summaryrefslogtreecommitdiff
path: root/noncore/tools/clock/clock.cpp
Side-by-side diff
Diffstat (limited to 'noncore/tools/clock/clock.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index 41c99a8..ecbf12f 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -388,116 +388,117 @@ void Clock::slotSnooze()
int warn = 0;
QTime t = QTime::currentTime();
QDateTime whenl( when.date(), t.addSecs( snoozeTime * 60 ) );
when = whenl;
AlarmServer::addAlarm( when,
"QPE/Application/clock",
"alarm(QDateTime,int)", warn );
}
//toggles alarm on/off
void Clock::slotToggleAlarm()
{
Config config( "qpe" );
config.setGroup( "Time" );
if ( alarmBool )
{
config.writeEntry( "clockAlarmSet", "FALSE" );
alarmOffBtn->setText( tr( "Alarm Is Off" ) );
snoozeBtn->hide();
alarmBool = FALSE;
alarmOff();
}
else
{
config.writeEntry( "clockAlarmSet", "TRUE" );
alarmOffBtn->setText( tr( "Alarm Is On" ) );
snoozeBtn->show();
alarmBool = TRUE;
alarmOn();
}
config.write();
}
void Clock::alarmOn()
{
QDate d = QDate::currentDate();
QTime tm( ( int ) hour, ( int ) minute, 0 );
qDebug( "Time set " + tm.toString() );
QTime t = QTime::currentTime();
if ( t > tm )
d = d.addDays( 1 );
int warn = 0;
QDateTime whenl( d, tm );
when = whenl;
AlarmServer::addAlarm( when,
"QPE/Application/clock",
"alarm(QDateTime,int)", warn );
- setCaption( "Alarm set: " + whenl.toString() );
+// setCaption( "Alarm set: " + whenl.toString() );
+ setCaption( tr("Alarm set: %1" ).arg(whenl.toString()) );
}
void Clock::alarmOff()
{
int warn = 0;
bSound = FALSE;
AlarmServer::deleteAlarm( when,
"QPE/Application/clock",
"alarm(QDateTime,int)", warn );
qDebug( "Alarm Off " + when.toString() );
- setCaption( "Clock" );
+ setCaption( tr("Clock") );
}
void Clock::clearTimer()
{
alarmOffBtn->setText( tr( "Alarm Is Off" ) );
alarmBool = FALSE;
snoozeBtn->hide();
- setCaption( "Clock" );
+ setCaption( tr("Clock") );
}
void Clock::appMessage( const QCString& msg, const QByteArray& /*data*/ )
{
int stopTimer = 0;
int timerStay = 5000;
bSound = TRUE;
qDebug( "Message received in clock" );
if ( msg == "alarm(QDateTime,int)" )
{
Config config( "qpe" );
config.setGroup( "Time" );
if ( config.readBoolEntry( "mp3Alarm", 0 ) )
{
clearTimer();
pthread_t thread;
pthread_create(&thread, NULL, (void * (*) (void *))startPlayer, NULL/* &*/);
}
else
{
Sound::soundAlarm();
stopTimer = startTimer( timerStay );
}
}
if ( msg == "timerStart()" )
{
slotStartTimer();
}
if ( msg == "timerStop()" )
{
slotStopTimer();
}
if ( msg == "timerReset()" )
{
slotResetTimer();
}
show();
raise();
QPEApplication::setKeepRunning();
setActiveWindow();
}
void Clock::timerEvent( QTimerEvent *e )
{