From c0b255e16d45fed73185fac431169284cc1431e8 Mon Sep 17 00:00:00 2001 From: zautrix Date: Sat, 08 Oct 2005 23:49:13 +0000 Subject: added mess for timer start --- diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 8ea8a73..04b8b21 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -148,13 +148,22 @@ SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) 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"; @@ -402,8 +411,8 @@ void SimpleAlarmDaemonImpl::fillTimerPopUp() configString += "#config file for kopi alarm timer\n"; configString += "#format: ;\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"; @@ -513,6 +522,7 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) return; } QString mess = "timer_alarm"; + QString disp; mess += ("Timer Alarm!\n"); if ( minutes == 3 ) { mess += mCustomText; @@ -520,6 +530,7 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) mRunningTimerText = mCustomText.stripWhiteSpace (); int in = mRunningTimerText.find( " " ); mRunningTimerText = mRunningTimerText.left ( in ); + disp = mCustomText; } else { if ( minutes == 2 ) { @@ -590,6 +601,7 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) if ( mCustomMinutes > 1440 ) mCustomMinutes = 1440; mess += mCustomText; + disp = mCustomText; minutes = mCustomMinutes; mRunningTimerText = mCustomText.stripWhiteSpace (); int in = mRunningTimerText.find( " " ); @@ -597,6 +609,7 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) } else { mess += mTimerPopUp->text( minutes ); + disp = mTimerPopUp->text( minutes ); mRunningTimerText = mTimerPopUp->text( minutes ); minutes -= 10; } @@ -606,6 +619,14 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) 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; } diff --git a/kalarmd/simplealarmdaemonimpl.h b/kalarmd/simplealarmdaemonimpl.h index cbdba47..9b7de94 100644 --- a/kalarmd/simplealarmdaemonimpl.h +++ b/kalarmd/simplealarmdaemonimpl.h @@ -68,6 +68,7 @@ class SimpleAlarmDaemonImpl : public QLabel private: AlarmDialog *mAlarmDialog; + QLabel * mTimerStartLabel; int mPlayBeeps; int mPausePlay; int mSuspend; -- cgit v0.9.0.2