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

@@ -49,7 +49,9 @@
\list \list
\o \l{A Quick Tour of Qt Creator} \o \l{A Quick Tour of Qt Creator}
\o \l{Creating a Project in Qt Creator} \o \l{Creating a Project in Qt Creator}
\o \l{The Code Editor}
\o \l{Build Settings} \o \l{Build Settings}
\o \l{Qt Version Management}
\o \l{Writing a Simple Program with Qt Creator} \o \l{Writing a Simple Program with Qt Creator}
\o \l{Navigating Quickly Around Your Code with Locator} \o \l{Navigating Quickly Around Your Code with Locator}
\o \l{Debugging with Qt Creator} \o \l{Debugging with Qt Creator}
@@ -206,10 +208,67 @@
are available to help speed up the process of developing your application. are available to help speed up the process of developing your application.
*/ */
/*! \contentspage index.html
\previouspage creator-quick-tour.html
\page creator-code-editor.html
\nextpage creator-build-settings.html
\title The Code Editor
### SCREENSHOT of the editor in action
\table
\row
\i Block navigation
\i To navigate between blocks, e.g., from one \c{\{} to another
\c{\c}}, use \key{Ctrl+[} and \key{Ctrl+]}.
\row
\i Block selection
\i To select a current block, use \key{Ctrl+U}. Pressing
\key{Ctrl+U} again extends the selection to the parent block.
To deselect, use \key{Ctrl+Shift+U}.
\row
\i Moving lines up and down
\i
\row
\i Completion
\i
\row
\i Indenting
\i
\row
\i Commenting or Uncommenting
\i
\endtable
More:
Collapse
Up/Down/Page Up/Page Down - hold ctrl to prevent the cursor from moving
F2 and Shift F2 - follows symbols under the cursor (works for namespaces, classes, methods, variables, includes, macros).
F4 - switch header and source
Ctrl + Scroll wheel -- used to quickly change the font size (handy for presentatiaons)
To switch to an external editor, select \gui{Open in external editor} from
the \gui{Edit -> Advanced} menu.
*/
/*! /*!
\contentspage index.html \contentspage index.html
\previouspage creator-quick-tour.html \previouspage creator-editor-settings.html
\page creator-build-settings.html \page creator-build-settings.html
\nextpage creator-creating-project.html \nextpage creator-creating-project.html
@@ -266,8 +325,15 @@
remove the build step. You will still be able to debug applications, but the remove the build step. You will still be able to debug applications, but the
contents of Qt and STL data types will not be displayed properly. contents of Qt and STL data types will not be displayed properly.
*/
\section1 Qt Version Management /*!
\contentspage index.html
\previouspage creator-build-settings.html
\page creator-version-management.html
\nextpage creator-creating-project.html
\title Qt Version Management
Qt Creator allows you to use multiple versions of Qt installed on your hard Qt Creator allows you to use multiple versions of Qt installed on your hard
disk and switch between them easily. disk and switch between them easily.

View File

@@ -751,6 +751,9 @@ bool Parser::parseCvQualifiers(SpecifierAST *&node)
spec->specifier_token = consumeToken(); spec->specifier_token = consumeToken();
*ast = spec; *ast = spec;
ast = &(*ast)->next; ast = &(*ast)->next;
} else if(LA() == T___ATTRIBUTE__) {
parseAttributeSpecifier(*ast);
ast = &(*ast)->next;
} else { } else {
break; break;
} }

View File

@@ -34,7 +34,6 @@
#ifndef INTERFACE_WRAP_HELPERS_H #ifndef INTERFACE_WRAP_HELPERS_H
#define INTERFACE_WRAP_HELPERS_H #define INTERFACE_WRAP_HELPERS_H
#include <extensionsystem/ExtensionSystemInterfaces>
#include <QtScript/QScriptEngine> #include <QtScript/QScriptEngine>
namespace SharedTools { namespace SharedTools {

View File

@@ -1,39 +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 "extensionsystem/pluginmanager.h"
#include "extensionsystem/pluginspec.h"
#include "extensionsystem/iplugin.h"
#include "extensionsystem/pluginview.h"
#include "extensionsystem/pluginerrorview.h"
#include "extensionsystem/plugindetailsview.h"

View File

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

View File

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

View File

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

View File

@@ -34,109 +34,42 @@
#ifndef ACTIONCONTAINER_H #ifndef ACTIONCONTAINER_H
#define ACTIONCONTAINER_H #define ACTIONCONTAINER_H
#include "actionmanager_p.h" #include <QtCore/QObject>
#include <QtGui/QMenu>
#include <coreplugin/actionmanager/iactioncontainer.h> #include <QtGui/QToolBar>
#include <coreplugin/actionmanager/icommand.h> #include <QtGui/QMenuBar>
#include <QtGui/QAction>
namespace Core { namespace Core {
namespace Internal {
class ActionContainer : public Core::IActionContainer class Command;
class ActionContainer : public QObject
{ {
public: public:
enum ContainerState { enum EmptyAction {
CS_None = 0x000000, EA_Mask = 0xFF00,
CS_Initialized = 0x010000, EA_None = 0x0100,
CS_PreLocation = 0x020000, EA_Hide = 0x0200,
CS_UserDefined = 0x040000 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() {} 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 } // namespace Core
#endif // ACTIONCONTAINER_H #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 "actionmanager_p.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "actioncontainer.h" #include "actioncontainer_p.h"
#include "command.h" #include "command_p.h"
#include "uniqueidmanager.h" #include "uniqueidmanager.h"
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
@@ -70,10 +70,10 @@ namespace {
All actions that are registered with the same string id (but different context lists) All actions that are registered with the same string id (but different context lists)
are considered to be overloads of the same command, represented by an instance are considered to be overloads of the same command, represented by an instance
of the ICommand class. of the Command class.
The action that is visible to the user is the one returned by ICommand::action(). The action that is visible to the user is the one returned by Command::action().
If you provide yourself a user visible representation of your action you need If you provide yourself a user visible representation of your action you need
to use ICommand::action() for this. to use Command::action() for this.
When this action is invoked by the user, When this action is invoked by the user,
the signal is forwarded to the registered action that is valid for the current context. the signal is forwarded to the registered action that is valid for the current context.
@@ -83,7 +83,7 @@ namespace {
Core::ActionManager *am = ExtensionSystem::PluginManager::instance() Core::ActionManager *am = ExtensionSystem::PluginManager::instance()
->getObject<Core::ICore>()->actionManager(); ->getObject<Core::ICore>()->actionManager();
QAction *myAction = new QAction(tr("My Action"), this); QAction *myAction = new QAction(tr("My Action"), this);
Core::ICommand *cmd = am->registerAction(myAction, Core::Command *cmd = am->registerAction(myAction,
"myplugin.myaction", "myplugin.myaction",
QList<int>() << C_GLOBAL_ID); QList<int>() << C_GLOBAL_ID);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u")));
@@ -92,7 +92,7 @@ namespace {
So the \c connect is done to your own QAction instance. If you create e.g. So the \c connect is done to your own QAction instance. If you create e.g.
a tool button that should represent the action you add the action a tool button that should represent the action you add the action
from ICommand::action() to it: from Command::action() to it:
\code \code
QToolButton *myButton = new QToolButton(someParentWidget); QToolButton *myButton = new QToolButton(someParentWidget);
myButton->setDefaultAction(cmd->action()); myButton->setDefaultAction(cmd->action());
@@ -123,33 +123,33 @@ namespace {
\endlist \endlist
\sa Core::ICore \sa Core::ICore
\sa Core::ICommand \sa Core::Command
\sa Core::IActionContainer \sa Core::ActionContainer
\sa Core::IContext \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. \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 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 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. \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 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. \brief Makes an \a action known to the system under the specified string \a id.
Returns a command object that represents the action in the application and is Returns a command object that represents the action in the application and is
@@ -160,7 +160,7 @@ namespace {
*/ */
/*! /*!
\fn ICommand *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context) \fn Command *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
\brief Makes a \a shortcut known to the system under the specified string \a id. \brief Makes a \a shortcut known to the system under the specified string \a id.
Returns a command object that represents the shortcut in the application and is Returns a command object that represents the shortcut in the application and is
@@ -171,15 +171,15 @@ namespace {
*/ */
/*! /*!
\fn ICommand *ActionManager::command(const QString &id) const \fn Command *ActionManager::command(const QString &id) const
\brief Returns the ICommand object that is known to the system \brief Returns the Command object that is known to the system
under the given string \a id. under the given string \a id.
\sa ActionManager::registerAction() \sa ActionManager::registerAction()
*/ */
/*! /*!
\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 \brief Returns the IActionContainter object that is know to the system
under the given string \a id. under the given string \a id.
@@ -233,12 +233,12 @@ QList<int> ActionManagerPrivate::defaultGroups() const
return m_defaultGroups; return m_defaultGroups;
} }
QList<Command *> ActionManagerPrivate::commands() const QList<CommandPrivate *> ActionManagerPrivate::commands() const
{ {
return m_idCmdMap.values(); return m_idCmdMap.values();
} }
QList<ActionContainer *> ActionManagerPrivate::containers() const QList<ActionContainerPrivate *> ActionManagerPrivate::containers() const
{ {
return m_idContainerMap.values(); return m_idContainerMap.values();
} }
@@ -272,7 +272,7 @@ bool ActionManagerPrivate::hasContext(QList<int> context) const
return false; return false;
} }
IActionContainer *ActionManagerPrivate::createMenu(const QString &id) ActionContainer *ActionManagerPrivate::createMenu(const QString &id)
{ {
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
@@ -290,7 +290,7 @@ IActionContainer *ActionManagerPrivate::createMenu(const QString &id)
return mc; return mc;
} }
IActionContainer *ActionManagerPrivate::createMenuBar(const QString &id) ActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
{ {
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
@@ -308,22 +308,22 @@ IActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
return mbc; return mbc;
} }
ICommand *ActionManagerPrivate::registerAction(QAction *action, const QString &id, const QList<int> &context) Command *ActionManagerPrivate::registerAction(QAction *action, const QString &id, const QList<int> &context)
{ {
OverrideableAction *a = 0; OverrideableAction *a = 0;
ICommand *c = registerOverridableAction(action, id, false); Command *c = registerOverridableAction(action, id, false);
a = static_cast<OverrideableAction *>(c); a = static_cast<OverrideableAction *>(c);
if (a) if (a)
a->addOverrideAction(action, context); a->addOverrideAction(action, context);
return a; return a;
} }
ICommand *ActionManagerPrivate::registerOverridableAction(QAction *action, const QString &id, bool checkUnique) Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const QString &id, bool checkUnique)
{ {
OverrideableAction *a = 0; OverrideableAction *a = 0;
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
if (Command *c = m_idCmdMap.value(uid, 0)) { if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
if (c->type() != ICommand::CT_OverridableAction) { if (c->type() != Command::CT_OverridableAction) {
qWarning() << "registerAction: id" << id << "is registered with a different command type."; qWarning() << "registerAction: id" << id << "is registered with a different command type.";
return c; return c;
} }
@@ -364,12 +364,12 @@ ICommand *ActionManagerPrivate::registerOverridableAction(QAction *action, const
return a; return a;
} }
ICommand *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context) Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
{ {
Shortcut *sc = 0; Shortcut *sc = 0;
int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
if (Command *c = m_idCmdMap.value(uid, 0)) { if (CommandPrivate *c = m_idCmdMap.value(uid, 0)) {
if (c->type() != ICommand::CT_Shortcut) { if (c->type() != Command::CT_Shortcut) {
qWarning() << "registerShortcut: id" << id << "is registered with a different command type."; qWarning() << "registerShortcut: id" << id << "is registered with a different command type.";
return c; return c;
} }
@@ -401,7 +401,7 @@ ICommand *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStr
return sc; return sc;
} }
ICommand *ActionManagerPrivate::command(const QString &id) const Command *ActionManagerPrivate::command(const QString &id) const
{ {
const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id); const int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid); const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
@@ -413,7 +413,7 @@ ICommand *ActionManagerPrivate::command(const QString &id) const
return it.value(); 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 int uid = m_mainWnd->uniqueIDManager()->uniqueIdentifier(id);
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
@@ -425,7 +425,7 @@ IActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const
return it.value(); return it.value();
} }
ICommand *ActionManagerPrivate::command(int uid) const Command *ActionManagerPrivate::command(int uid) const
{ {
const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid); const IdCmdMap::const_iterator it = m_idCmdMap.constFind(uid);
if (it == m_idCmdMap.constEnd()) { if (it == m_idCmdMap.constEnd()) {
@@ -436,7 +436,7 @@ ICommand *ActionManagerPrivate::command(int uid) const
return it.value(); return it.value();
} }
IActionContainer *ActionManagerPrivate::actionContainer(int uid) const ActionContainer *ActionManagerPrivate::actionContainer(int uid) const
{ {
const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid); const IdContainerMap::const_iterator it = m_idContainerMap.constFind(uid);
if (it == m_idContainerMap.constEnd()) { if (it == m_idContainerMap.constEnd()) {
@@ -461,7 +461,7 @@ void ActionManagerPrivate::initialize()
const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString()); const QKeySequence key(settings->value(QLatin1String(sequenceKey)).toString());
const int id = m_mainWnd->uniqueIDManager()->uniqueIdentifier(sid); const int id = m_mainWnd->uniqueIDManager()->uniqueIdentifier(sid);
ICommand *cmd = command(id); Command *cmd = command(id);
if (cmd) if (cmd)
cmd->setKeySequence(key); cmd->setKeySequence(key);
} }
@@ -476,7 +476,7 @@ void ActionManagerPrivate::saveSettings(QSettings *settings)
const IdCmdMap::const_iterator cmdcend = m_idCmdMap.constEnd(); const IdCmdMap::const_iterator cmdcend = m_idCmdMap.constEnd();
for (IdCmdMap::const_iterator j = m_idCmdMap.constBegin(); j != cmdcend; ++j) { for (IdCmdMap::const_iterator j = m_idCmdMap.constBegin(); j != cmdcend; ++j) {
const int id = j.key(); const int id = j.key();
Command *cmd = j.value(); CommandPrivate *cmd = j.value();
QKeySequence key = cmd->keySequence(); QKeySequence key = cmd->keySequence();
if (key != cmd->defaultKeySequence()) { if (key != cmd->defaultKeySequence()) {
const QString sid = m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(id); const QString sid = m_mainWnd->uniqueIDManager()->stringForUniqueIdentifier(id);

View File

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

View File

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

View File

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

View File

@@ -34,146 +34,61 @@
#ifndef COMMAND_H #ifndef COMMAND_H
#define COMMAND_H #define COMMAND_H
#include "icommand.h" #include <coreplugin/core_global.h>
#include "actionmanager_p.h"
#include <QtCore/QList> #include <QtGui/QAction>
#include <QtCore/QMultiMap> #include <QtGui/QShortcut>
#include <QtCore/QPointer>
#include <QtGui/QKeySequence> #include <QtGui/QKeySequence>
namespace Core { namespace Core {
namespace Internal {
class Command : public Core::ICommand class CORE_EXPORT Command : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
enum CommandState { enum CommandType {
CS_PreLocation = 0x020000, CT_Shortcut = 0x0001,
CS_LocationChanged = 0x040000, CT_OverridableAction = 0x0002,
CS_Initialized = 0x080000, CT_Mask = 0x00FF
CS_Mask = 0xFF0000
}; };
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() {} virtual ~Command() {}
void setStateFlags(int state); virtual QString stringWithAppendedShortcut(const QString &str) const = 0;
int stateFlags() const;
virtual QString name() const = 0; signals:
void keySequenceChanged();
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 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 } // namespace Core
#endif // COMMAND_H #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 "coreimpl.h"
#include "commandsfile.h" #include "commandsfile.h"
#include "shortcutsettings.h" #include "shortcutsettings.h"
#include "command.h" #include "command_p.h"
#include <coreplugin/uniqueidmanager.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 "baseview.h"
#include <extensionsystem/ExtensionSystemInterfaces> #include <QtGui/QWidget>
using namespace Core; using namespace Core;

View File

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

View File

@@ -98,12 +98,12 @@ HEADERS += mainwindow.h \
editormanager/openeditorswindow.h \ editormanager/openeditorswindow.h \
editormanager/ieditor.h \ editormanager/ieditor.h \
editormanager/ieditorfactory.h \ editormanager/ieditorfactory.h \
actionmanager/iactioncontainer.h \
actionmanager/actionmanager.h \
actionmanager/icommand.h \
actionmanager/actionmanager_p.h \
actionmanager/command.h \
actionmanager/actioncontainer.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 \ actionmanager/commandsfile.h \
dialogs/saveitemsdialog.h \ dialogs/saveitemsdialog.h \
dialogs/newdialog.h \ dialogs/newdialog.h \

View File

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

View File

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

View File

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

View File

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

View File

@@ -40,7 +40,7 @@
#include <aggregation/aggregate.h> #include <aggregation/aggregate.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreconstants.h> #include <coreplugin/coreconstants.h>
#include <coreplugin/coreimpl.h> #include <coreplugin/coreimpl.h>
#include <coreplugin/imode.h> #include <coreplugin/imode.h>
@@ -144,7 +144,7 @@ void ModeManager::objectAdded(QObject *obj)
const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->uniqueModeName(); const QString shortcutId = QLatin1String("QtCreator.Mode.") + mode->uniqueModeName();
QShortcut *shortcut = new QShortcut(m_mainWindow); QShortcut *shortcut = new QShortcut(m_mainWindow);
shortcut->setWhatsThis(tr("Switch to %1 mode").arg(mode->name())); shortcut->setWhatsThis(tr("Switch to %1 mode").arg(mode->name()));
ICommand *cmd = am->registerShortcut(shortcut, shortcutId, QList<int>() << Constants::C_GLOBAL_ID); Command *cmd = am->registerShortcut(shortcut, shortcutId, QList<int>() << Constants::C_GLOBAL_ID);
m_modeShortcuts.insert(index, cmd); m_modeShortcuts.insert(index, cmd);
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip())); connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
@@ -162,7 +162,7 @@ void ModeManager::objectAdded(QObject *obj)
void ModeManager::updateModeToolTip() void ModeManager::updateModeToolTip()
{ {
ICommand *cmd = qobject_cast<ICommand *>(sender()); Command *cmd = qobject_cast<Command *>(sender());
if (cmd) { if (cmd) {
int index = m_modeShortcuts.indexOf(cmd); int index = m_modeShortcuts.indexOf(cmd);
if (index != -1) if (index != -1)
@@ -184,7 +184,7 @@ void ModeManager::aboutToRemoveObject(QObject *obj)
m_mainWindow->removeContextObject(mode); m_mainWindow->removeContextObject(mode);
} }
void ModeManager::addAction(ICommand *command, int priority, QMenu *menu) void ModeManager::addAction(Command *command, int priority, QMenu *menu)
{ {
m_actions.insert(command, priority); m_actions.insert(command, priority);

View File

@@ -48,7 +48,7 @@ QT_END_NAMESPACE
namespace Core { namespace Core {
class ICommand; class Command;
class IMode; class IMode;
namespace Internal { namespace Internal {
@@ -70,7 +70,7 @@ public:
IMode* currentMode() const; IMode* currentMode() const;
IMode* mode(const QString &id) const; IMode* mode(const QString &id) const;
void addAction(ICommand *command, int priority, QMenu *menu = 0); void addAction(Command *command, int priority, QMenu *menu = 0);
void addWidget(QWidget *widget); void addWidget(QWidget *widget);
signals: signals:
@@ -95,9 +95,9 @@ private:
Internal::MainWindow *m_mainWindow; Internal::MainWindow *m_mainWindow;
Internal::FancyTabWidget *m_modeStack; Internal::FancyTabWidget *m_modeStack;
Internal::FancyActionBar *m_actionBar; Internal::FancyActionBar *m_actionBar;
QMap<ICommand*, int> m_actions; QMap<Command*, int> m_actions;
QVector<IMode*> m_modes; QVector<IMode*> m_modes;
QVector<ICommand*> m_modeShortcuts; QVector<Command*> m_modeShortcuts;
QSignalMapper *m_signalMapper; QSignalMapper *m_signalMapper;
QList<int> m_addedContexts; QList<int> m_addedContexts;
}; };

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -96,8 +96,8 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *)
addAutoReleasedObject(new CompletionSettingsPage(m_completion)); addAutoReleasedObject(new CompletionSettingsPage(m_completion));
// Menus // Menus
Core::IActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *mcpptools = am->createMenu(CppTools::Constants::M_TOOLS_CPP); Core::ActionContainer *mcpptools = am->createMenu(CppTools::Constants::M_TOOLS_CPP);
QMenu *menu = mcpptools->menu(); QMenu *menu = mcpptools->menu();
menu->setTitle(tr("&C++")); menu->setTitle(tr("&C++"));
menu->setEnabled(true); menu->setEnabled(true);
@@ -108,7 +108,7 @@ bool CppToolsPlugin::initialize(const QStringList & /*arguments*/, QString *)
QList<int> context = QList<int>() << m_context; QList<int> context = QList<int>() << m_context;
QAction *switchAction = new QAction(tr("Switch Header/Source"), this); QAction *switchAction = new QAction(tr("Switch Header/Source"), this);
Core::ICommand *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context); Core::Command *command = am->registerAction(switchAction, Constants::SWITCH_HEADER_SOURCE, context);
command->setDefaultKeySequence(QKeySequence(Qt::Key_F4)); command->setDefaultKeySequence(QKeySequence(Qt::Key_F4));
mcpptools->addAction(command); mcpptools->addAction(command);
connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource())); connect(switchAction, SIGNAL(triggered()), this, SLOT(switchHeaderSource()));

View File

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

View File

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

View File

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

View File

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

View File

@@ -34,12 +34,12 @@
#ifndef FORMEDITORW_H #ifndef FORMEDITORW_H
#define FORMEDITORW_H #define FORMEDITORW_H
#include <extensionsystem/ExtensionSystemInterfaces>
#include <QtDesigner/QDesignerFormEditorInterface> #include <QtDesigner/QDesignerFormEditorInterface>
#include <QtCore/QObject>
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QObject>
#include <QtCore/QPointer> #include <QtCore/QPointer>
#include <QtCore/QStringList>
#include "designerconstants.h" #include "designerconstants.h"
@@ -66,7 +66,7 @@ QT_END_NAMESPACE
namespace Core { namespace Core {
class ActionManager; class ActionManager;
class IActionContainer; class ActionContainer;
class ICore; class ICore;
class IEditor; class IEditor;
} }
@@ -142,7 +142,7 @@ private:
typedef QList<FormWindowEditor *> EditorList; typedef QList<FormWindowEditor *> EditorList;
void setupActions(); void setupActions();
Core::IActionContainer *createPreviewStyleMenu(Core::ActionManager *am, Core::ActionContainer *createPreviewStyleMenu(Core::ActionManager *am,
QActionGroup *actionGroup); QActionGroup *actionGroup);
void critical(const QString &errorMessage); 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 = new QAction(this);
m_installHandlerAction->setText(tr("Set vi-Style Keyboard Action Handler")); m_installHandlerAction->setText(tr("Set vi-Style Keyboard Action Handler"));
Core::ICommand *cmd = 0; Core::Command *cmd = 0;
cmd = actionManager->registerAction(m_installHandlerAction, cmd = actionManager->registerAction(m_installHandlerAction,
Constants::INSTALL_HANDLER, globalcontext); Constants::INSTALL_HANDLER, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(Constants::INSTALL_KEY)); cmd->setDefaultKeySequence(QKeySequence(Constants::INSTALL_KEY));
IActionContainer *advancedMenu = ActionContainer *advancedMenu =
actionManager->actionContainer(Core::Constants::M_EDIT_ADVANCED); actionManager->actionContainer(Core::Constants::M_EDIT_ADVANCED);
advancedMenu->addAction(cmd); advancedMenu->addAction(cmd);

View File

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

View File

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

View File

@@ -213,7 +213,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
Git::Constants::C_GITSUBMITEDITOR Git::Constants::C_GITSUBMITEDITOR
}; };
static Core::ICommand *createSeparator(Core::ActionManager *am, static Core::Command *createSeparator(Core::ActionManager *am,
const QList<int> &context, const QList<int> &context,
const QString &id, const QString &id,
QObject *parent) QObject *parent)
@@ -265,10 +265,10 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
//register actions //register actions
Core::ActionManager *actionManager = m_core->actionManager(); Core::ActionManager *actionManager = m_core->actionManager();
Core::IActionContainer *toolsContainer = Core::ActionContainer *toolsContainer =
actionManager->actionContainer(Core::Constants::M_TOOLS); actionManager->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *gitContainer = Core::ActionContainer *gitContainer =
actionManager->createMenu(QLatin1String("Git")); actionManager->createMenu(QLatin1String("Git"));
gitContainer->menu()->setTitle(tr("&Git")); gitContainer->menu()->setTitle(tr("&Git"));
toolsContainer->addMenu(gitContainer); 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))); connect(m_versionControl, SIGNAL(enabledChanged(bool)), ma, SLOT(setVisible(bool)));
} }
Core::ICommand *command; Core::Command *command;
m_diffAction = new QAction(tr("Diff current file"), this); m_diffAction = new QAction(tr("Diff current file"), this);
command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext); command = actionManager->registerAction(m_diffAction, "Git.Diff", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+D")));
connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -289,47 +289,47 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_statusAction = new QAction(tr("File Status"), this); m_statusAction = new QAction(tr("File Status"), this);
command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext); command = actionManager->registerAction(m_statusAction, "Git.Status", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+S")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile())); connect(m_statusAction, SIGNAL(triggered()), this, SLOT(statusFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_logAction = new QAction(tr("Log File"), this); m_logAction = new QAction(tr("Log File"), this);
command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext); command = actionManager->registerAction(m_logAction, "Git.Log", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+L")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile())); connect(m_logAction, SIGNAL(triggered()), this, SLOT(logFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_blameAction = new QAction(tr("Blame"), this); m_blameAction = new QAction(tr("Blame"), this);
command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext); command = actionManager->registerAction(m_blameAction, "Git.Blame", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+B")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile())); connect(m_blameAction, SIGNAL(triggered()), this, SLOT(blameFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_undoFileAction = new QAction(tr("Undo Changes"), this); m_undoFileAction = new QAction(tr("Undo Changes"), this);
command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext); command = actionManager->registerAction(m_undoFileAction, "Git.Undo", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+U")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges())); connect(m_undoFileAction, SIGNAL(triggered()), this, SLOT(undoFileChanges()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_stageAction = new QAction(tr("Stage file for commit"), this); m_stageAction = new QAction(tr("Stage file for commit"), this);
command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext); command = actionManager->registerAction(m_stageAction, "Git.Stage", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+A")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile())); connect(m_stageAction, SIGNAL(triggered()), this, SLOT(stageFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_unstageAction = new QAction(tr("Unstage file from commit"), this); m_unstageAction = new QAction(tr("Unstage file from commit"), this);
command = actionManager->registerAction(m_unstageAction, "Git.Unstage", globalcontext); command = actionManager->registerAction(m_unstageAction, "Git.Unstage", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_unstageAction, SIGNAL(triggered()), this, SLOT(unstageFile())); connect(m_unstageAction, SIGNAL(triggered()), this, SLOT(unstageFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_revertAction = new QAction(tr("Revert..."), this); m_revertAction = new QAction(tr("Revert..."), this);
command = actionManager->registerAction(m_revertAction, "Git.Revert", globalcontext); command = actionManager->registerAction(m_revertAction, "Git.Revert", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertFile())); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertFile()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -338,26 +338,26 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_diffProjectAction = new QAction(tr("Diff current project"), this); m_diffProjectAction = new QAction(tr("Diff current project"), this);
command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext); command = actionManager->registerAction(m_diffProjectAction, "Git.DiffProject", globalcontext);
command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D")); command->setDefaultKeySequence(QKeySequence("Alt+G,Alt+Shift+D"));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject())); connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_statusProjectAction = new QAction(tr("Project status"), this); m_statusProjectAction = new QAction(tr("Project status"), this);
command = actionManager->registerAction(m_statusProjectAction, "Git.StatusProject", globalcontext); command = actionManager->registerAction(m_statusProjectAction, "Git.StatusProject", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(statusProject())); connect(m_statusProjectAction, SIGNAL(triggered()), this, SLOT(statusProject()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_logProjectAction = new QAction(tr("Log project"), this); m_logProjectAction = new QAction(tr("Log project"), this);
command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext); command = actionManager->registerAction(m_logProjectAction, "Git.LogProject", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+K")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject())); connect(m_logProjectAction, SIGNAL(triggered()), this, SLOT(logProject()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_undoProjectAction = new QAction(tr("Undo Project Changes"), this); m_undoProjectAction = new QAction(tr("Undo Project Changes"), this);
command = actionManager->registerAction(m_undoProjectAction, "Git.UndoProject", globalcontext); command = actionManager->registerAction(m_undoProjectAction, "Git.UndoProject", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_undoProjectAction, SIGNAL(triggered()), this, SLOT(undoProjectChanges())); connect(m_undoProjectAction, SIGNAL(triggered()), this, SLOT(undoProjectChanges()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -366,33 +366,33 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_stashAction = new QAction(tr("Stash"), this); m_stashAction = new QAction(tr("Stash"), this);
m_stashAction->setToolTip("Saves the current state of your work."); m_stashAction->setToolTip("Saves the current state of your work.");
command = actionManager->registerAction(m_stashAction, "Git.Stash", globalcontext); command = actionManager->registerAction(m_stashAction, "Git.Stash", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stashAction, SIGNAL(triggered()), this, SLOT(stash())); connect(m_stashAction, SIGNAL(triggered()), this, SLOT(stash()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_pullAction = new QAction(tr("Pull"), this); m_pullAction = new QAction(tr("Pull"), this);
command = actionManager->registerAction(m_pullAction, "Git.Pull", globalcontext); command = actionManager->registerAction(m_pullAction, "Git.Pull", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_pullAction, SIGNAL(triggered()), this, SLOT(pull())); connect(m_pullAction, SIGNAL(triggered()), this, SLOT(pull()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_stashPopAction = new QAction(tr("Stash pop"), this); m_stashPopAction = new QAction(tr("Stash pop"), this);
m_stashAction->setToolTip("Restores changes saved to the stash list using \"Stash\"."); m_stashAction->setToolTip("Restores changes saved to the stash list using \"Stash\".");
command = actionManager->registerAction(m_stashPopAction, "Git.StashPop", globalcontext); command = actionManager->registerAction(m_stashPopAction, "Git.StashPop", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stashPopAction, SIGNAL(triggered()), this, SLOT(stashPop())); connect(m_stashPopAction, SIGNAL(triggered()), this, SLOT(stashPop()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_commitAction = new QAction(tr("Commit..."), this); m_commitAction = new QAction(tr("Commit..."), this);
command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext); command = actionManager->registerAction(m_commitAction, "Git.Commit", globalcontext);
command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+G,Alt+C")));
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit())); connect(m_commitAction, SIGNAL(triggered()), this, SLOT(startCommit()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_pushAction = new QAction(tr("Push"), this); m_pushAction = new QAction(tr("Push"), this);
command = actionManager->registerAction(m_pushAction, "Git.Push", globalcontext); command = actionManager->registerAction(m_pushAction, "Git.Push", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_pushAction, SIGNAL(triggered()), this, SLOT(push())); connect(m_pushAction, SIGNAL(triggered()), this, SLOT(push()));
gitContainer->addAction(command); gitContainer->addAction(command);
@@ -400,19 +400,19 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *error_message)
m_branchListAction = new QAction(tr("Branches..."), this); m_branchListAction = new QAction(tr("Branches..."), this);
command = actionManager->registerAction(m_branchListAction, "Git.BranchList", globalcontext); command = actionManager->registerAction(m_branchListAction, "Git.BranchList", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_branchListAction, SIGNAL(triggered()), this, SLOT(branchList())); connect(m_branchListAction, SIGNAL(triggered()), this, SLOT(branchList()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_stashListAction = new QAction(tr("List stashes"), this); m_stashListAction = new QAction(tr("List stashes"), this);
command = actionManager->registerAction(m_stashListAction, "Git.StashList", globalcontext); command = actionManager->registerAction(m_stashListAction, "Git.StashList", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_stashListAction, SIGNAL(triggered()), this, SLOT(stashList())); connect(m_stashListAction, SIGNAL(triggered()), this, SLOT(stashList()));
gitContainer->addAction(command); gitContainer->addAction(command);
m_showAction = new QAction(tr("Show commit..."), this); m_showAction = new QAction(tr("Show commit..."), this);
command = actionManager->registerAction(m_showAction, "Git.ShowCommit", globalcontext); command = actionManager->registerAction(m_showAction, "Git.ShowCommit", globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
connect(m_showAction, SIGNAL(triggered()), this, SLOT(showCommit())); connect(m_showAction, SIGNAL(triggered()), this, SLOT(showCommit()));
gitContainer->addAction(command); gitContainer->addAction(command);

View File

@@ -39,8 +39,8 @@
#include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/icorelistener.h> #include <coreplugin/icorelistener.h>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <projectexplorer/projectexplorer.h>
#include <QtCore/QObject> #include <QtCore/QObject>
#include <QtCore/QProcess> #include <QtCore/QProcess>
@@ -56,7 +56,7 @@ namespace Core {
class IEditorFactory; class IEditorFactory;
class ICore; class ICore;
class IVersionControl; class IVersionControl;
} } // namespace Core
namespace Git { namespace Git {
namespace Internal { namespace Internal {
@@ -87,10 +87,10 @@ class GitPlugin : public ExtensionSystem::IPlugin
public: public:
GitPlugin(); GitPlugin();
~GitPlugin(); ~GitPlugin();
static GitPlugin *instance(); static GitPlugin *instance();
bool initialize(const QStringList &arguments bool initialize(const QStringList &arguments, QString *error_message);
, QString *error_message);
void extensionsInitialized(); void extensionsInitialized();
QString getWorkingDirectory(); QString getWorkingDirectory();

View File

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

View File

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

View File

@@ -227,10 +227,10 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
//register actions //register actions
Core::ActionManager *am = m_coreInstance->actionManager(); Core::ActionManager *am = m_coreInstance->actionManager();
Core::IActionContainer *mtools = Core::ActionContainer *mtools =
am->actionContainer(Core::Constants::M_TOOLS); am->actionContainer(Core::Constants::M_TOOLS);
Core::IActionContainer *mperforce = Core::ActionContainer *mperforce =
am->createMenu(QLatin1String(PERFORCE_MENU)); am->createMenu(QLatin1String(PERFORCE_MENU));
mperforce->menu()->setTitle(tr("&Perforce")); mperforce->menu()->setTitle(tr("&Perforce"));
mtools->addMenu(mperforce); mtools->addMenu(mperforce);
@@ -246,12 +246,12 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
perforcesubmitcontext << perforcesubmitcontext <<
m_coreInstance->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR); m_coreInstance->uniqueIDManager()->uniqueIdentifier(Constants::C_PERFORCESUBMITEDITOR);
Core::ICommand *command; Core::Command *command;
QAction *tmpaction; QAction *tmpaction;
m_editAction = new QAction(tr("Edit"), this); m_editAction = new QAction(tr("Edit"), this);
command = am->registerAction(m_editAction, PerforcePlugin::EDIT, globalcontext); command = am->registerAction(m_editAction, PerforcePlugin::EDIT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+E")));
command->setDefaultText(tr("Edit File")); command->setDefaultText(tr("Edit File"));
connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile())); connect(m_editAction, SIGNAL(triggered()), this, SLOT(openCurrentFile()));
@@ -259,7 +259,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_addAction = new QAction(tr("Add"), this); m_addAction = new QAction(tr("Add"), this);
command = am->registerAction(m_addAction, PerforcePlugin::ADD, globalcontext); command = am->registerAction(m_addAction, PerforcePlugin::ADD, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+A")));
command->setDefaultText(tr("Add File")); command->setDefaultText(tr("Add File"));
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile())); connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
@@ -267,14 +267,14 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_deleteAction = new QAction(tr("Delete"), this); m_deleteAction = new QAction(tr("Delete"), this);
command = am->registerAction(m_deleteAction, PerforcePlugin::DELETE_FILE, globalcontext); command = am->registerAction(m_deleteAction, PerforcePlugin::DELETE_FILE, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Delete File")); command->setDefaultText(tr("Delete File"));
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile())); connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(deleteCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
m_revertAction = new QAction(tr("Revert"), this); m_revertAction = new QAction(tr("Revert"), this);
command = am->registerAction(m_revertAction, PerforcePlugin::REVERT, globalcontext); command = am->registerAction(m_revertAction, PerforcePlugin::REVERT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+R")));
command->setDefaultText(tr("Revert File")); command->setDefaultText(tr("Revert File"));
connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile())); connect(m_revertAction, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
@@ -287,14 +287,14 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_diffCurrentAction = new QAction(tr("Diff Current File"), this); m_diffCurrentAction = new QAction(tr("Diff Current File"), this);
command = am->registerAction(m_diffCurrentAction, PerforcePlugin::DIFF_CURRENT, globalcontext); command = am->registerAction(m_diffCurrentAction, PerforcePlugin::DIFF_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Diff Current File")); command->setDefaultText(tr("Diff Current File"));
connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile())); connect(m_diffCurrentAction, SIGNAL(triggered()), this, SLOT(diffCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
m_diffProjectAction = new QAction(tr("Diff Current Project/Session"), this); m_diffProjectAction = new QAction(tr("Diff Current Project/Session"), this);
command = am->registerAction(m_diffProjectAction, PerforcePlugin::DIFF_PROJECT, globalcontext); command = am->registerAction(m_diffProjectAction, PerforcePlugin::DIFF_PROJECT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+D")));
command->setDefaultText(tr("Diff Current Project/Session")); command->setDefaultText(tr("Diff Current Project/Session"));
connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject())); connect(m_diffProjectAction, SIGNAL(triggered()), this, SLOT(diffCurrentProject()));
@@ -346,7 +346,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this); m_annotateCurrentAction = new QAction(tr("Annotate Current File"), this);
command = am->registerAction(m_annotateCurrentAction, PerforcePlugin::ANNOTATE_CURRENT, globalcontext); command = am->registerAction(m_annotateCurrentAction, PerforcePlugin::ANNOTATE_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultText(tr("Annotate Current File")); command->setDefaultText(tr("Annotate Current File"));
connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile())); connect(m_annotateCurrentAction, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
mperforce->addAction(command); mperforce->addAction(command);
@@ -358,7 +358,7 @@ bool PerforcePlugin::initialize(const QStringList & /*arguments*/, QString *erro
m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this); m_filelogCurrentAction = new QAction(tr("Filelog Current File"), this);
command = am->registerAction(m_filelogCurrentAction, PerforcePlugin::FILELOG_CURRENT, globalcontext); command = am->registerAction(m_filelogCurrentAction, PerforcePlugin::FILELOG_CURRENT, globalcontext);
command->setAttribute(Core::ICommand::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F"))); command->setDefaultKeySequence(QKeySequence(tr("Alt+P,Alt+F")));
command->setDefaultText(tr("Filelog Current File")); command->setDefaultText(tr("Filelog Current File"));
connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile())); connect(m_filelogCurrentAction, SIGNAL(triggered()), this, SLOT(filelogCurrentFile()));

View File

@@ -39,8 +39,8 @@
#include <coreplugin/editormanager/ieditorfactory.h> #include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/iversioncontrol.h> #include <coreplugin/iversioncontrol.h>
#include <coreplugin/icorelistener.h> #include <coreplugin/icorelistener.h>
#include <projectexplorer/ProjectExplorerInterfaces>
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
#include <projectexplorer/projectexplorer.h>
#ifdef USE_P4_API #ifdef USE_P4_API
#include "workbenchclientuser.h" #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 "applicationlauncher.h"
#include "consoleprocess.h" #include "consoleprocess.h"
#include <projectexplorer/ProjectExplorerInterfaces>
#include <QtCore/QTimer> #include <QtCore/QTimer>
#include <QtDebug>
using namespace ProjectExplorer::Internal; 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->setToolTip(tr("Stop"));
m_stopAction->setEnabled(false); m_stopAction->setEnabled(false);
Core::ICommand *cmd = am->registerAction(m_stopAction, Constants::STOP, globalcontext); Core::Command *cmd = am->registerAction(m_stopAction, Constants::STOP, globalcontext);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R"))); cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+R")));
m_stopButton = new QToolButton; m_stopButton = new QToolButton;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -157,7 +157,7 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e)
{ {
QMenu *menu = createStandardContextMenu(); 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(); QMenu *contextMenu = mcontext->menu();
foreach (QAction *action, contextMenu->actions()) foreach (QAction *action, contextMenu->actions())
menu->addAction(action); menu->addAction(action);

View File

@@ -45,7 +45,7 @@
static QAction *actionFromId(Core::ICore *core, const QString &id) static QAction *actionFromId(Core::ICore *core, const QString &id)
{ {
Core::ICommand *cmd = core->actionManager()->command(id); Core::Command *cmd = core->actionManager()->command(id);
if (!cmd) if (!cmd)
return 0; return 0;
return cmd->action(); return cmd->action();

View File

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

View File

@@ -132,11 +132,11 @@ void QtScriptEditorPlugin::initializeEditor(QtScriptEditor::Internal::ScriptEdit
void QtScriptEditorPlugin::registerActions(Core::ICore *core) void QtScriptEditorPlugin::registerActions(Core::ICore *core)
{ {
Core::ActionManager *am = core->actionManager(); 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); QAction *action = new QAction(this);
action->setSeparator(true); action->setSeparator(true);
Core::ICommand *cmd = am->registerAction(action, QtScriptEditor::Constants::RUN_SEP, m_scriptcontext); Core::Command *cmd = am->registerAction(action, QtScriptEditor::Constants::RUN_SEP, m_scriptcontext);
mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE); mcontext->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
action = new QAction(tr("Run"), this); action = new QAction(tr("Run"), this);

View File

@@ -96,11 +96,11 @@ bool QuickOpenPlugin::initialize(const QStringList &, QString *)
const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow"); const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow");
QAction *action = new QAction(m_quickOpenToolWindow->windowIcon(), m_quickOpenToolWindow->windowTitle(), this); QAction *action = new QAction(m_quickOpenToolWindow->windowIcon(), m_quickOpenToolWindow->windowTitle(), this);
Core::ICommand *cmd = core->actionManager()->registerAction(action, actionId, QList<int>() << Core::Constants::C_GLOBAL_ID); Core::Command *cmd = core->actionManager()->registerAction(action, actionId, QList<int>() << Core::Constants::C_GLOBAL_ID);
cmd->setDefaultKeySequence(QKeySequence("Ctrl+K")); cmd->setDefaultKeySequence(QKeySequence("Ctrl+K"));
connect(action, SIGNAL(triggered()), this, SLOT(openQuickOpen())); connect(action, SIGNAL(triggered()), this, SLOT(openQuickOpen()));
Core::IActionContainer *mtools = core->actionManager()->actionContainer(Core::Constants::M_TOOLS); Core::ActionContainer *mtools = core->actionManager()->actionContainer(Core::Constants::M_TOOLS);
mtools->addAction(cmd); mtools->addAction(cmd);
addObject(new QuickOpenManager(m_quickOpenToolWindow)); addObject(new QuickOpenManager(m_quickOpenToolWindow));

View File

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

View File

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

View File

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

View File

@@ -113,11 +113,11 @@ void TextEditorActionHandler::createActions()
Core::ActionManager *am = m_core->actionManager(); Core::ActionManager *am = m_core->actionManager();
Core::IActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT); Core::ActionContainer *medit = am->actionContainer(Core::Constants::M_EDIT);
Core::IActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED); Core::ActionContainer *advancedMenu = am->actionContainer(Core::Constants::M_EDIT_ADVANCED);
m_selectEncodingAction = new QAction(tr("Select Encoding..."), this); m_selectEncodingAction = new QAction(tr("Select Encoding..."), this);
Core::ICommand *command = am->registerAction(m_selectEncodingAction, Constants::SELECT_ENCODING, m_contextId); Core::Command *command = am->registerAction(m_selectEncodingAction, Constants::SELECT_ENCODING, m_contextId);
connect(m_selectEncodingAction, SIGNAL(triggered()), this, SLOT(selectEncoding())); connect(m_selectEncodingAction, SIGNAL(triggered()), this, SLOT(selectEncoding()));
medit->addAction(command, Core::Constants::G_EDIT_OTHER); medit->addAction(command, Core::Constants::G_EDIT_OTHER);

View File

@@ -47,7 +47,7 @@
#include <coreplugin/mimedatabase.h> #include <coreplugin/mimedatabase.h>
#include <coreplugin/uniqueidmanager.h> #include <coreplugin/uniqueidmanager.h>
#include <coreplugin/actionmanager/actionmanager.h> #include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/icommand.h> #include <coreplugin/actionmanager/command.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <texteditor/texteditoractionhandler.h> #include <texteditor/texteditoractionhandler.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
@@ -127,7 +127,7 @@ bool TextEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
completionShortcut->setWhatsThis(tr("Triggers a completion in this scope")); completionShortcut->setWhatsThis(tr("Triggers a completion in this scope"));
// Make sure the shortcut still works when the completion widget is active // Make sure the shortcut still works when the completion widget is active
completionShortcut->setContext(Qt::ApplicationShortcut); completionShortcut->setContext(Qt::ApplicationShortcut);
Core::ICommand *command = am->registerShortcut(completionShortcut, Constants::COMPLETE_THIS, context); Core::Command *command = am->registerShortcut(completionShortcut, Constants::COMPLETE_THIS, context);
#ifndef Q_OS_MAC #ifndef Q_OS_MAC
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Space"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Space")));
#else #else

View File

@@ -1,5 +1,4 @@
load(qttest_p4) load(qttest_p4)
include(../shared/shared.pri) include(../shared/shared.pri)
QT = core QT = core
SOURCES += tst_ast.cpp SOURCES += tst_ast.cpp

View File

@@ -36,6 +36,9 @@ public:
{ return parse(source, TranslationUnit::ParseStatement); } { return parse(source, TranslationUnit::ParseStatement); }
private slots: private slots:
// declarations
void gcc_attributes_1();
// expressions // expressions
void simple_name(); void simple_name();
void template_id(); void template_id();
@@ -54,6 +57,13 @@ private slots:
void objc_protocol_definition_1(); void objc_protocol_definition_1();
}; };
void tst_AST::gcc_attributes_1()
{
QSharedPointer<TranslationUnit> unit(parseDeclaration("\n"
"static inline void *__attribute__((__always_inline__)) _mm_malloc(size_t size, size_t align);"
));
}
void tst_AST::simple_name() void tst_AST::simple_name()
{ {
QSharedPointer<TranslationUnit> unit(parseExpression("a")); QSharedPointer<TranslationUnit> unit(parseExpression("a"));

View File

@@ -5,3 +5,4 @@
#define __asm__(a...) #define __asm__(a...)
#define restrict #define restrict
#define __restrict #define __restrict
#define __weak