#include <VTKViewer_ViewModel.h>
#endif
-#ifndef DISABLE_SUPERVGRAPHVIEWER
- #include <SUPERVGraph_ViewModel.h>
- #include <SUPERVGraph_ViewFrame.h>
- #include <SUPERVGraph_ViewManager.h>
-#endif
+//#ifndef DISABLE_SUPERVGRAPHVIEWER
+// #include <SUPERVGraph_ViewModel.h>
+// #include <SUPERVGraph_ViewFrame.h>
+// #include <SUPERVGraph_ViewManager.h>
+//#endif
#include <QtxWorkstack.h>
LightApp_WidgetContainer* newWC = new LightApp_WidgetContainer( flag, desktop() );
connect( newWC, SIGNAL( destroyed ( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) );
+ // asv: connecting a slot for storing visibility flag of a window
+ connect( newWC, SIGNAL( visibilityChanged ( bool ) ), SLOT( onVisibilityChanged( bool ) ) );
myWindows.insert( flag, newWC );
if ( winMap.contains( flag ) )
desktop()->moveDockWindow( myWindows[flag], (Dock)winMap[flag] );
}
}
#endif
-#ifndef DISABLE_SUPERVGRAPHVIEWER
- if( vmType == SUPERVGraph_Viewer::Type() )
- {
- viewMgr = new SUPERVGraph_ViewManager( activeStudy(), desktop() );
- SUPERVGraph_Viewer* vm = new SUPERVGraph_Viewer();
- SUPERVGraph_ViewFrame* view = dynamic_cast<SUPERVGraph_ViewFrame*>( vm->getViewManager()->getActiveView() );
- if( view )
- view->setBackgroundColor( resMgr->colorValue( "SUPERVGraph", "Background", view->backgroundColor() ) );
- }
-#endif
+ //#ifndef DISABLE_SUPERVGRAPHVIEWER
+ // if( vmType == SUPERVGraph_Viewer::Type() )
+ // {
+ // viewMgr = new SUPERVGraph_ViewManager( activeStudy(), desktop(), new SUPERVGraph_Viewer() );
+ // }
+ //#endif
#ifndef DISABLE_OCCVIEWER
if( vmType == OCCViewer_Viewer::Type() )
{
// setWindowShown should be done even if no study is active (open). in this case all open windows
// will be hidden, which is neccessary in this case.
- for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
+ for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr ) {
+
+ if ( myWindowsVisible.contains( itr.key() ) &&
+ !myWindowsVisible[ itr.key() ] )
+ continue;
+
setWindowShown( itr.key(), !itr.data()->isEmpty() && winMap.contains( itr.key() ) );
+ }
}
/*!Update view managers.*/
updateDesktopTitle();
}
}
+
+/*! slot, called on show/hide of a dock window */
+void LightApp_Application::onVisibilityChanged( bool visible )
+{
+ const QObject* win = sender();
+
+ for ( WindowMap::ConstIterator itr = myWindows.begin(); itr != myWindows.end(); ++itr )
+ if ( itr.data() == win )
+ {
+ myWindowsVisible[ itr.key() ] = visible;
+ return;
+ }
+}
void onMRUActivated( QString );
void onPreferenceChanged( QString&, QString&, QString& );
void onRenameWindow();
+ void onVisibilityChanged( bool );
protected:
void updateWindows();
protected:
typedef QMap<QString, QAction*> ActionMap;
typedef QMap<int, LightApp_WidgetContainer*> WindowMap;
+ typedef QMap<int, bool> WindowVisibilityMap;
protected:
LightApp_Preferences* myPrefs;
LightApp_SelectionMgr* mySelMgr;
ActionMap myActions;
WindowMap myWindows;
+ WindowVisibilityMap myWindowsVisible;
SUIT_Accel* myAccel;