Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tobias Hunger
qt-creator
Commits
9f3ac20b
Commit
9f3ac20b
authored
Feb 04, 2010
by
con
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a tool tip for the target selector button.
parent
40bfe137
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
src/plugins/projectexplorer/miniprojecttargetselector.cpp
src/plugins/projectexplorer/miniprojecttargetselector.cpp
+24
-11
src/plugins/projectexplorer/miniprojecttargetselector.h
src/plugins/projectexplorer/miniprojecttargetselector.h
+1
-1
No files found.
src/plugins/projectexplorer/miniprojecttargetselector.cpp
View file @
9f3ac20b
...
...
@@ -203,13 +203,14 @@ void MiniTargetWidget::setActiveBuildConfiguration(int index)
ProjectExplorer
::
BuildConfiguration
*
bc
=
m_buildComboBox
->
itemData
(
index
).
value
<
ProjectExplorer
::
BuildConfiguration
*>
();
m_target
->
setActiveBuildConfiguration
(
bc
);
emit
activeBuildConfigurationC
hanged
(
bc
);
emit
c
hanged
();
}
void
MiniTargetWidget
::
setActiveRunConfiguration
(
int
index
)
{
m_target
->
setActiveRunConfiguration
(
m_runComboBox
->
itemData
(
index
).
value
<
ProjectExplorer
::
RunConfiguration
*>
());
emit
changed
();
}
void
MiniTargetWidget
::
setActiveBuildConfiguration
()
{
...
...
@@ -264,6 +265,7 @@ void MiniTargetWidget::updateDisplayName()
m_buildComboBox
->
setItemText
(
m_buildComboBox
->
findData
(
QVariant
::
fromValue
(
bc
)),
bc
->
displayName
());
}
emit
changed
();
}
bool
MiniTargetWidget
::
hasBuildConfiguration
()
const
...
...
@@ -377,14 +379,12 @@ void MiniProjectTargetSelector::addTarget(ProjectExplorer::Target *target, bool
if
(
index
<
0
)
return
;
connect
(
target
,
SIGNAL
(
activeBuildConfigurationChanged
(
ProjectExplorer
::
BuildConfiguration
*
)),
SLOT
(
updateAction
()));
ProjectListWidget
*
plw
=
qobject_cast
<
ProjectListWidget
*>
(
m_widgetStack
->
widget
(
index
));
QListWidgetItem
*
lwi
=
new
QListWidgetItem
();
plw
->
addItem
(
lwi
);
MiniTargetWidget
*
targetWidget
=
new
MiniTargetWidget
(
target
);
connect
(
targetWidget
,
SIGNAL
(
changed
()),
this
,
SLOT
(
updateAction
()));
targetWidget
->
installEventFilter
(
this
);
if
(
targetWidget
->
buildSettingsComboBox
())
targetWidget
->
buildSettingsComboBox
()
->
installEventFilter
(
this
);
...
...
@@ -425,23 +425,36 @@ void MiniProjectTargetSelector::updateAction()
Project
*
project
=
ProjectExplorerPlugin
::
instance
()
->
startupProject
();
QString
projectName
=
tr
(
"No Project"
);
QString
buildConfig
=
tr
(
"None"
);
QString
targetName
;
QString
buildConfig
;
QString
runConfig
;
if
(
project
)
{
projectName
=
project
->
displayName
();
if
(
project
->
activeTarget
()
&&
project
->
activeTarget
()
->
activeBuildConfiguration
())
{
if
(
BuildConfiguration
*
bc
=
project
->
activeTarget
()
->
activeBuildConfiguration
())
if
(
Target
*
target
=
project
->
activeTarget
())
{
if
(
project
->
targets
().
count
()
>
1
)
{
targetName
=
project
->
activeTarget
()
->
displayName
();
}
if
(
BuildConfiguration
*
bc
=
target
->
activeBuildConfiguration
())
{
buildConfig
=
bc
->
displayName
();
}
if
(
RunConfiguration
*
rc
=
target
->
activeRunConfiguration
())
{
runConfig
=
rc
->
displayName
();
}
}
}
m_projectAction
->
setProperty
(
"heading"
,
projectName
);
m_projectAction
->
setProperty
(
"subtitle"
,
buildConfig
);
if
(
project
&&
project
->
activeTarget
())
if
(
project
&&
project
->
activeTarget
())
m_projectAction
->
setIcon
(
project
->
activeTarget
()
->
icon
());
else
m_projectAction
->
setIcon
(
m_projectAction
->
icon
());
// Hack to force update!
QString
toolTip
=
tr
(
"<html><b>Project:</b> %1<br/>%2%3<b>Run:</b> %4</html>"
);
QString
targetTip
=
targetName
.
isEmpty
()
?
QLatin1String
(
""
)
:
tr
(
"<b>Target:</b> %1<br/>"
).
arg
(
targetName
);
QString
buildTip
=
buildConfig
.
isEmpty
()
?
QLatin1String
(
""
)
:
tr
(
"<b>Build:</b> %2<br/>"
).
arg
(
buildConfig
);
m_projectAction
->
setToolTip
(
toolTip
.
arg
(
projectName
,
targetTip
,
buildTip
,
runConfig
));
}
int
MiniProjectTargetSelector
::
indexFor
(
ProjectExplorer
::
Project
*
project
)
const
...
...
src/plugins/projectexplorer/miniprojecttargetselector.h
View file @
9f3ac20b
...
...
@@ -93,7 +93,7 @@ private slots:
void
updateDisplayName
();
signals:
void
activeBuildConfigurationChanged
(
ProjectExplorer
::
BuildConfiguration
*
buildConfig
);
void
changed
(
);
private:
QLabel
*
m_targetName
;
...
...
Write
Preview
Markdown
is supported
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