forked from qt-creator/qt-creator
iOS: Inline IosDsymBuildStepWidget
Change-Id: Ie14377dd5057d7def2366f0110838626a2f4ea29 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -12,7 +12,6 @@ add_qtc_plugin(Ios
|
||||
iosdevice.cpp iosdevice.h
|
||||
iosdsymbuildstep.cpp iosdsymbuildstep.h
|
||||
iosplugin.cpp iosplugin.h
|
||||
iospresetbuildstep.ui
|
||||
iosprobe.cpp iosprobe.h
|
||||
iosqtversion.cpp iosqtversion.h
|
||||
iosrunconfiguration.cpp iosrunconfiguration.h
|
||||
|
@@ -53,7 +53,6 @@ SOURCES += \
|
||||
|
||||
FORMS += \
|
||||
iossettingswidget.ui \
|
||||
iospresetbuildstep.ui \
|
||||
createsimulatordialog.ui \
|
||||
simulatoroperationdialog.ui
|
||||
|
||||
|
@@ -33,7 +33,6 @@ QtcPlugin {
|
||||
"iosdsymbuildstep.h",
|
||||
"iosplugin.cpp",
|
||||
"iosplugin.h",
|
||||
"iospresetbuildstep.ui",
|
||||
"iosprobe.cpp",
|
||||
"iosprobe.h",
|
||||
"iosqtversion.cpp",
|
||||
|
@@ -26,7 +26,6 @@
|
||||
#include "iosdsymbuildstep.h"
|
||||
|
||||
#include "iosconstants.h"
|
||||
#include "ui_iospresetbuildstep.h"
|
||||
#include "iosconfigurations.h"
|
||||
#include "iosrunconfiguration.h"
|
||||
|
||||
@@ -47,6 +46,12 @@
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QPushButton>
|
||||
|
||||
using namespace Core;
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
@@ -178,11 +183,6 @@ bool IosDsymBuildStep::isDefault() const
|
||||
return arguments() == defaultArguments() && command() == defaultCommand();
|
||||
}
|
||||
|
||||
void IosDsymBuildStep::doRun()
|
||||
{
|
||||
AbstractProcessStep::doRun();
|
||||
}
|
||||
|
||||
void IosDsymBuildStep::setupOutputFormatter(OutputFormatter *formatter)
|
||||
{
|
||||
formatter->setLineParsers(target()->kit()->createOutputParsers());
|
||||
@@ -190,11 +190,6 @@ void IosDsymBuildStep::setupOutputFormatter(OutputFormatter *formatter)
|
||||
AbstractProcessStep::setupOutputFormatter(formatter);
|
||||
}
|
||||
|
||||
BuildStepConfigWidget *IosDsymBuildStep::createConfigWidget()
|
||||
{
|
||||
return new IosDsymBuildStepConfigWidget(this);
|
||||
}
|
||||
|
||||
void IosDsymBuildStep::setArguments(const QStringList &args)
|
||||
{
|
||||
if (arguments() == args)
|
||||
@@ -215,73 +210,72 @@ QStringList IosDsymBuildStep::arguments() const
|
||||
return m_arguments;
|
||||
}
|
||||
|
||||
//
|
||||
// IosDsymBuildStepConfigWidget
|
||||
//
|
||||
|
||||
IosDsymBuildStepConfigWidget::IosDsymBuildStepConfigWidget(IosDsymBuildStep *buildStep)
|
||||
: BuildStepConfigWidget(buildStep), m_buildStep(buildStep)
|
||||
BuildStepConfigWidget *IosDsymBuildStep::createConfigWidget()
|
||||
{
|
||||
m_ui = new Ui::IosPresetBuildStep;
|
||||
m_ui->setupUi(this);
|
||||
auto widget = new BuildStepConfigWidget(this);
|
||||
|
||||
auto commandLabel = new QLabel(tr("Command:"), widget);
|
||||
|
||||
auto commandLineEdit = new QLineEdit(widget);
|
||||
commandLineEdit->setText(command().toString());
|
||||
|
||||
auto argumentsTextEdit = new QPlainTextEdit(widget);
|
||||
argumentsTextEdit->setPlainText(Utils::QtcProcess::joinArgs(arguments()));
|
||||
|
||||
auto argumentsLabel = new QLabel(tr("Arguments:"), widget);
|
||||
|
||||
auto resetDefaultsButton = new QPushButton(tr("Reset to Default"), widget);
|
||||
resetDefaultsButton->setLayoutDirection(Qt::RightToLeft);
|
||||
resetDefaultsButton->setEnabled(!isDefault());
|
||||
|
||||
auto gridLayout = new QGridLayout(widget);
|
||||
gridLayout->addWidget(commandLabel, 0, 0, 1, 1);
|
||||
gridLayout->addWidget(commandLineEdit, 0, 2, 1, 1);
|
||||
gridLayout->addWidget(argumentsLabel, 1, 0, 1, 1);
|
||||
gridLayout->addWidget(argumentsTextEdit, 1, 2, 2, 1);
|
||||
gridLayout->addWidget(resetDefaultsButton, 2, 3, 1, 1);
|
||||
|
||||
auto updateDetails = [this, widget] {
|
||||
ProcessParameters param;
|
||||
setupProcessParameters(¶m);
|
||||
widget->setSummaryText(param.summary(displayName()));
|
||||
};
|
||||
|
||||
m_ui->commandLineEdit->setText(m_buildStep->command().toString());
|
||||
m_ui->argumentsTextEdit->setPlainText(Utils::QtcProcess::joinArgs(
|
||||
m_buildStep->arguments()));
|
||||
m_ui->resetDefaultsButton->setEnabled(!m_buildStep->isDefault());
|
||||
updateDetails();
|
||||
|
||||
connect(m_ui->argumentsTextEdit, &QPlainTextEdit::textChanged,
|
||||
this, &IosDsymBuildStepConfigWidget::argumentsChanged);
|
||||
connect(m_ui->commandLineEdit, &QLineEdit::editingFinished,
|
||||
this, &IosDsymBuildStepConfigWidget::commandChanged);
|
||||
connect(m_ui->resetDefaultsButton, &QAbstractButton::clicked,
|
||||
this, &IosDsymBuildStepConfigWidget::resetDefaults);
|
||||
connect(argumentsTextEdit, &QPlainTextEdit::textChanged, this,
|
||||
[this, argumentsTextEdit, resetDefaultsButton, updateDetails] {
|
||||
setArguments(Utils::QtcProcess::splitArgs(argumentsTextEdit->toPlainText()));
|
||||
resetDefaultsButton->setEnabled(!isDefault());
|
||||
updateDetails();
|
||||
});
|
||||
|
||||
connect(commandLineEdit, &QLineEdit::editingFinished, this,
|
||||
[this, commandLineEdit, resetDefaultsButton, updateDetails] {
|
||||
setCommand(FilePath::fromString(commandLineEdit->text()));
|
||||
resetDefaultsButton->setEnabled(!isDefault());
|
||||
updateDetails();
|
||||
});
|
||||
|
||||
connect(resetDefaultsButton, &QAbstractButton::clicked, this,
|
||||
[this, commandLineEdit, resetDefaultsButton, argumentsTextEdit, updateDetails] {
|
||||
setCommand(defaultCommand());
|
||||
setArguments(defaultArguments());
|
||||
commandLineEdit->setText(command().toString());
|
||||
argumentsTextEdit->setPlainText(Utils::QtcProcess::joinArgs(arguments()));
|
||||
resetDefaultsButton->setEnabled(!isDefault());
|
||||
updateDetails();
|
||||
});
|
||||
|
||||
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::settingsChanged,
|
||||
this, &IosDsymBuildStepConfigWidget::updateDetails);
|
||||
connect(m_buildStep->target(), &Target::kitChanged,
|
||||
this, &IosDsymBuildStepConfigWidget::updateDetails);
|
||||
connect(m_buildStep->buildConfiguration(), &BuildConfiguration::enabledChanged,
|
||||
this, &IosDsymBuildStepConfigWidget::updateDetails);
|
||||
}
|
||||
this, updateDetails);
|
||||
connect(target(), &Target::kitChanged,
|
||||
this, updateDetails);
|
||||
connect(buildConfiguration(), &BuildConfiguration::enabledChanged,
|
||||
this, updateDetails);
|
||||
|
||||
IosDsymBuildStepConfigWidget::~IosDsymBuildStepConfigWidget()
|
||||
{
|
||||
delete m_ui;
|
||||
}
|
||||
|
||||
void IosDsymBuildStepConfigWidget::updateDetails()
|
||||
{
|
||||
ProcessParameters param;
|
||||
m_buildStep->setupProcessParameters(¶m);
|
||||
setSummaryText(param.summary(displayName()));
|
||||
}
|
||||
|
||||
void IosDsymBuildStepConfigWidget::commandChanged()
|
||||
{
|
||||
m_buildStep->setCommand(FilePath::fromString(m_ui->commandLineEdit->text()));
|
||||
m_ui->resetDefaultsButton->setEnabled(!m_buildStep->isDefault());
|
||||
updateDetails();
|
||||
}
|
||||
|
||||
void IosDsymBuildStepConfigWidget::argumentsChanged()
|
||||
{
|
||||
m_buildStep->setArguments(Utils::QtcProcess::splitArgs(
|
||||
m_ui->argumentsTextEdit->toPlainText()));
|
||||
m_ui->resetDefaultsButton->setEnabled(!m_buildStep->isDefault());
|
||||
updateDetails();
|
||||
}
|
||||
|
||||
void IosDsymBuildStepConfigWidget::resetDefaults()
|
||||
{
|
||||
m_buildStep->setCommand(m_buildStep->defaultCommand());
|
||||
m_buildStep->setArguments(m_buildStep->defaultArguments());
|
||||
m_ui->commandLineEdit->setText(m_buildStep->command().toString());
|
||||
m_ui->argumentsTextEdit->setPlainText(Utils::QtcProcess::joinArgs(
|
||||
m_buildStep->arguments()));
|
||||
m_ui->resetDefaultsButton->setEnabled(!m_buildStep->isDefault());
|
||||
updateDetails();
|
||||
return widget;
|
||||
}
|
||||
|
||||
//
|
||||
|
@@ -31,16 +31,11 @@
|
||||
|
||||
namespace Ios {
|
||||
namespace Internal {
|
||||
namespace Ui { class IosPresetBuildStep; }
|
||||
|
||||
class IosDsymBuildStepConfigWidget;
|
||||
|
||||
class IosDsymBuildStep : public ProjectExplorer::AbstractProcessStep
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
friend class IosDsymBuildStepConfigWidget;
|
||||
|
||||
public:
|
||||
IosDsymBuildStep(ProjectExplorer::BuildStepList *parent, Utils::Id id);
|
||||
|
||||
@@ -55,7 +50,6 @@ public:
|
||||
|
||||
private:
|
||||
bool init() override;
|
||||
void doRun() override;
|
||||
void setupOutputFormatter(Utils::OutputFormatter *formatter) override;
|
||||
QVariantMap toMap() const override;
|
||||
bool fromMap(const QVariantMap &map) override;
|
||||
@@ -68,24 +62,6 @@ private:
|
||||
bool m_clean;
|
||||
};
|
||||
|
||||
class IosDsymBuildStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
IosDsymBuildStepConfigWidget(IosDsymBuildStep *buildStep);
|
||||
~IosDsymBuildStepConfigWidget() override;
|
||||
|
||||
private:
|
||||
void commandChanged();
|
||||
void argumentsChanged();
|
||||
void resetDefaults();
|
||||
void updateDetails();
|
||||
|
||||
Ui::IosPresetBuildStep *m_ui;
|
||||
IosDsymBuildStep *m_buildStep;
|
||||
};
|
||||
|
||||
class IosDsymBuildStepFactory : public ProjectExplorer::BuildStepFactory
|
||||
{
|
||||
public:
|
||||
|
@@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>Ios::Internal::IosPresetBuildStep</class>
|
||||
<widget class="QWidget" name="Ios::Internal::IosPresetBuildStep">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>756</width>
|
||||
<height>133</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="resetDefaultsButton">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Reset to Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="commandLabel">
|
||||
<property name="text">
|
||||
<string>Command:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2" rowspan="2">
|
||||
<widget class="QPlainTextEdit" name="argumentsTextEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="argumentsLabel">
|
||||
<property name="text">
|
||||
<string>Arguments:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="commandLineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>argumentsTextEdit</zorder>
|
||||
<zorder>resetDefaultsButton</zorder>
|
||||
<zorder>argumentsLabel</zorder>
|
||||
<zorder>commandLabel</zorder>
|
||||
<zorder>commandLineEdit</zorder>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>commandLineEdit</tabstop>
|
||||
<tabstop>argumentsTextEdit</tabstop>
|
||||
<tabstop>resetDefaultsButton</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Reference in New Issue
Block a user