summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-10-08 23:49:13 (UTC)
committer zautrix <zautrix>2005-10-08 23:49:13 (UTC)
commitc0b255e16d45fed73185fac431169284cc1431e8 (patch) (side-by-side diff)
tree365e84041692e131a5c5518acdd6d786af3dc09c
parent4fb9beb1ec26f37a18f98af9d3b6b59acf8c56d2 (diff)
downloadkdepimpi-c0b255e16d45fed73185fac431169284cc1431e8.zip
kdepimpi-c0b255e16d45fed73185fac431169284cc1431e8.tar.gz
kdepimpi-c0b255e16d45fed73185fac431169284cc1431e8.tar.bz2
added mess for timer start
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp23
-rw-r--r--kalarmd/simplealarmdaemonimpl.h1
2 files changed, 23 insertions, 1 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index 8ea8a73..04b8b21 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -145,19 +145,28 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent )
}
else {
wavAlarm = true;
mSoundPopUp->setItemChecked ( 1, true );
}
saveSlot( 1 );
+ mTimerStartLabel = new QLabel( 0 );
+ mTimerStartLabel->setCaption( "Timer started!");
+ fon = mTimerPopUp->font();
+ fon.setBold( true );
+ points = (fon.pointSize()*2);
+ fon.setPointSize( points );
+ mTimerStartLabel->setFont( fon );
}
SimpleAlarmDaemonImpl::~SimpleAlarmDaemonImpl()
{
//delete mPopUp;
delete mAlarmDialog;
+ delete mTimerStartLabel;
}
+
void SimpleAlarmDaemonImpl::saveSlot( int load )
{
QString fileName = QDir::homeDirPath() +"/.kopialarmrc";
//qDebug("save %d ", load );
QFile file( fileName );
if ( load ) {
@@ -399,14 +408,14 @@ void SimpleAlarmDaemonImpl::fillTimerPopUp()
return;
}
QString configString ;
configString += "#config file for kopi alarm timer\n";
configString += "#format: <Text for popup menu>;<timer countdown in minutes>\n";
configString += "24 hours; 1440\n";
+ configString += "9 hours; 540\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";
configString += "Nap; 45\n";
@@ -510,19 +519,21 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
if ( mTimerTime )
return;
if ( minutes == 1 ) {
return;
}
QString mess = "timer_alarm";
+ QString disp;
mess += ("Timer Alarm!\n");
if ( minutes == 3 ) {
mess += mCustomText;
minutes = mCustomMinutes ;
mRunningTimerText = mCustomText.stripWhiteSpace ();
int in = mRunningTimerText.find( " " );
mRunningTimerText = mRunningTimerText.left ( in );
+ disp = mCustomText;
}
else {
if ( minutes == 2 ) {
// ask time
QDialog dia ( 0, ("Customize Timer" ), true );
QLabel lab (("Message Text:"), &dia );
@@ -587,28 +598,38 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
mCustomMinutes = spinh.value()*60+spinm.value();
if ( mCustomMinutes == 0 )
mCustomMinutes = 1;
if ( mCustomMinutes > 1440 )
mCustomMinutes = 1440;
mess += mCustomText;
+ disp = mCustomText;
minutes = mCustomMinutes;
mRunningTimerText = mCustomText.stripWhiteSpace ();
int in = mRunningTimerText.find( " " );
mRunningTimerText = mRunningTimerText.left ( in );
}
else {
mess += mTimerPopUp->text( minutes );
+ disp = mTimerPopUp->text( minutes );
mRunningTimerText = mTimerPopUp->text( minutes );
minutes -= 10;
}
}
//minutes = 1;
mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 );
timerMesssage = mess;
AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8());
+ mTimerStartLabel->setText( disp );
+ int w = 200;
+ int h = mTimerStartLabel->sizeHint().height() ;
+ int dw = QApplication::desktop()->width();
+ int dh = QApplication::desktop()->height();
+ mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
+ mTimerStartLabel->show();
+ QTimer::singleShot( 3000, mTimerStartLabel, SLOT ( hide() ) );
mTimerTime = 1;
}
void SimpleAlarmDaemonImpl::writeFile()
{
QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
diff --git a/kalarmd/simplealarmdaemonimpl.h b/kalarmd/simplealarmdaemonimpl.h
index cbdba47..9b7de94 100644
--- a/kalarmd/simplealarmdaemonimpl.h
+++ b/kalarmd/simplealarmdaemonimpl.h
@@ -65,12 +65,13 @@ class SimpleAlarmDaemonImpl : public QLabel
protected:
void mousePressEvent( QMouseEvent * );
private:
AlarmDialog *mAlarmDialog;
+ QLabel * mTimerStartLabel;
int mPlayBeeps;
int mPausePlay;
int mSuspend;
QString mAlarmMessage;
int mTimerTime;
int getFileNameLen( QString );