void MainWindow::createMenu() { m_appMenu = menuBar()->addMenu(tr("&Bluecherry")); m_browseEventsAction = m_appMenu->addAction(tr("Browse &events"), this, SLOT(showEventsWindow())); m_downloadManagerAction = m_appMenu->addAction(tr("Show &download manager"), this, SLOT(showDownloadsWindow())); m_appMenu->addSeparator(); m_addServerAction = m_appMenu->addAction(tr("Add another server"), this, SLOT(addServer())); m_optionsAction = m_appMenu->addAction(tr("&Options"), this, SLOT(showOptionsDialog())); m_appMenu->addSeparator(); m_quitAction = m_appMenu->addAction(tr("&Quit"), qApp, SLOT(quit())); m_serversMenu = menuBar()->addMenu(QString()); updateServersMenu(); m_liveMenu = menuBar()->addMenu(tr("&Live")); updateLiveMenu(); connect(m_serverRepository, SIGNAL(serverAdded(DVRServer*)), SLOT(updateServersMenu())); connect(m_serverRepository, SIGNAL(serverRemoved(DVRServer*)), SLOT(updateServersMenu())); connect(bcApp->liveView, SIGNAL(bandwidthModeChanged(int)), SLOT(bandwidthModeChanged(int))); m_helpMenu = menuBar()->addMenu(tr("&Help")); m_documentationAction = m_helpMenu->addAction(tr("&Documentation"), this, SLOT(openDocumentation())); m_supportAction = m_helpMenu->addAction(tr("Bluecherry &support"), this, SLOT(openSupport())); m_suggestionsAction = m_helpMenu->addAction(tr("Suggest a &feature"), this, SLOT(openIdeas())); m_helpMenu->addSeparator(); m_aboutAction = m_helpMenu->addAction(tr("&About Bluecherry"), this, SLOT(openAbout())); }
HelpMenu::HelpMenu(const WindowManager &manager, QWidget *parent) : QMenu(parent) { setTitle(tr("Help")); openDocumentationAct = addAction(tr("Documentation")); connect(openDocumentationAct, SIGNAL(triggered()), &manager, SLOT(openDocumentation())); }
MainWindow::MainWindow() { // User interface ---------------------------------------------------------- if (tr("LTR") == "RTL") { qApp->setLayoutDirection(Qt::RightToLeft); } setupUi(this); network_access_manager = new QNetworkAccessManager(this); default_printer = NULL; #ifdef Q_OS_MAC this->setUnifiedTitleAndToolBarOnMac(true); #endif progressBar = new QProgressBar(this); progressBar->setTextVisible(false); progressBar->resize(QSize(30, 10)); statusBar()->addPermanentWidget(progressBar, 0); statusBar()->setFixedHeight(20); progressBar->setFixedWidth(150); progressBar->setFixedHeight(15); progressBar->setVisible(false); LQCategoryComboBox->setVisible(false); SQStatisticsLabel->setVisible(false); currentSvgChanged(); btnApply = SQButtonBox->button(QDialogButtonBox::Apply); btnApply->setText(tr("Apply")); btnApply->setStatusTip(tr("Apply any changes you have made to the question")); btnApply->setIcon(QIcon(QString::fromUtf8(":/images/images/button_ok.png"))); btnDiscard = SQButtonBox->button(QDialogButtonBox::Discard); btnDiscard->setText(tr("Discard")); btnDiscard->setStatusTip(tr("Discard any changes you have made to the question")); btnDiscard->setIcon(QIcon(QString::fromUtf8(":/images/images/button_cancel.png"))); SQQuestionTextEdit->setTitle(tr("Question:")); SQQuestionTextEdit->textEdit()->setStatusTip(tr("Text of the selected question")); ECTextEdit->setTitle(tr("Comments:")); ECTextEdit->textEdit()->setStatusTip(tr("Use this field for your comments, notes, reminders...")); EFTreeWidget->setMouseTracking(true); EFTreeWidget->header()->setSectionResizeMode(0, QHeaderView::Fixed); EFTreeWidget->header()->setSectionResizeMode(1, QHeaderView::Stretch); EFTreeWidget->header()->setSectionResizeMode(2, QHeaderView::ResizeToContents); EFButtonBox->button(QDialogButtonBox::Apply)->setText(tr("Apply")); EFButtonBox->button(QDialogButtonBox::Apply)->setStatusTip(tr("Apply any changes you have made to the categories")); EFButtonBox->button(QDialogButtonBox::Apply)->setIcon(QIcon(QString::fromUtf8(":/images/images/button_ok.png"))); EFButtonBox->button(QDialogButtonBox::Discard)->setText(tr("Discard")); EFButtonBox->button(QDialogButtonBox::Discard)->setStatusTip(tr("Discard any changes you have made to the categories")); EFButtonBox->button(QDialogButtonBox::Discard)->setIcon(QIcon(QString::fromUtf8(":/images/images/button_cancel.png"))); // Initialize variables ---------------------------------------------------- // URLs docs_url = tr("http://itest.sourceforge.net/documentation/%1/en/").arg("1.4"); // i18n QTranslator translator; translator.load(":/i18n/iTest-i18n.qm"); itest_i18n.insert("English", "en"); itest_i18n.insert(translator.translate("LanguageNames", "Slovak"), "sk"); itest_i18n.insert(translator.translate("LanguageNames", "Russian"), "ru"); itest_i18n.insert(translator.translate("LanguageNames", "Turkish"), "tr"); itest_i18n.insert(translator.translate("LanguageNames", "Portuguese"), "pt"); itest_i18n.insert(translator.translate("LanguageNames", "Spanish"), "es"); itest_i18n.insert(translator.translate("LanguageNames", "Italian"), "it"); itest_i18n.insert(translator.translate("LanguageNames", "Latvian"), "lv"); itest_i18n.insert(translator.translate("LanguageNames", "Ukrainian"), "uk"); itest_i18n.insert(translator.translate("LanguageNames", "Czech"), "cs"); itest_i18n.insert(translator.translate("LanguageNames", "Hungarian"), "hu"); itest_i18n.insert(translator.translate("LanguageNames", "German"), "de"); // CURRENT_DB current_db_open = false; current_db_session = NULL; current_db_class = NULL; current_db_categories.resize(20); current_db_categories_enabled.resize(20); // Connect slots ----------------------------------------------------------- tbtnAddQuestion->setDefaultAction(actionAdd); tbtnDuplicateQuestion->setDefaultAction(actionDuplicate); tbtnDeleteQuestion->setDefaultAction(actionDelete); QObject::connect(actionAdd, SIGNAL(triggered()), this, SLOT(addQuestion())); QObject::connect(actionDelete, SIGNAL(triggered()), this, SLOT(deleteQuestion())); QObject::connect(actionDuplicate, SIGNAL(triggered()), this, SLOT(duplicateQuestion())); QObject::connect(btnApply, SIGNAL(released()), this, SLOT(applyQuestionChanges())); QObject::connect(actionApply, SIGNAL(triggered()), this, SLOT(applyQuestionChanges())); QObject::connect(btnDiscard, SIGNAL(released()), this, SLOT(discardQuestionChanges())); QObject::connect(actionDiscard, SIGNAL(triggered()), this, SLOT(discardQuestionChanges())); QObject::connect(actionNew, SIGNAL(triggered()), this, SLOT(newDB())); QObject::connect(btnNew, SIGNAL(released()), this, SLOT(newDB())); QObject::connect(actionOpen, SIGNAL(triggered()), this, SLOT(open())); QObject::connect(btnOpenOther, SIGNAL(released()), this, SLOT(open())); QObject::connect(btnOpenSelected, SIGNAL(released()), this, SLOT(openRecent())); QObject::connect(actionSave, SIGNAL(triggered()), this, SLOT(save())); QObject::connect(actionSave_as, SIGNAL(triggered()), this, SLOT(saveAs())); QObject::connect(actionSave_a_copy, SIGNAL(triggered()), this, SLOT(saveCopy())); QObject::connect(actionExport_CSV, SIGNAL(triggered()), this, SLOT(exportCSV())); QObject::connect(actionClose, SIGNAL(triggered()), this, SLOT(closeDB())); QObject::connect(actionQuit, SIGNAL(triggered()), this, SLOT(quit())); QObject::connect(actionAbout, SIGNAL(triggered()), this, SLOT(about())); QObject::connect(recentDBsListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(openRecent(QListWidgetItem *))); QObject::connect(LQListWidget, SIGNAL(currentTextChanged(QString)), this, SLOT(setCurrentQuestion())); QObject::connect(actionFrom_A_to_Z, SIGNAL(triggered()), this, SLOT(sortQuestionsAscending())); QObject::connect(actionFrom_Z_to_A, SIGNAL(triggered()), this, SLOT(sortQuestionsDescending())); QObject::connect(actionBy_category, SIGNAL(triggered()), this, SLOT(sortQuestionsByCategory())); tbtnAddSVG->setDefaultAction(actionAdd_SVG); tbtnRemoveSVG->setDefaultAction(actionRemove_SVG); tbtnEditSVG->setDefaultAction(actionEdit_SVG); tbtnExportSVG->setDefaultAction(actionExport_SVG); QObject::connect(actionAdd_SVG, SIGNAL(triggered()), this, SLOT(addSvg())); QObject::connect(actionRemove_SVG, SIGNAL(triggered()), this, SLOT(removeSvg())); QObject::connect(actionEdit_SVG, SIGNAL(triggered()), this, SLOT(editSvg())); QObject::connect(actionExport_SVG, SIGNAL(triggered()), this, SLOT(exportSvg())); QObject::connect(SQSVGListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(previewSvg(QListWidgetItem *))); QObject::connect(SQSVGListWidget, SIGNAL(currentTextChanged(QString)), this, SLOT(currentSvgChanged())); tbtnMoveUp->setDefaultAction(actionMove_up); tbtnMoveDown->setDefaultAction(actionMove_down); QObject::connect(actionMove_up, SIGNAL(triggered()), this, SLOT(moveUp())); QObject::connect(actionMove_down, SIGNAL(triggered()), this, SLOT(moveDown())); QObject::connect(actionMove_to_top, SIGNAL(triggered()), this, SLOT(moveToTop())); QObject::connect(actionMove_to_bottom, SIGNAL(triggered()), this, SLOT(moveToBottom())); QObject::connect(actionHide, SIGNAL(triggered()), this, SLOT(hideQuestion())); QObject::connect(actionShow_hidden, SIGNAL(triggered()), this, SLOT(filterLQSearch())); rbtngrpFilterLQ = new QButtonGroup(this); rbtngrpFilterLQ->addButton(LQAllRadioButton); rbtngrpFilterLQ->addButton(LQEasyRadioButton); rbtngrpFilterLQ->addButton(LQMediumRadioButton); rbtngrpFilterLQ->addButton(LQDifficultRadioButton); rbtngrpFilterLQ->addButton(LQCategoryRadioButton); actgrpFilterLQ = new QActionGroup(this); actgrpFilterLQ->addAction(actionShow_all); actgrpFilterLQ->addAction(actionShow_easy); actgrpFilterLQ->addAction(actionShow_medium); actgrpFilterLQ->addAction(actionShow_difficult); actgrpFilterLQ->addAction(actionShow_category); QObject::connect(rbtngrpFilterLQ, SIGNAL(buttonReleased(QAbstractButton *)), this, SLOT(filterLQ(QAbstractButton *))); QObject::connect(actgrpFilterLQ, SIGNAL(triggered(QAction *)), this, SLOT(filterLQAction(QAction *))); QObject::connect(LQCategoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(filterLQCategoryChanged())); QObject::connect(LQSearchLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterLQSearch())); QObject::connect(tbtnSearchByGroup, SIGNAL(released()), this, SLOT(searchByGroup())); actgrpPage = new QActionGroup(this); actgrpPage->addAction(actionEdit_questions); actgrpPage->addAction(actionEdit_comments); actgrpPage->addAction(actionEdit_categories); actgrpPage->addAction(actionEdit_test); actgrpPage->addAction(actionSaved_sessions); actgrpPage->addAction(actionEdit_classes); QObject::connect(actgrpPage, SIGNAL(triggered(QAction *)), this, SLOT(setPage(QAction *))); //QObject::connect(btnApply, SIGNAL(released()), this, SLOT(setDatabaseModified())); //QObject::connect(actionApply, SIGNAL(triggered()), this, SLOT(setDatabaseModified())); QObject::connect(ECTextEdit, SIGNAL(textChanged()), this, SLOT(setDatabaseModified())); QObject::connect(actionCheck_for_updates, SIGNAL(triggered()), this, SLOT(checkForUpdates())); QObject::connect(network_access_manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(httpRequestFinished(QNetworkReply *))); QObject::connect(actionDocumentation, SIGNAL(triggered()), this, SLOT(openDocumentation())); QObject::connect(SQStatisticsLabel, SIGNAL(linkActivated(QString)), this, SLOT(adjustQuestionDifficulty())); QObject::connect(actionPrint_questions, SIGNAL(triggered()), this, SLOT(showPrintQuestionsDialogue())); QObject::connect(actionOverall_statistics, SIGNAL(triggered()), this, SLOT(overallStatistics())); QObject::connect(actionChange_language, SIGNAL(triggered()), this, SLOT(changeLanguage())); QObject::connect(mainStackedWidget, SIGNAL(currentChanged(int)), this, SLOT(currentPageChanged(int))); // Disable all ------------------------------------------------------------- setAllEnabled(false); // Categories ------------------------------------------------------------------- setupCategoriesPage(); // Server ------------------------------------------------------------------ setupServer(); // Session viewer ---------------------------------------------------------- setupSessionViewer(); // Class viewer ------------------------------------------------------------ setupClassViewer(); // ------------------------------------------------------------------------- #ifdef Q_OS_MAC show(); #endif // Load settings ----------------------------------------------------------- loadSettings(); // Ready ------------------------------------------------------------------- statusBar()->showMessage(tr("Ready"), 10000); // Check app args ---------------------------------------------------------- if (qApp->arguments().count() > 1) { openFile(qApp->arguments().at(1)); } // ------------------------------------------------------------------------- #ifndef Q_OS_MAC show(); #endif }
MainGui::MainGui(QWidget *p) : QMainWindow(p), currenthdr(NULL) { setupUi(this); setAcceptDrops(true); //main toolbar setup QActionGroup *toolBarOptsGroup = new QActionGroup(this); toolBarOptsGroup->addAction(actionText_Under_Icons); toolBarOptsGroup->addAction(actionIcons_Only); toolBarOptsGroup->addAction(actionText_Alongside_Icons); toolBarOptsGroup->addAction(actionText_Only); menuToolbars->addAction(toolBar->toggleViewAction()); mdiArea = new QMdiArea(this); mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); mdiArea->setBackground(QBrush(QColor::fromRgb(192, 192, 192)) ); setCentralWidget(mdiArea); qtpfsgui_options=QtpfsguiOptions::getInstance(); load_options(); setWindowTitle("Qtpfsgui "QTPFSGUIVERSION); connect(mdiArea,SIGNAL(subWindowActivated(QMdiSubWindow*)),this,SLOT(updateActions(QMdiSubWindow*))); connect(fileNewAction, SIGNAL(triggered()), this, SLOT(fileNewViaWizard())); connect(fileOpenAction, SIGNAL(triggered()), this, SLOT(fileOpen())); connect(fileSaveAsAction, SIGNAL(triggered()), this, SLOT(fileSaveAs())); connect(TonemapAction, SIGNAL(triggered()), this, SLOT(tonemap_requested())); connect(rotateccw, SIGNAL(triggered()), this, SLOT(rotateccw_requested())); connect(rotatecw, SIGNAL(triggered()), this, SLOT(rotatecw_requested())); connect(actionResizeHDR, SIGNAL(triggered()), this, SLOT(resize_requested())); connect(action_Projective_Transformation, SIGNAL(triggered()), this, SLOT(projectiveTransf_requested())); connect(actionBatch_Tone_Mapping, SIGNAL(triggered()), this, SLOT(batch_requested())); connect(Low_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_ldr_exp())); connect(Fit_to_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_fit_exp())); connect(Shrink_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_shrink_exp())); connect(Extend_dynamic_range,SIGNAL(triggered()),this,SLOT(current_mdi_extend_exp())); connect(Decrease_exposure,SIGNAL(triggered()),this,SLOT(current_mdi_decrease_exp())); connect(Increase_exposure,SIGNAL(triggered()),this,SLOT(current_mdi_increase_exp())); connect(zoomInAct,SIGNAL(triggered()),this,SLOT(current_mdi_zoomin())); connect(zoomOutAct,SIGNAL(triggered()),this,SLOT(current_mdi_zoomout())); connect(fitToWindowAct,SIGNAL(toggled(bool)),this,SLOT(current_mdi_fit_to_win(bool))); connect(normalSizeAct,SIGNAL(triggered()),this,SLOT(current_mdi_original_size())); connect(documentationAction,SIGNAL(triggered()),this,SLOT(openDocumentation())); connect(actionWhat_s_This,SIGNAL(triggered()),this,SLOT(enterWhatsThis())); connect(actionAbout_Qt,SIGNAL(triggered()),qApp,SLOT(aboutQt())); connect(actionAbout_Qtpfsgui,SIGNAL(triggered()),this,SLOT(aboutQtpfsgui())); connect(OptionsAction,SIGNAL(triggered()),this,SLOT(preferences_called())); connect(Transplant_Exif_Data_action,SIGNAL(triggered()),this,SLOT(transplant_called())); connect(actionTile,SIGNAL(triggered()),mdiArea,SLOT(tileSubWindows())); connect(actionCascade,SIGNAL(triggered()),mdiArea,SLOT(cascadeSubWindows())); connect(fileExitAction, SIGNAL(triggered()), this, SLOT(fileExit())); connect(menuWindows, SIGNAL(aboutToShow()), this, SLOT(updateWindowMenu())); connect(actionSave_Hdr_Preview, SIGNAL(triggered()), this, SLOT(saveHdrPreview())); //QSignalMapper? connect(actionText_Under_Icons,SIGNAL(triggered()),this,SLOT(Text_Under_Icons())); connect(actionIcons_Only,SIGNAL(triggered()),this,SLOT(Icons_Only())); connect(actionText_Alongside_Icons,SIGNAL(triggered()),this,SLOT(Text_Alongside_Icons())); connect(actionText_Only,SIGNAL(triggered()),this,SLOT(Text_Only())); windowMapper = new QSignalMapper(this); connect(windowMapper,SIGNAL(mapped(QWidget*)),this,SLOT(setActiveSubWindow(QWidget*))); //recent files for (int i = 0; i < MaxRecentFiles; ++i) { recentFileActs[i] = new QAction(this); recentFileActs[i]->setVisible(false); connect(recentFileActs[i], SIGNAL(triggered()), this, SLOT(openRecentFile())); } separatorRecentFiles = menuFile->addSeparator(); for (int i = 0; i < MaxRecentFiles; ++i) menuFile->addAction(recentFileActs[i]); updateRecentFileActions(); //this->showMaximized(); testTempDir(qtpfsgui_options->tempfilespath); statusBar()->showMessage(tr("Ready.... Now open an Hdr or create one!"),17000); }