forked from qt-creator/qt-creator
iOS: Inline IosBuildStepConfigWidget
Also clean #includes. Change-Id: I105edb5f0505545a371db6944831a96b3e8db698 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -26,25 +26,20 @@
|
|||||||
#include "iosbuildstep.h"
|
#include "iosbuildstep.h"
|
||||||
#include "iosconstants.h"
|
#include "iosconstants.h"
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <projectexplorer/abstractprocessstep.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/project.h>
|
|
||||||
#include <projectexplorer/buildsteplist.h>
|
#include <projectexplorer/buildsteplist.h>
|
||||||
|
#include <projectexplorer/gcctoolchain.h>
|
||||||
#include <projectexplorer/gnumakeparser.h>
|
#include <projectexplorer/gnumakeparser.h>
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
|
||||||
#include <projectexplorer/processparameters.h>
|
#include <projectexplorer/processparameters.h>
|
||||||
|
#include <projectexplorer/project.h>
|
||||||
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
#include <projectexplorer/gcctoolchain.h>
|
|
||||||
#include <projectexplorer/abstractprocessstep.h>
|
|
||||||
|
|
||||||
#include <qtsupport/qtkitinformation.h>
|
|
||||||
#include <qtsupport/qtparser.h>
|
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/stringutils.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
|
|
||||||
@@ -73,6 +68,7 @@ class IosBuildStep final : public AbstractProcessStep
|
|||||||
public:
|
public:
|
||||||
IosBuildStep(BuildStepList *parent, Utils::Id id);
|
IosBuildStep(BuildStepList *parent, Utils::Id id);
|
||||||
|
|
||||||
|
private:
|
||||||
BuildStepConfigWidget *createConfigWidget() final;
|
BuildStepConfigWidget *createConfigWidget() final;
|
||||||
void setBaseArguments(const QStringList &args);
|
void setBaseArguments(const QStringList &args);
|
||||||
void setExtraArguments(const QStringList &extraArgs);
|
void setExtraArguments(const QStringList &extraArgs);
|
||||||
@@ -93,94 +89,67 @@ public:
|
|||||||
bool m_clean = false;
|
bool m_clean = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
BuildStepConfigWidget *IosBuildStep::createConfigWidget()
|
||||||
// IosBuildStepConfigWidget
|
|
||||||
//
|
|
||||||
|
|
||||||
class IosBuildStepConfigWidget final : public BuildStepConfigWidget
|
|
||||||
{
|
{
|
||||||
public:
|
auto widget = new BuildStepConfigWidget(this);
|
||||||
IosBuildStepConfigWidget(IosBuildStep *buildStep)
|
|
||||||
: BuildStepConfigWidget(buildStep), m_buildStep(buildStep)
|
|
||||||
{
|
|
||||||
auto buildArgumentsLabel = new QLabel(this);
|
|
||||||
buildArgumentsLabel->setText(IosBuildStep::tr("Base arguments:"));
|
|
||||||
|
|
||||||
m_buildArgumentsTextEdit = new QPlainTextEdit(this);
|
auto buildArgumentsLabel = new QLabel(tr("Base arguments:"), widget);
|
||||||
m_buildArgumentsTextEdit->setPlainText(QtcProcess::joinArgs(m_buildStep->baseArguments()));
|
|
||||||
|
|
||||||
m_resetDefaultsButton = new QPushButton(this);
|
auto buildArgumentsTextEdit = new QPlainTextEdit(widget);
|
||||||
m_resetDefaultsButton->setLayoutDirection(Qt::RightToLeft);
|
buildArgumentsTextEdit->setPlainText(QtcProcess::joinArgs(baseArguments()));
|
||||||
m_resetDefaultsButton->setText(IosBuildStep::tr("Reset Defaults"));
|
|
||||||
m_resetDefaultsButton->setEnabled(!m_buildStep->m_useDefaultArguments);
|
|
||||||
|
|
||||||
auto extraArgumentsLabel = new QLabel(this);
|
auto resetDefaultsButton = new QPushButton(widget);
|
||||||
|
resetDefaultsButton->setLayoutDirection(Qt::RightToLeft);
|
||||||
|
resetDefaultsButton->setText(tr("Reset Defaults"));
|
||||||
|
resetDefaultsButton->setEnabled(!m_useDefaultArguments);
|
||||||
|
|
||||||
m_extraArgumentsLineEdit = new QLineEdit(this);
|
auto extraArgumentsLabel = new QLabel(tr("Extra arguments:"), widget);
|
||||||
m_extraArgumentsLineEdit->setText(QtcProcess::joinArgs(m_buildStep->m_extraArguments));
|
|
||||||
|
|
||||||
auto gridLayout = new QGridLayout(this);
|
auto extraArgumentsLineEdit = new QLineEdit(widget);
|
||||||
|
extraArgumentsLineEdit->setText(QtcProcess::joinArgs(m_extraArguments));
|
||||||
|
|
||||||
|
auto gridLayout = new QGridLayout(widget);
|
||||||
gridLayout->addWidget(buildArgumentsLabel, 0, 0, 1, 1);
|
gridLayout->addWidget(buildArgumentsLabel, 0, 0, 1, 1);
|
||||||
gridLayout->addWidget(m_buildArgumentsTextEdit, 0, 1, 2, 1);
|
gridLayout->addWidget(buildArgumentsTextEdit, 0, 1, 2, 1);
|
||||||
gridLayout->addWidget(m_resetDefaultsButton, 1, 2, 1, 1);
|
gridLayout->addWidget(resetDefaultsButton, 1, 2, 1, 1);
|
||||||
gridLayout->addWidget(extraArgumentsLabel, 2, 0, 1, 1);
|
gridLayout->addWidget(extraArgumentsLabel, 2, 0, 1, 1);
|
||||||
gridLayout->addWidget(m_extraArgumentsLineEdit, 2, 1, 1, 1);
|
gridLayout->addWidget(extraArgumentsLineEdit, 2, 1, 1, 1);
|
||||||
|
|
||||||
extraArgumentsLabel->setText(IosBuildStep::tr("Extra arguments:"));
|
setDisplayName(tr("iOS build", "iOS BuildStep display name."));
|
||||||
|
|
||||||
setDisplayName(IosBuildStep::tr("iOS build", "iOS BuildStep display name."));
|
auto updateDetails = [this, widget] {
|
||||||
|
ProcessParameters param;
|
||||||
|
setupProcessParameters(¶m);
|
||||||
|
widget->setSummaryText(param.summary(displayName()));
|
||||||
|
};
|
||||||
|
|
||||||
updateDetails();
|
updateDetails();
|
||||||
|
|
||||||
connect(m_buildArgumentsTextEdit, &QPlainTextEdit::textChanged,
|
connect(buildArgumentsTextEdit, &QPlainTextEdit::textChanged, this, [=] {
|
||||||
this, &IosBuildStepConfigWidget::buildArgumentsChanged);
|
setBaseArguments(QtcProcess::splitArgs(buildArgumentsTextEdit->toPlainText()));
|
||||||
connect(m_resetDefaultsButton, &QAbstractButton::clicked,
|
resetDefaultsButton->setEnabled(!m_useDefaultArguments);
|
||||||
this, &IosBuildStepConfigWidget::resetDefaultArguments);
|
updateDetails();
|
||||||
connect(m_extraArgumentsLineEdit, &QLineEdit::editingFinished,
|
});
|
||||||
this, &IosBuildStepConfigWidget::extraArgumentsChanged);
|
|
||||||
|
connect(resetDefaultsButton, &QAbstractButton::clicked, this, [=] {
|
||||||
|
setBaseArguments(defaultArguments());
|
||||||
|
buildArgumentsTextEdit->setPlainText(QtcProcess::joinArgs(baseArguments()));
|
||||||
|
resetDefaultsButton->setEnabled(!m_useDefaultArguments);
|
||||||
|
});
|
||||||
|
|
||||||
|
connect(extraArgumentsLineEdit, &QLineEdit::editingFinished, [=] {
|
||||||
|
setExtraArguments(QtcProcess::splitArgs(extraArgumentsLineEdit->text()));
|
||||||
|
});
|
||||||
|
|
||||||
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
|
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
|
||||||
this, &IosBuildStepConfigWidget::updateDetails);
|
this, updateDetails);
|
||||||
connect(m_buildStep->target(), &Target::kitChanged,
|
connect(target(), &Target::kitChanged,
|
||||||
this, &IosBuildStepConfigWidget::updateDetails);
|
this, updateDetails);
|
||||||
|
connect(buildConfiguration(), &BuildConfiguration::environmentChanged,
|
||||||
|
this, updateDetails);
|
||||||
|
|
||||||
connect(m_buildStep->buildConfiguration(), &BuildConfiguration::environmentChanged,
|
return widget;
|
||||||
this, &IosBuildStepConfigWidget::updateDetails);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
void buildArgumentsChanged()
|
|
||||||
{
|
|
||||||
m_buildStep->setBaseArguments(QtcProcess::splitArgs(m_buildArgumentsTextEdit->toPlainText()));
|
|
||||||
m_resetDefaultsButton->setEnabled(!m_buildStep->m_useDefaultArguments);
|
|
||||||
updateDetails();
|
|
||||||
}
|
|
||||||
|
|
||||||
void resetDefaultArguments()
|
|
||||||
{
|
|
||||||
m_buildStep->setBaseArguments(m_buildStep->defaultArguments());
|
|
||||||
m_buildArgumentsTextEdit->setPlainText(QtcProcess::joinArgs(m_buildStep->baseArguments()));
|
|
||||||
m_resetDefaultsButton->setEnabled(!m_buildStep->m_useDefaultArguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
void extraArgumentsChanged()
|
|
||||||
{
|
|
||||||
m_buildStep->setExtraArguments(QtcProcess::splitArgs(m_extraArgumentsLineEdit->text()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateDetails()
|
|
||||||
{
|
|
||||||
ProcessParameters param;
|
|
||||||
m_buildStep->setupProcessParameters(¶m);
|
|
||||||
setSummaryText(param.summary(displayName()));
|
|
||||||
}
|
|
||||||
|
|
||||||
IosBuildStep *m_buildStep;
|
|
||||||
|
|
||||||
QPlainTextEdit *m_buildArgumentsTextEdit;
|
|
||||||
QPushButton *m_resetDefaultsButton;
|
|
||||||
QLineEdit *m_extraArgumentsLineEdit;
|
|
||||||
};
|
|
||||||
|
|
||||||
IosBuildStep::IosBuildStep(BuildStepList *parent, Id id)
|
IosBuildStep::IosBuildStep(BuildStepList *parent, Id id)
|
||||||
: AbstractProcessStep(parent, id)
|
: AbstractProcessStep(parent, id)
|
||||||
@@ -293,11 +262,6 @@ void IosBuildStep::doRun()
|
|||||||
AbstractProcessStep::doRun();
|
AbstractProcessStep::doRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStepConfigWidget *IosBuildStep::createConfigWidget()
|
|
||||||
{
|
|
||||||
return new IosBuildStepConfigWidget(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void IosBuildStep::setBaseArguments(const QStringList &args)
|
void IosBuildStep::setBaseArguments(const QStringList &args)
|
||||||
{
|
{
|
||||||
m_baseBuildArguments = args;
|
m_baseBuildArguments = args;
|
||||||
|
Reference in New Issue
Block a user