author | zautrix <zautrix> | 2005-08-17 14:48:16 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-17 14:48:16 (UTC) |
commit | 9e6d1f7f45ef1444dc6ee96347a2dbd67a0d79dd (patch) (unidiff) | |
tree | 4db3dfc9b67b56f415a9aab4306cc6375c6e7310 | |
parent | cb4e02944327194bc6066c4ec96826afc0ea178f (diff) | |
download | kdepimpi-9e6d1f7f45ef1444dc6ee96347a2dbd67a0d79dd.zip kdepimpi-9e6d1f7f45ef1444dc6ee96347a2dbd67a0d79dd.tar.gz kdepimpi-9e6d1f7f45ef1444dc6ee96347a2dbd67a0d79dd.tar.bz2 |
kapi dlete conf
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 3 | ||||
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 6 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 20 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 1 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 1 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 1 |
7 files changed, 36 insertions, 2 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 59ef12f..2e5cf50 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,24 +1,27 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.2.1 ************ | 3 | ********** VERSION 2.2.1 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Fixed a problem displaying very long allday events in agenda view in single day mode. | 6 | Fixed a problem displaying very long allday events in agenda view in single day mode. |
7 | 7 | ||
8 | KA/Pi: | ||
9 | Added a config option to turn on asking before a contact is deleted. | ||
10 | |||
8 | ********** VERSION 2.2.0 ************ | 11 | ********** VERSION 2.2.0 ************ |
9 | 12 | ||
10 | New stable release! | 13 | New stable release! |
11 | Fixed some minor usability problems. | 14 | Fixed some minor usability problems. |
12 | Added writing of next alarm to a file for usage on pdaXrom. | 15 | Added writing of next alarm to a file for usage on pdaXrom. |
13 | 16 | ||
14 | 17 | ||
15 | ************************************* | 18 | ************************************* |
16 | 19 | ||
17 | You can find the complete changelog | 20 | You can find the complete changelog |
18 | from version 1.7.7 to 2.2.0 | 21 | from version 1.7.7 to 2.2.0 |
19 | in the source package or on | 22 | in the source package or on |
20 | 23 | ||
21 | http://www.pi-sync.net/html/changelog.html | 24 | http://www.pi-sync.net/html/changelog.html |
22 | 25 | ||
23 | 26 | ||
24 | 27 | ||
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index e874b85..f369169 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -619,197 +619,203 @@ | |||
619 | { "Setting categories completed!","Setzen der Kategorien beendet!" }, | 619 | { "Setting categories completed!","Setzen der Kategorien beendet!" }, |
620 | { "OK","OK" }, | 620 | { "OK","OK" }, |
621 | { "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." }, | 621 | { "Please wait, processing categories...","Bitte warten, bearbeite Kategorien..." }, |
622 | { "Processing contact #%1","Bearbeite Kontakt #%1" }, | 622 | { "Processing contact #%1","Bearbeite Kontakt #%1" }, |
623 | { " categories added to list! "," Kategorien zur Liste hinzugefügt! " }, | 623 | { " categories added to list! "," Kategorien zur Liste hinzugefügt! " }, |
624 | { "%1: %2","%1: %2" }, | 624 | { "%1: %2","%1: %2" }, |
625 | { "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" }, | 625 | { "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n","Ihr persönlicher Kontakt ist\nnicht gesetzt! Bitte selektieren Sie\nihn und setzen ihn mit Menu:\nKonfiguration - Setze wer bin ich\n" }, |
626 | { "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" }, | 626 | { "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>","<qt>Wollen Sie wirklich<br><b>%1</b><br>als persönlichen Kontakt setzent?</qt>" }, |
627 | { "Cut","Ausschneiden" }, | 627 | { "Cut","Ausschneiden" }, |
628 | { "Paste","Einfügen" }, | 628 | { "Paste","Einfügen" }, |
629 | { "Delete","Löschen" }, | 629 | { "Delete","Löschen" }, |
630 | { "Choose...","Wähle..." }, | 630 | { "Choose...","Wähle..." }, |
631 | { "Add View","Ansicht hinzufügen" }, | 631 | { "Add View","Ansicht hinzufügen" }, |
632 | { "View name:","Ansicht Name:" }, | 632 | { "View name:","Ansicht Name:" }, |
633 | { "View Type","Typ der Ansicht" }, | 633 | { "View Type","Typ der Ansicht" }, |
634 | { "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." }, | 634 | { "Icons represent contacts. Very simple view.","Icons repräsentieren Kontakte. Sehr einfache Ansicht." }, |
635 | { "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." }, | 635 | { "A listing of contacts in a table. Each cell of the table holds a field of the contact.","Eine Kontaktliste in einer Tabelle." }, |
636 | { "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." }, | 636 | { "Rolodex style cards represent contacts.","Rolodex Stil Karten repräsentieren Kontakte." }, |
637 | { "Draw &separators","Zeichne &Trennlinie" }, | 637 | { "Draw &separators","Zeichne &Trennlinie" }, |
638 | { "Separator &width:","Trennlinien &Breite:" }, | 638 | { "Separator &width:","Trennlinien &Breite:" }, |
639 | { "&Padding:","Füllung:" }, | 639 | { "&Padding:","Füllung:" }, |
640 | { "Cards","Karten" }, | 640 | { "Cards","Karten" }, |
641 | { "&Margin:","&Rand:" }, | 641 | { "&Margin:","&Rand:" }, |
642 | { "Draw &borders","Zeichne Ränder" }, | 642 | { "Draw &borders","Zeichne Ränder" }, |
643 | { "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data.","The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data." }, | 643 | { "The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data.","The item margin is the distance (in pixels) between the item edge and the item data. Most noticeably, incrementing the item margin will add space between the focus rectangle and the item data." }, |
644 | { "The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators.","The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators." }, | 644 | { "The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators.","The Item Spacing decides the distance (in pixels) between the items and anything else: the view borders, other items or column separators." }, |
645 | { "Sets the width of column separators","Sets the width of column separators" }, | 645 | { "Sets the width of column separators","Sets the width of column separators" }, |
646 | { "&Layout","&Layout" }, | 646 | { "&Layout","&Layout" }, |
647 | { "Show &empty fields","Zeige leere Felder" }, | 647 | { "Show &empty fields","Zeige leere Felder" }, |
648 | { "Show field &labels","Zeige Feld Label" }, | 648 | { "Show field &labels","Zeige Feld Label" }, |
649 | { "Be&havior","Ver&halten" }, | 649 | { "Be&havior","Ver&halten" }, |
650 | { "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" }, | 650 | { "Header, Border and Separator Color","Kopf, Rand und Trennlinien Farbe" }, |
651 | { "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>","<qt>Sind Sie sicher, dass Sie die Ansicht <b>%1</b> löschen möchten?</qt>" }, | 651 | { "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>","<qt>Sind Sie sicher, dass Sie die Ansicht <b>%1</b> löschen möchten?</qt>" }, |
652 | { "Confirm Delete","Bestätige Löschen" }, | 652 | { "Confirm Delete","Bestätige Löschen" }, |
653 | { "Edit Address Book Filter","Editiere Adressbuch Filter" }, | 653 | { "Edit Address Book Filter","Editiere Adressbuch Filter" }, |
654 | { "Category rule","Kategorie Regel" }, | 654 | { "Category rule","Kategorie Regel" }, |
655 | { "Include categories","Inklusive" }, | 655 | { "Include categories","Inklusive" }, |
656 | { "Exclude categories","Exclusive" }, | 656 | { "Exclude categories","Exclusive" }, |
657 | { "Include contacts, that are:","Schließe folgende Kontakte ein:" }, | 657 | { "Include contacts, that are:","Schließe folgende Kontakte ein:" }, |
658 | { "public","Öffentlich" }, | 658 | { "public","Öffentlich" }, |
659 | { "private","Privat" }, | 659 | { "private","Privat" }, |
660 | { "confidential","Vertraulich" }, | 660 | { "confidential","Vertraulich" }, |
661 | { "Configure Resources","Konfiguriere Resourcen" }, | 661 | { "Configure Resources","Konfiguriere Resourcen" }, |
662 | { "Resource Configuration","Resource Konfiguration" }, | 662 | { "Resource Configuration","Resource Konfiguration" }, |
663 | { "Resources","Resourcen" }, | 663 | { "Resources","Resourcen" }, |
664 | { "Standard","Standard" }, | 664 | { "Standard","Standard" }, |
665 | { "&Use as Standard","Setze als Standard" }, | 665 | { "&Use as Standard","Setze als Standard" }, |
666 | { "Select type of the new resource:","Selektiere Typ der neuen Resource:" }, | 666 | { "Select type of the new resource:","Selektiere Typ der neuen Resource:" }, |
667 | { "General Settings","Allgemeine Einstellungen" }, | 667 | { "General Settings","Allgemeine Einstellungen" }, |
668 | { "Read-only","Nur-Lesen" }, | 668 | { "Read-only","Nur-Lesen" }, |
669 | { "Include in sync","Schließe in Sync mit ein" }, | 669 | { "Include in sync","Schließe in Sync mit ein" }, |
670 | { "%1 Resource Settings","%1 Resource Einstellungen" }, | 670 | { "%1 Resource Settings","%1 Resource Einstellungen" }, |
671 | { "Format:","Format:" }, | 671 | { "Format:","Format:" }, |
672 | { "Location:","Ort:" }, | 672 | { "Location:","Ort:" }, |
673 | { "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" }, | 673 | { "Full Menu bar (restart)","Volle Menu Leiste (Neustart!)" }, |
674 | { "Language","Sprache" }, | 674 | { "Language","Sprache" }, |
675 | { "Time Format","Zeit Format" }, | 675 | { "Time Format","Zeit Format" }, |
676 | { "Time Zone","Zeit Zone" }, | 676 | { "Time Zone","Zeit Zone" }, |
677 | { "Data storage path","Daten Speicherpfad" }, | 677 | { "Data storage path","Daten Speicherpfad" }, |
678 | { "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" }, | 678 | { "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" }, |
679 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, | 679 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, |
680 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, | 680 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, |
681 | { "Save settings","Speichere Einstellungen" }, | 681 | { "Save settings","Speichere Einstellungen" }, |
682 | { "Save standard","Speichere Standard" }, | 682 | { "Save standard","Speichere Standard" }, |
683 | { "Save","Speichern" }, | 683 | { "Save","Speichern" }, |
684 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 684 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
685 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, | 685 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, |
686 | { "Multiple Sync options","Multi Sync Optionen" }, | 686 | { "Multiple Sync options","Multi Sync Optionen" }, |
687 | { "Sync algo options","Sync Ablauf Optionen" }, | 687 | { "Sync algo options","Sync Ablauf Optionen" }, |
688 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, | 688 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, |
689 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, | 689 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, |
690 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, | 690 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, |
691 | { "Write back options","Optionen zum Zurückschreiben" }, | 691 | { "Write back options","Optionen zum Zurückschreiben" }, |
692 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, | 692 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, |
693 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, | 693 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, |
694 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, | 694 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, |
695 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, | 695 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, |
696 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, | 696 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, |
697 | { "Time period","Zeitspanne" }, | 697 | { "Time period","Zeitspanne" }, |
698 | { "From ","Von " }, | 698 | { "From ","Von " }, |
699 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, | 699 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, |
700 | { " weeks in the future "," Wochen in der Zukunft " }, | 700 | { " weeks in the future "," Wochen in der Zukunft " }, |
701 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, | 701 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, |
702 | { "Local temp file:","Lokale temp Datei:" }, | 702 | { "Local temp file:","Lokale temp Datei:" }, |
703 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, | 703 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, |
704 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, | 704 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, |
705 | { "You cannot remove your standard resource!\n Please select a new standard resource first.","Standard Resource kann\nnicht entfernt werden!\nBitte eine andere Resource\nals Standard setzen." }, | 705 | { "You cannot remove your standard resource!\n Please select a new standard resource first.","Standard Resource kann\nnicht entfernt werden!\nBitte eine andere Resource\nals Standard setzen." }, |
706 | { "Sorry","Tut mir leid" }, | 706 | { "Sorry","Tut mir leid" }, |
707 | { "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" }, | 707 | { "You cannot use a read-only<br> resource as standard!","Man kann nicht eine read-only<br> Resource als Standard setzen!" }, |
708 | { "Please restart to get the \nchanged resources (re)loaded!\n","Bitte starten Sie jetzt\ndas Programm neu, um die geänderten\nResourcen neu zu laden!\n" }, | 708 | { "Please restart to get the \nchanged resources (re)loaded!\n","Bitte starten Sie jetzt\ndas Programm neu, um die geänderten\nResourcen neu zu laden!\n" }, |
709 | { "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n","Die gewählte Datei enthält\nkeine gültige vCard.\nBitte prüfen Sie die Datei\nund versuchen es erneut.\n" }, | 709 | { "The selected file does not\ninclude a valid vCard.\nPlease check the file and try again.\n","Die gewählte Datei enthält\nkeine gültige vCard.\nBitte prüfen Sie die Datei\nund versuchen es erneut.\n" }, |
710 | { "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" }, | 710 | { "Unable to load resource '%1'","Resource kann nicht geladen werden: '%1'" }, |
711 | { "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" }, | 711 | { "Some changes are only\neffective after a restart!\n","Einige Änderungen werden erst\nnach einem Neustart übernommen!\n" }, |
712 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 712 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
713 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 713 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
714 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 714 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
715 | { "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?" }, | 715 | { "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?" }, |
716 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 716 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
717 | { "Error","Fehler" }, | 717 | { "Error","Fehler" }, |
718 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 718 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
719 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 719 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
720 | { "Warning","Warnung" }, | 720 | { "Warning","Warnung" }, |
721 | { "Select week number","Wähle Wochen Nummer" }, | 721 | { "Select week number","Wähle Wochen Nummer" }, |
722 | { "Februar","Februar" }, | 722 | { "Februar","Februar" }, |
723 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 723 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
724 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 724 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
725 | { "Remote IP address:","Ferne IP Adresse:" }, | 725 | { "Remote IP address:","Ferne IP Adresse:" }, |
726 | { "Remote port number:","Ferne Port Nummer:" }, | 726 | { "Remote port number:","Ferne Port Nummer:" }, |
727 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 727 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
728 | { "Remote from: ","Fern von: " }, | 728 | { "Remote from: ","Fern von: " }, |
729 | { "Local from: ","Lokal von: " }, | 729 | { "Local from: ","Lokal von: " }, |
730 | { "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" }, | 730 | { "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" }, |
731 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 731 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
732 | { "Write back","Schreibe zurück" }, | 732 | { "Write back","Schreibe zurück" }, |
733 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 733 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
734 | { "Received sync request","Sync Anfrage erhalten" }, | 734 | { "Received sync request","Sync Anfrage erhalten" }, |
735 | { "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." }, | 735 | { "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." }, |
736 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 736 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
737 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 737 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
738 | { "Sending file...","Sende Datei..." }, | 738 | { "Sending file...","Sende Datei..." }, |
739 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 739 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
740 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 740 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
741 | { "Received %1 bytes","%1 Bytes erhalten" }, | 741 | { "Received %1 bytes","%1 Bytes erhalten" }, |
742 | { "Writing file to disk...","Speichere Datei..." }, | 742 | { "Writing file to disk...","Speichere Datei..." }, |
743 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 743 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
744 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 744 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
745 | { "Synchronize!","Synchronisiere!" }, | 745 | { "Synchronize!","Synchronisiere!" }, |
746 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 746 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
747 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 747 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
748 | { "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!" }, | 748 | { "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!" }, |
749 | { "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, | 749 | { "Change search field enable jump bar","Ändere Suchfeld um Jumpbar anzuzeigen" }, |
750 | { "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, | 750 | { "Search with '*' prefix (wildcard)","Suche mit '*' Prefix (Wildcard)" }, |
751 | { "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, | 751 | { "Shrink searchfield in portrait view","Verkleinere Suchfeld im Portraitmodus" }, |
752 | { "Edit new contact","Bearbeite neuen Kontakt" }, | 752 | { "Edit new contact","Bearbeite neuen Kontakt" }, |
753 | { "Edit ","Bearbeite " }, | 753 | { "Edit ","Bearbeite " }, |
754 | { "No contact changed!","Kein Kontakt verändert" }, | 754 | { "No contact changed!","Kein Kontakt verändert" }, |
755 | { "%1 contacts changed!","%1 Kontakte geändert!" }, | 755 | { "%1 contacts changed!","%1 Kontakte geändert!" }, |
756 | { "Mobile (home)","Handy (Arbeit)" }, | 756 | { "Mobile (home)","Handy (Arbeit)" }, |
757 | { "Mobile (work)","Handy (Privat)" }, | 757 | { "Mobile (work)","Handy (Privat)" }, |
758 | { "Def.Formatted Name","Def. Format. Name" }, | 758 | { "Def.Formatted Name","Def. Format. Name" }, |
759 | { "Colors","Farben" }, | 759 | { "Colors","Farben" }, |
760 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, | 760 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, |
761 | { "Backup enabled","Backup angeschaltet" }, | 761 | { "Backup enabled","Backup angeschaltet" }, |
762 | { "Use standard backup dir","Standard Backupverzeichnis" }, | 762 | { "Use standard backup dir","Standard Backupverzeichnis" }, |
763 | { "Number of Backups:","Anzahl der Backups" }, | 763 | { "Number of Backups:","Anzahl der Backups" }, |
764 | { "Make backup every ","Mache ein Backup alle " }, | 764 | { "Make backup every ","Mache ein Backup alle " }, |
765 | { " days"," Tage" }, | 765 | { " days"," Tage" }, |
766 | { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, | 766 | { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, |
767 | { "Backup Failed!","Backup Problem!" }, | 767 | { "Backup Failed!","Backup Problem!" }, |
768 | { "Try again now","Versuche jetzt nochmal" }, | 768 | { "Try again now","Versuche jetzt nochmal" }, |
769 | { "Try again later","Versuche später nochmal" }, | 769 | { "Try again later","Versuche später nochmal" }, |
770 | { "Try again tomorrow","Versuche morgen nochmal" }, | 770 | { "Try again tomorrow","Versuche morgen nochmal" }, |
771 | { "Disable backup","Schalte Backup ab" }, | 771 | { "Disable backup","Schalte Backup ab" }, |
772 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 772 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
773 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 773 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
774 | { "Choose action","Wähle Aktion" }, | 774 | { "Choose action","Wähle Aktion" }, |
775 | { "&Configure KA/Pi...","Konfiguriere KA/Pi..." }, | 775 | { "&Configure KA/Pi...","Konfiguriere KA/Pi..." }, |
776 | { "Global Settings...","Globale Einstellungen..." }, | 776 | { "Global Settings...","Globale Einstellungen..." }, |
777 | { "Spouse","Ehegatte" }, | 777 | { "Spouse","Ehegatte" }, |
778 | { "Notes","Notizen" }, | 778 | { "Notes","Notizen" }, |
779 | { "Messanger","Messanger" }, | 779 | { "Messanger","Messanger" }, |
780 | { "Assistant","Assistent" }, | 780 | { "Assistant","Assistent" }, |
781 | { "Manager","Manager" }, | 781 | { "Manager","Manager" }, |
782 | { "Secrecy","Sichtbar" }, | 782 | { "Secrecy","Sichtbar" }, |
783 | { "male","männlich" }, | 783 | { "male","männlich" }, |
784 | { "female","weiblich" }, | 784 | { "female","weiblich" }, |
785 | { "Hide!","Verbergen!" }, | 785 | { "Hide!","Verbergen!" }, |
786 | { "Show!","Anzeigen!" }, | 786 | { "Show!","Anzeigen!" }, |
787 | { "Details","Details" }, | 787 | { "Details","Details" }, |
788 | { "Search:","Suche:" }, | 788 | { "Search:","Suche:" }, |
789 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, | 789 | { "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, |
790 | { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, | 790 | { "Pi-Sync Port Error","Pi-Sync Port Fehler" }, |
791 | { "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, | 791 | { "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, |
792 | { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, | 792 | { "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, |
793 | { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, | 793 | { "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, |
794 | { "Pi-Sync Error","Pi-Sync Fehler" }, | 794 | { "Pi-Sync Error","Pi-Sync Fehler" }, |
795 | { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, | 795 | { "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, |
796 | { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, | 796 | { "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, |
797 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, | 797 | { "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, |
798 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, | 798 | { "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, |
799 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, | 799 | { "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, |
800 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, | 800 | { "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, |
801 | { "Receiving file from remote...","Empfange entfernte Datei..." }, | 801 | { "Receiving file from remote...","Empfange entfernte Datei..." }, |
802 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, | 802 | { "Sending back synced file...","Sende synchronisierte Datei zurück..." }, |
803 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, | 803 | { "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, |
804 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, | 804 | { "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, |
805 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, | 805 | { "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, |
806 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, | 806 | { "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, |
807 | { "Writing back file ...","Schreibe Datei zurück..." }, | 807 | { "Writing back file ...","Schreibe Datei zurück..." }, |
808 | { "Sending back file ...","Sende Datei zurück..." }, | 808 | { "Sending back file ...","Sende Datei zurück..." }, |
809 | { "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" }, | 809 | { "Eeek, there I am ticklish!","Huch, da bin ich kitzlig!" }, |
810 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, | 810 | { "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, |
811 | { "...and %1 more\ncontact(s) selected","...und noch %1 Kontakte\n mehr ausgewählt" }, | ||
812 | { "Do you really\nwant to delete the\nsetected contact(s)?\n\n","Möchten Sie wirklich\ndie ausgewählten\nKontakte löschen?\n\n" }, | ||
813 | { "","" }, | ||
814 | { "","" }, | ||
815 | { "","" }, | ||
816 | { "","" }, | ||
811 | { "","" }, | 817 | { "","" }, |
812 | { "","" }, | 818 | { "","" }, |
813 | { "","" }, | 819 | { "","" }, |
814 | { "","" }, | 820 | { "","" }, |
815 | { "","" }, \ No newline at end of file | 821 | { "","" }, \ No newline at end of file |
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index d5de9cb..b9830b1 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -839,455 +839,471 @@ void KABCore::resizeEvent(QResizeEvent* e ) | |||
839 | mMainWindow->showMinimized(); | 839 | mMainWindow->showMinimized(); |
840 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 840 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
841 | mViewManager->getFilterAction()->setComboWidth( 150 ); | 841 | mViewManager->getFilterAction()->setComboWidth( 150 ); |
842 | if ( mIncSearchWidget ) | 842 | if ( mIncSearchWidget ) |
843 | mIncSearchWidget->setSize(); | 843 | mIncSearchWidget->setSize(); |
844 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | 844 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); |
845 | } | 845 | } |
846 | 846 | ||
847 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 | 847 | } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 |
848 | if ( mMiniSplitter->orientation() == Qt::Horizontal ) { | 848 | if ( mMiniSplitter->orientation() == Qt::Horizontal ) { |
849 | mMiniSplitter->setOrientation( Qt::Vertical ); | 849 | mMiniSplitter->setOrientation( Qt::Vertical ); |
850 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); | 850 | mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); |
851 | } | 851 | } |
852 | if ( QApplication::desktop()->width() <= 640 ) { | 852 | if ( QApplication::desktop()->width() <= 640 ) { |
853 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); | 853 | //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); |
854 | mMainWindow->showMinimized(); | 854 | mMainWindow->showMinimized(); |
855 | if ( KABPrefs::instance()->mHideSearchOnSwitch ) { | 855 | if ( KABPrefs::instance()->mHideSearchOnSwitch ) { |
856 | if ( mIncSearchWidget ) { | 856 | if ( mIncSearchWidget ) { |
857 | mIncSearchWidget->setSize(); | 857 | mIncSearchWidget->setSize(); |
858 | } | 858 | } |
859 | } else { | 859 | } else { |
860 | mViewManager->getFilterAction()->setComboWidth( 0 ); | 860 | mViewManager->getFilterAction()->setComboWidth( 0 ); |
861 | } | 861 | } |
862 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); | 862 | QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); |
863 | } | 863 | } |
864 | } | 864 | } |
865 | } | 865 | } |
866 | QWidget::resizeEvent( e ); | 866 | QWidget::resizeEvent( e ); |
867 | 867 | ||
868 | } | 868 | } |
869 | void KABCore::export2phone() | 869 | void KABCore::export2phone() |
870 | { | 870 | { |
871 | 871 | ||
872 | QStringList uids; | 872 | QStringList uids; |
873 | XXPortSelectDialog dlg( this, false, this ); | 873 | XXPortSelectDialog dlg( this, false, this ); |
874 | if ( dlg.exec() ) | 874 | if ( dlg.exec() ) |
875 | uids = dlg.uids(); | 875 | uids = dlg.uids(); |
876 | else | 876 | else |
877 | return; | 877 | return; |
878 | if ( uids.isEmpty() ) | 878 | if ( uids.isEmpty() ) |
879 | return; | 879 | return; |
880 | // qDebug("count %d ", uids.count()); | 880 | // qDebug("count %d ", uids.count()); |
881 | 881 | ||
882 | KAex2phonePrefs ex2phone; | 882 | KAex2phonePrefs ex2phone; |
883 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 883 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
884 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 884 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
885 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 885 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
886 | 886 | ||
887 | if ( !ex2phone.exec() ) { | 887 | if ( !ex2phone.exec() ) { |
888 | return; | 888 | return; |
889 | } | 889 | } |
890 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 890 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
891 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 891 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
892 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 892 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
893 | 893 | ||
894 | 894 | ||
895 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 895 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
896 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 896 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
897 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 897 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
898 | 898 | ||
899 | QString fileName = getPhoneFile(); | 899 | QString fileName = getPhoneFile(); |
900 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) | 900 | if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) |
901 | return; | 901 | return; |
902 | 902 | ||
903 | message(i18n("Exporting to phone...")); | 903 | message(i18n("Exporting to phone...")); |
904 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); | 904 | QTimer::singleShot( 1, this , SLOT ( writeToPhone())); |
905 | 905 | ||
906 | } | 906 | } |
907 | QString KABCore::getPhoneFile() | 907 | QString KABCore::getPhoneFile() |
908 | { | 908 | { |
909 | #ifdef DESKTOP_VERSION | 909 | #ifdef DESKTOP_VERSION |
910 | return locateLocal("tmp", "phonefile.vcf"); | 910 | return locateLocal("tmp", "phonefile.vcf"); |
911 | #else | 911 | #else |
912 | return "/tmp/phonefile.vcf"; | 912 | return "/tmp/phonefile.vcf"; |
913 | #endif | 913 | #endif |
914 | 914 | ||
915 | } | 915 | } |
916 | void KABCore::writeToPhone( ) | 916 | void KABCore::writeToPhone( ) |
917 | { | 917 | { |
918 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) | 918 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) |
919 | message(i18n("Export to phone finished!")); | 919 | message(i18n("Export to phone finished!")); |
920 | else | 920 | else |
921 | qDebug(i18n("KA: Error exporting to phone")); | 921 | qDebug(i18n("KA: Error exporting to phone")); |
922 | } | 922 | } |
923 | void KABCore::beamVCard() | 923 | void KABCore::beamVCard() |
924 | { | 924 | { |
925 | QStringList uids; | 925 | QStringList uids; |
926 | XXPortSelectDialog dlg( this, false, this ); | 926 | XXPortSelectDialog dlg( this, false, this ); |
927 | if ( dlg.exec() ) | 927 | if ( dlg.exec() ) |
928 | uids = dlg.uids(); | 928 | uids = dlg.uids(); |
929 | else | 929 | else |
930 | return; | 930 | return; |
931 | if ( uids.isEmpty() ) | 931 | if ( uids.isEmpty() ) |
932 | return; | 932 | return; |
933 | beamVCard( uids ); | 933 | beamVCard( uids ); |
934 | } | 934 | } |
935 | 935 | ||
936 | 936 | ||
937 | void KABCore::beamVCard(const QStringList& uids) | 937 | void KABCore::beamVCard(const QStringList& uids) |
938 | { | 938 | { |
939 | 939 | ||
940 | // LR: we should use the /tmp dir on the Zaurus, | 940 | // LR: we should use the /tmp dir on the Zaurus, |
941 | // because: /tmp = RAM, (HOME)/kdepim = flash memory | 941 | // because: /tmp = RAM, (HOME)/kdepim = flash memory |
942 | 942 | ||
943 | #ifdef DESKTOP_VERSION | 943 | #ifdef DESKTOP_VERSION |
944 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); | 944 | QString fileName = locateLocal("tmp", "kapibeamfile.vcf"); |
945 | #else | 945 | #else |
946 | QString fileName = "/tmp/kapibeamfile.vcf"; | 946 | QString fileName = "/tmp/kapibeamfile.vcf"; |
947 | #endif | 947 | #endif |
948 | 948 | ||
949 | KABC::VCardConverter converter; | 949 | KABC::VCardConverter converter; |
950 | QString description; | 950 | QString description; |
951 | QString datastream; | 951 | QString datastream; |
952 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { | 952 | for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { |
953 | KABC::Addressee a = mAddressBook->findByUid( *it ); | 953 | KABC::Addressee a = mAddressBook->findByUid( *it ); |
954 | 954 | ||
955 | if ( a.isEmpty() ) | 955 | if ( a.isEmpty() ) |
956 | continue; | 956 | continue; |
957 | 957 | ||
958 | if (description.isEmpty()) | 958 | if (description.isEmpty()) |
959 | description = a.formattedName(); | 959 | description = a.formattedName(); |
960 | 960 | ||
961 | QString vcard; | 961 | QString vcard; |
962 | converter.addresseeToVCard( a, vcard ); | 962 | converter.addresseeToVCard( a, vcard ); |
963 | int start = 0; | 963 | int start = 0; |
964 | int next; | 964 | int next; |
965 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { | 965 | while ( (next = vcard.find("TYPE=", start) )>= 0 ) { |
966 | int semi = vcard.find(";", next); | 966 | int semi = vcard.find(";", next); |
967 | int dopp = vcard.find(":", next); | 967 | int dopp = vcard.find(":", next); |
968 | int sep; | 968 | int sep; |
969 | if ( semi < dopp && semi >= 0 ) | 969 | if ( semi < dopp && semi >= 0 ) |
970 | sep = semi ; | 970 | sep = semi ; |
971 | else | 971 | else |
972 | sep = dopp; | 972 | sep = dopp; |
973 | datastream +=vcard.mid( start, next - start); | 973 | datastream +=vcard.mid( start, next - start); |
974 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); | 974 | datastream +=vcard.mid( next+5,sep -next -5 ).upper(); |
975 | start = sep; | 975 | start = sep; |
976 | } | 976 | } |
977 | datastream += vcard.mid( start,vcard.length() ); | 977 | datastream += vcard.mid( start,vcard.length() ); |
978 | } | 978 | } |
979 | #ifndef DESKTOP_VERSION | 979 | #ifndef DESKTOP_VERSION |
980 | QFile outFile(fileName); | 980 | QFile outFile(fileName); |
981 | if ( outFile.open(IO_WriteOnly) ) { | 981 | if ( outFile.open(IO_WriteOnly) ) { |
982 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); | 982 | datastream.replace ( QRegExp("VERSION:3.0") , "VERSION:2.1" ); |
983 | QTextStream t( &outFile ); // use a text stream | 983 | QTextStream t( &outFile ); // use a text stream |
984 | //t.setEncoding( QTextStream::UnicodeUTF8 ); | 984 | //t.setEncoding( QTextStream::UnicodeUTF8 ); |
985 | t.setEncoding( QTextStream::Latin1 ); | 985 | t.setEncoding( QTextStream::Latin1 ); |
986 | t <<datastream.latin1(); | 986 | t <<datastream.latin1(); |
987 | outFile.close(); | 987 | outFile.close(); |
988 | Ir *ir = new Ir( this ); | 988 | Ir *ir = new Ir( this ); |
989 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); | 989 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); |
990 | ir->send( fileName, description, "text/x-vCard" ); | 990 | ir->send( fileName, description, "text/x-vCard" ); |
991 | } else { | 991 | } else { |
992 | qDebug("KA: Error open temp beam file "); | 992 | qDebug("KA: Error open temp beam file "); |
993 | return; | 993 | return; |
994 | } | 994 | } |
995 | #endif | 995 | #endif |
996 | 996 | ||
997 | } | 997 | } |
998 | 998 | ||
999 | void KABCore::beamDone( Ir *ir ) | 999 | void KABCore::beamDone( Ir *ir ) |
1000 | { | 1000 | { |
1001 | #ifndef DESKTOP_VERSION | 1001 | #ifndef DESKTOP_VERSION |
1002 | delete ir; | 1002 | delete ir; |
1003 | #endif | 1003 | #endif |
1004 | topLevelWidget()->raise(); | 1004 | topLevelWidget()->raise(); |
1005 | message( i18n("Beaming finished!") ); | 1005 | message( i18n("Beaming finished!") ); |
1006 | } | 1006 | } |
1007 | 1007 | ||
1008 | 1008 | ||
1009 | void KABCore::browse( const QString& url ) | 1009 | void KABCore::browse( const QString& url ) |
1010 | { | 1010 | { |
1011 | #ifndef KAB_EMBEDDED | 1011 | #ifndef KAB_EMBEDDED |
1012 | kapp->invokeBrowser( url ); | 1012 | kapp->invokeBrowser( url ); |
1013 | #else //KAB_EMBEDDED | 1013 | #else //KAB_EMBEDDED |
1014 | qDebug("KABCore::browse must be fixed"); | 1014 | qDebug("KABCore::browse must be fixed"); |
1015 | #endif //KAB_EMBEDDED | 1015 | #endif //KAB_EMBEDDED |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | void KABCore::selectAllContacts() | 1018 | void KABCore::selectAllContacts() |
1019 | { | 1019 | { |
1020 | mViewManager->setSelected( QString::null, true ); | 1020 | mViewManager->setSelected( QString::null, true ); |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | void KABCore::deleteContacts() | 1023 | void KABCore::deleteContacts() |
1024 | { | 1024 | { |
1025 | QStringList uidList = mViewManager->selectedUids(); | 1025 | QStringList uidList = mViewManager->selectedUids(); |
1026 | deleteContacts( uidList ); | 1026 | deleteContacts( uidList ); |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | void KABCore::deleteContacts( const QStringList &uids ) | 1029 | void KABCore::deleteContacts( const QStringList &uids ) |
1030 | { | 1030 | { |
1031 | |||
1031 | if ( uids.count() > 0 ) { | 1032 | if ( uids.count() > 0 ) { |
1033 | |||
1034 | if ( KABPrefs::instance()->mAskForDelete ) { | ||
1035 | int count = uids.count(); | ||
1036 | if ( count > 5 ) count = 5; | ||
1037 | QString cNames; | ||
1038 | int i; | ||
1039 | for ( i = 0; i < count ; ++i ) { | ||
1040 | cNames += KGlobal::formatMessage( mAddressBook->findByUid( uids[i] ).realName() ,0) + "\n"; | ||
1041 | } | ||
1042 | if ( uids.count() > 5 ) | ||
1043 | cNames += i18n("...and %1 more\ncontact(s) selected").arg( uids.count() - 5 ); | ||
1044 | QString text = i18n( "Do you really\nwant to delete the\nsetected contact(s)?\n\n" ) + cNames ; | ||
1045 | if ( KMessageBox::questionYesNo( this, text ) != KMessageBox::Yes ) | ||
1046 | return; | ||
1047 | } | ||
1032 | PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); | 1048 | PwDeleteCommand *command = new PwDeleteCommand( mAddressBook, uids ); |
1033 | UndoStack::instance()->push( command ); | 1049 | UndoStack::instance()->push( command ); |
1034 | RedoStack::instance()->clear(); | 1050 | RedoStack::instance()->clear(); |
1035 | 1051 | ||
1036 | // now if we deleted anything, refresh | 1052 | // now if we deleted anything, refresh |
1037 | setContactSelected( QString::null ); | 1053 | setContactSelected( QString::null ); |
1038 | setModified( true ); | 1054 | setModified( true ); |
1039 | } | 1055 | } |
1040 | } | 1056 | } |
1041 | 1057 | ||
1042 | void KABCore::copyContacts() | 1058 | void KABCore::copyContacts() |
1043 | { | 1059 | { |
1044 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 1060 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
1045 | 1061 | ||
1046 | QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); | 1062 | QString clipText = AddresseeUtil::addresseesToClipboard( addrList ); |
1047 | 1063 | ||
1048 | kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; | 1064 | kdDebug(5720) << "KABCore::copyContacts: " << clipText << endl; |
1049 | 1065 | ||
1050 | QClipboard *cb = QApplication::clipboard(); | 1066 | QClipboard *cb = QApplication::clipboard(); |
1051 | cb->setText( clipText ); | 1067 | cb->setText( clipText ); |
1052 | } | 1068 | } |
1053 | 1069 | ||
1054 | void KABCore::cutContacts() | 1070 | void KABCore::cutContacts() |
1055 | { | 1071 | { |
1056 | QStringList uidList = mViewManager->selectedUids(); | 1072 | QStringList uidList = mViewManager->selectedUids(); |
1057 | 1073 | ||
1058 | //US if ( uidList.size() > 0 ) { | 1074 | //US if ( uidList.size() > 0 ) { |
1059 | if ( uidList.count() > 0 ) { | 1075 | if ( uidList.count() > 0 ) { |
1060 | PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); | 1076 | PwCutCommand *command = new PwCutCommand( mAddressBook, uidList ); |
1061 | UndoStack::instance()->push( command ); | 1077 | UndoStack::instance()->push( command ); |
1062 | RedoStack::instance()->clear(); | 1078 | RedoStack::instance()->clear(); |
1063 | 1079 | ||
1064 | setModified( true ); | 1080 | setModified( true ); |
1065 | } | 1081 | } |
1066 | } | 1082 | } |
1067 | 1083 | ||
1068 | void KABCore::pasteContacts() | 1084 | void KABCore::pasteContacts() |
1069 | { | 1085 | { |
1070 | QClipboard *cb = QApplication::clipboard(); | 1086 | QClipboard *cb = QApplication::clipboard(); |
1071 | 1087 | ||
1072 | KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); | 1088 | KABC::Addressee::List list = AddresseeUtil::clipboardToAddressees( cb->text() ); |
1073 | 1089 | ||
1074 | pasteContacts( list ); | 1090 | pasteContacts( list ); |
1075 | } | 1091 | } |
1076 | 1092 | ||
1077 | void KABCore::pasteContacts( KABC::Addressee::List &list ) | 1093 | void KABCore::pasteContacts( KABC::Addressee::List &list ) |
1078 | { | 1094 | { |
1079 | KABC::Resource *resource = requestResource( this ); | 1095 | KABC::Resource *resource = requestResource( this ); |
1080 | KABC::Addressee::List::Iterator it; | 1096 | KABC::Addressee::List::Iterator it; |
1081 | for ( it = list.begin(); it != list.end(); ++it ) | 1097 | for ( it = list.begin(); it != list.end(); ++it ) |
1082 | (*it).setResource( resource ); | 1098 | (*it).setResource( resource ); |
1083 | 1099 | ||
1084 | PwPasteCommand *command = new PwPasteCommand( this, list ); | 1100 | PwPasteCommand *command = new PwPasteCommand( this, list ); |
1085 | UndoStack::instance()->push( command ); | 1101 | UndoStack::instance()->push( command ); |
1086 | RedoStack::instance()->clear(); | 1102 | RedoStack::instance()->clear(); |
1087 | 1103 | ||
1088 | setModified( true ); | 1104 | setModified( true ); |
1089 | } | 1105 | } |
1090 | 1106 | ||
1091 | void KABCore::setWhoAmI() | 1107 | void KABCore::setWhoAmI() |
1092 | { | 1108 | { |
1093 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); | 1109 | KABC::Addressee::List addrList = mViewManager->selectedAddressees(); |
1094 | 1110 | ||
1095 | if ( addrList.count() > 1 ) { | 1111 | if ( addrList.count() > 1 ) { |
1096 | KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); | 1112 | KMessageBox::sorry( this, i18n( "Please select only one contact." ) ); |
1097 | return; | 1113 | return; |
1098 | } | 1114 | } |
1099 | 1115 | ||
1100 | QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); | 1116 | QString text( i18n( "<qt>Do you really want to use <b>%1</b> as your new personal contact?</qt>" ) ); |
1101 | if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].assembledName() ) ) == KMessageBox::Yes ) | 1117 | if ( KMessageBox::questionYesNo( this, text.arg( addrList[ 0 ].realName() ) ) == KMessageBox::Yes ) |
1102 | static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); | 1118 | static_cast<KABC::StdAddressBook*>( KABC::StdAddressBook::self() )->setWhoAmI( addrList[ 0 ] ); |
1103 | } | 1119 | } |
1104 | void KABCore::editCategories() | 1120 | void KABCore::editCategories() |
1105 | { | 1121 | { |
1106 | KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true ); | 1122 | KPIM::CategoryEditDialog dlg ( KABPrefs::instance(), this, "", true ); |
1107 | dlg.exec(); | 1123 | dlg.exec(); |
1108 | } | 1124 | } |
1109 | void KABCore::setCategories() | 1125 | void KABCore::setCategories() |
1110 | { | 1126 | { |
1111 | 1127 | ||
1112 | QStringList uids; | 1128 | QStringList uids; |
1113 | XXPortSelectDialog dlgx( this, false, this ); | 1129 | XXPortSelectDialog dlgx( this, false, this ); |
1114 | if ( dlgx.exec() ) | 1130 | if ( dlgx.exec() ) |
1115 | uids = dlgx.uids(); | 1131 | uids = dlgx.uids(); |
1116 | else | 1132 | else |
1117 | return; | 1133 | return; |
1118 | if ( uids.isEmpty() ) | 1134 | if ( uids.isEmpty() ) |
1119 | return; | 1135 | return; |
1120 | // qDebug("count %d ", uids.count()); | 1136 | // qDebug("count %d ", uids.count()); |
1121 | 1137 | ||
1122 | 1138 | ||
1123 | KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); | 1139 | KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); |
1124 | if ( !dlg.exec() ) { | 1140 | if ( !dlg.exec() ) { |
1125 | message( i18n("Setting categories cancelled") ); | 1141 | message( i18n("Setting categories cancelled") ); |
1126 | return; | 1142 | return; |
1127 | } | 1143 | } |
1128 | bool merge = false; | 1144 | bool merge = false; |
1129 | QString msg = i18n( "Merge with existing categories?" ); | 1145 | QString msg = i18n( "Merge with existing categories?" ); |
1130 | if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) | 1146 | if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) |
1131 | merge = true; | 1147 | merge = true; |
1132 | 1148 | ||
1133 | message( i18n("Setting categories ... please wait!") ); | 1149 | message( i18n("Setting categories ... please wait!") ); |
1134 | QStringList categories = dlg.selectedCategories(); | 1150 | QStringList categories = dlg.selectedCategories(); |
1135 | 1151 | ||
1136 | //QStringList uids = mViewManager->selectedUids(); | 1152 | //QStringList uids = mViewManager->selectedUids(); |
1137 | QStringList::Iterator it; | 1153 | QStringList::Iterator it; |
1138 | for ( it = uids.begin(); it != uids.end(); ++it ) { | 1154 | for ( it = uids.begin(); it != uids.end(); ++it ) { |
1139 | KABC::Addressee addr = mAddressBook->findByUid( *it ); | 1155 | KABC::Addressee addr = mAddressBook->findByUid( *it ); |
1140 | if ( !addr.isEmpty() ) { | 1156 | if ( !addr.isEmpty() ) { |
1141 | if ( !merge ) | 1157 | if ( !merge ) |
1142 | addr.setCategories( categories ); | 1158 | addr.setCategories( categories ); |
1143 | else { | 1159 | else { |
1144 | QStringList addrCategories = addr.categories(); | 1160 | QStringList addrCategories = addr.categories(); |
1145 | QStringList::Iterator catIt; | 1161 | QStringList::Iterator catIt; |
1146 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { | 1162 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { |
1147 | if ( !addrCategories.contains( *catIt ) ) | 1163 | if ( !addrCategories.contains( *catIt ) ) |
1148 | addrCategories.append( *catIt ); | 1164 | addrCategories.append( *catIt ); |
1149 | } | 1165 | } |
1150 | addr.setCategories( addrCategories ); | 1166 | addr.setCategories( addrCategories ); |
1151 | } | 1167 | } |
1152 | mAddressBook->insertAddressee( addr ); | 1168 | mAddressBook->insertAddressee( addr ); |
1153 | } | 1169 | } |
1154 | } | 1170 | } |
1155 | 1171 | ||
1156 | if ( uids.count() > 0 ) | 1172 | if ( uids.count() > 0 ) |
1157 | setModified( true ); | 1173 | setModified( true ); |
1158 | message( i18n("Setting categories completed!") ); | 1174 | message( i18n("Setting categories completed!") ); |
1159 | } | 1175 | } |
1160 | 1176 | ||
1161 | void KABCore::setSearchFields( const KABC::Field::List &fields ) | 1177 | void KABCore::setSearchFields( const KABC::Field::List &fields ) |
1162 | { | 1178 | { |
1163 | mIncSearchWidget->setFields( fields ); | 1179 | mIncSearchWidget->setFields( fields ); |
1164 | } | 1180 | } |
1165 | 1181 | ||
1166 | void KABCore::incrementalSearch( const QString& text ) | 1182 | void KABCore::incrementalSearch( const QString& text ) |
1167 | { | 1183 | { |
1168 | QString stext; | 1184 | QString stext; |
1169 | if ( KABPrefs::instance()->mAutoSearchWithWildcard ) { | 1185 | if ( KABPrefs::instance()->mAutoSearchWithWildcard ) { |
1170 | stext = "*" + text; | 1186 | stext = "*" + text; |
1171 | } else { | 1187 | } else { |
1172 | stext = text; | 1188 | stext = text; |
1173 | } | 1189 | } |
1174 | mViewManager->doSearch( stext, mIncSearchWidget->currentField() ); | 1190 | mViewManager->doSearch( stext, mIncSearchWidget->currentField() ); |
1175 | } | 1191 | } |
1176 | void KABCore::incrementalSearchJump( const QString& text ) | 1192 | void KABCore::incrementalSearchJump( const QString& text ) |
1177 | { | 1193 | { |
1178 | mViewManager->doSearch( text, mIncSearchWidget->currentField() ); | 1194 | mViewManager->doSearch( text, mIncSearchWidget->currentField() ); |
1179 | } | 1195 | } |
1180 | 1196 | ||
1181 | void KABCore::setModified() | 1197 | void KABCore::setModified() |
1182 | { | 1198 | { |
1183 | setModified( true ); | 1199 | setModified( true ); |
1184 | } | 1200 | } |
1185 | 1201 | ||
1186 | void KABCore::setModifiedWOrefresh() | 1202 | void KABCore::setModifiedWOrefresh() |
1187 | { | 1203 | { |
1188 | // qDebug("KABCore::setModifiedWOrefresh() "); | 1204 | // qDebug("KABCore::setModifiedWOrefresh() "); |
1189 | mModified = true; | 1205 | mModified = true; |
1190 | mActionSave->setEnabled( mModified ); | 1206 | mActionSave->setEnabled( mModified ); |
1191 | 1207 | ||
1192 | 1208 | ||
1193 | } | 1209 | } |
1194 | void KABCore::setModified( bool modified ) | 1210 | void KABCore::setModified( bool modified ) |
1195 | { | 1211 | { |
1196 | mModified = modified; | 1212 | mModified = modified; |
1197 | mActionSave->setEnabled( mModified ); | 1213 | mActionSave->setEnabled( mModified ); |
1198 | 1214 | ||
1199 | if ( modified ) | 1215 | if ( modified ) |
1200 | mJumpButtonBar->recreateButtons(); | 1216 | mJumpButtonBar->recreateButtons(); |
1201 | 1217 | ||
1202 | mViewManager->refreshView(); | 1218 | mViewManager->refreshView(); |
1203 | 1219 | ||
1204 | } | 1220 | } |
1205 | 1221 | ||
1206 | bool KABCore::modified() const | 1222 | bool KABCore::modified() const |
1207 | { | 1223 | { |
1208 | return mModified; | 1224 | return mModified; |
1209 | } | 1225 | } |
1210 | 1226 | ||
1211 | void KABCore::contactModified( const KABC::Addressee &addr ) | 1227 | void KABCore::contactModified( const KABC::Addressee &addr ) |
1212 | { | 1228 | { |
1213 | addrModified( addr ); | 1229 | addrModified( addr ); |
1214 | #if 0 // debug only | 1230 | #if 0 // debug only |
1215 | KABC::Addressee ad = addr; | 1231 | KABC::Addressee ad = addr; |
1216 | ad.computeCsum( "123"); | 1232 | ad.computeCsum( "123"); |
1217 | #endif | 1233 | #endif |
1218 | } | 1234 | } |
1219 | 1235 | ||
1220 | void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) | 1236 | void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) |
1221 | { | 1237 | { |
1222 | 1238 | ||
1223 | Command *command = 0; | 1239 | Command *command = 0; |
1224 | QString uid; | 1240 | QString uid; |
1225 | 1241 | ||
1226 | // check if it exists already | 1242 | // check if it exists already |
1227 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); | 1243 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); |
1228 | if ( origAddr.isEmpty() ) | 1244 | if ( origAddr.isEmpty() ) |
1229 | command = new PwNewCommand( mAddressBook, addr ); | 1245 | command = new PwNewCommand( mAddressBook, addr ); |
1230 | else { | 1246 | else { |
1231 | command = new PwEditCommand( mAddressBook, origAddr, addr ); | 1247 | command = new PwEditCommand( mAddressBook, origAddr, addr ); |
1232 | uid = addr.uid(); | 1248 | uid = addr.uid(); |
1233 | } | 1249 | } |
1234 | 1250 | ||
1235 | UndoStack::instance()->push( command ); | 1251 | UndoStack::instance()->push( command ); |
1236 | RedoStack::instance()->clear(); | 1252 | RedoStack::instance()->clear(); |
1237 | if ( updateDetails ) | 1253 | if ( updateDetails ) |
1238 | mDetails->setAddressee( addr ); | 1254 | mDetails->setAddressee( addr ); |
1239 | setModified( true ); | 1255 | setModified( true ); |
1240 | } | 1256 | } |
1241 | 1257 | ||
1242 | void KABCore::newContact() | 1258 | void KABCore::newContact() |
1243 | { | 1259 | { |
1244 | 1260 | ||
1245 | 1261 | ||
1246 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); | 1262 | QPtrList<KABC::Resource> kabcResources = mAddressBook->resources(); |
1247 | 1263 | ||
1248 | QPtrList<KRES::Resource> kresResources; | 1264 | QPtrList<KRES::Resource> kresResources; |
1249 | QPtrListIterator<KABC::Resource> it( kabcResources ); | 1265 | QPtrListIterator<KABC::Resource> it( kabcResources ); |
1250 | KABC::Resource *resource; | 1266 | KABC::Resource *resource; |
1251 | while ( ( resource = it.current() ) != 0 ) { | 1267 | while ( ( resource = it.current() ) != 0 ) { |
1252 | ++it; | 1268 | ++it; |
1253 | if ( !resource->readOnly() ) { | 1269 | if ( !resource->readOnly() ) { |
1254 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); | 1270 | KRES::Resource *res = static_cast<KRES::Resource*>( resource ); |
1255 | if ( res ) | 1271 | if ( res ) |
1256 | kresResources.append( res ); | 1272 | kresResources.append( res ); |
1257 | } | 1273 | } |
1258 | } | 1274 | } |
1259 | 1275 | ||
1260 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); | 1276 | KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, this ); |
1261 | resource = static_cast<KABC::Resource*>( res ); | 1277 | resource = static_cast<KABC::Resource*>( res ); |
1262 | 1278 | ||
1263 | if ( resource ) { | 1279 | if ( resource ) { |
1264 | KABC::Addressee addr; | 1280 | KABC::Addressee addr; |
1265 | addr.setResource( resource ); | 1281 | addr.setResource( resource ); |
1266 | mEditorDialog->setAddressee( addr ); | 1282 | mEditorDialog->setAddressee( addr ); |
1267 | mEditorDialog->setCaption( i18n("Edit new contact")); | 1283 | mEditorDialog->setCaption( i18n("Edit new contact")); |
1268 | KApplication::execDialog ( mEditorDialog ); | 1284 | KApplication::execDialog ( mEditorDialog ); |
1269 | 1285 | ||
1270 | } else | 1286 | } else |
1271 | return; | 1287 | return; |
1272 | 1288 | ||
1273 | // mEditorDict.insert( dialog->addressee().uid(), dialog ); | 1289 | // mEditorDict.insert( dialog->addressee().uid(), dialog ); |
1274 | 1290 | ||
1275 | 1291 | ||
1276 | } | 1292 | } |
1277 | 1293 | ||
1278 | void KABCore::addEmail( QString aStr ) | 1294 | void KABCore::addEmail( QString aStr ) |
1279 | { | 1295 | { |
1280 | #ifndef KAB_EMBEDDED | 1296 | #ifndef KAB_EMBEDDED |
1281 | QString fullName, email; | 1297 | QString fullName, email; |
1282 | 1298 | ||
1283 | KABC::Addressee::parseEmailAddress( aStr, fullName, email ); | 1299 | KABC::Addressee::parseEmailAddress( aStr, fullName, email ); |
1284 | 1300 | ||
1285 | // Try to lookup the addressee matching the email address | 1301 | // Try to lookup the addressee matching the email address |
1286 | bool found = false; | 1302 | bool found = false; |
1287 | QStringList emailList; | 1303 | QStringList emailList; |
1288 | KABC::AddressBook::Iterator it; | 1304 | KABC::AddressBook::Iterator it; |
1289 | for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { | 1305 | for ( it = mAddressBook->begin(); !found && (it != mAddressBook->end()); ++it ) { |
1290 | emailList = (*it).emails(); | 1306 | emailList = (*it).emails(); |
1291 | if ( emailList.contains( email ) > 0 ) { | 1307 | if ( emailList.contains( email ) > 0 ) { |
1292 | found = true; | 1308 | found = true; |
1293 | (*it).setNameFromString( fullName ); | 1309 | (*it).setNameFromString( fullName ); |
@@ -2477,385 +2493,385 @@ void KABCore::setFormattedName() | |||
2477 | (*it).setFormattedName( fName ); | 2493 | (*it).setFormattedName( fName ); |
2478 | (*it).setChanged( true ); | 2494 | (*it).setChanged( true ); |
2479 | modified = true; | 2495 | modified = true; |
2480 | (*it).setRevision( QDateTime::currentDateTime() ); | 2496 | (*it).setRevision( QDateTime::currentDateTime() ); |
2481 | } | 2497 | } |
2482 | } | 2498 | } |
2483 | message(i18n("Refreshing view...") ); | 2499 | message(i18n("Refreshing view...") ); |
2484 | qApp->processEvents(); | 2500 | qApp->processEvents(); |
2485 | if ( modified ) | 2501 | if ( modified ) |
2486 | setModified( true ); | 2502 | setModified( true ); |
2487 | Addressee add; | 2503 | Addressee add; |
2488 | mDetails->setAddressee( add ); | 2504 | mDetails->setAddressee( add ); |
2489 | if ( count == 0 ) | 2505 | if ( count == 0 ) |
2490 | message(i18n("No contact changed!") ); | 2506 | message(i18n("No contact changed!") ); |
2491 | else | 2507 | else |
2492 | message(i18n("%1 contacts changed!").arg( count ) ); | 2508 | message(i18n("%1 contacts changed!").arg( count ) ); |
2493 | } | 2509 | } |
2494 | 2510 | ||
2495 | void KABCore::clipboardDataChanged() | 2511 | void KABCore::clipboardDataChanged() |
2496 | { | 2512 | { |
2497 | 2513 | ||
2498 | if ( mReadWrite ) | 2514 | if ( mReadWrite ) |
2499 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); | 2515 | mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); |
2500 | 2516 | ||
2501 | } | 2517 | } |
2502 | 2518 | ||
2503 | void KABCore::updateActionMenu() | 2519 | void KABCore::updateActionMenu() |
2504 | { | 2520 | { |
2505 | UndoStack *undo = UndoStack::instance(); | 2521 | UndoStack *undo = UndoStack::instance(); |
2506 | RedoStack *redo = RedoStack::instance(); | 2522 | RedoStack *redo = RedoStack::instance(); |
2507 | 2523 | ||
2508 | if ( undo->isEmpty() ) | 2524 | if ( undo->isEmpty() ) |
2509 | mActionUndo->setText( i18n( "Undo" ) ); | 2525 | mActionUndo->setText( i18n( "Undo" ) ); |
2510 | else | 2526 | else |
2511 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); | 2527 | mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); |
2512 | 2528 | ||
2513 | mActionUndo->setEnabled( !undo->isEmpty() ); | 2529 | mActionUndo->setEnabled( !undo->isEmpty() ); |
2514 | 2530 | ||
2515 | if ( !redo->top() ) | 2531 | if ( !redo->top() ) |
2516 | mActionRedo->setText( i18n( "Redo" ) ); | 2532 | mActionRedo->setText( i18n( "Redo" ) ); |
2517 | else | 2533 | else |
2518 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); | 2534 | mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); |
2519 | 2535 | ||
2520 | mActionRedo->setEnabled( !redo->isEmpty() ); | 2536 | mActionRedo->setEnabled( !redo->isEmpty() ); |
2521 | } | 2537 | } |
2522 | 2538 | ||
2523 | void KABCore::configureKeyBindings() | 2539 | void KABCore::configureKeyBindings() |
2524 | { | 2540 | { |
2525 | #ifndef KAB_EMBEDDED | 2541 | #ifndef KAB_EMBEDDED |
2526 | KKeyDialog::configure( actionCollection(), true ); | 2542 | KKeyDialog::configure( actionCollection(), true ); |
2527 | #else //KAB_EMBEDDED | 2543 | #else //KAB_EMBEDDED |
2528 | qDebug("KABCore::configureKeyBindings() not implemented"); | 2544 | qDebug("KABCore::configureKeyBindings() not implemented"); |
2529 | #endif //KAB_EMBEDDED | 2545 | #endif //KAB_EMBEDDED |
2530 | } | 2546 | } |
2531 | 2547 | ||
2532 | #ifdef KAB_EMBEDDED | 2548 | #ifdef KAB_EMBEDDED |
2533 | void KABCore::configureResources() | 2549 | void KABCore::configureResources() |
2534 | { | 2550 | { |
2535 | KRES::KCMKResources dlg( this, "" , 0 ); | 2551 | KRES::KCMKResources dlg( this, "" , 0 ); |
2536 | 2552 | ||
2537 | if ( !dlg.exec() ) | 2553 | if ( !dlg.exec() ) |
2538 | return; | 2554 | return; |
2539 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); | 2555 | KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); |
2540 | } | 2556 | } |
2541 | #endif //KAB_EMBEDDED | 2557 | #endif //KAB_EMBEDDED |
2542 | 2558 | ||
2543 | 2559 | ||
2544 | /* this method will be called through the QCop interface from Ko/Pi to select addresses | 2560 | /* this method will be called through the QCop interface from Ko/Pi to select addresses |
2545 | * for the attendees list of an event. | 2561 | * for the attendees list of an event. |
2546 | */ | 2562 | */ |
2547 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) | 2563 | void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) |
2548 | { | 2564 | { |
2549 | qDebug("KABCore::requestForNameEmailUidList "); | 2565 | qDebug("KABCore::requestForNameEmailUidList "); |
2550 | bool ok = false; | 2566 | bool ok = false; |
2551 | mEmailSourceChannel = sourceChannel; | 2567 | mEmailSourceChannel = sourceChannel; |
2552 | mEmailSourceUID = uid; | 2568 | mEmailSourceUID = uid; |
2553 | QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); | 2569 | QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); |
2554 | //callContactdialog(); | 2570 | //callContactdialog(); |
2555 | #if 0 | 2571 | #if 0 |
2556 | int wid = uid.toInt( &ok ); | 2572 | int wid = uid.toInt( &ok ); |
2557 | qDebug("UID %s ", uid.latin1()); | 2573 | qDebug("UID %s ", uid.latin1()); |
2558 | if ( ok ) { | 2574 | if ( ok ) { |
2559 | if ( wid != QApplication::desktop()->width() ) { | 2575 | if ( wid != QApplication::desktop()->width() ) { |
2560 | qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); | 2576 | qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); |
2561 | message( i18n("Resizing, please wait...") ); | 2577 | message( i18n("Resizing, please wait...") ); |
2562 | mMainWindow->showMinimized(); | 2578 | mMainWindow->showMinimized(); |
2563 | /* | 2579 | /* |
2564 | { | 2580 | { |
2565 | QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); | 2581 | QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); |
2566 | } | 2582 | } |
2567 | */ | 2583 | */ |
2568 | QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); | 2584 | QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); |
2569 | return; | 2585 | return; |
2570 | } | 2586 | } |
2571 | 2587 | ||
2572 | } else { | 2588 | } else { |
2573 | qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); | 2589 | qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); |
2574 | } | 2590 | } |
2575 | callContactdialog(); | 2591 | callContactdialog(); |
2576 | //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); | 2592 | //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); |
2577 | #endif | 2593 | #endif |
2578 | } | 2594 | } |
2579 | void KABCore::resizeAndCallContactdialog() | 2595 | void KABCore::resizeAndCallContactdialog() |
2580 | { | 2596 | { |
2581 | updateMainWindow(); | 2597 | updateMainWindow(); |
2582 | QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); | 2598 | QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); |
2583 | } | 2599 | } |
2584 | 2600 | ||
2585 | void KABCore::doRingSync() | 2601 | void KABCore::doRingSync() |
2586 | { | 2602 | { |
2587 | topLevelWidget()->raise(); | 2603 | topLevelWidget()->raise(); |
2588 | syncManager->multiSync( false ); | 2604 | syncManager->multiSync( false ); |
2589 | } | 2605 | } |
2590 | void KABCore::callContactdialog() | 2606 | void KABCore::callContactdialog() |
2591 | { | 2607 | { |
2592 | static bool running = false; | 2608 | static bool running = false; |
2593 | if (running) return; | 2609 | if (running) return; |
2594 | running = true; | 2610 | running = true; |
2595 | QStringList nameList; | 2611 | QStringList nameList; |
2596 | QStringList emailList; | 2612 | QStringList emailList; |
2597 | QStringList uidList; | 2613 | QStringList uidList; |
2598 | qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() ); | 2614 | qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() ); |
2599 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); | 2615 | KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); |
2600 | uint i=0; | 2616 | uint i=0; |
2601 | for (i=0; i < list.count(); i++) | 2617 | for (i=0; i < list.count(); i++) |
2602 | { | 2618 | { |
2603 | nameList.append(list[i].realName()); | 2619 | nameList.append(list[i].realName()); |
2604 | emailList.append(list[i].preferredEmail()); | 2620 | emailList.append(list[i].preferredEmail()); |
2605 | uidList.append(list[i].uid()); | 2621 | uidList.append(list[i].uid()); |
2606 | } | 2622 | } |
2607 | QString uid = mEmailSourceUID; | 2623 | QString uid = mEmailSourceUID; |
2608 | //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); | 2624 | //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); |
2609 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); | 2625 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); |
2610 | running = false; | 2626 | running = false; |
2611 | } | 2627 | } |
2612 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays | 2628 | /* this method will be called through the QCop interface from Ko/Pi to select birthdays |
2613 | * to put them into the calendar. | 2629 | * to put them into the calendar. |
2614 | */ | 2630 | */ |
2615 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) | 2631 | void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) |
2616 | { | 2632 | { |
2617 | // qDebug("KABCore::requestForBirthdayList"); | 2633 | // qDebug("KABCore::requestForBirthdayList"); |
2618 | QStringList birthdayList; | 2634 | QStringList birthdayList; |
2619 | QStringList anniversaryList; | 2635 | QStringList anniversaryList; |
2620 | QStringList realNameList; | 2636 | QStringList realNameList; |
2621 | QStringList preferredEmailList; | 2637 | QStringList preferredEmailList; |
2622 | QStringList assembledNameList; | 2638 | QStringList assembledNameList; |
2623 | QStringList uidList; | 2639 | QStringList uidList; |
2624 | 2640 | ||
2625 | KABC::AddressBook::Iterator it; | 2641 | KABC::AddressBook::Iterator it; |
2626 | 2642 | ||
2627 | int count = 0; | 2643 | int count = 0; |
2628 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2644 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2629 | ++count; | 2645 | ++count; |
2630 | } | 2646 | } |
2631 | QProgressBar bar(count,0 ); | 2647 | QProgressBar bar(count,0 ); |
2632 | int w = 300; | 2648 | int w = 300; |
2633 | if ( QApplication::desktop()->width() < 320 ) | 2649 | if ( QApplication::desktop()->width() < 320 ) |
2634 | w = 220; | 2650 | w = 220; |
2635 | int h = bar.sizeHint().height() ; | 2651 | int h = bar.sizeHint().height() ; |
2636 | int dw = QApplication::desktop()->width(); | 2652 | int dw = QApplication::desktop()->width(); |
2637 | int dh = QApplication::desktop()->height(); | 2653 | int dh = QApplication::desktop()->height(); |
2638 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2654 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2639 | bar.show(); | 2655 | bar.show(); |
2640 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); | 2656 | bar.setCaption (i18n("Collecting birthdays - close to abort!") ); |
2641 | qApp->processEvents(); | 2657 | qApp->processEvents(); |
2642 | 2658 | ||
2643 | QDate bday; | 2659 | QDate bday; |
2644 | QString anni; | 2660 | QString anni; |
2645 | QString formattedbday; | 2661 | QString formattedbday; |
2646 | 2662 | ||
2647 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) | 2663 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) |
2648 | { | 2664 | { |
2649 | if ( ! bar.isVisible() ) | 2665 | if ( ! bar.isVisible() ) |
2650 | return; | 2666 | return; |
2651 | bar.setProgress( count++ ); | 2667 | bar.setProgress( count++ ); |
2652 | qApp->processEvents(); | 2668 | qApp->processEvents(); |
2653 | bday = (*it).birthday().date(); | 2669 | bday = (*it).birthday().date(); |
2654 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); | 2670 | anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); |
2655 | 2671 | ||
2656 | if ( bday.isValid() || !anni.isEmpty()) | 2672 | if ( bday.isValid() || !anni.isEmpty()) |
2657 | { | 2673 | { |
2658 | if (bday.isValid()) | 2674 | if (bday.isValid()) |
2659 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); | 2675 | formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); |
2660 | else | 2676 | else |
2661 | formattedbday = "NOTVALID"; | 2677 | formattedbday = "NOTVALID"; |
2662 | if (anni.isEmpty()) | 2678 | if (anni.isEmpty()) |
2663 | anni = "INVALID"; | 2679 | anni = "INVALID"; |
2664 | 2680 | ||
2665 | birthdayList.append(formattedbday); | 2681 | birthdayList.append(formattedbday); |
2666 | anniversaryList.append(anni); //should be ISODate | 2682 | anniversaryList.append(anni); //should be ISODate |
2667 | realNameList.append((*it).realName()); | 2683 | realNameList.append((*it).realName()); |
2668 | preferredEmailList.append((*it).preferredEmail()); | 2684 | preferredEmailList.append((*it).preferredEmail()); |
2669 | assembledNameList.append((*it).assembledName()); | 2685 | assembledNameList.append((*it).realName()); |
2670 | uidList.append((*it).uid()); | 2686 | uidList.append((*it).uid()); |
2671 | 2687 | ||
2672 | //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); | 2688 | //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); |
2673 | } | 2689 | } |
2674 | } | 2690 | } |
2675 | 2691 | ||
2676 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); | 2692 | bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); |
2677 | 2693 | ||
2678 | } | 2694 | } |
2679 | 2695 | ||
2680 | /* this method will be called through the QCop interface from other apps to show details of a contact. | 2696 | /* this method will be called through the QCop interface from other apps to show details of a contact. |
2681 | */ | 2697 | */ |
2682 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) | 2698 | void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) |
2683 | { | 2699 | { |
2684 | //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); | 2700 | //qDebug("KABCore::requestForDetails %s %s %s %s %s", sourceChannel.latin1(), sessionuid.latin1(), name.latin1(), email.latin1(), uid.latin1()); |
2685 | 2701 | ||
2686 | QString foundUid = QString::null; | 2702 | QString foundUid = QString::null; |
2687 | if ( ! uid.isEmpty() ) { | 2703 | if ( ! uid.isEmpty() ) { |
2688 | Addressee adrr = mAddressBook->findByUid( uid ); | 2704 | Addressee adrr = mAddressBook->findByUid( uid ); |
2689 | if ( !adrr.isEmpty() ) { | 2705 | if ( !adrr.isEmpty() ) { |
2690 | foundUid = uid; | 2706 | foundUid = uid; |
2691 | } | 2707 | } |
2692 | if ( email == "sendbacklist" ) { | 2708 | if ( email == "sendbacklist" ) { |
2693 | //qDebug("ssssssssssssssssssssssend "); | 2709 | //qDebug("ssssssssssssssssssssssend "); |
2694 | QStringList nameList; | 2710 | QStringList nameList; |
2695 | QStringList emailList; | 2711 | QStringList emailList; |
2696 | QStringList uidList; | 2712 | QStringList uidList; |
2697 | nameList.append(adrr.realName()); | 2713 | nameList.append(adrr.realName()); |
2698 | emailList = adrr.emails(); | 2714 | emailList = adrr.emails(); |
2699 | uidList.append( adrr.preferredEmail()); | 2715 | uidList.append( adrr.preferredEmail()); |
2700 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); | 2716 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); |
2701 | return; | 2717 | return; |
2702 | } | 2718 | } |
2703 | 2719 | ||
2704 | } | 2720 | } |
2705 | 2721 | ||
2706 | if ( email == "sendbacklist" ) | 2722 | if ( email == "sendbacklist" ) |
2707 | return; | 2723 | return; |
2708 | if (foundUid.isEmpty()) | 2724 | if (foundUid.isEmpty()) |
2709 | { | 2725 | { |
2710 | //find the uid of the person first | 2726 | //find the uid of the person first |
2711 | Addressee::List namelist; | 2727 | Addressee::List namelist; |
2712 | Addressee::List emaillist; | 2728 | Addressee::List emaillist; |
2713 | 2729 | ||
2714 | if (!name.isEmpty()) | 2730 | if (!name.isEmpty()) |
2715 | namelist = mAddressBook->findByName( name ); | 2731 | namelist = mAddressBook->findByName( name ); |
2716 | 2732 | ||
2717 | if (!email.isEmpty()) | 2733 | if (!email.isEmpty()) |
2718 | emaillist = mAddressBook->findByEmail( email ); | 2734 | emaillist = mAddressBook->findByEmail( email ); |
2719 | //qDebug("count %d %d ", namelist.count(),emaillist.count() ); | 2735 | //qDebug("count %d %d ", namelist.count(),emaillist.count() ); |
2720 | //check if we have a match in Namelist and Emaillist | 2736 | //check if we have a match in Namelist and Emaillist |
2721 | if ((namelist.count() == 0) && (emaillist.count() > 0)) { | 2737 | if ((namelist.count() == 0) && (emaillist.count() > 0)) { |
2722 | foundUid = emaillist[0].uid(); | 2738 | foundUid = emaillist[0].uid(); |
2723 | } | 2739 | } |
2724 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) | 2740 | else if ((namelist.count() > 0) && (emaillist.count() == 0)) |
2725 | foundUid = namelist[0].uid(); | 2741 | foundUid = namelist[0].uid(); |
2726 | else | 2742 | else |
2727 | { | 2743 | { |
2728 | for (int i = 0; i < namelist.count(); i++) | 2744 | for (int i = 0; i < namelist.count(); i++) |
2729 | { | 2745 | { |
2730 | for (int j = 0; j < emaillist.count(); j++) | 2746 | for (int j = 0; j < emaillist.count(); j++) |
2731 | { | 2747 | { |
2732 | if (namelist[i] == emaillist[j]) | 2748 | if (namelist[i] == emaillist[j]) |
2733 | { | 2749 | { |
2734 | foundUid = namelist[i].uid(); | 2750 | foundUid = namelist[i].uid(); |
2735 | } | 2751 | } |
2736 | } | 2752 | } |
2737 | } | 2753 | } |
2738 | } | 2754 | } |
2739 | } | 2755 | } |
2740 | else | 2756 | else |
2741 | { | 2757 | { |
2742 | foundUid = uid; | 2758 | foundUid = uid; |
2743 | } | 2759 | } |
2744 | 2760 | ||
2745 | if (!foundUid.isEmpty()) | 2761 | if (!foundUid.isEmpty()) |
2746 | { | 2762 | { |
2747 | 2763 | ||
2748 | // raise Ka/Pi if it is in the background | 2764 | // raise Ka/Pi if it is in the background |
2749 | #ifndef DESKTOP_VERSION | 2765 | #ifndef DESKTOP_VERSION |
2750 | #ifndef KORG_NODCOP | 2766 | #ifndef KORG_NODCOP |
2751 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); | 2767 | //QCopEnvelope e("QPE/Application/kapi", "raise()"); |
2752 | #endif | 2768 | #endif |
2753 | #endif | 2769 | #endif |
2754 | 2770 | ||
2755 | mMainWindow->showMaximized(); | 2771 | mMainWindow->showMaximized(); |
2756 | mMainWindow-> raise(); | 2772 | mMainWindow-> raise(); |
2757 | 2773 | ||
2758 | mViewManager->setSelected( "", false); | 2774 | mViewManager->setSelected( "", false); |
2759 | mViewManager->refreshView( "" ); | 2775 | mViewManager->refreshView( "" ); |
2760 | mViewManager->setSelected( foundUid, true ); | 2776 | mViewManager->setSelected( foundUid, true ); |
2761 | mViewManager->refreshView( foundUid ); | 2777 | mViewManager->refreshView( foundUid ); |
2762 | 2778 | ||
2763 | if ( !mMultipleViewsAtOnce ) | 2779 | if ( !mMultipleViewsAtOnce ) |
2764 | { | 2780 | { |
2765 | setDetailsVisible( true ); | 2781 | setDetailsVisible( true ); |
2766 | mActionDetails->setChecked(true); | 2782 | mActionDetails->setChecked(true); |
2767 | } | 2783 | } |
2768 | } | 2784 | } |
2769 | } | 2785 | } |
2770 | void KABCore::storagehowto() | 2786 | void KABCore::storagehowto() |
2771 | { | 2787 | { |
2772 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); | 2788 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); |
2773 | } | 2789 | } |
2774 | void KABCore::whatsnew() | 2790 | void KABCore::whatsnew() |
2775 | { | 2791 | { |
2776 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 2792 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
2777 | } | 2793 | } |
2778 | void KABCore::synchowto() | 2794 | void KABCore::synchowto() |
2779 | { | 2795 | { |
2780 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 2796 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
2781 | } | 2797 | } |
2782 | void KABCore::kdesynchowto() | 2798 | void KABCore::kdesynchowto() |
2783 | { | 2799 | { |
2784 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 2800 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
2785 | } | 2801 | } |
2786 | void KABCore::multisynchowto() | 2802 | void KABCore::multisynchowto() |
2787 | { | 2803 | { |
2788 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 2804 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
2789 | } | 2805 | } |
2790 | void KABCore::faq() | 2806 | void KABCore::faq() |
2791 | { | 2807 | { |
2792 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); | 2808 | KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); |
2793 | } | 2809 | } |
2794 | 2810 | ||
2795 | #include <libkcal/syncdefines.h> | 2811 | #include <libkcal/syncdefines.h> |
2796 | 2812 | ||
2797 | KABC::Addressee KABCore::getLastSyncAddressee() | 2813 | KABC::Addressee KABCore::getLastSyncAddressee() |
2798 | { | 2814 | { |
2799 | Addressee lse; | 2815 | Addressee lse; |
2800 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2816 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2801 | 2817 | ||
2802 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); | 2818 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); |
2803 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2819 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2804 | if (lse.isEmpty()) { | 2820 | if (lse.isEmpty()) { |
2805 | qDebug("KA: Creating new last-syncAddressee "); | 2821 | qDebug("KA: Creating new last-syncAddressee "); |
2806 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2822 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2807 | QString sum = ""; | 2823 | QString sum = ""; |
2808 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 2824 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
2809 | sum = "E: "; | 2825 | sum = "E: "; |
2810 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); | 2826 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); |
2811 | lse.setRevision( mLastAddressbookSync ); | 2827 | lse.setRevision( mLastAddressbookSync ); |
2812 | lse.setCategories( i18n("SyncEvent") ); | 2828 | lse.setCategories( i18n("SyncEvent") ); |
2813 | mAddressBook->insertAddressee( lse ); | 2829 | mAddressBook->insertAddressee( lse ); |
2814 | } | 2830 | } |
2815 | return lse; | 2831 | return lse; |
2816 | } | 2832 | } |
2817 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) | 2833 | int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, int mode , bool full ) |
2818 | { | 2834 | { |
2819 | 2835 | ||
2820 | //void setZaurusId(int id); | 2836 | //void setZaurusId(int id); |
2821 | // int zaurusId() const; | 2837 | // int zaurusId() const; |
2822 | // void setZaurusUid(int id); | 2838 | // void setZaurusUid(int id); |
2823 | // int zaurusUid() const; | 2839 | // int zaurusUid() const; |
2824 | // void setZaurusStat(int id); | 2840 | // void setZaurusStat(int id); |
2825 | // int zaurusStat() const; | 2841 | // int zaurusStat() const; |
2826 | // 0 equal | 2842 | // 0 equal |
2827 | // 1 take local | 2843 | // 1 take local |
2828 | // 2 take remote | 2844 | // 2 take remote |
2829 | // 3 cancel | 2845 | // 3 cancel |
2830 | QDateTime lastSync = mLastAddressbookSync; | 2846 | QDateTime lastSync = mLastAddressbookSync; |
2831 | QDateTime localMod = local->revision(); | 2847 | QDateTime localMod = local->revision(); |
2832 | QDateTime remoteMod = remote->revision(); | 2848 | QDateTime remoteMod = remote->revision(); |
2833 | 2849 | ||
2834 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2850 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2835 | 2851 | ||
2836 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2852 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2837 | bool remCh, locCh; | 2853 | bool remCh, locCh; |
2838 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); | 2854 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); |
2839 | //if ( remCh ) | 2855 | //if ( remCh ) |
2840 | // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); | 2856 | // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); |
2841 | locCh = ( localMod > mLastAddressbookSync ); | 2857 | locCh = ( localMod > mLastAddressbookSync ); |
2842 | //qDebug("cahnged rem %d loc %d",remCh, locCh ); | 2858 | //qDebug("cahnged rem %d loc %d",remCh, locCh ); |
2843 | if ( !remCh && ! locCh ) { | 2859 | if ( !remCh && ! locCh ) { |
2844 | //qDebug("both not changed "); | 2860 | //qDebug("both not changed "); |
2845 | lastSync = localMod.addDays(1); | 2861 | lastSync = localMod.addDays(1); |
2846 | if ( mode <= SYNC_PREF_ASK ) | 2862 | if ( mode <= SYNC_PREF_ASK ) |
2847 | return 0; | 2863 | return 0; |
2848 | } else { | 2864 | } else { |
2849 | if ( locCh ) { | 2865 | if ( locCh ) { |
2850 | //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); | 2866 | //qDebug("loc changed %s %s", localMod.toString().latin1(), mLastAddressbookSync.toString().latin1()); |
2851 | lastSync = localMod.addDays( -1 ); | 2867 | lastSync = localMod.addDays( -1 ); |
2852 | if ( !remCh ) | 2868 | if ( !remCh ) |
2853 | remoteMod =( lastSync.addDays( -1 ) ); | 2869 | remoteMod =( lastSync.addDays( -1 ) ); |
2854 | } else { | 2870 | } else { |
2855 | //qDebug(" not loc changed "); | 2871 | //qDebug(" not loc changed "); |
2856 | lastSync = localMod.addDays( 1 ); | 2872 | lastSync = localMod.addDays( 1 ); |
2857 | if ( remCh ) { | 2873 | if ( remCh ) { |
2858 | //qDebug("rem changed "); | 2874 | //qDebug("rem changed "); |
2859 | remoteMod =( lastSync.addDays( 1 ) ); | 2875 | remoteMod =( lastSync.addDays( 1 ) ); |
2860 | } | 2876 | } |
2861 | 2877 | ||
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index ea254b7..42d541b 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -1,156 +1,157 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | //US#ifdef KAB_EMBEDDED | 24 | //US#ifdef KAB_EMBEDDED |
25 | //#include <qstring.h> | 25 | //#include <qstring.h> |
26 | //#endif //KAB_EMBEDDED | 26 | //#endif //KAB_EMBEDDED |
27 | 27 | ||
28 | #include <qtextstream.h> | 28 | #include <qtextstream.h> |
29 | #include <qfile.h> | 29 | #include <qfile.h> |
30 | #include <qregexp.h> | 30 | #include <qregexp.h> |
31 | #include <stdlib.h> | 31 | #include <stdlib.h> |
32 | #include <libkdepim/kpimglobalprefs.h> | 32 | #include <libkdepim/kpimglobalprefs.h> |
33 | 33 | ||
34 | #include <kconfig.h> | 34 | #include <kconfig.h> |
35 | #include <klocale.h> | 35 | #include <klocale.h> |
36 | #include <kstaticdeleter.h> | 36 | #include <kstaticdeleter.h> |
37 | #include <kglobalsettings.h> | 37 | #include <kglobalsettings.h> |
38 | //US#include <kdebug.h> // defines kdDebug() | 38 | //US#include <kdebug.h> // defines kdDebug() |
39 | 39 | ||
40 | #include "kabprefs.h" | 40 | #include "kabprefs.h" |
41 | 41 | ||
42 | #ifdef DESKTOP_VERSION | 42 | #ifdef DESKTOP_VERSION |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | KABPrefs *KABPrefs::sInstance = 0; | 46 | KABPrefs *KABPrefs::sInstance = 0; |
47 | static KStaticDeleter<KABPrefs> staticDeleterAB; | 47 | static KStaticDeleter<KABPrefs> staticDeleterAB; |
48 | 48 | ||
49 | KABPrefs::KABPrefs() | 49 | KABPrefs::KABPrefs() |
50 | : KPimPrefs("kaddressbookrc") | 50 | : KPimPrefs("kaddressbookrc") |
51 | { | 51 | { |
52 | KPrefs::setCurrentGroup( "Views" ); | 52 | KPrefs::setCurrentGroup( "Views" ); |
53 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); | 53 | addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); |
54 | 54 | ||
55 | KPrefs::setCurrentGroup( "General" ); | 55 | KPrefs::setCurrentGroup( "General" ); |
56 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); | 56 | addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); |
57 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); | 57 | addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); |
58 | #ifdef KAB_EMBEDDED | 58 | #ifdef KAB_EMBEDDED |
59 | addItemBool("AskForDelete",&mAskForDelete,true); | ||
59 | addItemBool("AskForQuit",&mAskForQuit,true); | 60 | addItemBool("AskForQuit",&mAskForQuit,true); |
60 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 61 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
61 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 62 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
62 | addItemBool("SearchWithReturn",&mSearchWithReturn, false ); | 63 | addItemBool("SearchWithReturn",&mSearchWithReturn, false ); |
63 | addItemBool("AutoSearchWithWildcard",&mAutoSearchWithWildcard, false ); | 64 | addItemBool("AutoSearchWithWildcard",&mAutoSearchWithWildcard, false ); |
64 | addItemBool("HideSearchOnSwitch",&mHideSearchOnSwitch, false ); | 65 | addItemBool("HideSearchOnSwitch",&mHideSearchOnSwitch, false ); |
65 | addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); | 66 | addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); |
66 | 67 | ||
67 | 68 | ||
68 | #endif //KAB_EMBEDDED | 69 | #endif //KAB_EMBEDDED |
69 | 70 | ||
70 | KPrefs::setCurrentGroup( "MainWindow" ); | 71 | KPrefs::setCurrentGroup( "MainWindow" ); |
71 | bool m_visible = false; | 72 | bool m_visible = false; |
72 | #ifdef DESKTOP_VERSION | 73 | #ifdef DESKTOP_VERSION |
73 | m_visible = true; | 74 | m_visible = true; |
74 | #endif | 75 | #endif |
75 | addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); | 76 | addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); |
76 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); | 77 | addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); |
77 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); | 78 | addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); |
78 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); | 79 | addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); |
79 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); | 80 | addItemIntList( "DetailsSplitter", &mDetailsSplitter ); |
80 | addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); | 81 | addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); |
81 | 82 | ||
82 | 83 | ||
83 | KPrefs::setCurrentGroup( "Extensions_General" ); | 84 | KPrefs::setCurrentGroup( "Extensions_General" ); |
84 | QStringList defaultExtensions; | 85 | QStringList defaultExtensions; |
85 | defaultExtensions << "merge"; | 86 | defaultExtensions << "merge"; |
86 | defaultExtensions << "distribution_list_editor"; | 87 | defaultExtensions << "distribution_list_editor"; |
87 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); | 88 | addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); |
88 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); | 89 | addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); |
89 | 90 | ||
90 | KPrefs::setCurrentGroup( "Views" ); | 91 | KPrefs::setCurrentGroup( "Views" ); |
91 | QString defaultView = i18n( "Default Table View" ); | 92 | QString defaultView = i18n( "Default Table View" ); |
92 | addItemString( "CurrentView", &mCurrentView, defaultView ); | 93 | addItemString( "CurrentView", &mCurrentView, defaultView ); |
93 | addItemStringList( "ViewNames", &mViewNames, defaultView ); | 94 | addItemStringList( "ViewNames", &mViewNames, defaultView ); |
94 | 95 | ||
95 | KPrefs::setCurrentGroup( "Filters" ); | 96 | KPrefs::setCurrentGroup( "Filters" ); |
96 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); | 97 | addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); |
97 | 98 | ||
98 | } | 99 | } |
99 | 100 | ||
100 | KABPrefs::~KABPrefs() | 101 | KABPrefs::~KABPrefs() |
101 | { | 102 | { |
102 | //qDebug("KABPrefs::~KABPrefs() "); | 103 | //qDebug("KABPrefs::~KABPrefs() "); |
103 | if (sInstance == this) | 104 | if (sInstance == this) |
104 | sInstance = staticDeleterAB.setObject(0); | 105 | sInstance = staticDeleterAB.setObject(0); |
105 | } | 106 | } |
106 | 107 | ||
107 | KABPrefs *KABPrefs::instance() | 108 | KABPrefs *KABPrefs::instance() |
108 | { | 109 | { |
109 | if ( !sInstance ) { | 110 | if ( !sInstance ) { |
110 | #ifdef KAB_EMBEDDED | 111 | #ifdef KAB_EMBEDDED |
111 | sInstance = staticDeleterAB.setObject( new KABPrefs() ); | 112 | sInstance = staticDeleterAB.setObject( new KABPrefs() ); |
112 | #else //KAB_EMBEDDED | 113 | #else //KAB_EMBEDDED |
113 | //US the following line has changed ???. Why | 114 | //US the following line has changed ???. Why |
114 | staticDeleterAB.setObject( sInstance, new KABPrefs() ); | 115 | staticDeleterAB.setObject( sInstance, new KABPrefs() ); |
115 | #endif //KAB_EMBEDDED | 116 | #endif //KAB_EMBEDDED |
116 | sInstance->readConfig(); | 117 | sInstance->readConfig(); |
117 | } | 118 | } |
118 | 119 | ||
119 | return sInstance; | 120 | return sInstance; |
120 | } | 121 | } |
121 | 122 | ||
122 | void KABPrefs::setCategoryDefaults() | 123 | void KABPrefs::setCategoryDefaults() |
123 | { | 124 | { |
124 | mCustomCategories.clear(); | 125 | mCustomCategories.clear(); |
125 | 126 | ||
126 | mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) | 127 | mCustomCategories << i18n( "Business" ) << i18n( "Family" ) << i18n( "School" ) |
127 | << i18n( "Customer" ) << i18n( "Friend" ); | 128 | << i18n( "Customer" ) << i18n( "Friend" ); |
128 | } | 129 | } |
129 | 130 | ||
130 | // US introduce a nonconst way to return the config object. | 131 | // US introduce a nonconst way to return the config object. |
131 | KConfig* KABPrefs::getConfig() | 132 | KConfig* KABPrefs::getConfig() |
132 | { | 133 | { |
133 | return config(); | 134 | return config(); |
134 | } | 135 | } |
135 | void KABPrefs::usrReadConfig() | 136 | void KABPrefs::usrReadConfig() |
136 | { | 137 | { |
137 | KPimPrefs::usrReadConfig(); | 138 | KPimPrefs::usrReadConfig(); |
138 | } | 139 | } |
139 | 140 | ||
140 | 141 | ||
141 | /*US | 142 | /*US |
142 | void KABPrefs::usrSetDefaults() | 143 | void KABPrefs::usrSetDefaults() |
143 | { | 144 | { |
144 | KPimPrefs::usrSetDefaults(); | 145 | KPimPrefs::usrSetDefaults(); |
145 | } | 146 | } |
146 | 147 | ||
147 | void KABPrefs::usrReadConfig() | 148 | void KABPrefs::usrReadConfig() |
148 | { | 149 | { |
149 | KPimPrefs::usrReadConfig(); | 150 | KPimPrefs::usrReadConfig(); |
150 | } | 151 | } |
151 | 152 | ||
152 | void KABPrefs::usrWriteConfig() | 153 | void KABPrefs::usrWriteConfig() |
153 | { | 154 | { |
154 | KPimPrefs::usrWriteConfig(); | 155 | KPimPrefs::usrWriteConfig(); |
155 | } | 156 | } |
156 | */ | 157 | */ |
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index 2bb173d..ddbc0c0 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h | |||
@@ -1,98 +1,99 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> | 3 | Copyright (c) 2002 Mike Pilone <mpilone@slac.com> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KABPREFS_H | 24 | #ifndef KABPREFS_H |
25 | #define KABPREFS_H | 25 | #define KABPREFS_H |
26 | 26 | ||
27 | #include <qstringlist.h> | 27 | #include <qstringlist.h> |
28 | #include <qdict.h> | 28 | #include <qdict.h> |
29 | 29 | ||
30 | #include <libkdepim/kpimprefs.h> | 30 | #include <libkdepim/kpimprefs.h> |
31 | 31 | ||
32 | class KConfig; | 32 | class KConfig; |
33 | 33 | ||
34 | class KABPrefs : public KPimPrefs | 34 | class KABPrefs : public KPimPrefs |
35 | { | 35 | { |
36 | public: | 36 | public: |
37 | virtual ~KABPrefs(); | 37 | virtual ~KABPrefs(); |
38 | 38 | ||
39 | static KABPrefs *instance(); | 39 | static KABPrefs *instance(); |
40 | 40 | ||
41 | // General | 41 | // General |
42 | bool mHonorSingleClick; | 42 | bool mHonorSingleClick; |
43 | bool mAutomaticNameParsing; | 43 | bool mAutomaticNameParsing; |
44 | int mCurrentIncSearchField; | 44 | int mCurrentIncSearchField; |
45 | 45 | ||
46 | #ifdef KAB_EMBEDDED | 46 | #ifdef KAB_EMBEDDED |
47 | // US introduce a nonconst way to return the config object. | 47 | // US introduce a nonconst way to return the config object. |
48 | KConfig* getConfig(); | 48 | KConfig* getConfig(); |
49 | 49 | ||
50 | bool mToolBarHor; | 50 | bool mToolBarHor; |
51 | bool mToolBarUp; | 51 | bool mToolBarUp; |
52 | bool mAskForQuit; | 52 | bool mAskForQuit; |
53 | 53 | ||
54 | 54 | ||
55 | /** Set preferences to default values */ | 55 | /** Set preferences to default values */ |
56 | // void usrSetDefaults(); | 56 | // void usrSetDefaults(); |
57 | 57 | ||
58 | /** Read preferences from config file */ | 58 | /** Read preferences from config file */ |
59 | // void usrReadConfig(); | 59 | // void usrReadConfig(); |
60 | 60 | ||
61 | /** Write preferences to config file */ | 61 | /** Write preferences to config file */ |
62 | // void usrWriteConfig(); | 62 | // void usrWriteConfig(); |
63 | #endif //KAB_EMBEDDED | 63 | #endif //KAB_EMBEDDED |
64 | void usrReadConfig(); | 64 | void usrReadConfig(); |
65 | 65 | ||
66 | 66 | ||
67 | // GUI | 67 | // GUI |
68 | bool mFullMenuBarVisible; | 68 | bool mFullMenuBarVisible; |
69 | bool mJumpButtonBarVisible; | 69 | bool mJumpButtonBarVisible; |
70 | bool mDetailsPageVisible; | 70 | bool mDetailsPageVisible; |
71 | bool mMultipleViewsAtOnce; | 71 | bool mMultipleViewsAtOnce; |
72 | bool mSearchWithReturn; | 72 | bool mSearchWithReturn; |
73 | bool mAutoSearchWithWildcard; | 73 | bool mAutoSearchWithWildcard; |
74 | bool mHideSearchOnSwitch; | 74 | bool mHideSearchOnSwitch; |
75 | bool mAskForDelete; | ||
75 | QValueList<int> mExtensionsSplitter; | 76 | QValueList<int> mExtensionsSplitter; |
76 | QValueList<int> mDetailsSplitter; | 77 | QValueList<int> mDetailsSplitter; |
77 | 78 | ||
78 | // Extensions stuff | 79 | // Extensions stuff |
79 | int mCurrentExtension; | 80 | int mCurrentExtension; |
80 | QStringList mActiveExtensions; | 81 | QStringList mActiveExtensions; |
81 | 82 | ||
82 | // Views stuff | 83 | // Views stuff |
83 | QString mCurrentView; | 84 | QString mCurrentView; |
84 | QStringList mViewNames; | 85 | QStringList mViewNames; |
85 | 86 | ||
86 | // Filter | 87 | // Filter |
87 | int mCurrentFilter; | 88 | int mCurrentFilter; |
88 | 89 | ||
89 | void setCategoryDefaults(); | 90 | void setCategoryDefaults(); |
90 | QFont mDetailsFont; | 91 | QFont mDetailsFont; |
91 | 92 | ||
92 | private: | 93 | private: |
93 | KABPrefs(); | 94 | KABPrefs(); |
94 | 95 | ||
95 | static KABPrefs *sInstance; | 96 | static KABPrefs *sInstance; |
96 | }; | 97 | }; |
97 | 98 | ||
98 | #endif | 99 | #endif |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 1b4652a..9e4db74 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp | |||
@@ -1,418 +1,424 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | #include <qframe.h> | 25 | #include <qframe.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qtabwidget.h> | 29 | #include <qtabwidget.h> |
30 | #include <qcombobox.h> | 30 | #include <qcombobox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qlabel.h> | 32 | #include <qlabel.h> |
33 | #include <qfile.h> | 33 | #include <qfile.h> |
34 | #include <qvbox.h> | 34 | #include <qvbox.h> |
35 | 35 | ||
36 | #include <kconfig.h> | 36 | #include <kconfig.h> |
37 | #include <kdebug.h> | 37 | #include <kdebug.h> |
38 | #include <kdialog.h> | 38 | #include <kdialog.h> |
39 | #include <klistview.h> | 39 | #include <klistview.h> |
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <kglobal.h> | 41 | #include <kglobal.h> |
42 | #include <kmessagebox.h> | 42 | #include <kmessagebox.h> |
43 | #include <kstandarddirs.h> | 43 | #include <kstandarddirs.h> |
44 | 44 | ||
45 | #ifndef KAB_EMBEDDED | 45 | #ifndef KAB_EMBEDDED |
46 | #include <ktrader.h> | 46 | #include <ktrader.h> |
47 | #else // KAB_EMBEDDED | 47 | #else // KAB_EMBEDDED |
48 | #include <mergewidget.h> | 48 | #include <mergewidget.h> |
49 | #include <distributionlistwidget.h> | 49 | #include <distributionlistwidget.h> |
50 | #endif // KAB_EMBEDDED | 50 | #endif // KAB_EMBEDDED |
51 | 51 | ||
52 | #include "addresseewidget.h" | 52 | #include "addresseewidget.h" |
53 | #include "extensionconfigdialog.h" | 53 | #include "extensionconfigdialog.h" |
54 | #include "extensionwidget.h" | 54 | #include "extensionwidget.h" |
55 | #include "kabprefs.h" | 55 | #include "kabprefs.h" |
56 | 56 | ||
57 | #include "kabconfigwidget.h" | 57 | #include "kabconfigwidget.h" |
58 | #include <kglobalsettings.h> | 58 | #include <kglobalsettings.h> |
59 | 59 | ||
60 | class ExtensionItem : public QCheckListItem | 60 | class ExtensionItem : public QCheckListItem |
61 | { | 61 | { |
62 | public: | 62 | public: |
63 | 63 | ||
64 | #ifndef KAB_EMBEDDED | 64 | #ifndef KAB_EMBEDDED |
65 | ExtensionItem( QListView *parent, const QString &text ); | 65 | ExtensionItem( QListView *parent, const QString &text ); |
66 | void setService( const KService::Ptr &ptr ); | 66 | void setService( const KService::Ptr &ptr ); |
67 | #else //KAB_EMBEDDED | 67 | #else //KAB_EMBEDDED |
68 | ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); | 68 | ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ); |
69 | void setFactory( ExtensionFactory* fac ); | 69 | void setFactory( ExtensionFactory* fac ); |
70 | #endif //KAB_EMBEDDED | 70 | #endif //KAB_EMBEDDED |
71 | 71 | ||
72 | bool configWidgetAvailable() const; | 72 | bool configWidgetAvailable() const; |
73 | ExtensionFactory *factory() const; | 73 | ExtensionFactory *factory() const; |
74 | 74 | ||
75 | virtual QString text( int column ) const; | 75 | virtual QString text( int column ) const; |
76 | 76 | ||
77 | private: | 77 | private: |
78 | #ifndef KAB_EMBEDDED | 78 | #ifndef KAB_EMBEDDED |
79 | KService::Ptr mPtr; | 79 | KService::Ptr mPtr; |
80 | #else //KAB_EMBEDDED | 80 | #else //KAB_EMBEDDED |
81 | ExtensionFactory* mFactory; | 81 | ExtensionFactory* mFactory; |
82 | QString mName; | 82 | QString mName; |
83 | QString mComment; | 83 | QString mComment; |
84 | 84 | ||
85 | #endif //KAB_EMBEDDED | 85 | #endif //KAB_EMBEDDED |
86 | 86 | ||
87 | }; | 87 | }; |
88 | 88 | ||
89 | KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) | 89 | KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *name ) |
90 | : KPrefsWidget( prefs, parent, name ) | 90 | : KPrefsWidget( prefs, parent, name ) |
91 | { | 91 | { |
92 | 92 | ||
93 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 93 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
94 | KDialog::spacingHintSmall() ); | 94 | KDialog::spacingHintSmall() ); |
95 | 95 | ||
96 | QTabWidget *tabWidget = new QTabWidget( this ); | 96 | QTabWidget *tabWidget = new QTabWidget( this ); |
97 | topLayout->addWidget( tabWidget ); | 97 | topLayout->addWidget( tabWidget ); |
98 | 98 | ||
99 | // General page | 99 | // General page |
100 | QWidget *generalPage = new QWidget( this ); | 100 | QWidget *generalPage = new QWidget( this ); |
101 | QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), | 101 | QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), |
102 | KDialog::spacingHintSmall() ); | 102 | KDialog::spacingHintSmall() ); |
103 | 103 | ||
104 | 104 | ||
105 | QWidget *hBox = new QWidget( generalPage, "qhbox" ); | 105 | QWidget *hBox = new QWidget( generalPage, "qhbox" ); |
106 | QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); | 106 | QHBoxLayout *hboxLayout = new QHBoxLayout( hBox); |
107 | KPrefsWidFont *detailsFont = | 107 | KPrefsWidFont *detailsFont = |
108 | addWidFont(i18n("phone:123"),i18n("Details view font"), | 108 | addWidFont(i18n("phone:123"),i18n("Details view font"), |
109 | &(KABPrefs::instance()->mDetailsFont),hBox); | 109 | &(KABPrefs::instance()->mDetailsFont),hBox); |
110 | hboxLayout->addWidget(detailsFont->label()); | 110 | hboxLayout->addWidget(detailsFont->label()); |
111 | hboxLayout->addWidget(detailsFont->preview()); | 111 | hboxLayout->addWidget(detailsFont->preview()); |
112 | hboxLayout->addWidget(detailsFont->button()); | 112 | hboxLayout->addWidget(detailsFont->button()); |
113 | hboxLayout->setMargin(KDialog::marginHintSmall() ); | 113 | hboxLayout->setMargin(KDialog::marginHintSmall() ); |
114 | hboxLayout->setSpacing(KDialog::spacingHintSmall()); | 114 | hboxLayout->setSpacing(KDialog::spacingHintSmall()); |
115 | //hBox->setBackgroundColor( black); | 115 | //hBox->setBackgroundColor( black); |
116 | layout->addWidget( hBox ); | 116 | layout->addWidget( hBox ); |
117 | 117 | ||
118 | //general groupbox | 118 | //general groupbox |
119 | QWidget *vBox = new QWidget( generalPage, "qvbox" ); | 119 | QWidget *vBox = new QWidget( generalPage, "qvbox" ); |
120 | QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); | 120 | QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); |
121 | boxLayout->setAlignment( Qt::AlignTop ); | 121 | boxLayout->setAlignment( Qt::AlignTop ); |
122 | boxLayout->setMargin(KDialog::marginHintSmall() ); | 122 | boxLayout->setMargin(KDialog::marginHintSmall() ); |
123 | boxLayout->setSpacing( KDialog::spacingHintSmall() ); | 123 | boxLayout->setSpacing( KDialog::spacingHintSmall() ); |
124 | mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); | 124 | mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); |
125 | boxLayout->addWidget( mMenuBarBox ); | 125 | boxLayout->addWidget( mMenuBarBox ); |
126 | mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); | 126 | mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); |
127 | boxLayout->addWidget( mSearchReturnBox ); | 127 | boxLayout->addWidget( mSearchReturnBox ); |
128 | mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" ); | 128 | mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" ); |
129 | boxLayout->addWidget( mAutoSearchWithWildcardBox); | 129 | boxLayout->addWidget( mAutoSearchWithWildcardBox); |
130 | mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" ); | 130 | mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" ); |
131 | boxLayout->addWidget( mHideSearchOnSwitchBox ); | 131 | boxLayout->addWidget( mHideSearchOnSwitchBox ); |
132 | 132 | ||
133 | #ifdef DESKTOP_VERSION | 133 | #ifdef DESKTOP_VERSION |
134 | mHideSearchOnSwitchBox->hide(); | 134 | mHideSearchOnSwitchBox->hide(); |
135 | #endif | 135 | #endif |
136 | mViewsSingleClickBox = new QCheckBox( i18n( "Show edit dialog on single click" ), vBox, "msingle" ); | 136 | mViewsSingleClickBox = new QCheckBox( i18n( "Show edit dialog on single click" ), vBox, "msingle" ); |
137 | boxLayout->addWidget( mViewsSingleClickBox ); | 137 | boxLayout->addWidget( mViewsSingleClickBox ); |
138 | 138 | ||
139 | mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new contacts" ), vBox, "mparse" ); | 139 | mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new contacts" ), vBox, "mparse" ); |
140 | boxLayout->addWidget( mNameParsing ); | 140 | boxLayout->addWidget( mNameParsing ); |
141 | 141 | ||
142 | mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" ); | 142 | mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" ); |
143 | boxLayout->addWidget( mMultipleViewsAtOnce ); | 143 | boxLayout->addWidget( mMultipleViewsAtOnce ); |
144 | 144 | ||
145 | mAskForDelete = new QCheckBox( i18n( "Ask before delete contact" ), vBox, "mdel" ); | ||
146 | boxLayout->addWidget( mAskForDelete ); | ||
147 | |||
145 | mAskForQuit = new QCheckBox( i18n( "Show exit confirmation" ), vBox, "mquit" ); | 148 | mAskForQuit = new QCheckBox( i18n( "Show exit confirmation" ), vBox, "mquit" ); |
146 | boxLayout->addWidget( mAskForQuit ); | 149 | boxLayout->addWidget( mAskForQuit ); |
147 | 150 | ||
148 | layout->addWidget( vBox ); | 151 | layout->addWidget( vBox ); |
149 | 152 | ||
150 | tabWidget->addTab( generalPage, i18n( "General" ) ); | 153 | tabWidget->addTab( generalPage, i18n( "General" ) ); |
151 | 154 | ||
152 | // Extension page | 155 | // Extension page |
153 | QWidget *extensionPage = new QWidget( this ); | 156 | QWidget *extensionPage = new QWidget( this ); |
154 | QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), | 157 | QVBoxLayout *extensionLayout = new QVBoxLayout( extensionPage, KDialog::marginHintSmall(), |
155 | KDialog::spacingHintSmall() ); | 158 | KDialog::spacingHintSmall() ); |
156 | 159 | ||
157 | //extensions groupbox | 160 | //extensions groupbox |
158 | 161 | ||
159 | QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); | 162 | QGroupBox* groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), extensionPage ); |
160 | boxLayout = new QVBoxLayout( groupBox->layout() ); | 163 | boxLayout = new QVBoxLayout( groupBox->layout() ); |
161 | boxLayout->setAlignment( Qt::AlignTop ); | 164 | boxLayout->setAlignment( Qt::AlignTop ); |
162 | boxLayout->setMargin(KDialog::marginHintSmall()); | 165 | boxLayout->setMargin(KDialog::marginHintSmall()); |
163 | boxLayout->setSpacing(KDialog::spacingHintSmall()); | 166 | boxLayout->setSpacing(KDialog::spacingHintSmall()); |
164 | groupBox->layout()->setMargin(1) ; | 167 | groupBox->layout()->setMargin(1) ; |
165 | groupBox->layout()->setSpacing(0); | 168 | groupBox->layout()->setSpacing(0); |
166 | mExtensionView = new KListView( groupBox ); | 169 | mExtensionView = new KListView( groupBox ); |
167 | mExtensionView->setAllColumnsShowFocus( true ); | 170 | mExtensionView->setAllColumnsShowFocus( true ); |
168 | mExtensionView->addColumn( i18n( "Name" ) ); | 171 | mExtensionView->addColumn( i18n( "Name" ) ); |
169 | mExtensionView->addColumn( i18n( "Description" ) ); | 172 | mExtensionView->addColumn( i18n( "Description" ) ); |
170 | //mExtensionView->setMaximumHeight(80); | 173 | //mExtensionView->setMaximumHeight(80); |
171 | 174 | ||
172 | boxLayout->addWidget( mExtensionView ); | 175 | boxLayout->addWidget( mExtensionView ); |
173 | 176 | ||
174 | mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); | 177 | mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); |
175 | mConfigureButton->setEnabled( false ); | 178 | mConfigureButton->setEnabled( false ); |
176 | boxLayout->addWidget( mConfigureButton ); | 179 | boxLayout->addWidget( mConfigureButton ); |
177 | 180 | ||
178 | extensionLayout->addWidget( groupBox ); | 181 | extensionLayout->addWidget( groupBox ); |
179 | 182 | ||
180 | connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 183 | connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
181 | connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 184 | connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
182 | connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 185 | connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
183 | connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 186 | connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
184 | connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 187 | connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
185 | connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 188 | connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
186 | connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 189 | connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
187 | connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 190 | connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
191 | connect( mAskForDelete, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | ||
188 | connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), | 192 | connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), |
189 | SLOT( selectionChanged( QListViewItem* ) ) ); | 193 | SLOT( selectionChanged( QListViewItem* ) ) ); |
190 | connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), | 194 | connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), |
191 | SLOT( itemClicked( QListViewItem* ) ) ); | 195 | SLOT( itemClicked( QListViewItem* ) ) ); |
192 | connect( mConfigureButton, SIGNAL( clicked() ), | 196 | connect( mConfigureButton, SIGNAL( clicked() ), |
193 | SLOT( configureExtension() ) ); | 197 | SLOT( configureExtension() ) ); |
194 | 198 | ||
195 | tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); | 199 | tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); |
196 | 200 | ||
197 | // Addressee page | 201 | // Addressee page |
198 | mAddresseeWidget = new AddresseeWidget( this ); | 202 | mAddresseeWidget = new AddresseeWidget( this ); |
199 | tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); | 203 | tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); |
200 | connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); | 204 | connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); |
201 | 205 | ||
202 | } | 206 | } |
203 | 207 | ||
204 | void KABConfigWidget::usrReadConfig() | 208 | void KABConfigWidget::usrReadConfig() |
205 | { | 209 | { |
206 | KABPrefs* prefs = KABPrefs::instance(); | 210 | KABPrefs* prefs = KABPrefs::instance(); |
207 | 211 | ||
208 | bool blocked = signalsBlocked(); | 212 | bool blocked = signalsBlocked(); |
209 | blockSignals( true ); | 213 | blockSignals( true ); |
210 | mMenuBarBox->setChecked( prefs->mFullMenuBarVisible); | 214 | mMenuBarBox->setChecked( prefs->mFullMenuBarVisible); |
211 | mNameParsing->setChecked( prefs->mAutomaticNameParsing ); | 215 | mNameParsing->setChecked( prefs->mAutomaticNameParsing ); |
212 | mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); | 216 | mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); |
213 | mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); | 217 | mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); |
214 | mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard ); | 218 | mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard ); |
215 | mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch ); | 219 | mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch ); |
216 | mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); | 220 | mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); |
217 | mAskForQuit->setChecked( prefs->mAskForQuit ); | 221 | mAskForQuit->setChecked( prefs->mAskForQuit ); |
222 | mAskForDelete->setChecked( prefs->mAskForDelete ); | ||
218 | 223 | ||
219 | mAddresseeWidget->restoreSettings(); | 224 | mAddresseeWidget->restoreSettings(); |
220 | 225 | ||
221 | restoreExtensionSettings(); | 226 | restoreExtensionSettings(); |
222 | 227 | ||
223 | blockSignals( blocked ); | 228 | blockSignals( blocked ); |
224 | 229 | ||
225 | } | 230 | } |
226 | 231 | ||
227 | void KABConfigWidget::usrWriteConfig() | 232 | void KABConfigWidget::usrWriteConfig() |
228 | { | 233 | { |
229 | KABPrefs* prefs = KABPrefs::instance(); | 234 | KABPrefs* prefs = KABPrefs::instance(); |
230 | prefs->mFullMenuBarVisible = mMenuBarBox->isChecked(); | 235 | prefs->mFullMenuBarVisible = mMenuBarBox->isChecked(); |
231 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); | 236 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); |
232 | prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); | 237 | prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); |
233 | prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); | 238 | prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); |
234 | prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked(); | 239 | prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked(); |
235 | prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked(); | 240 | prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked(); |
236 | 241 | ||
237 | prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); | 242 | prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); |
238 | prefs->mAskForQuit = mAskForQuit->isChecked(); | 243 | prefs->mAskForQuit = mAskForQuit->isChecked(); |
244 | prefs->mAskForDelete = mAskForDelete->isChecked(); | ||
239 | 245 | ||
240 | mAddresseeWidget->saveSettings(); | 246 | mAddresseeWidget->saveSettings(); |
241 | 247 | ||
242 | saveExtensionSettings(); | 248 | saveExtensionSettings(); |
243 | 249 | ||
244 | } | 250 | } |
245 | 251 | ||
246 | void KABConfigWidget::restoreExtensionSettings() | 252 | void KABConfigWidget::restoreExtensionSettings() |
247 | { | 253 | { |
248 | QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; | 254 | QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; |
249 | 255 | ||
250 | mExtensionView->clear(); | 256 | mExtensionView->clear(); |
251 | 257 | ||
252 | #ifndef KAB_EMBEDDED | 258 | #ifndef KAB_EMBEDDED |
253 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); | 259 | KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/Extension" ); |
254 | KTrader::OfferList::ConstIterator it; | 260 | KTrader::OfferList::ConstIterator it; |
255 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { | 261 | for ( it = plugins.begin(); it != plugins.end(); ++it ) { |
256 | if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) | 262 | if ( !(*it)->hasServiceType( "KAddressBook/Extension" ) ) |
257 | continue; | 263 | continue; |
258 | 264 | ||
259 | ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() ); | 265 | ExtensionItem *item = new ExtensionItem( mExtensionView, (*it)->name() ); |
260 | item->setService( *it ); | 266 | item->setService( *it ); |
261 | if ( activeExtensions.contains( item->factory()->identifier() ) ) | 267 | if ( activeExtensions.contains( item->factory()->identifier() ) ) |
262 | item->setOn( true ); | 268 | item->setOn( true ); |
263 | } | 269 | } |
264 | #else //KAB_EMBEDDED | 270 | #else //KAB_EMBEDDED |
265 | ExtensionFactory *extensionFactory = new MergeFactory(); | 271 | ExtensionFactory *extensionFactory = new MergeFactory(); |
266 | 272 | ||
267 | ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts"); | 273 | ExtensionItem *item = new ExtensionItem( mExtensionView, "Merge", "Merge", "Merge contacts"); |
268 | 274 | ||
269 | item->setFactory( extensionFactory ); | 275 | item->setFactory( extensionFactory ); |
270 | if ( activeExtensions.contains( extensionFactory->identifier() ) ) | 276 | if ( activeExtensions.contains( extensionFactory->identifier() ) ) |
271 | item->setOn( true ); | 277 | item->setOn( true ); |
272 | 278 | ||
273 | 279 | ||
274 | 280 | ||
275 | extensionFactory = new DistributionListFactory(); | 281 | extensionFactory = new DistributionListFactory(); |
276 | 282 | ||
277 | item = new ExtensionItem( mExtensionView, "Distribution List", "Distribution List", "Manage Distribution Lists"); | 283 | item = new ExtensionItem( mExtensionView, "Distribution List", "Distribution List", "Manage Distribution Lists"); |
278 | 284 | ||
279 | item->setFactory( extensionFactory ); | 285 | item->setFactory( extensionFactory ); |
280 | if ( activeExtensions.contains( extensionFactory->identifier() ) ) | 286 | if ( activeExtensions.contains( extensionFactory->identifier() ) ) |
281 | item->setOn( true ); | 287 | item->setOn( true ); |
282 | 288 | ||
283 | 289 | ||
284 | #endif //KAB_EMBEDDED | 290 | #endif //KAB_EMBEDDED |
285 | 291 | ||
286 | } | 292 | } |
287 | 293 | ||
288 | void KABConfigWidget::saveExtensionSettings() | 294 | void KABConfigWidget::saveExtensionSettings() |
289 | { | 295 | { |
290 | QStringList activeExtensions; | 296 | QStringList activeExtensions; |
291 | 297 | ||
292 | QPtrList<QListViewItem> list; | 298 | QPtrList<QListViewItem> list; |
293 | QListViewItemIterator it( mExtensionView ); | 299 | QListViewItemIterator it( mExtensionView ); |
294 | while ( it.current() ) { | 300 | while ( it.current() ) { |
295 | ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); | 301 | ExtensionItem *item = static_cast<ExtensionItem*>( it.current() ); |
296 | if ( item ) { | 302 | if ( item ) { |
297 | if ( item->isOn() ) | 303 | if ( item->isOn() ) |
298 | activeExtensions.append( item->factory()->identifier() ); | 304 | activeExtensions.append( item->factory()->identifier() ); |
299 | } | 305 | } |
300 | ++it; | 306 | ++it; |
301 | } | 307 | } |
302 | 308 | ||
303 | KABPrefs::instance()->mActiveExtensions = activeExtensions; | 309 | KABPrefs::instance()->mActiveExtensions = activeExtensions; |
304 | } | 310 | } |
305 | 311 | ||
306 | void KABConfigWidget::configureExtension() | 312 | void KABConfigWidget::configureExtension() |
307 | { | 313 | { |
308 | ExtensionItem *item = static_cast<ExtensionItem*>( mExtensionView->currentItem() ); | 314 | ExtensionItem *item = static_cast<ExtensionItem*>( mExtensionView->currentItem() ); |
309 | if ( !item ) | 315 | if ( !item ) |
310 | return; | 316 | return; |
311 | 317 | ||
312 | #ifndef KAB_EMBEDDED | 318 | #ifndef KAB_EMBEDDED |
313 | KConfig config( "kaddressbookrc" ); | 319 | KConfig config( "kaddressbookrc" ); |
314 | #else //KAB_EMBEDDED | 320 | #else //KAB_EMBEDDED |
315 | KConfig config( locateLocal("config", "kaddressbookrc") ); | 321 | KConfig config( locateLocal("config", "kaddressbookrc") ); |
316 | #endif //KAB_EMBEDDED | 322 | #endif //KAB_EMBEDDED |
317 | config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) ); | 323 | config.setGroup( QString( "Extensions_%1" ).arg( item->factory()->identifier() ) ); |
318 | 324 | ||
319 | ExtensionConfigDialog dlg( item->factory(), &config, this ); | 325 | ExtensionConfigDialog dlg( item->factory(), &config, this ); |
320 | dlg.exec(); | 326 | dlg.exec(); |
321 | 327 | ||
322 | config.sync(); | 328 | config.sync(); |
323 | } | 329 | } |
324 | 330 | ||
325 | void KABConfigWidget::selectionChanged( QListViewItem *i ) | 331 | void KABConfigWidget::selectionChanged( QListViewItem *i ) |
326 | { | 332 | { |
327 | ExtensionItem *item = static_cast<ExtensionItem*>( i ); | 333 | ExtensionItem *item = static_cast<ExtensionItem*>( i ); |
328 | if ( !item ) | 334 | if ( !item ) |
329 | return; | 335 | return; |
330 | 336 | ||
331 | mConfigureButton->setEnabled( item->configWidgetAvailable() ); | 337 | mConfigureButton->setEnabled( item->configWidgetAvailable() ); |
332 | } | 338 | } |
333 | 339 | ||
334 | void KABConfigWidget::itemClicked( QListViewItem *item ) | 340 | void KABConfigWidget::itemClicked( QListViewItem *item ) |
335 | { | 341 | { |
336 | if ( item != 0 ) | 342 | if ( item != 0 ) |
337 | modified(); | 343 | modified(); |
338 | } | 344 | } |
339 | 345 | ||
340 | #ifndef KAB_EMBEDDED | 346 | #ifndef KAB_EMBEDDED |
341 | ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) | 347 | ExtensionItem::ExtensionItem( QListView *parent, const QString &text ) |
342 | : QCheckListItem( parent, text, CheckBox ) | 348 | : QCheckListItem( parent, text, CheckBox ) |
343 | { | 349 | { |
344 | } | 350 | } |
345 | 351 | ||
346 | void ExtensionItem::setService( const KService::Ptr &ptr ) | 352 | void ExtensionItem::setService( const KService::Ptr &ptr ) |
347 | { | 353 | { |
348 | mPtr = ptr; | 354 | mPtr = ptr; |
349 | } | 355 | } |
350 | #else //KAB_EMBEDDED | 356 | #else //KAB_EMBEDDED |
351 | ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) | 357 | ExtensionItem::ExtensionItem( QListView *parent, const QString &text, const QString &name, const QString &comment ) |
352 | : QCheckListItem( parent, text, CheckBox ) | 358 | : QCheckListItem( parent, text, CheckBox ) |
353 | { | 359 | { |
354 | mName = name; | 360 | mName = name; |
355 | mComment = comment; | 361 | mComment = comment; |
356 | } | 362 | } |
357 | 363 | ||
358 | 364 | ||
359 | void ExtensionItem::setFactory( ExtensionFactory* fac ) | 365 | void ExtensionItem::setFactory( ExtensionFactory* fac ) |
360 | { | 366 | { |
361 | mFactory = fac; | 367 | mFactory = fac; |
362 | } | 368 | } |
363 | #endif //KAB_EMBEDDED | 369 | #endif //KAB_EMBEDDED |
364 | 370 | ||
365 | bool ExtensionItem::configWidgetAvailable() const | 371 | bool ExtensionItem::configWidgetAvailable() const |
366 | { | 372 | { |
367 | #ifndef KAB_EMBEDDED | 373 | #ifndef KAB_EMBEDDED |
368 | KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() ); | 374 | KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() ); |
369 | if ( !factory ) | 375 | if ( !factory ) |
370 | return false; | 376 | return false; |
371 | 377 | ||
372 | ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); | 378 | ExtensionFactory *extensionFactory = static_cast<ExtensionFactory*>( factory ); |
373 | if ( !extensionFactory ) | 379 | if ( !extensionFactory ) |
374 | return false; | 380 | return false; |
375 | 381 | ||
376 | return extensionFactory->configureWidgetAvailable(); | 382 | return extensionFactory->configureWidgetAvailable(); |
377 | #else //KAB_EMBEDDED | 383 | #else //KAB_EMBEDDED |
378 | return mFactory->configureWidgetAvailable(); | 384 | return mFactory->configureWidgetAvailable(); |
379 | #endif //KAB_EMBEDDED | 385 | #endif //KAB_EMBEDDED |
380 | 386 | ||
381 | } | 387 | } |
382 | 388 | ||
383 | ExtensionFactory *ExtensionItem::factory() const | 389 | ExtensionFactory *ExtensionItem::factory() const |
384 | { | 390 | { |
385 | #ifndef KAB_EMBEDDED | 391 | #ifndef KAB_EMBEDDED |
386 | KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() ); | 392 | KLibFactory *factory = KLibLoader::self()->factory( mPtr->library().latin1() ); |
387 | if ( !factory ) | 393 | if ( !factory ) |
388 | return 0; | 394 | return 0; |
389 | 395 | ||
390 | return static_cast<ExtensionFactory*>( factory ); | 396 | return static_cast<ExtensionFactory*>( factory ); |
391 | #else //KAB_EMBEDDED | 397 | #else //KAB_EMBEDDED |
392 | return mFactory; | 398 | return mFactory; |
393 | #endif //KAB_EMBEDDED | 399 | #endif //KAB_EMBEDDED |
394 | } | 400 | } |
395 | 401 | ||
396 | QString ExtensionItem::text( int column ) const | 402 | QString ExtensionItem::text( int column ) const |
397 | { | 403 | { |
398 | #ifndef KAB_EMBEDDED | 404 | #ifndef KAB_EMBEDDED |
399 | if ( column == 0 ) | 405 | if ( column == 0 ) |
400 | return mPtr->name(); | 406 | return mPtr->name(); |
401 | else if ( column == 1 ) | 407 | else if ( column == 1 ) |
402 | return mPtr->comment(); | 408 | return mPtr->comment(); |
403 | else | 409 | else |
404 | return QString::null; | 410 | return QString::null; |
405 | #else //KAB_EMBEDDED | 411 | #else //KAB_EMBEDDED |
406 | if ( column == 0 ) | 412 | if ( column == 0 ) |
407 | return mName; | 413 | return mName; |
408 | else if ( column == 1 ) | 414 | else if ( column == 1 ) |
409 | return mComment; | 415 | return mComment; |
410 | else | 416 | else |
411 | return QString::null; | 417 | return QString::null; |
412 | #endif //KAB_EMBEDDED | 418 | #endif //KAB_EMBEDDED |
413 | } | 419 | } |
414 | 420 | ||
415 | #ifndef KAB_EMBEDDED | 421 | #ifndef KAB_EMBEDDED |
416 | #include "kabconfigwidget.moc" | 422 | #include "kabconfigwidget.moc" |
417 | #endif //KAB_EMBEDDED | 423 | #endif //KAB_EMBEDDED |
418 | 424 | ||
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index a172e97..f2a6b1b 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h | |||
@@ -1,77 +1,78 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef KABCONFIGWIDGET_H | 24 | #ifndef KABCONFIGWIDGET_H |
25 | #define KABCONFIGWIDGET_H | 25 | #define KABCONFIGWIDGET_H |
26 | 26 | ||
27 | #include <kprefswidget.h> | 27 | #include <kprefswidget.h> |
28 | 28 | ||
29 | class QCheckBox; | 29 | class QCheckBox; |
30 | class QListViewItem; | 30 | class QListViewItem; |
31 | class QPushButton; | 31 | class QPushButton; |
32 | class QComboBox; | 32 | class QComboBox; |
33 | class QLineEdit; | 33 | class QLineEdit; |
34 | class KListView; | 34 | class KListView; |
35 | class KABPrefs; | 35 | class KABPrefs; |
36 | 36 | ||
37 | class AddresseeWidget; | 37 | class AddresseeWidget; |
38 | 38 | ||
39 | class KABConfigWidget : public KPrefsWidget | 39 | class KABConfigWidget : public KPrefsWidget |
40 | { | 40 | { |
41 | Q_OBJECT | 41 | Q_OBJECT |
42 | 42 | ||
43 | public: | 43 | public: |
44 | KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 ); | 44 | KABConfigWidget(KABPrefs *prefs, QWidget *parent, const char *name = 0 ); |
45 | 45 | ||
46 | protected: | 46 | protected: |
47 | /** Implement this to read custom configuration widgets. */ | 47 | /** Implement this to read custom configuration widgets. */ |
48 | virtual void usrReadConfig(); | 48 | virtual void usrReadConfig(); |
49 | /** Implement this to write custom configuration widgets. */ | 49 | /** Implement this to write custom configuration widgets. */ |
50 | virtual void usrWriteConfig(); | 50 | virtual void usrWriteConfig(); |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | private slots: | 54 | private slots: |
55 | void configureExtension(); | 55 | void configureExtension(); |
56 | void selectionChanged( QListViewItem* ); | 56 | void selectionChanged( QListViewItem* ); |
57 | void itemClicked( QListViewItem* ); | 57 | void itemClicked( QListViewItem* ); |
58 | 58 | ||
59 | private: | 59 | private: |
60 | void restoreExtensionSettings(); | 60 | void restoreExtensionSettings(); |
61 | void saveExtensionSettings(); | 61 | void saveExtensionSettings(); |
62 | 62 | ||
63 | KListView *mExtensionView; | 63 | KListView *mExtensionView; |
64 | QCheckBox *mSearchReturnBox; | 64 | QCheckBox *mSearchReturnBox; |
65 | QCheckBox *mNameParsing; | 65 | QCheckBox *mNameParsing; |
66 | QCheckBox *mViewsSingleClickBox; | 66 | QCheckBox *mViewsSingleClickBox; |
67 | QCheckBox *mAutoSearchWithWildcardBox; | 67 | QCheckBox *mAutoSearchWithWildcardBox; |
68 | QCheckBox *mHideSearchOnSwitchBox; | 68 | QCheckBox *mHideSearchOnSwitchBox; |
69 | QCheckBox *mMultipleViewsAtOnce; | 69 | QCheckBox *mMultipleViewsAtOnce; |
70 | QCheckBox *mAskForQuit; | 70 | QCheckBox *mAskForQuit; |
71 | QCheckBox *mMenuBarBox; | 71 | QCheckBox *mMenuBarBox; |
72 | QCheckBox *mAskForDelete; | ||
72 | QPushButton *mConfigureButton; | 73 | QPushButton *mConfigureButton; |
73 | 74 | ||
74 | AddresseeWidget *mAddresseeWidget; | 75 | AddresseeWidget *mAddresseeWidget; |
75 | }; | 76 | }; |
76 | 77 | ||
77 | #endif | 78 | #endif |