summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index ea8e8ca..a85cc19 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -17,6 +17,7 @@
** not clear to you.
**
**********************************************************************/
+// code added and Copyright (C) by L. J. Potter <ljp@llornkcor.com> 2002
#include "clock.h"
#include "setAlarm.h"
@@ -31,8 +32,6 @@
#include <qsound.h>
#include <qtimer.h>
-#include <opie/oclickablelabel.h>
-
#include <qlcdnumber.h>
#include <qslider.h>
#include <qlabel.h>
@@ -94,7 +93,7 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f )
date->setText( TimeString::longDateString( QDate::currentDate() ) );
QWidget *controls = new QWidget( this );
- QGridLayout *gl = new QGridLayout( controls, 3, 2, 6, 4 );
+ QGridLayout *gl = new QGridLayout( controls, 2, 2, 6, 4 );
QButtonGroup *grp = new QButtonGroup( controls );
grp->setRadioButtonExclusive( true );
@@ -133,11 +132,6 @@ Clock::Clock( QWidget * parent, const char * name, WFlags f )
gl->addWidget( alarmBtn, 1, 2 );
alarmBtn->setText( tr( "Set Alarm" ) );
- OClickableLabel *click = new OClickableLabel(controls, "label" );
- click->setText(tr("Set date and time." ) );
- gl->addMultiCellWidget( click, 3, 3, 0, 2, AlignHCenter);
- connect( click, SIGNAL(clicked() ), this, SLOT(slotAdjustTime() ) );
-
connect( set, SIGNAL( pressed() ), SLOT( slotSet() ) );
connect( reset, SIGNAL( clicked() ), SLOT( slotReset() ) );
@@ -361,7 +355,7 @@ void Clock::alarmOn()
AlarmServer::addAlarm( when,
"QPE/Application/clock",
"alarm(QDateTime,int)", warn );
- QMessageBox::message("Note","Alarm is set for:\n"+ whenl.toString());
+ setCaption("Alarm set: "+ whenl.toString());
}
void Clock::alarmOff()
@@ -372,7 +366,7 @@ void Clock::alarmOff()
"QPE/Application/clock",
"alarm(QDateTime,int)", warn );
qDebug("Alarm Off "+ when.toString());
-
+ setCaption("Clock");
}
void Clock::appMessage(const QCString& msg, const QByteArray& data)
@@ -389,12 +383,16 @@ void Clock::appMessage(const QCString& msg, const QByteArray& data)
void Clock::timerEvent( QTimerEvent *e )
{
static int stop = 0;
- if ( stop < 10 && bSound) {
+ if ( stop < 120 && bSound) {
Sound::soundAlarm();
stop++;
} else {
stop = 0;
killTimer( e->timerId() );
+ alarmOffBtn->setText( tr( "Alarm Is Off" ) );
+ alarmBool=FALSE;
+ snoozeBtn->hide();
+ setCaption("Clock: Alarm was missed.");
}
}
@@ -481,8 +479,3 @@ QPoint AnalogClock::rotate( QPoint c, QPoint p, int a )
( p.x() - c.x() ) * sin( angle );
return QPoint( nx, ny );
}
-void Clock::slotAdjustTime()
-{
- QCopEnvelope e("QPE/System", "execute(QString)");
- e << QString("systemtime");
-}