From 3e0c52d13d8718a6f474e08b3b3f2c2ac949658d Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 17 Mar 2021 17:03:17 +0300 Subject: [PATCH] Bos #24048: EDF 23096 - Warning too long --- src/ModuleBase/ModuleBase_Tools.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 3037eceac..7109ad952 100644 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -1017,7 +1017,7 @@ bool askToDelete(const std::set theFeatures, aMessageBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes); aMessageBox.setDefaultButton(QMessageBox::No); - QString aText; + QString aText, aDetailedText; if (!thePrefixInfo.empty()) aText = thePrefixInfo.c_str(); QString aSep = ", "; @@ -1028,16 +1028,22 @@ bool askToDelete(const std::set theFeatures, if (!aNotActivatedDocWrn.isEmpty()) aText += aNotActivatedDocWrn; if (!anOtherFeatureNames.empty()) { - const char* aMsg = "Features are used in the following features: %1.\nThese " - "features will be deleted.\n"; - aText += QString(QObject::tr(aMsg)) + const char* aMsg = "The selected features are used in some\n" + "other features, which will also be deleted.\n"; + const char* aMsgDetails = "The selected features are used" + " in the following features: %1.\n"; + aText += QString(QObject::tr(aMsg)); + aDetailedText += QString(QObject::tr(aMsgDetails)) .arg(anOtherFeatureNames.join(aSep)); } if (!aParamFeatureNames.empty()) { - const char* aMsg = "Parameters are used directly and through a sequence " - "of dependencies in the following features: %1.\nThese features will " - "be deleted.\nOr parameters could be replaced by their values.\n"; - aText += QString(QObject::tr(aMsg)) + const char* aMsg = "The selected parameters are used directly or through\n" + "a sequence of dependencies in some features.\n" + "These features will be deleted.\n" + "Or parameters could be replaced by their values.\n"; + const char* aMsgDetails = "Parameters are used in the following features: %1.\n"; + aText += QString(QObject::tr(aMsg)); + aDetailedText += QString(QObject::tr(aMsgDetails)) .arg(aParamFeatureNames.join(aSep)); #ifdef _DEBUG QPushButton *aReplaceButton = @@ -1046,8 +1052,10 @@ bool askToDelete(const std::set theFeatures, } if (!aText.isEmpty()) { - aText += "Would you like to continue?"; aMessageBox.setText(aText); + aMessageBox.setInformativeText(QObject::tr("Would you like to continue?")); + if (!aDetailedText.isEmpty()) + aMessageBox.setDetailedText(aDetailedText); aMessageBox.exec(); QMessageBox::ButtonRole aButtonRole = aMessageBox.buttonRole(aMessageBox.clickedButton()); -- 2.39.2