diff options
author | Jochen Becher <jochen_becher@gmx.de> | 2016-06-24 18:53:54 +0200 |
---|---|---|
committer | Jochen Becher <jochen_becher@gmx.de> | 2016-06-27 09:41:34 +0000 |
commit | 4b01c6eb69d919da6bb4b9afa4bc63d2aa773714 (patch) | |
tree | bd32457fb84975e787813b31dc5cb1dd1d26cf8b /src/plugins/modeleditor/actionhandler.cpp | |
parent | 3e776dde5ebd49db6a0e772b09d931f0333a00ae (diff) |
ModelEditor: Synchronize browser and diagram selection
Change-Id: Idfbf2db98123e00bc3cef13869a0535a35e41f42
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/modeleditor/actionhandler.cpp')
-rw-r--r-- | src/plugins/modeleditor/actionhandler.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/modeleditor/actionhandler.cpp b/src/plugins/modeleditor/actionhandler.cpp index a2dabcfdcd..8f0d31a983 100644 --- a/src/plugins/modeleditor/actionhandler.cpp +++ b/src/plugins/modeleditor/actionhandler.cpp @@ -33,6 +33,7 @@ #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/icore.h> +#include <utils/icon.h> #include <QAction> #include <QShortcut> @@ -53,6 +54,7 @@ public: QAction *deleteAction = 0; QAction *selectAllAction = 0; QAction *openParentDiagramAction = 0; + QAction *synchronizeBrowserAction = 0; QAction *exportDiagramAction = 0; QAction *zoomInAction = 0; QAction *zoomOutAction = 0; @@ -116,6 +118,11 @@ QAction *ActionHandler::openParentDiagramAction() const return d->openParentDiagramAction; } +QAction *ActionHandler::synchronizeBrowserAction() const +{ + return d->synchronizeBrowserAction; +} + QAction *ActionHandler::exportDiagramAction() const { return d->exportDiagramAction; @@ -196,6 +203,13 @@ void ActionHandler::createActions() registerCommand(Constants::ACTION_ADD_COMPONENT, nullptr, Core::Context()); registerCommand(Constants::ACTION_ADD_CLASS, nullptr, Core::Context()); registerCommand(Constants::ACTION_ADD_CANVAS_DIAGRAM, nullptr, Core::Context()); + d->synchronizeBrowserAction = registerCommand( + Constants::ACTION_SYNC_BROWSER, nullptr, Core::Context(), true, + tr("Synchronize Browser and Diagram<br><i><small>Press&Hold for options</small></i>"))->action(); + static const Utils::Icon + LINK_ICON({{ QStringLiteral(":/core/images/linkicon.png"), Utils::Theme::IconsBaseColor }}); + d->synchronizeBrowserAction->setIcon(LINK_ICON.icon()); + d->synchronizeBrowserAction->setCheckable(true); auto editPropertiesAction = new QAction(tr("Edit Element Properties"), Core::ICore::mainWindow()); Core::Command *editPropertiesCommand = Core::ActionManager::registerAction( |