void SetupWizard::createPages() { setPage(PAGE_START, new StartPage(this)); setPage(PAGE_UPDATE, new AutoUpdatePage(this)); setPage(PAGE_CONTROLLER, new ControllerPage(this)); setPage(PAGE_VEHICLES, new VehiclePage(this)); setPage(PAGE_MULTI, new MultiPage(this)); setPage(PAGE_FIXEDWING, new FixedWingPage(this)); setPage(PAGE_HELI, new HeliPage(this)); setPage(PAGE_SURFACE, new SurfacePage(this)); setPage(PAGE_INPUT, new InputPage(this)); setPage(PAGE_OUTPUT, new OutputPage(this)); setPage(PAGE_LEVELLING, new LevellingPage(this)); setPage(PAGE_CALIBRATION, new OutputCalibrationPage(this)); setPage(PAGE_SUMMARY, new SummaryPage(this)); setPage(PAGE_SAVE, new SavePage(this)); setPage(PAGE_REBOOT, new RebootPage(this)); setPage(PAGE_NOTYETIMPLEMENTED, new NotYetImplementedPage(this)); setPage(PAGE_END, new EndPage(this)); setStartId(PAGE_START); connect(button(QWizard::CustomButton1), SIGNAL(clicked()), this, SLOT(customBackClicked())); setButtonText(QWizard::CustomButton1, buttonText(QWizard::BackButton)); QList<QWizard::WizardButton> button_layout; button_layout << QWizard::Stretch << QWizard::CustomButton1 << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton; setButtonLayout(button_layout); connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(pageChanged(int))); }
FirstRunDlg::FirstRunDlg(QWidget* const parent) : QWizard(parent), d(new Private) { setWizardStyle(QWizard::ClassicStyle); setButtonLayout(QList<QWizard::WizardButton>() << QWizard::HelpButton << QWizard::BackButton << QWizard::CancelButton << QWizard::NextButton << QWizard::FinishButton); d->welcomePage = new WelcomePage(this); // First assistant page d->collectionPage = new CollectionPage(this); d->databasePage = new DatabasePage(this); d->rawPage = new RawPage(this); d->metadataPage = new MetadataPage(this); d->previewPage = new PreviewPage(this); d->openFilePage = new OpenFilePage(this); d->tooltipsPage = new TooltipsPage(this); // NOTE: Added here new assistant pages... d->startScanPage = new StartScanPage(this); // Last assistant page resize(600, 600); connect(button(QWizard::FinishButton), SIGNAL(clicked()), this, SLOT(slotFinishPressed())); connect(this, SIGNAL(helpRequested()), this, SLOT(slotHelp())); }
void SetupWizard::createPages() { setPage(PAGE_START, new OPStartPage(this)); setPage(PAGE_UPDATE, new AutoUpdatePage(this)); setPage(PAGE_CONTROLLER, new ControllerPage(this)); setPage(PAGE_VEHICLES, new VehiclePage(this)); setPage(PAGE_MULTI, new MultiPage(this)); setPage(PAGE_FIXEDWING, new FixedWingPage(this)); setPage(PAGE_AIRSPEED, new AirSpeedPage(this)); setPage(PAGE_GPS, new GpsPage(this)); setPage(PAGE_HELI, new HeliPage(this)); setPage(PAGE_SURFACE, new SurfacePage(this)); setPage(PAGE_INPUT, new InputPage(this)); setPage(PAGE_ESC, new EscPage(this)); setPage(PAGE_SERVO, new ServoPage(this)); setPage(PAGE_BIAS_CALIBRATION, new BiasCalibrationPage(this)); setPage(PAGE_ESC_CALIBRATION, new EscCalibrationPage(this)); setPage(PAGE_OUTPUT_CALIBRATION, new OutputCalibrationPage(this)); setPage(PAGE_SUMMARY, new SummaryPage(this)); setPage(PAGE_SAVE, new SavePage(this)); setPage(PAGE_NOTYETIMPLEMENTED, new NotYetImplementedPage(this)); setPage(PAGE_AIRFRAME_INITIAL_TUNING, new AirframeInitialTuningPage(this)); setPage(PAGE_END, new OPEndPage(this)); setStartId(PAGE_START); connect(button(QWizard::CustomButton1), SIGNAL(clicked()), this, SLOT(customBackClicked())); setButtonText(QWizard::CustomButton1, buttonText(QWizard::BackButton)); QList<QWizard::WizardButton> button_layout; button_layout << QWizard::Stretch << QWizard::CustomButton1 << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton; setButtonLayout(button_layout); connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(pageChanged(int))); }
MatDBAboutDialog::MatDBAboutDialog(QWidget *parent) : QWizard(parent) { #ifdef Q_WS_MAC this->setParent(qApp->focusWidget()); this->setWindowModality(Qt::WindowModal); this->setWindowFlags(Qt::Sheet); setWizardStyle(ModernStyle); #endif setFixedWidth(900); setFixedHeight(450); setSizeGripEnabled(false); setPage(Page_Version, new VersionPage); setPage(Page_License, new LicensePage); setStartId(Page_Version); QList<QWizard::WizardButton> layout; layout << QWizard::Stretch << QWizard::FinishButton << QWizard::NextButton; setButtonLayout(layout); QPixmap pix(":/artwork/MatDBAbout.png"); setPixmap(QWizard::WatermarkPixmap, pix); setPixmap(QWizard::LogoPixmap, pix); setPixmap(QWizard::BannerPixmap, pix); setPixmap(QWizard::BackgroundPixmap, pix); }
//! [1] MyWizard::MyWizard(QWidget *parent) : QWizard(parent) { ... QList<QWizard::WizardButton> layout; layout << QWizard::Stretch << QWizard::BackButton << QWizard::CancelButton << QWizard::NextButton << QWizard::FinishButton; setButtonLayout(layout); ... }
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); }
FirstRunDlg::FirstRunDlg(QWidget* const parent) : QWizard(parent), d(new Private) { setWizardStyle(QWizard::ClassicStyle); setButtonLayout(QList<QWizard::WizardButton>() << QWizard::HelpButton << QWizard::BackButton << QWizard::CancelButton << QWizard::NextButton << QWizard::FinishButton); bool migrateAvailable; #ifdef Q_OS_LINUX ::Kdelibs4Migration migration; // If there's a digikamrc file in $KDEHOME/share/config, // then we create the migration page in the wizard migrateAvailable = !migration.locateLocal("config", QLatin1String("digikamrc")).isEmpty(); #else migrateAvailable = false; #endif d->welcomePage = new WelcomePage(this); // First assistant page if (migrateAvailable) d->migrateFromDigikam4Page = new MigrateFromDigikam4Page(this); d->collectionPage = new CollectionPage(this); d->databasePage = new DatabasePage(this); d->rawPage = new RawPage(this); d->metadataPage = new MetadataPage(this); d->previewPage = new PreviewPage(this); d->openFilePage = new OpenFilePage(this); d->tooltipsPage = new TooltipsPage(this); // NOTE: Added here new assistant pages... d->startScanPage = new StartScanPage(this); // Last assistant page resize(600, 600); connect(button(QWizard::FinishButton), SIGNAL(clicked()), this, SLOT(slotFinishPressed())); connect(this, SIGNAL(helpRequested()), this, SLOT(slotHelp())); }
void welcomeWizard::programInit( ) { checkDisableWelcome = new QCheckBox(); checkDisableWelcome->setText(tr("Don't show on next startup")); setButton(QWizard::CustomButton1, checkDisableWelcome); QList<QWizard::WizardButton> layout; layout << QWizard::CustomButton1 << QWizard::Stretch << QWizard::BackButton << QWizard::NextButton << QWizard::FinishButton; setButtonLayout(layout); button(QWizard::NextButton)->setText(tr("&Next")); button(QWizard::BackButton)->setText(tr("&Back")); button(QWizard::FinishButton)->setText(tr("&Finish")); connect(checkDisableWelcome, SIGNAL(clicked()), this, SLOT(slotCheckDisabled()) ); }
FileWizardDialog::FileWizardDialog(QWidget *parent) : Wizard(parent), m_filePage(new FileWizardPage) { setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setOption(QWizard::NoCancelButton, false); setOption(QWizard::NoDefaultButton, false); if (HostOsInfo::isMacHost()) { setButtonLayout(QList<QWizard::WizardButton>() << QWizard::CancelButton << QWizard::Stretch << QWizard::BackButton << QWizard::NextButton << QWizard::CommitButton << QWizard::FinishButton); } const int filePageId = addPage(m_filePage); wizardProgress()->item(filePageId)->setTitle(tr("Location")); connect(m_filePage, SIGNAL(activated()), button(QWizard::FinishButton), SLOT(animateClick())); }
void ExportWizard::setPage(int pageId) { // adapt buttons QList<QWizard::WizardButton> layout; layout << QWizard::Stretch << QWizard::BackButton; if (pageId >= PageWallpaper && pageId <= PagePdf) layout << QWizard::FinishButton; layout << QWizard::CancelButton; setButtonLayout(layout); // change page m_nextId = pageId; next(); // execute on-entry code switch (pageId) { case PageImage: if (m_ui->filePath->text().isEmpty()) slotChoosePath(); break; case PagePdf: if (!m_pdfPrinter) { m_pdfPrinter = new QPrinter; m_pdfPrinter->setOutputFormat(QPrinter::PdfFormat); m_pdfPrinter->setResolution(m_canvas->modeInfo()->printDpi()); m_pdfPrinter->setPaperSize(canvasNatInches(), QPrinter::Inch); m_pdfPrinter->setPageMargins(0, 0, 0, 0, QPrinter::Inch); //m_pdfPrinter->setOutputFileName("/tmp/aa.pdf"); initPageSizeNames(); slotPdfUpdateGui(); } if (m_pdfPrinter->outputFileName().isEmpty()) slotChoosePdfPath(); break; case PageSvg: if (m_ui->svgFilePath->text().isEmpty()) slotChooseSvgPath(); break; } }
void WizardMain::init(QWidget *parent) { lastPage=0; //setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint); //The titlebar is customized to delete the close button. NOT USED, DECENTRALIZES THE WIZARD ON THE SCREEN. //If false, the wizard will be launch from s2 page. if(mode==false) { //The first wizard page is visible only if launched from console in wizard mode, //parent is NULL only if the wizard is launched by main. if(parent == NULL) { addPage(new WizardGui_s0); lastPage++; //The last page is incremented to identify the last page id. } addPage(new WizardGui_s1); lastPage++; } addPage(new WizardGui_s2); addPage(new WizardGui_s3); lastPage++; connect(page(lastPage-1), SIGNAL(reportSent()),this, SLOT(wizardReportSent())); //A pointer to the WizardGui_s2 is set, the class will emit the reportSent() SIGNAL when the report is sent and should be saved on file. QList<QWizard::WizardButton> layout; layout << QWizard::Stretch << QWizard::Stretch << QWizard::Stretch << QWizard::Stretch << QWizard::CancelButton << QWizard::BackButton << QWizard::Stretch << QWizard::NextButton << QWizard::FinishButton; setOption(QWizard::NoBackButtonOnStartPage, true); setOption(QWizard::NoBackButtonOnLastPage, true); setOption(QWizard::NoCancelButton); setButtonLayout(layout); setWindowTitle(tr("OpenGooDebugToolSender")); setWindowIcon(QIcon(":/res/images/res/icon.png")); }
DvdWizard::DvdWizard(MonitorManager *manager, const QString &url, QWidget *parent) : QWizard(parent) , m_dvdauthor(NULL) , m_mkiso(NULL) , m_vobitem(NULL) , m_burnMenu(new QMenu(this)) { setWindowTitle(i18n("DVD Wizard")); //setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png"))); m_pageVob = new DvdWizardVob(this); m_pageVob->setTitle(i18n("Select Files For Your DVD")); addPage(m_pageVob); m_pageChapters = new DvdWizardChapters(manager, m_pageVob->dvdFormat(), this); m_pageChapters->setTitle(i18n("DVD Chapters")); addPage(m_pageChapters); if (!url.isEmpty()) m_pageVob->setUrl(url); connect(m_pageVob, SIGNAL(prepareMonitor()), this, SLOT(slotprepareMonitor())); m_pageMenu = new DvdWizardMenu(m_pageVob->dvdFormat(), this); m_pageMenu->setTitle(i18n("Create DVD Menu")); addPage(m_pageMenu); QWizardPage *page4 = new QWizardPage; page4->setTitle(i18n("Creating DVD Image")); m_status.setupUi(page4); m_status.error_box->setHidden(true); m_status.error_box->setTabBarHidden(true); m_status.tmp_folder->setUrl(KUrl(KdenliveSettings::currenttmpfolder())); m_status.tmp_folder->setMode(KFile::Directory | KFile::ExistingOnly); m_status.iso_image->setUrl(KUrl(QDir::homePath() + "/untitled.iso")); m_status.iso_image->setFilter("*.iso"); m_status.iso_image->setMode(KFile::File); m_status.iso_image->fileDialog()->setOperationMode(KFileDialog::Saving); #if KDE_IS_VERSION(4,7,0) m_isoMessage = new KMessageWidget; QGridLayout *s = static_cast <QGridLayout*> (page4->layout()); s->addWidget(m_isoMessage, 5, 0, 1, -1); m_isoMessage->hide(); #endif addPage(page4); connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotPageChanged(int))); connect(m_status.button_start, SIGNAL(clicked()), this, SLOT(slotGenerate())); connect(m_status.button_abort, SIGNAL(clicked()), this, SLOT(slotAbort())); connect(m_status.button_preview, SIGNAL(clicked()), this, SLOT(slotPreview())); QString programName("k3b"); QString exec = KStandardDirs::findExe(programName); if (!exec.isEmpty()) { //Add K3b action QAction *k3b = m_burnMenu->addAction(KIcon(programName), i18n("Burn with %1", programName), this, SLOT(slotBurn())); k3b->setData(exec); } programName = "brasero"; exec = KStandardDirs::findExe(programName); if (!exec.isEmpty()) { //Add Brasero action QAction *brasero = m_burnMenu->addAction(KIcon(programName), i18n("Burn with %1", programName), this, SLOT(slotBurn())); brasero->setData(exec); } if (m_burnMenu->isEmpty()) m_burnMenu->addAction(i18n("No burning program found (K3b, Brasero)")); m_status.button_burn->setMenu(m_burnMenu); m_status.button_burn->setIcon(KIcon("tools-media-optical-burn")); m_status.button_burn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); m_status.button_preview->setIcon(KIcon("media-playback-start")); setButtonText(QWizard::CustomButton1, i18n("Load")); setButtonText(QWizard::CustomButton2, i18n("Save")); button(QWizard::CustomButton1)->setIcon(KIcon("document-open")); button(QWizard::CustomButton2)->setIcon(KIcon("document-save")); connect(button(QWizard::CustomButton1), SIGNAL(clicked()), this, SLOT(slotLoad())); connect(button(QWizard::CustomButton2), SIGNAL(clicked()), this, SLOT(slotSave())); setOption(QWizard::HaveCustomButton1, true); setOption(QWizard::HaveCustomButton2, true); QList<QWizard::WizardButton> layout; layout << QWizard::CustomButton1 << QWizard::CustomButton2 << QWizard::Stretch << QWizard::BackButton << QWizard::NextButton << QWizard::CancelButton << QWizard::FinishButton; setButtonLayout(layout); }