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
f56dacc7
Commit
f56dacc7
authored
Jun 28, 2010
by
hjk
Browse files
Core::Context: remove special handling of C_GLOBAL_ID/C_GLOBAL
parent
060385b4
Changes
22
Hide whitespace changes
Inline
Side-by-side
src/plugins/bookmarks/bookmarksplugin.cpp
View file @
f56dacc7
...
...
@@ -69,7 +69,7 @@ bool BookmarksPlugin::initialize(const QStringList & /*arguments*/, QString *)
Core
::
ICore
*
core
=
Core
::
ICore
::
instance
();
Core
::
ActionManager
*
am
=
core
->
actionManager
();
Core
::
Context
textcontext
(
TextEditor
::
Constants
::
C_TEXTEDITOR
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
Core
::
ActionContainer
*
mtools
=
am
->
actionContainer
(
Core
::
Constants
::
M_TOOLS
);
...
...
src/plugins/coreplugin/actionmanager/actionmanager.cpp
View file @
f56dacc7
...
...
@@ -97,7 +97,7 @@ namespace {
QAction *myAction = new QAction(tr("My Action"), this);
Core::Command *cmd = am->registerAction(myAction,
"myplugin.myaction",
QList<int>() <<
C_GLOBAL
_ID
);
Core::Context(
C_GLOBAL
)
);
cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+u")));
connect(myAction, SIGNAL(triggered()), this, SLOT(performMyAction()));
\endcode
...
...
src/plugins/coreplugin/coreconstants.h
View file @
f56dacc7
...
...
@@ -93,7 +93,6 @@ const char * const M_HELP = "QtCreator.Menu.Help";
//contexts
const
char
*
const
C_GLOBAL
=
"Global Context"
;
const
int
C_GLOBAL_ID
=
0
;
const
char
*
const
C_WELCOME_MODE
=
"Core.WelcomeMode"
;
const
char
*
const
C_EDIT_MODE
=
"Core.EditMode"
;
const
char
*
const
C_DESIGN_MODE
=
"Core.DesignMode"
;
...
...
src/plugins/coreplugin/dialogs/shortcutsettings.cpp
View file @
f56dacc7
...
...
@@ -386,6 +386,8 @@ void ShortcutSettings::markPossibleCollisions(ShortcutItem *item)
if
(
item
->
m_key
.
isEmpty
())
return
;
int
globalId
=
Context
(
Constants
::
C_GLOBAL
).
at
(
0
);
foreach
(
ShortcutItem
*
currentItem
,
m_scitems
)
{
if
(
currentItem
->
m_key
.
isEmpty
()
||
item
==
currentItem
||
...
...
@@ -398,9 +400,9 @@ void ShortcutSettings::markPossibleCollisions(ShortcutItem *item)
// conflict if context is identical, OR if one
// of the contexts is the global context
if
(
item
->
m_cmd
->
context
().
contains
(
context
)
||
(
item
->
m_cmd
->
context
().
contains
(
Constants
::
C_GLOBAL_ID
)
&&
(
item
->
m_cmd
->
context
().
contains
(
globalId
)
&&
!
currentItem
->
m_cmd
->
context
().
isEmpty
())
||
(
currentItem
->
m_cmd
->
context
().
contains
(
Constants
::
C_GLOBAL_ID
)
&&
(
currentItem
->
m_cmd
->
context
().
contains
(
globalId
)
&&
!
item
->
m_cmd
->
context
().
isEmpty
()))
{
currentItem
->
m_item
->
setForeground
(
2
,
Qt
::
red
);
item
->
m_item
->
setForeground
(
2
,
Qt
::
red
);
...
...
src/plugins/coreplugin/icontext.h
View file @
f56dacc7
...
...
@@ -46,7 +46,6 @@ class CORE_EXPORT Context
public:
Context
()
{}
explicit
Context
(
int
c1
)
{
d
.
append
(
c1
);
}
// For C_GLOBAL_ID. FIXME: Sanitize.
explicit
Context
(
const
char
*
c1
)
{
add
(
c1
);
}
Context
(
const
char
*
c1
,
const
char
*
c2
)
{
add
(
c1
);
add
(
c2
);
}
Context
(
const
char
*
c1
,
const
char
*
c2
,
const
char
*
c3
)
{
add
(
c1
);
add
(
c2
);
add
(
c3
);
}
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
f56dacc7
...
...
@@ -112,8 +112,7 @@ MainWindow::MainWindow() :
EventFilteringMainWindow
(),
m_coreImpl
(
new
CoreImpl
(
this
)),
m_uniqueIDManager
(
new
UniqueIDManager
()),
m_globalContext
(
Constants
::
C_GLOBAL_ID
),
m_additionalContexts
(
m_globalContext
),
m_additionalContexts
(
Constants
::
C_GLOBAL
),
// keep this in sync with main() in app/main.cpp
m_settings
(
new
QSettings
(
QSettings
::
IniFormat
,
QSettings
::
UserScope
,
QLatin1String
(
"Nokia"
),
QLatin1String
(
"QtCreator"
),
this
)),
...
...
@@ -510,48 +509,50 @@ void MainWindow::registerDefaultActions()
ActionContainer
*
mwindow
=
am
->
actionContainer
(
Constants
::
M_WINDOW
);
ActionContainer
*
mhelp
=
am
->
actionContainer
(
Constants
::
M_HELP
);
Context
globalContext
(
Constants
::
C_GLOBAL
);
// File menu separators
Command
*
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Save"
),
m_
globalContext
);
Command
*
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Save"
),
globalContext
);
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"
),
globalContext
);
QIcon
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"edit-cut"
),
QIcon
(
Constants
::
ICON_CUT
));
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_PRINT
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Close"
),
m_
globalContext
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Close"
),
globalContext
);
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_CLOSE
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Other"
),
m_
globalContext
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.File.Sep.Other"
),
globalContext
);
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_OTHER
);
// Edit menu separators
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Edit.Sep.CopyPaste"
),
m_
globalContext
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Edit.Sep.CopyPaste"
),
globalContext
);
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_COPYPASTE
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Edit.Sep.SelectAll"
),
m_
globalContext
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Edit.Sep.SelectAll"
),
globalContext
);
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_SELECTALL
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Edit.Sep.Find"
),
m_
globalContext
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Edit.Sep.Find"
),
globalContext
);
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_FIND
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Edit.Sep.Advanced"
),
m_
globalContext
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Edit.Sep.Advanced"
),
globalContext
);
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_ADVANCED
);
// Tools menu separators
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Tools.Sep.Options"
),
m_
globalContext
);
cmd
=
createSeparator
(
am
,
this
,
QLatin1String
(
"QtCreator.Tools.Sep.Options"
),
globalContext
);
mtools
->
addAction
(
cmd
,
Constants
::
G_DEFAULT_THREE
);
// Return to editor shortcut: Note this requires Qt to fix up
// handling of shortcut overrides in menus, item views, combos....
m_focusToEditor
=
new
QShortcut
(
this
);
cmd
=
am
->
registerShortcut
(
m_focusToEditor
,
Constants
::
S_RETURNTOEDITOR
,
m_
globalContext
);
cmd
=
am
->
registerShortcut
(
m_focusToEditor
,
Constants
::
S_RETURNTOEDITOR
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
Qt
::
Key_Escape
));
connect
(
m_focusToEditor
,
SIGNAL
(
activated
()),
this
,
SLOT
(
setFocusToEditor
()));
// New File Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"document-new"
),
QIcon
(
Constants
::
ICON_NEWFILE
));
m_newAction
=
new
QAction
(
icon
,
tr
(
"&New File or Project..."
),
this
);
cmd
=
am
->
registerAction
(
m_newAction
,
Constants
::
NEW
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
m_newAction
,
Constants
::
NEW
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
New
);
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_NEW
);
connect
(
m_newAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
newFile
()));
...
...
@@ -559,14 +560,14 @@ void MainWindow::registerDefaultActions()
// Open Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"document-open"
),
QIcon
(
Constants
::
ICON_OPENFILE
));
m_openAction
=
new
QAction
(
icon
,
tr
(
"&Open File or Project..."
),
this
);
cmd
=
am
->
registerAction
(
m_openAction
,
Constants
::
OPEN
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
m_openAction
,
Constants
::
OPEN
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Open
);
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_OPEN
);
connect
(
m_openAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openFile
()));
// Open With Action
m_openWithAction
=
new
QAction
(
tr
(
"Open File &With..."
),
this
);
cmd
=
am
->
registerAction
(
m_openWithAction
,
Constants
::
OPEN_WITH
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
m_openWithAction
,
Constants
::
OPEN_WITH
,
globalContext
);
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_OPEN
);
connect
(
m_openWithAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openFileWith
()));
...
...
@@ -578,7 +579,7 @@ void MainWindow::registerDefaultActions()
// Save Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"document-save"
),
QIcon
(
Constants
::
ICON_SAVEFILE
));
QAction
*
tmpaction
=
new
QAction
(
icon
,
tr
(
"&Save"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
SAVE
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
SAVE
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Save
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
tr
(
"&Save"
));
...
...
@@ -587,7 +588,7 @@ void MainWindow::registerDefaultActions()
// Save As Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"document-save-as"
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"Save &As..."
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
SAVEAS
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
SAVEAS
,
globalContext
);
#ifdef Q_WS_MAC
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+Shift+S"
)));
#endif
...
...
@@ -597,7 +598,7 @@ void MainWindow::registerDefaultActions()
// SaveAll Action
m_saveAllAction
=
new
QAction
(
tr
(
"Save A&ll"
),
this
);
cmd
=
am
->
registerAction
(
m_saveAllAction
,
Constants
::
SAVEALL
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
m_saveAllAction
,
Constants
::
SAVEALL
,
globalContext
);
#ifndef Q_WS_MAC
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+Shift+S"
)));
#endif
...
...
@@ -607,14 +608,14 @@ void MainWindow::registerDefaultActions()
// Print Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"document-print"
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"&Print..."
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
PRINT
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
PRINT
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Print
);
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_PRINT
);
// Exit Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"application-exit"
));
m_exitAction
=
new
QAction
(
icon
,
tr
(
"E&xit"
),
this
);
cmd
=
am
->
registerAction
(
m_exitAction
,
Constants
::
EXIT
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
m_exitAction
,
Constants
::
EXIT
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+Q"
)));
mfile
->
addAction
(
cmd
,
Constants
::
G_FILE_OTHER
);
connect
(
m_exitAction
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
exit
()));
...
...
@@ -622,7 +623,7 @@ void MainWindow::registerDefaultActions()
// Undo Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"edit-undo"
),
QIcon
(
Constants
::
ICON_UNDO
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"&Undo"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
UNDO
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
UNDO
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Undo
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
tr
(
"&Undo"
));
...
...
@@ -632,7 +633,7 @@ void MainWindow::registerDefaultActions()
// Redo Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"edit-redo"
),
QIcon
(
Constants
::
ICON_REDO
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"&Redo"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
REDO
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
REDO
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Redo
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
cmd
->
setDefaultText
(
tr
(
"&Redo"
));
...
...
@@ -642,7 +643,7 @@ void MainWindow::registerDefaultActions()
// Cut Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"edit-cut"
),
QIcon
(
Constants
::
ICON_CUT
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"Cu&t"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
CUT
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
CUT
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Cut
);
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_COPYPASTE
);
tmpaction
->
setEnabled
(
false
);
...
...
@@ -650,7 +651,7 @@ void MainWindow::registerDefaultActions()
// Copy Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"edit-copy"
),
QIcon
(
Constants
::
ICON_COPY
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"&Copy"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
COPY
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
COPY
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Copy
);
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_COPYPASTE
);
tmpaction
->
setEnabled
(
false
);
...
...
@@ -658,7 +659,7 @@ void MainWindow::registerDefaultActions()
// Paste Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"edit-paste"
),
QIcon
(
Constants
::
ICON_PASTE
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"&Paste"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
PASTE
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
PASTE
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
Paste
);
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_COPYPASTE
);
tmpaction
->
setEnabled
(
false
);
...
...
@@ -666,7 +667,7 @@ void MainWindow::registerDefaultActions()
// Select All
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"edit-select-all"
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"&Select All"
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
SELECTALL
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
SELECTALL
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
::
SelectAll
);
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_SELECTALL
);
tmpaction
->
setEnabled
(
false
);
...
...
@@ -674,14 +675,14 @@ void MainWindow::registerDefaultActions()
// Goto Action
icon
=
QIcon
::
fromTheme
(
QLatin1String
(
"go-jump"
));
tmpaction
=
new
QAction
(
icon
,
tr
(
"&Go To Line..."
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
GOTO
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
GOTO
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+L"
)));
medit
->
addAction
(
cmd
,
Constants
::
G_EDIT_OTHER
);
tmpaction
->
setEnabled
(
false
);
// Options Action
m_optionsAction
=
new
QAction
(
tr
(
"&Options..."
),
this
);
cmd
=
am
->
registerAction
(
m_optionsAction
,
Constants
::
OPTIONS
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
m_optionsAction
,
Constants
::
OPTIONS
,
globalContext
);
#ifdef Q_WS_MAC
cmd
->
setDefaultKeySequence
(
QKeySequence
(
"Ctrl+,"
));
cmd
->
action
()
->
setMenuRole
(
QAction
::
PreferencesRole
);
...
...
@@ -712,7 +713,7 @@ void MainWindow::registerDefaultActions()
m_toggleSideBarAction
=
new
QAction
(
QIcon
(
Constants
::
ICON_TOGGLE_SIDEBAR
),
tr
(
"Show Sidebar"
),
this
);
m_toggleSideBarAction
->
setCheckable
(
true
);
cmd
=
am
->
registerAction
(
m_toggleSideBarAction
,
Constants
::
TOGGLE_SIDEBAR
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
m_toggleSideBarAction
,
Constants
::
TOGGLE_SIDEBAR
,
globalContext
);
cmd
->
setAttribute
(
Command
::
CA_UpdateText
);
#ifdef Q_WS_MAC
cmd
->
setDefaultKeySequence
(
QKeySequence
(
"Ctrl+0"
));
...
...
@@ -728,7 +729,7 @@ void MainWindow::registerDefaultActions()
// Full Screen Action
m_toggleFullScreenAction
=
new
QAction
(
tr
(
"Full Screen"
),
this
);
m_toggleFullScreenAction
->
setCheckable
(
true
);
cmd
=
am
->
registerAction
(
m_toggleFullScreenAction
,
Constants
::
TOGGLE_FULLSCREEN
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
m_toggleFullScreenAction
,
Constants
::
TOGGLE_FULLSCREEN
,
globalContext
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
"Ctrl+Shift+F11"
));
mwindow
->
addAction
(
cmd
,
Constants
::
G_WINDOW_SIZE
);
connect
(
m_toggleFullScreenAction
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
setFullScreen
(
bool
)));
...
...
@@ -746,7 +747,7 @@ void MainWindow::registerDefaultActions()
#else
tmpaction
=
new
QAction
(
icon
,
tr
(
"About &Qt Creator..."
),
this
);
#endif
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
ABOUT_QTCREATOR
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
ABOUT_QTCREATOR
,
globalContext
);
mhelp
->
addAction
(
cmd
,
Constants
::
G_HELP_ABOUT
);
tmpaction
->
setEnabled
(
true
);
#ifdef Q_WS_MAC
...
...
@@ -756,7 +757,7 @@ void MainWindow::registerDefaultActions()
//About Plugins Action
tmpaction
=
new
QAction
(
tr
(
"About &Plugins..."
),
this
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
ABOUT_PLUGINS
,
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
Constants
::
ABOUT_PLUGINS
,
globalContext
);
mhelp
->
addAction
(
cmd
,
Constants
::
G_HELP_ABOUT
);
tmpaction
->
setEnabled
(
true
);
#ifdef Q_WS_MAC
...
...
@@ -773,7 +774,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"
),
m_
globalContext
);
cmd
=
am
->
registerAction
(
tmpaction
,
QLatin1String
(
"QtCreator.Help.Sep.About"
),
globalContext
);
mhelp
->
addAction
(
cmd
,
Constants
::
G_HELP_ABOUT
);
#endif
}
...
...
src/plugins/coreplugin/mainwindow.h
View file @
f56dacc7
...
...
@@ -179,7 +179,6 @@ private:
CoreImpl
*
m_coreImpl
;
UniqueIDManager
*
m_uniqueIDManager
;
Context
m_globalContext
;
Context
m_additionalContexts
;
QSettings
*
m_settings
;
QSettings
*
m_globalSettings
;
...
...
src/plugins/coreplugin/modemanager.cpp
View file @
f56dacc7
...
...
@@ -179,7 +179,7 @@ void ModeManager::objectAdded(QObject *obj)
const
QString
shortcutId
=
QLatin1String
(
"QtCreator.Mode."
)
+
mode
->
id
();
QShortcut
*
shortcut
=
new
QShortcut
(
d
->
m_mainWindow
);
shortcut
->
setWhatsThis
(
tr
(
"Switch to <b>%1</b> mode"
).
arg
(
mode
->
displayName
()));
Command
*
cmd
=
am
->
registerShortcut
(
shortcut
,
shortcutId
,
Context
(
Constants
::
C_GLOBAL
_ID
));
Command
*
cmd
=
am
->
registerShortcut
(
shortcut
,
shortcutId
,
Context
(
Constants
::
C_GLOBAL
));
d
->
m_modeShortcuts
.
insert
(
index
,
cmd
);
connect
(
cmd
,
SIGNAL
(
keySequenceChanged
()),
this
,
SLOT
(
updateModeToolTip
()));
...
...
src/plugins/coreplugin/outputpane.cpp
View file @
f56dacc7
...
...
@@ -282,7 +282,7 @@ void OutputPaneManager::init()
{
ActionManager
*
am
=
Core
::
ICore
::
instance
()
->
actionManager
();
ActionContainer
*
mwindow
=
am
->
actionContainer
(
Constants
::
M_WINDOW
);
Context
globalcontext
=
Context
(
Core
::
Constants
::
C_GLOBAL
_ID
);
const
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
// Window->Output Panes
ActionContainer
*
mpanes
=
am
->
createMenu
(
Constants
::
M_WINDOW_PANES
);
...
...
@@ -356,7 +356,7 @@ void OutputPaneManager::init()
actionId
.
remove
(
QLatin1Char
(
' '
));
QAction
*
action
=
new
QAction
(
outPane
->
displayName
(),
this
);
Command
*
cmd
=
am
->
registerAction
(
action
,
actionId
,
Context
(
Constants
::
C_GLOBAL
_ID
));
Command
*
cmd
=
am
->
registerAction
(
action
,
actionId
,
Context
(
Constants
::
C_GLOBAL
));
mpanes
->
addAction
(
cmd
,
"Coreplugin.OutputPane.PanesGroup"
);
m_actions
.
insert
(
cmd
->
action
(),
idx
);
...
...
src/plugins/coreplugin/uniqueidmanager.cpp
View file @
f56dacc7
...
...
@@ -37,7 +37,6 @@ UniqueIDManager *UniqueIDManager::m_instance = 0;
UniqueIDManager
::
UniqueIDManager
()
{
m_instance
=
this
;
m_uniqueIdentifiers
.
insert
(
Constants
::
C_GLOBAL
,
Constants
::
C_GLOBAL_ID
);
}
UniqueIDManager
::~
UniqueIDManager
()
...
...
src/plugins/cppeditor/cppplugin.cpp
View file @
f56dacc7
...
...
@@ -272,7 +272,7 @@ bool CppPlugin::initialize(const QStringList & /*arguments*/, QString *errorMess
cppToolsMenu
->
addAction
(
cmd
);
// Update context in global context
Core
::
Context
globalContext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
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
);
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
f56dacc7
...
...
@@ -982,7 +982,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
Core
::
ActionManager
*
am
=
core
->
actionManager
();
QTC_ASSERT
(
am
,
return
false
);
const
Core
::
Context
globalcontext
(
CC
::
C_GLOBAL
_ID
);
const
Core
::
Context
globalcontext
(
CC
::
C_GLOBAL
);
const
Core
::
Context
cppDebuggercontext
(
C_CPPDEBUGGER
);
const
Core
::
Context
cppeditorcontext
(
CppEditor
::
Constants
::
C_CPPEDITOR
);
...
...
src/plugins/debugger/debuggeruiswitcher.cpp
View file @
f56dacc7
...
...
@@ -85,9 +85,6 @@ struct DebuggerUISwitcherPrivate
QStackedWidget
*
m_toolbarStack
;
Internal
::
DebuggerMainWindow
*
m_mainWindow
;
// global context
Core
::
Context
m_globalContext
;
QHash
<
int
,
Core
::
Context
>
m_contextsForLanguage
;
QActionGroup
*
m_languageActionGroup
;
...
...
@@ -139,8 +136,6 @@ DebuggerUISwitcher::DebuggerUISwitcher(Core::BaseMode *mode, QObject* parent) :
d
->
m_languageActionGroup
->
setExclusive
(
true
);
d
->
m_globalContext
.
add
(
Core
::
Constants
::
C_GLOBAL_ID
);
DebuggerUISwitcherPrivate
::
m_instance
=
this
;
}
...
...
@@ -212,7 +207,7 @@ void DebuggerUISwitcher::createViewsMenuItems()
{
Core
::
ICore
*
core
=
Core
::
ICore
::
instance
();
Core
::
ActionManager
*
am
=
core
->
actionManager
();
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
QMenu
*
mLang
=
d
->
m_languageMenu
->
menu
();
mLang
->
setTitle
(
tr
(
"&Languages"
));
...
...
@@ -248,10 +243,12 @@ void DebuggerUISwitcher::addLanguage(const QString &langName, const Core::Contex
d
->
m_languageActionGroup
->
addAction
(
langChange
);
QString
prefix
=
tr
(
"Alt+L"
);
connect
(
langChange
,
SIGNAL
(
triggered
()),
SLOT
(
langChangeTriggered
()));
Core
::
Command
*
cmd
=
am
->
registerAction
(
langChange
,
"Debugger.Language."
+
langName
,
d
->
m_globalContext
);
"Debugger.Language."
+
langName
,
Core
::
Context
(
Core
::
Constants
::
C_GLOBAL
));
cmd
->
setDefaultKeySequence
(
QKeySequence
(
QString
(
"%1,%2"
).
arg
(
prefix
).
arg
(
d
->
m_languages
.
count
())));
...
...
src/plugins/fakevim/fakevimplugin.cpp
View file @
f56dacc7
...
...
@@ -587,7 +587,7 @@ bool FakeVimPluginPrivate::initialize()
Core
::
ActionManager
*
actionManager
=
Core
::
ICore
::
instance
()
->
actionManager
();
QTC_ASSERT
(
actionManager
,
return
false
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
m_fakeVimOptionsPage
=
new
FakeVimOptionPage
;
q
->
addObject
(
m_fakeVimOptionsPage
);
...
...
src/plugins/find/findplugin.cpp
View file @
f56dacc7
...
...
@@ -192,7 +192,7 @@ void FindPlugin::setupMenu()
mfind
->
appendGroup
(
Constants
::
G_FIND_FILTERS
);
mfind
->
appendGroup
(
Constants
::
G_FIND_FLAGS
);
mfind
->
appendGroup
(
Constants
::
G_FIND_ACTIONS
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
Core
::
Command
*
cmd
;
QAction
*
separator
;
separator
=
new
QAction
(
this
);
...
...
@@ -220,7 +220,7 @@ void FindPlugin::setupFilterMenuItems()
QList
<
IFindFilter
*>
findInterfaces
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObjects
<
IFindFilter
>
();
Core
::
Command
*
cmd
;
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
Core
::
ActionContainer
*
mfindadvanced
=
am
->
actionContainer
(
Constants
::
M_FIND_ADVANCED
);
d
->
m_filterActions
.
clear
();
...
...
src/plugins/find/findtoolbar.cpp
View file @
f56dacc7
...
...
@@ -131,7 +131,7 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
QMetaTypeId
<
QStringList
>::
qt_metatype_id
();
// register actions
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
Core
::
ActionManager
*
am
=
Core
::
ICore
::
instance
()
->
actionManager
();
Core
::
ActionContainer
*
mfind
=
am
->
actionContainer
(
Constants
::
M_FIND
);
Core
::
Command
*
cmd
;
...
...
src/plugins/help/helpplugin.cpp
View file @
f56dacc7
...
...
@@ -119,7 +119,7 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
Q_UNUSED
(
arguments
)
Q_UNUSED
(
error
)
m_core
=
Core
::
ICore
::
instance
();
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
Core
::
Context
modecontext
(
Constants
::
C_MODE_HELP
);
const
QString
&
locale
=
qApp
->
property
(
"qtc_locale"
).
toString
();
...
...
src/plugins/locator/locatorplugin.cpp
View file @
f56dacc7
...
...
@@ -111,7 +111,7 @@ bool LocatorPlugin::initialize(const QStringList &, QString *)
const
QString
actionId
=
QLatin1String
(
"QtCreator.Locate"
);
QAction
*
action
=
new
QAction
(
m_locatorWidget
->
windowIcon
(),
m_locatorWidget
->
windowTitle
(),
this
);
Core
::
Command
*
cmd
=
core
->
actionManager
()
->
registerAction
(
action
,
actionId
,
Core
::
Context
(
Core
::
Constants
::
C_GLOBAL
_ID
));
Core
::
Command
*
cmd
=
core
->
actionManager
()
->
registerAction
(
action
,
actionId
,
Core
::
Context
(
Core
::
Constants
::
C_GLOBAL
));
cmd
->
setDefaultKeySequence
(
QKeySequence
(
"Ctrl+K"
));
connect
(
action
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openLocator
()));
...
...
src/plugins/perforce/perforceplugin.cpp
View file @
f56dacc7
...
...
@@ -266,7 +266,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
mtools
->
addMenu
(
mperforce
);
m_menuAction
=
mperforce
->
menu
()
->
menuAction
();
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
Core
::
Context
perforcesubmitcontext
(
Constants
::
PERFORCESUBMITEDITOR_CONTEXT
);
Core
::
Command
*
command
;
...
...
src/plugins/projectexplorer/outputwindow.cpp
View file @
f56dacc7
...
...
@@ -82,7 +82,7 @@ OutputPane::OutputPane()
// Stop
Core
::
ActionManager
*
am
=
Core
::
ICore
::
instance
()
->
actionManager
();
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
_ID
);
Core
::
Context
globalcontext
(
Core
::
Constants
::
C_GLOBAL
);
m_stopAction
=
new
QAction
(
QIcon
(
Constants
::
ICON_STOP
),
tr
(
"Stop"
),
this
);
m_stopAction
->
setToolTip
(
tr
(
"Stop"
));
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment