Fixes: - ICommand --> Command

Details:  - Naming convention
This commit is contained in:
con
2009-01-14 13:17:53 +01:00
parent d9f97aa179
commit fbfcc9a484
45 changed files with 190 additions and 191 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
//Toggle //Toggle
m_toggleAction = new QAction(tr("Toggle Bookmark"), this); m_toggleAction = new QAction(tr("Toggle Bookmark"), this);
Core::ICommand *cmd = Core::Command *cmd =
am->registerAction(m_toggleAction, BOOKMARKS_TOGGLE_ACTION, textcontext); am->registerAction(m_toggleAction, BOOKMARKS_TOGGLE_ACTION, textcontext);
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+M"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+M")));
@@ -100,7 +100,7 @@ using namespace Core::Internal;
*/ */
/*! /*!
\fn virtual void ActionContainer::addAction(Core::ICommand *action, const QString &group) \fn virtual void ActionContainer::addAction(Core::Command *action, const QString &group)
*/ */
/*! /*!
@@ -164,7 +164,7 @@ QAction *ActionContainerPrivate::insertLocation(const QString &group) const
return beforeAction(pos, &prevKey); return beforeAction(pos, &prevKey);
} }
void ActionContainerPrivate::addAction(ICommand *action, const QString &group) void ActionContainerPrivate::addAction(Command *action, const QString &group)
{ {
if (!canAddAction(action)) if (!canAddAction(action))
return; return;
@@ -234,9 +234,9 @@ QMenuBar *ActionContainerPrivate::menuBar() const
return 0; return 0;
} }
bool ActionContainerPrivate::canAddAction(ICommand *action) const bool ActionContainerPrivate::canAddAction(Command *action) const
{ {
if (action->type() != ICommand::CT_OverridableAction) if (action->type() != Command::CT_OverridableAction)
return false; return false;
CommandPrivate *cmd = static_cast<CommandPrivate *>(action); CommandPrivate *cmd = static_cast<CommandPrivate *>(action);
@@ -246,7 +246,7 @@ bool ActionContainerPrivate::canAddAction(ICommand *action) const
return true; return true;
} }
void ActionContainerPrivate::addAction(ICommand *action, int pos, bool setpos) void ActionContainerPrivate::addAction(Command *action, int pos, bool setpos)
{ {
Action *a = static_cast<Action *>(action); Action *a = static_cast<Action *>(action);
@@ -309,7 +309,7 @@ QAction *ActionContainerPrivate::beforeAction(int pos, int *prevKey) const
if (baId == -1) if (baId == -1)
return 0; return 0;
if (ICommand *cmd = am->command(baId)) if (Command *cmd = am->command(baId))
return cmd->action(); return cmd->action();
if (ActionContainer *container = am->actionContainer(baId)) if (ActionContainer *container = am->actionContainer(baId))
if (QMenu *menu = container->menu()) if (QMenu *menu = container->menu())
@@ -398,7 +398,7 @@ bool MenuActionContainer::update()
} }
} }
if (!hasitems) { if (!hasitems) {
foreach (ICommand *command, commands()) { foreach (Command *command, commands()) {
if (command->isActive()) { if (command->isActive()) {
hasitems = true; hasitems = true;
break; break;
@@ -42,7 +42,7 @@
namespace Core { namespace Core {
class ICommand; class Command;
class ActionContainer : public QObject class ActionContainer : public QObject
{ {
@@ -63,7 +63,7 @@ public:
virtual QAction *insertLocation(const QString &group) const = 0; virtual QAction *insertLocation(const QString &group) const = 0;
virtual void appendGroup(const QString &group) = 0; virtual void appendGroup(const QString &group) = 0;
virtual void addAction(Core::ICommand *action, const QString &group = QString()) = 0; virtual void addAction(Core::Command *action, const QString &group = QString()) = 0;
virtual void addMenu(Core::ActionContainer *menu, const QString &group = QString()) = 0; virtual void addMenu(Core::ActionContainer *menu, const QString &group = QString()) = 0;
virtual bool update() = 0; virtual bool update() = 0;
@@ -37,7 +37,7 @@
#include "actionmanager_p.h" #include "actionmanager_p.h"
#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
namespace Core { namespace Core {
namespace Internal { namespace Internal {
@@ -63,7 +63,7 @@ public:
QAction *insertLocation(const QString &group) const; QAction *insertLocation(const QString &group) const;
void appendGroup(const QString &group); void appendGroup(const QString &group);
void addAction(ICommand *action, const QString &group = QString()); void addAction(Command *action, const QString &group = QString());
void addMenu(ActionContainer *menu, const QString &group = QString()); void addMenu(ActionContainer *menu, const QString &group = QString());
int id() const; int id() const;
@@ -74,14 +74,14 @@ public:
virtual void insertAction(QAction *before, QAction *action) = 0; virtual void insertAction(QAction *before, QAction *action) = 0;
virtual void insertMenu(QAction *before, QMenu *menu) = 0; virtual void insertMenu(QAction *before, QMenu *menu) = 0;
QList<ICommand *> commands() const { return m_commands; } QList<Command *> commands() const { return m_commands; }
QList<ActionContainer *> subContainers() const { return m_subContainers; } QList<ActionContainer *> subContainers() const { return m_subContainers; }
protected: protected:
bool canAddAction(ICommand *action) const; bool canAddAction(Command *action) const;
bool canAddMenu(ActionContainer *menu) const; bool canAddMenu(ActionContainer *menu) const;
virtual bool canBeAddedToMenu() const = 0; virtual bool canBeAddedToMenu() const = 0;
void addAction(ICommand *action, int pos, bool setpos); void addAction(Command *action, int pos, bool setpos);
void addMenu(ActionContainer *menu, int pos, bool setpos); void addMenu(ActionContainer *menu, int pos, bool setpos);
private: private:
@@ -93,7 +93,7 @@ private:
int m_id; int m_id;
QMap<int, int> m_posmap; QMap<int, int> m_posmap;
QList<ActionContainer *> m_subContainers; QList<ActionContainer *> m_subContainers;
QList<ICommand *> m_commands; QList<Command *> m_commands;
}; };
class MenuActionContainer : public ActionContainerPrivate class MenuActionContainer : public ActionContainerPrivate
@@ -70,10 +70,10 @@ namespace {
All actions that are registered with the same string id (but different context lists) All actions that are registered with the same string id (but different context lists)
are considered to be overloads of the same command, represented by an instance are considered to be overloads of the same command, represented by an instance
of the ICommand class. of the Command class.
The action that is visible to the user is the one returned by ICommand::action(). The action that is visible to the user is the one returned by Command::action().
If you provide yourself a user visible representation of your action you need If you provide yourself a user visible representation of your action you need
to use ICommand::action() for this. to use Command::action() for this.
When this action is invoked by the user, When this action is invoked by the user,
the signal is forwarded to the registered action that is valid for the current context. the signal is forwarded to the registered action that is valid for the current context.
@@ -83,7 +83,7 @@ namespace {
Core::ActionManager *am = ExtensionSystem::PluginManager::instance() Core::ActionManager *am = ExtensionSystem::PluginManager::instance()
->getObject<Core::ICore>()->actionManager(); ->getObject<Core::ICore>()->actionManager();
QAction *myAction = new QAction(tr("My Action"), this); QAction *myAction = new QAction(tr("My Action"), this);
Core::ICommand *cmd = am->registerAction(myAction, Core::Command *cmd = am->registerAction(myAction,
"myplugin.myaction", "myplugin.myaction",
QList<int>() << C_GLOBAL_ID); QList<int>() << C_GLOBAL_ID);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u")));
@@ -92,7 +92,7 @@ namespace {
So the \c connect is done to your own QAction instance. If you create e.g. So the \c connect is done to your own QAction instance. If you create e.g.
a tool button that should represent the action you add the action a tool button that should represent the action you add the action
from ICommand::action() to it: from Command::action() to it:
\code \code
QToolButton *myButton = new QToolButton(someParentWidget); QToolButton *myButton = new QToolButton(someParentWidget);
myButton->setDefaultAction(cmd->action()); myButton->setDefaultAction(cmd->action());
@@ -123,7 +123,7 @@ namespace {
\endlist \endlist
\sa Core::ICore \sa Core::ICore
\sa Core::ICommand \sa Core::Command
\sa Core::ActionContainer \sa Core::ActionContainer
\sa Core::IContext \sa Core::IContext
*/ */
@@ -149,7 +149,7 @@ namespace {
*/ */
/*! /*!
\fn ICommand *ActionManager::registerAction(QAction *action, const QString &id, const QList<int> &context) \fn Command *ActionManager::registerAction(QAction *action, const QString &id, const QList<int> &context)
\brief Makes an \a action known to the system under the specified string \a id. \brief Makes an \a action known to the system under the specified string \a id.
Returns a command object that represents the action in the application and is Returns a command object that represents the action in the application and is
@@ -160,7 +160,7 @@ namespace {
*/ */
/*! /*!
\fn ICommand *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context) \fn Command *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
\brief Makes a \a shortcut known to the system under the specified string \a id. \brief Makes a \a shortcut known to the system under the specified string \a id.
Returns a command object that represents the shortcut in the application and is Returns a command object that represents the shortcut in the application and is
@@ -171,8 +171,8 @@ namespace {
*/ */
/*! /*!
\fn ICommand *ActionManager::command(const QString &id) const \fn Command *ActionManager::command(const QString &id) const
\brief Returns the ICommand object that is known to the system \brief Returns the Command object that is known to the system
under the given string \a id. under the given string \a id.
\sa ActionManager::registerAction() \sa ActionManager::registerAction()
@@ -308,22 +308,22 @@ ActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
return mbc; return mbc;
} }
ICommand *ActionManagerPrivate::registerAction(QAction *action, const QString &id, const QList<int> &context) Command *ActionManagerPrivate::registerAction(QAction *action, const QString &id, const QList<int> &context)
{ {
OverrideableAction *a = 0; OverrideableAction *a = 0;
ICommand *c = registerOverridableAction(action, id, false); Command *c = registerOverridableAction(action, id, false);
a = static_cast<OverrideableAction *>(c); a = static_cast<OverrideableAction *>(c);
if (a) if (a)
a->addOverrideAction(action, context); a->addOverrideAction(action, context);
return a; return a;
} }
ICommand *ActionManagerPrivate::registerOverridableAction(QAction *action, const QString &id, bool checkUnique) Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const QString &id, bool checkUnique)
{ {
OverrideableAction *a = 0; OverrideableAction *a = 0;
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) { if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
if (c->type() != ICommand::CT_OverridableAction) { if (c->type() != Command::CT_OverridableAction) {
qWarning() << "registerAction: id" << id << "is registered with a different command type."; qWarning() << "registerAction: id" << id << "is registered with a different command type.";
return c; return c;
} }
@@ -364,12 +364,12 @@ ICommand *ActionManagerPrivate::registerOverridableAction(QAction *action, const
return a; return a;
} }
ICommand *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context) Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
{ {
Shortcut *sc = 0; Shortcut *sc = 0;
int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) { if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
if (c->type() != ICommand::CT_Shortcut) { if (c->type() != Command::CT_Shortcut) {
qWarning() << "registerShortcut: id" << id << "is registered with a different command type."; qWarning() << "registerShortcut: id" << id << "is registered with a different command type.";
return c; return c;
} }
@@ -401,7 +401,7 @@ ICommand *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStr
return sc; return sc;
} }
ICommand *ActionManagerPrivate::command(const QString &id) const Command *ActionManagerPrivate::command(const QString &id) const
{ {
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid); const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
@@ -425,7 +425,7 @@ ActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const
return it.value(); return it.value();
} }
ICommand *ActionManagerPrivate::command(int uid) const Command *ActionManagerPrivate::command(int uid) const
{ {
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid); const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
if (it == m_idCmdMap.constEnd()) { if (it == m_idCmdMap.constEnd()) {
@@ -461,7 +461,7 @@ void ActionManagerPrivate::initialize()
const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString()); const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString());
const int id = m_mainWnd->uniqueIDManager()->uniqueIdentifier(sid); const int id = m_mainWnd->uniqueIDManager()->uniqueIdentifier(sid);
ICommand *cmd = command(id); Command *cmd = command(id);
if (cmd) if (cmd)
cmd->setKeySequence(key); cmd->setKeySequence(key);
} }
@@ -37,7 +37,7 @@
#include "coreplugin/core_global.h" #include "coreplugin/core_global.h"
#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QList> #include <QtCore/QList>
@@ -60,10 +60,10 @@ public:
virtual ActionContainer *createMenu(const QString &id) = 0; virtual ActionContainer *createMenu(const QString &id) = 0;
virtual ActionContainer *createMenuBar(const QString &id) = 0; virtual ActionContainer *createMenuBar(const QString &id) = 0;
virtual ICommand *registerAction(QAction *action, const QString &id, const QList<int> &context) = 0; virtual Command *registerAction(QAction *action, const QString &id, const QList<int> &context) = 0;
virtual ICommand *registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context) = 0; virtual Command *registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context) = 0;
virtual ICommand *command(const QString &id) const = 0; virtual Command *command(const QString &id) const = 0;
virtual ActionContainer *actionContainer(const QString &id) const = 0; virtual ActionContainer *actionContainer(const QString &id) const = 0;
}; };
@@ -79,7 +79,7 @@ public:
bool hasContext(int context) const; bool hasContext(int context) const;
ICommand *command(int uid) const; Command *command(int uid) const;
ActionContainer *actionContainer(int uid) const; ActionContainer *actionContainer(int uid) const;
void initialize(); void initialize();
@@ -88,17 +88,17 @@ public:
ActionContainer *createMenu(const QString &id); ActionContainer *createMenu(const QString &id);
ActionContainer *createMenuBar(const QString &id); ActionContainer *createMenuBar(const QString &id);
ICommand *registerAction(QAction *action, const QString &id, Command *registerAction(QAction *action, const QString &id,
const QList<int> &context); const QList<int> &context);
ICommand *registerShortcut(QShortcut *shortcut, const QString &id, Command *registerShortcut(QShortcut *shortcut, const QString &id,
const QList<int> &context); const QList<int> &context);
Core::ICommand *command(const QString &id) const; Core::Command *command(const QString &id) const;
Core::ActionContainer *actionContainer(const QString &id) const; Core::ActionContainer *actionContainer(const QString &id) const;
private: private:
bool hasContext(QList<int> context) const; bool hasContext(QList<int> context) const;
ICommand *registerOverridableAction(QAction *action, const QString &id, Command *registerOverridableAction(QAction *action, const QString &id,
bool checkUnique); bool checkUnique);
static ActionManagerPrivate* m_instance; static ActionManagerPrivate* m_instance;
@@ -38,10 +38,9 @@
#include "command_p.h" #include "command_p.h"
/*! /*!
\class Core::ICommand \class Core::Command
\mainclass \mainclass
\ingroup qwb \ingroup qwb
\inheaderfile icommand.h
\brief The class... \brief The class...
@@ -49,57 +48,57 @@
*/ */
/*! /*!
\enum ICommand::CommandType \enum Command::CommandType
*/ */
/*! /*!
\enum ICommand::CommandAttribute \enum Command::CommandAttribute
*/ */
/*! /*!
\fn void ICommand::setCategory(const QString &name) \fn void Command::setCategory(const QString &name)
Sets the category to \a name. Sets the category to \a name.
*/ */
/*! /*!
\fn virtual void ICommand::setDefaultKeySequence(const QKeySequence &key) \fn virtual void Command::setDefaultKeySequence(const QKeySequence &key)
*/ */
/*! /*!
\fn virtual int ICommand::id() const \fn virtual int Command::id() const
*/ */
/*! /*!
\fn virtual CommandType ICommand::type() const \fn virtual CommandType Command::type() const
*/ */
/*! /*!
\fn virtual QAction *ICommand::action() const \fn virtual QAction *Command::action() const
*/ */
/*! /*!
\fn virtual QShortcut *ICommand::shortcut() const \fn virtual QShortcut *Command::shortcut() const
*/ */
/*! /*!
\fn virtual void ICommand::setAttribute(CommandAttribute attr) \fn virtual void Command::setAttribute(CommandAttribute attr)
*/ */
/*! /*!
\fn virtual void ICommand::removeAttribute(CommandAttribute attr) \fn virtual void Command::removeAttribute(CommandAttribute attr)
*/ */
/*! /*!
\fn virtual bool ICommand::hasAttribute(CommandAttribute attr) const \fn virtual bool Command::hasAttribute(CommandAttribute attr) const
*/ */
/*! /*!
\fn virtual bool ICommand::isActive() const \fn virtual bool Command::isActive() const
*/ */
/*! /*!
\fn virtual ICommand::~ICommand() \fn virtual Command::~Command()
*/ */
using namespace Core::Internal; using namespace Core::Internal;
@@ -31,8 +31,8 @@
** **
***************************************************************************/ ***************************************************************************/
#ifndef ICOMMAND_H #ifndef COMMAND_H
#define ICOMMAND_H #define COMMAND_H
#include <coreplugin/core_global.h> #include <coreplugin/core_global.h>
@@ -42,7 +42,7 @@
namespace Core { namespace Core {
class CORE_EXPORT ICommand : public QObject class CORE_EXPORT Command : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -81,7 +81,7 @@ public:
virtual bool isActive() const = 0; virtual bool isActive() const = 0;
virtual ~ICommand() {} virtual ~Command() {}
virtual QString stringWithAppendedShortcut(const QString &str) const = 0; virtual QString stringWithAppendedShortcut(const QString &str) const = 0;
@@ -91,4 +91,4 @@ signals:
} // namespace Core } // namespace Core
#endif // ICOMMAND_H #endif // COMMAND_H
@@ -34,7 +34,7 @@
#ifndef COMMAND_P_H #ifndef COMMAND_P_H
#define COMMAND_P_H #define COMMAND_P_H
#include "icommand.h" #include "command.h"
#include "actionmanager_p.h" #include "actionmanager_p.h"
#include <QtCore/QList> #include <QtCore/QList>
@@ -45,7 +45,7 @@
namespace Core { namespace Core {
namespace Internal { namespace Internal {
class CommandPrivate : public Core::ICommand class CommandPrivate : public Core::Command
{ {
Q_OBJECT Q_OBJECT
public: public:
+1 -1
View File
@@ -100,7 +100,7 @@ HEADERS += mainwindow.h \
editormanager/ieditorfactory.h \ editormanager/ieditorfactory.h \
actionmanager/actioncontainer.h \ actionmanager/actioncontainer.h \
actionmanager/actionmanager.h \ actionmanager/actionmanager.h \
actionmanager/icommand.h \ actionmanager/command.h \
actionmanager/actionmanager_p.h \ actionmanager/actionmanager_p.h \
actionmanager/command_p.h \ actionmanager/command_p.h \
actionmanager/actioncontainer_p.h \ actionmanager/actioncontainer_p.h \
@@ -41,7 +41,7 @@
#include "filemanager.h" #include "filemanager.h"
#include <coreplugin/uniqueidmanager.h> #include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <QtGui/QKeyEvent> #include <QtGui/QKeyEvent>
#include <QtGui/QShortcut> #include <QtGui/QShortcut>
@@ -47,7 +47,7 @@ QT_END_NAMESPACE
namespace Core { namespace Core {
class ICommand; class Command;
namespace Internal { namespace Internal {
@@ -56,7 +56,7 @@ class MainWindow;
struct ShortcutItem struct ShortcutItem
{ {
ICommand *m_cmd; Command *m_cmd;
QKeySequence m_key; QKeySequence m_key;
QTreeWidgetItem *m_item; QTreeWidgetItem *m_item;
}; };
@@ -211,9 +211,9 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
ActionContainer *mfile = am->actionContainer(Constants::M_FILE); ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
//Revert to saved //Revert to saved
ICommand *cmd = am->registerAction(m_d->m_revertToSavedAction, Command *cmd = am->registerAction(m_d->m_revertToSavedAction,
Constants::REVERTTOSAVED, editManagerContext); Constants::REVERTTOSAVED, editManagerContext);
cmd->setAttribute(ICommand::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("Revert File to Saved")); cmd->setDefaultText(tr("Revert File to Saved"));
mfile->addAction(cmd, Constants::G_FILE_SAVE); mfile->addAction(cmd, Constants::G_FILE_SAVE);
connect(m_d->m_revertToSavedAction, SIGNAL(triggered()), this, SLOT(revertToSaved())); connect(m_d->m_revertToSavedAction, SIGNAL(triggered()), this, SLOT(revertToSaved()));
@@ -258,7 +258,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
//Close Action //Close Action
cmd = am->registerAction(m_d->m_closeCurrentEditorAction, Constants::CLOSE, editManagerContext); cmd = am->registerAction(m_d->m_closeCurrentEditorAction, Constants::CLOSE, editManagerContext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+W"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+W")));
cmd->setAttribute(Core::ICommand::CA_UpdateText); cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultText(m_d->m_closeCurrentEditorAction->text()); cmd->setDefaultText(m_d->m_closeCurrentEditorAction->text());
mfile->addAction(cmd, Constants::G_FILE_CLOSE); mfile->addAction(cmd, Constants::G_FILE_CLOSE);
connect(m_d->m_closeCurrentEditorAction, SIGNAL(triggered()), this, SLOT(closeEditor())); connect(m_d->m_closeCurrentEditorAction, SIGNAL(triggered()), this, SLOT(closeEditor()));
@@ -74,7 +74,7 @@ void EditorSplitter::registerActions()
ActionManager *am = m_core->actionManager(); ActionManager *am = m_core->actionManager();
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW); ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
ICommand *cmd; Command *cmd;
//Horizontal Action //Horizontal Action
m_horizontalSplitAction = new QAction(tr("Split Left/Right"), this); m_horizontalSplitAction = new QAction(tr("Split Left/Right"), this);
+7 -7
View File
@@ -428,13 +428,13 @@ void MainWindow::registerDefaultContainers()
ac->appendGroup(Constants::G_HELP_ABOUT); ac->appendGroup(Constants::G_HELP_ABOUT);
} }
static ICommand *createSeparator(ActionManagerPrivate *am, QObject *parent, static Command *createSeparator(ActionManagerPrivate *am, QObject *parent,
const QString &name, const QString &name,
const QList<int> &context) const QList<int> &context)
{ {
QAction *tmpaction = new QAction(parent); QAction *tmpaction = new QAction(parent);
tmpaction->setSeparator(true); tmpaction->setSeparator(true);
ICommand *cmd = am->registerAction(tmpaction, name, context); Command *cmd = am->registerAction(tmpaction, name, context);
return cmd; return cmd;
} }
@@ -449,7 +449,7 @@ void MainWindow::registerDefaultActions()
ActionContainer *mhelp = am->actionContainer(Constants::M_HELP); ActionContainer *mhelp = am->actionContainer(Constants::M_HELP);
// File menu separators // File menu separators
ICommand *cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Save"), m_globalContext); Command *cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Save"), m_globalContext);
mfile->addAction(cmd, Constants::G_FILE_SAVE); mfile->addAction(cmd, Constants::G_FILE_SAVE);
cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Print"), m_globalContext); cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Print"), m_globalContext);
@@ -514,7 +514,7 @@ void MainWindow::registerDefaultActions()
QAction *tmpaction = new QAction(QIcon(Constants::ICON_SAVEFILE), tr("&Save"), this); QAction *tmpaction = new QAction(QIcon(Constants::ICON_SAVEFILE), tr("&Save"), this);
cmd = am->registerAction(tmpaction, Constants::SAVE, m_globalContext); cmd = am->registerAction(tmpaction, Constants::SAVE, m_globalContext);
cmd->setDefaultKeySequence(QKeySequence::Save); cmd->setDefaultKeySequence(QKeySequence::Save);
cmd->setAttribute(ICommand::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Save")); cmd->setDefaultText(tr("&Save"));
mfile->addAction(cmd, Constants::G_FILE_SAVE); mfile->addAction(cmd, Constants::G_FILE_SAVE);
@@ -524,7 +524,7 @@ void MainWindow::registerDefaultActions()
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S")));
#endif #endif
cmd->setAttribute(ICommand::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("Save &As...")); cmd->setDefaultText(tr("Save &As..."));
mfile->addAction(cmd, Constants::G_FILE_SAVE); mfile->addAction(cmd, Constants::G_FILE_SAVE);
@@ -553,7 +553,7 @@ void MainWindow::registerDefaultActions()
tmpaction = new QAction(QIcon(Constants::ICON_UNDO), tr("&Undo"), this); tmpaction = new QAction(QIcon(Constants::ICON_UNDO), tr("&Undo"), this);
cmd = am->registerAction(tmpaction, Constants::UNDO, m_globalContext); cmd = am->registerAction(tmpaction, Constants::UNDO, m_globalContext);
cmd->setDefaultKeySequence(QKeySequence::Undo); cmd->setDefaultKeySequence(QKeySequence::Undo);
cmd->setAttribute(ICommand::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Undo")); cmd->setDefaultText(tr("&Undo"));
medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); medit->addAction(cmd, Constants::G_EDIT_UNDOREDO);
@@ -561,7 +561,7 @@ void MainWindow::registerDefaultActions()
tmpaction = new QAction(QIcon(Constants::ICON_REDO), tr("&Redo"), this); tmpaction = new QAction(QIcon(Constants::ICON_REDO), tr("&Redo"), this);
cmd = am->registerAction(tmpaction, Constants::REDO, m_globalContext); cmd = am->registerAction(tmpaction, Constants::REDO, m_globalContext);
cmd->setDefaultKeySequence(QKeySequence::Redo); cmd->setDefaultKeySequence(QKeySequence::Redo);
cmd->setAttribute(ICommand::CA_UpdateText); cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Redo")); cmd->setDefaultText(tr("&Redo"));
medit->addAction(cmd, Constants::G_EDIT_UNDOREDO); medit->addAction(cmd, Constants::G_EDIT_UNDOREDO);
+4 -4
View File
@@ -40,7 +40,7 @@
#include <aggregation/aggregate.h> #include <aggregation/aggregate.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/coreimpl.h> #include <coreplugin/coreimpl.h>
#include <coreplugin/imode.h> #include <coreplugin/imode.h>
@@ -144,7 +144,7 @@ void ModeManager::objectAdded(QObject *obj)
const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->uniqueModeName(); const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->uniqueModeName();
QShortcut *shortcut = new QShortcut(m_mainWindow); QShortcut *shortcut = new QShortcut(m_mainWindow);
shortcut->setWhatsThis(tr("Switch to %1 mode").arg(mode->name())); shortcut->setWhatsThis(tr("Switch to %1 mode").arg(mode->name()));
ICommand *cmd = am->registerShortcut(shortcut, shortcutId, QList<int>() << Constants::C_GLOBAL_ID); Command *cmd = am->registerShortcut(shortcut, shortcutId, QList<int>() << Constants::C_GLOBAL_ID);
m_modeShortcuts.insert(index, cmd); m_modeShortcuts.insert(index, cmd);
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip())); connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
@@ -162,7 +162,7 @@ void ModeManager::objectAdded(QObject *obj)
void ModeManager::updateModeToolTip() void ModeManager::updateModeToolTip()
{ {
ICommand *cmd = qobject_cast<ICommand *>(sender()); Command *cmd = qobject_cast<Command *>(sender());
if (cmd) { if (cmd) {
int index = m_modeShortcuts.indexOf(cmd); int index = m_modeShortcuts.indexOf(cmd);
if (index != -1) if (index != -1)
@@ -184,7 +184,7 @@ void ModeManager::aboutToRemoveObject(QObject *obj)
m_mainWindow->removeContextObject(mode); m_mainWindow->removeContextObject(mode);
} }
void ModeManager::addAction(ICommand *command, int priority, QMenu *menu) void ModeManager::addAction(Command *command, int priority, QMenu *menu)
{ {
m_actions.insert(command, priority); m_actions.insert(command, priority);
+4 -4
View File
@@ -48,7 +48,7 @@ QT_END_NAMESPACE
namespace Core { namespace Core {
class ICommand; class Command;
class IMode; class IMode;
namespace Internal { namespace Internal {
@@ -70,7 +70,7 @@ public:
IMode* currentMode() const; IMode* currentMode() const;
IMode* mode(const QString &id) const; IMode* mode(const QString &id) const;
void addAction(ICommand *command, int priority, QMenu *menu = 0); void addAction(Command *command, int priority, QMenu *menu = 0);
void addWidget(QWidget *widget); void addWidget(QWidget *widget);
signals: signals:
@@ -95,9 +95,9 @@ private:
Internal::MainWindow *m_mainWindow; Internal::MainWindow *m_mainWindow;
Internal::FancyTabWidget *m_modeStack; Internal::FancyTabWidget *m_modeStack;
Internal::FancyActionBar *m_actionBar; Internal::FancyActionBar *m_actionBar;
QMap<ICommand*, int> m_actions; QMap<Command*, int> m_actions;
QVector<IMode*> m_modes; QVector<IMode*> m_modes;
QVector<ICommand*> m_modeShortcuts; QVector<Command*> m_modeShortcuts;
QSignalMapper *m_signalMapper; QSignalMapper *m_signalMapper;
QList<int> m_addedContexts; QList<int> m_addedContexts;
}; };
+5 -5
View File
@@ -323,7 +323,7 @@ void NavigationWidget::objectAdded(QObject * obj)
QString displayName = factory->displayName(); QString displayName = factory->displayName();
QShortcut *shortcut = new QShortcut(this); QShortcut *shortcut = new QShortcut(this);
shortcut->setWhatsThis(tr("Activate %1 Pane").arg(displayName)); shortcut->setWhatsThis(tr("Activate %1 Pane").arg(displayName));
Core::ICommand *cmd = am->registerShortcut(shortcut, Core::Command *cmd = am->registerShortcut(shortcut,
displayName + QLatin1String(".FocusShortcut"), navicontext); displayName + QLatin1String(".FocusShortcut"), navicontext);
cmd->setDefaultKeySequence(factory->activationSequence()); cmd->setDefaultKeySequence(factory->activationSequence());
connect(shortcut, SIGNAL(activated()), this, SLOT(activateSubWidget())); connect(shortcut, SIGNAL(activated()), this, SLOT(activateSubWidget()));
@@ -492,10 +492,10 @@ void NavigationSubWidget::restoreSettings(int position)
factory()->restoreSettings(position, m_navigationWidget); factory()->restoreSettings(position, m_navigationWidget);
} }
Core::ICommand *NavigationSubWidget::command(const QString &title) const Core::Command *NavigationSubWidget::command(const QString &title) const
{ {
const QHash<QString, Core::ICommand*> commandMap = m_parentWidget->commandMap(); const QHash<QString, Core::Command*> commandMap = m_parentWidget->commandMap();
QHash<QString, Core::ICommand*>::const_iterator r = commandMap.find(title); QHash<QString, Core::Command*>::const_iterator r = commandMap.find(title);
if (r != commandMap.end()) if (r != commandMap.end())
return r.value(); return r.value();
return 0; return 0;
@@ -510,7 +510,7 @@ bool NavComboBox::event(QEvent *e)
{ {
if (e->type() == QEvent::ToolTip) { if (e->type() == QEvent::ToolTip) {
QString txt = currentText(); QString txt = currentText();
Core::ICommand *cmd = m_navSubWidget->command(txt); Core::Command *cmd = m_navSubWidget->command(txt);
if (cmd) { if (cmd) {
txt = tr("Activate %1").arg(txt); txt = tr("Activate %1").arg(txt);
setToolTip(cmd->stringWithAppendedShortcut(txt)); setToolTip(cmd->stringWithAppendedShortcut(txt));
+4 -4
View File
@@ -50,7 +50,7 @@ namespace Core {
class INavigationWidgetFactory; class INavigationWidgetFactory;
class IMode; class IMode;
class ICommand; class Command;
namespace Internal { namespace Internal {
class NavigationWidget; class NavigationWidget;
@@ -99,7 +99,7 @@ public:
// Called from the place holders // Called from the place holders
void placeHolderChanged(NavigationWidgetPlaceHolder *holder); void placeHolderChanged(NavigationWidgetPlaceHolder *holder);
QHash<QString, Core::ICommand*> commandMap() const { return m_commandMap; } QHash<QString, Core::Command*> commandMap() const { return m_commandMap; }
protected: protected:
void resizeEvent(QResizeEvent *); void resizeEvent(QResizeEvent *);
@@ -113,7 +113,7 @@ private:
NavigationSubWidget *insertSubItem(int position); NavigationSubWidget *insertSubItem(int position);
QList<NavigationSubWidget *> m_subWidgets; QList<NavigationSubWidget *> m_subWidgets;
QHash<QShortcut *, QString> m_shortcutMap; QHash<QShortcut *, QString> m_shortcutMap;
QHash<QString, Core::ICommand*> m_commandMap; QHash<QString, Core::Command*> m_commandMap;
bool m_shown; bool m_shown;
bool m_suppressed; bool m_suppressed;
int m_width; int m_width;
@@ -136,7 +136,7 @@ public:
void saveSettings(int position); void saveSettings(int position);
void restoreSettings(int position); void restoreSettings(int position);
Core::ICommand *command(const QString &title) const; Core::Command *command(const QString &title) const;
signals: signals:
void split(); void split();
+1 -1
View File
@@ -252,7 +252,7 @@ void OutputPane::init(ICore *core, ExtensionSystem::PluginManager *pm)
actionId.remove(QLatin1Char(' ')); actionId.remove(QLatin1Char(' '));
QAction *action = new QAction(outPane->name(), this); QAction *action = new QAction(outPane->name(), this);
ICommand *cmd = am->registerAction(action, actionId, m_context); Command *cmd = am->registerAction(action, actionId, m_context);
if (outPane->priorityInStatusBar() != -1) { if (outPane->priorityInStatusBar() != -1) {
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
cmd->setDefaultKeySequence(QKeySequence("Ctrl+" + QString::number(shortcutNumber))); cmd->setDefaultKeySequence(QKeySequence("Ctrl+" + QString::number(shortcutNumber)));
+6 -6
View File
@@ -206,12 +206,12 @@ void SideBar::activateItem(SideBarItem *item)
item->widget()->setFocus(); item->widget()->setFocus();
} }
void SideBar::setShortcutMap(const QMap<QString, Core::ICommand*> &shortcutMap) void SideBar::setShortcutMap(const QMap<QString, Core::Command*> &shortcutMap)
{ {
m_shortcutMap = shortcutMap; m_shortcutMap = shortcutMap;
} }
QMap<QString, Core::ICommand*> SideBar::shortcutMap() const QMap<QString, Core::Command*> SideBar::shortcutMap() const
{ {
return m_shortcutMap; return m_shortcutMap;
} }
@@ -341,10 +341,10 @@ void SideBarWidget::setCurrentIndex(int)
emit currentWidgetChanged(); emit currentWidgetChanged();
} }
Core::ICommand *SideBarWidget::command(const QString &title) const Core::Command *SideBarWidget::command(const QString &title) const
{ {
const QMap<QString, Core::ICommand*> shortcutMap = m_sideBar->shortcutMap(); const QMap<QString, Core::Command*> shortcutMap = m_sideBar->shortcutMap();
QMap<QString, Core::ICommand*>::const_iterator r = shortcutMap.find(title); QMap<QString, Core::Command*>::const_iterator r = shortcutMap.find(title);
if (r != shortcutMap.end()) if (r != shortcutMap.end())
return r.value(); return r.value();
return 0; return 0;
@@ -361,7 +361,7 @@ bool ComboBox::event(QEvent *e)
{ {
if (e->type() == QEvent::ToolTip) { if (e->type() == QEvent::ToolTip) {
QString txt = currentText(); QString txt = currentText();
Core::ICommand *cmd = m_sideBarWidget->command(txt); Core::Command *cmd = m_sideBarWidget->command(txt);
if (cmd) { if (cmd) {
txt = tr("Activate %1").arg(txt); txt = tr("Activate %1").arg(txt);
setToolTip(cmd->stringWithAppendedShortcut(txt)); setToolTip(cmd->stringWithAppendedShortcut(txt));
+5 -5
View File
@@ -50,7 +50,7 @@ QT_END_NAMESPACE
namespace Core { namespace Core {
class ICommand; class Command;
namespace Internal { namespace Internal {
class SideBarWidget; class SideBarWidget;
@@ -110,8 +110,8 @@ public:
void activateItem(SideBarItem *item); void activateItem(SideBarItem *item);
void setShortcutMap(const QMap<QString, Core::ICommand*> &shortcutMap); void setShortcutMap(const QMap<QString, Core::Command*> &shortcutMap);
QMap<QString, Core::ICommand*> shortcutMap() const; QMap<QString, Core::Command*> shortcutMap() const;
private slots: private slots:
void split(); void split();
@@ -126,7 +126,7 @@ private:
QMap<QString, SideBarItem*> m_itemMap; QMap<QString, SideBarItem*> m_itemMap;
QStringList m_availableItems; QStringList m_availableItems;
QStringList m_defaultVisible; QStringList m_defaultVisible;
QMap<QString, Core::ICommand*> m_shortcutMap; QMap<QString, Core::Command*> m_shortcutMap;
}; };
namespace Internal { namespace Internal {
@@ -144,7 +144,7 @@ public:
void updateAvailableItems(); void updateAvailableItems();
void removeCurrentItem(); void removeCurrentItem();
Core::ICommand *command(const QString &title) const; Core::Command *command(const QString &title) const;
signals: signals:
void split(); void split();
+1 -1
View File
@@ -39,7 +39,7 @@
#include "iview.h" #include "iview.h"
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <extensionsystem/ExtensionSystemInterfaces> #include <extensionsystem/ExtensionSystemInterfaces>
#include <aggregation/aggregate.h> #include <aggregation/aggregate.h>
+1 -1
View File
@@ -105,7 +105,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
cpContainer->menu()->setTitle(tr("&CodePaster")); cpContainer->menu()->setTitle(tr("&CodePaster"));
toolsContainer->addMenu(cpContainer); toolsContainer->addMenu(cpContainer);
Core::ICommand *command; Core::Command *command;
m_postAction = new QAction(tr("Paste snippet..."), this); m_postAction = new QAction(tr("Paste snippet..."), this);
command = actionManager->registerAction(m_postAction, "CodePaster.post", globalcontext); command = actionManager->registerAction(m_postAction, "CodePaster.post", globalcontext);
+2 -2
View File
@@ -45,7 +45,7 @@
#include <coreplugin/uniqueidmanager.h> #include <coreplugin/uniqueidmanager.h>
#include <coreplugin/fileiconprovider.h> #include <coreplugin/fileiconprovider.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <texteditor/completionsupport.h> #include <texteditor/completionsupport.h>
#include <texteditor/fontsettings.h> #include <texteditor/fontsettings.h>
@@ -197,7 +197,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
Core::ActionManager *am = m_core->actionManager(); Core::ActionManager *am = m_core->actionManager();
am->createMenu(CppEditor::Constants::M_CONTEXT); am->createMenu(CppEditor::Constants::M_CONTEXT);
Core::ICommand *cmd; Core::Command *cmd;
QAction *jumpToDefinition = new QAction(tr("Follow Symbol under Cursor"), this); QAction *jumpToDefinition = new QAction(tr("Follow Symbol under Cursor"), this);
cmd = am->registerAction(jumpToDefinition, cmd = am->registerAction(jumpToDefinition,
+1 -1
View File
@@ -108,7 +108,7 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *)
QList<int> context = QList<int>() << m_context; QList<int> context = QList<int>() << m_context;
QAction *switchAction = new QAction(tr("Switch Header/Source"), this); QAction *switchAction = new QAction(tr("Switch Header/Source"), this);
Core::ICommand *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context); Core::Command *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context);
command->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); command->setDefaultKeySequence(QKeySequence(Qt::Key_F4));
mcpptools->addAction(command); mcpptools->addAction(command);
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource())); connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));
+4 -4
View File
@@ -312,7 +312,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
Core::ActionContainer *mdebug = Core::ActionContainer *mdebug =
am->actionContainer(ProjectExplorer::Constants::M_DEBUG); am->actionContainer(ProjectExplorer::Constants::M_DEBUG);
Core::ICommand *cmd = 0; Core::Command *cmd = 0;
cmd = am->registerAction(m_manager->m_startExternalAction, cmd = am->registerAction(m_manager->m_startExternalAction,
Constants::STARTEXTERNAL, globalcontext); Constants::STARTEXTERNAL, globalcontext);
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
@@ -328,15 +328,15 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
cmd = am->registerAction(m_manager->m_stopAction, cmd = am->registerAction(m_manager->m_stopAction,
Constants::INTERRUPT, globalcontext); Constants::INTERRUPT, globalcontext);
cmd->setAttribute(Core::ICommand::CA_UpdateText); cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setAttribute(Core::ICommand::CA_UpdateIcon); cmd->setAttribute(Core::Command::CA_UpdateIcon);
cmd->setDefaultKeySequence(QKeySequence(Constants::INTERRUPT_KEY)); cmd->setDefaultKeySequence(QKeySequence(Constants::INTERRUPT_KEY));
cmd->setDefaultText(tr("Stop Debugger/Interrupt Debugger")); cmd->setDefaultText(tr("Stop Debugger/Interrupt Debugger"));
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
cmd = am->registerAction(m_manager->m_resetAction, cmd = am->registerAction(m_manager->m_resetAction,
Constants::RESET, globalcontext); Constants::RESET, globalcontext);
cmd->setAttribute(Core::ICommand::CA_UpdateText); cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultKeySequence(QKeySequence(Constants::RESET_KEY)); cmd->setDefaultKeySequence(QKeySequence(Constants::RESET_KEY));
cmd->setDefaultText(tr("Reset Debugger")); cmd->setDefaultText(tr("Reset Debugger"));
//disabled mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); //disabled mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
+10 -10
View File
@@ -111,10 +111,10 @@ static inline QAction *createEditModeAction(QActionGroup *ag,
rc->setCheckable(true); rc->setCheckable(true);
if (!iconName.isEmpty()) if (!iconName.isEmpty())
rc->setIcon(designerIcon(iconName)); rc->setIcon(designerIcon(iconName));
Core::ICommand *command = am->registerAction(rc, name, context); Core::Command *command = am->registerAction(rc, name, context);
if (!keySequence.isEmpty()) if (!keySequence.isEmpty())
command->setDefaultKeySequence(QKeySequence(keySequence)); command->setDefaultKeySequence(QKeySequence(keySequence));
command->setAttribute(Core::ICommand::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
medit->addAction(command, Core::Constants::G_EDIT_OTHER); medit->addAction(command, Core::Constants::G_EDIT_OTHER);
rc->setData(toolNumber); rc->setData(toolNumber);
ag->addAction(rc); ag->addAction(rc);
@@ -132,7 +132,7 @@ static inline QAction * createSeparator(QObject *parent,
{ {
QAction *actSeparator = new QAction(parent); QAction *actSeparator = new QAction(parent);
actSeparator->setSeparator(true); actSeparator->setSeparator(true);
Core::ICommand *command = am->registerAction(actSeparator, name, context); Core::Command *command = am->registerAction(actSeparator, name, context);
container->addAction(command, group); container->addAction(command, group);
return actSeparator; return actSeparator;
} }
@@ -145,7 +145,7 @@ static inline void addToolAction(QAction *a,
Core::ActionContainer *c1, Core::ActionContainer *c1,
const QString &keySequence = QString()) const QString &keySequence = QString())
{ {
Core::ICommand *command = am->registerAction(a, name, context); Core::Command *command = am->registerAction(a, name, context);
if (!keySequence.isEmpty()) if (!keySequence.isEmpty())
command->setDefaultKeySequence(QKeySequence(keySequence)); command->setDefaultKeySequence(QKeySequence(keySequence));
c1->addAction(command); c1->addAction(command);
@@ -306,7 +306,7 @@ void FormEditorW::deleteInstance()
void FormEditorW::setupActions() void FormEditorW::setupActions()
{ {
Core::ActionManager *am = m_core->actionManager(); Core::ActionManager *am = m_core->actionManager();
Core::ICommand *command; Core::Command *command;
//menus //menus
Core::ActionContainer *medit = Core::ActionContainer *medit =
@@ -334,7 +334,7 @@ void FormEditorW::setupActions()
//'delete' action //'delete' action
command = am->registerAction(m_fwm->actionDelete(), QLatin1String("FormEditor.Edit.Delete"), m_context); command = am->registerAction(m_fwm->actionDelete(), QLatin1String("FormEditor.Edit.Delete"), m_context);
command->setDefaultKeySequence(QKeySequence::Delete); command->setDefaultKeySequence(QKeySequence::Delete);
command->setAttribute(Core::ICommand::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
medit->addAction(command, Core::Constants::G_EDIT_COPYPASTE); medit->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
//editor Modes. Store ids for editor tool bars //editor Modes. Store ids for editor tool bars
@@ -446,7 +446,7 @@ QToolBar *FormEditorW::createEditorToolBar() const
Core::ActionManager *am = m_core->actionManager(); Core::ActionManager *am = m_core->actionManager();
const QStringList::const_iterator cend = m_toolActionIds.constEnd(); const QStringList::const_iterator cend = m_toolActionIds.constEnd();
for (QStringList::const_iterator it = m_toolActionIds.constBegin(); it != cend; ++it) { for (QStringList::const_iterator it = m_toolActionIds.constBegin(); it != cend; ++it) {
Core::ICommand *cmd = am->command(*it); Core::Command *cmd = am->command(*it);
QTC_ASSERT(cmd, continue); QTC_ASSERT(cmd, continue);
QAction *action = cmd->action(); QAction *action = cmd->action();
if (!action->icon().isNull()) // Simplify grid has no action yet if (!action->icon().isNull()) // Simplify grid has no action yet
@@ -483,10 +483,10 @@ Core::ActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManager *
name += dot; name += dot;
} }
name += data.toString(); name += data.toString();
Core::ICommand *command = am->registerAction(a, name, m_context); Core::Command *command = am->registerAction(a, name, m_context);
if (isDeviceProfile) { if (isDeviceProfile) {
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setAttribute(Core::ICommand::CA_NonConfigureable); command->setAttribute(Core::Command::CA_NonConfigureable);
} }
menuPreviewStyle->addAction(command); menuPreviewStyle->addAction(command);
} }
+1 -1
View File
@@ -165,7 +165,7 @@ bool FakeVimPluginPrivate::initialize(const QStringList &arguments, QString *err
m_installHandlerAction = new QAction(this); m_installHandlerAction = new QAction(this);
m_installHandlerAction->setText(tr("Set vi-Style Keyboard Action Handler")); m_installHandlerAction->setText(tr("Set vi-Style Keyboard Action Handler"));
Core::ICommand *cmd = 0; Core::Command *cmd = 0;
cmd = actionManager->registerAction(m_installHandlerAction, cmd = actionManager->registerAction(m_installHandlerAction,
Constants::INSTALL_HANDLER, globalcontext); Constants::INSTALL_HANDLER, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::INSTALL_KEY)); cmd->setDefaultKeySequence(QKeySequence(Constants::INSTALL_KEY));
+3 -3
View File
@@ -40,7 +40,7 @@
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -135,7 +135,7 @@ void FindPlugin::setupMenu()
mfind->appendGroup(Constants::G_FIND_FLAGS); mfind->appendGroup(Constants::G_FIND_FLAGS);
mfind->appendGroup(Constants::G_FIND_ACTIONS); mfind->appendGroup(Constants::G_FIND_ACTIONS);
QList<int> globalcontext = QList<int>() << Core::Constants::C_GLOBAL_ID; QList<int> globalcontext = QList<int>() << Core::Constants::C_GLOBAL_ID;
Core::ICommand *cmd; Core::Command *cmd;
QAction *separator; QAction *separator;
separator = new QAction(this); separator = new QAction(this);
separator->setSeparator(true); separator->setSeparator(true);
@@ -152,7 +152,7 @@ void FindPlugin::setupFilterMenuItems()
Core::ActionManager *am = m_core->actionManager(); Core::ActionManager *am = m_core->actionManager();
QList<IFindFilter*> findInterfaces = QList<IFindFilter*> findInterfaces =
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>(); ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
Core::ICommand *cmd; Core::Command *cmd;
QList<int> globalcontext = QList<int>() << Core::Constants::C_GLOBAL_ID; QList<int> globalcontext = QList<int>() << Core::Constants::C_GLOBAL_ID;
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND); Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
+2 -2
View File
@@ -39,7 +39,7 @@
#include <coreplugin/findplaceholder.h> #include <coreplugin/findplaceholder.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
@@ -140,7 +140,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
Core::ActionManager *am = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->actionManager(); Core::ActionManager *am = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->actionManager();
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND); Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
Core::ICommand *cmd; Core::Command *cmd;
m_findInDocumentAction = new QAction(tr("Current Document"), this); m_findInDocumentAction = new QAction(tr("Current Document"), this);
cmd = am->registerAction(m_findInDocumentAction, Constants::FIND_IN_DOCUMENT, globalcontext); cmd = am->registerAction(m_findInDocumentAction, Constants::FIND_IN_DOCUMENT, globalcontext);
+22 -22
View File
@@ -213,7 +213,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
Git::Constants::C_GITSUBMITEDITOR Git::Constants::C_GITSUBMITEDITOR
}; };
static Core::ICommand *createSeparator(Core::ActionManager *am, static Core::Command *createSeparator(Core::ActionManager *am,
const QList<int> &context, const QList<int> &context,
const QString &id, const QString &id,
QObject *parent) QObject *parent)
@@ -277,11 +277,11 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
connect(m_versionControl, SIGNAL(enabledChanged(bool)), ma, SLOT(setVisible(bool))); connect(m_versionControl, SIGNAL(enabledChanged(bool)), ma, SLOT(setVisible(bool)));
} }
Core::ICommand *command; Core::Command *command;
m_diffAction = new QAction(tr("Diff current file"), this); m_diffAction = new QAction(tr("Diff current file"), this);
command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext); command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D")));
connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -289,47 +289,47 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_statusAction = new QAction(tr("File Status"), this); m_statusAction = new QAction(tr("File Status"), this);
command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext); command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile())); connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_logAction = new QAction(tr("Log File"), this); m_logAction = new QAction(tr("Log File"), this);
command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext); command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile())); connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_blameAction = new QAction(tr("Blame"), this); m_blameAction = new QAction(tr("Blame"), this);
command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext); command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile())); connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_undoFileAction = new QAction(tr("Undo Changes"), this); m_undoFileAction = new QAction(tr("Undo Changes"), this);
command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext); command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges())); connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_stageAction = new QAction(tr("Stage file for commit"), this); m_stageAction = new QAction(tr("Stage file for commit"), this);
command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext); command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile())); connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_unstageAction = new QAction(tr("Unstage file from commit"), this); m_unstageAction = new QAction(tr("Unstage file from commit"), this);
command = actionManager->registerAction(m_unstageAction, "Git.Unstage", globalcontext); command = actionManager->registerAction(m_unstageAction, "Git.Unstage", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_unstageAction, SIGNAL(triggered()), this, SLOT(unstageFile())); connect(m_unstageAction, SIGNAL(triggered()), this, SLOT(unstageFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_revertAction = new QAction(tr("Revert..."), this); m_revertAction = new QAction(tr("Revert..."), this);
command = actionManager->registerAction(m_revertAction, "Git.Revert", globalcontext); command = actionManager->registerAction(m_revertAction, "Git.Revert", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertFile())); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -338,26 +338,26 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_diffProjectAction = new QAction(tr("Diff current project"), this); m_diffProjectAction = new QAction(tr("Diff current project"), this);
command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext); command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext);
command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D")); command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D"));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject())); connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_statusProjectAction = new QAction(tr("Project status"), this); m_statusProjectAction = new QAction(tr("Project status"), this);
command = actionManager->registerAction(m_statusProjectAction, "Git.StatusProject", globalcontext); command = actionManager->registerAction(m_statusProjectAction, "Git.StatusProject", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(statusProject())); connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(statusProject()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_logProjectAction = new QAction(tr("Log project"), this); m_logProjectAction = new QAction(tr("Log project"), this);
command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext); command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject())); connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_undoProjectAction = new QAction(tr("Undo Project Changes"), this); m_undoProjectAction = new QAction(tr("Undo Project Changes"), this);
command = actionManager->registerAction(m_undoProjectAction, "Git.UndoProject", globalcontext); command = actionManager->registerAction(m_undoProjectAction, "Git.UndoProject", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_undoProjectAction, SIGNAL(triggered()), this, SLOT(undoProjectChanges())); connect(m_undoProjectAction, SIGNAL(triggered()), this, SLOT(undoProjectChanges()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -366,33 +366,33 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_stashAction = new QAction(tr("Stash"), this); m_stashAction = new QAction(tr("Stash"), this);
m_stashAction->setToolTip("Saves the current state of your work."); m_stashAction->setToolTip("Saves the current state of your work.");
command = actionManager->registerAction(m_stashAction, "Git.Stash", globalcontext); command = actionManager->registerAction(m_stashAction, "Git.Stash", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stashAction, SIGNAL(triggered()), this, SLOT(stash())); connect(m_stashAction, SIGNAL(triggered()), this, SLOT(stash()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_pullAction = new QAction(tr("Pull"), this); m_pullAction = new QAction(tr("Pull"), this);
command = actionManager->registerAction(m_pullAction, "Git.Pull", globalcontext); command = actionManager->registerAction(m_pullAction, "Git.Pull", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_pullAction, SIGNAL(triggered()), this, SLOT(pull())); connect(m_pullAction, SIGNAL(triggered()), this, SLOT(pull()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_stashPopAction = new QAction(tr("Stash pop"), this); m_stashPopAction = new QAction(tr("Stash pop"), this);
m_stashAction->setToolTip("Restores changes saved to the stash list using \"Stash\"."); m_stashAction->setToolTip("Restores changes saved to the stash list using \"Stash\".");
command = actionManager->registerAction(m_stashPopAction, "Git.StashPop", globalcontext); command = actionManager->registerAction(m_stashPopAction, "Git.StashPop", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stashPopAction, SIGNAL(triggered()), this, SLOT(stashPop())); connect(m_stashPopAction, SIGNAL(triggered()), this, SLOT(stashPop()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_commitAction = new QAction(tr("Commit..."), this); m_commitAction = new QAction(tr("Commit..."), this);
command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext); command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit())); connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_pushAction = new QAction(tr("Push"), this); m_pushAction = new QAction(tr("Push"), this);
command = actionManager->registerAction(m_pushAction, "Git.Push", globalcontext); command = actionManager->registerAction(m_pushAction, "Git.Push", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_pushAction, SIGNAL(triggered()), this, SLOT(push())); connect(m_pushAction, SIGNAL(triggered()), this, SLOT(push()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -400,19 +400,19 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_branchListAction = new QAction(tr("Branches..."), this); m_branchListAction = new QAction(tr("Branches..."), this);
command = actionManager->registerAction(m_branchListAction, "Git.BranchList", globalcontext); command = actionManager->registerAction(m_branchListAction, "Git.BranchList", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_branchListAction, SIGNAL(triggered()), this, SLOT(branchList())); connect(m_branchListAction, SIGNAL(triggered()), this, SLOT(branchList()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_stashListAction = new QAction(tr("List stashes"), this); m_stashListAction = new QAction(tr("List stashes"), this);
command = actionManager->registerAction(m_stashListAction, "Git.StashList", globalcontext); command = actionManager->registerAction(m_stashListAction, "Git.StashList", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stashListAction, SIGNAL(triggered()), this, SLOT(stashList())); connect(m_stashListAction, SIGNAL(triggered()), this, SLOT(stashList()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_showAction = new QAction(tr("Show commit..."), this); m_showAction = new QAction(tr("Show commit..."), this);
command = actionManager->registerAction(m_showAction, "Git.ShowCommit", globalcontext); command = actionManager->registerAction(m_showAction, "Git.ShowCommit", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_showAction, SIGNAL(triggered()), this, SLOT(showCommit())); connect(m_showAction, SIGNAL(triggered()), this, SLOT(showCommit()));
gitContainer->addAction(command); gitContainer->addAction(command);
+2 -2
View File
@@ -92,12 +92,12 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *error_m
// Register the action with the action manager // Register the action with the action manager
Core::ActionManager *actionManager = core->actionManager(); Core::ActionManager *actionManager = core->actionManager();
Core::ICommand *command = Core::Command *command =
actionManager->registerAction( actionManager->registerAction(
helloWorldAction, "HelloWorld.HelloWorldAction", context); helloWorldAction, "HelloWorld.HelloWorldAction", context);
// Create our own menu to place in the Tools menu // Create our own menu to place in the Tools menu
Core::IActionContainer *helloWorldMenu = Core::ActionContainer *helloWorldMenu =
actionManager->createMenu("HelloWorld.HelloWorldMenu"); actionManager->createMenu("HelloWorld.HelloWorldMenu");
QMenu *menu = helloWorldMenu->menu(); QMenu *menu = helloWorldMenu->menu();
menu->setTitle(tr("&Hello World")); menu->setTitle(tr("&Hello World"));
+2 -2
View File
@@ -166,7 +166,7 @@ bool HelpPlugin::initialize(const QStringList & /*arguments*/, QString *)
this, SLOT(addBookmark())); this, SLOT(addBookmark()));
Core::ActionManager *am = m_core->actionManager(); Core::ActionManager *am = m_core->actionManager();
Core::ICommand *cmd; Core::Command *cmd;
// Add Home, Previous and Next actions (used in the toolbar) // Add Home, Previous and Next actions (used in the toolbar)
QAction *homeAction = new QAction(QIcon(QLatin1String(":/help/images/home.png")), tr("Home"), this); QAction *homeAction = new QAction(QIcon(QLatin1String(":/help/images/home.png")), tr("Home"), this);
@@ -251,7 +251,7 @@ bool HelpPlugin::initialize(const QStringList & /*arguments*/, QString *)
copyAction->setText(cmd->action()->text()); copyAction->setText(cmd->action()->text());
copyAction->setIcon(cmd->action()->icon()); copyAction->setIcon(cmd->action()->icon());
QMap<QString, Core::ICommand*> shortcutMap; QMap<QString, Core::Command*> shortcutMap;
QShortcut *shortcut = new QShortcut(splitter); QShortcut *shortcut = new QShortcut(splitter);
shortcut->setWhatsThis(tr("Activate Index in Help mode")); shortcut->setWhatsThis(tr("Activate Index in Help mode"));
cmd = am->registerShortcut(shortcut, QLatin1String("Help.IndexShortcut"), modecontext); cmd = am->registerShortcut(shortcut, QLatin1String("Help.IndexShortcut"), modecontext);
+9 -9
View File
@@ -246,12 +246,12 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
perforcesubmitcontext << perforcesubmitcontext <<
m_coreInstance->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR); m_coreInstance->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
Core::ICommand *command; Core::Command *command;
QAction *tmpaction; QAction *tmpaction;
m_editAction = new QAction(tr("Edit"), this); m_editAction = new QAction(tr("Edit"), this);
command = am->registerAction(m_editAction, PerforcePlugin::EDIT, globalcontext); command = am->registerAction(m_editAction, PerforcePlugin::EDIT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E")));
command->setDefaultText(tr("Edit File")); command->setDefaultText(tr("Edit File"));
connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile())); connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile()));
@@ -259,7 +259,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_addAction = new QAction(tr("Add"), this); m_addAction = new QAction(tr("Add"), this);
command = am->registerAction(m_addAction, PerforcePlugin::ADD, globalcontext); command = am->registerAction(m_addAction, PerforcePlugin::ADD, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A")));
command->setDefaultText(tr("Add File")); command->setDefaultText(tr("Add File"));
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
@@ -267,14 +267,14 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_deleteAction = new QAction(tr("Delete"), this); m_deleteAction = new QAction(tr("Delete"), this);
command = am->registerAction(m_deleteAction, PerforcePlugin::DELETE_FILE, globalcontext); command = am->registerAction(m_deleteAction, PerforcePlugin::DELETE_FILE, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Delete File")); command->setDefaultText(tr("Delete File"));
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile())); connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
m_revertAction = new QAction(tr("Revert"), this); m_revertAction = new QAction(tr("Revert"), this);
command = am->registerAction(m_revertAction, PerforcePlugin::REVERT, globalcontext); command = am->registerAction(m_revertAction, PerforcePlugin::REVERT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R")));
command->setDefaultText(tr("Revert File")); command->setDefaultText(tr("Revert File"));
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
@@ -287,14 +287,14 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_diffCurrentAction = new QAction(tr("Diff Current File"), this); m_diffCurrentAction = new QAction(tr("Diff Current File"), this);
command = am->registerAction(m_diffCurrentAction, PerforcePlugin::DIFF_CURRENT, globalcontext); command = am->registerAction(m_diffCurrentAction, PerforcePlugin::DIFF_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Diff Current File")); command->setDefaultText(tr("Diff Current File"));
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
m_diffProjectAction = new QAction(tr("Diff Current Project/Session"), this); m_diffProjectAction = new QAction(tr("Diff Current Project/Session"), this);
command = am->registerAction(m_diffProjectAction, PerforcePlugin::DIFF_PROJECT, globalcontext); command = am->registerAction(m_diffProjectAction, PerforcePlugin::DIFF_PROJECT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D")));
command->setDefaultText(tr("Diff Current Project/Session")); command->setDefaultText(tr("Diff Current Project/Session"));
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject())); connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
@@ -346,7 +346,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this); m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this);
command = am->registerAction(m_annotateCurrentAction, PerforcePlugin::ANNOTATE_CURRENT, globalcontext); command = am->registerAction(m_annotateCurrentAction, PerforcePlugin::ANNOTATE_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Annotate Current File")); command->setDefaultText(tr("Annotate Current File"));
connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile())); connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
@@ -358,7 +358,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this); m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this);
command = am->registerAction(m_filelogCurrentAction, PerforcePlugin::FILELOG_CURRENT, globalcontext); command = am->registerAction(m_filelogCurrentAction, PerforcePlugin::FILELOG_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F")));
command->setDefaultText(tr("Filelog Current File")); command->setDefaultText(tr("Filelog Current File"));
connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile())); connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile()));
+1 -1
View File
@@ -86,7 +86,7 @@ OutputPane::OutputPane(Core::ICore *core)
m_stopAction->setToolTip(tr("Stop")); m_stopAction->setToolTip(tr("Stop"));
m_stopAction->setEnabled(false); m_stopAction->setEnabled(false);
Core::ICommand *cmd = am->registerAction(m_stopAction, Constants::STOP, globalcontext); Core::Command *cmd = am->registerAction(m_stopAction, Constants::STOP, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R")));
m_stopButton = new QToolButton; m_stopButton = new QToolButton;
@@ -322,7 +322,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
// Separators // Separators
// //
Core::ICommand *cmd; Core::Command *cmd;
QAction *sep; QAction *sep;
sep = new QAction(this); sep = new QAction(this);
@@ -427,7 +427,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
// unload action // unload action
m_unloadAction = new QAction(tr("Unload Project"), this); m_unloadAction = new QAction(tr("Unload Project"), this);
cmd = am->registerAction(m_unloadAction, Constants::UNLOAD, globalcontext); cmd = am->registerAction(m_unloadAction, Constants::UNLOAD, globalcontext);
cmd->setAttribute(Core::ICommand::CA_UpdateText); cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultText(m_unloadAction->text()); cmd->setDefaultText(m_unloadAction->text());
mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT); mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);
mproject->addAction(cmd, Constants::G_PROJECT_FILES); mproject->addAction(cmd, Constants::G_PROJECT_FILES);
@@ -553,8 +553,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
debuggerIcon.addFile(":/gdbdebugger/images/debugger_start.png"); debuggerIcon.addFile(":/gdbdebugger/images/debugger_start.png");
m_debugAction = new QAction(debuggerIcon, tr("Start Debugging"), this); m_debugAction = new QAction(debuggerIcon, tr("Start Debugging"), this);
cmd = am->registerAction(m_debugAction, Constants::DEBUG, globalcontext); cmd = am->registerAction(m_debugAction, Constants::DEBUG, globalcontext);
cmd->setAttribute(Core::ICommand::CA_UpdateText); cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setAttribute(Core::ICommand::CA_UpdateIcon); cmd->setAttribute(Core::Command::CA_UpdateIcon);
cmd->setDefaultText(tr("Start Debugging")); cmd->setDefaultText(tr("Start Debugging"));
cmd->setDefaultKeySequence(QKeySequence(tr("F5"))); cmd->setDefaultKeySequence(QKeySequence(tr("F5")));
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE); mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
@@ -82,7 +82,7 @@ Qt4ProjectManagerPlugin::~Qt4ProjectManagerPlugin()
delete m_qt4ProjectManager; delete m_qt4ProjectManager;
} }
/* /*
static Core::ICommand *createSeparator(Core::ActionManager *am, static Core::Command *createSeparator(Core::ActionManager *am,
QObject *parent, QObject *parent,
const QString &name, const QString &name,
const QList<int> &context) const QList<int> &context)
@@ -148,7 +148,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList & /*arguments*/, QStr
m_projectContext = m_core->uniqueIDManager()-> m_projectContext = m_core->uniqueIDManager()->
uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND); uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
QList<int> context = QList<int>() << m_projectContext; QList<int> context = QList<int>() << m_projectContext;
Core::ICommand *command; Core::Command *command;
QIcon qmakeIcon(QLatin1String(":/qt4projectmanager/images/run_qmake.png")); QIcon qmakeIcon(QLatin1String(":/qt4projectmanager/images/run_qmake.png"));
qmakeIcon.addFile(QLatin1String(":/qt4projectmanager/images/run_qmake_small.png")); qmakeIcon.addFile(QLatin1String(":/qt4projectmanager/images/run_qmake_small.png"));
@@ -45,7 +45,7 @@
static QAction *actionFromId(Core::ICore *core, const QString &id) static QAction *actionFromId(Core::ICore *core, const QString &id)
{ {
Core::ICommand *cmd = core->actionManager()->command(id); Core::Command *cmd = core->actionManager()->command(id);
if (!cmd) if (!cmd)
return 0; return 0;
return cmd->action(); return cmd->action();
@@ -136,7 +136,7 @@ void QtScriptEditorPlugin::registerActions(Core::ICore *core)
QAction *action = new QAction(this); QAction *action = new QAction(this);
action->setSeparator(true); action->setSeparator(true);
Core::ICommand *cmd = am->registerAction(action, QtScriptEditor::Constants::RUN_SEP, m_scriptcontext); Core::Command *cmd = am->registerAction(action, QtScriptEditor::Constants::RUN_SEP, m_scriptcontext);
mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE); mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
action = new QAction(tr("Run"), this); action = new QAction(tr("Run"), this);
+1 -1
View File
@@ -96,7 +96,7 @@ bool QuickOpenPlugin::initialize(const QStringList &, QString *)
const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow"); const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow");
QAction *action = new QAction(m_quickOpenToolWindow->windowIcon(), m_quickOpenToolWindow->windowTitle(), this); QAction *action = new QAction(m_quickOpenToolWindow->windowIcon(), m_quickOpenToolWindow->windowTitle(), this);
Core::ICommand *cmd = core->actionManager()->registerAction(action, actionId, QList<int>() << Core::Constants::C_GLOBAL_ID); Core::Command *cmd = core->actionManager()->registerAction(action, actionId, QList<int>() << Core::Constants::C_GLOBAL_ID);
cmd->setDefaultKeySequence(QKeySequence("Ctrl+K")); cmd->setDefaultKeySequence(QKeySequence("Ctrl+K"));
connect(action, SIGNAL(triggered()), this, SLOT(openQuickOpen())); connect(action, SIGNAL(triggered()), this, SLOT(openQuickOpen()));
+8 -8
View File
@@ -304,11 +304,11 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
QList<int> globalcontext; QList<int> globalcontext;
globalcontext << m_coreInstance->uniqueIDManager()->uniqueIdentifier(C_GLOBAL); globalcontext << m_coreInstance->uniqueIDManager()->uniqueIdentifier(C_GLOBAL);
Core::ICommand *command; Core::Command *command;
m_addAction = new QAction(tr("Add"), this); m_addAction = new QAction(tr("Add"), this);
command = ami->registerAction(m_addAction, SubversionPlugin::ADD, command = ami->registerAction(m_addAction, SubversionPlugin::ADD,
globalcontext); globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A")));
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -316,14 +316,14 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_deleteAction = new QAction(tr("Delete"), this); m_deleteAction = new QAction(tr("Delete"), this);
command = ami->registerAction(m_deleteAction, SubversionPlugin::DELETE_FILE, command = ami->registerAction(m_deleteAction, SubversionPlugin::DELETE_FILE,
globalcontext); globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile())); connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
m_revertAction = new QAction(tr("Revert"), this); m_revertAction = new QAction(tr("Revert"), this);
command = ami->registerAction(m_revertAction, SubversionPlugin::REVERT, command = ami->registerAction(m_revertAction, SubversionPlugin::REVERT,
globalcontext); globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -341,7 +341,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_diffCurrentAction = new QAction(tr("Diff Current File"), this); m_diffCurrentAction = new QAction(tr("Diff Current File"), this);
command = ami->registerAction(m_diffCurrentAction, command = ami->registerAction(m_diffCurrentAction,
SubversionPlugin::DIFF_CURRENT, globalcontext); SubversionPlugin::DIFF_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D")));
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -360,7 +360,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_commitCurrentAction = new QAction(tr("Commit Current File"), this); m_commitCurrentAction = new QAction(tr("Commit Current File"), this);
command = ami->registerAction(m_commitCurrentAction, command = ami->registerAction(m_commitCurrentAction,
SubversionPlugin::COMMIT_CURRENT, globalcontext); SubversionPlugin::COMMIT_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C")));
connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile())); connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -373,7 +373,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this); m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this);
command = ami->registerAction(m_filelogCurrentAction, command = ami->registerAction(m_filelogCurrentAction,
SubversionPlugin::FILELOG_CURRENT, globalcontext); SubversionPlugin::FILELOG_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_filelogCurrentAction, SIGNAL(triggered()), this, connect(m_filelogCurrentAction, SIGNAL(triggered()), this,
SLOT(filelogCurrentFile())); SLOT(filelogCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -381,7 +381,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this); m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this);
command = ami->registerAction(m_annotateCurrentAction, command = ami->registerAction(m_annotateCurrentAction,
SubversionPlugin::ANNOTATE_CURRENT, globalcontext); SubversionPlugin::ANNOTATE_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_annotateCurrentAction, SIGNAL(triggered()), this, connect(m_annotateCurrentAction, SIGNAL(triggered()), this,
SLOT(annotateCurrentFile())); SLOT(annotateCurrentFile()));
subversionMenu->addAction(command); subversionMenu->addAction(command);
@@ -117,7 +117,7 @@ void TextEditorActionHandler::createActions()
Core::ActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED); Core::ActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED);
m_selectEncodingAction = new QAction(tr("Select Encoding..."), this); m_selectEncodingAction = new QAction(tr("Select Encoding..."), this);
Core::ICommand *command = am->registerAction(m_selectEncodingAction, Constants::SELECT_ENCODING, m_contextId); Core::Command *command = am->registerAction(m_selectEncodingAction, Constants::SELECT_ENCODING, m_contextId);
connect(m_selectEncodingAction, SIGNAL(triggered()), this, SLOT(selectEncoding())); connect(m_selectEncodingAction, SIGNAL(triggered()), this, SLOT(selectEncoding()));
medit->addAction(command, Core::Constants::G_EDIT_OTHER); medit->addAction(command, Core::Constants::G_EDIT_OTHER);
+2 -2
View File
@@ -47,7 +47,7 @@
#include <coreplugin/mimedatabase.h> #include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h> #include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <texteditor/texteditoractionhandler.h> #include <texteditor/texteditoractionhandler.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -127,7 +127,7 @@ bool TextEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
completionShortcut->setWhatsThis(tr("Triggers a completion in this scope")); completionShortcut->setWhatsThis(tr("Triggers a completion in this scope"));
// Make sure the shortcut still works when the completion widget is active // Make sure the shortcut still works when the completion widget is active
completionShortcut->setContext(Qt::ApplicationShortcut); completionShortcut->setContext(Qt::ApplicationShortcut);
Core::ICommand *command = am->registerShortcut(completionShortcut, Constants::COMPLETE_THIS, context); Core::Command *command = am->registerShortcut(completionShortcut, Constants::COMPLETE_THIS, context);
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Space"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Space")));
#else #else