summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp24
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 )
199 199
200 Config cfg( "Clock" ); 200 Config cfg( "Clock" );
201 cfg.setGroup( "Mode" ); 201 cfg.setGroup( "Mode" );
202 int mode = cfg.readBoolEntry( "clockMode");setSwatchMode( mode); 202 int mode = cfg.readBoolEntry( "clockMode");
203 setSwatchMode( mode);
203 modeSelect( mode); 204 modeSelect( mode);
204} 205}
205 206
@@ -267,6 +268,11 @@ void Clock::clearClock( void )
267 268
268void Clock::startSWatch() 269void Clock::startSWatch()
269{ 270{
271 if(swatch_running) {
272 stopSWatch();
273 return;
274 }
275 qDebug("startSWatch()");
270 swatch_start.start(); 276 swatch_start.start();
271 set->setText( tr( "Stop" ) ); 277 set->setText( tr( "Stop" ) );
272 t->start( 1000 ); 278 t->start( 1000 );
@@ -277,6 +283,7 @@ void Clock::startSWatch()
277 283
278void Clock::stopSWatch() 284void Clock::stopSWatch()
279{ 285{
286 qDebug("stopSWatch()");
280 swatch_totalms += swatch_start.elapsed(); 287 swatch_totalms += swatch_start.elapsed();
281 set->setText( tr( "Start" ) ); 288 set->setText( tr( "Start" ) );
282 t->stop(); 289 t->stop();
@@ -313,7 +320,7 @@ void Clock::slotReset()
313void Clock::modeSelect( int m ) 320void Clock::modeSelect( int m )
314{ 321{
315 qDebug("Clock::modeSelect( %d) ", m); 322 qDebug("Clock::modeSelect( %d) ", m);
316 if ( m ) 323 if ( m != 0 )
317 { 324 {
318 lcd->setNumDigits( 8 + 1 + sw_prec ); 325 lcd->setNumDigits( 8 + 1 + sw_prec );
319 lcd->setMinimumWidth( lcd->sizeHint().width() ); 326 lcd->setMinimumWidth( lcd->sizeHint().width() );
@@ -321,10 +328,17 @@ void Clock::modeSelect( int m )
321 reset->setEnabled( TRUE ); 328 reset->setEnabled( TRUE );
322 ampmLabel->hide(); 329 ampmLabel->hide();
323 330
324 if ( !swatch_running ) 331// if(m == 2) {
325 t->stop(); 332 if ( !swatch_running ) {
333 t->start( 1000 );
326 } 334 }
327 else 335// else
336// {
337// stopSWatch();
338// }
339// }
340 }
341 else //clock mode
328 { 342 {
329 lcd->setNumDigits( 5 ); 343 lcd->setNumDigits( 5 );
330 lcd->setMinimumWidth( lcd->sizeHint().width() ); 344 lcd->setMinimumWidth( lcd->sizeHint().width() );