Exemplo n.º 1
0
void Wizard::createIntroStep()
{
   QWizardPage * wp = new QWizardPage(this);
   wp->setTitle(tr("Welcome"));
   QVBoxLayout * vl = new QVBoxLayout;
   QLabel * lbl = new QLabel(tr("<h3>Welcome to the Maverick Setup Wizard.</h3><p><p><p>This will install Maverick Poker Bot on your computer.<p>It is recommended that you close all <b>Poker Rooms</b> before continuing.<p>Click Next to continue, or Cancel to exit Setup."), this);
   lbl->setWordWrap(true);
   vl->addWidget(lbl);

#ifdef DEMO_MODE
   QHBoxLayout * hb = new QHBoxLayout;
   QLabel * lblDemo = new QLabel(tr("<br><br><font color=red><h3>Demo Version</h3><p>Available poker-rooms:<br>Red Star Poker, Poker Academy Pro only.</font>"), this);
   lblDemo->setWordWrap(true);
   hb->addWidget(lblDemo);
   
   QPushButton * btnFull = new QPushButton(tr("&Get Full Version\n(Party Poker, Titan Poker, Cake Poker)"), this);
   btnFull->setFixedHeight(64);
   connect(btnFull, SIGNAL(clicked()), this, SLOT(getFullVersion()));
   hb->addWidget(btnFull, 0, Qt::AlignBottom);
   vl->addLayout(hb);
#endif
   wp->setLayout(vl);
   addPage(wp);
   pages_.insert(Intro, wp);
}
Exemplo n.º 2
0
void ConnectFriendWizard::updateStylesheet()
{
	/* add stylesheet to title */
	QList<int> ids = pageIds();
	for (QList<int>::iterator pageIt = ids.begin(); pageIt != ids.end(); ++pageIt) {
		QWizardPage *p = page(*pageIt);

		QString title;
		QMap<QWizardPage*, QString>::iterator it = mTitleString.find(p);
		if (it == mTitleString.end()) {
			/* Save title string */
			title = p->title();
			mTitleString[p] = title;
		} else {
			title = it.value();
		}

		QString stylesheet = "<span style=\"";

		if (mTitleFontSize) {
			stylesheet += QString("font-size:%1pt; ").arg(mTitleFontSize);
		}
		if (mTitleFontWeight) {
			stylesheet += QString("font-weight:%1; ").arg(mTitleFontWeight);
		}
		if (!mTitleColor.isEmpty()) {
			stylesheet += QString("color:%1; ").arg(mTitleColor);
		}

		stylesheet += QString("\">%1</span>").arg(title);

		p->setTitle(stylesheet);
	}
}
Exemplo n.º 3
0
QWizardPage *AuthenticationWizard::createIntroPage()
{

	QWizardPage *page = new QWizardPage();
	page->setTitle(i18nc("@title", "Select authentication method"));

	rbQA = new QRadioButton(i18n("Question and Answer"));
	rbSS = new QRadioButton(i18n("Shared Secret"));
	rbMV = new QRadioButton(i18n("Manual fingerprint verification"));

	QGroupBox *frame = new QGroupBox();
	QVBoxLayout *frameLayout = new QVBoxLayout();
	frame->setLayout(frameLayout);
	infoLabel = new QLabel();
	infoLabel->setWordWrap(true);
	frameLayout->addWidget(infoLabel);

	QVBoxLayout *layout = new QVBoxLayout();
	layout->addWidget(rbQA);
	layout->addWidget(rbSS);
	layout->addWidget(rbMV);

	layout->addSpacing(30);
	layout->addWidget(frame);

	page->setLayout(layout);

	rbQA->setChecked(true);

	return page;
}
Exemplo n.º 4
0
void ReplaceBandInputWizard::addSourcePage()
{
   QWizardPage* pPage = new QWizardPage(this);
   pPage->setTitle("Select source data element");
   QLabel* pPageLabel = new QLabel("Select the source data element.", pPage);
   pPageLabel->setWordWrap(true);
   mpSource = new QComboBox(pPage);
   mpSource->setEditable(false);

   const RasterDataDescriptor* pDestDesc = static_cast<const RasterDataDescriptor*>(mpDest->getDataDescriptor());
   std::vector<DataElement*> rasters = Service<ModelServices>()->getElements(TypeConverter::toString<RasterElement>());
   for(std::vector<DataElement*>::iterator raster = rasters.begin(); raster != rasters.end(); ++raster)
   {
      RasterElement* pRaster = static_cast<RasterElement*>(*raster);
      if (pRaster == mpDest)
      {
         continue;
      }
      const RasterDataDescriptor* pDesc = static_cast<const RasterDataDescriptor*>(pRaster->getDataDescriptor());
      if (pDesc->getRowCount() == pDestDesc->getRowCount() &&
          pDesc->getColumnCount() == pDestDesc->getColumnCount() &&
          pDesc->getDataType() == pDestDesc->getDataType())
      {
         mpSource->addItem(QString::fromStdString(pRaster->getName()), reinterpret_cast<qulonglong>(pRaster));
      }
   }

   QVBoxLayout* pLayout = new QVBoxLayout();
   pLayout->addWidget(pPageLabel);
   pLayout->addWidget(mpSource);
   pPage->setLayout(pLayout);

   addPage(pPage);
}
Exemplo n.º 5
0
QWizardPage *FirstRunWizard::createIntroPage()
{
	QWizardPage *introPage = new QWizardPage(this);
	introPage->setTitle( tr("Introduction") );
	introPage->setSubTitle( tr("This wizard will help setup the initial parameters of My Backstage") );

	return introPage;
}
Exemplo n.º 6
0
void QWizard::help()
{
    QWidget * page = d->ws->visibleWidget();
    if ( !page )
	return;

#if 0
    QWizardPage *wpage = ::qt_cast<QWizardPage*>(page);
    if ( wpage )
	emit wpage->helpClicked();
#endif
    emit helpClicked();
}
Exemplo n.º 7
0
EulaDialog::EulaDialog(QWidget* parent) : QWizard(parent) {
  setWindowTitle(trEulaTitle);
  setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);

  //// First page
  QWizardPage* firstPage = new QWizardPage;

  QRadioButton* agreeButton = new QRadioButton(trIAgree);
  VERIFY(connect(agreeButton, &QRadioButton::clicked, this, &EulaDialog::agreeButtonClicked));

  QRadioButton* notAgreeButton = new QRadioButton(trIDontAgree);
  notAgreeButton->setChecked(true);
  VERIFY(connect(notAgreeButton, &QRadioButton::clicked, this, &EulaDialog::notAgreeButtonClicked));

  QHBoxLayout* radioButtonsLay = new QHBoxLayout;
  radioButtonsLay->setAlignment(Qt::AlignHCenter);
  radioButtonsLay->setSpacing(30);
  radioButtonsLay->addWidget(agreeButton);
  radioButtonsLay->addWidget(notAgreeButton);

  QTextEdit* textBrowser = new QTextEdit;
  QFile file(":" PROJECT_NAME_LOWERCASE "/LICENSE");
  if (file.open(QFile::ReadOnly | QFile::Text)) {
    textBrowser->setHtml(file.readAll());
  }

  QVBoxLayout* mainLayout1 = new QVBoxLayout;
  mainLayout1->addWidget(new QLabel("<h3>" + trEndUserAgr + "</h3>"));
  mainLayout1->addWidget(textBrowser);
  mainLayout1->addLayout(radioButtonsLay, Qt::AlignCenter);
  firstPage->setLayout(mainLayout1);

  addPage(firstPage);

  //// Buttons
  setButtonText(QWizard::CustomButton1, trBack);
  setButtonText(QWizard::CustomButton2, trNext);
  setButtonText(QWizard::CustomButton3, trFinish);

  VERIFY(connect(button(QWizard::CustomButton1), &QAbstractButton::clicked, this, &EulaDialog::backButtonClicked));
  VERIFY(connect(button(QWizard::CustomButton2), &QAbstractButton::clicked, this, &EulaDialog::nextButtonClicked));
  VERIFY(connect(button(QWizard::CustomButton3), &QAbstractButton::clicked, this, &EulaDialog::finishButtonClicked));

  setButtonLayout(QList<WizardButton>{QWizard::Stretch, QWizard::CustomButton1, QWizard::CustomButton2,
                                      QWizard::CancelButton, QWizard::CustomButton3});

  button(QWizard::CustomButton1)->setHidden(true);
  button(QWizard::CustomButton2)->setHidden(true);
  button(QWizard::CustomButton3)->setDisabled(true);
  setWizardStyle(QWizard::ModernStyle);
}
Exemplo n.º 8
0
QWizardPage *IrcConnectionWizard::createIntroductionPage(QWidget *parent)
{
    QWizardPage *page = new QWizardPage(parent);
    page->setTitle(QObject::tr("Welcome to Quassel IRC"));

    QLabel *label = new QLabel(QObject::tr("This wizard will help you to set up your default identity and your IRC network connection.<br>"
                                           "This only covers basic settings. You can cancel this wizard any time and use the settings dialog for more detailed changes."), page);
    label->setWordWrap(true);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(label);
    page->setLayout(layout);
    return page;
}
Exemplo n.º 9
0
QWizardPage* MergeCategoriesWizard::createFinishedPage()
{
  QWizardPage *finished = new QWizardPage(this);
  QHBoxLayout *lay = new QHBoxLayout(finished);
  QLabel *desc = new QLabel(finished);
  lay->addWidget(desc);
  finished->setLayout(lay);

  desc->setWordWrap(true);
  finished->setTitle(i18n("Import completed"));
  desc->setText(i18n("The categories have been merged.\n\nThank you for improving Simon."));

  return finished;
}
Exemplo n.º 10
0
QWizardPage *AuthenticationWizard::createFinalPage()
{
	QWizardPage *page = new QWizardPage();
	QGridLayout *layout = new QGridLayout();
    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 0, 0);

	lFinal = new QLabel();
	lFinal->setWordWrap(true);
	layout->addWidget(lFinal);
    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 2, 0);

	page->setLayout(layout);

	return page;
}
Exemplo n.º 11
0
//! [0] //! [1]
QWizardPage *createIntroPage()
{
    QWizardPage *page = new QWizardPage;
    page->setTitle("Introduction");

    QLabel *label = new QLabel("This wizard will help you register your copy "
                               "of Super Product Two.");
    label->setWordWrap(true);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(label);
    page->setLayout(layout);

    return page;
}
Exemplo n.º 12
0
void ReplaceBandInputWizard::addSourceBandPage()
{
   QWizardPage* pPage = new QWizardPage(this);
   pPage->setTitle("Select source band");
   QLabel* pPageLabel = new QLabel("Select the source band.", pPage);
   pPageLabel->setWordWrap(true);
   mpSourceBand = new QComboBox(pPage);
   mpSourceBand->setEditable(false);

   QVBoxLayout* pLayout = new QVBoxLayout();
   pLayout->addWidget(pPageLabel);
   pLayout->addWidget(mpSourceBand);
   pPage->setLayout(pLayout);

   mSourceBandId = addPage(pPage);
}
Exemplo n.º 13
0
QWizardPage *AuthenticationWizard::createMVPage()
{
	QWizardPage *page = new QWizardPage();
	page->setTitle(i18nc("@title", "Manual Verification"));

	QGridLayout *layout = new QGridLayout();
    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 0, 0);

	QLabel *lMessage1 = new QLabel(i18nc("@info",
                "Contact <b>%1</b> via another secure channel and verify that the following fingerprint is correct:", contact));
	lMessage1->setWordWrap(true);
	layout->addWidget(lMessage1);
    QLabel *lFingerprint = new QLabel(QLatin1String("<b>") + chAdapter->remoteFingerprint() + QLatin1String("</b>"));
    lFingerprint->setAlignment(Qt::AlignCenter);
    lFingerprint->setTextInteractionFlags(Qt::TextSelectableByMouse);
	layout->addWidget(lFingerprint);

	cbManualAuth = new QComboBox();
	cbManualAuth->addItem(i18nc("@item:inlistbox ...verified that", "I have not"));
	cbManualAuth->addItem(i18nc("@item:inlistbox ...verified that", "I have"));
	cbManualAuth->setSizeAdjustPolicy(QComboBox::AdjustToContents);

	if(chAdapter->otrTrustLevel() == KTp::OTRTrustLevelPrivate) {
		cbManualAuth->setCurrentIndex(1);
	} else {
		cbManualAuth->setCurrentIndex(0);
	}

	QLabel *lMessage2 = new QLabel(i18nc("@info:label I have...",
                "verified that this is in fact the correct fingerprint for <b>%1</b>.", contact));
	lMessage2->setWordWrap(true);

	QHBoxLayout *verifyLayout = new QHBoxLayout();
	verifyLayout->addWidget(cbManualAuth, 0, Qt::AlignLeft);
    verifyLayout->addSpacing(5);
	verifyLayout->addWidget(lMessage2, 1);

	QFrame *frame = new QFrame();
	frame->setLayout(verifyLayout);
	layout->addWidget(frame);

    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 6, 0);
    layout->setVerticalSpacing(15);
	page->setLayout(layout);

	return page;
}
QWizardPage * MobileConnectionWizard::createIntroPage()
{
    QWizardPage *page = new QWizardPage();
    page->setTitle(i18nc("Mobile Connection Wizard", "Set up a Mobile Broadband Connection"));
    QVBoxLayout *layout = new QVBoxLayout;

    QLabel *label = new QLabel(i18nc("Mobile Connection Wizard", "This assistant helps you easily set up a mobile broadband connection to a cellular (3G) network."));
    label->setWordWrap(true);
    layout->addWidget(label);

    label = new QLabel("\n" + i18nc("Mobile Connection Wizard", "You will need the following information:"));
    layout->addWidget(label);

    label = new QLabel(QString("  . %1\n  . %2\n  . %3").
                       arg(i18nc("Mobile Connection Wizard", "Your broadband provider's name")).
                       arg(i18nc("Mobile Connection Wizard", "Your broadband billing plan name")).
                       arg(i18nc("Mobile Connection Wizard", "(in some cases) Your broadband billing plan APN (Access Point Name)")));
    layout->addWidget(label);

    if (!mInitialMethodType) {
        label = new QLabel("\n" + i18nc("Mobile Connection Wizard", "Create a connection for &this mobile broadband device:"));
        layout->addWidget(label);

        mDeviceComboBox = new QComboBox();
        mDeviceComboBox->addItem(i18nc("Mobile Connection Wizard", "Any GSM device"));
        mDeviceComboBox->setItemData(0, Knm::Connection::Gsm);
        mDeviceComboBox->addItem(i18nc("Mobile Connection Wizard", "Any CDMA device"));
        mDeviceComboBox->setItemData(1, Knm::Connection::Cdma);
        mDeviceComboBox->insertSeparator(NUMBER_OF_STATIC_ENTRIES-1);
        label->setBuddy(mDeviceComboBox);
        layout->addWidget(mDeviceComboBox);

        QObject::connect(Solid::Control::NetworkManagerNm09::notifier(), SIGNAL(networkInterfaceAdded(QString)),
                         this, SLOT(introDeviceAdded(QString)));
        QObject::connect(Solid::Control::NetworkManagerNm09::notifier(), SIGNAL(networkInterfaceRemoved(QString)),
                         this, SLOT(introDeviceRemoved(QString)));
        QObject::connect(Solid::Control::NetworkManagerNm09::notifier(), SIGNAL(statusChanged(Solid::Networking::Status)),
                         this, SLOT(introStatusChanged(Solid::Networking::Status)));

        introAddInitialDevices();
    }

    page->setLayout(layout);

    return page;
}
Exemplo n.º 15
0
void ReplaceBandInputWizard::addDestBandPage()
{
   QWizardPage* pPage = new QWizardPage(this);
   pPage->setTitle("Select destination band");
   QLabel* pPageLabel = new QLabel("Select the destination band.", pPage);
   pPageLabel->setWordWrap(true);
   mpDestBand = new QComboBox(pPage);
   mpDestBand->setEditable(false);
   mpDestBand->addItems(getBandNames(static_cast<const RasterDataDescriptor*>(mpDest->getDataDescriptor())));

   QVBoxLayout* pLayout = new QVBoxLayout();
   pLayout->addWidget(pPageLabel);
   pLayout->addWidget(mpDestBand);
   pPage->setLayout(pLayout);

   addPage(pPage);
}
Exemplo n.º 16
0
//! [5] //! [6]
QWizardPage *createConclusionPage()
//! [5] //! [7]
{
//! [7]
    QWizardPage *page = new QWizardPage;
    page->setTitle("Conclusion");

    QLabel *label = new QLabel("You are now successfully registered. Have a "
                               "nice day!");
    label->setWordWrap(true);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(label);
    page->setLayout(layout);

    return page;
//! [8]
}
Exemplo n.º 17
0
// vytvaranie stran
void NewGameDialog::addInitialPage() {
    QWizardPage *newPage = new QWizardPage(this);
    newPage->setTitle( tr("Main settings") );

    // pocet hracov
    QHBoxLayout *playersCountLayout = new QHBoxLayout;
    playersCountLayout->addWidget( new QLabel( tr("Players count: ") ) );
    playersCountLayout->addWidget( (m_playersCount = new QSpinBox) );
    m_playersCount->setValue(DEFAULT_PLAYERS_COUNT);
    // maximum bude pocet roznych podpisov
    m_playersCount->setRange(MINIMUM_PLAYERS_COUNT, PlayerSignRegistrator::list().size());

    // velkost plochy
    QHBoxLayout *boardSizeLayout = new QHBoxLayout;
    boardSizeLayout->addWidget( new QLabel( tr("Number of squares in board side: ") ) );
    boardSizeLayout->addWidget( (m_boardSize = new QSpinBox) );
    m_boardSize->setValue(DEFAULT_BOARD_SIZE);
    m_boardSize->setRange(MINIMUM_BOARD_SIZE, MAXIMUM_BOARD_SIZE);

    // pocet podpisov v rade na vytazstvo
    QHBoxLayout *signsCountToWinLayout = new QHBoxLayout;
    signsCountToWinLayout->addWidget( new QLabel( tr("Number of signs to win: ") ) );
    signsCountToWinLayout->addWidget( (m_signsCountToWin = new QSpinBox) );
    m_signsCountToWin->setValue(DEFAULT_WIN_STONES);
    m_signsCountToWin->setRange(MINIMUM_WIN_SIGNS_COUNT, MAXIMUM_BOARD_SIZE);

    // casovy limit tahu
    QHBoxLayout *timeLimitLayout = new QHBoxLayout;
    timeLimitLayout->addWidget( new QLabel( tr("Time limit of player's turn in seconds (0 = unlimited): ") ) );
    timeLimitLayout->addWidget( (m_timeLimit = new QLineEdit( QString().setNum(DEFAULT_TIME_LIMIT) )) );

    // pridanie sub layoutoch do hlavneho layoutu
    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->addLayout(playersCountLayout);
    mainLayout->addLayout(signsCountToWinLayout);
    mainLayout->addLayout(boardSizeLayout);
    mainLayout->addLayout(timeLimitLayout);

    // nastavenie layoutu a navrat funkcie
    newPage->setLayout(mainLayout);
    addPage(newPage);
}
Exemplo n.º 18
0
QWizardPage* FirstRunWizard::createIntroPage()
{
  QWizardPage *intro = new QWizardPage(this);
  QHBoxLayout *lay = new QHBoxLayout(intro);
  QLabel *desc = new QLabel(intro);
  lay->addWidget(desc);
  intro->setLayout(lay);

  desc->setWordWrap(true);
  intro->setTitle(i18n("Welcome to Simon"));
  desc->setOpenExternalLinks(true);
  desc->setText(i18n("<html><head /><body>"
    "<p>Simon is a speech recognition solution enabling you to control your computer with your voice.</p>"
    "<p>This assistant will help you to get Simon up and running.</p>"
    "<p>Go through the following steps carefully and read the instructions.</p>"
    "<p>You can still change these options later (see the manual for more information)."
    "<p>Find more instructions on <a href=\"http://userbase.kde.org/Simon\">our wiki</a>.</p>"
    "</body></html>"));

  return intro;
}
Exemplo n.º 19
0
QWizardPage *AuthenticationWizard::createQAPage()
{
	QWizardPage *page = new QWizardPage();
	QGridLayout *layout = new QGridLayout();
    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 0, 0);

	if(initiate) {
		page->setTitle(i18nc("@title", "Question and Answer"));

		lQuestion = new QLabel(i18nc("@info", "Enter a question that only <b>%1</b> is able to answer:",
                    contact));
		layout->addWidget(lQuestion);
		leQuestion = new QLineEdit();
		layout->addWidget(leQuestion);
		lAnswer = new QLabel(i18nc("@info", "Enter the answer to your question:"));
		layout->addWidget(lAnswer);
	} else {
		if(!question.isEmpty()) {
			page->setTitle(i18nc("@title", "Authentication with <b>%1</b>", contact));
			lQuestion = new QLabel(i18nc("@info", "<b>%1</b> would like to verify your authentication. "
                        "Please answer the following question in the field below:", contact));
            layout->setRowMinimumHeight(1, 30);
			lQuestion->setWordWrap(true);
			layout->addWidget(lQuestion);
			lAnswer = new QLabel(question);
            QFont font = lAnswer->font();
            font.setItalic(true);
            lAnswer->setFont(font);
			lAnswer->setWordWrap(true);
			layout->addWidget(lAnswer);
		}
	}
	leAnswer = new QLineEdit();
	layout->addWidget(leAnswer);
    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 5, 0);

	page->setLayout(layout);
	page->setCommitPage(true);
	return page;
}
Exemplo n.º 20
0
QWizardPage *AuthenticationWizard::createSSPage()
{
	QWizardPage *page = new QWizardPage();
	QGridLayout *layout = new QGridLayout();
    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 0, 0);

	if(initiate) {
		page->setTitle(i18nc("@title", "Shared Secret"));

		layout->addWidget(new QLabel(i18nc("@info", "Enter a secret passphrase known only to you and <b>%1</b>:", contact)));
	} else {
        page->setTitle(i18nc("@title", "Authentication with <b>%1</b>", contact));
		layout->addWidget(new QLabel(i18nc("@info", "Enter the secret passphrase known only to you and <b>%1</b>:", contact)));
	}
	leSecret = new QLineEdit();
	layout->addWidget(leSecret);

    layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 4, 0);
	page->setLayout(layout);
	page->setCommitPage(true);
	return page;
}
Exemplo n.º 21
0
ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) :
    QWizard(parent), ui(new Ui::ConnectFriendWizard)
{
    ui->setupUi(this);

    /* add stylesheet to title */
    QList<int> ids = pageIds();
    for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it) {
        QWizardPage *p = page(*it);
        p->setTitle(QString("<span style=\"font-size:16pt; font-weight:500; color:white;\">%1</span>").arg(p->title()));
    }

// this define comes from Qt example. I don't have mac, so it wasn't tested
#ifndef Q_WS_MAC
    setWizardStyle(ModernStyle);
#endif

    setStartId(Page_Intro);

// at this moment I don't know, what information should be in help
//	setOption(HaveHelpButton, true);
//	connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp()));

    setPixmap(QWizard::LogoPixmap, QPixmap(":/images/connect/connectFriendLogo.png"));

// we have no good pictures for watermarks
//	setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/connectFriendWatermark.png"));
    setPixmap(QWizard::BannerPixmap, QPixmap(":/images/connect/connectFriendBanner1.png"));

    /* register global fields */
    ui->ErrorMessagePage->registerField("errorMessage", ui->messageLabel, "text");

    /* disable not used pages */
    ui->foffRadioButton->hide();
    ui->rsidRadioButton->hide();

    connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->optionsFrame,SLOT(setEnabled(bool))) ;
    connect(ui->addKeyToKeyring_CB,SIGNAL(toggled(bool)), ui->acceptNoSignGPGCheckBox,SLOT(setChecked(bool))) ;
}
Exemplo n.º 22
0
//! [2]
QWizardPage *createRegistrationPage()
//! [1] //! [3]
{
//! [3]
    QWizardPage *page = new QWizardPage;
    page->setTitle("Registration");
    page->setSubTitle("Please fill both fields.");

    QLabel *nameLabel = new QLabel("Name:");
    QLineEdit *nameLineEdit = new QLineEdit;

    QLabel *emailLabel = new QLabel("Email address:");
    QLineEdit *emailLineEdit = new QLineEdit;

    QGridLayout *layout = new QGridLayout;
    layout->addWidget(nameLabel, 0, 0);
    layout->addWidget(nameLineEdit, 0, 1);
    layout->addWidget(emailLabel, 1, 0);
    layout->addWidget(emailLineEdit, 1, 1);
    page->setLayout(layout);

    return page;
//! [4]
}
Exemplo n.º 23
0
void CleanupWizard::updateWizard(int id)
{
    // this method update the wizard objectname in order to display the html help file
    // for each page
    switch(id) {
        case preselectionID:
            setObjectName("cleanupPreselection");
            break;
        case mailSelectionID:
            setObjectName("cleanupMail");
            break;
        case eventSelectionID:
            setObjectName("cleanupEvent");
            break;
        case documentTypeSelectionID:
            setObjectName("cleanupTypeSelection");
            break;
        case documentListSelectionID:
            setObjectName("cleanupListSelection");
            break;
        case finalSummaryID:
            setObjectName("cleanupSummary");
            break;
        default:
            setObjectName("cleanupWizard");
    }

    // QWizard automatically gives focus to the first child of the new page,
    // but it is somehow edit focus instead of navigation focus, so refocus it
    QWizardPage *currPage = page(id);
    if (currPage) {
        QWidget *focusWidget = currPage->focusWidget();
        if (focusWidget)
            focusWidget->setEditFocus(false);
    }
}
Exemplo n.º 24
0
QWizardPage *StandardDialog::createPage2() {
  QWizardPage *page = new QWizardPage;
  page->setTitle(tr("user information."));
  return page;
}
Exemplo n.º 25
0
QWizardPage *StandardDialog::createPage3() {
  QWizardPage *page = new QWizardPage;
  page->setTitle(tr("Exit."));
  return page;
}
Exemplo n.º 26
0
QWizardPage *StandardDialog::createPage1() {
  QWizardPage *page = new QWizardPage;
  page->setTitle(tr("Introduction."));
  return page;
}
Exemplo n.º 27
0
void QEbuMainWindow::actionWizard()
{
    QWizard *wizard = new QWizard(this);
    wizard->setWindowTitle(QObject::tr("Getting started"));
    wizard->setWizardStyle(QWizard::ModernStyle);
    wizard->adjustSize();

    // INTRO
    QWizardPage *intro = new QWizardPage;
    {
        intro->setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/watermark.png"));
        intro->setTitle(QObject::tr("Introduction"));
        QVBoxLayout *layout = new QVBoxLayout;
        QLabel *label = new QLabel(QObject::tr("This brief tutorial will give an overview "
                              "of the main components of the editor and their "
                              "meaning. A couple of aspects of the GUI are pointed out "
                              "in every page and small insight is given about the most "
                              "relevant elements."));
        label->setWordWrap(true);
        layout->addWidget(label);
        intro->setLayout(layout);
    }


    // FIRST PAGE - Basic Layout Description I
    // Breadcrumb
    // Grouping attributes/elements

    QWizardPage *page1 = new QWizardPage;
    {
        page1->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
        page1->setTitle(QObject::tr("Basic Layout I"));
        page1->setSubTitle(QObject::tr("Breadcrumb and grouping"));
        QVBoxLayout *layout = new QVBoxLayout;
        QLabel *image = new QLabel;
        image->setPixmap(QPixmap(":/images/page0.png"));
        image->setAlignment(Qt::AlignHCenter);
        QLabel *firstParagraph = new QLabel("(1) A simple to read breadcrumb at the top of each page will help you remember at which level of the tree you are");
        firstParagraph->setWordWrap(true);
        QLabel *secondParagraph = new QLabel("(2) All the fields within a form are grouped together, or at least sorted in a meaningful way. For any given types all the attributes are stacked at the top of the page, whereas inner elements occupy lower positions.");
        secondParagraph->setWordWrap(true);
        layout->addWidget(image);
        layout->addWidget(firstParagraph);
        layout->addWidget(secondParagraph);
        page1->setLayout(layout);
    }


    // SECOND PAGE - Basic Layout Description II
    // [0..1]
    // TAB

    QWizardPage *page2 = new QWizardPage;
    {
        page2->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
        page2->setTitle(QObject::tr("Basic Layout II"));
        page2->setSubTitle(QObject::tr("Simple elements and Tabs"));
        QVBoxLayout *layout = new QVBoxLayout;
        QLabel *image = new QLabel;
        image->setPixmap(QPixmap(":/images/page1.png"));
        image->setAlignment(Qt::AlignHCenter);
        QLabel *firstParagraph = new QLabel("(1) Inner elements with cardinality of [0..1] are hadlled with a couple of buttons to add the element, or edit the existing one, and to remove it. An immutable edit box gives a direct feedback of the status of said element.");
        firstParagraph->setWordWrap(true);
        QLabel *secondParagraph = new QLabel("(2) To have a nicer and tidier appearence, in case of very rich panels, the content is divided among several tabs, with the aim to keep together correlated elements.");
        secondParagraph->setWordWrap(true);
        layout->addWidget(image);
        layout->addWidget(firstParagraph);
        layout->addWidget(secondParagraph);
        page2->setLayout(layout);
    }

    // THIRD PAGE - Basic Layout Description III
    // The Amazing ListView
    // Mention to New Form vs Simple Dialog

    QWizardPage *page3 = new QWizardPage;
    {
        page3->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
        page3->setTitle(QObject::tr("Basic Layout III"));
        page3->setSubTitle(QObject::tr("Listview"));
        QVBoxLayout *layout = new QVBoxLayout;
        QLabel *image = new QLabel;
        image->setPixmap(QPixmap(":/images/page2.png"));
        image->setAlignment(Qt::AlignHCenter);
        QLabel *firstParagraph = new QLabel("In case of inner elements with [0..*] cardinality a custom list manager is provided, to manage the contents.");
        firstParagraph->setWordWrap(true);
        QLabel *secondParagraph = new QLabel("In presence of both single and multiple cardinality elements within the same form, to keep a coherent appearence all the items are managed with the proposed list view, that automatically forbids the insertion of more than one element, if needed.");
        secondParagraph->setWordWrap(true);
        layout->addWidget(image);
        layout->addWidget(firstParagraph);
        layout->addWidget(secondParagraph);
        page3->setLayout(layout);
    }

    // FOURTH PAGE - Dates & Numbers
    // Optional fields
    // Checkboxes
    // Compliance Check

    QWizardPage *page4 = new QWizardPage;
    {
        page4->setPixmap(QWizard::BannerPixmap, QPixmap(":/images/banner.png").scaled(560, 49, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
        page4->setTitle(QObject::tr("About data"));
        page4->setSubTitle(QObject::tr("Dates, numbers and validation"));
        QVBoxLayout *layout = new QVBoxLayout;
        QLabel *image = new QLabel;
        image->setPixmap(QPixmap(":/images/page3.png").scaledToWidth(500, Qt::SmoothTransformation));
        image->setAlignment(Qt::AlignHCenter);
        QLabel *firstParagraph = new QLabel("(1) Unlike simple text fields, data and numeric related fields come with a checkbox to enable/disable its content from being saved to the XML files in creation. Upon a change of the represented value the checkboxes are automatically ticked off, whilst if unchecked their value is ignored or cleared if previusly modified.");
        firstParagraph->setWordWrap(true);
        QLabel *secondParagraph = new QLabel("(2) Upon clicking Apply a compliance check is run on the form contents, and an error message, preventing the user from continuing, appears in case of mistakes or shortcomings.");
        secondParagraph->setWordWrap(true);
        layout->addWidget(image);
        layout->addWidget(firstParagraph);
        layout->addWidget(secondParagraph);
        page4->setLayout(layout);
    }

    // END OF TUTORIAL

    wizard->addPage(intro);
    wizard->addPage(page1);
    page1->setFixedHeight(420);
    wizard->addPage(page2);
    wizard->addPage(page3);
    wizard->addPage(page4);
    wizard->exec();
}
Exemplo n.º 28
0
QWizardPage *AddFeedWizard::createNameFeedPage()
{
  QWizardPage *page = new QWizardPage;
  page->setTitle(tr("Create New Feed"));
  page->setFinalPage(false);

  nameFeedEdit_ = new LineEdit(this);

  foldersTree_ = new QTreeWidget(this);
  foldersTree_->setObjectName("foldersTree_");
  foldersTree_->setColumnCount(2);
  foldersTree_->setColumnHidden(1, true);
  foldersTree_->header()->hide();

  QStringList treeItem;
  treeItem << tr("Feeds") << "Id";
  foldersTree_->setHeaderLabels(treeItem);

  treeItem.clear();
  treeItem << tr("All Feeds") << "0";
  QTreeWidgetItem *treeWidgetItem = new QTreeWidgetItem(treeItem);
  treeWidgetItem->setIcon(0, QIcon(":/images/folder"));
  foldersTree_->addTopLevelItem(treeWidgetItem);
  foldersTree_->setCurrentItem(treeWidgetItem);

  QSqlQuery q;
  QQueue<int> parentIds;
  parentIds.enqueue(0);
  while (!parentIds.empty()) {
    int parentId = parentIds.dequeue();
    QString qStr = QString("SELECT text, id FROM feeds WHERE parentId='%1' AND (xmlUrl='' OR xmlUrl IS NULL)").
        arg(parentId);
    q.exec(qStr);
    while (q.next()) {
      QString folderText = q.value(0).toString();
      QString folderId = q.value(1).toString();

      QStringList treeItem;
      treeItem << folderText << folderId;
      QTreeWidgetItem *treeWidgetItem = new QTreeWidgetItem(treeItem);

      treeWidgetItem->setIcon(0, QIcon(":/images/folder"));

      QList<QTreeWidgetItem *> treeItems =
            foldersTree_->findItems(QString::number(parentId),
                                                       Qt::MatchFixedString | Qt::MatchRecursive,
                                                       1);
      treeItems.at(0)->addChild(treeWidgetItem);
      if (folderId.toInt() == curFolderId_)
        foldersTree_->setCurrentItem(treeWidgetItem);
      parentIds.enqueue(folderId.toInt());
    }
  }

  foldersTree_->expandAll();
  foldersTree_->sortByColumn(0, Qt::AscendingOrder);

  ToolButton *newFolderButton = new ToolButton(this);
  newFolderButton->setIcon(QIcon(":/images/addT"));
  newFolderButton->setToolTip(tr("New Folder..."));
  newFolderButton->setAutoRaise(true);

  QHBoxLayout *newFolderLayout = new QHBoxLayout;
  newFolderLayout->setMargin(0);
  newFolderLayout->addWidget(newFolderButton);
  newFolderLayout->addStretch();
  QVBoxLayout *newFolderVLayout = new QVBoxLayout;
  newFolderVLayout->setMargin(2);
  newFolderVLayout->addStretch();
  newFolderVLayout->addLayout(newFolderLayout);

  foldersTree_->setLayout(newFolderVLayout);

  QVBoxLayout *layout = new QVBoxLayout;
  layout->addWidget(new QLabel(tr("Displayed name:")));
  layout->addWidget(nameFeedEdit_);
  layout->addWidget(new QLabel(tr("Location:")));
  layout->addWidget(foldersTree_);
  page->setLayout(layout);

  connect(nameFeedEdit_, SIGNAL(textChanged(const QString&)),
          this, SLOT(nameFeedEditChanged(const QString&)));
  connect(newFolderButton, SIGNAL(clicked()),
          this, SLOT(newFolder()));

  return page;
}
Exemplo n.º 29
0
PackThemeDialog::PackThemeDialog(QWidget * pParent, KviPointerList<KviThemeInfo> * pThemeInfoList)
: QWizard(pParent)
{
	setWindowTitle(__tr2qs_ctx("Export Theme - KVIrc","theme"));
	setMinimumSize(400,350);
	setDefaultProperty("QTextEdit","plainText",SIGNAL(textChanged()));
	m_pThemeInfoList = pThemeInfoList;

	QPixmap * pSide = g_pIconManager->getBigIcon("kvi_setup_label.png");
	QPixmap * pLogo = g_pIconManager->getBigIcon("kvi_bigicon_addons.png");

#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
	#if (_WIN32_WINNT >= 0x0600)
		// We are on a Windows Vista / Seven
		// It will fallback to XP if alpha compositing is disabled
		setWizardStyle(QWizard::AeroStyle);
	#else
		// Windows XP
		setWizardStyle(QWizard::ModernStyle);
		setPixmap(QWizard::WatermarkPixmap,*pSide);
		setPixmap(QWizard::LogoPixmap,*pLogo);
	#endif
#elif defined(COMPILE_ON_MAC)
	setWizardStyle(QWizard::MacStyle);
	setPixmap(QWizard::BackgroundPixmap,*pSide);
#else
	// All other systems
	setWizardStyle(QWizard::ClassicStyle);
	setPixmap(QWizard::WatermarkPixmap,*pSide);
	setPixmap(QWizard::LogoPixmap,*pLogo);
#endif

	// Add a default property for file selectors
	setDefaultProperty("KviFileSelector","tmpFile",SIGNAL(selectionChanged(const QString &)));

	// Welcome page
	QWizardPage * pPage = new QWizardPage(this);
	QVBoxLayout * pLayout = new QVBoxLayout(pPage);

	pPage->setLayout(pLayout);
	pPage->setTitle(__tr2qs_ctx("Welcome","theme"));

	QString szText = "<p>";
	szText += __tr2qs_ctx("This procedure allows you to export the selected themes to a single package. It is useful when you want to distribute your themes to the public.","theme");
	szText += "</p><p>";
	szText += __tr2qs_ctx("You will be asked to provide a package name, a description and, if you want, an icon/screenshot.","theme");
	szText += "</p><p>";
	szText += __tr2qs_ctx("Hit the \"Next\" button to begin.","theme");
	szText += "<p>";

	QLabel * pLabel = new QLabel(pPage);
	pLabel->setWordWrap(true);
	pLabel->setText(szText);
	pLayout->addWidget(pLabel);
	addPage(pPage);

	// Theme data
	m_pPackThemeDataWidget = new PackThemeDataWidget(this);
	addPage(m_pPackThemeDataWidget);

	// Packager information
	m_pPackThemeInfoWidget = new PackThemeInfoWidget(this);
	addPage(m_pPackThemeInfoWidget);

	// Screenshot/logo/icon
	m_pPackThemeImageWidget = new PackThemeImageWidget(this);
	addPage(m_pPackThemeImageWidget);

	// Save file name
	m_pPackThemeSaveWidget = new PackThemeSaveWidget(this);
	addPage(m_pPackThemeSaveWidget);

	//last thing to do before starting
	m_pPackThemeDataWidget->parseThemes(m_pThemeInfoList);
}
Exemplo n.º 30
0
QWizardPage *AddFeedWizard::createUrlFeedPage()
{
  QWizardPage *page = new QWizardPage;
  page->setTitle(tr("Create New Feed"));

  selectedPage = false;
  finishOn = false;

  urlFeedEdit_ = new LineEdit(this);
  urlFeedEdit_->setText("http://");

  titleFeedAsName_ = new QCheckBox(
        tr("Use title of the feed as displayed name"), this);
  titleFeedAsName_->setChecked(true);

  authentication_ = new QGroupBox(this);
  authentication_->setTitle(tr("Server requires authentication:"));
  authentication_->setCheckable(true);
  authentication_->setChecked(false);

  user_ = new LineEdit(this);
  pass_ = new LineEdit(this);
  pass_->setEchoMode(QLineEdit::Password);

  QGridLayout *authenticationLayout = new QGridLayout();
  authenticationLayout->addWidget(new QLabel(tr("Username:"******"Password:"******":/images/warning"));
  textWarning = new QLabel(this);
  QFont font = textWarning->font();
  font.setBold(true);
  textWarning->setFont(font);

  QHBoxLayout *warningLayout = new QHBoxLayout();
  warningLayout->setMargin(0);
  warningLayout->addWidget(iconWarning);
  warningLayout->addWidget(textWarning, 1);

  warningWidget_ = new QWidget(this);
  warningWidget_->setLayout(warningLayout);

  progressBar_ = new QProgressBar(this);
  progressBar_->setObjectName("progressBar_");
  progressBar_->setTextVisible(false);
  progressBar_->setFixedHeight(15);
  progressBar_->setMinimum(0);
  progressBar_->setMaximum(0);
  progressBar_->setVisible(false);

  QVBoxLayout *layout = new QVBoxLayout;
  layout->addWidget(new QLabel(tr("Feed URL or website address:")));
  layout->addWidget(urlFeedEdit_);
  layout->addWidget(titleFeedAsName_);
  layout->addSpacing(10);
  layout->addWidget(authentication_);
  layout->addStretch(1);
  layout->addWidget(warningWidget_);
  layout->addWidget(progressBar_);
  page->setLayout(layout);

  connect(urlFeedEdit_, SIGNAL(textChanged(const QString&)),
          this, SLOT(urlFeedEditChanged(const QString&)));
  connect(titleFeedAsName_, SIGNAL(stateChanged(int)),
          this, SLOT(titleFeedAsNameStateChanged(int)));

  return page;
}