| 80 | } |
| 81 | |
| 82 | void RuntimeController::setupActions() |
| 83 | { |
| 84 | // TODO not multi-window friendly, FIXME |
| 85 | KActionCollection* ac = m_core->uiControllerInternal()->defaultMainWindow()->actionCollection(); |
| 86 | |
| 87 | auto action = new QAction(this); |
| 88 | action->setToolTip(i18n("Allows to select a runtime")); |
| 89 | action->setMenu(m_runtimesMenu.data()); |
| 90 | action->setIcon(QIcon::fromTheme(QStringLiteral("file-library-symbolic"))); |
| 91 | auto updateActionText = [action](IRuntime* currentRuntime){ |
| 92 | action->setText(i18n("Runtime: %1", currentRuntime->name())); |
| 93 | }; |
| 94 | connect(this, &RuntimeController::currentRuntimeChanged, action, updateActionText); |
| 95 | updateActionText(m_currentRuntime); |
| 96 | |
| 97 | ac->addAction(QStringLiteral("switch_runtimes"), action); |
| 98 | } |
| 99 | |
| 100 | void KDevelop::RuntimeController::initialize() |
| 101 | { |
nothing calls this directly
no test coverage detected