Autotools: Use new step widget update logic more intensively

Change-Id: I4dbd1c331152a408b6d7a60a4cbc793995153364
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-06-25 10:41:32 +02:00
parent 1d2a15e143
commit 6e3c039f9e
4 changed files with 36 additions and 59 deletions

View File

@@ -66,6 +66,24 @@ AutoreconfStep::AutoreconfStep(BuildStepList *bsl) : AbstractProcessStep(bsl, AU
m_additionalArgumentsAspect->setValue("--force --install");
m_additionalArgumentsAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);
m_additionalArgumentsAspect->setHistoryCompleter("AutotoolsPM.History.AutoreconfStepArgs");
connect(m_additionalArgumentsAspect, &ProjectConfigurationAspect::changed, this, [this] {
m_runAutoreconf = true;
});
setSummaryUpdater([this] {
BuildConfiguration *bc = buildConfiguration();
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->target()->project()->projectDirectory());
param.setCommandLine({Utils::FilePath::fromString("autoreconf"),
m_additionalArgumentsAspect->value(),
Utils::CommandLine::Raw});
return param.summary(displayName());
});
}
bool AutoreconfStep::init()
@@ -101,31 +119,3 @@ void AutoreconfStep::doRun()
m_runAutoreconf = false;
AbstractProcessStep::doRun();
}
BuildStepConfigWidget *AutoreconfStep::createConfigWidget()
{
auto widget = AbstractProcessStep::createConfigWidget();
auto updateDetails = [this, widget] {
BuildConfiguration *bc = buildConfiguration();
ProcessParameters param;
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->target()->project()->projectDirectory());
param.setCommandLine({Utils::FilePath::fromString("autoreconf"),
m_additionalArgumentsAspect->value(),
Utils::CommandLine::Raw});
widget->setSummaryText(param.summary(displayName()));
};
updateDetails();
connect(m_additionalArgumentsAspect, &ProjectConfigurationAspect::changed, this, [=] {
updateDetails();
m_runAutoreconf = true;
});
return widget;
}