From 9063c6a0bf16066d23041f4938af628579a5065b Mon Sep 17 00:00:00 2001 From: sbh Date: Thu, 6 Nov 2014 18:12:12 +0300 Subject: [PATCH] The obligatory and concealment attribute's properties now registers in model by special message --- src/Config/CMakeLists.txt | 2 + src/Config/Config_AttributeMessage.cpp | 58 +++++++++++++++++++++ src/Config/Config_AttributeMessage.h | 44 ++++++++++++++++ src/Config/Config_Common.cpp | 41 ++++++++++++++- src/Config/Config_Common.h | 26 ++++++++- src/Config/Config_FeatureMessage.h | 15 ++++-- src/Config/Config_FeatureReader.cpp | 36 +++++++------ src/Config/Config_FeatureReader.h | 8 ++- src/Config/Config_Keywords.h | 17 +++--- src/Config/Config_WidgetAPI.cpp | 18 +------ src/Config/Config_XMLReader.cpp | 13 ----- src/Config/Config_XMLReader.h | 1 - src/Model/Model_Session.cpp | 6 +-- src/ModuleBase/ModuleBase_WidgetFactory.cpp | 23 -------- src/ModuleBase/ModuleBase_WidgetFactory.h | 1 - src/XGUI/XGUI_Workshop.cpp | 6 +-- 16 files changed, 217 insertions(+), 98 deletions(-) create mode 100644 src/Config/Config_AttributeMessage.cpp create mode 100644 src/Config/Config_AttributeMessage.h diff --git a/src/Config/CMakeLists.txt b/src/Config/CMakeLists.txt index 1be2129ed..ab42ba193 100644 --- a/src/Config/CMakeLists.txt +++ b/src/Config/CMakeLists.txt @@ -17,6 +17,7 @@ SET(PROJECT_HEADERS Config_ValidatorMessage.h Config_Prop.h Config_PropManager.h + Config_AttributeMessage.h ) SET(PROJECT_SOURCES @@ -31,6 +32,7 @@ SET(PROJECT_SOURCES Config_ValidatorMessage.cpp Config_Prop.cpp Config_PropManager.cpp + Config_AttributeMessage.cpp ) SET(XML_RESOURCES diff --git a/src/Config/Config_AttributeMessage.cpp b/src/Config/Config_AttributeMessage.cpp new file mode 100644 index 000000000..f0a638a10 --- /dev/null +++ b/src/Config/Config_AttributeMessage.cpp @@ -0,0 +1,58 @@ +/* + * + */ +#include "Config_AttributeMessage.h" + +Config_AttributeMessage::Config_AttributeMessage(const Events_ID theId, const void* theParent) + : Events_Message(theId, theParent) +{ + myAttributeId = ""; // Attribute unique id + myFeatureId = ""; // Feature unique id + myIsObligatory = true; + myIsConcealment = false; +} + +Config_AttributeMessage::~Config_AttributeMessage() +{ + +} + +const std::string& Config_AttributeMessage::featureId() const +{ + return myFeatureId; +} + +void Config_AttributeMessage::setFeatureId(const std::string& theId) +{ + myFeatureId = theId; +} + +const std::string& Config_AttributeMessage::attributeId() const +{ + return myAttributeId; +} + +void Config_AttributeMessage::setAttributeId(const std::string& theId) +{ + myAttributeId = theId; +} + +bool Config_AttributeMessage::isConcealment() const +{ + return myIsConcealment; +} + +void Config_AttributeMessage::setConcealment(bool theConcealment) +{ + this->myIsConcealment = theConcealment; +} + +bool Config_AttributeMessage::isObligatory() const +{ + return myIsObligatory; +} + +void Config_AttributeMessage::setObligatory(bool theObligatory) +{ + this->myIsObligatory = theObligatory; +} diff --git a/src/Config/Config_AttributeMessage.h b/src/Config/Config_AttributeMessage.h new file mode 100644 index 000000000..f8ac8e3d5 --- /dev/null +++ b/src/Config/Config_AttributeMessage.h @@ -0,0 +1,44 @@ +#ifndef ATTRIBUTE_MESSAGE_H +#define ATTRIBUTE_MESSAGE_H + +#include +#include +#include + +#include + +/* + * Class to pass an attribute's (widget's) entry info extracted from xml file. + * + */ +class Config_AttributeMessage : public Events_Message +{ + std::string myAttributeId; //Feature unique id + std::string myFeatureId; //Feature unique id + bool myIsObligatory; + bool myIsConcealment; + + public: + // Same event as Config_FeatureMessage::MODEL_EVENT() + inline static const char* MODEL_EVENT() + { + return Config_FeatureMessage::MODEL_EVENT(); + } + + //const Events_ID theID, const void* theSender = 0 + CONFIG_EXPORT Config_AttributeMessage(const Events_ID theId, const void* theParent = 0); + CONFIG_EXPORT virtual ~Config_AttributeMessage(); + + //Auto-generated getters/setters + CONFIG_EXPORT const std::string& attributeId() const; + CONFIG_EXPORT const std::string& featureId() const; + CONFIG_EXPORT bool isObligatory() const; + CONFIG_EXPORT bool isConcealment() const; + + CONFIG_EXPORT void setAttributeId(const std::string& theId); + CONFIG_EXPORT void setFeatureId(const std::string& id); + CONFIG_EXPORT void setConcealment(bool isConcealment); + CONFIG_EXPORT void setObligatory(bool isObligatory); +}; + +#endif // ATTRIBUTE_MESSAGE_H diff --git a/src/Config/Config_Common.cpp b/src/Config/Config_Common.cpp index a6a9ee512..b3a93acd1 100644 --- a/src/Config/Config_Common.cpp +++ b/src/Config/Config_Common.cpp @@ -11,7 +11,10 @@ #include #include -#include //for stringstream +#include // for stringstream + +#include +#include // for std::transform bool isElementNode(xmlNodePtr theNode) { return theNode->type == XML_ELEMENT_NODE; @@ -42,6 +45,19 @@ bool isNode(xmlNodePtr theNode, const char* theNodeName, ...) return false; } +bool isWidgetNode(xmlNodePtr theNode) +{ + if(!isElementNode(theNode)) + return false; + // it's parent is "feature" or "source" + xmlNodePtr aParentNode = theNode->parent; + if(!isNode(aParentNode, NODE_FEATURE, NODE_SOURCE, NULL)) + return false; + + //it should not be a "source" or a "validator" node + return !isNode(theNode, NODE_SOURCE, NODE_VALIDATOR, NULL); +} + bool hasChild(xmlNodePtr theNode) { xmlNodePtr aNode = theNode->children; @@ -94,3 +110,26 @@ std::string library(const std::string& theLibName) return aLibName; } + +std::string getProperty(xmlNodePtr theNode, const char* thePropName) +{ + std::string result = ""; + char* aPropChars = (char*) xmlGetProp(theNode, BAD_CAST thePropName); + if (!aPropChars || aPropChars[0] == 0) + return result; + result = std::string(aPropChars); + return result; +} + +bool getBooleanAttribute(xmlNodePtr theNode, const char* theAttributeName, bool theDefault) +{ + std::string prop = getProperty(theNode, theAttributeName); + std::transform(prop.begin(), prop.end(), prop.begin(), ::tolower); + bool result = theDefault; + if (prop == "true" || prop == "1") { + result = true; + } else if (prop == "false" || prop == "0") { + result = false; + } + return result; +} diff --git a/src/Config/Config_Common.h b/src/Config/Config_Common.h index a8459c107..0c2689757 100644 --- a/src/Config/Config_Common.h +++ b/src/Config/Config_Common.h @@ -5,8 +5,8 @@ * Author: sbh */ -#ifndef Config_Common_H_ -#define Config_Common_H_ +#ifndef CONFIG_COMMON_H_ +#define CONFIG_COMMON_H_ #include "Config_def.h" @@ -41,6 +41,11 @@ CONFIG_EXPORT bool isElementNode(xmlNodePtr theNode); */ CONFIG_EXPORT bool isNode(xmlNodePtr theNode, const char* theNodeName, ...); +/* + * Checks is the given node is attribute (widget) node. + */ +CONFIG_EXPORT bool isWidgetNode(xmlNodePtr theNode); + /* * Every xml node has child. Even if there is no explicit * child nodes libxml gives the "Text node" as child. @@ -69,4 +74,21 @@ CONFIG_EXPORT bool getValidatorInfo(xmlNodePtr theNode, std::string& outValidato */ CONFIG_EXPORT std::string library(const std::string& theLibName); +/* + * Returns named property for a given node as std::string. + */ +CONFIG_EXPORT std::string getProperty(xmlNodePtr theNode, const char* thePropName); + +/* + * Checks if the given XML node has the given attribute, + * if yes - returns it's bool value, if no, or if the value can not + * be converted to bool - returns theDefault value. + * \param theAttributeName attribute to check + * \param theDefault default value on bad data + * \return the boolean result + */ +CONFIG_EXPORT bool getBooleanAttribute(xmlNodePtr theNode, + const char* theAttributeName, + bool theDefault); + #endif diff --git a/src/Config/Config_FeatureMessage.h b/src/Config/Config_FeatureMessage.h index cd6ce1d47..04afbad19 100644 --- a/src/Config/Config_FeatureMessage.h +++ b/src/Config/Config_FeatureMessage.h @@ -6,9 +6,6 @@ #include -/// Event ID that feature is loaded (comes with Config_FeatureMessage) -static const char * EVENT_FEATURE_LOADED = "FeatureLoaded"; - /* * Class to pass a feature entry extracted from xml file. * Example of the feature entry: @@ -32,6 +29,18 @@ class Config_FeatureMessage : public Events_Message std::string myNestedFeatures; public: + /// Event ID that feature is loaded in workbench (GUI) + inline static const char* GUI_EVENT() + { + static const char * MY_GUI_EVENT_ID("WorkshopFeatureLoaded"); + return MY_GUI_EVENT_ID; + } + inline static const char* MODEL_EVENT() + { + static const char * MY_MODEL_EVENT_ID("ModelFeatureLoaded"); + return MY_MODEL_EVENT_ID; + } + //const Events_ID theID, const void* theSender = 0 CONFIG_EXPORT Config_FeatureMessage(const Events_ID theId, const void* theParent = 0); CONFIG_EXPORT virtual ~Config_FeatureMessage(); diff --git a/src/Config/Config_FeatureReader.cpp b/src/Config/Config_FeatureReader.cpp index 5c4ffba8e..91e59df39 100644 --- a/src/Config/Config_FeatureReader.cpp +++ b/src/Config/Config_FeatureReader.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -29,7 +30,8 @@ Config_FeatureReader::Config_FeatureReader(const std::string& theXmlFile, const char* theEventGenerated) : Config_XMLReader(theXmlFile), myLibraryName(theLibraryName), - myEventGenerated(theEventGenerated ? theEventGenerated : EVENT_FEATURE_LOADED) + myEventGenerated(theEventGenerated ? theEventGenerated : Config_FeatureMessage::GUI_EVENT()), + myIsProcessWidgets(theEventGenerated != NULL) { } @@ -46,18 +48,24 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) { Events_ID aMenuItemEvent = Events_Loop::eventByName(myEventGenerated); if (isNode(theNode, NODE_FEATURE, NULL)) { - Events_Loop* aEvLoop = Events_Loop::loop(); - boost::shared_ptr aMessage( - new Config_FeatureMessage(aMenuItemEvent, this)); + storeAttribute(theNode, _ID); + boost::shared_ptr aMessage(new Config_FeatureMessage(aMenuItemEvent, this)); fillFeature(theNode, aMessage); myFeatures.push_back(getProperty(theNode, _ID)); //If a feature has xml definition for it's widget: aMessage->setUseInput(hasChild(theNode)); - aEvLoop->send(aMessage); + Events_Loop::loop()->send(aMessage); //The m_last* variables always defined before fillFeature() call. XML is a tree. } else if (isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NULL)) { storeAttribute(theNode, _ID); storeAttribute(theNode, WORKBENCH_DOC); + } else if (myIsProcessWidgets && isWidgetNode(theNode)) { + boost::shared_ptr aMessage(new Config_AttributeMessage(aMenuItemEvent, this)); + aMessage->setFeatureId(restoreAttribute(NODE_FEATURE, _ID)); + aMessage->setAttributeId(getProperty(theNode, _ID)); + aMessage->setObligatory(getBooleanAttribute(theNode, ATTRIBUTE_OBLIGATORY, true)); + aMessage->setConcealment(getBooleanAttribute(theNode, ATTRIBUTE_CONCEALMENT, false)); + Events_Loop::loop()->send(aMessage); } //Process SOURCE, VALIDATOR nodes. Config_XMLReader::processNode(theNode); @@ -65,7 +73,11 @@ void Config_FeatureReader::processNode(xmlNodePtr theNode) bool Config_FeatureReader::processChildren(xmlNodePtr theNode) { - return isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NODE_FEATURE, NULL); + bool result = isNode(theNode, NODE_WORKBENCH, NODE_GROUP, NULL); + if(!result && myIsProcessWidgets) { + result = isNode(theNode, NODE_FEATURE, NULL); + } + return result; } void Config_FeatureReader::fillFeature(xmlNodePtr theNode, @@ -75,7 +87,7 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theNode, outFeatureMessage->setPluginLibrary(myLibraryName); outFeatureMessage->setNestedFeatures(getProperty(theNode, FEATURE_NESTED)); - bool isInternal = isInternalFeature(theNode); + bool isInternal = getBooleanAttribute(theNode, ATTRIBUTE_INTERNAL, false); outFeatureMessage->setInternal(isInternal); if (isInternal) { //Internal feature has no visual representation. @@ -90,16 +102,6 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theNode, outFeatureMessage->setDocumentKind(restoreAttribute(NODE_WORKBENCH, WORKBENCH_DOC)); } -bool Config_FeatureReader::isInternalFeature(xmlNodePtr theNode) -{ - std::string prop = getProperty(theNode, ATTRIBUTE_INTERNAL); - std::transform(prop.begin(), prop.end(), prop.begin(), ::tolower); - if (prop.empty() || prop == "false" || prop == "0") { - return false; - } - return true; -} - void Config_FeatureReader::storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute) { diff --git a/src/Config/Config_FeatureReader.h b/src/Config/Config_FeatureReader.h index 92a9d705f..3f5d7f705 100644 --- a/src/Config/Config_FeatureReader.h +++ b/src/Config/Config_FeatureReader.h @@ -32,8 +32,7 @@ class Config_FeatureReader : public Config_XMLReader bool processChildren(xmlNodePtr aNode); void fillFeature(xmlNodePtr theRoot, - const boost::shared_ptr& outFeatureMessage); - bool isInternalFeature(xmlNodePtr theRoot); + const boost::shared_ptr& outFeatureMessage); void storeAttribute(xmlNodePtr theNode, const char* theNodeAttribute); std::string restoreAttribute(xmlNodePtr theNode, const char* theNodeAttribute); @@ -43,13 +42,12 @@ class Config_FeatureReader : public Config_XMLReader /// A map to store all parent's attributes. /// The key has from "Node_Name:Node_Attribute" std::map myParentAttributes; - //std::string myLastWorkbench; - //std::string myLastGroup; std::string myLibraryName; std::list myFeatures; - /// event generated on feature data sending, by default it is EVENT_FEATURE_LOADED + /// event generated on feature data sending, by default it is Config_FeatureMessage::GUI_EVENT() const char* myEventGenerated; + bool myIsProcessWidgets; }; #endif /* CONFIG_FEATUREREADER_H_ */ diff --git a/src/Config/Config_Keywords.h b/src/Config/Config_Keywords.h index 46338306b..d7ed62fab 100644 --- a/src/Config/Config_Keywords.h +++ b/src/Config/Config_Keywords.h @@ -18,21 +18,13 @@ const static char* NODE_SOURCE = "source"; const static char* NODE_VALIDATOR = "validator"; //Widgets +const static char* WDG_INFO = "label"; const static char* WDG_DOUBLEVALUE = "doublevalue"; const static char* WDG_BOOLVALUE = "boolvalue"; const static char* WDG_STRINGVALUE = "stringvalue"; const static char* WDG_MULTISELECTOR = "multi_selector"; -//Widget containers -const static char* WDG_INFO = "label"; -const static char* WDG_GROUP = "groupbox"; -const static char* WDG_CHECK_GROUP = "check_groupbox"; -const static char* WDG_TOOLBOX = "toolbox"; -const static char* WDG_TOOLBOX_BOX = "box"; -const static char* WDG_SWITCH = "switch"; -const static char* WDG_SWITCH_CASE = "case"; const static char* WDG_SHAPE_SELECTOR = "shape_selector"; const static char* WDG_CHOICE = "choice"; - //Specific widgets const static char* WDG_POINT_SELECTOR = "point_selector"; const static char* WDG_POINT2D_DISTANCE = "point2ddistance"; @@ -41,6 +33,13 @@ const static char* WDG_FEATURE_OR_ATTRIBUTE_SELECTOR = "feature_or_attribute_sel const static char* WDG_DOUBLEVALUE_EDITOR = "doublevalue_editor"; const static char* WDG_FILE_SELECTOR= "file_selector"; +//Widget containers +const static char* WDG_GROUP = "groupbox"; +const static char* WDG_CHECK_GROUP = "check_groupbox"; +const static char* WDG_TOOLBOX = "toolbox"; +const static char* WDG_TOOLBOX_BOX = "box"; +const static char* WDG_SWITCH = "switch"; +const static char* WDG_SWITCH_CASE = "case"; const static char* WORKBENCH_DOC = "document"; //Common Widget's or Feature's Properties diff --git a/src/Config/Config_WidgetAPI.cpp b/src/Config/Config_WidgetAPI.cpp index 7d548ea24..085648e97 100644 --- a/src/Config/Config_WidgetAPI.cpp +++ b/src/Config/Config_WidgetAPI.cpp @@ -13,7 +13,6 @@ #include #include -#include Config_WidgetAPI::Config_WidgetAPI(std::string theRawXml) { @@ -85,25 +84,12 @@ bool Config_WidgetAPI::isPagedWidget() const std::string Config_WidgetAPI::getProperty(const char* thePropName) const { - std::string result = ""; - char* aPropChars = (char*) xmlGetProp(myCurrentNode, BAD_CAST thePropName); - if (!aPropChars || aPropChars[0] == 0) - return result; - result = std::string(aPropChars); - return result; + return ::getProperty(myCurrentNode, thePropName); } bool Config_WidgetAPI::getBooleanAttribute(const char* theAttributeName, bool theDefault) const { - std::string prop = getProperty(theAttributeName); - std::transform(prop.begin(), prop.end(), prop.begin(), ::tolower); - bool result = theDefault; - if (prop == "true" || prop == "1") { - result = true; - } else if (prop == "false" || prop == "0") { - result = false; - } - return result; + return ::getBooleanAttribute(myCurrentNode, theAttributeName, theDefault); } std::string Config_WidgetAPI::widgetId() const diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index 81c5d3725..66bd850a8 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -148,19 +148,6 @@ std::string Config_XMLReader::getNodeName(xmlNodePtr theNode) return result; } -/* - * Returns named property for a given node as std::string. - */ -std::string Config_XMLReader::getProperty(xmlNodePtr theNode, const char* theName) -{ - std::string result = ""; - char* aPropChars = (char*) xmlGetProp(theNode, BAD_CAST theName); - if (!aPropChars || aPropChars[0] == 0) - return result; - result = std::string(aPropChars); - return result; -} - void Config_XMLReader::processValidator(xmlNodePtr theNode) { Events_ID aValidatoEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED); diff --git a/src/Config/Config_XMLReader.h b/src/Config/Config_XMLReader.h index bd9392841..9ca7ca8e5 100644 --- a/src/Config/Config_XMLReader.h +++ b/src/Config/Config_XMLReader.h @@ -48,7 +48,6 @@ class Config_XMLReader xmlNodePtr node(void* theNode); std::string getNodeName(xmlNodePtr theNode); - std::string getProperty(xmlNodePtr theNode, const char* property); void processValidator(xmlNodePtr theNode); protected: diff --git a/src/Model/Model_Session.cpp b/src/Model/Model_Session.cpp index f78bfb76b..e3d811d0b 100644 --- a/src/Model/Model_Session.cpp +++ b/src/Model/Model_Session.cpp @@ -205,7 +205,7 @@ Model_Session::Model_Session() ModelAPI_Session::setSession(boost::shared_ptr(this)); // register the configuration reading listener Events_Loop* aLoop = Events_Loop::loop(); - static const Events_ID kFeatureEvent = Events_Loop::eventByName("FeatureRegisterEvent"); + static const Events_ID kFeatureEvent = Events_Loop::eventByName(Config_FeatureMessage::MODEL_EVENT()); aLoop->registerListener(this, kFeatureEvent); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED), 0, true); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED), 0, true); @@ -215,7 +215,7 @@ Model_Session::Model_Session() void Model_Session::processEvent(const boost::shared_ptr& theMessage) { - static const Events_ID kFeatureEvent = Events_Loop::eventByName("FeatureRegisterEvent"); + static const Events_ID kFeatureEvent = Events_Loop::eventByName(Config_FeatureMessage::MODEL_EVENT()); static const Events_ID kValidatorEvent = Events_Loop::eventByName(EVENT_VALIDATOR_LOADED); if (theMessage->eventID() == kFeatureEvent) { const boost::shared_ptr aMsg = @@ -252,7 +252,7 @@ void Model_Session::LoadPluginsInfo() return; // Read plugins information from XML files - Config_ModuleReader aXMLReader("FeatureRegisterEvent"); + Config_ModuleReader aXMLReader(Config_FeatureMessage::MODEL_EVENT()); aXMLReader.readAll(); } diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.cpp b/src/ModuleBase/ModuleBase_WidgetFactory.cpp index bd45e4ee0..cc66a69b8 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFactory.cpp @@ -123,25 +123,6 @@ QWidget* ModuleBase_WidgetFactory::labelControl(QWidget* theParent) return result; } -void ModuleBase_WidgetFactory::processAttributes() -{ - // register that this attribute in feature is not obligatory for the feature execution - // so, it is not needed for the standard validation mechanism - bool isObligatory = true; - bool isConcealment = false; - if( myWidgetApi ){ - isObligatory = myWidgetApi->getBooleanAttribute(ATTRIBUTE_OBLIGATORY, true); - isConcealment = myWidgetApi->getBooleanAttribute(ATTRIBUTE_CONCEALMENT, false); - } - boost::shared_ptr aSession = ModelAPI_Session::get(); - if (!isObligatory) { - aSession->validators()->registerNotObligatory(myParentId, myWidgetApi->widgetId()); - } - if(isConcealment) { - aSession->validators()->registerConcealment(myParentId, myWidgetApi->widgetId()); - } -} - QWidget* ModuleBase_WidgetFactory::createWidgetByType(const std::string& theType, QWidget* theParent) { @@ -194,10 +175,6 @@ QWidget* ModuleBase_WidgetFactory::createWidgetByType(const std::string& theType if (!result) {qDebug("ModuleBase_WidgetFactory::fillWidget: find bad widget type");} #endif } - if (result) { - processAttributes(); - } - return result; } diff --git a/src/ModuleBase/ModuleBase_WidgetFactory.h b/src/ModuleBase/ModuleBase_WidgetFactory.h index 43b8208b6..fd267d418 100644 --- a/src/ModuleBase/ModuleBase_WidgetFactory.h +++ b/src/ModuleBase/ModuleBase_WidgetFactory.h @@ -53,7 +53,6 @@ class MODULEBASE_EXPORT ModuleBase_WidgetFactory QString qs(const std::string& theStdString) const; - void processAttributes(); private: Config_WidgetAPI* myWidgetApi; diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 1d72cff78..cf38bd9e6 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -138,9 +138,7 @@ void XGUI_Workshop::startApplication() //Initialize event listening Events_Loop* aLoop = Events_Loop::loop(); aLoop->registerListener(this, Events_Error::errorID()); //!< Listening application errors. - //TODO(sbh): Implement static method to extract event id [SEID] - aLoop->registerListener(this, Events_Loop::eventByName(EVENT_FEATURE_LOADED)); - // TODO Is it good to use non standard event within workshop? + aLoop->registerListener(this, Events_Loop::eventByName(Config_FeatureMessage::GUI_EVENT())); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED)); @@ -257,7 +255,7 @@ void XGUI_Workshop::processEvent(const boost::shared_ptr& theMes } //A message to start feature creation received. - if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_FEATURE_LOADED)) { + if (theMessage->eventID() == Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) { boost::shared_ptr aFeatureMsg = boost::dynamic_pointer_cast(theMessage); if (!aFeatureMsg->isInternal()) { -- 2.39.2