Coco: Use ActionBuilder for start action

Change-Id: Icca57e1ece1e3267ecd5b23fc9856a6e31487d9e
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2023-12-19 18:35:12 +01:00
parent 913a17734b
commit 5b69d70d10

View File

@@ -19,6 +19,7 @@
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QFormLayout> #include <QFormLayout>
using namespace Core;
using namespace Utils; using namespace Utils;
namespace Coco { namespace Coco {
@@ -36,15 +37,10 @@ public:
void initialize() final void initialize() final
{ {
using namespace Core; ActionBuilder(this, "Coco.startCoco")
ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER); .setText("Squish Coco ...")
if (menu) { .addToContainer(Debugger::Constants::M_DEBUG_ANALYZER, Debugger::Constants::G_ANALYZER_TOOLS)
auto startCoco = new QAction("Squish Coco ...", this); .addOnTriggered(this, &CocoPlugin::startCoco);
Command *cmd = ActionManager::registerAction(startCoco, "Coco.startCoco");
menu->addAction(cmd, Debugger::Constants::G_ANALYZER_TOOLS);
connect(startCoco, &QAction::triggered, this, [this] { this->startCoco(); });
}
} }
void startCoco() void startCoco()
@@ -53,7 +49,7 @@ public:
m_client->shutdown(); m_client->shutdown();
m_client = nullptr; m_client = nullptr;
QDialog dialog(Core::ICore::dialogParent()); QDialog dialog(ICore::dialogParent());
dialog.setModal(true); dialog.setModal(true);
auto layout = new QFormLayout(); auto layout = new QFormLayout();