MCPcopy Create free account
hub / github.com/KDE/kdevelop / setupActions

Method setupActions

kdevplatform/shell/runcontroller.cpp:449–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447}
448
449void RunController::setupActions()
450{
451 Q_D(RunController);
452
453 QAction* action;
454
455 // TODO not multi-window friendly, FIXME
456 KActionCollection* ac = Core::self()->uiControllerInternal()->defaultMainWindow()->actionCollection();
457
458 action = new QAction(QIcon::fromTheme(QStringLiteral("configure")), i18nc("@action", "Configure Launches..."), this);
459 ac->addAction(QStringLiteral("configure_launches"), action);
460 action->setMenuRole(QAction::NoRole); // OSX: Be explicit about role, prevent hiding due to conflict with "Preferences..." menu item
461 action->setToolTip(i18nc("@info:tooltip", "Open Launch Configuration Dialog"));
462 action->setWhatsThis(i18nc("@info:whatsthis", "Opens a dialog to setup new launch configurations, or to change the existing ones."));
463 connect(action, &QAction::triggered, this, &RunController::showConfigurationDialog);
464
465 d->runAction = new QAction( QIcon::fromTheme(QStringLiteral("system-run")), i18nc("@action", "Execute Launch"), this);
466 d->runAction->setIconText( i18nc("@action Short text for 'Execute Launch' used in the toolbar", "Execute") );
467 ac->setDefaultShortcut(d->runAction, Qt::SHIFT | Qt::Key_F9);
468 d->runAction->setToolTip(i18nc("@info:tooltip", "Execute current launch"));
469 d->runAction->setWhatsThis(i18nc("@info:whatsthis", "Executes the target or the program specified in currently active launch configuration."));
470 ac->addAction(QStringLiteral("run_execute"), d->runAction);
471 connect(d->runAction, &QAction::triggered, this, &RunController::slotExecute);
472
473 d->dbgAction = new QAction( QIcon::fromTheme(QStringLiteral("debug-run")), i18nc("@action", "Debug Launch"), this);
474 ac->setDefaultShortcut(d->dbgAction, Qt::ALT | Qt::Key_F9);
475 d->dbgAction->setIconText( i18nc("@action Short text for 'Debug Launch' used in the toolbar", "Debug") );
476 d->dbgAction->setToolTip(i18nc("@info:tooltip", "Debug current launch"));
477 d->dbgAction->setWhatsThis(i18nc("@info:whatsthis", "Executes the target or the program specified in currently active launch configuration inside a Debugger."));
478 ac->addAction(QStringLiteral("run_debug"), d->dbgAction);
479 connect(d->dbgAction, &QAction::triggered, this, &RunController::debugCurrentLaunch);
480 Core::self()->uiControllerInternal()->area(0, QStringLiteral("code"))->addAction(d->dbgAction);
481
482// TODO: at least get a profile target, it's sad to have the menu entry without a profiler
483// QAction* profileAction = new QAction( QIcon::fromTheme(""), i18n("Profile Launch"), this);
484// profileAction->setToolTip(i18nc("@info:tooltip", "Profile current launch"));
485// profileAction->setWhatsThis(i18nc("@info:whatsthis", "Executes the target or the program specified in currently active launch configuration inside a Profiler."));
486// ac->addAction("run_profile", profileAction);
487// connect(profileAction, SIGNAL(triggered(bool)), this, SLOT(slotProfile()));
488
489 action = d->stopAction = new QAction( QIcon::fromTheme(QStringLiteral("process-stop")), i18nc("@action", "Stop All Jobs"), this);
490 action->setIconText(i18nc("@action Short text for 'Stop All Jobs' used in the toolbar", "Stop All"));
491 // Ctrl+Escape would be nicer, but that is taken by the ksysguard desktop shortcut
492 ac->setDefaultShortcut( action, QKeySequence(QStringLiteral("Ctrl+Shift+Escape")));
493 action->setToolTip(i18nc("@info:tooltip", "Stop all currently running jobs"));
494 action->setWhatsThis(i18nc("@info:whatsthis", "Requests that all running jobs are stopped."));
495 action->setEnabled(false);
496 ac->addAction(QStringLiteral("run_stop_all"), action);
497 connect(action, &QAction::triggered, this, &RunController::stopAllProcesses);
498 Core::self()->uiControllerInternal()->area(0, QStringLiteral("debug"))->addAction(action);
499
500 action = d->stopJobsMenu = new KActionMenu( QIcon::fromTheme(QStringLiteral("process-stop")), i18nc("@action", "Stop"), this);
501 d->stopJobsMenu->setPopupMode(QToolButton::InstantPopup);
502 action->setIconText(i18nc("@action Short text for 'Stop' used in the toolbar", "Stop"));
503 action->setToolTip(i18nc("@info:tooltip", "Menu allowing to stop individual jobs"));
504 action->setWhatsThis(i18nc("@info:whatsthis", "List of jobs that can be stopped individually."));
505 action->setEnabled(false);
506 ac->addAction(QStringLiteral("run_stop_menu"), action);

Callers

nothing calls this directly

Calls 8

defaultMainWindowMethod · 0.80
uiControllerInternalMethod · 0.80
setToolTipMethod · 0.80
actionCollectionMethod · 0.45
addActionMethod · 0.45
areaMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected