]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Error message correction for the following case, found by squish:
authornds <nds@opencascade.com>
Thu, 17 Dec 2015 13:19:27 +0000 (16:19 +0300)
committernds <nds@opencascade.com>
Thu, 17 Dec 2015 13:26:26 +0000 (16:26 +0300)
Create parameter a,
Create construction
Input 'a', 'Enter'
Input 'b', 'Enter' -> strange text in Property Panel tool tip.

src/ModelAPI/ModelAPI_Tools.cpp
src/ModuleBase/ModuleBase_IModule.cpp

index 9023cb2d2d89893c4fb9bf343d2fc6ab248571a1..442549557bf197ce3b4a1b03ca13d292793b48d0 100755 (executable)
@@ -22,6 +22,20 @@ std::shared_ptr<GeomAPI_Shape> shape(const ResultPtr& theResult)
   return theResult->shape();
 }
 
+const char* toString(ModelAPI_ExecState theExecState) 
+{
+#define TO_STRING(__NAME__) case __NAME__: return #__NAME__;
+  switch (theExecState) {
+  TO_STRING(ModelAPI_StateDone)
+  TO_STRING(ModelAPI_StateMustBeUpdated)
+  TO_STRING(ModelAPI_StateExecFailed)
+  TO_STRING(ModelAPI_StateInvalidArgument)
+  TO_STRING(ModelAPI_StateNothing)
+  default: return "Unknown ExecState.";
+  }
+#undef TO_STRING
+}
+
 std::string getFeatureError(const FeaturePtr& theFeature)
 {
   std::string anError;
@@ -39,7 +53,7 @@ std::string getFeatureError(const FeaturePtr& theFeature)
     bool isDone = ( theFeature->data()->execState() == ModelAPI_StateDone
                  || theFeature->data()->execState() == ModelAPI_StateMustBeUpdated );
     if (!isDone)
-      anError = theFeature->data()->execState();
+      anError = toString(theFeature->data()->execState());
   }
 
   return anError;
index 343f3a086fc22649fbda698b6e7f375ee105301b..35d09d0def4e24b791e1dccde7a602943a3d731f 100644 (file)
@@ -66,20 +66,6 @@ void ModuleBase_IModule::sendOperation(ModuleBase_Operation* theOperation)
   Events_Loop::loop()->send(aMessage);
 }
 
-const char* toString(ModelAPI_ExecState theExecState) 
-{
-#define TO_STRING(__NAME__) case __NAME__: return #__NAME__;
-  switch (theExecState) {
-  TO_STRING(ModelAPI_StateDone)
-  TO_STRING(ModelAPI_StateMustBeUpdated)
-  TO_STRING(ModelAPI_StateExecFailed)
-  TO_STRING(ModelAPI_StateInvalidArgument)
-  TO_STRING(ModelAPI_StateNothing)
-  default: return "Unknown ExecState.";
-  }
-#undef TO_STRING
-}
-
 QString ModuleBase_IModule::getFeatureError(const FeaturePtr& theFeature)
 {
   return ModelAPI_Tools::getFeatureError(theFeature).c_str();