summaryrefslogtreecommitdiffabout
path: root/kalarmd/simplealarmdaemonimpl.cpp
Unidiff
Diffstat (limited to 'kalarmd/simplealarmdaemonimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kalarmd/simplealarmdaemonimpl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp
index 37e7d0d..d6e06c8 100644
--- a/kalarmd/simplealarmdaemonimpl.cpp
+++ b/kalarmd/simplealarmdaemonimpl.cpp
@@ -249,49 +249,49 @@ void SimpleAlarmDaemonImpl::confSound( int num )
249 if ( num == 0 ) { 249 if ( num == 0 ) {
250 wavAlarm = false; 250 wavAlarm = false;
251 mSoundPopUp->setItemChecked ( 0, true ); 251 mSoundPopUp->setItemChecked ( 0, true );
252 mSoundPopUp->setItemChecked ( 1, false ); 252 mSoundPopUp->setItemChecked ( 1, false );
253 } else { 253 } else {
254 wavAlarm = true; 254 wavAlarm = true;
255 mSoundPopUp->setItemChecked ( 0, false ); 255 mSoundPopUp->setItemChecked ( 0, false );
256 mSoundPopUp->setItemChecked ( 1, true ); 256 mSoundPopUp->setItemChecked ( 1, true );
257 } 257 }
258} 258}
259void SimpleAlarmDaemonImpl::slotPlayBeep( int num ) 259void SimpleAlarmDaemonImpl::slotPlayBeep( int num )
260{ 260{
261 if ( num == 1000 ) { 261 if ( num == 1000 ) {
262 simulate(); 262 simulate();
263 return; 263 return;
264 } 264 }
265 mBeepPopUp->setItemChecked ( mPlayBeeps,false ); 265 mBeepPopUp->setItemChecked ( mPlayBeeps,false );
266 mPlayBeeps = num; 266 mPlayBeeps = num;
267 mBeepPopUp->setItemChecked ( mPlayBeeps, true ); 267 mBeepPopUp->setItemChecked ( mPlayBeeps, true );
268} 268}
269 269
270void SimpleAlarmDaemonImpl::recieve( const QCString& msg, const QByteArray& ) 270void SimpleAlarmDaemonImpl::recieve( const QCString& msg, const QByteArray& )
271{ 271{
272 //qDebug("SimpleAlarmDaemonImpl::ALARM RECEIVED! %s", msg.data()); 272 //qDebug("SimpleAlarmDaemonImpl::ALARM RECEIVED! %s", msg.data());
273 QString mess = msg; 273 QString mess = QString::fromUtf8(msg.data());
274 mAlarmMessage = mess.mid( 9 ); 274 mAlarmMessage = mess.mid( 9 );
275 QString filename = getenv("QPEDIR") ; 275 QString filename = getenv("QPEDIR") ;
276 filename += "/pics/kdepim/korganizer/koalarm.wav"; 276 filename += "/pics/kdepim/korganizer/koalarm.wav";
277 QString tempfilename; 277 QString tempfilename;
278 if ( mess.left( 13 ) == "suspend_alarm") { 278 if ( mess.left( 13 ) == "suspend_alarm") {
279 bool error = false; 279 bool error = false;
280 int len = mess.mid( 13 ).find("+++"); 280 int len = mess.mid( 13 ).find("+++");
281 if ( len < 2 ) 281 if ( len < 2 )
282 error = true; 282 error = true;
283 else { 283 else {
284 tempfilename = mess.mid( 13, len ); 284 tempfilename = mess.mid( 13, len );
285 if ( !QFile::exists( tempfilename ) ) 285 if ( !QFile::exists( tempfilename ) )
286 error = true; 286 error = true;
287 } 287 }
288 if ( ! error ) { 288 if ( ! error ) {
289 filename = tempfilename; 289 filename = tempfilename;
290 } 290 }
291 mAlarmMessage = mess.mid( 13+len+3 ); 291 mAlarmMessage = mess.mid( 13+len+3 );
292 //qDebug("suspend file %s ",tempfilename.latin1() ); 292 //qDebug("suspend file %s ",tempfilename.latin1() );
293 startAlarm( mAlarmMessage, filename); 293 startAlarm( mAlarmMessage, filename);
294 return; 294 return;
295 } 295 }
296 if ( mess.left( 11 ) == "timer_alarm") { 296 if ( mess.left( 11 ) == "timer_alarm") {
297 mTimerTime = 0; 297 mTimerTime = 0;
@@ -601,49 +601,49 @@ void SimpleAlarmDaemonImpl::confTimer( int time )
601 mCustomMinutes = spinh.value()*60+spinm.value(); 601 mCustomMinutes = spinh.value()*60+spinm.value();
602 if ( mCustomMinutes == 0 ) 602 if ( mCustomMinutes == 0 )
603 mCustomMinutes = 1; 603 mCustomMinutes = 1;
604 if ( mCustomMinutes > 1440 ) 604 if ( mCustomMinutes > 1440 )
605 mCustomMinutes = 1440; 605 mCustomMinutes = 1440;
606 mess += mCustomText; 606 mess += mCustomText;
607 minutes = mCustomMinutes; 607 minutes = mCustomMinutes;
608 mRunningTimerText = mCustomText.stripWhiteSpace (); 608 mRunningTimerText = mCustomText.stripWhiteSpace ();
609 int in = mRunningTimerText.find( " " ); 609 int in = mRunningTimerText.find( " " );
610 mRunningTimerText = mRunningTimerText.left ( in ); 610 mRunningTimerText = mRunningTimerText.left ( in );
611 } 611 }
612 else { 612 else {
613 mess+= QString::number ( minutes ) + ( " minutes are past!"); 613 mess+= QString::number ( minutes ) + ( " minutes are past!");
614 int min = minutes; 614 int min = minutes;
615 if ( min % 60 == 0 ) 615 if ( min % 60 == 0 )
616 mRunningTimerText = QString::number ( min/60 ) + ( " hours"); 616 mRunningTimerText = QString::number ( min/60 ) + ( " hours");
617 else 617 else
618 mRunningTimerText = QString::number ( minutes ) + ( " minutes"); 618 mRunningTimerText = QString::number ( minutes ) + ( " minutes");
619 } 619 }
620 } 620 }
621 //minutes = 1; 621 //minutes = 1;
622 622
623 mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); 623 mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 );
624 timerMesssage = mess; 624 timerMesssage = mess;
625 AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.latin1()); 625 AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8());
626 mTimerTime = 1; 626 mTimerTime = 1;
627} 627}
628 628
629void SimpleAlarmDaemonImpl::writeFile() 629void SimpleAlarmDaemonImpl::writeFile()
630{ 630{
631 QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 631 QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
632 //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); 632 //QCopEnvelope e("QPE/Application/kopi", "-writeFile");
633} 633}
634void SimpleAlarmDaemonImpl::showWN() 634void SimpleAlarmDaemonImpl::showWN()
635{ 635{
636 QCopEnvelope e("QPE/Application/kopi", "-showWN"); 636 QCopEnvelope e("QPE/Application/kopi", "-showWN");
637} 637}
638void SimpleAlarmDaemonImpl::newTodo() 638void SimpleAlarmDaemonImpl::newTodo()
639{ 639{
640 QCopEnvelope e("QPE/Application/kopi", "-newTodo"); 640 QCopEnvelope e("QPE/Application/kopi", "-newTodo");
641} 641}
642 642
643void SimpleAlarmDaemonImpl::newEvent() 643void SimpleAlarmDaemonImpl::newEvent()
644{ 644{
645 QCopEnvelope e("QPE/Application/kopi", "-newEvent"); 645 QCopEnvelope e("QPE/Application/kopi", "-newEvent");
646 646
647} 647}
648void SimpleAlarmDaemonImpl::newMail() 648void SimpleAlarmDaemonImpl::newMail()
649{ 649{