summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-09 23:58:28 (UTC)
committer zautrix <zautrix>2005-07-09 23:58:28 (UTC)
commit2aabde6c21d6dc4f9de8cf3ac17b98053961cc6b (patch) (unidiff)
treee57782981707d6932940d0489fc942bfeab40dd6
parent47370b5d0dea0f29bb929ba13cf45186095c762d (diff)
downloadkdepimpi-2aabde6c21d6dc4f9de8cf3ac17b98053961cc6b.zip
kdepimpi-2aabde6c21d6dc4f9de8cf3ac17b98053961cc6b.tar.gz
kdepimpi-2aabde6c21d6dc4f9de8cf3ac17b98053961cc6b.tar.bz2
fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt8
-rw-r--r--korganizer/calendarview.cpp6
-rw-r--r--korganizer/kotodoview.cpp24
-rw-r--r--korganizer/kotodoviewitem.cpp66
-rw-r--r--libkcal/incidence.cpp28
-rw-r--r--libkcal/incidence.h3
-rw-r--r--libkcal/incidencebase.cpp4
-rw-r--r--libkcal/incidencebase.h1
-rw-r--r--libkdepim/kdatepicker.cpp1
9 files changed, 117 insertions, 24 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index ea7071d..6723dc5 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1,1535 +1,1543 @@
1{ "10 minutes","10 Minuten" }, 1{ "10 minutes","10 Minuten" },
2{ "10th","10." }, 2{ "10th","10." },
3{ "11th","11." }, 3{ "11th","11." },
4{ "12 pm Format","12 AM/PM Format" }, 4{ "12 pm Format","12 AM/PM Format" },
5{ "12th","12." }, 5{ "12th","12." },
6{ "13th","13." }, 6{ "13th","13." },
7{ "14th","14." }, 7{ "14th","14." },
8{ "15th","15." }, 8{ "15th","15." },
9{ "16th","16." }, 9{ "16th","16." },
10{ "17th","17." }, 10{ "17th","17." },
11{ "18th","18." }, 11{ "18th","18." },
12{ "19th","19." }, 12{ "19th","19." },
13{ "1 Day","1 Tag" }, 13{ "1 Day","1 Tag" },
14{ "1 h","1 Std" }, 14{ "1 h","1 Std" },
15{ "1 (high)","1 (hoch)" }, 15{ "1 (high)","1 (hoch)" },
16{ "5 (low)","5" }, 16{ "5 (low)","5" },
17{ "1st","1." }, 17{ "1st","1." },
18{ "20th","20." }, 18{ "20th","20." },
19{ "21st","21." }, 19{ "21st","21." },
20{ "22nd","22." }, 20{ "22nd","22." },
21{ "23rd","23." }, 21{ "23rd","23." },
22{ "24:00 Hour Format","24:00 Stunden Format" }, 22{ "24:00 Hour Format","24:00 Stunden Format" },
23{ "24th","24." }, 23{ "24th","24." },
24{ "25th","25." }, 24{ "25th","25." },
25{ "26th","26." }, 25{ "26th","26." },
26{ "27th","27." }, 26{ "27th","27." },
27{ "28th","28." }, 27{ "28th","28." },
28{ "29th","29." }, 28{ "29th","29." },
29{ "2nd","2." }, 29{ "2nd","2." },
30{ "30 minutes","30 Minuten" }, 30{ "30 minutes","30 Minuten" },
31{ "30th","30." }, 31{ "30th","30." },
32{ "31st","31." }, 32{ "31st","31." },
33{ "3rd","3." }, 33{ "3rd","3." },
34{ "4th","4." }, 34{ "4th","4." },
35{ "5 (lowest)","5 (Niedrigster)" }, 35{ "5 (lowest)","5 (Niedrigster)" },
36{ "5th","5." }, 36{ "5th","5." },
37{ "6th","6." }, 37{ "6th","6." },
38{ "7th","7." }, 38{ "7th","7." },
39{ "8th","8." }, 39{ "8th","8." },
40{ "9th","9." }, 40{ "9th","9." },
41{ "About...","Über..." }, 41{ "About...","Über..." },
42{ "&Accept","&Akzeptieren" }, 42{ "&Accept","&Akzeptieren" },
43{ "Accept","Akzeptieren" }, 43{ "Accept","Akzeptieren" },
44{ "Accept A&ll","A&lles Akzepieren" }, 44{ "Accept A&ll","A&lles Akzepieren" },
45{ "Access:","Zugriff:" }, 45{ "Access:","Zugriff:" },
46{ "A corresponding event is missing in your calendar!","Ein zugehöriger Termin fehlt in ihrem Kalender!" }, 46{ "A corresponding event is missing in your calendar!","Ein zugehöriger Termin fehlt in ihrem Kalender!" },
47{ "Action","Aktion" }, 47{ "Action","Aktion" },
48{ "Add Filter","Filter Hinzufügen" }, 48{ "Add Filter","Filter Hinzufügen" },
49{ "&Add","Hinzufügen" }, 49{ "&Add","Hinzufügen" },
50{ "Add","Hinzufügen" }, 50{ "Add","Hinzufügen" },
51{ "Additional email addresses:","Zusätzliche E-Mail Adressen:" }, 51{ "Additional email addresses:","Zusätzliche E-Mail Adressen:" },
52{ "Additional email address:","Zusätzliche E-Mail Adresse:" }, 52{ "Additional email address:","Zusätzliche E-Mail Adresse:" },
53{ "&Addressbook","&Adressbuch" }, 53{ "&Addressbook","&Adressbuch" },
54{ "Address &Book...","Adress&buch..." }, 54{ "Address &Book...","Adress&buch..." },
55{ "Agenda Size","Agende Größe" }, 55{ "Agenda Size","Agende Größe" },
56{ "Agenda Size:","Größe der Agenda:" }, 56{ "Agenda Size:","Größe der Agenda:" },
57{ "Agenda view:","Agenda Ansicht:" }, 57{ "Agenda view:","Agenda Ansicht:" },
58{ "Agenda view background color:","Hintergrund der Agenda Ansicht:" }, 58{ "Agenda view background color:","Hintergrund der Agenda Ansicht:" },
59{ "All attendees","Alle Teilnehmer" }, 59{ "All attendees","Alle Teilnehmer" },
60{ "AllDayAgenda Height:","Höhe Ganztages Agenda:" }, 60{ "AllDayAgenda Height:","Höhe Ganztages Agenda:" },
61{ "All day event","Ganztägig" }, 61{ "All day event","Ganztägig" },
62{ "Anonymous","Anonym" }, 62{ "Anonymous","Anonym" },
63{ "Apply","Anwenden" }, 63{ "Apply","Anwenden" },
64{ "Apr","Apr" }, 64{ "Apr","Apr" },
65{ "April","April" }, 65{ "April","April" },
66{"Ask for every entry on conflict","Frage bei Konflikten nach"}, 66{"Ask for every entry on conflict","Frage bei Konflikten nach"},
67{ "Ask for preferences before syncing","Vor dem Syncronisieren nachfragen" }, 67{ "Ask for preferences before syncing","Vor dem Syncronisieren nachfragen" },
68{ "Ask for quit when closing KO/Pi","Vor dem Beenden von KO/Pi nachfragen" }, 68{ "Ask for quit when closing KO/Pi","Vor dem Beenden von KO/Pi nachfragen" },
69{ "Attendees","Teilnehmer" }, 69{ "Attendees","Teilnehmer" },
70{ "Aug","Aug" }, 70{ "Aug","Aug" },
71{ "August","August" }, 71{ "August","August" },
72{ "Auto-Save","Automatisches Abspeichern" }, 72{ "Auto-Save","Automatisches Abspeichern" },
73{ "Auto save delay in minutes:","Verzög.autom.Speichern in Min" }, 73{ "Auto save delay in minutes:","Verzög.autom.Speichern in Min" },
74{ "Auto saving...","Automatische Sicherung..." }, 74{ "Auto saving...","Automatische Sicherung..." },
75{ "Begin on:","Starte mit:" }, 75{ "Begin on:","Starte mit:" },
76{ "Begins on: %1","Starte mit: %1" }, 76{ "Begins on: %1","Starte mit: %1" },
77{ "<b>From:</b> %1 <b>To:</b> %2","<b>Vom:</b> %1 <b>Zum:</b> %2" }, 77{ "<b>From:</b> %1 <b>To:</b> %2","<b>Vom:</b> %1 <b>Zum:</b> %2" },
78{ "<b>On:</b> %1","<b>Am:</b> %1" }, 78{ "<b>On:</b> %1","<b>Am:</b> %1" },
79{ "<b>On:</b> %1 <b>From:S</b> %2 <b>To:</b> %3","<b>Am:</b> %1 <b>Vom:S</b> %2 <b>Zum:</b> %3" }, 79{ "<b>On:</b> %1 <b>From:S</b> %2 <b>To:</b> %3","<b>Am:</b> %1 <b>Vom:S</b> %2 <b>Zum:</b> %3" },
80{ "<b>Original event:</b><p>","<b>Original Termin:</b><p>" }, 80{ "<b>Original event:</b><p>","<b>Original Termin:</b><p>" },
81{ " - both are modified after last sync"," - beide wurden nach der letzten Syncronisation verändert" }, 81{ " - both are modified after last sync"," - beide wurden nach der letzten Syncronisation verändert" },
82{ "Busy","Belegt" }, 82{ "Busy","Belegt" },
83{ "&Cancel","Abbre&chen" }, 83{ "&Cancel","Abbre&chen" },
84{ "Cancel","Abbrechen" }, 84{ "Cancel","Abbrechen" },
85{ "Cannot delete To-Do\nwhich has children.","Kann Todo nicht löschen,\n da noch Einträge vorhanden sind" }, 85{ "Cannot delete To-Do\nwhich has children.","Kann Todo nicht löschen,\n da noch Einträge vorhanden sind" },
86{ "Can't generate mail:\nNo event selected.","Kann e-Mail nicht erstellen:\nKein Termin ausgewählt." }, 86{ "Can't generate mail:\nNo event selected.","Kann e-Mail nicht erstellen:\nKein Termin ausgewählt." },
87{ "Categories...","Kategorien..." }, 87{ "Categories...","Kategorien..." },
88{ "Categories","Kategorien" }, 88{ "Categories","Kategorien" },
89{ "Category","Kategorie" }, 89{ "Category","Kategorie" },
90{ "Center View","Zentriere Ansicht" }, 90{ "Center View","Zentriere Ansicht" },
91{ "Change","Ändere" }, 91{ "Change","Ändere" },
92{ "Cinema","Kino" }, 92{ "Cinema","Kino" },
93{ "Clone Item","Klone Eintrag" }, 93{ "Clone Item","Klone Eintrag" },
94{ "&Close","S&chließen" }, 94{ "&Close","S&chließen" },
95{ "Close","Schließen" }, 95{ "Close","Schließen" },
96{ "Close this dialog to abort deletion!","Zum Abbrechen des Löschvorganges Dialog schließen!" }, 96{ "Close this dialog to abort deletion!","Zum Abbrechen des Löschvorganges Dialog schließen!" },
97{ "Colors","Farben" }, 97{ "Colors","Farben" },
98{ "completed","erledigt" }, 98{ "completed","erledigt" },
99{ "completed on %1","erledigt am %1" }, 99{ "completed on %1","erledigt am %1" },
100{ "Complete","Erledigt" }, 100{ "Complete","Erledigt" },
101{ "Confidential","Vertraulich" }, 101{ "Confidential","Vertraulich" },
102{ "Configure...","Einstellungen..." }, 102{ "Configure...","Einstellungen..." },
103{ "Confirm &deletes","Löschvogang bestätigen" }, 103{ "Confirm &deletes","Löschvogang bestätigen" },
104{ "Couldn't load calendar\n '%1'.","Kann Kalender\n '%1' nicht laden." }, 104{ "Couldn't load calendar\n '%1'.","Kann Kalender\n '%1' nicht laden." },
105{ "Counter-event Viewer","Terminzähler Ansicht" }, 105{ "Counter-event Viewer","Terminzähler Ansicht" },
106{ "Daily ending hour:","Feierabend:" }, 106{ "Daily ending hour:","Feierabend:" },
107{ "Daily starting hour:","Anfangszeit:" }, 107{ "Daily starting hour:","Anfangszeit:" },
108{ "Daily","Täglich" }, 108{ "Daily","Täglich" },
109{ "Date Format","Datums Format" }, 109{ "Date Format","Datums Format" },
110{ "Date Format:","Datums Format:" }, 110{ "Date Format:","Datums Format:" },
111{ "DateNavigator:(nr)","Datums Navigator" }, 111{ "DateNavigator:(nr)","Datums Navigator" },
112{ "Dates: ","Datum: " }, 112{ "Dates: ","Datum: " },
113{ "Date && Time","Datum && Zeit" }, 113{ "Date && Time","Datum && Zeit" },
114{ "Day begins at:","Der Tag beginnt um:" }, 114{ "Day begins at:","Der Tag beginnt um:" },
115{ "Days in Next-X-Days:","Tage in Nächste-X-Tage:" }, 115{ "Days in Next-X-Days:","Tage in Nächste-X-Tage:" },
116{ "Days in What's Next:","Tage in What's Next:" }, 116{ "Days in What's Next:","Tage in What's Next:" },
117{ "day(s)","Tag(e)" }, 117{ "day(s)","Tag(e)" },
118{ "Days to show in Next-X-Days view:","Welche Tage in Nächste-X-Tagen anzeigen:" }, 118{ "Days to show in Next-X-Days view:","Welche Tage in Nächste-X-Tagen anzeigen:" },
119{ "day","Tag" }, 119{ "day","Tag" },
120{ "Dec","Dez" }, 120{ "Dec","Dez" },
121{ "December","Dezember" }, 121{ "December","Dezember" },
122{ "Default alarm time:","Standard Alarmzeit:" }, 122{ "Default alarm time:","Standard Alarmzeit:" },
123{ "Default appointment time:","Standard Termin Startzeit:" }, 123{ "Default appointment time:","Standard Termin Startzeit:" },
124{ "Default event color:","Standard Terminfarbe:" }, 124{ "Default event color:","Standard Terminfarbe:" },
125{ "Default","Standard" }, 125{ "Default","Standard" },
126{ "Def. duration of new app.:","Standard Termin Länge:" }, 126{ "Def. duration of new app.:","Standard Termin Länge:" },
127{ "Delete All","Lösche alles" }, 127{ "Delete All","Lösche alles" },
128{ "Delete all selected","Lösche alle Selektierten" }, 128{ "Delete all selected","Lösche alle Selektierten" },
129{ "Delete Current","Aktuellen löschen" }, 129{ "Delete Current","Aktuellen löschen" },
130{ "Delete Event...","Lösche Termin..." }, 130{ "Delete Event...","Lösche Termin..." },
131{ "Delete Event","Lösche Termin" }, 131{ "Delete Event","Lösche Termin" },
132{ "&Delete...","Lösche..." }, 132{ "&Delete...","Lösche..." },
133{ "Delete...","Lösche..." }, 133{ "Delete...","Lösche..." },
134{ "Delete","Lösche" }, 134{ "Delete","Lösche" },
135{ "Delete Todo...","Lösche Todo..." }, 135{ "Delete Todo...","Lösche Todo..." },
136{ "Delete To-Do","Lösche Todo" }, 136{ "Delete To-Do","Lösche Todo" },
137{ "Deleting item %d ...","Lösche Eintrag %d..." }, 137{ "Deleting item %d ...","Lösche Eintrag %d..." },
138{ "Descriptions","Beschreibungen" }, 138{ "Descriptions","Beschreibungen" },
139{ "Deselect all","Deselektiere Alle" }, 139{ "Deselect all","Deselektiere Alle" },
140{ "Details","Details" }, 140{ "Details","Details" },
141{ "Dinner","Abendessen" }, 141{ "Dinner","Abendessen" },
142{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" }, 142{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" },
143{ "Due Date","Fällig am" }, 143{ "Due Date","Fällig am" },
144{ "Due: ","Fällig: "}, 144{ "Due: ","Fällig: "},
145{ "Due Time","Fällig um" }, 145{ "Due Time","Fällig um" },
146{ "Due:","Fällig:"}, 146{ "Due:","Fällig:"},
147{ "Duration: ","Dauer: " }, 147{ "Duration: ","Dauer: " },
148{ "Edit...","Bearbeite..." }, 148{ "Edit...","Bearbeite..." },
149{ "Edit Event...","Bearbeite Termin..." }, 149{ "Edit Event...","Bearbeite Termin..." },
150{ "Edit Event","Bearbeite Termin" }, 150{ "Edit Event","Bearbeite Termin" },
151{ "Edit exceptions","Bearbeite Ausnahmen" }, 151{ "Edit exceptions","Bearbeite Ausnahmen" },
152{ "EditorBox:","Editor Fenster:" }, 152{ "EditorBox:","Editor Fenster:" },
153{ "Edit Recurrence Range","Bearbeite Wiederholung" }, 153{ "Edit Recurrence Range","Bearbeite Wiederholung" },
154{ "Edit Todo...","Berabeite Todo..." }, 154{ "Edit Todo...","Berabeite Todo..." },
155{ "Edit To-Do","Todo bearbeiten" }, 155{ "Edit To-Do","Todo bearbeiten" },
156{ "E&mail address:","E&mail Adresse:" }, 156{ "E&mail address:","E&mail Adresse:" },
157{ "(EmptyEmail)","(KeineEmail)" }, 157{ "(EmptyEmail)","(KeineEmail)" },
158{ "(EmptyName)","(KeinName)" }, 158{ "(EmptyName)","(KeinName)" },
159{ "Enable Recurrence","Wiederholung anschalten" }, 159{ "Enable Recurrence","Wiederholung anschalten" },
160{ "End after","Endet nach"}, 160{ "End after","Endet nach"},
161{ "End by:","Endet am"}, 161{ "End by:","Endet am"},
162{ "End Date","End Datum" }, 162{ "End Date","End Datum" },
163{ "End:","Ende:" }, 163{ "End:","Ende:" },
164{ "End Time","End Zeit" }, 164{ "End Time","End Zeit" },
165{ "English","Englisch" }, 165{ "English","Englisch" },
166{ "Event","Termin" }, 166{ "Event","Termin" },
167{ "Event list","Termin Liste" }, 167{ "Event list","Termin Liste" },
168{ "Events","Termine" }, 168{ "Events","Termine" },
169{ "Event Viewer:","Termin Übersicht:" }, 169{ "Event Viewer:","Termin Übersicht:" },
170{ "every","jede" }, 170{ "every","jede" },
171{ "Exceptions...","Ausnahmen..." }, 171{ "Exceptions...","Ausnahmen..." },
172{ "Exceptions","Ausnahmen" }, 172{ "Exceptions","Ausnahmen" },
173{ "Exclude holidays","Ohne freie Tage" }, 173{ "Exclude holidays","Ohne freie Tage" },
174{ "Exclude Saturdays","Ohne Samstage" }, 174{ "Exclude Saturdays","Ohne Samstage" },
175{ "Feb","Feb" }, 175{ "Feb","Feb" },
176{ "February","Februar" }, 176{ "February","Februar" },
177{ "&Find","Suche!" }, 177{ "&Find","Suche!" },
178{ "Fonts","Schriftart" }, 178{ "Fonts","Schriftart" },
179{ "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" }, 179{ "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" },
180{ "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"}, 180{ "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"},
181{ "Free","Frei" }, 181{ "Free","Frei" },
182{ "Friday","Freitag" }, 182{ "Friday","Freitag" },
183{ "Fri","Fr" }, 183{ "Fri","Fr" },
184{ "From:","Vom:" }, 184{ "From:","Vom:" },
185{ "Full &name:","Vor- und &Nachname:" }, 185{ "Full &name:","Vor- und &Nachname:" },
186{ "General","Allgemein" }, 186{ "General","Allgemein" },
187{ "German","Deutsch" }, 187{ "German","Deutsch" },
188{ "Gifts","Geschenke" }, 188{ "Gifts","Geschenke" },
189{ "Go to Today","Heute anzeigen" }, 189{ "Go to Today","Heute anzeigen" },
190{ "Help","Hilfe" }, 190{ "Help","Hilfe" },
191{ "Hide Dates","Daten ausblenden" }, 191{ "Hide Dates","Daten ausblenden" },
192{ "Highlight color:","Markierungen:" }, 192{ "Highlight color:","Markierungen:" },
193{ "Holiday color:","Freie Tage:" }, 193{ "Holiday color:","Freie Tage:" },
194{ "hour(s)","Stunde(n)" }, 194{ "hour(s)","Stunde(n)" },
195{ "In %1 days: ","In %1 Tagen: " }, 195{ "In %1 days: ","In %1 Tagen: " },
196{ "Incomplete Todo:","Unerledigte Aufgaben:" }, 196{ "Incomplete Todo:","Unerledigte Aufgaben:" },
197{ "Information","Information" }, 197{ "Information","Information" },
198{ "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" }, 198{ "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" },
199{ "Jan","Jan" }, 199{ "Jan","Jan" },
200{ "January","Januar" }, 200{ "January","Januar" },
201{ "JournalView:","Journal Ansicht:" }, 201{ "JournalView:","Journal Ansicht:" },
202{ "Journals","Journale" }, 202{ "Journals","Journale" },
203{ "Jul","Jul" }, 203{ "Jul","Jul" },
204{ "July","Juli" }, 204{ "July","Juli" },
205{ "Jump to date","Springe zum Datum" }, 205{ "Jump to date","Springe zum Datum" },
206{ "June","Juni" }, 206{ "June","Juni" },
207{ "Jun","Jun" }, 207{ "Jun","Jun" },
208{ "Key Bindings...","Tastenzuordnung..." }, 208{ "Key Bindings...","Tastenzuordnung..." },
209{ "Kids","Kinder" }, 209{ "Kids","Kinder" },
210{ "Known Problems...","Bekannte Probleme..." }, 210{ "Known Problems...","Bekannte Probleme..." },
211{ "KO/Pi Find ","KO/Pi Suchdialog " }, 211{ "KO/Pi Find ","KO/Pi Suchdialog " },
212{ "KO/Pi Find: ","KO/Pi Suchen: " }, 212{ "KO/Pi Find: ","KO/Pi Suchen: " },
213{ "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." }, 213{ "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." },
214{ "Language:(needs restart)","Sprache (Neustart!)" }, 214{ "Language:(needs restart)","Sprache (Neustart!)" },
215{ "Language:","Sprache" }, 215{ "Language:","Sprache" },
216{ "Large","Etwas mehr" }, 216{ "Large","Etwas mehr" },
217{ "List View:","Listenansicht:" }, 217{ "List View:","Listenansicht:" },
218{ "List View","Listenansicht" }, 218{ "List View","Listenansicht" },
219{ "Load/Save","Laden/Speichern" }, 219{ "Load/Save","Laden/Speichern" },
220{ "Load Template","Lade Vorlage" }, 220{ "Load Template","Lade Vorlage" },
221{ "Locale","Lokalisation" }, 221{ "Locale","Lokalisation" },
222{ "Local temp file:","Lokale temp. Datei:" }, 222{ "Local temp file:","Lokale temp. Datei:" },
223{ "Location: ","Ort: " }, 223{ "Location: ","Ort: " },
224{ "Location:","Ort:" }, 224{ "Location:","Ort:" },
225{ "Mail client","Mail Programm" }, 225{ "Mail client","Mail Programm" },
226{ "Mail Client","Mail Programm" }, 226{ "Mail Client","Mail Programm" },
227{ "March","März" }, 227{ "March","März" },
228{ "Mar","Mär" }, 228{ "Mar","Mär" },
229{ "May","Mai" }, 229{ "May","Mai" },
230{ "M. Bains line:","M. Bains Linie:" }, 230{ "M. Bains line:","M. Bains Linie:" },
231{ "Medium","Medium" }, 231{ "Medium","Medium" },
232{ "Method","Methode" }, 232{ "Method","Methode" },
233{ "minute(s)","Minute(n)" }, 233{ "minute(s)","Minute(n)" },
234{ "Monday","Montag" }, 234{ "Monday","Montag" },
235{ "Mon","Mo" }, 235{ "Mon","Mo" },
236{ "Monthly","Monatlich" }, 236{ "Monthly","Monatlich" },
237{ "Month not long enough","Monat ist nicht lang genug" }, 237{ "Month not long enough","Monat ist nicht lang genug" },
238{ "month(s)","Monat(e)" }, 238{ "month(s)","Monat(e)" },
239{ "Month view:","Monatsansicht:" }, 239{ "Month view:","Monatsansicht:" },
240{ "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" }, 240{ "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" },
241{ "Todo view uses category colors","Todo Ansicht zeigt Kategorie Farben" }, 241{ "Todo view uses category colors","Todo Ansicht zeigt Kategorie Farben" },
242{ "Move &Down","Nach unten verschieben" }, 242{ "Move &Down","Nach unten verschieben" },
243{ "Move &Up","Nach oben verschieben" }, 243{ "Move &Up","Nach oben verschieben" },
244{ "Name:","Name:" }, 244{ "Name:","Name:" },
245{ "Name","Name" }, 245{ "Name","Name" },
246{ "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" }, 246{ "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" },
247{ "%n Days","%n Tage" }, 247{ "%n Days","%n Tage" },
248{ "Never","Nie" }, 248{ "Never","Nie" },
249{ "New event...","Neuer Termin..." }, 249{ "New event...","Neuer Termin..." },
250{ "New event","Neuer Termin" }, 250{ "New event","Neuer Termin" },
251{ "New Event...","Neuer Termin..." }, 251{ "New Event...","Neuer Termin..." },
252{ "New Events/Todos should","Neue Termine/Todos sollten" }, 252{ "New Events/Todos should","Neue Termine/Todos sollten" },
253{ "&New","&Neu" }, 253{ "&New","&Neu" },
254{ "New","Neu", }, 254{ "New","Neu", },
255{ "New Sub-Todo...","Neues Sub-Todo..." }, 255{ "New Sub-Todo...","Neues Sub-Todo..." },
256{ "New Todo...","Neues Todo..." }, 256{ "New Todo...","Neues Todo..." },
257{ "Next Alarm: ","Nächster Alarm: ", }, 257{ "Next Alarm: ","Nächster Alarm: ", },
258{ "&Next Day","&Nächster Tag", }, 258{ "&Next Day","&Nächster Tag", },
259{ "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" }, 259{ "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" },
260{ "Next month","Nächster Monat" }, 260{ "Next month","Nächster Monat" },
261{ "&Next Week","&Nächste Woche" }, 261{ "&Next Week","&Nächste Woche" },
262{ "Next year","Nächstes Jahr" }, 262{ "Next year","Nächstes Jahr" },
263{ "Next Year","Nächstes Jahr" }, 263{ "Next Year","Nächstes Jahr" },
264{ "%n h","%n Std" }, 264{ "%n h","%n Std" },
265{ "No ending date","Kein End-Datum", }, 265{ "No ending date","Kein End-Datum", },
266{ "No event, nothing to do.","Kein Termin, nichts zu tun.", }, 266{ "No event, nothing to do.","Kein Termin, nichts zu tun.", },
267{ "No event selected.","Kein Termin selektiert" }, 267{ "No event selected.","Kein Termin selektiert" },
268{ "No","Nein" }, 268{ "No","Nein" },
269{ "No program set","Kein Programm ausgewählt", }, 269{ "No program set","Kein Programm ausgewählt", },
270{ "Normal","Normal" }, 270{ "Normal","Normal" },
271{ "[No selection]","Keine Selektion", }, 271{ "[No selection]","Keine Selektion", },
272{ "No sound set","Kein Sound ausgewählt", }, 272{ "No sound set","Kein Sound ausgewählt", },
273{ "no time ","keine Zeit ", }, 273{ "no time ","keine Zeit ", },
274{ "no time","keine Zeit", }, 274{ "no time","keine Zeit", },
275{ "No Time","Keine Zeit" }, 275{ "No Time","Keine Zeit" },
276{ "November","November" }, 276{ "November","November" },
277{ "Nov","Nov", }, 277{ "Nov","Nov", },
278{ "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" }, 278{ "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" },
279{ "occurrence(s)","Vorkommen" }, 279{ "occurrence(s)","Vorkommen" },
280{ "October","Oktober" }, 280{ "October","Oktober" },
281{ "Oct","Okt", }, 281{ "Oct","Okt", },
282{ "O-due!","Ü-fällig! " }, 282{ "O-due!","Ü-fällig! " },
283{ "&OK","&OK" }, 283{ "&OK","&OK" },
284{ "Ok+Show!","Ok+Anzeigen" }, 284{ "Ok+Show!","Ok+Anzeigen" },
285{ "Organizer: %1","Organisator %1" }, 285{ "Organizer: %1","Organisator %1" },
286{ "Organizer","Organisator" }, 286{ "Organizer","Organisator" },
287{ "Owner: ","Besitzer: " }, 287{ "Owner: ","Besitzer: " },
288{ "Owner:","Besitzer:" }, 288{ "Owner:","Besitzer:" },
289{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, 289{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" },
290{ "Pick a date to display","Wähle einen Tag zum anzeigen aus" }, 290{ "Pick a date to display","Wähle einen Tag zum anzeigen aus" },
291{ "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."}, 291{ "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."},
292{ "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." }, 292{ "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." },
293{ "Please specify a valid start date.","Bitte gültiges Startdatum angeben." }, 293{ "Please specify a valid start date.","Bitte gültiges Startdatum angeben." },
294{ "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." }, 294{ "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." },
295{ "Please specify a valid start time.","Bitte gültige Startzeit angeben."}, 295{ "Please specify a valid start time.","Bitte gültige Startzeit angeben."},
296{ "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." }, 296{ "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." },
297{ "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" }, 297{ "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" },
298{ "&Previous Day","Vorheriger Tag" }, 298{ "&Previous Day","Vorheriger Tag" },
299{ "Previous month","Vorheriger Monat" }, 299{ "Previous month","Vorheriger Monat" },
300{ "Previous Month","Vorheriger Monat" }, 300{ "Previous Month","Vorheriger Monat" },
301{ "&Previous Week","Vorherige Woche" }, 301{ "&Previous Week","Vorherige Woche" },
302{ "Previous year","Vorheriges Jahr" }, 302{ "Previous year","Vorheriges Jahr" },
303{ "Previous Year","Vorheriges Jahr" }, 303{ "Previous Year","Vorheriges Jahr" },
304{ "Printing","Drucken" }, 304{ "Printing","Drucken" },
305{ "Priority:","Priorität:" }, 305{ "Priority:","Priorität:" },
306{ "Private","Privat" }, 306{ "Private","Privat" },
307{ "Proceed","Weiter" }, 307{ "Proceed","Weiter" },
308{ "Public","Öffentlich" }, 308{ "Public","Öffentlich" },
309{ "Purge","Entferne" }, 309{ "Purge","Entferne" },
310{ "Purge Completed...","Entferne erledigte Todos..." }, 310{ "Purge Completed...","Entferne erledigte Todos..." },
311{ "Purge Todos","Todos bereinigen" }, 311{ "Purge Todos","Todos bereinigen" },
312{ "read-only","schreibgeschützt" }, 312{ "read-only","schreibgeschützt" },
313{ "Recur every","Wiederh. alle" }, 313{ "Recur every","Wiederh. alle" },
314{ "Recur in the month of","Wiederh. im Monat" }, 314{ "Recur in the month of","Wiederh. im Monat" },
315{ "Recur on the","Wiederh. am" }, 315{ "Recur on the","Wiederh. am" },
316{ "Recur on this day","Wiederh. am diesen Tag" }, 316{ "Recur on this day","Wiederh. am diesen Tag" },
317{ "Recurrence Range...","Wiederholungs Zeitraum..." }, 317{ "Recurrence Range...","Wiederholungs Zeitraum..." },
318{ "Recurrence Range","Wiederholungs Zeitraum" }, 318{ "Recurrence Range","Wiederholungs Zeitraum" },
319{ "Recurrence Rule","Wiederholungs Regel" }, 319{ "Recurrence Rule","Wiederholungs Regel" },
320{ "Recurrence","Wiederholung" }, 320{ "Recurrence","Wiederholung" },
321{ "Recurs","Wiederholung" }, 321{ "Recurs","Wiederholung" },
322{"&Reject","Abweisen"}, 322{"&Reject","Abweisen"},
323{ "Reminder:","Alarm:" }, 323{ "Reminder:","Alarm:" },
324{ "Rem.:","Alarm:" }, 324{ "Rem.:","Alarm:" },
325{ "Rem.","Alarm:" }, 325{ "Rem.","Alarm:" },
326{ "Remote file:","Remote Datei:"}, 326{ "Remote file:","Remote Datei:"},
327{ "Remote IP:","Remote (ferne) IP:" }, 327{ "Remote IP:","Remote (ferne) IP:" },
328{ "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " }, 328{ "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " },
329{ "Remote user:","Remote Benutzer"}, 329{ "Remote user:","Remote Benutzer"},
330{ "&Remove","Entfe&rnen" }, 330{ "&Remove","Entfe&rnen" },
331{ "Remove","Entfernen" }, 331{ "Remove","Entfernen" },
332{ "Request response","Bemerkung anfordern" }, 332{ "Request response","Bemerkung anfordern" },
333{ "Role:","Rolle:" }, 333{ "Role:","Rolle:" },
334{ "Role","Rolle" }, 334{ "Role","Rolle" },
335{ "Sat","Sa" }, 335{ "Sat","Sa" },
336{ "Saturday","Samstag" }, 336{ "Saturday","Samstag" },
337{ "Search for:","Suche nach:" }, 337{ "Search for:","Suche nach:" },
338{ "Search In","Suche in" }, 338{ "Search In","Suche in" },
339{ "Search...","Suche..." }, 339{ "Search...","Suche..." },
340{ "Search","Suche" }, 340{ "Search","Suche" },
341{ "Select Addresses","Wähle Adressen" }, 341{ "Select Addresses","Wähle Adressen" },
342{ "Select all","Selektiere Alle" }, 342{ "Select all","Selektiere Alle" },
343{ "Select a month","Wähle Monat" }, 343{ "Select a month","Wähle Monat" },
344{ "Select a week","Wähle Woche" }, 344{ "Select a week","Wähle Woche" },
345{ "Select a year","Wähle Jahr" }, 345{ "Select a year","Wähle Jahr" },
346{ "Send directly","Sende direkt" }, 346{ "Send directly","Sende direkt" },
347{ "&Send Messages","&Sende Nachrichten", }, 347{ "&Send Messages","&Sende Nachrichten", },
348{ "Sep","Sep" }, 348{ "Sep","Sep" },
349{ "September","September" }, 349{ "September","September" },
350{ "Shopping","Einkaufen" }, 350{ "Shopping","Einkaufen" },
351{ "Show Dates","Zeige Daten" }, 351{ "Show Dates","Zeige Daten" },
352{ "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." }, 352{ "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." },
353{ "Show Event","Termin anzeigen" }, 353{ "Show Event","Termin anzeigen" },
354{ "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." }, 354{ "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." },
355{ "Show Marcus Bains line","Zeige Marcus Bains Linie" }, 355{ "Show Marcus Bains line","Zeige Marcus Bains Linie" },
356{ "Show summary after syncing","Zeige Zusammenfassung nach Sync." }, 356{ "Show summary after syncing","Zeige Zusammenfassung nach Sync." },
357{ "Show time as:","Zeige Zeit als" }, 357{ "Show time as:","Zeige Zeit als" },
358{ "Show Todo","Todo anzeigen" }, 358{ "Show Todo","Todo anzeigen" },
359{ "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, 359{ "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" },
360{ "&Show","Anzeigen" }, 360{ "&Show","Anzeigen" },
361{ "Show...","Anzeigen..." }, 361{ "Show...","Anzeigen..." },
362{ "Show","Anzeigen" }, 362{ "Show","Anzeigen" },
363{ "Small","Klein" }, 363{ "Small","Klein" },
364{ "Sorry","Tut mir leid" }, 364{ "Sorry","Tut mir leid" },
365{"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, 365{"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"},
366{ "Start:","Start:" }, 366{ "Start:","Start:" },
367{ "Start Date","Start Datum" }, 367{ "Start Date","Start Datum" },
368{ "Start date: %1","Start Datum: %1" }, 368{ "Start date: %1","Start Datum: %1" },
369{ "Start Time","Start Zeit" }, 369{ "Start Time","Start Zeit" },
370{ "Status:","Status:" }, 370{ "Status:","Status:" },
371{ "Status","Status:" }, 371{ "Status","Status:" },
372{ "Summaries","Titel" }, 372{ "Summaries","Titel" },
373{ "Summary:","Titel:" }, 373{ "Summary:","Titel:" },
374{ "Summary","Titel" }, 374{ "Summary","Titel" },
375{ "Sunday","Sonntag" }, 375{ "Sunday","Sonntag" },
376{ "Sun","So" }, 376{ "Sun","So" },
377{ "Sync preferences:","Sync Einstellungen" }, 377{ "Sync preferences:","Sync Einstellungen" },
378{ "Sync Prefs","Sync Einstellungen" }, 378{ "Sync Prefs","Sync Einstellungen" },
379{ "Syncronize","Daten abgleich" }, 379{ "Syncronize","Daten abgleich" },
380{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, 380{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" },
381{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, 381{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" },
382{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" }, 382{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" },
383{ "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges Todo" }, 383{ "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges Todo" },
384{ "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" }, 384{ "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" },
385{ "Template...","Vorlage..." }, 385{ "Template...","Vorlage..." },
386{ "This day","Dieser Tag" }, 386{ "This day","Dieser Tag" },
387{ "This is an experimental feature. ","Dieses Feature ist experimentel" }, 387{ "This is an experimental feature. ","Dieses Feature ist experimentel" },
388{ "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." }, 388{ "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." },
389{ "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." }, 389{ "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." },
390{ "Thu","Do" }, 390{ "Thu","Do" },
391{ "Thursday","Donnerstag" }, 391{ "Thursday","Donnerstag" },
392{ "Time associated","Mit Zeit" }, 392{ "Time associated","Mit Zeit" },
393{ "Time bar:","Uhrzeit Zeile:" }, 393{ "Time bar:","Uhrzeit Zeile:" },
394{ "Time && Date","Zeit und Datum" }, 394{ "Time && Date","Zeit und Datum" },
395{ "Time Format","Zeit Format" }, 395{ "Time Format","Zeit Format" },
396{ "Time Format(nr):","Zeit Format(Neustart!)" }, 396{ "Time Format(nr):","Zeit Format(Neustart!)" },
397{ "Date Labels:","Datumsleiste:" }, 397{ "Date Labels:","Datumsleiste:" },
398{ "Time: ","Zeit: " }, 398{ "Time: ","Zeit: " },
399{ "Timezone:","Zeitzone:" }, 399{ "Timezone:","Zeitzone:" },
400{ "To: ","Bis: " }, 400{ "To: ","Bis: " },
401{ "To:","Bis:" }, 401{ "To:","Bis:" },
402{ "Today: ","Heute: " }, 402{ "Today: ","Heute: " },
403{ "Todo due today color:","Heute fällige Todos" }, 403{ "Todo due today color:","Heute fällige Todos" },
404{ "To-do items:","To-Do items:" }, 404{ "To-do items:","To-Do items:" },
405{ "Todo overdue color:","Überfällige Todos" }, 405{ "Todo overdue color:","Überfällige Todos" },
406{ "Todo","Todo" }, 406{ "Todo","Todo" },
407{ "To-do view shows completed Todos","Todo Ansicht zeigt erledigte Todos" }, 407{ "To-do view shows completed Todos","Todo Ansicht zeigt erledigte Todos" },
408{ "ToDoView:","Todo Ansicht:" }, 408{ "ToDoView:","Todo Ansicht:" },
409{ "Toggle Alarm","Wechsle Alarm" }, 409{ "Toggle Alarm","Wechsle Alarm" },
410{ "Toggle Allday","Umschalten Ganztag" }, 410{ "Toggle Allday","Umschalten Ganztag" },
411{ "Tomorrow: ","Morgen: " }, 411{ "Tomorrow: ","Morgen: " },
412{ "Tue","Di" }, 412{ "Tue","Di" },
413{ "Tuesday","Dienstag" }, 413{ "Tuesday","Dienstag" },
414{ "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" }, 414{ "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" },
415{ "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." }, 415{ "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." },
416{ "Unknown","Unbekannt" }, 416{ "Unknown","Unbekannt" },
417{ "Up","Hinauf" }, 417{ "Up","Hinauf" },
418{ "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" }, 418{ "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" },
419{ "User defined","Benutzerdefiniert" }, 419{ "User defined","Benutzerdefiniert" },
420{ "User long date:","Format langes Datum:" }, 420{ "User long date:","Format langes Datum:" },
421{ "User short date:","Forma kurzes Datum:" }, 421{ "User short date:","Forma kurzes Datum:" },
422{ "View","Ansicht" }, 422{ "View","Ansicht" },
423{ "View Fonts","Schriftarten Ansichten" }, 423{ "View Fonts","Schriftarten Ansichten" },
424{ "Views","Ansichten" }, 424{ "Views","Ansichten" },
425{ "Wed","Mi" }, 425{ "Wed","Mi" },
426{ "Wednesday","Mittwoch" }, 426{ "Wednesday","Mittwoch" },
427{ "Week %1","Woche %1" }, 427{ "Week %1","Woche %1" },
428{ "Weekly","Wöchentlich" }, 428{ "Weekly","Wöchentlich" },
429{ "Week starts on Sunday","Woche beginnt Sonntags" }, 429{ "Week starts on Sunday","Woche beginnt Sonntags" },
430{ "What's Next View:","What's Next Anz." }, 430{ "What's Next View:","What's Next Anz." },
431{ "What's next ?","Was kommt als nächstes?(What's Next)" }, 431{ "What's next ?","Was kommt als nächstes?(What's Next)" },
432{ "Working Hours","Tägliche Arbeitszeit" }, 432{ "Working Hours","Tägliche Arbeitszeit" },
433{ "Working hours color:","Arbeitszeit in der Agenda Ansicht:" }, 433{ "Working hours color:","Arbeitszeit in der Agenda Ansicht:" },
434{ "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" }, 434{ "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" },
435{ "Write back synced file","Syncronisierte Datei zurückschreiben" }, 435{ "Write back synced file","Syncronisierte Datei zurückschreiben" },
436{ "Yearly","Jährlich" }, 436{ "Yearly","Jährlich" },
437{ "year(s)","Jahr(e)" }, 437{ "year(s)","Jahr(e)" },
438{ "Yes","Ja" }, 438{ "Yes","Ja" },
439{ "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" }, 439{ "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" },
440{ "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." }, 440{ "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." },
441{ "week(s) on:","Woche(n) am: " }, 441{ "week(s) on:","Woche(n) am: " },
442{ "Full menu bar(nr)","Volle Menuleiste(bn)" }, 442{ "Full menu bar(nr)","Volle Menuleiste(bn)" },
443{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, 443{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" },
444{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, 444{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" },
445{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, 445{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." },
446{ "Daylight start:","Sommerzeit Start:" }, 446{ "Daylight start:","Sommerzeit Start:" },
447{ "Daylight end:","Sommerzeit Ende:" }, 447{ "Daylight end:","Sommerzeit Ende:" },
448{ "Time Zone","Zeitzone" }, 448{ "Time Zone","Zeitzone" },
449{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, 449{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" },
450{ "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" }, 450{ "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" },
451{ "minutely","minütlich" }, 451{ "minutely","minütlich" },
452{ "hourly","stündlich" }, 452{ "hourly","stündlich" },
453{ "daily","täglich" }, 453{ "daily","täglich" },
454{ "weekly","wöchentlich" }, 454{ "weekly","wöchentlich" },
455{ "monthly","monatlich" }, 455{ "monthly","monatlich" },
456{ "day-monthly","tag-monatlich" }, 456{ "day-monthly","tag-monatlich" },
457{ "month-yearly","monat-jährlich" }, 457{ "month-yearly","monat-jährlich" },
458{ "day-yearly","tag-jährlich" }, 458{ "day-yearly","tag-jährlich" },
459{ "position-yearly","pos-jährlich" }, 459{ "position-yearly","pos-jährlich" },
460{ "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" }, 460{ "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" },
461{ "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" }, 461{ "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" },
462{ "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" }, 462{ "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" },
463{ "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" }, 463{ "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" },
464{ "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" }, 464{ "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" },
465{ "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." }, 465{ "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." },
466{ "Event list view uses full window","Listenansicht nutzt Vollbild" }, 466{ "Event list view uses full window","Listenansicht nutzt Vollbild" },
467{ "Set agenda to DayBeginsAt on change","Setze Agenda auf TagBeginntUm bei Wechsel" }, 467{ "Set agenda to DayBeginsAt on change","Setze Agenda auf TagBeginntUm bei Wechsel" },
468{ "Set agenda to current time on change","Setze Agenda auf gegenw.Zeit bei Wechsel" }, 468{ "Set agenda to current time on change","Setze Agenda auf gegenw.Zeit bei Wechsel" },
469{ "Listview uses monthly timespan","Listenansicht zeigt monatliche Zeitspanne" }, 469{ "Listview uses monthly timespan","Listenansicht zeigt monatliche Zeitspanne" },
470{ "ViewChange","Ansichtswechsel" }, 470{ "ViewChange","Ansichtswechsel" },
471{ "Default alarm *.wav file:","Standard Alarm *.wav Datei:" }, 471{ "Default alarm *.wav file:","Standard Alarm *.wav Datei:" },
472{ "This setting is useless for 5500 user!","Diese Einst. ist nutzlos für 5500 Nutzer" }, 472{ "This setting is useless for 5500 user!","Diese Einst. ist nutzlos für 5500 Nutzer" },
473{ "File","Datei" }, 473{ "File","Datei" },
474{ "Clone...","Dupliziere..." }, 474{ "Clone...","Dupliziere..." },
475{ "Move...","Bewege..." }, 475{ "Move...","Bewege..." },
476{ "Beam...","Sende via IR..." }, 476{ "Beam...","Sende via IR..." },
477{ "&Clone...","Dupliziere..." }, 477{ "&Clone...","Dupliziere..." },
478{ "&Move...","Bewege..." }, 478{ "&Move...","Bewege..." },
479{ "&Beam...","Sende via IR..." }, 479{ "&Beam...","Sende via IR..." },
480{ "Show Completed","Zeige erledigte Todos" }, 480{ "Show Completed","Zeige erledigte Todos" },
481{ "Show Quick Todo","Zeige Quick-Todo" }, 481{ "Show Quick Todo","Zeige Quick-Todo" },
482{ "Unparent Todo","Un-sub Todo" }, 482{ "Unparent Todo","Un-sub Todo" },
483{ "Save selected to file...","Speichere Selektierte..." }, 483{ "Save selected to file...","Speichere Selektierte..." },
484{ "Add Categ. to selected...","Füge zu Selekt. Kateg. hinzu..." }, 484{ "Add Categ. to selected...","Füge zu Selekt. Kateg. hinzu..." },
485{ "Set Categ. for selected...","Setze Kateg. für Selekt." }, 485{ "Set Categ. for selected...","Setze Kateg. für Selekt." },
486{ "Beam via IR...","Sende via IR..." }, 486{ "Beam via IR...","Sende via IR..." },
487{ "Search","Suchen" }, 487{ "Search","Suchen" },
488{ "Date Picker","Datum auswählen" }, 488{ "Date Picker","Datum auswählen" },
489{ "Day View","Tagesansicht" }, 489{ "Day View","Tagesansicht" },
490{ "Work Week","Arbeitswoche" }, 490{ "Work Week","Arbeitswoche" },
491{ "Week","Wochenansicht" }, 491{ "Week","Wochenansicht" },
492{ "Month","Monatsansicht" }, 492{ "Month","Monatsansicht" },
493{ "Todo View","Todo Liste" }, 493{ "Todo View","Todo Liste" },
494{ "Journal","Journal" }, 494{ "Journal","Journal" },
495{ "Next days","Nächste Tage" }, 495{ "Next days","Nächste Tage" },
496{ "Print agenda selection...","Drucke Agendaselektion..." }, 496{ "Print agenda selection...","Drucke Agendaselektion..." },
497{ "Toggle DateNavigator","Navigator umschalten" }, 497{ "Toggle DateNavigator","Navigator umschalten" },
498{ "Toggle FilterView","Filteransicht umschalten" }, 498{ "Toggle FilterView","Filteransicht umschalten" },
499{ "Prev. month","Vorheriger Monat" }, 499{ "Prev. month","Vorheriger Monat" },
500{ "Go backward","Gehe zurück" }, 500{ "Go backward","Gehe zurück" },
501{ "Go forward","Gehe weiter" }, 501{ "Go forward","Gehe weiter" },
502{ "Synchronize","Synchronisieren" }, 502{ "Synchronize","Synchronisieren" },
503{ "AgendaSize","Agendagröße" }, 503{ "AgendaSize","Agendagröße" },
504{ "Import (*.ics/*.vcs) file","Importiere (*.ics/*.vcs) Datei" }, 504{ "Import (*.ics/*.vcs) file","Importiere (*.ics/*.vcs) Datei" },
505{ "Import last file","Importiere letzte Datei" }, 505{ "Import last file","Importiere letzte Datei" },
506{ "Import Opie/Qtopia Cal.","Importiere Opie/Qtopia Kal." }, 506{ "Import Opie/Qtopia Cal.","Importiere Opie/Qtopia Kal." },
507{ "Save Backup...","Speichere Backup..." }, 507{ "Save Backup...","Speichere Backup..." },
508{ "Export VCalendar","Exportiere VCalendar" }, 508{ "Export VCalendar","Exportiere VCalendar" },
509{ "Manage new categories...","Verwalte neue Kategorien..." }, 509{ "Manage new categories...","Verwalte neue Kategorien..." },
510{ "Beam complete calendar...","Sende kompletten Kalender..." }, 510{ "Beam complete calendar...","Sende kompletten Kalender..." },
511{ "Beam filtered calendar...","Sende gefilterten Kalender..." }, 511{ "Beam filtered calendar...","Sende gefilterten Kalender..." },
512{ "Remote via ssh","Über Netzwerk via ssh" }, 512{ "Remote via ssh","Über Netzwerk via ssh" },
513{ "With local file","Mit lokaler Datei" }, 513{ "With local file","Mit lokaler Datei" },
514{ "With last file","Mit letzter Datei" }, 514{ "With last file","Mit letzter Datei" },
515{ "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" }, 515{ "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" },
516{ "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" }, 516{ "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" },
517{ "Save filename","Speichern: Dateinamen wählen" }, 517{ "Save filename","Speichern: Dateinamen wählen" },
518{ "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" }, 518{ "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" },
519{ "KO/Pi: Warning!","KO/Pi: Warnung!" }, 519{ "KO/Pi: Warning!","KO/Pi: Warnung!" },
520{ "Overwrite!","Überschreibe!" }, 520{ "Overwrite!","Überschreibe!" },
521{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, 521{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" },
522{ "All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n","Alle selektierten Einträge werden\nunwiederbringlich gelöscht.\n(Löschen kann auf dem\nPDA einige Zeit dauern)\n" }, 522{ "All selected items will be\npermanently deleted.\n(Deleting items will take\nsome time on a PDA)\n","Alle selektierten Einträge werden\nunwiederbringlich gelöscht.\n(Löschen kann auf dem\nPDA einige Zeit dauern)\n" },
523{ "KO/Pi Confirmation","KO/Pi Bestätigung" }, 523{ "KO/Pi Confirmation","KO/Pi Bestätigung" },
524{ "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" }, 524{ "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" },
525{ "Deleting item %d ...","Lösche Eintrag %d ..." }, 525{ "Deleting item %d ...","Lösche Eintrag %d ..." },
526{ "%d items remaining in list.","%d Einträge sind in der Liste verblieben." }, 526{ "%d items remaining in list.","%d Einträge sind in der Liste verblieben." },
527{ "Size","Größe" }, 527{ "Size","Größe" },
528{ "Date","Datum" }, 528{ "Date","Datum" },
529{ "Mime Type","Datei Typ" }, 529{ "Mime Type","Datei Typ" },
530{ "All Files","Alle Dateien" }, 530{ "All Files","Alle Dateien" },
531{ "Files","Dateien" }, 531{ "Files","Dateien" },
532{ "Documents","DoKumente" }, 532{ "Documents","DoKumente" },
533{ "Select Categories","Selektiere Kategorien" }, 533{ "Select Categories","Selektiere Kategorien" },
534{ " &Deselect All "," Auswahl aufheben " }, 534{ " &Deselect All "," Auswahl aufheben " },
535{ "A&dd","Hinzu" }, 535{ "A&dd","Hinzu" },
536{ "&Modify","Ändern" }, 536{ "&Modify","Ändern" },
537{ "Edit Categories","Editiere Kategorien" }, 537{ "Edit Categories","Editiere Kategorien" },
538{ " &Edit Categories "," &Editiere Kategorien " }, 538{ " &Edit Categories "," &Editiere Kategorien " },
539{ "Beam Options","Beam Einstellungen" }, 539{ "Beam Options","Beam Einstellungen" },
540{ " With timezone "," Mit Zeitzone " }, 540{ " With timezone "," Mit Zeitzone " },
541{ " Local time ", " Lokale Zeit " }, 541{ " Local time ", " Lokale Zeit " },
542{ "Manage new Categories","Verwalte neue Kategorien" }, 542{ "Manage new Categories","Verwalte neue Kategorien" },
543{ "Add to category list","Füge zur Kategorieliste hinzu" }, 543{ "Add to category list","Füge zur Kategorieliste hinzu" },
544{ "Remove from Events/Todos","Entferne von Terminen/Todos" }, 544{ "Remove from Events/Todos","Entferne von Terminen/Todos" },
545{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, 545{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" },
546{ "File format","Datei Format" }, 546{ "File format","Datei Format" },
547{ "Time format","Zeit Format" }, 547{ "Time format","Zeit Format" },
548{ "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." }, 548{ "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." },
549{ "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" }, 549{ "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" },
550{ "h","Std" }, 550{ "h","Std" },
551{ "min","Min" }, 551{ "min","Min" },
552{ "hou","Std" }, 552{ "hou","Std" },
553{ "day","Tag" }, 553{ "day","Tag" },
554{ "French","Französich" }, 554{ "French","Französich" },
555{ "Time","Zeit" }, 555{ "Time","Zeit" },
556{ "Event Viewer","Termin Anzeige" }, 556{ "Event Viewer","Termin Anzeige" },
557{ "Cancel Sync","Sync Abbrechen" }, 557{ "Cancel Sync","Sync Abbrechen" },
558{ "Remote","Fern" }, 558{ "Remote","Fern" },
559{ "Local","Lokal" }, 559{ "Local","Lokal" },
560{ "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" }, 560{ "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" },
561{ "Local: ","Lokal: " }, 561{ "Local: ","Lokal: " },
562{ "Remote: ","Fern: " }, 562{ "Remote: ","Fern: " },
563{ "Last modified: ","Zuletzt geändert: " }, 563{ "Last modified: ","Zuletzt geändert: " },
564{ "Location: ","Ort: " }, 564{ "Location: ","Ort: " },
565{ "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" }, 565{ "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" },
566{ "<p><b>On:</b> %1</p>","<p><b>Am:</b> %1</p>" }, 566{ "<p><b>On:</b> %1</p>","<p><b>Am:</b> %1</p>" },
567{ "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " }, 567{ "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " },
568{ "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" }, 568{ "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" },
569{ "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " }, 569{ "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " },
570{ "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" }, 570{ "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" },
571{ "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." }, 571{ "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." },
572{ "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" }, 572{ "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" },
573{ "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" }, 573{ "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" },
574{ "( %1 min before )","( %1 min vorher )" }, 574{ "( %1 min before )","( %1 min vorher )" },
575{ "<b>Alarm on: ","<b>Alarm am: " }, 575{ "<b>Alarm on: ","<b>Alarm am: " },
576{ "<b>Details: </b>","<b>Details: </b>" }, 576{ "<b>Details: </b>","<b>Details: </b>" },
577{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, 577{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" },
578{ "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" }, 578{ "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" },
579{ "Organizer","Organisator" }, 579{ "Organizer","Organisator" },
580{ "Save","Speichern" }, 580{ "Save","Speichern" },
581{ "Exit (+save)","Beenden(+speichern)" }, 581{ "Exit (+save)","Beenden(+speichern)" },
582{ "Home","Zuhause" }, 582{ "Home","Zuhause" },
583{ "Office","Büro" }, 583{ "Office","Büro" },
584{ "Library","Bibliothek" }, 584{ "Library","Bibliothek" },
585{ "Doctor","Arzt" }, 585{ "Doctor","Arzt" },
586{ "Beach","Strand" }, 586{ "Beach","Strand" },
587{ "Conference room","Konferenzraum" }, 587{ "Conference room","Konferenzraum" },
588{ "Drive Home","Heimfahrt" }, 588{ "Drive Home","Heimfahrt" },
589{ "Watch TV","Tv gucken" }, 589{ "Watch TV","Tv gucken" },
590{ "Phone call","Telefonanruf" }, 590{ "Phone call","Telefonanruf" },
591{ "Pay bill","Rechnung bezahlen" }, 591{ "Pay bill","Rechnung bezahlen" },
592{ "Read book","Buch lesen" }, 592{ "Read book","Buch lesen" },
593{ "Watering plants","Pflanzen giessen" }, 593{ "Watering plants","Pflanzen giessen" },
594{"Appointment","Verabredung" }, 594{"Appointment","Verabredung" },
595{"Birthday","Geburtstag" }, 595{"Birthday","Geburtstag" },
596{"Business","Geschäft" }, 596{"Business","Geschäft" },
597{"Business Travel","Geschäftsreise" }, 597{"Business Travel","Geschäftsreise" },
598{"Cinema","Kino" }, 598{"Cinema","Kino" },
599{"Customer","Kunde" }, 599{"Customer","Kunde" },
600{"Break","Pause" }, 600{"Break","Pause" },
601{"Breakfast","Frühstück" }, 601{"Breakfast","Frühstück" },
602{"Competition","Wettkampf" }, 602{"Competition","Wettkampf" },
603{"Dinner","Abendessen" }, 603{"Dinner","Abendessen" },
604{"Education","Erziehung" }, 604{"Education","Erziehung" },
605{"Family","Familie" }, 605{"Family","Familie" },
606{"Favorites","Favoriten" }, 606{"Favorites","Favoriten" },
607{"Festival","Festival" }, 607{"Festival","Festival" },
608{"Fishing","Angeln" }, 608{"Fishing","Angeln" },
609{"Flight","Flug" }, 609{"Flight","Flug" },
610{"Gifts","Geschenk" }, 610{"Gifts","Geschenk" },
611{"Holiday","Feiertag" }, 611{"Holiday","Feiertag" },
612{"Holiday Cards","Ansichtskarten" }, 612{"Holiday Cards","Ansichtskarten" },
613{"Hot Contacts","Heisse Kontakte" }, 613{"Hot Contacts","Heisse Kontakte" },
614{"Hiking","Wandern" }, 614{"Hiking","Wandern" },
615{"Hunting","Jagen" }, 615{"Hunting","Jagen" },
616{"Key Customer","Wichtiger Kunde" }, 616{"Key Customer","Wichtiger Kunde" },
617{"Kids","Kinder" }, 617{"Kids","Kinder" },
618{"Lunch","Mittagessen" }, 618{"Lunch","Mittagessen" },
619{"Meeting","Treffen" }, 619{"Meeting","Treffen" },
620{"Miscellaneous","Verschiedenes" }, 620{"Miscellaneous","Verschiedenes" },
621{"Partner","Partner" }, 621{"Partner","Partner" },
622{"Party","Partie" }, 622{"Party","Partie" },
623{"Personal","Privat" }, 623{"Personal","Privat" },
624{"Personal Travel","Privatreise"}, 624{"Personal Travel","Privatreise"},
625{"PHB","PHB" }, 625{"PHB","PHB" },
626{"Phone Calls","Telefonanruf" }, 626{"Phone Calls","Telefonanruf" },
627{"Projects","Projekt" }, 627{"Projects","Projekt" },
628{"Recurring","Wiederholend" }, 628{"Recurring","Wiederholend" },
629{"School","Schule" }, 629{"School","Schule" },
630{"Shopping","Einkaufen" }, 630{"Shopping","Einkaufen" },
631{"Speach","Rede" }, 631{"Speach","Rede" },
632{"Special Occasion","Spez.Gelegenheit" }, 632{"Special Occasion","Spez.Gelegenheit" },
633{"Sports","Sport" }, 633{"Sports","Sport" },
634{"Talk","Vortrag" }, 634{"Talk","Vortrag" },
635{"Travel","Reise" }, 635{"Travel","Reise" },
636{"TV","TV" }, 636{"TV","TV" },
637{"Germany","Deutschland" }, 637{"Germany","Deutschland" },
638{"Sweden","Schweden" }, 638{"Sweden","Schweden" },
639{"Forest","Wald" }, 639{"Forest","Wald" },
640{ "Desert","Wüste" }, 640{ "Desert","Wüste" },
641{ "Kitchen","Küche" }, 641{ "Kitchen","Küche" },
642{ "Lake","See" }, 642{ "Lake","See" },
643{"University","Universität"}, 643{"University","Universität"},
644{"Vacation","Urlaub" }, 644{"Vacation","Urlaub" },
645{"VIP","VIP" }, 645{"VIP","VIP" },
646{ "Import Sharp Calendar","Importiere Sharp Kalender" }, 646{ "Import Sharp Calendar","Importiere Sharp Kalender" },
647{ "This todo has been cancelled!","Dieses Todo wurde gecancelt!" }, 647{ "This todo has been cancelled!","Dieses Todo wurde gecancelt!" },
648{ "This event has been cancelled!","Dieser Termin wurde gecancelt!" }, 648{ "This event has been cancelled!","Dieser Termin wurde gecancelt!" },
649{ "Cancelled","Gecancelt" }, 649{ "Cancelled","Gecancelt" },
650{ "Multiple sync","Mehrfach Sync" }, 650{ "Multiple sync","Mehrfach Sync" },
651{ "Local file","Lokale Datei" }, 651{ "Local file","Lokale Datei" },
652{ "Last file","Letzte Datei" }, 652{ "Last file","Letzte Datei" },
653{ "Keys + Colors...","Tasten + Farben..." }, 653{ "Keys + Colors...","Tasten + Farben..." },
654{ "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" }, 654{ "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" },
655{ "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" }, 655{ "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" },
656{ "Choose...","Wähle..." }, 656{ "Choose...","Wähle..." },
657{ "Use colors for application:","Setze Farben für Programm:" }, 657{ "Use colors for application:","Setze Farben für Programm:" },
658{ "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" }, 658{ "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" },
659{ "Frames, labels, etc.:","Rahmen, Label, etc.:" }, 659{ "Frames, labels, etc.:","Rahmen, Label, etc.:" },
660{ "Show parent To-Do's","Zeige Ober-Todos" }, 660{ "Show parent To-Do's","Zeige Ober-Todos" },
661{ "Show location","Zeige Orte" }, 661{ "Show location","Zeige Orte" },
662{ "Show events that recur ","Zeige Termine, die sich wiederholen:" }, 662{ "Show events that recur ","Zeige Termine, die sich wiederholen:" },
663{ "Show in every cell ","Zeige in jeder Zelle " }, 663{ "Show in every cell ","Zeige in jeder Zelle " },
664{ "short month","kurzen Monat" }, 664{ "short month","kurzen Monat" },
665{ "icons","Icons" }, 665{ "icons","Icons" },
666{ "Show Sat/Sun together","Zeige Sam/Son zusammen" }, 666{ "Show Sat/Sun together","Zeige Sam/Son zusammen" },
667{ "Category colors are applied to text","Kategorie Farben färben Text" }, 667{ "Category colors are applied to text","Kategorie Farben färben Text" },
668{ "Month view uses day colors","Monatsansicht zeigt Tagesfarben" }, 668{ "Month view uses day colors","Monatsansicht zeigt Tagesfarben" },
669{ "Day color odd months","Tagesfarbe ungerade Monate" }, 669{ "Day color odd months","Tagesfarbe ungerade Monate" },
670{ "Day color even months","Tagesfarbe gerade Monate" }, 670{ "Day color even months","Tagesfarbe gerade Monate" },
671{ "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" }, 671{ "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" },
672{ "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" }, 672{ "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" },
673{ "Small To-do view uses smaller font","Kleine Todo Ansicht nutzt kleineren Font" }, 673{ "Small To-do view uses smaller font","Kleine Todo Ansicht nutzt kleineren Font" },
674{ "Colors are applied to text","Farben werden auf Text angewendet" }, 674{ "Colors are applied to text","Farben werden auf Text angewendet" },
675{ "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" }, 675{ "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" },
676{ "Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n","Achtung: KO/Pi muß ausgeführt werden damit die Benachrichtigung funktioniert. Empfehlung für Zaurus: Diese Option nicht wählen und KO/Pi Alarm Applet installieren.\n" }, 676{ "Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n","Achtung: KO/Pi muß ausgeführt werden damit die Benachrichtigung funktioniert. Empfehlung für Zaurus: Diese Option nicht wählen und KO/Pi Alarm Applet installieren.\n" },
677{ "Play beeps count:","Anzahl der Alarmpiepse: " }, 677{ "Play beeps count:","Anzahl der Alarmpiepse: " },
678{ "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " }, 678{ "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " },
679{ "Default suspend time in min:","Standard Supendierungs Zeit: " }, 679{ "Default suspend time in min:","Standard Supendierungs Zeit: " },
680{ "Auto suspend count:","Anzahl der auto Suspendierungen" }, 680{ "Auto suspend count:","Anzahl der auto Suspendierungen" },
681{ "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" }, 681{ "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" },
682{ "New profile","Neues Profil" }, 682{ "New profile","Neues Profil" },
683{ "Clone profile","Klone Profil" }, 683{ "Clone profile","Klone Profil" },
684{ "Delete profile","Lösche Profil" }, 684{ "Delete profile","Lösche Profil" },
685{ "Profile:","Profil:" }, 685{ "Profile:","Profil:" },
686{ "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, 686{ "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" },
687{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, 687{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" },
688{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, 688{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" },
689{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, 689{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" },
690{ "Write back file","Schreibe Datei zurück" }, 690{ "Write back file","Schreibe Datei zurück" },
691{ "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, 691{ "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" },
692{ "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, 692{ "Pre sync (download) command:","Bevor Sync (download) Kommando:" },
693{ "Local device name:","Name dieses Gerätes:" }, 693{ "Local device name:","Name dieses Gerätes:" },
694{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, 694{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" },
695{ "Sync preferences","Synchronisations Einstellungen" }, 695{ "Sync preferences","Synchronisations Einstellungen" },
696{ "Profile kind","Profil Art" }, 696{ "Profile kind","Profil Art" },
697{ "Local file","Lokale Datei" }, 697{ "Local file","Lokale Datei" },
698{ "Local file:","Lokale Datei:" }, 698{ "Local file:","Lokale Datei:" },
699{ "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, 699{ "Post sync (upload) command:","Nach Sync (upload) Kommando:" },
700{ "Fill in default values for:","Setze Beispiel Werte ein für:" }, 700{ "Fill in default values for:","Setze Beispiel Werte ein für:" },
701{ "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, 701{ "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" },
702{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, 702{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile"},
703{ "Device","Gerät:" }, 703{ "Device","Gerät:" },
704{ "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, 704{ "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" },
705{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" }, 705{ "Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n","Synchronisationsübersicht:\n\n %d items lokal hinzugefügt\n %d items entfernt hinzugefügt\n %d items lokal geändert\n %d items entfernt geändert\n %d items lokal gelöscht\n %d items entfernt gelöscht\n" },
706{ "Synchronization successful","Synchronisation erfolgreich" }, 706{ "Synchronization successful","Synchronisation erfolgreich" },
707{ "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, 707{ "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." },
708{ "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, 708{ "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" },
709{ "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, 709{ "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" },
710{ "Enter password","Passwort eingeben" }, 710{ "Enter password","Passwort eingeben" },
711{ "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, 711{ "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" },
712{ "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, 712{ "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." },
713{ "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" }, 713{ "Sorry, the copy command failed!\nCommand was:\n%1\n \nTry command on console to get more\ndetailed info about the reason.\n","Sorry, das Kopierkommando schlug fehl!\nKommando war:\n%1\n \nVersuche Kommando von Kosole um\nDetails für das Fehlschlagen\nzu erfahren.\n" },
714{ "Writing back file result: ","Resultat des Dateizurückschreibens: " }, 714{ "Writing back file result: ","Resultat des Dateizurückschreibens: " },
715{ "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, 715{ "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" },
716{ "Edit Calendar Filters","Editiere Kalendar Filter" }, 716{ "Edit Calendar Filters","Editiere Kalendar Filter" },
717{ "Enter filter name:","Neuer Filter Name:" }, 717{ "Enter filter name:","Neuer Filter Name:" },
718{ "Add Filter","Filter hinzufügen" }, 718{ "Add Filter","Filter hinzufügen" },
719{ "Question","Frage" }, 719{ "Question","Frage" },
720{ "Filter position: ","Filter Position: " }, 720{ "Filter position: ","Filter Position: " },
721{ "Month View","Monatsansicht" }, 721{ "Month View","Monatsansicht" },
722{ "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" }, 722{ "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" },
723{ "KO/Pi config error","KO/Pi Konfig. Fehler" }, 723{ "KO/Pi config error","KO/Pi Konfig. Fehler" },
724{ "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, 724{ "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" },
725{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" }, 725{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" },
726{ "Access: ","Zugriff: " }, 726{ "Access: ","Zugriff: " },
727{ "Needs Action","Aktion notwendig" }, 727{ "Needs Action","Aktion notwendig" },
728{ "Accepted","Akzeptiert" }, 728{ "Accepted","Akzeptiert" },
729{ "Declined","Abgelehnt" }, 729{ "Declined","Abgelehnt" },
730{ "Tentative","Vorläufig" }, 730{ "Tentative","Vorläufig" },
731{ "Delegated","Beauftragt" }, 731{ "Delegated","Beauftragt" },
732{ "Completed","Vollständig" }, 732{ "Completed","Vollständig" },
733{ "In Process","In Bearbeitung" }, 733{ "In Process","In Bearbeitung" },
734{ "Participant","Teilnehmer" }, 734{ "Participant","Teilnehmer" },
735{ "Optional Participant","Möglicher Teilnehmer" }, 735{ "Optional Participant","Möglicher Teilnehmer" },
736{ "Observer","Beobachter" }, 736{ "Observer","Beobachter" },
737{ "Chair","Vorsitzender" }, 737{ "Chair","Vorsitzender" },
738{ "Not supported \non desktop!\n","" }, 738{ "Not supported \non desktop!\n","" },
739{ "Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. ","Es ist nichts selektiert!\nDieses druckt die volle Breite der Agenda View, so wie man sie sieht.\nUm die vertikale Auswahl zum Drucken zu bestimmen,\nbitte einen vertikalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen.\n(Es wird danach direkt der Termin Dialog angezeigt\n - dort bitte auf Abbrechen klicken) " }, 739{ "Nothing selected!\n\nThis prints the full width of the Agenda view as you see it!\n\nTo determine the vertical range of the printing, please select\na vertical range (with the left mouse button down) in one column. ","Es ist nichts selektiert!\nDieses druckt die volle Breite der Agenda View, so wie man sie sieht.\nUm die vertikale Auswahl zum Drucken zu bestimmen,\nbitte einen vertikalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen.\n(Es wird danach direkt der Termin Dialog angezeigt\n - dort bitte auf Abbrechen klicken) " },
740{ "Date range: ","Datums Zeitspanne: " }, 740{ "Date range: ","Datums Zeitspanne: " },
741{ "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " }, 741{ "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " },
742{ "Syncing - close to abort!","Syncing-schließe um abzubrechen." }, 742{ "Syncing - close to abort!","Syncing-schließe um abzubrechen." },
743{ "Add / remove events","Add./entferne Termine" }, 743{ "Add / remove events","Add./entferne Termine" },
744{ "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." }, 744{ "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." },
745{ "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." }, 745{ "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." },
746{ "Overwrite","Überschreiben" }, 746{ "Overwrite","Überschreiben" },
747{ "Sync+save","Syncen+speichern" }, 747{ "Sync+save","Syncen+speichern" },
748{ "Default","Standard" }, 748{ "Default","Standard" },
749{ " Categories added to list! "," Kategorien zur Liste hinzugefügt! " }, 749{ " Categories added to list! "," Kategorien zur Liste hinzugefügt! " },
750{ " %d items?"," %d Einträge?" }, 750{ " %d items?"," %d Einträge?" },
751{ "\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?","\nDieses ist ein\nwiederholender Termin!.\nSind Sie sicher, dass Sie\ndiesen Termin und alle\nWiederholungen löschen möchten?" }, 751{ "\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?","\nDieses ist ein\nwiederholender Termin!.\nSind Sie sicher, dass Sie\ndiesen Termin und alle\nWiederholungen löschen möchten?" },
752{ " ?\n\nDelete:\n"," ?\n\nLösche:\n" }, 752{ " ?\n\nDelete:\n"," ?\n\nLösche:\n" },
753{ "Current","Aktuelle" }, 753{ "Current","Aktuelle" },
754{ "\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n","\nDieses ist ein\nwiederholender Termin!\nMöchten sie alle Wiederholungen\nlöschen, oder nur die aktuelle am:\n" }, 754{ "\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n","\nDieses ist ein\nwiederholender Termin!\nMöchten sie alle Wiederholungen\nlöschen, oder nur die aktuelle am:\n" },
755{ "All","Alle" }, 755{ "All","Alle" },
756{ "Data Loss Warning","Datenverlust Warnung" }, 756{ "Data Loss Warning","Datenverlust Warnung" },
757{ "Proceed","Weitermachen" }, 757{ "Proceed","Weitermachen" },
758{ "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" }, 758{ "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" },
759{ "Filter disabled ","Filter abgeschaltet" }, 759{ "Filter disabled ","Filter abgeschaltet" },
760{ "Filter selected: ","Gewählter Filter: " }, 760{ "Filter selected: ","Gewählter Filter: " },
761{ "Toggle Cancel","Gecancelt ändern" }, 761{ "Toggle Cancel","Gecancelt ändern" },
762{ "&Toggle Cancel","Gecancel&t ändern" }, 762{ "&Toggle Cancel","Gecancel&t ändern" },
763{ "Configure Toolbar","Konfiguriere Toolbar" }, 763{ "Configure Toolbar","Konfiguriere Toolbar" },
764{ "Stretched TB","Gedehnte TB" }, 764{ "Stretched TB","Gedehnte TB" },
765{ "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" }, 765{ "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" },
766{ "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" }, 766{ "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" },
767{ "When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing","Wenn ein Kalender doppelt importiert\nwird, werden doppelte Einträge ignoriert!\nSie können eine Backup Datei anlegen unter\nDatei - Speichere Kalender Backup\num den Import rückgängig machen zu können.\n" }, 767{ "When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing","Wenn ein Kalender doppelt importiert\nwird, werden doppelte Einträge ignoriert!\nSie können eine Backup Datei anlegen unter\nDatei - Speichere Kalender Backup\num den Import rückgängig machen zu können.\n" },
768{ "Not supported \non desktop!\n","Nur verfügbar auf PDA!" }, 768{ "Not supported \non desktop!\n","Nur verfügbar auf PDA!" },
769{ "Imported file successfully","Datei erfolgreich importiert" }, 769{ "Imported file successfully","Datei erfolgreich importiert" },
770{ "Error importing file","Fehler beim Importieren der Datei" }, 770{ "Error importing file","Fehler beim Importieren der Datei" },
771{ "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, 771{ "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" },
772{ "Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n","Zu speichernde Datei\existiert bereits!\nExist. Datei vom:\n%1\nÜberschreiben?\n" }, 772{ "Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n","Zu speichernde Datei\existiert bereits!\nExist. Datei vom:\n%1\nÜberschreiben?\n" },
773{ "Overwrite!","Überschreiben!" }, 773{ "Overwrite!","Überschreiben!" },
774{ "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n","Import Datei \n...%1\nvom:\n%2\nDuplizierte Einträge\nwerden nicht importiert!\n" }, 774{ "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n","Import Datei \n...%1\nvom:\n%2\nDuplizierte Einträge\nwerden nicht importiert!\n" },
775{ "Load backup filename","Lade Backup Dateiname" }, 775{ "Load backup filename","Lade Backup Dateiname" },
776{ "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" }, 776{ "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" },
777{ "KO/Pi:Loaded %1","KO/Pi:Geladen %1" }, 777{ "KO/Pi:Loaded %1","KO/Pi:Geladen %1" },
778{ "Save backup filename","Speichere Backup Dateiname" }, 778{ "Save backup filename","Speichere Backup Dateiname" },
779{ "Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n","Backup Datei\nexistiert bereits!\nAlte Backup Datei vom:\n%1\nÜberschreiben?\n" }, 779{ "Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n","Backup Datei\nexistiert bereits!\nAlte Backup Datei vom:\n%1\nÜberschreiben?\n" },
780{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, 780{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" },
781{ "Details of attendee","Teilnehmerdetails" }, 781{ "Details of attendee","Teilnehmerdetails" },
782{ "Work phone:\n","Telefon Arbeit:\n" }, 782{ "Work phone:\n","Telefon Arbeit:\n" },
783{ "Work mobile phone:\n","Mobiltelefon Arbeit:\n" }, 783{ "Work mobile phone:\n","Mobiltelefon Arbeit:\n" },
784{ "Home phone:\n","Telefon privat:\n" }, 784{ "Home phone:\n","Telefon privat:\n" },
785{ "Mobile home phone:\n","Mobiltelefon privat:\n" }, 785{ "Mobile home phone:\n","Mobiltelefon privat:\n" },
786{ "Email:\n","Email:\n" }, 786{ "Email:\n","Email:\n" },
787{ "Alarm disabled for this item","Alarm deaktiviert für dieses Item" }, 787{ "Alarm disabled for this item","Alarm deaktiviert für dieses Item" },
788{ "Audio Al.: ","Audio Al.: " }, 788{ "Audio Al.: ","Audio Al.: " },
789{ "Proc.Al.: ","Proz.Al.: " }, 789{ "Proc.Al.: ","Proz.Al.: " },
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{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, 1401{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" },
1402{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, 1402{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" },
1403{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, 1403{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" },
1404{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, 1404{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." },
1405{ "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{ "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>" },
1406{ "Global application font for all apps:","Globale Schriftart:" }, 1406{ "Global application font for all apps:","Globale Schriftart:" },
1407{ "Application Font","Applikationsschriftart" }, 1407{ "Application Font","Applikationsschriftart" },
1408{ "Kx/Pi","Kx/Pi" }, 1408{ "Kx/Pi","Kx/Pi" },
1409{ "Backup","Backup" }, 1409{ "Backup","Backup" },
1410{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, 1410{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" },
1411{ "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 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!" },
1412{ "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{ "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!" },
1413{ "Choose Color","Wähle Farbe" }, 1413{ "Choose Color","Wähle Farbe" },
1414{ " OK "," OK " }, 1414{ " OK "," OK " },
1415{ " Cancel "," Abbrechen " }, 1415{ " Cancel "," Abbrechen " },
1416{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, 1416{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" },
1417{ "Matching items will be removed from list","Passende werden von der Liste entfernt" }, 1417{ "Matching items will be removed from list","Passende werden von der Liste entfernt" },
1418{ "Search on displayed list only","Suche auf der dargestellten Liste" }, 1418{ "Search on displayed list only","Suche auf der dargestellten Liste" },
1419{ "List will be cleared before search","Liste wird vor der Suche gelöscht" }, 1419{ "List will be cleared before search","Liste wird vor der Suche gelöscht" },
1420{ "<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{ "<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>" },
1421{ "%1\nis running!","%1\nist am Laufen!" }, 1421{ "%1\nis running!","%1\nist am Laufen!" },
1422{ "Additional Comment:","Zusätzlicher Kommentar:" }, 1422{ "Additional Comment:","Zusätzlicher Kommentar:" },
1423{ "Stop and save","Stopp und Speichern" }, 1423{ "Stop and save","Stopp und Speichern" },
1424{ "Continue running","Weiter laufen lassen" }, 1424{ "Continue running","Weiter laufen lassen" },
1425{ "Stop - do not save","Stopp - nicht Speichern" }, 1425{ "Stop - do not save","Stopp - nicht Speichern" },
1426{ "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{ "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?" },
1427{ "Time mismatch!","Zeiten stimmen nicht!" }, 1427{ "Time mismatch!","Zeiten stimmen nicht!" },
1428{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, 1428{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" },
1429{ "Yes, stop todo","Ja, stoppe Todo" }, 1429{ "Yes, stop todo","Ja, stoppe Todo" },
1430{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, 1430{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" },
1431{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, 1431{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" },
1432{ "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{ "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." },
1433{ "Spouse","Ehegatte" }, 1433{ "Spouse","Ehegatte" },
1434{ "Notes","Notizen" }, 1434{ "Notes","Notizen" },
1435{ "Messanger","Messanger" }, 1435{ "Messanger","Messanger" },
1436{ "Assistant","Assistent" }, 1436{ "Assistant","Assistent" },
1437{ "Manager","Manager" }, 1437{ "Manager","Manager" },
1438{ "Secrecy","Sichtbar" }, 1438{ "Secrecy","Sichtbar" },
1439{ "male","männlich" }, 1439{ "male","männlich" },
1440{ "female","weiblich" }, 1440{ "female","weiblich" },
1441{ "Hide!","Verbergen!" }, 1441{ "Hide!","Verbergen!" },
1442{ "Show!","Anzeigen!" }, 1442{ "Show!","Anzeigen!" },
1443{ "Details","Details" }, 1443{ "Details","Details" },
1444{ "Profession","Beruf" }, 1444{ "Profession","Beruf" },
1445{ "Children","Kinder" }, 1445{ "Children","Kinder" },
1446{ "Department","Abteilung" }, 1446{ "Department","Abteilung" },
1447{ "Backup cancelled","Backup abgebrochen" }, 1447{ "Backup cancelled","Backup abgebrochen" },
1448{ "Backup globally disabled","Backup global abgeschaltet" }, 1448{ "Backup globally disabled","Backup global abgeschaltet" },
1449{ "Backup succesfully finished","Backup erfolgreich beendet" }, 1449{ "Backup succesfully finished","Backup erfolgreich beendet" },
1450{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, 1450{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" },
1451{ "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{ "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" },
1452{ "Birthdays","Geburtstage" }, 1452{ "Birthdays","Geburtstage" },
1453{ "KO/Pi import information!","KO/Pi Import Information!" }, 1453{ "KO/Pi import information!","KO/Pi Import Information!" },
1454{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, 1454{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" },
1455{ "Cancel - do not start"," Abbrechen - Todo nicht starten" }, 1455{ "Cancel - do not start"," Abbrechen - Todo nicht starten" },
1456{ "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{ "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?"" },
1457{ "Reload","Neu laden" }, 1457{ "Reload","Neu laden" },
1458{ "Timezone settings","Zeitzoneneinstellung" }, 1458{ "Timezone settings","Zeitzoneneinstellung" },
1459{ "Title: ","Titel: " }, 1459{ "Title: ","Titel: " },
1460{ "Journal from: ","Journal vom: " }, 1460{ "Journal from: ","Journal vom: " },
1461{ "Journal: %1 from ","Journal: %1 vom " }, 1461{ "Journal: %1 from ","Journal: %1 vom " },
1462{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, 1462{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" },
1463{ "Selected Item","Ausgewähltes Item" }, 1463{ "Selected Item","Ausgewähltes Item" },
1464{ "Select Date...","Wähle Datum..." }, 1464{ "Select Date...","Wähle Datum..." },
1465{ "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{ "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:" },
1466{ "Change category list now!","Ändere Kategorieliste jetzt!" }, 1466{ "Change category list now!","Ändere Kategorieliste jetzt!" },
1467{ "Edit category list...","Ändere Kategorieliste..." }, 1467{ "Edit category list...","Ändere Kategorieliste..." },
1468{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, 1468{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" },
1469{ "Filepath: ","Dateipfad: " }, 1469{ "Filepath: ","Dateipfad: " },
1470{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, 1470{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" },
1471{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, 1471{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" },
1472{ "Pending Suspend Alarm","Laufender Suspend Alarm" }, 1472{ "Pending Suspend Alarm","Laufender Suspend Alarm" },
1473{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, 1473{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" },
1474{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, 1474{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" },
1475{ "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, 1475{ "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" },
1476{ "Alarm Options","Alarm Einstellungen" }, 1476{ "Alarm Options","Alarm Einstellungen" },
1477{ "Delete selected...","Lösche Ausgewählte..." }, 1477{ "Delete selected...","Lösche Ausgewählte..." },
1478{ "None","Nichts" }, 1478{ "None","Nichts" },
1479{ "Selection","Auswahl" }, 1479{ "Selection","Auswahl" },
1480{ "Set categories","Setze Kategorien" }, 1480{ "Set categories","Setze Kategorien" },
1481{ "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{ "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!" },
1482{ "Reset","Neu setzen" }, 1482{ "Reset","Neu setzen" },
1483{ "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{ "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)?" },
1484{ "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{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" },
1485{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, 1485{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" },
1486{ "\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{ "\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" },
1487{ "\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{ "\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" },
1488{ "Edit","Edit" }, 1488{ "Edit","Edit" },
1489{ "Last Modified","Zuletzt geändert" }, 1489{ "Last Modified","Zuletzt geändert" },
1490{ "Journal viewer","Journal Anzeige" }, 1490{ "Journal viewer","Journal Anzeige" },
1491{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, 1491{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." },
1492{ "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{ "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>." },
1493{ "Hide Completed","Verstecke erledigte Todos" }, 1493{ "Hide Completed","Verstecke erledigte Todos" },
1494{ "Show not Running","Zeige nicht Laufende" }, 1494{ "Show not Running","Zeige nicht Laufende" },
1495{ "Click to add new Todo","Klick für neues Todo!" }, 1495{ "Click to add new Todo","Klick für neues Todo!" },
1496{ "Show next conflict for","Zeige nächsten Konflikt für" }, 1496{ "Show next conflict for","Zeige nächsten Konflikt für" },
1497{ "All events","Alle Termine" }, 1497{ "All events","Alle Termine" },
1498{ "Allday events","Ganztagestermine" }, 1498{ "Allday events","Ganztagestermine" },
1499{ "Events with time","Termine mit Zeit" }, 1499{ "Events with time","Termine mit Zeit" },
1500{ "No conflict found","Kein Konflikt gefunden" }, 1500{ "No conflict found","Kein Konflikt gefunden" },
1501{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, 1501{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" },
1502{ "<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{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " },
1503{ "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" }, 1503{ "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" },
1504{ "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{ "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" },
1505{ "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" }, 1505{ "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" },
1506{ "Show date","Zeige Datum" }, 1506{ "Show date","Zeige Datum" },
1507{ "No problem!","Null Problemo!" }, 1507{ "No problem!","Null Problemo!" },
1508{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" }, 1508{ "Automatically sync with KDE-Desktop\nwhen receiving sync request","Synce automatisch mit KDE-Desktop\nwenn eine Sync-Anforderung kommt" },
1509{ "Pi-Sync Port Error","Pi-Sync Port Fehler" }, 1509{ "Pi-Sync Port Error","Pi-Sync Port Fehler" },
1510{ "<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{ "<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?" },
1511{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" }, 1511{ "No valid port number:\n%1","Keine gültige Port Nummer:\n%1" },
1512{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" }, 1512{ "Port number (Default: %1)\nValid range from 1 to 65535","Port Nummer (Standard: %1)\nGültiger Bereich von 1 bis 65535" },
1513{ "Pi-Sync Error","Pi-Sync Fehler" }, 1513{ "Pi-Sync Error","Pi-Sync Fehler" },
1514{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" }, 1514{ "Got send file request\nwith invalid password","Erhielt "sende Datei" Anfrage\nmit ungültigem Passwort" },
1515{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" }, 1515{ "Got receive file request\nwith invalid password","Erhielt "empfange Datei" Anfrage\nmit ungültigem Passwort" },
1516{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." }, 1516{ "Wrong password: Receiving remote file failed.","Falsches Passwort: Empfangen von entfernter Datei fehlgeschlagen." },
1517{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" }, 1517{ "Please close error dialog on remote.","Bitte schließe Fehler-Dialog am entfernten Rechner" },
1518{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" }, 1518{ "Unknown error on remote.","Unbekannter Fehler am entfernten Rechner" },
1519{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" }, 1519{ "Pi-Sync: Connected!","Pi-Sync: Verbunden!" },
1520{ "Receiving file from remote...","Empfange entfernte Datei..." }, 1520{ "Receiving file from remote...","Empfange entfernte Datei..." },
1521{ "Sending back synced file...","Sende synchronisierte Datei zurück..." }, 1521{ "Sending back synced file...","Sende synchronisierte Datei zurück..." },
1522{ "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 all sync info\nof all profiles?","Möchten Sie wirklich\ndie Sync-Info\nfür alle Profile\nlöschen?" },
1523{ "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{ "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" },
1524{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." }, 1524{ "Sorry, no valid port.Syncing cancelled.","Sorry, kein gültiger Port. Syncing abgebrochen." },
1525{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" }, 1525{ "Remote port number:\n(May be: 1 - 65535)","Ferne Port Nummer:\n(Darf sein: 1 - 65535)" },
1526{ "Writing back file ...","Schreibe Datei zurück..." }, 1526{ "Writing back file ...","Schreibe Datei zurück..." },
1527{ "Sending back file ...","Sende Datei zurück..." }, 1527{ "Sending back file ...","Sende Datei zurück..." },
1528{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" }, 1528{ "Eeek, there I am ticklish!","Hihi, da bin ich kitzlig!" },
1529{ "Created","Angelegt" },
1530{ "Last Modified Sub","Zuletzt geändertes Sub" },
1531{ "","" },
1532{ "","" },
1533{ "","" },
1534{ "","" },
1535{ "","" },
1536{ "","" },
1529{ "","" }, 1537{ "","" },
1530{ "","" }, 1538{ "","" },
1531{ "","" }, 1539{ "","" },
1532{ "","" }, 1540{ "","" },
1533{ "","" }, 1541{ "","" },
1534{ "","" }, 1542{ "","" },
1535{ "","" }, 1543{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 7044e90..f9685e9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1,4820 +1,4820 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Requires the Qt and KDE widget libraries, available at no cost at 4 Requires the Qt and KDE widget libraries, available at no cost at
5 http://www.troll.no and http://www.kde.org respectively 5 http://www.troll.no and http://www.kde.org respectively
6 6
7 Copyright (c) 1997, 1998, 1999 7 Copyright (c) 1997, 1998, 1999
8 Preston Brown (preton.brown@yale.edu) 8 Preston Brown (preton.brown@yale.edu)
9 Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl) 9 Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl)
10 Ian Dawes (iadawes@globalserve.net) 10 Ian Dawes (iadawes@globalserve.net)
11 Laszlo Boloni (boloni@cs.purdue.edu) 11 Laszlo Boloni (boloni@cs.purdue.edu)
12 12
13 Copyright (c) 2000, 2001, 2002 13 Copyright (c) 2000, 2001, 2002
14 Cornelius Schumacher <schumacher@kde.org> 14 Cornelius Schumacher <schumacher@kde.org>
15 15
16 This program is free software; you can redistribute it and/or modify 16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by 17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 2 of the License, or 18 the Free Software Foundation; either version 2 of the License, or
19 (at your option) any later version. 19 (at your option) any later version.
20 20
21 This program is distributed in the hope that it will be useful, 21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of 22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
24 GNU General Public License for more details. 24 GNU General Public License for more details.
25 25
26 You should have received a copy of the GNU General Public License 26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software 27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include <stdlib.h> 31#include <stdlib.h>
32 32
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qradiobutton.h> 34#include <qradiobutton.h>
35#include <qbuttongroup.h> 35#include <qbuttongroup.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qclipboard.h> 37#include <qclipboard.h>
38#include <qcursor.h> 38#include <qcursor.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qprogressbar.h> 40#include <qprogressbar.h>
41#include <qmultilineedit.h> 41#include <qmultilineedit.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qwidgetstack.h> 43#include <qwidgetstack.h>
44#include <qptrlist.h> 44#include <qptrlist.h>
45#include <qregexp.h> 45#include <qregexp.h>
46#include <qgroupbox.h> 46#include <qgroupbox.h>
47#include <qfile.h> 47#include <qfile.h>
48#include <qdir.h> 48#include <qdir.h>
49#ifndef KORG_NOSPLITTER 49#ifndef KORG_NOSPLITTER
50#include <qsplitter.h> 50#include <qsplitter.h>
51#endif 51#endif
52 52
53#include <kglobal.h> 53#include <kglobal.h>
54#include <kdebug.h> 54#include <kdebug.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kfiledialog.h> 56#include <kfiledialog.h>
57#include <kmessagebox.h> 57#include <kmessagebox.h>
58#include <knotifyclient.h> 58#include <knotifyclient.h>
59#include <kconfig.h> 59#include <kconfig.h>
60 60
61#include <libkdepim/ksyncprefsdialog.h> 61#include <libkdepim/ksyncprefsdialog.h>
62#include <krun.h> 62#include <krun.h>
63#include <kdirwatch.h> 63#include <kdirwatch.h>
64#include <libkdepim/kdatepicker.h> 64#include <libkdepim/kdatepicker.h>
65#include <libkdepim/ksyncprofile.h> 65#include <libkdepim/ksyncprofile.h>
66#include <libkdepim/kpimglobalprefs.h> 66#include <libkdepim/kpimglobalprefs.h>
67 67
68#include <libkcal/vcaldrag.h> 68#include <libkcal/vcaldrag.h>
69#include <libkcal/icaldrag.h> 69#include <libkcal/icaldrag.h>
70#include <libkcal/icalformat.h> 70#include <libkcal/icalformat.h>
71#include <libkcal/vcalformat.h> 71#include <libkcal/vcalformat.h>
72#include <libkcal/scheduler.h> 72#include <libkcal/scheduler.h>
73#include <libkcal/calendarlocal.h> 73#include <libkcal/calendarlocal.h>
74#include <libkcal/journal.h> 74#include <libkcal/journal.h>
75#include <libkcal/calfilter.h> 75#include <libkcal/calfilter.h>
76#include <libkcal/attendee.h> 76#include <libkcal/attendee.h>
77#include <libkcal/dndfactory.h> 77#include <libkcal/dndfactory.h>
78#include <libkcal/freebusy.h> 78#include <libkcal/freebusy.h>
79#include <libkcal/filestorage.h> 79#include <libkcal/filestorage.h>
80#include <libkcal/calendarresources.h> 80#include <libkcal/calendarresources.h>
81#include <libkcal/qtopiaformat.h> 81#include <libkcal/qtopiaformat.h>
82#include "../kalarmd/alarmdialog.h" 82#include "../kalarmd/alarmdialog.h"
83 83
84#ifndef DESKTOP_VERSION 84#ifndef DESKTOP_VERSION
85#include <libkcal/sharpformat.h> 85#include <libkcal/sharpformat.h>
86#include <externalapphandler.h> 86#include <externalapphandler.h>
87#endif 87#endif
88#include <libkcal/phoneformat.h> 88#include <libkcal/phoneformat.h>
89#ifndef KORG_NOMAIL 89#ifndef KORG_NOMAIL
90#include "komailclient.h" 90#include "komailclient.h"
91#endif 91#endif
92#ifndef KORG_NOPRINTER 92#ifndef KORG_NOPRINTER
93#include "calprinter.h" 93#include "calprinter.h"
94#endif 94#endif
95#ifndef KORG_NOPLUGINS 95#ifndef KORG_NOPLUGINS
96#include "kocore.h" 96#include "kocore.h"
97#endif 97#endif
98#include "koeventeditor.h" 98#include "koeventeditor.h"
99#include "kotodoeditor.h" 99#include "kotodoeditor.h"
100#include "koprefs.h" 100#include "koprefs.h"
101#include "koeventviewerdialog.h" 101#include "koeventviewerdialog.h"
102#include "publishdialog.h" 102#include "publishdialog.h"
103#include "kofilterview.h" 103#include "kofilterview.h"
104#include "koglobals.h" 104#include "koglobals.h"
105#include "koviewmanager.h" 105#include "koviewmanager.h"
106#include "koagendaview.h" 106#include "koagendaview.h"
107#include "koagenda.h" 107#include "koagenda.h"
108#include "kodialogmanager.h" 108#include "kodialogmanager.h"
109#include "outgoingdialog.h" 109#include "outgoingdialog.h"
110#include "incomingdialog.h" 110#include "incomingdialog.h"
111#include "datenavigatorcontainer.h" 111#include "datenavigatorcontainer.h"
112#include "statusdialog.h" 112#include "statusdialog.h"
113#include "kdatenavigator.h" 113#include "kdatenavigator.h"
114#include "kotodoview.h" 114#include "kotodoview.h"
115#include "datenavigator.h" 115#include "datenavigator.h"
116#include "resourceview.h" 116#include "resourceview.h"
117#include "navigatorbar.h" 117#include "navigatorbar.h"
118#include "searchdialog.h" 118#include "searchdialog.h"
119#include "mainwindow.h" 119#include "mainwindow.h"
120#include "categoryeditdialog.h" 120#include "categoryeditdialog.h"
121 121
122#include "calendarview.h" 122#include "calendarview.h"
123#ifndef DESKTOP_VERSION 123#ifndef DESKTOP_VERSION
124#include <qtopia/alarmserver.h> 124#include <qtopia/alarmserver.h>
125#endif 125#endif
126#ifndef _WIN32_ 126#ifndef _WIN32_
127#include <stdlib.h> 127#include <stdlib.h>
128#include <stdio.h> 128#include <stdio.h>
129#include <unistd.h> 129#include <unistd.h>
130#else 130#else
131#include <qprocess.h> 131#include <qprocess.h>
132#endif 132#endif
133 133
134#ifdef DESKTOP_VERSION 134#ifdef DESKTOP_VERSION
135#include <kabc/stdaddressbook.h> 135#include <kabc/stdaddressbook.h>
136#endif 136#endif
137using namespace KOrg; 137using namespace KOrg;
138using namespace KCal; 138using namespace KCal;
139extern int globalFlagBlockAgenda; 139extern int globalFlagBlockAgenda;
140extern int globalFlagBlockStartup; 140extern int globalFlagBlockStartup;
141 141
142 142
143MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) 143MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent)
144 144
145{ 145{
146 mAlarms = alarms; 146 mAlarms = alarms;
147 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) ); 147 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) );
148 QString mText = "<table width=\"100%\">\n"; 148 QString mText = "<table width=\"100%\">\n";
149 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 149 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
150#ifdef DESKTOP_VERSION 150#ifdef DESKTOP_VERSION
151 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 151 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
152#else 152#else
153 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>"; 153 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>";
154#endif 154#endif
155 // mText += "<img src=\""; 155 // mText += "<img src=\"";
156 // mText += ipath; 156 // mText += ipath;
157 // mText += "\">"; 157 // mText += "\">";
158 //mEventDate = QDate::currentDate(); 158 //mEventDate = QDate::currentDate();
159#ifdef DESKTOP_VERSION 159#ifdef DESKTOP_VERSION
160 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>"; 160 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>";
161#else 161#else
162 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>"; 162 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>";
163#endif 163#endif
164 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 164 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
165 165
166 Incidence * inc = getNextInc( start ); 166 Incidence * inc = getNextInc( start );
167 int time = 0; 167 int time = 0;
168 //mText += "<table>"; 168 //mText += "<table>";
169 while ( inc ) { 169 while ( inc ) {
170 QDateTime dt ; 170 QDateTime dt ;
171 QString tempText = "<a "; 171 QString tempText = "<a ";
172 bool ok; 172 bool ok;
173 dt = inc->getNextOccurence( start, &ok ); 173 dt = inc->getNextOccurence( start, &ok );
174 if ( !ok ) continue; 174 if ( !ok ) continue;
175 if ( inc->typeID() == eventID ) { 175 if ( inc->typeID() == eventID ) {
176 tempText += "href=\"event:"; 176 tempText += "href=\"event:";
177 } else if ( inc->typeID() == todoID ) { 177 } else if ( inc->typeID() == todoID ) {
178 tempText += "href=\"todo:"; 178 tempText += "href=\"todo:";
179 } 179 }
180 tempText += inc->uid() + "\">"; 180 tempText += inc->uid() + "\">";
181 if ( inc->typeID() == todoID ) 181 if ( inc->typeID() == todoID )
182 tempText += i18n("Todo: "); 182 tempText += i18n("Todo: ");
183 if ( inc->summary().length() > 0 ) 183 if ( inc->summary().length() > 0 )
184 tempText += inc->summary(); 184 tempText += inc->summary();
185 else 185 else
186 tempText += i18n("-no summary-"); 186 tempText += i18n("-no summary-");
187 QString timestr; 187 QString timestr;
188 if (!inc->doesFloat()) 188 if (!inc->doesFloat())
189 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": "; 189 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": ";
190 else 190 else
191 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 191 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
192 if ( dt.date() < QDate::currentDate() && time == 0 ) { 192 if ( dt.date() < QDate::currentDate() && time == 0 ) {
193 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 193 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
194 mText += "<table>"; 194 mText += "<table>";
195 time = 1; 195 time = 1;
196 } 196 }
197 if ( dt.date() == QDate::currentDate() && time <= 1 ) { 197 if ( dt.date() == QDate::currentDate() && time <= 1 ) {
198 if ( time > 0 ) 198 if ( time > 0 )
199 mText +="</table>"; 199 mText +="</table>";
200 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>"; 200 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>";
201 mText += "<table>"; 201 mText += "<table>";
202 time = 2; 202 time = 2;
203 203
204 } 204 }
205 if ( dt.date() > QDate::currentDate() && time <= 2 ) { 205 if ( dt.date() > QDate::currentDate() && time <= 2 ) {
206 if ( time > 0 ) 206 if ( time > 0 )
207 mText +="</table>"; 207 mText +="</table>";
208 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>"; 208 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>";
209 mText += "<table>"; 209 mText += "<table>";
210 time = 3; 210 time = 3;
211 } 211 }
212 mText +="<tr><td><b>"; 212 mText +="<tr><td><b>";
213 mText += timestr; 213 mText += timestr;
214 mText += "</b></td><td>"; 214 mText += "</b></td><td>";
215 mText += tempText; 215 mText += tempText;
216 mText += "</td></tr>\n"; 216 mText += "</td></tr>\n";
217 inc = getNextInc( start ); 217 inc = getNextInc( start );
218 } 218 }
219 mText +="</table>"; 219 mText +="</table>";
220 setText( mText ); 220 setText( mText );
221} 221}
222 222
223MissedAlarmTextBrowser::~MissedAlarmTextBrowser() 223MissedAlarmTextBrowser::~MissedAlarmTextBrowser()
224{ 224{
225 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() "); 225 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() ");
226} 226}
227Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start ) 227Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start )
228{ 228{
229 QDateTime dt ; 229 QDateTime dt ;
230 Incidence * retInc; 230 Incidence * retInc;
231 Incidence * inc = mAlarms.first(); 231 Incidence * inc = mAlarms.first();
232 if ( inc == 0 ) 232 if ( inc == 0 )
233 return 0; 233 return 0;
234 bool ok; 234 bool ok;
235 dt = inc->getNextOccurence( start, &ok ); 235 dt = inc->getNextOccurence( start, &ok );
236 if ( ! ok ) return 0; 236 if ( ! ok ) return 0;
237 QDateTime dtn ; 237 QDateTime dtn ;
238 retInc = inc; 238 retInc = inc;
239 inc = mAlarms.next(); 239 inc = mAlarms.next();
240 while ( inc ) { 240 while ( inc ) {
241 dtn = inc->getNextOccurence( start, &ok ); 241 dtn = inc->getNextOccurence( start, &ok );
242 if ( ! ok ) return 0; 242 if ( ! ok ) return 0;
243 if ( dtn < dt ) { 243 if ( dtn < dt ) {
244 dt = dtn; 244 dt = dtn;
245 retInc = inc; 245 retInc = inc;
246 } 246 }
247 inc = mAlarms.next(); 247 inc = mAlarms.next();
248 } 248 }
249 mAlarms.remove( retInc ); 249 mAlarms.remove( retInc );
250 return retInc; 250 return retInc;
251 251
252} 252}
253void MissedAlarmTextBrowser::setSource(const QString & n) 253void MissedAlarmTextBrowser::setSource(const QString & n)
254{ 254{
255 if (n.startsWith("event:")) { 255 if (n.startsWith("event:")) {
256#ifdef DESKTOP_VERSION 256#ifdef DESKTOP_VERSION
257 emit showIncidence(n.mid(8)); 257 emit showIncidence(n.mid(8));
258#else 258#else
259 emit showIncidence(n.mid(6)); 259 emit showIncidence(n.mid(6));
260#endif 260#endif
261 return; 261 return;
262 } else if (n.startsWith("todo:")) { 262 } else if (n.startsWith("todo:")) {
263#ifdef DESKTOP_VERSION 263#ifdef DESKTOP_VERSION
264 emit showIncidence(n.mid(7)); 264 emit showIncidence(n.mid(7));
265#else 265#else
266 emit showIncidence(n.mid(5)); 266 emit showIncidence(n.mid(5));
267#endif 267#endif
268 return; 268 return;
269 } 269 }
270} 270}
271 271
272 272
273class KOBeamPrefs : public QDialog 273class KOBeamPrefs : public QDialog
274{ 274{
275 public: 275 public:
276 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 276 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
277 QDialog( parent, name, true ) 277 QDialog( parent, name, true )
278 { 278 {
279 setCaption( i18n("Beam Options") ); 279 setCaption( i18n("Beam Options") );
280 QVBoxLayout* lay = new QVBoxLayout( this ); 280 QVBoxLayout* lay = new QVBoxLayout( this );
281 lay->setSpacing( 3 ); 281 lay->setSpacing( 3 );
282 lay->setMargin( 3 ); 282 lay->setMargin( 3 );
283 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 283 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
284 lay->addWidget( format ); 284 lay->addWidget( format );
285 format->setExclusive ( true ) ; 285 format->setExclusive ( true ) ;
286 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 286 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
287 lay->addWidget( time ); time->setExclusive ( true ) ; 287 lay->addWidget( time ); time->setExclusive ( true ) ;
288 vcal = new QRadioButton(" vCalendar ", format ); 288 vcal = new QRadioButton(" vCalendar ", format );
289 ical = new QRadioButton(" iCalendar ", format ); 289 ical = new QRadioButton(" iCalendar ", format );
290 vcal->setChecked( true ); 290 vcal->setChecked( true );
291 tz = new QRadioButton(i18n(" With timezone "), time ); 291 tz = new QRadioButton(i18n(" With timezone "), time );
292 local = new QRadioButton(i18n(" Local time "), time ); 292 local = new QRadioButton(i18n(" Local time "), time );
293 tz->setChecked( true ); 293 tz->setChecked( true );
294 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 294 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
295 lay->addWidget( ok ); 295 lay->addWidget( ok );
296 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 296 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
297 lay->addWidget( cancel ); 297 lay->addWidget( cancel );
298 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 298 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
299 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 299 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
300 resize( 200, 200 ); 300 resize( 200, 200 );
301 } 301 }
302 302
303 bool beamVcal() { return vcal->isChecked(); } 303 bool beamVcal() { return vcal->isChecked(); }
304 bool beamLocal() { return local->isChecked(); } 304 bool beamLocal() { return local->isChecked(); }
305private: 305private:
306 QRadioButton* vcal, *ical, *local, *tz; 306 QRadioButton* vcal, *ical, *local, *tz;
307}; 307};
308class KOCatPrefs : public QDialog 308class KOCatPrefs : public QDialog
309{ 309{
310 public: 310 public:
311 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 311 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
312 QDialog( parent, name, true ) 312 QDialog( parent, name, true )
313 { 313 {
314 setCaption( i18n("Manage new Categories") ); 314 setCaption( i18n("Manage new Categories") );
315 QVBoxLayout* lay = new QVBoxLayout( this ); 315 QVBoxLayout* lay = new QVBoxLayout( this );
316 lay->setSpacing( 3 ); 316 lay->setSpacing( 3 );
317 lay->setMargin( 3 ); 317 lay->setMargin( 3 );
318 QLabel * lab = new QLabel( i18n("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>:"), this ); 318 QLabel * lab = new QLabel( i18n("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>:"), this );
319 lay->addWidget( lab ); 319 lay->addWidget( lab );
320 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 320 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
321 lay->addWidget( format ); 321 lay->addWidget( format );
322 format->setExclusive ( true ) ; 322 format->setExclusive ( true ) ;
323 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 323 addCatBut = new QRadioButton(i18n("Add to category list"), format );
324 new QRadioButton(i18n("Remove from Events/Todos"), format ); 324 new QRadioButton(i18n("Remove from Events/Todos"), format );
325 addCatBut->setChecked( true ); 325 addCatBut->setChecked( true );
326 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); 326 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this );
327 lay->addWidget( ok ); 327 lay->addWidget( ok );
328 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 328 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
329 lay->addWidget( cancel ); 329 lay->addWidget( cancel );
330 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 330 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
331 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 331 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
332 resize( 200, 200 ); 332 resize( 200, 200 );
333 } 333 }
334 334
335 bool addCat() { return addCatBut->isChecked(); } 335 bool addCat() { return addCatBut->isChecked(); }
336private: 336private:
337 QRadioButton* addCatBut; 337 QRadioButton* addCatBut;
338}; 338};
339 339
340 340
341 341
342CalendarView::CalendarView( CalendarResources *calendar, 342CalendarView::CalendarView( CalendarResources *calendar,
343 QWidget *parent, const char *name ) 343 QWidget *parent, const char *name )
344 : CalendarViewBase( parent, name ), 344 : CalendarViewBase( parent, name ),
345 mCalendar( calendar ), 345 mCalendar( calendar ),
346 mResourceManager( calendar->resourceManager() ) 346 mResourceManager( calendar->resourceManager() )
347{ 347{
348 348
349 mEventEditor = 0; 349 mEventEditor = 0;
350 mTodoEditor = 0; 350 mTodoEditor = 0;
351 351
352 init(); 352 init();
353} 353}
354 354
355CalendarView::CalendarView( Calendar *calendar, 355CalendarView::CalendarView( Calendar *calendar,
356 QWidget *parent, const char *name ) 356 QWidget *parent, const char *name )
357 : CalendarViewBase( parent, name ), 357 : CalendarViewBase( parent, name ),
358 mCalendar( calendar ), 358 mCalendar( calendar ),
359 mResourceManager( 0 ) 359 mResourceManager( 0 )
360{ 360{
361 361
362 mEventEditor = 0; 362 mEventEditor = 0;
363 mTodoEditor = 0; 363 mTodoEditor = 0;
364 init(); 364 init();
365} 365}
366 366
367void CalendarView::init() 367void CalendarView::init()
368{ 368{
369 mNextAlarmDateTime = QDateTime::currentDateTime(); 369 mNextAlarmDateTime = QDateTime::currentDateTime();
370 setFocusPolicy ( NoFocus ); 370 //setFocusPolicy ( NoFocus );
371 mViewerCallerIsSearchDialog = false; 371 mViewerCallerIsSearchDialog = false;
372 mBlockShowDates = false; 372 mBlockShowDates = false;
373 373
374 mDatePickerMode = 0; 374 mDatePickerMode = 0;
375 mCurrentSyncDevice = ""; 375 mCurrentSyncDevice = "";
376 mViewManager = new KOViewManager( this ); 376 mViewManager = new KOViewManager( this );
377 mDialogManager = new KODialogManager( this ); 377 mDialogManager = new KODialogManager( this );
378 mEventViewerDialog = 0; 378 mEventViewerDialog = 0;
379 mModified = false; 379 mModified = false;
380 mReadOnly = false; 380 mReadOnly = false;
381 mSelectedIncidence = 0; 381 mSelectedIncidence = 0;
382 mCalPrinter = 0; 382 mCalPrinter = 0;
383 mFilters.setAutoDelete(true); 383 mFilters.setAutoDelete(true);
384 384
385 mCalendar->registerObserver( this ); 385 mCalendar->registerObserver( this );
386 // TODO: Make sure that view is updated, when calendar is changed. 386 // TODO: Make sure that view is updated, when calendar is changed.
387 387
388 mStorage = new FileStorage( mCalendar ); 388 mStorage = new FileStorage( mCalendar );
389 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 389 mNavigator = new DateNavigator( this, "datevav", mViewManager );
390 390
391 QBoxLayout *topLayout = (QBoxLayout*)layout(); 391 QBoxLayout *topLayout = (QBoxLayout*)layout();
392#ifndef KORG_NOSPLITTER 392#ifndef KORG_NOSPLITTER
393 // create the main layout frames. 393 // create the main layout frames.
394 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 394 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
395 topLayout->addWidget(mPanner); 395 topLayout->addWidget(mPanner);
396 396
397 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 397 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
398 "CalendarView::LeftFrame"); 398 "CalendarView::LeftFrame");
399 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 399 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
400 400
401 mDateNavigator = new DateNavigatorContainer( mLeftSplitter, 401 mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
402 "CalendarView::DateNavigator" ); 402 "CalendarView::DateNavigator" );
403 403
404 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 404 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
405 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 405 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
406 mTodoList->setNavigator( mNavigator ); 406 mTodoList->setNavigator( mNavigator );
407 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 407 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
408 408
409#ifdef KORG_NORESOURCEVIEW 409#ifdef KORG_NORESOURCEVIEW
410 mResourceView = 0; 410 mResourceView = 0;
411#else 411#else
412 if ( mResourceManager ) { 412 if ( mResourceManager ) {
413 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 413 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
414 mResourceView->updateView(); 414 mResourceView->updateView();
415 connect( mResourceView, SIGNAL( resourcesChanged() ), 415 connect( mResourceView, SIGNAL( resourcesChanged() ),
416 SLOT( updateView() ) ); 416 SLOT( updateView() ) );
417 } else { 417 } else {
418 mResourceView = 0; 418 mResourceView = 0;
419 } 419 }
420#endif 420#endif
421 QWidget *rightBox = new QWidget( mPanner ); 421 QWidget *rightBox = new QWidget( mPanner );
422 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 422 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
423 423
424 mRightFrame = new QWidgetStack( rightBox ); 424 mRightFrame = new QWidgetStack( rightBox );
425 rightLayout->addWidget( mRightFrame, 1 ); 425 rightLayout->addWidget( mRightFrame, 1 );
426 426
427 mLeftFrame = mLeftSplitter; 427 mLeftFrame = mLeftSplitter;
428#else 428#else
429 //QWidget *mainBox = new QWidget( this ); 429 //QWidget *mainBox = new QWidget( this );
430 //QWidget *leftFrame = new QWidget( mainBox ); 430 //QWidget *leftFrame = new QWidget( mainBox );
431 //QBoxLayout * mainBoxLayout; 431 //QBoxLayout * mainBoxLayout;
432 if ( KOPrefs::instance()->mVerticalScreen ) { 432 if ( KOPrefs::instance()->mVerticalScreen ) {
433 //mainBoxLayout = new QVBoxLayout(mainBox); 433 //mainBoxLayout = new QVBoxLayout(mainBox);
434 //leftFrameLayout = new QHBoxLayout(leftFrame ); 434 //leftFrameLayout = new QHBoxLayout(leftFrame );
435 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); 435 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
436 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 436 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
437 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; 437 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
438 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 438 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
439 } else { 439 } else {
440 //mainBoxLayout = new QHBoxLayout(mainBox); 440 //mainBoxLayout = new QHBoxLayout(mainBox);
441 //leftFrameLayout = new QVBoxLayout(leftFrame ); 441 //leftFrameLayout = new QVBoxLayout(leftFrame );
442 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 442 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
443 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 443 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
444 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 444 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
445 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 445 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
446 } 446 }
447 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 447 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
448 //QBoxLayout * leftFrameLayout; 448 //QBoxLayout * leftFrameLayout;
449 topLayout->addWidget( mMainFrame ); 449 topLayout->addWidget( mMainFrame );
450#ifdef DESKTOP_VERSION 450#ifdef DESKTOP_VERSION
451 mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); 451 mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this );
452 topLayout->addWidget( mDateScrollBar ); 452 topLayout->addWidget( mDateScrollBar );
453 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); 453 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
454 if ( QApplication::desktop()->width() < 800 ) 454 if ( QApplication::desktop()->width() < 800 )
455 mDateScrollBar->hide(); 455 mDateScrollBar->hide();
456#endif 456#endif
457 //mainBoxLayout->addWidget (mLeftFrame); 457 //mainBoxLayout->addWidget (mLeftFrame);
458 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 458 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
459 "CalendarView::DateNavigator" ); 459 "CalendarView::DateNavigator" );
460#if 0 460#if 0
461 // FIXME 461 // FIXME
462 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 462 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
463 "CalendarView::DateNavigator", QDate::currentDate()); 463 "CalendarView::DateNavigator", QDate::currentDate());
464#endif 464#endif
465 // mDateNavigator->blockSignals( true ); 465 // mDateNavigator->blockSignals( true );
466 //leftFrameLayout->addWidget( mDateNavigator ); 466 //leftFrameLayout->addWidget( mDateNavigator );
467 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 467 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
468 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 468 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
469 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 469 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
470 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 470 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
471 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 471 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
472 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); 472 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) );
473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
474 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); 474 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
475 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); 475 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
476 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); 476 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); 477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
478 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); 478 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() ));
479 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 479 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
480 480
481 mTodoList->setNavigator( mNavigator ); 481 mTodoList->setNavigator( mNavigator );
482#if 0 482#if 0
483 if ( QApplication::desktop()->width() < 480 ) { 483 if ( QApplication::desktop()->width() < 480 ) {
484 leftFrameLayout->addWidget(mFilterView); 484 leftFrameLayout->addWidget(mFilterView);
485 leftFrameLayout->addWidget(mTodoList, 2 ); 485 leftFrameLayout->addWidget(mTodoList, 2 );
486 486
487 } else { 487 } else {
488 leftFrameLayout->addWidget(mTodoList,2 ); 488 leftFrameLayout->addWidget(mTodoList,2 );
489 leftFrameLayout->addWidget(mFilterView ); 489 leftFrameLayout->addWidget(mFilterView );
490 } 490 }
491#endif 491#endif
492 mFilterView->hide(); 492 mFilterView->hide();
493 mCalEditView->hide(); 493 mCalEditView->hide();
494 QWidget *rightBox = new QWidget( mMainFrame ); 494 QWidget *rightBox = new QWidget( mMainFrame );
495 //mainBoxLayout->addWidget ( rightBox, 10 ); 495 //mainBoxLayout->addWidget ( rightBox, 10 );
496 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 496 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
497 mRightFrame = new QWidgetStack( rightBox ); 497 mRightFrame = new QWidgetStack( rightBox );
498 rightLayout->addWidget( mRightFrame, 10 ); 498 rightLayout->addWidget( mRightFrame, 10 );
499 499
500 //mLeftFrame = (QWidget *)leftFrame; 500 //mLeftFrame = (QWidget *)leftFrame;
501 if ( KOPrefs::instance()->mVerticalScreen ) { 501 if ( KOPrefs::instance()->mVerticalScreen ) {
502 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 502 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
503 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 503 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
504 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 504 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
505 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 505 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
506 } else { 506 } else {
507 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 507 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
508 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 508 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
509 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 509 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
510 } 510 }
511 if ( !KOPrefs::instance()->mShowDateNavigator) 511 if ( !KOPrefs::instance()->mShowDateNavigator)
512 mDateNavigator->hide(); 512 mDateNavigator->hide();
513 //qDebug("Calendarview Size %d %d ", width(), height()); 513 //qDebug("Calendarview Size %d %d ", width(), height());
514#endif 514#endif
515 515
516 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 516 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
517 SLOT( showDates( const KCal::DateList & ) ) ); 517 SLOT( showDates( const KCal::DateList & ) ) );
518 518
519 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 519 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
520 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 520 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
521 521
522 522
523 523
524 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 524 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
525 mViewManager, SLOT( showMonth( const QDate & ) ) ); 525 mViewManager, SLOT( showMonth( const QDate & ) ) );
526 526
527 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 527 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
528 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 528 mNavigator, SLOT( selectWeek( const QDate & ) ) );
529 529
530 connect( mDateNavigator, SIGNAL( goPrevYear() ), 530 connect( mDateNavigator, SIGNAL( goPrevYear() ),
531 mNavigator, SLOT( selectPreviousYear() ) ); 531 mNavigator, SLOT( selectPreviousYear() ) );
532 connect( mDateNavigator, SIGNAL( goNextYear() ), 532 connect( mDateNavigator, SIGNAL( goNextYear() ),
533 mNavigator, SLOT( selectNextYear() ) ); 533 mNavigator, SLOT( selectNextYear() ) );
534 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 534 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
535 mNavigator, SLOT( selectPreviousMonth() ) ); 535 mNavigator, SLOT( selectPreviousMonth() ) );
536 connect( mDateNavigator, SIGNAL( goNextMonth() ), 536 connect( mDateNavigator, SIGNAL( goNextMonth() ),
537 mNavigator, SLOT( selectNextMonth() ) ); 537 mNavigator, SLOT( selectNextMonth() ) );
538 538
539 connect( mDateNavigator, SIGNAL( goPrevious() ), 539 connect( mDateNavigator, SIGNAL( goPrevious() ),
540 mNavigator, SLOT( selectPrevious() ) ); 540 mNavigator, SLOT( selectPrevious() ) );
541 connect( mDateNavigator, SIGNAL( goNext() ), 541 connect( mDateNavigator, SIGNAL( goNext() ),
542 mNavigator, SLOT( selectNext() ) ); 542 mNavigator, SLOT( selectNext() ) );
543 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 543 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
544 mNavigator, SLOT( slotMonthSelect( int ) ) ); 544 mNavigator, SLOT( slotMonthSelect( int ) ) );
545 545
546 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 546 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
547 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 547 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
548#if 0 548#if 0
549 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 549 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
550 SLOT( incidenceAdded( Incidence *) ) ); 550 SLOT( incidenceAdded( Incidence *) ) );
551#endif 551#endif
552 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 552 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
553 553
554 connect( this, SIGNAL( configChanged() ), 554 connect( this, SIGNAL( configChanged() ),
555 mDateNavigator, SLOT( updateConfig() ) ); 555 mDateNavigator, SLOT( updateConfig() ) );
556 556
557 connect( mTodoList, SIGNAL( newTodoSignal() ), 557 connect( mTodoList, SIGNAL( newTodoSignal() ),
558 SLOT( newTodo() ) ); 558 SLOT( newTodo() ) );
559 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 559 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
560 SLOT( newSubTodo( Todo * ) ) ); 560 SLOT( newSubTodo( Todo * ) ) );
561 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 561 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
562 SLOT( editTodo( Todo * ) ) ); 562 SLOT( editTodo( Todo * ) ) );
563 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 563 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
564 SLOT( showTodo( Todo *) ) ); 564 SLOT( showTodo( Todo *) ) );
565 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 565 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
566 SLOT( deleteTodo( Todo *) ) ); 566 SLOT( deleteTodo( Todo *) ) );
567 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 567 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
568 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 568 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
569 SLOT( purgeCompleted() ) ); 569 SLOT( purgeCompleted() ) );
570 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 570 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
571 SIGNAL( todoModified( Todo *, int ) ) ); 571 SIGNAL( todoModified( Todo *, int ) ) );
572 572
573 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 573 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
574 this, SLOT ( cloneIncidence( Incidence * ) ) ); 574 this, SLOT ( cloneIncidence( Incidence * ) ) );
575 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 575 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
576 this, SLOT (cancelIncidence( Incidence * ) ) ); 576 this, SLOT (cancelIncidence( Incidence * ) ) );
577 577
578 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 578 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
579 this, SLOT ( moveIncidence( Incidence * ) ) ); 579 this, SLOT ( moveIncidence( Incidence * ) ) );
580 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 580 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
581 this, SLOT ( beamIncidence( Incidence * ) ) ); 581 this, SLOT ( beamIncidence( Incidence * ) ) );
582 582
583 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 583 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
584 this, SLOT ( todo_unsub( Todo * ) ) ); 584 this, SLOT ( todo_unsub( Todo * ) ) );
585 585
586 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 586 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
587 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 587 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
588 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 588 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
589 SLOT( updateTodo( Todo *, int ) ) ); 589 SLOT( updateTodo( Todo *, int ) ) );
590 connect( this, SIGNAL( todoModified( Todo *, int )), this, 590 connect( this, SIGNAL( todoModified( Todo *, int )), this,
591 SLOT( changeTodoDisplay( Todo *, int ) ) ); 591 SLOT( changeTodoDisplay( Todo *, int ) ) );
592 592
593 593
594 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 594 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
595 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 595 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
596 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 596 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
597 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 597 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
598 598
599 599
600 600
601 601
602 602
603 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 603 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
604 SLOT(checkClipboard())); 604 SLOT(checkClipboard()));
605 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 605 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
606 SLOT( processTodoListSelection( Incidence * ) ) ); 606 SLOT( processTodoListSelection( Incidence * ) ) );
607 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 607 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
608 608
609 // kdDebug() << "CalendarView::CalendarView() done" << endl; 609 // kdDebug() << "CalendarView::CalendarView() done" << endl;
610 610
611 mDateFrame = new QVBox(0,0,WType_Popup); 611 mDateFrame = new QVBox(0,0,WType_Popup);
612 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 612 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
613 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 613 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
614 mDateFrame->setLineWidth(3); 614 mDateFrame->setLineWidth(3);
615 mDateFrame->hide(); 615 mDateFrame->hide();
616 mDateFrame->setCaption( i18n( "Pick a date to display")); 616 mDateFrame->setCaption( i18n( "Pick a date to display"));
617 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 617 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
618 618
619 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 619 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
620 620
621 mEventEditor = mDialogManager->getEventEditor(); 621 mEventEditor = mDialogManager->getEventEditor();
622 mTodoEditor = mDialogManager->getTodoEditor(); 622 mTodoEditor = mDialogManager->getTodoEditor();
623 623
624 mFlagEditDescription = false; 624 mFlagEditDescription = false;
625 625
626 mSuspendTimer = new QTimer( this ); 626 mSuspendTimer = new QTimer( this );
627 mAlarmTimer = new QTimer( this ); 627 mAlarmTimer = new QTimer( this );
628 mRecheckAlarmTimer = new QTimer( this ); 628 mRecheckAlarmTimer = new QTimer( this );
629 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 629 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
630 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 630 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
631 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 631 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
632 mAlarmDialog = new AlarmDialog( this ); 632 mAlarmDialog = new AlarmDialog( this );
633 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 633 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
634 mAlarmDialog->setServerNotification( false ); 634 mAlarmDialog->setServerNotification( false );
635 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 635 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
636 636
637 637
638#ifndef DESKTOP_VERSION 638#ifndef DESKTOP_VERSION
639//US listen for arriving address resultsets 639//US listen for arriving address resultsets
640 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 640 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
641 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 641 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
642#endif 642#endif
643 mDateNavigator->setCalendar( mCalendar ); 643 mDateNavigator->setCalendar( mCalendar );
644} 644}
645 645
646 646
647CalendarView::~CalendarView() 647CalendarView::~CalendarView()
648{ 648{
649 // kdDebug() << "~CalendarView()" << endl; 649 // kdDebug() << "~CalendarView()" << endl;
650 //qDebug("CalendarView::~CalendarView() "); 650 //qDebug("CalendarView::~CalendarView() ");
651 delete mDialogManager; 651 delete mDialogManager;
652 delete mViewManager; 652 delete mViewManager;
653 delete mStorage; 653 delete mStorage;
654 delete mDateFrame ; 654 delete mDateFrame ;
655 delete mEventViewerDialog; 655 delete mEventViewerDialog;
656 //kdDebug() << "~CalendarView() done" << endl; 656 //kdDebug() << "~CalendarView() done" << endl;
657} 657}
658void CalendarView::nextConflict( bool all, bool allday ) 658void CalendarView::nextConflict( bool all, bool allday )
659{ 659{
660 660
661 QPtrList<Event> testlist = mCalendar->events(); 661 QPtrList<Event> testlist = mCalendar->events();
662 Event * test = testlist.first(); 662 Event * test = testlist.first();
663 while ( test ) { 663 while ( test ) {
664 test->setTagged( false ); 664 test->setTagged( false );
665 test = testlist.next(); 665 test = testlist.next();
666 } 666 }
667 QTime st ( 0,0,0); 667 QTime st ( 0,0,0);
668 if ( mViewManager->currentView() == mViewManager->agendaView() ) 668 if ( mViewManager->currentView() == mViewManager->agendaView() )
669 st = mViewManager->agendaView()->agenda()->getEndTime(); 669 st = mViewManager->agendaView()->agenda()->getEndTime();
670 //qDebug("time %s ", st.toString().latin1()); 670 //qDebug("time %s ", st.toString().latin1());
671 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); 671 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st);
672 QDateTime conflict; 672 QDateTime conflict;
673 QDateTime retVal; 673 QDateTime retVal;
674 bool found = false; 674 bool found = false;
675 Event * cE = 0; 675 Event * cE = 0;
676 Event * cE2 = 0; 676 Event * cE2 = 0;
677 QPtrList<Event> testlist2 = testlist; 677 QPtrList<Event> testlist2 = testlist;
678 test = testlist.first(); 678 test = testlist.first();
679 bool skip = false; 679 bool skip = false;
680 while ( test ) { 680 while ( test ) {
681 skip = false; 681 skip = false;
682 if ( !all ) skip = ( allday != test->doesFloat() ); 682 if ( !all ) skip = ( allday != test->doesFloat() );
683 if ( !skip ) { 683 if ( !skip ) {
684 Event * test2 = testlist2.first(); 684 Event * test2 = testlist2.first();
685 while ( test2 ) { 685 while ( test2 ) {
686 skip = false; 686 skip = false;
687 if ( !all ) skip = ( allday != test2->doesFloat() ); 687 if ( !all ) skip = ( allday != test2->doesFloat() );
688 if ( !skip ) { 688 if ( !skip ) {
689 if ( !test2->isTagged() ) { 689 if ( !test2->isTagged() ) {
690 if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { 690 if ( test->isOverlapping ( test2, &retVal, &startDT ) ) {
691 //qDebug("overlap "); 691 //qDebug("overlap ");
692 if ( ! found ) { 692 if ( ! found ) {
693 if ( retVal >= startDT ) { 693 if ( retVal >= startDT ) {
694 conflict = retVal; 694 conflict = retVal;
695 cE = test; 695 cE = test;
696 cE2 = test2; 696 cE2 = test2;
697 found = true; 697 found = true;
698 } 698 }
699 } else { 699 } else {
700 if ( retVal >= startDT && retVal < conflict ) { 700 if ( retVal >= startDT && retVal < conflict ) {
701 conflict = retVal; 701 conflict = retVal;
702 cE = test; 702 cE = test;
703 cE2 = test2; 703 cE2 = test2;
704 } 704 }
705 } 705 }
706 } 706 }
707 } 707 }
708 } 708 }
709 test2 = testlist2.next(); 709 test2 = testlist2.next();
710 } 710 }
711 } 711 }
712 test->setTagged( true ); 712 test->setTagged( true );
713 test = testlist.next(); 713 test = testlist.next();
714 } 714 }
715 if ( found ) { 715 if ( found ) {
716 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 716 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
717 mViewManager->showDayView(); 717 mViewManager->showDayView();
718 mNavigator->slotDaySelect( conflict.date() ); 718 mNavigator->slotDaySelect( conflict.date() );
719 int hour = conflict.time().hour(); 719 int hour = conflict.time().hour();
720 mViewManager->agendaView()->setStartHour( hour ); 720 mViewManager->agendaView()->setStartHour( hour );
721 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); 721 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) );
722 return; 722 return;
723 } 723 }
724 724
725 topLevelWidget()->setCaption( i18n("No conflict found") ); 725 topLevelWidget()->setCaption( i18n("No conflict found") );
726 qDebug("No conflict found "); 726 qDebug("No conflict found ");
727 return; 727 return;
728} 728}
729 729
730void CalendarView::conflictAll() 730void CalendarView::conflictAll()
731{ 731{
732 nextConflict ( true, true ); 732 nextConflict ( true, true );
733} 733}
734void CalendarView::conflictAllday() 734void CalendarView::conflictAllday()
735{ 735{
736 nextConflict ( false, true ); 736 nextConflict ( false, true );
737} 737}
738void CalendarView::conflictNotAll() 738void CalendarView::conflictNotAll()
739{ 739{
740 nextConflict ( false, false ); 740 nextConflict ( false, false );
741} 741}
742 742
743void CalendarView::setCalReadOnly( int id, bool readO ) 743void CalendarView::setCalReadOnly( int id, bool readO )
744{ 744{
745 if ( readO ) { 745 if ( readO ) {
746 emit save(); 746 emit save();
747 } 747 }
748 mCalendar->setReadOnly( id, readO ); 748 mCalendar->setReadOnly( id, readO );
749} 749}
750void CalendarView::setScrollBarStep(int val ) 750void CalendarView::setScrollBarStep(int val )
751{ 751{
752#ifdef DESKTOP_VERSION 752#ifdef DESKTOP_VERSION
753 mDateScrollBar->setLineStep ( val ); 753 mDateScrollBar->setLineStep ( val );
754#endif 754#endif
755} 755}
756void CalendarView::scrollBarValue(int val ) 756void CalendarView::scrollBarValue(int val )
757{ 757{
758#ifdef DESKTOP_VERSION 758#ifdef DESKTOP_VERSION
759 if ( QApplication::desktop()->width() < 800 ) return; 759 if ( QApplication::desktop()->width() < 800 ) return;
760 static bool block = false; 760 static bool block = false;
761 if ( block ) return; 761 if ( block ) return;
762 block = true; 762 block = true;
763 int count = mNavigator->selectedDates().count(); 763 int count = mNavigator->selectedDates().count();
764 int day = mNavigator->selectedDates().first().dayOfYear(); 764 int day = mNavigator->selectedDates().first().dayOfYear();
765 int stepdays = val; 765 int stepdays = val;
766 if ( mDateScrollBar->lineStep () <= count ) { 766 if ( mDateScrollBar->lineStep () <= count ) {
767 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 767 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
768 //qDebug("VAL %d ",val ); 768 //qDebug("VAL %d ",val );
769 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 769 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
770 stepdays = day+stepdays; 770 stepdays = day+stepdays;
771 if ( stepdays < 0 ) stepdays = 0; 771 if ( stepdays < 0 ) stepdays = 0;
772 } 772 }
773 if ( stepdays == day ) { 773 if ( stepdays == day ) {
774 block = false; 774 block = false;
775 return; 775 return;
776 } 776 }
777 int year = mNavigator->selectedDates().first().year(); 777 int year = mNavigator->selectedDates().first().year();
778 QDate d ( year,1,1 ); 778 QDate d ( year,1,1 );
779 mNavigator->selectDates( d.addDays( stepdays-1) , count ); 779 mNavigator->selectDates( d.addDays( stepdays-1) , count );
780 block = false; 780 block = false;
781#endif 781#endif
782 782
783} 783}
784void CalendarView::updateView(const QDate &start, const QDate &end) 784void CalendarView::updateView(const QDate &start, const QDate &end)
785{ 785{
786#ifdef DESKTOP_VERSION 786#ifdef DESKTOP_VERSION
787 if ( ! mDateScrollBar->draggingSlider () ) { 787 if ( ! mDateScrollBar->draggingSlider () ) {
788 int dof = start.dayOfYear(); 788 int dof = start.dayOfYear();
789 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); 789 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() );
790 if ( dof != mDateScrollBar->value() ) { 790 if ( dof != mDateScrollBar->value() ) {
791 mDateScrollBar->blockSignals( true ); 791 mDateScrollBar->blockSignals( true );
792 mDateScrollBar->setValue( start.dayOfYear()); 792 mDateScrollBar->setValue( start.dayOfYear());
793 mDateScrollBar->blockSignals( false ); 793 mDateScrollBar->blockSignals( false );
794 } 794 }
795 } 795 }
796#endif 796#endif
797 mTodoList->updateView(); 797 mTodoList->updateView();
798 mViewManager->updateView(start, end); 798 mViewManager->updateView(start, end);
799 //mDateNavigator->updateView(); 799 //mDateNavigator->updateView();
800} 800}
801 801
802 802
803 803
804void CalendarView::checkFiles() 804void CalendarView::checkFiles()
805{ 805{
806 QString message; 806 QString message;
807 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 807 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
808 KopiCalendarFile * cal = calendars.first(); 808 KopiCalendarFile * cal = calendars.first();
809 while ( cal ) { 809 while ( cal ) {
810 if ( cal->mErrorOnLoad ) { 810 if ( cal->mErrorOnLoad ) {
811 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 811 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
812 } 812 }
813 cal = calendars.next(); 813 cal = calendars.next();
814 } 814 }
815 if ( !message.isEmpty() ) { 815 if ( !message.isEmpty() ) {
816 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 816 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
817 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 817 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed"));
818 } 818 }
819 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 819 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
820} 820}
821void CalendarView::checkAlarms() 821void CalendarView::checkAlarms()
822{ 822{
823 823
824 824
825 KConfig *config = KOGlobals::config(); 825 KConfig *config = KOGlobals::config();
826 config->setGroup( "AppRun" ); 826 config->setGroup( "AppRun" );
827 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 827 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
828 int daysto = dt.daysTo( QDate::currentDate() ); 828 int daysto = dt.daysTo( QDate::currentDate() );
829 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 829 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
830 dt = dt.addDays( days ); 830 dt = dt.addDays( days );
831 int secto = dt.secsTo( QDateTime::currentDateTime() ); 831 int secto = dt.secsTo( QDateTime::currentDateTime() );
832 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 832 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
833 //qDebug("KO: Reading program stop %d ", secs); 833 //qDebug("KO: Reading program stop %d ", secs);
834 //secs -= ( 3600 * 24*3 ); // debug only 834 //secs -= ( 3600 * 24*3 ); // debug only
835 QDateTime latest = dt.addSecs ( secs ); 835 QDateTime latest = dt.addSecs ( secs );
836 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 836 qDebug("KO: Last termination on %s ", latest.toString().latin1());
837 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 837 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
838 QPtrList<Incidence> el = mCalendar->rawIncidences(); 838 QPtrList<Incidence> el = mCalendar->rawIncidences();
839 QPtrList<Incidence> al; 839 QPtrList<Incidence> al;
840 Incidence* inL = el.first(); 840 Incidence* inL = el.first();
841 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 841 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
842 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 842 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
843 while ( inL ) { 843 while ( inL ) {
844 bool ok = false; 844 bool ok = false;
845 int offset = 0; 845 int offset = 0;
846 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 846 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
847 if ( ok ) { 847 if ( ok ) {
848 //qDebug("OK %s",next.toString().latin1()); 848 //qDebug("OK %s",next.toString().latin1());
849 if ( next < cur ) { 849 if ( next < cur ) {
850 al.append( inL ); 850 al.append( inL );
851 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 851 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
852 } 852 }
853 } 853 }
854 inL = el.next(); 854 inL = el.next();
855 } 855 }
856 if ( al.count() ) { 856 if ( al.count() ) {
857 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 857 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
858 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 858 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
859 QVBoxLayout* lay = new QVBoxLayout( dia ); 859 QVBoxLayout* lay = new QVBoxLayout( dia );
860 lay->setSpacing( 0 ); 860 lay->setSpacing( 0 );
861 lay->setMargin( 0 ); 861 lay->setMargin( 0 );
862 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 862 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
863 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 863 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
864 lay->addWidget( matb ); 864 lay->addWidget( matb );
865 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 865 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
866 int wid = 210; 866 int wid = 210;
867 int x = QApplication::desktop()->width() - wid - 7; 867 int x = QApplication::desktop()->width() - wid - 7;
868 int y = QApplication::desktop()->height() - wid - 70; 868 int y = QApplication::desktop()->height() - wid - 70;
869 dia->setGeometry ( x,y,wid,wid); 869 dia->setGeometry ( x,y,wid,wid);
870 } else { 870 } else {
871 int si = 220; 871 int si = 220;
872 if ( QApplication::desktop()->width() > 470 ) 872 if ( QApplication::desktop()->width() > 470 )
873 si = 400; 873 si = 400;
874 dia->resize(si,si/2); 874 dia->resize(si,si/2);
875 } 875 }
876 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 876 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
877 dia->show(); 877 dia->show();
878 878
879 } 879 }
880} 880}
881void CalendarView::showDay( QDate d ) 881void CalendarView::showDay( QDate d )
882{ 882{
883 dateNavigator()->blockSignals( true ); 883 dateNavigator()->blockSignals( true );
884 dateNavigator()->selectDate( d ); 884 dateNavigator()->selectDate( d );
885 dateNavigator()->blockSignals( false ); 885 dateNavigator()->blockSignals( false );
886 mViewManager->showDayView(); 886 mViewManager->showDayView();
887 //dateNavigator()->selectDate( d ); 887 //dateNavigator()->selectDate( d );
888} 888}
889void CalendarView::timerAlarm() 889void CalendarView::timerAlarm()
890{ 890{
891 //qDebug("CalendarView::timerAlarm() "); 891 //qDebug("CalendarView::timerAlarm() ");
892 computeAlarm(mAlarmNotification ); 892 computeAlarm(mAlarmNotification );
893} 893}
894 894
895void CalendarView::suspendAlarm() 895void CalendarView::suspendAlarm()
896{ 896{
897 //qDebug(" CalendarView::suspendAlarm() "); 897 //qDebug(" CalendarView::suspendAlarm() ");
898 computeAlarm(mSuspendAlarmNotification ); 898 computeAlarm(mSuspendAlarmNotification );
899 899
900} 900}
901 901
902void CalendarView::startAlarm( QString mess , QString filename) 902void CalendarView::startAlarm( QString mess , QString filename)
903{ 903{
904 904
905 topLevelWidget()->showNormal(); 905 topLevelWidget()->showNormal();
906 topLevelWidget()->setActiveWindow(); 906 topLevelWidget()->setActiveWindow();
907 topLevelWidget()->raise(); 907 topLevelWidget()->raise();
908 908
909 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 909 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
910 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); 910 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) );
911 911
912} 912}
913 913
914void CalendarView::checkNextTimerAlarm() 914void CalendarView::checkNextTimerAlarm()
915{ 915{
916 mCalendar->checkAlarmForIncidence( 0, true ); 916 mCalendar->checkAlarmForIncidence( 0, true );
917} 917}
918 918
919void CalendarView::computeAlarm( QString msg ) 919void CalendarView::computeAlarm( QString msg )
920{ 920{
921 921
922 QString mess = msg; 922 QString mess = msg;
923 QString mAlarmMessage = mess.mid( 9 ); 923 QString mAlarmMessage = mess.mid( 9 );
924 QString filename = MainWindow::resourcePath(); 924 QString filename = MainWindow::resourcePath();
925 filename += "koalarm.wav"; 925 filename += "koalarm.wav";
926 QString tempfilename; 926 QString tempfilename;
927 if ( mess.left( 13 ) == "suspend_alarm") { 927 if ( mess.left( 13 ) == "suspend_alarm") {
928 bool error = false; 928 bool error = false;
929 int len = mess.mid( 13 ).find("+++"); 929 int len = mess.mid( 13 ).find("+++");
930 if ( len < 2 ) 930 if ( len < 2 )
931 error = true; 931 error = true;
932 else { 932 else {
933 tempfilename = mess.mid( 13, len ); 933 tempfilename = mess.mid( 13, len );
934 if ( !QFile::exists( tempfilename ) ) 934 if ( !QFile::exists( tempfilename ) )
935 error = true; 935 error = true;
936 } 936 }
937 if ( ! error ) { 937 if ( ! error ) {
938 filename = tempfilename; 938 filename = tempfilename;
939 } 939 }
940 mAlarmMessage = mess.mid( 13+len+3 ); 940 mAlarmMessage = mess.mid( 13+len+3 );
941 //qDebug("suspend file %s ",tempfilename.latin1() ); 941 //qDebug("suspend file %s ",tempfilename.latin1() );
942 startAlarm( mAlarmMessage, filename); 942 startAlarm( mAlarmMessage, filename);
943 return; 943 return;
944 } 944 }
945 if ( mess.left( 11 ) == "timer_alarm") { 945 if ( mess.left( 11 ) == "timer_alarm") {
946 //mTimerTime = 0; 946 //mTimerTime = 0;
947 startAlarm( mess.mid( 11 ), filename ); 947 startAlarm( mess.mid( 11 ), filename );
948 return; 948 return;
949 } 949 }
950 if ( mess.left( 10 ) == "proc_alarm") { 950 if ( mess.left( 10 ) == "proc_alarm") {
951 bool error = false; 951 bool error = false;
952 int len = mess.mid( 10 ).find("+++"); 952 int len = mess.mid( 10 ).find("+++");
953 if ( len < 2 ) 953 if ( len < 2 )
954 error = true; 954 error = true;
955 else { 955 else {
956 tempfilename = mess.mid( 10, len ); 956 tempfilename = mess.mid( 10, len );
957 if ( !QFile::exists( tempfilename ) ) 957 if ( !QFile::exists( tempfilename ) )
958 error = true; 958 error = true;
959 } 959 }
960 if ( error ) { 960 if ( error ) {
961 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 961 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
962 mAlarmMessage += mess.mid( 10+len+3+9 ); 962 mAlarmMessage += mess.mid( 10+len+3+9 );
963 } else { 963 } else {
964 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 964 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
965 //qDebug("-----system command %s ",tempfilename.latin1() ); 965 //qDebug("-----system command %s ",tempfilename.latin1() );
966#ifndef _WIN32_ 966#ifndef _WIN32_
967 if ( vfork () == 0 ) { 967 if ( vfork () == 0 ) {
968 execl ( tempfilename.latin1(), 0 ); 968 execl ( tempfilename.latin1(), 0 );
969 return; 969 return;
970 } 970 }
971#else 971#else
972 QProcess* p = new QProcess(); 972 QProcess* p = new QProcess();
973 p->addArgument( tempfilename.latin1() ); 973 p->addArgument( tempfilename.latin1() );
974 p->start(); 974 p->start();
975 return; 975 return;
976#endif 976#endif
977 977
978 return; 978 return;
979 } 979 }
980 980
981 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 981 //qDebug("+++++++system command %s ",tempfilename.latin1() );
982 } 982 }
983 if ( mess.left( 11 ) == "audio_alarm") { 983 if ( mess.left( 11 ) == "audio_alarm") {
984 bool error = false; 984 bool error = false;
985 int len = mess.mid( 11 ).find("+++"); 985 int len = mess.mid( 11 ).find("+++");
986 if ( len < 2 ) 986 if ( len < 2 )
987 error = true; 987 error = true;
988 else { 988 else {
989 tempfilename = mess.mid( 11, len ); 989 tempfilename = mess.mid( 11, len );
990 if ( !QFile::exists( tempfilename ) ) 990 if ( !QFile::exists( tempfilename ) )
991 error = true; 991 error = true;
992 } 992 }
993 if ( ! error ) { 993 if ( ! error ) {
994 filename = tempfilename; 994 filename = tempfilename;
995 } 995 }
996 mAlarmMessage = mess.mid( 11+len+3+9 ); 996 mAlarmMessage = mess.mid( 11+len+3+9 );
997 //qDebug("audio file command %s ",tempfilename.latin1() ); 997 //qDebug("audio file command %s ",tempfilename.latin1() );
998 } 998 }
999 if ( mess.left( 9 ) == "cal_alarm") { 999 if ( mess.left( 9 ) == "cal_alarm") {
1000 mAlarmMessage = mess.mid( 9 ) ; 1000 mAlarmMessage = mess.mid( 9 ) ;
1001 } 1001 }
1002 1002
1003 startAlarm( mAlarmMessage, filename ); 1003 startAlarm( mAlarmMessage, filename );
1004 1004
1005 1005
1006} 1006}
1007 1007
1008void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti ) 1008void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
1009{ 1009{
1010 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 1010 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
1011 1011
1012 mSuspendAlarmNotification = noti; 1012 mSuspendAlarmNotification = noti;
1013 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 1013 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
1014 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 1014 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
1015 mSuspendTimer->start( ms , true ); 1015 mSuspendTimer->start( ms , true );
1016 1016
1017} 1017}
1018 1018
1019void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 1019void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
1020{ 1020{
1021 mNextAlarmDateTime = qdt; 1021 mNextAlarmDateTime = qdt;
1022 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 1022 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
1023 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 1023 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
1024#ifndef DESKTOP_VERSION 1024#ifndef DESKTOP_VERSION
1025 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() ); 1025 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() );
1026#endif 1026#endif
1027 return; 1027 return;
1028 } 1028 }
1029 int maxSec; 1029 int maxSec;
1030 //maxSec = 5; //testing only 1030 //maxSec = 5; //testing only
1031 maxSec = 86400+3600; // one day+1hour 1031 maxSec = 86400+3600; // one day+1hour
1032 mAlarmNotification = noti; 1032 mAlarmNotification = noti;
1033 int sec = QDateTime::currentDateTime().secsTo( qdt ); 1033 int sec = QDateTime::currentDateTime().secsTo( qdt );
1034 if ( sec > maxSec ) { 1034 if ( sec > maxSec ) {
1035 mRecheckAlarmTimer->start( maxSec * 1000 ); 1035 mRecheckAlarmTimer->start( maxSec * 1000 );
1036 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); 1036 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec );
1037 return; 1037 return;
1038 } else { 1038 } else {
1039 mRecheckAlarmTimer->stop(); 1039 mRecheckAlarmTimer->stop();
1040 } 1040 }
1041 //qDebug("Alarm timer started with secs: %d ", sec); 1041 //qDebug("Alarm timer started with secs: %d ", sec);
1042 mAlarmTimer->start( sec *1000 , true ); 1042 mAlarmTimer->start( sec *1000 , true );
1043 1043
1044} 1044}
1045// called by mRecheckAlarmTimer to get next alarm 1045// called by mRecheckAlarmTimer to get next alarm
1046// we need this, because a QTimer has only a max range of 25 days 1046// we need this, because a QTimer has only a max range of 25 days
1047void CalendarView::recheckTimerAlarm() 1047void CalendarView::recheckTimerAlarm()
1048{ 1048{
1049 mAlarmTimer->stop(); 1049 mAlarmTimer->stop();
1050 mRecheckAlarmTimer->stop(); 1050 mRecheckAlarmTimer->stop();
1051 mCalendar->checkAlarmForIncidence( 0, true ); 1051 mCalendar->checkAlarmForIncidence( 0, true );
1052} 1052}
1053#ifndef DESKTOP_VERSION 1053#ifndef DESKTOP_VERSION
1054void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti ) 1054void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
1055#else 1055#else
1056void CalendarView::removeAlarm(const QDateTime &, const QString & ) 1056void CalendarView::removeAlarm(const QDateTime &, const QString & )
1057#endif 1057#endif
1058{ 1058{
1059 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 1059 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
1060 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 1060 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
1061#ifndef DESKTOP_VERSION 1061#ifndef DESKTOP_VERSION
1062 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() ); 1062 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() );
1063#endif 1063#endif
1064 return; 1064 return;
1065 } 1065 }
1066 mAlarmTimer->stop(); 1066 mAlarmTimer->stop();
1067} 1067}
1068void CalendarView::selectWeekNum ( int num ) 1068void CalendarView::selectWeekNum ( int num )
1069{ 1069{
1070 dateNavigator()->blockSignals( true ); 1070 dateNavigator()->blockSignals( true );
1071 dateNavigator()->selectWeek( num ); 1071 dateNavigator()->selectWeek( num );
1072 dateNavigator()->blockSignals( false ); 1072 dateNavigator()->blockSignals( false );
1073 mViewManager->showWeekView(); 1073 mViewManager->showWeekView();
1074} 1074}
1075KOViewManager *CalendarView::viewManager() 1075KOViewManager *CalendarView::viewManager()
1076{ 1076{
1077 return mViewManager; 1077 return mViewManager;
1078} 1078}
1079 1079
1080KODialogManager *CalendarView::dialogManager() 1080KODialogManager *CalendarView::dialogManager()
1081{ 1081{
1082 return mDialogManager; 1082 return mDialogManager;
1083} 1083}
1084 1084
1085QDate CalendarView::startDate() 1085QDate CalendarView::startDate()
1086{ 1086{
1087 DateList dates = mNavigator->selectedDates(); 1087 DateList dates = mNavigator->selectedDates();
1088 1088
1089 return dates.first(); 1089 return dates.first();
1090} 1090}
1091 1091
1092QDate CalendarView::endDate() 1092QDate CalendarView::endDate()
1093{ 1093{
1094 DateList dates = mNavigator->selectedDates(); 1094 DateList dates = mNavigator->selectedDates();
1095 1095
1096 return dates.last(); 1096 return dates.last();
1097} 1097}
1098 1098
1099 1099
1100void CalendarView::createPrinter() 1100void CalendarView::createPrinter()
1101{ 1101{
1102#ifndef KORG_NOPRINTER 1102#ifndef KORG_NOPRINTER
1103 if (!mCalPrinter) { 1103 if (!mCalPrinter) {
1104 mCalPrinter = new CalPrinter(this, mCalendar); 1104 mCalPrinter = new CalPrinter(this, mCalendar);
1105 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); 1105 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig()));
1106 } 1106 }
1107#endif 1107#endif
1108} 1108}
1109 1109
1110 1110
1111//KOPrefs::instance()->mWriteBackFile 1111//KOPrefs::instance()->mWriteBackFile
1112//KOPrefs::instance()->mWriteBackExistingOnly 1112//KOPrefs::instance()->mWriteBackExistingOnly
1113 1113
1114// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 1114// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
1115// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 1115// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
1116// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 1116// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
1117// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 1117// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
1118// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 1118// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
1119// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 1119// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
1120 1120
1121int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) 1121int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full )
1122{ 1122{
1123 1123
1124 // 0 equal 1124 // 0 equal
1125 // 1 take local 1125 // 1 take local
1126 // 2 take remote 1126 // 2 take remote
1127 // 3 cancel 1127 // 3 cancel
1128 QDateTime lastSync = mLastCalendarSync; 1128 QDateTime lastSync = mLastCalendarSync;
1129 QDateTime localMod = local->lastModified(); 1129 QDateTime localMod = local->lastModified();
1130 QDateTime remoteMod = remote->lastModified(); 1130 QDateTime remoteMod = remote->lastModified();
1131 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1131 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1132 bool remCh, locCh; 1132 bool remCh, locCh;
1133 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 1133 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
1134 //if ( remCh ) 1134 //if ( remCh )
1135 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 1135 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
1136 locCh = ( localMod > mLastCalendarSync ); 1136 locCh = ( localMod > mLastCalendarSync );
1137 if ( !remCh && ! locCh ) { 1137 if ( !remCh && ! locCh ) {
1138 //qDebug("both not changed "); 1138 //qDebug("both not changed ");
1139 lastSync = localMod.addDays(1); 1139 lastSync = localMod.addDays(1);
1140 if ( mode <= SYNC_PREF_ASK ) 1140 if ( mode <= SYNC_PREF_ASK )
1141 return 0; 1141 return 0;
1142 } else { 1142 } else {
1143 if ( locCh ) { 1143 if ( locCh ) {
1144 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1()); 1144 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1());
1145 lastSync = localMod.addDays( -1 ); 1145 lastSync = localMod.addDays( -1 );
1146 if ( !remCh ) 1146 if ( !remCh )
1147 remoteMod = ( lastSync.addDays( -1 ) ); 1147 remoteMod = ( lastSync.addDays( -1 ) );
1148 } else { 1148 } else {
1149 //qDebug(" not loc changed "); 1149 //qDebug(" not loc changed ");
1150 lastSync = localMod.addDays( 1 ); 1150 lastSync = localMod.addDays( 1 );
1151 if ( remCh ) 1151 if ( remCh )
1152 remoteMod =( lastSync.addDays( 1 ) ); 1152 remoteMod =( lastSync.addDays( 1 ) );
1153 1153
1154 } 1154 }
1155 } 1155 }
1156 full = true; 1156 full = true;
1157 if ( mode < SYNC_PREF_ASK ) 1157 if ( mode < SYNC_PREF_ASK )
1158 mode = SYNC_PREF_ASK; 1158 mode = SYNC_PREF_ASK;
1159 } else { 1159 } else {
1160 if ( localMod == remoteMod ) 1160 if ( localMod == remoteMod )
1161 // if ( local->revision() == remote->revision() ) 1161 // if ( local->revision() == remote->revision() )
1162 return 0; 1162 return 0;
1163 1163
1164 } 1164 }
1165 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); 1165 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() );
1166 1166
1167 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision()); 1167 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision());
1168 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() ); 1168 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() );
1169 //full = true; //debug only 1169 //full = true; //debug only
1170 if ( full ) { 1170 if ( full ) {
1171 bool equ = false; 1171 bool equ = false;
1172 if ( local->typeID() == eventID ) { 1172 if ( local->typeID() == eventID ) {
1173 equ = (*((Event*) local) == *((Event*) remote)); 1173 equ = (*((Event*) local) == *((Event*) remote));
1174 } 1174 }
1175 else if ( local->typeID() == todoID ) 1175 else if ( local->typeID() == todoID )
1176 equ = (*((Todo*) local) == (*(Todo*) remote)); 1176 equ = (*((Todo*) local) == (*(Todo*) remote));
1177 else if ( local->typeID() == journalID ) 1177 else if ( local->typeID() == journalID )
1178 equ = (*((Journal*) local) == *((Journal*) remote)); 1178 equ = (*((Journal*) local) == *((Journal*) remote));
1179 if ( equ ) { 1179 if ( equ ) {
1180 //qDebug("equal "); 1180 //qDebug("equal ");
1181 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1181 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1182 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 1182 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
1183 } 1183 }
1184 if ( mode < SYNC_PREF_FORCE_LOCAL ) 1184 if ( mode < SYNC_PREF_FORCE_LOCAL )
1185 return 0; 1185 return 0;
1186 1186
1187 }//else //debug only 1187 }//else //debug only
1188 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 1188 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
1189 } 1189 }
1190 int result; 1190 int result;
1191 bool localIsNew; 1191 bool localIsNew;
1192 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , localMod.toString().latin1() , remoteMod.toString().latin1() ); 1192 //qDebug("%s -- %s mLastCalendarSync %s lastsync %s --- local %s remote %s ",local->summary().latin1(), remote->summary().latin1(),mLastCalendarSync.toString().latin1() ,lastSync.toString().latin1() , localMod.toString().latin1() , remoteMod.toString().latin1() );
1193 1193
1194 1194
1195 // ************************************************ 1195 // ************************************************
1196 // ************************************************ 1196 // ************************************************
1197 // ************************************************ 1197 // ************************************************
1198 // We may have that lastSync > remoteMod AND lastSync > localMod 1198 // We may have that lastSync > remoteMod AND lastSync > localMod
1199 // BUT remoteMod != localMod 1199 // BUT remoteMod != localMod
1200 1200
1201 1201
1202 if ( full && mode < SYNC_PREF_NEWEST ) 1202 if ( full && mode < SYNC_PREF_NEWEST )
1203 mode = SYNC_PREF_ASK; 1203 mode = SYNC_PREF_ASK;
1204 1204
1205 switch( mode ) { 1205 switch( mode ) {
1206 case SYNC_PREF_LOCAL: 1206 case SYNC_PREF_LOCAL:
1207 if ( lastSync > remoteMod ) 1207 if ( lastSync > remoteMod )
1208 return 1; 1208 return 1;
1209 if ( lastSync > localMod ) 1209 if ( lastSync > localMod )
1210 return 2; 1210 return 2;
1211 return 1; 1211 return 1;
1212 break; 1212 break;
1213 case SYNC_PREF_REMOTE: 1213 case SYNC_PREF_REMOTE:
1214 if ( lastSync > localMod ) 1214 if ( lastSync > localMod )
1215 return 2; 1215 return 2;
1216 if ( lastSync > remoteMod ) 1216 if ( lastSync > remoteMod )
1217 return 1; 1217 return 1;
1218 return 2; 1218 return 2;
1219 break; 1219 break;
1220 case SYNC_PREF_NEWEST: 1220 case SYNC_PREF_NEWEST:
1221 if ( localMod >= remoteMod ) 1221 if ( localMod >= remoteMod )
1222 return 1; 1222 return 1;
1223 else 1223 else
1224 return 2; 1224 return 2;
1225 break; 1225 break;
1226 case SYNC_PREF_ASK: 1226 case SYNC_PREF_ASK:
1227 qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 1227 qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
1228 if ( lastSync > remoteMod && lastSync > localMod) 1228 if ( lastSync > remoteMod && lastSync > localMod)
1229 return 0; 1229 return 0;
1230 if ( lastSync > remoteMod ) 1230 if ( lastSync > remoteMod )
1231 return 1; 1231 return 1;
1232 if ( lastSync > localMod ) 1232 if ( lastSync > localMod )
1233 return 2; 1233 return 2;
1234 qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 1234 qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
1235 localIsNew = localMod >= remoteMod; 1235 localIsNew = localMod >= remoteMod;
1236 if ( localIsNew ) 1236 if ( localIsNew )
1237 getEventViewerDialog()->setColorMode( 1 ); 1237 getEventViewerDialog()->setColorMode( 1 );
1238 else 1238 else
1239 getEventViewerDialog()->setColorMode( 2 ); 1239 getEventViewerDialog()->setColorMode( 2 );
1240 getEventViewerDialog()->setIncidence(local); 1240 getEventViewerDialog()->setIncidence(local);
1241 if ( localIsNew ) 1241 if ( localIsNew )
1242 getEventViewerDialog()->setColorMode( 2 ); 1242 getEventViewerDialog()->setColorMode( 2 );
1243 else 1243 else
1244 getEventViewerDialog()->setColorMode( 1 ); 1244 getEventViewerDialog()->setColorMode( 1 );
1245 getEventViewerDialog()->addIncidence(remote); 1245 getEventViewerDialog()->addIncidence(remote);
1246 getEventViewerDialog()->setColorMode( 0 ); 1246 getEventViewerDialog()->setColorMode( 0 );
1247 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() ); 1247 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() );
1248 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!")); 1248 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!"));
1249 getEventViewerDialog()->showMe(); 1249 getEventViewerDialog()->showMe();
1250 result = getEventViewerDialog()->executeS( localIsNew ); 1250 result = getEventViewerDialog()->executeS( localIsNew );
1251 return result; 1251 return result;
1252 1252
1253 break; 1253 break;
1254 case SYNC_PREF_FORCE_LOCAL: 1254 case SYNC_PREF_FORCE_LOCAL:
1255 return 1; 1255 return 1;
1256 break; 1256 break;
1257 case SYNC_PREF_FORCE_REMOTE: 1257 case SYNC_PREF_FORCE_REMOTE:
1258 return 2; 1258 return 2;
1259 break; 1259 break;
1260 1260
1261 default: 1261 default:
1262 // SYNC_PREF_TAKE_BOTH not implemented 1262 // SYNC_PREF_TAKE_BOTH not implemented
1263 break; 1263 break;
1264 } 1264 }
1265 return 0; 1265 return 0;
1266} 1266}
1267Event* CalendarView::getLastSyncEvent() 1267Event* CalendarView::getLastSyncEvent()
1268{ 1268{
1269 Event* lse; 1269 Event* lse;
1270 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 1270 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
1271 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice ); 1271 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice );
1272 if (!lse) { 1272 if (!lse) {
1273 lse = new Event(); 1273 lse = new Event();
1274 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); 1274 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice );
1275 QString sum = ""; 1275 QString sum = "";
1276 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) 1276 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) )
1277 sum = "E: "; 1277 sum = "E: ";
1278 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); 1278 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event"));
1279 lse->setDtStart( mLastCalendarSync ); 1279 lse->setDtStart( mLastCalendarSync );
1280 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1280 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1281 lse->setCategories( i18n("SyncEvent") ); 1281 lse->setCategories( i18n("SyncEvent") );
1282 lse->setReadOnly( true ); 1282 lse->setReadOnly( true );
1283 mCalendar->addEvent( lse ); 1283 mCalendar->addEvent( lse );
1284 } 1284 }
1285 1285
1286 return lse; 1286 return lse;
1287 1287
1288} 1288}
1289 1289
1290// we check, if the to delete event has a id for a profile 1290// we check, if the to delete event has a id for a profile
1291// if yes, we set this id in the profile to delete 1291// if yes, we set this id in the profile to delete
1292void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) 1292void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
1293{ 1293{
1294 if ( lastSync.count() == 0 ) { 1294 if ( lastSync.count() == 0 ) {
1295 //qDebug(" lastSync.count() == 0"); 1295 //qDebug(" lastSync.count() == 0");
1296 return; 1296 return;
1297 } 1297 }
1298 if ( toDelete->typeID() == journalID ) 1298 if ( toDelete->typeID() == journalID )
1299 return; 1299 return;
1300 1300
1301 Event* eve = lastSync.first(); 1301 Event* eve = lastSync.first();
1302 1302
1303 while ( eve ) { 1303 while ( eve ) {
1304 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name 1304 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
1305 if ( !id.isEmpty() ) { 1305 if ( !id.isEmpty() ) {
1306 QString des = eve->description(); 1306 QString des = eve->description();
1307 QString pref = "e"; 1307 QString pref = "e";
1308 if ( toDelete->typeID() == todoID ) 1308 if ( toDelete->typeID() == todoID )
1309 pref = "t"; 1309 pref = "t";
1310 des += pref+ id + ","; 1310 des += pref+ id + ",";
1311 eve->setReadOnly( false ); 1311 eve->setReadOnly( false );
1312 eve->setDescription( des ); 1312 eve->setDescription( des );
1313 //qDebug("setdes %s ", des.latin1()); 1313 //qDebug("setdes %s ", des.latin1());
1314 eve->setReadOnly( true ); 1314 eve->setReadOnly( true );
1315 } 1315 }
1316 eve = lastSync.next(); 1316 eve = lastSync.next();
1317 } 1317 }
1318 1318
1319} 1319}
1320void CalendarView::checkExternalId( Incidence * inc ) 1320void CalendarView::checkExternalId( Incidence * inc )
1321{ 1321{
1322 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; 1322 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
1323 checkExternSyncEvent( lastSync, inc ); 1323 checkExternSyncEvent( lastSync, inc );
1324 1324
1325} 1325}
1326bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) 1326bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
1327{ 1327{
1328 bool syncOK = true; 1328 bool syncOK = true;
1329 int addedEvent = 0; 1329 int addedEvent = 0;
1330 int addedEventR = 0; 1330 int addedEventR = 0;
1331 int deletedEventR = 0; 1331 int deletedEventR = 0;
1332 int deletedEventL = 0; 1332 int deletedEventL = 0;
1333 int changedLocal = 0; 1333 int changedLocal = 0;
1334 int changedRemote = 0; 1334 int changedRemote = 0;
1335 int filteredIN = 0; 1335 int filteredIN = 0;
1336 int filteredOUT = 0; 1336 int filteredOUT = 0;
1337 //QPtrList<Event> el = local->rawEvents(); 1337 //QPtrList<Event> el = local->rawEvents();
1338 Event* eventR; 1338 Event* eventR;
1339 QString uid; 1339 QString uid;
1340 int take; 1340 int take;
1341 Event* eventRSync; 1341 Event* eventRSync;
1342 Event* eventLSync; 1342 Event* eventLSync;
1343 clearAllViews(); 1343 clearAllViews();
1344 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 1344 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
1345 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 1345 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
1346 bool fullDateRange = false; 1346 bool fullDateRange = false;
1347 local->resetTempSyncStat(); 1347 local->resetTempSyncStat();
1348 mLastCalendarSync = QDateTime::currentDateTime(); 1348 mLastCalendarSync = QDateTime::currentDateTime();
1349 if ( mSyncManager->syncWithDesktop() ) { 1349 if ( mSyncManager->syncWithDesktop() ) {
1350 remote->resetPilotStat(1); 1350 remote->resetPilotStat(1);
1351 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 1351 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
1352 mLastCalendarSync = KSyncManager::mRequestedSyncEvent; 1352 mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
1353 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); 1353 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
1354 } else { 1354 } else {
1355 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); 1355 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
1356 } 1356 }
1357 } 1357 }
1358 QDateTime modifiedCalendar = mLastCalendarSync; 1358 QDateTime modifiedCalendar = mLastCalendarSync;
1359 eventLSync = getLastSyncEvent(); 1359 eventLSync = getLastSyncEvent();
1360 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 1360 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
1361 if ( eventR ) { 1361 if ( eventR ) {
1362 qDebug("last-syncEvent on remote found "); 1362 qDebug("last-syncEvent on remote found ");
1363 eventRSync = (Event*) eventR->clone(); 1363 eventRSync = (Event*) eventR->clone();
1364 remote->deleteEvent(eventR ); 1364 remote->deleteEvent(eventR );
1365 1365
1366 } else { 1366 } else {
1367 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { 1367 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
1368 eventRSync = (Event*)eventLSync->clone(); 1368 eventRSync = (Event*)eventLSync->clone();
1369 } else { 1369 } else {
1370 fullDateRange = true; 1370 fullDateRange = true;
1371 eventRSync = new Event(); 1371 eventRSync = new Event();
1372 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 1372 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
1373 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 1373 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
1374 eventRSync->setDtStart( mLastCalendarSync ); 1374 eventRSync->setDtStart( mLastCalendarSync );
1375 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1375 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1376 eventRSync->setCategories( i18n("SyncEvent") ); 1376 eventRSync->setCategories( i18n("SyncEvent") );
1377 } 1377 }
1378 } 1378 }
1379 if ( eventLSync->dtStart() == mLastCalendarSync ) 1379 if ( eventLSync->dtStart() == mLastCalendarSync )
1380 fullDateRange = true; 1380 fullDateRange = true;
1381 1381
1382 if ( ! fullDateRange ) { 1382 if ( ! fullDateRange ) {
1383 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 1383 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
1384 1384
1385 qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 1385 qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
1386 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 1386 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
1387 fullDateRange = true; 1387 fullDateRange = true;
1388 } 1388 }
1389 } 1389 }
1390 if ( mSyncManager->syncWithDesktop() ) { 1390 if ( mSyncManager->syncWithDesktop() ) {
1391 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); 1391 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync );
1392 } 1392 }
1393 if ( fullDateRange ) 1393 if ( fullDateRange )
1394 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 1394 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
1395 else 1395 else
1396 mLastCalendarSync = eventLSync->dtStart(); 1396 mLastCalendarSync = eventLSync->dtStart();
1397 // for resyncing if own file has changed 1397 // for resyncing if own file has changed
1398 if ( mCurrentSyncDevice == "deleteaftersync" ) { 1398 if ( mCurrentSyncDevice == "deleteaftersync" ) {
1399 mLastCalendarSync = loadedFileVersion; 1399 mLastCalendarSync = loadedFileVersion;
1400 //qDebug("setting mLastCalendarSync "); 1400 //qDebug("setting mLastCalendarSync ");
1401 } 1401 }
1402 //qDebug("*************************** "); 1402 //qDebug("*************************** ");
1403 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 1403 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
1404 QPtrList<Incidence> er = remote->rawIncidences(); 1404 QPtrList<Incidence> er = remote->rawIncidences();
1405 Incidence* inR = er.first(); 1405 Incidence* inR = er.first();
1406 Incidence* inL; 1406 Incidence* inL;
1407 QProgressBar bar( er.count(),0 ); 1407 QProgressBar bar( er.count(),0 );
1408 bar.setCaption (i18n("Syncing - close to abort!") ); 1408 bar.setCaption (i18n("Syncing - close to abort!") );
1409 1409
1410 // ************** setting up filter ************* 1410 // ************** setting up filter *************
1411 CalFilter *filterIN = 0; 1411 CalFilter *filterIN = 0;
1412 CalFilter *filterOUT = 0; 1412 CalFilter *filterOUT = 0;
1413 CalFilter *filter = mFilters.first(); 1413 CalFilter *filter = mFilters.first();
1414 while(filter) { 1414 while(filter) {
1415 if ( filter->name() == mSyncManager->mFilterInCal ) 1415 if ( filter->name() == mSyncManager->mFilterInCal )
1416 filterIN = filter; 1416 filterIN = filter;
1417 if ( filter->name() == mSyncManager->mFilterOutCal ) 1417 if ( filter->name() == mSyncManager->mFilterOutCal )
1418 filterOUT = filter; 1418 filterOUT = filter;
1419 filter = mFilters.next(); 1419 filter = mFilters.next();
1420 } 1420 }
1421 int w = 300; 1421 int w = 300;
1422 if ( QApplication::desktop()->width() < 320 ) 1422 if ( QApplication::desktop()->width() < 320 )
1423 w = 220; 1423 w = 220;
1424 int h = bar.sizeHint().height() ; 1424 int h = bar.sizeHint().height() ;
1425 int dw = QApplication::desktop()->width(); 1425 int dw = QApplication::desktop()->width();
1426 int dh = QApplication::desktop()->height(); 1426 int dh = QApplication::desktop()->height();
1427 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1427 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1428 bar.show(); 1428 bar.show();
1429 int modulo = (er.count()/10)+1; 1429 int modulo = (er.count()/10)+1;
1430 int incCounter = 0; 1430 int incCounter = 0;
1431 while ( inR ) { 1431 while ( inR ) {
1432 if ( ! bar.isVisible() ) 1432 if ( ! bar.isVisible() )
1433 return false; 1433 return false;
1434 if ( incCounter % modulo == 0 ) 1434 if ( incCounter % modulo == 0 )
1435 bar.setProgress( incCounter ); 1435 bar.setProgress( incCounter );
1436 ++incCounter; 1436 ++incCounter;
1437 uid = inR->uid(); 1437 uid = inR->uid();
1438 bool skipIncidence = false; 1438 bool skipIncidence = false;
1439 if ( uid.left(15) == QString("last-syncEvent-") ) 1439 if ( uid.left(15) == QString("last-syncEvent-") )
1440 skipIncidence = true; 1440 skipIncidence = true;
1441 QString idS; 1441 QString idS;
1442 qApp->processEvents(); 1442 qApp->processEvents();
1443 if ( !skipIncidence ) { 1443 if ( !skipIncidence ) {
1444 inL = local->incidenceForUid( uid , false ); 1444 inL = local->incidenceForUid( uid , false );
1445 if ( inL ) { // maybe conflict - same uid in both calendars 1445 if ( inL ) { // maybe conflict - same uid in both calendars
1446 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { 1446 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
1447 //qDebug("take %d %s ", take, inL->summary().latin1()); 1447 //qDebug("take %d %s ", take, inL->summary().latin1());
1448 if ( take == 3 ) 1448 if ( take == 3 )
1449 return false; 1449 return false;
1450 if ( take == 1 ) {// take local ********************** 1450 if ( take == 1 ) {// take local **********************
1451 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 1451 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
1452 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1452 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1453 else 1453 else
1454 idS = inR->IDStr(); 1454 idS = inR->IDStr();
1455 int calID = inR->calID(); 1455 int calID = inR->calID();
1456 remote->deleteIncidence( inR ); 1456 remote->deleteIncidence( inR );
1457 inR = inL->clone(); 1457 inR = inL->clone();
1458 inR->setCalID( calID ); 1458 inR->setCalID( calID );
1459 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1459 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1460 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1460 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1461 inR->setIDStr( idS ); 1461 inR->setIDStr( idS );
1462 remote->addIncidence( inR ); 1462 remote->addIncidence( inR );
1463 if ( mSyncManager->syncWithDesktop() ) 1463 if ( mSyncManager->syncWithDesktop() )
1464 inR->setPilotId( 2 ); 1464 inR->setPilotId( 2 );
1465 ++changedRemote; 1465 ++changedRemote;
1466 } else {// take remote ********************** 1466 } else {// take remote **********************
1467 if ( !inL->isReadOnly() ) { 1467 if ( !inL->isReadOnly() ) {
1468 idS = inL->IDStr(); 1468 idS = inL->IDStr();
1469 int pid = inL->pilotId(); 1469 int pid = inL->pilotId();
1470 int calID = inL->calID(); 1470 int calID = inL->calID();
1471 local->deleteIncidence( inL ); 1471 local->deleteIncidence( inL );
1472 inL = inR->clone(); 1472 inL = inR->clone();
1473 inL->setCalID( calID ); 1473 inL->setCalID( calID );
1474 if ( mSyncManager->syncWithDesktop() ) 1474 if ( mSyncManager->syncWithDesktop() )
1475 inL->setPilotId( pid ); 1475 inL->setPilotId( pid );
1476 inL->setIDStr( idS ); 1476 inL->setIDStr( idS );
1477 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1477 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1478 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1478 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1479 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1479 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1480 } 1480 }
1481 local->addIncidence( inL ); 1481 local->addIncidence( inL );
1482 ++changedLocal; 1482 ++changedLocal;
1483 } 1483 }
1484 } 1484 }
1485 } 1485 }
1486 } else { // no conflict ********** add or delete remote 1486 } else { // no conflict ********** add or delete remote
1487 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ 1487 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){
1488 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1488 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1489 QString des = eventLSync->description(); 1489 QString des = eventLSync->description();
1490 QString pref = "e"; 1490 QString pref = "e";
1491 if ( inR->typeID() == todoID ) 1491 if ( inR->typeID() == todoID )
1492 pref = "t"; 1492 pref = "t";
1493 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1493 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1494 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1494 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1495 //remote->deleteIncidence( inR ); 1495 //remote->deleteIncidence( inR );
1496 ++deletedEventR; 1496 ++deletedEventR;
1497 } else { 1497 } else {
1498 inR->setLastModified( modifiedCalendar ); 1498 inR->setLastModified( modifiedCalendar );
1499 inL = inR->clone(); 1499 inL = inR->clone();
1500 inL->setIDStr( ":" ); 1500 inL->setIDStr( ":" );
1501 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1501 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1502 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1502 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1503 1503
1504 inL->setCalID( 0 );// add to default cal 1504 inL->setCalID( 0 );// add to default cal
1505 local->addIncidence( inL ); 1505 local->addIncidence( inL );
1506 ++addedEvent; 1506 ++addedEvent;
1507 1507
1508 } 1508 }
1509 } else { 1509 } else {
1510 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1510 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1511 inR->setLastModified( modifiedCalendar ); 1511 inR->setLastModified( modifiedCalendar );
1512 inL = inR->clone(); 1512 inL = inR->clone();
1513 inL->setIDStr( ":" ); 1513 inL->setIDStr( ":" );
1514 inL->setCalID( 0 );// add to default cal 1514 inL->setCalID( 0 );// add to default cal
1515 local->addIncidence( inL ); 1515 local->addIncidence( inL );
1516 ++addedEvent; 1516 ++addedEvent;
1517 1517
1518 } else { 1518 } else {
1519 checkExternSyncEvent(eventRSyncSharp, inR); 1519 checkExternSyncEvent(eventRSyncSharp, inR);
1520 remote->deleteIncidence( inR ); 1520 remote->deleteIncidence( inR );
1521 ++deletedEventR; 1521 ++deletedEventR;
1522 } 1522 }
1523 } 1523 }
1524 } else { 1524 } else {
1525 ++filteredIN; 1525 ++filteredIN;
1526 } 1526 }
1527 } 1527 }
1528 } 1528 }
1529 inR = er.next(); 1529 inR = er.next();
1530 } 1530 }
1531 QPtrList<Incidence> el = local->rawIncidences(); 1531 QPtrList<Incidence> el = local->rawIncidences();
1532 inL = el.first(); 1532 inL = el.first();
1533 modulo = (el.count()/10)+1; 1533 modulo = (el.count()/10)+1;
1534 bar.setCaption (i18n("Add / remove events") ); 1534 bar.setCaption (i18n("Add / remove events") );
1535 bar.setTotalSteps ( el.count() ) ; 1535 bar.setTotalSteps ( el.count() ) ;
1536 bar.show(); 1536 bar.show();
1537 incCounter = 0; 1537 incCounter = 0;
1538 1538
1539 while ( inL ) { 1539 while ( inL ) {
1540 1540
1541 qApp->processEvents(); 1541 qApp->processEvents();
1542 if ( ! bar.isVisible() ) 1542 if ( ! bar.isVisible() )
1543 return false; 1543 return false;
1544 if ( incCounter % modulo == 0 ) 1544 if ( incCounter % modulo == 0 )
1545 bar.setProgress( incCounter ); 1545 bar.setProgress( incCounter );
1546 ++incCounter; 1546 ++incCounter;
1547 uid = inL->uid(); 1547 uid = inL->uid();
1548 bool skipIncidence = false; 1548 bool skipIncidence = false;
1549 if ( uid.left(15) == QString("last-syncEvent-") ) 1549 if ( uid.left(15) == QString("last-syncEvent-") )
1550 skipIncidence = true; 1550 skipIncidence = true;
1551 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) 1551 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
1552 skipIncidence = true; 1552 skipIncidence = true;
1553 if ( !skipIncidence ) { 1553 if ( !skipIncidence ) {
1554 inR = remote->incidenceForUid( uid , true ); 1554 inR = remote->incidenceForUid( uid , true );
1555 if ( ! inR ) { 1555 if ( ! inR ) {
1556 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ 1556 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
1557 // no conflict ********** add or delete local 1557 // no conflict ********** add or delete local
1558 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1558 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1559 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1559 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1560 checkExternSyncEvent(eventLSyncSharp, inL); 1560 checkExternSyncEvent(eventLSyncSharp, inL);
1561 local->deleteIncidence( inL ); 1561 local->deleteIncidence( inL );
1562 ++deletedEventL; 1562 ++deletedEventL;
1563 } else { 1563 } else {
1564 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1564 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1565 inL->removeID(mCurrentSyncDevice ); 1565 inL->removeID(mCurrentSyncDevice );
1566 ++addedEventR; 1566 ++addedEventR;
1567 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1567 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1568 inL->setLastModified( modifiedCalendar ); 1568 inL->setLastModified( modifiedCalendar );
1569 inR = inL->clone(); 1569 inR = inL->clone();
1570 inR->setIDStr( ":" ); 1570 inR->setIDStr( ":" );
1571 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1571 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1572 inR->setCalID( 0 );// add to default cal 1572 inR->setCalID( 0 );// add to default cal
1573 remote->addIncidence( inR ); 1573 remote->addIncidence( inR );
1574 } 1574 }
1575 } 1575 }
1576 } else { 1576 } else {
1577 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1577 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1578 checkExternSyncEvent(eventLSyncSharp, inL); 1578 checkExternSyncEvent(eventLSyncSharp, inL);
1579 local->deleteIncidence( inL ); 1579 local->deleteIncidence( inL );
1580 ++deletedEventL; 1580 ++deletedEventL;
1581 } else { 1581 } else {
1582 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1582 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1583 ++addedEventR; 1583 ++addedEventR;
1584 inL->setLastModified( modifiedCalendar ); 1584 inL->setLastModified( modifiedCalendar );
1585 inR = inL->clone(); 1585 inR = inL->clone();
1586 inR->setIDStr( ":" ); 1586 inR->setIDStr( ":" );
1587 inR->setCalID( 0 );// add to default cal 1587 inR->setCalID( 0 );// add to default cal
1588 remote->addIncidence( inR ); 1588 remote->addIncidence( inR );
1589 } 1589 }
1590 } 1590 }
1591 } 1591 }
1592 } else { 1592 } else {
1593 ++filteredOUT; 1593 ++filteredOUT;
1594 } 1594 }
1595 } 1595 }
1596 } 1596 }
1597 inL = el.next(); 1597 inL = el.next();
1598 } 1598 }
1599 int delFut = 0; 1599 int delFut = 0;
1600 int remRem = 0; 1600 int remRem = 0;
1601 if ( mSyncManager->mWriteBackInFuture ) { 1601 if ( mSyncManager->mWriteBackInFuture ) {
1602 er = remote->rawIncidences(); 1602 er = remote->rawIncidences();
1603 remRem = er.count(); 1603 remRem = er.count();
1604 inR = er.first(); 1604 inR = er.first();
1605 QDateTime dt; 1605 QDateTime dt;
1606 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); 1606 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) );
1607 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); 1607 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 );
1608 while ( inR ) { 1608 while ( inR ) {
1609 if ( inR->typeID() == todoID ) { 1609 if ( inR->typeID() == todoID ) {
1610 Todo * t = (Todo*)inR; 1610 Todo * t = (Todo*)inR;
1611 if ( t->hasDueDate() ) 1611 if ( t->hasDueDate() )
1612 dt = t->dtDue(); 1612 dt = t->dtDue();
1613 else 1613 else
1614 dt = cur.addSecs( 62 ); 1614 dt = cur.addSecs( 62 );
1615 } 1615 }
1616 else if (inR->typeID() == eventID ) { 1616 else if (inR->typeID() == eventID ) {
1617 bool ok; 1617 bool ok;
1618 dt = inR->getNextOccurence( cur, &ok ); 1618 dt = inR->getNextOccurence( cur, &ok );
1619 if ( !ok ) 1619 if ( !ok )
1620 dt = cur.addSecs( -62 ); 1620 dt = cur.addSecs( -62 );
1621 } 1621 }
1622 else 1622 else
1623 dt = inR->dtStart(); 1623 dt = inR->dtStart();
1624 if ( dt < cur || dt > end ) { 1624 if ( dt < cur || dt > end ) {
1625 remote->deleteIncidence( inR ); 1625 remote->deleteIncidence( inR );
1626 ++delFut; 1626 ++delFut;
1627 } 1627 }
1628 inR = er.next(); 1628 inR = er.next();
1629 } 1629 }
1630 } 1630 }
1631 bar.hide(); 1631 bar.hide();
1632 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1632 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1633 eventLSync->setReadOnly( false ); 1633 eventLSync->setReadOnly( false );
1634 eventLSync->setDtStart( mLastCalendarSync ); 1634 eventLSync->setDtStart( mLastCalendarSync );
1635 eventRSync->setDtStart( mLastCalendarSync ); 1635 eventRSync->setDtStart( mLastCalendarSync );
1636 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1636 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1637 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1637 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1638 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1638 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1639 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1639 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1640 eventLSync->setReadOnly( true ); 1640 eventLSync->setReadOnly( true );
1641 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL ); 1641 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL );
1642 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1642 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1643 remote->addEvent( eventRSync ); 1643 remote->addEvent( eventRSync );
1644 else 1644 else
1645 delete eventRSync; 1645 delete eventRSync;
1646 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() ); 1646 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() );
1647 QString mes; 1647 QString mes;
1648 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 ); 1648 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 );
1649 QString delmess; 1649 QString delmess;
1650 if ( delFut ) { 1650 if ( delFut ) {
1651 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); 1651 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);
1652 mes += delmess; 1652 mes += delmess;
1653 } 1653 }
1654 mes = i18n("Local calendar changed!\n") +mes; 1654 mes = i18n("Local calendar changed!\n") +mes;
1655 mCalendar->checkAlarmForIncidence( 0, true ); 1655 mCalendar->checkAlarmForIncidence( 0, true );
1656 qDebug( mes ); 1656 qDebug( mes );
1657 if ( mSyncManager->mShowSyncSummary ) { 1657 if ( mSyncManager->mShowSyncSummary ) {
1658 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1658 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1659 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1659 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1660 qDebug("KO: WB cancelled "); 1660 qDebug("KO: WB cancelled ");
1661 mSyncManager->mWriteBackFile = false; 1661 mSyncManager->mWriteBackFile = false;
1662 return syncOK; 1662 return syncOK;
1663 } 1663 }
1664 } 1664 }
1665 return syncOK; 1665 return syncOK;
1666} 1666}
1667 1667
1668void CalendarView::setSyncDevice( QString s ) 1668void CalendarView::setSyncDevice( QString s )
1669{ 1669{
1670 mCurrentSyncDevice= s; 1670 mCurrentSyncDevice= s;
1671} 1671}
1672void CalendarView::setSyncName( QString s ) 1672void CalendarView::setSyncName( QString s )
1673{ 1673{
1674 mCurrentSyncName= s; 1674 mCurrentSyncName= s;
1675} 1675}
1676bool CalendarView::syncCalendar(QString filename, int mode) 1676bool CalendarView::syncCalendar(QString filename, int mode)
1677{ 1677{
1678 //qDebug("syncCalendar %s ", filename.latin1()); 1678 //qDebug("syncCalendar %s ", filename.latin1());
1679 mGlobalSyncMode = SYNC_MODE_NORMAL; 1679 mGlobalSyncMode = SYNC_MODE_NORMAL;
1680 CalendarLocal* calendar = new CalendarLocal(); 1680 CalendarLocal* calendar = new CalendarLocal();
1681 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1681 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1682 FileStorage* storage = new FileStorage( calendar ); 1682 FileStorage* storage = new FileStorage( calendar );
1683 bool syncOK = false; 1683 bool syncOK = false;
1684 storage->setFileName( filename ); 1684 storage->setFileName( filename );
1685 // qDebug("loading ... "); 1685 // qDebug("loading ... ");
1686 if ( storage->load() ) { 1686 if ( storage->load() ) {
1687 getEventViewerDialog()->setSyncMode( true ); 1687 getEventViewerDialog()->setSyncMode( true );
1688 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1688 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1689 getEventViewerDialog()->setSyncMode( false ); 1689 getEventViewerDialog()->setSyncMode( false );
1690 if ( syncOK ) { 1690 if ( syncOK ) {
1691 if ( mSyncManager->mWriteBackFile ) 1691 if ( mSyncManager->mWriteBackFile )
1692 { 1692 {
1693 storage->setSaveFormat( new ICalFormat() ); 1693 storage->setSaveFormat( new ICalFormat() );
1694 storage->save(); 1694 storage->save();
1695 } 1695 }
1696 } 1696 }
1697 setModified( true ); 1697 setModified( true );
1698 } 1698 }
1699 delete storage; 1699 delete storage;
1700 delete calendar; 1700 delete calendar;
1701 if ( syncOK ) 1701 if ( syncOK )
1702 updateView(); 1702 updateView();
1703 return syncOK; 1703 return syncOK;
1704} 1704}
1705 1705
1706void CalendarView::syncExternal( int mode ) 1706void CalendarView::syncExternal( int mode )
1707{ 1707{
1708 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1708 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1709 1709
1710 qApp->processEvents(); 1710 qApp->processEvents();
1711 CalendarLocal* calendar = new CalendarLocal(); 1711 CalendarLocal* calendar = new CalendarLocal();
1712 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1712 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1713 bool syncOK = false; 1713 bool syncOK = false;
1714 bool loadSuccess = false; 1714 bool loadSuccess = false;
1715 PhoneFormat* phoneFormat = 0; 1715 PhoneFormat* phoneFormat = 0;
1716 emit tempDisableBR(true); 1716 emit tempDisableBR(true);
1717#ifndef DESKTOP_VERSION 1717#ifndef DESKTOP_VERSION
1718 SharpFormat* sharpFormat = 0; 1718 SharpFormat* sharpFormat = 0;
1719 if ( mode == 0 ) { // sharp 1719 if ( mode == 0 ) { // sharp
1720 sharpFormat = new SharpFormat () ; 1720 sharpFormat = new SharpFormat () ;
1721 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1721 loadSuccess = sharpFormat->load( calendar, mCalendar );
1722 1722
1723 } else 1723 } else
1724#endif 1724#endif
1725 if ( mode == 1 ) { // phone 1725 if ( mode == 1 ) { // phone
1726 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1726 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1727 mSyncManager->mPhoneDevice, 1727 mSyncManager->mPhoneDevice,
1728 mSyncManager->mPhoneConnection, 1728 mSyncManager->mPhoneConnection,
1729 mSyncManager->mPhoneModel); 1729 mSyncManager->mPhoneModel);
1730 loadSuccess = phoneFormat->load( calendar,mCalendar); 1730 loadSuccess = phoneFormat->load( calendar,mCalendar);
1731 1731
1732 } else { 1732 } else {
1733 emit tempDisableBR(false); 1733 emit tempDisableBR(false);
1734 return; 1734 return;
1735 } 1735 }
1736 if ( loadSuccess ) { 1736 if ( loadSuccess ) {
1737 getEventViewerDialog()->setSyncMode( true ); 1737 getEventViewerDialog()->setSyncMode( true );
1738 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1738 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1739 getEventViewerDialog()->setSyncMode( false ); 1739 getEventViewerDialog()->setSyncMode( false );
1740 qApp->processEvents(); 1740 qApp->processEvents();
1741 if ( syncOK ) { 1741 if ( syncOK ) {
1742 if ( mSyncManager->mWriteBackFile ) 1742 if ( mSyncManager->mWriteBackFile )
1743 { 1743 {
1744 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1744 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1745 Incidence* inc = iL.first(); 1745 Incidence* inc = iL.first();
1746 if ( phoneFormat ) { 1746 if ( phoneFormat ) {
1747 while ( inc ) { 1747 while ( inc ) {
1748 inc->removeID(mCurrentSyncDevice); 1748 inc->removeID(mCurrentSyncDevice);
1749 inc = iL.next(); 1749 inc = iL.next();
1750 } 1750 }
1751 } 1751 }
1752#ifndef DESKTOP_VERSION 1752#ifndef DESKTOP_VERSION
1753 if ( sharpFormat ) 1753 if ( sharpFormat )
1754 sharpFormat->save(calendar); 1754 sharpFormat->save(calendar);
1755#endif 1755#endif
1756 if ( phoneFormat ) 1756 if ( phoneFormat )
1757 phoneFormat->save(calendar); 1757 phoneFormat->save(calendar);
1758 iL = calendar->rawIncidences(); 1758 iL = calendar->rawIncidences();
1759 inc = iL.first(); 1759 inc = iL.first();
1760 Incidence* loc; 1760 Incidence* loc;
1761 while ( inc ) { 1761 while ( inc ) {
1762 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1762 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1763 loc = mCalendar->incidence(inc->uid() ); 1763 loc = mCalendar->incidence(inc->uid() );
1764 if ( loc ) { 1764 if ( loc ) {
1765 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1765 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1766 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1766 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1767 } 1767 }
1768 } 1768 }
1769 inc = iL.next(); 1769 inc = iL.next();
1770 } 1770 }
1771 Incidence* lse = getLastSyncEvent(); 1771 Incidence* lse = getLastSyncEvent();
1772 if ( lse ) { 1772 if ( lse ) {
1773 lse->setReadOnly( false ); 1773 lse->setReadOnly( false );
1774 lse->setDescription( "" ); 1774 lse->setDescription( "" );
1775 lse->setReadOnly( true ); 1775 lse->setReadOnly( true );
1776 } 1776 }
1777 } 1777 }
1778 } else { 1778 } else {
1779 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 1779 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
1780 } 1780 }
1781 setModified( true ); 1781 setModified( true );
1782 } else { 1782 } else {
1783 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1783 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1784 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1784 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1785 question, i18n("Ok")) ; 1785 question, i18n("Ok")) ;
1786 1786
1787 } 1787 }
1788 delete calendar; 1788 delete calendar;
1789 updateView(); 1789 updateView();
1790 emit tempDisableBR(false); 1790 emit tempDisableBR(false);
1791 return ;//syncOK; 1791 return ;//syncOK;
1792 1792
1793} 1793}
1794 1794
1795bool CalendarView::importBday() 1795bool CalendarView::importBday()
1796{ 1796{
1797#ifndef KORG_NOKABC 1797#ifndef KORG_NOKABC
1798 1798
1799#ifdef DESKTOP_VERSION 1799#ifdef DESKTOP_VERSION
1800 int curCal = mCalendar->defaultCalendar(); 1800 int curCal = mCalendar->defaultCalendar();
1801 int bd = mCalEditView->getBirtdayID(); 1801 int bd = mCalEditView->getBirtdayID();
1802 if ( bd == 0 ) 1802 if ( bd == 0 )
1803 return false; 1803 return false;
1804 mCalendar->setDefaultCalendar( bd ); 1804 mCalendar->setDefaultCalendar( bd );
1805 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1805 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1806 KABC::AddressBook::Iterator it; 1806 KABC::AddressBook::Iterator it;
1807 int count = 0; 1807 int count = 0;
1808 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1808 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1809 ++count; 1809 ++count;
1810 } 1810 }
1811 QProgressBar bar(count,0 ); 1811 QProgressBar bar(count,0 );
1812 int w = 300; 1812 int w = 300;
1813 if ( QApplication::desktop()->width() < 320 ) 1813 if ( QApplication::desktop()->width() < 320 )
1814 w = 220; 1814 w = 220;
1815 int h = bar.sizeHint().height() ; 1815 int h = bar.sizeHint().height() ;
1816 int dw = QApplication::desktop()->width(); 1816 int dw = QApplication::desktop()->width();
1817 int dh = QApplication::desktop()->height(); 1817 int dh = QApplication::desktop()->height();
1818 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1818 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1819 bar.show(); 1819 bar.show();
1820 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1820 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1821 qApp->processEvents(); 1821 qApp->processEvents();
1822 count = 0; 1822 count = 0;
1823 int addCount = 0; 1823 int addCount = 0;
1824 KCal::Attendee* a = 0; 1824 KCal::Attendee* a = 0;
1825 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1825 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1826 if ( ! bar.isVisible() ) 1826 if ( ! bar.isVisible() )
1827 return false; 1827 return false;
1828 bar.setProgress( count++ ); 1828 bar.setProgress( count++ );
1829 qApp->processEvents(); 1829 qApp->processEvents();
1830 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1830 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1831 if ( (*it).birthday().date().isValid() ){ 1831 if ( (*it).birthday().date().isValid() ){
1832 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1832 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1833 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1833 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1834 ++addCount; 1834 ++addCount;
1835 } 1835 }
1836 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1836 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1837 if ( anni.isValid() ){ 1837 if ( anni.isValid() ){
1838 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1838 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1839 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1839 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1840 ++addCount; 1840 ++addCount;
1841 } 1841 }
1842 } 1842 }
1843 mCalendar->setDefaultCalendar( curCal ); 1843 mCalendar->setDefaultCalendar( curCal );
1844 updateView(); 1844 updateView();
1845 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1845 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1846#else //DESKTOP_VERSION 1846#else //DESKTOP_VERSION
1847 1847
1848 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 1848 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
1849 // the result should now arrive through method insertBirthdays 1849 // the result should now arrive through method insertBirthdays
1850 1850
1851#endif //DESKTOP_VERSION 1851#endif //DESKTOP_VERSION
1852 1852
1853#endif //KORG_NOKABC 1853#endif //KORG_NOKABC
1854 1854
1855 1855
1856 return true; 1856 return true;
1857} 1857}
1858 1858
1859// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 1859// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
1860void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 1860void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
1861 const QStringList& anniversaryList, const QStringList& realNameList, 1861 const QStringList& anniversaryList, const QStringList& realNameList,
1862 const QStringList& emailList, const QStringList& assembledNameList, 1862 const QStringList& emailList, const QStringList& assembledNameList,
1863 const QStringList& uidList) 1863 const QStringList& uidList)
1864{ 1864{
1865 1865
1866 //qDebug("KO::CalendarView::insertBirthdays"); 1866 //qDebug("KO::CalendarView::insertBirthdays");
1867 if (uid == this->name()) 1867 if (uid == this->name())
1868 { 1868 {
1869 int curCal = mCalendar->defaultCalendar(); 1869 int curCal = mCalendar->defaultCalendar();
1870 int bd = mCalEditView->getBirtdayID(); 1870 int bd = mCalEditView->getBirtdayID();
1871 if ( bd == 0 ) 1871 if ( bd == 0 )
1872 return; 1872 return;
1873 mCalendar->setDefaultCalendar( bd ); 1873 mCalendar->setDefaultCalendar( bd );
1874 1874
1875 1875
1876 int count = birthdayList.count(); 1876 int count = birthdayList.count();
1877 int addCount = 0; 1877 int addCount = 0;
1878 KCal::Attendee* a = 0; 1878 KCal::Attendee* a = 0;
1879 1879
1880 //qDebug("CalView 1 %i", count); 1880 //qDebug("CalView 1 %i", count);
1881 1881
1882 QProgressBar bar(count,0 ); 1882 QProgressBar bar(count,0 );
1883 int w = 300; 1883 int w = 300;
1884 if ( QApplication::desktop()->width() < 320 ) 1884 if ( QApplication::desktop()->width() < 320 )
1885 w = 220; 1885 w = 220;
1886 int h = bar.sizeHint().height() ; 1886 int h = bar.sizeHint().height() ;
1887 int dw = QApplication::desktop()->width(); 1887 int dw = QApplication::desktop()->width();
1888 int dh = QApplication::desktop()->height(); 1888 int dh = QApplication::desktop()->height();
1889 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1889 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1890 bar.show(); 1890 bar.show();
1891 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 1891 bar.setCaption (i18n("inserting birthdays - close to abort!") );
1892 qApp->processEvents(); 1892 qApp->processEvents();
1893 1893
1894 QDate birthday; 1894 QDate birthday;
1895 QDate anniversary; 1895 QDate anniversary;
1896 QString realName; 1896 QString realName;
1897 QString email; 1897 QString email;
1898 QString assembledName; 1898 QString assembledName;
1899 QString uid; 1899 QString uid;
1900 bool ok = true; 1900 bool ok = true;
1901 for ( int i = 0; i < count; i++) 1901 for ( int i = 0; i < count; i++)
1902 { 1902 {
1903 if ( ! bar.isVisible() ) 1903 if ( ! bar.isVisible() )
1904 return; 1904 return;
1905 bar.setProgress( i ); 1905 bar.setProgress( i );
1906 qApp->processEvents(); 1906 qApp->processEvents();
1907 1907
1908 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 1908 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
1909 if (!ok) { 1909 if (!ok) {
1910 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 1910 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
1911 } 1911 }
1912 1912
1913 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 1913 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
1914 if (!ok) { 1914 if (!ok) {
1915 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 1915 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
1916 } 1916 }
1917 realName = realNameList[i]; 1917 realName = realNameList[i];
1918 email = emailList[i]; 1918 email = emailList[i];
1919 assembledName = assembledNameList[i]; 1919 assembledName = assembledNameList[i];
1920 uid = uidList[i]; 1920 uid = uidList[i];
1921 //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() ); 1921 //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() );
1922 1922
1923 if ( birthday.isValid() ){ 1923 if ( birthday.isValid() ){
1924 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1924 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1925 KCal::Attendee::ReqParticipant,uid) ; 1925 KCal::Attendee::ReqParticipant,uid) ;
1926 if ( addAnniversary( birthday, assembledName, a, true ) ) 1926 if ( addAnniversary( birthday, assembledName, a, true ) )
1927 ++addCount; 1927 ++addCount;
1928 } 1928 }
1929 1929
1930 if ( anniversary.isValid() ){ 1930 if ( anniversary.isValid() ){
1931 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1931 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1932 KCal::Attendee::ReqParticipant,uid) ; 1932 KCal::Attendee::ReqParticipant,uid) ;
1933 if ( addAnniversary( anniversary, assembledName, a, false ) ) 1933 if ( addAnniversary( anniversary, assembledName, a, false ) )
1934 ++addCount; 1934 ++addCount;
1935 } 1935 }
1936 } 1936 }
1937 1937
1938 mCalendar->setDefaultCalendar( curCal ); 1938 mCalendar->setDefaultCalendar( curCal );
1939 updateView(); 1939 updateView();
1940 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1940 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1941 1941
1942 } 1942 }
1943 1943
1944} 1944}
1945 1945
1946 1946
1947 1947
1948bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1948bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1949{ 1949{
1950 //qDebug("addAnni "); 1950 //qDebug("addAnni ");
1951 Event * ev = new Event(); 1951 Event * ev = new Event();
1952 ev->setOrganizer(KOPrefs::instance()->email()); 1952 ev->setOrganizer(KOPrefs::instance()->email());
1953 if ( a ) { 1953 if ( a ) {
1954 ev->addAttendee( a ); 1954 ev->addAttendee( a );
1955 } 1955 }
1956 QString kind; 1956 QString kind;
1957 if ( birthday ) { 1957 if ( birthday ) {
1958 kind = i18n( "Birthday" ); 1958 kind = i18n( "Birthday" );
1959 ev->setSummary( name + " (" + QString::number(date.year()) +")"); 1959 ev->setSummary( name + " (" + QString::number(date.year()) +")");
1960 } 1960 }
1961 else { 1961 else {
1962 kind = i18n( "Anniversary" ); 1962 kind = i18n( "Anniversary" );
1963 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); 1963 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
1964 } 1964 }
1965 ev->setCategories( kind ); 1965 ev->setCategories( kind );
1966 ev->setDtStart( QDateTime(date) ); 1966 ev->setDtStart( QDateTime(date) );
1967 ev->setDtEnd( QDateTime(date) ); 1967 ev->setDtEnd( QDateTime(date) );
1968 ev->setFloats( true ); 1968 ev->setFloats( true );
1969 Recurrence * rec = ev->recurrence(); 1969 Recurrence * rec = ev->recurrence();
1970 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1970 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1971 rec->addYearlyNum( date.month() ); 1971 rec->addYearlyNum( date.month() );
1972 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1972 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1973 delete ev; 1973 delete ev;
1974 return false; 1974 return false;
1975 } 1975 }
1976 return true; 1976 return true;
1977 1977
1978} 1978}
1979bool CalendarView::importQtopia( const QString &categories, 1979bool CalendarView::importQtopia( const QString &categories,
1980 const QString &datebook, 1980 const QString &datebook,
1981 const QString &todolist ) 1981 const QString &todolist )
1982{ 1982{
1983 1983
1984 QtopiaFormat qtopiaFormat; 1984 QtopiaFormat qtopiaFormat;
1985 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1985 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1986 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 1986 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1987 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 1987 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1988 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 1988 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1989 1989
1990 updateView(); 1990 updateView();
1991 return true; 1991 return true;
1992 1992
1993#if 0 1993#if 0
1994 mGlobalSyncMode = SYNC_MODE_QTOPIA; 1994 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1995 mCurrentSyncDevice = "qtopia-XML"; 1995 mCurrentSyncDevice = "qtopia-XML";
1996 if ( mSyncManager->mAskForPreferences ) 1996 if ( mSyncManager->mAskForPreferences )
1997 edit_sync_options(); 1997 edit_sync_options();
1998 qApp->processEvents(); 1998 qApp->processEvents();
1999 CalendarLocal* calendar = new CalendarLocal(); 1999 CalendarLocal* calendar = new CalendarLocal();
2000 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2000 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2001 bool syncOK = false; 2001 bool syncOK = false;
2002 QtopiaFormat qtopiaFormat; 2002 QtopiaFormat qtopiaFormat;
2003 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 2003 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
2004 bool loadOk = true; 2004 bool loadOk = true;
2005 if ( !categories.isEmpty() ) 2005 if ( !categories.isEmpty() )
2006 loadOk = qtopiaFormat.load( calendar, categories ); 2006 loadOk = qtopiaFormat.load( calendar, categories );
2007 if ( loadOk && !datebook.isEmpty() ) 2007 if ( loadOk && !datebook.isEmpty() )
2008 loadOk = qtopiaFormat.load( calendar, datebook ); 2008 loadOk = qtopiaFormat.load( calendar, datebook );
2009 if ( loadOk && !todolist.isEmpty() ) 2009 if ( loadOk && !todolist.isEmpty() )
2010 loadOk = qtopiaFormat.load( calendar, todolist ); 2010 loadOk = qtopiaFormat.load( calendar, todolist );
2011 2011
2012 if ( loadOk ) { 2012 if ( loadOk ) {
2013 getEventViewerDialog()->setSyncMode( true ); 2013 getEventViewerDialog()->setSyncMode( true );
2014 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 2014 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
2015 getEventViewerDialog()->setSyncMode( false ); 2015 getEventViewerDialog()->setSyncMode( false );
2016 qApp->processEvents(); 2016 qApp->processEvents();
2017 if ( syncOK ) { 2017 if ( syncOK ) {
2018 if ( mSyncManager->mWriteBackFile ) 2018 if ( mSyncManager->mWriteBackFile )
2019 { 2019 {
2020 // write back XML file 2020 // write back XML file
2021 2021
2022 } 2022 }
2023 setModified( true ); 2023 setModified( true );
2024 } 2024 }
2025 } else { 2025 } else {
2026 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 2026 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
2027 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 2027 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
2028 question, i18n("Ok")) ; 2028 question, i18n("Ok")) ;
2029 } 2029 }
2030 delete calendar; 2030 delete calendar;
2031 updateView(); 2031 updateView();
2032 return syncOK; 2032 return syncOK;
2033 2033
2034 2034
2035#endif 2035#endif
2036 2036
2037} 2037}
2038 2038
2039void CalendarView::setSyncEventsReadOnly() 2039void CalendarView::setSyncEventsReadOnly()
2040{ 2040{
2041 mCalendar->setSyncEventsReadOnly(); 2041 mCalendar->setSyncEventsReadOnly();
2042} 2042}
2043 2043
2044bool CalendarView::loadCalendars() 2044bool CalendarView::loadCalendars()
2045{ 2045{
2046 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2046 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2047 KopiCalendarFile * cal = calendars.first(); 2047 KopiCalendarFile * cal = calendars.first();
2048 mCalendar->setDefaultCalendar( 1 ); 2048 mCalendar->setDefaultCalendar( 1 );
2049 openCalendar( MainWindow::defaultFileName(), false ); 2049 openCalendar( MainWindow::defaultFileName(), false );
2050 cal = calendars.next(); 2050 cal = calendars.next();
2051 while ( cal ) { 2051 while ( cal ) {
2052 addCalendar( cal ); 2052 addCalendar( cal );
2053 cal = calendars.next(); 2053 cal = calendars.next();
2054 } 2054 }
2055 restoreCalendarSettings(); 2055 restoreCalendarSettings();
2056 return true; 2056 return true;
2057} 2057}
2058bool CalendarView::restoreCalendarSettings() 2058bool CalendarView::restoreCalendarSettings()
2059{ 2059{
2060 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2060 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2061 KopiCalendarFile * cal = calendars.first(); 2061 KopiCalendarFile * cal = calendars.first();
2062 while ( cal ) { 2062 while ( cal ) {
2063 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 2063 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
2064 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 2064 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
2065 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 2065 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
2066 if ( cal->isStandard ) 2066 if ( cal->isStandard )
2067 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2067 mCalendar->setDefaultCalendar( cal->mCalNumber );
2068 cal = calendars.next(); 2068 cal = calendars.next();
2069 } 2069 }
2070 setSyncEventsReadOnly(); 2070 setSyncEventsReadOnly();
2071 mCalendar->reInitAlarmSettings(); 2071 mCalendar->reInitAlarmSettings();
2072 updateUnmanagedViews(); 2072 updateUnmanagedViews();
2073 updateView(); 2073 updateView();
2074 return true; 2074 return true;
2075} 2075}
2076void CalendarView::addCalendarId( int id ) 2076void CalendarView::addCalendarId( int id )
2077{ 2077{
2078 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); 2078 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
2079 if ( cal ) 2079 if ( cal )
2080 addCalendar( cal ); 2080 addCalendar( cal );
2081} 2081}
2082bool CalendarView::addCalendar( KopiCalendarFile * cal ) 2082bool CalendarView::addCalendar( KopiCalendarFile * cal )
2083{ 2083{
2084 cal->mErrorOnLoad = false; 2084 cal->mErrorOnLoad = false;
2085 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { 2085 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) {
2086 cal->mLoadDt = QDateTime::currentDateTime(); 2086 cal->mLoadDt = QDateTime::currentDateTime();
2087 return true; 2087 return true;
2088 } 2088 }
2089 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() ); 2089 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() );
2090 cal->mErrorOnLoad = true; 2090 cal->mErrorOnLoad = true;
2091 return false; 2091 return false;
2092} 2092}
2093bool CalendarView::openCalendar(QString filename, bool merge) 2093bool CalendarView::openCalendar(QString filename, bool merge)
2094{ 2094{
2095 2095
2096 if (filename.isEmpty()) { 2096 if (filename.isEmpty()) {
2097 return false; 2097 return false;
2098 } 2098 }
2099 2099
2100 if (!QFile::exists(filename)) { 2100 if (!QFile::exists(filename)) {
2101 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 2101 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
2102 return false; 2102 return false;
2103 } 2103 }
2104 2104
2105 globalFlagBlockAgenda = 1; 2105 globalFlagBlockAgenda = 1;
2106 clearAllViews(); 2106 clearAllViews();
2107 if (!merge) { 2107 if (!merge) {
2108 mViewManager->setDocumentId( filename ); 2108 mViewManager->setDocumentId( filename );
2109 mCalendar->close(); 2109 mCalendar->close();
2110 } 2110 }
2111 mStorage->setFileName( filename ); 2111 mStorage->setFileName( filename );
2112 2112
2113 if ( mStorage->load() ) { 2113 if ( mStorage->load() ) {
2114 if ( merge ) ;//setModified( true ); 2114 if ( merge ) ;//setModified( true );
2115 else { 2115 else {
2116 //setModified( true ); 2116 //setModified( true );
2117 mViewManager->setDocumentId( filename ); 2117 mViewManager->setDocumentId( filename );
2118 mDialogManager->setDocumentId( filename ); 2118 mDialogManager->setDocumentId( filename );
2119 mTodoList->setDocumentId( filename ); 2119 mTodoList->setDocumentId( filename );
2120 } 2120 }
2121 globalFlagBlockAgenda = 2; 2121 globalFlagBlockAgenda = 2;
2122 // if ( getLastSyncEvent() ) 2122 // if ( getLastSyncEvent() )
2123 // getLastSyncEvent()->setReadOnly( true ); 2123 // getLastSyncEvent()->setReadOnly( true );
2124 mCalendar->reInitAlarmSettings(); 2124 mCalendar->reInitAlarmSettings();
2125 setSyncEventsReadOnly(); 2125 setSyncEventsReadOnly();
2126 updateUnmanagedViews(); 2126 updateUnmanagedViews();
2127 updateView(); 2127 updateView();
2128 if ( filename != MainWindow::defaultFileName() ) { 2128 if ( filename != MainWindow::defaultFileName() ) {
2129 saveCalendar( MainWindow::defaultFileName() ); 2129 saveCalendar( MainWindow::defaultFileName() );
2130 } else { 2130 } else {
2131 QFileInfo finf ( MainWindow::defaultFileName()); 2131 QFileInfo finf ( MainWindow::defaultFileName());
2132 if ( finf.exists() ) { 2132 if ( finf.exists() ) {
2133 setLoadedFileVersion( finf.lastModified () ); 2133 setLoadedFileVersion( finf.lastModified () );
2134 } 2134 }
2135 } 2135 }
2136 return true; 2136 return true;
2137 } else { 2137 } else {
2138 // while failing to load, the calendar object could 2138 // while failing to load, the calendar object could
2139 // have become partially populated. Clear it out. 2139 // have become partially populated. Clear it out.
2140 if ( !merge ) { 2140 if ( !merge ) {
2141 mCalendar->close(); 2141 mCalendar->close();
2142 mViewManager->setDocumentId( filename ); 2142 mViewManager->setDocumentId( filename );
2143 mDialogManager->setDocumentId( filename ); 2143 mDialogManager->setDocumentId( filename );
2144 mTodoList->setDocumentId( filename ); 2144 mTodoList->setDocumentId( filename );
2145 } 2145 }
2146 2146
2147 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 2147 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
2148 2148
2149 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 2149 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
2150 globalFlagBlockAgenda = 2; 2150 globalFlagBlockAgenda = 2;
2151 mCalendar->reInitAlarmSettings(); 2151 mCalendar->reInitAlarmSettings();
2152 setSyncEventsReadOnly(); 2152 setSyncEventsReadOnly();
2153 updateUnmanagedViews(); 2153 updateUnmanagedViews();
2154 updateView(); 2154 updateView();
2155 } 2155 }
2156 return false; 2156 return false;
2157} 2157}
2158void CalendarView::mergeFile( QString fn ) 2158void CalendarView::mergeFile( QString fn )
2159{ 2159{
2160 clearAllViews(); 2160 clearAllViews();
2161 mCalendar->mergeCalendarFile( fn ); 2161 mCalendar->mergeCalendarFile( fn );
2162 mCalendar->reInitAlarmSettings(); 2162 mCalendar->reInitAlarmSettings();
2163 setSyncEventsReadOnly(); 2163 setSyncEventsReadOnly();
2164 updateUnmanagedViews(); 2164 updateUnmanagedViews();
2165 updateView(); 2165 updateView();
2166} 2166}
2167void CalendarView::showOpenError() 2167void CalendarView::showOpenError()
2168{ 2168{
2169 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 2169 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
2170} 2170}
2171void CalendarView::setLoadedFileVersion(QDateTime dt) 2171void CalendarView::setLoadedFileVersion(QDateTime dt)
2172{ 2172{
2173 loadedFileVersion = dt; 2173 loadedFileVersion = dt;
2174} 2174}
2175bool CalendarView::checkFileChanged(QString fn) 2175bool CalendarView::checkFileChanged(QString fn)
2176{ 2176{
2177 QFileInfo finf ( fn ); 2177 QFileInfo finf ( fn );
2178 if ( !finf.exists() ) 2178 if ( !finf.exists() )
2179 return true; 2179 return true;
2180 QDateTime dt = finf.lastModified (); 2180 QDateTime dt = finf.lastModified ();
2181 if ( dt <= loadedFileVersion ) 2181 if ( dt <= loadedFileVersion )
2182 return false; 2182 return false;
2183 return true; 2183 return true;
2184 2184
2185} 2185}
2186void CalendarView::watchSavedFile() 2186void CalendarView::watchSavedFile()
2187{ 2187{
2188 QFileInfo finf ( MainWindow::defaultFileName()); 2188 QFileInfo finf ( MainWindow::defaultFileName());
2189 if ( !finf.exists() ) 2189 if ( !finf.exists() )
2190 return; 2190 return;
2191 QDateTime dt = finf.lastModified (); 2191 QDateTime dt = finf.lastModified ();
2192 if ( dt < loadedFileVersion ) { 2192 if ( dt < loadedFileVersion ) {
2193 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 2193 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
2194 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 2194 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
2195 return; 2195 return;
2196 } 2196 }
2197 loadedFileVersion = dt; 2197 loadedFileVersion = dt;
2198} 2198}
2199bool CalendarView::checkAllFileVersions() 2199bool CalendarView::checkAllFileVersions()
2200{ 2200{
2201 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2201 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2202 KopiCalendarFile * cal = calendars.first(); 2202 KopiCalendarFile * cal = calendars.first();
2203 mCalendar->setDefaultCalendar( 1 ); 2203 mCalendar->setDefaultCalendar( 1 );
2204 mCalendar->setDefaultCalendarEnabledOnly(); 2204 mCalendar->setDefaultCalendarEnabledOnly();
2205 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2205 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2206 if ( !checkFileVersion(MainWindow::defaultFileName())) { 2206 if ( !checkFileVersion(MainWindow::defaultFileName())) {
2207 restoreCalendarSettings(); 2207 restoreCalendarSettings();
2208 return false; 2208 return false;
2209 } 2209 }
2210 } 2210 }
2211 cal = calendars.next(); 2211 cal = calendars.next();
2212 QDateTime storeTemp = loadedFileVersion; 2212 QDateTime storeTemp = loadedFileVersion;
2213 while ( cal ) { 2213 while ( cal ) {
2214 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2214 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2215 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2215 mCalendar->setDefaultCalendar( cal->mCalNumber );
2216 mCalendar->setDefaultCalendarEnabledOnly(); 2216 mCalendar->setDefaultCalendarEnabledOnly();
2217 loadedFileVersion = cal->mLoadDt.addSecs( 15 ); 2217 loadedFileVersion = cal->mLoadDt.addSecs( 15 );
2218 if ( !checkFileVersion(cal->mFileName )) { 2218 if ( !checkFileVersion(cal->mFileName )) {
2219 loadedFileVersion = storeTemp; 2219 loadedFileVersion = storeTemp;
2220 restoreCalendarSettings(); 2220 restoreCalendarSettings();
2221 return false; 2221 return false;
2222 } 2222 }
2223 } 2223 }
2224 cal = calendars.next(); 2224 cal = calendars.next();
2225 } 2225 }
2226 loadedFileVersion = storeTemp; 2226 loadedFileVersion = storeTemp;
2227 return true; 2227 return true;
2228} 2228}
2229bool CalendarView::checkFileVersion(QString fn) 2229bool CalendarView::checkFileVersion(QString fn)
2230{ 2230{
2231 QFileInfo finf ( fn ); 2231 QFileInfo finf ( fn );
2232 if ( !finf.exists() ) 2232 if ( !finf.exists() )
2233 return true; 2233 return true;
2234 QDateTime dt = finf.lastModified (); 2234 QDateTime dt = finf.lastModified ();
2235 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); 2235 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1());
2236 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); 2236 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1());
2237 if ( dt <= loadedFileVersion ) 2237 if ( dt <= loadedFileVersion )
2238 return true; 2238 return true;
2239 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)) , 2239 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)) ,
2240 i18n("KO/Pi Warning"),i18n("Overwrite"), 2240 i18n("KO/Pi Warning"),i18n("Overwrite"),
2241 i18n("Sync+save")); 2241 i18n("Sync+save"));
2242 2242
2243 if ( km == KMessageBox::Cancel ) 2243 if ( km == KMessageBox::Cancel )
2244 return false; 2244 return false;
2245 if ( km == KMessageBox::Yes ) 2245 if ( km == KMessageBox::Yes )
2246 return true; 2246 return true;
2247 2247
2248 setSyncDevice("deleteaftersync" ); 2248 setSyncDevice("deleteaftersync" );
2249 mSyncManager->mAskForPreferences = true; 2249 mSyncManager->mAskForPreferences = true;
2250 mSyncManager->mSyncAlgoPrefs = 3; 2250 mSyncManager->mSyncAlgoPrefs = 3;
2251 mSyncManager->mWriteBackFile = false; 2251 mSyncManager->mWriteBackFile = false;
2252 mSyncManager->mWriteBackExistingOnly = false; 2252 mSyncManager->mWriteBackExistingOnly = false;
2253 mSyncManager->mShowSyncSummary = false; 2253 mSyncManager->mShowSyncSummary = false;
2254 syncCalendar( fn, 3 ); 2254 syncCalendar( fn, 3 );
2255 Event * e = getLastSyncEvent(); 2255 Event * e = getLastSyncEvent();
2256 if ( e ) 2256 if ( e )
2257 mCalendar->deleteEvent( e ); 2257 mCalendar->deleteEvent( e );
2258 return true; 2258 return true;
2259} 2259}
2260bool CalendarView::saveCalendars() 2260bool CalendarView::saveCalendars()
2261{ 2261{
2262 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2262 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2263 KopiCalendarFile * cal = calendars.first(); 2263 KopiCalendarFile * cal = calendars.first();
2264 mCalendar->setDefaultCalendar( 1 ); 2264 mCalendar->setDefaultCalendar( 1 );
2265 mCalendar->setDefaultCalendarEnabledOnly(); 2265 mCalendar->setDefaultCalendarEnabledOnly();
2266 saveCalendar( MainWindow::defaultFileName() ); 2266 saveCalendar( MainWindow::defaultFileName() );
2267 cal = calendars.next(); 2267 cal = calendars.next();
2268 while ( cal ) { 2268 while ( cal ) {
2269 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2269 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2270 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2270 mCalendar->setDefaultCalendar( cal->mCalNumber );
2271 mCalendar->setDefaultCalendarEnabledOnly(); 2271 mCalendar->setDefaultCalendarEnabledOnly();
2272 if ( saveCalendar( cal->mFileName ) ) 2272 if ( saveCalendar( cal->mFileName ) )
2273 cal->mLoadDt = QDateTime::currentDateTime(); 2273 cal->mLoadDt = QDateTime::currentDateTime();
2274 } 2274 }
2275 cal = calendars.next(); 2275 cal = calendars.next();
2276 } 2276 }
2277 restoreCalendarSettings(); 2277 restoreCalendarSettings();
2278 return true; 2278 return true;
2279} 2279}
2280bool CalendarView::saveCalendar( QString filename ) 2280bool CalendarView::saveCalendar( QString filename )
2281{ 2281{
2282 2282
2283 // Store back all unsaved data into calendar object 2283 // Store back all unsaved data into calendar object
2284 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 2284 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
2285 if ( mViewManager->currentView() ) 2285 if ( mViewManager->currentView() )
2286 mViewManager->currentView()->flushView(); 2286 mViewManager->currentView()->flushView();
2287 2287
2288 2288
2289 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 2289 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
2290 mStorage->setSaveFormat( new ICalFormat() ); 2290 mStorage->setSaveFormat( new ICalFormat() );
2291 mStorage->setFileName( filename ); 2291 mStorage->setFileName( filename );
2292 bool success; 2292 bool success;
2293 success = mStorage->save(); 2293 success = mStorage->save();
2294 if ( !success ) { 2294 if ( !success ) {
2295 return false; 2295 return false;
2296 } 2296 }
2297 if ( filename == MainWindow::defaultFileName() ) { 2297 if ( filename == MainWindow::defaultFileName() ) {
2298 setLoadedFileVersion( lfv ); 2298 setLoadedFileVersion( lfv );
2299 watchSavedFile(); 2299 watchSavedFile();
2300 } 2300 }
2301 return true; 2301 return true;
2302} 2302}
2303 2303
2304void CalendarView::closeCalendar() 2304void CalendarView::closeCalendar()
2305{ 2305{
2306 2306
2307 // child windows no longer valid 2307 // child windows no longer valid
2308 clearAllViews(); 2308 clearAllViews();
2309 emit closingDown(); 2309 emit closingDown();
2310 2310
2311 mCalendar->close(); 2311 mCalendar->close();
2312 setModified(false); 2312 setModified(false);
2313 updateView(); 2313 updateView();
2314} 2314}
2315 2315
2316void CalendarView::archiveCalendar() 2316void CalendarView::archiveCalendar()
2317{ 2317{
2318 mDialogManager->showArchiveDialog(); 2318 mDialogManager->showArchiveDialog();
2319} 2319}
2320 2320
2321 2321
2322void CalendarView::readSettings() 2322void CalendarView::readSettings()
2323{ 2323{
2324 2324
2325 2325
2326 // mViewManager->showAgendaView(); 2326 // mViewManager->showAgendaView();
2327 QString str; 2327 QString str;
2328 //qDebug("CalendarView::readSettings() "); 2328 //qDebug("CalendarView::readSettings() ");
2329 // read settings from the KConfig, supplying reasonable 2329 // read settings from the KConfig, supplying reasonable
2330 // defaults where none are to be found 2330 // defaults where none are to be found
2331 KConfig *config = KOGlobals::config(); 2331 KConfig *config = KOGlobals::config();
2332#ifndef KORG_NOSPLITTER 2332#ifndef KORG_NOSPLITTER
2333 config->setGroup("KOrganizer Geometry"); 2333 config->setGroup("KOrganizer Geometry");
2334 2334
2335 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2335 QValueList<int> sizes = config->readIntListEntry("Separator1");
2336 if (sizes.count() != 2) { 2336 if (sizes.count() != 2) {
2337 sizes << mDateNavigator->minimumSizeHint().width(); 2337 sizes << mDateNavigator->minimumSizeHint().width();
2338 sizes << 300; 2338 sizes << 300;
2339 } 2339 }
2340 mPanner->setSizes(sizes); 2340 mPanner->setSizes(sizes);
2341 2341
2342 sizes = config->readIntListEntry("Separator2"); 2342 sizes = config->readIntListEntry("Separator2");
2343 if ( ( mResourceView && sizes.count() == 4 ) || 2343 if ( ( mResourceView && sizes.count() == 4 ) ||
2344 ( !mResourceView && sizes.count() == 3 ) ) { 2344 ( !mResourceView && sizes.count() == 3 ) ) {
2345 mLeftSplitter->setSizes(sizes); 2345 mLeftSplitter->setSizes(sizes);
2346 } 2346 }
2347#endif 2347#endif
2348 globalFlagBlockAgenda = 1; 2348 globalFlagBlockAgenda = 1;
2349 mViewManager->showAgendaView(); 2349 mViewManager->showAgendaView();
2350 //mViewManager->readSettings( config ); 2350 //mViewManager->readSettings( config );
2351 mTodoList->restoreLayout(config,QString("Todo Layout")); 2351 mTodoList->restoreLayout(config,QString("Todo Layout"));
2352 readFilterSettings(config); 2352 readFilterSettings(config);
2353 2353
2354#ifdef DESKTOP_VERSION 2354#ifdef DESKTOP_VERSION
2355 config->setGroup("WidgetLayout"); 2355 config->setGroup("WidgetLayout");
2356 QStringList list; 2356 QStringList list;
2357 list = config->readListEntry("MainLayout"); 2357 list = config->readListEntry("MainLayout");
2358 int x,y,w,h; 2358 int x,y,w,h;
2359 if ( ! list.isEmpty() ) { 2359 if ( ! list.isEmpty() ) {
2360 x = list[0].toInt(); 2360 x = list[0].toInt();
2361 y = list[1].toInt(); 2361 y = list[1].toInt();
2362 w = list[2].toInt(); 2362 w = list[2].toInt();
2363 h = list[3].toInt(); 2363 h = list[3].toInt();
2364 KApplication::testCoords( &x,&y,&w,&h ); 2364 KApplication::testCoords( &x,&y,&w,&h );
2365 topLevelWidget()->setGeometry(x,y,w,h); 2365 topLevelWidget()->setGeometry(x,y,w,h);
2366 2366
2367 } else { 2367 } else {
2368 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 2368 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
2369 } 2369 }
2370 list = config->readListEntry("EditEventLayout"); 2370 list = config->readListEntry("EditEventLayout");
2371 if ( ! list.isEmpty() ) { 2371 if ( ! list.isEmpty() ) {
2372 x = list[0].toInt(); 2372 x = list[0].toInt();
2373 y = list[1].toInt(); 2373 y = list[1].toInt();
2374 w = list[2].toInt(); 2374 w = list[2].toInt();
2375 h = list[3].toInt(); 2375 h = list[3].toInt();
2376 KApplication::testCoords( &x,&y,&w,&h ); 2376 KApplication::testCoords( &x,&y,&w,&h );
2377 mEventEditor->setGeometry(x,y,w,h); 2377 mEventEditor->setGeometry(x,y,w,h);
2378 2378
2379 } 2379 }
2380 list = config->readListEntry("EditTodoLayout"); 2380 list = config->readListEntry("EditTodoLayout");
2381 if ( ! list.isEmpty() ) { 2381 if ( ! list.isEmpty() ) {
2382 x = list[0].toInt(); 2382 x = list[0].toInt();
2383 y = list[1].toInt(); 2383 y = list[1].toInt();
2384 w = list[2].toInt(); 2384 w = list[2].toInt();
2385 h = list[3].toInt(); 2385 h = list[3].toInt();
2386 KApplication::testCoords( &x,&y,&w,&h ); 2386 KApplication::testCoords( &x,&y,&w,&h );
2387 mTodoEditor->setGeometry(x,y,w,h); 2387 mTodoEditor->setGeometry(x,y,w,h);
2388 2388
2389 } 2389 }
2390 list = config->readListEntry("ViewerLayout"); 2390 list = config->readListEntry("ViewerLayout");
2391 if ( ! list.isEmpty() ) { 2391 if ( ! list.isEmpty() ) {
2392 x = list[0].toInt(); 2392 x = list[0].toInt();
2393 y = list[1].toInt(); 2393 y = list[1].toInt();
2394 w = list[2].toInt(); 2394 w = list[2].toInt();
2395 h = list[3].toInt(); 2395 h = list[3].toInt();
2396 KApplication::testCoords( &x,&y,&w,&h ); 2396 KApplication::testCoords( &x,&y,&w,&h );
2397 getEventViewerDialog()->setGeometry(x,y,w,h); 2397 getEventViewerDialog()->setGeometry(x,y,w,h);
2398 } 2398 }
2399#endif 2399#endif
2400 config->setGroup( "Views" ); 2400 config->setGroup( "Views" );
2401 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2401 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2402 2402
2403 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2403 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2404 2404
2405 int resetval = 0; 2405 int resetval = 0;
2406 int maxVal = 0; 2406 int maxVal = 0;
2407 if (sizes.count() != 3) { 2407 if (sizes.count() != 3) {
2408 if ( KOPrefs::instance()->mVerticalScreen ) { 2408 if ( KOPrefs::instance()->mVerticalScreen ) {
2409 resetval = mDateNavigator->sizeHint().width()+2; 2409 resetval = mDateNavigator->sizeHint().width()+2;
2410 } else { 2410 } else {
2411 resetval = mDateNavigator->sizeHint().height()+2; 2411 resetval = mDateNavigator->sizeHint().height()+2;
2412 } 2412 }
2413 } 2413 }
2414 if ( resetval ) { 2414 if ( resetval ) {
2415 sizes.clear(); 2415 sizes.clear();
2416 if ( KOPrefs::instance()->mVerticalScreen ) { 2416 if ( KOPrefs::instance()->mVerticalScreen ) {
2417 maxVal = QApplication::desktop()->width() -10; 2417 maxVal = QApplication::desktop()->width() -10;
2418 } else { 2418 } else {
2419 maxVal = QApplication::desktop()->height()-10; 2419 maxVal = QApplication::desktop()->height()-10;
2420 } 2420 }
2421 sizes << resetval; 2421 sizes << resetval;
2422 if ( maxVal < resetval + resetval) 2422 if ( maxVal < resetval + resetval)
2423 resetval = maxVal - resetval; 2423 resetval = maxVal - resetval;
2424 sizes << resetval; 2424 sizes << resetval;
2425 sizes << 100; 2425 sizes << 100;
2426 } 2426 }
2427 mLeftFrame->setSizes(sizes); 2427 mLeftFrame->setSizes(sizes);
2428 sizes = config->readIntListEntry("Main Splitter Frame"); 2428 sizes = config->readIntListEntry("Main Splitter Frame");
2429 resetval = 0; 2429 resetval = 0;
2430 maxVal = 0; 2430 maxVal = 0;
2431 if (sizes.count() != 2) { 2431 if (sizes.count() != 2) {
2432 if ( !KOPrefs::instance()->mVerticalScreen ) { 2432 if ( !KOPrefs::instance()->mVerticalScreen ) {
2433 resetval = mDateNavigator->sizeHint().width()+2; 2433 resetval = mDateNavigator->sizeHint().width()+2;
2434 } else { 2434 } else {
2435 resetval = mDateNavigator->sizeHint().height()+2; 2435 resetval = mDateNavigator->sizeHint().height()+2;
2436 } 2436 }
2437 } 2437 }
2438 if ( resetval ) { 2438 if ( resetval ) {
2439 sizes.clear(); 2439 sizes.clear();
2440 if ( !KOPrefs::instance()->mVerticalScreen ) { 2440 if ( !KOPrefs::instance()->mVerticalScreen ) {
2441 maxVal = QApplication::desktop()->width() -10; 2441 maxVal = QApplication::desktop()->width() -10;
2442 } else { 2442 } else {
2443 maxVal = QApplication::desktop()->height()-10; 2443 maxVal = QApplication::desktop()->height()-10;
2444 } 2444 }
2445 sizes << resetval; 2445 sizes << resetval;
2446 if ( maxVal < resetval + resetval) 2446 if ( maxVal < resetval + resetval)
2447 resetval = maxVal - resetval; 2447 resetval = maxVal - resetval;
2448 sizes << resetval; 2448 sizes << resetval;
2449 } 2449 }
2450 mMainFrame->setSizes(sizes); 2450 mMainFrame->setSizes(sizes);
2451 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2451 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2452 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2452 else if ( dateCount == 7 ) mNavigator->selectWeek();
2453 else mNavigator->selectDates( dateCount ); 2453 else mNavigator->selectDates( dateCount );
2454 // mViewManager->readSettings( config ); 2454 // mViewManager->readSettings( config );
2455 updateConfig(); 2455 updateConfig();
2456 globalFlagBlockAgenda = 2; 2456 globalFlagBlockAgenda = 2;
2457 mViewManager->readSettings( config ); 2457 mViewManager->readSettings( config );
2458 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2458 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2459} 2459}
2460 2460
2461void CalendarView::checkSuspendAlarm() 2461void CalendarView::checkSuspendAlarm()
2462{ 2462{
2463 if ( mSuspendTimer->isActive() ) { 2463 if ( mSuspendTimer->isActive() ) {
2464 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); 2464 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
2465 } 2465 }
2466} 2466}
2467void CalendarView::writeSettings() 2467void CalendarView::writeSettings()
2468{ 2468{
2469 // kdDebug() << "CalendarView::writeSettings" << endl; 2469 // kdDebug() << "CalendarView::writeSettings" << endl;
2470 2470
2471 KConfig *config = KOGlobals::config(); 2471 KConfig *config = KOGlobals::config();
2472 2472
2473 mViewManager->writeSettings( config ); 2473 mViewManager->writeSettings( config );
2474 mTodoList->saveLayout(config,QString("Todo Layout")); 2474 mTodoList->saveLayout(config,QString("Todo Layout"));
2475 mDialogManager->writeSettings( config ); 2475 mDialogManager->writeSettings( config );
2476 //KOPrefs::instance()->usrWriteConfig(); 2476 //KOPrefs::instance()->usrWriteConfig();
2477 KOPrefs::instance()->writeConfig(); 2477 KOPrefs::instance()->writeConfig();
2478 2478
2479 writeFilterSettings(config); 2479 writeFilterSettings(config);
2480 config->setGroup( "AppRun" ); 2480 config->setGroup( "AppRun" );
2481 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2481 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2482 int days = dt.daysTo( QDate::currentDate() ); 2482 int days = dt.daysTo( QDate::currentDate() );
2483 dt = dt.addDays( days ); 2483 dt = dt.addDays( days );
2484 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2484 int secs = dt.secsTo( QDateTime::currentDateTime() );
2485 config->writeEntry( "LatestProgramStopDays", days ); 2485 config->writeEntry( "LatestProgramStopDays", days );
2486 config->writeEntry( "LatestProgramStopSecs", secs ); 2486 config->writeEntry( "LatestProgramStopSecs", secs );
2487 //qDebug("KO: Writing stop time: %d ", secs); 2487 //qDebug("KO: Writing stop time: %d ", secs);
2488 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2488 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2489 //QDateTime latest = dt.addSecs ( secs ); 2489 //QDateTime latest = dt.addSecs ( secs );
2490 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2490 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2491 config->setGroup( "Views" ); 2491 config->setGroup( "Views" );
2492 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2492 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2493 2493
2494#if 0 2494#if 0
2495 qDebug("********************* "); 2495 qDebug("********************* ");
2496 qDebug("Testcode secsto "); 2496 qDebug("Testcode secsto ");
2497 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2497 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2498 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2498 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2499 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2499 int secsto = dt_nodaylight.secsTo( dt_daylight );
2500 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2500 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2501 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2501 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2502 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2502 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2503 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2503 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2504 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2504 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2505 qDebug("********************* testcode end"); 2505 qDebug("********************* testcode end");
2506 2506
2507#endif 2507#endif
2508 2508
2509 QValueList<int> listINT = mLeftFrame->sizes(); 2509 QValueList<int> listINT = mLeftFrame->sizes();
2510 config->writeEntry("Left Splitter Frame",listINT); 2510 config->writeEntry("Left Splitter Frame",listINT);
2511 QValueList<int> listINT2 = mMainFrame->sizes(); 2511 QValueList<int> listINT2 = mMainFrame->sizes();
2512 config->writeEntry("Main Splitter Frame",listINT2); 2512 config->writeEntry("Main Splitter Frame",listINT2);
2513#ifdef DESKTOP_VERSION 2513#ifdef DESKTOP_VERSION
2514 config->setGroup("WidgetLayout"); 2514 config->setGroup("WidgetLayout");
2515 QStringList list ;//= config->readListEntry("MainLayout"); 2515 QStringList list ;//= config->readListEntry("MainLayout");
2516 int x,y,w,h; 2516 int x,y,w,h;
2517 QWidget* wid; 2517 QWidget* wid;
2518 wid = topLevelWidget(); 2518 wid = topLevelWidget();
2519 x = wid->geometry().x(); 2519 x = wid->geometry().x();
2520 y = wid->geometry().y(); 2520 y = wid->geometry().y();
2521 w = wid->width(); 2521 w = wid->width();
2522 h = wid->height(); 2522 h = wid->height();
2523 list.clear(); 2523 list.clear();
2524 list << QString::number( x ); 2524 list << QString::number( x );
2525 list << QString::number( y ); 2525 list << QString::number( y );
2526 list << QString::number( w ); 2526 list << QString::number( w );
2527 list << QString::number( h ); 2527 list << QString::number( h );
2528 config->writeEntry("MainLayout",list ); 2528 config->writeEntry("MainLayout",list );
2529 2529
2530 wid = mEventEditor; 2530 wid = mEventEditor;
2531 x = wid->geometry().x(); 2531 x = wid->geometry().x();
2532 y = wid->geometry().y(); 2532 y = wid->geometry().y();
2533 w = wid->width(); 2533 w = wid->width();
2534 h = wid->height(); 2534 h = wid->height();
2535 list.clear(); 2535 list.clear();
2536 list << QString::number( x ); 2536 list << QString::number( x );
2537 list << QString::number( y ); 2537 list << QString::number( y );
2538 list << QString::number( w ); 2538 list << QString::number( w );
2539 list << QString::number( h ); 2539 list << QString::number( h );
2540 config->writeEntry("EditEventLayout",list ); 2540 config->writeEntry("EditEventLayout",list );
2541 2541
2542 wid = mTodoEditor; 2542 wid = mTodoEditor;
2543 x = wid->geometry().x(); 2543 x = wid->geometry().x();
2544 y = wid->geometry().y(); 2544 y = wid->geometry().y();
2545 w = wid->width(); 2545 w = wid->width();
2546 h = wid->height(); 2546 h = wid->height();
2547 list.clear(); 2547 list.clear();
2548 list << QString::number( x ); 2548 list << QString::number( x );
2549 list << QString::number( y ); 2549 list << QString::number( y );
2550 list << QString::number( w ); 2550 list << QString::number( w );
2551 list << QString::number( h ); 2551 list << QString::number( h );
2552 config->writeEntry("EditTodoLayout",list ); 2552 config->writeEntry("EditTodoLayout",list );
2553 wid = getEventViewerDialog(); 2553 wid = getEventViewerDialog();
2554 x = wid->geometry().x(); 2554 x = wid->geometry().x();
2555 y = wid->geometry().y(); 2555 y = wid->geometry().y();
2556 w = wid->width(); 2556 w = wid->width();
2557 h = wid->height(); 2557 h = wid->height();
2558 list.clear(); 2558 list.clear();
2559 list << QString::number( x ); 2559 list << QString::number( x );
2560 list << QString::number( y ); 2560 list << QString::number( y );
2561 list << QString::number( w ); 2561 list << QString::number( w );
2562 list << QString::number( h ); 2562 list << QString::number( h );
2563 config->writeEntry("ViewerLayout",list ); 2563 config->writeEntry("ViewerLayout",list );
2564 wid = mDialogManager->getSearchDialog(); 2564 wid = mDialogManager->getSearchDialog();
2565 if ( wid ) { 2565 if ( wid ) {
2566 x = wid->geometry().x(); 2566 x = wid->geometry().x();
2567 y = wid->geometry().y(); 2567 y = wid->geometry().y();
2568 w = wid->width(); 2568 w = wid->width();
2569 h = wid->height(); 2569 h = wid->height();
2570 list.clear(); 2570 list.clear();
2571 list << QString::number( x ); 2571 list << QString::number( x );
2572 list << QString::number( y ); 2572 list << QString::number( y );
2573 list << QString::number( w ); 2573 list << QString::number( w );
2574 list << QString::number( h ); 2574 list << QString::number( h );
2575 config->writeEntry("SearchLayout",list ); 2575 config->writeEntry("SearchLayout",list );
2576 } 2576 }
2577#endif 2577#endif
2578 2578
2579 2579
2580 config->sync(); 2580 config->sync();
2581} 2581}
2582 2582
2583void CalendarView::readFilterSettings(KConfig *config) 2583void CalendarView::readFilterSettings(KConfig *config)
2584{ 2584{
2585 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2585 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2586 2586
2587 mFilters.clear(); 2587 mFilters.clear();
2588 2588
2589 config->setGroup("General"); 2589 config->setGroup("General");
2590 QStringList filterList = config->readListEntry("CalendarFilters"); 2590 QStringList filterList = config->readListEntry("CalendarFilters");
2591 2591
2592 QStringList::ConstIterator it = filterList.begin(); 2592 QStringList::ConstIterator it = filterList.begin();
2593 QStringList::ConstIterator end = filterList.end(); 2593 QStringList::ConstIterator end = filterList.end();
2594 while(it != end) { 2594 while(it != end) {
2595 // kdDebug() << " filter: " << (*it) << endl; 2595 // kdDebug() << " filter: " << (*it) << endl;
2596 2596
2597 CalFilter *filter; 2597 CalFilter *filter;
2598 filter = new CalFilter(*it); 2598 filter = new CalFilter(*it);
2599 config->setGroup("Filter_" + (*it).utf8()); 2599 config->setGroup("Filter_" + (*it).utf8());
2600 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2600 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2601 filter->setCriteria(config->readNumEntry("Criteria",0)); 2601 filter->setCriteria(config->readNumEntry("Criteria",0));
2602 filter->setCategoryList(config->readListEntry("CategoryList")); 2602 filter->setCategoryList(config->readListEntry("CategoryList"));
2603 mFilters.append(filter); 2603 mFilters.append(filter);
2604 2604
2605 ++it; 2605 ++it;
2606 } 2606 }
2607 2607
2608 if (mFilters.count() == 0) { 2608 if (mFilters.count() == 0) {
2609 CalFilter *filter = new CalFilter(i18n("Default")); 2609 CalFilter *filter = new CalFilter(i18n("Default"));
2610 mFilters.append(filter); 2610 mFilters.append(filter);
2611 } 2611 }
2612 mFilterView->updateFilters(); 2612 mFilterView->updateFilters();
2613 config->setGroup("FilterView"); 2613 config->setGroup("FilterView");
2614 2614
2615 mFilterView->blockSignals(true); 2615 mFilterView->blockSignals(true);
2616 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2616 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2617 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2617 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2618 mFilterView->blockSignals(false); 2618 mFilterView->blockSignals(false);
2619 // We do it manually to avoid it being done twice by the above calls 2619 // We do it manually to avoid it being done twice by the above calls
2620 updateFilter(); 2620 updateFilter();
2621} 2621}
2622 2622
2623void CalendarView::writeFilterSettings(KConfig *config) 2623void CalendarView::writeFilterSettings(KConfig *config)
2624{ 2624{
2625 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2625 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2626 2626
2627 QStringList filterList; 2627 QStringList filterList;
2628 2628
2629 CalFilter *filter = mFilters.first(); 2629 CalFilter *filter = mFilters.first();
2630 while(filter) { 2630 while(filter) {
2631 // kdDebug() << " fn: " << filter->name() << endl; 2631 // kdDebug() << " fn: " << filter->name() << endl;
2632 filterList << filter->name(); 2632 filterList << filter->name();
2633 config->setGroup("Filter_" + filter->name().utf8()); 2633 config->setGroup("Filter_" + filter->name().utf8());
2634 config->writeEntry("Criteria",filter->criteria()); 2634 config->writeEntry("Criteria",filter->criteria());
2635 config->writeEntry("CategoryList",filter->categoryList()); 2635 config->writeEntry("CategoryList",filter->categoryList());
2636 filter = mFilters.next(); 2636 filter = mFilters.next();
2637 } 2637 }
2638 config->setGroup("General"); 2638 config->setGroup("General");
2639 config->writeEntry("CalendarFilters",filterList); 2639 config->writeEntry("CalendarFilters",filterList);
2640 2640
2641 config->setGroup("FilterView"); 2641 config->setGroup("FilterView");
2642 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2642 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2643 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2643 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2644} 2644}
2645 2645
2646 2646
2647void CalendarView::goToday() 2647void CalendarView::goToday()
2648{ 2648{
2649 if ( mViewManager->currentView()->isMonthView() ) 2649 if ( mViewManager->currentView()->isMonthView() )
2650 mNavigator->selectTodayMonth(); 2650 mNavigator->selectTodayMonth();
2651 else 2651 else
2652 mNavigator->selectToday(); 2652 mNavigator->selectToday();
2653} 2653}
2654 2654
2655void CalendarView::goNext() 2655void CalendarView::goNext()
2656{ 2656{
2657 mNavigator->selectNext(); 2657 mNavigator->selectNext();
2658} 2658}
2659 2659
2660void CalendarView::goPrevious() 2660void CalendarView::goPrevious()
2661{ 2661{
2662 mNavigator->selectPrevious(); 2662 mNavigator->selectPrevious();
2663} 2663}
2664void CalendarView::goNextMonth() 2664void CalendarView::goNextMonth()
2665{ 2665{
2666 mNavigator->selectNextMonth(); 2666 mNavigator->selectNextMonth();
2667} 2667}
2668 2668
2669void CalendarView::goPreviousMonth() 2669void CalendarView::goPreviousMonth()
2670{ 2670{
2671 mNavigator->selectPreviousMonth(); 2671 mNavigator->selectPreviousMonth();
2672} 2672}
2673 2673
2674void CalendarView::updateConfig() 2674void CalendarView::updateConfig()
2675{ 2675{
2676 if ( KOPrefs::instance()->mUseAppColors ) 2676 if ( KOPrefs::instance()->mUseAppColors )
2677 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2677 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2678 emit configChanged(); 2678 emit configChanged();
2679 mTodoList->updateConfig(); 2679 mTodoList->updateConfig();
2680 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2680 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2681 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2681 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2682 // To make the "fill window" configurations work 2682 // To make the "fill window" configurations work
2683 //mViewManager->raiseCurrentView(); 2683 //mViewManager->raiseCurrentView();
2684} 2684}
2685 2685
2686 2686
2687void CalendarView::eventChanged(Event *event) 2687void CalendarView::eventChanged(Event *event)
2688{ 2688{
2689 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2689 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2690 //updateUnmanagedViews(); 2690 //updateUnmanagedViews();
2691} 2691}
2692 2692
2693void CalendarView::eventAdded(Event *event) 2693void CalendarView::eventAdded(Event *event)
2694{ 2694{
2695 changeEventDisplay(event,KOGlobals::EVENTADDED); 2695 changeEventDisplay(event,KOGlobals::EVENTADDED);
2696} 2696}
2697 2697
2698void CalendarView::eventToBeDeleted(Event *) 2698void CalendarView::eventToBeDeleted(Event *)
2699{ 2699{
2700 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2700 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2701} 2701}
2702 2702
2703void CalendarView::eventDeleted() 2703void CalendarView::eventDeleted()
2704{ 2704{
2705 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2705 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2706} 2706}
2707void CalendarView::changeTodoDisplay(Todo *which, int action) 2707void CalendarView::changeTodoDisplay(Todo *which, int action)
2708{ 2708{
2709 changeIncidenceDisplay((Incidence *)which, action); 2709 changeIncidenceDisplay((Incidence *)which, action);
2710 mDateNavigator->updateView(); //LR 2710 mDateNavigator->updateView(); //LR
2711 //mDialogManager->updateSearchDialog(); 2711 //mDialogManager->updateSearchDialog();
2712 2712
2713 if (which) { 2713 if (which) {
2714 mViewManager->updateWNview(); 2714 mViewManager->updateWNview();
2715 //mTodoList->updateView(); 2715 //mTodoList->updateView();
2716 } 2716 }
2717 2717
2718} 2718}
2719 2719
2720void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2720void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2721{ 2721{
2722 updateUnmanagedViews(); 2722 updateUnmanagedViews();
2723 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2723 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2724 if ( action == KOGlobals::EVENTDELETED ) { //delete 2724 if ( action == KOGlobals::EVENTDELETED ) { //delete
2725 mCalendar->checkAlarmForIncidence( 0, true ); 2725 mCalendar->checkAlarmForIncidence( 0, true );
2726 if ( mEventViewerDialog ) 2726 if ( mEventViewerDialog )
2727 mEventViewerDialog->hide(); 2727 mEventViewerDialog->hide();
2728 } 2728 }
2729 else 2729 else
2730 mCalendar->checkAlarmForIncidence( which , false ); 2730 mCalendar->checkAlarmForIncidence( which , false );
2731} 2731}
2732 2732
2733// most of the changeEventDisplays() right now just call the view's 2733// most of the changeEventDisplays() right now just call the view's
2734// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2734// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2735void CalendarView::changeEventDisplay(Event *which, int action) 2735void CalendarView::changeEventDisplay(Event *which, int action)
2736{ 2736{
2737 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2737 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2738 changeIncidenceDisplay((Incidence *)which, action); 2738 changeIncidenceDisplay((Incidence *)which, action);
2739 static bool clearallviews = false; 2739 static bool clearallviews = false;
2740 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 2740 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
2741 if ( clearallviews ) { 2741 if ( clearallviews ) {
2742 clearAllViews(); 2742 clearAllViews();
2743 clearallviews = false; 2743 clearallviews = false;
2744 } 2744 }
2745 return; 2745 return;
2746 } 2746 }
2747 clearallviews = true; 2747 clearallviews = true;
2748 mDateNavigator->updateView(); 2748 mDateNavigator->updateView();
2749 //mDialogManager->updateSearchDialog(); 2749 //mDialogManager->updateSearchDialog();
2750 if (which) { 2750 if (which) {
2751 // If there is an event view visible update the display 2751 // If there is an event view visible update the display
2752 mViewManager->currentView()->changeEventDisplay(which,action); 2752 mViewManager->currentView()->changeEventDisplay(which,action);
2753 // TODO: check, if update needed 2753 // TODO: check, if update needed
2754 // if (which->getTodoStatus()) { 2754 // if (which->getTodoStatus()) {
2755 mTodoList->updateView(); 2755 mTodoList->updateView();
2756 if ( action != KOGlobals::EVENTDELETED ) { 2756 if ( action != KOGlobals::EVENTDELETED ) {
2757 mConflictingEvent = which ; 2757 mConflictingEvent = which ;
2758 QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); 2758 QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) );
2759 } 2759 }
2760 // } 2760 // }
2761 } else { 2761 } else {
2762 mViewManager->currentView()->updateView(); 2762 mViewManager->currentView()->updateView();
2763 } 2763 }
2764} 2764}
2765void CalendarView::checkConflictForEvent() 2765void CalendarView::checkConflictForEvent()
2766{ 2766{
2767 2767
2768 if (!KOPrefs::instance()->mConfirm) 2768 if (!KOPrefs::instance()->mConfirm)
2769 return; 2769 return;
2770 if ( ! mConflictingEvent ) return; 2770 if ( ! mConflictingEvent ) return;
2771 if ( mConflictingEvent->isHoliday() || mConflictingEvent->isBirthday() || mConflictingEvent->isAnniversary() ) { 2771 if ( mConflictingEvent->isHoliday() || mConflictingEvent->isBirthday() || mConflictingEvent->isAnniversary() ) {
2772 mConflictingEvent = 0; 2772 mConflictingEvent = 0;
2773 return; 2773 return;
2774 } 2774 }
2775 QPtrList<Event> testlist = mCalendar->events(); 2775 QPtrList<Event> testlist = mCalendar->events();
2776 Event * test = testlist.first(); 2776 Event * test = testlist.first();
2777 QDateTime conflict; 2777 QDateTime conflict;
2778 QDateTime retVal; 2778 QDateTime retVal;
2779 bool found = false; 2779 bool found = false;
2780 Event * cE = 0; 2780 Event * cE = 0;
2781 QDateTime current = QDateTime::currentDateTime(); 2781 QDateTime current = QDateTime::currentDateTime();
2782 while ( test ) { 2782 while ( test ) {
2783 if ( !test->doesFloat() ) { 2783 if ( !test->doesFloat() ) {
2784 if ( mConflictingEvent->isOverlapping ( test, &retVal, &current ) ) { 2784 if ( mConflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
2785 if ( ! found ) { 2785 if ( ! found ) {
2786 conflict = retVal; 2786 conflict = retVal;
2787 cE = test; 2787 cE = test;
2788 } else { 2788 } else {
2789 if ( retVal < conflict ) { 2789 if ( retVal < conflict ) {
2790 conflict = retVal; 2790 conflict = retVal;
2791 cE = test; 2791 cE = test;
2792 } 2792 }
2793 } 2793 }
2794 found = true; 2794 found = true;
2795 } 2795 }
2796 } 2796 }
2797 test = testlist.next(); 2797 test = testlist.next();
2798 } 2798 }
2799 if ( found ) { 2799 if ( found ) {
2800 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; 2800 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( mConflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ;
2801 qApp->processEvents(); 2801 qApp->processEvents();
2802 int km = KMessageBox::warningContinueCancel(this,mess, 2802 int km = KMessageBox::warningContinueCancel(this,mess,
2803 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); 2803 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!"));
2804 if ( km != KMessageBox::Continue ) 2804 if ( km != KMessageBox::Continue )
2805 return; 2805 return;
2806 2806
2807 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 2807 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
2808 mViewManager->showDayView(); 2808 mViewManager->showDayView();
2809 mNavigator->slotDaySelect( conflict.date() ); 2809 mNavigator->slotDaySelect( conflict.date() );
2810 int hour = conflict.time().hour(); 2810 int hour = conflict.time().hour();
2811 mViewManager->agendaView()->setStartHour( hour ); 2811 mViewManager->agendaView()->setStartHour( hour );
2812 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); 2812 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
2813 } 2813 }
2814 mConflictingEvent = 0; 2814 mConflictingEvent = 0;
2815 return; 2815 return;
2816 2816
2817} 2817}
2818 2818
2819void CalendarView::updateTodoViews() 2819void CalendarView::updateTodoViews()
2820{ 2820{
2821 mTodoList->updateView(); 2821 mTodoList->updateView();
2822 mViewManager->currentView()->updateView(); 2822 mViewManager->currentView()->updateView();
2823 2823
2824} 2824}
2825 2825
2826 2826
2827 2827
2828void CalendarView::clearAllViews() 2828void CalendarView::clearAllViews()
2829{ 2829{
2830 mTodoList->clearList(); 2830 mTodoList->clearList();
2831 mViewManager->clearAllViews(); 2831 mViewManager->clearAllViews();
2832 SearchDialog * sd = mDialogManager->getSearchDialog(); 2832 SearchDialog * sd = mDialogManager->getSearchDialog();
2833 if ( sd ) { 2833 if ( sd ) {
2834 KOListView* kol = sd->listview(); 2834 KOListView* kol = sd->listview();
2835 if ( kol ) 2835 if ( kol )
2836 kol->clearList(); 2836 kol->clearList();
2837 } 2837 }
2838} 2838}
2839void CalendarView::updateView() 2839void CalendarView::updateView()
2840{ 2840{
2841 static bool clearallviews = false; 2841 static bool clearallviews = false;
2842 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 2842 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
2843 if ( clearallviews ) { 2843 if ( clearallviews ) {
2844 clearAllViews(); 2844 clearAllViews();
2845 clearallviews = false; 2845 clearallviews = false;
2846 } 2846 }
2847 return; 2847 return;
2848 } 2848 }
2849 clearallviews = true; 2849 clearallviews = true;
2850 DateList tmpList = mNavigator->selectedDates(); 2850 DateList tmpList = mNavigator->selectedDates();
2851 2851
2852 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2852 if ( KOPrefs::instance()->mHideNonStartedTodos )
2853 mTodoList->updateView(); 2853 mTodoList->updateView();
2854 // We assume that the navigator only selects consecutive days. 2854 // We assume that the navigator only selects consecutive days.
2855 updateView( tmpList.first(), tmpList.last() ); 2855 updateView( tmpList.first(), tmpList.last() );
2856} 2856}
2857 2857
2858void CalendarView::updateUnmanagedViews() 2858void CalendarView::updateUnmanagedViews()
2859{ 2859{
2860 mDateNavigator->updateDayMatrix(); 2860 mDateNavigator->updateDayMatrix();
2861} 2861}
2862 2862
2863int CalendarView::msgItemDelete(const QString name) 2863int CalendarView::msgItemDelete(const QString name)
2864{ 2864{
2865 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2865 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2866 i18n("This item will be\npermanently deleted."), 2866 i18n("This item will be\npermanently deleted."),
2867 i18n("KO/Pi Confirmation"),i18n("Delete")); 2867 i18n("KO/Pi Confirmation"),i18n("Delete"));
2868} 2868}
2869 2869
2870 2870
2871void CalendarView::edit_cut() 2871void CalendarView::edit_cut()
2872{ 2872{
2873 Event *anEvent=0; 2873 Event *anEvent=0;
2874 2874
2875 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2875 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2876 2876
2877 if (mViewManager->currentView()->isEventView()) { 2877 if (mViewManager->currentView()->isEventView()) {
2878 if ( incidence && incidence->typeID() == eventID ) { 2878 if ( incidence && incidence->typeID() == eventID ) {
2879 anEvent = static_cast<Event *>(incidence); 2879 anEvent = static_cast<Event *>(incidence);
2880 } 2880 }
2881 } 2881 }
2882 2882
2883 if (!anEvent) { 2883 if (!anEvent) {
2884 KNotifyClient::beep(); 2884 KNotifyClient::beep();
2885 return; 2885 return;
2886 } 2886 }
2887 DndFactory factory( mCalendar ); 2887 DndFactory factory( mCalendar );
2888 factory.cutIncidence(anEvent); 2888 factory.cutIncidence(anEvent);
2889 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2889 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2890} 2890}
2891 2891
2892void CalendarView::edit_copy() 2892void CalendarView::edit_copy()
2893{ 2893{
2894 Event *anEvent=0; 2894 Event *anEvent=0;
2895 2895
2896 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2896 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2897 2897
2898 if (mViewManager->currentView()->isEventView()) { 2898 if (mViewManager->currentView()->isEventView()) {
2899 if ( incidence && incidence->typeID() == eventID ) { 2899 if ( incidence && incidence->typeID() == eventID ) {
2900 anEvent = static_cast<Event *>(incidence); 2900 anEvent = static_cast<Event *>(incidence);
2901 } 2901 }
2902 } 2902 }
2903 2903
2904 if (!anEvent) { 2904 if (!anEvent) {
2905 KNotifyClient::beep(); 2905 KNotifyClient::beep();
2906 return; 2906 return;
2907 } 2907 }
2908 DndFactory factory( mCalendar ); 2908 DndFactory factory( mCalendar );
2909 factory.copyIncidence(anEvent); 2909 factory.copyIncidence(anEvent);
2910} 2910}
2911 2911
2912void CalendarView::edit_paste() 2912void CalendarView::edit_paste()
2913{ 2913{
2914 QDate date = mNavigator->selectedDates().first(); 2914 QDate date = mNavigator->selectedDates().first();
2915 2915
2916 DndFactory factory( mCalendar ); 2916 DndFactory factory( mCalendar );
2917 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2917 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2918 2918
2919 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2919 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2920} 2920}
2921void CalendarView::edit_global_options() 2921void CalendarView::edit_global_options()
2922{ 2922{
2923 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 2923 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2924 emit save(); 2924 emit save();
2925 emit saveStopTimer(); 2925 emit saveStopTimer();
2926 mDialogManager->showGlobalOptionsDialog(); 2926 mDialogManager->showGlobalOptionsDialog();
2927 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 2927 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2928 emit saveStopTimer(); 2928 emit saveStopTimer();
2929 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("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!"), 2929 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("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!"),
2930 i18n("Timezone settings"),i18n("Reload"))) { 2930 i18n("Timezone settings"),i18n("Reload"))) {
2931 qDebug("KO: TZ reload cancelled "); 2931 qDebug("KO: TZ reload cancelled ");
2932 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2932 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2933 return; 2933 return;
2934 } 2934 }
2935 qDebug("KO: Timezone change "); 2935 qDebug("KO: Timezone change ");
2936 loadCalendars(); 2936 loadCalendars();
2937 setModified(true); 2937 setModified(true);
2938 } 2938 }
2939 else 2939 else
2940 qDebug("KO: No tz change "); 2940 qDebug("KO: No tz change ");
2941} 2941}
2942void CalendarView::edit_options() 2942void CalendarView::edit_options()
2943{ 2943{
2944 mDialogManager->showOptionsDialog(); 2944 mDialogManager->showOptionsDialog();
2945} 2945}
2946 2946
2947 2947
2948void CalendarView::slotSelectPickerDate( QDate d) 2948void CalendarView::slotSelectPickerDate( QDate d)
2949{ 2949{
2950 mDateFrame->hide(); 2950 mDateFrame->hide();
2951 if ( mDatePickerMode == 1 ) { 2951 if ( mDatePickerMode == 1 ) {
2952 mNavigator->slotDaySelect( d ); 2952 mNavigator->slotDaySelect( d );
2953 } else if ( mDatePickerMode == 2 ) { 2953 } else if ( mDatePickerMode == 2 ) {
2954 if ( mMoveIncidence->typeID() == todoID ) { 2954 if ( mMoveIncidence->typeID() == todoID ) {
2955 Todo * to = (Todo *) mMoveIncidence; 2955 Todo * to = (Todo *) mMoveIncidence;
2956 QTime tim; 2956 QTime tim;
2957 int len = 0; 2957 int len = 0;
2958 if ( to->hasStartDate() && to->hasDueDate() ) 2958 if ( to->hasStartDate() && to->hasDueDate() )
2959 len = to->dtStart().secsTo( to->dtDue()); 2959 len = to->dtStart().secsTo( to->dtDue());
2960 if ( to->hasDueDate() ) 2960 if ( to->hasDueDate() )
2961 tim = to->dtDue().time(); 2961 tim = to->dtDue().time();
2962 else { 2962 else {
2963 tim = QTime ( 0,0,0 ); 2963 tim = QTime ( 0,0,0 );
2964 to->setFloats( true ); 2964 to->setFloats( true );
2965 to->setHasDueDate( true ); 2965 to->setHasDueDate( true );
2966 } 2966 }
2967 QDateTime dt ( d,tim ); 2967 QDateTime dt ( d,tim );
2968 to->setDtDue( dt ); 2968 to->setDtDue( dt );
2969 2969
2970 if ( to->hasStartDate() ) { 2970 if ( to->hasStartDate() ) {
2971 if ( len>0 ) 2971 if ( len>0 )
2972 to->setDtStart(to->dtDue().addSecs( -len )); 2972 to->setDtStart(to->dtDue().addSecs( -len ));
2973 else 2973 else
2974 if (to->dtStart() > to->dtDue() ) 2974 if (to->dtStart() > to->dtDue() )
2975 to->setDtStart(to->dtDue().addDays( -3 )); 2975 to->setDtStart(to->dtDue().addDays( -3 ));
2976 } 2976 }
2977 2977
2978 todoChanged( to ); 2978 todoChanged( to );
2979 } else if ( mMoveIncidence->typeID() == eventID ) { 2979 } else if ( mMoveIncidence->typeID() == eventID ) {
2980 if ( mMoveIncidence->doesRecur() ) { 2980 if ( mMoveIncidence->doesRecur() ) {
2981#if 0 2981#if 0
2982 // PENDING implement this 2982 // PENDING implement this
2983 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2983 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2984 mCalendar()->addIncidence( newInc ); 2984 mCalendar()->addIncidence( newInc );
2985 if ( mMoveIncidence->typeID() == todoID ) 2985 if ( mMoveIncidence->typeID() == todoID )
2986 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2986 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2987 else 2987 else
2988 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2988 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2989 mMoveIncidence = newInc; 2989 mMoveIncidence = newInc;
2990 2990
2991#endif 2991#endif
2992 } 2992 }
2993 QTime tim = mMoveIncidence->dtStart().time(); 2993 QTime tim = mMoveIncidence->dtStart().time();
2994 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2994 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2995 QDateTime dt ( d,tim ); 2995 QDateTime dt ( d,tim );
2996 mMoveIncidence->setDtStart( dt ); 2996 mMoveIncidence->setDtStart( dt );
2997 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2997 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2998 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2998 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2999 } else if ( mMoveIncidence->typeID() == journalID ) { 2999 } else if ( mMoveIncidence->typeID() == journalID ) {
3000 QTime tim = mMoveIncidence->dtStart().time(); 3000 QTime tim = mMoveIncidence->dtStart().time();
3001 QDateTime dt ( d,tim ); 3001 QDateTime dt ( d,tim );
3002 mMoveIncidence->setDtStart( dt ); 3002 mMoveIncidence->setDtStart( dt );
3003 updateView(); 3003 updateView();
3004 } 3004 }
3005 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 3005 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
3006 } 3006 }
3007} 3007}
3008 3008
3009void CalendarView::removeCategories() 3009void CalendarView::removeCategories()
3010{ 3010{
3011 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3011 QPtrList<Incidence> incList = mCalendar->rawIncidences();
3012 QStringList catList = KOPrefs::instance()->mCustomCategories; 3012 QStringList catList = KOPrefs::instance()->mCustomCategories;
3013 QStringList catIncList; 3013 QStringList catIncList;
3014 QStringList newCatList; 3014 QStringList newCatList;
3015 Incidence* inc = incList.first(); 3015 Incidence* inc = incList.first();
3016 uint i; 3016 uint i;
3017 while ( inc ) { 3017 while ( inc ) {
3018 newCatList.clear(); 3018 newCatList.clear();
3019 catIncList = inc->categories() ; 3019 catIncList = inc->categories() ;
3020 for( i = 0; i< catIncList.count(); ++i ) { 3020 for( i = 0; i< catIncList.count(); ++i ) {
3021 if ( catList.contains (catIncList[i])) 3021 if ( catList.contains (catIncList[i]))
3022 newCatList.append( catIncList[i] ); 3022 newCatList.append( catIncList[i] );
3023 } 3023 }
3024 newCatList.sort(); 3024 newCatList.sort();
3025 inc->setCategories( newCatList.join(",") ); 3025 inc->setCategories( newCatList.join(",") );
3026 inc = incList.next(); 3026 inc = incList.next();
3027 } 3027 }
3028} 3028}
3029 3029
3030int CalendarView::addCategories() 3030int CalendarView::addCategories()
3031{ 3031{
3032 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3032 QPtrList<Incidence> incList = mCalendar->rawIncidences();
3033 QStringList catList = KOPrefs::instance()->mCustomCategories; 3033 QStringList catList = KOPrefs::instance()->mCustomCategories;
3034 QStringList catIncList; 3034 QStringList catIncList;
3035 Incidence* inc = incList.first(); 3035 Incidence* inc = incList.first();
3036 uint i; 3036 uint i;
3037 int count = 0; 3037 int count = 0;
3038 while ( inc ) { 3038 while ( inc ) {
3039 catIncList = inc->categories() ; 3039 catIncList = inc->categories() ;
3040 for( i = 0; i< catIncList.count(); ++i ) { 3040 for( i = 0; i< catIncList.count(); ++i ) {
3041 if ( !catList.contains (catIncList[i])) { 3041 if ( !catList.contains (catIncList[i])) {
3042 catList.append( catIncList[i] ); 3042 catList.append( catIncList[i] );
3043 //qDebug("add cat %s ", catIncList[i].latin1()); 3043 //qDebug("add cat %s ", catIncList[i].latin1());
3044 ++count; 3044 ++count;
3045 } 3045 }
3046 } 3046 }
3047 inc = incList.next(); 3047 inc = incList.next();
3048 } 3048 }
3049 catList.sort(); 3049 catList.sort();
3050 KOPrefs::instance()->mCustomCategories = catList; 3050 KOPrefs::instance()->mCustomCategories = catList;
3051 return count; 3051 return count;
3052} 3052}
3053 3053
3054void CalendarView::editCategories() 3054void CalendarView::editCategories()
3055{ 3055{
3056 qDebug("CalendarView::editCategories() "); 3056 qDebug("CalendarView::editCategories() ");
3057 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this ); 3057 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this );
3058 ced.exec(); 3058 ced.exec();
3059} 3059}
3060void CalendarView::manageCategories() 3060void CalendarView::manageCategories()
3061{ 3061{
3062 KOCatPrefs* cp = new KOCatPrefs(); 3062 KOCatPrefs* cp = new KOCatPrefs();
3063 cp->show(); 3063 cp->show();
3064 int w =cp->sizeHint().width() ; 3064 int w =cp->sizeHint().width() ;
3065 int h = cp->sizeHint().height() ; 3065 int h = cp->sizeHint().height() ;
3066 int dw = QApplication::desktop()->width(); 3066 int dw = QApplication::desktop()->width();
3067 int dh = QApplication::desktop()->height(); 3067 int dh = QApplication::desktop()->height();
3068 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 3068 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
3069 if ( !cp->exec() ) { 3069 if ( !cp->exec() ) {
3070 delete cp; 3070 delete cp;
3071 return; 3071 return;
3072 } 3072 }
3073 int count = 0; 3073 int count = 0;
3074 if ( cp->addCat() ) { 3074 if ( cp->addCat() ) {
3075 count = addCategories(); 3075 count = addCategories();
3076 if ( count ) { 3076 if ( count ) {
3077 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 3077 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
3078 writeSettings(); 3078 writeSettings();
3079 } else 3079 } else
3080 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 3080 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
3081 } else { 3081 } else {
3082 removeCategories(); 3082 removeCategories();
3083 updateView(); 3083 updateView();
3084 } 3084 }
3085 delete cp; 3085 delete cp;
3086} 3086}
3087 3087
3088void CalendarView::beamIncidence(Incidence * Inc) 3088void CalendarView::beamIncidence(Incidence * Inc)
3089{ 3089{
3090 QPtrList<Incidence> delSel ; 3090 QPtrList<Incidence> delSel ;
3091 delSel.append(Inc); 3091 delSel.append(Inc);
3092 beamIncidenceList( delSel ); 3092 beamIncidenceList( delSel );
3093} 3093}
3094void CalendarView::beamCalendar() 3094void CalendarView::beamCalendar()
3095{ 3095{
3096 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 3096 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
3097 //qDebug("beamCalendar() "); 3097 //qDebug("beamCalendar() ");
3098 beamIncidenceList( delSel ); 3098 beamIncidenceList( delSel );
3099} 3099}
3100void CalendarView::beamFilteredCalendar() 3100void CalendarView::beamFilteredCalendar()
3101{ 3101{
3102 QPtrList<Incidence> delSel = mCalendar->incidences(); 3102 QPtrList<Incidence> delSel = mCalendar->incidences();
3103 //qDebug("beamFilteredCalendar() "); 3103 //qDebug("beamFilteredCalendar() ");
3104 beamIncidenceList( delSel ); 3104 beamIncidenceList( delSel );
3105} 3105}
3106void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 3106void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
3107{ 3107{
3108 3108
3109 KOBeamPrefs beamDialog; 3109 KOBeamPrefs beamDialog;
3110 if ( beamDialog.exec () == QDialog::Rejected ) 3110 if ( beamDialog.exec () == QDialog::Rejected )
3111 return; 3111 return;
3112#ifdef DESKTOP_VERSION 3112#ifdef DESKTOP_VERSION
3113 QString fn = locateLocal( "tmp", "kopibeamfile" ); 3113 QString fn = locateLocal( "tmp", "kopibeamfile" );
3114#else 3114#else
3115 QString fn = "/tmp/kopibeamfile"; 3115 QString fn = "/tmp/kopibeamfile";
3116#endif 3116#endif
3117 QString mes; 3117 QString mes;
3118 bool createbup = true; 3118 bool createbup = true;
3119 if ( createbup ) { 3119 if ( createbup ) {
3120 QString description = "\n"; 3120 QString description = "\n";
3121 CalendarLocal* cal = new CalendarLocal(); 3121 CalendarLocal* cal = new CalendarLocal();
3122 if ( beamDialog.beamLocal() ) 3122 if ( beamDialog.beamLocal() )
3123 cal->setLocalTime(); 3123 cal->setLocalTime();
3124 else 3124 else
3125 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 3125 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
3126 Incidence *incidence = delSel.first(); 3126 Incidence *incidence = delSel.first();
3127 bool addText = false; 3127 bool addText = false;
3128 if ( delSel.count() < 10 ) 3128 if ( delSel.count() < 10 )
3129 addText = true; 3129 addText = true;
3130 else { 3130 else {
3131 description.sprintf(i18n(" %d items?"),delSel.count() ); 3131 description.sprintf(i18n(" %d items?"),delSel.count() );
3132 } 3132 }
3133 while ( incidence ) { 3133 while ( incidence ) {
3134 Incidence *in = incidence->clone(); 3134 Incidence *in = incidence->clone();
3135 if ( ! in->summary().isEmpty() ) { 3135 if ( ! in->summary().isEmpty() ) {
3136 in->setDescription(""); 3136 in->setDescription("");
3137 } else { 3137 } else {
3138 in->setSummary( in->description().left(20)); 3138 in->setSummary( in->description().left(20));
3139 in->setDescription(""); 3139 in->setDescription("");
3140 } 3140 }
3141 if ( addText ) 3141 if ( addText )
3142 description += in->summary() + "\n"; 3142 description += in->summary() + "\n";
3143 cal->addIncidence( in ); 3143 cal->addIncidence( in );
3144 incidence = delSel.next(); 3144 incidence = delSel.next();
3145 } 3145 }
3146 if ( beamDialog.beamVcal() ) { 3146 if ( beamDialog.beamVcal() ) {
3147 fn += ".vcs"; 3147 fn += ".vcs";
3148 FileStorage storage( cal, fn, new VCalFormat ); 3148 FileStorage storage( cal, fn, new VCalFormat );
3149 storage.save(); 3149 storage.save();
3150 } else { 3150 } else {
3151 fn += ".ics"; 3151 fn += ".ics";
3152 FileStorage storage( cal, fn, new ICalFormat( ) ); 3152 FileStorage storage( cal, fn, new ICalFormat( ) );
3153 storage.save(); 3153 storage.save();
3154 } 3154 }
3155 delete cal; 3155 delete cal;
3156 mes = i18n("KO/Pi: Ready for beaming"); 3156 mes = i18n("KO/Pi: Ready for beaming");
3157 topLevelWidget()->setCaption(mes); 3157 topLevelWidget()->setCaption(mes);
3158 KApplication::convert2latin1( fn ); 3158 KApplication::convert2latin1( fn );
3159#ifndef DESKTOP_VERSION 3159#ifndef DESKTOP_VERSION
3160 Ir *ir = new Ir( this ); 3160 Ir *ir = new Ir( this );
3161 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 3161 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
3162 ir->send( fn, description, "text/x-vCalendar" ); 3162 ir->send( fn, description, "text/x-vCalendar" );
3163#endif 3163#endif
3164 } 3164 }
3165} 3165}
3166 3166
3167#ifndef DESKTOP_VERSION 3167#ifndef DESKTOP_VERSION
3168void CalendarView::beamDone( Ir *ir ) 3168void CalendarView::beamDone( Ir *ir )
3169{ 3169{
3170 delete ir; 3170 delete ir;
3171 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 3171 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
3172 topLevelWidget()->raise(); 3172 topLevelWidget()->raise();
3173} 3173}
3174#else 3174#else
3175void CalendarView::beamDone( Ir *){;} 3175void CalendarView::beamDone( Ir *){;}
3176#endif 3176#endif
3177void CalendarView::moveIncidence(Incidence * inc ) 3177void CalendarView::moveIncidence(Incidence * inc )
3178{ 3178{
3179 if ( !inc ) return; 3179 if ( !inc ) return;
3180 showDatePickerPopup(); 3180 showDatePickerPopup();
3181 mDatePickerMode = 2; 3181 mDatePickerMode = 2;
3182 mMoveIncidence = inc ; 3182 mMoveIncidence = inc ;
3183 QDate da; 3183 QDate da;
3184 if ( mMoveIncidence->typeID() == todoID ) { 3184 if ( mMoveIncidence->typeID() == todoID ) {
3185 Todo * to = (Todo *) mMoveIncidence; 3185 Todo * to = (Todo *) mMoveIncidence;
3186 if ( to->hasDueDate() ) 3186 if ( to->hasDueDate() )
3187 da = to->dtDue().date(); 3187 da = to->dtDue().date();
3188 else 3188 else
3189 da = QDate::currentDate(); 3189 da = QDate::currentDate();
3190 } else { 3190 } else {
3191 da = mMoveIncidence->dtStart().date(); 3191 da = mMoveIncidence->dtStart().date();
3192 } 3192 }
3193 //PENDING set date for recurring incidence to date of recurrence 3193 //PENDING set date for recurring incidence to date of recurrence
3194 //mMoveIncidenceOldDate; 3194 //mMoveIncidenceOldDate;
3195 mDatePicker->setDate( da ); 3195 mDatePicker->setDate( da );
3196} 3196}
3197void CalendarView::showDatePickerPopup() 3197void CalendarView::showDatePickerPopup()
3198{ 3198{
3199 if ( mDateFrame->isVisible() ) 3199 if ( mDateFrame->isVisible() )
3200 mDateFrame->hide(); 3200 mDateFrame->hide();
3201 else { 3201 else {
3202 int offX = 0, offY = 0; 3202 int offX = 0, offY = 0;
3203#ifdef DESKTOP_VERSION 3203#ifdef DESKTOP_VERSION
3204 int w =mDatePicker->sizeHint().width() ; 3204 int w =mDatePicker->sizeHint().width() ;
3205 int h = mDatePicker->sizeHint().height() ; 3205 int h = mDatePicker->sizeHint().height() ;
3206 int dw = topLevelWidget()->width(); 3206 int dw = topLevelWidget()->width();
3207 int dh = topLevelWidget()->height(); 3207 int dh = topLevelWidget()->height();
3208 offX = topLevelWidget()->x(); 3208 offX = topLevelWidget()->x();
3209 offY = topLevelWidget()->y(); 3209 offY = topLevelWidget()->y();
3210#else 3210#else
3211 int w =mDatePicker->sizeHint().width() ; 3211 int w =mDatePicker->sizeHint().width() ;
3212 int h = mDatePicker->sizeHint().height() ; 3212 int h = mDatePicker->sizeHint().height() ;
3213 int dw = QApplication::desktop()->width(); 3213 int dw = QApplication::desktop()->width();
3214 int dh = QApplication::desktop()->height(); 3214 int dh = QApplication::desktop()->height();
3215#endif 3215#endif
3216 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); 3216 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
3217 mDateFrame->show(); 3217 mDateFrame->show();
3218 } 3218 }
3219} 3219}
3220void CalendarView::showDatePicker( ) 3220void CalendarView::showDatePicker( )
3221{ 3221{
3222 showDatePickerPopup(); 3222 showDatePickerPopup();
3223 mDatePickerMode = 1; 3223 mDatePickerMode = 1;
3224 mDatePicker->setDate( mNavigator->selectedDates().first() ); 3224 mDatePicker->setDate( mNavigator->selectedDates().first() );
3225} 3225}
3226 3226
3227void CalendarView::showEventEditor() 3227void CalendarView::showEventEditor()
3228{ 3228{
3229#ifdef DESKTOP_VERSION 3229#ifdef DESKTOP_VERSION
3230 int x,y,w,h; 3230 int x,y,w,h;
3231 x = mEventEditor->geometry().x(); 3231 x = mEventEditor->geometry().x();
3232 y = mEventEditor->geometry().y(); 3232 y = mEventEditor->geometry().y();
3233 w = mEventEditor->width(); 3233 w = mEventEditor->width();
3234 h = mEventEditor->height(); 3234 h = mEventEditor->height();
3235 mEventEditor->show(); 3235 mEventEditor->show();
3236 mEventEditor->setGeometry(x,y,w,h); 3236 mEventEditor->setGeometry(x,y,w,h);
3237#else 3237#else
3238 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 3238 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
3239 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3239 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3240 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 3240 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
3241 qApp->processEvents(); 3241 qApp->processEvents();
3242 delete mEventEditor; 3242 delete mEventEditor;
3243 mEventEditor = mDialogManager->getEventEditor(); 3243 mEventEditor = mDialogManager->getEventEditor();
3244 topLevelWidget()->setCaption( i18n("") ); 3244 topLevelWidget()->setCaption( i18n("") );
3245 } 3245 }
3246 mEventEditor->showMaximized(); 3246 mEventEditor->showMaximized();
3247#endif 3247#endif
3248} 3248}
3249void CalendarView::showTodoEditor() 3249void CalendarView::showTodoEditor()
3250{ 3250{
3251#ifdef DESKTOP_VERSION 3251#ifdef DESKTOP_VERSION
3252 int x,y,w,h; 3252 int x,y,w,h;
3253 x = mTodoEditor->geometry().x(); 3253 x = mTodoEditor->geometry().x();
3254 y = mTodoEditor->geometry().y(); 3254 y = mTodoEditor->geometry().y();
3255 w = mTodoEditor->width(); 3255 w = mTodoEditor->width();
3256 h = mTodoEditor->height(); 3256 h = mTodoEditor->height();
3257 mTodoEditor->show(); 3257 mTodoEditor->show();
3258 mTodoEditor->setGeometry(x,y,w,h); 3258 mTodoEditor->setGeometry(x,y,w,h);
3259#else 3259#else
3260 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { 3260 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
3261 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3261 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3262 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); 3262 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
3263 qApp->processEvents(); 3263 qApp->processEvents();
3264 delete mTodoEditor; 3264 delete mTodoEditor;
3265 mTodoEditor = mDialogManager->getTodoEditor(); 3265 mTodoEditor = mDialogManager->getTodoEditor();
3266 topLevelWidget()->setCaption( i18n("") ); 3266 topLevelWidget()->setCaption( i18n("") );
3267 } 3267 }
3268 mTodoEditor->showMaximized(); 3268 mTodoEditor->showMaximized();
3269#endif 3269#endif
3270} 3270}
3271 3271
3272void CalendarView::cloneIncidence() 3272void CalendarView::cloneIncidence()
3273{ 3273{
3274 Incidence *incidence = currentSelection(); 3274 Incidence *incidence = currentSelection();
3275 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3275 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3276 if ( incidence ) { 3276 if ( incidence ) {
3277 cloneIncidence(incidence); 3277 cloneIncidence(incidence);
3278 } 3278 }
3279} 3279}
3280void CalendarView::moveIncidence() 3280void CalendarView::moveIncidence()
3281{ 3281{
3282 Incidence *incidence = currentSelection(); 3282 Incidence *incidence = currentSelection();
3283 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3283 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3284 if ( incidence ) { 3284 if ( incidence ) {
3285 moveIncidence(incidence); 3285 moveIncidence(incidence);
3286 } 3286 }
3287} 3287}
3288void CalendarView::beamIncidence() 3288void CalendarView::beamIncidence()
3289{ 3289{
3290 Incidence *incidence = currentSelection(); 3290 Incidence *incidence = currentSelection();
3291 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3291 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3292 if ( incidence ) { 3292 if ( incidence ) {
3293 beamIncidence(incidence); 3293 beamIncidence(incidence);
3294 } 3294 }
3295} 3295}
3296void CalendarView::toggleCancelIncidence() 3296void CalendarView::toggleCancelIncidence()
3297{ 3297{
3298 Incidence *incidence = currentSelection(); 3298 Incidence *incidence = currentSelection();
3299 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3299 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3300 if ( incidence ) { 3300 if ( incidence ) {
3301 cancelIncidence(incidence); 3301 cancelIncidence(incidence);
3302 } 3302 }
3303} 3303}
3304 3304
3305 3305
3306void CalendarView::cancelIncidence(Incidence * inc ) 3306void CalendarView::cancelIncidence(Incidence * inc )
3307{ 3307{
3308 inc->setCancelled( ! inc->cancelled() ); 3308 inc->setCancelled( ! inc->cancelled() );
3309 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 3309 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
3310 updateView(); 3310 updateView();
3311} 3311}
3312void CalendarView::cloneIncidence(Incidence * orgInc ) 3312void CalendarView::cloneIncidence(Incidence * orgInc )
3313{ 3313{
3314 Incidence * newInc = orgInc->clone(); 3314 Incidence * newInc = orgInc->clone();
3315 newInc->recreate(); 3315 newInc->recreate();
3316 3316
3317 if ( newInc->typeID() == todoID ) { 3317 if ( newInc->typeID() == todoID ) {
3318 Todo* t = (Todo*) newInc; 3318 Todo* t = (Todo*) newInc;
3319 bool cloneSub = false; 3319 bool cloneSub = false;
3320 if ( orgInc->relations().count() ) { 3320 if ( orgInc->relations().count() ) {
3321 int result = KMessageBox::warningYesNoCancel(this, 3321 int result = KMessageBox::warningYesNoCancel(this,
3322 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( KGlobal::formatMessage ( newInc->summary(),0 ) ), 3322 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( KGlobal::formatMessage ( newInc->summary(),0 ) ),
3323 i18n("Todo has subtodos"), 3323 i18n("Todo has subtodos"),
3324 i18n("Yes"), 3324 i18n("Yes"),
3325 i18n("No")); 3325 i18n("No"));
3326 3326
3327 if ( result == KMessageBox::Cancel ) { 3327 if ( result == KMessageBox::Cancel ) {
3328 delete t; 3328 delete t;
3329 return; 3329 return;
3330 } 3330 }
3331 if (result == KMessageBox::Yes) cloneSub = true; 3331 if (result == KMessageBox::Yes) cloneSub = true;
3332 } 3332 }
3333 showTodoEditor(); 3333 showTodoEditor();
3334 mTodoEditor->editTodo( t ); 3334 mTodoEditor->editTodo( t );
3335 if ( mTodoEditor->exec() ) { 3335 if ( mTodoEditor->exec() ) {
3336 if ( cloneSub ) { 3336 if ( cloneSub ) {
3337 orgInc->cloneRelations( t ); 3337 orgInc->cloneRelations( t );
3338 mCalendar->addIncidenceBranch( t ); 3338 mCalendar->addIncidenceBranch( t );
3339 updateView(); 3339 updateView();
3340 3340
3341 } else { 3341 } else {
3342 mCalendar->addTodo( t ); 3342 mCalendar->addTodo( t );
3343 updateView(); 3343 updateView();
3344 } 3344 }
3345 } else { 3345 } else {
3346 delete t; 3346 delete t;
3347 } 3347 }
3348 } 3348 }
3349 else if ( newInc->typeID() == eventID ) { 3349 else if ( newInc->typeID() == eventID ) {
3350 Event* e = (Event*) newInc; 3350 Event* e = (Event*) newInc;
3351 showEventEditor(); 3351 showEventEditor();
3352 mEventEditor->editEvent( e ); 3352 mEventEditor->editEvent( e );
3353 if ( mEventEditor->exec() ) { 3353 if ( mEventEditor->exec() ) {
3354 mCalendar->addEvent( e ); 3354 mCalendar->addEvent( e );
3355 updateView(); 3355 updateView();
3356 } else { 3356 } else {
3357 delete e; 3357 delete e;
3358 } 3358 }
3359 } if ( newInc->typeID() == journalID ) { 3359 } if ( newInc->typeID() == journalID ) {
3360 mCalendar->addJournal( (Journal*) newInc ); 3360 mCalendar->addJournal( (Journal*) newInc );
3361 editJournal( (Journal*) newInc ); 3361 editJournal( (Journal*) newInc );
3362 } 3362 }
3363 setActiveWindow(); 3363 setActiveWindow();
3364} 3364}
3365 3365
3366void CalendarView::newEvent() 3366void CalendarView::newEvent()
3367{ 3367{
3368 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 3368 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
3369 KOAgendaView *aView = mViewManager->agendaView(); 3369 KOAgendaView *aView = mViewManager->agendaView();
3370 if (aView) { 3370 if (aView) {
3371 if (aView->selectionStart().isValid()) { 3371 if (aView->selectionStart().isValid()) {
3372 if (aView->selectedIsAllDay()) { 3372 if (aView->selectedIsAllDay()) {
3373 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 3373 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
3374 } else { 3374 } else {
3375 newEvent(aView->selectionStart(),aView->selectionEnd()); 3375 newEvent(aView->selectionStart(),aView->selectionEnd());
3376 } 3376 }
3377 return; 3377 return;
3378 } 3378 }
3379 } 3379 }
3380 3380
3381 QDate date = mNavigator->selectedDates().first(); 3381 QDate date = mNavigator->selectedDates().first();
3382#if 0 3382#if 0
3383 QDateTime current = QDateTime::currentDateTime(); 3383 QDateTime current = QDateTime::currentDateTime();
3384 if ( date <= current.date() ) { 3384 if ( date <= current.date() ) {
3385 int hour = current.time().hour() +1; 3385 int hour = current.time().hour() +1;
3386 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 3386 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
3387 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3387 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3388 } else 3388 } else
3389#endif 3389#endif
3390 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 3390 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
3391 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 3391 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
3392 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3392 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3393} 3393}
3394 3394
3395void CalendarView::newEvent(QDateTime fh) 3395void CalendarView::newEvent(QDateTime fh)
3396{ 3396{
3397 newEvent(fh, 3397 newEvent(fh,
3398 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 3398 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
3399} 3399}
3400 3400
3401void CalendarView::newEvent(QDate dt) 3401void CalendarView::newEvent(QDate dt)
3402{ 3402{
3403 newEvent(QDateTime(dt, QTime(0,0,0)), 3403 newEvent(QDateTime(dt, QTime(0,0,0)),
3404 QDateTime(dt, QTime(0,0,0)), true); 3404 QDateTime(dt, QTime(0,0,0)), true);
3405} 3405}
3406void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) 3406void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint)
3407{ 3407{
3408 newEvent(fromHint, toHint, false); 3408 newEvent(fromHint, toHint, false);
3409} 3409}
3410void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 3410void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
3411{ 3411{
3412 3412
3413 showEventEditor(); 3413 showEventEditor();
3414 mEventEditor->newEvent(fromHint,toHint,allDay); 3414 mEventEditor->newEvent(fromHint,toHint,allDay);
3415 if ( mFilterView->filtersEnabled() ) { 3415 if ( mFilterView->filtersEnabled() ) {
3416 CalFilter *filter = mFilterView->selectedFilter(); 3416 CalFilter *filter = mFilterView->selectedFilter();
3417 if (filter && filter->showCategories()) { 3417 if (filter && filter->showCategories()) {
3418 mEventEditor->setCategories(filter->categoryList().join(",") ); 3418 mEventEditor->setCategories(filter->categoryList().join(",") );
3419 } 3419 }
3420 if ( filter ) 3420 if ( filter )
3421 mEventEditor->setSecrecy( filter->getSecrecy() ); 3421 mEventEditor->setSecrecy( filter->getSecrecy() );
3422 } 3422 }
3423 mEventEditor->exec(); 3423 mEventEditor->exec();
3424 setActiveWindow(); 3424 setActiveWindow();
3425} 3425}
3426void CalendarView::todoAdded(Todo * t) 3426void CalendarView::todoAdded(Todo * t)
3427{ 3427{
3428 3428
3429 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 3429 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
3430 updateTodoViews(); 3430 updateTodoViews();
3431} 3431}
3432void CalendarView::todoChanged(Todo * t) 3432void CalendarView::todoChanged(Todo * t)
3433{ 3433{
3434 emit todoModified( t, 4 ); 3434 emit todoModified( t, 4 );
3435 // updateTodoViews(); 3435 // updateTodoViews();
3436} 3436}
3437void CalendarView::todoToBeDeleted(Todo *) 3437void CalendarView::todoToBeDeleted(Todo *)
3438{ 3438{
3439 //qDebug("todoToBeDeleted(Todo *) "); 3439 //qDebug("todoToBeDeleted(Todo *) ");
3440 updateTodoViews(); 3440 updateTodoViews();
3441} 3441}
3442void CalendarView::todoDeleted() 3442void CalendarView::todoDeleted()
3443{ 3443{
3444 //qDebug(" todoDeleted()"); 3444 //qDebug(" todoDeleted()");
3445 updateTodoViews(); 3445 updateTodoViews();
3446} 3446}
3447 3447
3448 3448
3449void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) 3449void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
3450{ 3450{
3451 showTodoEditor(); 3451 showTodoEditor();
3452 mTodoEditor->newTodo(dt,0,allday); 3452 mTodoEditor->newTodo(dt,0,allday);
3453 if ( mFilterView->filtersEnabled() ) { 3453 if ( mFilterView->filtersEnabled() ) {
3454 CalFilter *filter = mFilterView->selectedFilter(); 3454 CalFilter *filter = mFilterView->selectedFilter();
3455 if (filter && filter->showCategories()) { 3455 if (filter && filter->showCategories()) {
3456 mTodoEditor->setCategories(filter->categoryList().join(",") ); 3456 mTodoEditor->setCategories(filter->categoryList().join(",") );
3457 } 3457 }
3458 if ( filter ) 3458 if ( filter )
3459 mTodoEditor->setSecrecy( filter->getSecrecy() ); 3459 mTodoEditor->setSecrecy( filter->getSecrecy() );
3460 } 3460 }
3461 mTodoEditor->exec(); 3461 mTodoEditor->exec();
3462 setActiveWindow(); 3462 setActiveWindow();
3463} 3463}
3464 3464
3465void CalendarView::newTodo() 3465void CalendarView::newTodo()
3466{ 3466{
3467 newTodoDateTime( QDateTime(),true ); 3467 newTodoDateTime( QDateTime(),true );
3468} 3468}
3469 3469
3470void CalendarView::newSubTodo() 3470void CalendarView::newSubTodo()
3471{ 3471{
3472 Todo *todo = selectedTodo(); 3472 Todo *todo = selectedTodo();
3473 if ( todo ) newSubTodo( todo ); 3473 if ( todo ) newSubTodo( todo );
3474} 3474}
3475 3475
3476void CalendarView::newSubTodo(Todo *parentEvent) 3476void CalendarView::newSubTodo(Todo *parentEvent)
3477{ 3477{
3478 3478
3479 showTodoEditor(); 3479 showTodoEditor();
3480 mTodoEditor->newTodo(QDateTime(),parentEvent,true); 3480 mTodoEditor->newTodo(QDateTime(),parentEvent,true);
3481 mTodoEditor->exec(); 3481 mTodoEditor->exec();
3482 setActiveWindow(); 3482 setActiveWindow();
3483} 3483}
3484 3484
3485void CalendarView::newFloatingEvent() 3485void CalendarView::newFloatingEvent()
3486{ 3486{
3487 DateList tmpList = mNavigator->selectedDates(); 3487 DateList tmpList = mNavigator->selectedDates();
3488 QDate date = tmpList.first(); 3488 QDate date = tmpList.first();
3489 3489
3490 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 3490 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
3491 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 3491 QDateTime( date, QTime( 12, 0, 0 ) ), true );
3492} 3492}
3493 3493
3494 3494
3495void CalendarView::editEvent( Event *event ) 3495void CalendarView::editEvent( Event *event )
3496{ 3496{
3497 3497
3498 if ( !event ) return; 3498 if ( !event ) return;
3499 if ( event->isReadOnly() ) { 3499 if ( event->isReadOnly() ) {
3500 showEvent( event ); 3500 showEvent( event );
3501 return; 3501 return;
3502 } 3502 }
3503 showEventEditor(); 3503 showEventEditor();
3504 mEventEditor->editEvent( event , mFlagEditDescription); 3504 mEventEditor->editEvent( event , mFlagEditDescription);
3505 mEventEditor->exec(); 3505 mEventEditor->exec();
3506 setActiveWindow(); 3506 setActiveWindow();
3507 3507
3508} 3508}
3509void CalendarView::editJournal( Journal *jour ) 3509void CalendarView::editJournal( Journal *jour )
3510{ 3510{
3511 if ( !jour ) return; 3511 if ( !jour ) return;
3512 mDialogManager->hideSearchDialog(); 3512 mDialogManager->hideSearchDialog();
3513 mViewManager->showJournalView(); 3513 mViewManager->showJournalView();
3514 mNavigator->slotDaySelect( jour->dtStart().date() ); 3514 mNavigator->slotDaySelect( jour->dtStart().date() );
3515} 3515}
3516void CalendarView::editTodo( Todo *todo ) 3516void CalendarView::editTodo( Todo *todo )
3517{ 3517{
3518 if ( !todo ) return; 3518 if ( !todo ) return;
3519 3519
3520 if ( todo->isReadOnly() ) { 3520 if ( todo->isReadOnly() ) {
3521 showTodo( todo ); 3521 showTodo( todo );
3522 return; 3522 return;
3523 } 3523 }
3524 showTodoEditor(); 3524 showTodoEditor();
3525 mTodoEditor->editTodo( todo ,mFlagEditDescription); 3525 mTodoEditor->editTodo( todo ,mFlagEditDescription);
3526 mTodoEditor->exec(); 3526 mTodoEditor->exec();
3527 setActiveWindow(); 3527 setActiveWindow();
3528 3528
3529} 3529}
3530 3530
3531KOEventViewerDialog* CalendarView::getEventViewerDialog() 3531KOEventViewerDialog* CalendarView::getEventViewerDialog()
3532{ 3532{
3533 if ( !mEventViewerDialog ) { 3533 if ( !mEventViewerDialog ) {
3534 mEventViewerDialog = new KOEventViewerDialog(0); 3534 mEventViewerDialog = new KOEventViewerDialog(0);
3535 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 3535 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
3536 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 3536 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
3537 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 3537 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
3538 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 3538 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
3539 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 3539 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
3540 viewManager(), SLOT( showAgendaView( bool ) ) ); 3540 viewManager(), SLOT( showAgendaView( bool ) ) );
3541 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), 3541 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()),
3542 this, SLOT( slotViewerClosed() ) ); 3542 this, SLOT( slotViewerClosed() ) );
3543 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), 3543 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
3544 this, SLOT( todoChanged(Todo *) ) ); 3544 this, SLOT( todoChanged(Todo *) ) );
3545 connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 3545 connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
3546 mEventViewerDialog->resize( 640, 480 ); 3546 mEventViewerDialog->resize( 640, 480 );
3547 3547
3548 } 3548 }
3549 return mEventViewerDialog; 3549 return mEventViewerDialog;
3550} 3550}
3551void CalendarView::showEvent(Event *event) 3551void CalendarView::showEvent(Event *event)
3552{ 3552{
3553 getEventViewerDialog()->setEvent(event); 3553 getEventViewerDialog()->setEvent(event);
3554 getEventViewerDialog()->showMe(); 3554 getEventViewerDialog()->showMe();
3555} 3555}
3556 3556
3557void CalendarView::showTodo(Todo *event) 3557void CalendarView::showTodo(Todo *event)
3558{ 3558{
3559 getEventViewerDialog()->setTodo(event); 3559 getEventViewerDialog()->setTodo(event);
3560 getEventViewerDialog()->showMe(); 3560 getEventViewerDialog()->showMe();
3561} 3561}
3562void CalendarView::showJournal( Journal *jour ) 3562void CalendarView::showJournal( Journal *jour )
3563{ 3563{
3564 getEventViewerDialog()->setJournal(jour); 3564 getEventViewerDialog()->setJournal(jour);
3565 getEventViewerDialog()->showMe(); 3565 getEventViewerDialog()->showMe();
3566 3566
3567} 3567}
3568// void CalendarView::todoModified (Todo *event, int changed) 3568// void CalendarView::todoModified (Todo *event, int changed)
3569// { 3569// {
3570// // if (mDialogList.find (event) != mDialogList.end ()) { 3570// // if (mDialogList.find (event) != mDialogList.end ()) {
3571// // kdDebug() << "Todo modified and open" << endl; 3571// // kdDebug() << "Todo modified and open" << endl;
3572// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; 3572// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event];
3573// // temp->modified (changed); 3573// // temp->modified (changed);
3574 3574
3575// // } 3575// // }
3576 3576
3577// mViewManager->updateView(); 3577// mViewManager->updateView();
3578// } 3578// }
3579 3579
3580void CalendarView::appointment_show() 3580void CalendarView::appointment_show()
3581{ 3581{
3582 Event *anEvent = 0; 3582 Event *anEvent = 0;
3583 3583
3584 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3584 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3585 3585
3586 if (mViewManager->currentView()->isEventView()) { 3586 if (mViewManager->currentView()->isEventView()) {
3587 if ( incidence && incidence->typeID() == eventID ) { 3587 if ( incidence && incidence->typeID() == eventID ) {
3588 anEvent = static_cast<Event *>(incidence); 3588 anEvent = static_cast<Event *>(incidence);
3589 } 3589 }
3590 } 3590 }
3591 3591
3592 if (!anEvent) { 3592 if (!anEvent) {
3593 KNotifyClient::beep(); 3593 KNotifyClient::beep();
3594 return; 3594 return;
3595 } 3595 }
3596 3596
3597 showEvent(anEvent); 3597 showEvent(anEvent);
3598} 3598}
3599 3599
3600void CalendarView::appointment_edit() 3600void CalendarView::appointment_edit()
3601{ 3601{
3602 Event *anEvent = 0; 3602 Event *anEvent = 0;
3603 3603
3604 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3604 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3605 3605
3606 if (mViewManager->currentView()->isEventView()) { 3606 if (mViewManager->currentView()->isEventView()) {
3607 if ( incidence && incidence->typeID() == eventID ) { 3607 if ( incidence && incidence->typeID() == eventID ) {
3608 anEvent = static_cast<Event *>(incidence); 3608 anEvent = static_cast<Event *>(incidence);
3609 } 3609 }
3610 } 3610 }
3611 3611
3612 if (!anEvent) { 3612 if (!anEvent) {
3613 KNotifyClient::beep(); 3613 KNotifyClient::beep();
3614 return; 3614 return;
3615 } 3615 }
3616 3616
3617 editEvent(anEvent); 3617 editEvent(anEvent);
3618} 3618}
3619 3619
3620void CalendarView::appointment_delete() 3620void CalendarView::appointment_delete()
3621{ 3621{
3622 Event *anEvent = 0; 3622 Event *anEvent = 0;
3623 3623
3624 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3624 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3625 3625
3626 if (mViewManager->currentView()->isEventView()) { 3626 if (mViewManager->currentView()->isEventView()) {
3627 if ( incidence && incidence->typeID() == eventID ) { 3627 if ( incidence && incidence->typeID() == eventID ) {
3628 anEvent = static_cast<Event *>(incidence); 3628 anEvent = static_cast<Event *>(incidence);
3629 } 3629 }
3630 } 3630 }
3631 3631
3632 if (!anEvent) { 3632 if (!anEvent) {
3633 KNotifyClient::beep(); 3633 KNotifyClient::beep();
3634 return; 3634 return;
3635 } 3635 }
3636 3636
3637 deleteEvent(anEvent); 3637 deleteEvent(anEvent);
3638} 3638}
3639 3639
3640void CalendarView::todo_resub( Todo * parent, Todo * sub ) 3640void CalendarView::todo_resub( Todo * parent, Todo * sub )
3641{ 3641{
3642 if (!sub) return; 3642 if (!sub) return;
3643 if ( sub->relatedTo() == parent ) 3643 if ( sub->relatedTo() == parent )
3644 return; 3644 return;
3645 sub->setRelatedTo(parent); 3645 sub->setRelatedTo(parent);
3646 sub->updated(); 3646 sub->updated();
3647 setModified(true); 3647 setModified(true);
3648 updateView(); 3648 updateView();
3649} 3649}
3650void CalendarView::todo_unsub(Todo *anTodo ) 3650void CalendarView::todo_unsub(Todo *anTodo )
3651{ 3651{
3652 todo_resub( 0, anTodo ); 3652 todo_resub( 0, anTodo );
3653} 3653}
3654 3654
3655void CalendarView::deleteTodo(Todo *todo) 3655void CalendarView::deleteTodo(Todo *todo)
3656{ 3656{
3657 if (!todo) { 3657 if (!todo) {
3658 KNotifyClient::beep(); 3658 KNotifyClient::beep();
3659 return; 3659 return;
3660 } 3660 }
3661 if (KOPrefs::instance()->mConfirm) { 3661 if (KOPrefs::instance()->mConfirm) {
3662 QString text = KGlobal::formatMessage ( todo->summary(),0 ); 3662 QString text = KGlobal::formatMessage ( todo->summary(),0 );
3663 if (!todo->relations().isEmpty()) { 3663 if (!todo->relations().isEmpty()) {
3664 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); 3664 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
3665 3665
3666 } 3666 }
3667 switch (msgItemDelete(i18n("Todo:") +"\n"+text)) { 3667 switch (msgItemDelete(i18n("Todo:") +"\n"+text)) {
3668 case KMessageBox::Continue: // OK 3668 case KMessageBox::Continue: // OK
3669 bool deleteT = false; 3669 bool deleteT = false;
3670 if (!todo->relations().isEmpty()) { 3670 if (!todo->relations().isEmpty()) {
3671 deleteT = removeCompletedSubTodos( todo ); 3671 deleteT = removeCompletedSubTodos( todo );
3672 } 3672 }
3673 // deleteT == true: todo already deleted in removeCompletedSubTodos 3673 // deleteT == true: todo already deleted in removeCompletedSubTodos
3674 if ( !deleteT ) { 3674 if ( !deleteT ) {
3675 checkExternalId( todo ); 3675 checkExternalId( todo );
3676 calendar()->deleteTodo(todo); 3676 calendar()->deleteTodo(todo);
3677 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 3677 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
3678 updateView(); 3678 updateView();
3679 } 3679 }
3680 break; 3680 break;
3681 } // switch 3681 } // switch
3682 } else { 3682 } else {
3683 checkExternalId( todo ); 3683 checkExternalId( todo );
3684 mCalendar->deleteTodo(todo); 3684 mCalendar->deleteTodo(todo);
3685 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 3685 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
3686 updateView(); 3686 updateView();
3687 } 3687 }
3688 3688
3689 emit updateSearchDialog(); 3689 emit updateSearchDialog();
3690} 3690}
3691void CalendarView::deleteJournal(Journal *jour) 3691void CalendarView::deleteJournal(Journal *jour)
3692{ 3692{
3693 if (!jour) { 3693 if (!jour) {
3694 KNotifyClient::beep(); 3694 KNotifyClient::beep();
3695 return; 3695 return;
3696 } 3696 }
3697 if (KOPrefs::instance()->mConfirm) { 3697 if (KOPrefs::instance()->mConfirm) {
3698 3698
3699 QString des; 3699 QString des;
3700 if ( !jour->summary().isEmpty() ) { 3700 if ( !jour->summary().isEmpty() ) {
3701 des = jour->summary(); 3701 des = jour->summary();
3702 } else { 3702 } else {
3703 des = jour->description().left(30); 3703 des = jour->description().left(30);
3704 des = des.simplifyWhiteSpace (); 3704 des = des.simplifyWhiteSpace ();
3705 des.replace (QRegExp ("\\n"),"" ); 3705 des.replace (QRegExp ("\\n"),"" );
3706 des.replace (QRegExp ("\\r"),"" ); 3706 des.replace (QRegExp ("\\r"),"" );
3707 } 3707 }
3708 switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) { 3708 switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) {
3709 case KMessageBox::Continue: // OK 3709 case KMessageBox::Continue: // OK
3710 calendar()->deleteJournal(jour); 3710 calendar()->deleteJournal(jour);
3711 updateView(); 3711 updateView();
3712 break; 3712 break;
3713 } // switch 3713 } // switch
3714 } else { 3714 } else {
3715 calendar()->deleteJournal(jour);; 3715 calendar()->deleteJournal(jour);;
3716 updateView(); 3716 updateView();
3717 } 3717 }
3718 emit updateSearchDialog(); 3718 emit updateSearchDialog();
3719} 3719}
3720 3720
3721void CalendarView::deleteEvent(Event *anEvent) 3721void CalendarView::deleteEvent(Event *anEvent)
3722{ 3722{
3723 if (!anEvent) { 3723 if (!anEvent) {
3724 KNotifyClient::beep(); 3724 KNotifyClient::beep();
3725 return; 3725 return;
3726 } 3726 }
3727 3727
3728 if (anEvent->recurrence()->doesRecur()) { 3728 if (anEvent->recurrence()->doesRecur()) {
3729 QDate itemDate = mViewManager->currentSelectionDate(); 3729 QDate itemDate = mViewManager->currentSelectionDate();
3730 int km; 3730 int km;
3731 if (!itemDate.isValid()) { 3731 if (!itemDate.isValid()) {
3732 //kdDebug() << "Date Not Valid" << endl; 3732 //kdDebug() << "Date Not Valid" << endl;
3733 if (KOPrefs::instance()->mConfirm) { 3733 if (KOPrefs::instance()->mConfirm) {
3734 km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + 3734 km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3735 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 3735 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
3736 i18n("KO/Pi Confirmation"),i18n("Delete All")); 3736 i18n("KO/Pi Confirmation"),i18n("Delete All"));
3737 if ( km == KMessageBox::Continue ) 3737 if ( km == KMessageBox::Continue )
3738 km = KMessageBox::No; // No = all below 3738 km = KMessageBox::No; // No = all below
3739 } else 3739 } else
3740 km = KMessageBox::No; 3740 km = KMessageBox::No;
3741 } else { 3741 } else {
3742 km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + 3742 km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3743 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 3743 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
3744 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), 3744 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
3745 i18n("KO/Pi Confirmation"),i18n("Current"), 3745 i18n("KO/Pi Confirmation"),i18n("Current"),
3746 i18n("All")); 3746 i18n("All"));
3747 } 3747 }
3748 switch(km) { 3748 switch(km) {
3749 3749
3750 case KMessageBox::No: // Continue // all 3750 case KMessageBox::No: // Continue // all
3751 //qDebug("KMessageBox::No "); 3751 //qDebug("KMessageBox::No ");
3752 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3752 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3753 schedule(Scheduler::Cancel,anEvent); 3753 schedule(Scheduler::Cancel,anEvent);
3754 3754
3755 checkExternalId( anEvent); 3755 checkExternalId( anEvent);
3756 mCalendar->deleteEvent(anEvent); 3756 mCalendar->deleteEvent(anEvent);
3757 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); 3757 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED);
3758 break; 3758 break;
3759 3759
3760 // Disabled because it does not work 3760 // Disabled because it does not work
3761 //#if 0 3761 //#if 0
3762 case KMessageBox::Yes: // just this one 3762 case KMessageBox::Yes: // just this one
3763 //QDate qd = mNavigator->selectedDates().first(); 3763 //QDate qd = mNavigator->selectedDates().first();
3764 //if (!qd.isValid()) { 3764 //if (!qd.isValid()) {
3765 // kdDebug() << "no date selected, or invalid date" << endl; 3765 // kdDebug() << "no date selected, or invalid date" << endl;
3766 // KNotifyClient::beep(); 3766 // KNotifyClient::beep();
3767 // return; 3767 // return;
3768 //} 3768 //}
3769 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); 3769 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1);
3770 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { 3770 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) {
3771 anEvent->addExDate(itemDate); 3771 anEvent->addExDate(itemDate);
3772 int duration = anEvent->recurrence()->duration(); 3772 int duration = anEvent->recurrence()->duration();
3773 if ( duration > 0 ) { 3773 if ( duration > 0 ) {
3774 anEvent->recurrence()->setDuration( duration - 1 ); 3774 anEvent->recurrence()->setDuration( duration - 1 );
3775 } 3775 }
3776 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); 3776 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
3777 } 3777 }
3778 break; 3778 break;
3779 //#endif 3779 //#endif
3780 } // switch 3780 } // switch
3781 } else { 3781 } else {
3782 if (KOPrefs::instance()->mConfirm) { 3782 if (KOPrefs::instance()->mConfirm) {
3783 switch (KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + 3783 switch (KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3784 i18n("\nAre you sure you want\nto delete this event?"), 3784 i18n("\nAre you sure you want\nto delete this event?"),
3785 i18n("KO/Pi Confirmation"),i18n("Delete"))) { 3785 i18n("KO/Pi Confirmation"),i18n("Delete"))) {
3786 case KMessageBox::Continue: // OK 3786 case KMessageBox::Continue: // OK
3787 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3787 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3788 schedule(Scheduler::Cancel,anEvent); 3788 schedule(Scheduler::Cancel,anEvent);
3789 checkExternalId( anEvent); 3789 checkExternalId( anEvent);
3790 mCalendar->deleteEvent(anEvent); 3790 mCalendar->deleteEvent(anEvent);
3791 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3791 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3792 break; 3792 break;
3793 } // switch 3793 } // switch
3794 } else { 3794 } else {
3795 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3795 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3796 schedule(Scheduler::Cancel,anEvent); 3796 schedule(Scheduler::Cancel,anEvent);
3797 checkExternalId( anEvent); 3797 checkExternalId( anEvent);
3798 mCalendar->deleteEvent(anEvent); 3798 mCalendar->deleteEvent(anEvent);
3799 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3799 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3800 } 3800 }
3801 } // if-else 3801 } // if-else
3802 emit updateSearchDialog(); 3802 emit updateSearchDialog();
3803} 3803}
3804 3804
3805bool CalendarView::deleteEvent(const QString &uid) 3805bool CalendarView::deleteEvent(const QString &uid)
3806{ 3806{
3807 Event *ev = mCalendar->event(uid); 3807 Event *ev = mCalendar->event(uid);
3808 if (ev) { 3808 if (ev) {
3809 deleteEvent(ev); 3809 deleteEvent(ev);
3810 return true; 3810 return true;
3811 } else { 3811 } else {
3812 return false; 3812 return false;
3813 } 3813 }
3814} 3814}
3815 3815
3816/*****************************************************************************/ 3816/*****************************************************************************/
3817 3817
3818void CalendarView::action_mail() 3818void CalendarView::action_mail()
3819{ 3819{
3820#ifndef KORG_NOMAIL 3820#ifndef KORG_NOMAIL
3821 KOMailClient mailClient; 3821 KOMailClient mailClient;
3822 3822
3823 Incidence *incidence = currentSelection(); 3823 Incidence *incidence = currentSelection();
3824 3824
3825 if (!incidence) { 3825 if (!incidence) {
3826 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3826 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3827 return; 3827 return;
3828 } 3828 }
3829 if(incidence->attendeeCount() == 0 ) { 3829 if(incidence->attendeeCount() == 0 ) {
3830 KMessageBox::sorry(this, 3830 KMessageBox::sorry(this,
3831 i18n("Can't generate mail:\nNo attendees defined.\n")); 3831 i18n("Can't generate mail:\nNo attendees defined.\n"));
3832 return; 3832 return;
3833 } 3833 }
3834 3834
3835 CalendarLocal cal_tmp; 3835 CalendarLocal cal_tmp;
3836 Event *event = 0; 3836 Event *event = 0;
3837 Event *ev = 0; 3837 Event *ev = 0;
3838 if ( incidence && incidence->typeID() == eventID ) { 3838 if ( incidence && incidence->typeID() == eventID ) {
3839 event = static_cast<Event *>(incidence); 3839 event = static_cast<Event *>(incidence);
3840 ev = new Event(*event); 3840 ev = new Event(*event);
3841 cal_tmp.addEvent(ev); 3841 cal_tmp.addEvent(ev);
3842 } 3842 }
3843 ICalFormat mForm(); 3843 ICalFormat mForm();
3844 QString attachment = mForm.toString( &cal_tmp ); 3844 QString attachment = mForm.toString( &cal_tmp );
3845 if (ev) delete(ev); 3845 if (ev) delete(ev);
3846 3846
3847 mailClient.mailAttendees(currentSelection(), attachment); 3847 mailClient.mailAttendees(currentSelection(), attachment);
3848 3848
3849#endif 3849#endif
3850 3850
3851#if 0 3851#if 0
3852 Event *anEvent = 0; 3852 Event *anEvent = 0;
3853 if (mViewManager->currentView()->isEventView()) { 3853 if (mViewManager->currentView()->isEventView()) {
3854 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); 3854 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first());
3855 } 3855 }
3856 3856
3857 if (!anEvent) { 3857 if (!anEvent) {
3858 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3858 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3859 return; 3859 return;
3860 } 3860 }
3861 if(anEvent->attendeeCount() == 0 ) { 3861 if(anEvent->attendeeCount() == 0 ) {
3862 KMessageBox::sorry(this, 3862 KMessageBox::sorry(this,
3863 i18n("Can't generate mail:\nNo attendees defined.\n")); 3863 i18n("Can't generate mail:\nNo attendees defined.\n"));
3864 return; 3864 return;
3865 } 3865 }
3866 3866
3867 mailobject.emailEvent(anEvent); 3867 mailobject.emailEvent(anEvent);
3868#endif 3868#endif
3869} 3869}
3870 3870
3871 3871
3872void CalendarView::schedule_publish(Incidence *incidence) 3872void CalendarView::schedule_publish(Incidence *incidence)
3873{ 3873{
3874 Event *event = 0; 3874 Event *event = 0;
3875 Todo *todo = 0; 3875 Todo *todo = 0;
3876 3876
3877 if (incidence == 0) { 3877 if (incidence == 0) {
3878 incidence = mViewManager->currentView()->selectedIncidences().first(); 3878 incidence = mViewManager->currentView()->selectedIncidences().first();
3879 if (incidence == 0) { 3879 if (incidence == 0) {
3880 incidence = mTodoList->selectedIncidences().first(); 3880 incidence = mTodoList->selectedIncidences().first();
3881 } 3881 }
3882 } 3882 }
3883 if ( incidence && incidence->typeID() == eventID ) { 3883 if ( incidence && incidence->typeID() == eventID ) {
3884 event = static_cast<Event *>(incidence); 3884 event = static_cast<Event *>(incidence);
3885 } else { 3885 } else {
3886 if ( incidence && incidence->typeID() == todoID ) { 3886 if ( incidence && incidence->typeID() == todoID ) {
3887 todo = static_cast<Todo *>(incidence); 3887 todo = static_cast<Todo *>(incidence);
3888 } 3888 }
3889 } 3889 }
3890 3890
3891 if (!event && !todo) { 3891 if (!event && !todo) {
3892 KMessageBox::sorry(this,i18n("No event selected.")); 3892 KMessageBox::sorry(this,i18n("No event selected."));
3893 return; 3893 return;
3894 } 3894 }
3895 3895
3896 PublishDialog *publishdlg = new PublishDialog(); 3896 PublishDialog *publishdlg = new PublishDialog();
3897 if (incidence->attendeeCount()>0) { 3897 if (incidence->attendeeCount()>0) {
3898 QPtrList<Attendee> attendees = incidence->attendees(); 3898 QPtrList<Attendee> attendees = incidence->attendees();
3899 attendees.first(); 3899 attendees.first();
3900 while ( attendees.current()!=0 ) { 3900 while ( attendees.current()!=0 ) {
3901 publishdlg->addAttendee(attendees.current()); 3901 publishdlg->addAttendee(attendees.current());
3902 attendees.next(); 3902 attendees.next();
3903 } 3903 }
3904 } 3904 }
3905 bool send = true; 3905 bool send = true;
3906 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { 3906 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) {
3907 if ( publishdlg->exec() != QDialog::Accepted ) 3907 if ( publishdlg->exec() != QDialog::Accepted )
3908 send = false; 3908 send = false;
3909 } 3909 }
3910 if ( send ) { 3910 if ( send ) {
3911 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3911 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3912 if ( event ) { 3912 if ( event ) {
3913 Event *ev = new Event(*event); 3913 Event *ev = new Event(*event);
3914 ev->registerObserver(0); 3914 ev->registerObserver(0);
3915 ev->clearAttendees(); 3915 ev->clearAttendees();
3916 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3916 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3917 delete(ev); 3917 delete(ev);
3918 } 3918 }
3919 } else { 3919 } else {
3920 if ( todo ) { 3920 if ( todo ) {
3921 Todo *ev = new Todo(*todo); 3921 Todo *ev = new Todo(*todo);
3922 ev->registerObserver(0); 3922 ev->registerObserver(0);
3923 ev->clearAttendees(); 3923 ev->clearAttendees();
3924 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3924 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3925 delete(ev); 3925 delete(ev);
3926 } 3926 }
3927 } 3927 }
3928 } 3928 }
3929 } 3929 }
3930 delete publishdlg; 3930 delete publishdlg;
3931} 3931}
3932 3932
3933void CalendarView::schedule_request(Incidence *incidence) 3933void CalendarView::schedule_request(Incidence *incidence)
3934{ 3934{
3935 schedule(Scheduler::Request,incidence); 3935 schedule(Scheduler::Request,incidence);
3936} 3936}
3937 3937
3938void CalendarView::schedule_refresh(Incidence *incidence) 3938void CalendarView::schedule_refresh(Incidence *incidence)
3939{ 3939{
3940 schedule(Scheduler::Refresh,incidence); 3940 schedule(Scheduler::Refresh,incidence);
3941} 3941}
3942 3942
3943void CalendarView::schedule_cancel(Incidence *incidence) 3943void CalendarView::schedule_cancel(Incidence *incidence)
3944{ 3944{
3945 schedule(Scheduler::Cancel,incidence); 3945 schedule(Scheduler::Cancel,incidence);
3946} 3946}
3947 3947
3948void CalendarView::schedule_add(Incidence *incidence) 3948void CalendarView::schedule_add(Incidence *incidence)
3949{ 3949{
3950 schedule(Scheduler::Add,incidence); 3950 schedule(Scheduler::Add,incidence);
3951} 3951}
3952 3952
3953void CalendarView::schedule_reply(Incidence *incidence) 3953void CalendarView::schedule_reply(Incidence *incidence)
3954{ 3954{
3955 schedule(Scheduler::Reply,incidence); 3955 schedule(Scheduler::Reply,incidence);
3956} 3956}
3957 3957
3958void CalendarView::schedule_counter(Incidence *incidence) 3958void CalendarView::schedule_counter(Incidence *incidence)
3959{ 3959{
3960 schedule(Scheduler::Counter,incidence); 3960 schedule(Scheduler::Counter,incidence);
3961} 3961}
3962 3962
3963void CalendarView::schedule_declinecounter(Incidence *incidence) 3963void CalendarView::schedule_declinecounter(Incidence *incidence)
3964{ 3964{
3965 schedule(Scheduler::Declinecounter,incidence); 3965 schedule(Scheduler::Declinecounter,incidence);
3966} 3966}
3967 3967
3968void CalendarView::schedule_publish_freebusy(int daysToPublish) 3968void CalendarView::schedule_publish_freebusy(int daysToPublish)
3969{ 3969{
3970 QDateTime start = QDateTime::currentDateTime(); 3970 QDateTime start = QDateTime::currentDateTime();
3971 QDateTime end = start.addDays(daysToPublish); 3971 QDateTime end = start.addDays(daysToPublish);
3972 3972
3973 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); 3973 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
3974 freebusy->setOrganizer(KOPrefs::instance()->email()); 3974 freebusy->setOrganizer(KOPrefs::instance()->email());
3975 3975
3976 3976
3977 PublishDialog *publishdlg = new PublishDialog(); 3977 PublishDialog *publishdlg = new PublishDialog();
3978 if ( publishdlg->exec() == QDialog::Accepted ) { 3978 if ( publishdlg->exec() == QDialog::Accepted ) {
3979 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3979 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3980 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { 3980 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) {
3981 delete(freebusy); 3981 delete(freebusy);
3982 } 3982 }
3983 } 3983 }
3984 delete publishdlg; 3984 delete publishdlg;
3985} 3985}
3986 3986
3987void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) 3987void CalendarView::schedule(Scheduler::Method method, Incidence *incidence)
3988{ 3988{
3989 Event *event = 0; 3989 Event *event = 0;
3990 Todo *todo = 0; 3990 Todo *todo = 0;
3991 3991
3992 if (incidence == 0) { 3992 if (incidence == 0) {
3993 incidence = mViewManager->currentView()->selectedIncidences().first(); 3993 incidence = mViewManager->currentView()->selectedIncidences().first();
3994 if (incidence == 0) { 3994 if (incidence == 0) {
3995 incidence = mTodoList->selectedIncidences().first(); 3995 incidence = mTodoList->selectedIncidences().first();
3996 } 3996 }
3997 } 3997 }
3998 if ( incidence && incidence->typeID() == eventID ) { 3998 if ( incidence && incidence->typeID() == eventID ) {
3999 event = static_cast<Event *>(incidence); 3999 event = static_cast<Event *>(incidence);
4000 } 4000 }
4001 if ( incidence && incidence->typeID() == todoID ) { 4001 if ( incidence && incidence->typeID() == todoID ) {
4002 todo = static_cast<Todo *>(incidence); 4002 todo = static_cast<Todo *>(incidence);
4003 } 4003 }
4004 4004
4005 if (!event && !todo) { 4005 if (!event && !todo) {
4006 KMessageBox::sorry(this,i18n("No event selected.")); 4006 KMessageBox::sorry(this,i18n("No event selected."));
4007 return; 4007 return;
4008 } 4008 }
4009 4009
4010 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { 4010 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) {
4011 KMessageBox::sorry(this,i18n("The event has no attendees.")); 4011 KMessageBox::sorry(this,i18n("The event has no attendees."));
4012 return; 4012 return;
4013 } 4013 }
4014 4014
4015 Event *ev = 0; 4015 Event *ev = 0;
4016 if (event) ev = new Event(*event); 4016 if (event) ev = new Event(*event);
4017 Todo *to = 0; 4017 Todo *to = 0;
4018 if (todo) to = new Todo(*todo); 4018 if (todo) to = new Todo(*todo);
4019 4019
4020 if (method == Scheduler::Reply || method == Scheduler::Refresh) { 4020 if (method == Scheduler::Reply || method == Scheduler::Refresh) {
4021 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 4021 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
4022 if (!me) { 4022 if (!me) {
4023 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); 4023 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails."));
4024 return; 4024 return;
4025 } 4025 }
4026 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { 4026 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) {
4027 StatusDialog *statdlg = new StatusDialog(this); 4027 StatusDialog *statdlg = new StatusDialog(this);
4028 if (!statdlg->exec()==QDialog::Accepted) return; 4028 if (!statdlg->exec()==QDialog::Accepted) return;
4029 me->setStatus( statdlg->status() ); 4029 me->setStatus( statdlg->status() );
4030 delete(statdlg); 4030 delete(statdlg);
4031 } 4031 }
4032 Attendee *menew = new Attendee(*me); 4032 Attendee *menew = new Attendee(*me);
4033 if (ev) { 4033 if (ev) {
4034 ev->clearAttendees(); 4034 ev->clearAttendees();
4035 ev->addAttendee(menew,false); 4035 ev->addAttendee(menew,false);
4036 } else { 4036 } else {
4037 if (to) { 4037 if (to) {
4038 todo->clearAttendees(); 4038 todo->clearAttendees();
4039 todo->addAttendee(menew,false); 4039 todo->addAttendee(menew,false);
4040 } 4040 }
4041 } 4041 }
4042 } 4042 }
4043 4043
4044 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 4044 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
4045 if (ev) { 4045 if (ev) {
4046 if ( !dlg->addMessage(ev,method) ) delete(ev); 4046 if ( !dlg->addMessage(ev,method) ) delete(ev);
4047 } else { 4047 } else {
4048 if (to) { 4048 if (to) {
4049 if ( !dlg->addMessage(to,method) ) delete(to); 4049 if ( !dlg->addMessage(to,method) ) delete(to);
4050 } 4050 }
4051 } 4051 }
4052} 4052}
4053 4053
4054void CalendarView::openAddressbook() 4054void CalendarView::openAddressbook()
4055{ 4055{
4056 KRun::runCommand("kaddressbook"); 4056 KRun::runCommand("kaddressbook");
4057} 4057}
4058 4058
4059void CalendarView::setModified(bool modified) 4059void CalendarView::setModified(bool modified)
4060{ 4060{
4061 if ( modified ) 4061 if ( modified )
4062 emit signalmodified(); 4062 emit signalmodified();
4063 if (mModified != modified) { 4063 if (mModified != modified) {
4064 mModified = modified; 4064 mModified = modified;
4065 emit modifiedChanged(mModified); 4065 emit modifiedChanged(mModified);
4066 } 4066 }
4067} 4067}
4068 4068
4069bool CalendarView::isReadOnly() 4069bool CalendarView::isReadOnly()
4070{ 4070{
4071 return mReadOnly; 4071 return mReadOnly;
4072} 4072}
4073 4073
4074void CalendarView::setReadOnly(bool readOnly) 4074void CalendarView::setReadOnly(bool readOnly)
4075{ 4075{
4076 if (mReadOnly != readOnly) { 4076 if (mReadOnly != readOnly) {
4077 mReadOnly = readOnly; 4077 mReadOnly = readOnly;
4078 emit readOnlyChanged(mReadOnly); 4078 emit readOnlyChanged(mReadOnly);
4079 } 4079 }
4080} 4080}
4081 4081
4082bool CalendarView::isModified() 4082bool CalendarView::isModified()
4083{ 4083{
4084 return mModified; 4084 return mModified;
4085} 4085}
4086void CalendarView::slotprintSelInc() 4086void CalendarView::slotprintSelInc()
4087{ 4087{
4088 if ( currentSelection() == 0 ) { 4088 if ( currentSelection() == 0 ) {
4089 KMessageBox::sorry(this,i18n("There is nothing selected!")); 4089 KMessageBox::sorry(this,i18n("There is nothing selected!"));
4090 return; 4090 return;
4091 } 4091 }
4092 showIncidence(); 4092 showIncidence();
4093 getEventViewerDialog()->print(); 4093 getEventViewerDialog()->print();
4094 4094
4095} 4095}
4096void CalendarView::printSetup() 4096void CalendarView::printSetup()
4097{ 4097{
4098#ifndef KORG_NOPRINTER 4098#ifndef KORG_NOPRINTER
4099 createPrinter(); 4099 createPrinter();
4100 4100
4101 mCalPrinter->setupPrinter(); 4101 mCalPrinter->setupPrinter();
4102#endif 4102#endif
4103} 4103}
4104 4104
4105void CalendarView::print() 4105void CalendarView::print()
4106{ 4106{
4107#ifndef KORG_NOPRINTER 4107#ifndef KORG_NOPRINTER
4108 createPrinter(); 4108 createPrinter();
4109 4109
4110 DateList tmpDateList = mNavigator->selectedDates(); 4110 DateList tmpDateList = mNavigator->selectedDates();
4111 mCalPrinter->print(CalPrinter::Month, 4111 mCalPrinter->print(CalPrinter::Month,
4112 tmpDateList.first(), tmpDateList.last()); 4112 tmpDateList.first(), tmpDateList.last());
4113#endif 4113#endif
4114} 4114}
4115 4115
4116void CalendarView::printPreview() 4116void CalendarView::printPreview()
4117{ 4117{
4118#ifndef KORG_NOPRINTER 4118#ifndef KORG_NOPRINTER
4119 kdDebug() << "CalendarView::printPreview()" << endl; 4119 kdDebug() << "CalendarView::printPreview()" << endl;
4120 4120
4121 createPrinter(); 4121 createPrinter();
4122 4122
4123 DateList tmpDateList = mNavigator->selectedDates(); 4123 DateList tmpDateList = mNavigator->selectedDates();
4124 4124
4125 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), 4125 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(),
4126 tmpDateList.last()); 4126 tmpDateList.last());
4127#endif 4127#endif
4128} 4128}
4129 4129
4130void CalendarView::exportICalendar() 4130void CalendarView::exportICalendar()
4131{ 4131{
4132 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); 4132 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this);
4133 4133
4134 // Force correct extension 4134 // Force correct extension
4135 if (filename.right(4) != ".ics") filename += ".ics"; 4135 if (filename.right(4) != ".ics") filename += ".ics";
4136 4136
4137 FileStorage storage( mCalendar, filename, new ICalFormat() ); 4137 FileStorage storage( mCalendar, filename, new ICalFormat() );
4138 storage.save(); 4138 storage.save();
4139} 4139}
4140 4140
4141bool CalendarView::exportVCalendar( QString filename ) 4141bool CalendarView::exportVCalendar( QString filename )
4142{ 4142{
4143 if (mCalendar->journals().count() > 0) { 4143 if (mCalendar->journals().count() > 0) {
4144 int result = KMessageBox::warningContinueCancel(this, 4144 int result = KMessageBox::warningContinueCancel(this,
4145 i18n("The journal entries can not be\nexported to a vCalendar file."), 4145 i18n("The journal entries can not be\nexported to a vCalendar file."),
4146 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 4146 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
4147 true); 4147 true);
4148 if (result != KMessageBox::Continue) return false; 4148 if (result != KMessageBox::Continue) return false;
4149 } 4149 }
4150 4150
4151 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 4151 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
4152 4152
4153 // Force correct extension 4153 // Force correct extension
4154 if (filename.right(4) != ".vcs") filename += ".vcs"; 4154 if (filename.right(4) != ".vcs") filename += ".vcs";
4155 4155
4156 FileStorage storage( mCalendar, filename, new VCalFormat ); 4156 FileStorage storage( mCalendar, filename, new VCalFormat );
4157 return storage.save(); 4157 return storage.save();
4158 4158
4159} 4159}
4160 4160
4161void CalendarView::eventUpdated(Incidence *) 4161void CalendarView::eventUpdated(Incidence *)
4162{ 4162{
4163 setModified(); 4163 setModified();
4164 // Don't call updateView here. The code, which has caused the update of the 4164 // Don't call updateView here. The code, which has caused the update of the
4165 // event is responsible for updating the view. 4165 // event is responsible for updating the view.
4166 // updateView(); 4166 // updateView();
4167} 4167}
4168 4168
4169void CalendarView::adaptNavigationUnits() 4169void CalendarView::adaptNavigationUnits()
4170{ 4170{
4171 if (mViewManager->currentView()->isEventView()) { 4171 if (mViewManager->currentView()->isEventView()) {
4172 int days = mViewManager->currentView()->currentDateCount(); 4172 int days = mViewManager->currentView()->currentDateCount();
4173 if (days == 1) { 4173 if (days == 1) {
4174 emit changeNavStringPrev(i18n("&Previous Day")); 4174 emit changeNavStringPrev(i18n("&Previous Day"));
4175 emit changeNavStringNext(i18n("&Next Day")); 4175 emit changeNavStringNext(i18n("&Next Day"));
4176 } else { 4176 } else {
4177 emit changeNavStringPrev(i18n("&Previous Week")); 4177 emit changeNavStringPrev(i18n("&Previous Week"));
4178 emit changeNavStringNext(i18n("&Next Week")); 4178 emit changeNavStringNext(i18n("&Next Week"));
4179 } 4179 }
4180 } 4180 }
4181} 4181}
4182 4182
4183void CalendarView::processMainViewSelection( Incidence *incidence ) 4183void CalendarView::processMainViewSelection( Incidence *incidence )
4184{ 4184{
4185 if ( incidence ) mTodoList->clearSelection(); 4185 if ( incidence ) mTodoList->clearSelection();
4186 processIncidenceSelection( incidence ); 4186 processIncidenceSelection( incidence );
4187} 4187}
4188 4188
4189void CalendarView::processTodoListSelection( Incidence *incidence ) 4189void CalendarView::processTodoListSelection( Incidence *incidence )
4190{ 4190{
4191 if ( incidence && mViewManager->currentView() ) { 4191 if ( incidence && mViewManager->currentView() ) {
4192 mViewManager->currentView()->clearSelection(); 4192 mViewManager->currentView()->clearSelection();
4193 } 4193 }
4194 processIncidenceSelection( incidence ); 4194 processIncidenceSelection( incidence );
4195} 4195}
4196 4196
4197void CalendarView::processIncidenceSelection( Incidence *incidence ) 4197void CalendarView::processIncidenceSelection( Incidence *incidence )
4198{ 4198{
4199 emit incidenceSelected( incidence ); 4199 emit incidenceSelected( incidence );
4200 if ( incidence == mSelectedIncidence ) return; 4200 if ( incidence == mSelectedIncidence ) return;
4201 mSelectedIncidence = incidence; 4201 mSelectedIncidence = incidence;
4202 4202
4203 if ( incidence && incidence->typeID() == eventID ) { 4203 if ( incidence && incidence->typeID() == eventID ) {
4204 Event *event = static_cast<Event *>( incidence ); 4204 Event *event = static_cast<Event *>( incidence );
4205 if ( event->organizer() == KOPrefs::instance()->email() ) { 4205 if ( event->organizer() == KOPrefs::instance()->email() ) {
4206 emit organizerEventsSelected( true ); 4206 emit organizerEventsSelected( true );
4207 } else { 4207 } else {
4208 emit organizerEventsSelected(false); 4208 emit organizerEventsSelected(false);
4209 } 4209 }
4210 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 4210 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
4211 KOPrefs::instance()->email() ) ) { 4211 KOPrefs::instance()->email() ) ) {
4212 emit groupEventsSelected( true ); 4212 emit groupEventsSelected( true );
4213 } else { 4213 } else {
4214 emit groupEventsSelected(false); 4214 emit groupEventsSelected(false);
4215 } 4215 }
4216 return; 4216 return;
4217 } else { 4217 } else {
4218 if ( incidence && incidence->typeID() == todoID ) { 4218 if ( incidence && incidence->typeID() == todoID ) {
4219 emit todoSelected( true ); 4219 emit todoSelected( true );
4220 Todo *event = static_cast<Todo *>( incidence ); 4220 Todo *event = static_cast<Todo *>( incidence );
4221 if ( event->organizer() == KOPrefs::instance()->email() ) { 4221 if ( event->organizer() == KOPrefs::instance()->email() ) {
4222 emit organizerEventsSelected( true ); 4222 emit organizerEventsSelected( true );
4223 } else { 4223 } else {
4224 emit organizerEventsSelected(false); 4224 emit organizerEventsSelected(false);
4225 } 4225 }
4226 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 4226 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
4227 KOPrefs::instance()->email() ) ) { 4227 KOPrefs::instance()->email() ) ) {
4228 emit groupEventsSelected( true ); 4228 emit groupEventsSelected( true );
4229 } else { 4229 } else {
4230 emit groupEventsSelected(false); 4230 emit groupEventsSelected(false);
4231 } 4231 }
4232 return; 4232 return;
4233 } else { 4233 } else {
4234 emit todoSelected( false ); 4234 emit todoSelected( false );
4235 emit organizerEventsSelected(false); 4235 emit organizerEventsSelected(false);
4236 emit groupEventsSelected(false); 4236 emit groupEventsSelected(false);
4237 } 4237 }
4238 return; 4238 return;
4239 } 4239 }
4240 4240
4241 /* if ( incidence && incidence->typeID() == todoID ) { 4241 /* if ( incidence && incidence->typeID() == todoID ) {
4242 emit todoSelected( true ); 4242 emit todoSelected( true );
4243 } else { 4243 } else {
4244 emit todoSelected( false ); 4244 emit todoSelected( false );
4245 }*/ 4245 }*/
4246} 4246}
4247 4247
4248 4248
4249void CalendarView::checkClipboard() 4249void CalendarView::checkClipboard()
4250{ 4250{
4251#ifndef KORG_NODND 4251#ifndef KORG_NODND
4252 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 4252 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
4253 emit pasteEnabled(true); 4253 emit pasteEnabled(true);
4254 } else { 4254 } else {
4255 emit pasteEnabled(false); 4255 emit pasteEnabled(false);
4256 } 4256 }
4257#endif 4257#endif
4258} 4258}
4259 4259
4260void CalendarView::showDates(const DateList &selectedDates) 4260void CalendarView::showDates(const DateList &selectedDates)
4261{ 4261{
4262 // kdDebug() << "CalendarView::selectDates()" << endl; 4262 // kdDebug() << "CalendarView::selectDates()" << endl;
4263 4263
4264 4264
4265 if ( !mBlockShowDates ) { 4265 if ( !mBlockShowDates ) {
4266 if ( mViewManager->currentView() ) { 4266 if ( mViewManager->currentView() ) {
4267 updateView( selectedDates.first(), selectedDates.last() ); 4267 updateView( selectedDates.first(), selectedDates.last() );
4268 } else { 4268 } else {
4269 mViewManager->showAgendaView(); 4269 mViewManager->showAgendaView();
4270 } 4270 }
4271 } 4271 }
4272 4272
4273 QDate date = selectedDates.first(); 4273 QDate date = selectedDates.first();
4274 if ( ! date.isValid() ) { 4274 if ( ! date.isValid() ) {
4275 topLevelWidget()->setCaption(""); 4275 topLevelWidget()->setCaption("");
4276 return; 4276 return;
4277 } 4277 }
4278 4278
4279 QString selDates; 4279 QString selDates;
4280 selDates = KGlobal::locale()->formatDate( date, true); 4280 selDates = KGlobal::locale()->formatDate( date, true);
4281 if (selectedDates.first() < selectedDates.last() ) 4281 if (selectedDates.first() < selectedDates.last() )
4282 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 4282 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
4283 else { 4283 else {
4284 QString addString; 4284 QString addString;
4285 if ( date == QDateTime::currentDateTime().date() ) 4285 if ( date == QDateTime::currentDateTime().date() )
4286 addString = i18n("Today"); 4286 addString = i18n("Today");
4287 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 4287 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
4288 addString = i18n("Tomorrow"); 4288 addString = i18n("Tomorrow");
4289 else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) 4289 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
4290 addString = i18n("Yesterday"); 4290 addString = i18n("Yesterday");
4291 else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) 4291 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
4292 addString = i18n("Day before yesterday"); 4292 addString = i18n("Day before yesterday");
4293 else if ( date == QDateTime::currentDateTime().date().addDays(2) ) 4293 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
4294 addString = i18n("Day after tomorrow"); 4294 addString = i18n("Day after tomorrow");
4295 if ( !addString.isEmpty() ) { 4295 if ( !addString.isEmpty() ) {
4296 topLevelWidget()->setCaption( addString+", " + selDates ); 4296 topLevelWidget()->setCaption( addString+", " + selDates );
4297 return; 4297 return;
4298 } 4298 }
4299 } 4299 }
4300 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 4300 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
4301 4301
4302} 4302}
4303 4303
4304QPtrList<CalFilter> CalendarView::filters() 4304QPtrList<CalFilter> CalendarView::filters()
4305{ 4305{
4306 return mFilters; 4306 return mFilters;
4307 4307
4308} 4308}
4309void CalendarView::editFilters() 4309void CalendarView::editFilters()
4310{ 4310{
4311 // kdDebug() << "CalendarView::editFilters()" << endl; 4311 // kdDebug() << "CalendarView::editFilters()" << endl;
4312 4312
4313 CalFilter *filter = mFilters.first(); 4313 CalFilter *filter = mFilters.first();
4314 while(filter) { 4314 while(filter) {
4315 filter = mFilters.next(); 4315 filter = mFilters.next();
4316 } 4316 }
4317 4317
4318 mDialogManager->showFilterEditDialog(&mFilters); 4318 mDialogManager->showFilterEditDialog(&mFilters);
4319 updateFilter(); 4319 updateFilter();
4320} 4320}
4321void CalendarView::toggleFilter() 4321void CalendarView::toggleFilter()
4322{ 4322{
4323 if ( mLeftFrame->isHidden() ) { 4323 if ( mLeftFrame->isHidden() ) {
4324 toggleExpand(); 4324 toggleExpand();
4325 showFilter( true ); 4325 showFilter( true );
4326 } else 4326 } else
4327 showFilter(! mCalEditView->isVisible()); 4327 showFilter(! mCalEditView->isVisible());
4328} 4328}
4329 4329
4330KOFilterView *CalendarView::filterView() 4330KOFilterView *CalendarView::filterView()
4331{ 4331{
4332 return mFilterView; 4332 return mFilterView;
4333} 4333}
4334void CalendarView::selectFilter( int fil ) 4334void CalendarView::selectFilter( int fil )
4335{ 4335{
4336 mFilterView->setSelectedFilter( fil ); 4336 mFilterView->setSelectedFilter( fil );
4337 updateUnmanagedViews(); 4337 updateUnmanagedViews();
4338} 4338}
4339void CalendarView::showFilter(bool visible) 4339void CalendarView::showFilter(bool visible)
4340{ 4340{
4341#if 1 4341#if 1
4342 if (visible) { 4342 if (visible) {
4343 mCalEditView->readConfig(); 4343 mCalEditView->readConfig();
4344 mCalEditView->show(); 4344 mCalEditView->show();
4345 QValueList<int> sizes; 4345 QValueList<int> sizes;
4346 sizes = mLeftFrame->sizes(); 4346 sizes = mLeftFrame->sizes();
4347 if ( sizes.count() == 4 && sizes[3] < 20 ) { 4347 if ( sizes.count() == 4 && sizes[3] < 20 ) {
4348 sizes.clear(); 4348 sizes.clear();
4349 sizes << 100; 4349 sizes << 100;
4350 sizes << 0; 4350 sizes << 0;
4351 sizes << 0; 4351 sizes << 0;
4352 sizes << 100; 4352 sizes << 100;
4353 mLeftFrame->setSizes(sizes); 4353 mLeftFrame->setSizes(sizes);
4354 } 4354 }
4355#if 0 4355#if 0
4356 sizes = mLeftFrame->sizes(); 4356 sizes = mLeftFrame->sizes();
4357 int ccc = 0; 4357 int ccc = 0;
4358 while ( ccc < sizes.count()) { 4358 while ( ccc < sizes.count()) {
4359 qDebug("size %d %d ", ccc, sizes[ccc]); 4359 qDebug("size %d %d ", ccc, sizes[ccc]);
4360 ++ccc; 4360 ++ccc;
4361 } 4361 }
4362#endif 4362#endif
4363 4363
4364 } 4364 }
4365 else { 4365 else {
4366 mCalEditView->hide(); 4366 mCalEditView->hide();
4367 } 4367 }
4368#else 4368#else
4369 if (visible) mFilterView->show(); 4369 if (visible) mFilterView->show();
4370 else mFilterView->hide(); 4370 else mFilterView->hide();
4371#endif 4371#endif
4372} 4372}
4373void CalendarView::toggleFilerEnabled( ) 4373void CalendarView::toggleFilerEnabled( )
4374{ 4374{
4375 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 4375 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
4376 if ( !mFilterView->filtersEnabled() ) 4376 if ( !mFilterView->filtersEnabled() )
4377 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 4377 topLevelWidget()->setCaption( i18n("Filter disabled ") );
4378 updateUnmanagedViews(); 4378 updateUnmanagedViews();
4379 4379
4380} 4380}
4381void CalendarView::updateFilter() 4381void CalendarView::updateFilter()
4382{ 4382{
4383 CalFilter *filter = mFilterView->selectedFilter(); 4383 CalFilter *filter = mFilterView->selectedFilter();
4384 if (filter) { 4384 if (filter) {
4385 QString mess; 4385 QString mess;
4386 if (mFilterView->filtersEnabled()) { 4386 if (mFilterView->filtersEnabled()) {
4387 mess = i18n("Filter selected: ")+filter->name(); 4387 mess = i18n("Filter selected: ")+filter->name();
4388 filter->setEnabled(true); 4388 filter->setEnabled(true);
4389 } 4389 }
4390 else filter->setEnabled(false); 4390 else filter->setEnabled(false);
4391 mCalendar->setFilter(filter); 4391 mCalendar->setFilter(filter);
4392 updateView(); 4392 updateView();
4393 if ( !mess.isEmpty() ) 4393 if ( !mess.isEmpty() )
4394 topLevelWidget()->setCaption( mess ); 4394 topLevelWidget()->setCaption( mess );
4395 4395
4396 } 4396 }
4397 emit filtersUpdated(); 4397 emit filtersUpdated();
4398} 4398}
4399 4399
4400void CalendarView::filterEdited() 4400void CalendarView::filterEdited()
4401{ 4401{
4402 mFilterView->updateFilters(); 4402 mFilterView->updateFilters();
4403 updateFilter(); 4403 updateFilter();
4404 writeSettings(); 4404 writeSettings();
4405} 4405}
4406 4406
4407 4407
4408void CalendarView::takeOverEvent() 4408void CalendarView::takeOverEvent()
4409{ 4409{
4410 Incidence *incidence = currentSelection(); 4410 Incidence *incidence = currentSelection();
4411 4411
4412 if (!incidence) return; 4412 if (!incidence) return;
4413 4413
4414 incidence->setOrganizer(KOPrefs::instance()->email()); 4414 incidence->setOrganizer(KOPrefs::instance()->email());
4415 incidence->recreate(); 4415 incidence->recreate();
4416 incidence->setReadOnly(false); 4416 incidence->setReadOnly(false);
4417 4417
4418 updateView(); 4418 updateView();
4419} 4419}
4420 4420
4421void CalendarView::takeOverCalendar() 4421void CalendarView::takeOverCalendar()
4422{ 4422{
4423 // TODO: Create Calendar::allIncidences() function and use it here 4423 // TODO: Create Calendar::allIncidences() function and use it here
4424 4424
4425 clearAllViews(); 4425 clearAllViews();
4426 QPtrList<Event> events = mCalendar->events(); 4426 QPtrList<Event> events = mCalendar->events();
4427 for(uint i=0; i<events.count(); ++i) { 4427 for(uint i=0; i<events.count(); ++i) {
4428 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 4428 events.at(i)->setOrganizer(KOPrefs::instance()->email());
4429 events.at(i)->recreate(); 4429 events.at(i)->recreate();
4430 events.at(i)->setReadOnly(false); 4430 events.at(i)->setReadOnly(false);
4431 } 4431 }
4432 4432
4433 QPtrList<Todo> todos = mCalendar->todos(); 4433 QPtrList<Todo> todos = mCalendar->todos();
4434 for(uint i=0; i<todos.count(); ++i) { 4434 for(uint i=0; i<todos.count(); ++i) {
4435 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 4435 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
4436 todos.at(i)->recreate(); 4436 todos.at(i)->recreate();
4437 todos.at(i)->setReadOnly(false); 4437 todos.at(i)->setReadOnly(false);
4438 } 4438 }
4439 4439
4440 QPtrList<Journal> journals = mCalendar->journals(); 4440 QPtrList<Journal> journals = mCalendar->journals();
4441 for(uint i=0; i<journals.count(); ++i) { 4441 for(uint i=0; i<journals.count(); ++i) {
4442 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 4442 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
4443 journals.at(i)->recreate(); 4443 journals.at(i)->recreate();
4444 journals.at(i)->setReadOnly(false); 4444 journals.at(i)->setReadOnly(false);
4445 } 4445 }
4446 4446
4447 updateView(); 4447 updateView();
4448} 4448}
4449 4449
4450void CalendarView::showIntro() 4450void CalendarView::showIntro()
4451{ 4451{
4452 kdDebug() << "To be implemented." << endl; 4452 kdDebug() << "To be implemented." << endl;
4453} 4453}
4454 4454
4455QWidgetStack *CalendarView::viewStack() 4455QWidgetStack *CalendarView::viewStack()
4456{ 4456{
4457 return mRightFrame; 4457 return mRightFrame;
4458} 4458}
4459 4459
4460QWidget *CalendarView::leftFrame() 4460QWidget *CalendarView::leftFrame()
4461{ 4461{
4462 return ( QWidget *)mLeftFrame; 4462 return ( QWidget *)mLeftFrame;
4463} 4463}
4464 4464
4465DateNavigator *CalendarView::dateNavigator() 4465DateNavigator *CalendarView::dateNavigator()
4466{ 4466{
4467 return mNavigator; 4467 return mNavigator;
4468} 4468}
4469 4469
4470KDateNavigator* CalendarView::dateNavigatorWidget() 4470KDateNavigator* CalendarView::dateNavigatorWidget()
4471{ 4471{
4472 return mDateNavigator->navigatorView(); 4472 return mDateNavigator->navigatorView();
4473} 4473}
4474void CalendarView::toggleDateNavigatorWidget() 4474void CalendarView::toggleDateNavigatorWidget()
4475{ 4475{
4476 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; 4476 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
4477 4477
4478 if (!KOPrefs::instance()->mShowDateNavigator ) 4478 if (!KOPrefs::instance()->mShowDateNavigator )
4479 mDateNavigator->hide(); 4479 mDateNavigator->hide();
4480 else 4480 else
4481 mDateNavigator->show(); 4481 mDateNavigator->show();
4482} 4482}
4483void CalendarView::addView(KOrg::BaseView *view) 4483void CalendarView::addView(KOrg::BaseView *view)
4484{ 4484{
4485 mViewManager->addView(view); 4485 mViewManager->addView(view);
4486} 4486}
4487 4487
4488void CalendarView::showView(KOrg::BaseView *view) 4488void CalendarView::showView(KOrg::BaseView *view)
4489{ 4489{
4490 mViewManager->showView(view, mLeftFrame->isVisible()); 4490 mViewManager->showView(view, mLeftFrame->isVisible());
4491} 4491}
4492 4492
4493Incidence *CalendarView::currentSelection() 4493Incidence *CalendarView::currentSelection()
4494{ 4494{
4495 return mViewManager->currentSelection(); 4495 return mViewManager->currentSelection();
4496} 4496}
4497void CalendarView::toggleAllDaySize() 4497void CalendarView::toggleAllDaySize()
4498{ 4498{
4499 /* 4499 /*
4500 if ( KOPrefs::instance()->mAllDaySize > 47 ) 4500 if ( KOPrefs::instance()->mAllDaySize > 47 )
4501 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 4501 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
4502 else 4502 else
4503 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 4503 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
4504 */ 4504 */
4505 viewManager()->agendaView()->toggleAllDay(); 4505 viewManager()->agendaView()->toggleAllDay();
4506} 4506}
4507void CalendarView::toggleExpand() 4507void CalendarView::toggleExpand()
4508{ 4508{
4509 // if ( mLeftFrame->isHidden() ) { 4509 // if ( mLeftFrame->isHidden() ) {
4510 // mLeftFrame->show(); 4510 // mLeftFrame->show();
4511 // emit calendarViewExpanded( false ); 4511 // emit calendarViewExpanded( false );
4512 // } else { 4512 // } else {
4513 // mLeftFrame->hide(); 4513 // mLeftFrame->hide();
4514 // emit calendarViewExpanded( true ); 4514 // emit calendarViewExpanded( true );
4515 // } 4515 // }
4516 //qDebug(" CalendarView::toggleExpand()"); 4516 //qDebug(" CalendarView::toggleExpand()");
4517 globalFlagBlockAgenda = 1; 4517 globalFlagBlockAgenda = 1;
4518 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 4518 emit calendarViewExpanded( !mLeftFrame->isHidden() );
4519 globalFlagBlockAgenda = 5; 4519 globalFlagBlockAgenda = 5;
4520 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 4520 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
4521 //mViewManager->showView( 0, true ); 4521 //mViewManager->showView( 0, true );
4522} 4522}
4523 4523
4524void CalendarView::calendarModified( bool modified, Calendar * ) 4524void CalendarView::calendarModified( bool modified, Calendar * )
4525{ 4525{
4526 setModified( modified ); 4526 setModified( modified );
4527} 4527}
4528 4528
4529Todo *CalendarView::selectedTodo() 4529Todo *CalendarView::selectedTodo()
4530{ 4530{
4531 Incidence *incidence = currentSelection(); 4531 Incidence *incidence = currentSelection();
4532 if ( incidence && incidence->typeID() == todoID ) { 4532 if ( incidence && incidence->typeID() == todoID ) {
4533 return static_cast<Todo *>( incidence ); 4533 return static_cast<Todo *>( incidence );
4534 } 4534 }
4535 4535
4536 incidence = mTodoList->selectedIncidences().first(); 4536 incidence = mTodoList->selectedIncidences().first();
4537 if ( incidence && incidence->typeID() == todoID ) { 4537 if ( incidence && incidence->typeID() == todoID ) {
4538 return static_cast<Todo *>( incidence ); 4538 return static_cast<Todo *>( incidence );
4539 } 4539 }
4540 4540
4541 return 0; 4541 return 0;
4542} 4542}
4543 4543
4544void CalendarView::showIncidence() 4544void CalendarView::showIncidence()
4545{ 4545{
4546 mViewerCallerIsSearchDialog = false; 4546 mViewerCallerIsSearchDialog = false;
4547 Incidence *incidence = currentSelection(); 4547 Incidence *incidence = currentSelection();
4548 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4548 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4549 if ( incidence ) { 4549 if ( incidence ) {
4550 ShowIncidenceVisitor v; 4550 ShowIncidenceVisitor v;
4551 v.act( incidence, this ); 4551 v.act( incidence, this );
4552 } 4552 }
4553} 4553}
4554void CalendarView::editIncidenceDescription() 4554void CalendarView::editIncidenceDescription()
4555{ 4555{
4556 mFlagEditDescription = true; 4556 mFlagEditDescription = true;
4557 editIncidence(); 4557 editIncidence();
4558 mFlagEditDescription = false; 4558 mFlagEditDescription = false;
4559} 4559}
4560void CalendarView::editIncidence() 4560void CalendarView::editIncidence()
4561{ 4561{
4562 // qDebug("editIncidence() "); 4562 // qDebug("editIncidence() ");
4563 Incidence *incidence = currentSelection(); 4563 Incidence *incidence = currentSelection();
4564 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4564 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4565 if ( incidence ) { 4565 if ( incidence ) {
4566 EditIncidenceVisitor v; 4566 EditIncidenceVisitor v;
4567 v.act( incidence, this ); 4567 v.act( incidence, this );
4568 } 4568 }
4569} 4569}
4570 4570
4571void CalendarView::deleteIncidence() 4571void CalendarView::deleteIncidence()
4572{ 4572{
4573 Incidence *incidence = currentSelection(); 4573 Incidence *incidence = currentSelection();
4574 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4574 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4575 if ( incidence ) { 4575 if ( incidence ) {
4576 deleteIncidence(incidence); 4576 deleteIncidence(incidence);
4577 } 4577 }
4578} 4578}
4579void CalendarView::showIncidence(QString uid) 4579void CalendarView::showIncidence(QString uid)
4580{ 4580{
4581 Incidence *inc = mCalendar->incidence( uid ); 4581 Incidence *inc = mCalendar->incidence( uid );
4582 if ( inc ) 4582 if ( inc )
4583 showIncidence( inc ); 4583 showIncidence( inc );
4584} 4584}
4585void CalendarView::showIncidence(Incidence *incidence) 4585void CalendarView::showIncidence(Incidence *incidence)
4586{ 4586{
4587 mViewerCallerIsSearchDialog = false; 4587 mViewerCallerIsSearchDialog = false;
4588 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); 4588 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() );
4589 if ( sender() && mDialogManager->getSearchDialog() ) { 4589 if ( sender() && mDialogManager->getSearchDialog() ) {
4590 if ( sender () == mDialogManager->getSearchDialog()->listview() ) { 4590 if ( sender () == mDialogManager->getSearchDialog()->listview() ) {
4591 mViewerCallerIsSearchDialog = true; 4591 mViewerCallerIsSearchDialog = true;
4592 } 4592 }
4593 } 4593 }
4594 if ( incidence ) { 4594 if ( incidence ) {
4595 ShowIncidenceVisitor v; 4595 ShowIncidenceVisitor v;
4596 v.act( incidence, this ); 4596 v.act( incidence, this );
4597 } 4597 }
4598} 4598}
4599 4599
4600void CalendarView::editIncidence(Incidence *incidence) 4600void CalendarView::editIncidence(Incidence *incidence)
4601{ 4601{
4602 if ( incidence ) { 4602 if ( incidence ) {
4603 4603
4604 EditIncidenceVisitor v; 4604 EditIncidenceVisitor v;
4605 v.act( incidence, this ); 4605 v.act( incidence, this );
4606 4606
4607 } 4607 }
4608} 4608}
4609 4609
4610void CalendarView::deleteIncidence(Incidence *incidence) 4610void CalendarView::deleteIncidence(Incidence *incidence)
4611{ 4611{
4612 //qDebug(" CalendarView::deleteIncidence "); 4612 //qDebug(" CalendarView::deleteIncidence ");
4613 if ( incidence == 0 ) { 4613 if ( incidence == 0 ) {
4614 updateView(); 4614 updateView();
4615 emit updateSearchDialog(); 4615 emit updateSearchDialog();
4616 return; 4616 return;
4617 } 4617 }
4618 if ( incidence ) { 4618 if ( incidence ) {
4619 DeleteIncidenceVisitor v; 4619 DeleteIncidenceVisitor v;
4620 v.act( incidence, this ); 4620 v.act( incidence, this );
4621 } 4621 }
4622} 4622}
4623 4623
4624 4624
4625void CalendarView::lookForOutgoingMessages() 4625void CalendarView::lookForOutgoingMessages()
4626{ 4626{
4627 OutgoingDialog *ogd = mDialogManager->outgoingDialog(); 4627 OutgoingDialog *ogd = mDialogManager->outgoingDialog();
4628 ogd->loadMessages(); 4628 ogd->loadMessages();
4629} 4629}
4630 4630
4631void CalendarView::lookForIncomingMessages() 4631void CalendarView::lookForIncomingMessages()
4632{ 4632{
4633 IncomingDialog *icd = mDialogManager->incomingDialog(); 4633 IncomingDialog *icd = mDialogManager->incomingDialog();
4634 icd->retrieve(); 4634 icd->retrieve();
4635} 4635}
4636 4636
4637bool CalendarView::removeCompletedSubTodos( Todo* t ) 4637bool CalendarView::removeCompletedSubTodos( Todo* t )
4638{ 4638{
4639 bool deleteTodo = true; 4639 bool deleteTodo = true;
4640 QPtrList<Incidence> subTodos; 4640 QPtrList<Incidence> subTodos;
4641 Incidence *aTodo; 4641 Incidence *aTodo;
4642 subTodos = t->relations(); 4642 subTodos = t->relations();
4643 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 4643 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
4644 if (! removeCompletedSubTodos( (Todo*) aTodo )) 4644 if (! removeCompletedSubTodos( (Todo*) aTodo ))
4645 deleteTodo = false; 4645 deleteTodo = false;
4646 } 4646 }
4647 if ( deleteTodo ) { 4647 if ( deleteTodo ) {
4648 if ( t->isCompleted() && !t->doesRecur()) { 4648 if ( t->isCompleted() && !t->doesRecur()) {
4649 checkExternalId( t ); 4649 checkExternalId( t );
4650 mCalendar->deleteTodo( t ); 4650 mCalendar->deleteTodo( t );
4651 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 4651 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
4652 } 4652 }
4653 else 4653 else
4654 deleteTodo = false; 4654 deleteTodo = false;
4655 } 4655 }
4656 return deleteTodo; 4656 return deleteTodo;
4657 4657
4658} 4658}
4659void CalendarView::purgeCompleted() 4659void CalendarView::purgeCompleted()
4660{ 4660{
4661 int result = KMessageBox::warningContinueCancel(this, 4661 int result = KMessageBox::warningContinueCancel(this,
4662 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); 4662 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge"));
4663 4663
4664 if (result == KMessageBox::Continue) { 4664 if (result == KMessageBox::Continue) {
4665 4665
4666 QPtrList<Todo> todoCal; 4666 QPtrList<Todo> todoCal;
4667 QPtrList<Todo> rootTodos; 4667 QPtrList<Todo> rootTodos;
4668 //QPtrList<Incidence> rel; 4668 //QPtrList<Incidence> rel;
4669 Todo *aTodo; 4669 Todo *aTodo;
4670 todoCal = calendar()->todos(); 4670 todoCal = calendar()->todos();
4671 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { 4671 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
4672 if ( !aTodo->relatedTo() ) 4672 if ( !aTodo->relatedTo() )
4673 rootTodos.append( aTodo ); 4673 rootTodos.append( aTodo );
4674 } 4674 }
4675 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { 4675 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
4676 removeCompletedSubTodos( aTodo ); 4676 removeCompletedSubTodos( aTodo );
4677 } 4677 }
4678 4678
4679 updateView(); 4679 updateView();
4680 } 4680 }
4681} 4681}
4682 4682
4683void CalendarView::slotCalendarChanged() 4683void CalendarView::slotCalendarChanged()
4684{ 4684{
4685 ; 4685 ;
4686} 4686}
4687 4687
4688void CalendarView::keyPressEvent ( QKeyEvent *e) 4688void CalendarView::keyPressEvent ( QKeyEvent *e)
4689{ 4689{
4690 //qDebug(" alendarView::keyPressEvent "); 4690 //qDebug("CalendarView::keyPressEvent ");
4691 e->ignore(); 4691 e->ignore();
4692} 4692}
4693 4693
4694 4694
4695bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) 4695bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
4696{ 4696{
4697 4697
4698 if ( manager != mSyncManager) 4698 if ( manager != mSyncManager)
4699 qDebug("KO: Internal error-1. SyncManager mismatch "); 4699 qDebug("KO: Internal error-1. SyncManager mismatch ");
4700 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { 4700 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
4701 qDebug("KO: SyncKDE request detected!"); 4701 qDebug("KO: SyncKDE request detected!");
4702 } 4702 }
4703 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 4703 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
4704 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 4704 mCurrentSyncName = mSyncManager->getCurrentSyncName();
4705 return syncCalendar( filename, mode ); 4705 return syncCalendar( filename, mode );
4706} 4706}
4707bool CalendarView::syncExternal(KSyncManager* manager, QString resource) 4707bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
4708{ 4708{
4709 //mSyncManager = manager; 4709 //mSyncManager = manager;
4710 if ( manager != mSyncManager) 4710 if ( manager != mSyncManager)
4711 qDebug("KO: Internal error-2. SyncManager mismatch "); 4711 qDebug("KO: Internal error-2. SyncManager mismatch ");
4712 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 4712 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
4713 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 4713 mCurrentSyncName = mSyncManager->getCurrentSyncName();
4714 if ( resource == "sharp" ) 4714 if ( resource == "sharp" )
4715 syncExternal( 0 ); 4715 syncExternal( 0 );
4716 if ( resource == "phone" ) 4716 if ( resource == "phone" )
4717 syncExternal( 1 ); 4717 syncExternal( 1 );
4718 // pending setmodified 4718 // pending setmodified
4719 return true; 4719 return true;
4720} 4720}
4721void CalendarView::setSyncManager(KSyncManager* manager) 4721void CalendarView::setSyncManager(KSyncManager* manager)
4722{ 4722{
4723 mSyncManager = manager; 4723 mSyncManager = manager;
4724} 4724}
4725 4725
4726void CalendarView::removeSyncInfo( QString syncProfile) 4726void CalendarView::removeSyncInfo( QString syncProfile)
4727{ 4727{
4728 qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); 4728 qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1());
4729 mCalendar->removeSyncInfo( syncProfile ); 4729 mCalendar->removeSyncInfo( syncProfile );
4730 4730
4731} 4731}
4732 4732
4733void CalendarView::undo_delete() 4733void CalendarView::undo_delete()
4734{ 4734{
4735 //qDebug("undo_delete() "); 4735 //qDebug("undo_delete() ");
4736 Incidence* undo = mCalendar->undoIncidence(); 4736 Incidence* undo = mCalendar->undoIncidence();
4737 if ( !undo ) { 4737 if ( !undo ) {
4738 KMessageBox::sorry(this,i18n("There is nothing to undo!"), 4738 KMessageBox::sorry(this,i18n("There is nothing to undo!"),
4739 i18n("KO/Pi")); 4739 i18n("KO/Pi"));
4740 return; 4740 return;
4741 } 4741 }
4742 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) + 4742 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) +
4743 i18n("\nAre you sure you want\nto restore this?"), 4743 i18n("\nAre you sure you want\nto restore this?"),
4744 i18n("KO/Pi Confirmation"),i18n("Restore"))) { 4744 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
4745 mCalendar->undoDeleteIncidence(); 4745 mCalendar->undoDeleteIncidence();
4746 updateView(); 4746 updateView();
4747 } 4747 }
4748} 4748}
4749 4749
4750void CalendarView::slotViewerClosed() 4750void CalendarView::slotViewerClosed()
4751{ 4751{
4752 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); 4752 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
4753} 4753}
4754 4754
4755void CalendarView::resetFocus() 4755void CalendarView::resetFocus()
4756{ 4756{
4757 if ( mViewerCallerIsSearchDialog ) { 4757 if ( mViewerCallerIsSearchDialog ) {
4758 if ( mDialogManager->getSearchDialog()->isVisible() ){ 4758 if ( mDialogManager->getSearchDialog()->isVisible() ){
4759 mDialogManager->getSearchDialog()->raise(); 4759 mDialogManager->getSearchDialog()->raise();
4760 mDialogManager->getSearchDialog()->setActiveWindow(); 4760 mDialogManager->getSearchDialog()->setActiveWindow();
4761 mDialogManager->getSearchDialog()->listview()->resetFocus(); 4761 mDialogManager->getSearchDialog()->listview()->resetFocus();
4762 } else 4762 } else
4763 mViewerCallerIsSearchDialog = false; 4763 mViewerCallerIsSearchDialog = false;
4764 } 4764 }
4765 if ( !mViewerCallerIsSearchDialog ) { 4765 if ( !mViewerCallerIsSearchDialog ) {
4766 //mViewManager->currentView()->setFocus(); 4766 //mViewManager->currentView()->setFocus();
4767 //qDebug("sssssssssssssssset focus "); 4767 //qDebug("sssssssssssssssset focus ");
4768 topLevelWidget()->raise(); 4768 topLevelWidget()->raise();
4769 setActiveWindow(); 4769 setActiveWindow();
4770 //setFocus(); 4770 //setFocus();
4771 } 4771 }
4772 mViewerCallerIsSearchDialog = false; 4772 mViewerCallerIsSearchDialog = false;
4773} 4773}
4774 4774
4775void CalendarView::showNextAlarms() 4775void CalendarView::showNextAlarms()
4776{ 4776{
4777 QString message; 4777 QString message;
4778 QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); 4778 QDateTime nextAl = mCalendar->nextAlarmEventDateTime();
4779 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { 4779 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) {
4780 QString sum = mCalendar->nextSummary(); 4780 QString sum = mCalendar->nextSummary();
4781 QDateTime nextA = mNextAlarmDateTime; 4781 QDateTime nextA = mNextAlarmDateTime;
4782 QDateTime cur = QDateTime::currentDateTime(); 4782 QDateTime cur = QDateTime::currentDateTime();
4783 int secs = cur.secsTo( nextA ); 4783 int secs = cur.secsTo( nextA );
4784 int min = secs /60; 4784 int min = secs /60;
4785 int hours = min /60; 4785 int hours = min /60;
4786 min = min % 60; 4786 min = min % 60;
4787 int days = hours /24; 4787 int days = hours /24;
4788 hours = hours % 24; 4788 hours = hours % 24;
4789 4789
4790 //message = i18n("The next alarm is in:\n"); 4790 //message = i18n("The next alarm is in:\n");
4791 if ( days > 1 ) 4791 if ( days > 1 )
4792 message += i18n("%1 days\n").arg( days ); 4792 message += i18n("%1 days\n").arg( days );
4793 else if ( days == 1 ) 4793 else if ( days == 1 )
4794 message += i18n("1 day\n"); 4794 message += i18n("1 day\n");
4795 if ( hours > 1 ) 4795 if ( hours > 1 )
4796 message += i18n("%1 hours\n").arg( hours ); 4796 message += i18n("%1 hours\n").arg( hours );
4797 else if ( hours == 1 ) 4797 else if ( hours == 1 )
4798 message += i18n("1 hour\n"); 4798 message += i18n("1 hour\n");
4799 if ( min > 1 ) 4799 if ( min > 1 )
4800 message += i18n("%1 minutes\n").arg( min ); 4800 message += i18n("%1 minutes\n").arg( min );
4801 else if ( min == 1 ) 4801 else if ( min == 1 )
4802 message += i18n("1 minute\n"); 4802 message += i18n("1 minute\n");
4803 if ( message.isEmpty() ) 4803 if ( message.isEmpty() )
4804 message = i18n("The next alarm is in\nless than one minute!"); 4804 message = i18n("The next alarm is in\nless than one minute!");
4805 else 4805 else
4806 message = i18n("The next alarm is in:\n") + message; 4806 message = i18n("The next alarm is in:\n") + message;
4807 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; 4807 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ;
4808 } else { 4808 } else {
4809 message = i18n("There is no next alarm."); 4809 message = i18n("There is no next alarm.");
4810 4810
4811 } 4811 }
4812#ifdef DESKTOP_VERSION 4812#ifdef DESKTOP_VERSION
4813 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 4813 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
4814 message += i18n("\nThe internal alarm notification is disabled!\n"); 4814 message += i18n("\nThe internal alarm notification is disabled!\n");
4815 message += i18n("Enable it in the settings menu, TAB alarm."); 4815 message += i18n("Enable it in the settings menu, TAB alarm.");
4816 } 4816 }
4817 4817
4818#endif 4818#endif
4819 KMessageBox::information( this, message); 4819 KMessageBox::information( this, message);
4820} 4820}
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index add1819..94f35e6 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -1,1711 +1,1717 @@
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 ) { 417 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
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 return; 436 return;
436 } 437 }
437 438
438 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 439 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
439 switch ( e->key() ) { 440 switch ( e->key() ) {
440 case Qt::Key_Down: 441 case Qt::Key_Down:
441 case Qt::Key_Up: 442 case Qt::Key_Up:
442 QListView::keyPressEvent ( e ); 443 QListView::keyPressEvent ( e );
444 e->accept();
443 break; 445 break;
444 case Qt::Key_Left: 446 case Qt::Key_Left:
445 case Qt::Key_Right: 447 case Qt::Key_Right:
446 QListView::keyPressEvent ( e ); 448 QListView::keyPressEvent ( e );
447 e->accept(); 449 e->accept();
448 return; 450 return;
449 break; 451 break;
450 default: 452 default:
451 e->ignore(); 453 e->ignore();
452 break; 454 break;
453 } 455 }
454 return; 456 return;
455 } 457 }
456 e->ignore(); 458 e->ignore();
457} 459}
458void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 460void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
459{ 461{
460 QListView::contentsMouseReleaseEvent(e); 462 QListView::contentsMouseReleaseEvent(e);
461 mMousePressed = false; 463 mMousePressed = false;
462} 464}
463 465
464void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 466void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
465{ 467{
466 if (!e) return; 468 if (!e) return;
467 469
468 QPoint vp = contentsToViewport(e->pos()); 470 QPoint vp = contentsToViewport(e->pos());
469 471
470 QListViewItem *item = itemAt(vp); 472 QListViewItem *item = itemAt(vp);
471 473
472 emit double_Clicked(item); 474 emit double_Clicked(item);
473 if (!item) return; 475 if (!item) return;
474 476
475 emit doubleClicked(item,vp,0); 477 emit doubleClicked(item,vp,0);
476} 478}
477 479
478///////////////////////////////////////////////////////////////////////////// 480/////////////////////////////////////////////////////////////////////////////
479 481
480KOQuickTodo::KOQuickTodo(QWidget *parent) : 482KOQuickTodo::KOQuickTodo(QWidget *parent) :
481 QLineEdit(parent) 483 QLineEdit(parent)
482{ 484{
483 setText(i18n("Click to add new Todo")); 485 setText(i18n("Click to add new Todo"));
484} 486}
485 487
486void KOQuickTodo::focusInEvent(QFocusEvent *ev) 488void KOQuickTodo::focusInEvent(QFocusEvent *ev)
487{ 489{
488 if ( text()==i18n("Click to add new Todo") ) 490 if ( text()==i18n("Click to add new Todo") )
489 setText(""); 491 setText("");
490 QLineEdit::focusInEvent(ev); 492 QLineEdit::focusInEvent(ev);
491} 493}
492 494
493void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 495void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
494{ 496{
495 setText(i18n("Click to add new Todo")); 497 setText(i18n("Click to add new Todo"));
496 QLineEdit::focusOutEvent(ev); 498 QLineEdit::focusOutEvent(ev);
497} 499}
498 500
499///////////////////////////////////////////////////////////////////////////// 501/////////////////////////////////////////////////////////////////////////////
500 502
501KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 503KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
502 KOrg::BaseView(calendar,parent,name) 504 KOrg::BaseView(calendar,parent,name)
503{ 505{
504 mCategoryPopupMenu = 0; 506 mCategoryPopupMenu = 0;
505 mPendingUpdateBeforeRepaint = false; 507 mPendingUpdateBeforeRepaint = false;
506 isFlatDisplay = false; 508 isFlatDisplay = false;
507 mNavigator = 0; 509 mNavigator = 0;
508 QBoxLayout *topLayout = new QVBoxLayout(this); 510 QBoxLayout *topLayout = new QVBoxLayout(this);
509 mName = QString ( name ); 511 mName = QString ( name );
510 mBlockUpdate = false; 512 mBlockUpdate = false;
511 mQuickBar = new QWidget( this ); 513 mQuickBar = new QWidget( this );
512 topLayout->addWidget(mQuickBar); 514 topLayout->addWidget(mQuickBar);
513 515
514 mQuickAdd = new KOQuickTodo(mQuickBar); 516 mQuickAdd = new KOQuickTodo(mQuickBar);
515 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); 517 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
516 quickLayout->addWidget( mQuickAdd ); 518 quickLayout->addWidget( mQuickAdd );
519 mNewSubBut = new QPushButton( "sub",mQuickBar );
520 QPushButton * s_done = new QPushButton( "D",mQuickBar );
521 QPushButton * s_run = new QPushButton( "R",mQuickBar );
522 QPushButton * allopen = new QPushButton( "O",mQuickBar );
523 QPushButton * allclose = new QPushButton( "C",mQuickBar );
517 QPushButton * flat = new QPushButton( "F",mQuickBar ); 524 QPushButton * flat = new QPushButton( "F",mQuickBar );
525
518 int fixwid = flat->sizeHint().height(); 526 int fixwid = flat->sizeHint().height();
519 if ( QApplication::desktop()->width() >= 800 ) 527 if ( QApplication::desktop()->width() >= 800 )
520 fixwid *= 2; 528 fixwid *= 2;
521 flat->setFixedWidth( fixwid ); 529 flat->setFixedWidth( fixwid );
522 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); 530 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
523 QPushButton * allopen = new QPushButton( "O",mQuickBar );
524 allopen->setFixedWidth( fixwid ); 531 allopen->setFixedWidth( fixwid );
525 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); 532 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
526 QPushButton * allclose = new QPushButton( "C",mQuickBar );
527 allclose->setFixedWidth( fixwid ); 533 allclose->setFixedWidth( fixwid );
528 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); 534 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
529 QPushButton * s_done = new QPushButton( "D",mQuickBar );
530 s_done->setPixmap( SmallIcon("greenhook16")); 535 s_done->setPixmap( SmallIcon("greenhook16"));
531 s_done->setFixedWidth( fixwid ); 536 s_done->setFixedWidth( fixwid );
532 s_done->setFixedHeight( flat->sizeHint().height() ); 537 s_done->setFixedHeight( flat->sizeHint().height() );
533 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); 538 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
534 QPushButton * s_run = new QPushButton( "R",mQuickBar );
535 s_run->setPixmap( SmallIcon("ko16old")); 539 s_run->setPixmap( SmallIcon("ko16old"));
536 s_run->setFixedWidth( fixwid ); 540 s_run->setFixedWidth( fixwid );
537 s_run->setFixedHeight( flat->sizeHint().height() ); 541 s_run->setFixedHeight( flat->sizeHint().height() );
538 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); 542 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
539 543
540 mNewSubBut = new QPushButton( "sub",mQuickBar );
541 mNewSubBut->setFixedWidth( fixwid*3/2 ); 544 mNewSubBut->setFixedWidth( fixwid*3/2 );
542 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); 545 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
543 mNewSubBut->setEnabled( false ); 546 mNewSubBut->setEnabled( false );
544 quickLayout->addWidget( mNewSubBut ); 547 quickLayout->addWidget( mNewSubBut );
545 quickLayout->addWidget( s_done ); 548 quickLayout->addWidget( s_done );
546 quickLayout->addWidget( s_run ); 549 quickLayout->addWidget( s_run );
547 550
548 quickLayout->addWidget( allopen ); 551 quickLayout->addWidget( allopen );
549 quickLayout->addWidget( allclose ); 552 quickLayout->addWidget( allclose );
550 quickLayout->addWidget( flat ); 553 quickLayout->addWidget( flat );
551 554
552 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); 555 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
553 556
554 mTodoListView = new KOTodoListView(calendar,this, name ); 557 mTodoListView = new KOTodoListView(calendar,this, name );
555 topLayout->addWidget(mTodoListView); 558 topLayout->addWidget(mTodoListView);
556 //mTodoListView->header()->setMaximumHeight(30); 559 //mTodoListView->header()->setMaximumHeight(30);
557 mTodoListView->setRootIsDecorated(true); 560 mTodoListView->setRootIsDecorated(true);
558 mTodoListView->setAllColumnsShowFocus(true); 561 mTodoListView->setAllColumnsShowFocus(true);
559 562
560 mTodoListView->setShowSortIndicator(true); 563 mTodoListView->setShowSortIndicator(true);
561 564
562 mTodoListView->addColumn(i18n("Todo")); 565 mTodoListView->addColumn(i18n("Todo"));
563 mTodoListView->addColumn(i18n("Prio")); 566 mTodoListView->addColumn(i18n("Prio"));
564 mTodoListView->setColumnAlignment(1,AlignHCenter); 567 mTodoListView->setColumnAlignment(1,AlignHCenter);
565 mTodoListView->addColumn(i18n("Complete")); 568 mTodoListView->addColumn(i18n("Complete"));
566 mTodoListView->setColumnAlignment(2,AlignCenter); 569 mTodoListView->setColumnAlignment(2,AlignCenter);
567 570
568 mTodoListView->addColumn(i18n("Due Date")); 571 mTodoListView->addColumn(i18n("Due Date"));
569 mTodoListView->setColumnAlignment(3,AlignLeft); 572 mTodoListView->setColumnAlignment(3,AlignLeft);
570 mTodoListView->addColumn(i18n("Due Time")); 573 mTodoListView->addColumn(i18n("Due Time"));
571 mTodoListView->setColumnAlignment(4,AlignHCenter); 574 mTodoListView->setColumnAlignment(4,AlignHCenter);
572 575
573 mTodoListView->addColumn(i18n("Start Date")); 576 mTodoListView->addColumn(i18n("Start Date"));
574 mTodoListView->setColumnAlignment(5,AlignLeft); 577 mTodoListView->setColumnAlignment(5,AlignLeft);
575 mTodoListView->addColumn(i18n("Start Time")); 578 mTodoListView->addColumn(i18n("Start Time"));
576 mTodoListView->setColumnAlignment(6,AlignHCenter); 579 mTodoListView->setColumnAlignment(6,AlignHCenter);
577 580
578 mTodoListView->addColumn(i18n("Cancelled")); 581 //mTodoListView->addColumn(i18n("Cancelled"));
579 mTodoListView->addColumn(i18n("Categories")); 582 mTodoListView->addColumn(i18n("Categories"));
580 mTodoListView->addColumn(i18n("Calendar")); 583 mTodoListView->addColumn(i18n("Calendar"));
584 mTodoListView->addColumn(i18n("Last Modified"));
585 mTodoListView->addColumn(i18n("Created"));
586 mTodoListView->addColumn(i18n("Last Modified Sub"));
581#if 0 587#if 0
582 mTodoListView->addColumn(i18n("Sort Id")); 588 mTodoListView->addColumn(i18n("Sort Id"));
583 mTodoListView->setColumnAlignment(4,AlignHCenter); 589 mTodoListView->setColumnAlignment(4,AlignHCenter);
584#endif 590#endif
585 591
586 mTodoListView->setMinimumHeight( 60 ); 592 mTodoListView->setMinimumHeight( 60 );
587 mTodoListView->setItemsRenameable( true ); 593 mTodoListView->setItemsRenameable( true );
588 mTodoListView->setRenameable( 0 ); 594 mTodoListView->setRenameable( 0 );
589 mTodoListView->setColumnWidth( 0, 120 ); 595 mTodoListView->setColumnWidth( 0, 120 );
590 int iii = 0; 596 int iii = 0;
591 for ( iii = 0; iii< 10 ; ++iii ) 597 for ( iii = 0; iii< 12 ; ++iii )
592 mTodoListView->setColumnWidthMode( iii, QListView::Manual ); 598 mTodoListView->setColumnWidthMode( iii, QListView::Manual );
593 599
594 600
595 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 601 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
596 602
597 mPriorityPopupMenu = new QPopupMenu(this); 603 mPriorityPopupMenu = new QPopupMenu(this);
598 for (int i = 1; i <= 5; i++) { 604 for (int i = 1; i <= 5; i++) {
599 QString label = QString ("%1").arg (i); 605 QString label = QString ("%1").arg (i);
600 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 606 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
601 } 607 }
602 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 608 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
603 609
604 mPercentageCompletedPopupMenu = new QPopupMenu(this); 610 mPercentageCompletedPopupMenu = new QPopupMenu(this);
605 for (int i = 0; i <= 100; i+=20) { 611 for (int i = 0; i <= 100; i+=20) {
606 QString label = QString ("%1 %").arg (i); 612 QString label = QString ("%1 %").arg (i);
607 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 613 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
608 } 614 }
609 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 615 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
610 616
611 617
612 mCategoryPopupMenu = new QPopupMenu (this); 618 mCategoryPopupMenu = new QPopupMenu (this);
613 mCategoryPopupMenu->setCheckable (true); 619 mCategoryPopupMenu->setCheckable (true);
614 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); 620 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
615 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); 621 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
616 622
617 mCalPopupMenu = new QPopupMenu (this); 623 mCalPopupMenu = new QPopupMenu (this);
618 mCalPopupMenu->setCheckable (true); 624 mCalPopupMenu->setCheckable (true);
619 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); 625 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
620 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); 626 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
621 627
622 628
623 629
624 630
625 mItemPopupMenu = new QPopupMenu(this); 631 mItemPopupMenu = new QPopupMenu(this);
626 mItemPopupMenu->insertItem(i18n("Show"), this, 632 mItemPopupMenu->insertItem(i18n("Show"), this,
627 SLOT (showTodo())); 633 SLOT (showTodo()));
628 mItemPopupMenu->insertItem(i18n("Edit..."), this, 634 mItemPopupMenu->insertItem(i18n("Edit..."), this,
629 SLOT (editTodo())); 635 SLOT (editTodo()));
630 mItemPopupMenu->insertItem( i18n("Delete..."), this, 636 mItemPopupMenu->insertItem( i18n("Delete..."), this,
631 SLOT (deleteTodo())); 637 SLOT (deleteTodo()));
632 mItemPopupMenu->insertItem( i18n("Clone..."), this, 638 mItemPopupMenu->insertItem( i18n("Clone..."), this,
633 SLOT (cloneTodo())); 639 SLOT (cloneTodo()));
634 mItemPopupMenu->insertItem( i18n("Move..."), this, 640 mItemPopupMenu->insertItem( i18n("Move..."), this,
635 SLOT (moveTodo())); 641 SLOT (moveTodo()));
636#ifndef DESKTOP_VERSION 642#ifndef DESKTOP_VERSION
637 mItemPopupMenu->insertItem( i18n("Beam..."), this, 643 mItemPopupMenu->insertItem( i18n("Beam..."), this,
638 SLOT (beamTodo())); 644 SLOT (beamTodo()));
639#endif 645#endif
640 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 646 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
641 SLOT (cancelTodo())); 647 SLOT (cancelTodo()));
642 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu); 648 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu);
643 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu); 649 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu);
644 mItemPopupMenu->insertSeparator(); 650 mItemPopupMenu->insertSeparator();
645 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, 651 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
646 SLOT (toggleRunningItem())); 652 SLOT (toggleRunningItem()));
647 mItemPopupMenu->insertSeparator(); 653 mItemPopupMenu->insertSeparator();
648 /* 654 /*
649 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 655 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
650 SLOT (newTodo())); 656 SLOT (newTodo()));
651 */ 657 */
652 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 658 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
653 SLOT (newSubTodo())); 659 SLOT (newSubTodo()));
654 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 660 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
655 SLOT (unparentTodo()),0,21); 661 SLOT (unparentTodo()),0,21);
656 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 662 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
657 SLOT (reparentTodo()),0,22); 663 SLOT (reparentTodo()),0,22);
658 mItemPopupMenu->insertSeparator(); 664 mItemPopupMenu->insertSeparator();
659#if 0 665#if 0
660 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), 666 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."),
661 this, SLOT( purgeCompleted() ) ); 667 this, SLOT( purgeCompleted() ) );
662 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 668 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
663 this, SLOT( toggleCompleted() ),0, 33 ); 669 this, SLOT( toggleCompleted() ),0, 33 );
664 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 670 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
665 this, SLOT( toggleQuickTodo() ),0, 34 ); 671 this, SLOT( toggleQuickTodo() ),0, 34 );
666 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 672 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
667 this, SLOT( toggleRunning() ),0, 35 ); 673 this, SLOT( toggleRunning() ),0, 35 );
668 674
669#endif 675#endif
670 mPopupMenu = new QPopupMenu(this); 676 mPopupMenu = new QPopupMenu(this);
671 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 677 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
672 SLOT (newTodo()),0,1); 678 SLOT (newTodo()),0,1);
673 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), 679 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."),
674 this, SLOT(purgeCompleted()),0,2); 680 this, SLOT(purgeCompleted()),0,2);
675 mPopupMenu->insertItem(i18n("Show Completed"), 681 mPopupMenu->insertItem(i18n("Show Completed"),
676 this, SLOT( toggleCompleted() ),0,3 ); 682 this, SLOT( toggleCompleted() ),0,3 );
677 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 683 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
678 this, SLOT( toggleRunning() ),0,5 ); 684 this, SLOT( toggleRunning() ),0,5 );
679 mPopupMenu->insertItem(i18n(" set all open","Display all opened"), 685 mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
680 this, SLOT( setAllOpen() ),0,6 ); 686 this, SLOT( setAllOpen() ),0,6 );
681 mPopupMenu->insertItem(i18n(" set all close","Display all closed"), 687 mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
682 this, SLOT( setAllClose() ),0,7 ); 688 this, SLOT( setAllClose() ),0,7 );
683 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), 689 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"),
684 this, SLOT( setAllFlat() ),0,8 ); 690 this, SLOT( setAllFlat() ),0,8 );
685 mPopupMenu->insertSeparator(); 691 mPopupMenu->insertSeparator();
686 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 692 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
687 this, SLOT( toggleQuickTodo() ),0,4 ); 693 this, SLOT( toggleQuickTodo() ),0,4 );
688 mDocPrefs = new DocPrefs( name ); 694 mDocPrefs = new DocPrefs( name );
689 695
690 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); 696 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu );
691 mPopupMenu->setCheckable( true ); 697 mPopupMenu->setCheckable( true );
692 mItemPopupMenu->setCheckable( true ); 698 mItemPopupMenu->setCheckable( true );
693 699
694 700
695 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 701 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
696 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 702 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
697 703
698 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 704 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
699 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 705 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
700 706
701 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 707 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
702 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 708 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
703 709
704 710
705 // Double clicking conflicts with opening/closing the subtree 711 // Double clicking conflicts with opening/closing the subtree
706 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 712 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
707 SLOT( editItem( QListViewItem *) ) ); 713 SLOT( editItem( QListViewItem *) ) );
708 /* 714 /*
709 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 715 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
710 const QPoint &,int ) ), 716 const QPoint &,int ) ),
711 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 717 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
712 */ 718 */
713 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 719 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
714 const QPoint &,int ) ), 720 const QPoint &,int ) ),
715 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 721 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
716 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 722 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
717 SLOT( itemClicked( QListViewItem * ) ) ); 723 SLOT( itemClicked( QListViewItem * ) ) );
718 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 724 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
719 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 725 SLOT( itemDoubleClicked( QListViewItem * ) ) );
720 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 726 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
721 SLOT( updateView() ) ); 727 SLOT( updateView() ) );
722 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 728 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
723 SLOT( todoModified(Todo *, int) ) ); 729 SLOT( todoModified(Todo *, int) ) );
724 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 730 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
725 SLOT( itemStateChanged( QListViewItem * ) ) ); 731 SLOT( itemStateChanged( QListViewItem * ) ) );
726 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 732 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
727 SLOT( itemStateChanged( QListViewItem * ) ) ); 733 SLOT( itemStateChanged( QListViewItem * ) ) );
728 connect( mTodoListView, SIGNAL( paintNeeded() ), 734 connect( mTodoListView, SIGNAL( paintNeeded() ),
729 SLOT( paintNeeded()) ); 735 SLOT( paintNeeded()) );
730 736
731#if 0 737#if 0
732 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 738 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
733 SLOT(selectionChanged(QListViewItem *))); 739 SLOT(selectionChanged(QListViewItem *)));
734 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 740 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
735 SLOT(selectionChanged(QListViewItem *))); 741 SLOT(selectionChanged(QListViewItem *)));
736 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 742 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
737 SLOT(selectionChanged(QListViewItem *))); 743 SLOT(selectionChanged(QListViewItem *)));
738#endif 744#endif
739 745
740 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 746 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
741 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 747 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
742 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 748 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
743 749
744 connect( mTodoListView, SIGNAL(selectionChanged() ), 750 connect( mTodoListView, SIGNAL(selectionChanged() ),
745 SLOT( processSelectionChange() ) ); 751 SLOT( processSelectionChange() ) );
746 connect( mQuickAdd, SIGNAL( returnPressed () ), 752 connect( mQuickAdd, SIGNAL( returnPressed () ),
747 SLOT( addQuickTodo() ) ); 753 SLOT( addQuickTodo() ) );
748 754
749} 755}
750 756
751KOTodoView::~KOTodoView() 757KOTodoView::~KOTodoView()
752{ 758{
753 759
754#if QT_VERSION >= 0x030000 760#if QT_VERSION >= 0x030000
755 761
756#else 762#else
757 delete mKOTodoViewWhatsThis; 763 delete mKOTodoViewWhatsThis;
758#endif 764#endif
759 765
760 delete mDocPrefs; 766 delete mDocPrefs;
761} 767}
762QString KOTodoView::getWhatsThisText(QPoint p) 768QString KOTodoView::getWhatsThisText(QPoint p)
763{ 769{
764 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 770 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
765 if ( item ) 771 if ( item )
766 return KIncidenceFormatter::instance()->getFormattedText( item->todo(), 772 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
767 KOPrefs::instance()->mWTshowDetails, 773 KOPrefs::instance()->mWTshowDetails,
768 KOPrefs::instance()->mWTshowCreated, 774 KOPrefs::instance()->mWTshowCreated,
769 KOPrefs::instance()->mWTshowChanged); 775 KOPrefs::instance()->mWTshowChanged);
770 return i18n("That is the todo view" ); 776 return i18n("That is the todo view" );
771 777
772} 778}
773 779
774void KOTodoView::jumpToDate () 780void KOTodoView::jumpToDate ()
775{ 781{
776 // if (mActiveItem) { 782 // if (mActiveItem) {
777// mActiveItem->todo()); 783// mActiveItem->todo());
778// if ( mActiveItem->todo()->hasDueDate() ) 784// if ( mActiveItem->todo()->hasDueDate() )
779// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 785// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
780} 786}
781void KOTodoView::paintNeeded() 787void KOTodoView::paintNeeded()
782{ 788{
783 if ( mPendingUpdateBeforeRepaint ) { 789 if ( mPendingUpdateBeforeRepaint ) {
784 updateView(); 790 updateView();
785 mPendingUpdateBeforeRepaint = false; 791 mPendingUpdateBeforeRepaint = false;
786 } 792 }
787} 793}
788void KOTodoView::paintEvent(QPaintEvent * pevent) 794void KOTodoView::paintEvent(QPaintEvent * pevent)
789{ 795{
790 if ( mPendingUpdateBeforeRepaint ) { 796 if ( mPendingUpdateBeforeRepaint ) {
791 updateView(); 797 updateView();
792 mPendingUpdateBeforeRepaint = false; 798 mPendingUpdateBeforeRepaint = false;
793 } 799 }
794 KOrg::BaseView::paintEvent( pevent); 800 KOrg::BaseView::paintEvent( pevent);
795} 801}
796 802
797void KOTodoView::updateView() 803void KOTodoView::updateView()
798{ 804{
799 pendingSubtodo = 0; 805 pendingSubtodo = 0;
800 if ( mBlockUpdate ) { 806 if ( mBlockUpdate ) {
801 return; 807 return;
802 } 808 }
803 if ( !isVisible() ) { 809 if ( !isVisible() ) {
804 mPendingUpdateBeforeRepaint = true; 810 mPendingUpdateBeforeRepaint = true;
805 return; 811 return;
806 } 812 }
807 //qDebug("KOTodoView::updateView() %x", this); 813 //qDebug("KOTodoView::updateView() %x", this);
808 if ( isFlatDisplay ) { 814 if ( isFlatDisplay ) {
809 displayAllFlat(); 815 displayAllFlat();
810 return; 816 return;
811 } 817 }
812 storeCurrentItem(); 818 storeCurrentItem();
813 //qDebug("update "); 819 //qDebug("update ");
814// kdDebug() << "KOTodoView::updateView()" << endl; 820// kdDebug() << "KOTodoView::updateView()" << endl;
815 QFont fo = KOPrefs::instance()->mTodoViewFont; 821 QFont fo = KOPrefs::instance()->mTodoViewFont;
816 822
817 823
818 mTodoListView->clear(); 824 mTodoListView->clear();
819 if ( mName == "todolistsmall" ) { 825 if ( mName == "todolistsmall" ) {
820 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { 826 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
821 int ps = fo.pointSize() -2; 827 int ps = fo.pointSize() -2;
822 if ( ps > 12 ) 828 if ( ps > 12 )
823 ps -= 2; 829 ps -= 2;
824 fo.setPointSize( ps ); 830 fo.setPointSize( ps );
825 } 831 }
826 } 832 }
827 833
828 mTodoListView->setFont( fo ); 834 mTodoListView->setFont( fo );
829 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); 835 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
830 //mTodoListView->header()->setMaximumHeight(fm.height()); 836 //mTodoListView->header()->setMaximumHeight(fm.height());
831 QPtrList<Todo> todoList = calendar()->todos(); 837 QPtrList<Todo> todoList = calendar()->todos();
832 838
833/* 839/*
834 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; 840 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
835 Event *t; 841 Event *t;
836 for(t = todoList.first(); t; t = todoList.next()) { 842 for(t = todoList.first(); t; t = todoList.next()) {
837 kdDebug() << " " << t->getSummary() << endl; 843 kdDebug() << " " << t->getSummary() << endl;
838 844
839 if (t->getRelatedTo()) { 845 if (t->getRelatedTo()) {
840 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; 846 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
841 } 847 }
842 848
843 QPtrList<Event> l = t->getRelations(); 849 QPtrList<Event> l = t->getRelations();
844 Event *c; 850 Event *c;
845 for(c=l.first();c;c=l.next()) { 851 for(c=l.first();c;c=l.next()) {
846 kdDebug() << " - relation: " << c->getSummary() << endl; 852 kdDebug() << " - relation: " << c->getSummary() << endl;
847 } 853 }
848 } 854 }
849*/ 855*/
850 856
851 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a 857 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a
852 // specific order of events. That means that we have to generate parent items 858 // specific order of events. That means that we have to generate parent items
853 // recursively for proper hierarchical display of Todos. 859 // recursively for proper hierarchical display of Todos.
854 mTodoMap.clear(); 860 mTodoMap.clear();
855 Todo *todo; 861 Todo *todo;
856 todo = todoList.first();// todo; todo = todoList.next()) { 862 todo = todoList.first();// todo; todo = todoList.next()) {
857 while ( todo ) { 863 while ( todo ) {
858 bool next = true; 864 bool next = true;
859 // qDebug("todo %s ", todo->summary().latin1()); 865 // qDebug("todo %s ", todo->summary().latin1());
860 Incidence *incidence = todo->relatedTo(); 866 Incidence *incidence = todo->relatedTo();
861 while ( incidence ) { 867 while ( incidence ) {
862 if ( incidence->typeID() == todoID ) { 868 if ( incidence->typeID() == todoID ) {
863 //qDebug("related %s ",incidence->summary().latin1() ); 869 //qDebug("related %s ",incidence->summary().latin1() );
864 if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) { 870 if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) {
865 //qDebug("related not found "); 871 //qDebug("related not found ");
866 todoList.remove( ); 872 todoList.remove( );
867 todo = todoList.current(); 873 todo = todoList.current();
868 next = false; 874 next = false;
869 incidence = 0; 875 incidence = 0;
870 876
871 } else { 877 } else {
872 //qDebug("related found "); 878 //qDebug("related found ");
873 incidence = incidence->relatedTo(); 879 incidence = incidence->relatedTo();
874 } 880 }
875 } else 881 } else
876 incidence = 0; 882 incidence = 0;
877 } 883 }
878 if ( next ) 884 if ( next )
879 todo = todoList.next(); 885 todo = todoList.next();
880 } 886 }
881 887
882 for(todo = todoList.first(); todo; todo = todoList.next()) { 888 for(todo = todoList.first(); todo; todo = todoList.next()) {
883 if (!mTodoMap.contains(todo) && checkTodo( todo ) ) 889 if (!mTodoMap.contains(todo) && checkTodo( todo ) )
884 { 890 {
885 insertTodoItem(todo); 891 insertTodoItem(todo);
886 } 892 }
887 } 893 }
888 // Restore opened/closed state 894 // Restore opened/closed state
889 mTodoListView->blockSignals( true ); 895 mTodoListView->blockSignals( true );
890 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); 896 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() );
891 mTodoListView->blockSignals( false ); 897 mTodoListView->blockSignals( false );
892 resetCurrentItem(); 898 resetCurrentItem();
893} 899}
894 900
895void KOTodoView::storeCurrentItem() 901void KOTodoView::storeCurrentItem()
896{ 902{
897 mCurItem = 0; 903 mCurItem = 0;
898 mCurItemRootParent = 0; 904 mCurItemRootParent = 0;
899 mCurItemParent = 0; 905 mCurItemParent = 0;
900 mCurItemAbove = 0; 906 mCurItemAbove = 0;
901 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 907 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
902 if (mActiveItem) { 908 if (mActiveItem) {
903 mCurItem = mActiveItem->todo(); 909 mCurItem = mActiveItem->todo();
904 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove (); 910 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove ();
905 if ( activeItemAbove ) 911 if ( activeItemAbove )
906 mCurItemAbove = activeItemAbove->todo(); 912 mCurItemAbove = activeItemAbove->todo();
907 mCurItemRootParent = mCurItem; 913 mCurItemRootParent = mCurItem;
908 mCurItemParent = mCurItemRootParent->relatedTo(); 914 mCurItemParent = mCurItemRootParent->relatedTo();
909 while ( mCurItemRootParent->relatedTo() != 0 ) 915 while ( mCurItemRootParent->relatedTo() != 0 )
910 mCurItemRootParent = mCurItemRootParent->relatedTo(); 916 mCurItemRootParent = mCurItemRootParent->relatedTo();
911 } 917 }
912 mActiveItem = 0; 918 mActiveItem = 0;
913} 919}
914 920
915void KOTodoView::resetCurrentItem() 921void KOTodoView::resetCurrentItem()
916{ 922{
917 //mTodoListView->setFocus(); 923 //mTodoListView->setFocus();
918 KOTodoViewItem* foundItem = 0; 924 KOTodoViewItem* foundItem = 0;
919 KOTodoViewItem* foundItemRoot = 0; 925 KOTodoViewItem* foundItemRoot = 0;
920 KOTodoViewItem* foundItemParent = 0; 926 KOTodoViewItem* foundItemParent = 0;
921 KOTodoViewItem* foundItemAbove = 0; 927 KOTodoViewItem* foundItemAbove = 0;
922 if ( mTodoListView->firstChild () ) { 928 if ( mTodoListView->firstChild () ) {
923 if ( mCurItem ) { 929 if ( mCurItem ) {
924 KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild (); 930 KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild ();
925 while ( item ) { 931 while ( item ) {
926 if ( item->todo() == mCurItem ) { 932 if ( item->todo() == mCurItem ) {
927 foundItem = item; 933 foundItem = item;
928 break; 934 break;
929 } else if ( item->todo() == mCurItemAbove ) { 935 } else if ( item->todo() == mCurItemAbove ) {
930 foundItemAbove = item; 936 foundItemAbove = item;
931 937
932 } 938 }
933 if ( item->todo() == mCurItemRootParent ) { 939 if ( item->todo() == mCurItemRootParent ) {
934 foundItemRoot = item; 940 foundItemRoot = item;
935 } 941 }
936 if ( item->todo() == mCurItemParent ) { 942 if ( item->todo() == mCurItemParent ) {
937 foundItemParent = item; 943 foundItemParent = item;
938 } 944 }
939 item = (KOTodoViewItem*)item->itemBelow(); 945 item = (KOTodoViewItem*)item->itemBelow();
940 } 946 }
941 if ( ! foundItem ) { 947 if ( ! foundItem ) {
942 if ( foundItemParent ) { 948 if ( foundItemParent ) {
943 foundItem = foundItemParent; 949 foundItem = foundItemParent;
944 } else { 950 } else {
945 if ( foundItemRoot ) 951 if ( foundItemRoot )
946 foundItem = foundItemRoot; 952 foundItem = foundItemRoot;
947 else 953 else
948 foundItem = foundItemAbove; 954 foundItem = foundItemAbove;
949 } 955 }
950 } 956 }
951 } 957 }
952 if ( foundItem ) { 958 if ( foundItem ) {
953 mTodoListView->setSelected ( foundItem, true ); 959 mTodoListView->setSelected ( foundItem, true );
954 mTodoListView->setCurrentItem( foundItem ); 960 mTodoListView->setCurrentItem( foundItem );
955 mTodoListView->ensureItemVisible( foundItem ); 961 mTodoListView->ensureItemVisible( foundItem );
956 } else { 962 } else {
957 if ( mTodoListView->firstChild () ) { 963 if ( mTodoListView->firstChild () ) {
958 mTodoListView->setSelected ( mTodoListView->firstChild (), true ); 964 mTodoListView->setSelected ( mTodoListView->firstChild (), true );
959 mTodoListView->setCurrentItem( mTodoListView->firstChild () ); 965 mTodoListView->setCurrentItem( mTodoListView->firstChild () );
960 } 966 }
961 } 967 }
962 } 968 }
963 processSelectionChange(); 969 processSelectionChange();
964 QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); 970 QTimer::singleShot( 100, this, SLOT ( resetFocusToList() ));
965} 971}
966void KOTodoView::resetFocusToList() 972void KOTodoView::resetFocusToList()
967{ 973{
968 topLevelWidget()->setActiveWindow(); 974 topLevelWidget()->setActiveWindow();
969 mTodoListView->setFocus(); 975 mTodoListView->setFocus();
970} 976}
971//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove; 977//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove;
972bool KOTodoView::checkTodo( Todo * todo ) 978bool KOTodoView::checkTodo( Todo * todo )
973{ 979{
974 980
975 if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) 981 if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() )
976 return false; 982 return false;
977 if ( !todo->isCompleted() ) { 983 if ( !todo->isCompleted() ) {
978 if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() ) 984 if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() )
979 return true; 985 return true;
980 } 986 }
981 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { 987 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) {
982 if ( todo->hasStartDate() ) 988 if ( todo->hasStartDate() )
983 if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) 989 if ( mNavigator->selectedDates().last() < todo->dtStart().date() )
984 return false; 990 return false;
985 if ( todo->hasDueDate() ) 991 if ( todo->hasDueDate() )
986 if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) 992 if ( mNavigator->selectedDates().first() > todo->dtDue().date() )
987 return false; 993 return false;
988 } 994 }
989 return true; 995 return true;
990} 996}
991 997
992void KOTodoView::restoreItemState( QListViewItem *item ) 998void KOTodoView::restoreItemState( QListViewItem *item )
993{ 999{
994 pendingSubtodo = 0; 1000 pendingSubtodo = 0;
995 while( item ) { 1001 while( item ) {
996 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1002 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
997 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); 1003 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
998 if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); 1004 if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
999 item = item->nextSibling(); 1005 item = item->nextSibling();
1000 } 1006 }
1001} 1007}
1002 1008
1003 1009
1004QMap<Todo *,KOTodoViewItem *>::ConstIterator 1010QMap<Todo *,KOTodoViewItem *>::ConstIterator
1005KOTodoView::insertTodoItem(Todo *todo) 1011KOTodoView::insertTodoItem(Todo *todo)
1006{ 1012{
1007 1013
1008 // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; 1014 // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
1009 // TODO: Check, if dynmaic cast is necessary 1015 // TODO: Check, if dynmaic cast is necessary
1010 1016
1011 pendingSubtodo = 0; 1017 pendingSubtodo = 0;
1012 Incidence *incidence = todo->relatedTo(); 1018 Incidence *incidence = todo->relatedTo();
1013 while ( incidence && !incidence->calEnabled() ) 1019 while ( incidence && !incidence->calEnabled() )
1014 incidence = incidence->relatedTo(); 1020 incidence = incidence->relatedTo();
1015 if (incidence && incidence->typeID() == todoID ) { 1021 if (incidence && incidence->typeID() == todoID ) {
1016 Todo *relatedTodo = static_cast<Todo *>(incidence); 1022 Todo *relatedTodo = static_cast<Todo *>(incidence);
1017 1023
1018 // kdDebug() << " has Related" << endl; 1024 // kdDebug() << " has Related" << endl;
1019 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 1025 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
1020 itemIterator = mTodoMap.find(relatedTodo); 1026 itemIterator = mTodoMap.find(relatedTodo);
1021 if (itemIterator == mTodoMap.end()) { 1027 if (itemIterator == mTodoMap.end()) {
1022 // kdDebug() << " related not yet in list" << endl; 1028 // kdDebug() << " related not yet in list" << endl;
1023 itemIterator = insertTodoItem (relatedTodo); 1029 itemIterator = insertTodoItem (relatedTodo);
1024 } 1030 }
1025 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem 1031 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem
1026 // and one into the map. Sure finding is more easy but why? -zecke 1032 // and one into the map. Sure finding is more easy but why? -zecke
1027 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); 1033 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this);
1028 return mTodoMap.insert(todo,todoItem); 1034 return mTodoMap.insert(todo,todoItem);
1029 } else { 1035 } else {
1030 // kdDebug() << " no Related" << endl; 1036 // kdDebug() << " no Related" << endl;
1031 // see above -zecke 1037 // see above -zecke
1032 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1038 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1033 return mTodoMap.insert(todo,todoItem); 1039 return mTodoMap.insert(todo,todoItem);
1034 } 1040 }
1035} 1041}
1036 1042
1037 1043
1038void KOTodoView::updateConfig() 1044void KOTodoView::updateConfig()
1039{ 1045{
1040 updateView(); 1046 updateView();
1041 mTodoListView->repaintContents(); 1047 mTodoListView->repaintContents();
1042} 1048}
1043 1049
1044QPtrList<Incidence> KOTodoView::selectedIncidences() 1050QPtrList<Incidence> KOTodoView::selectedIncidences()
1045{ 1051{
1046 QPtrList<Incidence> selected; 1052 QPtrList<Incidence> selected;
1047 1053
1048 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1054 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1049// if (!item) item = mActiveItem; 1055// if (!item) item = mActiveItem;
1050 if (item) selected.append(item->todo()); 1056 if (item) selected.append(item->todo());
1051 1057
1052 return selected; 1058 return selected;
1053} 1059}
1054 1060
1055QPtrList<Todo> KOTodoView::selectedTodos() 1061QPtrList<Todo> KOTodoView::selectedTodos()
1056{ 1062{
1057 QPtrList<Todo> selected; 1063 QPtrList<Todo> selected;
1058 1064
1059 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1065 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1060// if (!item) item = mActiveItem; 1066// if (!item) item = mActiveItem;
1061 if (item) selected.append(item->todo()); 1067 if (item) selected.append(item->todo());
1062 1068
1063 return selected; 1069 return selected;
1064} 1070}
1065 1071
1066void KOTodoView::changeEventDisplay(Event *, int) 1072void KOTodoView::changeEventDisplay(Event *, int)
1067{ 1073{
1068 updateView(); 1074 updateView();
1069} 1075}
1070 1076
1071void KOTodoView::showDates(const QDate &, const QDate &) 1077void KOTodoView::showDates(const QDate &, const QDate &)
1072{ 1078{
1073} 1079}
1074 1080
1075void KOTodoView::showEvents(QPtrList<Event>) 1081void KOTodoView::showEvents(QPtrList<Event>)
1076{ 1082{
1077 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; 1083 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
1078} 1084}
1079 1085
1080void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1086void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1081 const QDate &td) 1087 const QDate &td)
1082{ 1088{
1083#ifndef KORG_NOPRINTER 1089#ifndef KORG_NOPRINTER
1084 calPrinter->preview(CalPrinter::Todolist, fd, td); 1090 calPrinter->preview(CalPrinter::Todolist, fd, td);
1085#endif 1091#endif
1086} 1092}
1087 1093
1088void KOTodoView::editItem(QListViewItem *item ) 1094void KOTodoView::editItem(QListViewItem *item )
1089{ 1095{
1090 emit editTodoSignal(((KOTodoViewItem *)item)->todo()); 1096 emit editTodoSignal(((KOTodoViewItem *)item)->todo());
1091} 1097}
1092 1098
1093void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) 1099void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
1094{ 1100{
1095 emit showTodoSignal(((KOTodoViewItem *)item)->todo()); 1101 emit showTodoSignal(((KOTodoViewItem *)item)->todo());
1096} 1102}
1097 1103
1098void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) 1104void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
1099{ 1105{
1100 pendingSubtodo = 0; 1106 pendingSubtodo = 0;
1101 mActiveItem = (KOTodoViewItem *)item; 1107 mActiveItem = (KOTodoViewItem *)item;
1102 if (item) { 1108 if (item) {
1103 switch (column){ 1109 switch (column){
1104 case 1: 1110 case 1:
1105 mPriorityPopupMenu->popup(QCursor::pos ()); break; 1111 mPriorityPopupMenu->popup(QCursor::pos ()); break;
1106 case 2: 1112 case 2:
1107 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; 1113 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
1108 case 3: 1114 case 3:
1109 moveTodo(); 1115 moveTodo();
1110 break; 1116 break;
1111 case 8: 1117 case 8:
1112 mCategoryPopupMenu->popup(QCursor::pos ()); break; 1118 mCategoryPopupMenu->popup(QCursor::pos ()); break;
1113 case 9: 1119 case 9:
1114 mCalPopupMenu->popup(QCursor::pos ()); break; 1120 mCalPopupMenu->popup(QCursor::pos ()); break;
1115 default: 1121 default:
1116 mItemPopupMenu->popup(QCursor::pos()); 1122 mItemPopupMenu->popup(QCursor::pos());
1117 } 1123 }
1118 } else mPopupMenu->popup(QCursor::pos()); 1124 } else mPopupMenu->popup(QCursor::pos());
1119} 1125}
1120void KOTodoView::newTodo() 1126void KOTodoView::newTodo()
1121{ 1127{
1122 emit newTodoSignal(); 1128 emit newTodoSignal();
1123} 1129}
1124 1130
1125void KOTodoView::newSubTodo() 1131void KOTodoView::newSubTodo()
1126{ 1132{
1127 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1133 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1128 if (mActiveItem) { 1134 if (mActiveItem) {
1129 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) { 1135 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) {
1130 addQuickTodoPar( mActiveItem->todo()); 1136 addQuickTodoPar( mActiveItem->todo());
1131 } else 1137 } else
1132 emit newSubTodoSignal(mActiveItem->todo()); 1138 emit newSubTodoSignal(mActiveItem->todo());
1133 } 1139 }
1134} 1140}
1135void KOTodoView::unparentTodo() 1141void KOTodoView::unparentTodo()
1136{ 1142{
1137 if (mActiveItem) { 1143 if (mActiveItem) {
1138 emit unparentTodoSignal(mActiveItem->todo()); 1144 emit unparentTodoSignal(mActiveItem->todo());
1139 } 1145 }
1140} 1146}
1141 1147
1142void KOTodoView::reparentTodo() 1148void KOTodoView::reparentTodo()
1143{ 1149{
1144 if (mActiveItem) { 1150 if (mActiveItem) {
1145 topLevelWidget()->setCaption(i18n("Click on new parent item")); 1151 topLevelWidget()->setCaption(i18n("Click on new parent item"));
1146 pendingSubtodo = mActiveItem; 1152 pendingSubtodo = mActiveItem;
1147 } 1153 }
1148} 1154}
1149void KOTodoView::editTodo() 1155void KOTodoView::editTodo()
1150{ 1156{
1151 if (mActiveItem) { 1157 if (mActiveItem) {
1152 emit editTodoSignal(mActiveItem->todo()); 1158 emit editTodoSignal(mActiveItem->todo());
1153 } 1159 }
1154} 1160}
1155void KOTodoView::cloneTodo() 1161void KOTodoView::cloneTodo()
1156{ 1162{
1157 if (mActiveItem) { 1163 if (mActiveItem) {
1158 emit cloneTodoSignal((Incidence*)mActiveItem->todo()); 1164 emit cloneTodoSignal((Incidence*)mActiveItem->todo());
1159 } 1165 }
1160} 1166}
1161void KOTodoView::cancelTodo() 1167void KOTodoView::cancelTodo()
1162{ 1168{
1163 if (mActiveItem) { 1169 if (mActiveItem) {
1164 emit cancelTodoSignal((Incidence*)mActiveItem->todo()); 1170 emit cancelTodoSignal((Incidence*)mActiveItem->todo());
1165 } 1171 }
1166} 1172}
1167void KOTodoView::moveTodo() 1173void KOTodoView::moveTodo()
1168{ 1174{
1169 if (mActiveItem) { 1175 if (mActiveItem) {
1170 emit moveTodoSignal((Incidence*)mActiveItem->todo()); 1176 emit moveTodoSignal((Incidence*)mActiveItem->todo());
1171 } 1177 }
1172} 1178}
1173void KOTodoView::beamTodo() 1179void KOTodoView::beamTodo()
1174{ 1180{
1175 if (mActiveItem) { 1181 if (mActiveItem) {
1176 emit beamTodoSignal((Incidence*)mActiveItem->todo()); 1182 emit beamTodoSignal((Incidence*)mActiveItem->todo());
1177 } 1183 }
1178} 1184}
1179 1185
1180 1186
1181void KOTodoView::showTodo() 1187void KOTodoView::showTodo()
1182{ 1188{
1183 if (mActiveItem) { 1189 if (mActiveItem) {
1184 emit showTodoSignal(mActiveItem->todo()); 1190 emit showTodoSignal(mActiveItem->todo());
1185 } 1191 }
1186} 1192}
1187 1193
1188void KOTodoView::deleteTodo() 1194void KOTodoView::deleteTodo()
1189{ 1195{
1190 if (mActiveItem) { 1196 if (mActiveItem) {
1191 emit deleteTodoSignal(mActiveItem->todo()); 1197 emit deleteTodoSignal(mActiveItem->todo());
1192 } 1198 }
1193} 1199}
1194 1200
1195void KOTodoView::setNewPriority(int index) 1201void KOTodoView::setNewPriority(int index)
1196{ 1202{
1197 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1203 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1198 mActiveItem->todo()->setPriority(mPriority[index]); 1204 mActiveItem->todo()->setPriority(mPriority[index]);
1199 mActiveItem->construct(); 1205 mActiveItem->construct();
1200 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); 1206 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED);
1201 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1207 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1202 } 1208 }
1203 processSelectionChange(); 1209 processSelectionChange();
1204} 1210}
1205 1211
1206void KOTodoView::setNewPercentage(int index) 1212void KOTodoView::setNewPercentage(int index)
1207{ 1213{
1208 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1214 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1209 1215
1210 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { 1216 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) {
1211 mActiveItem->setOn( true ); 1217 mActiveItem->setOn( true );
1212 processSelectionChange(); 1218 processSelectionChange();
1213 return; 1219 return;
1214 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { 1220 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) {
1215 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); 1221 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent()));
1216 if ( par && par->isOn() ) 1222 if ( par && par->isOn() )
1217 par->setOn( false ); 1223 par->setOn( false );
1218 } 1224 }
1219 if (mPercentage[index] == 100) { 1225 if (mPercentage[index] == 100) {
1220 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); 1226 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime());
1221 } else { 1227 } else {
1222 mActiveItem->todo()->setCompleted(false); 1228 mActiveItem->todo()->setCompleted(false);
1223 } 1229 }
1224 mActiveItem->todo()->setPercentComplete(mPercentage[index]); 1230 mActiveItem->todo()->setPercentComplete(mPercentage[index]);
1225 mActiveItem->construct(); 1231 mActiveItem->construct();
1226 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); 1232 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED);
1227 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1233 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1228 } 1234 }
1229 processSelectionChange(); 1235 processSelectionChange();
1230} 1236}
1231 1237
1232void KOTodoView::fillCategories () 1238void KOTodoView::fillCategories ()
1233{ 1239{
1234 mCategoryPopupMenu->clear(); 1240 mCategoryPopupMenu->clear();
1235 if ( ! mActiveItem ) return; 1241 if ( ! mActiveItem ) return;
1236 QStringList checkedCategories = mActiveItem->todo()->categories (); 1242 QStringList checkedCategories = mActiveItem->todo()->categories ();
1237 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 1243 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
1238 it != KOPrefs::instance()->mCustomCategories.end (); 1244 it != KOPrefs::instance()->mCustomCategories.end ();
1239 ++it) { 1245 ++it) {
1240 int index = mCategoryPopupMenu->insertItem (*it); 1246 int index = mCategoryPopupMenu->insertItem (*it);
1241 mCategory[index] = *it; 1247 mCategory[index] = *it;
1242 if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); 1248 if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true);
1243 } 1249 }
1244} 1250}
1245void KOTodoView::fillCal () 1251void KOTodoView::fillCal ()
1246{ 1252{
1247 mCalPopupMenu->clear(); 1253 mCalPopupMenu->clear();
1248 if (!mActiveItem) return; 1254 if (!mActiveItem) return;
1249 bool readO = mActiveItem->todo()->isReadOnly(); 1255 bool readO = mActiveItem->todo()->isReadOnly();
1250 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 1256 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
1251 while ( kkf ) { 1257 while ( kkf ) {
1252 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); 1258 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber);
1253 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) 1259 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
1254 mCalPopupMenu->setItemEnabled( index, false ); 1260 mCalPopupMenu->setItemEnabled( index, false );
1255 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID()); 1261 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID());
1256 kkf = KOPrefs::instance()->mCalendars.next(); 1262 kkf = KOPrefs::instance()->mCalendars.next();
1257 } 1263 }
1258} 1264}
1259void KOTodoView::changedCal (int index ) 1265void KOTodoView::changedCal (int index )
1260{ 1266{
1261 if (!mActiveItem) return; 1267 if (!mActiveItem) return;
1262 mActiveItem->todo()->setCalID( index ); 1268 mActiveItem->todo()->setCalID( index );
1263 mActiveItem->construct(); 1269 mActiveItem->construct();
1264} 1270}
1265void KOTodoView::changedCategories(int index) 1271void KOTodoView::changedCategories(int index)
1266{ 1272{
1267 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1273 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1268 QStringList categories = mActiveItem->todo()->categories (); 1274 QStringList categories = mActiveItem->todo()->categories ();
1269 QString colcat = categories.first(); 1275 QString colcat = categories.first();
1270 if (categories.find (mCategory[index]) != categories.end ()) 1276 if (categories.find (mCategory[index]) != categories.end ())
1271 categories.remove (mCategory[index]); 1277 categories.remove (mCategory[index]);
1272 else 1278 else
1273 categories.insert (categories.end(), mCategory[index]); 1279 categories.insert (categories.end(), mCategory[index]);
1274 categories.sort (); 1280 categories.sort ();
1275 if ( !colcat.isEmpty() ) { 1281 if ( !colcat.isEmpty() ) {
1276 if ( categories.find ( colcat ) != categories.end () ) { 1282 if ( categories.find ( colcat ) != categories.end () ) {
1277 categories.remove( colcat ); 1283 categories.remove( colcat );
1278 categories.prepend( colcat ); 1284 categories.prepend( colcat );
1279 } 1285 }
1280 } 1286 }
1281 mActiveItem->todo()->setCategories (categories); 1287 mActiveItem->todo()->setCategories (categories);
1282 mActiveItem->construct(); 1288 mActiveItem->construct();
1283 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1289 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1284 todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); 1290 todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED);
1285 } 1291 }
1286} 1292}
1287void KOTodoView::itemDoubleClicked(QListViewItem *item) 1293void KOTodoView::itemDoubleClicked(QListViewItem *item)
1288{ 1294{
1289 if ( pendingSubtodo != 0 ) { 1295 if ( pendingSubtodo != 0 ) {
1290 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1296 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1291 } 1297 }
1292 pendingSubtodo = 0; 1298 pendingSubtodo = 0;
1293 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); 1299 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() );
1294 int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); 1300 int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() );
1295 //qDebug("ROW %d ", row); 1301 //qDebug("ROW %d ", row);
1296 if (!item) { 1302 if (!item) {
1297 newTodo(); 1303 newTodo();
1298 return; 1304 return;
1299 } else { 1305 } else {
1300 if ( row == 1 ) { 1306 if ( row == 1 ) {
1301 mActiveItem = (KOTodoViewItem *) item; 1307 mActiveItem = (KOTodoViewItem *) item;
1302 newSubTodo(); 1308 newSubTodo();
1303 return; 1309 return;
1304 } 1310 }
1305 if ( row == 5 || row == 6 || row == 2) { 1311 if ( row == 5 || row == 6 || row == 2) {
1306 mActiveItem = (KOTodoViewItem *) item; 1312 mActiveItem = (KOTodoViewItem *) item;
1307 Todo * t = mActiveItem->todo(); 1313 Todo * t = mActiveItem->todo();
1308 if ( t->isRunning() ) { 1314 if ( t->isRunning() ) {
1309 if ( t->runTime() < 15) { 1315 if ( t->runTime() < 15) {
1310 t->stopRunning(); 1316 t->stopRunning();
1311 mActiveItem->construct(); 1317 mActiveItem->construct();
1312 topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); 1318 topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!"));
1313 return; 1319 return;
1314 } 1320 }
1315 else 1321 else
1316 toggleRunningItem(); 1322 toggleRunningItem();
1317 return; 1323 return;
1318 } else { 1324 } else {
1319 t->setRunning( true ); 1325 t->setRunning( true );
1320 mActiveItem->construct(); 1326 mActiveItem->construct();
1321 topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); 1327 topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!"));
1322 return; 1328 return;
1323 } 1329 }
1324 } 1330 }
1325 } 1331 }
1326 if ( KOPrefs::instance()->mEditOnDoubleClick ) 1332 if ( KOPrefs::instance()->mEditOnDoubleClick )
1327 editItem( item ); 1333 editItem( item );
1328 else 1334 else
1329 showItem( item , QPoint(), 0 ); 1335 showItem( item , QPoint(), 0 );
1330} 1336}
1331void KOTodoView::toggleRunningItem() 1337void KOTodoView::toggleRunningItem()
1332{ 1338{
1333 // qDebug("KOTodoView::toggleRunning() "); 1339 // qDebug("KOTodoView::toggleRunning() ");
1334 if ( ! mActiveItem ) 1340 if ( ! mActiveItem )
1335 return; 1341 return;
1336 Todo * t = mActiveItem->todo(); 1342 Todo * t = mActiveItem->todo();
1337 if ( t->isRunning() ) { 1343 if ( t->isRunning() ) {
1338 KOStopTodoPrefs tp ( t, this ); 1344 KOStopTodoPrefs tp ( t, this );
1339 if (QApplication::desktop()->width() <= 800 ){ 1345 if (QApplication::desktop()->width() <= 800 ){
1340 int wid = tp.width(); 1346 int wid = tp.width();
1341 int hei = tp.height(); 1347 int hei = tp.height();
1342 int xx = (QApplication::desktop()->width()-wid)/2; 1348 int xx = (QApplication::desktop()->width()-wid)/2;
1343 int yy = (QApplication::desktop()->height()-hei)/2; 1349 int yy = (QApplication::desktop()->height()-hei)/2;
1344 tp.setGeometry( xx,yy,wid,hei ); 1350 tp.setGeometry( xx,yy,wid,hei );
1345 } 1351 }
1346 tp.exec(); 1352 tp.exec();
1347 mActiveItem->construct(); 1353 mActiveItem->construct();
1348 } else { 1354 } else {
1349 KOStartTodoPrefs tp ( t->summary(), this ); 1355 KOStartTodoPrefs tp ( t->summary(), this );
1350 if (QApplication::desktop()->width() <= 800 ){ 1356 if (QApplication::desktop()->width() <= 800 ){
1351 int wid = tp.width(); 1357 int wid = tp.width();
1352 int hei = tp.height(); 1358 int hei = tp.height();
1353 int xx = (QApplication::desktop()->width()-wid)/2; 1359 int xx = (QApplication::desktop()->width()-wid)/2;
1354 int yy = (QApplication::desktop()->height()-hei)/2; 1360 int yy = (QApplication::desktop()->height()-hei)/2;
1355 tp.setGeometry( xx,yy,wid,hei ); 1361 tp.setGeometry( xx,yy,wid,hei );
1356 } 1362 }
1357 if ( !tp.exec() ) return; 1363 if ( !tp.exec() ) return;
1358 if ( tp.stopAll() ) { 1364 if ( tp.stopAll() ) {
1359 mCalendar->stopAllTodos(); 1365 mCalendar->stopAllTodos();
1360 t->setRunning( true ); 1366 t->setRunning( true );
1361 updateView(); 1367 updateView();
1362 } else { 1368 } else {
1363 t->setRunning( true ); 1369 t->setRunning( true );
1364 mActiveItem->construct(); 1370 mActiveItem->construct();
1365 } 1371 }
1366 } 1372 }
1367} 1373}
1368 1374
1369void KOTodoView::itemClicked(QListViewItem *item) 1375void KOTodoView::itemClicked(QListViewItem *item)
1370{ 1376{
1371 //qDebug("KOTodoView::itemClicked %d", item); 1377 //qDebug("KOTodoView::itemClicked %d", item);
1372 if (!item) { 1378 if (!item) {
1373 if ( pendingSubtodo != 0 ) { 1379 if ( pendingSubtodo != 0 ) {
1374 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1380 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1375 } 1381 }
1376 pendingSubtodo = 0; 1382 pendingSubtodo = 0;
1377 return; 1383 return;
1378 } 1384 }
1379 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1385 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1380 if ( pendingSubtodo != 0 ) { 1386 if ( pendingSubtodo != 0 ) {
1381 bool allowReparent = true; 1387 bool allowReparent = true;
1382 QListViewItem *par = item; 1388 QListViewItem *par = item;
1383 while ( par ) { 1389 while ( par ) {
1384 if ( par == pendingSubtodo ) { 1390 if ( par == pendingSubtodo ) {
1385 allowReparent = false; 1391 allowReparent = false;
1386 break; 1392 break;
1387 } 1393 }
1388 par = par->parent(); 1394 par = par->parent();
1389 } 1395 }
1390 if ( !allowReparent ) { 1396 if ( !allowReparent ) {
1391 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); 1397 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
1392 pendingSubtodo = 0; 1398 pendingSubtodo = 0;
1393 } else { 1399 } else {
1394 Todo* newParent = todoItem->todo(); 1400 Todo* newParent = todoItem->todo();
1395 Todo* newSub = pendingSubtodo->todo(); 1401 Todo* newSub = pendingSubtodo->todo();
1396 pendingSubtodo = 0; 1402 pendingSubtodo = 0;
1397 emit reparentTodoSignal( newParent,newSub ); 1403 emit reparentTodoSignal( newParent,newSub );
1398 return; 1404 return;
1399 } 1405 }
1400 } 1406 }
1401 1407
1402} 1408}
1403 1409
1404void KOTodoView::setDocumentId( const QString &id ) 1410void KOTodoView::setDocumentId( const QString &id )
1405{ 1411{
1406 1412
1407 mDocPrefs->setDoc( id ); 1413 mDocPrefs->setDoc( id );
1408} 1414}
1409 1415
1410void KOTodoView::itemStateChanged( QListViewItem *item ) 1416void KOTodoView::itemStateChanged( QListViewItem *item )
1411{ 1417{
1412 if (!item) return; 1418 if (!item) return;
1413 1419
1414 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1420 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1415 1421
1416// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; 1422// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
1417 1423
1418 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); 1424 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
1419} 1425}
1420 1426
1421void KOTodoView::saveLayout(KConfig *config, const QString &group) const 1427void KOTodoView::saveLayout(KConfig *config, const QString &group) const
1422{ 1428{
1423 mTodoListView->saveLayout(config,group); 1429 mTodoListView->saveLayout(config,group);
1424} 1430}
1425 1431
1426void KOTodoView::restoreLayout(KConfig *config, const QString &group) 1432void KOTodoView::restoreLayout(KConfig *config, const QString &group)
1427{ 1433{
1428 mTodoListView->restoreLayout(config,group); 1434 mTodoListView->restoreLayout(config,group);
1429} 1435}
1430 1436
1431void KOTodoView::processSelectionChange() 1437void KOTodoView::processSelectionChange()
1432{ 1438{
1433// kdDebug() << "KOTodoView::processSelectionChange()" << endl; 1439// kdDebug() << "KOTodoView::processSelectionChange()" << endl;
1434 1440
1435 KOTodoViewItem *item = 1441 KOTodoViewItem *item =
1436 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); 1442 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() );
1437 1443
1438 if ( !item ) { 1444 if ( !item ) {
1439 emit incidenceSelected( 0 ); 1445 emit incidenceSelected( 0 );
1440 mNewSubBut->setEnabled( false ); 1446 mNewSubBut->setEnabled( false );
1441 } else { 1447 } else {
1442 emit incidenceSelected( item->todo() ); 1448 emit incidenceSelected( item->todo() );
1443 mNewSubBut->setEnabled( true ); 1449 mNewSubBut->setEnabled( true );
1444 } 1450 }
1445} 1451}
1446 1452
1447void KOTodoView::modified(bool b) 1453void KOTodoView::modified(bool b)
1448{ 1454{
1449 emit isModified(b); 1455 emit isModified(b);
1450} 1456}
1451void KOTodoView::setTodoModified( Todo* todo ) 1457void KOTodoView::setTodoModified( Todo* todo )
1452{ 1458{
1453 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); 1459 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED );
1454} 1460}
1455void KOTodoView::clearSelection() 1461void KOTodoView::clearSelection()
1456{ 1462{
1457 mTodoListView->selectAll( false ); 1463 mTodoListView->selectAll( false );
1458} 1464}
1459void KOTodoView::setAllOpen() 1465void KOTodoView::setAllOpen()
1460{ 1466{
1461 if ( isFlatDisplay ) { 1467 if ( isFlatDisplay ) {
1462 isFlatDisplay = false; 1468 isFlatDisplay = false;
1463 mPopupMenu->setItemChecked( 8,false ); 1469 mPopupMenu->setItemChecked( 8,false );
1464 updateView(); 1470 updateView();
1465 } else { 1471 } else {
1466 storeCurrentItem(); 1472 storeCurrentItem();
1467 } 1473 }
1468 setOpen(mTodoListView->firstChild(), true); 1474 setOpen(mTodoListView->firstChild(), true);
1469 resetCurrentItem(); 1475 resetCurrentItem();
1470} 1476}
1471void KOTodoView::setAllClose() 1477void KOTodoView::setAllClose()
1472{ 1478{
1473 if ( isFlatDisplay ) { 1479 if ( isFlatDisplay ) {
1474 isFlatDisplay = false; 1480 isFlatDisplay = false;
1475 mPopupMenu->setItemChecked( 8,false ); 1481 mPopupMenu->setItemChecked( 8,false );
1476 updateView(); 1482 updateView();
1477 } else { 1483 } else {
1478 storeCurrentItem(); 1484 storeCurrentItem();
1479 } 1485 }
1480 setOpen(mTodoListView->firstChild(), false); 1486 setOpen(mTodoListView->firstChild(), false);
1481 resetCurrentItem(); 1487 resetCurrentItem();
1482} 1488}
1483void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) 1489void KOTodoView::setOpen( QListViewItem* item, bool setOpenI)
1484{ 1490{
1485 1491
1486 while ( item ) { 1492 while ( item ) {
1487 setOpen( item->firstChild(), setOpenI ); 1493 setOpen( item->firstChild(), setOpenI );
1488 item->setOpen( setOpenI ); 1494 item->setOpen( setOpenI );
1489 item = item->nextSibling(); 1495 item = item->nextSibling();
1490 } 1496 }
1491} 1497}
1492 1498
1493void KOTodoView::displayAllFlat() 1499void KOTodoView::displayAllFlat()
1494{ 1500{
1495 storeCurrentItem(); 1501 storeCurrentItem();
1496 pendingSubtodo = 0; 1502 pendingSubtodo = 0;
1497 if ( mBlockUpdate ) { 1503 if ( mBlockUpdate ) {
1498 return; 1504 return;
1499 } 1505 }
1500 mPopupMenu->setItemChecked( 8,true ); 1506 mPopupMenu->setItemChecked( 8,true );
1501 isFlatDisplay = true; 1507 isFlatDisplay = true;
1502 QPtrList<Todo> todoList = calendar()->todos(); 1508 QPtrList<Todo> todoList = calendar()->todos();
1503 mTodoMap.clear(); 1509 mTodoMap.clear();
1504 mTodoListView->clear(); 1510 mTodoListView->clear();
1505 Todo *todo; 1511 Todo *todo;
1506 for(todo = todoList.first(); todo; todo = todoList.next()) { 1512 for(todo = todoList.first(); todo; todo = todoList.next()) {
1507 if ( checkTodo( todo ) ) { 1513 if ( checkTodo( todo ) ) {
1508 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1514 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1509 mTodoMap.insert(todo,todoItem); 1515 mTodoMap.insert(todo,todoItem);
1510 } 1516 }
1511 } 1517 }
1512 resetCurrentItem(); 1518 resetCurrentItem();
1513} 1519}
1514 1520
1515void KOTodoView::setAllFlat() 1521void KOTodoView::setAllFlat()
1516{ 1522{
1517 if ( isFlatDisplay ) { 1523 if ( isFlatDisplay ) {
1518 isFlatDisplay = false; 1524 isFlatDisplay = false;
1519 mPopupMenu->setItemChecked( 8,false ); 1525 mPopupMenu->setItemChecked( 8,false );
1520 updateView(); 1526 updateView();
1521 return; 1527 return;
1522 } 1528 }
1523 displayAllFlat(); 1529 displayAllFlat();
1524} 1530}
1525 1531
1526void KOTodoView::purgeCompleted() 1532void KOTodoView::purgeCompleted()
1527{ 1533{
1528 emit purgeCompletedSignal(); 1534 emit purgeCompletedSignal();
1529 1535
1530} 1536}
1531void KOTodoView::toggleQuickTodo() 1537void KOTodoView::toggleQuickTodo()
1532{ 1538{
1533 if ( mQuickBar->isVisible() ) { 1539 if ( mQuickBar->isVisible() ) {
1534 mQuickBar->hide(); 1540 mQuickBar->hide();
1535 KOPrefs::instance()->mEnableQuickTodo = false; 1541 KOPrefs::instance()->mEnableQuickTodo = false;
1536 } 1542 }
1537 else { 1543 else {
1538 mQuickBar->show(); 1544 mQuickBar->show();
1539 KOPrefs::instance()->mEnableQuickTodo = true; 1545 KOPrefs::instance()->mEnableQuickTodo = true;
1540 } 1546 }
1541 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 1547 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
1542 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 1548 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
1543} 1549}
1544 1550
1545void KOTodoView::toggleRunning() 1551void KOTodoView::toggleRunning()
1546{ 1552{
1547 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; 1553 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos;
1548 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 1554 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
1549 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 1555 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
1550 updateView(); 1556 updateView();
1551 if ( KOPrefs::instance()->mHideNonStartedTodos ) 1557 if ( KOPrefs::instance()->mHideNonStartedTodos )
1552 topLevelWidget()->setCaption(i18n("Hide not Running")); 1558 topLevelWidget()->setCaption(i18n("Hide not Running"));
1553 else 1559 else
1554 topLevelWidget()->setCaption(i18n("Show not Running")); 1560 topLevelWidget()->setCaption(i18n("Show not Running"));
1555} 1561}
1556 1562
1557void KOTodoView::toggleCompleted() 1563void KOTodoView::toggleCompleted()
1558{ 1564{
1559 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; 1565 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
1560 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 1566 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
1561 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 1567 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
1562 updateView(); 1568 updateView();
1563 if ( KOPrefs::instance()->mShowCompletedTodo ) 1569 if ( KOPrefs::instance()->mShowCompletedTodo )
1564 topLevelWidget()->setCaption(i18n("Show Completed")); 1570 topLevelWidget()->setCaption(i18n("Show Completed"));
1565 else 1571 else
1566 topLevelWidget()->setCaption(i18n("Hide Completed")); 1572 topLevelWidget()->setCaption(i18n("Hide Completed"));
1567} 1573}
1568 1574
1569void KOTodoView::addQuickTodo() 1575void KOTodoView::addQuickTodo()
1570{ 1576{
1571 addQuickTodoPar( 0 ); 1577 addQuickTodoPar( 0 );
1572} 1578}
1573void KOTodoView::addQuickTodoPar( Todo * parentTodo) 1579void KOTodoView::addQuickTodoPar( Todo * parentTodo)
1574{ 1580{
1575 Todo *todo = new Todo(); 1581 Todo *todo = new Todo();
1576 todo->setSummary(mQuickAdd->text()); 1582 todo->setSummary(mQuickAdd->text());
1577 todo->setOrganizer(KOPrefs::instance()->email()); 1583 todo->setOrganizer(KOPrefs::instance()->email());
1578 if ( parentTodo ) { 1584 if ( parentTodo ) {
1579 todo->setRelatedTo(parentTodo); 1585 todo->setRelatedTo(parentTodo);
1580 1586
1581 todo->setCategories (parentTodo->categoriesStr ()); 1587 todo->setCategories (parentTodo->categoriesStr ());
1582 todo->setSecrecy (parentTodo->secrecy ()); 1588 todo->setSecrecy (parentTodo->secrecy ());
1583 if ( parentTodo->priority() < 3 ) 1589 if ( parentTodo->priority() < 3 )
1584 todo->setPriority( parentTodo->priority() ); 1590 todo->setPriority( parentTodo->priority() );
1585 todo->setCalID( parentTodo->calID() ); 1591 todo->setCalID( parentTodo->calID() );
1586 } else { 1592 } else {
1587 CalFilter * cf = mCalendar->filter(); 1593 CalFilter * cf = mCalendar->filter();
1588 if ( cf ) { 1594 if ( cf ) {
1589 if ( cf->isEnabled()&& cf->showCategories()) { 1595 if ( cf->isEnabled()&& cf->showCategories()) {
1590 todo->setCategories(cf->categoryList()); 1596 todo->setCategories(cf->categoryList());
1591 } 1597 }
1592 if ( cf->isEnabled() ) 1598 if ( cf->isEnabled() )
1593 todo->setSecrecy( cf->getSecrecy()); 1599 todo->setSecrecy( cf->getSecrecy());
1594 } 1600 }
1595 } 1601 }
1596 mCalendar->addTodo(todo); 1602 mCalendar->addTodo(todo);
1597 mQuickAdd->setText(""); 1603 mQuickAdd->setText("");
1598 todoModified (todo, KOGlobals::EVENTADDED ); 1604 todoModified (todo, KOGlobals::EVENTADDED );
1599 updateView(); 1605 updateView();
1600 1606
1601} 1607}
1602void KOTodoView::keyPressEvent ( QKeyEvent * e ) 1608void KOTodoView::keyPressEvent ( QKeyEvent * e )
1603{ 1609{
1604 // e->ignore(); 1610 // e->ignore();
1605 //return; 1611 //return;
1606 //qDebug("KOTodoView::keyPressEvent ");
1607 if ( !isVisible() ) { 1612 if ( !isVisible() ) {
1608 e->ignore(); 1613 e->ignore();
1609 return; 1614 return;
1610 } 1615 }
1611 switch ( e->key() ) { 1616 switch ( e->key() ) {
1612 case Qt::Key_Down: 1617 case Qt::Key_Down:
1613 case Qt::Key_Up: 1618 case Qt::Key_Up:
1614 QWidget::keyPressEvent ( e ); 1619 // KOrg::BaseView::keyPressEvent ( e );
1620 e->ignore();
1615 break; 1621 break;
1616 1622
1617 case Qt::Key_Q: 1623 case Qt::Key_Q:
1618 1624
1619 1625
1620 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) { 1626 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) {
1621 e->ignore(); 1627 e->ignore();
1622 break; 1628 break;
1623 } 1629 }
1624 toggleQuickTodo(); 1630 toggleQuickTodo();
1625 break; 1631 break;
1626 case Qt::Key_U: 1632 case Qt::Key_U:
1627 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1633 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1628 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1634 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1629 unparentTodo(); 1635 unparentTodo();
1630 e->accept(); 1636 e->accept();
1631 } else 1637 } else
1632 e->ignore(); 1638 e->ignore();
1633 break; 1639 break;
1634 case Qt::Key_S: 1640 case Qt::Key_S:
1635 if ( e->state() == Qt::ControlButton ) { 1641 if ( e->state() == Qt::ControlButton ) {
1636 e->ignore(); 1642 e->ignore();
1637 break; 1643 break;
1638 } 1644 }
1639 if ( e->state() == Qt::ShiftButton ) { 1645 if ( e->state() == Qt::ShiftButton ) {
1640 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1646 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1641 reparentTodo(); 1647 reparentTodo();
1642 e->accept(); 1648 e->accept();
1643 } else 1649 } else
1644 e->ignore(); 1650 e->ignore();
1645 break; 1651 break;
1646 case Qt::Key_P: 1652 case Qt::Key_P:
1647 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1653 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1648 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1654 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1649 if ( pendingSubtodo ) 1655 if ( pendingSubtodo )
1650 itemClicked(mActiveItem); 1656 itemClicked(mActiveItem);
1651 e->accept(); 1657 e->accept();
1652 } else 1658 } else
1653 e->ignore(); 1659 e->ignore();
1654 break; 1660 break;
1655 case Qt::Key_Escape: 1661 case Qt::Key_Escape:
1656 if ( pendingSubtodo ) { 1662 if ( pendingSubtodo ) {
1657 itemClicked(0); 1663 itemClicked(0);
1658 e->accept(); 1664 e->accept();
1659 } else 1665 } else
1660 e->ignore(); 1666 e->ignore();
1661 break; 1667 break;
1662 default: 1668 default:
1663 e->ignore(); 1669 e->ignore();
1664 } 1670 }
1665 1671
1666 if ( true ) { 1672 if ( true ) {
1667 if ( e->key() == Qt::Key_I ) { 1673 if ( e->key() == Qt::Key_I ) {
1668 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); 1674 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem();
1669 if ( cn ) { 1675 if ( cn ) {
1670 mActiveItem = cn; 1676 mActiveItem = cn;
1671 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 1677 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
1672 if ( ci ){ 1678 if ( ci ){
1673 showTodo(); 1679 showTodo();
1674 cn = (KOTodoViewItem*)cn->itemBelow(); 1680 cn = (KOTodoViewItem*)cn->itemBelow();
1675 if ( cn ) { 1681 if ( cn ) {
1676 mTodoListView->setCurrentItem ( cn ); 1682 mTodoListView->setCurrentItem ( cn );
1677 mTodoListView->ensureItemVisible ( cn ); 1683 mTodoListView->ensureItemVisible ( cn );
1678 } 1684 }
1679 1685
1680 } 1686 }
1681 } 1687 }
1682 e->accept(); 1688 e->accept();
1683 1689
1684 } 1690 }
1685 1691
1686 } 1692 }
1687 1693
1688} 1694}
1689void KOTodoView::updateTodo( Todo * t, int type ) 1695void KOTodoView::updateTodo( Todo * t, int type )
1690{ 1696{
1691 if ( mBlockUpdate) 1697 if ( mBlockUpdate)
1692 return; 1698 return;
1693 1699
1694 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 1700 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
1695 itemIterator = mTodoMap.find(t); 1701 itemIterator = mTodoMap.find(t);
1696 if (itemIterator != mTodoMap.end()) { 1702 if (itemIterator != mTodoMap.end()) {
1697 (*itemIterator)->construct(); 1703 (*itemIterator)->construct();
1698 } else { 1704 } else {
1699 if ( type == KOGlobals::EVENTADDED ) { 1705 if ( type == KOGlobals::EVENTADDED ) {
1700 insertTodoItem( t ); 1706 insertTodoItem( t );
1701 } 1707 }
1702 } 1708 }
1703 1709
1704} 1710}
1705 1711
1706void KOTodoView::todoModified(Todo * t , int p ) 1712void KOTodoView::todoModified(Todo * t , int p )
1707{ 1713{
1708 mBlockUpdate = true; 1714 mBlockUpdate = true;
1709 emit todoModifiedSignal ( t, p ); 1715 emit todoModifiedSignal ( t, p );
1710 mBlockUpdate = false; 1716 mBlockUpdate = false;
1711} 1717}
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 0cf6e4c..bdef94c 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -1,526 +1,576 @@
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 19
20#include <klocale.h> 20#include <klocale.h>
21#include <kdebug.h> 21#include <kdebug.h>
22#include <qapp.h> 22#include <qapp.h>
23#include <kglobal.h> 23#include <kglobal.h>
24 24
25#include <kiconloader.h> 25#include <kiconloader.h>
26#include "kotodoviewitem.h" 26#include "kotodoviewitem.h"
27#include "kotodoview.h" 27#include "kotodoview.h"
28#include "koprefs.h" 28#include "koprefs.h"
29 29
30KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) 30KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo)
31 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 31 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
32{ 32{
33 construct(); 33 construct();
34} 34}
35 35
36KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) 36KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo )
37 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 37 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
38{ 38{
39 construct(); 39 construct();
40} 40}
41 41
42QString KOTodoViewItem::key(int column,bool) const 42QString KOTodoViewItem::key(int column,bool) const
43{ 43{
44 QMap<int,QString>::ConstIterator it = mKeyMap.find(column); 44 QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
45 if (it == mKeyMap.end()) { 45 if (it == mKeyMap.end()) {
46 return text(column).lower(); 46 return text(column).lower();
47 } else { 47 } else {
48 return *it; 48 return *it;
49 } 49 }
50} 50}
51 51
52void KOTodoViewItem:: setup() 52void KOTodoViewItem:: setup()
53{ 53{
54 54
55 int h = 20; 55 int h = 20;
56 if ( listView () ) { 56 if ( listView () ) {
57 QFontMetrics fm ( listView ()->font () ); 57 QFontMetrics fm ( listView ()->font () );
58 h = fm.height(); 58 h = fm.height();
59 } 59 }
60 setHeight( h ); 60 setHeight( h );
61 61
62} 62}
63void KOTodoViewItem::setSortKey(int column,const QString &key) 63void KOTodoViewItem::setSortKey(int column,const QString &key)
64{ 64{
65 mKeyMap.insert(column,key); 65 mKeyMap.insert(column,key);
66} 66}
67 67
68#if QT_VERSION >= 0x030000 68#if QT_VERSION >= 0x030000
69void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, 69void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w,
70 int y,int h) 70 int y,int h)
71{ 71{
72 QListViewItem::paintBranches(p,cg,w,y,h); 72 QListViewItem::paintBranches(p,cg,w,y,h);
73} 73}
74#else 74#else
75#endif 75#endif
76 76
77void KOTodoViewItem::construct() 77void KOTodoViewItem::construct()
78{ 78{
79 // qDebug("KOTodoViewItem::construct() "); 79 // qDebug("KOTodoViewItem::construct() ");
80 m_init = true; 80 m_init = true;
81 QString keyd = "=="; 81 QString keyd = "==";
82 QString keyt = "=="; 82 QString keyt = "==";
83 QString skeyd = "=="; 83 QString skeyd = "==";
84 QString skeyt = "=="; 84 QString skeyt = "==";
85 85
86 setOn(mTodo->isCompleted()); 86 setOn(mTodo->isCompleted());
87 setText(0,mTodo->summary()); 87 setText(0,mTodo->summary());
88 setText(1,QString::number(mTodo->priority())); 88 setText(1,QString::number(mTodo->priority()));
89 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 89 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
90 if (mTodo->percentComplete()<100) { 90 if (mTodo->percentComplete()<100) {
91 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 91 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
92 else setSortKey(2,QString::number(mTodo->percentComplete())); 92 else setSortKey(2,QString::number(mTodo->percentComplete()));
93 } 93 }
94 else { 94 else {
95 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 95 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
96 else setSortKey(2,QString::number(99)); 96 else setSortKey(2,QString::number(99));
97 } 97 }
98 if (mTodo->hasDueDate()) { 98 if (mTodo->hasDueDate()) {
99 setText(3, mTodo->dtDueDateStr()); 99 setText(3, mTodo->dtDueDateStr());
100 QDate d = mTodo->dtDue().date(); 100 QDate d = mTodo->dtDue().date();
101 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 101 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
102 // setSortKey(3,keyd); 102 // setSortKey(3,keyd);
103 if (mTodo->doesFloat()) { 103 if (mTodo->doesFloat()) {
104 setText(4,""); 104 setText(4,"");
105 } 105 }
106 else { 106 else {
107 setText(4,mTodo->dtDueTimeStr()); 107 setText(4,mTodo->dtDueTimeStr());
108 QTime t = mTodo->dtDue().time(); 108 QTime t = mTodo->dtDue().time();
109 keyt.sprintf("%02d%02d",t.hour(),t.minute()); 109 keyt.sprintf("%02d%02d",t.hour(),t.minute());
110 //setSortKey(4,keyt); 110 //setSortKey(4,keyt);
111 } 111 }
112 } else { 112 } else {
113 setText(3,""); 113 setText(3,"");
114 setText(4,""); 114 setText(4,"");
115 } 115 }
116 setSortKey(3,keyd); 116 setSortKey(3,keyd);
117 setSortKey(4,keyt); 117 setSortKey(4,keyt);
118 118
119 if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); 119 if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt);
120 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 120 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
121 121
122 122
123 123
124 keyd = ""; 124 keyd = "";
125 keyt = ""; 125 keyt = "";
126 126
127 if (mTodo->isRunning() ) { 127 if (mTodo->isRunning() ) {
128 QDate d = mTodo->runStart().date(); 128 QDate d = mTodo->runStart().date();
129 QTime t = mTodo->runStart().time(); 129 QTime t = mTodo->runStart().time();
130 skeyt.sprintf("%02d%02d",t.hour(),t.minute()); 130 skeyt.sprintf("%02d%02d",t.hour(),t.minute());
131 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 131 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
132 keyd = KGlobal::locale()->formatDate( d , true); 132 keyd = KGlobal::locale()->formatDate( d , true);
133 keyt = KGlobal::locale()->formatTime( t ); 133 keyt = KGlobal::locale()->formatTime( t );
134 134
135 } else { 135 } else {
136 136
137 if (mTodo->hasStartDate()) { 137 if (mTodo->hasStartDate()) {
138 keyd = mTodo->dtStartDateStr(); 138 keyd = mTodo->dtStartDateStr();
139 QDate d = mTodo->dtStart().date(); 139 QDate d = mTodo->dtStart().date();
140 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 140 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
141 141
142 if ( !mTodo->doesFloat()) { 142 if ( !mTodo->doesFloat()) {
143 keyt = mTodo->dtStartTimeStr(); 143 keyt = mTodo->dtStartTimeStr();
144 QTime t = mTodo->dtStart().time(); 144 QTime t = mTodo->dtStart().time();
145 skeyt.sprintf("%02d%02d",t.hour(),t.minute()); 145 skeyt.sprintf("%02d%02d",t.hour(),t.minute());
146 146
147 } 147 }
148 148
149 } 149 }
150 } 150 }
151 setText(5,keyd); 151 setText(5,keyd);
152 setText(6,keyt); 152 setText(6,keyt);
153 setSortKey(5,skeyd); 153 setSortKey(5,skeyd);
154 setSortKey(6,skeyt); 154 setSortKey(6,skeyt);
155 155
156 setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); 156 //setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No"));
157 setText(8,mTodo->categoriesStr()); 157 setText(7,mTodo->categoriesStr());
158 setText(9,KOPrefs::instance()->calName( mTodo->calID())); 158 setText(8,KOPrefs::instance()->calName( mTodo->calID()));
159 159 setText(9, KGlobal::locale()->formatDateTime( mTodo->lastModified(), true, true ));
160 setText(10, KGlobal::locale()->formatDateTime( mTodo->created(), true, true ));
161 setText(11, KGlobal::locale()->formatDateTime( mTodo->lastModifiedSub(), true, true ));
162 QString key;
163 QDate d = mTodo->lastModified().date();
164 QTime t = mTodo->lastModified().time();
165 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() );
166 setSortKey(9,key);
167 d = mTodo->created().date();
168 t = mTodo->created().time();
169 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() );
170 setSortKey(10,key);
171 d = mTodo->lastModifiedSub().date();
172 t = mTodo->lastModifiedSub().time();
173 key.sprintf("%04d%02d%02d%02d%02d%02d",d.year(),d.month(),d.day(),t.hour(),t.minute(),t.second() );
174 setSortKey(11,key);
175
160#if 0 176#if 0
161 // Find sort id in description. It's the text behind the last '#' character 177 // Find sort id in description. It's the text behind the last '#' character
162 // found in the description. White spaces are removed from beginning and end 178 // found in the description. White spaces are removed from beginning and end
163 // of sort id. 179 // of sort id.
164 int pos = mTodo->description().findRev('#'); 180 int pos = mTodo->description().findRev('#');
165 if (pos < 0) { 181 if (pos < 0) {
166 setText(6,""); 182 setText(6,"");
167 } else { 183 } else {
168 QString str = mTodo->description().mid(pos+1); 184 QString str = mTodo->description().mid(pos+1);
169 str.stripWhiteSpace(); 185 str.stripWhiteSpace();
170 setText(6,str); 186 setText(6,str);
171 } 187 }
172#endif 188#endif
173 189
174 m_known = false; 190 m_known = false;
175 m_init = false; 191 m_init = false;
176 192
177 setMyPixmap(); 193 setMyPixmap();
178 194
179} 195}
180void KOTodoViewItem::setMyPixmap() 196void KOTodoViewItem::setMyPixmap()
181{ 197{
182 int size = 5; 198 int size = 5;
183 QPixmap pixi = QPixmap( 1, 1 ); 199 QPixmap pixi = QPixmap( 1, 1 );
184 // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) { 200 // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) {
185// pixi = SmallIcon("redcross16"); 201// pixi = SmallIcon("redcross16");
186// } else { 202// } else {
187 QPainter p; 203 QPainter p;
188 204
189 int pixSize = 0; 205 int pixSize = 0;
190 QPixmap pPix = QPixmap( size, size ); 206 QPixmap pPix = QPixmap( size, size );
191 if ( mTodo->description().length() > 0 ) { 207 if ( mTodo->description().length() > 0 ) {
192 pixi.resize(size, pixSize+size); 208 pixi.resize(size, pixSize+size);
193 pPix.fill( Qt::darkGreen ); 209 pPix.fill( Qt::darkGreen );
194 p.begin( &pixi ); 210 p.begin( &pixi );
195 p. drawPixmap ( 0, pixSize, pPix); 211 p. drawPixmap ( 0, pixSize, pPix);
196 p.end(); 212 p.end();
197 pixSize += size; 213 pixSize += size;
198 } 214 }
199 if ( mTodo->isAlarmEnabled() && mTodo->alarmEnabled()) { 215 if ( mTodo->isAlarmEnabled() && mTodo->alarmEnabled()) {
200 pixi.resize(size, pixSize+size); 216 pixi.resize(size, pixSize+size);
201 pPix.fill( Qt::red ); 217 pPix.fill( Qt::red );
202 p.begin( &pixi ); 218 p.begin( &pixi );
203 p. drawPixmap ( 0, pixSize, pPix); 219 p. drawPixmap ( 0, pixSize, pPix);
204 p.end(); 220 p.end();
205 pixSize += size; 221 pixSize += size;
206 } 222 }
207 if ( mTodo->doesRecur() ) { 223 if ( mTodo->doesRecur() ) {
208 pixi.resize(size, pixSize+size); 224 pixi.resize(size, pixSize+size);
209 pPix.fill( Qt::blue ); 225 pPix.fill( Qt::blue );
210 p.begin( &pixi ); 226 p.begin( &pixi );
211 p. drawPixmap ( 0, pixSize, pPix); 227 p. drawPixmap ( 0, pixSize, pPix);
212 p.end(); 228 p.end();
213 pixSize += size; 229 pixSize += size;
214 } 230 }
215 // } 231 // }
216 if ( pixi.width() > 1 ) { 232 if ( pixi.width() > 1 ) {
217 setPixmap ( 0,pixi ) ; 233 setPixmap ( 0,pixi ) ;
218 } else { 234 } else {
219 setPixmap ( 0,QPixmap() ) ; 235 setPixmap ( 0,QPixmap() ) ;
220 } 236 }
221} 237}
222void KOTodoViewItem::stateChange(bool state) 238void KOTodoViewItem::stateChange(bool state)
223{ 239{
224 // qDebug("KOTodoViewItem::stateChange %d ", state); 240 // qDebug("KOTodoViewItem::stateChange %d ", state);
225 // do not change setting on startup 241 // do not change setting on startup
226 if ( m_init ) return; 242 if ( m_init ) return;
227 if (isOn()!=state) { 243 if (isOn()!=state) {
228 setOn(state); 244 setOn(state);
229 //qDebug("SETON "); 245 //qDebug("SETON ");
230 return; 246 return;
231 } 247 }
232 if ( mTodo->isCompleted() == state ) { 248 if ( mTodo->isCompleted() == state ) {
233 //qDebug("STATECHANGE:nothing to do "); 249 //qDebug("STATECHANGE:nothing to do ");
234 return; 250 return;
235 } 251 }
236 QString keyd = "=="; 252 QString keyd = "==";
237 QString keyt = "=="; 253 QString keyt = "==";
238 //qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1()); 254 //qDebug("KOTodoViewItem::stateChange %s ", text(0).latin1());
239 if ( mTodo->doesRecur() ){ 255 if ( mTodo->doesRecur() ){
240 QDateTime start = mTodo->dtStart(); 256 QDateTime start = mTodo->dtStart();
241 mTodo->setCompleted(state); 257 mTodo->setCompleted(state);
242 if ( start != mTodo->dtStart() ) { 258 if ( start != mTodo->dtStart() ) {
243 if ( state && !mTodo->isCompleted() ) { 259 if ( state && !mTodo->isCompleted() ) {
244 setOn( false ); 260 setOn( false );
245 state = false; 261 state = false;
246 } 262 }
247 } 263 }
248 } else 264 } else
249 mTodo->setCompleted(state); 265 mTodo->setCompleted(state);
250 266
251 if (state) mTodo->setCompleted(QDateTime::currentDateTime()); 267 if (state) mTodo->setCompleted(QDateTime::currentDateTime());
252 268
253 if (mTodo->hasDueDate()) { 269 if (mTodo->hasDueDate()) {
254 setText(3, mTodo->dtDueDateStr()); 270 setText(3, mTodo->dtDueDateStr());
255 QDate d = mTodo->dtDue().date(); 271 QDate d = mTodo->dtDue().date();
256 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 272 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
257 setSortKey(3,keyd); 273 setSortKey(3,keyd);
258 if (mTodo->doesFloat()) { 274 if (mTodo->doesFloat()) {
259 setText(4,""); 275 setText(4,"");
260 } 276 }
261 else { 277 else {
262 setText(4,mTodo->dtDueTimeStr()); 278 setText(4,mTodo->dtDueTimeStr());
263 QTime t = mTodo->dtDue().time(); 279 QTime t = mTodo->dtDue().time();
264 keyt.sprintf("%02d%02d",t.hour(),t.minute()); 280 keyt.sprintf("%02d%02d",t.hour(),t.minute());
265 setSortKey(4,keyt); 281 setSortKey(4,keyt);
266 } 282 }
267 } 283 }
268 if (mTodo->hasStartDate()) { 284 if (mTodo->hasStartDate()) {
269 QString skeyt = "=="; 285 QString skeyt = "==";
270 QString skeyd = "=="; 286 QString skeyd = "==";
271 setText(5, mTodo->dtStartDateStr()); 287 setText(5, mTodo->dtStartDateStr());
272 QDate d = mTodo->dtStart().date(); 288 QDate d = mTodo->dtStart().date();
273 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 289 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
274 290
275 if (mTodo->doesFloat()) { 291 if (mTodo->doesFloat()) {
276 setText(6,""); 292 setText(6,"");
277 } 293 }
278 else { 294 else {
279 setText(6,mTodo->dtStartTimeStr()); 295 setText(6,mTodo->dtStartTimeStr());
280 QTime t = mTodo->dtStart().time(); 296 QTime t = mTodo->dtStart().time();
281 skeyt.sprintf("%02d%02d",t.hour(),t.minute()); 297 skeyt.sprintf("%02d%02d",t.hour(),t.minute());
282 298
283 } 299 }
284 setSortKey(5,skeyd); 300 setSortKey(5,skeyd);
285 setSortKey(6,skeyt); 301 setSortKey(6,skeyt);
286 } 302 }
287 if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt); 303 if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt);
288 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 304 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
289 305
290 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 306 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
291 if (mTodo->percentComplete()<100) { 307 if (mTodo->percentComplete()<100) {
292 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 308 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
293 else setSortKey(2,QString::number(mTodo->percentComplete())); 309 else setSortKey(2,QString::number(mTodo->percentComplete()));
294 } 310 }
295 else { 311 else {
296 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 312 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
297 else setSortKey(2,QString::number(99)); 313 else setSortKey(2,QString::number(99));
298 } 314 }
299 if ( state ) { 315 if ( state ) {
300 QListViewItem * myChild = firstChild(); 316 QListViewItem * myChild = firstChild();
301 KOTodoViewItem *item; 317 KOTodoViewItem *item;
302 while( myChild ) { 318 while( myChild ) {
303 //qDebug("stateCH "); 319 //qDebug("stateCH ");
304 item = static_cast<KOTodoViewItem*>(myChild); 320 item = static_cast<KOTodoViewItem*>(myChild);
305 item->stateChange(state); 321 item->stateChange(state);
306 myChild = myChild->nextSibling(); 322 myChild = myChild->nextSibling();
307 } 323 }
308 } else { 324 } else {
309 QListViewItem * myChild = parent(); 325 QListViewItem * myChild = parent();
310 if ( myChild ) 326 if ( myChild )
311 (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); 327 (static_cast<KOTodoViewItem*>(myChild))->stateChange(state);
312 } 328 }
313 mTodoView->modified(true); 329 mTodoView->modified(true);
314 setMyPixmap(); 330 setMyPixmap();
315 mTodoView->setTodoModified( mTodo ); 331 mTodoView->setTodoModified( mTodo );
316} 332}
317 333
318bool KOTodoViewItem::isAlternate() 334bool KOTodoViewItem::isAlternate()
319{ 335{
320 336#if 0
337 //if ( m_known ) return m_odd;
338 //qDebug("test ");
339 KOTodoViewItem *item = static_cast<KOTodoViewItem *>(itemAbove());
340 if ( item ) {
341 m_known = item->m_known;
342 if ( m_known ) {
343 m_odd = !item->m_odd ;
344 return m_odd;
345 }
346 } else {
347 item = static_cast<KOTodoViewItem *>(itemBelow());
348 if ( item ) {
349 m_known = item->m_known;
350 if ( m_known ) {
351 m_odd = !item->m_odd ;
352 return m_odd;
353 }
354 }
355 }
321 KOTodoListView *lv = static_cast<KOTodoListView *>(listView()); 356 KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
322 if (lv && lv->alternateBackground().isValid()) 357 item = static_cast<KOTodoViewItem *>(lv->firstChild());
358 bool previous = true;
359 qDebug("WHILE ");
360 while ( item ) {
361 item->m_odd = !previous;
362 item->m_known = true;
363 previous = !previous;
364 item = static_cast<KOTodoViewItem *>(item->itemBelow());
365 }
366 return m_odd;
367
368#else
369
370 //KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
371 //if (lv && lv->alternateBackground().isValid())
323 { 372 {
324 KOTodoViewItem *above = 0; 373 KOTodoViewItem *above = static_cast<KOTodoViewItem *>(itemAbove());
325 above = static_cast<KOTodoViewItem *>(itemAbove());
326 m_known = above ? above->m_known : true; 374 m_known = above ? above->m_known : true;
327 if (m_known) 375 if (m_known)
328 { 376 {
329 m_odd = above ? !above->m_odd : false; 377 m_odd = above ? !above->m_odd : false;
330 } 378 }
331 else 379 else
332 { 380 {
333 KOTodoViewItem *item; 381 KOTodoViewItem *item;
334 bool previous = true; 382 bool previous = true;
335 if (QListViewItem::parent()) 383 if (QListViewItem::parent())
336 { 384 {
337 item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); 385 item = static_cast<KOTodoViewItem *>(QListViewItem::parent());
338 if (item) 386 if (item)
339 previous = item->m_odd; 387 previous = item->m_odd;
340 item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); 388 item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild());
341 } 389 }
342 else 390 else
343 { 391 {
392 KOTodoListView *lv = static_cast<KOTodoListView *>(listView());
344 item = static_cast<KOTodoViewItem *>(lv->firstChild()); 393 item = static_cast<KOTodoViewItem *>(lv->firstChild());
345 } 394 }
346 395
347 while(item) 396 while(item)
348 { 397 {
349 item->m_odd = previous = !previous; 398 item->m_odd = previous = !previous;
350 item->m_known = true; 399 item->m_known = true;
351 item = static_cast<KOTodoViewItem *>(item->nextSibling()); 400 item = static_cast<KOTodoViewItem *>(item->nextSibling());
352 } 401 }
353 } 402 }
354 return m_odd; 403 return m_odd;
355 } 404 }
356 return false; 405 return false;
406#endif
357} 407}
358 408
359void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) 409void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment)
360{ 410{
361 QColorGroup _cg = cg; 411 QColorGroup _cg = cg;
362 QColorGroup::ColorRole role; 412 QColorGroup::ColorRole role;
363 if ( KOPrefs::instance()->mTodoViewUsesForegroundColor && !mTodo->isRunning()) 413 if ( KOPrefs::instance()->mTodoViewUsesForegroundColor && !mTodo->isRunning())
364 role = QColorGroup::Text; 414 role = QColorGroup::Text;
365 else 415 else
366 role = QColorGroup::Base; 416 role = QColorGroup::Base;
367 //#ifndef KORG_NOLVALTERNATION 417 //#ifndef KORG_NOLVALTERNATION
368 if (isAlternate()) 418 if (isAlternate())
369 _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); 419 _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground());
370 bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; 420 bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors;
371 QColor colorToSet; 421 QColor colorToSet;
372 if ( column == 0 && mTodo->calID() > 1 ) { 422 if ( column == 0 && mTodo->calID() > 1 ) {
373 setColor = true; 423 setColor = true;
374 colorToSet = KOPrefs::instance()->defaultColor( mTodo->calID() ); 424 colorToSet = KOPrefs::instance()->defaultColor( mTodo->calID() );
375 } else if ( setColor ) { 425 } else if ( setColor ) {
376 QStringList categories = mTodo->categories(); 426 QStringList categories = mTodo->categories();
377 QString cat = categories.first(); 427 QString cat = categories.first();
378 if ( !cat.isEmpty()) { 428 if ( !cat.isEmpty()) {
379 colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); 429 colorToSet = *(KOPrefs::instance()->categoryColor(cat) );
380 } else 430 } else
381 setColor = false; 431 setColor = false;
382 } 432 }
383 bool openMode = !isOpen(); 433 bool openMode = !isOpen();
384 // maybe we are in flat-display-mode 434 // maybe we are in flat-display-mode
385 if ( !firstChild() ) 435 if ( !firstChild() )
386 openMode = false; 436 openMode = false;
387 bool colorRunning = mTodo->isRunning(); 437 bool colorRunning = mTodo->isRunning();
388 if ( ! colorRunning && openMode ) 438 if ( ! colorRunning && openMode )
389 colorRunning = mTodo->hasRunningSub(); 439 colorRunning = mTodo->hasRunningSub();
390 if ( colorRunning ) { 440 if ( colorRunning ) {
391 setColor = true; 441 setColor = true;
392 colorToSet = KOPrefs::instance()->mTodoRunColor; 442 colorToSet = KOPrefs::instance()->mTodoRunColor;
393 } else { 443 } else {
394 int odue = mTodo->hasDueSubTodo( openMode ); 444 int odue = mTodo->hasDueSubTodo( openMode );
395 if (odue == 2) { 445 if (odue == 2) {
396 colorToSet = KOPrefs::instance()->mTodoOverdueColor; 446 colorToSet = KOPrefs::instance()->mTodoOverdueColor;
397 setColor = true; 447 setColor = true;
398 } else if ( odue == 1 ) { 448 } else if ( odue == 1 ) {
399 colorToSet = KOPrefs::instance()->mTodoDueTodayColor; 449 colorToSet = KOPrefs::instance()->mTodoDueTodayColor;
400 setColor = true; 450 setColor = true;
401 } 451 }
402 } 452 }
403 453
404 454
405 if ( setColor ) { 455 if ( setColor ) {
406 _cg.setColor(role,colorToSet ); 456 _cg.setColor(role,colorToSet );
407 if ( role == QColorGroup::Base) { 457 if ( role == QColorGroup::Base) {
408 int rgb = colorToSet.red(); 458 int rgb = colorToSet.red();
409 rgb += colorToSet.blue()/2; 459 rgb += colorToSet.blue()/2;
410 rgb += colorToSet.green(); 460 rgb += colorToSet.green();
411 if ( rgb < 200 ) 461 if ( rgb < 200 )
412 _cg.setColor(QColorGroup::Text,Qt::white ); 462 _cg.setColor(QColorGroup::Text,Qt::white );
413 } 463 }
414 } 464 }
415 //#endif 465 //#endif
416 if ( column > 0 ){ 466 if ( column > 0 ){
417 if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { 467 if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) {
418 p->save(); 468 p->save();
419 int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); 469 int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5);
420 470
421 p->fillRect( 0, 0, width, height(), _cg.base() ); // background 471 p->fillRect( 0, 0, width, height(), _cg.base() ); // background
422 // p->setPen(Qt::black ); //border 472 // p->setPen(Qt::black ); //border
423 // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling 473 // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling
424 QColor fc = KOPrefs::instance()->mHighlightColor; 474 QColor fc = KOPrefs::instance()->mHighlightColor;
425 if ( mTodo->percentComplete() == 100 ) 475 if ( mTodo->percentComplete() == 100 )
426 fc = darkGreen; 476 fc = darkGreen;
427 p->drawRect( 2, 2, width-4, height()-4); 477 p->drawRect( 2, 2, width-4, height()-4);
428 p->fillRect( 3, 3, progress, height()-6, 478 p->fillRect( 3, 3, progress, height()-6,
429 fc ); 479 fc );
430 p->restore(); 480 p->restore();
431 } else { 481 } else {
432 QCheckListItem::paintCell(p, _cg, column, width, alignment); 482 QCheckListItem::paintCell(p, _cg, column, width, alignment);
433 } 483 }
434 return; 484 return;
435 } 485 }
436 486
437 int align = alignment; 487 int align = alignment;
438 488
439 if ( !p ) 489 if ( !p )
440 return; 490 return;
441 491
442 p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); 492 p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) );
443 493
444 QListView *lv = listView(); 494 QListView *lv = listView();
445 if ( !lv ) 495 if ( !lv )
446 return; 496 return;
447 int marg = 2;//lv->itemMargin(); 497 int marg = 2;//lv->itemMargin();
448 int r = 0; 498 int r = 0;
449 QCheckListItem::Type myType = QCheckListItem::CheckBox; 499 QCheckListItem::Type myType = QCheckListItem::CheckBox;
450 int BoxSize = 20; 500 int BoxSize = 20;
451 int boxOffset = 2; 501 int boxOffset = 2;
452 int xOffset = 2; 502 int xOffset = 2;
453 if (qApp->desktop()->width() < 300 ) { 503 if (qApp->desktop()->width() < 300 ) {
454 BoxSize = 14; 504 BoxSize = 14;
455 boxOffset = -1; 505 boxOffset = -1;
456 xOffset = 1; 506 xOffset = 1;
457 // marg = 0; 507 // marg = 0;
458 } 508 }
459 if ( height() < BoxSize ) { 509 if ( height() < BoxSize ) {
460 boxOffset = boxOffset - ((BoxSize - height())/2) ; 510 boxOffset = boxOffset - ((BoxSize - height())/2) ;
461 // qDebug("boxOffset %d height %d", boxOffset, height() ); 511 // qDebug("boxOffset %d height %d", boxOffset, height() );
462 BoxSize = height(); 512 BoxSize = height();
463 513
464 } 514 }
465 //bool winStyle = lv->style() == WindowsStyle; 515 //bool winStyle = lv->style() == WindowsStyle;
466 516
467 int lineStart = 5; 517 int lineStart = 5;
468 if ( myType == Controller ) { 518 if ( myType == Controller ) {
469 if ( !pixmap( 0 ) ) 519 if ( !pixmap( 0 ) )
470 r += BoxSize + 4; 520 r += BoxSize + 4;
471 } else { 521 } else {
472 ASSERT( lv ); //### 522 ASSERT( lv ); //###
473 //QFontMetrics fm( lv->font() ); 523 //QFontMetrics fm( lv->font() );
474 //int d = fm.height(); 524 //int d = fm.height();
475 int x = 0; 525 int x = 0;
476 int y = (height() - BoxSize) / 2; 526 int y = (height() - BoxSize) / 2;
477 //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) ); 527 //p->setPen( QPen( _cg.text(), winStyle ? 2 : 1 ) );
478 if ( myType == CheckBox ) { 528 if ( myType == CheckBox ) {
479 if ( isEnabled() ) 529 if ( isEnabled() )
480 p->setPen( QPen( _cg.text(), 1 ) ); 530 p->setPen( QPen( _cg.text(), 1 ) );
481 else 531 else
482 p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) ); 532 p->setPen( QPen( listView()->palette().color( QPalette::Disabled, QColorGroup::Text ), 1 ) );
483 p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 ); 533 p->drawRect( x+marg, y+2, BoxSize-4, BoxSize-4 );
484 lineStart = x+marg; 534 lineStart = x+marg;
485 ///////////////////// 535 /////////////////////
486 x++; 536 x++;
487 y++; 537 y++;
488 if ( isOn() ) { 538 if ( isOn() ) {
489 QPointArray a( 7*2 ); 539 QPointArray a( 7*2 );
490 int i, xx, yy; 540 int i, xx, yy;
491 xx = x+xOffset+marg+(boxOffset/2); 541 xx = x+xOffset+marg+(boxOffset/2);
492 yy = y+5+boxOffset; 542 yy = y+5+boxOffset;
493 for ( i=0; i<3; i++ ) { 543 for ( i=0; i<3; i++ ) {
494 a.setPoint( 2*i, xx, yy ); 544 a.setPoint( 2*i, xx, yy );
495 a.setPoint( 2*i+1, xx, yy+2 ); 545 a.setPoint( 2*i+1, xx, yy+2 );
496 // qDebug(" "); 546 // qDebug(" ");
497 xx++; yy++; 547 xx++; yy++;
498 } 548 }
499 yy -= 2; 549 yy -= 2;
500 for ( i=3; i<7; i++ ) { 550 for ( i=3; i<7; i++ ) {
501 a.setPoint( 2*i, xx, yy ); 551 a.setPoint( 2*i, xx, yy );
502 a.setPoint( 2*i+1, xx, yy+2 ); 552 a.setPoint( 2*i+1, xx, yy+2 );
503 xx++; yy--; 553 xx++; yy--;
504 } 554 }
505 p->setPen( darkGreen ); 555 p->setPen( darkGreen );
506 p->drawLineSegments( a ); 556 p->drawLineSegments( a );
507 } 557 }
508 //////////////////////// 558 ////////////////////////
509 } 559 }
510 r += BoxSize + 4; 560 r += BoxSize + 4;
511 } 561 }
512 562
513 p->translate( r, 0 ); 563 p->translate( r, 0 );
514 p->setPen( QPen( _cg.text() ) ); 564 p->setPen( QPen( _cg.text() ) );
515 QListViewItem::paintCell( p, _cg, column, width - r, align ); 565 QListViewItem::paintCell( p, _cg, column, width - r, align );
516 if ( mTodo->cancelled () ) { 566 if ( mTodo->cancelled () ) {
517 p->setPen( black ); 567 p->setPen( black );
518 QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); 568 QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() );
519 int wid = br.width() +lineStart; 569 int wid = br.width() +lineStart;
520 if ( wid > width-3 ) 570 if ( wid > width-3 )
521 wid = width-3; 571 wid = width-3;
522 p->drawLine( lineStart, height()/2+1, wid, height()/2+1 ); 572 p->drawLine( lineStart, height()/2+1, wid, height()/2+1 );
523 573
524 } 574 }
525 575
526} 576}
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index 11f7ecc..e4bcc5e 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -1,760 +1,780 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <kglobal.h> 21#include <kglobal.h>
22#include <klocale.h> 22#include <klocale.h>
23#include <kdebug.h> 23#include <kdebug.h>
24 24
25#include "calformat.h" 25#include "calformat.h"
26 26
27#include "incidence.h" 27#include "incidence.h"
28#include "todo.h" 28#include "todo.h"
29 29
30using namespace KCal; 30using namespace KCal;
31 31
32Incidence::Incidence() : 32Incidence::Incidence() :
33 IncidenceBase(), 33 IncidenceBase(),
34 mRelatedTo(0), mSecrecy(SecrecyPublic), mPriority(3) 34 mRelatedTo(0), mSecrecy(SecrecyPublic), mPriority(3)
35{ 35{
36 mRecurrence = new Recurrence(this); 36 mRecurrence = new Recurrence(this);
37 mCancelled = false; 37 mCancelled = false;
38 recreate(); 38 recreate();
39 mHasStartDate = true; 39 mHasStartDate = true;
40 mAlarms.setAutoDelete(true); 40 mAlarms.setAutoDelete(true);
41 mAttachments.setAutoDelete(true); 41 mAttachments.setAutoDelete(true);
42 mHasRecurrenceID = false; 42 mHasRecurrenceID = false;
43 mHoliday = false; 43 mHoliday = false;
44 mBirthday = false; 44 mBirthday = false;
45 mAnniversary = false; 45 mAnniversary = false;
46 46
47} 47}
48 48
49Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) 49Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
50{ 50{
51// TODO: reenable attributes currently commented out. 51// TODO: reenable attributes currently commented out.
52 mRevision = i.mRevision; 52 mRevision = i.mRevision;
53 mCreated = i.mCreated; 53 mCreated = i.mCreated;
54 mDescription = i.mDescription; 54 mDescription = i.mDescription;
55 mSummary = i.mSummary; 55 mSummary = i.mSummary;
56 mCategories = i.mCategories; 56 mCategories = i.mCategories;
57// Incidence *mRelatedTo; Incidence *mRelatedTo; 57// Incidence *mRelatedTo; Incidence *mRelatedTo;
58 mRelatedTo = 0; 58 mRelatedTo = 0;
59 mRelatedToUid = i.mRelatedToUid; 59 mRelatedToUid = i.mRelatedToUid;
60// QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations; 60// QPtrList<Incidence> mRelations; QPtrList<Incidence> mRelations;
61 mExDates = i.mExDates; 61 mExDates = i.mExDates;
62 mAttachments = i.mAttachments; 62 mAttachments = i.mAttachments;
63 mResources = i.mResources; 63 mResources = i.mResources;
64 mSecrecy = i.mSecrecy; 64 mSecrecy = i.mSecrecy;
65 mPriority = i.mPriority; 65 mPriority = i.mPriority;
66 mLocation = i.mLocation; 66 mLocation = i.mLocation;
67 mCancelled = i.mCancelled; 67 mCancelled = i.mCancelled;
68 mHasStartDate = i.mHasStartDate; 68 mHasStartDate = i.mHasStartDate;
69 QPtrListIterator<Alarm> it( i.mAlarms ); 69 QPtrListIterator<Alarm> it( i.mAlarms );
70 const Alarm *a; 70 const Alarm *a;
71 while( (a = it.current()) ) { 71 while( (a = it.current()) ) {
72 Alarm *b = new Alarm( *a ); 72 Alarm *b = new Alarm( *a );
73 b->setParent( this ); 73 b->setParent( this );
74 mAlarms.append( b ); 74 mAlarms.append( b );
75 75
76 ++it; 76 ++it;
77 } 77 }
78 mAlarms.setAutoDelete(true); 78 mAlarms.setAutoDelete(true);
79 mHasRecurrenceID = i.mHasRecurrenceID; 79 mHasRecurrenceID = i.mHasRecurrenceID;
80 mRecurrenceID = i.mRecurrenceID; 80 mRecurrenceID = i.mRecurrenceID;
81 mRecurrence = new Recurrence( *(i.mRecurrence), this ); 81 mRecurrence = new Recurrence( *(i.mRecurrence), this );
82 mHoliday = i.mHoliday ; 82 mHoliday = i.mHoliday ;
83 mBirthday = i.mBirthday; 83 mBirthday = i.mBirthday;
84 mAnniversary = i.mAnniversary; 84 mAnniversary = i.mAnniversary;
85} 85}
86 86
87Incidence::~Incidence() 87Incidence::~Incidence()
88{ 88{
89 89
90 Incidence *ev; 90 Incidence *ev;
91 QPtrList<Incidence> Relations = relations(); 91 QPtrList<Incidence> Relations = relations();
92 for (ev=Relations.first();ev;ev=Relations.next()) { 92 for (ev=Relations.first();ev;ev=Relations.next()) {
93 if (ev->relatedTo() == this) ev->setRelatedTo(0); 93 if (ev->relatedTo() == this) ev->setRelatedTo(0);
94 } 94 }
95 if (relatedTo()) relatedTo()->removeRelation(this); 95 if (relatedTo()) relatedTo()->removeRelation(this);
96 delete mRecurrence; 96 delete mRecurrence;
97 97
98} 98}
99 99
100bool Incidence::isHoliday() const 100bool Incidence::isHoliday() const
101{ 101{
102 return mHoliday; 102 return mHoliday;
103} 103}
104bool Incidence::isBirthday() const 104bool Incidence::isBirthday() const
105{ 105{
106 106
107 return mBirthday ; 107 return mBirthday ;
108} 108}
109bool Incidence::isAnniversary() const 109bool Incidence::isAnniversary() const
110{ 110{
111 return mAnniversary ; 111 return mAnniversary ;
112 112
113} 113}
114 114
115bool Incidence::hasRecurrenceID() const 115bool Incidence::hasRecurrenceID() const
116{ 116{
117 return mHasRecurrenceID; 117 return mHasRecurrenceID;
118} 118}
119 119
120void Incidence::setHasRecurrenceID( bool b ) 120void Incidence::setHasRecurrenceID( bool b )
121{ 121{
122 mHasRecurrenceID = b; 122 mHasRecurrenceID = b;
123} 123}
124 124
125void Incidence::setRecurrenceID(QDateTime d) 125void Incidence::setRecurrenceID(QDateTime d)
126{ 126{
127 mRecurrenceID = d; 127 mRecurrenceID = d;
128 mHasRecurrenceID = true; 128 mHasRecurrenceID = true;
129 updated(); 129 updated();
130} 130}
131QDateTime Incidence::recurrenceID () const 131QDateTime Incidence::recurrenceID () const
132{ 132{
133 return mRecurrenceID; 133 return mRecurrenceID;
134} 134}
135 135
136bool Incidence::cancelled() const 136bool Incidence::cancelled() const
137{ 137{
138 return mCancelled; 138 return mCancelled;
139} 139}
140void Incidence::setCancelled( bool b ) 140void Incidence::setCancelled( bool b )
141{ 141{
142 mCancelled = b; 142 mCancelled = b;
143 updated(); 143 updated();
144} 144}
145bool Incidence::hasStartDate() const 145bool Incidence::hasStartDate() const
146{ 146{
147 return mHasStartDate; 147 return mHasStartDate;
148} 148}
149 149
150void Incidence::setHasStartDate(bool f) 150void Incidence::setHasStartDate(bool f)
151{ 151{
152 if (mReadOnly) return; 152 if (mReadOnly) return;
153 mHasStartDate = f; 153 mHasStartDate = f;
154 updated(); 154 updated();
155} 155}
156 156
157// A string comparison that considers that null and empty are the same 157// A string comparison that considers that null and empty are the same
158static bool stringCompare( const QString& s1, const QString& s2 ) 158static bool stringCompare( const QString& s1, const QString& s2 )
159{ 159{
160 if ( s1.isEmpty() && s2.isEmpty() ) 160 if ( s1.isEmpty() && s2.isEmpty() )
161 return true; 161 return true;
162 return s1 == s2; 162 return s1 == s2;
163} 163}
164 164
165bool KCal::operator==( const Incidence& i1, const Incidence& i2 ) 165bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
166{ 166{
167 167
168 if( i1.alarms().count() != i2.alarms().count() ) { 168 if( i1.alarms().count() != i2.alarms().count() ) {
169 return false; // no need to check further 169 return false; // no need to check further
170 } 170 }
171 if ( i1.alarms().count() > 0 ) { 171 if ( i1.alarms().count() > 0 ) {
172 if ( !( *(i1.alarms().first()) == *(i2.alarms().first())) ) 172 if ( !( *(i1.alarms().first()) == *(i2.alarms().first())) )
173 { 173 {
174 qDebug("alarm not equal "); 174 qDebug("alarm not equal ");
175 return false; 175 return false;
176 } 176 }
177 } 177 }
178#if 0 178#if 0
179 QPtrListIterator<Alarm> a1( i1.alarms() ); 179 QPtrListIterator<Alarm> a1( i1.alarms() );
180 QPtrListIterator<Alarm> a2( i2.alarms() ); 180 QPtrListIterator<Alarm> a2( i2.alarms() );
181 for( ; a1.current() && a2.current(); ++a1, ++a2 ) { 181 for( ; a1.current() && a2.current(); ++a1, ++a2 ) {
182 if( *a1.current() == *a2.current() ) { 182 if( *a1.current() == *a2.current() ) {
183 continue; 183 continue;
184 } 184 }
185 else { 185 else {
186 return false; 186 return false;
187 } 187 }
188 } 188 }
189#endif 189#endif
190 190
191 if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) { 191 if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) {
192 if ( i1.hasRecurrenceID() ) { 192 if ( i1.hasRecurrenceID() ) {
193 if ( i1.recurrenceID() != i2.recurrenceID() ) 193 if ( i1.recurrenceID() != i2.recurrenceID() )
194 return false; 194 return false;
195 } 195 }
196 196
197 } else { 197 } else {
198 return false; 198 return false;
199 } 199 }
200 200
201 if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) ) 201 if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) )
202 return false; 202 return false;
203 if ( i1.hasStartDate() == i2.hasStartDate() ) { 203 if ( i1.hasStartDate() == i2.hasStartDate() ) {
204 if ( i1.hasStartDate() ) { 204 if ( i1.hasStartDate() ) {
205 if ( i1.dtStart() != i2.dtStart() ) 205 if ( i1.dtStart() != i2.dtStart() )
206 return false; 206 return false;
207 } 207 }
208 } else { 208 } else {
209 return false; 209 return false;
210 } 210 }
211 if (!( *i1.recurrence() == *i2.recurrence()) ) { 211 if (!( *i1.recurrence() == *i2.recurrence()) ) {
212 qDebug("recurrence is NOT equal "); 212 qDebug("recurrence is NOT equal ");
213 return false; 213 return false;
214 } 214 }
215 return 215 return
216 // i1.created() == i2.created() && 216 // i1.created() == i2.created() &&
217 stringCompare( i1.description(), i2.description() ) && 217 stringCompare( i1.description(), i2.description() ) &&
218 stringCompare( i1.summary(), i2.summary() ) && 218 stringCompare( i1.summary(), i2.summary() ) &&
219 i1.categories() == i2.categories() && 219 i1.categories() == i2.categories() &&
220 // no need to compare mRelatedTo 220 // no need to compare mRelatedTo
221 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) && 221 stringCompare( i1.relatedToUid(), i2.relatedToUid() ) &&
222 // i1.relations() == i2.relations() && 222 // i1.relations() == i2.relations() &&
223 i1.exDates() == i2.exDates() && 223 i1.exDates() == i2.exDates() &&
224 i1.attachments() == i2.attachments() && 224 i1.attachments() == i2.attachments() &&
225 i1.resources() == i2.resources() && 225 i1.resources() == i2.resources() &&
226 i1.secrecy() == i2.secrecy() && 226 i1.secrecy() == i2.secrecy() &&
227 i1.priority() == i2.priority() && 227 i1.priority() == i2.priority() &&
228 i1.cancelled() == i2.cancelled() && 228 i1.cancelled() == i2.cancelled() &&
229 stringCompare( i1.location(), i2.location() ); 229 stringCompare( i1.location(), i2.location() );
230} 230}
231 231
232Incidence* Incidence::recreateCloneException( QDate d ) 232Incidence* Incidence::recreateCloneException( QDate d )
233{ 233{
234 Incidence* newInc = clone(); 234 Incidence* newInc = clone();
235 newInc->recreate(); 235 newInc->recreate();
236 if ( doesRecur() ) { 236 if ( doesRecur() ) {
237 addExDate( d ); 237 addExDate( d );
238 newInc->recurrence()->unsetRecurs(); 238 newInc->recurrence()->unsetRecurs();
239 if ( typeID() == eventID ) { 239 if ( typeID() == eventID ) {
240 int len = dtStart().secsTo( ((Event*)this)->dtEnd()); 240 int len = dtStart().secsTo( ((Event*)this)->dtEnd());
241 QTime tim = dtStart().time(); 241 QTime tim = dtStart().time();
242 newInc->setDtStart( QDateTime(d, tim) ); 242 newInc->setDtStart( QDateTime(d, tim) );
243 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 243 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
244 } else { 244 } else {
245 int len = dtStart().secsTo( ((Todo*)this)->dtDue()); 245 int len = dtStart().secsTo( ((Todo*)this)->dtDue());
246 QTime tim = ((Todo*)this)->dtDue().time(); 246 QTime tim = ((Todo*)this)->dtDue().time();
247 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) ); 247 ((Todo*)newInc)->setDtDue( QDateTime(d, tim) );
248 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) ); 248 ((Todo*)newInc)->setDtStart( ((Todo*)newInc)->dtDue().addSecs( -len ) );
249 ((Todo*)this)->setRecurDates(); 249 ((Todo*)this)->setRecurDates();
250 } 250 }
251 newInc->setExDates( DateList () ); 251 newInc->setExDates( DateList () );
252 } 252 }
253 return newInc; 253 return newInc;
254} 254}
255 255
256void Incidence::recreate() 256void Incidence::recreate()
257{ 257{
258 setCreated(QDateTime::currentDateTime()); 258 setCreated(QDateTime::currentDateTime());
259 259
260 setUid(CalFormat::createUniqueId()); 260 setUid(CalFormat::createUniqueId());
261 261
262 setRevision(0); 262 setRevision(0);
263 setIDStr( ":" ); 263 setIDStr( ":" );
264 setLastModified(QDateTime::currentDateTime()); 264 setLastModified(QDateTime::currentDateTime());
265} 265}
266void Incidence::cloneRelations( Incidence * newInc ) 266void Incidence::cloneRelations( Incidence * newInc )
267{ 267{
268 // newInc is already a clone of this incidence 268 // newInc is already a clone of this incidence
269 Incidence * inc; 269 Incidence * inc;
270 Incidence * cloneInc; 270 Incidence * cloneInc;
271 QPtrList<Incidence> Relations = relations(); 271 QPtrList<Incidence> Relations = relations();
272 for (inc=Relations.first();inc;inc=Relations.next()) { 272 for (inc=Relations.first();inc;inc=Relations.next()) {
273 cloneInc = inc->clone(); 273 cloneInc = inc->clone();
274 cloneInc->recreate(); 274 cloneInc->recreate();
275 cloneInc->setRelatedTo( newInc ); 275 cloneInc->setRelatedTo( newInc );
276 inc->cloneRelations( cloneInc ); 276 inc->cloneRelations( cloneInc );
277 } 277 }
278} 278}
279void Incidence::setReadOnly( bool readOnly ) 279void Incidence::setReadOnly( bool readOnly )
280{ 280{
281 IncidenceBase::setReadOnly( readOnly ); 281 IncidenceBase::setReadOnly( readOnly );
282 recurrence()->setRecurReadOnly( readOnly); 282 recurrence()->setRecurReadOnly( readOnly);
283} 283}
284 284void Incidence::setLastModifiedSubInvalid()
285{
286 mLastModifiedSub = QDateTime();
287 if ( mRelatedTo )
288 mRelatedTo->setLastModifiedSubInvalid();
289}
290QDateTime Incidence::lastModifiedSub()
291{
292 if ( !mRelations.count() )
293 return lastModified();
294 if ( mLastModifiedSub.isValid() )
295 return mLastModifiedSub;
296 mLastModifiedSub = lastModified();
297 Incidence * inc;
298 QPtrList<Incidence> Relations = relations();
299 for (inc=Relations.first();inc;inc=Relations.next()) {
300 if ( inc->lastModifiedSub() > mLastModifiedSub )
301 mLastModifiedSub = inc->lastModifiedSub();
302 }
303 return mLastModifiedSub;
304}
285void Incidence::setCreated(QDateTime created) 305void Incidence::setCreated(QDateTime created)
286{ 306{
287 if (mReadOnly) return; 307 if (mReadOnly) return;
288 mCreated = getEvenTime(created); 308 mCreated = getEvenTime(created);
289} 309}
290 310
291QDateTime Incidence::created() const 311QDateTime Incidence::created() const
292{ 312{
293 return mCreated; 313 return mCreated;
294} 314}
295 315
296void Incidence::setRevision(int rev) 316void Incidence::setRevision(int rev)
297{ 317{
298 if (mReadOnly) return; 318 if (mReadOnly) return;
299 mRevision = rev; 319 mRevision = rev;
300 320
301 updated(); 321 updated();
302} 322}
303 323
304int Incidence::revision() const 324int Incidence::revision() const
305{ 325{
306 return mRevision; 326 return mRevision;
307} 327}
308 328
309void Incidence::setDtStart(const QDateTime &dtStart) 329void Incidence::setDtStart(const QDateTime &dtStart)
310{ 330{
311 331
312 QDateTime dt = getEvenTime(dtStart); 332 QDateTime dt = getEvenTime(dtStart);
313 recurrence()->setRecurStart( dt); 333 recurrence()->setRecurStart( dt);
314 IncidenceBase::setDtStart( dt ); 334 IncidenceBase::setDtStart( dt );
315} 335}
316 336
317void Incidence::setDescription(const QString &description) 337void Incidence::setDescription(const QString &description)
318{ 338{
319 if (mReadOnly) return; 339 if (mReadOnly) return;
320 mDescription = description; 340 mDescription = description;
321 updated(); 341 updated();
322} 342}
323 343
324QString Incidence::description() const 344QString Incidence::description() const
325{ 345{
326 return mDescription; 346 return mDescription;
327} 347}
328 348
329 349
330void Incidence::setSummary(const QString &summary) 350void Incidence::setSummary(const QString &summary)
331{ 351{
332 if (mReadOnly) return; 352 if (mReadOnly) return;
333 mSummary = summary; 353 mSummary = summary;
334 updated(); 354 updated();
335} 355}
336 356
337QString Incidence::summary() const 357QString Incidence::summary() const
338{ 358{
339 return mSummary; 359 return mSummary;
340} 360}
341void Incidence::checkCategories() 361void Incidence::checkCategories()
342{ 362{
343 mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday")); 363 mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday"));
344 mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday")); 364 mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday"));
345 mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary")); 365 mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary"));
346} 366}
347 367
348void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false 368void Incidence::addCategories(const QStringList &categories, bool addToRelations ) //addToRelations = false
349{ 369{
350 if (mReadOnly) return; 370 if (mReadOnly) return;
351 int i; 371 int i;
352 for( i = 0; i < categories.count(); ++i ) { 372 for( i = 0; i < categories.count(); ++i ) {
353 if ( !mCategories.contains (categories[i])) 373 if ( !mCategories.contains (categories[i]))
354 mCategories.append( categories[i] ); 374 mCategories.append( categories[i] );
355 } 375 }
356 checkCategories(); 376 checkCategories();
357 updated(); 377 updated();
358 if ( addToRelations ) { 378 if ( addToRelations ) {
359 Incidence * inc; 379 Incidence * inc;
360 QPtrList<Incidence> Relations = relations(); 380 QPtrList<Incidence> Relations = relations();
361 for (inc=Relations.first();inc;inc=Relations.next()) { 381 for (inc=Relations.first();inc;inc=Relations.next()) {
362 inc->addCategories( categories, true ); 382 inc->addCategories( categories, true );
363 } 383 }
364 } 384 }
365} 385}
366 386
367void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false 387void Incidence::setCategories(const QStringList &categories, bool setForRelations ) //setForRelations = false
368{ 388{
369 if (mReadOnly) return; 389 if (mReadOnly) return;
370 mCategories = categories; 390 mCategories = categories;
371 checkCategories(); 391 checkCategories();
372 updated(); 392 updated();
373 if ( setForRelations ) { 393 if ( setForRelations ) {
374 Incidence * inc; 394 Incidence * inc;
375 QPtrList<Incidence> Relations = relations(); 395 QPtrList<Incidence> Relations = relations();
376 for (inc=Relations.first();inc;inc=Relations.next()) { 396 for (inc=Relations.first();inc;inc=Relations.next()) {
377 inc->setCategories( categories, true ); 397 inc->setCategories( categories, true );
378 } 398 }
379 } 399 }
380} 400}
381 401
382// TODO: remove setCategories(QString) function 402// TODO: remove setCategories(QString) function
383void Incidence::setCategories(const QString &catStr) 403void Incidence::setCategories(const QString &catStr)
384{ 404{
385 if (mReadOnly) return; 405 if (mReadOnly) return;
386 mCategories.clear(); 406 mCategories.clear();
387 407
388 if (catStr.isEmpty()) return; 408 if (catStr.isEmpty()) return;
389 409
390 mCategories = QStringList::split(",",catStr); 410 mCategories = QStringList::split(",",catStr);
391 411
392 QStringList::Iterator it; 412 QStringList::Iterator it;
393 for(it = mCategories.begin();it != mCategories.end(); ++it) { 413 for(it = mCategories.begin();it != mCategories.end(); ++it) {
394 *it = (*it).stripWhiteSpace(); 414 *it = (*it).stripWhiteSpace();
395 } 415 }
396 checkCategories(); 416 checkCategories();
397 updated(); 417 updated();
398} 418}
399// using this makes filtering 3 times faster 419// using this makes filtering 3 times faster
400QStringList* Incidence::categoriesP() 420QStringList* Incidence::categoriesP()
401{ 421{
402 return &mCategories; 422 return &mCategories;
403} 423}
404 424
405QStringList Incidence::categories() const 425QStringList Incidence::categories() const
406{ 426{
407 return mCategories; 427 return mCategories;
408} 428}
409 429
410QString Incidence::categoriesStr() 430QString Incidence::categoriesStr()
411{ 431{
412 return mCategories.join(","); 432 return mCategories.join(",");
413} 433}
414QString Incidence::categoriesStrWithSpace() 434QString Incidence::categoriesStrWithSpace()
415{ 435{
416 return mCategories.join(", "); 436 return mCategories.join(", ");
417} 437}
418 438
419void Incidence::setRelatedToUid(const QString &relatedToUid) 439void Incidence::setRelatedToUid(const QString &relatedToUid)
420{ 440{
421 if (mReadOnly) return; 441 if (mReadOnly) return;
422 mRelatedToUid = relatedToUid; 442 mRelatedToUid = relatedToUid;
423} 443}
424 444
425QString Incidence::relatedToUid() const 445QString Incidence::relatedToUid() const
426{ 446{
427 return mRelatedToUid; 447 return mRelatedToUid;
428} 448}
429 449
430void Incidence::setRelatedTo(Incidence *relatedTo) 450void Incidence::setRelatedTo(Incidence *relatedTo)
431{ 451{
432 //qDebug("Incidence::setRelatedTo %d ", relatedTo); 452 //qDebug("Incidence::setRelatedTo %d ", relatedTo);
433 //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() ); 453 //qDebug("setRelatedTo(Incidence *relatedTo) %s %s", summary().latin1(), relatedTo->summary().latin1() );
434 if (mReadOnly || mRelatedTo == relatedTo) return; 454 if (mReadOnly || mRelatedTo == relatedTo) return;
435 if(mRelatedTo) { 455 if(mRelatedTo) {
436 // updated(); 456 // updated();
437 mRelatedTo->removeRelation(this); 457 mRelatedTo->removeRelation(this);
438 } 458 }
439 mRelatedTo = relatedTo; 459 mRelatedTo = relatedTo;
440 if (mRelatedTo) { 460 if (mRelatedTo) {
441 mRelatedTo->addRelation(this); 461 mRelatedTo->addRelation(this);
442 mRelatedToUid = mRelatedTo->uid(); 462 mRelatedToUid = mRelatedTo->uid();
443 } else { 463 } else {
444 mRelatedToUid = ""; 464 mRelatedToUid = "";
445 } 465 }
446} 466}
447 467
448Incidence *Incidence::relatedTo() const 468Incidence *Incidence::relatedTo() const
449{ 469{
450 return mRelatedTo; 470 return mRelatedTo;
451} 471}
452 472
453QPtrList<Incidence> Incidence::relations() const 473QPtrList<Incidence> Incidence::relations() const
454{ 474{
455 return mRelations; 475 return mRelations;
456} 476}
457 477
458void Incidence::addRelationsToList(QPtrList<Incidence> *rel) 478void Incidence::addRelationsToList(QPtrList<Incidence> *rel)
459{ 479{
460 Incidence* inc; 480 Incidence* inc;
461 QPtrList<Incidence> Relations = relations(); 481 QPtrList<Incidence> Relations = relations();
462 for (inc=Relations.first();inc;inc=Relations.next()) { 482 for (inc=Relations.first();inc;inc=Relations.next()) {
463 inc->addRelationsToList( rel ); 483 inc->addRelationsToList( rel );
464 } 484 }
465 if ( rel->findRef( this ) == -1 ) 485 if ( rel->findRef( this ) == -1 )
466 rel->append( this ); 486 rel->append( this );
467} 487}
468 488
469void Incidence::addRelation(Incidence *event) 489void Incidence::addRelation(Incidence *event)
470{ 490{
491 setLastModifiedSubInvalid();
471 if( mRelations.findRef( event ) == -1 ) { 492 if( mRelations.findRef( event ) == -1 ) {
472 mRelations.append(event); 493 mRelations.append(event);
473 //updated(); 494 //updated();
474 } 495 }
475} 496}
476 497
477void Incidence::removeRelation(Incidence *event) 498void Incidence::removeRelation(Incidence *event)
478{ 499{
479 500 setLastModifiedSubInvalid();
480 mRelations.removeRef(event); 501 mRelations.removeRef(event);
481
482// if (event->getRelatedTo() == this) event->setRelatedTo(0); 502// if (event->getRelatedTo() == this) event->setRelatedTo(0);
483} 503}
484 504
485bool Incidence::recursOn(const QDate &qd) const 505bool Incidence::recursOn(const QDate &qd) const
486{ 506{
487 if (recurrence()->recursOnPure(qd) && !isException(qd)) return true; 507 if (recurrence()->recursOnPure(qd) && !isException(qd)) return true;
488 else return false; 508 else return false;
489} 509}
490 510
491void Incidence::setExDates(const DateList &exDates) 511void Incidence::setExDates(const DateList &exDates)
492{ 512{
493 if (mReadOnly) return; 513 if (mReadOnly) return;
494 mExDates = exDates; 514 mExDates = exDates;
495 515
496 recurrence()->setRecurExDatesCount(mExDates.count()); 516 recurrence()->setRecurExDatesCount(mExDates.count());
497 517
498 updated(); 518 updated();
499} 519}
500 520
501void Incidence::addExDate(const QDate &date) 521void Incidence::addExDate(const QDate &date)
502{ 522{
503 if (mReadOnly) return; 523 if (mReadOnly) return;
504 mExDates.append(date); 524 mExDates.append(date);
505 525
506 recurrence()->setRecurExDatesCount(mExDates.count()); 526 recurrence()->setRecurExDatesCount(mExDates.count());
507 527
508 updated(); 528 updated();
509} 529}
510 530
511DateList Incidence::exDates() const 531DateList Incidence::exDates() const
512{ 532{
513 return mExDates; 533 return mExDates;
514} 534}
515 535
516bool Incidence::isException(const QDate &date) const 536bool Incidence::isException(const QDate &date) const
517{ 537{
518 DateList::ConstIterator it; 538 DateList::ConstIterator it;
519 for( it = mExDates.begin(); it != mExDates.end(); ++it ) { 539 for( it = mExDates.begin(); it != mExDates.end(); ++it ) {
520 if ( (*it) == date ) { 540 if ( (*it) == date ) {
521 return true; 541 return true;
522 } 542 }
523 } 543 }
524 544
525 return false; 545 return false;
526} 546}
527 547
528void Incidence::addAttachment(Attachment *attachment) 548void Incidence::addAttachment(Attachment *attachment)
529{ 549{
530 if (mReadOnly || !attachment) return; 550 if (mReadOnly || !attachment) return;
531 mAttachments.append(attachment); 551 mAttachments.append(attachment);
532 updated(); 552 updated();
533} 553}
534 554
535void Incidence::deleteAttachment(Attachment *attachment) 555void Incidence::deleteAttachment(Attachment *attachment)
536{ 556{
537 mAttachments.removeRef(attachment); 557 mAttachments.removeRef(attachment);
538} 558}
539 559
540void Incidence::deleteAttachments(const QString& mime) 560void Incidence::deleteAttachments(const QString& mime)
541{ 561{
542 Attachment *at = mAttachments.first(); 562 Attachment *at = mAttachments.first();
543 while (at) { 563 while (at) {
544 if (at->mimeType() == mime) 564 if (at->mimeType() == mime)
545 mAttachments.remove(); 565 mAttachments.remove();
546 else 566 else
547 at = mAttachments.next(); 567 at = mAttachments.next();
548 } 568 }
549} 569}
550 570
551QPtrList<Attachment> Incidence::attachments() const 571QPtrList<Attachment> Incidence::attachments() const
552{ 572{
553 return mAttachments; 573 return mAttachments;
554} 574}
555 575
556QPtrList<Attachment> Incidence::attachments(const QString& mime) const 576QPtrList<Attachment> Incidence::attachments(const QString& mime) const
557{ 577{
558 QPtrList<Attachment> attachments; 578 QPtrList<Attachment> attachments;
559 QPtrListIterator<Attachment> it( mAttachments ); 579 QPtrListIterator<Attachment> it( mAttachments );
560 Attachment *at; 580 Attachment *at;
561 while ( (at = it.current()) ) { 581 while ( (at = it.current()) ) {
562 if (at->mimeType() == mime) 582 if (at->mimeType() == mime)
563 attachments.append(at); 583 attachments.append(at);
564 ++it; 584 ++it;
565 } 585 }
566 586
567 return attachments; 587 return attachments;
568} 588}
569 589
570void Incidence::setResources(const QStringList &resources) 590void Incidence::setResources(const QStringList &resources)
571{ 591{
572 if (mReadOnly) return; 592 if (mReadOnly) return;
573 mResources = resources; 593 mResources = resources;
574 updated(); 594 updated();
575} 595}
576 596
577QStringList Incidence::resources() const 597QStringList Incidence::resources() const
578{ 598{
579 return mResources; 599 return mResources;
580} 600}
581 601
582 602
583void Incidence::setPriority(int priority) 603void Incidence::setPriority(int priority)
584{ 604{
585 if (mReadOnly) return; 605 if (mReadOnly) return;
586 mPriority = priority; 606 mPriority = priority;
587 updated(); 607 updated();
588} 608}
589 609
590int Incidence::priority() const 610int Incidence::priority() const
591{ 611{
592 return mPriority; 612 return mPriority;
593} 613}
594 614
595void Incidence::setSecrecy(int sec) 615void Incidence::setSecrecy(int sec)
596{ 616{
597 if (mReadOnly) return; 617 if (mReadOnly) return;
598 mSecrecy = sec; 618 mSecrecy = sec;
599 updated(); 619 updated();
600} 620}
601 621
602int Incidence::secrecy() const 622int Incidence::secrecy() const
603{ 623{
604 return mSecrecy; 624 return mSecrecy;
605} 625}
606 626
607QString Incidence::secrecyStr() const 627QString Incidence::secrecyStr() const
608{ 628{
609 return secrecyName(mSecrecy); 629 return secrecyName(mSecrecy);
610} 630}
611 631
612QString Incidence::secrecyName(int secrecy) 632QString Incidence::secrecyName(int secrecy)
613{ 633{
614 switch (secrecy) { 634 switch (secrecy) {
615 case SecrecyPublic: 635 case SecrecyPublic:
616 return i18n("Public"); 636 return i18n("Public");
617 break; 637 break;
618 case SecrecyPrivate: 638 case SecrecyPrivate:
619 return i18n("Private"); 639 return i18n("Private");
620 break; 640 break;
621 case SecrecyConfidential: 641 case SecrecyConfidential:
622 return i18n("Confidential"); 642 return i18n("Confidential");
623 break; 643 break;
624 default: 644 default:
625 return i18n("Undefined"); 645 return i18n("Undefined");
626 break; 646 break;
627 } 647 }
628} 648}
629 649
630QStringList Incidence::secrecyList() 650QStringList Incidence::secrecyList()
631{ 651{
632 QStringList list; 652 QStringList list;
633 list << secrecyName(SecrecyPublic); 653 list << secrecyName(SecrecyPublic);
634 list << secrecyName(SecrecyPrivate); 654 list << secrecyName(SecrecyPrivate);
635 list << secrecyName(SecrecyConfidential); 655 list << secrecyName(SecrecyConfidential);
636 656
637 return list; 657 return list;
638} 658}
639 659
640 660
641QPtrList<Alarm> Incidence::alarms() const 661QPtrList<Alarm> Incidence::alarms() const
642{ 662{
643 return mAlarms; 663 return mAlarms;
644} 664}
645 665
646Alarm* Incidence::newAlarm() 666Alarm* Incidence::newAlarm()
647{ 667{
648 Alarm* alarm = new Alarm(this); 668 Alarm* alarm = new Alarm(this);
649 mAlarms.append(alarm); 669 mAlarms.append(alarm);
650// updated(); 670// updated();
651 return alarm; 671 return alarm;
652} 672}
653 673
654void Incidence::addAlarm(Alarm *alarm) 674void Incidence::addAlarm(Alarm *alarm)
655{ 675{
656 mAlarms.append(alarm); 676 mAlarms.append(alarm);
657 updated(); 677 updated();
658} 678}
659 679
660void Incidence::removeAlarm(Alarm *alarm) 680void Incidence::removeAlarm(Alarm *alarm)
661{ 681{
662 mAlarms.removeRef(alarm); 682 mAlarms.removeRef(alarm);
663 updated(); 683 updated();
664} 684}
665 685
666void Incidence::clearAlarms() 686void Incidence::clearAlarms()
667{ 687{
668 mAlarms.clear(); 688 mAlarms.clear();
669 updated(); 689 updated();
670} 690}
671 691
672bool Incidence::isAlarmEnabled() const 692bool Incidence::isAlarmEnabled() const
673{ 693{
674 Alarm* alarm; 694 Alarm* alarm;
675 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { 695 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
676 if (alarm->enabled()) 696 if (alarm->enabled())
677 return true; 697 return true;
678 } 698 }
679 return false; 699 return false;
680} 700}
681 701
682Recurrence *Incidence::recurrence() const 702Recurrence *Incidence::recurrence() const
683{ 703{
684 return mRecurrence; 704 return mRecurrence;
685} 705}
686void Incidence::setRecurrence( Recurrence * r) 706void Incidence::setRecurrence( Recurrence * r)
687{ 707{
688 delete mRecurrence; 708 delete mRecurrence;
689 mRecurrence = r; 709 mRecurrence = r;
690} 710}
691 711
692void Incidence::setLocation(const QString &location) 712void Incidence::setLocation(const QString &location)
693{ 713{
694 if (mReadOnly) return; 714 if (mReadOnly) return;
695 mLocation = location; 715 mLocation = location;
696 updated(); 716 updated();
697} 717}
698 718
699QString Incidence::location() const 719QString Incidence::location() const
700{ 720{
701 return mLocation; 721 return mLocation;
702} 722}
703 723
704ushort Incidence::doesRecur() const 724ushort Incidence::doesRecur() const
705{ 725{
706 if ( mRecurrence ) return mRecurrence->doesRecur(); 726 if ( mRecurrence ) return mRecurrence->doesRecur();
707 else return Recurrence::rNone; 727 else return Recurrence::rNone;
708} 728}
709 729
710QDateTime Incidence::getNextOccurence( const QDateTime& dt, bool* ok ) const 730QDateTime Incidence::getNextOccurence( const QDateTime& dt, bool* ok ) const
711{ 731{
712 QDateTime incidenceStart = dt; 732 QDateTime incidenceStart = dt;
713 *ok = false; 733 *ok = false;
714 if ( doesRecur() ) { 734 if ( doesRecur() ) {
715 bool last; 735 bool last;
716 recurrence()->getPreviousDateTime( incidenceStart , &last ); 736 recurrence()->getPreviousDateTime( incidenceStart , &last );
717 int count = 0; 737 int count = 0;
718 if ( !last ) { 738 if ( !last ) {
719 while ( !last ) { 739 while ( !last ) {
720 ++count; 740 ++count;
721 incidenceStart = recurrence()->getNextDateTime( incidenceStart, &last ); 741 incidenceStart = recurrence()->getNextDateTime( incidenceStart, &last );
722 if ( recursOn( incidenceStart.date() ) ) { 742 if ( recursOn( incidenceStart.date() ) ) {
723 last = true; // exit while llop 743 last = true; // exit while llop
724 } else { 744 } else {
725 if ( last ) { // no alarm on last recurrence 745 if ( last ) { // no alarm on last recurrence
726 return QDateTime (); 746 return QDateTime ();
727 } 747 }
728 int year = incidenceStart.date().year(); 748 int year = incidenceStart.date().year();
729 // workaround for bug in recurrence 749 // workaround for bug in recurrence
730 if ( count == 100 || year < 1000 || year > 5000 ) { 750 if ( count == 100 || year < 1000 || year > 5000 ) {
731 return QDateTime (); 751 return QDateTime ();
732 } 752 }
733 incidenceStart = incidenceStart.addSecs( 1 ); 753 incidenceStart = incidenceStart.addSecs( 1 );
734 } 754 }
735 } 755 }
736 } else { 756 } else {
737 return QDateTime (); 757 return QDateTime ();
738 } 758 }
739 } else { 759 } else {
740 if ( hasStartDate () ) { 760 if ( hasStartDate () ) {
741 incidenceStart = dtStart(); 761 incidenceStart = dtStart();
742 } 762 }
743 if ( typeID() == todoID ) { 763 if ( typeID() == todoID ) {
744 if ( ((Todo*)this)->hasDueDate() ) 764 if ( ((Todo*)this)->hasDueDate() )
745 incidenceStart = ((Todo*)this)->dtDue(); 765 incidenceStart = ((Todo*)this)->dtDue();
746 } 766 }
747 } 767 }
748 if ( incidenceStart > dt ) 768 if ( incidenceStart > dt )
749 *ok = true; 769 *ok = true;
750 return incidenceStart; 770 return incidenceStart;
751} 771}
752QDateTime Incidence::dtStart() const 772QDateTime Incidence::dtStart() const
753{ 773{
754 if ( doesRecur() ) { 774 if ( doesRecur() ) {
755 if ( typeID() == todoID ) { 775 if ( typeID() == todoID ) {
756 ((Todo*)this)->checkSetCompletedFalse(); 776 ((Todo*)this)->checkSetCompletedFalse();
757 } 777 }
758 } 778 }
759 return mDtStart; 779 return mDtStart;
760} 780}
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index c88ba2f..d4af9f0 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -1,318 +1,321 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef INCIDENCE_H 20#ifndef INCIDENCE_H
21#define INCIDENCE_H 21#define INCIDENCE_H
22// 22//
23// Incidence - base class of calendaring components 23// Incidence - base class of calendaring components
24// 24//
25 25
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qvaluelist.h> 28#include <qvaluelist.h>
29 29
30#include "recurrence.h" 30#include "recurrence.h"
31#include "alarm.h" 31#include "alarm.h"
32#include "attachment.h" 32#include "attachment.h"
33#include "listbase.h" 33#include "listbase.h"
34#include "incidencebase.h" 34#include "incidencebase.h"
35 35
36namespace KCal { 36namespace KCal {
37 37
38class Event; 38class Event;
39class Todo; 39class Todo;
40class Journal; 40class Journal;
41 41
42/** 42/**
43 This class provides the base class common to all calendar components. 43 This class provides the base class common to all calendar components.
44*/ 44*/
45class Incidence : public IncidenceBase 45class Incidence : public IncidenceBase
46{ 46{
47 public: 47 public:
48 /** 48 /**
49 This class provides the interface for a visitor of calendar components. It 49 This class provides the interface for a visitor of calendar components. It
50 serves as base class for concrete visitors, which implement certain actions on 50 serves as base class for concrete visitors, which implement certain actions on
51 calendar components. It allows to add functions, which operate on the concrete 51 calendar components. It allows to add functions, which operate on the concrete
52 types of calendar components, without changing the calendar component classes. 52 types of calendar components, without changing the calendar component classes.
53 */ 53 */
54 class Visitor 54 class Visitor
55 { 55 {
56 public: 56 public:
57 /** Destruct Incidence::Visitor */ 57 /** Destruct Incidence::Visitor */
58 virtual ~Visitor() {} 58 virtual ~Visitor() {}
59 59
60 /** 60 /**
61 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 61 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
62 on an Event object. 62 on an Event object.
63 */ 63 */
64 virtual bool visit(Event *) { return false; } 64 virtual bool visit(Event *) { return false; }
65 /** 65 /**
66 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 66 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
67 on an Todo object. 67 on an Todo object.
68 */ 68 */
69 virtual bool visit(Todo *) { return false; } 69 virtual bool visit(Todo *) { return false; }
70 /** 70 /**
71 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions 71 Reimplement this function in your concrete subclass of IncidenceVisitor to perform actions
72 on an Journal object. 72 on an Journal object.
73 */ 73 */
74 virtual bool visit(Journal *) { return false; } 74 virtual bool visit(Journal *) { return false; }
75 75
76 protected: 76 protected:
77 /** Constructor is protected to prevent direct creation of visitor base class. */ 77 /** Constructor is protected to prevent direct creation of visitor base class. */
78 Visitor() {} 78 Visitor() {}
79 }; 79 };
80 80
81 /** 81 /**
82 This class implements a visitor for adding an Incidence to a resource 82 This class implements a visitor for adding an Incidence to a resource
83 supporting addEvent(), addTodo() and addJournal() calls. 83 supporting addEvent(), addTodo() and addJournal() calls.
84 */ 84 */
85 template<class T> 85 template<class T>
86 class AddVisitor : public Visitor 86 class AddVisitor : public Visitor
87 { 87 {
88 public: 88 public:
89 AddVisitor( T *r ) : mResource( r ) {} 89 AddVisitor( T *r ) : mResource( r ) {}
90 bool visit( Event *e ) { return mResource->addEvent( e ); } 90 bool visit( Event *e ) { return mResource->addEvent( e ); }
91 bool visit( Todo *t ) { return mResource->addTodo( t ); } 91 bool visit( Todo *t ) { return mResource->addTodo( t ); }
92 bool visit( Journal *j ) { return mResource->addJournal( j ); } 92 bool visit( Journal *j ) { return mResource->addJournal( j ); }
93 93
94 private: 94 private:
95 T *mResource; 95 T *mResource;
96 }; 96 };
97 97
98 /** enumeration for describing an event's secrecy. */ 98 /** enumeration for describing an event's secrecy. */
99 enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 }; 99 enum { SecrecyPublic = 0, SecrecyPrivate = 1, SecrecyConfidential = 2 };
100 typedef ListBase<Incidence> List; 100 typedef ListBase<Incidence> List;
101 Incidence(); 101 Incidence();
102 Incidence(const Incidence &); 102 Incidence(const Incidence &);
103 ~Incidence(); 103 ~Incidence();
104 104
105 /** 105 /**
106 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to 106 Accept IncidenceVisitor. A class taking part in the visitor mechanism has to
107 provide this implementation: 107 provide this implementation:
108 <pre> 108 <pre>
109 bool accept(Visitor &v) { return v.visit(this); } 109 bool accept(Visitor &v) { return v.visit(this); }
110 </pre> 110 </pre>
111 */ 111 */
112 virtual bool accept(Visitor &) { return false; } 112 virtual bool accept(Visitor &) { return false; }
113 113
114 virtual Incidence *clone() = 0; 114 virtual Incidence *clone() = 0;
115 virtual void cloneRelations( Incidence * ); 115 virtual void cloneRelations( Incidence * );
116 void addRelationsToList(QPtrList<Incidence> *rel); 116 void addRelationsToList(QPtrList<Incidence> *rel);
117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0; 117 virtual QDateTime getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const = 0;
118 void setReadOnly( bool ); 118 void setReadOnly( bool );
119 119
120 /** 120 /**
121 Recreate event. The event is made a new unique event, but already stored 121 Recreate event. The event is made a new unique event, but already stored
122 event information is preserved. Sets uniquie id, creation date, last 122 event information is preserved. Sets uniquie id, creation date, last
123 modification date and revision number. 123 modification date and revision number.
124 */ 124 */
125 void recreate(); 125 void recreate();
126 Incidence* recreateCloneException(QDate); 126 Incidence* recreateCloneException(QDate);
127 127
128 /** set creation date */ 128 /** set creation date */
129 void setCreated(QDateTime); 129 void setCreated(QDateTime);
130 /** return time and date of creation. */ 130 /** return time and date of creation. */
131 QDateTime created() const; 131 QDateTime created() const;
132 132
133 /** set the number of revisions this event has seen */ 133 /** set the number of revisions this event has seen */
134 void setRevision(int rev); 134 void setRevision(int rev);
135 /** return the number of revisions this event has seen */ 135 /** return the number of revisions this event has seen */
136 int revision() const; 136 int revision() const;
137 137
138 /** Set starting date/time. */ 138 /** Set starting date/time. */
139 virtual void setDtStart(const QDateTime &dtStart); 139 virtual void setDtStart(const QDateTime &dtStart);
140 /** Return the incidence's ending date/time as a QDateTime. */ 140 /** Return the incidence's ending date/time as a QDateTime. */
141 virtual QDateTime dtEnd() const { return QDateTime(); } 141 virtual QDateTime dtEnd() const { return QDateTime(); }
142 142
143 /** sets the event's lengthy description. */ 143 /** sets the event's lengthy description. */
144 void setDescription(const QString &description); 144 void setDescription(const QString &description);
145 /** returns a reference to the event's description. */ 145 /** returns a reference to the event's description. */
146 QString description() const; 146 QString description() const;
147 147
148 /** sets the event's short summary. */ 148 /** sets the event's short summary. */
149 void setSummary(const QString &summary); 149 void setSummary(const QString &summary);
150 /** returns a reference to the event's summary. */ 150 /** returns a reference to the event's summary. */
151 QString summary() const; 151 QString summary() const;
152 152
153 /** set event's applicable categories */ 153 /** set event's applicable categories */
154 void setCategories(const QStringList &categories, bool setForRelations = false); 154 void setCategories(const QStringList &categories, bool setForRelations = false);
155 void addCategories(const QStringList &categories, bool addToRelations = false); 155 void addCategories(const QStringList &categories, bool addToRelations = false);
156 /** set event's categories based on a comma delimited string */ 156 /** set event's categories based on a comma delimited string */
157 void setCategories(const QString &catStr); 157 void setCategories(const QString &catStr);
158 /** return categories in a list */ 158 /** return categories in a list */
159 QStringList categories() const; 159 QStringList categories() const;
160 QStringList* categoriesP(); 160 QStringList* categoriesP();
161 /** return categories as a comma separated string */ 161 /** return categories as a comma separated string */
162 QString categoriesStr(); 162 QString categoriesStr();
163 QString categoriesStrWithSpace(); 163 QString categoriesStrWithSpace();
164 164
165 /** point at some other event to which the event relates. This function should 165 /** point at some other event to which the event relates. This function should
166 * only be used when constructing a calendar before the related Event 166 * only be used when constructing a calendar before the related Event
167 * exists. */ 167 * exists. */
168 void setRelatedToUid(const QString &); 168 void setRelatedToUid(const QString &);
169 /** what event does this one relate to? This function should 169 /** what event does this one relate to? This function should
170 * only be used when constructing a calendar before the related Event 170 * only be used when constructing a calendar before the related Event
171 * exists. */ 171 * exists. */
172 QString relatedToUid() const; 172 QString relatedToUid() const;
173 /** point at some other event to which the event relates */ 173 /** point at some other event to which the event relates */
174 void setRelatedTo(Incidence *relatedTo); 174 void setRelatedTo(Incidence *relatedTo);
175 /** what event does this one relate to? */ 175 /** what event does this one relate to? */
176 Incidence *relatedTo() const; 176 Incidence *relatedTo() const;
177 /** All events that are related to this event */ 177 /** All events that are related to this event */
178 QPtrList<Incidence> relations() const; 178 QPtrList<Incidence> relations() const;
179 /** Add an event which is related to this event */ 179 /** Add an event which is related to this event */
180 void addRelation(Incidence *); 180 void addRelation(Incidence *);
181 /** Remove event that is related to this event */ 181 /** Remove event that is related to this event */
182 void removeRelation(Incidence *); 182 void removeRelation(Incidence *);
183 183
184 /** returns the list of dates which are exceptions to the recurrence rule */ 184 /** returns the list of dates which are exceptions to the recurrence rule */
185 DateList exDates() const; 185 DateList exDates() const;
186 /** sets the list of dates which are exceptions to the recurrence rule */ 186 /** sets the list of dates which are exceptions to the recurrence rule */
187 void setExDates(const DateList &_exDates); 187 void setExDates(const DateList &_exDates);
188 void setExDates(const char *dates); 188 void setExDates(const char *dates);
189 /** Add a date to the list of exceptions of the recurrence rule. */ 189 /** Add a date to the list of exceptions of the recurrence rule. */
190 void addExDate(const QDate &date); 190 void addExDate(const QDate &date);
191 191
192 /** returns true if there is an exception for this date in the recurrence 192 /** returns true if there is an exception for this date in the recurrence
193 rule set, or false otherwise. */ 193 rule set, or false otherwise. */
194 bool isException(const QDate &qd) const; 194 bool isException(const QDate &qd) const;
195 195
196 /** add attachment to this event */ 196 /** add attachment to this event */
197 void addAttachment(Attachment *attachment); 197 void addAttachment(Attachment *attachment);
198 /** remove and delete a specific attachment */ 198 /** remove and delete a specific attachment */
199 void deleteAttachment(Attachment *attachment); 199 void deleteAttachment(Attachment *attachment);
200 /** remove and delete all attachments with this mime type */ 200 /** remove and delete all attachments with this mime type */
201 void deleteAttachments(const QString& mime); 201 void deleteAttachments(const QString& mime);
202 /** return list of all associated attachments */ 202 /** return list of all associated attachments */
203 QPtrList<Attachment> attachments() const; 203 QPtrList<Attachment> attachments() const;
204 /** find a list of attachments with this mime type */ 204 /** find a list of attachments with this mime type */
205 QPtrList<Attachment> attachments(const QString& mime) const; 205 QPtrList<Attachment> attachments(const QString& mime) const;
206 206
207 /** sets the event's status the value specified. See the enumeration 207 /** sets the event's status the value specified. See the enumeration
208 * above for possible values. */ 208 * above for possible values. */
209 void setSecrecy(int); 209 void setSecrecy(int);
210 /** return the event's secrecy. */ 210 /** return the event's secrecy. */
211 int secrecy() const; 211 int secrecy() const;
212 /** return the event's secrecy in string format. */ 212 /** return the event's secrecy in string format. */
213 QString secrecyStr() const; 213 QString secrecyStr() const;
214 /** return list of all availbale secrecy classes */ 214 /** return list of all availbale secrecy classes */
215 static QStringList secrecyList(); 215 static QStringList secrecyList();
216 /** return human-readable name of secrecy class */ 216 /** return human-readable name of secrecy class */
217 static QString secrecyName(int); 217 static QString secrecyName(int);
218 218
219 /** returns TRUE if the date specified is one on which the event will 219 /** returns TRUE if the date specified is one on which the event will
220 * recur. */ 220 * recur. */
221 bool recursOn(const QDate &qd) const; 221 bool recursOn(const QDate &qd) const;
222 222
223 // VEVENT and VTODO, but not VJOURNAL (move to EventBase class?): 223 // VEVENT and VTODO, but not VJOURNAL (move to EventBase class?):
224 224
225 /** set resources used, such as Office, Car, etc. */ 225 /** set resources used, such as Office, Car, etc. */
226 void setResources(const QStringList &resources); 226 void setResources(const QStringList &resources);
227 /** return list of current resources */ 227 /** return list of current resources */
228 QStringList resources() const; 228 QStringList resources() const;
229 229
230 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */ 230 /** set the event's priority, 0 is undefined, 1 highest (decreasing order) */
231 void setPriority(int priority); 231 void setPriority(int priority);
232 /** get the event's priority */ 232 /** get the event's priority */
233 int priority() const; 233 int priority() const;
234 234
235 /** All alarms that are associated with this incidence */ 235 /** All alarms that are associated with this incidence */
236 QPtrList<Alarm> alarms() const; 236 QPtrList<Alarm> alarms() const;
237 /** Create a new alarm which is associated with this incidence */ 237 /** Create a new alarm which is associated with this incidence */
238 Alarm* newAlarm(); 238 Alarm* newAlarm();
239 /** Add an alarm which is associated with this incidence */ 239 /** Add an alarm which is associated with this incidence */
240 void addAlarm(Alarm*); 240 void addAlarm(Alarm*);
241 /** Remove an alarm that is associated with this incidence */ 241 /** Remove an alarm that is associated with this incidence */
242 void removeAlarm(Alarm*); 242 void removeAlarm(Alarm*);
243 /** Remove all alarms that are associated with this incidence */ 243 /** Remove all alarms that are associated with this incidence */
244 void clearAlarms(); 244 void clearAlarms();
245 /** return whether any alarm associated with this incidence is enabled */ 245 /** return whether any alarm associated with this incidence is enabled */
246 bool isAlarmEnabled() const; 246 bool isAlarmEnabled() const;
247 247
248 /** 248 /**
249 Return the recurrence rule associated with this incidence. If there is 249 Return the recurrence rule associated with this incidence. If there is
250 none, returns an appropriate (non-0) object. 250 none, returns an appropriate (non-0) object.
251 */ 251 */
252 Recurrence *recurrence() const; 252 Recurrence *recurrence() const;
253 void setRecurrence(Recurrence * r); 253 void setRecurrence(Recurrence * r);
254 /** 254 /**
255 Forward to Recurrence::doesRecur(). 255 Forward to Recurrence::doesRecur().
256 */ 256 */
257 ushort doesRecur() const; 257 ushort doesRecur() const;
258 258
259 /** set the event's/todo's location. Do _not_ use it with journal */ 259 /** set the event's/todo's location. Do _not_ use it with journal */
260 void setLocation(const QString &location); 260 void setLocation(const QString &location);
261 /** return the event's/todo's location. Do _not_ use it with journal */ 261 /** return the event's/todo's location. Do _not_ use it with journal */
262 QString location() const; 262 QString location() const;
263 /** returns TRUE or FALSE depending on whether the todo has a start date */ 263 /** returns TRUE or FALSE depending on whether the todo has a start date */
264 bool hasStartDate() const; 264 bool hasStartDate() const;
265 /** sets the event's hasStartDate value. */ 265 /** sets the event's hasStartDate value. */
266 void setHasStartDate(bool f); 266 void setHasStartDate(bool f);
267 QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const; 267 QDateTime getNextOccurence( const QDateTime& dt, bool* yes ) const;
268 bool cancelled() const; 268 bool cancelled() const;
269 void setCancelled( bool b ); 269 void setCancelled( bool b );
270 270
271 bool hasRecurrenceID() const; 271 bool hasRecurrenceID() const;
272 void setHasRecurrenceID( bool b ); 272 void setHasRecurrenceID( bool b );
273 273
274 void setRecurrenceID(QDateTime); 274 void setRecurrenceID(QDateTime);
275 QDateTime recurrenceID () const; 275 QDateTime recurrenceID () const;
276 QDateTime dtStart() const; 276 QDateTime dtStart() const;
277 bool isHoliday() const; 277 bool isHoliday() const;
278 bool isBirthday() const; 278 bool isBirthday() const;
279 bool isAnniversary() const; 279 bool isAnniversary() const;
280 QDateTime lastModifiedSub();
281 void setLastModifiedSubInvalid();
280 282
281 283
282protected: 284protected:
283 QPtrList<Alarm> mAlarms; 285 QPtrList<Alarm> mAlarms;
284 QPtrList<Incidence> mRelations; 286 QPtrList<Incidence> mRelations;
285 QDateTime mRecurrenceID; 287 QDateTime mRecurrenceID;
286 bool mHasRecurrenceID; 288 bool mHasRecurrenceID;
287 private: 289 private:
288 void checkCategories(); 290 void checkCategories();
289 bool mHoliday, mBirthday, mAnniversary; 291 bool mHoliday, mBirthday, mAnniversary;
290 int mRevision; 292 int mRevision;
291 bool mCancelled; 293 bool mCancelled;
292 294
293 // base components of jounal, event and todo 295 // base components of jounal, event and todo
294 QDateTime mCreated; 296 QDateTime mCreated;
297 QDateTime mLastModifiedSub;
295 QString mDescription; 298 QString mDescription;
296 QString mSummary; 299 QString mSummary;
297 QStringList mCategories; 300 QStringList mCategories;
298 Incidence *mRelatedTo; 301 Incidence *mRelatedTo;
299 QString mRelatedToUid; 302 QString mRelatedToUid;
300 DateList mExDates; 303 DateList mExDates;
301 QPtrList<Attachment> mAttachments; 304 QPtrList<Attachment> mAttachments;
302 QStringList mResources; 305 QStringList mResources;
303 bool mHasStartDate; // if todo has associated start date 306 bool mHasStartDate; // if todo has associated start date
304 307
305 int mSecrecy; 308 int mSecrecy;
306 int mPriority; // 1 = highest, 2 = less, etc. 309 int mPriority; // 1 = highest, 2 = less, etc.
307 310
308 //QPtrList<Alarm> mAlarms; 311 //QPtrList<Alarm> mAlarms;
309 Recurrence *mRecurrence; 312 Recurrence *mRecurrence;
310 313
311 QString mLocation; 314 QString mLocation;
312}; 315};
313 316
314bool operator==( const Incidence&, const Incidence& ); 317bool operator==( const Incidence&, const Incidence& );
315 318
316} 319}
317 320
318#endif 321#endif
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 1a19f3e..022dead 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -1,478 +1,482 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include <kglobal.h> 21#include <kglobal.h>
22#include <klocale.h> 22#include <klocale.h>
23#include <kdebug.h> 23#include <kdebug.h>
24#include <kidmanager.h> 24#include <kidmanager.h>
25 25
26#include "calformat.h" 26#include "calformat.h"
27#include "syncdefines.h" 27#include "syncdefines.h"
28 28
29#include "incidencebase.h" 29#include "incidencebase.h"
30 30
31using namespace KCal; 31using namespace KCal;
32 32
33IncidenceBase::IncidenceBase() : 33IncidenceBase::IncidenceBase() :
34 mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false), 34 mReadOnly(false), mFloats(true), mDuration(0), mHasDuration(false),
35 mPilotId(0), mSyncStatus(SYNCMOD) 35 mPilotId(0), mSyncStatus(SYNCMOD)
36{ 36{
37 blockLastModified = false; 37 blockLastModified = false;
38 setUid(CalFormat::createUniqueId()); 38 setUid(CalFormat::createUniqueId());
39 mOrganizer = ""; 39 mOrganizer = "";
40 mFloats = false; 40 mFloats = false;
41 mDuration = 0; 41 mDuration = 0;
42 mHasDuration = false; 42 mHasDuration = false;
43 mPilotId = 0; 43 mPilotId = 0;
44 mExternalId = ":"; 44 mExternalId = ":";
45 mTempSyncStat = SYNC_TEMPSTATE_INITIAL; 45 mTempSyncStat = SYNC_TEMPSTATE_INITIAL;
46 mSyncStatus = 0; 46 mSyncStatus = 0;
47 mAttendees.setAutoDelete( true ); 47 mAttendees.setAutoDelete( true );
48 mCalEnabled = true; 48 mCalEnabled = true;
49 mAlarmEnabled = true; 49 mAlarmEnabled = true;
50 mCalID = 0; 50 mCalID = 0;
51} 51}
52 52
53IncidenceBase::IncidenceBase(const IncidenceBase &i) : 53IncidenceBase::IncidenceBase(const IncidenceBase &i) :
54 CustomProperties( i ) 54 CustomProperties( i )
55{ 55{
56 56
57 blockLastModified = false; 57 blockLastModified = false;
58 mReadOnly = i.mReadOnly; 58 mReadOnly = i.mReadOnly;
59 mDtStart = i.mDtStart; 59 mDtStart = i.mDtStart;
60 mDuration = i.mDuration; 60 mDuration = i.mDuration;
61 mHasDuration = i.mHasDuration; 61 mHasDuration = i.mHasDuration;
62 mOrganizer = i.mOrganizer; 62 mOrganizer = i.mOrganizer;
63 mUid = i.mUid; 63 mUid = i.mUid;
64 mCalEnabled = i.mCalEnabled; 64 mCalEnabled = i.mCalEnabled;
65 mAlarmEnabled = i.mAlarmEnabled; 65 mAlarmEnabled = i.mAlarmEnabled;
66 mCalID = i.mCalID; 66 mCalID = i.mCalID;
67 QPtrList<Attendee> attendees = i.attendees(); 67 QPtrList<Attendee> attendees = i.attendees();
68 for( Attendee *a = attendees.first(); a; a = attendees.next() ) { 68 for( Attendee *a = attendees.first(); a; a = attendees.next() ) {
69 mAttendees.append( new Attendee( *a ) ); 69 mAttendees.append( new Attendee( *a ) );
70 } 70 }
71 mFloats = i.mFloats; 71 mFloats = i.mFloats;
72 mLastModified = i.mLastModified; 72 mLastModified = i.mLastModified;
73 mPilotId = i.mPilotId; 73 mPilotId = i.mPilotId;
74 mTempSyncStat = i.mTempSyncStat; 74 mTempSyncStat = i.mTempSyncStat;
75 mSyncStatus = i.mSyncStatus; 75 mSyncStatus = i.mSyncStatus;
76 mExternalId = i.mExternalId; 76 mExternalId = i.mExternalId;
77 // The copied object is a new one, so it isn't observed by the observer 77 // The copied object is a new one, so it isn't observed by the observer
78 // of the original object. 78 // of the original object.
79 mObservers.clear(); 79 mObservers.clear();
80 80
81 mAttendees.setAutoDelete( true ); 81 mAttendees.setAutoDelete( true );
82} 82}
83 83
84IncidenceBase::~IncidenceBase() 84IncidenceBase::~IncidenceBase()
85{ 85{
86} 86}
87 87
88 88
89bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 ) 89bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 )
90{ 90{
91 // do not compare mSyncStatus and mExternalId 91 // do not compare mSyncStatus and mExternalId
92 if( i1.attendees().count() != i2.attendees().count() ) { 92 if( i1.attendees().count() != i2.attendees().count() ) {
93 return false; // no need to check further 93 return false; // no need to check further
94 } 94 }
95 if ( i1.attendees().count() > 0 ) { 95 if ( i1.attendees().count() > 0 ) {
96 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ; 96 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ;
97 while ( a1 ) { 97 while ( a1 ) {
98 if ( !( (*a1) == (*a2)) ) 98 if ( !( (*a1) == (*a2)) )
99 { 99 {
100 //qDebug("Attendee not equal "); 100 //qDebug("Attendee not equal ");
101 return false; 101 return false;
102 } 102 }
103 a1 = i1.attendees().next(); 103 a1 = i1.attendees().next();
104 a2 = i2.attendees().next(); 104 a2 = i2.attendees().next();
105 } 105 }
106 } 106 }
107 //if ( i1.dtStart() != i2.dtStart() ) 107 //if ( i1.dtStart() != i2.dtStart() )
108 // return false; 108 // return false;
109#if 0 109#if 0
110 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() ); 110 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() );
111 qDebug("1 %d ",i1.duration() == i2.duration() ); 111 qDebug("1 %d ",i1.duration() == i2.duration() );
112 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() ); 112 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() );
113 qDebug("1 %d ",i1.pilotId() == i2.pilotId() ); 113 qDebug("1 %d ",i1.pilotId() == i2.pilotId() );
114 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() ); 114 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() );
115 qDebug("6 %d ",i1.organizer() == i2.organizer() ); 115 qDebug("6 %d ",i1.organizer() == i2.organizer() );
116 116
117#endif 117#endif
118 if ( i1.hasDuration() == i2.hasDuration() ) { 118 if ( i1.hasDuration() == i2.hasDuration() ) {
119 if ( i1.hasDuration() ) { 119 if ( i1.hasDuration() ) {
120 if ( i1.duration() != i2.duration() ) 120 if ( i1.duration() != i2.duration() )
121 return false; 121 return false;
122 } 122 }
123 } else { 123 } else {
124 return false; 124 return false;
125 } 125 }
126 126
127 return ( i1.organizer() == i2.organizer() && 127 return ( i1.organizer() == i2.organizer() &&
128 // i1.uid() == i2.uid() && 128 // i1.uid() == i2.uid() &&
129 // Don't compare lastModified, otherwise the operator is not 129 // Don't compare lastModified, otherwise the operator is not
130 // of much use. We are not comparing for identity, after all. 130 // of much use. We are not comparing for identity, after all.
131 i1.doesFloat() == i2.doesFloat() && 131 i1.doesFloat() == i2.doesFloat() &&
132 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() ); 132 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() );
133 // no need to compare mObserver 133 // no need to compare mObserver
134} 134}
135 135
136 136
137QDateTime IncidenceBase::getEvenTime( QDateTime dt ) 137QDateTime IncidenceBase::getEvenTime( QDateTime dt )
138{ 138{
139 QTime t = dt.time(); 139 QTime t = dt.time();
140 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 140 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
141 return dt; 141 return dt;
142} 142}
143 143
144bool IncidenceBase::isTagged() const 144bool IncidenceBase::isTagged() const
145{ 145{
146 return mIsTagged; 146 return mIsTagged;
147} 147}
148void IncidenceBase::setTagged( bool b) 148void IncidenceBase::setTagged( bool b)
149{ 149{
150 mIsTagged = b; 150 mIsTagged = b;
151} 151}
152void IncidenceBase::setCalID( int id ) 152void IncidenceBase::setCalID( int id )
153{ 153{
154 if ( mCalID > 0 ) { 154 if ( mCalID > 0 ) {
155 blockLastModified = true; 155 blockLastModified = true;
156 updated(); 156 updated();
157 blockLastModified = false; 157 blockLastModified = false;
158 } 158 }
159 mCalID = id; 159 mCalID = id;
160} 160}
161int IncidenceBase::calID() const 161int IncidenceBase::calID() const
162{ 162{
163 return mCalID; 163 return mCalID;
164} 164}
165void IncidenceBase::setCalEnabled( bool b ) 165void IncidenceBase::setCalEnabled( bool b )
166{ 166{
167 mCalEnabled = b; 167 mCalEnabled = b;
168} 168}
169bool IncidenceBase::calEnabled() const 169bool IncidenceBase::calEnabled() const
170{ 170{
171 return mCalEnabled; 171 return mCalEnabled;
172} 172}
173 173
174void IncidenceBase::setAlarmEnabled( bool b ) 174void IncidenceBase::setAlarmEnabled( bool b )
175{ 175{
176 mAlarmEnabled = b; 176 mAlarmEnabled = b;
177} 177}
178bool IncidenceBase::alarmEnabled() const 178bool IncidenceBase::alarmEnabled() const
179{ 179{
180 return mAlarmEnabled; 180 return mAlarmEnabled;
181} 181}
182 182
183 183
184void IncidenceBase::setUid(const QString &uid) 184void IncidenceBase::setUid(const QString &uid)
185{ 185{
186 mUid = uid; 186 mUid = uid;
187 updated(); 187 updated();
188} 188}
189 189
190QString IncidenceBase::uid() const 190QString IncidenceBase::uid() const
191{ 191{
192 return mUid; 192 return mUid;
193} 193}
194void IncidenceBase::setLastModifiedSubInvalid()
195{
194 196
197}
195void IncidenceBase::setLastModified(const QDateTime &lm) 198void IncidenceBase::setLastModified(const QDateTime &lm)
196{ 199{
197 if ( blockLastModified ) return; 200 if ( blockLastModified ) return;
198 // DON'T! updated() because we call this from 201 // DON'T! updated() because we call this from
199 // Calendar::updateEvent(). 202 // Calendar::updateEvent().
200 mLastModified = getEvenTime(lm); 203 mLastModified = getEvenTime(lm);
204 setLastModifiedSubInvalid();
201 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); 205 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1());
202} 206}
203 207
204QDateTime IncidenceBase::lastModified() const 208QDateTime IncidenceBase::lastModified() const
205{ 209{
206 return mLastModified; 210 return mLastModified;
207} 211}
208 212
209void IncidenceBase::setOrganizer(const QString &o) 213void IncidenceBase::setOrganizer(const QString &o)
210{ 214{
211 // we don't check for readonly here, because it is 215 // we don't check for readonly here, because it is
212 // possible that by setting the organizer we are changing 216 // possible that by setting the organizer we are changing
213 // the event's readonly status... 217 // the event's readonly status...
214 mOrganizer = o; 218 mOrganizer = o;
215 if (mOrganizer.left(7).upper() == "MAILTO:") 219 if (mOrganizer.left(7).upper() == "MAILTO:")
216 mOrganizer = mOrganizer.remove(0,7); 220 mOrganizer = mOrganizer.remove(0,7);
217 221
218 updated(); 222 updated();
219} 223}
220 224
221QString IncidenceBase::organizer() const 225QString IncidenceBase::organizer() const
222{ 226{
223 return mOrganizer; 227 return mOrganizer;
224} 228}
225 229
226void IncidenceBase::setReadOnly( bool readOnly ) 230void IncidenceBase::setReadOnly( bool readOnly )
227{ 231{
228 mReadOnly = readOnly; 232 mReadOnly = readOnly;
229} 233}
230 234
231void IncidenceBase::setDtStart(const QDateTime &dtStart) 235void IncidenceBase::setDtStart(const QDateTime &dtStart)
232{ 236{
233// if (mReadOnly) return; 237// if (mReadOnly) return;
234 mDtStart = getEvenTime(dtStart); 238 mDtStart = getEvenTime(dtStart);
235 updated(); 239 updated();
236} 240}
237 241
238 242
239QDateTime IncidenceBase::dtStart() const 243QDateTime IncidenceBase::dtStart() const
240{ 244{
241 return mDtStart; 245 return mDtStart;
242} 246}
243 247
244QString IncidenceBase::dtStartTimeStr() const 248QString IncidenceBase::dtStartTimeStr() const
245{ 249{
246 return KGlobal::locale()->formatTime(dtStart().time()); 250 return KGlobal::locale()->formatTime(dtStart().time());
247} 251}
248 252
249QString IncidenceBase::dtStartDateStr(bool shortfmt) const 253QString IncidenceBase::dtStartDateStr(bool shortfmt) const
250{ 254{
251 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); 255 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt);
252} 256}
253 257
254QString IncidenceBase::dtStartStr(bool shortfmt) const 258QString IncidenceBase::dtStartStr(bool shortfmt) const
255{ 259{
256 if ( doesFloat() ) 260 if ( doesFloat() )
257 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); 261 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt);
258 return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); 262 return KGlobal::locale()->formatDateTime(dtStart(), shortfmt);
259} 263}
260 264
261 265
262bool IncidenceBase::doesFloat() const 266bool IncidenceBase::doesFloat() const
263{ 267{
264 return mFloats; 268 return mFloats;
265} 269}
266 270
267void IncidenceBase::setFloats(bool f) 271void IncidenceBase::setFloats(bool f)
268{ 272{
269 if (mReadOnly) return; 273 if (mReadOnly) return;
270 mFloats = f; 274 mFloats = f;
271 updated(); 275 updated();
272} 276}
273 277
274 278
275bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) 279bool IncidenceBase::addAttendee(Attendee *a, bool doupdate)
276{ 280{
277 if (mReadOnly) return false; 281 if (mReadOnly) return false;
278 if (a->name().left(7).upper() == "MAILTO:") 282 if (a->name().left(7).upper() == "MAILTO:")
279 a->setName(a->name().remove(0,7)); 283 a->setName(a->name().remove(0,7));
280 284
281 QPtrListIterator<Attendee> qli(mAttendees); 285 QPtrListIterator<Attendee> qli(mAttendees);
282 286
283 qli.toFirst(); 287 qli.toFirst();
284 while (qli) { 288 while (qli) {
285 if (*qli.current() == *a) 289 if (*qli.current() == *a)
286 return false; 290 return false;
287 ++qli; 291 ++qli;
288 } 292 }
289 mAttendees.append(a); 293 mAttendees.append(a);
290 if (doupdate) updated(); 294 if (doupdate) updated();
291 return true; 295 return true;
292} 296}
293 297
294#if 0 298#if 0
295void IncidenceBase::removeAttendee(Attendee *a) 299void IncidenceBase::removeAttendee(Attendee *a)
296{ 300{
297 if (mReadOnly) return; 301 if (mReadOnly) return;
298 mAttendees.removeRef(a); 302 mAttendees.removeRef(a);
299 updated(); 303 updated();
300} 304}
301 305
302void IncidenceBase::removeAttendee(const char *n) 306void IncidenceBase::removeAttendee(const char *n)
303{ 307{
304 Attendee *a; 308 Attendee *a;
305 309
306 if (mReadOnly) return; 310 if (mReadOnly) return;
307 for (a = mAttendees.first(); a; a = mAttendees.next()) 311 for (a = mAttendees.first(); a; a = mAttendees.next())
308 if (a->getName() == n) { 312 if (a->getName() == n) {
309 mAttendees.remove(); 313 mAttendees.remove();
310 break; 314 break;
311 } 315 }
312} 316}
313#endif 317#endif
314 318
315void IncidenceBase::clearAttendees() 319void IncidenceBase::clearAttendees()
316{ 320{
317 if (mReadOnly) return; 321 if (mReadOnly) return;
318 mAttendees.clear(); 322 mAttendees.clear();
319} 323}
320 324
321#if 0 325#if 0
322Attendee *IncidenceBase::getAttendee(const char *n) const 326Attendee *IncidenceBase::getAttendee(const char *n) const
323{ 327{
324 QPtrListIterator<Attendee> qli(mAttendees); 328 QPtrListIterator<Attendee> qli(mAttendees);
325 329
326 qli.toFirst(); 330 qli.toFirst();
327 while (qli) { 331 while (qli) {
328 if (qli.current()->getName() == n) 332 if (qli.current()->getName() == n)
329 return qli.current(); 333 return qli.current();
330 ++qli; 334 ++qli;
331 } 335 }
332 return 0L; 336 return 0L;
333} 337}
334#endif 338#endif
335 339
336Attendee *IncidenceBase::attendeeByMail(const QString &email) 340Attendee *IncidenceBase::attendeeByMail(const QString &email)
337{ 341{
338 QPtrListIterator<Attendee> qli(mAttendees); 342 QPtrListIterator<Attendee> qli(mAttendees);
339 343
340 qli.toFirst(); 344 qli.toFirst();
341 while (qli) { 345 while (qli) {
342 if (qli.current()->email().lower() == email.lower()) 346 if (qli.current()->email().lower() == email.lower())
343 return qli.current(); 347 return qli.current();
344 ++qli; 348 ++qli;
345 } 349 }
346 return 0L; 350 return 0L;
347} 351}
348 352
349Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email) 353Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email)
350{ 354{
351 QPtrListIterator<Attendee> qli(mAttendees); 355 QPtrListIterator<Attendee> qli(mAttendees);
352 356
353 QStringList mails = emails; 357 QStringList mails = emails;
354 if (!email.isEmpty()) { 358 if (!email.isEmpty()) {
355 mails.append(email); 359 mails.append(email);
356 } 360 }
357 qli.toFirst(); 361 qli.toFirst();
358 while (qli) { 362 while (qli) {
359 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) { 363 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) {
360 if (qli.current()->email().lower() == (*it).lower()) 364 if (qli.current()->email().lower() == (*it).lower())
361 return qli.current(); 365 return qli.current();
362 } 366 }
363 367
364 ++qli; 368 ++qli;
365 } 369 }
366 return 0L; 370 return 0L;
367} 371}
368 372
369void IncidenceBase::setDuration(int seconds) 373void IncidenceBase::setDuration(int seconds)
370{ 374{
371 mDuration = seconds; 375 mDuration = seconds;
372 setHasDuration(true); 376 setHasDuration(true);
373} 377}
374 378
375int IncidenceBase::duration() const 379int IncidenceBase::duration() const
376{ 380{
377 return mDuration; 381 return mDuration;
378} 382}
379 383
380void IncidenceBase::setHasDuration(bool b) 384void IncidenceBase::setHasDuration(bool b)
381{ 385{
382 mHasDuration = b; 386 mHasDuration = b;
383} 387}
384 388
385bool IncidenceBase::hasDuration() const 389bool IncidenceBase::hasDuration() const
386{ 390{
387 return mHasDuration; 391 return mHasDuration;
388} 392}
389 393
390void IncidenceBase::setSyncStatus(int stat) 394void IncidenceBase::setSyncStatus(int stat)
391{ 395{
392 if (mReadOnly) return; 396 if (mReadOnly) return;
393 mSyncStatus = stat; 397 mSyncStatus = stat;
394} 398}
395 399
396int IncidenceBase::syncStatus() const 400int IncidenceBase::syncStatus() const
397{ 401{
398 return mSyncStatus; 402 return mSyncStatus;
399} 403}
400 404
401void IncidenceBase::setPilotId( int id ) 405void IncidenceBase::setPilotId( int id )
402{ 406{
403 if (mReadOnly) return; 407 if (mReadOnly) return;
404 mPilotId = id; 408 mPilotId = id;
405} 409}
406 410
407int IncidenceBase::pilotId() const 411int IncidenceBase::pilotId() const
408{ 412{
409 return mPilotId; 413 return mPilotId;
410} 414}
411 415
412int IncidenceBase::tempSyncStat() const 416int IncidenceBase::tempSyncStat() const
413{ 417{
414 return mTempSyncStat; 418 return mTempSyncStat;
415} 419}
416void IncidenceBase::setTempSyncStat( int id ) 420void IncidenceBase::setTempSyncStat( int id )
417{ 421{
418 if (mReadOnly) return; 422 if (mReadOnly) return;
419 mTempSyncStat = id; 423 mTempSyncStat = id;
420} 424}
421 425
422void IncidenceBase::removeID(const QString &prof) 426void IncidenceBase::removeID(const QString &prof)
423{ 427{
424 if ( prof.isEmpty() ) 428 if ( prof.isEmpty() )
425 mExternalId = ":"; 429 mExternalId = ":";
426 else 430 else
427 mExternalId = KIdManager::removeId ( mExternalId, prof); 431 mExternalId = KIdManager::removeId ( mExternalId, prof);
428 432
429} 433}
430void IncidenceBase::setID( const QString & prof , const QString & id ) 434void IncidenceBase::setID( const QString & prof , const QString & id )
431{ 435{
432 mExternalId = KIdManager::setId ( mExternalId, prof, id ); 436 mExternalId = KIdManager::setId ( mExternalId, prof, id );
433} 437}
434QString IncidenceBase::getID( const QString & prof) 438QString IncidenceBase::getID( const QString & prof)
435{ 439{
436 return KIdManager::getId ( mExternalId, prof ); 440 return KIdManager::getId ( mExternalId, prof );
437} 441}
438 442
439// example :Sharp_DTM;22;23566:TP;-1;8654:TPP;18;0: 443// example :Sharp_DTM;22;23566:TP;-1;8654:TPP;18;0:
440// format name;III;JJJ: III >= 0, may be -1. JJJ always >= 0 444// format name;III;JJJ: III >= 0, may be -1. JJJ always >= 0
441void IncidenceBase::setCsum( const QString & prof , const QString & id ) 445void IncidenceBase::setCsum( const QString & prof , const QString & id )
442{ 446{
443 mExternalId = KIdManager::setCsum ( mExternalId, prof, id ); 447 mExternalId = KIdManager::setCsum ( mExternalId, prof, id );
444} 448}
445QString IncidenceBase::getCsum( const QString & prof) 449QString IncidenceBase::getCsum( const QString & prof)
446{ 450{
447 return KIdManager::getCsum ( mExternalId, prof ); 451 return KIdManager::getCsum ( mExternalId, prof );
448} 452}
449 453
450void IncidenceBase::setIDStr( const QString & s ) 454void IncidenceBase::setIDStr( const QString & s )
451{ 455{
452 if (mReadOnly) return; 456 if (mReadOnly) return;
453 mExternalId = s; 457 mExternalId = s;
454} 458}
455 459
456QString IncidenceBase::IDStr() const 460QString IncidenceBase::IDStr() const
457{ 461{
458 return mExternalId ; 462 return mExternalId ;
459} 463}
460void IncidenceBase::registerObserver( IncidenceBase::Observer *observer ) 464void IncidenceBase::registerObserver( IncidenceBase::Observer *observer )
461{ 465{
462 if( !mObservers.contains(observer) ) mObservers.append( observer ); 466 if( !mObservers.contains(observer) ) mObservers.append( observer );
463} 467}
464 468
465void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer ) 469void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer )
466{ 470{
467 mObservers.remove( observer ); 471 mObservers.remove( observer );
468} 472}
469 473
470void IncidenceBase::updated() 474void IncidenceBase::updated()
471{ 475{
472 QPtrListIterator<Observer> it(mObservers); 476 QPtrListIterator<Observer> it(mObservers);
473 while( it.current() ) { 477 while( it.current() ) {
474 Observer *o = it.current(); 478 Observer *o = it.current();
475 ++it; 479 ++it;
476 o->incidenceUpdated( this ); 480 o->incidenceUpdated( this );
477 } 481 }
478} 482}
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h
index bed73db..665c1f6 100644
--- a/libkcal/incidencebase.h
+++ b/libkcal/incidencebase.h
@@ -1,186 +1,187 @@
1/* 1/*
2 This file is part of libkcal. 2 This file is part of libkcal.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20#ifndef KCAL_INCIDENCEBASE_H 20#ifndef KCAL_INCIDENCEBASE_H
21#define KCAL_INCIDENCEBASE_H 21#define KCAL_INCIDENCEBASE_H
22// 22//
23// Incidence - base class of calendaring components 23// Incidence - base class of calendaring components
24// 24//
25 25
26#include <qdatetime.h> 26#include <qdatetime.h>
27#include <qstringlist.h> 27#include <qstringlist.h>
28#include <qvaluelist.h> 28#include <qvaluelist.h>
29#include <qptrlist.h> 29#include <qptrlist.h>
30 30
31#include "customproperties.h" 31#include "customproperties.h"
32#include "attendee.h" 32#include "attendee.h"
33 33
34namespace KCal { 34namespace KCal {
35 35
36typedef QValueList<QDate> DateList; 36typedef QValueList<QDate> DateList;
37 enum IncTypeID { eventID,todoID,journalID,freebusyID }; 37 enum IncTypeID { eventID,todoID,journalID,freebusyID };
38 38
39/** 39/**
40 This class provides the base class common to all calendar components. 40 This class provides the base class common to all calendar components.
41*/ 41*/
42class IncidenceBase : public CustomProperties 42class IncidenceBase : public CustomProperties
43{ 43{
44 public: 44 public:
45 class Observer { 45 class Observer {
46 public: 46 public:
47 virtual void incidenceUpdated( IncidenceBase * ) = 0; 47 virtual void incidenceUpdated( IncidenceBase * ) = 0;
48 }; 48 };
49 49
50 IncidenceBase(); 50 IncidenceBase();
51 IncidenceBase(const IncidenceBase &); 51 IncidenceBase(const IncidenceBase &);
52 virtual ~IncidenceBase(); 52 virtual ~IncidenceBase();
53 53
54 virtual QCString type() const = 0; 54 virtual QCString type() const = 0;
55 virtual IncTypeID typeID() const = 0; 55 virtual IncTypeID typeID() const = 0;
56 56
57 /** Set the unique id for the event */ 57 /** Set the unique id for the event */
58 void setUid(const QString &); 58 void setUid(const QString &);
59 /** Return the unique id for the event */ 59 /** Return the unique id for the event */
60 QString uid() const; 60 QString uid() const;
61 61
62 /** Sets the time the incidence was last modified. */ 62 /** Sets the time the incidence was last modified. */
63 void setLastModified(const QDateTime &lm); 63 void setLastModified(const QDateTime &lm);
64 /** Return the time the incidence was last modified. */ 64 /** Return the time the incidence was last modified. */
65 QDateTime lastModified() const; 65 QDateTime lastModified() const;
66 66
67 /** sets the organizer for the event */ 67 /** sets the organizer for the event */
68 void setOrganizer(const QString &o); 68 void setOrganizer(const QString &o);
69 QString organizer() const; 69 QString organizer() const;
70 70
71 /** Set readonly status. */ 71 /** Set readonly status. */
72 virtual void setReadOnly( bool ); 72 virtual void setReadOnly( bool );
73 /** Return if the object is read-only. */ 73 /** Return if the object is read-only. */
74 bool isReadOnly() const { return mReadOnly; } 74 bool isReadOnly() const { return mReadOnly; }
75 75
76 /** for setting the event's starting date/time with a QDateTime. */ 76 /** for setting the event's starting date/time with a QDateTime. */
77 virtual void setDtStart(const QDateTime &dtStart); 77 virtual void setDtStart(const QDateTime &dtStart);
78 /** returns an event's starting date/time as a QDateTime. */ 78 /** returns an event's starting date/time as a QDateTime. */
79 virtual QDateTime dtStart() const; 79 virtual QDateTime dtStart() const;
80 /** returns an event's starting time as a string formatted according to the 80 /** returns an event's starting time as a string formatted according to the
81 users locale settings */ 81 users locale settings */
82 QString dtStartTimeStr() const; 82 QString dtStartTimeStr() const;
83 /** returns an event's starting date as a string formatted according to the 83 /** returns an event's starting date as a string formatted according to the
84 users locale settings */ 84 users locale settings */
85 QString dtStartDateStr(bool shortfmt=true) const; 85 QString dtStartDateStr(bool shortfmt=true) const;
86 /** returns an event's starting date and time as a string formatted according 86 /** returns an event's starting date and time as a string formatted according
87 to the users locale settings */ 87 to the users locale settings */
88 QString dtStartStr(bool shortfmt=true) const; 88 QString dtStartStr(bool shortfmt=true) const;
89 89
90 virtual void setDuration(int seconds); 90 virtual void setDuration(int seconds);
91 int duration() const; 91 int duration() const;
92 void setHasDuration(bool); 92 void setHasDuration(bool);
93 bool hasDuration() const; 93 bool hasDuration() const;
94 94
95 /** Return true or false depending on whether the incidence "floats," 95 /** Return true or false depending on whether the incidence "floats,"
96 * i.e. has a date but no time attached to it. */ 96 * i.e. has a date but no time attached to it. */
97 bool doesFloat() const; 97 bool doesFloat() const;
98 /** Set whether the incidence floats, i.e. has a date but no time attached to it. */ 98 /** Set whether the incidence floats, i.e. has a date but no time attached to it. */
99 void setFloats(bool f); 99 void setFloats(bool f);
100 100
101 /** 101 /**
102 Add Attendee to this incidence. IncidenceBase takes ownership of the 102 Add Attendee to this incidence. IncidenceBase takes ownership of the
103 Attendee object. 103 Attendee object.
104 */ 104 */
105 bool addAttendee(Attendee *a, bool doupdate=true ); 105 bool addAttendee(Attendee *a, bool doupdate=true );
106// void removeAttendee(Attendee *a); 106// void removeAttendee(Attendee *a);
107// void removeAttendee(const char *n); 107// void removeAttendee(const char *n);
108 /** Remove all Attendees. */ 108 /** Remove all Attendees. */
109 void clearAttendees(); 109 void clearAttendees();
110 /** Return list of attendees. */ 110 /** Return list of attendees. */
111 QPtrList<Attendee> attendees() const { return mAttendees; }; 111 QPtrList<Attendee> attendees() const { return mAttendees; };
112 /** Return number of attendees. */ 112 /** Return number of attendees. */
113 int attendeeCount() const { return mAttendees.count(); }; 113 int attendeeCount() const { return mAttendees.count(); };
114 /** Return the Attendee with this email */ 114 /** Return the Attendee with this email */
115 Attendee* attendeeByMail(const QString &); 115 Attendee* attendeeByMail(const QString &);
116 /** Return first Attendee with one of this emails */ 116 /** Return first Attendee with one of this emails */
117 Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null); 117 Attendee* attendeeByMails(const QStringList &, const QString& email = QString::null);
118 118
119 /** pilot syncronization states */ 119 /** pilot syncronization states */
120 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 }; 120 enum { SYNCNONE = 0, SYNCMOD = 1, SYNCDEL = 3 };
121 /** Set synchronisation satus. */ 121 /** Set synchronisation satus. */
122 void setSyncStatus(int stat); 122 void setSyncStatus(int stat);
123 /** Return synchronisation status. */ 123 /** Return synchronisation status. */
124 int syncStatus() const; 124 int syncStatus() const;
125 125
126 /** Set Pilot Id. */ 126 /** Set Pilot Id. */
127 void setPilotId(int id); 127 void setPilotId(int id);
128 /** Return Pilot Id. */ 128 /** Return Pilot Id. */
129 int pilotId() const; 129 int pilotId() const;
130 130
131 void setTempSyncStat(int id); 131 void setTempSyncStat(int id);
132 int tempSyncStat() const; 132 int tempSyncStat() const;
133 void setIDStr( const QString & ); 133 void setIDStr( const QString & );
134 QString IDStr() const; 134 QString IDStr() const;
135 void setID( const QString &, const QString & ); 135 void setID( const QString &, const QString & );
136 QString getID( const QString & ); 136 QString getID( const QString & );
137 void setCsum( const QString &, const QString & ); 137 void setCsum( const QString &, const QString & );
138 QString getCsum( const QString & ); 138 QString getCsum( const QString & );
139 void removeID(const QString &); 139 void removeID(const QString &);
140 140
141 void registerObserver( Observer * ); 141 void registerObserver( Observer * );
142 void unRegisterObserver( Observer * ); 142 void unRegisterObserver( Observer * );
143 void updated(); 143 void updated();
144 void setCalID( int id ); 144 void setCalID( int id );
145 int calID() const; 145 int calID() const;
146 void setCalEnabled( bool ); 146 void setCalEnabled( bool );
147 bool calEnabled() const; 147 bool calEnabled() const;
148 void setAlarmEnabled( bool ); 148 void setAlarmEnabled( bool );
149 bool alarmEnabled() const; 149 bool alarmEnabled() const;
150 bool isTagged() const; 150 bool isTagged() const;
151 void setTagged( bool ); 151 void setTagged( bool );
152 virtual void setLastModifiedSubInvalid();
152 protected: 153 protected:
153 bool blockLastModified; 154 bool blockLastModified;
154 bool mIsTagged; 155 bool mIsTagged;
155 QDateTime mDtStart; 156 QDateTime mDtStart;
156 bool mReadOnly; 157 bool mReadOnly;
157 QDateTime getEvenTime( QDateTime ); 158 QDateTime getEvenTime( QDateTime );
158 159
159 private: 160 private:
160 // base components 161 // base components
161 QString mOrganizer; 162 QString mOrganizer;
162 QString mUid; 163 QString mUid;
163 int mCalID; 164 int mCalID;
164 bool mCalEnabled; 165 bool mCalEnabled;
165 bool mAlarmEnabled; 166 bool mAlarmEnabled;
166 QDateTime mLastModified; 167 QDateTime mLastModified;
167 QPtrList<Attendee> mAttendees; 168 QPtrList<Attendee> mAttendees;
168 169
169 bool mFloats; 170 bool mFloats;
170 171
171 int mDuration; 172 int mDuration;
172 bool mHasDuration; 173 bool mHasDuration;
173 QString mExternalId; 174 QString mExternalId;
174 int mTempSyncStat; 175 int mTempSyncStat;
175 176
176 // PILOT SYNCHRONIZATION STUFF 177 // PILOT SYNCHRONIZATION STUFF
177 int mPilotId; // unique id for pilot sync 178 int mPilotId; // unique id for pilot sync
178 int mSyncStatus; // status (for sync) 179 int mSyncStatus; // status (for sync)
179 180
180 QPtrList<Observer> mObservers; 181 QPtrList<Observer> mObservers;
181}; 182};
182 183
183bool operator==( const IncidenceBase&, const IncidenceBase& ); 184bool operator==( const IncidenceBase&, const IncidenceBase& );
184} 185}
185 186
186#endif 187#endif
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp
index 5d83511..7f352d6 100644
--- a/libkdepim/kdatepicker.cpp
+++ b/libkdepim/kdatepicker.cpp
@@ -1,488 +1,489 @@
1/* -*- C++ -*- 1/* -*- C++ -*-
2 This file is part of the KDE libraries 2 This file is part of the KDE libraries
3 Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org) 3 Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org)
4 (C) 1998-2001 Mirko Boehm (mirko@kde.org) 4 (C) 1998-2001 Mirko Boehm (mirko@kde.org)
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21#include "kdatepicker.h" 21#include "kdatepicker.h"
22#include <kglobal.h> 22#include <kglobal.h>
23#include <kapplication.h> 23#include <kapplication.h>
24#include <klocale.h> 24#include <klocale.h>
25#include <kiconloader.h> 25#include <kiconloader.h>
26#include <qframe.h> 26#include <qframe.h>
27#include <qpainter.h> 27#include <qpainter.h>
28#include <qdialog.h> 28#include <qdialog.h>
29#include <qtoolbutton.h> 29#include <qtoolbutton.h>
30#include <qfont.h> 30#include <qfont.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qvalidator.h> 33#include <qvalidator.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <knotifyclient.h> 35#include <knotifyclient.h>
36#include <kglobalsettings.h> 36#include <kglobalsettings.h>
37#include "kdatetbl.h" 37#include "kdatetbl.h"
38#include "kdateedit.h" 38#include "kdateedit.h"
39//#include "kdatepicker.moc" 39//#include "kdatepicker.moc"
40 40
41 41
42KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name) 42KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
43 : QFrame(parent,name), 43 : QFrame(parent,name),
44 yearForward(new QToolButton(this)), 44 yearForward(new QToolButton(this)),
45 yearBackward(new QToolButton(this)), 45 yearBackward(new QToolButton(this)),
46 monthForward(new QToolButton(this)), 46 monthForward(new QToolButton(this)),
47 monthBackward(new QToolButton(this)), 47 monthBackward(new QToolButton(this)),
48 selectMonth(new QToolButton(this)), 48 selectMonth(new QToolButton(this)),
49 selectYear(new QToolButton(this)), 49 selectYear(new QToolButton(this)),
50 todayBut(new QToolButton(this)), 50 todayBut(new QToolButton(this)),
51 //line(new QLineEdit(this)), 51 //line(new QLineEdit(this)),
52 val(new KDateValidator(this)) 52 val(new KDateValidator(this))
53 //table(new KDateTable(this)), 53 //table(new KDateTable(this)),
54 //fontsize(1) 54 //fontsize(1)
55{ 55{
56 QFont fo = KGlobalSettings::generalFont(); 56 QFont fo = KGlobalSettings::generalFont();
57 int add = 2; 57 int add = 2;
58 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 ) 58 if ( QApplication::desktop()->width() >= 480 && QApplication::desktop()->width() <= 640 )
59 add += 4; 59 add += 4;
60 fo.setPointSize(fo.pointSize()+add ); 60 fo.setPointSize(fo.pointSize()+add );
61 setFont( fo ); 61 setFont( fo );
62 table = new KDateTable(this); 62 table = new KDateTable(this);
63 setFontSize(font().pointSize()); 63 setFontSize(font().pointSize());
64 //line->setValidator(val); 64 //line->setValidator(val);
65 lineDate = new KDateEdit( this, "dateediipicker", true ); 65 lineDate = new KDateEdit( this, "dateediipicker", true );
66 yearForward->setPixmap(SmallIcon("3rightarrowB")); 66 yearForward->setPixmap(SmallIcon("3rightarrowB"));
67 yearBackward->setPixmap(SmallIcon("3leftarrowB")); 67 yearBackward->setPixmap(SmallIcon("3leftarrowB"));
68 monthForward->setPixmap(SmallIcon("2rightarrowB")); 68 monthForward->setPixmap(SmallIcon("2rightarrowB"));
69 monthBackward->setPixmap(SmallIcon("2leftarrowB")); 69 monthBackward->setPixmap(SmallIcon("2leftarrowB"));
70 todayBut->setPixmap(SmallIcon("today")); 70 todayBut->setPixmap(SmallIcon("today"));
71 setDate(dt); // set button texts 71 setDate(dt); // set button texts
72 connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate))); 72 connect(table, SIGNAL(dateChanged(QDate)), SLOT(dateChangedSlot(QDate)));
73 connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot())); 73 connect(table, SIGNAL(tableClicked()), SLOT(tableClickedSlot()));
74 connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked())); 74 connect(monthForward, SIGNAL(clicked()), SLOT(monthForwardClicked()));
75 connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked())); 75 connect(monthBackward, SIGNAL(clicked()), SLOT(monthBackwardClicked()));
76 connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked())); 76 connect(yearForward, SIGNAL(clicked()), SLOT(yearForwardClicked()));
77 connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked())); 77 connect(yearBackward, SIGNAL(clicked()), SLOT(yearBackwardClicked()));
78 connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked())); 78 connect(selectMonth, SIGNAL(clicked()), SLOT(selectMonthClicked()));
79 connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked())); 79 connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked()));
80 connect(todayBut, SIGNAL(clicked()), SLOT(goToday())); 80 connect(todayBut, SIGNAL(clicked()), SLOT(goToday()));
81 //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); 81 //connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed()));
82 connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate))); 82 connect(lineDate, SIGNAL(dateChanged(QDate)), SLOT(slotSetDate(QDate)));
83 connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed())); 83 connect(lineDate, SIGNAL(returnPressed()), SLOT(lineEnterPressed()));
84 table->setFocus(); 84 table->setFocus();
85 85
86} 86}
87 87
88KDatePicker::~KDatePicker() 88KDatePicker::~KDatePicker()
89{ 89{
90} 90}
91 91
92void 92void
93KDatePicker::resizeEvent(QResizeEvent*) 93KDatePicker::resizeEvent(QResizeEvent*)
94{ 94{
95 QWidget *buttons[] = { 95 QWidget *buttons[] = {
96 yearBackward, 96 yearBackward,
97 monthBackward, 97 monthBackward,
98 selectMonth, 98 selectMonth,
99 selectYear, 99 selectYear,
100 monthForward, 100 monthForward,
101 yearForward }; 101 yearForward };
102 const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); 102 const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]);
103 QSize sizes[NoOfButtons]; 103 QSize sizes[NoOfButtons];
104 int buttonHeight=0; 104 int buttonHeight=0;
105 int count; 105 int count;
106 int w; 106 int w;
107 int x=0; 107 int x=0;
108 // ----- calculate button row height: 108 // ----- calculate button row height:
109 for(count=0; count<NoOfButtons; ++count) { 109 for(count=0; count<NoOfButtons; ++count) {
110 int xS = buttons[count]->sizeHint().width(); 110 int xS = buttons[count]->sizeHint().width();
111 int yS = buttons[count]->sizeHint().height(); 111 int yS = buttons[count]->sizeHint().height();
112 if ( QApplication::desktop()->width() < 320 ) 112 if ( QApplication::desktop()->width() < 320 )
113 sizes[count]=QSize ( xS+4, yS ); 113 sizes[count]=QSize ( xS+4, yS );
114 else 114 else
115 sizes[count]=QSize ( xS+10, yS ); 115 sizes[count]=QSize ( xS+10, yS );
116 116
117 buttonHeight=QMAX(buttonHeight, sizes[count].height()); 117 buttonHeight=QMAX(buttonHeight, sizes[count].height());
118 } 118 }
119 buttonHeight += 10; 119 buttonHeight += 10;
120 // ----- calculate size of the month button: 120 // ----- calculate size of the month button:
121 w=0; 121 w=0;
122 for(count=0; count<NoOfButtons; ++count) { 122 for(count=0; count<NoOfButtons; ++count) {
123 if(buttons[count]!=selectMonth) 123 if(buttons[count]!=selectMonth)
124 { 124 {
125 w+=sizes[count].width(); 125 w+=sizes[count].width();
126 } else { 126 } else {
127 x=count; 127 x=count;
128 } 128 }
129 } 129 }
130 sizes[x].setWidth(width()-w); // stretch the month button 130 sizes[x].setWidth(width()-w); // stretch the month button
131 // ----- place the buttons: 131 // ----- place the buttons:
132 x=0; 132 x=0;
133 for(count=0; count<NoOfButtons; ++count) 133 for(count=0; count<NoOfButtons; ++count)
134 { 134 {
135 w=sizes[count].width(); 135 w=sizes[count].width();
136 buttons[count]->setGeometry(x, 0, w, buttonHeight); 136 buttons[count]->setGeometry(x, 0, w, buttonHeight);
137 x+=w; 137 x+=w;
138 } 138 }
139 // ----- place the line edit for direct input: 139 // ----- place the line edit for direct input:
140 sizes[0]=lineDate->sizeHint(); 140 sizes[0]=lineDate->sizeHint();
141 //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height()); 141 //line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height());
142 int todaywid = todayBut->sizeHint().width(); 142 int todaywid = todayBut->sizeHint().width();
143todayBut->setGeometry(0, height()-sizes[0].height(),todaywid, sizes[0].height()); 143todayBut->setGeometry(0, height()-sizes[0].height(),todaywid, sizes[0].height());
144 lineDate->setGeometry(0+todaywid, height()-sizes[0].height(), width()-todaywid, sizes[0].height()); 144 lineDate->setGeometry(0+todaywid, height()-sizes[0].height(), width()-todaywid, sizes[0].height());
145 // ----- adjust the table: 145 // ----- adjust the table:
146 table->setGeometry(0, buttonHeight, width(), 146 table->setGeometry(0, buttonHeight, width(),
147 height()-buttonHeight-sizes[0].height()); 147 height()-buttonHeight-sizes[0].height());
148} 148}
149 149
150void 150void
151KDatePicker::dateChangedSlot(QDate date) 151KDatePicker::dateChangedSlot(QDate date)
152{ 152{
153 lineDate->setDate( date );//(KGlobal::locale()->formatDate(date, true)); 153 lineDate->setDate( date );//(KGlobal::locale()->formatDate(date, true));
154 //line->setText(KGlobal::locale()->formatDate(date, true)); 154 //line->setText(KGlobal::locale()->formatDate(date, true));
155 emit(dateChanged(date)); 155 emit(dateChanged(date));
156} 156}
157 157
158void 158void
159KDatePicker::tableClickedSlot() 159KDatePicker::tableClickedSlot()
160{ 160{
161 161
162 emit(dateSelected(table->getDate())); 162 emit(dateSelected(table->getDate()));
163 emit(tableClicked()); 163 emit(tableClicked());
164} 164}
165 165
166const QDate& 166const QDate&
167KDatePicker::getDate() const 167KDatePicker::getDate() const
168{ 168{
169 return table->getDate(); 169 return table->getDate();
170} 170}
171 171
172const QDate & 172const QDate &
173KDatePicker::date() const 173KDatePicker::date() const
174{ 174{
175 return table->getDate(); 175 return table->getDate();
176} 176}
177 177
178void KDatePicker::goToday() 178void KDatePicker::goToday()
179{ 179{
180 slotSetDate( QDate::currentDate() ); 180 slotSetDate( QDate::currentDate() );
181 181
182} 182}
183void KDatePicker::slotSetDate( QDate date ) 183void KDatePicker::slotSetDate( QDate date )
184{ 184{
185 185
186 if(date.isValid()) { 186 if(date.isValid()) {
187 QString temp; 187 QString temp;
188 // ----- 188 // -----
189 table->setDate(date); 189 table->setDate(date);
190 selectMonth->setText(KGlobal::locale()->monthName(date.month(), false)); 190 selectMonth->setText(KGlobal::locale()->monthName(date.month(), false));
191 temp.setNum(date.year()); 191 temp.setNum(date.year());
192 selectYear->setText(temp); 192 selectYear->setText(temp);
193 //line->setText(KGlobal::locale()->formatDate(date, true)); 193 //line->setText(KGlobal::locale()->formatDate(date, true));
194 lineDate->setDate( date ); 194 lineDate->setDate( date );
195 } 195 }
196 196
197} 197}
198bool 198bool
199KDatePicker::setDate(const QDate& date) 199KDatePicker::setDate(const QDate& date)
200{ 200{
201 table->setFocus(); 201 table->setFocus();
202 if(date.isValid()) { 202 if(date.isValid()) {
203 QString temp; 203 QString temp;
204 // ----- 204 // -----
205 table->setDate(date); 205 table->setDate(date);
206 selectMonth->setText(KGlobal::locale()->monthName(date.month(), false)); 206 selectMonth->setText(KGlobal::locale()->monthName(date.month(), false));
207 temp.setNum(date.year()); 207 temp.setNum(date.year());
208 selectYear->setText(temp); 208 selectYear->setText(temp);
209 //line->setText(KGlobal::locale()->formatDate(date, true)); 209 //line->setText(KGlobal::locale()->formatDate(date, true));
210 lineDate->setDate( date ); 210 lineDate->setDate( date );
211 return true; 211 return true;
212 } else { 212 } else {
213 213
214 return false; 214 return false;
215 } 215 }
216 216
217 217
218} 218}
219 219
220void 220void
221KDatePicker::monthForwardClicked() 221KDatePicker::monthForwardClicked()
222{ 222{
223 QDate temp=table->getDate(); 223 QDate temp=table->getDate();
224 int day=temp.day(); 224 int day=temp.day();
225 // ----- 225 // -----
226 if(temp.month()==12) { 226 if(temp.month()==12) {
227 temp.setYMD(temp.year()+1, 1, 1); 227 temp.setYMD(temp.year()+1, 1, 1);
228 } else { 228 } else {
229 temp.setYMD(temp.year(), temp.month()+1, 1); 229 temp.setYMD(temp.year(), temp.month()+1, 1);
230 } 230 }
231 if(temp.daysInMonth()<day) { 231 if(temp.daysInMonth()<day) {
232 temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); 232 temp.setYMD(temp.year(), temp.month(), temp.daysInMonth());
233 } else { 233 } else {
234 temp.setYMD(temp.year(), temp.month(), day); 234 temp.setYMD(temp.year(), temp.month(), day);
235 } 235 }
236 // assert(temp.isValid()); 236 // assert(temp.isValid());
237 setDate(temp); 237 setDate(temp);
238} 238}
239 239
240void 240void
241KDatePicker::monthBackwardClicked() 241KDatePicker::monthBackwardClicked()
242{ 242{
243 QDate temp=table->getDate(); 243 QDate temp=table->getDate();
244 int day=temp.day(); 244 int day=temp.day();
245 // ----- 245 // -----
246 if(temp.month()==1) 246 if(temp.month()==1)
247 { 247 {
248 temp.setYMD(temp.year()-1, 12, 1); 248 temp.setYMD(temp.year()-1, 12, 1);
249 } else { 249 } else {
250 temp.setYMD(temp.year(), temp.month()-1, 1); 250 temp.setYMD(temp.year(), temp.month()-1, 1);
251 } 251 }
252 if(temp.daysInMonth()<day) 252 if(temp.daysInMonth()<day)
253 { 253 {
254 temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); 254 temp.setYMD(temp.year(), temp.month(), temp.daysInMonth());
255 } else { 255 } else {
256 temp.setYMD(temp.year(), temp.month(), day); 256 temp.setYMD(temp.year(), temp.month(), day);
257 } 257 }
258 // assert(temp.isValid()); 258 // assert(temp.isValid());
259 setDate(temp); 259 setDate(temp);
260} 260}
261 261
262void 262void
263KDatePicker::yearForwardClicked() 263KDatePicker::yearForwardClicked()
264{ 264{
265 QDate temp=table->getDate(); 265 QDate temp=table->getDate();
266 int day=temp.day(); 266 int day=temp.day();
267 // ----- 267 // -----
268 temp.setYMD(temp.year()+1, temp.month(), 1); 268 temp.setYMD(temp.year()+1, temp.month(), 1);
269 if(temp.daysInMonth()<day) 269 if(temp.daysInMonth()<day)
270 { 270 {
271 temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); 271 temp.setYMD(temp.year(), temp.month(), temp.daysInMonth());
272 } else { 272 } else {
273 temp.setYMD(temp.year(), temp.month(), day); 273 temp.setYMD(temp.year(), temp.month(), day);
274 } 274 }
275 // assert(temp.isValid()); 275 // assert(temp.isValid());
276 setDate(temp); 276 setDate(temp);
277} 277}
278 278
279void 279void
280KDatePicker::yearBackwardClicked() 280KDatePicker::yearBackwardClicked()
281{ 281{
282 QDate temp=table->getDate(); 282 QDate temp=table->getDate();
283 int day=temp.day(); 283 int day=temp.day();
284 // ----- 284 // -----
285 temp.setYMD(temp.year()-1, temp.month(), 1); 285 temp.setYMD(temp.year()-1, temp.month(), 1);
286 if(temp.daysInMonth()<day) 286 if(temp.daysInMonth()<day)
287 { 287 {
288 temp.setYMD(temp.year(), temp.month(), temp.daysInMonth()); 288 temp.setYMD(temp.year(), temp.month(), temp.daysInMonth());
289 } else { 289 } else {
290 temp.setYMD(temp.year(), temp.month(), day); 290 temp.setYMD(temp.year(), temp.month(), day);
291 } 291 }
292 // assert(temp.isValid()); 292 // assert(temp.isValid());
293 setDate(temp); 293 setDate(temp);
294} 294}
295 295
296void 296void
297KDatePicker::selectMonthClicked() 297KDatePicker::selectMonthClicked()
298{ 298{
299 int month; 299 int month;
300 KPopupFrame* popup = new KPopupFrame(this); 300 KPopupFrame* popup = new KPopupFrame(this);
301 KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup); 301 KDateInternalMonthPicker* picker = new KDateInternalMonthPicker(popup);
302 // ----- 302 // -----
303 picker->resize(picker->sizeHint()); 303 picker->resize(picker->sizeHint());
304 popup->setMainWidget(picker); 304 popup->setMainWidget(picker);
305 picker->setFocus(); 305 picker->setFocus();
306 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 306 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
307 if(popup->exec(selectMonth->mapToGlobal(QPoint(0, selectMonth->height())))) 307 if(popup->exec(selectMonth->mapToGlobal(QPoint(0, selectMonth->height()))))
308 { 308 {
309 QDate date; 309 QDate date;
310 int day; 310 int day;
311 // ----- 311 // -----
312 month=picker->getResult(); 312 month=picker->getResult();
313 date=table->getDate(); 313 date=table->getDate();
314 day=date.day(); 314 day=date.day();
315 // ----- construct a valid date in this month: 315 // ----- construct a valid date in this month:
316 date.setYMD(date.year(), month, 1); 316 date.setYMD(date.year(), month, 1);
317 date.setYMD(date.year(), month, QMIN(day, date.daysInMonth())); 317 date.setYMD(date.year(), month, QMIN(day, date.daysInMonth()));
318 // ----- set this month 318 // ----- set this month
319 setDate(date); 319 setDate(date);
320 } else { 320 } else {
321 KNotifyClient::beep(); 321 KNotifyClient::beep();
322 } 322 }
323 delete popup; 323 delete popup;
324} 324}
325 325
326void 326void
327KDatePicker::selectYearClicked() 327KDatePicker::selectYearClicked()
328{ 328{
329 int year; 329 int year;
330 KPopupFrame* popup = new KPopupFrame(this); 330 KPopupFrame* popup = new KPopupFrame(this);
331 KDateInternalYearSelector* picker = new KDateInternalYearSelector(fontsize, popup); 331 KDateInternalYearSelector* picker = new KDateInternalYearSelector(fontsize, popup);
332 // ----- 332 // -----
333 picker->resize(picker->sizeHint()); 333 picker->resize(picker->sizeHint());
334 popup->setMainWidget(picker); 334 popup->setMainWidget(picker);
335 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 335 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
336 picker->setFocus(); 336 picker->setFocus();
337 if(popup->exec(selectYear->mapToGlobal(QPoint(0, selectMonth->height())))) 337 if(popup->exec(selectYear->mapToGlobal(QPoint(0, selectMonth->height()))))
338 { 338 {
339 QDate date; 339 QDate date;
340 int day; 340 int day;
341 // ----- 341 // -----
342 year=picker->getYear(); 342 year=picker->getYear();
343 date=table->getDate(); 343 date=table->getDate();
344 day=date.day(); 344 day=date.day();
345 // ----- construct a valid date in this month: 345 // ----- construct a valid date in this month:
346 date.setYMD(year, date.month(), 1); 346 date.setYMD(year, date.month(), 1);
347 date.setYMD(year, date.month(), QMIN(day, date.daysInMonth())); 347 date.setYMD(year, date.month(), QMIN(day, date.daysInMonth()));
348 // ----- set this month 348 // ----- set this month
349 setDate(date); 349 setDate(date);
350 } else { 350 } else {
351 KNotifyClient::beep(); 351 KNotifyClient::beep();
352 } 352 }
353 delete popup; 353 delete popup;
354} 354}
355 355
356void 356void
357KDatePicker::setEnabled(bool enable) 357KDatePicker::setEnabled(bool enable)
358{ 358{
359 QWidget *widgets[]= { 359 QWidget *widgets[]= {
360 yearForward, yearBackward, monthForward, monthBackward, 360 yearForward, yearBackward, monthForward, monthBackward,
361 selectMonth, selectYear, 361 selectMonth, selectYear,
362 lineDate, table }; 362 lineDate, table };
363 const int Size=sizeof(widgets)/sizeof(widgets[0]); 363 const int Size=sizeof(widgets)/sizeof(widgets[0]);
364 int count; 364 int count;
365 // ----- 365 // -----
366 for(count=0; count<Size; ++count) 366 for(count=0; count<Size; ++count)
367 { 367 {
368 widgets[count]->setEnabled(enable); 368 widgets[count]->setEnabled(enable);
369 } 369 }
370} 370}
371 371
372void 372void
373KDatePicker::lineEnterPressed() 373KDatePicker::lineEnterPressed()
374{ 374{
375 QDate temp; 375 QDate temp;
376 // ----- 376 // -----
377 temp = lineDate->date(); 377 temp = lineDate->date();
378 //if(val->date(line->text(), temp)==QValidator::Acceptable) 378 //if(val->date(line->text(), temp)==QValidator::Acceptable)
379 //{ 379 //{
380 emit(dateEntered(temp)); 380 emit(dateEntered(temp));
381 setDate(temp); 381 setDate(temp);
382 // } else { 382 // } else {
383// KNotifyClient::beep(); 383// KNotifyClient::beep();
384// } 384// }
385} 385}
386 386
387QSize 387QSize
388KDatePicker::sizeHint() const 388KDatePicker::sizeHint() const
389{ 389{
390 QSize tableSize=table->sizeHint(); 390 QSize tableSize=table->sizeHint();
391 QWidget *buttons[]={ 391 QWidget *buttons[]={
392 yearBackward, 392 yearBackward,
393 monthBackward, 393 monthBackward,
394 selectMonth, 394 selectMonth,
395 selectYear, 395 selectYear,
396 monthForward, 396 monthForward,
397 yearForward }; 397 yearForward };
398 const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); 398 const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]);
399 QSize sizes[NoOfButtons]; 399 QSize sizes[NoOfButtons];
400 int cx=0, cy=0, count; 400 int cx=0, cy=0, count;
401 // ----- store the size hints: 401 // ----- store the size hints:
402 for(count=0; count<NoOfButtons; ++count) 402 for(count=0; count<NoOfButtons; ++count)
403 { 403 {
404 sizes[count]=buttons[count]->sizeHint(); 404 sizes[count]=buttons[count]->sizeHint();
405 if(buttons[count]==selectMonth) 405 if(buttons[count]==selectMonth)
406 { 406 {
407 cx+=maxMonthRect.width()+15; 407 cx+=maxMonthRect.width()+15;
408 } else { 408 } else {
409 cx+=sizes[count].width()+15; 409 cx+=sizes[count].width()+15;
410 } 410 }
411 cy=QMAX(sizes[count].height(), cy); 411 cy=QMAX(sizes[count].height(), cy);
412 } 412 }
413 // ----- calculate width hint: 413 // ----- calculate width hint:
414 cx=QMAX(cx, tableSize.width()); // line edit ignored 414 cx=QMAX(cx, tableSize.width()); // line edit ignored
415 if ( cx > QApplication::desktop()->width() -5 ) 415 if ( cx > QApplication::desktop()->width() -5 )
416 cx = QApplication::desktop()->width() -5; 416 cx = QApplication::desktop()->width() -5;
417 // ----- calculate height hint: 417 // ----- calculate height hint:
418 cy+=tableSize.height()+lineDate->sizeHint().height(); 418 cy+=tableSize.height()+lineDate->sizeHint().height();
419 419
420 return QSize(cx, cy); 420 return QSize(cx, cy);
421} 421}
422 422
423void 423void
424KDatePicker::setFontSize(int s) 424KDatePicker::setFontSize(int s)
425{ 425{
426 QWidget *buttons[]= { 426 QWidget *buttons[]= {
427 // yearBackward, 427 // yearBackward,
428 // monthBackward, 428 // monthBackward,
429 selectMonth, 429 selectMonth,
430 selectYear, 430 selectYear,
431 // monthForward, 431 // monthForward,
432 // yearForward 432 // yearForward
433 }; 433 };
434 const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]); 434 const int NoOfButtons=sizeof(buttons)/sizeof(buttons[0]);
435 int count; 435 int count;
436 QFont font; 436 QFont font;
437 QRect r; 437 QRect r;
438 // ----- 438 // -----
439 fontsize=s; 439 fontsize=s;
440 for(count=0; count<NoOfButtons; ++count) 440 for(count=0; count<NoOfButtons; ++count)
441 { 441 {
442 font=buttons[count]->font(); 442 font=buttons[count]->font();
443 font.setPointSize(s); 443 font.setPointSize(s);
444 buttons[count]->setFont(font); 444 buttons[count]->setFont(font);
445 } 445 }
446 QFontMetrics metrics(selectMonth->fontMetrics()); 446 QFontMetrics metrics(selectMonth->fontMetrics());
447 for(int i=1; i <= 12; ++i) 447 for(int i=1; i <= 12; ++i)
448 { // maxMonthRect is used by sizeHint() 448 { // maxMonthRect is used by sizeHint()
449 r=metrics.boundingRect(KGlobal::locale()->monthName(i, false)); 449 r=metrics.boundingRect(KGlobal::locale()->monthName(i, false));
450 maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width())); 450 maxMonthRect.setWidth(QMAX(r.width(), maxMonthRect.width()));
451 maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height())); 451 maxMonthRect.setHeight(QMAX(r.height(), maxMonthRect.height()));
452 } 452 }
453 table->setFontSize(s); 453 table->setFontSize(s);
454} 454}
455 455
456void KDatePicker::virtual_hook( int id, void* data ) 456void KDatePicker::virtual_hook( int id, void* data )
457{ /*BASE::virtual_hook( id, data );*/ } 457{ /*BASE::virtual_hook( id, data );*/ }
458 458
459void KDatePicker::keyPressEvent ( QKeyEvent * e ) 459void KDatePicker::keyPressEvent ( QKeyEvent * e )
460{ 460{
461 switch ( e->key() ) { 461 switch ( e->key() ) {
462 case Qt::Key_Right: 462 case Qt::Key_Right:
463 monthForwardClicked(); 463 monthForwardClicked();
464 break; 464 break;
465 case Qt::Key_Left: 465 case Qt::Key_Left:
466 monthBackwardClicked(); 466 monthBackwardClicked();
467 break; 467 break;
468 468
469 case Qt::Key_Down: 469 case Qt::Key_Down:
470 yearForwardClicked(); 470 yearForwardClicked();
471 471
472 break; 472 break;
473 473
474 case Qt::Key_Up: 474 case Qt::Key_Up:
475 yearBackwardClicked(); 475 yearBackwardClicked();
476 break; 476 break;
477 477
478 case Qt::Key_Return: 478 case Qt::Key_Return:
479 case Qt::Key_Enter:
479 tableClickedSlot(); 480 tableClickedSlot();
480 break; 481 break;
481 case Qt::Key_Escape: 482 case Qt::Key_Escape:
482 e->ignore(); 483 e->ignore();
483 break; 484 break;
484 default: 485 default:
485 break; 486 break;
486 } 487 }
487 488
488} 489}