From 2b33e7776d7e758d9983ea59ffeeb8077c9823dd Mon Sep 17 00:00:00 2001 From: donovaly Date: Sun, 26 Jul 2020 16:53:44 +0200 Subject: [PATCH] [TD] get rid of trailing newlines as discussed with luzpaz in https://github.com/FreeCAD/FreeCAD/pull/3735 there shouldn't be trailing newlines in translated strings. - Moreover fix the logic of the output dialog text --- src/Mod/TechDraw/Gui/ViewProviderPage.cpp | 5 +++-- src/Mod/TechDraw/Gui/ViewProviderProjGroup.cpp | 8 +++++--- src/Mod/TechDraw/Gui/ViewProviderTemplate.cpp | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp index 37609bf0ae..bb05599bf2 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp @@ -222,10 +222,11 @@ bool ViewProviderPage::onDelete(const std::vector &) QString bodyMessage; QTextStream bodyMessageStream(&bodyMessage); bodyMessageStream << qApp->translate("Std_Delete", - "The page is not empty, therefore the\nfollowing referencing objects might be lost.\n\n" - "Are you sure you want to continue?"); + "The page is not empty, therefore the\nfollowing referencing objects might be lost:"); + bodyMessageStream << '\n'; for (auto ObjIterator : objs) bodyMessageStream << '\n' << QString::fromUtf8(ObjIterator->Label.getValue()); + bodyMessageStream << "\n\nAre you sure you want to continue?"; // show and evaluate the dialog int DialogResult = QMessageBox::warning(Gui::getMainWindow(), qApp->translate("Std_Delete", "Object dependencies"), bodyMessage, diff --git a/src/Mod/TechDraw/Gui/ViewProviderProjGroup.cpp b/src/Mod/TechDraw/Gui/ViewProviderProjGroup.cpp index 30622b7925..4cc643475a 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderProjGroup.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderProjGroup.cpp @@ -193,7 +193,8 @@ bool ViewProviderProjGroup::onDelete(const std::vector &) // if there are section or detail views we cannot delete because this would break them if (!ViewList.empty()) { bodyMessageStream << qApp->translate("Std_Delete", - "The group cannot be deleted because its items have the following\nsection or detail views, or leader lines that would get broken:\n"); + "The group cannot be deleted because its items have the following\nsection or detail views, or leader lines that would get broken:"); + bodyMessageStream << '\n'; for (auto ListIterator : ViewList) bodyMessageStream << '\n' << QString::fromUtf8(ListIterator.c_str()); QMessageBox::warning(Gui::getMainWindow(), @@ -206,10 +207,11 @@ bool ViewProviderProjGroup::onDelete(const std::vector &) { // generate dialog bodyMessageStream << qApp->translate("Std_Delete", - "The projection group is not empty, therefore\nthe following referencing objects might be lost.\n\n" - "Are you sure you want to continue?\n"); + "The projection group is not empty, therefore\nthe following referencing objects might be lost:"); + bodyMessageStream << '\n'; for (auto ObjIterator : objs) bodyMessageStream << '\n' << QString::fromUtf8(ObjIterator->Label.getValue()); + bodyMessageStream << "\n\nAre you sure you want to continue?"; // show and evaluate dialog int DialogResult = QMessageBox::warning(Gui::getMainWindow(), qApp->translate("Std_Delete", "Object dependencies"), bodyMessage, diff --git a/src/Mod/TechDraw/Gui/ViewProviderTemplate.cpp b/src/Mod/TechDraw/Gui/ViewProviderTemplate.cpp index 7299433e35..ef3224dc85 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderTemplate.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderTemplate.cpp @@ -195,9 +195,9 @@ bool ViewProviderTemplate::onDelete(const std::vector &) QString bodyMessage; QTextStream bodyMessageStream(&bodyMessage); bodyMessageStream << qApp->translate("Std_Delete", - "The following referencing objects might break.\n\n" - "Are you sure you want to continue?\n"); - bodyMessageStream << '\n' << QString::fromUtf8(page->Label.getValue()); + "The following referencing objects might break:"); + bodyMessageStream << "\n\n" << QString::fromUtf8(page->Label.getValue()); + bodyMessageStream << "\n\nAre you sure you want to continue?"; // show and evaluate dialog int DialogResult = QMessageBox::warning(Gui::getMainWindow(),