| 1672 | } |
| 1673 | |
| 1674 | void MainWindow::startExeAction() |
| 1675 | { |
| 1676 | QAction* action = qobject_cast<QAction*>(sender()); |
| 1677 | |
| 1678 | if (action == nullptr) { |
| 1679 | log::error("not an action?"); |
| 1680 | return; |
| 1681 | } |
| 1682 | |
| 1683 | const auto& list = *m_OrganizerCore.executablesList(); |
| 1684 | |
| 1685 | const auto title = action->text(); |
| 1686 | auto itor = list.find(title); |
| 1687 | |
| 1688 | if (itor == list.end()) { |
| 1689 | log::warn("startExeAction(): executable '{}' not found", title); |
| 1690 | return; |
| 1691 | } |
| 1692 | |
| 1693 | action->setEnabled(false); |
| 1694 | Guard g([&] { |
| 1695 | action->setEnabled(true); |
| 1696 | }); |
| 1697 | |
| 1698 | m_OrganizerCore.processRunner() |
| 1699 | .setFromExecutable(*itor) |
| 1700 | .setWaitForCompletion(ProcessRunner::TriggerRefresh) |
| 1701 | .run(); |
| 1702 | } |
| 1703 | |
| 1704 | void MainWindow::activateSelectedProfile() |
| 1705 | { |
nothing calls this directly
no test coverage detected