void MainWindow::slot_languageChanged(int) { QMessageBox mb(tr("Change Language?"), QString(tr("Changing the language requires restarting qGo. Go ahead?\n")), QMessageBox::Question, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape, QMessageBox::NoButton); if (mb.exec() == QMessageBox::Yes) { if(ui.connectionWidget->closeConnection() < 0) goto lc_no_close; if(checkForOpenBoards() < 0) goto lc_no_close; saveSettings(); startqGo(); } else { lc_no_close: QSettings settings; ui.comboBox_language->blockSignals(true); ui.comboBox_language->setCurrentIndex(settings.value("LANGUAGE").toInt()); ui.comboBox_language->blockSignals(false); } }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(application); QApplication * app = new QApplication(argc, argv); QTranslator translator; app->setOrganizationName("qGo"); app->setApplicationName("qGo"); translatorPtr = &translator; startqGo(); if ( argc > 1 ) { // FIXME qDebug("Opening files from command line not supported at the moment."); } else { mainwindow->show(); } srand(time(NULL)); return app->exec(); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(application); QApplication * app = new QApplication(argc, argv); QTranslator translator; app->setOrganizationName("qGo"); app->setApplicationName("qGo"); QCommandLineParser parser; parser.process(*app); const QStringList args = parser.positionalArguments(); translatorPtr = &translator; startqGo(); mainwindow->show(); QStringList::const_iterator filename; for ( filename = args.begin(); filename != args.end(); ++filename ) { mainwindow->openSGF(*filename); } //srand(time(NULL)); return app->exec(); }
int main(int argc, char *argv[]) { Q_INIT_RESOURCE(application); QApplication app(argc, argv); QTranslator translator; QString *sgf_file = NULL; QCoreApplication::setOrganizationName("qGo"); QCoreApplication::setApplicationName("qGo"); appPtr = &app; translatorPtr = &translator; startqGo(); if ( argc > 1 ) { sgf_file = new QString( argv[1] ); } if ( sgf_file ) { bool success = mainwindow->loadSgfFile( *sgf_file ); delete sgf_file; if(!success) return -1; //mainwindow->hide(); } else { mainwindow->show(); } srand(time(NULL)); return app.exec(); }