void SuggestAnAppPage::initializePageContent()
{
    ui->setupUi(this);

    ui->mainLayout->setContentsMargins(0, 0, 0, 0);
    ui->mainLayout->setSpacing(3);

    GuiConfigurationManager *guiConfManager = GlobalObjectRegistry::sharedGlobalObjectRegistry()->getGuiConfigurationManager();

    InContentNavigationWidget *inContentNavigationWidget = new InContentNavigationWidget(tr("Go to Options"));
    connect(inContentNavigationWidget, SIGNAL(backButtonClicked()), this, SLOT(_backButtonPressed()));
    ui->mainLayout->insertWidget(0, inContentNavigationWidget);

    ui->contentLayout->setContentsMargins(guiConfManager->getMarginsForId("PageWidget/Default/contentMargins"));

    this->setStyleSheet(guiConfManager->getStyleForId("Widget/Default/Background/style"));

    ui->appNameLabel->setStyleSheet(guiConfManager->getStyleForId("Label/Default/DarkDarkGray/style"));
    ui->appNameLineEdit->setStyleSheet(guiConfManager->getStyleForId("LineEdit/Default/Gray/style"));
    ui->urlLabel->setStyleSheet(guiConfManager->getStyleForId("Label/Default/DarkDarkGray/style"));
    ui->urlLineEdit->setStyleSheet(guiConfManager->getStyleForId("LineEdit/Default/Gray/style"));

    ui->summaryLabel->setStyleSheet(guiConfManager->getStyleForId("Label/Default/DarkDarkGray/style"));
    ui->summaryTextEdit->setStyleSheet(guiConfManager->getStyleForId("TextEdit/Default/LightGray/style"));
    ui->sendButton->setStyleSheet(guiConfManager->getStyleForId("Button/Default/NormalPriority/style"));
    ui->sendButton->setFlat(true);

    connect(ui->sendButton, SIGNAL(clicked()), this, SLOT(_sendButtonPressed()));
}
Example #2
0
AddFeedWizard::AddFeedWizard(QWidget *parent, int curFolderId)
  : QWizard(parent),
    curFolderId_(curFolderId)
{
  setWindowFlags (windowFlags() & ~Qt::WindowContextHelpButtonHint);
  setWindowTitle(tr("Add Feed"));
  setWizardStyle(QWizard::ModernStyle);
  setOptions(QWizard::HaveFinishButtonOnEarlyPages |
             QWizard::NoBackButtonOnStartPage);

  addPage(createUrlFeedPage());
  addPage(createNameFeedPage());

  updateFeeds_ = new UpdateFeeds(this, true);

  connect(button(QWizard::BackButton), SIGNAL(clicked()),
          this, SLOT(backButtonClicked()));
  connect(button(QWizard::NextButton), SIGNAL(clicked()),
          this, SLOT(nextButtonClicked()));
  connect(button(QWizard::FinishButton), SIGNAL(clicked()),
          this, SLOT(finishButtonClicked()));
  connect(this, SIGNAL(currentIdChanged(int)),
          SLOT(slotCurrentIdChanged(int)),
          Qt::QueuedConnection);
  resize(400, 300);

  Settings settings;
  restoreGeometry(settings.value("addFeedWizard/geometry").toByteArray());
}
DocumentPage::DocumentPage(const QString& filePath, QGraphicsItem *parent)
    : MApplicationPage(parent)
    , currentPage(1)
    , m_pinchInProgress(false)
    , m_endScale(1.0)
    , m_blockRecenter(false)
    , pageLoaded(false)
    , m_defaultZoomLevelAction(ActionPool::ZoomFitToWidth)
    , pageIndicator(0)
    , m_infoBanner(0)
    , shareIf(0)
    , searchstring("")
    , searchingTimeout(false)
    , zoomAction(0)
    , indicatorAction(0)
    , zoomCombobox(0)
    , indicatorCombobox(0)
    , searchStarted(false)
    , noMatches(false)
    , totalPage(1)
    , liveDocument(0)
    , bounceAnimation(0)
    , jumpToPageOverlay(0)
    , findtoolbar(0)
    , quickViewToolbar(0)
    , quickViewer(false)
    , m_pageView(new ZoomBackground(this))
    , m_lastZoomFactor(1.0)
{
    setView(m_pageView);
    documentName = filePath;
    setObjectName("documentpage");

    // double click interval setting to 325ms
    QApplication::setDoubleClickInterval(DOUBLETAP_INTERVAL);

    setAutoMarginsForComponentsEnabled(false);
    setComponentsDisplayMode(MApplicationPage::AllComponents, MApplicationPageModel::Hide);
    setEscapeMode(MApplicationPageModel::EscapeCloseWindow);
    qRegisterMetaType<ZoomLevel>("ZoomLevel");
    m_autoHideTimer.setSingleShot(true);
    m_autoHideTimer.setInterval(NAVI_BAR_TIMEOUT);

    m_shortTapTimer.setSingleShot(true);
    m_shortTapTimer.setInterval(QApplication::doubleClickInterval());

    searchTimer.setSingleShot(true);
    searchTimer.setInterval(searchDelay);

    connect(&searchTimer, SIGNAL(timeout()), this, SLOT(searchTimeout()));
    connect(&m_shortTapTimer, SIGNAL(timeout()), this, SLOT(shortTapEvent()));
    connect(&m_autoHideTimer, SIGNAL(timeout()), this, SLOT(autoHideToolbar()));
    connect(this, SIGNAL(backButtonClicked()), this, SLOT(onClose()));
    connect(ActionPool::instance(), SIGNAL(destroyed(QObject *)), this, SLOT(removeActions()));
    connect(this, SIGNAL(loadSuccess(QString)), SLOT(updateViewerType()));
    connect(MInputMethodState::instance(), SIGNAL(inputMethodAreaChanged(const QRect &)), this, SLOT(sendVisibleAreayChanged()));
}
SettingsPage::SettingsPage(AbstractServiceSetupContext *context,
                           MButtonModel *model,
                           QGraphicsItem *parent)
    : MApplicationPage(parent)
    , d_ptr(new SettingsPagePrivate())
{
    Q_D(SettingsPage);
    d->context = context;
    d->buttonModel = model;
    connect(this, SIGNAL(backButtonClicked()), d->context, SLOT(store()));
    pannableViewport()->positionIndicator()->setStyleName("CommonPositionIndicatorInverted");
}
Example #5
0
SimpleWizard::SimpleWizard(QWidget *parent)
    : QDialog(parent)
{
    ui.setupUi(this);

    // This stretch pushes all wizard pages upward, we don't want that
    //ui.vboxLayout->insertStretch(0, 1);
    #ifdef WIN32
    ui.line->setFrameShadow(QFrame::Sunken);
    #endif

    connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
    connect(ui.backButton, SIGNAL(clicked()), this, SLOT(backButtonClicked()));
    connect(ui.nextButton, SIGNAL(clicked()), this, SLOT(nextButtonClicked()));
}
Example #6
0
ExportDialog::ExportDialog(const int collectionId,
                           QList<int> &selectionRecordIdList,
                           QWidget *parent) :
    QDialog(parent),
    ui(new Ui::ExportDialog),
    m_recordList(selectionRecordIdList),
    m_collectionId(collectionId),
    m_exportCancelled(false)
{
    ui->setupUi(this);

    //init
    initUiCSV();

    //setup ui text
    if (!selectionRecordIdList.isEmpty()) {
        ui->selectedRecordsRadio->setChecked(true);
        int count = selectionRecordIdList.size();
        //QString text = tr("%n file(s)", "", fileCount);
        //BUG workaround: investigate why it doesn't work (http://qt-project.org/doc/qt-4.8/i18n-source-translation.html#handling-plurals)
        QString itemText = (count == 1 )? tr("item") : tr("items");
        QString text = tr("Selected records (%1 %2)")
                .arg(QString::number(count))
                .arg(itemText);
        ui->selectedRecordsRadio->setText(text);
    }

    //components
    m_metadataEngine = &MetadataEngine::getInstance();

    //connections
    connect(ui->cancelButton, SIGNAL(clicked()),
            this, SLOT(reject()));
    connect(ui->nextButton, SIGNAL(clicked()),
            this, SLOT(nextButtonClicked()));
    connect(ui->backCSVButton, SIGNAL(clicked()),
            this, SLOT(backButtonClicked()));
    connect(ui->cancelProgressButton, SIGNAL(clicked()),
            this, SLOT(cancelProgressButtonClicked()));
    connect(ui->exportCSVButton, SIGNAL(clicked()),
            this, SLOT(exportCSVButtonClicked()));
}
void PeopleApplication::createEditPage(const QModelIndex &index, const QString& title)
{
    if (m_editPage)
        return;

    QModelIndex useIndex;

    if (index.isValid())
        useIndex = index;
    else
        useIndex = m_currentIndex;

    if (useIndex.isValid())
        m_editModel = SeasideSyncModel::createPersonModel(useIndex);
    else  // create empty edit model to add new contact
        m_editModel = new SeasidePersonModel;
    MWidgetController *person = new MWidgetController(m_editModel);
    person->setViewType("personEdit");

    m_editModelModified = false;
    connect(m_editModel, SIGNAL(modified(QList<const char*>)),
            this, SLOT(editModified()));

    m_editPage = new MApplicationPage;
    if (title.isNull())
        m_editPage->setTitle(QObject::tr("Edit Contact","Title for edit screen"));
    else
        m_editPage->setTitle(title);
    m_editPage->setCentralWidget(person);

    MAction *action = new MAction(QObject::tr("<b>Save</b>","Save toolbar button for edit screen"), this);
    action->setLocation(MAction::ApplicationMenuLocation);
    m_editPage->addAction(action);
    connect(action, SIGNAL(triggered()), this, SLOT(editSave()));

    connect(m_editPage, SIGNAL(backButtonClicked()), this, SLOT(editBack()));

    m_editPage->appear(MApplicationPage::DestroyWhenDismissed);
}
void PeopleApplication::createDetailPage(const QModelIndex &index)
{
    if (m_detailPage)
        return;

    if (!index.isValid())
        return;

    searchCancel();

    m_currentIndex = index;

    m_currentPerson = new SeasidePerson(index);
    m_currentPerson->setViewType("personDetail");

    connect(m_currentPerson, SIGNAL(callNumber(const QString&)),
            this, SLOT(callNumber(const QString&)));
    connect(m_currentPerson, SIGNAL(composeIM(const QString&)),
            this, SLOT(composeIM(const QString&)));
    connect(m_currentPerson, SIGNAL(composeSMS(const QString&)),
            this, SLOT(composeSMS(const QString&)));
    connect(m_currentPerson, SIGNAL(composeEmail(const QString&)),
            this, SLOT(composeEmail(const QString&)));
    connect(m_currentPerson, SIGNAL(viewRequest(qreal,qreal)),
            this, SLOT(scrollIntoView(qreal,qreal)));

    m_detailPage = new MApplicationPage;
    m_detailPage->setTitle(QObject::tr("Contact Detail","Title for detail view"));
    m_detailPage->setCentralWidget(m_currentPerson);

    MAction *action = new MAction(QObject::tr("<b>Edit</b>","Edit toolbar button to edit contact details"), this);
    action->setLocation(MAction::ApplicationMenuLocation);
    m_detailPage->addAction(action);
    connect(action, SIGNAL(triggered()), this, SLOT(editCurrent()));

    connect(m_detailPage, SIGNAL(backButtonClicked()), this, SLOT(detailBack()));

    m_detailPage->appear(MApplicationPage::DestroyWhenDismissed);
}
void PeopleApplication::createCommPage(SeasidePersonModel *pm, CommCat type)
{
    if (m_commPage)
        return;

    searchCancel();

    m_commPage = new PersonCommsPage(pm, type);

    connect(m_commPage, SIGNAL(backButtonClicked()),
            this, SLOT(commBack()));

    switch (type) {
    case CatCall:
        connect(m_commPage, SIGNAL(destSelected(QString)),
                this, SLOT(callNumber(QString)));
        break;

    case CatSMS:
        connect(m_commPage, SIGNAL(destSelected(QString)),
                this, SLOT(composeSMS(QString)));
        break;

    case CatIM:
      connect(m_commPage, SIGNAL(destSelectedIM(QString)),
              this, SLOT(composeIM(QString)));
      break;

    case CatEmail:
        connect(m_commPage, SIGNAL(destSelected(QString)),
                this, SLOT(composeEmail(QString)));
        break;
    }
    connect(m_commPage, SIGNAL(destSelected(QString)),
            this, SLOT(commBack()));

    m_commPage->appear(MApplicationPage::DestroyWhenDismissed);
}
void MNavigationBarViewPrivate::init()
{
    Q_Q(MNavigationBarView);

    QGraphicsLinearLayout* contentLayout = new QGraphicsLinearLayout(controller);
    contentLayout->setContentsMargins(0, 0, 0, 0);
    content = new QGraphicsWidget;
    content->setObjectName("ContentToAnimate");
    contentLayout->addItem(content);

    applicationMenuButton = new MApplicationMenuButton(content);
    applicationMenuButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    escapeButtonSlot = new MEscapeButtonSlot(content);
    escapeButtonSlot->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    closeButton = new MButton(escapeButtonSlot);
    closeButton->setViewType("icon");

    backButton = new MButton(escapeButtonSlot);
    backButton->setViewType("icon");

    layout = new MLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    content->setLayout(layout);

    toolBarSlot = new QGraphicsWidget(content);
    toolBarSlot->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    toolBarLayout = new QGraphicsLinearLayout;
    toolBarLayout->setContentsMargins(0, 0, 0, 0);
    toolBarLayout->setSpacing(0);
    toolBarSlot->setLayout(toolBarLayout);

    menuToolbarEscapePolicy = new MLinearLayoutPolicy(layout, Qt::Horizontal);
    menuToolbarEscapePolicy->setSpacing(0);
    menuToolbarEscapePolicy->addItem(applicationMenuButton);
    menuToolbarEscapePolicy->addItem(toolBarSlot);
    menuToolbarEscapePolicy->addItem(escapeButtonSlot);

    escapeToolbarMenuPolicy = new MLinearLayoutPolicy(layout, Qt::Horizontal);
    escapeToolbarMenuPolicy->setSpacing(0);
    escapeToolbarMenuPolicy->addItem(escapeButtonSlot);
    escapeToolbarMenuPolicy->addItem(toolBarSlot);
    escapeToolbarMenuPolicy->addItem(applicationMenuButton);

    escapeToolbarPolicy = new MLinearLayoutPolicy(layout, Qt::Horizontal);
    escapeToolbarPolicy->setSpacing(0);
    escapeToolbarPolicy->addItem(escapeButtonSlot);
    escapeToolbarPolicy->addItem(toolBarSlot);

    toolbarPolicy = new MLinearLayoutPolicy(layout, Qt::Horizontal);
    toolbarPolicy->setSpacing(0);
    toolbarPolicy->addItem(toolBarSlot);

    toolbarMenuPolicy = new MLinearLayoutPolicy(layout, Qt::Horizontal);
    toolbarMenuPolicy->setSpacing(0);
    toolbarMenuPolicy->addItem(toolBarSlot);
    toolbarMenuPolicy->addItem(applicationMenuButton);

    customContentPolicy = new MLinearLayoutPolicy(layout, Qt::Horizontal);
    customContentPolicy->setSpacing(0);

    layout->setPolicy(toolbarPolicy);

    // Connects button signals
    QObject::connect(applicationMenuButton, SIGNAL(clicked()), controller, SIGNAL(viewmenuTriggered()));
    QObject::connect(closeButton, SIGNAL(clicked()), controller, SIGNAL(closeButtonClicked()));
    QObject::connect(backButton, SIGNAL(clicked()), controller, SIGNAL(backButtonClicked()));

    toolBarIsEmptyWatcher = new MDynamicPropertyWatcher;
    toolBarIsEmptyWatcher->setPropertyName("isEmpty");
    q->connect(toolBarIsEmptyWatcher, SIGNAL(propertyChanged()),
               SLOT(_q_updateIsEmptyAndJustEscapeButtonProperties()));
}
Example #11
0
KviTalWizard::KviTalWizard(QWidget * pParent)
: QDialog(pParent)
{
	m_p = new KviTalWizardPrivate;
	m_p->pPageList = new KviPointerList<KviTalWizardPageData>;
	m_p->pPageList->setAutoDelete(true);
	m_p->pCurrentPage = NULL;
	m_p->iEnabledPageCount = 0;
	m_p->pLayout = new QGridLayout(this);

	m_p->pTitleLabel = new QLabel(this);
	m_p->pLayout->addWidget(m_p->pTitleLabel,0,0,1,3);

	m_p->pStepsLabel = new QLabel(this);
	m_p->pStepsLabel->setMinimumWidth(80);
	m_p->pStepsLabel->setAlignment(Qt::AlignRight);
	m_p->pLayout->addWidget(m_p->pStepsLabel,0,4,1,3);

	QFrame * f1 = new QFrame(this);
	f1->setFrameStyle(QFrame::Sunken | QFrame::HLine);
	m_p->pLayout->addWidget(f1,1,0,1,7);

	m_p->pWidgetStack = new QStackedWidget(this);
	m_p->pLayout->addWidget(m_p->pWidgetStack,2,0,1,7);

	QFrame * f2 = new QFrame(this);
	f2->setFrameStyle(QFrame::Sunken | QFrame::HLine);
	m_p->pLayout->addWidget(f2,3,0,1,7);

	KviTalHBox * pButtonBox = new KviTalHBox(this);
	m_p->pLayout->addWidget(pButtonBox,4,0,1,7);

	pButtonBox->setMargin(0);
	pButtonBox->setSpacing(0);


	m_p->pCancelButton = new QPushButton(__tr("Cancel"),pButtonBox);
	m_p->pCancelButton->setMinimumWidth(80);
	QObject::connect(
			m_p->pCancelButton,
			SIGNAL(clicked()),
			this,
			SLOT(cancelButtonClicked())
		);

	QWidget * pSpacer = new QWidget(pButtonBox);
	pSpacer->setFixedWidth(4);

	m_p->pHelpButton = new QPushButton(__tr("Help"),pButtonBox);
	m_p->pHelpButton->setMinimumWidth(80);
	QObject::connect(
			m_p->pHelpButton,
			SIGNAL(clicked()),
			this,
			SLOT(helpButtonClicked())
		);

	QWidget * pLargeSpacer = new QWidget(pButtonBox);
	pLargeSpacer->setMinimumWidth(50);
	pButtonBox->setStretchFactor(pLargeSpacer,100);

	QString szText = "< ";
	szText += __tr("Back");
	m_p->pBackButton = new QPushButton(szText,pButtonBox);
	m_p->pBackButton->setMinimumWidth(80);
	QObject::connect(
			m_p->pBackButton,
			SIGNAL(clicked()),
			this,
			SLOT(backButtonClicked())
		);

	m_p->pNextSpacer = new QWidget(pButtonBox);
	m_p->pNextSpacer->setFixedWidth(4);

	szText = __tr("Next");
	szText += " >";
	m_p->pNextButton = new QPushButton(szText,pButtonBox);
	m_p->pNextButton->setMinimumWidth(80);
	QObject::connect(
			m_p->pNextButton,
			SIGNAL(clicked()),
			this,
			SLOT(nextButtonClicked())
		);

	m_p->pFinishSpacer = new QWidget(pButtonBox);
	m_p->pFinishSpacer->setFixedWidth(4);

	m_p->pFinishButton = new QPushButton(__tr("Finish"),pButtonBox);
	m_p->pFinishButton->setMinimumWidth(80);
	QObject::connect(
			m_p->pFinishButton,
			SIGNAL(clicked()),
			this,
			SLOT(finishButtonClicked())
		);

	m_p->pLayout->setMargin(8);
	m_p->pLayout->setSpacing(4);
	m_p->pLayout->setRowStretch(2,1);
	m_p->pLayout->setColumnStretch(0,1);
}
SwAcctEditPage::SwAcctEditPage(SwClientService *swService, QGraphicsItem *parent) :
        MApplicationPage(parent),
        mService(swService),
        mServiceConfig(mService->getServiceConfig()),
        mFlickrClicked(false)
{
    int adj = 0;
    setEscapeMode(MApplicationPageModel::EscapeManualBack);
    connect(this, SIGNAL(backButtonClicked()),
            this, SLOT(dismiss()));

    connect(mService,
            SIGNAL(CredsStateChanged(SwClientService*,SwClientService::CredsState)),
            this,
            SLOT(onCredsStateChanged(SwClientService *, SwClientService::CredsState)));
    if (!mServiceConfig->isValid())
        dismiss();
    mParams = mServiceConfig->getConfigParams();

    MLayout *layout = new MLayout;
    MGridLayoutPolicy *policy = new MGridLayoutPolicy(layout);

    QString link = mServiceConfig->getLink();
    MLabel *lblServiceName = new MLabel();
    if (!link.isEmpty())
        lblServiceName->setText(QString("<a href=\"%1\">%2</a>").arg(link, mServiceConfig->getDisplayName()));
    else
        lblServiceName->setText(mServiceConfig->getDisplayName());
    lblServiceName->setObjectName("SwAcctEditPageServiceNameLabel");
    policy->addItem(lblServiceName, 0, 0, 1, 2, Qt::AlignHCenter);

    connect(lblServiceName,
            SIGNAL(linkActivated(QString)),
            this,
            SLOT(onLinkClicked(QString)));

    QString desc = mServiceConfig->getDescription();
    if (!desc.isEmpty()) {
        MLabel *lblServiceDesc = new MLabel();
        lblServiceDesc->setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
        lblServiceDesc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        //Have to insert a random HTML tag to make word wrap actually work...
        //Should be able to remove at some point once MTF word wrap works properly
        lblServiceDesc->setText(QString("<b></b>").append(desc));
        lblServiceDesc->setObjectName("SwAcctEditPageServiceDescLabel");
        policy->addItem(lblServiceDesc, 1, 0, 1, 2, Qt::AlignLeft);
    } else {
        adj -= 1;
    }

    //This is *ugly*
    if (mServiceConfig->getAuthtype() == SwClientServiceConfig::AuthTypeFlickr) {
        if (!mParams.value(USER_KEY).isEmpty()) {
            //% "User %1"
            MLabel *lblUsername = new MLabel(qtTrId("label_flickr_username").arg(mParams.value(USER_KEY)));
            lblUsername->setObjectName("SwAcctEditPageFlickrUserLabel");
            policy->addItem(lblUsername, 2+adj, 0, 1, 2, Qt::AlignHCenter);
            adj += 1;
        }

        mFlickrButton = new MButton();
        mFlickrButton->setObjectName("SwAcctEditPageFlickrButton");
        policy->addItem(mFlickrButton, 2+adj, 0, 1, 2, Qt::AlignHCenter);

        connect(mFlickrButton,
                SIGNAL(clicked()),
                this,
                SLOT(onFlickrClicked()));

        adj += 1;
    } else {
        MLabel *lblUsername = new MLabel();
        lblUsername->setObjectName("SwAcctEditPageUsernameLabel");
        lblUsername->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        //% "Username:"******"label_username"));
        policy->addItem(lblUsername, 2+adj, 0);

        mEdtUsername = new MTextEdit(MTextEditModel::SingleLine);
        mEdtUsername->setObjectName("SwAcctEditPageUsernameButton");
        mEdtUsername->setText(mParams.value(USER_KEY));
        //qDebug() << QString("Set username to %1").arg(mParams.value(USER_KEY));
        policy->addItem(mEdtUsername, 2+adj, 1);

        if (mServiceConfig->getAuthtype() == SwClientServiceConfig::AuthTypePassword) {
            MLabel *lblPassword = new MLabel();
            lblPassword->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
            //% "Password:"******"label_password"));
            lblPassword->setObjectName("SwAcctEditPagePasswordLabel");
            policy->addItem(lblPassword, 3+adj, 0);
            mEdtPassword = new MTextEdit(MTextEditModel::SingleLine);
            mEdtPassword->setText(mParams.value(PASS_KEY));
            mEdtPassword->setEchoMode(MTextEditModel::Password);
            mEdtPassword->setObjectName("SwAcctEditPagePasswordButton");
    //        qDebug() << QString("Set password to %1").arg(mParams.value(PASS_KEY));
            policy->addItem(mEdtPassword, 3+adj, 1);
            connect(mEdtPassword,
                    SIGNAL(textChanged()),
                    this,
                    SLOT(onLoginChanged()));
            adj += 1;
        }
    }

    mLblStatus = new MLabel(STATUS_TEXT_UNCONFIGURED);
    mLblStatus->setObjectName("SwAcctEditPageStatusLabel");
    policy->addItem(mLblStatus, 3+adj, 0, 1, 2, Qt::AlignHCenter);

    onCredsStateChanged(mService, mService->credsState());

    MLabel *lblServiceHint = new MLabel();
    lblServiceHint->setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
    lblServiceHint->setObjectName("SwAcctEditPageServiceHintLabel");
    lblServiceHint->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    lblServiceHint->setText(SERVICE_HINT_TEXT.arg(mService->getDisplayName()));
    policy->addItem(lblServiceHint, 4+adj, 0, 1, 2);


    //This, also, is *ugly*
    if (mServiceConfig->getAuthtype() != SwClientServiceConfig::AuthTypeFlickr) {
        //% "Apply"
        mBtnApply = new MButton(qtTrId("button_apply"));
        mBtnApply->setObjectName("SwAcctEditPageApplyButton");
        policy->addItem(mBtnApply, 5+adj, 0, 1, 2, Qt::AlignHCenter);

        //% "Cancel"
        mBtnCancel = new MButton(qtTrId("button_cancel"));
        mBtnCancel->setObjectName("SwAcctEditPageCancelButton");
        policy->addItem(mBtnCancel, 6+adj, 0, 1, 2, Qt::AlignHCenter);

        connect(mEdtUsername,
                SIGNAL(textChanged()),
                this,
                SLOT(onLoginChanged()));

        connect(mBtnApply,
                SIGNAL(clicked()),
                this,
                SLOT(onApplyClicked()));
        connect(mBtnCancel,
                SIGNAL(clicked()),
                this,
                SLOT(dismiss()));
    }


    layout->setPolicy(policy);
    centralWidget()->setLayout(layout);
}