diff options
author | hjk <hjk@qt.io> | 2023-12-19 18:35:12 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2023-12-20 08:31:41 +0000 |
commit | 5b69d70d1007ffce4ad16684a09ff897102ae586 (patch) | |
tree | f3fc264d6fa66909244ae3ff8426bc2f11ce7ca4 /src/plugins/coco | |
parent | 913a17734b2189a0954e7eb8e50ff6076e695521 (diff) |
Coco: Use ActionBuilder for start action
Change-Id: Icca57e1ece1e3267ecd5b23fc9856a6e31487d9e
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/coco')
-rw-r--r-- | src/plugins/coco/cocoplugin.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/plugins/coco/cocoplugin.cpp b/src/plugins/coco/cocoplugin.cpp index 5925f457603..bdeaae8fef4 100644 --- a/src/plugins/coco/cocoplugin.cpp +++ b/src/plugins/coco/cocoplugin.cpp @@ -19,6 +19,7 @@ #include <QDialogButtonBox> #include <QFormLayout> +using namespace Core; using namespace Utils; namespace Coco { @@ -36,15 +37,10 @@ public: void initialize() final { - using namespace Core; - ActionContainer *menu = ActionManager::actionContainer(Debugger::Constants::M_DEBUG_ANALYZER); - if (menu) { - auto startCoco = new QAction("Squish Coco ...", this); - Command *cmd = ActionManager::registerAction(startCoco, "Coco.startCoco"); - menu->addAction(cmd, Debugger::Constants::G_ANALYZER_TOOLS); - - connect(startCoco, &QAction::triggered, this, [this] { this->startCoco(); }); - } + ActionBuilder(this, "Coco.startCoco") + .setText("Squish Coco ...") + .addToContainer(Debugger::Constants::M_DEBUG_ANALYZER, Debugger::Constants::G_ANALYZER_TOOLS) + .addOnTriggered(this, &CocoPlugin::startCoco); } void startCoco() @@ -53,7 +49,7 @@ public: m_client->shutdown(); m_client = nullptr; - QDialog dialog(Core::ICore::dialogParent()); + QDialog dialog(ICore::dialogParent()); dialog.setModal(true); auto layout = new QFormLayout(); |