summaryrefslogtreecommitdiff
path: root/noncore
authorllornkcor <llornkcor>2003-03-26 13:18:35 (UTC)
committer llornkcor <llornkcor>2003-03-26 13:18:35 (UTC)
commit2b040bc1d3fafccfcb1d7773f005f038e1032277 (patch) (side-by-side diff)
tree4636b63e5e1562bc41ef47426d0ed38b27b68a3e /noncore
parenta651ef38fbd5a712261f8a40d0417e2ddb91b530 (diff)
downloadopie-2b040bc1d3fafccfcb1d7773f005f038e1032277.zip
opie-2b040bc1d3fafccfcb1d7773f005f038e1032277.tar.gz
opie-2b040bc1d3fafccfcb1d7773f005f038e1032277.tar.bz2
fix goofiness with s watch
Diffstat (limited to 'noncore') (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
@@ -190,25 +190,26 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f )
}
else
{
alarmOffBtn->setText( tr( "Alarm Is Off" ) );
alarmBool = FALSE;
snoozeBtn->hide();
}
QTimer::singleShot( 0, this, SLOT( updateClock() ) );
Config cfg( "Clock" );
cfg.setGroup( "Mode" );
- int mode = cfg.readBoolEntry( "clockMode");setSwatchMode( mode);
+ int mode = cfg.readBoolEntry( "clockMode");
+ setSwatchMode( mode);
modeSelect( mode);
}
Clock::~Clock()
{
toggleScreenSaver( true );
}
void Clock::updateClock()
{
if ( clockRB->isChecked() )
{
@@ -258,34 +259,40 @@ void Clock::changeClock( bool a )
ampm = a;
updateClock();
}
void Clock::clearClock( void )
{
lcd->display( QTime( 0, 0, 0 ).toString() );
aclock->display( QTime( 0, 0, 0 ) );
}
void Clock::startSWatch()
{
+ if(swatch_running) {
+ stopSWatch();
+ return;
+ }
+ qDebug("startSWatch()");
swatch_start.start();
set->setText( tr( "Stop" ) );
t->start( 1000 );
swatch_running = TRUE;
// disable screensaver while stop watch is running
toggleScreenSaver( FALSE );
}
void Clock::stopSWatch()
{
+ qDebug("stopSWatch()");
swatch_totalms += swatch_start.elapsed();
set->setText( tr( "Start" ) );
t->stop();
swatch_running = FALSE;
toggleScreenSaver( TRUE );
updateClock();
}
void Clock::slotSet()
{
if ( t->isActive() )
@@ -304,36 +311,43 @@ void Clock::slotReset()
swatch_start.start();
swatch_totalms = 0;
if ( swatch_running )
t->start( 1000 );
updateClock();
}
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() );
set->setEnabled( TRUE );
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() );
set->setEnabled( FALSE );
reset->setEnabled( FALSE );
t->start( 1000 );
}
Config config( "Clock" );
config.setGroup( "Mode" );
config.writeEntry( "clockMode", m );
updateClock();