Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
21b26a79
Commit
21b26a79
authored
Mar 08, 2010
by
Lasse Holmstedt
Browse files
Show different tooltips for run/debug actions when no project selected
Task-number: QTCREATOR-191 Reviewed-by: dt
parent
0e163256
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/projectexplorer.cpp
View file @
21b26a79
...
...
@@ -630,6 +630,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
runIcon
.
addFile
(
Constants
::
ICON_RUN_SMALL
);
d
->
m_runAction
=
new
QAction
(
runIcon
,
tr
(
"Run"
),
this
);
cmd
=
am
->
registerAction
(
d
->
m_runAction
,
Constants
::
RUN
,
globalcontext
);
cmd
->
setAttribute
(
Core
::
Command
::
CA_UpdateText
);
cmd
->
setDefaultKeySequence
(
QKeySequence
(
tr
(
"Ctrl+R"
)));
mbuild
->
addAction
(
cmd
,
Constants
::
G_BUILD_RUN
);
...
...
@@ -1727,22 +1729,31 @@ void ProjectExplorerPlugin::updateRunActions()
if
(
!
project
||
!
project
->
activeTarget
()
||
!
project
->
activeTarget
()
->
activeRunConfiguration
())
{
d
->
m_runAction
->
setToolTip
(
tr
(
"Cannot run without a project."
));
d
->
m_debugAction
->
setToolTip
(
tr
(
"Cannot debug without a project."
));
d
->
m_runAction
->
setEnabled
(
false
);
d
->
m_debugAction
->
setEnabled
(
false
);
return
;
}
d
->
m_runAction
->
setToolTip
(
QString
());
d
->
m_debugAction
->
setToolTip
(
QString
());
bool
canRun
=
findRunControlFactory
(
project
->
activeTarget
()
->
activeRunConfiguration
(),
ProjectExplorer
::
Constants
::
RUNMODE
)
&&
project
->
activeTarget
()
->
activeRunConfiguration
()
->
isEnabled
();
const
bool
canDebug
=
!
d
->
m_debuggingRunControl
&&
findRunControlFactory
(
project
->
activeTarget
()
->
activeRunConfiguration
(),
ProjectExplorer
::
Constants
::
DEBUGMODE
)
&&
project
->
activeTarget
()
->
activeRunConfiguration
()
->
isEnabled
();
const
bool
building
=
d
->
m_buildManager
->
isBuilding
();
d
->
m_runAction
->
setEnabled
(
canRun
&&
!
building
);
canRun
=
d
->
m_currentProject
&&
findRunControlFactory
(
d
->
m_currentProject
->
activeTarget
()
->
activeRunConfiguration
(),
ProjectExplorer
::
Constants
::
RUNMODE
);
d
->
m_runActionContextMenu
->
setEnabled
(
canRun
&&
!
building
);
d
->
m_debugAction
->
setEnabled
(
canDebug
&&
!
building
);
}
void
ProjectExplorerPlugin
::
cancelBuild
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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