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
Marco Bubke
flatpak-qt-creator
Commits
171899d7
Commit
171899d7
authored
Oct 29, 2009
by
dt
Browse files
Add a Make this Buildconfiguration active label
parent
e903c4d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/buildsettingspropertiespage.cpp
View file @
171899d7
...
...
@@ -35,6 +35,7 @@
#include <coreplugin/coreconstants.h>
#include <extensionsystem/pluginmanager.h>
#include <utils/qtcassert.h>
#include <QtCore/QDebug>
#include <QtCore/QPair>
...
...
@@ -151,23 +152,30 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project)
{
QVBoxLayout
*
vbox
=
new
QVBoxLayout
(
this
);
vbox
->
setContentsMargins
(
0
,
-
1
,
0
,
-
1
);
QHBoxLayout
*
hbox
=
new
QHBoxLayout
();
hbox
->
addWidget
(
new
QLabel
(
tr
(
"Edit Build Configuration:"
),
this
));
m_buildConfigurationComboBox
=
new
QComboBox
(
this
);
m_buildConfigurationComboBox
->
setSizeAdjustPolicy
(
QComboBox
::
AdjustToContents
);
hbox
->
addWidget
(
m_buildConfigurationComboBox
);
m_addButton
=
new
QPushButton
(
this
);
m_addButton
->
setText
(
tr
(
"Add"
));
m_addButton
->
setSizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Fixed
);
hbox
->
addWidget
(
m_addButton
);
m_removeButton
=
new
QPushButton
(
this
);
m_removeButton
->
setText
(
tr
(
"Remove"
));
m_removeButton
->
setSizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Fixed
);
hbox
->
addWidget
(
m_removeButton
);
hbox
->
addSpacerItem
(
new
QSpacerItem
(
0
,
0
,
QSizePolicy
::
Expanding
,
QSizePolicy
::
Fixed
));
vbox
->
addLayout
(
hbox
);
{
// Edit Build Configuration row
QHBoxLayout
*
hbox
=
new
QHBoxLayout
();
hbox
->
addWidget
(
new
QLabel
(
tr
(
"Edit Build Configuration:"
),
this
));
m_buildConfigurationComboBox
=
new
QComboBox
(
this
);
m_buildConfigurationComboBox
->
setSizeAdjustPolicy
(
QComboBox
::
AdjustToContents
);
hbox
->
addWidget
(
m_buildConfigurationComboBox
);
m_addButton
=
new
QPushButton
(
this
);
m_addButton
->
setText
(
tr
(
"Add"
));
m_addButton
->
setSizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Fixed
);
hbox
->
addWidget
(
m_addButton
);
m_removeButton
=
new
QPushButton
(
this
);
m_removeButton
->
setText
(
tr
(
"Remove"
));
m_removeButton
->
setSizePolicy
(
QSizePolicy
::
Fixed
,
QSizePolicy
::
Fixed
);
hbox
->
addWidget
(
m_removeButton
);
hbox
->
addSpacerItem
(
new
QSpacerItem
(
0
,
0
,
QSizePolicy
::
Expanding
,
QSizePolicy
::
Fixed
));
vbox
->
addLayout
(
hbox
);
}
m_makeActiveLabel
=
new
QLabel
(
this
);
m_makeActiveLabel
->
setVisible
(
false
);
vbox
->
addWidget
(
m_makeActiveLabel
);
m_subWidgets
=
new
BuildSettingsSubWidgets
(
this
);
vbox
->
addWidget
(
m_subWidgets
);
...
...
@@ -178,6 +186,9 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project)
m_buildConfiguration
=
m_project
->
activeBuildConfiguration
()
->
name
();
connect
(
m_makeActiveLabel
,
SIGNAL
(
linkActivated
(
QString
)),
this
,
SLOT
(
makeActive
()));
connect
(
m_buildConfigurationComboBox
,
SIGNAL
(
currentIndexChanged
(
int
)),
this
,
SLOT
(
currentIndexChanged
(
int
)));
...
...
@@ -186,12 +197,21 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project)
connect
(
m_project
,
SIGNAL
(
buildConfigurationDisplayNameChanged
(
const
QString
&
)),
this
,
SLOT
(
buildConfigurationDisplayNameChanged
(
const
QString
&
)));
connect
(
m_project
,
SIGNAL
(
activeBuildConfigurationChanged
()),
this
,
SLOT
(
checkMakeActiveLabel
()));
if
(
m_project
->
buildConfigurationFactory
())
connect
(
m_project
->
buildConfigurationFactory
(),
SIGNAL
(
availableCreationTypesChanged
()),
SLOT
(
updateAddButtonMenu
()));
updateBuildSettings
();
}
void
BuildSettingsWidget
::
makeActive
()
{
m_project
->
setActiveBuildConfiguration
(
m_project
->
buildConfiguration
(
m_buildConfiguration
));
}
void
BuildSettingsWidget
::
updateAddButtonMenu
()
{
m_addButtonMenu
->
clear
();
...
...
@@ -273,6 +293,18 @@ void BuildSettingsWidget::activeBuildConfigurationChanged()
buildStepWidget
->
init
(
m_buildConfiguration
);
}
}
checkMakeActiveLabel
();
}
void
BuildSettingsWidget
::
checkMakeActiveLabel
()
{
m_makeActiveLabel
->
setVisible
(
false
);
if
(
!
m_project
->
activeBuildConfiguration
()
||
m_project
->
activeBuildConfiguration
()
->
name
()
!=
m_buildConfiguration
)
{
BuildConfiguration
*
bc
=
m_project
->
buildConfiguration
(
m_buildConfiguration
);
QTC_ASSERT
(
bc
,
return
);
m_makeActiveLabel
->
setText
(
tr
(
"<a href=
\"
#
\"
>Make %1 active.</a>"
).
arg
(
bc
->
displayName
()));
m_makeActiveLabel
->
setVisible
(
true
);
}
}
void
BuildSettingsWidget
::
createConfiguration
()
...
...
src/plugins/projectexplorer/buildsettingspropertiespage.h
View file @
171899d7
...
...
@@ -101,6 +101,8 @@ private slots:
void
cloneConfiguration
();
void
deleteConfiguration
();
void
updateAddButtonMenu
();
void
checkMakeActiveLabel
();
void
makeActive
();
private:
void
cloneConfiguration
(
const
QString
&
toClone
);
...
...
@@ -113,6 +115,7 @@ private:
BuildSettingsSubWidgets
*
m_subWidgets
;
QString
m_buildConfiguration
;
QMenu
*
m_addButtonMenu
;
QLabel
*
m_makeActiveLabel
;
};
}
// namespace Internal
...
...
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