void MainWindow::slotShowPreferencesDialog() { PreferencesDialog dialog; dialog.exec(); // Use the new flow method (if it has changed) m_project->reloadFlowSource(); }
void MainWindow::on_actionEditPreferences_triggered() { PreferencesDialog prefDialog; prefDialog.setModal(true); prefDialog.exec(); }
void Window::vOnGeneralConfigure() { std::string sUiFile = sGetUiFilePath("preferences.ui"); Glib::RefPtr<Gtk::Builder> poBuilder = Gtk::Builder::create_from_file(sUiFile); PreferencesDialog * poDialog = 0; poBuilder->get_widget_derived("PreferencesDialog", poDialog); poDialog->vSetConfig(m_poCoreConfig, this); poDialog->set_transient_for(*this); poDialog->run(); poDialog->hide(); }
void MainWindow::slotPreferences() { //never reuse the preference dialog, to make sure its settings are always reloaded PreferencesDialog * dialog = new PreferencesDialog( this, Settings::self() ); dialog->setAttribute(Qt::WA_DeleteOnClose); // keep us informed when the user changes settings connect( dialog, SIGNAL(settingsChanged(QString)), this, SLOT(slotNewConfig()) ); dialog->show(); }
void MainWindow2::preferences() { PreferencesDialog* prefDialog = new PreferencesDialog( this ); prefDialog->setAttribute( Qt::WA_DeleteOnClose ); prefDialog->init( mEditor->preference() ); connect( prefDialog, &PreferencesDialog::windowOpacityChange, this, &MainWindow2::setOpacity ); connect( prefDialog, &PreferencesDialog::finished, [ &] { qDebug() << "Preference dialog closed!"; clearKeyboardShortcuts(); setupKeyboardShortcuts(); } ); prefDialog->show(); }
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; }
pascal OSStatus PreferencesDialog::WindowEventHandler(EventHandlerCallRef myHandler, EventRef event, void* userData) { OSStatus result = eventNotHandledErr; UInt32 eventClass, eventKind; eventClass = GetEventClass(event); eventKind = GetEventKind(event); PreferencesDialog* prefDlg = reinterpret_cast<PreferencesDialog*>(userData); switch (eventClass) { case kEventClassControl: { ControlRef targetControl = NULL; ControlID targetControlID; GetEventParameter(event, kEventParamDirectObject, typeControlRef, NULL, sizeof(targetControl), NULL, &targetControl); if (targetControl) GetControlID(targetControl, &targetControlID); switch (eventKind) { case kEventControlHit: { switch (targetControlID.id) { // simulate insert key with ctrl+up case 131: prefDlg->setFakeInsertKey(GetControl32BitValue(targetControl)-1); result = noErr; break; // 15 bit color toggle case 132: prefDlg->toggleUse15BitColorDepth(); result = noErr; break; // Enable MIDI device case 129: prefDlg->toggleUseMidiDevice(); result = noErr; break; // Save MIDI preferences case 128: prefDlg->toggleSavePreferences(); result = noErr; break; // Record key velocity case 127: prefDlg->toggleRecordVelocity(); result = noErr; break; // velocity amplify slider case 125: { prefDlg->storeVelocityAmplify(GetControlValue(targetControl)); result = noErr; break; } } break; } } break; } // Handle window close event (= discard) case kEventClassWindow: { switch (eventKind) { case kEventWindowClose: { prefDlg->restoreDataBase(); prefDlg->hide(); result = noErr; break; } } break; } case kEventClassCommand: { switch (eventKind) { case kEventCommandProcess: { HICommand command; GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(HICommand), NULL, &command); switch (command.commandID) { case kDiscardPreferences: prefDlg->restoreDataBase(); case kConfirmPreferences: { // These two events are better off when sent to the main window SendEventToWindow(event, prefDlg->mainWindow); break; } default: // Handle MIDI device selection from pop-up menu if (command.commandID >= kMIDIDeviceBaseCommand && command.commandID <= kMIDIDeviceBaseCommand + prefDlg->getNumMidiDevices()) { prefDlg->storeMidiDeviceName(command.commandID - kMIDIDeviceBaseCommand); result = noErr; } } break; } } break; } } return result; }
void MainWindow::MessageReceived(BMessage* message) { switch (message->what) { case kSearchContact: { void* control = NULL; if (message->FindPointer("source", &control) != B_OK) return; SearchBarTextControl* searchBox = static_cast<SearchBarTextControl*>(control); if (searchBox == NULL) return; RosterMap map = fServer->RosterItems(); for (uint32 i = 0; i < map.CountItems(); i++) { ContactLinker* linker = map.ValueAt(i); RosterItem* item = linker->GetRosterItem(); // If the search filter has been deleted show all the items, // otherwise remove the item in order to show only items // that matches the search criteria if (strcmp(searchBox->Text(), "") == 0) AddItem(item); else if (linker->GetName().IFindFirst(searchBox->Text()) == B_ERROR) RemoveItem(item); else AddItem(item); UpdateListItem(item); } break; } case CAYA_SHOW_SETTINGS: { PreferencesDialog* dialog = new PreferencesDialog(); dialog->Show(); break; } case CAYA_OPEN_CHAT_WINDOW: { int index = message->FindInt32("index"); RosterItem* ritem = ItemAt(index); if (ritem != NULL) ritem->GetContactLinker()->ShowWindow(false, true); break; } case CAYA_REPLICANT_STATUS_SET: { int32 status; message->FindInt32("status", &status); AccountManager* accountManager = AccountManager::Get(); accountManager->SetStatus((CayaStatus)status); break; } case CAYA_REPLICANT_SHOW_WINDOW: { if (LockLooper()) { SetWorkspaces(B_CURRENT_WORKSPACE); if ((IsMinimized() || IsHidden()) || fWorkspaceChanged) { Minimize(false); Show(); fWorkspaceChanged = false; } else if ((!IsMinimized() || !IsHidden()) || (!fWorkspaceChanged)) { Minimize(true); } UnlockLooper(); } break; } case IM_MESSAGE: ImMessage(message); break; case IM_ERROR: ImError(message); break; case B_ABOUT_REQUESTED: be_app->PostMessage(message); break; default: BWindow::MessageReceived(message); } }
//**************************************************************************** // Load the preferences dialog void MainWindow::LoadPreferences () { PreferencesDialog* preferences = new PreferencesDialog(); preferences->show(); }
//************************************************************************************ void QRap::Preferences() { PreferencesDialog *Preferences = new PreferencesDialog(); Preferences->show(); }