From: apo Date: Thu, 25 Sep 2008 09:47:45 +0000 (+0000) Subject: Fix for Bug VISU200820407 X-Git-Tag: TG_VISU_2008_Development_Finished~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=27f6b7e10aec0321c9f8c593acb31a3591814ec8;p=modules%2Fvisu.git Fix for Bug VISU200820407 Function ?Sweep? is activated for any presentation only after pushing/unpushing of button ?Cycled? --- diff --git a/src/VISUGUI/VisuGUI_Sweep.cxx b/src/VISUGUI/VisuGUI_Sweep.cxx index db1c841c..f447bb5a 100644 --- a/src/VISUGUI/VisuGUI_Sweep.cxx +++ b/src/VISUGUI/VisuGUI_Sweep.cxx @@ -144,8 +144,8 @@ VisuGUI_Sweep::VisuGUI_Sweep( VisuGUI* theModule, QToolButton* aStopButton = new QToolButton( aNavigationTab ); aStopButton->setIcon( aResourceMgr->loadPixmap( "VISU", tr( "ICON_SWEEP_STOP" ) ) ); aStopButton->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); - aStopButton->setCheckable( true ); - connect( aStopButton, SIGNAL( toggled( bool ) ), SLOT( onStop( bool ) ) ); + aStopButton->setCheckable( false ); + connect( aStopButton, SIGNAL( clicked( ) ), SLOT( onStop( ) ) ); aHBoxLayout->addWidget( aStopButton ); myIsCycled = new QCheckBox( aNavigationTab ); @@ -278,7 +278,7 @@ void VisuGUI_Sweep::onModuleDeactivated() { setHidden( true ); - onStop( true ); + onEnable( true ); } @@ -304,7 +304,7 @@ namespace ~TEnabler() { - myWidget->onStop( !myIsValidSelection ); + myWidget->onEnable( !myIsValidSelection ); } }; } @@ -358,8 +358,6 @@ void VisuGUI_Sweep::onValueChanged( int value ) { bool anIsValidSelection = ( myScalarMap && myActor.GetPointer() ); - TEnabler anEnabler( this, anIsValidSelection ); - if ( !anIsValidSelection ) return; @@ -468,7 +466,6 @@ void VisuGUI_Sweep::onLast() //---------------------------------------------------------------------------- void VisuGUI_Sweep::onPlay( bool on ) { - SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr(); if ( on ) { myPlayButton->setIcon( myPausePixmap ); myTimer->start( int( myStepDelay->value() * 1000 ) ); @@ -491,12 +488,20 @@ void VisuGUI_Sweep::onToggleView( bool on ) //---------------------------------------------------------------------------- -void VisuGUI_Sweep::onStop( bool on ) +void VisuGUI_Sweep::onStop() { - if ( on ) { - onPlay( false ); - mySweepSlider->setValue( mySweepSlider->maximum() ); - } + onPlay( false ); + mySweepSlider->setValue( mySweepSlider->maximum() ); + + if ( myViewWindow ) + myViewWindow->Repaint(); +} + + +//---------------------------------------------------------------------------- +void VisuGUI_Sweep::onEnable( bool on ) +{ + onStop(); mySweepSlider->setEnabled( !on ); @@ -507,9 +512,6 @@ void VisuGUI_Sweep::onStop( bool on ) myNextButton->setEnabled( !on ); myLastButton->setEnabled( !on ); - - if ( on && myViewWindow ) - myViewWindow->Repaint(); } diff --git a/src/VISUGUI/VisuGUI_Sweep.h b/src/VISUGUI/VisuGUI_Sweep.h index 8062d269..23fa3402 100644 --- a/src/VISUGUI/VisuGUI_Sweep.h +++ b/src/VISUGUI/VisuGUI_Sweep.h @@ -86,7 +86,9 @@ public slots: virtual void onLast(); - virtual void onStop( bool ); + virtual void onStop(); + + virtual void onEnable( bool ); virtual void onValueChanged( int );