Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

This commit is contained in:
dt
2009-01-14 17:15:30 +01:00
85 changed files with 968 additions and 1043 deletions

View File

@@ -37,10 +37,10 @@
#include "bookmarksplugin.h"
#include "bookmarks_global.h"
#include <projectexplorer/ProjectExplorerInterfaces>
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <texteditor/basetexteditor.h>
#include <utils/qtcassert.h>
@@ -49,6 +49,7 @@
#include <QtGui/QAction>
#include <QtGui/QContextMenuEvent>
#include <QtGui/QMenu>
#include <QtGui/QPainter>
Q_DECLARE_METATYPE(Bookmarks::Internal::Bookmark*)

View File

@@ -77,17 +77,17 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
globalcontext << Core::Constants::C_GLOBAL_ID;
Core::IActionContainer *mtools =
Core::ActionContainer *mtools =
am->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *mbm =
Core::ActionContainer *mbm =
am->createMenu(QLatin1String(BOOKMARKS_MENU));
mbm->menu()->setTitle(tr("&Bookmarks"));
mtools->addMenu(mbm);
//Toggle
m_toggleAction = new QAction(tr("Toggle Bookmark"), this);
Core::ICommand *cmd =
Core::Command *cmd =
am->registerAction(m_toggleAction, BOOKMARKS_TOGGLE_ACTION, textcontext);
#ifndef Q_OS_MAC
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+M")));

View File

@@ -31,10 +31,10 @@
**
***************************************************************************/
#include "actioncontainer.h"
#include "actioncontainer_p.h"
#include "actionmanager_p.h"
#include "command.h"
#include "command_p.h"
#include "coreimpl.h"
#include "coreconstants.h"
@@ -51,112 +51,111 @@ using namespace Core;
using namespace Core::Internal;
/*!
\class IActionContainer
\class ActionContainer
\mainclass
\inheaderfile iactioncontainer.h
\brief The IActionContainer class represents a menu or menu bar in Qt Creator.
\brief The ActionContainer class represents a menu or menu bar in Qt Creator.
*/
/*!
\enum IActionContainer::ContainerType
\enum ActionContainer::ContainerType
*/
/*!
\enum IActionContainer::EmptyAction
\enum ActionContainer::EmptyAction
*/
/*!
\fn virtual IActionContainer::setEmptyAction(EmptyAction ea)
\fn virtual ActionContainer::setEmptyAction(EmptyAction ea)
*/
/*!
\fn virtual int IActionContainer::id() const
\fn virtual int ActionContainer::id() const
*/
/*!
\fn virtual ContainerType IActionContainer::type() const
\fn virtual ContainerType ActionContainer::type() const
*/
/*!
\fn virtual QMenu *IActionContainer::menu() const
\fn virtual QMenu *ActionContainer::menu() const
*/
/*!
\fn virtual QToolBar *IActionContainer::toolBar() const
\fn virtual QToolBar *ActionContainer::toolBar() const
*/
/*!
\fn virtual QMenuBar *IActionContainer::menuBar() const
\fn virtual QMenuBar *ActionContainer::menuBar() const
*/
/*!
\fn virtual QAction *IActionContainer::insertLocation(const QString &group) const
\fn virtual QAction *ActionContainer::insertLocation(const QString &group) const
*/
/*!
\fn virtual void IActionContainer::appendGroup(const QString &group, bool global)
\fn virtual void ActionContainer::appendGroup(const QString &group, bool global)
*/
/*!
\fn virtual void IActionContainer::addAction(Core::ICommand *action, const QString &group)
\fn virtual void ActionContainer::addAction(Core::Command *action, const QString &group)
*/
/*!
\fn virtual void IActionContainer::addMenu(Core::IActionContainer *menu, const QString &group)
\fn virtual void ActionContainer::addMenu(Core::ActionContainer *menu, const QString &group)
*/
/*!
\fn virtual bool IActionContainer::update()
\fn virtual bool ActionContainer::update()
*/
/*!
\fn virtual IActionContainer::~IActionContainer()
\fn virtual ActionContainer::~ActionContainer()
*/
// ---------- ActionContainer ------------
// ---------- ActionContainerPrivate ------------
/*!
\class Core::Internal::ActionContainer
\class Core::Internal::ActionContainerPrivate
\internal
*/
ActionContainer::ActionContainer(int id)
ActionContainerPrivate::ActionContainerPrivate(int id)
: m_data(CS_None), m_id(id)
{
}
void ActionContainer::setEmptyAction(EmptyAction ea)
void ActionContainerPrivate::setEmptyAction(EmptyAction ea)
{
m_data = ((m_data & ~EA_Mask) | ea);
}
bool ActionContainer::hasEmptyAction(EmptyAction ea) const
bool ActionContainerPrivate::hasEmptyAction(EmptyAction ea) const
{
return (m_data & EA_Mask) == ea;
}
void ActionContainer::setState(ContainerState state)
void ActionContainerPrivate::setState(ContainerState state)
{
m_data |= state;
}
bool ActionContainer::hasState(ContainerState state) const
bool ActionContainerPrivate::hasState(ContainerState state) const
{
return (m_data & state);
}
void ActionContainer::appendGroup(const QString &group)
void ActionContainerPrivate::appendGroup(const QString &group)
{
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
int gid = idmanager->uniqueIdentifier(group);
m_groups << gid;
}
QAction *ActionContainer::insertLocation(const QString &group) const
QAction *ActionContainerPrivate::insertLocation(const QString &group) const
{
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
int grpid = idmanager->uniqueIdentifier(group);
@@ -165,22 +164,22 @@ QAction *ActionContainer::insertLocation(const QString &group) const
return beforeAction(pos, &prevKey);
}
void ActionContainer::addAction(ICommand *action, const QString &group)
void ActionContainerPrivate::addAction(Command *action, const QString &group)
{
if (!canAddAction(action))
return;
ActionManagerPrivate *am = ActionManagerPrivate::instance();
Action *a = static_cast<Action *>(action);
if (a->stateFlags() & Command::CS_PreLocation) {
if (a->stateFlags() & CommandPrivate::CS_PreLocation) {
QList<CommandLocation> locs = a->locations();
for (int i=0; i<locs.size(); ++i) {
if (IActionContainer *aci = am->actionContainer(locs.at(i).m_container)) {
ActionContainer *ac = static_cast<ActionContainer *>(aci);
if (ActionContainer *aci = am->actionContainer(locs.at(i).m_container)) {
ActionContainerPrivate *ac = static_cast<ActionContainerPrivate *>(aci);
ac->addAction(action, locs.at(i).m_position, false);
}
}
a->setStateFlags(a->stateFlags() | Command::CS_Initialized);
a->setStateFlags(a->stateFlags() | CommandPrivate::CS_Initialized);
} else {
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
int grpid = idmanager->uniqueIdentifier(Constants::G_DEFAULT_TWO);
@@ -193,21 +192,21 @@ void ActionContainer::addAction(ICommand *action, const QString &group)
}
}
void ActionContainer::addMenu(IActionContainer *menu, const QString &group)
void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &group)
{
ActionContainer *container = static_cast<ActionContainer *>(menu);
ActionContainerPrivate *container = static_cast<ActionContainerPrivate *>(menu);
if (!container->canBeAddedToMenu())
return;
ActionManagerPrivate *am = ActionManagerPrivate::instance();
MenuActionContainer *mc = static_cast<MenuActionContainer *>(menu);
if (mc->hasState(ActionContainer::CS_PreLocation)) {
if (mc->hasState(ActionContainerPrivate::CS_PreLocation)) {
CommandLocation loc = mc->location();
if (IActionContainer *aci = am->actionContainer(loc.m_container)) {
ActionContainer *ac = static_cast<ActionContainer *>(aci);
if (ActionContainer *aci = am->actionContainer(loc.m_container)) {
ActionContainerPrivate *ac = static_cast<ActionContainerPrivate *>(aci);
ac->addMenu(menu, loc.m_position, false);
}
mc->setState(ActionContainer::CS_Initialized);
mc->setState(ActionContainerPrivate::CS_Initialized);
} else {
UniqueIDManager *idmanager = CoreImpl::instance()->uniqueIDManager();
int grpid = idmanager->uniqueIdentifier(Constants::G_DEFAULT_TWO);
@@ -220,34 +219,34 @@ void ActionContainer::addMenu(IActionContainer *menu, const QString &group)
}
}
int ActionContainer::id() const
int ActionContainerPrivate::id() const
{
return m_id;
}
QMenu *ActionContainer::menu() const
QMenu *ActionContainerPrivate::menu() const
{
return 0;
}
QMenuBar *ActionContainer::menuBar() const
QMenuBar *ActionContainerPrivate::menuBar() const
{
return 0;
}
bool ActionContainer::canAddAction(ICommand *action) const
bool ActionContainerPrivate::canAddAction(Command *action) const
{
if (action->type() != ICommand::CT_OverridableAction)
if (action->type() != Command::CT_OverridableAction)
return false;
Command *cmd = static_cast<Command *>(action);
if (cmd->stateFlags() & Command::CS_Initialized)
CommandPrivate *cmd = static_cast<CommandPrivate *>(action);
if (cmd->stateFlags() & CommandPrivate::CS_Initialized)
return false;
return true;
}
void ActionContainer::addAction(ICommand *action, int pos, bool setpos)
void ActionContainerPrivate::addAction(Command *action, int pos, bool setpos)
{
Action *a = static_cast<Action *>(action);
@@ -269,7 +268,7 @@ void ActionContainer::addAction(ICommand *action, int pos, bool setpos)
insertAction(ba, a->action());
}
void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos)
void ActionContainerPrivate::addMenu(ActionContainer *menu, int pos, bool setpos)
{
MenuActionContainer *mc = static_cast<MenuActionContainer *>(menu);
@@ -289,7 +288,7 @@ void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos)
insertMenu(ba, mc->menu());
}
QAction *ActionContainer::beforeAction(int pos, int *prevKey) const
QAction *ActionContainerPrivate::beforeAction(int pos, int *prevKey) const
{
ActionManagerPrivate *am = ActionManagerPrivate::instance();
@@ -310,16 +309,16 @@ QAction *ActionContainer::beforeAction(int pos, int *prevKey) const
if (baId == -1)
return 0;
if (ICommand *cmd = am->command(baId))
if (Command *cmd = am->command(baId))
return cmd->action();
if (IActionContainer *container = am->actionContainer(baId))
if (ActionContainer *container = am->actionContainer(baId))
if (QMenu *menu = container->menu())
return menu->menuAction();
return 0;
}
int ActionContainer::calcPosition(int pos, int prevKey) const
int ActionContainerPrivate::calcPosition(int pos, int prevKey) const
{
int grp = (pos & 0xFFFF0000);
if (prevKey == -1)
@@ -341,7 +340,7 @@ int ActionContainer::calcPosition(int pos, int prevKey) const
*/
MenuActionContainer::MenuActionContainer(int id)
: ActionContainer(id), m_menu(0)
: ActionContainerPrivate(id), m_menu(0)
{
setEmptyAction(EA_Disable);
}
@@ -388,7 +387,7 @@ bool MenuActionContainer::update()
bool hasitems = false;
foreach (IActionContainer *container, subContainers()) {
foreach (ActionContainer *container, subContainers()) {
if (container == this) {
qWarning() << Q_FUNC_INFO << "container" << (this->menu() ? this->menu()->title() : "") << "contains itself as subcontainer";
continue;
@@ -399,7 +398,7 @@ bool MenuActionContainer::update()
}
}
if (!hasitems) {
foreach (ICommand *command, commands()) {
foreach (Command *command, commands()) {
if (command->isActive()) {
hasitems = true;
break;
@@ -417,7 +416,7 @@ bool MenuActionContainer::update()
bool MenuActionContainer::canBeAddedToMenu() const
{
if (hasState(ActionContainer::CS_Initialized))
if (hasState(ActionContainerPrivate::CS_Initialized))
return false;
return true;
@@ -432,7 +431,7 @@ bool MenuActionContainer::canBeAddedToMenu() const
*/
MenuBarActionContainer::MenuBarActionContainer(int id)
: ActionContainer(id), m_menuBar(0)
: ActionContainerPrivate(id), m_menuBar(0)
{
setEmptyAction(EA_None);
}

View File

@@ -34,109 +34,42 @@
#ifndef ACTIONCONTAINER_H
#define ACTIONCONTAINER_H
#include "actionmanager_p.h"
#include <coreplugin/actionmanager/iactioncontainer.h>
#include <coreplugin/actionmanager/icommand.h>
#include <QtCore/QObject>
#include <QtGui/QMenu>
#include <QtGui/QToolBar>
#include <QtGui/QMenuBar>
#include <QtGui/QAction>
namespace Core {
namespace Internal {
class ActionContainer : public Core::IActionContainer
class Command;
class ActionContainer : public QObject
{
public:
enum ContainerState {
CS_None = 0x000000,
CS_Initialized = 0x010000,
CS_PreLocation = 0x020000,
CS_UserDefined = 0x040000
enum EmptyAction {
EA_Mask = 0xFF00,
EA_None = 0x0100,
EA_Hide = 0x0200,
EA_Disable = 0x0300
};
ActionContainer(int id);
virtual void setEmptyAction(EmptyAction ea) = 0;
virtual int id() const = 0;
virtual QMenu *menu() const = 0;
virtual QMenuBar *menuBar() const = 0;
virtual QAction *insertLocation(const QString &group) const = 0;
virtual void appendGroup(const QString &group) = 0;
virtual void addAction(Core::Command *action, const QString &group = QString()) = 0;
virtual void addMenu(Core::ActionContainer *menu, const QString &group = QString()) = 0;
virtual bool update() = 0;
virtual ~ActionContainer() {}
void setEmptyAction(EmptyAction ea);
bool hasEmptyAction(EmptyAction ea) const;
void setState(ContainerState state);
bool hasState(ContainerState state) const;
QAction *insertLocation(const QString &group) const;
void appendGroup(const QString &group);
void addAction(ICommand *action, const QString &group = QString());
void addMenu(IActionContainer *menu, const QString &group = QString());
int id() const;
QMenu *menu() const;
QMenuBar *menuBar() const;
virtual void insertAction(QAction *before, QAction *action) = 0;
virtual void insertMenu(QAction *before, QMenu *menu) = 0;
QList<ICommand *> commands() const { return m_commands; }
QList<IActionContainer *> subContainers() const { return m_subContainers; }
protected:
bool canAddAction(ICommand *action) const;
bool canAddMenu(IActionContainer *menu) const;
virtual bool canBeAddedToMenu() const = 0;
void addAction(ICommand *action, int pos, bool setpos);
void addMenu(IActionContainer *menu, int pos, bool setpos);
private:
QAction *beforeAction(int pos, int *prevKey) const;
int calcPosition(int pos, int prevKey) const;
QList<int> m_groups;
int m_data;
int m_id;
QMap<int, int> m_posmap;
QList<IActionContainer *> m_subContainers;
QList<ICommand *> m_commands;
};
class MenuActionContainer : public ActionContainer
{
public:
MenuActionContainer(int id);
void setMenu(QMenu *menu);
QMenu *menu() const;
void setLocation(const CommandLocation &location);
CommandLocation location() const;
void insertAction(QAction *before, QAction *action);
void insertMenu(QAction *before, QMenu *menu);
bool update();
protected:
bool canBeAddedToMenu() const;
private:
QMenu *m_menu;
CommandLocation m_location;
};
class MenuBarActionContainer : public ActionContainer
{
public:
MenuBarActionContainer(int id);
void setMenuBar(QMenuBar *menuBar);
QMenuBar *menuBar() const;
void insertAction(QAction *before, QAction *action);
void insertMenu(QAction *before, QMenu *menu);
bool update();
protected:
bool canBeAddedToMenu() const;
private:
QMenuBar *m_menuBar;
};
} // namespace Internal
} // namespace Core
#endif // ACTIONCONTAINER_H

View File

@@ -0,0 +1,142 @@
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef ACTIONCONTAINER_P_H
#define ACTIONCONTAINER_P_H
#include "actionmanager_p.h"
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
namespace Core {
namespace Internal {
class ActionContainerPrivate : public Core::ActionContainer
{
public:
enum ContainerState {
CS_None = 0x000000,
CS_Initialized = 0x010000,
CS_PreLocation = 0x020000,
CS_UserDefined = 0x040000
};
ActionContainerPrivate(int id);
virtual ~ActionContainerPrivate() {}
void setEmptyAction(EmptyAction ea);
bool hasEmptyAction(EmptyAction ea) const;
void setState(ContainerState state);
bool hasState(ContainerState state) const;
QAction *insertLocation(const QString &group) const;
void appendGroup(const QString &group);
void addAction(Command *action, const QString &group = QString());
void addMenu(ActionContainer *menu, const QString &group = QString());
int id() const;
QMenu *menu() const;
QMenuBar *menuBar() const;
virtual void insertAction(QAction *before, QAction *action) = 0;
virtual void insertMenu(QAction *before, QMenu *menu) = 0;
QList<Command *> commands() const { return m_commands; }
QList<ActionContainer *> subContainers() const { return m_subContainers; }
protected:
bool canAddAction(Command *action) const;
bool canAddMenu(ActionContainer *menu) const;
virtual bool canBeAddedToMenu() const = 0;
void addAction(Command *action, int pos, bool setpos);
void addMenu(ActionContainer *menu, int pos, bool setpos);
private:
QAction *beforeAction(int pos, int *prevKey) const;
int calcPosition(int pos, int prevKey) const;
QList<int> m_groups;
int m_data;
int m_id;
QMap<int, int> m_posmap;
QList<ActionContainer *> m_subContainers;
QList<Command *> m_commands;
};
class MenuActionContainer : public ActionContainerPrivate
{
public:
MenuActionContainer(int id);
void setMenu(QMenu *menu);
QMenu *menu() const;
void setLocation(const CommandLocation &location);
CommandLocation location() const;
void insertAction(QAction *before, QAction *action);
void insertMenu(QAction *before, QMenu *menu);
bool update();
protected:
bool canBeAddedToMenu() const;
private:
QMenu *m_menu;
CommandLocation m_location;
};
class MenuBarActionContainer : public ActionContainerPrivate
{
public:
MenuBarActionContainer(int id);
void setMenuBar(QMenuBar *menuBar);
QMenuBar *menuBar() const;
void insertAction(QAction *before, QAction *action);
void insertMenu(QAction *before, QMenu *menu);
bool update();
protected:
bool canBeAddedToMenu() const;
private:
QMenuBar *m_menuBar;
};
} // namespace Internal
} // namespace Core
#endif // ACTIONCONTAINER_P_H

View File

@@ -33,8 +33,8 @@
#include "actionmanager_p.h"
#include "mainwindow.h"
#include "actioncontainer.h"
#include "command.h"
#include "actioncontainer_p.h"
#include "command_p.h"
#include "uniqueidmanager.h"
#include <coreplugin/coreconstants.h>
@@ -70,10 +70,10 @@ namespace {
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
of the ICommand class.
The action that is visible to the user is the one returned by ICommand::action().
of the Command class.
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
to use ICommand::action() for this.
to use Command::action() for this.
When this action is invoked by the user,
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()
->getObject<Core::ICore>()->actionManager();
QAction *myAction = new QAction(tr("My Action"), this);
Core::ICommand *cmd = am->registerAction(myAction,
Core::Command *cmd = am->registerAction(myAction,
"myplugin.myaction",
QList<int>() << C_GLOBAL_ID);
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.
a tool button that should represent the action you add the action
from ICommand::action() to it:
from Command::action() to it:
\code
QToolButton *myButton = new QToolButton(someParentWidget);
myButton->setDefaultAction(cmd->action());
@@ -123,33 +123,33 @@ namespace {
\endlist
\sa Core::ICore
\sa Core::ICommand
\sa Core::IActionContainer
\sa Core::Command
\sa Core::ActionContainer
\sa Core::IContext
*/
/*!
\fn IActionContainer *ActionManager::createMenu(const QString &id)
\fn ActionContainer *ActionManager::createMenu(const QString &id)
\brief Creates a new menu with the given string \a id.
Returns a new IActionContainer that you can use to get the QMenu instance
Returns a new ActionContainer that you can use to get the QMenu instance
or to add menu items to the menu. The ActionManager owns
the returned IActionContainer.
the returned ActionContainer.
Add your menu to some other menu or a menu bar via the
ActionManager::actionContainer and IActionContainer::addMenu methods.
ActionManager::actionContainer and ActionContainer::addMenu methods.
*/
/*!
\fn IActionContainer *ActionManager::createMenuBar(const QString &id)
\fn ActionContainer *ActionManager::createMenuBar(const QString &id)
\brief Creates a new menu bar with the given string \a id.
Returns a new IActionContainer that you can use to get the QMenuBar instance
Returns a new ActionContainer that you can use to get the QMenuBar instance
or to add menus to the menu bar. The ActionManager owns
the returned IActionContainer.
the returned ActionContainer.
*/
/*!
\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.
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.
Returns a command object that represents the shortcut in the application and is
@@ -171,15 +171,15 @@ namespace {
*/
/*!
\fn ICommand *ActionManager::command(const QString &id) const
\brief Returns the ICommand object that is known to the system
\fn Command *ActionManager::command(const QString &id) const
\brief Returns the Command object that is known to the system
under the given string \a id.
\sa ActionManager::registerAction()
*/
/*!
\fn IActionContainer *ActionManager::actionContainer(const QString &id) const
\fn ActionContainer *ActionManager::actionContainer(const QString &id) const
\brief Returns the IActionContainter object that is know to the system
under the given string \a id.
@@ -233,12 +233,12 @@ QList<int> ActionManagerPrivate::defaultGroups() const
return m_defaultGroups;
}
QList<Command *> ActionManagerPrivate::commands() const
QList<CommandPrivate *> ActionManagerPrivate::commands() const
{
return m_idCmdMap.values();
}
QList<ActionContainer *> ActionManagerPrivate::containers() const
QList<ActionContainerPrivate *> ActionManagerPrivate::containers() const
{
return m_idContainerMap.values();
}
@@ -272,7 +272,7 @@ bool ActionManagerPrivate::hasContext(QList<int> context) const
return false;
}
IActionContainer *ActionManagerPrivate::createMenu(const QString &id)
ActionContainer *ActionManagerPrivate::createMenu(const QString &id)
{
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
@@ -290,7 +290,7 @@ IActionContainer *ActionManagerPrivate::createMenu(const QString &id)
return mc;
}
IActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
ActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
{
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
@@ -308,22 +308,22 @@ IActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
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;
ICommand *c = registerOverridableAction(action, id, false);
Command *c = registerOverridableAction(action, id, false);
a = static_cast<OverrideableAction *>(c);
if (a)
a->addOverrideAction(action, context);
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;
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
if (Command *c = m_idCmdMap.value(uid, 0)) {
if (c->type() != ICommand::CT_OverridableAction) {
if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
if (c->type() != Command::CT_OverridableAction) {
qWarning() << "registerAction: id" << id << "is registered with a different command type.";
return c;
}
@@ -364,12 +364,12 @@ ICommand *ActionManagerPrivate::registerOverridableAction(QAction *action, const
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;
int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
if (Command *c = m_idCmdMap.value(uid, 0)) {
if (c->type() != ICommand::CT_Shortcut) {
if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
if (c->type() != Command::CT_Shortcut) {
qWarning() << "registerShortcut: id" << id << "is registered with a different command type.";
return c;
}
@@ -401,7 +401,7 @@ ICommand *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStr
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 IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
@@ -413,7 +413,7 @@ ICommand *ActionManagerPrivate::command(const QString &id) const
return it.value();
}
IActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const
ActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const
{
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
@@ -425,7 +425,7 @@ IActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const
return it.value();
}
ICommand *ActionManagerPrivate::command(int uid) const
Command *ActionManagerPrivate::command(int uid) const
{
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
if (it == m_idCmdMap.constEnd()) {
@@ -436,7 +436,7 @@ ICommand *ActionManagerPrivate::command(int uid) const
return it.value();
}
IActionContainer *ActionManagerPrivate::actionContainer(int uid) const
ActionContainer *ActionManagerPrivate::actionContainer(int uid) const
{
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
if (it == m_idContainerMap.constEnd()) {
@@ -461,7 +461,7 @@ void ActionManagerPrivate::initialize()
const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString());
const int id = m_mainWnd->uniqueIDManager()->uniqueIdentifier(sid);
ICommand *cmd = command(id);
Command *cmd = command(id);
if (cmd)
cmd->setKeySequence(key);
}
@@ -476,7 +476,7 @@ void ActionManagerPrivate::saveSettings(QSettings *settings)
const IdCmdMap::const_iterator cmdcend = m_idCmdMap.constEnd();
for (IdCmdMap::const_iterator j = m_idCmdMap.constBegin(); j != cmdcend; ++j) {
const int id = j.key();
Command *cmd = j.value();
CommandPrivate *cmd = j.value();
QKeySequence key = cmd->keySequence();
if (key != cmd->defaultKeySequence()) {
const QString sid = m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(id);

View File

@@ -36,8 +36,8 @@
#include "coreplugin/core_global.h"
#include <coreplugin/actionmanager/iactioncontainer.h>
#include <coreplugin/actionmanager/icommand.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <QtCore/QObject>
#include <QtCore/QList>
@@ -57,14 +57,14 @@ public:
ActionManager(QObject *parent = 0) : QObject(parent) {}
virtual ~ActionManager() {}
virtual IActionContainer *createMenu(const QString &id) = 0;
virtual IActionContainer *createMenuBar(const QString &id) = 0;
virtual ActionContainer *createMenu(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 ICommand *registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context) = 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 ICommand *command(const QString &id) const = 0;
virtual IActionContainer *actionContainer(const QString &id) const = 0;
virtual Command *command(const QString &id) const = 0;
virtual ActionContainer *actionContainer(const QString &id) const = 0;
};
} // namespace Core

View File

@@ -56,9 +56,9 @@ class UniqueIDManager;
namespace Internal {
class ActionContainer;
class ActionContainerPrivate;
class MainWindow;
class Command;
class CommandPrivate;
class ActionManagerPrivate : public Core::ActionManager
{
@@ -74,40 +74,40 @@ public:
void saveSettings(QSettings *settings);
QList<int> defaultGroups() const;
QList<Command *> commands() const;
QList<ActionContainer *> containers() const;
QList<CommandPrivate *> commands() const;
QList<ActionContainerPrivate *> containers() const;
bool hasContext(int context) const;
ICommand *command(int uid) const;
IActionContainer *actionContainer(int uid) const;
Command *command(int uid) const;
ActionContainer *actionContainer(int uid) const;
void initialize();
//ActionManager Interface
IActionContainer *createMenu(const QString &id);
IActionContainer *createMenuBar(const QString &id);
ActionContainer *createMenu(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);
ICommand *registerShortcut(QShortcut *shortcut, const QString &id,
Command *registerShortcut(QShortcut *shortcut, const QString &id,
const QList<int> &context);
Core::ICommand *command(const QString &id) const;
Core::IActionContainer *actionContainer(const QString &id) const;
Core::Command *command(const QString &id) const;
Core::ActionContainer *actionContainer(const QString &id) const;
private:
bool hasContext(QList<int> context) const;
ICommand *registerOverridableAction(QAction *action, const QString &id,
Command *registerOverridableAction(QAction *action, const QString &id,
bool checkUnique);
static ActionManagerPrivate* m_instance;
QList<int> m_defaultGroups;
typedef QHash<int, Command *> IdCmdMap;
typedef QHash<int, CommandPrivate *> IdCmdMap;
IdCmdMap m_idCmdMap;
typedef QHash<int, ActionContainer *> IdContainerMap;
typedef QHash<int, ActionContainerPrivate *> IdContainerMap;
IdContainerMap m_idContainerMap;
// typedef QMap<int, int> GlobalGroupMap;

View File

@@ -35,13 +35,12 @@
#include <QtGui/QAction>
#include <QtGui/QShortcut>
#include "command.h"
#include "command_p.h"
/*!
\class Core::ICommand
\class Core::Command
\mainclass
\ingroup qwb
\inheaderfile icommand.h
\brief The class...
@@ -49,226 +48,167 @@
*/
/*!
\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.
*/
/*!
\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()
*/
using namespace Core::Internal;
/*!
\class Command
\ingroup qwb
\inheaderfile command.h
*/
/*!
\enum Command::CommandState
*/
/*!
\fn Command::Command(CommandType type, int id)
*/
Command::Command(CommandType type, int id)
: m_type(type), m_id(id)
{
}
/*!
\fn virtual Command::~Command()
*/
using namespace Core::Internal;
/*!
...
\class CommandPrivate
\inheaderfile command_p.h
\internal
*/
void Command::setStateFlags(int state)
CommandPrivate::CommandPrivate(CommandType type, int id)
: m_type(type), m_id(id)
{
}
void CommandPrivate::setStateFlags(int state)
{
m_type |= (state & CS_Mask);
}
/*!
...
*/
int Command::stateFlags() const
int CommandPrivate::stateFlags() const
{
return (m_type & CS_Mask);
}
/*!
\fn virtual QString Command::name() const
*/
/*!
...
*/
void Command::setCategory(const QString &name)
void CommandPrivate::setCategory(const QString &name)
{
m_category = name;
}
/*!
...
*/
QString Command::category() const
QString CommandPrivate::category() const
{
if (m_category.isEmpty())
return QObject::tr("Other");
return m_category;
}
/*!
...
*/
void Command::setDefaultKeySequence(const QKeySequence &key)
void CommandPrivate::setDefaultKeySequence(const QKeySequence &key)
{
m_defaultKey = key;
}
/*!
...
*/
QKeySequence Command::defaultKeySequence() const
QKeySequence CommandPrivate::defaultKeySequence() const
{
return m_defaultKey;
}
void Command::setDefaultText(const QString &text)
void CommandPrivate::setDefaultText(const QString &text)
{
m_defaultText = text;
}
QString Command::defaultText() const
QString CommandPrivate::defaultText() const
{
return m_defaultText;
}
/*!
...
*/
int Command::id() const
int CommandPrivate::id() const
{
return m_id;
}
/*!
...
*/
Command::CommandType Command::type() const
CommandPrivate::CommandType CommandPrivate::type() const
{
return (CommandType)(m_type & CT_Mask);
}
/*!
...
*/
QAction *Command::action() const
QAction *CommandPrivate::action() const
{
return 0;
}
/*!
...
*/
QShortcut *Command::shortcut() const
QShortcut *CommandPrivate::shortcut() const
{
return 0;
}
/*!
...
*/
void Command::setAttribute(CommandAttribute attr)
void CommandPrivate::setAttribute(CommandAttribute attr)
{
m_type |= attr;
}
/*!
...
*/
void Command::removeAttribute(CommandAttribute attr)
void CommandPrivate::removeAttribute(CommandAttribute attr)
{
m_type &= ~attr;
}
/*!
...
*/
bool Command::hasAttribute(CommandAttribute attr) const
bool CommandPrivate::hasAttribute(CommandAttribute attr) const
{
return (m_type & attr);
}
QString Command::stringWithAppendedShortcut(const QString &str) const
QString CommandPrivate::stringWithAppendedShortcut(const QString &str) const
{
return QString("%1 <span style=\"color: gray; font-size: small\">%2</span>").arg(str).arg(
keySequence().toString(QKeySequence::NativeText));
}
/*!
\fn virtual bool Command::setCurrentContext(const QList<int> &context) = 0
*/
// ---------- Shortcut ------------
/*!
\class Shortcut
\ingroup qwb
\inheaderfile command.h
*/
/*!
...
*/
Shortcut::Shortcut(int id)
: Command(CT_Shortcut, id), m_shortcut(0)
: CommandPrivate(CT_Shortcut, id), m_shortcut(0)
{
}
@@ -322,7 +262,7 @@ QList<int> Shortcut::context() const
void Shortcut::setDefaultKeySequence(const QKeySequence &key)
{
setKeySequence(key);
Command::setDefaultKeySequence(key);
CommandPrivate::setDefaultKeySequence(key);
}
void Shortcut::setKeySequence(const QKeySequence &key)
@@ -374,14 +314,13 @@ bool Shortcut::isActive() const
/*!
\class Action
\ingroup qwb
\inheaderfile command.h
*/
/*!
...
*/
Action::Action(CommandType type, int id)
: Command(type, id), m_action(0)
: CommandPrivate(type, id), m_action(0)
{
}
@@ -439,7 +378,7 @@ QList<CommandLocation> Action::locations() const
void Action::setDefaultKeySequence(const QKeySequence &key)
{
setKeySequence(key);
Command::setDefaultKeySequence(key);
CommandPrivate::setDefaultKeySequence(key);
}
void Action::setKeySequence(const QKeySequence &key)
@@ -467,7 +406,6 @@ QKeySequence Action::keySequence() const
/*!
\class OverrideableAction
\ingroup qwb
\inheaderfile command.h
*/
/*!

View File

@@ -34,146 +34,61 @@
#ifndef COMMAND_H
#define COMMAND_H
#include "icommand.h"
#include "actionmanager_p.h"
#include <coreplugin/core_global.h>
#include <QtCore/QList>
#include <QtCore/QMultiMap>
#include <QtCore/QPointer>
#include <QtGui/QAction>
#include <QtGui/QShortcut>
#include <QtGui/QKeySequence>
namespace Core {
namespace Internal {
class Command : public Core::ICommand
class CORE_EXPORT Command : public QObject
{
Q_OBJECT
public:
enum CommandState {
CS_PreLocation = 0x020000,
CS_LocationChanged = 0x040000,
CS_Initialized = 0x080000,
CS_Mask = 0xFF0000
enum CommandType {
CT_Shortcut = 0x0001,
CT_OverridableAction = 0x0002,
CT_Mask = 0x00FF
};
Command(CommandType type, int id);
enum CommandAttribute {
CA_Hide = 0x0100,
CA_UpdateText = 0x0200,
CA_UpdateIcon = 0x0400,
CA_NonConfigureable = 0x8000,
CA_Mask = 0xFF00
};
virtual void setDefaultKeySequence(const QKeySequence &key) = 0;
virtual void setKeySequence(const QKeySequence &key) = 0;
virtual QKeySequence defaultKeySequence() const = 0;
virtual QKeySequence keySequence() const = 0;
virtual void setDefaultText(const QString &text) = 0;
virtual QString defaultText() const = 0;
virtual void setCategory(const QString &name) = 0;
virtual int id() const = 0;
virtual CommandType type() const = 0;
virtual QAction *action() const = 0;
virtual QShortcut *shortcut() const = 0;
virtual void setAttribute(CommandAttribute attr) = 0;
virtual void removeAttribute(CommandAttribute attr) = 0;
virtual bool hasAttribute(CommandAttribute attr) const = 0;
virtual bool isActive() const = 0;
virtual ~Command() {}
void setStateFlags(int state);
int stateFlags() const;
virtual QString stringWithAppendedShortcut(const QString &str) const = 0;
virtual QString name() const = 0;
void setCategory(const QString &name);
QString category() const;
void setDefaultKeySequence(const QKeySequence &key);
QKeySequence defaultKeySequence() const;
void setDefaultText(const QString &text);
QString defaultText() const;
int id() const;
CommandType type() const;
QAction *action() const;
QShortcut *shortcut() const;
void setAttribute(CommandAttribute attr);
void removeAttribute(CommandAttribute attr);
bool hasAttribute(CommandAttribute attr) const;
virtual bool setCurrentContext(const QList<int> &context) = 0;
QString stringWithAppendedShortcut(const QString &str) const;
protected:
QString m_category;
int m_type;
int m_id;
QKeySequence m_defaultKey;
QString m_defaultText;
signals:
void keySequenceChanged();
};
class Shortcut : public Command
{
Q_OBJECT
public:
Shortcut(int id);
QString name() const;
void setDefaultKeySequence(const QKeySequence &key);
void setKeySequence(const QKeySequence &key);
QKeySequence keySequence() const;
virtual void setDefaultText(const QString &key);
virtual QString defaultText() const;
void setShortcut(QShortcut *shortcut);
QShortcut *shortcut() const;
void setContext(const QList<int> &context);
QList<int> context() const;
bool setCurrentContext(const QList<int> &context);
bool isActive() const;
private:
QList<int> m_context;
QShortcut *m_shortcut;
QString m_defaultText;
};
class Action : public Command
{
Q_OBJECT
public:
Action(CommandType type, int id);
QString name() const;
void setDefaultKeySequence(const QKeySequence &key);
void setKeySequence(const QKeySequence &key);
QKeySequence keySequence() const;
virtual void setAction(QAction *action);
QAction *action() const;
void setLocations(const QList<CommandLocation> &locations);
QList<CommandLocation> locations() const;
protected:
void updateToolTipWithKeySequence();
QAction *m_action;
QList<CommandLocation> m_locations;
QString m_toolTip;
};
class OverrideableAction : public Action
{
Q_OBJECT
public:
OverrideableAction(int id);
void setAction(QAction *action);
bool setCurrentContext(const QList<int> &context);
void addOverrideAction(QAction *action, const QList<int> &context);
bool isActive() const;
private slots:
void actionChanged();
private:
QPointer<QAction> m_currentAction;
QList<int> m_context;
QMap<int, QPointer<QAction> > m_contextActionMap;
bool m_active;
bool m_contextInitialized;
};
} // namespace Internal
} // namespace Core
#endif // COMMAND_H

View File

@@ -0,0 +1,179 @@
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef COMMAND_P_H
#define COMMAND_P_H
#include "command.h"
#include "actionmanager_p.h"
#include <QtCore/QList>
#include <QtCore/QMultiMap>
#include <QtCore/QPointer>
#include <QtGui/QKeySequence>
namespace Core {
namespace Internal {
class CommandPrivate : public Core::Command
{
Q_OBJECT
public:
enum CommandState {
CS_PreLocation = 0x020000,
CS_LocationChanged = 0x040000,
CS_Initialized = 0x080000,
CS_Mask = 0xFF0000
};
CommandPrivate(CommandType type, int id);
virtual ~CommandPrivate() {}
void setStateFlags(int state);
int stateFlags() const;
virtual QString name() const = 0;
void setCategory(const QString &name);
QString category() const;
void setDefaultKeySequence(const QKeySequence &key);
QKeySequence defaultKeySequence() const;
void setDefaultText(const QString &text);
QString defaultText() const;
int id() const;
CommandType type() const;
QAction *action() const;
QShortcut *shortcut() const;
void setAttribute(CommandAttribute attr);
void removeAttribute(CommandAttribute attr);
bool hasAttribute(CommandAttribute attr) const;
virtual bool setCurrentContext(const QList<int> &context) = 0;
QString stringWithAppendedShortcut(const QString &str) const;
protected:
QString m_category;
int m_type;
int m_id;
QKeySequence m_defaultKey;
QString m_defaultText;
};
class Shortcut : public CommandPrivate
{
Q_OBJECT
public:
Shortcut(int id);
QString name() const;
void setDefaultKeySequence(const QKeySequence &key);
void setKeySequence(const QKeySequence &key);
QKeySequence keySequence() const;
virtual void setDefaultText(const QString &key);
virtual QString defaultText() const;
void setShortcut(QShortcut *shortcut);
QShortcut *shortcut() const;
void setContext(const QList<int> &context);
QList<int> context() const;
bool setCurrentContext(const QList<int> &context);
bool isActive() const;
private:
QList<int> m_context;
QShortcut *m_shortcut;
QString m_defaultText;
};
class Action : public CommandPrivate
{
Q_OBJECT
public:
Action(CommandType type, int id);
QString name() const;
void setDefaultKeySequence(const QKeySequence &key);
void setKeySequence(const QKeySequence &key);
QKeySequence keySequence() const;
virtual void setAction(QAction *action);
QAction *action() const;
void setLocations(const QList<CommandLocation> &locations);
QList<CommandLocation> locations() const;
protected:
void updateToolTipWithKeySequence();
QAction *m_action;
QList<CommandLocation> m_locations;
QString m_toolTip;
};
class OverrideableAction : public Action
{
Q_OBJECT
public:
OverrideableAction(int id);
void setAction(QAction *action);
bool setCurrentContext(const QList<int> &context);
void addOverrideAction(QAction *action, const QList<int> &context);
bool isActive() const;
private slots:
void actionChanged();
private:
QPointer<QAction> m_currentAction;
QList<int> m_context;
QMap<int, QPointer<QAction> > m_contextActionMap;
bool m_active;
bool m_contextInitialized;
};
} // namespace Internal
} // namespace Core
#endif // COMMAND_P_H

View File

@@ -34,7 +34,7 @@
#include "coreimpl.h"
#include "commandsfile.h"
#include "shortcutsettings.h"
#include "command.h"
#include "command_p.h"
#include <coreplugin/uniqueidmanager.h>

View File

@@ -1,75 +0,0 @@
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef IACTIONCONTAINER_H
#define IACTIONCONTAINER_H
#include <QtCore/QObject>
#include <QtGui/QMenu>
#include <QtGui/QToolBar>
#include <QtGui/QMenuBar>
#include <QtGui/QAction>
namespace Core {
class ICommand;
class IActionContainer : public QObject
{
public:
enum EmptyAction {
EA_Mask = 0xFF00,
EA_None = 0x0100,
EA_Hide = 0x0200,
EA_Disable = 0x0300
};
virtual void setEmptyAction(EmptyAction ea) = 0;
virtual int id() const = 0;
virtual QMenu *menu() const = 0;
virtual QMenuBar *menuBar() const = 0;
virtual QAction *insertLocation(const QString &group) const = 0;
virtual void appendGroup(const QString &group) = 0;
virtual void addAction(Core::ICommand *action, const QString &group = QString()) = 0;
virtual void addMenu(Core::IActionContainer *menu, const QString &group = QString()) = 0;
virtual bool update() = 0;
virtual ~IActionContainer() {}
};
} // namespace Core
#endif // IACTIONCONTAINER_H

View File

@@ -1,94 +0,0 @@
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#ifndef ICOMMAND_H
#define ICOMMAND_H
#include <coreplugin/core_global.h>
#include <QtGui/QAction>
#include <QtGui/QShortcut>
#include <QtGui/QKeySequence>
namespace Core {
class CORE_EXPORT ICommand : public QObject
{
Q_OBJECT
public:
enum CommandType {
CT_Shortcut = 0x0001,
CT_OverridableAction = 0x0002,
CT_Mask = 0x00FF
};
enum CommandAttribute {
CA_Hide = 0x0100,
CA_UpdateText = 0x0200,
CA_UpdateIcon = 0x0400,
CA_NonConfigureable = 0x8000,
CA_Mask = 0xFF00
};
virtual void setDefaultKeySequence(const QKeySequence &key) = 0;
virtual void setKeySequence(const QKeySequence &key) = 0;
virtual QKeySequence defaultKeySequence() const = 0;
virtual QKeySequence keySequence() const = 0;
virtual void setDefaultText(const QString &text) = 0;
virtual QString defaultText() const = 0;
virtual void setCategory(const QString &name) = 0;
virtual int id() const = 0;
virtual CommandType type() const = 0;
virtual QAction *action() const = 0;
virtual QShortcut *shortcut() const = 0;
virtual void setAttribute(CommandAttribute attr) = 0;
virtual void removeAttribute(CommandAttribute attr) = 0;
virtual bool hasAttribute(CommandAttribute attr) const = 0;
virtual bool isActive() const = 0;
virtual ~ICommand() {}
virtual QString stringWithAppendedShortcut(const QString &str) const = 0;
signals:
void keySequenceChanged();
};
} // namespace Core
#endif // ICOMMAND_H

View File

@@ -33,7 +33,7 @@
#include "baseview.h"
#include <extensionsystem/ExtensionSystemInterfaces>
#include <QtGui/QWidget>
using namespace Core;

View File

@@ -34,8 +34,6 @@
#ifndef CORECONSTANTS_H
#define CORECONSTANTS_H
#include <extensionsystem/ExtensionSystemInterfaces>
namespace Core {
namespace Constants {

View File

@@ -98,12 +98,12 @@ HEADERS += mainwindow.h \
editormanager/openeditorswindow.h \
editormanager/ieditor.h \
editormanager/ieditorfactory.h \
actionmanager/iactioncontainer.h \
actionmanager/actionmanager.h \
actionmanager/icommand.h \
actionmanager/actionmanager_p.h \
actionmanager/command.h \
actionmanager/actioncontainer.h \
actionmanager/actionmanager.h \
actionmanager/command.h \
actionmanager/actionmanager_p.h \
actionmanager/command_p.h \
actionmanager/actioncontainer_p.h \
actionmanager/commandsfile.h \
dialogs/saveitemsdialog.h \
dialogs/newdialog.h \

View File

@@ -34,14 +34,14 @@
#include "shortcutsettings.h"
#include "ui_shortcutsettings.h"
#include "actionmanager_p.h"
#include "command.h"
#include "command_p.h"
#include "coreconstants.h"
#include "coreimpl.h"
#include "commandsfile.h"
#include "filemanager.h"
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/icommand.h>
#include <coreplugin/actionmanager/command.h>
#include <QtGui/QKeyEvent>
#include <QtGui/QShortcut>
@@ -285,10 +285,10 @@ void ShortcutSettings::initialize()
UniqueIDManager *uidm =
CoreImpl::instance()->uniqueIDManager();
QList<Command *> cmds = m_am->commands();
QList<CommandPrivate *> cmds = m_am->commands();
for (int i = 0; i < cmds.size(); ++i) {
Command *c = cmds.at(i);
if (c->hasAttribute(Command::CA_NonConfigureable))
CommandPrivate *c = cmds.at(i);
if (c->hasAttribute(CommandPrivate::CA_NonConfigureable))
continue;
if (c->action() && c->action()->isSeparator())
continue;
@@ -313,7 +313,7 @@ void ShortcutSettings::initialize()
item->setText(0, uidm->stringForUniqueIdentifier(c->id()));
if (c->action()) {
QString text = c->hasAttribute(Command::CA_UpdateText) && !c->defaultText().isNull() ? c->defaultText() : c->action()->text();
QString text = c->hasAttribute(CommandPrivate::CA_UpdateText) && !c->defaultText().isNull() ? c->defaultText() : c->action()->text();
s->m_key = c->action()->shortcut();
item->setText(1, text);
} else {

View File

@@ -47,17 +47,16 @@ QT_END_NAMESPACE
namespace Core {
class ICommand;
class Command;
namespace Internal {
class ActionManagerPrivate;
class Command;
class MainWindow;
struct ShortcutItem
{
ICommand *m_cmd;
Command *m_cmd;
QKeySequence m_key;
QTreeWidgetItem *m_item;
};

View File

@@ -208,12 +208,12 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
QList<int>() << m_d->m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER);
ActionManager *am = m_d->m_core->actionManager();
IActionContainer *mfile = am->actionContainer(Constants::M_FILE);
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
//Revert to saved
ICommand *cmd = am->registerAction(m_d->m_revertToSavedAction,
Command *cmd = am->registerAction(m_d->m_revertToSavedAction,
Constants::REVERTTOSAVED, editManagerContext);
cmd->setAttribute(ICommand::CA_UpdateText);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("Revert File to Saved"));
mfile->addAction(cmd, Constants::G_FILE_SAVE);
connect(m_d->m_revertToSavedAction, SIGNAL(triggered()), this, SLOT(revertToSaved()));
@@ -227,7 +227,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
connect(m_d->m_saveAsAction, SIGNAL(triggered()), this, SLOT(saveFileAs()));
//Window Menu
IActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
//Window menu separators
QAction *tmpaction = new QAction(this);
@@ -258,7 +258,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
//Close Action
cmd = am->registerAction(m_d->m_closeCurrentEditorAction, Constants::CLOSE, editManagerContext);
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());
mfile->addAction(cmd, Constants::G_FILE_CLOSE);
connect(m_d->m_closeCurrentEditorAction, SIGNAL(triggered()), this, SLOT(closeEditor()));
@@ -315,8 +315,8 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
connect(m_d->m_goForwardAction, SIGNAL(triggered()), this, SLOT(goForwardInNavigationHistory()));
IActionContainer *medit = am->actionContainer(Constants::M_EDIT);
IActionContainer *advancedMenu = am->createMenu(Constants::M_EDIT_ADVANCED);
ActionContainer *medit = am->actionContainer(Constants::M_EDIT);
ActionContainer *advancedMenu = am->createMenu(Constants::M_EDIT_ADVANCED);
medit->addMenu(advancedMenu, Constants::G_EDIT_FORMAT);
advancedMenu->menu()->setTitle(tr("&Advanced"));

View File

@@ -73,8 +73,8 @@ void EditorSplitter::registerActions()
QList<int>() << m_core->uniqueIDManager()->uniqueIdentifier(Constants::C_EDITORMANAGER);
ActionManager *am = m_core->actionManager();
IActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
ICommand *cmd;
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
Command *cmd;
//Horizontal Action
m_horizontalSplitAction = new QAction(tr("Split Left/Right"), this);
@@ -98,7 +98,7 @@ void EditorSplitter::registerActions()
this, SLOT(unsplit()));
//Default Layout menu
IActionContainer *mLayout = am->createMenu("QtCreator.Menu.Window.Layout");
ActionContainer *mLayout = am->createMenu("QtCreator.Menu.Window.Layout");
mwindow->addMenu(mLayout, Constants::G_WINDOW_SPLIT);
mLayout->menu()->setTitle(tr("Default Splitter Layout"));

View File

@@ -186,6 +186,7 @@ MainWindow::MainWindow() :
QCoreApplication::setOrganizationName(QLatin1String("Nokia"));
QSettings::setDefaultFormat(QSettings::IniFormat);
QString baseName = qApp->style()->objectName();
#ifdef Q_WS_X11
if (baseName == "windows") {
// Sometimes we get the standard windows 95 style as a fallback
// e.g. if we are running on a KDE4 desktop
@@ -195,6 +196,7 @@ MainWindow::MainWindow() :
else
baseName = "cleanlooks";
}
#endif
qApp->setStyle(new ManhattanStyle(baseName));
statusBar()->setProperty("p_styled", true);
}
@@ -365,7 +367,7 @@ void MainWindow::registerDefaultContainers()
{
ActionManagerPrivate *am = m_actionManager;
IActionContainer *menubar = am->createMenuBar(Constants::MENU_BAR);
ActionContainer *menubar = am->createMenuBar(Constants::MENU_BAR);
#ifndef Q_WS_MAC // System menu bar on Mac
setMenuBar(menubar->menuBar());
@@ -378,7 +380,7 @@ void MainWindow::registerDefaultContainers()
menubar->appendGroup(Constants::G_HELP);
//File Menu
IActionContainer *filemenu = am->createMenu(Constants::M_FILE);
ActionContainer *filemenu = am->createMenu(Constants::M_FILE);
menubar->addMenu(filemenu, Constants::G_FILE);
filemenu->menu()->setTitle(tr("&File"));
filemenu->appendGroup(Constants::G_FILE_NEW);
@@ -392,7 +394,7 @@ void MainWindow::registerDefaultContainers()
//Edit Menu
IActionContainer *medit = am->createMenu(Constants::M_EDIT);
ActionContainer *medit = am->createMenu(Constants::M_EDIT);
menubar->addMenu(medit, Constants::G_EDIT);
medit->menu()->setTitle(tr("&Edit"));
medit->appendGroup(Constants::G_EDIT_UNDOREDO);
@@ -403,12 +405,12 @@ void MainWindow::registerDefaultContainers()
medit->appendGroup(Constants::G_EDIT_OTHER);
//Tools Menu
IActionContainer *ac = am->createMenu(Constants::M_TOOLS);
ActionContainer *ac = am->createMenu(Constants::M_TOOLS);
menubar->addMenu(ac, Constants::G_TOOLS);
ac->menu()->setTitle(tr("&Tools"));
//Window Menu
IActionContainer *mwindow = am->createMenu(Constants::M_WINDOW);
ActionContainer *mwindow = am->createMenu(Constants::M_WINDOW);
menubar->addMenu(mwindow, Constants::G_WINDOW);
mwindow->menu()->setTitle(tr("&Window"));
mwindow->appendGroup(Constants::G_WINDOW_SIZE);
@@ -428,28 +430,28 @@ void MainWindow::registerDefaultContainers()
ac->appendGroup(Constants::G_HELP_ABOUT);
}
static ICommand *createSeparator(ActionManagerPrivate *am, QObject *parent,
static Command *createSeparator(ActionManagerPrivate *am, QObject *parent,
const QString &name,
const QList<int> &context)
{
QAction *tmpaction = new QAction(parent);
tmpaction->setSeparator(true);
ICommand *cmd = am->registerAction(tmpaction, name, context);
Command *cmd = am->registerAction(tmpaction, name, context);
return cmd;
}
void MainWindow::registerDefaultActions()
{
ActionManagerPrivate *am = m_actionManager;
IActionContainer *mfile = am->actionContainer(Constants::M_FILE);
IActionContainer *medit = am->actionContainer(Constants::M_EDIT);
IActionContainer *mtools = am->actionContainer(Constants::M_TOOLS);
IActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
ActionContainer *mfile = am->actionContainer(Constants::M_FILE);
ActionContainer *medit = am->actionContainer(Constants::M_EDIT);
ActionContainer *mtools = am->actionContainer(Constants::M_TOOLS);
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
Q_UNUSED(mwindow)
IActionContainer *mhelp = am->actionContainer(Constants::M_HELP);
ActionContainer *mhelp = am->actionContainer(Constants::M_HELP);
// 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);
cmd = createSeparator(am, this, QLatin1String("QtCreator.File.Sep.Print"), m_globalContext);
@@ -506,7 +508,7 @@ void MainWindow::registerDefaultActions()
connect(m_openWithAction, SIGNAL(triggered()), this, SLOT(openFileWith()));
//File->Recent Files Menu
IActionContainer *ac = am->createMenu(Constants::M_FILE_RECENTFILES);
ActionContainer *ac = am->createMenu(Constants::M_FILE_RECENTFILES);
mfile->addMenu(ac, Constants::G_FILE_OPEN);
ac->menu()->setTitle(tr("Recent Files"));
@@ -514,7 +516,7 @@ void MainWindow::registerDefaultActions()
QAction *tmpaction = new QAction(QIcon(Constants::ICON_SAVEFILE), tr("&Save"), this);
cmd = am->registerAction(tmpaction, Constants::SAVE, m_globalContext);
cmd->setDefaultKeySequence(QKeySequence::Save);
cmd->setAttribute(ICommand::CA_UpdateText);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Save"));
mfile->addAction(cmd, Constants::G_FILE_SAVE);
@@ -524,7 +526,7 @@ void MainWindow::registerDefaultActions()
#ifdef Q_OS_MAC
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+S")));
#endif
cmd->setAttribute(ICommand::CA_UpdateText);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("Save &As..."));
mfile->addAction(cmd, Constants::G_FILE_SAVE);
@@ -553,7 +555,7 @@ void MainWindow::registerDefaultActions()
tmpaction = new QAction(QIcon(Constants::ICON_UNDO), tr("&Undo"), this);
cmd = am->registerAction(tmpaction, Constants::UNDO, m_globalContext);
cmd->setDefaultKeySequence(QKeySequence::Undo);
cmd->setAttribute(ICommand::CA_UpdateText);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Undo"));
medit->addAction(cmd, Constants::G_EDIT_UNDOREDO);
@@ -561,7 +563,7 @@ void MainWindow::registerDefaultActions()
tmpaction = new QAction(QIcon(Constants::ICON_REDO), tr("&Redo"), this);
cmd = am->registerAction(tmpaction, Constants::REDO, m_globalContext);
cmd->setDefaultKeySequence(QKeySequence::Redo);
cmd->setAttribute(ICommand::CA_UpdateText);
cmd->setAttribute(Command::CA_UpdateText);
cmd->setDefaultText(tr("&Redo"));
medit->addAction(cmd, Constants::G_EDIT_UNDOREDO);
@@ -1056,7 +1058,7 @@ void MainWindow::updateContext()
void MainWindow::aboutToShowRecentFiles()
{
IActionContainer *aci =
ActionContainer *aci =
m_actionManager->actionContainer(Constants::M_FILE_RECENTFILES);
aci->menu()->clear();
m_recentFilesActions.clear();

View File

@@ -40,7 +40,7 @@
#include <aggregation/aggregate.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/coreimpl.h>
#include <coreplugin/imode.h>
@@ -144,7 +144,7 @@ void ModeManager::objectAdded(QObject *obj)
const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->uniqueModeName();
QShortcut *shortcut = new QShortcut(m_mainWindow);
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);
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
@@ -162,7 +162,7 @@ void ModeManager::objectAdded(QObject *obj)
void ModeManager::updateModeToolTip()
{
ICommand *cmd = qobject_cast<ICommand *>(sender());
Command *cmd = qobject_cast<Command *>(sender());
if (cmd) {
int index = m_modeShortcuts.indexOf(cmd);
if (index != -1)
@@ -184,7 +184,7 @@ void ModeManager::aboutToRemoveObject(QObject *obj)
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);

View File

@@ -48,7 +48,7 @@ QT_END_NAMESPACE
namespace Core {
class ICommand;
class Command;
class IMode;
namespace Internal {
@@ -70,7 +70,7 @@ public:
IMode* currentMode() 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);
signals:
@@ -95,9 +95,9 @@ private:
Internal::MainWindow *m_mainWindow;
Internal::FancyTabWidget *m_modeStack;
Internal::FancyActionBar *m_actionBar;
QMap<ICommand*, int> m_actions;
QMap<Command*, int> m_actions;
QVector<IMode*> m_modes;
QVector<ICommand*> m_modeShortcuts;
QVector<Command*> m_modeShortcuts;
QSignalMapper *m_signalMapper;
QList<int> m_addedContexts;
};

View File

@@ -39,7 +39,6 @@
#include <coreplugin/modemanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <extensionsystem/ExtensionSystemInterfaces>
#include <QtGui/QAction>
#include <QtGui/QHBoxLayout>
@@ -323,7 +322,7 @@ void NavigationWidget::objectAdded(QObject * obj)
QString displayName = factory->displayName();
QShortcut *shortcut = new QShortcut(this);
shortcut->setWhatsThis(tr("Activate %1 Pane").arg(displayName));
Core::ICommand *cmd = am->registerShortcut(shortcut,
Core::Command *cmd = am->registerShortcut(shortcut,
displayName + QLatin1String(".FocusShortcut"), navicontext);
cmd->setDefaultKeySequence(factory->activationSequence());
connect(shortcut, SIGNAL(activated()), this, SLOT(activateSubWidget()));
@@ -492,10 +491,10 @@ void NavigationSubWidget::restoreSettings(int position)
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();
QHash<QString, Core::ICommand*>::const_iterator r = commandMap.find(title);
const QHash<QString, Core::Command*> commandMap = m_parentWidget->commandMap();
QHash<QString, Core::Command*>::const_iterator r = commandMap.find(title);
if (r != commandMap.end())
return r.value();
return 0;
@@ -510,7 +509,7 @@ bool NavComboBox::event(QEvent *e)
{
if (e->type() == QEvent::ToolTip) {
QString txt = currentText();
Core::ICommand *cmd = m_navSubWidget->command(txt);
Core::Command *cmd = m_navSubWidget->command(txt);
if (cmd) {
txt = tr("Activate %1").arg(txt);
setToolTip(cmd->stringWithAppendedShortcut(txt));

View File

@@ -50,7 +50,7 @@ namespace Core {
class INavigationWidgetFactory;
class IMode;
class ICommand;
class Command;
namespace Internal {
class NavigationWidget;
@@ -99,7 +99,7 @@ public:
// Called from the place holders
void placeHolderChanged(NavigationWidgetPlaceHolder *holder);
QHash<QString, Core::ICommand*> commandMap() const { return m_commandMap; }
QHash<QString, Core::Command*> commandMap() const { return m_commandMap; }
protected:
void resizeEvent(QResizeEvent *);
@@ -113,7 +113,7 @@ private:
NavigationSubWidget *insertSubItem(int position);
QList<NavigationSubWidget *> m_subWidgets;
QHash<QShortcut *, QString> m_shortcutMap;
QHash<QString, Core::ICommand*> m_commandMap;
QHash<QString, Core::Command*> m_commandMap;
bool m_shown;
bool m_suppressed;
int m_width;
@@ -136,7 +136,7 @@ public:
void saveSettings(int position);
void restoreSettings(int position);
Core::ICommand *command(const QString &title) const;
Core::Command *command(const QString &title) const;
signals:
void split();

View File

@@ -38,7 +38,7 @@
#include "modemanager.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/iactioncontainer.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/editorgroup.h>
@@ -211,10 +211,10 @@ void OutputPane::init(ICore *core, ExtensionSystem::PluginManager *pm)
m_core = core;
ActionManager *am = m_core->actionManager();
IActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
ActionContainer *mwindow = am->actionContainer(Constants::M_WINDOW);
// Window->Output Panes
IActionContainer *mpanes = am->createMenu(Constants::M_WINDOW_PANES);
ActionContainer *mpanes = am->createMenu(Constants::M_WINDOW_PANES);
mwindow->addMenu(mpanes, Constants::G_WINDOW_PANES);
mpanes->menu()->setTitle(tr("Output &Panes"));
@@ -252,7 +252,7 @@ void OutputPane::init(ICore *core, ExtensionSystem::PluginManager *pm)
actionId.remove(QLatin1Char(' '));
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) {
#ifdef Q_OS_MAC
cmd->setDefaultKeySequence(QKeySequence("Ctrl+" + QString::number(shortcutNumber)));

View File

@@ -35,7 +35,6 @@
#include "qworkbench_wrapper.h"
#include "metatypedeclarations.h"
#include <extensionsystem/ExtensionSystemInterfaces>
#include <utils/qtcassert.h>
#include <interface_wrap_helpers.h>
#include <wrap_helpers.h>

View File

@@ -206,12 +206,12 @@ void SideBar::activateItem(SideBarItem *item)
item->widget()->setFocus();
}
void SideBar::setShortcutMap(const QMap<QString, Core::ICommand*> &shortcutMap)
void SideBar::setShortcutMap(const QMap<QString, Core::Command*> &shortcutMap)
{
m_shortcutMap = shortcutMap;
}
QMap<QString, Core::ICommand*> SideBar::shortcutMap() const
QMap<QString, Core::Command*> SideBar::shortcutMap() const
{
return m_shortcutMap;
}
@@ -341,10 +341,10 @@ void SideBarWidget::setCurrentIndex(int)
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();
QMap<QString, Core::ICommand*>::const_iterator r = shortcutMap.find(title);
const QMap<QString, Core::Command*> shortcutMap = m_sideBar->shortcutMap();
QMap<QString, Core::Command*>::const_iterator r = shortcutMap.find(title);
if (r != shortcutMap.end())
return r.value();
return 0;
@@ -361,7 +361,7 @@ bool ComboBox::event(QEvent *e)
{
if (e->type() == QEvent::ToolTip) {
QString txt = currentText();
Core::ICommand *cmd = m_sideBarWidget->command(txt);
Core::Command *cmd = m_sideBarWidget->command(txt);
if (cmd) {
txt = tr("Activate %1").arg(txt);
setToolTip(cmd->stringWithAppendedShortcut(txt));

View File

@@ -50,7 +50,7 @@ QT_END_NAMESPACE
namespace Core {
class ICommand;
class Command;
namespace Internal {
class SideBarWidget;
@@ -110,8 +110,8 @@ public:
void activateItem(SideBarItem *item);
void setShortcutMap(const QMap<QString, Core::ICommand*> &shortcutMap);
QMap<QString, Core::ICommand*> shortcutMap() const;
void setShortcutMap(const QMap<QString, Core::Command*> &shortcutMap);
QMap<QString, Core::Command*> shortcutMap() const;
private slots:
void split();
@@ -126,7 +126,7 @@ private:
QMap<QString, SideBarItem*> m_itemMap;
QStringList m_availableItems;
QStringList m_defaultVisible;
QMap<QString, Core::ICommand*> m_shortcutMap;
QMap<QString, Core::Command*> m_shortcutMap;
};
namespace Internal {
@@ -144,7 +144,7 @@ public:
void updateAvailableItems();
void removeCurrentItem();
Core::ICommand *command(const QString &title) const;
Core::Command *command(const QString &title) const;
signals:
void split();

View File

@@ -39,8 +39,7 @@
#include "iview.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h>
#include <extensionsystem/ExtensionSystemInterfaces>
#include <coreplugin/actionmanager/command.h>
#include <aggregation/aggregate.h>
#include <QtCore/QSettings>

View File

@@ -97,15 +97,15 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
//register actions
Core::ActionManager *actionManager = gCoreInstance->actionManager();
Core::IActionContainer *toolsContainer =
Core::ActionContainer *toolsContainer =
actionManager->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *cpContainer =
Core::ActionContainer *cpContainer =
actionManager->createMenu(QLatin1String("CodePaster"));
cpContainer->menu()->setTitle(tr("&CodePaster"));
toolsContainer->addMenu(cpContainer);
Core::ICommand *command;
Core::Command *command;
m_postAction = new QAction(tr("Paste snippet..."), this);
command = actionManager->registerAction(m_postAction, "CodePaster.post", globalcontext);

View File

@@ -40,8 +40,8 @@
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/icorelistener.h>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <extensionsystem/iplugin.h>
#include <projectexplorer/projectexplorer.h>
#include <QtCore/QObject>

View File

@@ -657,7 +657,7 @@ void CPPEditor::contextMenuEvent(QContextMenuEvent *e)
if (lastAction->menu() && QLatin1String(lastAction->menu()->metaObject()->className()) == QLatin1String("QUnicodeControlCharacterMenu"))
menu->removeAction(lastAction);
Core::IActionContainer *mcontext =
Core::ActionContainer *mcontext =
m_core->actionManager()->actionContainer(CppEditor::Constants::M_CONTEXT);
QMenu *contextMenu = mcontext->menu();

View File

@@ -45,7 +45,7 @@
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/fileiconprovider.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/completionsupport.h>
#include <texteditor/fontsettings.h>
@@ -197,7 +197,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
Core::ActionManager *am = m_core->actionManager();
am->createMenu(CppEditor::Constants::M_CONTEXT);
Core::ICommand *cmd;
Core::Command *cmd;
QAction *jumpToDefinition = new QAction(tr("Follow Symbol under Cursor"), this);
cmd = am->registerAction(jumpToDefinition,

View File

@@ -96,8 +96,8 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *)
addAutoReleasedObject(new CompletionSettingsPage(m_completion));
// Menus
Core::IActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *mcpptools = am->createMenu(CppTools::Constants::M_TOOLS_CPP);
Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS);
Core::ActionContainer *mcpptools = am->createMenu(CppTools::Constants::M_TOOLS_CPP);
QMenu *menu = mcpptools->menu();
menu->setTitle(tr("&C++"));
menu->setEnabled(true);
@@ -108,7 +108,7 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *)
QList<int> context = QList<int>() << m_context;
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));
mcpptools->addAction(command);
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));

View File

@@ -35,7 +35,7 @@
#define CPPTOOLS_H
#include <extensionsystem/iplugin.h>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/projectexplorer.h>
QT_BEGIN_NAMESPACE
class QFileInfo;

View File

@@ -306,13 +306,13 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
connect(m_breakpointMarginAction, SIGNAL(triggered()),
this, SLOT(breakpointMarginActionTriggered()));
//Core::IActionContainer *mcppcontext =
//Core::ActionContainer *mcppcontext =
// am->actionContainer(CppEditor::Constants::M_CONTEXT);
Core::IActionContainer *mdebug =
Core::ActionContainer *mdebug =
am->actionContainer(ProjectExplorer::Constants::M_DEBUG);
Core::ICommand *cmd = 0;
Core::Command *cmd = 0;
cmd = am->registerAction(m_manager->m_startExternalAction,
Constants::STARTEXTERNAL, globalcontext);
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,
Constants::INTERRUPT, globalcontext);
cmd->setAttribute(Core::ICommand::CA_UpdateText);
cmd->setAttribute(Core::ICommand::CA_UpdateIcon);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setAttribute(Core::Command::CA_UpdateIcon);
cmd->setDefaultKeySequence(QKeySequence(Constants::INTERRUPT_KEY));
cmd->setDefaultText(tr("Stop Debugger/Interrupt Debugger"));
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
cmd = am->registerAction(m_manager->m_resetAction,
Constants::RESET, globalcontext);
cmd->setAttribute(Core::ICommand::CA_UpdateText);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setDefaultKeySequence(QKeySequence(Constants::RESET_KEY));
cmd->setDefaultText(tr("Reset Debugger"));
//disabled mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
@@ -450,7 +450,7 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
// Views menu
cmd = am->registerAction(sep, QLatin1String("Debugger.Sep5"), globalcontext);
mdebug->addAction(cmd);
IActionContainer *viewsMenu = am->createMenu(Constants::M_DEBUG_VIEWS);
ActionContainer *viewsMenu = am->createMenu(Constants::M_DEBUG_VIEWS);
QMenu *m = viewsMenu->menu();
m->setEnabled(true);
m->setTitle(tr("&Views"));

View File

@@ -34,7 +34,6 @@
#ifndef FORMEDITORFACTORY_H
#define FORMEDITORFACTORY_H
#include <extensionsystem/ExtensionSystemInterfaces>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <QtCore/QStringList>

View File

@@ -100,7 +100,7 @@ static inline QIcon designerIcon(const QString &iconName)
static inline QAction *createEditModeAction(QActionGroup *ag,
const QList<int> &context,
Core::ActionManager *am,
Core::IActionContainer *medit,
Core::ActionContainer *medit,
const QString &actionName,
const QString &name,
int toolNumber,
@@ -111,10 +111,10 @@ static inline QAction *createEditModeAction(QActionGroup *ag,
rc->setCheckable(true);
if (!iconName.isEmpty())
rc->setIcon(designerIcon(iconName));
Core::ICommand *command = am->registerAction(rc, name, context);
Core::Command *command = am->registerAction(rc, name, context);
if (!keySequence.isEmpty())
command->setDefaultKeySequence(QKeySequence(keySequence));
command->setAttribute(Core::ICommand::CA_Hide);
command->setAttribute(Core::Command::CA_Hide);
medit->addAction(command, Core::Constants::G_EDIT_OTHER);
rc->setData(toolNumber);
ag->addAction(rc);
@@ -126,13 +126,13 @@ static inline QAction *createEditModeAction(QActionGroup *ag,
static inline QAction * createSeparator(QObject *parent,
Core::ActionManager *am,
const QList<int> &context,
Core::IActionContainer *container,
Core::ActionContainer *container,
const QString &name = QString(),
const QString &group = QString())
{
QAction *actSeparator = new QAction(parent);
actSeparator->setSeparator(true);
Core::ICommand *command = am->registerAction(actSeparator, name, context);
Core::Command *command = am->registerAction(actSeparator, name, context);
container->addAction(command, group);
return actSeparator;
}
@@ -142,10 +142,10 @@ static inline void addToolAction(QAction *a,
Core::ActionManager *am,
const QList<int> &context,
const QString &name,
Core::IActionContainer *c1,
Core::ActionContainer *c1,
const QString &keySequence = QString())
{
Core::ICommand *command = am->registerAction(a, name, context);
Core::Command *command = am->registerAction(a, name, context);
if (!keySequence.isEmpty())
command->setDefaultKeySequence(QKeySequence(keySequence));
c1->addAction(command);
@@ -306,15 +306,15 @@ void FormEditorW::deleteInstance()
void FormEditorW::setupActions()
{
Core::ActionManager *am = m_core->actionManager();
Core::ICommand *command;
Core::Command *command;
//menus
Core::IActionContainer *medit =
Core::ActionContainer *medit =
am->actionContainer(Core::Constants::M_EDIT);
Core::IActionContainer *mtools =
Core::ActionContainer *mtools =
am->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *mformtools =
Core::ActionContainer *mformtools =
am->createMenu(M_FORMEDITOR);
mformtools->menu()->setTitle(tr("For&m editor"));
mtools->addMenu(mformtools);
@@ -334,7 +334,7 @@ void FormEditorW::setupActions()
//'delete' action
command = am->registerAction(m_fwm->actionDelete(), QLatin1String("FormEditor.Edit.Delete"), m_context);
command->setDefaultKeySequence(QKeySequence::Delete);
command->setAttribute(Core::ICommand::CA_Hide);
command->setAttribute(Core::Command::CA_Hide);
medit->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
//editor Modes. Store ids for editor tool bars
@@ -446,7 +446,7 @@ QToolBar *FormEditorW::createEditorToolBar() const
Core::ActionManager *am = m_core->actionManager();
const QStringList::const_iterator cend = m_toolActionIds.constEnd();
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);
QAction *action = cmd->action();
if (!action->icon().isNull()) // Simplify grid has no action yet
@@ -457,11 +457,11 @@ QToolBar *FormEditorW::createEditorToolBar() const
return rc;
}
Core::IActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManager *am,
Core::ActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManager *am,
QActionGroup *actionGroup)
{
const QString menuId = QLatin1String(M_FORMEDITOR_PREVIEW);
Core::IActionContainer *menuPreviewStyle = am->createMenu(menuId);
Core::ActionContainer *menuPreviewStyle = am->createMenu(menuId);
menuPreviewStyle->menu()->setTitle(tr("Preview in"));
// The preview menu is a list of invisible actions for the embedded design
@@ -483,10 +483,10 @@ Core::IActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManager
name += dot;
}
name += data.toString();
Core::ICommand *command = am->registerAction(a, name, m_context);
Core::Command *command = am->registerAction(a, name, m_context);
if (isDeviceProfile) {
command->setAttribute(Core::ICommand::CA_UpdateText);
command->setAttribute(Core::ICommand::CA_NonConfigureable);
command->setAttribute(Core::Command::CA_UpdateText);
command->setAttribute(Core::Command::CA_NonConfigureable);
}
menuPreviewStyle->addAction(command);
}

View File

@@ -34,12 +34,12 @@
#ifndef FORMEDITORW_H
#define FORMEDITORW_H
#include <extensionsystem/ExtensionSystemInterfaces>
#include <QtDesigner/QDesignerFormEditorInterface>
#include <QtCore/QObject>
#include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include <QtCore/QStringList>
#include "designerconstants.h"
@@ -66,7 +66,7 @@ QT_END_NAMESPACE
namespace Core {
class ActionManager;
class IActionContainer;
class ActionContainer;
class ICore;
class IEditor;
}
@@ -142,7 +142,7 @@ private:
typedef QList<FormWindowEditor *> EditorList;
void setupActions();
Core::IActionContainer *createPreviewStyleMenu(Core::ActionManager *am,
Core::ActionContainer *createPreviewStyleMenu(Core::ActionManager *am,
QActionGroup *actionGroup);
void critical(const QString &errorMessage);

View File

@@ -165,12 +165,12 @@ bool FakeVimPluginPrivate::initialize(const QStringList &arguments, QString *err
m_installHandlerAction = new QAction(this);
m_installHandlerAction->setText(tr("Set vi-Style Keyboard Action Handler"));
Core::ICommand *cmd = 0;
Core::Command *cmd = 0;
cmd = actionManager->registerAction(m_installHandlerAction,
Constants::INSTALL_HANDLER, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::INSTALL_KEY));
IActionContainer *advancedMenu =
ActionContainer *advancedMenu =
actionManager->actionContainer(Core::Constants::M_EDIT_ADVANCED);
advancedMenu->addAction(cmd);

View File

@@ -39,8 +39,8 @@
#include "searchresultwindow.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/iactioncontainer.h>
#include <coreplugin/actionmanager/icommand.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h>
#include <utils/qtcassert.h>
@@ -127,15 +127,15 @@ void FindPlugin::openFindFilter()
void FindPlugin::setupMenu()
{
Core::ActionManager *am = m_core->actionManager();
Core::IActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
Core::IActionContainer *mfind = am->createMenu(Constants::M_FIND);
Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
Core::ActionContainer *mfind = am->createMenu(Constants::M_FIND);
medit->addMenu(mfind, Core::Constants::G_EDIT_FIND);
mfind->menu()->setTitle(tr("&Find/Replace"));
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::ICommand *cmd;
Core::Command *cmd;
QAction *separator;
separator = new QAction(this);
separator->setSeparator(true);
@@ -152,10 +152,10 @@ void FindPlugin::setupFilterMenuItems()
Core::ActionManager *am = m_core->actionManager();
QList<IFindFilter*> findInterfaces =
ExtensionSystem::PluginManager::instance()->getObjects<IFindFilter>();
Core::ICommand *cmd;
Core::Command *cmd;
QList<int> globalcontext = QList<int>() << Core::Constants::C_GLOBAL_ID;
Core::IActionContainer *mfind = am->actionContainer(Constants::M_FIND);
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
m_filterActions.clear();
foreach (IFindFilter *filter, findInterfaces) {
QAction *action = new QAction(filter->name(), this);

View File

@@ -38,8 +38,8 @@
#include <coreplugin/coreconstants.h>
#include <coreplugin/findplaceholder.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/iactioncontainer.h>
#include <coreplugin/actionmanager/icommand.h>
#include <coreplugin/actionmanager/actioncontainer.h>
#include <coreplugin/actionmanager/command.h>
#include <QtCore/QSettings>
#include <QtGui/QPushButton>
@@ -139,8 +139,8 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
globalcontext << Core::Constants::C_GLOBAL_ID;
Core::ActionManager *am = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->actionManager();
Core::IActionContainer *mfind = am->actionContainer(Constants::M_FIND);
Core::ICommand *cmd;
Core::ActionContainer *mfind = am->actionContainer(Constants::M_FIND);
Core::Command *cmd;
m_findInDocumentAction = new QAction(tr("Current Document"), this);
cmd = am->registerAction(m_findInDocumentAction, Constants::FIND_IN_DOCUMENT, globalcontext);

View File

@@ -213,7 +213,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
Git::Constants::C_GITSUBMITEDITOR
};
static Core::ICommand *createSeparator(Core::ActionManager *am,
static Core::Command *createSeparator(Core::ActionManager *am,
const QList<int> &context,
const QString &id,
QObject *parent)
@@ -265,10 +265,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
//register actions
Core::ActionManager *actionManager = m_core->actionManager();
Core::IActionContainer *toolsContainer =
Core::ActionContainer *toolsContainer =
actionManager->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *gitContainer =
Core::ActionContainer *gitContainer =
actionManager->createMenu(QLatin1String("Git"));
gitContainer->menu()->setTitle(tr("&Git"));
toolsContainer->addMenu(gitContainer);
@@ -277,11 +277,11 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
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);
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")));
connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
gitContainer->addAction(command);
@@ -289,47 +289,47 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_statusAction = new QAction(tr("File Status"), this);
command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext);
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()));
gitContainer->addAction(command);
m_logAction = new QAction(tr("Log File"), this);
command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext);
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()));
gitContainer->addAction(command);
m_blameAction = new QAction(tr("Blame"), this);
command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext);
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()));
gitContainer->addAction(command);
m_undoFileAction = new QAction(tr("Undo Changes"), this);
command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext);
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()));
gitContainer->addAction(command);
m_stageAction = new QAction(tr("Stage file for commit"), this);
command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext);
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()));
gitContainer->addAction(command);
m_unstageAction = new QAction(tr("Unstage file from commit"), this);
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()));
gitContainer->addAction(command);
m_revertAction = new QAction(tr("Revert..."), this);
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()));
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);
command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext);
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()));
gitContainer->addAction(command);
m_statusProjectAction = new QAction(tr("Project status"), this);
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()));
gitContainer->addAction(command);
m_logProjectAction = new QAction(tr("Log project"), this);
command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext);
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()));
gitContainer->addAction(command);
m_undoProjectAction = new QAction(tr("Undo Project Changes"), this);
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()));
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->setToolTip("Saves the current state of your work.");
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()));
gitContainer->addAction(command);
m_pullAction = new QAction(tr("Pull"), this);
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()));
gitContainer->addAction(command);
m_stashPopAction = new QAction(tr("Stash pop"), this);
m_stashAction->setToolTip("Restores changes saved to the stash list using \"Stash\".");
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()));
gitContainer->addAction(command);
m_commitAction = new QAction(tr("Commit..."), this);
command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext);
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()));
gitContainer->addAction(command);
m_pushAction = new QAction(tr("Push"), this);
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()));
gitContainer->addAction(command);
@@ -400,19 +400,19 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_branchListAction = new QAction(tr("Branches..."), this);
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()));
gitContainer->addAction(command);
m_stashListAction = new QAction(tr("List stashes"), this);
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()));
gitContainer->addAction(command);
m_showAction = new QAction(tr("Show commit..."), this);
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()));
gitContainer->addAction(command);

View File

@@ -39,8 +39,8 @@
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/icorelistener.h>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <extensionsystem/iplugin.h>
#include <projectexplorer/projectexplorer.h>
#include <QtCore/QObject>
#include <QtCore/QProcess>
@@ -53,20 +53,20 @@ class QTemporaryFile;
QT_END_NAMESPACE
namespace Core {
class IEditorFactory;
class ICore;
class IVersionControl;
}
class IEditorFactory;
class ICore;
class IVersionControl;
} // namespace Core
namespace Git {
namespace Internal {
class GitPlugin;
class GitClient;
class ChangeSelectionDialog;
class GitSubmitEditor;
struct CommitData;
struct GitSettings;
class GitPlugin;
class GitClient;
class ChangeSelectionDialog;
class GitSubmitEditor;
struct CommitData;
struct GitSettings;
// Just a proxy for GitPlugin
class CoreListener : public Core::ICoreListener
@@ -85,83 +85,83 @@ class GitPlugin : public ExtensionSystem::IPlugin
Q_OBJECT
public:
GitPlugin();
~GitPlugin();
GitPlugin();
~GitPlugin();
static GitPlugin *instance();
bool initialize(const QStringList &arguments
, QString *error_message);
void extensionsInitialized();
bool initialize(const QStringList &arguments, QString *error_message);
void extensionsInitialized();
QString getWorkingDirectory();
QString getWorkingDirectory();
GitOutputWindow *outputWindow() const;
GitOutputWindow *outputWindow() const;
GitSettings settings() const;
GitSettings settings() const;
void setSettings(const GitSettings &s);
public slots:
void updateActions();
bool editorAboutToClose(Core::IEditor *editor);
void updateActions();
bool editorAboutToClose(Core::IEditor *editor);
private slots:
void diffCurrentFile();
void diffCurrentProject();
void submitEditorDiff(const QStringList &unstaged, const QStringList &staged);
void submitCurrentLog();
void statusFile();
void statusProject();
void logFile();
void blameFile();
void logProject();
void undoFileChanges();
void undoProjectChanges();
void stageFile();
void unstageFile();
void revertFile();
void diffCurrentFile();
void diffCurrentProject();
void submitEditorDiff(const QStringList &unstaged, const QStringList &staged);
void submitCurrentLog();
void statusFile();
void statusProject();
void logFile();
void blameFile();
void logProject();
void undoFileChanges();
void undoProjectChanges();
void stageFile();
void unstageFile();
void revertFile();
void showCommit();
void startCommit();
void stash();
void stashPop();
void branchList();
void stashList();
void pull();
void push();
void showCommit();
void startCommit();
void stash();
void stashPop();
void branchList();
void stashList();
void pull();
void push();
private:
QFileInfo currentFile() const;
Core::IEditor *openSubmitEditor(const QString &fileName, const CommitData &cd);
void cleanChangeTmpFile();
QFileInfo currentFile() const;
Core::IEditor *openSubmitEditor(const QString &fileName, const CommitData &cd);
void cleanChangeTmpFile();
static GitPlugin *m_instance;
Core::ICore *m_core;
QAction *m_diffAction;
QAction *m_diffProjectAction;
QAction *m_statusAction;
QAction *m_statusProjectAction;
QAction *m_logAction;
QAction *m_blameAction;
QAction *m_logProjectAction;
QAction *m_undoFileAction;
QAction *m_undoProjectAction;
QAction *m_showAction;
QAction *m_stageAction;
QAction *m_unstageAction;
QAction *m_revertAction;
QAction *m_commitAction;
QAction *m_pullAction;
QAction *m_pushAction;
static GitPlugin *m_instance;
Core::ICore *m_core;
QAction *m_diffAction;
QAction *m_diffProjectAction;
QAction *m_statusAction;
QAction *m_statusProjectAction;
QAction *m_logAction;
QAction *m_blameAction;
QAction *m_logProjectAction;
QAction *m_undoFileAction;
QAction *m_undoProjectAction;
QAction *m_showAction;
QAction *m_stageAction;
QAction *m_unstageAction;
QAction *m_revertAction;
QAction *m_commitAction;
QAction *m_pullAction;
QAction *m_pushAction;
QAction *m_submitCurrentAction;
QAction *m_diffSelectedFilesAction;
QAction *m_undoAction;
QAction *m_redoAction;
QAction *m_stashAction;
QAction *m_stashPopAction;
QAction *m_stashListAction;
QAction *m_branchListAction;
QAction *m_submitCurrentAction;
QAction *m_diffSelectedFilesAction;
QAction *m_undoAction;
QAction *m_redoAction;
QAction *m_stashAction;
QAction *m_stashPopAction;
QAction *m_stashListAction;
QAction *m_branchListAction;
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
GitClient *m_gitClient;

View File

@@ -33,7 +33,7 @@
#include "helloworldplugin.h"
#include <coreplugin/actionmanager/actionmanagerinterface.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/basemode.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icore.h>
@@ -92,12 +92,12 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *error_m
// Register the action with the action manager
Core::ActionManager *actionManager = core->actionManager();
Core::ICommand *command =
Core::Command *command =
actionManager->registerAction(
helloWorldAction, "HelloWorld.HelloWorldAction", context);
// Create our own menu to place in the Tools menu
Core::IActionContainer *helloWorldMenu =
Core::ActionContainer *helloWorldMenu =
actionManager->createMenu("HelloWorld.HelloWorldMenu");
QMenu *menu = helloWorldMenu->menu();
menu->setTitle(tr("&Hello World"));
@@ -107,7 +107,7 @@ bool HelloWorldPlugin::initialize(const QStringList &arguments, QString *error_m
helloWorldMenu->addAction(command);
// Request the Tools menu and add the Hello World menu to it
Core::IActionContainer *toolsMenu =
Core::ActionContainer *toolsMenu =
actionManager->actionContainer(Core::Constants::M_TOOLS);
toolsMenu->addMenu(helloWorldMenu);

View File

@@ -166,7 +166,7 @@ bool HelpPlugin::initialize(const QStringList & /*arguments*/, QString *)
this, SLOT(addBookmark()));
Core::ActionManager *am = m_core->actionManager();
Core::ICommand *cmd;
Core::Command *cmd;
// Add Home, Previous and Next actions (used in the toolbar)
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->setIcon(cmd->action()->icon());
QMap<QString, Core::ICommand*> shortcutMap;
QMap<QString, Core::Command*> shortcutMap;
QShortcut *shortcut = new QShortcut(splitter);
shortcut->setWhatsThis(tr("Activate Index in Help mode"));
cmd = am->registerShortcut(shortcut, QLatin1String("Help.IndexShortcut"), modecontext);

View File

@@ -227,10 +227,10 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
//register actions
Core::ActionManager *am = m_coreInstance->actionManager();
Core::IActionContainer *mtools =
Core::ActionContainer *mtools =
am->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *mperforce =
Core::ActionContainer *mperforce =
am->createMenu(QLatin1String(PERFORCE_MENU));
mperforce->menu()->setTitle(tr("&Perforce"));
mtools->addMenu(mperforce);
@@ -246,12 +246,12 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
perforcesubmitcontext <<
m_coreInstance->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
Core::ICommand *command;
Core::Command *command;
QAction *tmpaction;
m_editAction = new QAction(tr("Edit"), this);
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->setDefaultText(tr("Edit File"));
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);
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->setDefaultText(tr("Add File"));
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);
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"));
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile()));
mperforce->addAction(command);
m_revertAction = new QAction(tr("Revert"), this);
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->setDefaultText(tr("Revert File"));
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);
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"));
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
mperforce->addAction(command);
m_diffProjectAction = new QAction(tr("Diff Current Project/Session"), this);
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->setDefaultText(tr("Diff Current Project/Session"));
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);
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"));
connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
mperforce->addAction(command);
@@ -358,7 +358,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this);
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->setDefaultText(tr("Filelog Current File"));
connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile()));

View File

@@ -39,8 +39,8 @@
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/icorelistener.h>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <extensionsystem/iplugin.h>
#include <projectexplorer/projectexplorer.h>
#ifdef USE_P4_API
#include "workbenchclientuser.h"

View File

@@ -1,44 +0,0 @@
/***************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Qt Software Information (qt-info@nokia.com)
**
**
** Non-Open Source Usage
**
** Licensees may use this file in accordance with the Qt Beta Version
** License Agreement, Agreement version 2.2 provided with the Software or,
** alternatively, in accordance with the terms contained in a written
** agreement between you and Nokia.
**
** GNU General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU General
** Public License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the packaging
** of this file. Please review the following information to ensure GNU
** General Public Licensing requirements will be met:
**
** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
** http://www.gnu.org/copyleft/gpl.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt GPL Exception
** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
**
***************************************************************************/
#include "projectexplorer/buildparserinterface.h"
#include "projectexplorer/projectexplorerconstants.h"
#include "projectexplorer/project.h"
#include "projectexplorer/buildstep.h"
#include "projectexplorer/buildconfiguration.h"
#include "projectexplorer/buildmanager.h"
#include "projectexplorer/projectexplorer.h"
#include "projectexplorer/persistentsettings.h"
#include "projectexplorer/environment.h"
#include "projectexplorer/environmenteditmodel.h"
#include "projectexplorer/abstractprocessstep.h"

View File

@@ -34,10 +34,7 @@
#include "applicationlauncher.h"
#include "consoleprocess.h"
#include <projectexplorer/ProjectExplorerInterfaces>
#include <QtCore/QTimer>
#include <QtDebug>
using namespace ProjectExplorer::Internal;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 194 B

View File

@@ -86,7 +86,7 @@ OutputPane::OutputPane(Core::ICore *core)
m_stopAction->setToolTip(tr("Stop"));
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")));
m_stopButton = new QToolButton;

View File

@@ -233,15 +233,15 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
addAutoReleasedObject(new ProjectFileWizardExtension(m_core));
// context menus
Core::IActionContainer *msessionContextMenu =
Core::ActionContainer *msessionContextMenu =
am->createMenu(Constants::M_SESSIONCONTEXT);
Core::IActionContainer *mproject =
Core::ActionContainer *mproject =
am->createMenu(Constants::M_PROJECTCONTEXT);
Core::IActionContainer *msubProject =
Core::ActionContainer *msubProject =
am->createMenu(Constants::M_SUBPROJECTCONTEXT);
Core::IActionContainer *mfolder =
Core::ActionContainer *mfolder =
am->createMenu(Constants::M_FOLDERCONTEXT);
Core::IActionContainer *mfilec =
Core::ActionContainer *mfilec =
am->createMenu(Constants::M_FILECONTEXT);
m_sessionContextMenu = msessionContextMenu->menu();
@@ -250,22 +250,22 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
m_folderMenu = mfolder->menu();
m_fileMenu = mfilec->menu();
Core::IActionContainer *mfile =
Core::ActionContainer *mfile =
am->actionContainer(Core::Constants::M_FILE);
Core::IActionContainer *menubar =
Core::ActionContainer *menubar =
am->actionContainer(Core::Constants::MENU_BAR);
// mode manager (for fancy actions)
Core::ModeManager *modeManager = m_core->modeManager();
// build menu
Core::IActionContainer *mbuild =
Core::ActionContainer *mbuild =
am->createMenu(Constants::M_BUILDPROJECT);
mbuild->menu()->setTitle("&Build");
menubar->addMenu(mbuild, Core::Constants::G_VIEW);
// debug menu
Core::IActionContainer *mdebug =
Core::ActionContainer *mdebug =
am->createMenu(Constants::M_DEBUG);
mdebug->menu()->setTitle("&Debug");
menubar->addMenu(mdebug, Core::Constants::G_VIEW);
@@ -309,7 +309,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
mfilec->appendGroup(Constants::G_FILE_CONFIG);
// "open with" submenu
Core::IActionContainer * const openWith =
Core::ActionContainer * const openWith =
am->createMenu(ProjectExplorer::Constants::M_OPENFILEWITHCONTEXT);
m_openWithMenu = openWith->menu();
m_openWithMenu->setTitle(tr("Open With"));
@@ -322,7 +322,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
// Separators
//
Core::ICommand *cmd;
Core::Command *cmd;
QAction *sep;
sep = new QAction(this);
@@ -417,7 +417,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
mfilec->addMenu(openWith, ProjectExplorer::Constants::G_FILE_OPEN);
// recent projects menu
Core::IActionContainer *mrecent =
Core::ActionContainer *mrecent =
am->createMenu(Constants::M_RECENTPROJECTS);
mrecent->menu()->setTitle("Recent Projects");
mfile->addMenu(mrecent, Core::Constants::G_FILE_OPEN);
@@ -427,7 +427,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
// unload action
m_unloadAction = new QAction(tr("Unload Project"), this);
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());
mfile->addAction(cmd, Core::Constants::G_FILE_PROJECT);
mproject->addAction(cmd, Constants::G_PROJECT_FILES);
@@ -439,7 +439,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
msessionContextMenu->addAction(cmd, Constants::G_SESSION_FILES);
// session menu
Core::IActionContainer *msession = am->createMenu(Constants::M_SESSION);
Core::ActionContainer *msession = am->createMenu(Constants::M_SESSION);
msession->menu()->setTitle("&Session");
mfile->addMenu(msession, Core::Constants::G_FILE_PROJECT);
m_sessionMenu = msession->menu();
@@ -447,7 +447,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
this, SLOT(updateSessionMenu()));
// build menu
Core::IActionContainer *mbc =
Core::ActionContainer *mbc =
am->createMenu(Constants::BUILDCONFIGURATIONMENU);
m_buildConfigurationMenu = mbc->menu();
m_buildConfigurationMenu->setTitle(tr("Set Build Configuration"));
@@ -523,7 +523,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
mbuild->addAction(cmd, Constants::G_BUILD_RUN);
mproject->addAction(cmd, Constants::G_PROJECT_RUN);
Core::IActionContainer *mrc = am->createMenu(Constants::RUNCONFIGURATIONMENU);
Core::ActionContainer *mrc = am->createMenu(Constants::RUNCONFIGURATIONMENU);
m_runConfigurationMenu = mrc->menu();
m_runConfigurationMenu->setTitle(tr("Set Run Configuration"));
mbuild->addMenu(mrc, Constants::G_BUILD_RUN);
@@ -553,8 +553,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList & /*arguments*/, QStrin
debuggerIcon.addFile(":/gdbdebugger/images/debugger_start.png");
m_debugAction = new QAction(debuggerIcon, tr("Start Debugging"), this);
cmd = am->registerAction(m_debugAction, Constants::DEBUG, globalcontext);
cmd->setAttribute(Core::ICommand::CA_UpdateText);
cmd->setAttribute(Core::ICommand::CA_UpdateIcon);
cmd->setAttribute(Core::Command::CA_UpdateText);
cmd->setAttribute(Core::Command::CA_UpdateIcon);
cmd->setDefaultText(tr("Start Debugging"));
cmd->setDefaultKeySequence(QKeySequence(tr("F5")));
mdebug->addAction(cmd, Core::Constants::G_DEFAULT_ONE);
@@ -1472,7 +1472,7 @@ void ProjectExplorerPlugin::updateRecentProjectMenu()
if (debug)
qDebug() << "ProjectExplorerPlugin::updateRecentProjectMenu";
Core::IActionContainer *aci =
Core::ActionContainer *aci =
m_core->actionManager()->actionContainer(Constants::M_RECENTPROJECTS);
QMenu *menu = aci->menu();
menu->clear();

View File

@@ -34,12 +34,8 @@
#ifndef BUILDPARSERFACTORY_H
#define BUILDPARSERFACTORY_H
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/buildparserinterface.h>
namespace ProjectExplorer {
class BuildParserInterface;
}
namespace Qt4ProjectManager {
namespace Internal {
@@ -66,5 +62,4 @@ public:
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // BUILDPARSERFACTORY_H

View File

@@ -31,13 +31,13 @@
**
***************************************************************************/
#ifndef CE_SDK_HANDLER_INCL
#define CE_SDK_HANDLER_INCL
#ifndef CE_SDK_HANDLER_H
#define CE_SDK_HANDLER_H
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/projectexplorer.h>
#include <QStringList>
#include <QDir>
#include <QtCore/QStringList>
#include <QtCore/QDir>
#define VCINSTALL_MACRO "$(VCInstallDir)"
#define VSINSTALL_MACRO "$(VSInstallDir)"
@@ -105,4 +105,4 @@ inline QString CeSdkHandler::fixPaths(QString path) const
} // namespace Internal
} // namespace Qt4ProjectManager
#endif // CE_SDK_HANDLER_INCL
#endif // CE_SDK_HANDLER_H

View File

@@ -34,7 +34,7 @@
#ifndef DEPLOYHELPER_H
#define DEPLOYHELPER_H
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/buildstep.h>
#include <QtCore/QString>
#include <QtCore/QStringList>

View File

@@ -34,7 +34,7 @@
#ifndef GCCPARSER_H
#define GCCPARSER_H
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/buildparserinterface.h>
#include <QtCore/QRegExp>

View File

@@ -36,7 +36,7 @@
#include "qt4project.h"
#include "qt4projectmanagerconstants.h"
#include <extensionsystem/ExtensionSystemInterfaces>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <QtCore/QDir>

View File

@@ -37,14 +37,13 @@
#include "qtversionmanager.h"
#include "ui_makestep.h"
#include <projectexplorer/ProjectExplorerInterfaces>
#include <QDebug>
#include <projectexplorer/abstractprocessstep.h>
#include <projectexplorer/projectexplorer.h>
namespace Qt4ProjectManager {
class Qt4Project;
// NBS move this class to an own plugin? So that there can be a make project at a future time
class MakeStep : public ProjectExplorer::AbstractProcessStep
{

View File

@@ -33,12 +33,13 @@
#include "msvcenvironment.h"
#include <QSettings>
#include <QFile>
#include <QDebug>
#include <QStringList>
#include <QRegExp>
#include <QTemporaryFile>
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QProcess>
#include <QtCore/QRegExp>
#include <QtCore/QSettings>
#include <QtCore/QStringList>
#include <QtCore/QTemporaryFile>
using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::Environment;

View File

@@ -34,10 +34,10 @@
#ifndef MSVCENVIRONMENT_H
#define MSVCENVIRONMENT_H
#include <QString>
#include <QList>
#include <QtCore/QString>
#include <QtCore/QList>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/projectexplorer.h>
namespace Qt4ProjectManager {
namespace Internal {

View File

@@ -34,7 +34,7 @@
#ifndef MSVCPARSER_H
#define MSVCPARSER_H
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/buildparserinterface.h>
#include <QtCore/QRegExp>
@@ -58,4 +58,4 @@ private:
} // namespace ProjectExplorer
#endif // MsvcParser
#endif // MSVCPARSER_H

View File

@@ -34,10 +34,12 @@
#ifndef QMAKESTEP_H
#define QMAKESTEP_H
#include <projectexplorer/ProjectExplorerInterfaces>
#include "ui_qmakestep.h"
#include <projectexplorer/abstractprocessstep.h>
#include <QStringList>
#include "ui_qmakestep.h"
namespace Qt4ProjectManager {
@@ -46,10 +48,11 @@ class Qt4Project;
class QMakeStep : public ProjectExplorer::AbstractProcessStep
{
Q_OBJECT
public:
QMakeStep(Qt4Project * project);
~QMakeStep();
virtual bool init(const QString & name);
virtual bool init(const QString &name);
virtual void run(QFutureInterface<bool> &);
virtual QString name();
virtual QString displayName();
@@ -58,6 +61,7 @@ public:
QStringList arguments(const QString &buildConfiguration);
void setForced(bool b);
bool forced();
protected:
virtual void processStartupFailed();
virtual bool processFinished(int exitCode, QProcess::ExitStatus status);

View File

@@ -48,7 +48,9 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/vcsmanager.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <utils/listutils.h>
#include <QtCore/QVariant>

View File

@@ -48,7 +48,10 @@
#include "profilereader.h"
#include "gdbmacrosbuildstep.h"
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectnodes.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/mimedatabase.h>
@@ -82,7 +85,7 @@ Qt4ProjectManagerPlugin::~Qt4ProjectManagerPlugin()
delete m_qt4ProjectManager;
}
/*
static Core::ICommand *createSeparator(Core::ActionManager *am,
static Core::Command *createSeparator(Core::ActionManager *am,
QObject *parent,
const QString &name,
const QList<int> &context)
@@ -139,16 +142,16 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList & /*arguments*/, QStr
//addObject(m_embeddedPropertiesPage);
//menus
Core::IActionContainer *mbuild =
Core::ActionContainer *mbuild =
am->actionContainer(ProjectExplorer::Constants::M_BUILDPROJECT);
Core::IActionContainer *mproject =
Core::ActionContainer *mproject =
am->actionContainer(ProjectExplorer::Constants::M_PROJECTCONTEXT);
//register actions
m_projectContext = m_core->uniqueIDManager()->
uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND);
QList<int> context = QList<int>() << m_projectContext;
Core::ICommand *command;
Core::Command *command;
QIcon qmakeIcon(QLatin1String(":/qt4projectmanager/images/run_qmake.png"));
qmakeIcon.addFile(QLatin1String(":/qt4projectmanager/images/run_qmake_small.png"));

View File

@@ -38,7 +38,7 @@
#include <coreplugin/dialogs/ioptionspage.h>
#include <coreplugin/icore.h>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/projectexplorer.h>
#include <QtCore/QDebug>
#include <QtCore/QPointer>

View File

@@ -157,7 +157,7 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e)
{
QMenu *menu = createStandardContextMenu();
if (Core::IActionContainer *mcontext = m_core->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) {
if (Core::ActionContainer *mcontext = m_core->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) {
QMenu *contextMenu = mcontext->menu();
foreach (QAction *action, contextMenu->actions())
menu->addAction(action);

View File

@@ -45,7 +45,7 @@
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)
return 0;
return cmd->action();

View File

@@ -34,7 +34,6 @@
#ifndef RQTSCRIPTEDITORFACTORY_H
#define RQTSCRIPTEDITORFACTORY_H
#include <extensionsystem/ExtensionSystemInterfaces>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <QtCore/QStringList>

View File

@@ -132,11 +132,11 @@ void QtScriptEditorPlugin::initializeEditor(QtScriptEditor::Internal::ScriptEdit
void QtScriptEditorPlugin::registerActions(Core::ICore *core)
{
Core::ActionManager *am = core->actionManager();
Core::IActionContainer *mcontext = am->createMenu(QtScriptEditor::Constants::M_CONTEXT);
Core::ActionContainer *mcontext = am->createMenu(QtScriptEditor::Constants::M_CONTEXT);
QAction *action = new QAction(this);
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);
action = new QAction(tr("Run"), this);

View File

@@ -96,11 +96,11 @@ bool QuickOpenPlugin::initialize(const QStringList &, QString *)
const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow");
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"));
connect(action, SIGNAL(triggered()), this, SLOT(openQuickOpen()));
Core::IActionContainer *mtools = core->actionManager()->actionContainer(Core::Constants::M_TOOLS);
Core::ActionContainer *mtools = core->actionManager()->actionContainer(Core::Constants::M_TOOLS);
mtools->addAction(cmd);
addObject(new QuickOpenManager(m_quickOpenToolWindow));

View File

@@ -34,16 +34,13 @@
#ifndef RRESOURCEEDITORFACTORY_H
#define RRESOURCEEDITORFACTORY_H
#include <extensionsystem/ExtensionSystemInterfaces>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <QtCore/QStringList>
namespace Core {
class ICore;
class IEditor;
class IFile;
}
} // namespace Core
namespace ResourceEditor {
namespace Internal {

View File

@@ -55,7 +55,7 @@
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <projectexplorer/projectexplorer.h>
#include <utils/qtcassert.h>
#include <QtCore/qplugin.h>
@@ -290,9 +290,9 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
//register actions
Core::ActionManager *ami = m_coreInstance->actionManager();
Core::IActionContainer *toolsContainer = ami->actionContainer(M_TOOLS);
Core::ActionContainer *toolsContainer = ami->actionContainer(M_TOOLS);
Core::IActionContainer *subversionMenu =
Core::ActionContainer *subversionMenu =
ami->createMenu(QLatin1String(SUBVERSION_MENU));
subversionMenu->menu()->setTitle(tr("&Subversion"));
toolsContainer->addMenu(subversionMenu);
@@ -304,11 +304,11 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
QList<int> globalcontext;
globalcontext << m_coreInstance->uniqueIDManager()->uniqueIdentifier(C_GLOBAL);
Core::ICommand *command;
Core::Command *command;
m_addAction = new QAction(tr("Add"), this);
command = ami->registerAction(m_addAction, SubversionPlugin::ADD,
globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+A")));
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
subversionMenu->addAction(command);
@@ -316,14 +316,14 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_deleteAction = new QAction(tr("Delete"), this);
command = ami->registerAction(m_deleteAction, SubversionPlugin::DELETE_FILE,
globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile()));
subversionMenu->addAction(command);
m_revertAction = new QAction(tr("Revert"), this);
command = ami->registerAction(m_revertAction, SubversionPlugin::REVERT,
globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
subversionMenu->addAction(command);
@@ -341,7 +341,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_diffCurrentAction = new QAction(tr("Diff Current File"), this);
command = ami->registerAction(m_diffCurrentAction,
SubversionPlugin::DIFF_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+D")));
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
subversionMenu->addAction(command);
@@ -360,7 +360,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_commitCurrentAction = new QAction(tr("Commit Current File"), this);
command = ami->registerAction(m_commitCurrentAction,
SubversionPlugin::COMMIT_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+S,Alt+C")));
connect(m_commitCurrentAction, SIGNAL(triggered()), this, SLOT(startCommitCurrentFile()));
subversionMenu->addAction(command);
@@ -373,7 +373,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this);
command = ami->registerAction(m_filelogCurrentAction,
SubversionPlugin::FILELOG_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_filelogCurrentAction, SIGNAL(triggered()), this,
SLOT(filelogCurrentFile()));
subversionMenu->addAction(command);
@@ -381,7 +381,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments*/, QString *er
m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this);
command = ami->registerAction(m_annotateCurrentAction,
SubversionPlugin::ANNOTATE_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_annotateCurrentAction, SIGNAL(triggered()), this,
SLOT(annotateCurrentFile()));
subversionMenu->addAction(command);

View File

@@ -39,8 +39,8 @@
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/iversioncontrol.h>
#include <coreplugin/icorelistener.h>
#include <extensionsystem/iplugin.h>
#include <coreplugin/icorelistener.h>
#include <extensionsystem/iplugin.h>
#include <QtCore/QObject>
#include <QtCore/QProcess>

View File

@@ -113,11 +113,11 @@ void TextEditorActionHandler::createActions()
Core::ActionManager *am = m_core->actionManager();
Core::IActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
Core::IActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED);
Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
Core::ActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED);
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()));
medit->addAction(command, Core::Constants::G_EDIT_OTHER);

View File

@@ -47,7 +47,7 @@
#include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h>
#include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h>
#include <texteditor/texteditoractionhandler.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"));
// Make sure the shortcut still works when the completion widget is active
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
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Space")));
#else