Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
fbfcc9a4
Commit
fbfcc9a4
authored
Jan 14, 2009
by
con
Browse files
Fixes: - ICommand --> Command
Details: - Naming convention
parent
d9f97aa1
Changes
45
Hide whitespace changes
Inline
Side-by-side
src/plugins/bookmarks/bookmarksplugin.cpp
View file @
fbfcc9a4
...
...
@@ -87,7 +87,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
//Toggle
m_toggleAction
=
new
QAction
(
tr
(
"Toggle Bookmark"
),
this
);
Core
::
I
Command
*
cmd
=
Core
::
Command
*
cmd
=
am
->
registerAction
(
m_toggleAction
,
BOOKMARKS_TOGGLE_ACTION
,
textcontext
);
#ifndef Q_OS_MAC
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+M"
)));
...
...
src/plugins/coreplugin/actionmanager/actioncontainer.cpp
View file @
fbfcc9a4
...
...
@@ -100,7 +100,7 @@ using namespace Core::Internal;
*/
/*!
\fn virtual void ActionContainer::addAction(Core::
I
Command *action, const QString &group)
\fn virtual void ActionContainer::addAction(Core::Command *action, const QString &group)
*/
/*!
...
...
@@ -164,7 +164,7 @@ QAction *ActionContainerPrivate::insertLocation(const QString &group) const
return
beforeAction
(
pos
,
&
prevKey
);
}
void
ActionContainerPrivate
::
addAction
(
I
Command
*
action
,
const
QString
&
group
)
void
ActionContainerPrivate
::
addAction
(
Command
*
action
,
const
QString
&
group
)
{
if
(
!
canAddAction
(
action
))
return
;
...
...
@@ -234,9 +234,9 @@ QMenuBar *ActionContainerPrivate::menuBar() const
return
0
;
}
bool
ActionContainerPrivate
::
canAddAction
(
I
Command
*
action
)
const
bool
ActionContainerPrivate
::
canAddAction
(
Command
*
action
)
const
{
if
(
action
->
type
()
!=
I
Command
::
CT_OverridableAction
)
if
(
action
->
type
()
!=
Command
::
CT_OverridableAction
)
return
false
;
CommandPrivate
*
cmd
=
static_cast
<
CommandPrivate
*>
(
action
);
...
...
@@ -246,7 +246,7 @@ bool ActionContainerPrivate::canAddAction(ICommand *action) const
return
true
;
}
void
ActionContainerPrivate
::
addAction
(
I
Command
*
action
,
int
pos
,
bool
setpos
)
void
ActionContainerPrivate
::
addAction
(
Command
*
action
,
int
pos
,
bool
setpos
)
{
Action
*
a
=
static_cast
<
Action
*>
(
action
);
...
...
@@ -309,7 +309,7 @@ QAction *ActionContainerPrivate::beforeAction(int pos, int *prevKey) const
if
(
baId
==
-
1
)
return
0
;
if
(
I
Command
*
cmd
=
am
->
command
(
baId
))
if
(
Command
*
cmd
=
am
->
command
(
baId
))
return
cmd
->
action
();
if
(
ActionContainer
*
container
=
am
->
actionContainer
(
baId
))
if
(
QMenu
*
menu
=
container
->
menu
())
...
...
@@ -398,7 +398,7 @@ bool MenuActionContainer::update()
}
}
if
(
!
hasitems
)
{
foreach
(
I
Command
*
command
,
commands
())
{
foreach
(
Command
*
command
,
commands
())
{
if
(
command
->
isActive
())
{
hasitems
=
true
;
break
;
...
...
src/plugins/coreplugin/actionmanager/actioncontainer.h
View file @
fbfcc9a4
...
...
@@ -42,7 +42,7 @@
namespace
Core
{
class
I
Command
;
class
Command
;
class
ActionContainer
:
public
QObject
{
...
...
@@ -63,7 +63,7 @@ public:
virtual
QAction
*
insertLocation
(
const
QString
&
group
)
const
=
0
;
virtual
void
appendGroup
(
const
QString
&
group
)
=
0
;
virtual
void
addAction
(
Core
::
I
Command
*
action
,
const
QString
&
group
=
QString
())
=
0
;
virtual
void
addAction
(
Core
::
Command
*
action
,
const
QString
&
group
=
QString
())
=
0
;
virtual
void
addMenu
(
Core
::
ActionContainer
*
menu
,
const
QString
&
group
=
QString
())
=
0
;
virtual
bool
update
()
=
0
;
...
...
src/plugins/coreplugin/actionmanager/actioncontainer_p.h
View file @
fbfcc9a4
...
...
@@ -37,7 +37,7 @@
#include
"actionmanager_p.h"
#include
<coreplugin/actionmanager/actioncontainer.h>
#include
<coreplugin/actionmanager/
i
command.h>
#include
<coreplugin/actionmanager/command.h>
namespace
Core
{
namespace
Internal
{
...
...
@@ -63,7 +63,7 @@ public:
QAction
*
insertLocation
(
const
QString
&
group
)
const
;
void
appendGroup
(
const
QString
&
group
);
void
addAction
(
I
Command
*
action
,
const
QString
&
group
=
QString
());
void
addAction
(
Command
*
action
,
const
QString
&
group
=
QString
());
void
addMenu
(
ActionContainer
*
menu
,
const
QString
&
group
=
QString
());
int
id
()
const
;
...
...
@@ -74,14 +74,14 @@ public:
virtual
void
insertAction
(
QAction
*
before
,
QAction
*
action
)
=
0
;
virtual
void
insertMenu
(
QAction
*
before
,
QMenu
*
menu
)
=
0
;
QList
<
I
Command
*>
commands
()
const
{
return
m_commands
;
}
QList
<
Command
*>
commands
()
const
{
return
m_commands
;
}
QList
<
ActionContainer
*>
subContainers
()
const
{
return
m_subContainers
;
}
protected:
bool
canAddAction
(
I
Command
*
action
)
const
;
bool
canAddAction
(
Command
*
action
)
const
;
bool
canAddMenu
(
ActionContainer
*
menu
)
const
;
virtual
bool
canBeAddedToMenu
()
const
=
0
;
void
addAction
(
I
Command
*
action
,
int
pos
,
bool
setpos
);
void
addAction
(
Command
*
action
,
int
pos
,
bool
setpos
);
void
addMenu
(
ActionContainer
*
menu
,
int
pos
,
bool
setpos
);
private:
...
...
@@ -93,7 +93,7 @@ private:
int
m_id
;
QMap
<
int
,
int
>
m_posmap
;
QList
<
ActionContainer
*>
m_subContainers
;
QList
<
I
Command
*>
m_commands
;
QList
<
Command
*>
m_commands
;
};
class
MenuActionContainer
:
public
ActionContainerPrivate
...
...
src/plugins/coreplugin/actionmanager/actionmanager.cpp
View file @
fbfcc9a4
...
...
@@ -70,10 +70,10 @@ namespace {
All actions that are registered with the same string id (but different context lists)
are considered to be overloads of the same command, represented by an instance
of the
I
Command class.
The action that is visible to the user is the one returned by
I
Command::action().
of the Command class.
The action that is visible to the user is the one returned by Command::action().
If you provide yourself a user visible representation of your action you need
to use
I
Command::action() for this.
to use Command::action() for this.
When this action is invoked by the user,
the signal is forwarded to the registered action that is valid for the current context.
...
...
@@ -83,7 +83,7 @@ namespace {
Core::ActionManager *am = ExtensionSystem::PluginManager::instance()
->getObject<Core::ICore>()->actionManager();
QAction *myAction = new QAction(tr("My Action"), this);
Core::
I
Command *cmd = am->registerAction(myAction,
Core::Command *cmd = am->registerAction(myAction,
"myplugin.myaction",
QList<int>() << C_GLOBAL_ID);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u")));
...
...
@@ -92,7 +92,7 @@ namespace {
So the \c connect is done to your own QAction instance. If you create e.g.
a tool button that should represent the action you add the action
from
I
Command::action() to it:
from Command::action() to it:
\code
QToolButton *myButton = new QToolButton(someParentWidget);
myButton->setDefaultAction(cmd->action());
...
...
@@ -123,7 +123,7 @@ namespace {
\endlist
\sa Core::ICore
\sa Core::
I
Command
\sa Core::Command
\sa Core::ActionContainer
\sa Core::IContext
*/
...
...
@@ -149,7 +149,7 @@ namespace {
*/
/*!
\fn
I
Command *ActionManager::registerAction(QAction *action, const QString &id, const QList<int> &context)
\fn Command *ActionManager::registerAction(QAction *action, const QString &id, const QList<int> &context)
\brief Makes an \a action known to the system under the specified string \a id.
Returns a command object that represents the action in the application and is
...
...
@@ -160,7 +160,7 @@ namespace {
*/
/*!
\fn
I
Command *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
\fn Command *ActionManager::registerShortcut(QShortcut *shortcut, const QString &id, const QList<int> &context)
\brief Makes a \a shortcut known to the system under the specified string \a id.
Returns a command object that represents the shortcut in the application and is
...
...
@@ -171,8 +171,8 @@ namespace {
*/
/*!
\fn
I
Command *ActionManager::command(const QString &id) const
\brief Returns the
I
Command object that is known to the system
\fn Command *ActionManager::command(const QString &id) const
\brief Returns the Command object that is known to the system
under the given string \a id.
\sa ActionManager::registerAction()
...
...
@@ -308,22 +308,22 @@ ActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
return
mbc
;
}
I
Command
*
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
;
I
Command
*
c
=
registerOverridableAction
(
action
,
id
,
false
);
Command
*
c
=
registerOverridableAction
(
action
,
id
,
false
);
a
=
static_cast
<
OverrideableAction
*>
(
c
);
if
(
a
)
a
->
addOverrideAction
(
action
,
context
);
return
a
;
}
I
Command
*
ActionManagerPrivate
::
registerOverridableAction
(
QAction
*
action
,
const
QString
&
id
,
bool
checkUnique
)
Command
*
ActionManagerPrivate
::
registerOverridableAction
(
QAction
*
action
,
const
QString
&
id
,
bool
checkUnique
)
{
OverrideableAction
*
a
=
0
;
const
int
uid
=
m_mainWnd
->
uniqueIDManager
()
->
uniqueIdentifier
(
id
);
if
(
CommandPrivate
*
c
=
m_idCmdMap
.
value
(
uid
,
0
))
{
if
(
c
->
type
()
!=
I
Command
::
CT_OverridableAction
)
{
if
(
c
->
type
()
!=
Command
::
CT_OverridableAction
)
{
qWarning
()
<<
"registerAction: id"
<<
id
<<
"is registered with a different command type."
;
return
c
;
}
...
...
@@ -364,12 +364,12 @@ ICommand *ActionManagerPrivate::registerOverridableAction(QAction *action, const
return
a
;
}
I
Command
*
ActionManagerPrivate
::
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
const
QList
<
int
>
&
context
)
Command
*
ActionManagerPrivate
::
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
const
QList
<
int
>
&
context
)
{
Shortcut
*
sc
=
0
;
int
uid
=
m_mainWnd
->
uniqueIDManager
()
->
uniqueIdentifier
(
id
);
if
(
CommandPrivate
*
c
=
m_idCmdMap
.
value
(
uid
,
0
))
{
if
(
c
->
type
()
!=
I
Command
::
CT_Shortcut
)
{
if
(
c
->
type
()
!=
Command
::
CT_Shortcut
)
{
qWarning
()
<<
"registerShortcut: id"
<<
id
<<
"is registered with a different command type."
;
return
c
;
}
...
...
@@ -401,7 +401,7 @@ ICommand *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStr
return
sc
;
}
I
Command
*
ActionManagerPrivate
::
command
(
const
QString
&
id
)
const
Command
*
ActionManagerPrivate
::
command
(
const
QString
&
id
)
const
{
const
int
uid
=
m_mainWnd
->
uniqueIDManager
()
->
uniqueIdentifier
(
id
);
const
IdCmdMap
::
const_iterator
it
=
m_idCmdMap
.
constFind
(
uid
);
...
...
@@ -425,7 +425,7 @@ ActionContainer *ActionManagerPrivate::actionContainer(const QString &id) const
return
it
.
value
();
}
I
Command
*
ActionManagerPrivate
::
command
(
int
uid
)
const
Command
*
ActionManagerPrivate
::
command
(
int
uid
)
const
{
const
IdCmdMap
::
const_iterator
it
=
m_idCmdMap
.
constFind
(
uid
);
if
(
it
==
m_idCmdMap
.
constEnd
())
{
...
...
@@ -461,7 +461,7 @@ void ActionManagerPrivate::initialize()
const
QKeySequence
key
(
settings
->
value
(
QLatin1String
(
sequenceKey
)).
toString
());
const
int
id
=
m_mainWnd
->
uniqueIDManager
()
->
uniqueIdentifier
(
sid
);
I
Command
*
cmd
=
command
(
id
);
Command
*
cmd
=
command
(
id
);
if
(
cmd
)
cmd
->
setKeySequence
(
key
);
}
...
...
src/plugins/coreplugin/actionmanager/actionmanager.h
View file @
fbfcc9a4
...
...
@@ -37,7 +37,7 @@
#include
"coreplugin/core_global.h"
#include
<coreplugin/actionmanager/actioncontainer.h>
#include
<coreplugin/actionmanager/
i
command.h>
#include
<coreplugin/actionmanager/command.h>
#include
<QtCore/QObject>
#include
<QtCore/QList>
...
...
@@ -60,10 +60,10 @@ public:
virtual
ActionContainer
*
createMenu
(
const
QString
&
id
)
=
0
;
virtual
ActionContainer
*
createMenuBar
(
const
QString
&
id
)
=
0
;
virtual
I
Command
*
registerAction
(
QAction
*
action
,
const
QString
&
id
,
const
QList
<
int
>
&
context
)
=
0
;
virtual
I
Command
*
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
const
QList
<
int
>
&
context
)
=
0
;
virtual
Command
*
registerAction
(
QAction
*
action
,
const
QString
&
id
,
const
QList
<
int
>
&
context
)
=
0
;
virtual
Command
*
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
const
QList
<
int
>
&
context
)
=
0
;
virtual
I
Command
*
command
(
const
QString
&
id
)
const
=
0
;
virtual
Command
*
command
(
const
QString
&
id
)
const
=
0
;
virtual
ActionContainer
*
actionContainer
(
const
QString
&
id
)
const
=
0
;
};
...
...
src/plugins/coreplugin/actionmanager/actionmanager_p.h
View file @
fbfcc9a4
...
...
@@ -79,7 +79,7 @@ public:
bool
hasContext
(
int
context
)
const
;
I
Command
*
command
(
int
uid
)
const
;
Command
*
command
(
int
uid
)
const
;
ActionContainer
*
actionContainer
(
int
uid
)
const
;
void
initialize
();
...
...
@@ -88,17 +88,17 @@ public:
ActionContainer
*
createMenu
(
const
QString
&
id
);
ActionContainer
*
createMenuBar
(
const
QString
&
id
);
I
Command
*
registerAction
(
QAction
*
action
,
const
QString
&
id
,
Command
*
registerAction
(
QAction
*
action
,
const
QString
&
id
,
const
QList
<
int
>
&
context
);
I
Command
*
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
Command
*
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
const
QList
<
int
>
&
context
);
Core
::
I
Command
*
command
(
const
QString
&
id
)
const
;
Core
::
Command
*
command
(
const
QString
&
id
)
const
;
Core
::
ActionContainer
*
actionContainer
(
const
QString
&
id
)
const
;
private:
bool
hasContext
(
QList
<
int
>
context
)
const
;
I
Command
*
registerOverridableAction
(
QAction
*
action
,
const
QString
&
id
,
Command
*
registerOverridableAction
(
QAction
*
action
,
const
QString
&
id
,
bool
checkUnique
);
static
ActionManagerPrivate
*
m_instance
;
...
...
src/plugins/coreplugin/actionmanager/command.cpp
View file @
fbfcc9a4
...
...
@@ -38,10 +38,9 @@
#include
"command_p.h"
/*!
\class Core::
I
Command
\class Core::Command
\mainclass
\ingroup qwb
\inheaderfile icommand.h
\brief The class...
...
...
@@ -49,57 +48,57 @@
*/
/*!
\enum
I
Command::CommandType
\enum Command::CommandType
*/
/*!
\enum
I
Command::CommandAttribute
\enum Command::CommandAttribute
*/
/*!
\fn void
I
Command::setCategory(const QString &name)
\fn void Command::setCategory(const QString &name)
Sets the category to \a name.
*/
/*!
\fn virtual void
I
Command::setDefaultKeySequence(const QKeySequence &key)
\fn virtual void Command::setDefaultKeySequence(const QKeySequence &key)
*/
/*!
\fn virtual int
I
Command::id() const
\fn virtual int Command::id() const
*/
/*!
\fn virtual CommandType
I
Command::type() const
\fn virtual CommandType Command::type() const
*/
/*!
\fn virtual QAction *
I
Command::action() const
\fn virtual QAction *Command::action() const
*/
/*!
\fn virtual QShortcut *
I
Command::shortcut() const
\fn virtual QShortcut *Command::shortcut() const
*/
/*!
\fn virtual void
I
Command::setAttribute(CommandAttribute attr)
\fn virtual void Command::setAttribute(CommandAttribute attr)
*/
/*!
\fn virtual void
I
Command::removeAttribute(CommandAttribute attr)
\fn virtual void Command::removeAttribute(CommandAttribute attr)
*/
/*!
\fn virtual bool
I
Command::hasAttribute(CommandAttribute attr) const
\fn virtual bool Command::hasAttribute(CommandAttribute attr) const
*/
/*!
\fn virtual bool
I
Command::isActive() const
\fn virtual bool Command::isActive() const
*/
/*!
\fn virtual
I
Command::~
I
Command()
\fn virtual Command::~Command()
*/
using
namespace
Core
::
Internal
;
...
...
src/plugins/coreplugin/actionmanager/
i
command.h
→
src/plugins/coreplugin/actionmanager/command.h
View file @
fbfcc9a4
...
...
@@ -31,8 +31,8 @@
**
***************************************************************************/
#ifndef
I
COMMAND_H
#define
I
COMMAND_H
#ifndef COMMAND_H
#define COMMAND_H
#include
<coreplugin/core_global.h>
...
...
@@ -42,7 +42,7 @@
namespace
Core
{
class
CORE_EXPORT
I
Command
:
public
QObject
class
CORE_EXPORT
Command
:
public
QObject
{
Q_OBJECT
public:
...
...
@@ -81,7 +81,7 @@ public:
virtual
bool
isActive
()
const
=
0
;
virtual
~
I
Command
()
{}
virtual
~
Command
()
{}
virtual
QString
stringWithAppendedShortcut
(
const
QString
&
str
)
const
=
0
;
...
...
@@ -91,4 +91,4 @@ signals:
}
// namespace Core
#endif //
I
COMMAND_H
#endif // COMMAND_H
src/plugins/coreplugin/actionmanager/command_p.h
View file @
fbfcc9a4
...
...
@@ -34,7 +34,7 @@
#ifndef COMMAND_P_H
#define COMMAND_P_H
#include
"
i
command.h"
#include
"command.h"
#include
"actionmanager_p.h"
#include
<QtCore/QList>
...
...
@@ -45,7 +45,7 @@
namespace
Core
{
namespace
Internal
{
class
CommandPrivate
:
public
Core
::
I
Command
class
CommandPrivate
:
public
Core
::
Command
{
Q_OBJECT
public:
...
...
src/plugins/coreplugin/coreplugin.pro
View file @
fbfcc9a4
...
...
@@ -100,7 +100,7 @@ HEADERS += mainwindow.h \
editormanager
/
ieditorfactory
.
h
\
actionmanager
/
actioncontainer
.
h
\
actionmanager
/
actionmanager
.
h
\
actionmanager
/
i
command
.
h
\
actionmanager
/
command
.
h
\
actionmanager
/
actionmanager_p
.
h
\
actionmanager
/
command_p
.
h
\
actionmanager
/
actioncontainer_p
.
h
\
...
...
src/plugins/coreplugin/dialogs/shortcutsettings.cpp
View file @
fbfcc9a4
...
...
@@ -41,7 +41,7 @@
#include
"filemanager.h"
#include
<coreplugin/uniqueidmanager.h>
#include
<coreplugin/actionmanager/
i
command.h>
#include
<coreplugin/actionmanager/command.h>
#include
<QtGui/QKeyEvent>
#include
<QtGui/QShortcut>
...
...
src/plugins/coreplugin/dialogs/shortcutsettings.h
View file @
fbfcc9a4
...
...
@@ -47,7 +47,7 @@ QT_END_NAMESPACE
namespace
Core
{
class
I
Command
;
class
Command
;
namespace
Internal
{
...
...
@@ -56,7 +56,7 @@ class MainWindow;
struct
ShortcutItem
{
I
Command
*
m_cmd
;
Command
*
m_cmd
;
QKeySequence
m_key
;
QTreeWidgetItem
*
m_item
;
};
...
...
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
fbfcc9a4
...
...
@@ -211,9 +211,9 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
ActionContainer
*
mfile
=
am
->
actionContainer
(
Constants
::
M_FILE
);
//Revert to saved
I
Command
*
cmd
=
am
->
registerAction
(
m_d
->
m_revertToSavedAction
,
Command
*
cmd
=
am
->
registerAction
(
m_d
->
m_revertToSavedAction
,
Constants
::
REVERTTOSAVED
,
editManagerContext
);
cmd
->
setAttribute
(
I
Command
::
CA_UpdateText
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
tr
(
"Revert File to Saved"
));
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_SAVE
);
connect
(
m_d
->
m_revertToSavedAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
revertToSaved
()));
...
...
@@ -258,7 +258,7 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
//Close Action
cmd
=
am
->
registerAction
(
m_d
->
m_closeCurrentEditorAction
,
Constants
::
CLOSE
,
editManagerContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+W"
)));
cmd
->
setAttribute
(
Core
::
I
Command
::
CA_UpdateText
);
cmd
->
setAttribute
(
Core
::
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
m_d
->
m_closeCurrentEditorAction
->
text
());
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_CLOSE
);
connect
(
m_d
->
m_closeCurrentEditorAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
closeEditor
()));
...
...
src/plugins/coreplugin/editormanager/editorsplitter.cpp
View file @
fbfcc9a4
...
...
@@ -74,7 +74,7 @@ void EditorSplitter::registerActions()
ActionManager
*
am
=
m_core
->
actionManager
();
ActionContainer
*
mwindow
=
am
->
actionContainer
(
Constants
::
M_WINDOW
);
I
Command
*
cmd
;
Command
*
cmd
;
//Horizontal Action
m_horizontalSplitAction
=
new
QAction
(
tr
(
"Split Left/Right"
),
this
);
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
fbfcc9a4
...
...
@@ -428,13 +428,13 @@ void MainWindow::registerDefaultContainers()
ac
->
appendGroup
(
Constants
::
G_HELP_ABOUT
);
}
static
I
Command
*
createSeparator
(
ActionManagerPrivate
*
am
,
QObject
*
parent
,
static
Command
*
createSeparator
(
ActionManagerPrivate
*
am
,
QObject
*
parent
,
const
QString
&
name
,
const
QList
<
int
>
&
context
)
{
QAction
*
tmpaction
=
new
QAction
(
parent
);
tmpaction
->
setSeparator
(
true
);
I
Command
*
cmd
=
am
->
registerAction
(
tmpaction
,
name
,
context
);
Command
*
cmd
=
am
->
registerAction
(
tmpaction
,
name
,
context
);
return
cmd
;
}
...
...
@@ -449,7 +449,7 @@ void MainWindow::registerDefaultActions()
ActionContainer
*
mhelp
=
am
->
actionContainer
(
Constants
::
M_HELP
);
// File menu separators
I
Command
*
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Save"
),
m_globalContext
);
Command
*
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Save"
),
m_globalContext
);
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_SAVE
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Print"
),
m_globalContext
);
...
...
@@ -514,7 +514,7 @@ void MainWindow::registerDefaultActions()
QAction
*
tmpaction
=
new
QAction
(
QIcon
(
Constants
::
ICON_SAVEFILE
),
tr
(
"&Save"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
SAVE
,
m_globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Save
);
cmd
->
setAttribute
(
I
Command
::
CA_UpdateText
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
tr
(
"&Save"
));
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_SAVE
);
...
...
@@ -524,7 +524,7 @@ void MainWindow::registerDefaultActions()
#ifdef Q_OS_MAC
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+Shift+S"
)));
#endif
cmd
->
setAttribute
(
I
Command
::
CA_UpdateText
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
tr
(
"Save &As..."
));
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_SAVE
);
...
...
@@ -553,7 +553,7 @@ void MainWindow::registerDefaultActions()
tmpaction
=
new
QAction
(
QIcon
(
Constants
::
ICON_UNDO
),
tr
(
"&Undo"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
UNDO
,
m_globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Undo
);
cmd
->
setAttribute
(
I
Command
::
CA_UpdateText
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
tr
(
"&Undo"
));
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_UNDOREDO
);
...
...
@@ -561,7 +561,7 @@ void MainWindow::registerDefaultActions()
tmpaction
=
new
QAction
(
QIcon
(
Constants
::
ICON_REDO
),
tr
(
"&Redo"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
REDO
,
m_globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Redo
);
cmd
->
setAttribute
(
I
Command
::
CA_UpdateText
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
tr
(
"&Redo"
));
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_UNDOREDO
);
...
...
src/plugins/coreplugin/modemanager.cpp
View file @
fbfcc9a4
...
...
@@ -40,7 +40,7 @@
#include
<aggregation/aggregate.h>
#include
<coreplugin/actionmanager/actionmanager.h>
#include
<coreplugin/actionmanager/
i
command.h>
#include
<coreplugin/actionmanager/command.h>
#include
<coreplugin/coreconstants.h>
#include
<coreplugin/coreimpl.h>
#include
<coreplugin/imode.h>
...
...
@@ -144,7 +144,7 @@ void ModeManager::objectAdded(QObject *obj)
const
QString
shortcutId
=
QLatin1String
(
"QtCreator.Mode."
)
+
mode
->
uniqueModeName
();
QShortcut
*
shortcut
=
new
QShortcut
(
m_mainWindow
);
shortcut
->
setWhatsThis
(
tr
(
"Switch to %1 mode"
).
arg
(
mode
->
name
()));
I
Command
*
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
);