CDTExtractionDockWidget::CDTExtractionDockWidget(QWidget *parent) : CDTDockWidget(parent), ui(new Ui::CDTExtractionDockWidget), modelExtractions (new QSqlQueryModel(this)), isGeometryModified (false), currentEditState (LOCKED), vectorLayer (NULL), mapCanvas (NULL), lastMapTool (NULL), actionStartEdit (new QAction(QIcon(":/Icons/Start.png"),tr("Start Edit"),this)), actionRollBack (new QAction(QIcon(":/Icons/Undo.png"),tr("Rollback"),this)), actionSave (new QAction(QIcon(":/Icons/Save.png"),tr("Save"),this)), actionStop (new QAction(QIcon(":/Icons/Stop.png"),tr("Stop"),this)) { ui->setupUi(this); ui->comboBoxExtraction->setModel(modelExtractions); connect(ui->comboBoxMethod, SIGNAL(currentIndexChanged(int)), SLOT(updateDescription(int))); connect(actionStartEdit, SIGNAL(triggered()), SLOT(onActionStartEdit())); connect(actionRollBack, SIGNAL(triggered()), SLOT(onActionRollBack())); connect(actionSave, SIGNAL(triggered()), SLOT(onActionSave())); connect(actionStop,SIGNAL(triggered()), SLOT(onActionStop())); ui->toolButtonStart-> setDefaultAction(actionStartEdit); ui->toolButtonRollback->setDefaultAction(actionRollBack); ui->toolButtonSave-> setDefaultAction(actionSave); ui->toolButtonStop-> setDefaultAction(actionStop); ui->toolButtonStart->setIconSize(MainWindow::getIconSize()); ui->toolButtonRollback->setIconSize(MainWindow::getIconSize()); ui->toolButtonSave->setIconSize(MainWindow::getIconSize()); ui->toolButtonStop->setIconSize(MainWindow::getIconSize()); foreach (CDTExtractionInterface* plugin, extractionPlugins) { description.insert(plugin->methodName(),plugin->description()); ui->comboBoxMethod->addItem(plugin->methodName()); }
SLGMMainWindow::SLGMMainWindow(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); connect(ui.actionNew,SIGNAL(triggered()),this,SLOT(onActionNew())); connect(ui.actionOpen,SIGNAL(triggered()),this,SLOT(onActionOpen())); connect(ui.actionSave,SIGNAL(triggered()),this,SLOT(onActionSave())); connect(ui.actionSaveAs,SIGNAL(triggered()),this,SLOT(onActionSaveAs())); connect(ui.actionClose,SIGNAL(triggered()),this,SLOT(onActionClose())); mainLayout = new QHBoxLayout(); editorWidget = new SLGMEditorWidget(); widgetMapTreeEditor = new SLGMMapTreeEditor(this->getEditorScene()->game, this); objectSelectorWidget = new SLGMObjectSelectorWidget(this); mainLayout->addWidget(widgetMapTreeEditor); mainLayout->addWidget(editorWidget); mainLayout->addWidget(objectSelectorWidget); QWidget* temp = new QWidget(); temp->setLayout(mainLayout); setCentralWidget(temp); }
/** * @brief Sets up the toolbar */ void MainWindow::setupToolbar() { qDebug() << "Entered"; connect(ui->navbar, SIGNAL(sigSearch()), this, SLOT(onActionSearch())); connect(ui->navbar, SIGNAL(sigSave()), this, SLOT(onActionSave())); connect(ui->navbar, SIGNAL(sigSaveAll()), this, SLOT(onActionSaveAll())); connect(ui->navbar, SIGNAL(sigReload()), this, SLOT(onActionReload())); connect(ui->navbar, SIGNAL(sigAbout()), m_aboutDialog, SLOT(exec())); connect(ui->navbar, SIGNAL(sigSettings()), m_settingsWindow, SLOT(show())); connect(ui->navbar, SIGNAL(sigLike()), m_supportDialog, SLOT(exec())); connect(ui->navbar, SIGNAL(sigSync()), this, SLOT(onActionXbmc())); connect(ui->navbar, SIGNAL(sigRename()), this, SLOT(onActionRename())); connect(ui->navbar, SIGNAL(sigExport()), m_exportDialog, SLOT(exec())); ui->navbar->setActionSearchEnabled(false); ui->navbar->setActionSaveEnabled(false); ui->navbar->setActionSaveAllEnabled(false); ui->navbar->setActionRenameEnabled(false); }
/* ///////////////////////////////////////////////////////////////////////////// * Application main window constructor */ TTCutMainWindow::TTCutMainWindow() : QMainWindow() { // setup Qt Designer UI setupUi( this ); // images // -------------------------------------------------------------------------- TTCut::imgDownArrow = new QPixmap( downarrow_18_xpm ); TTCut::imgUpArrow = new QPixmap( uparrow_18_xpm ); TTCut::imgDelete = new QPixmap( cancel_18_xpm ); TTCut::imgFileOpen24 = new QPixmap( fileopen_24_xpm ); TTCut::imgFileNew = new QPixmap( filenew_16_xpm ); TTCut::imgFileOpen = new QPixmap( fileopen_16_xpm ); TTCut::imgFileSave = new QPixmap( filesave_16_xpm );; TTCut::imgFileSaveAs = new QPixmap( filesaveas_16_xpm ); TTCut::imgSaveImage = new QPixmap( saveimage_16_xpm ); TTCut::imgSettings = new QPixmap( settings_16_xpm ); TTCut::imgSettings18 = new QPixmap( settings_18_xpm ); TTCut::imgExit = new QPixmap( exit_16_xpm ); TTCut::imgPlay = new QPixmap( play_18_xpm ); TTCut::imgStop = new QPixmap( stop_18_xpm ); TTCut::imgSearch = new QPixmap( search_18_xpm ); TTCut::imgChapter = new QPixmap( chapter_18_xpm ); TTCut::imgPreview = new QPixmap( preview_18_xpm ); TTCut::imgCutAV = new QPixmap( cutav_18_xpm ); TTCut::imgCutAudio = new QPixmap( cutaudio_18_xpm ); TTCut::imgGoTo = new QPixmap( goto_18_xpm ); TTCut::imgMarker = new QPixmap( note_18_xpm ); TTCut::imgClock = new QPixmap( clock_16_xpm ); TTCut::imgApply = new QPixmap( apply_18_xpm ); TTCut::imgAddToList = new QPixmap( addtolist_18_xpm ); TTCut::imgFileClose = new QPixmap( fileclose_18_xpm ); setFocusPolicy(Qt::StrongFocus); // Message logger instance log = TTMessageLogger::getInstance(); // Get the current Qt version at runtime log->infoMsg(oName, "TTCut-Version: %s", qPrintable(TTCut::versionString)); log->infoMsg(oName, "Qt-Version: %s", qVersion()); #if QT_VERSION < 0x040100 // TODO: Show message box and abort session log->errorMsg(oName, "Qt-Version >= 4.1.0 required"); #endif // Settings TTCut::recentFileList.clear(); settings = new TTCutSettings(); settings->readSettings(); log->enableLogFile(TTCut::createLogFile); log->setLogModeConsole(TTCut::logModeConsole); log->setLogModeExtended(TTCut::logModeExtended); // Audio list audioList = new TTAudioListData(); audioFileInfo->setListData(audioList); // Mux list and mplex provider (later by plugin) muxListData = new TTMuxListData(); mplexProvider = new TTMplexProvider(); // no navigation navigationEnabled( false ); // init cutListData = NULL; mpegStream = NULL; TTCut::isVideoOpen = false; TTCut::projectFileName = ""; // Signal and slot connections // // Connect signals from main menu // -------------------------------------------------------------------------- connect(actionOpenVideo, SIGNAL(triggered()), videoFileInfo, SLOT(onFileOpen())); connect(actionOpenAudio, SIGNAL(triggered()), audioFileInfo, SLOT(onFileOpen())); connect(actionFileNew, SIGNAL(triggered()), SLOT(onFileNew())); connect(actionFileOpen, SIGNAL(triggered()), SLOT(onFileOpen())); connect(actionFileSave, SIGNAL(triggered()), SLOT(onFileSave())); connect(actionFileSaveAs, SIGNAL(triggered()), SLOT(onFileSaveAs())); connect(actionExit, SIGNAL(triggered()), SLOT(onFileExit())); connect(actionSaveCurrentFrame, SIGNAL(triggered()), SLOT(onActionSave())); connect(actionSettings, SIGNAL(triggered()), SLOT(onActionSettings())); connect(actionAbout, SIGNAL(triggered()), SLOT(onHelpAbout())); // recent files for (int i = 0; i < MaxRecentFiles; ++i) { recentFileAction[i] = new QAction(this); recentFileAction[i]->setVisible(false); menuRecentProjects->addAction(recentFileAction[i]); connect(recentFileAction[i], SIGNAL(triggered()), SLOT(onFileRecent())); } updateRecentFileActions(); // Connect signals from video and audio info // -------------------------------------------------------------------------- connect(videoFileInfo, SIGNAL(fileOpened(QString)), SLOT(onReadVideoStream(QString))); connect(audioFileInfo, SIGNAL(fileOpened(QString)), SLOT(onReadAudioStream(QString))); // Connect signals from navigation widget // -------------------------------------------------------------------------- connect(navigation, SIGNAL(prevIFrame()), currentFrame, SLOT(onPrevIFrame())); connect(navigation, SIGNAL(nextIFrame()), currentFrame, SLOT(onNextIFrame())); connect(navigation, SIGNAL(prevPFrame()), currentFrame, SLOT(onPrevPFrame())); connect(navigation, SIGNAL(nextPFrame()), currentFrame, SLOT(onNextPFrame())); connect(navigation, SIGNAL(prevBFrame()), currentFrame, SLOT(onPrevBFrame())); connect(navigation, SIGNAL(nextBFrame()), currentFrame, SLOT(onNextBFrame())); connect(navigation, SIGNAL(setCutOut(int)), currentFrame, SLOT(onSetCutOut(int))); connect(navigation, SIGNAL(setCutOut(int)), cutOutFrame, SLOT(onGotoCutOut(int))); connect(navigation, SIGNAL(setCutIn(int)), currentFrame, SLOT(onSetCutIn(int))); connect(navigation, SIGNAL(gotoCutIn(int)), currentFrame, SLOT(onGotoCutIn(int))); connect(navigation, SIGNAL(gotoCutOut(int)), currentFrame, SLOT(onGotoCutOut(int))); connect(navigation, SIGNAL(addCutRange(int, int)), cutList, SLOT(onAddEntry(int, int))); connect(navigation, SIGNAL(gotoMarker(int)), currentFrame, SLOT(onGotoMarker(int))); connect(navigation, SIGNAL(moveNumSteps(int)), currentFrame, SLOT(onMoveNumSteps(int))); connect(navigation, SIGNAL(moveToHome()), currentFrame, SLOT(onMoveToHome())); connect(navigation, SIGNAL(moveToEnd()), currentFrame, SLOT(onMoveToEnd())); // Connect signal from video slider // -------------------------------------------------------------------------- connect(streamNavigator, SIGNAL(sliderValueChanged(int)), SLOT(onVideoSliderChanged(int))); // Connect signals from cut-out frame widget // -------------------------------------------------------------------------- connect(cutOutFrame, SIGNAL(equalFrameFound(int)), currentFrame, SLOT(onGotoFrame(int))); connect(cutOutFrame, SIGNAL(newCutOutFramePos(int)), cutList, SLOT(onEditCutOut(int))); // Connect signals from current frame widget // -------------------------------------------------------------------------- connect(currentFrame, SIGNAL(newFramePosition(int)), SLOT(onNewFramePos(int))); // Connect signals from cut list widget // -------------------------------------------------------------------------- connect(cutList, SIGNAL(entrySelected(int)), cutOutFrame, SLOT(onGotoCutOut(int))); connect(cutList, SIGNAL(entryEdit(const TTCutListDataItem&)), navigation, SLOT(onEditCut(const TTCutListDataItem&))); connect(cutList, SIGNAL(gotoCutIn(int)), currentFrame, SLOT(onGotoFrame(int))); connect(cutList, SIGNAL(gotoCutOut(int)), currentFrame, SLOT(onGotoFrame(int))); connect(cutList, SIGNAL(refreshDisplay()), streamNavigator, SLOT(onRefreshDisplay())); connect(cutList, SIGNAL(previewCut(int)), SLOT(onPreviewCut(int))); connect(cutList, SIGNAL(audioVideoCut(int)), SLOT(onAudioVideoCut(int))); connect(cutList, SIGNAL(audioCut(int)), SLOT(onAudioCut(int))); }
/** * @brief Sets up the toolbar */ void MainWindow::setupToolbar() { qDebug() << "Entered"; #ifdef IS_MAC_AND_QT5 QtMacUnifiedToolBar *toolBar = new QtMacUnifiedToolBar(this); ui->mainToolBar->setVisible(false); #else QToolBar *toolBar = ui->mainToolBar; #ifdef Q_OS_MAC setUnifiedTitleAndToolBarOnMac(true); #endif #endif QPainter p; QList<QPixmap> icons; icons << QPixmap(":/img/spanner.png") << QPixmap(":/img/info.png") << QPixmap(":/img/folder_in.png") << QPixmap(":/img/magnifier.png") <<QPixmap(":/img/save.png") << QPixmap(":/img/storage.png") << QPixmap(":/img/heart.png") << QPixmap(":/img/arrow_circle_right.png") << QPixmap(":/img/xbmc.png") << QPixmap(":/img/folder_64.png") << QPixmap(":/img/export.png"); for (int i=0, n=icons.count() ; i<n ; ++i) { p.begin(&icons[i]); p.setCompositionMode(QPainter::CompositionMode_SourceIn); p.fillRect(icons[i].rect(), QColor(0, 0, 0, 100)); p.end(); } m_actionSearch = new QAction(QIcon(icons[3]), tr("Search"), this); m_actionSearch->setShortcut(QKeySequence::Find); m_actionSearch->setToolTip(tr("Search (%1)").arg(QKeySequence(QKeySequence::Find).toString(QKeySequence::NativeText))); m_actionSave = new QAction(QIcon(icons[4]), tr("Save"), this); m_actionSave->setShortcut(QKeySequence::Save); m_actionSave->setToolTip(tr("Save (%1)").arg(QKeySequence(QKeySequence::Save).toString(QKeySequence::NativeText))); m_actionSaveAll = new QAction(QIcon(icons[5]), tr("Save All"), this); QKeySequence seqSaveAll(Qt::CTRL+Qt::ShiftModifier+Qt::Key_S); m_actionSaveAll->setShortcut(seqSaveAll); m_actionSaveAll->setToolTip(tr("Save All (%1)").arg(seqSaveAll.toString(QKeySequence::NativeText))); m_actionReload = new QAction(QIcon(icons[7]), tr("Reload"), this); m_actionReload->setShortcut(QKeySequence::Refresh); m_actionReload->setToolTip(tr("Reload all files (%1)").arg(QKeySequence(QKeySequence::Refresh).toString(QKeySequence::NativeText))); m_actionRename = new QAction(QIcon(icons[9]), tr("Rename"), this); m_actionRename->setToolTip(tr("Rename selected files")); m_actionSettings = new QAction(QIcon(icons[0]), tr("Settings"), this); m_actionXbmc = new QAction(QIcon(icons[8]), tr("XBMC"), this); m_actionXbmc->setToolTip(tr("Synchronize to XBMC")); m_actionExport = new QAction(QIcon(icons[10]), tr("Export"), this); m_actionExport->setToolTip(tr("Export Database")); m_actionAbout = new QAction(QIcon(icons[1]), tr("About"), this); m_actionLike = new QAction(QIcon(icons[6]), tr("Donate"), this); toolBar->addAction(m_actionSearch); toolBar->addAction(m_actionSave); toolBar->addAction(m_actionSaveAll); toolBar->addAction(m_actionReload); toolBar->addAction(m_actionRename); toolBar->addAction(m_actionSettings); toolBar->addAction(m_actionXbmc); toolBar->addAction(m_actionExport); toolBar->addAction(m_actionAbout); #ifndef IS_MAC_AND_QT5 m_filterWidget->setParent(toolBar); toolBar->addWidget(m_filterWidget); #endif #ifndef APPSTORE toolBar->addAction(m_actionLike); #endif connect(m_actionSearch, SIGNAL(triggered()), this, SLOT(onActionSearch())); connect(m_actionSave, SIGNAL(triggered()), this, SLOT(onActionSave())); connect(m_actionSaveAll, SIGNAL(triggered()), this, SLOT(onActionSaveAll())); connect(m_actionReload, SIGNAL(triggered()), this, SLOT(onActionReload())); connect(m_actionAbout, SIGNAL(triggered()), m_aboutDialog, SLOT(exec())); connect(m_actionSettings, SIGNAL(triggered()), m_settingsWindow, SLOT(show())); connect(m_actionLike, SIGNAL(triggered()), m_supportDialog, SLOT(exec())); connect(m_actionXbmc, SIGNAL(triggered()), this, SLOT(onActionXbmc())); connect(m_actionRename, SIGNAL(triggered()), this, SLOT(onActionRename())); connect(m_actionExport, SIGNAL(triggered()), m_exportDialog, SLOT(exec())); m_actionSearch->setEnabled(false); m_actionSave->setEnabled(false); m_actionSaveAll->setEnabled(false); m_actionRename->setEnabled(false); #ifdef IS_MAC_AND_QT5 toolBar->showInWindowForWidget(this); #endif #ifdef Q_OS_WIN32 toolBar->setStyleSheet("QToolButton {border: 0; padding: 5px;} QToolBar { border-bottom: 1px solid rgba(0, 0, 0, 100); }"); #endif }