-rw-r--r-- | library/backend/rohfeedback.cpp | 28 | ||||
-rw-r--r-- | library/backend/rohfeedback.h | 3 |
2 files changed, 17 insertions, 14 deletions
diff --git a/library/backend/rohfeedback.cpp b/library/backend/rohfeedback.cpp index ff76a36..21aad34 100644 --- a/library/backend/rohfeedback.cpp +++ b/library/backend/rohfeedback.cpp @@ -1,7 +1,7 @@ -#include <rohfeedback.h> - +#ifdef OPIE_WITHROHFEEDBACK +#include <rohfeedback.h> #include <stdio.h> #include <qpeapplication.h> #include <qevent.h> #include <resource.h> @@ -34,14 +34,13 @@ RoHFeedback::RoHFeedback() : QString S; for( int i = 0; i < NOOFICONS ; i ++ ) { - Imgs[i] = new QPixmap( Resource::loadPixmap("RoH/star/"+ - QString::number(i+1) + - ".png" )); + Imgs[i] = new QPixmap( Resource::loadPixmap( + "RoH/star/"+ QString::number(i+1) + ".png" )); Masks[i] = new QBitmap(); - (*Masks[i]) = Resource::loadPixmap("RoH/star/"+QString::number(i+1) + - ".png" ); + (*Masks[i]) = Resource::loadPixmap( + "RoH/star/"+QString::number(i+1) + "-mask.png" ); } } IconWidth = Imgs[0]->size().width(); @@ -65,18 +64,16 @@ void RoHFeedback::init( const QPoint & P, QWidget* wid ) { if( ! IconWidth ) return; Receiver = wid; - IconNr = -1; + IconNr = FeedbackTimerStart; move( P.x()-IconWidth/2, P.y() - IconHeight/2 ); // to initialize - Timer.start( DELAY - SPEED/NOOFICONS ); + Timer.start( DELAY ); } void RoHFeedback::stop( void ) { - IconNr = -2; // stop - hide(); - Timer.stop(); + IconNr = FeedbackStopped; // stop } bool RoHFeedback::event( QEvent * E ) { @@ -99,15 +96,16 @@ bool RoHFeedback::event( QEvent * E ) { void RoHFeedback::iconShow( void ) { switch( IconNr ) { case FeedbackTimerStart: - IconNr = 0; + IconNr = FeedbackShow; Timer.start( SPEED/NOOFICONS ); break; case FeedbackStopped: // stopped IconNr = FeedbackTimerStart; hide(); + Timer.stop(); break; case FeedbackShow: // first show(); // FT @@ -121,5 +119,7 @@ void RoHFeedback::iconShow( void ) { } } } -}
\ No newline at end of file +} + +#endif diff --git a/library/backend/rohfeedback.h b/library/backend/rohfeedback.h index f38a095..9ffd35a 100644 --- a/library/backend/rohfeedback.h +++ b/library/backend/rohfeedback.h @@ -1,7 +1,9 @@ #ifndef ROHFEEDBACK_H #define ROHFEEDBACK_H +#ifdef OPIE_WITHROHFEEDBACK + /* RightOnHold feedback show @@ -59,4 +61,5 @@ protected : } } #endif +#endif |