Added a method to disable waiting cursor in the preview operation

This commit is contained in:
rnc 2012-03-16 15:48:25 +00:00
parent 1757fe1487
commit 1468abed08
2 changed files with 11 additions and 4 deletions

View File

@ -89,7 +89,7 @@ GEOM::GEOM_Gen_ptr GEOMBase_Helper::getGeomEngine()
//================================================================
GEOMBase_Helper::GEOMBase_Helper( SUIT_Desktop* desktop )
: myDesktop( desktop ), myViewWindow( 0 ), myDisplayer( 0 ), myCommand( 0 ), isPreview( false ),
myIsApplyAndClose( false ), myIsOptimizedBrowsing( false )
myIsApplyAndClose( false ), myIsOptimizedBrowsing( false ), myIsWaitCursorEnabled( true )
{
}
@ -279,6 +279,10 @@ void GEOMBase_Helper::displayPreview( const bool display,
try {
SUIT_OverrideCursor wc;
ObjectList objects;
if ( !isWaitCursorEnabled() )
wc.suspend();
if ( !execute( objects ) || !getOperation()->IsDone() ) {
wc.suspend();
}
@ -766,7 +770,6 @@ bool GEOMBase_Helper::commitCommand( const char* )
bool GEOMBase_Helper::hasCommand() const
{
bool res = (bool) myCommand;
MESSAGE("hasCommand = "<<res)
return (bool)myCommand;
}

View File

@ -188,6 +188,9 @@ protected:
virtual void setIsOptimizedBrowsing( const bool theFlag );
virtual bool isOptimizedBrowsing() const;
virtual void setIsWaitCursorEnabled( const bool theFlag ) {myIsWaitCursorEnabled = theFlag;}
virtual bool isWaitCursorEnabled() const {return myIsWaitCursorEnabled ;}
private:
QString getEntry( GEOM::GEOM_Object_ptr ) const;
void clearShapeBuffer( GEOM::GEOM_Object_ptr );
@ -206,6 +209,7 @@ private:
SUIT_Desktop* myDesktop;
bool myIsApplyAndClose;
bool myIsOptimizedBrowsing;
bool myIsWaitCursorEnabled;
};