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
ff0ac20a
Commit
ff0ac20a
authored
Sep 10, 2010
by
hjk
Browse files
coreplugin: use Core::Id is some places
parent
2d6ad569
Changes
28
Hide whitespace changes
Inline
Side-by-side
src/plugins/bookmarks/bookmarksplugin.cpp
View file @
ff0ac20a
...
...
@@ -71,11 +71,8 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
Core
::
Context
textcontext
(
TextEditor
::
Constants
::
C_TEXTEDITOR
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
Core
::
ActionContainer
*
mtools
=
am
->
actionContainer
(
Core
::
Constants
::
M_TOOLS
);
Core
::
ActionContainer
*
mbm
=
am
->
createMenu
(
QLatin1String
(
BOOKMARKS_MENU
));
Core
::
ActionContainer
*
mtools
=
am
->
actionContainer
(
Core
::
Constants
::
M_TOOLS
);
Core
::
ActionContainer
*
mbm
=
am
->
createMenu
(
Core
::
Id
(
BOOKMARKS_MENU
));
mbm
->
menu
()
->
setTitle
(
tr
(
"&Bookmarks"
));
mtools
->
addMenu
(
mbm
);
...
...
@@ -92,7 +89,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
QAction
*
sep
=
new
QAction
(
this
);
sep
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
sep
,
QLatin1String
(
"Bookmarks.Sep.Toggle"
),
textcontext
);
cmd
=
am
->
registerAction
(
sep
,
Core
::
Id
(
"Bookmarks.Sep.Toggle"
),
textcontext
);
mbm
->
addAction
(
cmd
);
//Previous
...
...
@@ -117,7 +114,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
sep
=
new
QAction
(
this
);
sep
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
sep
,
QLatin1String
(
"Bookmarks.Sep.DirNavigation"
),
globalcontext
);
cmd
=
am
->
registerAction
(
sep
,
Core
::
Id
(
"Bookmarks.Sep.DirNavigation"
),
globalcontext
);
mbm
->
addAction
(
cmd
);
//Previous Doc
...
...
src/plugins/coreplugin/actionmanager/actionmanager.cpp
View file @
ff0ac20a
...
...
@@ -294,7 +294,7 @@ bool ActionManagerPrivate::hasContext(const Context &context) const
return
false
;
}
ActionContainer
*
ActionManagerPrivate
::
createMenu
(
const
QString
&
id
)
ActionContainer
*
ActionManagerPrivate
::
createMenu
(
const
Id
&
id
)
{
const
int
uid
=
UniqueIDManager
::
instance
()
->
uniqueIdentifier
(
id
);
const
IdContainerMap
::
const_iterator
it
=
m_idContainerMap
.
constFind
(
uid
);
...
...
@@ -312,7 +312,7 @@ ActionContainer *ActionManagerPrivate::createMenu(const QString &id)
return
mc
;
}
ActionContainer
*
ActionManagerPrivate
::
createMenuBar
(
const
QString
&
id
)
ActionContainer
*
ActionManagerPrivate
::
createMenuBar
(
const
Id
&
id
)
{
const
int
uid
=
UniqueIDManager
::
instance
()
->
uniqueIdentifier
(
id
);
const
IdContainerMap
::
const_iterator
it
=
m_idContainerMap
.
constFind
(
uid
);
...
...
@@ -330,7 +330,7 @@ ActionContainer *ActionManagerPrivate::createMenuBar(const QString &id)
return
mbc
;
}
Command
*
ActionManagerPrivate
::
registerAction
(
QAction
*
action
,
const
QString
&
id
,
const
Context
&
context
)
Command
*
ActionManagerPrivate
::
registerAction
(
QAction
*
action
,
const
Id
&
id
,
const
Context
&
context
)
{
Action
*
a
=
0
;
Command
*
c
=
registerOverridableAction
(
action
,
id
,
false
);
...
...
@@ -340,7 +340,7 @@ Command *ActionManagerPrivate::registerAction(QAction *action, const QString &id
return
a
;
}
Command
*
ActionManagerPrivate
::
registerOverridableAction
(
QAction
*
action
,
const
QString
&
id
,
bool
checkUnique
)
Command
*
ActionManagerPrivate
::
registerOverridableAction
(
QAction
*
action
,
const
Id
&
id
,
bool
checkUnique
)
{
Action
*
a
=
0
;
const
int
uid
=
UniqueIDManager
::
instance
()
->
uniqueIdentifier
(
id
);
...
...
@@ -386,7 +386,7 @@ Command *ActionManagerPrivate::registerOverridableAction(QAction *action, const
return
a
;
}
Command
*
ActionManagerPrivate
::
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
const
Context
&
context
)
Command
*
ActionManagerPrivate
::
registerShortcut
(
QShortcut
*
shortcut
,
const
Id
&
id
,
const
Context
&
context
)
{
Shortcut
*
sc
=
0
;
int
uid
=
UniqueIDManager
::
instance
()
->
uniqueIdentifier
(
id
);
...
...
@@ -423,7 +423,7 @@ Command *ActionManagerPrivate::registerShortcut(QShortcut *shortcut, const QStri
return
sc
;
}
Command
*
ActionManagerPrivate
::
command
(
const
QString
&
id
)
const
Command
*
ActionManagerPrivate
::
command
(
const
Id
&
id
)
const
{
const
int
uid
=
UniqueIDManager
::
instance
()
->
uniqueIdentifier
(
id
);
const
IdCmdMap
::
const_iterator
it
=
m_idCmdMap
.
constFind
(
uid
);
...
...
@@ -435,7 +435,7 @@ Command *ActionManagerPrivate::command(const QString &id) const
return
it
.
value
();
}
ActionContainer
*
ActionManagerPrivate
::
actionContainer
(
const
QString
&
id
)
const
ActionContainer
*
ActionManagerPrivate
::
actionContainer
(
const
Id
&
id
)
const
{
const
int
uid
=
UniqueIDManager
::
instance
()
->
uniqueIdentifier
(
id
);
const
IdContainerMap
::
const_iterator
it
=
m_idContainerMap
.
constFind
(
uid
);
...
...
src/plugins/coreplugin/actionmanager/actionmanager.h
View file @
ff0ac20a
...
...
@@ -46,6 +46,7 @@ namespace Core {
class
ActionContainer
;
class
Command
;
class
Context
;
class
Id
;
class
CORE_EXPORT
ActionManager
:
public
QObject
{
...
...
@@ -54,14 +55,14 @@ public:
ActionManager
(
QObject
*
parent
=
0
)
:
QObject
(
parent
)
{}
virtual
~
ActionManager
()
{}
virtual
ActionContainer
*
createMenu
(
const
QString
&
id
)
=
0
;
virtual
ActionContainer
*
createMenuBar
(
const
QString
&
id
)
=
0
;
virtual
ActionContainer
*
createMenu
(
const
Id
&
id
)
=
0
;
virtual
ActionContainer
*
createMenuBar
(
const
Id
&
id
)
=
0
;
virtual
Command
*
registerAction
(
QAction
*
action
,
const
QString
&
id
,
const
Context
&
context
)
=
0
;
virtual
Command
*
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
const
Context
&
context
)
=
0
;
virtual
Command
*
registerAction
(
QAction
*
action
,
const
Id
&
id
,
const
Context
&
context
)
=
0
;
virtual
Command
*
registerShortcut
(
QShortcut
*
shortcut
,
const
Id
&
id
,
const
Context
&
context
)
=
0
;
virtual
Command
*
command
(
const
QString
&
id
)
const
=
0
;
virtual
ActionContainer
*
actionContainer
(
const
QString
&
id
)
const
=
0
;
virtual
Command
*
command
(
const
Id
&
id
)
const
=
0
;
virtual
ActionContainer
*
actionContainer
(
const
Id
&
id
)
const
=
0
;
virtual
QList
<
Command
*>
commands
()
const
=
0
;
};
...
...
src/plugins/coreplugin/actionmanager/actionmanager_p.h
View file @
ff0ac20a
...
...
@@ -82,20 +82,20 @@ public:
void
initialize
();
//ActionManager Interface
ActionContainer
*
createMenu
(
const
QString
&
id
);
ActionContainer
*
createMenuBar
(
const
QString
&
id
);
ActionContainer
*
createMenu
(
const
Id
&
id
);
ActionContainer
*
createMenuBar
(
const
Id
&
id
);
Command
*
registerAction
(
QAction
*
action
,
const
QString
&
id
,
Command
*
registerAction
(
QAction
*
action
,
const
Id
&
id
,
const
Context
&
context
);
Command
*
registerShortcut
(
QShortcut
*
shortcut
,
const
QString
&
id
,
Command
*
registerShortcut
(
QShortcut
*
shortcut
,
const
Id
&
id
,
const
Context
&
context
);
Core
::
Command
*
command
(
const
QString
&
id
)
const
;
Core
::
ActionContainer
*
actionContainer
(
const
QString
&
id
)
const
;
Core
::
Command
*
command
(
const
Id
&
id
)
const
;
Core
::
ActionContainer
*
actionContainer
(
const
Id
&
id
)
const
;
private:
bool
hasContext
(
const
Context
&
context
)
const
;
Command
*
registerOverridableAction
(
QAction
*
action
,
const
QString
&
id
,
Command
*
registerOverridableAction
(
QAction
*
action
,
const
Id
&
id
,
bool
checkUnique
);
static
ActionManagerPrivate
*
m_instance
;
...
...
src/plugins/coreplugin/editormanager/editormanager.cpp
View file @
ff0ac20a
...
...
@@ -52,6 +52,7 @@
#include
<coreplugin/imode.h>
#include
<coreplugin/settingsdatabase.h>
#include
<coreplugin/variablemanager.h>
#include
<coreplugin/uniqueidmanager.h>
#include
<extensionsystem/pluginmanager.h>
...
...
@@ -295,12 +296,12 @@ EditorManager::EditorManager(ICore *core, QWidget *parent) :
// Window menu separators
QAction
*
tmpaction
=
new
QAction
(
this
);
tmpaction
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
tmpaction
,
QLatin1String
(
"QtCreator.Window.Sep.Split"
)
,
editManagerContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
"QtCreator.Window.Sep.Split"
,
editManagerContext
);
mwindow
->
addAction
(
cmd
,
Constants
::
G_WINDOW_SPLIT
);
tmpaction
=
new
QAction
(
this
);
tmpaction
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
tmpaction
,
QLatin1String
(
"QtCreator.Window.Sep.Navigate"
)
,
editManagerContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
"QtCreator.Window.Sep.Navigate"
,
editManagerContext
);
mwindow
->
addAction
(
cmd
,
Constants
::
G_WINDOW_NAVIGATE
);
// Close Action
...
...
src/plugins/coreplugin/editortoolbar.cpp
View file @
ff0ac20a
...
...
@@ -34,6 +34,7 @@
#include
<coreplugin/icore.h>
#include
<coreplugin/minisplitter.h>
#include
<coreplugin/sidebar.h>
#include
<coreplugin/uniqueidmanager.h>
#include
<coreplugin/editormanager/editorview.h>
#include
<coreplugin/editormanager/editormanager.h>
...
...
src/plugins/coreplugin/icore.h
View file @
ff0ac20a
...
...
@@ -32,6 +32,7 @@
#include
"core_global.h"
#include
"dialogs/iwizard.h"
#include
"uniqueidmanager.h"
#include
<QtCore/QObject>
#include
<QtCore/QSettings>
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
ff0ac20a
...
...
@@ -779,7 +779,7 @@ void MainWindow::registerDefaultActions()
#ifndef Q_WS_MAC // doesn't have the "About" actions in the Help menu
tmpaction
=
new
QAction
(
this
);
tmpaction
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
tmpaction
,
QLatin1String
(
"QtCreator.Help.Sep.About"
)
,
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
"QtCreator.Help.Sep.About"
,
globalContext
);
mhelp
->
addAction
(
cmd
,
Constants
::
G_HELP_ABOUT
);
#endif
}
...
...
src/plugins/coreplugin/navigationwidget.cpp
View file @
ff0ac20a
...
...
@@ -36,6 +36,7 @@
#include
"modemanager.h"
#include
"actionmanager/actionmanager.h"
#include
"actionmanager/command.h"
#include
"uniqueidmanager.h"
#include
<extensionsystem/pluginmanager.h>
...
...
@@ -173,8 +174,8 @@ void NavigationWidget::setFactories(const QList<INavigationWidgetFactory *> fact
connect
(
shortcut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
activateSubWidget
()));
m_shortcutMap
.
insert
(
shortcut
,
id
);
Core
::
Command
*
cmd
=
am
->
registerShortcut
(
shortcut
,
QLatin1String
(
"QtCreator.Sidebar."
)
+
id
,
navicontext
);
Command
*
cmd
=
am
->
registerShortcut
(
shortcut
,
Id
(
QLatin1String
(
"QtCreator.Sidebar."
)
+
id
)
,
navicontext
);
cmd
->
setDefaultKeySequence
(
factory
->
activationSequence
());
m_commandMap
.
insert
(
id
,
cmd
);
...
...
src/plugins/coreplugin/outputpane.cpp
View file @
ff0ac20a
...
...
@@ -40,6 +40,7 @@
#include
<coreplugin/editormanager/editormanager.h>
#include
<coreplugin/findplaceholder.h>
#include
<coreplugin/editormanager/ieditor.h>
#include
<coreplugin/uniqueidmanager.h>
#include
<extensionsystem/pluginmanager.h>
...
...
@@ -317,7 +318,7 @@ void OutputPaneManager::init()
QAction
*
sep
=
new
QAction
(
this
);
sep
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
sep
,
QLatin1String
(
"Coreplugin.OutputPane.Sep"
)
,
globalcontext
);
cmd
=
am
->
registerAction
(
sep
,
"Coreplugin.OutputPane.Sep"
,
globalcontext
);
mpanes
->
addAction
(
cmd
,
"Coreplugin.OutputPane.ActionsGroup"
);
QList
<
IOutputPane
*>
panes
=
ExtensionSystem
::
PluginManager
::
instance
()
...
...
src/plugins/cpaster/cpasterplugin.cpp
View file @
ff0ac20a
...
...
@@ -114,7 +114,7 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m
actionManager
->
actionContainer
(
Core
::
Constants
::
M_TOOLS
);
Core
::
ActionContainer
*
cpContainer
=
actionManager
->
createMenu
(
QLatin1String
(
"CodePaster"
));
actionManager
->
createMenu
(
Core
::
Id
(
"CodePaster"
));
cpContainer
->
menu
()
->
setTitle
(
tr
(
"&Code Pasting"
));
toolsContainer
->
addMenu
(
cpContainer
);
...
...
src/plugins/cppeditor/cppplugin.cpp
View file @
ff0ac20a
...
...
@@ -132,7 +132,7 @@ Core::Command *createSeparator(Core::ActionManager *am,
{
QAction
*
separator
=
new
QAction
(
parent
);
separator
->
setSeparator
(
true
);
return
am
->
registerAction
(
separator
,
QLatin1String
(
id
),
context
);
return
am
->
registerAction
(
separator
,
Core
::
Id
(
id
),
context
);
}
CppPlugin
*
CppPlugin
::
m_instance
=
0
;
...
...
@@ -242,7 +242,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
Core
::
ActionContainer
*
contextMenu
=
am
->
createMenu
(
CppEditor
::
Constants
::
M_CONTEXT
);
Core
::
Command
*
cmd
;
Core
::
ActionContainer
*
cppToolsMenu
=
am
->
actionContainer
(
QLatin1String
(
CppTools
::
Constants
::
M_TOOLS_CPP
));
Core
::
ActionContainer
*
cppToolsMenu
=
am
->
actionContainer
(
Core
::
Id
(
CppTools
::
Constants
::
M_TOOLS_CPP
));
QAction
*
jumpToDefinition
=
new
QAction
(
tr
(
"Follow Symbol Under Cursor"
),
this
);
cmd
=
am
->
registerAction
(
jumpToDefinition
,
...
...
@@ -288,7 +288,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
Core
::
Context
globalContext
(
Core
::
Constants
::
C_GLOBAL
);
cppToolsMenu
->
addAction
(
createSeparator
(
am
,
this
,
globalContext
,
CppEditor
::
Constants
::
SEPARATOR2
));
m_updateCodeModelAction
=
new
QAction
(
tr
(
"Update Code Model"
),
this
);
cmd
=
am
->
registerAction
(
m_updateCodeModelAction
,
QLatin1String
(
Constants
::
UPDATE_CODEMODEL
),
globalContext
);
cmd
=
am
->
registerAction
(
m_updateCodeModelAction
,
Core
::
Id
(
Constants
::
UPDATE_CODEMODEL
),
globalContext
);
CppTools
::
CppModelManagerInterface
*
cppModelManager
=
CppTools
::
CppModelManagerInterface
::
instance
();
connect
(
m_updateCodeModelAction
,
SIGNAL
(
triggered
()),
cppModelManager
,
SLOT
(
updateModifiedSourceFiles
()));
cppToolsMenu
->
addAction
(
cmd
);
...
...
src/plugins/cvs/cvsplugin.cpp
View file @
ff0ac20a
...
...
@@ -271,8 +271,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes
Core
::
ActionManager
*
ami
=
core
->
actionManager
();
Core
::
ActionContainer
*
toolsContainer
=
ami
->
actionContainer
(
M_TOOLS
);
Core
::
ActionContainer
*
cvsMenu
=
ami
->
createMenu
(
QLatin1String
(
CMD_ID_CVS_MENU
));
Core
::
ActionContainer
*
cvsMenu
=
ami
->
createMenu
(
Core
::
Id
(
CMD_ID_CVS_MENU
));
cvsMenu
->
menu
()
->
setTitle
(
tr
(
"&CVS"
));
toolsContainer
->
addMenu
(
cvsMenu
);
m_menuAction
=
cvsMenu
->
menu
()
->
menuAction
();
...
...
src/plugins/debugger/debuggeruiswitcher.cpp
View file @
ff0ac20a
...
...
@@ -182,7 +182,7 @@ DebuggerUISwitcher::DebuggerUISwitcher(BaseMode *mode, QObject* parent)
SLOT
(
updateDockWidgetSettings
()));
d
->
m_debugMenu
=
am
->
actionContainer
(
ProjectExplorer
::
Constants
::
M_DEBUG
);
d
->
m_viewsMenu
=
am
->
actionContainer
(
QLatin1String
(
Core
::
Constants
::
M_WINDOW_VIEWS
));
d
->
m_viewsMenu
=
am
->
actionContainer
(
Core
::
Id
(
Core
::
Constants
::
M_WINDOW_VIEWS
));
QTC_ASSERT
(
d
->
m_viewsMenu
,
return
)
d
->
m_debuggerLanguageMenu
=
am
->
createMenu
(
Constants
::
M_DEBUG_DEBUGGING_LANGUAGES
);
...
...
@@ -355,20 +355,20 @@ void DebuggerUISwitcher::createViewsMenuItems()
// Add menu items
Command
*
cmd
=
0
;
cmd
=
am
->
registerAction
(
d
->
m_openMemoryEditorAction
,
QLatin1String
(
"Debugger.Views.OpenMemoryEditor"
),
Context
(
Constants
::
C_DEBUGMODE
));
Core
::
Id
(
"Debugger.Views.OpenMemoryEditor"
),
Core
::
Context
(
Constants
::
C_DEBUGMODE
));
d
->
m_viewsMenu
->
addAction
(
cmd
);
cmd
=
am
->
registerAction
(
d
->
m_mainWindow
->
menuSeparator1
(),
QLatin1String
(
"Debugger.Views.Separator1"
),
globalcontext
);
Core
::
Id
(
"Debugger.Views.Separator1"
),
globalcontext
);
d
->
m_viewsMenu
->
addAction
(
cmd
);
cmd
=
am
->
registerAction
(
d
->
m_mainWindow
->
toggleLockedAction
(),
QLatin1String
(
"Debugger.Views.ToggleLocked"
),
globalcontext
);
Core
::
Id
(
"Debugger.Views.ToggleLocked"
),
globalcontext
);
d
->
m_viewsMenu
->
addAction
(
cmd
);
cmd
=
am
->
registerAction
(
d
->
m_mainWindow
->
menuSeparator2
(),
QLatin1String
(
"Debugger.Views.Separator2"
),
globalcontext
);
Core
::
Id
(
"Debugger.Views.Separator2"
),
globalcontext
);
d
->
m_viewsMenu
->
addAction
(
cmd
);
cmd
=
am
->
registerAction
(
d
->
m_mainWindow
->
resetLayoutAction
(),
QLatin1String
(
"Debugger.Views.ResetSimple"
),
globalcontext
);
Core
::
Id
(
"Debugger.Views.ResetSimple"
),
globalcontext
);
d
->
m_viewsMenu
->
addAction
(
cmd
);
}
...
...
@@ -394,7 +394,7 @@ void DebuggerUISwitcher::addLanguage(const DebuggerLanguage &languageId,
debuggableLang
->
setText
(
languageName
);
d
->
m_languageActionGroup
->
addAction
(
debuggableLang
);
Command
*
activeDebugLanguageCmd
=
am
->
registerAction
(
debuggableLang
,
"Debugger.DebugLanguage."
+
languageName
,
QString
(
"Debugger.DebugLanguage."
+
languageName
)
,
Context
(
Core
::
Constants
::
C_GLOBAL
));
d
->
m_debuggerLanguageMenu
->
addAction
(
activeDebugLanguageCmd
);
...
...
@@ -610,7 +610,7 @@ QDockWidget *DebuggerUISwitcher::createDockWidget(const DebuggerLanguage &langua
ActionManager
*
am
=
ICore
::
instance
()
->
actionManager
();
QAction
*
toggleViewAction
=
dockWidget
->
toggleViewAction
();
Command
*
cmd
=
am
->
registerAction
(
toggleViewAction
,
"Debugger."
+
dockWidget
->
objectName
(),
globalContext
);
QString
(
"Debugger."
+
dockWidget
->
objectName
()
)
,
globalContext
);
cmd
->
setAttribute
(
Command
::
CA_Hide
);
d
->
m_viewsMenu
->
addAction
(
cmd
);
...
...
src/plugins/designer/formeditorw.cpp
View file @
ff0ac20a
...
...
@@ -239,7 +239,7 @@ void FormEditorW::setupViewActions()
{
// Populate "View" menu of form editor menu
Core
::
ActionManager
*
am
=
m_core
->
actionManager
();
Core
::
ActionContainer
*
viewMenu
=
am
->
actionContainer
(
QLatin1String
(
Core
::
Constants
::
M_WINDOW_VIEWS
));
Core
::
ActionContainer
*
viewMenu
=
am
->
actionContainer
(
Core
::
Id
(
Core
::
Constants
::
M_WINDOW_VIEWS
));
QTC_ASSERT
(
viewMenu
,
return
)
addDockViewAction
(
am
,
viewMenu
,
WidgetBoxSubWindow
,
m_contexts
,
...
...
@@ -441,7 +441,7 @@ void FormEditorW::setupActions()
//'delete' action. Do not set a shortcut as Designer handles
// the 'Delete' key by event filter. Setting a shortcut triggers
// buggy behaviour on Mac (Pressing Delete in QLineEdit removing the widget).
command
=
am
->
registerAction
(
m_fwm
->
actionDelete
(),
QLatin1String
(
"FormEditor.Edit.Delete"
),
m_contexts
);
command
=
am
->
registerAction
(
m_fwm
->
actionDelete
(),
Core
::
Id
(
"FormEditor.Edit.Delete"
),
m_contexts
);
bindShortcut
(
command
,
m_fwm
->
actionDelete
());
command
->
setAttribute
(
Core
::
Command
::
CA_Hide
);
medit
->
addAction
(
command
,
Core
::
Constants
::
G_EDIT_COPYPASTE
);
...
...
@@ -452,7 +452,7 @@ void FormEditorW::setupActions()
m_modeActionSeparator
=
new
QAction
(
this
);
m_modeActionSeparator
->
setSeparator
(
true
);
command
=
am
->
registerAction
(
m_modeActionSeparator
,
QLatin1String
(
"FormEditor.Sep.ModeActions"
),
m_contexts
);
command
=
am
->
registerAction
(
m_modeActionSeparator
,
Core
::
Id
(
"FormEditor.Sep.ModeActions"
),
m_contexts
);
medit
->
addAction
(
command
,
Core
::
Constants
::
G_EDIT_OTHER
);
m_toolActionIds
.
push_back
(
QLatin1String
(
"FormEditor.WidgetEditor"
));
...
...
src/plugins/find/findplugin.cpp
View file @
ff0ac20a
...
...
@@ -42,6 +42,7 @@
#include
<coreplugin/coreconstants.h>
#include
<coreplugin/icore.h>
#include
<coreplugin/icontext.h>
#include
<coreplugin/uniqueidmanager.h>
#include
<extensionsystem/pluginmanager.h>
...
...
@@ -198,11 +199,11 @@ void FindPlugin::setupMenu()
QAction
*
separator
;
separator
=
new
QAction
(
this
);
separator
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
separator
,
QLatin1String
(
"Find.Sep.Flags"
)
,
globalcontext
);
cmd
=
am
->
registerAction
(
separator
,
"Find.Sep.Flags"
,
globalcontext
);
mfind
->
addAction
(
cmd
,
Constants
::
G_FIND_FLAGS
);
separator
=
new
QAction
(
this
);
separator
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
separator
,
QLatin1String
(
"Find.Sep.Actions"
)
,
globalcontext
);
cmd
=
am
->
registerAction
(
separator
,
"Find.Sep.Actions"
,
globalcontext
);
mfind
->
addAction
(
cmd
,
Constants
::
G_FIND_ACTIONS
);
Core
::
ActionContainer
*
mfindadvanced
=
am
->
createMenu
(
Constants
::
M_FIND_ADVANCED
);
...
...
@@ -234,7 +235,7 @@ void FindPlugin::setupFilterMenuItems()
haveEnabledFilters
=
true
;
action
->
setEnabled
(
isEnabled
);
action
->
setData
(
qVariantFromValue
(
filter
));
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"FindFilter."
)
+
filter
->
id
(),
globalcontext
);
cmd
=
am
->
registerAction
(
action
,
QString
(
QLatin1String
(
"FindFilter."
)
+
filter
->
id
()
)
,
globalcontext
);
cmd
->
setDefaultKeySequence
(
filter
->
defaultShortcut
());
mfindadvanced
->
addAction
(
cmd
);
d
->
m_filterActions
.
insert
(
filter
,
action
);
...
...
src/plugins/find/findtoolbar.cpp
View file @
ff0ac20a
...
...
@@ -38,6 +38,7 @@
#include
<coreplugin/actionmanager/actioncontainer.h>
#include
<coreplugin/actionmanager/command.h>
#include
<coreplugin/findplaceholder.h>
#include
<coreplugin/uniqueidmanager.h>
#include
<extensionsystem/pluginmanager.h>
...
...
@@ -151,7 +152,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
if
(
QApplication
::
clipboard
()
->
supportsFindBuffer
())
{
m_enterFindStringAction
=
new
QAction
(
tr
(
"Enter Find String"
),
this
);
cmd
=
am
->
registerAction
(
m_enterFindStringAction
,
QLatin1String
(
"Find.EnterFindString"
)
,
globalcontext
);
cmd
=
am
->
registerAction
(
m_enterFindStringAction
,
"Find.EnterFindString"
,
globalcontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+E"
)));
mfind
->
addAction
(
cmd
,
Constants
::
G_FIND_ACTIONS
);
connect
(
m_enterFindStringAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
putSelectionToFindClipboard
()));
...
...
src/plugins/find/searchresultwindow.cpp
View file @
ff0ac20a
...
...
@@ -39,6 +39,7 @@
#include
<coreplugin/actionmanager/command.h>
#include
<coreplugin/coreconstants.h>
#include
<coreplugin/icontext.h>
#include
<coreplugin/uniqueidmanager.h>
#include
<utils/qtcassert.h>
#include
<QtCore/QFile>
...
...
@@ -325,7 +326,7 @@ SearchResultWindow::SearchResultWindow() : d(new SearchResultWindowPrivate)
d
->
m_expandCollapseAction
->
setCheckable
(
true
);
d
->
m_expandCollapseAction
->
setIcon
(
QIcon
(
QLatin1String
(
":/find/images/expand.png"
)));
Core
::
Command
*
cmd
=
Core
::
ICore
::
instance
()
->
actionManager
()
->
registerAction
(
d
->
m_expandCollapseAction
,
QLatin1String
(
"Find.ExpandAll"
)
,
d
->
m_expandCollapseAction
,
"Find.ExpandAll"
,
Core
::
Context
(
Core
::
Constants
::
C_GLOBAL
));
d
->
m_expandCollapseButton
->
setDefaultAction
(
cmd
->
action
());
...
...
src/plugins/git/gitplugin.cpp
View file @
ff0ac20a
...
...
@@ -174,7 +174,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = {
static
Core
::
Command
*
createSeparator
(
Core
::
ActionManager
*
am
,
const
Core
::
Context
&
context
,
const
QString
&
id
,
const
Core
::
Id
&
id
,
QObject
*
parent
)
{
QAction
*
a
=
new
QAction
(
parent
);
...
...
@@ -356,7 +356,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr
(
"Unstage File from Commit"
),
tr
(
"Unstage
\"
%1
\"
from Commit"
),
QLatin1String
(
"Git.Unstage"
),
globalcontext
,
true
,
SLOT
(
unstageFile
()));
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
QLatin1String
(
"Git.Sep.Project"
),
this
));
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
Core
::
Id
(
"Git.Sep.Project"
),
this
));
parameterActionCommand
=
createProjectAction
(
actionManager
,
gitContainer
,
...
...
@@ -379,7 +379,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
QLatin1String
(
"Git.CleanProject"
),
globalcontext
,
true
,
SLOT
(
cleanProject
()));
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
QLatin1String
(
"Git.Sep.Repository"
),
this
));
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
Core
::
Id
(
"Git.Sep.Repository"
),
this
));
createRepositoryAction
(
actionManager
,
gitContainer
,
tr
(
"Diff Repository"
),
QLatin1String
(
"Git.DiffRepository"
),
...
...
@@ -424,7 +424,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr
(
"Launch gitk"
),
QLatin1String
(
"Git.LaunchGitK"
),
globalcontext
,
true
,
&
GitClient
::
launchGitK
);
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
QLatin1String
(
"Git.Sep.Global"
),
this
));
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
Core
::
Id
(
"Git.Sep.Global"
),
this
));
ActionCommandPair
actionCommand
=
createRepositoryAction
(
actionManager
,
gitContainer
,
...
...
@@ -463,7 +463,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr
(
"Push"
),
QLatin1String
(
"Git.Push"
),
globalcontext
,
true
,
SLOT
(
push
()));
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
QLatin1String
(
"Git.Sep.Branch"
),
this
));
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
Core
::
Id
(
"Git.Sep.Branch"
),
this
));
createRepositoryAction
(
actionManager
,
gitContainer
,
tr
(
"Branches..."
),
QLatin1String
(
"Git.BranchList"
),
...
...
@@ -479,8 +479,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
gitContainer
->
addAction
(
showCommitCommand
);
// Subversion in a submenu.
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
QLatin1String
(
"Git.Sep.Subversion"
),
this
));
Core
::
ActionContainer
*
subversionMenu
=
actionManager
->
createMenu
(
QLatin1String
(
"Git.Subversion"
));
gitContainer
->
addAction
(
createSeparator
(
actionManager
,
globalcontext
,
Core
::
Id
(
"Git.Sep.Subversion"
),
this
));
Core
::
ActionContainer
*
subversionMenu
=
actionManager
->
createMenu
(
Core
::
Id
(
"Git.Subversion"
));
subversionMenu
->
menu
()
->
setTitle
(
tr
(
"Subversion"
));
gitContainer
->
addMenu
(
subversionMenu
);
...
...
@@ -498,7 +498,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
Core
::
Command
*
tCommand
=
actionManager
->
registerAction
(
snapShotActions
.
at
(
i
),
QLatin1String
(
"Git.Snapshot."
)
+
QString
::
number
(
i
),
QString
(
QLatin1String
(
"Git.Snapshot."
)
+
QString
::
number
(
i
)
)
,
globalcontext
);
gitContainer
->
addAction
(
tCommand
);
}
...
...
src/plugins/help/helpplugin.cpp
View file @
ff0ac20a
...
...
@@ -183,13 +183,12 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
QAction
*
action
=
new
QAction
(
QIcon
(
QLatin1String
(
IMAGEPATH
"home.png"
)),
tr
(
"Home"
),
this
);
Core
::
ActionManager
*
am
=
m_core
->
actionManager
();
Core
::
Command
*
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"Help.Home"
),
globalcontext
);
Core
::
Command
*
cmd
=
am
->
registerAction
(
action
,
"Help.Home"
,
globalcontext
);
connect
(
action
,
SIGNAL
(
triggered
()),
m_centralWidget
,
SLOT
(
home
()));
action
=
new
QAction
(
QIcon
(
QLatin1String
(
IMAGEPATH
"previous.png"
)),
tr
(
"Previous Page"
),
this
);
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"Help.Previous"
),
modecontext
);
cmd
=
am
->
registerAction
(
action
,
Core
::
Id
(
"Help.Previous"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Back
);
action
->
setEnabled
(
m_centralWidget
->
isBackwardAvailable
());
connect
(
action
,
SIGNAL
(
triggered
()),
m_centralWidget
,
SLOT
(
backward
()));
...
...
@@ -198,7 +197,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
action
=
new
QAction
(
QIcon
(
QLatin1String
(
IMAGEPATH
"next.png"
)),
tr
(
"Next Page"
),
this
);
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"Help.Next"
),
modecontext
);
cmd
=
am
->
registerAction
(
action
,
Core
::
Id
(
"Help.Next"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Forward
);
action
->
setEnabled
(
m_centralWidget
->
isForwardAvailable
());
connect
(
action
,
SIGNAL
(
triggered
()),
m_centralWidget
,
SLOT
(
forward
()));
...
...
@@ -207,7 +206,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
action
=
new
QAction
(
QIcon
(
QLatin1String
(
IMAGEPATH
"bookmark.png"
)),
tr
(
"Add Bookmark"
),
this
);
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"Help.AddBookmark"
),
cmd
=
am
->
registerAction
(
action
,
Core
::
Id
(
"Help.AddBookmark"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
CTRL
+
Qt
::
Key_M
));
connect
(
action
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
addBookmark
()));
...
...
@@ -215,17 +214,17 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
// Add Contents, Index, and Context menu items and a separator to the Help menu
action
=
new
QAction
(
QIcon
::
fromTheme
(
QLatin1String
(
"help-contents"
)),
tr
(
SB_CONTENTS
),
this
);
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"Help.Contents"
),
globalcontext
);
cmd
=
am
->
registerAction
(
action
,
Core
::
Id
(
"Help.Contents"
),
globalcontext
);
am
->
actionContainer
(
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
connect
(
action
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
activateContents
()));
action
=
new
QAction
(
tr
(
SB_INDEX
),
this
);
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"Help.Index"
),
globalcontext
);
cmd
=
am
->
registerAction
(
action
,
Core
::
Id
(
"Help.Index"
),
globalcontext
);
am
->
actionContainer
(
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
connect
(
action
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
activateIndex
()));
action
=
new
QAction
(
tr
(
"Context Help"
),
this
);
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"Help.Context"
),
globalcontext
);
cmd
=
am
->
registerAction
(
action
,
Core
::
Id
(
"Help.Context"
),
globalcontext
);
am
->
actionContainer
(
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
Key_F1
));
connect
(
action
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
activateContext
()));
...
...
@@ -233,7 +232,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
#ifndef Q_WS_MAC
action
=
new
QAction
(
this
);
action
->
setSeparator
(
true
);
cmd
=
am
->
registerAction
(
action
,
QLatin1String
(
"Help.Separator"
),
globalcontext
);
cmd
=
am
->
registerAction
(
action
,
Core
::
Id
(
"Help.Separator"
),
globalcontext
);
am
->
actionContainer
(
M_HELP
)
->
addAction
(
cmd
,
Core
::
Constants
::
G_HELP_HELP
);
#endif
...
...
@@ -410,20 +409,20 @@ void HelpPlugin::setupUi()
QShortcut
*
shortcut
=
new
QShortcut
(
m_splitter
);
shortcut
->
setWhatsThis
(
tr
(
"Activate Index in Help mode"
));
Core
::
Command
*
cmd
=
am
->
registerShortcut
(
shortcut
,
QLatin1String
(
"Help.IndexShortcut"
),
modecontext
);
Core
::
Id
(
"Help.IndexShortcut"
),
modecontext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
CTRL
+
Qt
::
SHIFT
+
Qt
::
Key_I
));
connect
(
shortcut
,
SIGNAL
(
activated
()),
this
,
SLOT
(
activateIndex
()));
shortcutMap
.
insert
(
QLatin1String
(
SB_INDEX
),
cmd
);
ContentWindow
*
contentWindow
=
new
ContentWindow
();
contentWindow
->
setWindowTitle
(
tr
(
SB_CONTENTS
));
m_contentItem
=
new
Core
::
SideBarItem
(
contentWindow
,
QLatin1String
(
SB_CONTENTS
));
m_contentItem
=
new
Core
::
SideBarItem
(
contentWindow
,
Core
::
Id
(
SB_CONTENTS
));
connect
(
contentWindow
,
SIGNAL
(
linkActivated
(
QUrl
)),
m_centralWidget
,
SLOT
(
setSource
(
QUrl
)));
shortcut
=
new
QShortcut
(
m_splitter
);
<