Commit 3e1f2521 authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann
Browse files

Qmldesigner: Change action registration



Context variables don't worked, so the context was registered.

Change-Id: Ic0efb8dc68d4762656e7858c1011e9fb759a7d81
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 852f947f
......@@ -163,7 +163,7 @@ void QmlDesignerPlugin::createDesignModeWidget()
m_context->context().add(qmlDesignerNavigatorContext);
m_context->context().add(ProjectExplorer::Constants::LANG_QMLJS);
m_shortCutManager.registerActions();
m_shortCutManager.registerActions(qmlDesignerMainContext, qmlDesignerFormEditorContext, qmlDesignerNavigatorContext);
connect(Core::ICore::editorManager(),
SIGNAL(currentEditorChanged(Core::IEditor*)),
......
......@@ -3,6 +3,7 @@
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/icore.h>
#include <coreplugin/icontext.h>
#include <coreplugin/editormanager/openeditorsmodel.h>
#include <coreplugin/coreconstants.h>
#include <utils/hostosinfo.h>
......@@ -39,14 +40,12 @@ ShortCutManager::ShortCutManager()
}
void ShortCutManager::registerActions()
void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContext,
const Core::Context &qmlDesignerFormEditorContext,
const Core::Context &qmlDesignerNavigatorContext)
{
Core::ActionContainer *editMenu = Core::ActionManager::actionContainer(Core::Constants::M_EDIT);
Core::Context qmlDesignerMainContext(Constants::C_QMLDESIGNER);
Core::Context qmlDesignerFormEditorContext(Constants::C_QMLFORMEDITOR);
Core::Context qmlDesignerNavigatorContext(Constants::C_QMLNAVIGATOR);
connect(&m_undoAction, SIGNAL(triggered()), this, SLOT(undo()));
connect(&m_redoAction, SIGNAL(triggered()), this, SLOT(redo()));
......
......@@ -5,9 +5,9 @@
#include <QAction>
#include <utils/parameteraction.h>
namespace Core {
class IEditor;
class Context;
}
namespace QmlDesigner {
......@@ -21,7 +21,9 @@ class ShortCutManager : public QObject
public:
ShortCutManager();
void registerActions();
void registerActions(const Core::Context &qmlDesignerMainContext,
const Core::Context &qmlDesignerFormEditorContext,
const Core::Context &qmlDesignerNavigatorContext);
void connectUndoActions(DesignDocument *designDocument);
void disconnectUndoActions(DesignDocument *designDocument);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment