-rw-r--r-- | noncore/tools/clock/clock.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp index 0eb2b83..74b7147 100644 --- a/noncore/tools/clock/clock.cpp +++ b/noncore/tools/clock/clock.cpp @@ -199,7 +199,8 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f ) Config cfg( "Clock" ); cfg.setGroup( "Mode" ); - int mode = cfg.readBoolEntry( "clockMode");setSwatchMode( mode); + int mode = cfg.readBoolEntry( "clockMode"); + setSwatchMode( mode); modeSelect( mode); } @@ -267,6 +268,11 @@ void Clock::clearClock( void ) void Clock::startSWatch() { + if(swatch_running) { + stopSWatch(); + return; + } + qDebug("startSWatch()"); swatch_start.start(); set->setText( tr( "Stop" ) ); t->start( 1000 ); @@ -277,6 +283,7 @@ void Clock::startSWatch() void Clock::stopSWatch() { + qDebug("stopSWatch()"); swatch_totalms += swatch_start.elapsed(); set->setText( tr( "Start" ) ); t->stop(); @@ -313,7 +320,7 @@ void Clock::slotReset() void Clock::modeSelect( int m ) { qDebug("Clock::modeSelect( %d) ", m); - if ( m ) + if ( m != 0 ) { lcd->setNumDigits( 8 + 1 + sw_prec ); lcd->setMinimumWidth( lcd->sizeHint().width() ); @@ -321,10 +328,17 @@ void Clock::modeSelect( int m ) reset->setEnabled( TRUE ); ampmLabel->hide(); - if ( !swatch_running ) - t->stop(); +// if(m == 2) { + if ( !swatch_running ) { + t->start( 1000 ); } - else +// else +// { +// stopSWatch(); +// } +// } + } + else //clock mode { lcd->setNumDigits( 5 ); lcd->setMinimumWidth( lcd->sizeHint().width() ); |