]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
NPAL15833: EDF406: Save icon is inactive then Supervisor graph is modified.
authorjfa <jfa@opencascade.com>
Fri, 15 Jun 2007 12:27:42 +0000 (12:27 +0000)
committerjfa <jfa@opencascade.com>
Fri, 15 Jun 2007 12:27:42 +0000 (12:27 +0000)
src/SUPERVGUI/SUPERVGUI.cxx
src/SUPERVGUI/SUPERVGUI_Main.cxx

index 266c28bbf4d1c2f193f17dba27a1a597ad2f7408..137e3041f0a6deebaf57d430931a317827fbb23c 100644 (file)
@@ -573,8 +573,12 @@ void SUPERVGUI::renameDataflow() {
                 if ( !SUPERV_isNull(aStreamDataFlow) )
                   aStreamDataFlow->SetName( nm.latin1() );
               }
-              else
+              else {
                 aDataFlow->SetName( nm.latin1() );
+              }
+
+              // update "Save" icon and menu state, if dataflow is published
+              SUPERVGUI_Main::setModifiedFlag();  
             }
           }
          // mkr : PAL7037 <--
index e108f7d3a588cfc87f81c9bd3b587661805d7153..c0dd3ea434f4a7108a5fcac8b5992b326cd95bcd 100644 (file)
@@ -350,6 +350,11 @@ void SUPERVGUI_Main::sync() {
   //if ( aSupMod ) aSupMod->updateObjBrowser();
   //else MESSAGE("NULL Supervision module!");
 
+  // update "Save" icon and menu state, if dataflow is published
+  _PTR(Study) aStudy = ((SalomeApp_Study*)study)->studyDS();
+  _PTR(SObject)  aSO = aStudy->FindObjectIOR(dataflow->getIOR());
+  if (aSO) SUPERVGUI_Main::setModifiedFlag();  
+
   if (myCurrentView == CANVASTABLE) {
     myArray->sync();
     myArray->update();
@@ -597,7 +602,7 @@ void SUPERVGUI_Main::onShowToolbar()
 void SUPERVGUI_Main::onObjectCreatedDeleted()
 {
   if ( study ) {
-    if ( STD_Application* app = dynamic_cast<STD_Application*>( study->application() ) ) {
+    if ( LightApp_Application* app = dynamic_cast<LightApp_Application*>( study->application() ) ) {
       ViewManagerList aVMList;
       app->viewManagers( SUPERVGraph_Viewer::Type(), aVMList );
       SUIT_ViewManager* aVM;
@@ -608,16 +613,20 @@ void SUPERVGUI_Main::onObjectCreatedDeleted()
          QObjectList* aMainList = aVW->queryList("SUPERVGUI_Main");
          if ( aMainList->count() == 1 ) {
            SUPERVGUI_Main* aMain = dynamic_cast<SUPERVGUI_Main*>( aMainList->first() );
-           if ( aMain )
-             if ( !CORBA::is_nil( aMain->getDataflow() )
-                  &&
-                  !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR()) // equal dataflows
-                  && 
-                  aMain != this ) // not equal mains
+           if ( aMain ) {
+             if (aMain != this &&
+                  !CORBA::is_nil(aMain->getDataflow()) &&
+                  !QString(aMain->getDataflow()->getIOR()).compare(getDataflow()->getIOR())) // equal dataflows
                aMain->getCanvas()->merge();
+            }
          }
        }
       }
+
+      // update "Save" icon and menu state, if dataflow is published
+      //_PTR(Study) aStudy = ((SalomeApp_Study*)study)->studyDS();
+      //_PTR(SObject)  aSO = aStudy->FindObjectIOR(dataflow->getIOR());
+      //if (aSO) SUPERVGUI_Main::setModifiedFlag();  
     }
   }
 }
@@ -649,7 +658,7 @@ void SUPERVGUI_Main::onPutInStudy( QString* theNodePortName )
          }
        }
       }
-      SUPERVGUI_Main::setModifiedFlag();  
+      //SUPERVGUI_Main::setModifiedFlag();
     }
   }
 }