]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/XGUI/XGUI_Workshop.cpp
Salome HOME
bos #29475 Option to create new part on study open
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index 67a525988a1da920e62436083d96ecc693507b71..624f6442233e1efdc94170689afdc72cac4ad8e9 100644 (file)
@@ -90,6 +90,7 @@
 #include <Events_Loop.h>
 #include <Events_InfoMessage.h>
 #include <Events_LongOp.h>
+#include <Events_MessageBool.h>
 
 #include <ExchangePlugin_ExportPart.h>
 #include <ExchangePlugin_ImportPart.h>
@@ -1161,6 +1162,12 @@ void XGUI_Workshop::onPreferences()
       } else if (aSection == ModuleBase_Preferences::MENU_SECTION) {
         myMainWindow->menuObject()->updateFromResources();
       }
+      else if (aSection == ModuleBase_Preferences::GENERAL_SECTION && aPref.second == "create_init_part") {
+        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();
+      }
     }
     std::vector<int> aColor;
     try {