Salome HOME
bos #29475 Option to create new part on study open
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index 669abec834207e6fb35e40e86d5c4b788e3a2ff2..8528d7687c194bef7acefa30a8199dfedcd7d4c1 100644 (file)
 #include <SketcherPrs_Tools.h>
 
 #include <Events_Loop.h>
+#include <Events_MessageBool.h>
 #include <Config_PropManager.h>
 #include <Config_Keywords.h>
 
@@ -286,6 +287,13 @@ PartSet_Module::~PartSet_Module()
 void PartSet_Module::createFeatures()
 {
   ModuleBase_IModule::createFeatures();
+
+  // send signal to initialization plugin about the state of the preferences: to create part or not
+  bool aCreate = ModuleBase_Preferences::resourceMgr()->booleanValue(
+    ModuleBase_Preferences::GENERAL_SECTION, "create_init_part", true);
+  Events_MessageBool aCreateMsg(Events_Loop::eventByName(EVENT_CREATE_PART_ON_START), aCreate);
+  aCreateMsg.send();
+
   myRoot = new PartSet_RootNode();
   myRoot->setWorkshop(workshop());
   ModuleBase_IModule::loadProprietaryPlugins();