author | zautrix <zautrix> | 2005-06-11 15:15:54 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-11 15:15:54 (UTC) |
commit | 0cfaf22fc5d8f511320813171be84ce3436990c6 (patch) (unidiff) | |
tree | 00f858c12e9c810c53acdd816a9fcfe7e880996a | |
parent | d4501288ba7414ba89a791dd2c306e9f74eeb3fa (diff) | |
download | kdepimpi-0cfaf22fc5d8f511320813171be84ce3436990c6.zip kdepimpi-0cfaf22fc5d8f511320813171be84ce3436990c6.tar.gz kdepimpi-0cfaf22fc5d8f511320813171be84ce3436990c6.tar.bz2 |
fixx
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index ec6a4ec..a11fab3 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,57 +1,59 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.6 ************ | 3 | ********** VERSION 2.1.6 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. | 6 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. |
7 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. | 7 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. |
8 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. | 8 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. |
9 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. | 9 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. |
10 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. | ||
11 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. | ||
10 | 12 | ||
11 | ********** VERSION 2.1.5 ************ | 13 | ********** VERSION 2.1.5 ************ |
12 | 14 | ||
13 | This is the new stable version. | 15 | This is the new stable version. |
14 | Bugfix: | 16 | Bugfix: |
15 | Fixed a problem with agenda popup on the desktop in KO/Pi. | 17 | Fixed a problem with agenda popup on the desktop in KO/Pi. |
16 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. | 18 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. |
17 | Added config option to not display completed todos in agenda view. | 19 | Added config option to not display completed todos in agenda view. |
18 | Addressee view is now using the formatted name, if defined. | 20 | Addressee view is now using the formatted name, if defined. |
19 | That makes it possible to display "lastname, firstname" in that view now. | 21 | That makes it possible to display "lastname, firstname" in that view now. |
20 | To set the formatted name for all contacts, please use menu: | 22 | To set the formatted name for all contacts, please use menu: |
21 | Edit->Change->Set formatted name. | 23 | Edit->Change->Set formatted name. |
22 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. | 24 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. |
23 | 25 | ||
24 | ********** VERSION 2.1.4 ************ | 26 | ********** VERSION 2.1.4 ************ |
25 | 27 | ||
26 | Fixed two more bugs in the KA/Pi CSV import dialog: | 28 | Fixed two more bugs in the KA/Pi CSV import dialog: |
27 | Made it possible to read multi-line fields and import it to the "Note" field. | 29 | Made it possible to read multi-line fields and import it to the "Note" field. |
28 | Fixed a problem in mapping custom fields, whatever a custem field is... | 30 | Fixed a problem in mapping custom fields, whatever a custem field is... |
29 | 31 | ||
30 | ********** VERSION 2.1.3 ************ | 32 | ********** VERSION 2.1.3 ************ |
31 | 33 | ||
32 | Changed the menu structure of the alarm applet: | 34 | Changed the menu structure of the alarm applet: |
33 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". | 35 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". |
34 | 36 | ||
35 | Fixed several problems in the KA/Pi CSV import dialog: | 37 | Fixed several problems in the KA/Pi CSV import dialog: |
36 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. | 38 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. |
37 | 39 | ||
38 | 40 | ||
39 | ********** VERSION 2.1.2 ************ | 41 | ********** VERSION 2.1.2 ************ |
40 | 42 | ||
41 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. | 43 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. |
42 | 44 | ||
43 | Fixed a problem when importing data from Outlook with mutiple categories set. | 45 | Fixed a problem when importing data from Outlook with mutiple categories set. |
44 | 46 | ||
45 | Changed display of days in datenavigator: | 47 | Changed display of days in datenavigator: |
46 | Birthdays are now blue, not dark green. | 48 | Birthdays are now blue, not dark green. |
47 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. | 49 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. |
48 | When journal view is shown, only holidays are shown and days with journals are blue. | 50 | When journal view is shown, only holidays are shown and days with journals are blue. |
49 | 51 | ||
50 | Added Backup options to global config: | 52 | Added Backup options to global config: |
51 | You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). | 53 | You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). |
52 | It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. | 54 | It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. |
53 | The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. | 55 | The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. |
54 | 56 | ||
55 | ********** VERSION 2.1.1 ************ | 57 | ********** VERSION 2.1.1 ************ |
56 | 58 | ||
57 | Stable release 2.1.1! | 59 | Stable release 2.1.1! |
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index 37e7d0d..d6e06c8 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -225,97 +225,97 @@ void SimpleAlarmDaemonImpl::saveSlot( int load ) | |||
225 | configString += "PLBE " + QString::number( mPlayBeeps ) + "\n"; | 225 | configString += "PLBE " + QString::number( mPlayBeeps ) + "\n"; |
226 | configString += "CUTE " + mCustomText + "\n"; | 226 | configString += "CUTE " + mCustomText + "\n"; |
227 | configString += "CUMI " + QString::number( mCustomMinutes ) + "\n"; | 227 | configString += "CUMI " + QString::number( mCustomMinutes ) + "\n"; |
228 | configString += "SUTI " + QString::number( mAlarmDialog->getSuspendTime( )) + "\n"; | 228 | configString += "SUTI " + QString::number( mAlarmDialog->getSuspendTime( )) + "\n"; |
229 | QTextStream ts( &file ); | 229 | QTextStream ts( &file ); |
230 | ts << configString ; | 230 | ts << configString ; |
231 | file.close(); | 231 | file.close(); |
232 | } | 232 | } |
233 | 233 | ||
234 | } | 234 | } |
235 | void SimpleAlarmDaemonImpl::confSuspend( int num ) | 235 | void SimpleAlarmDaemonImpl::confSuspend( int num ) |
236 | { | 236 | { |
237 | mSuspendPopUp->setItemChecked ( mSuspend,false ); | 237 | mSuspendPopUp->setItemChecked ( mSuspend,false ); |
238 | mSuspend = num; | 238 | mSuspend = num; |
239 | mSuspendPopUp->setItemChecked ( mSuspend,true ); | 239 | mSuspendPopUp->setItemChecked ( mSuspend,true ); |
240 | } | 240 | } |
241 | void SimpleAlarmDaemonImpl::confPause( int num ) | 241 | void SimpleAlarmDaemonImpl::confPause( int num ) |
242 | { | 242 | { |
243 | mPausePopUp->setItemChecked ( mPausePlay,false ); | 243 | mPausePopUp->setItemChecked ( mPausePlay,false ); |
244 | mPausePlay = num; | 244 | mPausePlay = num; |
245 | mPausePopUp->setItemChecked ( mPausePlay,true ); | 245 | mPausePopUp->setItemChecked ( mPausePlay,true ); |
246 | } | 246 | } |
247 | void SimpleAlarmDaemonImpl::confSound( int num ) | 247 | void SimpleAlarmDaemonImpl::confSound( int num ) |
248 | { | 248 | { |
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 | } |
259 | void SimpleAlarmDaemonImpl::slotPlayBeep( int num ) | 259 | void 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 | ||
270 | void SimpleAlarmDaemonImpl::recieve( const QCString& msg, const QByteArray& ) | 270 | void 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; |
298 | startAlarm( mess.mid( 11 ), filename ); | 298 | startAlarm( mess.mid( 11 ), filename ); |
299 | return; | 299 | return; |
300 | } | 300 | } |
301 | if ( mess.left( 10 ) == "proc_alarm") { | 301 | if ( mess.left( 10 ) == "proc_alarm") { |
302 | bool error = false; | 302 | bool error = false; |
303 | int len = mess.mid( 10 ).find("+++"); | 303 | int len = mess.mid( 10 ).find("+++"); |
304 | if ( len < 2 ) | 304 | if ( len < 2 ) |
305 | error = true; | 305 | error = true; |
306 | else { | 306 | else { |
307 | tempfilename = mess.mid( 10, len ); | 307 | tempfilename = mess.mid( 10, len ); |
308 | if ( !QFile::exists( tempfilename ) ) | 308 | if ( !QFile::exists( tempfilename ) ) |
309 | error = true; | 309 | error = true; |
310 | } | 310 | } |
311 | if ( error ) { | 311 | if ( error ) { |
312 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; | 312 | mAlarmMessage = "Procedure Alarm\nError - File not found\n"; |
313 | mAlarmMessage += mess.mid( 10+len+3+9 ); | 313 | mAlarmMessage += mess.mid( 10+len+3+9 ); |
314 | } else { | 314 | } else { |
315 | { | 315 | { |
316 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 316 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
317 | } | 317 | } |
318 | //qDebug("-----system command %s ",tempfilename.latin1() ); | 318 | //qDebug("-----system command %s ",tempfilename.latin1() ); |
319 | if ( vfork () == 0 ) { | 319 | if ( vfork () == 0 ) { |
320 | execl ( tempfilename.latin1(), 0 ); | 320 | execl ( tempfilename.latin1(), 0 ); |
321 | return; | 321 | return; |
@@ -577,97 +577,97 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
577 | spinm.setFixedSize( 110,62 ); | 577 | spinm.setFixedSize( 110,62 ); |
578 | lay.addWidget( &hbox); | 578 | lay.addWidget( &hbox); |
579 | QLabel lab5 ("Timer fires at:", &dia ); | 579 | QLabel lab5 ("Timer fires at:", &dia ); |
580 | lab5.setAlignment( AlignCenter ); | 580 | lab5.setAlignment( AlignCenter ); |
581 | lay.addWidget( &lab5); | 581 | lay.addWidget( &lab5); |
582 | KODateLabel dl ( &dia ); | 582 | KODateLabel dl ( &dia ); |
583 | dl.setAlignment( AlignCenter ); | 583 | dl.setAlignment( AlignCenter ); |
584 | dl.setFont( fo ); | 584 | dl.setFont( fo ); |
585 | connect ( &spinh, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_hours( int ) ) ); | 585 | connect ( &spinh, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_hours( int ) ) ); |
586 | connect ( &spinm, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_minutes( int ) ) ); | 586 | connect ( &spinm, SIGNAL ( valueChanged (int)), &dl, SLOT ( slot_minutes( int ) ) ); |
587 | lay.addWidget( &dl); | 587 | lay.addWidget( &dl); |
588 | spinh.setValue( mCustomMinutes/60 ); | 588 | spinh.setValue( mCustomMinutes/60 ); |
589 | spinm.setValue( mCustomMinutes%60 ); | 589 | spinm.setValue( mCustomMinutes%60 ); |
590 | QPushButton ok ( "Start timer", &dia); | 590 | QPushButton ok ( "Start timer", &dia); |
591 | ok.setDefault( true ); | 591 | ok.setDefault( true ); |
592 | ok.setFont( fo ); | 592 | ok.setFont( fo ); |
593 | spinh.setFocus(); | 593 | spinh.setFocus(); |
594 | lay.addWidget( &ok); | 594 | lay.addWidget( &ok); |
595 | connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) ); | 595 | connect ( &ok, SIGNAL (clicked()), &dia, SLOT ( accept() ) ); |
596 | dia.resize( dia.sizeHint().width(), dia.sizeHint().height() ); | 596 | dia.resize( dia.sizeHint().width(), dia.sizeHint().height() ); |
597 | 597 | ||
598 | if ( !dia.exec() ) | 598 | if ( !dia.exec() ) |
599 | return; | 599 | return; |
600 | mCustomText = lEdit.text(); | 600 | mCustomText = lEdit.text(); |
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 | ||
629 | void SimpleAlarmDaemonImpl::writeFile() | 629 | void 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 | } |
634 | void SimpleAlarmDaemonImpl::showWN() | 634 | void SimpleAlarmDaemonImpl::showWN() |
635 | { | 635 | { |
636 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); | 636 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); |
637 | } | 637 | } |
638 | void SimpleAlarmDaemonImpl::newTodo() | 638 | void SimpleAlarmDaemonImpl::newTodo() |
639 | { | 639 | { |
640 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); | 640 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); |
641 | } | 641 | } |
642 | 642 | ||
643 | void SimpleAlarmDaemonImpl::newEvent() | 643 | void SimpleAlarmDaemonImpl::newEvent() |
644 | { | 644 | { |
645 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); | 645 | QCopEnvelope e("QPE/Application/kopi", "-newEvent"); |
646 | 646 | ||
647 | } | 647 | } |
648 | void SimpleAlarmDaemonImpl::newMail() | 648 | void SimpleAlarmDaemonImpl::newMail() |
649 | { | 649 | { |
650 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); | 650 | QCopEnvelope e("QPE/Application/ompi", "newMail()"); |
651 | } | 651 | } |
652 | void SimpleAlarmDaemonImpl::showAdd() | 652 | void SimpleAlarmDaemonImpl::showAdd() |
653 | { | 653 | { |
654 | QCopEnvelope e("QPE/Application/kapi", "raise()"); | 654 | QCopEnvelope e("QPE/Application/kapi", "raise()"); |
655 | } | 655 | } |
656 | void SimpleAlarmDaemonImpl::ringSync() | 656 | void SimpleAlarmDaemonImpl::ringSync() |
657 | { | 657 | { |
658 | QCopEnvelope e("QPE/Application/kopi", "-ringSync"); | 658 | QCopEnvelope e("QPE/Application/kopi", "-ringSync"); |
659 | 659 | ||
660 | } | 660 | } |
661 | void SimpleAlarmDaemonImpl::newCountdown() | 661 | void SimpleAlarmDaemonImpl::newCountdown() |
662 | { | 662 | { |
663 | //recieve("cal_alarm", 10 ); | 663 | //recieve("cal_alarm", 10 ); |
664 | } | 664 | } |
665 | void SimpleAlarmDaemonImpl::simulate() | 665 | void SimpleAlarmDaemonImpl::simulate() |
666 | { | 666 | { |
667 | writeFile(); | 667 | writeFile(); |
668 | QString filename = getenv("QPEDIR") ; | 668 | QString filename = getenv("QPEDIR") ; |
669 | filename += "/pics/kdepim/korganizer/koalarm.wav"; | 669 | filename += "/pics/kdepim/korganizer/koalarm.wav"; |
670 | startAlarm("Alarm simulation", filename ); | 670 | startAlarm("Alarm simulation", filename ); |
671 | } | 671 | } |
672 | void SimpleAlarmDaemonImpl::showKO() | 672 | void SimpleAlarmDaemonImpl::showKO() |
673 | { | 673 | { |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8d992b9..4b82aa8 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -605,103 +605,105 @@ void CalendarView::init() | |||
605 | mFlagEditDescription = false; | 605 | mFlagEditDescription = false; |
606 | 606 | ||
607 | mSuspendTimer = new QTimer( this ); | 607 | mSuspendTimer = new QTimer( this ); |
608 | mAlarmTimer = new QTimer( this ); | 608 | mAlarmTimer = new QTimer( this ); |
609 | mRecheckAlarmTimer = new QTimer( this ); | 609 | mRecheckAlarmTimer = new QTimer( this ); |
610 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); | 610 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); |
611 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); | 611 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); |
612 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); | 612 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); |
613 | mAlarmDialog = new AlarmDialog( this ); | 613 | mAlarmDialog = new AlarmDialog( this ); |
614 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); | 614 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); |
615 | mAlarmDialog->setServerNotification( false ); | 615 | mAlarmDialog->setServerNotification( false ); |
616 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); | 616 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); |
617 | 617 | ||
618 | 618 | ||
619 | #ifndef DESKTOP_VERSION | 619 | #ifndef DESKTOP_VERSION |
620 | //US listen for arriving address resultsets | 620 | //US listen for arriving address resultsets |
621 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), | 621 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), |
622 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 622 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
623 | #endif | 623 | #endif |
624 | mDateNavigator->setCalendar( mCalendar ); | 624 | mDateNavigator->setCalendar( mCalendar ); |
625 | } | 625 | } |
626 | 626 | ||
627 | 627 | ||
628 | CalendarView::~CalendarView() | 628 | CalendarView::~CalendarView() |
629 | { | 629 | { |
630 | // kdDebug() << "~CalendarView()" << endl; | 630 | // kdDebug() << "~CalendarView()" << endl; |
631 | //qDebug("CalendarView::~CalendarView() "); | 631 | //qDebug("CalendarView::~CalendarView() "); |
632 | delete mDialogManager; | 632 | delete mDialogManager; |
633 | delete mViewManager; | 633 | delete mViewManager; |
634 | delete mStorage; | 634 | delete mStorage; |
635 | delete mDateFrame ; | 635 | delete mDateFrame ; |
636 | delete beamDialog; | 636 | delete beamDialog; |
637 | delete mEventViewerDialog; | 637 | delete mEventViewerDialog; |
638 | //kdDebug() << "~CalendarView() done" << endl; | 638 | //kdDebug() << "~CalendarView() done" << endl; |
639 | } | 639 | } |
640 | void CalendarView::checkAlarms() | 640 | void CalendarView::checkAlarms() |
641 | { | 641 | { |
642 | KConfig *config = KOGlobals::config(); | 642 | KConfig *config = KOGlobals::config(); |
643 | config->setGroup( "AppRun" ); | 643 | config->setGroup( "AppRun" ); |
644 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | 644 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); |
645 | int secto = dt.secsTo( QDateTime::currentDateTime() ); | 645 | int secto = dt.secsTo( QDateTime::currentDateTime() ); |
646 | int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30; | 646 | int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30; |
647 | //secs -= ( 3600 * 24*3 ); // debug only | 647 | //secs -= ( 3600 * 24*3 ); // debug only |
648 | QDateTime latest = dt.addSecs ( secs ); | 648 | QDateTime latest = dt.addSecs ( secs ); |
649 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); | 649 | qDebug("KO: Last termination on %s ", latest.toString().latin1()); |
650 | QPtrList<Incidence> el = mCalendar->rawIncidences(); | 650 | QPtrList<Incidence> el = mCalendar->rawIncidences(); |
651 | QPtrList<Incidence> al; | 651 | QPtrList<Incidence> al; |
652 | Incidence* inL = el.first(); | 652 | Incidence* inL = el.first(); |
653 | QDateTime cur = QDateTime::currentDateTime().addSecs(-59); | ||
654 | qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); | ||
653 | while ( inL ) { | 655 | while ( inL ) { |
654 | bool ok = false; | 656 | bool ok = false; |
655 | int offset = 0; | 657 | int offset = 0; |
656 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; | 658 | QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; |
657 | if ( ok ) { | 659 | if ( ok ) { |
658 | //qDebug("OK %s",next.toString().latin1()); | 660 | //qDebug("OK %s",next.toString().latin1()); |
659 | if ( next < QDateTime::currentDateTime() ) { | 661 | if ( next < cur ) { |
660 | al.append( inL ); | 662 | al.append( inL ); |
661 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); | 663 | //qDebug("found missed alarm: %s ", inL->summary().latin1() ); |
662 | } | 664 | } |
663 | } | 665 | } |
664 | inL = el.next(); | 666 | inL = el.next(); |
665 | } | 667 | } |
666 | if ( al.count() ) { | 668 | if ( al.count() ) { |
667 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); | 669 | QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); |
668 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); | 670 | dia->setCaption( i18n("KO/Pi: Missing alarms!") ); |
669 | QVBoxLayout* lay = new QVBoxLayout( dia ); | 671 | QVBoxLayout* lay = new QVBoxLayout( dia ); |
670 | lay->setSpacing( 0 ); | 672 | lay->setSpacing( 0 ); |
671 | lay->setMargin( 0 ); | 673 | lay->setMargin( 0 ); |
672 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); | 674 | MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); |
673 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); | 675 | connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); |
674 | lay->addWidget( matb ); | 676 | lay->addWidget( matb ); |
675 | if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { | 677 | if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { |
676 | int wid = 210; | 678 | int wid = 210; |
677 | int x = QApplication::desktop()->width() - wid - 7; | 679 | int x = QApplication::desktop()->width() - wid - 7; |
678 | int y = QApplication::desktop()->height() - wid - 70; | 680 | int y = QApplication::desktop()->height() - wid - 70; |
679 | dia->setGeometry ( x,y,wid,wid); | 681 | dia->setGeometry ( x,y,wid,wid); |
680 | } else { | 682 | } else { |
681 | int si = 220; | 683 | int si = 220; |
682 | if ( QApplication::desktop()->width() > 470 ) | 684 | if ( QApplication::desktop()->width() > 470 ) |
683 | si = 400; | 685 | si = 400; |
684 | dia->resize(si,si/2); | 686 | dia->resize(si,si/2); |
685 | } | 687 | } |
686 | dia->setBackgroundColor( QColor( 255, 255, 255 ) ); | 688 | dia->setBackgroundColor( QColor( 255, 255, 255 ) ); |
687 | dia->show(); | 689 | dia->show(); |
688 | 690 | ||
689 | } | 691 | } |
690 | } | 692 | } |
691 | void CalendarView::showDay( QDate d ) | 693 | void CalendarView::showDay( QDate d ) |
692 | { | 694 | { |
693 | dateNavigator()->blockSignals( true ); | 695 | dateNavigator()->blockSignals( true ); |
694 | dateNavigator()->selectDate( d ); | 696 | dateNavigator()->selectDate( d ); |
695 | dateNavigator()->blockSignals( false ); | 697 | dateNavigator()->blockSignals( false ); |
696 | mViewManager->showDayView(); | 698 | mViewManager->showDayView(); |
697 | //dateNavigator()->selectDate( d ); | 699 | //dateNavigator()->selectDate( d ); |
698 | } | 700 | } |
699 | void CalendarView::timerAlarm() | 701 | void CalendarView::timerAlarm() |
700 | { | 702 | { |
701 | //qDebug("CalendarView::timerAlarm() "); | 703 | //qDebug("CalendarView::timerAlarm() "); |
702 | computeAlarm(mAlarmNotification ); | 704 | computeAlarm(mAlarmNotification ); |
703 | } | 705 | } |
704 | 706 | ||
705 | void CalendarView::suspendAlarm() | 707 | void CalendarView::suspendAlarm() |
706 | { | 708 | { |
707 | //qDebug(" CalendarView::suspendAlarm() "); | 709 | //qDebug(" CalendarView::suspendAlarm() "); |
@@ -787,97 +789,97 @@ void CalendarView::computeAlarm( QString msg ) | |||
787 | 789 | ||
788 | return; | 790 | return; |
789 | } | 791 | } |
790 | 792 | ||
791 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); | 793 | //qDebug("+++++++system command %s ",tempfilename.latin1() ); |
792 | } | 794 | } |
793 | if ( mess.left( 11 ) == "audio_alarm") { | 795 | if ( mess.left( 11 ) == "audio_alarm") { |
794 | bool error = false; | 796 | bool error = false; |
795 | int len = mess.mid( 11 ).find("+++"); | 797 | int len = mess.mid( 11 ).find("+++"); |
796 | if ( len < 2 ) | 798 | if ( len < 2 ) |
797 | error = true; | 799 | error = true; |
798 | else { | 800 | else { |
799 | tempfilename = mess.mid( 11, len ); | 801 | tempfilename = mess.mid( 11, len ); |
800 | if ( !QFile::exists( tempfilename ) ) | 802 | if ( !QFile::exists( tempfilename ) ) |
801 | error = true; | 803 | error = true; |
802 | } | 804 | } |
803 | if ( ! error ) { | 805 | if ( ! error ) { |
804 | filename = tempfilename; | 806 | filename = tempfilename; |
805 | } | 807 | } |
806 | mAlarmMessage = mess.mid( 11+len+3+9 ); | 808 | mAlarmMessage = mess.mid( 11+len+3+9 ); |
807 | //qDebug("audio file command %s ",tempfilename.latin1() ); | 809 | //qDebug("audio file command %s ",tempfilename.latin1() ); |
808 | } | 810 | } |
809 | if ( mess.left( 9 ) == "cal_alarm") { | 811 | if ( mess.left( 9 ) == "cal_alarm") { |
810 | mAlarmMessage = mess.mid( 9 ) ; | 812 | mAlarmMessage = mess.mid( 9 ) ; |
811 | } | 813 | } |
812 | 814 | ||
813 | startAlarm( mAlarmMessage, filename ); | 815 | startAlarm( mAlarmMessage, filename ); |
814 | 816 | ||
815 | 817 | ||
816 | } | 818 | } |
817 | 819 | ||
818 | void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) | 820 | void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString ¬i ) |
819 | { | 821 | { |
820 | //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 822 | //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
821 | 823 | ||
822 | mSuspendAlarmNotification = noti; | 824 | mSuspendAlarmNotification = noti; |
823 | int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; | 825 | int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; |
824 | //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); | 826 | //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); |
825 | mSuspendTimer->start( ms , true ); | 827 | mSuspendTimer->start( ms , true ); |
826 | 828 | ||
827 | } | 829 | } |
828 | 830 | ||
829 | void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) | 831 | void CalendarView::addAlarm(const QDateTime &qdt, const QString ¬i ) |
830 | { | 832 | { |
831 | mNextAlarmDateTime = qdt; | 833 | mNextAlarmDateTime = qdt; |
832 | //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 834 | //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
833 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 835 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
834 | #ifndef DESKTOP_VERSION | 836 | #ifndef DESKTOP_VERSION |
835 | AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); | 837 | AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() ); |
836 | #endif | 838 | #endif |
837 | return; | 839 | return; |
838 | } | 840 | } |
839 | int maxSec; | 841 | int maxSec; |
840 | //maxSec = 5; //testing only | 842 | //maxSec = 5; //testing only |
841 | maxSec = 86400+3600; // one day+1hour | 843 | maxSec = 86400+3600; // one day+1hour |
842 | mAlarmNotification = noti; | 844 | mAlarmNotification = noti; |
843 | int sec = QDateTime::currentDateTime().secsTo( qdt ); | 845 | int sec = QDateTime::currentDateTime().secsTo( qdt ); |
844 | if ( sec > maxSec ) { | 846 | if ( sec > maxSec ) { |
845 | mRecheckAlarmTimer->start( maxSec * 1000 ); | 847 | mRecheckAlarmTimer->start( maxSec * 1000 ); |
846 | // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); | 848 | // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); |
847 | return; | 849 | return; |
848 | } else { | 850 | } else { |
849 | mRecheckAlarmTimer->stop(); | 851 | mRecheckAlarmTimer->stop(); |
850 | } | 852 | } |
851 | //qDebug("Alarm timer started with secs: %d ", sec); | 853 | //qDebug("Alarm timer started with secs: %d ", sec); |
852 | mAlarmTimer->start( sec *1000 , true ); | 854 | mAlarmTimer->start( sec *1000 , true ); |
853 | 855 | ||
854 | } | 856 | } |
855 | // called by mRecheckAlarmTimer to get next alarm | 857 | // called by mRecheckAlarmTimer to get next alarm |
856 | // we need this, because a QTimer has only a max range of 25 days | 858 | // we need this, because a QTimer has only a max range of 25 days |
857 | void CalendarView::recheckTimerAlarm() | 859 | void CalendarView::recheckTimerAlarm() |
858 | { | 860 | { |
859 | mAlarmTimer->stop(); | 861 | mAlarmTimer->stop(); |
860 | mRecheckAlarmTimer->stop(); | 862 | mRecheckAlarmTimer->stop(); |
861 | mCalendar->checkAlarmForIncidence( 0, true ); | 863 | mCalendar->checkAlarmForIncidence( 0, true ); |
862 | } | 864 | } |
863 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) | 865 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) |
864 | { | 866 | { |
865 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 867 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
866 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 868 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
867 | #ifndef DESKTOP_VERSION | 869 | #ifndef DESKTOP_VERSION |
868 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); | 870 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); |
869 | #endif | 871 | #endif |
870 | return; | 872 | return; |
871 | } | 873 | } |
872 | mAlarmTimer->stop(); | 874 | mAlarmTimer->stop(); |
873 | } | 875 | } |
874 | void CalendarView::selectWeekNum ( int num ) | 876 | void CalendarView::selectWeekNum ( int num ) |
875 | { | 877 | { |
876 | dateNavigator()->blockSignals( true ); | 878 | dateNavigator()->blockSignals( true ); |
877 | dateNavigator()->selectWeek( num ); | 879 | dateNavigator()->selectWeek( num ); |
878 | dateNavigator()->blockSignals( false ); | 880 | dateNavigator()->blockSignals( false ); |
879 | mViewManager->showWeekView(); | 881 | mViewManager->showWeekView(); |
880 | } | 882 | } |
881 | KOViewManager *CalendarView::viewManager() | 883 | KOViewManager *CalendarView::viewManager() |
882 | { | 884 | { |
883 | return mViewManager; | 885 | return mViewManager; |