From 24d4cb65761b50d1cb5a4872b58220880212e966 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 3 Nov 2023 15:43:44 +0100 Subject: [PATCH] ProjectExplorer: Make the MAKEFLAGS warning self-explanatory Fixes: QTCREATORBUG-29816 Change-Id: If35fe74c52ec1c890f390eb0a645299ce9e926b4 Reviewed-by: Christian Stenger Reviewed-by: --- src/plugins/projectexplorer/makestep.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp index bcf3bab8f02..7929f2e325e 100644 --- a/src/plugins/projectexplorer/makestep.cpp +++ b/src/plugins/projectexplorer/makestep.cpp @@ -67,11 +67,6 @@ MakeStep::MakeStep(BuildStepList *parent, Id id) m_overrideMakeflagsAspect.setSettingsKey(id.toKey() + OVERRIDE_MAKEFLAGS_SUFFIX); m_overrideMakeflagsAspect.setLabel(text, BoolAspect::LabelPlacement::AtCheckBox); - m_nonOverrideWarning.setText("

" + - Tr::tr("MAKEFLAGS specifies parallel jobs. Check \"%1\" to override.") - .arg(text) + "

"); - m_nonOverrideWarning.setIconType(InfoLabel::Warning); - m_disabledForSubdirsAspect.setSettingsKey(id.toKey() + ".disabledForSubdirs"); m_disabledForSubdirsAspect.setLabel(Tr::tr("Disable in subdirectories:")); m_disabledForSubdirsAspect.setToolTip(Tr::tr("Runs this step only for a top-level build.")); @@ -354,8 +349,22 @@ QWidget *MakeStep::createConfigWidget() const bool jobCountEnabled = !userArgsContainsJobCount(); m_jobCountAspect.setEnabled(jobCountEnabled); m_overrideMakeflagsAspect.setEnabled(jobCountEnabled); - m_nonOverrideWarning.setVisible(makeflagsJobCountMismatch() - && !jobCountOverridesMakeflags()); + + QString warningText; + InfoLabel::InfoType iconType = InfoLabel::Information; + if (makeflagsJobCountMismatch()) { + if (m_overrideMakeflagsAspect.value()) { + warningText = Tr::tr("Overriding MAKEFLAGS environment variable."); + } else { + warningText = Tr::tr("MAKEFLAGS specifies a conflicting job count."); + iconType = InfoLabel::Warning; + } + } else { + warningText = Tr::tr("No conflict with MAKEFLAGS environment variable."); + } + m_nonOverrideWarning.setText(QString::fromLatin1("

%1

") + .arg(warningText)); + m_nonOverrideWarning.setIconType(iconType); }; updateDetails();