Commit 271ec63a authored by Nikolai Kosjar's avatar Nikolai Kosjar

Deploy steps: Get rid of useless aggregation.

Change-Id: I03a3d020336dab4d2f1f85c77138d8df6246c174
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent aee8a3ac
......@@ -48,36 +48,29 @@ namespace Internal {
namespace {
const char IncrementalKey[] = "RemoteLinux.GenericDirectUploadStep.Incremental";
class ConfigWidget : public BuildStepConfigWidget
class ConfigWidget : public SimpleBuildStepConfigWidget
{
Q_OBJECT
public:
ConfigWidget(GenericDirectUploadStep *step) : m_widget(step)
ConfigWidget(GenericDirectUploadStep *step) : SimpleBuildStepConfigWidget(step)
{
m_incrementalCheckBox.setText(tr("Incremental deployment"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(0);
mainLayout->addWidget(&m_widget);
mainLayout->addWidget(&m_incrementalCheckBox);
m_incrementalCheckBox.setChecked(step->incrementalDeployment());
connect(&m_widget, SIGNAL(updateSummary()), SIGNAL(updateSummary()));
connect(&m_incrementalCheckBox, SIGNAL(toggled(bool)),
SLOT(handleIncrementalChanged(bool)));
}
private:
QString summaryText() const { return m_widget.summaryText(); }
QString displayName() const { return m_widget.displayName(); }
GenericDirectUploadStep *myStep() const {
return qobject_cast<GenericDirectUploadStep *>(m_widget.step());
}
bool showWidget() const { return true; }
private:
Q_SLOT void handleIncrementalChanged(bool incremental) {
myStep()->setIncrementalDeployment(incremental);
GenericDirectUploadStep *step = qobject_cast<GenericDirectUploadStep *>(this->step());
step->setIncrementalDeployment(incremental);
}
SimpleBuildStepConfigWidget m_widget;
QCheckBox m_incrementalCheckBox;
};
......
......@@ -45,40 +45,35 @@ namespace {
const char CommandLineKey[] = "RemoteLinuxCustomCommandDeploymentStep.CommandLine";
class ConfigWidget : public BuildStepConfigWidget
class ConfigWidget : public SimpleBuildStepConfigWidget
{
Q_OBJECT
public:
ConfigWidget(AbstractRemoteLinuxCustomCommandDeploymentStep *step)
: m_step(step), m_widget(step)
: SimpleBuildStepConfigWidget(step)
{
QVBoxLayout * const mainLayout = new QVBoxLayout(this);
mainLayout->setMargin(0);
mainLayout->addWidget(&m_widget);
QHBoxLayout * const commandLineLayout = new QHBoxLayout;
mainLayout->addLayout(commandLineLayout);
QLabel * const commandLineLabel = new QLabel(tr("Command line:"));
commandLineLayout->addWidget(commandLineLabel);
m_commandLineEdit.setText(m_step->commandLine());
m_commandLineEdit.setText(step->commandLine());
commandLineLayout->addWidget(&m_commandLineEdit);
connect(&m_widget, SIGNAL(updateSummary()), SIGNAL(updateSummary()));
connect(&m_widget, SIGNAL(updateAdditionalSummary()), SIGNAL(updateAdditionalSummary()));
connect(&m_commandLineEdit, SIGNAL(textEdited(QString)), SLOT(handleCommandLineEdited()));
}
private:
QString summaryText() const { return m_widget.summaryText(); }
QString additionalSummaryText() const { return m_widget.additionalSummaryText(); }
QString displayName() const { return m_widget.displayName(); }
bool showWidget() const { return true; }
private:
Q_SLOT void handleCommandLineEdited() {
m_step->setCommandLine(m_commandLineEdit.text().trimmed());
AbstractRemoteLinuxCustomCommandDeploymentStep *step =
qobject_cast<AbstractRemoteLinuxCustomCommandDeploymentStep *>(this->step());
step->setCommandLine(m_commandLineEdit.text().trimmed());
}
AbstractRemoteLinuxCustomCommandDeploymentStep * const m_step;
QLineEdit m_commandLineEdit;
SimpleBuildStepConfigWidget m_widget;
};
} // anonymous namespace
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment