void ConclusionPage::initializePage() { QString licenseText; if (wizard()->hasVisitedPage(LicenseWizard::Page_Evaluate)) { licenseText = tr("<u>Evaluation License Agreement:</u>" "You can use this software for 30 days and make one backup," "but you are not allowed to distribute it."); } else if (wizard()->hasVisitedPage(LicenseWizard::Page_Details)) { licenseText = tr("<u>First-Time License Agreement:</u>" "You cans use this software subject to the license" "you will receive by email"); } else { licenseText = tr("<u>Upgrade License License Agreement:</u>" "The software is licensed under the terms of your current license." ); } bottomLabel->setText(licenseText); }
bool LoadTokensPage::validatePage() { // once the import is finished, we call next(); skip validation if(wizard()->hasTokensData()) return true; QUrl url = QUrl::fromUserInput(urlLineEdit->text()); if(!url.isValid()) { QMessageBox::critical(this, tr("Error"), tr("The provided URL is not valid.")); return false; } progressLabel->setText(tr("Downloading (0MB)")); // show an infinite progressbar progressBar->setMaximum(0); progressBar->setMinimum(0); progressBar->setValue(0); progressLabel->show(); progressBar->show(); wizard()->disableButtons(); setEnabled(false); if(!nam) nam = new QNetworkAccessManager(this); QNetworkReply *reply = nam->get(QNetworkRequest(url)); connect(reply, SIGNAL(finished()), this, SLOT(actDownloadFinishedTokensFile())); connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(actDownloadProgressTokensFile(qint64, qint64))); return false; }
void OwncloudOAuthCredsPage::asyncAuthResult(OAuth::Result r, const QString &user, const QString &token, const QString &refreshToken) { switch (r) { case OAuth::NotSupported: { /* OAuth not supported (can't open browser), fallback to HTTP credentials */ OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard()); ocWizard->back(); ocWizard->setAuthType(DetermineAuthTypeJob::Basic); break; } case OAuth::Error: /* Error while getting the access token. (Timeout, or the server did not accept our client credentials */ _ui.errorLabel->show(); wizard()->show(); break; case OAuth::LoggedIn: { _token = token; _user = user; _refreshToken = refreshToken; OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard()); Q_ASSERT(ocWizard); emit connectToOCUrl(ocWizard->account()->url().toString()); break; } } }
bool LoadTokensPage::validatePage() { // once the import is finished, we call next(); skip validation if(wizard()->hasTokensData()) return true; QUrl url = QUrl::fromUserInput(urlLineEdit->text()); if(!url.isValid()) { QMessageBox::critical(this, tr("Error"), tr("The provided URL is not valid.")); return false; } progressLabel->setText(tr("Downloading (0MB)")); // show an infinite progressbar progressBar->setMaximum(0); progressBar->setMinimum(0); progressBar->setValue(0); progressLabel->show(); progressBar->show(); wizard()->disableButtons(); setEnabled(false); downloadTokensFile(url); return false; }
void LoadSetsPage::actDownloadFinishedSetsFile() { progressLabel->hide(); progressBar->hide(); // check for a reply QNetworkReply *reply = static_cast<QNetworkReply *>(sender()); QNetworkReply::NetworkError errorCode = reply->error(); if (errorCode != QNetworkReply::NoError) { QMessageBox::critical(this, tr("Error"), tr("Network error: %1.").arg(reply->errorString())); wizard()->enableButtons(); setEnabled(true); reply->deleteLater(); return; } // save allsets.json url, but only if the user customized it and download was successfull if(urlLineEdit->text() != QString(ALLSETS_URL)) wizard()->settings->setValue("allsetsurl", urlLineEdit->text()); else wizard()->settings->remove("allsetsurl"); readSetsFromByteArray(reply->readAll()); reply->deleteLater(); }
void NewWizardPage4::fileAccepted(const QString& s) { path = s; templateFileBrowser->show(); if (wizard()->currentPage() == this) wizard()->next(); }
void OwncloudAdvancedSetupPage::initializePage() { WizardCommon::initErrorLabel(_ui.errorLabel); _checking = false; _oldLocalFolder = wizard()->property("oldLocalFolder").toString(); _ui.lSelectiveSyncSizeLabel->setText(QString()); _ui.lSyncEverythingSizeLabel->setText(QString()); // call to init label updateStatus(); // ensure "next" gets the focus, not obSelectLocalFolder QTimer::singleShot(0, wizard()->button(QWizard::NextButton), SLOT(setFocus())); auto acc = static_cast<OwncloudWizard *>(wizard())->account(); auto quotaJob = new PropfindJob(acc, _remoteFolder, this); quotaJob->setProperties(QList<QByteArray>() << "http://owncloud.org/ns:size"); connect(quotaJob, SIGNAL(result(QVariantMap)), SLOT(slotQuotaRetrieved(QVariantMap))); quotaJob->start(); if (Theme::instance()->wizardSelectiveSyncDefaultNothing()) { _selectiveSyncBlacklist = QStringList("/"); QTimer::singleShot(0, this, SLOT(slotSelectiveSyncClicked())); } }
void PluginsInstallPage::initializePage() { setTitle( tr( "Your plugins are now being installed" ) ); wizard()->setCommitPage( true ); QAbstractButton* continueButton = wizard()->setButton( FirstRunWizard::NextButton, tr( "Continue" ) ); if ( wizard()->canGoBack() ) wizard()->setButton( FirstRunWizard::BackButton, tr( "<< Back" ) ); #ifdef Q_OS_WIN32 if ( wizard()->pluginList()->installList().count() > 0 ) { // get the install to happen a bit later so that // we actually show this page of the wizard // and the user has time to read what's happening QTimer::singleShot( 1000, this, SLOT(install()) ); continueButton->setEnabled( false ); } else { continueButton->click(); } #endif }
void LoadSetsPage::readSetsFromByteArray(QByteArray data) { // show an infinite progressbar progressBar->setMaximum(0); progressBar->setMinimum(0); progressBar->setValue(0); progressLabel->setText(tr("Parsing file")); progressLabel->show(); progressBar->show(); // unzip the file if needed if(data.startsWith(ZIP_SIGNATURE)) { #ifdef HAS_ZLIB // zipped file QBuffer *inBuffer = new QBuffer(&data); QBuffer *outBuffer = new QBuffer(this); QString fileName; UnZip::ErrorCode ec; UnZip uz; ec = uz.openArchive(inBuffer); if (ec != UnZip::Ok) { zipDownloadFailed(tr("Failed to open Zip archive: %1.").arg(uz.formatError(ec))); return; } if(uz.fileList().size() != 1) { zipDownloadFailed(tr("Zip extraction failed: the Zip archive doesn't contain exactly one file.")); return; } fileName = uz.fileList().at(0); outBuffer->open(QBuffer::ReadWrite); ec = uz.extractFile(fileName, outBuffer); if (ec != UnZip::Ok) { zipDownloadFailed(tr("Zip extraction failed: %1.").arg(uz.formatError(ec))); uz.closeArchive(); return; } future = QtConcurrent::run(wizard()->importer, &OracleImporter::readSetsFromByteArray, outBuffer->data()); watcher.setFuture(future); return; #else zipDownloadFailed(tr("Sorry, this version of Oracle does not support zipped files.")); wizard()->enableButtons(); setEnabled(true); progressLabel->hide(); progressBar->hide(); return; #endif } // Start the computation. future = QtConcurrent::run(wizard()->importer, &OracleImporter::readSetsFromByteArray, data); watcher.setFuture(future); }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void GatherDataPage::showEvent(QShowEvent* event) { wizard()->setWindowTitle("MDCTool - Step " + QString::number(wizard()->currentId() + 1) + " of " + QString::number(wizard()->pageIds().size())); double value = static_cast<double>(wizard()->currentId()) / static_cast<double>(wizard()->pageIds().size()); int progress = static_cast<int>(value * 100); progressBar->setValue(progress); }
void PHIWizardInstall::finish( bool err ) { if ( err ) wizard()->button( QWizard::CancelButton )->setEnabled( true ); else { wizard()->button( QWizard::FinishButton )->setEnabled( true ); _box->setEnabled( true ); } }
void SaveSetsPage::initializePage() { messageLog->clear(); connect(wizard()->importer, SIGNAL(setIndexChanged(int, int, const QString &)), this, SLOT(updateTotalProgress(int, int, const QString &))); if (!wizard()->importer->startImport()) QMessageBox::critical(this, tr("Error"), tr("No set has been imported.")); }
void QInstallPage::start(){ setSubTitle("Configuring EGSnrc core system"); progressBar->show(); progressBar->reset(); screen->clear(); wizard()->button(QWizard::BackButton)->setEnabled(false); wizard()->button(QWizard::FinishButton)->setEnabled(false); installButton->setEnabled(false); the_time.start(); buildEGSnrc(corespec); }
void QInstallPage::resetPage(){ wizard()->button(QWizard::BackButton)->setEnabled(true); wizard()->button(QWizard::FinishButton)->setEnabled(true); //installButton->setText("&Install"); installButton->setEnabled(true); progressBar->setValue( progressBar->maximum() ); //connect(installButton,SIGNAL(clicked()),this,SLOT(start())); //qDebug("Total steps = %d",i_config_steps); timeStamp(); }
void UIWizardCloneVMPageBasic2::sltButtonClicked(QAbstractButton *pButton) { setFinalPage(pButton != m_pFullCloneRadio); /* On older Qt versions the content of the current page isn't updated when * using setFinalPage. So switch back and for to simulate it. */ #if QT_VERSION < 0x040700 wizard()->back(); wizard()->next(); #endif }
void OwncloudOAuthCredsPage::initializePage() { OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard()); Q_ASSERT(ocWizard); ocWizard->account()->setCredentials(CredentialsFactory::create("http")); _asyncAuth.reset(new OAuth(ocWizard->account().data(), this)); connect(_asyncAuth.data(), &OAuth::result, this, &OwncloudOAuthCredsPage::asyncAuthResult, Qt::QueuedConnection); _asyncAuth->start(); wizard()->hide(); }
void TourMetadataPage::initializePage() { setTitle( tr( "Discover more about the artists you love" ) ); wizard()->setButton( FirstRunWizard::NextButton, tr( "Continue" ) ); if ( wizard()->canGoBack() ) wizard()->setButton( FirstRunWizard::BackButton, tr( "<< Back" ) ); wizard()->setButton( FirstRunWizard::SkipButton, tr( "Skip Tour >>" ) ); }
void WDWizardPage::showEvent(QShowEvent *event) { if (wizard()->currentPage() == this) { setupDialogSize(); } QAbstractButton *runButton = getRunButton(wizard()); if (NULL != runButton) { runButton->setVisible(isFinalPage()); } QWizardPage::showEvent(event); }
/*! Overrides the QWizardPage::setVisible() function to detect when the page is entered/left to configure the Next Value button. */ void LabToolCalibrationWizardAnalogOut::setVisible(bool visible) { QWizardPage::setVisible(visible); if (visible) { wizard()->setButtonText(QWizard::CustomButton1, tr("Next &Value")); wizard()->setOption(QWizard::HaveCustomButton1, true); connect(wizard(), SIGNAL(customButtonClicked(int)), this, SLOT(nextValueClicked())); } else {
bool LoadSetsPage::validatePage() { // once the import is finished, we call next(); skip validation if(wizard()->importer->getSets().count() > 0) return true; // else, try to import sets if(urlRadioButton->isChecked()) { QUrl url = QUrl::fromUserInput(urlLineEdit->text()); if(!url.isValid()) { QMessageBox::critical(this, tr("Error"), tr("The provided url is not valid.")); return false; } progressLabel->setText(tr("Downloading (0MB)")); // show an infinite progressbar progressBar->setMaximum(0); progressBar->setMinimum(0); progressBar->setValue(0); progressLabel->show(); progressBar->show(); wizard()->disableButtons(); setEnabled(false); if(!nam) nam = new QNetworkAccessManager(this); QNetworkReply *reply = nam->get(QNetworkRequest(url)); connect(reply, SIGNAL(finished()), this, SLOT(actDownloadFinishedSetsFile())); connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(actDownloadProgressSetsFile(qint64, qint64))); } else if(fileRadioButton->isChecked()) { QFile setsFile(fileLineEdit->text()); if(!setsFile.exists()) { QMessageBox::critical(this, tr("Error"), tr("Please choose a file.")); return false; } if (!setsFile.open(QIODevice::ReadOnly | QIODevice::Text)) { QMessageBox::critical(0, tr("Error"), tr("Cannot open file '%1'.").arg(fileLineEdit->text())); return false; } wizard()->disableButtons(); setEnabled(false); readSetsFromByteArray(setsFile.readAll()); } return false; }
bool LoadSetsPage::validatePage() { // once the import is finished, we call next(); skip validation if (wizard()->importer->getSets().count() > 0) { return true; } // else, try to import sets if (urlRadioButton->isChecked()) { QUrl url = QUrl::fromUserInput(urlLineEdit->text()); if (!url.isValid()) { QMessageBox::critical(this, tr("Error"), tr("The provided URL is not valid.")); return false; } progressLabel->setText(tr("Downloading (0MB)")); // show an infinite progressbar progressBar->setMaximum(0); progressBar->setMinimum(0); progressBar->setValue(0); progressLabel->show(); progressBar->show(); wizard()->disableButtons(); setEnabled(false); downloadSetsFile(url); } else if (fileRadioButton->isChecked()) { QFile setsFile(fileLineEdit->text()); if (!setsFile.exists()) { QMessageBox::critical(this, tr("Error"), tr("Please choose a file.")); return false; } if (!setsFile.open(QIODevice::ReadOnly)) { QMessageBox::critical(nullptr, tr("Error"), tr("Cannot open file '%1'.").arg(fileLineEdit->text())); return false; } wizard()->disableButtons(); setEnabled(false); readSetsFromByteArray(setsFile.readAll()); } return false; }
void DecConclusionPage::initializePage() { QString source = wizard()->field("source").toString(); sourceLabel_->setText(source); destinationLabel_->setText(wizard()->field("destination").toString()); QFileInfo file(source); sizeLabel_->setText(QString().setNum(file.size())); QWizardPage::initializePage(); }
/*! Overrides the QWizardPage::setVisible() function to detect when the page is entered/left to configure the ReCalibrate button. */ void LabToolCalibrationWizardAnalogIn::setVisible(bool visible) { QWizardPage::setVisible(visible); if (visible) { wizard()->setButtonText(QWizard::CustomButton1, tr("&ReCalibrate")); wizard()->setOption(QWizard::HaveCustomButton1, true); connect(wizard(), SIGNAL(customButtonClicked(int)), this, SLOT(recalibrateClicked())); wizard()->button(QWizard::CustomButton1)->setEnabled(true); } else {
//! [28] void ConclusionPage::setVisible(bool visible) { QWizardPage::setVisible(visible); if (visible) { //! [29] wizard()->setButtonText(QWizard::CustomButton1, tr("&Print")); wizard()->setOption(QWizard::HaveCustomButton1, true); connect(wizard(), SIGNAL(customButtonClicked(int)), this, SLOT(printButtonClicked())); //! [29] } else {
void PluginsInstallPage::install() { #ifdef Q_OS_WIN32 foreach( IPluginInfo* plugin, wizard()->pluginList()->installList() ) plugin->doInstall(); #endif QAbstractButton* continueButton = wizard()->setButton( FirstRunWizard::NextButton, tr( "Continue" ) ); continueButton->setEnabled( true ); QTimer::singleShot( 1000, continueButton, SLOT(click()) ); }
void LoginPage::initializePage() { setTitle( tr( "Let's get started by connecting your Last.fm account" ) ); wizard()->setButton( FirstRunWizard::NextButton, tr( "Connect Your Account" ) ); QAbstractButton* custom = wizard()->setButton( FirstRunWizard::CustomButton, tr( "Sign up" ) ); QAbstractButton* proxy = wizard()->setButton( FirstRunWizard::BackButton, tr( "Proxy?" ) ); connect( custom, SIGNAL(clicked()), SLOT(onSignUpClicked())); connect( proxy, SIGNAL(clicked()), SLOT(onProxyClicked())); }
void LoadSetsPage::importFinished() { wizard()->enableButtons(); setEnabled(true); progressLabel->hide(); progressBar->hide(); if(watcher.future().result()) { wizard()->next(); } else { QMessageBox::critical(this, tr("Error"), tr("The file was retrieved successfully, but it does not contain any sets data.")); } }
void WizardPageMain::updateProjectNameStatus() { ui->projectNameLineEdit->setPalette( mLocationPaletteOrig ); QFileInfo fi( QDir( ui->locationLineEdit->text() ).absoluteFilePath( ui->projectNameLineEdit->text() ) ); if( fi.exists() ) { QPalette pal = ui->projectNameLineEdit->palette(); pal.setColor( QPalette::Base, QColor( 0xFF, 0x63, 0x47 ) ); ui->projectNameLineEdit->setPalette( pal ); if( mInitialized ) wizard()->button( QWizard::NextButton )->setEnabled( false ); } else if( mInitialized ) wizard()->button( QWizard::NextButton )->setEnabled( true ); }
void OwncloudWizardResultPage::initializePage() { /* const QString localFolder = wizard()->property("localFolder").toString(); QString text; if( _remoteFolder == QLatin1String("/") || _remoteFolder.isEmpty() ) { text = tr("Your entire account is synced to the local folder <i>%1</i>") .arg(QDir::toNativeSeparators(localFolder)); } else { text = tr("%1 folder <i>%1</i> is synced to local folder <i>%2</i>") .arg(Theme::instance()->appNameGUI()) .arg(_remoteFolder).arg(QDir::toNativeSeparators(localFolder)); } _ui.localFolderLabel->setText( text ); */ QStringList folders = wizard()->property("localFolders").value<QStringList>(); foreach (const QString &str, folders) { qDebug()<<"folder selected : " << str; } QListView *list=_ui.listView; QStringListModel *model = new QStringListModel(this); model->setStringList(folders); //list->setViewMode(QListView::IconMode); list->setModel(model); }
Project* MainWindow::newProject(bool target) { NewProjectWizard wizard(this); wizard.setTargetPlatformEnabled(target); if(wizard.exec() == QDialog::Rejected) return 0; const QString& saveLocation = wizard.saveLocation(); if(QFile::exists(saveLocation)) { QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Are You Sure?"), tr("Overwrite ") + saveLocation + "?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if(ret == QMessageBox::No) return 0; } Project* project = Project::create(saveLocation); if(!project) { MessageDialog::showError(this, "simple_error", QStringList() << tr("Failed to create project.") << tr("Attempted save location: ") + saveLocation); return 0; } project->updateSetting(TARGET_KEY, wizard.targetPlatform()); foreach(const QString& setting, wizard.projectType()->defaultSettings()) project->updateSetting(setting, ""); ProjectManager::ref().openProject(project); return project; }