]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Replace of Events_Error by Events_InfoMessage. Provide storing of non translated...
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 6 Jun 2016 12:56:57 +0000 (15:56 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 6 Jun 2016 12:56:57 +0000 (15:56 +0300)
46 files changed:
src/BuildPlugin/BuildPlugin_Validators.cpp
src/BuildPlugin/BuildPlugin_Wire.cpp
src/Config/Config_DataModelReader.cpp
src/Config/Config_ModuleReader.cpp
src/Config/Config_Translator.cpp
src/Config/Config_Translator.h
src/Config/Config_ValidatorReader.cpp
src/Config/Config_XMLReader.cpp
src/FeaturesPlugin/FeaturesPlugin_Validators.cpp
src/GeomValidators/GeomValidators_Face.cpp
src/GeomValidators/GeomValidators_ShapeType.cpp
src/InitializationPlugin/InitializationPlugin_Plugin.cpp
src/Model/Model_AttributeSelection.cpp
src/Model/Model_Data.cpp
src/Model/Model_Document.cpp
src/Model/Model_Objects.cpp
src/Model/Model_SelectionNaming.cpp
src/Model/Model_Session.cpp
src/Model/Model_Update.cpp
src/Model/Model_Validator.cpp
src/ModuleBase/ModuleBase_FilterFactory.cpp
src/ModuleBase/ModuleBase_ResultPrs.cpp
src/ModuleBase/ModuleBase_Tools.cpp
src/ModuleBase/ModuleBase_WidgetCreatorFactory.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/ParametersPlugin/ParametersPlugin_EvalListener.cpp
src/SketchSolver/SketchSolver_Builder.cpp
src/SketchSolver/SketchSolver_Group.cpp
src/SketcherPrs/SketcherPrs_Angle.cpp
src/SketcherPrs/SketcherPrs_Coincident.cpp
src/SketcherPrs/SketcherPrs_Collinear.cpp
src/SketcherPrs/SketcherPrs_DimensionStyleListener.cpp
src/SketcherPrs/SketcherPrs_Equal.cpp
src/SketcherPrs/SketcherPrs_HVDirection.cpp
src/SketcherPrs/SketcherPrs_LengthDimension.cpp
src/SketcherPrs/SketcherPrs_Middle.cpp
src/SketcherPrs/SketcherPrs_Radius.cpp
src/SketcherPrs/SketcherPrs_SymbolPrs.cpp
src/XGUI/XGUI_ActionsMgr.cpp
src/XGUI/XGUI_CustomPrs.cpp
src/XGUI/XGUI_DataModel.cpp
src/XGUI/XGUI_ObjectsBrowser.cpp
src/XGUI/XGUI_Tools.cpp
src/XGUI/XGUI_Workshop.cpp
src/XGUI/XGUI_WorkshopListener.cpp
src/XGUI/XGUI_msg_fr.ts

index b3ede6d602d88b1c9bfd2610841ceb9d5202a293..234e697b2d7712f36986c76fca5aad3265a5b33c 100644 (file)
@@ -23,7 +23,7 @@
 #include <GeomValidators_FeatureKind.h>
 #include <GeomValidators_ShapeType.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 //=================================================================================================
 bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute,
@@ -32,9 +32,9 @@ bool BuildPlugin_ValidatorBaseForBuild::isValid(const AttributePtr& theAttribute
 {
   // Get base objects list.
   if(theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) {
-    Events_Error::send("Error: BuildPlugin_ValidatorBaseForBuild does not support attribute type \""
-      + theAttribute->attributeType() + "\"\n Only \"" + ModelAPI_AttributeSelectionList::typeId()
-      + "\" supported.");
+    std::string aMsg = "Error: BuildPlugin_ValidatorBaseForBuild does not support attribute type '%1'\nOnly '%2' is supported.";
+    Events_InfoMessage("BuildPlugin_Validators", aMsg).
+      arg(theAttribute->attributeType()).arg(ModelAPI_AttributeSelectionList::typeId()).send();
     return false;
   }
   AttributeSelectionListPtr aSelectionList =
@@ -113,8 +113,8 @@ bool BuildPlugin_ValidatorBaseForWire::isValid(const std::shared_ptr<ModelAPI_Fe
 {
   // Get attribute.
   if(theArguments.size() != 1) {
-    Events_Error::send("Error: BuildPlugin_ValidatorBaseForWire should be used only with "
-      "1 parameter (ID of base objects list).");
+    std::string aMsg = "Error: BuildPlugin_ValidatorBaseForWire should be used only with 1 parameter (ID of base objects list).";
+    Events_InfoMessage("BuildPlugin_Validators", aMsg).send();
     return false;
   }
   AttributeSelectionListPtr aSelectionList = theFeature->selectionList(theArguments.front());
@@ -158,8 +158,9 @@ bool BuildPlugin_ValidatorBaseForFace::isValid(const std::shared_ptr<ModelAPI_Fe
 {
   // Get attribute.
   if(theArguments.size() != 1) {
-    Events_Error::send("Error: BuildPlugin_ValidatorBaseForFace should be used only with "
-      "1 parameter (ID of base objects list).");
+    std::string aMsg = "Error: BuildPlugin_ValidatorBaseForFace should be used only with "
+      "1 parameter (ID of base objects list).";
+    Events_InfoMessage("BuildPlugin_Validators", aMsg).send();
     return false;
   }
   AttributeSelectionListPtr aSelectionList = theFeature->selectionList(theArguments.front());
@@ -231,16 +232,18 @@ bool BuildPlugin_ValidatorSubShapesSelection::isValid(const AttributePtr& theAtt
                                                       std::string& theError) const
 {
   if(theArguments.size() != 1) {
-    Events_Error::send("Error: BuildPlugin_ValidatorSubShapesSelection should be used only with "
-      "1 parameter(Sketch feature id).");
+    std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection should be used only with "
+      "1 parameter(Sketch feature id).";
+    Events_InfoMessage("BuildPlugin_Validators", aMsg).send();
     return false;
   }
 
   // Get base objects list.
   if(theAttribute->attributeType() != ModelAPI_AttributeSelectionList::typeId()) {
-    Events_Error::send("Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \""
-      + theAttribute->attributeType() + "\"\n Only \"" + ModelAPI_AttributeSelectionList::typeId()
-      + "\" supported.");
+    std::string aMsg = "Error: BuildPlugin_ValidatorSubShapesSelection does not support attribute type \""
+      "%1\"\n Only \"%2\" supported.";
+    Events_InfoMessage("BuildPlugin_Validators", aMsg).
+      arg(theAttribute->attributeType()).arg(ModelAPI_AttributeSelectionList::typeId()).send();
     return false;
   }
   AttributeSelectionListPtr aSelectionList =
index 523c81a03c970ec00c8bc6c30667c8d321aacd7d..f16de3d49394a013c0c375077ee6d0ee2f755979 100644 (file)
@@ -10,7 +10,7 @@
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultConstruction.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <GeomAPI_PlanarEdges.h>
 #include <GeomAPI_ShapeExplorer.h>
@@ -88,7 +88,8 @@ bool BuildPlugin_Wire::customAction(const std::string& theActionId)
   if(theActionId == "add_contour") {
     return addContour();
   } else {
-    Events_Error::send("Error: Feature \"" + getKind() + "\" does not support action \"" + theActionId + "\".");
+    std::string aMsg = "Error: Feature \"%1\" does not support action \"%2\".";
+    Events_InfoMessage("BuildPlugin_Wire", aMsg).arg(getKind()).arg(theActionId).send();
   }
 
   return false;
@@ -100,7 +101,7 @@ bool BuildPlugin_Wire::addContour()
   // Get base objects list.
   AttributeSelectionListPtr aSelectionList = selectionList(BASE_OBJECTS_ID());
   if(aSelectionList->size() == 0) {
-    Events_Error::send("Error: Empty selection list.");
+    Events_InfoMessage("BuildPlugin_Wire", "Error: Empty selection list.").send();
     return false;
   }
 
@@ -188,7 +189,8 @@ bool BuildPlugin_Wire::addContour()
   }
 
   if(!isAnyContourAdded) {
-    Events_Error::send("Error: Contours already closed or no contours found for selected edges.");
+    Events_InfoMessage("BuildPlugin_Wire", 
+      "Error: Contours already closed or no contours found for selected edges.").send();
     return false;
   }
 
index 22c6608f7f37455f1dade3537704ef3227691c2b..afd688ed538e072fd344c88d5feb6c786e53a39a 100644 (file)
@@ -11,7 +11,6 @@
 #include <Config_Keywords.h>
 #include "Config_Common.h"
 
-#include <Events_Error.h>
 #include <Events_InfoMessage.h>
 
 
index 2fd33f6cda947d90b50a1a065d6902ede4152340..dfd442b7e6012a70d6938d8fb800ffcb7d3de71c 100644 (file)
@@ -13,7 +13,7 @@
 #include <Config_Common.h>
 #include <Config_ModuleReader.h>
 #include <Config_FeatureReader.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <libxml/parser.h>
 #include <libxml/tree.h>
@@ -70,9 +70,9 @@ void Config_ModuleReader::addFeature(const std::string& theFeatureName,
                                      const std::string& thePluginConfig)
 {
   if (myFeaturesInFiles.count(theFeatureName)) {
-    std::string anErrorMsg = "Can not register feature '" + theFeatureName + "' in plugin '"
-        + thePluginConfig + "'. There is a feature with the same ID.";
-    Events_Error::send(anErrorMsg);
+    std::string anErrorMsg = "Can not register feature '%1' in plugin '%2'."
+      " There is a feature with the same ID.";
+    Events_InfoMessage("Config_ModuleReader", anErrorMsg).arg(theFeatureName).arg(thePluginConfig).send();
     return;
   }
 
@@ -194,7 +194,7 @@ void Config_ModuleReader::loadScript(const std::string& theFileName)
       Py_XDECREF(pvalue);
       Py_XDECREF(ptraceback);
     }
-    Events_Error::send(anErrorMsg);
+    Events_InfoMessage("Config_ModuleReader", anErrorMsg).send();
   }
 
   /* release python thread */
@@ -229,7 +229,7 @@ void Config_ModuleReader::loadLibrary(const std::string& theLibName)
     anErrorMsg += ": " + std::string(dlerror());
     #endif
     std::cerr << anErrorMsg << std::endl;
-    Events_Error::send(anErrorMsg);
+    Events_InfoMessage("Config_ModuleReader", anErrorMsg).send();
   }
 }
 
index bf105efe455dd93c34898dd1a3ac732c638407c6..f21e8f6486dbe3eade7dda6ad7f9f189a649e3ad 100644 (file)
@@ -8,6 +8,9 @@
 #include "Config_XMLReader.h"
 #include "Config_Common.h"
 
+#include <fstream>
+#include <ostream>
+
 class Config_TSReader : public Config_XMLReader
 {
 public:
@@ -47,6 +50,11 @@ void Config_TSReader::processNode(xmlNodePtr theNode)
 //******************************************************************************
 //******************************************************************************
 Config_Translator::Translator Config_Translator::myTranslator;
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+Config_Translator::Translator Config_Translator::myMissed;
+#endif
+#endif
 
 bool Config_Translator::load(const std::string& theFileName)
 {
@@ -120,5 +128,63 @@ std::string Config_Translator::translate(const std::string& theContext,
   if (theParams.size() > 0) {
     aMsg = insertParameters(aMsg, theParams);
   }
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+  myMissed[theContext][theMessage] = "";
+#endif
+#endif
   return aMsg;
 }
+
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+void Config_Translator::saveMissedTranslations()
+{
+  if (myMissed.size() == 0)
+    return;
+
+  char* aPath = getenv("ROOT_DIR");
+#ifdef WIN32
+  std::string aFile = aPath + std::string("\\MissedTranslation.ts");
+#else
+  std::string aFile = aPath + std::string("/MissedTranslation.ts");
+#endif
+  std::ofstream oFStream;
+
+  // Delete old file
+  int aa = remove(aFile.c_str());
+
+  oFStream.open(aFile, std::ofstream::out | std::ofstream::app);
+  if (oFStream.is_open()) {
+    Translator::const_iterator aContIt;
+    Dictionary::const_iterator aDictIt;
+    std::string aContext;
+    std::string aSrc;
+    Dictionary aDict;
+
+    oFStream << "<TS version=\"2.0\">" << std::endl;
+    for(aContIt = myMissed.cbegin(); aContIt != myMissed.cend(); aContIt++) {
+      oFStream << "<context>" << std::endl;
+
+      aContext = aContIt->first;
+      oFStream << "  <name>" << aContext << "</name>" << std::endl;
+
+      aDict = aContIt->second;
+      for(aDictIt = aDict.cbegin(); aDictIt != aDict.cend(); aDictIt++) {
+        oFStream << "  <message>" << std::endl;
+        aSrc = aDictIt->first;
+
+        oFStream << "    <source>" << aSrc << "</source>" << std::endl;
+        oFStream << "    <translation>" << "</translation>" << std::endl;
+
+        oFStream << "  </message>" << std::endl;
+      }
+      oFStream << "</context>" << std::endl;
+    }
+
+    oFStream << "</TS>" << std::endl;
+    oFStream.close();
+  }
+}
+#endif
+#endif
index 4365ec75213c9125267630d49c92a7cf7da70ff3..706883ffb37c025d5e03248736d0a557962a3b59 100644 (file)
@@ -13,6 +13,8 @@
 #include <string>
 #include <map>
 
+#define MISSED_TRANSLATION
+
 /**
  * \class Config_Translator
  * \ingroup Config
@@ -54,8 +56,21 @@ public:
     const std::string& theMessage, 
     const std::list<std::string>& theParams = std::list<std::string>());
 
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+  static CONFIG_EXPORT void saveMissedTranslations();
+#endif
+#endif
+
+
 private:
   static Translator myTranslator;
+
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+  static Translator myMissed;
+#endif
+#endif
 };
 
 #endif
\ No newline at end of file
index dfeb81cc70cfdf13891910749fbc77285de94d82..8a7236b212eaf09c3f002f0078a3b5d6b9f7e280 100644 (file)
@@ -15,7 +15,6 @@
 #include <Config_PropManager.h>
 
 #include <Events_Loop.h>
-#include <Events_Error.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
index 1fcc90652b23220458ba0f987ef1c663da101f8a..bdfaa583af7022ce135c0b4a91ad8213325f8874 100644 (file)
@@ -13,7 +13,7 @@
 #include <Config_PropManager.h>
 
 #include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
@@ -52,7 +52,7 @@ Config_XMLReader::Config_XMLReader(const std::string& theXmlFileName)
   myDocumentPath = prefix + FSEP + theXmlFileName;
   std::ifstream aTestFile(myDocumentPath);
   if (!aTestFile) 
-    Events_Error::send("Unable to open " + myDocumentPath);
+    Events_InfoMessage("Config_XMLReader", "Unable to open %1").arg(myDocumentPath).send();
   aTestFile.close();
 }
 
index b451667acad83e8d703d5be7c7433596a1fcfc6a..73c132e0d6a0aae3232f43734bbc164682b45451 100644 (file)
@@ -14,8 +14,6 @@
 #include <ModelAPI_Feature.h>
 #include <ModelAPI_ResultConstruction.h>
 
-#include <Events_Error.h>
-
 #include <GeomValidators_BodyShapes.h>
 #include <GeomValidators_FeatureKind.h>
 #include <GeomValidators_ShapeType.h>
index d3b075fde59c5f4d976d512719cf50fca579bc96..f91066da277bdea6b64fcf8cb859b36b40a48773 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <GeomAbs_SurfaceType.hxx>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <QString>
 #include <QMap>
@@ -28,7 +28,7 @@ GeomAbs_SurfaceType faceType(const std::string& theType)
   if (MyFaceTypes.find(aType) != MyFaceTypes.end())
     return MyFaceTypes[aType];
   
-  Events_Error::send("Face type defined in XML is not implemented!");
+  Events_InfoMessage("GeomValidators_Face", "Face type defined in XML is not implemented!").send();
   return GeomAbs_Plane;
 }
 
index 141839ed1213ac7bd43e073405fc51bed4466a06..b4495c2fb90296b15d72a8b74d4380282badbcae 100755 (executable)
@@ -13,7 +13,7 @@
 #include <ModelAPI_AttributeSelectionList.h>
 #include <ModelAPI_AttributeReference.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <string>
 #include <map>
@@ -40,7 +40,7 @@ GeomValidators_ShapeType::TypeOfShape GeomValidators_ShapeType::shapeType(const
   if (MyShapeTypes.find(aType) != MyShapeTypes.end())
     return MyShapeTypes[aType];
 
-  Events_Error::send("Shape type defined in XML is not implemented!");
+  Events_InfoMessage("Shape type defined in XML is not implemented!").send();
   return AnyShape;
 }
 
index b896d594ba9ddb904b52d57dc81f17b682e71389..0c47e2a52586263d639d9e850d9f6a053846ee9c 100644 (file)
@@ -11,7 +11,7 @@
 #include <ModelAPI_Result.h>
 
 #include <Events_Message.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <memory>
 
@@ -79,9 +79,9 @@ void InitializationPlugin_Plugin::processEvent(const std::shared_ptr<Events_Mess
     Events_Loop::loop()->send(aMsg);
 
   } else if (theMessage.get()) {
-    Events_Error::send(
-        std::string("InitializationPlugin_Plugin::processEvent: unhandled message caught: ")
-            + theMessage->eventID().eventText());
+    Events_InfoMessage("InitializationPlugin_Plugin",
+        "InitializationPlugin_Plugin::processEvent: unhandled message caught: %1")
+            .arg(theMessage->eventID().eventText()).send();
   }
 }
 
index be028e276f5cab1909cd0c0bdd9840588e7e1a4f..7f90352af3df27e5202b2185ba263432ab0cc501 100644 (file)
@@ -18,7 +18,7 @@
 #include <ModelAPI_Tools.h>
 #include <GeomAPI_Shape.h>
 #include <GeomAPI_PlanarEdges.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <TNaming_Selector.hxx>
 #include <TNaming_NamedShape.hxx>
@@ -662,7 +662,7 @@ void Model_AttributeSelection::selectBody(
     if (aResult) {
       aContext = aResult->shape()->impl<TopoDS_Shape>();
     } else {
-      Events_Error::send("A result with shape is expected");
+      Events_InfoMessage("Model_AttributeSelection", "A result with shape is expected").send();
       return;
     }
   }
index 4dfabe551219209f63f169f9f102b549b8c5e17b..1e63282bb2690aebc2fb5c809bc7dc8c3c38574d 100644 (file)
@@ -36,7 +36,7 @@
 #include <GeomData_Point2D.h>
 #include <GeomData_Dir.h>
 #include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <TDataStd_Name.hxx>
 #include <TDataStd_AsciiString.hxx>
@@ -182,7 +182,7 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin
     anAttr->setObject(myObject);
     anAttr->setID(theID);
   } else {
-    Events_Error::send("Can not create unknown type of attribute " + theAttrType);
+    Events_InfoMessage("Model_Data", "Can not create unknown type of attribute %1").arg(theAttrType).send();
   }
   return aResult;
 }
@@ -370,7 +370,7 @@ void Model_Data::setError(const std::string& theError, bool theSend)
 {
   execState(ModelAPI_StateExecFailed);
   if (theSend) {
-    Events_Error::send(theError);
+    Events_InfoMessage("Model_Data", theError).send();
   }
   TDataStd_AsciiString::Set(myLab, theError.c_str());
 }
index 88f8bc6cbbedde47235bf2c5c0f2a32873df9360..ac473ce216f07c9a20872aaf4c0ce6c95f3627f7 100755 (executable)
@@ -18,7 +18,7 @@
 #include <ModelAPI_ResultBody.h>
 
 #include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <TDataStd_Integer.hxx>
 #include <TDataStd_Comment.hxx>
@@ -119,61 +119,61 @@ bool Model_Document::load(const char* theDirName, const char* theFileName, Docum
     aStatus = anApp->Open(aPath, aLoaded);
   } catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    Events_Error::send(
-        std::string("Exception in opening of document: ") + aFail->GetMessageString());
+    Events_InfoMessage("Model_Document",
+        "Exception in opening of document: %1").arg(aFail->GetMessageString()).send();
     return false;
   }
   bool isError = aStatus != PCDM_RS_OK;
   if (isError) {
     switch (aStatus) {
       case PCDM_RS_UnknownDocument:
-        Events_Error::send(std::string("Can not open document"));
+        Events_InfoMessage("Model_Document", "Can not open document").send();
         break;
       case PCDM_RS_AlreadyRetrieved:
-        Events_Error::send(std::string("Can not open document: already opened"));
+        Events_InfoMessage("Model_Document", "Can not open document: already opened").send();
         break;
       case PCDM_RS_AlreadyRetrievedAndModified:
-        Events_Error::send(
-            std::string("Can not open document: already opened and modified"));
+        Events_InfoMessage("Model_Document", 
+            "Can not open document: already opened and modified").send();
         break;
       case PCDM_RS_NoDriver:
-        Events_Error::send(std::string("Can not open document: driver library is not found"));
+        Events_InfoMessage("Model_Document", "Can not open document: driver library is not found").send();
         break;
       case PCDM_RS_UnknownFileDriver:
-        Events_Error::send(std::string("Can not open document: unknown driver for opening"));
+        Events_InfoMessage("Model_Document", "Can not open document: unknown driver for opening").send();
         break;
       case PCDM_RS_OpenError:
-        Events_Error::send(std::string("Can not open document: file open error"));
+        Events_InfoMessage("Model_Document", "Can not open document: file open error").send();
         break;
       case PCDM_RS_NoVersion:
-        Events_Error::send(std::string("Can not open document: invalid version"));
+        Events_InfoMessage("Model_Document", "Can not open document: invalid version").send();
         break;
       case PCDM_RS_NoModel:
-        Events_Error::send(std::string("Can not open document: no data model"));
+        Events_InfoMessage("Model_Document", "Can not open document: no data model").send();
         break;
       case PCDM_RS_NoDocument:
-        Events_Error::send(std::string("Can not open document: no document inside"));
+        Events_InfoMessage("Model_Document", "Can not open document: no document inside").send();
         break;
       case PCDM_RS_FormatFailure:
-        Events_Error::send(std::string("Can not open document: format failure"));
+        Events_InfoMessage("Model_Document", "Can not open document: format failure").send();
         break;
       case PCDM_RS_TypeNotFoundInSchema:
-        Events_Error::send(std::string("Can not open document: invalid object"));
+        Events_InfoMessage("Model_Document", "Can not open document: invalid object").send();
         break;
       case PCDM_RS_UnrecognizedFileFormat:
-        Events_Error::send(std::string("Can not open document: unrecognized file format"));
+        Events_InfoMessage("Model_Document", "Can not open document: unrecognized file format").send();
         break;
       case PCDM_RS_MakeFailure:
-        Events_Error::send(std::string("Can not open document: make failure"));
+        Events_InfoMessage("Model_Document", "Can not open document: make failure").send();
         break;
       case PCDM_RS_PermissionDenied:
-        Events_Error::send(std::string("Can not open document: permission denied"));
+        Events_InfoMessage("Model_Document", "Can not open document: permission denied").send();
         break;
       case PCDM_RS_DriverFailure:
-        Events_Error::send(std::string("Can not open document: driver failure"));
+        Events_InfoMessage("Model_Document", "Can not open document: driver failure").send();
         break;
       default:
-        Events_Error::send(std::string("Can not open document: unknown error"));
+        Events_InfoMessage("Model_Document", "Can not open document: unknown error").send();
         break;
     }
   }
@@ -231,22 +231,22 @@ bool Model_Document::save(
     aStatus = anApp->SaveAs(myDoc, aPath);
   } catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    Events_Error::send(
-        std::string("Exception in saving of document: ") + aFail->GetMessageString());
+    Events_InfoMessage("Model_Document", 
+        "Exception in saving of document: %1").arg(aFail->GetMessageString()).send();
     return false;
   }
   bool isDone = aStatus == PCDM_SS_OK || aStatus == PCDM_SS_No_Obj;
   if (!isDone) {
     switch (aStatus) {
       case PCDM_SS_DriverFailure:
-        Events_Error::send(std::string("Can not save document: save driver-library failure"));
+        Events_InfoMessage("Model_Document", "Can not save document: save driver-library failure").send();
         break;
       case PCDM_SS_WriteFailure:
-        Events_Error::send(std::string("Can not save document: file writing failure"));
+        Events_InfoMessage("Model_Document", "Can not save document: file writing failure").send();
         break;
       case PCDM_SS_Failure:
       default:
-        Events_Error::send(std::string("Can not save document"));
+        Events_InfoMessage("Model_Document", "Can not save document").send();
         break;
     }
   }
@@ -273,8 +273,8 @@ bool Model_Document::save(
             aFile.Copy(aDestination);
             theResults.push_back(aDestinationDir.ToCString());
           } else {
-            Events_Error::send(
-              std::string("Can not open file ") + aSubPath.ToCString() + " for saving");
+            Events_InfoMessage("Model_Document", 
+              "Can not open file %1 for saving").arg(aSubPath.ToCString()).send();
           }
         }
       } else { // simply save opened document
index 44ab4cf593c62d5a50744a031a5511382d9b2663..0be76f106de57f717d525fceb2b6960113eedc0d 100644 (file)
@@ -20,7 +20,7 @@
 #include <ModelAPI_Tools.h>
 
 #include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <TDataStd_Integer.hxx>
 #include <TDataStd_Comment.hxx>
@@ -224,8 +224,8 @@ void Model_Objects::refsToFeature(FeaturePtr theFeature,
   }
 
   if (!theRefs.empty() && isSendError) {
-    Events_Error::send(
-      "Feature '" + theFeature->data()->name() + "' is used and can not be deleted");
+    Events_InfoMessage("Model_Objects", 
+      "Feature '%1' is used and can not be deleted").arg(theFeature->data()->name()).send();
   }
 }
 
@@ -302,10 +302,10 @@ void Model_Objects::moveFeature(FeaturePtr theMoved, FeaturePtr theAfterThis)
   if (!aPassedMovedFrom || !aPassedMovedTo) {// not found: unknown situation
     if (!aPassedMovedFrom) {
       static std::string aMovedFromError("The moved feature is not found");
-      Events_Error::send(aMovedFromError);
+      Events_InfoMessage("Model_Objects", aMovedFromError).send();
     } else {
       static std::string aMovedToError("The 'after' feature for movement is not found");
-      Events_Error::send(aMovedToError);
+      Events_InfoMessage("Model_Objects", aMovedToError).send();
     }
     return;
   }
@@ -643,7 +643,7 @@ void Model_Objects::synchronizeFeatures(
         TCollection_AsciiString(Handle(TDataStd_Comment)::DownCast(aLabIter.Value())->Get())
         .ToCString(), anOwner);
       if (!aFeature.get()) {  // somethig is wrong, most probably, the opened document has invalid structure
-        Events_Error::send("Invalid type of object in the document");
+        Events_InfoMessage("Model_Objects", "Invalid type of object in the document").send();
         aLabIter.Value()->Label().ForgetAllAttributes();
         continue;
       }
@@ -1082,8 +1082,8 @@ void Model_Objects::updateResults(FeaturePtr theFeature)
           theFeature->attributeChanged("expression"); // just produce a value
           break;
         } else {
-          Events_Error::send(std::string("Unknown type of result is found in the document:") +
-            TCollection_AsciiString(aGroup->Get()).ToCString());
+          Events_InfoMessage("Model_Objects", "Unknown type of result is found in the document:")
+            .arg(TCollection_AsciiString(aGroup->Get()).ToCString()).send();
         }
       }
       if (aNewBody && !aNewBody->data()->isDeleted()) {
index 167d3b93574afebf9d69d02d2ee01071dfc601d2..232834edc02cdbd889ae80dd582561b083c1fc33 100644 (file)
@@ -7,7 +7,7 @@
 #include "Model_SelectionNaming.h"
 #include "Model_Document.h"
 #include <ModelAPI_Feature.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <TopoDS_Iterator.hxx>
 #include <TopoDS.hxx>
@@ -286,7 +286,7 @@ TopAbs_ShapeEnum translateType (const std::string& theType)
   }
   if (MyShapeTypes.find(theType) != MyShapeTypes.end())
     return MyShapeTypes[theType];
-  Events_Error::send("Shape type defined in XML is not implemented!");
+  Events_InfoMessage("Model_SelectionNaming", "Shape type defined in XML is not implemented!").send();
   return TopAbs_SHAPE;
 }
 
index 886bfec9f304b3cdeda9ba47a89d2601dc7c6fad..fe35df17d218e244740d6a3b28e6e43407b282e4 100644 (file)
@@ -15,7 +15,7 @@
 #include <Model_Validator.h>
 #include <ModelAPI_Events.h>
 #include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <Config_FeatureMessage.h>
 #include <Config_AttributeMessage.h>
 #include <Config_ValidatorMessage.h>
@@ -156,9 +156,9 @@ FeaturePtr Model_Session::createFeature(string theFeatureID, Model_Document* the
   if (myPlugins.find(theFeatureID) != myPlugins.end()) {
     std::pair<std::string, std::string>& aPlugin = myPlugins[theFeatureID]; // plugin and doc kind
     if (!aPlugin.second.empty() && aPlugin.second != theDocOwner->kind()) {
-      Events_Error::send(
-          string("Feature '") + theFeatureID + "' can be created only in document '"
-              + aPlugin.second + "' by the XML definition");
+      Events_InfoMessage("Model_Session",
+          "Feature '%1' can be created only in document '%2' by the XML definition")
+          .arg(theFeatureID).arg(aPlugin.second).send();
       return FeaturePtr();
     }
     myCurrentPluginName = aPlugin.first;
@@ -169,16 +169,16 @@ FeaturePtr Model_Session::createFeature(string theFeatureID, Model_Document* the
     if (myPluginObjs.find(myCurrentPluginName) != myPluginObjs.end()) {
       FeaturePtr aCreated = myPluginObjs[myCurrentPluginName]->createFeature(theFeatureID);
       if (!aCreated) {
-        Events_Error::send(
-            string("Can not initialize feature '") + theFeatureID + "' in plugin '"
-                + myCurrentPluginName + "'");
+        Events_InfoMessage("Model_Session",
+            "Can not initialize feature '%1' in plugin '%2'")
+            .arg(theFeatureID).arg(myCurrentPluginName).send();
       }
       return aCreated;
     } else {
-      Events_Error::send(string("Can not load plugin '") + myCurrentPluginName + "'");
+      Events_InfoMessage("Model_Session","Can not load plugin '%1'").arg(myCurrentPluginName).send();
     }
   } else {
-    Events_Error::send(string("Feature '") + theFeatureID + "' not found in any plugin");
+    Events_InfoMessage("Model_Session","Feature '%1' not found in any plugin").arg(theFeatureID).send();
   }
 
   return FeaturePtr();  // return nothing
@@ -394,7 +394,7 @@ void Model_Session::processEvent(const std::shared_ptr<Events_Message>& theMessa
     }
   } else {  // create/update/delete
     if (myCheckTransactions && !isOperation())
-      Events_Error::send("Modification of data structure outside of the transaction");
+      Events_InfoMessage("Model_Session", "Modification of data structure outside of the transaction").send();
     // if part is deleted, make the root as the current document (on undo of Parts creations)
     static const Events_ID kDeletedEvent = Events_Loop::eventByName(EVENT_OBJECT_DELETED);
     if (theMessage->eventID() == kDeletedEvent) {
index 000c377d43b212704ce22db6e3f24920cf2ea84f..53a308d3c8ac2b9d9936026d246a311b28400397 100755 (executable)
@@ -27,7 +27,7 @@
 #include <GeomDataAPI_Point2D.h>
 #include <Events_Loop.h>
 #include <Events_LongOp.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <Config_PropManager.h>
 
 using namespace std;
@@ -350,8 +350,8 @@ bool Model_Update::processFeature(FeaturePtr theFeature)
   } else {
     int aCount = myProcessed[theFeature];
     if (aCount > 100) { // too many repetition of processing (in VS it may crash on 330 with stack overflow)
-      Events_Error::send(
-        "Feature '" + theFeature->data()->name() + "' is updated in infinitive loop");
+      Events_InfoMessage("Model_Update",
+        "Feature '%1' is updated in infinitive loop").arg(theFeature->data()->name()).send();
       return false;
     }
     myProcessed[theFeature] = aCount + 1;
@@ -725,8 +725,8 @@ void Model_Update::executeFeature(FeaturePtr theFeature)
     }
   } catch(...) {
     aState = ModelAPI_StateExecFailed;
-    Events_Error::send(
-      "Feature " + theFeature->getKind() + " has failed during the execution");
+    Events_InfoMessage("Model_Update",
+      "Feature %1 has failed during the execution").arg(theFeature->getKind()).send();
   }
   // The macro feature has to be deleted in any case even its execution is failed 
   myWaitForFinish.insert(theFeature);
index 6795e43e1b2b13cb7387d4ff8e3515534a25ac4b..dafa195830c7b5e6dcd6f439ecf1168f900d3cf2 100644 (file)
 #include <ModelAPI_Feature.h>
 #include <Model_Data.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 void Model_ValidatorsFactory::registerValidator(const std::string& theID,
   ModelAPI_Validator* theValidator)
 {
   if (myIDs.find(theID) != myIDs.end()) {
-    Events_Error::send(std::string("Validator ") + theID + " is already registered");
+    Events_InfoMessage("Model_Validator", "Validator %1 is already registered").arg(theID).send();
   } else {
     myIDs[theID] = theValidator;
   }
@@ -86,7 +86,8 @@ void Model_ValidatorsFactory::validators(const std::string& theFeatureID,
     AttrValidators::const_iterator aValidatorsIt = aFeatureIt->second.cbegin();
     for (; aValidatorsIt != aFeatureIt->second.cend(); aValidatorsIt++) {
       if (!validator(aValidatorsIt->first)) {
-        Events_Error::send(std::string("Validator ") + aValidatorsIt->first + " was not registered");
+        Events_InfoMessage("Model_Validator", "Validator %1 was not registered")
+          .arg(aValidatorsIt->first).send();
       } else {
         theValidators.push_back(std::make_pair(aValidatorsIt->first, aValidatorsIt->second));
       }
@@ -106,7 +107,8 @@ void Model_ValidatorsFactory::validators(const std::string& theFeatureID, const
       AttrValidators::const_iterator aValidatorsIt = anAttrIt->second.cbegin();
       for (; aValidatorsIt != anAttrIt->second.cend(); aValidatorsIt++) {
         if (!validator(aValidatorsIt->first)) {
-          Events_Error::send(std::string("Validator ") + aValidatorsIt->first + " was not registered");
+          Events_InfoMessage("Model_Validator", "Validator %1 was not registered")
+            .arg(aValidatorsIt->first).send();
         } else {
           theValidators.push_back(std::make_pair(aValidatorsIt->first, aValidatorsIt->second));
         }
index e511e5223c6809d3ff82bcc5b4ceeba896078923..4320004afc94da2b6ff8274aa58b22b63b5caef4 100644 (file)
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_Data.h>
 //#include <ModelAPI_AttributeValidator.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 
 void ModuleBase_FilterFactory::registerFilter(const std::string& theID,
                                               ModuleBase_Filter* theFilter)
 {
   if (myIDs.find(theID) != myIDs.end()) {
-    Events_Error::send(std::string("Filter ") + theID + " is already registered");
+    Events_InfoMessage("ModuleBase_FilterFactory", "Filter %1 is already registered").arg(theID).send();
   } else {
     myIDs[theID] = theFilter;
   }
@@ -63,7 +63,8 @@ void ModuleBase_FilterFactory::filters(const std::string& theFeatureID,
         std::map<std::string, ModuleBase_Filter*>::const_iterator aFound = myIDs.find(
           aValIter->first);
         if (aFound == myIDs.end()) {
-          Events_Error::send(std::string("Filter ") + aValIter->first + " was not registered");
+          Events_InfoMessage("ModuleBase_FilterFactory", "Filter %1 was not registered")
+            .arg(aValIter->first).send();
         } else {
           ModuleBase_Filter* aFilter = aFound->second;
           aFilter->setArguments(aValIter->second);
index 4085f399eccbe8f0a7707ec79214d0040cfaa6ec..dfd0d1a63db85b085b8de75b0d4731d6ebf27d5d 100755 (executable)
@@ -12,7 +12,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <GeomAPI_PlanarEdges.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <Events_Loop.h>
 
 #include <BRep_Builder.hxx>
@@ -75,7 +75,7 @@ void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
   AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
 
   if (!aReadyToDisplay) {
-    Events_Error::throwException("An empty AIS presentation: ModuleBase_ResultPrs");
+    Events_InfoMessage("ModuleBase_ResultPrs", "An empty AIS presentation: ModuleBase_ResultPrs").send();
     static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
     ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
   }
index 37e6500b4d58f567de51b101f825e315a57e3f16..a17f61e4b37136d48452ad56eefb2495f1719c6a 100755 (executable)
@@ -34,7 +34,7 @@
 #include <TopoDS_Iterator.hxx>
 
 #include <GeomDataAPI_Point2D.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <Config_PropManager.h>
 
@@ -323,7 +323,7 @@ TopAbs_ShapeEnum shapeType(const QString& theType)
   QString aType = theType.toLower();
   if (MyShapeTypes.contains(aType))
     return MyShapeTypes[aType];
-  Events_Error::send("Shape type defined in XML is not implemented!");
+  Events_InfoMessage("ModuleBase_Tools", "Shape type defined in XML is not implemented!").send();
   return TopAbs_SHAPE;
 }
 
index 13c7bf571d9e5db21073f67610ebd1a15d7dc1c8..2d0ab9e2508c9fc85906f0dde7943ae69373d955 100755 (executable)
@@ -9,7 +9,7 @@
 
 #include <Config_WidgetAPI.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <QStringList>
 
@@ -43,8 +43,8 @@ void ModuleBase_WidgetCreatorFactory::registerCreator(const WidgetCreatorPtr& th
     if (!myPanelToCreator.contains(aKey))
       myPanelToCreator[aKey] = theCreator;
     else {
-      Events_Error::send("The" + aKey + " panel XML definition has been already \
-used by another widget creator");
+      Events_InfoMessage("ModuleBase_WidgetCreatorFactory", 
+        "The %1 panel XML definition has been already used by another widget creator").arg(aKey).send();
     }
   }
 
@@ -56,8 +56,8 @@ used by another widget creator");
     if (!myCreators.contains(aKey))
       myCreators[aKey] = theCreator;
     else {
-      Events_Error::send("The" + aKey + " widget XML definition has been already \
-used by another widget creator");
+      Events_InfoMessage("ModuleBase_WidgetCreatorFactory",
+        "The %1 widget XML definition has been already used by another widget creator").arg(aKey).send();
     }
   }
 
@@ -69,8 +69,8 @@ used by another widget creator");
     if (!myPageToCreator.contains(aKey))
       myPageToCreator[aKey] = theCreator;
     else {
-      Events_Error::send("The" + aKey + " page XML definition has been already \
-used by another widget creator");
+      Events_InfoMessage("ModuleBase_WidgetCreatorFactory",
+        "The %1 page XML definition has been already used by another widget creator").arg(aKey).send();
     }
   }
 }
index 119329071e8cf0fecad02d833ecc48bb845d86dc..4652227a84a180fd7921b20d6c9ef52974fc1881 100644 (file)
@@ -39,7 +39,6 @@
 #include <ModelAPI_AttributeValidator.h>
 
 #include <Config_WidgetAPI.h>
-#include <Events_Error.h>
 
 #include <GeomAPI_Shape.h>
 
index 624b923194ebf3a2c6e8e9c80a3ce366a9cd1017..fe2665b1081f8678cc5467613489a3a472f3f654 100644 (file)
@@ -11,7 +11,7 @@
 #include <ParametersPlugin_Parameter.h>
 #include <ParametersPlugin_PyInterp.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_AttributeInteger.h>
@@ -89,8 +89,9 @@ void ParametersPlugin_EvalListener::processEvent(
   } else if (theMessage->eventID() == kReplaceParameterEvent) {
     processReplaceParameterEvent(theMessage);
   } else {
-    Events_Error::send(std::string("ParametersPlugin python interpreter, unhandled message caught: ")
-                       + theMessage->eventID().eventText());
+    Events_InfoMessage("ParametersPlugin_EvalListener", 
+      "ParametersPlugin python interpreter, unhandled message caught: ")
+      .arg(theMessage->eventID().eventText()).send();
   }
 }
 
index ba7074e50c5447f3f292ef5b604a128de2c56f51..451e2141ff9f5778f1d3f0814ed51bd47586086f 100644 (file)
@@ -22,7 +22,7 @@
 #include <SketchSolver_ConstraintMovement.h>
 
 #ifdef _DEBUG
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <ModelAPI_AttributeRefList.h>
 #include <ModelAPI_ResultConstruction.h>
 #include <SketchSolver_Error.h>
@@ -61,7 +61,7 @@ SolverConstraintPtr SketchSolver_Builder::createConstraint(ConstraintPtr theCons
         ResultConstructionPtr aRC =
             std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(aRefAttr->object());
         if (!aRC)
-          Events_Error::send(SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this);
+          Events_InfoMessage("SketchSolver_Builder", SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this).send();
       }
       continue;
     }
@@ -73,7 +73,7 @@ SolverConstraintPtr SketchSolver_Builder::createConstraint(ConstraintPtr theCons
         ResultConstructionPtr aRC =
             std::dynamic_pointer_cast<ModelAPI_ResultConstruction>(*aListIter);
         if (*aListIter && !aRC)
-          Events_Error::send(SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this);
+          Events_InfoMessage("SketchSolver_Builder", SketchSolver_Error::NEED_OBJECT_NOT_FEATURE(), this).send();
       }
     }
   }
index 639af961c4e43f4e5ad0dbb1a06d377ae2e2a8c1..0471488f38ce6d095e124209d8a031cc7c36ffc2 100644 (file)
@@ -12,7 +12,7 @@
 #include <SketchSolver_Error.h>
 #include <SketchSolver_Manager.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <Events_Loop.h>
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_Events.h>
@@ -166,7 +166,7 @@ bool SketchSolver_Group::changeConstraint(
     if (!aConstraint->error().empty()) {
       if (aConstraint->error() == SketchSolver_Error::NOT_INITIALIZED())
         return false; // some attribute are not initialized yet, don't show message
-      Events_Error::send(aConstraint->error(), this);
+      Events_InfoMessage("SketchSolver_Group", aConstraint->error(), this).send();
     }
     myConstraints[theConstraint] = aConstraint;
 
index d46643fd9c375075d0a5ad7fd2a2114020239162..bbca46d507183835df37f5042b2f41ba259d55a6 100644 (file)
@@ -25,8 +25,6 @@
 #include <TopExp.hxx>
 #include <BRep_Tool.hxx>
 
-#include <Events_Error.h>
-
 #define PI 3.1415926535897932
 
 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_Angle, AIS_AngleDimension_);
index 2b6c57b846dbeaa146caa129e13a9ba5d27dac8c..e7ae5a144043c45ace700547fe039cdccc6fb8e8 100644 (file)
@@ -18,8 +18,6 @@
 #include <GeomAPI_Dir.h>
 #include <GeomAPI_Pnt2d.h>
 
-#include <Events_Error.h>
-
 #include <SketchPlugin_Constraint.h>
 
 #include <Graphic3d_AspectMarker3d.hxx>
index 36c68a41def93f79f5dd30d24a4feb07c0cf38ad..8b069825aca96ad221829f83d15276b23a7c5ffb 100755 (executable)
@@ -10,8 +10,6 @@
 
 #include <SketchPlugin_Constraint.h>
 
-#include "Events_Error.h"
-
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Prs3d_Root.hxx>
 
index e8b950f383b72facb28039ec2b96c0164b3da744..4977b3f28e7771cfdd778c16361d19ff02428704 100755 (executable)
@@ -7,7 +7,6 @@
 #include "SketcherPrs_DimensionStyleListener.h"
 #include "SketcherPrs_Tools.h"
 
-#include <Events_Error.h>
 #include <Events_Loop.h>
 
 SketcherPrs_DimensionStyleListener::SketcherPrs_DimensionStyleListener()
index 4423ca592888c07774a96dd0eaf13bca751e84b0..74ed7d4db3ea51a21d4706146cc75e9066a6071b 100644 (file)
@@ -10,8 +10,6 @@
 
 #include <SketchPlugin_Constraint.h>
 
-#include "Events_Error.h"
-
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Prs3d_Root.hxx>
 
index b532887d1052901106a2c5a6e376cd1e0f4eb868..b0a7066186a84653eae58ff24a4c623ddc3bf943 100644 (file)
@@ -13,8 +13,6 @@
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Prs3d_Root.hxx>
 
-#include <Events_Error.h>
-
 
 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_HVDirection, SketcherPrs_SymbolPrs);
index 2dc2a3b3daa6c65cb80baa1c1a6310779f11b12b..fd4ba79e1f7ca7e464fba031335af240420253bc 100644 (file)
@@ -15,8 +15,6 @@
 #include <SketchPlugin_Point.h>
 #include <SketchPlugin_Circle.h>
 
-#include <Events_Error.h>
-
 #include <GeomDataAPI_Point2D.h>
 #include <GeomAPI_Pnt.h>
 #include <GeomAPI_XYZ.h>
index ceca64a9c96505baa8a018d3844a59a9de239d08..b3d22499470e5577a3a9656026cd1e865b58108c 100755 (executable)
@@ -10,8 +10,6 @@
 
 #include <SketchPlugin_Constraint.h>
 
-#include "Events_Error.h"
-
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Prs3d_Root.hxx>
 
index e31b3e1d497d0df476a6d4b5df21ed09562624fb..9e7e61b655ffb6520c797e797f9825e5e4f039a5 100644 (file)
@@ -13,8 +13,6 @@
 #include <SketchPlugin_Circle.h>
 #include <SketchPlugin_Arc.h>
 
-#include <Events_Error.h>
-
 #include <GeomDataAPI_Point2D.h>
 #include <GeomAPI_Pnt2d.h>
 #include <GeomAPI_Circ.h>
index 590f1abf8e4ebe2603943b0561a34b6556dfa3ef..5f551735422f9edec93bf358c2e54b06d7e97a39 100644 (file)
@@ -12,7 +12,7 @@
 #include <GeomAPI_Vertex.h>
 #include <GeomAPI_Curve.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <Graphic3d_ArrayOfSegments.hxx>
 #include <Graphic3d_BndBox4f.hxx>
@@ -294,7 +294,7 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon()
   // The icon for constraint is not found
   static const char aMsg[] = "Error! constraint images are not found";
   cout<<aMsg<<endl;
-  Events_Error::send(aMsg);
+  Events_InfoMessage("SketcherPrs_SymbolPrs", aMsg).send();
   myIconsMap[iconName()] = Handle(Image_AlienPixMap)();
   return Handle(Image_AlienPixMap)();
 }
index 0435be1a6cafbf1aa7c3057f56aae249aef6c0c2..129a595daa13fc12b0df39660277a150701d20d2 100644 (file)
@@ -12,7 +12,7 @@
 #include <XGUI_SelectionMgr.h>
 
 #include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Events.h>
@@ -175,7 +175,7 @@ QKeySequence XGUI_ActionsMgr::registerShortcut(const QKeySequence& theKeySequenc
   if (myShortcuts.contains(theKeySequence)) {
     QString aMessage = tr("Shortcut %1 is already defined. Ignore.");
     aMessage = aMessage.arg(theKeySequence.toString());
-    Events_Error::send(aMessage.toStdString());
+    Events_InfoMessage("XGUI_ActionsMgr", aMessage.toStdString()).send();
     return QKeySequence();
   }
   myShortcuts.append(theKeySequence);
index 7948325d795e1442ceeff7b5521220b8d90e4605..f07582125e0a09dfb500ff2993be9c606d371892 100644 (file)
@@ -14,7 +14,7 @@
 #include <ModelAPI_Session.h>
 #include <Config_PropManager.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <vector>
 #include <QColor>
@@ -50,7 +50,8 @@ void XGUI_CustomPrs::getDefaultColor(ObjectPtr theObject, const bool isEmptyColo
     // all AIS objects, where the color is not set, are in black.
     // The color should be defined in XML or set in the attribute
     theColor = Config_PropManager::color("Visualization", "object_default_color", "#000000");
-    Events_Error::send("A default color is not defined in the preferences for this kind of result");
+    Events_InfoMessage("XGUI_CustomPrs", 
+      "A default color is not defined in the preferences for this kind of result").send();
   }
 }
 
index d1ccd46ffa3f987c4729acb3a77d00b5868c7eed..cbba9c920638ff322be328498fe0b343ff452f78 100644 (file)
@@ -22,7 +22,6 @@
 #include <Config_DataModelReader.h>
 
 #include <Events_Loop.h>
-#include <Events_Error.h>
 
 #include <QIcon>
 #include <QBrush>
index 7d6410a49eed6162e1e89f6cb7a3aaa89ab905e3..14715346960388ffaaf1677f6dd1f177a7562426 100644 (file)
@@ -8,7 +8,6 @@
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Document.h>
 #include <ModelAPI_Tools.h>
-#include <Events_Error.h>
 
 #include <ModuleBase_Tools.h>
 
index 9a7556e403aa431d18eebfc168d3cde9ae186717..b3e1dca321ec14877c55949df0323add655eb3bd 100644 (file)
@@ -17,7 +17,7 @@
 #include <ModelAPI_ResultPart.h>
 #include <ModelAPI_CompositeFeature.h>
 #include <ModelAPI_Tools.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <GeomAPI_Shape.h>
 
@@ -137,7 +137,7 @@ bool canRename(const ObjectPtr& theObject, const QString& theName)
       QString aErrMsg(QObject::tr("Selected parameter can not be renamed to: %1. \
  There is a parameter with the same name. Its value is: %2.").arg(qPrintable(theName)).arg(aValue));
       // We can not use here a dialog box for message - it will crash editing process in ObjectBrowser
-      Events_Error::send(aErrMsg.toStdString());
+      Events_InfoMessage("XGUI_Tools", aErrMsg.toStdString()).send();
       return false;
     }
   }
index 61bb0e22ab94f3784176c5e592497314c0787504..d7f38883ae936c3c8119f71402b5da68859a3f7f 100755 (executable)
@@ -52,7 +52,7 @@
 //#include <PartSetPlugin_Part.h>
 
 #include <Events_Loop.h>
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <Events_LongOp.h>
 
 #include <ModuleBase_FilterFactory.h>
@@ -217,6 +217,13 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
 //******************************************************
 XGUI_Workshop::~XGUI_Workshop(void)
 {
+#ifdef _DEBUG
+#ifdef MISSED_TRANSLATION
+  // Save Missed translations
+  Config_Translator::saveMissedTranslations();
+#endif
+#endif
+
   delete myDisplayer;
   delete myDataModelXMLReader;
 }
@@ -498,10 +505,9 @@ void XGUI_Workshop::setPropertyPanel(ModuleBase_Operation* theOperation)
   std::string aFeatureKind = aFeature->getKind();
   foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
     if (!aWidget->attributeID().empty() && !aFeature->attribute(aWidget->attributeID()).get()) {
-      std::string anErrorMsg = "The feature '" + aFeatureKind + "' has no attribute '"
-          + aWidget->attributeID() + "' used by widget '"
-          + aWidget->metaObject()->className() + "'.";
-      Events_Error::send(anErrorMsg);
+      std::string anErrorMsg = "The feature '%1' has no attribute '%2' used by widget '%3'.";
+      Events_InfoMessage("XGUI_Workshop", anErrorMsg)
+        .arg(aFeatureKind).arg(aWidget->attributeID()).arg(aWidget->metaObject()->className()).send();
       myPropertyPanel->cleanContent();
       return;
     }
@@ -1012,7 +1018,7 @@ ModuleBase_IModule* XGUI_Workshop::loadModule(const QString& theModule)
 
   if (!err.isEmpty()) {
     if (desktop()) {
-      Events_Error::send(err.toStdString());
+      Events_InfoMessage("XGUI_Workshop", err.toStdString()).send();
     } else {
       qWarning(qPrintable(err));
     }
index 567ecc63a8c1febd90c6c5fdeb1c69ae3605a5c6..366336a1f4307ed65b504699ec1c7dfbf52af5bc 100755 (executable)
@@ -29,7 +29,6 @@
 #include <ModelAPI_Tools.h>
 
 #include <Events_Loop.h>
-#include <Events_Error.h>
 #include <Events_LongOp.h>
 
 #include <ModuleBase_IWorkshop.h>
@@ -83,7 +82,6 @@ void XGUI_WorkshopListener::initializeEventListening()
 {
   //Initialize event listening
   Events_Loop* aLoop = Events_Loop::loop();
-  //aLoop->registerListener(this, Events_Error::errorID());  //!< Listening application errors.
   aLoop->registerListener(this, Events_InfoMessage::errorID());  //!< Listening application errors.
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED));
   aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
index a47614eca0505e783350127bdcdc409746ae3ec5..070700a9ae2e3ff8f28c53736b6727c067478162 100644 (file)
 <context>
     <name>XGUI_DataTree</name>
     <message>
-        <location filename="XGUI_ObjectsBrowser.cpp" line="161"/>
+        <location filename="XGUI_ObjectsBrowser.cpp" line="160"/>
         <source>History change</source>
         <translation type="unfinished"></translation>
     </message>
 <context>
     <name>XGUI_ObjectsBrowser</name>
     <message>
-        <location filename="XGUI_ObjectsBrowser.cpp" line="343"/>
+        <location filename="XGUI_ObjectsBrowser.cpp" line="342"/>
         <source>Part set</source>
         <translation type="unfinished"></translation>
     </message>
 <context>
     <name>XGUI_Workshop</name>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="302"/>
-        <location filename="XGUI_Workshop.cpp" line="356"/>
+        <location filename="XGUI_Workshop.cpp" line="309"/>
+        <location filename="XGUI_Workshop.cpp" line="363"/>
         <source>Undo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="303"/>
-        <location filename="XGUI_Workshop.cpp" line="356"/>
+        <location filename="XGUI_Workshop.cpp" line="310"/>
+        <location filename="XGUI_Workshop.cpp" line="363"/>
         <source>Undo last command</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="306"/>
+        <location filename="XGUI_Workshop.cpp" line="313"/>
         <source>INF_DESK_TOOLBAR_STANDARD</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="312"/>
-        <location filename="XGUI_Workshop.cpp" line="365"/>
+        <location filename="XGUI_Workshop.cpp" line="319"/>
+        <location filename="XGUI_Workshop.cpp" line="372"/>
         <source>Redo</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="312"/>
-        <location filename="XGUI_Workshop.cpp" line="365"/>
+        <location filename="XGUI_Workshop.cpp" line="319"/>
+        <location filename="XGUI_Workshop.cpp" line="372"/>
         <source>Redo last command</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="329"/>
+        <location filename="XGUI_Workshop.cpp" line="336"/>
         <source>Export native...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="329"/>
+        <location filename="XGUI_Workshop.cpp" line="336"/>
         <source>Export the current document into a native file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="334"/>
+        <location filename="XGUI_Workshop.cpp" line="341"/>
         <source>Import native...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="334"/>
+        <location filename="XGUI_Workshop.cpp" line="341"/>
         <source>Import native file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="346"/>
-        <location filename="XGUI_Workshop.cpp" line="835"/>
+        <location filename="XGUI_Workshop.cpp" line="353"/>
+        <location filename="XGUI_Workshop.cpp" line="841"/>
         <source>Save</source>
         <extracomment>Title of the dialog which asks user if he wants to save study in existing non-empty folder</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="346"/>
+        <location filename="XGUI_Workshop.cpp" line="353"/>
         <source>Save the document</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="351"/>
+        <location filename="XGUI_Workshop.cpp" line="358"/>
         <source>Save as...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="351"/>
+        <location filename="XGUI_Workshop.cpp" line="358"/>
         <source>Save the document into a file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="379"/>
+        <location filename="XGUI_Workshop.cpp" line="386"/>
         <source>Open...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="379"/>
+        <location filename="XGUI_Workshop.cpp" line="386"/>
         <source>Open a new document</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="383"/>
+        <location filename="XGUI_Workshop.cpp" line="390"/>
         <source>Preferences</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="383"/>
+        <location filename="XGUI_Workshop.cpp" line="390"/>
         <source>Edit preferences</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="387"/>
+        <location filename="XGUI_Workshop.cpp" line="394"/>
         <source>Exit</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="387"/>
+        <location filename="XGUI_Workshop.cpp" line="394"/>
         <source>Exit application</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="697"/>
-        <location filename="XGUI_Workshop.cpp" line="753"/>
+        <location filename="XGUI_Workshop.cpp" line="703"/>
+        <location filename="XGUI_Workshop.cpp" line="759"/>
         <source>Save current file</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="698"/>
+        <location filename="XGUI_Workshop.cpp" line="704"/>
         <source>The document is modified, save before opening another?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="709"/>
+        <location filename="XGUI_Workshop.cpp" line="715"/>
         <source>Select directory</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="714"/>
+        <location filename="XGUI_Workshop.cpp" line="720"/>
         <source>Warning</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="714"/>
+        <location filename="XGUI_Workshop.cpp" line="720"/>
         <source>Unable to open the file.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="753"/>
+        <location filename="XGUI_Workshop.cpp" line="759"/>
         <source>The document is modified, save before exit?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="819"/>
+        <location filename="XGUI_Workshop.cpp" line="825"/>
         <source>Select directory to save files...</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="821"/>
+        <location filename="XGUI_Workshop.cpp" line="827"/>
         <source>Directories (*)</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="836"/>
+        <location filename="XGUI_Workshop.cpp" line="842"/>
         <source>The directory already contains some files, save anyway?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="969"/>
+        <location filename="XGUI_Workshop.cpp" line="975"/>
         <source>Information about module &quot;%1&quot; doesn&apos;t exist.</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="1100"/>
+        <location filename="XGUI_Workshop.cpp" line="1106"/>
         <source>Object browser</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="1432"/>
+        <location filename="XGUI_Workshop.cpp" line="1438"/>
         <source>Unused features are the following: %1.
 These features will be deleted.
 Would you like to continue?</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="1470"/>
+        <location filename="XGUI_Workshop.cpp" line="1476"/>
         <source>All features are relevant, there is nothing to be deleted</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="1970"/>
+        <location filename="XGUI_Workshop.cpp" line="1976"/>
         <source>Find results</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="XGUI_Workshop.cpp" line="1971"/>
+        <location filename="XGUI_Workshop.cpp" line="1977"/>
         <source>Results not found</source>
         <translation type="unfinished"></translation>
     </message>