author | zautrix <zautrix> | 2005-07-03 14:46:21 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-03 14:46:21 (UTC) |
commit | 0c632bafd2d058504118dc8957fc4808a784f548 (patch) (unidiff) | |
tree | 5d726f0b4c480ac253f5c0b89907a2b624e9812d | |
parent | 3be76edf08827e1e00206399469904fe69887854 (diff) | |
download | kdepimpi-0c632bafd2d058504118dc8957fc4808a784f548.zip kdepimpi-0c632bafd2d058504118dc8957fc4808a784f548.tar.gz kdepimpi-0c632bafd2d058504118dc8957fc4808a784f548.tar.bz2 |
kapi search fix
-rw-r--r-- | bin/kdepim/kaddressbook/germantranslation.txt | 2 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookcardview.cpp | 8 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbookiconview.cpp | 8 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/bin/kdepim/kaddressbook/germantranslation.txt b/bin/kdepim/kaddressbook/germantranslation.txt index b2f2704..f64bfda 100644 --- a/bin/kdepim/kaddressbook/germantranslation.txt +++ b/bin/kdepim/kaddressbook/germantranslation.txt | |||
@@ -596,198 +596,198 @@ | |||
596 | { "I/O device: ","I/O device: " }, | 596 | { "I/O device: ","I/O device: " }, |
597 | { "Connection: ","Connection: " }, | 597 | { "Connection: ","Connection: " }, |
598 | { "Model(opt.): ","Model(opt.): " }, | 598 | { "Model(opt.): ","Model(opt.): " }, |
599 | { "Exporting to phone...","Exportiere aufs Handy..." }, | 599 | { "Exporting to phone...","Exportiere aufs Handy..." }, |
600 | { "Error exporting to phone","Fehler beim Export aufs Handy" }, | 600 | { "Error exporting to phone","Fehler beim Export aufs Handy" }, |
601 | { "contacts successfully exported.","Kontakte erfolgreich exportiert." }, | 601 | { "contacts successfully exported.","Kontakte erfolgreich exportiert." }, |
602 | { "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" }, | 602 | { "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?","Wollen Sie<br>alle existieren Einträge von<br>%1<br>vor dem Export entfernen?" }, |
603 | { "Set formatted name","Setze formatierten Namen" }, | 603 | { "Set formatted name","Setze formatierten Namen" }, |
604 | { "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." }, | 604 | { "You can set the formatted name\nfor a list of contacts in one go.","Sie können den formatierten Namen für\nein Liste von Kontakten auf einmal setzen." }, |
605 | { "Set formatted name to:","Setze formatierten Name auf:" }, | 605 | { "Set formatted name to:","Setze formatierten Name auf:" }, |
606 | { "Simple: James Bond","Einfach: James Bond" }, | 606 | { "Simple: James Bond","Einfach: James Bond" }, |
607 | { "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" }, | 607 | { "Full: Mr. James 007 Bond I","Voll: Mr. James 007 Bond I" }, |
608 | { "Reverse: Bond, James","Umgekehrt: Bond, James" }, | 608 | { "Reverse: Bond, James","Umgekehrt: Bond, James" }, |
609 | { "Organization: MI6","Organisation: MI6" }, | 609 | { "Organization: MI6","Organisation: MI6" }, |
610 | { "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." }, | 610 | { "Set formatted name to\norganization, if name empty","Setze formatierten Namen auf\nOrganisation, wenn Name leer ist." }, |
611 | { "Select contact list","Selektiere Kontakt Liste" }, | 611 | { "Select contact list","Selektiere Kontakt Liste" }, |
612 | { "Changing contact #%1","Ändere Kontakt #%1" }, | 612 | { "Changing contact #%1","Ändere Kontakt #%1" }, |
613 | { "Refreshing view...","Lade Ansicht neu..." }, | 613 | { "Refreshing view...","Lade Ansicht neu..." }, |
614 | { "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" }, | 614 | { "Setting formatted name completed!","Setzen vom formatierten Namen beendet!" }, |
615 | { "Removing voice...","Entferne voice..." }, | 615 | { "Removing voice...","Entferne voice..." }, |
616 | { "Remove voice completed!","Entferne voice beendet!" }, | 616 | { "Remove voice completed!","Entferne voice beendet!" }, |
617 | { "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" }, | 617 | { "Merge with existing categories?","Zu bestehenden\nKategorien hinzufügen?" }, |
618 | { "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" }, | 618 | { "Setting categories ... please wait!","Setze Kategorien ... bitte warten!" }, |
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 | { "","" }, | 788 | { "Search:","Suche:" }, |
789 | { "","" }, | 789 | { "","" }, |
790 | { "","" }, | 790 | { "","" }, |
791 | { "","" }, | 791 | { "","" }, |
792 | { "","" }, | 792 | { "","" }, |
793 | { "","" }, \ No newline at end of file | 793 | { "","" }, \ No newline at end of file |
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index 9c35fd6..ca21016 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp | |||
@@ -126,382 +126,382 @@ void AddresseeCardView::printMe() | |||
126 | QPainter p; | 126 | QPainter p; |
127 | p.begin ( &printer ); | 127 | p.begin ( &printer ); |
128 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | 128 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); |
129 | float dx, dy; | 129 | float dx, dy; |
130 | int wid = (m.width() * 9)/10; | 130 | int wid = (m.width() * 9)/10; |
131 | dx = (float) wid/(float)contentsWidth (); | 131 | dx = (float) wid/(float)contentsWidth (); |
132 | dy = (float)(m.height()) / (float)contentsHeight (); | 132 | dy = (float)(m.height()) / (float)contentsHeight (); |
133 | float scale; | 133 | float scale; |
134 | // scale to fit the width or height of the paper | 134 | // scale to fit the width or height of the paper |
135 | if ( dx < dy ) | 135 | if ( dx < dy ) |
136 | scale = dx; | 136 | scale = dx; |
137 | else | 137 | else |
138 | scale = dy; | 138 | scale = dy; |
139 | p.translate( m.width()/10,0 ); | 139 | p.translate( m.width()/10,0 ); |
140 | p.scale( scale, scale ); | 140 | p.scale( scale, scale ); |
141 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); | 141 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); |
142 | p.end(); | 142 | p.end(); |
143 | repaint(); | 143 | repaint(); |
144 | #endif | 144 | #endif |
145 | } | 145 | } |
146 | 146 | ||
147 | 147 | ||
148 | void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) | 148 | void AddresseeCardView::dragEnterEvent(QDragEnterEvent *e) |
149 | { | 149 | { |
150 | #ifndef KAB_EMBEDDED | 150 | #ifndef KAB_EMBEDDED |
151 | if (QTextDrag::canDecode(e)) | 151 | if (QTextDrag::canDecode(e)) |
152 | e->accept(); | 152 | e->accept(); |
153 | #else //KAB_EMBEDDED | 153 | #else //KAB_EMBEDDED |
154 | qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); | 154 | qDebug("AddresseeCardView::dragEnterEvent drag&drop is not implemented"); |
155 | #endif //KAB_EMBEDDED | 155 | #endif //KAB_EMBEDDED |
156 | } | 156 | } |
157 | 157 | ||
158 | void AddresseeCardView::dropEvent(QDropEvent *e) | 158 | void AddresseeCardView::dropEvent(QDropEvent *e) |
159 | { | 159 | { |
160 | emit addresseeDropped(e); | 160 | emit addresseeDropped(e); |
161 | } | 161 | } |
162 | 162 | ||
163 | void AddresseeCardView::startDrag() | 163 | void AddresseeCardView::startDrag() |
164 | { | 164 | { |
165 | emit startAddresseeDrag(); | 165 | emit startAddresseeDrag(); |
166 | } | 166 | } |
167 | 167 | ||
168 | 168 | ||
169 | /////////////////////////////// | 169 | /////////////////////////////// |
170 | // KAddressBookCardView | 170 | // KAddressBookCardView |
171 | 171 | ||
172 | KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab, | 172 | KAddressBookCardView::KAddressBookCardView( KABC::AddressBook *ab, |
173 | QWidget *parent, const char *name ) | 173 | QWidget *parent, const char *name ) |
174 | : KAddressBookView( ab, parent, name ) | 174 | : KAddressBookView( ab, parent, name ) |
175 | { | 175 | { |
176 | mShowEmptyFields = false; | 176 | mShowEmptyFields = false; |
177 | 177 | ||
178 | // Init the GUI | 178 | // Init the GUI |
179 | QVBoxLayout *layout = new QVBoxLayout(viewWidget()); | 179 | QVBoxLayout *layout = new QVBoxLayout(viewWidget()); |
180 | 180 | ||
181 | mCardView = new AddresseeCardView(viewWidget(), "mCardView"); | 181 | mCardView = new AddresseeCardView(viewWidget(), "mCardView"); |
182 | mCardView->setSelectionMode(CardView::Extended); | 182 | mCardView->setSelectionMode(CardView::Extended); |
183 | layout->addWidget(mCardView); | 183 | layout->addWidget(mCardView); |
184 | 184 | ||
185 | // Connect up the signals | 185 | // Connect up the signals |
186 | connect(mCardView, SIGNAL(executed(CardViewItem *)), | 186 | connect(mCardView, SIGNAL(executed(CardViewItem *)), |
187 | this, SLOT(addresseeExecuted(CardViewItem *))); | 187 | this, SLOT(addresseeExecuted(CardViewItem *))); |
188 | connect(mCardView, SIGNAL(selectionChanged()), | 188 | connect(mCardView, SIGNAL(selectionChanged()), |
189 | this, SLOT(addresseeSelected())); | 189 | this, SLOT(addresseeSelected())); |
190 | connect(mCardView, SIGNAL(addresseeDropped(QDropEvent*)), | 190 | connect(mCardView, SIGNAL(addresseeDropped(QDropEvent*)), |
191 | this, SIGNAL(dropped(QDropEvent*))); | 191 | this, SIGNAL(dropped(QDropEvent*))); |
192 | connect(mCardView, SIGNAL(startAddresseeDrag()), | 192 | connect(mCardView, SIGNAL(startAddresseeDrag()), |
193 | this, SIGNAL(startDrag())); | 193 | this, SIGNAL(startDrag())); |
194 | connect(this, SIGNAL(printView()), | 194 | connect(this, SIGNAL(printView()), |
195 | mCardView , SLOT(printMe())); | 195 | mCardView , SLOT(printMe())); |
196 | } | 196 | } |
197 | 197 | ||
198 | KAddressBookCardView::~KAddressBookCardView() | 198 | KAddressBookCardView::~KAddressBookCardView() |
199 | { | 199 | { |
200 | } | 200 | } |
201 | void KAddressBookCardView::setFocusAV() | 201 | void KAddressBookCardView::setFocusAV() |
202 | { | 202 | { |
203 | if ( mCardView ) | 203 | if ( mCardView ) |
204 | mCardView->setFocus(); | 204 | mCardView->setFocus(); |
205 | 205 | ||
206 | } | 206 | } |
207 | void KAddressBookCardView::scrollUP() | 207 | void KAddressBookCardView::scrollUP() |
208 | { | 208 | { |
209 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); | 209 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); |
210 | QApplication::postEvent( mCardView, ev ); | 210 | QApplication::postEvent( mCardView, ev ); |
211 | ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Up, 0,0 ); | 211 | ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Up, 0,0 ); |
212 | QApplication::postEvent( mCardView, ev ); | 212 | QApplication::postEvent( mCardView, ev ); |
213 | 213 | ||
214 | } | 214 | } |
215 | void KAddressBookCardView::scrollDOWN() | 215 | void KAddressBookCardView::scrollDOWN() |
216 | { | 216 | { |
217 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); | 217 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); |
218 | QApplication::postEvent( mCardView, ev ); | 218 | QApplication::postEvent( mCardView, ev ); |
219 | ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 ); | 219 | ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 ); |
220 | QApplication::postEvent( mCardView, ev ); | 220 | QApplication::postEvent( mCardView, ev ); |
221 | } | 221 | } |
222 | void KAddressBookCardView::readConfig(KConfig *config) | 222 | void KAddressBookCardView::readConfig(KConfig *config) |
223 | { | 223 | { |
224 | KAddressBookView::readConfig(config); | 224 | KAddressBookView::readConfig(config); |
225 | 225 | ||
226 | // costum colors? | 226 | // costum colors? |
227 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) | 227 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) |
228 | { | 228 | { |
229 | QPalette p( mCardView->palette() ); | 229 | QPalette p( mCardView->palette() ); |
230 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); | 230 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); |
231 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); | 231 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); |
232 | c = p.color(QPalette::Normal, QColorGroup::Text ); | 232 | c = p.color(QPalette::Normal, QColorGroup::Text ); |
233 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); | 233 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); |
234 | c = p.color(QPalette::Normal, QColorGroup::Button ); | 234 | c = p.color(QPalette::Normal, QColorGroup::Button ); |
235 | p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); | 235 | p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); |
236 | c = p.color(QPalette::Normal, QColorGroup::ButtonText ); | 236 | c = p.color(QPalette::Normal, QColorGroup::ButtonText ); |
237 | p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); | 237 | p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); |
238 | c = p.color(QPalette::Normal, QColorGroup::Highlight ); | 238 | c = p.color(QPalette::Normal, QColorGroup::Highlight ); |
239 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); | 239 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); |
240 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); | 240 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); |
241 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); | 241 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); |
242 | mCardView->viewport()->setPalette( p ); | 242 | mCardView->viewport()->setPalette( p ); |
243 | } | 243 | } |
244 | else | 244 | else |
245 | { | 245 | { |
246 | // needed if turned off during a session. | 246 | // needed if turned off during a session. |
247 | mCardView->viewport()->setPalette( mCardView->palette() ); | 247 | mCardView->viewport()->setPalette( mCardView->palette() ); |
248 | } | 248 | } |
249 | 249 | ||
250 | //custom fonts? | 250 | //custom fonts? |
251 | QFont f( font() ); | 251 | QFont f( font() ); |
252 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) | 252 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) |
253 | { | 253 | { |
254 | mCardView->setFont( config->readFontEntry( "TextFont", &f) ); | 254 | mCardView->setFont( config->readFontEntry( "TextFont", &f) ); |
255 | f.setBold( true ); | 255 | f.setBold( true ); |
256 | mCardView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); | 256 | mCardView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); |
257 | } | 257 | } |
258 | else | 258 | else |
259 | { | 259 | { |
260 | mCardView->setFont( f ); | 260 | mCardView->setFont( f ); |
261 | f.setBold( true ); | 261 | f.setBold( true ); |
262 | mCardView->setHeaderFont( f ); | 262 | mCardView->setHeaderFont( f ); |
263 | } | 263 | } |
264 | 264 | ||
265 | mCardView->setDrawCardBorder(config->readBoolEntry("DrawBorder", true)); | 265 | mCardView->setDrawCardBorder(config->readBoolEntry("DrawBorder", true)); |
266 | mCardView->setDrawColSeparators(config->readBoolEntry("DrawSeparators", | 266 | mCardView->setDrawColSeparators(config->readBoolEntry("DrawSeparators", |
267 | true)); | 267 | true)); |
268 | mCardView->setDrawFieldLabels(config->readBoolEntry("DrawFieldLabels",false)); | 268 | mCardView->setDrawFieldLabels(config->readBoolEntry("DrawFieldLabels",false)); |
269 | mShowEmptyFields = config->readBoolEntry("ShowEmptyFields", false); | 269 | mShowEmptyFields = config->readBoolEntry("ShowEmptyFields", false); |
270 | 270 | ||
271 | mCardView->setShowEmptyFields( mShowEmptyFields ); | 271 | mCardView->setShowEmptyFields( mShowEmptyFields ); |
272 | 272 | ||
273 | mCardView->setItemWidth( config->readNumEntry( "ItemWidth", 200 ) ); | 273 | mCardView->setItemWidth( config->readNumEntry( "ItemWidth", 200 ) ); |
274 | mCardView->setItemMargin( config->readNumEntry( "ItemMargin", 0 ) ); | 274 | mCardView->setItemMargin( config->readNumEntry( "ItemMargin", 0 ) ); |
275 | mCardView->setItemSpacing( config->readNumEntry( "ItemSpacing", 10 ) ); | 275 | mCardView->setItemSpacing( config->readNumEntry( "ItemSpacing", 10 ) ); |
276 | mCardView->setSeparatorWidth( config->readNumEntry( "SeparatorWidth", 2 ) ); | 276 | mCardView->setSeparatorWidth( config->readNumEntry( "SeparatorWidth", 2 ) ); |
277 | 277 | ||
278 | #if 0 | 278 | #if 0 |
279 | // LR KABPrefs::instance()->mHonorSingleClick is handled and fixed in cardviews contentsMouseDoubleClickEven | 279 | // LR KABPrefs::instance()->mHonorSingleClick is handled and fixed in cardviews contentsMouseDoubleClickEven |
280 | disconnect(mCardView, SIGNAL(executed(CardViewItem *)), | 280 | disconnect(mCardView, SIGNAL(executed(CardViewItem *)), |
281 | this, SLOT(addresseeExecuted(CardViewItem *))); | 281 | this, SLOT(addresseeExecuted(CardViewItem *))); |
282 | 282 | ||
283 | if (KABPrefs::instance()->mHonorSingleClick) | 283 | if (KABPrefs::instance()->mHonorSingleClick) |
284 | connect(mCardView, SIGNAL(executed(CardViewItem *)), | 284 | connect(mCardView, SIGNAL(executed(CardViewItem *)), |
285 | this, SLOT(addresseeExecuted(CardViewItem *))); | 285 | this, SLOT(addresseeExecuted(CardViewItem *))); |
286 | else | 286 | else |
287 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), | 287 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), |
288 | this, SLOT(addresseeExecuted(CardViewItem *))); | 288 | this, SLOT(addresseeExecuted(CardViewItem *))); |
289 | #endif | 289 | #endif |
290 | 290 | ||
291 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), | 291 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), |
292 | this, SLOT(addresseeExecuted(CardViewItem *))); | 292 | this, SLOT(addresseeExecuted(CardViewItem *))); |
293 | } | 293 | } |
294 | 294 | ||
295 | void KAddressBookCardView::writeConfig( KConfig *config ) | 295 | void KAddressBookCardView::writeConfig( KConfig *config ) |
296 | { | 296 | { |
297 | config->writeEntry( "ItemWidth", mCardView->itemWidth() ); | 297 | config->writeEntry( "ItemWidth", mCardView->itemWidth() ); |
298 | KAddressBookView::writeConfig( config ); | 298 | KAddressBookView::writeConfig( config ); |
299 | } | 299 | } |
300 | void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) | 300 | void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) |
301 | { | 301 | { |
302 | mCardView->clear(); | 302 | mCardView->clear(); |
303 | if ( s.isEmpty() || s == "*" ) { | 303 | if ( s.isEmpty() || s == "*" ) { |
304 | refresh(); | 304 | refresh(); |
305 | return; | 305 | return; |
306 | } | 306 | } |
307 | QRegExp re = getRegExp( s ); | 307 | QRegExp re = getRegExp( s ); |
308 | if (!re.isValid()) | 308 | if (!re.isValid()) |
309 | return; | 309 | return; |
310 | mCardView->viewport()->setUpdatesEnabled( false ); | 310 | mCardView->viewport()->setUpdatesEnabled( false ); |
311 | KABC::Addressee::List addresseeList = addressees(); | 311 | KABC::Addressee::List addresseeList = addressees(); |
312 | KABC::Addressee::List::Iterator it; | 312 | KABC::Addressee::List::Iterator it; |
313 | if ( field ) { | 313 | if ( field ) { |
314 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 314 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
315 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 315 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
316 | continue; | 316 | continue; |
317 | #if QT_VERSION >= 0x030000 | 317 | #if QT_VERSION >= 0x030000 |
318 | if (re.search(field->value( *it ).lower()) != -1) | 318 | if (re.search(field->value( *it ).lower()) == 0) |
319 | #else | 319 | #else |
320 | if (re.match(field->value( *it ).lower()) != -1) | 320 | if (re.match(field->value( *it ).lower()) == 0) |
321 | #endif | 321 | #endif |
322 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | 322 | new AddresseeCardViewItem(fields(), mShowEmptyFields, |
323 | addressBook(), *it, mCardView); | 323 | addressBook(), *it, mCardView); |
324 | 324 | ||
325 | } | 325 | } |
326 | } else { | 326 | } else { |
327 | KABC::Field::List fieldList = allFields(); | 327 | KABC::Field::List fieldList = allFields(); |
328 | KABC::Field::List::ConstIterator fieldIt; | 328 | KABC::Field::List::ConstIterator fieldIt; |
329 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 329 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
330 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 330 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
331 | continue; | 331 | continue; |
332 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 332 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
333 | #if QT_VERSION >= 0x030000 | 333 | #if QT_VERSION >= 0x030000 |
334 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 334 | if (re.search((*fieldIt)->value( *it ).lower()) == 0) |
335 | #else | 335 | #else |
336 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 336 | if (re.match((*fieldIt)->value( *it ).lower()) == 0) |
337 | #endif | 337 | #endif |
338 | { | 338 | { |
339 | new AddresseeCardViewItem(fields(), mShowEmptyFields, | 339 | new AddresseeCardViewItem(fields(), mShowEmptyFields, |
340 | addressBook(), *it, mCardView); | 340 | addressBook(), *it, mCardView); |
341 | break; | 341 | break; |
342 | } | 342 | } |
343 | } | 343 | } |
344 | } | 344 | } |
345 | } | 345 | } |
346 | mCardView->viewport()->setUpdatesEnabled( true ); | 346 | mCardView->viewport()->setUpdatesEnabled( true ); |
347 | mCardView->viewport()->update(); | 347 | mCardView->viewport()->update(); |
348 | if ( mCardView->firstItem() ) { | 348 | if ( mCardView->firstItem() ) { |
349 | mCardView->setCurrentItem ( mCardView->firstItem() ); | 349 | mCardView->setCurrentItem ( mCardView->firstItem() ); |
350 | mCardView->setSelected ( mCardView->firstItem() , true ); | 350 | mCardView->setSelected ( mCardView->firstItem() , true ); |
351 | } | 351 | } |
352 | else | 352 | else |
353 | emit selected(QString::null); | 353 | emit selected(QString::null); |
354 | } | 354 | } |
355 | QStringList KAddressBookCardView::selectedUids() | 355 | QStringList KAddressBookCardView::selectedUids() |
356 | { | 356 | { |
357 | QStringList uidList; | 357 | QStringList uidList; |
358 | CardViewItem *item; | 358 | CardViewItem *item; |
359 | AddresseeCardViewItem *aItem; | 359 | AddresseeCardViewItem *aItem; |
360 | 360 | ||
361 | for (item = mCardView->firstItem(); item; item = item->nextItem()) | 361 | for (item = mCardView->firstItem(); item; item = item->nextItem()) |
362 | { | 362 | { |
363 | if (item->isSelected()) | 363 | if (item->isSelected()) |
364 | { | 364 | { |
365 | #ifndef KAB_EMBEDDED | 365 | #ifndef KAB_EMBEDDED |
366 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 366 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
367 | #else //KAB_EMBEDDED | 367 | #else //KAB_EMBEDDED |
368 | aItem = (AddresseeCardViewItem*)(item); | 368 | aItem = (AddresseeCardViewItem*)(item); |
369 | #endif //KAB_EMBEDDED | 369 | #endif //KAB_EMBEDDED |
370 | if (aItem) | 370 | if (aItem) |
371 | uidList << aItem->addressee().uid(); | 371 | uidList << aItem->addressee().uid(); |
372 | } | 372 | } |
373 | } | 373 | } |
374 | 374 | ||
375 | return uidList; | 375 | return uidList; |
376 | } | 376 | } |
377 | 377 | ||
378 | void KAddressBookCardView::refresh(QString uid) | 378 | void KAddressBookCardView::refresh(QString uid) |
379 | { | 379 | { |
380 | CardViewItem *item; | 380 | CardViewItem *item; |
381 | AddresseeCardViewItem *aItem; | 381 | AddresseeCardViewItem *aItem; |
382 | 382 | ||
383 | if (uid.isNull()) | 383 | if (uid.isNull()) |
384 | { | 384 | { |
385 | // Rebuild the view | 385 | // Rebuild the view |
386 | mCardView->viewport()->setUpdatesEnabled( false ); | 386 | mCardView->viewport()->setUpdatesEnabled( false ); |
387 | mCardView->clear(); | 387 | mCardView->clear(); |
388 | 388 | ||
389 | KABC::Addressee::List addresseeList = addressees(); | 389 | KABC::Addressee::List addresseeList = addressees(); |
390 | KABC::Addressee::List::Iterator iter; | 390 | KABC::Addressee::List::Iterator iter; |
391 | for (iter = addresseeList.begin(); iter != addresseeList.end(); ++iter) | 391 | for (iter = addresseeList.begin(); iter != addresseeList.end(); ++iter) |
392 | { | 392 | { |
393 | if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) | 393 | if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) |
394 | continue; | 394 | continue; |
395 | aItem = new AddresseeCardViewItem(fields(), mShowEmptyFields, | 395 | aItem = new AddresseeCardViewItem(fields(), mShowEmptyFields, |
396 | addressBook(), *iter, mCardView); | 396 | addressBook(), *iter, mCardView); |
397 | } | 397 | } |
398 | mCardView->viewport()->setUpdatesEnabled( true ); | 398 | mCardView->viewport()->setUpdatesEnabled( true ); |
399 | mCardView->viewport()->update(); | 399 | mCardView->viewport()->update(); |
400 | 400 | ||
401 | // by default nothing is selected | 401 | // by default nothing is selected |
402 | emit selected(QString::null); | 402 | emit selected(QString::null); |
403 | } | 403 | } |
404 | else | 404 | else |
405 | { | 405 | { |
406 | // Try to find the one to refresh | 406 | // Try to find the one to refresh |
407 | bool found = false; | 407 | bool found = false; |
408 | for (item = mCardView->firstItem(); item && !found; | 408 | for (item = mCardView->firstItem(); item && !found; |
409 | item = item->nextItem()) | 409 | item = item->nextItem()) |
410 | { | 410 | { |
411 | #ifndef KAB_EMBEDDED | 411 | #ifndef KAB_EMBEDDED |
412 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 412 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
413 | #else //KAB_EMBEDDED | 413 | #else //KAB_EMBEDDED |
414 | aItem = (AddresseeCardViewItem*)(item); | 414 | aItem = (AddresseeCardViewItem*)(item); |
415 | #endif //KAB_EMBEDDED | 415 | #endif //KAB_EMBEDDED |
416 | 416 | ||
417 | if ((aItem) && (aItem->addressee().uid() == uid)) | 417 | if ((aItem) && (aItem->addressee().uid() == uid)) |
418 | { | 418 | { |
419 | aItem->refresh(); | 419 | aItem->refresh(); |
420 | found = true; | 420 | found = true; |
421 | } | 421 | } |
422 | } | 422 | } |
423 | } | 423 | } |
424 | } | 424 | } |
425 | 425 | ||
426 | void KAddressBookCardView::setSelected(QString uid, bool selected) | 426 | void KAddressBookCardView::setSelected(QString uid, bool selected) |
427 | { | 427 | { |
428 | CardViewItem *item; | 428 | CardViewItem *item; |
429 | AddresseeCardViewItem *aItem; | 429 | AddresseeCardViewItem *aItem; |
430 | 430 | ||
431 | if (uid.isNull()) | 431 | if (uid.isNull()) |
432 | { | 432 | { |
433 | mCardView->selectAll(selected); | 433 | mCardView->selectAll(selected); |
434 | } | 434 | } |
435 | else | 435 | else |
436 | { | 436 | { |
437 | bool found = false; | 437 | bool found = false; |
438 | for (item = mCardView->firstItem(); item && !found; | 438 | for (item = mCardView->firstItem(); item && !found; |
439 | item = item->nextItem()) | 439 | item = item->nextItem()) |
440 | { | 440 | { |
441 | #ifndef KAB_EMBEDDED | 441 | #ifndef KAB_EMBEDDED |
442 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 442 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
443 | #else //KAB_EMBEDDED | 443 | #else //KAB_EMBEDDED |
444 | aItem = (AddresseeCardViewItem*)(item); | 444 | aItem = (AddresseeCardViewItem*)(item); |
445 | #endif //KAB_EMBEDDED | 445 | #endif //KAB_EMBEDDED |
446 | 446 | ||
447 | if ((aItem) && (aItem->addressee().uid() == uid)) | 447 | if ((aItem) && (aItem->addressee().uid() == uid)) |
448 | { | 448 | { |
449 | mCardView->setSelected(aItem, selected); | 449 | mCardView->setSelected(aItem, selected); |
450 | mCardView->ensureItemVisible(item); | 450 | mCardView->ensureItemVisible(item); |
451 | found = true; | 451 | found = true; |
452 | } | 452 | } |
453 | } | 453 | } |
454 | } | 454 | } |
455 | } | 455 | } |
456 | 456 | ||
457 | //US added an additional method without parameter | 457 | //US added an additional method without parameter |
458 | void KAddressBookCardView::setSelected() | 458 | void KAddressBookCardView::setSelected() |
459 | { | 459 | { |
460 | setSelected(QString::null, true); | 460 | setSelected(QString::null, true); |
461 | } | 461 | } |
462 | 462 | ||
463 | void KAddressBookCardView::addresseeExecuted(CardViewItem *item) | 463 | void KAddressBookCardView::addresseeExecuted(CardViewItem *item) |
464 | { | 464 | { |
465 | #ifndef KAB_EMBEDDED | 465 | #ifndef KAB_EMBEDDED |
466 | AddresseeCardViewItem *aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 466 | AddresseeCardViewItem *aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
467 | #else //KAB_EMBEDDED | 467 | #else //KAB_EMBEDDED |
468 | AddresseeCardViewItem *aItem = (AddresseeCardViewItem*)(item); | 468 | AddresseeCardViewItem *aItem = (AddresseeCardViewItem*)(item); |
469 | #endif //KAB_EMBEDDED | 469 | #endif //KAB_EMBEDDED |
470 | if (aItem) | 470 | if (aItem) |
471 | { | 471 | { |
472 | //kdDebug()<<"... even has a valid item:)"<<endl; | 472 | //kdDebug()<<"... even has a valid item:)"<<endl; |
473 | emit executed(aItem->addressee().uid()); | 473 | emit executed(aItem->addressee().uid()); |
474 | } | 474 | } |
475 | } | 475 | } |
476 | 476 | ||
477 | void KAddressBookCardView::addresseeSelected() | 477 | void KAddressBookCardView::addresseeSelected() |
478 | { | 478 | { |
479 | CardViewItem *item; | 479 | CardViewItem *item; |
480 | AddresseeCardViewItem *aItem; | 480 | AddresseeCardViewItem *aItem; |
481 | 481 | ||
482 | bool found = false; | 482 | bool found = false; |
483 | for (item = mCardView->firstItem(); item && !found; | 483 | for (item = mCardView->firstItem(); item && !found; |
484 | item = item->nextItem()) | 484 | item = item->nextItem()) |
485 | { | 485 | { |
486 | if (item->isSelected()) | 486 | if (item->isSelected()) |
487 | { | 487 | { |
488 | #ifndef KAB_EMBEDDED | 488 | #ifndef KAB_EMBEDDED |
489 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); | 489 | aItem = dynamic_cast<AddresseeCardViewItem*>(item); |
490 | #else //KAB_EMBEDDED | 490 | #else //KAB_EMBEDDED |
491 | aItem = (AddresseeCardViewItem*)(item); | 491 | aItem = (AddresseeCardViewItem*)(item); |
492 | #endif //KAB_EMBEDDED | 492 | #endif //KAB_EMBEDDED |
493 | if ( aItem ) | 493 | if ( aItem ) |
494 | { | 494 | { |
495 | emit selected(aItem->addressee().uid()); | 495 | emit selected(aItem->addressee().uid()); |
496 | found = true; | 496 | found = true; |
497 | } | 497 | } |
498 | } | 498 | } |
499 | } | 499 | } |
500 | 500 | ||
501 | if (!found) | 501 | if (!found) |
502 | emit selected(QString::null); | 502 | emit selected(QString::null); |
503 | 503 | ||
504 | } | 504 | } |
505 | #ifndef KAB_EMBEDDED | 505 | #ifndef KAB_EMBEDDED |
506 | #include "kaddressbookcardview.moc" | 506 | #include "kaddressbookcardview.moc" |
507 | #endif //KAB_EMBEDDED | 507 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/views/kaddressbookiconview.cpp b/kaddressbook/views/kaddressbookiconview.cpp index 3bdfd1a..4bbdf1d 100644 --- a/kaddressbook/views/kaddressbookiconview.cpp +++ b/kaddressbook/views/kaddressbookiconview.cpp | |||
@@ -80,373 +80,373 @@ AddresseeIconView::AddresseeIconView(QWidget *parent, const char *name) | |||
80 | setSelectionMode( QIconView::Extended ); | 80 | setSelectionMode( QIconView::Extended ); |
81 | setResizeMode( QIconView::Adjust ); | 81 | setResizeMode( QIconView::Adjust ); |
82 | setWordWrapIconText( true ); | 82 | setWordWrapIconText( true ); |
83 | setGridX( 100 ); | 83 | setGridX( 100 ); |
84 | setItemsMovable(false); | 84 | setItemsMovable(false); |
85 | setSorting(true, true); | 85 | setSorting(true, true); |
86 | 86 | ||
87 | 87 | ||
88 | //US ??? setMode( KIconView::Select ); | 88 | //US ??? setMode( KIconView::Select ); |
89 | 89 | ||
90 | #ifndef KAB_EMBEDDED | 90 | #ifndef KAB_EMBEDDED |
91 | 91 | ||
92 | connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), | 92 | connect(this, SIGNAL(dropped(QDropEvent*, const QValueList<QIconDragItem>&)), |
93 | this, SLOT(itemDropped(QDropEvent*, const QValueList<QIconDragItem>&))); | 93 | this, SLOT(itemDropped(QDropEvent*, const QValueList<QIconDragItem>&))); |
94 | #endif //KAB_EMBEDDED | 94 | #endif //KAB_EMBEDDED |
95 | } | 95 | } |
96 | 96 | ||
97 | AddresseeIconView::~AddresseeIconView() | 97 | AddresseeIconView::~AddresseeIconView() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | 100 | ||
101 | 101 | ||
102 | void AddresseeIconView::itemDropped(QDropEvent *e, | 102 | void AddresseeIconView::itemDropped(QDropEvent *e, |
103 | const QValueList<QIconDragItem> &) | 103 | const QValueList<QIconDragItem> &) |
104 | { | 104 | { |
105 | emit addresseeDropped(e); | 105 | emit addresseeDropped(e); |
106 | } | 106 | } |
107 | 107 | ||
108 | QDragObject *AddresseeIconView::dragObject() | 108 | QDragObject *AddresseeIconView::dragObject() |
109 | { | 109 | { |
110 | emit startAddresseeDrag(); | 110 | emit startAddresseeDrag(); |
111 | 111 | ||
112 | // We never want IconView to start the drag | 112 | // We never want IconView to start the drag |
113 | return 0; | 113 | return 0; |
114 | } | 114 | } |
115 | //////////////////////////////// | 115 | //////////////////////////////// |
116 | // AddresseeIconViewItem (internal class) | 116 | // AddresseeIconViewItem (internal class) |
117 | #ifndef KAB_EMBEDDED | 117 | #ifndef KAB_EMBEDDED |
118 | class AddresseeIconViewItem : public KIconViewItem | 118 | class AddresseeIconViewItem : public KIconViewItem |
119 | #else //KAB_EMBEDDED | 119 | #else //KAB_EMBEDDED |
120 | class AddresseeIconViewItem : public QIconViewItem | 120 | class AddresseeIconViewItem : public QIconViewItem |
121 | #endif //KAB_EMBEDDED | 121 | #endif //KAB_EMBEDDED |
122 | { | 122 | { |
123 | public: | 123 | public: |
124 | #ifndef KAB_EMBEDDED | 124 | #ifndef KAB_EMBEDDED |
125 | AddresseeIconViewItem(const KABC::Field::List &fields, | 125 | AddresseeIconViewItem(const KABC::Field::List &fields, |
126 | KABC::AddressBook *doc, const KABC::Addressee &a, | 126 | KABC::AddressBook *doc, const KABC::Addressee &a, |
127 | QIconView *parent) | 127 | QIconView *parent) |
128 | : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) | 128 | : KIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) |
129 | #else //KAB_EMBEDDED | 129 | #else //KAB_EMBEDDED |
130 | AddresseeIconViewItem(const KABC::Field::List &fields, | 130 | AddresseeIconViewItem(const KABC::Field::List &fields, |
131 | KABC::AddressBook *doc, const KABC::Addressee &a, | 131 | KABC::AddressBook *doc, const KABC::Addressee &a, |
132 | QIconView *parent) | 132 | QIconView *parent) |
133 | : QIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) | 133 | : QIconViewItem(parent), mFields( fields ), mDocument(doc), mAddressee(a) |
134 | #endif //KAB_EMBEDDED | 134 | #endif //KAB_EMBEDDED |
135 | { | 135 | { |
136 | if ( mFields.isEmpty() ) { | 136 | if ( mFields.isEmpty() ) { |
137 | mFields = KABC::Field::defaultFields(); | 137 | mFields = KABC::Field::defaultFields(); |
138 | } | 138 | } |
139 | refresh(); | 139 | refresh(); |
140 | } | 140 | } |
141 | 141 | ||
142 | const KABC::Addressee &addressee() const { return mAddressee; } | 142 | const KABC::Addressee &addressee() const { return mAddressee; } |
143 | 143 | ||
144 | void refresh() | 144 | void refresh() |
145 | { | 145 | { |
146 | // Update our addressee, since it may have changed elsewhere | 146 | // Update our addressee, since it may have changed elsewhere |
147 | mAddressee = mDocument->findByUid(mAddressee.uid()); | 147 | mAddressee = mDocument->findByUid(mAddressee.uid()); |
148 | 148 | ||
149 | if (!mAddressee.isEmpty()) | 149 | if (!mAddressee.isEmpty()) |
150 | setText( mAddressee.givenName() + " " + mAddressee.familyName() ); | 150 | setText( mAddressee.givenName() + " " + mAddressee.familyName() ); |
151 | 151 | ||
152 | QPixmap icon; | 152 | QPixmap icon; |
153 | QPixmap defaultIcon( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop, 128 ) ); | 153 | QPixmap defaultIcon( KGlobal::iconLoader()->loadIcon( "vcard", KIcon::Desktop, 128 ) ); |
154 | KABC::Picture pic = mAddressee.photo(); | 154 | KABC::Picture pic = mAddressee.photo(); |
155 | if ( pic.data().isNull() ) | 155 | if ( pic.data().isNull() ) |
156 | pic = mAddressee.logo(); | 156 | pic = mAddressee.logo(); |
157 | 157 | ||
158 | if ( pic.isIntern() && !pic.data().isNull() ) { | 158 | if ( pic.isIntern() && !pic.data().isNull() ) { |
159 | QImage img = pic.data(); | 159 | QImage img = pic.data(); |
160 | #ifndef KAB_EMBEDDED | 160 | #ifndef KAB_EMBEDDED |
161 | if ( img.width() > img.height() ) | 161 | if ( img.width() > img.height() ) |
162 | icon = img.scaleWidth( 32 ); | 162 | icon = img.scaleWidth( 32 ); |
163 | else | 163 | else |
164 | icon = img.scaleHeight( 32 ); | 164 | icon = img.scaleHeight( 32 ); |
165 | #else //KAB_EMBEDDED | 165 | #else //KAB_EMBEDDED |
166 | qDebug("AddresseeIconViewItem::refresh - scale here dependend of the displaysize and the right factor"); | 166 | qDebug("AddresseeIconViewItem::refresh - scale here dependend of the displaysize and the right factor"); |
167 | icon.convertFromImage(img.smoothScale(32, 32)); | 167 | icon.convertFromImage(img.smoothScale(32, 32)); |
168 | #endif //KAB_EMBEDDED | 168 | #endif //KAB_EMBEDDED |
169 | 169 | ||
170 | } else | 170 | } else |
171 | icon = defaultIcon; | 171 | icon = defaultIcon; |
172 | 172 | ||
173 | setPixmap( icon ); | 173 | setPixmap( icon ); |
174 | } | 174 | } |
175 | 175 | ||
176 | private: | 176 | private: |
177 | KABC::Field::List mFields; | 177 | KABC::Field::List mFields; |
178 | KABC::AddressBook *mDocument; | 178 | KABC::AddressBook *mDocument; |
179 | KABC::Addressee mAddressee; | 179 | KABC::Addressee mAddressee; |
180 | }; | 180 | }; |
181 | 181 | ||
182 | /////////////////////////////// | 182 | /////////////////////////////// |
183 | // KAddressBookView | 183 | // KAddressBookView |
184 | 184 | ||
185 | KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, | 185 | KAddressBookIconView::KAddressBookIconView( KABC::AddressBook *ab, |
186 | QWidget *parent, const char *name) | 186 | QWidget *parent, const char *name) |
187 | : KAddressBookView( ab, parent, name ) | 187 | : KAddressBookView( ab, parent, name ) |
188 | { | 188 | { |
189 | // Init the GUI | 189 | // Init the GUI |
190 | QVBoxLayout *layout = new QVBoxLayout(viewWidget()); | 190 | QVBoxLayout *layout = new QVBoxLayout(viewWidget()); |
191 | 191 | ||
192 | mIconView = new AddresseeIconView(viewWidget(), "mIconView"); | 192 | mIconView = new AddresseeIconView(viewWidget(), "mIconView"); |
193 | layout->addWidget(mIconView); | 193 | layout->addWidget(mIconView); |
194 | 194 | ||
195 | // Connect up the signals | 195 | // Connect up the signals |
196 | 196 | ||
197 | //US method executed is part of KIconView | 197 | //US method executed is part of KIconView |
198 | //US connect(mIconView, SIGNAL(executed(QIconViewItem *)), | 198 | //US connect(mIconView, SIGNAL(executed(QIconViewItem *)), |
199 | //US this, SLOT(addresseeExecuted(QIconViewItem *))); | 199 | //US this, SLOT(addresseeExecuted(QIconViewItem *))); |
200 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), | 200 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), |
201 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 201 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
202 | 202 | ||
203 | connect(mIconView, SIGNAL(selectionChanged()), | 203 | connect(mIconView, SIGNAL(selectionChanged()), |
204 | this, SLOT(addresseeSelected())); | 204 | this, SLOT(addresseeSelected())); |
205 | connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)), | 205 | connect(mIconView, SIGNAL(addresseeDropped(QDropEvent*)), |
206 | this, SIGNAL(dropped(QDropEvent*))); | 206 | this, SIGNAL(dropped(QDropEvent*))); |
207 | connect(mIconView, SIGNAL(startAddresseeDrag()), | 207 | connect(mIconView, SIGNAL(startAddresseeDrag()), |
208 | this, SIGNAL(startDrag())); | 208 | this, SIGNAL(startDrag())); |
209 | } | 209 | } |
210 | 210 | ||
211 | KAddressBookIconView::~KAddressBookIconView() | 211 | KAddressBookIconView::~KAddressBookIconView() |
212 | { | 212 | { |
213 | } | 213 | } |
214 | void KAddressBookIconView::setFocusAV() | 214 | void KAddressBookIconView::setFocusAV() |
215 | { | 215 | { |
216 | if ( mIconView ) | 216 | if ( mIconView ) |
217 | mIconView->setFocus(); | 217 | mIconView->setFocus(); |
218 | } | 218 | } |
219 | 219 | ||
220 | 220 | ||
221 | void KAddressBookIconView::scrollUP() | 221 | void KAddressBookIconView::scrollUP() |
222 | { | 222 | { |
223 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); | 223 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); |
224 | QApplication::postEvent( mIconView, ev ); | 224 | QApplication::postEvent( mIconView, ev ); |
225 | } | 225 | } |
226 | void KAddressBookIconView::scrollDOWN() | 226 | void KAddressBookIconView::scrollDOWN() |
227 | { | 227 | { |
228 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); | 228 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); |
229 | QApplication::postEvent( mIconView, ev ); | 229 | QApplication::postEvent( mIconView, ev ); |
230 | } | 230 | } |
231 | void KAddressBookIconView::readConfig(KConfig *config) | 231 | void KAddressBookIconView::readConfig(KConfig *config) |
232 | { | 232 | { |
233 | KAddressBookView::readConfig(config); | 233 | KAddressBookView::readConfig(config); |
234 | 234 | ||
235 | //US method executed is part of KIconView | 235 | //US method executed is part of KIconView |
236 | //US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), | 236 | //US disconnect(mIconView, SIGNAL(executed(QIconViewItem *)), |
237 | //US this, SLOT(addresseeExecuted(QIconViewItem *))); | 237 | //US this, SLOT(addresseeExecuted(QIconViewItem *))); |
238 | disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), | 238 | disconnect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), |
239 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 239 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
240 | 240 | ||
241 | //US method executed is part of KIconView. Use selectionChanged instead | 241 | //US method executed is part of KIconView. Use selectionChanged instead |
242 | /*US | 242 | /*US |
243 | if (KABPrefs::instance()->mHonorSingleClick) | 243 | if (KABPrefs::instance()->mHonorSingleClick) |
244 | connect(mIconView, SIGNAL(executed(QIconViewItem *)), | 244 | connect(mIconView, SIGNAL(executed(QIconViewItem *)), |
245 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 245 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
246 | else | 246 | else |
247 | connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), | 247 | connect(mIconView, SIGNAL(doubleClicked(QIconViewItem *)), |
248 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 248 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
249 | */ | 249 | */ |
250 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), | 250 | connect(mIconView, SIGNAL(selectionChanged(QIconViewItem *)), |
251 | this, SLOT(addresseeExecuted(QIconViewItem *))); | 251 | this, SLOT(addresseeExecuted(QIconViewItem *))); |
252 | 252 | ||
253 | } | 253 | } |
254 | void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) | 254 | void KAddressBookIconView::doSearch( const QString& s ,KABC::Field *field ) |
255 | { | 255 | { |
256 | mIconView->clear(); | 256 | mIconView->clear(); |
257 | mIconList.clear(); | 257 | mIconList.clear(); |
258 | if ( s.isEmpty() || s == "*" ) { | 258 | if ( s.isEmpty() || s == "*" ) { |
259 | refresh(); | 259 | refresh(); |
260 | return; | 260 | return; |
261 | } | 261 | } |
262 | QRegExp re = getRegExp( s ); | 262 | QRegExp re = getRegExp( s ); |
263 | if (!re.isValid()) | 263 | if (!re.isValid()) |
264 | return; | 264 | return; |
265 | KABC::Addressee::List addresseeList = addressees(); | 265 | KABC::Addressee::List addresseeList = addressees(); |
266 | KABC::Addressee::List::Iterator it; | 266 | KABC::Addressee::List::Iterator it; |
267 | if ( field ) { | 267 | if ( field ) { |
268 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 268 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
269 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 269 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
270 | continue; | 270 | continue; |
271 | #if QT_VERSION >= 0x030000 | 271 | #if QT_VERSION >= 0x030000 |
272 | if (re.search(field->value( *it ).lower()) != -1) | 272 | if (re.search(field->value( *it ).lower()) == 0) |
273 | #else | 273 | #else |
274 | if (re.match(field->value( *it ).lower()) != -1) | 274 | if (re.match(field->value( *it ).lower()) == 0) |
275 | #endif | 275 | #endif |
276 | mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | 276 | mIconList.append(new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); |
277 | 277 | ||
278 | 278 | ||
279 | } | 279 | } |
280 | } else { | 280 | } else { |
281 | KABC::Field::List fieldList = allFields(); | 281 | KABC::Field::List fieldList = allFields(); |
282 | KABC::Field::List::ConstIterator fieldIt; | 282 | KABC::Field::List::ConstIterator fieldIt; |
283 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 283 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
284 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 284 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
285 | continue; | 285 | continue; |
286 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 286 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
287 | #if QT_VERSION >= 0x030000 | 287 | #if QT_VERSION >= 0x030000 |
288 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 288 | if (re.search((*fieldIt)->value( *it ).lower()) == 0) |
289 | #else | 289 | #else |
290 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 290 | if (re.match((*fieldIt)->value( *it ).lower()) == 0) |
291 | #endif | 291 | #endif |
292 | { | 292 | { |
293 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); | 293 | mIconList.append( new AddresseeIconViewItem( fields(), addressBook(), *it, mIconView )); |
294 | break; | 294 | break; |
295 | } | 295 | } |
296 | } | 296 | } |
297 | } | 297 | } |
298 | } | 298 | } |
299 | mIconView->arrangeItemsInGrid( true ); | 299 | mIconView->arrangeItemsInGrid( true ); |
300 | if ( mIconView->firstItem() ) { | 300 | if ( mIconView->firstItem() ) { |
301 | mIconView->setCurrentItem ( mIconView->firstItem() ); | 301 | mIconView->setCurrentItem ( mIconView->firstItem() ); |
302 | mIconView->setSelected ( mIconView->firstItem() , true ); | 302 | mIconView->setSelected ( mIconView->firstItem() , true ); |
303 | } | 303 | } |
304 | else | 304 | else |
305 | emit selected(QString::null); | 305 | emit selected(QString::null); |
306 | } | 306 | } |
307 | QStringList KAddressBookIconView::selectedUids() | 307 | QStringList KAddressBookIconView::selectedUids() |
308 | { | 308 | { |
309 | QStringList uidList; | 309 | QStringList uidList; |
310 | QIconViewItem *item; | 310 | QIconViewItem *item; |
311 | AddresseeIconViewItem *aItem; | 311 | AddresseeIconViewItem *aItem; |
312 | 312 | ||
313 | for (item = mIconView->firstItem(); item; item = item->nextItem()) | 313 | for (item = mIconView->firstItem(); item; item = item->nextItem()) |
314 | { | 314 | { |
315 | if (item->isSelected()) | 315 | if (item->isSelected()) |
316 | { | 316 | { |
317 | #ifndef KAB_EMBEDDED | 317 | #ifndef KAB_EMBEDDED |
318 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 318 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
319 | #else //KAB_EMBEDDED | 319 | #else //KAB_EMBEDDED |
320 | aItem = (AddresseeIconViewItem*)(item); | 320 | aItem = (AddresseeIconViewItem*)(item); |
321 | #endif //KAB_EMBEDDED | 321 | #endif //KAB_EMBEDDED |
322 | if (aItem) | 322 | if (aItem) |
323 | uidList << aItem->addressee().uid(); | 323 | uidList << aItem->addressee().uid(); |
324 | } | 324 | } |
325 | } | 325 | } |
326 | 326 | ||
327 | return uidList; | 327 | return uidList; |
328 | } | 328 | } |
329 | 329 | ||
330 | void KAddressBookIconView::refresh(QString uid) | 330 | void KAddressBookIconView::refresh(QString uid) |
331 | { | 331 | { |
332 | QIconViewItem *item; | 332 | QIconViewItem *item; |
333 | AddresseeIconViewItem *aItem; | 333 | AddresseeIconViewItem *aItem; |
334 | 334 | ||
335 | if ( uid.isNull() ) { | 335 | if ( uid.isNull() ) { |
336 | // Rebuild the view | 336 | // Rebuild the view |
337 | mIconView->clear(); | 337 | mIconView->clear(); |
338 | mIconList.clear(); | 338 | mIconList.clear(); |
339 | 339 | ||
340 | KABC::Addressee::List addresseeList = addressees(); | 340 | KABC::Addressee::List addresseeList = addressees(); |
341 | KABC::Addressee::List::Iterator iter; | 341 | KABC::Addressee::List::Iterator iter; |
342 | for ( iter = addresseeList.begin(); iter != addresseeList.end(); ++iter ) { | 342 | for ( iter = addresseeList.begin(); iter != addresseeList.end(); ++iter ) { |
343 | if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) | 343 | if ( (*iter).uid().left(2) == "la" && (*iter).uid().left(19) == QString("last-syncAddressee-") ) |
344 | continue; | 344 | continue; |
345 | aItem = new AddresseeIconViewItem( fields(), addressBook(), *iter, mIconView ); | 345 | aItem = new AddresseeIconViewItem( fields(), addressBook(), *iter, mIconView ); |
346 | } | 346 | } |
347 | 347 | ||
348 | mIconView->arrangeItemsInGrid( true ); | 348 | mIconView->arrangeItemsInGrid( true ); |
349 | 349 | ||
350 | for ( item = mIconView->firstItem(); item; item = item->nextItem() ) | 350 | for ( item = mIconView->firstItem(); item; item = item->nextItem() ) |
351 | { | 351 | { |
352 | #ifndef KAB_EMBEDDED | 352 | #ifndef KAB_EMBEDDED |
353 | AddresseeIconViewItem* aivi = dynamic_cast<AddresseeIconViewItem*>( item ); | 353 | AddresseeIconViewItem* aivi = dynamic_cast<AddresseeIconViewItem*>( item ); |
354 | #else //KAB_EMBEDDED | 354 | #else //KAB_EMBEDDED |
355 | AddresseeIconViewItem* aivi = (AddresseeIconViewItem*)( item ); | 355 | AddresseeIconViewItem* aivi = (AddresseeIconViewItem*)( item ); |
356 | #endif //KAB_EMBEDDED | 356 | #endif //KAB_EMBEDDED |
357 | mIconList.append( aivi ); | 357 | mIconList.append( aivi ); |
358 | } | 358 | } |
359 | 359 | ||
360 | } else { | 360 | } else { |
361 | // Try to find the one to refresh | 361 | // Try to find the one to refresh |
362 | for ( item = mIconView->firstItem(); item; item = item->nextItem() ) { | 362 | for ( item = mIconView->firstItem(); item; item = item->nextItem() ) { |
363 | #ifndef KAB_EMBEDDED | 363 | #ifndef KAB_EMBEDDED |
364 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 364 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
365 | #else //KAB_EMBEDDED | 365 | #else //KAB_EMBEDDED |
366 | aItem = (AddresseeIconViewItem*)(item); | 366 | aItem = (AddresseeIconViewItem*)(item); |
367 | #endif //KAB_EMBEDDED | 367 | #endif //KAB_EMBEDDED |
368 | if ((aItem) && (aItem->addressee().uid() == uid)) { | 368 | if ((aItem) && (aItem->addressee().uid() == uid)) { |
369 | aItem->refresh(); | 369 | aItem->refresh(); |
370 | mIconView->arrangeItemsInGrid( true ); | 370 | mIconView->arrangeItemsInGrid( true ); |
371 | return; | 371 | return; |
372 | } | 372 | } |
373 | } | 373 | } |
374 | refresh( QString::null ); | 374 | refresh( QString::null ); |
375 | } | 375 | } |
376 | } | 376 | } |
377 | 377 | ||
378 | void KAddressBookIconView::setSelected(QString uid, bool selected) | 378 | void KAddressBookIconView::setSelected(QString uid, bool selected) |
379 | { | 379 | { |
380 | QIconViewItem *item; | 380 | QIconViewItem *item; |
381 | AddresseeIconViewItem *aItem; | 381 | AddresseeIconViewItem *aItem; |
382 | 382 | ||
383 | if (uid.isNull()) | 383 | if (uid.isNull()) |
384 | { | 384 | { |
385 | mIconView->selectAll(selected); | 385 | mIconView->selectAll(selected); |
386 | } | 386 | } |
387 | else | 387 | else |
388 | { | 388 | { |
389 | bool found = false; | 389 | bool found = false; |
390 | for (item = mIconView->firstItem(); item && !found; | 390 | for (item = mIconView->firstItem(); item && !found; |
391 | item = item->nextItem()) | 391 | item = item->nextItem()) |
392 | { | 392 | { |
393 | #ifndef KAB_EMBEDDED | 393 | #ifndef KAB_EMBEDDED |
394 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 394 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
395 | #else //KAB_EMBEDDED | 395 | #else //KAB_EMBEDDED |
396 | aItem = (AddresseeIconViewItem*)(item); | 396 | aItem = (AddresseeIconViewItem*)(item); |
397 | #endif //KAB_EMBEDDED | 397 | #endif //KAB_EMBEDDED |
398 | 398 | ||
399 | if ((aItem) && (aItem->addressee().uid() == uid)) | 399 | if ((aItem) && (aItem->addressee().uid() == uid)) |
400 | { | 400 | { |
401 | mIconView->setSelected(aItem, selected); | 401 | mIconView->setSelected(aItem, selected); |
402 | mIconView->ensureItemVisible( aItem ); | 402 | mIconView->ensureItemVisible( aItem ); |
403 | found = true; | 403 | found = true; |
404 | } | 404 | } |
405 | } | 405 | } |
406 | } | 406 | } |
407 | } | 407 | } |
408 | 408 | ||
409 | void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) | 409 | void KAddressBookIconView::addresseeExecuted(QIconViewItem *item) |
410 | { | 410 | { |
411 | #ifndef KAB_EMBEDDED | 411 | #ifndef KAB_EMBEDDED |
412 | AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 412 | AddresseeIconViewItem *aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
413 | #else //KAB_EMBEDDED | 413 | #else //KAB_EMBEDDED |
414 | AddresseeIconViewItem *aItem = (AddresseeIconViewItem*)(item); | 414 | AddresseeIconViewItem *aItem = (AddresseeIconViewItem*)(item); |
415 | #endif //KAB_EMBEDDED | 415 | #endif //KAB_EMBEDDED |
416 | 416 | ||
417 | if (aItem) { | 417 | if (aItem) { |
418 | emit executed(aItem->addressee().uid()); | 418 | emit executed(aItem->addressee().uid()); |
419 | } | 419 | } |
420 | } | 420 | } |
421 | 421 | ||
422 | void KAddressBookIconView::addresseeSelected() | 422 | void KAddressBookIconView::addresseeSelected() |
423 | { | 423 | { |
424 | QIconViewItem *item; | 424 | QIconViewItem *item; |
425 | AddresseeIconViewItem *aItem; | 425 | AddresseeIconViewItem *aItem; |
426 | 426 | ||
427 | bool found = false; | 427 | bool found = false; |
428 | for (item = mIconView->firstItem(); item && !found; | 428 | for (item = mIconView->firstItem(); item && !found; |
429 | item = item->nextItem()) | 429 | item = item->nextItem()) |
430 | { | 430 | { |
431 | if (item->isSelected()) | 431 | if (item->isSelected()) |
432 | { | 432 | { |
433 | #ifndef KAB_EMBEDDED | 433 | #ifndef KAB_EMBEDDED |
434 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); | 434 | aItem = dynamic_cast<AddresseeIconViewItem*>(item); |
435 | #else //KAB_EMBEDDED | 435 | #else //KAB_EMBEDDED |
436 | aItem = (AddresseeIconViewItem*)(item); | 436 | aItem = (AddresseeIconViewItem*)(item); |
437 | #endif //KAB_EMBEDDED | 437 | #endif //KAB_EMBEDDED |
438 | if (aItem) | 438 | if (aItem) |
439 | { | 439 | { |
440 | emit selected(aItem->addressee().uid()); | 440 | emit selected(aItem->addressee().uid()); |
441 | found = true; | 441 | found = true; |
442 | } | 442 | } |
443 | } | 443 | } |
444 | } | 444 | } |
445 | 445 | ||
446 | if (!found) | 446 | if (!found) |
447 | emit selected(QString::null); | 447 | emit selected(QString::null); |
448 | } | 448 | } |
449 | 449 | ||
450 | #ifndef KAB_EMBEDDED | 450 | #ifndef KAB_EMBEDDED |
451 | #include "kaddressbookiconview.moc" | 451 | #include "kaddressbookiconview.moc" |
452 | #endif //KAB_EMBEDDED | 452 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 565cd1d..348f491 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp | |||
@@ -1,369 +1,369 @@ | |||
1 | // $Id$ | 1 | // $Id$ |
2 | 2 | ||
3 | #include <qvbox.h> | 3 | #include <qvbox.h> |
4 | #include <qlistbox.h> | 4 | #include <qlistbox.h> |
5 | #include <qwidget.h> | 5 | #include <qwidget.h> |
6 | #include <qfile.h> | 6 | #include <qfile.h> |
7 | #include <qimage.h> | 7 | #include <qimage.h> |
8 | #include <qcombobox.h> | 8 | #include <qcombobox.h> |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | #include <qdragobject.h> | 10 | #include <qdragobject.h> |
11 | #include <qevent.h> | 11 | #include <qevent.h> |
12 | #include <qurl.h> | 12 | #include <qurl.h> |
13 | #include <qpixmap.h> | 13 | #include <qpixmap.h> |
14 | 14 | ||
15 | #include <kabc/addressbook.h> | 15 | #include <kabc/addressbook.h> |
16 | #include <kapplication.h> | 16 | #include <kapplication.h> |
17 | #include <kconfig.h> | 17 | #include <kconfig.h> |
18 | #include <kcolorbutton.h> | 18 | #include <kcolorbutton.h> |
19 | #include <kdebug.h> | 19 | #include <kdebug.h> |
20 | #include <kglobal.h> | 20 | #include <kglobal.h> |
21 | #include <kiconloader.h> | 21 | #include <kiconloader.h> |
22 | #include <klineedit.h> | 22 | #include <klineedit.h> |
23 | #include <klocale.h> | 23 | #include <klocale.h> |
24 | #include <kmessagebox.h> | 24 | #include <kmessagebox.h> |
25 | #include <kurl.h> | 25 | #include <kurl.h> |
26 | #include <kurlrequester.h> | 26 | #include <kurlrequester.h> |
27 | 27 | ||
28 | //US#include "configuretableviewdialog.h" | 28 | //US#include "configuretableviewdialog.h" |
29 | #include "contactlistview.h" | 29 | #include "contactlistview.h" |
30 | #include "kabprefs.h" | 30 | #include "kabprefs.h" |
31 | #include "undocmds.h" | 31 | #include "undocmds.h" |
32 | #include "viewmanager.h" | 32 | #include "viewmanager.h" |
33 | 33 | ||
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qheader.h> | 35 | #include <qheader.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | 37 | ||
38 | #include "kaddressbooktableview.h" | 38 | #include "kaddressbooktableview.h" |
39 | 39 | ||
40 | 40 | ||
41 | KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, | 41 | KAddressBookTableView::KAddressBookTableView( KABC::AddressBook *ab, |
42 | QWidget *parent, const char *name ) | 42 | QWidget *parent, const char *name ) |
43 | : KAddressBookView( ab, parent, name ) | 43 | : KAddressBookView( ab, parent, name ) |
44 | { | 44 | { |
45 | mainLayout = new QVBoxLayout( viewWidget(), 2 ); | 45 | mainLayout = new QVBoxLayout( viewWidget(), 2 ); |
46 | 46 | ||
47 | // The list view will be created when the config is read. | 47 | // The list view will be created when the config is read. |
48 | mListView = 0; | 48 | mListView = 0; |
49 | } | 49 | } |
50 | 50 | ||
51 | KAddressBookTableView::~KAddressBookTableView() | 51 | KAddressBookTableView::~KAddressBookTableView() |
52 | { | 52 | { |
53 | } | 53 | } |
54 | void KAddressBookTableView::setFocusAV() | 54 | void KAddressBookTableView::setFocusAV() |
55 | { | 55 | { |
56 | if ( mListView ) | 56 | if ( mListView ) |
57 | mListView->setFocus(); | 57 | mListView->setFocus(); |
58 | 58 | ||
59 | } | 59 | } |
60 | void KAddressBookTableView::scrollUP() | 60 | void KAddressBookTableView::scrollUP() |
61 | { | 61 | { |
62 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); | 62 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Up, 0,0 ); |
63 | QApplication::postEvent( mListView, ev ); | 63 | QApplication::postEvent( mListView, ev ); |
64 | ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Up, 0,0 ); | 64 | ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Up, 0,0 ); |
65 | QApplication::postEvent( mListView, ev ); | 65 | QApplication::postEvent( mListView, ev ); |
66 | } | 66 | } |
67 | void KAddressBookTableView::scrollDOWN() | 67 | void KAddressBookTableView::scrollDOWN() |
68 | { | 68 | { |
69 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); | 69 | QKeyEvent * ev = new QKeyEvent ( QEvent::KeyPress, Qt::Key_Down, 0,0 ); |
70 | QApplication::postEvent( mListView, ev ); | 70 | QApplication::postEvent( mListView, ev ); |
71 | ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 ); | 71 | ev = new QKeyEvent ( QEvent::KeyRelease, Qt::Key_Down, 0,0 ); |
72 | QApplication::postEvent( mListView, ev ); | 72 | QApplication::postEvent( mListView, ev ); |
73 | } | 73 | } |
74 | void KAddressBookTableView::reconstructListView() | 74 | void KAddressBookTableView::reconstructListView() |
75 | { | 75 | { |
76 | if (mListView) | 76 | if (mListView) |
77 | { | 77 | { |
78 | disconnect(mListView, SIGNAL(selectionChanged()), | 78 | disconnect(mListView, SIGNAL(selectionChanged()), |
79 | this, SLOT(addresseeSelected())); | 79 | this, SLOT(addresseeSelected())); |
80 | disconnect(mListView, SIGNAL(executed(QListViewItem*)), | 80 | disconnect(mListView, SIGNAL(executed(QListViewItem*)), |
81 | this, SLOT(addresseeExecuted(QListViewItem*))); | 81 | this, SLOT(addresseeExecuted(QListViewItem*))); |
82 | disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), | 82 | disconnect(mListView, SIGNAL(doubleClicked(QListViewItem*)), |
83 | this, SLOT(addresseeExecuted(QListViewItem*))); | 83 | this, SLOT(addresseeExecuted(QListViewItem*))); |
84 | disconnect(mListView, SIGNAL(startAddresseeDrag()), this, | 84 | disconnect(mListView, SIGNAL(startAddresseeDrag()), this, |
85 | SIGNAL(startDrag())); | 85 | SIGNAL(startDrag())); |
86 | disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), | 86 | disconnect(mListView, SIGNAL(returnPressed(QListViewItem*)), |
87 | this, SLOT(addresseeExecuted(QListViewItem*))); | 87 | this, SLOT(addresseeExecuted(QListViewItem*))); |
88 | 88 | ||
89 | disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, | 89 | disconnect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, |
90 | SIGNAL(dropped(QDropEvent*))); | 90 | SIGNAL(dropped(QDropEvent*))); |
91 | delete mListView; | 91 | delete mListView; |
92 | } | 92 | } |
93 | 93 | ||
94 | mListView = new ContactListView( this, addressBook(), viewWidget() ); | 94 | mListView = new ContactListView( this, addressBook(), viewWidget() ); |
95 | 95 | ||
96 | connect(this, SIGNAL(printView()), | 96 | connect(this, SIGNAL(printView()), |
97 | mListView , SLOT(printMe())); | 97 | mListView , SLOT(printMe())); |
98 | //US set singleClick manually, because it is no global configparameter in embedded space | 98 | //US set singleClick manually, because it is no global configparameter in embedded space |
99 | mListView->setSingleClick(KABPrefs::instance()->mHonorSingleClick); | 99 | mListView->setSingleClick(KABPrefs::instance()->mHonorSingleClick); |
100 | 100 | ||
101 | // Add the columns | 101 | // Add the columns |
102 | KABC::Field::List fieldList = fields(); | 102 | KABC::Field::List fieldList = fields(); |
103 | KABC::Field::List::ConstIterator it; | 103 | KABC::Field::List::ConstIterator it; |
104 | 104 | ||
105 | int c = 0; | 105 | int c = 0; |
106 | for( it = fieldList.begin(); it != fieldList.end(); ++it ) { | 106 | for( it = fieldList.begin(); it != fieldList.end(); ++it ) { |
107 | mListView->addColumn( (*it)->label() ); | 107 | mListView->addColumn( (*it)->label() ); |
108 | mListView->setColumnWidthMode(c++, QListView::Manual); | 108 | mListView->setColumnWidthMode(c++, QListView::Manual); |
109 | //US | 109 | //US |
110 | // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); | 110 | // qDebug("KAddressBookTableView::reconstructListView: field %s", (*it)->label().latin1()); |
111 | } | 111 | } |
112 | 112 | ||
113 | connect(mListView, SIGNAL(selectionChanged()), | 113 | connect(mListView, SIGNAL(selectionChanged()), |
114 | this, SLOT(addresseeSelected())); | 114 | this, SLOT(addresseeSelected())); |
115 | connect(mListView, SIGNAL(startAddresseeDrag()), this, | 115 | connect(mListView, SIGNAL(startAddresseeDrag()), this, |
116 | SIGNAL(startDrag())); | 116 | SIGNAL(startDrag())); |
117 | connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, | 117 | connect(mListView, SIGNAL(addresseeDropped(QDropEvent*)), this, |
118 | SIGNAL(dropped(QDropEvent*))); | 118 | SIGNAL(dropped(QDropEvent*))); |
119 | 119 | ||
120 | if (KABPrefs::instance()->mHonorSingleClick) { | 120 | if (KABPrefs::instance()->mHonorSingleClick) { |
121 | // qDebug("KAddressBookTableView::reconstructListView single"); | 121 | // qDebug("KAddressBookTableView::reconstructListView single"); |
122 | connect(mListView, SIGNAL(executed(QListViewItem*)), | 122 | connect(mListView, SIGNAL(executed(QListViewItem*)), |
123 | this, SLOT(addresseeExecuted(QListViewItem*))); | 123 | this, SLOT(addresseeExecuted(QListViewItem*))); |
124 | } else { | 124 | } else { |
125 | // qDebug("KAddressBookTableView::reconstructListView double"); | 125 | // qDebug("KAddressBookTableView::reconstructListView double"); |
126 | connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), | 126 | connect(mListView, SIGNAL(doubleClicked(QListViewItem*)), |
127 | this, SLOT(addresseeExecuted(QListViewItem*))); | 127 | this, SLOT(addresseeExecuted(QListViewItem*))); |
128 | } | 128 | } |
129 | connect(mListView, SIGNAL(returnPressed(QListViewItem*)), | 129 | connect(mListView, SIGNAL(returnPressed(QListViewItem*)), |
130 | this, SLOT(addresseeExecuted(QListViewItem*))); | 130 | this, SLOT(addresseeExecuted(QListViewItem*))); |
131 | connect(mListView, SIGNAL(signalDelete()), | 131 | connect(mListView, SIGNAL(signalDelete()), |
132 | this, SLOT(addresseeDeleted())); | 132 | this, SLOT(addresseeDeleted())); |
133 | 133 | ||
134 | //US performceimprovement. Refresh is done from the outside | 134 | //US performceimprovement. Refresh is done from the outside |
135 | //US refresh(); | 135 | //US refresh(); |
136 | 136 | ||
137 | mListView->setSorting( 0, true ); | 137 | mListView->setSorting( 0, true ); |
138 | mainLayout->addWidget( mListView ); | 138 | mainLayout->addWidget( mListView ); |
139 | mainLayout->activate(); | 139 | mainLayout->activate(); |
140 | mListView->show(); | 140 | mListView->show(); |
141 | } | 141 | } |
142 | 142 | ||
143 | void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) | 143 | void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) |
144 | { | 144 | { |
145 | mListView->clear(); | 145 | mListView->clear(); |
146 | if ( s.isEmpty() || s == "*" ) { | 146 | if ( s.isEmpty() || s == "*" ) { |
147 | refresh(); | 147 | refresh(); |
148 | return; | 148 | return; |
149 | } | 149 | } |
150 | QRegExp re = getRegExp( s ); | 150 | QRegExp re = getRegExp( s ); |
151 | if (!re.isValid()) | 151 | if (!re.isValid()) |
152 | return; | 152 | return; |
153 | KABC::Addressee::List addresseeList = addressees(); | 153 | KABC::Addressee::List addresseeList = addressees(); |
154 | KABC::Addressee::List::Iterator it; | 154 | KABC::Addressee::List::Iterator it; |
155 | if ( field ) { | 155 | if ( field ) { |
156 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 156 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
157 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 157 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
158 | continue; | 158 | continue; |
159 | #if QT_VERSION >= 0x030000 | 159 | #if QT_VERSION >= 0x030000 |
160 | if (re.search(field->value( *it ).lower()) == 0) | 160 | if (re.search(field->value( *it ).lower()) == 0) |
161 | #else | 161 | #else |
162 | if (re.match(field->value( *it ).lower()) != -1) | 162 | if (re.match(field->value( *it ).lower()) == 0) |
163 | #endif | 163 | #endif |
164 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 164 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
165 | 165 | ||
166 | } | 166 | } |
167 | } else { | 167 | } else { |
168 | KABC::Field::List fieldList = allFields(); | 168 | KABC::Field::List fieldList = allFields(); |
169 | KABC::Field::List::ConstIterator fieldIt; | 169 | KABC::Field::List::ConstIterator fieldIt; |
170 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 170 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
171 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 171 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
172 | continue; | 172 | continue; |
173 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { | 173 | for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { |
174 | #if QT_VERSION >= 0x030000 | 174 | #if QT_VERSION >= 0x030000 |
175 | if (re.search((*fieldIt)->value( *it ).lower()) != -1) | 175 | if (re.search((*fieldIt)->value( *it ).lower()) == 0) |
176 | #else | 176 | #else |
177 | if (re.match((*fieldIt)->value( *it ).lower()) != -1) | 177 | if (re.match((*fieldIt)->value( *it ).lower()) == 0) |
178 | #endif | 178 | #endif |
179 | { | 179 | { |
180 | //qDebug("match %s %s %s", pattern.latin1(), (*fieldIt)->value( *it ).latin1(), (*fieldIt)->label().latin1() ); | 180 | //qDebug("match %s %s %s", pattern.latin1(), (*fieldIt)->value( *it ).latin1(), (*fieldIt)->label().latin1() ); |
181 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 181 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
182 | break; | 182 | break; |
183 | } | 183 | } |
184 | } | 184 | } |
185 | } | 185 | } |
186 | } | 186 | } |
187 | // Sometimes the background pixmap gets messed up when we add lots | 187 | // Sometimes the background pixmap gets messed up when we add lots |
188 | // of items. | 188 | // of items. |
189 | //mListView->repaint(); | 189 | //mListView->repaint(); |
190 | if ( mListView->firstChild() ) { | 190 | if ( mListView->firstChild() ) { |
191 | mListView->setCurrentItem ( mListView->firstChild() ); | 191 | mListView->setCurrentItem ( mListView->firstChild() ); |
192 | mListView->setSelected ( mListView->firstChild(), true ); | 192 | mListView->setSelected ( mListView->firstChild(), true ); |
193 | } | 193 | } |
194 | else | 194 | else |
195 | emit selected(QString::null); | 195 | emit selected(QString::null); |
196 | 196 | ||
197 | } | 197 | } |
198 | void KAddressBookTableView::writeConfig(KConfig *config) | 198 | void KAddressBookTableView::writeConfig(KConfig *config) |
199 | { | 199 | { |
200 | KAddressBookView::writeConfig(config); | 200 | KAddressBookView::writeConfig(config); |
201 | 201 | ||
202 | mListView->saveLayout(config, config->group()); | 202 | mListView->saveLayout(config, config->group()); |
203 | } | 203 | } |
204 | 204 | ||
205 | void KAddressBookTableView::readConfig(KConfig *config) | 205 | void KAddressBookTableView::readConfig(KConfig *config) |
206 | { | 206 | { |
207 | KAddressBookView::readConfig( config ); | 207 | KAddressBookView::readConfig( config ); |
208 | // The config could have changed the fields, so we need to reconstruct | 208 | // The config could have changed the fields, so we need to reconstruct |
209 | // the listview. | 209 | // the listview. |
210 | reconstructListView(); | 210 | reconstructListView(); |
211 | 211 | ||
212 | // costum colors? | 212 | // costum colors? |
213 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) | 213 | if ( config->readBoolEntry( "EnableCustomColors", false ) ) |
214 | { | 214 | { |
215 | QPalette p( mListView->palette() ); | 215 | QPalette p( mListView->palette() ); |
216 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); | 216 | QColor c = p.color(QPalette::Normal, QColorGroup::Base ); |
217 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); | 217 | p.setColor( QPalette::Normal, QColorGroup::Base, config->readColorEntry( "BackgroundColor", &c ) ); |
218 | c = p.color(QPalette::Normal, QColorGroup::Text ); | 218 | c = p.color(QPalette::Normal, QColorGroup::Text ); |
219 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); | 219 | p.setColor( QPalette::Normal, QColorGroup::Text, config->readColorEntry( "TextColor", &c ) ); |
220 | c = p.color(QPalette::Normal, QColorGroup::Button ); | 220 | c = p.color(QPalette::Normal, QColorGroup::Button ); |
221 | p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); | 221 | p.setColor( QPalette::Normal, QColorGroup::Button, config->readColorEntry( "HeaderColor", &c ) ); |
222 | c = p.color(QPalette::Normal, QColorGroup::ButtonText ); | 222 | c = p.color(QPalette::Normal, QColorGroup::ButtonText ); |
223 | p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); | 223 | p.setColor( QPalette::Normal, QColorGroup::ButtonText, config->readColorEntry( "HeaderTextColor", &c ) ); |
224 | c = p.color(QPalette::Normal, QColorGroup::Highlight ); | 224 | c = p.color(QPalette::Normal, QColorGroup::Highlight ); |
225 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); | 225 | p.setColor( QPalette::Normal, QColorGroup::Highlight, config->readColorEntry( "HighlightColor", &c ) ); |
226 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); | 226 | c = p.color(QPalette::Normal, QColorGroup::HighlightedText ); |
227 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); | 227 | p.setColor( QPalette::Normal, QColorGroup::HighlightedText, config->readColorEntry( "HighlightedTextColor", &c ) ); |
228 | #ifndef KAB_EMBEDDED | 228 | #ifndef KAB_EMBEDDED |
229 | c = KGlobalSettings::alternateBackgroundColor(); | 229 | c = KGlobalSettings::alternateBackgroundColor(); |
230 | #else //KAB_EMBEDDED | 230 | #else //KAB_EMBEDDED |
231 | c = QColor(240, 240, 240); | 231 | c = QColor(240, 240, 240); |
232 | #endif //KAB_EMBEDDED | 232 | #endif //KAB_EMBEDDED |
233 | c = config->readColorEntry ("AlternatingBackgroundColor", &c); | 233 | c = config->readColorEntry ("AlternatingBackgroundColor", &c); |
234 | mListView->setAlternateColor(c); | 234 | mListView->setAlternateColor(c); |
235 | 235 | ||
236 | 236 | ||
237 | //US mListView->viewport()->setPalette( p ); | 237 | //US mListView->viewport()->setPalette( p ); |
238 | mListView->setPalette( p ); | 238 | mListView->setPalette( p ); |
239 | } | 239 | } |
240 | else | 240 | else |
241 | { | 241 | { |
242 | // needed if turned off during a session. | 242 | // needed if turned off during a session. |
243 | //US mListView->viewport()->setPalette( mListView->palette() ); | 243 | //US mListView->viewport()->setPalette( mListView->palette() ); |
244 | mListView->setPalette( mListView->palette() ); | 244 | mListView->setPalette( mListView->palette() ); |
245 | } | 245 | } |
246 | 246 | ||
247 | //custom fonts? | 247 | //custom fonts? |
248 | QFont f( font() ); | 248 | QFont f( font() ); |
249 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) | 249 | if ( config->readBoolEntry( "EnableCustomFonts", false ) ) |
250 | { | 250 | { |
251 | mListView->setFont( config->readFontEntry( "TextFont", &f) ); | 251 | mListView->setFont( config->readFontEntry( "TextFont", &f) ); |
252 | f.setBold( true ); | 252 | f.setBold( true ); |
253 | //US mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); | 253 | //US mListView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); |
254 | mListView->header()->setFont( config->readFontEntry( "HeaderFont", &f ) ); | 254 | mListView->header()->setFont( config->readFontEntry( "HeaderFont", &f ) ); |
255 | } | 255 | } |
256 | else | 256 | else |
257 | { | 257 | { |
258 | mListView->setFont( f ); | 258 | mListView->setFont( f ); |
259 | f.setBold( true ); | 259 | f.setBold( true ); |
260 | //US mListView->setHeaderFont( f ); | 260 | //US mListView->setHeaderFont( f ); |
261 | mListView->header()->setFont( f ); | 261 | mListView->header()->setFont( f ); |
262 | } | 262 | } |
263 | 263 | ||
264 | // Set the list view options | 264 | // Set the list view options |
265 | mListView->setAlternateBackgroundEnabled(config->readBoolEntry("ABackground", | 265 | mListView->setAlternateBackgroundEnabled(config->readBoolEntry("ABackground", |
266 | true)); | 266 | true)); |
267 | mListView->setSingleLineEnabled(config->readBoolEntry("SingleLine", false)); | 267 | mListView->setSingleLineEnabled(config->readBoolEntry("SingleLine", false)); |
268 | mListView->setToolTipsEnabled(config->readBoolEntry("ToolTips", true)); | 268 | mListView->setToolTipsEnabled(config->readBoolEntry("ToolTips", true)); |
269 | 269 | ||
270 | if (config->readBoolEntry("Background", false)) | 270 | if (config->readBoolEntry("Background", false)) |
271 | mListView->setBackgroundPixmap(config->readEntry("BackgroundName")); | 271 | mListView->setBackgroundPixmap(config->readEntry("BackgroundName")); |
272 | 272 | ||
273 | // Restore the layout of the listview | 273 | // Restore the layout of the listview |
274 | mListView->restoreLayout(config, config->group()); | 274 | mListView->restoreLayout(config, config->group()); |
275 | } | 275 | } |
276 | 276 | ||
277 | void KAddressBookTableView::refresh(QString uid) | 277 | void KAddressBookTableView::refresh(QString uid) |
278 | { | 278 | { |
279 | // For now just repopulate. In reality this method should | 279 | // For now just repopulate. In reality this method should |
280 | // check the value of uid, and if valid iterate through | 280 | // check the value of uid, and if valid iterate through |
281 | // the listview to find the entry, then tell it to refresh. | 281 | // the listview to find the entry, then tell it to refresh. |
282 | 282 | ||
283 | if (uid.isNull()) { | 283 | if (uid.isNull()) { |
284 | // Clear the list view | 284 | // Clear the list view |
285 | QString currentUID, nextUID; | 285 | QString currentUID, nextUID; |
286 | #ifndef KAB_EMBEDDED | 286 | #ifndef KAB_EMBEDDED |
287 | ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() ); | 287 | ContactListViewItem *currentItem = dynamic_cast<ContactListViewItem*>( mListView->currentItem() ); |
288 | #else //KAB_EMBEDDED | 288 | #else //KAB_EMBEDDED |
289 | ContactListViewItem *currentItem = (ContactListViewItem*)( mListView->currentItem() ); | 289 | ContactListViewItem *currentItem = (ContactListViewItem*)( mListView->currentItem() ); |
290 | #endif //KAB_EMBEDDED | 290 | #endif //KAB_EMBEDDED |
291 | 291 | ||
292 | if ( currentItem ) { | 292 | if ( currentItem ) { |
293 | #ifndef KAB_EMBEDDED | 293 | #ifndef KAB_EMBEDDED |
294 | ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); | 294 | ContactListViewItem *nextItem = dynamic_cast<ContactListViewItem*>( currentItem->itemBelow() ); |
295 | #else //KAB_EMBEDDED | 295 | #else //KAB_EMBEDDED |
296 | ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); | 296 | ContactListViewItem *nextItem = (ContactListViewItem*)( currentItem->itemBelow() ); |
297 | #endif //KAB_EMBEDDED | 297 | #endif //KAB_EMBEDDED |
298 | if ( nextItem ) | 298 | if ( nextItem ) |
299 | nextUID = nextItem->addressee().uid(); | 299 | nextUID = nextItem->addressee().uid(); |
300 | currentUID = currentItem->addressee().uid(); | 300 | currentUID = currentItem->addressee().uid(); |
301 | } | 301 | } |
302 | 302 | ||
303 | mListView->clear(); | 303 | mListView->clear(); |
304 | 304 | ||
305 | currentItem = 0; | 305 | currentItem = 0; |
306 | KABC::Addressee::List addresseeList = addressees(); | 306 | KABC::Addressee::List addresseeList = addressees(); |
307 | KABC::Addressee::List::Iterator it; | 307 | KABC::Addressee::List::Iterator it; |
308 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { | 308 | for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { |
309 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 309 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
310 | continue; | 310 | continue; |
311 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 311 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
312 | if ( (*it).uid() == currentUID ) | 312 | if ( (*it).uid() == currentUID ) |
313 | currentItem = item; | 313 | currentItem = item; |
314 | else if ( (*it).uid() == nextUID && !currentItem ) | 314 | else if ( (*it).uid() == nextUID && !currentItem ) |
315 | currentItem = item; | 315 | currentItem = item; |
316 | } | 316 | } |
317 | 317 | ||
318 | // Sometimes the background pixmap gets messed up when we add lots | 318 | // Sometimes the background pixmap gets messed up when we add lots |
319 | // of items. | 319 | // of items. |
320 | mListView->repaint(); | 320 | mListView->repaint(); |
321 | 321 | ||
322 | if ( currentItem ) { | 322 | if ( currentItem ) { |
323 | mListView->setCurrentItem( currentItem ); | 323 | mListView->setCurrentItem( currentItem ); |
324 | mListView->ensureItemVisible( currentItem ); | 324 | mListView->ensureItemVisible( currentItem ); |
325 | } | 325 | } |
326 | } else { | 326 | } else { |
327 | // Only need to update on entry. Iterate through and try to find it | 327 | // Only need to update on entry. Iterate through and try to find it |
328 | ContactListViewItem *ceItem; | 328 | ContactListViewItem *ceItem; |
329 | QListViewItemIterator it( mListView ); | 329 | QListViewItemIterator it( mListView ); |
330 | while ( it.current() ) { | 330 | while ( it.current() ) { |
331 | #ifndef KAB_EMBEDDED | 331 | #ifndef KAB_EMBEDDED |
332 | ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); | 332 | ceItem = dynamic_cast<ContactListViewItem*>( it.current() ); |
333 | #else //KAB_EMBEDDED | 333 | #else //KAB_EMBEDDED |
334 | ceItem = (ContactListViewItem*)( it.current() ); | 334 | ceItem = (ContactListViewItem*)( it.current() ); |
335 | #endif //KAB_EMBEDDED | 335 | #endif //KAB_EMBEDDED |
336 | 336 | ||
337 | if ( ceItem && ceItem->addressee().uid() == uid ) { | 337 | if ( ceItem && ceItem->addressee().uid() == uid ) { |
338 | ceItem->refresh(); | 338 | ceItem->refresh(); |
339 | return; | 339 | return; |
340 | } | 340 | } |
341 | ++it; | 341 | ++it; |
342 | } | 342 | } |
343 | 343 | ||
344 | refresh( QString::null ); | 344 | refresh( QString::null ); |
345 | } | 345 | } |
346 | } | 346 | } |
347 | 347 | ||
348 | QStringList KAddressBookTableView::selectedUids() | 348 | QStringList KAddressBookTableView::selectedUids() |
349 | { | 349 | { |
350 | QStringList uidList; | 350 | QStringList uidList; |
351 | QListViewItem *item; | 351 | QListViewItem *item; |
352 | ContactListViewItem *ceItem; | 352 | ContactListViewItem *ceItem; |
353 | 353 | ||
354 | for(item = mListView->firstChild(); item; item = item->itemBelow()) | 354 | for(item = mListView->firstChild(); item; item = item->itemBelow()) |
355 | { | 355 | { |
356 | if (mListView->isSelected( item )) | 356 | if (mListView->isSelected( item )) |
357 | { | 357 | { |
358 | #ifndef KAB_EMBEDDED | 358 | #ifndef KAB_EMBEDDED |
359 | ceItem = dynamic_cast<ContactListViewItem*>(item); | 359 | ceItem = dynamic_cast<ContactListViewItem*>(item); |
360 | #else //KAB_EMBEDDED | 360 | #else //KAB_EMBEDDED |
361 | ceItem = (ContactListViewItem*)(item); | 361 | ceItem = (ContactListViewItem*)(item); |
362 | #endif //KAB_EMBEDDED | 362 | #endif //KAB_EMBEDDED |
363 | 363 | ||
364 | if (ceItem != 0L) | 364 | if (ceItem != 0L) |
365 | uidList << ceItem->addressee().uid(); | 365 | uidList << ceItem->addressee().uid(); |
366 | } | 366 | } |
367 | } | 367 | } |
368 | if ( uidList.count() == 0 ) | 368 | if ( uidList.count() == 0 ) |
369 | if ( mListView->currentItem() ) { | 369 | if ( mListView->currentItem() ) { |