diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index f30fe0ce59..45e801f9c7 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -145,7 +145,7 @@ void UnifiedDatumCommand(Gui::Command &cmd, Base::Type type, std::string name) QMessageBox::warning(Gui::getMainWindow(),QObject::tr("Error"), QObject::tr("There is no active body. Please make a body active before inserting a datum entity.")); } } catch (Base::Exception &e) { - QMessageBox::warning(Gui::getMainWindow(),QObject::tr("Error"),QString::fromLatin1(e.what())); + QMessageBox::warning(Gui::getMainWindow(),QObject::tr("Error"),QApplication::translate("Exception", e.what())); } catch (Standard_Failure &e) { QMessageBox::warning(Gui::getMainWindow(),QObject::tr("Error"),QString::fromLatin1(e.GetMessageString())); } @@ -406,7 +406,7 @@ void CmdPartDesignSubShapeBinder::activated(int iMsg) } catch (Base::Exception &e) { e.ReportException(); QMessageBox::critical(Gui::getMainWindow(), - QObject::tr("Sub-Shape Binder"), QString::fromUtf8(e.what())); + QObject::tr("Sub-Shape Binder"), QApplication::translate("Exception", e.what())); abortCommand(); } } diff --git a/src/Mod/PartDesign/Gui/TaskBooleanParameters.cpp b/src/Mod/PartDesign/Gui/TaskBooleanParameters.cpp index ad52302eb6..8da1456d6e 100644 --- a/src/Mod/PartDesign/Gui/TaskBooleanParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskBooleanParameters.cpp @@ -361,7 +361,7 @@ bool TaskDlgBooleanParameters::accept() Gui::Command::runCommand(Gui::Command::Doc,str.str().c_str()); } catch (const Base::Exception& e) { - QMessageBox::warning(parameter, tr("Boolean: Accept: Input error"), QString::fromLatin1(e.what())); + QMessageBox::warning(parameter, tr("Boolean: Accept: Input error"), QCoreApplication::translate("Exception", e.what())); return false; } diff --git a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp index 27b87903c2..7ff72735e3 100644 --- a/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp @@ -333,7 +333,7 @@ void TaskLinearPatternParameters::onDirectionChanged(int /*num*/) pcLinearPattern->Direction.Paste(dirLinks.getCurrentLink()); } } catch (Base::Exception &e) { - QMessageBox::warning(nullptr,tr("Error"),QString::fromLatin1(e.what())); + QMessageBox::warning(nullptr,tr("Error"),QApplication::translate("Exception", e.what())); } kickUpdateViewTimer(); diff --git a/src/Mod/PartDesign/Gui/TaskMirroredParameters.cpp b/src/Mod/PartDesign/Gui/TaskMirroredParameters.cpp index 0e9087ad30..018f660c1f 100644 --- a/src/Mod/PartDesign/Gui/TaskMirroredParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskMirroredParameters.cpp @@ -242,7 +242,7 @@ void TaskMirroredParameters::onPlaneChanged(int /*num*/) pcMirrored->MirrorPlane.Paste(planeLinks.getCurrentLink()); } } catch (Base::Exception &e) { - QMessageBox::warning(nullptr,tr("Error"),QString::fromLatin1(e.what())); + QMessageBox::warning(nullptr,tr("Error"),QApplication::translate("Exception", e.what())); } recomputeFeature(); diff --git a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp index 18eade01a4..8b8d8f1abe 100644 --- a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp @@ -518,7 +518,7 @@ bool TaskPipeParameters::accept() } } catch (const Base::Exception& e) { - QMessageBox::warning(this, tr("Input error"), QString::fromUtf8(e.what())); + QMessageBox::warning(this, tr("Input error"), QApplication::translate("Exception", e.what())); return false; } diff --git a/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp b/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp index d0fa35c64a..c565ecf839 100644 --- a/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPolarPatternParameters.cpp @@ -332,7 +332,7 @@ void TaskPolarPatternParameters::onAxisChanged(int /*num*/) pcPolarPattern->Axis.Paste(axesLinks.getCurrentLink()); } } catch (Base::Exception &e) { - QMessageBox::warning(nullptr,tr("Error"),QString::fromLatin1(e.what())); + QMessageBox::warning(nullptr,tr("Error"),QApplication::translate("Exception", e.what())); } kickUpdateViewTimer(); diff --git a/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp b/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp index c84bac0b12..1d4d915383 100644 --- a/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp @@ -882,7 +882,7 @@ bool TaskBoxPrimitives::setPrimitive(App::DocumentObject *obj) Gui::Command::runCommand(Gui::Command::Doc, "App.ActiveDocument.recompute()"); } catch (const Base::PyException& e) { - QMessageBox::warning(this, tr("Create primitive"), QString::fromLatin1(e.what())); + QMessageBox::warning(this, tr("Create primitive"), QApplication::translate("Exception", e.what())); return false; } return true; diff --git a/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp b/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp index ff1fd8c9fb..605769a387 100644 --- a/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp +++ b/src/Mod/PartDesign/Gui/TaskShapeBinder.cpp @@ -410,7 +410,7 @@ bool TaskDlgShapeBinder::accept() } } catch (const Base::Exception& e) { - QMessageBox::warning(parameter, tr("Input error"), QString::fromUtf8(e.what())); + QMessageBox::warning(parameter, tr("Input error"), QApplication::translate("Exception", e.what())); return false; }