From: jfa Date: Fri, 15 Jun 2007 12:27:42 +0000 (+0000) Subject: NPAL15833: EDF406: Save icon is inactive then Supervisor graph is modified. X-Git-Tag: T15881~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8f026629d020c39184528e0a6ec404aaa14ec5a0;p=modules%2Fsuperv.git NPAL15833: EDF406: Save icon is inactive then Supervisor graph is modified. --- diff --git a/src/SUPERVGUI/SUPERVGUI.cxx b/src/SUPERVGUI/SUPERVGUI.cxx index 266c28b..137e304 100644 --- a/src/SUPERVGUI/SUPERVGUI.cxx +++ b/src/SUPERVGUI/SUPERVGUI.cxx @@ -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 <-- diff --git a/src/SUPERVGUI/SUPERVGUI_Main.cxx b/src/SUPERVGUI/SUPERVGUI_Main.cxx index e108f7d..c0dd3ea 100644 --- a/src/SUPERVGUI/SUPERVGUI_Main.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Main.cxx @@ -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( study->application() ) ) { + if ( LightApp_Application* app = dynamic_cast( 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( 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(); } } }