if ( app && !app->stdApp().IsNull() )
{
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
TColStd_SequenceOfExtendedString formats;
app->stdApp()->Formats( formats );
if ( !formats.IsEmpty() )
bool status = false;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == CDF_RS_OK;
}
catch ( Standard_Failure ) {
bool status = false;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
if ( save )
status = app->Save( stdDoc() ) == CDF_SS_OK;
else
bool res = true;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
if ( myStdDoc->HasOpenCommand() )
myStdDoc->AbortCommand();
bool res = true;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
myStdDoc->AbortCommand();
update();
}
bool res = true;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
myStdDoc->CommitCommand();
if ( canUndo() )
return false;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
myStdDoc->Undo();
undoModified(); /* decrement modification counter */
}
return false;
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
myStdDoc->Redo();
doModified(); /* increment modification counter */
}
if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
{
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
aRetValue = UnitsAPI::AnyToSI( theValue, theUnits );
}
catch( Standard_Failure ) {
if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
{
try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
+#endif
aRetValue = UnitsAPI::AnyFromSI( theValue, theUnits );
}
catch( Standard_Failure ) {
*/
bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
{
-// // Disable GUI user actions while python command is executed
-// if (SUIT_Session::IsPythonExecuted()) {
-// // Disable mouse and keyboard events
-// QEvent::Type aType = e->type();
-// if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
-// aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
-// aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
-// aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
-// aType == QEvent::Accel || aType == QEvent::AccelOverride)
-// return false;
-// }
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
+ // Disable GUI user actions while python command is executed
+ if (SUIT_Session::IsPythonExecuted()) {
+ // Disable mouse and keyboard events
+ QEvent::Type aType = e->type();
+ if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
+ aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
+ aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
+ aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
+ aType == QEvent::Accel || aType == QEvent::AccelOverride)
+ return false;
+ }
+#endif
return myExceptHandler ? myExceptHandler->handle( receiver, e ) :
QApplication::notify( receiver, e );
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#include "SalomeApp_ExceptionHandler.h"
-//#include "CASCatch.hxx"
#include <OSD.hxx>
#include <qstring.h>
-#include <Standard_ErrorHandler.hxx>
-#include <Standard_Failure.hxx>
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+ #include <Standard_ErrorHandler.hxx>
+ #include <Standard_Failure.hxx>
+#else
+ #include "CASCatch.hxx"
+#endif
/*!Constructor. Initialize by \a floatSignal.*/
SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
/*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
{
-//CASCatch_TRY {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
try {
OCC_CATCH_SIGNALS;
+#else
+ CASCatch_TRY {
+#endif
SUIT_ExceptionHandler::internalHandle( o, e );
}
-//CASCatch_CATCH(Standard_Failure) {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
catch(Standard_Failure) {
+#else
+ CASCatch_CATCH(Standard_Failure) {
+#endif
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
throw Standard_Failure( aFail->GetMessageString() );
}
virtual bool notify( QObject* receiver, QEvent* e )
{
-// // Disable GUI user actions while python command is executed
-// if (SUIT_Session::IsPythonExecuted()) {
-// // Disable mouse and keyboard events
-// QEvent::Type aType = e->type();
-// if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
-// aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
-// aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
-// aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
-// aType == QEvent::Accel || aType == QEvent::AccelOverride)
-// return false;
-// }
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
+ // Disable GUI user actions while python command is executed
+ if (SUIT_Session::IsPythonExecuted()) {
+ // Disable mouse and keyboard events
+ QEvent::Type aType = e->type();
+ if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
+ aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
+ aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
+ aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
+ aType == QEvent::Accel || aType == QEvent::AccelOverride)
+ return false;
+ }
+#endif
return myHandler ? myHandler->handle( receiver, e ) :
QApplication::notify( receiver, e );