AutoTest: More ActionBuilder polish

Change-Id: Ic7ba4ea43887c0589055df8e84c047242aea0809
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2023-12-19 16:02:43 +01:00
parent f2d4d62fed
commit ea090adcdb

View File

@@ -294,35 +294,33 @@ void AutotestPlugin::extensionsInitialized()
contextMenu->addMenu(runTestMenu); contextMenu->addMenu(runTestMenu);
contextMenu->addSeparator(); contextMenu->addSeparator();
ActionBuilder runTest(this, Constants::ACTION_RUN_UCURSOR); ActionBuilder(this, Constants::ACTION_RUN_UCURSOR)
runTest.setText(Tr::tr("&Run Test")); .setText(Tr::tr("&Run Test"))
runTest.setEnabled(false); .setEnabled(false)
runTest.setIcon(Utils::Icons::RUN_SMALL.icon()); .setIcon(Utils::Icons::RUN_SMALL.icon())
runTest.addToContainer(menuId); .addToContainer(menuId)
runTest.addOnTriggered([] { dd->onRunUnderCursorTriggered(TestRunMode::Run); }); .addOnTriggered([] { dd->onRunUnderCursorTriggered(TestRunMode::Run); });
ActionBuilder runTestNoDeploy(this, Constants::ACTION_RUN_UCURSOR_NODEPLOY); ActionBuilder(this, Constants::ACTION_RUN_UCURSOR_NODEPLOY)
runTestNoDeploy.setText(Tr::tr("Run Test Without Deployment")); .setText(Tr::tr("Run Test Without Deployment"))
runTestNoDeploy.setIcon(Utils::Icons::RUN_SMALL.icon()); .setIcon(Utils::Icons::RUN_SMALL.icon())
runTestNoDeploy.setEnabled(false); .setEnabled(false)
runTestNoDeploy.addToContainer(menuId); .addToContainer(menuId)
runTestNoDeploy.addOnTriggered( .addOnTriggered([] { dd->onRunUnderCursorTriggered(TestRunMode::RunWithoutDeploy); });
[] { dd->onRunUnderCursorTriggered(TestRunMode::RunWithoutDeploy); });
ActionBuilder debugTest(this, Constants::ACTION_RUN_DBG_UCURSOR); ActionBuilder(this, Constants::ACTION_RUN_DBG_UCURSOR)
debugTest.setText(Tr::tr("&Debug Test")); .setText(Tr::tr("&Debug Test"))
debugTest.setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon()); .setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon())
debugTest.setEnabled(false); .setEnabled(false)
debugTest.addToContainer(menuId); .addToContainer(menuId)
debugTest.addOnTriggered([] { dd->onRunUnderCursorTriggered(TestRunMode::Debug); }); .addOnTriggered([] { dd->onRunUnderCursorTriggered(TestRunMode::Debug); });
ActionBuilder debugTestNoDeploy(this, Constants::ACTION_RUN_DBG_UCURSOR_NODEPLOY); ActionBuilder(this, Constants::ACTION_RUN_DBG_UCURSOR_NODEPLOY)
debugTestNoDeploy.setText(Tr::tr("Debug Test Without Deployment")); .setText(Tr::tr("Debug Test Without Deployment"))
debugTestNoDeploy.setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon()); .setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL.icon())
debugTestNoDeploy.setEnabled(false); .setEnabled(false)
debugTestNoDeploy.addToContainer(menuId); .addToContainer(menuId)
debugTestNoDeploy.addOnTriggered( .addOnTriggered([] { dd->onRunUnderCursorTriggered(TestRunMode::DebugWithoutDeploy); });
[] { dd->onRunUnderCursorTriggered(TestRunMode::DebugWithoutDeploy); });
} }
ExtensionSystem::IPlugin::ShutdownFlag AutotestPlugin::aboutToShutdown() ExtensionSystem::IPlugin::ShutdownFlag AutotestPlugin::aboutToShutdown()