forked from qt-creator/qt-creator
Core::Context: compile hot fix for Windows.
This commit is contained in:
@@ -47,7 +47,6 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/ifile.h>
|
#include <coreplugin/ifile.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <find/ifindsupport.h>
|
#include <find/ifindsupport.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
@@ -291,11 +290,10 @@ class BinEditorInterface : public Core::IEditor
|
|||||||
public:
|
public:
|
||||||
BinEditorInterface(BinEditor *editor)
|
BinEditorInterface(BinEditor *editor)
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
|
||||||
m_editor = editor;
|
m_editor = editor;
|
||||||
m_file = new BinEditorFile(m_editor);
|
m_file = new BinEditorFile(m_editor);
|
||||||
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
m_context.add(Core::Constants::K_DEFAULT_BINARY_EDITOR_ID);
|
||||||
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
|
m_context.add(Constants::C_BINEDITOR);
|
||||||
m_cursorPositionLabel = new Utils::LineColumnLabel;
|
m_cursorPositionLabel = new Utils::LineColumnLabel;
|
||||||
|
|
||||||
QHBoxLayout *l = new QHBoxLayout;
|
QHBoxLayout *l = new QHBoxLayout;
|
||||||
@@ -436,8 +434,7 @@ void BinEditorPlugin::initializeEditor(BinEditor *editor)
|
|||||||
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
|
QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
|
||||||
editor->setEditorInterface(editorInterface);
|
editor->setEditorInterface(editorInterface);
|
||||||
|
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
m_context.add(Constants::C_BINEDITOR);
|
||||||
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
|
|
||||||
if (!m_undoAction) {
|
if (!m_undoAction) {
|
||||||
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
|
m_undoAction = registerNewAction(QLatin1String(Core::Constants::UNDO),
|
||||||
this, SLOT(undoAction()),
|
this, SLOT(undoAction()),
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
#include <texteditor/basetexteditor.h>
|
#include <texteditor/basetexteditor.h>
|
||||||
@@ -298,9 +297,10 @@ void BookmarkView::gotoBookmark(const QModelIndex &index)
|
|||||||
////
|
////
|
||||||
|
|
||||||
BookmarkContext::BookmarkContext(BookmarkView *widget)
|
BookmarkContext::BookmarkContext(BookmarkView *widget)
|
||||||
: Core::IContext(widget), m_bookmarkView(widget)
|
: Core::IContext(widget),
|
||||||
|
m_bookmarkView(widget),
|
||||||
|
m_context(Constants::BOOKMARKS_CONTEXT)
|
||||||
{
|
{
|
||||||
m_context << UniqueIDManager::instance()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Context BookmarkContext::context() const
|
Context BookmarkContext::context() const
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ public:
|
|||||||
virtual QWidget *widget();
|
virtual QWidget *widget();
|
||||||
private:
|
private:
|
||||||
BookmarkView *m_bookmarkView;
|
BookmarkView *m_bookmarkView;
|
||||||
Core::Context m_context;
|
const Core::Context m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
class BookmarkViewFactory : public Core::INavigationWidgetFactory
|
class BookmarkViewFactory : public Core::INavigationWidgetFactory
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -69,8 +68,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
|||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
Core::ActionManager *am = core->actionManager();
|
Core::ActionManager *am = core->actionManager();
|
||||||
Core::UniqueIDManager *uidm = core->uniqueIDManager();
|
Core::Context textcontext(TextEditor::Constants::C_TEXTEDITOR);
|
||||||
Core::Context textcontext(uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR));
|
|
||||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||||
|
|
||||||
Core::ActionContainer *mtools =
|
Core::ActionContainer *mtools =
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "cmakeeditorfactory.h"
|
#include "cmakeeditorfactory.h"
|
||||||
#include "cmakeprojectconstants.h"
|
#include "cmakeprojectconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
#include <texteditor/texteditorconstants.h>
|
#include <texteditor/texteditorconstants.h>
|
||||||
@@ -49,12 +48,10 @@ using namespace CMakeProjectManager::Internal;
|
|||||||
//
|
//
|
||||||
|
|
||||||
CMakeEditorEditable::CMakeEditorEditable(CMakeEditor *editor)
|
CMakeEditorEditable::CMakeEditorEditable(CMakeEditor *editor)
|
||||||
: BaseTextEditorEditable(editor)
|
: BaseTextEditorEditable(editor),
|
||||||
{
|
m_context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
TextEditor::Constants::C_TEXTEDITOR)
|
||||||
m_context << uidm->uniqueIdentifier(CMakeProjectManager::Constants::C_CMAKEEDITOR);
|
{ }
|
||||||
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
Core::Context CMakeEditorEditable::context() const
|
Core::Context CMakeEditorEditable::context() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
QString id() const;
|
QString id() const;
|
||||||
bool isTemporary() const { return false; }
|
bool isTemporary() const { return false; }
|
||||||
private:
|
private:
|
||||||
Core::Context m_context;
|
const Core::Context m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMakeEditor : public TextEditor::BaseTextEditor
|
class CMakeEditor : public TextEditor::BaseTextEditor
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ QList<ActionContainerPrivate *> ActionManagerPrivate::containers() const
|
|||||||
|
|
||||||
bool ActionManagerPrivate::hasContext(int context) const
|
bool ActionManagerPrivate::hasContext(int context) const
|
||||||
{
|
{
|
||||||
return m_context.contains(context);
|
return m_context.d.contains(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionManagerPrivate::setContext(const Context &context)
|
void ActionManagerPrivate::setContext(const Context &context)
|
||||||
@@ -278,8 +278,8 @@ void ActionManagerPrivate::setContext(const Context &context)
|
|||||||
|
|
||||||
bool ActionManagerPrivate::hasContext(const Context &context) const
|
bool ActionManagerPrivate::hasContext(const Context &context) const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_context.count(); ++i) {
|
for (int i = 0; i < m_context.d.count(); ++i) {
|
||||||
if (context.contains(m_context.at(i)))
|
if (context.d.contains(m_context.d.at(i)))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -403,7 +403,7 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStri
|
|||||||
shortcut->setParent(m_mainWnd);
|
shortcut->setParent(m_mainWnd);
|
||||||
sc->setShortcut(shortcut);
|
sc->setShortcut(shortcut);
|
||||||
|
|
||||||
if (context.isEmpty())
|
if (context.d.isEmpty())
|
||||||
sc->setContext(Context(0));
|
sc->setContext(Context(0));
|
||||||
else
|
else
|
||||||
sc->setContext(context);
|
sc->setContext(context);
|
||||||
|
|||||||
@@ -336,8 +336,8 @@ QString Shortcut::defaultText() const
|
|||||||
|
|
||||||
bool Shortcut::setCurrentContext(const Core::Context &context)
|
bool Shortcut::setCurrentContext(const Core::Context &context)
|
||||||
{
|
{
|
||||||
foreach (int ctxt, m_context) {
|
foreach (int ctxt, m_context.d) {
|
||||||
if (context.contains(ctxt)) {
|
if (context.d.contains(ctxt)) {
|
||||||
if (!m_shortcut->isEnabled()) {
|
if (!m_shortcut->isEnabled()) {
|
||||||
m_shortcut->setEnabled(true);
|
m_shortcut->setEnabled(true);
|
||||||
emit activeStateChanged();
|
emit activeStateChanged();
|
||||||
@@ -487,10 +487,10 @@ static inline QString msgActionWarning(QAction *newAction, int k, QAction *oldAc
|
|||||||
|
|
||||||
void Action::addOverrideAction(QAction *action, const Core::Context &context)
|
void Action::addOverrideAction(QAction *action, const Core::Context &context)
|
||||||
{
|
{
|
||||||
if (context.isEmpty()) {
|
if (context.d.isEmpty()) {
|
||||||
m_contextActionMap.insert(0, action);
|
m_contextActionMap.insert(0, action);
|
||||||
} else {
|
} else {
|
||||||
for (int i=0; i<context.size(); ++i) {
|
for (int i = 0; i < context.size(); ++i) {
|
||||||
int k = context.at(i);
|
int k = context.at(i);
|
||||||
if (m_contextActionMap.contains(k))
|
if (m_contextActionMap.contains(k))
|
||||||
qWarning("%s", qPrintable(msgActionWarning(action, k, m_contextActionMap.value(k, 0))));
|
qWarning("%s", qPrintable(msgActionWarning(action, k, m_contextActionMap.value(k, 0))));
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/editormanager/openeditorsmodel.h>
|
#include <coreplugin/editormanager/openeditorsmodel.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -136,8 +135,7 @@ DesignMode::~DesignMode()
|
|||||||
|
|
||||||
Context DesignMode::context() const
|
Context DesignMode::context() const
|
||||||
{
|
{
|
||||||
static Context contexts(
|
static Context contexts(Constants::C_DESIGN_MODE);
|
||||||
Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::C_DESIGN_MODE));
|
|
||||||
return contexts;
|
return contexts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -269,7 +267,7 @@ void DesignMode::updateContext(Core::IMode *newMode, Core::IMode *oldMode)
|
|||||||
|
|
||||||
void DesignMode::setActiveContext(const Context &context)
|
void DesignMode::setActiveContext(const Context &context)
|
||||||
{
|
{
|
||||||
if (d->m_activeContext == context)
|
if (d->m_activeContext.d == context.d)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ModeManager::instance()->currentMode() == this)
|
if (ModeManager::instance()->currentMode() == this)
|
||||||
|
|||||||
@@ -393,7 +393,7 @@ void ShortcutSettings::markPossibleCollisions(ShortcutItem *item)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (int context, currentItem->m_cmd->context()) {
|
foreach (int context, currentItem->m_cmd->context().d) {
|
||||||
|
|
||||||
// conflict if context is identical, OR if one
|
// conflict if context is identical, OR if one
|
||||||
// of the contexts is the global context
|
// of the contexts is the global context
|
||||||
|
|||||||
@@ -117,10 +117,9 @@ QString EditMode::id() const
|
|||||||
|
|
||||||
Context EditMode::context() const
|
Context EditMode::context() const
|
||||||
{
|
{
|
||||||
static Context contexts(
|
static Context contexts(Constants::C_EDIT_MODE,
|
||||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDIT_MODE),
|
Constants::C_EDITORMANAGER,
|
||||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDITORMANAGER) ,
|
Constants::C_NAVIGATION_PANE);
|
||||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_NAVIGATION_PANE));
|
|
||||||
return contexts;
|
return contexts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include <coreplugin/editortoolbar.h>
|
#include <coreplugin/editortoolbar.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -267,15 +266,9 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
|||||||
connect(m_d->m_core, SIGNAL(contextAboutToChange(Core::IContext *)),
|
connect(m_d->m_core, SIGNAL(contextAboutToChange(Core::IContext *)),
|
||||||
this, SLOT(handleContextChange(Core::IContext *)));
|
this, SLOT(handleContextChange(Core::IContext *)));
|
||||||
|
|
||||||
UniqueIDManager *uidm = m_d->m_core->uniqueIDManager();
|
const Context editManagerContext(Constants::C_EDITORMANAGER);
|
||||||
const Context gc = Context(Constants::C_GLOBAL_ID);
|
|
||||||
const Context editManagerContext =
|
|
||||||
Context(uidm->uniqueIdentifier(Constants::C_EDITORMANAGER));
|
|
||||||
|
|
||||||
// combined context for edit & design modes
|
// combined context for edit & design modes
|
||||||
const Context editDesignContext =
|
const Context editDesignContext(Constants::C_EDITORMANAGER, Constants::C_DESIGN_MODE);
|
||||||
Context(uidm->uniqueIdentifier(Constants::C_EDITORMANAGER),
|
|
||||||
uidm->uniqueIdentifier(Constants::C_DESIGN_MODE));
|
|
||||||
|
|
||||||
ActionManager *am = m_d->m_core->actionManager();
|
ActionManager *am = m_d->m_core->actionManager();
|
||||||
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
|
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
|
||||||
@@ -478,11 +471,7 @@ EditorManager::~EditorManager()
|
|||||||
|
|
||||||
void EditorManager::init()
|
void EditorManager::init()
|
||||||
{
|
{
|
||||||
QList<int> context;
|
|
||||||
context << m_d->m_core->uniqueIDManager()->uniqueIdentifier("QtCreator.OpenDocumentsView");
|
|
||||||
|
|
||||||
m_d->m_coreListener = new EditorClosingCoreListener(this);
|
m_d->m_coreListener = new EditorClosingCoreListener(this);
|
||||||
|
|
||||||
pluginManager()->addObject(m_d->m_coreListener);
|
pluginManager()->addObject(m_d->m_coreListener);
|
||||||
|
|
||||||
m_d->m_openEditorsFactory = new OpenEditorsViewFactory();
|
m_d->m_openEditorsFactory = new OpenEditorsViewFactory();
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
#define ICONTEXT_H
|
#define ICONTEXT_H
|
||||||
|
|
||||||
#include <coreplugin/core_global.h>
|
#include <coreplugin/core_global.h>
|
||||||
|
|
||||||
|
#include <QtCore/QList>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@@ -39,13 +41,23 @@ QT_END_NAMESPACE
|
|||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
class CORE_EXPORT Context : public QList<int>
|
class CORE_EXPORT Context
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Context() {}
|
Context() {}
|
||||||
explicit Context(int c1) { append(c1); }
|
|
||||||
Context(int c1, int c2) { append(c1); append(c2); }
|
explicit Context(const char *c1) { add(c1); }
|
||||||
Context(int c1, int c2, int c3) { append(c1); append(c2); append(c3); }
|
Context(const char *c1, const char *c2) { add(c1); add(c2); }
|
||||||
|
Context(const char *c1, const char *c2, const char *c3) { add(c1); add(c2); add(c3); }
|
||||||
|
Context(const char *base, int offset);
|
||||||
|
void add(const char *c);
|
||||||
|
bool contains(const char *c) const;
|
||||||
|
bool contains(int c) const { return d.contains(c); }
|
||||||
|
int size() const { return d.size(); }
|
||||||
|
bool isEmpty() const { return d.isEmpty(); }
|
||||||
|
int at(int i) const { return d.at(i); }
|
||||||
|
public:
|
||||||
|
QList<int> d;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CORE_EXPORT IContext : public QObject
|
class CORE_EXPORT IContext : public QObject
|
||||||
|
|||||||
@@ -1198,21 +1198,21 @@ void MainWindow::writeSettings()
|
|||||||
|
|
||||||
void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add)
|
void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add)
|
||||||
{
|
{
|
||||||
foreach (const int context, remove) {
|
foreach (const int context, remove.d) {
|
||||||
if (context == 0)
|
if (context == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int index = m_additionalContexts.indexOf(context);
|
int index = m_additionalContexts.d.indexOf(context);
|
||||||
if (index != -1)
|
if (index != -1)
|
||||||
m_additionalContexts.removeAt(index);
|
m_additionalContexts.d.removeAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const int context, add) {
|
foreach (const int context, add.d) {
|
||||||
if (context == 0)
|
if (context == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!m_additionalContexts.contains(context))
|
if (!m_additionalContexts.d.contains(context))
|
||||||
m_additionalContexts.prepend(context);
|
m_additionalContexts.d.prepend(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
updateContext();
|
updateContext();
|
||||||
@@ -1228,15 +1228,15 @@ void MainWindow::updateContext()
|
|||||||
Context contexts;
|
Context contexts;
|
||||||
|
|
||||||
if (m_activeContext)
|
if (m_activeContext)
|
||||||
contexts += m_activeContext->context();
|
contexts.d += m_activeContext->context().d;
|
||||||
|
|
||||||
contexts += m_additionalContexts;
|
contexts.d += m_additionalContexts.d;
|
||||||
|
|
||||||
Context uniquecontexts;
|
Context uniquecontexts;
|
||||||
for (int i = 0; i < contexts.size(); ++i) {
|
for (int i = 0; i < contexts.d.size(); ++i) {
|
||||||
const int c = contexts.at(i);
|
const int c = contexts.d.at(i);
|
||||||
if (!uniquecontexts.contains(c))
|
if (!uniquecontexts.d.contains(c))
|
||||||
uniquecontexts << c;
|
uniquecontexts.d << c;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_actionManager->setContext(uniquecontexts);
|
m_actionManager->setContext(uniquecontexts);
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
#include "inavigationwidgetfactory.h"
|
#include "inavigationwidgetfactory.h"
|
||||||
#include "modemanager.h"
|
#include "modemanager.h"
|
||||||
#include "uniqueidmanager.h"
|
|
||||||
#include "actionmanager/actionmanager.h"
|
#include "actionmanager/actionmanager.h"
|
||||||
#include "actionmanager/command.h"
|
#include "actionmanager/command.h"
|
||||||
|
|
||||||
@@ -348,8 +347,7 @@ void NavigationWidget::objectAdded(QObject * obj)
|
|||||||
|
|
||||||
ICore *core = ICore::instance();
|
ICore *core = ICore::instance();
|
||||||
ActionManager *am = core->actionManager();
|
ActionManager *am = core->actionManager();
|
||||||
Context navicontext(core->uniqueIDManager()->
|
Context navicontext(Core::Constants::C_NAVIGATION_PANE);
|
||||||
uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE));
|
|
||||||
|
|
||||||
QString id = factory->id();
|
QString id = factory->id();
|
||||||
QShortcut *shortcut = new QShortcut(this);
|
QShortcut *shortcut = new QShortcut(this);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
|
||||||
UniqueIDManager* UniqueIDManager::m_instance = 0;
|
UniqueIDManager *UniqueIDManager::m_instance = 0;
|
||||||
|
|
||||||
UniqueIDManager::UniqueIDManager()
|
UniqueIDManager::UniqueIDManager()
|
||||||
{
|
{
|
||||||
@@ -64,3 +64,27 @@ QString UniqueIDManager::stringForUniqueIdentifier(int uid)
|
|||||||
{
|
{
|
||||||
return m_uniqueIdentifiers.key(uid);
|
return m_uniqueIdentifiers.key(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Move to some better place.
|
||||||
|
#include "icontext.h"
|
||||||
|
|
||||||
|
static int toId(const char *id)
|
||||||
|
{
|
||||||
|
return UniqueIDManager::instance()->uniqueIdentifier(QLatin1String(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
Context::Context(const char *id, int offset)
|
||||||
|
{
|
||||||
|
d.append(UniqueIDManager::instance()
|
||||||
|
-> uniqueIdentifier(QString(id) + QString::number(offset)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Context::add(const char *id)
|
||||||
|
{
|
||||||
|
d.append(toId(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Context::contains(const char *id) const
|
||||||
|
{
|
||||||
|
return d.contains(toId(id));
|
||||||
|
}
|
||||||
|
|||||||
@@ -47,7 +47,6 @@
|
|||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <texteditor/basetexteditor.h>
|
#include <texteditor/basetexteditor.h>
|
||||||
|
|
||||||
@@ -83,7 +82,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
|
|||||||
Q_UNUSED(error_message)
|
Q_UNUSED(error_message)
|
||||||
|
|
||||||
// Create the globalcontext list to register actions accordingly
|
// Create the globalcontext list to register actions accordingly
|
||||||
Core::Context globalcontext(UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL));
|
Core::Context globalcontext(Core::Constants::C_GLOBAL);
|
||||||
|
|
||||||
// Create the settings Page
|
// Create the settings Page
|
||||||
m_settings->fromSettings(Core::ICore::instance()->settings());
|
m_settings->fromSettings(Core::ICore::instance()->settings());
|
||||||
|
|||||||
@@ -61,7 +61,6 @@
|
|||||||
#include <cpptools/cpptoolsconstants.h>
|
#include <cpptools/cpptoolsconstants.h>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/editormanager/ieditor.h>
|
#include <coreplugin/editormanager/ieditor.h>
|
||||||
@@ -588,10 +587,9 @@ struct FindCanonicalSymbol
|
|||||||
CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
|
CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
|
||||||
: BaseTextEditorEditable(editor)
|
: BaseTextEditorEditable(editor)
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
m_context.add(CppEditor::Constants::C_CPPEDITOR);
|
||||||
m_context << uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
m_context.add(ProjectExplorer::Constants::LANG_CXX);
|
||||||
m_context << uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
m_context.add(TextEditor::Constants::C_TEXTEDITOR);
|
||||||
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CPPEditor::CPPEditor(QWidget *parent)
|
CPPEditor::CPPEditor(QWidget *parent)
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
|||||||
wizardParameters.setId(QLatin1String("C.Header"));
|
wizardParameters.setId(QLatin1String("C.Header"));
|
||||||
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));
|
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));
|
||||||
|
|
||||||
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR));
|
Core::Context context(CppEditor::Constants::C_CPPEDITOR);
|
||||||
|
|
||||||
Core::ActionManager *am = core->actionManager();
|
Core::ActionManager *am = core->actionManager();
|
||||||
Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT);
|
Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT);
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
# include <projectexplorer/projectexplorerconstants.h>
|
# include <projectexplorer/projectexplorerconstants.h>
|
||||||
# include <projectexplorer/session.h>
|
# include <projectexplorer/session.h>
|
||||||
# include <coreplugin/icore.h>
|
# include <coreplugin/icore.h>
|
||||||
# include <coreplugin/uniqueidmanager.h>
|
|
||||||
# include <coreplugin/mimedatabase.h>
|
# include <coreplugin/mimedatabase.h>
|
||||||
# include <coreplugin/editormanager/editormanager.h>
|
# include <coreplugin/editormanager/editormanager.h>
|
||||||
# include <coreplugin/progressmanager/progressmanager.h>
|
# include <coreplugin/progressmanager/progressmanager.h>
|
||||||
@@ -957,16 +956,18 @@ void CppModelManager::editorAboutToClose(Core::IEditor *editor)
|
|||||||
|
|
||||||
bool CppModelManager::isCppEditor(Core::IEditor *editor) const
|
bool CppModelManager::isCppEditor(Core::IEditor *editor) const
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uidm = m_core->uniqueIDManager();
|
return editor->context().contains(ProjectExplorer::Constants::LANG_CXX);
|
||||||
const int uid = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
|
|
||||||
return editor->context().contains(uid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TokenCache *CppModelManager::tokenCache(TextEditor::ITextEditor *editor) const
|
TokenCache *CppModelManager::tokenCache(TextEditor::ITextEditor *editor) const
|
||||||
{ return editorSupport(editor)->tokenCache(); }
|
{
|
||||||
|
return editorSupport(editor)->tokenCache();
|
||||||
|
}
|
||||||
|
|
||||||
void CppModelManager::emitDocumentUpdated(Document::Ptr doc)
|
void CppModelManager::emitDocumentUpdated(Document::Ptr doc)
|
||||||
{ emit documentUpdated(doc); }
|
{
|
||||||
|
emit documentUpdated(doc);
|
||||||
|
}
|
||||||
|
|
||||||
void CppModelManager::onDocumentUpdated(Document::Ptr doc)
|
void CppModelManager::onDocumentUpdated(Document::Ptr doc)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -80,7 +79,6 @@ enum { debug = 0 };
|
|||||||
CppToolsPlugin *CppToolsPlugin::m_instance = 0;
|
CppToolsPlugin *CppToolsPlugin::m_instance = 0;
|
||||||
|
|
||||||
CppToolsPlugin::CppToolsPlugin() :
|
CppToolsPlugin::CppToolsPlugin() :
|
||||||
m_context(-1),
|
|
||||||
m_modelManager(0),
|
m_modelManager(0),
|
||||||
m_fileSettings(new CppFileSettings)
|
m_fileSettings(new CppFileSettings)
|
||||||
{
|
{
|
||||||
@@ -131,8 +129,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
mtools->addMenu(mcpptools);
|
mtools->addMenu(mcpptools);
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
m_context = core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
Core::Context context(CppEditor::Constants::C_CPPEDITOR);
|
||||||
Core::Context context(m_context);
|
|
||||||
|
|
||||||
QAction *switchAction = new QAction(tr("Switch Header/Source"), this);
|
QAction *switchAction = new QAction(tr("Switch Header/Source"), this);
|
||||||
Core::Command *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context);
|
Core::Command *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context);
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ private:
|
|||||||
QString correspondingHeaderOrSourceI(const QString &fileName) const;
|
QString correspondingHeaderOrSourceI(const QString &fileName) const;
|
||||||
QFileInfo findFile(const QDir &dir, const QString &name, const ProjectExplorer::Project *project) const;
|
QFileInfo findFile(const QDir &dir, const QString &name, const ProjectExplorer::Project *project) const;
|
||||||
|
|
||||||
int m_context;
|
|
||||||
CppModelManager *m_modelManager;
|
CppModelManager *m_modelManager;
|
||||||
QSharedPointer<CppFileSettings> m_fileSettings;
|
QSharedPointer<CppFileSettings> m_fileSettings;
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,6 @@
|
|||||||
#include <coreplugin/filemanager.h>
|
#include <coreplugin/filemanager.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -257,7 +256,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
|
|||||||
toolsContainer->addMenu(cvsMenu);
|
toolsContainer->addMenu(cvsMenu);
|
||||||
m_menuAction = cvsMenu->menu()->menuAction();
|
m_menuAction = cvsMenu->menu()->menuAction();
|
||||||
|
|
||||||
Core::Context globalcontext(core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL));
|
Core::Context globalcontext(C_GLOBAL);
|
||||||
|
|
||||||
Core::Command *command;
|
Core::Command *command;
|
||||||
|
|
||||||
@@ -379,8 +378,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
|
|||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
// Actions of the submit editor
|
// Actions of the submit editor
|
||||||
Core::Context cvscommitcontext;
|
Core::Context cvscommitcontext(Constants::CVSCOMMITEDITOR);
|
||||||
cvscommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::CVSCOMMITEDITOR);
|
|
||||||
|
|
||||||
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||||
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, cvscommitcontext);
|
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, cvscommitcontext);
|
||||||
|
|||||||
@@ -82,7 +82,6 @@
|
|||||||
#include <coreplugin/navigationwidget.h>
|
#include <coreplugin/navigationwidget.h>
|
||||||
#include <coreplugin/outputpane.h>
|
#include <coreplugin/outputpane.h>
|
||||||
#include <coreplugin/rightpane.h>
|
#include <coreplugin/rightpane.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
|
|
||||||
#include <cplusplus/ExpressionUnderCursor.h>
|
#include <cplusplus/ExpressionUnderCursor.h>
|
||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
@@ -980,15 +979,12 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
|||||||
ICore *core = ICore::instance();
|
ICore *core = ICore::instance();
|
||||||
QTC_ASSERT(core, return false);
|
QTC_ASSERT(core, return false);
|
||||||
|
|
||||||
Core::UniqueIDManager *uidm = core->uniqueIDManager();
|
|
||||||
QTC_ASSERT(uidm, return false);
|
|
||||||
|
|
||||||
Core::ActionManager *am = core->actionManager();
|
Core::ActionManager *am = core->actionManager();
|
||||||
QTC_ASSERT(am, return false);
|
QTC_ASSERT(am, return false);
|
||||||
|
|
||||||
const Core::Context globalcontext(CC::C_GLOBAL_ID);
|
const Core::Context globalcontext(CC::C_GLOBAL_ID);
|
||||||
const Core::Context cppDebuggercontext(uidm->uniqueIdentifier(C_CPPDEBUGGER));
|
const Core::Context cppDebuggercontext(C_CPPDEBUGGER);
|
||||||
const Core::Context cppeditorcontext(uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR));
|
const Core::Context cppeditorcontext(CppEditor::Constants::C_CPPEDITOR);
|
||||||
|
|
||||||
m_stopIcon = QIcon(_(":/debugger/images/debugger_stop_small.png"));
|
m_stopIcon = QIcon(_(":/debugger/images/debugger_stop_small.png"));
|
||||||
m_stopIcon.addFile(":/debugger/images/debugger_stop.png");
|
m_stopIcon.addFile(":/debugger/images/debugger_stop.png");
|
||||||
@@ -1206,17 +1202,15 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
|||||||
errorMessage->clear();
|
errorMessage->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_gdbRunningContext = Core::Context(uidm->uniqueIdentifier(Constants::GDBRUNNING));
|
m_gdbRunningContext = Core::Context(Constants::GDBRUNNING);
|
||||||
|
|
||||||
// Register factory of DebuggerRunControl.
|
// Register factory of DebuggerRunControl.
|
||||||
m_debuggerRunControlFactory = new DebuggerRunControlFactory
|
m_debuggerRunControlFactory = new DebuggerRunControlFactory
|
||||||
(m_plugin, DebuggerEngineType(cmdLineEnabledEngines));
|
(m_plugin, DebuggerEngineType(cmdLineEnabledEngines));
|
||||||
m_plugin->addAutoReleasedObject(m_debuggerRunControlFactory);
|
m_plugin->addAutoReleasedObject(m_debuggerRunControlFactory);
|
||||||
|
|
||||||
m_debugMode->setContext(Core::Context(
|
m_debugMode->setContext(
|
||||||
uidm->uniqueIdentifier(CC::C_EDITORMANAGER),
|
Core::Context(CC::C_EDITORMANAGER, C_DEBUGMODE, CC::C_NAVIGATION_PANE));
|
||||||
uidm->uniqueIdentifier(C_DEBUGMODE),
|
|
||||||
uidm->uniqueIdentifier(CC::C_NAVIGATION_PANE)));
|
|
||||||
|
|
||||||
m_reverseToolButton = 0;
|
m_reverseToolButton = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/basemode.h>
|
#include <coreplugin/basemode.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
@@ -140,7 +139,7 @@ DebuggerUISwitcher::DebuggerUISwitcher(Core::BaseMode *mode, QObject* parent) :
|
|||||||
|
|
||||||
d->m_languageActionGroup->setExclusive(true);
|
d->m_languageActionGroup->setExclusive(true);
|
||||||
|
|
||||||
d->m_globalContext << Core::Constants::C_GLOBAL_ID;
|
d->m_globalContext.add(Core::Constants::C_GLOBAL_ID);
|
||||||
|
|
||||||
DebuggerUISwitcherPrivate::m_instance = this;
|
DebuggerUISwitcherPrivate::m_instance = this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/helpmanager.h>
|
#include <coreplugin/helpmanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -174,8 +173,7 @@ FormEditorW::FormEditorW() :
|
|||||||
m_fwm = qobject_cast<qdesigner_internal::QDesignerFormWindowManager*>(m_formeditor->formWindowManager());
|
m_fwm = qobject_cast<qdesigner_internal::QDesignerFormWindowManager*>(m_formeditor->formWindowManager());
|
||||||
QTC_ASSERT(m_fwm, return);
|
QTC_ASSERT(m_fwm, return);
|
||||||
|
|
||||||
Core::UniqueIDManager *idMan = Core::UniqueIDManager::instance();
|
m_contexts.add(Designer::Constants::C_FORMEDITOR);
|
||||||
m_contexts << idMan->uniqueIdentifier(QLatin1String(Designer::Constants::C_FORMEDITOR));
|
|
||||||
|
|
||||||
setupActions();
|
setupActions();
|
||||||
|
|
||||||
@@ -331,11 +329,8 @@ void FormEditorW::fullInit()
|
|||||||
layout->addWidget(m_editorWidget);
|
layout->addWidget(m_editorWidget);
|
||||||
m_modeWidget->setLayout(layout);
|
m_modeWidget->setLayout(layout);
|
||||||
|
|
||||||
Core::UniqueIDManager *idMan = Core::UniqueIDManager::instance();
|
|
||||||
int editorManagerContext = idMan->uniqueIdentifier(QLatin1String(Core::Constants::C_EDITORMANAGER));
|
|
||||||
|
|
||||||
Core::Context designerContexts = m_contexts;
|
Core::Context designerContexts = m_contexts;
|
||||||
designerContexts.append(Core::Context(editorManagerContext));
|
designerContexts.add(Core::Constants::C_EDITORMANAGER);
|
||||||
m_context = new DesignerContext(designerContexts, m_modeWidget, this);
|
m_context = new DesignerContext(designerContexts, m_modeWidget, this);
|
||||||
m_core->addContextObject(m_context);
|
m_core->addContextObject(m_context);
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <texteditor/basetextdocument.h>
|
#include <texteditor/basetextdocument.h>
|
||||||
#include <texteditor/plaintexteditor.h>
|
#include <texteditor/plaintexteditor.h>
|
||||||
@@ -75,9 +74,8 @@ FormWindowEditor::FormWindowEditor(Internal::DesignerXmlEditor *editor,
|
|||||||
Core::IEditor(parent),
|
Core::IEditor(parent),
|
||||||
d(new FormWindowEditorPrivate(editor, form))
|
d(new FormWindowEditorPrivate(editor, form))
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
d->m_context.add(Designer::Constants::K_DESIGNER_XML_EDITOR_ID);
|
||||||
d->m_context << uidm->uniqueIdentifier(QLatin1String(Designer::Constants::K_DESIGNER_XML_EDITOR_ID))
|
d->m_context.add(Designer::Constants::C_DESIGNER_XML_EDITOR);
|
||||||
<< uidm->uniqueIdentifier(QLatin1String(Designer::Constants::C_DESIGNER_XML_EDITOR));
|
|
||||||
connect(form, SIGNAL(changed()), this, SIGNAL(changed()));
|
connect(form, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||||
// Revert to saved/load externally modified files
|
// Revert to saved/load externally modified files
|
||||||
connect(&(d->m_file), SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
|
connect(&(d->m_file), SIGNAL(reload(QString)), this, SLOT(slotOpen(QString)));
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
#include "genericprojectmanager.h"
|
#include "genericprojectmanager.h"
|
||||||
#include "genericprojectconstants.h"
|
#include "genericprojectconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
@@ -102,11 +101,9 @@ Core::IFile *ProjectFilesFactory::open(const QString &fileName)
|
|||||||
////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ProjectFilesEditable::ProjectFilesEditable(ProjectFilesEditor *editor)
|
ProjectFilesEditable::ProjectFilesEditable(ProjectFilesEditor *editor)
|
||||||
: TextEditor::BaseTextEditorEditable(editor)
|
: TextEditor::BaseTextEditorEditable(editor),
|
||||||
{
|
m_context(Constants::C_FILESEDITOR)
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
{ }
|
||||||
m_context << uidm->uniqueIdentifier(Constants::C_FILESEDITOR);
|
|
||||||
}
|
|
||||||
|
|
||||||
ProjectFilesEditable::~ProjectFilesEditable()
|
ProjectFilesEditable::~ProjectFilesEditable()
|
||||||
{ }
|
{ }
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/filemanager.h>
|
#include <coreplugin/filemanager.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -282,8 +281,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
m_core = Core::ICore::instance();
|
m_core = Core::ICore::instance();
|
||||||
m_gitClient = new GitClient(this);
|
m_gitClient = new GitClient(this);
|
||||||
// Create the globalcontext list to register actions accordingly
|
// Create the globalcontext list to register actions accordingly
|
||||||
Core::Context globalcontext;
|
Core::Context globalcontext(Core::Constants::C_GLOBAL);
|
||||||
globalcontext << m_core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_GLOBAL);
|
|
||||||
|
|
||||||
// Create the settings Page
|
// Create the settings Page
|
||||||
addAutoReleasedObject(new SettingsPage());
|
addAutoReleasedObject(new SettingsPage());
|
||||||
@@ -493,8 +491,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Submit editor
|
// Submit editor
|
||||||
Core::Context submitContext;
|
Core::Context submitContext(Constants::C_GITSUBMITEDITOR);
|
||||||
submitContext.push_back(m_core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::C_GITSUBMITEDITOR)));
|
|
||||||
m_submitCurrentAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
m_submitCurrentAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||||
Core::Command *command = actionManager->registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
|
Core::Command *command = actionManager->registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
|
||||||
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog()));
|
||||||
|
|||||||
@@ -59,7 +59,6 @@
|
|||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/rightpane.h>
|
#include <coreplugin/rightpane.h>
|
||||||
#include <coreplugin/sidebar.h>
|
#include <coreplugin/sidebar.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <texteditor/texteditorconstants.h>
|
#include <texteditor/texteditorconstants.h>
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
@@ -121,7 +120,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
|||||||
Q_UNUSED(error)
|
Q_UNUSED(error)
|
||||||
m_core = Core::ICore::instance();
|
m_core = Core::ICore::instance();
|
||||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||||
Core::Context modecontext(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_MODE_HELP));
|
Core::Context modecontext(Constants::C_MODE_HELP);
|
||||||
|
|
||||||
const QString &locale = qApp->property("qtc_locale").toString();
|
const QString &locale = qApp->property("qtc_locale").toString();
|
||||||
if (!locale.isEmpty()) {
|
if (!locale.isEmpty()) {
|
||||||
@@ -342,7 +341,7 @@ void HelpPlugin::setupUi()
|
|||||||
{
|
{
|
||||||
// side bar widgets and shortcuts
|
// side bar widgets and shortcuts
|
||||||
Core::ActionManager *am = m_core->actionManager();
|
Core::ActionManager *am = m_core->actionManager();
|
||||||
Core::Context modecontext(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_MODE_HELP));
|
Core::Context modecontext(Constants::C_MODE_HELP);
|
||||||
|
|
||||||
IndexWindow *indexWindow = new IndexWindow();
|
IndexWindow *indexWindow = new IndexWindow();
|
||||||
indexWindow->setWindowTitle(tr(SB_INDEX));
|
indexWindow->setWindowTitle(tr(SB_INDEX));
|
||||||
@@ -520,12 +519,12 @@ void HelpPlugin::createRightPaneContextViewer()
|
|||||||
Aggregation::Aggregate *agg = new Aggregation::Aggregate();
|
Aggregation::Aggregate *agg = new Aggregation::Aggregate();
|
||||||
agg->add(m_helpViewerForSideBar);
|
agg->add(m_helpViewerForSideBar);
|
||||||
agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar));
|
agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar));
|
||||||
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar,Core::Context(
|
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar,
|
||||||
m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR)), this));
|
Core::Context(Constants::C_HELP_SIDEBAR), this));
|
||||||
|
|
||||||
QAction *copy = new QAction(this);
|
QAction *copy = new QAction(this);
|
||||||
Core::Command *cmd = m_core->actionManager()->registerAction(copy, Core::Constants::COPY,
|
Core::Command *cmd = m_core->actionManager()->registerAction(copy, Core::Constants::COPY,
|
||||||
Core::Context(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR)));
|
Core::Context(Constants::C_HELP_SIDEBAR));
|
||||||
copy->setText(cmd->action()->text());
|
copy->setText(cmd->action()->text());
|
||||||
copy->setIcon(cmd->action()->icon());
|
copy->setIcon(cmd->action()->icon());
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include "ui_imageviewertoolbar.h"
|
#include "ui_imageviewertoolbar.h"
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -51,6 +50,10 @@ namespace Internal {
|
|||||||
|
|
||||||
struct ImageViewerPrivate
|
struct ImageViewerPrivate
|
||||||
{
|
{
|
||||||
|
ImageViewerPrivate()
|
||||||
|
: context(Constants::IMAGEVIEWER_ID)
|
||||||
|
{}
|
||||||
|
|
||||||
Core::Context context;
|
Core::Context context;
|
||||||
QString displayName;
|
QString displayName;
|
||||||
ImageViewerFile *file;
|
ImageViewerFile *file;
|
||||||
@@ -64,8 +67,6 @@ ImageViewer::ImageViewer(QWidget *parent)
|
|||||||
d_ptr(new ImageViewerPrivate)
|
d_ptr(new ImageViewerPrivate)
|
||||||
{
|
{
|
||||||
d_ptr->file = new ImageViewerFile(this);
|
d_ptr->file = new ImageViewerFile(this);
|
||||||
d_ptr->context << Core::ICore::instance()->uniqueIDManager()
|
|
||||||
->uniqueIdentifier(Constants::IMAGEVIEWER_ID);
|
|
||||||
|
|
||||||
d_ptr->imageView = new ImageView();
|
d_ptr->imageView = new ImageView();
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include <QtGui/QAction>
|
#include <QtGui/QAction>
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
@@ -50,6 +49,10 @@ enum SupportedActions { ZoomIn = 0, ZoomOut, OriginalSize, FitToScreen, Backgrou
|
|||||||
|
|
||||||
struct ImageViewerActionHandlerPrivate
|
struct ImageViewerActionHandlerPrivate
|
||||||
{
|
{
|
||||||
|
ImageViewerActionHandlerPrivate()
|
||||||
|
: context(Constants::IMAGEVIEWER_ID)
|
||||||
|
{}
|
||||||
|
|
||||||
QPointer<QAction> actionZoomIn;
|
QPointer<QAction> actionZoomIn;
|
||||||
QPointer<QAction> actionZoomOut;
|
QPointer<QAction> actionZoomOut;
|
||||||
QPointer<QAction> actionOriginalSize;
|
QPointer<QAction> actionOriginalSize;
|
||||||
@@ -65,9 +68,6 @@ ImageViewerActionHandler::ImageViewerActionHandler(QObject *parent) :
|
|||||||
QObject(parent),
|
QObject(parent),
|
||||||
d_ptr(new ImageViewerActionHandlerPrivate)
|
d_ptr(new ImageViewerActionHandlerPrivate)
|
||||||
{
|
{
|
||||||
d_ptr->context << Core::ICore::instance()->uniqueIDManager()
|
|
||||||
->uniqueIdentifier(Constants::IMAGEVIEWER_ID);
|
|
||||||
|
|
||||||
d_ptr->signalMapper = new QSignalMapper(this);
|
d_ptr->signalMapper = new QSignalMapper(this);
|
||||||
connect(d_ptr->signalMapper, SIGNAL(mapped(int)), SLOT(actionTriggered(int)));
|
connect(d_ptr->signalMapper, SIGNAL(mapped(int)), SLOT(actionTriggered(int)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/settingsdatabase.h>
|
#include <coreplugin/settingsdatabase.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -106,8 +105,7 @@ bool LocatorPlugin::initialize(const QStringList &, QString *)
|
|||||||
m_locatorWidget->setEnabled(false);
|
m_locatorWidget->setEnabled(false);
|
||||||
Core::StatusBarWidget *view = new Core::StatusBarWidget;
|
Core::StatusBarWidget *view = new Core::StatusBarWidget;
|
||||||
view->setWidget(m_locatorWidget);
|
view->setWidget(m_locatorWidget);
|
||||||
view->setContext(Core::Context(core->uniqueIDManager()
|
view->setContext(Core::Context("LocatorWidget"));
|
||||||
->uniqueIdentifier(QLatin1String("LocatorWidget"))));
|
|
||||||
view->setPosition(Core::StatusBarWidget::First);
|
view->setPosition(Core::StatusBarWidget::First);
|
||||||
addAutoReleasedObject(view);
|
addAutoReleasedObject(view);
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
#include <coreplugin/vcsmanager.h>
|
#include <coreplugin/vcsmanager.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/filemanager.h>
|
#include <coreplugin/filemanager.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
@@ -207,7 +206,7 @@ QStringList MercurialPlugin::standardArguments() const
|
|||||||
|
|
||||||
void MercurialPlugin::createMenu()
|
void MercurialPlugin::createMenu()
|
||||||
{
|
{
|
||||||
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Core::Constants::C_GLOBAL)));
|
Core::Context context(Core::Constants::C_GLOBAL);
|
||||||
|
|
||||||
// Create menu item for Mercurial
|
// Create menu item for Mercurial
|
||||||
mercurialContainer = actionManager->createMenu(QLatin1String("Mercurial.MercurialMenu"));
|
mercurialContainer = actionManager->createMenu(QLatin1String("Mercurial.MercurialMenu"));
|
||||||
@@ -534,7 +533,7 @@ void MercurialPlugin::outgoing()
|
|||||||
|
|
||||||
void MercurialPlugin::createSubmitEditorActions()
|
void MercurialPlugin::createSubmitEditorActions()
|
||||||
{
|
{
|
||||||
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::COMMIT_ID)));
|
Core::Context context(Constants::COMMIT_ID);
|
||||||
Core::Command *command;
|
Core::Command *command;
|
||||||
|
|
||||||
editorCommit = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
editorCommit = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||||
|
|||||||
@@ -47,7 +47,6 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <locator/commandlocator.h>
|
#include <locator/commandlocator.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/synchronousprocess.h>
|
#include <utils/synchronousprocess.h>
|
||||||
@@ -268,8 +267,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
|
|||||||
m_menuAction = mperforce->menu()->menuAction();
|
m_menuAction = mperforce->menu()->menuAction();
|
||||||
|
|
||||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||||
Core::Context perforcesubmitcontext(
|
Core::Context perforcesubmitcontext(Constants::PERFORCESUBMITEDITOR_CONTEXT);
|
||||||
Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::PERFORCESUBMITEDITOR_CONTEXT));
|
|
||||||
|
|
||||||
Core::Command *command;
|
Core::Command *command;
|
||||||
|
|
||||||
|
|||||||
@@ -384,7 +384,7 @@ OutputWindow::OutputWindow(QWidget *parent)
|
|||||||
|
|
||||||
static uint usedIds = 0;
|
static uint usedIds = 0;
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QString(Constants::C_APP_OUTPUT) + QString().setNum(usedIds++)));
|
Core::Context context(Constants::C_APP_OUTPUT, usedIds++);
|
||||||
m_outputWindowContext = new Core::BaseContext(this, context);
|
m_outputWindowContext = new Core::BaseContext(this, context);
|
||||||
core->addContextObject(m_outputWindowContext);
|
core->addContextObject(m_outputWindowContext);
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,6 @@
|
|||||||
#include <coreplugin/mainwindow.h>
|
#include <coreplugin/mainwindow.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -265,7 +264,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
d->m_proWindow = new ProjectWindow;
|
d->m_proWindow = new ProjectWindow;
|
||||||
|
|
||||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||||
Core::Context pecontext(core->uniqueIDManager()->uniqueIdentifier(Constants::C_PROJECTEXPLORER));
|
Core::Context pecontext(Constants::C_PROJECTEXPLORER);
|
||||||
|
|
||||||
d->m_projectsMode = new Core::BaseMode;
|
d->m_projectsMode = new Core::BaseMode;
|
||||||
d->m_projectsMode->setDisplayName(tr("Projects"));
|
d->m_projectsMode->setDisplayName(tr("Projects"));
|
||||||
@@ -1312,12 +1311,12 @@ void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node
|
|||||||
Core::Context newContext;
|
Core::Context newContext;
|
||||||
|
|
||||||
if (d->m_currentProject) {
|
if (d->m_currentProject) {
|
||||||
oldContext.append(d->m_currentProject->projectManager()->projectContext());
|
oldContext.d.append(d->m_currentProject->projectManager()->projectContext());
|
||||||
oldContext.append(d->m_currentProject->projectManager()->projectLanguage());
|
oldContext.d.append(d->m_currentProject->projectManager()->projectLanguage());
|
||||||
}
|
}
|
||||||
if (project) {
|
if (project) {
|
||||||
newContext.append(project->projectManager()->projectContext());
|
newContext.d.append(project->projectManager()->projectContext());
|
||||||
newContext.append(project->projectManager()->projectLanguage());
|
newContext.d.append(project->projectManager()->projectLanguage());
|
||||||
}
|
}
|
||||||
|
|
||||||
core->updateAdditionalContexts(oldContext, newContext);
|
core->updateAdditionalContexts(oldContext, newContext);
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/icontext.h>
|
#include <coreplugin/icontext.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QtCore/QDir>
|
||||||
@@ -98,7 +97,7 @@ public:
|
|||||||
virtual QWidget *widget();
|
virtual QWidget *widget();
|
||||||
private:
|
private:
|
||||||
QWidget *m_taskList;
|
QWidget *m_taskList;
|
||||||
Core::Context m_context;
|
const Core::Context m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TaskModel : public QAbstractItemModel
|
class TaskModel : public QAbstractItemModel
|
||||||
@@ -1000,10 +999,10 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
|||||||
}
|
}
|
||||||
|
|
||||||
TaskWindowContext::TaskWindowContext(QWidget *widget)
|
TaskWindowContext::TaskWindowContext(QWidget *widget)
|
||||||
: Core::IContext(widget), m_taskList(widget)
|
: Core::IContext(widget),
|
||||||
|
m_taskList(widget),
|
||||||
|
m_context(Core::Constants::C_PROBLEM_PANE)
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
|
||||||
m_context << uidm->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Context TaskWindowContext::context() const
|
Core::Context TaskWindowContext::context() const
|
||||||
|
|||||||
@@ -30,23 +30,21 @@
|
|||||||
#include "designmodecontext.h"
|
#include "designmodecontext.h"
|
||||||
#include "qmldesignerconstants.h"
|
#include "qmldesignerconstants.h"
|
||||||
#include "designmodewidget.h"
|
#include "designmodewidget.h"
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
DesignModeContext::DesignModeContext(DesignModeWidget *widget) : IContext(widget),
|
DesignModeContext::DesignModeContext(DesignModeWidget *widget)
|
||||||
m_widget(widget)
|
: IContext(widget),
|
||||||
|
m_widget(widget),
|
||||||
|
m_context(Constants::C_FORMEDITOR, Constants::C_QT_QUICK_TOOLS_MENU)
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uuidManager = Core::UniqueIDManager::instance();
|
|
||||||
m_context << uuidManager->uniqueIdentifier(Constants::C_FORMEDITOR)
|
|
||||||
<< uuidManager->uniqueIdentifier(Constants::C_QT_QUICK_TOOLS_MENU);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DesignModeContext::~DesignModeContext()
|
DesignModeContext::~DesignModeContext()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Context DesignModeContext::context() const
|
Core::Context DesignModeContext::context() const
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ public:
|
|||||||
QString contextHelpId() const;
|
QString contextHelpId() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Core::Context m_context;
|
|
||||||
DesignModeWidget *m_widget;
|
DesignModeWidget *m_widget;
|
||||||
|
const Core::Context m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,24 +35,22 @@
|
|||||||
#include "settingspage.h"
|
#include "settingspage.h"
|
||||||
#include "designmodecontext.h"
|
#include "designmodecontext.h"
|
||||||
|
|
||||||
#include <coreplugin/designmode.h>
|
|
||||||
#include <qmljseditor/qmljseditorconstants.h>
|
#include <qmljseditor/qmljseditorconstants.h>
|
||||||
|
|
||||||
#include <coreplugin/modemanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/icontext.h>
|
|
||||||
#include <coreplugin/dialogs/iwizard.h>
|
|
||||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
|
||||||
#include <coreplugin/mimedatabase.h>
|
|
||||||
#include <coreplugin/coreconstants.h>
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/editormanager/openeditorsmodel.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
|
#include <coreplugin/actionmanager/command.h>
|
||||||
|
#include <coreplugin/coreconstants.h>
|
||||||
|
#include <coreplugin/designmode.h>
|
||||||
|
#include <coreplugin/dialogs/iwizard.h>
|
||||||
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||||
|
#include <coreplugin/editormanager/openeditorsmodel.h>
|
||||||
|
#include <coreplugin/icontext.h>
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -119,8 +117,7 @@ bool BauhausPlugin::initialize(const QStringList & /*arguments*/, QString *error
|
|||||||
{
|
{
|
||||||
Core::ICore *core = Core::ICore::instance();
|
Core::ICore *core = Core::ICore::instance();
|
||||||
|
|
||||||
const int uid = core->uniqueIDManager()->uniqueIdentifier(QLatin1String(QmlDesigner::Constants::C_FORMEDITOR));
|
const Core::Context switchContext(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
||||||
const Core::Context switchContext(core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID));
|
|
||||||
|
|
||||||
Core::ActionManager *am = core->actionManager();
|
Core::ActionManager *am = core->actionManager();
|
||||||
|
|
||||||
@@ -163,8 +160,7 @@ void BauhausPlugin::createDesignModeWidget()
|
|||||||
|
|
||||||
m_context = new DesignModeContext(m_mainWidget);
|
m_context = new DesignModeContext(m_mainWidget);
|
||||||
creatorCore->addContextObject(m_context);
|
creatorCore->addContextObject(m_context);
|
||||||
Core::UniqueIDManager *uuidManager = Core::UniqueIDManager::instance();
|
Core::Context formEditorContext(Constants::C_FORMEDITOR);
|
||||||
Core::Context formEditorContext(uuidManager->uniqueIdentifier(Constants::C_FORMEDITOR));
|
|
||||||
|
|
||||||
// Revert to saved
|
// Revert to saved
|
||||||
actionManager->registerAction(m_revertToSavedAction,
|
actionManager->registerAction(m_revertToSavedAction,
|
||||||
@@ -279,8 +275,8 @@ void BauhausPlugin::contextChanged(Core::IContext *context, const Core::Context
|
|||||||
{
|
{
|
||||||
Q_UNUSED(context)
|
Q_UNUSED(context)
|
||||||
|
|
||||||
foreach (int additionalContext, additionalContexts) {
|
foreach (int additionalContext, additionalContexts.d) {
|
||||||
if (m_context->context().contains(additionalContext)) {
|
if (m_context->context().d.contains(additionalContext)) {
|
||||||
m_isActive = true;
|
m_isActive = true;
|
||||||
m_mainWidget->showEditor(m_editorManager->currentEditor());
|
m_mainWidget->showEditor(m_editorManager->currentEditor());
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -34,8 +34,6 @@
|
|||||||
#include "components/objecttree.h"
|
#include "components/objecttree.h"
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@@ -43,10 +41,11 @@
|
|||||||
namespace Qml {
|
namespace Qml {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
InspectorContext::InspectorContext(QWidget *widget) : IContext(widget),
|
InspectorContext::InspectorContext(QWidget *widget)
|
||||||
m_widget(widget)
|
: IContext(widget),
|
||||||
|
m_widget(widget),
|
||||||
|
m_context(Constants::C_INSPECTOR)
|
||||||
{
|
{
|
||||||
m_context << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::C_INSPECTOR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InspectorContext::~InspectorContext()
|
InspectorContext::~InspectorContext()
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
** contact the sales department at http://qt.nokia.com/contact.
|
** contact the sales department at http://qt.nokia.com/contact.
|
||||||
**
|
**
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#include "qmlinspectorconstants.h"
|
#include "qmlinspectorconstants.h"
|
||||||
#include "qmlinspector.h"
|
#include "qmlinspector.h"
|
||||||
#include "qmlinspectorplugin.h"
|
#include "qmlinspectorplugin.h"
|
||||||
@@ -47,7 +48,6 @@
|
|||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
|
|
||||||
@@ -100,8 +100,7 @@ bool QmlInspectorPlugin::initialize(const QStringList &arguments, QString *error
|
|||||||
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
|
ExtensionSystem::PluginManager *pluginManager = ExtensionSystem::PluginManager::instance();
|
||||||
Debugger::DebuggerUISwitcher *uiSwitcher = pluginManager->getObject<Debugger::DebuggerUISwitcher>();
|
Debugger::DebuggerUISwitcher *uiSwitcher = pluginManager->getObject<Debugger::DebuggerUISwitcher>();
|
||||||
|
|
||||||
uiSwitcher->addLanguage(Qml::Constants::LANG_QML,
|
uiSwitcher->addLanguage(Qml::Constants::LANG_QML, Core::Context(Constants::C_INSPECTOR));
|
||||||
Core::Context(core->uniqueIDManager()->uniqueIdentifier(Constants::C_INSPECTOR)));
|
|
||||||
m_inspector = new QmlInspector;
|
m_inspector = new QmlInspector;
|
||||||
m_inspector->createDockWidgets();
|
m_inspector->createDockWidgets();
|
||||||
addObject(m_inspector);
|
addObject(m_inspector);
|
||||||
|
|||||||
@@ -53,7 +53,6 @@
|
|||||||
#include <coreplugin/modemanager.h>
|
#include <coreplugin/modemanager.h>
|
||||||
#include <coreplugin/designmode.h>
|
#include <coreplugin/designmode.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
#include <texteditor/basetextdocument.h>
|
#include <texteditor/basetextdocument.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
@@ -575,11 +574,9 @@ int SemanticInfo::revision() const
|
|||||||
QmlJSEditorEditable::QmlJSEditorEditable(QmlJSTextEditor *editor)
|
QmlJSEditorEditable::QmlJSEditorEditable(QmlJSTextEditor *editor)
|
||||||
: BaseTextEditorEditable(editor)
|
: BaseTextEditorEditable(editor)
|
||||||
{
|
{
|
||||||
|
m_context.add(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
m_context.add(TextEditor::Constants::C_TEXTEDITOR);
|
||||||
m_context << uidm->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
m_context.add(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
||||||
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
|
||||||
m_context << uidm->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use preferred mode from Bauhaus settings
|
// Use preferred mode from Bauhaus settings
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ namespace QmlJSEditor {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
QmlJSEditorActionHandler::QmlJSEditorActionHandler()
|
QmlJSEditorActionHandler::QmlJSEditorActionHandler()
|
||||||
: TextEditor::TextEditorActionHandler(QLatin1String(QmlJSEditor::Constants::C_QMLJSEDITOR_ID),
|
: TextEditor::TextEditorActionHandler(QmlJSEditor::Constants::C_QMLJSEDITOR_ID, Format)
|
||||||
Format)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,9 +110,8 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
|||||||
m_modelManager = new ModelManager(this);
|
m_modelManager = new ModelManager(this);
|
||||||
addAutoReleasedObject(m_modelManager);
|
addAutoReleasedObject(m_modelManager);
|
||||||
|
|
||||||
Core::Context context;
|
Core::Context context(QmlJSEditor::Constants::C_QMLJSEDITOR_ID,
|
||||||
context << core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID)
|
QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
||||||
<< core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
|
||||||
|
|
||||||
m_editor = new QmlJSEditorFactory(this);
|
m_editor = new QmlJSEditorFactory(this);
|
||||||
addObject(m_editor);
|
addObject(m_editor);
|
||||||
@@ -140,7 +139,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
|||||||
mtools->addMenu(menuQtQuick);
|
mtools->addMenu(menuQtQuick);
|
||||||
m_actionPreview = new QAction("&Preview", this);
|
m_actionPreview = new QAction("&Preview", this);
|
||||||
|
|
||||||
Core::Context toolsMenuContext(core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU));
|
Core::Context toolsMenuContext(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
||||||
Core::Command *cmd = addToolAction(m_actionPreview, am, toolsMenuContext,
|
Core::Command *cmd = addToolAction(m_actionPreview, am, toolsMenuContext,
|
||||||
QLatin1String("QtQuick.Preview"), menuQtQuick, tr("Ctrl+Alt+R"));
|
QLatin1String("QtQuick.Preview"), menuQtQuick, tr("Ctrl+Alt+R"));
|
||||||
connect(cmd->action(), SIGNAL(triggered()), SLOT(openPreview()));
|
connect(cmd->action(), SIGNAL(triggered()), SLOT(openPreview()));
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/texteditoractionhandler.h>
|
#include <texteditor/texteditoractionhandler.h>
|
||||||
#include <texteditor/texteditorconstants.h>
|
#include <texteditor/texteditorconstants.h>
|
||||||
@@ -54,11 +53,10 @@ using namespace Qt4ProjectManager::Internal;
|
|||||||
//
|
//
|
||||||
|
|
||||||
ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
|
ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
|
||||||
: BaseTextEditorEditable(editor)
|
: BaseTextEditorEditable(editor),
|
||||||
|
m_context(Qt4ProjectManager::Constants::C_PROFILEEDITOR,
|
||||||
|
TextEditor::Constants::C_TEXTEDITOR)
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
|
||||||
m_context << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::C_PROFILEEDITOR);
|
|
||||||
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
|
||||||
// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
|
// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
QString id() const;
|
QString id() const;
|
||||||
bool isTemporary() const { return false; }
|
bool isTemporary() const { return false; }
|
||||||
private:
|
private:
|
||||||
Core::Context m_context;
|
const Core::Context m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ProFileEditor : public TextEditor::BaseTextEditor
|
class ProFileEditor : public TextEditor::BaseTextEditor
|
||||||
|
|||||||
@@ -60,7 +60,6 @@
|
|||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
@@ -173,9 +172,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
|||||||
am->actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);
|
am->actionContainer(ProjectExplorer::Constants::M_SUBPROJECTCONTEXT);
|
||||||
|
|
||||||
//register actions
|
//register actions
|
||||||
m_projectContext = core->uniqueIDManager()->
|
Core::Context context(Qt4ProjectManager::Constants::PROJECT_ID);
|
||||||
uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_ID);
|
|
||||||
Core::Context context(m_projectContext);
|
|
||||||
Core::Command *command;
|
Core::Command *command;
|
||||||
|
|
||||||
QIcon qmakeIcon(QLatin1String(":/qt4projectmanager/images/run_qmake.png"));
|
QIcon qmakeIcon(QLatin1String(":/qt4projectmanager/images/run_qmake.png"));
|
||||||
|
|||||||
@@ -86,14 +86,13 @@ private:
|
|||||||
ProFileEditorFactory *m_proFileEditorFactory;
|
ProFileEditorFactory *m_proFileEditorFactory;
|
||||||
Qt4Manager *m_qt4ProjectManager;
|
Qt4Manager *m_qt4ProjectManager;
|
||||||
|
|
||||||
int m_projectContext;
|
|
||||||
|
|
||||||
QAction *m_runQMakeAction;
|
QAction *m_runQMakeAction;
|
||||||
QAction *m_runQMakeActionContextMenu;
|
QAction *m_runQMakeActionContextMenu;
|
||||||
QAction *m_buildSubProjectContextMenu;
|
QAction *m_buildSubProjectContextMenu;
|
||||||
QAction *m_rebuildSubProjectContextMenu;
|
QAction *m_rebuildSubProjectContextMenu;
|
||||||
QAction *m_cleanSubProjectContextMenu;
|
QAction *m_cleanSubProjectContextMenu;
|
||||||
GettingStartedWelcomePage *m_welcomePage;
|
GettingStartedWelcomePage *m_welcomePage;
|
||||||
|
int m_projectContext;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include "resourceeditorplugin.h"
|
#include "resourceeditorplugin.h"
|
||||||
#include "resourceeditorconstants.h"
|
#include "resourceeditorconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/fileiconprovider.h>
|
#include <coreplugin/fileiconprovider.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
|
|
||||||
@@ -45,10 +44,9 @@ using namespace ResourceEditor::Constants;
|
|||||||
ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
|
ResourceEditorFactory::ResourceEditorFactory(ResourceEditorPlugin *plugin) :
|
||||||
Core::IEditorFactory(plugin),
|
Core::IEditorFactory(plugin),
|
||||||
m_mimeTypes(QStringList(QLatin1String("application/vnd.nokia.xml.qt.resource"))),
|
m_mimeTypes(QStringList(QLatin1String("application/vnd.nokia.xml.qt.resource"))),
|
||||||
|
m_context(ResourceEditor::Constants::C_RESOURCEEDITOR),
|
||||||
m_plugin(plugin)
|
m_plugin(plugin)
|
||||||
{
|
{
|
||||||
m_context += Core::UniqueIDManager::instance()
|
|
||||||
->uniqueIdentifier(QLatin1String(ResourceEditor::Constants::C_RESOURCEEDITOR));
|
|
||||||
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
|
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
|
||||||
iconProvider->registerIconOverlayForSuffix(QIcon(":/resourceeditor/images/qt_qrc.png"),
|
iconProvider->registerIconOverlayForSuffix(QIcon(":/resourceeditor/images/qt_qrc.png"),
|
||||||
QLatin1String("qrc"));
|
QLatin1String("qrc"));
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
const QStringList m_mimeTypes;
|
const QStringList m_mimeTypes;
|
||||||
Core::Context m_context;
|
const Core::Context m_context;
|
||||||
|
|
||||||
ResourceEditorPlugin *m_plugin;
|
ResourceEditorPlugin *m_plugin;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -87,12 +87,10 @@ bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *err
|
|||||||
errorMessage->clear();
|
errorMessage->clear();
|
||||||
|
|
||||||
// Register undo and redo
|
// Register undo and redo
|
||||||
Core::ActionManager * const actionManager = core->actionManager();
|
const Core::Context context(Constants::C_RESOURCEEDITOR);
|
||||||
int const contextId = core->uniqueIDManager()->uniqueIdentifier(
|
|
||||||
Constants::C_RESOURCEEDITOR);
|
|
||||||
const Core::Context context(contextId);
|
|
||||||
m_undoAction = new QAction(tr("&Undo"), this);
|
m_undoAction = new QAction(tr("&Undo"), this);
|
||||||
m_redoAction = new QAction(tr("&Redo"), this);
|
m_redoAction = new QAction(tr("&Redo"), this);
|
||||||
|
Core::ActionManager * const actionManager = core->actionManager();
|
||||||
actionManager->registerAction(m_undoAction, Core::Constants::UNDO, context);
|
actionManager->registerAction(m_undoAction, Core::Constants::UNDO, context);
|
||||||
actionManager->registerAction(m_redoAction, Core::Constants::REDO, context);
|
actionManager->registerAction(m_redoAction, Core::Constants::REDO, context);
|
||||||
connect(m_undoAction, SIGNAL(triggered()), this, SLOT(onUndo()));
|
connect(m_undoAction, SIGNAL(triggered()), this, SLOT(onUndo()));
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
#include <coreplugin/filemanager.h>
|
#include <coreplugin/filemanager.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -304,8 +303,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
subversionMenu->menu()->setTitle(tr("&Subversion"));
|
subversionMenu->menu()->setTitle(tr("&Subversion"));
|
||||||
toolsContainer->addMenu(subversionMenu);
|
toolsContainer->addMenu(subversionMenu);
|
||||||
m_menuAction = subversionMenu->menu()->menuAction();
|
m_menuAction = subversionMenu->menu()->menuAction();
|
||||||
Core::Context globalcontext(core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL));
|
Core::Context globalcontext(C_GLOBAL);
|
||||||
|
|
||||||
Core::Command *command;
|
Core::Command *command;
|
||||||
|
|
||||||
m_diffCurrentAction = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
|
m_diffCurrentAction = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
|
||||||
@@ -456,8 +454,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
|||||||
m_commandLocator->appendCommand(command);
|
m_commandLocator->appendCommand(command);
|
||||||
|
|
||||||
// Actions of the submit editor
|
// Actions of the submit editor
|
||||||
Core::Context svncommitcontext;
|
Core::Context svncommitcontext(Constants::SUBVERSIONCOMMITEDITOR);
|
||||||
svncommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
|
|
||||||
|
|
||||||
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||||
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext);
|
command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext);
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include "fontsettings.h"
|
#include "fontsettings.h"
|
||||||
|
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
|
|
||||||
@@ -56,11 +55,9 @@ using namespace TextEditor;
|
|||||||
using namespace TextEditor::Internal;
|
using namespace TextEditor::Internal;
|
||||||
|
|
||||||
PlainTextEditorEditable::PlainTextEditorEditable(PlainTextEditor *editor)
|
PlainTextEditorEditable::PlainTextEditorEditable(PlainTextEditor *editor)
|
||||||
: BaseTextEditorEditable(editor)
|
: BaseTextEditorEditable(editor),
|
||||||
|
m_context(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID, TextEditor::Constants::C_TEXTEDITOR)
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
|
||||||
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
|
|
||||||
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlainTextEditor::PlainTextEditor(QWidget *parent)
|
PlainTextEditor::PlainTextEditor(QWidget *parent)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
virtual QString id() const;
|
virtual QString id() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Core::Context m_context;
|
const Core::Context m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
class TEXTEDITOR_EXPORT PlainTextEditor : public BaseTextEditor
|
class TEXTEDITOR_EXPORT PlainTextEditor : public BaseTextEditor
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ PlainTextEditorFactory::PlainTextEditorFactory(QObject *parent)
|
|||||||
: Core::IEditorFactory(parent)
|
: Core::IEditorFactory(parent)
|
||||||
{
|
{
|
||||||
m_actionHandler = new TextEditorActionHandler(
|
m_actionHandler = new TextEditorActionHandler(
|
||||||
QLatin1String(TextEditor::Constants::C_TEXTEDITOR),
|
TextEditor::Constants::C_TEXTEDITOR,
|
||||||
TextEditorActionHandler::Format |
|
TextEditorActionHandler::Format |
|
||||||
TextEditorActionHandler::UnCommentSelection |
|
TextEditorActionHandler::UnCommentSelection |
|
||||||
TextEditorActionHandler::UnCollapseAll);
|
TextEditorActionHandler::UnCollapseAll);
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
#include <locator/locatormanager.h>
|
#include <locator/locatormanager.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
@@ -53,7 +52,7 @@
|
|||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
using namespace TextEditor::Internal;
|
using namespace TextEditor::Internal;
|
||||||
|
|
||||||
TextEditorActionHandler::TextEditorActionHandler(const QString &context,
|
TextEditorActionHandler::TextEditorActionHandler(const char *context,
|
||||||
uint optionalActions)
|
uint optionalActions)
|
||||||
: QObject(Core::ICore::instance()),
|
: QObject(Core::ICore::instance()),
|
||||||
m_undoAction(0),
|
m_undoAction(0),
|
||||||
@@ -91,10 +90,9 @@ TextEditorActionHandler::TextEditorActionHandler(const QString &context,
|
|||||||
m_joinLinesAction(0),
|
m_joinLinesAction(0),
|
||||||
m_optionalActions(optionalActions),
|
m_optionalActions(optionalActions),
|
||||||
m_currentEditor(0),
|
m_currentEditor(0),
|
||||||
|
m_contextId(context),
|
||||||
m_initialized(false)
|
m_initialized(false)
|
||||||
{
|
{
|
||||||
m_contextId << Core::UniqueIDManager::instance()->uniqueIdentifier(context);
|
|
||||||
|
|
||||||
connect(Core::ICore::instance()->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
connect(Core::ICore::instance()->editorManager(), SIGNAL(currentEditorChanged(Core::IEditor*)),
|
||||||
this, SLOT(updateCurrentEditor(Core::IEditor*)));
|
this, SLOT(updateCurrentEditor(Core::IEditor*)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public:
|
|||||||
UnCollapseAll = 4
|
UnCollapseAll = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
TextEditorActionHandler(const QString &context, uint optionalActions = None);
|
TextEditorActionHandler(const char *context, uint optionalActions = None);
|
||||||
void setupActions(BaseTextEditor *editor);
|
void setupActions(BaseTextEditor *editor);
|
||||||
|
|
||||||
void initializeActions();
|
void initializeActions();
|
||||||
|
|||||||
@@ -44,7 +44,6 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/mimedatabase.h>
|
#include <coreplugin/mimedatabase.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/actionmanager/command.h>
|
#include <coreplugin/actionmanager/command.h>
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
@@ -116,8 +115,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
m_lineNumberFilter = new LineNumberFilter;
|
m_lineNumberFilter = new LineNumberFilter;
|
||||||
addAutoReleasedObject(m_lineNumberFilter);
|
addAutoReleasedObject(m_lineNumberFilter);
|
||||||
|
|
||||||
int contextId = core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
Core::Context context(TextEditor::Constants::C_TEXTEDITOR);
|
||||||
Core::Context context(contextId);
|
|
||||||
Core::ActionManager *am = core->actionManager();
|
Core::ActionManager *am = core->actionManager();
|
||||||
|
|
||||||
// Add shortcut for invoking automatic completion
|
// Add shortcut for invoking automatic completion
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
#include "vcsbaseconstants.h"
|
#include "vcsbaseconstants.h"
|
||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
#include <coreplugin/ifile.h>
|
#include <coreplugin/ifile.h>
|
||||||
#include <coreplugin/iversioncontrol.h>
|
#include <coreplugin/iversioncontrol.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
@@ -99,11 +98,9 @@ VCSBaseEditorEditable::VCSBaseEditorEditable(VCSBaseEditor *editor,
|
|||||||
const VCSBaseEditorParameters *type) :
|
const VCSBaseEditorParameters *type) :
|
||||||
BaseTextEditorEditable(editor),
|
BaseTextEditorEditable(editor),
|
||||||
m_id(type->id),
|
m_id(type->id),
|
||||||
|
m_context(type->context, TextEditor::Constants::C_TEXTEDITOR),
|
||||||
m_temporary(false)
|
m_temporary(false)
|
||||||
{
|
{
|
||||||
Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
|
|
||||||
m_context << uidm->uniqueIdentifier(QLatin1String(type->context))
|
|
||||||
<< uidm->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Core::Context VCSBaseEditorEditable::context() const
|
Core::Context VCSBaseEditorEditable::context() const
|
||||||
|
|||||||
@@ -93,12 +93,12 @@ struct VCSBaseSubmitEditorPrivate
|
|||||||
QString m_displayName;
|
QString m_displayName;
|
||||||
QString m_checkScriptWorkingDirectory;
|
QString m_checkScriptWorkingDirectory;
|
||||||
VCSBase::Internal::SubmitEditorFile *m_file;
|
VCSBase::Internal::SubmitEditorFile *m_file;
|
||||||
Core::Context m_contexts;
|
|
||||||
|
|
||||||
QPointer<QAction> m_diffAction;
|
QPointer<QAction> m_diffAction;
|
||||||
QPointer<QAction> m_submitAction;
|
QPointer<QAction> m_submitAction;
|
||||||
|
|
||||||
Internal::NickNameDialog *m_nickNameDialog;
|
Internal::NickNameDialog *m_nickNameDialog;
|
||||||
|
Core::Context m_contexts;
|
||||||
};
|
};
|
||||||
|
|
||||||
VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditorParameters *parameters,
|
VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditorParameters *parameters,
|
||||||
@@ -108,9 +108,9 @@ VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditor
|
|||||||
m_toolWidget(0),
|
m_toolWidget(0),
|
||||||
m_parameters(parameters),
|
m_parameters(parameters),
|
||||||
m_file(new VCSBase::Internal::SubmitEditorFile(QLatin1String(m_parameters->mimeType), q)),
|
m_file(new VCSBase::Internal::SubmitEditorFile(QLatin1String(m_parameters->mimeType), q)),
|
||||||
m_nickNameDialog(0)
|
m_nickNameDialog(0),
|
||||||
|
m_contexts(m_parameters->context)
|
||||||
{
|
{
|
||||||
m_contexts << Core::UniqueIDManager::instance()->uniqueIdentifier(m_parameters->context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters,
|
VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters,
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
#include <coreplugin/uniqueidmanager.h>
|
|
||||||
|
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
#include <utils/welcomemodetreewidget.h>
|
#include <utils/welcomemodetreewidget.h>
|
||||||
@@ -150,8 +149,7 @@ QString WelcomeMode::id() const
|
|||||||
|
|
||||||
Core::Context WelcomeMode::context() const
|
Core::Context WelcomeMode::context() const
|
||||||
{
|
{
|
||||||
static Core::Context contexts =
|
static Core::Context contexts(Core::Constants::C_WELCOME_MODE);
|
||||||
Core::Context(Core::UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_WELCOME_MODE));
|
|
||||||
return contexts;
|
return contexts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user