/*!
    Constructs a new idle widget with the given \a parent.
*/
HsIdleWidget::HsIdleWidget(QGraphicsItem *parent)
  : HbWidget(parent),
    mControlLayer(0), mPageLayer(0), mPageWallpaperLayer(0),
    mSceneLayer(0),
    mTrashBin(0), mPageIndicator(0),
    mHorizontalSnapLine(0), mVerticalSnapLine(0)
{
    setFlag(ItemHasNoContents);

    loadControlLayer();

    QGraphicsLinearLayout *linearLayout = 0;

    linearLayout = new QGraphicsLinearLayout(Qt::Horizontal);
    linearLayout->setContentsMargins(0, 0, 0, 0);
    linearLayout->setSpacing(0);
    mPageLayer = new HbWidget(this);
    mPageLayer->setLayout(linearLayout);
    mPageLayer->setZValue(2);
    
    linearLayout = new QGraphicsLinearLayout(Qt::Horizontal);
    linearLayout->setContentsMargins(0, 0, 0, 0);
    linearLayout->setSpacing(0);
    mPageWallpaperLayer = new HbWidget(this);
    mPageWallpaperLayer->setLayout(linearLayout);
    mPageWallpaperLayer->setZValue(1);
    
    linearLayout = new QGraphicsLinearLayout(Qt::Horizontal);
    linearLayout->setContentsMargins(0, 0, 0, 0);
    linearLayout->setSpacing(0);
    mSceneLayer = new HbWidget(this);
    mSceneLayer->setLayout(linearLayout);
    mSceneLayer->setZValue(0);
}
MPannableViewport* StatusIndicatorMenuDropDownView::createPannableArea()
{
    // Create pannable area contents
    statusIndicatorExtensionArea = createVerticalExtensionArea();

    QGraphicsLinearLayout *contentLayout = new QGraphicsLinearLayout(Qt::Vertical);
    contentLayout->setContentsMargins(0, 0, 0, 0);
    contentLayout->setSpacing(0);
    contentLayout->addItem(statusIndicatorExtensionArea);

    MWidgetController *contentWidget = new MStylableWidget;
    contentWidget->setStyleName("StatusIndicatorMenuContentWidget");
    contentWidget->setLayout(contentLayout);

    QGraphicsLinearLayout *pannableLayout = new QGraphicsLinearLayout(Qt::Vertical);
    pannableLayout->setContentsMargins(0, 0, 0, 0);
    pannableLayout->setSpacing(0);
    pannableLayout->addItem(contentWidget);
    QGraphicsWidget *closeButtonRow = createCloseButtonRow();
    pannableLayout->addItem(closeButtonRow);
    pannableLayout->addStretch();

    // Create a container widget for the pannable area
    PannedWidgetController *pannedWidget = new PannedWidgetController;
    pannedWidget->setLayout(pannableLayout);
    pannedWidget->setBottommostWidget(closeButtonRow);
    connect(pannedWidget, SIGNAL(positionOrSizeChanged()), this, SLOT(setPannabilityAndLayout()));
    connect(pannedWidget, SIGNAL(pressedOutSideContents()), controller, SIGNAL(hideRequested()));

    // Setup the pannable viewport
    MPannableViewport *pannableViewport = new MPannableViewport;
    pannableViewport->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    pannableViewport->setWidget(pannedWidget);
    return pannableViewport;
}
void ToolBarPage::setupCheckBoxes()
{
    QGraphicsLinearLayout *layoutCheckboxes = new QGraphicsLinearLayout(Qt::Vertical);
    layoutCheckboxes->setContentsMargins(0, 0, 0, 0);
    layoutCheckboxes->setSpacing(0);

    visibleBackButton = new MButton();
    visibleBackButton->setObjectName("visibleBackButton");
    visibleBackButton->setStyleName(inv("CommonRightCheckBox"));
    visibleBackButton->setViewType(MButton::checkboxType);
    visibleBackButton->setCheckable(true);
    visibleBackButton->setChecked(true);
    connect(visibleBackButton, SIGNAL(toggled(bool)), this, SLOT(setBackButtonVisible(bool)));
    visibleBackButtonLabel = new MLabel();
    visibleBackButtonLabel->setObjectName("visibleBackButtonLabel");
    visibleBackButtonLabel->setStyleName(inv("CommonSingleTitle"));
    visibleBackButtonLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
    visibleBackButtonLabel->setWordWrap(false);
    visibleBackButtonLabel->setTextElide(true);

    visibleMenuButton = new MButton();
    visibleMenuButton->setObjectName("visibleMenuButton");
    visibleMenuButton->setStyleName(inv("CommonRightCheckBox"));
    visibleMenuButton->setViewType(MButton::checkboxType);
    visibleMenuButton->setCheckable(true);
    visibleMenuButton->setChecked(true);
    connect(visibleMenuButton, SIGNAL(toggled(bool)), this, SLOT(setMenuActionsVisible(bool)));
    visibleMenuButtonLabel = new MLabel();
    visibleMenuButtonLabel->setObjectName("visibleMenuButtonLabel");
    visibleMenuButtonLabel->setStyleName(inv("CommonSingleTitle"));
    visibleMenuButtonLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
    visibleMenuButtonLabel->setWordWrap(false);
    visibleMenuButtonLabel->setTextElide(true);

    QGraphicsLinearLayout *layoutBackCheckbox = new QGraphicsLinearLayout(Qt::Horizontal);
    layoutBackCheckbox->setContentsMargins(0, 0, 0, 0);
    layoutBackCheckbox->setSpacing(0);
    layoutBackCheckbox->addItem(visibleBackButtonLabel);
    layoutBackCheckbox->addItem(visibleBackButton);
    layoutBackCheckbox->setAlignment(visibleBackButtonLabel, Qt::AlignCenter);
    layoutBackCheckbox->setAlignment(visibleBackButton, Qt::AlignCenter);
    layoutCheckboxes->addItem(layoutBackCheckbox);

    QGraphicsLinearLayout *layoutMenuCheckbox = new QGraphicsLinearLayout(Qt::Horizontal);
    layoutMenuCheckbox->setContentsMargins(0, 0, 0, 0);
    layoutMenuCheckbox->setSpacing(0);
    layoutMenuCheckbox->addItem(visibleMenuButtonLabel);
    layoutMenuCheckbox->addItem(visibleMenuButton);
    layoutMenuCheckbox->setAlignment(visibleMenuButtonLabel, Qt::AlignCenter);
    layoutMenuCheckbox->setAlignment(visibleMenuButton, Qt::AlignCenter);
    layoutCheckboxes->addItem(layoutMenuCheckbox);

    containerPolicy->addItem(layoutCheckboxes);
}
StatusIndicatorMenuVerticalView::StatusIndicatorMenuVerticalView(StatusIndicatorMenu *controller) :
    MSceneWindowView(controller),
    controller(controller)
{
    // Create an extension area for the top row plugins
    MApplicationExtensionArea *extensionArea = new MApplicationExtensionArea("com.meego.core.MStatusIndicatorMenuExtensionInterface/1.0");
    connect(extensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), controller, SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*)));
    connect(extensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), this, SLOT(setExtensionLayoutPosition(MApplicationExtensionInterface*)));
    extensionArea->setObjectName("StatusIndicatorMenuExtensionArea");
    setSafeMode(extensionArea, QFile(CRASH_FILE).exists());
    extensionArea->init();

    // Add panning to the expension area
    MPannableViewport* viewport = new MPannableViewport();
    viewport->setWidget(extensionArea);
    viewport->setVerticalPanningPolicy(MPannableWidget::PanningAsNeeded);
    viewport->setStyleName("StatusIndicatorMenuViewport");
    viewport->positionIndicator()->setStyleName("CommonPositionIndicatorInverted");

    // Put the extension area to a horizontal layout
    QGraphicsLinearLayout *vlayout = new QGraphicsLinearLayout(Qt::Vertical);
    vlayout->setContentsMargins(0, 0, 0, 0);
    vlayout->setSpacing(0);
    vlayout->addItem(viewport);

    // Add a separator line on the bottom of the menu
    MStylableWidget *bottomSeparator = new MStylableWidget;
    bottomSeparator->setStyleName("StatusIndicatorMenuBottomSeparator");
    bottomSeparator->setLayoutPosition(M::VerticalTopPosition);
    vlayout->addItem(bottomSeparator);

    // Create a container widget for extension area and settings button layout
    containerWidget = new MStylableWidget;
    containerWidget->setStyleName("StatusIndicatorMenuExtensionAreaWidget");
    containerWidget->setLayout(vlayout);

    QGraphicsLinearLayout *hlayout = new QGraphicsLinearLayout(Qt::Horizontal);
    hlayout->setContentsMargins(0, 0, 0, 0);
    hlayout->setSpacing(0);
    hlayout->addStretch();
    hlayout->addItem(containerWidget);
    hlayout->addStretch();

    // Add a separator line on the right of the menu
    MStylableWidget *rightSeparator = new MStylableWidget;
    rightSeparator->setStyleName("StatusIndicatorMenuRightSeparator");
    rightSeparator->setLayoutPosition(M::HorizontalLeftPosition);
    hlayout->addItem(rightSeparator);

    controller->setLayout(hlayout);
    containerWidget->installEventFilter(this);
}
/*!
 Initializes UI. Everything that is not done in docml files should be here.
 return true if ok, in error false.
 */
void NmHsWidget::setupUi()
{
    NM_FUNCTION;

    //main level layout needed to control docml objects
    QGraphicsLinearLayout *widgetLayout = new QGraphicsLinearLayout(Qt::Vertical);
    widgetLayout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
            KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
    widgetLayout->setSpacing(KNmHsWidgetContentsMargin);
    widgetLayout->addItem(mMainContainer);
    this->setLayout(widgetLayout);

    //fetch pointer to content container layout
    //to be able to add/remove email rows and no mails label
    mContentLayout = (QGraphicsLinearLayout*) mContentContainer->layout();
    
    //set noMailsLabel properties not supported by doc loader 
    QColor newFontColor;
    newFontColor = HbColorScheme::color("qtc_hs_list_item_content_normal");
    mNoMailsLabel->setTextColor(newFontColor);
    mNoMailsLabel->setVisible(true);   
    
    mContentLayout->removeItem(mNoMailsLabel);
    
    //widget background
    mBackgroundFrameDrawer = new HbFrameDrawer(KNmHsWidgetBackgroundImage,
        HbFrameDrawer::NinePieces);
    HbFrameItem* backgroundLayoutItem = new HbFrameItem(mBackgroundFrameDrawer);
    //set to NULL to indicate that ownership transferred
    mBackgroundFrameDrawer = NULL;
    mWidgetContainer->setBackgroundItem(backgroundLayoutItem);
}
Example #6
0
QGraphicsWidget* Flights::graphicsWidget()
{
    if ( !m_container ) {
        m_container = new QGraphicsWidget( this );

        m_header = new Plasma::Label( m_container );
        m_header->setText( m_airport );
        QFont font = Plasma::Theme::defaultTheme()->font( Plasma::Theme::DefaultFont );
        font.setPointSize( 14 );
        m_header->setFont( font );
        m_header->setAlignment( Qt::AlignCenter );

        m_flightDepartureList = new FlightDepartureList( m_container );
        m_flightDepartureList->setPreferredSize( 300, 200 );

        QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout( this );
        mainLayout->addItem( m_container );
        mainLayout->setContentsMargins( 0, 0, 0, 0 );

        QGraphicsLinearLayout *containerLayout = new QGraphicsLinearLayout( Qt::Vertical, m_container );
        containerLayout->addItem( m_header );
        containerLayout->addItem( m_flightDepartureList );
        containerLayout->setContentsMargins( 0, 4, 0, 0 );
        containerLayout->setSpacing( 0 );

        registerAsDragHandle( m_header );
        registerAsDragHandle( m_flightDepartureList );
    }

    return m_container;
}
QGraphicsWidget* StatusIndicatorMenuDropDownView::createTopRow()
{
    // Create an extension area for the top row plugins
    settingsPluginsExtensionArea = new MApplicationExtensionArea("com.meego.core.MStatusIndicatorMenuExtensionInterface/1.0");
    connect(settingsPluginsExtensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)), controller, SLOT(setStatusIndicatorMenuInterface(MApplicationExtensionInterface*)));
    settingsPluginsExtensionArea->setObjectName("StatusIndicatorMenuTopRowExtensionArea");
    settingsPluginsExtensionArea->setInProcessFilter(QRegExp("/statusindicatormenu-(volume|alarms|internetconnection|presence|profile).desktop$"));
    settingsPluginsExtensionArea->setOutOfProcessFilter(QRegExp("$^"));
    settingsPluginsExtensionArea->setOrder((QStringList()  << "statusindicatormenu-volume.desktop" << "statusindicatormenu-alarms.desktop" << "statusindicatormenu-internetconnection.desktop" << "statusindicatormenu-presence.desktop" << "statusindicatormenu-profile.desktop"));

    // Create a button for accessing the full settings
    //% "Settings"
    MButton *settingsButton = new MButton(qtTrId("qtn_stat_menu_settings"));
    settingsButton->setObjectName("StatusIndicatorMenuTopRowExtensionButton");
    settingsButton->setViewType(MButton::iconType);
    settingsButton->setIconID("icon-m-status-menu-settings");
    connect(settingsButton, SIGNAL(clicked()), controller, SLOT(launchControlPanelAndHide()));

    // Put the extension area and the settings button to a horizontal layout
    QGraphicsLinearLayout *topRowLayout = new QGraphicsLinearLayout(Qt::Horizontal);
    topRowLayout->setContentsMargins(0, 0, 0, 0);
    topRowLayout->setSpacing(0);
    topRowLayout->addStretch();
    topRowLayout->addItem(settingsPluginsExtensionArea);
    topRowLayout->addItem(settingsButton);
    topRowLayout->addStretch();

    // Create a container widget for extension area and settings button layout
    MWidgetController *topRowWidget = new MStylableWidget;
    topRowWidget->setStyleName("StatusIndicatorMenuExtensionAreaWidget");
    topRowWidget->setLayout(topRowLayout);

    return topRowWidget;
}
Example #8
0
void IconApplet::init()
{
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);

    layout->addItem(m_icon);

    KConfigGroup cg = config();

    if (m_url.isValid()) {
        // we got this in via the ctor, e.g. as a result of a drop
        cg.writeEntry("Url", m_url);
        emit configNeedsSaving();
    } else {
        configChanged();
    }

    setDisplayLines(2);
    registerAsDragHandle(m_icon);
    setAspectRatioMode(Plasma::ConstrainedSquare);

    connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)),
        this, SLOT(iconSizeChanged(int)));
}
Example #9
0
AlbumsFilterBar::AlbumsFilterBar( QGraphicsItem *parent, Qt::WindowFlags wFlags )
    : QGraphicsWidget( parent, wFlags )
    , m_editor( new KLineEdit )
    , m_closeIcon( new Plasma::IconWidget( KIcon("dialog-close"), QString(), this ) )
{
    QGraphicsProxyWidget *editProxy = new QGraphicsProxyWidget( this );
    editProxy->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
    editProxy->setWidget( m_editor );

    m_editor->installEventFilter( this );
    m_editor->setAttribute( Qt::WA_NoSystemBackground );
    m_editor->setAutoFillBackground( true );
    m_editor->setClearButtonShown( true );
    m_editor->setClickMessage( i18n( "Filter Albums" ) );
    m_editor->setContentsMargins( 0, 0, 0, 0 );

    QSizeF iconSize = m_closeIcon->sizeFromIconSize( 16 );
    m_closeIcon->setMaximumSize( iconSize );
    m_closeIcon->setMinimumSize( iconSize );

    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout( Qt::Horizontal, this );
    layout->setSpacing( 1 );
    layout->addItem( editProxy );
    layout->addItem( m_closeIcon );
    layout->setStretchFactor( editProxy, 100 );
    layout->setAlignment( editProxy, Qt::AlignCenter );
    layout->setAlignment( m_closeIcon, Qt::AlignCenter );
    layout->setContentsMargins( 0, 2, 0, 0 );

    m_closeIcon->setToolTip( i18n( "Close" ) );
    connect( m_closeIcon, SIGNAL(clicked()), SIGNAL(closeRequested()) );
    connect( m_editor, SIGNAL(textChanged(QString)), SIGNAL(filterTextChanged(QString)) );
}
Example #10
0
void HGLayout::setSpacing(int s)
{
    HLayout::setSpacing(s);

    QGraphicsLayout* ll = layout();
    if (!ll) return ;

    switch (layoutType()) {
    case HEnums::kVBox:
    case HEnums::kHBox: {
        QGraphicsLinearLayout* l = static_cast<QGraphicsLinearLayout*>(ll);
        l->setSpacing(s);
        break;
    }
    case HEnums::kGrid: {
        QGraphicsGridLayout* l = static_cast<QGraphicsGridLayout*>(ll);
        l->setSpacing(s);
        break;
    }
    case HEnums::kAnchor: {
        QGraphicsAnchorLayout* l = static_cast<QGraphicsAnchorLayout*>(ll);
        l->setSpacing(s);
        break;
    }
    default:
        break;
    }
}
NotificationAreaView::NotificationAreaView(NotificationArea *controller) :
    MWidgetView(controller),
    bannerLayout(new MLayout()),
    clearButtonLayout(new QGraphicsLinearLayout(Qt::Horizontal)),
    //% "Clear"
    clearButton(new MButton(qtTrId("qtn_noti_clear"))),
    andMore(new MStylableWidget)
{
    // Set up the main layout
    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
    mainLayout->setContentsMargins(0, 0, 0, 0);
    mainLayout->setSpacing(0);
    mainLayout->addItem(bannerLayout);
    mainLayout->addItem(andMore);
    mainLayout->addItem(clearButtonLayout);
    controller->setLayout(mainLayout);

    // Set up the banner layout
    bannerPolicy = new MLinearLayoutPolicy(bannerLayout, Qt::Vertical);
    bannerPolicy->setStyleName("NotificationAreaBannerLayoutPolicy");
    bannerLayout->setContentsMargins(0, 0, 0, 0);
    bannerLayout->setPolicy(bannerPolicy);

    // Create the "and more" area
    andMore->setStyleName("AndMore");
    andMore->setVisible(false);
    //% "And more"
    MLabel *andMoreLabel = new MLabel(qtTrId("qtn_noti_and_more"));
    andMoreLabel->setStyleName("AndMoreLabel");
    QGraphicsLinearLayout *andMoreLayout = new QGraphicsLinearLayout(Qt::Horizontal);
    andMoreLayout->setContentsMargins(0, 0, 0, 0);
    andMoreLayout->setSpacing(0);
    andMoreLayout->addStretch();
    andMoreLayout->addItem(andMoreLabel);
    andMore->setLayout(andMoreLayout);

    // Put a clear button into the clear button layout
    clearButtonLayout->setContentsMargins(0, 0, 0, 0);
    clearButtonLayout->setSpacing(0);
    clearButton->setStyleName("NotificationAreaClearButton");
    connect(clearButton, SIGNAL(clicked()), controller, SLOT(removeAllRemovableBanners()));
    clearButtonLayout->addStretch();
    clearButtonLayout->addItem(clearButton);
    clearButtonLayout->addStretch();
}
Example #12
0
QGraphicsWidget *StackFolder::graphicsWidget()
{
    if (m_graphicsWidget) {
        return m_graphicsWidget;
    }

    setAcceptDrops(true);

    PreviewGenerator *previewGenerator = PreviewGenerator::createInstance();
    previewGenerator->setPlugins(m_previewPlugins);

    TypeImageProvider *typeImageProvider = new TypeImageProvider();
    ModeImageProvider *modeImageProvider = new ModeImageProvider();
    PreviewImageProvider *previewImageProvider = new PreviewImageProvider();

    m_viewer = new Viewer;

    m_directory = new Directory(this);
    m_directory->setModel(m_model);
    m_directory->setTopUrl(m_url);
    m_directory->setUrl(m_url);
    connect(m_directory, SIGNAL(fileActivated()), this, SLOT(fileActivated()));
    connect(m_directory, SIGNAL(dataAdded(const QModelIndex&, int, int)), this, SLOT(dataAdded(const QModelIndex&, int, int)));
    connect(m_directory, SIGNAL(viewerRequested(const QString&, int, int, int, int)), this, SLOT(runViewer(const QString&, int, int, int, int)));
    connect(m_directory, SIGNAL(viewerCanceled()), this, SLOT(stopViewer()));
    connect(m_directory, SIGNAL(activatedDragAndDrop(const KFileItem&)), this, SLOT(activatedDragAndDrop(const KFileItem&)));

    qmlRegisterType<File>("File", 1, 0, "File");
    qmlRegisterType<QGraphicsDropShadowEffect>("Effects", 1, 0, "DropShadow");

    QDeclarativeEngine *m_engine = new QDeclarativeEngine;
    m_engine->addImageProvider("type", typeImageProvider);
    m_engine->addImageProvider("mode", modeImageProvider);
    m_engine->addImageProvider("preview", previewImageProvider);
    m_engine->rootContext()->setContextProperty("directory", m_directory);
    QString qmlMainFilePath = KStandardDirs::locate("data", "plasma/packages/org.kde.stackfolder/contents/ui/main.qml");
    QDeclarativeComponent component(m_engine, QUrl::fromLocalFile(qmlMainFilePath));
    QObject *object = component.create();
    QGraphicsLayoutItem *graphicsObject = qobject_cast<QGraphicsLayoutItem*>(object);

    QObject::connect(object, SIGNAL(currentChanged()), m_viewer, SLOT(stop()));

    m_layout = new QGraphicsLinearLayout(Qt::Vertical);
    m_layout->setContentsMargins(10, 0, 10, 0);
    m_layout->addItem(graphicsObject);


    m_graphicsWidget = new QGraphicsWidget(this);
    m_graphicsWidget->setLayout(m_layout);

    QGraphicsLinearLayout *lay = dynamic_cast<QGraphicsLinearLayout *>(layout());
    //lay->setContentsMargins(3, 0, 3, 6);
    lay->setContentsMargins(0, 0, 0, 0);
    lay->setSpacing(0);

    return m_graphicsWidget;
}
Example #13
0
bool Hdd::addVisualization(const QString& source)
{
    Plasma::Meter *w;
    Plasma::DataEngine *engine = dataEngine("soliddevice");
    Plasma::DataEngine::Data data;

    if (!engine) {
        return false;
    }
    if (!isValidDevice(source, &data)) {
        // do not try to show hard drives and swap partitions.
        return false;
    }
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
    layout->setContentsMargins(3, 3, 3, 3);
    layout->setSpacing(5);

    w = new Plasma::Meter(this);
    w->setMeterType(Plasma::Meter::BarMeterHorizontal);
    if (mode() != SM::Applet::Panel) {
        MonitorIcon *icon = new MonitorIcon(this);
        m_icons.insert(source, icon);
        icon->setImage("drive-harddisk");
        if (data["Accessible"].toBool()) {
            QStringList overlays;
            overlays << QString("emblem-mounted");
            icon->setOverlays(overlays);
        }
        layout->addItem(icon);
    } else {
        w->setSvg("system-monitor/hdd_panel");
    }
    w->setLabel(0, hddTitle(source, data));
    w->setLabelAlignment(0, Qt::AlignVCenter | Qt::AlignLeft);
    w->setLabelAlignment(1, Qt::AlignVCenter | Qt::AlignRight);
    w->setLabelAlignment(2, Qt::AlignVCenter | Qt::AlignCenter);
    w->setMaximum(data["Size"].toULongLong() / (1024 * 1024));
    applyTheme(w);
    appendVisualization(source, w);
    layout->addItem(w);
    mainLayout()->addItem(layout);
    dataUpdated(source, data);
    setPreferredItemHeight(layout->preferredSize().height());

    QString disk = data["Parent UDI"].toString();

    m_diskMap[disk] << w;
    if (!connectedSources().contains(disk)) {
        data = engine->query(disk);
        dataUpdated(disk, data);
        connectSource(disk);
    }
    return true;
}
Example #14
0
void KWidget::setSpacing( int space )
{
    QGraphicsLayout *tmpLayout = layout();
    if(d_func()->layoutType == VBox || d_func()->layoutType == HBox)
    {
        QGraphicsLinearLayout *boxLayout = dynamic_cast<QGraphicsLinearLayout*>(tmpLayout);
        if(boxLayout)
        {
            return boxLayout->setSpacing(space);
        }
    }
}
Example #15
0
RtdScheduleApplet::RtdScheduleApplet(QObject *parent, const QVariantList& args)
    : Plasma::Applet(parent, args)
{
    m_label = new Plasma::Label(this);

    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    layout->addItem(m_label);

    setBackgroundHints(DefaultBackground);
    resize(170, 150);
}
Example #16
0
TabsView::TabsView( QGraphicsWidget *parent )
    : QGraphicsProxyWidget( parent )
{
    // tree view which holds the collection of fetched tabs
    m_treeView = new TabsTreeView( 0 );
    connect( m_treeView, SIGNAL( clicked( const QModelIndex & ) ),
             this, SLOT( itemClicked( const QModelIndex & ) ) );

    m_model = new QStandardItemModel();
    m_model->setColumnCount( 1 );
    m_treeView->setModel( m_model );

    m_treeProxy = new QGraphicsProxyWidget( this );
    m_treeProxy->setWidget( m_treeView );

    // the textbrowser widget to display the tabs
    m_tabTextBrowser = new Plasma::TextBrowser( );
    KTextBrowser *browserWidget = m_tabTextBrowser->nativeWidget();
    browserWidget->setFrameShape( QFrame::StyledPanel );
    browserWidget->setAttribute( Qt::WA_NoSystemBackground );
    browserWidget->setOpenExternalLinks( true );
    browserWidget->setUndoRedoEnabled( true );
    browserWidget->setAutoFillBackground( false );
    browserWidget->setWordWrapMode( QTextOption::NoWrap );
    browserWidget->viewport()->setAutoFillBackground( true );
    browserWidget->viewport()->setAttribute( Qt::WA_NoSystemBackground );
    browserWidget->setTextInteractionFlags( Qt::TextBrowserInteraction | Qt::TextSelectableByKeyboard );

    QScrollBar *treeScrollBar = m_treeView->verticalScrollBar();
    m_scrollBar = new Plasma::ScrollBar( this );
    m_scrollBar->setFocusPolicy( Qt::NoFocus );

    // synchronize scrollbars
    connect( treeScrollBar, SIGNAL( rangeChanged( int, int ) ), SLOT( slotScrollBarRangeChanged( int, int ) ) );
    connect( treeScrollBar, SIGNAL( valueChanged( int ) ), m_scrollBar, SLOT( setValue( int ) ) );
    connect( m_scrollBar, SIGNAL( valueChanged( int ) ), treeScrollBar, SLOT( setValue( int ) ) );
    m_scrollBar->setRange( treeScrollBar->minimum(), treeScrollBar->maximum() );
    m_scrollBar->setPageStep( treeScrollBar->pageStep() );
    m_scrollBar->setSingleStep( treeScrollBar->singleStep() );

    // arrange textbrowser and treeview in a horizontal layout
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout( Qt::Horizontal );
    layout->addItem( m_treeProxy );
    layout->addItem( m_scrollBar );
    layout->addItem( m_tabTextBrowser );
    layout->setSpacing( 2 );
    layout->setContentsMargins( 0, 0, 0, 0 );
    setLayout( layout );
    setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
    updateScrollBarVisibility();
}
Example #17
0
SessionWidget::SessionWidget( QGraphicsItem * parent, Qt::WindowFlags wFlags)
  : QGraphicsWidget ( parent, wFlags)
{
  this->setFocusPolicy(Qt::ClickFocus);

   m_signalMapper = new QSignalMapper(this);

  QGraphicsLinearLayout* mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
  mainLayout->setSpacing(0);
  mainLayout->addStretch();
  this->setLayout(mainLayout);

  connect( m_signalMapper, SIGNAL(mapped(int)),
           this, SLOT(slotSwitchSession(int)));

  Q_ASSERT(mainLayout->count() == 0);

  //Cache the icon pixmaps
  QSize iconSize = QSize(KIconLoader::SizeSmallMedium, KIconLoader::SizeSmallMedium);

  SessList sessions;
  KDisplayManager manager;
  manager.localSessions(sessions);

  QList<QGraphicsWidget*> entries;

  foreach(SessEnt session, sessions) {
    QPixmap pixmap;
    KUser user (session.user);
    if (!user.isValid())
      continue;

    if (session.tty)
      continue;

    Plasma::IconWidget* entry = createButton(this);
    pixmap = getUserIcon(user);

    entry->setIcon(pixmap);

    QString username = getUsername(false, user);
    entry->setText(username);

    connect(entry, SIGNAL(clicked()), m_signalMapper, SLOT(map()));
    m_signalMapper->setMapping(entry, session.vt);

    if (session.self)
      entry->setEnabled(false);

    entries << entry;
  }
Example #18
0
void SpellCheck::init()
{
    Plasma::IconWidget *icon = new Plasma::IconWidget(KIcon("tools-check-spelling"), QString(), this);

    registerAsDragHandle(icon);

    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    layout->addItem(icon);

    Plasma::ToolTipManager::self()->setContent(this, Plasma::ToolTipContent(i18n("Spell Checking"), i18n("Check spelling of clipboard contents."), icon->icon().pixmap(IconSize(KIconLoader::Desktop))));

    connect(this, SIGNAL(activate()), this, SLOT(toggleDialog()));
    connect(icon, SIGNAL(clicked()), this, SLOT(toggleDialog()));
}
MWidgetController *MSettingsLanguageSettingsFactory::createWidget(const MSettingsLanguageSettings &settingsItem, MSettingsLanguageWidget &rootWidget, MDataStore *dataStore)
{
    // Create content layout to layout content items in
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);

    MStylableWidget *widget = new MStylableWidget;
    widget->setStyleName("MSettingsLanguage");
    widget->setLayout(layout);

    createChildren(layout, settingsItem, rootWidget, dataStore);
    layout->addStretch();

    return widget;
}
void ToolBarPage::setupSliders()
{
    QGraphicsLinearLayout *layoutSliders = new QGraphicsLinearLayout(Qt::Vertical);
    layoutSliders->setContentsMargins(0, 0, 0, 0);
    layoutSliders->setSpacing(0);

    maxToolsLabel = new MLabel;
    maxToolsLabel->setObjectName("maxToolsLabel");
    maxToolsLabel->setStyleName(inv("CommonFieldLabel"));
    maxToolsLabel->setTextElide(true);
    layoutSliders->addItem(maxToolsLabel);
    maxToolsSlider = new MSlider;
    maxToolsSlider->setObjectName("maxToolsSlider");
    maxToolsSlider->setStyleName(inv("CommonSlider"));
    maxToolsSlider->setRange(0, 5);
    maxToolsSlider->setValue(2);
    maxToolsSlider->setMinLabelVisible(false);
    maxToolsSlider->setMaxLabelVisible(false);
    maxToolsSlider->setHandleLabelVisible(true);
    maxToolsSlider->setMinLabel(QString::number(maxToolsSlider->minimum()));
    maxToolsSlider->setMaxLabel(QString::number(maxToolsSlider->maximum()));
    QObject::connect(maxToolsSlider, SIGNAL(valueChanged(int)), this, SLOT(updateTools(int)));
    layoutSliders->addItem(maxToolsSlider);

    maxTabsLabel = new MLabel;
    maxTabsLabel->setObjectName("maxTabsLabel");
    maxTabsLabel->setStyleName(inv("CommonFieldLabel"));
    maxTabsLabel->setTextElide(true);
    layoutSliders->addItem(maxTabsLabel);
    maxTabsSlider = new MSlider;
    maxTabsSlider->setObjectName("maxTabsSlider");
    maxTabsSlider->setStyleName(inv("CommonSlider"));
    maxTabsSlider->setRange(0, 4);
    maxTabsSlider->setValue(3);
    maxTabsSlider->setMinLabelVisible(false);
    maxTabsSlider->setMaxLabelVisible(false);
    maxTabsSlider->setHandleLabelVisible(true);
    maxTabsSlider->setMinLabel(QString::number(maxTabsSlider->minimum()));
    maxTabsSlider->setMaxLabel(QString::number(maxTabsSlider->maximum()));
    QObject::connect(maxTabsSlider, SIGNAL(valueChanged(int)), this, SLOT(updateTabs(int)));
    layoutSliders->addItem(maxTabsSlider);

    containerPolicy->addItem(layoutSliders);
}
Example #21
0
MToggleWidget::MToggleWidget(QGraphicsItem *parent, QImage icon, QString iconId, bool isToggle) :
    MWidget(parent),
    m_stateImage(NULL)
{
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, this);
    MFeedback* feedback = new MFeedback(FEEDBACK_PATTERN, this);
    connect(this, SIGNAL(pressed()), feedback, SLOT(play()));

    m_iconWidget = new MImageWidget(this);
    m_iconWidget->setAspectRatioMode(Qt::KeepAspectRatio);
    m_iconWidget->setMinimumSize(64, 64);
    m_iconWidget->setMaximumSize(64, 64);

    setMinimumSize(80, 80);
    setMaximumSize(80, 80);

    bool weHaveAnImage = false;

    if (!iconId.isEmpty()) {
        weHaveAnImage = true;
        m_iconWidget->setImage(iconId);
    }

    if (!icon.isNull() && !weHaveAnImage) {
        weHaveAnImage = true;
        m_iconWidget->setImage(icon);
    }

    layout->addItem(m_iconWidget);
    layout->setSpacing(0.1);

    if (isToggle) {
        m_stateImage = new MImageWidget(this);
        m_stateImage->setMinimumSize(60, 20);
        m_stateImage->setMaximumSize(60, 20);
        m_stateImage->setAspectRatioMode(Qt::KeepAspectRatio);
        m_stateImage->setImage(QImage(OFF_SWITCH));
        layout->addItem(m_stateImage);
        layout->setAlignment(m_stateImage, Qt::AlignHCenter);
    } else {
        layout->addStretch();
    }
}
void MAdvancedListItemPrivate::createLayout()
{
    Q_Q(MAdvancedListItem);

    switch (listItemStyle) {
    case MAdvancedListItem::IconWithTitleProgressIndicatorAndTwoSideIcons: {
            layout()->addItem(q->imageWidget(), 0, 0, 3, 1);

            layout()->addItem(q->titleLabelWidget(), 0, 1);
            layout()->addItem(q->progressIndicator(), 1, 1);

            QGraphicsWidget * panel = new QGraphicsWidget(q);
            QGraphicsLinearLayout * panelLayout = new QGraphicsLinearLayout(Qt::Vertical);
            panelLayout->setContentsMargins(0, 0, 0, 0);
            panelLayout->setSpacing(0);
            panel->setLayout(panelLayout);

            q->sideTopImageWidget()->setParentItem(panel);
            q->sideBottomImageWidget()->setParentItem(panel);

            panelLayout->addItem(q->sideTopImageWidget());
            panelLayout->addItem(q->sideBottomImageWidget());

            layout()->addItem(panel, 0, 2, 3, 1, Qt::AlignVCenter);
            layout()->addItem(new QGraphicsWidget(q), 2, 1);

            break;
        }
    case MAdvancedListItem::IconWithTitleProgressIndicatorAndTopSideIcon: {
            q->sideTopImageWidget()->setParentItem(q);
            q->sideBottomImageWidget()->setParentItem(q);

            layout()->addItem(q->imageWidget(), 0, 0, 3, 1);
            layout()->addItem(q->titleLabelWidget(), 0, 1);
            layout()->addItem(q->progressIndicator(), 1, 1, 1, 2);
            layout()->addItem(q->sideTopImageWidget(), 0, 2, Qt::AlignBottom);
            layout()->addItem(new QGraphicsWidget(q), 2, 1);
            break;
        }
    default:
        break;
    }
}
void IrHsWidgetTitleRow::loadUi()
{
    LOG_METHOD;
    IRHsWidgetUiLoader loader;
    loader.load(KIrHsWidgetTitleRowDocML);

    //Create layout
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);

    layout->setContentsMargins(KIrHsWidgetContentsMargin, KIrHsWidgetContentsMargin,
        KIrHsWidgetContentsMargin, KIrHsWidgetContentsMargin);
    layout->setSpacing(KIrHsWidgetContentsMargin);
    setLayout(layout);
    
    QGraphicsWidget *container = loader.findWidget(KIrHsWidgetTitleRowContainer);
    layout->addItem(container);

    mStationLogo = static_cast<HbLabel*> (loader.findWidget(KIrHsWidgetStationLogo));
    mStationName = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetStationName));
    mStationName->setTextColor(HbColorScheme::color(KStationNameColor));         
}
Example #24
0
void WindowList::init()
{
    Plasma::IconWidget *icon = new Plasma::IconWidget(KIcon("preferences-system-windows"), QString(), this);

    m_listMenu = new KWindowListMenu;
    m_listMenu->installEventFilter(this);

    registerAsDragHandle(icon);

    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    layout->addItem(icon);

    Plasma::ToolTipManager::self()->setContent(this, Plasma::ToolTipContent(i18n("Window list"), i18n("Show list of opened windows"), KIcon("preferences-system-windows").pixmap(IconSize(KIconLoader::Desktop))));

    connect(this, SIGNAL(activate()), this, SLOT(showMenu()));
    connect(this, SIGNAL(destroyed()), m_listMenu, SLOT(deleteLater()));
    connect(icon, SIGNAL(clicked()), this, SLOT(showMenu()));
    connect(m_listMenu, SIGNAL(triggered(QAction*)), this, SLOT(triggered(QAction*)));
}
MyNavBarContent::MyNavBarContent(QGraphicsItem *parent)
    : QGraphicsWidget(parent), d(new MyNavBarContentPrivate(this))
{
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    setLayout(layout);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

    MSlider *slider = new MSlider;
    slider->setRange(0, 100);
    slider->setMinLabelVisible(true);
    slider->setMaxLabelVisible(true);
    slider->setHandleLabelVisible(true);
    layout->addItem(slider);

    MButton *okButton = new MButton("OK");
    okButton->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    okButton->setStyleName("ToolBarLabelOnlyCommonButton");
    connect(okButton, SIGNAL(clicked()), SIGNAL(okClicked()));
    layout->addItem(okButton);
}
void LoginSheet::createCentralWidget()
{
    QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical,
                                                                  centralWidget());
    mainLayout->setContentsMargins(0,0,0,0);
    mainLayout->setSpacing(0);

    //% "Connect to Service"
    MLabel *label = new MLabel(qtTrId("xx_wg_sheets_connect_service"));
    label->setStyleName("CommonTitle");
    label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
    mainLayout->addItem(label);

    mainLayout->addItem(createSpacer());

    //% "Username:"******"xx_wg_sheets_username"));
    label->setStyleName("CommonFieldLabel");

    mainLayout->addItem(label);

    userNameTextEdit = new MTextEdit;
    userNameTextEdit->setStyleName("CommonSingleInputFieldLabeled");
    mainLayout->addItem(userNameTextEdit);

    mainLayout->addItem(createSpacer());

    //% "Password:"******"xx_wg_sheets_password"));
    label->setStyleName("CommonFieldLabel");
    mainLayout->addItem(label);

    MTextEdit *textEdit = new MTextEdit;
    textEdit->setStyleName("CommonSingleInputFieldLabeled");
    textEdit->setEchoMode(MTextEditModel::Password);
    mainLayout->addItem(textEdit);

    mainLayout->addStretch();
}
void StatusIndicatorMenuDropDownView::applyStyle()
{
    MSceneWindowView::applyStyle();

    if (pannableViewport == NULL) {
        QGraphicsAnchorLayout *backgroundLayout = new QGraphicsAnchorLayout;
        backgroundLayout->setContentsMargins(0, 0, 0, 0);
        backgroundLayout->setSpacing(0);
        backgroundLayout->addCornerAnchors(backgroundWidget, Qt::TopLeftCorner, backgroundLayout, Qt::TopLeftCorner);
        backgroundLayout->setMaximumHeight(0);

        // Put all the stuff into the scene window layout
        pannableViewport = createPannableArea();
        topRowWidget = createTopRow();
        QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
        layout->setContentsMargins(0, 0, 0, 0);
        layout->setSpacing(0);
        layout->addItem(topRowWidget);
        layout->addItem(backgroundLayout);
        layout->addItem(pannableViewport);
        controller->setLayout(layout);
    }
}
MOverlay *StatusIndicatorMenuDropDownView::createCloseButtonOverlay()
{
    // Create a close button
    MButton *closeButton = new MButton;
    closeButton->setViewType("icon");
    closeButton->setObjectName("StatusIndicatorMenuCloseButton");
    closeButton->setIconID("icon-m-framework-close");
    connect(closeButton, SIGNAL(clicked()), controller, SIGNAL(hideRequested()));

    // Add two overlay widgets that will not allow mouse events to pass through them next to the close button
    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Horizontal);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    layout->addItem(new EventEaterWidget);
    layout->addItem(closeButton);
    layout->addItem(new EventEaterWidget);

    // Create the overlay itself
    MOverlay *closeButtonOverlay = new MOverlay;
    closeButtonOverlay->setLayout(layout);
    closeButtonOverlay->setObjectName("CloseButtonOverlay");

    return closeButtonOverlay;
}
void
ThemeWidget::createWidgets ()
{
    QGraphicsLinearLayout *mainLayout;
    
    /*
     * Creating and setting up the main layout
     */
    mainLayout = new QGraphicsLinearLayout(Qt::Vertical);
    mainLayout->setContentsMargins (0., 0., 0., 0.);
    mainLayout->setSpacing (0.);

    /*
     * Creating the list with the available themes.
     */
    m_List = new MList();
    m_List->setObjectName ("ThemeList");

    // We only connect the themeChangeStarted if we have a chance to sense the
    // end of the theme change too. just to be sure.
    if (connect (m_ThemeBusinessLogic, SIGNAL (themeChanged (QString)),
                 SLOT (enableList ()))) {
        connect (m_ThemeBusinessLogic, SIGNAL (themeChangeStarted (QString)),
                 SLOT (disableList ()));
    }
    
    // Cellcreator
    m_CellCreator = new ThemeCellCreator;
    m_List->setCellCreator (m_CellCreator);
    m_List->setSelectionMode (MList::SingleSelection);

    // This function will create the m_LiveFilterEditor widget.
    readLocalThemes ();

    /*
     * An item to activate the OVI link.
     */
    m_OviItem = new MBasicListItem (MBasicListItem::IconWithTitle);
    m_OviItem->setObjectName("OviItem");

    // Currently we use the default.
    //m_OviItem->setLayoutPosition (M::VerticalCenterPosition);
    m_OviItem->imageWidget()->setImage ("icon-m-common-ovi");

    /*
     * Adding everything to the layout.
     */
    m_LiveFilterEditor->setParentLayoutItem (mainLayout);
    mainLayout->addItem (m_OviItem);
    mainLayout->addItem (m_List);

    /*
     * Connecting to the signals.
     */
    connect (m_OviItem, SIGNAL(clicked()),
            this, SLOT(oviActivated()));
    connect (m_LiveFilterEditor, SIGNAL(textChanged()),
            this, SLOT(textChanged ()));
    connect (m_List, SIGNAL(panningStarted()),
            this, SLOT(hideEmptyTextEdit()));
    connect (m_ThemeBusinessLogic, SIGNAL(refreshNeeded()),
            this, SLOT(refreshNeeded ()));

    setLayout(mainLayout);
    retranslateUi ();
}
void PeopleGroupedView::insertCard(const QModelIndex& index) {
    // requires: model is sorted in alphabetical order
    QGraphicsLinearLayout *linear;

    SEASIDE_SHORTCUTS
    SEASIDE_SET_MODEL_AND_ROW(m_itemModel, index.row());
    QString name = SEASIDE_FIELD(FirstName, String);
    bool isSelf = SEASIDE_FIELD(isSelf, Bool);

    int section;

    //if MeCard section 0, else shift other sections down one
    if(isSelf)
        section = 0;
    else
        section = findSection(name, m_headings)+1;

    // if this is the first item in the section, add the heading
    if (m_sectionCounts[section] == 0) {
        // items from before the first heading go in an "Other" section at the beginning
        QString heading;
        if (section > 1)
            heading = m_displayHeadings[section-2];
        else if(section == 1)
            heading = "Other";  // TODO: i18n
        else
            heading = "Me";
        linear = new QGraphicsLinearLayout(Qt::Vertical);
        linear->setContentsMargins(0, 0, 0, 0);
        linear->setSpacing(0);

        m_mainLayout->addItem(linear, section, 0);
        linear->addItem(createHeader(heading));
    }

    m_sectionCounts[section]++;

    qDebug() << "section " << section << " sectionCount " << m_sectionCounts[section];

    linear = static_cast<QGraphicsLinearLayout *>(m_mainLayout->itemAt(section, 0));
    SeasidePersonCard *card = new SeasidePersonCard(index);

    int i;
    int count = linear->count();
    for (i=1; i<count; i++) {
        SeasidePersonCard *existing = static_cast<SeasidePersonCard *>(linear->itemAt(i));
        if (existing->name().localeAwareCompare(name) > 0)
            break;
    }
     qDebug() << "item at " << i;
    linear->insertItem(i, card);

    QObject::connect(card, SIGNAL(requestDetails(QModelIndex)),
                     m_controller, SIGNAL(itemClicked(QModelIndex)),
                     Qt::UniqueConnection);

    /*QObject::connect(card, SIGNAL(requestEdit(QModelIndex)),
                     m_controller, SIGNAL(editRequest(QModelIndex)),
                     Qt::UniqueConnection);*/

    QObject::connect(card, SIGNAL(requestSetFavorite(const QUuid&,bool)),
                     m_controller, SLOT(setFavorite(const QUuid&,bool)),
                     Qt::UniqueConnection);

    QObject::connect(card, SIGNAL(requestDelete(const QUuid&)),
                     m_controller, SLOT(deletePerson(const QUuid&)),
                     Qt::UniqueConnection);

    QObject::connect(card, SIGNAL(callNumber(const QString&)),
                     m_controller, SIGNAL(callNumber(const QString&)),
                     Qt::UniqueConnection);

    QObject::connect(card, SIGNAL(composeSMS(const QString&)),
                     m_controller, SIGNAL(composeSMS(const QString&)),
                     Qt::UniqueConnection);

    QObject::connect(card, SIGNAL(composeIM(const QString&)),
                     m_controller, SIGNAL(composeIM(const QString&)),
                     Qt::UniqueConnection);

    QObject::connect(card, SIGNAL(composeEmail(const QString&)),
                     m_controller, SIGNAL(composeEmail(const QString&)),
                     Qt::UniqueConnection);
}