void Kaqtoos::setupConnections() { // OAUTH connect(oauthManager, SIGNAL(temporaryTokenReceived(QString,QString)), this, SLOT(onTemporaryTokenReceived(QString, QString))); connect(oauthManager, SIGNAL(authorizationReceived(QString,QString)), this, SLOT(onAuthorizationReceived(QString, QString))); connect(oauthManager, SIGNAL(accessTokenReceived(QString,QString)), this, SLOT(onAccessTokenReceived(QString,QString))); connect(oauthManager, SIGNAL(requestReady(QByteArray)), this, SLOT(onRequestReady(QByteArray))); // Network connect(&downloadManager, SIGNAL(getDownload(QBuffer *, const QString &)), this, SLOT(receiveBuffer(QBuffer *, const QString &))); // UI connect(connectAction, SIGNAL(triggered()), this, SLOT(getAccess())); connect(disconnectAction, SIGNAL(triggered()), this, SLOT(deleteUserOAuthConnection())); connect(exitAction, SIGNAL(triggered()), this, SLOT(close())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(openAbout())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { iTrytoClose = false; iDownloader = new FileDownloader(this); iAudioExtractor = new AudioExtractor(this); ui->setupUi(this); ui->progressBar->setMinimum(0); ui->progressBar->setMaximum(100); ui->progressBar->setValue(0); connect(ui->startButton, SIGNAL(clicked()), this, SLOT(startDownload())); connect(ui->cancelButton, SIGNAL(clicked()), this, SLOT(cancelDownload())); connect(iDownloader, SIGNAL(downloadProgress(int)), this, SLOT(updateProgress(int))); connect(iDownloader, SIGNAL(stateChanged(DownloadState)), this, SLOT(stateChanged(DownloadState))); connect(ui->extractButton, SIGNAL(clicked()), this, SLOT(extractAudio())); connect(ui->codecButton, SIGNAL(clicked()), this, SLOT(codecInfo())); connect(ui->encodeButton, SIGNAL(clicked()), this, SLOT(encodeX264())); connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(closeApp())); connect(iDownloader, SIGNAL(infoChanged(const QString&)), this, SLOT(infoChanged(const QString&))); connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearInfoText())); connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(openSettings())); connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(openAbout())); connect(iAudioExtractor, SIGNAL(infoChanged(const QString&)), this, SLOT(infoChanged(const QString&))); connect(iAudioExtractor, SIGNAL(extractStateChanged(int)), this, SLOT(extractStateChanged(int))); connect(iAudioExtractor, SIGNAL(encodeStateChanged(int)), this, SLOT(extractStateChanged(int))); ui->videoIdEdit->setText("nVjsGKrE6E8"); }
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())); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); setFixedSize(ui->graphicsView->width()+10,ui->graphicsView->height()+25); m_file = menuBar()->addMenu("Game"); m_help = menuBar()->addMenu("Help"); m_newGame = new QAction(tr("&New Game"),this); //m_settings = new QAction(tr("&Settings"),this); m_exit = new QAction(tr("E&xit"),this); m_about = new QAction(tr("About arkanoid"),this); m_newGame->setShortcut(QKeySequence::New); m_newGame->setShortcut(QKeySequence::Close); QPixmap bgPix(":/img/hexagon_pattern.png"); bgPix = bgPix.scaled(800,600, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); m_scene = new QGraphicsScene(0,0,ui->graphicsView->width(),ui->graphicsView->height()); ui->graphicsView->setScene(m_scene); QPixmap blft(":/img/border_left.png"); QPixmap btop(":/img/border_top.png"); QPixmap brght(":/img/border_right.png"); blft = blft.scaled(800,25, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); btop = btop.scaled(25,600, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); brght = brght.scaled(800,25, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); ui->graphicsView->setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); ui->graphicsView->setBackgroundBrush(bgPix); ui->graphicsView->setCacheMode(QGraphicsView::CacheBackground); ui->graphicsView->setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform); QIcon ico(tr(":/icon.ico")); setWindowIcon(ico); connect(m_newGame,SIGNAL(triggered()),this,SLOT(startNewGame())); //connect(m_settings,SIGNAL(triggered()),this,SLOT(openSettings())); connect(m_exit,SIGNAL(triggered()),this,SLOT(close())); connect(m_about,SIGNAL(triggered()),this,SLOT(openAbout())); m_file->addAction(m_newGame); m_file->addSeparator(); //m_file->addAction(m_settings); //m_file->addSeparator(); m_file->addAction(m_exit); m_help->addAction(m_about); setCentralWidget(ui->graphicsView); }
CcgView::CcgView(QWidget *parent) : QMainWindow(parent), ui(new Ui::CcgView) { ui->setupUi(this); // check that the command line program is installed if (!fileExists(QString(CCG_BINARY))) { QMessageBox::information(this, "ccg binary not found", "The ccg command line program " \ "must be installed in order for " \ "this GUI to work"); close(); return; } setRanges(); setDefaults(); setupData(); // When the calculate button is pressed connect(ui->pushButtonCalculate, SIGNAL(clicked()), this, SLOT(calculate())); // When data sources is selected open the data dialog connect(ui->actionDataSources,SIGNAL(triggered()), this,SLOT(openDataSources())); // Save the current image connect(ui->actionSaveImage,SIGNAL(triggered()), this,SLOT(saveImageAs())); // Exit the application connect(ui->actionExit,SIGNAL(triggered()), this,SLOT(close())); // open the about dialog connect(ui->actionAbout,SIGNAL(triggered()), this,SLOT(openAbout())); // Event for detecting mouse click on image ui->graphicsView->installEventFilter(this); statusLabel.setText("Ready"); statusLabel.setIndent(3); ui->statusBar->addWidget(&statusLabel); ui->spinBoxStartYear->setValue(globals.startYear); ui->spinBoxEndYear->setValue(globals.endYear); ui->comboBoxPlotType->setCurrentIndex(globals.plotTypeIndex); ui->comboBoxRegion->setCurrentIndex(globals.regionIndex); showingImage=false; }
void MainWindow::on_actionAbout_triggered() { openAbout(); }
void NMainMenuBar::setupHelpMenu() { helpMenu = this->addMenu(tr("&Help")); QFont f = global.getGuiFont(QFont()); helpMenu->setFont(f); openProjectWebPageAction = new QAction(tr("&Project wiki"), this); openProjectWebPageAction->setToolTip(tr("Open NixNote wiki page with help/documentation/contact")); connect(openProjectWebPageAction, SIGNAL(triggered()), this, SLOT(onOpenProjectWebPage())); helpMenu->addAction(openProjectWebPageAction); QAction *openGettingStartedWebPageAction = new QAction(tr("&Getting started"), this); openGettingStartedWebPageAction->setToolTip(tr("Open Getting started wiki page")); connect(openGettingStartedWebPageAction, SIGNAL(triggered()), this, SLOT(onOpenGettingStartedWebPage())); helpMenu->addAction(openGettingStartedWebPageAction); helpMenu->addSeparator(); themeInformationAction = new QAction(tr("Theme &Information"), this); // themeInformationAction->setToolTip(tr("View information about the current theme.")); // connect(themeInformationAction, SIGNAL(triggered()), this, SLOT(openThemeInformation())); // helpMenu->addAction(themeInformationAction); // QString url = global.getResourceFileName(global.resourceList, ":themeInformation"); // themeInformationAction->setVisible(false); // if (url.startsWith("http://", Qt::CaseInsensitive) || url.startsWith("https://", Qt::CaseInsensitive)) // themeInformationAction->setVisible(true); // QFile file(url); // if (file.exists()) // themeInformationAction->setVisible(true); // global.settings->beginGroup(INI_GROUP_APPEARANCE); // QString themeName = global.settings->value("themeName", "").toString(); // global.settings->endGroup(); // if (themeName == "") // temporarily off - as the themes are currently un-ripe/unfinished themeInformationAction->setVisible(false); openMessageLogAction = new QAction(tr("Data and &log location info"), this); openMessageLogAction->setToolTip(tr("View location of program data and log file")); connect(openMessageLogAction, SIGNAL(triggered()), parent, SLOT(openMessageLogInfo())); helpMenu->addAction(openMessageLogAction); openShortcutsDialogAction = new QAction(tr("Active shortcuts"), this); openShortcutsDialogAction->setToolTip(tr("View current shortcuts")); connect(openShortcutsDialogAction, SIGNAL(triggered(bool)), parent, SLOT(openShortcutsDialog())); helpMenu->addAction(openShortcutsDialogAction); helpMenu->addSeparator(); aboutQtAction = new QAction(tr("About &Qt"), this); aboutQtAction->setMenuRole(QAction::AboutQtRole); aboutQtAction->setToolTip(tr("About Qt")); connect(aboutQtAction, SIGNAL(triggered()), parent, SLOT(openQtAbout())); helpMenu->addAction(aboutQtAction); helpMenu->addSeparator(); aboutAction = new QAction(tr("&About"), this); aboutAction->setToolTip(tr("About")); aboutAction->setMenuRole(QAction::AboutRole); connect(aboutAction, SIGNAL(triggered()), parent, SLOT(openAbout())); helpMenu->addAction(aboutAction); }
Window::Window(int argc, char *argv[]) : QMainWindow(NULL), ui(new Ui::Window) { ui->setupUi(this); // Cache size cacheSize = 50; cachePos = 0; prefs = new Preferences(this); about = new AboutDialog(this); connect(prefs, SIGNAL(finished(int)), this, SLOT(updatePrefs())); initSlider(ui->xSlider); initSlider(ui->ySlider); initSlider(ui->zSlider); initSpanSlider(ui->xSpanSlider); initSpanSlider(ui->ySpanSlider); initSpanSlider(ui->zSpanSlider); // Rotation connect(ui->xSlider, SIGNAL(valueChanged(int)), ui->viewport, SLOT(setXRotation(int))); connect(ui->viewport, SIGNAL(xRotationChanged(int)), ui->xSlider, SLOT(setValue(int))); connect(ui->ySlider, SIGNAL(valueChanged(int)), ui->viewport, SLOT(setYRotation(int))); connect(ui->viewport, SIGNAL(yRotationChanged(int)), ui->ySlider, SLOT(setValue(int))); connect(ui->zSlider, SIGNAL(valueChanged(int)), ui->viewport, SLOT(setZRotation(int))); connect(ui->viewport, SIGNAL(zRotationChanged(int)), ui->zSlider, SLOT(setValue(int))); // Slicing connect(ui->xSpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setXSliceLow(int))); connect(ui->xSpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setXSliceHigh(int))); connect(ui->ySpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setYSliceLow(int))); connect(ui->ySpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setYSliceHigh(int))); connect(ui->zSpanSlider, SIGNAL(lowerValueChanged(int)), ui->viewport, SLOT(setZSliceLow(int))); connect(ui->zSpanSlider, SIGNAL(upperValueChanged(int)), ui->viewport, SLOT(setZSliceHigh(int))); ui->animSlider->setRange(0, 10); ui->animSlider->setSingleStep(1); ui->animSlider->setPageStep(10); ui->animSlider->setTickInterval(2); ui->animSlider->setTickPosition(QSlider::TicksRight); ui->animSlider->setEnabled(false); // Actions connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(openAbout())); connect(ui->actionPreferences, SIGNAL(triggered()), this, SLOT(openSettings())); connect(ui->actionFiles, SIGNAL(triggered()), this, SLOT(openFiles())); connect(ui->actionDir, SIGNAL(triggered()), this, SLOT(openDir())); connect(ui->actionCubes, SIGNAL(triggered()), this, SLOT(toggleDisplay())); connect(ui->actionCones, SIGNAL(triggered()), this, SLOT(toggleDisplay())); connect(ui->actionVectors, SIGNAL(triggered()), this, SLOT(toggleDisplay())); displayType = new QActionGroup(this); displayType->addAction(ui->actionCubes); displayType->addAction(ui->actionCones); displayType->addAction(ui->actionVectors); ui->actionCubes->setChecked(true); signalMapper = new QSignalMapper(this); signalMapper->setMapping (ui->actionFollow, "") ; connect (signalMapper, SIGNAL(mapped(QString)), this, SLOT(watchDir(QString))) ; connect(ui->actionFollow, SIGNAL(triggered()), signalMapper, SLOT(map())); ui->xSlider->setValue(15 * 16); ui->ySlider->setValue(345 * 16); ui->zSlider->setValue(0 * 16); setWindowTitle(tr("MuView 0.9")); // Data, don't connect until we are ready (probably still not ready here)... connect(ui->animSlider, SIGNAL(valueChanged(int)), this, SLOT(updateDisplayData(int))); // Load files from command line if supplied if (argc > 1) { QStringList rawList; for (int i=1; i<argc; i++) { rawList << argv[i]; } if (rawList.contains(QString("-w"))) { if (rawList.indexOf("-w") < (rawList.length() - 1)) { watchDir(rawList[rawList.indexOf("-w")+1]); } } else { QStringList allLoadedFiles; foreach (QString item, rawList) { QFileInfo info(item); if (!info.exists()) { std::cout << "File " << item.toStdString() << " does not exist" << std::endl; } else { // Push our new content... if (info.isDir()) { QDir chosenDir(item); dirString = chosenDir.path()+"/"; QStringList filters; filters << "*.omf" << "*.ovf"; chosenDir.setNameFilters(filters); QStringList files = chosenDir.entryList(); foreach (QString file, files) { filenames << (dirString+file); displayNames << (dirString+item); //omfCache.push_back(readOMF((dirString+file).toStdString(), tempHeader)); } } else {