forked from qt-creator/qt-creator
core: use a class derived from QList<int> instead of a QList<int> for Core::Context
A mostly mechanical change. Reviewed-By: con
This commit is contained in:
@@ -319,7 +319,7 @@ public:
|
||||
|
||||
QWidget *widget() { return m_editor; }
|
||||
|
||||
QList<int> context() const { return m_context; }
|
||||
Core::Context context() const { return m_context; }
|
||||
|
||||
bool createNew(const QString & /* contents */ = QString()) {
|
||||
m_editor->setData(QByteArray());
|
||||
@@ -354,7 +354,7 @@ private:
|
||||
BinEditor *m_editor;
|
||||
QString m_displayName;
|
||||
BinEditorFile *m_file;
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
QToolBar *m_toolBar;
|
||||
Utils::LineColumnLabel *m_cursorPositionLabel;
|
||||
};
|
||||
|
@@ -69,7 +69,7 @@ private slots:
|
||||
void updateCurrentEditor(Core::IContext *object);
|
||||
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
QAction *registerNewAction(const QString &id, const QString &title = QString());
|
||||
QAction *registerNewAction(const QString &id, QObject *receiver, const char *slot,
|
||||
const QString &title = QString());
|
||||
|
@@ -303,7 +303,7 @@ BookmarkContext::BookmarkContext(BookmarkView *widget)
|
||||
m_context << UniqueIDManager::instance()->uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
|
||||
}
|
||||
|
||||
QList<int> BookmarkContext::context() const
|
||||
Context BookmarkContext::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ BookmarkManager::BookmarkManager() :
|
||||
m_bookmarkIcon(QLatin1String(":/bookmarks/images/bookmark.png")),
|
||||
m_selectionModel(new QItemSelectionModel(this, this))
|
||||
{
|
||||
connect(Core::ICore::instance(), SIGNAL(contextChanged(Core::IContext*,QList<int>)),
|
||||
connect(Core::ICore::instance(), SIGNAL(contextChanged(Core::IContext*,Core::Context)),
|
||||
this, SLOT(updateActionStatus()));
|
||||
|
||||
connect(ProjectExplorerPlugin::instance()->session(), SIGNAL(sessionLoaded()),
|
||||
|
@@ -161,11 +161,11 @@ class BookmarkContext : public Core::IContext
|
||||
{
|
||||
public:
|
||||
BookmarkContext(BookmarkView *widget);
|
||||
virtual QList<int> context() const;
|
||||
virtual Core::Context context() const;
|
||||
virtual QWidget *widget();
|
||||
private:
|
||||
BookmarkView *m_bookmarkView;
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
class BookmarkViewFactory : public Core::INavigationWidgetFactory
|
||||
|
@@ -69,13 +69,9 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
|
||||
{
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
|
||||
QList<int> context = QList<int>() << core->uniqueIDManager()->
|
||||
uniqueIdentifier(Constants::BOOKMARKS_CONTEXT);
|
||||
QList<int> textcontext, globalcontext;
|
||||
textcontext << core->uniqueIDManager()->
|
||||
uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||
Core::UniqueIDManager *uidm = core->uniqueIDManager();
|
||||
Core::Context textcontext(uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR));
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
|
||||
Core::ActionContainer *mtools =
|
||||
am->actionContainer(Core::Constants::M_TOOLS);
|
||||
|
@@ -56,7 +56,7 @@ CMakeEditorEditable::CMakeEditorEditable(CMakeEditor *editor)
|
||||
m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
||||
}
|
||||
|
||||
QList<int> CMakeEditorEditable::context() const
|
||||
Core::Context CMakeEditorEditable::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -53,14 +53,14 @@ class CMakeEditorEditable : public TextEditor::BaseTextEditorEditable
|
||||
{
|
||||
public:
|
||||
CMakeEditorEditable(CMakeEditor *);
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
|
||||
bool duplicateSupported() const { return true; }
|
||||
Core::IEditor *duplicate(QWidget *parent);
|
||||
QString id() const;
|
||||
bool isTemporary() const { return false; }
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
class CMakeEditor : public TextEditor::BaseTextEditor
|
||||
|
@@ -265,7 +265,7 @@ bool ActionManagerPrivate::hasContext(int context) const
|
||||
return m_context.contains(context);
|
||||
}
|
||||
|
||||
void ActionManagerPrivate::setContext(const QList<int> &context)
|
||||
void ActionManagerPrivate::setContext(const Context &context)
|
||||
{
|
||||
// here are possibilities for speed optimization if necessary:
|
||||
// let commands (de-)register themselves for contexts
|
||||
@@ -276,7 +276,7 @@ void ActionManagerPrivate::setContext(const QList<int> &context)
|
||||
it.value()->setCurrentContext(m_context);
|
||||
}
|
||||
|
||||
bool ActionManagerPrivate::hasContext(QList<int> context) const
|
||||
bool ActionManagerPrivate::hasContext(const Context &context) const
|
||||
{
|
||||
for (int i = 0; i < m_context.count(); ++i) {
|
||||
if (context.contains(m_context.at(i)))
|
||||
@@ -321,7 +321,7 @@ ActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
|
||||
return mbc;
|
||||
}
|
||||
|
||||
Command *ActionManagerPrivate::registerAction(QAction *action, const QString &id, const QList<int> &context)
|
||||
Command *ActionManagerPrivate::registerAction(QAction *action, const QString &id, const Context &context)
|
||||
{
|
||||
Action *a = 0;
|
||||
Command *c = registerOverridableAction(action, id, false);
|
||||
@@ -377,7 +377,7 @@ Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const
|
||||
return a;
|
||||
}
|
||||
|
||||
Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
|
||||
Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const Context &context)
|
||||
{
|
||||
Shortcut *sc = 0;
|
||||
int uid = UniqueIDManager::instance()->uniqueIdentifier(id);
|
||||
@@ -404,7 +404,7 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStri
|
||||
sc->setShortcut(shortcut);
|
||||
|
||||
if (context.isEmpty())
|
||||
sc->setContext(QList<int>() << 0);
|
||||
sc->setContext(Context(0));
|
||||
else
|
||||
sc->setContext(context);
|
||||
|
||||
|
@@ -45,6 +45,7 @@ namespace Core {
|
||||
|
||||
class ActionContainer;
|
||||
class Command;
|
||||
class Context;
|
||||
|
||||
class CORE_EXPORT ActionManager : public QObject
|
||||
{
|
||||
@@ -56,8 +57,8 @@ public:
|
||||
virtual ActionContainer *createMenu(const QString &id) = 0;
|
||||
virtual ActionContainer *createMenuBar(const QString &id) = 0;
|
||||
|
||||
virtual Command *registerAction(QAction *action, const QString &id, const QList<int> &context) = 0;
|
||||
virtual Command *registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context) = 0;
|
||||
virtual Command *registerAction(QAction *action, const QString &id, const Context &context) = 0;
|
||||
virtual Command *registerShortcut(QShortcut *shortcut, const QString &id, const Context &context) = 0;
|
||||
|
||||
virtual Command *command(const QString &id) const = 0;
|
||||
virtual ActionContainer *actionContainer(const QString &id) const = 0;
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#define ACTIONMANAGERPRIVATE_H
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QHash>
|
||||
@@ -64,7 +65,7 @@ public:
|
||||
explicit ActionManagerPrivate(MainWindow *mainWnd);
|
||||
~ActionManagerPrivate();
|
||||
|
||||
void setContext(const QList<int> &context);
|
||||
void setContext(const Context &context);
|
||||
static ActionManagerPrivate *instance();
|
||||
|
||||
void saveSettings(QSettings *settings);
|
||||
@@ -85,15 +86,15 @@ public:
|
||||
ActionContainer *createMenuBar(const QString &id);
|
||||
|
||||
Command *registerAction(QAction *action, const QString &id,
|
||||
const QList<int> &context);
|
||||
const Context &context);
|
||||
Command *registerShortcut(QShortcut *shortcut, const QString &id,
|
||||
const QList<int> &context);
|
||||
const Context &context);
|
||||
|
||||
Core::Command *command(const QString &id) const;
|
||||
Core::ActionContainer *actionContainer(const QString &id) const;
|
||||
|
||||
private:
|
||||
bool hasContext(QList<int> context) const;
|
||||
bool hasContext(const Context &context) const;
|
||||
Command *registerOverridableAction(QAction *action, const QString &id,
|
||||
bool checkUnique);
|
||||
|
||||
@@ -109,7 +110,7 @@ private:
|
||||
// typedef QMap<int, int> GlobalGroupMap;
|
||||
// GlobalGroupMap m_globalgroups;
|
||||
//
|
||||
QList<int> m_context;
|
||||
Context m_context;
|
||||
|
||||
MainWindow *m_mainWnd;
|
||||
};
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "command_p.h"
|
||||
|
||||
#include "icore.h"
|
||||
#include "icontext.h"
|
||||
#include "uniqueidmanager.h"
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
@@ -238,7 +239,7 @@ QShortcut *CommandPrivate::shortcut() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
QList<int> CommandPrivate::context() const
|
||||
Core::Context CommandPrivate::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
@@ -295,12 +296,12 @@ QShortcut *Shortcut::shortcut() const
|
||||
return m_shortcut;
|
||||
}
|
||||
|
||||
void Shortcut::setContext(const QList<int> &context)
|
||||
void Shortcut::setContext(const Core::Context &context)
|
||||
{
|
||||
m_context = context;
|
||||
}
|
||||
|
||||
QList<int> Shortcut::context() const
|
||||
Core::Context Shortcut::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
@@ -333,7 +334,7 @@ QString Shortcut::defaultText() const
|
||||
return m_defaultText;
|
||||
}
|
||||
|
||||
bool Shortcut::setCurrentContext(const QList<int> &context)
|
||||
bool Shortcut::setCurrentContext(const Context &context)
|
||||
{
|
||||
foreach (int ctxt, m_context) {
|
||||
if (context.contains(ctxt)) {
|
||||
@@ -431,7 +432,7 @@ QKeySequence Action::keySequence() const
|
||||
return m_action->shortcut();
|
||||
}
|
||||
|
||||
bool Action::setCurrentContext(const QList<int> &context)
|
||||
bool Action::setCurrentContext(const Core::Context &context)
|
||||
{
|
||||
m_context = context;
|
||||
|
||||
@@ -484,7 +485,7 @@ static inline QString msgActionWarning(QAction *newAction, int k, QAction *oldAc
|
||||
return msg;
|
||||
}
|
||||
|
||||
void Action::addOverrideAction(QAction *action, const QList<int> &context)
|
||||
void Action::addOverrideAction(QAction *action, const Core::Context &context)
|
||||
{
|
||||
if (context.isEmpty()) {
|
||||
m_contextActionMap.insert(0, action);
|
||||
|
@@ -43,6 +43,8 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
|
||||
class Context;
|
||||
|
||||
class CORE_EXPORT Command : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -65,7 +67,7 @@ public:
|
||||
|
||||
virtual QAction *action() const = 0;
|
||||
virtual QShortcut *shortcut() const = 0;
|
||||
virtual QList<int> context() const = 0;
|
||||
virtual Context context() const = 0;
|
||||
|
||||
virtual void setAttribute(CommandAttribute attr) = 0;
|
||||
virtual void removeAttribute(CommandAttribute attr) = 0;
|
||||
|
@@ -60,19 +60,19 @@ public:
|
||||
|
||||
QAction *action() const;
|
||||
QShortcut *shortcut() const;
|
||||
QList<int> context() const;
|
||||
Context context() const;
|
||||
|
||||
|
||||
void setAttribute(CommandAttribute attr);
|
||||
void removeAttribute(CommandAttribute attr);
|
||||
bool hasAttribute(CommandAttribute attr) const;
|
||||
|
||||
virtual bool setCurrentContext(const QList<int> &context) = 0;
|
||||
virtual bool setCurrentContext(const Context &context) = 0;
|
||||
|
||||
QString stringWithAppendedShortcut(const QString &str) const;
|
||||
|
||||
protected:
|
||||
QList<int> m_context;
|
||||
Context m_context;
|
||||
QString m_category;
|
||||
int m_attributes;
|
||||
int m_id;
|
||||
@@ -98,9 +98,9 @@ public:
|
||||
void setShortcut(QShortcut *shortcut);
|
||||
QShortcut *shortcut() const;
|
||||
|
||||
void setContext(const QList<int> &context);
|
||||
QList<int> context() const;
|
||||
bool setCurrentContext(const QList<int> &context);
|
||||
void setContext(const Context &context);
|
||||
Context context() const;
|
||||
bool setCurrentContext(const Context &context);
|
||||
|
||||
bool isActive() const;
|
||||
private:
|
||||
@@ -126,9 +126,9 @@ public:
|
||||
void setLocations(const QList<CommandLocation> &locations);
|
||||
QList<CommandLocation> locations() const;
|
||||
|
||||
bool setCurrentContext(const QList<int> &context);
|
||||
bool setCurrentContext(const Context &context);
|
||||
bool isActive() const;
|
||||
void addOverrideAction(QAction *action, const QList<int> &context);
|
||||
void addOverrideAction(QAction *action, const Context &context);
|
||||
|
||||
protected:
|
||||
void updateToolTipWithKeySequence();
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
int priority() const { return m_priority; }
|
||||
QWidget *widget() { return m_widget; }
|
||||
QString id() const { return m_id; }
|
||||
QList<int> context() const { return m_context; }
|
||||
Context context() const { return m_context; }
|
||||
QString contextHelpId() const { return m_helpId; }
|
||||
|
||||
void setDisplayName(const QString &name) { m_displayName = name; }
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
void setWidget(QWidget *widget) { m_widget = widget; }
|
||||
void setId(const QString &id) { m_id = id; }
|
||||
void setContextHelpId(const QString &helpId) { m_helpId = helpId; }
|
||||
void setContext(const QList<int> &context) { m_context = context; }
|
||||
void setContext(const Context &context) { m_context = context; }
|
||||
|
||||
private:
|
||||
QString m_displayName;
|
||||
@@ -76,7 +76,7 @@ private:
|
||||
QWidget *m_widget;
|
||||
QString m_id;
|
||||
QString m_helpId;
|
||||
QList<int> m_context;
|
||||
Context m_context;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
@@ -191,7 +191,7 @@ QStatusBar *CoreImpl::statusBar() const
|
||||
return m_mainwindow->statusBar();
|
||||
}
|
||||
|
||||
void CoreImpl::updateAdditionalContexts(const QList<int> &remove, const QList<int> &add)
|
||||
void CoreImpl::updateAdditionalContexts(const Context &remove, const Context &add)
|
||||
{
|
||||
m_mainwindow->updateAdditionalContexts(remove, add);
|
||||
}
|
||||
|
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
// Adds and removes additional active contexts, these contexts are appended
|
||||
// to the currently active contexts.
|
||||
void updateAdditionalContexts(const QList<int> &remove, const QList<int> &add);
|
||||
void updateAdditionalContexts(const Context &remove, const Context &add);
|
||||
bool hasContext(int context) const;
|
||||
void addContextObject(IContext *context);
|
||||
void removeContextObject(IContext *context);
|
||||
|
@@ -87,7 +87,7 @@ bool DesignModeCoreListener::coreAboutToClose()
|
||||
struct DesignEditorInfo {
|
||||
int widgetIndex;
|
||||
QStringList mimeTypes;
|
||||
QList<int> context;
|
||||
Context context;
|
||||
QWidget *widget;
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ struct DesignModePrivate {
|
||||
|
||||
EditorManager *m_editorManager;
|
||||
QStackedWidget *m_stackWidget;
|
||||
QList<int> m_activeContext;
|
||||
Context m_activeContext;
|
||||
};
|
||||
|
||||
DesignModePrivate::DesignModePrivate(DesignMode *q, EditorManager *editorManager) :
|
||||
@@ -134,10 +134,10 @@ DesignMode::~DesignMode()
|
||||
delete d;
|
||||
}
|
||||
|
||||
QList<int> DesignMode::context() const
|
||||
Context DesignMode::context() const
|
||||
{
|
||||
static QList<int> contexts = QList<int>() <<
|
||||
Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::C_DESIGN_MODE);
|
||||
static Context contexts(
|
||||
Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::C_DESIGN_MODE));
|
||||
return contexts;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ QStringList DesignMode::registeredMimeTypes() const
|
||||
*/
|
||||
void DesignMode::registerDesignWidget(QWidget *widget,
|
||||
const QStringList &mimeTypes,
|
||||
const QList<int> &context)
|
||||
const Context &context)
|
||||
{
|
||||
int index = d->m_stackWidget->addWidget(widget);
|
||||
|
||||
@@ -235,7 +235,7 @@ void DesignMode::currentEditorChanged(Core::IEditor *editor)
|
||||
disconnect(d->m_currentEditor.data(), SIGNAL(changed()), this, SLOT(updateActions()));
|
||||
|
||||
if (!mimeEditorAvailable) {
|
||||
setActiveContext(QList<int>());
|
||||
setActiveContext(Context());
|
||||
if (core->modeManager()->currentMode() == this)
|
||||
core->modeManager()->activateMode(Core::Constants::MODE_EDIT);
|
||||
setEnabled(false);
|
||||
@@ -260,14 +260,14 @@ void DesignMode::updateContext(Core::IMode *newMode, Core::IMode *oldMode)
|
||||
{
|
||||
if (newMode == this) {
|
||||
// Apply active context
|
||||
Core::ICore::instance()->updateAdditionalContexts(QList<int>(), d->m_activeContext);
|
||||
Core::ICore::instance()->updateAdditionalContexts(Context(), d->m_activeContext);
|
||||
} else if (oldMode == this) {
|
||||
// Remove active context
|
||||
Core::ICore::instance()->updateAdditionalContexts(d->m_activeContext, QList<int>());
|
||||
Core::ICore::instance()->updateAdditionalContexts(d->m_activeContext, Context());
|
||||
}
|
||||
}
|
||||
|
||||
void DesignMode::setActiveContext(const QList<int> &context)
|
||||
void DesignMode::setActiveContext(const Context &context)
|
||||
{
|
||||
if (d->m_activeContext == context)
|
||||
return;
|
||||
|
@@ -59,13 +59,13 @@ public:
|
||||
|
||||
void registerDesignWidget(QWidget *widget,
|
||||
const QStringList &mimeTypes,
|
||||
const QList<int> &context);
|
||||
const Context &context);
|
||||
void unregisterDesignWidget(QWidget *widget);
|
||||
|
||||
QStringList registeredMimeTypes() const;
|
||||
|
||||
// IContext
|
||||
QList<int> context() const;
|
||||
Context context() const;
|
||||
QWidget *widget();
|
||||
|
||||
// IMode
|
||||
@@ -83,7 +83,7 @@ private slots:
|
||||
void updateContext(Core::IMode *newMode, Core::IMode *oldMode);
|
||||
|
||||
private:
|
||||
void setActiveContext(const QList<int> &context);
|
||||
void setActiveContext(const Context &context);
|
||||
|
||||
DesignModePrivate *d;
|
||||
friend class Internal::DesignModeCoreListener;
|
||||
|
@@ -115,12 +115,12 @@ QString EditMode::id() const
|
||||
return QLatin1String(Constants::MODE_EDIT);
|
||||
}
|
||||
|
||||
QList<int> EditMode::context() const
|
||||
Context EditMode::context() const
|
||||
{
|
||||
static QList<int> contexts = QList<int>() <<
|
||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDIT_MODE) <<
|
||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDITORMANAGER) <<
|
||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_NAVIGATION_PANE);
|
||||
static Context contexts(
|
||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDIT_MODE),
|
||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_EDITORMANAGER) ,
|
||||
UniqueIDManager::instance()->uniqueIdentifier(Constants::C_NAVIGATION_PANE));
|
||||
return contexts;
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
int priority() const;
|
||||
QWidget* widget();
|
||||
QString id() const;
|
||||
QList<int> context() const;
|
||||
Context context() const;
|
||||
|
||||
private slots:
|
||||
void grabEditorManager(Core::IMode *mode);
|
||||
|
@@ -250,7 +250,7 @@ EditorManager *EditorManager::m_instance = 0;
|
||||
|
||||
static Command *createSeparator(ActionManager *am, QObject *parent,
|
||||
const QString &name,
|
||||
const QList<int> &context)
|
||||
const Context &context)
|
||||
{
|
||||
QAction *tmpaction = new QAction(parent);
|
||||
tmpaction->setSeparator(true);
|
||||
@@ -267,14 +267,15 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
|
||||
connect(m_d->m_core, SIGNAL(contextAboutToChange(Core::IContext *)),
|
||||
this, SLOT(handleContextChange(Core::IContext *)));
|
||||
|
||||
const QList<int> gc = QList<int>() << Constants::C_GLOBAL_ID;
|
||||
const QList<int> editManagerContext =
|
||||
QList<int>() << m_d->m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER);
|
||||
UniqueIDManager *uidm = m_d->m_core->uniqueIDManager();
|
||||
const Context gc = Context(Constants::C_GLOBAL_ID);
|
||||
const Context editManagerContext =
|
||||
Context(uidm->uniqueIdentifier(Constants::C_EDITORMANAGER));
|
||||
|
||||
// combined context for edit & design modes
|
||||
const QList<int> editDesignContext =
|
||||
QList<int>() << m_d->m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER)
|
||||
<< m_d->m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_DESIGN_MODE);
|
||||
const Context editDesignContext =
|
||||
Context(uidm->uniqueIdentifier(Constants::C_EDITORMANAGER),
|
||||
uidm->uniqueIdentifier(Constants::C_DESIGN_MODE));
|
||||
|
||||
ActionManager *am = m_d->m_core->actionManager();
|
||||
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
|
||||
|
@@ -39,6 +39,15 @@ QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
|
||||
class CORE_EXPORT Context : public QList<int>
|
||||
{
|
||||
public:
|
||||
Context() {}
|
||||
explicit Context(int c1) { append(c1); }
|
||||
Context(int c1, int c2) { append(c1); append(c2); }
|
||||
Context(int c1, int c2, int c3) { append(c1); append(c2); append(c3); }
|
||||
};
|
||||
|
||||
class CORE_EXPORT IContext : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -46,7 +55,7 @@ public:
|
||||
IContext(QObject *parent = 0) : QObject(parent) {}
|
||||
virtual ~IContext() {}
|
||||
|
||||
virtual QList<int> context() const = 0;
|
||||
virtual Context context() const = 0;
|
||||
virtual QWidget *widget() = 0;
|
||||
virtual QString contextHelpId() const { return QString(); }
|
||||
};
|
||||
@@ -54,20 +63,20 @@ public:
|
||||
class BaseContext : public Core::IContext
|
||||
{
|
||||
public:
|
||||
BaseContext(QWidget *widget, const QList<int> &context, QObject *parent = 0)
|
||||
BaseContext(QWidget *widget, const Context &context, QObject *parent = 0)
|
||||
: Core::IContext(parent),
|
||||
m_widget(widget),
|
||||
m_context(context)
|
||||
{
|
||||
}
|
||||
|
||||
QList<int> context() const { return m_context; }
|
||||
Context context() const { return m_context; }
|
||||
|
||||
QWidget *widget() { return m_widget; }
|
||||
|
||||
private:
|
||||
QWidget *m_widget;
|
||||
QList<int> m_context;
|
||||
Context m_context;
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
@@ -48,6 +48,7 @@ QT_END_NAMESPACE
|
||||
namespace Core {
|
||||
|
||||
class ActionManager;
|
||||
class Context;
|
||||
class EditorManager;
|
||||
class FileManager;
|
||||
class HelpManager;
|
||||
@@ -111,7 +112,7 @@ public:
|
||||
virtual IContext *currentContextObject() const = 0;
|
||||
// Adds and removes additional active contexts, these contexts are appended
|
||||
// to the currently active contexts.
|
||||
virtual void updateAdditionalContexts(const QList<int> &remove, const QList<int> &add) = 0;
|
||||
virtual void updateAdditionalContexts(const Context &remove, const Context &add) = 0;
|
||||
virtual bool hasContext(int context) const = 0;
|
||||
virtual void addContextObject(IContext *context) = 0;
|
||||
virtual void removeContextObject(IContext *context) = 0;
|
||||
@@ -125,7 +126,7 @@ signals:
|
||||
void optionsDialogRequested();
|
||||
void coreAboutToClose();
|
||||
void contextAboutToChange(Core::IContext *context);
|
||||
void contextChanged(Core::IContext *context, const QList<int> &additionalContexts);
|
||||
void contextChanged(Core::IContext *context, const Core::Context &additionalContexts);
|
||||
};
|
||||
|
||||
} // namespace Core
|
||||
|
@@ -112,7 +112,7 @@ MainWindow::MainWindow() :
|
||||
EventFilteringMainWindow(),
|
||||
m_coreImpl(new CoreImpl(this)),
|
||||
m_uniqueIDManager(new UniqueIDManager()),
|
||||
m_globalContext(QList<int>() << Constants::C_GLOBAL_ID),
|
||||
m_globalContext(Constants::C_GLOBAL_ID),
|
||||
m_additionalContexts(m_globalContext),
|
||||
// keep this in sync with main() in app/main.cpp
|
||||
m_settings(new QSettings(QSettings::IniFormat, QSettings::UserScope,
|
||||
@@ -493,7 +493,7 @@ void MainWindow::registerDefaultContainers()
|
||||
|
||||
static Command *createSeparator(ActionManager *am, QObject *parent,
|
||||
const QString &name,
|
||||
const QList<int> &context)
|
||||
const Context &context)
|
||||
{
|
||||
QAction *tmpaction = new QAction(parent);
|
||||
tmpaction->setSeparator(true);
|
||||
@@ -1196,7 +1196,7 @@ void MainWindow::writeSettings()
|
||||
m_navigationWidget->saveSettings(m_settings);
|
||||
}
|
||||
|
||||
void MainWindow::updateAdditionalContexts(const QList<int> &remove, const QList<int> &add)
|
||||
void MainWindow::updateAdditionalContexts(const Context &remove, const Context &add)
|
||||
{
|
||||
foreach (const int context, remove) {
|
||||
if (context == 0)
|
||||
@@ -1225,14 +1225,14 @@ bool MainWindow::hasContext(int context) const
|
||||
|
||||
void MainWindow::updateContext()
|
||||
{
|
||||
QList<int> contexts;
|
||||
Context contexts;
|
||||
|
||||
if (m_activeContext)
|
||||
contexts += m_activeContext->context();
|
||||
|
||||
contexts += m_additionalContexts;
|
||||
|
||||
QList<int> uniquecontexts;
|
||||
Context uniquecontexts;
|
||||
for (int i = 0; i < contexts.size(); ++i) {
|
||||
const int c = contexts.at(i);
|
||||
if (!uniquecontexts.contains(c))
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include "core_global.h"
|
||||
#include "icontext.h"
|
||||
#include "dialogs/iwizard.h"
|
||||
|
||||
#include "eventfilteringmainwindow.h"
|
||||
@@ -117,7 +118,7 @@ public:
|
||||
IContext * currentContextObject() const;
|
||||
QStatusBar *statusBar() const;
|
||||
|
||||
void updateAdditionalContexts(const QList<int> &remove, const QList<int> &add);
|
||||
void updateAdditionalContexts(const Context &remove, const Context &add);
|
||||
bool hasContext(int context) const;
|
||||
|
||||
void setSuppressNavigationWidget(bool suppress);
|
||||
@@ -178,8 +179,8 @@ private:
|
||||
|
||||
CoreImpl *m_coreImpl;
|
||||
UniqueIDManager *m_uniqueIDManager;
|
||||
QList<int> m_globalContext;
|
||||
QList<int> m_additionalContexts;
|
||||
Context m_globalContext;
|
||||
Context m_additionalContexts;
|
||||
QSettings *m_settings;
|
||||
QSettings *m_globalSettings;
|
||||
SettingsDatabase *m_settingsDatabase;
|
||||
|
@@ -57,7 +57,8 @@
|
||||
|
||||
namespace Core {
|
||||
|
||||
struct ModeManagerPrivate {
|
||||
struct ModeManagerPrivate
|
||||
{
|
||||
explicit ModeManagerPrivate(Internal::MainWindow *mainWindow,
|
||||
Internal::FancyTabWidget *modeStack,
|
||||
ModeManager *q);
|
||||
@@ -70,7 +71,7 @@ struct ModeManagerPrivate {
|
||||
QVector<IMode*> m_modes;
|
||||
QVector<Command*> m_modeShortcuts;
|
||||
QSignalMapper *m_signalMapper;
|
||||
QList<int> m_addedContexts;
|
||||
Context m_addedContexts;
|
||||
int m_oldCurrent;
|
||||
};
|
||||
|
||||
@@ -178,7 +179,7 @@ void ModeManager::objectAdded(QObject *obj)
|
||||
const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->id();
|
||||
QShortcut *shortcut = new QShortcut(d->m_mainWindow);
|
||||
shortcut->setWhatsThis(tr("Switch to <b>%1</b> mode").arg(mode->displayName()));
|
||||
Command *cmd = am->registerShortcut(shortcut, shortcutId, QList<int>() << Constants::C_GLOBAL_ID);
|
||||
Command *cmd = am->registerShortcut(shortcut, shortcutId, Context(Constants::C_GLOBAL_ID));
|
||||
|
||||
d->m_modeShortcuts.insert(index, cmd);
|
||||
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include "navigationwidget.h"
|
||||
|
||||
#include "icore.h"
|
||||
#include "icontext.h"
|
||||
#include "coreconstants.h"
|
||||
#include "inavigationwidgetfactory.h"
|
||||
#include "modemanager.h"
|
||||
@@ -347,8 +348,8 @@ void NavigationWidget::objectAdded(QObject * obj)
|
||||
|
||||
ICore *core = ICore::instance();
|
||||
ActionManager *am = core->actionManager();
|
||||
QList<int> navicontext = QList<int>() << core->uniqueIDManager()->
|
||||
uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE);
|
||||
Context navicontext(core->uniqueIDManager()->
|
||||
uniqueIdentifier(Core::Constants::C_NAVIGATION_PANE));
|
||||
|
||||
QString id = factory->id();
|
||||
QShortcut *shortcut = new QShortcut(this);
|
||||
|
@@ -282,8 +282,7 @@ void OutputPaneManager::init()
|
||||
{
|
||||
ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
|
||||
QList<int> globalcontext;
|
||||
globalcontext.append(Core::Constants::C_GLOBAL_ID);
|
||||
Context globalcontext = Context(Core::Constants::C_GLOBAL_ID);
|
||||
|
||||
// Window->Output Panes
|
||||
ActionContainer *mpanes = am->createMenu(Constants::M_WINDOW_PANES);
|
||||
@@ -357,7 +356,7 @@ void OutputPaneManager::init()
|
||||
actionId.remove(QLatin1Char(' '));
|
||||
QAction *action = new QAction(outPane->displayName(), this);
|
||||
|
||||
Command *cmd = am->registerAction(action, actionId, QList<int>() << Constants::C_GLOBAL_ID);
|
||||
Command *cmd = am->registerAction(action, actionId, Context(Constants::C_GLOBAL_ID));
|
||||
|
||||
mpanes->addAction(cmd, "Coreplugin.OutputPane.PanesGroup");
|
||||
m_actions.insert(cmd->action(), idx);
|
||||
|
@@ -80,7 +80,7 @@ QSettings *CorePrototype::settings() const
|
||||
return callee()->settings();
|
||||
}
|
||||
|
||||
void CorePrototype::updateAdditionalContexts(const QList<int> &remove, const QList<int> &add)
|
||||
void CorePrototype::updateAdditionalContexts(const Context &remove, const Context &add)
|
||||
{
|
||||
callee()->updateAdditionalContexts(remove, add);
|
||||
}
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
QSettings *settings() const;
|
||||
|
||||
public slots:
|
||||
void updateAdditionalContexts(const QList<int> &remove, const QList<int> &add);
|
||||
void updateAdditionalContexts(const Context &remove, const Context &add);
|
||||
QString toString() const;
|
||||
|
||||
private:
|
||||
|
@@ -36,7 +36,7 @@ using namespace Core;
|
||||
StatusBarWidget::StatusBarWidget(QObject *parent)
|
||||
: IContext(parent),
|
||||
m_widget(0),
|
||||
m_context(QList<int>()),
|
||||
m_context(),
|
||||
m_defaultPosition(StatusBarWidget::First)
|
||||
{
|
||||
}
|
||||
@@ -46,7 +46,7 @@ StatusBarWidget::~StatusBarWidget()
|
||||
delete m_widget;
|
||||
}
|
||||
|
||||
QList<int> StatusBarWidget::context() const
|
||||
Context StatusBarWidget::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ QWidget *StatusBarWidget::setWidget(QWidget *widget)
|
||||
return oldWidget;
|
||||
}
|
||||
|
||||
void StatusBarWidget::setContext(const QList<int> &context)
|
||||
void StatusBarWidget::setContext(const Context &context)
|
||||
{
|
||||
m_context = context;
|
||||
}
|
||||
|
@@ -46,17 +46,17 @@ public:
|
||||
StatusBarWidget(QObject *parent = 0);
|
||||
~StatusBarWidget();
|
||||
|
||||
QList<int> context() const;
|
||||
Context context() const;
|
||||
QWidget *widget();
|
||||
StatusBarWidget::StatusBarPosition position() const;
|
||||
|
||||
QWidget *setWidget(QWidget *widget);
|
||||
void setContext(const QList<int> &context);
|
||||
void setContext(const Context &context);
|
||||
void setPosition(StatusBarWidget::StatusBarPosition position);
|
||||
|
||||
private:
|
||||
QPointer<QWidget> m_widget;
|
||||
QList<int> m_context;
|
||||
Context m_context;
|
||||
StatusBarWidget::StatusBarPosition m_defaultPosition;
|
||||
};
|
||||
|
||||
|
@@ -83,8 +83,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
|
||||
Q_UNUSED(error_message)
|
||||
|
||||
// Create the globalcontext list to register actions accordingly
|
||||
QList<int> globalcontext;
|
||||
globalcontext << UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL);
|
||||
Core::Context globalcontext(UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_GLOBAL));
|
||||
|
||||
// Create the settings Page
|
||||
m_settings->fromSettings(Core::ICore::instance()->settings());
|
||||
|
@@ -1724,7 +1724,7 @@ void CPPEditor::keyPressEvent(QKeyEvent *e)
|
||||
finishRename();
|
||||
}
|
||||
|
||||
QList<int> CPPEditorEditable::context() const
|
||||
Core::Context CPPEditorEditable::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -169,7 +169,7 @@ class CPPEditorEditable : public TextEditor::BaseTextEditorEditable
|
||||
Q_OBJECT
|
||||
public:
|
||||
CPPEditorEditable(CPPEditor *);
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
|
||||
bool duplicateSupported() const { return true; }
|
||||
Core::IEditor *duplicate(QWidget *parent);
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
virtual bool open(const QString & fileName);
|
||||
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
class CPPEditor : public TextEditor::BaseTextEditor
|
||||
|
@@ -123,7 +123,7 @@ QStringList CppEditorFactory::mimeTypes() const
|
||||
static inline
|
||||
Core::Command *createSeparator(Core::ActionManager *am,
|
||||
QObject *parent,
|
||||
const QList<int> &context,
|
||||
Core::Context &context,
|
||||
const char *id)
|
||||
{
|
||||
QAction *separator = new QAction(parent);
|
||||
@@ -231,8 +231,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
||||
wizardParameters.setId(QLatin1String("C.Header"));
|
||||
addAutoReleasedObject(new CppFileWizard(wizardParameters, Header, core));
|
||||
|
||||
QList<int> context;
|
||||
context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR));
|
||||
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
Core::ActionContainer *contextMenu= am->createMenu(CppEditor::Constants::M_CONTEXT);
|
||||
@@ -274,8 +273,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
|
||||
cppToolsMenu->addAction(cmd);
|
||||
|
||||
// Update context in global context
|
||||
QList<int> globalContext;
|
||||
globalContext.append(Core::Constants::C_GLOBAL_ID);
|
||||
Core::Context globalContext(Core::Constants::C_GLOBAL_ID);
|
||||
cppToolsMenu->addAction(createSeparator(am, this, globalContext, CppEditor::Constants::SEPARATOR2));
|
||||
m_updateCodeModelAction = new QAction(tr("Update Code Model"), this);
|
||||
cmd = am->registerAction(m_updateCodeModelAction, QLatin1String(Constants::UPDATE_CODEMODEL), globalContext);
|
||||
|
@@ -132,7 +132,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
|
||||
// Actions
|
||||
m_context = core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||
QList<int> context = QList<int>() << m_context;
|
||||
Core::Context context(m_context);
|
||||
|
||||
QAction *switchAction = new QAction(tr("Switch Header/Source"), this);
|
||||
Core::Command *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context);
|
||||
|
@@ -205,7 +205,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
|
||||
static inline Core::Command *createSeparator(QObject *parent,
|
||||
Core::ActionManager *ami,
|
||||
const char *id,
|
||||
const QList<int> &globalcontext)
|
||||
const Core::Context &globalcontext)
|
||||
{
|
||||
QAction *tmpaction = new QAction(parent);
|
||||
tmpaction->setSeparator(true);
|
||||
@@ -257,8 +257,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
|
||||
toolsContainer->addMenu(cvsMenu);
|
||||
m_menuAction = cvsMenu->menu()->menuAction();
|
||||
|
||||
QList<int> globalcontext;
|
||||
globalcontext << core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL);
|
||||
Core::Context globalcontext(core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL));
|
||||
|
||||
Core::Command *command;
|
||||
|
||||
@@ -380,7 +379,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
|
||||
m_commandLocator->appendCommand(command);
|
||||
|
||||
// Actions of the submit editor
|
||||
QList<int> cvscommitcontext;
|
||||
Core::Context cvscommitcontext;
|
||||
cvscommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::CVSCOMMITEDITOR);
|
||||
|
||||
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||
|
@@ -72,6 +72,7 @@
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/findplaceholder.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/icorelistener.h>
|
||||
#include <coreplugin/manhattanstyle.h>
|
||||
@@ -877,7 +878,7 @@ public:
|
||||
|
||||
QString m_previousMode;
|
||||
TextEditor::BaseTextMark *m_locationMark;
|
||||
int m_gdbRunningContext;
|
||||
Core::Context m_gdbRunningContext;
|
||||
AttachRemoteParameters m_attachRemoteParameters;
|
||||
|
||||
QAction *m_startExternalAction;
|
||||
@@ -968,7 +969,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
|
||||
m_sessionEngine = 0;
|
||||
m_debugMode = 0;
|
||||
m_locationMark = 0;
|
||||
m_gdbRunningContext = 0;
|
||||
m_gdbRunningContext = Core::Context(0);
|
||||
|
||||
m_debugMode = 0;
|
||||
m_uiSwitcher = 0;
|
||||
@@ -987,20 +988,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
QTC_ASSERT(am, return false);
|
||||
|
||||
const QList<int> globalcontext = QList<int>()
|
||||
<< CC::C_GLOBAL_ID;
|
||||
|
||||
const QList<int> cppcontext = QList<int>()
|
||||
<< uidm->uniqueIdentifier(PE::LANG_CXX);
|
||||
|
||||
const QList<int> cppDebuggercontext = QList<int>()
|
||||
<< uidm->uniqueIdentifier(C_CPPDEBUGGER);
|
||||
|
||||
const QList<int> cppeditorcontext = QList<int>()
|
||||
<< uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR);
|
||||
|
||||
const QList<int> texteditorcontext = QList<int>()
|
||||
<< uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
||||
const Core::Context globalcontext(CC::C_GLOBAL_ID);
|
||||
const Core::Context cppDebuggercontext(uidm->uniqueIdentifier(C_CPPDEBUGGER));
|
||||
const Core::Context cppeditorcontext(uidm->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR));
|
||||
|
||||
m_stopIcon = QIcon(_(":/debugger/images/debugger_stop_small.png"));
|
||||
m_stopIcon.addFile(":/debugger/images/debugger_stop.png");
|
||||
@@ -1218,18 +1208,17 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
||||
errorMessage->clear();
|
||||
}
|
||||
|
||||
m_gdbRunningContext = uidm->uniqueIdentifier(Constants::GDBRUNNING);
|
||||
m_gdbRunningContext = Core::Context(uidm->uniqueIdentifier(Constants::GDBRUNNING));
|
||||
|
||||
// Register factory of DebuggerRunControl.
|
||||
m_debuggerRunControlFactory = new DebuggerRunControlFactory
|
||||
(m_plugin, DebuggerEngineType(cmdLineEnabledEngines));
|
||||
m_plugin->addAutoReleasedObject(m_debuggerRunControlFactory);
|
||||
|
||||
QList<int> context;
|
||||
context.append(uidm->uniqueIdentifier(CC::C_EDITORMANAGER));
|
||||
context.append(uidm->uniqueIdentifier(C_DEBUGMODE));
|
||||
context.append(uidm->uniqueIdentifier(CC::C_NAVIGATION_PANE));
|
||||
m_debugMode->setContext(context);
|
||||
m_debugMode->setContext(Core::Context(
|
||||
uidm->uniqueIdentifier(CC::C_EDITORMANAGER),
|
||||
uidm->uniqueIdentifier(C_DEBUGMODE),
|
||||
uidm->uniqueIdentifier(CC::C_NAVIGATION_PANE)));
|
||||
|
||||
m_reverseToolButton = 0;
|
||||
|
||||
@@ -1271,7 +1260,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
|
||||
am->actionContainer(PE::M_DEBUG_STARTDEBUGGING);
|
||||
|
||||
cmd = am->registerAction(m_actions.continueAction,
|
||||
PE::DEBUG, QList<int>() << m_gdbRunningContext);
|
||||
PE::DEBUG, m_gdbRunningContext);
|
||||
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
|
||||
|
||||
cmd = am->registerAction(m_startExternalAction,
|
||||
@@ -2096,9 +2085,9 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
|
||||
const bool startIsContinue = (m_state == InferiorStopped);
|
||||
ICore *core = ICore::instance();
|
||||
if (startIsContinue)
|
||||
core->updateAdditionalContexts(QList<int>(), QList<int>() << m_gdbRunningContext);
|
||||
core->updateAdditionalContexts(Core::Context(), m_gdbRunningContext);
|
||||
else
|
||||
core->updateAdditionalContexts(QList<int>() << m_gdbRunningContext, QList<int>());
|
||||
core->updateAdditionalContexts(m_gdbRunningContext, Core::Context());
|
||||
|
||||
const bool started = m_state == InferiorRunning
|
||||
|| m_state == InferiorRunningRequested
|
||||
|
@@ -87,9 +87,9 @@ struct DebuggerUISwitcherPrivate
|
||||
Internal::DebuggerMainWindow *m_mainWindow;
|
||||
|
||||
// global context
|
||||
QList<int> m_globalContext;
|
||||
Core::Context m_globalContext;
|
||||
|
||||
QHash<int, QList<int> > m_contextsForLanguage;
|
||||
QHash<int, Core::Context> m_contextsForLanguage;
|
||||
|
||||
QActionGroup *m_languageActionGroup;
|
||||
|
||||
@@ -213,9 +213,7 @@ void DebuggerUISwitcher::createViewsMenuItems()
|
||||
{
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
|
||||
QList<int> globalcontext;
|
||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
|
||||
QMenu *mLang = d->m_languageMenu->menu();
|
||||
mLang->setTitle(tr("&Languages"));
|
||||
@@ -237,7 +235,7 @@ DebuggerUISwitcher *DebuggerUISwitcher::instance()
|
||||
return DebuggerUISwitcherPrivate::m_instance;
|
||||
}
|
||||
|
||||
void DebuggerUISwitcher::addLanguage(const QString &langName, const QList<int> &context)
|
||||
void DebuggerUISwitcher::addLanguage(const QString &langName, const Core::Context &context)
|
||||
{
|
||||
//qDebug() << "ADD UI LANGUAGE: " << langName;
|
||||
d->m_toolBars.insert(langName, 0);
|
||||
@@ -310,8 +308,8 @@ void DebuggerUISwitcher::changeDebuggerUI(const QString &langName)
|
||||
QHashIterator<int, Core::Command *> iter(d->m_menuCommands);
|
||||
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
const QList<int> &oldContexts = d->m_contextsForLanguage.value(d->m_activeLanguage);
|
||||
const QList<int> &newContexts = d->m_contextsForLanguage.value(langId);
|
||||
const Core::Context &oldContexts = d->m_contextsForLanguage.value(d->m_activeLanguage);
|
||||
const Core::Context &newContexts = d->m_contextsForLanguage.value(langId);
|
||||
core->updateAdditionalContexts(oldContexts, newContexts);
|
||||
|
||||
d->m_activeLanguage = langId;
|
||||
@@ -401,7 +399,7 @@ QDockWidget *DebuggerUISwitcher::createDockWidget(const QString &langName,
|
||||
if (d->m_languages.indexOf(langName) != d->m_activeLanguage)
|
||||
dockWidget->hide();
|
||||
|
||||
QList<int> langContext = d->m_contextsForLanguage.value(d->m_languages.indexOf(langName));
|
||||
Core::Context langContext = d->m_contextsForLanguage.value(d->m_languages.indexOf(langName));
|
||||
|
||||
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
QAction *action = dockWidget->toggleViewAction();
|
||||
|
@@ -33,13 +33,14 @@
|
||||
#include "debugger_global.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QMultiHash>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QDockWidget);
|
||||
#include <QtCore/QMultiHash>
|
||||
|
||||
namespace Core {
|
||||
class ActionContainer;
|
||||
class Command;
|
||||
class Context;
|
||||
class BaseMode;
|
||||
class IMode;
|
||||
}
|
||||
@@ -68,7 +69,7 @@ public:
|
||||
static DebuggerUISwitcher *instance();
|
||||
|
||||
// debuggable languages are registered with this function.
|
||||
void addLanguage(const QString &langName, const QList<int> &context);
|
||||
void addLanguage(const QString &langName, const Core::Context &context);
|
||||
|
||||
// debugger toolbars are registered with this function
|
||||
void setToolbar(const QString &langName, QWidget *widget);
|
||||
|
@@ -43,7 +43,7 @@ enum { debug = 0 };
|
||||
namespace Designer {
|
||||
namespace Internal {
|
||||
|
||||
DesignerContext::DesignerContext(const QList<int> contexts,
|
||||
DesignerContext::DesignerContext(const Core::Context &contexts,
|
||||
QWidget *widget,
|
||||
QObject *parent) :
|
||||
Core::IContext(parent),
|
||||
@@ -52,7 +52,7 @@ DesignerContext::DesignerContext(const QList<int> contexts,
|
||||
{
|
||||
}
|
||||
|
||||
QList<int> DesignerContext::context() const
|
||||
Core::Context DesignerContext::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -44,16 +44,16 @@ class DesignerContext : public Core::IContext
|
||||
{
|
||||
Q_DISABLE_COPY(DesignerContext)
|
||||
public:
|
||||
explicit DesignerContext(const QList<int> contexts,
|
||||
explicit DesignerContext(const Core::Context &contexts,
|
||||
QWidget *widget,
|
||||
QObject *parent = 0);
|
||||
|
||||
virtual QList<int> context() const;
|
||||
virtual Core::Context context() const;
|
||||
virtual QWidget *widget();
|
||||
virtual QString contextHelpId() const;
|
||||
|
||||
private:
|
||||
const QList<int> m_context;
|
||||
const Core::Context m_context;
|
||||
QWidget *m_widget;
|
||||
};
|
||||
|
||||
|
@@ -119,7 +119,7 @@ static inline QIcon designerIcon(const QString &iconName)
|
||||
// Create a menu separator
|
||||
static inline QAction *createSeparator(QObject *parent,
|
||||
Core::ActionManager *am,
|
||||
const QList<int> &context,
|
||||
const Core::Context &context,
|
||||
Core::ActionContainer *container,
|
||||
const QString &name = QString(),
|
||||
const QString &group = QString())
|
||||
@@ -220,7 +220,7 @@ FormEditorW::~FormEditorW()
|
||||
// Add an actioon to toggle the view state of a dock window
|
||||
void FormEditorW::addDockViewAction(Core::ActionManager *am,
|
||||
Core::ActionContainer *viewMenu,
|
||||
int index, const QList<int> &context,
|
||||
int index, const Core::Context &context,
|
||||
const QString &title, const QString &id)
|
||||
{
|
||||
if (const QDockWidget *dw = m_editorWidget->designerDockWidgets()[index]) {
|
||||
@@ -334,7 +334,9 @@ void FormEditorW::fullInit()
|
||||
Core::UniqueIDManager *idMan = Core::UniqueIDManager::instance();
|
||||
int editorManagerContext = idMan->uniqueIdentifier(QLatin1String(Core::Constants::C_EDITORMANAGER));
|
||||
|
||||
m_context = new DesignerContext(QList<int>() << m_contexts << editorManagerContext, m_modeWidget, this);
|
||||
Core::Context designerContexts = m_contexts;
|
||||
designerContexts.append(Core::Context(editorManagerContext));
|
||||
m_context = new DesignerContext(designerContexts, m_modeWidget, this);
|
||||
m_core->addContextObject(m_context);
|
||||
|
||||
m_designMode->registerDesignWidget(m_modeWidget, QStringList(QLatin1String(FORM_MIMETYPE)), m_contexts);
|
||||
@@ -625,7 +627,7 @@ void FormEditorW::bindShortcut(Core::Command *command, QAction *action)
|
||||
|
||||
// Create an action to activate a designer tool
|
||||
QAction *FormEditorW::createEditModeAction(QActionGroup *ag,
|
||||
const QList<int> &context,
|
||||
const Core::Context &context,
|
||||
Core::ActionManager *am,
|
||||
Core::ActionContainer *medit,
|
||||
const QString &actionName,
|
||||
@@ -651,7 +653,7 @@ QAction *FormEditorW::createEditModeAction(QActionGroup *ag,
|
||||
|
||||
// Create a tool action
|
||||
Core::Command *FormEditorW::addToolAction(QAction *a, Core::ActionManager *am,
|
||||
const QList<int> &context, const QString &name,
|
||||
const Core::Context &context, const QString &name,
|
||||
Core::ActionContainer *c1, const QString &keySequence)
|
||||
{
|
||||
Core::Command *command = am->registerAction(a, name, context);
|
||||
|
@@ -30,11 +30,13 @@
|
||||
#ifndef FORMEDITORW_H
|
||||
#define FORMEDITORW_H
|
||||
|
||||
#include "designerconstants.h"
|
||||
|
||||
#include "coreplugin/icontext.h"
|
||||
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QMap>
|
||||
|
||||
#include "designerconstants.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@@ -136,10 +138,10 @@ private:
|
||||
|
||||
void setupActions();
|
||||
void setupViewActions();
|
||||
inline void addDockViewAction(Core::ActionManager *am,
|
||||
void addDockViewAction(Core::ActionManager *am,
|
||||
Core::ActionContainer *viewMenu,
|
||||
int index,
|
||||
const QList<int> &context,
|
||||
const Core::Context &context,
|
||||
const QString &title, const QString &id);
|
||||
|
||||
Core::ActionContainer *createPreviewStyleMenu(Core::ActionManager *am,
|
||||
@@ -148,7 +150,7 @@ private:
|
||||
void critical(const QString &errorMessage);
|
||||
void bindShortcut(Core::Command *command, QAction *action);
|
||||
QAction *createEditModeAction(QActionGroup *ag,
|
||||
const QList<int> &context,
|
||||
const Core::Context &context,
|
||||
Core::ActionManager *am,
|
||||
Core::ActionContainer *medit,
|
||||
const QString &actionName,
|
||||
@@ -157,7 +159,7 @@ private:
|
||||
const QString &iconName = QString(),
|
||||
const QString &keySequence = QString());
|
||||
Core::Command *addToolAction(QAction *a, Core::ActionManager *am,
|
||||
const QList<int> &context, const QString &name,
|
||||
const Core::Context &context, const QString &name,
|
||||
Core::ActionContainer *c1, const QString &keySequence = QString());
|
||||
QToolBar *createEditorToolBar() const;
|
||||
|
||||
@@ -184,7 +186,7 @@ private:
|
||||
QSignalMapper *m_shortcutMapper;
|
||||
|
||||
DesignerContext *m_context;
|
||||
QList<int> m_contexts;
|
||||
Core::Context m_contexts;
|
||||
|
||||
QStringList m_toolActionIds;
|
||||
QWidget *m_modeWidget;
|
||||
|
@@ -53,13 +53,14 @@
|
||||
|
||||
namespace Designer {
|
||||
|
||||
struct FormWindowEditorPrivate {
|
||||
struct FormWindowEditorPrivate
|
||||
{
|
||||
explicit FormWindowEditorPrivate(Internal::DesignerXmlEditor *editor,
|
||||
QDesignerFormWindowInterface *form);
|
||||
|
||||
TextEditor::PlainTextEditorEditable m_textEditable;
|
||||
Internal::FormWindowFile m_file;
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
FormWindowEditorPrivate::FormWindowEditorPrivate(Internal::DesignerXmlEditor *editor,
|
||||
@@ -221,7 +222,7 @@ bool FormWindowEditor::restoreState(const QByteArray &state)
|
||||
return d->m_textEditable.restoreState(state);
|
||||
}
|
||||
|
||||
QList<int> FormWindowEditor::context() const
|
||||
Core::Context FormWindowEditor::context() const
|
||||
{
|
||||
return d->m_context;
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ public:
|
||||
virtual QString preferredMode() const;
|
||||
|
||||
// IContext
|
||||
virtual QList<int> context() const;
|
||||
virtual Core::Context context() const;
|
||||
virtual QWidget *widget();
|
||||
|
||||
// For uic code model support
|
||||
|
@@ -587,8 +587,7 @@ bool FakeVimPluginPrivate::initialize()
|
||||
Core::ActionManager *actionManager = Core::ICore::instance()->actionManager();
|
||||
QTC_ASSERT(actionManager, return false);
|
||||
|
||||
QList<int> globalcontext;
|
||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
|
||||
m_fakeVimOptionsPage = new FakeVimOptionPage;
|
||||
q->addObject(m_fakeVimOptionsPage);
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
@@ -191,7 +192,7 @@ void FindPlugin::setupMenu()
|
||||
mfind->appendGroup(Constants::G_FIND_FILTERS);
|
||||
mfind->appendGroup(Constants::G_FIND_FLAGS);
|
||||
mfind->appendGroup(Constants::G_FIND_ACTIONS);
|
||||
QList<int> globalcontext = QList<int>() << Core::Constants::C_GLOBAL_ID;
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
Core::Command *cmd;
|
||||
QAction *separator;
|
||||
separator = new QAction(this);
|
||||
@@ -219,7 +220,7 @@ void FindPlugin::setupFilterMenuItems()
|
||||
QList<IFindFilter*> findInterfaces =
|
||||
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
|
||||
Core::Command *cmd;
|
||||
QList<int> globalcontext = QList<int>() << Core::Constants::C_GLOBAL_ID;
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
|
||||
Core::ActionContainer *mfindadvanced = am->actionContainer(Constants::M_FIND_ADVANCED);
|
||||
d->m_filterActions.clear();
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "textfindconstants.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
@@ -130,9 +131,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
|
||||
QMetaTypeId<QStringList>::qt_metatype_id();
|
||||
|
||||
// register actions
|
||||
QList<int> globalcontext;
|
||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
|
||||
Core::Command *cmd;
|
||||
|
@@ -111,7 +111,7 @@ ProjectFilesEditable::ProjectFilesEditable(ProjectFilesEditor *editor)
|
||||
ProjectFilesEditable::~ProjectFilesEditable()
|
||||
{ }
|
||||
|
||||
QList<int> ProjectFilesEditable::context() const
|
||||
Core::Context ProjectFilesEditable::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ public:
|
||||
ProjectFilesEditable(ProjectFilesEditor *editor);
|
||||
virtual ~ProjectFilesEditable();
|
||||
|
||||
virtual QList<int> context() const;
|
||||
virtual Core::Context context() const;
|
||||
virtual QString id() const;
|
||||
|
||||
virtual bool duplicateSupported() const;
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
virtual bool isTemporary() const { return false; }
|
||||
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
class ProjectFilesEditor: public TextEditor::BaseTextEditor
|
||||
|
@@ -174,7 +174,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
|
||||
};
|
||||
|
||||
static Core::Command *createSeparator(Core::ActionManager *am,
|
||||
const QList<int> &context,
|
||||
const Core::Context &context,
|
||||
const QString &id,
|
||||
QObject *parent)
|
||||
{
|
||||
@@ -187,7 +187,7 @@ static Core::Command *createSeparator(Core::ActionManager *am,
|
||||
ParameterActionCommandPair
|
||||
GitPlugin::createParameterAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
const QString &id, const QList<int> &context,
|
||||
const QString &id, const Core::Context &context,
|
||||
bool addToLocator)
|
||||
{
|
||||
Utils::ParameterAction *action = new Utils::ParameterAction(defaultText, parameterText,
|
||||
@@ -205,7 +205,7 @@ ParameterActionCommandPair
|
||||
ParameterActionCommandPair
|
||||
GitPlugin::createFileAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
const QString &id, const QList<int> &context, bool addToLocator,
|
||||
const QString &id, const Core::Context &context, bool addToLocator,
|
||||
const char *pluginSlot)
|
||||
{
|
||||
const ParameterActionCommandPair rc = createParameterAction(am, ac, defaultText, parameterText, id, context, addToLocator);
|
||||
@@ -218,7 +218,7 @@ ParameterActionCommandPair
|
||||
ParameterActionCommandPair
|
||||
GitPlugin::createProjectAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
const QString &id, const QList<int> &context, bool addToLocator,
|
||||
const QString &id, const Core::Context &context, bool addToLocator,
|
||||
const char *pluginSlot)
|
||||
{
|
||||
const ParameterActionCommandPair rc = createParameterAction(am, ac, defaultText, parameterText, id, context, addToLocator);
|
||||
@@ -231,7 +231,7 @@ ParameterActionCommandPair
|
||||
ActionCommandPair
|
||||
GitPlugin::createRepositoryAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &text, const QString &id,
|
||||
const QList<int> &context, bool addToLocator)
|
||||
const Core::Context &context, bool addToLocator)
|
||||
{
|
||||
QAction *action = new QAction(text, this);
|
||||
Core::Command *command = am->registerAction(action, id, context);
|
||||
@@ -246,7 +246,7 @@ ActionCommandPair
|
||||
ActionCommandPair
|
||||
GitPlugin::createRepositoryAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &text, const QString &id,
|
||||
const QList<int> &context, bool addToLocator,
|
||||
const Core::Context &context, bool addToLocator,
|
||||
const char *pluginSlot)
|
||||
{
|
||||
const ActionCommandPair rc = createRepositoryAction(am, ac, text, id, context, addToLocator);
|
||||
@@ -259,7 +259,7 @@ ActionCommandPair
|
||||
ActionCommandPair
|
||||
GitPlugin::createRepositoryAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &text, const QString &id,
|
||||
const QList<int> &context, bool addToLocator,
|
||||
const Core::Context &context, bool addToLocator,
|
||||
GitClientMemberFunc func)
|
||||
{
|
||||
// Set the member func as data and connect to generic slot
|
||||
@@ -282,7 +282,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
m_core = Core::ICore::instance();
|
||||
m_gitClient = new GitClient(this);
|
||||
// Create the globalcontext list to register actions accordingly
|
||||
QList<int> globalcontext;
|
||||
Core::Context globalcontext;
|
||||
globalcontext << m_core->uniqueIDManager()->uniqueIdentifier(Core::Constants::C_GLOBAL);
|
||||
|
||||
// Create the settings Page
|
||||
@@ -493,7 +493,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
}
|
||||
|
||||
// Submit editor
|
||||
QList<int> submitContext;
|
||||
Core::Context submitContext;
|
||||
submitContext.push_back(m_core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::C_GITSUBMITEDITOR)));
|
||||
m_submitCurrentAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||
Core::Command *command = actionManager->registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext);
|
||||
|
@@ -53,6 +53,7 @@ namespace Core {
|
||||
class IEditorFactory;
|
||||
class ICore;
|
||||
class Command;
|
||||
class Context;
|
||||
class ActionManager;
|
||||
class ActionContainer;
|
||||
}
|
||||
@@ -135,36 +136,36 @@ private:
|
||||
inline ParameterActionCommandPair
|
||||
createParameterAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
const QString &id, const QList<int> &context, bool addToLocator);
|
||||
const QString &id, const Core::Context &context, bool addToLocator);
|
||||
|
||||
inline ParameterActionCommandPair
|
||||
createFileAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
const QString &id, const QList<int> &context, bool addToLocator,
|
||||
const QString &id, const Core::Context &context, bool addToLocator,
|
||||
const char *pluginSlot);
|
||||
|
||||
inline ParameterActionCommandPair
|
||||
createProjectAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
const QString &id, const QList<int> &context, bool addToLocator);
|
||||
const QString &id, const Core::Context &context, bool addToLocator);
|
||||
|
||||
inline ParameterActionCommandPair
|
||||
createProjectAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &defaultText, const QString ¶meterText,
|
||||
const QString &id, const QList<int> &context, bool addToLocator,
|
||||
const QString &id, const Core::Context &context, bool addToLocator,
|
||||
const char *pluginSlot);
|
||||
|
||||
|
||||
inline ActionCommandPair createRepositoryAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &text, const QString &id,
|
||||
const QList<int> &context, bool addToLocator);
|
||||
const Core::Context &context, bool addToLocator);
|
||||
inline ActionCommandPair createRepositoryAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &text, const QString &id,
|
||||
const QList<int> &context,
|
||||
const Core::Context &context,
|
||||
bool addToLocator, const char *pluginSlot);
|
||||
inline ActionCommandPair createRepositoryAction(Core::ActionManager *am, Core::ActionContainer *ac,
|
||||
const QString &text, const QString &id,
|
||||
const QList<int> &context,
|
||||
const Core::Context &context,
|
||||
bool addToLocator, GitClientMemberFunc);
|
||||
|
||||
bool isCommitEditorOpen() const;
|
||||
|
@@ -120,10 +120,8 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(error)
|
||||
m_core = Core::ICore::instance();
|
||||
QList<int> globalcontext;
|
||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||
QList<int> modecontext;
|
||||
modecontext << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_MODE_HELP);
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
Core::Context modecontext(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_MODE_HELP));
|
||||
|
||||
const QString &locale = qApp->property("qtc_locale").toString();
|
||||
if (!locale.isEmpty()) {
|
||||
@@ -304,7 +302,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
|
||||
this, SLOT(modeChanged(Core::IMode*)));
|
||||
|
||||
addAutoReleasedObject(m_mode = new HelpMode(m_splitter, m_centralWidget));
|
||||
m_mode->setContext(QList<int>() << modecontext);
|
||||
m_mode->setContext(modecontext);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -343,9 +341,8 @@ void HelpPlugin::aboutToShutdown()
|
||||
void HelpPlugin::setupUi()
|
||||
{
|
||||
// side bar widgets and shortcuts
|
||||
QList<int> modecontext;
|
||||
Core::ActionManager *am = m_core->actionManager();
|
||||
modecontext << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_MODE_HELP);
|
||||
Core::Context modecontext(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_MODE_HELP));
|
||||
|
||||
IndexWindow *indexWindow = new IndexWindow();
|
||||
indexWindow->setWindowTitle(tr(SB_INDEX));
|
||||
@@ -523,12 +520,12 @@ void HelpPlugin::createRightPaneContextViewer()
|
||||
Aggregation::Aggregate *agg = new Aggregation::Aggregate();
|
||||
agg->add(m_helpViewerForSideBar);
|
||||
agg->add(new HelpViewerFindSupport(m_helpViewerForSideBar));
|
||||
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar, QList<int>()
|
||||
<< m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR), this));
|
||||
m_core->addContextObject(new Core::BaseContext(m_helpViewerForSideBar,Core::Context(
|
||||
m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR)), this));
|
||||
|
||||
QAction *copy = new QAction(this);
|
||||
Core::Command *cmd = m_core->actionManager()->registerAction(copy, Core::Constants::COPY,
|
||||
QList<int>() << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR));
|
||||
Core::Context(m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_HELP_SIDEBAR)));
|
||||
copy->setText(cmd->action()->text());
|
||||
copy->setIcon(cmd->action()->icon());
|
||||
|
||||
|
@@ -51,7 +51,7 @@ namespace Internal {
|
||||
|
||||
struct ImageViewerPrivate
|
||||
{
|
||||
QList<int> context;
|
||||
Core::Context context;
|
||||
QString displayName;
|
||||
ImageViewerFile *file;
|
||||
ImageView *imageView;
|
||||
@@ -109,7 +109,7 @@ ImageViewer::~ImageViewer()
|
||||
delete d_ptr->toolbar;
|
||||
}
|
||||
|
||||
QList<int> ImageViewer::context() const
|
||||
Core::Context ImageViewer::context() const
|
||||
{
|
||||
return d_ptr->context;
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ public:
|
||||
explicit ImageViewer(QWidget *parent = 0);
|
||||
~ImageViewer();
|
||||
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
QWidget *widget();
|
||||
|
||||
bool createNew(const QString &contents = QString());
|
||||
|
@@ -57,7 +57,7 @@ struct ImageViewerActionHandlerPrivate
|
||||
QPointer<QAction> actionBackground;
|
||||
QPointer<QAction> actionOutline;
|
||||
|
||||
QList<int> context;
|
||||
Core::Context context;
|
||||
QPointer<QSignalMapper> signalMapper;
|
||||
};
|
||||
|
||||
@@ -126,7 +126,7 @@ void ImageViewerActionHandler::createActions()
|
||||
}
|
||||
|
||||
QAction *ImageViewerActionHandler::registerNewAction(int actionId, const QString &id,
|
||||
const QString &title, const QList<int> &context, const QKeySequence &key)
|
||||
const QString &title, const Core::Context &context, const QKeySequence &key)
|
||||
{
|
||||
Core::ActionManager *actionManager = Core::ICore::instance()->actionManager();
|
||||
Core::Command *command = 0;
|
||||
|
@@ -31,11 +31,15 @@
|
||||
#ifndef IMAGEVIEWERACTIONHANDLER_H
|
||||
#define IMAGEVIEWERACTIONHANDLER_H
|
||||
|
||||
#include <QObject>
|
||||
#include "coreplugin/icontext.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QScopedPointer>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QAction)
|
||||
QT_FORWARD_DECLARE_CLASS(QKeySequence)
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QAction;
|
||||
class QKeySequence;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ImageViewer {
|
||||
namespace Internal {
|
||||
@@ -65,7 +69,7 @@ protected:
|
||||
\return Created and registered action, 0 if something goes wrong
|
||||
*/
|
||||
QAction *registerNewAction(int actionId, const QString &id, const QString &title,
|
||||
const QList<int> &context, const QKeySequence &key);
|
||||
const Core::Context &context, const QKeySequence &key);
|
||||
|
||||
private:
|
||||
QScopedPointer<struct ImageViewerActionHandlerPrivate> d_ptr;
|
||||
|
@@ -106,14 +106,14 @@ bool LocatorPlugin::initialize(const QStringList &, QString *)
|
||||
m_locatorWidget->setEnabled(false);
|
||||
Core::StatusBarWidget *view = new Core::StatusBarWidget;
|
||||
view->setWidget(m_locatorWidget);
|
||||
view->setContext(QList<int>() << core->uniqueIDManager()
|
||||
->uniqueIdentifier(QLatin1String("LocatorWidget")));
|
||||
view->setContext(Core::Context(core->uniqueIDManager()
|
||||
->uniqueIdentifier(QLatin1String("LocatorWidget"))));
|
||||
view->setPosition(Core::StatusBarWidget::First);
|
||||
addAutoReleasedObject(view);
|
||||
|
||||
const QString actionId = QLatin1String("QtCreator.Locate");
|
||||
QAction *action = new QAction(m_locatorWidget->windowIcon(), m_locatorWidget->windowTitle(), this);
|
||||
Core::Command *cmd = core->actionManager()->registerAction(action, actionId, QList<int>() << Core::Constants::C_GLOBAL_ID);
|
||||
Core::Command *cmd = core->actionManager()->registerAction(action, actionId, Core::Context(Core::Constants::C_GLOBAL_ID));
|
||||
cmd->setDefaultKeySequence(QKeySequence("Ctrl+K"));
|
||||
connect(action, SIGNAL(triggered()), this, SLOT(openLocator()));
|
||||
|
||||
|
@@ -207,7 +207,7 @@ QStringList MercurialPlugin::standardArguments() const
|
||||
|
||||
void MercurialPlugin::createMenu()
|
||||
{
|
||||
QList<int> context = QList<int>()<< core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Core::Constants::C_GLOBAL));
|
||||
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Core::Constants::C_GLOBAL)));
|
||||
|
||||
// Create menu item for Mercurial
|
||||
mercurialContainer = actionManager->createMenu(QLatin1String("Mercurial.MercurialMenu"));
|
||||
@@ -230,7 +230,7 @@ void MercurialPlugin::createMenu()
|
||||
m_menuAction = mercurialContainer->menu()->menuAction();
|
||||
}
|
||||
|
||||
void MercurialPlugin::createFileActions(const QList<int> &context)
|
||||
void MercurialPlugin::createFileActions(const Core::Context &context)
|
||||
{
|
||||
Core::Command *command;
|
||||
|
||||
@@ -335,7 +335,7 @@ void MercurialPlugin::statusCurrentFile()
|
||||
m_client->status(state.currentFileTopLevel(), state.relativeCurrentFile());
|
||||
}
|
||||
|
||||
void MercurialPlugin::createDirectoryActions(const QList<int> &context)
|
||||
void MercurialPlugin::createDirectoryActions(const Core::Context &context)
|
||||
{
|
||||
QAction *action;
|
||||
Core::Command *command;
|
||||
@@ -403,7 +403,7 @@ void MercurialPlugin::statusMulti()
|
||||
m_client->status(state.topLevel());
|
||||
}
|
||||
|
||||
void MercurialPlugin::createRepositoryActions(const QList<int> &context)
|
||||
void MercurialPlugin::createRepositoryActions(const Core::Context &context)
|
||||
{
|
||||
QAction *action = new QAction(tr("Pull..."), this);
|
||||
m_repositoryActionList.append(action);
|
||||
@@ -534,7 +534,7 @@ void MercurialPlugin::outgoing()
|
||||
|
||||
void MercurialPlugin::createSubmitEditorActions()
|
||||
{
|
||||
QList<int> context = QList<int>()<< core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::COMMIT_ID));
|
||||
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QLatin1String(Constants::COMMIT_ID)));
|
||||
Core::Command *command;
|
||||
|
||||
editorCommit = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||
@@ -677,7 +677,7 @@ void MercurialPlugin::deleteCommitLog()
|
||||
}
|
||||
}
|
||||
|
||||
void MercurialPlugin::createRepositoryManagementActions(const QList<int> &context)
|
||||
void MercurialPlugin::createRepositoryManagementActions(const Core::Context &context)
|
||||
{
|
||||
//TODO create menu for these options
|
||||
Q_UNUSED(context);
|
||||
@@ -689,14 +689,14 @@ void MercurialPlugin::createRepositoryManagementActions(const QList<int> &contex
|
||||
// mercurialContainer->addAction(command);
|
||||
}
|
||||
|
||||
void MercurialPlugin::createLessUsedActions(const QList<int> &context)
|
||||
void MercurialPlugin::createLessUsedActions(const Core::Context &context)
|
||||
{
|
||||
//TODO create menue for these options
|
||||
Q_UNUSED(context);
|
||||
return;
|
||||
}
|
||||
|
||||
void MercurialPlugin::createSeparator(const QList<int> &context, const QString &id)
|
||||
void MercurialPlugin::createSeparator(const Core::Context &context, const QString &id)
|
||||
{
|
||||
QAction *action = new QAction(this);
|
||||
action->setSeparator(true);
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "mercurialsettings.h"
|
||||
|
||||
#include <vcsbase/vcsbaseplugin.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QHash>
|
||||
@@ -139,12 +140,12 @@ private:
|
||||
//methods
|
||||
void createMenu();
|
||||
void createSubmitEditorActions();
|
||||
void createSeparator(const QList<int> &context, const QString &id);
|
||||
void createFileActions(const QList<int> &context);
|
||||
void createDirectoryActions(const QList<int> &context);
|
||||
void createRepositoryActions(const QList<int> &context);
|
||||
void createRepositoryManagementActions(const QList<int> &context);
|
||||
void createLessUsedActions(const QList<int> &context);
|
||||
void createSeparator(const Core::Context &context, const QString &id);
|
||||
void createFileActions(const Core::Context &context);
|
||||
void createDirectoryActions(const Core::Context &context);
|
||||
void createRepositoryActions(const Core::Context &context);
|
||||
void createRepositoryManagementActions(const Core::Context &context);
|
||||
void createLessUsedActions(const Core::Context &context);
|
||||
void deleteCommitLog();
|
||||
|
||||
//Variables
|
||||
|
@@ -219,7 +219,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
|
||||
static inline Core::Command *createSeparator(QObject *parent,
|
||||
Core::ActionManager *ami,
|
||||
const char *id,
|
||||
const QList<int> &globalcontext)
|
||||
const Core::Context &globalcontext)
|
||||
{
|
||||
QAction *tmpaction = new QAction(parent);
|
||||
tmpaction->setSeparator(true);
|
||||
@@ -267,12 +267,9 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString * e
|
||||
mtools->addMenu(mperforce);
|
||||
m_menuAction = mperforce->menu()->menuAction();
|
||||
|
||||
QList<int> globalcontext;
|
||||
globalcontext << Core::Constants::C_GLOBAL_ID;
|
||||
|
||||
QList<int> perforcesubmitcontext;
|
||||
perforcesubmitcontext << Core::UniqueIDManager::instance()->
|
||||
uniqueIdentifier(Constants::PERFORCESUBMITEDITOR_CONTEXT);
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
Core::Context perforcesubmitcontext(
|
||||
Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::PERFORCESUBMITEDITOR_CONTEXT));
|
||||
|
||||
Core::Command *command;
|
||||
|
||||
|
@@ -82,8 +82,7 @@ OutputPane::OutputPane()
|
||||
|
||||
// Stop
|
||||
Core::ActionManager *am = Core::ICore::instance()->actionManager();
|
||||
QList<int> globalcontext;
|
||||
globalcontext.append(Core::Constants::C_GLOBAL_ID);
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
|
||||
m_stopAction = new QAction(QIcon(Constants::ICON_STOP), tr("Stop"), this);
|
||||
m_stopAction->setToolTip(tr("Stop"));
|
||||
@@ -385,8 +384,7 @@ OutputWindow::OutputWindow(QWidget *parent)
|
||||
|
||||
static uint usedIds = 0;
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
QList<int> context;
|
||||
context << core->uniqueIDManager()->uniqueIdentifier(QString(Constants::C_APP_OUTPUT) + QString().setNum(usedIds++));
|
||||
Core::Context context(core->uniqueIDManager()->uniqueIdentifier(QString(Constants::C_APP_OUTPUT) + QString().setNum(usedIds++)));
|
||||
m_outputWindowContext = new Core::BaseContext(this, context);
|
||||
core->addContextObject(m_outputWindowContext);
|
||||
|
||||
|
@@ -264,11 +264,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
|
||||
d->m_proWindow = new ProjectWindow;
|
||||
|
||||
QList<int> globalcontext;
|
||||
globalcontext.append(Core::Constants::C_GLOBAL_ID);
|
||||
|
||||
QList<int> pecontext;
|
||||
pecontext << core->uniqueIDManager()->uniqueIdentifier(Constants::C_PROJECTEXPLORER);
|
||||
Core::Context globalcontext(Core::Constants::C_GLOBAL_ID);
|
||||
Core::Context pecontext(core->uniqueIDManager()->uniqueIdentifier(Constants::C_PROJECTEXPLORER));
|
||||
|
||||
d->m_projectsMode = new Core::BaseMode;
|
||||
d->m_projectsMode->setDisplayName(tr("Projects"));
|
||||
@@ -276,7 +273,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
||||
d->m_projectsMode->setIcon(QIcon(QLatin1String(":/fancyactionbar/images/mode_Project.png")));
|
||||
d->m_projectsMode->setPriority(Constants::P_MODE_SESSION);
|
||||
d->m_projectsMode->setWidget(d->m_proWindow);
|
||||
d->m_projectsMode->setContext(QList<int>() << pecontext);
|
||||
d->m_projectsMode->setContext(pecontext);
|
||||
d->m_projectsMode->setEnabled(session()->startupProject());
|
||||
d->m_projectsMode->setContextHelpId(QLatin1String("Managing Projects"));
|
||||
addAutoReleasedObject(d->m_projectsMode);
|
||||
@@ -1311,8 +1308,8 @@ void ProjectExplorerPlugin::setCurrent(Project *project, QString filePath, Node
|
||||
|
||||
bool projectChanged = false;
|
||||
if (d->m_currentProject != project) {
|
||||
QList<int> oldContext;
|
||||
QList<int> newContext;
|
||||
Core::Context oldContext;
|
||||
Core::Context newContext;
|
||||
|
||||
if (d->m_currentProject) {
|
||||
oldContext.append(d->m_currentProject->projectManager()->projectContext());
|
||||
|
@@ -94,11 +94,11 @@ class TaskWindowContext : public Core::IContext
|
||||
{
|
||||
public:
|
||||
TaskWindowContext(QWidget *widget);
|
||||
virtual QList<int> context() const;
|
||||
virtual Core::Context context() const;
|
||||
virtual QWidget *widget();
|
||||
private:
|
||||
QWidget *m_taskList;
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
class TaskModel : public QAbstractItemModel
|
||||
@@ -1006,7 +1006,7 @@ TaskWindowContext::TaskWindowContext(QWidget *widget)
|
||||
m_context << uidm->uniqueIdentifier(Core::Constants::C_PROBLEM_PANE);
|
||||
}
|
||||
|
||||
QList<int> TaskWindowContext::context() const
|
||||
Core::Context TaskWindowContext::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ DesignModeContext::~DesignModeContext()
|
||||
|
||||
}
|
||||
|
||||
QList<int> DesignModeContext::context() const
|
||||
Core::Context DesignModeContext::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -51,13 +51,13 @@ public:
|
||||
DesignModeContext(DesignModeWidget *widget);
|
||||
~DesignModeContext();
|
||||
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
QWidget *widget();
|
||||
|
||||
QString contextHelpId() const;
|
||||
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
DesignModeWidget *m_widget;
|
||||
};
|
||||
|
||||
|
@@ -120,10 +120,7 @@ bool BauhausPlugin::initialize(const QStringList & /*arguments*/, QString *error
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
|
||||
const int uid = core->uniqueIDManager()->uniqueIdentifier(QLatin1String(QmlDesigner::Constants::C_FORMEDITOR));
|
||||
const QList<int> context = QList<int>() << uid;
|
||||
|
||||
const QList<int> switchContext = QList<int>() << uid
|
||||
<< core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID);
|
||||
const Core::Context switchContext(core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID));
|
||||
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
|
||||
@@ -167,7 +164,7 @@ void BauhausPlugin::createDesignModeWidget()
|
||||
m_context = new DesignModeContext(m_mainWidget);
|
||||
creatorCore->addContextObject(m_context);
|
||||
Core::UniqueIDManager *uuidManager = Core::UniqueIDManager::instance();
|
||||
QList<int> formEditorContext = QList<int> () << uuidManager->uniqueIdentifier(Constants::C_FORMEDITOR);
|
||||
Core::Context formEditorContext(uuidManager->uniqueIdentifier(Constants::C_FORMEDITOR));
|
||||
|
||||
// Revert to saved
|
||||
actionManager->registerAction(m_revertToSavedAction,
|
||||
@@ -263,8 +260,8 @@ void BauhausPlugin::createDesignModeWidget()
|
||||
connect(m_editorManager, SIGNAL(editorsClosed(QList<Core::IEditor*>)),
|
||||
this, SLOT(textEditorsClosed(QList<Core::IEditor*>)));
|
||||
|
||||
connect(creatorCore, SIGNAL(contextChanged(Core::IContext*,QList<int>)),
|
||||
this, SLOT(contextChanged(Core::IContext*,QList<int>)));
|
||||
connect(creatorCore, SIGNAL(contextChanged(Core::IContext*,Core::Context)),
|
||||
this, SLOT(contextChanged(Core::IContext*,Core::Context)));
|
||||
|
||||
}
|
||||
|
||||
@@ -278,7 +275,7 @@ void BauhausPlugin::updateEditor(Core::IEditor *editor)
|
||||
}
|
||||
}
|
||||
|
||||
void BauhausPlugin::contextChanged(Core::IContext *context, const QList<int> &additionalContexts)
|
||||
void BauhausPlugin::contextChanged(Core::IContext *context, const Core::Context &additionalContexts)
|
||||
{
|
||||
Q_UNUSED(context)
|
||||
|
||||
|
@@ -42,6 +42,7 @@ class QAction;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
class Context;
|
||||
class IContext;
|
||||
class IWizard;
|
||||
class ICore;
|
||||
@@ -85,7 +86,7 @@ private slots:
|
||||
void textEditorsClosed(QList<Core::IEditor *> editors);
|
||||
void updateActions(Core::IEditor* editor);
|
||||
void updateEditor(Core::IEditor *editor);
|
||||
void contextChanged(Core::IContext *context, const QList<int> &additionalContexts);
|
||||
void contextChanged(Core::IContext *context, const Core::Context &additionalContexts);
|
||||
|
||||
private:
|
||||
void createDesignModeWidget();
|
||||
|
@@ -54,7 +54,7 @@ InspectorContext::~InspectorContext()
|
||||
|
||||
}
|
||||
|
||||
QList<int> InspectorContext::context() const
|
||||
Core::Context InspectorContext::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ public:
|
||||
InspectorContext(QWidget *widget);
|
||||
~InspectorContext();
|
||||
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
QWidget *widget();
|
||||
|
||||
QString contextHelpId() const;
|
||||
@@ -67,7 +67,7 @@ public slots:
|
||||
void setContextHelpId(const QString &helpId);
|
||||
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
QWidget *m_widget;
|
||||
QString m_contextHelpId;
|
||||
|
||||
|
@@ -462,7 +462,7 @@ void QmlInspector::createDockWidgets()
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
Core::ActionContainer *mstart = am->actionContainer(ProjectExplorer::Constants::M_DEBUG_STARTDEBUGGING);
|
||||
Core::Command *cmd = am->registerAction(m_simultaneousDebugAction, Constants::M_DEBUG_SIMULTANEOUSLY,
|
||||
QList<int>() << m_context->context());
|
||||
m_context->context());
|
||||
cmd->setAttribute(Core::Command::CA_Hide);
|
||||
mstart->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
|
||||
|
||||
|
@@ -101,7 +101,7 @@ bool QmlInspectorPlugin::initialize(const QStringList &arguments, QString *error
|
||||
Debugger::DebuggerUISwitcher *uiSwitcher = pluginManager->getObject<Debugger::DebuggerUISwitcher>();
|
||||
|
||||
uiSwitcher->addLanguage(Qml::Constants::LANG_QML,
|
||||
QList<int>() << core->uniqueIDManager()->uniqueIdentifier(Constants::C_INSPECTOR));
|
||||
Core::Context(core->uniqueIDManager()->uniqueIdentifier(Constants::C_INSPECTOR)));
|
||||
m_inspector = new QmlInspector;
|
||||
m_inspector->createDockWidgets();
|
||||
addObject(m_inspector);
|
||||
|
@@ -713,7 +713,7 @@ bool QmlJSEditorEditable::open(const QString &fileName)
|
||||
return b;
|
||||
}
|
||||
|
||||
QmlJSTextEditor::Context QmlJSEditorEditable::context() const
|
||||
Core::Context QmlJSEditorEditable::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ class QmlJSEditorEditable : public TextEditor::BaseTextEditorEditable
|
||||
|
||||
public:
|
||||
QmlJSEditorEditable(QmlJSTextEditor *);
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
|
||||
bool duplicateSupported() const { return true; }
|
||||
Core::IEditor *duplicate(QWidget *parent);
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
virtual QString preferredMode() const;
|
||||
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
struct Declaration
|
||||
@@ -204,8 +204,6 @@ class QmlJSTextEditor : public TextEditor::BaseTextEditor
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef QList<int> Context;
|
||||
|
||||
QmlJSTextEditor(QWidget *parent = 0);
|
||||
~QmlJSTextEditor();
|
||||
|
||||
@@ -262,7 +260,7 @@ private:
|
||||
|
||||
SemanticHighlighter::Source currentSource(bool force = false);
|
||||
|
||||
const Context m_context;
|
||||
const Core::Context m_context;
|
||||
|
||||
QTimer *m_updateDocumentTimer;
|
||||
QTimer *m_updateUsesTimer;
|
||||
|
@@ -110,7 +110,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
m_modelManager = new ModelManager(this);
|
||||
addAutoReleasedObject(m_modelManager);
|
||||
|
||||
QList<int> context;
|
||||
Core::Context context;
|
||||
context << core->uniqueIDManager()->uniqueIdentifier(QmlJSEditor::Constants::C_QMLJSEDITOR_ID)
|
||||
<< core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
||||
|
||||
@@ -140,8 +140,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
|
||||
mtools->addMenu(menuQtQuick);
|
||||
m_actionPreview = new QAction("&Preview", this);
|
||||
|
||||
QList<int> toolsMenuContext = QList<int>()
|
||||
<< core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU);
|
||||
Core::Context toolsMenuContext(core->uniqueIDManager()->uniqueIdentifier(QmlDesigner::Constants::C_QT_QUICK_TOOLS_MENU));
|
||||
Core::Command *cmd = addToolAction(m_actionPreview, am, toolsMenuContext,
|
||||
QLatin1String("QtQuick.Preview"), menuQtQuick, tr("Ctrl+Alt+R"));
|
||||
connect(cmd->action(), SIGNAL(triggered()), SLOT(openPreview()));
|
||||
@@ -220,7 +219,7 @@ void QmlJSEditorPlugin::followSymbolUnderCursor()
|
||||
}
|
||||
|
||||
Core::Command *QmlJSEditorPlugin::addToolAction(QAction *a, Core::ActionManager *am,
|
||||
const QList<int> &context, const QString &name,
|
||||
Core::Context &context, const QString &name,
|
||||
Core::ActionContainer *c1, const QString &keySequence)
|
||||
{
|
||||
Core::Command *command = am->registerAction(a, name, context);
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#define QMLJSEDITORPLUGIN_H
|
||||
|
||||
#include <extensionsystem/iplugin.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QAction)
|
||||
@@ -93,7 +94,7 @@ private Q_SLOTS:
|
||||
void quickFixNow();
|
||||
|
||||
private:
|
||||
Core::Command *addToolAction(QAction *a, Core::ActionManager *am, const QList<int> &context, const QString &name,
|
||||
Core::Command *addToolAction(QAction *a, Core::ActionManager *am, Core::Context &context, const QString &name,
|
||||
Core::ActionContainer *c1, const QString &keySequence);
|
||||
|
||||
static QmlJSEditorPlugin *m_instance;
|
||||
|
@@ -62,7 +62,7 @@ ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor)
|
||||
// m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
|
||||
}
|
||||
|
||||
QList<int> ProFileEditorEditable::context() const
|
||||
Core::Context ProFileEditorEditable::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -55,14 +55,14 @@ class ProFileEditorEditable : public TextEditor::BaseTextEditorEditable
|
||||
{
|
||||
public:
|
||||
ProFileEditorEditable(ProFileEditor *);
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
|
||||
bool duplicateSupported() const { return true; }
|
||||
Core::IEditor *duplicate(QWidget *parent);
|
||||
QString id() const;
|
||||
bool isTemporary() const { return false; }
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
class ProFileEditor : public TextEditor::BaseTextEditor
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/modemanager.h>
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -84,7 +85,7 @@ QemuRuntimeManager::QemuRuntimeManager(QObject *parent)
|
||||
Core::ICore *core = Core::ICore::instance();
|
||||
Core::ActionManager *actionManager = core->actionManager();
|
||||
Core::Command *qemuCommand = actionManager->registerAction(m_qemuAction,
|
||||
"MaemoEmulator", QList<int>() << Core::Constants::C_GLOBAL_ID);
|
||||
"MaemoEmulator", Core::Context(Core::Constants::C_GLOBAL_ID));
|
||||
qemuCommand->setAttribute(Core::Command::CA_UpdateText);
|
||||
qemuCommand->setAttribute(Core::Command::CA_UpdateIcon);
|
||||
|
||||
|
@@ -175,7 +175,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
//register actions
|
||||
m_projectContext = core->uniqueIDManager()->
|
||||
uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_ID);
|
||||
QList<int> context = QList<int>() << m_projectContext;
|
||||
Core::Context context(m_projectContext);
|
||||
Core::Command *command;
|
||||
|
||||
QIcon qmakeIcon(QLatin1String(":/qt4projectmanager/images/run_qmake.png"));
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#define RRESOURCEEDITORFACTORY_H
|
||||
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
@@ -44,8 +45,6 @@ class ResourceEditorFactory : public Core::IEditorFactory
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef QList<int> Context;
|
||||
|
||||
explicit ResourceEditorFactory(ResourceEditorPlugin *plugin);
|
||||
|
||||
virtual QStringList mimeTypes() const;
|
||||
@@ -58,7 +57,7 @@ public:
|
||||
|
||||
private:
|
||||
const QStringList m_mimeTypes;
|
||||
Context m_context;
|
||||
Core::Context m_context;
|
||||
|
||||
ResourceEditorPlugin *m_plugin;
|
||||
};
|
||||
|
@@ -90,7 +90,7 @@ bool ResourceEditorPlugin::initialize(const QStringList &arguments, QString *err
|
||||
Core::ActionManager * const actionManager = core->actionManager();
|
||||
int const contextId = core->uniqueIDManager()->uniqueIdentifier(
|
||||
Constants::C_RESOURCEEDITOR);
|
||||
const QList<int> context = QList<int>() << contextId;
|
||||
const Core::Context context(contextId);
|
||||
m_undoAction = new QAction(tr("&Undo"), this);
|
||||
m_redoAction = new QAction(tr("&Redo"), this);
|
||||
actionManager->registerAction(m_undoAction, Core::Constants::UNDO, context);
|
||||
|
@@ -66,7 +66,7 @@ QString ResourceEditorFile::mimeType() const
|
||||
}
|
||||
|
||||
|
||||
ResourceEditorW::ResourceEditorW(const QList<int> &context,
|
||||
ResourceEditorW::ResourceEditorW(const Core::Context &context,
|
||||
ResourceEditorPlugin *plugin,
|
||||
QWidget *parent)
|
||||
: m_context(context),
|
||||
|
@@ -51,8 +51,6 @@ class ResourceEditorFile
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef QList<int> Context;
|
||||
|
||||
ResourceEditorFile(ResourceEditorW *parent = 0);
|
||||
|
||||
//IFile
|
||||
@@ -78,9 +76,7 @@ class ResourceEditorW : public Core::IEditor
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
typedef QList<int> Context;
|
||||
|
||||
ResourceEditorW(const Context &context,
|
||||
ResourceEditorW(const Core::Context &context,
|
||||
ResourceEditorPlugin *plugin,
|
||||
QWidget *parent = 0);
|
||||
~ResourceEditorW();
|
||||
@@ -99,7 +95,7 @@ public:
|
||||
bool restoreState(const QByteArray &/*state*/) { return true; }
|
||||
|
||||
// ContextInterface
|
||||
Context context() const { return m_context; }
|
||||
Core::Context context() const { return m_context; }
|
||||
QWidget *widget();
|
||||
|
||||
void setSuggestedFileName(const QString &fileName);
|
||||
@@ -114,7 +110,7 @@ private:
|
||||
const QString m_fileFilter;
|
||||
QString m_displayName;
|
||||
QString m_suggestedName;
|
||||
const Context m_context;
|
||||
const Core::Context m_context;
|
||||
QPointer<SharedTools::QrcEditor> m_resourceEditor;
|
||||
ResourceEditorFile *m_resourceFile;
|
||||
ResourceEditorPlugin *m_plugin;
|
||||
|
@@ -252,7 +252,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
|
||||
static inline Core::Command *createSeparator(QObject *parent,
|
||||
Core::ActionManager *ami,
|
||||
const char*id,
|
||||
const QList<int> &globalcontext)
|
||||
const Core::Context &globalcontext)
|
||||
{
|
||||
QAction *tmpaction = new QAction(parent);
|
||||
tmpaction->setSeparator(true);
|
||||
@@ -304,8 +304,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
||||
subversionMenu->menu()->setTitle(tr("&Subversion"));
|
||||
toolsContainer->addMenu(subversionMenu);
|
||||
m_menuAction = subversionMenu->menu()->menuAction();
|
||||
QList<int> globalcontext;
|
||||
globalcontext << core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL);
|
||||
Core::Context globalcontext(core->uniqueIDManager()->uniqueIdentifier(C_GLOBAL));
|
||||
|
||||
Core::Command *command;
|
||||
|
||||
@@ -457,7 +456,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
|
||||
m_commandLocator->appendCommand(command);
|
||||
|
||||
// Actions of the submit editor
|
||||
QList<int> svncommitcontext;
|
||||
Core::Context svncommitcontext;
|
||||
svncommitcontext << Core::UniqueIDManager::instance()->uniqueIdentifier(Constants::SUBVERSIONCOMMITEDITOR);
|
||||
|
||||
m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this);
|
||||
|
@@ -83,7 +83,7 @@ PlainTextEditor::PlainTextEditor(QWidget *parent)
|
||||
PlainTextEditor::~PlainTextEditor()
|
||||
{}
|
||||
|
||||
QList<int> PlainTextEditorEditable::context() const
|
||||
Core::Context PlainTextEditorEditable::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ class TEXTEDITOR_EXPORT PlainTextEditorEditable : public BaseTextEditorEditable
|
||||
Q_OBJECT
|
||||
public:
|
||||
PlainTextEditorEditable(PlainTextEditor *);
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
|
||||
bool duplicateSupported() const { return true; }
|
||||
Core::IEditor *duplicate(QWidget *parent);
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
virtual QString id() const;
|
||||
|
||||
private:
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
};
|
||||
|
||||
class TEXTEDITOR_EXPORT PlainTextEditor : public BaseTextEditor
|
||||
|
@@ -178,7 +178,7 @@ private:
|
||||
|
||||
uint m_optionalActions;
|
||||
QPointer<BaseTextEditor> m_currentEditor;
|
||||
QList<int> m_contextId;
|
||||
Core::Context m_contextId;
|
||||
bool m_initialized;
|
||||
};
|
||||
|
||||
|
@@ -117,7 +117,7 @@ bool TextEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
addAutoReleasedObject(m_lineNumberFilter);
|
||||
|
||||
int contextId = core->uniqueIDManager()->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
|
||||
QList<int> context = QList<int>() << contextId;
|
||||
Core::Context context(contextId);
|
||||
Core::ActionManager *am = core->actionManager();
|
||||
|
||||
// Add shortcut for invoking automatic completion
|
||||
|
@@ -76,7 +76,7 @@ class VCSBaseEditorEditable : public TextEditor::BaseTextEditorEditable
|
||||
public:
|
||||
VCSBaseEditorEditable(VCSBaseEditor *,
|
||||
const VCSBaseEditorParameters *type);
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
|
||||
bool duplicateSupported() const { return false; }
|
||||
Core::IEditor *duplicate(QWidget * /*parent*/) { return 0; }
|
||||
@@ -91,7 +91,7 @@ signals:
|
||||
|
||||
private:
|
||||
QString m_id;
|
||||
QList<int> m_context;
|
||||
Core::Context m_context;
|
||||
bool m_temporary;
|
||||
};
|
||||
|
||||
@@ -106,7 +106,7 @@ VCSBaseEditorEditable::VCSBaseEditorEditable(VCSBaseEditor *editor,
|
||||
<< uidm->uniqueIdentifier(QLatin1String(TextEditor::Constants::C_TEXTEDITOR));
|
||||
}
|
||||
|
||||
QList<int> VCSBaseEditorEditable::context() const
|
||||
Core::Context VCSBaseEditorEditable::context() const
|
||||
{
|
||||
return m_context;
|
||||
}
|
||||
|
@@ -93,7 +93,7 @@ struct VCSBaseSubmitEditorPrivate
|
||||
QString m_displayName;
|
||||
QString m_checkScriptWorkingDirectory;
|
||||
VCSBase::Internal::SubmitEditorFile *m_file;
|
||||
QList<int> m_contexts;
|
||||
Core::Context m_contexts;
|
||||
|
||||
QPointer<QAction> m_diffAction;
|
||||
QPointer<QAction> m_submitAction;
|
||||
@@ -377,7 +377,7 @@ QWidget *VCSBaseSubmitEditor::toolBar()
|
||||
return m_d->m_toolWidget;
|
||||
}
|
||||
|
||||
QList<int> VCSBaseSubmitEditor::context() const
|
||||
Core::Context VCSBaseSubmitEditor::context() const
|
||||
{
|
||||
return m_d->m_contexts;
|
||||
}
|
||||
|
@@ -145,7 +145,7 @@ public:
|
||||
virtual QString id() const;
|
||||
|
||||
virtual QWidget *toolBar();
|
||||
virtual QList<int> context() const;
|
||||
virtual Core::Context context() const;
|
||||
virtual QWidget *widget();
|
||||
|
||||
virtual QByteArray saveState() const;
|
||||
|
@@ -148,10 +148,10 @@ QString WelcomeMode::id() const
|
||||
return QLatin1String(Core::Constants::MODE_WELCOME);
|
||||
}
|
||||
|
||||
QList<int> WelcomeMode::context() const
|
||||
Core::Context WelcomeMode::context() const
|
||||
{
|
||||
static QList<int> contexts = QList<int>()
|
||||
<< Core::UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_WELCOME_MODE);
|
||||
static Core::Context contexts =
|
||||
Core::Context(Core::UniqueIDManager::instance()->uniqueIdentifier(Core::Constants::C_WELCOME_MODE));
|
||||
return contexts;
|
||||
}
|
||||
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
int priority() const;
|
||||
QWidget *widget();
|
||||
QString id() const;
|
||||
QList<int> context() const;
|
||||
Core::Context context() const;
|
||||
void activated();
|
||||
QString contextHelpId() const { return QLatin1String("Qt Creator Manual"); }
|
||||
void initPlugins();
|
||||
|
Reference in New Issue
Block a user