void MainWindow::on_actionEditPreferences_triggered() { PreferencesDialog prefDialog; prefDialog.setModal(true); prefDialog.exec(); }
void MainWindow::slotShowPreferencesDialog() { PreferencesDialog dialog; dialog.exec(); // Use the new flow method (if it has changed) m_project->reloadFlowSource(); }
MainWindow::MainWindow(QString projectPath, QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), m_progressDialog(NULL), m_renderProgressDialog(NULL), m_flowExaminer(NULL), m_cs(this) { ui->setupUi(this); m_project = new Project_sV(); m_wCanvas = new Canvas(m_project, this); setCentralWidget(m_wCanvas); createActions(); createDockWindows(); updateWindowTitle(); setWindowIcon(QIcon(":icons/slowmoIcon.png")); QSettings settings; bool show = settings.value("ui/displayHelp", false).toBool(); m_wCanvas->showHelp(show); settings.sync(); restoreGeometry(settings.value("mainwindow/geometry").toByteArray()); restoreState(settings.value("mainwindow/windowState").toByteArray()); if (!projectPath.isEmpty()) { loadProject(projectPath); } if (!settings.contains("binaries/ffmpeg")) { qDebug() << "need to find ffmpeg"; QMessageBox::information( this, "valid FFMPEG not found", "Please choose a working ffmpeg\n" , QMessageBox::Ok, 0 ); PreferencesDialog dialog; dialog.exec(); } }
void MainWindow::init() { auto* dropLabel = new DropLabel(this); connect(ui->action_Preferences, &QAction::triggered, [&]() { PreferencesDialog dialog; dialog.exec(); }); connect(ui->imageProcessingModeBox, &QComboBox::currentTextChanged, [&](const QString &text) { ui->noiseReductionLevel->setEnabled(text.contains("noise")); ui->scaleRatioBox->setEnabled(text.contains("scale")); }); connect(dropLabel, SIGNAL(fileDropped(QString)), this, SLOT(processImage(QString))); connect(ui->browseButton, SIGNAL(clicked(bool)), this, SLOT(browseImage())); connect(ui->action_Open_image, &QAction::triggered, this, &MainWindow::browseImage); connect(ui->action_About_waifu2x_converter_qt, &QAction::triggered, [&]() { AboutDialog dialog; dialog.exec(); }); connect(ui->actionAbout_Qt, &QAction::triggered, qApp, &QApplication::aboutQt); connect(ui->actionE_xit, &QAction::triggered, qApp, &QApplication::quit); setWindowTitle(QApplication::applicationName()); ui->action_Open_image->setIcon(style()->standardIcon(QStyle::SP_DirOpenIcon)); ui->actionE_xit->setIcon(style()->standardIcon(QStyle::SP_DialogCloseButton)); ui->action_About_waifu2x_converter_qt->setIcon(style()->standardIcon(QStyle::SP_DialogHelpButton)); ui->verticalLayout_2->insertWidget(0, dropLabel, 1); ui->threadsBox->setValue(m_settings->threadsCount()); ui->scaleRatioBox->setValue(m_settings->scaleRatio()); ui->noiseReductionLevel->setValue(m_settings->noiseReductionLevel()); ui->imageProcessingModeBox->setCurrentText(m_settings->imageProcessingMode()); }
void MainWindow::openPreferences() { PreferencesDialog *preferences = new PreferencesDialog(this); preferences->exec(); delete preferences; }