summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-08-23 12:55:50 (UTC)
committer zautrix <zautrix>2005-08-23 12:55:50 (UTC)
commit72d600e2c3b3405e5f37615a56560811c0cf9a78 (patch) (unidiff)
tree0f3eeb3ae34822149ba8b6d62990725e59a29187
parente34e096c0e1b799904643c753591833f3ff2ab95 (diff)
downloadkdepimpi-72d600e2c3b3405e5f37615a56560811c0cf9a78.zip
kdepimpi-72d600e2c3b3405e5f37615a56560811c0cf9a78.tar.gz
kdepimpi-72d600e2c3b3405e5f37615a56560811c0cf9a78.tar.bz2
kopi load change
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt2
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/kotodoview.cpp5
-rw-r--r--korganizer/main.cpp4
-rw-r--r--korganizer/mainwindow.cpp64
-rw-r--r--korganizer/mainwindow.h6
6 files changed, 62 insertions, 23 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index fcfa282..fbd262c 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -790,773 +790,773 @@
790{ "No sound set","Kein Sound definiert" }, 790{ "No sound set","Kein Sound definiert" },
791{ "*.wav|Wav Files","*.wav|Wav Dateien" }, 791{ "*.wav|Wav Files","*.wav|Wav Dateien" },
792{ "No program set","Kein Programm definiert" }, 792{ "No program set","Kein Programm definiert" },
793{ "Running '%1'","Ausführen '%1'" }, 793{ "Running '%1'","Ausführen '%1'" },
794{ "Playing '%1'","Abspielen '%1'" }, 794{ "Playing '%1'","Abspielen '%1'" },
795{ "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" }, 795{ "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" },
796{ "Load!","Laden!" }, 796{ "Load!","Laden!" },
797{ "Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n","Backup Datei vom:\n%1\nDas Laden der Backup Datei\nlöscht die aktuellen Daten!\n" }, 797{ "Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n","Backup Datei vom:\n%1\nDas Laden der Backup Datei\nlöscht die aktuellen Daten!\n" },
798{ "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" }, 798{ "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" },
799{ "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" }, 799{ "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" },
800{ "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" }, 800{ "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" },
801{ "Features + hints...","Eigenschaften + Tipps..." }, 801{ "Features + hints...","Eigenschaften + Tipps..." },
802{ "User translation...","Benutzer Übersetzung..." }, 802{ "User translation...","Benutzer Übersetzung..." },
803{ "Sync HowTo...","Synchronisation HowTo..." }, 803{ "Sync HowTo...","Synchronisation HowTo..." },
804{ "Print calendar...","Drucke Kalender..." }, 804{ "Print calendar...","Drucke Kalender..." },
805{ "Anniversary","Jahrestag" }, 805{ "Anniversary","Jahrestag" },
806{ "When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n","Wenn Geburtstage mehrfach importiert\nwerden, werden doppelte Einträge ignoriert\nwenn sie nicht verändert wurden.\n" }, 806{ "When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n","Wenn Geburtstage mehrfach importiert\nwerden, werden doppelte Einträge ignoriert\nwenn sie nicht verändert wurden.\n" },
807{ "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" }, 807{ "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" },
808{ "Next recurrence is on: ","Nächste Wiederholung ist am:" }, 808{ "Next recurrence is on: ","Nächste Wiederholung ist am:" },
809{ "<b>Alarm on: </b>","<b>Alarm am: </b>" }, 809{ "<b>Alarm on: </b>","<b>Alarm am: </b>" },
810{ "<b>Access: </b>","<b>Zugriff: </b>" }, 810{ "<b>Access: </b>","<b>Zugriff: </b>" },
811{ "(%1 min before)","(%1 min vorher)" }, 811{ "(%1 min before)","(%1 min vorher)" },
812{ "<b>Categories: </b>","<b>Kategorien: </b>" }, 812{ "<b>Categories: </b>","<b>Kategorien: </b>" },
813{ "Save Journal/Description...","Speichere Journal/Details..." }, 813{ "Save Journal/Description...","Speichere Journal/Details..." },
814{ "This saves the text/details of selected\nJournals and Events/Todos\nto a text file.","Das speichert den Text bzw.\ndie Details von selektierten\nJournalen und Events/Todos\nin eine Textdatei." }, 814{ "This saves the text/details of selected\nJournals and Events/Todos\nto a text file.","Das speichert den Text bzw.\ndie Details von selektierten\nJournalen und Events/Todos\nin eine Textdatei." },
815{ "Continue","Weitermachen" }, 815{ "Continue","Weitermachen" },
816{ " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" }, 816{ " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" },
817{ "Attendee:","Teilnehmer:" }, 817{ "Attendee:","Teilnehmer:" },
818{ "Click OK to search ->","Klicke zum Suchen auf OK ->" }, 818{ "Click OK to search ->","Klicke zum Suchen auf OK ->" },
819{ "On day ","Am Tag " }, 819{ "On day ","Am Tag " },
820{ "%1 of ","%1 des Monats" }, 820{ "%1 of ","%1 des Monats" },
821{ "%1 of the year","%1 des Jahres" }, 821{ "%1 of the year","%1 des Jahres" },
822{ "Anonymous","Anonymo" }, 822{ "Anonymous","Anonymo" },
823{ "nobody@nowhere","niemand@nirgendwo" }, 823{ "nobody@nowhere","niemand@nirgendwo" },
824{ "calendar.html","calendar.html" }, 824{ "calendar.html","calendar.html" },
825{ " Local Time"," Lokale Zeit" }, 825{ " Local Time"," Lokale Zeit" },
826{ "Unknown Name","Unbekannter Name" }, 826{ "Unknown Name","Unbekannter Name" },
827{ "unknown@nowhere","unbekannt@nirgendwo" }, 827{ "unknown@nowhere","unbekannt@nirgendwo" },
828{ "Beam via IR!","Beam via IR!" }, 828{ "Beam via IR!","Beam via IR!" },
829{ "Next Month","Nächster Monat" }, 829{ "Next Month","Nächster Monat" },
830{ "Prio","Prio" }, 830{ "Prio","Prio" },
831{ "Reparent Todo","Mache Sub-Todo" }, 831{ "Reparent Todo","Mache Sub-Todo" },
832{ "tomorrow","morgen" }, 832{ "tomorrow","morgen" },
833{ "today","heute" }, 833{ "today","heute" },
834{ "yesterday","gestern" }, 834{ "yesterday","gestern" },
835{ "Ok","Ok" }, 835{ "Ok","Ok" },
836{ "Ok+Agenda","Ok+Agenda" }, 836{ "Ok+Agenda","Ok+Agenda" },
837{ "Email","Email" }, 837{ "Email","Email" },
838{ "RSVP","RSVP" }, 838{ "RSVP","RSVP" },
839{ "Email:","Email:" }, 839{ "Email:","Email:" },
840{ "Appointment Time ","Termin Zeit " }, 840{ "Appointment Time ","Termin Zeit " },
841{ "2","2" }, 841{ "2","2" },
842{ "3","3" }, 842{ "3","3" },
843{ "4","4" }, 843{ "4","4" },
844{ " 0 %"," 0 %" }, 844{ " 0 %"," 0 %" },
845{ " 20 %"," 20 %" }, 845{ " 20 %"," 20 %" },
846{ " 40 %"," 40 %" }, 846{ " 40 %"," 40 %" },
847{ " 60 %"," 60 %" }, 847{ " 60 %"," 60 %" },
848{ " 80 %"," 80 %" }, 848{ " 80 %"," 80 %" },
849{ "100 %","100 %" }, 849{ "100 %","100 %" },
850{ "Filter","Filter" }, 850{ "Filter","Filter" },
851{ "Configure","Konfiguriere" }, 851{ "Configure","Konfiguriere" },
852{ "What's Next","What's Next" }, 852{ "What's Next","What's Next" },
853{ "Complete calendar...","Kompletten Kalender..." }, 853{ "Complete calendar...","Kompletten Kalender..." },
854{ "Filtered calendar...","Gefilterten Kalender..." }, 854{ "Filtered calendar...","Gefilterten Kalender..." },
855{ "Export to phone","Exportiere zum Handy" }, 855{ "Export to phone","Exportiere zum Handy" },
856{ "Beam receive enabled","Beam Empfang an" }, 856{ "Beam receive enabled","Beam Empfang an" },
857{ "What's new?","Was ist neu?" }, 857{ "What's new?","Was ist neu?" },
858{ "FAQ...","FAQ..." }, 858{ "FAQ...","FAQ..." },
859{ "Licence...","Licence..." }, 859{ "Licence...","Licence..." },
860{ "What's This?","What's This?" }, 860{ "What's This?","What's This?" },
861{ "&Edit...","Bearbeite..." }, 861{ "&Edit...","Bearbeite..." },
862{ "Oktober","Oktober" }, 862{ "Oktober","Oktober" },
863{ "Title","Titel" }, 863{ "Title","Titel" },
864{ "%1 %","%1 %" }, 864{ "%1 %","%1 %" },
865{ "Enable Pi-Sync","Schalte Pi-Sync an" }, 865{ "Enable Pi-Sync","Schalte Pi-Sync an" },
866{ "Import!","Importiere!" }, 866{ "Import!","Importiere!" },
867{ "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" }, 867{ "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" },
868{ "Export to phone options","Export ans Handy Optionen" }, 868{ "Export to phone options","Export ans Handy Optionen" },
869{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, 869{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." },
870{ "I/O device: ","I/O device: " }, 870{ "I/O device: ","I/O device: " },
871{ "Connection: ","Connection: " }, 871{ "Connection: ","Connection: " },
872{ "Model(opt.): ","Model(opt.): " }, 872{ "Model(opt.): ","Model(opt.): " },
873{ "Write back events in future only","Schreibe nur zukünftige Termine zurück" }, 873{ "Write back events in future only","Schreibe nur zukünftige Termine zurück" },
874{ "Max. weeks in future: ","Max. Wochen in der Zukunft: " }, 874{ "Max. weeks in future: ","Max. Wochen in der Zukunft: " },
875{ "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nTodo/Kalender Daten auf dem Handy!" }, 875{ "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nTodo/Kalender Daten auf dem Handy!" },
876{ "Export to mobile phone!","Exportiere auf das Handy!" }, 876{ "Export to mobile phone!","Exportiere auf das Handy!" },
877{ "Export complete calendar","Exportiere kompletten Kalender" }, 877{ "Export complete calendar","Exportiere kompletten Kalender" },
878{ "Writing to phone...","Sende Daten ans Handy..." }, 878{ "Writing to phone...","Sende Daten ans Handy..." },
879{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, 879{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" },
880{ "Retry","Nochmal versuchen" }, 880{ "Retry","Nochmal versuchen" },
881{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, 881{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" },
882{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, 882{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" },
883{ "Error exporting to phone!","Fehler beim Export auf das Handy!" }, 883{ "Error exporting to phone!","Fehler beim Export auf das Handy!" },
884{ "Export filtered calendar","Exportiere gefilterten Kalender" }, 884{ "Export filtered calendar","Exportiere gefilterten Kalender" },
885{ "Preferences","Vorlieben" }, 885{ "Preferences","Vorlieben" },
886{ "Global","Global" }, 886{ "Global","Global" },
887{ "Phone","Phone" }, 887{ "Phone","Phone" },
888{ "SMS","SMS" }, 888{ "SMS","SMS" },
889{ "Fax","Fax" }, 889{ "Fax","Fax" },
890{ "Pager","Pager" }, 890{ "Pager","Pager" },
891{ "SIP","SIP" }, 891{ "SIP","SIP" },
892{ "Italian","Italienisch" }, 892{ "Italian","Italienisch" },
893{ "24:00","24:00" }, 893{ "24:00","24:00" },
894{ "12:00am","12:00am" }, 894{ "12:00am","12:00am" },
895{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, 895{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" },
896{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, 896{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" },
897{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, 897{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" },
898{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, 898{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" },
899{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, 899{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" },
900{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, 900{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" },
901{ "Used Mail Client","Benutzter Mail Client" }, 901{ "Used Mail Client","Benutzter Mail Client" },
902{ "Channel:","Channel:" }, 902{ "Channel:","Channel:" },
903{ "Message:","Message:" }, 903{ "Message:","Message:" },
904{ "Parameters:","Parameter:" }, 904{ "Parameters:","Parameter:" },
905{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, 905{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" },
906{ "extra Message:","extra Message:" }, 906{ "extra Message:","extra Message:" },
907{ "extra Parameters:","extra Parameter:" }, 907{ "extra Parameters:","extra Parameter:" },
908{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, 908{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" },
909{ "External Apps.","Externe Appl." }, 909{ "External Apps.","Externe Appl." },
910{ "24 hours","24 Std." }, 910{ "24 hours","24 Std." },
911{ "3 hours","3 Std." }, 911{ "3 hours","3 Std." },
912{ "1 hour","1 Std." }, 912{ "1 hour","1 Std." },
913{ "15 minutes","15 Min." }, 913{ "15 minutes","15 Min." },
914{ "5 minutes","5 Min." }, 914{ "5 minutes","5 Min." },
915{ "1 minute","1 Min." }, 915{ "1 minute","1 Min." },
916{ "23","23" }, 916{ "23","23" },
917{ "Mon 15","Mon 15" }, 917{ "Mon 15","Mon 15" },
918{ "Configure KO","Konfiguriere KO" }, 918{ "Configure KO","Konfiguriere KO" },
919{ "Event text","Termin Text" }, 919{ "Event text","Termin Text" },
920{ "ToDo","Todo" }, 920{ "ToDo","Todo" },
921{ "Today","Heute" }, 921{ "Today","Heute" },
922{ "What's Next View","What's Next Ansicht" }, 922{ "What's Next View","What's Next Ansicht" },
923{ "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" }, 923{ "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" },
924{ "Alarm","Alarm" }, 924{ "Alarm","Alarm" },
925{ "Used %1 Client","Benutzter %1 Client" }, 925{ "Used %1 Client","Benutzter %1 Client" },
926{ "No email client installed","Kein Email Klient installiert" }, 926{ "No email client installed","Kein Email Klient installiert" },
927{ "Userdefined email client","Benutzerdef. Email Klient" }, 927{ "Userdefined email client","Benutzerdef. Email Klient" },
928{ "OM/Pi email client","OM/Pi Email Klient" }, 928{ "OM/Pi email client","OM/Pi Email Klient" },
929{ "Include in multiple ","Beziehe in multiple " }, 929{ "Include in multiple ","Beziehe in multiple " },
930{ "calendar ","Kalender " }, 930{ "calendar ","Kalender " },
931{ "addressbook ","Adressbuch " }, 931{ "addressbook ","Adressbuch " },
932{ "pwmanager","PWmanager" }, 932{ "pwmanager","PWmanager" },
933{ " sync"," Sync ein" }, 933{ " sync"," Sync ein" },
934{ "Write back synced data","Schreibe gesyncte Daten zurück" }, 934{ "Write back synced data","Schreibe gesyncte Daten zurück" },
935{ "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, 935{ "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" },
936{ "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, 936{ "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" },
937{ "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, 937{ "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " },
938{ "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, 938{ "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" },
939{ "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, 939{ "Mobile device (cell phone)","Mobiles Gerät (Handy)" },
940{ "Help...","Hilfe..." }, 940{ "Help...","Hilfe..." },
941{ "Local file Cal:","Lokale Datei Kal:" }, 941{ "Local file Cal:","Lokale Datei Kal:" },
942{ "Local file ABook:","Lokale Datei ABuch:" }, 942{ "Local file ABook:","Lokale Datei ABuch:" },
943{ "Local file PWMgr:","Lokale Datei PWMgr:" }, 943{ "Local file PWMgr:","Lokale Datei PWMgr:" },
944{ "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, 944{ "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" },
945{ "Calendar:","Kalender:" }, 945{ "Calendar:","Kalender:" },
946{ "AddressBook:","AdressBuch:" }, 946{ "AddressBook:","AdressBuch:" },
947{ "PWManager:","PWManager:" }, 947{ "PWManager:","PWManager:" },
948{ "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, 948{ "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" },
949{ "ssh/scp","ssh/scp" }, 949{ "ssh/scp","ssh/scp" },
950{ "ftp","ftp" }, 950{ "ftp","ftp" },
951{ "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, 951{ "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" },
952{ "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, 952{ "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" },
953{ "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, 953{ "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" },
954{ "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, 954{ "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" },
955{ "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, 955{ "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" },
956{ "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, 956{ "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" },
957{ "KDE-Pim sync config","KDE-Pim sync Konfig" }, 957{ "KDE-Pim sync config","KDE-Pim sync Konfig" },
958{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, 958{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" },
959{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" }, 959{ "Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n","Empfohlen: Leer lassen!\n(So dass das Model\nautomatisch erkannt\nwerden kann)\nOder füge Model Name ein:\n" },
960{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, 960{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" },
961{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, 961{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" },
962{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, 962{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" },
963{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, 963{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" },
964{ "Disable Pi-Sync","Schalte Pi-Sync aus" }, 964{ "Disable Pi-Sync","Schalte Pi-Sync aus" },
965{ "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen "Multi-Syncen"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" }, 965{ "Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!","Wollen Sie wirklich\nmit allen selektierten\nProfilen "Multi-Syncen"?\nDas Syncen dauert einige Zeit -\nalle Profile werden zweimal gesynct!" },
966{ "KDE-Pim Sync","KDE-Pim Sync" }, 966{ "KDE-Pim Sync","KDE-Pim Sync" },
967{ "Multiple profiles","Multi-Sync Profile" }, 967{ "Multiple profiles","Multi-Sync Profile" },
968{ "Device: ","Gerät: " }, 968{ "Device: ","Gerät: " },
969{ "Multiple sync started.","Multi-Sync gestartet." }, 969{ "Multiple sync started.","Multi-Sync gestartet." },
970{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, 970{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" },
971{ "Turn filter on","Schalte Filter an" }, 971{ "Turn filter on","Schalte Filter an" },
972{ "Turn filter off","Schalte Filter aus" }, 972{ "Turn filter off","Schalte Filter aus" },
973{ "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, 973{ "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" },
974{ "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, 974{ "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" },
975{ "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, 975{ "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" },
976{ "<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n","<p><b>Schwarz</b>: Termin/Todo mit Teilnehmern. Sie sind der Organisator!</p>\n" }, 976{ "<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n","<p><b>Schwarz</b>: Termin/Todo mit Teilnehmern. Sie sind der Organisator!</p>\n" },
977{ "<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n","<p><b>Dunkelgrün</b>: Information(Beschreibung) verfügbar.([i] in WN Ansicht)</p>\n" }, 977{ "<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n","<p><b>Dunkelgrün</b>: Information(Beschreibung) verfügbar.([i] in WN Ansicht)</p>\n" },
978{ "<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n","<p><b>Blau</b>: Wiederholender Termin.([r] in Whats'Next Ansicht)</p>\n" }, 978{ "<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n","<p><b>Blau</b>: Wiederholender Termin.([r] in Whats'Next Ansicht)</p>\n" },
979{ "<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n","<p><b>Rot</b>: Alarm gesetzt.([a] in Whats'Next Ansicht)</p>\n" }, 979{ "<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n","<p><b>Rot</b>: Alarm gesetzt.([a] in Whats'Next Ansicht)</p>\n" },
980{ "<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n","<p><b>Kreuz</b>: Eintrag gecancelt.([c] in Whats'Next Ansicht)</p>\n" }, 980{ "<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n","<p><b>Kreuz</b>: Eintrag gecancelt.([c] in Whats'Next Ansicht)</p>\n" },
981{ "<p><b>(for square icons in agenda and month view)</b></p>\n","<p><b>(für quadratische Icons in Agenda und Monats Ansicht)</b></p>\n" }, 981{ "<p><b>(for square icons in agenda and month view)</b></p>\n","<p><b>(für quadratische Icons in Agenda und Monats Ansicht)</b></p>\n" },
982{ "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, 982{ "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" },
983{ "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, 983{ "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" },
984{ "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, 984{ "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" },
985{ "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, 985{ "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" },
986{ "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, 986{ "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" },
987{ "<p><b>shift+up/down</b>: Goto first/last item</p>\n","<p><b>shift+up/down</b>: Gehe zum ersten/letzten Eintrag</p>\n" }, 987{ "<p><b>shift+up/down</b>: Goto first/last item</p>\n","<p><b>shift+up/down</b>: Gehe zum ersten/letzten Eintrag</p>\n" },
988{ "<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n","<p><b>ctrl+up/down</b>: Gehe hoch/runter 20% aller Einträge</p>\n" }, 988{ "<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n","<p><b>ctrl+up/down</b>: Gehe hoch/runter 20% aller Einträge</p>\n" },
989{ "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, 989{ "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" },
990{ "<p><b>return+shift</b>: Deselect item+one step down</p>\n","<p><b>return+shift</b>: Deselektiere Item+Cursor einen Eintrag runter</p>\n" }, 990{ "<p><b>return+shift</b>: Deselect item+one step down</p>\n","<p><b>return+shift</b>: Deselektiere Item+Cursor einen Eintrag runter</p>\n" },
991{ "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, 991{ "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" },
992{ "<p><b>I</b>: Show info of current item+one step down.</p>\n","<p><b>I</b>: Zeige Detail-Ansicht vom sel.Eintrag+Cursor einen Eintrag runter.</p>\n" }, 992{ "<p><b>I</b>: Show info of current item+one step down.</p>\n","<p><b>I</b>: Zeige Detail-Ansicht vom sel.Eintrag+Cursor einen Eintrag runter.</p>\n" },
993{ "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, 993{ "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" },
994{ "<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n","<p><b>return+shift</b>: Markiere Todo als nicht erledigt+Cursor einen Eintrag runter</p>\n" }, 994{ "<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n","<p><b>return+shift</b>: Markiere Todo als nicht erledigt+Cursor einen Eintrag runter</p>\n" },
995{ "<p><b>return</b>: Mark item as completed+one step down.</p>\n","<p><b>return</b>: Markiere Todo als erledigt+Cursor einen Eintrag runter.</p>\n" }, 995{ "<p><b>return</b>: Mark item as completed+one step down.</p>\n","<p><b>return</b>: Markiere Todo als erledigt+Cursor einen Eintrag runter.</p>\n" },
996{ "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, 996{ "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" },
997{ "<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n","<p><b>shift+P</b>: Mache Todo zum neuen <b>P</b>arent Todo für das Todo, welches mit shift+Sselektiert wurde.</p>\n" }, 997{ "<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n","<p><b>shift+P</b>: Mache Todo zum neuen <b>P</b>arent Todo für das Todo, welches mit shift+Sselektiert wurde.</p>\n" },
998{ "<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n","<p><b>shift+S</b>: Mache Todo zum <b>S</b>ubtodo</p>\n" }, 998{ "<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n","<p><b>shift+S</b>: Mache Todo zum <b>S</b>ubtodo</p>\n" },
999{ "<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n","<p><b>shift+U</b>: <b>U</b>nparent Todo (Mache Sub-Todo zum Toplevel Todo)</p>\n" }, 999{ "<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n","<p><b>shift+U</b>: <b>U</b>nparent Todo (Mache Sub-Todo zum Toplevel Todo)</p>\n" },
1000{ "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, 1000{ "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" },
1001{ "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, 1001{ "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" },
1002{ "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, 1002{ "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" },
1003{ "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, 1003{ "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" },
1004{ "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, 1004{ "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" },
1005{ "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" }, 1005{ "<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n","<p><b>left</b>: Vorh. Woche | <b>left+ctrl</b>: Vorh. Monat</p>\n" },
1006{ "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" }, 1006{ "<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n","<p><b>right</b>: Nächste Woche | <b>right+ctrl</b>: Nächste Woche</p>\n" },
1007{ "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, 1007{ "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" },
1008{ "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, 1008{ "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" },
1009{ "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" }, 1009{ "<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n","<p><b>+,-</b> : Zoom rein/raus Agenda | <b>A</b>: Wechsle Ganztag Agenda Höhe</p>\n" },
1010{ "<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X+ctrl</b>: Zeige/verstecke Datumsnavigator</p>\n" }, 1010{ "<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X+ctrl</b>: Zeige/verstecke Datumsnavigator</p>\n" },
1011{ "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" }, 1011{ "<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n","<p><b>T</b>: Gehe zu Heute | <b>T+ctrl</b>: Neues Todo</p>\n" },
1012{ "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" }, 1012{ "<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n","<p><b>E</b>: Editiere selektiertes Item |<b> E+ctrl</b>: Neuer Termin</p>\n" },
1013{ "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monatsansicht</p>\n" }, 1013{ "<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n","<p><b>D</b>: Ein-Tages Ansicht | <b>M</b>: Monatsansicht</p>\n" },
1014{ "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochenansicht | <b>U</b>: Wochenansicht</p>\n" }, 1014{ "<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n","<p><b>Z,Y</b>: Arbeitswochenansicht | <b>U</b>: Wochenansicht</p>\n" },
1015{ "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" }, 1015{ "<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n","<p><b>V</b>: Todo Ansicht | <b>L</b>: Termin Listen Ansicht</p>\n" },
1016{ "<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ","<p><b>X</b>: Nächste-X-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " }, 1016{ "<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ","<p><b>X</b>: Nächste-X-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " },
1017{ "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" }, 1017{ "<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n","<p><b>1-0</b> (+<b>ctrl</b>): Selektiere Filter 1-10 (11-20)</p>\n" },
1018{ "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" }, 1018{ "<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n","<p><b>O</b>: Filter An/Aus | <b>J</b>: Journal Ansicht</p>\n" },
1019{ "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" }, 1019{ "<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" },
1020{ "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" }, 1020{ "<p><b>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" },
1021{ "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" }, 1021{ "<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n","<p><b>H</b>: Dieser Hilfe Dialog | <b>S</b>: Such Dialog</p>\n" },
1022{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, 1022{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" },
1023{ "After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" }, 1023{ "After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n","Nachdem etwas geändert wurde, werden die\nDaten automatisch in die Datei abgespeichert\n~/kdepim/apps/korganizer/mycalendar.ics\nnach (konfigurierbar) drei Minuten.\nAus Sicherheitsgründen wird noch einmal\nnach 10 Min. abgespeichert, wenn keine\nÄnderungen vorgenommen wurden. Die \nDaten werden automatisch gespeichert,\nwenn KO/Pi beendet wird.\nSie können eine Backup-Datei erstellen im\nMenu: Datei - Speichere Kalender Backup\n" },
1024{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, 1024{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" },
1025{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, 1025{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" },
1026{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, 1026{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" },
1027{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, 1027{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" },
1028{ "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" }, 1028{ "2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n","2) Ein Audio Alarm Daemon\nfür den Zaurus ist verfügbar\nals zusätzliche Anwendung\n" },
1029{ "1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" }, 1029{ "1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n","1) Importieren von *.vcs oder *.ics Dateien von\nanderen Anwendungen kann möglicherweise\n nicht richtig funktionieren,\nwenn die Termine Eigenschaften haben,\ndie KO/Pi nicht unterstützt.\n" },
1030{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, 1030{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" },
1031{ "KO/Pi FAQ","KO/Pi FAQ" }, 1031{ "KO/Pi FAQ","KO/Pi FAQ" },
1032{ "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, 1032{ "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" },
1033{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, 1033{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" },
1034{ "About KOrganizer/Pi","Über KOrganizer/Pi" }, 1034{ "About KOrganizer/Pi","Über KOrganizer/Pi" },
1035{ "From: ","Von: " }, 1035{ "From: ","Von: " },
1036{ "Remove sync info","Entferne Sync Info" }, 1036{ "Remove sync info","Entferne Sync Info" },
1037{ "For all profiles","Für alle Profile" }, 1037{ "For all profiles","Für alle Profile" },
1038{ "Hide not Running","Verstecke nicht Laufende" }, 1038{ "Hide not Running","Verstecke nicht Laufende" },
1039{ "ME","ME" }, 1039{ "ME","ME" },
1040{ "Toolbar","Toolbar" }, 1040{ "Toolbar","Toolbar" },
1041{ "Undo Delete...","UNDO Löschen..." }, 1041{ "Undo Delete...","UNDO Löschen..." },
1042{ "Undo Delete","Löschen rückgängig machen" }, 1042{ "Undo Delete","Löschen rückgängig machen" },
1043{ "KDE Sync HowTo...","KDE Sync HowTo..." }, 1043{ "KDE Sync HowTo...","KDE Sync HowTo..." },
1044{ "Multi Sync HowTo...","Multi Sync HowTo..." }, 1044{ "Multi Sync HowTo...","Multi Sync HowTo..." },
1045{ "Januar","Januar" }, 1045{ "Januar","Januar" },
1046{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, 1046{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" },
1047{ "No Filter","Kein Filter" }, 1047{ "No Filter","Kein Filter" },
1048{ "Multiple Sync options","Multi Sync Optionen" }, 1048{ "Multiple Sync options","Multi Sync Optionen" },
1049{ "Sync algo options","Sync Ablauf Optionen" }, 1049{ "Sync algo options","Sync Ablauf Optionen" },
1050{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, 1050{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
1051{ "Incoming calendar filter:","Eingehender Kalender Filter:" }, 1051{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
1052{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, 1052{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" },
1053{ "Write back options","Optionen zum Zurückschreiben" }, 1053{ "Write back options","Optionen zum Zurückschreiben" },
1054{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, 1054{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" },
1055{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, 1055{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" },
1056{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, 1056{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" },
1057{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, 1057{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" },
1058{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, 1058{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" },
1059{ "Time period","Zeitspanne" }, 1059{ "Time period","Zeitspanne" },
1060{ "From ","Von " }, 1060{ "From ","Von " },
1061{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, 1061{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " },
1062{ " weeks in the future "," Wochen in der Zukunft " }, 1062{ " weeks in the future "," Wochen in der Zukunft " },
1063{ "Profile kind specific settings","Profil Art abhängige Einstellungen" }, 1063{ "Profile kind specific settings","Profil Art abhängige Einstellungen" },
1064{ "Local temp file:","Lokale temp Datei:" }, 1064{ "Local temp file:","Lokale temp Datei:" },
1065{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, 1065{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" },
1066{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, 1066{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" },
1067{ "Language","Sprache" }, 1067{ "Language","Sprache" },
1068{ "Time Format","Zeit Format" }, 1068{ "Time Format","Zeit Format" },
1069{ "Time Zone","Zeit Zone" }, 1069{ "Time Zone","Zeit Zone" },
1070{ "%1 groups subscribed","%1 Guppen abboniert" }, 1070{ "%1 groups subscribed","%1 Guppen abboniert" },
1071{ "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" }, 1071{ "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" },
1072{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, 1072{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
1073{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, 1073{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
1074{ "Save settings","Speichere Einstellungen" }, 1074{ "Save settings","Speichere Einstellungen" },
1075{ "Save standard","Speichere Standard" }, 1075{ "Save standard","Speichere Standard" },
1076{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, 1076{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
1077{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, 1077{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
1078{ "Data storage path","Daten Speicherpfad" }, 1078{ "Data storage path","Daten Speicherpfad" },
1079{ "Language","Sprache" }, 1079{ "Language","Sprache" },
1080{ "Show time in agenda items","Zeige Zeit in Agenda Items" }, 1080{ "Show time in agenda items","Zeige Zeit in Agenda Items" },
1081{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, 1081{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" },
1082{ "Show events that are done","Zeige abgelaufene Termine" }, 1082{ "Show events that are done","Zeige abgelaufene Termine" },
1083{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, 1083{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" },
1084{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, 1084{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" },
1085{ "KO/Pi","KO/Pi" }, 1085{ "KO/Pi","KO/Pi" },
1086{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, 1086{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" },
1087{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, 1087{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." },
1088{ "Sound.Al.: ","Sound.Al.: " }, 1088{ "Sound.Al.: ","Sound.Al.: " },
1089{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, 1089{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" },
1090{ "Restore","Wiederherstellen" }, 1090{ "Restore","Wiederherstellen" },
1091{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" }, 1091{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" },
1092{ "% completed","% erledigt" }, 1092{ "% completed","% erledigt" },
1093{ "%d item(s) found.","%d Item(s) gefunden." }, 1093{ "%d item(s) found.","%d Item(s) gefunden." },
1094{ "Set complete","Setze auf erledigt" }, 1094{ "Set complete","Setze auf erledigt" },
1095{ "(cancelled)","(gecancelt)" }, 1095{ "(cancelled)","(gecancelt)" },
1096{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, 1096{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" },
1097{ " Local time "," Lokale Zeit " }, 1097{ " Local time "," Lokale Zeit " },
1098{ "Form2","Form2" }, 1098{ "Form2","Form2" },
1099{ "Filter enabled","Filter angeschaltet" }, 1099{ "Filter enabled","Filter angeschaltet" },
1100{ "Edit Filters","Ändere Filter" }, 1100{ "Edit Filters","Ändere Filter" },
1101{ "Print What's Next View...","Drucke What's Next Ansicht..." }, 1101{ "Print What's Next View...","Drucke What's Next Ansicht..." },
1102{ "Agenda","Agenda" }, 1102{ "Agenda","Agenda" },
1103{ " ("," (" }, 1103{ " ("," (" },
1104{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, 1104{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" },
1105{ "Print","Print" }, 1105{ "Print","Print" },
1106{ "&Setup Printer...","Drucker &Setup..." }, 1106{ "&Setup Printer...","Drucker &Setup..." },
1107{ "View Type","Zeige Typ" }, 1107{ "View Type","Zeige Typ" },
1108{ "Page &orientation:","Seiten Ausrichtung:" }, 1108{ "Page &orientation:","Seiten Ausrichtung:" },
1109{ "Use Default of Selected Style","Default des selektierten Stils" }, 1109{ "Use Default of Selected Style","Default des selektierten Stils" },
1110{ "Use Default Setting of Printer","Default Einstellung des Druckers" }, 1110{ "Use Default Setting of Printer","Default Einstellung des Druckers" },
1111{ "Portrait","Portrait" }, 1111{ "Portrait","Portrait" },
1112{ "Landscape","Landschaft" }, 1112{ "Landscape","Landschaft" },
1113{ "Print day","Drucke Tag" }, 1113{ "Print day","Drucke Tag" },
1114{ "CalPrintDay_Base","CalPrintDay_Base" }, 1114{ "CalPrintDay_Base","CalPrintDay_Base" },
1115{ "Date && Time Range","Datum && Zeitspanne" }, 1115{ "Date && Time Range","Datum && Zeitspanne" },
1116{ "&End date:","&Enddatum:" }, 1116{ "&End date:","&Enddatum:" },
1117{ "&Start date:","&Startdatum:" }, 1117{ "&Start date:","&Startdatum:" },
1118{ "Start &time:","Startzeit:" }, 1118{ "Start &time:","Startzeit:" },
1119{ "End ti&me:","Endzeit:" }, 1119{ "End ti&me:","Endzeit:" },
1120{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, 1120{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" },
1121{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, 1121{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" },
1122{ "Alt+D","Alt+D" }, 1122{ "Alt+D","Alt+D" },
1123{ "&Use colors","Nutze Farben" }, 1123{ "&Use colors","Nutze Farben" },
1124{ "Alt+U","Alt+U" }, 1124{ "Alt+U","Alt+U" },
1125{ "Print week","Drucke Woche" }, 1125{ "Print week","Drucke Woche" },
1126{ "CalPrintWeek_Base","CalPrintWeek_Base" }, 1126{ "CalPrintWeek_Base","CalPrintWeek_Base" },
1127{ "Use &colors","Nutze Farben" }, 1127{ "Use &colors","Nutze Farben" },
1128{ "Type of View","Typ der Ansicht" }, 1128{ "Type of View","Typ der Ansicht" },
1129{ "Print as &Filofax page","Drucke als &Filofax Seite" }, 1129{ "Print as &Filofax page","Drucke als &Filofax Seite" },
1130{ "Alt+F","Alt+F" }, 1130{ "Alt+F","Alt+F" },
1131{ "Print as &timetable view:","Drucke als Zeittabelle:" }, 1131{ "Print as &timetable view:","Drucke als Zeittabelle:" },
1132{ "Alt+T","Alt+T" }, 1132{ "Alt+T","Alt+T" },
1133{ "Print as split week view","Drucke als gesplittete Wochenansicht" }, 1133{ "Print as split week view","Drucke als gesplittete Wochenansicht" },
1134{ "Print month","Drucke Monat" }, 1134{ "Print month","Drucke Monat" },
1135{ "CalPrintMonth_Base","CalPrintMonth_Base" }, 1135{ "CalPrintMonth_Base","CalPrintMonth_Base" },
1136{ "&Start month:","&Startmonat:" }, 1136{ "&Start month:","&Startmonat:" },
1137{ "&End month:","&Endmonat:" }, 1137{ "&End month:","&Endmonat:" },
1138{ "Print week &numbers","Drucke Wochen Nummer(n)" }, 1138{ "Print week &numbers","Drucke Wochen Nummer(n)" },
1139{ "Print todos","Drucke Todos" }, 1139{ "Print todos","Drucke Todos" },
1140{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, 1140{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" },
1141{ "Include &description of the item","Inclusive Itembeschreibung" }, 1141{ "Include &description of the item","Inclusive Itembeschreibung" },
1142{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, 1142{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" },
1143{ "Include &priority of the item","Inclusive Priorität des Items" }, 1143{ "Include &priority of the item","Inclusive Priorität des Items" },
1144{ "Items to Print","Zu druckende Items" }, 1144{ "Items to Print","Zu druckende Items" },
1145{ "&From:","Von:" }, 1145{ "&From:","Von:" },
1146{ "&To:","Bis:" }, 1146{ "&To:","Bis:" },
1147{ "Print &all todo items","Drucke alle Todo Items" }, 1147{ "Print &all todo items","Drucke alle Todo Items" },
1148{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, 1148{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" },
1149{ "Only items due in the &range:","Nur Items in dem Zeitraum:" }, 1149{ "Only items due in the &range:","Nur Items in dem Zeitraum:" },
1150{ "Todo List","Todo Liste" }, 1150{ "Todo List","Todo Liste" },
1151{ "&Title:","&Titel:" }, 1151{ "&Title:","&Titel:" },
1152{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, 1152{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" },
1153{ "Todo list","Todo Liste" }, 1153{ "Todo list","Todo Liste" },
1154{ "&Print...","Drucke..." }, 1154{ "&Print...","Drucke..." },
1155{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, 1155{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" },
1156{ "[Unconfigured]","[Unkonfiguriert]" }, 1156{ "[Unconfigured]","[Unkonfiguriert]" },
1157{ "OK","OK" }, 1157{ "OK","OK" },
1158{ "FilterEditor","FilterEditor" }, 1158{ "FilterEditor","FilterEditor" },
1159{ "Include","Inclusive" }, 1159{ "Include","Inclusive" },
1160{ "Exclude","Exclusive" }, 1160{ "Exclude","Exclusive" },
1161{ "Edit Selection...","Editiere Auswahl" }, 1161{ "Edit Selection...","Editiere Auswahl" },
1162{ "recurring events","wiederholende Termine" }, 1162{ "recurring events","wiederholende Termine" },
1163{ "recurr. events","wiederh.Termine" }, 1163{ "recurr. events","wiederh.Termine" },
1164{ "completed to-dos","erledigte Todos" }, 1164{ "completed to-dos","erledigte Todos" },
1165{ "events","Termine" }, 1165{ "events","Termine" },
1166{ "todos","Todos" }, 1166{ "todos","Todos" },
1167{ "journals","Journale" }, 1167{ "journals","Journale" },
1168{ "public","öffentl." }, 1168{ "public","öffentl." },
1169{ "private","privat" }, 1169{ "private","privat" },
1170{ "confidential","vertraul." }, 1170{ "confidential","vertraul." },
1171{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, 1171{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" },
1172{ "Yesterday","Gestern" }, 1172{ "Yesterday","Gestern" },
1173{ "Day after tomorrow","Übermorgen" }, 1173{ "Day after tomorrow","Übermorgen" },
1174{ "Tomorrow","Morgen" }, 1174{ "Tomorrow","Morgen" },
1175{ "Day before yesterday","Vorgestern" }, 1175{ "Day before yesterday","Vorgestern" },
1176{ "Size %1","Größe %1" }, 1176{ "Size %1","Größe %1" },
1177{ "New Agendasize: %1","Neue Agendagröße: %1" }, 1177{ "New Agendasize: %1","Neue Agendagröße: %1" },
1178{ " (%1 y.)"," (%1 J.)" }, 1178{ " (%1 y.)"," (%1 J.)" },
1179{ "Allday:","Ganztägig:" }, 1179{ "Allday:","Ganztägig:" },
1180{ "compl.todos","erled.Todos" }, 1180{ "compl.todos","erled.Todos" },
1181{ "Day view","Tagesansicht" }, 1181{ "Day view","Tagesansicht" },
1182{ "Next days","Nächste Tage" }, 1182{ "Next days","Nächste Tage" },
1183{ "Next week","Nächste Woche" }, 1183{ "Next week","Nächste Woche" },
1184{ "Next two weeks","Nächste zwei Wochen" }, 1184{ "Next two weeks","Nächste zwei Wochen" },
1185{ "This month","Dieser Monat" }, 1185{ "This month","Dieser Monat" },
1186{ "Journal view","Journal" }, 1186{ "Journal view","Journal" },
1187{ "Display all opened","Zeige alle geöffnet" }, 1187{ "Display all opened","Zeige alle geöffnet" },
1188{ "Display all closed","Zeige alle geschlossen" }, 1188{ "Display all closed","Zeige alle geschlossen" },
1189{ "Display all flat","Zeige alle flach" }, 1189{ "Display all flat","Zeige alle flach" },
1190{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, 1190{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
1191{ "Default todo done color:","Standard Todo erledigt Farbe" }, 1191{ "Default todo done color:","Standard Todo erledigt Farbe" },
1192{ "Select week %1-%2","Wähle Woche %1-%2" }, 1192{ "Select week %1-%2","Wähle Woche %1-%2" },
1193{ "Select Week","Wähle Woche" }, 1193{ "Select Week","Wähle Woche" },
1194{ "Set alarm...","Setze Alarm..." }, 1194{ "Set alarm...","Setze Alarm..." },
1195{ "Set Alarm!","Setze Alarm!" }, 1195{ "Set Alarm!","Setze Alarm!" },
1196{ "Changed alarm for %1 items","Alarm für %1 Items geändert" }, 1196{ "Changed alarm for %1 items","Alarm für %1 Items geändert" },
1197{ " and "," und " }, 1197{ " and "," und " },
1198{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, 1198{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
1199{ "Mail to selected","Mail an Ausgewählte" }, 1199{ "Mail to selected","Mail an Ausgewählte" },
1200{ "Mail to all","Mail an Alle" }, 1200{ "Mail to all","Mail an Alle" },
1201{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, 1201{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" },
1202{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, 1202{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" },
1203{ " on"," am" }, 1203{ " on"," am" },
1204{ " completed on "," erledigt am " }, 1204{ " completed on "," erledigt am " },
1205{ "Save as Event template","Speichere als Vorlage" }, 1205{ "Save as Event template","Speichere als Vorlage" },
1206{ "Load Event template","Lade Termin Vorlage" }, 1206{ "Load Event template","Lade Termin Vorlage" },
1207{ "Save as Journal template","Speichere als Journal Vorlage" }, 1207{ "Save as Journal template","Speichere als Journal Vorlage" },
1208{ "Insert Journal template","Füge Journal Vorlage ein" }, 1208{ "Insert Journal template","Füge Journal Vorlage ein" },
1209{ "Sub todos:<br>","Unter-Todos:<br>" }, 1209{ "Sub todos:<br>","Unter-Todos:<br>" },
1210{ "Parent todo:<br>","Über-Todo:<br>" }, 1210{ "Parent todo:<br>","Über-Todo:<br>" },
1211{ "Set current as color category","Setze Gewählte als Farbkategorie" }, 1211{ "Set current as color category","Setze Gewählte als Farbkategorie" },
1212{ " completed"," erledigt" }, 1212{ " completed"," erledigt" },
1213{ "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" }, 1213{ "(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!","(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi basiert auf KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) und das KDE Team.\nKOrganizer/Pi ist lizensiert unter der GPL.\nKO/Pi kann kompiliert werden für\nLinux, Zaurus-PDA und Windows\nwww.pi-sync.info --- www.korganizer.org\nBesonderen Dank an Michael und Ben\nfür intensives Testen!" },
1214{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 1214{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
1215{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 1215{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
1216{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 1216{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
1217{ "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?" }, 1217{ "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?" },
1218{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 1218{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
1219{ "Error","Fehler" }, 1219{ "Error","Fehler" },
1220{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 1220{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
1221{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 1221{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
1222{ "Warning","Warnung" }, 1222{ "Warning","Warnung" },
1223{ "Select week number","Wähle Wochen Nummer" }, 1223{ "Select week number","Wähle Wochen Nummer" },
1224{ "Februar","Februar" }, 1224{ "Februar","Februar" },
1225{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, 1225{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" },
1226{ "W","W" }, 1226{ "W","W" },
1227{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, 1227{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" },
1228{ "T: %1","T: %1" }, 1228{ "T: %1","T: %1" },
1229{ "Start: ","Start: " }, 1229{ "Start: ","Start: " },
1230{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 1230{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
1231{ "Password for remote access:","Passwort für fernen Zugriff:" }, 1231{ "Password for remote access:","Passwort für fernen Zugriff:" },
1232{ "Remote IP address:","Ferne IP Adresse:" }, 1232{ "Remote IP address:","Ferne IP Adresse:" },
1233{ "Remote port number:","Ferne Port Nummer:" }, 1233{ "Remote port number:","Ferne Port Nummer:" },
1234{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 1234{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
1235{ "Remote from: ","Fern von: " }, 1235{ "Remote from: ","Fern von: " },
1236{ "Local from: ","Lokal von: " }, 1236{ "Local from: ","Lokal von: " },
1237{ "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" }, 1237{ "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" },
1238{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 1238{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
1239{ "Write back","Schreibe zurück" }, 1239{ "Write back","Schreibe zurück" },
1240{ "KO/Pi Synchronization","KO/Pi Synchronisation" }, 1240{ "KO/Pi Synchronization","KO/Pi Synchronisation" },
1241{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 1241{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
1242{ "Received sync request","Sync Anfrage erhalten" }, 1242{ "Received sync request","Sync Anfrage erhalten" },
1243{ "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." }, 1243{ "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." },
1244{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1244{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1245{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1245{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1246{ "Sending file...","Sende Datei..." }, 1246{ "Sending file...","Sende Datei..." },
1247{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1247{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1248{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1248{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1249{ "Received %1 bytes","%1 Bytes erhalten" }, 1249{ "Received %1 bytes","%1 Bytes erhalten" },
1250{ "Writing file to disk...","Speichere Datei..." }, 1250{ "Writing file to disk...","Speichere Datei..." },
1251{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1251{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1252{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1252{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1253{ "Synchronize!","Synchronisiere!" }, 1253{ "Synchronize!","Synchronisiere!" },
1254{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1254{ "High clock skew!","Großer Uhrzeitunterschied!" },
1255{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1255{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1256{ "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!" }, 1256{ "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!" },
1257{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1257{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1258{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1258{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1259{ "List week view","Listenwochenansicht" }, 1259{ "List week view","Listenwochenansicht" },
1260{ "List week","Listenwochenansicht" }, 1260{ "List week","Listenwochenansicht" },
1261{ "Next Week","Nächste Woche" }, 1261{ "Next Week","Nächste Woche" },
1262{ "Previous Week","Vorherige Woche" }, 1262{ "Previous Week","Vorherige Woche" },
1263{ "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." }, 1263{ "No items were found matching\nyour search expression.\nUse the wildcard characters\n'*' and '?' where needed.","Keine Einträge gefunden die\ndem Suchausdruck entsprechen.\nBenutze Platzhalter Zeichen\n'*' und '?' wo benötigt." },
1264{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1264{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1265{ "Details","Details" }, 1265{ "Details","Details" },
1266{ "Created time","Erstellt Zeit" }, 1266{ "Created time","Erstellt Zeit" },
1267{ "Last modified time","Geändert Zeit" }, 1267{ "Last modified time","Geändert Zeit" },
1268{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1268{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1269{ "View Options","Anzeige Optionen" }, 1269{ "View Options","Anzeige Optionen" },
1270{ "<b>Created: ","<b>Erstellt am: " }, 1270{ "<b>Created: ","<b>Erstellt am: " },
1271{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1271{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1272{ "Journal: ","Journal: " }, 1272{ "Journal: ","Journal: " },
1273{ "yearly","jährlich" }, 1273{ "yearly","jährlich" },
1274{ "(%1) ","%1-" }, 1274{ "(%1) ","%1-" },
1275{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1275{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1276{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1276{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1277{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1277{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1278{ "Summary/Loc.","Titel/Ort" }, 1278{ "Summary/Loc.","Titel/Ort" },
1279{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1279{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1280{ "Week Number","Wochennummer" }, 1280{ "Week Number","Wochennummer" },
1281{ "Import","Importiere" }, 1281{ "Import","Importiere" },
1282{ "Export","Exportiere" }, 1282{ "Export","Exportiere" },
1283{ "Beam","Beame" }, 1283{ "Beam","Beame" },
1284{ "Export","Exportiere" }, 1284{ "Export","Exportiere" },
1285{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1285{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1286{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1286{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1287{ "Journal/Details...","Journale/Details..." }, 1287{ "Journal/Details...","Journale/Details..." },
1288{ "Agenda View","Agenda Ansicht" }, 1288{ "Agenda View","Agenda Ansicht" },
1289{ "Show current time","Zeige aktuelle Zeit" }, 1289{ "Show current time","Zeige aktuelle Zeit" },
1290{ "Edit new item","Bearbeite neuen Eintrag" }, 1290{ "Edit new item","Bearbeite neuen Eintrag" },
1291{ "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" }, 1291{ "Please select at least one\nof the types to search for:\n\nEvents\nTodos\nJournals","Bitte wählen Sie mindestens\neinen dieser Typen\num darin zu suchen:\n\nTermine\nTodos\nJournale" },
1292{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, 1292{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1293{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, 1293{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1294{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, 1294{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" },
1295{ "%1 days\n","%1 Tagen\n" }, 1295{ "%1 days\n","%1 Tagen\n" },
1296{ "1 day\n","1 Tag\n" }, 1296{ "1 day\n","1 Tag\n" },
1297{ "%1 hours\n","%1 Stunden\n" }, 1297{ "%1 hours\n","%1 Stunden\n" },
1298{ "1 hour\n","1 Stunde\n" }, 1298{ "1 hour\n","1 Stunde\n" },
1299{ "%1 minutes\n","%1 Minuten\n" }, 1299{ "%1 minutes\n","%1 Minuten\n" },
1300{ "1 minute\n","1 Minute\n" }, 1300{ "1 minute\n","1 Minute\n" },
1301{ "Only one toolbar","Nur eine Toolbar" }, 1301{ "Only one toolbar","Nur eine Toolbar" },
1302{ "Print","Drucke" }, 1302{ "Print","Drucke" },
1303{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, 1303{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
1304{ "There is nothing selected!","Es ist nichts ausgewählt!" }, 1304{ "There is nothing selected!","Es ist nichts ausgewählt!" },
1305{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, 1305{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
1306{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, 1306{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
1307{ "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, 1307{ "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" },
1308{ "KO/Pi Printout","KO/Pi Ausdruck" }, 1308{ "KO/Pi Printout","KO/Pi Ausdruck" },
1309{ "Print unscaled","Drucke unskaliert" }, 1309{ "Print unscaled","Drucke unskaliert" },
1310{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, 1310{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." },
1311{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, 1311{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." },
1312{ "Printout Mode","Druck Modus" }, 1312{ "Printout Mode","Druck Modus" },
1313{ "Filter menu icon","Filtermenu Icon" }, 1313{ "Filter menu icon","Filtermenu Icon" },
1314{ "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, 1314{ "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" },
1315{ "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, 1315{ "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" },
1316{ "%1d","%1t" }, 1316{ "%1d","%1t" },
1317{ "%1h","%1std" }, 1317{ "%1h","%1std" },
1318{ "%1min","%1min" }, 1318{ "%1min","%1min" },
1319{ "( %1 before )","( %1 vorher )" }, 1319{ "( %1 before )","( %1 vorher )" },
1320{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, 1320{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" },
1321{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, 1321{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" },
1322{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, 1322{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." },
1323{ "Show Sync Events","Zeige Sync-Ereignisse" }, 1323{ "Show Sync Events","Zeige Sync-Ereignisse" },
1324{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, 1324{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" },
1325{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, 1325{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" },
1326{ " on "," am " }, 1326{ " on "," am " },
1327{ "On: ","Am: " }, 1327{ "On: ","Am: " },
1328{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, 1328{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" },
1329{ "Start/Stop todo...","Starte/Stoppe Todo..." }, 1329{ "Start/Stop todo...","Starte/Stoppe Todo..." },
1330{ "Color for running todos:","Farbe für laufende Todos:" }, 1330{ "Color for running todos:","Farbe für laufende Todos:" },
1331{ "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, 1331{ "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" },
1332{ "Todo is started","Todo ist gestartet" }, 1332{ "Todo is started","Todo ist gestartet" },
1333{ "Stop todo","Stoppe Todo" }, 1333{ "Stop todo","Stoppe Todo" },
1334{ "Todo is stopped","Todo ist gestoppt" }, 1334{ "Todo is stopped","Todo ist gestoppt" },
1335{ "Start todo","Starte Todo" }, 1335{ "Start todo","Starte Todo" },
1336{ "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, 1336{ "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" },
1337{ "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, 1337{ "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" },
1338{ "Todo has subtodos","Todo hat Untertodos" }, 1338{ "Todo has subtodos","Todo hat Untertodos" },
1339{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, 1339{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" },
1340{ "Colors","Farben" }, 1340{ "Colors","Farben" },
1341{ "Click on new parent item","Klicke auf neues Übertodo" }, 1341{ "Click on new parent item","Klicke auf neues Übertodo" },
1342{ "Reparenting aborted!","Übertodo setzen abgebrochen" }, 1342{ "Reparenting aborted!","Übertodo setzen abgebrochen" },
1343{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, 1343{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" },
1344{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, 1344{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" },
1345{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, 1345{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
1346{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, 1346{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
1347{ "times","Zeiten" }, 1347{ "times","Zeiten" },
1348{ "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, 1348{ "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" },
1349{ "Backup enabled","Backup angeschaltet" }, 1349{ "Backup enabled","Backup angeschaltet" },
1350{ "Use standard backup dir","Standard Backupverzeichnis" }, 1350{ "Use standard backup dir","Standard Backupverzeichnis" },
1351{ "Number of Backups:","Anzahl der Backups" }, 1351{ "Number of Backups:","Anzahl der Backups" },
1352{ "Make backup every ","Mache ein Backup alle " }, 1352{ "Make backup every ","Mache ein Backup alle " },
1353{ " days"," Tage" }, 1353{ " days"," Tage" },
1354{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, 1354{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." },
1355{ "Backup Failed!","Backup Problem!" }, 1355{ "Backup Failed!","Backup Problem!" },
1356{ "Try again now","Versuche jetzt nochmal" }, 1356{ "Try again now","Versuche jetzt nochmal" },
1357{ "Try again later","Versuche später nochmal" }, 1357{ "Try again later","Versuche später nochmal" },
1358{ "Try again tomorrow","Versuche morgen nochmal" }, 1358{ "Try again tomorrow","Versuche morgen nochmal" },
1359{ "Disable backup","Schalte Backup ab" }, 1359{ "Disable backup","Schalte Backup ab" },
1360{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, 1360{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
1361{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, 1361{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
1362{ "Choose action","Wähle Aktion" }, 1362{ "Choose action","Wähle Aktion" },
1363{ "Comment for todo:","Kommentar zum Todo:" }, 1363{ "Comment for todo:","Kommentar zum Todo:" },
1364{ "Stop+note","Stop+Notiz" }, 1364{ "Stop+note","Stop+Notiz" },
1365{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, 1365{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" },
1366{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, 1366{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" },
1367{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, 1367{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" },
1368{ "Print complete list...","Drucke komplette Liste..." }, 1368{ "Print complete list...","Drucke komplette Liste..." },
1369{ "Hide all selected","Verstecke Ausgewählte" }, 1369{ "Hide all selected","Verstecke Ausgewählte" },
1370{ "Add items","hinzufügen" }, 1370{ "Add items","hinzufügen" },
1371{ "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, 1371{ "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" },
1372{ "Print List View...","Drucke Listenansicht..." }, 1372{ "Print List View...","Drucke Listenansicht..." },
1373{ "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, 1373{ "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." },
1374{ "Configure KO/Pi...","Konfiguriere KO/Pi..." }, 1374{ "Configure KO/Pi...","Konfiguriere KO/Pi..." },
1375{ "Global Settings...","Globale Einstellungen..." }, 1375{ "Global Settings...","Globale Einstellungen..." },
1376{ "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, 1376{ "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" },
1377{ "(disabled)","(abgeschaltet)" }, 1377{ "(disabled)","(abgeschaltet)" },
1378{ "New Calendar","Neuer Kalender" }, 1378{ "New Calendar","Neuer Kalender" },
1379{ "Calendar","Kalender" }, 1379{ "Calendar","Kalender" },
1380{ "Filter selector","Filterauswahl" }, 1380{ "Filter selector","Filterauswahl" },
1381{ "Filtermenu","Filtermenu" }, 1381{ "Filtermenu","Filtermenu" },
1382{ "Toggle Fullscreen","Vollbild umschalten" }, 1382{ "Toggle Fullscreen","Vollbild umschalten" },
1383{ "Toggle Resource View","Resourcenansicht umschalten" }, 1383{ "Toggle Resource View","Resourcenansicht umschalten" },
1384{ "Storage HowTo...","Speicherort HowTo..." }, 1384{ "Storage HowTo...","Speicherort HowTo..." },
1385{ "Timetracking HowTo...","Timetracking HowTo..." }, 1385{ "Timetracking HowTo...","Timetracking HowTo..." },
1386{ "Juni","Juni" }, 1386{ "Juni","Juni" },
1387{ "Juli","Juli" }, 1387{ "Juli","Juli" },
1388{ "ToDo:","ToDo:" }, 1388{ "ToDo:","ToDo:" },
1389{ "Set Calendar","Setze Kalender" }, 1389{ "Set Calendar","Setze Kalender" },
1390{ "Todo: %1","Todo: %1" }, 1390{ "Todo: %1","Todo: %1" },
1391{ ": (Prio ",": (Prio " }, 1391{ ": (Prio ",": (Prio " },
1392{ "Todos","Todos" }, 1392{ "Todos","Todos" },
1393{ "Todo Viewer","Todo Anzeige" }, 1393{ "Todo Viewer","Todo Anzeige" },
1394{ "Todo ","Todo " }, 1394{ "Todo ","Todo " },
1395{ " Calendar \n Resource "," Kalender \n Resource " }, 1395{ " Calendar \n Resource "," Kalender \n Resource " },
1396{ " Color "," Farbe " }, 1396{ " Color "," Farbe " },
1397{ "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, 1397{ "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" },
1398{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, 1398{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" },
1399{ "Add new Calendar","Füge Kalender hinzu" }, 1399{ "Add new Calendar","Füge Kalender hinzu" },
1400{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, 1400{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" },
1401{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, 1401{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" },
1402{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, 1402{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" },
1403{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, 1403{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." },
1404{ "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" }, 1404{ "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" },
1405{ "Global application font for all apps:","Globale Schriftart:" }, 1405{ "Global application font for all apps:","Globale Schriftart:" },
1406{ "Application Font","Applikationsschriftart" }, 1406{ "Application Font","Applikationsschriftart" },
1407{ "Kx/Pi","Kx/Pi" }, 1407{ "Kx/Pi","Kx/Pi" },
1408{ "Backup","Backup" }, 1408{ "Backup","Backup" },
1409{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, 1409{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" },
1410{ "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" }, 1410{ "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" },
1411{ "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" }, 1411{ "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" },
1412{ "Choose Color","Wähle Farbe" }, 1412{ "Choose Color","Wähle Farbe" },
1413{ " OK "," OK " }, 1413{ " OK "," OK " },
1414{ " Cancel "," Abbrechen " }, 1414{ " Cancel "," Abbrechen " },
1415{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, 1415{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" },
1416{ "Matching items will be removed from list","Passende werden von der Liste entfernt" }, 1416{ "Matching items will be removed from list","Passende werden von der Liste entfernt" },
1417{ "Search on displayed list only","Suche auf der dargestellten Liste" }, 1417{ "Search on displayed list only","Suche auf der dargestellten Liste" },
1418{ "List will be cleared before search","Liste wird vor der Suche gelöscht" }, 1418{ "List will be cleared before search","Liste wird vor der Suche gelöscht" },
1419{ "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" }, 1419{ "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" },
1420{ "%1\nis running!","%1\nist am Laufen!" }, 1420{ "%1\nis running!","%1\nist am Laufen!" },
1421{ "Additional Comment:","Zusätzlicher Kommentar:" }, 1421{ "Additional Comment:","Zusätzlicher Kommentar:" },
1422{ "Stop and save","Stopp und Speichern" }, 1422{ "Stop and save","Stopp und Speichern" },
1423{ "Continue running","Weiter laufen lassen" }, 1423{ "Continue running","Weiter laufen lassen" },
1424{ "Stop - do not save","Stopp - nicht Speichern" }, 1424{ "Stop - do not save","Stopp - nicht Speichern" },
1425{ "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" }, 1425{ "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" },
1426{ "Time mismatch!","Zeiten stimmen nicht!" }, 1426{ "Time mismatch!","Zeiten stimmen nicht!" },
1427{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, 1427{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" },
1428{ "Yes, stop todo","Ja, stoppe Todo" }, 1428{ "Yes, stop todo","Ja, stoppe Todo" },
1429{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, 1429{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" },
1430{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, 1430{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" },
1431{ "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." }, 1431{ "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." },
1432{ "Spouse","Ehegatte" }, 1432{ "Spouse","Ehegatte" },
1433{ "Notes","Notizen" }, 1433{ "Notes","Notizen" },
1434{ "Messanger","Messanger" }, 1434{ "Messanger","Messanger" },
1435{ "Assistant","Assistent" }, 1435{ "Assistant","Assistent" },
1436{ "Manager","Manager" }, 1436{ "Manager","Manager" },
1437{ "Secrecy","Sichtbar" }, 1437{ "Secrecy","Sichtbar" },
1438{ "male","männlich" }, 1438{ "male","männlich" },
1439{ "female","weiblich" }, 1439{ "female","weiblich" },
1440{ "Hide!","Verbergen!" }, 1440{ "Hide!","Verbergen!" },
1441{ "Show!","Anzeigen!" }, 1441{ "Show!","Anzeigen!" },
1442{ "Details","Details" }, 1442{ "Details","Details" },
1443{ "Profession","Beruf" }, 1443{ "Profession","Beruf" },
1444{ "Children","Kinder" }, 1444{ "Children","Kinder" },
1445{ "Department","Abteilung" }, 1445{ "Department","Abteilung" },
1446{ "Backup cancelled","Backup abgebrochen" }, 1446{ "Backup cancelled","Backup abgebrochen" },
1447{ "Backup globally disabled","Backup global abgeschaltet" }, 1447{ "Backup globally disabled","Backup global abgeschaltet" },
1448{ "Backup succesfully finished","Backup erfolgreich beendet" }, 1448{ "Backup succesfully finished","Backup erfolgreich beendet" },
1449{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, 1449{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" },
1450{ "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, 1450{ "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" },
1451{ "Birthdays","Geburtstage" }, 1451{ "Birthdays","Geburtstage" },
1452{ "KO/Pi import information!","KO/Pi Import Information!" }, 1452{ "KO/Pi import information!","KO/Pi Import Information!" },
1453{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, 1453{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" },
1454{ "Cancel - do not start"," Abbrechen - Todo nicht starten" }, 1454{ "Cancel - do not start"," Abbrechen - Todo nicht starten" },
1455{ "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, 1455{ "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" },
1456{ "Reload","Neu laden" }, 1456{ "Reload","Neu laden" },
1457{ "Timezone settings","Zeitzoneneinstellung" }, 1457{ "Timezone settings","Zeitzoneneinstellung" },
1458{ "Title: ","Titel: " }, 1458{ "Title: ","Titel: " },
1459{ "Journal from: ","Journal vom: " }, 1459{ "Journal from: ","Journal vom: " },
1460{ "Journal: %1 from ","Journal: %1 vom " }, 1460{ "Journal: %1 from ","Journal: %1 vom " },
1461{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, 1461{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" },
1462{ "Selected Item","Ausgewähltes Item" }, 1462{ "Selected Item","Ausgewähltes Item" },
1463{ "Select Date...","Wähle Datum..." }, 1463{ "Select Date...","Wähle Datum..." },
1464{ "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, 1464{ "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" },
1465{ "Change category list now!","Ändere Kategorieliste jetzt!" }, 1465{ "Change category list now!","Ändere Kategorieliste jetzt!" },
1466{ "Edit category list...","Ändere Kategorieliste..." }, 1466{ "Edit category list...","Ändere Kategorieliste..." },
1467{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, 1467{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" },
1468{ "Filepath: ","Dateipfad: " }, 1468{ "Filepath: ","Dateipfad: " },
1469{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, 1469{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" },
1470{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, 1470{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" },
1471{ "Pending Suspend Alarm","Laufender Suspend Alarm" }, 1471{ "Pending Suspend Alarm","Laufender Suspend Alarm" },
1472{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, 1472{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" },
1473{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, 1473{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" },
1474{ "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, 1474{ "Loading of calendar(s) failed","Laden von Kalendern fehlgeschlagen" },
1475{ "Alarm Options","Alarm Einstellungen" }, 1475{ "Alarm Options","Alarm Einstellungen" },
1476{ "Delete selected...","Lösche Ausgewählte..." }, 1476{ "Delete selected...","Lösche Ausgewählte..." },
1477{ "None","Nichts" }, 1477{ "None","Nichts" },
1478{ "Selection","Auswahl" }, 1478{ "Selection","Auswahl" },
1479{ "Set categories","Setze Kategorien" }, 1479{ "Set categories","Setze Kategorien" },
1480{ "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, 1480{ "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" },
1481{ "Reset","Neu setzen" }, 1481{ "Reset","Neu setzen" },
1482{ "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, 1482{ "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" },
1483{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, 1483{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" },
1484{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, 1484{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" },
1485{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, 1485{ "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" },
1486{ "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, 1486{ "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" },
1487{ "Edit","Edit" }, 1487{ "Edit","Edit" },
1488{ "Last Modified","Zuletzt geändert" }, 1488{ "Last Modified","Zuletzt geändert" },
1489{ "Journal viewer","Journal Anzeige" }, 1489{ "Journal viewer","Journal Anzeige" },
1490{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, 1490{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." },
1491{ "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, 1491{ "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." },
1492{ "Hide Completed","Verstecke erledigte Todos" }, 1492{ "Hide Completed","Verstecke erledigte Todos" },
1493{ "Show not Running","Zeige nicht Laufende" }, 1493{ "Show not Running","Zeige nicht Laufende" },
1494{ "Click to add new Todo","Klick für neues Todo!" }, 1494{ "Click to add new Todo","Klick für neues Todo!" },
1495{ "Show next conflict for","Zeige nächsten Konflikt für" }, 1495{ "Show next conflict for","Zeige nächsten Konflikt für" },
1496{ "All events","Alle Termine" }, 1496{ "All events","Alle Termine" },
1497{ "Allday events","Ganztagestermine" }, 1497{ "Allday events","Ganztagestermine" },
1498{ "Events with time","Termine mit Zeit" }, 1498{ "Events with time","Termine mit Zeit" },
1499{ "No conflict found","Kein Konflikt gefunden" }, 1499{ "No conflict found","Kein Konflikt gefunden" },
1500{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, 1500{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" },
1501{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " }, 1501{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " },
1502{ "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, 1502{ "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" },
1503{ "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" }, 1503{ "The event\n%1\nconflicts with event\n%2\nat date\n%3.\n","Der Termin\n%1\nist im Konflikt mit Termin\n%2\nam Datum\n%3.\n" },
1504{ "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" }, 1504{ "KO/Pi Conflict detected","KO/Pi Konflikt erkannt" },
1505{ "Show date","Zeige Datum" }, 1505{ "Show date","Zeige Datum" },
1506{ "No problem!","Null Problemo!" }, 1506{ "No problem!","Null Problemo!" },
1507{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, 1507{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
1508{ "Pi-Sync Port Error","Pi-Sync Port Fehler" }, 1508{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
1509{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" }, 1509{ "<b>Enabling Pi-Sync failed!</b> Failed to bind or listen to the port %1! Is another instance already listening to that port?","<b>Anschalten von Pi-Sync fehlgeschlagen!</b> Fehler beim Ansprechen des Ports %1! Ist bereits eine andere Anwendung dabei diesen Port zu nutzen?" },
1510{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, 1510{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
1511{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, 1511{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
1512{ "Pi-Sync Error","Pi-Sync Fehler" }, 1512{ "Pi-Sync Error","Pi-Sync Fehler" },
1513{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, 1513{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
1514{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, 1514{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
1515{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, 1515{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
1516{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, 1516{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
1517{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, 1517{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
1518{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, 1518{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
1519{ "Receiving file from remote...","Empfange entfernte Datei..." }, 1519{ "Receiving file from remote...","Empfange entfernte Datei..." },
1520{ "Sending back synced file...","Sende synchronisierte Datei zurück..." }, 1520{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
1521{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" }, 1521{ "Do you want to\nclear all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
1522{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" }, 1522{ "Do you want to\nclear the sync\ninfo of profile\n%1?\n","Möchten Sie wirklich\ndie Sync-Info für Profil\n%1?\nlöschen" },
1523{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, 1523{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
1524{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, 1524{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
1525{ "Writing back file ...","Schreibe Datei zurück..." }, 1525{ "Writing back file ...","Schreibe Datei zurück..." },
1526{ "Sending back file ...","Sende Datei zurück..." }, 1526{ "Sending back file ...","Sende Datei zurück..." },
1527{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, 1527{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" },
1528{ "Created","Angelegt" }, 1528{ "Created","Angelegt" },
1529{ "Last Modified Sub","Zuletzt geändertes Sub" }, 1529{ "Last Modified Sub","Zuletzt geändertes Sub" },
1530{ "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" }, 1530{ "Checking conflicts ... please wait","Überprüfe Konflikte ... bitte warten" },
1531{ "Show times on two lines","Zeige Zeiten auf zwei Zeilen" }, 1531{ "Show times on two lines","Zeige Zeiten auf zwei Zeilen" },
1532{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" }, 1532{ "Save using LOCAL storage","Speichere nutze LOCAL Pfad" },
1533{ "Duration","Dauer" }, 1533{ "Duration","Dauer" },
1534{ " day"," Tag" }, 1534{ " day"," Tag" },
1535{ "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" }, 1535{ "Click this button to display all todos in a <b>flat</b> hierarchy","Klicke diesen Knopf um alle Todos in einer <b>flachen</b> Hierarchie darzustellen" },
1536{ "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" }, 1536{ "Click this button to display all todos <b>openend</b>","Klicke diesen Knopf um alle Todos <b>geöffnet</b> darzustellen" },
1537{ "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" }, 1537{ "Click this button to display all todos <b>closed</b>","Klicke diesen Knopf um alle Todos <b>geschlossen</b> darzustellen" },
1538{ "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" }, 1538{ "Click this button to toggle show/hide <b>running</b> todos","Klicke diesen Knopf um <b>zeige Laufende</b> umzuschalten" },
1539{ "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" }, 1539{ "Click this button to toggle show/hide <b>completed</b> todos","Klicke diesen Knopf um <b>zeige Erledigte</b> umzuschalten" },
1540{ "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" }, 1540{ "Click this button to add a new subtodo to the currently selected todo","Klicke diesen Knopf um ein Untertodo zu dem gerade selektierten Todo hinzuzufügen" },
1541{ "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." }, 1541{ "In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.","In dieser Spalte kann man einen <b>Kalender auf sichtbar schalten</b>. Wenn ein Kalender nicht sichtbar ist werden seine Einträge nicht in den Ansichten angezeigt. Man kann Einträge hinzufügen und laden/speichern wie gewöhnlich." },
1542{ "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." }, 1542{ "In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.","In dieser Spalte wird der <b>Name des Kalenders</b> angezeigt. Wenn Sie auf den Namen klicken wird Information über die Kalenderdatei angezeigt. Wenn die Datei beim Start nicht geladen wurde können Sie hier erneut versuchen sie zu laden." },
1543{ "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." }, 1543{ "In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as "do not use". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.","In dieser Spalte können die <b>Alarme eines Kalenders alle zusammen abgeschaltet werden</b>. Die Alarmdaten im Kalender selbst werden nicht verändert, es werde die Alarme intern als "nicht beachten" markiert. Nützlich wenn Sie den Kalender einer anderen Person laden aber nicht über dessen Alarme unterrichtet werden wollen." },
1544{ "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." }, 1544{ "In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.","In dieser Spalte können Sie einen <b>Kalender und alle Einträge auf schreibgeschützt setzen</b>. Einträge eines schreibgeschützten Kalenders können nicht verändert werden und es können keine Einträge zum Kalender hinzugefügt werden. Wenn Sie die Einstellung eines Kalenders in dieser Spalte auf schreibgeschützt setzen werden alle Daten automatisch abgespeichert, da die Daten eines schreibgeschützten Kalenders später nicht mehr gespeichert werden." },
1545{ "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." }, 1545{ "Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.","Klicken Sie diesen Knopf <b>um einen Kalender hinzuzufügen</b>. Sie können eine existierende Kalenderdatei hinzufügen oder einen neuen Kalender und KO/Pi legt dann eine neue leere Kalenderdatei für Sie an." },
1546{ "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" }, 1546{ "<b>iCal (*.ics) file on disk:</b><br>(will be created, if not existing)","<b>iCal (*.ics) Datei:</b><br>(Datei wird angelegt, wenn sie nicht existiert)" },
1547{ "Error saving data","Fehler beim Abspeichern" }, 1547{ "Error saving data","Fehler beim Abspeichern" },
1548{ "Calendar(s) not saved:","Nicht gespeicherte Kalender:" }, 1548{ "Calendar(s) not saved:","Nicht gespeicherte Kalender:" },
1549{ "Enable conflict detection","Schalte Konflikterkennung an" }, 1549{ "Enable conflict detection","Schalte Konflikterkennung an" },
1550{ "Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>. Sie können einstellen welche Termine überprüft werden:" }, 1550{ "Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:","Konflikterkennung prüft einen <b>bearbeiteten Termin</b> auf Überschneidungen mit <b>anderen Terminen</b>. Sie können einstellen welche Termine überprüft werden:" },
1551{ "Filter for the edited event","Filter für den bearbeiteten Termin" }, 1551{ "Filter for the edited event","Filter für den bearbeiteten Termin" },
1552{ "Filter for other existing events","Filter für die anderen Termine" }, 1552{ "Filter for other existing events","Filter für die anderen Termine" },
1553{ "Check Allday with Allday","Prüfe GanzTag mit GanzTag" }, 1553{ "Check Allday with Allday","Prüfe GanzTag mit GanzTag" },
1554{ "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" }, 1554{ "Check Allday with NonAllday","Prüfe GanzTag mit NichtGanzTag" },
1555{ "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" }, 1555{ "Check NonAllday with Allday","Prüfe NichtGanzTag mit GanzTag" },
1556{ "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" }, 1556{ "Check NonAllday with NonAllday","Prüfe NichtGanzTag mit NichtGanzTag" },
1557{ "Conflict detection","Konflikterkennung" }, 1557{ "Conflict detection","Konflikterkennung" },
1558{ "","" }, 1558{ "Loading calendar files ... please wait","Lade Kalenderdateien ... bitte warten" },
1559{ "","" }, 1559{ "","" },
1560{ "","" }, 1560{ "","" },
1561{ "","" }, 1561{ "","" },
1562{ "","" }, 1562{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e3b62de..9928b48 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1626,1538 +1626,1538 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int
1626 QDateTime modifiedCalendar = mLastCalendarSync; 1626 QDateTime modifiedCalendar = mLastCalendarSync;
1627 eventLSync = getLastSyncEvent(); 1627 eventLSync = getLastSyncEvent();
1628 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 1628 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
1629 if ( eventR ) { 1629 if ( eventR ) {
1630 qDebug("last-syncEvent on remote found "); 1630 qDebug("last-syncEvent on remote found ");
1631 eventRSync = (Event*) eventR->clone(); 1631 eventRSync = (Event*) eventR->clone();
1632 remote->deleteEvent(eventR ); 1632 remote->deleteEvent(eventR );
1633 1633
1634 } else { 1634 } else {
1635 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { 1635 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
1636 eventRSync = (Event*)eventLSync->clone(); 1636 eventRSync = (Event*)eventLSync->clone();
1637 } else { 1637 } else {
1638 fullDateRange = true; 1638 fullDateRange = true;
1639 eventRSync = new Event(); 1639 eventRSync = new Event();
1640 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 1640 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
1641 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 1641 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
1642 eventRSync->setDtStart( mLastCalendarSync ); 1642 eventRSync->setDtStart( mLastCalendarSync );
1643 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1643 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1644 eventRSync->setCategories( i18n("SyncEvent") ); 1644 eventRSync->setCategories( i18n("SyncEvent") );
1645 } 1645 }
1646 } 1646 }
1647 if ( eventLSync->dtStart() == mLastCalendarSync ) 1647 if ( eventLSync->dtStart() == mLastCalendarSync )
1648 fullDateRange = true; 1648 fullDateRange = true;
1649 1649
1650 if ( ! fullDateRange ) { 1650 if ( ! fullDateRange ) {
1651 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 1651 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
1652 1652
1653 qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 1653 qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
1654 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 1654 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
1655 fullDateRange = true; 1655 fullDateRange = true;
1656 } 1656 }
1657 } 1657 }
1658 if ( mSyncManager->syncWithDesktop() ) { 1658 if ( mSyncManager->syncWithDesktop() ) {
1659 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); 1659 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync );
1660 } 1660 }
1661 if ( fullDateRange ) 1661 if ( fullDateRange )
1662 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 1662 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
1663 else 1663 else
1664 mLastCalendarSync = eventLSync->dtStart(); 1664 mLastCalendarSync = eventLSync->dtStart();
1665 // for resyncing if own file has changed 1665 // for resyncing if own file has changed
1666 if ( mCurrentSyncDevice == "deleteaftersync" ) { 1666 if ( mCurrentSyncDevice == "deleteaftersync" ) {
1667 mLastCalendarSync = loadedFileVersion; 1667 mLastCalendarSync = loadedFileVersion;
1668 //qDebug("setting mLastCalendarSync "); 1668 //qDebug("setting mLastCalendarSync ");
1669 } 1669 }
1670 //qDebug("*************************** "); 1670 //qDebug("*************************** ");
1671 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 1671 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
1672 QPtrList<Incidence> er = remote->rawIncidences(); 1672 QPtrList<Incidence> er = remote->rawIncidences();
1673 Incidence* inR = er.first(); 1673 Incidence* inR = er.first();
1674 Incidence* inL; 1674 Incidence* inL;
1675 QProgressBar bar( er.count(),0 ); 1675 QProgressBar bar( er.count(),0 );
1676 bar.setCaption (i18n("Syncing - close to abort!") ); 1676 bar.setCaption (i18n("Syncing - close to abort!") );
1677 1677
1678 // ************** setting up filter ************* 1678 // ************** setting up filter *************
1679 CalFilter *filterIN = 0; 1679 CalFilter *filterIN = 0;
1680 CalFilter *filterOUT = 0; 1680 CalFilter *filterOUT = 0;
1681 CalFilter *filter = mFilters.first(); 1681 CalFilter *filter = mFilters.first();
1682 while(filter) { 1682 while(filter) {
1683 if ( filter->name() == mSyncManager->mFilterInCal ) 1683 if ( filter->name() == mSyncManager->mFilterInCal )
1684 filterIN = filter; 1684 filterIN = filter;
1685 if ( filter->name() == mSyncManager->mFilterOutCal ) 1685 if ( filter->name() == mSyncManager->mFilterOutCal )
1686 filterOUT = filter; 1686 filterOUT = filter;
1687 filter = mFilters.next(); 1687 filter = mFilters.next();
1688 } 1688 }
1689 int w = 300; 1689 int w = 300;
1690 if ( QApplication::desktop()->width() < 320 ) 1690 if ( QApplication::desktop()->width() < 320 )
1691 w = 220; 1691 w = 220;
1692 int h = bar.sizeHint().height() ; 1692 int h = bar.sizeHint().height() ;
1693 int dw = QApplication::desktop()->width(); 1693 int dw = QApplication::desktop()->width();
1694 int dh = QApplication::desktop()->height(); 1694 int dh = QApplication::desktop()->height();
1695 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1695 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1696 bar.show(); 1696 bar.show();
1697 int modulo = (er.count()/10)+1; 1697 int modulo = (er.count()/10)+1;
1698 int incCounter = 0; 1698 int incCounter = 0;
1699 while ( inR ) { 1699 while ( inR ) {
1700 if ( ! bar.isVisible() ) 1700 if ( ! bar.isVisible() )
1701 return false; 1701 return false;
1702 if ( incCounter % modulo == 0 ) 1702 if ( incCounter % modulo == 0 )
1703 bar.setProgress( incCounter ); 1703 bar.setProgress( incCounter );
1704 ++incCounter; 1704 ++incCounter;
1705 uid = inR->uid(); 1705 uid = inR->uid();
1706 bool skipIncidence = false; 1706 bool skipIncidence = false;
1707 if ( uid.left(15) == QString("last-syncEvent-") ) 1707 if ( uid.left(15) == QString("last-syncEvent-") )
1708 skipIncidence = true; 1708 skipIncidence = true;
1709 QString idS; 1709 QString idS;
1710 qApp->processEvents(); 1710 qApp->processEvents();
1711 if ( !skipIncidence ) { 1711 if ( !skipIncidence ) {
1712 inL = local->incidenceForUid( uid , false ); 1712 inL = local->incidenceForUid( uid , false );
1713 if ( inL ) { // maybe conflict - same uid in both calendars 1713 if ( inL ) { // maybe conflict - same uid in both calendars
1714 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { 1714 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
1715 //qDebug("take %d %s ", take, inL->summary().latin1()); 1715 //qDebug("take %d %s ", take, inL->summary().latin1());
1716 if ( take == 3 ) 1716 if ( take == 3 )
1717 return false; 1717 return false;
1718 if ( take == 1 ) {// take local ********************** 1718 if ( take == 1 ) {// take local **********************
1719 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 1719 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
1720 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1720 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1721 else 1721 else
1722 idS = inR->IDStr(); 1722 idS = inR->IDStr();
1723 int calID = inR->calID(); 1723 int calID = inR->calID();
1724 remote->deleteIncidence( inR ); 1724 remote->deleteIncidence( inR );
1725 inR = inL->clone(); 1725 inR = inL->clone();
1726 inR->setCalID( calID ); 1726 inR->setCalID( calID );
1727 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1727 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1728 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1728 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1729 inR->setIDStr( idS ); 1729 inR->setIDStr( idS );
1730 remote->addIncidence( inR ); 1730 remote->addIncidence( inR );
1731 if ( mSyncManager->syncWithDesktop() ) 1731 if ( mSyncManager->syncWithDesktop() )
1732 inR->setPilotId( 2 ); 1732 inR->setPilotId( 2 );
1733 ++changedRemote; 1733 ++changedRemote;
1734 } else {// take remote ********************** 1734 } else {// take remote **********************
1735 if ( !inL->isReadOnly() ) { 1735 if ( !inL->isReadOnly() ) {
1736 idS = inL->IDStr(); 1736 idS = inL->IDStr();
1737 int pid = inL->pilotId(); 1737 int pid = inL->pilotId();
1738 int calID = inL->calID(); 1738 int calID = inL->calID();
1739 local->deleteIncidence( inL ); 1739 local->deleteIncidence( inL );
1740 inL = inR->clone(); 1740 inL = inR->clone();
1741 inL->setCalID( calID ); 1741 inL->setCalID( calID );
1742 if ( mSyncManager->syncWithDesktop() ) 1742 if ( mSyncManager->syncWithDesktop() )
1743 inL->setPilotId( pid ); 1743 inL->setPilotId( pid );
1744 inL->setIDStr( idS ); 1744 inL->setIDStr( idS );
1745 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1745 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1746 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1746 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1747 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1747 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1748 } 1748 }
1749 local->addIncidence( inL ); 1749 local->addIncidence( inL );
1750 ++changedLocal; 1750 ++changedLocal;
1751 } 1751 }
1752 } 1752 }
1753 } 1753 }
1754 } else { // no conflict ********** add or delete remote 1754 } else { // no conflict ********** add or delete remote
1755 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ 1755 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){
1756 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1756 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1757 QString des = eventLSync->description(); 1757 QString des = eventLSync->description();
1758 QString pref = "e"; 1758 QString pref = "e";
1759 if ( inR->typeID() == todoID ) 1759 if ( inR->typeID() == todoID )
1760 pref = "t"; 1760 pref = "t";
1761 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1761 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1762 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1762 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1763 //remote->deleteIncidence( inR ); 1763 //remote->deleteIncidence( inR );
1764 ++deletedEventR; 1764 ++deletedEventR;
1765 } else { 1765 } else {
1766 inR->setLastModified( modifiedCalendar ); 1766 inR->setLastModified( modifiedCalendar );
1767 inL = inR->clone(); 1767 inL = inR->clone();
1768 inL->setIDStr( ":" ); 1768 inL->setIDStr( ":" );
1769 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1769 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1770 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1770 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1771 1771
1772 inL->setCalID( 0 );// add to default cal 1772 inL->setCalID( 0 );// add to default cal
1773 local->addIncidence( inL ); 1773 local->addIncidence( inL );
1774 ++addedEvent; 1774 ++addedEvent;
1775 1775
1776 } 1776 }
1777 } else { 1777 } else {
1778 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1778 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1779 inR->setLastModified( modifiedCalendar ); 1779 inR->setLastModified( modifiedCalendar );
1780 inL = inR->clone(); 1780 inL = inR->clone();
1781 inL->setIDStr( ":" ); 1781 inL->setIDStr( ":" );
1782 inL->setCalID( 0 );// add to default cal 1782 inL->setCalID( 0 );// add to default cal
1783 local->addIncidence( inL ); 1783 local->addIncidence( inL );
1784 ++addedEvent; 1784 ++addedEvent;
1785 1785
1786 } else { 1786 } else {
1787 checkExternSyncEvent(eventRSyncSharp, inR); 1787 checkExternSyncEvent(eventRSyncSharp, inR);
1788 remote->deleteIncidence( inR ); 1788 remote->deleteIncidence( inR );
1789 ++deletedEventR; 1789 ++deletedEventR;
1790 } 1790 }
1791 } 1791 }
1792 } else { 1792 } else {
1793 ++filteredIN; 1793 ++filteredIN;
1794 } 1794 }
1795 } 1795 }
1796 } 1796 }
1797 inR = er.next(); 1797 inR = er.next();
1798 } 1798 }
1799 QPtrList<Incidence> el = local->rawIncidences(); 1799 QPtrList<Incidence> el = local->rawIncidences();
1800 inL = el.first(); 1800 inL = el.first();
1801 modulo = (el.count()/10)+1; 1801 modulo = (el.count()/10)+1;
1802 bar.setCaption (i18n("Add / remove events") ); 1802 bar.setCaption (i18n("Add / remove events") );
1803 bar.setTotalSteps ( el.count() ) ; 1803 bar.setTotalSteps ( el.count() ) ;
1804 bar.show(); 1804 bar.show();
1805 incCounter = 0; 1805 incCounter = 0;
1806 1806
1807 while ( inL ) { 1807 while ( inL ) {
1808 1808
1809 qApp->processEvents(); 1809 qApp->processEvents();
1810 if ( ! bar.isVisible() ) 1810 if ( ! bar.isVisible() )
1811 return false; 1811 return false;
1812 if ( incCounter % modulo == 0 ) 1812 if ( incCounter % modulo == 0 )
1813 bar.setProgress( incCounter ); 1813 bar.setProgress( incCounter );
1814 ++incCounter; 1814 ++incCounter;
1815 uid = inL->uid(); 1815 uid = inL->uid();
1816 bool skipIncidence = false; 1816 bool skipIncidence = false;
1817 if ( uid.left(15) == QString("last-syncEvent-") ) 1817 if ( uid.left(15) == QString("last-syncEvent-") )
1818 skipIncidence = true; 1818 skipIncidence = true;
1819 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) 1819 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
1820 skipIncidence = true; 1820 skipIncidence = true;
1821 if ( !skipIncidence ) { 1821 if ( !skipIncidence ) {
1822 inR = remote->incidenceForUid( uid , true ); 1822 inR = remote->incidenceForUid( uid , true );
1823 if ( ! inR ) { 1823 if ( ! inR ) {
1824 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ 1824 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
1825 // no conflict ********** add or delete local 1825 // no conflict ********** add or delete local
1826 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1826 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1827 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1827 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1828 checkExternSyncEvent(eventLSyncSharp, inL); 1828 checkExternSyncEvent(eventLSyncSharp, inL);
1829 local->deleteIncidence( inL ); 1829 local->deleteIncidence( inL );
1830 ++deletedEventL; 1830 ++deletedEventL;
1831 } else { 1831 } else {
1832 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1832 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1833 inL->removeID(mCurrentSyncDevice ); 1833 inL->removeID(mCurrentSyncDevice );
1834 ++addedEventR; 1834 ++addedEventR;
1835 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1835 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1836 inL->setLastModified( modifiedCalendar ); 1836 inL->setLastModified( modifiedCalendar );
1837 inR = inL->clone(); 1837 inR = inL->clone();
1838 inR->setIDStr( ":" ); 1838 inR->setIDStr( ":" );
1839 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1839 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1840 inR->setCalID( 0 );// add to default cal 1840 inR->setCalID( 0 );// add to default cal
1841 remote->addIncidence( inR ); 1841 remote->addIncidence( inR );
1842 } 1842 }
1843 } 1843 }
1844 } else { 1844 } else {
1845 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1845 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1846 checkExternSyncEvent(eventLSyncSharp, inL); 1846 checkExternSyncEvent(eventLSyncSharp, inL);
1847 local->deleteIncidence( inL ); 1847 local->deleteIncidence( inL );
1848 ++deletedEventL; 1848 ++deletedEventL;
1849 } else { 1849 } else {
1850 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1850 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1851 ++addedEventR; 1851 ++addedEventR;
1852 inL->setLastModified( modifiedCalendar ); 1852 inL->setLastModified( modifiedCalendar );
1853 inR = inL->clone(); 1853 inR = inL->clone();
1854 inR->setIDStr( ":" ); 1854 inR->setIDStr( ":" );
1855 inR->setCalID( 0 );// add to default cal 1855 inR->setCalID( 0 );// add to default cal
1856 remote->addIncidence( inR ); 1856 remote->addIncidence( inR );
1857 } 1857 }
1858 } 1858 }
1859 } 1859 }
1860 } else { 1860 } else {
1861 ++filteredOUT; 1861 ++filteredOUT;
1862 } 1862 }
1863 } 1863 }
1864 } 1864 }
1865 inL = el.next(); 1865 inL = el.next();
1866 } 1866 }
1867 int delFut = 0; 1867 int delFut = 0;
1868 int remRem = 0; 1868 int remRem = 0;
1869 if ( mSyncManager->mWriteBackInFuture ) { 1869 if ( mSyncManager->mWriteBackInFuture ) {
1870 er = remote->rawIncidences(); 1870 er = remote->rawIncidences();
1871 remRem = er.count(); 1871 remRem = er.count();
1872 inR = er.first(); 1872 inR = er.first();
1873 QDateTime dt; 1873 QDateTime dt;
1874 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); 1874 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) );
1875 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); 1875 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 );
1876 while ( inR ) { 1876 while ( inR ) {
1877 if ( inR->typeID() == todoID ) { 1877 if ( inR->typeID() == todoID ) {
1878 Todo * t = (Todo*)inR; 1878 Todo * t = (Todo*)inR;
1879 if ( t->hasDueDate() ) 1879 if ( t->hasDueDate() )
1880 dt = t->dtDue(); 1880 dt = t->dtDue();
1881 else 1881 else
1882 dt = cur.addSecs( 62 ); 1882 dt = cur.addSecs( 62 );
1883 } 1883 }
1884 else if (inR->typeID() == eventID ) { 1884 else if (inR->typeID() == eventID ) {
1885 bool ok; 1885 bool ok;
1886 dt = inR->getNextOccurence( cur, &ok ); 1886 dt = inR->getNextOccurence( cur, &ok );
1887 if ( !ok ) 1887 if ( !ok )
1888 dt = cur.addSecs( -62 ); 1888 dt = cur.addSecs( -62 );
1889 } 1889 }
1890 else 1890 else
1891 dt = inR->dtStart(); 1891 dt = inR->dtStart();
1892 if ( dt < cur || dt > end ) { 1892 if ( dt < cur || dt > end ) {
1893 remote->deleteIncidence( inR ); 1893 remote->deleteIncidence( inR );
1894 ++delFut; 1894 ++delFut;
1895 } 1895 }
1896 inR = er.next(); 1896 inR = er.next();
1897 } 1897 }
1898 } 1898 }
1899 bar.hide(); 1899 bar.hide();
1900 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1900 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1901 eventLSync->setReadOnly( false ); 1901 eventLSync->setReadOnly( false );
1902 eventLSync->setDtStart( mLastCalendarSync ); 1902 eventLSync->setDtStart( mLastCalendarSync );
1903 eventRSync->setDtStart( mLastCalendarSync ); 1903 eventRSync->setDtStart( mLastCalendarSync );
1904 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1904 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1905 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1905 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1906 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1906 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1907 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1907 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1908 eventLSync->setReadOnly( true ); 1908 eventLSync->setReadOnly( true );
1909 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL ); 1909 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL );
1910 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1910 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1911 remote->addEvent( eventRSync ); 1911 remote->addEvent( eventRSync );
1912 else 1912 else
1913 delete eventRSync; 1913 delete eventRSync;
1914 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() ); 1914 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() );
1915 QString mes; 1915 QString mes;
1916 mes .sprintf( i18n("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"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR, filteredIN, filteredOUT ); 1916 mes .sprintf( i18n("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"),addedEvent, addedEventR, changedLocal, changedRemote, deletedEventL, deletedEventR, filteredIN, filteredOUT );
1917 QString delmess; 1917 QString delmess;
1918 if ( delFut ) { 1918 if ( delFut ) {
1919 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are more\nthan %d weeks in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInPast,mSyncManager->mWriteBackInFuture, remRem-delFut); 1919 delmess.sprintf( i18n("%d items skipped on remote,\nbecause they are more\nthan %d weeks in the past or\nmore than %d weeks in the future.\nAfter skipping, remote has\n%d calendar/todo items."), delFut,mSyncManager->mWriteBackInPast,mSyncManager->mWriteBackInFuture, remRem-delFut);
1920 mes += delmess; 1920 mes += delmess;
1921 } 1921 }
1922 mes = i18n("Local calendar changed!\n") +mes; 1922 mes = i18n("Local calendar changed!\n") +mes;
1923 mCalendar->checkAlarmForIncidence( 0, true ); 1923 mCalendar->checkAlarmForIncidence( 0, true );
1924 qDebug( mes ); 1924 qDebug( mes );
1925 if ( mSyncManager->mShowSyncSummary ) { 1925 if ( mSyncManager->mShowSyncSummary ) {
1926 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1926 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1927 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1927 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1928 qDebug("KO: WB cancelled "); 1928 qDebug("KO: WB cancelled ");
1929 mSyncManager->mWriteBackFile = false; 1929 mSyncManager->mWriteBackFile = false;
1930 return syncOK; 1930 return syncOK;
1931 } 1931 }
1932 } 1932 }
1933 return syncOK; 1933 return syncOK;
1934} 1934}
1935 1935
1936void CalendarView::setSyncDevice( QString s ) 1936void CalendarView::setSyncDevice( QString s )
1937{ 1937{
1938 mCurrentSyncDevice= s; 1938 mCurrentSyncDevice= s;
1939} 1939}
1940void CalendarView::setSyncName( QString s ) 1940void CalendarView::setSyncName( QString s )
1941{ 1941{
1942 mCurrentSyncName= s; 1942 mCurrentSyncName= s;
1943} 1943}
1944bool CalendarView::syncCalendar(QString filename, int mode) 1944bool CalendarView::syncCalendar(QString filename, int mode)
1945{ 1945{
1946 //qDebug("syncCalendar %s ", filename.latin1()); 1946 //qDebug("syncCalendar %s ", filename.latin1());
1947 mGlobalSyncMode = SYNC_MODE_NORMAL; 1947 mGlobalSyncMode = SYNC_MODE_NORMAL;
1948 CalendarLocal* calendar = new CalendarLocal(); 1948 CalendarLocal* calendar = new CalendarLocal();
1949 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1949 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1950 FileStorage* storage = new FileStorage( calendar ); 1950 FileStorage* storage = new FileStorage( calendar );
1951 bool syncOK = false; 1951 bool syncOK = false;
1952 storage->setFileName( filename ); 1952 storage->setFileName( filename );
1953 // qDebug("loading ... "); 1953 // qDebug("loading ... ");
1954 if ( storage->load() ) { 1954 if ( storage->load() ) {
1955 getEventViewerDialog()->setSyncMode( true ); 1955 getEventViewerDialog()->setSyncMode( true );
1956 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1956 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1957 getEventViewerDialog()->setSyncMode( false ); 1957 getEventViewerDialog()->setSyncMode( false );
1958 if ( syncOK ) { 1958 if ( syncOK ) {
1959 if ( mSyncManager->mWriteBackFile ) 1959 if ( mSyncManager->mWriteBackFile )
1960 { 1960 {
1961 storage->setSaveFormat( new ICalFormat() ); 1961 storage->setSaveFormat( new ICalFormat() );
1962 storage->save(); 1962 storage->save();
1963 } 1963 }
1964 } 1964 }
1965 setModified( true ); 1965 setModified( true );
1966 } 1966 }
1967 delete storage; 1967 delete storage;
1968 delete calendar; 1968 delete calendar;
1969 if ( syncOK ) 1969 if ( syncOK )
1970 updateView(); 1970 updateView();
1971 return syncOK; 1971 return syncOK;
1972} 1972}
1973 1973
1974void CalendarView::syncExternal( int mode ) 1974void CalendarView::syncExternal( int mode )
1975{ 1975{
1976 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1976 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1977 1977
1978 qApp->processEvents(); 1978 qApp->processEvents();
1979 CalendarLocal* calendar = new CalendarLocal(); 1979 CalendarLocal* calendar = new CalendarLocal();
1980 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1980 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1981 bool syncOK = false; 1981 bool syncOK = false;
1982 bool loadSuccess = false; 1982 bool loadSuccess = false;
1983 PhoneFormat* phoneFormat = 0; 1983 PhoneFormat* phoneFormat = 0;
1984 emit tempDisableBR(true); 1984 emit tempDisableBR(true);
1985#ifndef DESKTOP_VERSION 1985#ifndef DESKTOP_VERSION
1986 SharpFormat* sharpFormat = 0; 1986 SharpFormat* sharpFormat = 0;
1987 if ( mode == 0 ) { // sharp 1987 if ( mode == 0 ) { // sharp
1988 sharpFormat = new SharpFormat () ; 1988 sharpFormat = new SharpFormat () ;
1989 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1989 loadSuccess = sharpFormat->load( calendar, mCalendar );
1990 1990
1991 } else 1991 } else
1992#endif 1992#endif
1993 if ( mode == 1 ) { // phone 1993 if ( mode == 1 ) { // phone
1994 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1994 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1995 mSyncManager->mPhoneDevice, 1995 mSyncManager->mPhoneDevice,
1996 mSyncManager->mPhoneConnection, 1996 mSyncManager->mPhoneConnection,
1997 mSyncManager->mPhoneModel); 1997 mSyncManager->mPhoneModel);
1998 loadSuccess = phoneFormat->load( calendar,mCalendar); 1998 loadSuccess = phoneFormat->load( calendar,mCalendar);
1999 1999
2000 } else { 2000 } else {
2001 emit tempDisableBR(false); 2001 emit tempDisableBR(false);
2002 return; 2002 return;
2003 } 2003 }
2004 if ( loadSuccess ) { 2004 if ( loadSuccess ) {
2005 getEventViewerDialog()->setSyncMode( true ); 2005 getEventViewerDialog()->setSyncMode( true );
2006 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 2006 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
2007 getEventViewerDialog()->setSyncMode( false ); 2007 getEventViewerDialog()->setSyncMode( false );
2008 qApp->processEvents(); 2008 qApp->processEvents();
2009 if ( syncOK ) { 2009 if ( syncOK ) {
2010 if ( mSyncManager->mWriteBackFile ) 2010 if ( mSyncManager->mWriteBackFile )
2011 { 2011 {
2012 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 2012 QPtrList<Incidence> iL = mCalendar->rawIncidences();
2013 Incidence* inc = iL.first(); 2013 Incidence* inc = iL.first();
2014 if ( phoneFormat ) { 2014 if ( phoneFormat ) {
2015 while ( inc ) { 2015 while ( inc ) {
2016 inc->removeID(mCurrentSyncDevice); 2016 inc->removeID(mCurrentSyncDevice);
2017 inc = iL.next(); 2017 inc = iL.next();
2018 } 2018 }
2019 } 2019 }
2020#ifndef DESKTOP_VERSION 2020#ifndef DESKTOP_VERSION
2021 if ( sharpFormat ) 2021 if ( sharpFormat )
2022 sharpFormat->save(calendar); 2022 sharpFormat->save(calendar);
2023#endif 2023#endif
2024 if ( phoneFormat ) 2024 if ( phoneFormat )
2025 phoneFormat->save(calendar); 2025 phoneFormat->save(calendar);
2026 iL = calendar->rawIncidences(); 2026 iL = calendar->rawIncidences();
2027 inc = iL.first(); 2027 inc = iL.first();
2028 Incidence* loc; 2028 Incidence* loc;
2029 while ( inc ) { 2029 while ( inc ) {
2030 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 2030 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
2031 loc = mCalendar->incidence(inc->uid() ); 2031 loc = mCalendar->incidence(inc->uid() );
2032 if ( loc ) { 2032 if ( loc ) {
2033 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 2033 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
2034 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 2034 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
2035 } 2035 }
2036 } 2036 }
2037 inc = iL.next(); 2037 inc = iL.next();
2038 } 2038 }
2039 Incidence* lse = getLastSyncEvent(); 2039 Incidence* lse = getLastSyncEvent();
2040 if ( lse ) { 2040 if ( lse ) {
2041 lse->setReadOnly( false ); 2041 lse->setReadOnly( false );
2042 lse->setDescription( "" ); 2042 lse->setDescription( "" );
2043 lse->setReadOnly( true ); 2043 lse->setReadOnly( true );
2044 } 2044 }
2045 } 2045 }
2046 } else { 2046 } else {
2047 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 2047 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
2048 } 2048 }
2049 setModified( true ); 2049 setModified( true );
2050 } else { 2050 } else {
2051 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 2051 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
2052 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 2052 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
2053 question, i18n("Ok")) ; 2053 question, i18n("Ok")) ;
2054 2054
2055 } 2055 }
2056 delete calendar; 2056 delete calendar;
2057 updateView(); 2057 updateView();
2058 emit tempDisableBR(false); 2058 emit tempDisableBR(false);
2059 return ;//syncOK; 2059 return ;//syncOK;
2060 2060
2061} 2061}
2062 2062
2063bool CalendarView::importBday() 2063bool CalendarView::importBday()
2064{ 2064{
2065#ifndef KORG_NOKABC 2065#ifndef KORG_NOKABC
2066 2066
2067#ifdef DESKTOP_VERSION 2067#ifdef DESKTOP_VERSION
2068 int curCal = mCalendar->defaultCalendar(); 2068 int curCal = mCalendar->defaultCalendar();
2069 int bd = mCalEditView->getBirtdayID(); 2069 int bd = mCalEditView->getBirtdayID();
2070 if ( bd == 0 ) 2070 if ( bd == 0 )
2071 return false; 2071 return false;
2072 mCalendar->setDefaultCalendar( bd ); 2072 mCalendar->setDefaultCalendar( bd );
2073 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 2073 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
2074 KABC::AddressBook::Iterator it; 2074 KABC::AddressBook::Iterator it;
2075 int count = 0; 2075 int count = 0;
2076 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 2076 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
2077 ++count; 2077 ++count;
2078 } 2078 }
2079 QProgressBar bar(count,0 ); 2079 QProgressBar bar(count,0 );
2080 int w = 300; 2080 int w = 300;
2081 if ( QApplication::desktop()->width() < 320 ) 2081 if ( QApplication::desktop()->width() < 320 )
2082 w = 220; 2082 w = 220;
2083 int h = bar.sizeHint().height() ; 2083 int h = bar.sizeHint().height() ;
2084 int dw = QApplication::desktop()->width(); 2084 int dw = QApplication::desktop()->width();
2085 int dh = QApplication::desktop()->height(); 2085 int dh = QApplication::desktop()->height();
2086 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2086 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2087 bar.show(); 2087 bar.show();
2088 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 2088 bar.setCaption (i18n("Reading addressbook - close to abort!") );
2089 qApp->processEvents(); 2089 qApp->processEvents();
2090 count = 0; 2090 count = 0;
2091 int addCount = 0; 2091 int addCount = 0;
2092 KCal::Attendee* a = 0; 2092 KCal::Attendee* a = 0;
2093 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 2093 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
2094 if ( ! bar.isVisible() ) 2094 if ( ! bar.isVisible() )
2095 return false; 2095 return false;
2096 bar.setProgress( count++ ); 2096 bar.setProgress( count++ );
2097 qApp->processEvents(); 2097 qApp->processEvents();
2098 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 2098 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
2099 if ( (*it).birthday().date().isValid() ){ 2099 if ( (*it).birthday().date().isValid() ){
2100 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 2100 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
2101 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 2101 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
2102 ++addCount; 2102 ++addCount;
2103 } 2103 }
2104 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 2104 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
2105 if ( anni.isValid() ){ 2105 if ( anni.isValid() ){
2106 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 2106 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
2107 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 2107 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
2108 ++addCount; 2108 ++addCount;
2109 } 2109 }
2110 } 2110 }
2111 mCalendar->setDefaultCalendar( curCal ); 2111 mCalendar->setDefaultCalendar( curCal );
2112 updateView(); 2112 updateView();
2113 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 2113 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
2114#else //DESKTOP_VERSION 2114#else //DESKTOP_VERSION
2115 2115
2116 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 2116 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
2117 // the result should now arrive through method insertBirthdays 2117 // the result should now arrive through method insertBirthdays
2118 2118
2119#endif //DESKTOP_VERSION 2119#endif //DESKTOP_VERSION
2120 2120
2121#endif //KORG_NOKABC 2121#endif //KORG_NOKABC
2122 2122
2123 2123
2124 return true; 2124 return true;
2125} 2125}
2126 2126
2127// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 2127// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
2128void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 2128void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
2129 const QStringList& anniversaryList, const QStringList& realNameList, 2129 const QStringList& anniversaryList, const QStringList& realNameList,
2130 const QStringList& emailList, const QStringList& assembledNameList, 2130 const QStringList& emailList, const QStringList& assembledNameList,
2131 const QStringList& uidList) 2131 const QStringList& uidList)
2132{ 2132{
2133 2133
2134 //qDebug("KO::CalendarView::insertBirthdays"); 2134 //qDebug("KO::CalendarView::insertBirthdays");
2135 if (uid == this->name()) 2135 if (uid == this->name())
2136 { 2136 {
2137 int curCal = mCalendar->defaultCalendar(); 2137 int curCal = mCalendar->defaultCalendar();
2138 int bd = mCalEditView->getBirtdayID(); 2138 int bd = mCalEditView->getBirtdayID();
2139 if ( bd == 0 ) 2139 if ( bd == 0 )
2140 return; 2140 return;
2141 mCalendar->setDefaultCalendar( bd ); 2141 mCalendar->setDefaultCalendar( bd );
2142 2142
2143 2143
2144 int count = birthdayList.count(); 2144 int count = birthdayList.count();
2145 int addCount = 0; 2145 int addCount = 0;
2146 KCal::Attendee* a = 0; 2146 KCal::Attendee* a = 0;
2147 2147
2148 //qDebug("CalView 1 %i", count); 2148 //qDebug("CalView 1 %i", count);
2149 2149
2150 QProgressBar bar(count,0 ); 2150 QProgressBar bar(count,0 );
2151 int w = 300; 2151 int w = 300;
2152 if ( QApplication::desktop()->width() < 320 ) 2152 if ( QApplication::desktop()->width() < 320 )
2153 w = 220; 2153 w = 220;
2154 int h = bar.sizeHint().height() ; 2154 int h = bar.sizeHint().height() ;
2155 int dw = QApplication::desktop()->width(); 2155 int dw = QApplication::desktop()->width();
2156 int dh = QApplication::desktop()->height(); 2156 int dh = QApplication::desktop()->height();
2157 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2157 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2158 bar.show(); 2158 bar.show();
2159 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 2159 bar.setCaption (i18n("inserting birthdays - close to abort!") );
2160 qApp->processEvents(); 2160 qApp->processEvents();
2161 2161
2162 QDate birthday; 2162 QDate birthday;
2163 QDate anniversary; 2163 QDate anniversary;
2164 QString realName; 2164 QString realName;
2165 QString email; 2165 QString email;
2166 QString assembledName; 2166 QString assembledName;
2167 QString uid; 2167 QString uid;
2168 bool ok = true; 2168 bool ok = true;
2169 for ( int i = 0; i < count; i++) 2169 for ( int i = 0; i < count; i++)
2170 { 2170 {
2171 if ( ! bar.isVisible() ) 2171 if ( ! bar.isVisible() )
2172 return; 2172 return;
2173 bar.setProgress( i ); 2173 bar.setProgress( i );
2174 qApp->processEvents(); 2174 qApp->processEvents();
2175 2175
2176 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 2176 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
2177 if (!ok) { 2177 if (!ok) {
2178 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 2178 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
2179 } 2179 }
2180 2180
2181 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 2181 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
2182 if (!ok) { 2182 if (!ok) {
2183 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 2183 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
2184 } 2184 }
2185 realName = realNameList[i]; 2185 realName = realNameList[i];
2186 email = emailList[i]; 2186 email = emailList[i];
2187 assembledName = assembledNameList[i]; 2187 assembledName = assembledNameList[i];
2188 uid = uidList[i]; 2188 uid = uidList[i];
2189 //qDebug("insert birthday in KO/Pi: %s,%s,%s,%s: %s, %s", realName.latin1(), email.latin1(), assembledName.latin1(), uid.latin1(), birthdayList[i].latin1(), anniversaryList[i].latin1() ); 2189 //qDebug("insert birthday in KO/Pi: %s,%s,%s,%s: %s, %s", realName.latin1(), email.latin1(), assembledName.latin1(), uid.latin1(), birthdayList[i].latin1(), anniversaryList[i].latin1() );
2190 2190
2191 if ( birthday.isValid() ){ 2191 if ( birthday.isValid() ){
2192 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 2192 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
2193 KCal::Attendee::ReqParticipant,uid) ; 2193 KCal::Attendee::ReqParticipant,uid) ;
2194 if ( addAnniversary( birthday, assembledName, a, true ) ) 2194 if ( addAnniversary( birthday, assembledName, a, true ) )
2195 ++addCount; 2195 ++addCount;
2196 } 2196 }
2197 2197
2198 if ( anniversary.isValid() ){ 2198 if ( anniversary.isValid() ){
2199 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 2199 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
2200 KCal::Attendee::ReqParticipant,uid) ; 2200 KCal::Attendee::ReqParticipant,uid) ;
2201 if ( addAnniversary( anniversary, assembledName, a, false ) ) 2201 if ( addAnniversary( anniversary, assembledName, a, false ) )
2202 ++addCount; 2202 ++addCount;
2203 } 2203 }
2204 } 2204 }
2205 2205
2206 mCalendar->setDefaultCalendar( curCal ); 2206 mCalendar->setDefaultCalendar( curCal );
2207 updateView(); 2207 updateView();
2208 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 2208 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
2209 2209
2210 } 2210 }
2211 2211
2212} 2212}
2213 2213
2214 2214
2215 2215
2216bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 2216bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
2217{ 2217{
2218 //qDebug("addAnni "); 2218 //qDebug("addAnni ");
2219 Event * ev = new Event(); 2219 Event * ev = new Event();
2220 ev->setOrganizer(KOPrefs::instance()->email()); 2220 ev->setOrganizer(KOPrefs::instance()->email());
2221 if ( a ) { 2221 if ( a ) {
2222 ev->addAttendee( a ); 2222 ev->addAttendee( a );
2223 } 2223 }
2224 QString kind; 2224 QString kind;
2225 if ( birthday ) { 2225 if ( birthday ) {
2226 kind = i18n( "Birthday" ); 2226 kind = i18n( "Birthday" );
2227 ev->setSummary( name + " (" + QString::number(date.year()) +")"); 2227 ev->setSummary( name + " (" + QString::number(date.year()) +")");
2228 } 2228 }
2229 else { 2229 else {
2230 kind = i18n( "Anniversary" ); 2230 kind = i18n( "Anniversary" );
2231 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); 2231 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
2232 } 2232 }
2233 ev->setCategories( kind ); 2233 ev->setCategories( kind );
2234 ev->setDtStart( QDateTime(date) ); 2234 ev->setDtStart( QDateTime(date) );
2235 ev->setDtEnd( QDateTime(date) ); 2235 ev->setDtEnd( QDateTime(date) );
2236 ev->setFloats( true ); 2236 ev->setFloats( true );
2237 Recurrence * rec = ev->recurrence(); 2237 Recurrence * rec = ev->recurrence();
2238 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 2238 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
2239 rec->addYearlyNum( date.month() ); 2239 rec->addYearlyNum( date.month() );
2240 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 2240 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
2241 delete ev; 2241 delete ev;
2242 return false; 2242 return false;
2243 } 2243 }
2244 return true; 2244 return true;
2245 2245
2246} 2246}
2247bool CalendarView::importQtopia( const QString &categories, 2247bool CalendarView::importQtopia( const QString &categories,
2248 const QString &datebook, 2248 const QString &datebook,
2249 const QString &todolist ) 2249 const QString &todolist )
2250{ 2250{
2251 2251
2252 QtopiaFormat qtopiaFormat; 2252 QtopiaFormat qtopiaFormat;
2253 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 2253 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
2254 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 2254 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
2255 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 2255 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
2256 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 2256 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
2257 2257
2258 updateView(); 2258 updateView();
2259 return true; 2259 return true;
2260 2260
2261#if 0 2261#if 0
2262 mGlobalSyncMode = SYNC_MODE_QTOPIA; 2262 mGlobalSyncMode = SYNC_MODE_QTOPIA;
2263 mCurrentSyncDevice = "qtopia-XML"; 2263 mCurrentSyncDevice = "qtopia-XML";
2264 if ( mSyncManager->mAskForPreferences ) 2264 if ( mSyncManager->mAskForPreferences )
2265 edit_sync_options(); 2265 edit_sync_options();
2266 qApp->processEvents(); 2266 qApp->processEvents();
2267 CalendarLocal* calendar = new CalendarLocal(); 2267 CalendarLocal* calendar = new CalendarLocal();
2268 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2268 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2269 bool syncOK = false; 2269 bool syncOK = false;
2270 QtopiaFormat qtopiaFormat; 2270 QtopiaFormat qtopiaFormat;
2271 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 2271 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
2272 bool loadOk = true; 2272 bool loadOk = true;
2273 if ( !categories.isEmpty() ) 2273 if ( !categories.isEmpty() )
2274 loadOk = qtopiaFormat.load( calendar, categories ); 2274 loadOk = qtopiaFormat.load( calendar, categories );
2275 if ( loadOk && !datebook.isEmpty() ) 2275 if ( loadOk && !datebook.isEmpty() )
2276 loadOk = qtopiaFormat.load( calendar, datebook ); 2276 loadOk = qtopiaFormat.load( calendar, datebook );
2277 if ( loadOk && !todolist.isEmpty() ) 2277 if ( loadOk && !todolist.isEmpty() )
2278 loadOk = qtopiaFormat.load( calendar, todolist ); 2278 loadOk = qtopiaFormat.load( calendar, todolist );
2279 2279
2280 if ( loadOk ) { 2280 if ( loadOk ) {
2281 getEventViewerDialog()->setSyncMode( true ); 2281 getEventViewerDialog()->setSyncMode( true );
2282 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 2282 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
2283 getEventViewerDialog()->setSyncMode( false ); 2283 getEventViewerDialog()->setSyncMode( false );
2284 qApp->processEvents(); 2284 qApp->processEvents();
2285 if ( syncOK ) { 2285 if ( syncOK ) {
2286 if ( mSyncManager->mWriteBackFile ) 2286 if ( mSyncManager->mWriteBackFile )
2287 { 2287 {
2288 // write back XML file 2288 // write back XML file
2289 2289
2290 } 2290 }
2291 setModified( true ); 2291 setModified( true );
2292 } 2292 }
2293 } else { 2293 } else {
2294 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 2294 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
2295 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 2295 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
2296 question, i18n("Ok")) ; 2296 question, i18n("Ok")) ;
2297 } 2297 }
2298 delete calendar; 2298 delete calendar;
2299 updateView(); 2299 updateView();
2300 return syncOK; 2300 return syncOK;
2301 2301
2302 2302
2303#endif 2303#endif
2304 2304
2305} 2305}
2306 2306
2307void CalendarView::setSyncEventsReadOnly() 2307void CalendarView::setSyncEventsReadOnly()
2308{ 2308{
2309 mCalendar->setSyncEventsReadOnly(); 2309 mCalendar->setSyncEventsReadOnly();
2310} 2310}
2311 2311
2312bool CalendarView::loadCalendars() 2312bool CalendarView::loadCalendars()
2313{ 2313{
2314 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2314 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2315 KopiCalendarFile * cal = calendars.first(); 2315 KopiCalendarFile * cal = calendars.first();
2316 mCalendar->setDefaultCalendar( 1 ); 2316 mCalendar->setDefaultCalendar( 1 );
2317 openCalendar( MainWindow::defaultFileName(), false ); 2317 openCalendar( MainWindow::defaultFileName(), false );
2318 cal = calendars.next(); 2318 cal = calendars.next();
2319 while ( cal ) { 2319 while ( cal ) {
2320 addCalendar( cal ); 2320 addCalendar( cal );
2321 cal = calendars.next(); 2321 cal = calendars.next();
2322 } 2322 }
2323 restoreCalendarSettings(); 2323 restoreCalendarSettings();
2324 return true; 2324 return true;
2325} 2325}
2326bool CalendarView::restoreCalendarSettings() 2326bool CalendarView::restoreCalendarSettings()
2327{ 2327{
2328 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2328 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2329 KopiCalendarFile * cal = calendars.first(); 2329 KopiCalendarFile * cal = calendars.first();
2330 while ( cal ) { 2330 while ( cal ) {
2331 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 2331 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
2332 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 2332 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
2333 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 2333 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
2334 if ( cal->isStandard ) 2334 if ( cal->isStandard )
2335 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2335 mCalendar->setDefaultCalendar( cal->mCalNumber );
2336 cal = calendars.next(); 2336 cal = calendars.next();
2337 } 2337 }
2338 setSyncEventsReadOnly(); 2338 setSyncEventsReadOnly();
2339 mCalendar->reInitAlarmSettings(); 2339 mCalendar->reInitAlarmSettings();
2340 updateUnmanagedViews(); 2340 updateUnmanagedViews();
2341 updateView(); 2341 updateView();
2342 return true; 2342 return true;
2343} 2343}
2344void CalendarView::addCalendarId( int id ) 2344void CalendarView::addCalendarId( int id )
2345{ 2345{
2346 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); 2346 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
2347 if ( cal ) 2347 if ( cal )
2348 addCalendar( cal ); 2348 addCalendar( cal );
2349} 2349}
2350bool CalendarView::addCalendar( KopiCalendarFile * cal ) 2350bool CalendarView::addCalendar( KopiCalendarFile * cal )
2351{ 2351{
2352 cal->mErrorOnLoad = false; 2352 cal->mErrorOnLoad = false;
2353 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { 2353 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) {
2354 cal->mLoadDt = QDateTime::currentDateTime(); 2354 cal->mLoadDt = QDateTime::currentDateTime();
2355 return true; 2355 return true;
2356 } 2356 }
2357 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() ); 2357 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() );
2358 cal->mErrorOnLoad = true; 2358 cal->mErrorOnLoad = true;
2359 return false; 2359 return false;
2360} 2360}
2361bool CalendarView::openCalendar(QString filename, bool merge) 2361bool CalendarView::openCalendar(QString filename, bool merge)
2362{ 2362{
2363 2363
2364 if (filename.isEmpty()) { 2364 if (filename.isEmpty()) {
2365 return false; 2365 return false;
2366 } 2366 }
2367 2367
2368 if (!QFile::exists(filename)) { 2368 if (!QFile::exists(filename)) {
2369 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 2369 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
2370 return false; 2370 return false;
2371 } 2371 }
2372 2372
2373 globalFlagBlockAgenda = 1; 2373 globalFlagBlockAgenda = 1;
2374 clearAllViews(); 2374 clearAllViews();
2375 if (!merge) { 2375 if (!merge) {
2376 mViewManager->setDocumentId( filename ); 2376 mViewManager->setDocumentId( filename );
2377 mCalendar->close(); 2377 mCalendar->close();
2378 } 2378 }
2379 mStorage->setFileName( filename ); 2379 mStorage->setFileName( filename );
2380 2380
2381 if ( mStorage->load() ) { 2381 if ( mStorage->load() ) {
2382 if ( merge ) ;//setModified( true ); 2382 if ( merge ) ;//setModified( true );
2383 else { 2383 else {
2384 //setModified( true ); 2384 //setModified( true );
2385 mViewManager->setDocumentId( filename ); 2385 mViewManager->setDocumentId( filename );
2386 mDialogManager->setDocumentId( filename ); 2386 mDialogManager->setDocumentId( filename );
2387 mTodoList->setDocumentId( filename ); 2387 mTodoList->setDocumentId( filename );
2388 } 2388 }
2389 globalFlagBlockAgenda = 2; 2389 globalFlagBlockAgenda = 2;
2390 // if ( getLastSyncEvent() ) 2390 // if ( getLastSyncEvent() )
2391 // getLastSyncEvent()->setReadOnly( true ); 2391 // getLastSyncEvent()->setReadOnly( true );
2392 mCalendar->reInitAlarmSettings(); 2392 mCalendar->reInitAlarmSettings();
2393 setSyncEventsReadOnly(); 2393 setSyncEventsReadOnly();
2394 updateUnmanagedViews(); 2394 //updateUnmanagedViews();
2395 updateView(); 2395 //updateView();
2396 if ( filename != MainWindow::defaultFileName() ) { 2396 if ( filename != MainWindow::defaultFileName() ) {
2397 saveCalendar( MainWindow::defaultFileName() ); 2397 saveCalendar( MainWindow::defaultFileName() );
2398 } else { 2398 } else {
2399 QFileInfo finf ( MainWindow::defaultFileName()); 2399 QFileInfo finf ( MainWindow::defaultFileName());
2400 if ( finf.exists() ) { 2400 if ( finf.exists() ) {
2401 setLoadedFileVersion( finf.lastModified () ); 2401 setLoadedFileVersion( finf.lastModified () );
2402 } 2402 }
2403 } 2403 }
2404 return true; 2404 return true;
2405 } else { 2405 } else {
2406 // while failing to load, the calendar object could 2406 // while failing to load, the calendar object could
2407 // have become partially populated. Clear it out. 2407 // have become partially populated. Clear it out.
2408 if ( !merge ) { 2408 if ( !merge ) {
2409 mCalendar->close(); 2409 mCalendar->close();
2410 mViewManager->setDocumentId( filename ); 2410 mViewManager->setDocumentId( filename );
2411 mDialogManager->setDocumentId( filename ); 2411 mDialogManager->setDocumentId( filename );
2412 mTodoList->setDocumentId( filename ); 2412 mTodoList->setDocumentId( filename );
2413 } 2413 }
2414 2414
2415 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 2415 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
2416 2416
2417 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 2417 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
2418 globalFlagBlockAgenda = 2; 2418 globalFlagBlockAgenda = 2;
2419 mCalendar->reInitAlarmSettings(); 2419 mCalendar->reInitAlarmSettings();
2420 setSyncEventsReadOnly(); 2420 setSyncEventsReadOnly();
2421 updateUnmanagedViews(); 2421 updateUnmanagedViews();
2422 updateView(); 2422 updateView();
2423 } 2423 }
2424 return false; 2424 return false;
2425} 2425}
2426void CalendarView::mergeFile( QString fn ) 2426void CalendarView::mergeFile( QString fn )
2427{ 2427{
2428 clearAllViews(); 2428 clearAllViews();
2429 mCalendar->mergeCalendarFile( fn ); 2429 mCalendar->mergeCalendarFile( fn );
2430 mCalendar->reInitAlarmSettings(); 2430 mCalendar->reInitAlarmSettings();
2431 setSyncEventsReadOnly(); 2431 setSyncEventsReadOnly();
2432 updateUnmanagedViews(); 2432 updateUnmanagedViews();
2433 updateView(); 2433 updateView();
2434} 2434}
2435void CalendarView::showOpenError() 2435void CalendarView::showOpenError()
2436{ 2436{
2437 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 2437 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
2438} 2438}
2439void CalendarView::setLoadedFileVersion(QDateTime dt) 2439void CalendarView::setLoadedFileVersion(QDateTime dt)
2440{ 2440{
2441 loadedFileVersion = dt; 2441 loadedFileVersion = dt;
2442} 2442}
2443bool CalendarView::checkFileChanged(QString fn) 2443bool CalendarView::checkFileChanged(QString fn)
2444{ 2444{
2445 QFileInfo finf ( fn ); 2445 QFileInfo finf ( fn );
2446 if ( !finf.exists() ) 2446 if ( !finf.exists() )
2447 return true; 2447 return true;
2448 QDateTime dt = finf.lastModified (); 2448 QDateTime dt = finf.lastModified ();
2449 if ( dt <= loadedFileVersion ) 2449 if ( dt <= loadedFileVersion )
2450 return false; 2450 return false;
2451 return true; 2451 return true;
2452 2452
2453} 2453}
2454void CalendarView::watchSavedFile() 2454void CalendarView::watchSavedFile()
2455{ 2455{
2456 QFileInfo finf ( MainWindow::defaultFileName()); 2456 QFileInfo finf ( MainWindow::defaultFileName());
2457 if ( !finf.exists() ) 2457 if ( !finf.exists() )
2458 return; 2458 return;
2459 QDateTime dt = finf.lastModified (); 2459 QDateTime dt = finf.lastModified ();
2460 if ( dt < loadedFileVersion ) { 2460 if ( dt < loadedFileVersion ) {
2461 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 2461 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
2462 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 2462 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
2463 return; 2463 return;
2464 } 2464 }
2465 loadedFileVersion = dt; 2465 loadedFileVersion = dt;
2466} 2466}
2467bool CalendarView::checkAllFileVersions() 2467bool CalendarView::checkAllFileVersions()
2468{ 2468{
2469 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2469 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2470 KopiCalendarFile * cal = calendars.first(); 2470 KopiCalendarFile * cal = calendars.first();
2471 mCalendar->setDefaultCalendar( 1 ); 2471 mCalendar->setDefaultCalendar( 1 );
2472 mCalendar->setDefaultCalendarEnabledOnly(); 2472 mCalendar->setDefaultCalendarEnabledOnly();
2473 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2473 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2474 if ( !checkFileVersion(MainWindow::defaultFileName())) { 2474 if ( !checkFileVersion(MainWindow::defaultFileName())) {
2475 restoreCalendarSettings(); 2475 restoreCalendarSettings();
2476 return false; 2476 return false;
2477 } 2477 }
2478 } 2478 }
2479 cal = calendars.next(); 2479 cal = calendars.next();
2480 QDateTime storeTemp = loadedFileVersion; 2480 QDateTime storeTemp = loadedFileVersion;
2481 while ( cal ) { 2481 while ( cal ) {
2482 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2482 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2483 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2483 mCalendar->setDefaultCalendar( cal->mCalNumber );
2484 mCalendar->setDefaultCalendarEnabledOnly(); 2484 mCalendar->setDefaultCalendarEnabledOnly();
2485 loadedFileVersion = cal->mLoadDt.addSecs( 15 ); 2485 loadedFileVersion = cal->mLoadDt.addSecs( 15 );
2486 if ( !checkFileVersion(cal->mFileName )) { 2486 if ( !checkFileVersion(cal->mFileName )) {
2487 loadedFileVersion = storeTemp; 2487 loadedFileVersion = storeTemp;
2488 restoreCalendarSettings(); 2488 restoreCalendarSettings();
2489 return false; 2489 return false;
2490 } 2490 }
2491 } 2491 }
2492 cal = calendars.next(); 2492 cal = calendars.next();
2493 } 2493 }
2494 loadedFileVersion = storeTemp; 2494 loadedFileVersion = storeTemp;
2495 return true; 2495 return true;
2496} 2496}
2497bool CalendarView::checkFileVersion(QString fn) 2497bool CalendarView::checkFileVersion(QString fn)
2498{ 2498{
2499 QFileInfo finf ( fn ); 2499 QFileInfo finf ( fn );
2500 if ( !finf.exists() ) 2500 if ( !finf.exists() )
2501 return true; 2501 return true;
2502 QDateTime dt = finf.lastModified (); 2502 QDateTime dt = finf.lastModified ();
2503 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); 2503 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1());
2504 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); 2504 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1());
2505 if ( dt <= loadedFileVersion ) 2505 if ( dt <= loadedFileVersion )
2506 return true; 2506 return true;
2507 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , 2507 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n").arg(KGlobal::formatMessage(fn,0)).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) ,
2508 i18n("KO/Pi Warning"),i18n("Overwrite"), 2508 i18n("KO/Pi Warning"),i18n("Overwrite"),
2509 i18n("Sync+save")); 2509 i18n("Sync+save"));
2510 2510
2511 if ( km == KMessageBox::Cancel ) 2511 if ( km == KMessageBox::Cancel )
2512 return false; 2512 return false;
2513 if ( km == KMessageBox::Yes ) 2513 if ( km == KMessageBox::Yes )
2514 return true; 2514 return true;
2515 2515
2516 setSyncDevice("deleteaftersync" ); 2516 setSyncDevice("deleteaftersync" );
2517 mSyncManager->mAskForPreferences = true; 2517 mSyncManager->mAskForPreferences = true;
2518 mSyncManager->mSyncAlgoPrefs = 3; 2518 mSyncManager->mSyncAlgoPrefs = 3;
2519 mSyncManager->mWriteBackFile = false; 2519 mSyncManager->mWriteBackFile = false;
2520 mSyncManager->mWriteBackExistingOnly = false; 2520 mSyncManager->mWriteBackExistingOnly = false;
2521 mSyncManager->mShowSyncSummary = false; 2521 mSyncManager->mShowSyncSummary = false;
2522 syncCalendar( fn, 3 ); 2522 syncCalendar( fn, 3 );
2523 Event * e = getLastSyncEvent(); 2523 Event * e = getLastSyncEvent();
2524 if ( e ) 2524 if ( e )
2525 mCalendar->deleteEvent( e ); 2525 mCalendar->deleteEvent( e );
2526 return true; 2526 return true;
2527} 2527}
2528bool CalendarView::saveCalendars() 2528bool CalendarView::saveCalendars()
2529{ 2529{
2530 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2530 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2531 KopiCalendarFile * cal = calendars.first(); 2531 KopiCalendarFile * cal = calendars.first();
2532 mCalendar->setDefaultCalendar( 1 ); 2532 mCalendar->setDefaultCalendar( 1 );
2533 mCalendar->setDefaultCalendarEnabledOnly(); 2533 mCalendar->setDefaultCalendarEnabledOnly();
2534 QString saveError; 2534 QString saveError;
2535 if ( !saveCalendar( MainWindow::defaultFileName() ) ) 2535 if ( !saveCalendar( MainWindow::defaultFileName() ) )
2536 saveError = cal->mName +"\n"; 2536 saveError = cal->mName +"\n";
2537 cal = calendars.next(); 2537 cal = calendars.next();
2538 while ( cal ) { 2538 while ( cal ) {
2539 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2539 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2540 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2540 mCalendar->setDefaultCalendar( cal->mCalNumber );
2541 mCalendar->setDefaultCalendarEnabledOnly(); 2541 mCalendar->setDefaultCalendarEnabledOnly();
2542 if ( saveCalendar( cal->mFileName ) ) 2542 if ( saveCalendar( cal->mFileName ) )
2543 cal->mLoadDt = QDateTime::currentDateTime(); 2543 cal->mLoadDt = QDateTime::currentDateTime();
2544 else 2544 else
2545 saveError += cal->mName + "\n"; 2545 saveError += cal->mName + "\n";
2546 } 2546 }
2547 cal = calendars.next(); 2547 cal = calendars.next();
2548 } 2548 }
2549 restoreCalendarSettings(); 2549 restoreCalendarSettings();
2550 if ( !saveError.isEmpty() ) { 2550 if ( !saveError.isEmpty() ) {
2551 saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError; 2551 saveError = KGlobal::formatMessage( i18n("Calendar(s) not saved:"),0 )+"\n" + saveError;
2552 KMessageBox::error(this, saveError, i18n("Error saving data")); 2552 KMessageBox::error(this, saveError, i18n("Error saving data"));
2553 return false; 2553 return false;
2554 } 2554 }
2555 return true; 2555 return true;
2556} 2556}
2557bool CalendarView::saveCalendar( QString filename ) 2557bool CalendarView::saveCalendar( QString filename )
2558{ 2558{
2559 2559
2560 // Store back all unsaved data into calendar object 2560 // Store back all unsaved data into calendar object
2561 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 2561 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
2562 if ( mViewManager->currentView() ) 2562 if ( mViewManager->currentView() )
2563 mViewManager->currentView()->flushView(); 2563 mViewManager->currentView()->flushView();
2564 2564
2565 2565
2566 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 2566 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
2567 mStorage->setSaveFormat( new ICalFormat() ); 2567 mStorage->setSaveFormat( new ICalFormat() );
2568 mStorage->setFileName( filename ); 2568 mStorage->setFileName( filename );
2569 bool success; 2569 bool success;
2570 success = mStorage->save(); 2570 success = mStorage->save();
2571 if ( !success ) { 2571 if ( !success ) {
2572 return false; 2572 return false;
2573 } 2573 }
2574 if ( filename == MainWindow::defaultFileName() ) { 2574 if ( filename == MainWindow::defaultFileName() ) {
2575 setLoadedFileVersion( lfv ); 2575 setLoadedFileVersion( lfv );
2576 watchSavedFile(); 2576 watchSavedFile();
2577 } 2577 }
2578 return true; 2578 return true;
2579} 2579}
2580 2580
2581void CalendarView::closeCalendar() 2581void CalendarView::closeCalendar()
2582{ 2582{
2583 2583
2584 // child windows no longer valid 2584 // child windows no longer valid
2585 clearAllViews(); 2585 clearAllViews();
2586 emit closingDown(); 2586 emit closingDown();
2587 2587
2588 mCalendar->close(); 2588 mCalendar->close();
2589 setModified(false); 2589 setModified(false);
2590 updateView(); 2590 updateView();
2591} 2591}
2592 2592
2593void CalendarView::archiveCalendar() 2593void CalendarView::archiveCalendar()
2594{ 2594{
2595 mDialogManager->showArchiveDialog(); 2595 mDialogManager->showArchiveDialog();
2596} 2596}
2597 2597
2598 2598
2599void CalendarView::readSettings() 2599void CalendarView::readSettings()
2600{ 2600{
2601 2601
2602 2602
2603 // mViewManager->showAgendaView(); 2603 // mViewManager->showAgendaView();
2604 QString str; 2604 QString str;
2605 //qDebug("CalendarView::readSettings() "); 2605 //qDebug("CalendarView::readSettings() ");
2606 // read settings from the KConfig, supplying reasonable 2606 // read settings from the KConfig, supplying reasonable
2607 // defaults where none are to be found 2607 // defaults where none are to be found
2608 KConfig *config = KOGlobals::config(); 2608 KConfig *config = KOGlobals::config();
2609#ifndef KORG_NOSPLITTER 2609#ifndef KORG_NOSPLITTER
2610 config->setGroup("KOrganizer Geometry"); 2610 config->setGroup("KOrganizer Geometry");
2611 2611
2612 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2612 QValueList<int> sizes = config->readIntListEntry("Separator1");
2613 if (sizes.count() != 2) { 2613 if (sizes.count() != 2) {
2614 sizes << mDateNavigator->minimumSizeHint().width(); 2614 sizes << mDateNavigator->minimumSizeHint().width();
2615 sizes << 300; 2615 sizes << 300;
2616 } 2616 }
2617 mPanner->setSizes(sizes); 2617 mPanner->setSizes(sizes);
2618 2618
2619 sizes = config->readIntListEntry("Separator2"); 2619 sizes = config->readIntListEntry("Separator2");
2620 if ( ( mResourceView && sizes.count() == 4 ) || 2620 if ( ( mResourceView && sizes.count() == 4 ) ||
2621 ( !mResourceView && sizes.count() == 3 ) ) { 2621 ( !mResourceView && sizes.count() == 3 ) ) {
2622 mLeftSplitter->setSizes(sizes); 2622 mLeftSplitter->setSizes(sizes);
2623 } 2623 }
2624#endif 2624#endif
2625 globalFlagBlockAgenda = 1; 2625 globalFlagBlockAgenda = 1;
2626 mViewManager->showAgendaView(); 2626 mViewManager->showAgendaView();
2627 //mViewManager->readSettings( config ); 2627 //mViewManager->readSettings( config );
2628 mTodoList->restoreLayout(config,QString("Todo Layout")); 2628 mTodoList->restoreLayout(config,QString("Todo Layout"));
2629 readFilterSettings(config); 2629 readFilterSettings(config);
2630 2630
2631#ifdef DESKTOP_VERSION 2631#ifdef DESKTOP_VERSION
2632 config->setGroup("WidgetLayout"); 2632 config->setGroup("WidgetLayout");
2633 QStringList list; 2633 QStringList list;
2634 list = config->readListEntry("MainLayout"); 2634 list = config->readListEntry("MainLayout");
2635 int x,y,w,h; 2635 int x,y,w,h;
2636 if ( ! list.isEmpty() ) { 2636 if ( ! list.isEmpty() ) {
2637 x = list[0].toInt(); 2637 x = list[0].toInt();
2638 y = list[1].toInt(); 2638 y = list[1].toInt();
2639 w = list[2].toInt(); 2639 w = list[2].toInt();
2640 h = list[3].toInt(); 2640 h = list[3].toInt();
2641 KApplication::testCoords( &x,&y,&w,&h ); 2641 KApplication::testCoords( &x,&y,&w,&h );
2642 topLevelWidget()->setGeometry(x,y,w,h); 2642 topLevelWidget()->setGeometry(x,y,w,h);
2643 2643
2644 } else { 2644 } else {
2645 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 2645 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
2646 } 2646 }
2647 list = config->readListEntry("EditEventLayout"); 2647 list = config->readListEntry("EditEventLayout");
2648 if ( ! list.isEmpty() ) { 2648 if ( ! list.isEmpty() ) {
2649 x = list[0].toInt(); 2649 x = list[0].toInt();
2650 y = list[1].toInt(); 2650 y = list[1].toInt();
2651 w = list[2].toInt(); 2651 w = list[2].toInt();
2652 h = list[3].toInt(); 2652 h = list[3].toInt();
2653 KApplication::testCoords( &x,&y,&w,&h ); 2653 KApplication::testCoords( &x,&y,&w,&h );
2654 mEventEditor->setGeometry(x,y,w,h); 2654 mEventEditor->setGeometry(x,y,w,h);
2655 2655
2656 } 2656 }
2657 list = config->readListEntry("EditTodoLayout"); 2657 list = config->readListEntry("EditTodoLayout");
2658 if ( ! list.isEmpty() ) { 2658 if ( ! list.isEmpty() ) {
2659 x = list[0].toInt(); 2659 x = list[0].toInt();
2660 y = list[1].toInt(); 2660 y = list[1].toInt();
2661 w = list[2].toInt(); 2661 w = list[2].toInt();
2662 h = list[3].toInt(); 2662 h = list[3].toInt();
2663 KApplication::testCoords( &x,&y,&w,&h ); 2663 KApplication::testCoords( &x,&y,&w,&h );
2664 mTodoEditor->setGeometry(x,y,w,h); 2664 mTodoEditor->setGeometry(x,y,w,h);
2665 2665
2666 } 2666 }
2667 list = config->readListEntry("ViewerLayout"); 2667 list = config->readListEntry("ViewerLayout");
2668 if ( ! list.isEmpty() ) { 2668 if ( ! list.isEmpty() ) {
2669 x = list[0].toInt(); 2669 x = list[0].toInt();
2670 y = list[1].toInt(); 2670 y = list[1].toInt();
2671 w = list[2].toInt(); 2671 w = list[2].toInt();
2672 h = list[3].toInt(); 2672 h = list[3].toInt();
2673 KApplication::testCoords( &x,&y,&w,&h ); 2673 KApplication::testCoords( &x,&y,&w,&h );
2674 getEventViewerDialog()->setGeometry(x,y,w,h); 2674 getEventViewerDialog()->setGeometry(x,y,w,h);
2675 } 2675 }
2676#endif 2676#endif
2677 config->setGroup( "Views" ); 2677 config->setGroup( "Views" );
2678 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2678 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2679 2679
2680 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2680 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2681 2681
2682 int resetval = 0; 2682 int resetval = 0;
2683 int maxVal = 0; 2683 int maxVal = 0;
2684 if (sizes.count() != 3) { 2684 if (sizes.count() != 3) {
2685 if ( KOPrefs::instance()->mVerticalScreen ) { 2685 if ( KOPrefs::instance()->mVerticalScreen ) {
2686 resetval = mDateNavigator->sizeHint().width()+2; 2686 resetval = mDateNavigator->sizeHint().width()+2;
2687 } else { 2687 } else {
2688 resetval = mDateNavigator->sizeHint().height()+2; 2688 resetval = mDateNavigator->sizeHint().height()+2;
2689 } 2689 }
2690 } 2690 }
2691 if ( resetval ) { 2691 if ( resetval ) {
2692 sizes.clear(); 2692 sizes.clear();
2693 if ( KOPrefs::instance()->mVerticalScreen ) { 2693 if ( KOPrefs::instance()->mVerticalScreen ) {
2694 maxVal = QApplication::desktop()->width() -10; 2694 maxVal = QApplication::desktop()->width() -10;
2695 } else { 2695 } else {
2696 maxVal = QApplication::desktop()->height()-10; 2696 maxVal = QApplication::desktop()->height()-10;
2697 } 2697 }
2698 sizes << resetval; 2698 sizes << resetval;
2699 if ( maxVal < resetval + resetval) 2699 if ( maxVal < resetval + resetval)
2700 resetval = maxVal - resetval; 2700 resetval = maxVal - resetval;
2701 sizes << resetval; 2701 sizes << resetval;
2702 sizes << 100; 2702 sizes << 100;
2703 } 2703 }
2704 mLeftFrame->setSizes(sizes); 2704 mLeftFrame->setSizes(sizes);
2705 sizes = config->readIntListEntry("Main Splitter Frame"); 2705 sizes = config->readIntListEntry("Main Splitter Frame");
2706 resetval = 0; 2706 resetval = 0;
2707 maxVal = 0; 2707 maxVal = 0;
2708 if (sizes.count() != 2) { 2708 if (sizes.count() != 2) {
2709 if ( !KOPrefs::instance()->mVerticalScreen ) { 2709 if ( !KOPrefs::instance()->mVerticalScreen ) {
2710 resetval = mDateNavigator->sizeHint().width()+2; 2710 resetval = mDateNavigator->sizeHint().width()+2;
2711 } else { 2711 } else {
2712 resetval = mDateNavigator->sizeHint().height()+2; 2712 resetval = mDateNavigator->sizeHint().height()+2;
2713 } 2713 }
2714 } 2714 }
2715 if ( resetval ) { 2715 if ( resetval ) {
2716 sizes.clear(); 2716 sizes.clear();
2717 if ( !KOPrefs::instance()->mVerticalScreen ) { 2717 if ( !KOPrefs::instance()->mVerticalScreen ) {
2718 maxVal = QApplication::desktop()->width() -10; 2718 maxVal = QApplication::desktop()->width() -10;
2719 } else { 2719 } else {
2720 maxVal = QApplication::desktop()->height()-10; 2720 maxVal = QApplication::desktop()->height()-10;
2721 } 2721 }
2722 sizes << resetval; 2722 sizes << resetval;
2723 if ( maxVal < resetval + resetval) 2723 if ( maxVal < resetval + resetval)
2724 resetval = maxVal - resetval; 2724 resetval = maxVal - resetval;
2725 sizes << resetval; 2725 sizes << resetval;
2726 } 2726 }
2727 mMainFrame->setSizes(sizes); 2727 mMainFrame->setSizes(sizes);
2728 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2728 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2729 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2729 else if ( dateCount == 7 ) mNavigator->selectWeek();
2730 else mNavigator->selectDates( dateCount ); 2730 else mNavigator->selectDates( dateCount );
2731 // mViewManager->readSettings( config ); 2731 // mViewManager->readSettings( config );
2732 updateConfig(); 2732 updateConfig();
2733 globalFlagBlockAgenda = 2; 2733 globalFlagBlockAgenda = 2;
2734 mViewManager->readSettings( config ); 2734 mViewManager->readSettings( config );
2735 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2735 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2736} 2736}
2737 2737
2738void CalendarView::checkSuspendAlarm() 2738void CalendarView::checkSuspendAlarm()
2739{ 2739{
2740 if ( mSuspendTimer->isActive() ) { 2740 if ( mSuspendTimer->isActive() ) {
2741 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); 2741 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
2742 } 2742 }
2743} 2743}
2744void CalendarView::writeSettings() 2744void CalendarView::writeSettings()
2745{ 2745{
2746 // kdDebug() << "CalendarView::writeSettings" << endl; 2746 // kdDebug() << "CalendarView::writeSettings" << endl;
2747 2747
2748 KConfig *config = KOGlobals::config(); 2748 KConfig *config = KOGlobals::config();
2749 2749
2750 mViewManager->writeSettings( config ); 2750 mViewManager->writeSettings( config );
2751 mTodoList->saveLayout(config,QString("Todo Layout")); 2751 mTodoList->saveLayout(config,QString("Todo Layout"));
2752 mDialogManager->writeSettings( config ); 2752 mDialogManager->writeSettings( config );
2753 //KOPrefs::instance()->usrWriteConfig(); 2753 //KOPrefs::instance()->usrWriteConfig();
2754 KOPrefs::instance()->writeConfig(); 2754 KOPrefs::instance()->writeConfig();
2755 2755
2756 writeFilterSettings(config); 2756 writeFilterSettings(config);
2757 config->setGroup( "AppRun" ); 2757 config->setGroup( "AppRun" );
2758 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2758 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2759 int days = dt.daysTo( QDate::currentDate() ); 2759 int days = dt.daysTo( QDate::currentDate() );
2760 dt = dt.addDays( days ); 2760 dt = dt.addDays( days );
2761 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2761 int secs = dt.secsTo( QDateTime::currentDateTime() );
2762 config->writeEntry( "LatestProgramStopDays", days ); 2762 config->writeEntry( "LatestProgramStopDays", days );
2763 config->writeEntry( "LatestProgramStopSecs", secs ); 2763 config->writeEntry( "LatestProgramStopSecs", secs );
2764 //qDebug("KO: Writing stop time: %d ", secs); 2764 //qDebug("KO: Writing stop time: %d ", secs);
2765 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2765 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2766 //QDateTime latest = dt.addSecs ( secs ); 2766 //QDateTime latest = dt.addSecs ( secs );
2767 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2767 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2768 config->setGroup( "Views" ); 2768 config->setGroup( "Views" );
2769 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2769 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2770 2770
2771#if 0 2771#if 0
2772 qDebug("********************* "); 2772 qDebug("********************* ");
2773 qDebug("Testcode secsto "); 2773 qDebug("Testcode secsto ");
2774 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2774 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2775 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2775 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2776 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2776 int secsto = dt_nodaylight.secsTo( dt_daylight );
2777 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2777 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2778 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2778 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2779 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2779 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2780 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2780 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2781 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2781 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2782 qDebug("********************* testcode end"); 2782 qDebug("********************* testcode end");
2783 2783
2784#endif 2784#endif
2785 2785
2786 QValueList<int> listINT = mLeftFrame->sizes(); 2786 QValueList<int> listINT = mLeftFrame->sizes();
2787 config->writeEntry("Left Splitter Frame",listINT); 2787 config->writeEntry("Left Splitter Frame",listINT);
2788 QValueList<int> listINT2 = mMainFrame->sizes(); 2788 QValueList<int> listINT2 = mMainFrame->sizes();
2789 config->writeEntry("Main Splitter Frame",listINT2); 2789 config->writeEntry("Main Splitter Frame",listINT2);
2790#ifdef DESKTOP_VERSION 2790#ifdef DESKTOP_VERSION
2791 config->setGroup("WidgetLayout"); 2791 config->setGroup("WidgetLayout");
2792 QStringList list ;//= config->readListEntry("MainLayout"); 2792 QStringList list ;//= config->readListEntry("MainLayout");
2793 int x,y,w,h; 2793 int x,y,w,h;
2794 QWidget* wid; 2794 QWidget* wid;
2795 wid = topLevelWidget(); 2795 wid = topLevelWidget();
2796 x = wid->geometry().x(); 2796 x = wid->geometry().x();
2797 y = wid->geometry().y(); 2797 y = wid->geometry().y();
2798 w = wid->width(); 2798 w = wid->width();
2799 h = wid->height(); 2799 h = wid->height();
2800 list.clear(); 2800 list.clear();
2801 list << QString::number( x ); 2801 list << QString::number( x );
2802 list << QString::number( y ); 2802 list << QString::number( y );
2803 list << QString::number( w ); 2803 list << QString::number( w );
2804 list << QString::number( h ); 2804 list << QString::number( h );
2805 config->writeEntry("MainLayout",list ); 2805 config->writeEntry("MainLayout",list );
2806 2806
2807 wid = mEventEditor; 2807 wid = mEventEditor;
2808 x = wid->geometry().x(); 2808 x = wid->geometry().x();
2809 y = wid->geometry().y(); 2809 y = wid->geometry().y();
2810 w = wid->width(); 2810 w = wid->width();
2811 h = wid->height(); 2811 h = wid->height();
2812 list.clear(); 2812 list.clear();
2813 list << QString::number( x ); 2813 list << QString::number( x );
2814 list << QString::number( y ); 2814 list << QString::number( y );
2815 list << QString::number( w ); 2815 list << QString::number( w );
2816 list << QString::number( h ); 2816 list << QString::number( h );
2817 config->writeEntry("EditEventLayout",list ); 2817 config->writeEntry("EditEventLayout",list );
2818 2818
2819 wid = mTodoEditor; 2819 wid = mTodoEditor;
2820 x = wid->geometry().x(); 2820 x = wid->geometry().x();
2821 y = wid->geometry().y(); 2821 y = wid->geometry().y();
2822 w = wid->width(); 2822 w = wid->width();
2823 h = wid->height(); 2823 h = wid->height();
2824 list.clear(); 2824 list.clear();
2825 list << QString::number( x ); 2825 list << QString::number( x );
2826 list << QString::number( y ); 2826 list << QString::number( y );
2827 list << QString::number( w ); 2827 list << QString::number( w );
2828 list << QString::number( h ); 2828 list << QString::number( h );
2829 config->writeEntry("EditTodoLayout",list ); 2829 config->writeEntry("EditTodoLayout",list );
2830 wid = getEventViewerDialog(); 2830 wid = getEventViewerDialog();
2831 x = wid->geometry().x(); 2831 x = wid->geometry().x();
2832 y = wid->geometry().y(); 2832 y = wid->geometry().y();
2833 w = wid->width(); 2833 w = wid->width();
2834 h = wid->height(); 2834 h = wid->height();
2835 list.clear(); 2835 list.clear();
2836 list << QString::number( x ); 2836 list << QString::number( x );
2837 list << QString::number( y ); 2837 list << QString::number( y );
2838 list << QString::number( w ); 2838 list << QString::number( w );
2839 list << QString::number( h ); 2839 list << QString::number( h );
2840 config->writeEntry("ViewerLayout",list ); 2840 config->writeEntry("ViewerLayout",list );
2841 wid = mDialogManager->getSearchDialog(); 2841 wid = mDialogManager->getSearchDialog();
2842 if ( wid ) { 2842 if ( wid ) {
2843 x = wid->geometry().x(); 2843 x = wid->geometry().x();
2844 y = wid->geometry().y(); 2844 y = wid->geometry().y();
2845 w = wid->width(); 2845 w = wid->width();
2846 h = wid->height(); 2846 h = wid->height();
2847 list.clear(); 2847 list.clear();
2848 list << QString::number( x ); 2848 list << QString::number( x );
2849 list << QString::number( y ); 2849 list << QString::number( y );
2850 list << QString::number( w ); 2850 list << QString::number( w );
2851 list << QString::number( h ); 2851 list << QString::number( h );
2852 config->writeEntry("SearchLayout",list ); 2852 config->writeEntry("SearchLayout",list );
2853 } 2853 }
2854#endif 2854#endif
2855 2855
2856 2856
2857 config->sync(); 2857 config->sync();
2858} 2858}
2859 2859
2860void CalendarView::readFilterSettings(KConfig *config) 2860void CalendarView::readFilterSettings(KConfig *config)
2861{ 2861{
2862 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2862 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2863 2863
2864 mFilters.clear(); 2864 mFilters.clear();
2865 2865
2866 config->setGroup("General"); 2866 config->setGroup("General");
2867 QStringList filterList = config->readListEntry("CalendarFilters"); 2867 QStringList filterList = config->readListEntry("CalendarFilters");
2868 2868
2869 QStringList::ConstIterator it = filterList.begin(); 2869 QStringList::ConstIterator it = filterList.begin();
2870 QStringList::ConstIterator end = filterList.end(); 2870 QStringList::ConstIterator end = filterList.end();
2871 while(it != end) { 2871 while(it != end) {
2872 // kdDebug() << " filter: " << (*it) << endl; 2872 // kdDebug() << " filter: " << (*it) << endl;
2873 2873
2874 CalFilter *filter; 2874 CalFilter *filter;
2875 filter = new CalFilter(*it); 2875 filter = new CalFilter(*it);
2876 config->setGroup("Filter_" + (*it).utf8()); 2876 config->setGroup("Filter_" + (*it).utf8());
2877 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2877 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2878 filter->setCriteria(config->readNumEntry("Criteria",0)); 2878 filter->setCriteria(config->readNumEntry("Criteria",0));
2879 filter->setCategoryList(config->readListEntry("CategoryList")); 2879 filter->setCategoryList(config->readListEntry("CategoryList"));
2880 mFilters.append(filter); 2880 mFilters.append(filter);
2881 2881
2882 ++it; 2882 ++it;
2883 } 2883 }
2884 2884
2885 if (mFilters.count() == 0) { 2885 if (mFilters.count() == 0) {
2886 CalFilter *filter = new CalFilter(i18n("Default")); 2886 CalFilter *filter = new CalFilter(i18n("Default"));
2887 mFilters.append(filter); 2887 mFilters.append(filter);
2888 } 2888 }
2889 mFilterView->updateFilters(); 2889 mFilterView->updateFilters();
2890 config->setGroup("FilterView"); 2890 config->setGroup("FilterView");
2891 2891
2892 mFilterView->blockSignals(true); 2892 mFilterView->blockSignals(true);
2893 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2893 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2894 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2894 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2895 mFilterView->blockSignals(false); 2895 mFilterView->blockSignals(false);
2896 // We do it manually to avoid it being done twice by the above calls 2896 // We do it manually to avoid it being done twice by the above calls
2897 updateFilter(); 2897 updateFilter();
2898} 2898}
2899 2899
2900void CalendarView::writeFilterSettings(KConfig *config) 2900void CalendarView::writeFilterSettings(KConfig *config)
2901{ 2901{
2902 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2902 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2903 2903
2904 QStringList filterList; 2904 QStringList filterList;
2905 2905
2906 CalFilter *filter = mFilters.first(); 2906 CalFilter *filter = mFilters.first();
2907 while(filter) { 2907 while(filter) {
2908 // kdDebug() << " fn: " << filter->name() << endl; 2908 // kdDebug() << " fn: " << filter->name() << endl;
2909 filterList << filter->name(); 2909 filterList << filter->name();
2910 config->setGroup("Filter_" + filter->name().utf8()); 2910 config->setGroup("Filter_" + filter->name().utf8());
2911 config->writeEntry("Criteria",filter->criteria()); 2911 config->writeEntry("Criteria",filter->criteria());
2912 config->writeEntry("CategoryList",filter->categoryList()); 2912 config->writeEntry("CategoryList",filter->categoryList());
2913 filter = mFilters.next(); 2913 filter = mFilters.next();
2914 } 2914 }
2915 config->setGroup("General"); 2915 config->setGroup("General");
2916 config->writeEntry("CalendarFilters",filterList); 2916 config->writeEntry("CalendarFilters",filterList);
2917 2917
2918 config->setGroup("FilterView"); 2918 config->setGroup("FilterView");
2919 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2919 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2920 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2920 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2921} 2921}
2922 2922
2923 2923
2924void CalendarView::goToday() 2924void CalendarView::goToday()
2925{ 2925{
2926 if ( mViewManager->currentView()->isMonthView() ) 2926 if ( mViewManager->currentView()->isMonthView() )
2927 mNavigator->selectTodayMonth(); 2927 mNavigator->selectTodayMonth();
2928 else 2928 else
2929 mNavigator->selectToday(); 2929 mNavigator->selectToday();
2930} 2930}
2931 2931
2932void CalendarView::goNext() 2932void CalendarView::goNext()
2933{ 2933{
2934 mNavigator->selectNext(); 2934 mNavigator->selectNext();
2935} 2935}
2936 2936
2937void CalendarView::goPrevious() 2937void CalendarView::goPrevious()
2938{ 2938{
2939 mNavigator->selectPrevious(); 2939 mNavigator->selectPrevious();
2940} 2940}
2941void CalendarView::goNextMonth() 2941void CalendarView::goNextMonth()
2942{ 2942{
2943 mNavigator->selectNextMonth(); 2943 mNavigator->selectNextMonth();
2944} 2944}
2945 2945
2946void CalendarView::goPreviousMonth() 2946void CalendarView::goPreviousMonth()
2947{ 2947{
2948 mNavigator->selectPreviousMonth(); 2948 mNavigator->selectPreviousMonth();
2949} 2949}
2950 2950
2951void CalendarView::updateConfig() 2951void CalendarView::updateConfig()
2952{ 2952{
2953 if ( KOPrefs::instance()->mUseAppColors ) 2953 if ( KOPrefs::instance()->mUseAppColors )
2954 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2954 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2955 emit configChanged(); 2955 emit configChanged();
2956 mTodoList->updateConfig(); 2956 mTodoList->updateConfig();
2957 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2957 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2958 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2958 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2959 // To make the "fill window" configurations work 2959 // To make the "fill window" configurations work
2960 //mViewManager->raiseCurrentView(); 2960 //mViewManager->raiseCurrentView();
2961} 2961}
2962 2962
2963 2963
2964void CalendarView::eventChanged(Event *event) 2964void CalendarView::eventChanged(Event *event)
2965{ 2965{
2966 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2966 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2967 //updateUnmanagedViews(); 2967 //updateUnmanagedViews();
2968} 2968}
2969 2969
2970void CalendarView::eventAdded(Event *event) 2970void CalendarView::eventAdded(Event *event)
2971{ 2971{
2972 changeEventDisplay(event,KOGlobals::EVENTADDED); 2972 changeEventDisplay(event,KOGlobals::EVENTADDED);
2973} 2973}
2974 2974
2975void CalendarView::eventToBeDeleted(Event *) 2975void CalendarView::eventToBeDeleted(Event *)
2976{ 2976{
2977 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2977 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2978} 2978}
2979 2979
2980void CalendarView::eventDeleted() 2980void CalendarView::eventDeleted()
2981{ 2981{
2982 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2982 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2983} 2983}
2984void CalendarView::changeTodoDisplay(Todo *which, int action) 2984void CalendarView::changeTodoDisplay(Todo *which, int action)
2985{ 2985{
2986 changeIncidenceDisplay((Incidence *)which, action); 2986 changeIncidenceDisplay((Incidence *)which, action);
2987 mDateNavigator->updateView(); //LR 2987 mDateNavigator->updateView(); //LR
2988 //mDialogManager->updateSearchDialog(); 2988 //mDialogManager->updateSearchDialog();
2989 2989
2990 if (which) { 2990 if (which) {
2991 mViewManager->updateWNview(); 2991 mViewManager->updateWNview();
2992 //mTodoList->updateView(); 2992 //mTodoList->updateView();
2993 } 2993 }
2994 2994
2995} 2995}
2996 2996
2997void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2997void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2998{ 2998{
2999 updateUnmanagedViews(); 2999 updateUnmanagedViews();
3000 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 3000 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
3001 if ( action == KOGlobals::EVENTDELETED ) { //delete 3001 if ( action == KOGlobals::EVENTDELETED ) { //delete
3002 mCalendar->checkAlarmForIncidence( 0, true ); 3002 mCalendar->checkAlarmForIncidence( 0, true );
3003 if ( mEventViewerDialog ) 3003 if ( mEventViewerDialog )
3004 mEventViewerDialog->hide(); 3004 mEventViewerDialog->hide();
3005 } 3005 }
3006 else 3006 else
3007 mCalendar->checkAlarmForIncidence( which , false ); 3007 mCalendar->checkAlarmForIncidence( which , false );
3008} 3008}
3009 3009
3010// most of the changeEventDisplays() right now just call the view's 3010// most of the changeEventDisplays() right now just call the view's
3011// total update mode, but they SHOULD be recoded to be more refresh-efficient. 3011// total update mode, but they SHOULD be recoded to be more refresh-efficient.
3012void CalendarView::changeEventDisplay(Event *which, int action) 3012void CalendarView::changeEventDisplay(Event *which, int action)
3013{ 3013{
3014 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 3014 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
3015 changeIncidenceDisplay((Incidence *)which, action); 3015 changeIncidenceDisplay((Incidence *)which, action);
3016 static bool clearallviews = false; 3016 static bool clearallviews = false;
3017 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3017 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3018 if ( clearallviews ) { 3018 if ( clearallviews ) {
3019 clearAllViews(); 3019 clearAllViews();
3020 clearallviews = false; 3020 clearallviews = false;
3021 } 3021 }
3022 return; 3022 return;
3023 } 3023 }
3024 clearallviews = true; 3024 clearallviews = true;
3025 mDateNavigator->updateView(); 3025 mDateNavigator->updateView();
3026 //mDialogManager->updateSearchDialog(); 3026 //mDialogManager->updateSearchDialog();
3027 if (which) { 3027 if (which) {
3028 // If there is an event view visible update the display 3028 // If there is an event view visible update the display
3029 mViewManager->currentView()->changeEventDisplay(which,action); 3029 mViewManager->currentView()->changeEventDisplay(which,action);
3030 // TODO: check, if update needed 3030 // TODO: check, if update needed
3031 // if (which->getTodoStatus()) { 3031 // if (which->getTodoStatus()) {
3032 mTodoList->updateView(); 3032 mTodoList->updateView();
3033 if ( action != KOGlobals::EVENTDELETED && KOPrefs::instance()->mDetectConflicts ) { 3033 if ( action != KOGlobals::EVENTDELETED && KOPrefs::instance()->mDetectConflicts ) {
3034 mConflictingEvent = which ; 3034 mConflictingEvent = which ;
3035 int time = 1000; 3035 int time = 1000;
3036#ifdef DESKTOP_VERSION 3036#ifdef DESKTOP_VERSION
3037 time = 500; 3037 time = 500;
3038#endif 3038#endif
3039 bool checkC = false; 3039 bool checkC = false;
3040 if ( mConflictingEvent->doesFloat() ) { 3040 if ( mConflictingEvent->doesFloat() ) {
3041 checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay 3041 checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay
3042 || KOPrefs::instance()->mCheckConflictsAllDayNonAD; 3042 || KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3043 } else { 3043 } else {
3044 checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay 3044 checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay
3045 || KOPrefs::instance()->mCheckConflictsNonADNonAD; 3045 || KOPrefs::instance()->mCheckConflictsNonADNonAD;
3046 } 3046 }
3047 if ( checkC ) 3047 if ( checkC )
3048 QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); 3048 QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) );
3049 } 3049 }
3050 // } 3050 // }
3051 } else { 3051 } else {
3052 mViewManager->currentView()->updateView(); 3052 mViewManager->currentView()->updateView();
3053 } 3053 }
3054} 3054}
3055void CalendarView::checkConflictForEvent() 3055void CalendarView::checkConflictForEvent()
3056{ 3056{
3057 3057
3058 if (!KOPrefs::instance()->mConfirm) 3058 if (!KOPrefs::instance()->mConfirm)
3059 return; 3059 return;
3060 if ( ! mConflictingEvent ) return; 3060 if ( ! mConflictingEvent ) return;
3061 Event * conflictingEvent = mConflictingEvent; 3061 Event * conflictingEvent = mConflictingEvent;
3062 mConflictingEvent = 0; 3062 mConflictingEvent = 0;
3063 QDateTime current = QDateTime::currentDateTime(); 3063 QDateTime current = QDateTime::currentDateTime();
3064 if ( ! conflictingEvent->matchTime( &current, 0 ) ) { 3064 if ( ! conflictingEvent->matchTime( &current, 0 ) ) {
3065 return; 3065 return;
3066 } 3066 }
3067 CalFilter *filterIN = 0; 3067 CalFilter *filterIN = 0;
3068 CalFilter *filterALL = 0; 3068 CalFilter *filterALL = 0;
3069 CalFilter *filter = mFilters.first(); 3069 CalFilter *filter = mFilters.first();
3070 while(filter) { 3070 while(filter) {
3071 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem) 3071 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem)
3072 filterIN = filter; 3072 filterIN = filter;
3073 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem ) 3073 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem )
3074 filterALL = filter; 3074 filterALL = filter;
3075 filter = mFilters.next(); 3075 filter = mFilters.next();
3076 } 3076 }
3077 if ( filterIN ) { 3077 if ( filterIN ) {
3078 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) { 3078 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) {
3079 return; 3079 return;
3080 } 3080 }
3081 } 3081 }
3082 QPtrList<Event> testlist = mCalendar->events(); 3082 QPtrList<Event> testlist = mCalendar->events();
3083 Event * test = testlist.first(); 3083 Event * test = testlist.first();
3084 QDateTime conflict; 3084 QDateTime conflict;
3085 QDateTime retVal; 3085 QDateTime retVal;
3086 bool found = false; 3086 bool found = false;
3087 Event * cE = 0; 3087 Event * cE = 0;
3088 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay; 3088 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay;
3089 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD; 3089 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3090 if ( !conflictingEvent->doesFloat() ) { 3090 if ( !conflictingEvent->doesFloat() ) {
3091 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay; 3091 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay;
3092 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD; 3092 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD;
3093 } 3093 }
3094 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 3094 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
3095 while ( test ) { 3095 while ( test ) {
3096 qApp->processEvents(); 3096 qApp->processEvents();
3097 bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad ); 3097 bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad );
3098 if ( !skip ) { 3098 if ( !skip ) {
3099 if ( filterALL ) { 3099 if ( filterALL ) {
3100 if ( !filterALL->filterCalendarItem( test ) ) { 3100 if ( !filterALL->filterCalendarItem( test ) ) {
3101 skip = true; 3101 skip = true;
3102 } 3102 }
3103 } 3103 }
3104 if ( !skip ) { 3104 if ( !skip ) {
3105 if ( found ) 3105 if ( found )
3106 skip = !test->matchTime( &current, &conflict ); 3106 skip = !test->matchTime( &current, &conflict );
3107 else 3107 else
3108 skip = !test->matchTime( &current, 0 ); 3108 skip = !test->matchTime( &current, 0 );
3109 if ( !skip ) { 3109 if ( !skip ) {
3110 if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) { 3110 if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
3111 if ( ! found ) { 3111 if ( ! found ) {
3112 conflict = retVal; 3112 conflict = retVal;
3113 cE = test; 3113 cE = test;
3114 } else { 3114 } else {
3115 if ( retVal < conflict ) { 3115 if ( retVal < conflict ) {
3116 conflict = retVal; 3116 conflict = retVal;
3117 cE = test; 3117 cE = test;
3118 } 3118 }
3119 } 3119 }
3120 found = true; 3120 found = true;
3121 } 3121 }
3122 } 3122 }
3123 } 3123 }
3124 } 3124 }
3125 test = testlist.next(); 3125 test = testlist.next();
3126 } 3126 }
3127 topLevelWidget()->setCaption( i18n("KO/Pi") ); 3127 topLevelWidget()->setCaption( i18n("KO/Pi") );
3128 if ( found ) { 3128 if ( found ) {
3129 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; 3129 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ;
3130 qApp->processEvents(); 3130 qApp->processEvents();
3131 int km = KMessageBox::warningContinueCancel(this,mess, 3131 int km = KMessageBox::warningContinueCancel(this,mess,
3132 i18n("KO/Pi Conflict detected"),i18n("Show date"),i18n("No problem!")); 3132 i18n("KO/Pi Conflict detected"),i18n("Show date"),i18n("No problem!"));
3133 if ( km != KMessageBox::Continue ) { 3133 if ( km != KMessageBox::Continue ) {
3134 return; 3134 return;
3135 } 3135 }
3136 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 3136 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
3137 mViewManager->showDayView(); 3137 mViewManager->showDayView();
3138 mNavigator->slotDaySelect( conflict.date() ); 3138 mNavigator->slotDaySelect( conflict.date() );
3139 int hour = conflict.time().hour(); 3139 int hour = conflict.time().hour();
3140 mViewManager->agendaView()->setStartHour( hour ); 3140 mViewManager->agendaView()->setStartHour( hour );
3141 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( conflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); 3141 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( conflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
3142 } else 3142 } else
3143 topLevelWidget()->setCaption( i18n("No conflict found") ); 3143 topLevelWidget()->setCaption( i18n("No conflict found") );
3144 return; 3144 return;
3145 3145
3146} 3146}
3147 3147
3148void CalendarView::updateTodoViews() 3148void CalendarView::updateTodoViews()
3149{ 3149{
3150 mTodoList->updateView(); 3150 mTodoList->updateView();
3151 mViewManager->currentView()->updateView(); 3151 mViewManager->currentView()->updateView();
3152 3152
3153} 3153}
3154 3154
3155 3155
3156 3156
3157void CalendarView::clearAllViews() 3157void CalendarView::clearAllViews()
3158{ 3158{
3159 mTodoList->clearList(); 3159 mTodoList->clearList();
3160 mViewManager->clearAllViews(); 3160 mViewManager->clearAllViews();
3161 SearchDialog * sd = mDialogManager->getSearchDialog(); 3161 SearchDialog * sd = mDialogManager->getSearchDialog();
3162 if ( sd ) { 3162 if ( sd ) {
3163 KOListView* kol = sd->listview(); 3163 KOListView* kol = sd->listview();
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 17248dc..07bfdbf 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -1,1274 +1,1279 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qheader.h> 25#include <qheader.h>
26#include <qcursor.h> 26#include <qcursor.h>
27#include <qwhatsthis.h> 27#include <qwhatsthis.h>
28#include <qdialog.h> 28#include <qdialog.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31 31
32#include <qinputdialog.h> 32#include <qinputdialog.h>
33 33
34#include <qvbox.h> 34#include <qvbox.h>
35#include <kdebug.h> 35#include <kdebug.h>
36#include "koprefs.h" 36#include "koprefs.h"
37#include <klocale.h> 37#include <klocale.h>
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kdateedit.h> 39#include <kdateedit.h>
40#include "ktimeedit.h" 40#include "ktimeedit.h"
41#include <kiconloader.h> 41#include <kiconloader.h>
42#include <kmessagebox.h> 42#include <kmessagebox.h>
43 43
44#include <libkcal/icaldrag.h> 44#include <libkcal/icaldrag.h>
45#include <libkcal/vcaldrag.h> 45#include <libkcal/vcaldrag.h>
46#include <libkcal/calfilter.h> 46#include <libkcal/calfilter.h>
47#include <libkcal/dndfactory.h> 47#include <libkcal/dndfactory.h>
48#include <libkcal/calendarresources.h> 48#include <libkcal/calendarresources.h>
49#include <libkcal/resourcecalendar.h> 49#include <libkcal/resourcecalendar.h>
50#include <kresources/resourceselectdialog.h> 50#include <kresources/resourceselectdialog.h>
51#include <libkcal/kincidenceformatter.h> 51#include <libkcal/kincidenceformatter.h>
52#ifndef DESKTOP_VERSION 52#ifndef DESKTOP_VERSION
53#include <qpe/qpeapplication.h> 53#include <qpe/qpeapplication.h>
54#else 54#else
55#include <qapplication.h> 55#include <qapplication.h>
56#endif 56#endif
57#ifndef KORG_NOPRINTER 57#ifndef KORG_NOPRINTER
58#include "calprinter.h" 58#include "calprinter.h"
59#endif 59#endif
60#include "docprefs.h" 60#include "docprefs.h"
61 61
62#include "kotodoview.h" 62#include "kotodoview.h"
63using namespace KOrg; 63using namespace KOrg;
64 64
65 65
66KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *name ) : 66KOStartTodoPrefs::KOStartTodoPrefs( QString sum, QWidget *parent, const char *name ) :
67 QDialog( parent, name, true ) 67 QDialog( parent, name, true )
68{ 68{
69 mStopAll = true; 69 mStopAll = true;
70 setCaption( i18n("Start todo") ); 70 setCaption( i18n("Start todo") );
71 QVBoxLayout* lay = new QVBoxLayout( this ); 71 QVBoxLayout* lay = new QVBoxLayout( this );
72 lay->setSpacing( 3 ); 72 lay->setSpacing( 3 );
73 lay->setMargin( 3 ); 73 lay->setMargin( 3 );
74 QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this ); 74 QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( sum ), this );
75 lay->addWidget( lab ); 75 lay->addWidget( lab );
76 lab->setAlignment( AlignCenter ); 76 lab->setAlignment( AlignCenter );
77 77
78 QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this ); 78 QPushButton * ok = new QPushButton( i18n("Start this todo\nand stop all running"), this );
79 lay->addWidget( ok ); 79 lay->addWidget( ok );
80 ok->setDefault( true ); 80 ok->setDefault( true );
81 QPushButton * start = new QPushButton( i18n("Start todo"), this ); 81 QPushButton * start = new QPushButton( i18n("Start todo"), this );
82 lay->addWidget( start ); 82 lay->addWidget( start );
83 QPushButton * cancel = new QPushButton( i18n("Cancel - do not start"), this ); 83 QPushButton * cancel = new QPushButton( i18n("Cancel - do not start"), this );
84 lay->addWidget( cancel ); 84 lay->addWidget( cancel );
85 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 85 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
86 connect ( start,SIGNAL(clicked() ),this , SLOT ( doStop() ) ); 86 connect ( start,SIGNAL(clicked() ),this , SLOT ( doStop() ) );
87 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 87 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
88 resize( sizeHint() ); 88 resize( sizeHint() );
89 89
90} 90}
91void KOStartTodoPrefs::doStop() 91void KOStartTodoPrefs::doStop()
92{ 92{
93 mStopAll = false; 93 mStopAll = false;
94 accept(); 94 accept();
95} 95}
96KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) : 96KOStopTodoPrefs::KOStopTodoPrefs( Todo* todo, QWidget *parent, const char *name ) :
97 QDialog( parent, name, true ) 97 QDialog( parent, name, true )
98{ 98{
99 mTodo = todo; 99 mTodo = todo;
100 setCaption( i18n("Stop todo") ); 100 setCaption( i18n("Stop todo") );
101 QVBoxLayout* lay = new QVBoxLayout( this ); 101 QVBoxLayout* lay = new QVBoxLayout( this );
102 lay->setSpacing( 3 ); 102 lay->setSpacing( 3 );
103 lay->setMargin( 3 ); 103 lay->setMargin( 3 );
104 QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( todo->summary() ), this ); 104 QLabel * lab = new QLabel( i18n("<b>%1\n</b>").arg( todo->summary() ), this );
105 lay->addWidget( lab ); 105 lay->addWidget( lab );
106 lab->setAlignment( AlignHCenter ); 106 lab->setAlignment( AlignHCenter );
107 lab = new QLabel( i18n("Additional Comment:"), this ); 107 lab = new QLabel( i18n("Additional Comment:"), this );
108 lay->addWidget( lab ); 108 lay->addWidget( lab );
109 mComment = new QLineEdit( this ); 109 mComment = new QLineEdit( this );
110 lay->addWidget( mComment ); 110 lay->addWidget( mComment );
111 QHBox * start = new QHBox ( this ); 111 QHBox * start = new QHBox ( this );
112 lay->addWidget( start ); 112 lay->addWidget( start );
113 lab = new QLabel( i18n("Start:"), start ); 113 lab = new QLabel( i18n("Start:"), start );
114 QHBox * end = new QHBox ( this ); 114 QHBox * end = new QHBox ( this );
115 lay->addWidget( end ); 115 lay->addWidget( end );
116 lab = new QLabel( i18n("End:"), end ); 116 lab = new QLabel( i18n("End:"), end );
117 sde = new KDateEdit( start ); 117 sde = new KDateEdit( start );
118 ste = new KOTimeEdit( start ); 118 ste = new KOTimeEdit( start );
119 connect ( sde,SIGNAL(setTimeTo( QTime ) ),ste , SLOT ( setTime(QTime ) ) ); 119 connect ( sde,SIGNAL(setTimeTo( QTime ) ),ste , SLOT ( setTime(QTime ) ) );
120 ede = new KDateEdit( end ); 120 ede = new KDateEdit( end );
121 ete = new KOTimeEdit(end ); 121 ete = new KOTimeEdit(end );
122 connect ( ede,SIGNAL(setTimeTo( QTime ) ),ete , SLOT ( setTime(QTime ) ) ); 122 connect ( ede,SIGNAL(setTimeTo( QTime ) ),ete , SLOT ( setTime(QTime ) ) );
123 sde->setDate( mTodo->runStart().date() ); 123 sde->setDate( mTodo->runStart().date() );
124 ste->setTime( mTodo->runStart().time() ); 124 ste->setTime( mTodo->runStart().time() );
125 ede->setDate( QDate::currentDate()); 125 ede->setDate( QDate::currentDate());
126 ete->setTime( QTime::currentTime() ); 126 ete->setTime( QTime::currentTime() );
127 QPushButton * ok = new QPushButton( i18n("Stop and save"), this ); 127 QPushButton * ok = new QPushButton( i18n("Stop and save"), this );
128 lay->addWidget( ok ); 128 lay->addWidget( ok );
129 ok->setDefault( true ); 129 ok->setDefault( true );
130 QPushButton * cancel = new QPushButton( i18n("Continue running"), this ); 130 QPushButton * cancel = new QPushButton( i18n("Continue running"), this );
131 lay->addWidget( cancel ); 131 lay->addWidget( cancel );
132 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 132 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
133 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 133 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
134 ok = new QPushButton( i18n("Stop - do not save"), this ); 134 ok = new QPushButton( i18n("Stop - do not save"), this );
135 connect ( ok,SIGNAL(clicked() ),this , SLOT ( doNotSave() ) ); 135 connect ( ok,SIGNAL(clicked() ),this , SLOT ( doNotSave() ) );
136 lay->addWidget( ok ); 136 lay->addWidget( ok );
137 if (QApplication::desktop()->width() < 320 ) 137 if (QApplication::desktop()->width() < 320 )
138 resize( 240, sizeHint().height() ); 138 resize( 240, sizeHint().height() );
139 else 139 else
140 resize( 320, sizeHint().height() ); 140 resize( 320, sizeHint().height() );
141 141
142} 142}
143 143
144void KOStopTodoPrefs::accept() 144void KOStopTodoPrefs::accept()
145{ 145{
146 QDateTime start = QDateTime( sde->date(), ste->getTime() ); 146 QDateTime start = QDateTime( sde->date(), ste->getTime() );
147 QDateTime stop = QDateTime( ede->date(), ete->getTime() ); 147 QDateTime stop = QDateTime( ede->date(), ete->getTime() );
148 if ( start > stop ) { 148 if ( start > stop ) {
149 KMessageBox::sorry(this, 149 KMessageBox::sorry(this,
150 i18n("The start time is\nafter the end time!"), 150 i18n("The start time is\nafter the end time!"),
151 i18n("Time mismatch!")); 151 i18n("Time mismatch!"));
152 return; 152 return;
153 } 153 }
154 mTodo->saveRunningInfo( mComment->text(), start, stop ); 154 mTodo->saveRunningInfo( mComment->text(), start, stop );
155 QDialog::accept(); 155 QDialog::accept();
156} 156}
157void KOStopTodoPrefs::doNotSave() 157void KOStopTodoPrefs::doNotSave()
158{ 158{
159 int result = KMessageBox::warningContinueCancel(this, 159 int result = KMessageBox::warningContinueCancel(this,
160 i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") ); 160 i18n("Do you really want to set\nthe state to stopped\nwithout saving the data?"),mTodo->summary(),i18n("Yes, stop todo") );
161 if (result != KMessageBox::Continue) return; 161 if (result != KMessageBox::Continue) return;
162 mTodo->stopRunning(); 162 mTodo->stopRunning();
163 QDialog::accept(); 163 QDialog::accept();
164} 164}
165 165
166 166
167class KOTodoViewWhatsThis :public QWhatsThis 167class KOTodoViewWhatsThis :public QWhatsThis
168{ 168{
169public: 169public:
170 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; 170 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
171 171
172protected: 172protected:
173 virtual QString text( const QPoint& p) 173 virtual QString text( const QPoint& p)
174 { 174 {
175 return _view->getWhatsThisText(p) ; 175 return _view->getWhatsThisText(p) ;
176 } 176 }
177private: 177private:
178 QWidget* _wid; 178 QWidget* _wid;
179 KOTodoView * _view; 179 KOTodoView * _view;
180}; 180};
181 181
182KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, 182KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent,
183 const char *name) : 183 const char *name) :
184 KListView(parent,name) 184 KListView(parent,name)
185{ 185{
186 mName = QString ( name ); 186 mName = QString ( name );
187 mCalendar = calendar; 187 mCalendar = calendar;
188#ifndef DESKTOP_VERSION 188#ifndef DESKTOP_VERSION
189 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 189 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
190#endif 190#endif
191 mOldCurrent = 0; 191 mOldCurrent = 0;
192 mMousePressed = false; 192 mMousePressed = false;
193 193
194 setAcceptDrops(true); 194 setAcceptDrops(true);
195 viewport()->setAcceptDrops(true); 195 viewport()->setAcceptDrops(true);
196 int size = 16; 196 int size = 16;
197 if (qApp->desktop()->width() < 300 ) 197 if (qApp->desktop()->width() < 300 )
198 size = 12; 198 size = 12;
199 setTreeStepSize( size + 6 ); 199 setTreeStepSize( size + 6 );
200 200
201} 201}
202 202
203void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) 203void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e)
204{ 204{
205#ifndef KORG_NODND 205#ifndef KORG_NODND
206// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; 206// kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl;
207 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 207 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
208 !QTextDrag::canDecode( e ) ) { 208 !QTextDrag::canDecode( e ) ) {
209 e->ignore(); 209 e->ignore();
210 return; 210 return;
211 } 211 }
212 212
213 mOldCurrent = currentItem(); 213 mOldCurrent = currentItem();
214#endif 214#endif
215} 215}
216 216
217 217
218void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) 218void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e)
219{ 219{
220#ifndef KORG_NODND 220#ifndef KORG_NODND
221// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; 221// kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl;
222 222
223 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 223 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
224 !QTextDrag::canDecode( e ) ) { 224 !QTextDrag::canDecode( e ) ) {
225 e->ignore(); 225 e->ignore();
226 return; 226 return;
227 } 227 }
228 228
229 e->accept(); 229 e->accept();
230#endif 230#endif
231} 231}
232 232
233void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) 233void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *)
234{ 234{
235#ifndef KORG_NODND 235#ifndef KORG_NODND
236// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl; 236// kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl;
237 237
238 setCurrentItem(mOldCurrent); 238 setCurrentItem(mOldCurrent);
239 setSelected(mOldCurrent,true); 239 setSelected(mOldCurrent,true);
240#endif 240#endif
241} 241}
242 242
243void KOTodoListView::contentsDropEvent(QDropEvent *e) 243void KOTodoListView::contentsDropEvent(QDropEvent *e)
244{ 244{
245#ifndef KORG_NODND 245#ifndef KORG_NODND
246// kdDebug() << "KOTodoListView::contentsDropEvent" << endl; 246// kdDebug() << "KOTodoListView::contentsDropEvent" << endl;
247 247
248 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && 248 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
249 !QTextDrag::canDecode( e ) ) { 249 !QTextDrag::canDecode( e ) ) {
250 e->ignore(); 250 e->ignore();
251 return; 251 return;
252 } 252 }
253 253
254 DndFactory factory( mCalendar ); 254 DndFactory factory( mCalendar );
255 Todo *todo = factory.createDropTodo(e); 255 Todo *todo = factory.createDropTodo(e);
256 256
257 if (todo) { 257 if (todo) {
258 e->acceptAction(); 258 e->acceptAction();
259 259
260 KOTodoViewItem *destination = 260 KOTodoViewItem *destination =
261 (KOTodoViewItem *)itemAt(contentsToViewport(e->pos())); 261 (KOTodoViewItem *)itemAt(contentsToViewport(e->pos()));
262 Todo *destinationEvent = 0; 262 Todo *destinationEvent = 0;
263 if (destination) destinationEvent = destination->todo(); 263 if (destination) destinationEvent = destination->todo();
264 264
265 Todo *existingTodo = mCalendar->todo(todo->uid()); 265 Todo *existingTodo = mCalendar->todo(todo->uid());
266 266
267 if(existingTodo) { 267 if(existingTodo) {
268 Incidence *to = destinationEvent; 268 Incidence *to = destinationEvent;
269 while(to) { 269 while(to) {
270 if (to->uid() == todo->uid()) { 270 if (to->uid() == todo->uid()) {
271 KMessageBox::sorry(this, 271 KMessageBox::sorry(this,
272 i18n("Cannot move Todo to itself\nor a child of itself"), 272 i18n("Cannot move Todo to itself\nor a child of itself"),
273 i18n("Drop Todo")); 273 i18n("Drop Todo"));
274 delete todo; 274 delete todo;
275 return; 275 return;
276 } 276 }
277 to = to->relatedTo(); 277 to = to->relatedTo();
278 } 278 }
279 internalDrop = true; 279 internalDrop = true;
280 if ( destinationEvent ) 280 if ( destinationEvent )
281 reparentTodoSignal( destinationEvent, existingTodo ); 281 reparentTodoSignal( destinationEvent, existingTodo );
282 else 282 else
283 unparentTodoSignal(existingTodo); 283 unparentTodoSignal(existingTodo);
284 delete todo; 284 delete todo;
285 } else { 285 } else {
286 mCalendar->addTodo(todo); 286 mCalendar->addTodo(todo);
287 emit todoDropped(todo, KOGlobals::EVENTADDED); 287 emit todoDropped(todo, KOGlobals::EVENTADDED);
288 if ( destinationEvent ) 288 if ( destinationEvent )
289 reparentTodoSignal( destinationEvent, todo ); 289 reparentTodoSignal( destinationEvent, todo );
290 } 290 }
291 } 291 }
292 else { 292 else {
293 QString text; 293 QString text;
294 if (QTextDrag::decode(e,text)) { 294 if (QTextDrag::decode(e,text)) {
295 //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); 295 //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) );
296 KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); 296 KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) ));
297 qDebug("Dropped : " + text); 297 qDebug("Dropped : " + text);
298 QStringList emails = QStringList::split(",",text); 298 QStringList emails = QStringList::split(",",text);
299 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { 299 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
300 int pos = (*it).find("<"); 300 int pos = (*it).find("<");
301 QString name = (*it).left(pos); 301 QString name = (*it).left(pos);
302 QString email = (*it).mid(pos); 302 QString email = (*it).mid(pos);
303 if (!email.isEmpty() && todoi) { 303 if (!email.isEmpty() && todoi) {
304 todoi->todo()->addAttendee(new Attendee(name,email)); 304 todoi->todo()->addAttendee(new Attendee(name,email));
305 } 305 }
306 } 306 }
307 } 307 }
308 else { 308 else {
309 qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); 309 qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable ");
310 e->ignore(); 310 e->ignore();
311 } 311 }
312 } 312 }
313#endif 313#endif
314} 314}
315void KOTodoListView::wheelEvent (QWheelEvent *e) 315void KOTodoListView::wheelEvent (QWheelEvent *e)
316{ 316{
317 QListView::wheelEvent (e); 317 QListView::wheelEvent (e);
318} 318}
319 319
320void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) 320void KOTodoListView::contentsMousePressEvent(QMouseEvent* e)
321{ 321{
322 322
323 QPoint p(contentsToViewport(e->pos())); 323 QPoint p(contentsToViewport(e->pos()));
324 QListViewItem *i = itemAt(p); 324 QListViewItem *i = itemAt(p);
325 bool rootClicked = true; 325 bool rootClicked = true;
326 if (i) { 326 if (i) {
327 // if the user clicked into the root decoration of the item, don't 327 // if the user clicked into the root decoration of the item, don't
328 // try to start a drag! 328 // try to start a drag!
329 int X = p.x(); 329 int X = p.x();
330 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); 330 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() );
331 if (X > header()->sectionPos(0) + 331 if (X > header()->sectionPos(0) +
332 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + 332 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
333 itemMargin() +i->height()|| 333 itemMargin() +i->height()||
334 X < header()->sectionPos(0)) { 334 X < header()->sectionPos(0)) {
335 rootClicked = false; 335 rootClicked = false;
336 } 336 }
337 } else { 337 } else {
338 rootClicked = false; 338 rootClicked = false;
339 } 339 }
340#ifndef KORG_NODND 340#ifndef KORG_NODND
341 mMousePressed = false; 341 mMousePressed = false;
342 if (! rootClicked && !( e->button() == RightButton) ) { 342 if (! rootClicked && !( e->button() == RightButton) ) {
343 mPressPos = e->pos(); 343 mPressPos = e->pos();
344 mMousePressed = true; 344 mMousePressed = true;
345 } else { 345 } else {
346 mMousePressed = false; 346 mMousePressed = false;
347 } 347 }
348#endif 348#endif
349 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); 349 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked);
350#ifndef DESKTOP_VERSION 350#ifndef DESKTOP_VERSION
351 if (!( e->button() == RightButton && rootClicked) ) 351 if (!( e->button() == RightButton && rootClicked) )
352 QListView::contentsMousePressEvent(e); 352 QListView::contentsMousePressEvent(e);
353#else 353#else
354 QListView::contentsMousePressEvent(e); 354 QListView::contentsMousePressEvent(e);
355#endif 355#endif
356} 356}
357void KOTodoListView::paintEvent(QPaintEvent* e) 357void KOTodoListView::paintEvent(QPaintEvent* e)
358{ 358{
359 emit paintNeeded(); 359 emit paintNeeded();
360 QListView::paintEvent( e); 360 QListView::paintEvent( e);
361} 361}
362void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) 362void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
363{ 363{
364 364
365#ifndef KORG_NODND 365#ifndef KORG_NODND
366 //QListView::contentsMouseMoveEvent(e); 366 //QListView::contentsMouseMoveEvent(e);
367 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > 367 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
368 QApplication::startDragDistance()*3) { 368 QApplication::startDragDistance()*3) {
369 mMousePressed = false; 369 mMousePressed = false;
370 QListViewItem *item = itemAt(contentsToViewport(mPressPos)); 370 QListViewItem *item = itemAt(contentsToViewport(mPressPos));
371 if (item) { 371 if (item) {
372 DndFactory factory( mCalendar ); 372 DndFactory factory( mCalendar );
373 ICalDrag *vd = factory.createDrag( 373 ICalDrag *vd = factory.createDrag(
374 ((KOTodoViewItem *)item)->todo(),viewport()); 374 ((KOTodoViewItem *)item)->todo(),viewport());
375 internalDrop = false; 375 internalDrop = false;
376 // we cannot do any senseful here, because the DnD is still broken in Qt 376 // we cannot do any senseful here, because the DnD is still broken in Qt
377 if (vd->drag()) { 377 if (vd->drag()) {
378 if ( !internalDrop ) { 378 if ( !internalDrop ) {
379 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); 379 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() );
380 qDebug("Dnd: External move: Delete drag source "); 380 qDebug("Dnd: External move: Delete drag source ");
381 } else 381 } else
382 qDebug("Dnd: Internal move "); 382 qDebug("Dnd: Internal move ");
383 383
384 } else { 384 } else {
385 if ( !internalDrop ) { 385 if ( !internalDrop ) {
386 qDebug("Dnd: External Copy"); 386 qDebug("Dnd: External Copy");
387 } else 387 } else
388 qDebug("DnD: Internal copy: Copy pending"); 388 qDebug("DnD: Internal copy: Copy pending");
389 } 389 }
390 } 390 }
391 } 391 }
392#endif 392#endif
393} 393}
394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) 394void KOTodoListView::keyReleaseEvent ( QKeyEvent *e )
395{ 395{
396 if ( !e->isAutoRepeat() ) { 396 if ( !e->isAutoRepeat() ) {
397 mFlagKeyPressed = false; 397 mFlagKeyPressed = false;
398 } 398 }
399} 399}
400 400
401 401
402void KOTodoListView::keyPressEvent ( QKeyEvent * e ) 402void KOTodoListView::keyPressEvent ( QKeyEvent * e )
403{ 403{
404 qApp->processEvents(); 404 qApp->processEvents();
405 if ( !isVisible() ) { 405 if ( !isVisible() ) {
406 e->ignore(); 406 e->ignore();
407 return; 407 return;
408 } 408 }
409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
410 e->ignore(); 410 e->ignore();
411 // qDebug(" ignore %d",e->isAutoRepeat() ); 411 // qDebug(" ignore %d",e->isAutoRepeat() );
412 return; 412 return;
413 } 413 }
414 if (! e->isAutoRepeat() ) 414 if (! e->isAutoRepeat() )
415 mFlagKeyPressed = true; 415 mFlagKeyPressed = true;
416 QListViewItem* cn; 416 QListViewItem* cn;
417 if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") { 417 if ( (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) && mName != "todolistsmall") {
418 cn = currentItem(); 418 cn = currentItem();
419 if ( cn ) { 419 if ( cn ) {
420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
421 if ( ci ){ 421 if ( ci ){
422 if ( e->state() == ShiftButton ) 422 if ( e->state() == ShiftButton )
423 ci->setOn( false ); 423 ci->setOn( false );
424 else 424 else
425 ci->setOn( true ); 425 ci->setOn( true );
426 cn = cn->itemBelow(); 426 cn = cn->itemBelow();
427 if ( cn ) { 427 if ( cn ) {
428 setCurrentItem ( cn ); 428 setCurrentItem ( cn );
429 ensureItemVisible ( cn ); 429 ensureItemVisible ( cn );
430 } 430 }
431 431
432 } 432 }
433 } 433 }
434 434
435 e->accept(); 435 e->accept();
436 return; 436 return;
437 } 437 }
438 438
439 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 439 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
440 switch ( e->key() ) { 440 switch ( e->key() ) {
441 case Qt::Key_Down: 441 case Qt::Key_Down:
442 case Qt::Key_Up: 442 case Qt::Key_Up:
443 QListView::keyPressEvent ( e ); 443 QListView::keyPressEvent ( e );
444 e->accept(); 444 e->accept();
445 break; 445 break;
446 case Qt::Key_Left: 446 case Qt::Key_Left:
447 case Qt::Key_Right: 447 case Qt::Key_Right:
448 QListView::keyPressEvent ( e ); 448 QListView::keyPressEvent ( e );
449 e->accept(); 449 e->accept();
450 return; 450 return;
451 break; 451 break;
452 default: 452 default:
453 e->ignore(); 453 e->ignore();
454 break; 454 break;
455 } 455 }
456 return; 456 return;
457 } 457 }
458 e->ignore(); 458 e->ignore();
459} 459}
460void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 460void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
461{ 461{
462 QListView::contentsMouseReleaseEvent(e); 462 QListView::contentsMouseReleaseEvent(e);
463 mMousePressed = false; 463 mMousePressed = false;
464} 464}
465 465
466void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 466void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
467{ 467{
468 if (!e) return; 468 if (!e) return;
469 469
470 QPoint vp = contentsToViewport(e->pos()); 470 QPoint vp = contentsToViewport(e->pos());
471 471
472 QListViewItem *item = itemAt(vp); 472 QListViewItem *item = itemAt(vp);
473 473
474 emit double_Clicked(item); 474 emit double_Clicked(item);
475 if (!item) return; 475 if (!item) return;
476 476
477 emit doubleClicked(item,vp,0); 477 emit doubleClicked(item,vp,0);
478} 478}
479 479
480///////////////////////////////////////////////////////////////////////////// 480/////////////////////////////////////////////////////////////////////////////
481 481
482KOQuickTodo::KOQuickTodo(QWidget *parent) : 482KOQuickTodo::KOQuickTodo(QWidget *parent) :
483 QLineEdit(parent) 483 QLineEdit(parent)
484{ 484{
485 setText(i18n("Click to add new Todo")); 485 setText(i18n("Click to add new Todo"));
486 setFocusPolicy ( QWidget::ClickFocus ); 486 setFocusPolicy ( QWidget::ClickFocus );
487} 487}
488 488
489void KOQuickTodo::focusInEvent(QFocusEvent *ev) 489void KOQuickTodo::focusInEvent(QFocusEvent *ev)
490{ 490{
491 if ( text()==i18n("Click to add new Todo") ) 491 if ( text()==i18n("Click to add new Todo") )
492 setText(""); 492 setText("");
493 QLineEdit::focusInEvent(ev); 493 QLineEdit::focusInEvent(ev);
494} 494}
495 495
496void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 496void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
497{ 497{
498 setText(i18n("Click to add new Todo")); 498 setText(i18n("Click to add new Todo"));
499 QLineEdit::focusOutEvent(ev); 499 QLineEdit::focusOutEvent(ev);
500} 500}
501 501
502///////////////////////////////////////////////////////////////////////////// 502/////////////////////////////////////////////////////////////////////////////
503 503
504KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 504KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
505 KOrg::BaseView(calendar,parent,name) 505 KOrg::BaseView(calendar,parent,name)
506{ 506{
507
508 mCurItem = 0;
509 mCurItemRootParent = 0;
510 mCurItemParent = 0;
511 mCurItemAbove = 0;
507 mActiveItem = 0; 512 mActiveItem = 0;
508 mCategoryPopupMenu = 0; 513 mCategoryPopupMenu = 0;
509 mPendingUpdateBeforeRepaint = false; 514 mPendingUpdateBeforeRepaint = false;
510 isFlatDisplay = false; 515 isFlatDisplay = false;
511 mNavigator = 0; 516 mNavigator = 0;
512 QBoxLayout *topLayout = new QVBoxLayout(this); 517 QBoxLayout *topLayout = new QVBoxLayout(this);
513 mName = QString ( name ); 518 mName = QString ( name );
514 mBlockUpdate = false; 519 mBlockUpdate = false;
515 mQuickBar = new QWidget( this ); 520 mQuickBar = new QWidget( this );
516 topLayout->addWidget(mQuickBar); 521 topLayout->addWidget(mQuickBar);
517 522
518 mQuickAdd = new KOQuickTodo(mQuickBar); 523 mQuickAdd = new KOQuickTodo(mQuickBar);
519 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); 524 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
520 quickLayout->addWidget( mQuickAdd ); 525 quickLayout->addWidget( mQuickAdd );
521 mNewSubBut = new QPushButton( "sub",mQuickBar ); 526 mNewSubBut = new QPushButton( "sub",mQuickBar );
522 QPushButton * s_done = new QPushButton( "D",mQuickBar ); 527 QPushButton * s_done = new QPushButton( "D",mQuickBar );
523 QPushButton * s_run = new QPushButton( "R",mQuickBar ); 528 QPushButton * s_run = new QPushButton( "R",mQuickBar );
524 QPushButton * allopen = new QPushButton( "O",mQuickBar ); 529 QPushButton * allopen = new QPushButton( "O",mQuickBar );
525 QPushButton * allclose = new QPushButton( "C",mQuickBar ); 530 QPushButton * allclose = new QPushButton( "C",mQuickBar );
526 QPushButton * flat = new QPushButton( "F",mQuickBar ); 531 QPushButton * flat = new QPushButton( "F",mQuickBar );
527 532
528 int fixwid = mQuickAdd->sizeHint().height(); 533 int fixwid = mQuickAdd->sizeHint().height();
529 int fixhei = fixwid; 534 int fixhei = fixwid;
530 if ( QApplication::desktop()->width() > 800 ) 535 if ( QApplication::desktop()->width() > 800 )
531 fixwid = (fixwid*3)/2; 536 fixwid = (fixwid*3)/2;
532 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); 537 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
533 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); 538 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
534 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); 539 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
535 s_done->setPixmap( SmallIcon("greenhook16")); 540 s_done->setPixmap( SmallIcon("greenhook16"));
536 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); 541 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
537 s_run->setPixmap( SmallIcon("ko16old")); 542 s_run->setPixmap( SmallIcon("ko16old"));
538 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); 543 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
539 544
540 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); 545 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
541 546
542 mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() ); 547 mNewSubBut->setFixedWidth(mNewSubBut->sizeHint().width() );
543 mNewSubBut->setEnabled( false ); 548 mNewSubBut->setEnabled( false );
544 flat->setFixedWidth( fixwid ); 549 flat->setFixedWidth( fixwid );
545 s_done->setFixedWidth( fixwid ); 550 s_done->setFixedWidth( fixwid );
546 allopen->setFixedWidth( fixwid ); 551 allopen->setFixedWidth( fixwid );
547 allclose->setFixedWidth( fixwid ); 552 allclose->setFixedWidth( fixwid );
548 s_run->setFixedWidth( fixwid ); 553 s_run->setFixedWidth( fixwid );
549 554
550 flat->setFixedHeight(fixhei ); 555 flat->setFixedHeight(fixhei );
551 s_done->setFixedHeight(fixhei ); 556 s_done->setFixedHeight(fixhei );
552 allopen->setFixedHeight(fixhei ); 557 allopen->setFixedHeight(fixhei );
553 allclose->setFixedHeight(fixhei ); 558 allclose->setFixedHeight(fixhei );
554 s_run->setFixedHeight(fixhei ); 559 s_run->setFixedHeight(fixhei );
555 mNewSubBut->setFixedHeight(fixhei ); 560 mNewSubBut->setFixedHeight(fixhei );
556 561
557 flat->setFocusPolicy( NoFocus ); 562 flat->setFocusPolicy( NoFocus );
558 s_done->setFocusPolicy( NoFocus ); 563 s_done->setFocusPolicy( NoFocus );
559 allopen->setFocusPolicy( NoFocus ); 564 allopen->setFocusPolicy( NoFocus );
560 allclose->setFocusPolicy( NoFocus ); 565 allclose->setFocusPolicy( NoFocus );
561 s_run->setFocusPolicy( NoFocus ); 566 s_run->setFocusPolicy( NoFocus );
562 mNewSubBut->setFocusPolicy( NoFocus ); 567 mNewSubBut->setFocusPolicy( NoFocus );
563 568
564 QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) ); 569 QWhatsThis::add( flat, i18n("Click this button to display all todos in a <b>flat</b> hierarchy" ) );
565 QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) ); 570 QWhatsThis::add( allopen, i18n("Click this button to display all todos <b>openend</b>" ) );
566 QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) ); 571 QWhatsThis::add( allclose, i18n("Click this button to display all todos <b>closed</b>" ) );
567 QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) ); 572 QWhatsThis::add( s_run, i18n("Click this button to toggle show/hide <b>running</b> todos" ) );
568 QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) ); 573 QWhatsThis::add( mNewSubBut, i18n("Click this button to add a new subtodo to the currently selected todo" ) );
569 QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) ); 574 QWhatsThis::add( s_done, i18n("Click this button to toggle show/hide <b>completed</b> todos" ) );
570 575
571 quickLayout->addWidget( mNewSubBut ); 576 quickLayout->addWidget( mNewSubBut );
572 quickLayout->addWidget( s_done ); 577 quickLayout->addWidget( s_done );
573 quickLayout->addWidget( s_run ); 578 quickLayout->addWidget( s_run );
574 quickLayout->addWidget( allopen ); 579 quickLayout->addWidget( allopen );
575 quickLayout->addWidget( allclose ); 580 quickLayout->addWidget( allclose );
576 quickLayout->addWidget( flat ); 581 quickLayout->addWidget( flat );
577 582
578 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); 583 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
579 584
580 mTodoListView = new KOTodoListView(calendar,this, name ); 585 mTodoListView = new KOTodoListView(calendar,this, name );
581 topLayout->addWidget(mTodoListView); 586 topLayout->addWidget(mTodoListView);
582 //mTodoListView->header()->setMaximumHeight(30); 587 //mTodoListView->header()->setMaximumHeight(30);
583 mTodoListView->setRootIsDecorated(true); 588 mTodoListView->setRootIsDecorated(true);
584 mTodoListView->setAllColumnsShowFocus(true); 589 mTodoListView->setAllColumnsShowFocus(true);
585 590
586 mTodoListView->setShowSortIndicator(true); 591 mTodoListView->setShowSortIndicator(true);
587 592
588 mTodoListView->addColumn(i18n("Todo")); 593 mTodoListView->addColumn(i18n("Todo"));
589 mTodoListView->addColumn(i18n("Prio")); 594 mTodoListView->addColumn(i18n("Prio"));
590 mTodoListView->setColumnAlignment(1,AlignHCenter); 595 mTodoListView->setColumnAlignment(1,AlignHCenter);
591 mTodoListView->addColumn(i18n("Complete")); 596 mTodoListView->addColumn(i18n("Complete"));
592 mTodoListView->setColumnAlignment(2,AlignCenter); 597 mTodoListView->setColumnAlignment(2,AlignCenter);
593 598
594 mTodoListView->addColumn(i18n("Due Date")); 599 mTodoListView->addColumn(i18n("Due Date"));
595 mTodoListView->setColumnAlignment(3,AlignLeft); 600 mTodoListView->setColumnAlignment(3,AlignLeft);
596 mTodoListView->addColumn(i18n("Due Time")); 601 mTodoListView->addColumn(i18n("Due Time"));
597 mTodoListView->setColumnAlignment(4,AlignHCenter); 602 mTodoListView->setColumnAlignment(4,AlignHCenter);
598 603
599 mTodoListView->addColumn(i18n("Start Date")); 604 mTodoListView->addColumn(i18n("Start Date"));
600 mTodoListView->setColumnAlignment(5,AlignLeft); 605 mTodoListView->setColumnAlignment(5,AlignLeft);
601 mTodoListView->addColumn(i18n("Start Time")); 606 mTodoListView->addColumn(i18n("Start Time"));
602 mTodoListView->setColumnAlignment(6,AlignHCenter); 607 mTodoListView->setColumnAlignment(6,AlignHCenter);
603 608
604 //mTodoListView->addColumn(i18n("Cancelled")); 609 //mTodoListView->addColumn(i18n("Cancelled"));
605 mTodoListView->addColumn(i18n("Categories")); 610 mTodoListView->addColumn(i18n("Categories"));
606 mTodoListView->addColumn(i18n("Calendar")); 611 mTodoListView->addColumn(i18n("Calendar"));
607 mTodoListView->addColumn(i18n("Last Modified")); 612 mTodoListView->addColumn(i18n("Last Modified"));
608 mTodoListView->addColumn(i18n("Created")); 613 mTodoListView->addColumn(i18n("Created"));
609 mTodoListView->addColumn(i18n("Last Modified Sub")); 614 mTodoListView->addColumn(i18n("Last Modified Sub"));
610#if 0 615#if 0
611 mTodoListView->addColumn(i18n("Sort Id")); 616 mTodoListView->addColumn(i18n("Sort Id"));
612 mTodoListView->setColumnAlignment(4,AlignHCenter); 617 mTodoListView->setColumnAlignment(4,AlignHCenter);
613#endif 618#endif
614 619
615 mTodoListView->setMinimumHeight( 60 ); 620 mTodoListView->setMinimumHeight( 60 );
616 mTodoListView->setItemsRenameable( true ); 621 mTodoListView->setItemsRenameable( true );
617 mTodoListView->setRenameable( 0 ); 622 mTodoListView->setRenameable( 0 );
618 mTodoListView->setColumnWidth( 0, 120 ); 623 mTodoListView->setColumnWidth( 0, 120 );
619 int iii = 0; 624 int iii = 0;
620 for ( iii = 0; iii< 12 ; ++iii ) 625 for ( iii = 0; iii< 12 ; ++iii )
621 mTodoListView->setColumnWidthMode( iii, QListView::Manual ); 626 mTodoListView->setColumnWidthMode( iii, QListView::Manual );
622 627
623 628
624 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 629 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
625 630
626 mPriorityPopupMenu = new QPopupMenu(this); 631 mPriorityPopupMenu = new QPopupMenu(this);
627 for (int i = 1; i <= 5; i++) { 632 for (int i = 1; i <= 5; i++) {
628 QString label = QString ("%1").arg (i); 633 QString label = QString ("%1").arg (i);
629 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 634 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
630 } 635 }
631 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 636 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
632 637
633 mPercentageCompletedPopupMenu = new QPopupMenu(this); 638 mPercentageCompletedPopupMenu = new QPopupMenu(this);
634 for (int i = 0; i <= 100; i+=20) { 639 for (int i = 0; i <= 100; i+=20) {
635 QString label = QString ("%1 %").arg (i); 640 QString label = QString ("%1 %").arg (i);
636 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 641 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
637 } 642 }
638 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 643 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
639 644
640 645
641 mCategoryPopupMenu = new QPopupMenu (this); 646 mCategoryPopupMenu = new QPopupMenu (this);
642 mCategoryPopupMenu->setCheckable (true); 647 mCategoryPopupMenu->setCheckable (true);
643 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); 648 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
644 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); 649 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
645 650
646 mCalPopupMenu = new QPopupMenu (this); 651 mCalPopupMenu = new QPopupMenu (this);
647 mCalPopupMenu->setCheckable (true); 652 mCalPopupMenu->setCheckable (true);
648 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); 653 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
649 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); 654 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
650 655
651 656
652 657
653 658
654 mItemPopupMenu = new QPopupMenu(this); 659 mItemPopupMenu = new QPopupMenu(this);
655 mItemPopupMenu->insertItem(i18n("Show"), this, 660 mItemPopupMenu->insertItem(i18n("Show"), this,
656 SLOT (showTodo())); 661 SLOT (showTodo()));
657 mItemPopupMenu->insertItem(i18n("Edit..."), this, 662 mItemPopupMenu->insertItem(i18n("Edit..."), this,
658 SLOT (editTodo())); 663 SLOT (editTodo()));
659 mItemPopupMenu->insertItem( i18n("Delete..."), this, 664 mItemPopupMenu->insertItem( i18n("Delete..."), this,
660 SLOT (deleteTodo())); 665 SLOT (deleteTodo()));
661 mItemPopupMenu->insertItem( i18n("Clone..."), this, 666 mItemPopupMenu->insertItem( i18n("Clone..."), this,
662 SLOT (cloneTodo())); 667 SLOT (cloneTodo()));
663 mItemPopupMenu->insertItem( i18n("Move..."), this, 668 mItemPopupMenu->insertItem( i18n("Move..."), this,
664 SLOT (moveTodo())); 669 SLOT (moveTodo()));
665#ifndef DESKTOP_VERSION 670#ifndef DESKTOP_VERSION
666 mItemPopupMenu->insertItem( i18n("Beam..."), this, 671 mItemPopupMenu->insertItem( i18n("Beam..."), this,
667 SLOT (beamTodo())); 672 SLOT (beamTodo()));
668#endif 673#endif
669 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 674 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
670 SLOT (cancelTodo())); 675 SLOT (cancelTodo()));
671 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu); 676 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu);
672 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu); 677 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu);
673 mItemPopupMenu->insertSeparator(); 678 mItemPopupMenu->insertSeparator();
674 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, 679 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
675 SLOT (toggleRunningItem())); 680 SLOT (toggleRunningItem()));
676 mItemPopupMenu->insertSeparator(); 681 mItemPopupMenu->insertSeparator();
677 /* 682 /*
678 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 683 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
679 SLOT (newTodo())); 684 SLOT (newTodo()));
680 */ 685 */
681 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 686 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
682 SLOT (newSubTodo())); 687 SLOT (newSubTodo()));
683 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 688 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
684 SLOT (unparentTodo()),0,21); 689 SLOT (unparentTodo()),0,21);
685 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 690 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
686 SLOT (reparentTodo()),0,22); 691 SLOT (reparentTodo()),0,22);
687 mItemPopupMenu->insertSeparator(); 692 mItemPopupMenu->insertSeparator();
688#if 0 693#if 0
689 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), 694 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."),
690 this, SLOT( purgeCompleted() ) ); 695 this, SLOT( purgeCompleted() ) );
691 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 696 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
692 this, SLOT( toggleCompleted() ),0, 33 ); 697 this, SLOT( toggleCompleted() ),0, 33 );
693 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 698 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
694 this, SLOT( toggleQuickTodo() ),0, 34 ); 699 this, SLOT( toggleQuickTodo() ),0, 34 );
695 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 700 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
696 this, SLOT( toggleRunning() ),0, 35 ); 701 this, SLOT( toggleRunning() ),0, 35 );
697 702
698#endif 703#endif
699 mPopupMenu = new QPopupMenu(this); 704 mPopupMenu = new QPopupMenu(this);
700 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 705 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
701 SLOT (newTodo()),0,1); 706 SLOT (newTodo()),0,1);
702 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), 707 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."),
703 this, SLOT(purgeCompleted()),0,2); 708 this, SLOT(purgeCompleted()),0,2);
704 mPopupMenu->insertItem(i18n("Show Completed"), 709 mPopupMenu->insertItem(i18n("Show Completed"),
705 this, SLOT( toggleCompleted() ),0,3 ); 710 this, SLOT( toggleCompleted() ),0,3 );
706 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 711 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
707 this, SLOT( toggleRunning() ),0,5 ); 712 this, SLOT( toggleRunning() ),0,5 );
708 mPopupMenu->insertItem(i18n(" set all open","Display all opened"), 713 mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
709 this, SLOT( setAllOpen() ),0,6 ); 714 this, SLOT( setAllOpen() ),0,6 );
710 mPopupMenu->insertItem(i18n(" set all close","Display all closed"), 715 mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
711 this, SLOT( setAllClose() ),0,7 ); 716 this, SLOT( setAllClose() ),0,7 );
712 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), 717 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"),
713 this, SLOT( setAllFlat() ),0,8 ); 718 this, SLOT( setAllFlat() ),0,8 );
714 mPopupMenu->insertSeparator(); 719 mPopupMenu->insertSeparator();
715 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 720 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
716 this, SLOT( toggleQuickTodo() ),0,4 ); 721 this, SLOT( toggleQuickTodo() ),0,4 );
717 mDocPrefs = new DocPrefs( name ); 722 mDocPrefs = new DocPrefs( name );
718 723
719 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); 724 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu );
720 mPopupMenu->setCheckable( true ); 725 mPopupMenu->setCheckable( true );
721 mItemPopupMenu->setCheckable( true ); 726 mItemPopupMenu->setCheckable( true );
722 727
723 728
724 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 729 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
725 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 730 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
726 731
727 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 732 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
728 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 733 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
729 734
730 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 735 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
731 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 736 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
732 737
733 738
734 // Double clicking conflicts with opening/closing the subtree 739 // Double clicking conflicts with opening/closing the subtree
735 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 740 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
736 SLOT( editItem( QListViewItem *) ) ); 741 SLOT( editItem( QListViewItem *) ) );
737 /* 742 /*
738 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 743 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
739 const QPoint &,int ) ), 744 const QPoint &,int ) ),
740 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 745 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
741 */ 746 */
742 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 747 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
743 const QPoint &,int ) ), 748 const QPoint &,int ) ),
744 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 749 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
745 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 750 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
746 SLOT( itemClicked( QListViewItem * ) ) ); 751 SLOT( itemClicked( QListViewItem * ) ) );
747 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 752 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
748 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 753 SLOT( itemDoubleClicked( QListViewItem * ) ) );
749 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 754 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
750 SLOT( updateView() ) ); 755 SLOT( updateView() ) );
751 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 756 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
752 SLOT( todoModified(Todo *, int) ) ); 757 SLOT( todoModified(Todo *, int) ) );
753 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 758 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
754 SLOT( itemStateChanged( QListViewItem * ) ) ); 759 SLOT( itemStateChanged( QListViewItem * ) ) );
755 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 760 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
756 SLOT( itemStateChanged( QListViewItem * ) ) ); 761 SLOT( itemStateChanged( QListViewItem * ) ) );
757 connect( mTodoListView, SIGNAL( paintNeeded() ), 762 connect( mTodoListView, SIGNAL( paintNeeded() ),
758 SLOT( paintNeeded()) ); 763 SLOT( paintNeeded()) );
759 764
760#if 0 765#if 0
761 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 766 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
762 SLOT(selectionChanged(QListViewItem *))); 767 SLOT(selectionChanged(QListViewItem *)));
763 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 768 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
764 SLOT(selectionChanged(QListViewItem *))); 769 SLOT(selectionChanged(QListViewItem *)));
765 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 770 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
766 SLOT(selectionChanged(QListViewItem *))); 771 SLOT(selectionChanged(QListViewItem *)));
767#endif 772#endif
768 773
769 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 774 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
770 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 775 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
771 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 776 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
772 777
773 connect( mTodoListView, SIGNAL(selectionChanged() ), 778 connect( mTodoListView, SIGNAL(selectionChanged() ),
774 SLOT( processSelectionChange() ) ); 779 SLOT( processSelectionChange() ) );
775 connect( mQuickAdd, SIGNAL( returnPressed () ), 780 connect( mQuickAdd, SIGNAL( returnPressed () ),
776 SLOT( addQuickTodo() ) ); 781 SLOT( addQuickTodo() ) );
777 782
778} 783}
779 784
780KOTodoView::~KOTodoView() 785KOTodoView::~KOTodoView()
781{ 786{
782 787
783#if QT_VERSION >= 0x030000 788#if QT_VERSION >= 0x030000
784 789
785#else 790#else
786 delete mKOTodoViewWhatsThis; 791 delete mKOTodoViewWhatsThis;
787#endif 792#endif
788 793
789 delete mDocPrefs; 794 delete mDocPrefs;
790} 795}
791QString KOTodoView::getWhatsThisText(QPoint p) 796QString KOTodoView::getWhatsThisText(QPoint p)
792{ 797{
793 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 798 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
794 if ( item ) 799 if ( item )
795 return KIncidenceFormatter::instance()->getFormattedText( item->todo(), 800 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
796 KOPrefs::instance()->mWTshowDetails, 801 KOPrefs::instance()->mWTshowDetails,
797 KOPrefs::instance()->mWTshowCreated, 802 KOPrefs::instance()->mWTshowCreated,
798 KOPrefs::instance()->mWTshowChanged); 803 KOPrefs::instance()->mWTshowChanged);
799 return i18n("That is the todo view" ); 804 return i18n("That is the todo view" );
800 805
801} 806}
802 807
803void KOTodoView::jumpToDate () 808void KOTodoView::jumpToDate ()
804{ 809{
805 // if (mActiveItem) { 810 // if (mActiveItem) {
806// mActiveItem->todo()); 811// mActiveItem->todo());
807// if ( mActiveItem->todo()->hasDueDate() ) 812// if ( mActiveItem->todo()->hasDueDate() )
808// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 813// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
809} 814}
810void KOTodoView::paintNeeded() 815void KOTodoView::paintNeeded()
811{ 816{
812 if ( mPendingUpdateBeforeRepaint ) { 817 if ( mPendingUpdateBeforeRepaint ) {
813 updateView(); 818 updateView();
814 mPendingUpdateBeforeRepaint = false; 819 mPendingUpdateBeforeRepaint = false;
815 } 820 }
816} 821}
817void KOTodoView::paintEvent(QPaintEvent * pevent) 822void KOTodoView::paintEvent(QPaintEvent * pevent)
818{ 823{
819 if ( mPendingUpdateBeforeRepaint ) { 824 if ( mPendingUpdateBeforeRepaint ) {
820 updateView(); 825 updateView();
821 mPendingUpdateBeforeRepaint = false; 826 mPendingUpdateBeforeRepaint = false;
822 } 827 }
823 KOrg::BaseView::paintEvent( pevent); 828 KOrg::BaseView::paintEvent( pevent);
824} 829}
825 830
826void KOTodoView::clearList( bool saveCurrentItem ) // default true 831void KOTodoView::clearList( bool saveCurrentItem ) // default true
827{ 832{
828 if ( mTodoListView->childCount() ) { 833 if ( mTodoListView->childCount() ) {
829 if ( saveCurrentItem ) 834 if ( saveCurrentItem )
830 storeCurrentItem(); 835 storeCurrentItem();
831 mTodoListView->clear(); 836 mTodoListView->clear();
832 mTodoMap.clear(); 837 mTodoMap.clear();
833 } 838 }
834} 839}
835void KOTodoView::updateView() 840void KOTodoView::updateView()
836{ 841{
837 mActiveItem = 0; 842 mActiveItem = 0;
838 pendingSubtodo = 0; 843 pendingSubtodo = 0;
839 if ( mBlockUpdate ) { 844 if ( mBlockUpdate ) {
840 return; 845 return;
841 } 846 }
842 if ( !isVisible() ) { 847 if ( !isVisible() ) {
843 clearList (); 848 clearList ();
844 mPendingUpdateBeforeRepaint = true; 849 mPendingUpdateBeforeRepaint = true;
845 return; 850 return;
846 } 851 }
847 //qDebug("KOTodoView::updateView() %x", this); 852 //qDebug("KOTodoView::updateView() %x", this);
848 if ( isFlatDisplay ) { 853 if ( isFlatDisplay ) {
849 displayAllFlat(); 854 displayAllFlat();
850 return; 855 return;
851 } 856 }
852 //qDebug("update "); 857 //qDebug("update ");
853// kdDebug() << "KOTodoView::updateView()" << endl; 858// kdDebug() << "KOTodoView::updateView()" << endl;
854 QFont fo = KOPrefs::instance()->mTodoViewFont; 859 QFont fo = KOPrefs::instance()->mTodoViewFont;
855 860
856 clearList (); 861 clearList ();
857 862
858 if ( mName == "todolistsmall" ) { 863 if ( mName == "todolistsmall" ) {
859 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { 864 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
860 int ps = fo.pointSize() -2; 865 int ps = fo.pointSize() -2;
861 if ( ps > 12 ) 866 if ( ps > 12 )
862 ps -= 2; 867 ps -= 2;
863 fo.setPointSize( ps ); 868 fo.setPointSize( ps );
864 } 869 }
865 } 870 }
866 871
867 mTodoListView->setFont( fo ); 872 mTodoListView->setFont( fo );
868 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); 873 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
869 //mTodoListView->header()->setMaximumHeight(fm.height()); 874 //mTodoListView->header()->setMaximumHeight(fm.height());
870 QPtrList<Todo> todoList = calendar()->todos(); 875 QPtrList<Todo> todoList = calendar()->todos();
871 876
872/* 877/*
873 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; 878 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
874 Event *t; 879 Event *t;
875 for(t = todoList.first(); t; t = todoList.next()) { 880 for(t = todoList.first(); t; t = todoList.next()) {
876 kdDebug() << " " << t->getSummary() << endl; 881 kdDebug() << " " << t->getSummary() << endl;
877 882
878 if (t->getRelatedTo()) { 883 if (t->getRelatedTo()) {
879 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; 884 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
880 } 885 }
881 886
882 QPtrList<Event> l = t->getRelations(); 887 QPtrList<Event> l = t->getRelations();
883 Event *c; 888 Event *c;
884 for(c=l.first();c;c=l.next()) { 889 for(c=l.first();c;c=l.next()) {
885 kdDebug() << " - relation: " << c->getSummary() << endl; 890 kdDebug() << " - relation: " << c->getSummary() << endl;
886 } 891 }
887 } 892 }
888*/ 893*/
889 894
890 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a 895 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a
891 // specific order of events. That means that we have to generate parent items 896 // specific order of events. That means that we have to generate parent items
892 // recursively for proper hierarchical display of Todos. 897 // recursively for proper hierarchical display of Todos.
893 Todo *todo; 898 Todo *todo;
894 todo = todoList.first();// todo; todo = todoList.next()) { 899 todo = todoList.first();// todo; todo = todoList.next()) {
895 while ( todo ) { 900 while ( todo ) {
896 bool next = true; 901 bool next = true;
897 // qDebug("todo %s ", todo->summary().latin1()); 902 // qDebug("todo %s ", todo->summary().latin1());
898 Incidence *incidence = todo->relatedTo(); 903 Incidence *incidence = todo->relatedTo();
899 while ( incidence ) { 904 while ( incidence ) {
900 if ( incidence->typeID() == todoID ) { 905 if ( incidence->typeID() == todoID ) {
901 //qDebug("related %s ",incidence->summary().latin1() ); 906 //qDebug("related %s ",incidence->summary().latin1() );
902 if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) { 907 if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) {
903 //qDebug("related not found "); 908 //qDebug("related not found ");
904 todoList.remove( ); 909 todoList.remove( );
905 todo = todoList.current(); 910 todo = todoList.current();
906 next = false; 911 next = false;
907 incidence = 0; 912 incidence = 0;
908 913
909 } else { 914 } else {
910 //qDebug("related found "); 915 //qDebug("related found ");
911 incidence = incidence->relatedTo(); 916 incidence = incidence->relatedTo();
912 } 917 }
913 } else 918 } else
914 incidence = 0; 919 incidence = 0;
915 } 920 }
916 if ( next ) 921 if ( next )
917 todo = todoList.next(); 922 todo = todoList.next();
918 } 923 }
919 924
920 for(todo = todoList.first(); todo; todo = todoList.next()) { 925 for(todo = todoList.first(); todo; todo = todoList.next()) {
921 if (!mTodoMap.contains(todo) && checkTodo( todo ) ) 926 if (!mTodoMap.contains(todo) && checkTodo( todo ) )
922 { 927 {
923 insertTodoItem(todo); 928 insertTodoItem(todo);
924 } 929 }
925 } 930 }
926 // Restore opened/closed state 931 // Restore opened/closed state
927 mTodoListView->blockSignals( true ); 932 mTodoListView->blockSignals( true );
928 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); 933 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() );
929 mTodoListView->blockSignals( false ); 934 mTodoListView->blockSignals( false );
930 resetCurrentItem(); 935 resetCurrentItem();
931} 936}
932 937
933void KOTodoView::storeCurrentItem() 938void KOTodoView::storeCurrentItem()
934{ 939{
935 mCurItem = 0; 940 mCurItem = 0;
936 mCurItemRootParent = 0; 941 mCurItemRootParent = 0;
937 mCurItemParent = 0; 942 mCurItemParent = 0;
938 mCurItemAbove = 0; 943 mCurItemAbove = 0;
939 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 944 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
940 if (mActiveItem) { 945 if (mActiveItem) {
941 mCurItem = mActiveItem->todo(); 946 mCurItem = mActiveItem->todo();
942 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove (); 947 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove ();
943 if ( activeItemAbove ) 948 if ( activeItemAbove )
944 mCurItemAbove = activeItemAbove->todo(); 949 mCurItemAbove = activeItemAbove->todo();
945 mCurItemRootParent = mCurItem; 950 mCurItemRootParent = mCurItem;
946 mCurItemParent = mCurItemRootParent->relatedTo(); 951 mCurItemParent = mCurItemRootParent->relatedTo();
947 while ( mCurItemRootParent->relatedTo() != 0 ) 952 while ( mCurItemRootParent->relatedTo() != 0 )
948 mCurItemRootParent = mCurItemRootParent->relatedTo(); 953 mCurItemRootParent = mCurItemRootParent->relatedTo();
949 } 954 }
950 mActiveItem = 0; 955 mActiveItem = 0;
951} 956}
952 957
953void KOTodoView::resetCurrentItem() 958void KOTodoView::resetCurrentItem()
954{ 959{
955 //mTodoListView->setFocus(); 960 //mTodoListView->setFocus();
956 KOTodoViewItem* foundItem = 0; 961 KOTodoViewItem* foundItem = 0;
957 KOTodoViewItem* foundItemRoot = 0; 962 KOTodoViewItem* foundItemRoot = 0;
958 KOTodoViewItem* foundItemParent = 0; 963 KOTodoViewItem* foundItemParent = 0;
959 KOTodoViewItem* foundItemAbove = 0; 964 KOTodoViewItem* foundItemAbove = 0;
960 if ( mTodoListView->firstChild () ) { 965 if ( mTodoListView->firstChild () ) {
961 if ( mCurItem ) { 966 if ( mCurItem ) {
962 KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild (); 967 KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild ();
963 while ( item ) { 968 while ( item ) {
964 if ( item->todo() == mCurItem ) { 969 if ( item->todo() == mCurItem ) {
965 foundItem = item; 970 foundItem = item;
966 break; 971 break;
967 } else if ( item->todo() == mCurItemAbove ) { 972 } else if ( item->todo() == mCurItemAbove ) {
968 foundItemAbove = item; 973 foundItemAbove = item;
969 974
970 } 975 }
971 if ( item->todo() == mCurItemRootParent ) { 976 if ( item->todo() == mCurItemRootParent ) {
972 foundItemRoot = item; 977 foundItemRoot = item;
973 } 978 }
974 if ( item->todo() == mCurItemParent ) { 979 if ( item->todo() == mCurItemParent ) {
975 foundItemParent = item; 980 foundItemParent = item;
976 } 981 }
977 item = (KOTodoViewItem*)item->itemBelow(); 982 item = (KOTodoViewItem*)item->itemBelow();
978 } 983 }
979 if ( ! foundItem ) { 984 if ( ! foundItem ) {
980 if ( foundItemParent ) { 985 if ( foundItemParent ) {
981 foundItem = foundItemParent; 986 foundItem = foundItemParent;
982 } else { 987 } else {
983 if ( foundItemRoot ) 988 if ( foundItemRoot )
984 foundItem = foundItemRoot; 989 foundItem = foundItemRoot;
985 else 990 else
986 foundItem = foundItemAbove; 991 foundItem = foundItemAbove;
987 } 992 }
988 } 993 }
989 } 994 }
990 if ( foundItem ) { 995 if ( foundItem ) {
991 mTodoListView->setSelected ( foundItem, true ); 996 mTodoListView->setSelected ( foundItem, true );
992 mTodoListView->setCurrentItem( foundItem ); 997 mTodoListView->setCurrentItem( foundItem );
993 mTodoListView->ensureItemVisible( foundItem ); 998 mTodoListView->ensureItemVisible( foundItem );
994 } else { 999 } else {
995 if ( mTodoListView->firstChild () ) { 1000 if ( mTodoListView->firstChild () ) {
996 mTodoListView->setSelected ( mTodoListView->firstChild (), true ); 1001 mTodoListView->setSelected ( mTodoListView->firstChild (), true );
997 mTodoListView->setCurrentItem( mTodoListView->firstChild () ); 1002 mTodoListView->setCurrentItem( mTodoListView->firstChild () );
998 } 1003 }
999 } 1004 }
1000 } 1005 }
1001 processSelectionChange(); 1006 processSelectionChange();
1002 if ( mName != "todolistsmall" ) 1007 if ( mName != "todolistsmall" )
1003 QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); 1008 QTimer::singleShot( 100, this, SLOT ( resetFocusToList() ));
1004} 1009}
1005void KOTodoView::resetFocusToList() 1010void KOTodoView::resetFocusToList()
1006{ 1011{
1007 topLevelWidget()->setActiveWindow(); 1012 topLevelWidget()->setActiveWindow();
1008 mTodoListView->setFocus(); 1013 mTodoListView->setFocus();
1009} 1014}
1010//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove; 1015//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove;
1011bool KOTodoView::checkTodo( Todo * todo ) 1016bool KOTodoView::checkTodo( Todo * todo )
1012{ 1017{
1013 1018
1014 if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) 1019 if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() )
1015 return false; 1020 return false;
1016 if ( !todo->isCompleted() ) { 1021 if ( !todo->isCompleted() ) {
1017 if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() ) 1022 if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() )
1018 return true; 1023 return true;
1019 } 1024 }
1020 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { 1025 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) {
1021 if ( todo->hasStartDate() ) 1026 if ( todo->hasStartDate() )
1022 if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) 1027 if ( mNavigator->selectedDates().last() < todo->dtStart().date() )
1023 return false; 1028 return false;
1024 if ( todo->hasDueDate() ) 1029 if ( todo->hasDueDate() )
1025 if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) 1030 if ( mNavigator->selectedDates().first() > todo->dtDue().date() )
1026 return false; 1031 return false;
1027 } 1032 }
1028 return true; 1033 return true;
1029} 1034}
1030 1035
1031void KOTodoView::restoreItemState( QListViewItem *item ) 1036void KOTodoView::restoreItemState( QListViewItem *item )
1032{ 1037{
1033 pendingSubtodo = 0; 1038 pendingSubtodo = 0;
1034 while( item ) { 1039 while( item ) {
1035 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1040 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1036 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); 1041 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
1037 if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); 1042 if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
1038 item = item->nextSibling(); 1043 item = item->nextSibling();
1039 } 1044 }
1040} 1045}
1041 1046
1042 1047
1043QMap<Todo *,KOTodoViewItem *>::ConstIterator 1048QMap<Todo *,KOTodoViewItem *>::ConstIterator
1044KOTodoView::insertTodoItem(Todo *todo) 1049KOTodoView::insertTodoItem(Todo *todo)
1045{ 1050{
1046 1051
1047 // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; 1052 // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
1048 // TODO: Check, if dynmaic cast is necessary 1053 // TODO: Check, if dynmaic cast is necessary
1049 1054
1050 pendingSubtodo = 0; 1055 pendingSubtodo = 0;
1051 Incidence *incidence = todo->relatedTo(); 1056 Incidence *incidence = todo->relatedTo();
1052 while ( incidence && !incidence->calEnabled() ) 1057 while ( incidence && !incidence->calEnabled() )
1053 incidence = incidence->relatedTo(); 1058 incidence = incidence->relatedTo();
1054 if (incidence && incidence->typeID() == todoID ) { 1059 if (incidence && incidence->typeID() == todoID ) {
1055 Todo *relatedTodo = static_cast<Todo *>(incidence); 1060 Todo *relatedTodo = static_cast<Todo *>(incidence);
1056 1061
1057 // kdDebug() << " has Related" << endl; 1062 // kdDebug() << " has Related" << endl;
1058 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 1063 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
1059 itemIterator = mTodoMap.find(relatedTodo); 1064 itemIterator = mTodoMap.find(relatedTodo);
1060 if (itemIterator == mTodoMap.end()) { 1065 if (itemIterator == mTodoMap.end()) {
1061 // kdDebug() << " related not yet in list" << endl; 1066 // kdDebug() << " related not yet in list" << endl;
1062 itemIterator = insertTodoItem (relatedTodo); 1067 itemIterator = insertTodoItem (relatedTodo);
1063 } 1068 }
1064 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem 1069 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem
1065 // and one into the map. Sure finding is more easy but why? -zecke 1070 // and one into the map. Sure finding is more easy but why? -zecke
1066 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); 1071 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this);
1067 return mTodoMap.insert(todo,todoItem); 1072 return mTodoMap.insert(todo,todoItem);
1068 } else { 1073 } else {
1069 // kdDebug() << " no Related" << endl; 1074 // kdDebug() << " no Related" << endl;
1070 // see above -zecke 1075 // see above -zecke
1071 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1076 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1072 return mTodoMap.insert(todo,todoItem); 1077 return mTodoMap.insert(todo,todoItem);
1073 } 1078 }
1074} 1079}
1075 1080
1076 1081
1077void KOTodoView::updateConfig() 1082void KOTodoView::updateConfig()
1078{ 1083{
1079 updateView(); 1084 updateView();
1080 mTodoListView->repaintContents(); 1085 mTodoListView->repaintContents();
1081} 1086}
1082 1087
1083QPtrList<Incidence> KOTodoView::selectedIncidences() 1088QPtrList<Incidence> KOTodoView::selectedIncidences()
1084{ 1089{
1085 QPtrList<Incidence> selected; 1090 QPtrList<Incidence> selected;
1086 1091
1087 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1092 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1088// if (!item) item = mActiveItem; 1093// if (!item) item = mActiveItem;
1089 if (item) selected.append(item->todo()); 1094 if (item) selected.append(item->todo());
1090 1095
1091 return selected; 1096 return selected;
1092} 1097}
1093 1098
1094QPtrList<Todo> KOTodoView::selectedTodos() 1099QPtrList<Todo> KOTodoView::selectedTodos()
1095{ 1100{
1096 QPtrList<Todo> selected; 1101 QPtrList<Todo> selected;
1097 1102
1098 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1103 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1099// if (!item) item = mActiveItem; 1104// if (!item) item = mActiveItem;
1100 if (item) selected.append(item->todo()); 1105 if (item) selected.append(item->todo());
1101 1106
1102 return selected; 1107 return selected;
1103} 1108}
1104 1109
1105void KOTodoView::changeEventDisplay(Event *, int) 1110void KOTodoView::changeEventDisplay(Event *, int)
1106{ 1111{
1107 updateView(); 1112 updateView();
1108} 1113}
1109 1114
1110void KOTodoView::showDates(const QDate &, const QDate &) 1115void KOTodoView::showDates(const QDate &, const QDate &)
1111{ 1116{
1112} 1117}
1113 1118
1114void KOTodoView::showEvents(QPtrList<Event>) 1119void KOTodoView::showEvents(QPtrList<Event>)
1115{ 1120{
1116 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; 1121 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
1117} 1122}
1118 1123
1119void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1124void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1120 const QDate &td) 1125 const QDate &td)
1121{ 1126{
1122#ifndef KORG_NOPRINTER 1127#ifndef KORG_NOPRINTER
1123 calPrinter->preview(CalPrinter::Todolist, fd, td); 1128 calPrinter->preview(CalPrinter::Todolist, fd, td);
1124#endif 1129#endif
1125} 1130}
1126 1131
1127void KOTodoView::editItem(QListViewItem *item ) 1132void KOTodoView::editItem(QListViewItem *item )
1128{ 1133{
1129 if ( item ) 1134 if ( item )
1130 emit editTodoSignal(((KOTodoViewItem *)item)->todo()); 1135 emit editTodoSignal(((KOTodoViewItem *)item)->todo());
1131} 1136}
1132 1137
1133void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) 1138void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
1134{ 1139{
1135 if ( item ) 1140 if ( item )
1136 emit showTodoSignal(((KOTodoViewItem *)item)->todo()); 1141 emit showTodoSignal(((KOTodoViewItem *)item)->todo());
1137} 1142}
1138 1143
1139void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) 1144void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
1140{ 1145{
1141 pendingSubtodo = 0; 1146 pendingSubtodo = 0;
1142 mActiveItem = (KOTodoViewItem *)item; 1147 mActiveItem = (KOTodoViewItem *)item;
1143 if (item) { 1148 if (item) {
1144 switch (column){ 1149 switch (column){
1145 case 1: 1150 case 1:
1146 mPriorityPopupMenu->popup(QCursor::pos ()); break; 1151 mPriorityPopupMenu->popup(QCursor::pos ()); break;
1147 case 2: 1152 case 2:
1148 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; 1153 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
1149 case 3: 1154 case 3:
1150 moveTodo(); 1155 moveTodo();
1151 break; 1156 break;
1152 case 7: 1157 case 7:
1153 mCategoryPopupMenu->popup(QCursor::pos ()); break; 1158 mCategoryPopupMenu->popup(QCursor::pos ()); break;
1154 case 8: 1159 case 8:
1155 mCalPopupMenu->popup(QCursor::pos ()); break; 1160 mCalPopupMenu->popup(QCursor::pos ()); break;
1156 default: 1161 default:
1157 mItemPopupMenu->popup(QCursor::pos()); 1162 mItemPopupMenu->popup(QCursor::pos());
1158 } 1163 }
1159 } else mPopupMenu->popup(QCursor::pos()); 1164 } else mPopupMenu->popup(QCursor::pos());
1160} 1165}
1161void KOTodoView::newTodo() 1166void KOTodoView::newTodo()
1162{ 1167{
1163 emit newTodoSignal(); 1168 emit newTodoSignal();
1164} 1169}
1165 1170
1166void KOTodoView::newSubTodo() 1171void KOTodoView::newSubTodo()
1167{ 1172{
1168 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1173 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1169 if (mActiveItem) { 1174 if (mActiveItem) {
1170 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) { 1175 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) {
1171 addQuickTodoPar( mActiveItem->todo()); 1176 addQuickTodoPar( mActiveItem->todo());
1172 } else 1177 } else
1173 emit newSubTodoSignal(mActiveItem->todo()); 1178 emit newSubTodoSignal(mActiveItem->todo());
1174 } 1179 }
1175} 1180}
1176void KOTodoView::unparentTodo() 1181void KOTodoView::unparentTodo()
1177{ 1182{
1178 if (mActiveItem) { 1183 if (mActiveItem) {
1179 emit unparentTodoSignal(mActiveItem->todo()); 1184 emit unparentTodoSignal(mActiveItem->todo());
1180 } 1185 }
1181} 1186}
1182 1187
1183void KOTodoView::reparentTodo() 1188void KOTodoView::reparentTodo()
1184{ 1189{
1185 if (mActiveItem) { 1190 if (mActiveItem) {
1186 topLevelWidget()->setCaption(i18n("Click on new parent item")); 1191 topLevelWidget()->setCaption(i18n("Click on new parent item"));
1187 pendingSubtodo = mActiveItem; 1192 pendingSubtodo = mActiveItem;
1188 } 1193 }
1189} 1194}
1190void KOTodoView::editTodo() 1195void KOTodoView::editTodo()
1191{ 1196{
1192 if (mActiveItem) { 1197 if (mActiveItem) {
1193 emit editTodoSignal(mActiveItem->todo()); 1198 emit editTodoSignal(mActiveItem->todo());
1194 } 1199 }
1195} 1200}
1196void KOTodoView::cloneTodo() 1201void KOTodoView::cloneTodo()
1197{ 1202{
1198 if (mActiveItem) { 1203 if (mActiveItem) {
1199 emit cloneTodoSignal((Incidence*)mActiveItem->todo()); 1204 emit cloneTodoSignal((Incidence*)mActiveItem->todo());
1200 } 1205 }
1201} 1206}
1202void KOTodoView::cancelTodo() 1207void KOTodoView::cancelTodo()
1203{ 1208{
1204 if (mActiveItem) { 1209 if (mActiveItem) {
1205 emit cancelTodoSignal((Incidence*)mActiveItem->todo()); 1210 emit cancelTodoSignal((Incidence*)mActiveItem->todo());
1206 } 1211 }
1207} 1212}
1208void KOTodoView::moveTodo() 1213void KOTodoView::moveTodo()
1209{ 1214{
1210 if (mActiveItem) { 1215 if (mActiveItem) {
1211 emit moveTodoSignal((Incidence*)mActiveItem->todo()); 1216 emit moveTodoSignal((Incidence*)mActiveItem->todo());
1212 } 1217 }
1213} 1218}
1214void KOTodoView::beamTodo() 1219void KOTodoView::beamTodo()
1215{ 1220{
1216 if (mActiveItem) { 1221 if (mActiveItem) {
1217 emit beamTodoSignal((Incidence*)mActiveItem->todo()); 1222 emit beamTodoSignal((Incidence*)mActiveItem->todo());
1218 } 1223 }
1219} 1224}
1220 1225
1221 1226
1222void KOTodoView::showTodo() 1227void KOTodoView::showTodo()
1223{ 1228{
1224 if (mActiveItem) { 1229 if (mActiveItem) {
1225 emit showTodoSignal(mActiveItem->todo()); 1230 emit showTodoSignal(mActiveItem->todo());
1226 } 1231 }
1227} 1232}
1228 1233
1229void KOTodoView::deleteTodo() 1234void KOTodoView::deleteTodo()
1230{ 1235{
1231 if (mActiveItem) { 1236 if (mActiveItem) {
1232 emit deleteTodoSignal(mActiveItem->todo()); 1237 emit deleteTodoSignal(mActiveItem->todo());
1233 } 1238 }
1234} 1239}
1235 1240
1236void KOTodoView::setNewPriority(int index) 1241void KOTodoView::setNewPriority(int index)
1237{ 1242{
1238 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1243 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1239 mActiveItem->todo()->setPriority(mPriority[index]); 1244 mActiveItem->todo()->setPriority(mPriority[index]);
1240 mActiveItem->construct(); 1245 mActiveItem->construct();
1241 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); 1246 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED);
1242 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1247 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1243 } 1248 }
1244 processSelectionChange(); 1249 processSelectionChange();
1245} 1250}
1246 1251
1247void KOTodoView::setNewPercentage(int index) 1252void KOTodoView::setNewPercentage(int index)
1248{ 1253{
1249 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1254 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1250 1255
1251 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { 1256 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) {
1252 mActiveItem->setOn( true ); 1257 mActiveItem->setOn( true );
1253 processSelectionChange(); 1258 processSelectionChange();
1254 return; 1259 return;
1255 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { 1260 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) {
1256 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); 1261 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent()));
1257 if ( par && par->isOn() ) 1262 if ( par && par->isOn() )
1258 par->setOn( false ); 1263 par->setOn( false );
1259 } 1264 }
1260 if (mPercentage[index] == 100) { 1265 if (mPercentage[index] == 100) {
1261 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); 1266 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime());
1262 } else { 1267 } else {
1263 mActiveItem->todo()->setCompleted(false); 1268 mActiveItem->todo()->setCompleted(false);
1264 } 1269 }
1265 mActiveItem->todo()->setPercentComplete(mPercentage[index]); 1270 mActiveItem->todo()->setPercentComplete(mPercentage[index]);
1266 mActiveItem->construct(); 1271 mActiveItem->construct();
1267 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); 1272 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED);
1268 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1273 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1269 } 1274 }
1270 processSelectionChange(); 1275 processSelectionChange();
1271} 1276}
1272 1277
1273void KOTodoView::fillCategories () 1278void KOTodoView::fillCategories ()
1274{ 1279{
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index c9d1345..6339370 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,115 +1,115 @@
1 1
2 2
3#ifndef DESKTOP_VERSION 3#ifndef DESKTOP_VERSION
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include <qcopchannel_qws.h> 5#include <qcopchannel_qws.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#else 8#else
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qstring.h> 10#include <qstring.h>
11#include <qwindowsstyle.h> 11#include <qwindowsstyle.h>
12#include <qplatinumstyle.h> 12#include <qplatinumstyle.h>
13#include <qsgistyle.h> 13#include <qsgistyle.h>
14#include <stdlib.h> 14#include <stdlib.h>
15#endif 15#endif
16#include <qtextcodec.h> 16#include <qtextcodec.h>
17 17
18#include <qdir.h> 18#include <qdir.h>
19#include <kstandarddirs.h> 19#include <kstandarddirs.h>
20#include <kglobal.h> 20#include <kglobal.h>
21#include <stdio.h> 21#include <stdio.h>
22#include "mainwindow.h" 22#include "mainwindow.h"
23#include <libkdepim/kpimglobalprefs.h> 23#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 24void dumpMissing();
25 25
26 26
27int main( int argc, char **argv ) 27int main( int argc, char **argv )
28{ 28{
29#ifndef DESKTOP_VERSION 29#ifndef DESKTOP_VERSION
30 QPEApplication a( argc, argv ); 30 QPEApplication a( argc, argv );
31 a.setKeepRunning (); 31 a.setKeepRunning ();
32#else 32#else
33 QApplication a( argc, argv ); 33 QApplication a( argc, argv );
34 QApplication::setStyle( new QPlatinumStyle ()); 34 QApplication::setStyle( new QPlatinumStyle ());
35#ifdef _WIN32_ 35#ifdef _WIN32_
36 QString hdir ( getenv( "HOME") ); 36 QString hdir ( getenv( "HOME") );
37 if ( hdir.isEmpty() ) { 37 if ( hdir.isEmpty() ) {
38 QString hd ("C:/" ); 38 QString hd ("C:/" );
39 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 39 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
40 if ( QDir::homeDirPath().lower() == hd.lower() ) { 40 if ( QDir::homeDirPath().lower() == hd.lower() ) {
41 _putenv( "HOME=C:"); 41 _putenv( "HOME=C:");
42 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 42 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
43 } 43 }
44 } else { 44 } else {
45 QDir app_dir; 45 QDir app_dir;
46 if ( !app_dir.exists(hdir) ) 46 if ( !app_dir.exists(hdir) )
47 app_dir.mkdir (hdir); 47 app_dir.mkdir (hdir);
48 } 48 }
49#endif 49#endif
50#endif 50#endif
51 bool exitHelp = false; 51 bool exitHelp = false;
52 if ( argc > 1 ) { 52 if ( argc > 1 ) {
53 QString command = argv[1]; 53 QString command = argv[1];
54 if ( command == "-help" ){ 54 if ( command == "-help" ){
55 printf("KO/Pi command line commands:\n"); 55 printf("KO/Pi command line commands:\n");
56 printf(" no command: Start KO/Pi in usual way\n"); 56 printf(" no command: Start KO/Pi in usual way\n");
57 printf(" -help: This output\n"); 57 printf(" -help: This output\n");
58 printf("Next Option: Open or Show after start:\n"); 58 printf("Next Option: Open or Show after start:\n");
59 printf(" -newTodo: New Todo dialog\n"); 59 printf(" -newTodo: New Todo dialog\n");
60 printf(" -newEvent: New Event dialog\n"); 60 printf(" -newEvent: New Event dialog\n");
61 printf(" -showList: List view\n"); 61 printf(" -showList: List view\n");
62 printf(" -showDay: Day view\n"); 62 printf(" -showDay: Day view\n");
63 printf(" -showWWeek: Work Week view\n"); 63 printf(" -showWWeek: Work Week view\n");
64 printf(" -showWeek: Week view\n"); 64 printf(" -showWeek: Week view\n");
65 printf(" -showTodo: Todo view\n"); 65 printf(" -showTodo: Todo view\n");
66 printf(" -showJournal: Journal view\n"); 66 printf(" -showJournal: Journal view\n");
67 printf(" -showKO: Next Days view\n"); 67 printf(" -showKO: Next Days view\n");
68 printf(" -showWNext: What's Next view\n"); 68 printf(" -showWNext: What's Next view\n");
69 printf(" -showNextXView: Next X View\n"); 69 printf(" -showNextXView: Next X View\n");
70 printf(" -new[Y] and -show[X] may be used togehther\n"); 70 printf(" -new[Y] and -show[X] may be used togehther\n");
71 printf(" KO/Pi is exiting now. Bye!\n"); 71 printf(" KO/Pi is exiting now. Bye!\n");
72 exitHelp = true; 72 exitHelp = true;
73 } 73 }
74 } 74 }
75 if ( ! exitHelp ) { 75 if ( ! exitHelp ) {
76 KGlobal::setAppName( "korganizer" ); 76 KGlobal::setAppName( "korganizer" );
77 QString fileName ; 77 QString fileName ;
78#ifndef DESKTOP_VERSION 78#ifndef DESKTOP_VERSION
79 fileName = getenv("QPEDIR"); 79 fileName = getenv("QPEDIR");
80 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); 80 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
81#else 81#else
82 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; 82 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
83 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 83 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
84#endif 84#endif
85 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); 85 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
86 86
87 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); 87 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
88 KPimGlobalPrefs::instance()->setGlobalConfig(); 88 KPimGlobalPrefs::instance()->setGlobalConfig();
89 MainWindow m; 89 MainWindow m;
90#ifndef DESKTOP_VERSION 90#ifndef DESKTOP_VERSION
91 91
92 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 92 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receiveStart( const QCString&, const QByteArray& )));
93 a.showMainWidget(&m ); 93 a.showMainWidget(&m );
94#else 94#else
95 a.setMainWidget(&m ); 95 a.setMainWidget(&m );
96 m.show(); 96 m.show();
97 //m.resize( 800, 600 ); 97 //m.resize( 800, 600 );
98 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 98 //QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
99#endif 99#endif
100 if ( argc > 1 ) { 100 if ( argc > 1 ) {
101 QCString command = argv[1]; 101 QCString command = argv[1];
102 if ( argc > 2 ) 102 if ( argc > 2 )
103 command += argv[2]; 103 command += argv[2];
104 qApp->processEvents(); 104 qApp->processEvents();
105 m.recieve(command, QByteArray() ); 105 m.recieve(command, QByteArray() );
106 106
107 } 107 }
108 108
109 a.exec(); 109 a.exec();
110 dumpMissing(); 110 dumpMissing();
111 111
112 KPimGlobalPrefs::instance()->writeConfig(); 112 KPimGlobalPrefs::instance()->writeConfig();
113 } 113 }
114 qDebug("KO: Bye! "); 114 qDebug("KO: Bye! ");
115} 115}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9ae393d..8c72d89 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,1311 +1,1338 @@
1#include <stdlib.h> 1#include <stdlib.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qpainter.h> 5#include <qpainter.h>
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qlineedit.h> 9#include <qlineedit.h>
10#include <qtextcodec.h> 10#include <qtextcodec.h>
11#include <qfile.h> 11#include <qfile.h>
12#include <qdir.h> 12#include <qdir.h>
13#include <qapp.h> 13#include <qapp.h>
14#include <qfileinfo.h> 14#include <qfileinfo.h>
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qspinbox.h> 16#include <qspinbox.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qmap.h> 18#include <qmap.h>
19#include <qwmatrix.h> 19#include <qwmatrix.h>
20#include <qtextbrowser.h> 20#include <qtextbrowser.h>
21#include <qtextstream.h> 21#include <qtextstream.h>
22#ifndef DESKTOP_VERSION 22#ifndef DESKTOP_VERSION
23#include <qpe/global.h> 23#include <qpe/global.h>
24#include <qpe/qpetoolbar.h> 24#include <qpe/qpetoolbar.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27#include <qtopia/alarmserver.h> 27#include <qtopia/alarmserver.h>
28#include <qtopia/qcopenvelope_qws.h> 28#include <qtopia/qcopenvelope_qws.h>
29#include <unistd.h> // for sleep 29#include <unistd.h> // for sleep
30#else 30#else
31#include <qtoolbar.h> 31#include <qtoolbar.h>
32#include <qapplication.h> 32#include <qapplication.h>
33//#include <resource.h> 33//#include <resource.h>
34 34
35#endif 35#endif
36#include <libkcal/calendarlocal.h> 36#include <libkcal/calendarlocal.h>
37#include <libkcal/todo.h> 37#include <libkcal/todo.h>
38#include <libkcal/phoneformat.h> 38#include <libkcal/phoneformat.h>
39#include <libkdepim/ksyncprofile.h> 39#include <libkdepim/ksyncprofile.h>
40#include <libkdepim/phoneaccess.h> 40#include <libkdepim/phoneaccess.h>
41#include <libkcal/kincidenceformatter.h> 41#include <libkcal/kincidenceformatter.h>
42#include <libkdepim/kpimglobalprefs.h> 42#include <libkdepim/kpimglobalprefs.h>
43 43
44#include "calendarview.h" 44#include "calendarview.h"
45#include "koviewmanager.h" 45#include "koviewmanager.h"
46#include "datenavigator.h" 46#include "datenavigator.h"
47#include "koagendaview.h" 47#include "koagendaview.h"
48#include "kojournalview.h" 48#include "kojournalview.h"
49#include "koagenda.h" 49#include "koagenda.h"
50#include "kodialogmanager.h" 50#include "kodialogmanager.h"
51#include "kdialogbase.h" 51#include "kdialogbase.h"
52#include "kapplication.h" 52#include "kapplication.h"
53#include "kofilterview.h" 53#include "kofilterview.h"
54#include "kstandarddirs.h" 54#include "kstandarddirs.h"
55#include "koprefs.h" 55#include "koprefs.h"
56#include "kfiledialog.h" 56#include "kfiledialog.h"
57#include "koglobals.h" 57#include "koglobals.h"
58#include "kglobal.h" 58#include "kglobal.h"
59#include "ktoolbar.h" 59#include "ktoolbar.h"
60#include "klocale.h" 60#include "klocale.h"
61#include "kconfig.h" 61#include "kconfig.h"
62#include "externalapphandler.h" 62#include "externalapphandler.h"
63#include <kglobalsettings.h> 63#include <kglobalsettings.h>
64 64
65using namespace KCal; 65using namespace KCal;
66#ifndef _WIN32_ 66#ifndef _WIN32_
67#include <unistd.h> 67#include <unistd.h>
68#else 68#else
69#ifdef _OL_IMPORT_ 69#ifdef _OL_IMPORT_
70#include "koimportoldialog.h" 70#include "koimportoldialog.h"
71#endif 71#endif
72#endif 72#endif
73#include "mainwindow.h" 73#include "mainwindow.h"
74 74
75 75
76class KOex2phonePrefs : public QDialog 76class KOex2phonePrefs : public QDialog
77{ 77{
78 public: 78 public:
79 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 79 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
80 QDialog( parent, name, true ) 80 QDialog( parent, name, true )
81 { 81 {
82 setCaption( i18n("Export to phone options") ); 82 setCaption( i18n("Export to phone options") );
83 QVBoxLayout* lay = new QVBoxLayout( this ); 83 QVBoxLayout* lay = new QVBoxLayout( this );
84 lay->setSpacing( 3 ); 84 lay->setSpacing( 3 );
85 lay->setMargin( 3 ); 85 lay->setMargin( 3 );
86 QLabel *lab; 86 QLabel *lab;
87 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 87 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
88 lab->setAlignment (AlignHCenter ); 88 lab->setAlignment (AlignHCenter );
89 QHBox* temphb; 89 QHBox* temphb;
90 temphb = new QHBox( this ); 90 temphb = new QHBox( this );
91 new QLabel( i18n("I/O device: "), temphb ); 91 new QLabel( i18n("I/O device: "), temphb );
92 mPhoneDevice = new QLineEdit( temphb); 92 mPhoneDevice = new QLineEdit( temphb);
93 lay->addWidget( temphb ); 93 lay->addWidget( temphb );
94 temphb = new QHBox( this ); 94 temphb = new QHBox( this );
95 new QLabel( i18n("Connection: "), temphb ); 95 new QLabel( i18n("Connection: "), temphb );
96 mPhoneConnection = new QLineEdit( temphb); 96 mPhoneConnection = new QLineEdit( temphb);
97 lay->addWidget( temphb ); 97 lay->addWidget( temphb );
98 temphb = new QHBox( this ); 98 temphb = new QHBox( this );
99 new QLabel( i18n("Model(opt.): "), temphb ); 99 new QLabel( i18n("Model(opt.): "), temphb );
100 mPhoneModel = new QLineEdit( temphb); 100 mPhoneModel = new QLineEdit( temphb);
101 lay->addWidget( temphb ); 101 lay->addWidget( temphb );
102 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 102 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
103 mWriteBackFuture->setChecked( true ); 103 mWriteBackFuture->setChecked( true );
104 lay->addWidget( mWriteBackFuture ); 104 lay->addWidget( mWriteBackFuture );
105 temphb = new QHBox( this ); 105 temphb = new QHBox( this );
106 new QLabel( i18n("Max. weeks in future: ") , temphb ); 106 new QLabel( i18n("Max. weeks in future: ") , temphb );
107 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 107 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
108 mWriteBackFutureWeeks->setValue( 8 ); 108 mWriteBackFutureWeeks->setValue( 8 );
109 lay->addWidget( temphb ); 109 lay->addWidget( temphb );
110 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 110 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
111 lab->setAlignment (AlignHCenter ); 111 lab->setAlignment (AlignHCenter );
112 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 112 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
113 lay->addWidget( ok ); 113 lay->addWidget( ok );
114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
115 lay->addWidget( cancel ); 115 lay->addWidget( cancel );
116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
118 resize( 220, 240 ); 118 resize( 220, 240 );
119 qApp->processEvents(); 119 qApp->processEvents();
120 int dw = QApplication::desktop()->width(); 120 int dw = QApplication::desktop()->width();
121 int dh = QApplication::desktop()->height(); 121 int dh = QApplication::desktop()->height();
122 move( (dw-width())/2, (dh - height() )/2 ); 122 move( (dw-width())/2, (dh - height() )/2 );
123 } 123 }
124 124
125public: 125public:
126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
127 QCheckBox* mWriteBackFuture; 127 QCheckBox* mWriteBackFuture;
128 QSpinBox* mWriteBackFutureWeeks; 128 QSpinBox* mWriteBackFutureWeeks;
129}; 129};
130 130
131QPixmap* sgListViewCompletedPix[6]; 131QPixmap* sgListViewCompletedPix[6];
132QPixmap* sgListViewJournalPix; 132QPixmap* sgListViewJournalPix;
133 133
134 134
135int globalFlagBlockStartup; 135int globalFlagBlockStartup;
136MainWindow::MainWindow( QWidget *parent, const char *name ) : 136MainWindow::MainWindow( QWidget *parent, const char *name ) :
137 QMainWindow( parent, name ) 137 QMainWindow( parent, name )
138{ 138{
139 sgListViewCompletedPix[5] = &listviewPix; 139 sgListViewCompletedPix[5] = &listviewPix;
140 sgListViewCompletedPix[0] = &listviewPix0; 140 sgListViewCompletedPix[0] = &listviewPix0;
141 sgListViewCompletedPix[1] = &listviewPix20; 141 sgListViewCompletedPix[1] = &listviewPix20;
142 sgListViewCompletedPix[2] = &listviewPix40; 142 sgListViewCompletedPix[2] = &listviewPix40;
143 sgListViewCompletedPix[3] = &listviewPix60; 143 sgListViewCompletedPix[3] = &listviewPix60;
144 sgListViewCompletedPix[4] = &listviewPix80; 144 sgListViewCompletedPix[4] = &listviewPix80;
145 //int size = 12; 145 //int size = 12;
146 { 146 {
147 sgListViewCompletedPix[5]->resize( 11, 11 ); 147 sgListViewCompletedPix[5]->resize( 11, 11 );
148 sgListViewCompletedPix[5]->fill( Qt::white ); 148 sgListViewCompletedPix[5]->fill( Qt::white );
149 QPainter p ( sgListViewCompletedPix[5] ); 149 QPainter p ( sgListViewCompletedPix[5] );
150 p.drawRect( 0,0,11,11); 150 p.drawRect( 0,0,11,11);
151 p.drawLine ( 2, 5, 4 , 7 ) ; 151 p.drawLine ( 2, 5, 4 , 7 ) ;
152 p.drawLine ( 4 , 7 , 8, 3) ; 152 p.drawLine ( 4 , 7 , 8, 3) ;
153 int iii = 0; 153 int iii = 0;
154 for ( iii = 0; iii < 5; ++iii ) { 154 for ( iii = 0; iii < 5; ++iii ) {
155 sgListViewCompletedPix[iii]->resize( 11, 11 ); 155 sgListViewCompletedPix[iii]->resize( 11, 11 );
156 sgListViewCompletedPix[iii]->fill( Qt::white ); 156 sgListViewCompletedPix[iii]->fill( Qt::white );
157 QPainter p ( sgListViewCompletedPix[iii] ); 157 QPainter p ( sgListViewCompletedPix[iii] );
158 p.drawRect( 0,0,11,11); 158 p.drawRect( 0,0,11,11);
159 if ( iii ) 159 if ( iii )
160 p.fillRect( 1,1,iii*2,9,Qt::gray ); 160 p.fillRect( 1,1,iii*2,9,Qt::gray );
161 } 161 }
162 sgListViewJournalPix = &journalPix; 162 sgListViewJournalPix = &journalPix;
163 sgListViewJournalPix->resize( 11, 11 ); 163 sgListViewJournalPix->resize( 11, 11 );
164 sgListViewJournalPix->fill( Qt::white ); 164 sgListViewJournalPix->fill( Qt::white );
165 { 165 {
166 QPainter p ( sgListViewJournalPix ); 166 QPainter p ( sgListViewJournalPix );
167 p.drawRect( 0,0,11,11); 167 p.drawRect( 0,0,11,11);
168 p.drawLine( 2,3,5,3); 168 p.drawLine( 2,3,5,3);
169 p.drawLine( 2,5,8,5); 169 p.drawLine( 2,5,8,5);
170 p.drawLine( 2,7,6,7); 170 p.drawLine( 2,7,6,7);
171 } 171 }
172 } 172 }
173 mClosed = false; 173 mClosed = false;
174 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 174 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
175 QString confFile = locateLocal("config","korganizerrc"); 175 QString confFile = locateLocal("config","korganizerrc");
176 QFileInfo finf ( confFile ); 176 QFileInfo finf ( confFile );
177 bool showWarning = !finf.exists(); 177 bool showWarning = !finf.exists();
178 setIcon(SmallIcon( "ko24" ) ); 178 setIcon(SmallIcon( "ko24" ) );
179 mBlockAtStartup = true; 179 mBlockAtStartup = true;
180 mFlagKeyPressed = false; 180 mFlagKeyPressed = false;
181 setCaption("KO/Pi"); 181 setCaption("KO/Pi");
182 KOPrefs *p = KOPrefs::instance(); 182 KOPrefs *p = KOPrefs::instance();
183 //KPimGlobalPrefs::instance()->setGlobalConfig(); 183 //KPimGlobalPrefs::instance()->setGlobalConfig();
184 p->mCurrentDisplayedView = 0; 184 p->mCurrentDisplayedView = 0;
185 if ( p->mHourSize > 22 ) 185 if ( p->mHourSize > 22 )
186 p->mHourSize = 22; 186 p->mHourSize = 22;
187 QMainWindow::ToolBarDock tbd; 187 QMainWindow::ToolBarDock tbd;
188 if ( p->mToolBarHor ) { 188 if ( p->mToolBarHor ) {
189 if ( p->mToolBarUp ) 189 if ( p->mToolBarUp )
190 tbd = Bottom; 190 tbd = Bottom;
191 else 191 else
192 tbd = Top; 192 tbd = Top;
193 } 193 }
194 else { 194 else {
195 if ( p->mToolBarUp ) 195 if ( p->mToolBarUp )
196 tbd = Right; 196 tbd = Right;
197 else 197 else
198 tbd = Left; 198 tbd = Left;
199 } 199 }
200 if ( KOPrefs::instance()->mUseAppColors ) 200 if ( KOPrefs::instance()->mUseAppColors )
201 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 201 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
202 globalFlagBlockStartup = 1; 202 globalFlagBlockStartup = 1;
203 iconToolBar = new QPEToolBar( this ); 203 iconToolBar = new QPEToolBar( this );
204 addToolBar (iconToolBar , tbd ); 204 addToolBar (iconToolBar , tbd );
205 205
206#ifdef DESKTOP_VERSION 206#ifdef DESKTOP_VERSION
207 if ( KOPrefs::instance()->mShowIconFilter ) 207 if ( KOPrefs::instance()->mShowIconFilter )
208#else 208#else
209 if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) ) 209 if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) )
210#endif 210#endif
211 211
212{ 212{
213 if ( p->mToolBarHorF ) { 213 if ( p->mToolBarHorF ) {
214 if ( p->mToolBarUpF ) 214 if ( p->mToolBarUpF )
215 tbd = Bottom; 215 tbd = Bottom;
216 else 216 else
217 tbd = Top; 217 tbd = Top;
218 } 218 }
219 else { 219 else {
220 if ( p->mToolBarUpF ) 220 if ( p->mToolBarUpF )
221 tbd = Right; 221 tbd = Right;
222 else 222 else
223 tbd = Left; 223 tbd = Left;
224 } 224 }
225 filterToolBar = new QPEToolBar ( this ); 225 filterToolBar = new QPEToolBar ( this );
226 filterMenubar = new KMenuBar( 0 ); 226 filterMenubar = new KMenuBar( 0 );
227 QFontMetrics fm ( filterMenubar->font() ); 227 QFontMetrics fm ( filterMenubar->font() );
228#ifndef DESKTOP_VERSION 228#ifndef DESKTOP_VERSION
229 filterToolBar->setFocusPolicy( NoFocus ); 229 filterToolBar->setFocusPolicy( NoFocus );
230 filterMenubar->setFocusPolicy( NoFocus ); 230 filterMenubar->setFocusPolicy( NoFocus );
231#endif 231#endif
232 filterPopupMenu = new QPopupMenu( this ); 232 filterPopupMenu = new QPopupMenu( this );
233 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 233 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
234 QString addTest = "A"; 234 QString addTest = "A";
235 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 235 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
236#ifdef DESKTOP_VERSION 236#ifdef DESKTOP_VERSION
237 addTest = "AAAAAABBBCCCx"; 237 addTest = "AAAAAABBBCCCx";
238#else 238#else
239 addTest = "AAAAAx"; 239 addTest = "AAAAAx";
240#endif 240#endif
241 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 241 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
242 addToolBar (filterToolBar , tbd ); 242 addToolBar (filterToolBar , tbd );
243 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 243 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
244 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 244 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
245 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) 245 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
246 filterToolBar->hide(); 246 filterToolBar->hide();
247 } else { 247 } else {
248 filterToolBar = 0; 248 filterToolBar = 0;
249 filterMenubar = 0; 249 filterMenubar = 0;
250 filterPopupMenu = 0; 250 filterPopupMenu = 0;
251 } 251 }
252 if ( p->mShowIconOnetoolbar ) { 252 if ( p->mShowIconOnetoolbar ) {
253 viewToolBar = iconToolBar ; 253 viewToolBar = iconToolBar ;
254 navigatorToolBar = iconToolBar ; 254 navigatorToolBar = iconToolBar ;
255 } else { 255 } else {
256#ifndef DESKTOP_VERSION 256#ifndef DESKTOP_VERSION
257 setToolBarsMovable( false ); 257 setToolBarsMovable( false );
258#endif 258#endif
259 if ( p->mToolBarHorV ) { 259 if ( p->mToolBarHorV ) {
260 if ( p->mToolBarUpV ) 260 if ( p->mToolBarUpV )
261 tbd = Bottom; 261 tbd = Bottom;
262 else 262 else
263 tbd = Top; 263 tbd = Top;
264 } 264 }
265 else { 265 else {
266 if ( p->mToolBarUpV ) 266 if ( p->mToolBarUpV )
267 tbd = Right; 267 tbd = Right;
268 else 268 else
269 tbd = Left; 269 tbd = Left;
270 } 270 }
271 viewToolBar = new QPEToolBar( this ); 271 viewToolBar = new QPEToolBar( this );
272 addToolBar (viewToolBar , tbd ); 272 addToolBar (viewToolBar , tbd );
273 if ( p->mToolBarHorN ) { 273 if ( p->mToolBarHorN ) {
274 if ( p->mToolBarUpN ) 274 if ( p->mToolBarUpN )
275 tbd = Bottom; 275 tbd = Bottom;
276 else 276 else
277 tbd = Top; 277 tbd = Top;
278 } 278 }
279 else { 279 else {
280 if ( p->mToolBarUpN ) 280 if ( p->mToolBarUpN )
281 tbd = Right; 281 tbd = Right;
282 else 282 else
283 tbd = Left; 283 tbd = Left;
284 } 284 }
285 navigatorToolBar = new QPEToolBar( this ); 285 navigatorToolBar = new QPEToolBar( this );
286 addToolBar (navigatorToolBar , tbd ); 286 addToolBar (navigatorToolBar , tbd );
287 } 287 }
288 288
289 289
290 290
291 mCalendarModifiedFlag = false; 291 mCalendarModifiedFlag = false;
292 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 292 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
293 splash->setAlignment ( AlignCenter ); 293 splash->setAlignment ( AlignCenter );
294 setCentralWidget( splash ); 294 setCentralWidget( splash );
295#ifndef DESKTOP_VERSION 295#ifndef DESKTOP_VERSION
296 showMaximized(); 296 showMaximized();
297#endif 297#endif
298 298
299 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 299 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
300 setDefaultPreferences(); 300 setDefaultPreferences();
301 mCalendar = new CalendarLocal(); 301 mCalendar = new CalendarLocal();
302 mView = new CalendarView( mCalendar, this,"mCalendar " ); 302 mView = new CalendarView( mCalendar, this,"mCalendar " );
303 mView->hide(); 303 mView->hide();
304 //mView->resize(splash->size() ); 304 //mView->resize(splash->size() );
305 initActions(); 305 initActions();
306 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 306 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
307 mSyncManager->setBlockSave(false); 307 mSyncManager->setBlockSave(false);
308 mView->setSyncManager(mSyncManager); 308 mView->setSyncManager(mSyncManager);
309#ifndef DESKTOP_VERSION 309#ifndef DESKTOP_VERSION
310 iconToolBar->show(); 310 iconToolBar->show();
311 qApp->processEvents(); 311 qApp->processEvents();
312#endif 312#endif
313 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 313 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
314 int vh = height() ; 314 int vh = height() ;
315 int vw = width(); 315 int vw = width();
316 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 316 //qDebug("Toolbar hei %d ",iconToolBar->height() );
317 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 317 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
318 vh -= iconToolBar->height(); 318 vh -= iconToolBar->height();
319 } else { 319 } else {
320 vw -= iconToolBar->height(); 320 vw -= iconToolBar->height();
321 } 321 }
322 //mView->setMaximumSize( splash->size() ); 322 //mView->setMaximumSize( splash->size() );
323 //mView->resize( splash->size() ); 323 //mView->resize( splash->size() );
324 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 324 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
325 mView->readSettings(); 325 mView->readSettings();
326 bool newFile = false; 326 bool newFile = false;
327 if( !QFile::exists( defaultFileName() ) ) { 327 if( !QFile::exists( defaultFileName() ) ) {
328 QFileInfo finfo ( defaultFileName() ); 328 QFileInfo finfo ( defaultFileName() );
329 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 329 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
330 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; 330 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n";
331 finfo.setFile( oldFile ); 331 finfo.setFile( oldFile );
332 if (finfo.exists() ) { 332 if (finfo.exists() ) {
333 KMessageBox::information( this, message); 333 KMessageBox::information( this, message);
334 mView->openCalendar( oldFile ); 334 mView->openCalendar( oldFile );
335 qApp->processEvents(); 335 qApp->processEvents();
336 } else { 336 } else {
337 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 337 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
338 finfo.setFile( oldFile ); 338 finfo.setFile( oldFile );
339 if (finfo.exists() ) { 339 if (finfo.exists() ) {
340 KMessageBox::information( this, message); 340 KMessageBox::information( this, message);
341 mView->openCalendar( oldFile ); 341 mView->openCalendar( oldFile );
342 qApp->processEvents(); 342 qApp->processEvents();
343 } 343 }
344 } 344 }
345 mView->saveCalendar( defaultFileName() ); 345 mView->saveCalendar( defaultFileName() );
346 newFile = true; 346 newFile = true;
347 } 347 }
348 348
349 QTime neededSaveTime = QDateTime::currentDateTime().time(); 349 //QTime neededSaveTime = QDateTime::currentDateTime().time();
350 mView->loadCalendars(); 350 //mView->loadCalendars();
351 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 351 //int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
352 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 352 //qDebug("KO: Calendar loading time: %d ms",msNeeded );
353 353
354 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 354 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
355 KOPrefs::instance()->setAllDefaults(); 355 KOPrefs::instance()->setAllDefaults();
356 } 356 }
357 processIncidenceSelection( 0 );
358 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
359 SLOT( processIncidenceSelection( Incidence * ) ) );
360 connect( mView, SIGNAL( modifiedChanged( bool ) ),
361 SLOT( slotModifiedChanged( bool ) ) );
362 357
363 358
364 connect( mView, SIGNAL( tempDisableBR(bool) ), 359 connect( mView, SIGNAL( tempDisableBR(bool) ),
365 SLOT( disableBR(bool) ) ); 360 SLOT( disableBR(bool) ) );
366 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 361 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
367 mView->setModified( false );
368 mBlockAtStartup = false;
369 mView->setModified( false );
370 setCentralWidget( mView ); 362 setCentralWidget( mView );
371 globalFlagBlockStartup = 0; 363 globalFlagBlockStartup = 0;
372 mView->show(); 364 mView->show();
373 delete splash; 365 delete splash;
374 if ( newFile ) 366 if ( newFile )
375 mView->updateConfig(); 367 mView->updateConfig();
376 // qApp->processEvents(); 368 // qApp->processEvents();
377 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 369 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
378 //fillSyncMenu(); 370 //fillSyncMenu();
379 371
380 372
381 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 373 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
382 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
383 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 374 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
384 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 375 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
385 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 376 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
386 mSyncManager->setDefaultFileName( sentSyncFile()); 377 mSyncManager->setDefaultFileName( sentSyncFile());
387 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 378 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
388 mSyncManager->fillSyncMenu(); 379 mSyncManager->fillSyncMenu();
389 380
390 381
391 382
392 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 383 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
393 if ( showWarning ) { 384 if ( showWarning ) {
394 KMessageBox::information( this, 385 KMessageBox::information( this,
395 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 386 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
396 qApp->processEvents(); 387 qApp->processEvents();
397 mView->dialogManager()->showSyncOptions(); 388 mView->dialogManager()->showSyncOptions();
398 } 389 }
399 390
400 //US listen for result adressed from Ka/Pi 391 //US listen for result adressed from Ka/Pi
401#ifndef DESKTOP_VERSION 392
402 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
403#endif
404#ifndef DESKTOP_VERSION 393#ifndef DESKTOP_VERSION
405 infrared = 0; 394 infrared = 0;
406#endif 395#endif
407 updateFilterToolbar(); 396 updateFilterToolbar();
408 updateWeek( mView->startDate() ); 397 updateWeek( mView->startDate() );
409 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 398 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
410 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 399 SLOT( updateWeekNum( const KCal::DateList & ) ) );
411 mBRdisabled = false; 400 mBRdisabled = false;
412 //toggleBeamReceive(); 401 //toggleBeamReceive();
413 402
414 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 403 setCaption(i18n("Loading calendar files ... please wait" ));
404 QTimer::singleShot( 10, this, SLOT ( loadDataAfterStart() ));
415} 405}
416MainWindow::~MainWindow() 406MainWindow::~MainWindow()
417{ 407{
418 //qDebug("MainWindow::~MainWindow() "); 408 //qDebug("MainWindow::~MainWindow() ");
419 //save toolbar location 409 //save toolbar location
420 delete mCalendar; 410 delete mCalendar;
421 delete mSyncManager; 411 delete mSyncManager;
422#ifndef DESKTOP_VERSION 412#ifndef DESKTOP_VERSION
423 if ( infrared ) 413 if ( infrared )
424 delete infrared; 414 delete infrared;
425#endif 415#endif
426 416
427 417
428} 418}
419
420void MainWindow::loadDataAfterStart()
421{
422
423 qDebug("KO: Start loading files..." );
424 QTime neededSaveTime = QDateTime::currentDateTime().time();
425 mView->loadCalendars();
426 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
427 qDebug("KO: Calendar loading time: %d ms",msNeeded );
428 //QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
429 mView->setModified( false );
430 mBlockAtStartup = false;
431 mView->setModified( false );
432 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
433 processIncidenceSelection( 0 );
434 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
435 SLOT( processIncidenceSelection( Incidence * ) ) );
436 connect( mView, SIGNAL( modifiedChanged( bool ) ),
437 SLOT( slotModifiedChanged( bool ) ) );
438
439#ifndef DESKTOP_VERSION
440 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
441 connect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(recieve( const QCString&, const QByteArray& )));
442 disconnect( qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT(receiveStart( const QCString&, const QByteArray& )));
443 if ( !mCStringMess.isEmpty() )
444 recieve( mCStringMess, mByteData );
445#endif
446
447
448 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
449}
450
429void MainWindow::slotResetFocus() 451void MainWindow::slotResetFocus()
430{ 452{
431 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar); 453 //qDebug(" CalendarView::slotResetFocus() %x %x %x %x", qApp->focusWidget(), menuBar1, mView,iconToolBar);
432 mFocusLoop = 3; 454 mFocusLoop = 3;
433 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 455 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
434} 456}
435void MainWindow::slotResetFocusLoop() 457void MainWindow::slotResetFocusLoop()
436{ 458{
437 --mFocusLoop; 459 --mFocusLoop;
438 QWidget* fw = mView->viewManager()->currentView(); 460 QWidget* fw = mView->viewManager()->currentView();
439 if ( fw ) { 461 if ( fw ) {
440 //qDebug("loop "); 462 //qDebug("loop ");
441 fw->setFocus(); 463 fw->setFocus();
442 if ( qApp->focusWidget() != fw && mFocusLoop > 0 ) 464 if ( qApp->focusWidget() != fw && mFocusLoop > 0 )
443 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() )); 465 QTimer::singleShot( 0, this, SLOT(slotResetFocusLoop() ));
444 } 466 }
445 467
446} 468}
447void MainWindow::disableBR(bool b) 469void MainWindow::disableBR(bool b)
448{ 470{
449#ifndef DESKTOP_VERSION 471#ifndef DESKTOP_VERSION
450 if ( b ) { 472 if ( b ) {
451 if ( infrared ) { 473 if ( infrared ) {
452 toggleBeamReceive(); 474 toggleBeamReceive();
453 mBRdisabled = true; 475 mBRdisabled = true;
454 } 476 }
455 mBRdisabled = true; 477 mBRdisabled = true;
456 } else { 478 } else {
457 if ( mBRdisabled ) { 479 if ( mBRdisabled ) {
458 mBRdisabled = false; 480 mBRdisabled = false;
459 //makes no sense,because other cal ap is probably running 481 //makes no sense,because other cal ap is probably running
460 // toggleBeamReceive(); 482 // toggleBeamReceive();
461 } 483 }
462 } 484 }
463#endif 485#endif
464 486
465} 487}
466bool MainWindow::beamReceiveEnabled() 488bool MainWindow::beamReceiveEnabled()
467{ 489{
468#ifndef DESKTOP_VERSION 490#ifndef DESKTOP_VERSION
469 return ( infrared != 0 ); 491 return ( infrared != 0 );
470#endif 492#endif
471 return false; 493 return false;
472} 494}
473 495
474void MainWindow::toggleBeamReceive() 496void MainWindow::toggleBeamReceive()
475{ 497{
476 if ( mBRdisabled ) 498 if ( mBRdisabled )
477 return; 499 return;
478#ifndef DESKTOP_VERSION 500#ifndef DESKTOP_VERSION
479 if ( infrared ) { 501 if ( infrared ) {
480 qDebug("KO: Disable BeamReceive "); 502 qDebug("KO: Disable BeamReceive ");
481 delete infrared; 503 delete infrared;
482 infrared = 0; 504 infrared = 0;
483 brAction->setOn(false); 505 brAction->setOn(false);
484 return; 506 return;
485 } 507 }
486 qDebug("KO: Enable BeamReceive "); 508 qDebug("KO: Enable BeamReceive ");
487 brAction->setOn(true); 509 brAction->setOn(true);
488 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; 510 infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ;
489 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); 511 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& )));
490#endif 512#endif
491} 513}
492void MainWindow::showMaximized () 514void MainWindow::showMaximized ()
493{ 515{
494#ifndef DESKTOP_VERSION 516#ifndef DESKTOP_VERSION
495 if ( ! globalFlagBlockStartup ) 517 if ( ! globalFlagBlockStartup )
496 if ( mClosed ) 518 if ( mClosed )
497 mView->goToday(); 519 mView->goToday();
498#endif 520#endif
499 QWidget::showMaximized () ; 521 QWidget::showMaximized () ;
500 mClosed = false; 522 mClosed = false;
501} 523}
502void MainWindow::closeEvent( QCloseEvent* ce ) 524void MainWindow::closeEvent( QCloseEvent* ce )
503{ 525{
504 526
505 527
506 528
507 if ( ! KOPrefs::instance()->mAskForQuit ) { 529 if ( ! KOPrefs::instance()->mAskForQuit ) {
508 saveOnClose(); 530 saveOnClose();
509 if ( mCalendarModifiedFlag ) { 531 if ( mCalendarModifiedFlag ) {
510 ce->ignore(); 532 ce->ignore();
511 return; 533 return;
512 } 534 }
513 mClosed = true; 535 mClosed = true;
514 ce->accept(); 536 ce->accept();
515 return; 537 return;
516 538
517 } 539 }
518 540
519 switch( QMessageBox::information( this, "KO/Pi", 541 switch( QMessageBox::information( this, "KO/Pi",
520 i18n("Do you really want\nto close KO/Pi?"), 542 i18n("Do you really want\nto close KO/Pi?"),
521 i18n("Close"), i18n("No"), 543 i18n("Close"), i18n("No"),
522 0, 0 ) ) { 544 0, 0 ) ) {
523 case 0: 545 case 0:
524 saveOnClose(); 546 saveOnClose();
525 if ( mCalendarModifiedFlag ) { 547 if ( mCalendarModifiedFlag ) {
526 ce->ignore(); 548 ce->ignore();
527 return; 549 return;
528 } 550 }
529 mClosed = true; 551 mClosed = true;
530 ce->accept(); 552 ce->accept();
531 break; 553 break;
532 case 1: 554 case 1:
533 ce->ignore(); 555 ce->ignore();
534 break; 556 break;
535 case 2: 557 case 2:
536 558
537 default: 559 default:
538 break; 560 break;
539 } 561 }
540 562
541 563
542} 564}
543 565void MainWindow::receiveStart( const QCString& cmsg, const QByteArray& data )
566{
567 qDebug("KO: QCOP start message received: %s ", cmsg.data() );
568 mCStringMess = cmsg;
569 mByteData = data;
570}
544void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 571void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
545{ 572{
546 QDataStream stream( data, IO_ReadOnly ); 573 QDataStream stream( data, IO_ReadOnly );
547 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 574 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
548 //QString datamess; 575 //QString datamess;
549 //qDebug("message "); 576 //qDebug("message ");
550 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 577 qDebug("KO: QCOP message received: %s ", cmsg.data() );
551 578
552 if ( cmsg == "setDocument(QString)" ) { 579 if ( cmsg == "setDocument(QString)" ) {
553 QDataStream stream( data, IO_ReadOnly ); 580 QDataStream stream( data, IO_ReadOnly );
554 QString fileName; 581 QString fileName;
555 stream >> fileName; 582 stream >> fileName;
556 //qDebug("filename %s ", fileName.latin1()); 583 //qDebug("filename %s ", fileName.latin1());
557 showMaximized(); 584 showMaximized();
558 raise(); 585 raise();
559 KOPrefs::instance()->mLastSyncedLocalFile = fileName ; 586 KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
560 mSyncManager->slotSyncMenu( 1002 ); 587 mSyncManager->slotSyncMenu( 1002 );
561 return; 588 return;
562 } 589 }
563 590
564 if ( cmsg == "-writeFile" ) { 591 if ( cmsg == "-writeFile" ) {
565 // I made from the "-writeFile" an "-writeAlarm" 592 // I made from the "-writeFile" an "-writeAlarm"
566 mView->viewManager()->showWhatsNextView(); 593 mView->viewManager()->showWhatsNextView();
567 mCalendar->checkAlarmForIncidence( 0, true); 594 mCalendar->checkAlarmForIncidence( 0, true);
568 showMaximized(); 595 showMaximized();
569 raise(); 596 raise();
570 return; 597 return;
571 598
572 } 599 }
573 if ( cmsg == "-writeFileSilent" ) { 600 if ( cmsg == "-writeFileSilent" ) {
574 // I made from the "-writeFile" an "-writeAlarm" 601 // I made from the "-writeFile" an "-writeAlarm"
575 // mView->viewManager()->showWhatsNextView(); 602 // mView->viewManager()->showWhatsNextView();
576 mCalendar->checkAlarmForIncidence( 0, true); 603 mCalendar->checkAlarmForIncidence( 0, true);
577 //showMaximized(); 604 //showMaximized();
578 //raise(); 605 //raise();
579 hide(); 606 hide();
580 return; 607 return;
581 } 608 }
582 if ( cmsg == "-newCountdown" ) { 609 if ( cmsg == "-newCountdown" ) {
583 qDebug("newCountdown "); 610 qDebug("newCountdown ");
584 611
585 } 612 }
586 QString msg ; 613 QString msg ;
587 QString allmsg = cmsg; 614 QString allmsg = cmsg;
588 while ( allmsg.length() > 0 ) { 615 while ( allmsg.length() > 0 ) {
589 int nextC = allmsg.find( "-", 1 ); 616 int nextC = allmsg.find( "-", 1 );
590 if ( nextC == -1 ) { 617 if ( nextC == -1 ) {
591 msg = allmsg; 618 msg = allmsg;
592 allmsg = ""; 619 allmsg = "";
593 } else{ 620 } else{
594 msg = allmsg.left( nextC ); 621 msg = allmsg.left( nextC );
595 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 622 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
596 } 623 }
597 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 624 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
598 if ( msg == "-newEvent" ) { 625 if ( msg == "-newEvent" ) {
599 QTimer::singleShot( 0, mView, SLOT ( newEvent())); 626 QTimer::singleShot( 0, mView, SLOT ( newEvent()));
600 } 627 }
601 if ( msg == "-newTodo" ) { 628 if ( msg == "-newTodo" ) {
602 QTimer::singleShot( 0, mView, SLOT ( newTodo())); 629 QTimer::singleShot( 0, mView, SLOT ( newTodo()));
603 } 630 }
604 if ( msg == "-showWN" ) { 631 if ( msg == "-showWN" ) {
605 mView->viewManager()->showWhatsNextView(); 632 mView->viewManager()->showWhatsNextView();
606 } 633 }
607 if ( msg == "-showTodo" ) { 634 if ( msg == "-showTodo" ) {
608 mView->viewManager()->showTodoView(); 635 mView->viewManager()->showTodoView();
609 } 636 }
610 if ( msg == "-showList" ) { 637 if ( msg == "-showList" ) {
611 mView->viewManager()->showListView(); 638 mView->viewManager()->showListView();
612 } 639 }
613 else if ( msg == "-showDay" ) { 640 else if ( msg == "-showDay" ) {
614 mView->viewManager()->showDayView(); 641 mView->viewManager()->showDayView();
615 } 642 }
616 else if ( msg == "-showWWeek" ) { 643 else if ( msg == "-showWWeek" ) {
617 mView->viewManager()->showWorkWeekView(); 644 mView->viewManager()->showWorkWeekView();
618 } 645 }
619 else if ( msg == "-ringSync" ) { 646 else if ( msg == "-ringSync" ) {
620 QTimer::singleShot( 0, this, SLOT (startMultiSync())); 647 QTimer::singleShot( 0, this, SLOT (startMultiSync()));
621 } 648 }
622 else if ( msg == "-showWeek" ) { 649 else if ( msg == "-showWeek" ) {
623 mView->viewManager()->showWeekView(); 650 mView->viewManager()->showWeekView();
624 } 651 }
625 else if ( msg == "-showTodo" ) { 652 else if ( msg == "-showTodo" ) {
626 mView->viewManager()->showTodoView(); 653 mView->viewManager()->showTodoView();
627 } 654 }
628 else if ( msg == "-showJournal" ) { 655 else if ( msg == "-showJournal" ) {
629 mView->dateNavigator()->selectDates( 1 ); 656 mView->dateNavigator()->selectDates( 1 );
630 mView->dateNavigator()->selectToday(); 657 mView->dateNavigator()->selectToday();
631 mView->viewManager()->showJournalView(); 658 mView->viewManager()->showJournalView();
632 } 659 }
633 else if ( msg == "-showKO" ) { 660 else if ( msg == "-showKO" ) {
634 mView->viewManager()->showNextXView(); 661 mView->viewManager()->showNextXView();
635 } 662 }
636 else if ( msg == "-showWNext" ) { 663 else if ( msg == "-showWNext" ) {
637 mView->viewManager()->showWhatsNextView(); 664 mView->viewManager()->showWhatsNextView();
638 } 665 }
639 else if ( msg == "nextView()" ) { 666 else if ( msg == "nextView()" ) {
640 mView->viewManager()->showNextView(); 667 mView->viewManager()->showNextView();
641 } 668 }
642 else if ( msg == "-showNextXView" ) { 669 else if ( msg == "-showNextXView" ) {
643 mView->viewManager()->showNextXView(); 670 mView->viewManager()->showNextXView();
644 } 671 }
645 672
646 673
647 } 674 }
648 675
649 showMaximized(); 676 showMaximized();
650 raise(); 677 raise();
651} 678}
652void MainWindow::startMultiSync() 679void MainWindow::startMultiSync()
653{ 680{
654 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 681 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
655 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), 682 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"),
656 question, 683 question,
657 i18n("Yes"), i18n("No"), 684 i18n("Yes"), i18n("No"),
658 0, 0 ) != 0 ) { 685 0, 0 ) != 0 ) {
659 setCaption(i18n("Aborted! Nothing synced!")); 686 setCaption(i18n("Aborted! Nothing synced!"));
660 return; 687 return;
661 } 688 }
662 mSyncManager->multiSync( false ); 689 mSyncManager->multiSync( false );
663#ifndef DESKTOP_VERSION 690#ifndef DESKTOP_VERSION
664 QCopEnvelope e("QPE/Application/kapi", "doRingSync"); 691 QCopEnvelope e("QPE/Application/kapi", "doRingSync");
665#endif 692#endif
666} 693}
667QPixmap MainWindow::loadPixmap( QString name ) 694QPixmap MainWindow::loadPixmap( QString name )
668{ 695{
669 return SmallIcon( name ); 696 return SmallIcon( name );
670 697
671} 698}
672void MainWindow::setUsesBigPixmaps ( bool b ) 699void MainWindow::setUsesBigPixmaps ( bool b )
673{ 700{
674 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 701 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
675 if ( b ) 702 if ( b )
676 qDebug("KO: BigPixmaps are not supported "); 703 qDebug("KO: BigPixmaps are not supported ");
677} 704}
678void MainWindow::initActions() 705void MainWindow::initActions()
679{ 706{
680 //KOPrefs::instance()->mShowFullMenu 707 //KOPrefs::instance()->mShowFullMenu
681 iconToolBar->clear(); 708 iconToolBar->clear();
682 KOPrefs *p = KOPrefs::instance(); 709 KOPrefs *p = KOPrefs::instance();
683 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 710 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
684 711
685 QPopupMenu *viewMenu = new QPopupMenu( this ); 712 QPopupMenu *viewMenu = new QPopupMenu( this );
686 QPopupMenu *actionMenu = new QPopupMenu( this ); 713 QPopupMenu *actionMenu = new QPopupMenu( this );
687 mCurrentItemMenu = new QPopupMenu ( this ); 714 mCurrentItemMenu = new QPopupMenu ( this );
688 QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); 715 QPopupMenu *nextConflictMenu = new QPopupMenu ( this );
689 QPopupMenu *importMenu = new QPopupMenu( this ); 716 QPopupMenu *importMenu = new QPopupMenu( this );
690 QPopupMenu *importMenu_X = new QPopupMenu( this ); 717 QPopupMenu *importMenu_X = new QPopupMenu( this );
691 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 718 QPopupMenu *exportMenu_X = new QPopupMenu( this );
692 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 719 QPopupMenu *beamMenu_X = new QPopupMenu( this );
693 selectFilterMenu = new QPopupMenu( this ); 720 selectFilterMenu = new QPopupMenu( this );
694 selectFilterMenu->setCheckable( true ); 721 selectFilterMenu->setCheckable( true );
695 syncMenu = new QPopupMenu( this ); 722 syncMenu = new QPopupMenu( this );
696 configureAgendaMenu = new QPopupMenu( this ); 723 configureAgendaMenu = new QPopupMenu( this );
697 configureToolBarMenu = new QPopupMenu( this ); 724 configureToolBarMenu = new QPopupMenu( this );
698 QPopupMenu *helpMenu = new QPopupMenu( this ); 725 QPopupMenu *helpMenu = new QPopupMenu( this );
699 QIconSet icon; 726 QIconSet icon;
700 int pixWid = 22, pixHei = 22; 727 int pixWid = 22, pixHei = 22;
701 QString pathString = ""; 728 QString pathString = "";
702 if ( !p->mToolBarMiniIcons ) { 729 if ( !p->mToolBarMiniIcons ) {
703 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 730 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
704 pathString += "icons16/"; 731 pathString += "icons16/";
705 pixWid = 18; pixHei = 16; 732 pixWid = 18; pixHei = 16;
706 } 733 }
707 } else { 734 } else {
708 pathString += "iconsmini/"; 735 pathString += "iconsmini/";
709 pixWid = 18; pixHei = 16; 736 pixWid = 18; pixHei = 16;
710 } 737 }
711 738
712 if ( KOPrefs::instance()->mShowFullMenu ) { 739 if ( KOPrefs::instance()->mShowFullMenu ) {
713 menuBar1 = new KMenuBar( this );//menuBar(); 740 menuBar1 = new KMenuBar( this );//menuBar();
714 //setMenuBar( menuBar1 ); 741 //setMenuBar( menuBar1 );
715 menuBar1->show(); 742 menuBar1->show();
716 menuBar1->insertItem( i18n("File"), importMenu ); 743 menuBar1->insertItem( i18n("File"), importMenu );
717 menuBar1->insertItem( i18n("View"), viewMenu ); 744 menuBar1->insertItem( i18n("View"), viewMenu );
718 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); 745 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu );
719 menuBar1->insertItem( i18n("Action"), actionMenu ); 746 menuBar1->insertItem( i18n("Action"), actionMenu );
720#ifdef DESKTOP_VERSION 747#ifdef DESKTOP_VERSION
721 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 748 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
722 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 749 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
723#else 750#else
724 menuBar1->insertItem( i18n("Sync"), syncMenu ); 751 menuBar1->insertItem( i18n("Sync"), syncMenu );
725 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 752 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
726#endif 753#endif
727 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 754 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
728 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 755 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
729 menuBar1->insertItem( i18n("Help"), helpMenu ); 756 menuBar1->insertItem( i18n("Help"), helpMenu );
730 } else { 757 } else {
731 menuBar1 = new KMenuBar( iconToolBar ); 758 menuBar1 = new KMenuBar( iconToolBar );
732 QPopupMenu *menuBar = new QPopupMenu( this ); 759 QPopupMenu *menuBar = new QPopupMenu( this );
733 icon = loadPixmap( pathString + "z_menu" ); 760 icon = loadPixmap( pathString + "z_menu" );
734 menuBar1->insertItem( icon.pixmap(), menuBar); 761 menuBar1->insertItem( icon.pixmap(), menuBar);
735 //menuBar1->insertItem( i18n("ME"), menuBar); 762 //menuBar1->insertItem( i18n("ME"), menuBar);
736 menuBar->insertItem( i18n("File"), importMenu ); 763 menuBar->insertItem( i18n("File"), importMenu );
737 menuBar->insertItem( i18n("View"), viewMenu ); 764 menuBar->insertItem( i18n("View"), viewMenu );
738 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); 765 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu );
739 menuBar->insertItem( i18n("Action"), actionMenu ); 766 menuBar->insertItem( i18n("Action"), actionMenu );
740 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 767 menuBar->insertItem( i18n("Synchronize"), syncMenu );
741 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 768 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
742 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 769 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
743 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 770 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
744 menuBar->insertItem( i18n("Help"), helpMenu ); 771 menuBar->insertItem( i18n("Help"), helpMenu );
745 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 772 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
746 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 773 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
747 connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) ); 774 connect ( menuBar, SIGNAL( aboutToHide () ), this, SLOT ( slotResetFocus() ) );
748 } 775 }
749 connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); 776 connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
750 //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) ); 777 //connect ( menuBar1, SIGNAL( lostFocus () ), this, SLOT ( slotResetFocus() ) );
751 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 778 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
752 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 779 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
753 780
754 781
755 mWeekBgColor = iconToolBar->backgroundColor(); 782 mWeekBgColor = iconToolBar->backgroundColor();
756 mWeekPixmap.resize( pixWid , pixHei ); 783 mWeekPixmap.resize( pixWid , pixHei );
757 mWeekPixmap.fill( mWeekBgColor ); 784 mWeekPixmap.fill( mWeekBgColor );
758 icon = mWeekPixmap; 785 icon = mWeekPixmap;
759 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 786 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
760 if ( p-> mShowIconWeekNum ) 787 if ( p-> mShowIconWeekNum )
761 mWeekAction->addTo( iconToolBar ); 788 mWeekAction->addTo( iconToolBar );
762 mWeekFont = font(); 789 mWeekFont = font();
763 790
764 int fontPoint = mWeekFont.pointSize(); 791 int fontPoint = mWeekFont.pointSize();
765 QFontMetrics f( mWeekFont ); 792 QFontMetrics f( mWeekFont );
766 int fontWid = f.width( "30" ); 793 int fontWid = f.width( "30" );
767 while ( fontWid > pixWid ) { 794 while ( fontWid > pixWid ) {
768 --fontPoint; 795 --fontPoint;
769 mWeekFont.setPointSize( fontPoint ); 796 mWeekFont.setPointSize( fontPoint );
770 QFontMetrics f( mWeekFont ); 797 QFontMetrics f( mWeekFont );
771 fontWid = f.width( "30" ); 798 fontWid = f.width( "30" );
772 //qDebug("dec-- "); 799 //qDebug("dec-- ");
773 } 800 }
774 801
775 connect( mWeekAction, SIGNAL( activated() ), 802 connect( mWeekAction, SIGNAL( activated() ),
776 this, SLOT( weekAction() ) ); 803 this, SLOT( weekAction() ) );
777 804
778 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 805 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
779 if ( p->mShowIconFilterview ) { 806 if ( p->mShowIconFilterview ) {
780 icon = loadPixmap( pathString + "filter" ); 807 icon = loadPixmap( pathString + "filter" );
781 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 808 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
782 connect( actionFilterMenuTB, SIGNAL( activated() ), 809 connect( actionFilterMenuTB, SIGNAL( activated() ),
783 this, SLOT( fillFilterMenuTB() ) ); 810 this, SLOT( fillFilterMenuTB() ) );
784 actionFilterMenuTB->addTo( iconToolBar ); 811 actionFilterMenuTB->addTo( iconToolBar );
785 selectFilterMenuTB = new QPopupMenu( this ); 812 selectFilterMenuTB = new QPopupMenu( this );
786 selectFilterMenuTB->setCheckable( true ); 813 selectFilterMenuTB->setCheckable( true );
787 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 814 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
788 } 815 }
789 816
790 //#endif 817 //#endif
791 // ****************** 818 // ******************
792 QAction *action; 819 QAction *action;
793 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 820 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
794 configureToolBarMenu->setCheckable( true ); 821 configureToolBarMenu->setCheckable( true );
795 822
796 823
797 configureAgendaMenu->setCheckable( true ); 824 configureAgendaMenu->setCheckable( true );
798 int iii ; 825 int iii ;
799 for ( iii = 1;iii<= 10 ;++iii ){ 826 for ( iii = 1;iii<= 10 ;++iii ){
800 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 827 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
801 } 828 }
802 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 829 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
803 830
804 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 831 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
805 this, SLOT( showConfigureAgenda( ) ) ); 832 this, SLOT( showConfigureAgenda( ) ) );
806 icon = loadPixmap( pathString + "today" ); 833 icon = loadPixmap( pathString + "today" );
807 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 834 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
808 today_action->addTo( actionMenu ); 835 today_action->addTo( actionMenu );
809 connect( today_action, SIGNAL( activated() ), 836 connect( today_action, SIGNAL( activated() ),
810 mView, SLOT( goToday() ) ); 837 mView, SLOT( goToday() ) );
811 838
812 icon = loadPixmap( pathString + "picker" ); 839 icon = loadPixmap( pathString + "picker" );
813 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); 840 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
814 dPickerAction->addTo( actionMenu ); 841 dPickerAction->addTo( actionMenu );
815 connect( dPickerAction, SIGNAL( activated() ), 842 connect( dPickerAction, SIGNAL( activated() ),
816 mView, SLOT( showDatePicker() ) ); 843 mView, SLOT( showDatePicker() ) );
817 844
818 icon = loadPixmap( pathString + "search" ); 845 icon = loadPixmap( pathString + "search" );
819 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 846 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
820 search_action->addTo( actionMenu ); 847 search_action->addTo( actionMenu );
821 connect( search_action, SIGNAL( activated() ), 848 connect( search_action, SIGNAL( activated() ),
822 mView->dialogManager(), SLOT( showSearchDialog() ) ); 849 mView->dialogManager(), SLOT( showSearchDialog() ) );
823 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); 850 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
824 851
825 action = new QAction( "Undo Delete", i18n("All events"), 0, this ); 852 action = new QAction( "Undo Delete", i18n("All events"), 0, this );
826 action->addTo( nextConflictMenu ); 853 action->addTo( nextConflictMenu );
827 connect( action, SIGNAL( activated() ), 854 connect( action, SIGNAL( activated() ),
828 mView, SLOT( conflictAll() ) ); 855 mView, SLOT( conflictAll() ) );
829 856
830 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); 857 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
831 action->addTo( nextConflictMenu ); 858 action->addTo( nextConflictMenu );
832 connect( action, SIGNAL( activated() ), 859 connect( action, SIGNAL( activated() ),
833 mView, SLOT( conflictAllday() ) ); 860 mView, SLOT( conflictAllday() ) );
834 861
835 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); 862 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
836 action->addTo( nextConflictMenu ); 863 action->addTo( nextConflictMenu );
837 connect( action, SIGNAL( activated() ), 864 connect( action, SIGNAL( activated() ),
838 mView, SLOT( conflictNotAll() ) ); 865 mView, SLOT( conflictNotAll() ) );
839 866
840 actionMenu->insertSeparator(); 867 actionMenu->insertSeparator();
841 868
842 icon = loadPixmap( pathString + "newevent" ); 869 icon = loadPixmap( pathString + "newevent" );
843 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 870 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
844 ne_action->addTo( mCurrentItemMenu ); 871 ne_action->addTo( mCurrentItemMenu );
845 connect( ne_action, SIGNAL( activated() ), 872 connect( ne_action, SIGNAL( activated() ),
846 mView, SLOT( newEvent() ) ); 873 mView, SLOT( newEvent() ) );
847 icon = loadPixmap( pathString + "newtodo" ); 874 icon = loadPixmap( pathString + "newtodo" );
848 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 875 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
849 nt_action->addTo( mCurrentItemMenu ); 876 nt_action->addTo( mCurrentItemMenu );
850 connect( nt_action, SIGNAL( activated() ), 877 connect( nt_action, SIGNAL( activated() ),
851 mView, SLOT( newTodo() ) ); 878 mView, SLOT( newTodo() ) );
852 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 879 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
853 this ); 880 this );
854 mNewSubTodoAction->addTo( mCurrentItemMenu ); 881 mNewSubTodoAction->addTo( mCurrentItemMenu );
855 connect( mNewSubTodoAction, SIGNAL( activated() ), 882 connect( mNewSubTodoAction, SIGNAL( activated() ),
856 mView, SLOT( newSubTodo() ) ); 883 mView, SLOT( newSubTodo() ) );
857 884
858 mCurrentItemMenu->insertSeparator(); 885 mCurrentItemMenu->insertSeparator();
859 icon = loadPixmap( pathString + "newevent" ); 886 icon = loadPixmap( pathString + "newevent" );
860 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 887 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
861 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 888 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
862 configureToolBarMenu->insertSeparator(); 889 configureToolBarMenu->insertSeparator();
863 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 890 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
864 configureToolBarMenu->insertSeparator(); 891 configureToolBarMenu->insertSeparator();
865 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 892 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
866 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 893 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
867 icon = loadPixmap( pathString + "newtodo" ); 894 icon = loadPixmap( pathString + "newtodo" );
868 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 895 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
869 896
870 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 897 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
871 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); 898 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
872 mShowAction->addTo( mCurrentItemMenu ); 899 mShowAction->addTo( mCurrentItemMenu );
873 connect( mShowAction, SIGNAL( activated() ), 900 connect( mShowAction, SIGNAL( activated() ),
874 mView, SLOT( showIncidence() ) ); 901 mView, SLOT( showIncidence() ) );
875 902
876 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 903 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
877 mEditAction->addTo( mCurrentItemMenu ); 904 mEditAction->addTo( mCurrentItemMenu );
878 connect( mEditAction, SIGNAL( activated() ), 905 connect( mEditAction, SIGNAL( activated() ),
879 mView, SLOT( editIncidence() ) ); 906 mView, SLOT( editIncidence() ) );
880 907
881 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 908 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
882 mDeleteAction->addTo( mCurrentItemMenu ); 909 mDeleteAction->addTo( mCurrentItemMenu );
883 connect( mDeleteAction, SIGNAL( activated() ), 910 connect( mDeleteAction, SIGNAL( activated() ),
884 mView, SLOT( deleteIncidence() ) ); 911 mView, SLOT( deleteIncidence() ) );
885 912
886 913
887 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 914 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
888 mCloneAction->addTo( mCurrentItemMenu ); 915 mCloneAction->addTo( mCurrentItemMenu );
889 connect( mCloneAction, SIGNAL( activated() ), 916 connect( mCloneAction, SIGNAL( activated() ),
890 mView, SLOT( cloneIncidence() ) ); 917 mView, SLOT( cloneIncidence() ) );
891 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 918 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
892 mMoveAction->addTo( mCurrentItemMenu ); 919 mMoveAction->addTo( mCurrentItemMenu );
893 connect( mMoveAction, SIGNAL( activated() ), 920 connect( mMoveAction, SIGNAL( activated() ),
894 mView, SLOT( moveIncidence() ) ); 921 mView, SLOT( moveIncidence() ) );
895#ifndef DESKTOP_VERSION 922#ifndef DESKTOP_VERSION
896 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 923 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
897 mBeamAction->addTo(mCurrentItemMenu ); 924 mBeamAction->addTo(mCurrentItemMenu );
898 connect( mBeamAction, SIGNAL( activated() ), 925 connect( mBeamAction, SIGNAL( activated() ),
899 mView, SLOT( beamIncidence() ) ); 926 mView, SLOT( beamIncidence() ) );
900#endif 927#endif
901 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 928 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
902 mCancelAction->addTo( mCurrentItemMenu ); 929 mCancelAction->addTo( mCurrentItemMenu );
903 connect( mCancelAction, SIGNAL( activated() ), 930 connect( mCancelAction, SIGNAL( activated() ),
904 mView, SLOT( toggleCancelIncidence() ) ); 931 mView, SLOT( toggleCancelIncidence() ) );
905 932
906 933
907 mCurrentItemMenu->insertSeparator(); 934 mCurrentItemMenu->insertSeparator();
908 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 935 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
909 action->addTo( mCurrentItemMenu ); 936 action->addTo( mCurrentItemMenu );
910 connect( action, SIGNAL( activated() ), 937 connect( action, SIGNAL( activated() ),
911 mView, SLOT( undo_delete() ) ); 938 mView, SLOT( undo_delete() ) );
912 939
913 // *********************** 940 // ***********************
914 if ( KOPrefs::instance()->mVerticalScreen ) { 941 if ( KOPrefs::instance()->mVerticalScreen ) {
915 icon = SmallIcon( "1updownarrow" ); 942 icon = SmallIcon( "1updownarrow" );
916 } else { 943 } else {
917 icon = SmallIcon("1leftrightarrow" ); 944 icon = SmallIcon("1leftrightarrow" );
918 } 945 }
919 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 946 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
920 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 947 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
921 FSaction->addTo( viewMenu ); 948 FSaction->addTo( viewMenu );
922 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 949 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
923 950
924 951
925 icon = loadPixmap( pathString + "filter" ); 952 icon = loadPixmap( pathString + "filter" );
926 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 953 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
927 icon = loadPixmap( pathString + "configure" ); 954 icon = loadPixmap( pathString + "configure" );
928 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); 955 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
929 action->addTo( viewMenu ); 956 action->addTo( viewMenu );
930 connect( action, SIGNAL( activated() ), 957 connect( action, SIGNAL( activated() ),
931 mView, SLOT( toggleFilter() ) ); 958 mView, SLOT( toggleFilter() ) );
932 mToggleFilter = action; 959 mToggleFilter = action;
933 icon = loadPixmap( pathString + "navi" ); 960 icon = loadPixmap( pathString + "navi" );
934 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 961 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
935 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 962 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
936 action->addTo( viewMenu ); 963 action->addTo( viewMenu );
937 connect( action, SIGNAL( activated() ), 964 connect( action, SIGNAL( activated() ),
938 mView, SLOT( toggleDateNavigatorWidget() ) ); 965 mView, SLOT( toggleDateNavigatorWidget() ) );
939 mToggleNav = action ; 966 mToggleNav = action ;
940 icon = loadPixmap( pathString + "allday" ); 967 icon = loadPixmap( pathString + "allday" );
941 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 968 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
942 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 969 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
943 action->addTo( viewMenu ); 970 action->addTo( viewMenu );
944 connect( action, SIGNAL( activated() ), 971 connect( action, SIGNAL( activated() ),
945 mView, SLOT( toggleAllDaySize() ) ); 972 mView, SLOT( toggleAllDaySize() ) );
946 mToggleAllday = action; 973 mToggleAllday = action;
947 974
948 975
949 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 976 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
950 mToggleNav, SLOT( setEnabled ( bool ) ) ); 977 mToggleNav, SLOT( setEnabled ( bool ) ) );
951 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 978 //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
952 // mToggleFilter, SLOT( setEnabled ( bool ) ) ); 979 // mToggleFilter, SLOT( setEnabled ( bool ) ) );
953 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 980 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
954 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 981 mToggleAllday, SLOT( setEnabled ( bool ) ) );
955 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 982 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
956 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); 983 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) );
957 984
958 985
959 dPickerAction->addTo( iconToolBar ); 986 dPickerAction->addTo( iconToolBar );
960 viewMenu->insertSeparator(); 987 viewMenu->insertSeparator();
961 988
962 if ( p-> mShowIconToggleFull ) 989 if ( p-> mShowIconToggleFull )
963 FSaction->addTo( iconToolBar ); 990 FSaction->addTo( iconToolBar );
964 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 991 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
965 992
966 //******************** 993 //********************
967 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 994 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
968 995
969 996
970 icon = loadPixmap( pathString + "whatsnext" ); 997 icon = loadPixmap( pathString + "whatsnext" );
971 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 998 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
972 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 999 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
973 whatsnext_action->addTo( viewMenu ); 1000 whatsnext_action->addTo( viewMenu );
974 connect( whatsnext_action, SIGNAL( activated() ), 1001 connect( whatsnext_action, SIGNAL( activated() ),
975 mView->viewManager(), SLOT( showWhatsNextView() ) ); 1002 mView->viewManager(), SLOT( showWhatsNextView() ) );
976 1003
977 icon = loadPixmap( pathString + "xdays" ); 1004 icon = loadPixmap( pathString + "xdays" );
978 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 1005 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
979 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 1006 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
980 xdays_action->addTo( viewMenu ); 1007 xdays_action->addTo( viewMenu );
981 connect( xdays_action, SIGNAL( activated() ), 1008 connect( xdays_action, SIGNAL( activated() ),
982 mView->viewManager(), SLOT( showNextXView() ) ); 1009 mView->viewManager(), SLOT( showNextXView() ) );
983 1010
984 1011
985 icon = loadPixmap( pathString + "journal" ); 1012 icon = loadPixmap( pathString + "journal" );
986 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 1013 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
987 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 1014 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
988 viewjournal_action->addTo( viewMenu ); 1015 viewjournal_action->addTo( viewMenu );
989 connect( viewjournal_action, SIGNAL( activated() ), 1016 connect( viewjournal_action, SIGNAL( activated() ),
990 mView->viewManager(), SLOT( showJournalView() ) ); 1017 mView->viewManager(), SLOT( showJournalView() ) );
991 1018
992 1019
993 icon = loadPixmap( pathString + "day" ); 1020 icon = loadPixmap( pathString + "day" );
994 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 1021 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
995 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 1022 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
996 day1_action->addTo( viewMenu ); 1023 day1_action->addTo( viewMenu );
997 // action->addTo( toolBar ); 1024 // action->addTo( toolBar );
998 connect( day1_action, SIGNAL( activated() ), 1025 connect( day1_action, SIGNAL( activated() ),
999 mView->viewManager(), SLOT( showDayView() ) ); 1026 mView->viewManager(), SLOT( showDayView() ) );
1000 1027
1001 icon = loadPixmap( pathString + "workweek" ); 1028 icon = loadPixmap( pathString + "workweek" );
1002 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 1029 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
1003 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 1030 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
1004 day5_action->addTo( viewMenu ); 1031 day5_action->addTo( viewMenu );
1005 connect( day5_action, SIGNAL( activated() ), 1032 connect( day5_action, SIGNAL( activated() ),
1006 mView->viewManager(), SLOT( showWorkWeekView() ) ); 1033 mView->viewManager(), SLOT( showWorkWeekView() ) );
1007 1034
1008 icon = loadPixmap( pathString + "week" ); 1035 icon = loadPixmap( pathString + "week" );
1009 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 1036 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
1010 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 1037 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
1011 day7_action->addTo( viewMenu ); 1038 day7_action->addTo( viewMenu );
1012 connect( day7_action, SIGNAL( activated() ), 1039 connect( day7_action, SIGNAL( activated() ),
1013 mView->viewManager(), SLOT( showWeekView() ) ); 1040 mView->viewManager(), SLOT( showWeekView() ) );
1014 1041
1015 icon = loadPixmap( pathString + "workweek2" ); 1042 icon = loadPixmap( pathString + "workweek2" );
1016 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 1043 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
1017 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 1044 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
1018 day6_action->addTo( viewMenu ); 1045 day6_action->addTo( viewMenu );
1019 connect( day6_action, SIGNAL( activated() ), 1046 connect( day6_action, SIGNAL( activated() ),
1020 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 1047 mView->viewManager(), SLOT( showMonthViewWeek() ) );
1021 1048
1022 icon = loadPixmap( pathString + "month" ); 1049 icon = loadPixmap( pathString + "month" );
1023 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 1050 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
1024 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 1051 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
1025 month_action->addTo( viewMenu ); 1052 month_action->addTo( viewMenu );
1026 connect( month_action, SIGNAL( activated() ), 1053 connect( month_action, SIGNAL( activated() ),
1027 mView->viewManager(), SLOT( showMonthView() ) ); 1054 mView->viewManager(), SLOT( showMonthView() ) );
1028 1055
1029 icon = loadPixmap( pathString + "list" ); 1056 icon = loadPixmap( pathString + "list" );
1030 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 1057 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
1031 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 1058 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
1032 showlist_action->addTo( viewMenu ); 1059 showlist_action->addTo( viewMenu );
1033 connect( showlist_action, SIGNAL( activated() ), 1060 connect( showlist_action, SIGNAL( activated() ),
1034 mView->viewManager(), SLOT( showListView() ) ); 1061 mView->viewManager(), SLOT( showListView() ) );
1035 1062
1036 icon = loadPixmap( pathString + "todo" ); 1063 icon = loadPixmap( pathString + "todo" );
1037 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 1064 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
1038 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 1065 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
1039 todoview_action->addTo( viewMenu ); 1066 todoview_action->addTo( viewMenu );
1040 connect( todoview_action, SIGNAL( activated() ), 1067 connect( todoview_action, SIGNAL( activated() ),
1041 mView->viewManager(), SLOT( showTodoView() ) ); 1068 mView->viewManager(), SLOT( showTodoView() ) );
1042 1069
1043 1070
1044 1071
1045#if 0 1072#if 0
1046 action = new QAction( "view_timespan", "Time Span", 0, this ); 1073 action = new QAction( "view_timespan", "Time Span", 0, this );
1047 action->addTo( viewMenu ); 1074 action->addTo( viewMenu );
1048 connect( action, SIGNAL( activated() ), 1075 connect( action, SIGNAL( activated() ),
1049 mView->viewManager(), SLOT( showTimeSpanView() ) ); 1076 mView->viewManager(), SLOT( showTimeSpanView() ) );
1050#endif 1077#endif
1051 1078
1052 1079
1053 1080
1054 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, 1081 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0,
1055 this ); 1082 this );
1056 action->addTo( actionMenu ); 1083 action->addTo( actionMenu );
1057 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 1084 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
1058 1085
1059 1086
1060 icon = loadPixmap( pathString + "search" ); 1087 icon = loadPixmap( pathString + "search" );
1061 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 1088 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
1062 1089
1063 1090
1064 1091
1065 actionMenu->insertSeparator(); 1092 actionMenu->insertSeparator();
1066 action = new QAction( "manage cat", i18n("Edit category list..."), 0, 1093 action = new QAction( "manage cat", i18n("Edit category list..."), 0,
1067 this ); 1094 this );
1068 action->addTo( actionMenu ); 1095 action->addTo( actionMenu );
1069 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); 1096 connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) );
1070 1097
1071 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 1098 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
1072 this ); 1099 this );
1073 action->addTo( actionMenu ); 1100 action->addTo( actionMenu );
1074 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 1101 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
1075 1102
1076 1103
1077 actionMenu->insertSeparator(); 1104 actionMenu->insertSeparator();
1078 icon = loadPixmap( pathString + "configure" ); 1105 icon = loadPixmap( pathString + "configure" );
1079 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); 1106 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
1080 action->addTo( actionMenu ); 1107 action->addTo( actionMenu );
1081 connect( action, SIGNAL( activated() ), 1108 connect( action, SIGNAL( activated() ),
1082 mView, SLOT( edit_options() ) ); 1109 mView, SLOT( edit_options() ) );
1083 action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); 1110 action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this );
1084 action->addTo( actionMenu ); 1111 action->addTo( actionMenu );
1085 connect( action, SIGNAL( activated() ), 1112 connect( action, SIGNAL( activated() ),
1086 this, SLOT( calHint() ) ); 1113 this, SLOT( calHint() ) );
1087 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); 1114 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
1088 action->addTo( actionMenu ); 1115 action->addTo( actionMenu );
1089 connect( action, SIGNAL( activated() ), 1116 connect( action, SIGNAL( activated() ),
1090 mView, SLOT( edit_global_options() ) ); 1117 mView, SLOT( edit_global_options() ) );
1091 if ( KOPrefs::instance()->mShowFullMenu ) { 1118 if ( KOPrefs::instance()->mShowFullMenu ) {
1092 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 1119 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
1093 1120
1094 } 1121 }
1095 // actionMenu->insertSeparator(); 1122 // actionMenu->insertSeparator();
1096 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 1123 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
1097 this ); 1124 this );
1098 action->addTo( importMenu_X ); 1125 action->addTo( importMenu_X );
1099 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 1126 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
1100 action = new QAction( "import_quick", i18n("Import last file"), 0, 1127 action = new QAction( "import_quick", i18n("Import last file"), 0,
1101 this ); 1128 this );
1102 action->addTo( importMenu_X ); 1129 action->addTo( importMenu_X );
1103 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 1130 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
1104 importMenu_X->insertSeparator(); 1131 importMenu_X->insertSeparator();
1105 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 1132 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
1106 this ); 1133 this );
1107 action->addTo( importMenu_X ); 1134 action->addTo( importMenu_X );
1108 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 1135 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
1109 //#ifndef DESKTOP_VERSION 1136 //#ifndef DESKTOP_VERSION
1110 importMenu_X->insertSeparator(); 1137 importMenu_X->insertSeparator();
1111 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 1138 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
1112 this ); 1139 this );
1113 action->addTo( importMenu_X ); 1140 action->addTo( importMenu_X );
1114 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 1141 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
1115 //#else 1142 //#else
1116#ifdef _OL_IMPORT_ 1143#ifdef _OL_IMPORT_
1117 importMenu_X->insertSeparator(); 1144 importMenu_X->insertSeparator();
1118 action = new QAction( "import_ol", i18n("Import from OL"), 0, 1145 action = new QAction( "import_ol", i18n("Import from OL"), 0,
1119 this ); 1146 this );
1120 action->addTo( importMenu_X ); 1147 action->addTo( importMenu_X );
1121 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 1148 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
1122#endif 1149#endif
1123 //#endif 1150 //#endif
1124 1151
1125 //importMenu->insertSeparator(); 1152 //importMenu->insertSeparator();
1126#if 0 1153#if 0
1127 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 1154 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
1128 this ); 1155 this );
1129 action->addTo( importMenu ); 1156 action->addTo( importMenu );
1130 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 1157 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
1131#endif 1158#endif
1132 action = new QAction( "save_cal", i18n("Save Backup..."), 0, 1159 action = new QAction( "save_cal", i18n("Save Backup..."), 0,
1133 this ); 1160 this );
1134 action->addTo( importMenu ); 1161 action->addTo( importMenu );
1135 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 1162 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
1136 importMenu->insertSeparator(); 1163 importMenu->insertSeparator();
1137 importMenu->insertItem( i18n("Import"), importMenu_X ); 1164 importMenu->insertItem( i18n("Import"), importMenu_X );
1138 //importMenu->insertSeparator(); 1165 //importMenu->insertSeparator();
1139 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 1166 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
1140 this ); 1167 this );
1141 action->addTo( exportMenu_X ); 1168 action->addTo( exportMenu_X );
1142 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 1169 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
1143 1170
1144 1171
1145 //LR 1172 //LR
1146 QPopupMenu *ex2phone = new QPopupMenu( this ); 1173 QPopupMenu *ex2phone = new QPopupMenu( this );
1147 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1174 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1148 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1175 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1149 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 1176 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
1150 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 1177 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
1151 1178
1152 importMenu->insertItem( i18n("Export"), exportMenu_X ); 1179 importMenu->insertItem( i18n("Export"), exportMenu_X );
1153 mPrintSelAction = 0; 1180 mPrintSelAction = 0;
1154#ifndef DESKTOP_VERSION 1181#ifndef DESKTOP_VERSION
1155 //importMenu->insertSeparator(); 1182 //importMenu->insertSeparator();
1156 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 1183 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
1157 this ); 1184 this );
1158 brAction->addTo( beamMenu_X ); 1185 brAction->addTo( beamMenu_X );
1159 brAction->setToggleAction (true ) ; 1186 brAction->setToggleAction (true ) ;
1160 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 1187 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
1161 1188
1162 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 1189 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
1163 this ); 1190 this );
1164 action->addTo( beamMenu_X ); 1191 action->addTo( beamMenu_X );
1165 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 1192 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
1166 1193
1167 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 1194 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
1168 this ); 1195 this );
1169 action->addTo( beamMenu_X ); 1196 action->addTo( beamMenu_X );
1170 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 1197 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
1171 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 1198 importMenu->insertItem( i18n("Beam"), beamMenu_X );
1172#else 1199#else
1173 //importMenu->insertSeparator(); 1200 //importMenu->insertSeparator();
1174 icon = loadPixmap( pathString + "print" ); 1201 icon = loadPixmap( pathString + "print" );
1175 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 1202 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
1176 action->addTo( beamMenu_X ); 1203 action->addTo( beamMenu_X );
1177 connect( action, SIGNAL( activated() ), 1204 connect( action, SIGNAL( activated() ),
1178 this, SLOT( printCal() ) ); 1205 this, SLOT( printCal() ) );
1179 1206
1180 icon = loadPixmap( pathString + "week" ); 1207 icon = loadPixmap( pathString + "week" );
1181 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 1208 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
1182 action->addTo( beamMenu_X ); 1209 action->addTo( beamMenu_X );
1183 connect( action, SIGNAL( activated() ), 1210 connect( action, SIGNAL( activated() ),
1184 this, SLOT( printSel() ) ); 1211 this, SLOT( printSel() ) );
1185 icon = loadPixmap( pathString + "whatsnext" ); 1212 icon = loadPixmap( pathString + "whatsnext" );
1186 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 1213 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
1187 action->addTo( beamMenu_X ); 1214 action->addTo( beamMenu_X );
1188 connect( action, SIGNAL( activated() ), 1215 connect( action, SIGNAL( activated() ),
1189 mView->viewManager(), SLOT( slotprintWNV() ) ); 1216 mView->viewManager(), SLOT( slotprintWNV() ) );
1190 1217
1191 1218
1192 icon = loadPixmap( pathString + "list" ); 1219 icon = loadPixmap( pathString + "list" );
1193 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); 1220 action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this );
1194 action->addTo( beamMenu_X ); 1221 action->addTo( beamMenu_X );
1195 connect( action, SIGNAL( activated() ), 1222 connect( action, SIGNAL( activated() ),
1196 this, SLOT( printListView() ) ); 1223 this, SLOT( printListView() ) );
1197 1224
1198 icon = loadPixmap( pathString + "newevent" ); 1225 icon = loadPixmap( pathString + "newevent" );
1199 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); 1226 action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this );
1200 action->addTo( beamMenu_X ); 1227 action->addTo( beamMenu_X );
1201 connect( action, SIGNAL( activated() ), 1228 connect( action, SIGNAL( activated() ),
1202 mView, SLOT( slotprintSelInc() ) ); 1229 mView, SLOT( slotprintSelInc() ) );
1203 mPrintSelAction = action; 1230 mPrintSelAction = action;
1204 importMenu->insertItem( i18n("Print"), beamMenu_X ); 1231 importMenu->insertItem( i18n("Print"), beamMenu_X );
1205#endif 1232#endif
1206 1233
1207 importMenu->insertSeparator(); 1234 importMenu->insertSeparator();
1208 action = new QAction( "beam all", i18n("Save"), 0, 1235 action = new QAction( "beam all", i18n("Save"), 0,
1209 this ); 1236 this );
1210 action->addTo( importMenu ); 1237 action->addTo( importMenu );
1211 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 1238 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
1212 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 1239 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
1213 this ); 1240 this );
1214 action->addTo( importMenu ); 1241 action->addTo( importMenu );
1215 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 1242 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
1216 1243
1217 //menuBar->insertItem( "Configure",configureMenu ); 1244 //menuBar->insertItem( "Configure",configureMenu );
1218 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 1245 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
1219 icon = loadPixmap( "korganizer/korganizer" ); 1246 icon = loadPixmap( "korganizer/korganizer" );
1220 1247
1221 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 1248 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
1222 action->addTo( helpMenu ); 1249 action->addTo( helpMenu );
1223 connect( action, SIGNAL( activated() ), 1250 connect( action, SIGNAL( activated() ),
1224 SLOT( whatsNew() ) ); 1251 SLOT( whatsNew() ) );
1225 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 1252 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
1226 action->addTo( helpMenu ); 1253 action->addTo( helpMenu );
1227 connect( action, SIGNAL( activated() ), 1254 connect( action, SIGNAL( activated() ),
1228 SLOT( features() ) ); 1255 SLOT( features() ) );
1229 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 1256 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
1230 action->addTo( helpMenu ); 1257 action->addTo( helpMenu );
1231 connect( action, SIGNAL( activated() ), 1258 connect( action, SIGNAL( activated() ),
1232 SLOT( keyBindings() ) ); 1259 SLOT( keyBindings() ) );
1233 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); 1260 action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this );
1234 action->addTo( helpMenu ); 1261 action->addTo( helpMenu );
1235 connect( action, SIGNAL( activated() ), 1262 connect( action, SIGNAL( activated() ),
1236 SLOT( storagehowto() ) ); 1263 SLOT( storagehowto() ) );
1237 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); 1264 action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this );
1238 action->addTo( helpMenu ); 1265 action->addTo( helpMenu );
1239 connect( action, SIGNAL( activated() ), 1266 connect( action, SIGNAL( activated() ),
1240 SLOT( timetrackinghowto() ) ); 1267 SLOT( timetrackinghowto() ) );
1241 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 1268 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
1242 action->addTo( helpMenu ); 1269 action->addTo( helpMenu );
1243 connect( action, SIGNAL( activated() ), 1270 connect( action, SIGNAL( activated() ),
1244 SLOT( synchowto() ) ); 1271 SLOT( synchowto() ) );
1245 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 1272 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
1246 action->addTo( helpMenu ); 1273 action->addTo( helpMenu );
1247 connect( action, SIGNAL( activated() ), 1274 connect( action, SIGNAL( activated() ),
1248 SLOT( kdesynchowto() ) ); 1275 SLOT( kdesynchowto() ) );
1249 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 1276 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
1250 action->addTo( helpMenu ); 1277 action->addTo( helpMenu );
1251 connect( action, SIGNAL( activated() ), 1278 connect( action, SIGNAL( activated() ),
1252 SLOT( multisynchowto() ) ); 1279 SLOT( multisynchowto() ) );
1253 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 1280 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
1254 action->addTo( helpMenu ); 1281 action->addTo( helpMenu );
1255 connect( action, SIGNAL( activated() ), 1282 connect( action, SIGNAL( activated() ),
1256 SLOT( aboutAutoSaving() ) ); 1283 SLOT( aboutAutoSaving() ) );
1257 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 1284 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
1258 action->addTo( helpMenu ); 1285 action->addTo( helpMenu );
1259 connect( action, SIGNAL( activated() ), 1286 connect( action, SIGNAL( activated() ),
1260 SLOT( aboutKnownBugs() ) ); 1287 SLOT( aboutKnownBugs() ) );
1261 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 1288 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
1262 action->addTo( helpMenu ); 1289 action->addTo( helpMenu );
1263 connect( action, SIGNAL( activated() ), 1290 connect( action, SIGNAL( activated() ),
1264 SLOT( usertrans() ) ); 1291 SLOT( usertrans() ) );
1265 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 1292 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
1266 action->addTo( helpMenu ); 1293 action->addTo( helpMenu );
1267 connect( action, SIGNAL( activated() ), 1294 connect( action, SIGNAL( activated() ),
1268 SLOT( faq() ) ); 1295 SLOT( faq() ) );
1269 action = new QAction( "licence", i18n("Licence..."), 0, this ); 1296 action = new QAction( "licence", i18n("Licence..."), 0, this );
1270 action->addTo( helpMenu ); 1297 action->addTo( helpMenu );
1271 connect( action, SIGNAL( activated() ), 1298 connect( action, SIGNAL( activated() ),
1272 SLOT( licence() ) ); 1299 SLOT( licence() ) );
1273 action = new QAction( "about", i18n("About..."), 0, this ); 1300 action = new QAction( "about", i18n("About..."), 0, this );
1274 action->addTo( helpMenu ); 1301 action->addTo( helpMenu );
1275 connect( action, SIGNAL( activated() ), 1302 connect( action, SIGNAL( activated() ),
1276 SLOT( about() ) ); 1303 SLOT( about() ) );
1277 //menuBar->insertSeparator(); 1304 //menuBar->insertSeparator();
1278 1305
1279 // ****************************************************** 1306 // ******************************************************
1280 // menubar icons 1307 // menubar icons
1281 1308
1282 1309
1283 1310
1284 //menuBar->insertItem( iconToolBar ); 1311 //menuBar->insertItem( iconToolBar );
1285 //xdays_action 1312 //xdays_action
1286 if (p-> mShowIconNewEvent) 1313 if (p-> mShowIconNewEvent)
1287 ne_action->addTo( iconToolBar ); 1314 ne_action->addTo( iconToolBar );
1288 if (p->mShowIconNewTodo ) 1315 if (p->mShowIconNewTodo )
1289 nt_action->addTo( iconToolBar ); 1316 nt_action->addTo( iconToolBar );
1290 if (p-> mShowIconSearch) 1317 if (p-> mShowIconSearch)
1291 search_action->addTo( iconToolBar ); 1318 search_action->addTo( iconToolBar );
1292 if (p-> mShowIconWhatsThis) 1319 if (p-> mShowIconWhatsThis)
1293 QWhatsThis::whatsThisButton ( iconToolBar ); 1320 QWhatsThis::whatsThisButton ( iconToolBar );
1294 if (p-> mShowIconNext) 1321 if (p-> mShowIconNext)
1295 whatsnext_action->addTo( viewToolBar ); 1322 whatsnext_action->addTo( viewToolBar );
1296 if (p-> mShowIconNextDays) 1323 if (p-> mShowIconNextDays)
1297 xdays_action->addTo( viewToolBar ); 1324 xdays_action->addTo( viewToolBar );
1298 if (p-> mShowIconJournal) 1325 if (p-> mShowIconJournal)
1299 viewjournal_action->addTo( viewToolBar ); 1326 viewjournal_action->addTo( viewToolBar );
1300 if (p-> mShowIconDay1) 1327 if (p-> mShowIconDay1)
1301 day1_action->addTo( viewToolBar ); 1328 day1_action->addTo( viewToolBar );
1302 if (p-> mShowIconDay5) 1329 if (p-> mShowIconDay5)
1303 day5_action->addTo( viewToolBar ); 1330 day5_action->addTo( viewToolBar );
1304 if (p-> mShowIconDay7) 1331 if (p-> mShowIconDay7)
1305 day7_action->addTo( viewToolBar ); 1332 day7_action->addTo( viewToolBar );
1306 if (p-> mShowIconDay6) 1333 if (p-> mShowIconDay6)
1307 day6_action->addTo( viewToolBar ); 1334 day6_action->addTo( viewToolBar );
1308 if (p-> mShowIconMonth) 1335 if (p-> mShowIconMonth)
1309 month_action->addTo( viewToolBar ); 1336 month_action->addTo( viewToolBar );
1310 if (p-> mShowIconList) 1337 if (p-> mShowIconList)
1311 showlist_action->addTo( viewToolBar ); 1338 showlist_action->addTo( viewToolBar );
@@ -1751,938 +1778,939 @@ void MainWindow::processIncidenceSelection( Incidence *incidence )
1751 startString += i18n(" (%1 y.)"). arg( years ); 1778 startString += i18n(" (%1 y.)"). arg( years );
1752 } 1779 }
1753 } 1780 }
1754 else 1781 else
1755 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1782 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1756 } 1783 }
1757 } 1784 }
1758 else { 1785 else {
1759 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 ) 1786 if ( (( KCal::Todo*)incidence)->percentComplete() == 100 )
1760 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) ); 1787 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+i18n("completed on %1").arg( (( KCal::Todo*)incidence)->completedStr(true) );
1761 else 1788 else
1762 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1789 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1763 } 1790 }
1764 if ( !incidence->location().isEmpty() ) 1791 if ( !incidence->location().isEmpty() )
1765 startString += " (" +incidence->location()+")"; 1792 startString += " (" +incidence->location()+")";
1766 setCaption( incidence->summary()+startString); 1793 setCaption( incidence->summary()+startString);
1767 enableIncidenceActions( true ); 1794 enableIncidenceActions( true );
1768 if ( incidence->typeID() == eventID ) { 1795 if ( incidence->typeID() == eventID ) {
1769 mShowAction->setMenuText( i18n("Show Event") ); 1796 mShowAction->setMenuText( i18n("Show Event") );
1770 mNewSubTodoAction->setEnabled( false ); 1797 mNewSubTodoAction->setEnabled( false );
1771 } else if ( incidence->typeID() == todoID ) { 1798 } else if ( incidence->typeID() == todoID ) {
1772 mShowAction->setMenuText( i18n("Show Todo") ); 1799 mShowAction->setMenuText( i18n("Show Todo") );
1773 mNewSubTodoAction->setEnabled( true ); 1800 mNewSubTodoAction->setEnabled( true );
1774 } else { 1801 } else {
1775 mShowAction->setMenuText( i18n("Show") ); 1802 mShowAction->setMenuText( i18n("Show") );
1776 mNewSubTodoAction->setEnabled( false ); 1803 mNewSubTodoAction->setEnabled( false );
1777 } 1804 }
1778#ifdef DESKTOP_VERSION 1805#ifdef DESKTOP_VERSION
1779 static QPixmap jP = SmallIcon( "journal" ); 1806 static QPixmap jP = SmallIcon( "journal" );
1780 static QPixmap eP = SmallIcon( "newevent" ); 1807 static QPixmap eP = SmallIcon( "newevent" );
1781 static QPixmap tP = SmallIcon( "newtodo" ); 1808 static QPixmap tP = SmallIcon( "newtodo" );
1782 QIconSet icon; 1809 QIconSet icon;
1783 if ( incidence->typeID() == todoID ) 1810 if ( incidence->typeID() == todoID )
1784 icon = QIconSet ( tP ); 1811 icon = QIconSet ( tP );
1785 else if ( incidence->typeID() == eventID ) 1812 else if ( incidence->typeID() == eventID )
1786 icon = QIconSet ( eP ); 1813 icon = QIconSet ( eP );
1787 else if ( incidence->typeID() == journalID ) 1814 else if ( incidence->typeID() == journalID )
1788 icon = QIconSet ( jP ); 1815 icon = QIconSet ( jP );
1789 mPrintSelAction->setIconSet ( icon ); 1816 mPrintSelAction->setIconSet ( icon );
1790#endif 1817#endif
1791} 1818}
1792 1819
1793void MainWindow::enableIncidenceActions( bool enabled ) 1820void MainWindow::enableIncidenceActions( bool enabled )
1794{ 1821{
1795 mShowAction->setEnabled( enabled ); 1822 mShowAction->setEnabled( enabled );
1796 mEditAction->setEnabled( enabled ); 1823 mEditAction->setEnabled( enabled );
1797 mDeleteAction->setEnabled( enabled ); 1824 mDeleteAction->setEnabled( enabled );
1798 1825
1799 mCloneAction->setEnabled( enabled ); 1826 mCloneAction->setEnabled( enabled );
1800 mMoveAction->setEnabled( enabled ); 1827 mMoveAction->setEnabled( enabled );
1801#ifndef DESKTOP_VERSION 1828#ifndef DESKTOP_VERSION
1802 mBeamAction->setEnabled( enabled ); 1829 mBeamAction->setEnabled( enabled );
1803#else 1830#else
1804 mPrintSelAction->setEnabled( enabled ); 1831 mPrintSelAction->setEnabled( enabled );
1805#endif 1832#endif
1806 mCancelAction->setEnabled( enabled ); 1833 mCancelAction->setEnabled( enabled );
1807} 1834}
1808 1835
1809void MainWindow::importOL() 1836void MainWindow::importOL()
1810{ 1837{
1811#ifdef _OL_IMPORT_ 1838#ifdef _OL_IMPORT_
1812 mView->clearAllViews(); 1839 mView->clearAllViews();
1813 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); 1840 KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this );
1814 id->exec(); 1841 id->exec();
1815 delete id; 1842 delete id;
1816 mView->calendar()->checkAlarmForIncidence( 0, true ); 1843 mView->calendar()->checkAlarmForIncidence( 0, true );
1817 mView->updateView(); 1844 mView->updateView();
1818#endif 1845#endif
1819} 1846}
1820void MainWindow::importBday() 1847void MainWindow::importBday()
1821{ 1848{
1822 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), 1849 int result = QMessageBox::warning( this, i18n("KO/Pi import information!"),
1823 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), 1850 i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"),
1824 i18n("Import!"), i18n("Cancel"), 0, 1851 i18n("Import!"), i18n("Cancel"), 0,
1825 0, 1 ); 1852 0, 1 );
1826 if ( result == 0 ) { 1853 if ( result == 0 ) {
1827 mView->importBday(); 1854 mView->importBday();
1828 1855
1829 } 1856 }
1830 1857
1831 1858
1832} 1859}
1833void MainWindow::importQtopia() 1860void MainWindow::importQtopia()
1834{ 1861{
1835 //#ifndef DESKTOP_VERSION 1862 //#ifndef DESKTOP_VERSION
1836 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); 1863 QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing");
1837#ifdef DESKTOP_VERSION 1864#ifdef DESKTOP_VERSION
1838 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); 1865 mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml");
1839#endif 1866#endif
1840 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, 1867 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess,
1841 i18n("Import!"), i18n("Cancel"), 0, 1868 i18n("Import!"), i18n("Cancel"), 0,
1842 0, 1 ); 1869 0, 1 );
1843 if ( result == 0 ) { 1870 if ( result == 0 ) {
1844#ifndef DESKTOP_VERSION 1871#ifndef DESKTOP_VERSION
1845 QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); 1872 QString datebook = Global::applicationFileName( "datebook", "datebook.xml");
1846 QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); 1873 QString todolist = Global::applicationFileName( "todolist", "todolist.xml");
1847 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; 1874 QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml";
1848#else 1875#else
1849 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; 1876 QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml";
1850 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; 1877 QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml";
1851 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; 1878 QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml";
1852#endif 1879#endif
1853 mView->importQtopia( categories, datebook, todolist ); 1880 mView->importQtopia( categories, datebook, todolist );
1854 } 1881 }
1855 mView->calendar()->reInitAlarmSettings(); 1882 mView->calendar()->reInitAlarmSettings();
1856#if 0 1883#if 0
1857 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 1884 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
1858 i18n("Not supported \non desktop!\n"), 1885 i18n("Not supported \non desktop!\n"),
1859 i18n("Ok"), i18n("Cancel"), 0, 1886 i18n("Ok"), i18n("Cancel"), 0,
1860 0, 1 ); 1887 0, 1 );
1861 1888
1862#endif 1889#endif
1863} 1890}
1864 1891
1865void MainWindow::saveOnClose() 1892void MainWindow::saveOnClose()
1866{ 1893{
1867 KOPrefs *p = KOPrefs::instance(); 1894 KOPrefs *p = KOPrefs::instance();
1868 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); 1895 p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
1869 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); 1896 p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal );
1870 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); 1897 p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal );
1871 if ( filterToolBar ) { 1898 if ( filterToolBar ) {
1872 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); 1899 p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal );
1873 } 1900 }
1874#ifdef DESKTOP_VERSION 1901#ifdef DESKTOP_VERSION
1875 1902
1876 QPoint myP; 1903 QPoint myP;
1877 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); 1904 myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) );
1878 if ( p->mToolBarHor ) 1905 if ( p->mToolBarHor )
1879 p->mToolBarUp = myP.y() > height()/2; 1906 p->mToolBarUp = myP.y() > height()/2;
1880 else 1907 else
1881 p->mToolBarUp = myP.x() > width()/2; 1908 p->mToolBarUp = myP.x() > width()/2;
1882 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); 1909 myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) );
1883 if ( p->mToolBarHorV ) 1910 if ( p->mToolBarHorV )
1884 p->mToolBarUpV = myP.y() > height()/2; 1911 p->mToolBarUpV = myP.y() > height()/2;
1885 else 1912 else
1886 p->mToolBarUpV = myP.x() > width()/2 ; 1913 p->mToolBarUpV = myP.x() > width()/2 ;
1887 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); 1914 myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) );
1888 if ( p->mToolBarHorN ) 1915 if ( p->mToolBarHorN )
1889 p->mToolBarUpN = myP.y() > height()/2; 1916 p->mToolBarUpN = myP.y() > height()/2;
1890 else 1917 else
1891 p->mToolBarUpN = myP.x() > width()/2 ; 1918 p->mToolBarUpN = myP.x() > width()/2 ;
1892 if ( filterToolBar ) { 1919 if ( filterToolBar ) {
1893 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); 1920 myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) );
1894 if ( p->mToolBarHorF ) 1921 if ( p->mToolBarHorF )
1895 p->mToolBarUpF = myP.y() > height()/2; 1922 p->mToolBarUpF = myP.y() > height()/2;
1896 else 1923 else
1897 p->mToolBarUpF = myP.x() > width()/2 ; 1924 p->mToolBarUpF = myP.x() > width()/2 ;
1898 } 1925 }
1899#else 1926#else
1900 if ( p->mToolBarHor ) 1927 if ( p->mToolBarHor )
1901 p->mToolBarUp = iconToolBar->y() > height()/2; 1928 p->mToolBarUp = iconToolBar->y() > height()/2;
1902 else 1929 else
1903 p->mToolBarUp = iconToolBar->x() > width()/2; 1930 p->mToolBarUp = iconToolBar->x() > width()/2;
1904 if ( p->mToolBarHorV ) 1931 if ( p->mToolBarHorV )
1905 p->mToolBarUpV = viewToolBar->y() > height()/2; 1932 p->mToolBarUpV = viewToolBar->y() > height()/2;
1906 else 1933 else
1907 p->mToolBarUpV = viewToolBar->x() > width()/2 ; 1934 p->mToolBarUpV = viewToolBar->x() > width()/2 ;
1908 1935
1909 if ( p->mToolBarHorN ) 1936 if ( p->mToolBarHorN )
1910 p->mToolBarUpN = navigatorToolBar->y() > height()/2; 1937 p->mToolBarUpN = navigatorToolBar->y() > height()/2;
1911 else 1938 else
1912 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; 1939 p->mToolBarUpN = navigatorToolBar->x() > width()/2 ;
1913 if ( filterToolBar ) { 1940 if ( filterToolBar ) {
1914 if ( p->mToolBarHorF ) 1941 if ( p->mToolBarHorF )
1915 p->mToolBarUpF = filterToolBar->y() > height()/2; 1942 p->mToolBarUpF = filterToolBar->y() > height()/2;
1916 else 1943 else
1917 p->mToolBarUpF = filterToolBar->x() > width()/2 ; 1944 p->mToolBarUpF = filterToolBar->x() > width()/2 ;
1918 } 1945 }
1919#endif 1946#endif
1920 save(); 1947 save();
1921 mView->writeSettings(); 1948 mView->writeSettings();
1922 mView->checkSuspendAlarm(); 1949 mView->checkSuspendAlarm();
1923} 1950}
1924void MainWindow::slotModifiedChanged( bool ) 1951void MainWindow::slotModifiedChanged( bool )
1925{ 1952{
1926 if ( mBlockAtStartup ) 1953 if ( mBlockAtStartup )
1927 return; 1954 return;
1928 1955
1929 int msec; 1956 int msec;
1930 if ( mCalendarModifiedFlag ) { 1957 if ( mCalendarModifiedFlag ) {
1931 //qDebug(" MainWindow timer is running "); 1958 //qDebug(" MainWindow timer is running ");
1932 return; 1959 return;
1933 } 1960 }
1934 // we store the changes after 1 minute, 1961 // we store the changes after 1 minute,
1935 // and for safety reasons after 10 minutes again 1962 // and for safety reasons after 10 minutes again
1936 if ( !mSyncManager->blockSave() ) 1963 if ( !mSyncManager->blockSave() )
1937 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1964 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1938 else 1965 else
1939 msec = 1000 * 600; 1966 msec = 1000 * 600;
1940 mSaveTimer.start( msec, true ); // 1 minute 1967 mSaveTimer.start( msec, true ); // 1 minute
1941 qDebug("KO: Saving File in %d secs!", msec/1000); 1968 qDebug("KO: Saving File in %d secs!", msec/1000);
1942 mCalendarModifiedFlag = true; 1969 mCalendarModifiedFlag = true;
1943} 1970}
1944void MainWindow::saveStopTimer() 1971void MainWindow::saveStopTimer()
1945{ 1972{
1946 mSaveTimer.stop(); 1973 mSaveTimer.stop();
1947} 1974}
1948void MainWindow::backupAllFiles() 1975void MainWindow::backupAllFiles()
1949{ 1976{
1950 QDate reference ( 2000,1,1); 1977 QDate reference ( 2000,1,1);
1951 int daysTo = reference.daysTo ( QDate::currentDate() ); 1978 int daysTo = reference.daysTo ( QDate::currentDate() );
1952 setCaption(i18n("Creating backup ... please wait ..." )); 1979 setCaption(i18n("Creating backup ... please wait ..." ));
1953 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); 1980 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate);
1954 // we need the file path, the backup dir and the number of bups as param 1981 // we need the file path, the backup dir and the number of bups as param
1955 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 1982 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
1956 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 1983 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
1957 bupDir = KGlobalSettings::backupDataDir(); 1984 bupDir = KGlobalSettings::backupDataDir();
1958 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1985 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1959 if ( retval == 0 ) { 1986 if ( retval == 0 ) {
1960 setCaption(i18n("Backup cancelled" )); 1987 setCaption(i18n("Backup cancelled" ));
1961 qDebug("KO: Backup cancelled. Will try again tomorrow "); 1988 qDebug("KO: Backup cancelled. Will try again tomorrow ");
1962 // retval == 0 : backup skipped for today, try again tomorrow 1989 // retval == 0 : backup skipped for today, try again tomorrow
1963 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; 1990 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
1964 } else if ( retval == 1 ){ 1991 } else if ( retval == 1 ){
1965 qDebug("KO: Backup created."); 1992 qDebug("KO: Backup created.");
1966 // backup ok 1993 // backup ok
1967 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1994 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1968 KopiCalendarFile * cal = calendars.first(); 1995 KopiCalendarFile * cal = calendars.first();
1969 cal = calendars.next(); 1996 cal = calendars.next();
1970 while ( cal ) { 1997 while ( cal ) {
1971 if ( !cal->mErrorOnLoad ) { 1998 if ( !cal->mErrorOnLoad ) {
1972 KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1999 KApplication::createBackup( cal->mFileName, bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1973 } 2000 }
1974 cal = calendars.next(); 2001 cal = calendars.next();
1975 } 2002 }
1976 KOPrefs::instance()->mLastBackupDate = daysTo; 2003 KOPrefs::instance()->mLastBackupDate = daysTo;
1977 setCaption(i18n("Backup succesfully finished" )); 2004 setCaption(i18n("Backup succesfully finished" ));
1978 } else if ( retval == 2 ){ 2005 } else if ( retval == 2 ){
1979 setCaption(i18n("Backup globally disabled" )); 2006 setCaption(i18n("Backup globally disabled" ));
1980 qDebug("KO: Backup globally cancelled."); 2007 qDebug("KO: Backup globally cancelled.");
1981 // backup globally cancelled 2008 // backup globally cancelled
1982 KPimGlobalPrefs::instance()->mBackupEnabled = false; 2009 KPimGlobalPrefs::instance()->mBackupEnabled = false;
1983 } 2010 }
1984 // retval == 3: do nothing, try again later 2011 // retval == 3: do nothing, try again later
1985} 2012}
1986void MainWindow::save() 2013void MainWindow::save()
1987{ 2014{
1988 2015
1989 if ( mView->viewManager()->journalView() ) 2016 if ( mView->viewManager()->journalView() )
1990 mView->viewManager()->journalView()->checkModified(); 2017 mView->viewManager()->journalView()->checkModified();
1991 if ( !mCalendarModifiedFlag ) { 2018 if ( !mCalendarModifiedFlag ) {
1992 qDebug("KO: Calendar not modified. Nothing saved."); 2019 qDebug("KO: Calendar not modified. Nothing saved.");
1993 return; 2020 return;
1994 } 2021 }
1995 if ( mSyncManager->blockSave() ) { 2022 if ( mSyncManager->blockSave() ) {
1996 slotModifiedChanged( true ); 2023 slotModifiedChanged( true );
1997 return; 2024 return;
1998 } 2025 }
1999 mSyncManager->setBlockSave(true); 2026 mSyncManager->setBlockSave(true);
2000 if ( mView->checkAllFileVersions() ) { 2027 if ( mView->checkAllFileVersions() ) {
2001 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ 2028 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){
2002 QDate reference ( 2000,1,1); 2029 QDate reference ( 2000,1,1);
2003 int daysTo = reference.daysTo ( QDate::currentDate() ); 2030 int daysTo = reference.daysTo ( QDate::currentDate() );
2004 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { 2031 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) {
2005 backupAllFiles(); 2032 backupAllFiles();
2006 } 2033 }
2007 ; // KPimGlobalPrefs::instance()->mLastBackupDate 2034 ; // KPimGlobalPrefs::instance()->mLastBackupDate
2008 } 2035 }
2009 QTime neededSaveTime = QDateTime::currentDateTime().time(); 2036 QTime neededSaveTime = QDateTime::currentDateTime().time();
2010 if ( !isMinimized () ) 2037 if ( !isMinimized () )
2011 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 2038 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
2012 qDebug("KO: Start saving data to file!"); 2039 qDebug("KO: Start saving data to file!");
2013 if ( mView->saveCalendars() ) 2040 if ( mView->saveCalendars() )
2014 mCalendarModifiedFlag = false; 2041 mCalendarModifiedFlag = false;
2015 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 2042 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
2016 qDebug("KO: Needed %d ms for saving.",msNeeded ); 2043 qDebug("KO: Needed %d ms for saving.",msNeeded );
2017 QString savemes; 2044 QString savemes;
2018 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 2045 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
2019 if ( !isMinimized () ) 2046 if ( !isMinimized () )
2020 setCaption(savemes); 2047 setCaption(savemes);
2021 else 2048 else
2022 qDebug(savemes); 2049 qDebug(savemes);
2023 } else { 2050 } else {
2024 setCaption(i18n("Saving cancelled!")); 2051 setCaption(i18n("Saving cancelled!"));
2025 mCalendarModifiedFlag = false; 2052 mCalendarModifiedFlag = false;
2026 slotModifiedChanged( true ); 2053 slotModifiedChanged( true );
2027 } 2054 }
2028 mSyncManager->setBlockSave( false ); 2055 mSyncManager->setBlockSave( false );
2029} 2056}
2030 2057
2031void MainWindow::keyReleaseEvent ( QKeyEvent * e) 2058void MainWindow::keyReleaseEvent ( QKeyEvent * e)
2032{ 2059{
2033 if ( !e->isAutoRepeat() ) { 2060 if ( !e->isAutoRepeat() ) {
2034 mFlagKeyPressed = false; 2061 mFlagKeyPressed = false;
2035 } 2062 }
2036} 2063}
2037void MainWindow::keyPressEvent ( QKeyEvent * e ) 2064void MainWindow::keyPressEvent ( QKeyEvent * e )
2038{ 2065{
2039 qApp->processEvents(); 2066 qApp->processEvents();
2040 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 2067 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
2041 e->ignore(); 2068 e->ignore();
2042 // qDebug(" ignore %d",e->isAutoRepeat() ); 2069 // qDebug(" ignore %d",e->isAutoRepeat() );
2043 return; 2070 return;
2044 } 2071 }
2045 if (! e->isAutoRepeat() ) 2072 if (! e->isAutoRepeat() )
2046 mFlagKeyPressed = true; 2073 mFlagKeyPressed = true;
2047 KOPrefs *p = KOPrefs::instance(); 2074 KOPrefs *p = KOPrefs::instance();
2048 bool showSelectedDates = false; 2075 bool showSelectedDates = false;
2049 int size; 2076 int size;
2050 int pro = 0; 2077 int pro = 0;
2051 //qDebug("MainWindow::keyPressEvent "); 2078 //qDebug("MainWindow::keyPressEvent ");
2052 switch ( e->key() ) { 2079 switch ( e->key() ) {
2053 case Qt::Key_Right: 2080 case Qt::Key_Right:
2054 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 2081 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
2055 mView->goNextMonth(); 2082 mView->goNextMonth();
2056 else 2083 else
2057 mView->goNext(); 2084 mView->goNext();
2058 showSelectedDates = true; 2085 showSelectedDates = true;
2059 break; 2086 break;
2060 case Qt::Key_Left: 2087 case Qt::Key_Left:
2061 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2088 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2062 mView->goPreviousMonth(); 2089 mView->goPreviousMonth();
2063 else 2090 else
2064 mView->goPrevious(); 2091 mView->goPrevious();
2065 showSelectedDates = true; 2092 showSelectedDates = true;
2066 break; 2093 break;
2067 case Qt::Key_Down: 2094 case Qt::Key_Down:
2068 mView->viewManager()->agendaView()->scrollOneHourDown(); 2095 mView->viewManager()->agendaView()->scrollOneHourDown();
2069 break; 2096 break;
2070 case Qt::Key_Up: 2097 case Qt::Key_Up:
2071 mView->viewManager()->agendaView()->scrollOneHourUp(); 2098 mView->viewManager()->agendaView()->scrollOneHourUp();
2072 break; 2099 break;
2073 case Qt::Key_K: 2100 case Qt::Key_K:
2074 mView->viewManager()->showMonthViewWeek(); 2101 mView->viewManager()->showMonthViewWeek();
2075 break; 2102 break;
2076 case Qt::Key_I: 2103 case Qt::Key_I:
2077 mView->showIncidence(); 2104 mView->showIncidence();
2078 break; 2105 break;
2079 case Qt::Key_Delete: 2106 case Qt::Key_Delete:
2080 case Qt::Key_Backspace: 2107 case Qt::Key_Backspace:
2081 mView->deleteIncidence(); 2108 mView->deleteIncidence();
2082 break; 2109 break;
2083 case Qt::Key_D: 2110 case Qt::Key_D:
2084 mView->viewManager()->showDayView(); 2111 mView->viewManager()->showDayView();
2085 showSelectedDates = true; 2112 showSelectedDates = true;
2086 break; 2113 break;
2087 case Qt::Key_O: 2114 case Qt::Key_O:
2088 mView->toggleFilerEnabled( ); 2115 mView->toggleFilerEnabled( );
2089 break; 2116 break;
2090 case Qt::Key_0: 2117 case Qt::Key_0:
2091 case Qt::Key_1: 2118 case Qt::Key_1:
2092 case Qt::Key_2: 2119 case Qt::Key_2:
2093 case Qt::Key_3: 2120 case Qt::Key_3:
2094 case Qt::Key_4: 2121 case Qt::Key_4:
2095 case Qt::Key_5: 2122 case Qt::Key_5:
2096 case Qt::Key_6: 2123 case Qt::Key_6:
2097 case Qt::Key_7: 2124 case Qt::Key_7:
2098 case Qt::Key_8: 2125 case Qt::Key_8:
2099 case Qt::Key_9: 2126 case Qt::Key_9:
2100 pro = e->key()-48; 2127 pro = e->key()-48;
2101 if ( pro == 0 ) 2128 if ( pro == 0 )
2102 pro = 10; 2129 pro = 10;
2103 if ( e->state() == Qt::ControlButton) 2130 if ( e->state() == Qt::ControlButton)
2104 pro += 10; 2131 pro += 10;
2105 break; 2132 break;
2106 case Qt::Key_M: 2133 case Qt::Key_M:
2107 mView->viewManager()->showMonthView(); 2134 mView->viewManager()->showMonthView();
2108 showSelectedDates = true; 2135 showSelectedDates = true;
2109 break; 2136 break;
2110 case Qt::Key_Insert: 2137 case Qt::Key_Insert:
2111 mView->newEvent(); 2138 mView->newEvent();
2112 break; 2139 break;
2113 case Qt::Key_S : 2140 case Qt::Key_S :
2114 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 2141 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
2115 mView->newSubTodo(); 2142 mView->newSubTodo();
2116 else 2143 else
2117 mView->dialogManager()->showSearchDialog(); 2144 mView->dialogManager()->showSearchDialog();
2118 break; 2145 break;
2119 case Qt::Key_Y : 2146 case Qt::Key_Y :
2120 case Qt::Key_Z : 2147 case Qt::Key_Z :
2121 mView->viewManager()->showWorkWeekView(); 2148 mView->viewManager()->showWorkWeekView();
2122 showSelectedDates = true; 2149 showSelectedDates = true;
2123 break; 2150 break;
2124 case Qt::Key_U : 2151 case Qt::Key_U :
2125 mView->viewManager()->showWeekView(); 2152 mView->viewManager()->showWeekView();
2126 showSelectedDates = true; 2153 showSelectedDates = true;
2127 break; 2154 break;
2128 case Qt::Key_H : 2155 case Qt::Key_H :
2129 keyBindings(); 2156 keyBindings();
2130 break; 2157 break;
2131 case Qt::Key_W: 2158 case Qt::Key_W:
2132 mView->viewManager()->showWhatsNextView(); 2159 mView->viewManager()->showWhatsNextView();
2133 break; 2160 break;
2134 case Qt::Key_L: 2161 case Qt::Key_L:
2135 mView->viewManager()->showListView(); 2162 mView->viewManager()->showListView();
2136 break; 2163 break;
2137 case Qt::Key_N: 2164 case Qt::Key_N:
2138 mView->viewManager()->showNextView(); 2165 mView->viewManager()->showNextView();
2139 break; 2166 break;
2140 case Qt::Key_V: 2167 case Qt::Key_V:
2141 mView->viewManager()->showTodoView(); 2168 mView->viewManager()->showTodoView();
2142 break; 2169 break;
2143 case Qt::Key_C: 2170 case Qt::Key_C:
2144 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 2171 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
2145 break; 2172 break;
2146 case Qt::Key_P: 2173 case Qt::Key_P:
2147 mView->showDatePicker( ); 2174 mView->showDatePicker( );
2148 break; 2175 break;
2149 case Qt::Key_F: 2176 case Qt::Key_F:
2150 mView->editFilters(); 2177 mView->editFilters();
2151 break; 2178 break;
2152 case Qt::Key_R: 2179 case Qt::Key_R:
2153 mView->toggleFilter(); 2180 mView->toggleFilter();
2154 break; 2181 break;
2155 case Qt::Key_X: 2182 case Qt::Key_X:
2156 if ( e->state() == Qt::ControlButton ) 2183 if ( e->state() == Qt::ControlButton )
2157 mView->toggleDateNavigatorWidget(); 2184 mView->toggleDateNavigatorWidget();
2158 else { 2185 else {
2159 mView->viewManager()->showNextXView(); 2186 mView->viewManager()->showNextXView();
2160 showSelectedDates = true; 2187 showSelectedDates = true;
2161 } 2188 }
2162 break; 2189 break;
2163 case Qt::Key_Space: 2190 case Qt::Key_Space:
2164 mView->toggleExpand(); 2191 mView->toggleExpand();
2165 break; 2192 break;
2166 case Qt::Key_A: 2193 case Qt::Key_A:
2167 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 2194 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
2168 mView->showNextAlarms(); 2195 mView->showNextAlarms();
2169 else 2196 else
2170 mView->toggleAllDaySize(); 2197 mView->toggleAllDaySize();
2171 break; 2198 break;
2172 case Qt::Key_T: 2199 case Qt::Key_T:
2173 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2200 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2174 mView->newTodo(); 2201 mView->newTodo();
2175 else { 2202 else {
2176 mView->goToday(); 2203 mView->goToday();
2177 showSelectedDates = true; 2204 showSelectedDates = true;
2178 } 2205 }
2179 break; 2206 break;
2180 case Qt::Key_Q: 2207 case Qt::Key_Q:
2181 if ( e->state() == Qt::ControlButton ) 2208 if ( e->state() == Qt::ControlButton )
2182 mView->conflictNotAll(); 2209 mView->conflictNotAll();
2183 else if ( e->state() == Qt::ShiftButton ) 2210 else if ( e->state() == Qt::ShiftButton )
2184 mView->conflictAllday(); 2211 mView->conflictAllday();
2185 else 2212 else
2186 mView->conflictAll(); 2213 mView->conflictAll();
2187 break; 2214 break;
2188 case Qt::Key_J: 2215 case Qt::Key_J:
2189 mView->viewManager()->showJournalView(); 2216 mView->viewManager()->showJournalView();
2190 break; 2217 break;
2191 case Qt::Key_B: 2218 case Qt::Key_B:
2192 mView->editIncidenceDescription();; 2219 mView->editIncidenceDescription();;
2193 break; 2220 break;
2194 // case Qt::Key_Return: 2221 // case Qt::Key_Return:
2195 case Qt::Key_E: 2222 case Qt::Key_E:
2196 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2223 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2197 mView->newEvent(); 2224 mView->newEvent();
2198 else 2225 else
2199 mView->editIncidence(); 2226 mView->editIncidence();
2200 break; 2227 break;
2201 case Qt::Key_Plus: 2228 case Qt::Key_Plus:
2202 size = p->mHourSize +2; 2229 size = p->mHourSize +2;
2203 if ( size <= 22 ) 2230 if ( size <= 22 )
2204 configureAgenda( size ); 2231 configureAgenda( size );
2205 break; 2232 break;
2206 case Qt::Key_Minus: 2233 case Qt::Key_Minus:
2207 size = p->mHourSize - 2; 2234 size = p->mHourSize - 2;
2208 if ( size >= 4 ) 2235 if ( size >= 4 )
2209 configureAgenda( size ); 2236 configureAgenda( size );
2210 break; 2237 break;
2211 2238
2212 2239
2213 default: 2240 default:
2214 e->ignore(); 2241 e->ignore();
2215 } 2242 }
2216 if ( pro > 0 ) { 2243 if ( pro > 0 ) {
2217 selectFilter( pro+1 ); 2244 selectFilter( pro+1 );
2218 } 2245 }
2219 if ( showSelectedDates ) { 2246 if ( showSelectedDates ) {
2220 ;// setCaptionToDates(); 2247 ;// setCaptionToDates();
2221 } 2248 }
2222 2249
2223} 2250}
2224void MainWindow::fillFilterMenuTB() 2251void MainWindow::fillFilterMenuTB()
2225{ 2252{
2226 selectFilterMenuTB->clear(); 2253 selectFilterMenuTB->clear();
2227 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2254 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
2228 selectFilterMenuTB->insertSeparator(); 2255 selectFilterMenuTB->insertSeparator();
2229 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2256 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
2230 2257
2231 selectFilterMenuTB->insertSeparator(); 2258 selectFilterMenuTB->insertSeparator();
2232 QPtrList<CalFilter> fili = mView->filters(); 2259 QPtrList<CalFilter> fili = mView->filters();
2233 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2260 CalFilter *curfilter = mView->filterView()->selectedFilter();
2234 CalFilter *filter = fili.first(); 2261 CalFilter *filter = fili.first();
2235 int iii = 2; 2262 int iii = 2;
2236 bool checkitem = mView->filterView()->filtersEnabled(); 2263 bool checkitem = mView->filterView()->filtersEnabled();
2237 while(filter) { 2264 while(filter) {
2238 selectFilterMenuTB->insertItem( filter->name(), iii ); 2265 selectFilterMenuTB->insertItem( filter->name(), iii );
2239 if ( filter == curfilter) 2266 if ( filter == curfilter)
2240 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2267 selectFilterMenuTB->setItemChecked( iii, checkitem );
2241 filter = fili.next(); 2268 filter = fili.next();
2242 ++iii; 2269 ++iii;
2243 } 2270 }
2244 if ( !checkitem ) 2271 if ( !checkitem )
2245 selectFilterMenuTB->setItemChecked( 1, true ); 2272 selectFilterMenuTB->setItemChecked( 1, true );
2246 2273
2247 int x = 0; 2274 int x = 0;
2248 int y = iconToolBar->height(); 2275 int y = iconToolBar->height();
2249 int dX = 0; 2276 int dX = 0;
2250 int dY = 0; 2277 int dY = 0;
2251 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2278 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2252 if ( iconToolBar->y() > height()/2 ) { 2279 if ( iconToolBar->y() > height()/2 ) {
2253 dY = selectFilterMenuTB->sizeHint().height()+8; 2280 dY = selectFilterMenuTB->sizeHint().height()+8;
2254 y = 0; 2281 y = 0;
2255 } 2282 }
2256 } else { 2283 } else {
2257 if ( iconToolBar->x() > width()/2 ) { // right side 2284 if ( iconToolBar->x() > width()/2 ) { // right side
2258 x=0; 2285 x=0;
2259 dX= selectFilterMenuTB->sizeHint().width()+8; 2286 dX= selectFilterMenuTB->sizeHint().width()+8;
2260 y = 0; 2287 y = 0;
2261 } else { 2288 } else {
2262 x= iconToolBar->width(); 2289 x= iconToolBar->width();
2263 y = 0; 2290 y = 0;
2264 } 2291 }
2265 } 2292 }
2266 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2293 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2267 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2294 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2268} 2295}
2269void MainWindow::fillFilterMenu() 2296void MainWindow::fillFilterMenu()
2270{ 2297{
2271 selectFilterMenu->clear(); 2298 selectFilterMenu->clear();
2272 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2299 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2273 selectFilterMenu->insertSeparator(); 2300 selectFilterMenu->insertSeparator();
2274 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2301 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2275 2302
2276 selectFilterMenu->insertSeparator(); 2303 selectFilterMenu->insertSeparator();
2277 QPtrList<CalFilter> fili = mView->filters(); 2304 QPtrList<CalFilter> fili = mView->filters();
2278 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2305 CalFilter *curfilter = mView->filterView()->selectedFilter();
2279 CalFilter *filter = fili.first(); 2306 CalFilter *filter = fili.first();
2280 int iii = 2; 2307 int iii = 2;
2281 bool checkitem = mView->filterView()->filtersEnabled(); 2308 bool checkitem = mView->filterView()->filtersEnabled();
2282 while(filter) { 2309 while(filter) {
2283 selectFilterMenu->insertItem( filter->name(), iii ); 2310 selectFilterMenu->insertItem( filter->name(), iii );
2284 if ( filter == curfilter) 2311 if ( filter == curfilter)
2285 selectFilterMenu->setItemChecked( iii, checkitem ); 2312 selectFilterMenu->setItemChecked( iii, checkitem );
2286 filter = fili.next(); 2313 filter = fili.next();
2287 ++iii; 2314 ++iii;
2288 } 2315 }
2289 if ( !checkitem ) 2316 if ( !checkitem )
2290 selectFilterMenu->setItemChecked( 1, true ); 2317 selectFilterMenu->setItemChecked( 1, true );
2291} 2318}
2292void MainWindow::fillFilterMenuPopup() 2319void MainWindow::fillFilterMenuPopup()
2293{ 2320{
2294 filterPopupMenu->clear(); 2321 filterPopupMenu->clear();
2295 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2322 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2296 2323
2297 filterPopupMenu->insertSeparator(); 2324 filterPopupMenu->insertSeparator();
2298 QPtrList<CalFilter> fili = mView->filters(); 2325 QPtrList<CalFilter> fili = mView->filters();
2299 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2326 CalFilter *curfilter = mView->filterView()->selectedFilter();
2300 CalFilter *filter = fili.first(); 2327 CalFilter *filter = fili.first();
2301 int iii = 1; 2328 int iii = 1;
2302 bool checkitem = mView->filterView()->filtersEnabled(); 2329 bool checkitem = mView->filterView()->filtersEnabled();
2303 while(filter) { 2330 while(filter) {
2304 filterPopupMenu->insertItem( filter->name(), iii ); 2331 filterPopupMenu->insertItem( filter->name(), iii );
2305 if ( filter == curfilter) 2332 if ( filter == curfilter)
2306 filterPopupMenu->setItemChecked( iii, checkitem ); 2333 filterPopupMenu->setItemChecked( iii, checkitem );
2307 filter = fili.next(); 2334 filter = fili.next();
2308 ++iii; 2335 ++iii;
2309 } 2336 }
2310 if ( !checkitem ) 2337 if ( !checkitem )
2311 filterPopupMenu->setItemChecked( 0, true ); 2338 filterPopupMenu->setItemChecked( 0, true );
2312} 2339}
2313void MainWindow::selectFilter( int fil ) 2340void MainWindow::selectFilter( int fil )
2314{ 2341{
2315 2342
2316 if ( fil == 0 ) { 2343 if ( fil == 0 ) {
2317 mView->editFilters( ); 2344 mView->editFilters( );
2318 } else if ( fil == 1 ){ 2345 } else if ( fil == 1 ){
2319 if ( mView->filterView()->filtersEnabled() ) 2346 if ( mView->filterView()->filtersEnabled() )
2320 mView->toggleFilerEnabled( ); 2347 mView->toggleFilerEnabled( );
2321 } else { 2348 } else {
2322 if ( !mView->filterView()->filtersEnabled() ) { 2349 if ( !mView->filterView()->filtersEnabled() ) {
2323 mView->filterView()->blockSignals( true ); 2350 mView->filterView()->blockSignals( true );
2324 mView->toggleFilerEnabled( ); 2351 mView->toggleFilerEnabled( );
2325 mView->filterView()->blockSignals( false ); 2352 mView->filterView()->blockSignals( false );
2326 } 2353 }
2327 mView->selectFilter( fil-2 ); 2354 mView->selectFilter( fil-2 );
2328 } 2355 }
2329} 2356}
2330void MainWindow::updateFilterToolbar() 2357void MainWindow::updateFilterToolbar()
2331{ 2358{
2332 if ( filterMenubar ) { 2359 if ( filterMenubar ) {
2333 if ( !mView->filterView()->filtersEnabled() ) { 2360 if ( !mView->filterView()->filtersEnabled() ) {
2334 filterMenubar->changeItem( 0, i18n("No Filter") ); 2361 filterMenubar->changeItem( 0, i18n("No Filter") );
2335 } else { 2362 } else {
2336 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2363 CalFilter *curfilter = mView->filterView()->selectedFilter();
2337 if ( curfilter ) { 2364 if ( curfilter ) {
2338 QString name = curfilter->name(); 2365 QString name = curfilter->name();
2339 if ( name.length() > 12 ) 2366 if ( name.length() > 12 )
2340 name = name.left(10)+"..."; 2367 name = name.left(10)+"...";
2341 filterMenubar->changeItem( 0, name ); 2368 filterMenubar->changeItem( 0, name );
2342 } 2369 }
2343 } 2370 }
2344 } 2371 }
2345} 2372}
2346void MainWindow::selectFilterPopup( int fil ) 2373void MainWindow::selectFilterPopup( int fil )
2347{ 2374{
2348 selectFilter( fil + 1 ); 2375 selectFilter( fil + 1 );
2349 2376
2350} 2377}
2351void MainWindow::configureToolBar( int item ) 2378void MainWindow::configureToolBar( int item )
2352{ 2379{
2353 2380
2354 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2381 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2355 KOPrefs *p = KOPrefs::instance(); 2382 KOPrefs *p = KOPrefs::instance();
2356 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2383 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
2357 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); 2384 p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
2358 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); 2385 p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
2359 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 2386 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
2360 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 2387 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
2361 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); 2388 p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
2362 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); 2389 p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
2363 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); 2390 p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
2364 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); 2391 p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
2365 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 2392 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
2366 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 2393 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
2367 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 2394 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
2368 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 2395 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
2369 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); 2396 p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 );
2370 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 2397 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
2371 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 2398 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
2372 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 2399 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
2373 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 2400 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
2374 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 2401 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
2375 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 2402 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
2376 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 2403 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
2377 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 2404 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
2378 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 2405 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
2379 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 2406 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
2380 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 2407 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
2381 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 2408 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
2382 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); 2409 p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 );
2383 // initActions(); 2410 // initActions();
2384 setCaption ( i18n("Toolbar changes needs a restart!") ); 2411 setCaption ( i18n("Toolbar changes needs a restart!") );
2385} 2412}
2386void MainWindow::setCaption ( const QString & c ) 2413void MainWindow::setCaption ( const QString & c )
2387{ 2414{
2388 QString cap = c; 2415 QString cap = c;
2389 cap.replace( QRegExp("\n"), " " ); 2416 cap.replace( QRegExp("\n"), " " );
2390 cap = cap.stripWhiteSpace(); 2417 cap = cap.stripWhiteSpace();
2391 if ( cap.isEmpty() ) 2418 if ( cap.isEmpty() )
2392 cap = "KO/Pi"; 2419 cap = "KO/Pi";
2393 QWidget::setCaption( cap ); 2420 QWidget::setCaption( cap );
2394} 2421}
2395void MainWindow::setCaptionToDates() 2422void MainWindow::setCaptionToDates()
2396{ 2423{
2397 QString selDates; 2424 QString selDates;
2398 QDate date = mView->startDate(); 2425 QDate date = mView->startDate();
2399 if ( ! date.isValid() ) { 2426 if ( ! date.isValid() ) {
2400 setCaption(""); 2427 setCaption("");
2401 return; 2428 return;
2402 } 2429 }
2403 selDates = KGlobal::locale()->formatDate( date, true); 2430 selDates = KGlobal::locale()->formatDate( date, true);
2404 if (mView->startDate() < mView->endDate() ) 2431 if (mView->startDate() < mView->endDate() )
2405 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 2432 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
2406 else { 2433 else {
2407 QString addString; 2434 QString addString;
2408 if ( date == QDateTime::currentDateTime().date() ) 2435 if ( date == QDateTime::currentDateTime().date() )
2409 addString = i18n("Today"); 2436 addString = i18n("Today");
2410 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 2437 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
2411 addString = i18n("Tomorrow"); 2438 addString = i18n("Tomorrow");
2412 if ( !addString.isEmpty() ) 2439 if ( !addString.isEmpty() )
2413 selDates = addString+", "+selDates ; 2440 selDates = addString+", "+selDates ;
2414 } 2441 }
2415 setCaption( i18n("Dates: ") + selDates ); 2442 setCaption( i18n("Dates: ") + selDates );
2416 2443
2417} 2444}
2418void MainWindow::showConfigureAgenda( ) 2445void MainWindow::showConfigureAgenda( )
2419{ 2446{
2420 int iii; 2447 int iii;
2421 for ( iii = 1;iii<= 10 ;++iii ){ 2448 for ( iii = 1;iii<= 10 ;++iii ){
2422 configureAgendaMenu->setItemChecked( (iii+1)*2, false ); 2449 configureAgendaMenu->setItemChecked( (iii+1)*2, false );
2423 } 2450 }
2424 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); 2451 configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
2425} 2452}
2426void MainWindow::configureAgenda( int item ) 2453void MainWindow::configureAgenda( int item )
2427{ 2454{
2428 if ( KOPrefs::instance()->mHourSize == item ) 2455 if ( KOPrefs::instance()->mHourSize == item )
2429 return; 2456 return;
2430 KOPrefs::instance()->mHourSize=item; 2457 KOPrefs::instance()->mHourSize=item;
2431 mView->viewManager()->agendaView()->updateConfig(); 2458 mView->viewManager()->agendaView()->updateConfig();
2432} 2459}
2433 2460
2434void MainWindow::saveCalendar() 2461void MainWindow::saveCalendar()
2435{ 2462{
2436 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 2463 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
2437 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 2464 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
2438 bupDir = KGlobalSettings::backupDataDir(); 2465 bupDir = KGlobalSettings::backupDataDir();
2439 bupDir = KGlobal::formatMessage ( bupDir, 0 ); 2466 bupDir = KGlobal::formatMessage ( bupDir, 0 );
2440 QString bupHint; 2467 QString bupHint;
2441 if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) 2468 if ( !KPimGlobalPrefs::instance()->mBackupEnabled )
2442 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); 2469 bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)");
2443 if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; 2470 if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return;
2444 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; 2471 bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled;
2445 KPimGlobalPrefs::instance()->mBackupEnabled = false; 2472 KPimGlobalPrefs::instance()->mBackupEnabled = false;
2446 save(); 2473 save();
2447 KPimGlobalPrefs::instance()->mBackupEnabled = enabled; 2474 KPimGlobalPrefs::instance()->mBackupEnabled = enabled;
2448 backupAllFiles(); 2475 backupAllFiles();
2449} 2476}
2450void MainWindow::loadCalendar() 2477void MainWindow::loadCalendar()
2451{ 2478{
2452 2479
2453 2480
2454#if 0 2481#if 0
2455 QString fn = KOPrefs::instance()->mLastLoadFile; 2482 QString fn = KOPrefs::instance()->mLastLoadFile;
2456 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); 2483 fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this );
2457 2484
2458 if ( fn == "" ) 2485 if ( fn == "" )
2459 return; 2486 return;
2460 QFileInfo info; 2487 QFileInfo info;
2461 info.setFile( fn ); 2488 info.setFile( fn );
2462 QString mess; 2489 QString mess;
2463 bool loadbup = true; 2490 bool loadbup = true;
2464 if ( info. exists() ) { 2491 if ( info. exists() ) {
2465 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2492 mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2466 int result = QMessageBox::warning( this, "KO/Pi: Warning!", 2493 int result = QMessageBox::warning( this, "KO/Pi: Warning!",
2467 mess, 2494 mess,
2468 i18n("Load!"), i18n("Cancel"), 0, 2495 i18n("Load!"), i18n("Cancel"), 0,
2469 0, 1 ); 2496 0, 1 );
2470 if ( result != 0 ) { 2497 if ( result != 0 ) {
2471 loadbup = false; 2498 loadbup = false;
2472 } 2499 }
2473 } else { 2500 } else {
2474 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2501 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2475 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 2502 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
2476 0, 1 ); 2503 0, 1 );
2477 2504
2478 return; 2505 return;
2479 } 2506 }
2480 if ( loadbup ) { 2507 if ( loadbup ) {
2481 mView->openCalendar( fn ); 2508 mView->openCalendar( fn );
2482 KOPrefs::instance()->mLastLoadFile = fn; 2509 KOPrefs::instance()->mLastLoadFile = fn;
2483 mess = i18n("KO/Pi:Loaded %1").arg(fn) ; 2510 mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
2484 setCaption(mess); 2511 setCaption(mess);
2485 } 2512 }
2486#endif 2513#endif
2487 2514
2488} 2515}
2489void MainWindow::quickImportIcal() 2516void MainWindow::quickImportIcal()
2490{ 2517{
2491 importFile( KOPrefs::instance()->mLastImportFile, false ); 2518 importFile( KOPrefs::instance()->mLastImportFile, false );
2492} 2519}
2493void MainWindow::importFile( QString fn, bool quick ) 2520void MainWindow::importFile( QString fn, bool quick )
2494{ 2521{
2495 QFileInfo info; 2522 QFileInfo info;
2496 info.setFile( fn ); 2523 info.setFile( fn );
2497 QString mess; 2524 QString mess;
2498 if ( !info. exists() ) { 2525 if ( !info. exists() ) {
2499 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); 2526 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
2500 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2527 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2501 mess ); 2528 mess );
2502 return; 2529 return;
2503 } 2530 }
2504 int result = 0; 2531 int result = 0;
2505 if ( !quick ) { 2532 if ( !quick ) {
2506 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2533 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2507 result = QMessageBox::warning( this, "KO/Pi: Warning!", 2534 result = QMessageBox::warning( this, "KO/Pi: Warning!",
2508 mess, 2535 mess,
2509 "Import", "Cancel", 0, 2536 "Import", "Cancel", 0,
2510 0, 1 ); 2537 0, 1 );
2511 } 2538 }
2512 if ( result == 0 ) { 2539 if ( result == 0 ) {
2513 if ( mView->openCalendar( fn, true )) { 2540 if ( mView->openCalendar( fn, true )) {
2514 KOPrefs::instance()->mLastImportFile = fn; 2541 KOPrefs::instance()->mLastImportFile = fn;
2515 setCaption(i18n("Imported file successfully")); 2542 setCaption(i18n("Imported file successfully"));
2516 } else { 2543 } else {
2517 setCaption(i18n("Error importing file")); 2544 setCaption(i18n("Error importing file"));
2518 } 2545 }
2546 mView->updateView();
2519 } 2547 }
2520} 2548}
2521 2549
2522void MainWindow::importIcal() 2550void MainWindow::importIcal()
2523{ 2551{
2524 2552
2525 QString fn =KOPrefs::instance()->mLastImportFile; 2553 QString fn =KOPrefs::instance()->mLastImportFile;
2526 2554
2527 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 2555 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
2528 if ( fn == "" ) 2556 if ( fn == "" )
2529 return; 2557 return;
2530 importFile( fn, true ); 2558 importFile( fn, true );
2531 2559
2532} 2560}
2533 2561
2534void MainWindow::exportVCalendar() 2562void MainWindow::exportVCalendar()
2535{ 2563{
2536 QString fn = KOPrefs::instance()->mLastVcalFile; 2564 QString fn = KOPrefs::instance()->mLastVcalFile;
2537 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 2565 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
2538 if ( fn == "" ) 2566 if ( fn == "" )
2539 return; 2567 return;
2540 QFileInfo info; 2568 QFileInfo info;
2541 info.setFile( fn ); 2569 info.setFile( fn );
2542 QString mes; 2570 QString mes;
2543 bool createbup = true; 2571 bool createbup = true;
2544 if ( info. exists() ) { 2572 if ( info. exists() ) {
2545 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 2573 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
2546 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2574 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2547 i18n("Overwrite!"), i18n("Cancel"), 0, 2575 i18n("Overwrite!"), i18n("Cancel"), 0,
2548 0, 1 ); 2576 0, 1 );
2549 if ( result != 0 ) { 2577 if ( result != 0 ) {
2550 createbup = false; 2578 createbup = false;
2551 } 2579 }
2552 } 2580 }
2553 if ( createbup ) { 2581 if ( createbup ) {
2554 if ( mView->exportVCalendar( fn ) ) { 2582 if ( mView->exportVCalendar( fn ) ) {
2555 KOPrefs::instance()->mLastVcalFile = fn; 2583 KOPrefs::instance()->mLastVcalFile = fn;
2556 if ( fn.length() > 20 ) 2584 if ( fn.length() > 20 )
2557 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 2585 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
2558 else 2586 else
2559 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 2587 mes = i18n("KO/Pi:Exported to %1").arg(fn );
2560 setCaption(mes); 2588 setCaption(mes);
2561 } 2589 }
2562 } 2590 }
2563 2591
2564} 2592}
2565QString MainWindow::sentSyncFile() 2593QString MainWindow::sentSyncFile()
2566{ 2594{
2567#ifdef DESKTOP_VERSION 2595#ifdef DESKTOP_VERSION
2568 return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) ); 2596 return QDir::convertSeparators( locateLocal( "tmp", "copysynccal.ics" ) );
2569#else 2597#else
2570 return QString( "/tmp/copysynccal.ics" ); 2598 return QString( "/tmp/copysynccal.ics" );
2571#endif 2599#endif
2572} 2600}
2573 2601
2574void MainWindow::syncFileRequest() 2602void MainWindow::syncFileRequest()
2575{ 2603{
2576 while ( mSyncManager->blockSave() ) { 2604 while ( mSyncManager->blockSave() ) {
2577 qApp->processEvents(); 2605 qApp->processEvents();
2578 } 2606 }
2579 mSyncManager->setBlockSave(true); 2607 mSyncManager->setBlockSave(true);
2580 2608
2581 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2609 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2582 mSyncManager->slotSyncMenu( 999 ); 2610 mSyncManager->slotSyncMenu( 999 );
2583 } 2611 }
2584 2612
2585 setCaption(i18n("Saving Data to temp file ..." )); 2613 setCaption(i18n("Saving Data to temp file ..." ));
2586 mView->saveCalendar( sentSyncFile() ); 2614 mView->saveCalendar( sentSyncFile() );
2587 setCaption(i18n("Data saved to temp file!" )); 2615 setCaption(i18n("Data saved to temp file!" ));
2588 mSyncManager->setBlockSave( false ); 2616 mSyncManager->setBlockSave( false );
2589 2617
2590} 2618}
2591void MainWindow::getFile( bool success ) 2619void MainWindow::getFile( bool success )
2592{ 2620{
2593 if ( ! success ) { 2621 if ( ! success ) {
2594 setCaption( i18n("Error receiving file. Nothing changed!") ); 2622 setCaption( i18n("Error receiving file. Nothing changed!") );
2595 return; 2623 return;
2596 } 2624 }
2597 mView->mergeFile( sentSyncFile() ); 2625 mView->mergeFile( sentSyncFile() );
2598 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2626 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2599 mSyncManager->slotSyncMenu( 999 ); 2627 mSyncManager->slotSyncMenu( 999 );
2600 } 2628 }
2601 setCaption( i18n("Pi-Sync successful!") ); 2629 setCaption( i18n("Pi-Sync successful!") );
2602} 2630}
2603void MainWindow::printListView() 2631void MainWindow::printListView()
2604{ 2632{
2605 2633
2606 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items."); 2634 QString message = i18n("You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.");
2607 2635
2608 KMessageBox::information( this, message); 2636 KMessageBox::information( this, message);
2609} 2637}
2610void MainWindow::printSel( ) 2638void MainWindow::printSel( )
2611{ 2639{
2612 mView->viewManager()->agendaView()->agenda()->printSelection(); 2640 mView->viewManager()->agendaView()->agenda()->printSelection();
2613} 2641}
2614 2642
2615void MainWindow::printCal() 2643void MainWindow::printCal()
2616{ 2644{
2617 mView->print();//mCp->showDialog(); 2645 mView->print();//mCp->showDialog();
2618} 2646}
2619 2647
2620 2648
2621#include "libkdepim/kdatepicker.h" 2649#include "libkdepim/kdatepicker.h"
2622#include <kdatetbl.h> 2650#include <kdatetbl.h>
2623 2651
2624void MainWindow::weekAction() 2652void MainWindow::weekAction()
2625{ 2653{
2626 int month; 2654 int month;
2627 KPopupFrame* popup = new KPopupFrame(this); 2655 KPopupFrame* popup = new KPopupFrame(this);
2628 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); 2656 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2629 // ----- 2657 // -----
2630 picker->resize(picker->sizeHint()); 2658 picker->resize(picker->sizeHint());
2631 popup->setMainWidget(picker); 2659 popup->setMainWidget(picker);
2632 picker->setFocus(); 2660 picker->setFocus();
2633 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2661 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2634 int x = 0; 2662 int x = 0;
2635 int y = iconToolBar->height(); 2663 int y = iconToolBar->height();
2636 int dX = 0; 2664 int dX = 0;
2637 int dY = 0; 2665 int dY = 0;
2638 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2666 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2639 if ( iconToolBar->y() > height()/2 ) { 2667 if ( iconToolBar->y() > height()/2 ) {
2640 dY = picker->sizeHint().height()+8; 2668 dY = picker->sizeHint().height()+8;
2641 y = 0; 2669 y = 0;
2642 } 2670 }
2643 } else { 2671 } else {
2644 if ( iconToolBar->x() > width()/2 ) { // right side 2672 if ( iconToolBar->x() > width()/2 ) { // right side
2645 x=0; 2673 x=0;
2646 dX= picker->sizeHint().width()+8; 2674 dX= picker->sizeHint().width()+8;
2647 y = 0; 2675 y = 0;
2648 } else { 2676 } else {
2649 x= iconToolBar->width(); 2677 x= iconToolBar->width();
2650 y = 0; 2678 y = 0;
2651 } 2679 }
2652 } 2680 }
2653 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2681 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2654 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) 2682 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2655 { 2683 {
2656 month = picker->getResult(); 2684 month = picker->getResult();
2657 emit selectWeek ( month ); 2685 emit selectWeek ( month );
2658 //qDebug("weekSelected %d ", month); 2686 //qDebug("weekSelected %d ", month);
2659 } 2687 }
2660 delete popup; 2688 delete popup;
2661} 2689}
2662 2690
2663void MainWindow::hideEvent ( QHideEvent * ) 2691void MainWindow::hideEvent ( QHideEvent * )
2664{ 2692{
2665 QString message; 2693 QString message;
2666 QDateTime nextA = mCalendar->nextAlarmEventDateTime(); 2694 QDateTime nextA = mCalendar->nextAlarmEventDateTime();
2667 if ( nextA.isValid() ) { 2695 if ( nextA.isValid() ) {
2668 QString sum = mCalendar->nextSummary(); 2696 QString sum = mCalendar->nextSummary();
2669 2697
2670 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); 2698 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
2671 setCaption( message ); 2699 setCaption( message );
2672 } 2700 }
2673} 2701}
2674 2702
2675void MainWindow::resizeEvent( QResizeEvent* e) 2703void MainWindow::resizeEvent( QResizeEvent* e)
2676{ 2704{
2677#ifndef DESKTOP_VERSION 2705#ifndef DESKTOP_VERSION
2678 if ( filterToolBar ) { 2706 if ( filterToolBar ) {
2679 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) { 2707 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
2680 if (QApplication::desktop()->width() > QApplication::desktop()->height() ) 2708 if (QApplication::desktop()->width() > QApplication::desktop()->height() )
2681 filterToolBar->hide(); 2709 filterToolBar->hide();
2682 else 2710 else
2683 filterToolBar->show(); 2711 filterToolBar->show();
2684 } 2712 }
2685 } 2713 }
2686#endif 2714#endif
2687 QMainWindow::resizeEvent( e); 2715 QMainWindow::resizeEvent( e);
2688} 2716}
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 7d3d492..fdcf7c4 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,178 +1,184 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <qdict.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <qregexp.h> 10#include <qregexp.h>
11 11
12#include <libkcal/incidence.h> 12#include <libkcal/incidence.h>
13#include <ksyncmanager.h> 13#include <ksyncmanager.h>
14#include <kpopupmenu.h> 14#include <kpopupmenu.h>
15#ifndef DESKTOP_VERSION 15#ifndef DESKTOP_VERSION
16#include <qcopchannel_qws.h> 16#include <qcopchannel_qws.h>
17#endif 17#endif
18class QAction; 18class QAction;
19class CalendarView; 19class CalendarView;
20class KSyncProfile; 20class KSyncProfile;
21#ifdef DESKTOP_VERSION 21#ifdef DESKTOP_VERSION
22 22
23#define QPEToolBar QToolBar 23#define QPEToolBar QToolBar
24#endif 24#endif
25class QPEToolBar; 25class QPEToolBar;
26 26
27 27
28namespace KCal { 28namespace KCal {
29class CalendarLocal; 29class CalendarLocal;
30} 30}
31 31
32using namespace KCal; 32using namespace KCal;
33 33
34class MainWindow : public QMainWindow 34class MainWindow : public QMainWindow
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 public: 37 public:
38 MainWindow( QWidget *parent = 0, const char *name = 0 ); 38 MainWindow( QWidget *parent = 0, const char *name = 0 );
39 ~MainWindow(); 39 ~MainWindow();
40 bool beamReceiveEnabled(); 40 bool beamReceiveEnabled();
41 static QString defaultFileName(); 41 static QString defaultFileName();
42 static QString syncFileName(); 42 static QString syncFileName();
43 static QString resourcePath(); 43 static QString resourcePath();
44 public slots: 44 public slots:
45 void setUsesBigPixmaps ( bool ); 45 void setUsesBigPixmaps ( bool );
46 void setCaption ( const QString & ); 46 void setCaption ( const QString & );
47 void updateWeekNum(const KCal::DateList &); 47 void updateWeekNum(const KCal::DateList &);
48 void updateWeek(QDate); 48 void updateWeek(QDate);
49 void updateFilterToolbar(); 49 void updateFilterToolbar();
50 virtual void showMaximized (); 50 virtual void showMaximized ();
51 void configureAgenda( int ); 51 void configureAgenda( int );
52 void recieve( const QCString& msg, const QByteArray& data ); 52 void recieve( const QCString& msg, const QByteArray& data );
53 void receiveStart( const QCString& msg, const QByteArray& data );
53 protected slots: 54 protected slots:
55 void loadDataAfterStart();
54 void calHint(); 56 void calHint();
55 void startMultiSync(); 57 void startMultiSync();
56 void setCaptionToDates(); 58 void setCaptionToDates();
57 void weekAction(); 59 void weekAction();
58 void about(); 60 void about();
59 void licence(); 61 void licence();
60 void faq(); 62 void faq();
61 void usertrans(); 63 void usertrans();
62 void features(); 64 void features();
63 void synchowto(); 65 void synchowto();
64 void storagehowto(); 66 void storagehowto();
65 void timetrackinghowto(); 67 void timetrackinghowto();
66 void kdesynchowto(); 68 void kdesynchowto();
67 void multisynchowto(); 69 void multisynchowto();
68 void whatsNew(); 70 void whatsNew();
69 void keyBindings(); 71 void keyBindings();
70 void aboutAutoSaving();; 72 void aboutAutoSaving();;
71 void aboutKnownBugs(); 73 void aboutKnownBugs();
72 74
73 void processIncidenceSelection( Incidence * ); 75 void processIncidenceSelection( Incidence * );
74 76
75 void importQtopia(); 77 void importQtopia();
76 void importBday(); 78 void importBday();
77 void importOL(); 79 void importOL();
78 void importIcal(); 80 void importIcal();
79 void importFile( QString, bool ); 81 void importFile( QString, bool );
80 void quickImportIcal(); 82 void quickImportIcal();
81 83
82 void slotModifiedChanged( bool ); 84 void slotModifiedChanged( bool );
83 85
84 void save(); 86 void save();
85 void backupAllFiles(); 87 void backupAllFiles();
86 void saveStopTimer(); 88 void saveStopTimer();
87 void configureToolBar( int ); 89 void configureToolBar( int );
88 void printSel(); 90 void printSel();
89 void printCal(); 91 void printCal();
90 void printListView(); 92 void printListView();
91 void saveCalendar(); 93 void saveCalendar();
92 void loadCalendar(); 94 void loadCalendar();
93 void exportVCalendar(); 95 void exportVCalendar();
94 void fillFilterMenu(); 96 void fillFilterMenu();
95 void fillFilterMenuTB(); 97 void fillFilterMenuTB();
96 void selectFilter( int ); 98 void selectFilter( int );
97 void fillFilterMenuPopup(); 99 void fillFilterMenuPopup();
98 void selectFilterPopup( int ); 100 void selectFilterPopup( int );
99 void exportToPhone( int ); 101 void exportToPhone( int );
100 void toggleBeamReceive(); 102 void toggleBeamReceive();
101 void disableBR(bool); 103 void disableBR(bool);
102 signals: 104 signals:
103 void selectWeek ( int ); 105 void selectWeek ( int );
104 private slots: 106 private slots:
105 void slotResetFocus(); 107 void slotResetFocus();
106 void slotResetFocusLoop(); 108 void slotResetFocusLoop();
107 void showConfigureAgenda(); 109 void showConfigureAgenda();
108 void getFile( bool ); 110 void getFile( bool );
109 void syncFileRequest(); 111 void syncFileRequest();
110 112
111 protected: 113 protected:
112 int mFocusLoop; 114 int mFocusLoop;
113 void hideEvent ( QHideEvent * ); 115 void hideEvent ( QHideEvent * );
114 QString sentSyncFile(); 116 QString sentSyncFile();
115 void displayText( QString, QString); 117 void displayText( QString, QString);
116 void enableIncidenceActions( bool ); 118 void enableIncidenceActions( bool );
117 119
118 private: 120 private:
121
122 QCString mCStringMess;
123 QByteArray mByteData;
124
119 //void setMenuBar( QMenuBar * ); 125 //void setMenuBar( QMenuBar * );
120 bool mBRdisabled; 126 bool mBRdisabled;
121#ifndef DESKTOP_VERSION 127#ifndef DESKTOP_VERSION
122 QCopChannel* infrared; 128 QCopChannel* infrared;
123#endif 129#endif
124 QAction* brAction; 130 QAction* brAction;
125 KSyncManager* mSyncManager; 131 KSyncManager* mSyncManager;
126 bool mClosed; 132 bool mClosed;
127 void saveOnClose(); 133 void saveOnClose();
128 bool mFlagKeyPressed; 134 bool mFlagKeyPressed;
129 bool mBlockAtStartup; 135 bool mBlockAtStartup;
130 KMenuBar *menuBar1; 136 KMenuBar *menuBar1;
131 QPEToolBar *iconToolBar; 137 QPEToolBar *iconToolBar;
132 QPEToolBar *viewToolBar; 138 QPEToolBar *viewToolBar;
133 QPEToolBar *navigatorToolBar; 139 QPEToolBar *navigatorToolBar;
134 QPEToolBar *filterToolBar; 140 QPEToolBar *filterToolBar;
135 KMenuBar *filterMenubar; 141 KMenuBar *filterMenubar;
136 QPopupMenu * filterPopupMenu; 142 QPopupMenu * filterPopupMenu;
137 QPopupMenu * mCurrentItemMenu; 143 QPopupMenu * mCurrentItemMenu;
138 void initActions(); 144 void initActions();
139 void setDefaultPreferences(); 145 void setDefaultPreferences();
140 void resizeEvent( QResizeEvent* e); 146 void resizeEvent( QResizeEvent* e);
141 void keyPressEvent ( QKeyEvent * ) ; 147 void keyPressEvent ( QKeyEvent * ) ;
142 void keyReleaseEvent ( QKeyEvent * ) ; 148 void keyReleaseEvent ( QKeyEvent * ) ;
143 QPopupMenu *configureToolBarMenu; 149 QPopupMenu *configureToolBarMenu;
144 QPopupMenu *selectFilterMenu; 150 QPopupMenu *selectFilterMenu;
145 QPopupMenu *selectFilterMenuTB; 151 QPopupMenu *selectFilterMenuTB;
146 QPopupMenu *configureAgendaMenu, *syncMenu; 152 QPopupMenu *configureAgendaMenu, *syncMenu;
147 CalendarLocal *mCalendar; 153 CalendarLocal *mCalendar;
148 CalendarView *mView; 154 CalendarView *mView;
149 QAction *mNewSubTodoAction; 155 QAction *mNewSubTodoAction;
150 QAction *mWeekAction; 156 QAction *mWeekAction;
151 QFont mWeekFont; 157 QFont mWeekFont;
152 QPixmap mWeekPixmap; 158 QPixmap mWeekPixmap;
153 QColor mWeekBgColor; 159 QColor mWeekBgColor;
154 160
155 QAction *mShowAction; 161 QAction *mShowAction;
156 QAction *mEditAction; 162 QAction *mEditAction;
157 QAction *mDeleteAction; 163 QAction *mDeleteAction;
158 QAction *mCloneAction; 164 QAction *mCloneAction;
159 QAction *mMoveAction; 165 QAction *mMoveAction;
160 QAction *mBeamAction; 166 QAction *mBeamAction;
161 QAction *mCancelAction; 167 QAction *mCancelAction;
162 QAction *mPrintSelAction; 168 QAction *mPrintSelAction;
163 169
164 QAction *mToggleNav; 170 QAction *mToggleNav;
165 QAction *mToggleFilter; 171 QAction *mToggleFilter;
166 QAction *mToggleAllday; 172 QAction *mToggleAllday;
167 QAction *actionFilterMenuTB; 173 QAction *actionFilterMenuTB;
168 174
169 void closeEvent( QCloseEvent* ce ); 175 void closeEvent( QCloseEvent* ce );
170 QTimer mSaveTimer; 176 QTimer mSaveTimer;
171 //bool mBlockSaveFlag; 177 //bool mBlockSaveFlag;
172 bool mCalendarModifiedFlag; 178 bool mCalendarModifiedFlag;
173 QPixmap loadPixmap( QString ); 179 QPixmap loadPixmap( QString );
174 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix; 180 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix;
175}; 181};
176 182
177 183
178#endif 184#endif