From: mpv Date: Thu, 10 Sep 2015 07:37:49 +0000 (+0300) Subject: The message is produced on each errors state of object change for later GUI catching... X-Git-Tag: V_1.4.0_beta4~46 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=90c96d8564e5d92cfd7fb0f0b49ab077a93ba9e2;p=modules%2Fshaper.git The message is produced on each errors state of object change for later GUI catching and usage. --- diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 79a405366..755da1593 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -302,7 +302,11 @@ static Handle(TDataStd_IntegerArray) stateArray(TDF_Label& theLab) void Model_Data::execState(const ModelAPI_ExecState theState) { if (theState != ModelAPI_StateNothing) { - stateArray(myLab)->SetValue(STATE_INDEX_STATE, (int)theState); + if (stateArray(myLab)->Value(STATE_INDEX_STATE) != (int)theState) { + stateArray(myLab)->SetValue(STATE_INDEX_STATE, (int)theState); + static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_ERROR_CHANGED); + ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent, false); + } } } @@ -328,6 +332,8 @@ void Model_Data::setError(const std::string& theError, bool theSend) Events_Error::send(theError); } TDataStd_AsciiString::Set(myLab, theError.c_str()); + static const Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_ERROR_CHANGED); + ModelAPI_EventCreator::get()->sendUpdated(myObject, anEvent, false); } void Model_Data::eraseErrorString() diff --git a/src/ModelAPI/ModelAPI_Events.h b/src/ModelAPI/ModelAPI_Events.h index ef253f5be..4ba952cf5 100644 --- a/src/ModelAPI/ModelAPI_Events.h +++ b/src/ModelAPI/ModelAPI_Events.h @@ -34,6 +34,8 @@ static const char * EVENT_OBJECT_RENAMED = "ObjectRenamed"; static const char * EVENT_OBJECT_MOVED = "ObjectsMoved"; /// Event ID that visualization must be redisplayed (comes with ModelAPI_ObjectUpdatedMessage) static const char * EVENT_OBJECT_TO_REDISPLAY = "ObjectsToRedisplay"; +/// Event ID that error state or error message was updated for the object +static const char * EVENT_OBJECT_ERROR_CHANGED = "ObjectsErrorChanged"; /// Event ID that visualization must be redisplayed (comes with ModelAPI_ObjectUpdatedMessage) static const char * EVENT_OPERATION_LAUNCHED = "OperationLaunched"; /// Event ID that plugin is loaded (comes with ModelAPI_ObjectUpdatedMessage)