+ browseObjects( aBrowseObjectsEntries, myIsApplyAndClose );
+
+ if ( !myIsApplyAndClose && inputPanel() )
+ start();
+ }
+ else if( !anErrorMsg.isEmpty() )
+ {
+ // Abort document opeartion only if requested
+ if ( isToAbortOnApply() )
+ abortDocOperation();
+
+ printErrorMessage( anErrorMsg );
+
+ // If the operation has no input panel - do abort
+ if ( !inputPanel() ) {
+ abort();
+ }
+ }
+}
+
+void HYDROGUI_Operation::startOperation()
+{
+ LightApp_Operation::startOperation();
+ myModule->getActiveOperations().push( this );
+
+ if( myIsApplyAndClose && inputPanel() )
+ {
+ myModule->getApp()->desktop()->addDockWidget( Qt::RightDockWidgetArea, inputPanel() );
+ inputPanel()->show();
+ }
+}
+
+void HYDROGUI_Operation::abortOperation()
+{
+ LightApp_Operation::abortOperation();
+ closeInputPanel();
+}
+
+void HYDROGUI_Operation::commitOperation()
+{
+ LightApp_Operation::commitOperation();
+ if ( myIsApplyAndClose )
+ closeInputPanel();
+}
+
+void HYDROGUI_Operation::stopOperation()
+{
+ LightApp_Operation::stopOperation();
+
+ // pop the operation from the cached map of active operations
+ QStack<HYDROGUI_Operation*>& anOperations = myModule->getActiveOperations();
+ if ( !anOperations.empty() ) {
+ if ( anOperations.top() == this )
+ anOperations.pop();
+ else
+ {
+ // find in the stack the current operation and remove it from the stack
+ QVectorIterator<HYDROGUI_Operation*> aVIt( anOperations );
+ aVIt.toBack();
+ aVIt.previous(); // skip the top show/hide operation
+ while ( aVIt.hasPrevious() )
+ {
+ HYDROGUI_Operation* anOp = aVIt.previous();
+ if ( anOp == this )
+ anOperations.remove( anOperations.lastIndexOf( anOp ) );
+ }
+ }
+ }
+ // release the preview manager with removing the added preview Z layer
+ setPreviewManager( 0 );
+}
+
+void HYDROGUI_Operation::setDialogActive( const bool active )
+{
+ LightApp_Operation::setDialogActive( active );
+ if( myPanel )
+ {
+ if( active )
+ {
+ myPanel->show();
+ }