#include <SUIT_MessageBox.h>
#include <SUIT_Desktop.h>
#include <QColor>
+#include <QApplication>
+
#include <OCCViewer_ViewManager.h>
#include <OCCViewer_ViewModel.h>
return aPanel;
}
+void HYDROGUI_StreamOp::apply()
+{
+ QApplication::setOverrideCursor( Qt::WaitCursor );
+
+ startDocOperation();
+
+ int anUpdateFlags = 0;
+ QString anErrorMsg;
+
+ bool aResult = false;
+ QStringList aBrowseObjectsEntries;
+
+ try
+ {
+ aResult = processApply( anUpdateFlags, anErrorMsg, aBrowseObjectsEntries );
+ }
+ catch ( Standard_Failure )
+ {
+ Handle(Standard_Failure) aFailure = Standard_Failure::Caught();
+ anErrorMsg = aFailure->GetMessageString();
+ aResult = false;
+ }
+ catch ( ... )
+ {
+ aResult = false;
+ }
+
+ QApplication::restoreOverrideCursor();
+
+ if ( aResult )
+ {
+ module()->update( anUpdateFlags );
+ commitDocOperation();
+ commit();
+ browseObjects( aBrowseObjectsEntries );
+ }
+ else
+ {
+ myEditedObject->Remove();
+ module()->setObjectRemoved( myEditedObject );
+
+ if ( isToAbortOnApply() )
+ abortDocOperation();
+
+ abort();
+ SUIT_MessageBox::critical( module()->getApp()->desktop(),
+ tr( "CREATE_STREAM_ERROR" ),
+ anErrorMsg );
+
+ }
+}
+
bool HYDROGUI_StreamOp::processApply( int& theUpdateFlags,
QString& theErrorMsg,
QStringList& theBrowseObjectsEntries )
<context>
<name>HYDROGUI_StreamOp</name>
<message>
+ <source>CREATE_STREAM_ERROR</source>
+ <translation>Stream creation error</translation>
+ </message>
+ <message>
<source>CREATE_STREAM</source>
<translation>Create stream</translation>
</message>