CMakePM: Add ability to stop CMake run in Settings

Previously the only way to stop the CMake run was to click on "x"
button of the "Configure" progress bar.

Now you can click in Settings on "Stop CMake".

Change-Id: I167b86ba62679f197c194148b122ff0c87e87162
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-12-22 15:18:00 +01:00
parent d17d8ab50f
commit dfacdbefa8
8 changed files with 42 additions and 14 deletions

View File

@@ -411,13 +411,16 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
});
connect(m_resetButton, &QPushButton::clicked, m_configModel, &ConfigModel::resetAllChanges);
connect(m_reconfigureButton,
&QPushButton::clicked,
m_buildConfiguration,
&CMakeBuildConfiguration::runCMakeWithExtraArguments);
connect(m_setButton, &QPushButton::clicked, this, [this]() {
setVariableUnsetFlag(false);
connect(m_reconfigureButton, &QPushButton::clicked, this, [this]() {
auto buildSystem = static_cast<CMakeBuildSystem *>(m_buildConfiguration->buildSystem());
if (!buildSystem->isParsing()) {
buildSystem->runCMakeWithExtraArguments();
} else {
buildSystem->stopCMakeRun();
m_reconfigureButton->setEnabled(false);
}
});
connect(m_setButton, &QPushButton::clicked, this, [this]() { setVariableUnsetFlag(false); });
connect(m_unsetButton, &QPushButton::clicked, this, [this]() {
setVariableUnsetFlag(true);
});
@@ -570,7 +573,15 @@ void CMakeBuildSettingsWidget::updateButtonState()
});
m_resetButton->setEnabled(m_configModel->hasChanges() && !isParsing);
m_reconfigureButton->setEnabled(!configChanges.isEmpty() && !isParsing);
m_reconfigureButton->setEnabled(true);
if (isParsing)
m_reconfigureButton->setText(tr("Stop CMake"));
else if (m_configModel->hasChanges())
m_reconfigureButton->setText(tr("Apply Configuration Changes"));
else
m_reconfigureButton->setText(tr("Run CMake"));
m_buildConfiguration->setConfigurationChanges(configChanges);
}
@@ -1323,11 +1334,6 @@ BuildSystem *CMakeBuildConfiguration::buildSystem() const
return m_buildSystem;
}
void CMakeBuildConfiguration::runCMakeWithExtraArguments()
{
m_buildSystem->runCMakeWithExtraArguments();
}
void CMakeBuildConfiguration::setSourceDirectory(const FilePath &path)
{
aspect<SourceDirectoryAspect>()->setValue(path.toString());