forked from qt-creator/qt-creator
Qbs/Qmake: Centralize build step variable chooser creation
This is nothing individual steps should worry about anymore. Similar to what RunConfiguration::createConfigurationWidget() did already. Change-Id: I5e29e7ceff5b6761952a0a123d9198a0d381cf4f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -93,6 +93,7 @@ BuildStep::BuildStep(BuildStepList *bsl, Id id)
|
||||
QWidget *BuildStep::doCreateConfigWidget()
|
||||
{
|
||||
QWidget *widget = createConfigWidget();
|
||||
VariableChooser::addSupportForChildWidgets(widget, macroExpander());
|
||||
|
||||
const auto recreateSummary = [this] {
|
||||
if (m_summaryUpdater)
|
||||
|
@@ -22,7 +22,6 @@
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QThread>
|
||||
|
||||
@@ -322,8 +321,6 @@ QWidget *MakeStep::createConfigWidget()
|
||||
|
||||
auto widget = builder.emerge();
|
||||
|
||||
VariableChooser::addSupportForChildWidgets(widget, macroExpander());
|
||||
|
||||
setSummaryUpdater([this] {
|
||||
const CommandLine make = effectiveMakeCommand(MakeStep::Display);
|
||||
if (make.executable().isEmpty())
|
||||
|
@@ -22,11 +22,9 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/guard.h>
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/macroexpander.h>
|
||||
#include <utils/outputformatter.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QJsonArray>
|
||||
@@ -486,8 +484,13 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step)
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
propertyEdit = new FancyLineEdit(this);
|
||||
propertyEdit->setToolTip(QbsProjectManager::Tr::tr("Properties to pass to the project."));
|
||||
propertyEdit->setValidationFunction([this](FancyLineEdit *edit, QString *errorMessage) {
|
||||
return validateProperties(edit, errorMessage);
|
||||
});
|
||||
|
||||
defaultInstallDirCheckBox = new QCheckBox(this);
|
||||
defaultInstallDirCheckBox->setText(QbsProjectManager::Tr::tr("Use default location"));
|
||||
|
||||
installDirChooser = new PathChooser(this);
|
||||
installDirChooser->setExpectedKind(PathChooser::Directory);
|
||||
@@ -514,17 +517,6 @@ QbsBuildStepConfigWidget::QbsBuildStepConfigWidget(QbsBuildStep *step)
|
||||
noMargin,
|
||||
}.attachTo(this);
|
||||
|
||||
propertyEdit->setToolTip(QbsProjectManager::Tr::tr("Properties to pass to the project."));
|
||||
defaultInstallDirCheckBox->setText(QbsProjectManager::Tr::tr("Use default location"));
|
||||
|
||||
auto chooser = new VariableChooser(this);
|
||||
chooser->addMacroExpanderProvider([this] { return m_qbsStep->macroExpander(); });
|
||||
chooser->addSupportedWidget(propertyEdit);
|
||||
chooser->addSupportedWidget(installDirChooser->lineEdit());
|
||||
propertyEdit->setValidationFunction([this](FancyLineEdit *edit, QString *errorMessage) {
|
||||
return validateProperties(edit, errorMessage);
|
||||
});
|
||||
|
||||
connect(defaultInstallDirCheckBox, &QCheckBox::toggled, this,
|
||||
&QbsBuildStepConfigWidget::changeUseDefaultInstallDir);
|
||||
|
||||
|
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
|
||||
#include <qtsupport/qtkitaspect.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
@@ -39,7 +40,6 @@
|
||||
#include <utils/layoutbuilder.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <utils/utilsicons.h>
|
||||
#include <utils/variablechooser.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QLabel>
|
||||
@@ -479,8 +479,6 @@ QWidget *QMakeStep::createConfigWidget()
|
||||
abisListWidget = nullptr;
|
||||
});
|
||||
|
||||
VariableChooser::addSupportForChildWidgets(widget, macroExpander());
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user