QueuePool::QueuePool(QWidget* parent) : KTabWidget(parent) { setTabBarHidden(false); #if KDE_IS_VERSION(4,3,0) setTabsClosable(false); #else setCloseButtonEnabled(false); #endif slotAddQueue(); connect(this, SIGNAL(currentChanged(int)), this, SLOT(slotQueueSelected(int))); connect(this, SIGNAL(closeRequest(QWidget*)), this, SLOT(slotCloseQueueRequest(QWidget*))); connect(this, SIGNAL(testCanDecode(const QDragMoveEvent*, bool&)), this, SLOT(slotTestCanDecode(const QDragMoveEvent*, bool&))); // -- FileWatch connections ------------------------------ LoadingCacheInterface::connectToSignalFileChanged(this, SLOT(slotFileChanged(const QString&))); }
void QueuePool::slotRemoveCurrentQueue() { QueueListView* const queue = currentQueue(); if (!queue) { return; } removeTab(indexOf(queue)); if (count() == 0) { slotAddQueue(); } else { for (int i = 0; i < count(); ++i) { setTabText(i, QString("#%1").arg(i + 1)); } } emit signalQueuePoolChanged(); }
void QueuePool::slotCloseQueueRequest(QWidget* w) { removeTab(indexOf(w)); if (count() == 0) { slotAddQueue(); } emit signalQueuePoolChanged(); }
void QueuePool::slotRemoveCurrentQueue() { QueueListView* queue = currentQueue(); if (!queue) { return; } removeTab(indexOf(queue)); if (count() == 0) { slotAddQueue(); } emit signalQueuePoolChanged(); }
void QueueMgrWindow::setupActions() { // -- Standard 'File' menu actions --------------------------------------------- KActionCollection* const ac = actionCollection(); d->runAction = new QAction(QIcon::fromTheme(QLatin1String("media-playback-start")), i18n("Run"), this); d->runAction->setEnabled(false); connect(d->runAction, SIGNAL(triggered()), this, SLOT(slotRun())); ac->addAction(QLatin1String("queuemgr_run"), d->runAction); ac->setDefaultShortcut(d->runAction, Qt::CTRL + Qt::Key_P); d->stopAction = new QAction(QIcon::fromTheme(QLatin1String("media-playback-stop")), i18n("Stop"), this); d->stopAction->setEnabled(false); connect(d->stopAction, SIGNAL(triggered()), this, SLOT(slotStop())); ac->addAction(QLatin1String("queuemgr_stop"), d->stopAction); ac->setDefaultShortcut(d->stopAction, Qt::CTRL + Qt::Key_S); d->newQueueAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-addqueue")), i18n("New Queue"), this); connect(d->newQueueAction, SIGNAL(triggered()), d->queuePool, SLOT(slotAddQueue())); ac->addAction(QLatin1String("queuemgr_newqueue"), d->newQueueAction); d->removeQueueAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-rmqueue")), i18n("Remove Queue"), this); connect(d->removeQueueAction, SIGNAL(triggered()), d->queuePool, SLOT(slotRemoveCurrentQueue())); ac->addAction(QLatin1String("queuemgr_removequeue"), d->removeQueueAction); // TODO rename action to saveWorkflowAction to avoid confusion? d->saveQueueAction = new QAction(QIcon::fromTheme(QLatin1String("document-save")), i18n("Save Workflow"), this); connect(d->saveQueueAction, SIGNAL(triggered()), this, SLOT(slotSaveWorkflow())); ac->addAction(QLatin1String("queuemgr_savequeue"), d->saveQueueAction); d->removeItemsSelAction = new QAction(QIcon::fromTheme(QLatin1String("list-remove")), i18n("Remove items"), this); d->removeItemsSelAction->setEnabled(false); connect(d->removeItemsSelAction, SIGNAL(triggered()), d->queuePool, SLOT(slotRemoveSelectedItems())); ac->addAction(QLatin1String("queuemgr_removeitemssel"), d->removeItemsSelAction); ac->setDefaultShortcut(d->removeItemsSelAction, Qt::CTRL + Qt::Key_K); d->removeItemsDoneAction = new QAction(i18n("Remove processed items"), this); d->removeItemsDoneAction->setEnabled(false); connect(d->removeItemsDoneAction, SIGNAL(triggered()), d->queuePool, SLOT(slotRemoveItemsDone())); ac->addAction(QLatin1String("queuemgr_removeitemsdone"), d->removeItemsDoneAction); d->clearQueueAction = new QAction(QIcon::fromTheme(QLatin1String("edit-clear")), i18n("Clear Queue"), this); d->clearQueueAction->setEnabled(false); connect(d->clearQueueAction, SIGNAL(triggered()), d->queuePool, SLOT(slotClearList())); ac->addAction(QLatin1String("queuemgr_clearlist"), d->clearQueueAction); ac->setDefaultShortcut(d->clearQueueAction, Qt::CTRL + Qt::SHIFT + Qt::Key_K); QAction* const close = buildStdAction(StdCloseAction, this, SLOT(close()), this); ac->addAction(QLatin1String("queuemgr_close"), close); // -- 'Tools' menu actions ----------------------------------------------------- d->moveUpToolAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-commit")), i18n("Move up"), this); connect(d->moveUpToolAction, SIGNAL(triggered()), d->assignedList, SLOT(slotMoveCurrentToolUp())); ac->addAction(QLatin1String("queuemgr_toolup"), d->moveUpToolAction); d->moveDownToolAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-update")), i18n("Move down"), this); connect(d->moveDownToolAction, SIGNAL(triggered()), d->assignedList, SLOT(slotMoveCurrentToolDown())); ac->addAction(QLatin1String("queuemgr_tooldown"), d->moveDownToolAction); d->removeToolAction = new QAction(QIcon::fromTheme(QLatin1String("bqm-remove")), i18n("Remove tool"), this); connect(d->removeToolAction, SIGNAL(triggered()), d->assignedList, SLOT(slotRemoveCurrentTool())); ac->addAction(QLatin1String("queuemgr_toolremove"), d->removeToolAction); d->clearToolsAction = new QAction(QIcon::fromTheme(QLatin1String("edit-clear-list")), i18n("Clear List"), this); connect(d->clearToolsAction, SIGNAL(triggered()), d->assignedList, SLOT(slotClearToolsList())); ac->addAction(QLatin1String("queuemgr_toolsclear"), d->clearToolsAction); // -- Standard 'View' menu actions --------------------------------------------- createFullScreenAction(QLatin1String("queuemgr_fullscreen")); // -- Standard 'Configure' menu actions ---------------------------------------- createSettingsActions(); // --------------------------------------------------------------------------------- ThemeManager::instance()->registerThemeActions(this); // -- Standard 'Help' menu actions --------------------------------------------- createHelpActions(); // Provides a menu entry that allows showing/hiding the toolbar(s) setStandardToolBarMenuEnabled(true); // Provides a menu entry that allows showing/hiding the statusbar createStandardStatusBarAction(); // --------------------------------------------------------------------------------- createGUI(xmlFile()); showMenuBarAction()->setChecked(!menuBar()->isHidden()); // NOTE: workaround for bug #171080 }