From 486c750da1a00b24f0ca341026dc3042007f5d13 Mon Sep 17 00:00:00 2001 From: mkr Date: Thu, 23 Jun 2005 12:52:45 +0000 Subject: [PATCH] Fix for bug IPAL9209 : 3.0.0: (/dn06/../current1506) "Graph Supervisor" viewer isn't closed after document closing. --- src/SUPERVGUI/SUPERVGUI.cxx | 13 +++++++++++-- src/SUPERVGUI/SUPERVGUI.h | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/SUPERVGUI/SUPERVGUI.cxx b/src/SUPERVGUI/SUPERVGUI.cxx index 6ee1bda..a158d5f 100644 --- a/src/SUPERVGUI/SUPERVGUI.cxx +++ b/src/SUPERVGUI/SUPERVGUI.cxx @@ -75,6 +75,7 @@ SUPERVGUI::SUPERVGUI() study(0), browser(0), myFirstActivation(true), + myAllGraphsClosed(false), myInitialViewFrame(0) //info(0) { @@ -229,9 +230,11 @@ bool SUPERVGUI::activateModule( SUIT_Study* theStudy ) connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), this, SLOT( setMain( SUIT_ViewWindow* ) ) ); - if ( myFirstActivation ) + if ( myFirstActivation ) { + myAllGraphsClosed = false; // create new empty dataflow createDataflow( New, true ); + } return true; } @@ -252,7 +255,8 @@ bool SUPERVGUI::deactivateModule( SUIT_Study* theStudy ) this, SLOT( setMain( SUIT_ViewWindow* ) ) ); //--------------------------------------- - myFirstActivation = false; + if ( !myAllGraphsClosed ) + myFirstActivation = false; return SalomeApp_Module::deactivateModule( theStudy ); } @@ -269,6 +273,7 @@ SalomeApp_Selection* SUPERVGUI::createSelection() const SUIT_ViewWindow* SUPERVGUI::createGraph() { SUPERVGraph_ViewManager* aVM = new SUPERVGraph_ViewManager( study, application()->desktop(), new SUPERVGraph_Viewer() ); + (( SalomeApp_Application* )application())->addViewManager( aVM ); SUIT_ViewWindow* aVW = aVM->createViewWindow(); if ( aVW ) { connect( aVM, @@ -404,6 +409,10 @@ void SUPERVGUI::onGraphClosed(SUIT_ViewWindow* theViewWindow) { } } } + if ( myGraphList.isEmpty() ) { + myAllGraphsClosed = true; + myFirstActivation = true; + } } void SUPERVGUI::setMain( SUIT_ViewWindow* w) { diff --git a/src/SUPERVGUI/SUPERVGUI.h b/src/SUPERVGUI/SUPERVGUI.h index 578a734..12d6986 100644 --- a/src/SUPERVGUI/SUPERVGUI.h +++ b/src/SUPERVGUI/SUPERVGUI.h @@ -156,6 +156,7 @@ class SUPERVGUI: public SalomeApp_Module { QMap myInterfaceNameMap; bool myFirstActivation; + bool myAllGraphsClosed; SUPERVGraph_ViewFrame* myInitialViewFrame; }; -- 2.39.2