void MainWindow::showOptions() { ConfigDialog *options = new ConfigDialog(); #ifdef SG_GLOBAL_SHORTCUTS globalShortcutBlock(true); #endif if (isMinimized()) { showNormal(); if (options->exec() == QDialog::Accepted) updateUI(); hideToShot(); } else { if (options->exec() == QDialog::Accepted) updateUI(); } #ifdef SG_GLOBAL_SHORTCUTS globalShortcutBlock(false); #endif delete options; }
/* Plugin might offer a configuration window. If ts3plugin_offersConfigure returns 0, this function does not need to be implemented. */ void ts3plugin_configure(void* handle, void* qParentWidget) { debuglog("GW2Plugin: configure\n"); ConfigDialog qConfigDialog; qConfigDialog.SetupUi(); qConfigDialog.exec(); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(configdialog); QApplication app(argc, argv); ConfigDialog dialog; return dialog.exec(); }
void MainWindow::openSettingsWindow() { this->hide(); ConfigDialog dialog; dialog.exec(); this->show(); this->loadPref(); }
void soundKonverter::showConfigDialog() { ConfigDialog *dialog = new ConfigDialog( config, this/*, ConfigDialog::Page(configStartPage)*/ ); connect( dialog, SIGNAL(updateFileList()), m_view, SLOT(updateFileList()) ); dialog->resize( size() ); dialog->exec(); delete dialog; }
void KueueApp::openConfig() { ConfigDialog* c = new ConfigDialog( mWindow ); connect( c, SIGNAL( settingsChanged() ), this, SLOT( settingsChanged() ) ); c->exec(); delete c; }
void MainWindow::configDialog() { if(this->visitorMode == true) { QMessageBox::warning(this, QString::fromLocal8Bit("失败"), QString::fromLocal8Bit("游客身份无法修改配置文件")); return; } ConfigDialog *configDialog = new ConfigDialog(this); configDialog->setDefaultInfo(this->configInfo); connect(configDialog, &ConfigDialog::configChanged, this, &MainWindow::setConfig); configDialog->exec(); }
void MainWindow::onPreferencesPressed() { ConfigDialog configdialog; if (configdialog.exec()) { util::Config::instance().save("data/config.xml"); MessageDialog("The configuration has been saved.", "You should restart the program in order to activate the changes.", gui::MessageDialog::QINFO); } else { util::Config::instance().destroy(); util::Config::instance().load("data/config.xml"); } }
void MainWindow::on_actionPreferences_triggered() { ConfigDialog *dialog = new ConfigDialog(); dialog->exec(); /* TODO */ }
void Datenums::configure(QWidget *parent) { ConfigDialog *dlg = new ConfigDialog(parent); dlg->exec(); delete dlg; }
int P300ClassifierMain( int argc, char **argv, QApplication& app ) { ConfigDialog dialog; CCmdLine cmdLine; QString arg_TrainingDataFiles; QString arg_TestingDataFiles; QString arg_inicfg; QStringList arg_TrainingDataFilesList; QStringList arg_TestingDataFilesList; bool barg_TrainingDataFiles; bool barg_TestingDataFiles; bool barg_inicfg; cmdLine.SplitLine(argc, argv); barg_TrainingDataFiles =cmdLine.HasSwitch("-TrainingDataFiles"); barg_TestingDataFiles =cmdLine.HasSwitch("-TestingDataFiles"); barg_inicfg =cmdLine.HasSwitch("-inicfg"); //int co = cmdLine.GetArgumentCount("-TrainingDataFiles"); if (barg_TrainingDataFiles) { for (int i=0; i<cmdLine.GetArgumentCount("-TrainingDataFiles"); i++) { arg_TrainingDataFiles = arg_TrainingDataFiles.fromStdString(cmdLine.GetArgument("-TrainingDataFiles",i)); arg_TrainingDataFilesList.insert(i, arg_TrainingDataFiles); } } else { arg_TrainingDataFiles = ""; } if (barg_TestingDataFiles) { for (int i=0; i<cmdLine.GetArgumentCount("-TestingDataFiles"); i++) { arg_TestingDataFiles = arg_TestingDataFiles.fromStdString(cmdLine.GetArgument("-TestingDataFiles",i)); arg_TestingDataFilesList.insert(i, arg_TestingDataFiles); } } else { arg_TestingDataFiles = ""; } if (barg_inicfg) { arg_inicfg = arg_inicfg.fromStdString(cmdLine.GetArgument("-inicfg",0)); } else { arg_inicfg = ""; } QString classifierOutputFile = cmdLine.GetSafeArgument( "-ClassifierOutputFile", 0, "" ).c_str(); dialog.SetFiles(arg_TrainingDataFilesList, arg_TestingDataFilesList, arg_inicfg, classifierOutputFile); return dialog.exec(); }
int main(int argc, char* argv[]) { QApplication app(argc, argv); //all the translation stuff was taken from minitube const QString locale = QLocale::system().name(); // qt translations QTranslator qtTranslator; qtTranslator.load("qt_" + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); app.installTranslator(&qtTranslator); // app translations QString dataDir = QLatin1String(PKGDATADIR); qDebug() << __METHOD_NAME__ << "Data dir: " << __FUNCTION__ << dataDir; #ifdef USE_DEVELOPING qDebug() << __METHOD_NAME__ << "Developing"; QString localeDir = qApp->applicationDirPath() + QDir::separator() + "locale"; #else qDebug() << __METHOD_NAME__ << "Not developing"; #if defined(Q_OS_OS2) //|| defined(Q_OS_WIN) ->this isn't checked QString localeDir = qApp->applicationDirPath() + QDir::separator() + "locale"; #else QString localeDir = dataDir + QDir::separator() + "locale"; #endif #endif qDebug() << __METHOD_NAME__ << "Locale dir: " << localeDir; QTranslator translator; translator.load(locale, localeDir); app.installTranslator(&translator); #ifndef Q_OS_LINUX QString BUILTIN_ICON_THEME = "oxygen"; QIcon::setThemeName(BUILTIN_ICON_THEME); #endif /** *command line stuff */ int next_option; int re = 0; const char* const short_options = "hevc"; const struct option long_options[] = { {"help", 0, NULL, 'h'}, {"eggs", 0, NULL, 'e'}, {"version", 0, NULL, 'v'}, {"configure",0, NULL, 'c'}, {NULL, 0, NULL, 0} }; next_option = getopt_long(argc, argv, short_options, long_options, NULL); if (next_option == 'h') { std::cout << QString("If you have problems with the toolbar and the actions, try deleting the file .config/QIviewer/qiviewer.conf\n" "How to use: qiviewer [OPTION/FILE]\n" "Avaible options:\n" " -h --help shows this help and finish\n" " -v --version shows qiviewer version\n" " -e --eggs shows eggs dialog\n" " -c --configuration shows the configuration dialog\n").toStdString(); re = 0; } else if (next_option == 'c') { ConfigDialog con; con.setWindowTitle("QIviewer configuration"); con.exec(); re = 0; } else if (next_option == '?') { std::cout << QString("Try 'qiviewer --help' for more information\n").toStdString(); re = 0; } else if (next_option == 'v') { std::cout << QString("QIviewer %1\n" "Copyright (C) 2011 Aguilera Dario.\n" "License GPLv2+.\n" "<http://gnu.org/licenses/gpl.html>.\n" "This is free software: you are free to change it and redistribute.\n" "There is NO WARRANTY.\n" ).arg(QLatin1String(PROJECT_VERSION)).toStdString(); re = 0; } else if (next_option == 'e') { EggsDialog ed; re = ed.exec(); } else if (next_option == -1) { MainWindow imageViewer; if (QApplication::arguments().size() > 1) imageViewer.openImageFromCommandLine(QApplication::arguments()); imageViewer.show(); re = app.exec(); } return re; }