void MainWindow::MenuEvents() { this->connect(this->menu.load_img, SIGNAL(triggered()), this, SLOT(getFiles())); this->connect(this->menu.compare_img, SIGNAL(triggered()), this, SLOT(compareFiles())); this->connect(this->menu.exit, SIGNAL(triggered()), this, SLOT(close())); this->connect(this->menu.about, SIGNAL(triggered()), this, SLOT(aboutDialog())); }
void CtiClientWindow::about() { QString serviceData = QStringLiteral(""); for (QStringHash::const_iterator i = this->config->services.constBegin(); i != this->config->services.constEnd(); i++) { const QString serviceName = i.key(); QString serviceType = i.value(); if (serviceType == QStringLiteral("Inbound")) serviceType = tr("Inbound"); else if (serviceType == QStringLiteral("Outbound")) serviceType = tr("Outbound"); else if (serviceType == QStringLiteral("Queue")) serviceType = tr("Queue"); serviceData.append(QString("<b>%1</b> - %2").arg(serviceName).arg(serviceType)); if (i.value() == QStringLiteral("Queue")) { AstCtiAgentStatus status = this->config->extensions.at(0)->queues.value(serviceName); serviceData.append(QString(" (%1)").arg(agentStatusToString(status))); } serviceData.append(QStringLiteral("<br>")); } AboutDialog aboutDialog(serviceData); aboutDialog.exec(); }
void YouCam::on_centralWidget_customContextMenuRequested(const QPoint &pos) { QMenu *menu=new QMenu(this); menu->setFont(QFont("Ubuntu", 9)); menu->setStyleSheet("border:0px;margin:0px;padding:0px;"); // menu->actions().at(1)->setFont(QFont("Ubuntu", 7)); menu->addAction(QString("About"),this,SLOT(aboutDialog())); menu->popup(ui->viewfinder->mapToGlobal(pos)); }
//------------------------------------------------------------------------- void MainWindow::openAboutDialog() { QDialog aboutDialog(this, Qt::Tool); Ui::AboutDialog ui; ui.setupUi(&aboutDialog); std::string scoutVersion("<html>"); scoutVersion += APP::Application::getScoutFullVersionInfo(); scoutVersion += "\nQT version " QT_VERSION_STR "\n\n<a href=\"http://scout.zih.tu-dresden.de\">http://scout.zih.tu-dresden.de</a></html>"; boost::algorithm::replace_all(scoutVersion, "\n", "<br>"); ui.VersionText->setText(scoutVersion.c_str()); aboutDialog.exec(); }
MenuBar::MenuBar() { init(); connect(newPlaylist, SIGNAL(triggered()), this, SLOT(createNewPlaylist())); connect(openFile, SIGNAL(triggered()), this, SLOT(open())); connect(delPlaylist, SIGNAL(triggered()), this, SLOT(deletePlaylist())); connect(close, SIGNAL(triggered()), this, SLOT(quit())); connect(optionsAction, SIGNAL(triggered()), this, SLOT(showOptions())); connect(playlistEditAction, SIGNAL(triggered()), this, SLOT(showPlaylistEditor())); connect(about, SIGNAL(triggered()), this, SLOT(aboutDialog())); }
MainWindow::MainWindow() { ui.setupUi( this ); setWindowTitle( tr( "Last.fm Fingerprinter" ) ); setStatusBar( 0 ); setAcceptDrops(true); resize( Settings().size() ); move( Settings().position() ); #ifndef Q_WS_MAC QMenu* fileMenu = new QMenu( tr( "&File" ), this ); QAction* exitAction = fileMenu->addAction( tr( "E&xit" ), this, SLOT( close() ) ); #ifdef Q_WS_X11 exitAction->setShortcut( tr( "CTRL+Q" ) ); exitAction->setText( tr("&Quit") ); #endif menuBar()->insertMenu( menuBar()->actions().at( 0 ), fileMenu ); #endif // Help shortcut #ifdef Q_WS_MAC ui.actionFAQ->setShortcut( tr( "Ctrl+?" ) ); #else ui.actionFAQ->setShortcut( tr( "F1") ); #endif QString info = tr( "<ol>" "<li>Select the folders containing the tracks that you wish to fingerprint." "<li>Press the Fingerprint button at the bottom to start." "</ol>" "This operation will not modify your files in any way, it will only analyse them " "and post a unique ID (fingerprint) to Last.fm." "<p>Please note that you can stop at any time; the app will remember how far it got, " "and automatically resume from that point the next time." ); ui.informationLabel->setText( info ); connect( ui.actionFAQ, SIGNAL( triggered() ), this, SLOT( showFAQ() ) ); connect( ui.actionAbout, SIGNAL( triggered() ), this, SLOT( aboutDialog() ) ); connect( ui.actionLogout, SIGNAL( triggered() ), this, SIGNAL( logout() ) ); connect( ui.fingerprintButton, SIGNAL( clicked() ), this, SLOT( fingerprintButtonClicked() ) ); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); resize(434, 336); setWindowTitle("AR Crypt 1.1"); ui->leftEditor->setFont(QFont("Courier New", 10)); ui->rightEditor->setFont(QFont("Courier New", 10)); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(aboutDialog())); connect(ui->actionTXTtoXPC, SIGNAL(triggered()), this, SLOT(fileToXPC())); }
void NotificationIcon::about_dialog(){ QDialog aboutDialog(0, Qt::WindowTitleHint | Qt::WindowSystemMenuHint); QLabel l("<h1>MiptTelecomBalance</h1>\ \nThis program allows you to monitor\n\ the balance of your personal account\n\ in \"MIPT-TELECOM\"\n\ Authors:"); l.setWordWrap(true); QLabel l1, l2, l3; l1.setText("<h3>Lantsov Alexander</h3>"); l2.setText("<h3>Kudinova Marina</h3>"); l3.setText("<h3>Alekseeva Maria</h3>"); QString img[4] = { AttentionPath, PositivePath, NegativePath, ProblemPath }; qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); QLabel lp1, lp2, lp3; QPixmap p1(img[qrand() % 4]); QPixmap p2(img[qrand() % 4]); QPixmap p3(img[qrand() % 4]); lp1.setPixmap(p1); lp2.setPixmap(p2); lp3.setPixmap(p3); lp1.setFixedSize(p1.width(),p1.height()); lp2.setFixedSize(p2.width(),p2.height()); lp3.setFixedSize(p3.width(),p3.height()); QPushButton button("OK"); QGridLayout layout; layout.addWidget(&l , 0, 0, 1, 2); layout.addWidget(&lp1, 1, 0); layout.addWidget(&l1 , 1, 1); layout.addWidget(&lp2, 2, 0); layout.addWidget(&l2 , 2, 1); layout.addWidget(&lp3, 3, 0); layout.addWidget(&l3 , 3, 1); layout.addWidget(&button, 4, 0, 1, 2); QObject::connect(&button, SIGNAL(clicked()), &aboutDialog, SLOT(accept())); aboutDialog.setLayout(&layout); aboutDialog.setWindowTitle("About"); //aboutDialog.setFixedSize( aboutDialog.sizeHint() ); layout.setSizeConstraint( QLayout::SetFixedSize ); aboutDialog.show(); aboutDialog.exec(); }
/** * Help/About Menu **/ QMenu *QVLCMenu::HelpMenu( QWidget *parent ) { QMenu *menu = new QMenu( parent ); addDPStaticEntry( menu, qtr( "&Help..." ) , ":/menu/help", SLOT( helpDialog() ), "F1" ); #ifdef UPDATE_CHECK addDPStaticEntry( menu, qtr( "Check for &Updates..." ) , "", SLOT( updateDialog() ) ); #endif menu->addSeparator(); addDPStaticEntry( menu, qtr( I_MENU_ABOUT ), ":/menu/info", SLOT( aboutDialog() ), "Shift+F1" ); return menu; }
void MainWindow::initActions() { m_sessionNew = new QAction(this); m_sessionNew->setShortcut( tr( "Ctrl+N" ) ); connect ( m_sessionNew , SIGNAL ( triggered() ), this , SLOT ( newSession() ) ); m_sessionList = new QAction(this); m_sessionList->setShortcut( tr( "Ctrl+L" ) ); connect ( m_sessionList , SIGNAL ( triggered() ), this , SLOT ( sessionList() ) ); m_closeFullScreenAction = new QAction(this); m_closeFullScreenAction -> setIcon( QIcon( ":/shellicons/Restore") ); connect ( m_closeFullScreenAction , SIGNAL ( triggered() ), this , SLOT ( showNormal() ) ); //TODO: Fix fullscreen action behaviour m_fullScreenAction = new QAction(this); m_fullScreenAction -> setIcon( QIcon( ":/icons/FullScreen") ); m_fullScreenAction->setShortcut( tr( "F11" ) ); connect ( m_fullScreenAction, SIGNAL ( triggered() ), this , SLOT ( fullScreen() ) ); m_quitAction = new QAction(this); m_quitAction->setShortcut(tr("Ctrl+Q")); m_quitAction -> setIcon( QIcon( ":/icons/Quit") ); connect ( m_quitAction, SIGNAL ( triggered() ), this , SLOT ( close() ) ); m_updateAllMonitorsActions = new QAction(this); m_updateAllMonitorsActions->setShortcut( tr("F5") ); connect ( m_updateAllMonitorsActions, SIGNAL ( triggered() ),this, SLOT ( update() ) ); m_selectStyleAction = new QAction(this); connect ( m_selectStyleAction , SIGNAL (triggered()), this , SLOT ( selectStyle() ) ); m_preferencesAction = new QAction( this ); connect ( m_preferencesAction, SIGNAL ( triggered() ),this, SLOT ( showPreferences() ) ); aboutAction = new QAction(this); aboutQtAction = new QAction(this); connect ( aboutAction, SIGNAL ( triggered () ), this, SLOT ( aboutDialog() ) ); connect ( aboutQtAction, SIGNAL ( triggered () ), qApp, SLOT ( aboutQt() ) ); }
void MainWindow::aboutTriggered() { AboutDialog aboutDialog(this); aboutDialog.exec(); }
void MainWindow::actionAbout() { // Open About dialog AboutDialog aboutDialog(this); aboutDialog.exec(); }
void GCF::Components::MainWindow::about() { GCF::Components::AboutBox aboutDialog(this); aboutDialog.exec(); }
// Slot. void MainWindow::about() { QDialog aboutDialog(this); QVBoxLayout* layout = new QVBoxLayout(&aboutDialog); QTextEdit* textEdit = new QTextEdit(&aboutDialog); textEdit->setReadOnly(true); textEdit->setHtml( "<pre>" PROGRAM_NAME " " PROGRAM_VERSION "\n\n" "This program is free software: you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation, either version 3 of the License, or\n" "(at your option) any later version.\n\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n\n" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" "</pre>" "<hr/>" "<pre>" "This program uses code from:\n\n" "- The Gnuspeech project (http://www.gnu.org/software/gnuspeech/).\n\n" " Provided by David R. Hill, Leonard Manzara and Craig Schock.\n\n" " Gnuspeech is distributed under the terms of the GNU General Public License\n" " as published by the Free Software Foundation, either version 3 of the\n" " License, or (at your option) any later version.\n\n" "- Qt (http://www.qt.io/).\n\n" " Provided by Digia Plc.\n\n" " Qt Free Edition is distributed under the terms of the GNU LGPLv2.1 or LGPLv3,\n" " depending on the library (see http://www.qt.io/faq/).\n\n" "- PortAudio Portable Real-Time Audio Library (http://www.portaudio.com/).\n\n" " Provided by Ross Bencina and Phil Burk.\n\n" " PortAudio is distributed under these terms:\n" " \"Permission is hereby granted, free of charge, to any person obtaining a copy\n" " of this software and associated documentation files (the \"Software\"), to\n" " deal in the Software without restriction, including without limitation the\n" " rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n" " sell copies of the Software, and to permit persons to whom the Software is\n" " furnished to do so, subject to the following conditions:\n\n" " The above copyright notice and this permission notice shall be included in\n" " all copies or substantial portions of the Software.\n\n" " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n" " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n" " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n" " IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n" " DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n" " OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n" " USE OR OTHER DEALINGS IN THE SOFTWARE.\"\n\n" "</pre>" ); layout->addWidget(textEdit); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, &aboutDialog); layout->addWidget(buttonBox); connect(buttonBox, SIGNAL(accepted()), &aboutDialog, SLOT(accept())); aboutDialog.setWindowTitle(tr("About ") + PROGRAM_NAME); aboutDialog.resize(600, 550); aboutDialog.exec(); }
void MainWindow::showAbout() { AboutDialog aboutDialog(this); aboutDialog.exec(); }
KeyPad::KeyPad(LCDDisplay *lcd, QWidget *parent, const char *name ) : QGrid(5, parent, name) { int i; QButton *btnButton; // save lcd at init display = lcd; // Init variable dCurrent = 0; iLenCurrent = 1; bIsDec = false; dDecCurrent = 0; iPreviousOperator = 0; dPreviousValue = 0; // First line btnClear = new QPushButton("CE/C", this, "Clear"); btn7 = new QPushButton("7", this, "7"); btn8 = new QPushButton("8", this, "8"); btn9 = new QPushButton("9", this, "9"); btnPlus = new QPushButton("+", this, "+"); // 2nd line btnBackspace = new QPushButton("<-",this, "Backspace"); btn4 = new QPushButton("4", this, "4"); btn5 = new QPushButton("5", this, "5"); btn6 = new QPushButton("6", this, "6"); btnMinus = new QPushButton("-", this, "-"); // 3rd line btnPercent = new QPushButton("%", this, "percent"); btn1 = new QPushButton("1", this, "1"); btn2 = new QPushButton("2", this, "2"); btn3 = new QPushButton("3", this, "3"); btnMultiply = new QPushButton("X", this, "X"); // 4th line btnAbout = new QPushButton("?", this, "About"); btn0 = new QPushButton("0", this, "0"); btnDot = new QPushButton(".", this, "dot"); btnEqual = new QPushButton("=", this, "equal"); btnDivide = new QPushButton("/", this, "divide"); // Digit key grpbtnDigits = new QButtonGroup(0, "digits"); grpbtnDigits->insert(btn0, 0); grpbtnDigits->insert(btn1, 1); grpbtnDigits->insert(btn2, 2); grpbtnDigits->insert(btn3, 3); grpbtnDigits->insert(btn4, 4); grpbtnDigits->insert(btn5, 5); grpbtnDigits->insert(btn6, 6); grpbtnDigits->insert(btn7, 7); grpbtnDigits->insert(btn8, 8); grpbtnDigits->insert(btn9, 9); // set appearance of buttons for(i=0; i<10; i++) { btnButton = grpbtnDigits->find(i); btnButton->setFixedSize(30,30); } // Operator key grpbtnOperators = new QButtonGroup(0, "operator"); grpbtnOperators->insert(btnPlus, 1); grpbtnOperators->insert(btnMinus,2); grpbtnOperators->insert(btnMultiply,3); grpbtnOperators->insert(btnDivide,4); grpbtnOperators->insert(btnEqual,5); // set appearance of buttons for(i=1; i<6; i++) { btnButton = grpbtnOperators->find(i); btnButton->setFixedSize(30,30); } btnClear->setFixedSize(30,30); btnClear->setPalette(QPalette( QColor(255, 99, 71) ) ); btnDot->setFixedSize(30,30); btnPercent->setFixedSize(30,30); btnBackspace->setFixedSize(30,30); btnAbout->setFixedSize(30,30); m_buttonKeys.insert(Key_0, btn0); m_buttonKeys.insert(Key_1, btn1); m_buttonKeys.insert(Key_2, btn2); m_buttonKeys.insert(Key_3, btn3); m_buttonKeys.insert(Key_4, btn4); m_buttonKeys.insert(Key_5, btn5); m_buttonKeys.insert(Key_6, btn6); m_buttonKeys.insert(Key_7, btn7); m_buttonKeys.insert(Key_8, btn8); m_buttonKeys.insert(Key_9, btn9); m_buttonKeys.insert(Key_Period, btnDot); m_buttonKeys.insert(Key_Plus, btnPlus); m_buttonKeys.insert(Key_Minus, btnMinus); m_buttonKeys.insert(Key_Equal, btnEqual); m_buttonKeys.insert(Key_Asterisk, btnMultiply); m_buttonKeys.insert(Key_Slash, btnDivide); m_buttonKeys.insert(Key_Percent, btnPercent); m_buttonKeys.insert(Key_Backspace, btnBackspace); // SIGNALS AND SLOTS connect(grpbtnDigits, SIGNAL(clicked(int) ), this, SLOT(enterDigits(int))); connect(grpbtnOperators, SIGNAL(clicked(int)), this, SLOT(operatorPressed(int))); connect(btnClear, SIGNAL(clicked()), this, SLOT(clearLCD())); connect(btnBackspace, SIGNAL(clicked()), this, SLOT(backspace())); connect(btnAbout, SIGNAL(clicked()), this, SLOT(aboutDialog())); connect(btnDot, SIGNAL(clicked()), this, SLOT(gotoDec())); connect(display, SIGNAL(keyPressed(int)), SLOT(slotKeyPressed(int))); connect(display, SIGNAL(keyReleased(int)), SLOT(slotKeyReleased(int))); }
QMenu* TabWidget::kueueMainMenu() { QMenu* menu = new QMenu( this ); QMenu* kueue = new QMenu( menu ); kueue->setIcon( QIcon( ":/icons/kueue.png" ) ); kueue->setTitle( "Kueue" ); mActionConfig = new QAction( kueue ); mActionConfig->setText( "Configure kueue" ); mActionConfig->setIcon( QIcon( ":/icons/menus/configure.png" ) ); mActionNSA = new QAction( kueue ); mActionNSA->setText( "Generate NSA Report" ); mActionNSA->setIcon( QIcon( ":/icons/menus/nsa.png" ) ); if ( Settings::unityEnabled() ) { mActionAddUnityTab = new QAction( kueue ); mActionAddUnityTab->setText( "Add Unity tab" ); mActionAddUnityTab->setIcon( QIcon( ":/icons/menus/web.png" ) ); } mActionQuit = new QAction( kueue ); mActionQuit->setText( "Quit" ); mActionQuit->setIcon( QIcon( ":/icons/menus/quit.png" ) ); mActionQuit->setShortcut ( QKeySequence( Qt::CTRL + Qt::Key_Q ) ); kueue->addAction( mActionConfig ); if ( Settings::unityEnabled() ) { kueue->addAction( mActionAddUnityTab ); } kueue->addAction( mActionNSA ); kueue->addAction( mActionQuit ); QMenu* view = new QMenu( menu ); view->setIcon( QIcon( ":/icons/conf/targets.png" ) ); view->setTitle( "Personal queue" ); QMenu* filter = new QMenu( menu ); filter->setIcon( QIcon( ":/icons/menus/filter.png" ) ); filter->setTitle( "Filter" ); mActionAwaitingCustomer = new QAction( filter ); mActionAwaitingCustomer->setText( "Awaiting Customer" ); mActionAwaitingCustomer->setCheckable( true ); mActionAwaitingSupport = new QAction( filter ); mActionAwaitingSupport->setText( "Awaiting Support" ); mActionAwaitingSupport->setCheckable( true ); mActionOthers = new QAction( filter ); mActionOthers->setText( "Other" ); mActionOthers->setCheckable( true ); mActionShowCR = new QAction( filter ); mActionShowCR->setText( "Show CRs" ); mActionShowCR->setCheckable( true ); mActionShowSR = new QAction( filter ); mActionShowSR->setText( "Show SRs" ); mActionShowSR->setCheckable( true ); filter->addAction( mActionAwaitingCustomer ); filter->addAction( mActionAwaitingSupport ); filter->addAction( mActionOthers ); filter->addSeparator(); filter->addAction( mActionShowCR ); filter->addAction( mActionShowSR ); view->addMenu( filter ); QMenu* sortby = new QMenu( menu ); sortby->setIcon( QIcon( ":/icons/menus/sort.png" ) ); sortby->setTitle( "Sort by" ); mActionSortUpdate = new QAction( sortby ); mActionSortUpdate->setText( "Last activity" ); mActionSortUpdate->setCheckable( true ); mActionSortAge = new QAction( sortby ); mActionSortAge->setText( "Age" ); mActionSortAge->setCheckable( true ); sortby->addAction( mActionSortUpdate ); sortby->addAction( mActionSortAge ); view->addMenu( sortby ); QMenu* other = new QMenu( menu ); other->setIcon( QIcon( ":/icons/menus/misc.png" ) ); other->setTitle( "Other" ); mActionCloseSrTables = new QAction( other ); mActionCloseSrTables->setText( "Close all SR tables" ); mActionExpandSrTables = new QAction( other ); mActionExpandSrTables->setText( "Expand all SR tables" ); other->addAction( mActionCloseSrTables ); other->addAction( mActionExpandSrTables ); view->addMenu( other ); QMenu* sub = new QMenu( menu ); sub->setIcon( QIcon( ":/icons/conf/targets.png" ) ); sub->setTitle( "Subowned SRs" ); QMenu* subfilter = new QMenu( menu ); subfilter->setIcon( QIcon( ":/icons/menus/filter.png" ) ); subfilter->setTitle( "Filter" ); mActionSubAwaitingCustomer = new QAction( subfilter ); mActionSubAwaitingCustomer->setText( "Awaiting Customer" ); mActionSubAwaitingCustomer->setCheckable( true ); mActionSubAwaitingSupport = new QAction( subfilter ); mActionSubAwaitingSupport->setText( "Awaiting Support" ); mActionSubAwaitingSupport->setCheckable( true ); mActionSubOthers = new QAction( subfilter ); mActionSubOthers->setText( "Other" ); mActionSubOthers->setCheckable( true ); mActionSubShowCR = new QAction( subfilter ); mActionSubShowCR->setText( "Show CRs" ); mActionSubShowCR->setCheckable( true ); mActionSubShowSR = new QAction( subfilter ); mActionSubShowSR->setText( "Show SRs" ); mActionSubShowSR->setCheckable( true ); subfilter->addAction( mActionSubAwaitingCustomer ); subfilter->addAction( mActionSubAwaitingSupport ); subfilter->addAction( mActionSubOthers ); subfilter->addSeparator(); subfilter->addAction( mActionSubShowCR ); subfilter->addAction( mActionSubShowSR ); sub->addMenu( subfilter ); QMenu* subsortby = new QMenu( menu ); subsortby->setIcon( QIcon( ":/icons/menus/sort.png" ) ); subsortby->setTitle( "Sort by" ); mActionSubSortUpdate = new QAction( subsortby ); mActionSubSortUpdate->setText( "Last activity" ); mActionSubSortUpdate->setCheckable( true ); mActionSubSortAge = new QAction( subsortby ); mActionSubSortAge->setText( "Age" ); mActionSubSortAge->setCheckable( true ); sortby->addAction( mActionSubSortUpdate ); sortby->addAction( mActionSubSortAge ); sub->addMenu( subsortby ); QMenu* subother = new QMenu( menu ); subother->setIcon( QIcon( ":/icons/menus/misc.png" ) ); subother->setTitle( "Other" ); mActionSubCloseSrTables = new QAction( other ); mActionSubCloseSrTables->setText( "Close all SR tables" ); mActionSubExpandSrTables = new QAction( other ); mActionSubExpandSrTables->setText( "Expand all SR tables" ); subother->addAction( mActionSubCloseSrTables ); subother->addAction( mActionSubExpandSrTables ); sub->addMenu( subother ); QMenu* qmon = new QMenu( menu ); qmon->setIcon( QIcon( ":/icons/conf/monitor.png" ) ); qmon->setTitle( "Queue monitor" ); QMenu* qmonfilter = new QMenu( qmon ); filter->setIcon( QIcon( ":/icons/menus/filter.png" ) ); filter->setTitle( "Filter" ); /*mActionQmonAwaitingCustomer = new QAction( qmonfilter ); mActionQmonAwaitingCustomer->setText( "Awaiting Customer" ); mActionQmonAwaitingCustomer->setCheckable( true ); mActionQmonAwaitingSupport = new QAction( qmonfilter ); mActionQmonAwaitingSupport->setText( "Awaiting Support" ); mActionQmonAwaitingSupport->setCheckable( true ); mActionQmonOthers = new QAction( qmonfilter ); mActionQmonOthers->setText( "Other" ); mActionQmonOthers->setCheckable( true ); qmonfilter->addAction( mActionAwaitingCustomer ); qmonfilter->addAction( mActionAwaitingSupport ); qmonfilter->addAction( mActionOthers );*/ qmon->addMenu( qmonfilter ); QMenu* help = new QMenu( menu ); help->setIcon( QIcon( ":/icons/menus/help.png" ) ); help->setTitle( "Help" ); mActionHelp = new QAction( help ); mActionHelp->setText( "Help" ); mActionHelp->setIcon( QIcon( ":/icons/menus/help.png" ) ); mActionBug = new QAction( help ); mActionBug->setText( "Report Bug" ); mActionBug->setIcon( QIcon( ":/icons/menus/reportbug.png" ) ); mActionFeature = new QAction( help ); mActionFeature->setText( "Suggest feature" ); mActionFeature->setIcon( QIcon( ":/icons/menus/feature.png" ) ); mActionAbout = new QAction( help ); mActionAbout->setText( "About kueue" ); mActionAbout->setIcon( QIcon( ":/icons/menus/about.png" ) ); help->addAction( mActionHelp ); help->addAction( mActionBug ); help->addAction( mActionFeature ); help->addAction( mActionAbout ); menu->addMenu( kueue ); menu->addMenu( view ); menu->addMenu( sub ); menu->addMenu( qmon ); menu->addMenu( help ); setMenus(); connect( mActionQuit, SIGNAL( activated() ), qApp, SLOT( quit() ) ); connect( mActionConfig, SIGNAL( activated() ), this, SIGNAL( openConfig() ) ); connect( mActionShowSR, SIGNAL( toggled( bool ) ), this, SLOT( setShowSR( bool ) ) ); connect( mActionShowCR, SIGNAL( toggled( bool ) ), this, SLOT( setShowCR( bool ) ) ); connect( mActionSortUpdate, SIGNAL( toggled( bool ) ), this, SLOT( setSortUpdate( bool ) ) ); connect( mActionSortAge, SIGNAL( toggled( bool ) ), this, SLOT( setSortAge( bool ) ) ); connect( mActionAwaitingCustomer, SIGNAL( toggled( bool ) ), this, SLOT( setShowAwaitingCustomer( bool ) ) ); connect( mActionAwaitingSupport, SIGNAL( toggled( bool ) ), this, SLOT( setShowAwaitingSupport( bool ) ) ); connect( mActionOthers, SIGNAL( toggled( bool ) ), this, SLOT( setShowStatusOthers( bool ) ) ); connect( mActionExpandSrTables, SIGNAL( activated() ), this, SLOT( expandAllTables() ) ); connect( mActionCloseSrTables, SIGNAL( activated() ), this, SLOT( closeAllTables() ) ); connect( mActionSubShowSR, SIGNAL( toggled( bool ) ), this, SLOT( subSetShowSR( bool ) ) ); connect( mActionSubShowCR, SIGNAL( toggled( bool ) ), this, SLOT( subSetShowCR( bool ) ) ); connect( mActionSubSortUpdate, SIGNAL( toggled( bool ) ), this, SLOT( subSetSortUpdate( bool ) ) ); connect( mActionSubSortAge, SIGNAL( toggled( bool ) ), this, SLOT( subSetSortAge( bool ) ) ); connect( mActionSubAwaitingCustomer, SIGNAL( toggled( bool ) ), this, SLOT( subSetShowAwaitingCustomer( bool ) ) ); connect( mActionSubAwaitingSupport, SIGNAL( toggled( bool ) ), this, SLOT( subSetShowAwaitingSupport( bool ) ) ); connect( mActionSubOthers, SIGNAL( toggled( bool ) ), this, SLOT( subSetShowStatusOthers( bool ) ) ); connect( mActionSubExpandSrTables, SIGNAL( activated() ), this, SLOT( subExpandAllTables() ) ); connect( mActionSubCloseSrTables, SIGNAL( activated() ), this, SLOT( subCloseAllTables() ) ); connect( mActionAbout, SIGNAL( activated() ), this, SLOT( aboutDialog() ) ); connect( mActionBug, SIGNAL( activated() ), this, SLOT( reportBug() ) ); connect( mActionFeature, SIGNAL( activated() ), this, SLOT( suggestFeature() ) ); connect( mActionHelp, SIGNAL( activated() ), this, SLOT( openHelp() ) ); if ( Settings::unityEnabled() ) { connect( mActionAddUnityTab, SIGNAL( activated() ), this, SLOT( addUnityBrowser() ) ); } connect( mActionNSA, SIGNAL( activated() ), this, SLOT( makeNsaReport() ) ); return menu; }
PointViewerMainWindow::PointViewerMainWindow(const QGLFormat& format) : m_progressBar(0), m_pointView(0), m_shaderEditor(0), m_helpDialog(0), m_logTextView(0), m_maxPointCount(200*1000*1000), // 200 million m_geometries(0), m_ipcServer(0), m_hookManager(0) { #ifndef _WIN32 setWindowIcon(QIcon(":resource/icons/hicolor/256x256/apps/displaz.png")); #else // On windows, application icon is set via windows resource file #endif setWindowTitle("Displaz"); setAcceptDrops(true); m_helpDialog = new HelpDialog(this); m_geometries = new GeometryCollection(this); connect(m_geometries, SIGNAL(layoutChanged()), this, SLOT(updateTitle())); connect(m_geometries, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(updateTitle())); connect(m_geometries, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(updateTitle())); connect(m_geometries, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(updateTitle())); //-------------------------------------------------- // Set up file loader in a separate thread // // Some subtleties regarding qt thread usage are discussed here: // http://mayaposch.wordpress.com/2011/11/01/how-to-really-truly-use-qthreads-the-full-explanation // // Main point: each QObject has a thread affinity which determines which // thread its slots will execute on, when called via a connected signal. QThread* loaderThread = new QThread(); m_fileLoader = new FileLoader(m_maxPointCount); m_fileLoader->moveToThread(loaderThread); connect(loaderThread, SIGNAL(finished()), m_fileLoader, SLOT(deleteLater())); connect(loaderThread, SIGNAL(finished()), loaderThread, SLOT(deleteLater())); //connect(m_fileLoader, SIGNAL(finished()), this, SIGNAL(fileLoadFinished())); connect(m_fileLoader, SIGNAL(geometryLoaded(std::shared_ptr<Geometry>, bool, bool)), m_geometries, SLOT(addGeometry(std::shared_ptr<Geometry>, bool, bool))); connect(m_fileLoader, SIGNAL(geometryMutatorLoaded(std::shared_ptr<GeometryMutator>)), m_geometries, SLOT(mutateGeometry(std::shared_ptr<GeometryMutator>))); loaderThread->start(); //-------------------------------------------------- // Menus menuBar()->setNativeMenuBar(false); // OS X doesn't activate the native menu bar under Qt5 // File menu QMenu* fileMenu = menuBar()->addMenu(tr("&File")); QAction* openAct = fileMenu->addAction(tr("&Open")); openAct->setToolTip(tr("Open a data set")); openAct->setShortcuts(QKeySequence::Open); connect(openAct, SIGNAL(triggered()), this, SLOT(openFiles())); QAction* addAct = fileMenu->addAction(tr("&Add")); addAct->setToolTip(tr("Add a data set")); connect(addAct, SIGNAL(triggered()), this, SLOT(addFiles())); QAction* reloadAct = fileMenu->addAction(tr("&Reload")); reloadAct->setStatusTip(tr("Reload point files from disk")); reloadAct->setShortcut(Qt::Key_F5); connect(reloadAct, SIGNAL(triggered()), this, SLOT(reloadFiles())); fileMenu->addSeparator(); QAction* screenShotAct = fileMenu->addAction(tr("Scree&nshot")); screenShotAct->setStatusTip(tr("Save screen shot of 3D window")); screenShotAct->setShortcut(Qt::Key_F9); connect(screenShotAct, SIGNAL(triggered()), this, SLOT(screenShot())); fileMenu->addSeparator(); QAction* quitAct = fileMenu->addAction(tr("&Quit")); quitAct->setStatusTip(tr("Exit the application")); quitAct->setShortcuts(QKeySequence::Quit); connect(quitAct, SIGNAL(triggered()), this, SLOT(close())); // View menu QMenu* viewMenu = menuBar()->addMenu(tr("&View")); QAction* trackballMode = viewMenu->addAction(tr("Use &Trackball camera")); trackballMode->setCheckable(true); trackballMode->setChecked(false); // Background sub-menu QMenu* backMenu = viewMenu->addMenu(tr("Set &Background")); QSignalMapper* mapper = new QSignalMapper(this); // Selectable backgrounds (svg_names from SVG standard - see QColor docs) const char* backgroundNames[] = {/* "Display Name", "svg_name", */ "Default", "#3C3232", "Black", "black", "Dark Grey", "dimgrey", "Slate Grey", "#858C93", "Light Grey", "lightgrey", "White", "white" }; for(size_t i = 0; i < sizeof(backgroundNames)/sizeof(const char*); i+=2) { QAction* backgroundAct = backMenu->addAction(tr(backgroundNames[i])); QPixmap pixmap(50,50); QString colName = backgroundNames[i+1]; pixmap.fill(QColor(colName)); QIcon icon(pixmap); backgroundAct->setIcon(icon); mapper->setMapping(backgroundAct, colName); connect(backgroundAct, SIGNAL(triggered()), mapper, SLOT(map())); } connect(mapper, SIGNAL(mapped(QString)), this, SLOT(setBackground(QString))); backMenu->addSeparator(); QAction* backgroundCustom = backMenu->addAction(tr("&Custom")); connect(backgroundCustom, SIGNAL(triggered()), this, SLOT(chooseBackground())); // Check boxes for drawing various scene elements by category viewMenu->addSeparator(); QAction* drawBoundingBoxes = viewMenu->addAction(tr("Draw Bounding bo&xes")); drawBoundingBoxes->setCheckable(true); drawBoundingBoxes->setChecked(false); QAction* drawCursor = viewMenu->addAction(tr("Draw 3D &Cursor")); drawCursor->setCheckable(true); drawCursor->setChecked(true); QAction* drawAxes = viewMenu->addAction(tr("Draw &Axes")); drawAxes->setCheckable(true); drawAxes->setChecked(true); QAction* drawGrid = viewMenu->addAction(tr("Draw &Grid")); drawGrid->setCheckable(true); drawGrid->setChecked(false); QAction* drawAnnotations = viewMenu->addAction(tr("Draw A&nnotations")); drawAnnotations->setCheckable(true); drawAnnotations->setChecked(true); // Shader menu QMenu* shaderMenu = menuBar()->addMenu(tr("&Shader")); QAction* openShaderAct = shaderMenu->addAction(tr("&Open")); openShaderAct->setToolTip(tr("Open a shader file")); connect(openShaderAct, SIGNAL(triggered()), this, SLOT(openShaderFile())); QAction* editShaderAct = shaderMenu->addAction(tr("&Edit")); editShaderAct->setToolTip(tr("Open shader editor window")); QAction* saveShaderAct = shaderMenu->addAction(tr("&Save")); saveShaderAct->setToolTip(tr("Save current shader file")); connect(saveShaderAct, SIGNAL(triggered()), this, SLOT(saveShaderFile())); shaderMenu->addSeparator(); // Help menu QMenu* helpMenu = menuBar()->addMenu(tr("&Help")); QAction* helpAct = helpMenu->addAction(tr("User &Guide")); connect(helpAct, SIGNAL(triggered()), this, SLOT(helpDialog())); helpMenu->addSeparator(); QAction* aboutAct = helpMenu->addAction(tr("&About")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(aboutDialog())); //-------------------------------------------------- // Point viewer m_pointView = new View3D(m_geometries, format, this); setCentralWidget(m_pointView); connect(drawBoundingBoxes, SIGNAL(triggered()), m_pointView, SLOT(toggleDrawBoundingBoxes())); connect(drawCursor, SIGNAL(triggered()), m_pointView, SLOT(toggleDrawCursor())); connect(drawAxes, SIGNAL(triggered()), m_pointView, SLOT(toggleDrawAxes())); connect(drawGrid, SIGNAL(triggered()), m_pointView, SLOT(toggleDrawGrid())); connect(drawAnnotations, SIGNAL(triggered()), m_pointView, SLOT(toggleDrawAnnotations())); connect(trackballMode, SIGNAL(triggered()), m_pointView, SLOT(toggleCameraMode())); connect(m_geometries, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(geometryRowsInserted(QModelIndex,int,int))); //-------------------------------------------------- // Docked widgets // Shader parameters UI QDockWidget* shaderParamsDock = new QDockWidget(tr("Shader Parameters"), this); shaderParamsDock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable); QWidget* shaderParamsUI = new QWidget(shaderParamsDock); shaderParamsDock->setWidget(shaderParamsUI); m_pointView->setShaderParamsUIWidget(shaderParamsUI); // Shader editor UI QDockWidget* shaderEditorDock = new QDockWidget(tr("Shader Editor"), this); shaderEditorDock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable); QWidget* shaderEditorUI = new QWidget(shaderEditorDock); m_shaderEditor = new ShaderEditor(shaderEditorUI); QGridLayout* shaderEditorLayout = new QGridLayout(shaderEditorUI); shaderEditorLayout->setContentsMargins(2,2,2,2); shaderEditorLayout->addWidget(m_shaderEditor, 0, 0, 1, 1); connect(editShaderAct, SIGNAL(triggered()), shaderEditorDock, SLOT(show())); shaderEditorDock->setWidget(shaderEditorUI); shaderMenu->addAction(m_shaderEditor->compileAction()); connect(m_shaderEditor->compileAction(), SIGNAL(triggered()), this, SLOT(compileShaderFile())); // TODO: check if this is needed - test shader update functionality //connect(m_shaderEditor, SIGNAL(sendShader(QString)), // &m_pointView->shaderProgram(), SLOT(setShader(QString))); // Log viewer UI QDockWidget* logDock = new QDockWidget(tr("Log"), this); logDock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable); QWidget* logUI = new QWidget(logDock); m_logTextView = new LogViewer(logUI); m_logTextView->setReadOnly(true); m_logTextView->setTextInteractionFlags(Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse); m_logTextView->connectLogger(&g_logger); // connect to global logger m_progressBar = new QProgressBar(logUI); m_progressBar->setRange(0,100); m_progressBar->setValue(0); m_progressBar->hide(); connect(m_fileLoader, SIGNAL(loadStepStarted(QString)), this, SLOT(setProgressBarText(QString))); connect(m_fileLoader, SIGNAL(loadProgress(int)), m_progressBar, SLOT(setValue(int))); connect(m_fileLoader, SIGNAL(resetProgress()), m_progressBar, SLOT(hide())); QVBoxLayout* logUILayout = new QVBoxLayout(logUI); //logUILayout->setContentsMargins(2,2,2,2); logUILayout->addWidget(m_logTextView); logUILayout->addWidget(m_progressBar); //m_logTextView->setLineWrapMode(QPlainTextEdit::NoWrap); logDock->setWidget(logUI); // Data set list UI QDockWidget* dataSetDock = new QDockWidget(tr("Data Sets"), this); dataSetDock->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable); DataSetUI* dataSetUI = new DataSetUI(this); dataSetDock->setWidget(dataSetUI); QAbstractItemView* dataSetOverview = dataSetUI->view(); dataSetOverview->setModel(m_geometries); connect(dataSetOverview, SIGNAL(doubleClicked(const QModelIndex&)), m_pointView, SLOT(centerOnGeometry(const QModelIndex&))); m_pointView->setSelectionModel(dataSetOverview->selectionModel()); // Set up docked widgets addDockWidget(Qt::RightDockWidgetArea, shaderParamsDock); addDockWidget(Qt::LeftDockWidgetArea, shaderEditorDock); addDockWidget(Qt::RightDockWidgetArea, logDock); addDockWidget(Qt::RightDockWidgetArea, dataSetDock); tabifyDockWidget(logDock, dataSetDock); logDock->raise(); shaderEditorDock->setVisible(false); // Add dock widget toggles to view menu viewMenu->addSeparator(); viewMenu->addAction(shaderParamsDock->toggleViewAction()); viewMenu->addAction(logDock->toggleViewAction()); viewMenu->addAction(dataSetDock->toggleViewAction()); // Create custom hook events from CLI at runtime m_hookManager = new HookManager(this); }
CMagnumWin::CMagnumWin() : m_shortcutFind( this ){ m_documentTabs.setTabsClosable( true ); connect( &m_documentTabs , SIGNAL(tabCloseRequested(int)) , this , SLOT(tabClose(int)) ); connect( &m_documentTabs , SIGNAL(currentChanged(int)) , this , SLOT(currentDocumentChanged(int)) ); setCentralWidget( &m_documentTabs ); QMenu* file = m_mainMenu.addMenu( "File" ); connect( file->addAction( "New" ) , SIGNAL(triggered()) , this , SLOT(newDocument()) ); connect( file->addAction( "Open" ) , SIGNAL(triggered()) , this , SLOT(loadDocument()) ); m_menuLastOpened.setTitle("Open recent"); connect( &m_menuLastOpened , SIGNAL(triggered(QAction*)) , this , SLOT(lastOpened_Action(QAction*)) ); file->addMenu( &m_menuLastOpened ); file->addSeparator(); connect( file->addAction( "Save" ) , SIGNAL(triggered()) , this , SLOT(saveCurrentDocument()) ); connect( file->addAction( "Save As..." ) , SIGNAL(triggered()) , this , SLOT(saveCurrentDocumentAs()) ); connect( file->addAction( "Save All" ) , SIGNAL(triggered()) , this , SLOT(saveAllDocument()) ); file->addSeparator(); connect( file->addAction( "Close" ) , SIGNAL(triggered()) , this , SLOT(closeCurrentDocument()) ); connect( file->addAction( "Close All" ) , SIGNAL(triggered()) , this , SLOT(closeAllDocument()) ); file->addSeparator(); connect( file->addAction( tr( "About" ) ) , SIGNAL(triggered()) , this , SLOT(aboutDialog()) ); setMenuBar( &m_mainMenu ); m_mainToolbar.setObjectName( "mainWindowToolBar" ); connect( m_mainToolbar.addAction( QIcon(":doc_new") , "New" ) , SIGNAL(triggered()) , this , SLOT(newDocument()) ); connect( m_mainToolbar.addAction( QIcon(":doc_open") , "Open" ) , SIGNAL(triggered()) , this , SLOT(loadDocument()) ); connect( m_mainToolbar.addAction( QIcon(":doc_filesave") , "Save" ) , SIGNAL(triggered()) , this , SLOT(saveCurrentDocument()) ); connect( m_mainToolbar.addAction( QIcon(":doc_filesaveas") , "Save as..." ) , SIGNAL(triggered()) , this , SLOT(saveCurrentDocumentAs()) ); connect( m_mainToolbar.addAction( QIcon(":doc_filesaveall") , "Save All" ) , SIGNAL(triggered()) , this , SLOT(saveAllDocument()) ); //connect( m_mainToolbar.addAction("TEST") , SIGNAL(triggered()) , this , SLOT(testEvent()) ); addToolBar( &m_mainToolbar ); m_findWidget = new CFindWindow( this ); connect( m_findWidget , SIGNAL(goTo(CDocument*,int)),this,SLOT(findWin_goTo(CDocument*,int))); addDockWidget( Qt::LeftDockWidgetArea , m_findWidget ); newDocument(); m_projectManager = new CProject( this ); connect( m_projectManager, SIGNAL(gotoDocumentLine(CDocument*,int)), this, SLOT(findWin_goTo(CDocument*,int)) ); addDockWidget( Qt::LeftDockWidgetArea, m_projectManager ); m_shortcutFind.setKey( Qt::CTRL + Qt::Key_F ); connect( &m_shortcutFind , SIGNAL(activated()) , this , SLOT( shortcutFind() ) ); loadSettings(); connect( &m_fileSystemNotification , SIGNAL(fileChanged(QString)) , this , SLOT(fsNotify(QString)) ); QString aboutString( "Magnum\n" ); aboutString += "Kuka software editor\nRelease: 0.1\n\n"; aboutString += "For information or suggestion contact [email protected]"; m_aboutDialog = new CAboutWindow( ":PROGICO" , aboutString , this ); setAcceptDrops( true ); }
void MainWindow::on_actionAbout_triggered() { AboutDialog aboutDialog(this); aboutDialog.exec(); }
void ControlManagerMainWindow::about() { CAboutDialog aboutDialog(this); aboutDialog.exec(); }
viewMenu->addSeparator(); subChartMenu = viewMenu->addMenu(tr("Add Chart")); viewMenu->addAction(tr("Reset Layout"), this, SLOT(resetWindowLayout())); windowMenu = menuBar()->addMenu(tr("&Window")); connect(windowMenu, SIGNAL(aboutToShow()), this, SLOT(setWindowMenu())); connect(rideMenu, SIGNAL(aboutToShow()), this, SLOT(setActivityMenu())); connect(subChartMenu, SIGNAL(aboutToShow()), this, SLOT(setSubChartMenu())); connect(subChartMenu, SIGNAL(triggered(QAction*)), this, SLOT(addChart(QAction*))); connect(windowMenu, SIGNAL(triggered(QAction*)), this, SLOT(selectWindow(QAction*))); QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu->addAction(tr("&User Guide"), this, SLOT(helpView())); helpMenu->addAction(tr("&Log a bug or feature request"), this, SLOT(logBug())); helpMenu->addSeparator(); helpMenu->addAction(tr("&About GoldenCheetah"), this, SLOT(aboutDialog())); /*---------------------------------------------------------------------- * Lets go, choose latest ride and get GUI up and running *--------------------------------------------------------------------*/ // selects the latest ride in the list: if (context->athlete->allRides->childCount() != 0) context->athlete->treeWidget->setCurrentItem(context->athlete->allRides->child(context->athlete->allRides->childCount()-1)); //XXX!!! We really do need a mechanism for showing if a ride needs saving... //connect(this, SIGNAL(rideDirty()), this, SLOT(enableSaveButton())); //connect(this, SIGNAL(rideClean()), this, SLOT(enableSaveButton())); // cpx aggregate cache check connect(context,SIGNAL(rideSelected(RideItem*)), this, SLOT(rideSelected(RideItem*)));
bool Application::pxAppInit() { QLocalSocket socket; socket.connectToServer(APP_NAME); if (socket.waitForConnected(500)) { qDebug() << "Application allready launched!"; return false; } _localServer = new QLocalServer(this); if (!_localServer->listen(APP_NAME)) { QLocalServer::removeServer(APP_NAME); _localServer->listen(APP_NAME); } QString homePath = QDir::homePath(); QString settingsFile = homePath + "/" + SETTINGS_FILE; _settings = new QSettings(settingsFile, QSettings::IniFormat, this); initLanguages(); _configWidget = new ConfigWidget(_settings, _languages); QObject::connect(_configWidget, SIGNAL(settingsChanged()), this, SLOT(setupHotkeys())); _configWidget->init(); //_shortcutScreenFull = new QxtGlobalShortcut; //_shortcutScreenPart = new QxtGlobalShortcut; //_shortcutTextShare = new QxtGlobalShortcut; connectDisconectHotkeys(true); connect(_configWidget, SIGNAL(showSignal(bool)), this, SLOT(connectDisconectHotkeys(bool))); _trayIconMenu = new QMenu; _trayIconMenu->addAction(tr("About"), this, SLOT(aboutDialog())); _trayIconMenu->addAction("", this, SLOT(processCodeShare())); _trayIconMenu->addAction("", this, SLOT(processScreenshotFull())); _trayIconMenu->addAction("", this, SLOT(processScreenshotPart())); _trayIconMenu->addAction(tr("Configure"), _configWidget, SLOT(show())); _trayIconMenu->addSeparator(); _trayIconMenu->addAction(tr("Exit"), this, SLOT(quit())); // Tray menu setupHotkeys(); _trayIcon = new QSystemTrayIcon(QIcon(":/icons/icon.png"), this); connect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), SLOT(trayIconClicked(QSystemTrayIcon::ActivationReason))); _trayIcon->setContextMenu(_trayIconMenu); // Tray icon _network = new Network(_settings, this); connect(_network, SIGNAL(linkReceived(QString)), SLOT(linkAvaliable(QString))); // Network this->setQuitOnLastWindowClosed(false); _trayIcon->show(); QFile file(settingsFile); if (!file.exists()) _configWidget->show(); return true; }
// Slot. void MainWindow::about() { QDialog aboutDialog(this); QVBoxLayout* layout = new QVBoxLayout(&aboutDialog); QTextEdit* textEdit = new QTextEdit(&aboutDialog); textEdit->setReadOnly(true); textEdit->setHtml( "<pre>" PROGRAM_NAME " " VERSION "\n\n" "This program is free software: you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation, either version 3 of the License, or\n" "(at your option) any later version.\n\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n\n" "You should have received a copy of the GNU General Public License\n" "along with this program. If not, see http://www.gnu.org/licenses/.\n" "</pre>" "<hr/>" "<pre>" "This program uses code from:\n\n" "- The Gnuspeech project (http://www.gnu.org/software/gnuspeech/).\n\n" " Provided by David R. Hill, Leonard Manzara and Craig Schock.\n\n" " Gnuspeech is distributed under the terms of the GNU General Public License\n" " as published by the Free Software Foundation, either version 3 of the\n" " License, or (at your option) any later version.\n\n" "- Qt (http://www.qt.io/).\n\n" " Provided by Digia Plc.\n\n" " Qt Free Edition is distributed under the terms of the GNU LGPLv2.1 or LGPLv3,\n" " depending on the library (see http://www.qt.io/faq/).\n\n" "- QCustomPlot (http://www.qcustomplot.com/).\n\n" " Provided by Emanuel Eichhammer.\n\n" " QCustomPlot is distributed under the terms of the GNU General Public License\n" " as published by the Free Software Foundation, either version 3 of the\n" " License, or (at your option) any later version.\n\n" "- FFTW (http://www.fftw.org/).\n\n" " Provided by Matteo Frigo and Massachusetts Institute of Technology.\n\n" " FFTW is free software; you can redistribute it and/or modify it under the\n" " terms of the GNU General Public License as published by the Free Software\n" " Foundation; either version 2 of the License, or (at your option) any\n" " later version.\n\n" "- JACK Audio Connection Kit (http://jackaudio.org/).\n\n" " Provided by Paul Davis, Stephane Letz, Jack O'Quinn, Torben Hohn and others.\n\n" " The JACK library is free software; you can redistribute it and/or modify\n" " it under the terms of the GNU Lesser General Public License as published by\n" " the Free Software Foundation; either version 2.1 of the License, or\n" " (at your option) any later version.\n\n" "</pre>" ); layout->addWidget(textEdit); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, &aboutDialog); layout->addWidget(buttonBox); connect(buttonBox, SIGNAL(accepted()), &aboutDialog, SLOT(accept())); aboutDialog.setWindowTitle(tr("About ") + PROGRAM_NAME); aboutDialog.resize(600, 550); aboutDialog.exec(); }