SUPERVGUI::SUPERVGUI()
: SalomeApp_Module( "SUPERV" ),
study(0),
- browser(0)
+ browser(0),
+ myFirstActivation(true),
+ myInitialViewFrame(0)
//info(0)
{
Trace("SUPERVGUI::SUPERVGUI")
connect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( setMain( SUIT_ViewWindow* ) ) );
+ if ( myFirstActivation )
+ // create new empty dataflow
+ createDataflow( New, true );
+
return true;
}
disconnect( application()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
this, SLOT( setMain( SUIT_ViewWindow* ) ) );
//---------------------------------------
+
+ myFirstActivation = false;
return SalomeApp_Module::deactivateModule( theStudy );
}
createDataflow( Modify );
}
-bool SUPERVGUI::createDataflow( const NEW_DF_MODE mode ) {
+bool SUPERVGUI::createDataflow( const NEW_DF_MODE mode, bool theInitialDF ) {
Trace("SUPERVGUI::createDataflow, mode = " << mode );
// asv : 27.01.05 : fix for PAL7823 : if the study is locked - warn the user and return.
return false;
}
- // 2. create a ViewFrame object
- SUPERVGraph_ViewFrame* aViewFrame = dynamic_cast<SUPERVGraph_ViewFrame*>( createGraph() );
+ SUPERVGraph_ViewFrame* aViewFrame;
+ if ( theInitialDF || !myInitialViewFrame ) {
+ // 2. create a ViewFrame object
+ aViewFrame = dynamic_cast<SUPERVGraph_ViewFrame*>( createGraph() );
+ }
+ else {
+ // 2. get empty initial view frame as new ViewFrame object
+ aViewFrame = myInitialViewFrame;
+ myInitialViewFrame = 0;
+ }
+
if ( aViewFrame ) {
// 3. bind Graph and ViewFrame == create SUPERVGUI_Main object
main = new SUPERVGUI_Main( aViewFrame, application()->desktop(), aGraph );
- if ( mode == New )
- main->addNode();
+ if ( mode == New ) {
+ if ( !theInitialDF )
+ main->addNode();
+ else
+ myInitialViewFrame = aViewFrame;
+ }
else
registerGraph( f, main );
aViewFrame->show();
// method called from importDataflow(), modifyDataflow(), newDataflow() with
// different modes. The behavior of the function is very similar in all 3 cases,
// but some differences still exist. These differences are implemented using NEW_DF_MODE param.
- bool createDataflow( const NEW_DF_MODE f );
+ bool createDataflow( const NEW_DF_MODE f, bool theInitialDF = false );
void createSupervAction( const int id, const QString& po_id, const QString& icon_id = QString(""),
const int key = 0, const bool toggle = false );
SUPERVGUI_Main* main; // active main
QPtrList<SUPERVGUI_Main> myGraphList;
QMap<QString, QString> myInterfaceNameMap;
+
+ bool myFirstActivation;
+ SUPERVGraph_ViewFrame* myInitialViewFrame;
};
#endif