]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/XGUI/XGUI_ErrorDialog.cpp
Salome HOME
Translate strings with corresponded codec
[modules/shaper.git] / src / XGUI / XGUI_ErrorDialog.cpp
index 75df206519032f8ebc2100f37246b8dc0c51f0e5..04a3f5316c2f71e50b5e30cca4fc9f679d5a70d9 100644 (file)
@@ -16,6 +16,7 @@
 #include <QLabel>
 #include <QVBoxLayout>
 #include <QTextEdit>
+#include <QTextCodec>
 
 XGUI_ErrorDialog::XGUI_ErrorDialog(QWidget* parent)
     : QDialog(parent)
@@ -60,7 +61,9 @@ void XGUI_ErrorDialog::clear()
 void XGUI_ErrorDialog::addError(std::shared_ptr<Events_InfoMessage> theMsg)
 {
   std::string aError = Config_Translator::translate(theMsg);
-  myErrors.append(aError.c_str());
+  std::string aCodec = Config_Translator::codec(theMsg->context());
+  QString aMsg = QTextCodec::codecForName(aCodec.c_str())->toUnicode(aError.c_str());
+  myErrors.append(aMsg);
   refresh();
   if (!isVisible()) {
     show();