author | zautrix <zautrix> | 2005-02-18 09:36:33 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-18 09:36:33 (UTC) |
commit | 59a00e603e2ba14885e81c09daf3bb89859ff176 (patch) (unidiff) | |
tree | e257e5b0e338675c5448f9d4c57eadf68ed5e76b | |
parent | b1e885da3b0a083121f940485d9c0eea53ff5139 (diff) | |
download | kdepimpi-59a00e603e2ba14885e81c09daf3bb89859ff176.zip kdepimpi-59a00e603e2ba14885e81c09daf3bb89859ff176.tar.gz kdepimpi-59a00e603e2ba14885e81c09daf3bb89859ff176.tar.bz2 |
recur fixes
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 8 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 6 | ||||
-rw-r--r-- | libkcal/recurrence.cpp | 12 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 8 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwminit.cpp | 8 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmview.cpp | 2 |
6 files changed, 29 insertions, 15 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index ab6d220..58be545 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -519,774 +519,782 @@ | |||
519 | { "Remote via ssh","Über Netzwerk via ssh" }, | 519 | { "Remote via ssh","Über Netzwerk via ssh" }, |
520 | { "With local file","Mit lokaler Datei" }, | 520 | { "With local file","Mit lokaler Datei" }, |
521 | { "With last file","Mit letzter Datei" }, | 521 | { "With last file","Mit letzter Datei" }, |
522 | { "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" }, | 522 | { "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" }, |
523 | { "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" }, | 523 | { "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" }, |
524 | { "Save filename","Speichern: Dateinamen wählen" }, | 524 | { "Save filename","Speichern: Dateinamen wählen" }, |
525 | { "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" }, | 525 | { "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" }, |
526 | { "KO/Pi: Warning!","KO/Pi: Warnung!" }, | 526 | { "KO/Pi: Warning!","KO/Pi: Warnung!" }, |
527 | { "Overwrite!","Überschreibe!" }, | 527 | { "Overwrite!","Überschreibe!" }, |
528 | { "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, | 528 | { "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, |
529 | { "All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n","Alle selektierten Einträge werden\nunwiederbringlich gelöscht.\n(Löschen kann auf dem\nPDA einige Zeit dauern)\n" }, | 529 | { "All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n","Alle selektierten Einträge werden\nunwiederbringlich gelöscht.\n(Löschen kann auf dem\nPDA einige Zeit dauern)\n" }, |
530 | { "KO/Pi Confirmation","KO/Pi Bestätigung" }, | 530 | { "KO/Pi Confirmation","KO/Pi Bestätigung" }, |
531 | { "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" }, | 531 | { "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" }, |
532 | { "Deleting item %d ...","Lösche Eintrag %d ..." }, | 532 | { "Deleting item %d ...","Lösche Eintrag %d ..." }, |
533 | { "%d items remaining in list.","%d Einträge sind in der Liste verblieben." }, | 533 | { "%d items remaining in list.","%d Einträge sind in der Liste verblieben." }, |
534 | { "Size","Größe" }, | 534 | { "Size","Größe" }, |
535 | { "Date","Datum" }, | 535 | { "Date","Datum" }, |
536 | { "Mime Type","Datei Typ" }, | 536 | { "Mime Type","Datei Typ" }, |
537 | { "All Files","Alle Dateien" }, | 537 | { "All Files","Alle Dateien" }, |
538 | { "Files","Dateien" }, | 538 | { "Files","Dateien" }, |
539 | { "Documents","DoKumente" }, | 539 | { "Documents","DoKumente" }, |
540 | { "Select Categories","Selektiere Kategorien" }, | 540 | { "Select Categories","Selektiere Kategorien" }, |
541 | { " &Deselect All "," Auswahl aufheben " }, | 541 | { " &Deselect All "," Auswahl aufheben " }, |
542 | { "A&dd","Hinzu" }, | 542 | { "A&dd","Hinzu" }, |
543 | { "&Modify","Ändern" }, | 543 | { "&Modify","Ändern" }, |
544 | { "Edit Categories","Editiere Kategorien" }, | 544 | { "Edit Categories","Editiere Kategorien" }, |
545 | { " &Edit Categories "," &Editiere Kategorien " }, | 545 | { " &Edit Categories "," &Editiere Kategorien " }, |
546 | { "Beam Options","Beam Einstellungen" }, | 546 | { "Beam Options","Beam Einstellungen" }, |
547 | { " With timezone "," Mit Zeitzone " }, | 547 | { " With timezone "," Mit Zeitzone " }, |
548 | { " Local time ", " Lokale Zeit " }, | 548 | { " Local time ", " Lokale Zeit " }, |
549 | { "Manage new Categories","Verwalte neue Kategorien" }, | 549 | { "Manage new Categories","Verwalte neue Kategorien" }, |
550 | { "Add to category list","Füge zur Kategorieliste hinzu" }, | 550 | { "Add to category list","Füge zur Kategorieliste hinzu" }, |
551 | { "Remove from Events/Todos","Entferne von Terminen/Todos" }, | 551 | { "Remove from Events/Todos","Entferne von Terminen/Todos" }, |
552 | { "After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nTerminen oder Todos geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, | 552 | { "After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nTerminen oder Todos geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, |
553 | { "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, | 553 | { "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, |
554 | { "File format","Datei Format" }, | 554 | { "File format","Datei Format" }, |
555 | { "Time format","Zeit Format" }, | 555 | { "Time format","Zeit Format" }, |
556 | { "Delete all\ncompleted To-Dos?","Lösche alle\nerledigten To-Dos?" }, | 556 | { "Delete all\ncompleted To-Dos?","Lösche alle\nerledigten To-Dos?" }, |
557 | { "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." }, | 557 | { "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." }, |
558 | { "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" }, | 558 | { "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" }, |
559 | { "h","Std" }, | 559 | { "h","Std" }, |
560 | { "min","Min" }, | 560 | { "min","Min" }, |
561 | { "hou","Std" }, | 561 | { "hou","Std" }, |
562 | { "day","Tag" }, | 562 | { "day","Tag" }, |
563 | { "French","Französich" }, | 563 | { "French","Französich" }, |
564 | { "Time","Zeit" }, | 564 | { "Time","Zeit" }, |
565 | { "Event Viewer","Termin Ansicht" }, | 565 | { "Event Viewer","Termin Ansicht" }, |
566 | { "Cancel Sync","Sync Abbrechen" }, | 566 | { "Cancel Sync","Sync Abbrechen" }, |
567 | { "Remote","Fern" }, | 567 | { "Remote","Fern" }, |
568 | { "Local","Lokal" }, | 568 | { "Local","Lokal" }, |
569 | { "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" }, | 569 | { "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" }, |
570 | { "Local: ","Lokal: " }, | 570 | { "Local: ","Lokal: " }, |
571 | { "Remote: ","Fern: " }, | 571 | { "Remote: ","Fern: " }, |
572 | { "Last modified: ","Zuletzt geändert: " }, | 572 | { "Last modified: ","Zuletzt geändert: " }, |
573 | { "Location: ","Ort: " }, | 573 | { "Location: ","Ort: " }, |
574 | { "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" }, | 574 | { "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" }, |
575 | { "<p><b>On:</b> %1</p>","<p><b>Am:</b> %1</p>" }, | 575 | { "<p><b>On:</b> %1</p>","<p><b>Am:</b> %1</p>" }, |
576 | { "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " }, | 576 | { "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " }, |
577 | { "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" }, | 577 | { "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" }, |
578 | { "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " }, | 578 | { "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " }, |
579 | { "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" }, | 579 | { "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" }, |
580 | { "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." }, | 580 | { "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." }, |
581 | { "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" }, | 581 | { "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" }, |
582 | { "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" }, | 582 | { "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" }, |
583 | { "( %1 min before )","( %1 min vorher )" }, | 583 | { "( %1 min before )","( %1 min vorher )" }, |
584 | { "<b>Alarm on: ","<b>Alarm am: " }, | 584 | { "<b>Alarm on: ","<b>Alarm am: " }, |
585 | { "<b>Details: </b>","<b>Details: </b>" }, | 585 | { "<b>Details: </b>","<b>Details: </b>" }, |
586 | { "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, | 586 | { "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, |
587 | { "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" }, | 587 | { "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" }, |
588 | { "Organizer","Organisator" }, | 588 | { "Organizer","Organisator" }, |
589 | { "Save","Speichern" }, | 589 | { "Save","Speichern" }, |
590 | { "Exit (+save)","Beenden (+ speichern)" }, | 590 | { "Exit (+save)","Beenden (+ speichern)" }, |
591 | { "Home","Zuhause" }, | 591 | { "Home","Zuhause" }, |
592 | { "Office","Büro" }, | 592 | { "Office","Büro" }, |
593 | { "Libary","Bücherei" }, | 593 | { "Libary","Bücherei" }, |
594 | { "Doctor","Arzt" }, | 594 | { "Doctor","Arzt" }, |
595 | { "Beach","Strand" }, | 595 | { "Beach","Strand" }, |
596 | { "Conference room","Konferenzraum" }, | 596 | { "Conference room","Konferenzraum" }, |
597 | { "Drive Home","Heimfahrt" }, | 597 | { "Drive Home","Heimfahrt" }, |
598 | { "Watch TV","Tv gucken" }, | 598 | { "Watch TV","Tv gucken" }, |
599 | { "Phone call","Telefonanruf" }, | 599 | { "Phone call","Telefonanruf" }, |
600 | { "Pay bill","Rechnung bezahlen" }, | 600 | { "Pay bill","Rechnung bezahlen" }, |
601 | { "Read book","Buch lesen" }, | 601 | { "Read book","Buch lesen" }, |
602 | { "Watering plants","Pflanzen giessen" }, | 602 | { "Watering plants","Pflanzen giessen" }, |
603 | {"Appointment","Verabredung" }, | 603 | {"Appointment","Verabredung" }, |
604 | {"Birthday","Geburtstag" }, | 604 | {"Birthday","Geburtstag" }, |
605 | {"Business","Geschäft" }, | 605 | {"Business","Geschäft" }, |
606 | {"Business Travel","Geschäftsreise" }, | 606 | {"Business Travel","Geschäftsreise" }, |
607 | {"Cinema","Kino" }, | 607 | {"Cinema","Kino" }, |
608 | {"Customer","Kunde" }, | 608 | {"Customer","Kunde" }, |
609 | {"Break","Pause" }, | 609 | {"Break","Pause" }, |
610 | {"Breakfast","Frühstück" }, | 610 | {"Breakfast","Frühstück" }, |
611 | {"Competition","Wettkampf" }, | 611 | {"Competition","Wettkampf" }, |
612 | {"Dinner","Abendessen" }, | 612 | {"Dinner","Abendessen" }, |
613 | {"Education","Erziehung" }, | 613 | {"Education","Erziehung" }, |
614 | {"Family","Familie" }, | 614 | {"Family","Familie" }, |
615 | {"Favorites","Favoriten" }, | 615 | {"Favorites","Favoriten" }, |
616 | {"Festival","Festival" }, | 616 | {"Festival","Festival" }, |
617 | {"Fishing","Angeln" }, | 617 | {"Fishing","Angeln" }, |
618 | {"Flight","Flug" }, | 618 | {"Flight","Flug" }, |
619 | {"Gifts","Geschenk" }, | 619 | {"Gifts","Geschenk" }, |
620 | {"Holiday","Feiertag" }, | 620 | {"Holiday","Feiertag" }, |
621 | {"Holiday Cards","Ansichtskarten" }, | 621 | {"Holiday Cards","Ansichtskarten" }, |
622 | {"Hot Contacts","Heisse Kontakte" }, | 622 | {"Hot Contacts","Heisse Kontakte" }, |
623 | {"Hiking","Wandern" }, | 623 | {"Hiking","Wandern" }, |
624 | {"Hunting","Jagen" }, | 624 | {"Hunting","Jagen" }, |
625 | {"Key Customer","Wichtiger Kunde" }, | 625 | {"Key Customer","Wichtiger Kunde" }, |
626 | {"Kids","Kinder" }, | 626 | {"Kids","Kinder" }, |
627 | {"Lunch","Mittagessen" }, | 627 | {"Lunch","Mittagessen" }, |
628 | {"Meeting","Treffen" }, | 628 | {"Meeting","Treffen" }, |
629 | {"Miscellaneous","Verschiedenes" }, | 629 | {"Miscellaneous","Verschiedenes" }, |
630 | {"Partner","Partner" }, | 630 | {"Partner","Partner" }, |
631 | {"Party","Partie" }, | 631 | {"Party","Partie" }, |
632 | {"Personal","Privat" }, | 632 | {"Personal","Privat" }, |
633 | {"Personal Travel","Privatreise"}, | 633 | {"Personal Travel","Privatreise"}, |
634 | {"PHB","PHB" }, | 634 | {"PHB","PHB" }, |
635 | {"Phone Calls","Telefonanruf" }, | 635 | {"Phone Calls","Telefonanruf" }, |
636 | {"Projects","Projekt" }, | 636 | {"Projects","Projekt" }, |
637 | {"Recurring","Wiederholend" }, | 637 | {"Recurring","Wiederholend" }, |
638 | {"School","Schule" }, | 638 | {"School","Schule" }, |
639 | {"Shopping","Einkaufen" }, | 639 | {"Shopping","Einkaufen" }, |
640 | {"Speach","Rede" }, | 640 | {"Speach","Rede" }, |
641 | {"Special Occasion","Spez.Gelegenheit" }, | 641 | {"Special Occasion","Spez.Gelegenheit" }, |
642 | {"Sports","Sport" }, | 642 | {"Sports","Sport" }, |
643 | {"Talk","Vortrag" }, | 643 | {"Talk","Vortrag" }, |
644 | {"Travel","Reise" }, | 644 | {"Travel","Reise" }, |
645 | {"TV","TV" }, | 645 | {"TV","TV" }, |
646 | {"Germany","Deutschland" }, | 646 | {"Germany","Deutschland" }, |
647 | {"Sweden","Schweden" }, | 647 | {"Sweden","Schweden" }, |
648 | {"Forest","Wald" }, | 648 | {"Forest","Wald" }, |
649 | { "Desert","Wüste" }, | 649 | { "Desert","Wüste" }, |
650 | { "Kitchen","Küche" }, | 650 | { "Kitchen","Küche" }, |
651 | { "Lake","See" }, | 651 | { "Lake","See" }, |
652 | {"University","Universität"}, | 652 | {"University","Universität"}, |
653 | {"Vacation","Urlaub" }, | 653 | {"Vacation","Urlaub" }, |
654 | {"VIP","VIP" }, | 654 | {"VIP","VIP" }, |
655 | { "Import Sharp Calendar","Importiere Sharp Kalender" }, | 655 | { "Import Sharp Calendar","Importiere Sharp Kalender" }, |
656 | { "This todo has been cancelled!","Dieses Todo wurde gecancelt!" }, | 656 | { "This todo has been cancelled!","Dieses Todo wurde gecancelt!" }, |
657 | { "This event has been cancelled!","Dieser Termin wurde gecancelt!" }, | 657 | { "This event has been cancelled!","Dieser Termin wurde gecancelt!" }, |
658 | { "Cancelled","Gecancelt" }, | 658 | { "Cancelled","Gecancelt" }, |
659 | { "Multiple sync","Mehrfach Sync" }, | 659 | { "Multiple sync","Mehrfach Sync" }, |
660 | { "Local file","Lokale Datei" }, | 660 | { "Local file","Lokale Datei" }, |
661 | { "Last file","Letzte Datei" }, | 661 | { "Last file","Letzte Datei" }, |
662 | { "Keys + Colors...","Tasten + Farben..." }, | 662 | { "Keys + Colors...","Tasten + Farben..." }, |
663 | { "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" }, | 663 | { "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" }, |
664 | { "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" }, | 664 | { "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" }, |
665 | { "Choose...","Wähle..." }, | 665 | { "Choose...","Wähle..." }, |
666 | { "Use colors for application:","Setze Farben für Programm:" }, | 666 | { "Use colors for application:","Setze Farben für Programm:" }, |
667 | { "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" }, | 667 | { "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" }, |
668 | { "Frames, labels, etc.:","Rahmen, Label, etc.:" }, | 668 | { "Frames, labels, etc.:","Rahmen, Label, etc.:" }, |
669 | { "Show parent To-Do's in What's Next view","Zeige Ober-Todo in What's Next Anz." }, | 669 | { "Show parent To-Do's in What's Next view","Zeige Ober-Todo in What's Next Anz." }, |
670 | { "Show location in What's Next view","Zeige Ort in What's Next Anz." }, | 670 | { "Show location in What's Next view","Zeige Ort in What's Next Anz." }, |
671 | { "Show events that recur ","Zeige Termine, die sich wiederholen:" }, | 671 | { "Show events that recur ","Zeige Termine, die sich wiederholen:" }, |
672 | { "Show in every cell ","Zeige in jeder Zelle " }, | 672 | { "Show in every cell ","Zeige in jeder Zelle " }, |
673 | { "short month","kurzen Monat" }, | 673 | { "short month","kurzen Monat" }, |
674 | { "icons","Icons" }, | 674 | { "icons","Icons" }, |
675 | { "Show Sat/Sun together","Zeige Sam/Son zusammen" }, | 675 | { "Show Sat/Sun together","Zeige Sam/Son zusammen" }, |
676 | { "Categorie colors are applied to text","Kategorie Farben färben Text" }, | 676 | { "Categorie colors are applied to text","Kategorie Farben färben Text" }, |
677 | { "Month view uses day colors","Monatsansicht zeigt Tagesfarben" }, | 677 | { "Month view uses day colors","Monatsansicht zeigt Tagesfarben" }, |
678 | { "Day color odd months","Tagesfarbe ungerade Monate" }, | 678 | { "Day color odd months","Tagesfarbe ungerade Monate" }, |
679 | { "Day color even months","Tagesfarbe gerade Monate" }, | 679 | { "Day color even months","Tagesfarbe gerade Monate" }, |
680 | { "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" }, | 680 | { "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" }, |
681 | { "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" }, | 681 | { "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" }, |
682 | { "Small To-do view uses smaller font","Kleine To-do Ansicht nutzt kleineren Font" }, | 682 | { "Small To-do view uses smaller font","Kleine To-do Ansicht nutzt kleineren Font" }, |
683 | { "Colors are applied to text","Farben werden auf Text angewendet" }, | 683 | { "Colors are applied to text","Farben werden auf Text angewendet" }, |
684 | { "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" }, | 684 | { "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" }, |
685 | { "Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n","Achtung: KO/Pi muß ausgeführt werden damit die Benachrichtigung funktioniert. Empfehlung für Zaurus: Diese Option nicht wählen und KO/Pi Alarm Applet installieren.\n" }, | 685 | { "Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n","Achtung: KO/Pi muß ausgeführt werden damit die Benachrichtigung funktioniert. Empfehlung für Zaurus: Diese Option nicht wählen und KO/Pi Alarm Applet installieren.\n" }, |
686 | { "Play beeps count:","Anzahl der Alarmpiepse: " }, | 686 | { "Play beeps count:","Anzahl der Alarmpiepse: " }, |
687 | { "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " }, | 687 | { "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " }, |
688 | { "Default suspend time in min:","Standard Supendierungs Zeit: " }, | 688 | { "Default suspend time in min:","Standard Supendierungs Zeit: " }, |
689 | { "Auto suspend count:","Anzahl der auto Suspendierungen" }, | 689 | { "Auto suspend count:","Anzahl der auto Suspendierungen" }, |
690 | { "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" }, | 690 | { "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" }, |
691 | { "New profile","Neues Profil" }, | 691 | { "New profile","Neues Profil" }, |
692 | { "Clone profile","Klone Profil" }, | 692 | { "Clone profile","Klone Profil" }, |
693 | { "Delete profile","Lösche Profil" }, | 693 | { "Delete profile","Lösche Profil" }, |
694 | { "Profile:","Profil:" }, | 694 | { "Profile:","Profil:" }, |
695 | { "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, | 695 | { "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, |
696 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, | 696 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, |
697 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, | 697 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, |
698 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, | 698 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, |
699 | { "Write back file","Schreibe Datei zurück" }, | 699 | { "Write back file","Schreibe Datei zurück" }, |
700 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, | 700 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, |
701 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, | 701 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, |
702 | { "Local device name:","Name dieses Gerätes:" }, | 702 | { "Local device name:","Name dieses Gerätes:" }, |
703 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, | 703 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, |
704 | { "Sync preferences","Synchronisations Einstellungen" }, | 704 | { "Sync preferences","Synchronisations Einstellungen" }, |
705 | { "Profile kind","Profil Art" }, | 705 | { "Profile kind","Profil Art" }, |
706 | { "Local file","Lokale Datei" }, | 706 | { "Local file","Lokale Datei" }, |
707 | { "Local file:","Lokale Datei:" }, | 707 | { "Local file:","Lokale Datei:" }, |
708 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, | 708 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, |
709 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, | 709 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, |
710 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, | 710 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, |
711 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, | 711 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, |
712 | { "Device","Gerät:" }, | 712 | { "Device","Gerät:" }, |
713 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, | 713 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, |
714 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, | 714 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, |
715 | { "Synchronization successful","Synchronisation erfolgreich" }, | 715 | { "Synchronization successful","Synchronisation erfolgreich" }, |
716 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, | 716 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, |
717 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, | 717 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, |
718 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, | 718 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, |
719 | { "Enter password","Passwort eingeben" }, | 719 | { "Enter password","Passwort eingeben" }, |
720 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, | 720 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, |
721 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, | 721 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, |
722 | { "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, | 722 | { "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, |
723 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, | 723 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, |
724 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, | 724 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, |
725 | { "Edit Calendar Filters","Editiere Kalendar Filter" }, | 725 | { "Edit Calendar Filters","Editiere Kalendar Filter" }, |
726 | { "Enter filter name:","Neuer Filter Name:" }, | 726 | { "Enter filter name:","Neuer Filter Name:" }, |
727 | { "Add Filter","Filter hinzufügen" }, | 727 | { "Add Filter","Filter hinzufügen" }, |
728 | { "Question","Frage" }, | 728 | { "Question","Frage" }, |
729 | { "Filter position: ","Filter Position: " }, | 729 | { "Filter position: ","Filter Position: " }, |
730 | { "Month View","Monatsansicht" }, | 730 | { "Month View","Monatsansicht" }, |
731 | { "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" }, | 731 | { "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" }, |
732 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, | 732 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, |
733 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, | 733 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, |
734 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" }, | 734 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" }, |
735 | { "Access: ","Zugriff: " }, | 735 | { "Access: ","Zugriff: " }, |
736 | { "Needs Action","Aktion notwendig" }, | 736 | { "Needs Action","Aktion notwendig" }, |
737 | { "Accepted","Akzeptiert" }, | 737 | { "Accepted","Akzeptiert" }, |
738 | { "Declined","Abgelehnt" }, | 738 | { "Declined","Abgelehnt" }, |
739 | { "Tentative","Vorläufig" }, | 739 | { "Tentative","Vorläufig" }, |
740 | { "Delegated","Beauftragt" }, | 740 | { "Delegated","Beauftragt" }, |
741 | { "Completed","Vollständig" }, | 741 | { "Completed","Vollständig" }, |
742 | { "In Process","In Bearbeitung" }, | 742 | { "In Process","In Bearbeitung" }, |
743 | { "Participant","Teilnehmer" }, | 743 | { "Participant","Teilnehmer" }, |
744 | { "Optional Participant","Möglicher Teilnehmer" }, | 744 | { "Optional Participant","Möglicher Teilnehmer" }, |
745 | { "Observer","Beobachter" }, | 745 | { "Observer","Beobachter" }, |
746 | { "Chair","Vorsitzender" }, | 746 | { "Chair","Vorsitzender" }, |
747 | { "Not supported \non desktop!\n","" }, | 747 | { "Not supported \non desktop!\n","" }, |
748 | { "Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. ","Es ist nichts selektiert!\nDieses druckt die volle Breite der Agenda View, so wie man sie sieht.\nUm die verticale Auswahl zum Drucken zu bestimmen,\nbitte einen verticalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen. " }, | 748 | { "Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. ","Es ist nichts selektiert!\nDieses druckt die volle Breite der Agenda View, so wie man sie sieht.\nUm die verticale Auswahl zum Drucken zu bestimmen,\nbitte einen verticalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen. " }, |
749 | { "Date range: ","Datums Zeitspanne: " }, | 749 | { "Date range: ","Datums Zeitspanne: " }, |
750 | { "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " }, | 750 | { "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " }, |
751 | { "Syncing - close to abort!","Syncing-schließe um abzubrechen." }, | 751 | { "Syncing - close to abort!","Syncing-schließe um abzubrechen." }, |
752 | { "Add / remove events","Add./entferne Termine" }, | 752 | { "Add / remove events","Add./entferne Termine" }, |
753 | { "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." }, | 753 | { "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." }, |
754 | { "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." }, | 754 | { "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." }, |
755 | { "\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie gepeicherte Datei wurde verändert!\nDatei Grösse: %1 Bytes.\nZuletzt geändert: %2\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, | 755 | { "\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie gepeicherte Datei wurde verändert!\nDatei Grösse: %1 Bytes.\nZuletzt geändert: %2\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, |
756 | { "Overwrite","Überschreiben" }, | 756 | { "Overwrite","Überschreiben" }, |
757 | { "Sync+save","Syncen+speichern" }, | 757 | { "Sync+save","Syncen+speichern" }, |
758 | { "Default","Standard" }, | 758 | { "Default","Standard" }, |
759 | { " Categories added to list! "," Kategorien zur Liste hinzugefügt! " }, | 759 | { " Categories added to list! "," Kategorien zur Liste hinzugefügt! " }, |
760 | { " %d items?"," %d Einträge?" }, | 760 | { " %d items?"," %d Einträge?" }, |
761 | { "\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?","\nDieses ist ein\nwiederholender Termin!.\nSind Sie sicher, dass Sie\ndiesen Termin und alle\nWiederholungen löschen möchten?" }, | 761 | { "\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?","\nDieses ist ein\nwiederholender Termin!.\nSind Sie sicher, dass Sie\ndiesen Termin und alle\nWiederholungen löschen möchten?" }, |
762 | { " ?\n\nDelete:\n"," ?\n\nLösche:\n" }, | 762 | { " ?\n\nDelete:\n"," ?\n\nLösche:\n" }, |
763 | { "Current","Aktuelle" }, | 763 | { "Current","Aktuelle" }, |
764 | { "\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n","\nDieses ist ein\nwiederholender Termin!\nMöchten sie alle Wiederholungen\nlöschen, oder nur die aktuelle am:\n" }, | 764 | { "\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n","\nDieses ist ein\nwiederholender Termin!\nMöchten sie alle Wiederholungen\nlöschen, oder nur die aktuelle am:\n" }, |
765 | { "All","Alle" }, | 765 | { "All","Alle" }, |
766 | { "Data Loss Warning","Datenverlust Warnung" }, | 766 | { "Data Loss Warning","Datenverlust Warnung" }, |
767 | { "Proceed","Weitermachen" }, | 767 | { "Proceed","Weitermachen" }, |
768 | { "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" }, | 768 | { "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" }, |
769 | { "Filter disabled ","Filter abgeschaltet" }, | 769 | { "Filter disabled ","Filter abgeschaltet" }, |
770 | { "Filter selected: ","Gewählter Filter: " }, | 770 | { "Filter selected: ","Gewählter Filter: " }, |
771 | { "Toggle Cancel","Gecancelt ändern" }, | 771 | { "Toggle Cancel","Gecancelt ändern" }, |
772 | { "&Toggle Cancel","Gecancel&t ändern" }, | 772 | { "&Toggle Cancel","Gecancel&t ändern" }, |
773 | { "Configure Toolbar","Konfiguriere Toolbar" }, | 773 | { "Configure Toolbar","Konfiguriere Toolbar" }, |
774 | { "Stretched TB","Gedehnte TB" }, | 774 | { "Stretched TB","Gedehnte TB" }, |
775 | { "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" }, | 775 | { "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" }, |
776 | { "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" }, | 776 | { "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" }, |
777 | { "When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing","Wenn ein Kalender doppelt importiert\nwird, werden doppelte Einträge ignoriert!\nSie können eine Backup Datei anlegen unter\nDatei - Speichere Kalender Backup\num den Import rückgängig machen zu können.\n" }, | 777 | { "When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing","Wenn ein Kalender doppelt importiert\nwird, werden doppelte Einträge ignoriert!\nSie können eine Backup Datei anlegen unter\nDatei - Speichere Kalender Backup\num den Import rückgängig machen zu können.\n" }, |
778 | { "Not supported \non desktop!\n","Nur verfügbar auf PDA!" }, | 778 | { "Not supported \non desktop!\n","Nur verfügbar auf PDA!" }, |
779 | { "Imported file successfully","Datei erfolgreich importiert" }, | 779 | { "Imported file successfully","Datei erfolgreich importiert" }, |
780 | { "Error importing file","Fehler beim Importieren der Datei" }, | 780 | { "Error importing file","Fehler beim Importieren der Datei" }, |
781 | { "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, | 781 | { "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, |
782 | { "Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n","Zu speichernde Datei\existiert bereits!\nExist. Datei vom:\n%1\nÜberschreiben?\n" }, | 782 | { "Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n","Zu speichernde Datei\existiert bereits!\nExist. Datei vom:\n%1\nÜberschreiben?\n" }, |
783 | { "Overwrite!","Überschreiben!" }, | 783 | { "Overwrite!","Überschreiben!" }, |
784 | { "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n","Import Datei \n...%1\nvom:\n%2\nDuplizierte Einträge\nwerden nicht importiert!\n" }, | 784 | { "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n","Import Datei \n...%1\nvom:\n%2\nDuplizierte Einträge\nwerden nicht importiert!\n" }, |
785 | { "Load backup filename","Lade Backup Dateiname" }, | 785 | { "Load backup filename","Lade Backup Dateiname" }, |
786 | { "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" }, | 786 | { "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" }, |
787 | { "KO/Pi:Loaded %1","KO/Pi:Geladen %1" }, | 787 | { "KO/Pi:Loaded %1","KO/Pi:Geladen %1" }, |
788 | { "Save backup filename","Speichere Backup Dateiname" }, | 788 | { "Save backup filename","Speichere Backup Dateiname" }, |
789 | { "Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n","Backup Datei\nexistiert bereits!\nAlte Backup Datei vom:\n%1\nÜberschreiben?\n" }, | 789 | { "Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n","Backup Datei\nexistiert bereits!\nAlte Backup Datei vom:\n%1\nÜberschreiben?\n" }, |
790 | { "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, | 790 | { "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, |
791 | { "Details of attendee","Teilnehmerdetails" }, | 791 | { "Details of attendee","Teilnehmerdetails" }, |
792 | { "Work phone:\n","Telefon Arbeit:\n" }, | 792 | { "Work phone:\n","Telefon Arbeit:\n" }, |
793 | { "Work mobile phone:\n","Mobiltelefon Arbeit:\n" }, | 793 | { "Work mobile phone:\n","Mobiltelefon Arbeit:\n" }, |
794 | { "Home phone:\n","Telefon privat:\n" }, | 794 | { "Home phone:\n","Telefon privat:\n" }, |
795 | { "Mobile home phone:\n","Mobiltelefon privat:\n" }, | 795 | { "Mobile home phone:\n","Mobiltelefon privat:\n" }, |
796 | { "Email:\n","Email:\n" }, | 796 | { "Email:\n","Email:\n" }, |
797 | { "Alarm disabled for this item","Alarm deaktiviert für dieses Item" }, | 797 | { "Alarm disabled for this item","Alarm deaktiviert für dieses Item" }, |
798 | { "Audio Al.: ","Audio Al.: " }, | 798 | { "Audio Al.: ","Audio Al.: " }, |
799 | { "Proc.Al.: ","Proz.Al.: " }, | 799 | { "Proc.Al.: ","Proz.Al.: " }, |
800 | { "No sound set","Kein Sound definiert" }, | 800 | { "No sound set","Kein Sound definiert" }, |
801 | { "*.wav|Wav Files","*.wav|Wav Dateien" }, | 801 | { "*.wav|Wav Files","*.wav|Wav Dateien" }, |
802 | { "No program set","Kein Programm definiert" }, | 802 | { "No program set","Kein Programm definiert" }, |
803 | { "Running '%1'","Ausführen '%1'" }, | 803 | { "Running '%1'","Ausführen '%1'" }, |
804 | { "Playing '%1'","Abspielen '%1'" }, | 804 | { "Playing '%1'","Abspielen '%1'" }, |
805 | { "Show Sync Events in WN/Agenda view","Zeige Sync Events in WN/Agenda Ansicht" }, | 805 | { "Show Sync Events in WN/Agenda view","Zeige Sync Events in WN/Agenda Ansicht" }, |
806 | { "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" }, | 806 | { "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" }, |
807 | { "Load!","Laden!" }, | 807 | { "Load!","Laden!" }, |
808 | { "Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n","Backup Datei vom:\n%1\nDas Laden der Backup Datei\nlöscht die aktuellen Daten!\n" }, | 808 | { "Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n","Backup Datei vom:\n%1\nDas Laden der Backup Datei\nlöscht die aktuellen Daten!\n" }, |
809 | { "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" }, | 809 | { "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" }, |
810 | { "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" }, | 810 | { "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" }, |
811 | { "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" }, | 811 | { "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" }, |
812 | { "Features + hints...","Eigenschaften + Tipps..." }, | 812 | { "Features + hints...","Eigenschaften + Tipps..." }, |
813 | { "User translation...","Benutzer Übersetzung..." }, | 813 | { "User translation...","Benutzer Übersetzung..." }, |
814 | { "Sync HowTo...","Synchronisation HowTo..." }, | 814 | { "Sync HowTo...","Synchronisation HowTo..." }, |
815 | { "Print calendar...","Drucke Kalender..." }, | 815 | { "Print calendar...","Drucke Kalender..." }, |
816 | { "Anniversary","Jahrestag" }, | 816 | { "Anniversary","Jahrestag" }, |
817 | { "When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n","Wenn Geburtstage mehrfach importiert\nwerden, werden doppelte Einträge ignoriert\nwenn sie nicht verändert wurden.\n" }, | 817 | { "When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n","Wenn Geburtstage mehrfach importiert\nwerden, werden doppelte Einträge ignoriert\nwenn sie nicht verändert wurden.\n" }, |
818 | { "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" }, | 818 | { "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" }, |
819 | { "Next recurrence is on: ","Nächste Wiederholung ist am:" }, | 819 | { "Next recurrence is on: ","Nächste Wiederholung ist am:" }, |
820 | { "<b>Alarm on: </b>","<b>Alarm am: </b>" }, | 820 | { "<b>Alarm on: </b>","<b>Alarm am: </b>" }, |
821 | { "<b>Access: </b>","<b>Zugriff: </b>" }, | 821 | { "<b>Access: </b>","<b>Zugriff: </b>" }, |
822 | { "(%1 min before)","(%1 min vorher)" }, | 822 | { "(%1 min before)","(%1 min vorher)" }, |
823 | { "<b>Categories: </b>","<b>Kategorien: </b>" }, | 823 | { "<b>Categories: </b>","<b>Kategorien: </b>" }, |
824 | { "Save Journal/Description...","Speichere Journal/Details..." }, | 824 | { "Save Journal/Description...","Speichere Journal/Details..." }, |
825 | { "This saves the text/details of selected\nJournals and Events/Todos\nto a text file.","Das speichert den Text bzw.\ndie Details von selektierten\nJournalen und Events/Todos\nin eine Textdatei." }, | 825 | { "This saves the text/details of selected\nJournals and Events/Todos\nto a text file.","Das speichert den Text bzw.\ndie Details von selektierten\nJournalen und Events/Todos\nin eine Textdatei." }, |
826 | { "Continue","Weitermachen" }, | 826 | { "Continue","Weitermachen" }, |
827 | { " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" }, | 827 | { " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" }, |
828 | { "Attendee:","Teilnehmer:" }, | 828 | { "Attendee:","Teilnehmer:" }, |
829 | { "Click OK to search ->","Klicke zum Suchen auf OK ->" }, | 829 | { "Click OK to search ->","Klicke zum Suchen auf OK ->" }, |
830 | { "On day ","Am Tag " }, | 830 | { "On day ","Am Tag " }, |
831 | { "%1 of ","%1 des Monats" }, | 831 | { "%1 of ","%1 des Monats" }, |
832 | { "%1 of the year","%1 des Jahres" }, | 832 | { "%1 of the year","%1 des Jahres" }, |
833 | { "Anonymous","Anonymo" }, | 833 | { "Anonymous","Anonymo" }, |
834 | { "nobody@nowhere","niemand@nirgendwo" }, | 834 | { "nobody@nowhere","niemand@nirgendwo" }, |
835 | { "calendar.html","calendar.html" }, | 835 | { "calendar.html","calendar.html" }, |
836 | { " Local Time"," Locale Zeit" }, | 836 | { " Local Time"," Locale Zeit" }, |
837 | { "Unknown Name","Unbekannter Name" }, | 837 | { "Unknown Name","Unbekannter Name" }, |
838 | { "unknown@nowhere","unbekannt@nirgendwo" }, | 838 | { "unknown@nowhere","unbekannt@nirgendwo" }, |
839 | { "Beam via IR!","Beam via IR!" }, | 839 | { "Beam via IR!","Beam via IR!" }, |
840 | { "Next Month","Nächster Monat" }, | 840 | { "Next Month","Nächster Monat" }, |
841 | { "Prio","Prio" }, | 841 | { "Prio","Prio" }, |
842 | { "Reparent Todo","Mache Sub-Todo" }, | 842 | { "Reparent Todo","Mache Sub-Todo" }, |
843 | { "tomorrow","morgen" }, | 843 | { "tomorrow","morgen" }, |
844 | { "today","heute" }, | 844 | { "today","heute" }, |
845 | { "yesterday","gestern" }, | 845 | { "yesterday","gestern" }, |
846 | { "Ok","Ok" }, | 846 | { "Ok","Ok" }, |
847 | { "Ok+Agenda","Ok+Agenda" }, | 847 | { "Ok+Agenda","Ok+Agenda" }, |
848 | { "Email","Email" }, | 848 | { "Email","Email" }, |
849 | { "RSVP","RSVP" }, | 849 | { "RSVP","RSVP" }, |
850 | { "Email:","Email:" }, | 850 | { "Email:","Email:" }, |
851 | { "Appointment Time ","Termin Zeit " }, | 851 | { "Appointment Time ","Termin Zeit " }, |
852 | { "2","2" }, | 852 | { "2","2" }, |
853 | { "3","3" }, | 853 | { "3","3" }, |
854 | { "4","4" }, | 854 | { "4","4" }, |
855 | { " 0 %"," 0 %" }, | 855 | { " 0 %"," 0 %" }, |
856 | { " 20 %"," 20 %" }, | 856 | { " 20 %"," 20 %" }, |
857 | { " 40 %"," 40 %" }, | 857 | { " 40 %"," 40 %" }, |
858 | { " 60 %"," 60 %" }, | 858 | { " 60 %"," 60 %" }, |
859 | { " 80 %"," 80 %" }, | 859 | { " 80 %"," 80 %" }, |
860 | { "100 %","100 %" }, | 860 | { "100 %","100 %" }, |
861 | { "Filter","Filter" }, | 861 | { "Filter","Filter" }, |
862 | { "Configure","Konfiguriere" }, | 862 | { "Configure","Konfiguriere" }, |
863 | { "What's Next","What's Next" }, | 863 | { "What's Next","What's Next" }, |
864 | { "Complete calendar...","Kompletten Kalender..." }, | 864 | { "Complete calendar...","Kompletten Kalender..." }, |
865 | { "Filtered calendar...","Gefilterten Kalender..." }, | 865 | { "Filtered calendar...","Gefilterten Kalender..." }, |
866 | { "Export to phone","Exportiere zum Handy" }, | 866 | { "Export to phone","Exportiere zum Handy" }, |
867 | { "Beam receive enabled","Beam Empfang an" }, | 867 | { "Beam receive enabled","Beam Empfang an" }, |
868 | { "What's new?","Was ist neu?" }, | 868 | { "What's new?","Was ist neu?" }, |
869 | { "FAQ...","FAQ..." }, | 869 | { "FAQ...","FAQ..." }, |
870 | { "Licence...","Licence..." }, | 870 | { "Licence...","Licence..." }, |
871 | { "What's This?","What's This?" }, | 871 | { "What's This?","What's This?" }, |
872 | { "&Edit...","&Editiere..." }, | 872 | { "&Edit...","&Editiere..." }, |
873 | { "Oktober","Oktober" }, | 873 | { "Oktober","Oktober" }, |
874 | { "Title","Titel" }, | 874 | { "Title","Titel" }, |
875 | { "%1 %","%1 %" }, | 875 | { "%1 %","%1 %" }, |
876 | { "Enable Pi-Sync","Schalte Pi-Sync an" }, | 876 | { "Enable Pi-Sync","Schalte Pi-Sync an" }, |
877 | { "Import!","Importiere!" }, | 877 | { "Import!","Importiere!" }, |
878 | { "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" }, | 878 | { "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" }, |
879 | { "Export to phone options","Export ans Handy Optionen" }, | 879 | { "Export to phone options","Export ans Handy Optionen" }, |
880 | { "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, | 880 | { "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, |
881 | { "I/O device: ","I/O device: " }, | 881 | { "I/O device: ","I/O device: " }, |
882 | { "Connection: ","Connection: " }, | 882 | { "Connection: ","Connection: " }, |
883 | { "Model(opt.): ","Model(opt.): " }, | 883 | { "Model(opt.): ","Model(opt.): " }, |
884 | { "Write back events in future only","Schreibe nur zukünftige Termine zurück" }, | 884 | { "Write back events in future only","Schreibe nur zukünftige Termine zurück" }, |
885 | { "Max. weeks in future: ","Max. Wochen in der Zukunft: " }, | 885 | { "Max. weeks in future: ","Max. Wochen in der Zukunft: " }, |
886 | { "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nToDo/Kalender Daten auf dem Handy!" }, | 886 | { "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nToDo/Kalender Daten auf dem Handy!" }, |
887 | { "Export to mobile phone!","Exportiere auf das Handy!" }, | 887 | { "Export to mobile phone!","Exportiere auf das Handy!" }, |
888 | { "Export complete calendar","Exportiere kompletten Kalender" }, | 888 | { "Export complete calendar","Exportiere kompletten Kalender" }, |
889 | { "Writing to phone...","Sende Daten ans Handy..." }, | 889 | { "Writing to phone...","Sende Daten ans Handy..." }, |
890 | { " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, | 890 | { " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, |
891 | { "Retry","Nochmal versuchen" }, | 891 | { "Retry","Nochmal versuchen" }, |
892 | { "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, | 892 | { "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, |
893 | { "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, | 893 | { "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, |
894 | { "Error exporting to phone!","Fehler beim Export auf das Handy!" }, | 894 | { "Error exporting to phone!","Fehler beim Export auf das Handy!" }, |
895 | { "Export filtered calendar","Exportiere gefilterten Kalender" }, | 895 | { "Export filtered calendar","Exportiere gefilterten Kalender" }, |
896 | { "Preferences","Vorlieben" }, | 896 | { "Preferences","Vorlieben" }, |
897 | { "Global","Global" }, | 897 | { "Global","Global" }, |
898 | { "Phone","Phone" }, | 898 | { "Phone","Phone" }, |
899 | { "SMS","SMS" }, | 899 | { "SMS","SMS" }, |
900 | { "Fax","Fax" }, | 900 | { "Fax","Fax" }, |
901 | { "Pager","Pager" }, | 901 | { "Pager","Pager" }, |
902 | { "SIP","SIP" }, | 902 | { "SIP","SIP" }, |
903 | { "Italian","Italienisch" }, | 903 | { "Italian","Italienisch" }, |
904 | { "24:00","24:00" }, | 904 | { "24:00","24:00" }, |
905 | { "12:00am","12:00am" }, | 905 | { "12:00am","12:00am" }, |
906 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, | 906 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, |
907 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, | 907 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, |
908 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, | 908 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, |
909 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, | 909 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, |
910 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, | 910 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, |
911 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, | 911 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, |
912 | { "Used Mail Client","Benutzter Mail Client" }, | 912 | { "Used Mail Client","Benutzter Mail Client" }, |
913 | { "Channel:","Channel:" }, | 913 | { "Channel:","Channel:" }, |
914 | { "Message:","Message:" }, | 914 | { "Message:","Message:" }, |
915 | { "Parameters:","Parameter:" }, | 915 | { "Parameters:","Parameter:" }, |
916 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, | 916 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, |
917 | { "extra Message:","extra Message:" }, | 917 | { "extra Message:","extra Message:" }, |
918 | { "extra Parameters:","extra Parameter:" }, | 918 | { "extra Parameters:","extra Parameter:" }, |
919 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, | 919 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, |
920 | { "External Apps.","Externe Appl." }, | 920 | { "External Apps.","Externe Appl." }, |
921 | { "24 hours","24 Std." }, | 921 | { "24 hours","24 Std." }, |
922 | { "3 hours","3 Std." }, | 922 | { "3 hours","3 Std." }, |
923 | { "1 hour","1 Std." }, | 923 | { "1 hour","1 Std." }, |
924 | { "15 minutes","15 Min." }, | 924 | { "15 minutes","15 Min." }, |
925 | { "5 minutes","5 Min." }, | 925 | { "5 minutes","5 Min." }, |
926 | { "1 minute","1 Min." }, | 926 | { "1 minute","1 Min." }, |
927 | { "23","23" }, | 927 | { "23","23" }, |
928 | { "Mon 15","Mon 15" }, | 928 | { "Mon 15","Mon 15" }, |
929 | { "Configure KO","Konfiguriere KO" }, | 929 | { "Configure KO","Konfiguriere KO" }, |
930 | { "Event text","Termin Text" }, | 930 | { "Event text","Termin Text" }, |
931 | { "ToDo","ToDo" }, | 931 | { "ToDo","ToDo" }, |
932 | { "Today","Heute" }, | 932 | { "Today","Heute" }, |
933 | { "What's Next View","What's Next Ansicht" }, | 933 | { "What's Next View","What's Next Ansicht" }, |
934 | { "Show Sync Events in \nWhat's Next/Agenda view","Zeige Sync Termine in \nWhat's Next/Agenda view" }, | 934 | { "Show Sync Events in \nWhat's Next/Agenda view","Zeige Sync Termine in \nWhat's Next/Agenda view" }, |
935 | { "Use short date in \nWhat's Next/Event view","Zeige Kurzdatum in \nWhat's Next/Event view" }, | 935 | { "Use short date in \nWhat's Next/Event view","Zeige Kurzdatum in \nWhat's Next/Event view" }, |
936 | { "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" }, | 936 | { "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" }, |
937 | { "Alarm","Alarm" }, | 937 | { "Alarm","Alarm" }, |
938 | { "Used %1 Client","Benutzter %1 Client" }, | 938 | { "Used %1 Client","Benutzter %1 Client" }, |
939 | { "No email client installed","Kein Email Klient installiert" }, | 939 | { "No email client installed","Kein Email Klient installiert" }, |
940 | { "Userdefined email client","Benutzerdef. Email Klient" }, | 940 | { "Userdefined email client","Benutzerdef. Email Klient" }, |
941 | { "OM/Pi email client","OM/Pi Email Klient" }, | 941 | { "OM/Pi email client","OM/Pi Email Klient" }, |
942 | { "Include in multiple ","Beziehe in multiple " }, | 942 | { "Include in multiple ","Beziehe in multiple " }, |
943 | { "calendar ","Kalender " }, | 943 | { "calendar ","Kalender " }, |
944 | { "addressbook ","Adressbuch " }, | 944 | { "addressbook ","Adressbuch " }, |
945 | { "pwmanager","PWmanager" }, | 945 | { "pwmanager","PWmanager" }, |
946 | { " sync"," Sync ein" }, | 946 | { " sync"," Sync ein" }, |
947 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, | 947 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, |
948 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, | 948 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, |
949 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, | 949 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, |
950 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, | 950 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, |
951 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, | 951 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, |
952 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, | 952 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, |
953 | { "Help...","Hilfe..." }, | 953 | { "Help...","Hilfe..." }, |
954 | { "Local file Cal:","Lokale Datei Kal:" }, | 954 | { "Local file Cal:","Lokale Datei Kal:" }, |
955 | { "Local file ABook:","Lokale Datei ABuch:" }, | 955 | { "Local file ABook:","Lokale Datei ABuch:" }, |
956 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, | 956 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, |
957 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, | 957 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, |
958 | { "Calendar:","Kalender:" }, | 958 | { "Calendar:","Kalender:" }, |
959 | { "AddressBook:","AdressBuch:" }, | 959 | { "AddressBook:","AdressBuch:" }, |
960 | { "PWManager:","PWManager:" }, | 960 | { "PWManager:","PWManager:" }, |
961 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, | 961 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, |
962 | { "ssh/scp","ssh/scp" }, | 962 | { "ssh/scp","ssh/scp" }, |
963 | { "ftp","ftp" }, | 963 | { "ftp","ftp" }, |
964 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, | 964 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, |
965 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, | 965 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, |
966 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, | 966 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, |
967 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, | 967 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, |
968 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, | 968 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, |
969 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, | 969 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, |
970 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, | 970 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, |
971 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, | 971 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, |
972 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, | 972 | { "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, |
973 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, | 973 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, |
974 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, | 974 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, |
975 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, | 975 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, |
976 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, | 976 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, |
977 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, | 977 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, |
978 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, | 978 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, |
979 | { "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen \"Multi-Syncen\"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, | 979 | { "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen \"Multi-Syncen\"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, |
980 | { "KDE-Pim Sync","KDE-Pim Sync" }, | 980 | { "KDE-Pim Sync","KDE-Pim Sync" }, |
981 | { "Multiple profiles","Multi-Sync Profile" }, | 981 | { "Multiple profiles","Multi-Sync Profile" }, |
982 | { "Device: ","Gerät: " }, | 982 | { "Device: ","Gerät: " }, |
983 | { "Multiple sync started.","Multi-Sync gestartet." }, | 983 | { "Multiple sync started.","Multi-Sync gestartet." }, |
984 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, | 984 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, |
985 | { "Turn filter on","Schalte Filter an" }, | 985 | { "Turn filter on","Schalte Filter an" }, |
986 | { "Turn filter off","Schalte Filter aus" }, | 986 | { "Turn filter off","Schalte Filter aus" }, |
987 | { "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, | 987 | { "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, |
988 | { "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, | 988 | { "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, |
989 | { "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, | 989 | { "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, |
990 | { "<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n","<p><b>Schwarz</b>: Termin/Todo mit Teilnehmern. Sie sind der Organisator!</p>\n" }, | 990 | { "<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n","<p><b>Schwarz</b>: Termin/Todo mit Teilnehmern. Sie sind der Organisator!</p>\n" }, |
991 | { "<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n","<p><b>Dunkelgrün</b>: Information(Beschreibung) verfügbar.([i] in WN Ansicht)</p>\n" }, | 991 | { "<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n","<p><b>Dunkelgrün</b>: Information(Beschreibung) verfügbar.([i] in WN Ansicht)</p>\n" }, |
992 | { "<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n","<p><b>Blau</b>: Wiederholender Termin.([r] in Whats'Next Ansicht)</p>\n" }, | 992 | { "<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n","<p><b>Blau</b>: Wiederholender Termin.([r] in Whats'Next Ansicht)</p>\n" }, |
993 | { "<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n","<p><b>Rot</b>: Alarm gesetzt.([a] in Whats'Next Ansicht)</p>\n" }, | 993 | { "<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n","<p><b>Rot</b>: Alarm gesetzt.([a] in Whats'Next Ansicht)</p>\n" }, |
994 | { "<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n","<p><b>Kreuz</b>: Eintrag gecancelt.([c] in Whats'Next Ansicht)</p>\n" }, | 994 | { "<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n","<p><b>Kreuz</b>: Eintrag gecancelt.([c] in Whats'Next Ansicht)</p>\n" }, |
995 | { "<p><b>(for square icons in agenda and month view)</b></p>\n","<p><b>(für quadratische Icons in Agenda und Monats Ansicht)</b></p>\n" }, | 995 | { "<p><b>(for square icons in agenda and month view)</b></p>\n","<p><b>(für quadratische Icons in Agenda und Monats Ansicht)</b></p>\n" }, |
996 | { "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, | 996 | { "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, |
997 | { "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, | 997 | { "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, |
998 | { "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, | 998 | { "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, |
999 | { "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, | 999 | { "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, |
1000 | { "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, | 1000 | { "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, |
1001 | { "<p><b>shift+up/down</b>: Goto first/last item</p>\n","<p><b>shift+up/down</b>: Gehe zum ersten/letzten Eintrag</p>\n" }, | 1001 | { "<p><b>shift+up/down</b>: Goto first/last item</p>\n","<p><b>shift+up/down</b>: Gehe zum ersten/letzten Eintrag</p>\n" }, |
1002 | { "<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n","<p><b>ctrl+up/down</b>: Gehe hoch/runter 20% aller Einträge</p>\n" }, | 1002 | { "<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n","<p><b>ctrl+up/down</b>: Gehe hoch/runter 20% aller Einträge</p>\n" }, |
1003 | { "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, | 1003 | { "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, |
1004 | { "<p><b>return+shift</b>: Deselect item+one step down</p>\n","<p><b>return+shift</b>: Deselektiere Item+Cursor einen Eintrag runter</p>\n" }, | 1004 | { "<p><b>return+shift</b>: Deselect item+one step down</p>\n","<p><b>return+shift</b>: Deselektiere Item+Cursor einen Eintrag runter</p>\n" }, |
1005 | { "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, | 1005 | { "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, |
1006 | { "<p><b>I</b>: Show info of current item+one step down.</p>\n","<p><b>I</b>: Zeige Detail-Ansicht vom sel.Eintrag+Cursor einen Eintrag runter.</p>\n" }, | 1006 | { "<p><b>I</b>: Show info of current item+one step down.</p>\n","<p><b>I</b>: Zeige Detail-Ansicht vom sel.Eintrag+Cursor einen Eintrag runter.</p>\n" }, |
1007 | { "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, | 1007 | { "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, |
1008 | { "<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n","<p><b>return+shift</b>: Markiere Todo als nicht erledigt+Cursor einen Eintrag runter</p>\n" }, | 1008 | { "<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n","<p><b>return+shift</b>: Markiere Todo als nicht erledigt+Cursor einen Eintrag runter</p>\n" }, |
1009 | { "<p><b>return</b>: Mark item as completed+one step down.</p>\n","<p><b>return</b>: Markiere Todo als erledigt+Cursor einen Eintrag runter.</p>\n" }, | 1009 | { "<p><b>return</b>: Mark item as completed+one step down.</p>\n","<p><b>return</b>: Markiere Todo als erledigt+Cursor einen Eintrag runter.</p>\n" }, |
1010 | { "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, | 1010 | { "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, |
1011 | { "<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n","<p><b>shift+P</b>: Mache Todo zum neuen <b>P</b>arent Todo für das Todo, welches mit shift+Sselektiert wurde.</p>\n" }, | 1011 | { "<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n","<p><b>shift+P</b>: Mache Todo zum neuen <b>P</b>arent Todo für das Todo, welches mit shift+Sselektiert wurde.</p>\n" }, |
1012 | { "<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n","<p><b>shift+S</b>: Mache Todo zum <b>S</b>ubtodo</p>\n" }, | 1012 | { "<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n","<p><b>shift+S</b>: Mache Todo zum <b>S</b>ubtodo</p>\n" }, |
1013 | { "<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n","<p><b>shift+U</b>: <b>U</b>nparent Todo (Mache Sub-Todo zum Toplevel Todo)</p>\n" }, | 1013 | { "<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n","<p><b>shift+U</b>: <b>U</b>nparent Todo (Mache Sub-Todo zum Toplevel Todo)</p>\n" }, |
1014 | { "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, | 1014 | { "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, |
1015 | { "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, | 1015 | { "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, |
1016 | { "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, | 1016 | { "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, |
1017 | { "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, | 1017 | { "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, |
1018 | { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, | 1018 | { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, |
1019 | { "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" }, | 1019 | { "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" }, |
1020 | { "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" }, | 1020 | { "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" }, |
1021 | { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, | 1021 | { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, |
1022 | { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, | 1022 | { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, |
1023 | { "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" }, | 1023 | { "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" }, |
1024 | { "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datenavigator</p>\n" }, | 1024 | { "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datenavigator</p>\n" }, |
1025 | { "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" }, | 1025 | { "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" }, |
1026 | { "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" }, | 1026 | { "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" }, |
1027 | { "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monats Ansicht</p>\n" }, | 1027 | { "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monats Ansicht</p>\n" }, |
1028 | { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochen Ansicht | <b>U</b>: Wochen Ansicht</p>\n" }, | 1028 | { "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochen Ansicht | <b>U</b>: Wochen Ansicht</p>\n" }, |
1029 | { "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" }, | 1029 | { "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" }, |
1030 | { "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht days view| <b>W</b>: What's next Ansicht\n " }, | 1030 | { "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht days view| <b>W</b>: What's next Ansicht\n " }, |
1031 | { "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" }, | 1031 | { "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" }, |
1032 | { "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" }, | 1032 | { "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" }, |
1033 | { "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" }, | 1033 | { "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" }, |
1034 | { "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" }, | 1034 | { "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" }, |
1035 | { "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" }, | 1035 | { "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" }, |
1036 | { "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" }, | 1036 | { "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" }, |
1037 | { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, | 1037 | { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, |
1038 | { "After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" }, | 1038 | { "After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" }, |
1039 | { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, | 1039 | { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, |
1040 | { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, | 1040 | { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, |
1041 | { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, | 1041 | { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, |
1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.net\n" }, | 1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.net\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.net\n" }, |
1043 | { "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" }, | 1043 | { "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" }, |
1044 | { "1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" }, | 1044 | { "1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" }, |
1045 | { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, | 1045 | { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, |
1046 | { "KO/Pi FAQ","KO/Pi FAQ" }, | 1046 | { "KO/Pi FAQ","KO/Pi FAQ" }, |
1047 | { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, | 1047 | { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, |
1048 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, | 1048 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, |
1049 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, | 1049 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, |
1050 | { "From: ","Von: " }, | 1050 | { "From: ","Von: " }, |
1051 | { "Remove sync info","Entferne Sync Info" }, | 1051 | { "Remove sync info","Entferne Sync Info" }, |
1052 | { "For all profiles","Für alle Profile" }, | 1052 | { "For all profiles","Für alle Profile" }, |
1053 | { "Hide not Running","Verstecke nicht Laufende" }, | 1053 | { "Hide not Running","Verstecke nicht Laufende" }, |
1054 | { "ME","ME" }, | 1054 | { "ME","ME" }, |
1055 | { "Toolbar","Toolbar" }, | 1055 | { "Toolbar","Toolbar" }, |
1056 | { "Undo Delete...","Löschen rückgängig machen..." }, | 1056 | { "Undo Delete...","Löschen rückgängig machen..." }, |
1057 | { "Undo Delete","Löschen rückgängig machen" }, | 1057 | { "Undo Delete","Löschen rückgängig machen" }, |
1058 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, | 1058 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, |
1059 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, | 1059 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, |
1060 | { "Januar","Januar" }, | 1060 | { "Januar","Januar" }, |
1061 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, | 1061 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, |
1062 | { "No Filter","Kein Filter" }, | 1062 | { "No Filter","Kein Filter" }, |
1063 | { "Multiple Sync options","Multi Sync Optionen" }, | 1063 | { "Multiple Sync options","Multi Sync Optionen" }, |
1064 | { "Sync algo options","Sync Ablauf Optionen" }, | 1064 | { "Sync algo options","Sync Ablauf Optionen" }, |
1065 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, | 1065 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, |
1066 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, | 1066 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, |
1067 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, | 1067 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, |
1068 | { "Write back options","Optionen zum Zurückschreiben" }, | 1068 | { "Write back options","Optionen zum Zurückschreiben" }, |
1069 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, | 1069 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, |
1070 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, | 1070 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, |
1071 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, | 1071 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, |
1072 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, | 1072 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, |
1073 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, | 1073 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, |
1074 | { "Time period","Zeitspanne" }, | 1074 | { "Time period","Zeitspanne" }, |
1075 | { "From ","Von " }, | 1075 | { "From ","Von " }, |
1076 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, | 1076 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, |
1077 | { " weeks in the future "," Wochen in der Zukunft " }, | 1077 | { " weeks in the future "," Wochen in der Zukunft " }, |
1078 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, | 1078 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, |
1079 | { "Local temp file:","Lokale temp Datei:" }, | 1079 | { "Local temp file:","Lokale temp Datei:" }, |
1080 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, | 1080 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, |
1081 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, | 1081 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, |
1082 | { "Language","Sprache" }, | 1082 | { "Language","Sprache" }, |
1083 | { "Time Format","Zeit Format" }, | 1083 | { "Time Format","Zeit Format" }, |
1084 | { "Time Zone","Zeit Zone" }, | 1084 | { "Time Zone","Zeit Zone" }, |
1085 | { "%1 groups subscribed","%1 Guppen abboniert" }, | 1085 | { "%1 groups subscribed","%1 Guppen abboniert" }, |
1086 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, | 1086 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Aktuelles Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverz.)/apps/kopiemail/localmail" }, |
1087 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, | 1087 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, |
1088 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, | 1088 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, |
1089 | { "Save settings","Speichere Einstellungen" }, | 1089 | { "Save settings","Speichere Einstellungen" }, |
1090 | { "Save standard","Speichere Standard" }, | 1090 | { "Save standard","Speichere Standard" }, |
1091 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 1091 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
1092 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, | 1092 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, |
1093 | { "Data storage path","Daten Speicherpfad" }, | 1093 | { "Data storage path","Daten Speicherpfad" }, |
1094 | { "Language","Sprache" }, | 1094 | { "Language","Sprache" }, |
1095 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, | 1095 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, |
1096 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, | 1096 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, |
1097 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, | 1097 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, |
1098 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, | 1098 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, |
1099 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, | 1099 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, |
1100 | { "KO/Pi","KO/Pi" }, | 1100 | { "KO/Pi","KO/Pi" }, |
1101 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, | 1101 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, |
1102 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, | 1102 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, |
1103 | { "Sound.Al.: ","Sound.Al.: " }, | 1103 | { "Sound.Al.: ","Sound.Al.: " }, |
1104 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, | 1104 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, |
1105 | { "Restore","Wiederherstellen" }, | 1105 | { "Restore","Wiederherstellen" }, |
1106 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, | 1106 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, |
1107 | { "% completed","% komplett" }, | 1107 | { "% completed","% komplett" }, |
1108 | { "%d item(s) found.","%d Item(s) gefunden." }, | 1108 | { "%d item(s) found.","%d Item(s) gefunden." }, |
1109 | { "Set complete","Setze auf erledigt" }, | 1109 | { "Set complete","Setze auf erledigt" }, |
1110 | { "(cancelled)","(gecancelt)" }, | 1110 | { "(cancelled)","(gecancelt)" }, |
1111 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, | 1111 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, |
1112 | { " Local time "," Locale Zeit " }, | 1112 | { " Local time "," Locale Zeit " }, |
1113 | { "Form2","Form2" }, | 1113 | { "Form2","Form2" }, |
1114 | { "Filter enabled","Filter angeschaltet" }, | 1114 | { "Filter enabled","Filter angeschaltet" }, |
1115 | { "Edit Filters","Ändere Filter" }, | 1115 | { "Edit Filters","Ändere Filter" }, |
1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, | 1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, |
1117 | { "Agenda","Agenda" }, | 1117 | { "Agenda","Agenda" }, |
1118 | { " ("," (" }, | 1118 | { " ("," (" }, |
1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, | 1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, |
1120 | { "Print","Print" }, | 1120 | { "Print","Print" }, |
1121 | { "&Setup Printer...","Drucker &Setup..." }, | 1121 | { "&Setup Printer...","Drucker &Setup..." }, |
1122 | { "View Type","Zeige Typ" }, | 1122 | { "View Type","Zeige Typ" }, |
1123 | { "Page &orientation:","Seiten Ausrichtung:" }, | 1123 | { "Page &orientation:","Seiten Ausrichtung:" }, |
1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, | 1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, |
1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, | 1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, |
1126 | { "Portrait","Portrait" }, | 1126 | { "Portrait","Portrait" }, |
1127 | { "Landscape","Landschaft" }, | 1127 | { "Landscape","Landschaft" }, |
1128 | { "Print day","Drucke Tag" }, | 1128 | { "Print day","Drucke Tag" }, |
1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, | 1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, |
1130 | { "Date && Time Range","Datum && Zeitspanne" }, | 1130 | { "Date && Time Range","Datum && Zeitspanne" }, |
1131 | { "&End date:","&Enddatum:" }, | 1131 | { "&End date:","&Enddatum:" }, |
1132 | { "&Start date:","&Startdatum:" }, | 1132 | { "&Start date:","&Startdatum:" }, |
1133 | { "Start &time:","Startzeit:" }, | 1133 | { "Start &time:","Startzeit:" }, |
1134 | { "End ti&me:","Endzeit:" }, | 1134 | { "End ti&me:","Endzeit:" }, |
1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, | 1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, |
1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, | 1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, |
1137 | { "Alt+D","Alt+D" }, | 1137 | { "Alt+D","Alt+D" }, |
1138 | { "&Use colors","Nutze Farben" }, | 1138 | { "&Use colors","Nutze Farben" }, |
1139 | { "Alt+U","Alt+U" }, | 1139 | { "Alt+U","Alt+U" }, |
1140 | { "Print week","Drucke Woche" }, | 1140 | { "Print week","Drucke Woche" }, |
1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, | 1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, |
1142 | { "Use &colors","Nutze Farben" }, | 1142 | { "Use &colors","Nutze Farben" }, |
1143 | { "Type of View","Typ der Ansicht" }, | 1143 | { "Type of View","Typ der Ansicht" }, |
1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, | 1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, |
1145 | { "Alt+F","Alt+F" }, | 1145 | { "Alt+F","Alt+F" }, |
1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, | 1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, |
1147 | { "Alt+T","Alt+T" }, | 1147 | { "Alt+T","Alt+T" }, |
1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, | 1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, |
1149 | { "Print month","Drucke Monat" }, | 1149 | { "Print month","Drucke Monat" }, |
1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, | 1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, |
1151 | { "&Start month:","&Startmonat:" }, | 1151 | { "&Start month:","&Startmonat:" }, |
1152 | { "&End month:","&Endmonat:" }, | 1152 | { "&End month:","&Endmonat:" }, |
1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, | 1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, |
1154 | { "Print todos","Drucke Todos" }, | 1154 | { "Print todos","Drucke Todos" }, |
1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1159 | { "Items to Print","Zu druckende Items" }, | 1159 | { "Items to Print","Zu druckende Items" }, |
1160 | { "&From:","Von:" }, | 1160 | { "&From:","Von:" }, |
1161 | { "&To:","Bis:" }, | 1161 | { "&To:","Bis:" }, |
1162 | { "Print &all todo items","Drucke alle Todo Items" }, | 1162 | { "Print &all todo items","Drucke alle Todo Items" }, |
1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1165 | { "Todo List","Todo Liste" }, | 1165 | { "Todo List","Todo Liste" }, |
1166 | { "&Title:","&Titel:" }, | 1166 | { "&Title:","&Titel:" }, |
1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1168 | { "Todo list","Todo Liste" }, | 1168 | { "Todo list","Todo Liste" }, |
1169 | { "&Print...","Drucke..." }, | 1169 | { "&Print...","Drucke..." }, |
1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1171 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1171 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1172 | { "OK","OK" }, | 1172 | { "OK","OK" }, |
1173 | { "FilterEditor","FilterEditor" }, | 1173 | { "FilterEditor","FilterEditor" }, |
1174 | { "Include","Inclusive" }, | 1174 | { "Include","Inclusive" }, |
1175 | { "Exclude","Exclusive" }, | 1175 | { "Exclude","Exclusive" }, |
1176 | { "Edit Selection...","Editiere Auswahl" }, | 1176 | { "Edit Selection...","Editiere Auswahl" }, |
1177 | { "recurring events","wiederholende Termine" }, | 1177 | { "recurring events","wiederholende Termine" }, |
1178 | { "recurr. events","wiederh.Termine" }, | 1178 | { "recurr. events","wiederh.Termine" }, |
1179 | { "completed to-dos","erledigte Todos" }, | 1179 | { "completed to-dos","erledigte Todos" }, |
1180 | { "events","Termine" }, | 1180 | { "events","Termine" }, |
1181 | { "todos","Todos" }, | 1181 | { "todos","Todos" }, |
1182 | { "journals","Journale" }, | 1182 | { "journals","Journale" }, |
1183 | { "public","öffentl." }, | 1183 | { "public","öffentl." }, |
1184 | { "private","privat" }, | 1184 | { "private","privat" }, |
1185 | { "confidential","vertraul." }, | 1185 | { "confidential","vertraul." }, |
1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1187 | { "Yesterday","Gestern" }, | 1187 | { "Yesterday","Gestern" }, |
1188 | { "Day after tomorrow","Übermorgen" }, | 1188 | { "Day after tomorrow","Übermorgen" }, |
1189 | { "Tomorrow","Morgen" }, | 1189 | { "Tomorrow","Morgen" }, |
1190 | { "Day before yesterday","Vorgestern" }, | 1190 | { "Day before yesterday","Vorgestern" }, |
1191 | { "Size %1","Größe %1" }, | 1191 | { "Size %1","Größe %1" }, |
1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1193 | { " (%1 y.)"," (%1 J.)" }, | 1193 | { " (%1 y.)"," (%1 J.)" }, |
1194 | { "Allday:","Ganztägig:" }, | 1194 | { "Allday:","Ganztägig:" }, |
1195 | { "compl.todos","erled.Todos" }, | 1195 | { "compl.todos","erled.Todos" }, |
1196 | { "Day view","Tagesansicht" }, | 1196 | { "Day view","Tagesansicht" }, |
1197 | { "Next days","Nächste Tage" }, | 1197 | { "Next days","Nächste Tage" }, |
1198 | { "Next week","Nächste Woche" }, | 1198 | { "Next week","Nächste Woche" }, |
1199 | { "Next two weeks","Nächste zwei Wochen" }, | 1199 | { "Next two weeks","Nächste zwei Wochen" }, |
1200 | { "Next month","Nächster Monat" }, | 1200 | { "Next month","Nächster Monat" }, |
1201 | { "Journal view","Journal" }, | 1201 | { "Journal view","Journal" }, |
1202 | { "Display all opened","Zeige alle geöffnet" }, | 1202 | { "Display all opened","Zeige alle geöffnet" }, |
1203 | { "Display all closed","Zeige alle geschlossen" }, | 1203 | { "Display all closed","Zeige alle geschlossen" }, |
1204 | { "Display all flat","Zeige alle flach" }, | 1204 | { "Display all flat","Zeige alle flach" }, |
1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, | 1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, |
1208 | { "Select Week","Wähle Woche" }, | 1208 | { "Select Week","Wähle Woche" }, |
1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, | 1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, |
1210 | { "Set Alarm!","Setze Alarm!" }, | 1210 | { "Set Alarm!","Setze Alarm!" }, |
1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1212 | { " and "," und " }, | 1212 | { " and "," und " }, |
1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | 1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, |
1214 | { "Mail to selected","Mail an Ausgewählte" }, | 1214 | { "Mail to selected","Mail an Ausgewählte" }, |
1215 | { "Mail to all","Mail an Alle" }, | 1215 | { "Mail to all","Mail an Alle" }, |
1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1218 | { " on"," am" }, | 1218 | { " on"," am" }, |
1219 | { " completed on "," erledigt am " }, | 1219 | { " completed on "," erledigt am " }, |
1220 | { "Save as Event template","Speichere als Vorlage" }, | 1220 | { "Save as Event template","Speichere als Vorlage" }, |
1221 | { "Load Event template","Lade Termin Vorlage" }, | 1221 | { "Load Event template","Lade Termin Vorlage" }, |
1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, | 1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, |
1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, | 1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, |
1224 | { "Sub todos:<br>","Unter Todos:<br>" }, | 1224 | { "Sub todos:<br>","Unter Todos:<br>" }, |
1225 | { "Parent todo:<br>","Über Todo:<br>" }, | 1225 | { "Parent todo:<br>","Über Todo:<br>" }, |
1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, | 1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, |
1227 | { " completed"," erledigt" }, | 1227 | { " completed"," erledigt" }, |
1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.net --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, | 1228 | { "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.net --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.net --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, |
1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, | 1232 | { "Connection to remote\nhost timed out!\nDid you forgot to enable\nsyncing on remote host?","Verbindungsversuch wegen\nZeitüberschreitung gescheitert!\nWurde vergessen Pi-Sync auf\nder Gegenstelle anzuschalten?" }, |
1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
1234 | { "Error","Fehler" }, | 1234 | { "Error","Fehler" }, |
1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
1237 | { "Warning","Warnung" }, | 1237 | { "Warning","Warnung" }, |
1238 | { "Select week number","Wähle Wochen Nummer" }, | 1238 | { "Select week number","Wähle Wochen Nummer" }, |
1239 | { "Februar","Februar" }, | 1239 | { "Februar","Februar" }, |
1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, | 1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, |
1241 | { "W","W" }, | 1241 | { "W","W" }, |
1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, | 1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, |
1243 | { "T: %1","T: %1" }, | 1243 | { "T: %1","T: %1" }, |
1244 | { "Start: ","Start: " }, | 1244 | { "Start: ","Start: " }, |
1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
1247 | { "Remote IP address:","Ferne IP Adresse:" }, | 1247 | { "Remote IP address:","Ferne IP Adresse:" }, |
1248 | { "Remote port number:","Ferne Port Nummer:" }, | 1248 | { "Remote port number:","Ferne Port Nummer:" }, |
1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
1250 | { "Remote from: ","Fern von: " }, | 1250 | { "Remote from: ","Fern von: " }, |
1251 | { "Local from: ","Lokal von: " }, | 1251 | { "Local from: ","Lokal von: " }, |
1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, | 1252 | { "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out\n","Synchronisationsübersicht:\n\n %d lokal hinzugefügt\n %d fern hinzugefügt\n %d lokal geändert\n %d fern geändert\n %d lokal gelöscht\n %d fern gelöscht\n %d eingehende ausgefiltert\n %d ausgehende ausgefiltert\n" }, |
1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
1254 | { "Write back","Schreibe zurück" }, | 1254 | { "Write back","Schreibe zurück" }, |
1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1257 | { "Received sync request","Sync Anfrage erhalten" }, | 1257 | { "Received sync request","Sync Anfrage erhalten" }, |
1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, | 1258 | { "Synchronizing from remote ...\n\nDo not use this application!\n\nIf syncing fails\nyou can close this dialog.","Ferne Synchronisation ...\n\nBenutze diese Anwendung nicht!\n\nWenn das Syncen fehlschlägt kann\ndieser Dialog geschlossen werden." }, |
1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1261 | { "Sending file...","Sende Datei..." }, | 1261 | { "Sending file...","Sende Datei..." }, |
1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1264 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1264 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1265 | { "Writing file to disk...","Speichere Datei..." }, | 1265 | { "Writing file to disk...","Speichere Datei..." }, |
1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1268 | { "Synchronize!","Synchronisiere!" }, | 1268 | { "Synchronize!","Synchronisiere!" }, |
1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, | 1271 | { "The clocks of the syncing\ndevices have a difference\nof more than 5 minutes.\nPlease adjust your clocks.\nYou may get wrong syncing results!\nPlease confirm synchronization!","Die Uhren der syncenden Geräte\nhaben einen Unterschied von\nmehr als 5 Minuten. Bitte die\nUhrzeiten anpassen. Sie können\nfalsche Sync-Resultate erhalten!\nBitte das Syncen bestätigen!" }, |
1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1274 | { "List week view","Listenwochenansicht" }, | 1274 | { "List week view","Listenwochenansicht" }, |
1275 | { "List week","Listenwochenansicht" }, | 1275 | { "List week","Listenwochenansicht" }, |
1276 | { "Next Week","Nächste Woche" }, | 1276 | { "Next Week","Nächste Woche" }, |
1277 | { "Previous Week","Vorherige Woche" }, | 1277 | { "Previous Week","Vorherige Woche" }, |
1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, | 1278 | { "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, |
1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, | 1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, |
1280 | { "Details","Details" }, | 1280 | { "Details","Details" }, |
1281 | { "Created time","Erstellt Zeit" }, | 1281 | { "Created time","Erstellt Zeit" }, |
1282 | { "Last modified time","Geändert Zeit" }, | 1282 | { "Last modified time","Geändert Zeit" }, |
1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, | 1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, |
1284 | { "View Options","Anzeige Optionen" }, | 1284 | { "View Options","Anzeige Optionen" }, |
1285 | { "<b>Created: ","<b>Erstellt am: " }, | 1285 | { "<b>Created: ","<b>Erstellt am: " }, |
1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, | 1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, |
1287 | { "Journal: ","Journal: " }, | ||
1288 | { "yearly","jährlich" }, | ||
1289 | { "(%1) ","%1-" }, | ||
1290 | { "","" }, | ||
1291 | { "","" }, | ||
1292 | { "","" }, | ||
1293 | { "","" }, | ||
1294 | { "","" }, | ||
1287 | { "","" }, | 1295 | { "","" }, |
1288 | { "","" }, | 1296 | { "","" }, |
1289 | { "","" }, | 1297 | { "","" }, |
1290 | { "","" }, | 1298 | { "","" }, |
1291 | { "","" }, | 1299 | { "","" }, |
1292 | 1300 | ||
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index 1f5afc0..4a6e17d 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -1,965 +1,965 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 1999 Preston Brown | 3 | Copyright (c) 1999 Preston Brown |
4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <qlistview.h> | 25 | #include <qlistview.h> |
26 | #include <qlayout.h> | 26 | #include <qlayout.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
28 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
29 | #include <qprogressbar.h> | 29 | #include <qprogressbar.h> |
30 | #include <qfileinfo.h> | 30 | #include <qfileinfo.h> |
31 | #include <qmessagebox.h> | 31 | #include <qmessagebox.h> |
32 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
34 | #include <qdir.h> | 34 | #include <qdir.h> |
35 | #include <qwhatsthis.h> | 35 | #include <qwhatsthis.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | 37 | ||
38 | #include <klocale.h> | 38 | #include <klocale.h> |
39 | #include <kdebug.h> | 39 | #include <kdebug.h> |
40 | #include <kiconloader.h> | 40 | #include <kiconloader.h> |
41 | #include <kglobal.h> | 41 | #include <kglobal.h> |
42 | 42 | ||
43 | #include <libkdepim/kpimglobalprefs.h> | 43 | #include <libkdepim/kpimglobalprefs.h> |
44 | #include <libkcal/calendar.h> | 44 | #include <libkcal/calendar.h> |
45 | #include <libkcal/calendarlocal.h> | 45 | #include <libkcal/calendarlocal.h> |
46 | #include <libkcal/icalformat.h> | 46 | #include <libkcal/icalformat.h> |
47 | #include <libkcal/vcalformat.h> | 47 | #include <libkcal/vcalformat.h> |
48 | #include <libkcal/recurrence.h> | 48 | #include <libkcal/recurrence.h> |
49 | #include <libkcal/filestorage.h> | 49 | #include <libkcal/filestorage.h> |
50 | #include <libkdepim/categoryselectdialog.h> | 50 | #include <libkdepim/categoryselectdialog.h> |
51 | #include <libkcal/kincidenceformatter.h> | 51 | #include <libkcal/kincidenceformatter.h> |
52 | #ifndef DESKTOP_VERSION | 52 | #ifndef DESKTOP_VERSION |
53 | #include <qpe/qpeapplication.h> | 53 | #include <qpe/qpeapplication.h> |
54 | #else | 54 | #else |
55 | #include <qapplication.h> | 55 | #include <qapplication.h> |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | #ifndef KORG_NOPRINTER | 58 | #ifndef KORG_NOPRINTER |
59 | #include "calprinter.h" | 59 | #include "calprinter.h" |
60 | #endif | 60 | #endif |
61 | #include "koglobals.h" | 61 | #include "koglobals.h" |
62 | #include "koprefs.h" | 62 | #include "koprefs.h" |
63 | #include "kfiledialog.h" | 63 | #include "kfiledialog.h" |
64 | 64 | ||
65 | #include "kolistview.h" | 65 | #include "kolistview.h" |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | class KOListViewWhatsThis :public QWhatsThis | 70 | class KOListViewWhatsThis :public QWhatsThis |
71 | { | 71 | { |
72 | public: | 72 | public: |
73 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 73 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; |
74 | 74 | ||
75 | protected: | 75 | protected: |
76 | virtual QString text( const QPoint& p) | 76 | virtual QString text( const QPoint& p) |
77 | { | 77 | { |
78 | return _view->getWhatsThisText(p) ; | 78 | return _view->getWhatsThisText(p) ; |
79 | } | 79 | } |
80 | private: | 80 | private: |
81 | QWidget* _wid; | 81 | QWidget* _wid; |
82 | KOListView * _view; | 82 | KOListView * _view; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | 85 | ||
86 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | 86 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) |
87 | { | 87 | { |
88 | mItem = item; | 88 | mItem = item; |
89 | mDate = date; | 89 | mDate = date; |
90 | } | 90 | } |
91 | 91 | ||
92 | ListItemVisitor::~ListItemVisitor() | 92 | ListItemVisitor::~ListItemVisitor() |
93 | { | 93 | { |
94 | } | 94 | } |
95 | 95 | ||
96 | bool ListItemVisitor::visit(Event *e) | 96 | bool ListItemVisitor::visit(Event *e) |
97 | { | 97 | { |
98 | 98 | ||
99 | bool ok = false; | 99 | bool ok = false; |
100 | QString start, end; | 100 | QString start, end; |
101 | QDate ds, de; | 101 | QDate ds, de; |
102 | if ( e->doesRecur() ) { | 102 | if ( e->doesRecur() ) { |
103 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); | 103 | ds = e->getNextOccurence( QDateTime( mDate, QTime(0,0,0)), &ok ).date(); |
104 | if ( ok ) { | 104 | if ( ok ) { |
105 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); | 105 | int days = e->dtStart().date().daysTo(e->dtEnd().date() ); |
106 | start = KGlobal::locale()->formatDate(ds,true); | 106 | start = KGlobal::locale()->formatDate(ds,true); |
107 | de = ds.addDays( days); | 107 | de = ds.addDays( days); |
108 | end = KGlobal::locale()->formatDate(de,true); | 108 | end = KGlobal::locale()->formatDate(de,true); |
109 | } | 109 | } |
110 | 110 | ||
111 | } | 111 | } |
112 | if ( ! ok ) { | 112 | if ( ! ok ) { |
113 | start =e->dtStartDateStr(); | 113 | start =e->dtStartDateStr(); |
114 | end = e->dtEndDateStr(); | 114 | end = e->dtEndDateStr(); |
115 | ds = e->dtStart().date(); | 115 | ds = e->dtStart().date(); |
116 | de = e->dtEnd().date(); | 116 | de = e->dtEnd().date(); |
117 | } | 117 | } |
118 | mItem->setText(0,e->summary()); | 118 | mItem->setText(0,e->summary()); |
119 | mItem->setText(1,start); | 119 | mItem->setText(1,start); |
120 | mItem->setText(2,e->dtStartTimeStr()); | 120 | mItem->setText(2,e->dtStartTimeStr()); |
121 | mItem->setText(3,end); | 121 | mItem->setText(3,end); |
122 | mItem->setText(4,e->dtEndTimeStr()); | 122 | mItem->setText(4,e->dtEndTimeStr()); |
123 | mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); | 123 | mItem->setText(5,e->isAlarmEnabled() ? i18n("Yes") : i18n("No")); |
124 | mItem->setText(6, e->recurrence()->recurrenceText()); | 124 | mItem->setText(6, e->recurrence()->recurrenceText()); |
125 | mItem->setText(7,"---"); | 125 | mItem->setText(7,"---"); |
126 | mItem->setText(8,"---"); | 126 | mItem->setText(8,"---"); |
127 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); | 127 | mItem->setText(9, e->cancelled() ? i18n("Yes") : i18n("No")); |
128 | mItem->setText(10,e->categoriesStr()); | 128 | mItem->setText(10,e->categoriesStr()); |
129 | 129 | ||
130 | QString key; | 130 | QString key; |
131 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); | 131 | QTime t = e->doesFloat() ? QTime(0,0) : e->dtStart().time(); |
132 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); | 132 | key.sprintf("%04d%02d%02d%02d%02d",ds.year(),ds.month(),ds.day(),t.hour(),t.minute()); |
133 | mItem->setSortKey(1,key); | 133 | mItem->setSortKey(1,key); |
134 | 134 | ||
135 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); | 135 | t = e->doesFloat() ? QTime(0,0) : e->dtEnd().time(); |
136 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); | 136 | key.sprintf("%04d%02d%02d%02d%02d",de.year(),de.month(),de.day(),t.hour(),t.minute()); |
137 | mItem->setSortKey(3,key); | 137 | mItem->setSortKey(3,key); |
138 | 138 | ||
139 | return true; | 139 | return true; |
140 | } | 140 | } |
141 | 141 | ||
142 | bool ListItemVisitor::visit(Todo *t) | 142 | bool ListItemVisitor::visit(Todo *t) |
143 | { | 143 | { |
144 | mItem->setText(0,i18n("To-Do: %1").arg(t->summary())); | 144 | mItem->setText(0,i18n("Todo: %1").arg(t->summary())); |
145 | if (t->hasStartDate()) { | 145 | if (t->hasStartDate()) { |
146 | mItem->setText(1,t->dtStartDateStr()); | 146 | mItem->setText(1,t->dtStartDateStr()); |
147 | if (t->doesFloat()) { | 147 | if (t->doesFloat()) { |
148 | mItem->setText(2,"---"); | 148 | mItem->setText(2,"---"); |
149 | } else { | 149 | } else { |
150 | mItem->setText(2,t->dtStartTimeStr()); | 150 | mItem->setText(2,t->dtStartTimeStr()); |
151 | } | 151 | } |
152 | } else { | 152 | } else { |
153 | mItem->setText(1,"---"); | 153 | mItem->setText(1,"---"); |
154 | mItem->setText(2,"---"); | 154 | mItem->setText(2,"---"); |
155 | } | 155 | } |
156 | mItem->setText(3,"---"); | 156 | mItem->setText(3,"---"); |
157 | mItem->setText(4,"---"); | 157 | mItem->setText(4,"---"); |
158 | mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); | 158 | mItem->setText(5,t->isAlarmEnabled() ? i18n("Yes") : i18n("No")); |
159 | mItem->setText(6, t->recurrence()->recurrenceText()); | 159 | mItem->setText(6, t->recurrence()->recurrenceText()); |
160 | if (t->hasDueDate()) { | 160 | if (t->hasDueDate()) { |
161 | mItem->setText(7,t->dtDueDateStr()); | 161 | mItem->setText(7,t->dtDueDateStr()); |
162 | if (t->doesFloat()) { | 162 | if (t->doesFloat()) { |
163 | mItem->setText(8,"---"); | 163 | mItem->setText(8,"---"); |
164 | } else { | 164 | } else { |
165 | mItem->setText(8,t->dtDueTimeStr()); | 165 | mItem->setText(8,t->dtDueTimeStr()); |
166 | } | 166 | } |
167 | } else { | 167 | } else { |
168 | mItem->setText(7,"---"); | 168 | mItem->setText(7,"---"); |
169 | mItem->setText(8,"---"); | 169 | mItem->setText(8,"---"); |
170 | } | 170 | } |
171 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); | 171 | mItem->setText(9, t->cancelled() ? i18n("Yes") : i18n("No")); |
172 | mItem->setText(10,t->categoriesStr()); | 172 | mItem->setText(10,t->categoriesStr()); |
173 | 173 | ||
174 | QString key; | 174 | QString key; |
175 | QDate d; | 175 | QDate d; |
176 | if (t->hasDueDate()) { | 176 | if (t->hasDueDate()) { |
177 | d = t->dtDue().date(); | 177 | d = t->dtDue().date(); |
178 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); | 178 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtDue().time(); |
179 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 179 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
180 | mItem->setSortKey(7,key); | 180 | mItem->setSortKey(7,key); |
181 | } | 181 | } |
182 | if ( t->hasStartDate() ) { | 182 | if ( t->hasStartDate() ) { |
183 | d = t->dtStart().date(); | 183 | d = t->dtStart().date(); |
184 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); | 184 | QTime tm = t->doesFloat() ? QTime(0,0) : t->dtStart().time(); |
185 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); | 185 | key.sprintf("%04d%02d%02d%02d%02d",d.year(),d.month(),d.day(),tm.hour(),tm.minute()); |
186 | mItem->setSortKey(1,key); | 186 | mItem->setSortKey(1,key); |
187 | } | 187 | } |
188 | return true; | 188 | return true; |
189 | } | 189 | } |
190 | 190 | ||
191 | bool ListItemVisitor::visit(Journal * j) | 191 | bool ListItemVisitor::visit(Journal * j) |
192 | { | 192 | { |
193 | QString des = j->description().left(50); | 193 | QString des = j->description().left(30); |
194 | des = des.simplifyWhiteSpace (); | 194 | des = des.simplifyWhiteSpace (); |
195 | des.replace (QRegExp ("\\n"),"" ); | 195 | des.replace (QRegExp ("\\n"),"" ); |
196 | des.replace (QRegExp ("\\r"),"" ); | 196 | des.replace (QRegExp ("\\r"),"" ); |
197 | mItem->setText(0,i18n("Journal")+": "+des.left(25)); | 197 | mItem->setText(0,i18n("Journal: ")+des.left(25)); |
198 | mItem->setText(1,j->dtStartDateStr()); | 198 | mItem->setText(1,j->dtStartDateStr()); |
199 | mItem->setText(2,"---"); | 199 | mItem->setText(2,"---"); |
200 | mItem->setText(3,"---"); | 200 | mItem->setText(3,"---"); |
201 | mItem->setText(4,"---"); | 201 | mItem->setText(4,"---"); |
202 | mItem->setText(5,"---"); | 202 | mItem->setText(5,"---"); |
203 | mItem->setText(6,"---"); | 203 | mItem->setText(6,"---"); |
204 | mItem->setText(7,j->dtStartDateStr()); | 204 | mItem->setText(7,j->dtStartDateStr()); |
205 | mItem->setText(8,"---"); | 205 | mItem->setText(8,"---"); |
206 | mItem->setText(9,"---"); | 206 | mItem->setText(9,"---"); |
207 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); | 207 | mItem->setText(10,i18n("Last Modified: ")+ KGlobal::locale()->formatDateTime( j->lastModified() , true) ); |
208 | 208 | ||
209 | QString key; | 209 | QString key; |
210 | QDate d = j->dtStart().date(); | 210 | QDate d = j->dtStart().date(); |
211 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); | 211 | key.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); |
212 | mItem->setSortKey(1,key); | 212 | mItem->setSortKey(1,key); |
213 | mItem->setSortKey(7,key); | 213 | mItem->setSortKey(7,key); |
214 | 214 | ||
215 | return true; | 215 | return true; |
216 | } | 216 | } |
217 | 217 | ||
218 | KOListView::KOListView(Calendar *calendar, QWidget *parent, | 218 | KOListView::KOListView(Calendar *calendar, QWidget *parent, |
219 | const char *name) | 219 | const char *name) |
220 | : KOEventView(calendar, parent, name) | 220 | : KOEventView(calendar, parent, name) |
221 | { | 221 | { |
222 | mActiveItem = 0; | 222 | mActiveItem = 0; |
223 | mListView = new KOListViewListView(this); | 223 | mListView = new KOListViewListView(this); |
224 | mListView->addColumn(i18n("Summary")); | 224 | mListView->addColumn(i18n("Summary")); |
225 | mListView->addColumn(i18n("Start Date")); | 225 | mListView->addColumn(i18n("Start Date")); |
226 | mListView->addColumn(i18n("Start Time")); | 226 | mListView->addColumn(i18n("Start Time")); |
227 | mListView->addColumn(i18n("End Date")); | 227 | mListView->addColumn(i18n("End Date")); |
228 | mListView->addColumn(i18n("End Time")); | 228 | mListView->addColumn(i18n("End Time")); |
229 | mListView->addColumn(i18n("Alarm")); // alarm set? | 229 | mListView->addColumn(i18n("Alarm")); // alarm set? |
230 | mListView->addColumn(i18n("Recurs")); // recurs? | 230 | mListView->addColumn(i18n("Recurs")); // recurs? |
231 | mListView->addColumn(i18n("Due Date")); | 231 | mListView->addColumn(i18n("Due Date")); |
232 | mListView->addColumn(i18n("Due Time")); | 232 | mListView->addColumn(i18n("Due Time")); |
233 | mListView->addColumn(i18n("Cancelled")); | 233 | mListView->addColumn(i18n("Cancelled")); |
234 | mListView->addColumn(i18n("Categories")); | 234 | mListView->addColumn(i18n("Categories")); |
235 | 235 | ||
236 | mListView->setColumnAlignment(0,AlignLeft); | 236 | mListView->setColumnAlignment(0,AlignLeft); |
237 | mListView->setColumnAlignment(1,AlignLeft); | 237 | mListView->setColumnAlignment(1,AlignLeft); |
238 | mListView->setColumnAlignment(2,AlignHCenter); | 238 | mListView->setColumnAlignment(2,AlignHCenter); |
239 | mListView->setColumnAlignment(3,AlignLeft); | 239 | mListView->setColumnAlignment(3,AlignLeft); |
240 | mListView->setColumnAlignment(4,AlignHCenter); | 240 | mListView->setColumnAlignment(4,AlignHCenter); |
241 | mListView->setColumnAlignment(5,AlignLeft); | 241 | mListView->setColumnAlignment(5,AlignLeft); |
242 | mListView->setColumnAlignment(6,AlignLeft); | 242 | mListView->setColumnAlignment(6,AlignLeft); |
243 | mListView->setColumnAlignment(7,AlignLeft); | 243 | mListView->setColumnAlignment(7,AlignLeft); |
244 | mListView->setColumnAlignment(8,AlignLeft); | 244 | mListView->setColumnAlignment(8,AlignLeft); |
245 | mListView->setColumnAlignment(9,AlignLeft); | 245 | mListView->setColumnAlignment(9,AlignLeft); |
246 | mListView->setColumnAlignment(10,AlignLeft); | 246 | mListView->setColumnAlignment(10,AlignLeft); |
247 | mListView->setColumnWidthMode(10, QListView::Manual); | 247 | mListView->setColumnWidthMode(10, QListView::Manual); |
248 | new KOListViewWhatsThis(mListView->viewport(),this); | 248 | new KOListViewWhatsThis(mListView->viewport(),this); |
249 | 249 | ||
250 | int iii = 0; | 250 | int iii = 0; |
251 | for ( iii = 0; iii< 10 ; ++iii ) | 251 | for ( iii = 0; iii< 10 ; ++iii ) |
252 | mListView->setColumnWidthMode( iii, QListView::Manual ); | 252 | mListView->setColumnWidthMode( iii, QListView::Manual ); |
253 | 253 | ||
254 | QBoxLayout *layoutTop = new QVBoxLayout(this); | 254 | QBoxLayout *layoutTop = new QVBoxLayout(this); |
255 | layoutTop->addWidget(mListView); | 255 | layoutTop->addWidget(mListView); |
256 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 256 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
257 | mPopupMenu = eventPopup(); | 257 | mPopupMenu = eventPopup(); |
258 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 258 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
259 | i18n("Select all"),this, | 259 | i18n("Select all"),this, |
260 | SLOT(allSelection()),true); | 260 | SLOT(allSelection()),true); |
261 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 261 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
262 | i18n("Deselect all"),this, | 262 | i18n("Deselect all"),this, |
263 | SLOT(clearSelection()),true); | 263 | SLOT(clearSelection()),true); |
264 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 264 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
265 | i18n("Delete all selected"),this, | 265 | i18n("Delete all selected"),this, |
266 | SLOT(deleteAll()),true); | 266 | SLOT(deleteAll()),true); |
267 | mPopupMenu->insertSeparator(); | 267 | mPopupMenu->insertSeparator(); |
268 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 268 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
269 | i18n("Save selected to file..."),this, | 269 | i18n("Save selected to file..."),this, |
270 | SLOT(saveToFile()),true); | 270 | SLOT(saveToFile()),true); |
271 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 271 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
272 | i18n("Save Journal/Description..."),this, | 272 | i18n("Save Journal/Description..."),this, |
273 | SLOT(saveDescriptionToFile()),true); | 273 | SLOT(saveDescriptionToFile()),true); |
274 | // mPopupMenu->insertSeparator(); | 274 | // mPopupMenu->insertSeparator(); |
275 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 275 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
276 | i18n("Add Categ. to selected..."),this, | 276 | i18n("Add Categ. to selected..."),this, |
277 | SLOT(addCat()),true); | 277 | SLOT(addCat()),true); |
278 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 278 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
279 | i18n("Set Categ. for selected..."),this, | 279 | i18n("Set Categ. for selected..."),this, |
280 | SLOT(setCat()),true); | 280 | SLOT(setCat()),true); |
281 | //mPopupMenu->insertSeparator(); | 281 | //mPopupMenu->insertSeparator(); |
282 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 282 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
283 | i18n("Set alarm for selected..."),this, | 283 | i18n("Set alarm for selected..."),this, |
284 | SLOT(setAlarm()),true); | 284 | SLOT(setAlarm()),true); |
285 | 285 | ||
286 | 286 | ||
287 | #ifndef DESKTOP_VERSION | 287 | #ifndef DESKTOP_VERSION |
288 | mPopupMenu->insertSeparator(); | 288 | mPopupMenu->insertSeparator(); |
289 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), | 289 | mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), |
290 | i18n("Beam selected via IR"),this, | 290 | i18n("Beam selected via IR"),this, |
291 | SLOT(beamSelected()),true); | 291 | SLOT(beamSelected()),true); |
292 | #endif | 292 | #endif |
293 | /* | 293 | /* |
294 | mPopupMenu = new QPopupMenu; | 294 | mPopupMenu = new QPopupMenu; |
295 | mPopupMenu->insertItem(i18n("Edit Event"), this, | 295 | mPopupMenu->insertItem(i18n("Edit Event"), this, |
296 | SLOT (editEvent())); | 296 | SLOT (editEvent())); |
297 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, | 297 | mPopupMenu->insertItem(SmallIcon("delete"), i18n("Delete Event"), this, |
298 | SLOT (deleteEvent())); | 298 | SLOT (deleteEvent())); |
299 | mPopupMenu->insertSeparator(); | 299 | mPopupMenu->insertSeparator(); |
300 | mPopupMenu->insertItem(i18n("Show Dates"), this, | 300 | mPopupMenu->insertItem(i18n("Show Dates"), this, |
301 | SLOT(showDates())); | 301 | SLOT(showDates())); |
302 | mPopupMenu->insertItem(i18n("Hide Dates"), this, | 302 | mPopupMenu->insertItem(i18n("Hide Dates"), this, |
303 | SLOT(hideDates())); | 303 | SLOT(hideDates())); |
304 | */ | 304 | */ |
305 | QObject::connect(mListView,SIGNAL( newEvent()), | 305 | QObject::connect(mListView,SIGNAL( newEvent()), |
306 | this,SIGNAL(signalNewEvent())); | 306 | this,SIGNAL(signalNewEvent())); |
307 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), | 307 | QObject::connect(mListView,SIGNAL(doubleClicked(QListViewItem *)), |
308 | this,SLOT(defaultItemAction(QListViewItem *))); | 308 | this,SLOT(defaultItemAction(QListViewItem *))); |
309 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, | 309 | QObject::connect(mListView,SIGNAL(rightButtonClicked ( QListViewItem *, |
310 | const QPoint &, int )), | 310 | const QPoint &, int )), |
311 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); | 311 | this,SLOT(popupMenu(QListViewItem *,const QPoint &,int))); |
312 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), | 312 | QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), |
313 | SLOT(processSelectionChange(QListViewItem *))); | 313 | SLOT(processSelectionChange(QListViewItem *))); |
314 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), | 314 | QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), |
315 | SIGNAL(showIncidenceSignal(Incidence *)) ); | 315 | SIGNAL(showIncidenceSignal(Incidence *)) ); |
316 | 316 | ||
317 | readSettings(KOGlobals::config(),"KOListView Layout"); | 317 | readSettings(KOGlobals::config(),"KOListView Layout"); |
318 | } | 318 | } |
319 | 319 | ||
320 | KOListView::~KOListView() | 320 | KOListView::~KOListView() |
321 | { | 321 | { |
322 | delete mPopupMenu; | 322 | delete mPopupMenu; |
323 | } | 323 | } |
324 | QString KOListView::getWhatsThisText(QPoint p) | 324 | QString KOListView::getWhatsThisText(QPoint p) |
325 | { | 325 | { |
326 | KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); | 326 | KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); |
327 | if ( item ) | 327 | if ( item ) |
328 | return KIncidenceFormatter::instance()->getFormattedText( item->data(), | 328 | return KIncidenceFormatter::instance()->getFormattedText( item->data(), |
329 | KOPrefs::instance()->mWTshowDetails, | 329 | KOPrefs::instance()->mWTshowDetails, |
330 | KOPrefs::instance()->mWTshowCreated, | 330 | KOPrefs::instance()->mWTshowCreated, |
331 | KOPrefs::instance()->mWTshowChanged); | 331 | KOPrefs::instance()->mWTshowChanged); |
332 | return i18n("That is the list view" ); | 332 | return i18n("That is the list view" ); |
333 | 333 | ||
334 | } | 334 | } |
335 | 335 | ||
336 | void KOListView::updateList() | 336 | void KOListView::updateList() |
337 | { | 337 | { |
338 | // qDebug(" KOListView::updateList() "); | 338 | // qDebug(" KOListView::updateList() "); |
339 | 339 | ||
340 | } | 340 | } |
341 | 341 | ||
342 | void KOListView::addCat( ) | 342 | void KOListView::addCat( ) |
343 | { | 343 | { |
344 | setCategories( false ); | 344 | setCategories( false ); |
345 | } | 345 | } |
346 | void KOListView::setCat() | 346 | void KOListView::setCat() |
347 | { | 347 | { |
348 | setCategories( true ); | 348 | setCategories( true ); |
349 | } | 349 | } |
350 | void KOListView::setAlarm() | 350 | void KOListView::setAlarm() |
351 | { | 351 | { |
352 | KOAlarmPrefs kap( this); | 352 | KOAlarmPrefs kap( this); |
353 | if ( !kap.exec() ) | 353 | if ( !kap.exec() ) |
354 | return; | 354 | return; |
355 | 355 | ||
356 | 356 | ||
357 | QStringList itemList; | 357 | QStringList itemList; |
358 | QPtrList<KOListViewItem> sel ; | 358 | QPtrList<KOListViewItem> sel ; |
359 | QListViewItem *qitem = mListView->firstChild (); | 359 | QListViewItem *qitem = mListView->firstChild (); |
360 | while ( qitem ) { | 360 | while ( qitem ) { |
361 | if ( qitem->isSelected() ) { | 361 | if ( qitem->isSelected() ) { |
362 | Incidence* inc = ((KOListViewItem *) qitem)->data(); | 362 | Incidence* inc = ((KOListViewItem *) qitem)->data(); |
363 | if ( inc->type() != "Journal" ) { | 363 | if ( inc->type() != "Journal" ) { |
364 | if ( inc->type() == "Todo" ) { | 364 | if ( inc->type() == "Todo" ) { |
365 | if ( ((Todo*)inc)->hasDueDate() ) | 365 | if ( ((Todo*)inc)->hasDueDate() ) |
366 | sel.append(((KOListViewItem *)qitem)); | 366 | sel.append(((KOListViewItem *)qitem)); |
367 | } else | 367 | } else |
368 | sel.append(((KOListViewItem *)qitem)); | 368 | sel.append(((KOListViewItem *)qitem)); |
369 | } | 369 | } |
370 | } | 370 | } |
371 | qitem = qitem->nextSibling(); | 371 | qitem = qitem->nextSibling(); |
372 | } | 372 | } |
373 | int count = 0; | 373 | int count = 0; |
374 | KOListViewItem * item, *temp; | 374 | KOListViewItem * item, *temp; |
375 | item = sel.first(); | 375 | item = sel.first(); |
376 | Incidence* inc; | 376 | Incidence* inc; |
377 | while ( item ) { | 377 | while ( item ) { |
378 | inc = item->data(); | 378 | inc = item->data(); |
379 | ++count; | 379 | ++count; |
380 | if (kap.mAlarmButton->isChecked()) { | 380 | if (kap.mAlarmButton->isChecked()) { |
381 | if (inc->alarms().count() == 0) | 381 | if (inc->alarms().count() == 0) |
382 | inc->newAlarm(); | 382 | inc->newAlarm(); |
383 | QPtrList<Alarm> alarms = inc->alarms(); | 383 | QPtrList<Alarm> alarms = inc->alarms(); |
384 | Alarm *alarm; | 384 | Alarm *alarm; |
385 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 385 | for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
386 | alarm->setEnabled(true); | 386 | alarm->setEnabled(true); |
387 | int j = kap.mAlarmTimeEdit->value()* -60; | 387 | int j = kap.mAlarmTimeEdit->value()* -60; |
388 | if (kap.mAlarmIncrCombo->currentItem() == 1) | 388 | if (kap.mAlarmIncrCombo->currentItem() == 1) |
389 | j = j * 60; | 389 | j = j * 60; |
390 | else if (kap.mAlarmIncrCombo->currentItem() == 2) | 390 | else if (kap.mAlarmIncrCombo->currentItem() == 2) |
391 | j = j * (60 * 24); | 391 | j = j * (60 * 24); |
392 | alarm->setStartOffset( j ); | 392 | alarm->setStartOffset( j ); |
393 | 393 | ||
394 | if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) { | 394 | if (!kap.mAlarmProgram.isEmpty() && kap.mAlarmProgramButton->isOn()) { |
395 | alarm->setProcedureAlarm(kap.mAlarmProgram); | 395 | alarm->setProcedureAlarm(kap.mAlarmProgram); |
396 | } | 396 | } |
397 | else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) | 397 | else if (!kap.mAlarmSound.isEmpty() && kap.mAlarmSoundButton->isOn()) |
398 | alarm->setAudioAlarm(kap.mAlarmSound); | 398 | alarm->setAudioAlarm(kap.mAlarmSound); |
399 | else | 399 | else |
400 | alarm->setType(Alarm::Invalid); | 400 | alarm->setType(Alarm::Invalid); |
401 | //alarm->setAudioAlarm("default"); | 401 | //alarm->setAudioAlarm("default"); |
402 | // TODO: Deal with multiple alarms | 402 | // TODO: Deal with multiple alarms |
403 | break; // For now, stop after the first alarm | 403 | break; // For now, stop after the first alarm |
404 | } | 404 | } |
405 | } else { | 405 | } else { |
406 | Alarm* alarm = inc->alarms().first(); | 406 | Alarm* alarm = inc->alarms().first(); |
407 | if ( alarm ) { | 407 | if ( alarm ) { |
408 | alarm->setEnabled(false); | 408 | alarm->setEnabled(false); |
409 | alarm->setType(Alarm::Invalid); | 409 | alarm->setType(Alarm::Invalid); |
410 | } | 410 | } |
411 | } | 411 | } |
412 | temp = item; | 412 | temp = item; |
413 | item = sel.next(); | 413 | item = sel.next(); |
414 | mUidDict.remove( inc->uid() ); | 414 | mUidDict.remove( inc->uid() ); |
415 | delete temp;; | 415 | delete temp;; |
416 | addIncidence( inc ); | 416 | addIncidence( inc ); |
417 | } | 417 | } |
418 | topLevelWidget()->setCaption( i18n("Canged alarm for %1 items").arg( count ) ); | 418 | topLevelWidget()->setCaption( i18n("Canged alarm for %1 items").arg( count ) ); |
419 | qDebug("KO: Set alarm for %d items", count); | 419 | qDebug("KO: Set alarm for %d items", count); |
420 | calendar()->reInitAlarmSettings(); | 420 | calendar()->reInitAlarmSettings(); |
421 | } | 421 | } |
422 | void KOListView::setCategories( bool removeOld ) | 422 | void KOListView::setCategories( bool removeOld ) |
423 | { | 423 | { |
424 | 424 | ||
425 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 425 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |
426 | if (! csd->exec()) { | 426 | if (! csd->exec()) { |
427 | delete csd; | 427 | delete csd; |
428 | return; | 428 | return; |
429 | } | 429 | } |
430 | QStringList catList = csd->selectedCategories(); | 430 | QStringList catList = csd->selectedCategories(); |
431 | delete csd; | 431 | delete csd; |
432 | // if ( catList.count() == 0 ) | 432 | // if ( catList.count() == 0 ) |
433 | // return; | 433 | // return; |
434 | catList.sort(); | 434 | catList.sort(); |
435 | QString categoriesStr = catList.join(","); | 435 | QString categoriesStr = catList.join(","); |
436 | int i; | 436 | int i; |
437 | QStringList itemList; | 437 | QStringList itemList; |
438 | QPtrList<KOListViewItem> sel ; | 438 | QPtrList<KOListViewItem> sel ; |
439 | QListViewItem *qitem = mListView->firstChild (); | 439 | QListViewItem *qitem = mListView->firstChild (); |
440 | while ( qitem ) { | 440 | while ( qitem ) { |
441 | if ( qitem->isSelected() ) { | 441 | if ( qitem->isSelected() ) { |
442 | sel.append(((KOListViewItem *)qitem)); | 442 | sel.append(((KOListViewItem *)qitem)); |
443 | } | 443 | } |
444 | qitem = qitem->nextSibling(); | 444 | qitem = qitem->nextSibling(); |
445 | } | 445 | } |
446 | KOListViewItem * item, *temp; | 446 | KOListViewItem * item, *temp; |
447 | item = sel.first(); | 447 | item = sel.first(); |
448 | Incidence* inc; | 448 | Incidence* inc; |
449 | while ( item ) { | 449 | while ( item ) { |
450 | inc = item->data(); | 450 | inc = item->data(); |
451 | if ( removeOld ) { | 451 | if ( removeOld ) { |
452 | inc->setCategories( categoriesStr ); | 452 | inc->setCategories( categoriesStr ); |
453 | } else { | 453 | } else { |
454 | itemList = QStringList::split (",", inc->categoriesStr() ); | 454 | itemList = QStringList::split (",", inc->categoriesStr() ); |
455 | for( i = 0; i< catList.count(); ++i ) { | 455 | for( i = 0; i< catList.count(); ++i ) { |
456 | if ( !itemList.contains (catList[i])) | 456 | if ( !itemList.contains (catList[i])) |
457 | itemList.append( catList[i] ); | 457 | itemList.append( catList[i] ); |
458 | } | 458 | } |
459 | itemList.sort(); | 459 | itemList.sort(); |
460 | inc->setCategories( itemList.join(",") ); | 460 | inc->setCategories( itemList.join(",") ); |
461 | } | 461 | } |
462 | temp = item; | 462 | temp = item; |
463 | item = sel.next(); | 463 | item = sel.next(); |
464 | mUidDict.remove( inc->uid() ); | 464 | mUidDict.remove( inc->uid() ); |
465 | delete temp;; | 465 | delete temp;; |
466 | addIncidence( inc ); | 466 | addIncidence( inc ); |
467 | } | 467 | } |
468 | } | 468 | } |
469 | 469 | ||
470 | void KOListView::beamSelected() | 470 | void KOListView::beamSelected() |
471 | { | 471 | { |
472 | int icount = 0; | 472 | int icount = 0; |
473 | QPtrList<Incidence> delSel ; | 473 | QPtrList<Incidence> delSel ; |
474 | QListViewItem *item = mListView->firstChild (); | 474 | QListViewItem *item = mListView->firstChild (); |
475 | while ( item ) { | 475 | while ( item ) { |
476 | if ( item->isSelected() ) { | 476 | if ( item->isSelected() ) { |
477 | delSel.append(((KOListViewItem *)item)->data()); | 477 | delSel.append(((KOListViewItem *)item)->data()); |
478 | ++icount; | 478 | ++icount; |
479 | } | 479 | } |
480 | 480 | ||
481 | item = item->nextSibling(); | 481 | item = item->nextSibling(); |
482 | } | 482 | } |
483 | if ( icount ) { | 483 | if ( icount ) { |
484 | emit beamIncidenceList( delSel ); | 484 | emit beamIncidenceList( delSel ); |
485 | return; | 485 | return; |
486 | QString fn ; | 486 | QString fn ; |
487 | fn = QDir::homeDirPath()+"/kopitempbeamfile.vcs"; | 487 | fn = QDir::homeDirPath()+"/kopitempbeamfile.vcs"; |
488 | QString mes; | 488 | QString mes; |
489 | bool createbup = true; | 489 | bool createbup = true; |
490 | if ( createbup ) { | 490 | if ( createbup ) { |
491 | QString description = "\n"; | 491 | QString description = "\n"; |
492 | CalendarLocal* cal = new CalendarLocal(); | 492 | CalendarLocal* cal = new CalendarLocal(); |
493 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 493 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
494 | Incidence *incidence = delSel.first(); | 494 | Incidence *incidence = delSel.first(); |
495 | while ( incidence ) { | 495 | while ( incidence ) { |
496 | Incidence *in = incidence->clone(); | 496 | Incidence *in = incidence->clone(); |
497 | description += in->summary() + "\n"; | 497 | description += in->summary() + "\n"; |
498 | cal->addIncidence( in ); | 498 | cal->addIncidence( in ); |
499 | incidence = delSel.next(); | 499 | incidence = delSel.next(); |
500 | } | 500 | } |
501 | FileStorage storage( cal, fn, new VCalFormat ); | 501 | FileStorage storage( cal, fn, new VCalFormat ); |
502 | storage.save(); | 502 | storage.save(); |
503 | delete cal; | 503 | delete cal; |
504 | mes = i18n("KO/Pi: Ready for beaming"); | 504 | mes = i18n("KO/Pi: Ready for beaming"); |
505 | topLevelWidget()->setCaption(mes); | 505 | topLevelWidget()->setCaption(mes); |
506 | 506 | ||
507 | #ifndef DESKTOP_VERSION | 507 | #ifndef DESKTOP_VERSION |
508 | Ir *ir = new Ir( this ); | 508 | Ir *ir = new Ir( this ); |
509 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 509 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
510 | ir->send( fn, description, "text/x-vCalendar" ); | 510 | ir->send( fn, description, "text/x-vCalendar" ); |
511 | #endif | 511 | #endif |
512 | } | 512 | } |
513 | } | 513 | } |
514 | } | 514 | } |
515 | void KOListView::beamDone( Ir *ir ) | 515 | void KOListView::beamDone( Ir *ir ) |
516 | { | 516 | { |
517 | #ifndef DESKTOP_VERSION | 517 | #ifndef DESKTOP_VERSION |
518 | delete ir; | 518 | delete ir; |
519 | #endif | 519 | #endif |
520 | topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done")); | 520 | topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done")); |
521 | } | 521 | } |
522 | 522 | ||
523 | void KOListView::saveDescriptionToFile() | 523 | void KOListView::saveDescriptionToFile() |
524 | { | 524 | { |
525 | 525 | ||
526 | int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), | 526 | int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), |
527 | i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), | 527 | i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), |
528 | i18n("Continue"), i18n("Cancel"), 0, | 528 | i18n("Continue"), i18n("Cancel"), 0, |
529 | 0, 1 ); | 529 | 0, 1 ); |
530 | if ( result != 0 ) { | 530 | if ( result != 0 ) { |
531 | return; | 531 | return; |
532 | } | 532 | } |
533 | int icount = 0; | 533 | int icount = 0; |
534 | QPtrList<Incidence> delSel ; | 534 | QPtrList<Incidence> delSel ; |
535 | QListViewItem *item = mListView->firstChild (); | 535 | QListViewItem *item = mListView->firstChild (); |
536 | while ( item ) { | 536 | while ( item ) { |
537 | if ( item->isSelected() ) { | 537 | if ( item->isSelected() ) { |
538 | delSel.append(((KOListViewItem *)item)->data()); | 538 | delSel.append(((KOListViewItem *)item)->data()); |
539 | ++icount; | 539 | ++icount; |
540 | } | 540 | } |
541 | 541 | ||
542 | item = item->nextSibling(); | 542 | item = item->nextSibling(); |
543 | } | 543 | } |
544 | if ( icount ) { | 544 | if ( icount ) { |
545 | QString fn = KOPrefs::instance()->mLastSaveFile; | 545 | QString fn = KOPrefs::instance()->mLastSaveFile; |
546 | fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); | 546 | fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); |
547 | 547 | ||
548 | if ( fn == "" ) | 548 | if ( fn == "" ) |
549 | return; | 549 | return; |
550 | QFileInfo info; | 550 | QFileInfo info; |
551 | info.setFile( fn ); | 551 | info.setFile( fn ); |
552 | QString mes; | 552 | QString mes; |
553 | bool createbup = true; | 553 | bool createbup = true; |
554 | if ( info. exists() ) { | 554 | if ( info. exists() ) { |
555 | mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 555 | mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
556 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 556 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
557 | i18n("Overwrite!"), i18n("Cancel"), 0, | 557 | i18n("Overwrite!"), i18n("Cancel"), 0, |
558 | 0, 1 ); | 558 | 0, 1 ); |
559 | if ( result != 0 ) { | 559 | if ( result != 0 ) { |
560 | createbup = false; | 560 | createbup = false; |
561 | } | 561 | } |
562 | } | 562 | } |
563 | if ( createbup ) { | 563 | if ( createbup ) { |
564 | QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") + | 564 | QString text = i18n("KO/Pi Description/Journal save file.\nSave date: ") + |
565 | KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false); | 565 | KGlobal::locale()->formatDateTime(QDateTime::currentDateTime(), false); |
566 | Incidence *incidence = delSel.first(); | 566 | Incidence *incidence = delSel.first(); |
567 | icount = 0; | 567 | icount = 0; |
568 | while ( incidence ) { | 568 | while ( incidence ) { |
569 | if ( incidence->type() == "Journal" ) { | 569 | if ( incidence->type() == "Journal" ) { |
570 | text += "\n************************************\n"; | 570 | text += "\n************************************\n"; |
571 | text += i18n("Journal from: ") +incidence->dtStartDateStr( false ); | 571 | text += i18n("Journal from: ") +incidence->dtStartDateStr( false ); |
572 | text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); | 572 | text +="\n" + i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); |
573 | text +="\n" + i18n("Description: ") + "\n"+ incidence->description(); | 573 | text +="\n" + i18n("Description: ") + "\n"+ incidence->description(); |
574 | ++icount; | 574 | ++icount; |
575 | 575 | ||
576 | } else { | 576 | } else { |
577 | if ( !incidence->description().isEmpty() ) { | 577 | if ( !incidence->description().isEmpty() ) { |
578 | text += "\n************************************\n"; | 578 | text += "\n************************************\n"; |
579 | if ( incidence->type() == "Todo" ) | 579 | if ( incidence->type() == "Todo" ) |
580 | text += i18n("To-Do: "); | 580 | text += i18n("To-Do: "); |
581 | text += incidence->summary(); | 581 | text += incidence->summary(); |
582 | if ( incidence->hasStartDate() ) | 582 | if ( incidence->hasStartDate() ) |
583 | text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false ); | 583 | text +="\n"+ i18n("Start Date: ") + incidence->dtStartStr( false ); |
584 | text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); | 584 | text +="\n"+ i18n("Last modified: ") +KGlobal::locale()->formatDateTime(incidence->lastModified(), false); |
585 | if ( !incidence->location().isEmpty() ) | 585 | if ( !incidence->location().isEmpty() ) |
586 | text += "\n" +i18n("Location: ") + incidence->location(); | 586 | text += "\n" +i18n("Location: ") + incidence->location(); |
587 | text += "\n" + i18n("Description: ") + "\n" + incidence->description(); | 587 | text += "\n" + i18n("Description: ") + "\n" + incidence->description(); |
588 | ++icount; | 588 | ++icount; |
589 | 589 | ||
590 | } | 590 | } |
591 | } | 591 | } |
592 | incidence = delSel.next(); | 592 | incidence = delSel.next(); |
593 | } | 593 | } |
594 | QFile file( fn ); | 594 | QFile file( fn ); |
595 | if (!file.open( IO_WriteOnly ) ) { | 595 | if (!file.open( IO_WriteOnly ) ) { |
596 | topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); | 596 | topLevelWidget()->setCaption(i18n("File open error - nothing saved!") ); |
597 | return; | 597 | return; |
598 | } | 598 | } |
599 | QTextStream ts( &file ); | 599 | QTextStream ts( &file ); |
600 | ts << text; | 600 | ts << text; |
601 | file.close(); | 601 | file.close(); |
602 | //qDebug("%s ", text.latin1()); | 602 | //qDebug("%s ", text.latin1()); |
603 | mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); | 603 | mes = i18n("KO/Pi:Saved %1 descriptions/journals").arg(icount ); |
604 | KOPrefs::instance()->mLastSaveFile = fn; | 604 | KOPrefs::instance()->mLastSaveFile = fn; |
605 | topLevelWidget()->setCaption(mes); | 605 | topLevelWidget()->setCaption(mes); |
606 | } | 606 | } |
607 | } | 607 | } |
608 | } | 608 | } |
609 | void KOListView::saveToFile() | 609 | void KOListView::saveToFile() |
610 | { | 610 | { |
611 | 611 | ||
612 | int icount = 0; | 612 | int icount = 0; |
613 | QPtrList<Incidence> delSel ; | 613 | QPtrList<Incidence> delSel ; |
614 | QListViewItem *item = mListView->firstChild (); | 614 | QListViewItem *item = mListView->firstChild (); |
615 | while ( item ) { | 615 | while ( item ) { |
616 | if ( item->isSelected() ) { | 616 | if ( item->isSelected() ) { |
617 | delSel.append(((KOListViewItem *)item)->data()); | 617 | delSel.append(((KOListViewItem *)item)->data()); |
618 | ++icount; | 618 | ++icount; |
619 | } | 619 | } |
620 | 620 | ||
621 | item = item->nextSibling(); | 621 | item = item->nextSibling(); |
622 | } | 622 | } |
623 | if ( icount ) { | 623 | if ( icount ) { |
624 | QString fn = KOPrefs::instance()->mLastSaveFile; | 624 | QString fn = KOPrefs::instance()->mLastSaveFile; |
625 | fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); | 625 | fn = KFileDialog::getSaveFileName( fn, i18n("Save filename"), this ); |
626 | 626 | ||
627 | if ( fn == "" ) | 627 | if ( fn == "" ) |
628 | return; | 628 | return; |
629 | QFileInfo info; | 629 | QFileInfo info; |
630 | info.setFile( fn ); | 630 | info.setFile( fn ); |
631 | QString mes; | 631 | QString mes; |
632 | bool createbup = true; | 632 | bool createbup = true; |
633 | if ( info. exists() ) { | 633 | if ( info. exists() ) { |
634 | mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 634 | mes = i18n("File already exists!\nOld file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
635 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 635 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
636 | i18n("Overwrite!"), i18n("Cancel"), 0, | 636 | i18n("Overwrite!"), i18n("Cancel"), 0, |
637 | 0, 1 ); | 637 | 0, 1 ); |
638 | if ( result != 0 ) { | 638 | if ( result != 0 ) { |
639 | createbup = false; | 639 | createbup = false; |
640 | } | 640 | } |
641 | } | 641 | } |
642 | if ( createbup ) { | 642 | if ( createbup ) { |
643 | CalendarLocal cal; | 643 | CalendarLocal cal; |
644 | cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 644 | cal.setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
645 | Incidence *incidence = delSel.first(); | 645 | Incidence *incidence = delSel.first(); |
646 | while ( incidence ) { | 646 | while ( incidence ) { |
647 | cal.addIncidence( incidence->clone() ); | 647 | cal.addIncidence( incidence->clone() ); |
648 | incidence = delSel.next(); | 648 | incidence = delSel.next(); |
649 | } | 649 | } |
650 | ICalFormat format; | 650 | ICalFormat format; |
651 | format.save( &cal, fn ); | 651 | format.save( &cal, fn ); |
652 | mes = i18n("KO/Pi:Saved %1").arg(fn ); | 652 | mes = i18n("KO/Pi:Saved %1").arg(fn ); |
653 | KOPrefs::instance()->mLastSaveFile = fn; | 653 | KOPrefs::instance()->mLastSaveFile = fn; |
654 | topLevelWidget()->setCaption(mes); | 654 | topLevelWidget()->setCaption(mes); |
655 | } | 655 | } |
656 | } | 656 | } |
657 | } | 657 | } |
658 | void KOListView::deleteAll() | 658 | void KOListView::deleteAll() |
659 | { | 659 | { |
660 | int icount = 0; | 660 | int icount = 0; |
661 | QPtrList<Incidence> delSel ; | 661 | QPtrList<Incidence> delSel ; |
662 | QListViewItem *item = mListView->firstChild (); | 662 | QListViewItem *item = mListView->firstChild (); |
663 | while ( item ) { | 663 | while ( item ) { |
664 | if ( item->isSelected() ) { | 664 | if ( item->isSelected() ) { |
665 | delSel.append(((KOListViewItem *)item)->data()); | 665 | delSel.append(((KOListViewItem *)item)->data()); |
666 | ++icount; | 666 | ++icount; |
667 | } | 667 | } |
668 | 668 | ||
669 | item = item->nextSibling(); | 669 | item = item->nextSibling(); |
670 | } | 670 | } |
671 | if ( icount ) { | 671 | if ( icount ) { |
672 | Incidence *incidence = delSel.first(); | 672 | Incidence *incidence = delSel.first(); |
673 | Incidence *toDelete; | 673 | Incidence *toDelete; |
674 | KOPrefs *p = KOPrefs::instance(); | 674 | KOPrefs *p = KOPrefs::instance(); |
675 | bool confirm = p->mConfirm; | 675 | bool confirm = p->mConfirm; |
676 | QString mess; | 676 | QString mess; |
677 | mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); | 677 | mess = mess.sprintf( i18n("You have %d item(s) selected.\n"), icount ); |
678 | if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { | 678 | if ( KMessageBox::Continue == KMessageBox::warningContinueCancel(this, mess + i18n("All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n"), i18n("KO/Pi Confirmation"),i18n("Delete")) ) { |
679 | p->mConfirm = false; | 679 | p->mConfirm = false; |
680 | int delCounter = 0; | 680 | int delCounter = 0; |
681 | QDialog dia ( this, "p-dialog", true ); | 681 | QDialog dia ( this, "p-dialog", true ); |
682 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); | 682 | QLabel lab (i18n("Close dialog to abort deletion!"), &dia ); |
683 | QVBoxLayout lay( &dia ); | 683 | QVBoxLayout lay( &dia ); |
684 | lay.setMargin(7); | 684 | lay.setMargin(7); |
685 | lay.setSpacing(7); | 685 | lay.setSpacing(7); |
686 | lay.addWidget( &lab); | 686 | lay.addWidget( &lab); |
687 | QProgressBar bar( icount, &dia ); | 687 | QProgressBar bar( icount, &dia ); |
688 | lay.addWidget( &bar); | 688 | lay.addWidget( &bar); |
689 | int w = 220; | 689 | int w = 220; |
690 | int h = 50; | 690 | int h = 50; |
691 | int dw = QApplication::desktop()->width(); | 691 | int dw = QApplication::desktop()->width(); |
692 | int dh = QApplication::desktop()->height(); | 692 | int dh = QApplication::desktop()->height(); |
693 | dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 693 | dia.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
694 | //dia.resize( 240,50 ); | 694 | //dia.resize( 240,50 ); |
695 | dia.show(); | 695 | dia.show(); |
696 | 696 | ||
697 | while ( incidence ) { | 697 | while ( incidence ) { |
698 | bar.setProgress( delCounter ); | 698 | bar.setProgress( delCounter ); |
699 | mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); | 699 | mess = mess.sprintf( i18n("Deleting item %d ..."), ++delCounter ); |
700 | dia.setCaption( mess ); | 700 | dia.setCaption( mess ); |
701 | qApp->processEvents(); | 701 | qApp->processEvents(); |
702 | toDelete = (incidence); | 702 | toDelete = (incidence); |
703 | incidence = delSel.next(); | 703 | incidence = delSel.next(); |
704 | emit deleteIncidenceSignal(toDelete ); | 704 | emit deleteIncidenceSignal(toDelete ); |
705 | if ( dia.result() != 0 ) | 705 | if ( dia.result() != 0 ) |
706 | break; | 706 | break; |
707 | 707 | ||
708 | } | 708 | } |
709 | mess = mess.sprintf( i18n("%d items remaining in list."), count() ); | 709 | mess = mess.sprintf( i18n("%d items remaining in list."), count() ); |
710 | topLevelWidget ()->setCaption( mess ); | 710 | topLevelWidget ()->setCaption( mess ); |
711 | p->mConfirm = confirm; | 711 | p->mConfirm = confirm; |
712 | } | 712 | } |
713 | } | 713 | } |
714 | 714 | ||
715 | 715 | ||
716 | } | 716 | } |
717 | int KOListView::maxDatesHint() | 717 | int KOListView::maxDatesHint() |
718 | { | 718 | { |
719 | return 0; | 719 | return 0; |
720 | } | 720 | } |
721 | 721 | ||
722 | int KOListView::currentDateCount() | 722 | int KOListView::currentDateCount() |
723 | { | 723 | { |
724 | return 0; | 724 | return 0; |
725 | } | 725 | } |
726 | 726 | ||
727 | QPtrList<Incidence> KOListView::selectedIncidences() | 727 | QPtrList<Incidence> KOListView::selectedIncidences() |
728 | { | 728 | { |
729 | QPtrList<Incidence> eventList; | 729 | QPtrList<Incidence> eventList; |
730 | QListViewItem *item = mListView->firstChild (); | 730 | QListViewItem *item = mListView->firstChild (); |
731 | while ( item ) { | 731 | while ( item ) { |
732 | if ( item->isSelected() ) { | 732 | if ( item->isSelected() ) { |
733 | eventList.append(((KOListViewItem *)item)->data()); | 733 | eventList.append(((KOListViewItem *)item)->data()); |
734 | } | 734 | } |
735 | 735 | ||
736 | item = item->nextSibling(); | 736 | item = item->nextSibling(); |
737 | } | 737 | } |
738 | 738 | ||
739 | // // QListViewItem *item = mListView->selectedItem(); | 739 | // // QListViewItem *item = mListView->selectedItem(); |
740 | //if (item) eventList.append(((KOListViewItem *)item)->data()); | 740 | //if (item) eventList.append(((KOListViewItem *)item)->data()); |
741 | 741 | ||
742 | return eventList; | 742 | return eventList; |
743 | } | 743 | } |
744 | 744 | ||
745 | DateList KOListView::selectedDates() | 745 | DateList KOListView::selectedDates() |
746 | { | 746 | { |
747 | DateList eventList; | 747 | DateList eventList; |
748 | return eventList; | 748 | return eventList; |
749 | } | 749 | } |
750 | 750 | ||
751 | void KOListView::showDates(bool show) | 751 | void KOListView::showDates(bool show) |
752 | { | 752 | { |
753 | // Shouldn't we set it to a value greater 0? When showDates is called with | 753 | // Shouldn't we set it to a value greater 0? When showDates is called with |
754 | // show == true at first, then the columnwidths are set to zero. | 754 | // show == true at first, then the columnwidths are set to zero. |
755 | static int oldColWidth1 = 0; | 755 | static int oldColWidth1 = 0; |
756 | static int oldColWidth3 = 0; | 756 | static int oldColWidth3 = 0; |
757 | 757 | ||
758 | if (!show) { | 758 | if (!show) { |
759 | oldColWidth1 = mListView->columnWidth(1); | 759 | oldColWidth1 = mListView->columnWidth(1); |
760 | oldColWidth3 = mListView->columnWidth(3); | 760 | oldColWidth3 = mListView->columnWidth(3); |
761 | mListView->setColumnWidth(1, 0); | 761 | mListView->setColumnWidth(1, 0); |
762 | mListView->setColumnWidth(3, 0); | 762 | mListView->setColumnWidth(3, 0); |
763 | } else { | 763 | } else { |
764 | mListView->setColumnWidth(1, oldColWidth1); | 764 | mListView->setColumnWidth(1, oldColWidth1); |
765 | mListView->setColumnWidth(3, oldColWidth3); | 765 | mListView->setColumnWidth(3, oldColWidth3); |
766 | } | 766 | } |
767 | mListView->repaint(); | 767 | mListView->repaint(); |
768 | } | 768 | } |
769 | 769 | ||
770 | void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 770 | void KOListView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
771 | const QDate &td) | 771 | const QDate &td) |
772 | { | 772 | { |
773 | #ifndef KORG_NOPRINTER | 773 | #ifndef KORG_NOPRINTER |
774 | calPrinter->preview(CalPrinter::Day, fd, td); | 774 | calPrinter->preview(CalPrinter::Day, fd, td); |
775 | #endif | 775 | #endif |
776 | } | 776 | } |
777 | 777 | ||
778 | void KOListView::showDates() | 778 | void KOListView::showDates() |
779 | { | 779 | { |
780 | showDates(true); | 780 | showDates(true); |
781 | } | 781 | } |
782 | 782 | ||
783 | void KOListView::hideDates() | 783 | void KOListView::hideDates() |
784 | { | 784 | { |
785 | showDates(false); | 785 | showDates(false); |
786 | } | 786 | } |
787 | 787 | ||
788 | void KOListView::updateView() | 788 | void KOListView::updateView() |
789 | { | 789 | { |
790 | mListView->setFocus(); | 790 | mListView->setFocus(); |
791 | if ( mListView->firstChild () ) | 791 | if ( mListView->firstChild () ) |
792 | mListView->setCurrentItem( mListView->firstChild () ); | 792 | mListView->setCurrentItem( mListView->firstChild () ); |
793 | } | 793 | } |
794 | void KOListView::updateConfig() | 794 | void KOListView::updateConfig() |
795 | { | 795 | { |
796 | 796 | ||
797 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 797 | mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
798 | updateView(); | 798 | updateView(); |
799 | 799 | ||
800 | } | 800 | } |
801 | void KOListView::setStartDate(const QDate &start) | 801 | void KOListView::setStartDate(const QDate &start) |
802 | { | 802 | { |
803 | mStartDate = start; | 803 | mStartDate = start; |
804 | } | 804 | } |
805 | 805 | ||
806 | void KOListView::showDates(const QDate &start, const QDate &end) | 806 | void KOListView::showDates(const QDate &start, const QDate &end) |
807 | { | 807 | { |
808 | clear(); | 808 | clear(); |
809 | mStartDate = start; | 809 | mStartDate = start; |
810 | QDate date = start; | 810 | QDate date = start; |
811 | QPtrList<Journal> j_list; | 811 | QPtrList<Journal> j_list; |
812 | while( date <= end ) { | 812 | while( date <= end ) { |
813 | addEvents(calendar()->events(date)); | 813 | addEvents(calendar()->events(date)); |
814 | addTodos(calendar()->todos(date)); | 814 | addTodos(calendar()->todos(date)); |
815 | Journal* jo = calendar()->journal(date); | 815 | Journal* jo = calendar()->journal(date); |
816 | if ( jo ) | 816 | if ( jo ) |
817 | j_list.append( jo ); | 817 | j_list.append( jo ); |
818 | date = date.addDays( 1 ); | 818 | date = date.addDays( 1 ); |
819 | } | 819 | } |
820 | addJournals(j_list); | 820 | addJournals(j_list); |
821 | emit incidenceSelected( 0 ); | 821 | emit incidenceSelected( 0 ); |
822 | updateView(); | 822 | updateView(); |
823 | 823 | ||
824 | } | 824 | } |
825 | 825 | ||
826 | void KOListView::addEvents(QPtrList<Event> eventList) | 826 | void KOListView::addEvents(QPtrList<Event> eventList) |
827 | { | 827 | { |
828 | Event *ev; | 828 | Event *ev; |
829 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 829 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
830 | addIncidence(ev); | 830 | addIncidence(ev); |
831 | } | 831 | } |
832 | if ( !mListView->currentItem() ){ | 832 | if ( !mListView->currentItem() ){ |
833 | updateView(); | 833 | updateView(); |
834 | } | 834 | } |
835 | } | 835 | } |
836 | 836 | ||
837 | void KOListView::addTodos(QPtrList<Todo> eventList) | 837 | void KOListView::addTodos(QPtrList<Todo> eventList) |
838 | { | 838 | { |
839 | Todo *ev; | 839 | Todo *ev; |
840 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 840 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
841 | addIncidence(ev); | 841 | addIncidence(ev); |
842 | } | 842 | } |
843 | if ( !mListView->currentItem() ){ | 843 | if ( !mListView->currentItem() ){ |
844 | updateView(); | 844 | updateView(); |
845 | } | 845 | } |
846 | } | 846 | } |
847 | void KOListView::addJournals(QPtrList<Journal> eventList) | 847 | void KOListView::addJournals(QPtrList<Journal> eventList) |
848 | { | 848 | { |
849 | Journal *ev; | 849 | Journal *ev; |
850 | for(ev = eventList.first(); ev; ev = eventList.next()) { | 850 | for(ev = eventList.first(); ev; ev = eventList.next()) { |
851 | addIncidence(ev); | 851 | addIncidence(ev); |
852 | } | 852 | } |
853 | if ( !mListView->currentItem() ){ | 853 | if ( !mListView->currentItem() ){ |
854 | updateView(); | 854 | updateView(); |
855 | } | 855 | } |
856 | } | 856 | } |
857 | 857 | ||
858 | void KOListView::addIncidence(Incidence *incidence) | 858 | void KOListView::addIncidence(Incidence *incidence) |
859 | { | 859 | { |
860 | if ( mUidDict.find( incidence->uid() ) ) return; | 860 | if ( mUidDict.find( incidence->uid() ) ) return; |
861 | 861 | ||
862 | // mListView->setFont ( KOPrefs::instance()->mListViewFont ); | 862 | // mListView->setFont ( KOPrefs::instance()->mListViewFont ); |
863 | mUidDict.insert( incidence->uid(), incidence ); | 863 | mUidDict.insert( incidence->uid(), incidence ); |
864 | 864 | ||
865 | KOListViewItem *item = new KOListViewItem( incidence, mListView ); | 865 | KOListViewItem *item = new KOListViewItem( incidence, mListView ); |
866 | ListItemVisitor v(item, mStartDate ); | 866 | ListItemVisitor v(item, mStartDate ); |
867 | if (incidence->accept(v)) return; | 867 | if (incidence->accept(v)) return; |
868 | else delete item; | 868 | else delete item; |
869 | //qDebug("delete item "); | 869 | //qDebug("delete item "); |
870 | } | 870 | } |
871 | 871 | ||
872 | void KOListView::showEvents(QPtrList<Event> eventList) | 872 | void KOListView::showEvents(QPtrList<Event> eventList) |
873 | { | 873 | { |
874 | clear(); | 874 | clear(); |
875 | 875 | ||
876 | addEvents(eventList); | 876 | addEvents(eventList); |
877 | 877 | ||
878 | // After new creation of list view no events are selected. | 878 | // After new creation of list view no events are selected. |
879 | emit incidenceSelected( 0 ); | 879 | emit incidenceSelected( 0 ); |
880 | } | 880 | } |
881 | int KOListView::count() | 881 | int KOListView::count() |
882 | { | 882 | { |
883 | return mListView->childCount(); | 883 | return mListView->childCount(); |
884 | } | 884 | } |
885 | 885 | ||
886 | void KOListView::changeEventDisplay(Event *event, int action) | 886 | void KOListView::changeEventDisplay(Event *event, int action) |
887 | { | 887 | { |
888 | KOListViewItem *item; | 888 | KOListViewItem *item; |
889 | 889 | ||
890 | switch(action) { | 890 | switch(action) { |
891 | case KOGlobals::EVENTADDED: | 891 | case KOGlobals::EVENTADDED: |
892 | addIncidence( event ); | 892 | addIncidence( event ); |
893 | break; | 893 | break; |
894 | case KOGlobals::EVENTEDITED: | 894 | case KOGlobals::EVENTEDITED: |
895 | item = getItemForEvent(event); | 895 | item = getItemForEvent(event); |
896 | if (item) { | 896 | if (item) { |
897 | mUidDict.remove( event->uid() ); | 897 | mUidDict.remove( event->uid() ); |
898 | delete item; | 898 | delete item; |
899 | addIncidence( event ); | 899 | addIncidence( event ); |
900 | } | 900 | } |
901 | break; | 901 | break; |
902 | case KOGlobals::EVENTDELETED: | 902 | case KOGlobals::EVENTDELETED: |
903 | item = getItemForEvent(event); | 903 | item = getItemForEvent(event); |
904 | if (item) { | 904 | if (item) { |
905 | mUidDict.remove( event->uid() ); | 905 | mUidDict.remove( event->uid() ); |
906 | delete item; | 906 | delete item; |
907 | } | 907 | } |
908 | break; | 908 | break; |
909 | default: | 909 | default: |
910 | ; | 910 | ; |
911 | } | 911 | } |
912 | } | 912 | } |
913 | 913 | ||
914 | KOListViewItem *KOListView::getItemForEvent(Event *event) | 914 | KOListViewItem *KOListView::getItemForEvent(Event *event) |
915 | { | 915 | { |
916 | KOListViewItem *item = (KOListViewItem *)mListView->firstChild(); | 916 | KOListViewItem *item = (KOListViewItem *)mListView->firstChild(); |
917 | while (item) { | 917 | while (item) { |
918 | if (item->data() == event) return item; | 918 | if (item->data() == event) return item; |
919 | item = (KOListViewItem *)item->nextSibling(); | 919 | item = (KOListViewItem *)item->nextSibling(); |
920 | } | 920 | } |
921 | return 0; | 921 | return 0; |
922 | } | 922 | } |
923 | 923 | ||
924 | void KOListView::defaultItemAction(QListViewItem *i) | 924 | void KOListView::defaultItemAction(QListViewItem *i) |
925 | { | 925 | { |
926 | KOListViewItem *item = static_cast<KOListViewItem *>( i ); | 926 | KOListViewItem *item = static_cast<KOListViewItem *>( i ); |
927 | if ( item ) defaultAction( item->data() ); | 927 | if ( item ) defaultAction( item->data() ); |
928 | 928 | ||
929 | } | 929 | } |
930 | 930 | ||
931 | void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) | 931 | void KOListView::popupMenu(QListViewItem *item,const QPoint &,int) |
932 | { | 932 | { |
933 | mActiveItem = (KOListViewItem *)item; | 933 | mActiveItem = (KOListViewItem *)item; |
934 | if (mActiveItem) { | 934 | if (mActiveItem) { |
935 | Incidence *incidence = mActiveItem->data(); | 935 | Incidence *incidence = mActiveItem->data(); |
936 | mPopupMenu->showIncidencePopup(incidence); | 936 | mPopupMenu->showIncidencePopup(incidence); |
937 | 937 | ||
938 | /* | 938 | /* |
939 | if ( incidence && incidence->type() == "Event" ) { | 939 | if ( incidence && incidence->type() == "Event" ) { |
940 | Event *event = static_cast<Event *>( incidence ); | 940 | Event *event = static_cast<Event *>( incidence ); |
941 | mPopupMenu->showEventPopup(event); | 941 | mPopupMenu->showEventPopup(event); |
942 | } | 942 | } |
943 | */ | 943 | */ |
944 | } | 944 | } |
945 | } | 945 | } |
946 | 946 | ||
947 | void KOListView::readSettings(KConfig *config, QString setting) | 947 | void KOListView::readSettings(KConfig *config, QString setting) |
948 | { | 948 | { |
949 | // qDebug("KOListView::readSettings "); | 949 | // qDebug("KOListView::readSettings "); |
950 | mListView->restoreLayout(config,setting); | 950 | mListView->restoreLayout(config,setting); |
951 | } | 951 | } |
952 | 952 | ||
953 | void KOListView::writeSettings(KConfig *config, QString setting) | 953 | void KOListView::writeSettings(KConfig *config, QString setting) |
954 | { | 954 | { |
955 | // qDebug("KOListView::writeSettings "); | 955 | // qDebug("KOListView::writeSettings "); |
956 | mListView->saveLayout(config, setting); | 956 | mListView->saveLayout(config, setting); |
957 | } | 957 | } |
958 | 958 | ||
959 | void KOListView::processSelectionChange(QListViewItem *) | 959 | void KOListView::processSelectionChange(QListViewItem *) |
960 | { | 960 | { |
961 | 961 | ||
962 | KOListViewItem *item = | 962 | KOListViewItem *item = |
963 | static_cast<KOListViewItem *>( mListView->currentItem() ); | 963 | static_cast<KOListViewItem *>( mListView->currentItem() ); |
964 | 964 | ||
965 | if ( !item ) { | 965 | if ( !item ) { |
diff --git a/libkcal/recurrence.cpp b/libkcal/recurrence.cpp index 5181eaf..8a175c9 100644 --- a/libkcal/recurrence.cpp +++ b/libkcal/recurrence.cpp | |||
@@ -1,980 +1,986 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 1998 Preston Brown | 3 | Copyright (c) 1998 Preston Brown |
4 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 4 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
5 | Copyright (c) 2002 David Jarvie <software@astrojar.org.uk> | 5 | Copyright (c) 2002 David Jarvie <software@astrojar.org.uk> |
6 | 6 | ||
7 | This library is free software; you can redistribute it and/or | 7 | This library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public | 8 | modify it under the terms of the GNU Library General Public |
9 | License as published by the Free Software Foundation; either | 9 | License as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. | 10 | version 2 of the License, or (at your option) any later version. |
11 | 11 | ||
12 | This library is distributed in the hope that it will be useful, | 12 | This library is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Library General Public License for more details. | 15 | Library General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU Library General Public License | 17 | You should have received a copy of the GNU Library General Public License |
18 | along with this library; see the file COPYING.LIB. If not, write to | 18 | along with this library; see the file COPYING.LIB. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <limits.h> | 23 | #include <limits.h> |
24 | 24 | ||
25 | #include <kdebug.h> | 25 | #include <kdebug.h> |
26 | #include <kglobal.h> | 26 | #include <kglobal.h> |
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | 28 | ||
29 | #include "incidence.h" | 29 | #include "incidence.h" |
30 | 30 | ||
31 | #include "recurrence.h" | 31 | #include "recurrence.h" |
32 | 32 | ||
33 | using namespace KCal; | 33 | using namespace KCal; |
34 | 34 | ||
35 | Recurrence::Feb29Type Recurrence::mFeb29YearlyDefaultType = Recurrence::rMar1; | 35 | Recurrence::Feb29Type Recurrence::mFeb29YearlyDefaultType = Recurrence::rMar1; |
36 | 36 | ||
37 | 37 | ||
38 | Recurrence::Recurrence(Incidence *parent, int compatVersion) | 38 | Recurrence::Recurrence(Incidence *parent, int compatVersion) |
39 | : recurs(rNone), // by default, it's not a recurring event | 39 | : recurs(rNone), // by default, it's not a recurring event |
40 | rWeekStart(1), // default is Monday | 40 | rWeekStart(1), // default is Monday |
41 | rDays(7), | 41 | rDays(7), |
42 | mFloats(parent ? parent->doesFloat() : false), | 42 | mFloats(parent ? parent->doesFloat() : false), |
43 | mRecurReadOnly(false), | 43 | mRecurReadOnly(false), |
44 | mRecurExDatesCount(0), | 44 | mRecurExDatesCount(0), |
45 | mFeb29YearlyType(mFeb29YearlyDefaultType), | 45 | mFeb29YearlyType(mFeb29YearlyDefaultType), |
46 | mCompatVersion(compatVersion ? compatVersion : INT_MAX), | 46 | mCompatVersion(compatVersion ? compatVersion : INT_MAX), |
47 | mCompatRecurs(rNone), | 47 | mCompatRecurs(rNone), |
48 | mCompatDuration(0), | 48 | mCompatDuration(0), |
49 | mParent(parent) | 49 | mParent(parent) |
50 | { | 50 | { |
51 | rMonthDays.setAutoDelete( true ); | 51 | rMonthDays.setAutoDelete( true ); |
52 | rMonthPositions.setAutoDelete( true ); | 52 | rMonthPositions.setAutoDelete( true ); |
53 | rYearNums.setAutoDelete( true ); | 53 | rYearNums.setAutoDelete( true ); |
54 | } | 54 | } |
55 | 55 | ||
56 | Recurrence::Recurrence(const Recurrence &r, Incidence *parent) | 56 | Recurrence::Recurrence(const Recurrence &r, Incidence *parent) |
57 | : recurs(r.recurs), | 57 | : recurs(r.recurs), |
58 | rWeekStart(r.rWeekStart), | 58 | rWeekStart(r.rWeekStart), |
59 | rDays(r.rDays.copy()), | 59 | rDays(r.rDays.copy()), |
60 | rFreq(r.rFreq), | 60 | rFreq(r.rFreq), |
61 | rDuration(r.rDuration), | 61 | rDuration(r.rDuration), |
62 | rEndDateTime(r.rEndDateTime), | 62 | rEndDateTime(r.rEndDateTime), |
63 | mRecurStart(r.mRecurStart), | 63 | mRecurStart(r.mRecurStart), |
64 | mFloats(r.mFloats), | 64 | mFloats(r.mFloats), |
65 | mRecurReadOnly(r.mRecurReadOnly), | 65 | mRecurReadOnly(r.mRecurReadOnly), |
66 | mRecurExDatesCount(r.mRecurExDatesCount), | 66 | mRecurExDatesCount(r.mRecurExDatesCount), |
67 | mFeb29YearlyType(r.mFeb29YearlyType), | 67 | mFeb29YearlyType(r.mFeb29YearlyType), |
68 | mCompatVersion(r.mCompatVersion), | 68 | mCompatVersion(r.mCompatVersion), |
69 | mCompatRecurs(r.mCompatRecurs), | 69 | mCompatRecurs(r.mCompatRecurs), |
70 | mCompatDuration(r.mCompatDuration), | 70 | mCompatDuration(r.mCompatDuration), |
71 | mParent(parent) | 71 | mParent(parent) |
72 | { | 72 | { |
73 | for (QPtrListIterator<rMonthPos> mp(r.rMonthPositions); mp.current(); ++mp) { | 73 | for (QPtrListIterator<rMonthPos> mp(r.rMonthPositions); mp.current(); ++mp) { |
74 | rMonthPos *tmp = new rMonthPos; | 74 | rMonthPos *tmp = new rMonthPos; |
75 | tmp->rPos = mp.current()->rPos; | 75 | tmp->rPos = mp.current()->rPos; |
76 | tmp->negative = mp.current()->negative; | 76 | tmp->negative = mp.current()->negative; |
77 | tmp->rDays = mp.current()->rDays.copy(); | 77 | tmp->rDays = mp.current()->rDays.copy(); |
78 | rMonthPositions.append(tmp); | 78 | rMonthPositions.append(tmp); |
79 | } | 79 | } |
80 | for (QPtrListIterator<int> md(r.rMonthDays); md.current(); ++md) { | 80 | for (QPtrListIterator<int> md(r.rMonthDays); md.current(); ++md) { |
81 | int *tmp = new int; | 81 | int *tmp = new int; |
82 | *tmp = *md.current(); | 82 | *tmp = *md.current(); |
83 | rMonthDays.append(tmp); | 83 | rMonthDays.append(tmp); |
84 | } | 84 | } |
85 | for (QPtrListIterator<int> yn(r.rYearNums); yn.current(); ++yn) { | 85 | for (QPtrListIterator<int> yn(r.rYearNums); yn.current(); ++yn) { |
86 | int *tmp = new int; | 86 | int *tmp = new int; |
87 | *tmp = *yn.current(); | 87 | *tmp = *yn.current(); |
88 | rYearNums.append(tmp); | 88 | rYearNums.append(tmp); |
89 | } | 89 | } |
90 | rMonthDays.setAutoDelete( true ); | 90 | rMonthDays.setAutoDelete( true ); |
91 | rMonthPositions.setAutoDelete( true ); | 91 | rMonthPositions.setAutoDelete( true ); |
92 | rYearNums.setAutoDelete( true ); | 92 | rYearNums.setAutoDelete( true ); |
93 | } | 93 | } |
94 | 94 | ||
95 | Recurrence::~Recurrence() | 95 | Recurrence::~Recurrence() |
96 | { | 96 | { |
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | bool Recurrence::operator==( const Recurrence& r2 ) const | 100 | bool Recurrence::operator==( const Recurrence& r2 ) const |
101 | { | 101 | { |
102 | 102 | ||
103 | // the following line is obvious | 103 | // the following line is obvious |
104 | if ( recurs == rNone && r2.recurs == rNone ) | 104 | if ( recurs == rNone && r2.recurs == rNone ) |
105 | return true; | 105 | return true; |
106 | // we need the above line, because two non recurring events may | 106 | // we need the above line, because two non recurring events may |
107 | // differ in the other settings, because one (or both) | 107 | // differ in the other settings, because one (or both) |
108 | // may be not initialized properly | 108 | // may be not initialized properly |
109 | 109 | ||
110 | if ( recurs != r2.recurs | 110 | if ( recurs != r2.recurs |
111 | || rFreq != r2.rFreq | 111 | || rFreq != r2.rFreq |
112 | || rDuration != r2.rDuration | 112 | || rDuration != r2.rDuration |
113 | || !rDuration && rEndDateTime != r2.rEndDateTime | 113 | || !rDuration && rEndDateTime != r2.rEndDateTime |
114 | || mRecurStart != r2.mRecurStart | 114 | || mRecurStart != r2.mRecurStart |
115 | || mFloats != r2.mFloats | 115 | || mFloats != r2.mFloats |
116 | || mRecurReadOnly != r2.mRecurReadOnly | 116 | || mRecurReadOnly != r2.mRecurReadOnly |
117 | || mRecurExDatesCount != r2.mRecurExDatesCount ) | 117 | || mRecurExDatesCount != r2.mRecurExDatesCount ) |
118 | return false; | 118 | return false; |
119 | // no need to compare mCompat* and mParent | 119 | // no need to compare mCompat* and mParent |
120 | // OK to compare the pointers | 120 | // OK to compare the pointers |
121 | switch ( recurs ) | 121 | switch ( recurs ) |
122 | { | 122 | { |
123 | case rWeekly: | 123 | case rWeekly: |
124 | return rDays == r2.rDays | 124 | return rDays == r2.rDays |
125 | && rWeekStart == r2.rWeekStart; | 125 | && rWeekStart == r2.rWeekStart; |
126 | case rMonthlyPos: { | 126 | case rMonthlyPos: { |
127 | QPtrList<rMonthPos> MonthPositions = rMonthPositions; | 127 | QPtrList<rMonthPos> MonthPositions = rMonthPositions; |
128 | QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; | 128 | QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; |
129 | if ( !MonthPositions.count() ) | 129 | if ( !MonthPositions.count() ) |
130 | return false; | 130 | return false; |
131 | if ( !MonthPositions2.count() ) | 131 | if ( !MonthPositions2.count() ) |
132 | return false; | 132 | return false; |
133 | return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; | 133 | return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; |
134 | } | 134 | } |
135 | case rMonthlyDay: { | 135 | case rMonthlyDay: { |
136 | QPtrList<int> MonthDays = rMonthDays ; | 136 | QPtrList<int> MonthDays = rMonthDays ; |
137 | QPtrList<int> MonthDays2 = r2.rMonthDays ; | 137 | QPtrList<int> MonthDays2 = r2.rMonthDays ; |
138 | if ( !MonthDays.count() ) | 138 | if ( !MonthDays.count() ) |
139 | return false; | 139 | return false; |
140 | if ( !MonthDays2.count() ) | 140 | if ( !MonthDays2.count() ) |
141 | return false; | 141 | return false; |
142 | return *MonthDays.first() == *MonthDays2.first() ; | 142 | return *MonthDays.first() == *MonthDays2.first() ; |
143 | } | 143 | } |
144 | case rYearlyPos: { | 144 | case rYearlyPos: { |
145 | 145 | ||
146 | QPtrList<int> YearNums = rYearNums; | 146 | QPtrList<int> YearNums = rYearNums; |
147 | QPtrList<int> YearNums2 = r2.rYearNums; | 147 | QPtrList<int> YearNums2 = r2.rYearNums; |
148 | if ( *YearNums.first() != *YearNums2.first() ) | 148 | if ( *YearNums.first() != *YearNums2.first() ) |
149 | return false; | 149 | return false; |
150 | QPtrList<rMonthPos> MonthPositions = rMonthPositions; | 150 | QPtrList<rMonthPos> MonthPositions = rMonthPositions; |
151 | QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; | 151 | QPtrList<rMonthPos> MonthPositions2 = r2.rMonthPositions; |
152 | if ( !MonthPositions.count() ) | 152 | if ( !MonthPositions.count() ) |
153 | return false; | 153 | return false; |
154 | if ( !MonthPositions2.count() ) | 154 | if ( !MonthPositions2.count() ) |
155 | return false; | 155 | return false; |
156 | return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; | 156 | return MonthPositions.first()->rPos == MonthPositions2.first()->rPos; |
157 | 157 | ||
158 | } | 158 | } |
159 | case rYearlyMonth: { | 159 | case rYearlyMonth: { |
160 | QPtrList<int> YearNums = rYearNums; | 160 | QPtrList<int> YearNums = rYearNums; |
161 | QPtrList<int> YearNums2 = r2.rYearNums; | 161 | QPtrList<int> YearNums2 = r2.rYearNums; |
162 | return ( *YearNums.first() == *YearNums2.first() && mFeb29YearlyType == r2.mFeb29YearlyType); | 162 | return ( *YearNums.first() == *YearNums2.first() && mFeb29YearlyType == r2.mFeb29YearlyType); |
163 | } | 163 | } |
164 | case rYearlyDay: { | 164 | case rYearlyDay: { |
165 | QPtrList<int> YearNums = rYearNums; | 165 | QPtrList<int> YearNums = rYearNums; |
166 | QPtrList<int> YearNums2 = r2.rYearNums; | 166 | QPtrList<int> YearNums2 = r2.rYearNums; |
167 | return ( *YearNums.first() == *YearNums2.first() ); | 167 | return ( *YearNums.first() == *YearNums2.first() ); |
168 | } | 168 | } |
169 | case rNone: | 169 | case rNone: |
170 | case rMinutely: | 170 | case rMinutely: |
171 | case rHourly: | 171 | case rHourly: |
172 | case rDaily: | 172 | case rDaily: |
173 | default: | 173 | default: |
174 | return true; | 174 | return true; |
175 | } | 175 | } |
176 | } | 176 | } |
177 | /* | 177 | /* |
178 | bool Recurrence::compareLists( const QPtrList<int> &l1 ,const QPtrList<int> &l2) | 178 | bool Recurrence::compareLists( const QPtrList<int> &l1 ,const QPtrList<int> &l2) |
179 | { | 179 | { |
180 | if ( l1.count() != l2.count() ) | 180 | if ( l1.count() != l2.count() ) |
181 | return false; | 181 | return false; |
182 | int count = l1.count(); | 182 | int count = l1.count(); |
183 | int i; | 183 | int i; |
184 | for ( i = 0; i < count ; ++i ) { | 184 | for ( i = 0; i < count ; ++i ) { |
185 | // if ( l1.at(i) != l2.at(i) ) | 185 | // if ( l1.at(i) != l2.at(i) ) |
186 | return false; | 186 | return false; |
187 | qDebug("compüare "); | 187 | qDebug("compüare "); |
188 | } | 188 | } |
189 | return true; | 189 | return true; |
190 | } | 190 | } |
191 | */ | 191 | */ |
192 | QString Recurrence::recurrenceText() const | 192 | QString Recurrence::recurrenceText() const |
193 | { | 193 | { |
194 | QString recurText = i18n("No"); | 194 | QString recurText; |
195 | if ( recurs == Recurrence::rMinutely ) | 195 | if ( recurs == Recurrence::rMinutely ) |
196 | recurText = i18n("minutely"); | 196 | recurText = i18n("minutely"); |
197 | else if ( recurs == Recurrence::rHourly ) | 197 | else if ( recurs == Recurrence::rHourly ) |
198 | recurText = i18n("hourly"); | 198 | recurText = i18n("hourly"); |
199 | else if ( recurs == Recurrence::rDaily ) | 199 | else if ( recurs == Recurrence::rDaily ) |
200 | recurText = i18n("daily"); | 200 | recurText = i18n("daily"); |
201 | else if ( recurs == Recurrence::rWeekly ) | 201 | else if ( recurs == Recurrence::rWeekly ) |
202 | recurText = i18n("weekly"); | 202 | recurText = i18n("weekly"); |
203 | else if ( recurs == Recurrence::rMonthlyPos ) | 203 | else if ( recurs == Recurrence::rMonthlyPos ) |
204 | recurText = i18n("monthly"); | 204 | recurText = i18n("monthly"); |
205 | else if ( recurs == Recurrence::rMonthlyDay ) | 205 | else if ( recurs == Recurrence::rMonthlyDay ) |
206 | recurText = i18n("day-monthly"); | 206 | recurText = i18n("monthly"); |
207 | else if ( recurs == Recurrence::rYearlyMonth ) | 207 | else if ( recurs == Recurrence::rYearlyMonth ) |
208 | recurText = i18n("month-yearly"); | 208 | recurText = i18n("yearly"); |
209 | else if ( recurs == Recurrence::rYearlyDay ) | 209 | else if ( recurs == Recurrence::rYearlyDay ) |
210 | recurText = i18n("day-yearly"); | 210 | recurText = i18n("day-yearly"); |
211 | else if ( recurs == Recurrence::rYearlyPos ) | 211 | else if ( recurs == Recurrence::rYearlyPos ) |
212 | recurText = i18n("position-yearly"); | 212 | recurText = i18n("position-yearly"); |
213 | if ( !recurText.isEmpty() ) { | ||
214 | if ( rFreq > 1 ){ | ||
215 | recurText = i18n("(%1) ").arg(rFreq ) + recurText; | ||
216 | } | ||
217 | } else | ||
218 | recurText = i18n("No"); | ||
213 | return recurText; | 219 | return recurText; |
214 | } | 220 | } |
215 | 221 | ||
216 | void Recurrence::setCompatVersion(int version) | 222 | void Recurrence::setCompatVersion(int version) |
217 | { | 223 | { |
218 | mCompatVersion = version ? version : INT_MAX; | 224 | mCompatVersion = version ? version : INT_MAX; |
219 | } | 225 | } |
220 | 226 | ||
221 | ushort Recurrence::doesRecur() const | 227 | ushort Recurrence::doesRecur() const |
222 | { | 228 | { |
223 | return recurs; | 229 | return recurs; |
224 | } | 230 | } |
225 | 231 | ||
226 | bool Recurrence::recursOnPure(const QDate &qd) const | 232 | bool Recurrence::recursOnPure(const QDate &qd) const |
227 | { | 233 | { |
228 | switch(recurs) { | 234 | switch(recurs) { |
229 | case rMinutely: | 235 | case rMinutely: |
230 | return recursSecondly(qd, rFreq*60); | 236 | return recursSecondly(qd, rFreq*60); |
231 | case rHourly: | 237 | case rHourly: |
232 | return recursSecondly(qd, rFreq*3600); | 238 | return recursSecondly(qd, rFreq*3600); |
233 | case rDaily: | 239 | case rDaily: |
234 | return recursDaily(qd); | 240 | return recursDaily(qd); |
235 | case rWeekly: | 241 | case rWeekly: |
236 | return recursWeekly(qd); | 242 | return recursWeekly(qd); |
237 | case rMonthlyPos: | 243 | case rMonthlyPos: |
238 | case rMonthlyDay: | 244 | case rMonthlyDay: |
239 | return recursMonthly(qd); | 245 | return recursMonthly(qd); |
240 | case rYearlyMonth: | 246 | case rYearlyMonth: |
241 | return recursYearlyByMonth(qd); | 247 | return recursYearlyByMonth(qd); |
242 | case rYearlyDay: | 248 | case rYearlyDay: |
243 | return recursYearlyByDay(qd); | 249 | return recursYearlyByDay(qd); |
244 | case rYearlyPos: | 250 | case rYearlyPos: |
245 | return recursYearlyByPos(qd); | 251 | return recursYearlyByPos(qd); |
246 | default: | 252 | default: |
247 | return false; | 253 | return false; |
248 | case rNone: | 254 | case rNone: |
249 | return false; | 255 | return false; |
250 | } // case | 256 | } // case |
251 | return false; | 257 | return false; |
252 | } | 258 | } |
253 | 259 | ||
254 | bool Recurrence::recursAtPure(const QDateTime &dt) const | 260 | bool Recurrence::recursAtPure(const QDateTime &dt) const |
255 | { | 261 | { |
256 | switch(recurs) { | 262 | switch(recurs) { |
257 | case rMinutely: | 263 | case rMinutely: |
258 | return recursMinutelyAt(dt, rFreq); | 264 | return recursMinutelyAt(dt, rFreq); |
259 | case rHourly: | 265 | case rHourly: |
260 | return recursMinutelyAt(dt, rFreq*60); | 266 | return recursMinutelyAt(dt, rFreq*60); |
261 | default: | 267 | default: |
262 | if (dt.time() != mRecurStart.time()) | 268 | if (dt.time() != mRecurStart.time()) |
263 | return false; | 269 | return false; |
264 | switch(recurs) { | 270 | switch(recurs) { |
265 | case rDaily: | 271 | case rDaily: |
266 | return recursDaily(dt.date()); | 272 | return recursDaily(dt.date()); |
267 | case rWeekly: | 273 | case rWeekly: |
268 | return recursWeekly(dt.date()); | 274 | return recursWeekly(dt.date()); |
269 | case rMonthlyPos: | 275 | case rMonthlyPos: |
270 | case rMonthlyDay: | 276 | case rMonthlyDay: |
271 | return recursMonthly(dt.date()); | 277 | return recursMonthly(dt.date()); |
272 | case rYearlyMonth: | 278 | case rYearlyMonth: |
273 | return recursYearlyByMonth(dt.date()); | 279 | return recursYearlyByMonth(dt.date()); |
274 | case rYearlyDay: | 280 | case rYearlyDay: |
275 | return recursYearlyByDay(dt.date()); | 281 | return recursYearlyByDay(dt.date()); |
276 | case rYearlyPos: | 282 | case rYearlyPos: |
277 | return recursYearlyByPos(dt.date()); | 283 | return recursYearlyByPos(dt.date()); |
278 | default: | 284 | default: |
279 | return false; | 285 | return false; |
280 | case rNone: | 286 | case rNone: |
281 | return false; | 287 | return false; |
282 | } | 288 | } |
283 | } // case | 289 | } // case |
284 | return false; | 290 | return false; |
285 | } | 291 | } |
286 | 292 | ||
287 | QDate Recurrence::endDate() const | 293 | QDate Recurrence::endDate() const |
288 | { | 294 | { |
289 | int count = 0; | 295 | int count = 0; |
290 | QDate end; | 296 | QDate end; |
291 | if (recurs != rNone) { | 297 | if (recurs != rNone) { |
292 | if (rDuration < 0) | 298 | if (rDuration < 0) |
293 | return QDate(); // infinite recurrence | 299 | return QDate(); // infinite recurrence |
294 | if (rDuration == 0) | 300 | if (rDuration == 0) |
295 | return rEndDateTime.date(); | 301 | return rEndDateTime.date(); |
296 | 302 | ||
297 | // The end date is determined by the recurrence count | 303 | // The end date is determined by the recurrence count |
298 | QDate dStart = mRecurStart.date(); | 304 | QDate dStart = mRecurStart.date(); |
299 | switch (recurs) | 305 | switch (recurs) |
300 | { | 306 | { |
301 | case rMinutely: | 307 | case rMinutely: |
302 | return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*60).date(); | 308 | return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*60).date(); |
303 | case rHourly: | 309 | case rHourly: |
304 | return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*3600).date(); | 310 | return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*3600).date(); |
305 | case rDaily: | 311 | case rDaily: |
306 | return dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); | 312 | return dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); |
307 | 313 | ||
308 | case rWeekly: | 314 | case rWeekly: |
309 | count = weeklyCalc(END_DATE_AND_COUNT, end); | 315 | count = weeklyCalc(END_DATE_AND_COUNT, end); |
310 | break; | 316 | break; |
311 | case rMonthlyPos: | 317 | case rMonthlyPos: |
312 | case rMonthlyDay: | 318 | case rMonthlyDay: |
313 | count = monthlyCalc(END_DATE_AND_COUNT, end); | 319 | count = monthlyCalc(END_DATE_AND_COUNT, end); |
314 | break; | 320 | break; |
315 | case rYearlyMonth: | 321 | case rYearlyMonth: |
316 | count = yearlyMonthCalc(END_DATE_AND_COUNT, end); | 322 | count = yearlyMonthCalc(END_DATE_AND_COUNT, end); |
317 | break; | 323 | break; |
318 | case rYearlyDay: | 324 | case rYearlyDay: |
319 | count = yearlyDayCalc(END_DATE_AND_COUNT, end); | 325 | count = yearlyDayCalc(END_DATE_AND_COUNT, end); |
320 | break; | 326 | break; |
321 | case rYearlyPos: | 327 | case rYearlyPos: |
322 | count = yearlyPosCalc(END_DATE_AND_COUNT, end); | 328 | count = yearlyPosCalc(END_DATE_AND_COUNT, end); |
323 | break; | 329 | break; |
324 | default: | 330 | default: |
325 | // catch-all. Should never get here. | 331 | // catch-all. Should never get here. |
326 | kdDebug(5800) << "Control should never reach here in endDate()!" << endl; | 332 | kdDebug(5800) << "Control should never reach here in endDate()!" << endl; |
327 | break; | 333 | break; |
328 | } | 334 | } |
329 | } | 335 | } |
330 | if (!count) | 336 | if (!count) |
331 | return QDate(); // error - there is no recurrence | 337 | return QDate(); // error - there is no recurrence |
332 | return end; | 338 | return end; |
333 | } | 339 | } |
334 | 340 | ||
335 | QDateTime Recurrence::endDateTime() const | 341 | QDateTime Recurrence::endDateTime() const |
336 | { | 342 | { |
337 | int count = 0; | 343 | int count = 0; |
338 | QDate end; | 344 | QDate end; |
339 | if (recurs != rNone) { | 345 | if (recurs != rNone) { |
340 | if (rDuration < 0) | 346 | if (rDuration < 0) |
341 | return QDateTime(); // infinite recurrence | 347 | return QDateTime(); // infinite recurrence |
342 | if (rDuration == 0) | 348 | if (rDuration == 0) |
343 | return rEndDateTime; | 349 | return rEndDateTime; |
344 | 350 | ||
345 | // The end date is determined by the recurrence count | 351 | // The end date is determined by the recurrence count |
346 | QDate dStart = mRecurStart.date(); | 352 | QDate dStart = mRecurStart.date(); |
347 | switch (recurs) | 353 | switch (recurs) |
348 | { | 354 | { |
349 | case rMinutely: | 355 | case rMinutely: |
350 | return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*60); | 356 | return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*60); |
351 | case rHourly: | 357 | case rHourly: |
352 | return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*3600); | 358 | return mRecurStart.addSecs((rDuration-1+mRecurExDatesCount)*rFreq*3600); |
353 | case rDaily: | 359 | case rDaily: |
354 | return dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); | 360 | return dStart.addDays((rDuration-1+mRecurExDatesCount)*rFreq); |
355 | 361 | ||
356 | case rWeekly: | 362 | case rWeekly: |
357 | count = weeklyCalc(END_DATE_AND_COUNT, end); | 363 | count = weeklyCalc(END_DATE_AND_COUNT, end); |
358 | break; | 364 | break; |
359 | case rMonthlyPos: | 365 | case rMonthlyPos: |
360 | case rMonthlyDay: | 366 | case rMonthlyDay: |
361 | count = monthlyCalc(END_DATE_AND_COUNT, end); | 367 | count = monthlyCalc(END_DATE_AND_COUNT, end); |
362 | break; | 368 | break; |
363 | case rYearlyMonth: | 369 | case rYearlyMonth: |
364 | count = yearlyMonthCalc(END_DATE_AND_COUNT, end); | 370 | count = yearlyMonthCalc(END_DATE_AND_COUNT, end); |
365 | break; | 371 | break; |
366 | case rYearlyDay: | 372 | case rYearlyDay: |
367 | count = yearlyDayCalc(END_DATE_AND_COUNT, end); | 373 | count = yearlyDayCalc(END_DATE_AND_COUNT, end); |
368 | break; | 374 | break; |
369 | case rYearlyPos: | 375 | case rYearlyPos: |
370 | count = yearlyPosCalc(END_DATE_AND_COUNT, end); | 376 | count = yearlyPosCalc(END_DATE_AND_COUNT, end); |
371 | break; | 377 | break; |
372 | default: | 378 | default: |
373 | // catch-all. Should never get here. | 379 | // catch-all. Should never get here. |
374 | kdDebug(5800) << "Control should never reach here in endDate()!" << endl; | 380 | kdDebug(5800) << "Control should never reach here in endDate()!" << endl; |
375 | break; | 381 | break; |
376 | } | 382 | } |
377 | } | 383 | } |
378 | if (!count) | 384 | if (!count) |
379 | return QDateTime(); // error - there is no recurrence | 385 | return QDateTime(); // error - there is no recurrence |
380 | return QDateTime(end, mRecurStart.time()); | 386 | return QDateTime(end, mRecurStart.time()); |
381 | } | 387 | } |
382 | 388 | ||
383 | int Recurrence::durationTo(const QDate &date) const | 389 | int Recurrence::durationTo(const QDate &date) const |
384 | { | 390 | { |
385 | QDate d = date; | 391 | QDate d = date; |
386 | return recurCalc(COUNT_TO_DATE, d); | 392 | return recurCalc(COUNT_TO_DATE, d); |
387 | } | 393 | } |
388 | 394 | ||
389 | int Recurrence::durationTo(const QDateTime &datetime) const | 395 | int Recurrence::durationTo(const QDateTime &datetime) const |
390 | { | 396 | { |
391 | QDateTime dt = datetime; | 397 | QDateTime dt = datetime; |
392 | return recurCalc(COUNT_TO_DATE, dt); | 398 | return recurCalc(COUNT_TO_DATE, dt); |
393 | } | 399 | } |
394 | 400 | ||
395 | void Recurrence::unsetRecurs() | 401 | void Recurrence::unsetRecurs() |
396 | { | 402 | { |
397 | if (mRecurReadOnly) return; | 403 | if (mRecurReadOnly) return; |
398 | recurs = rNone; | 404 | recurs = rNone; |
399 | rMonthPositions.clear(); | 405 | rMonthPositions.clear(); |
400 | rMonthDays.clear(); | 406 | rMonthDays.clear(); |
401 | rYearNums.clear(); | 407 | rYearNums.clear(); |
402 | } | 408 | } |
403 | 409 | ||
404 | void Recurrence::setRecurStart(const QDateTime &start) | 410 | void Recurrence::setRecurStart(const QDateTime &start) |
405 | { | 411 | { |
406 | mRecurStart = start; | 412 | mRecurStart = start; |
407 | mFloats = false; | 413 | mFloats = false; |
408 | switch (recurs) | 414 | switch (recurs) |
409 | { | 415 | { |
410 | case rMinutely: | 416 | case rMinutely: |
411 | case rHourly: | 417 | case rHourly: |
412 | break; | 418 | break; |
413 | case rDaily: | 419 | case rDaily: |
414 | case rWeekly: | 420 | case rWeekly: |
415 | case rMonthlyPos: | 421 | case rMonthlyPos: |
416 | case rMonthlyDay: | 422 | case rMonthlyDay: |
417 | case rYearlyMonth: | 423 | case rYearlyMonth: |
418 | case rYearlyDay: | 424 | case rYearlyDay: |
419 | case rYearlyPos: | 425 | case rYearlyPos: |
420 | default: | 426 | default: |
421 | rEndDateTime.setTime(start.time()); | 427 | rEndDateTime.setTime(start.time()); |
422 | break; | 428 | break; |
423 | } | 429 | } |
424 | } | 430 | } |
425 | 431 | ||
426 | void Recurrence::setRecurStart(const QDate &start) | 432 | void Recurrence::setRecurStart(const QDate &start) |
427 | { | 433 | { |
428 | mRecurStart.setDate(start); | 434 | mRecurStart.setDate(start); |
429 | mRecurStart.setTime(QTime(0,0,0)); | 435 | mRecurStart.setTime(QTime(0,0,0)); |
430 | switch (recurs) | 436 | switch (recurs) |
431 | { | 437 | { |
432 | case rMinutely: | 438 | case rMinutely: |
433 | case rHourly: | 439 | case rHourly: |
434 | break; | 440 | break; |
435 | case rDaily: | 441 | case rDaily: |
436 | case rWeekly: | 442 | case rWeekly: |
437 | case rMonthlyPos: | 443 | case rMonthlyPos: |
438 | case rMonthlyDay: | 444 | case rMonthlyDay: |
439 | case rYearlyMonth: | 445 | case rYearlyMonth: |
440 | case rYearlyDay: | 446 | case rYearlyDay: |
441 | case rYearlyPos: | 447 | case rYearlyPos: |
442 | default: | 448 | default: |
443 | mFloats = true; | 449 | mFloats = true; |
444 | break; | 450 | break; |
445 | } | 451 | } |
446 | } | 452 | } |
447 | 453 | ||
448 | void Recurrence::setFloats(bool f) | 454 | void Recurrence::setFloats(bool f) |
449 | { | 455 | { |
450 | switch (recurs) | 456 | switch (recurs) |
451 | { | 457 | { |
452 | case rDaily: | 458 | case rDaily: |
453 | case rWeekly: | 459 | case rWeekly: |
454 | case rMonthlyPos: | 460 | case rMonthlyPos: |
455 | case rMonthlyDay: | 461 | case rMonthlyDay: |
456 | case rYearlyMonth: | 462 | case rYearlyMonth: |
457 | case rYearlyDay: | 463 | case rYearlyDay: |
458 | case rYearlyPos: | 464 | case rYearlyPos: |
459 | break; | 465 | break; |
460 | case rMinutely: | 466 | case rMinutely: |
461 | case rHourly: | 467 | case rHourly: |
462 | default: | 468 | default: |
463 | return; // can't set sub-daily to floating | 469 | return; // can't set sub-daily to floating |
464 | } | 470 | } |
465 | mFloats = f; | 471 | mFloats = f; |
466 | if (f) { | 472 | if (f) { |
467 | mRecurStart.setTime(QTime(0,0,0)); | 473 | mRecurStart.setTime(QTime(0,0,0)); |
468 | rEndDateTime.setTime(QTime(0,0,0)); | 474 | rEndDateTime.setTime(QTime(0,0,0)); |
469 | } | 475 | } |
470 | } | 476 | } |
471 | 477 | ||
472 | int Recurrence::frequency() const | 478 | int Recurrence::frequency() const |
473 | { | 479 | { |
474 | return rFreq; | 480 | return rFreq; |
475 | } | 481 | } |
476 | 482 | ||
477 | int Recurrence::duration() const | 483 | int Recurrence::duration() const |
478 | { | 484 | { |
479 | return rDuration; | 485 | return rDuration; |
480 | } | 486 | } |
481 | 487 | ||
482 | void Recurrence::setDuration(int _rDuration) | 488 | void Recurrence::setDuration(int _rDuration) |
483 | { | 489 | { |
484 | if (mRecurReadOnly) return; | 490 | if (mRecurReadOnly) return; |
485 | if (_rDuration > 0) { | 491 | if (_rDuration > 0) { |
486 | rDuration = _rDuration; | 492 | rDuration = _rDuration; |
487 | // Compatibility mode is only needed when reading the calendar in ICalFormatImpl, | 493 | // Compatibility mode is only needed when reading the calendar in ICalFormatImpl, |
488 | // so explicitly setting the duration means no backwards compatibility is needed. | 494 | // so explicitly setting the duration means no backwards compatibility is needed. |
489 | mCompatDuration = 0; | 495 | mCompatDuration = 0; |
490 | } | 496 | } |
491 | } | 497 | } |
492 | 498 | ||
493 | QString Recurrence::endDateStr(bool shortfmt) const | 499 | QString Recurrence::endDateStr(bool shortfmt) const |
494 | { | 500 | { |
495 | return KGlobal::locale()->formatDate(rEndDateTime.date(),shortfmt); | 501 | return KGlobal::locale()->formatDate(rEndDateTime.date(),shortfmt); |
496 | } | 502 | } |
497 | 503 | ||
498 | const QBitArray &Recurrence::days() const | 504 | const QBitArray &Recurrence::days() const |
499 | { | 505 | { |
500 | return rDays; | 506 | return rDays; |
501 | } | 507 | } |
502 | 508 | ||
503 | const QPtrList<Recurrence::rMonthPos> &Recurrence::monthPositions() const | 509 | const QPtrList<Recurrence::rMonthPos> &Recurrence::monthPositions() const |
504 | { | 510 | { |
505 | return rMonthPositions; | 511 | return rMonthPositions; |
506 | } | 512 | } |
507 | 513 | ||
508 | const QPtrList<Recurrence::rMonthPos> &Recurrence::yearMonthPositions() const | 514 | const QPtrList<Recurrence::rMonthPos> &Recurrence::yearMonthPositions() const |
509 | { | 515 | { |
510 | return rMonthPositions; | 516 | return rMonthPositions; |
511 | } | 517 | } |
512 | 518 | ||
513 | const QPtrList<int> &Recurrence::monthDays() const | 519 | const QPtrList<int> &Recurrence::monthDays() const |
514 | { | 520 | { |
515 | return rMonthDays; | 521 | return rMonthDays; |
516 | } | 522 | } |
517 | 523 | ||
518 | void Recurrence::setMinutely(int _rFreq, int _rDuration) | 524 | void Recurrence::setMinutely(int _rFreq, int _rDuration) |
519 | { | 525 | { |
520 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) | 526 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) |
521 | return; | 527 | return; |
522 | setDailySub(rMinutely, _rFreq, _rDuration); | 528 | setDailySub(rMinutely, _rFreq, _rDuration); |
523 | } | 529 | } |
524 | 530 | ||
525 | void Recurrence::setMinutely(int _rFreq, const QDateTime &_rEndDateTime) | 531 | void Recurrence::setMinutely(int _rFreq, const QDateTime &_rEndDateTime) |
526 | { | 532 | { |
527 | if (mRecurReadOnly) return; | 533 | if (mRecurReadOnly) return; |
528 | rEndDateTime = _rEndDateTime; | 534 | rEndDateTime = _rEndDateTime; |
529 | setDailySub(rMinutely, _rFreq, 0); | 535 | setDailySub(rMinutely, _rFreq, 0); |
530 | } | 536 | } |
531 | 537 | ||
532 | void Recurrence::setHourly(int _rFreq, int _rDuration) | 538 | void Recurrence::setHourly(int _rFreq, int _rDuration) |
533 | { | 539 | { |
534 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) | 540 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) |
535 | return; | 541 | return; |
536 | setDailySub(rHourly, _rFreq, _rDuration); | 542 | setDailySub(rHourly, _rFreq, _rDuration); |
537 | } | 543 | } |
538 | 544 | ||
539 | void Recurrence::setHourly(int _rFreq, const QDateTime &_rEndDateTime) | 545 | void Recurrence::setHourly(int _rFreq, const QDateTime &_rEndDateTime) |
540 | { | 546 | { |
541 | if (mRecurReadOnly) return; | 547 | if (mRecurReadOnly) return; |
542 | rEndDateTime = _rEndDateTime; | 548 | rEndDateTime = _rEndDateTime; |
543 | setDailySub(rHourly, _rFreq, 0); | 549 | setDailySub(rHourly, _rFreq, 0); |
544 | } | 550 | } |
545 | 551 | ||
546 | void Recurrence::setDaily(int _rFreq, int _rDuration) | 552 | void Recurrence::setDaily(int _rFreq, int _rDuration) |
547 | { | 553 | { |
548 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) | 554 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) |
549 | return; | 555 | return; |
550 | setDailySub(rDaily, _rFreq, _rDuration); | 556 | setDailySub(rDaily, _rFreq, _rDuration); |
551 | } | 557 | } |
552 | 558 | ||
553 | void Recurrence::setDaily(int _rFreq, const QDate &_rEndDate) | 559 | void Recurrence::setDaily(int _rFreq, const QDate &_rEndDate) |
554 | { | 560 | { |
555 | if (mRecurReadOnly) return; | 561 | if (mRecurReadOnly) return; |
556 | rEndDateTime.setDate(_rEndDate); | 562 | rEndDateTime.setDate(_rEndDate); |
557 | rEndDateTime.setTime(mRecurStart.time()); | 563 | rEndDateTime.setTime(mRecurStart.time()); |
558 | setDailySub(rDaily, _rFreq, 0); | 564 | setDailySub(rDaily, _rFreq, 0); |
559 | } | 565 | } |
560 | 566 | ||
561 | void Recurrence::setWeekly(int _rFreq, const QBitArray &_rDays, | 567 | void Recurrence::setWeekly(int _rFreq, const QBitArray &_rDays, |
562 | int _rDuration, int _rWeekStart) | 568 | int _rDuration, int _rWeekStart) |
563 | { | 569 | { |
564 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) | 570 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) |
565 | return; | 571 | return; |
566 | recurs = rWeekly; | 572 | recurs = rWeekly; |
567 | 573 | ||
568 | rFreq = _rFreq; | 574 | rFreq = _rFreq; |
569 | rDays = _rDays; | 575 | rDays = _rDays; |
570 | rWeekStart = _rWeekStart; | 576 | rWeekStart = _rWeekStart; |
571 | rDuration = _rDuration; | 577 | rDuration = _rDuration; |
572 | if (mCompatVersion < 310 && _rDuration > 0) { | 578 | if (mCompatVersion < 310 && _rDuration > 0) { |
573 | // Backwards compatibility for KDE < 3.1. | 579 | // Backwards compatibility for KDE < 3.1. |
574 | // rDuration was set to the number of time periods to recur, | 580 | // rDuration was set to the number of time periods to recur, |
575 | // with week start always on a Monday. | 581 | // with week start always on a Monday. |
576 | // Convert this to the number of occurrences. | 582 | // Convert this to the number of occurrences. |
577 | mCompatDuration = _rDuration; | 583 | mCompatDuration = _rDuration; |
578 | int weeks = ((mCompatDuration-1+mRecurExDatesCount)*7) + (7 - mRecurStart.date().dayOfWeek()); | 584 | int weeks = ((mCompatDuration-1+mRecurExDatesCount)*7) + (7 - mRecurStart.date().dayOfWeek()); |
579 | QDate end(mRecurStart.date().addDays(weeks * rFreq)); | 585 | QDate end(mRecurStart.date().addDays(weeks * rFreq)); |
580 | rDuration = INT_MAX; // ensure that weeklyCalc() does its job correctly | 586 | rDuration = INT_MAX; // ensure that weeklyCalc() does its job correctly |
581 | rDuration = weeklyCalc(COUNT_TO_DATE, end); | 587 | rDuration = weeklyCalc(COUNT_TO_DATE, end); |
582 | } else { | 588 | } else { |
583 | mCompatDuration = 0; | 589 | mCompatDuration = 0; |
584 | } | 590 | } |
585 | rMonthPositions.clear(); | 591 | rMonthPositions.clear(); |
586 | rMonthDays.clear(); | 592 | rMonthDays.clear(); |
587 | if (mParent) mParent->updated(); | 593 | if (mParent) mParent->updated(); |
588 | } | 594 | } |
589 | 595 | ||
590 | void Recurrence::setWeekly(int _rFreq, const QBitArray &_rDays, | 596 | void Recurrence::setWeekly(int _rFreq, const QBitArray &_rDays, |
591 | const QDate &_rEndDate, int _rWeekStart) | 597 | const QDate &_rEndDate, int _rWeekStart) |
592 | { | 598 | { |
593 | if (mRecurReadOnly) return; | 599 | if (mRecurReadOnly) return; |
594 | recurs = rWeekly; | 600 | recurs = rWeekly; |
595 | 601 | ||
596 | rFreq = _rFreq; | 602 | rFreq = _rFreq; |
597 | rDays = _rDays; | 603 | rDays = _rDays; |
598 | rWeekStart = _rWeekStart; | 604 | rWeekStart = _rWeekStart; |
599 | rEndDateTime.setDate(_rEndDate); | 605 | rEndDateTime.setDate(_rEndDate); |
600 | rEndDateTime.setTime(mRecurStart.time()); | 606 | rEndDateTime.setTime(mRecurStart.time()); |
601 | rDuration = 0; // set to 0 because there is an end date | 607 | rDuration = 0; // set to 0 because there is an end date |
602 | mCompatDuration = 0; | 608 | mCompatDuration = 0; |
603 | rMonthPositions.clear(); | 609 | rMonthPositions.clear(); |
604 | rMonthDays.clear(); | 610 | rMonthDays.clear(); |
605 | rYearNums.clear(); | 611 | rYearNums.clear(); |
606 | if (mParent) mParent->updated(); | 612 | if (mParent) mParent->updated(); |
607 | } | 613 | } |
608 | 614 | ||
609 | void Recurrence::setMonthly(short type, int _rFreq, int _rDuration) | 615 | void Recurrence::setMonthly(short type, int _rFreq, int _rDuration) |
610 | { | 616 | { |
611 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) | 617 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) |
612 | return; | 618 | return; |
613 | recurs = type; | 619 | recurs = type; |
614 | 620 | ||
615 | rFreq = _rFreq; | 621 | rFreq = _rFreq; |
616 | rDuration = _rDuration; | 622 | rDuration = _rDuration; |
617 | if (mCompatVersion < 310) | 623 | if (mCompatVersion < 310) |
618 | mCompatDuration = (_rDuration > 0) ? _rDuration : 0; | 624 | mCompatDuration = (_rDuration > 0) ? _rDuration : 0; |
619 | rYearNums.clear(); | 625 | rYearNums.clear(); |
620 | if (mParent) mParent->updated(); | 626 | if (mParent) mParent->updated(); |
621 | } | 627 | } |
622 | 628 | ||
623 | void Recurrence::setMonthly(short type, int _rFreq, | 629 | void Recurrence::setMonthly(short type, int _rFreq, |
624 | const QDate &_rEndDate) | 630 | const QDate &_rEndDate) |
625 | { | 631 | { |
626 | if (mRecurReadOnly) return; | 632 | if (mRecurReadOnly) return; |
627 | recurs = type; | 633 | recurs = type; |
628 | 634 | ||
629 | rFreq = _rFreq; | 635 | rFreq = _rFreq; |
630 | rEndDateTime.setDate(_rEndDate); | 636 | rEndDateTime.setDate(_rEndDate); |
631 | rEndDateTime.setTime(mRecurStart.time()); | 637 | rEndDateTime.setTime(mRecurStart.time()); |
632 | rDuration = 0; // set to 0 because there is an end date | 638 | rDuration = 0; // set to 0 because there is an end date |
633 | mCompatDuration = 0; | 639 | mCompatDuration = 0; |
634 | rYearNums.clear(); | 640 | rYearNums.clear(); |
635 | if (mParent) mParent->updated(); | 641 | if (mParent) mParent->updated(); |
636 | } | 642 | } |
637 | 643 | ||
638 | void Recurrence::addMonthlyPos(short _rPos, const QBitArray &_rDays) | 644 | void Recurrence::addMonthlyPos(short _rPos, const QBitArray &_rDays) |
639 | { | 645 | { |
640 | if (recurs == rMonthlyPos) | 646 | if (recurs == rMonthlyPos) |
641 | addMonthlyPos_(_rPos, _rDays); | 647 | addMonthlyPos_(_rPos, _rDays); |
642 | } | 648 | } |
643 | 649 | ||
644 | void Recurrence::addMonthlyPos_(short _rPos, const QBitArray &_rDays) | 650 | void Recurrence::addMonthlyPos_(short _rPos, const QBitArray &_rDays) |
645 | { | 651 | { |
646 | if (mRecurReadOnly | 652 | if (mRecurReadOnly |
647 | || _rPos == 0 || _rPos > 5 || _rPos < -5) // invalid week number | 653 | || _rPos == 0 || _rPos > 5 || _rPos < -5) // invalid week number |
648 | return; | 654 | return; |
649 | 655 | ||
650 | for (rMonthPos* it = rMonthPositions.first(); it; it = rMonthPositions.next()) { | 656 | for (rMonthPos* it = rMonthPositions.first(); it; it = rMonthPositions.next()) { |
651 | int itPos = it->negative ? -it->rPos : it->rPos; | 657 | int itPos = it->negative ? -it->rPos : it->rPos; |
652 | if (_rPos == itPos) { | 658 | if (_rPos == itPos) { |
653 | // This week is already in the list. | 659 | // This week is already in the list. |
654 | // Combine the specified days with those in the list. | 660 | // Combine the specified days with those in the list. |
655 | it->rDays |= _rDays; | 661 | it->rDays |= _rDays; |
656 | if (mParent) mParent->updated(); | 662 | if (mParent) mParent->updated(); |
657 | return; | 663 | return; |
658 | } | 664 | } |
659 | } | 665 | } |
660 | // Add the new position to the list | 666 | // Add the new position to the list |
661 | rMonthPos *tmpPos = new rMonthPos; | 667 | rMonthPos *tmpPos = new rMonthPos; |
662 | if (_rPos > 0) { | 668 | if (_rPos > 0) { |
663 | tmpPos->rPos = _rPos; | 669 | tmpPos->rPos = _rPos; |
664 | tmpPos->negative = false; | 670 | tmpPos->negative = false; |
665 | } else { | 671 | } else { |
666 | tmpPos->rPos = -_rPos; // take abs() | 672 | tmpPos->rPos = -_rPos; // take abs() |
667 | tmpPos->negative = true; | 673 | tmpPos->negative = true; |
668 | } | 674 | } |
669 | tmpPos->rDays = _rDays; | 675 | tmpPos->rDays = _rDays; |
670 | tmpPos->rDays.detach(); | 676 | tmpPos->rDays.detach(); |
671 | rMonthPositions.append(tmpPos); | 677 | rMonthPositions.append(tmpPos); |
672 | 678 | ||
673 | if (mCompatVersion < 310 && mCompatDuration > 0) { | 679 | if (mCompatVersion < 310 && mCompatDuration > 0) { |
674 | // Backwards compatibility for KDE < 3.1. | 680 | // Backwards compatibility for KDE < 3.1. |
675 | // rDuration was set to the number of time periods to recur. | 681 | // rDuration was set to the number of time periods to recur. |
676 | // Convert this to the number of occurrences. | 682 | // Convert this to the number of occurrences. |
677 | int monthsAhead = (mCompatDuration-1+mRecurExDatesCount) * rFreq; | 683 | int monthsAhead = (mCompatDuration-1+mRecurExDatesCount) * rFreq; |
678 | int month = mRecurStart.date().month() - 1 + monthsAhead; | 684 | int month = mRecurStart.date().month() - 1 + monthsAhead; |
679 | QDate end(mRecurStart.date().year() + month/12, month%12 + 1, 31); | 685 | QDate end(mRecurStart.date().year() + month/12, month%12 + 1, 31); |
680 | rDuration = INT_MAX; // ensure that recurCalc() does its job correctly | 686 | rDuration = INT_MAX; // ensure that recurCalc() does its job correctly |
681 | rDuration = recurCalc(COUNT_TO_DATE, end); | 687 | rDuration = recurCalc(COUNT_TO_DATE, end); |
682 | } | 688 | } |
683 | 689 | ||
684 | if (mParent) mParent->updated(); | 690 | if (mParent) mParent->updated(); |
685 | } | 691 | } |
686 | 692 | ||
687 | void Recurrence::addMonthlyDay(short _rDay) | 693 | void Recurrence::addMonthlyDay(short _rDay) |
688 | { | 694 | { |
689 | if (mRecurReadOnly || (recurs != rMonthlyDay && recurs != rYearlyMonth) | 695 | if (mRecurReadOnly || (recurs != rMonthlyDay && recurs != rYearlyMonth) |
690 | || _rDay == 0 || _rDay > 31 || _rDay < -31) // invalid day number | 696 | || _rDay == 0 || _rDay > 31 || _rDay < -31) // invalid day number |
691 | return; | 697 | return; |
692 | for (int* it = rMonthDays.first(); it; it = rMonthDays.next()) { | 698 | for (int* it = rMonthDays.first(); it; it = rMonthDays.next()) { |
693 | if (_rDay == *it) | 699 | if (_rDay == *it) |
694 | return; // this day is already in the list - avoid duplication | 700 | return; // this day is already in the list - avoid duplication |
695 | } | 701 | } |
696 | int *tmpDay = new int; | 702 | int *tmpDay = new int; |
697 | *tmpDay = _rDay; | 703 | *tmpDay = _rDay; |
698 | rMonthDays.append(tmpDay); | 704 | rMonthDays.append(tmpDay); |
699 | 705 | ||
700 | if (mCompatVersion < 310 && mCompatDuration > 0) { | 706 | if (mCompatVersion < 310 && mCompatDuration > 0) { |
701 | // Backwards compatibility for KDE < 3.1. | 707 | // Backwards compatibility for KDE < 3.1. |
702 | // rDuration was set to the number of time periods to recur. | 708 | // rDuration was set to the number of time periods to recur. |
703 | // Convert this to the number of occurrences. | 709 | // Convert this to the number of occurrences. |
704 | int monthsAhead = (mCompatDuration-1+mRecurExDatesCount) * rFreq; | 710 | int monthsAhead = (mCompatDuration-1+mRecurExDatesCount) * rFreq; |
705 | int month = mRecurStart.date().month() - 1 + monthsAhead; | 711 | int month = mRecurStart.date().month() - 1 + monthsAhead; |
706 | QDate end(mRecurStart.date().year() + month/12, month%12 + 1, 31); | 712 | QDate end(mRecurStart.date().year() + month/12, month%12 + 1, 31); |
707 | rDuration = INT_MAX; // ensure that recurCalc() does its job correctly | 713 | rDuration = INT_MAX; // ensure that recurCalc() does its job correctly |
708 | rDuration = recurCalc(COUNT_TO_DATE, end); | 714 | rDuration = recurCalc(COUNT_TO_DATE, end); |
709 | } | 715 | } |
710 | 716 | ||
711 | if (mParent) mParent->updated(); | 717 | if (mParent) mParent->updated(); |
712 | } | 718 | } |
713 | 719 | ||
714 | void Recurrence::setYearly(int type, int _rFreq, int _rDuration) | 720 | void Recurrence::setYearly(int type, int _rFreq, int _rDuration) |
715 | { | 721 | { |
716 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) | 722 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) |
717 | return; | 723 | return; |
718 | if (mCompatVersion < 310) | 724 | if (mCompatVersion < 310) |
719 | mCompatDuration = (_rDuration > 0) ? _rDuration : 0; | 725 | mCompatDuration = (_rDuration > 0) ? _rDuration : 0; |
720 | setYearly_(type, mFeb29YearlyDefaultType, _rFreq, _rDuration); | 726 | setYearly_(type, mFeb29YearlyDefaultType, _rFreq, _rDuration); |
721 | } | 727 | } |
722 | 728 | ||
723 | void Recurrence::setYearly(int type, int _rFreq, const QDate &_rEndDate) | 729 | void Recurrence::setYearly(int type, int _rFreq, const QDate &_rEndDate) |
724 | { | 730 | { |
725 | if (mRecurReadOnly) return; | 731 | if (mRecurReadOnly) return; |
726 | rEndDateTime.setDate(_rEndDate); | 732 | rEndDateTime.setDate(_rEndDate); |
727 | rEndDateTime.setTime(mRecurStart.time()); | 733 | rEndDateTime.setTime(mRecurStart.time()); |
728 | mCompatDuration = 0; | 734 | mCompatDuration = 0; |
729 | setYearly_(type, mFeb29YearlyDefaultType, _rFreq, 0); | 735 | setYearly_(type, mFeb29YearlyDefaultType, _rFreq, 0); |
730 | } | 736 | } |
731 | 737 | ||
732 | void Recurrence::setYearlyByDate(Feb29Type type, int _rFreq, int _rDuration) | 738 | void Recurrence::setYearlyByDate(Feb29Type type, int _rFreq, int _rDuration) |
733 | { | 739 | { |
734 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) | 740 | if (mRecurReadOnly || _rDuration == 0 || _rDuration < -1) |
735 | return; | 741 | return; |
736 | if (mCompatVersion < 310) | 742 | if (mCompatVersion < 310) |
737 | mCompatDuration = (_rDuration > 0) ? _rDuration : 0; | 743 | mCompatDuration = (_rDuration > 0) ? _rDuration : 0; |
738 | setYearly_(rYearlyMonth, type, _rFreq, _rDuration); | 744 | setYearly_(rYearlyMonth, type, _rFreq, _rDuration); |
739 | } | 745 | } |
740 | 746 | ||
741 | void Recurrence::setYearlyByDate(Feb29Type type, int _rFreq, const QDate &_rEndDate) | 747 | void Recurrence::setYearlyByDate(Feb29Type type, int _rFreq, const QDate &_rEndDate) |
742 | { | 748 | { |
743 | if (mRecurReadOnly) return; | 749 | if (mRecurReadOnly) return; |
744 | rEndDateTime.setDate(_rEndDate); | 750 | rEndDateTime.setDate(_rEndDate); |
745 | rEndDateTime.setTime(mRecurStart.time()); | 751 | rEndDateTime.setTime(mRecurStart.time()); |
746 | mCompatDuration = 0; | 752 | mCompatDuration = 0; |
747 | setYearly_(rYearlyMonth, type, _rFreq, 0); | 753 | setYearly_(rYearlyMonth, type, _rFreq, 0); |
748 | } | 754 | } |
749 | 755 | ||
750 | void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays) | 756 | void Recurrence::addYearlyMonthPos(short _rPos, const QBitArray &_rDays) |
751 | { | 757 | { |
752 | if (recurs == rYearlyPos) | 758 | if (recurs == rYearlyPos) |
753 | addMonthlyPos_(_rPos, _rDays); | 759 | addMonthlyPos_(_rPos, _rDays); |
754 | } | 760 | } |
755 | 761 | ||
756 | const QPtrList<int> &Recurrence::yearNums() const | 762 | const QPtrList<int> &Recurrence::yearNums() const |
757 | { | 763 | { |
758 | return rYearNums; | 764 | return rYearNums; |
759 | } | 765 | } |
760 | void Recurrence::addYearlyMonth(short _rPos ) | 766 | void Recurrence::addYearlyMonth(short _rPos ) |
761 | { | 767 | { |
762 | if (mRecurReadOnly || recurs != rYearlyMonth) // invalid day/month number | 768 | if (mRecurReadOnly || recurs != rYearlyMonth) // invalid day/month number |
763 | return; | 769 | return; |
764 | rMonthPos *tmpPos = new rMonthPos; | 770 | rMonthPos *tmpPos = new rMonthPos; |
765 | if ( _rPos > 0) { | 771 | if ( _rPos > 0) { |
766 | tmpPos->rPos = _rPos; | 772 | tmpPos->rPos = _rPos; |
767 | tmpPos->negative = false; | 773 | tmpPos->negative = false; |
768 | } else { | 774 | } else { |
769 | tmpPos->rPos = -_rPos; // take abs() | 775 | tmpPos->rPos = -_rPos; // take abs() |
770 | tmpPos->negative = true; | 776 | tmpPos->negative = true; |
771 | } | 777 | } |
772 | rMonthPositions.append(tmpPos); | 778 | rMonthPositions.append(tmpPos); |
773 | } | 779 | } |
774 | void Recurrence::addYearlyNum(short _rNum) | 780 | void Recurrence::addYearlyNum(short _rNum) |
775 | { | 781 | { |
776 | if (mRecurReadOnly | 782 | if (mRecurReadOnly |
777 | || (recurs != rYearlyMonth && recurs != rYearlyDay && recurs != rYearlyPos) | 783 | || (recurs != rYearlyMonth && recurs != rYearlyDay && recurs != rYearlyPos) |
778 | || _rNum <= 0) // invalid day/month number | 784 | || _rNum <= 0) // invalid day/month number |
779 | return; | 785 | return; |
780 | 786 | ||
781 | if (mCompatVersion < 310 && mCompatRecurs == rYearlyDay) { | 787 | if (mCompatVersion < 310 && mCompatRecurs == rYearlyDay) { |
782 | // Backwards compatibility for KDE < 3.1. | 788 | // Backwards compatibility for KDE < 3.1. |
783 | // Dates were stored as day numbers, with a fiddle to take account of leap years. | 789 | // Dates were stored as day numbers, with a fiddle to take account of leap years. |
784 | // Convert the day number to a month. | 790 | // Convert the day number to a month. |
785 | if (_rNum <= 0 || _rNum > 366 || (_rNum == 366 && mRecurStart.date().daysInYear() < 366)) | 791 | if (_rNum <= 0 || _rNum > 366 || (_rNum == 366 && mRecurStart.date().daysInYear() < 366)) |
786 | return; // invalid day number | 792 | return; // invalid day number |
787 | _rNum = QDate(mRecurStart.date().year(), 1, 1).addDays(_rNum - 1).month(); | 793 | _rNum = QDate(mRecurStart.date().year(), 1, 1).addDays(_rNum - 1).month(); |
788 | } else | 794 | } else |
789 | if ((recurs == rYearlyMonth || recurs == rYearlyPos) && _rNum > 12 | 795 | if ((recurs == rYearlyMonth || recurs == rYearlyPos) && _rNum > 12 |
790 | || recurs == rYearlyDay && _rNum > 366) | 796 | || recurs == rYearlyDay && _rNum > 366) |
791 | return; // invalid day number | 797 | return; // invalid day number |
792 | 798 | ||
793 | uint i = 0; | 799 | uint i = 0; |
794 | for (int* it = rYearNums.first(); it && _rNum >= *it; it = rYearNums.next()) { | 800 | for (int* it = rYearNums.first(); it && _rNum >= *it; it = rYearNums.next()) { |
795 | if (_rNum == *it) | 801 | if (_rNum == *it) |
796 | return; // this day/month is already in the list - avoid duplication | 802 | return; // this day/month is already in the list - avoid duplication |
797 | ++i; | 803 | ++i; |
798 | } | 804 | } |
799 | 805 | ||
800 | int *tmpNum = new int; | 806 | int *tmpNum = new int; |
801 | *tmpNum = _rNum; | 807 | *tmpNum = _rNum; |
802 | rYearNums.insert(i, tmpNum); // insert the day/month in a sorted position | 808 | rYearNums.insert(i, tmpNum); // insert the day/month in a sorted position |
803 | 809 | ||
804 | if (mCompatVersion < 310 && mCompatDuration > 0) { | 810 | if (mCompatVersion < 310 && mCompatDuration > 0) { |
805 | // Backwards compatibility for KDE < 3.1. | 811 | // Backwards compatibility for KDE < 3.1. |
806 | // rDuration was set to the number of time periods to recur. | 812 | // rDuration was set to the number of time periods to recur. |
807 | // Convert this to the number of occurrences. | 813 | // Convert this to the number of occurrences. |
808 | QDate end(mRecurStart.date().year() + (mCompatDuration-1+mRecurExDatesCount)*rFreq, 12, 31); | 814 | QDate end(mRecurStart.date().year() + (mCompatDuration-1+mRecurExDatesCount)*rFreq, 12, 31); |
809 | rDuration = INT_MAX; // ensure that recurCalc() does its job correctly | 815 | rDuration = INT_MAX; // ensure that recurCalc() does its job correctly |
810 | rDuration = recurCalc(COUNT_TO_DATE, end); | 816 | rDuration = recurCalc(COUNT_TO_DATE, end); |
811 | } | 817 | } |
812 | 818 | ||
813 | if (mParent) mParent->updated(); | 819 | if (mParent) mParent->updated(); |
814 | } | 820 | } |
815 | 821 | ||
816 | 822 | ||
817 | QDateTime Recurrence::getNextDateTime(const QDateTime &preDateTime, bool *last) const | 823 | QDateTime Recurrence::getNextDateTime(const QDateTime &preDateTime, bool *last) const |
818 | { | 824 | { |
819 | if (last) | 825 | if (last) |
820 | *last = false; | 826 | *last = false; |
821 | int freq; | 827 | int freq; |
822 | switch (recurs) | 828 | switch (recurs) |
823 | { | 829 | { |
824 | case rMinutely: | 830 | case rMinutely: |
825 | freq = rFreq * 60; | 831 | freq = rFreq * 60; |
826 | break; | 832 | break; |
827 | case rHourly: | 833 | case rHourly: |
828 | freq = rFreq * 3600; | 834 | freq = rFreq * 3600; |
829 | break; | 835 | break; |
830 | case rDaily: | 836 | case rDaily: |
831 | case rWeekly: | 837 | case rWeekly: |
832 | case rMonthlyPos: | 838 | case rMonthlyPos: |
833 | case rMonthlyDay: | 839 | case rMonthlyDay: |
834 | case rYearlyMonth: | 840 | case rYearlyMonth: |
835 | case rYearlyDay: | 841 | case rYearlyDay: |
836 | case rYearlyPos: { | 842 | case rYearlyPos: { |
837 | QDate preDate = preDateTime.date(); | 843 | QDate preDate = preDateTime.date(); |
838 | if (!mFloats && mRecurStart.time() > preDateTime.time()) | 844 | if (!mFloats && mRecurStart.time() > preDateTime.time()) |
839 | preDate = preDate.addDays(-1); | 845 | preDate = preDate.addDays(-1); |
840 | return QDateTime(getNextDateNoTime(preDate, last), mRecurStart.time()); | 846 | return QDateTime(getNextDateNoTime(preDate, last), mRecurStart.time()); |
841 | } | 847 | } |
842 | default: | 848 | default: |
843 | return QDateTime(); | 849 | return QDateTime(); |
844 | } | 850 | } |
845 | 851 | ||
846 | // It's a sub-daily recurrence | 852 | // It's a sub-daily recurrence |
847 | if (preDateTime < mRecurStart) | 853 | if (preDateTime < mRecurStart) |
848 | return mRecurStart; | 854 | return mRecurStart; |
849 | int count = mRecurStart.secsTo(preDateTime) / freq + 2; | 855 | int count = mRecurStart.secsTo(preDateTime) / freq + 2; |
850 | if (rDuration > 0) { | 856 | if (rDuration > 0) { |
851 | if (count > rDuration) | 857 | if (count > rDuration) |
852 | return QDateTime(); | 858 | return QDateTime(); |
853 | if (last && count == rDuration) | 859 | if (last && count == rDuration) |
854 | *last = true; | 860 | *last = true; |
855 | } | 861 | } |
856 | QDateTime endtime = mRecurStart.addSecs((count - 1)*freq); | 862 | QDateTime endtime = mRecurStart.addSecs((count - 1)*freq); |
857 | if (rDuration == 0) { | 863 | if (rDuration == 0) { |
858 | if (endtime > rEndDateTime) | 864 | if (endtime > rEndDateTime) |
859 | return QDateTime(); | 865 | return QDateTime(); |
860 | if (last && endtime == rEndDateTime) | 866 | if (last && endtime == rEndDateTime) |
861 | *last = true; | 867 | *last = true; |
862 | } | 868 | } |
863 | return endtime; | 869 | return endtime; |
864 | } | 870 | } |
865 | 871 | ||
866 | QDate Recurrence::getNextDate(const QDate &preDate, bool *last) const | 872 | QDate Recurrence::getNextDate(const QDate &preDate, bool *last) const |
867 | { | 873 | { |
868 | if (last) | 874 | if (last) |
869 | *last = false; | 875 | *last = false; |
870 | switch (recurs) | 876 | switch (recurs) |
871 | { | 877 | { |
872 | case rMinutely: | 878 | case rMinutely: |
873 | case rHourly: | 879 | case rHourly: |
874 | return getNextDateTime(QDateTime(preDate, QTime(23,59,59)), last).date(); | 880 | return getNextDateTime(QDateTime(preDate, QTime(23,59,59)), last).date(); |
875 | case rDaily: | 881 | case rDaily: |
876 | case rWeekly: | 882 | case rWeekly: |
877 | case rMonthlyPos: | 883 | case rMonthlyPos: |
878 | case rMonthlyDay: | 884 | case rMonthlyDay: |
879 | case rYearlyMonth: | 885 | case rYearlyMonth: |
880 | case rYearlyDay: | 886 | case rYearlyDay: |
881 | case rYearlyPos: | 887 | case rYearlyPos: |
882 | qDebug("Recurrence::getNextDate: MAY BE BROKEN "); | 888 | qDebug("Recurrence::getNextDate: MAY BE BROKEN "); |
883 | return getNextDateNoTime(preDate, last); | 889 | return getNextDateNoTime(preDate, last); |
884 | default: | 890 | default: |
885 | return QDate(); | 891 | return QDate(); |
886 | } | 892 | } |
887 | } | 893 | } |
888 | 894 | ||
889 | 895 | ||
890 | QDateTime Recurrence::getPreviousDateTime(const QDateTime &afterDateTime, bool *last) const | 896 | QDateTime Recurrence::getPreviousDateTime(const QDateTime &afterDateTime, bool *last) const |
891 | { | 897 | { |
892 | if (last) | 898 | if (last) |
893 | *last = false; | 899 | *last = false; |
894 | int freq; | 900 | int freq; |
895 | switch (recurs) | 901 | switch (recurs) |
896 | { | 902 | { |
897 | case rMinutely: | 903 | case rMinutely: |
898 | freq = rFreq * 60; | 904 | freq = rFreq * 60; |
899 | break; | 905 | break; |
900 | case rHourly: | 906 | case rHourly: |
901 | freq = rFreq * 3600; | 907 | freq = rFreq * 3600; |
902 | break; | 908 | break; |
903 | case rDaily: | 909 | case rDaily: |
904 | case rWeekly: | 910 | case rWeekly: |
905 | case rMonthlyPos: | 911 | case rMonthlyPos: |
906 | case rMonthlyDay: | 912 | case rMonthlyDay: |
907 | case rYearlyMonth: | 913 | case rYearlyMonth: |
908 | case rYearlyDay: | 914 | case rYearlyDay: |
909 | case rYearlyPos: { | 915 | case rYearlyPos: { |
910 | QDate afterDate = afterDateTime.date(); | 916 | QDate afterDate = afterDateTime.date(); |
911 | if (!mFloats && mRecurStart.time() < afterDateTime.time()) | 917 | if (!mFloats && mRecurStart.time() < afterDateTime.time()) |
912 | afterDate = afterDate.addDays(1); | 918 | afterDate = afterDate.addDays(1); |
913 | return QDateTime(getPreviousDateNoTime(afterDate, last), mRecurStart.time()); | 919 | return QDateTime(getPreviousDateNoTime(afterDate, last), mRecurStart.time()); |
914 | } | 920 | } |
915 | default: | 921 | default: |
916 | return QDateTime(); | 922 | return QDateTime(); |
917 | } | 923 | } |
918 | 924 | ||
919 | // It's a sub-daily recurrence | 925 | // It's a sub-daily recurrence |
920 | if (afterDateTime <= mRecurStart) | 926 | if (afterDateTime <= mRecurStart) |
921 | return QDateTime(); | 927 | return QDateTime(); |
922 | int count = (mRecurStart.secsTo(afterDateTime) - 1) / freq + 1; | 928 | int count = (mRecurStart.secsTo(afterDateTime) - 1) / freq + 1; |
923 | if (rDuration > 0) { | 929 | if (rDuration > 0) { |
924 | if (count > rDuration) | 930 | if (count > rDuration) |
925 | count = rDuration; | 931 | count = rDuration; |
926 | if (last && count == rDuration) | 932 | if (last && count == rDuration) |
927 | *last = true; | 933 | *last = true; |
928 | } | 934 | } |
929 | QDateTime endtime = mRecurStart.addSecs((count - 1)*freq); | 935 | QDateTime endtime = mRecurStart.addSecs((count - 1)*freq); |
930 | if (rDuration == 0) { | 936 | if (rDuration == 0) { |
931 | if (endtime > rEndDateTime) | 937 | if (endtime > rEndDateTime) |
932 | endtime = rEndDateTime; | 938 | endtime = rEndDateTime; |
933 | if (last && endtime == rEndDateTime) | 939 | if (last && endtime == rEndDateTime) |
934 | *last = true; | 940 | *last = true; |
935 | } | 941 | } |
936 | return endtime; | 942 | return endtime; |
937 | } | 943 | } |
938 | 944 | ||
939 | QDate Recurrence::getPreviousDate(const QDate &afterDate, bool *last) const | 945 | QDate Recurrence::getPreviousDate(const QDate &afterDate, bool *last) const |
940 | { | 946 | { |
941 | if (last) | 947 | if (last) |
942 | *last = false; | 948 | *last = false; |
943 | switch (recurs) | 949 | switch (recurs) |
944 | { | 950 | { |
945 | case rMinutely: | 951 | case rMinutely: |
946 | case rHourly: | 952 | case rHourly: |
947 | return getPreviousDateTime(QDateTime(afterDate, QTime(0,0,0)), last).date(); | 953 | return getPreviousDateTime(QDateTime(afterDate, QTime(0,0,0)), last).date(); |
948 | case rDaily: | 954 | case rDaily: |
949 | case rWeekly: | 955 | case rWeekly: |
950 | case rMonthlyPos: | 956 | case rMonthlyPos: |
951 | case rMonthlyDay: | 957 | case rMonthlyDay: |
952 | case rYearlyMonth: | 958 | case rYearlyMonth: |
953 | case rYearlyDay: | 959 | case rYearlyDay: |
954 | case rYearlyPos: | 960 | case rYearlyPos: |
955 | return getPreviousDateNoTime(afterDate, last); | 961 | return getPreviousDateNoTime(afterDate, last); |
956 | default: | 962 | default: |
957 | return QDate(); | 963 | return QDate(); |
958 | } | 964 | } |
959 | } | 965 | } |
960 | 966 | ||
961 | 967 | ||
962 | /***************************** PROTECTED FUNCTIONS ***************************/ | 968 | /***************************** PROTECTED FUNCTIONS ***************************/ |
963 | 969 | ||
964 | bool Recurrence::recursSecondly(const QDate &qd, int secondFreq) const | 970 | bool Recurrence::recursSecondly(const QDate &qd, int secondFreq) const |
965 | { | 971 | { |
966 | if ((qd >= mRecurStart.date()) && | 972 | if ((qd >= mRecurStart.date()) && |
967 | ((rDuration > 0) && (qd <= endDate()) || | 973 | ((rDuration > 0) && (qd <= endDate()) || |
968 | ((rDuration == 0) && (qd <= rEndDateTime.date())) || | 974 | ((rDuration == 0) && (qd <= rEndDateTime.date())) || |
969 | (rDuration == -1))) { | 975 | (rDuration == -1))) { |
970 | // The date queried falls within the range of the event. | 976 | // The date queried falls within the range of the event. |
971 | if (secondFreq < 24*3600) | 977 | if (secondFreq < 24*3600) |
972 | return true; // the event recurs at least once each day | 978 | return true; // the event recurs at least once each day |
973 | int after = mRecurStart.secsTo(QDateTime(qd)); | 979 | int after = mRecurStart.secsTo(QDateTime(qd)); |
974 | if (after / secondFreq != (after + 24*3600) / secondFreq) | 980 | if (after / secondFreq != (after + 24*3600) / secondFreq) |
975 | return true; | 981 | return true; |
976 | } | 982 | } |
977 | return false; | 983 | return false; |
978 | } | 984 | } |
979 | 985 | ||
980 | bool Recurrence::recursMinutelyAt(const QDateTime &dt, int minuteFreq) const | 986 | bool Recurrence::recursMinutelyAt(const QDateTime &dt, int minuteFreq) const |
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp index 083e6d1..48257ef 100644 --- a/pwmanager/pwmanager/pwm.cpp +++ b/pwmanager/pwmanager/pwm.cpp | |||
@@ -1,1549 +1,1549 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2003, 2004 by Michael Buesch * | 3 | * copyright (C) 2003, 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.0.1 of pwmanager | 14 | * This file is originaly based on version 1.0.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #include <klocale.h> | 20 | #include <klocale.h> |
21 | #include <klistview.h> | 21 | #include <klistview.h> |
22 | #include <ktoolbar.h> | 22 | #include <ktoolbar.h> |
23 | #include <kfiledialog.h> | 23 | #include <kfiledialog.h> |
24 | #include <kiconloader.h> | 24 | #include <kiconloader.h> |
25 | #include <kmessagebox.h> | 25 | #include <kmessagebox.h> |
26 | 26 | ||
27 | #include <qstatusbar.h> | 27 | #include <qstatusbar.h> |
28 | 28 | ||
29 | #ifndef PWM_EMBEDDED | 29 | #ifndef PWM_EMBEDDED |
30 | #include <kmenubar.h> | 30 | #include <kmenubar.h> |
31 | #include <kstatusbar.h> | 31 | #include <kstatusbar.h> |
32 | #include <dcopclient.h> | 32 | #include <dcopclient.h> |
33 | #include "configwndimpl.h" | 33 | #include "configwndimpl.h" |
34 | #include "configuration.h" | 34 | #include "configuration.h" |
35 | #else | 35 | #else |
36 | #include <qmenubar.h> | 36 | #include <qmenubar.h> |
37 | #include <qmessagebox.h> | 37 | #include <qmessagebox.h> |
38 | #include <pwmprefs.h> | 38 | #include <pwmprefs.h> |
39 | #include <kpimglobalprefs.h> | 39 | #include <kpimglobalprefs.h> |
40 | #include <kcmconfigs/kcmpwmconfig.h> | 40 | #include <kcmconfigs/kcmpwmconfig.h> |
41 | #include <kcmconfigs/kcmkdepimconfig.h> | 41 | #include <kcmconfigs/kcmkdepimconfig.h> |
42 | #include <kcmultidialog.h> | 42 | #include <kcmultidialog.h> |
43 | #include "editcategory.h" | 43 | #include "editcategory.h" |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | 46 | ||
47 | #ifndef DESKTOP_VERSION | 47 | #ifndef DESKTOP_VERSION |
48 | #include <qpe/global.h> | 48 | #include <qpe/global.h> |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #include <qpixmap.h> | 51 | #include <qpixmap.h> |
52 | #include <qcheckbox.h> | 52 | #include <qcheckbox.h> |
53 | #include <qspinbox.h> | 53 | #include <qspinbox.h> |
54 | #include <qlineedit.h> | 54 | #include <qlineedit.h> |
55 | #include <qfileinfo.h> | 55 | #include <qfileinfo.h> |
56 | #include <qclipboard.h> | 56 | #include <qclipboard.h> |
57 | 57 | ||
58 | 58 | ||
59 | #include <stdio.h> | 59 | #include <stdio.h> |
60 | 60 | ||
61 | #include "pwm.h" | 61 | #include "pwm.h" |
62 | #include "pwminit.h" | 62 | #include "pwminit.h" |
63 | #include "pwmprint.h" | 63 | #include "pwmprint.h" |
64 | #include "addentrywndimpl.h" | 64 | #include "addentrywndimpl.h" |
65 | #include "globalstuff.h" | 65 | #include "globalstuff.h" |
66 | #include "findwndimpl.h" | 66 | #include "findwndimpl.h" |
67 | #include "csv.h" | 67 | #include "csv.h" |
68 | 68 | ||
69 | #ifdef CONFIG_KWALLETIF | 69 | #ifdef CONFIG_KWALLETIF |
70 | # include "kwalletif.h" | 70 | # include "kwalletif.h" |
71 | # include "kwalletemu.h" | 71 | # include "kwalletemu.h" |
72 | #endif | 72 | #endif |
73 | #ifdef CONFIG_KEYCARD | 73 | #ifdef CONFIG_KEYCARD |
74 | # include "pwmkeycard.h" | 74 | # include "pwmkeycard.h" |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | 77 | ||
78 | #define DEFAULT_SIZE (QSize(700, 400)) | 78 | #define DEFAULT_SIZE (QSize(700, 400)) |
79 | 79 | ||
80 | // Button IDs for "file" popup menu | 80 | // Button IDs for "file" popup menu |
81 | enum { | 81 | enum { |
82 | BUTTON_POPUP_FILE_NEW = 0, | 82 | BUTTON_POPUP_FILE_NEW = 0, |
83 | BUTTON_POPUP_FILE_OPEN, | 83 | BUTTON_POPUP_FILE_OPEN, |
84 | BUTTON_POPUP_FILE_CLOSE, | 84 | BUTTON_POPUP_FILE_CLOSE, |
85 | BUTTON_POPUP_FILE_SAVE, | 85 | BUTTON_POPUP_FILE_SAVE, |
86 | BUTTON_POPUP_FILE_SAVEAS, | 86 | BUTTON_POPUP_FILE_SAVEAS, |
87 | BUTTON_POPUP_FILE_EXPORT, | 87 | BUTTON_POPUP_FILE_EXPORT, |
88 | BUTTON_POPUP_FILE_IMPORT, | 88 | BUTTON_POPUP_FILE_IMPORT, |
89 | BUTTON_POPUP_FILE_PRINT, | 89 | BUTTON_POPUP_FILE_PRINT, |
90 | BUTTON_POPUP_FILE_QUIT | 90 | BUTTON_POPUP_FILE_QUIT |
91 | }; | 91 | }; |
92 | // Button IDs for "manage" popup menu | 92 | // Button IDs for "manage" popup menu |
93 | enum { | 93 | enum { |
94 | BUTTON_POPUP_MANAGE_ADD = 0, | 94 | BUTTON_POPUP_MANAGE_ADD = 0, |
95 | BUTTON_POPUP_MANAGE_EDIT, | 95 | BUTTON_POPUP_MANAGE_EDIT, |
96 | BUTTON_POPUP_MANAGE_DEL, | 96 | BUTTON_POPUP_MANAGE_DEL, |
97 | BUTTON_POPUP_MANAGE_CHANGEMP | 97 | BUTTON_POPUP_MANAGE_CHANGEMP |
98 | }; | 98 | }; |
99 | // Button IDs for chipcard popup menu | 99 | // Button IDs for chipcard popup menu |
100 | enum { | 100 | enum { |
101 | #ifdef CONFIG_KEYCARD | 101 | #ifdef CONFIG_KEYCARD |
102 | BUTTON_POPUP_CHIPCARD_GENNEW = 0, | 102 | BUTTON_POPUP_CHIPCARD_GENNEW = 0, |
103 | BUTTON_POPUP_CHIPCARD_DEL, | 103 | BUTTON_POPUP_CHIPCARD_DEL, |
104 | BUTTON_POPUP_CHIPCARD_READID, | 104 | BUTTON_POPUP_CHIPCARD_READID, |
105 | BUTTON_POPUP_CHIPCARD_SAVEBACKUP, | 105 | BUTTON_POPUP_CHIPCARD_SAVEBACKUP, |
106 | BUTTON_POPUP_CHIPCARD_REPLAYBACKUP | 106 | BUTTON_POPUP_CHIPCARD_REPLAYBACKUP |
107 | #else // CONFIG_KEYCARD | 107 | #else // CONFIG_KEYCARD |
108 | BUTTON_POPUP_CHIPCARD_NO = 0 | 108 | BUTTON_POPUP_CHIPCARD_NO = 0 |
109 | #endif // CONFIG_KEYCARD | 109 | #endif // CONFIG_KEYCARD |
110 | }; | 110 | }; |
111 | // Button IDs for "view" popup menu | 111 | // Button IDs for "view" popup menu |
112 | enum { | 112 | enum { |
113 | BUTTON_POPUP_VIEW_FIND = 0, | 113 | BUTTON_POPUP_VIEW_FIND = 0, |
114 | BUTTON_POPUP_VIEW_LOCK, | 114 | BUTTON_POPUP_VIEW_LOCK, |
115 | BUTTON_POPUP_VIEW_DEEPLOCK, | 115 | BUTTON_POPUP_VIEW_DEEPLOCK, |
116 | BUTTON_POPUP_VIEW_UNLOCK | 116 | BUTTON_POPUP_VIEW_UNLOCK |
117 | }; | 117 | }; |
118 | // Button IDs for "options" popup menu | 118 | // Button IDs for "options" popup menu |
119 | enum { | 119 | enum { |
120 | BUTTON_POPUP_OPTIONS_CONFIG = 0 | 120 | BUTTON_POPUP_OPTIONS_CONFIG = 0 |
121 | #ifdef PWM_EMBEDDED | 121 | #ifdef PWM_EMBEDDED |
122 | ,BUTTON_POPUP_OPTIONS_CATEGORY | 122 | ,BUTTON_POPUP_OPTIONS_CATEGORY |
123 | #endif | 123 | #endif |
124 | }; | 124 | }; |
125 | // Button IDs for "export" popup menu (in "file" popup menu) | 125 | // Button IDs for "export" popup menu (in "file" popup menu) |
126 | enum { | 126 | enum { |
127 | BUTTON_POPUP_EXPORT_TEXT = 0, | 127 | BUTTON_POPUP_EXPORT_TEXT = 0, |
128 | BUTTON_POPUP_EXPORT_GPASMAN, | 128 | BUTTON_POPUP_EXPORT_GPASMAN, |
129 | BUTTON_POPUP_EXPORT_CSV | 129 | BUTTON_POPUP_EXPORT_CSV |
130 | #ifdef CONFIG_KWALLETIF | 130 | #ifdef CONFIG_KWALLETIF |
131 | ,BUTTON_POPUP_EXPORT_KWALLET | 131 | ,BUTTON_POPUP_EXPORT_KWALLET |
132 | #endif | 132 | #endif |
133 | }; | 133 | }; |
134 | // Button IDs for "import" popup menu (in "file" popup menu) | 134 | // Button IDs for "import" popup menu (in "file" popup menu) |
135 | enum { | 135 | enum { |
136 | BUTTON_POPUP_IMPORT_TEXT = 0, | 136 | BUTTON_POPUP_IMPORT_TEXT = 0, |
137 | BUTTON_POPUP_IMPORT_GPASMAN, | 137 | BUTTON_POPUP_IMPORT_GPASMAN, |
138 | BUTTON_POPUP_IMPORT_CSV | 138 | BUTTON_POPUP_IMPORT_CSV |
139 | #ifdef CONFIG_KWALLETIF | 139 | #ifdef CONFIG_KWALLETIF |
140 | ,BUTTON_POPUP_IMPORT_KWALLET | 140 | ,BUTTON_POPUP_IMPORT_KWALLET |
141 | #endif | 141 | #endif |
142 | }; | 142 | }; |
143 | 143 | ||
144 | #ifdef PWM_EMBEDDED | 144 | #ifdef PWM_EMBEDDED |
145 | // Button IDs for "help" popup menu | 145 | // Button IDs for "help" popup menu |
146 | enum { | 146 | enum { |
147 | BUTTON_POPUP_HELP_LICENSE = 0, | 147 | BUTTON_POPUP_HELP_LICENSE = 0, |
148 | BUTTON_POPUP_HELP_FAQ, | 148 | BUTTON_POPUP_HELP_FAQ, |
149 | BUTTON_POPUP_HELP_ABOUT, | 149 | BUTTON_POPUP_HELP_ABOUT, |
150 | BUTTON_POPUP_HELP_SYNC, | 150 | BUTTON_POPUP_HELP_SYNC, |
151 | BUTTON_POPUP_HELP_WHATSNEW | 151 | BUTTON_POPUP_HELP_WHATSNEW |
152 | }; | 152 | }; |
153 | #endif | 153 | #endif |
154 | 154 | ||
155 | // Button IDs for toolbar | 155 | // Button IDs for toolbar |
156 | enum { | 156 | enum { |
157 | BUTTON_TOOL_NEW = 0, | 157 | BUTTON_TOOL_NEW = 0, |
158 | BUTTON_TOOL_OPEN, | 158 | BUTTON_TOOL_OPEN, |
159 | BUTTON_TOOL_SAVE, | 159 | BUTTON_TOOL_SAVE, |
160 | BUTTON_TOOL_SAVEAS, | 160 | BUTTON_TOOL_SAVEAS, |
161 | BUTTON_TOOL_PRINT, | 161 | BUTTON_TOOL_PRINT, |
162 | BUTTON_TOOL_ADD, | 162 | BUTTON_TOOL_ADD, |
163 | BUTTON_TOOL_EDIT, | 163 | BUTTON_TOOL_EDIT, |
164 | BUTTON_TOOL_DEL, | 164 | BUTTON_TOOL_DEL, |
165 | BUTTON_TOOL_FIND, | 165 | BUTTON_TOOL_FIND, |
166 | BUTTON_TOOL_LOCK, | 166 | BUTTON_TOOL_LOCK, |
167 | BUTTON_TOOL_DEEPLOCK, | 167 | BUTTON_TOOL_DEEPLOCK, |
168 | BUTTON_TOOL_UNLOCK | 168 | BUTTON_TOOL_UNLOCK |
169 | }; | 169 | }; |
170 | 170 | ||
171 | 171 | ||
172 | PwM::PwM(PwMInit *_init, PwMDoc *doc, | 172 | PwM::PwM(PwMInit *_init, PwMDoc *doc, |
173 | bool virginity, | 173 | bool virginity, |
174 | QWidget *parent, const char *name) | 174 | QWidget *parent, const char *name) |
175 | : KMainWindow(parent, "HALLO") | 175 | : KMainWindow(parent, "HALLO") |
176 | , forceQuit (false) | 176 | , forceQuit (false) |
177 | , forceMinimizeToTray (false) | 177 | , forceMinimizeToTray (false) |
178 | { | 178 | { |
179 | syncManager = 0; | 179 | syncManager = 0; |
180 | virgin = !virginity; | 180 | virgin = !virginity; |
181 | init = _init; | 181 | init = _init; |
182 | connect(doc, SIGNAL(docClosed(PwMDoc *)), | 182 | connect(doc, SIGNAL(docClosed(PwMDoc *)), |
183 | this, SLOT(docClosed(PwMDoc *))); | 183 | this, SLOT(docClosed(PwMDoc *))); |
184 | initMenubar(); | 184 | initMenubar(); |
185 | initToolbar(); | 185 | initToolbar(); |
186 | initMetrics(); | 186 | initMetrics(); |
187 | setVirgin(virginity); | 187 | setVirgin(virginity); |
188 | setFocusPolicy(QWidget::WheelFocus); | 188 | setFocusPolicy(QWidget::WheelFocus); |
189 | #ifndef PWM_EMBEDDED | 189 | #ifndef PWM_EMBEDDED |
190 | statusBar()->show(); | 190 | statusBar()->show(); |
191 | #endif | 191 | #endif |
192 | view = makeNewListView(doc); | 192 | view = makeNewListView(doc); |
193 | setCentralWidget(view); | 193 | setCentralWidget(view); |
194 | updateCaption(); | 194 | updateCaption(); |
195 | showStatMsg(i18n("Ready.")); | 195 | showStatMsg(i18n("Ready.")); |
196 | } | 196 | } |
197 | 197 | ||
198 | PwM::~PwM() | 198 | PwM::~PwM() |
199 | { | 199 | { |
200 | qDebug("PwM::~PwM() %x", this); | 200 | //qDebug("PwM::~PwM() %x", this); |
201 | disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), | 201 | disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), |
202 | this, SLOT(docClosed(PwMDoc *))); | 202 | this, SLOT(docClosed(PwMDoc *))); |
203 | conf()->confWndMainWndSize(size()); | 203 | conf()->confWndMainWndSize(size()); |
204 | //LR closing of windows changed | 204 | //LR closing of windows changed |
205 | //needed for fastload option on PDA | 205 | //needed for fastload option on PDA |
206 | //emit closed(this); | 206 | //emit closed(this); |
207 | //qDebug("PwM::~PwM() emited closed(this)"); | 207 | //qDebug("PwM::~PwM() emited closed(this)"); |
208 | delete view; | 208 | delete view; |
209 | delete syncManager; | 209 | delete syncManager; |
210 | } | 210 | } |
211 | 211 | ||
212 | void PwM::initMenubar() | 212 | void PwM::initMenubar() |
213 | { | 213 | { |
214 | KIconLoader* picons; | 214 | KIconLoader* picons; |
215 | #ifndef PWM_EMBEDDED | 215 | #ifndef PWM_EMBEDDED |
216 | KIconLoader icons; | 216 | KIconLoader icons; |
217 | picons = &icons; | 217 | picons = &icons; |
218 | #else | 218 | #else |
219 | picons = KGlobal::iconLoader(); | 219 | picons = KGlobal::iconLoader(); |
220 | 220 | ||
221 | 221 | ||
222 | syncPopup = new KPopupMenu(this); | 222 | syncPopup = new KPopupMenu(this); |
223 | 223 | ||
224 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup); | 224 | syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup); |
225 | syncManager->setBlockSave(false); | 225 | syncManager->setBlockSave(false); |
226 | 226 | ||
227 | connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); | 227 | connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); |
228 | syncManager->fillSyncMenu(); | 228 | syncManager->fillSyncMenu(); |
229 | 229 | ||
230 | #endif | 230 | #endif |
231 | filePopup = new KPopupMenu(this); | 231 | filePopup = new KPopupMenu(this); |
232 | importPopup = new KPopupMenu(filePopup); | 232 | importPopup = new KPopupMenu(filePopup); |
233 | exportPopup = new KPopupMenu(filePopup); | 233 | exportPopup = new KPopupMenu(filePopup); |
234 | managePopup = new KPopupMenu(this); | 234 | managePopup = new KPopupMenu(this); |
235 | #ifdef CONFIG_KEYCARD | 235 | #ifdef CONFIG_KEYCARD |
236 | chipcardPopup = new KPopupMenu(this); | 236 | chipcardPopup = new KPopupMenu(this); |
237 | #endif // CONFIG_KEYCARD | 237 | #endif // CONFIG_KEYCARD |
238 | viewPopup = new KPopupMenu(this); | 238 | viewPopup = new KPopupMenu(this); |
239 | optionsPopup = new KPopupMenu(this); | 239 | optionsPopup = new KPopupMenu(this); |
240 | 240 | ||
241 | // "file" popup menu | 241 | // "file" popup menu |
242 | filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), | 242 | filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), |
243 | i18n("&New"), this, | 243 | i18n("&New"), this, |
244 | SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); | 244 | SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); |
245 | filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), | 245 | filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), |
246 | i18n("&Open"), this, | 246 | i18n("&Open"), this, |
247 | SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); | 247 | SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); |
248 | filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), | 248 | filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), |
249 | i18n("&Close"), this, | 249 | i18n("&Close"), this, |
250 | SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); | 250 | SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); |
251 | filePopup->insertSeparator(); | 251 | filePopup->insertSeparator(); |
252 | filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), | 252 | filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), |
253 | i18n("&Save"), this, | 253 | i18n("&Save"), this, |
254 | SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); | 254 | SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); |
255 | filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), | 255 | filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), |
256 | i18n("Save &as..."), | 256 | i18n("Save &as..."), |
257 | this, SLOT(saveAs_slot()), 0, | 257 | this, SLOT(saveAs_slot()), 0, |
258 | BUTTON_POPUP_FILE_SAVEAS); | 258 | BUTTON_POPUP_FILE_SAVEAS); |
259 | filePopup->insertSeparator(); | 259 | filePopup->insertSeparator(); |
260 | // "file/export" popup menu | 260 | // "file/export" popup menu |
261 | exportPopup->insertItem(i18n("&Text-file..."), this, | 261 | exportPopup->insertItem(i18n("&Text-file..."), this, |
262 | SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); | 262 | SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); |
263 | exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, | 263 | exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, |
264 | SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); | 264 | SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); |
265 | exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, | 265 | exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, |
266 | SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV); | 266 | SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV); |
267 | #ifdef CONFIG_KWALLETIF | 267 | #ifdef CONFIG_KWALLETIF |
268 | exportPopup->insertItem(i18n("&KWallet..."), this, | 268 | exportPopup->insertItem(i18n("&KWallet..."), this, |
269 | SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); | 269 | SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); |
270 | #endif | 270 | #endif |
271 | filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), | 271 | filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), |
272 | i18n("E&xport"), exportPopup, | 272 | i18n("E&xport"), exportPopup, |
273 | BUTTON_POPUP_FILE_EXPORT); | 273 | BUTTON_POPUP_FILE_EXPORT); |
274 | // "file/import" popup menu | 274 | // "file/import" popup menu |
275 | importPopup->insertItem(i18n("&Text-file..."), this, | 275 | importPopup->insertItem(i18n("&Text-file..."), this, |
276 | SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT); | 276 | SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT); |
277 | importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, | 277 | importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, |
278 | SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN); | 278 | SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN); |
279 | importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, | 279 | importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, |
280 | SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV); | 280 | SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV); |
281 | #ifdef CONFIG_KWALLETIF | 281 | #ifdef CONFIG_KWALLETIF |
282 | importPopup->insertItem(i18n("&KWallet..."), this, | 282 | importPopup->insertItem(i18n("&KWallet..."), this, |
283 | SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); | 283 | SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); |
284 | #endif | 284 | #endif |
285 | filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), | 285 | filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), |
286 | i18n("I&mport"), importPopup, | 286 | i18n("I&mport"), importPopup, |
287 | BUTTON_POPUP_FILE_IMPORT); | 287 | BUTTON_POPUP_FILE_IMPORT); |
288 | filePopup->insertSeparator(); | 288 | filePopup->insertSeparator(); |
289 | filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), | 289 | filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), |
290 | i18n("&Print..."), this, | 290 | i18n("&Print..."), this, |
291 | SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); | 291 | SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); |
292 | filePopup->insertSeparator(); | 292 | filePopup->insertSeparator(); |
293 | filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)), | 293 | filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)), |
294 | i18n("&Quit"), this, | 294 | i18n("&Quit"), this, |
295 | SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT); | 295 | SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT); |
296 | menuBar()->insertItem(i18n("&File"), filePopup); | 296 | menuBar()->insertItem(i18n("&File"), filePopup); |
297 | // "manage" popup menu | 297 | // "manage" popup menu |
298 | managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)), | 298 | managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)), |
299 | i18n("&Add password"), this, | 299 | i18n("&Add password"), this, |
300 | SLOT(addPwd_slot()), 0, | 300 | SLOT(addPwd_slot()), 0, |
301 | BUTTON_POPUP_MANAGE_ADD); | 301 | BUTTON_POPUP_MANAGE_ADD); |
302 | managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)), | 302 | managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)), |
303 | i18n("&Edit"), this, SLOT(editPwd_slot()), 0, | 303 | i18n("&Edit"), this, SLOT(editPwd_slot()), 0, |
304 | BUTTON_POPUP_MANAGE_EDIT); | 304 | BUTTON_POPUP_MANAGE_EDIT); |
305 | managePopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), | 305 | managePopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), |
306 | i18n("&Delete"), this, SLOT(deletePwd_slot()), | 306 | i18n("&Delete"), this, SLOT(deletePwd_slot()), |
307 | 0, BUTTON_POPUP_MANAGE_DEL); | 307 | 0, BUTTON_POPUP_MANAGE_DEL); |
308 | managePopup->insertSeparator(); | 308 | managePopup->insertSeparator(); |
309 | managePopup->insertItem(QIconSet(picons->loadIcon("rotate", KIcon::Small)), | 309 | managePopup->insertItem(QIconSet(picons->loadIcon("rotate", KIcon::Small)), |
310 | i18n("Change &Master Password"), this, | 310 | i18n("Change &Master Password"), this, |
311 | SLOT(changeMasterPwd_slot()), 0, | 311 | SLOT(changeMasterPwd_slot()), 0, |
312 | BUTTON_POPUP_MANAGE_CHANGEMP); | 312 | BUTTON_POPUP_MANAGE_CHANGEMP); |
313 | menuBar()->insertItem(i18n("&Manage"), managePopup); | 313 | menuBar()->insertItem(i18n("&Manage"), managePopup); |
314 | // "chipcard" popup menu | 314 | // "chipcard" popup menu |
315 | #ifdef CONFIG_KEYCARD | 315 | #ifdef CONFIG_KEYCARD |
316 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), | 316 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), |
317 | i18n("&Generate new key-card"), this, | 317 | i18n("&Generate new key-card"), this, |
318 | SLOT(genNewCard_slot()), 0, | 318 | SLOT(genNewCard_slot()), 0, |
319 | BUTTON_POPUP_CHIPCARD_GENNEW); | 319 | BUTTON_POPUP_CHIPCARD_GENNEW); |
320 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), | 320 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("editdelete", KIcon::Small)), |
321 | i18n("&Erase key-card"), this, | 321 | i18n("&Erase key-card"), this, |
322 | SLOT(eraseCard_slot()), 0, | 322 | SLOT(eraseCard_slot()), 0, |
323 | BUTTON_POPUP_CHIPCARD_DEL); | 323 | BUTTON_POPUP_CHIPCARD_DEL); |
324 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)), | 324 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("", KIcon::Small)), |
325 | i18n("Read card-&ID"), this, | 325 | i18n("Read card-&ID"), this, |
326 | SLOT(readCardId_slot()), 0, | 326 | SLOT(readCardId_slot()), 0, |
327 | BUTTON_POPUP_CHIPCARD_READID); | 327 | BUTTON_POPUP_CHIPCARD_READID); |
328 | chipcardPopup->insertSeparator(); | 328 | chipcardPopup->insertSeparator(); |
329 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)), | 329 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("2rightarrow", KIcon::Small)), |
330 | i18n("&Make card backup-image"), this, | 330 | i18n("&Make card backup-image"), this, |
331 | SLOT(makeCardBackup_slot()), 0, | 331 | SLOT(makeCardBackup_slot()), 0, |
332 | BUTTON_POPUP_CHIPCARD_SAVEBACKUP); | 332 | BUTTON_POPUP_CHIPCARD_SAVEBACKUP); |
333 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)), | 333 | chipcardPopup->insertItem(QIconSet(picons->loadIcon("2leftarrow", KIcon::Small)), |
334 | i18n("&Replay card backup-image"), this, | 334 | i18n("&Replay card backup-image"), this, |
335 | SLOT(replayCardBackup_slot()), 0, | 335 | SLOT(replayCardBackup_slot()), 0, |
336 | BUTTON_POPUP_CHIPCARD_REPLAYBACKUP); | 336 | BUTTON_POPUP_CHIPCARD_REPLAYBACKUP); |
337 | menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup); | 337 | menuBar()->insertItem(i18n("&Chipcard manager"), chipcardPopup); |
338 | #endif // CONFIG_KEYCARD | 338 | #endif // CONFIG_KEYCARD |
339 | // "view" popup menu | 339 | // "view" popup menu |
340 | viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)), | 340 | viewPopup->insertItem(QIconSet(picons->loadIcon("find", KIcon::Small)), |
341 | i18n("&Find"), this, | 341 | i18n("&Find"), this, |
342 | SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND); | 342 | SLOT(find_slot()), 0, BUTTON_POPUP_VIEW_FIND); |
343 | viewPopup->insertSeparator(); | 343 | viewPopup->insertSeparator(); |
344 | viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)), | 344 | viewPopup->insertItem(QIconSet(picons->loadIcon("halfencrypted", KIcon::Small)), |
345 | i18n("&Lock all entries"), this, | 345 | i18n("&Lock all entries"), this, |
346 | SLOT(lockWnd_slot()), 0, | 346 | SLOT(lockWnd_slot()), 0, |
347 | BUTTON_POPUP_VIEW_LOCK); | 347 | BUTTON_POPUP_VIEW_LOCK); |
348 | viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)), | 348 | viewPopup->insertItem(QIconSet(picons->loadIcon("encrypted", KIcon::Small)), |
349 | i18n("&Deep-lock all entries"), this, | 349 | i18n("&Deep-lock all entries"), this, |
350 | SLOT(deepLockWnd_slot()), 0, | 350 | SLOT(deepLockWnd_slot()), 0, |
351 | BUTTON_POPUP_VIEW_DEEPLOCK); | 351 | BUTTON_POPUP_VIEW_DEEPLOCK); |
352 | viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)), | 352 | viewPopup->insertItem(QIconSet(picons->loadIcon("decrypted", KIcon::Small)), |
353 | i18n("&Unlock all entries"), this, | 353 | i18n("&Unlock all entries"), this, |
354 | SLOT(unlockWnd_slot()), 0, | 354 | SLOT(unlockWnd_slot()), 0, |
355 | BUTTON_POPUP_VIEW_UNLOCK); | 355 | BUTTON_POPUP_VIEW_UNLOCK); |
356 | menuBar()->insertItem(i18n("&View"), viewPopup); | 356 | menuBar()->insertItem(i18n("&View"), viewPopup); |
357 | // "options" popup menu | 357 | // "options" popup menu |
358 | optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), | 358 | optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), |
359 | i18n("&Configure..."), this, | 359 | i18n("&Configure..."), this, |
360 | SLOT(config_slot()),0, | 360 | SLOT(config_slot()),0, |
361 | BUTTON_POPUP_OPTIONS_CONFIG); | 361 | BUTTON_POPUP_OPTIONS_CONFIG); |
362 | menuBar()->insertItem(i18n("&Options"), optionsPopup); | 362 | menuBar()->insertItem(i18n("&Options"), optionsPopup); |
363 | // "help" popup menu | 363 | // "help" popup menu |
364 | #ifndef PWM_EMBEDDED | 364 | #ifndef PWM_EMBEDDED |
365 | helpPopup = helpMenu(QString::null, false); | 365 | helpPopup = helpMenu(QString::null, false); |
366 | #else | 366 | #else |
367 | optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), | 367 | optionsPopup->insertItem(QIconSet(picons->loadIcon("configure", KIcon::Small)), |
368 | i18n("C&ategories..."), this, | 368 | i18n("C&ategories..."), this, |
369 | SLOT(category_slot()),0, | 369 | SLOT(category_slot()),0, |
370 | BUTTON_POPUP_OPTIONS_CATEGORY); | 370 | BUTTON_POPUP_OPTIONS_CATEGORY); |
371 | 371 | ||
372 | 372 | ||
373 | menuBar()->insertItem(i18n("&Sync"), syncPopup); | 373 | menuBar()->insertItem(i18n("&Sync"), syncPopup); |
374 | 374 | ||
375 | 375 | ||
376 | 376 | ||
377 | 377 | ||
378 | 378 | ||
379 | helpPopup = new KPopupMenu(this); | 379 | helpPopup = new KPopupMenu(this); |
380 | 380 | ||
381 | 381 | ||
382 | helpPopup->insertItem(i18n("&License"), this, | 382 | helpPopup->insertItem(i18n("&License"), this, |
383 | SLOT(showLicense_slot()), 0, | 383 | SLOT(showLicense_slot()), 0, |
384 | BUTTON_POPUP_HELP_LICENSE); | 384 | BUTTON_POPUP_HELP_LICENSE); |
385 | 385 | ||
386 | helpPopup->insertItem(i18n("&Faq"), this, | 386 | helpPopup->insertItem(i18n("&Faq"), this, |
387 | SLOT(faq_slot()), 0, | 387 | SLOT(faq_slot()), 0, |
388 | BUTTON_POPUP_HELP_FAQ); | 388 | BUTTON_POPUP_HELP_FAQ); |
389 | 389 | ||
390 | helpPopup->insertItem(i18n("&About PwManager"), this, | 390 | helpPopup->insertItem(i18n("&About PwManager"), this, |
391 | SLOT(createAboutData_slot()), 0, | 391 | SLOT(createAboutData_slot()), 0, |
392 | BUTTON_POPUP_HELP_ABOUT); | 392 | BUTTON_POPUP_HELP_ABOUT); |
393 | 393 | ||
394 | helpPopup->insertItem(i18n("&Sync HowTo"), this, | 394 | helpPopup->insertItem(i18n("&Sync HowTo"), this, |
395 | SLOT(syncHowTo_slot()), 0, | 395 | SLOT(syncHowTo_slot()), 0, |
396 | BUTTON_POPUP_HELP_SYNC); | 396 | BUTTON_POPUP_HELP_SYNC); |
397 | 397 | ||
398 | helpPopup->insertItem(i18n("&What's New"), this, | 398 | helpPopup->insertItem(i18n("&What's New"), this, |
399 | SLOT(whatsnew_slot()), 0, | 399 | SLOT(whatsnew_slot()), 0, |
400 | BUTTON_POPUP_HELP_WHATSNEW); | 400 | BUTTON_POPUP_HELP_WHATSNEW); |
401 | 401 | ||
402 | #endif | 402 | #endif |
403 | menuBar()->insertItem(i18n("&Help"), helpPopup); | 403 | menuBar()->insertItem(i18n("&Help"), helpPopup); |
404 | 404 | ||
405 | } | 405 | } |
406 | 406 | ||
407 | void PwM::initToolbar() | 407 | void PwM::initToolbar() |
408 | { | 408 | { |
409 | KIconLoader* picons; | 409 | KIconLoader* picons; |
410 | #ifndef PWM_EMBEDDED | 410 | #ifndef PWM_EMBEDDED |
411 | KIconLoader icons; | 411 | KIconLoader icons; |
412 | picons = &icons; | 412 | picons = &icons; |
413 | #else | 413 | #else |
414 | picons = KGlobal::iconLoader(); | 414 | picons = KGlobal::iconLoader(); |
415 | #endif | 415 | #endif |
416 | 416 | ||
417 | #ifdef PWM_EMBEDDED | 417 | #ifdef PWM_EMBEDDED |
418 | if ( QApplication::desktop()->width() > 320 ) | 418 | if ( QApplication::desktop()->width() > 320 ) |
419 | #endif | 419 | #endif |
420 | { | 420 | { |
421 | toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar), | 421 | toolBar()->insertButton(picons->loadIcon("filenew", KIcon::Toolbar), |
422 | BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this, | 422 | BUTTON_TOOL_NEW, SIGNAL(clicked(int)), this, |
423 | SLOT(new_slot()), true, i18n("New")); | 423 | SLOT(new_slot()), true, i18n("New")); |
424 | toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar), | 424 | toolBar()->insertButton(picons->loadIcon("fileopen", KIcon::Toolbar), |
425 | BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this, | 425 | BUTTON_TOOL_OPEN, SIGNAL(clicked(int)), this, |
426 | SLOT(open_slot()), true, i18n("Open")); | 426 | SLOT(open_slot()), true, i18n("Open")); |
427 | toolBar()->insertSeparator(); | 427 | toolBar()->insertSeparator(); |
428 | } | 428 | } |
429 | toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar), | 429 | toolBar()->insertButton(picons->loadIcon("filesave", KIcon::Toolbar), |
430 | BUTTON_TOOL_SAVE, SIGNAL(clicked(int)), this, | 430 | BUTTON_TOOL_SAVE, SIGNAL(clicked(int)), this, |
431 | SLOT(save_slot()), true, i18n("Save")); | 431 | SLOT(save_slot()), true, i18n("Save")); |
432 | toolBar()->insertButton(picons->loadIcon("filesaveas", KIcon::Toolbar), | 432 | toolBar()->insertButton(picons->loadIcon("filesaveas", KIcon::Toolbar), |
433 | BUTTON_TOOL_SAVEAS, SIGNAL(clicked(int)), this, | 433 | BUTTON_TOOL_SAVEAS, SIGNAL(clicked(int)), this, |
434 | SLOT(saveAs_slot()), true, i18n("Save as")); | 434 | SLOT(saveAs_slot()), true, i18n("Save as")); |
435 | toolBar()->insertButton(picons->loadIcon("fileprint", KIcon::Toolbar), | 435 | toolBar()->insertButton(picons->loadIcon("fileprint", KIcon::Toolbar), |
436 | BUTTON_TOOL_PRINT, SIGNAL(clicked(int)), this, | 436 | BUTTON_TOOL_PRINT, SIGNAL(clicked(int)), this, |
437 | SLOT(print_slot()), true, i18n("Print...")); | 437 | SLOT(print_slot()), true, i18n("Print...")); |
438 | toolBar()->insertSeparator(); | 438 | toolBar()->insertSeparator(); |
439 | toolBar()->insertButton(picons->loadIcon("pencil", KIcon::Toolbar), | 439 | toolBar()->insertButton(picons->loadIcon("pencil", KIcon::Toolbar), |
440 | BUTTON_TOOL_ADD, SIGNAL(clicked(int)), this, | 440 | BUTTON_TOOL_ADD, SIGNAL(clicked(int)), this, |
441 | SLOT(addPwd_slot()), true, | 441 | SLOT(addPwd_slot()), true, |
442 | i18n("Add password")); | 442 | i18n("Add password")); |
443 | toolBar()->insertButton(picons->loadIcon("edit", KIcon::Toolbar), | 443 | toolBar()->insertButton(picons->loadIcon("edit", KIcon::Toolbar), |
444 | BUTTON_TOOL_EDIT, SIGNAL(clicked(int)), this, | 444 | BUTTON_TOOL_EDIT, SIGNAL(clicked(int)), this, |
445 | SLOT(editPwd_slot()), true, | 445 | SLOT(editPwd_slot()), true, |
446 | i18n("Edit password")); | 446 | i18n("Edit password")); |
447 | toolBar()->insertButton(picons->loadIcon("editdelete", KIcon::Toolbar), | 447 | toolBar()->insertButton(picons->loadIcon("editdelete", KIcon::Toolbar), |
448 | BUTTON_TOOL_DEL, SIGNAL(clicked(int)), this, | 448 | BUTTON_TOOL_DEL, SIGNAL(clicked(int)), this, |
449 | SLOT(deletePwd_slot()), true, | 449 | SLOT(deletePwd_slot()), true, |
450 | i18n("Delete password")); | 450 | i18n("Delete password")); |
451 | toolBar()->insertSeparator(); | 451 | toolBar()->insertSeparator(); |
452 | toolBar()->insertButton(picons->loadIcon("find", KIcon::Toolbar), | 452 | toolBar()->insertButton(picons->loadIcon("find", KIcon::Toolbar), |
453 | BUTTON_TOOL_FIND, SIGNAL(clicked(int)), this, | 453 | BUTTON_TOOL_FIND, SIGNAL(clicked(int)), this, |
454 | SLOT(find_slot()), true, i18n("Find entry")); | 454 | SLOT(find_slot()), true, i18n("Find entry")); |
455 | toolBar()->insertSeparator(); | 455 | toolBar()->insertSeparator(); |
456 | toolBar()->insertButton(picons->loadIcon("halfencrypted", KIcon::Toolbar), | 456 | toolBar()->insertButton(picons->loadIcon("halfencrypted", KIcon::Toolbar), |
457 | BUTTON_TOOL_LOCK, SIGNAL(clicked(int)), this, | 457 | BUTTON_TOOL_LOCK, SIGNAL(clicked(int)), this, |
458 | SLOT(lockWnd_slot()), true, | 458 | SLOT(lockWnd_slot()), true, |
459 | i18n("Lock all entries")); | 459 | i18n("Lock all entries")); |
460 | toolBar()->insertButton(picons->loadIcon("encrypted", KIcon::Toolbar), | 460 | toolBar()->insertButton(picons->loadIcon("encrypted", KIcon::Toolbar), |
461 | BUTTON_TOOL_DEEPLOCK, SIGNAL(clicked(int)), this, | 461 | BUTTON_TOOL_DEEPLOCK, SIGNAL(clicked(int)), this, |
462 | SLOT(deepLockWnd_slot()), true, | 462 | SLOT(deepLockWnd_slot()), true, |
463 | i18n("Deep-Lock all entries")); | 463 | i18n("Deep-Lock all entries")); |
464 | toolBar()->insertButton(picons->loadIcon("decrypted", KIcon::Toolbar), | 464 | toolBar()->insertButton(picons->loadIcon("decrypted", KIcon::Toolbar), |
465 | BUTTON_TOOL_UNLOCK, SIGNAL(clicked(int)), this, | 465 | BUTTON_TOOL_UNLOCK, SIGNAL(clicked(int)), this, |
466 | SLOT(unlockWnd_slot()), true, | 466 | SLOT(unlockWnd_slot()), true, |
467 | i18n("Unlock all entries")); | 467 | i18n("Unlock all entries")); |
468 | } | 468 | } |
469 | 469 | ||
470 | void PwM::initMetrics() | 470 | void PwM::initMetrics() |
471 | { | 471 | { |
472 | QSize s = conf()->confWndMainWndSize(); | 472 | QSize s = conf()->confWndMainWndSize(); |
473 | if (s.isValid()) | 473 | if (s.isValid()) |
474 | resize(s); | 474 | resize(s); |
475 | else | 475 | else |
476 | resize(DEFAULT_SIZE); | 476 | resize(DEFAULT_SIZE); |
477 | } | 477 | } |
478 | 478 | ||
479 | void PwM::updateCaption() | 479 | void PwM::updateCaption() |
480 | { | 480 | { |
481 | setPlainCaption(curDoc()->getTitle() + " - " PROG_NAME " " PACKAGE_VER); | 481 | setPlainCaption(curDoc()->getTitle() + " - " PROG_NAME " " PACKAGE_VER); |
482 | } | 482 | } |
483 | 483 | ||
484 | void PwM::hideEvent(QHideEvent *) | 484 | void PwM::hideEvent(QHideEvent *) |
485 | { | 485 | { |
486 | if (isMinimized()) { | 486 | if (isMinimized()) { |
487 | if (init->tray()) { | 487 | if (init->tray()) { |
488 | forceMinimizeToTray = true; | 488 | forceMinimizeToTray = true; |
489 | close(); | 489 | close(); |
490 | } | 490 | } |
491 | int mmlock = conf()->confGlobMinimizeLock(); | 491 | int mmlock = conf()->confGlobMinimizeLock(); |
492 | switch (mmlock) { | 492 | switch (mmlock) { |
493 | case 0: // don't lock anything | 493 | case 0: // don't lock anything |
494 | break; | 494 | break; |
495 | case 1: {// normal lock | 495 | case 1: {// normal lock |
496 | curDoc()->lockAll(true); | 496 | curDoc()->lockAll(true); |
497 | break; | 497 | break; |
498 | } case 2: {// deep-lock | 498 | } case 2: {// deep-lock |
499 | curDoc()->deepLock(); | 499 | curDoc()->deepLock(); |
500 | break; | 500 | break; |
501 | } default: | 501 | } default: |
502 | WARN(); | 502 | WARN(); |
503 | } | 503 | } |
504 | } | 504 | } |
505 | } | 505 | } |
506 | 506 | ||
507 | void PwM::setVirgin(bool v) | 507 | void PwM::setVirgin(bool v) |
508 | { | 508 | { |
509 | if (virgin == v) | 509 | if (virgin == v) |
510 | return; | 510 | return; |
511 | virgin = v; | 511 | virgin = v; |
512 | filePopup->setItemEnabled(BUTTON_POPUP_FILE_SAVE, !v); | 512 | filePopup->setItemEnabled(BUTTON_POPUP_FILE_SAVE, !v); |
513 | filePopup->setItemEnabled(BUTTON_POPUP_FILE_SAVEAS, !v); | 513 | filePopup->setItemEnabled(BUTTON_POPUP_FILE_SAVEAS, !v); |
514 | filePopup->setItemEnabled(BUTTON_POPUP_FILE_EXPORT, !v); | 514 | filePopup->setItemEnabled(BUTTON_POPUP_FILE_EXPORT, !v); |
515 | filePopup->setItemEnabled(BUTTON_POPUP_FILE_PRINT, !v); | 515 | filePopup->setItemEnabled(BUTTON_POPUP_FILE_PRINT, !v); |
516 | managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_EDIT, !v); | 516 | managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_EDIT, !v); |
517 | managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_DEL, !v); | 517 | managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_DEL, !v); |
518 | managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, !v); | 518 | managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, !v); |
519 | viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_LOCK, !v); | 519 | viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_LOCK, !v); |
520 | viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_DEEPLOCK, !v); | 520 | viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_DEEPLOCK, !v); |
521 | viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_UNLOCK, !v); | 521 | viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_UNLOCK, !v); |
522 | viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_FIND, !v); | 522 | viewPopup->setItemEnabled(BUTTON_POPUP_VIEW_FIND, !v); |
523 | toolBar()->setItemEnabled(BUTTON_TOOL_SAVE, !v); | 523 | toolBar()->setItemEnabled(BUTTON_TOOL_SAVE, !v); |
524 | toolBar()->setItemEnabled(BUTTON_TOOL_SAVEAS, !v); | 524 | toolBar()->setItemEnabled(BUTTON_TOOL_SAVEAS, !v); |
525 | toolBar()->setItemEnabled(BUTTON_TOOL_PRINT, !v); | 525 | toolBar()->setItemEnabled(BUTTON_TOOL_PRINT, !v); |
526 | toolBar()->setItemEnabled(BUTTON_TOOL_EDIT, !v); | 526 | toolBar()->setItemEnabled(BUTTON_TOOL_EDIT, !v); |
527 | toolBar()->setItemEnabled(BUTTON_TOOL_DEL, !v); | 527 | toolBar()->setItemEnabled(BUTTON_TOOL_DEL, !v); |
528 | toolBar()->setItemEnabled(BUTTON_TOOL_LOCK, !v); | 528 | toolBar()->setItemEnabled(BUTTON_TOOL_LOCK, !v); |
529 | toolBar()->setItemEnabled(BUTTON_TOOL_DEEPLOCK, !v); | 529 | toolBar()->setItemEnabled(BUTTON_TOOL_DEEPLOCK, !v); |
530 | toolBar()->setItemEnabled(BUTTON_TOOL_UNLOCK, !v); | 530 | toolBar()->setItemEnabled(BUTTON_TOOL_UNLOCK, !v); |
531 | toolBar()->setItemEnabled(BUTTON_TOOL_FIND, !v); | 531 | toolBar()->setItemEnabled(BUTTON_TOOL_FIND, !v); |
532 | } | 532 | } |
533 | 533 | ||
534 | void PwM::new_slot() | 534 | void PwM::new_slot() |
535 | { | 535 | { |
536 | init->createMainWnd(); | 536 | init->createMainWnd(); |
537 | } | 537 | } |
538 | 538 | ||
539 | //US ENH | 539 | //US ENH |
540 | void PwM::open_slot() | 540 | void PwM::open_slot() |
541 | { | 541 | { |
542 | open_slot(""); | 542 | open_slot(""); |
543 | } | 543 | } |
544 | 544 | ||
545 | void PwM::open_slot(QString fn) | 545 | void PwM::open_slot(QString fn) |
546 | { | 546 | { |
547 | openDoc(fn); | 547 | openDoc(fn); |
548 | } | 548 | } |
549 | 549 | ||
550 | PwMDoc * PwM::openDoc(QString filename, bool openDeepLocked) | 550 | PwMDoc * PwM::openDoc(QString filename, bool openDeepLocked) |
551 | { | 551 | { |
552 | if (!isVirgin()) { | 552 | if (!isVirgin()) { |
553 | // open the document in a new window. | 553 | // open the document in a new window. |
554 | PwM *newInstance = init->createMainWnd(); | 554 | PwM *newInstance = init->createMainWnd(); |
555 | PwMDoc *newDoc = newInstance->openDoc(filename, openDeepLocked); | 555 | PwMDoc *newDoc = newInstance->openDoc(filename, openDeepLocked); |
556 | if (!newDoc) { | 556 | if (!newDoc) { |
557 | newInstance->setForceQuit(true); | 557 | newInstance->setForceQuit(true); |
558 | delete_and_null(newInstance); | 558 | delete_and_null(newInstance); |
559 | } | 559 | } |
560 | return newDoc; | 560 | return newDoc; |
561 | } | 561 | } |
562 | 562 | ||
563 | if (!curDoc()->openDocUi(curDoc(), filename, openDeepLocked)) | 563 | if (!curDoc()->openDocUi(curDoc(), filename, openDeepLocked)) |
564 | return 0; | 564 | return 0; |
565 | showStatMsg(i18n("Successfully opened file.")); | 565 | showStatMsg(i18n("Successfully opened file.")); |
566 | updateCaption(); | 566 | updateCaption(); |
567 | setVirgin(false); | 567 | setVirgin(false); |
568 | return curDoc(); | 568 | return curDoc(); |
569 | } | 569 | } |
570 | 570 | ||
571 | PwMView * PwM::makeNewListView(PwMDoc *doc) | 571 | PwMView * PwM::makeNewListView(PwMDoc *doc) |
572 | { | 572 | { |
573 | PwMView *ret = new PwMView(this, this, doc); | 573 | PwMView *ret = new PwMView(this, this, doc); |
574 | ret->setFont(conf()->confGlobEntryFont()); | 574 | ret->setFont(conf()->confGlobEntryFont()); |
575 | ret->show(); | 575 | ret->show(); |
576 | return ret; | 576 | return ret; |
577 | } | 577 | } |
578 | 578 | ||
579 | void PwM::close_slot() | 579 | void PwM::close_slot() |
580 | { | 580 | { |
581 | close(); | 581 | close(); |
582 | } | 582 | } |
583 | 583 | ||
584 | void PwM::quitButton_slot() | 584 | void PwM::quitButton_slot() |
585 | { | 585 | { |
586 | init->shutdownApp(0); | 586 | init->shutdownApp(0); |
587 | } | 587 | } |
588 | 588 | ||
589 | void PwM::save_slot() | 589 | void PwM::save_slot() |
590 | { | 590 | { |
591 | save(); | 591 | save(); |
592 | } | 592 | } |
593 | 593 | ||
594 | bool PwM::save() | 594 | bool PwM::save() |
595 | { | 595 | { |
596 | if (!curDoc()->saveDocUi(curDoc())) | 596 | if (!curDoc()->saveDocUi(curDoc())) |
597 | return false; | 597 | return false; |
598 | showStatMsg(i18n("Successfully saved data.")); | 598 | showStatMsg(i18n("Successfully saved data.")); |
599 | updateCaption(); | 599 | updateCaption(); |
600 | return true; | 600 | return true; |
601 | } | 601 | } |
602 | 602 | ||
603 | void PwM::saveAs_slot() | 603 | void PwM::saveAs_slot() |
604 | { | 604 | { |
605 | saveAs(); | 605 | saveAs(); |
606 | } | 606 | } |
607 | 607 | ||
608 | bool PwM::saveAs() | 608 | bool PwM::saveAs() |
609 | { | 609 | { |
610 | if (!curDoc()->saveAsDocUi(curDoc())) | 610 | if (!curDoc()->saveAsDocUi(curDoc())) |
611 | return false; | 611 | return false; |
612 | showStatMsg(i18n("Successfully saved data.")); | 612 | showStatMsg(i18n("Successfully saved data.")); |
613 | updateCaption(); | 613 | updateCaption(); |
614 | return true; | 614 | return true; |
615 | } | 615 | } |
616 | 616 | ||
617 | //US ENH : changed code to run with older MOC | 617 | //US ENH : changed code to run with older MOC |
618 | void PwM::addPwd_slot() | 618 | void PwM::addPwd_slot() |
619 | { | 619 | { |
620 | addPwd_slot1(0, 0); | 620 | addPwd_slot1(0, 0); |
621 | } | 621 | } |
622 | 622 | ||
623 | void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc) | 623 | void PwM::addPwd_slot1(QString *pw, PwMDoc *_doc) |
624 | { | 624 | { |
625 | PwMDoc *doc; | 625 | PwMDoc *doc; |
626 | if (_doc) { | 626 | if (_doc) { |
627 | doc = _doc; | 627 | doc = _doc; |
628 | } else { | 628 | } else { |
629 | doc = curDoc(); | 629 | doc = curDoc(); |
630 | } | 630 | } |
631 | PWM_ASSERT(doc); | 631 | PWM_ASSERT(doc); |
632 | doc->timer()->getLock(DocTimer::id_autoLockTimer); | 632 | doc->timer()->getLock(DocTimer::id_autoLockTimer); |
633 | #ifndef PWM_EMBEDDED | 633 | #ifndef PWM_EMBEDDED |
634 | AddEntryWndImpl w; | 634 | AddEntryWndImpl w; |
635 | #else | 635 | #else |
636 | AddEntryWndImpl w(doc, this, "addentrywndimpl"); | 636 | AddEntryWndImpl w(doc, this, "addentrywndimpl"); |
637 | #endif | 637 | #endif |
638 | 638 | ||
639 | vector<string> catList; | 639 | vector<string> catList; |
640 | doc->getCategoryList(&catList); | 640 | doc->getCategoryList(&catList); |
641 | unsigned i, size = catList.size(); | 641 | unsigned i, size = catList.size(); |
642 | for (i = 0; i < size; ++i) { | 642 | for (i = 0; i < size; ++i) { |
643 | w.addCategory(catList[i].c_str()); | 643 | w.addCategory(catList[i].c_str()); |
644 | } | 644 | } |
645 | w.setCurrCategory(view->getCurrentCategory()); | 645 | w.setCurrCategory(view->getCurrentCategory()); |
646 | if (pw) | 646 | if (pw) |
647 | w.pwLineEdit->setText(*pw); | 647 | w.pwLineEdit->setText(*pw); |
648 | 648 | ||
649 | tryAgain: | 649 | tryAgain: |
650 | if (w.exec() == 1) | 650 | if (w.exec() == 1) |
651 | { | 651 | { |
652 | PwMDataItem d; | 652 | PwMDataItem d; |
653 | 653 | ||
654 | //US BUG: to initialize all values of curEntr with meaningfulldata, | 654 | //US BUG: to initialize all values of curEntr with meaningfulldata, |
655 | // we call clear on it. Reason: Metadata will be uninitialized otherwise. | 655 | // we call clear on it. Reason: Metadata will be uninitialized otherwise. |
656 | // another option would be to create a constructor for PwMDataItem | 656 | // another option would be to create a constructor for PwMDataItem |
657 | d.clear(true); | 657 | d.clear(true); |
658 | 658 | ||
659 | d.desc = w.getDescription().latin1(); | 659 | d.desc = w.getDescription().latin1(); |
660 | d.name = w.getUsername().latin1(); | 660 | d.name = w.getUsername().latin1(); |
661 | d.pw = w.getPassword().latin1(); | 661 | d.pw = w.getPassword().latin1(); |
662 | d.comment = w.getComment().latin1(); | 662 | d.comment = w.getComment().latin1(); |
663 | d.url = w.getUrl().latin1(); | 663 | d.url = w.getUrl().latin1(); |
664 | d.launcher = w.getLauncher().latin1(); | 664 | d.launcher = w.getLauncher().latin1(); |
665 | PwMerror ret = doc->addEntry(w.getCategory(), &d); | 665 | PwMerror ret = doc->addEntry(w.getCategory(), &d); |
666 | if (ret == e_entryExists) { | 666 | if (ret == e_entryExists) { |
667 | KMessageBox::error(this, | 667 | KMessageBox::error(this, |
668 | i18n | 668 | i18n |
669 | ("An entry with this \"Description\",\n" | 669 | ("An entry with this \"Description\",\n" |
670 | "does already exist.\n" | 670 | "does already exist.\n" |
671 | "Please select another description."), | 671 | "Please select another description."), |
672 | i18n("entry already exists.")); | 672 | i18n("entry already exists.")); |
673 | goto tryAgain; | 673 | goto tryAgain; |
674 | } else if (ret == e_maxAllowedEntr) { | 674 | } else if (ret == e_maxAllowedEntr) { |
675 | KMessageBox::error(this, i18n("The maximum possible number of\nentries" | 675 | KMessageBox::error(this, i18n("The maximum possible number of\nentries" |
676 | "has been reached.\nYou can't add more entries."), | 676 | "has been reached.\nYou can't add more entries."), |
677 | i18n("maximum number of entries")); | 677 | i18n("maximum number of entries")); |
678 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 678 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
679 | return; | 679 | return; |
680 | } | 680 | } |
681 | } | 681 | } |
682 | setVirgin(false); | 682 | setVirgin(false); |
683 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 683 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
684 | } | 684 | } |
685 | 685 | ||
686 | //US ENH : changed code to run with older MOC | 686 | //US ENH : changed code to run with older MOC |
687 | void PwM::editPwd_slot() | 687 | void PwM::editPwd_slot() |
688 | { | 688 | { |
689 | editPwd_slot3(0,0,0); | 689 | editPwd_slot3(0,0,0); |
690 | } | 690 | } |
691 | 691 | ||
692 | void PwM::editPwd_slot1(const QString *category) | 692 | void PwM::editPwd_slot1(const QString *category) |
693 | { | 693 | { |
694 | editPwd_slot3(category, 0, 0); | 694 | editPwd_slot3(category, 0, 0); |
695 | } | 695 | } |
696 | 696 | ||
697 | void PwM::editPwd_slot3(const QString *category, const int *index, | 697 | void PwM::editPwd_slot3(const QString *category, const int *index, |
698 | PwMDoc *_doc) | 698 | PwMDoc *_doc) |
699 | { | 699 | { |
700 | PwMDoc *doc; | 700 | PwMDoc *doc; |
701 | if (_doc) { | 701 | if (_doc) { |
702 | doc = _doc; | 702 | doc = _doc; |
703 | } else { | 703 | } else { |
704 | doc = curDoc(); | 704 | doc = curDoc(); |
705 | } | 705 | } |
706 | PWM_ASSERT(doc); | 706 | PWM_ASSERT(doc); |
707 | if (doc->isDocEmpty()) | 707 | if (doc->isDocEmpty()) |
708 | return; | 708 | return; |
709 | if (doc->isDeepLocked()) | 709 | if (doc->isDeepLocked()) |
710 | return; | 710 | return; |
711 | doc->timer()->getLock(DocTimer::id_autoLockTimer); | 711 | doc->timer()->getLock(DocTimer::id_autoLockTimer); |
712 | unsigned int curEntryIndex; | 712 | unsigned int curEntryIndex; |
713 | if (index) { | 713 | if (index) { |
714 | curEntryIndex = *index; | 714 | curEntryIndex = *index; |
715 | } else { | 715 | } else { |
716 | if (!(view->getCurEntryIndex(&curEntryIndex))) { | 716 | if (!(view->getCurEntryIndex(&curEntryIndex))) { |
717 | printDebug("couldn't get index. Maybe we have a binary entry here."); | 717 | printDebug("couldn't get index. Maybe we have a binary entry here."); |
718 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 718 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
719 | return; | 719 | return; |
720 | } | 720 | } |
721 | } | 721 | } |
722 | QString curCategory; | 722 | QString curCategory; |
723 | if (category) { | 723 | if (category) { |
724 | curCategory = *category; | 724 | curCategory = *category; |
725 | } else { | 725 | } else { |
726 | curCategory = view->getCurrentCategory(); | 726 | curCategory = view->getCurrentCategory(); |
727 | } | 727 | } |
728 | PwMDataItem currItem; | 728 | PwMDataItem currItem; |
729 | if (!doc->getEntry(curCategory, curEntryIndex, &currItem, true)) { | 729 | if (!doc->getEntry(curCategory, curEntryIndex, &currItem, true)) { |
730 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 730 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
731 | return; | 731 | return; |
732 | } | 732 | } |
733 | BUG_ON(currItem.binary); | 733 | BUG_ON(currItem.binary); |
734 | 734 | ||
735 | AddEntryWndImpl w(doc); | 735 | AddEntryWndImpl w(doc); |
736 | vector<string> catList; | 736 | vector<string> catList; |
737 | doc->getCategoryList(&catList); | 737 | doc->getCategoryList(&catList); |
738 | unsigned i, size = catList.size(); | 738 | unsigned i, size = catList.size(); |
739 | for (i = 0; i < size; ++i) { | 739 | for (i = 0; i < size; ++i) { |
740 | w.addCategory(catList[i].c_str()); | 740 | w.addCategory(catList[i].c_str()); |
741 | } | 741 | } |
742 | w.setCurrCategory(curCategory); | 742 | w.setCurrCategory(curCategory); |
743 | w.setDescription(currItem.desc.c_str()); | 743 | w.setDescription(currItem.desc.c_str()); |
744 | w.setUsername(currItem.name.c_str()); | 744 | w.setUsername(currItem.name.c_str()); |
745 | w.setPassword(currItem.pw.c_str()); | 745 | w.setPassword(currItem.pw.c_str()); |
746 | w.setUrl(currItem.url.c_str()); | 746 | w.setUrl(currItem.url.c_str()); |
747 | w.setLauncher(currItem.launcher.c_str()); | 747 | w.setLauncher(currItem.launcher.c_str()); |
748 | w.setComment(currItem.comment.c_str()); | 748 | w.setComment(currItem.comment.c_str()); |
749 | if (w.exec() == 1) { | 749 | if (w.exec() == 1) { |
750 | currItem.desc = w.getDescription().latin1(); | 750 | currItem.desc = w.getDescription().latin1(); |
751 | currItem.name = w.getUsername().latin1(); | 751 | currItem.name = w.getUsername().latin1(); |
752 | currItem.pw = w.getPassword().latin1(); | 752 | currItem.pw = w.getPassword().latin1(); |
753 | currItem.comment = w.getComment().latin1(); | 753 | currItem.comment = w.getComment().latin1(); |
754 | currItem.url = w.getUrl().latin1(); | 754 | currItem.url = w.getUrl().latin1(); |
755 | currItem.launcher = w.getLauncher().latin1(); | 755 | currItem.launcher = w.getLauncher().latin1(); |
756 | if (!doc->editEntry(curCategory, w.getCategory(), | 756 | if (!doc->editEntry(curCategory, w.getCategory(), |
757 | curEntryIndex, &currItem)) { | 757 | curEntryIndex, &currItem)) { |
758 | KMessageBox::error(this, | 758 | KMessageBox::error(this, |
759 | i18n("Couldn't edit the entry.\n" | 759 | i18n("Couldn't edit the entry.\n" |
760 | "Maybe you changed the category and\n" | 760 | "Maybe you changed the category and\n" |
761 | "this entry is already present\nin the new " | 761 | "this entry is already present\nin the new " |
762 | "category?"), | 762 | "category?"), |
763 | i18n("couldn't edit entry.")); | 763 | i18n("couldn't edit entry.")); |
764 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 764 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
765 | return; | 765 | return; |
766 | } | 766 | } |
767 | } | 767 | } |
768 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 768 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
769 | } | 769 | } |
770 | 770 | ||
771 | void PwM::deletePwd_slot() | 771 | void PwM::deletePwd_slot() |
772 | { | 772 | { |
773 | PWM_ASSERT(curDoc()); | 773 | PWM_ASSERT(curDoc()); |
774 | if (curDoc()->isDocEmpty()) | 774 | if (curDoc()->isDocEmpty()) |
775 | return; | 775 | return; |
776 | if (curDoc()->isDeepLocked()) | 776 | if (curDoc()->isDeepLocked()) |
777 | return; | 777 | return; |
778 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 778 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
779 | unsigned int curEntryIndex = 0; | 779 | unsigned int curEntryIndex = 0; |
780 | if (!(view->getCurEntryIndex(&curEntryIndex))) { | 780 | if (!(view->getCurEntryIndex(&curEntryIndex))) { |
781 | printDebug("couldn't get index"); | 781 | printDebug("couldn't get index"); |
782 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 782 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
783 | return; | 783 | return; |
784 | } | 784 | } |
785 | 785 | ||
786 | PwMDataItem currItem; | 786 | PwMDataItem currItem; |
787 | QString curCategory = view->getCurrentCategory(); | 787 | QString curCategory = view->getCurrentCategory(); |
788 | if (!curDoc()->getEntry(curCategory, curEntryIndex, &currItem)) { | 788 | if (!curDoc()->getEntry(curCategory, curEntryIndex, &currItem)) { |
789 | printDebug("couldn't get entry"); | 789 | printDebug("couldn't get entry"); |
790 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 790 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
791 | return; | 791 | return; |
792 | } | 792 | } |
793 | if (KMessageBox:: | 793 | if (KMessageBox:: |
794 | questionYesNo(this, | 794 | questionYesNo(this, |
795 | i18n | 795 | i18n |
796 | ("Do you really want to delete\nthe selected entry") + | 796 | ("Do you really want to delete\nthe selected entry") + |
797 | " \n\"" + QString(currItem.desc.c_str()) | 797 | " \n\"" + QString(currItem.desc.c_str()) |
798 | + "\" ?", i18n("delete?")) | 798 | + "\" ?", i18n("delete?")) |
799 | == KMessageBox::Yes) { | 799 | == KMessageBox::Yes) { |
800 | 800 | ||
801 | curDoc()->delEntry(curCategory, curEntryIndex); | 801 | curDoc()->delEntry(curCategory, curEntryIndex); |
802 | } | 802 | } |
803 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 803 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
804 | } | 804 | } |
805 | 805 | ||
806 | void PwM::changeMasterPwd_slot() | 806 | void PwM::changeMasterPwd_slot() |
807 | { | 807 | { |
808 | PWM_ASSERT(curDoc()); | 808 | PWM_ASSERT(curDoc()); |
809 | curDoc()->changeCurrentPw(); | 809 | curDoc()->changeCurrentPw(); |
810 | } | 810 | } |
811 | 811 | ||
812 | void PwM::lockWnd_slot() | 812 | void PwM::lockWnd_slot() |
813 | { | 813 | { |
814 | PWM_ASSERT(curDoc()); | 814 | PWM_ASSERT(curDoc()); |
815 | curDoc()->lockAll(true); | 815 | curDoc()->lockAll(true); |
816 | } | 816 | } |
817 | 817 | ||
818 | void PwM::deepLockWnd_slot() | 818 | void PwM::deepLockWnd_slot() |
819 | { | 819 | { |
820 | PWM_ASSERT(curDoc()); | 820 | PWM_ASSERT(curDoc()); |
821 | curDoc()->deepLock(); | 821 | curDoc()->deepLock(); |
822 | } | 822 | } |
823 | 823 | ||
824 | void PwM::unlockWnd_slot() | 824 | void PwM::unlockWnd_slot() |
825 | { | 825 | { |
826 | PWM_ASSERT(curDoc()); | 826 | PWM_ASSERT(curDoc()); |
827 | curDoc()->lockAll(false); | 827 | curDoc()->lockAll(false); |
828 | } | 828 | } |
829 | 829 | ||
830 | void PwM::config_slot() | 830 | void PwM::config_slot() |
831 | { | 831 | { |
832 | int oldStyle = conf()->confWndMainViewStyle(); | 832 | int oldStyle = conf()->confWndMainViewStyle(); |
833 | #ifdef PWM_EMBEDDED | 833 | #ifdef PWM_EMBEDDED |
834 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"pwmconfigdialog", true ); | 834 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"pwmconfigdialog", true ); |
835 | 835 | ||
836 | KCMPwmConfig* pwmcfg = new KCMPwmConfig( ConfigureDialog->getNewVBoxPage(i18n( "PwManager")) , "KCMPwmConfig" ); | 836 | KCMPwmConfig* pwmcfg = new KCMPwmConfig( ConfigureDialog->getNewVBoxPage(i18n( "PwManager")) , "KCMPwmConfig" ); |
837 | ConfigureDialog->addModule(pwmcfg ); | 837 | ConfigureDialog->addModule(pwmcfg ); |
838 | 838 | ||
839 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); | 839 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); |
840 | ConfigureDialog->addModule(kdelibcfg ); | 840 | ConfigureDialog->addModule(kdelibcfg ); |
841 | 841 | ||
842 | #ifndef DESKTOP_VERSION | 842 | #ifndef DESKTOP_VERSION |
843 | ConfigureDialog->showMaximized(); | 843 | ConfigureDialog->showMaximized(); |
844 | #endif | 844 | #endif |
845 | if ( ConfigureDialog->exec() ) | 845 | if ( ConfigureDialog->exec() ) |
846 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); | 846 | KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); |
847 | delete ConfigureDialog; | 847 | delete ConfigureDialog; |
848 | 848 | ||
849 | #else //PWM_EMBEDDED | 849 | #else //PWM_EMBEDDED |
850 | // display the configuration window (modal mode) | 850 | // display the configuration window (modal mode) |
851 | if (!conf()->showConfWnd(this)) | 851 | if (!conf()->showConfWnd(this)) |
852 | return; | 852 | return; |
853 | #endif | 853 | #endif |
854 | 854 | ||
855 | int newStyle = conf()->confWndMainViewStyle(); | 855 | int newStyle = conf()->confWndMainViewStyle(); |
856 | // reinitialize tray | 856 | // reinitialize tray |
857 | init->initTray(); | 857 | init->initTray(); |
858 | // reinitialize KWallet emulation | 858 | // reinitialize KWallet emulation |
859 | init->initKWalletEmu(); | 859 | init->initKWalletEmu(); |
860 | 860 | ||
861 | PwMDocList *_dl = PwMDoc::getOpenDocList(); | 861 | PwMDocList *_dl = PwMDoc::getOpenDocList(); |
862 | const vector<PwMDocList::listItem> *dl = _dl->getList(); | 862 | const vector<PwMDocList::listItem> *dl = _dl->getList(); |
863 | vector<PwMDocList::listItem>::const_iterator i = dl->begin(), | 863 | vector<PwMDocList::listItem>::const_iterator i = dl->begin(), |
864 | end = dl->end(); | 864 | end = dl->end(); |
865 | PwMDoc *doc; | 865 | PwMDoc *doc; |
866 | while (i != end) { | 866 | while (i != end) { |
867 | doc = (*i).doc; | 867 | doc = (*i).doc; |
868 | // unlock-without-mpw timeout | 868 | // unlock-without-mpw timeout |
869 | doc->timer()->start(DocTimer::id_mpwTimer); | 869 | doc->timer()->start(DocTimer::id_mpwTimer); |
870 | // auto-lock timeout | 870 | // auto-lock timeout |
871 | doc->timer()->start(DocTimer::id_autoLockTimer); | 871 | doc->timer()->start(DocTimer::id_autoLockTimer); |
872 | ++i; | 872 | ++i; |
873 | } | 873 | } |
874 | 874 | ||
875 | const QValueList<PwM *> *ml = init->mainWndList(); | 875 | const QValueList<PwM *> *ml = init->mainWndList(); |
876 | #ifndef PWM_EMBEDDED | 876 | #ifndef PWM_EMBEDDED |
877 | QValueList<PwM *>::const_iterator i2 = ml->begin(), | 877 | QValueList<PwM *>::const_iterator i2 = ml->begin(), |
878 | end2 = ml->end(); | 878 | end2 = ml->end(); |
879 | #else | 879 | #else |
880 | QValueList<PwM *>::ConstIterator i2 = ml->begin(), | 880 | QValueList<PwM *>::ConstIterator i2 = ml->begin(), |
881 | end2 = ml->end(); | 881 | end2 = ml->end(); |
882 | #endif | 882 | #endif |
883 | PwM *pwm; | 883 | PwM *pwm; |
884 | while (i2 != end2) { | 884 | while (i2 != end2) { |
885 | pwm = *i2; | 885 | pwm = *i2; |
886 | // reinitialize the window style. | 886 | // reinitialize the window style. |
887 | if (oldStyle != newStyle) | 887 | if (oldStyle != newStyle) |
888 | pwm->curView()->initStyle(newStyle); | 888 | pwm->curView()->initStyle(newStyle); |
889 | // set the new font | 889 | // set the new font |
890 | pwm->curView()->setFont(conf()->confGlobEntryFont()); | 890 | pwm->curView()->setFont(conf()->confGlobEntryFont()); |
891 | ++i2; | 891 | ++i2; |
892 | } | 892 | } |
893 | } | 893 | } |
894 | 894 | ||
895 | void PwM::activateMpButton(bool activate) | 895 | void PwM::activateMpButton(bool activate) |
896 | { | 896 | { |
897 | managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, activate); | 897 | managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, activate); |
898 | } | 898 | } |
899 | 899 | ||
900 | void PwM::closeEvent(QCloseEvent *e) | 900 | void PwM::closeEvent(QCloseEvent *e) |
901 | { | 901 | { |
902 | qDebug("PwM::closeEvent "); | 902 | //qDebug("PwM::closeEvent "); |
903 | emit closed( this ); | 903 | emit closed( this ); |
904 | return; | 904 | return; |
905 | e->accept(); | 905 | e->accept(); |
906 | } | 906 | } |
907 | 907 | ||
908 | void PwM::docClosed(PwMDoc *doc) | 908 | void PwM::docClosed(PwMDoc *doc) |
909 | { | 909 | { |
910 | qDebug("PwM::docClosed "); | 910 | //qDebug("PwM::docClosed "); |
911 | PARAM_UNUSED(doc); | 911 | PARAM_UNUSED(doc); |
912 | PWM_ASSERT(doc == curDoc()); | 912 | PWM_ASSERT(doc == curDoc()); |
913 | close(); | 913 | close(); |
914 | } | 914 | } |
915 | 915 | ||
916 | void PwM::find_slot() | 916 | void PwM::find_slot() |
917 | { | 917 | { |
918 | PWM_ASSERT(curDoc()); | 918 | PWM_ASSERT(curDoc()); |
919 | if (curDoc()->isDocEmpty()) | 919 | if (curDoc()->isDocEmpty()) |
920 | return; | 920 | return; |
921 | if (curDoc()->isDeepLocked()) | 921 | if (curDoc()->isDeepLocked()) |
922 | return; | 922 | return; |
923 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 923 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
924 | FindWndImpl findWnd(view); | 924 | FindWndImpl findWnd(view); |
925 | findWnd.exec(); | 925 | findWnd.exec(); |
926 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 926 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
927 | } | 927 | } |
928 | 928 | ||
929 | void PwM::exportToText() | 929 | void PwM::exportToText() |
930 | { | 930 | { |
931 | PWM_ASSERT(curDoc()); | 931 | PWM_ASSERT(curDoc()); |
932 | if (curDoc()->isDocEmpty()) { | 932 | if (curDoc()->isDocEmpty()) { |
933 | KMessageBox::information(this, | 933 | KMessageBox::information(this, |
934 | i18n | 934 | i18n |
935 | ("Sorry, there's nothing to export.\n" | 935 | ("Sorry, there's nothing to export.\n" |
936 | "Please first add some passwords."), | 936 | "Please first add some passwords."), |
937 | i18n("nothing to do")); | 937 | i18n("nothing to do")); |
938 | return; | 938 | return; |
939 | } | 939 | } |
940 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 940 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
941 | QString fn(KFileDialog::getSaveFileName(QString::null, | 941 | QString fn(KFileDialog::getSaveFileName(QString::null, |
942 | i18n("*|plain-text file"), | 942 | i18n("*|plain-text file"), |
943 | this)); | 943 | this)); |
944 | if (fn == "") { | 944 | if (fn == "") { |
945 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 945 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
946 | return; | 946 | return; |
947 | } | 947 | } |
948 | 948 | ||
949 | PwMerror ret = curDoc()->exportToText(&fn); | 949 | PwMerror ret = curDoc()->exportToText(&fn); |
950 | if (ret != e_success) { | 950 | if (ret != e_success) { |
951 | KMessageBox::error(this, | 951 | KMessageBox::error(this, |
952 | i18n("Error: Couldn't write to file.\n" | 952 | i18n("Error: Couldn't write to file.\n" |
953 | "Please check if you have permission to write\n" | 953 | "Please check if you have permission to write\n" |
954 | "to the file in that directory."), | 954 | "to the file in that directory."), |
955 | i18n("error while writing")); | 955 | i18n("error while writing")); |
956 | } else | 956 | } else |
957 | showStatMsg(i18n("Successfully exported data.")); | 957 | showStatMsg(i18n("Successfully exported data.")); |
958 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 958 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
959 | } | 959 | } |
960 | 960 | ||
961 | bool PwM::importFromText() | 961 | bool PwM::importFromText() |
962 | { | 962 | { |
963 | if (!isVirgin()) { | 963 | if (!isVirgin()) { |
964 | if (KMessageBox::questionYesNo(this, | 964 | if (KMessageBox::questionYesNo(this, |
965 | i18n("Do you want to import the data\n" | 965 | i18n("Do you want to import the data\n" |
966 | "into the current document? (If you\n" | 966 | "into the current document? (If you\n" |
967 | "select \"no\", a new document will be\n" | 967 | "select \"no\", a new document will be\n" |
968 | "opened.)"), | 968 | "opened.)"), |
969 | i18n("import into this document?")) | 969 | i18n("import into this document?")) |
970 | == KMessageBox::No) { | 970 | == KMessageBox::No) { |
971 | // import the data to a new window. | 971 | // import the data to a new window. |
972 | PwM *newInstance = init->createMainWnd(); | 972 | PwM *newInstance = init->createMainWnd(); |
973 | bool ok = newInstance->importFromText(); | 973 | bool ok = newInstance->importFromText(); |
974 | if (!ok) { | 974 | if (!ok) { |
975 | newInstance->setForceQuit(true); | 975 | newInstance->setForceQuit(true); |
976 | delete_and_null(newInstance); | 976 | delete_and_null(newInstance); |
977 | } | 977 | } |
978 | return ok; | 978 | return ok; |
979 | } | 979 | } |
980 | } | 980 | } |
981 | 981 | ||
982 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 982 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
983 | PwMerror ret; | 983 | PwMerror ret; |
984 | QString path(KFileDialog::getOpenFileName(QString::null, | 984 | QString path(KFileDialog::getOpenFileName(QString::null, |
985 | i18n("*|PWM-exported text file"), | 985 | i18n("*|PWM-exported text file"), |
986 | this)); | 986 | this)); |
987 | if (path == "") | 987 | if (path == "") |
988 | goto cancelImport; | 988 | goto cancelImport; |
989 | 989 | ||
990 | ret = curDoc()->importFromText(&path, 0); | 990 | ret = curDoc()->importFromText(&path, 0); |
991 | if (ret == e_fileFormat) { | 991 | if (ret == e_fileFormat) { |
992 | KMessageBox::error(this, | 992 | KMessageBox::error(this, |
993 | i18n("Could not read file-format.\n" | 993 | i18n("Could not read file-format.\n" |
994 | "This seems to be _not_ a valid file\n" | 994 | "This seems to be _not_ a valid file\n" |
995 | "exported by PwM."), | 995 | "exported by PwM."), |
996 | i18n("invalid file-format")); | 996 | i18n("invalid file-format")); |
997 | goto cancelImport; | 997 | goto cancelImport; |
998 | } else if (ret == e_invalidArg) { | 998 | } else if (ret == e_invalidArg) { |
999 | BUG(); | 999 | BUG(); |
1000 | goto cancelImport; | 1000 | goto cancelImport; |
1001 | } else if (ret != e_success) { | 1001 | } else if (ret != e_success) { |
1002 | KMessageBox::error(this, | 1002 | KMessageBox::error(this, |
1003 | i18n("Could not import file!\n" | 1003 | i18n("Could not import file!\n" |
1004 | "Do you have permission to read this file?\n" | 1004 | "Do you have permission to read this file?\n" |
1005 | "Do you have enough free memory?"), | 1005 | "Do you have enough free memory?"), |
1006 | i18n("import failed")); | 1006 | i18n("import failed")); |
1007 | goto cancelImport; | 1007 | goto cancelImport; |
1008 | } | 1008 | } |
1009 | setVirgin(false); | 1009 | setVirgin(false); |
1010 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1010 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1011 | return true; | 1011 | return true; |
1012 | 1012 | ||
1013 | cancelImport: | 1013 | cancelImport: |
1014 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1014 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1015 | return false; | 1015 | return false; |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | void PwM::exportToGpasman() | 1018 | void PwM::exportToGpasman() |
1019 | { | 1019 | { |
1020 | PWM_ASSERT(curDoc()); | 1020 | PWM_ASSERT(curDoc()); |
1021 | if (curDoc()->isDocEmpty()) { | 1021 | if (curDoc()->isDocEmpty()) { |
1022 | KMessageBox::information(this, | 1022 | KMessageBox::information(this, |
1023 | i18n | 1023 | i18n |
1024 | ("Sorry, there's nothing to export.\n" | 1024 | ("Sorry, there's nothing to export.\n" |
1025 | "Please first add some passwords."), | 1025 | "Please first add some passwords."), |
1026 | i18n("nothing to do")); | 1026 | i18n("nothing to do")); |
1027 | return; | 1027 | return; |
1028 | } | 1028 | } |
1029 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 1029 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
1030 | QString fn(KFileDialog::getSaveFileName(QString::null, | 1030 | QString fn(KFileDialog::getSaveFileName(QString::null, |
1031 | i18n("*|Gpasman or Kpasman file"), | 1031 | i18n("*|Gpasman or Kpasman file"), |
1032 | this)); | 1032 | this)); |
1033 | if (fn == "") { | 1033 | if (fn == "") { |
1034 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1034 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1035 | return; | 1035 | return; |
1036 | } | 1036 | } |
1037 | 1037 | ||
1038 | PwMerror ret = curDoc()->exportToGpasman(&fn); | 1038 | PwMerror ret = curDoc()->exportToGpasman(&fn); |
1039 | if (ret != e_success) { | 1039 | if (ret != e_success) { |
1040 | if (ret == e_noPw) { | 1040 | if (ret == e_noPw) { |
1041 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1041 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1042 | return; | 1042 | return; |
1043 | } | 1043 | } |
1044 | KMessageBox::error(this, | 1044 | KMessageBox::error(this, |
1045 | i18n("Error: Couldn't write to file.\n" | 1045 | i18n("Error: Couldn't write to file.\n" |
1046 | "Please check if you have permission to write " | 1046 | "Please check if you have permission to write " |
1047 | "to the file in that directory."), | 1047 | "to the file in that directory."), |
1048 | i18n("error while writing")); | 1048 | i18n("error while writing")); |
1049 | } else | 1049 | } else |
1050 | showStatMsg(i18n("Successfully exported data.")); | 1050 | showStatMsg(i18n("Successfully exported data.")); |
1051 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1051 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | 1054 | ||
1055 | 1055 | ||
1056 | void PwM::exportToCsv() | 1056 | void PwM::exportToCsv() |
1057 | { | 1057 | { |
1058 | PWM_ASSERT(curDoc()); | 1058 | PWM_ASSERT(curDoc()); |
1059 | if (curDoc()->isDocEmpty()) { | 1059 | if (curDoc()->isDocEmpty()) { |
1060 | KMessageBox::information(this, | 1060 | KMessageBox::information(this, |
1061 | i18n | 1061 | i18n |
1062 | ("Sorry, there is nothing to export;\n" | 1062 | ("Sorry, there is nothing to export;\n" |
1063 | "please add some passwords first."), | 1063 | "please add some passwords first."), |
1064 | i18n("Nothing to Do")); | 1064 | i18n("Nothing to Do")); |
1065 | return; | 1065 | return; |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 1068 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
1069 | QString fn(KFileDialog::getSaveFileName("*.csv", i18n("*|CSV Text File"), this)); | 1069 | QString fn(KFileDialog::getSaveFileName("*.csv", i18n("*|CSV Text File"), this)); |
1070 | if (fn.isEmpty()) { | 1070 | if (fn.isEmpty()) { |
1071 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1071 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1072 | return; | 1072 | return; |
1073 | } | 1073 | } |
1074 | 1074 | ||
1075 | Csv csv(this); | 1075 | Csv csv(this); |
1076 | if (!csv.exportData(fn, curDoc())) { | 1076 | if (!csv.exportData(fn, curDoc())) { |
1077 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1077 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1078 | showStatMsg(i18n("CSV file export failed.")); | 1078 | showStatMsg(i18n("CSV file export failed.")); |
1079 | return; | 1079 | return; |
1080 | } | 1080 | } |
1081 | showStatMsg(i18n("Successfully exported data.")); | 1081 | showStatMsg(i18n("Successfully exported data.")); |
1082 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1082 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | bool PwM::importCsv() | 1085 | bool PwM::importCsv() |
1086 | { | 1086 | { |
1087 | Csv csv(this); | 1087 | Csv csv(this); |
1088 | if (!isVirgin()) { | 1088 | if (!isVirgin()) { |
1089 | if (KMessageBox::questionYesNo(this, | 1089 | if (KMessageBox::questionYesNo(this, |
1090 | i18n("Do you want to import the data\n" | 1090 | i18n("Do you want to import the data\n" |
1091 | "into the current document? (If you\n" | 1091 | "into the current document? (If you\n" |
1092 | "select \"no\", a new document will be\n" | 1092 | "select \"no\", a new document will be\n" |
1093 | "opened.)"), | 1093 | "opened.)"), |
1094 | i18n("Import into This Document?")) | 1094 | i18n("Import into This Document?")) |
1095 | == KMessageBox::No) { | 1095 | == KMessageBox::No) { |
1096 | // import the data to a new window. | 1096 | // import the data to a new window. |
1097 | PwM *newInstance = init->createMainWnd(); | 1097 | PwM *newInstance = init->createMainWnd(); |
1098 | bool ok = newInstance->importCsv(); | 1098 | bool ok = newInstance->importCsv(); |
1099 | if (!ok) { | 1099 | if (!ok) { |
1100 | newInstance->setForceQuit(true); | 1100 | newInstance->setForceQuit(true); |
1101 | delete_and_null(newInstance); | 1101 | delete_and_null(newInstance); |
1102 | } | 1102 | } |
1103 | return ok; | 1103 | return ok; |
1104 | } | 1104 | } |
1105 | } | 1105 | } |
1106 | 1106 | ||
1107 | QString filename = KFileDialog::getOpenFileName("*.csv", i18n("*|CSV Text File"), this); | 1107 | QString filename = KFileDialog::getOpenFileName("*.csv", i18n("*|CSV Text File"), this); |
1108 | if (filename.isEmpty()) | 1108 | if (filename.isEmpty()) |
1109 | return false; | 1109 | return false; |
1110 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 1110 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
1111 | if (!csv.importData(filename, curDoc())) { | 1111 | if (!csv.importData(filename, curDoc())) { |
1112 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1112 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1113 | showStatMsg(i18n("CSV file import failed.")); | 1113 | showStatMsg(i18n("CSV file import failed.")); |
1114 | return false; | 1114 | return false; |
1115 | } | 1115 | } |
1116 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1116 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1117 | KMessageBox::information(this, | 1117 | KMessageBox::information(this, |
1118 | i18n("Successfully imported the CSV data\n" | 1118 | i18n("Successfully imported the CSV data\n" |
1119 | "into the current document."), i18n("Successfully Imported")); | 1119 | "into the current document."), i18n("Successfully Imported")); |
1120 | showStatMsg(i18n("Successfully imported")); | 1120 | showStatMsg(i18n("Successfully imported")); |
1121 | setVirgin(false); | 1121 | setVirgin(false); |
1122 | return true; | 1122 | return true; |
1123 | } | 1123 | } |
1124 | 1124 | ||
1125 | 1125 | ||
1126 | void PwM::exportToKWallet() | 1126 | void PwM::exportToKWallet() |
1127 | { | 1127 | { |
1128 | #ifdef CONFIG_KWALLETIF | 1128 | #ifdef CONFIG_KWALLETIF |
1129 | if (!checkAndAskForKWalletEmu()) | 1129 | if (!checkAndAskForKWalletEmu()) |
1130 | return; | 1130 | return; |
1131 | PWM_ASSERT(curDoc()); | 1131 | PWM_ASSERT(curDoc()); |
1132 | if (curDoc()->isDocEmpty()) { | 1132 | if (curDoc()->isDocEmpty()) { |
1133 | KMessageBox::information(this, | 1133 | KMessageBox::information(this, |
1134 | i18n | 1134 | i18n |
1135 | ("Sorry, there's nothing to export.\n" | 1135 | ("Sorry, there's nothing to export.\n" |
1136 | "Please first add some passwords."), | 1136 | "Please first add some passwords."), |
1137 | i18n("nothing to do")); | 1137 | i18n("nothing to do")); |
1138 | init->initKWalletEmu(); | 1138 | init->initKWalletEmu(); |
1139 | return; | 1139 | return; |
1140 | } | 1140 | } |
1141 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 1141 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
1142 | KWalletIf walletIf(this); | 1142 | KWalletIf walletIf(this); |
1143 | if (walletIf.kwalletExport(curDoc())) { | 1143 | if (walletIf.kwalletExport(curDoc())) { |
1144 | KMessageBox::information(this, | 1144 | KMessageBox::information(this, |
1145 | i18n("Successfully exported the data of the current " | 1145 | i18n("Successfully exported the data of the current " |
1146 | "document to KWallet."), | 1146 | "document to KWallet."), |
1147 | i18n("Successfully exported data.")); | 1147 | i18n("Successfully exported data.")); |
1148 | showStatMsg(i18n("Successfully exported data.")); | 1148 | showStatMsg(i18n("Successfully exported data.")); |
1149 | } | 1149 | } |
1150 | init->initKWalletEmu(); | 1150 | init->initKWalletEmu(); |
1151 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1151 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1152 | #endif // CONFIG_KWALLETIF | 1152 | #endif // CONFIG_KWALLETIF |
1153 | } | 1153 | } |
1154 | 1154 | ||
1155 | bool PwM::importFromGpasman() | 1155 | bool PwM::importFromGpasman() |
1156 | { | 1156 | { |
1157 | if (!isVirgin()) { | 1157 | if (!isVirgin()) { |
1158 | if (KMessageBox::questionYesNo(this, | 1158 | if (KMessageBox::questionYesNo(this, |
1159 | i18n("Do you want to import the data\n" | 1159 | i18n("Do you want to import the data\n" |
1160 | "into the current document? (If you\n" | 1160 | "into the current document? (If you\n" |
1161 | "select \"no\", a new document will be\n" | 1161 | "select \"no\", a new document will be\n" |
1162 | "opened.)"), | 1162 | "opened.)"), |
1163 | i18n("import into this document?")) | 1163 | i18n("import into this document?")) |
1164 | == KMessageBox::No) { | 1164 | == KMessageBox::No) { |
1165 | // import the data to a new window. | 1165 | // import the data to a new window. |
1166 | PwM *newInstance = init->createMainWnd(); | 1166 | PwM *newInstance = init->createMainWnd(); |
1167 | bool ok = newInstance->importFromGpasman(); | 1167 | bool ok = newInstance->importFromGpasman(); |
1168 | if (!ok) { | 1168 | if (!ok) { |
1169 | newInstance->setForceQuit(true); | 1169 | newInstance->setForceQuit(true); |
1170 | delete_and_null(newInstance); | 1170 | delete_and_null(newInstance); |
1171 | } | 1171 | } |
1172 | return ok; | 1172 | return ok; |
1173 | } | 1173 | } |
1174 | } | 1174 | } |
1175 | 1175 | ||
1176 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 1176 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
1177 | PwMerror ret; | 1177 | PwMerror ret; |
1178 | QString path(KFileDialog::getOpenFileName(QString::null, | 1178 | QString path(KFileDialog::getOpenFileName(QString::null, |
1179 | i18n("*|Gpasman or Kpasman file"), this)); | 1179 | i18n("*|Gpasman or Kpasman file"), this)); |
1180 | if (path == "") | 1180 | if (path == "") |
1181 | goto cancelImport; | 1181 | goto cancelImport; |
1182 | ret = curDoc()->importFromGpasman(&path); | 1182 | ret = curDoc()->importFromGpasman(&path); |
1183 | if (ret == e_wrongPw) { | 1183 | if (ret == e_wrongPw) { |
1184 | if (KMessageBox::questionYesNo(this, | 1184 | if (KMessageBox::questionYesNo(this, |
1185 | i18n | 1185 | i18n |
1186 | ("This is probably the wrong master-password\n" | 1186 | ("This is probably the wrong master-password\n" |
1187 | "you have typed in.\n" | 1187 | "you have typed in.\n" |
1188 | "There is no real way to determine the\n" | 1188 | "There is no real way to determine the\n" |
1189 | "correctness of the password in the Gpasman\n" | 1189 | "correctness of the password in the Gpasman\n" |
1190 | "file-format. But I think this\n" | 1190 | "file-format. But I think this\n" |
1191 | "password ist wrong.\n" | 1191 | "password ist wrong.\n" |
1192 | "Do you want to continue nevertheless?"), | 1192 | "Do you want to continue nevertheless?"), |
1193 | i18n("password error")) | 1193 | i18n("password error")) |
1194 | == KMessageBox::No) { | 1194 | == KMessageBox::No) { |
1195 | goto cancelImport; | 1195 | goto cancelImport; |
1196 | } | 1196 | } |
1197 | } else if (ret != e_success) { | 1197 | } else if (ret != e_success) { |
1198 | KMessageBox::error(this, | 1198 | KMessageBox::error(this, |
1199 | i18n("Could not import file!\n" | 1199 | i18n("Could not import file!\n" |
1200 | "Do you have permission to read this file?"), | 1200 | "Do you have permission to read this file?"), |
1201 | i18n("import failed")); | 1201 | i18n("import failed")); |
1202 | goto cancelImport; | 1202 | goto cancelImport; |
1203 | } | 1203 | } |
1204 | setVirgin(false); | 1204 | setVirgin(false); |
1205 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1205 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1206 | return true; | 1206 | return true; |
1207 | 1207 | ||
1208 | cancelImport: | 1208 | cancelImport: |
1209 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1209 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1210 | return false; | 1210 | return false; |
1211 | } | 1211 | } |
1212 | 1212 | ||
1213 | #ifdef CONFIG_KWALLETIF | 1213 | #ifdef CONFIG_KWALLETIF |
1214 | bool PwM::checkAndAskForKWalletEmu() | 1214 | bool PwM::checkAndAskForKWalletEmu() |
1215 | { | 1215 | { |
1216 | if (init->kwalletEmu()) { | 1216 | if (init->kwalletEmu()) { |
1217 | /* KWallet emulation is enabled. We can't import/export | 1217 | /* KWallet emulation is enabled. We can't import/export |
1218 | * data from/to it, while emulation is active. | 1218 | * data from/to it, while emulation is active. |
1219 | */ | 1219 | */ |
1220 | if (KMessageBox::questionYesNo(this, | 1220 | if (KMessageBox::questionYesNo(this, |
1221 | i18n("KWallet emulation is enabled.\n" | 1221 | i18n("KWallet emulation is enabled.\n" |
1222 | "You can't import or export data from/to " | 1222 | "You can't import or export data from/to " |
1223 | "the original KWallet, while the emulation " | 1223 | "the original KWallet, while the emulation " |
1224 | "is active.\n" | 1224 | "is active.\n" |
1225 | "Do you want to tempoarly disable the KWallet emulation?"), | 1225 | "Do you want to tempoarly disable the KWallet emulation?"), |
1226 | i18n("Tempoarly disable KWallet emulation?")) | 1226 | i18n("Tempoarly disable KWallet emulation?")) |
1227 | == KMessageBox::Yes) { | 1227 | == KMessageBox::Yes) { |
1228 | init->initKWalletEmu(true); | 1228 | init->initKWalletEmu(true); |
1229 | PWM_ASSERT(!init->kwalletEmu()); | 1229 | PWM_ASSERT(!init->kwalletEmu()); |
1230 | return true; | 1230 | return true; |
1231 | } | 1231 | } |
1232 | return false; | 1232 | return false; |
1233 | } | 1233 | } |
1234 | return true; | 1234 | return true; |
1235 | } | 1235 | } |
1236 | #endif // CONFIG_KWALLETIF | 1236 | #endif // CONFIG_KWALLETIF |
1237 | 1237 | ||
1238 | bool PwM::importKWallet() | 1238 | bool PwM::importKWallet() |
1239 | { | 1239 | { |
1240 | #ifdef CONFIG_KWALLETIF | 1240 | #ifdef CONFIG_KWALLETIF |
1241 | if (!checkAndAskForKWalletEmu()) | 1241 | if (!checkAndAskForKWalletEmu()) |
1242 | return false; | 1242 | return false; |
1243 | KWalletIf walletIf(this); | 1243 | KWalletIf walletIf(this); |
1244 | if (!isVirgin()) { | 1244 | if (!isVirgin()) { |
1245 | if (KMessageBox::questionYesNo(this, | 1245 | if (KMessageBox::questionYesNo(this, |
1246 | i18n("Do you want to import the data " | 1246 | i18n("Do you want to import the data " |
1247 | "into the current document? (If you " | 1247 | "into the current document? (If you " |
1248 | "select \"no\", a new document will be " | 1248 | "select \"no\", a new document will be " |
1249 | "opened.)"), | 1249 | "opened.)"), |
1250 | i18n("import into this document?")) | 1250 | i18n("import into this document?")) |
1251 | == KMessageBox::No) { | 1251 | == KMessageBox::No) { |
1252 | // import the data to a new window. | 1252 | // import the data to a new window. |
1253 | PwM *newInstance = init->createMainWnd(); | 1253 | PwM *newInstance = init->createMainWnd(); |
1254 | bool ok = newInstance->importKWallet(); | 1254 | bool ok = newInstance->importKWallet(); |
1255 | if (!ok) { | 1255 | if (!ok) { |
1256 | newInstance->setForceQuit(true); | 1256 | newInstance->setForceQuit(true); |
1257 | delete_and_null(newInstance); | 1257 | delete_and_null(newInstance); |
1258 | goto exit_fail; | 1258 | goto exit_fail; |
1259 | } else { | 1259 | } else { |
1260 | goto exit_ok; | 1260 | goto exit_ok; |
1261 | } | 1261 | } |
1262 | } | 1262 | } |
1263 | } | 1263 | } |
1264 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 1264 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
1265 | if (!walletIf.kwalletImport(curDoc())) { | 1265 | if (!walletIf.kwalletImport(curDoc())) { |
1266 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1266 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1267 | showStatMsg(i18n("KWallet import failed")); | 1267 | showStatMsg(i18n("KWallet import failed")); |
1268 | goto exit_fail; | 1268 | goto exit_fail; |
1269 | } | 1269 | } |
1270 | KMessageBox::information(this, | 1270 | KMessageBox::information(this, |
1271 | i18n("Successfully imported the KWallet data " | 1271 | i18n("Successfully imported the KWallet data " |
1272 | "into the current document."), | 1272 | "into the current document."), |
1273 | i18n("successfully imported")); | 1273 | i18n("successfully imported")); |
1274 | showStatMsg(i18n("successfully imported")); | 1274 | showStatMsg(i18n("successfully imported")); |
1275 | setVirgin(false); | 1275 | setVirgin(false); |
1276 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1276 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1277 | 1277 | ||
1278 | exit_ok: | 1278 | exit_ok: |
1279 | init->initKWalletEmu(); | 1279 | init->initKWalletEmu(); |
1280 | return true; | 1280 | return true; |
1281 | 1281 | ||
1282 | exit_fail: | 1282 | exit_fail: |
1283 | init->initKWalletEmu(); | 1283 | init->initKWalletEmu(); |
1284 | #endif // CONFIG_KWALLETIF | 1284 | #endif // CONFIG_KWALLETIF |
1285 | return false; | 1285 | return false; |
1286 | } | 1286 | } |
1287 | 1287 | ||
1288 | void PwM::print_slot() | 1288 | void PwM::print_slot() |
1289 | { | 1289 | { |
1290 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); | 1290 | curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); |
1291 | #ifndef PWM_EMBEDDED | 1291 | #ifndef PWM_EMBEDDED |
1292 | PwMPrint p(curDoc(), this); | 1292 | PwMPrint p(curDoc(), this); |
1293 | p.printNow(); | 1293 | p.printNow(); |
1294 | #else | 1294 | #else |
1295 | qDebug("PwM::print_slot , PRINTING IS NOT IMPLEMENTED"); | 1295 | qDebug("PwM::print_slot , PRINTING IS NOT IMPLEMENTED"); |
1296 | #endif | 1296 | #endif |
1297 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); | 1297 | curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | void PwM::genNewCard_slot() | 1300 | void PwM::genNewCard_slot() |
1301 | { | 1301 | { |
1302 | #ifdef CONFIG_KEYCARD | 1302 | #ifdef CONFIG_KEYCARD |
1303 | init->keycard()->genNewCard(); | 1303 | init->keycard()->genNewCard(); |
1304 | #endif | 1304 | #endif |
1305 | } | 1305 | } |
1306 | 1306 | ||
1307 | void PwM::eraseCard_slot() | 1307 | void PwM::eraseCard_slot() |
1308 | { | 1308 | { |
1309 | #ifdef CONFIG_KEYCARD | 1309 | #ifdef CONFIG_KEYCARD |
1310 | init->keycard()->eraseCard(); | 1310 | init->keycard()->eraseCard(); |
1311 | #endif | 1311 | #endif |
1312 | } | 1312 | } |
1313 | 1313 | ||
1314 | void PwM::readCardId_slot() | 1314 | void PwM::readCardId_slot() |
1315 | { | 1315 | { |
1316 | #ifdef CONFIG_KEYCARD | 1316 | #ifdef CONFIG_KEYCARD |
1317 | init->keycard()->displayKey(); | 1317 | init->keycard()->displayKey(); |
1318 | #endif | 1318 | #endif |
1319 | } | 1319 | } |
1320 | 1320 | ||
1321 | void PwM::makeCardBackup_slot() | 1321 | void PwM::makeCardBackup_slot() |
1322 | { | 1322 | { |
1323 | #ifdef CONFIG_KEYCARD | 1323 | #ifdef CONFIG_KEYCARD |
1324 | init->keycard()->makeBackupImage(); | 1324 | init->keycard()->makeBackupImage(); |
1325 | #endif | 1325 | #endif |
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | void PwM::replayCardBackup_slot() | 1328 | void PwM::replayCardBackup_slot() |
1329 | { | 1329 | { |
1330 | #ifdef CONFIG_KEYCARD | 1330 | #ifdef CONFIG_KEYCARD |
1331 | init->keycard()->replayBackupImage(); | 1331 | init->keycard()->replayBackupImage(); |
1332 | #endif | 1332 | #endif |
1333 | } | 1333 | } |
1334 | 1334 | ||
1335 | void PwM::execLauncher_slot() | 1335 | void PwM::execLauncher_slot() |
1336 | { | 1336 | { |
1337 | PWM_ASSERT(curDoc()); | 1337 | PWM_ASSERT(curDoc()); |
1338 | if (curDoc()->isDeepLocked()) | 1338 | if (curDoc()->isDeepLocked()) |
1339 | return; | 1339 | return; |
1340 | unsigned int curEntryIndex; | 1340 | unsigned int curEntryIndex; |
1341 | if (!view->getCurEntryIndex(&curEntryIndex)) | 1341 | if (!view->getCurEntryIndex(&curEntryIndex)) |
1342 | return; | 1342 | return; |
1343 | bool ret = curDoc()->execLauncher(view->getCurrentCategory(), | 1343 | bool ret = curDoc()->execLauncher(view->getCurrentCategory(), |
1344 | curEntryIndex); | 1344 | curEntryIndex); |
1345 | if (ret) | 1345 | if (ret) |
1346 | showStatMsg(i18n("Executed the \"Launcher\".")); | 1346 | showStatMsg(i18n("Executed the \"Launcher\".")); |
1347 | else | 1347 | else |
1348 | showStatMsg(i18n("ERROR: Couldn't execute the \"Launcher\"!")); | 1348 | showStatMsg(i18n("ERROR: Couldn't execute the \"Launcher\"!")); |
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | void PwM::goToURL_slot() | 1351 | void PwM::goToURL_slot() |
1352 | { | 1352 | { |
1353 | PWM_ASSERT(curDoc()); | 1353 | PWM_ASSERT(curDoc()); |
1354 | if (curDoc()->isDeepLocked()) | 1354 | if (curDoc()->isDeepLocked()) |
1355 | return; | 1355 | return; |
1356 | unsigned int curEntryIndex; | 1356 | unsigned int curEntryIndex; |
1357 | if (!view->getCurEntryIndex(&curEntryIndex)) | 1357 | if (!view->getCurEntryIndex(&curEntryIndex)) |
1358 | return; | 1358 | return; |
1359 | bool ret = curDoc()->goToURL(view->getCurrentCategory(), | 1359 | bool ret = curDoc()->goToURL(view->getCurrentCategory(), |
1360 | curEntryIndex); | 1360 | curEntryIndex); |
1361 | if (ret) | 1361 | if (ret) |
1362 | showStatMsg(i18n("started browser with current URL.")); | 1362 | showStatMsg(i18n("started browser with current URL.")); |
1363 | else | 1363 | else |
1364 | showStatMsg(i18n("ERROR: Couldn't start browser! Maybe invalid URL?")); | 1364 | showStatMsg(i18n("ERROR: Couldn't start browser! Maybe invalid URL?")); |
1365 | } | 1365 | } |
1366 | 1366 | ||
1367 | void PwM::copyToClipboard(const QString &s) | 1367 | void PwM::copyToClipboard(const QString &s) |
1368 | { | 1368 | { |
1369 | QClipboard *cb = QApplication::clipboard(); | 1369 | QClipboard *cb = QApplication::clipboard(); |
1370 | #ifndef PWM_EMBEDDED | 1370 | #ifndef PWM_EMBEDDED |
1371 | if (cb->supportsSelection()) | 1371 | if (cb->supportsSelection()) |
1372 | cb->setText(s, QClipboard::Selection); | 1372 | cb->setText(s, QClipboard::Selection); |
1373 | cb->setText(s, QClipboard::Clipboard); | 1373 | cb->setText(s, QClipboard::Clipboard); |
1374 | #else | 1374 | #else |
1375 | cb->setText(s); | 1375 | cb->setText(s); |
1376 | 1376 | ||
1377 | #endif | 1377 | #endif |
1378 | 1378 | ||
1379 | } | 1379 | } |
1380 | 1380 | ||
1381 | 1381 | ||
1382 | void PwM::showStatMsg(const QString &msg) | 1382 | void PwM::showStatMsg(const QString &msg) |
1383 | { | 1383 | { |
1384 | #ifdef DESKTOP_VERSION | 1384 | #ifdef DESKTOP_VERSION |
1385 | statusBar()->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); | 1385 | statusBar()->message(msg, STATUSBAR_MSG_TIMEOUT * 1000); |
1386 | #else | 1386 | #else |
1387 | qDebug("Statusbar : %s",msg.latin1()); | 1387 | //qDebug("Statusbar : %s",msg.latin1()); |
1388 | Global::statusMessage(msg); | 1388 | Global::statusMessage(msg); |
1389 | #endif | 1389 | #endif |
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | void PwM::focusInEvent(QFocusEvent *e) | 1392 | void PwM::focusInEvent(QFocusEvent *e) |
1393 | { | 1393 | { |
1394 | if (e->gotFocus()) { | 1394 | if (e->gotFocus()) { |
1395 | emit gotFocus(this); | 1395 | emit gotFocus(this); |
1396 | } else if (e->lostFocus()) { | 1396 | } else if (e->lostFocus()) { |
1397 | emit lostFocus(this); | 1397 | emit lostFocus(this); |
1398 | } | 1398 | } |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | 1401 | ||
1402 | #ifdef PWM_EMBEDDED | 1402 | #ifdef PWM_EMBEDDED |
1403 | 1403 | ||
1404 | void PwM::category_slot() | 1404 | void PwM::category_slot() |
1405 | { | 1405 | { |
1406 | PwMDoc *doc = curDoc(); | 1406 | PwMDoc *doc = curDoc(); |
1407 | PWM_ASSERT(doc); | 1407 | PWM_ASSERT(doc); |
1408 | doc->timer()->getLock(DocTimer::id_autoLockTimer); | 1408 | doc->timer()->getLock(DocTimer::id_autoLockTimer); |
1409 | 1409 | ||
1410 | editCategoryWnd w(doc, this, "editcategory"); | 1410 | editCategoryWnd w(doc, this, "editcategory"); |
1411 | /* | 1411 | /* |
1412 | vector<string> catList; | 1412 | vector<string> catList; |
1413 | doc->getCategoryList(&catList); | 1413 | doc->getCategoryList(&catList); |
1414 | unsigned i, size = catList.size(); | 1414 | unsigned i, size = catList.size(); |
1415 | for (i = 0; i < size; ++i) { | 1415 | for (i = 0; i < size; ++i) { |
1416 | w.addCategory(catList[i].c_str()); | 1416 | w.addCategory(catList[i].c_str()); |
1417 | } | 1417 | } |
1418 | w.setCurrCategory(view->getCurrentCategory()); | 1418 | w.setCurrCategory(view->getCurrentCategory()); |
1419 | if (pw) | 1419 | if (pw) |
1420 | w.pwLineEdit->setText(*pw); | 1420 | w.pwLineEdit->setText(*pw); |
1421 | */ | 1421 | */ |
1422 | w.setCurrCategory(view->getCurrentCategory()); | 1422 | w.setCurrCategory(view->getCurrentCategory()); |
1423 | 1423 | ||
1424 | tryAgain: | 1424 | tryAgain: |
1425 | if (w.exec() == 1) | 1425 | if (w.exec() == 1) |
1426 | { | 1426 | { |
1427 | PwMDataItem d; | 1427 | PwMDataItem d; |
1428 | 1428 | ||
1429 | //US BUG: to initialize all values of curEntr with meaningfulldata, | 1429 | //US BUG: to initialize all values of curEntr with meaningfulldata, |
1430 | // we call clear on it. Reason: Metadata will be uninitialized otherwise. | 1430 | // we call clear on it. Reason: Metadata will be uninitialized otherwise. |
1431 | // another option would be to create a constructor for PwMDataItem | 1431 | // another option would be to create a constructor for PwMDataItem |
1432 | d.clear(true); | 1432 | d.clear(true); |
1433 | /* | 1433 | /* |
1434 | d.desc = w.getDescription().latin1(); | 1434 | d.desc = w.getDescription().latin1(); |
1435 | d.name = w.getUsername().latin1(); | 1435 | d.name = w.getUsername().latin1(); |
1436 | d.pw = w.getPassword().latin1(); | 1436 | d.pw = w.getPassword().latin1(); |
1437 | d.comment = w.getComment().latin1(); | 1437 | d.comment = w.getComment().latin1(); |
1438 | d.url = w.getUrl().latin1(); | 1438 | d.url = w.getUrl().latin1(); |
1439 | d.launcher = w.getLauncher().latin1(); | 1439 | d.launcher = w.getLauncher().latin1(); |
1440 | PwMerror ret = doc->addEntry(w.getCategory(), &d); | 1440 | PwMerror ret = doc->addEntry(w.getCategory(), &d); |
1441 | if (ret == e_entryExists) { | 1441 | if (ret == e_entryExists) { |
1442 | KMessageBox::error(this, | 1442 | KMessageBox::error(this, |
1443 | i18n | 1443 | i18n |
1444 | ("An entry with this \"Description\",\n" | 1444 | ("An entry with this \"Description\",\n" |
1445 | "does already exist.\n" | 1445 | "does already exist.\n" |
1446 | "Please select another description."), | 1446 | "Please select another description."), |
1447 | i18n("entry already exists.")); | 1447 | i18n("entry already exists.")); |
1448 | goto tryAgain; | 1448 | goto tryAgain; |
1449 | } else if (ret == e_maxAllowedEntr) { | 1449 | } else if (ret == e_maxAllowedEntr) { |
1450 | KMessageBox::error(this, i18n("The maximum possible number of\nentries" | 1450 | KMessageBox::error(this, i18n("The maximum possible number of\nentries" |
1451 | "has been reached.\nYou can't add more entries."), | 1451 | "has been reached.\nYou can't add more entries."), |
1452 | i18n("maximum number of entries")); | 1452 | i18n("maximum number of entries")); |
1453 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 1453 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
1454 | return; | 1454 | return; |
1455 | } | 1455 | } |
1456 | */ | 1456 | */ |
1457 | } | 1457 | } |
1458 | setVirgin(false); | 1458 | setVirgin(false); |
1459 | doc->timer()->putLock(DocTimer::id_autoLockTimer); | 1459 | doc->timer()->putLock(DocTimer::id_autoLockTimer); |
1460 | } | 1460 | } |
1461 | 1461 | ||
1462 | 1462 | ||
1463 | void PwM::whatsnew_slot() | 1463 | void PwM::whatsnew_slot() |
1464 | { | 1464 | { |
1465 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1465 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | void PwM::showLicense_slot() | 1468 | void PwM::showLicense_slot() |
1469 | { | 1469 | { |
1470 | KApplication::showLicence(); | 1470 | KApplication::showLicence(); |
1471 | } | 1471 | } |
1472 | 1472 | ||
1473 | void PwM::faq_slot() | 1473 | void PwM::faq_slot() |
1474 | { | 1474 | { |
1475 | KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" ); | 1475 | KApplication::showFile( "PWM/Pi FAQ", "kdepim/pwmanager/pwmanagerFAQ.txt" ); |
1476 | } | 1476 | } |
1477 | 1477 | ||
1478 | void PwM::syncHowTo_slot() | 1478 | void PwM::syncHowTo_slot() |
1479 | { | 1479 | { |
1480 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1480 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1481 | } | 1481 | } |
1482 | 1482 | ||
1483 | 1483 | ||
1484 | void PwM::createAboutData_slot() | 1484 | void PwM::createAboutData_slot() |
1485 | { | 1485 | { |
1486 | QString version; | 1486 | QString version; |
1487 | #include <../version> | 1487 | #include <../version> |
1488 | ; | 1488 | ; |
1489 | QMessageBox::about( this, "About PwManager/Pi", | 1489 | QMessageBox::about( this, "About PwManager/Pi", |
1490 | "PwManager/Platform-independent\n" | 1490 | "PwManager/Platform-independent\n" |
1491 | "(PWM/Pi) " +version + " - " + | 1491 | "(PWM/Pi) " +version + " - " + |
1492 | #ifdef DESKTOP_VERSION | 1492 | #ifdef DESKTOP_VERSION |
1493 | "Desktop Edition\n" | 1493 | "Desktop Edition\n" |
1494 | #else | 1494 | #else |
1495 | "PDA-Edition\n" | 1495 | "PDA-Edition\n" |
1496 | "for: Zaurus 5500 / 7x0 / 8x0\n" | 1496 | "for: Zaurus 5500 / 7x0 / 8x0\n" |
1497 | #endif | 1497 | #endif |
1498 | 1498 | ||
1499 | "(c) 2004 Ulf Schenk\n" | 1499 | "(c) 2004 Ulf Schenk\n" |
1500 | "(c) 2004 Lutz Rogowski\n" | 1500 | "(c) 2004 Lutz Rogowski\n" |
1501 | "(c) 1997-2004, The KDE PIM Team\n" | 1501 | "(c) 1997-2004, The KDE PIM Team\n" |
1502 | 1502 | ||
1503 | "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n" | 1503 | "(c) Michael Buesch - main programming\nand current maintainer\nmbuesch@freenet.de\n" |
1504 | "Matt Scifo - mscifo@o1.com\n" | 1504 | "Matt Scifo - mscifo@o1.com\n" |
1505 | "Elias Probst - elias.probst@gmx.de\n" | 1505 | "Elias Probst - elias.probst@gmx.de\n" |
1506 | "George Staikos - staikos@kde.org\n" | 1506 | "George Staikos - staikos@kde.org\n" |
1507 | "Matthew Palmer - mjp16@uow.edu.au\n" | 1507 | "Matthew Palmer - mjp16@uow.edu.au\n" |
1508 | "Olivier Sessink - gpasman@nl.linux.org\n" | 1508 | "Olivier Sessink - gpasman@nl.linux.org\n" |
1509 | "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" | 1509 | "The libgcrypt developers -\nBlowfish and SHA1 algorithms\nftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/\n" |
1510 | "Troy Engel - tengel@sonic.net\n" | 1510 | "Troy Engel - tengel@sonic.net\n" |
1511 | "Wickey - wickey@gmx.at\n" | 1511 | "Wickey - wickey@gmx.at\n" |
1512 | "Ian MacGregor - original documentation author.\n" | 1512 | "Ian MacGregor - original documentation author.\n" |
1513 | ); | 1513 | ); |
1514 | } | 1514 | } |
1515 | 1515 | ||
1516 | 1516 | ||
1517 | //this are the overwritten callbackmethods from the syncinterface | 1517 | //this are the overwritten callbackmethods from the syncinterface |
1518 | bool PwM::sync(KSyncManager* manager, QString filename, int mode) | 1518 | bool PwM::sync(KSyncManager* manager, QString filename, int mode) |
1519 | { | 1519 | { |
1520 | PWM_ASSERT(curDoc()); | 1520 | PWM_ASSERT(curDoc()); |
1521 | 1521 | ||
1522 | bool ret = curDoc()->sync(manager, filename, mode); | 1522 | bool ret = curDoc()->sync(manager, filename, mode); |
1523 | 1523 | ||
1524 | qDebug("PwM::sync save now: ret=%i", ret); | 1524 | qDebug("PwM::sync save now: ret=%i", ret); |
1525 | 1525 | ||
1526 | if (ret == true) { | 1526 | if (ret == true) { |
1527 | //US BUG: what can we call here to update the view of the current doc? | 1527 | //US BUG: what can we call here to update the view of the current doc? |
1528 | //mViewManager->refreshView(); | 1528 | //mViewManager->refreshView(); |
1529 | 1529 | ||
1530 | //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. | 1530 | //US curDoc()->sync sets the dirtyFlag in case the sync was successfull. |
1531 | save(); | 1531 | save(); |
1532 | } | 1532 | } |
1533 | 1533 | ||
1534 | return ret; | 1534 | return ret; |
1535 | } | 1535 | } |
1536 | 1536 | ||
1537 | void PwM::removeSyncInfo( QString syncProfile) | 1537 | void PwM::removeSyncInfo( QString syncProfile) |
1538 | { | 1538 | { |
1539 | qDebug("PWM:removeSyncInfo for profile %s ", syncProfile.latin1()); | 1539 | qDebug("PWM:removeSyncInfo for profile %s ", syncProfile.latin1()); |
1540 | curDoc()->removeSyncInfo( syncProfile ); | 1540 | curDoc()->removeSyncInfo( syncProfile ); |
1541 | //US curDoc()->removeSyncInfo sets the dirtyFlag. | 1541 | //US curDoc()->removeSyncInfo sets the dirtyFlag. |
1542 | } | 1542 | } |
1543 | 1543 | ||
1544 | #endif | 1544 | #endif |
1545 | 1545 | ||
1546 | 1546 | ||
1547 | #ifndef PWM_EMBEDDED | 1547 | #ifndef PWM_EMBEDDED |
1548 | #include "pwm.moc" | 1548 | #include "pwm.moc" |
1549 | #endif | 1549 | #endif |
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp index 0cf248c..d59d4d8 100644 --- a/pwmanager/pwmanager/pwminit.cpp +++ b/pwmanager/pwmanager/pwminit.cpp | |||
@@ -1,661 +1,661 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2004 by Michael Buesch * | 3 | * copyright (C) 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.0.1 of pwmanager | 14 | * This file is originaly based on version 1.0.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #include "pwminit.h" | 20 | #include "pwminit.h" |
21 | #include "randomizer.h" | 21 | #include "randomizer.h" |
22 | #include <qdir.h> | 22 | #include <qdir.h> |
23 | 23 | ||
24 | #ifndef PWM_EMBEDDED | 24 | #ifndef PWM_EMBEDDED |
25 | #include "selftest.h" | 25 | #include "selftest.h" |
26 | #include "configuration.h" | 26 | #include "configuration.h" |
27 | #else | 27 | #else |
28 | #include "pwmprefs.h" | 28 | #include "pwmprefs.h" |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #include "pwm.h" | 31 | #include "pwm.h" |
32 | #include "pwmexception.h" | 32 | #include "pwmexception.h" |
33 | #include "pwmtray.h" | 33 | #include "pwmtray.h" |
34 | #include "pwmdoc.h" | 34 | #include "pwmdoc.h" |
35 | 35 | ||
36 | #ifdef CONFIG_KWALLETIF | 36 | #ifdef CONFIG_KWALLETIF |
37 | # include "kwalletemu.h" | 37 | # include "kwalletemu.h" |
38 | #endif // CONFIG_KWALLETIF | 38 | #endif // CONFIG_KWALLETIF |
39 | #ifdef CONFIG_KEYCARD | 39 | #ifdef CONFIG_KEYCARD |
40 | # include "pwmkeycard.h" | 40 | # include "pwmkeycard.h" |
41 | #endif // CONFIG_KEYCARD | 41 | #endif // CONFIG_KEYCARD |
42 | 42 | ||
43 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
44 | 44 | ||
45 | #include <kmessagebox.h> | 45 | #include <kmessagebox.h> |
46 | #ifndef PWM_EMBEDDED | 46 | #ifndef PWM_EMBEDDED |
47 | #include <kcmdlineargs.h> | 47 | #include <kcmdlineargs.h> |
48 | #include <kwin.h> | 48 | #include <kwin.h> |
49 | #include <dcopclient.h> | 49 | #include <dcopclient.h> |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | #include <kapplication.h> | 52 | #include <kapplication.h> |
53 | #include <kiconloader.h> | 53 | #include <kiconloader.h> |
54 | 54 | ||
55 | #include <signal.h> | 55 | #include <signal.h> |
56 | 56 | ||
57 | static PwMInit *sig_init_pointer; | 57 | static PwMInit *sig_init_pointer; |
58 | #ifdef _WIN32_ | 58 | #ifdef _WIN32_ |
59 | static void sig_handler(int signum) | 59 | static void sig_handler(int signum) |
60 | #else | 60 | #else |
61 | static NOREGPARM void sig_handler(int signum) | 61 | static NOREGPARM void sig_handler(int signum) |
62 | #endif | 62 | #endif |
63 | { | 63 | { |
64 | switch (signum) { | 64 | switch (signum) { |
65 | case SIGINT: | 65 | case SIGINT: |
66 | case SIGTERM: | 66 | case SIGTERM: |
67 | sig_init_pointer->shutdownApp(20 + signum); | 67 | sig_init_pointer->shutdownApp(20 + signum); |
68 | break; | 68 | break; |
69 | default: | 69 | default: |
70 | printDebug(string("unhandled signal ") | 70 | printDebug(string("unhandled signal ") |
71 | + tostr(signum)); | 71 | + tostr(signum)); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | PwMInit::PwMInit(PwMApplication *_app) | 77 | PwMInit::PwMInit(PwMApplication *_app) |
78 | : runStatus (unknown) | 78 | : runStatus (unknown) |
79 | , _curWidget (0) | 79 | , _curWidget (0) |
80 | , _dcopClient (0) | 80 | , _dcopClient (0) |
81 | , _kwalletEmu (0) | 81 | , _kwalletEmu (0) |
82 | , _keycard (0) | 82 | , _keycard (0) |
83 | , _tray (0) | 83 | , _tray (0) |
84 | { | 84 | { |
85 | sig_init_pointer = this; | 85 | sig_init_pointer = this; |
86 | app = _app; | 86 | app = _app; |
87 | } | 87 | } |
88 | 88 | ||
89 | PwMInit::~PwMInit() | 89 | PwMInit::~PwMInit() |
90 | { | 90 | { |
91 | qDebug("PwMInit::~PwMInit() "); | 91 | //qDebug("PwMInit::~PwMInit() "); |
92 | #ifndef PWM_EMBEDDED | 92 | #ifndef PWM_EMBEDDED |
93 | SelfTest::cancel(); | 93 | SelfTest::cancel(); |
94 | // close all open mainwnds | 94 | // close all open mainwnds |
95 | QValueList<PwM *>::iterator i = _mainWndList.begin(), | 95 | QValueList<PwM *>::iterator i = _mainWndList.begin(), |
96 | end = _mainWndList.end(); | 96 | end = _mainWndList.end(); |
97 | 97 | ||
98 | #else | 98 | #else |
99 | // close all open mainwnds | 99 | // close all open mainwnds |
100 | QValueList<PwM *>::Iterator i = _mainWndList.begin(), | 100 | QValueList<PwM *>::Iterator i = _mainWndList.begin(), |
101 | end = _mainWndList.end(); | 101 | end = _mainWndList.end(); |
102 | #endif | 102 | #endif |
103 | while (i != end) { | 103 | while (i != end) { |
104 | disconnect(*i, SIGNAL(closed(PwM *)), | 104 | disconnect(*i, SIGNAL(closed(PwM *)), |
105 | this, SLOT(mainWndClosed(PwM *))); | 105 | this, SLOT(mainWndClosed(PwM *))); |
106 | delete *i; | 106 | delete *i; |
107 | ++i; | 107 | ++i; |
108 | } | 108 | } |
109 | _mainWndList.clear(); | 109 | _mainWndList.clear(); |
110 | // close all remaining open documents | 110 | // close all remaining open documents |
111 | PwMDocList *_dl = PwMDoc::getOpenDocList(); | 111 | PwMDocList *_dl = PwMDoc::getOpenDocList(); |
112 | vector<PwMDocList::listItem> dl = *(_dl->getList()); | 112 | vector<PwMDocList::listItem> dl = *(_dl->getList()); |
113 | vector<PwMDocList::listItem>::iterator i2 = dl.begin(), | 113 | vector<PwMDocList::listItem>::iterator i2 = dl.begin(), |
114 | end2 = dl.end(); | 114 | end2 = dl.end(); |
115 | while (i2 != end2) { | 115 | while (i2 != end2) { |
116 | delete (*i2).doc; | 116 | delete (*i2).doc; |
117 | ++i2; | 117 | ++i2; |
118 | } | 118 | } |
119 | 119 | ||
120 | #ifdef CONFIG_KWALLETIF | 120 | #ifdef CONFIG_KWALLETIF |
121 | delete_ifnot_null(_kwalletEmu); | 121 | delete_ifnot_null(_kwalletEmu); |
122 | #endif // CONFIG_KWALLETIF | 122 | #endif // CONFIG_KWALLETIF |
123 | #ifdef CONFIG_KEYCARD | 123 | #ifdef CONFIG_KEYCARD |
124 | delete_ifnot_null(_keycard); | 124 | delete_ifnot_null(_keycard); |
125 | #endif // CONFIG_KEYCARD | 125 | #endif // CONFIG_KEYCARD |
126 | delete_ifnot_null(_tray); | 126 | delete_ifnot_null(_tray); |
127 | 127 | ||
128 | Randomizer::cleanup(); | 128 | Randomizer::cleanup(); |
129 | #ifndef PWM_EMBEDDED | 129 | #ifndef PWM_EMBEDDED |
130 | Configuration::cleanup(); | 130 | Configuration::cleanup(); |
131 | #endif | 131 | #endif |
132 | } | 132 | } |
133 | 133 | ||
134 | void PwMInit::initializeApp() | 134 | void PwMInit::initializeApp() |
135 | { | 135 | { |
136 | //qDebug("PwMInit::initializeApp() "); | 136 | //qDebug("PwMInit::initializeApp() "); |
137 | PWM_ASSERT(runStatus == unknown); | 137 | PWM_ASSERT(runStatus == unknown); |
138 | runStatus = init; | 138 | runStatus = init; |
139 | initPosixSignalHandler(); | 139 | initPosixSignalHandler(); |
140 | Randomizer::init(); | 140 | Randomizer::init(); |
141 | #ifndef PWM_EMBEDDED | 141 | #ifndef PWM_EMBEDDED |
142 | Configuration::init(); | 142 | Configuration::init(); |
143 | #endif | 143 | #endif |
144 | initDCOP(); | 144 | initDCOP(); |
145 | initKWalletEmu(); | 145 | initKWalletEmu(); |
146 | initKeycard(); | 146 | initKeycard(); |
147 | initTray(); | 147 | initTray(); |
148 | handleCmdLineArgs(); | 148 | handleCmdLineArgs(); |
149 | bool openDeeplocked = false; | 149 | bool openDeeplocked = false; |
150 | if (conf()->confGlobAutostartDeepLocked() || | 150 | if (conf()->confGlobAutostartDeepLocked() || |
151 | savedCmd.open_deeplocked) | 151 | savedCmd.open_deeplocked) |
152 | openDeeplocked = true; | 152 | openDeeplocked = true; |
153 | if ( false ){ | 153 | if ( false ){ |
154 | // LR is not working | 154 | // LR is not working |
155 | //if (conf()->confWndAutoMinimizeOnStart() || | 155 | //if (conf()->confWndAutoMinimizeOnStart() || |
156 | // savedCmd.minToTray) { | 156 | // savedCmd.minToTray) { |
157 | PwMDoc *newDoc = createDoc(); | 157 | PwMDoc *newDoc = createDoc(); |
158 | qDebug(" createDoc()"); | 158 | //qDebug(" createDoc()"); |
159 | if (!newDoc->openDocUi(newDoc, | 159 | if (!newDoc->openDocUi(newDoc, |
160 | conf()->confGlobAutoStart(), | 160 | conf()->confGlobAutoStart(), |
161 | openDeeplocked)) { | 161 | openDeeplocked)) { |
162 | delete newDoc; | 162 | delete newDoc; |
163 | } | 163 | } |
164 | 164 | ||
165 | //US ENH for embedded devices: in the case of failure, open a document the default way | 165 | //US ENH for embedded devices: in the case of failure, open a document the default way |
166 | createMainWnd(conf()->confGlobAutoStart(), | 166 | createMainWnd(conf()->confGlobAutoStart(), |
167 | openDeeplocked, | 167 | openDeeplocked, |
168 | true, | 168 | true, |
169 | 0, | 169 | 0, |
170 | savedCmd.minimized); | 170 | savedCmd.minimized); |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | ||
175 | //} | 175 | //} |
176 | } else { | 176 | } else { |
177 | createMainWnd(conf()->confGlobAutoStart(), | 177 | createMainWnd(conf()->confGlobAutoStart(), |
178 | openDeeplocked, | 178 | openDeeplocked, |
179 | true, | 179 | true, |
180 | 0, | 180 | 0, |
181 | savedCmd.minimized); | 181 | savedCmd.minimized); |
182 | } | 182 | } |
183 | runStatus = running; | 183 | runStatus = running; |
184 | } | 184 | } |
185 | 185 | ||
186 | void PwMInit::shutdownApp(int exitStatus) | 186 | void PwMInit::shutdownApp(int exitStatus) |
187 | { | 187 | { |
188 | 188 | ||
189 | 189 | ||
190 | PwM * iii;; | 190 | PwM * iii;; |
191 | while ( _mainWndList.count() ) { | 191 | while ( _mainWndList.count() ) { |
192 | iii = _mainWndList.first(); | 192 | iii = _mainWndList.first(); |
193 | disconnect(iii, SIGNAL(closed(PwM *)), | 193 | disconnect(iii, SIGNAL(closed(PwM *)), |
194 | this, SLOT(mainWndClosed(PwM *))); | 194 | this, SLOT(mainWndClosed(PwM *))); |
195 | mainWndClosed((iii)); | 195 | mainWndClosed((iii)); |
196 | } | 196 | } |
197 | 197 | ||
198 | printDebug(string("PwMInit::shutdownApp(") | 198 | printDebug(string("PwMInit::shutdownApp(") |
199 | + tostr(exitStatus) + ") called."); | 199 | + tostr(exitStatus) + ") called."); |
200 | PWM_ASSERT((runStatus == running) || (runStatus == init)); | 200 | PWM_ASSERT((runStatus == running) || (runStatus == init)); |
201 | runStatus = shutdown; | 201 | runStatus = shutdown; |
202 | QApplication::exit(exitStatus); | 202 | QApplication::exit(exitStatus); |
203 | /* The destructor of PwMInit is called when control | 203 | /* The destructor of PwMInit is called when control |
204 | * leaves main() | 204 | * leaves main() |
205 | */ | 205 | */ |
206 | } | 206 | } |
207 | 207 | ||
208 | void PwMInit::initPosixSignalHandler() | 208 | void PwMInit::initPosixSignalHandler() |
209 | { | 209 | { |
210 | signal(SIGINT, sig_handler); | 210 | signal(SIGINT, sig_handler); |
211 | signal(SIGTERM, sig_handler); | 211 | signal(SIGTERM, sig_handler); |
212 | } | 212 | } |
213 | 213 | ||
214 | void PwMInit::initDCOP() | 214 | void PwMInit::initDCOP() |
215 | { | 215 | { |
216 | #ifndef PWM_EMBEDDED | 216 | #ifndef PWM_EMBEDDED |
217 | _dcopClient = app->dcopClient(); | 217 | _dcopClient = app->dcopClient(); |
218 | _dcopClient->setNotifications(true); | 218 | _dcopClient->setNotifications(true); |
219 | #endif | 219 | #endif |
220 | 220 | ||
221 | } | 221 | } |
222 | 222 | ||
223 | void PwMInit::initKWalletEmu(bool forceDisable, bool forceReload) | 223 | void PwMInit::initKWalletEmu(bool forceDisable, bool forceReload) |
224 | { | 224 | { |
225 | #ifdef CONFIG_KWALLETIF | 225 | #ifdef CONFIG_KWALLETIF |
226 | if (!conf()->confGlobKwalletEmu() || | 226 | if (!conf()->confGlobKwalletEmu() || |
227 | forceDisable) { | 227 | forceDisable) { |
228 | delete_ifnot_null(_kwalletEmu); | 228 | delete_ifnot_null(_kwalletEmu); |
229 | return; | 229 | return; |
230 | } | 230 | } |
231 | try { | 231 | try { |
232 | if (_kwalletEmu && forceReload) | 232 | if (_kwalletEmu && forceReload) |
233 | delete_and_null(_kwalletEmu); | 233 | delete_and_null(_kwalletEmu); |
234 | if (!_kwalletEmu) | 234 | if (!_kwalletEmu) |
235 | _kwalletEmu = new KWalletEmu(this); | 235 | _kwalletEmu = new KWalletEmu(this); |
236 | } catch (PwMException e) { | 236 | } catch (PwMException e) { |
237 | string errMsg("initializing KWallet emulation failed. ID: "); | 237 | string errMsg("initializing KWallet emulation failed. ID: "); |
238 | errMsg += tostr(static_cast<int>(e.getId())); | 238 | errMsg += tostr(static_cast<int>(e.getId())); |
239 | errMsg += " err-message: "; | 239 | errMsg += " err-message: "; |
240 | errMsg += e.getMessage(); | 240 | errMsg += e.getMessage(); |
241 | printWarn(errMsg); | 241 | printWarn(errMsg); |
242 | return; | 242 | return; |
243 | } | 243 | } |
244 | #else // CONFIG_KWALLETIF | 244 | #else // CONFIG_KWALLETIF |
245 | PARAM_UNUSED(forceDisable); | 245 | PARAM_UNUSED(forceDisable); |
246 | PARAM_UNUSED(forceReload); | 246 | PARAM_UNUSED(forceReload); |
247 | #endif // CONFIG_KWALLETIF | 247 | #endif // CONFIG_KWALLETIF |
248 | } | 248 | } |
249 | 249 | ||
250 | void PwMInit::initKeycard() | 250 | void PwMInit::initKeycard() |
251 | { | 251 | { |
252 | #ifdef CONFIG_KEYCARD | 252 | #ifdef CONFIG_KEYCARD |
253 | PWM_ASSERT(!_keycard); | 253 | PWM_ASSERT(!_keycard); |
254 | _keycard = new PwMKeyCard(this); | 254 | _keycard = new PwMKeyCard(this); |
255 | #endif // CONFIG_KEYCARD | 255 | #endif // CONFIG_KEYCARD |
256 | } | 256 | } |
257 | 257 | ||
258 | void PwMInit::initTray() | 258 | void PwMInit::initTray() |
259 | { | 259 | { |
260 | #ifdef PWM_EMBEDDED | 260 | #ifdef PWM_EMBEDDED |
261 | //US ENH : embedded version does not support a tray | 261 | //US ENH : embedded version does not support a tray |
262 | return; | 262 | return; |
263 | #endif | 263 | #endif |
264 | 264 | ||
265 | if (!conf()->confGlobTray()) { | 265 | if (!conf()->confGlobTray()) { |
266 | if (!_tray) | 266 | if (!_tray) |
267 | return; | 267 | return; |
268 | _tray->hide(); | 268 | _tray->hide(); |
269 | delete_and_null(_tray); | 269 | delete_and_null(_tray); |
270 | return; | 270 | return; |
271 | } | 271 | } |
272 | if (_tray) | 272 | if (_tray) |
273 | return; | 273 | return; |
274 | _tray = new PwMTray(this); | 274 | _tray = new PwMTray(this); |
275 | connect(_tray, SIGNAL(quitSelected()), | 275 | connect(_tray, SIGNAL(quitSelected()), |
276 | this, SLOT(removeTrayAndQuit())); | 276 | this, SLOT(removeTrayAndQuit())); |
277 | connect(_tray, SIGNAL(closed(PwMTray *)), | 277 | connect(_tray, SIGNAL(closed(PwMTray *)), |
278 | this, SLOT(trayIconClosed(PwMTray *))); | 278 | this, SLOT(trayIconClosed(PwMTray *))); |
279 | KIconLoader icons; | 279 | KIconLoader icons; |
280 | #ifndef PWM_EMBEDDED | 280 | #ifndef PWM_EMBEDDED |
281 | _tray->setPixmap(icons.loadIcon(PACKAGE_NAME, KIcon::Small)); | 281 | _tray->setPixmap(icons.loadIcon(PACKAGE_NAME, KIcon::Small)); |
282 | #endif | 282 | #endif |
283 | _tray->show(); | 283 | _tray->show(); |
284 | // connect the signals of all open documents. | 284 | // connect the signals of all open documents. |
285 | const vector<PwMDocList::listItem> *dl = PwMDoc::getOpenDocList()->getList(); | 285 | const vector<PwMDocList::listItem> *dl = PwMDoc::getOpenDocList()->getList(); |
286 | vector<PwMDocList::listItem>::const_iterator i = dl->begin(), | 286 | vector<PwMDocList::listItem>::const_iterator i = dl->begin(), |
287 | end = dl->end(); | 287 | end = dl->end(); |
288 | while (i != end) { | 288 | while (i != end) { |
289 | _tray->connectDocToTray((*i).doc); | 289 | _tray->connectDocToTray((*i).doc); |
290 | ++i; | 290 | ++i; |
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 | ||
294 | void PwMInit::removeTrayAndQuit() | 294 | void PwMInit::removeTrayAndQuit() |
295 | { | 295 | { |
296 | PWM_ASSERT(_tray); | 296 | PWM_ASSERT(_tray); |
297 | // _tray is deleted in ~PwMInit | 297 | // _tray is deleted in ~PwMInit |
298 | shutdownApp(0); | 298 | shutdownApp(0); |
299 | } | 299 | } |
300 | 300 | ||
301 | PwM * PwMInit::createMainWnd(const QString &loadFile, | 301 | PwM * PwMInit::createMainWnd(const QString &loadFile, |
302 | bool loadFileDeepLocked, | 302 | bool loadFileDeepLocked, |
303 | bool virginity, | 303 | bool virginity, |
304 | PwMDoc *doc, | 304 | PwMDoc *doc, |
305 | bool minimized) | 305 | bool minimized) |
306 | { | 306 | { |
307 | PwM *newWnd; | 307 | PwM *newWnd; |
308 | if (!doc) | 308 | if (!doc) |
309 | doc = createDoc(); | 309 | doc = createDoc(); |
310 | newWnd = new PwM(this, doc, virginity); | 310 | newWnd = new PwM(this, doc, virginity); |
311 | #ifndef PWM_EMBEDDED | 311 | #ifndef PWM_EMBEDDED |
312 | _mainWndList.push_back(newWnd); | 312 | _mainWndList.push_back(newWnd); |
313 | #else | 313 | #else |
314 | _mainWndList.append(newWnd); | 314 | _mainWndList.append(newWnd); |
315 | #endif | 315 | #endif |
316 | connect(newWnd, SIGNAL(closed(PwM *)), | 316 | connect(newWnd, SIGNAL(closed(PwM *)), |
317 | this, SLOT(mainWndClosed(PwM *))); | 317 | this, SLOT(mainWndClosed(PwM *))); |
318 | connect(newWnd, SIGNAL(gotFocus(PwM *)), | 318 | connect(newWnd, SIGNAL(gotFocus(PwM *)), |
319 | this, SLOT(setCurWidget(PwM *))); | 319 | this, SLOT(setCurWidget(PwM *))); |
320 | connect(newWnd, SIGNAL(lostFocus(PwM *)), | 320 | connect(newWnd, SIGNAL(lostFocus(PwM *)), |
321 | this, SLOT(resetCurWidget())); | 321 | this, SLOT(resetCurWidget())); |
322 | 322 | ||
323 | //US ENH | 323 | //US ENH |
324 | #ifndef PWM_EMBEDDED | 324 | #ifndef PWM_EMBEDDED |
325 | if (minimized) | 325 | if (minimized) |
326 | newWnd->showMinimized(); | 326 | newWnd->showMinimized(); |
327 | else | 327 | else |
328 | newWnd->show(); | 328 | newWnd->show(); |
329 | 329 | ||
330 | #else //PWM_EMBEDDED | 330 | #else //PWM_EMBEDDED |
331 | 331 | ||
332 | #ifndef DESKTOP_VERSION | 332 | #ifndef DESKTOP_VERSION |
333 | app->showMainWidget( newWnd ); | 333 | app->showMainWidget( newWnd ); |
334 | #else //DESKTOP_VERSION | 334 | #else //DESKTOP_VERSION |
335 | newWnd->resize (640, 480 ); | 335 | newWnd->resize (640, 480 ); |
336 | newWnd->show(); | 336 | newWnd->show(); |
337 | #endif //DESKTOP_VERSION | 337 | #endif //DESKTOP_VERSION |
338 | 338 | ||
339 | #endif //PWM_EMBEDDED | 339 | #endif //PWM_EMBEDDED |
340 | 340 | ||
341 | if (loadFile != QString::null && | 341 | if (loadFile != QString::null && |
342 | loadFile != "") { | 342 | loadFile != "") { |
343 | newWnd->openDoc(loadFile, loadFileDeepLocked); | 343 | newWnd->openDoc(loadFile, loadFileDeepLocked); |
344 | } | 344 | } |
345 | return newWnd; | 345 | return newWnd; |
346 | } | 346 | } |
347 | 347 | ||
348 | PwMDoc * PwMInit::createDoc() | 348 | PwMDoc * PwMInit::createDoc() |
349 | { | 349 | { |
350 | PwMDoc *doc = new PwMDoc(this); | 350 | PwMDoc *doc = new PwMDoc(this); |
351 | #ifdef CONFIG_KEYCARD | 351 | #ifdef CONFIG_KEYCARD |
352 | doc->setPwMKeyCard(keycard()); | 352 | doc->setPwMKeyCard(keycard()); |
353 | #endif | 353 | #endif |
354 | #ifdef CONFIG_KWALLETIF | 354 | #ifdef CONFIG_KWALLETIF |
355 | if (kwalletEmu()) | 355 | if (kwalletEmu()) |
356 | kwalletEmu()->connectDocSignals(doc); | 356 | kwalletEmu()->connectDocSignals(doc); |
357 | #endif | 357 | #endif |
358 | 358 | ||
359 | if (_tray) | 359 | if (_tray) |
360 | _tray->connectDocToTray(doc); | 360 | _tray->connectDocToTray(doc); |
361 | 361 | ||
362 | return doc; | 362 | return doc; |
363 | 363 | ||
364 | } | 364 | } |
365 | 365 | ||
366 | void PwMInit::mainWndClosed(PwM *wnd) | 366 | void PwMInit::mainWndClosed(PwM *wnd) |
367 | { | 367 | { |
368 | bool doMinimizeToTray = false; | 368 | bool doMinimizeToTray = false; |
369 | bool doDeleteDoc = false; | 369 | bool doDeleteDoc = false; |
370 | #ifndef PWM_EMBEDDED | 370 | #ifndef PWM_EMBEDDED |
371 | dcopClient()->suspend(); | 371 | dcopClient()->suspend(); |
372 | dcopClient()->setAcceptCalls(false); | 372 | dcopClient()->setAcceptCalls(false); |
373 | #endif | 373 | #endif |
374 | again: | 374 | again: |
375 | 375 | ||
376 | if (wnd->isForceMinimizeToTray()) { | 376 | if (wnd->isForceMinimizeToTray()) { |
377 | if (unlikely(!_tray)) { | 377 | if (unlikely(!_tray)) { |
378 | /* This should not happen! If we set forceMinimizeToTray , | 378 | /* This should not happen! If we set forceMinimizeToTray , |
379 | * we must be sure that _tray exists. | 379 | * we must be sure that _tray exists. |
380 | */ | 380 | */ |
381 | BUG(); | 381 | BUG(); |
382 | wnd->setForceMinimizeToTray(false); | 382 | wnd->setForceMinimizeToTray(false); |
383 | goto again; | 383 | goto again; |
384 | } | 384 | } |
385 | doMinimizeToTray = true; | 385 | doMinimizeToTray = true; |
386 | } else { | 386 | } else { |
387 | // Ask to minimize to tray. If not, delete doc. | 387 | // Ask to minimize to tray. If not, delete doc. |
388 | if (_tray && | 388 | if (_tray && |
389 | runStatus != shutdown && | 389 | runStatus != shutdown && |
390 | !wnd->isForceQuit() && | 390 | !wnd->isForceQuit() && |
391 | !wnd->curDoc()->isDeleted()) { | 391 | !wnd->curDoc()->isDeleted()) { |
392 | if (conf()->confWndClose()) | 392 | if (conf()->confWndClose()) |
393 | doDeleteDoc = true; | 393 | doDeleteDoc = true; |
394 | else | 394 | else |
395 | doMinimizeToTray = true; | 395 | doMinimizeToTray = true; |
396 | } else { | 396 | } else { |
397 | doDeleteDoc = true; | 397 | doDeleteDoc = true; |
398 | } | 398 | } |
399 | } | 399 | } |
400 | 400 | ||
401 | if (doMinimizeToTray) { | 401 | if (doMinimizeToTray) { |
402 | qDebug("doMinimizeToTray "); | 402 | //qDebug("doMinimizeToTray "); |
403 | PWM_ASSERT(_tray); | 403 | PWM_ASSERT(_tray); |
404 | int mmlock = conf()->confGlobMinimizeLock(); | 404 | int mmlock = conf()->confGlobMinimizeLock(); |
405 | switch (mmlock) { | 405 | switch (mmlock) { |
406 | case 0: // don't lock anything | 406 | case 0: // don't lock anything |
407 | break; | 407 | break; |
408 | case 1: // normal lock | 408 | case 1: // normal lock |
409 | wnd->curDoc()->lockAll(true); | 409 | wnd->curDoc()->lockAll(true); |
410 | break; | 410 | break; |
411 | case 2: // deep-lock | 411 | case 2: // deep-lock |
412 | wnd->curDoc()->deepLock(); | 412 | wnd->curDoc()->deepLock(); |
413 | break; | 413 | break; |
414 | default: | 414 | default: |
415 | WARN(); | 415 | WARN(); |
416 | } | 416 | } |
417 | } else if (doDeleteDoc) { | 417 | } else if (doDeleteDoc) { |
418 | qDebug("doDeleteDoc "); | 418 | //qDebug("doDeleteDoc "); |
419 | if (!wnd->curDoc()->tryDelete()) { | 419 | if (!wnd->curDoc()->tryDelete()) { |
420 | /* We failed deleting the doc, | 420 | /* We failed deleting the doc, |
421 | * so open a new window with it, again. | 421 | * so open a new window with it, again. |
422 | */ | 422 | */ |
423 | createMainWnd(QString::null, false, | 423 | createMainWnd(QString::null, false, |
424 | false, wnd->curDoc()); | 424 | false, wnd->curDoc()); |
425 | } | 425 | } |
426 | } | 426 | } |
427 | #ifndef PWM_EMBEDDED | 427 | #ifndef PWM_EMBEDDED |
428 | // find the closed window in the "mainWndList" and delete it. | 428 | // find the closed window in the "mainWndList" and delete it. |
429 | QValueList<PwM *>::iterator i = _mainWndList.begin(), | 429 | QValueList<PwM *>::iterator i = _mainWndList.begin(), |
430 | end = _mainWndList.end(); | 430 | end = _mainWndList.end(); |
431 | #else | 431 | #else |
432 | // find the closed window in the "mainWndList" and delete it. | 432 | // find the closed window in the "mainWndList" and delete it. |
433 | QValueList<PwM *>::Iterator i = _mainWndList.begin(), | 433 | QValueList<PwM *>::Iterator i = _mainWndList.begin(), |
434 | end = _mainWndList.end(); | 434 | end = _mainWndList.end(); |
435 | #endif | 435 | #endif |
436 | while (i != end) { | 436 | while (i != end) { |
437 | //qDebug("iii %x end %x wnd %x", (*i), (*end), wnd); | 437 | //qDebug("iii %x end %x wnd %x", (*i), (*end), wnd); |
438 | if (*i == wnd) { | 438 | if (*i == wnd) { |
439 | #ifndef PWM_EMBEDDED | 439 | #ifndef PWM_EMBEDDED |
440 | _mainWndList.erase(i); | 440 | _mainWndList.erase(i); |
441 | #else | 441 | #else |
442 | _mainWndList.remove(i); | 442 | _mainWndList.remove(i); |
443 | #endif | 443 | #endif |
444 | 444 | ||
445 | if ( app->mainWidget() == wnd ) { | 445 | if ( app->mainWidget() == wnd ) { |
446 | if ( _mainWndList.count() ) { | 446 | if ( _mainWndList.count() ) { |
447 | #ifndef DESKTOP_VERSION | 447 | #ifndef DESKTOP_VERSION |
448 | app->showMainWidget(_mainWndList.first() ); | 448 | app->showMainWidget(_mainWndList.first() ); |
449 | #endif //DESKTOP_VERSION | 449 | #endif //DESKTOP_VERSION |
450 | 450 | ||
451 | } | 451 | } |
452 | } | 452 | } |
453 | delete wnd; | 453 | delete wnd; |
454 | goto out_success; | 454 | goto out_success; |
455 | } | 455 | } |
456 | ++i; | 456 | ++i; |
457 | } | 457 | } |
458 | BUG(); | 458 | BUG(); |
459 | out_success: | 459 | out_success: |
460 | #ifndef PWM_EMBEDDED | 460 | #ifndef PWM_EMBEDDED |
461 | if (!_mainWndList.size()) | 461 | if (!_mainWndList.size()) |
462 | #else | 462 | #else |
463 | if (!_mainWndList.count()) | 463 | if (!_mainWndList.count()) |
464 | #endif | 464 | #endif |
465 | 465 | ||
466 | { | 466 | { |
467 | /* If there's no main window and no tray icon | 467 | /* If there's no main window and no tray icon |
468 | * left, we have no user interface, so we can | 468 | * left, we have no user interface, so we can |
469 | * shut down the application. | 469 | * shut down the application. |
470 | */ | 470 | */ |
471 | if (!_tray) { | 471 | if (!_tray) { |
472 | #ifndef PWM_EMBEDDED | 472 | #ifndef PWM_EMBEDDED |
473 | dcopClient()->setAcceptCalls(true); | 473 | dcopClient()->setAcceptCalls(true); |
474 | dcopClient()->resume(); | 474 | dcopClient()->resume(); |
475 | #endif | 475 | #endif |
476 | shutdownApp(0); | 476 | shutdownApp(0); |
477 | return; | 477 | return; |
478 | } | 478 | } |
479 | /* There is no widget left, so set | 479 | /* There is no widget left, so set |
480 | * _curWidget to 0 | 480 | * _curWidget to 0 |
481 | */ | 481 | */ |
482 | resetCurWidget(); | 482 | resetCurWidget(); |
483 | } | 483 | } |
484 | #ifndef PWM_EMBEDDED | 484 | #ifndef PWM_EMBEDDED |
485 | dcopClient()->setAcceptCalls(true); | 485 | dcopClient()->setAcceptCalls(true); |
486 | dcopClient()->resume(); | 486 | dcopClient()->resume(); |
487 | #endif | 487 | #endif |
488 | } | 488 | } |
489 | 489 | ||
490 | void PwMInit::trayIconClosed(PwMTray *tray) | 490 | void PwMInit::trayIconClosed(PwMTray *tray) |
491 | { | 491 | { |
492 | if (runStatus != running) | 492 | if (runStatus != running) |
493 | return; | 493 | return; |
494 | PARAM_UNUSED(tray); | 494 | PARAM_UNUSED(tray); |
495 | PWM_ASSERT(tray == _tray); | 495 | PWM_ASSERT(tray == _tray); |
496 | /* If there's no main wnd left we have to | 496 | /* If there's no main wnd left we have to |
497 | * shutdown the app (same as in mainWndClosed()) | 497 | * shutdown the app (same as in mainWndClosed()) |
498 | */ | 498 | */ |
499 | #ifndef PWM_EMBEDDED | 499 | #ifndef PWM_EMBEDDED |
500 | if (!_mainWndList.size()) | 500 | if (!_mainWndList.size()) |
501 | shutdownApp(0); | 501 | shutdownApp(0); |
502 | #else | 502 | #else |
503 | if (!_mainWndList.count()) | 503 | if (!_mainWndList.count()) |
504 | shutdownApp(0); | 504 | shutdownApp(0); |
505 | #endif | 505 | #endif |
506 | } | 506 | } |
507 | 507 | ||
508 | void PwMInit::handleCmdLineArgs(bool initial) | 508 | void PwMInit::handleCmdLineArgs(bool initial) |
509 | { | 509 | { |
510 | #ifndef PWM_EMBEDDED | 510 | #ifndef PWM_EMBEDDED |
511 | KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); | 511 | KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); |
512 | PWM_ASSERT(args); | 512 | PWM_ASSERT(args); |
513 | int i, numArgs = args->count(); | 513 | int i, numArgs = args->count(); |
514 | const char *curArg; | 514 | const char *curArg; |
515 | 515 | ||
516 | // read all cmdline options | 516 | // read all cmdline options |
517 | savedCmd.open_deeplocked = args->isSet("open-deeplocked"); | 517 | savedCmd.open_deeplocked = args->isSet("open-deeplocked"); |
518 | savedCmd.minimized = args->isSet("minimized"); | 518 | savedCmd.minimized = args->isSet("minimized"); |
519 | savedCmd.minToTray = args->isSet("mintray"); | 519 | savedCmd.minToTray = args->isSet("mintray"); |
520 | savedCmd.skipSelfTest = args->isSet("skip-self-test"); | 520 | savedCmd.skipSelfTest = args->isSet("skip-self-test"); |
521 | if (savedCmd.minimized && | 521 | if (savedCmd.minimized && |
522 | savedCmd.minToTray) { | 522 | savedCmd.minToTray) { |
523 | printInfo(i18n("Commandline option \"--minimized\" and " | 523 | printInfo(i18n("Commandline option \"--minimized\" and " |
524 | "\"--mintray\" selected. These are incompatible. " | 524 | "\"--mintray\" selected. These are incompatible. " |
525 | "\"--mintray\" will be selected.").latin1()); | 525 | "\"--mintray\" will be selected.").latin1()); |
526 | } | 526 | } |
527 | /* Iterate through all non-option arguments. | 527 | /* Iterate through all non-option arguments. |
528 | * Every non-option arg is a filename to open. | 528 | * Every non-option arg is a filename to open. |
529 | */ | 529 | */ |
530 | for (i = 0; i < numArgs; ++i) { | 530 | for (i = 0; i < numArgs; ++i) { |
531 | curArg = args->arg(i); | 531 | curArg = args->arg(i); |
532 | PWM_ASSERT(curArg); | 532 | PWM_ASSERT(curArg); |
533 | if (savedCmd.minToTray) { | 533 | if (savedCmd.minToTray) { |
534 | PwMDoc *newDoc = createDoc(); | 534 | PwMDoc *newDoc = createDoc(); |
535 | if (!newDoc->openDocUi(newDoc, | 535 | if (!newDoc->openDocUi(newDoc, |
536 | curArg, | 536 | curArg, |
537 | savedCmd.open_deeplocked)) { | 537 | savedCmd.open_deeplocked)) { |
538 | delete newDoc; | 538 | delete newDoc; |
539 | } | 539 | } |
540 | } else { | 540 | } else { |
541 | PwM *newInstance = createMainWnd(QString::null, | 541 | PwM *newInstance = createMainWnd(QString::null, |
542 | false, | 542 | false, |
543 | true, | 543 | true, |
544 | 0, | 544 | 0, |
545 | savedCmd.minimized); | 545 | savedCmd.minimized); |
546 | PwMDoc *newDoc = newInstance->openDoc(curArg, | 546 | PwMDoc *newDoc = newInstance->openDoc(curArg, |
547 | savedCmd.open_deeplocked); | 547 | savedCmd.open_deeplocked); |
548 | if (!newDoc) { | 548 | if (!newDoc) { |
549 | newInstance->setForceQuit(true); | 549 | newInstance->setForceQuit(true); |
550 | delete_and_null(newInstance); | 550 | delete_and_null(newInstance); |
551 | } | 551 | } |
552 | } | 552 | } |
553 | } | 553 | } |
554 | 554 | ||
555 | if (savedCmd.minToTray) { | 555 | if (savedCmd.minToTray) { |
556 | minimizeAllMainWnd(true); | 556 | minimizeAllMainWnd(true); |
557 | } else if (savedCmd.minimized) { | 557 | } else if (savedCmd.minimized) { |
558 | minimizeAllMainWnd(false); | 558 | minimizeAllMainWnd(false); |
559 | } | 559 | } |
560 | if (!savedCmd.skipSelfTest && initial) { | 560 | if (!savedCmd.skipSelfTest && initial) { |
561 | SelfTest::schedule(); | 561 | SelfTest::schedule(); |
562 | } | 562 | } |
563 | args->clear(); | 563 | args->clear(); |
564 | #endif | 564 | #endif |
565 | } | 565 | } |
566 | 566 | ||
567 | void PwMInit::minimizeAllMainWnd(bool toTray) | 567 | void PwMInit::minimizeAllMainWnd(bool toTray) |
568 | { | 568 | { |
569 | #ifndef PWM_EMBEDDED | 569 | #ifndef PWM_EMBEDDED |
570 | if (!_mainWndList.size()) | 570 | if (!_mainWndList.size()) |
571 | return; | 571 | return; |
572 | #else | 572 | #else |
573 | if (!_mainWndList.count()) | 573 | if (!_mainWndList.count()) |
574 | return; | 574 | return; |
575 | #endif | 575 | #endif |
576 | const QValueList<PwM *> *ml = mainWndList(); | 576 | const QValueList<PwM *> *ml = mainWndList(); |
577 | #ifndef PWM_EMBEDDED | 577 | #ifndef PWM_EMBEDDED |
578 | QValueList<PwM *>::const_iterator it = ml->begin(), | 578 | QValueList<PwM *>::const_iterator it = ml->begin(), |
579 | end = ml->end(); | 579 | end = ml->end(); |
580 | #else | 580 | #else |
581 | QValueList<PwM *>::ConstIterator it = ml->begin(), | 581 | QValueList<PwM *>::ConstIterator it = ml->begin(), |
582 | end = ml->end(); | 582 | end = ml->end(); |
583 | #endif | 583 | #endif |
584 | PwM *wnd; | 584 | PwM *wnd; |
585 | if (toTray && _tray) { | 585 | if (toTray && _tray) { |
586 | /* minimize to tray. | 586 | /* minimize to tray. |
587 | * close all mainWnd. | 587 | * close all mainWnd. |
588 | */ | 588 | */ |
589 | while (it != end) { | 589 | while (it != end) { |
590 | wnd = *it; | 590 | wnd = *it; |
591 | wnd->setForceMinimizeToTray(true); | 591 | wnd->setForceMinimizeToTray(true); |
592 | wnd->close_slot(); | 592 | wnd->close_slot(); |
593 | ++it; | 593 | ++it; |
594 | } | 594 | } |
595 | } else { | 595 | } else { |
596 | // normal minimize | 596 | // normal minimize |
597 | while (it != end) { | 597 | while (it != end) { |
598 | wnd = *it; | 598 | wnd = *it; |
599 | wnd->hide(); | 599 | wnd->hide(); |
600 | wnd->showMinimized(); | 600 | wnd->showMinimized(); |
601 | ++it; | 601 | ++it; |
602 | } | 602 | } |
603 | } | 603 | } |
604 | } | 604 | } |
605 | 605 | ||
606 | #ifdef PWM_EMBEDDED | 606 | #ifdef PWM_EMBEDDED |
607 | 607 | ||
608 | #ifndef DESKTOP_VERSION | 608 | #ifndef DESKTOP_VERSION |
609 | 609 | ||
610 | PwMApplication::PwMApplication(int & argc, char ** argv) | 610 | PwMApplication::PwMApplication(int & argc, char ** argv) |
611 | : QPEApplication( argc, argv ) | 611 | : QPEApplication( argc, argv ) |
612 | , init (0) | 612 | , init (0) |
613 | { | 613 | { |
614 | this->setKeepRunning (); | 614 | this->setKeepRunning (); |
615 | } | 615 | } |
616 | 616 | ||
617 | PwMApplication::~PwMApplication() | 617 | PwMApplication::~PwMApplication() |
618 | { | 618 | { |
619 | delete_ifnot_null(init); | 619 | delete_ifnot_null(init); |
620 | } | 620 | } |
621 | #else //DESKTOP_VERSION | 621 | #else //DESKTOP_VERSION |
622 | 622 | ||
623 | PwMApplication::PwMApplication(int & argc, char ** argv) | 623 | PwMApplication::PwMApplication(int & argc, char ** argv) |
624 | : QApplication( argc, argv ) | 624 | : QApplication( argc, argv ) |
625 | , init (0) | 625 | , init (0) |
626 | { | 626 | { |
627 | setStyle( new QPlatinumStyle ()); | 627 | setStyle( new QPlatinumStyle ()); |
628 | QString hdir = QDir::homeDirPath(); | 628 | QString hdir = QDir::homeDirPath(); |
629 | // there is a bug when creating dirs for WIN 98 | 629 | // there is a bug when creating dirs for WIN 98 |
630 | // it is difficult to fix, because we have no WIN 98 runnung | 630 | // it is difficult to fix, because we have no WIN 98 runnung |
631 | // such that we try it to create the dirs at startup here | 631 | // such that we try it to create the dirs at startup here |
632 | if ( hdir == "C:\\" ) | 632 | if ( hdir == "C:\\" ) |
633 | { | 633 | { |
634 | // win 98 or ME | 634 | // win 98 or ME |
635 | QDir app_dir; | 635 | QDir app_dir; |
636 | if ( !app_dir.exists("C:\\kdepim") ) | 636 | if ( !app_dir.exists("C:\\kdepim") ) |
637 | app_dir.mkdir ("C:\\kdepim"); | 637 | app_dir.mkdir ("C:\\kdepim"); |
638 | if ( !app_dir.exists("C:\\kdepim\\apps") ) | 638 | if ( !app_dir.exists("C:\\kdepim\\apps") ) |
639 | app_dir.mkdir ("C:\\kdepim\\apps"); | 639 | app_dir.mkdir ("C:\\kdepim\\apps"); |
640 | if ( !app_dir.exists("C:\\kdepim\\config") ) | 640 | if ( !app_dir.exists("C:\\kdepim\\config") ) |
641 | app_dir.mkdir ("C:\\kdepim\\config"); | 641 | app_dir.mkdir ("C:\\kdepim\\config"); |
642 | if ( !app_dir.exists("C:\\kdepim\\apps\\pwmanager") ) | 642 | if ( !app_dir.exists("C:\\kdepim\\apps\\pwmanager") ) |
643 | app_dir.mkdir ("C:\\kdepim\\apps\\pwmanager"); | 643 | app_dir.mkdir ("C:\\kdepim\\apps\\pwmanager"); |
644 | } | 644 | } |
645 | } | 645 | } |
646 | 646 | ||
647 | PwMApplication::~PwMApplication() | 647 | PwMApplication::~PwMApplication() |
648 | { | 648 | { |
649 | delete_ifnot_null(init); | 649 | delete_ifnot_null(init); |
650 | } | 650 | } |
651 | 651 | ||
652 | #endif //DESKTOP_VERSION | 652 | #endif //DESKTOP_VERSION |
653 | 653 | ||
654 | #endif //PWM_EMBEDDED | 654 | #endif //PWM_EMBEDDED |
655 | 655 | ||
656 | 656 | ||
657 | 657 | ||
658 | 658 | ||
659 | #ifndef PWM_EMBEDDED | 659 | #ifndef PWM_EMBEDDED |
660 | #include "pwminit.moc" | 660 | #include "pwminit.moc" |
661 | #endif | 661 | #endif |
diff --git a/pwmanager/pwmanager/pwmview.cpp b/pwmanager/pwmanager/pwmview.cpp index cd816e5..8c4d9cc 100644 --- a/pwmanager/pwmanager/pwmview.cpp +++ b/pwmanager/pwmanager/pwmview.cpp | |||
@@ -1,620 +1,620 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * copyright (C) 2003, 2004 by Michael Buesch * | 3 | * copyright (C) 2003, 2004 by Michael Buesch * |
4 | * email: mbuesch@freenet.de * | 4 | * email: mbuesch@freenet.de * |
5 | * * | 5 | * * |
6 | * This program is free software; you can redistribute it and/or modify * | 6 | * This program is free software; you can redistribute it and/or modify * |
7 | * it under the terms of the GNU General Public License version 2 * | 7 | * it under the terms of the GNU General Public License version 2 * |
8 | * as published by the Free Software Foundation. * | 8 | * as published by the Free Software Foundation. * |
9 | * * | 9 | * * |
10 | ***************************************************************************/ | 10 | ***************************************************************************/ |
11 | 11 | ||
12 | /*************************************************************************** | 12 | /*************************************************************************** |
13 | * copyright (C) 2004 by Ulf Schenk | 13 | * copyright (C) 2004 by Ulf Schenk |
14 | * This file is originaly based on version 1.0.1 of pwmanager | 14 | * This file is originaly based on version 1.0.1 of pwmanager |
15 | * and was modified to run on embedded devices that run microkde | 15 | * and was modified to run on embedded devices that run microkde |
16 | * | 16 | * |
17 | * $Id$ | 17 | * $Id$ |
18 | **************************************************************************/ | 18 | **************************************************************************/ |
19 | 19 | ||
20 | #include "pwmview.h" | 20 | #include "pwmview.h" |
21 | #include "pwmexception.h" | 21 | #include "pwmexception.h" |
22 | #include "globalstuff.h" | 22 | #include "globalstuff.h" |
23 | #include "pwm.h" | 23 | #include "pwm.h" |
24 | #include "rencatwnd.h" | 24 | #include "rencatwnd.h" |
25 | #ifndef PWM_EMBEDDED | 25 | #ifndef PWM_EMBEDDED |
26 | #include "configuration.h" | 26 | #include "configuration.h" |
27 | #else | 27 | #else |
28 | #include "pwmprefs.h" | 28 | #include "pwmprefs.h" |
29 | #endif | 29 | #endif |
30 | #include "commentbox.h" | 30 | #include "commentbox.h" |
31 | 31 | ||
32 | #include <kmessagebox.h> | 32 | #include <kmessagebox.h> |
33 | #include <klocale.h> | 33 | #include <klocale.h> |
34 | 34 | ||
35 | #include <qlineedit.h> | 35 | #include <qlineedit.h> |
36 | #include <qpoint.h> | 36 | #include <qpoint.h> |
37 | #include <qapplication.h> | 37 | #include <qapplication.h> |
38 | #include <qlayout.h> | 38 | #include <qlayout.h> |
39 | 39 | ||
40 | //US ENH: wouldn't it be a good idea if we could use this consts everywhere else. | 40 | //US ENH: wouldn't it be a good idea if we could use this consts everywhere else. |
41 | //US ENH: for examle in listviewpwm.cpp | 41 | //US ENH: for examle in listviewpwm.cpp |
42 | //US ENH: Because of that I transfer them into the headerfile. | 42 | //US ENH: Because of that I transfer them into the headerfile. |
43 | /* | 43 | /* |
44 | #define COLUMN_DESC 0 | 44 | #define COLUMN_DESC 0 |
45 | #define COLUMN_NAME 1 | 45 | #define COLUMN_NAME 1 |
46 | #define COLUMN_PW 2 | 46 | #define COLUMN_PW 2 |
47 | #define COLUMN_URL 3 | 47 | #define COLUMN_URL 3 |
48 | #define COLUMN_LAUNCHER 4 | 48 | #define COLUMN_LAUNCHER 4 |
49 | */ | 49 | */ |
50 | 50 | ||
51 | PwMView::PwMView(PwM *_mainClass, | 51 | PwMView::PwMView(PwM *_mainClass, |
52 | QWidget *parent, PwMDoc *_doc, | 52 | QWidget *parent, PwMDoc *_doc, |
53 | const char *name) | 53 | const char *name) |
54 | : PwMViewStyle(parent, name) | 54 | : PwMViewStyle(parent, name) |
55 | { | 55 | { |
56 | PWM_ASSERT(_mainClass); | 56 | PWM_ASSERT(_mainClass); |
57 | PWM_ASSERT(parent); | 57 | PWM_ASSERT(parent); |
58 | PWM_ASSERT(_doc); | 58 | PWM_ASSERT(_doc); |
59 | setView(this); | 59 | setView(this); |
60 | doc = _doc; | 60 | doc = _doc; |
61 | doc->setListViewPointer(this); | 61 | doc->setListViewPointer(this); |
62 | mainClass = _mainClass; | 62 | mainClass = _mainClass; |
63 | resize(_mainClass->size()); | 63 | resize(_mainClass->size()); |
64 | initStyle(conf()->confWndMainViewStyle()); | 64 | initStyle(conf()->confWndMainViewStyle()); |
65 | initCtxMenu(); | 65 | initCtxMenu(); |
66 | doc->setCurrentView(this); | 66 | doc->setCurrentView(this); |
67 | connect(doc, SIGNAL(dataChanged(PwMDoc *)), this, SLOT(updateView())); | 67 | connect(doc, SIGNAL(dataChanged(PwMDoc *)), this, SLOT(updateView())); |
68 | } | 68 | } |
69 | 69 | ||
70 | PwMView::~PwMView() | 70 | PwMView::~PwMView() |
71 | { | 71 | { |
72 | } | 72 | } |
73 | 73 | ||
74 | void PwMView::initCtxMenu() | 74 | void PwMView::initCtxMenu() |
75 | { | 75 | { |
76 | ctxMenu = new QPopupMenu(this); | 76 | ctxMenu = new QPopupMenu(this); |
77 | ctxMenu->insertItem(i18n("&Add password"), mainClass, SLOT(addPwd_slot())); | 77 | ctxMenu->insertItem(i18n("&Add password"), mainClass, SLOT(addPwd_slot())); |
78 | ctxMenu->insertSeparator(); | 78 | ctxMenu->insertSeparator(); |
79 | ctxMenu->insertItem(i18n("&Edit"), mainClass, SLOT(editPwd_slot())); | 79 | ctxMenu->insertItem(i18n("&Edit"), mainClass, SLOT(editPwd_slot())); |
80 | ctxMenu->insertItem(i18n("&Delete"), mainClass, SLOT(deletePwd_slot())); | 80 | ctxMenu->insertItem(i18n("&Delete"), mainClass, SLOT(deletePwd_slot())); |
81 | ctxMenu->insertSeparator(); | 81 | ctxMenu->insertSeparator(); |
82 | ctxMenu->insertItem(i18n("copy password to clipboard"), | 82 | ctxMenu->insertItem(i18n("copy password to clipboard"), |
83 | this, SLOT(copyPwToClip())); | 83 | this, SLOT(copyPwToClip())); |
84 | ctxMenu->insertItem(i18n("copy username to clipboard"), | 84 | ctxMenu->insertItem(i18n("copy username to clipboard"), |
85 | this, SLOT(copyNameToClip())); | 85 | this, SLOT(copyNameToClip())); |
86 | ctxMenu->insertItem(i18n("copy description to clipboard"), | 86 | ctxMenu->insertItem(i18n("copy description to clipboard"), |
87 | this, SLOT(copyDescToClip())); | 87 | this, SLOT(copyDescToClip())); |
88 | ctxMenu->insertItem(i18n("copy url to clipboard"), | 88 | ctxMenu->insertItem(i18n("copy url to clipboard"), |
89 | this, SLOT(copyUrlToClip())); | 89 | this, SLOT(copyUrlToClip())); |
90 | ctxMenu->insertItem(i18n("copy launcher to clipboard"), | 90 | ctxMenu->insertItem(i18n("copy launcher to clipboard"), |
91 | this, SLOT(copyLauncherToClip())); | 91 | this, SLOT(copyLauncherToClip())); |
92 | ctxMenu->insertItem(i18n("copy comment to clipboard"), | 92 | ctxMenu->insertItem(i18n("copy comment to clipboard"), |
93 | this, SLOT(copyCommentToClip())); | 93 | this, SLOT(copyCommentToClip())); |
94 | ctxMenu->insertSeparator(); | 94 | ctxMenu->insertSeparator(); |
95 | ctxMenu->insertItem(i18n("Execute \"Launcher\""), mainClass, | 95 | ctxMenu->insertItem(i18n("Execute \"Launcher\""), mainClass, |
96 | SLOT(execLauncher_slot())); | 96 | SLOT(execLauncher_slot())); |
97 | ctxMenu->insertItem(i18n("Go to \"URL\""), mainClass, | 97 | ctxMenu->insertItem(i18n("Go to \"URL\""), mainClass, |
98 | SLOT(goToURL_slot())); | 98 | SLOT(goToURL_slot())); |
99 | } | 99 | } |
100 | 100 | ||
101 | void PwMView::resizeEvent(QResizeEvent *) | 101 | void PwMView::resizeEvent(QResizeEvent *) |
102 | { | 102 | { |
103 | resizeView(size()); | 103 | resizeView(size()); |
104 | } | 104 | } |
105 | 105 | ||
106 | void PwMView::refreshCommentTextEdit(QListViewItem *curItem) | 106 | void PwMView::refreshCommentTextEdit(QListViewItem *curItem) |
107 | { | 107 | { |
108 | PWM_ASSERT(commentBox); | 108 | PWM_ASSERT(commentBox); |
109 | if (!curItem) | 109 | if (!curItem) |
110 | return; | 110 | return; |
111 | string comment; | 111 | string comment; |
112 | PwMerror ret; | 112 | PwMerror ret; |
113 | ret = document()->getCommentByLvp(getCurrentCategory(), | 113 | ret = document()->getCommentByLvp(getCurrentCategory(), |
114 | lv->childCount() - lv->itemIndex(curItem) - 1, | 114 | lv->childCount() - lv->itemIndex(curItem) - 1, |
115 | &comment); | 115 | &comment); |
116 | if (ret == e_binEntry) { | 116 | if (ret == e_binEntry) { |
117 | commentBox->setContent(i18n("This is a binary entry.\n" | 117 | commentBox->setContent(i18n("This is a binary entry.\n" |
118 | "It is not a normal password-entry, as it contains " | 118 | "It is not a normal password-entry, as it contains " |
119 | "binary data, which PwManager can't display here.")); | 119 | "binary data, which PwManager can't display here.")); |
120 | } else if (ret == e_normalEntry) { | 120 | } else if (ret == e_normalEntry) { |
121 | commentBox->setContent(comment.c_str()); | 121 | commentBox->setContent(comment.c_str()); |
122 | } else { | 122 | } else { |
123 | BUG(); | 123 | BUG(); |
124 | return; | 124 | return; |
125 | } | 125 | } |
126 | lv->ensureItemVisible(curItem); | 126 | lv->ensureItemVisible(curItem); |
127 | } | 127 | } |
128 | 128 | ||
129 | void PwMView::keyReleaseEvent(QKeyEvent * /*e*/) | 129 | void PwMView::keyReleaseEvent(QKeyEvent * /*e*/) |
130 | { | 130 | { |
131 | refreshCommentTextEdit(lv->currentItem()); | 131 | refreshCommentTextEdit(lv->currentItem()); |
132 | } | 132 | } |
133 | 133 | ||
134 | bool PwMView::getCurEntryIndex(unsigned int *index) | 134 | bool PwMView::getCurEntryIndex(unsigned int *index) |
135 | { | 135 | { |
136 | QListViewItem *current = lv->currentItem(); | 136 | QListViewItem *current = lv->currentItem(); |
137 | if (!current) | 137 | if (!current) |
138 | return false; | 138 | return false; |
139 | return getDocEntryIndex(index, current); | 139 | return getDocEntryIndex(index, current); |
140 | } | 140 | } |
141 | 141 | ||
142 | bool PwMView::getDocEntryIndex(unsigned int *index, | 142 | bool PwMView::getDocEntryIndex(unsigned int *index, |
143 | const QListViewItem *item) | 143 | const QListViewItem *item) |
144 | { | 144 | { |
145 | vector<unsigned int> foundPositions; | 145 | vector<unsigned int> foundPositions; |
146 | PwMDataItem curItem; | 146 | PwMDataItem curItem; |
147 | curItem.desc = item->text(COLUMN_DESC).latin1(); | 147 | curItem.desc = item->text(COLUMN_DESC).latin1(); |
148 | curItem.name = item->text(COLUMN_NAME).latin1(); | 148 | curItem.name = item->text(COLUMN_NAME).latin1(); |
149 | document()->getCommentByLvp(getCurrentCategory(), | 149 | document()->getCommentByLvp(getCurrentCategory(), |
150 | lv->childCount() - lv->itemIndex(item) - 1, | 150 | lv->childCount() - lv->itemIndex(item) - 1, |
151 | &curItem.comment); | 151 | &curItem.comment); |
152 | curItem.url = item->text(COLUMN_URL).latin1(); | 152 | curItem.url = item->text(COLUMN_URL).latin1(); |
153 | curItem.launcher = item->text(COLUMN_LAUNCHER).latin1(); | 153 | curItem.launcher = item->text(COLUMN_LAUNCHER).latin1(); |
154 | document()->findEntry(getCurrentCategory(), curItem, SEARCH_IN_DESC | | 154 | document()->findEntry(getCurrentCategory(), curItem, SEARCH_IN_DESC | |
155 | SEARCH_IN_NAME | SEARCH_IN_COMMENT | SEARCH_IN_URL | | 155 | SEARCH_IN_NAME | SEARCH_IN_COMMENT | SEARCH_IN_URL | |
156 | SEARCH_IN_LAUNCHER, | 156 | SEARCH_IN_LAUNCHER, |
157 | &foundPositions, true); | 157 | &foundPositions, true); |
158 | if (foundPositions.size()) { | 158 | if (foundPositions.size()) { |
159 | *index = foundPositions[0]; | 159 | *index = foundPositions[0]; |
160 | return true; | 160 | return true; |
161 | } | 161 | } |
162 | 162 | ||
163 | return false; | 163 | return false; |
164 | } | 164 | } |
165 | 165 | ||
166 | void PwMView::handleToggle(QListViewItem *item) | 166 | void PwMView::handleToggle(QListViewItem *item) |
167 | { | 167 | { |
168 | PWM_ASSERT(doc); | 168 | PWM_ASSERT(doc); |
169 | if (!item) | 169 | if (!item) |
170 | return; | 170 | return; |
171 | QCheckListItem *clItem = (QCheckListItem *)item; | 171 | QCheckListItem *clItem = (QCheckListItem *)item; |
172 | QString curCat(getCurrentCategory()); | 172 | QString curCat(getCurrentCategory()); |
173 | 173 | ||
174 | // find document position of this entry. | 174 | // find document position of this entry. |
175 | unsigned int curEntryDocIndex; | 175 | unsigned int curEntryDocIndex; |
176 | if (!getDocEntryIndex(&curEntryDocIndex, item)) | 176 | if (!getDocEntryIndex(&curEntryDocIndex, item)) |
177 | return; | 177 | return; |
178 | 178 | ||
179 | // hack to refresh the comment, if only one item is present | 179 | // hack to refresh the comment, if only one item is present |
180 | if (lv->childCount() == 1) | 180 | if (lv->childCount() == 1) |
181 | refreshCommentTextEdit(lv->currentItem()); | 181 | refreshCommentTextEdit(lv->currentItem()); |
182 | 182 | ||
183 | if (doc->isLocked(curCat, curEntryDocIndex) != clItem->isOn()) | 183 | if (doc->isLocked(curCat, curEntryDocIndex) != clItem->isOn()) |
184 | return; // this is just a click somewhere on the entry | 184 | return; // this is just a click somewhere on the entry |
185 | if (doc->isDeepLocked()) { | 185 | if (doc->isDeepLocked()) { |
186 | PwMerror ret; | 186 | PwMerror ret; |
187 | ret = doc->deepLock(false); | 187 | ret = doc->deepLock(false); |
188 | if (ret != e_success) | 188 | if (ret != e_success) |
189 | clItem->setOn(false); | 189 | clItem->setOn(false); |
190 | return; | 190 | return; |
191 | } | 191 | } |
192 | doc->lockAt(curCat, curEntryDocIndex, !clItem->isOn()); | 192 | doc->lockAt(curCat, curEntryDocIndex, !clItem->isOn()); |
193 | } | 193 | } |
194 | 194 | ||
195 | void PwMView::handleRightClick(QListViewItem *item, const QPoint &point, int) | 195 | void PwMView::handleRightClick(QListViewItem *item, const QPoint &point, int) |
196 | { | 196 | { |
197 | if (!item) | 197 | if (!item) |
198 | return; | 198 | return; |
199 | ctxMenu->move(point); | 199 | ctxMenu->move(point); |
200 | /* don't use ctxMenu->exec() here, as it generates race conditions | 200 | /* don't use ctxMenu->exec() here, as it generates race conditions |
201 | * with the card interface code. Believe it or not. :) | 201 | * with the card interface code. Believe it or not. :) |
202 | */ | 202 | */ |
203 | ctxMenu->show(); | 203 | ctxMenu->show(); |
204 | } | 204 | } |
205 | 205 | ||
206 | void PwMView::updateCategories() | 206 | void PwMView::updateCategories() |
207 | { | 207 | { |
208 | qDebug("PwMView::updateCategories() "); | 208 | //qDebug("PwMView::updateCategories() "); |
209 | QString oldSel(getCurrentCategory()); | 209 | QString oldSel(getCurrentCategory()); |
210 | delAllCategories(); | 210 | delAllCategories(); |
211 | QStringList catList; | 211 | QStringList catList; |
212 | document()->getCategoryList(&catList); | 212 | document()->getCategoryList(&catList); |
213 | catList.sort(); | 213 | catList.sort(); |
214 | #ifndef PWM_EMBEDDED | 214 | #ifndef PWM_EMBEDDED |
215 | QStringList::iterator i = catList.begin(), | 215 | QStringList::iterator i = catList.begin(), |
216 | end = catList.end(); | 216 | end = catList.end(); |
217 | #else | 217 | #else |
218 | QStringList::Iterator i = catList.begin(), | 218 | QStringList::Iterator i = catList.begin(), |
219 | end = catList.end(); | 219 | end = catList.end(); |
220 | #endif | 220 | #endif |
221 | while (i != end) { | 221 | while (i != end) { |
222 | addCategory(*i); | 222 | addCategory(*i); |
223 | ++i; | 223 | ++i; |
224 | } | 224 | } |
225 | selectCategory(oldSel); | 225 | selectCategory(oldSel); |
226 | } | 226 | } |
227 | 227 | ||
228 | void PwMView::shiftToView() | 228 | void PwMView::shiftToView() |
229 | { | 229 | { |
230 | int cX = lv->contentsX(); | 230 | int cX = lv->contentsX(); |
231 | int cY = lv->contentsY(); | 231 | int cY = lv->contentsY(); |
232 | commentBox->clear(); | 232 | commentBox->clear(); |
233 | 233 | ||
234 | unsigned int catDocIndex; | 234 | unsigned int catDocIndex; |
235 | if (unlikely( | 235 | if (unlikely( |
236 | !(document()->findCategory(getCurrentCategory(), | 236 | !(document()->findCategory(getCurrentCategory(), |
237 | &catDocIndex)))) { | 237 | &catDocIndex)))) { |
238 | BUG(); | 238 | BUG(); |
239 | } | 239 | } |
240 | 240 | ||
241 | // ensure all listViewPos are set | 241 | // ensure all listViewPos are set |
242 | doc->ensureLvp(); | 242 | doc->ensureLvp(); |
243 | 243 | ||
244 | // clear all tmp-data vectors | 244 | // clear all tmp-data vectors |
245 | unsigned int i, entries = doc->numEntries(catDocIndex); | 245 | unsigned int i, entries = doc->numEntries(catDocIndex); |
246 | if (entries) { | 246 | if (entries) { |
247 | mainClass->setVirgin(false); | 247 | mainClass->setVirgin(false); |
248 | } | 248 | } |
249 | vector<PwMDataItem> tmpSorted; | 249 | vector<PwMDataItem> tmpSorted; |
250 | PwMDataItem currItem; | 250 | PwMDataItem currItem; |
251 | currItem.clear(); | 251 | currItem.clear(); |
252 | tmpSorted.insert(tmpSorted.begin(), entries, currItem); | 252 | tmpSorted.insert(tmpSorted.begin(), entries, currItem); |
253 | 253 | ||
254 | // Sort items and store them in tempoary tmpSorted. | 254 | // Sort items and store them in tempoary tmpSorted. |
255 | for (i = 0; i < entries; ++i) { | 255 | for (i = 0; i < entries; ++i) { |
256 | doc->getEntry(catDocIndex, i, &currItem); | 256 | doc->getEntry(catDocIndex, i, &currItem); |
257 | //qDebug("PwMView::shiftToView: %s, %i", currItem.desc.c_str(), currItem.listViewPos); | 257 | //qDebug("PwMView::shiftToView: %s, %i", currItem.desc.c_str(), currItem.listViewPos); |
258 | tmpSorted[currItem.listViewPos] = currItem; | 258 | tmpSorted[currItem.listViewPos] = currItem; |
259 | } | 259 | } |
260 | 260 | ||
261 | // shift tempoary data to ListView. | 261 | // shift tempoary data to ListView. |
262 | tmpDisableSort(); | 262 | tmpDisableSort(); |
263 | lv->clear(); | 263 | lv->clear(); |
264 | 264 | ||
265 | //US ENH: adjust the headers of the table according the category texts | 265 | //US ENH: adjust the headers of the table according the category texts |
266 | { | 266 | { |
267 | PwMCategoryItem* catItem = doc->getCategoryEntry(catDocIndex); | 267 | PwMCategoryItem* catItem = doc->getCategoryEntry(catDocIndex); |
268 | // qDebug("PwMView::ShiftToView CAT: %i, %s", catDocIndex, catItem->name.c_str()); | 268 | // qDebug("PwMView::ShiftToView CAT: %i, %s", catDocIndex, catItem->name.c_str()); |
269 | lv->setColumnText(COLUMN_DESC, catItem->desc_text.c_str()); | 269 | lv->setColumnText(COLUMN_DESC, catItem->desc_text.c_str()); |
270 | lv->setColumnText(COLUMN_NAME, catItem->name_text.c_str()); | 270 | lv->setColumnText(COLUMN_NAME, catItem->name_text.c_str()); |
271 | lv->setColumnText(COLUMN_PW, catItem->pw_text.c_str()); | 271 | lv->setColumnText(COLUMN_PW, catItem->pw_text.c_str()); |
272 | } | 272 | } |
273 | 273 | ||
274 | QCheckListItem *newItem; | 274 | QCheckListItem *newItem; |
275 | vector<PwMDataItem>::iterator it = tmpSorted.begin(), | 275 | vector<PwMDataItem>::iterator it = tmpSorted.begin(), |
276 | end = tmpSorted.end(); | 276 | end = tmpSorted.end(); |
277 | while (it != end) { | 277 | while (it != end) { |
278 | newItem = new ListViewItemPwM(lv); | 278 | newItem = new ListViewItemPwM(lv); |
279 | newItem->setText(COLUMN_DESC, (*it).desc.c_str()); | 279 | newItem->setText(COLUMN_DESC, (*it).desc.c_str()); |
280 | if ((*it).binary) { | 280 | if ((*it).binary) { |
281 | newItem->setText(COLUMN_NAME, ""); | 281 | newItem->setText(COLUMN_NAME, ""); |
282 | newItem->setText(COLUMN_PW, i18n("<BINARY ENTRY>")); | 282 | newItem->setText(COLUMN_PW, i18n("<BINARY ENTRY>")); |
283 | newItem->setText(COLUMN_URL, ""); | 283 | newItem->setText(COLUMN_URL, ""); |
284 | newItem->setText(COLUMN_LAUNCHER, (*it).launcher.c_str()); | 284 | newItem->setText(COLUMN_LAUNCHER, (*it).launcher.c_str()); |
285 | } else { | 285 | } else { |
286 | newItem->setText(COLUMN_NAME, (*it).name.c_str()); | 286 | newItem->setText(COLUMN_NAME, (*it).name.c_str()); |
287 | if ((*it).lockStat) { | 287 | if ((*it).lockStat) { |
288 | newItem->setText(COLUMN_PW, QString((*it).pw.c_str()) | 288 | newItem->setText(COLUMN_PW, QString((*it).pw.c_str()) |
289 | + " " | 289 | + " " |
290 | + i18n("To unlock click the icon on the left.")); | 290 | + i18n("To unlock click the icon on the left.")); |
291 | } else { | 291 | } else { |
292 | newItem->setText(COLUMN_PW, (*it).pw.c_str()); | 292 | newItem->setText(COLUMN_PW, (*it).pw.c_str()); |
293 | } | 293 | } |
294 | newItem->setText(COLUMN_URL, (*it).url.c_str()); | 294 | newItem->setText(COLUMN_URL, (*it).url.c_str()); |
295 | newItem->setText(COLUMN_LAUNCHER, (*it).launcher.c_str()); | 295 | newItem->setText(COLUMN_LAUNCHER, (*it).launcher.c_str()); |
296 | } | 296 | } |
297 | newItem->setOn(!((*it).lockStat)); | 297 | newItem->setOn(!((*it).lockStat)); |
298 | lv->insertItem(newItem); | 298 | lv->insertItem(newItem); |
299 | ++it; | 299 | ++it; |
300 | } | 300 | } |
301 | tmpReEnableSort(); | 301 | tmpReEnableSort(); |
302 | 302 | ||
303 | if (cY || cX) | 303 | if (cY || cX) |
304 | lv->setContentsPos(cX, cY); | 304 | lv->setContentsPos(cX, cY); |
305 | } | 305 | } |
306 | 306 | ||
307 | void PwMView::reorgLp() | 307 | void PwMView::reorgLp() |
308 | { | 308 | { |
309 | if (!lv->childCount()) | 309 | if (!lv->childCount()) |
310 | return; | 310 | return; |
311 | PWM_ASSERT(doc); | 311 | PWM_ASSERT(doc); |
312 | PWM_ASSERT(!doc->isDocEmpty()); | 312 | PWM_ASSERT(!doc->isDocEmpty()); |
313 | QListViewItem *currItem; | 313 | QListViewItem *currItem; |
314 | vector<unsigned int> foundPos; | 314 | vector<unsigned int> foundPos; |
315 | /* This searchIn _should_ be: | 315 | /* This searchIn _should_ be: |
316 | *const unsigned int searchIn = SEARCH_IN_DESC; | 316 | *const unsigned int searchIn = SEARCH_IN_DESC; |
317 | * But we want backward compatibility (see comment in PwMDoc::addEntry()). | 317 | * But we want backward compatibility (see comment in PwMDoc::addEntry()). |
318 | * So we need to search again, if we don't find the entry. (see below) | 318 | * So we need to search again, if we don't find the entry. (see below) |
319 | */ | 319 | */ |
320 | const unsigned int searchIn = SEARCH_IN_DESC | SEARCH_IN_NAME | | 320 | const unsigned int searchIn = SEARCH_IN_DESC | SEARCH_IN_NAME | |
321 | SEARCH_IN_URL | SEARCH_IN_LAUNCHER; | 321 | SEARCH_IN_URL | SEARCH_IN_LAUNCHER; |
322 | QString curCat(getCurrentCategory()); | 322 | QString curCat(getCurrentCategory()); |
323 | PwMDataItem findThis; | 323 | PwMDataItem findThis; |
324 | unsigned int i, cnt = lv->childCount(); | 324 | unsigned int i, cnt = lv->childCount(); |
325 | for (i = 0; i < cnt; ++i) { | 325 | for (i = 0; i < cnt; ++i) { |
326 | currItem = lv->itemAtIndex(i); | 326 | currItem = lv->itemAtIndex(i); |
327 | findThis.desc = currItem->text(COLUMN_DESC).latin1(); | 327 | findThis.desc = currItem->text(COLUMN_DESC).latin1(); |
328 | findThis.name = currItem->text(COLUMN_NAME).latin1(); | 328 | findThis.name = currItem->text(COLUMN_NAME).latin1(); |
329 | findThis.url = currItem->text(COLUMN_URL).latin1(); | 329 | findThis.url = currItem->text(COLUMN_URL).latin1(); |
330 | findThis.launcher = currItem->text(COLUMN_LAUNCHER).latin1(); | 330 | findThis.launcher = currItem->text(COLUMN_LAUNCHER).latin1(); |
331 | doc->findEntry(curCat, findThis, searchIn, | 331 | doc->findEntry(curCat, findThis, searchIn, |
332 | &foundPos, true); | 332 | &foundPos, true); |
333 | if (!foundPos.size()) { | 333 | if (!foundPos.size()) { |
334 | /* Did not find the entry. We seem to have a binary | 334 | /* Did not find the entry. We seem to have a binary |
335 | * entry here (pray for it!). So search again with | 335 | * entry here (pray for it!). So search again with |
336 | * the "correct" searchIn flags. | 336 | * the "correct" searchIn flags. |
337 | */ | 337 | */ |
338 | const unsigned int searchIn2 = SEARCH_IN_DESC; | 338 | const unsigned int searchIn2 = SEARCH_IN_DESC; |
339 | doc->findEntry(curCat, findThis, searchIn2, | 339 | doc->findEntry(curCat, findThis, searchIn2, |
340 | &foundPos, true); | 340 | &foundPos, true); |
341 | if (unlikely(!foundPos.size())) { | 341 | if (unlikely(!foundPos.size())) { |
342 | BUG(); | 342 | BUG(); |
343 | continue; | 343 | continue; |
344 | } | 344 | } |
345 | /* We assert that it's a binary entry, now. | 345 | /* We assert that it's a binary entry, now. |
346 | * No chance to efficiently verify it here. | 346 | * No chance to efficiently verify it here. |
347 | */ | 347 | */ |
348 | } | 348 | } |
349 | doc->setListViewPos(curCat, foundPos[0], cnt - i - 1); | 349 | doc->setListViewPos(curCat, foundPos[0], cnt - i - 1); |
350 | } | 350 | } |
351 | } | 351 | } |
352 | 352 | ||
353 | void PwMView::selAt(int index) | 353 | void PwMView::selAt(int index) |
354 | { | 354 | { |
355 | QListViewItem *item = lv->itemAtIndex(index); | 355 | QListViewItem *item = lv->itemAtIndex(index); |
356 | if (!item) | 356 | if (!item) |
357 | return; | 357 | return; |
358 | lv->setCurrentItem(item); | 358 | lv->setCurrentItem(item); |
359 | lv->ensureItemVisible(item); | 359 | lv->ensureItemVisible(item); |
360 | } | 360 | } |
361 | 361 | ||
362 | void PwMView::renCatButton_slot() | 362 | void PwMView::renCatButton_slot() |
363 | { | 363 | { |
364 | if (doc->isDeepLocked()) | 364 | if (doc->isDeepLocked()) |
365 | return; | 365 | return; |
366 | RenCatWnd wnd(this); | 366 | RenCatWnd wnd(this); |
367 | if (wnd.exec() == 1) { | 367 | if (wnd.exec() == 1) { |
368 | QString newName(wnd.getNewName()); | 368 | QString newName(wnd.getNewName()); |
369 | if (newName == "") | 369 | if (newName == "") |
370 | return; | 370 | return; |
371 | document()->renameCategory(getCurrentCategory(), | 371 | document()->renameCategory(getCurrentCategory(), |
372 | newName); | 372 | newName); |
373 | } | 373 | } |
374 | } | 374 | } |
375 | 375 | ||
376 | void PwMView::delCatButton_slot() | 376 | void PwMView::delCatButton_slot() |
377 | { | 377 | { |
378 | if (doc->isDeepLocked()) | 378 | if (doc->isDeepLocked()) |
379 | return; | 379 | return; |
380 | if (numCategories() <= 1) { | 380 | if (numCategories() <= 1) { |
381 | mainClass->showStatMsg(i18n("Can't remove the last category.")); | 381 | mainClass->showStatMsg(i18n("Can't remove the last category.")); |
382 | return; | 382 | return; |
383 | } | 383 | } |
384 | if (KMessageBox::questionYesNo(this, | 384 | if (KMessageBox::questionYesNo(this, |
385 | i18n("Do you really want to\n" | 385 | i18n("Do you really want to\n" |
386 | "delete the selected\n" | 386 | "delete the selected\n" |
387 | "category? All password-\n" | 387 | "category? All password-\n" |
388 | "entries will be lost in\n" | 388 | "entries will be lost in\n" |
389 | "this category!\n"), | 389 | "this category!\n"), |
390 | i18n("Delete category?")) | 390 | i18n("Delete category?")) |
391 | == KMessageBox::No) { | 391 | == KMessageBox::No) { |
392 | return; | 392 | return; |
393 | } | 393 | } |
394 | document()->delCategory(getCurrentCategory()); | 394 | document()->delCategory(getCurrentCategory()); |
395 | } | 395 | } |
396 | 396 | ||
397 | void PwMView::copyPwToClip() | 397 | void PwMView::copyPwToClip() |
398 | { | 398 | { |
399 | if (doc->isDeepLocked()) | 399 | if (doc->isDeepLocked()) |
400 | return; | 400 | return; |
401 | unsigned int curIndex = 0; | 401 | unsigned int curIndex = 0; |
402 | if (!getCurEntryIndex(&curIndex)) | 402 | if (!getCurEntryIndex(&curIndex)) |
403 | return; | 403 | return; |
404 | PwMDataItem d; | 404 | PwMDataItem d; |
405 | document()->getDataChangedLock(); | 405 | document()->getDataChangedLock(); |
406 | document()->getEntry(getCurrentCategory(), curIndex, &d, true); | 406 | document()->getEntry(getCurrentCategory(), curIndex, &d, true); |
407 | document()->putDataChangedLock(); | 407 | document()->putDataChangedLock(); |
408 | PwM::copyToClipboard(d.pw.c_str()); | 408 | PwM::copyToClipboard(d.pw.c_str()); |
409 | } | 409 | } |
410 | 410 | ||
411 | void PwMView::copyNameToClip() | 411 | void PwMView::copyNameToClip() |
412 | { | 412 | { |
413 | if (doc->isDeepLocked()) | 413 | if (doc->isDeepLocked()) |
414 | return; | 414 | return; |
415 | unsigned int curIndex = 0; | 415 | unsigned int curIndex = 0; |
416 | if (!getCurEntryIndex(&curIndex)) | 416 | if (!getCurEntryIndex(&curIndex)) |
417 | return; | 417 | return; |
418 | PwMDataItem d; | 418 | PwMDataItem d; |
419 | document()->getEntry(getCurrentCategory(), curIndex, &d); | 419 | document()->getEntry(getCurrentCategory(), curIndex, &d); |
420 | PwM::copyToClipboard(d.name.c_str()); | 420 | PwM::copyToClipboard(d.name.c_str()); |
421 | } | 421 | } |
422 | 422 | ||
423 | void PwMView::copyDescToClip() | 423 | void PwMView::copyDescToClip() |
424 | { | 424 | { |
425 | if (doc->isDeepLocked()) | 425 | if (doc->isDeepLocked()) |
426 | return; | 426 | return; |
427 | unsigned int curIndex = 0; | 427 | unsigned int curIndex = 0; |
428 | if (!getCurEntryIndex(&curIndex)) | 428 | if (!getCurEntryIndex(&curIndex)) |
429 | return; | 429 | return; |
430 | PwMDataItem d; | 430 | PwMDataItem d; |
431 | document()->getEntry(getCurrentCategory(), curIndex, &d); | 431 | document()->getEntry(getCurrentCategory(), curIndex, &d); |
432 | PwM::copyToClipboard(d.desc.c_str()); | 432 | PwM::copyToClipboard(d.desc.c_str()); |
433 | } | 433 | } |
434 | 434 | ||
435 | void PwMView::copyUrlToClip() | 435 | void PwMView::copyUrlToClip() |
436 | { | 436 | { |
437 | if (doc->isDeepLocked()) | 437 | if (doc->isDeepLocked()) |
438 | return; | 438 | return; |
439 | unsigned int curIndex = 0; | 439 | unsigned int curIndex = 0; |
440 | if (!getCurEntryIndex(&curIndex)) | 440 | if (!getCurEntryIndex(&curIndex)) |
441 | return; | 441 | return; |
442 | PwMDataItem d; | 442 | PwMDataItem d; |
443 | document()->getEntry(getCurrentCategory(), curIndex, &d); | 443 | document()->getEntry(getCurrentCategory(), curIndex, &d); |
444 | PwM::copyToClipboard(d.url.c_str()); | 444 | PwM::copyToClipboard(d.url.c_str()); |
445 | } | 445 | } |
446 | 446 | ||
447 | void PwMView::copyLauncherToClip() | 447 | void PwMView::copyLauncherToClip() |
448 | { | 448 | { |
449 | if (doc->isDeepLocked()) | 449 | if (doc->isDeepLocked()) |
450 | return; | 450 | return; |
451 | unsigned int curIndex = 0; | 451 | unsigned int curIndex = 0; |
452 | if (!getCurEntryIndex(&curIndex)) | 452 | if (!getCurEntryIndex(&curIndex)) |
453 | return; | 453 | return; |
454 | PwMDataItem d; | 454 | PwMDataItem d; |
455 | document()->getEntry(getCurrentCategory(), curIndex, &d); | 455 | document()->getEntry(getCurrentCategory(), curIndex, &d); |
456 | PwM::copyToClipboard(d.launcher.c_str()); | 456 | PwM::copyToClipboard(d.launcher.c_str()); |
457 | } | 457 | } |
458 | 458 | ||
459 | void PwMView::copyCommentToClip() | 459 | void PwMView::copyCommentToClip() |
460 | { | 460 | { |
461 | if (doc->isDeepLocked()) | 461 | if (doc->isDeepLocked()) |
462 | return; | 462 | return; |
463 | unsigned int curIndex = 0; | 463 | unsigned int curIndex = 0; |
464 | if (!getCurEntryIndex(&curIndex)) | 464 | if (!getCurEntryIndex(&curIndex)) |
465 | return; | 465 | return; |
466 | PwMDataItem d; | 466 | PwMDataItem d; |
467 | document()->getEntry(getCurrentCategory(), curIndex, &d); | 467 | document()->getEntry(getCurrentCategory(), curIndex, &d); |
468 | PwM::copyToClipboard(d.comment.c_str()); | 468 | PwM::copyToClipboard(d.comment.c_str()); |
469 | } | 469 | } |
470 | 470 | ||
471 | /************************************************************************ | 471 | /************************************************************************ |
472 | * | 472 | * |
473 | * | 473 | * |
474 | * | 474 | * |
475 | ************************************************************************/ | 475 | ************************************************************************/ |
476 | 476 | ||
477 | 477 | ||
478 | PwMDataItemView::PwMDataItemView( QWidget *parent, const char *name ) | 478 | PwMDataItemView::PwMDataItemView( QWidget *parent, const char *name ) |
479 | : QTextBrowser( parent, name ) | 479 | : QTextBrowser( parent, name ) |
480 | 480 | ||
481 | 481 | ||
482 | { | 482 | { |
483 | //US setWrapPolicy( QTextEdit::AtWordBoundary ); | 483 | //US setWrapPolicy( QTextEdit::AtWordBoundary ); |
484 | setLinkUnderline( false ); | 484 | setLinkUnderline( false ); |
485 | // setVScrollBarMode( QScrollView::AlwaysOff ); | 485 | // setVScrollBarMode( QScrollView::AlwaysOff ); |
486 | //setHScrollBarMode( QScrollView::AlwaysOff ); | 486 | //setHScrollBarMode( QScrollView::AlwaysOff ); |
487 | 487 | ||
488 | //US QStyleSheet *sheet = styleSheet(); | 488 | //US QStyleSheet *sheet = styleSheet(); |
489 | //US QStyleSheetItem *link = sheet->item( "a" ); | 489 | //US QStyleSheetItem *link = sheet->item( "a" ); |
490 | //US link->setColor( KGlobalSettings::linkColor() ); | 490 | //US link->setColor( KGlobalSettings::linkColor() ); |
491 | 491 | ||
492 | } | 492 | } |
493 | 493 | ||
494 | void PwMDataItemView::setPwMDataItem( const PwMDataItem& a ) | 494 | void PwMDataItemView::setPwMDataItem( const PwMDataItem& a ) |
495 | 495 | ||
496 | { | 496 | { |
497 | mItem = a; | 497 | mItem = a; |
498 | // clear view | 498 | // clear view |
499 | setText( QString::null ); | 499 | setText( QString::null ); |
500 | 500 | ||
501 | 501 | ||
502 | QString dynamicPart; | 502 | QString dynamicPart; |
503 | QString format = "<tr><td align=\"right\"><b>%1</b></td>" | 503 | QString format = "<tr><td align=\"right\"><b>%1</b></td>" |
504 | "<td align=\"left\">%2</td></tr>"; | 504 | "<td align=\"left\">%2</td></tr>"; |
505 | 505 | ||
506 | dynamicPart += format | 506 | dynamicPart += format |
507 | .arg( i18n("LastUpdate") ) | 507 | .arg( i18n("LastUpdate") ) |
508 | .arg( mItem.meta.update.toString().latin1() ); | 508 | .arg( mItem.meta.update.toString().latin1() ); |
509 | 509 | ||
510 | dynamicPart += format | 510 | dynamicPart += format |
511 | .arg( i18n("Description") ) | 511 | .arg( i18n("Description") ) |
512 | .arg( mItem.desc.c_str() ); | 512 | .arg( mItem.desc.c_str() ); |
513 | 513 | ||
514 | dynamicPart += format | 514 | dynamicPart += format |
515 | .arg( i18n("Name") ) | 515 | .arg( i18n("Name") ) |
516 | .arg( mItem.name.c_str() ); | 516 | .arg( mItem.name.c_str() ); |
517 | 517 | ||
518 | dynamicPart += format | 518 | dynamicPart += format |
519 | .arg( i18n("Password") ) | 519 | .arg( i18n("Password") ) |
520 | .arg( mItem.pw.c_str() ); | 520 | .arg( mItem.pw.c_str() ); |
521 | 521 | ||
522 | QString comment(mItem.pw.c_str()); | 522 | QString comment(mItem.pw.c_str()); |
523 | dynamicPart += format | 523 | dynamicPart += format |
524 | .arg( i18n("Comment") ) | 524 | .arg( i18n("Comment") ) |
525 | .arg( comment.replace( QRegExp("\n"), "<br>" ) ); | 525 | .arg( comment.replace( QRegExp("\n"), "<br>" ) ); |
526 | 526 | ||
527 | dynamicPart += format | 527 | dynamicPart += format |
528 | .arg( i18n("URL") ) | 528 | .arg( i18n("URL") ) |
529 | .arg( mItem.url.c_str() ); | 529 | .arg( mItem.url.c_str() ); |
530 | 530 | ||
531 | dynamicPart += format | 531 | dynamicPart += format |
532 | .arg( i18n("Launcher") ) | 532 | .arg( i18n("Launcher") ) |
533 | .arg( mItem.launcher.c_str() ); | 533 | .arg( mItem.launcher.c_str() ); |
534 | 534 | ||
535 | QString mText = "<table><td colspan=\"2\"> </td>"; | 535 | QString mText = "<table><td colspan=\"2\"> </td>"; |
536 | 536 | ||
537 | mText += dynamicPart; | 537 | mText += dynamicPart; |
538 | mText += "</table>"; | 538 | mText += "</table>"; |
539 | 539 | ||
540 | // at last display it... | 540 | // at last display it... |
541 | setText( mText ); | 541 | setText( mText ); |
542 | 542 | ||
543 | } | 543 | } |
544 | 544 | ||
545 | PwMDataItem PwMDataItemView::pwmdataitem() const | 545 | PwMDataItem PwMDataItemView::pwmdataitem() const |
546 | { | 546 | { |
547 | return mItem; | 547 | return mItem; |
548 | } | 548 | } |
549 | 549 | ||
550 | /************************************************************************ | 550 | /************************************************************************ |
551 | * | 551 | * |
552 | * | 552 | * |
553 | * | 553 | * |
554 | ************************************************************************/ | 554 | ************************************************************************/ |
555 | 555 | ||
556 | 556 | ||
557 | PwMDataItemChooser::PwMDataItemChooser( PwMDataItem loc, PwMDataItem rem, bool takeloc, QWidget *parent, const char *name ) | 557 | PwMDataItemChooser::PwMDataItemChooser( PwMDataItem loc, PwMDataItem rem, bool takeloc, QWidget *parent, const char *name ) |
558 | : KDialogBase(parent, name, true , | 558 | : KDialogBase(parent, name, true , |
559 | i18n("Conflict! Please choose Entry!"),Ok|User1|Close,Close, false) | 559 | i18n("Conflict! Please choose Entry!"),Ok|User1|Close,Close, false) |
560 | { | 560 | { |
561 | findButton( Close )->setText( i18n("Cancel Sync")); | 561 | findButton( Close )->setText( i18n("Cancel Sync")); |
562 | findButton( Ok )->setText( i18n("Remote")); | 562 | findButton( Ok )->setText( i18n("Remote")); |
563 | findButton( User1 )->setText( i18n("Local")); | 563 | findButton( User1 )->setText( i18n("Local")); |
564 | QWidget* topframe = new QWidget( this ); | 564 | QWidget* topframe = new QWidget( this ); |
565 | setMainWidget( topframe ); | 565 | setMainWidget( topframe ); |
566 | QBoxLayout* bl; | 566 | QBoxLayout* bl; |
567 | if ( QApplication::desktop()->width() < 640 ) { | 567 | if ( QApplication::desktop()->width() < 640 ) { |
568 | bl = new QVBoxLayout( topframe ); | 568 | bl = new QVBoxLayout( topframe ); |
569 | } else { | 569 | } else { |
570 | bl = new QHBoxLayout( topframe ); | 570 | bl = new QHBoxLayout( topframe ); |
571 | } | 571 | } |
572 | QVBox* subframe = new QVBox( topframe ); | 572 | QVBox* subframe = new QVBox( topframe ); |
573 | bl->addWidget(subframe ); | 573 | bl->addWidget(subframe ); |
574 | QLabel* lab = new QLabel( i18n("Local Entry"), subframe ); | 574 | QLabel* lab = new QLabel( i18n("Local Entry"), subframe ); |
575 | if ( takeloc ) | 575 | if ( takeloc ) |
576 | lab->setBackgroundColor(Qt::green.light() ); | 576 | lab->setBackgroundColor(Qt::green.light() ); |
577 | PwMDataItemView * av = new PwMDataItemView( subframe ); | 577 | PwMDataItemView * av = new PwMDataItemView( subframe ); |
578 | av->setPwMDataItem( loc ); | 578 | av->setPwMDataItem( loc ); |
579 | subframe = new QVBox( topframe ); | 579 | subframe = new QVBox( topframe ); |
580 | bl->addWidget(subframe ); | 580 | bl->addWidget(subframe ); |
581 | lab = new QLabel( i18n("Remote Entry"), subframe ); | 581 | lab = new QLabel( i18n("Remote Entry"), subframe ); |
582 | if ( !takeloc ) | 582 | if ( !takeloc ) |
583 | lab->setBackgroundColor(Qt::green.light() ); | 583 | lab->setBackgroundColor(Qt::green.light() ); |
584 | av = new PwMDataItemView( subframe ); | 584 | av = new PwMDataItemView( subframe ); |
585 | av->setPwMDataItem( rem ); | 585 | av->setPwMDataItem( rem ); |
586 | QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); | 586 | QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); |
587 | QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); | 587 | QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); |
588 | #ifndef DESKTOP_VERSION | 588 | #ifndef DESKTOP_VERSION |
589 | showMaximized(); | 589 | showMaximized(); |
590 | #else | 590 | #else |
591 | resize ( 640, 400 ); | 591 | resize ( 640, 400 ); |
592 | #endif | 592 | #endif |
593 | } | 593 | } |
594 | 594 | ||
595 | int PwMDataItemChooser::executeD( bool local ) | 595 | int PwMDataItemChooser::executeD( bool local ) |
596 | { | 596 | { |
597 | mSyncResult = 3; | 597 | mSyncResult = 3; |
598 | if ( local ) | 598 | if ( local ) |
599 | findButton( User1 )->setFocus(); | 599 | findButton( User1 )->setFocus(); |
600 | else | 600 | else |
601 | findButton( Ok )->setFocus(); | 601 | findButton( Ok )->setFocus(); |
602 | exec(); | 602 | exec(); |
603 | return mSyncResult; | 603 | return mSyncResult; |
604 | } | 604 | } |
605 | void PwMDataItemChooser::slot_remote() | 605 | void PwMDataItemChooser::slot_remote() |
606 | { | 606 | { |
607 | mSyncResult = 2; | 607 | mSyncResult = 2; |
608 | accept(); | 608 | accept(); |
609 | } | 609 | } |
610 | void PwMDataItemChooser::slot_local() | 610 | void PwMDataItemChooser::slot_local() |
611 | { | 611 | { |
612 | mSyncResult = 1; | 612 | mSyncResult = 1; |
613 | accept(); | 613 | accept(); |
614 | } | 614 | } |
615 | 615 | ||
616 | 616 | ||
617 | 617 | ||
618 | #ifndef PWM_EMBEDDED | 618 | #ifndef PWM_EMBEDDED |
619 | #include "pwmview.moc" | 619 | #include "pwmview.moc" |
620 | #endif | 620 | #endif |