forked from qt-creator/qt-creator
Coco: Use ActionBuilder for start action
Change-Id: Icca57e1ece1e3267ecd5b23fc9856a6e31487d9e Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -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();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user