summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp46
1 files changed, 15 insertions, 31 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index d6e06c8..eff96eb 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -401,13 +401,12 @@ void SimpleAlarmDaemonImpl::fillTimerPopUp()
}
QString configString ;
configString += "#config file for kopi alarm timer\n";
configString += "#format: <Text for popup menu>;<timer countdown in minutes>\n";
- configString += "#NOTE: minimum value for timer are 3 minutes!\n";
- configString += "24 h; 1440\n";
- configString += " 8 h; 480\n";
- configString += " 5 h; 300\n";
- configString += " 1 h; 60\n";
+ configString += "24 hours; 1440\n";
+ configString += "8 hours; 480\n";
+ configString += "5 hours; 300\n";
+ configString += "1 hour; 60\n";
configString += "30 min; 30\n";
configString += "15 min; 15\n";
configString += "SEPARATOR\n";
configString += "Pizza; 22\n";
@@ -433,23 +432,23 @@ void SimpleAlarmDaemonImpl::fillTimerPopUp()
QStringList li = QStringList::split(";",line);
ok = false;
if ( li.count() == 2 ) {
int val = li[1].toInt( &ok );
- if ( ok && val > 2 ) {
- mTimerPopUp->insertItem( li[0], val);
+ if ( ok && val > 0 ) {
+ mTimerPopUp->insertItem( li[0], val+10);
}
}
}
}
}
file.close();
#if 0
- mTimerPopUp->insertItem( "24 h", 1440 );
+ mTimerPopUp->insertItem( "24 hours", 1440 );
// mTimerPopUp->insertItem( i18n("12 h"), 720 );
- mTimerPopUp->insertItem( " 8 h", 480 );
- mTimerPopUp->insertItem( " 5 h", 300 );
+ mTimerPopUp->insertItem( " 8 hours", 480 );
+ mTimerPopUp->insertItem( " 5 hours", 300 );
// mTimerPopUp->insertItem( i18n(" 2 h"), 120 );
- mTimerPopUp->insertItem( " 1 h", 60 );
+ mTimerPopUp->insertItem( " 1 hour", 60 );
mTimerPopUp->insertItem( "30 min", 30 );
mTimerPopUp->insertItem( "15 min", 15 );
mTimerPopUp->insertItem( "10 min", 10 );
//mTimerPopUp->insertItem( " 5 min", 5 );
@@ -504,9 +503,9 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
if ( !dia.exec() )
return;
- AlarmServer::deleteAlarm ( mRunningTimer,"koalarm" , timerMesssage.latin1() );
+ AlarmServer::deleteAlarm ( mRunningTimer,"koalarm" , timerMesssage.utf8() );
mTimerTime = 0;
return;
}
if ( mTimerTime )
@@ -515,21 +514,9 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
return;
}
QString mess = "timer_alarm";
mess += ("Timer Alarm!\n");
- if ( minutes == 22 ) {
- mess += ( "Pizza is ready");
- mRunningTimerText = "Pizza";
- }
- else if ( minutes == 45 ) {
- mess += ( "Please wake up!");
- mRunningTimerText = "Nap";
- }
- else if ( minutes == 5 ) {
- mess += ( "Tea is ready");
- mRunningTimerText = "Tea";
- }
- else if ( minutes == 3 ) {
+ if ( minutes == 3 ) {
mess += mCustomText;
minutes = mCustomMinutes ;
mRunningTimerText = mCustomText.stripWhiteSpace ();
int in = mRunningTimerText.find( " " );
@@ -609,14 +596,11 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
int in = mRunningTimerText.find( " " );
mRunningTimerText = mRunningTimerText.left ( in );
}
else {
- mess+= QString::number ( minutes ) + ( " minutes are past!");
- int min = minutes;
- if ( min % 60 == 0 )
- mRunningTimerText = QString::number ( min/60 ) + ( " hours");
- else
- mRunningTimerText = QString::number ( minutes ) + ( " minutes");
+ mess += mTimerPopUp->text( minutes );
+ mRunningTimerText = mTimerPopUp->text( minutes );
+ minutes -= 10;
}
}
//minutes = 1;