- myZLevelsDlg = new HYDROGUI_ZLevelsDlg( module()->getApp()->desktop() );
- myZLevelsDlg->setModal( true );
- myZLevelsDlg->setObjects( anObject2VisibleList );
-
- //TODO: check
- connect( myZLevelsDlg, SIGNAL( applyOrder() ), this, SLOT( onApply() ) );
- connect( myZLevelsDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
+ if ( !myDlg ) {
+ myDlg = new HYDROGUI_ZLevelsDlg( module()->getApp()->desktop(), module() );
+ connect( myDlg, SIGNAL( applyOrder() ), this, SLOT( onApply() ) );
+ connect( myDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
+ }
+ myDlg->setObjects( anObject2VisibleList );