*/
HYDROGUI_ZLevelsOp::HYDROGUI_ZLevelsOp( HYDROGUI_Module* theModule )
: HYDROGUI_Operation( theModule ),
- myZLevelsDlg( NULL )
+ myDlg( NULL )
{
setName( tr( "SET_Z_LEVELS" ) );
}
}
// Show the dialog
- if ( !myZLevelsDlg ) {
- //TODO: delete dialog each time?
- myZLevelsDlg = new HYDROGUI_ZLevelsDlg( module()->getApp()->desktop(), module() );
- 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() ) );
}
- myZLevelsDlg->setObjects( anObject2VisibleList );
+ myDlg->setObjects( anObject2VisibleList );
- myZLevelsDlg->exec();
+ myDlg->exec();
}
/**
{
bool aRes = false;
- if ( myZLevelsDlg ) {
+ if ( myDlg ) {
Handle(HYDROData_Document) aDoc = doc();
if( !aDoc.IsNull() ) {
- HYDROGUI_ListModel::ObjectList anObjects = myZLevelsDlg->getObjects();
+ HYDROGUI_ListModel::ObjectList anObjects = myDlg->getObjects();
HYDROData_SequenceOfObjects anOrderedObjects;
foreach ( const Handle(HYDROData_Entity) anObject, anObjects ) {
anOrderedObjects.Append( anObject );
aDoc->SetObjectsLayerOrder( anOrderedObjects );
- theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced;
+ theUpdateFlags = UF_Model | UF_OCCViewer;
aRes = true;
}
}
return aRes;
}
+/**
+*/
+bool HYDROGUI_ZLevelsOp::isGranted() const
+{
+ return true;
+}
+
+/**
+*/
+void HYDROGUI_ZLevelsOp::processCancel()
+{
+ // Delete the dialog
+ if ( myDlg ) {
+ delete myDlg;
+ myDlg = 0;
+ }
+}
\ No newline at end of file
class HYDROGUI_ZLevelsDlg;
+
class HYDROGUI_ZLevelsOp : public HYDROGUI_Operation
{
Q_OBJECT
public:
-
HYDROGUI_ZLevelsOp( HYDROGUI_Module* theModule );
virtual ~HYDROGUI_ZLevelsOp();
public:
-
- virtual bool isGranted() const { return true; }
+ virtual bool isGranted() const;
protected:
-
virtual void startOperation();
-
virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg );
+ virtual void processCancel();
private:
- HYDROGUI_ZLevelsDlg* myZLevelsDlg;
+ HYDROGUI_ZLevelsDlg* myDlg;
};