]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Exclude Events_Error class from the project
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 6 Jun 2016 15:00:40 +0000 (18:00 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 6 Jun 2016 15:00:40 +0000 (18:00 +0300)
src/Config/Config_Translator.h
src/ConnectorPlugin/ConnectorPlugin_ExportFeature.py
src/Events/CMakeLists.txt
src/Events/Events.i
src/Events/Events_Error.cpp [deleted file]
src/Events/Events_Error.h [deleted file]
src/ParametersPlugin/ParametersPlugin_msg_ru.ts
src/PartSet/PartSet_OperationPrs.cpp
src/PartSet/PartSet_ResultSketchPrs.cpp
src/SketchPlugin/SketchPlugin_msg_en.ts
src/SketcherPrs/SketcherPrs_Tools.cpp

index 706883ffb37c025d5e03248736d0a557962a3b59..9f989f9d0dac7e9caa5411e63aa1f416f8483286 100644 (file)
@@ -13,7 +13,7 @@
 #include <string>
 #include <map>
 
-#define MISSED_TRANSLATION
+//#define MISSED_TRANSLATION
 
 /**
  * \class Config_Translator
index e9cb9804f1813430747dd8965363f74c09982532..1e8f814882788a28a2f3f7ef468c4a9c1525eb61 100644 (file)
@@ -55,7 +55,7 @@ class ExportFeature(ModelAPI.ModelAPI_Feature):
         kResultBodyType = "Bodies"
         aPartSize = self.Part.size(kResultBodyType)
         if aPartSize == 0:
-            EventsAPI.Events_Error_send("No results in the active document")
+            EventsAPI.Events_InfoMessage("ExportFeature","No results in the active document").send()
             return
 
         anObjList = [self.Part.object(kResultBodyType, idx) for idx in xrange(aPartSize)]
index a747fd8724ca5899f65eeec86c765c3cc3d1d5b8..9b3f7773f480309e679b8cb9e0f6d6d2c53df201 100644 (file)
@@ -11,7 +11,6 @@ SET(PROJECT_HEADERS
     Events_MessageGroup.h
     Events_Listener.h
     Events_Loop.h
-    Events_Error.h
     Events_LongOp.h
        Events_InfoMessage.h
 )
@@ -21,7 +20,6 @@ SET(PROJECT_SOURCES
     Events_MessageGroup.cpp
     Events_Listener.cpp
     Events_Loop.cpp
-    Events_Error.cpp
     Events_LongOp.cpp
 )
 
index 005c05758ccc050a43049eea179d32abb252f030..733170ffc5f869d029a239ae1e060488fd679fbb 100644 (file)
@@ -2,7 +2,7 @@
 %module EventsAPI
 %{
   #include "Events.h"
-  #include "Events_Error.h"
+  #include "Events_InfoMessage.h"
   #include "Events_Message.h"
 %}
 
@@ -16,4 +16,4 @@
 
 // all supported interfaces
 %include "Events_Message.h"
-%include "Events_Error.h"
+%include "Events_InfoMessage.h"
diff --git a/src/Events/Events_Error.cpp b/src/Events/Events_Error.cpp
deleted file mode 100644 (file)
index 1dc1012..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-/*
- * Events_Error.cpp
- *
- *  Created on: Apr 28, 2014
- *      Author: sbh
- */
-
-#include <Events_Error.h>
-#include <Events_Loop.h>
-
-#define THROW_EMPTY_AIS_EXCEPTION
-
-Events_Error::Events_Error(const std::string& theDescription, const void* theSender)
-    : Events_Message(Events_Error::errorID(), theSender)
-{
-  myDescription = theDescription;
-}
-
-Events_Error::~Events_Error()
-{
-}
-
-Events_ID Events_Error::errorID()
-{
-  Events_Loop* aLoop = Events_Loop::loop();
-  return aLoop->eventByName("ApplicationError");
-}
-
-const char* Events_Error::description() const
-{
-  return myDescription.c_str();
-}
-
-void Events_Error::send(const std::string& theDescription, const void* theSender)
-{
-  std::shared_ptr<Events_Message> aNewOne = 
-    std::shared_ptr<Events_Message>(new Events_Error(theDescription, theSender));
-  Events_Loop::loop()->send(aNewOne);
-}
-
-void Events_Error::throwException(const std::string& theDescription)
-{
-#ifdef THROW_EMPTY_AIS_EXCEPTION
-  Events_Error::send(
-      std::string("An exception: ") + theDescription);
-#endif
-}
diff --git a/src/Events/Events_Error.h b/src/Events/Events_Error.h
deleted file mode 100644 (file)
index aefa5dd..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-/*
- * Events_Error.h
- *
- *  Created on: Apr 28, 2014
- *      Author: sbh
- */
-
-#ifndef EVENTS_ERROR_H_
-#define EVENTS_ERROR_H_
-
-#include <Events.h>
-#include <Events_Message.h>
-
-#include <string>
-
-/**\class Events_Error
- * \ingroup EventsLoop
- * \brief An error message event.
- *
- * Is generated by any algorithm or GUI of the application to inform the user about
- * the problem. In GUI mode all such errors are collected in the message log window.
- */
-class Events_Error : public Events_Message
-{
-  std::string myDescription;  ///< the description of the error
-
-public:
-  /// default destructor   
-  EVENTS_EXPORT virtual ~Events_Error();
-
-  /// Identifier of this event (one for all errors)
-  EVENTS_EXPORT static Events_ID errorID();
-  /// Specific error string
-  EVENTS_EXPORT const char* description() const;
-  /// Allows to send an error quickly: it creates and sends the error object automatically
-  EVENTS_EXPORT static void send(const std::string& theDescription, const void* theSender = 0);
-
-  /// Throws a C++ exception about using an empty AIS object
-  /// \param theDescription an exception information
-  EVENTS_EXPORT static void throwException(const std::string& theDescription);
-
-protected:
-  /// Default constructor. Use "send" message for generation an error.
-  EVENTS_EXPORT Events_Error(const std::string& theDescription, const void* theSender = 0);
-};
-
-#endif /* EVENTS_ERROR_H_ */
index c1e212c698acac744243a5321a4911c14547e950..d65572fb4f5abfae1bb25c608a4a026f16cae00d 100644 (file)
@@ -6,65 +6,58 @@
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="165"/>
         <source>Name</source>
-        <translation>Имя</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="165"/>
         <source>Equation</source>
-        <translation>Выражение</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="165"/>
         <source>Result</source>
-        <translation>Результат</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="165"/>
         <source>Comment</source>
-        <translation>Коментарий</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="188"/>
         <source>Parameters</source>
-        <translation type="unfinished">Параметры</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="194"/>
         <source>Features</source>
-        <translation>Объекты</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="213"/>
         <source>Add</source>
-        <translation>Добавить</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="217"/>
         <source>Insert</source>
-        <translation>Вставить</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="221"/>
         <source>Remove</source>
-        <translation>Удалить</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="258"/>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="698"/>
         <source>Warning</source>
-        <translation>Предупреждение</translation>
+        <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="ParametersPlugin_WidgetParamsMgr.cpp" line="420"/>
         <source>Name %1 already exists.</source>
-        <translation>Имя %1 уже существует.</translation>
-    </message>
-</context>
-<context>
-    <name>QObject</name>
-    <message>
-        <source>Parameters</source>
-        <translation type="obsolete">Параметры</translation>
+        <translation type="unfinished"></translation>
     </message>
 </context>
 </TS>
index 7102e16c03cce8ce8045d3722e2abfb0309affa5..10d475066d66cbfd9a2f8e5b14087f67bb64b1f1 100755 (executable)
@@ -30,7 +30,7 @@
 #include <ModelAPI_Session.h>
 #include <ModelAPI_ResultCompSolid.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <Events_Loop.h>
 
 #include <GeomAPI_IPresentable.h>
@@ -115,7 +115,8 @@ void PartSet_OperationPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
   }
 
   if (!aReadyToDisplay) {
-    Events_Error::throwException("An empty AIS presentation: PartSet_OperationPrs");
+    Events_InfoMessage("PartSet_OperationPrs", 
+      "An empty AIS presentation: PartSet_OperationPrs").send();
     std::shared_ptr<Events_Message> aMsg = std::shared_ptr<Events_Message>(
                 new Events_Message(Events_Loop::eventByName(EVENT_EMPTY_OPERATION_PRESENTATION)));
     Events_Loop::loop()->send(aMsg);
index 384741cedf30442e8fa09f3275dde8409bc2beee..154ca8d41d9bc671ac9f02525d10d4b78f336e63 100755 (executable)
@@ -13,7 +13,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <GeomAPI_PlanarEdges.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 #include <Events_Loop.h>
 
 #include <SketchPlugin_SketchEntity.h>
@@ -97,7 +97,7 @@ void PartSet_ResultSketchPrs::Compute(const Handle(PrsMgr_PresentationManager3d)
   }
 
   if (!aReadyToDisplay) {
-    Events_Error::throwException("An empty AIS presentation: PartSet_ResultSketchPrs");
+    Events_InfoMessage("PartSet_ResultSketchPrs", "An empty AIS presentation: PartSet_ResultSketchPrs").send();
     static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
     ModelAPI_EventCreator::get()->sendUpdated(myResult, anEvent);
   }
index 8703b587985b27ee26c5ff2c89da98144e6b41e4..e2281644f8ed88fcc138d64045189888be6bc4bb 100644 (file)
@@ -1,15 +1,83 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="en_US">
-<context>
+  <context>
+    <name>Sketch</name>
+    <message>
+      <source>Model_FeatureValidator: Attribute "DirX" is not initialized.</source>
+      <translation>Select a plane for the sketch</translation>
+    </message>
+    <message>
+      <source>Model_FeatureValidator: Attribute "Features" is not initialized.</source>
+      <translation>Sketch objects are not defined</translation>
+    </message>
+  </context>
+  
+  <context>
+    <name>SketchCircle</name>
+    <message>
+      <source>CircleRadius - GeomValidators_Positive: Double is not positive.</source>
+      <translation>Set a positive number for the radius value</translation>
+    </message>
+    <message>
+      <source>Model_FeatureValidator: Attribute "CircleCenter" is not initialized.</source>
+      <translation>Select a center point</translation>
+    </message>
+  </context>
+  
+  <context>
+    <name>SketchConstraintHorizontal</name>
+    <message>
+      <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+      <translation>Select a line for the constraint</translation>
+    </message>
+    <message>
+      <source>ModelAPI_StateInvalidArgument</source>
+      <translation>Wrong object is selected</translation>
+    </message>
+  </context>
+  
+  <context>
+    <name>SketchConstraintPerpendicular</name>
+    <message>
+      <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+      <translation>Select first line for the perpendicular constraint</translation>
+    </message>
+    <message>
+      <source>Model_FeatureValidator: Attribute "ConstraintEntityB" is not initialized.</source>
+      <translation>Select second line for the perpendicular constraint</translation>
+    </message>
+  </context>
+  
+  <context>
+    <name>SketchConstraintRadius</name>
+    <message>
+      <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+      <translation>Select a circle for the radius definition</translation>
+    </message>
+  </context>
+  
+  <context>
     <name>SketchConstraintVertical</name>
     <message>
-        <source>Model_FeatureValidator: Attribute &quot;ConstraintEntityA&quot; is not initialized.</source>
-        <translation>Select a line for the constraint definition.</translation>
+      <source>ModelAPI_StateInvalidArgument</source>
+      <translation>Wrong object is selected</translation>
+    </message>
+    <message>
+      <source>Model_FeatureValidator: Attribute "ConstraintEntityA" is not initialized.</source>
+      <translation>Select a line for the constraint</translation>
+    </message>
+  </context>
+  
+  <context>
+    <name>SketchLine</name>
+    <message>
+      <source>GeomValidators_Different: Attributes StartPoint and EndPoint are equal.</source>
+      <translation>Drag mouse pointer to select an end point</translation>
     </message>
     <message>
-        <source>ModelAPI_StateInvalidArgument</source>
-        <translation>Wrong argument for the constraint</translation>
+      <source>Model_FeatureValidator: Attribute "EndPoint" is not initialized.</source>
+      <translation>Click to select an end point for the line</translation>
     </message>
-</context>
+  </context>
 </TS>
index 91a8d3df81ce5545857290465ac1e7328219d94d..7947c38a2c909bf475f9f5a4577527716adf0392 100644 (file)
@@ -17,7 +17,7 @@
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_Events.h>
 
-#include <Events_Error.h>
+#include <Events_InfoMessage.h>
 
 #include <GeomDataAPI_Point2D.h>
 #include <GeomAPI_Lin2d.h>
@@ -376,7 +376,7 @@ void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect, double theDimValue
 
 void sendEmptyPresentationError(ModelAPI_Feature* theFeature, const std::string theError)
 {
-  Events_Error::throwException("An empty AIS presentation: SketcherPrs_LengthDimension");
+  Events_InfoMessage("SketcherPrs_Tools", "An empty AIS presentation: SketcherPrs_LengthDimension").send();
   static const Events_ID anEvent = Events_Loop::eventByName(EVENT_EMPTY_AIS_PRESENTATION);
   std::shared_ptr<ModelAPI_Object> aConstraintPtr(theFeature);
   ModelAPI_EventCreator::get()->sendUpdated(aConstraintPtr, anEvent);