]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#2206 Avoid the ability to cancel the current sketch when saving
authornds <nds@opencascade.com>
Mon, 9 Oct 2017 13:02:14 +0000 (16:02 +0300)
committernds <nds@opencascade.com>
Mon, 9 Oct 2017 13:02:43 +0000 (16:02 +0300)
src/SHAPERGUI/SHAPERGUI.cpp
src/SHAPERGUI/SHAPERGUI.h

index c4580759f3bdb8dc0877664fee3193d16872d261..42c1b509051cf3f21dd89169ac2eb9a8b1af11bc 100644 (file)
@@ -273,6 +273,17 @@ bool SHAPERGUI::activateModule(SUIT_Study* theStudy)
   // Postrrocessing for LoadScriptId to remove created(if it was created) SALOME Object Browser
   connect(getApp()->action(LightApp_Application::UserID+1), SIGNAL(triggered(bool)),
           this, SLOT(onScriptLoaded()));
+
+  disconnect(getApp()->action(LightApp_Application::FileSaveId), SIGNAL(triggered(bool)),
+             getApp(), SLOT(onSaveDoc()));
+  disconnect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
+             getApp(), SLOT(onSaveAsDoc()));
+
+  connect(getApp()->action(LightApp_Application::FileSaveId), SIGNAL(triggered(bool)),
+          this, SLOT(onSaveDocByShaper()));
+  connect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
+          this, SLOT(onSaveAsDocByShaper()));
+
   return isDone;
 }
 
@@ -321,6 +332,17 @@ bool SHAPERGUI::deactivateModule(SUIT_Study* theStudy)
   disconnect(getApp()->action(LightApp_Application::UserID+1), SIGNAL(triggered(bool)),
              this, SLOT(onScriptLoaded()));
 
+  disconnect(getApp()->action(LightApp_Application::FileSaveId), SIGNAL(triggered(bool)),
+             this, SLOT(onSaveDocByShaper()));
+  disconnect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
+             this, SLOT(onSaveAsDocByShaper()));
+
+  connect(getApp()->action(LightApp_Application::FileSaveId), SIGNAL(triggered(bool)),
+          getApp(), SLOT(onSaveDoc()));
+  connect(getApp()->action(LightApp_Application::FileSaveAsId), SIGNAL(triggered(bool)),
+          getApp(), SLOT(onSaveAsDoc()));
+
+
   return LightApp_Module::deactivateModule(theStudy);
 }
 
@@ -388,6 +410,24 @@ void SHAPERGUI::onScriptLoaded()
     delete aBrowser;
 }
 
+//******************************************************
+void SHAPERGUI::onSaveDocByShaper()
+{
+  if(!workshop()->operationMgr()->abortAllOperations(XGUI_OperationMgr::XGUI_InformationMessage))
+    return;
+
+  getApp()->onSaveDoc();
+}
+
+//******************************************************
+void SHAPERGUI::onSaveAsDocByShaper()
+{
+  if(!workshop()->operationMgr()->abortAllOperations(XGUI_OperationMgr::XGUI_InformationMessage))
+    return;
+
+  getApp()->onSaveAsDoc();
+}
+
 //******************************************************
 void SHAPERGUI::onUpdateCommandStatus()
 {
index 1d6e4808f5e5809648f98c020c824dbaa4910602..ffe975ca2813e5b5b0633bf423ae6ad28b958ee9 100644 (file)
@@ -182,6 +182,12 @@ Q_OBJECT
   /// Hide object browser if it was created during loading script
   void onScriptLoaded();
 
+  /// Save application functionality with additional processing of aborting the current operation
+  void onSaveDocByShaper();
+
+  /// Save application functionality with additional processing of aborting the current operation
+  void onSaveAsDocByShaper();
+
   /// Obtains the current application and updates its actions
   void onUpdateCommandStatus();