From dda2d4761ed51bc23a7428cfa0d09db077f1a047 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Thu, 7 Jul 2022 10:26:38 +0200 Subject: [PATCH] Sketcher: Use new critical message mechanism to notify parabola migration ========================================================================= A migrated parabola cannot be openned with a previous version of FreeCAD. The user is notified upfront. --- src/Mod/Sketcher/App/SketchObject.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 9ee0bfe29f..f803264a2b 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -8135,8 +8135,6 @@ void SketchObject::migrateSketch() // There are parabolas and there isn't an IA axis. (1) there are no axis or (2) there is a legacy construction line if(focalaxisfound == constraints.end()) { - Base::Console().Warning("Migrating parabolas. Migrated files won't open in previous versions of FreeCAD!!\n"); - // maps parabola geoid to focusgeoid std::map parabolageoid2focusgeoid; @@ -8225,6 +8223,11 @@ void SketchObject::migrateSketch() } Constraints.setValues(std::move(newconstraints)); + + Base::Console().Warning("In Sketch %s, parabolas were migrated. Migrated files won't open in previous versions of FreeCAD!!\n",this->Label.getStrValue().c_str()); + + this->getDocument()->signalUserMessage(*this, QStringLiteral(QT_TRANSLATE_NOOP("CriticalMessages","Sketch:")) + QStringLiteral(" ") + QString::fromStdString(this->Label.getStrValue()) + + QStringLiteral(".\n\n") + QString::fromLatin1(QT_TRANSLATE_NOOP("CriticalMessages","Parabolas were migrated. Migrated files won't open in previous versions of FreeCAD!!")), App::Document::NotificationType::Critical); } } }