summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-07 20:46:00 (UTC)
committer zautrix <zautrix>2005-07-07 20:46:00 (UTC)
commitde5621f2fd3924f27c05459ae555b3bd06c5e584 (patch) (unidiff)
tree589d19415e3c0ff6c08cec375db145242581c143
parent766b53919de14b8faec22db32b6a750acde0b760 (diff)
downloadkdepimpi-de5621f2fd3924f27c05459ae555b3bd06c5e584.zip
kdepimpi-de5621f2fd3924f27c05459ae555b3bd06c5e584.tar.gz
kdepimpi-de5621f2fd3924f27c05459ae555b3bd06c5e584.tar.bz2
fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt13
-rw-r--r--korganizer/calendarview.cpp153
-rw-r--r--korganizer/kotodoview.cpp16
-rw-r--r--libkcal/event.cpp115
-rw-r--r--libkcal/event.h2
-rw-r--r--libkcal/incidencebase.cpp8
-rw-r--r--libkcal/incidencebase.h4
7 files changed, 243 insertions, 68 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index b225594..43bc343 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1,1520 +1,1517 @@
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{ "Port number (Default: %1)","Port Nummer (Default: %1)" }, 960{ "Port number (Default: %1)","Port Nummer (Default: %1)" },
961{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, 961{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" },
962{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, 962{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" },
963{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, 963{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" },
964{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, 964{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" },
965{ "Disable Pi-Sync","Schalte Pi-Sync aus" }, 965{ "Disable Pi-Sync","Schalte Pi-Sync aus" },
966{ "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{ "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!" },
967{ "KDE-Pim Sync","KDE-Pim Sync" }, 967{ "KDE-Pim Sync","KDE-Pim Sync" },
968{ "Multiple profiles","Multi-Sync Profile" }, 968{ "Multiple profiles","Multi-Sync Profile" },
969{ "Device: ","Gerät: " }, 969{ "Device: ","Gerät: " },
970{ "Multiple sync started.","Multi-Sync gestartet." }, 970{ "Multiple sync started.","Multi-Sync gestartet." },
971{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, 971{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" },
972{ "Turn filter on","Schalte Filter an" }, 972{ "Turn filter on","Schalte Filter an" },
973{ "Turn filter off","Schalte Filter aus" }, 973{ "Turn filter off","Schalte Filter aus" },
974{ "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, 974{ "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" },
975{ "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, 975{ "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" },
976{ "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, 976{ "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" },
977{ "<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>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" },
978{ "<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>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" },
979{ "<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>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n","<p><b>Blau</b>: Wiederholender Termin.([r] in Whats'Next Ansicht)</p>\n" },
980{ "<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>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n","<p><b>Rot</b>: Alarm gesetzt.([a] in Whats'Next Ansicht)</p>\n" },
981{ "<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>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n","<p><b>Kreuz</b>: Eintrag gecancelt.([c] in Whats'Next Ansicht)</p>\n" },
982{ "<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><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" },
983{ "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, 983{ "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" },
984{ "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, 984{ "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" },
985{ "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, 985{ "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" },
986{ "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, 986{ "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" },
987{ "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, 987{ "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" },
988{ "<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>shift+up/down</b>: Goto first/last item</p>\n","<p><b>shift+up/down</b>: Gehe zum ersten/letzten Eintrag</p>\n" },
989{ "<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>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" },
990{ "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, 990{ "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" },
991{ "<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+shift</b>: Deselect item+one step down</p>\n","<p><b>return+shift</b>: Deselektiere Item+Cursor einen Eintrag runter</p>\n" },
992{ "<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>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" },
993{ "<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><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" },
994{ "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, 994{ "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" },
995{ "<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+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" },
996{ "<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>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" },
997{ "<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>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" },
998{ "<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+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" },
999{ "<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+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" },
1000{ "<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><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" },
1001{ "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, 1001{ "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" },
1002{ "<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>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" },
1003{ "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, 1003{ "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" },
1004{ "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, 1004{ "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" },
1005{ "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, 1005{ "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" },
1006{ "<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>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" },
1007{ "<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>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" },
1008{ "<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>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" },
1009{ "<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>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" },
1010{ "<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>+,-</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" },
1011{ "<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>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" },
1012{ "<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>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" },
1013{ "<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>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" },
1014{ "<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>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" },
1015{ "<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>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" },
1016{ "<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>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" },
1017{ "<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>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 " },
1018{ "<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>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" },
1019{ "<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>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" },
1020{ "<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>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n","<p><b>Space</b>: Zeige fullscreen | <b>P</b>: Datums Picker</p>\n" },
1021{ "<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>I</b>: Show info for selected event/todo</p>\n","<p><b>I</b>: Zeige Info (Details) für selektiertes Item</p>\n" },
1022{ "<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><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" },
1023{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, 1023{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" },
1024{ "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{ "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" },
1025{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, 1025{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" },
1026{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, 1026{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" },
1027{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, 1027{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" },
1028{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, 1028{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" },
1029{ "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{ "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" },
1030{ "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{ "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" },
1031{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, 1031{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" },
1032{ "KO/Pi FAQ","KO/Pi FAQ" }, 1032{ "KO/Pi FAQ","KO/Pi FAQ" },
1033{ "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, 1033{ "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" },
1034{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, 1034{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" },
1035{ "About KOrganizer/Pi","Über KOrganizer/Pi" }, 1035{ "About KOrganizer/Pi","Über KOrganizer/Pi" },
1036{ "From: ","Von: " }, 1036{ "From: ","Von: " },
1037{ "Remove sync info","Entferne Sync Info" }, 1037{ "Remove sync info","Entferne Sync Info" },
1038{ "For all profiles","Für alle Profile" }, 1038{ "For all profiles","Für alle Profile" },
1039{ "Hide not Running","Verstecke nicht Laufende" }, 1039{ "Hide not Running","Verstecke nicht Laufende" },
1040{ "ME","ME" }, 1040{ "ME","ME" },
1041{ "Toolbar","Toolbar" }, 1041{ "Toolbar","Toolbar" },
1042{ "Undo Delete...","UNDO Löschen..." }, 1042{ "Undo Delete...","UNDO Löschen..." },
1043{ "Undo Delete","Löschen rückgängig machen" }, 1043{ "Undo Delete","Löschen rückgängig machen" },
1044{ "KDE Sync HowTo...","KDE Sync HowTo..." }, 1044{ "KDE Sync HowTo...","KDE Sync HowTo..." },
1045{ "Multi Sync HowTo...","Multi Sync HowTo..." }, 1045{ "Multi Sync HowTo...","Multi Sync HowTo..." },
1046{ "Januar","Januar" }, 1046{ "Januar","Januar" },
1047{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, 1047{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" },
1048{ "No Filter","Kein Filter" }, 1048{ "No Filter","Kein Filter" },
1049{ "Multiple Sync options","Multi Sync Optionen" }, 1049{ "Multiple Sync options","Multi Sync Optionen" },
1050{ "Sync algo options","Sync Ablauf Optionen" }, 1050{ "Sync algo options","Sync Ablauf Optionen" },
1051{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, 1051{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
1052{ "Incoming calendar filter:","Eingehender Kalender Filter:" }, 1052{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
1053{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, 1053{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" },
1054{ "Write back options","Optionen zum Zurückschreiben" }, 1054{ "Write back options","Optionen zum Zurückschreiben" },
1055{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, 1055{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" },
1056{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, 1056{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" },
1057{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, 1057{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" },
1058{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, 1058{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" },
1059{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, 1059{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" },
1060{ "Time period","Zeitspanne" }, 1060{ "Time period","Zeitspanne" },
1061{ "From ","Von " }, 1061{ "From ","Von " },
1062{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, 1062{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " },
1063{ " weeks in the future "," Wochen in der Zukunft " }, 1063{ " weeks in the future "," Wochen in der Zukunft " },
1064{ "Profile kind specific settings","Profil Art abhängige Einstellungen" }, 1064{ "Profile kind specific settings","Profil Art abhängige Einstellungen" },
1065{ "Local temp file:","Lokale temp Datei:" }, 1065{ "Local temp file:","Lokale temp Datei:" },
1066{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, 1066{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" },
1067{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, 1067{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" },
1068{ "Language","Sprache" }, 1068{ "Language","Sprache" },
1069{ "Time Format","Zeit Format" }, 1069{ "Time Format","Zeit Format" },
1070{ "Time Zone","Zeit Zone" }, 1070{ "Time Zone","Zeit Zone" },
1071{ "%1 groups subscribed","%1 Guppen abboniert" }, 1071{ "%1 groups subscribed","%1 Guppen abboniert" },
1072{ "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{ "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" },
1073{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, 1073{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
1074{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, 1074{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
1075{ "Save settings","Speichere Einstellungen" }, 1075{ "Save settings","Speichere Einstellungen" },
1076{ "Save standard","Speichere Standard" }, 1076{ "Save standard","Speichere Standard" },
1077{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, 1077{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
1078{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, 1078{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
1079{ "Data storage path","Daten Speicherpfad" }, 1079{ "Data storage path","Daten Speicherpfad" },
1080{ "Language","Sprache" }, 1080{ "Language","Sprache" },
1081{ "Show time in agenda items","Zeige Zeit in Agenda Items" }, 1081{ "Show time in agenda items","Zeige Zeit in Agenda Items" },
1082{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, 1082{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" },
1083{ "Show events that are done","Zeige abgelaufene Termine" }, 1083{ "Show events that are done","Zeige abgelaufene Termine" },
1084{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, 1084{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" },
1085{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, 1085{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" },
1086{ "KO/Pi","KO/Pi" }, 1086{ "KO/Pi","KO/Pi" },
1087{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, 1087{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" },
1088{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, 1088{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." },
1089{ "Sound.Al.: ","Sound.Al.: " }, 1089{ "Sound.Al.: ","Sound.Al.: " },
1090{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, 1090{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" },
1091{ "Restore","Wiederherstellen" }, 1091{ "Restore","Wiederherstellen" },
1092{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" }, 1092{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" },
1093{ "% completed","% erledigt" }, 1093{ "% completed","% erledigt" },
1094{ "%d item(s) found.","%d Item(s) gefunden." }, 1094{ "%d item(s) found.","%d Item(s) gefunden." },
1095{ "Set complete","Setze auf erledigt" }, 1095{ "Set complete","Setze auf erledigt" },
1096{ "(cancelled)","(gecancelt)" }, 1096{ "(cancelled)","(gecancelt)" },
1097{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, 1097{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" },
1098{ " Local time "," Lokale Zeit " }, 1098{ " Local time "," Lokale Zeit " },
1099{ "Form2","Form2" }, 1099{ "Form2","Form2" },
1100{ "Filter enabled","Filter angeschaltet" }, 1100{ "Filter enabled","Filter angeschaltet" },
1101{ "Edit Filters","Ändere Filter" }, 1101{ "Edit Filters","Ändere Filter" },
1102{ "Print What's Next View...","Drucke What's Next Ansicht..." }, 1102{ "Print What's Next View...","Drucke What's Next Ansicht..." },
1103{ "Agenda","Agenda" }, 1103{ "Agenda","Agenda" },
1104{ " ("," (" }, 1104{ " ("," (" },
1105{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, 1105{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" },
1106{ "Print","Print" }, 1106{ "Print","Print" },
1107{ "&Setup Printer...","Drucker &Setup..." }, 1107{ "&Setup Printer...","Drucker &Setup..." },
1108{ "View Type","Zeige Typ" }, 1108{ "View Type","Zeige Typ" },
1109{ "Page &orientation:","Seiten Ausrichtung:" }, 1109{ "Page &orientation:","Seiten Ausrichtung:" },
1110{ "Use Default of Selected Style","Default des selektierten Stils" }, 1110{ "Use Default of Selected Style","Default des selektierten Stils" },
1111{ "Use Default Setting of Printer","Default Einstellung des Druckers" }, 1111{ "Use Default Setting of Printer","Default Einstellung des Druckers" },
1112{ "Portrait","Portrait" }, 1112{ "Portrait","Portrait" },
1113{ "Landscape","Landschaft" }, 1113{ "Landscape","Landschaft" },
1114{ "Print day","Drucke Tag" }, 1114{ "Print day","Drucke Tag" },
1115{ "CalPrintDay_Base","CalPrintDay_Base" }, 1115{ "CalPrintDay_Base","CalPrintDay_Base" },
1116{ "Date && Time Range","Datum && Zeitspanne" }, 1116{ "Date && Time Range","Datum && Zeitspanne" },
1117{ "&End date:","&Enddatum:" }, 1117{ "&End date:","&Enddatum:" },
1118{ "&Start date:","&Startdatum:" }, 1118{ "&Start date:","&Startdatum:" },
1119{ "Start &time:","Startzeit:" }, 1119{ "Start &time:","Startzeit:" },
1120{ "End ti&me:","Endzeit:" }, 1120{ "End ti&me:","Endzeit:" },
1121{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, 1121{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" },
1122{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, 1122{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" },
1123{ "Alt+D","Alt+D" }, 1123{ "Alt+D","Alt+D" },
1124{ "&Use colors","Nutze Farben" }, 1124{ "&Use colors","Nutze Farben" },
1125{ "Alt+U","Alt+U" }, 1125{ "Alt+U","Alt+U" },
1126{ "Print week","Drucke Woche" }, 1126{ "Print week","Drucke Woche" },
1127{ "CalPrintWeek_Base","CalPrintWeek_Base" }, 1127{ "CalPrintWeek_Base","CalPrintWeek_Base" },
1128{ "Use &colors","Nutze Farben" }, 1128{ "Use &colors","Nutze Farben" },
1129{ "Type of View","Typ der Ansicht" }, 1129{ "Type of View","Typ der Ansicht" },
1130{ "Print as &Filofax page","Drucke als &Filofax Seite" }, 1130{ "Print as &Filofax page","Drucke als &Filofax Seite" },
1131{ "Alt+F","Alt+F" }, 1131{ "Alt+F","Alt+F" },
1132{ "Print as &timetable view:","Drucke als Zeittabelle:" }, 1132{ "Print as &timetable view:","Drucke als Zeittabelle:" },
1133{ "Alt+T","Alt+T" }, 1133{ "Alt+T","Alt+T" },
1134{ "Print as split week view","Drucke als gesplittete Wochenansicht" }, 1134{ "Print as split week view","Drucke als gesplittete Wochenansicht" },
1135{ "Print month","Drucke Monat" }, 1135{ "Print month","Drucke Monat" },
1136{ "CalPrintMonth_Base","CalPrintMonth_Base" }, 1136{ "CalPrintMonth_Base","CalPrintMonth_Base" },
1137{ "&Start month:","&Startmonat:" }, 1137{ "&Start month:","&Startmonat:" },
1138{ "&End month:","&Endmonat:" }, 1138{ "&End month:","&Endmonat:" },
1139{ "Print week &numbers","Drucke Wochen Nummer(n)" }, 1139{ "Print week &numbers","Drucke Wochen Nummer(n)" },
1140{ "Print todos","Drucke Todos" }, 1140{ "Print todos","Drucke Todos" },
1141{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, 1141{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" },
1142{ "Include &description of the item","Inclusive Itembeschreibung" }, 1142{ "Include &description of the item","Inclusive Itembeschreibung" },
1143{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, 1143{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" },
1144{ "Include &priority of the item","Inclusive Priorität des Items" }, 1144{ "Include &priority of the item","Inclusive Priorität des Items" },
1145{ "Items to Print","Zu druckende Items" }, 1145{ "Items to Print","Zu druckende Items" },
1146{ "&From:","Von:" }, 1146{ "&From:","Von:" },
1147{ "&To:","Bis:" }, 1147{ "&To:","Bis:" },
1148{ "Print &all todo items","Drucke alle Todo Items" }, 1148{ "Print &all todo items","Drucke alle Todo Items" },
1149{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, 1149{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" },
1150{ "Only items due in the &range:","Nur Items in dem Zeitraum:" }, 1150{ "Only items due in the &range:","Nur Items in dem Zeitraum:" },
1151{ "Todo List","Todo Liste" }, 1151{ "Todo List","Todo Liste" },
1152{ "&Title:","&Titel:" }, 1152{ "&Title:","&Titel:" },
1153{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, 1153{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" },
1154{ "Todo list","Todo Liste" }, 1154{ "Todo list","Todo Liste" },
1155{ "&Print...","Drucke..." }, 1155{ "&Print...","Drucke..." },
1156{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, 1156{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" },
1157{ "[Unconfigured]","[Unkonfiguriert]" }, 1157{ "[Unconfigured]","[Unkonfiguriert]" },
1158{ "OK","OK" }, 1158{ "OK","OK" },
1159{ "FilterEditor","FilterEditor" }, 1159{ "FilterEditor","FilterEditor" },
1160{ "Include","Inclusive" }, 1160{ "Include","Inclusive" },
1161{ "Exclude","Exclusive" }, 1161{ "Exclude","Exclusive" },
1162{ "Edit Selection...","Editiere Auswahl" }, 1162{ "Edit Selection...","Editiere Auswahl" },
1163{ "recurring events","wiederholende Termine" }, 1163{ "recurring events","wiederholende Termine" },
1164{ "recurr. events","wiederh.Termine" }, 1164{ "recurr. events","wiederh.Termine" },
1165{ "completed to-dos","erledigte Todos" }, 1165{ "completed to-dos","erledigte Todos" },
1166{ "events","Termine" }, 1166{ "events","Termine" },
1167{ "todos","Todos" }, 1167{ "todos","Todos" },
1168{ "journals","Journale" }, 1168{ "journals","Journale" },
1169{ "public","öffentl." }, 1169{ "public","öffentl." },
1170{ "private","privat" }, 1170{ "private","privat" },
1171{ "confidential","vertraul." }, 1171{ "confidential","vertraul." },
1172{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, 1172{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" },
1173{ "Yesterday","Gestern" }, 1173{ "Yesterday","Gestern" },
1174{ "Day after tomorrow","Übermorgen" }, 1174{ "Day after tomorrow","Übermorgen" },
1175{ "Tomorrow","Morgen" }, 1175{ "Tomorrow","Morgen" },
1176{ "Day before yesterday","Vorgestern" }, 1176{ "Day before yesterday","Vorgestern" },
1177{ "Size %1","Größe %1" }, 1177{ "Size %1","Größe %1" },
1178{ "New Agendasize: %1","Neue Agendagröße: %1" }, 1178{ "New Agendasize: %1","Neue Agendagröße: %1" },
1179{ " (%1 y.)"," (%1 J.)" }, 1179{ " (%1 y.)"," (%1 J.)" },
1180{ "Allday:","Ganztägig:" }, 1180{ "Allday:","Ganztägig:" },
1181{ "compl.todos","erled.Todos" }, 1181{ "compl.todos","erled.Todos" },
1182{ "Day view","Tagesansicht" }, 1182{ "Day view","Tagesansicht" },
1183{ "Next days","Nächste Tage" }, 1183{ "Next days","Nächste Tage" },
1184{ "Next week","Nächste Woche" }, 1184{ "Next week","Nächste Woche" },
1185{ "Next two weeks","Nächste zwei Wochen" }, 1185{ "Next two weeks","Nächste zwei Wochen" },
1186{ "This month","Dieser Monat" }, 1186{ "This month","Dieser Monat" },
1187{ "Journal view","Journal" }, 1187{ "Journal view","Journal" },
1188{ "Display all opened","Zeige alle geöffnet" }, 1188{ "Display all opened","Zeige alle geöffnet" },
1189{ "Display all closed","Zeige alle geschlossen" }, 1189{ "Display all closed","Zeige alle geschlossen" },
1190{ "Display all flat","Zeige alle flach" }, 1190{ "Display all flat","Zeige alle flach" },
1191{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, 1191{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
1192{ "Default todo done color:","Standard Todo erledigt Farbe" }, 1192{ "Default todo done color:","Standard Todo erledigt Farbe" },
1193{ "Select week %1-%2","Wähle Woche %1-%2" }, 1193{ "Select week %1-%2","Wähle Woche %1-%2" },
1194{ "Select Week","Wähle Woche" }, 1194{ "Select Week","Wähle Woche" },
1195{ "Set alarm...","Setze Alarm..." }, 1195{ "Set alarm...","Setze Alarm..." },
1196{ "Set Alarm!","Setze Alarm!" }, 1196{ "Set Alarm!","Setze Alarm!" },
1197{ "Changed alarm for %1 items","Alarm für %1 Items geändert" }, 1197{ "Changed alarm for %1 items","Alarm für %1 Items geändert" },
1198{ " and "," und " }, 1198{ " and "," und " },
1199{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, 1199{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
1200{ "Mail to selected","Mail an Ausgewählte" }, 1200{ "Mail to selected","Mail an Ausgewählte" },
1201{ "Mail to all","Mail an Alle" }, 1201{ "Mail to all","Mail an Alle" },
1202{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, 1202{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" },
1203{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, 1203{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" },
1204{ " on"," am" }, 1204{ " on"," am" },
1205{ " completed on "," erledigt am " }, 1205{ " completed on "," erledigt am " },
1206{ "Save as Event template","Speichere als Vorlage" }, 1206{ "Save as Event template","Speichere als Vorlage" },
1207{ "Load Event template","Lade Termin Vorlage" }, 1207{ "Load Event template","Lade Termin Vorlage" },
1208{ "Save as Journal template","Speichere als Journal Vorlage" }, 1208{ "Save as Journal template","Speichere als Journal Vorlage" },
1209{ "Insert Journal template","Füge Journal Vorlage ein" }, 1209{ "Insert Journal template","Füge Journal Vorlage ein" },
1210{ "Sub todos:<br>","Unter-Todos:<br>" }, 1210{ "Sub todos:<br>","Unter-Todos:<br>" },
1211{ "Parent todo:<br>","Über-Todo:<br>" }, 1211{ "Parent todo:<br>","Über-Todo:<br>" },
1212{ "Set current as color category","Setze Gewählte als Farbkategorie" }, 1212{ "Set current as color category","Setze Gewählte als Farbkategorie" },
1213{ " completed"," erledigt" }, 1213{ " completed"," erledigt" },
1214{ "(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{ "(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!" },
1215{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 1215{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
1216{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 1216{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
1217{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 1217{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
1218{ "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{ "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?" },
1219{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 1219{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
1220{ "Error","Fehler" }, 1220{ "Error","Fehler" },
1221{ ""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 Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
1222{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 1222{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
1223{ "Warning","Warnung" }, 1223{ "Warning","Warnung" },
1224{ "Select week number","Wähle Wochen Nummer" }, 1224{ "Select week number","Wähle Wochen Nummer" },
1225{ "Februar","Februar" }, 1225{ "Februar","Februar" },
1226{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, 1226{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" },
1227{ "W","W" }, 1227{ "W","W" },
1228{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, 1228{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" },
1229{ "T: %1","T: %1" }, 1229{ "T: %1","T: %1" },
1230{ "Start: ","Start: " }, 1230{ "Start: ","Start: " },
1231{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 1231{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
1232{ "Password for remote access:","Passwort für fernen Zugriff:" }, 1232{ "Password for remote access:","Passwort für fernen Zugriff:" },
1233{ "Remote IP address:","Ferne IP Adresse:" }, 1233{ "Remote IP address:","Ferne IP Adresse:" },
1234{ "Remote port number:","Ferne Port Nummer:" }, 1234{ "Remote port number:","Ferne Port Nummer:" },
1235{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 1235{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
1236{ "Remote from: ","Fern von: " }, 1236{ "Remote from: ","Fern von: " },
1237{ "Local from: ","Lokal von: " }, 1237{ "Local from: ","Lokal von: " },
1238{ "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{ "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" },
1239{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 1239{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
1240{ "Write back","Schreibe zurück" }, 1240{ "Write back","Schreibe zurück" },
1241{ "KO/Pi Synchronization","KO/Pi Synchronisation" }, 1241{ "KO/Pi Synchronization","KO/Pi Synchronisation" },
1242{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 1242{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
1243{ "Received sync request","Sync Anfrage erhalten" }, 1243{ "Received sync request","Sync Anfrage erhalten" },
1244{ "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{ "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." },
1245{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1245{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1246{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1246{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1247{ "Sending file...","Sende Datei..." }, 1247{ "Sending file...","Sende Datei..." },
1248{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1248{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1249{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1249{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1250{ "Received %1 bytes","%1 Bytes erhalten" }, 1250{ "Received %1 bytes","%1 Bytes erhalten" },
1251{ "Writing file to disk...","Speichere Datei..." }, 1251{ "Writing file to disk...","Speichere Datei..." },
1252{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1252{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1253{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1253{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1254{ "Synchronize!","Synchronisiere!" }, 1254{ "Synchronize!","Synchronisiere!" },
1255{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1255{ "High clock skew!","Großer Uhrzeitunterschied!" },
1256{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1256{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1257{ "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{ "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!" },
1258{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1258{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1259{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1259{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1260{ "List week view","Listenwochenansicht" }, 1260{ "List week view","Listenwochenansicht" },
1261{ "List week","Listenwochenansicht" }, 1261{ "List week","Listenwochenansicht" },
1262{ "Next Week","Nächste Woche" }, 1262{ "Next Week","Nächste Woche" },
1263{ "Previous Week","Vorherige Woche" }, 1263{ "Previous Week","Vorherige Woche" },
1264{ "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{ "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." },
1265{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1265{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1266{ "Details","Details" }, 1266{ "Details","Details" },
1267{ "Created time","Erstellt Zeit" }, 1267{ "Created time","Erstellt Zeit" },
1268{ "Last modified time","Geändert Zeit" }, 1268{ "Last modified time","Geändert Zeit" },
1269{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1269{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1270{ "View Options","Anzeige Optionen" }, 1270{ "View Options","Anzeige Optionen" },
1271{ "<b>Created: ","<b>Erstellt am: " }, 1271{ "<b>Created: ","<b>Erstellt am: " },
1272{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1272{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1273{ "Journal: ","Journal: " }, 1273{ "Journal: ","Journal: " },
1274{ "yearly","jährlich" }, 1274{ "yearly","jährlich" },
1275{ "(%1) ","%1-" }, 1275{ "(%1) ","%1-" },
1276{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1276{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1277{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1277{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1278{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1278{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1279{ "Summary/Loc.","Titel/Ort" }, 1279{ "Summary/Loc.","Titel/Ort" },
1280{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1280{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1281{ "Week Number","Wochennummer" }, 1281{ "Week Number","Wochennummer" },
1282{ "Import","Importiere" }, 1282{ "Import","Importiere" },
1283{ "Export","Exportiere" }, 1283{ "Export","Exportiere" },
1284{ "Beam","Beame" }, 1284{ "Beam","Beame" },
1285{ "Export","Exportiere" }, 1285{ "Export","Exportiere" },
1286{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1286{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1287{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1287{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1288{ "Journal/Details...","Journale/Details..." }, 1288{ "Journal/Details...","Journale/Details..." },
1289{ "Agenda View","Agenda Ansicht" }, 1289{ "Agenda View","Agenda Ansicht" },
1290{ "Show current time","Zeige aktuelle Zeit" }, 1290{ "Show current time","Zeige aktuelle Zeit" },
1291{ "Edit new item","Bearbeite neuen Eintrag" }, 1291{ "Edit new item","Bearbeite neuen Eintrag" },
1292{ "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{ "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" },
1293{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, 1293{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1294{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, 1294{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1295{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, 1295{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" },
1296{ "%1 days\n","%1 Tagen\n" }, 1296{ "%1 days\n","%1 Tagen\n" },
1297{ "1 day\n","1 Tag\n" }, 1297{ "1 day\n","1 Tag\n" },
1298{ "%1 hours\n","%1 Stunden\n" }, 1298{ "%1 hours\n","%1 Stunden\n" },
1299{ "1 hour\n","1 Stunde\n" }, 1299{ "1 hour\n","1 Stunde\n" },
1300{ "%1 minutes\n","%1 Minuten\n" }, 1300{ "%1 minutes\n","%1 Minuten\n" },
1301{ "1 minute\n","1 Minute\n" }, 1301{ "1 minute\n","1 Minute\n" },
1302{ "Only one toolbar","Nur eine Toolbar" }, 1302{ "Only one toolbar","Nur eine Toolbar" },
1303{ "Print","Drucke" }, 1303{ "Print","Drucke" },
1304{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, 1304{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
1305{ "There is nothing selected!","Es ist nichts ausgewählt!" }, 1305{ "There is nothing selected!","Es ist nichts ausgewählt!" },
1306{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, 1306{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
1307{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, 1307{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
1308{ "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{ "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" },
1309{ "KO/Pi Printout","KO/Pi Ausdruck" }, 1309{ "KO/Pi Printout","KO/Pi Ausdruck" },
1310{ "Print unscaled","Drucke unskaliert" }, 1310{ "Print unscaled","Drucke unskaliert" },
1311{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, 1311{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." },
1312{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, 1312{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." },
1313{ "Printout Mode","Druck Modus" }, 1313{ "Printout Mode","Druck Modus" },
1314{ "Filter menu icon","Filtermenu Icon" }, 1314{ "Filter menu icon","Filtermenu Icon" },
1315{ "<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>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" },
1316{ "<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{ "<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" },
1317{ "%1d","%1t" }, 1317{ "%1d","%1t" },
1318{ "%1h","%1std" }, 1318{ "%1h","%1std" },
1319{ "%1min","%1min" }, 1319{ "%1min","%1min" },
1320{ "( %1 before )","( %1 vorher )" }, 1320{ "( %1 before )","( %1 vorher )" },
1321{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, 1321{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" },
1322{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, 1322{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" },
1323{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, 1323{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." },
1324{ "Show Sync Events","Zeige Sync-Ereignisse" }, 1324{ "Show Sync Events","Zeige Sync-Ereignisse" },
1325{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, 1325{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" },
1326{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, 1326{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" },
1327{ " on "," am " }, 1327{ " on "," am " },
1328{ "On: ","Am: " }, 1328{ "On: ","Am: " },
1329{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, 1329{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" },
1330{ "Start/Stop todo...","Starte/Stoppe Todo..." }, 1330{ "Start/Stop todo...","Starte/Stoppe Todo..." },
1331{ "Color for running todos:","Farbe für laufende Todos:" }, 1331{ "Color for running todos:","Farbe für laufende Todos:" },
1332{ "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{ "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?" },
1333{ "Todo is started","Todo ist gestartet" }, 1333{ "Todo is started","Todo ist gestartet" },
1334{ "Stop todo","Stoppe Todo" }, 1334{ "Stop todo","Stoppe Todo" },
1335{ "Todo is stopped","Todo ist gestoppt" }, 1335{ "Todo is stopped","Todo ist gestoppt" },
1336{ "Start todo","Starte Todo" }, 1336{ "Start todo","Starte Todo" },
1337{ "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\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" },
1338{ "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{ "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?" },
1339{ "Todo has subtodos","Todo hat Untertodos" }, 1339{ "Todo has subtodos","Todo hat Untertodos" },
1340{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, 1340{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" },
1341{ "Colors","Farben" }, 1341{ "Colors","Farben" },
1342{ "Click on new parent item","Klicke auf neues Übertodo" }, 1342{ "Click on new parent item","Klicke auf neues Übertodo" },
1343{ "Reparenting aborted!","Übertodo setzen abgebrochen" }, 1343{ "Reparenting aborted!","Übertodo setzen abgebrochen" },
1344{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, 1344{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" },
1345{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, 1345{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" },
1346{ "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{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
1347{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, 1347{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
1348{ "times","Zeiten" }, 1348{ "times","Zeiten" },
1349{ "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{ "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?" },
1350{ "Backup enabled","Backup angeschaltet" }, 1350{ "Backup enabled","Backup angeschaltet" },
1351{ "Use standard backup dir","Standard Backupverzeichnis" }, 1351{ "Use standard backup dir","Standard Backupverzeichnis" },
1352{ "Number of Backups:","Anzahl der Backups" }, 1352{ "Number of Backups:","Anzahl der Backups" },
1353{ "Make backup every ","Mache ein Backup alle " }, 1353{ "Make backup every ","Mache ein Backup alle " },
1354{ " days"," Tage" }, 1354{ " days"," Tage" },
1355{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, 1355{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." },
1356{ "Backup Failed!","Backup Problem!" }, 1356{ "Backup Failed!","Backup Problem!" },
1357{ "Try again now","Versuche jetzt nochmal" }, 1357{ "Try again now","Versuche jetzt nochmal" },
1358{ "Try again later","Versuche später nochmal" }, 1358{ "Try again later","Versuche später nochmal" },
1359{ "Try again tomorrow","Versuche morgen nochmal" }, 1359{ "Try again tomorrow","Versuche morgen nochmal" },
1360{ "Disable backup","Schalte Backup ab" }, 1360{ "Disable backup","Schalte Backup ab" },
1361{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, 1361{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
1362{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, 1362{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
1363{ "Choose action","Wähle Aktion" }, 1363{ "Choose action","Wähle Aktion" },
1364{ "Comment for todo:","Kommentar zum Todo:" }, 1364{ "Comment for todo:","Kommentar zum Todo:" },
1365{ "Stop+note","Stop+Notiz" }, 1365{ "Stop+note","Stop+Notiz" },
1366{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, 1366{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" },
1367{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, 1367{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" },
1368{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, 1368{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" },
1369{ "Print complete list...","Drucke komplette Liste..." }, 1369{ "Print complete list...","Drucke komplette Liste..." },
1370{ "Hide all selected","Verstecke Ausgewählte" }, 1370{ "Hide all selected","Verstecke Ausgewählte" },
1371{ "Add items","hinzufügen" }, 1371{ "Add items","hinzufügen" },
1372{ "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{ "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?" },
1373{ "Print List View...","Drucke Listenansicht..." }, 1373{ "Print List View...","Drucke Listenansicht..." },
1374{ "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{ "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." },
1375{ "Configure KO/Pi...","Konfiguriere KO/Pi..." }, 1375{ "Configure KO/Pi...","Konfiguriere KO/Pi..." },
1376{ "Global Settings...","Globale Einstellungen..." }, 1376{ "Global Settings...","Globale Einstellungen..." },
1377{ "<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{ "<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" },
1378{ "(disabled)","(abgeschaltet)" }, 1378{ "(disabled)","(abgeschaltet)" },
1379{ "New Calendar","Neuer Kalender" }, 1379{ "New Calendar","Neuer Kalender" },
1380{ "Calendar","Kalender" }, 1380{ "Calendar","Kalender" },
1381{ "Filter selector","Filterauswahl" }, 1381{ "Filter selector","Filterauswahl" },
1382{ "Filtermenu","Filtermenu" }, 1382{ "Filtermenu","Filtermenu" },
1383{ "Toggle Fullscreen","Vollbild umschalten" }, 1383{ "Toggle Fullscreen","Vollbild umschalten" },
1384{ "Toggle Resource View","Resourcenansicht umschalten" }, 1384{ "Toggle Resource View","Resourcenansicht umschalten" },
1385{ "Storage HowTo...","Speicherort HowTo..." }, 1385{ "Storage HowTo...","Speicherort HowTo..." },
1386{ "Timetracking HowTo...","Timetracking HowTo..." }, 1386{ "Timetracking HowTo...","Timetracking HowTo..." },
1387{ "Juni","Juni" }, 1387{ "Juni","Juni" },
1388{ "Juli","Juli" }, 1388{ "Juli","Juli" },
1389{ "ToDo:","ToDo:" }, 1389{ "ToDo:","ToDo:" },
1390{ "Set Calendar","Setze Kalender" }, 1390{ "Set Calendar","Setze Kalender" },
1391{ "Todo: %1","Todo: %1" }, 1391{ "Todo: %1","Todo: %1" },
1392{ ": (Prio ",": (Prio " }, 1392{ ": (Prio ",": (Prio " },
1393{ "Todos","Todos" }, 1393{ "Todos","Todos" },
1394{ "Todo Viewer","Todo Anzeige" }, 1394{ "Todo Viewer","Todo Anzeige" },
1395{ "Todo ","Todo " }, 1395{ "Todo ","Todo " },
1396{ " Calendar \n Resource "," Kalender \n Resource " }, 1396{ " Calendar \n Resource "," Kalender \n Resource " },
1397{ " Color "," Farbe " }, 1397{ " Color "," Farbe " },
1398{ "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>. 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!)" },
1399{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, 1399{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" },
1400{ "Add new Calendar","Füge Kalender hinzu" }, 1400{ "Add new Calendar","Füge Kalender hinzu" },
1401{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, 1401{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" },
1402{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, 1402{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" },
1403{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, 1403{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" },
1404{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, 1404{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" },
1405{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, 1405{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." },
1406{ "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{ "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>" },
1407{ "Global application font for all apps:","Globale Schriftart:" }, 1407{ "Global application font for all apps:","Globale Schriftart:" },
1408{ "Application Font","Applikationsschriftart" }, 1408{ "Application Font","Applikationsschriftart" },
1409{ "Kx/Pi","Kx/Pi" }, 1409{ "Kx/Pi","Kx/Pi" },
1410{ "Backup","Backup" }, 1410{ "Backup","Backup" },
1411{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, 1411{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" },
1412{ "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 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!" },
1413{ "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{ "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!" },
1414{ "Choose Color","Wähle Farbe" }, 1414{ "Choose Color","Wähle Farbe" },
1415{ " OK "," OK " }, 1415{ " OK "," OK " },
1416{ " Cancel "," Abbrechen " }, 1416{ " Cancel "," Abbrechen " },
1417{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, 1417{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" },
1418{ "Matching items will be removed from list","Passende werden von der Liste entfernt" }, 1418{ "Matching items will be removed from list","Passende werden von der Liste entfernt" },
1419{ "Search on displayed list only","Suche auf der dargestellten Liste" }, 1419{ "Search on displayed list only","Suche auf der dargestellten Liste" },
1420{ "List will be cleared before search","Liste wird vor der Suche gelöscht" }, 1420{ "List will be cleared before search","Liste wird vor der Suche gelöscht" },
1421{ "<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{ "<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>" },
1422{ "%1\nis running!","%1\nist am Laufen!" }, 1422{ "%1\nis running!","%1\nist am Laufen!" },
1423{ "Additional Comment:","Zusätzlicher Kommentar:" }, 1423{ "Additional Comment:","Zusätzlicher Kommentar:" },
1424{ "Stop and save","Stopp und Speichern" }, 1424{ "Stop and save","Stopp und Speichern" },
1425{ "Continue running","Weiter laufen lassen" }, 1425{ "Continue running","Weiter laufen lassen" },
1426{ "Stop - do not save","Stopp - nicht Speichern" }, 1426{ "Stop - do not save","Stopp - nicht Speichern" },
1427{ "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{ "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?" },
1428{ "Time mismatch!","Zeiten stimmen nicht!" }, 1428{ "Time mismatch!","Zeiten stimmen nicht!" },
1429{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, 1429{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" },
1430{ "Yes, stop todo","Ja, stoppe Todo" }, 1430{ "Yes, stop todo","Ja, stoppe Todo" },
1431{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, 1431{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" },
1432{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, 1432{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" },
1433{ "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{ "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." },
1434{ "Spouse","Ehegatte" }, 1434{ "Spouse","Ehegatte" },
1435{ "Notes","Notizen" }, 1435{ "Notes","Notizen" },
1436{ "Messanger","Messanger" }, 1436{ "Messanger","Messanger" },
1437{ "Assistant","Assistent" }, 1437{ "Assistant","Assistent" },
1438{ "Manager","Manager" }, 1438{ "Manager","Manager" },
1439{ "Secrecy","Sichtbar" }, 1439{ "Secrecy","Sichtbar" },
1440{ "male","männlich" }, 1440{ "male","männlich" },
1441{ "female","weiblich" }, 1441{ "female","weiblich" },
1442{ "Hide!","Verbergen!" }, 1442{ "Hide!","Verbergen!" },
1443{ "Show!","Anzeigen!" }, 1443{ "Show!","Anzeigen!" },
1444{ "Details","Details" }, 1444{ "Details","Details" },
1445{ "Profession","Beruf" }, 1445{ "Profession","Beruf" },
1446{ "Children","Kinder" }, 1446{ "Children","Kinder" },
1447{ "Department","Abteilung" }, 1447{ "Department","Abteilung" },
1448{ "Backup cancelled","Backup abgebrochen" }, 1448{ "Backup cancelled","Backup abgebrochen" },
1449{ "Backup globally disabled","Backup global abgeschaltet" }, 1449{ "Backup globally disabled","Backup global abgeschaltet" },
1450{ "Backup succesfully finished","Backup erfolgreich beendet" }, 1450{ "Backup succesfully finished","Backup erfolgreich beendet" },
1451{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, 1451{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" },
1452{ "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{ "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" },
1453{ "Birthdays","Geburtstage" }, 1453{ "Birthdays","Geburtstage" },
1454{ "KO/Pi import information!","KO/Pi Import Information!" }, 1454{ "KO/Pi import information!","KO/Pi Import Information!" },
1455{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, 1455{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" },
1456{ "Cancel - do not start"," Abbrechen - Todo nicht starten" }, 1456{ "Cancel - do not start"," Abbrechen - Todo nicht starten" },
1457{ "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{ "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?"" },
1458{ "Reload","Neu laden" }, 1458{ "Reload","Neu laden" },
1459{ "Timezone settings","Zeitzoneneinstellung" }, 1459{ "Timezone settings","Zeitzoneneinstellung" },
1460{ "Title: ","Titel: " }, 1460{ "Title: ","Titel: " },
1461{ "Journal from: ","Journal vom: " }, 1461{ "Journal from: ","Journal vom: " },
1462{ "Journal: %1 from ","Journal: %1 vom " }, 1462{ "Journal: %1 from ","Journal: %1 vom " },
1463{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, 1463{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" },
1464{ "Selected Item","Ausgewähltes Item" }, 1464{ "Selected Item","Ausgewähltes Item" },
1465{ "Select Date...","Wähle Datum..." }, 1465{ "Select Date...","Wähle Datum..." },
1466{ "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{ "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:" },
1467{ "Change category list now!","Ändere Kategorieliste jetzt!" }, 1467{ "Change category list now!","Ändere Kategorieliste jetzt!" },
1468{ "Edit category list...","Ändere Kategorieliste..." }, 1468{ "Edit category list...","Ändere Kategorieliste..." },
1469{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, 1469{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" },
1470{ "Filepath: ","Dateipfad: " }, 1470{ "Filepath: ","Dateipfad: " },
1471{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, 1471{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" },
1472{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, 1472{ "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" },
1473{ "Pending Suspend Alarm","Laufender Suspend Alarm" }, 1473{ "Pending Suspend Alarm","Laufender Suspend Alarm" },
1474{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, 1474{ "Error loading calendar %1","Fehler beim Laden von Kalender %1" },
1475{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, 1475{ "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" },
1476{ "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, 1476{ "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" },
1477{ "Alarm Options","Alarm Einstellungen" }, 1477{ "Alarm Options","Alarm Einstellungen" },
1478{ "Delete selected...","Lösche Ausgewählte..." }, 1478{ "Delete selected...","Lösche Ausgewählte..." },
1479{ "None","Nichts" }, 1479{ "None","Nichts" },
1480{ "Selection","Auswahl" }, 1480{ "Selection","Auswahl" },
1481{ "Set categories","Setze Kategorien" }, 1481{ "Set categories","Setze Kategorien" },
1482{ "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{ "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!" },
1483{ "Reset","Neu setzen" }, 1483{ "Reset","Neu setzen" },
1484{ "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{ "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)?" },
1485{ "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{ "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" },
1486{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, 1486{ "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" },
1487{ "\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{ "\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" },
1488{ "\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{ "\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" },
1489{ "Edit","Edit" }, 1489{ "Edit","Edit" },
1490{ "Last Modified","Zuletzt geändert" }, 1490{ "Last Modified","Zuletzt geändert" },
1491{ "Journal viewer","Journal Anzeige" }, 1491{ "Journal viewer","Journal Anzeige" },
1492{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, 1492{ "Configure Calendar Files...","Konfiguriere Kalenderdateien..." },
1493{ "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{ "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>." },
1494{ "Hide Completed","Verstecke erledigte Todos" }, 1494{ "Hide Completed","Verstecke erledigte Todos" },
1495{ "Show not Running","Zeige nicht Laufende" }, 1495{ "Show not Running","Zeige nicht Laufende" },
1496{ "Click to add new Todo","Klick für neues Todo!" }, 1496{ "Click to add new Todo","Klick für neues Todo!" },
1497{ "Show next conflict for","Zeige nächsten Konflikt für" }, 1497{ "Show next conflict for","Zeige nächsten Konflikt für" },
1498{ "All events","Alle Termine" }, 1498{ "All events","Alle Termine" },
1499{ "Allday events","Ganztagestermine" }, 1499{ "Allday events","Ganztagestermine" },
1500{ "Events with time","Termine mit Zeit" }, 1500{ "Events with time","Termine mit Zeit" },
1501{ "No conflict found within the next two years","Kein Konflikt innerhalb der nächsten zwei Jahre gefunden" }, 1501{ "No conflict found within the next two years","Kein Konflikt innerhalb der nächsten zwei Jahre gefunden" },
1502{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" }, 1502{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" },
1503{ "<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{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " },
1504{ "Week view mode uses row layout","Wochenansicht Modus nutzt Reihenlayout" },
1505{ "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" },
1506{ "KO/Pi Conflict delected","KO/Pi Konflikt erkannt" },
1507{ "Show date","Zeige Datum" },
1508{ "No problem!","Kein Problem!" },
1504{ "","" }, 1509{ "","" },
1505{ "","" }, 1510{ "","" },
1506{ "","" }, 1511{ "","" },
1507{ "","" }, 1512{ "","" },
1508{ "","" }, 1513{ "","" },
1509{ "","" }, 1514{ "","" },
1510{ "","" }, 1515{ "","" },
1511{ "","" }, 1516{ "","" },
1512{ "","" }, 1517{ "","" },
1513{ "","" },
1514{ "","" },
1515{ "","" },
1516{ "","" },
1517{ "","" },
1518
1519
1520
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e766b8f..65750af 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1,4797 +1,4834 @@
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 "kodialogmanager.h" 107#include "kodialogmanager.h"
108#include "outgoingdialog.h" 108#include "outgoingdialog.h"
109#include "incomingdialog.h" 109#include "incomingdialog.h"
110#include "datenavigatorcontainer.h" 110#include "datenavigatorcontainer.h"
111#include "statusdialog.h" 111#include "statusdialog.h"
112#include "kdatenavigator.h" 112#include "kdatenavigator.h"
113#include "kotodoview.h" 113#include "kotodoview.h"
114#include "datenavigator.h" 114#include "datenavigator.h"
115#include "resourceview.h" 115#include "resourceview.h"
116#include "navigatorbar.h" 116#include "navigatorbar.h"
117#include "searchdialog.h" 117#include "searchdialog.h"
118#include "mainwindow.h" 118#include "mainwindow.h"
119#include "categoryeditdialog.h" 119#include "categoryeditdialog.h"
120 120
121#include "calendarview.h" 121#include "calendarview.h"
122#ifndef DESKTOP_VERSION 122#ifndef DESKTOP_VERSION
123#include <qtopia/alarmserver.h> 123#include <qtopia/alarmserver.h>
124#endif 124#endif
125#ifndef _WIN32_ 125#ifndef _WIN32_
126#include <stdlib.h> 126#include <stdlib.h>
127#include <stdio.h> 127#include <stdio.h>
128#include <unistd.h> 128#include <unistd.h>
129#else 129#else
130#include <qprocess.h> 130#include <qprocess.h>
131#endif 131#endif
132 132
133#ifdef DESKTOP_VERSION 133#ifdef DESKTOP_VERSION
134#include <kabc/stdaddressbook.h> 134#include <kabc/stdaddressbook.h>
135#endif 135#endif
136using namespace KOrg; 136using namespace KOrg;
137using namespace KCal; 137using namespace KCal;
138extern int globalFlagBlockAgenda; 138extern int globalFlagBlockAgenda;
139extern int globalFlagBlockStartup; 139extern int globalFlagBlockStartup;
140 140
141 141
142MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent) 142MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms,QDateTime start ) : QTextBrowser(parent)
143 143
144{ 144{
145 mAlarms = alarms; 145 mAlarms = alarms;
146 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) ); 146 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) );
147 QString mText = "<table width=\"100%\">\n"; 147 QString mText = "<table width=\"100%\">\n";
148 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 148 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
149#ifdef DESKTOP_VERSION 149#ifdef DESKTOP_VERSION
150 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 150 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
151#else 151#else
152 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>"; 152 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h3>";
153#endif 153#endif
154 // mText += "<img src=\""; 154 // mText += "<img src=\"";
155 // mText += ipath; 155 // mText += ipath;
156 // mText += "\">"; 156 // mText += "\">";
157 //mEventDate = QDate::currentDate(); 157 //mEventDate = QDate::currentDate();
158#ifdef DESKTOP_VERSION 158#ifdef DESKTOP_VERSION
159 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>"; 159 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h2>";
160#else 160#else
161 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>"; 161 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>";
162#endif 162#endif
163 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 163 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
164 164
165 Incidence * inc = getNextInc( start ); 165 Incidence * inc = getNextInc( start );
166 int time = 0; 166 int time = 0;
167 //mText += "<table>"; 167 //mText += "<table>";
168 while ( inc ) { 168 while ( inc ) {
169 QDateTime dt ; 169 QDateTime dt ;
170 QString tempText = "<a "; 170 QString tempText = "<a ";
171 bool ok; 171 bool ok;
172 dt = inc->getNextOccurence( start, &ok ); 172 dt = inc->getNextOccurence( start, &ok );
173 if ( !ok ) continue; 173 if ( !ok ) continue;
174 if ( inc->typeID() == eventID ) { 174 if ( inc->typeID() == eventID ) {
175 tempText += "href=\"event:"; 175 tempText += "href=\"event:";
176 } else if ( inc->typeID() == todoID ) { 176 } else if ( inc->typeID() == todoID ) {
177 tempText += "href=\"todo:"; 177 tempText += "href=\"todo:";
178 } 178 }
179 tempText += inc->uid() + "\">"; 179 tempText += inc->uid() + "\">";
180 if ( inc->typeID() == todoID ) 180 if ( inc->typeID() == todoID )
181 tempText += i18n("Todo: "); 181 tempText += i18n("Todo: ");
182 if ( inc->summary().length() > 0 ) 182 if ( inc->summary().length() > 0 )
183 tempText += inc->summary(); 183 tempText += inc->summary();
184 else 184 else
185 tempText += i18n("-no summary-"); 185 tempText += i18n("-no summary-");
186 QString timestr; 186 QString timestr;
187 if (!inc->doesFloat()) 187 if (!inc->doesFloat())
188 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": "; 188 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": ";
189 else 189 else
190 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 190 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
191 if ( dt.date() < QDate::currentDate() && time == 0 ) { 191 if ( dt.date() < QDate::currentDate() && time == 0 ) {
192 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 192 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
193 mText += "<table>"; 193 mText += "<table>";
194 time = 1; 194 time = 1;
195 } 195 }
196 if ( dt.date() == QDate::currentDate() && time <= 1 ) { 196 if ( dt.date() == QDate::currentDate() && time <= 1 ) {
197 if ( time > 0 ) 197 if ( time > 0 )
198 mText +="</table>"; 198 mText +="</table>";
199 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>"; 199 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>";
200 mText += "<table>"; 200 mText += "<table>";
201 time = 2; 201 time = 2;
202 202
203 } 203 }
204 if ( dt.date() > QDate::currentDate() && time <= 2 ) { 204 if ( dt.date() > QDate::currentDate() && time <= 2 ) {
205 if ( time > 0 ) 205 if ( time > 0 )
206 mText +="</table>"; 206 mText +="</table>";
207 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>"; 207 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>";
208 mText += "<table>"; 208 mText += "<table>";
209 time = 3; 209 time = 3;
210 } 210 }
211 mText +="<tr><td><b>"; 211 mText +="<tr><td><b>";
212 mText += timestr; 212 mText += timestr;
213 mText += "</b></td><td>"; 213 mText += "</b></td><td>";
214 mText += tempText; 214 mText += tempText;
215 mText += "</td></tr>\n"; 215 mText += "</td></tr>\n";
216 inc = getNextInc( start ); 216 inc = getNextInc( start );
217 } 217 }
218 mText +="</table>"; 218 mText +="</table>";
219 setText( mText ); 219 setText( mText );
220} 220}
221 221
222MissedAlarmTextBrowser::~MissedAlarmTextBrowser() 222MissedAlarmTextBrowser::~MissedAlarmTextBrowser()
223{ 223{
224 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() "); 224 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() ");
225} 225}
226Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start ) 226Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start )
227{ 227{
228 QDateTime dt ; 228 QDateTime dt ;
229 Incidence * retInc; 229 Incidence * retInc;
230 Incidence * inc = mAlarms.first(); 230 Incidence * inc = mAlarms.first();
231 if ( inc == 0 ) 231 if ( inc == 0 )
232 return 0; 232 return 0;
233 bool ok; 233 bool ok;
234 dt = inc->getNextOccurence( start, &ok ); 234 dt = inc->getNextOccurence( start, &ok );
235 if ( ! ok ) return 0; 235 if ( ! ok ) return 0;
236 QDateTime dtn ; 236 QDateTime dtn ;
237 retInc = inc; 237 retInc = inc;
238 inc = mAlarms.next(); 238 inc = mAlarms.next();
239 while ( inc ) { 239 while ( inc ) {
240 dtn = inc->getNextOccurence( start, &ok ); 240 dtn = inc->getNextOccurence( start, &ok );
241 if ( ! ok ) return 0; 241 if ( ! ok ) return 0;
242 if ( dtn < dt ) { 242 if ( dtn < dt ) {
243 dt = dtn; 243 dt = dtn;
244 retInc = inc; 244 retInc = inc;
245 } 245 }
246 inc = mAlarms.next(); 246 inc = mAlarms.next();
247 } 247 }
248 mAlarms.remove( retInc ); 248 mAlarms.remove( retInc );
249 return retInc; 249 return retInc;
250 250
251} 251}
252void MissedAlarmTextBrowser::setSource(const QString & n) 252void MissedAlarmTextBrowser::setSource(const QString & n)
253{ 253{
254 if (n.startsWith("event:")) { 254 if (n.startsWith("event:")) {
255#ifdef DESKTOP_VERSION 255#ifdef DESKTOP_VERSION
256 emit showIncidence(n.mid(8)); 256 emit showIncidence(n.mid(8));
257#else 257#else
258 emit showIncidence(n.mid(6)); 258 emit showIncidence(n.mid(6));
259#endif 259#endif
260 return; 260 return;
261 } else if (n.startsWith("todo:")) { 261 } else if (n.startsWith("todo:")) {
262#ifdef DESKTOP_VERSION 262#ifdef DESKTOP_VERSION
263 emit showIncidence(n.mid(7)); 263 emit showIncidence(n.mid(7));
264#else 264#else
265 emit showIncidence(n.mid(5)); 265 emit showIncidence(n.mid(5));
266#endif 266#endif
267 return; 267 return;
268 } 268 }
269} 269}
270 270
271 271
272class KOBeamPrefs : public QDialog 272class KOBeamPrefs : public QDialog
273{ 273{
274 public: 274 public:
275 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 275 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
276 QDialog( parent, name, true ) 276 QDialog( parent, name, true )
277 { 277 {
278 setCaption( i18n("Beam Options") ); 278 setCaption( i18n("Beam Options") );
279 QVBoxLayout* lay = new QVBoxLayout( this ); 279 QVBoxLayout* lay = new QVBoxLayout( this );
280 lay->setSpacing( 3 ); 280 lay->setSpacing( 3 );
281 lay->setMargin( 3 ); 281 lay->setMargin( 3 );
282 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 282 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
283 lay->addWidget( format ); 283 lay->addWidget( format );
284 format->setExclusive ( true ) ; 284 format->setExclusive ( true ) ;
285 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 285 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
286 lay->addWidget( time ); time->setExclusive ( true ) ; 286 lay->addWidget( time ); time->setExclusive ( true ) ;
287 vcal = new QRadioButton(" vCalendar ", format ); 287 vcal = new QRadioButton(" vCalendar ", format );
288 ical = new QRadioButton(" iCalendar ", format ); 288 ical = new QRadioButton(" iCalendar ", format );
289 vcal->setChecked( true ); 289 vcal->setChecked( true );
290 tz = new QRadioButton(i18n(" With timezone "), time ); 290 tz = new QRadioButton(i18n(" With timezone "), time );
291 local = new QRadioButton(i18n(" Local time "), time ); 291 local = new QRadioButton(i18n(" Local time "), time );
292 tz->setChecked( true ); 292 tz->setChecked( true );
293 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 293 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
294 lay->addWidget( ok ); 294 lay->addWidget( ok );
295 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 295 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
296 lay->addWidget( cancel ); 296 lay->addWidget( cancel );
297 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 297 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
298 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 298 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
299 resize( 200, 200 ); 299 resize( 200, 200 );
300 } 300 }
301 301
302 bool beamVcal() { return vcal->isChecked(); } 302 bool beamVcal() { return vcal->isChecked(); }
303 bool beamLocal() { return local->isChecked(); } 303 bool beamLocal() { return local->isChecked(); }
304private: 304private:
305 QRadioButton* vcal, *ical, *local, *tz; 305 QRadioButton* vcal, *ical, *local, *tz;
306}; 306};
307class KOCatPrefs : public QDialog 307class KOCatPrefs : public QDialog
308{ 308{
309 public: 309 public:
310 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 310 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
311 QDialog( parent, name, true ) 311 QDialog( parent, name, true )
312 { 312 {
313 setCaption( i18n("Manage new Categories") ); 313 setCaption( i18n("Manage new Categories") );
314 QVBoxLayout* lay = new QVBoxLayout( this ); 314 QVBoxLayout* lay = new QVBoxLayout( this );
315 lay->setSpacing( 3 ); 315 lay->setSpacing( 3 );
316 lay->setMargin( 3 ); 316 lay->setMargin( 3 );
317 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 ); 317 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 lay->addWidget( lab ); 318 lay->addWidget( lab );
319 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 319 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
320 lay->addWidget( format ); 320 lay->addWidget( format );
321 format->setExclusive ( true ) ; 321 format->setExclusive ( true ) ;
322 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 322 addCatBut = new QRadioButton(i18n("Add to category list"), format );
323 new QRadioButton(i18n("Remove from Events/Todos"), format ); 323 new QRadioButton(i18n("Remove from Events/Todos"), format );
324 addCatBut->setChecked( true ); 324 addCatBut->setChecked( true );
325 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); 325 QPushButton * ok = new QPushButton( i18n("Change category list now!"), this );
326 lay->addWidget( ok ); 326 lay->addWidget( ok );
327 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 327 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
328 lay->addWidget( cancel ); 328 lay->addWidget( cancel );
329 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 329 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
330 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 330 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
331 resize( 200, 200 ); 331 resize( 200, 200 );
332 } 332 }
333 333
334 bool addCat() { return addCatBut->isChecked(); } 334 bool addCat() { return addCatBut->isChecked(); }
335private: 335private:
336 QRadioButton* addCatBut; 336 QRadioButton* addCatBut;
337}; 337};
338 338
339 339
340 340
341CalendarView::CalendarView( CalendarResources *calendar, 341CalendarView::CalendarView( CalendarResources *calendar,
342 QWidget *parent, const char *name ) 342 QWidget *parent, const char *name )
343 : CalendarViewBase( parent, name ), 343 : CalendarViewBase( parent, name ),
344 mCalendar( calendar ), 344 mCalendar( calendar ),
345 mResourceManager( calendar->resourceManager() ) 345 mResourceManager( calendar->resourceManager() )
346{ 346{
347 347
348 mEventEditor = 0; 348 mEventEditor = 0;
349 mTodoEditor = 0; 349 mTodoEditor = 0;
350 350
351 init(); 351 init();
352} 352}
353 353
354CalendarView::CalendarView( Calendar *calendar, 354CalendarView::CalendarView( Calendar *calendar,
355 QWidget *parent, const char *name ) 355 QWidget *parent, const char *name )
356 : CalendarViewBase( parent, name ), 356 : CalendarViewBase( parent, name ),
357 mCalendar( calendar ), 357 mCalendar( calendar ),
358 mResourceManager( 0 ) 358 mResourceManager( 0 )
359{ 359{
360 360
361 mEventEditor = 0; 361 mEventEditor = 0;
362 mTodoEditor = 0; 362 mTodoEditor = 0;
363 init(); 363 init();
364} 364}
365 365
366void CalendarView::init() 366void CalendarView::init()
367{ 367{
368 mNextAlarmDateTime = QDateTime::currentDateTime(); 368 mNextAlarmDateTime = QDateTime::currentDateTime();
369 setFocusPolicy ( NoFocus ); 369 setFocusPolicy ( NoFocus );
370 mViewerCallerIsSearchDialog = false; 370 mViewerCallerIsSearchDialog = false;
371 mBlockShowDates = false; 371 mBlockShowDates = false;
372 372
373 mDatePickerMode = 0; 373 mDatePickerMode = 0;
374 mCurrentSyncDevice = ""; 374 mCurrentSyncDevice = "";
375 mViewManager = new KOViewManager( this ); 375 mViewManager = new KOViewManager( this );
376 mDialogManager = new KODialogManager( this ); 376 mDialogManager = new KODialogManager( this );
377 mEventViewerDialog = 0; 377 mEventViewerDialog = 0;
378 mModified = false; 378 mModified = false;
379 mReadOnly = false; 379 mReadOnly = false;
380 mSelectedIncidence = 0; 380 mSelectedIncidence = 0;
381 mCalPrinter = 0; 381 mCalPrinter = 0;
382 mFilters.setAutoDelete(true); 382 mFilters.setAutoDelete(true);
383 383
384 mCalendar->registerObserver( this ); 384 mCalendar->registerObserver( this );
385 // TODO: Make sure that view is updated, when calendar is changed. 385 // TODO: Make sure that view is updated, when calendar is changed.
386 386
387 mStorage = new FileStorage( mCalendar ); 387 mStorage = new FileStorage( mCalendar );
388 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 388 mNavigator = new DateNavigator( this, "datevav", mViewManager );
389 389
390 QBoxLayout *topLayout = (QBoxLayout*)layout(); 390 QBoxLayout *topLayout = (QBoxLayout*)layout();
391#ifndef KORG_NOSPLITTER 391#ifndef KORG_NOSPLITTER
392 // create the main layout frames. 392 // create the main layout frames.
393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
394 topLayout->addWidget(mPanner); 394 topLayout->addWidget(mPanner);
395 395
396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
397 "CalendarView::LeftFrame"); 397 "CalendarView::LeftFrame");
398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
399 399
400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter, 400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
401 "CalendarView::DateNavigator" ); 401 "CalendarView::DateNavigator" );
402 402
403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
405 mTodoList->setNavigator( mNavigator ); 405 mTodoList->setNavigator( mNavigator );
406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
407 407
408#ifdef KORG_NORESOURCEVIEW 408#ifdef KORG_NORESOURCEVIEW
409 mResourceView = 0; 409 mResourceView = 0;
410#else 410#else
411 if ( mResourceManager ) { 411 if ( mResourceManager ) {
412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
413 mResourceView->updateView(); 413 mResourceView->updateView();
414 connect( mResourceView, SIGNAL( resourcesChanged() ), 414 connect( mResourceView, SIGNAL( resourcesChanged() ),
415 SLOT( updateView() ) ); 415 SLOT( updateView() ) );
416 } else { 416 } else {
417 mResourceView = 0; 417 mResourceView = 0;
418 } 418 }
419#endif 419#endif
420 QWidget *rightBox = new QWidget( mPanner ); 420 QWidget *rightBox = new QWidget( mPanner );
421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
422 422
423 mRightFrame = new QWidgetStack( rightBox ); 423 mRightFrame = new QWidgetStack( rightBox );
424 rightLayout->addWidget( mRightFrame, 1 ); 424 rightLayout->addWidget( mRightFrame, 1 );
425 425
426 mLeftFrame = mLeftSplitter; 426 mLeftFrame = mLeftSplitter;
427#else 427#else
428 //QWidget *mainBox = new QWidget( this ); 428 //QWidget *mainBox = new QWidget( this );
429 //QWidget *leftFrame = new QWidget( mainBox ); 429 //QWidget *leftFrame = new QWidget( mainBox );
430 //QBoxLayout * mainBoxLayout; 430 //QBoxLayout * mainBoxLayout;
431 if ( KOPrefs::instance()->mVerticalScreen ) { 431 if ( KOPrefs::instance()->mVerticalScreen ) {
432 //mainBoxLayout = new QVBoxLayout(mainBox); 432 //mainBoxLayout = new QVBoxLayout(mainBox);
433 //leftFrameLayout = new QHBoxLayout(leftFrame ); 433 //leftFrameLayout = new QHBoxLayout(leftFrame );
434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); 434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; 436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
438 } else { 438 } else {
439 //mainBoxLayout = new QHBoxLayout(mainBox); 439 //mainBoxLayout = new QHBoxLayout(mainBox);
440 //leftFrameLayout = new QVBoxLayout(leftFrame ); 440 //leftFrameLayout = new QVBoxLayout(leftFrame );
441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
445 } 445 }
446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
447 //QBoxLayout * leftFrameLayout; 447 //QBoxLayout * leftFrameLayout;
448 topLayout->addWidget( mMainFrame ); 448 topLayout->addWidget( mMainFrame );
449#ifdef DESKTOP_VERSION 449#ifdef DESKTOP_VERSION
450 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this ); 450 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this );
451 topLayout->addWidget( mDateScrollBar ); 451 topLayout->addWidget( mDateScrollBar );
452 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); 452 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
453 if ( QApplication::desktop()->width() < 800 ) 453 if ( QApplication::desktop()->width() < 800 )
454 mDateScrollBar->hide(); 454 mDateScrollBar->hide();
455#endif 455#endif
456 //mainBoxLayout->addWidget (mLeftFrame); 456 //mainBoxLayout->addWidget (mLeftFrame);
457 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 457 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
458 "CalendarView::DateNavigator" ); 458 "CalendarView::DateNavigator" );
459#if 0 459#if 0
460 // FIXME 460 // FIXME
461 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 461 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
462 "CalendarView::DateNavigator", QDate::currentDate()); 462 "CalendarView::DateNavigator", QDate::currentDate());
463#endif 463#endif
464 // mDateNavigator->blockSignals( true ); 464 // mDateNavigator->blockSignals( true );
465 //leftFrameLayout->addWidget( mDateNavigator ); 465 //leftFrameLayout->addWidget( mDateNavigator );
466 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 466 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
467 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 467 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
468 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 468 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
469 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 469 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
470 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 470 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); 471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) );
472 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 472 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); 473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
474 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); 474 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
475 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); 475 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
476 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); 476 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
477 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); 477 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() ));
478 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 478 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
479 479
480 mTodoList->setNavigator( mNavigator ); 480 mTodoList->setNavigator( mNavigator );
481#if 0 481#if 0
482 if ( QApplication::desktop()->width() < 480 ) { 482 if ( QApplication::desktop()->width() < 480 ) {
483 leftFrameLayout->addWidget(mFilterView); 483 leftFrameLayout->addWidget(mFilterView);
484 leftFrameLayout->addWidget(mTodoList, 2 ); 484 leftFrameLayout->addWidget(mTodoList, 2 );
485 485
486 } else { 486 } else {
487 leftFrameLayout->addWidget(mTodoList,2 ); 487 leftFrameLayout->addWidget(mTodoList,2 );
488 leftFrameLayout->addWidget(mFilterView ); 488 leftFrameLayout->addWidget(mFilterView );
489 } 489 }
490#endif 490#endif
491 mFilterView->hide(); 491 mFilterView->hide();
492 mCalEditView->hide(); 492 mCalEditView->hide();
493 QWidget *rightBox = new QWidget( mMainFrame ); 493 QWidget *rightBox = new QWidget( mMainFrame );
494 //mainBoxLayout->addWidget ( rightBox, 10 ); 494 //mainBoxLayout->addWidget ( rightBox, 10 );
495 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 495 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
496 mRightFrame = new QWidgetStack( rightBox ); 496 mRightFrame = new QWidgetStack( rightBox );
497 rightLayout->addWidget( mRightFrame, 10 ); 497 rightLayout->addWidget( mRightFrame, 10 );
498 498
499 //mLeftFrame = (QWidget *)leftFrame; 499 //mLeftFrame = (QWidget *)leftFrame;
500 if ( KOPrefs::instance()->mVerticalScreen ) { 500 if ( KOPrefs::instance()->mVerticalScreen ) {
501 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 501 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
502 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 502 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
503 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 503 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
504 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 504 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
505 } else { 505 } else {
506 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 506 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
507 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 507 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
508 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 508 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
509 } 509 }
510 if ( !KOPrefs::instance()->mShowDateNavigator) 510 if ( !KOPrefs::instance()->mShowDateNavigator)
511 mDateNavigator->hide(); 511 mDateNavigator->hide();
512 //qDebug("Calendarview Size %d %d ", width(), height()); 512 //qDebug("Calendarview Size %d %d ", width(), height());
513#endif 513#endif
514 514
515 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 515 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
516 SLOT( showDates( const KCal::DateList & ) ) ); 516 SLOT( showDates( const KCal::DateList & ) ) );
517 517
518 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 518 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
519 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 519 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
520 520
521 521
522 522
523 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 523 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
524 mViewManager, SLOT( showMonth( const QDate & ) ) ); 524 mViewManager, SLOT( showMonth( const QDate & ) ) );
525 525
526 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 526 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
527 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 527 mNavigator, SLOT( selectWeek( const QDate & ) ) );
528 528
529 connect( mDateNavigator, SIGNAL( goPrevYear() ), 529 connect( mDateNavigator, SIGNAL( goPrevYear() ),
530 mNavigator, SLOT( selectPreviousYear() ) ); 530 mNavigator, SLOT( selectPreviousYear() ) );
531 connect( mDateNavigator, SIGNAL( goNextYear() ), 531 connect( mDateNavigator, SIGNAL( goNextYear() ),
532 mNavigator, SLOT( selectNextYear() ) ); 532 mNavigator, SLOT( selectNextYear() ) );
533 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 533 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
534 mNavigator, SLOT( selectPreviousMonth() ) ); 534 mNavigator, SLOT( selectPreviousMonth() ) );
535 connect( mDateNavigator, SIGNAL( goNextMonth() ), 535 connect( mDateNavigator, SIGNAL( goNextMonth() ),
536 mNavigator, SLOT( selectNextMonth() ) ); 536 mNavigator, SLOT( selectNextMonth() ) );
537 537
538 connect( mDateNavigator, SIGNAL( goPrevious() ), 538 connect( mDateNavigator, SIGNAL( goPrevious() ),
539 mNavigator, SLOT( selectPrevious() ) ); 539 mNavigator, SLOT( selectPrevious() ) );
540 connect( mDateNavigator, SIGNAL( goNext() ), 540 connect( mDateNavigator, SIGNAL( goNext() ),
541 mNavigator, SLOT( selectNext() ) ); 541 mNavigator, SLOT( selectNext() ) );
542 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 542 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
543 mNavigator, SLOT( slotMonthSelect( int ) ) ); 543 mNavigator, SLOT( slotMonthSelect( int ) ) );
544 544
545 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 545 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
546 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 546 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
547#if 0 547#if 0
548 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 548 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
549 SLOT( incidenceAdded( Incidence *) ) ); 549 SLOT( incidenceAdded( Incidence *) ) );
550#endif 550#endif
551 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 551 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
552 552
553 connect( this, SIGNAL( configChanged() ), 553 connect( this, SIGNAL( configChanged() ),
554 mDateNavigator, SLOT( updateConfig() ) ); 554 mDateNavigator, SLOT( updateConfig() ) );
555 555
556 connect( mTodoList, SIGNAL( newTodoSignal() ), 556 connect( mTodoList, SIGNAL( newTodoSignal() ),
557 SLOT( newTodo() ) ); 557 SLOT( newTodo() ) );
558 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 558 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
559 SLOT( newSubTodo( Todo * ) ) ); 559 SLOT( newSubTodo( Todo * ) ) );
560 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 560 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
561 SLOT( editTodo( Todo * ) ) ); 561 SLOT( editTodo( Todo * ) ) );
562 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 562 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
563 SLOT( showTodo( Todo *) ) ); 563 SLOT( showTodo( Todo *) ) );
564 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 564 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
565 SLOT( deleteTodo( Todo *) ) ); 565 SLOT( deleteTodo( Todo *) ) );
566 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 566 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
567 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 567 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
568 SLOT( purgeCompleted() ) ); 568 SLOT( purgeCompleted() ) );
569 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 569 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
570 SIGNAL( todoModified( Todo *, int ) ) ); 570 SIGNAL( todoModified( Todo *, int ) ) );
571 571
572 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 572 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
573 this, SLOT ( cloneIncidence( Incidence * ) ) ); 573 this, SLOT ( cloneIncidence( Incidence * ) ) );
574 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 574 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
575 this, SLOT (cancelIncidence( Incidence * ) ) ); 575 this, SLOT (cancelIncidence( Incidence * ) ) );
576 576
577 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 577 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
578 this, SLOT ( moveIncidence( Incidence * ) ) ); 578 this, SLOT ( moveIncidence( Incidence * ) ) );
579 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 579 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
580 this, SLOT ( beamIncidence( Incidence * ) ) ); 580 this, SLOT ( beamIncidence( Incidence * ) ) );
581 581
582 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 582 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
583 this, SLOT ( todo_unsub( Todo * ) ) ); 583 this, SLOT ( todo_unsub( Todo * ) ) );
584 584
585 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 585 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
586 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 586 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
587 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 587 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
588 SLOT( updateTodo( Todo *, int ) ) ); 588 SLOT( updateTodo( Todo *, int ) ) );
589 connect( this, SIGNAL( todoModified( Todo *, int )), this, 589 connect( this, SIGNAL( todoModified( Todo *, int )), this,
590 SLOT( changeTodoDisplay( Todo *, int ) ) ); 590 SLOT( changeTodoDisplay( Todo *, int ) ) );
591 591
592 592
593 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 593 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
594 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 594 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
595 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 595 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
596 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 596 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
597 597
598 598
599 599
600 600
601 601
602 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 602 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
603 SLOT(checkClipboard())); 603 SLOT(checkClipboard()));
604 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 604 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
605 SLOT( processTodoListSelection( Incidence * ) ) ); 605 SLOT( processTodoListSelection( Incidence * ) ) );
606 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 606 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
607 607
608 // kdDebug() << "CalendarView::CalendarView() done" << endl; 608 // kdDebug() << "CalendarView::CalendarView() done" << endl;
609 609
610 mDateFrame = new QVBox(0,0,WType_Popup); 610 mDateFrame = new QVBox(0,0,WType_Popup);
611 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 611 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
612 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 612 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
613 mDateFrame->setLineWidth(3); 613 mDateFrame->setLineWidth(3);
614 mDateFrame->hide(); 614 mDateFrame->hide();
615 mDateFrame->setCaption( i18n( "Pick a date to display")); 615 mDateFrame->setCaption( i18n( "Pick a date to display"));
616 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 616 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
617 617
618 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 618 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
619 619
620 mEventEditor = mDialogManager->getEventEditor(); 620 mEventEditor = mDialogManager->getEventEditor();
621 mTodoEditor = mDialogManager->getTodoEditor(); 621 mTodoEditor = mDialogManager->getTodoEditor();
622 622
623 mFlagEditDescription = false; 623 mFlagEditDescription = false;
624 624
625 mSuspendTimer = new QTimer( this ); 625 mSuspendTimer = new QTimer( this );
626 mAlarmTimer = new QTimer( this ); 626 mAlarmTimer = new QTimer( this );
627 mRecheckAlarmTimer = new QTimer( this ); 627 mRecheckAlarmTimer = new QTimer( this );
628 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 628 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
629 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 629 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
630 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 630 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
631 mAlarmDialog = new AlarmDialog( this ); 631 mAlarmDialog = new AlarmDialog( this );
632 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 632 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
633 mAlarmDialog->setServerNotification( false ); 633 mAlarmDialog->setServerNotification( false );
634 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 634 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
635 635
636 636
637#ifndef DESKTOP_VERSION 637#ifndef DESKTOP_VERSION
638//US listen for arriving address resultsets 638//US listen for arriving address resultsets
639 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 639 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
640 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 640 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
641#endif 641#endif
642 mDateNavigator->setCalendar( mCalendar ); 642 mDateNavigator->setCalendar( mCalendar );
643} 643}
644 644
645 645
646CalendarView::~CalendarView() 646CalendarView::~CalendarView()
647{ 647{
648 // kdDebug() << "~CalendarView()" << endl; 648 // kdDebug() << "~CalendarView()" << endl;
649 //qDebug("CalendarView::~CalendarView() "); 649 //qDebug("CalendarView::~CalendarView() ");
650 delete mDialogManager; 650 delete mDialogManager;
651 delete mViewManager; 651 delete mViewManager;
652 delete mStorage; 652 delete mStorage;
653 delete mDateFrame ; 653 delete mDateFrame ;
654 delete mEventViewerDialog; 654 delete mEventViewerDialog;
655 //kdDebug() << "~CalendarView() done" << endl; 655 //kdDebug() << "~CalendarView() done" << endl;
656} 656}
657void CalendarView::nextConflict( bool all, bool allday ) 657void CalendarView::nextConflict( bool all, bool allday )
658{ 658{
659 QDate start = mNavigator->selectedDates().first().addDays(1); 659
660 QPtrList<Event> testlist = mCalendar->events();
661 Event * test = testlist.first();
662 while ( test ) {
663 test->setTagged( false );
664 }
665 QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0));
666 QDateTime conflict;
667 QDateTime retVal;
668 bool found = false;
669 Event * cE = 0;
670 QPtrList<Event> testlist2 = testlist;
671 while ( test ) {
672 Event * test2 = testlist2.first();
673 while ( test2 ) {
674 if ( !test2->isTagged() ) {
675 if ( test->isOverlapping ( test2, &retVal, true ) ) {
676 if ( ! found ) {
677 if ( retVal >= startDT ) {
678 conflict = retVal;
679 cE = test;
680 found = true;
681 }
682 } else {
683 if ( retVal >= startDT && retVal < conflict ) {
684 conflict = retVal;
685 cE = test;
686 }
687 }
688 }
689 }
690 test2 = testlist2.next();
691 }
692 test->setTagged( true );
693 test = testlist.next();
694 }
695 if ( found ) {
696 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
697 mViewManager->showDayView();
698 mNavigator->slotDaySelect( conflict.date() );
699 int hour = conflict.time().hour();
700 mViewManager->agendaView()->setStartHour( hour );
701 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
702 return;
703 }
704
705 topLevelWidget()->setCaption( i18n("No conflict found within the next two years") );
706 qDebug("No conflict found ");
707 return;
708
709
710
711
712
713#if 0
714
715
660 QDate end = start.addDays( 365*2); 716 QDate end = start.addDays( 365*2);
661 while ( start < end ) { 717 while ( start < end ) {
662 QPtrList<Event> eventList = calendar()->events( start ); 718 QPtrList<Event> eventList = calendar()->events( start );
663 Event * ev = eventList.first(); 719 Event * ev = eventList.first();
664 QPtrList<Event> test = eventList; 720 QPtrList<Event> test = eventList;
665 while ( ev ) { 721 while ( ev ) {
666 //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); 722 //qDebug("found %d on %s ", eventList.count(), start.toString().latin1());
667 Event * t_ev = test.first(); 723 Event * t_ev = test.first();
668 QDateTime es = ev->dtStart(); 724 QDateTime es = ev->dtStart();
669 QDateTime ee = ev->dtEnd(); 725 QDateTime ee = ev->dtEnd();
670 if ( ev->doesFloat() ) 726 if ( ev->doesFloat() )
671 ee = ee.addDays( 1 ); 727 ee = ee.addDays( 1 );
672 if ( ! all ) { 728 if ( ! all ) {
673 if ( ev->doesFloat() != allday ) 729 if ( ev->doesFloat() != allday )
674 t_ev = 0; 730 t_ev = 0;
675 } 731 }
676 while ( t_ev ) { 732 while ( t_ev ) {
677 bool skip = false; 733 bool skip = false;
678 if ( ! all ) { 734 if ( ! all ) {
679 if ( t_ev->doesFloat() != allday ) 735 if ( t_ev->doesFloat() != allday )
680 skip = true; 736 skip = true;
681 } 737 }
682 if ( !skip && ev != t_ev ) { 738 if ( !skip && ev != t_ev ) {
683 QDateTime ets = t_ev->dtStart(); 739 QDateTime ets = t_ev->dtStart();
684 QDateTime ete = t_ev->dtEnd(); 740 QDateTime ete = t_ev->dtEnd();
685 if ( t_ev->doesFloat() ) 741 if ( t_ev->doesFloat() )
686 ete = ete.addDays( 1 ); 742 ete = ete.addDays( 1 );
687 //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() ); 743 //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() );
688 if ( es < ete && ets < ee ) { 744 if ( es < ete && ets < ee ) {
689 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 745 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
690 mViewManager->showDayView(); 746 mViewManager->showDayView();
691 mNavigator->slotDaySelect( start ); 747 mNavigator->slotDaySelect( start );
692 int hour = es.time().hour(); 748 int hour = es.time().hour();
693 if ( ets > es ) 749 if ( ets > es )
694 hour = ets.time().hour(); 750 hour = ets.time().hour();
695 mViewManager->agendaView()->setStartHour( hour ); 751 mViewManager->agendaView()->setStartHour( hour );
696 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) ); 752 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) );
697 return; 753 return;
698 } 754 }
699 } 755 }
700 t_ev = test.next(); 756 t_ev = test.next();
701 } 757 }
702 ev = eventList.next(); 758 ev = eventList.next();
703 } 759 }
704 start = start.addDays( 1 ); 760 start = start.addDays( 1 );
705 } 761 }
706 topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); 762 topLevelWidget()->setCaption( i18n("No conflict found within the next two years") );
707 qDebug("No conflict found "); 763 qDebug("No conflict found ");
764#endif
708} 765}
709 766
710void CalendarView::conflictAll() 767void CalendarView::conflictAll()
711{ 768{
712 nextConflict ( true, true ); 769 nextConflict ( true, true );
713} 770}
714void CalendarView::conflictAllday() 771void CalendarView::conflictAllday()
715{ 772{
716 nextConflict ( false, true ); 773 nextConflict ( false, true );
717} 774}
718void CalendarView::conflictNotAll() 775void CalendarView::conflictNotAll()
719{ 776{
720 nextConflict ( false, false ); 777 nextConflict ( false, false );
721} 778}
722 779
723void CalendarView::setCalReadOnly( int id, bool readO ) 780void CalendarView::setCalReadOnly( int id, bool readO )
724{ 781{
725 if ( readO ) { 782 if ( readO ) {
726 emit save(); 783 emit save();
727 } 784 }
728 mCalendar->setReadOnly( id, readO ); 785 mCalendar->setReadOnly( id, readO );
729} 786}
730void CalendarView::setScrollBarStep(int val ) 787void CalendarView::setScrollBarStep(int val )
731{ 788{
732#ifdef DESKTOP_VERSION 789#ifdef DESKTOP_VERSION
733 mDateScrollBar->setLineStep ( val ); 790 mDateScrollBar->setLineStep ( val );
734#endif 791#endif
735} 792}
736void CalendarView::scrollBarValue(int val ) 793void CalendarView::scrollBarValue(int val )
737{ 794{
738#ifdef DESKTOP_VERSION 795#ifdef DESKTOP_VERSION
739 if ( QApplication::desktop()->width() < 800 ) return; 796 if ( QApplication::desktop()->width() < 800 ) return;
740 static bool block = false; 797 static bool block = false;
741 if ( block ) return; 798 if ( block ) return;
742 block = true; 799 block = true;
743 int count = mNavigator->selectedDates().count(); 800 int count = mNavigator->selectedDates().count();
744 int day = mNavigator->selectedDates().first().dayOfYear(); 801 int day = mNavigator->selectedDates().first().dayOfYear();
745 int stepdays = val; 802 int stepdays = val;
746 if ( mDateScrollBar->lineStep () <= count ) { 803 if ( mDateScrollBar->lineStep () <= count ) {
747 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 804 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
748 //qDebug("VAL %d ",val ); 805 //qDebug("VAL %d ",val );
749 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 806 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
750 stepdays = day+stepdays; 807 stepdays = day+stepdays;
751 if ( stepdays < 0 ) stepdays = 0; 808 if ( stepdays < 0 ) stepdays = 0;
752 } 809 }
753 if ( stepdays == day ) { 810 if ( stepdays == day ) {
754 block = false; 811 block = false;
755 return; 812 return;
756 } 813 }
757 int year = mNavigator->selectedDates().first().year(); 814 int year = mNavigator->selectedDates().first().year();
758 QDate d ( year,1,1 ); 815 QDate d ( year,1,1 );
759 mNavigator->selectDates( d.addDays( stepdays-1) , count ); 816 mNavigator->selectDates( d.addDays( stepdays-1) , count );
760 block = false; 817 block = false;
761#endif 818#endif
762 819
763} 820}
764void CalendarView::updateView(const QDate &start, const QDate &end) 821void CalendarView::updateView(const QDate &start, const QDate &end)
765{ 822{
766#ifdef DESKTOP_VERSION 823#ifdef DESKTOP_VERSION
767 if ( ! mDateScrollBar->draggingSlider () ) { 824 if ( ! mDateScrollBar->draggingSlider () ) {
768 int dof = start.dayOfYear(); 825 int dof = start.dayOfYear();
769 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); 826 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() );
770 if ( dof != mDateScrollBar->value() ) { 827 if ( dof != mDateScrollBar->value() ) {
771 mDateScrollBar->blockSignals( true ); 828 mDateScrollBar->blockSignals( true );
772 mDateScrollBar->setValue( start.dayOfYear()); 829 mDateScrollBar->setValue( start.dayOfYear());
773 mDateScrollBar->blockSignals( false ); 830 mDateScrollBar->blockSignals( false );
774 } 831 }
775 } 832 }
776#endif 833#endif
777 mTodoList->updateView(); 834 mTodoList->updateView();
778 mViewManager->updateView(start, end); 835 mViewManager->updateView(start, end);
779 //mDateNavigator->updateView(); 836 //mDateNavigator->updateView();
780} 837}
781 838
782 839
783 840
784void CalendarView::checkFiles() 841void CalendarView::checkFiles()
785{ 842{
786 QString message; 843 QString message;
787 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 844 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
788 KopiCalendarFile * cal = calendars.first(); 845 KopiCalendarFile * cal = calendars.first();
789 while ( cal ) { 846 while ( cal ) {
790 if ( cal->mErrorOnLoad ) { 847 if ( cal->mErrorOnLoad ) {
791 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 848 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
792 } 849 }
793 cal = calendars.next(); 850 cal = calendars.next();
794 } 851 }
795 if ( !message.isEmpty() ) { 852 if ( !message.isEmpty() ) {
796 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); 853 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);
797 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 854 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed"));
798 } 855 }
799 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 856 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
800} 857}
801void CalendarView::checkAlarms() 858void CalendarView::checkAlarms()
802{ 859{
803 860
804 861
805 KConfig *config = KOGlobals::config(); 862 KConfig *config = KOGlobals::config();
806 config->setGroup( "AppRun" ); 863 config->setGroup( "AppRun" );
807 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 864 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
808 int daysto = dt.daysTo( QDate::currentDate() ); 865 int daysto = dt.daysTo( QDate::currentDate() );
809 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 866 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
810 dt = dt.addDays( days ); 867 dt = dt.addDays( days );
811 int secto = dt.secsTo( QDateTime::currentDateTime() ); 868 int secto = dt.secsTo( QDateTime::currentDateTime() );
812 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 869 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
813 //qDebug("KO: Reading program stop %d ", secs); 870 //qDebug("KO: Reading program stop %d ", secs);
814 //secs -= ( 3600 * 24*3 ); // debug only 871 //secs -= ( 3600 * 24*3 ); // debug only
815 QDateTime latest = dt.addSecs ( secs ); 872 QDateTime latest = dt.addSecs ( secs );
816 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 873 qDebug("KO: Last termination on %s ", latest.toString().latin1());
817 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 874 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
818 QPtrList<Incidence> el = mCalendar->rawIncidences(); 875 QPtrList<Incidence> el = mCalendar->rawIncidences();
819 QPtrList<Incidence> al; 876 QPtrList<Incidence> al;
820 Incidence* inL = el.first(); 877 Incidence* inL = el.first();
821 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 878 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
822 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 879 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
823 while ( inL ) { 880 while ( inL ) {
824 bool ok = false; 881 bool ok = false;
825 int offset = 0; 882 int offset = 0;
826 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 883 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
827 if ( ok ) { 884 if ( ok ) {
828 //qDebug("OK %s",next.toString().latin1()); 885 //qDebug("OK %s",next.toString().latin1());
829 if ( next < cur ) { 886 if ( next < cur ) {
830 al.append( inL ); 887 al.append( inL );
831 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 888 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
832 } 889 }
833 } 890 }
834 inL = el.next(); 891 inL = el.next();
835 } 892 }
836 if ( al.count() ) { 893 if ( al.count() ) {
837 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 894 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
838 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 895 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
839 QVBoxLayout* lay = new QVBoxLayout( dia ); 896 QVBoxLayout* lay = new QVBoxLayout( dia );
840 lay->setSpacing( 0 ); 897 lay->setSpacing( 0 );
841 lay->setMargin( 0 ); 898 lay->setMargin( 0 );
842 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 899 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
843 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 900 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
844 lay->addWidget( matb ); 901 lay->addWidget( matb );
845 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 902 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
846 int wid = 210; 903 int wid = 210;
847 int x = QApplication::desktop()->width() - wid - 7; 904 int x = QApplication::desktop()->width() - wid - 7;
848 int y = QApplication::desktop()->height() - wid - 70; 905 int y = QApplication::desktop()->height() - wid - 70;
849 dia->setGeometry ( x,y,wid,wid); 906 dia->setGeometry ( x,y,wid,wid);
850 } else { 907 } else {
851 int si = 220; 908 int si = 220;
852 if ( QApplication::desktop()->width() > 470 ) 909 if ( QApplication::desktop()->width() > 470 )
853 si = 400; 910 si = 400;
854 dia->resize(si,si/2); 911 dia->resize(si,si/2);
855 } 912 }
856 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 913 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
857 dia->show(); 914 dia->show();
858 915
859 } 916 }
860} 917}
861void CalendarView::showDay( QDate d ) 918void CalendarView::showDay( QDate d )
862{ 919{
863 dateNavigator()->blockSignals( true ); 920 dateNavigator()->blockSignals( true );
864 dateNavigator()->selectDate( d ); 921 dateNavigator()->selectDate( d );
865 dateNavigator()->blockSignals( false ); 922 dateNavigator()->blockSignals( false );
866 mViewManager->showDayView(); 923 mViewManager->showDayView();
867 //dateNavigator()->selectDate( d ); 924 //dateNavigator()->selectDate( d );
868} 925}
869void CalendarView::timerAlarm() 926void CalendarView::timerAlarm()
870{ 927{
871 //qDebug("CalendarView::timerAlarm() "); 928 //qDebug("CalendarView::timerAlarm() ");
872 computeAlarm(mAlarmNotification ); 929 computeAlarm(mAlarmNotification );
873} 930}
874 931
875void CalendarView::suspendAlarm() 932void CalendarView::suspendAlarm()
876{ 933{
877 //qDebug(" CalendarView::suspendAlarm() "); 934 //qDebug(" CalendarView::suspendAlarm() ");
878 computeAlarm(mSuspendAlarmNotification ); 935 computeAlarm(mSuspendAlarmNotification );
879 936
880} 937}
881 938
882void CalendarView::startAlarm( QString mess , QString filename) 939void CalendarView::startAlarm( QString mess , QString filename)
883{ 940{
884 941
885 topLevelWidget()->showNormal(); 942 topLevelWidget()->showNormal();
886 topLevelWidget()->setActiveWindow(); 943 topLevelWidget()->setActiveWindow();
887 topLevelWidget()->raise(); 944 topLevelWidget()->raise();
888 945
889 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 946 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
890 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); 947 QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) );
891 948
892} 949}
893 950
894void CalendarView::checkNextTimerAlarm() 951void CalendarView::checkNextTimerAlarm()
895{ 952{
896 mCalendar->checkAlarmForIncidence( 0, true ); 953 mCalendar->checkAlarmForIncidence( 0, true );
897} 954}
898 955
899void CalendarView::computeAlarm( QString msg ) 956void CalendarView::computeAlarm( QString msg )
900{ 957{
901 958
902 QString mess = msg; 959 QString mess = msg;
903 QString mAlarmMessage = mess.mid( 9 ); 960 QString mAlarmMessage = mess.mid( 9 );
904 QString filename = MainWindow::resourcePath(); 961 QString filename = MainWindow::resourcePath();
905 filename += "koalarm.wav"; 962 filename += "koalarm.wav";
906 QString tempfilename; 963 QString tempfilename;
907 if ( mess.left( 13 ) == "suspend_alarm") { 964 if ( mess.left( 13 ) == "suspend_alarm") {
908 bool error = false; 965 bool error = false;
909 int len = mess.mid( 13 ).find("+++"); 966 int len = mess.mid( 13 ).find("+++");
910 if ( len < 2 ) 967 if ( len < 2 )
911 error = true; 968 error = true;
912 else { 969 else {
913 tempfilename = mess.mid( 13, len ); 970 tempfilename = mess.mid( 13, len );
914 if ( !QFile::exists( tempfilename ) ) 971 if ( !QFile::exists( tempfilename ) )
915 error = true; 972 error = true;
916 } 973 }
917 if ( ! error ) { 974 if ( ! error ) {
918 filename = tempfilename; 975 filename = tempfilename;
919 } 976 }
920 mAlarmMessage = mess.mid( 13+len+3 ); 977 mAlarmMessage = mess.mid( 13+len+3 );
921 //qDebug("suspend file %s ",tempfilename.latin1() ); 978 //qDebug("suspend file %s ",tempfilename.latin1() );
922 startAlarm( mAlarmMessage, filename); 979 startAlarm( mAlarmMessage, filename);
923 return; 980 return;
924 } 981 }
925 if ( mess.left( 11 ) == "timer_alarm") { 982 if ( mess.left( 11 ) == "timer_alarm") {
926 //mTimerTime = 0; 983 //mTimerTime = 0;
927 startAlarm( mess.mid( 11 ), filename ); 984 startAlarm( mess.mid( 11 ), filename );
928 return; 985 return;
929 } 986 }
930 if ( mess.left( 10 ) == "proc_alarm") { 987 if ( mess.left( 10 ) == "proc_alarm") {
931 bool error = false; 988 bool error = false;
932 int len = mess.mid( 10 ).find("+++"); 989 int len = mess.mid( 10 ).find("+++");
933 if ( len < 2 ) 990 if ( len < 2 )
934 error = true; 991 error = true;
935 else { 992 else {
936 tempfilename = mess.mid( 10, len ); 993 tempfilename = mess.mid( 10, len );
937 if ( !QFile::exists( tempfilename ) ) 994 if ( !QFile::exists( tempfilename ) )
938 error = true; 995 error = true;
939 } 996 }
940 if ( error ) { 997 if ( error ) {
941 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 998 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
942 mAlarmMessage += mess.mid( 10+len+3+9 ); 999 mAlarmMessage += mess.mid( 10+len+3+9 );
943 } else { 1000 } else {
944 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 1001 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
945 //qDebug("-----system command %s ",tempfilename.latin1() ); 1002 //qDebug("-----system command %s ",tempfilename.latin1() );
946#ifndef _WIN32_ 1003#ifndef _WIN32_
947 if ( vfork () == 0 ) { 1004 if ( vfork () == 0 ) {
948 execl ( tempfilename.latin1(), 0 ); 1005 execl ( tempfilename.latin1(), 0 );
949 return; 1006 return;
950 } 1007 }
951#else 1008#else
952 QProcess* p = new QProcess(); 1009 QProcess* p = new QProcess();
953 p->addArgument( tempfilename.latin1() ); 1010 p->addArgument( tempfilename.latin1() );
954 p->start(); 1011 p->start();
955 return; 1012 return;
956#endif 1013#endif
957 1014
958 return; 1015 return;
959 } 1016 }
960 1017
961 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 1018 //qDebug("+++++++system command %s ",tempfilename.latin1() );
962 } 1019 }
963 if ( mess.left( 11 ) == "audio_alarm") { 1020 if ( mess.left( 11 ) == "audio_alarm") {
964 bool error = false; 1021 bool error = false;
965 int len = mess.mid( 11 ).find("+++"); 1022 int len = mess.mid( 11 ).find("+++");
966 if ( len < 2 ) 1023 if ( len < 2 )
967 error = true; 1024 error = true;
968 else { 1025 else {
969 tempfilename = mess.mid( 11, len ); 1026 tempfilename = mess.mid( 11, len );
970 if ( !QFile::exists( tempfilename ) ) 1027 if ( !QFile::exists( tempfilename ) )
971 error = true; 1028 error = true;
972 } 1029 }
973 if ( ! error ) { 1030 if ( ! error ) {
974 filename = tempfilename; 1031 filename = tempfilename;
975 } 1032 }
976 mAlarmMessage = mess.mid( 11+len+3+9 ); 1033 mAlarmMessage = mess.mid( 11+len+3+9 );
977 //qDebug("audio file command %s ",tempfilename.latin1() ); 1034 //qDebug("audio file command %s ",tempfilename.latin1() );
978 } 1035 }
979 if ( mess.left( 9 ) == "cal_alarm") { 1036 if ( mess.left( 9 ) == "cal_alarm") {
980 mAlarmMessage = mess.mid( 9 ) ; 1037 mAlarmMessage = mess.mid( 9 ) ;
981 } 1038 }
982 1039
983 startAlarm( mAlarmMessage, filename ); 1040 startAlarm( mAlarmMessage, filename );
984 1041
985 1042
986} 1043}
987 1044
988void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti ) 1045void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
989{ 1046{
990 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 1047 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
991 1048
992 mSuspendAlarmNotification = noti; 1049 mSuspendAlarmNotification = noti;
993 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 1050 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
994 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 1051 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
995 mSuspendTimer->start( ms , true ); 1052 mSuspendTimer->start( ms , true );
996 1053
997} 1054}
998 1055
999void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 1056void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
1000{ 1057{
1001 mNextAlarmDateTime = qdt; 1058 mNextAlarmDateTime = qdt;
1002 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 1059 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
1003 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 1060 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
1004#ifndef DESKTOP_VERSION 1061#ifndef DESKTOP_VERSION
1005 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() ); 1062 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() );
1006#endif 1063#endif
1007 return; 1064 return;
1008 } 1065 }
1009 int maxSec; 1066 int maxSec;
1010 //maxSec = 5; //testing only 1067 //maxSec = 5; //testing only
1011 maxSec = 86400+3600; // one day+1hour 1068 maxSec = 86400+3600; // one day+1hour
1012 mAlarmNotification = noti; 1069 mAlarmNotification = noti;
1013 int sec = QDateTime::currentDateTime().secsTo( qdt ); 1070 int sec = QDateTime::currentDateTime().secsTo( qdt );
1014 if ( sec > maxSec ) { 1071 if ( sec > maxSec ) {
1015 mRecheckAlarmTimer->start( maxSec * 1000 ); 1072 mRecheckAlarmTimer->start( maxSec * 1000 );
1016 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); 1073 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec );
1017 return; 1074 return;
1018 } else { 1075 } else {
1019 mRecheckAlarmTimer->stop(); 1076 mRecheckAlarmTimer->stop();
1020 } 1077 }
1021 //qDebug("Alarm timer started with secs: %d ", sec); 1078 //qDebug("Alarm timer started with secs: %d ", sec);
1022 mAlarmTimer->start( sec *1000 , true ); 1079 mAlarmTimer->start( sec *1000 , true );
1023 1080
1024} 1081}
1025// called by mRecheckAlarmTimer to get next alarm 1082// called by mRecheckAlarmTimer to get next alarm
1026// we need this, because a QTimer has only a max range of 25 days 1083// we need this, because a QTimer has only a max range of 25 days
1027void CalendarView::recheckTimerAlarm() 1084void CalendarView::recheckTimerAlarm()
1028{ 1085{
1029 mAlarmTimer->stop(); 1086 mAlarmTimer->stop();
1030 mRecheckAlarmTimer->stop(); 1087 mRecheckAlarmTimer->stop();
1031 mCalendar->checkAlarmForIncidence( 0, true ); 1088 mCalendar->checkAlarmForIncidence( 0, true );
1032} 1089}
1033#ifndef DESKTOP_VERSION 1090#ifndef DESKTOP_VERSION
1034void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti ) 1091void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
1035#else 1092#else
1036void CalendarView::removeAlarm(const QDateTime &, const QString & ) 1093void CalendarView::removeAlarm(const QDateTime &, const QString & )
1037#endif 1094#endif
1038{ 1095{
1039 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 1096 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
1040 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 1097 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
1041#ifndef DESKTOP_VERSION 1098#ifndef DESKTOP_VERSION
1042 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() ); 1099 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() );
1043#endif 1100#endif
1044 return; 1101 return;
1045 } 1102 }
1046 mAlarmTimer->stop(); 1103 mAlarmTimer->stop();
1047} 1104}
1048void CalendarView::selectWeekNum ( int num ) 1105void CalendarView::selectWeekNum ( int num )
1049{ 1106{
1050 dateNavigator()->blockSignals( true ); 1107 dateNavigator()->blockSignals( true );
1051 dateNavigator()->selectWeek( num ); 1108 dateNavigator()->selectWeek( num );
1052 dateNavigator()->blockSignals( false ); 1109 dateNavigator()->blockSignals( false );
1053 mViewManager->showWeekView(); 1110 mViewManager->showWeekView();
1054} 1111}
1055KOViewManager *CalendarView::viewManager() 1112KOViewManager *CalendarView::viewManager()
1056{ 1113{
1057 return mViewManager; 1114 return mViewManager;
1058} 1115}
1059 1116
1060KODialogManager *CalendarView::dialogManager() 1117KODialogManager *CalendarView::dialogManager()
1061{ 1118{
1062 return mDialogManager; 1119 return mDialogManager;
1063} 1120}
1064 1121
1065QDate CalendarView::startDate() 1122QDate CalendarView::startDate()
1066{ 1123{
1067 DateList dates = mNavigator->selectedDates(); 1124 DateList dates = mNavigator->selectedDates();
1068 1125
1069 return dates.first(); 1126 return dates.first();
1070} 1127}
1071 1128
1072QDate CalendarView::endDate() 1129QDate CalendarView::endDate()
1073{ 1130{
1074 DateList dates = mNavigator->selectedDates(); 1131 DateList dates = mNavigator->selectedDates();
1075 1132
1076 return dates.last(); 1133 return dates.last();
1077} 1134}
1078 1135
1079 1136
1080void CalendarView::createPrinter() 1137void CalendarView::createPrinter()
1081{ 1138{
1082#ifndef KORG_NOPRINTER 1139#ifndef KORG_NOPRINTER
1083 if (!mCalPrinter) { 1140 if (!mCalPrinter) {
1084 mCalPrinter = new CalPrinter(this, mCalendar); 1141 mCalPrinter = new CalPrinter(this, mCalendar);
1085 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); 1142 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig()));
1086 } 1143 }
1087#endif 1144#endif
1088} 1145}
1089 1146
1090 1147
1091//KOPrefs::instance()->mWriteBackFile 1148//KOPrefs::instance()->mWriteBackFile
1092//KOPrefs::instance()->mWriteBackExistingOnly 1149//KOPrefs::instance()->mWriteBackExistingOnly
1093 1150
1094// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 1151// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
1095// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 1152// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
1096// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 1153// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
1097// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 1154// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
1098// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 1155// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
1099// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 1156// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
1100 1157
1101int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) 1158int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full )
1102{ 1159{
1103 1160
1104 // 0 equal 1161 // 0 equal
1105 // 1 take local 1162 // 1 take local
1106 // 2 take remote 1163 // 2 take remote
1107 // 3 cancel 1164 // 3 cancel
1108 QDateTime lastSync = mLastCalendarSync; 1165 QDateTime lastSync = mLastCalendarSync;
1109 QDateTime localMod = local->lastModified(); 1166 QDateTime localMod = local->lastModified();
1110 QDateTime remoteMod = remote->lastModified(); 1167 QDateTime remoteMod = remote->lastModified();
1111 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1168 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1112 bool remCh, locCh; 1169 bool remCh, locCh;
1113 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 1170 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
1114 //if ( remCh ) 1171 //if ( remCh )
1115 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 1172 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
1116 locCh = ( localMod > mLastCalendarSync ); 1173 locCh = ( localMod > mLastCalendarSync );
1117 if ( !remCh && ! locCh ) { 1174 if ( !remCh && ! locCh ) {
1118 //qDebug("both not changed "); 1175 //qDebug("both not changed ");
1119 lastSync = localMod.addDays(1); 1176 lastSync = localMod.addDays(1);
1120 if ( mode <= SYNC_PREF_ASK ) 1177 if ( mode <= SYNC_PREF_ASK )
1121 return 0; 1178 return 0;
1122 } else { 1179 } else {
1123 if ( locCh ) { 1180 if ( locCh ) {
1124 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1()); 1181 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1());
1125 lastSync = localMod.addDays( -1 ); 1182 lastSync = localMod.addDays( -1 );
1126 if ( !remCh ) 1183 if ( !remCh )
1127 remoteMod = ( lastSync.addDays( -1 ) ); 1184 remoteMod = ( lastSync.addDays( -1 ) );
1128 } else { 1185 } else {
1129 //qDebug(" not loc changed "); 1186 //qDebug(" not loc changed ");
1130 lastSync = localMod.addDays( 1 ); 1187 lastSync = localMod.addDays( 1 );
1131 if ( remCh ) 1188 if ( remCh )
1132 remoteMod =( lastSync.addDays( 1 ) ); 1189 remoteMod =( lastSync.addDays( 1 ) );
1133 1190
1134 } 1191 }
1135 } 1192 }
1136 full = true; 1193 full = true;
1137 if ( mode < SYNC_PREF_ASK ) 1194 if ( mode < SYNC_PREF_ASK )
1138 mode = SYNC_PREF_ASK; 1195 mode = SYNC_PREF_ASK;
1139 } else { 1196 } else {
1140 if ( localMod == remoteMod ) 1197 if ( localMod == remoteMod )
1141 // if ( local->revision() == remote->revision() ) 1198 // if ( local->revision() == remote->revision() )
1142 return 0; 1199 return 0;
1143 1200
1144 } 1201 }
1145 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); 1202 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() );
1146 1203
1147 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision()); 1204 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision());
1148 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() ); 1205 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() );
1149 //full = true; //debug only 1206 //full = true; //debug only
1150 if ( full ) { 1207 if ( full ) {
1151 bool equ = false; 1208 bool equ = false;
1152 if ( local->typeID() == eventID ) { 1209 if ( local->typeID() == eventID ) {
1153 equ = (*((Event*) local) == *((Event*) remote)); 1210 equ = (*((Event*) local) == *((Event*) remote));
1154 } 1211 }
1155 else if ( local->typeID() == todoID ) 1212 else if ( local->typeID() == todoID )
1156 equ = (*((Todo*) local) == (*(Todo*) remote)); 1213 equ = (*((Todo*) local) == (*(Todo*) remote));
1157 else if ( local->typeID() == journalID ) 1214 else if ( local->typeID() == journalID )
1158 equ = (*((Journal*) local) == *((Journal*) remote)); 1215 equ = (*((Journal*) local) == *((Journal*) remote));
1159 if ( equ ) { 1216 if ( equ ) {
1160 //qDebug("equal "); 1217 //qDebug("equal ");
1161 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1218 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1162 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 1219 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
1163 } 1220 }
1164 if ( mode < SYNC_PREF_FORCE_LOCAL ) 1221 if ( mode < SYNC_PREF_FORCE_LOCAL )
1165 return 0; 1222 return 0;
1166 1223
1167 }//else //debug only 1224 }//else //debug only
1168 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 1225 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
1169 } 1226 }
1170 int result; 1227 int result;
1171 bool localIsNew; 1228 bool localIsNew;
1172 //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() ); 1229 //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() );
1173 1230
1174 1231
1175 // ************************************************ 1232 // ************************************************
1176 // ************************************************ 1233 // ************************************************
1177 // ************************************************ 1234 // ************************************************
1178 // We may have that lastSync > remoteMod AND lastSync > localMod 1235 // We may have that lastSync > remoteMod AND lastSync > localMod
1179 // BUT remoteMod != localMod 1236 // BUT remoteMod != localMod
1180 1237
1181 1238
1182 if ( full && mode < SYNC_PREF_NEWEST ) 1239 if ( full && mode < SYNC_PREF_NEWEST )
1183 mode = SYNC_PREF_ASK; 1240 mode = SYNC_PREF_ASK;
1184 1241
1185 switch( mode ) { 1242 switch( mode ) {
1186 case SYNC_PREF_LOCAL: 1243 case SYNC_PREF_LOCAL:
1187 if ( lastSync > remoteMod ) 1244 if ( lastSync > remoteMod )
1188 return 1; 1245 return 1;
1189 if ( lastSync > localMod ) 1246 if ( lastSync > localMod )
1190 return 2; 1247 return 2;
1191 return 1; 1248 return 1;
1192 break; 1249 break;
1193 case SYNC_PREF_REMOTE: 1250 case SYNC_PREF_REMOTE:
1194 if ( lastSync > localMod ) 1251 if ( lastSync > localMod )
1195 return 2; 1252 return 2;
1196 if ( lastSync > remoteMod ) 1253 if ( lastSync > remoteMod )
1197 return 1; 1254 return 1;
1198 return 2; 1255 return 2;
1199 break; 1256 break;
1200 case SYNC_PREF_NEWEST: 1257 case SYNC_PREF_NEWEST:
1201 if ( localMod >= remoteMod ) 1258 if ( localMod >= remoteMod )
1202 return 1; 1259 return 1;
1203 else 1260 else
1204 return 2; 1261 return 2;
1205 break; 1262 break;
1206 case SYNC_PREF_ASK: 1263 case SYNC_PREF_ASK:
1207 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 1264 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
1208 if ( lastSync > remoteMod && lastSync > localMod) 1265 if ( lastSync > remoteMod && lastSync > localMod)
1209 return 0; 1266 return 0;
1210 if ( lastSync > remoteMod ) 1267 if ( lastSync > remoteMod )
1211 return 1; 1268 return 1;
1212 if ( lastSync > localMod ) 1269 if ( lastSync > localMod )
1213 return 2; 1270 return 2;
1214 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 1271 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
1215 localIsNew = localMod >= remoteMod; 1272 localIsNew = localMod >= remoteMod;
1216 if ( localIsNew ) 1273 if ( localIsNew )
1217 getEventViewerDialog()->setColorMode( 1 ); 1274 getEventViewerDialog()->setColorMode( 1 );
1218 else 1275 else
1219 getEventViewerDialog()->setColorMode( 2 ); 1276 getEventViewerDialog()->setColorMode( 2 );
1220 getEventViewerDialog()->setIncidence(local); 1277 getEventViewerDialog()->setIncidence(local);
1221 if ( localIsNew ) 1278 if ( localIsNew )
1222 getEventViewerDialog()->setColorMode( 2 ); 1279 getEventViewerDialog()->setColorMode( 2 );
1223 else 1280 else
1224 getEventViewerDialog()->setColorMode( 1 ); 1281 getEventViewerDialog()->setColorMode( 1 );
1225 getEventViewerDialog()->addIncidence(remote); 1282 getEventViewerDialog()->addIncidence(remote);
1226 getEventViewerDialog()->setColorMode( 0 ); 1283 getEventViewerDialog()->setColorMode( 0 );
1227 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() ); 1284 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() );
1228 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!")); 1285 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!"));
1229 getEventViewerDialog()->showMe(); 1286 getEventViewerDialog()->showMe();
1230 result = getEventViewerDialog()->executeS( localIsNew ); 1287 result = getEventViewerDialog()->executeS( localIsNew );
1231 return result; 1288 return result;
1232 1289
1233 break; 1290 break;
1234 case SYNC_PREF_FORCE_LOCAL: 1291 case SYNC_PREF_FORCE_LOCAL:
1235 return 1; 1292 return 1;
1236 break; 1293 break;
1237 case SYNC_PREF_FORCE_REMOTE: 1294 case SYNC_PREF_FORCE_REMOTE:
1238 return 2; 1295 return 2;
1239 break; 1296 break;
1240 1297
1241 default: 1298 default:
1242 // SYNC_PREF_TAKE_BOTH not implemented 1299 // SYNC_PREF_TAKE_BOTH not implemented
1243 break; 1300 break;
1244 } 1301 }
1245 return 0; 1302 return 0;
1246} 1303}
1247Event* CalendarView::getLastSyncEvent() 1304Event* CalendarView::getLastSyncEvent()
1248{ 1305{
1249 Event* lse; 1306 Event* lse;
1250 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 1307 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
1251 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice ); 1308 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice );
1252 if (!lse) { 1309 if (!lse) {
1253 lse = new Event(); 1310 lse = new Event();
1254 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); 1311 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice );
1255 QString sum = ""; 1312 QString sum = "";
1256 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) 1313 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) )
1257 sum = "E: "; 1314 sum = "E: ";
1258 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); 1315 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event"));
1259 lse->setDtStart( mLastCalendarSync ); 1316 lse->setDtStart( mLastCalendarSync );
1260 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1317 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1261 lse->setCategories( i18n("SyncEvent") ); 1318 lse->setCategories( i18n("SyncEvent") );
1262 lse->setReadOnly( true ); 1319 lse->setReadOnly( true );
1263 mCalendar->addEvent( lse ); 1320 mCalendar->addEvent( lse );
1264 } 1321 }
1265 1322
1266 return lse; 1323 return lse;
1267 1324
1268} 1325}
1269 1326
1270// we check, if the to delete event has a id for a profile 1327// we check, if the to delete event has a id for a profile
1271// if yes, we set this id in the profile to delete 1328// if yes, we set this id in the profile to delete
1272void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) 1329void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
1273{ 1330{
1274 if ( lastSync.count() == 0 ) { 1331 if ( lastSync.count() == 0 ) {
1275 //qDebug(" lastSync.count() == 0"); 1332 //qDebug(" lastSync.count() == 0");
1276 return; 1333 return;
1277 } 1334 }
1278 if ( toDelete->typeID() == journalID ) 1335 if ( toDelete->typeID() == journalID )
1279 return; 1336 return;
1280 1337
1281 Event* eve = lastSync.first(); 1338 Event* eve = lastSync.first();
1282 1339
1283 while ( eve ) { 1340 while ( eve ) {
1284 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name 1341 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
1285 if ( !id.isEmpty() ) { 1342 if ( !id.isEmpty() ) {
1286 QString des = eve->description(); 1343 QString des = eve->description();
1287 QString pref = "e"; 1344 QString pref = "e";
1288 if ( toDelete->typeID() == todoID ) 1345 if ( toDelete->typeID() == todoID )
1289 pref = "t"; 1346 pref = "t";
1290 des += pref+ id + ","; 1347 des += pref+ id + ",";
1291 eve->setReadOnly( false ); 1348 eve->setReadOnly( false );
1292 eve->setDescription( des ); 1349 eve->setDescription( des );
1293 //qDebug("setdes %s ", des.latin1()); 1350 //qDebug("setdes %s ", des.latin1());
1294 eve->setReadOnly( true ); 1351 eve->setReadOnly( true );
1295 } 1352 }
1296 eve = lastSync.next(); 1353 eve = lastSync.next();
1297 } 1354 }
1298 1355
1299} 1356}
1300void CalendarView::checkExternalId( Incidence * inc ) 1357void CalendarView::checkExternalId( Incidence * inc )
1301{ 1358{
1302 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; 1359 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
1303 checkExternSyncEvent( lastSync, inc ); 1360 checkExternSyncEvent( lastSync, inc );
1304 1361
1305} 1362}
1306bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) 1363bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
1307{ 1364{
1308 bool syncOK = true; 1365 bool syncOK = true;
1309 int addedEvent = 0; 1366 int addedEvent = 0;
1310 int addedEventR = 0; 1367 int addedEventR = 0;
1311 int deletedEventR = 0; 1368 int deletedEventR = 0;
1312 int deletedEventL = 0; 1369 int deletedEventL = 0;
1313 int changedLocal = 0; 1370 int changedLocal = 0;
1314 int changedRemote = 0; 1371 int changedRemote = 0;
1315 int filteredIN = 0; 1372 int filteredIN = 0;
1316 int filteredOUT = 0; 1373 int filteredOUT = 0;
1317 //QPtrList<Event> el = local->rawEvents(); 1374 //QPtrList<Event> el = local->rawEvents();
1318 Event* eventR; 1375 Event* eventR;
1319 QString uid; 1376 QString uid;
1320 int take; 1377 int take;
1321 Event* eventRSync; 1378 Event* eventRSync;
1322 Event* eventLSync; 1379 Event* eventLSync;
1323 clearAllViews(); 1380 clearAllViews();
1324 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 1381 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
1325 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 1382 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
1326 bool fullDateRange = false; 1383 bool fullDateRange = false;
1327 local->resetTempSyncStat(); 1384 local->resetTempSyncStat();
1328 mLastCalendarSync = QDateTime::currentDateTime(); 1385 mLastCalendarSync = QDateTime::currentDateTime();
1329 if ( mSyncManager->syncWithDesktop() ) { 1386 if ( mSyncManager->syncWithDesktop() ) {
1330 remote->resetPilotStat(1); 1387 remote->resetPilotStat(1);
1331 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 1388 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
1332 mLastCalendarSync = KSyncManager::mRequestedSyncEvent; 1389 mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
1333 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); 1390 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
1334 } else { 1391 } else {
1335 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); 1392 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
1336 } 1393 }
1337 } 1394 }
1338 QDateTime modifiedCalendar = mLastCalendarSync; 1395 QDateTime modifiedCalendar = mLastCalendarSync;
1339 eventLSync = getLastSyncEvent(); 1396 eventLSync = getLastSyncEvent();
1340 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 1397 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
1341 if ( eventR ) { 1398 if ( eventR ) {
1342 eventRSync = (Event*) eventR->clone(); 1399 eventRSync = (Event*) eventR->clone();
1343 remote->deleteEvent(eventR ); 1400 remote->deleteEvent(eventR );
1344 1401
1345 } else { 1402 } else {
1346 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { 1403 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
1347 eventRSync = (Event*)eventLSync->clone(); 1404 eventRSync = (Event*)eventLSync->clone();
1348 } else { 1405 } else {
1349 fullDateRange = true; 1406 fullDateRange = true;
1350 eventRSync = new Event(); 1407 eventRSync = new Event();
1351 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 1408 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
1352 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 1409 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
1353 eventRSync->setDtStart( mLastCalendarSync ); 1410 eventRSync->setDtStart( mLastCalendarSync );
1354 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1411 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1355 eventRSync->setCategories( i18n("SyncEvent") ); 1412 eventRSync->setCategories( i18n("SyncEvent") );
1356 } 1413 }
1357 } 1414 }
1358 if ( eventLSync->dtStart() == mLastCalendarSync ) 1415 if ( eventLSync->dtStart() == mLastCalendarSync )
1359 fullDateRange = true; 1416 fullDateRange = true;
1360 1417
1361 if ( ! fullDateRange ) { 1418 if ( ! fullDateRange ) {
1362 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 1419 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
1363 1420
1364 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 1421 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
1365 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 1422 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
1366 fullDateRange = true; 1423 fullDateRange = true;
1367 } 1424 }
1368 } 1425 }
1369 if ( mSyncManager->syncWithDesktop() ) { 1426 if ( mSyncManager->syncWithDesktop() ) {
1370 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); 1427 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync );
1371 } 1428 }
1372 if ( fullDateRange ) 1429 if ( fullDateRange )
1373 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 1430 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
1374 else 1431 else
1375 mLastCalendarSync = eventLSync->dtStart(); 1432 mLastCalendarSync = eventLSync->dtStart();
1376 // for resyncing if own file has changed 1433 // for resyncing if own file has changed
1377 if ( mCurrentSyncDevice == "deleteaftersync" ) { 1434 if ( mCurrentSyncDevice == "deleteaftersync" ) {
1378 mLastCalendarSync = loadedFileVersion; 1435 mLastCalendarSync = loadedFileVersion;
1379 //qDebug("setting mLastCalendarSync "); 1436 //qDebug("setting mLastCalendarSync ");
1380 } 1437 }
1381 //qDebug("*************************** "); 1438 //qDebug("*************************** ");
1382 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 1439 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
1383 QPtrList<Incidence> er = remote->rawIncidences(); 1440 QPtrList<Incidence> er = remote->rawIncidences();
1384 Incidence* inR = er.first(); 1441 Incidence* inR = er.first();
1385 Incidence* inL; 1442 Incidence* inL;
1386 QProgressBar bar( er.count(),0 ); 1443 QProgressBar bar( er.count(),0 );
1387 bar.setCaption (i18n("Syncing - close to abort!") ); 1444 bar.setCaption (i18n("Syncing - close to abort!") );
1388 1445
1389 // ************** setting up filter ************* 1446 // ************** setting up filter *************
1390 CalFilter *filterIN = 0; 1447 CalFilter *filterIN = 0;
1391 CalFilter *filterOUT = 0; 1448 CalFilter *filterOUT = 0;
1392 CalFilter *filter = mFilters.first(); 1449 CalFilter *filter = mFilters.first();
1393 while(filter) { 1450 while(filter) {
1394 if ( filter->name() == mSyncManager->mFilterInCal ) 1451 if ( filter->name() == mSyncManager->mFilterInCal )
1395 filterIN = filter; 1452 filterIN = filter;
1396 if ( filter->name() == mSyncManager->mFilterOutCal ) 1453 if ( filter->name() == mSyncManager->mFilterOutCal )
1397 filterOUT = filter; 1454 filterOUT = filter;
1398 filter = mFilters.next(); 1455 filter = mFilters.next();
1399 } 1456 }
1400 int w = 300; 1457 int w = 300;
1401 if ( QApplication::desktop()->width() < 320 ) 1458 if ( QApplication::desktop()->width() < 320 )
1402 w = 220; 1459 w = 220;
1403 int h = bar.sizeHint().height() ; 1460 int h = bar.sizeHint().height() ;
1404 int dw = QApplication::desktop()->width(); 1461 int dw = QApplication::desktop()->width();
1405 int dh = QApplication::desktop()->height(); 1462 int dh = QApplication::desktop()->height();
1406 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1463 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1407 bar.show(); 1464 bar.show();
1408 int modulo = (er.count()/10)+1; 1465 int modulo = (er.count()/10)+1;
1409 int incCounter = 0; 1466 int incCounter = 0;
1410 while ( inR ) { 1467 while ( inR ) {
1411 if ( ! bar.isVisible() ) 1468 if ( ! bar.isVisible() )
1412 return false; 1469 return false;
1413 if ( incCounter % modulo == 0 ) 1470 if ( incCounter % modulo == 0 )
1414 bar.setProgress( incCounter ); 1471 bar.setProgress( incCounter );
1415 ++incCounter; 1472 ++incCounter;
1416 uid = inR->uid(); 1473 uid = inR->uid();
1417 bool skipIncidence = false; 1474 bool skipIncidence = false;
1418 if ( uid.left(15) == QString("last-syncEvent-") ) 1475 if ( uid.left(15) == QString("last-syncEvent-") )
1419 skipIncidence = true; 1476 skipIncidence = true;
1420 QString idS; 1477 QString idS;
1421 qApp->processEvents(); 1478 qApp->processEvents();
1422 if ( !skipIncidence ) { 1479 if ( !skipIncidence ) {
1423 inL = local->incidence( uid ); 1480 inL = local->incidence( uid );
1424 if ( inL ) { // maybe conflict - same uid in both calendars 1481 if ( inL ) { // maybe conflict - same uid in both calendars
1425 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { 1482 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
1426 //qDebug("take %d %s ", take, inL->summary().latin1()); 1483 //qDebug("take %d %s ", take, inL->summary().latin1());
1427 if ( take == 3 ) 1484 if ( take == 3 )
1428 return false; 1485 return false;
1429 if ( take == 1 ) {// take local ********************** 1486 if ( take == 1 ) {// take local **********************
1430 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 1487 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
1431 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1488 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1432 else 1489 else
1433 idS = inR->IDStr(); 1490 idS = inR->IDStr();
1434 remote->deleteIncidence( inR ); 1491 remote->deleteIncidence( inR );
1435 inR = inL->clone(); 1492 inR = inL->clone();
1436 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1493 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1437 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1494 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1438 inR->setIDStr( idS ); 1495 inR->setIDStr( idS );
1439 remote->addIncidence( inR ); 1496 remote->addIncidence( inR );
1440 if ( mSyncManager->syncWithDesktop() ) 1497 if ( mSyncManager->syncWithDesktop() )
1441 inR->setPilotId( 2 ); 1498 inR->setPilotId( 2 );
1442 ++changedRemote; 1499 ++changedRemote;
1443 } else {// take remote ********************** 1500 } else {// take remote **********************
1444 idS = inL->IDStr(); 1501 idS = inL->IDStr();
1445 int pid = inL->pilotId(); 1502 int pid = inL->pilotId();
1446 local->deleteIncidence( inL ); 1503 local->deleteIncidence( inL );
1447 inL = inR->clone(); 1504 inL = inR->clone();
1448 if ( mSyncManager->syncWithDesktop() ) 1505 if ( mSyncManager->syncWithDesktop() )
1449 inL->setPilotId( pid ); 1506 inL->setPilotId( pid );
1450 inL->setIDStr( idS ); 1507 inL->setIDStr( idS );
1451 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1508 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1452 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1509 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1453 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1510 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1454 } 1511 }
1455 local->addIncidence( inL ); 1512 local->addIncidence( inL );
1456 ++changedLocal; 1513 ++changedLocal;
1457 } 1514 }
1458 } 1515 }
1459 } else { // no conflict ********** add or delete remote 1516 } else { // no conflict ********** add or delete remote
1460 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ 1517 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){
1461 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1518 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1462 QString des = eventLSync->description(); 1519 QString des = eventLSync->description();
1463 QString pref = "e"; 1520 QString pref = "e";
1464 if ( inR->typeID() == todoID ) 1521 if ( inR->typeID() == todoID )
1465 pref = "t"; 1522 pref = "t";
1466 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1523 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1467 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1524 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1468 //remote->deleteIncidence( inR ); 1525 //remote->deleteIncidence( inR );
1469 ++deletedEventR; 1526 ++deletedEventR;
1470 } else { 1527 } else {
1471 inR->setLastModified( modifiedCalendar ); 1528 inR->setLastModified( modifiedCalendar );
1472 inL = inR->clone(); 1529 inL = inR->clone();
1473 inL->setIDStr( ":" ); 1530 inL->setIDStr( ":" );
1474 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1531 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1475 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1532 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1476 local->addIncidence( inL ); 1533 local->addIncidence( inL );
1477 ++addedEvent; 1534 ++addedEvent;
1478 1535
1479 } 1536 }
1480 } else { 1537 } else {
1481 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1538 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1482 inR->setLastModified( modifiedCalendar ); 1539 inR->setLastModified( modifiedCalendar );
1483 inL = inR->clone(); 1540 inL = inR->clone();
1484 inL->setIDStr( ":" ); 1541 inL->setIDStr( ":" );
1485 local->addIncidence( inL ); 1542 local->addIncidence( inL );
1486 ++addedEvent; 1543 ++addedEvent;
1487 1544
1488 } else { 1545 } else {
1489 checkExternSyncEvent(eventRSyncSharp, inR); 1546 checkExternSyncEvent(eventRSyncSharp, inR);
1490 remote->deleteIncidence( inR ); 1547 remote->deleteIncidence( inR );
1491 ++deletedEventR; 1548 ++deletedEventR;
1492 } 1549 }
1493 } 1550 }
1494 } else { 1551 } else {
1495 ++filteredIN; 1552 ++filteredIN;
1496 } 1553 }
1497 } 1554 }
1498 } 1555 }
1499 inR = er.next(); 1556 inR = er.next();
1500 } 1557 }
1501 QPtrList<Incidence> el = local->rawIncidences(); 1558 QPtrList<Incidence> el = local->rawIncidences();
1502 inL = el.first(); 1559 inL = el.first();
1503 modulo = (el.count()/10)+1; 1560 modulo = (el.count()/10)+1;
1504 bar.setCaption (i18n("Add / remove events") ); 1561 bar.setCaption (i18n("Add / remove events") );
1505 bar.setTotalSteps ( el.count() ) ; 1562 bar.setTotalSteps ( el.count() ) ;
1506 bar.show(); 1563 bar.show();
1507 incCounter = 0; 1564 incCounter = 0;
1508 1565
1509 while ( inL ) { 1566 while ( inL ) {
1510 1567
1511 qApp->processEvents(); 1568 qApp->processEvents();
1512 if ( ! bar.isVisible() ) 1569 if ( ! bar.isVisible() )
1513 return false; 1570 return false;
1514 if ( incCounter % modulo == 0 ) 1571 if ( incCounter % modulo == 0 )
1515 bar.setProgress( incCounter ); 1572 bar.setProgress( incCounter );
1516 ++incCounter; 1573 ++incCounter;
1517 uid = inL->uid(); 1574 uid = inL->uid();
1518 bool skipIncidence = false; 1575 bool skipIncidence = false;
1519 if ( uid.left(15) == QString("last-syncEvent-") ) 1576 if ( uid.left(15) == QString("last-syncEvent-") )
1520 skipIncidence = true; 1577 skipIncidence = true;
1521 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) 1578 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
1522 skipIncidence = true; 1579 skipIncidence = true;
1523 if ( !skipIncidence ) { 1580 if ( !skipIncidence ) {
1524 inR = remote->incidence( uid ); 1581 inR = remote->incidence( uid );
1525 if ( ! inR ) { 1582 if ( ! inR ) {
1526 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ 1583 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
1527 // no conflict ********** add or delete local 1584 // no conflict ********** add or delete local
1528 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1585 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1529 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1586 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1530 checkExternSyncEvent(eventLSyncSharp, inL); 1587 checkExternSyncEvent(eventLSyncSharp, inL);
1531 local->deleteIncidence( inL ); 1588 local->deleteIncidence( inL );
1532 ++deletedEventL; 1589 ++deletedEventL;
1533 } else { 1590 } else {
1534 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1591 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1535 inL->removeID(mCurrentSyncDevice ); 1592 inL->removeID(mCurrentSyncDevice );
1536 ++addedEventR; 1593 ++addedEventR;
1537 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1594 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1538 inL->setLastModified( modifiedCalendar ); 1595 inL->setLastModified( modifiedCalendar );
1539 inR = inL->clone(); 1596 inR = inL->clone();
1540 inR->setIDStr( ":" ); 1597 inR->setIDStr( ":" );
1541 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1598 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1542 remote->addIncidence( inR ); 1599 remote->addIncidence( inR );
1543 } 1600 }
1544 } 1601 }
1545 } else { 1602 } else {
1546 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1603 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1547 checkExternSyncEvent(eventLSyncSharp, inL); 1604 checkExternSyncEvent(eventLSyncSharp, inL);
1548 local->deleteIncidence( inL ); 1605 local->deleteIncidence( inL );
1549 ++deletedEventL; 1606 ++deletedEventL;
1550 } else { 1607 } else {
1551 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1608 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1552 ++addedEventR; 1609 ++addedEventR;
1553 inL->setLastModified( modifiedCalendar ); 1610 inL->setLastModified( modifiedCalendar );
1554 inR = inL->clone(); 1611 inR = inL->clone();
1555 inR->setIDStr( ":" ); 1612 inR->setIDStr( ":" );
1556 remote->addIncidence( inR ); 1613 remote->addIncidence( inR );
1557 } 1614 }
1558 } 1615 }
1559 } 1616 }
1560 } else { 1617 } else {
1561 ++filteredOUT; 1618 ++filteredOUT;
1562 } 1619 }
1563 } 1620 }
1564 } 1621 }
1565 inL = el.next(); 1622 inL = el.next();
1566 } 1623 }
1567 int delFut = 0; 1624 int delFut = 0;
1568 int remRem = 0; 1625 int remRem = 0;
1569 if ( mSyncManager->mWriteBackInFuture ) { 1626 if ( mSyncManager->mWriteBackInFuture ) {
1570 er = remote->rawIncidences(); 1627 er = remote->rawIncidences();
1571 remRem = er.count(); 1628 remRem = er.count();
1572 inR = er.first(); 1629 inR = er.first();
1573 QDateTime dt; 1630 QDateTime dt;
1574 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); 1631 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) );
1575 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); 1632 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 );
1576 while ( inR ) { 1633 while ( inR ) {
1577 if ( inR->typeID() == todoID ) { 1634 if ( inR->typeID() == todoID ) {
1578 Todo * t = (Todo*)inR; 1635 Todo * t = (Todo*)inR;
1579 if ( t->hasDueDate() ) 1636 if ( t->hasDueDate() )
1580 dt = t->dtDue(); 1637 dt = t->dtDue();
1581 else 1638 else
1582 dt = cur.addSecs( 62 ); 1639 dt = cur.addSecs( 62 );
1583 } 1640 }
1584 else if (inR->typeID() == eventID ) { 1641 else if (inR->typeID() == eventID ) {
1585 bool ok; 1642 bool ok;
1586 dt = inR->getNextOccurence( cur, &ok ); 1643 dt = inR->getNextOccurence( cur, &ok );
1587 if ( !ok ) 1644 if ( !ok )
1588 dt = cur.addSecs( -62 ); 1645 dt = cur.addSecs( -62 );
1589 } 1646 }
1590 else 1647 else
1591 dt = inR->dtStart(); 1648 dt = inR->dtStart();
1592 if ( dt < cur || dt > end ) { 1649 if ( dt < cur || dt > end ) {
1593 remote->deleteIncidence( inR ); 1650 remote->deleteIncidence( inR );
1594 ++delFut; 1651 ++delFut;
1595 } 1652 }
1596 inR = er.next(); 1653 inR = er.next();
1597 } 1654 }
1598 } 1655 }
1599 bar.hide(); 1656 bar.hide();
1600 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1657 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1601 eventLSync->setReadOnly( false ); 1658 eventLSync->setReadOnly( false );
1602 eventLSync->setDtStart( mLastCalendarSync ); 1659 eventLSync->setDtStart( mLastCalendarSync );
1603 eventRSync->setDtStart( mLastCalendarSync ); 1660 eventRSync->setDtStart( mLastCalendarSync );
1604 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1661 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1605 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1662 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1606 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1663 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1607 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1664 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1608 eventLSync->setReadOnly( true ); 1665 eventLSync->setReadOnly( true );
1609 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL ); 1666 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL );
1610 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1667 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1611 remote->addEvent( eventRSync ); 1668 remote->addEvent( eventRSync );
1612 else 1669 else
1613 delete eventRSync; 1670 delete eventRSync;
1614 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() ); 1671 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() );
1615 QString mes; 1672 QString mes;
1616 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 ); 1673 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 );
1617 QString delmess; 1674 QString delmess;
1618 if ( delFut ) { 1675 if ( delFut ) {
1619 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); 1676 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);
1620 mes += delmess; 1677 mes += delmess;
1621 } 1678 }
1622 mes = i18n("Local calendar changed!\n") +mes; 1679 mes = i18n("Local calendar changed!\n") +mes;
1623 mCalendar->checkAlarmForIncidence( 0, true ); 1680 mCalendar->checkAlarmForIncidence( 0, true );
1624 qDebug( mes ); 1681 qDebug( mes );
1625 if ( mSyncManager->mShowSyncSummary ) { 1682 if ( mSyncManager->mShowSyncSummary ) {
1626 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1683 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1627 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1684 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1628 qDebug("KO: WB cancelled "); 1685 qDebug("KO: WB cancelled ");
1629 mSyncManager->mWriteBackFile = false; 1686 mSyncManager->mWriteBackFile = false;
1630 return syncOK; 1687 return syncOK;
1631 } 1688 }
1632 } 1689 }
1633 return syncOK; 1690 return syncOK;
1634} 1691}
1635 1692
1636void CalendarView::setSyncDevice( QString s ) 1693void CalendarView::setSyncDevice( QString s )
1637{ 1694{
1638 mCurrentSyncDevice= s; 1695 mCurrentSyncDevice= s;
1639} 1696}
1640void CalendarView::setSyncName( QString s ) 1697void CalendarView::setSyncName( QString s )
1641{ 1698{
1642 mCurrentSyncName= s; 1699 mCurrentSyncName= s;
1643} 1700}
1644bool CalendarView::syncCalendar(QString filename, int mode) 1701bool CalendarView::syncCalendar(QString filename, int mode)
1645{ 1702{
1646 //qDebug("syncCalendar %s ", filename.latin1()); 1703 //qDebug("syncCalendar %s ", filename.latin1());
1647 mGlobalSyncMode = SYNC_MODE_NORMAL; 1704 mGlobalSyncMode = SYNC_MODE_NORMAL;
1648 CalendarLocal* calendar = new CalendarLocal(); 1705 CalendarLocal* calendar = new CalendarLocal();
1649 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1706 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1650 FileStorage* storage = new FileStorage( calendar ); 1707 FileStorage* storage = new FileStorage( calendar );
1651 bool syncOK = false; 1708 bool syncOK = false;
1652 storage->setFileName( filename ); 1709 storage->setFileName( filename );
1653 // qDebug("loading ... "); 1710 // qDebug("loading ... ");
1654 if ( storage->load() ) { 1711 if ( storage->load() ) {
1655 getEventViewerDialog()->setSyncMode( true ); 1712 getEventViewerDialog()->setSyncMode( true );
1656 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1713 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1657 getEventViewerDialog()->setSyncMode( false ); 1714 getEventViewerDialog()->setSyncMode( false );
1658 if ( syncOK ) { 1715 if ( syncOK ) {
1659 if ( mSyncManager->mWriteBackFile ) 1716 if ( mSyncManager->mWriteBackFile )
1660 { 1717 {
1661 storage->setSaveFormat( new ICalFormat() ); 1718 storage->setSaveFormat( new ICalFormat() );
1662 storage->save(); 1719 storage->save();
1663 } 1720 }
1664 } 1721 }
1665 setModified( true ); 1722 setModified( true );
1666 } 1723 }
1667 delete storage; 1724 delete storage;
1668 delete calendar; 1725 delete calendar;
1669 if ( syncOK ) 1726 if ( syncOK )
1670 updateView(); 1727 updateView();
1671 return syncOK; 1728 return syncOK;
1672} 1729}
1673 1730
1674void CalendarView::syncExternal( int mode ) 1731void CalendarView::syncExternal( int mode )
1675{ 1732{
1676 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1733 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1677 1734
1678 qApp->processEvents(); 1735 qApp->processEvents();
1679 CalendarLocal* calendar = new CalendarLocal(); 1736 CalendarLocal* calendar = new CalendarLocal();
1680 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1737 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1681 bool syncOK = false; 1738 bool syncOK = false;
1682 bool loadSuccess = false; 1739 bool loadSuccess = false;
1683 PhoneFormat* phoneFormat = 0; 1740 PhoneFormat* phoneFormat = 0;
1684 emit tempDisableBR(true); 1741 emit tempDisableBR(true);
1685#ifndef DESKTOP_VERSION 1742#ifndef DESKTOP_VERSION
1686 SharpFormat* sharpFormat = 0; 1743 SharpFormat* sharpFormat = 0;
1687 if ( mode == 0 ) { // sharp 1744 if ( mode == 0 ) { // sharp
1688 sharpFormat = new SharpFormat () ; 1745 sharpFormat = new SharpFormat () ;
1689 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1746 loadSuccess = sharpFormat->load( calendar, mCalendar );
1690 1747
1691 } else 1748 } else
1692#endif 1749#endif
1693 if ( mode == 1 ) { // phone 1750 if ( mode == 1 ) { // phone
1694 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1751 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1695 mSyncManager->mPhoneDevice, 1752 mSyncManager->mPhoneDevice,
1696 mSyncManager->mPhoneConnection, 1753 mSyncManager->mPhoneConnection,
1697 mSyncManager->mPhoneModel); 1754 mSyncManager->mPhoneModel);
1698 loadSuccess = phoneFormat->load( calendar,mCalendar); 1755 loadSuccess = phoneFormat->load( calendar,mCalendar);
1699 1756
1700 } else { 1757 } else {
1701 emit tempDisableBR(false); 1758 emit tempDisableBR(false);
1702 return; 1759 return;
1703 } 1760 }
1704 if ( loadSuccess ) { 1761 if ( loadSuccess ) {
1705 getEventViewerDialog()->setSyncMode( true ); 1762 getEventViewerDialog()->setSyncMode( true );
1706 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1763 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1707 getEventViewerDialog()->setSyncMode( false ); 1764 getEventViewerDialog()->setSyncMode( false );
1708 qApp->processEvents(); 1765 qApp->processEvents();
1709 if ( syncOK ) { 1766 if ( syncOK ) {
1710 if ( mSyncManager->mWriteBackFile ) 1767 if ( mSyncManager->mWriteBackFile )
1711 { 1768 {
1712 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1769 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1713 Incidence* inc = iL.first(); 1770 Incidence* inc = iL.first();
1714 if ( phoneFormat ) { 1771 if ( phoneFormat ) {
1715 while ( inc ) { 1772 while ( inc ) {
1716 inc->removeID(mCurrentSyncDevice); 1773 inc->removeID(mCurrentSyncDevice);
1717 inc = iL.next(); 1774 inc = iL.next();
1718 } 1775 }
1719 } 1776 }
1720#ifndef DESKTOP_VERSION 1777#ifndef DESKTOP_VERSION
1721 if ( sharpFormat ) 1778 if ( sharpFormat )
1722 sharpFormat->save(calendar); 1779 sharpFormat->save(calendar);
1723#endif 1780#endif
1724 if ( phoneFormat ) 1781 if ( phoneFormat )
1725 phoneFormat->save(calendar); 1782 phoneFormat->save(calendar);
1726 iL = calendar->rawIncidences(); 1783 iL = calendar->rawIncidences();
1727 inc = iL.first(); 1784 inc = iL.first();
1728 Incidence* loc; 1785 Incidence* loc;
1729 while ( inc ) { 1786 while ( inc ) {
1730 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1787 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1731 loc = mCalendar->incidence(inc->uid() ); 1788 loc = mCalendar->incidence(inc->uid() );
1732 if ( loc ) { 1789 if ( loc ) {
1733 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1790 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1734 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1791 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1735 } 1792 }
1736 } 1793 }
1737 inc = iL.next(); 1794 inc = iL.next();
1738 } 1795 }
1739 Incidence* lse = getLastSyncEvent(); 1796 Incidence* lse = getLastSyncEvent();
1740 if ( lse ) { 1797 if ( lse ) {
1741 lse->setReadOnly( false ); 1798 lse->setReadOnly( false );
1742 lse->setDescription( "" ); 1799 lse->setDescription( "" );
1743 lse->setReadOnly( true ); 1800 lse->setReadOnly( true );
1744 } 1801 }
1745 } 1802 }
1746 } else { 1803 } else {
1747 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 1804 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
1748 } 1805 }
1749 setModified( true ); 1806 setModified( true );
1750 } else { 1807 } else {
1751 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1808 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1752 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1809 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1753 question, i18n("Ok")) ; 1810 question, i18n("Ok")) ;
1754 1811
1755 } 1812 }
1756 delete calendar; 1813 delete calendar;
1757 updateView(); 1814 updateView();
1758 emit tempDisableBR(false); 1815 emit tempDisableBR(false);
1759 return ;//syncOK; 1816 return ;//syncOK;
1760 1817
1761} 1818}
1762 1819
1763bool CalendarView::importBday() 1820bool CalendarView::importBday()
1764{ 1821{
1765#ifndef KORG_NOKABC 1822#ifndef KORG_NOKABC
1766 1823
1767#ifdef DESKTOP_VERSION 1824#ifdef DESKTOP_VERSION
1768 int curCal = mCalendar->defaultCalendar(); 1825 int curCal = mCalendar->defaultCalendar();
1769 int bd = mCalEditView->getBirtdayID(); 1826 int bd = mCalEditView->getBirtdayID();
1770 if ( bd == 0 ) 1827 if ( bd == 0 )
1771 return false; 1828 return false;
1772 mCalendar->setDefaultCalendar( bd ); 1829 mCalendar->setDefaultCalendar( bd );
1773 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1830 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1774 KABC::AddressBook::Iterator it; 1831 KABC::AddressBook::Iterator it;
1775 int count = 0; 1832 int count = 0;
1776 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1833 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1777 ++count; 1834 ++count;
1778 } 1835 }
1779 QProgressBar bar(count,0 ); 1836 QProgressBar bar(count,0 );
1780 int w = 300; 1837 int w = 300;
1781 if ( QApplication::desktop()->width() < 320 ) 1838 if ( QApplication::desktop()->width() < 320 )
1782 w = 220; 1839 w = 220;
1783 int h = bar.sizeHint().height() ; 1840 int h = bar.sizeHint().height() ;
1784 int dw = QApplication::desktop()->width(); 1841 int dw = QApplication::desktop()->width();
1785 int dh = QApplication::desktop()->height(); 1842 int dh = QApplication::desktop()->height();
1786 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1843 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1787 bar.show(); 1844 bar.show();
1788 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1845 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1789 qApp->processEvents(); 1846 qApp->processEvents();
1790 count = 0; 1847 count = 0;
1791 int addCount = 0; 1848 int addCount = 0;
1792 KCal::Attendee* a = 0; 1849 KCal::Attendee* a = 0;
1793 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1850 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1794 if ( ! bar.isVisible() ) 1851 if ( ! bar.isVisible() )
1795 return false; 1852 return false;
1796 bar.setProgress( count++ ); 1853 bar.setProgress( count++ );
1797 qApp->processEvents(); 1854 qApp->processEvents();
1798 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1855 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1799 if ( (*it).birthday().date().isValid() ){ 1856 if ( (*it).birthday().date().isValid() ){
1800 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1857 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1801 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1858 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1802 ++addCount; 1859 ++addCount;
1803 } 1860 }
1804 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1861 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1805 if ( anni.isValid() ){ 1862 if ( anni.isValid() ){
1806 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1863 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1807 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1864 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1808 ++addCount; 1865 ++addCount;
1809 } 1866 }
1810 } 1867 }
1811 mCalendar->setDefaultCalendar( curCal ); 1868 mCalendar->setDefaultCalendar( curCal );
1812 updateView(); 1869 updateView();
1813 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1870 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1814#else //DESKTOP_VERSION 1871#else //DESKTOP_VERSION
1815 1872
1816 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 1873 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
1817 // the result should now arrive through method insertBirthdays 1874 // the result should now arrive through method insertBirthdays
1818 1875
1819#endif //DESKTOP_VERSION 1876#endif //DESKTOP_VERSION
1820 1877
1821#endif //KORG_NOKABC 1878#endif //KORG_NOKABC
1822 1879
1823 1880
1824 return true; 1881 return true;
1825} 1882}
1826 1883
1827// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 1884// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
1828void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 1885void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
1829 const QStringList& anniversaryList, const QStringList& realNameList, 1886 const QStringList& anniversaryList, const QStringList& realNameList,
1830 const QStringList& emailList, const QStringList& assembledNameList, 1887 const QStringList& emailList, const QStringList& assembledNameList,
1831 const QStringList& uidList) 1888 const QStringList& uidList)
1832{ 1889{
1833 1890
1834 //qDebug("KO::CalendarView::insertBirthdays"); 1891 //qDebug("KO::CalendarView::insertBirthdays");
1835 if (uid == this->name()) 1892 if (uid == this->name())
1836 { 1893 {
1837 int curCal = mCalendar->defaultCalendar(); 1894 int curCal = mCalendar->defaultCalendar();
1838 int bd = mCalEditView->getBirtdayID(); 1895 int bd = mCalEditView->getBirtdayID();
1839 if ( bd == 0 ) 1896 if ( bd == 0 )
1840 return; 1897 return;
1841 mCalendar->setDefaultCalendar( bd ); 1898 mCalendar->setDefaultCalendar( bd );
1842 1899
1843 1900
1844 int count = birthdayList.count(); 1901 int count = birthdayList.count();
1845 int addCount = 0; 1902 int addCount = 0;
1846 KCal::Attendee* a = 0; 1903 KCal::Attendee* a = 0;
1847 1904
1848 //qDebug("CalView 1 %i", count); 1905 //qDebug("CalView 1 %i", count);
1849 1906
1850 QProgressBar bar(count,0 ); 1907 QProgressBar bar(count,0 );
1851 int w = 300; 1908 int w = 300;
1852 if ( QApplication::desktop()->width() < 320 ) 1909 if ( QApplication::desktop()->width() < 320 )
1853 w = 220; 1910 w = 220;
1854 int h = bar.sizeHint().height() ; 1911 int h = bar.sizeHint().height() ;
1855 int dw = QApplication::desktop()->width(); 1912 int dw = QApplication::desktop()->width();
1856 int dh = QApplication::desktop()->height(); 1913 int dh = QApplication::desktop()->height();
1857 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1914 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1858 bar.show(); 1915 bar.show();
1859 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 1916 bar.setCaption (i18n("inserting birthdays - close to abort!") );
1860 qApp->processEvents(); 1917 qApp->processEvents();
1861 1918
1862 QDate birthday; 1919 QDate birthday;
1863 QDate anniversary; 1920 QDate anniversary;
1864 QString realName; 1921 QString realName;
1865 QString email; 1922 QString email;
1866 QString assembledName; 1923 QString assembledName;
1867 QString uid; 1924 QString uid;
1868 bool ok = true; 1925 bool ok = true;
1869 for ( int i = 0; i < count; i++) 1926 for ( int i = 0; i < count; i++)
1870 { 1927 {
1871 if ( ! bar.isVisible() ) 1928 if ( ! bar.isVisible() )
1872 return; 1929 return;
1873 bar.setProgress( i ); 1930 bar.setProgress( i );
1874 qApp->processEvents(); 1931 qApp->processEvents();
1875 1932
1876 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 1933 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
1877 if (!ok) { 1934 if (!ok) {
1878 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 1935 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
1879 } 1936 }
1880 1937
1881 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 1938 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
1882 if (!ok) { 1939 if (!ok) {
1883 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 1940 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
1884 } 1941 }
1885 realName = realNameList[i]; 1942 realName = realNameList[i];
1886 email = emailList[i]; 1943 email = emailList[i];
1887 assembledName = assembledNameList[i]; 1944 assembledName = assembledNameList[i];
1888 uid = uidList[i]; 1945 uid = uidList[i];
1889 //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() ); 1946 //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() );
1890 1947
1891 if ( birthday.isValid() ){ 1948 if ( birthday.isValid() ){
1892 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1949 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1893 KCal::Attendee::ReqParticipant,uid) ; 1950 KCal::Attendee::ReqParticipant,uid) ;
1894 if ( addAnniversary( birthday, assembledName, a, true ) ) 1951 if ( addAnniversary( birthday, assembledName, a, true ) )
1895 ++addCount; 1952 ++addCount;
1896 } 1953 }
1897 1954
1898 if ( anniversary.isValid() ){ 1955 if ( anniversary.isValid() ){
1899 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1956 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1900 KCal::Attendee::ReqParticipant,uid) ; 1957 KCal::Attendee::ReqParticipant,uid) ;
1901 if ( addAnniversary( anniversary, assembledName, a, false ) ) 1958 if ( addAnniversary( anniversary, assembledName, a, false ) )
1902 ++addCount; 1959 ++addCount;
1903 } 1960 }
1904 } 1961 }
1905 1962
1906 mCalendar->setDefaultCalendar( curCal ); 1963 mCalendar->setDefaultCalendar( curCal );
1907 updateView(); 1964 updateView();
1908 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1965 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1909 1966
1910 } 1967 }
1911 1968
1912} 1969}
1913 1970
1914 1971
1915 1972
1916bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1973bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1917{ 1974{
1918 //qDebug("addAnni "); 1975 //qDebug("addAnni ");
1919 Event * ev = new Event(); 1976 Event * ev = new Event();
1920 ev->setOrganizer(KOPrefs::instance()->email()); 1977 ev->setOrganizer(KOPrefs::instance()->email());
1921 if ( a ) { 1978 if ( a ) {
1922 ev->addAttendee( a ); 1979 ev->addAttendee( a );
1923 } 1980 }
1924 QString kind; 1981 QString kind;
1925 if ( birthday ) { 1982 if ( birthday ) {
1926 kind = i18n( "Birthday" ); 1983 kind = i18n( "Birthday" );
1927 ev->setSummary( name + " (" + QString::number(date.year()) +")"); 1984 ev->setSummary( name + " (" + QString::number(date.year()) +")");
1928 } 1985 }
1929 else { 1986 else {
1930 kind = i18n( "Anniversary" ); 1987 kind = i18n( "Anniversary" );
1931 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); 1988 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
1932 } 1989 }
1933 ev->setCategories( kind ); 1990 ev->setCategories( kind );
1934 ev->setDtStart( QDateTime(date) ); 1991 ev->setDtStart( QDateTime(date) );
1935 ev->setDtEnd( QDateTime(date) ); 1992 ev->setDtEnd( QDateTime(date) );
1936 ev->setFloats( true ); 1993 ev->setFloats( true );
1937 Recurrence * rec = ev->recurrence(); 1994 Recurrence * rec = ev->recurrence();
1938 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1995 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1939 rec->addYearlyNum( date.month() ); 1996 rec->addYearlyNum( date.month() );
1940 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1997 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1941 delete ev; 1998 delete ev;
1942 return false; 1999 return false;
1943 } 2000 }
1944 return true; 2001 return true;
1945 2002
1946} 2003}
1947bool CalendarView::importQtopia( const QString &categories, 2004bool CalendarView::importQtopia( const QString &categories,
1948 const QString &datebook, 2005 const QString &datebook,
1949 const QString &todolist ) 2006 const QString &todolist )
1950{ 2007{
1951 2008
1952 QtopiaFormat qtopiaFormat; 2009 QtopiaFormat qtopiaFormat;
1953 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 2010 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1954 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 2011 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1955 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 2012 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1956 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 2013 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1957 2014
1958 updateView(); 2015 updateView();
1959 return true; 2016 return true;
1960 2017
1961#if 0 2018#if 0
1962 mGlobalSyncMode = SYNC_MODE_QTOPIA; 2019 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1963 mCurrentSyncDevice = "qtopia-XML"; 2020 mCurrentSyncDevice = "qtopia-XML";
1964 if ( mSyncManager->mAskForPreferences ) 2021 if ( mSyncManager->mAskForPreferences )
1965 edit_sync_options(); 2022 edit_sync_options();
1966 qApp->processEvents(); 2023 qApp->processEvents();
1967 CalendarLocal* calendar = new CalendarLocal(); 2024 CalendarLocal* calendar = new CalendarLocal();
1968 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2025 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1969 bool syncOK = false; 2026 bool syncOK = false;
1970 QtopiaFormat qtopiaFormat; 2027 QtopiaFormat qtopiaFormat;
1971 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 2028 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1972 bool loadOk = true; 2029 bool loadOk = true;
1973 if ( !categories.isEmpty() ) 2030 if ( !categories.isEmpty() )
1974 loadOk = qtopiaFormat.load( calendar, categories ); 2031 loadOk = qtopiaFormat.load( calendar, categories );
1975 if ( loadOk && !datebook.isEmpty() ) 2032 if ( loadOk && !datebook.isEmpty() )
1976 loadOk = qtopiaFormat.load( calendar, datebook ); 2033 loadOk = qtopiaFormat.load( calendar, datebook );
1977 if ( loadOk && !todolist.isEmpty() ) 2034 if ( loadOk && !todolist.isEmpty() )
1978 loadOk = qtopiaFormat.load( calendar, todolist ); 2035 loadOk = qtopiaFormat.load( calendar, todolist );
1979 2036
1980 if ( loadOk ) { 2037 if ( loadOk ) {
1981 getEventViewerDialog()->setSyncMode( true ); 2038 getEventViewerDialog()->setSyncMode( true );
1982 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 2039 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1983 getEventViewerDialog()->setSyncMode( false ); 2040 getEventViewerDialog()->setSyncMode( false );
1984 qApp->processEvents(); 2041 qApp->processEvents();
1985 if ( syncOK ) { 2042 if ( syncOK ) {
1986 if ( mSyncManager->mWriteBackFile ) 2043 if ( mSyncManager->mWriteBackFile )
1987 { 2044 {
1988 // write back XML file 2045 // write back XML file
1989 2046
1990 } 2047 }
1991 setModified( true ); 2048 setModified( true );
1992 } 2049 }
1993 } else { 2050 } else {
1994 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 2051 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
1995 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 2052 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
1996 question, i18n("Ok")) ; 2053 question, i18n("Ok")) ;
1997 } 2054 }
1998 delete calendar; 2055 delete calendar;
1999 updateView(); 2056 updateView();
2000 return syncOK; 2057 return syncOK;
2001 2058
2002 2059
2003#endif 2060#endif
2004 2061
2005} 2062}
2006 2063
2007void CalendarView::setSyncEventsReadOnly() 2064void CalendarView::setSyncEventsReadOnly()
2008{ 2065{
2009 mCalendar->setSyncEventsReadOnly(); 2066 mCalendar->setSyncEventsReadOnly();
2010} 2067}
2011 2068
2012bool CalendarView::loadCalendars() 2069bool CalendarView::loadCalendars()
2013{ 2070{
2014 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2071 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2015 KopiCalendarFile * cal = calendars.first(); 2072 KopiCalendarFile * cal = calendars.first();
2016 mCalendar->setDefaultCalendar( 1 ); 2073 mCalendar->setDefaultCalendar( 1 );
2017 openCalendar( MainWindow::defaultFileName(), false ); 2074 openCalendar( MainWindow::defaultFileName(), false );
2018 cal = calendars.next(); 2075 cal = calendars.next();
2019 while ( cal ) { 2076 while ( cal ) {
2020 addCalendar( cal ); 2077 addCalendar( cal );
2021 cal = calendars.next(); 2078 cal = calendars.next();
2022 } 2079 }
2023 restoreCalendarSettings(); 2080 restoreCalendarSettings();
2024 return true; 2081 return true;
2025} 2082}
2026bool CalendarView::restoreCalendarSettings() 2083bool CalendarView::restoreCalendarSettings()
2027{ 2084{
2028 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2085 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2029 KopiCalendarFile * cal = calendars.first(); 2086 KopiCalendarFile * cal = calendars.first();
2030 while ( cal ) { 2087 while ( cal ) {
2031 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 2088 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
2032 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 2089 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
2033 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 2090 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
2034 if ( cal->isStandard ) 2091 if ( cal->isStandard )
2035 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2092 mCalendar->setDefaultCalendar( cal->mCalNumber );
2036 cal = calendars.next(); 2093 cal = calendars.next();
2037 } 2094 }
2038 setSyncEventsReadOnly(); 2095 setSyncEventsReadOnly();
2039 mCalendar->reInitAlarmSettings(); 2096 mCalendar->reInitAlarmSettings();
2040 updateUnmanagedViews(); 2097 updateUnmanagedViews();
2041 updateView(); 2098 updateView();
2042 return true; 2099 return true;
2043} 2100}
2044void CalendarView::addCalendarId( int id ) 2101void CalendarView::addCalendarId( int id )
2045{ 2102{
2046 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); 2103 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
2047 if ( cal ) 2104 if ( cal )
2048 addCalendar( cal ); 2105 addCalendar( cal );
2049} 2106}
2050bool CalendarView::addCalendar( KopiCalendarFile * cal ) 2107bool CalendarView::addCalendar( KopiCalendarFile * cal )
2051{ 2108{
2052 cal->mErrorOnLoad = false; 2109 cal->mErrorOnLoad = false;
2053 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { 2110 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) {
2054 cal->mLoadDt = QDateTime::currentDateTime(); 2111 cal->mLoadDt = QDateTime::currentDateTime();
2055 return true; 2112 return true;
2056 } 2113 }
2057 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() ); 2114 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() );
2058 cal->mErrorOnLoad = true; 2115 cal->mErrorOnLoad = true;
2059 return false; 2116 return false;
2060} 2117}
2061bool CalendarView::openCalendar(QString filename, bool merge) 2118bool CalendarView::openCalendar(QString filename, bool merge)
2062{ 2119{
2063 2120
2064 if (filename.isEmpty()) { 2121 if (filename.isEmpty()) {
2065 return false; 2122 return false;
2066 } 2123 }
2067 2124
2068 if (!QFile::exists(filename)) { 2125 if (!QFile::exists(filename)) {
2069 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 2126 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
2070 return false; 2127 return false;
2071 } 2128 }
2072 2129
2073 globalFlagBlockAgenda = 1; 2130 globalFlagBlockAgenda = 1;
2074 clearAllViews(); 2131 clearAllViews();
2075 if (!merge) { 2132 if (!merge) {
2076 mViewManager->setDocumentId( filename ); 2133 mViewManager->setDocumentId( filename );
2077 mCalendar->close(); 2134 mCalendar->close();
2078 } 2135 }
2079 mStorage->setFileName( filename ); 2136 mStorage->setFileName( filename );
2080 2137
2081 if ( mStorage->load() ) { 2138 if ( mStorage->load() ) {
2082 if ( merge ) ;//setModified( true ); 2139 if ( merge ) ;//setModified( true );
2083 else { 2140 else {
2084 //setModified( true ); 2141 //setModified( true );
2085 mViewManager->setDocumentId( filename ); 2142 mViewManager->setDocumentId( filename );
2086 mDialogManager->setDocumentId( filename ); 2143 mDialogManager->setDocumentId( filename );
2087 mTodoList->setDocumentId( filename ); 2144 mTodoList->setDocumentId( filename );
2088 } 2145 }
2089 globalFlagBlockAgenda = 2; 2146 globalFlagBlockAgenda = 2;
2090 // if ( getLastSyncEvent() ) 2147 // if ( getLastSyncEvent() )
2091 // getLastSyncEvent()->setReadOnly( true ); 2148 // getLastSyncEvent()->setReadOnly( true );
2092 mCalendar->reInitAlarmSettings(); 2149 mCalendar->reInitAlarmSettings();
2093 setSyncEventsReadOnly(); 2150 setSyncEventsReadOnly();
2094 updateUnmanagedViews(); 2151 updateUnmanagedViews();
2095 updateView(); 2152 updateView();
2096 if ( filename != MainWindow::defaultFileName() ) { 2153 if ( filename != MainWindow::defaultFileName() ) {
2097 saveCalendar( MainWindow::defaultFileName() ); 2154 saveCalendar( MainWindow::defaultFileName() );
2098 } else { 2155 } else {
2099 QFileInfo finf ( MainWindow::defaultFileName()); 2156 QFileInfo finf ( MainWindow::defaultFileName());
2100 if ( finf.exists() ) { 2157 if ( finf.exists() ) {
2101 setLoadedFileVersion( finf.lastModified () ); 2158 setLoadedFileVersion( finf.lastModified () );
2102 } 2159 }
2103 } 2160 }
2104 return true; 2161 return true;
2105 } else { 2162 } else {
2106 // while failing to load, the calendar object could 2163 // while failing to load, the calendar object could
2107 // have become partially populated. Clear it out. 2164 // have become partially populated. Clear it out.
2108 if ( !merge ) { 2165 if ( !merge ) {
2109 mCalendar->close(); 2166 mCalendar->close();
2110 mViewManager->setDocumentId( filename ); 2167 mViewManager->setDocumentId( filename );
2111 mDialogManager->setDocumentId( filename ); 2168 mDialogManager->setDocumentId( filename );
2112 mTodoList->setDocumentId( filename ); 2169 mTodoList->setDocumentId( filename );
2113 } 2170 }
2114 2171
2115 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 2172 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
2116 2173
2117 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 2174 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
2118 globalFlagBlockAgenda = 2; 2175 globalFlagBlockAgenda = 2;
2119 mCalendar->reInitAlarmSettings(); 2176 mCalendar->reInitAlarmSettings();
2120 setSyncEventsReadOnly(); 2177 setSyncEventsReadOnly();
2121 updateUnmanagedViews(); 2178 updateUnmanagedViews();
2122 updateView(); 2179 updateView();
2123 } 2180 }
2124 return false; 2181 return false;
2125} 2182}
2126void CalendarView::showOpenError() 2183void CalendarView::showOpenError()
2127{ 2184{
2128 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 2185 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
2129} 2186}
2130void CalendarView::setLoadedFileVersion(QDateTime dt) 2187void CalendarView::setLoadedFileVersion(QDateTime dt)
2131{ 2188{
2132 loadedFileVersion = dt; 2189 loadedFileVersion = dt;
2133} 2190}
2134bool CalendarView::checkFileChanged(QString fn) 2191bool CalendarView::checkFileChanged(QString fn)
2135{ 2192{
2136 QFileInfo finf ( fn ); 2193 QFileInfo finf ( fn );
2137 if ( !finf.exists() ) 2194 if ( !finf.exists() )
2138 return true; 2195 return true;
2139 QDateTime dt = finf.lastModified (); 2196 QDateTime dt = finf.lastModified ();
2140 if ( dt <= loadedFileVersion ) 2197 if ( dt <= loadedFileVersion )
2141 return false; 2198 return false;
2142 return true; 2199 return true;
2143 2200
2144} 2201}
2145void CalendarView::watchSavedFile() 2202void CalendarView::watchSavedFile()
2146{ 2203{
2147 QFileInfo finf ( MainWindow::defaultFileName()); 2204 QFileInfo finf ( MainWindow::defaultFileName());
2148 if ( !finf.exists() ) 2205 if ( !finf.exists() )
2149 return; 2206 return;
2150 QDateTime dt = finf.lastModified (); 2207 QDateTime dt = finf.lastModified ();
2151 if ( dt < loadedFileVersion ) { 2208 if ( dt < loadedFileVersion ) {
2152 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 2209 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
2153 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 2210 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
2154 return; 2211 return;
2155 } 2212 }
2156 loadedFileVersion = dt; 2213 loadedFileVersion = dt;
2157} 2214}
2158bool CalendarView::checkAllFileVersions() 2215bool CalendarView::checkAllFileVersions()
2159{ 2216{
2160 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2217 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2161 KopiCalendarFile * cal = calendars.first(); 2218 KopiCalendarFile * cal = calendars.first();
2162 mCalendar->setDefaultCalendar( 1 ); 2219 mCalendar->setDefaultCalendar( 1 );
2163 mCalendar->setDefaultCalendarEnabledOnly(); 2220 mCalendar->setDefaultCalendarEnabledOnly();
2164 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2221 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2165 if ( !checkFileVersion(MainWindow::defaultFileName())) { 2222 if ( !checkFileVersion(MainWindow::defaultFileName())) {
2166 restoreCalendarSettings(); 2223 restoreCalendarSettings();
2167 return false; 2224 return false;
2168 } 2225 }
2169 } 2226 }
2170 cal = calendars.next(); 2227 cal = calendars.next();
2171 QDateTime storeTemp = loadedFileVersion; 2228 QDateTime storeTemp = loadedFileVersion;
2172 while ( cal ) { 2229 while ( cal ) {
2173 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2230 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2174 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2231 mCalendar->setDefaultCalendar( cal->mCalNumber );
2175 mCalendar->setDefaultCalendarEnabledOnly(); 2232 mCalendar->setDefaultCalendarEnabledOnly();
2176 loadedFileVersion = cal->mLoadDt.addSecs( 15 ); 2233 loadedFileVersion = cal->mLoadDt.addSecs( 15 );
2177 if ( !checkFileVersion(cal->mFileName )) { 2234 if ( !checkFileVersion(cal->mFileName )) {
2178 loadedFileVersion = storeTemp; 2235 loadedFileVersion = storeTemp;
2179 restoreCalendarSettings(); 2236 restoreCalendarSettings();
2180 return false; 2237 return false;
2181 } 2238 }
2182 } 2239 }
2183 cal = calendars.next(); 2240 cal = calendars.next();
2184 } 2241 }
2185 loadedFileVersion = storeTemp; 2242 loadedFileVersion = storeTemp;
2186 return true; 2243 return true;
2187} 2244}
2188bool CalendarView::checkFileVersion(QString fn) 2245bool CalendarView::checkFileVersion(QString fn)
2189{ 2246{
2190 QFileInfo finf ( fn ); 2247 QFileInfo finf ( fn );
2191 if ( !finf.exists() ) 2248 if ( !finf.exists() )
2192 return true; 2249 return true;
2193 QDateTime dt = finf.lastModified (); 2250 QDateTime dt = finf.lastModified ();
2194 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); 2251 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1());
2195 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); 2252 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1());
2196 if ( dt <= loadedFileVersion ) 2253 if ( dt <= loadedFileVersion )
2197 return true; 2254 return true;
2198 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)) , 2255 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)) ,
2199 i18n("KO/Pi Warning"),i18n("Overwrite"), 2256 i18n("KO/Pi Warning"),i18n("Overwrite"),
2200 i18n("Sync+save")); 2257 i18n("Sync+save"));
2201 2258
2202 if ( km == KMessageBox::Cancel ) 2259 if ( km == KMessageBox::Cancel )
2203 return false; 2260 return false;
2204 if ( km == KMessageBox::Yes ) 2261 if ( km == KMessageBox::Yes )
2205 return true; 2262 return true;
2206 2263
2207 setSyncDevice("deleteaftersync" ); 2264 setSyncDevice("deleteaftersync" );
2208 mSyncManager->mAskForPreferences = true; 2265 mSyncManager->mAskForPreferences = true;
2209 mSyncManager->mSyncAlgoPrefs = 3; 2266 mSyncManager->mSyncAlgoPrefs = 3;
2210 mSyncManager->mWriteBackFile = false; 2267 mSyncManager->mWriteBackFile = false;
2211 mSyncManager->mWriteBackExistingOnly = false; 2268 mSyncManager->mWriteBackExistingOnly = false;
2212 mSyncManager->mShowSyncSummary = false; 2269 mSyncManager->mShowSyncSummary = false;
2213 syncCalendar( fn, 3 ); 2270 syncCalendar( fn, 3 );
2214 Event * e = getLastSyncEvent(); 2271 Event * e = getLastSyncEvent();
2215 if ( e ) 2272 if ( e )
2216 mCalendar->deleteEvent( e ); 2273 mCalendar->deleteEvent( e );
2217 return true; 2274 return true;
2218} 2275}
2219bool CalendarView::saveCalendars() 2276bool CalendarView::saveCalendars()
2220{ 2277{
2221 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2278 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2222 KopiCalendarFile * cal = calendars.first(); 2279 KopiCalendarFile * cal = calendars.first();
2223 mCalendar->setDefaultCalendar( 1 ); 2280 mCalendar->setDefaultCalendar( 1 );
2224 mCalendar->setDefaultCalendarEnabledOnly(); 2281 mCalendar->setDefaultCalendarEnabledOnly();
2225 saveCalendar( MainWindow::defaultFileName() ); 2282 saveCalendar( MainWindow::defaultFileName() );
2226 cal = calendars.next(); 2283 cal = calendars.next();
2227 while ( cal ) { 2284 while ( cal ) {
2228 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2285 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2229 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2286 mCalendar->setDefaultCalendar( cal->mCalNumber );
2230 mCalendar->setDefaultCalendarEnabledOnly(); 2287 mCalendar->setDefaultCalendarEnabledOnly();
2231 if ( saveCalendar( cal->mFileName ) ) 2288 if ( saveCalendar( cal->mFileName ) )
2232 cal->mLoadDt = QDateTime::currentDateTime(); 2289 cal->mLoadDt = QDateTime::currentDateTime();
2233 } 2290 }
2234 cal = calendars.next(); 2291 cal = calendars.next();
2235 } 2292 }
2236 restoreCalendarSettings(); 2293 restoreCalendarSettings();
2237 return true; 2294 return true;
2238} 2295}
2239bool CalendarView::saveCalendar( QString filename ) 2296bool CalendarView::saveCalendar( QString filename )
2240{ 2297{
2241 2298
2242 // Store back all unsaved data into calendar object 2299 // Store back all unsaved data into calendar object
2243 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 2300 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
2244 if ( mViewManager->currentView() ) 2301 if ( mViewManager->currentView() )
2245 mViewManager->currentView()->flushView(); 2302 mViewManager->currentView()->flushView();
2246 2303
2247 2304
2248 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 2305 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
2249 mStorage->setSaveFormat( new ICalFormat() ); 2306 mStorage->setSaveFormat( new ICalFormat() );
2250 mStorage->setFileName( filename ); 2307 mStorage->setFileName( filename );
2251 bool success; 2308 bool success;
2252 success = mStorage->save(); 2309 success = mStorage->save();
2253 if ( !success ) { 2310 if ( !success ) {
2254 return false; 2311 return false;
2255 } 2312 }
2256 if ( filename == MainWindow::defaultFileName() ) { 2313 if ( filename == MainWindow::defaultFileName() ) {
2257 setLoadedFileVersion( lfv ); 2314 setLoadedFileVersion( lfv );
2258 watchSavedFile(); 2315 watchSavedFile();
2259 } 2316 }
2260 return true; 2317 return true;
2261} 2318}
2262 2319
2263void CalendarView::closeCalendar() 2320void CalendarView::closeCalendar()
2264{ 2321{
2265 2322
2266 // child windows no longer valid 2323 // child windows no longer valid
2267 clearAllViews(); 2324 clearAllViews();
2268 emit closingDown(); 2325 emit closingDown();
2269 2326
2270 mCalendar->close(); 2327 mCalendar->close();
2271 setModified(false); 2328 setModified(false);
2272 updateView(); 2329 updateView();
2273} 2330}
2274 2331
2275void CalendarView::archiveCalendar() 2332void CalendarView::archiveCalendar()
2276{ 2333{
2277 mDialogManager->showArchiveDialog(); 2334 mDialogManager->showArchiveDialog();
2278} 2335}
2279 2336
2280 2337
2281void CalendarView::readSettings() 2338void CalendarView::readSettings()
2282{ 2339{
2283 2340
2284 2341
2285 // mViewManager->showAgendaView(); 2342 // mViewManager->showAgendaView();
2286 QString str; 2343 QString str;
2287 //qDebug("CalendarView::readSettings() "); 2344 //qDebug("CalendarView::readSettings() ");
2288 // read settings from the KConfig, supplying reasonable 2345 // read settings from the KConfig, supplying reasonable
2289 // defaults where none are to be found 2346 // defaults where none are to be found
2290 KConfig *config = KOGlobals::config(); 2347 KConfig *config = KOGlobals::config();
2291#ifndef KORG_NOSPLITTER 2348#ifndef KORG_NOSPLITTER
2292 config->setGroup("KOrganizer Geometry"); 2349 config->setGroup("KOrganizer Geometry");
2293 2350
2294 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2351 QValueList<int> sizes = config->readIntListEntry("Separator1");
2295 if (sizes.count() != 2) { 2352 if (sizes.count() != 2) {
2296 sizes << mDateNavigator->minimumSizeHint().width(); 2353 sizes << mDateNavigator->minimumSizeHint().width();
2297 sizes << 300; 2354 sizes << 300;
2298 } 2355 }
2299 mPanner->setSizes(sizes); 2356 mPanner->setSizes(sizes);
2300 2357
2301 sizes = config->readIntListEntry("Separator2"); 2358 sizes = config->readIntListEntry("Separator2");
2302 if ( ( mResourceView && sizes.count() == 4 ) || 2359 if ( ( mResourceView && sizes.count() == 4 ) ||
2303 ( !mResourceView && sizes.count() == 3 ) ) { 2360 ( !mResourceView && sizes.count() == 3 ) ) {
2304 mLeftSplitter->setSizes(sizes); 2361 mLeftSplitter->setSizes(sizes);
2305 } 2362 }
2306#endif 2363#endif
2307 globalFlagBlockAgenda = 1; 2364 globalFlagBlockAgenda = 1;
2308 mViewManager->showAgendaView(); 2365 mViewManager->showAgendaView();
2309 //mViewManager->readSettings( config ); 2366 //mViewManager->readSettings( config );
2310 mTodoList->restoreLayout(config,QString("Todo Layout")); 2367 mTodoList->restoreLayout(config,QString("Todo Layout"));
2311 readFilterSettings(config); 2368 readFilterSettings(config);
2312 2369
2313#ifdef DESKTOP_VERSION 2370#ifdef DESKTOP_VERSION
2314 config->setGroup("WidgetLayout"); 2371 config->setGroup("WidgetLayout");
2315 QStringList list; 2372 QStringList list;
2316 list = config->readListEntry("MainLayout"); 2373 list = config->readListEntry("MainLayout");
2317 int x,y,w,h; 2374 int x,y,w,h;
2318 if ( ! list.isEmpty() ) { 2375 if ( ! list.isEmpty() ) {
2319 x = list[0].toInt(); 2376 x = list[0].toInt();
2320 y = list[1].toInt(); 2377 y = list[1].toInt();
2321 w = list[2].toInt(); 2378 w = list[2].toInt();
2322 h = list[3].toInt(); 2379 h = list[3].toInt();
2323 KApplication::testCoords( &x,&y,&w,&h ); 2380 KApplication::testCoords( &x,&y,&w,&h );
2324 topLevelWidget()->setGeometry(x,y,w,h); 2381 topLevelWidget()->setGeometry(x,y,w,h);
2325 2382
2326 } else { 2383 } else {
2327 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 2384 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
2328 } 2385 }
2329 list = config->readListEntry("EditEventLayout"); 2386 list = config->readListEntry("EditEventLayout");
2330 if ( ! list.isEmpty() ) { 2387 if ( ! list.isEmpty() ) {
2331 x = list[0].toInt(); 2388 x = list[0].toInt();
2332 y = list[1].toInt(); 2389 y = list[1].toInt();
2333 w = list[2].toInt(); 2390 w = list[2].toInt();
2334 h = list[3].toInt(); 2391 h = list[3].toInt();
2335 KApplication::testCoords( &x,&y,&w,&h ); 2392 KApplication::testCoords( &x,&y,&w,&h );
2336 mEventEditor->setGeometry(x,y,w,h); 2393 mEventEditor->setGeometry(x,y,w,h);
2337 2394
2338 } 2395 }
2339 list = config->readListEntry("EditTodoLayout"); 2396 list = config->readListEntry("EditTodoLayout");
2340 if ( ! list.isEmpty() ) { 2397 if ( ! list.isEmpty() ) {
2341 x = list[0].toInt(); 2398 x = list[0].toInt();
2342 y = list[1].toInt(); 2399 y = list[1].toInt();
2343 w = list[2].toInt(); 2400 w = list[2].toInt();
2344 h = list[3].toInt(); 2401 h = list[3].toInt();
2345 KApplication::testCoords( &x,&y,&w,&h ); 2402 KApplication::testCoords( &x,&y,&w,&h );
2346 mTodoEditor->setGeometry(x,y,w,h); 2403 mTodoEditor->setGeometry(x,y,w,h);
2347 2404
2348 } 2405 }
2349 list = config->readListEntry("ViewerLayout"); 2406 list = config->readListEntry("ViewerLayout");
2350 if ( ! list.isEmpty() ) { 2407 if ( ! list.isEmpty() ) {
2351 x = list[0].toInt(); 2408 x = list[0].toInt();
2352 y = list[1].toInt(); 2409 y = list[1].toInt();
2353 w = list[2].toInt(); 2410 w = list[2].toInt();
2354 h = list[3].toInt(); 2411 h = list[3].toInt();
2355 KApplication::testCoords( &x,&y,&w,&h ); 2412 KApplication::testCoords( &x,&y,&w,&h );
2356 getEventViewerDialog()->setGeometry(x,y,w,h); 2413 getEventViewerDialog()->setGeometry(x,y,w,h);
2357 } 2414 }
2358#endif 2415#endif
2359 config->setGroup( "Views" ); 2416 config->setGroup( "Views" );
2360 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2417 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2361 2418
2362 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2419 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2363 2420
2364 int resetval = 0; 2421 int resetval = 0;
2365 int maxVal = 0; 2422 int maxVal = 0;
2366 if (sizes.count() != 3) { 2423 if (sizes.count() != 3) {
2367 if ( KOPrefs::instance()->mVerticalScreen ) { 2424 if ( KOPrefs::instance()->mVerticalScreen ) {
2368 resetval = mDateNavigator->sizeHint().width()+2; 2425 resetval = mDateNavigator->sizeHint().width()+2;
2369 } else { 2426 } else {
2370 resetval = mDateNavigator->sizeHint().height()+2; 2427 resetval = mDateNavigator->sizeHint().height()+2;
2371 } 2428 }
2372 } 2429 }
2373 if ( resetval ) { 2430 if ( resetval ) {
2374 sizes.clear(); 2431 sizes.clear();
2375 if ( KOPrefs::instance()->mVerticalScreen ) { 2432 if ( KOPrefs::instance()->mVerticalScreen ) {
2376 maxVal = QApplication::desktop()->width() -10; 2433 maxVal = QApplication::desktop()->width() -10;
2377 } else { 2434 } else {
2378 maxVal = QApplication::desktop()->height()-10; 2435 maxVal = QApplication::desktop()->height()-10;
2379 } 2436 }
2380 sizes << resetval; 2437 sizes << resetval;
2381 if ( maxVal < resetval + resetval) 2438 if ( maxVal < resetval + resetval)
2382 resetval = maxVal - resetval; 2439 resetval = maxVal - resetval;
2383 sizes << resetval; 2440 sizes << resetval;
2384 sizes << 100; 2441 sizes << 100;
2385 } 2442 }
2386 mLeftFrame->setSizes(sizes); 2443 mLeftFrame->setSizes(sizes);
2387 sizes = config->readIntListEntry("Main Splitter Frame"); 2444 sizes = config->readIntListEntry("Main Splitter Frame");
2388 resetval = 0; 2445 resetval = 0;
2389 maxVal = 0; 2446 maxVal = 0;
2390 if (sizes.count() != 2) { 2447 if (sizes.count() != 2) {
2391 if ( !KOPrefs::instance()->mVerticalScreen ) { 2448 if ( !KOPrefs::instance()->mVerticalScreen ) {
2392 resetval = mDateNavigator->sizeHint().width()+2; 2449 resetval = mDateNavigator->sizeHint().width()+2;
2393 } else { 2450 } else {
2394 resetval = mDateNavigator->sizeHint().height()+2; 2451 resetval = mDateNavigator->sizeHint().height()+2;
2395 } 2452 }
2396 } 2453 }
2397 if ( resetval ) { 2454 if ( resetval ) {
2398 sizes.clear(); 2455 sizes.clear();
2399 if ( !KOPrefs::instance()->mVerticalScreen ) { 2456 if ( !KOPrefs::instance()->mVerticalScreen ) {
2400 maxVal = QApplication::desktop()->width() -10; 2457 maxVal = QApplication::desktop()->width() -10;
2401 } else { 2458 } else {
2402 maxVal = QApplication::desktop()->height()-10; 2459 maxVal = QApplication::desktop()->height()-10;
2403 } 2460 }
2404 sizes << resetval; 2461 sizes << resetval;
2405 if ( maxVal < resetval + resetval) 2462 if ( maxVal < resetval + resetval)
2406 resetval = maxVal - resetval; 2463 resetval = maxVal - resetval;
2407 sizes << resetval; 2464 sizes << resetval;
2408 } 2465 }
2409 mMainFrame->setSizes(sizes); 2466 mMainFrame->setSizes(sizes);
2410 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2467 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2411 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2468 else if ( dateCount == 7 ) mNavigator->selectWeek();
2412 else mNavigator->selectDates( dateCount ); 2469 else mNavigator->selectDates( dateCount );
2413 // mViewManager->readSettings( config ); 2470 // mViewManager->readSettings( config );
2414 updateConfig(); 2471 updateConfig();
2415 globalFlagBlockAgenda = 2; 2472 globalFlagBlockAgenda = 2;
2416 mViewManager->readSettings( config ); 2473 mViewManager->readSettings( config );
2417 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2474 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2418} 2475}
2419 2476
2420void CalendarView::checkSuspendAlarm() 2477void CalendarView::checkSuspendAlarm()
2421{ 2478{
2422 if ( mSuspendTimer->isActive() ) { 2479 if ( mSuspendTimer->isActive() ) {
2423 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); 2480 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
2424 } 2481 }
2425} 2482}
2426void CalendarView::writeSettings() 2483void CalendarView::writeSettings()
2427{ 2484{
2428 // kdDebug() << "CalendarView::writeSettings" << endl; 2485 // kdDebug() << "CalendarView::writeSettings" << endl;
2429 2486
2430 KConfig *config = KOGlobals::config(); 2487 KConfig *config = KOGlobals::config();
2431 2488
2432 mViewManager->writeSettings( config ); 2489 mViewManager->writeSettings( config );
2433 mTodoList->saveLayout(config,QString("Todo Layout")); 2490 mTodoList->saveLayout(config,QString("Todo Layout"));
2434 mDialogManager->writeSettings( config ); 2491 mDialogManager->writeSettings( config );
2435 //KOPrefs::instance()->usrWriteConfig(); 2492 //KOPrefs::instance()->usrWriteConfig();
2436 KOPrefs::instance()->writeConfig(); 2493 KOPrefs::instance()->writeConfig();
2437 2494
2438 writeFilterSettings(config); 2495 writeFilterSettings(config);
2439 config->setGroup( "AppRun" ); 2496 config->setGroup( "AppRun" );
2440 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2497 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2441 int days = dt.daysTo( QDate::currentDate() ); 2498 int days = dt.daysTo( QDate::currentDate() );
2442 dt = dt.addDays( days ); 2499 dt = dt.addDays( days );
2443 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2500 int secs = dt.secsTo( QDateTime::currentDateTime() );
2444 config->writeEntry( "LatestProgramStopDays", days ); 2501 config->writeEntry( "LatestProgramStopDays", days );
2445 config->writeEntry( "LatestProgramStopSecs", secs ); 2502 config->writeEntry( "LatestProgramStopSecs", secs );
2446 //qDebug("KO: Writing stop time: %d ", secs); 2503 //qDebug("KO: Writing stop time: %d ", secs);
2447 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2504 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2448 //QDateTime latest = dt.addSecs ( secs ); 2505 //QDateTime latest = dt.addSecs ( secs );
2449 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2506 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2450 config->setGroup( "Views" ); 2507 config->setGroup( "Views" );
2451 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2508 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2452 2509
2453#if 0 2510#if 0
2454 qDebug("********************* "); 2511 qDebug("********************* ");
2455 qDebug("Testcode secsto "); 2512 qDebug("Testcode secsto ");
2456 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2513 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2457 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2514 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2458 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2515 int secsto = dt_nodaylight.secsTo( dt_daylight );
2459 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2516 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2460 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2517 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2461 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2518 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2462 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2519 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2463 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2520 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2464 qDebug("********************* testcode end"); 2521 qDebug("********************* testcode end");
2465 2522
2466#endif 2523#endif
2467 2524
2468 QValueList<int> listINT = mLeftFrame->sizes(); 2525 QValueList<int> listINT = mLeftFrame->sizes();
2469 config->writeEntry("Left Splitter Frame",listINT); 2526 config->writeEntry("Left Splitter Frame",listINT);
2470 QValueList<int> listINT2 = mMainFrame->sizes(); 2527 QValueList<int> listINT2 = mMainFrame->sizes();
2471 config->writeEntry("Main Splitter Frame",listINT2); 2528 config->writeEntry("Main Splitter Frame",listINT2);
2472#ifdef DESKTOP_VERSION 2529#ifdef DESKTOP_VERSION
2473 config->setGroup("WidgetLayout"); 2530 config->setGroup("WidgetLayout");
2474 QStringList list ;//= config->readListEntry("MainLayout"); 2531 QStringList list ;//= config->readListEntry("MainLayout");
2475 int x,y,w,h; 2532 int x,y,w,h;
2476 QWidget* wid; 2533 QWidget* wid;
2477 wid = topLevelWidget(); 2534 wid = topLevelWidget();
2478 x = wid->geometry().x(); 2535 x = wid->geometry().x();
2479 y = wid->geometry().y(); 2536 y = wid->geometry().y();
2480 w = wid->width(); 2537 w = wid->width();
2481 h = wid->height(); 2538 h = wid->height();
2482 list.clear(); 2539 list.clear();
2483 list << QString::number( x ); 2540 list << QString::number( x );
2484 list << QString::number( y ); 2541 list << QString::number( y );
2485 list << QString::number( w ); 2542 list << QString::number( w );
2486 list << QString::number( h ); 2543 list << QString::number( h );
2487 config->writeEntry("MainLayout",list ); 2544 config->writeEntry("MainLayout",list );
2488 2545
2489 wid = mEventEditor; 2546 wid = mEventEditor;
2490 x = wid->geometry().x(); 2547 x = wid->geometry().x();
2491 y = wid->geometry().y(); 2548 y = wid->geometry().y();
2492 w = wid->width(); 2549 w = wid->width();
2493 h = wid->height(); 2550 h = wid->height();
2494 list.clear(); 2551 list.clear();
2495 list << QString::number( x ); 2552 list << QString::number( x );
2496 list << QString::number( y ); 2553 list << QString::number( y );
2497 list << QString::number( w ); 2554 list << QString::number( w );
2498 list << QString::number( h ); 2555 list << QString::number( h );
2499 config->writeEntry("EditEventLayout",list ); 2556 config->writeEntry("EditEventLayout",list );
2500 2557
2501 wid = mTodoEditor; 2558 wid = mTodoEditor;
2502 x = wid->geometry().x(); 2559 x = wid->geometry().x();
2503 y = wid->geometry().y(); 2560 y = wid->geometry().y();
2504 w = wid->width(); 2561 w = wid->width();
2505 h = wid->height(); 2562 h = wid->height();
2506 list.clear(); 2563 list.clear();
2507 list << QString::number( x ); 2564 list << QString::number( x );
2508 list << QString::number( y ); 2565 list << QString::number( y );
2509 list << QString::number( w ); 2566 list << QString::number( w );
2510 list << QString::number( h ); 2567 list << QString::number( h );
2511 config->writeEntry("EditTodoLayout",list ); 2568 config->writeEntry("EditTodoLayout",list );
2512 wid = getEventViewerDialog(); 2569 wid = getEventViewerDialog();
2513 x = wid->geometry().x(); 2570 x = wid->geometry().x();
2514 y = wid->geometry().y(); 2571 y = wid->geometry().y();
2515 w = wid->width(); 2572 w = wid->width();
2516 h = wid->height(); 2573 h = wid->height();
2517 list.clear(); 2574 list.clear();
2518 list << QString::number( x ); 2575 list << QString::number( x );
2519 list << QString::number( y ); 2576 list << QString::number( y );
2520 list << QString::number( w ); 2577 list << QString::number( w );
2521 list << QString::number( h ); 2578 list << QString::number( h );
2522 config->writeEntry("ViewerLayout",list ); 2579 config->writeEntry("ViewerLayout",list );
2523 wid = mDialogManager->getSearchDialog(); 2580 wid = mDialogManager->getSearchDialog();
2524 if ( wid ) { 2581 if ( wid ) {
2525 x = wid->geometry().x(); 2582 x = wid->geometry().x();
2526 y = wid->geometry().y(); 2583 y = wid->geometry().y();
2527 w = wid->width(); 2584 w = wid->width();
2528 h = wid->height(); 2585 h = wid->height();
2529 list.clear(); 2586 list.clear();
2530 list << QString::number( x ); 2587 list << QString::number( x );
2531 list << QString::number( y ); 2588 list << QString::number( y );
2532 list << QString::number( w ); 2589 list << QString::number( w );
2533 list << QString::number( h ); 2590 list << QString::number( h );
2534 config->writeEntry("SearchLayout",list ); 2591 config->writeEntry("SearchLayout",list );
2535 } 2592 }
2536#endif 2593#endif
2537 2594
2538 2595
2539 config->sync(); 2596 config->sync();
2540} 2597}
2541 2598
2542void CalendarView::readFilterSettings(KConfig *config) 2599void CalendarView::readFilterSettings(KConfig *config)
2543{ 2600{
2544 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2601 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2545 2602
2546 mFilters.clear(); 2603 mFilters.clear();
2547 2604
2548 config->setGroup("General"); 2605 config->setGroup("General");
2549 QStringList filterList = config->readListEntry("CalendarFilters"); 2606 QStringList filterList = config->readListEntry("CalendarFilters");
2550 2607
2551 QStringList::ConstIterator it = filterList.begin(); 2608 QStringList::ConstIterator it = filterList.begin();
2552 QStringList::ConstIterator end = filterList.end(); 2609 QStringList::ConstIterator end = filterList.end();
2553 while(it != end) { 2610 while(it != end) {
2554 // kdDebug() << " filter: " << (*it) << endl; 2611 // kdDebug() << " filter: " << (*it) << endl;
2555 2612
2556 CalFilter *filter; 2613 CalFilter *filter;
2557 filter = new CalFilter(*it); 2614 filter = new CalFilter(*it);
2558 config->setGroup("Filter_" + (*it).utf8()); 2615 config->setGroup("Filter_" + (*it).utf8());
2559 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2616 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2560 filter->setCriteria(config->readNumEntry("Criteria",0)); 2617 filter->setCriteria(config->readNumEntry("Criteria",0));
2561 filter->setCategoryList(config->readListEntry("CategoryList")); 2618 filter->setCategoryList(config->readListEntry("CategoryList"));
2562 mFilters.append(filter); 2619 mFilters.append(filter);
2563 2620
2564 ++it; 2621 ++it;
2565 } 2622 }
2566 2623
2567 if (mFilters.count() == 0) { 2624 if (mFilters.count() == 0) {
2568 CalFilter *filter = new CalFilter(i18n("Default")); 2625 CalFilter *filter = new CalFilter(i18n("Default"));
2569 mFilters.append(filter); 2626 mFilters.append(filter);
2570 } 2627 }
2571 mFilterView->updateFilters(); 2628 mFilterView->updateFilters();
2572 config->setGroup("FilterView"); 2629 config->setGroup("FilterView");
2573 2630
2574 mFilterView->blockSignals(true); 2631 mFilterView->blockSignals(true);
2575 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2632 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2576 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2633 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2577 mFilterView->blockSignals(false); 2634 mFilterView->blockSignals(false);
2578 // We do it manually to avoid it being done twice by the above calls 2635 // We do it manually to avoid it being done twice by the above calls
2579 updateFilter(); 2636 updateFilter();
2580} 2637}
2581 2638
2582void CalendarView::writeFilterSettings(KConfig *config) 2639void CalendarView::writeFilterSettings(KConfig *config)
2583{ 2640{
2584 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2641 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2585 2642
2586 QStringList filterList; 2643 QStringList filterList;
2587 2644
2588 CalFilter *filter = mFilters.first(); 2645 CalFilter *filter = mFilters.first();
2589 while(filter) { 2646 while(filter) {
2590 // kdDebug() << " fn: " << filter->name() << endl; 2647 // kdDebug() << " fn: " << filter->name() << endl;
2591 filterList << filter->name(); 2648 filterList << filter->name();
2592 config->setGroup("Filter_" + filter->name().utf8()); 2649 config->setGroup("Filter_" + filter->name().utf8());
2593 config->writeEntry("Criteria",filter->criteria()); 2650 config->writeEntry("Criteria",filter->criteria());
2594 config->writeEntry("CategoryList",filter->categoryList()); 2651 config->writeEntry("CategoryList",filter->categoryList());
2595 filter = mFilters.next(); 2652 filter = mFilters.next();
2596 } 2653 }
2597 config->setGroup("General"); 2654 config->setGroup("General");
2598 config->writeEntry("CalendarFilters",filterList); 2655 config->writeEntry("CalendarFilters",filterList);
2599 2656
2600 config->setGroup("FilterView"); 2657 config->setGroup("FilterView");
2601 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2658 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2602 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2659 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2603} 2660}
2604 2661
2605 2662
2606void CalendarView::goToday() 2663void CalendarView::goToday()
2607{ 2664{
2608 if ( mViewManager->currentView()->isMonthView() ) 2665 if ( mViewManager->currentView()->isMonthView() )
2609 mNavigator->selectTodayMonth(); 2666 mNavigator->selectTodayMonth();
2610 else 2667 else
2611 mNavigator->selectToday(); 2668 mNavigator->selectToday();
2612} 2669}
2613 2670
2614void CalendarView::goNext() 2671void CalendarView::goNext()
2615{ 2672{
2616 mNavigator->selectNext(); 2673 mNavigator->selectNext();
2617} 2674}
2618 2675
2619void CalendarView::goPrevious() 2676void CalendarView::goPrevious()
2620{ 2677{
2621 mNavigator->selectPrevious(); 2678 mNavigator->selectPrevious();
2622} 2679}
2623void CalendarView::goNextMonth() 2680void CalendarView::goNextMonth()
2624{ 2681{
2625 mNavigator->selectNextMonth(); 2682 mNavigator->selectNextMonth();
2626} 2683}
2627 2684
2628void CalendarView::goPreviousMonth() 2685void CalendarView::goPreviousMonth()
2629{ 2686{
2630 mNavigator->selectPreviousMonth(); 2687 mNavigator->selectPreviousMonth();
2631} 2688}
2632 2689
2633void CalendarView::updateConfig() 2690void CalendarView::updateConfig()
2634{ 2691{
2635 if ( KOPrefs::instance()->mUseAppColors ) 2692 if ( KOPrefs::instance()->mUseAppColors )
2636 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2693 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2637 emit configChanged(); 2694 emit configChanged();
2638 mTodoList->updateConfig(); 2695 mTodoList->updateConfig();
2639 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2696 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2640 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2697 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2641 // To make the "fill window" configurations work 2698 // To make the "fill window" configurations work
2642 //mViewManager->raiseCurrentView(); 2699 //mViewManager->raiseCurrentView();
2643} 2700}
2644 2701
2645 2702
2646void CalendarView::eventChanged(Event *event) 2703void CalendarView::eventChanged(Event *event)
2647{ 2704{
2648 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2705 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2649 //updateUnmanagedViews(); 2706 //updateUnmanagedViews();
2650} 2707}
2651 2708
2652void CalendarView::eventAdded(Event *event) 2709void CalendarView::eventAdded(Event *event)
2653{ 2710{
2654 changeEventDisplay(event,KOGlobals::EVENTADDED); 2711 changeEventDisplay(event,KOGlobals::EVENTADDED);
2655} 2712}
2656 2713
2657void CalendarView::eventToBeDeleted(Event *) 2714void CalendarView::eventToBeDeleted(Event *)
2658{ 2715{
2659 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2716 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2660} 2717}
2661 2718
2662void CalendarView::eventDeleted() 2719void CalendarView::eventDeleted()
2663{ 2720{
2664 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2721 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2665} 2722}
2666void CalendarView::changeTodoDisplay(Todo *which, int action) 2723void CalendarView::changeTodoDisplay(Todo *which, int action)
2667{ 2724{
2668 changeIncidenceDisplay((Incidence *)which, action); 2725 changeIncidenceDisplay((Incidence *)which, action);
2669 mDateNavigator->updateView(); //LR 2726 mDateNavigator->updateView(); //LR
2670 //mDialogManager->updateSearchDialog(); 2727 //mDialogManager->updateSearchDialog();
2671 2728
2672 if (which) { 2729 if (which) {
2673 mViewManager->updateWNview(); 2730 mViewManager->updateWNview();
2674 //mTodoList->updateView(); 2731 //mTodoList->updateView();
2675 } 2732 }
2676 2733
2677} 2734}
2678 2735
2679void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2736void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2680{ 2737{
2681 updateUnmanagedViews(); 2738 updateUnmanagedViews();
2682 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2739 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2683 if ( action == KOGlobals::EVENTDELETED ) { //delete 2740 if ( action == KOGlobals::EVENTDELETED ) { //delete
2684 mCalendar->checkAlarmForIncidence( 0, true ); 2741 mCalendar->checkAlarmForIncidence( 0, true );
2685 if ( mEventViewerDialog ) 2742 if ( mEventViewerDialog )
2686 mEventViewerDialog->hide(); 2743 mEventViewerDialog->hide();
2687 } 2744 }
2688 else 2745 else
2689 mCalendar->checkAlarmForIncidence( which , false ); 2746 mCalendar->checkAlarmForIncidence( which , false );
2690} 2747}
2691 2748
2692// most of the changeEventDisplays() right now just call the view's 2749// most of the changeEventDisplays() right now just call the view's
2693// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2750// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2694void CalendarView::changeEventDisplay(Event *which, int action) 2751void CalendarView::changeEventDisplay(Event *which, int action)
2695{ 2752{
2696 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2753 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2697 changeIncidenceDisplay((Incidence *)which, action); 2754 changeIncidenceDisplay((Incidence *)which, action);
2698
2699
2700 static bool clearallviews = false; 2755 static bool clearallviews = false;
2701 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 2756 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
2702 if ( clearallviews ) { 2757 if ( clearallviews ) {
2703 clearAllViews(); 2758 clearAllViews();
2704 clearallviews = false; 2759 clearallviews = false;
2705 } 2760 }
2706 return; 2761 return;
2707 } 2762 }
2708 clearallviews = true; 2763 clearallviews = true;
2709
2710
2711
2712 mDateNavigator->updateView(); 2764 mDateNavigator->updateView();
2713 //mDialogManager->updateSearchDialog(); 2765 //mDialogManager->updateSearchDialog();
2714
2715 if (which) { 2766 if (which) {
2716 // If there is an event view visible update the display 2767 // If there is an event view visible update the display
2717 mViewManager->currentView()->changeEventDisplay(which,action); 2768 mViewManager->currentView()->changeEventDisplay(which,action);
2718 // TODO: check, if update needed 2769 // TODO: check, if update needed
2719 // if (which->getTodoStatus()) { 2770 // if (which->getTodoStatus()) {
2720 mTodoList->updateView(); 2771 mTodoList->updateView();
2721 if ( action != KOGlobals::EVENTDELETED ) { 2772 if ( action != KOGlobals::EVENTDELETED ) {
2722 mConflictingEvent = which ; 2773 mConflictingEvent = which ;
2723 QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) ); 2774 QTimer::singleShot( 1000, this, SLOT ( checkConflictForEvent() ) );
2724 } 2775 }
2725 // } 2776 // }
2726 } else { 2777 } else {
2727 mViewManager->currentView()->updateView(); 2778 mViewManager->currentView()->updateView();
2728 } 2779 }
2729} 2780}
2730void CalendarView::checkConflictForEvent() 2781void CalendarView::checkConflictForEvent()
2731{ 2782{
2732 2783
2733 if (!KOPrefs::instance()->mConfirm) 2784 if (!KOPrefs::instance()->mConfirm)
2734 return; 2785 return;
2735 if ( ! mConflictingEvent ) return; 2786 if ( ! mConflictingEvent ) return;
2736 if ( mConflictingEvent->doesFloat() ) { 2787 if ( mConflictingEvent->doesFloat() ) {
2737 mConflictingEvent = 0; 2788 mConflictingEvent = 0;
2738 return; 2789 return;
2739 } 2790 }
2740 bool all = false; 2791 QPtrList<Event> testlist = mCalendar->events();
2741 bool allday = false; 2792 Event * test = testlist.first();
2742 Event * ev = mConflictingEvent; 2793 QDateTime conflict;
2743 mConflictingEvent = 0; 2794 QDateTime retVal;
2744 QDate start = ev->dtStart().date(); 2795 bool found = false;
2745 QDate end = ev->dtEnd().date().addDays(1); 2796 Event * cE = 0;
2746 while ( start < end ) { 2797 while ( test ) {
2747 QPtrList<Event> test = calendar()->events( start ); 2798 if ( !test->doesFloat() ) {
2748 //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); 2799 if ( mConflictingEvent->isOverlapping ( test, &retVal, true ) ) {
2749 Event * t_ev = test.first(); 2800 if ( ! found ) {
2750 QDateTime es = ev->dtStart(); 2801 conflict = retVal;
2751 QDateTime ee = ev->dtEnd(); 2802 cE = test;
2752 if ( ev->doesFloat() ) 2803 } else {
2753 ee = ee.addDays( 1 ); 2804 if ( retVal < conflict ) {
2754 if ( ! all ) { 2805 conflict = retVal;
2755 if ( ev->doesFloat() != allday ) 2806 cE = test;
2756 t_ev = 0; 2807 }
2757 }
2758 while ( t_ev ) {
2759 bool skip = false;
2760 if ( ! all ) {
2761 if ( t_ev->doesFloat() != allday )
2762 skip = true;
2763 }
2764 if ( !skip && ev != t_ev ) {
2765 QDateTime ets = t_ev->dtStart();
2766 QDateTime ete = t_ev->dtEnd();
2767 if ( t_ev->doesFloat() )
2768 ete = ete.addDays( 1 );
2769 //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() );
2770 if ( es < ete && ets < ee ) {
2771 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( ev->summary(),0 ) ).arg( KGlobal::formatMessage ( t_ev->summary(),0 )).arg(KGlobal::locale()->formatDate(start) ) ;
2772 qApp->processEvents();
2773 int km = KMessageBox::warningContinueCancel(this,mess,
2774 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!"));
2775 if ( km != KMessageBox::Continue )
2776 return;
2777
2778 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
2779 mViewManager->showDayView();
2780 mNavigator->slotDaySelect( start );
2781 int hour = es.time().hour();
2782 if ( ets > es )
2783 hour = ets.time().hour();
2784 mViewManager->agendaView()->setStartHour( hour );
2785 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) );
2786 return;
2787 } 2808 }
2809 found = true;
2788 } 2810 }
2789 t_ev = test.next();
2790 } 2811 }
2791 start = start.addDays( 1 ); 2812 test = testlist.next();
2792 } 2813 }
2793 qDebug("No conflict found "); 2814 if ( found ) {
2794 2815 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()) ) ;
2816 qApp->processEvents();
2817 int km = KMessageBox::warningContinueCancel(this,mess,
2818 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!"));
2819 if ( km != KMessageBox::Continue )
2820 return;
2795 2821
2822 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
2823 mViewManager->showDayView();
2824 mNavigator->slotDaySelect( conflict.date() );
2825 int hour = conflict.time().hour();
2826 mViewManager->agendaView()->setStartHour( hour );
2827 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( mConflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
2828 return;
2829 }
2830
2831 return;
2832
2796} 2833}
2797 2834
2798void CalendarView::updateTodoViews() 2835void CalendarView::updateTodoViews()
2799{ 2836{
2800 mTodoList->updateView(); 2837 mTodoList->updateView();
2801 mViewManager->currentView()->updateView(); 2838 mViewManager->currentView()->updateView();
2802 2839
2803} 2840}
2804 2841
2805 2842
2806 2843
2807void CalendarView::clearAllViews() 2844void CalendarView::clearAllViews()
2808{ 2845{
2809 mTodoList->clearList(); 2846 mTodoList->clearList();
2810 mViewManager->clearAllViews(); 2847 mViewManager->clearAllViews();
2811 SearchDialog * sd = mDialogManager->getSearchDialog(); 2848 SearchDialog * sd = mDialogManager->getSearchDialog();
2812 if ( sd ) { 2849 if ( sd ) {
2813 KOListView* kol = sd->listview(); 2850 KOListView* kol = sd->listview();
2814 if ( kol ) 2851 if ( kol )
2815 kol->clearList(); 2852 kol->clearList();
2816 } 2853 }
2817} 2854}
2818void CalendarView::updateView() 2855void CalendarView::updateView()
2819{ 2856{
2820 static bool clearallviews = false; 2857 static bool clearallviews = false;
2821 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 2858 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
2822 if ( clearallviews ) { 2859 if ( clearallviews ) {
2823 clearAllViews(); 2860 clearAllViews();
2824 clearallviews = false; 2861 clearallviews = false;
2825 } 2862 }
2826 return; 2863 return;
2827 } 2864 }
2828 clearallviews = true; 2865 clearallviews = true;
2829 DateList tmpList = mNavigator->selectedDates(); 2866 DateList tmpList = mNavigator->selectedDates();
2830 2867
2831 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2868 if ( KOPrefs::instance()->mHideNonStartedTodos )
2832 mTodoList->updateView(); 2869 mTodoList->updateView();
2833 // We assume that the navigator only selects consecutive days. 2870 // We assume that the navigator only selects consecutive days.
2834 updateView( tmpList.first(), tmpList.last() ); 2871 updateView( tmpList.first(), tmpList.last() );
2835} 2872}
2836 2873
2837void CalendarView::updateUnmanagedViews() 2874void CalendarView::updateUnmanagedViews()
2838{ 2875{
2839 mDateNavigator->updateDayMatrix(); 2876 mDateNavigator->updateDayMatrix();
2840} 2877}
2841 2878
2842int CalendarView::msgItemDelete(const QString name) 2879int CalendarView::msgItemDelete(const QString name)
2843{ 2880{
2844 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2881 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2845 i18n("This item will be\npermanently deleted."), 2882 i18n("This item will be\npermanently deleted."),
2846 i18n("KO/Pi Confirmation"),i18n("Delete")); 2883 i18n("KO/Pi Confirmation"),i18n("Delete"));
2847} 2884}
2848 2885
2849 2886
2850void CalendarView::edit_cut() 2887void CalendarView::edit_cut()
2851{ 2888{
2852 Event *anEvent=0; 2889 Event *anEvent=0;
2853 2890
2854 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2891 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2855 2892
2856 if (mViewManager->currentView()->isEventView()) { 2893 if (mViewManager->currentView()->isEventView()) {
2857 if ( incidence && incidence->typeID() == eventID ) { 2894 if ( incidence && incidence->typeID() == eventID ) {
2858 anEvent = static_cast<Event *>(incidence); 2895 anEvent = static_cast<Event *>(incidence);
2859 } 2896 }
2860 } 2897 }
2861 2898
2862 if (!anEvent) { 2899 if (!anEvent) {
2863 KNotifyClient::beep(); 2900 KNotifyClient::beep();
2864 return; 2901 return;
2865 } 2902 }
2866 DndFactory factory( mCalendar ); 2903 DndFactory factory( mCalendar );
2867 factory.cutIncidence(anEvent); 2904 factory.cutIncidence(anEvent);
2868 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2905 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2869} 2906}
2870 2907
2871void CalendarView::edit_copy() 2908void CalendarView::edit_copy()
2872{ 2909{
2873 Event *anEvent=0; 2910 Event *anEvent=0;
2874 2911
2875 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2912 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2876 2913
2877 if (mViewManager->currentView()->isEventView()) { 2914 if (mViewManager->currentView()->isEventView()) {
2878 if ( incidence && incidence->typeID() == eventID ) { 2915 if ( incidence && incidence->typeID() == eventID ) {
2879 anEvent = static_cast<Event *>(incidence); 2916 anEvent = static_cast<Event *>(incidence);
2880 } 2917 }
2881 } 2918 }
2882 2919
2883 if (!anEvent) { 2920 if (!anEvent) {
2884 KNotifyClient::beep(); 2921 KNotifyClient::beep();
2885 return; 2922 return;
2886 } 2923 }
2887 DndFactory factory( mCalendar ); 2924 DndFactory factory( mCalendar );
2888 factory.copyIncidence(anEvent); 2925 factory.copyIncidence(anEvent);
2889} 2926}
2890 2927
2891void CalendarView::edit_paste() 2928void CalendarView::edit_paste()
2892{ 2929{
2893 QDate date = mNavigator->selectedDates().first(); 2930 QDate date = mNavigator->selectedDates().first();
2894 2931
2895 DndFactory factory( mCalendar ); 2932 DndFactory factory( mCalendar );
2896 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2933 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2897 2934
2898 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2935 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2899} 2936}
2900void CalendarView::edit_global_options() 2937void CalendarView::edit_global_options()
2901{ 2938{
2902 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 2939 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2903 emit save(); 2940 emit save();
2904 emit saveStopTimer(); 2941 emit saveStopTimer();
2905 mDialogManager->showGlobalOptionsDialog(); 2942 mDialogManager->showGlobalOptionsDialog();
2906 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 2943 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2907 emit saveStopTimer(); 2944 emit saveStopTimer();
2908 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!"), 2945 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!"),
2909 i18n("Timezone settings"),i18n("Reload"))) { 2946 i18n("Timezone settings"),i18n("Reload"))) {
2910 qDebug("KO: TZ reload cancelled "); 2947 qDebug("KO: TZ reload cancelled ");
2911 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2948 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2912 return; 2949 return;
2913 } 2950 }
2914 qDebug("KO: Timezone change "); 2951 qDebug("KO: Timezone change ");
2915 loadCalendars(); 2952 loadCalendars();
2916 setModified(true); 2953 setModified(true);
2917 } 2954 }
2918 else 2955 else
2919 qDebug("KO: No tz change "); 2956 qDebug("KO: No tz change ");
2920} 2957}
2921void CalendarView::edit_options() 2958void CalendarView::edit_options()
2922{ 2959{
2923 mDialogManager->showOptionsDialog(); 2960 mDialogManager->showOptionsDialog();
2924} 2961}
2925 2962
2926 2963
2927void CalendarView::slotSelectPickerDate( QDate d) 2964void CalendarView::slotSelectPickerDate( QDate d)
2928{ 2965{
2929 mDateFrame->hide(); 2966 mDateFrame->hide();
2930 if ( mDatePickerMode == 1 ) { 2967 if ( mDatePickerMode == 1 ) {
2931 mNavigator->slotDaySelect( d ); 2968 mNavigator->slotDaySelect( d );
2932 } else if ( mDatePickerMode == 2 ) { 2969 } else if ( mDatePickerMode == 2 ) {
2933 if ( mMoveIncidence->typeID() == todoID ) { 2970 if ( mMoveIncidence->typeID() == todoID ) {
2934 Todo * to = (Todo *) mMoveIncidence; 2971 Todo * to = (Todo *) mMoveIncidence;
2935 QTime tim; 2972 QTime tim;
2936 int len = 0; 2973 int len = 0;
2937 if ( to->hasStartDate() && to->hasDueDate() ) 2974 if ( to->hasStartDate() && to->hasDueDate() )
2938 len = to->dtStart().secsTo( to->dtDue()); 2975 len = to->dtStart().secsTo( to->dtDue());
2939 if ( to->hasDueDate() ) 2976 if ( to->hasDueDate() )
2940 tim = to->dtDue().time(); 2977 tim = to->dtDue().time();
2941 else { 2978 else {
2942 tim = QTime ( 0,0,0 ); 2979 tim = QTime ( 0,0,0 );
2943 to->setFloats( true ); 2980 to->setFloats( true );
2944 to->setHasDueDate( true ); 2981 to->setHasDueDate( true );
2945 } 2982 }
2946 QDateTime dt ( d,tim ); 2983 QDateTime dt ( d,tim );
2947 to->setDtDue( dt ); 2984 to->setDtDue( dt );
2948 2985
2949 if ( to->hasStartDate() ) { 2986 if ( to->hasStartDate() ) {
2950 if ( len>0 ) 2987 if ( len>0 )
2951 to->setDtStart(to->dtDue().addSecs( -len )); 2988 to->setDtStart(to->dtDue().addSecs( -len ));
2952 else 2989 else
2953 if (to->dtStart() > to->dtDue() ) 2990 if (to->dtStart() > to->dtDue() )
2954 to->setDtStart(to->dtDue().addDays( -3 )); 2991 to->setDtStart(to->dtDue().addDays( -3 ));
2955 } 2992 }
2956 2993
2957 todoChanged( to ); 2994 todoChanged( to );
2958 } else if ( mMoveIncidence->typeID() == eventID ) { 2995 } else if ( mMoveIncidence->typeID() == eventID ) {
2959 if ( mMoveIncidence->doesRecur() ) { 2996 if ( mMoveIncidence->doesRecur() ) {
2960#if 0 2997#if 0
2961 // PENDING implement this 2998 // PENDING implement this
2962 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2999 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2963 mCalendar()->addIncidence( newInc ); 3000 mCalendar()->addIncidence( newInc );
2964 if ( mMoveIncidence->typeID() == todoID ) 3001 if ( mMoveIncidence->typeID() == todoID )
2965 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 3002 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2966 else 3003 else
2967 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 3004 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2968 mMoveIncidence = newInc; 3005 mMoveIncidence = newInc;
2969 3006
2970#endif 3007#endif
2971 } 3008 }
2972 QTime tim = mMoveIncidence->dtStart().time(); 3009 QTime tim = mMoveIncidence->dtStart().time();
2973 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 3010 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2974 QDateTime dt ( d,tim ); 3011 QDateTime dt ( d,tim );
2975 mMoveIncidence->setDtStart( dt ); 3012 mMoveIncidence->setDtStart( dt );
2976 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 3013 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2977 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 3014 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2978 } else if ( mMoveIncidence->typeID() == journalID ) { 3015 } else if ( mMoveIncidence->typeID() == journalID ) {
2979 QTime tim = mMoveIncidence->dtStart().time(); 3016 QTime tim = mMoveIncidence->dtStart().time();
2980 QDateTime dt ( d,tim ); 3017 QDateTime dt ( d,tim );
2981 mMoveIncidence->setDtStart( dt ); 3018 mMoveIncidence->setDtStart( dt );
2982 updateView(); 3019 updateView();
2983 } 3020 }
2984 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 3021 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2985 } 3022 }
2986} 3023}
2987 3024
2988void CalendarView::removeCategories() 3025void CalendarView::removeCategories()
2989{ 3026{
2990 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3027 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2991 QStringList catList = KOPrefs::instance()->mCustomCategories; 3028 QStringList catList = KOPrefs::instance()->mCustomCategories;
2992 QStringList catIncList; 3029 QStringList catIncList;
2993 QStringList newCatList; 3030 QStringList newCatList;
2994 Incidence* inc = incList.first(); 3031 Incidence* inc = incList.first();
2995 uint i; 3032 uint i;
2996 while ( inc ) { 3033 while ( inc ) {
2997 newCatList.clear(); 3034 newCatList.clear();
2998 catIncList = inc->categories() ; 3035 catIncList = inc->categories() ;
2999 for( i = 0; i< catIncList.count(); ++i ) { 3036 for( i = 0; i< catIncList.count(); ++i ) {
3000 if ( catList.contains (catIncList[i])) 3037 if ( catList.contains (catIncList[i]))
3001 newCatList.append( catIncList[i] ); 3038 newCatList.append( catIncList[i] );
3002 } 3039 }
3003 newCatList.sort(); 3040 newCatList.sort();
3004 inc->setCategories( newCatList.join(",") ); 3041 inc->setCategories( newCatList.join(",") );
3005 inc = incList.next(); 3042 inc = incList.next();
3006 } 3043 }
3007} 3044}
3008 3045
3009int CalendarView::addCategories() 3046int CalendarView::addCategories()
3010{ 3047{
3011 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3048 QPtrList<Incidence> incList = mCalendar->rawIncidences();
3012 QStringList catList = KOPrefs::instance()->mCustomCategories; 3049 QStringList catList = KOPrefs::instance()->mCustomCategories;
3013 QStringList catIncList; 3050 QStringList catIncList;
3014 Incidence* inc = incList.first(); 3051 Incidence* inc = incList.first();
3015 uint i; 3052 uint i;
3016 int count = 0; 3053 int count = 0;
3017 while ( inc ) { 3054 while ( inc ) {
3018 catIncList = inc->categories() ; 3055 catIncList = inc->categories() ;
3019 for( i = 0; i< catIncList.count(); ++i ) { 3056 for( i = 0; i< catIncList.count(); ++i ) {
3020 if ( !catList.contains (catIncList[i])) { 3057 if ( !catList.contains (catIncList[i])) {
3021 catList.append( catIncList[i] ); 3058 catList.append( catIncList[i] );
3022 //qDebug("add cat %s ", catIncList[i].latin1()); 3059 //qDebug("add cat %s ", catIncList[i].latin1());
3023 ++count; 3060 ++count;
3024 } 3061 }
3025 } 3062 }
3026 inc = incList.next(); 3063 inc = incList.next();
3027 } 3064 }
3028 catList.sort(); 3065 catList.sort();
3029 KOPrefs::instance()->mCustomCategories = catList; 3066 KOPrefs::instance()->mCustomCategories = catList;
3030 return count; 3067 return count;
3031} 3068}
3032 3069
3033void CalendarView::editCategories() 3070void CalendarView::editCategories()
3034{ 3071{
3035 qDebug("CalendarView::editCategories() "); 3072 qDebug("CalendarView::editCategories() ");
3036 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this ); 3073 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this );
3037 ced.exec(); 3074 ced.exec();
3038} 3075}
3039void CalendarView::manageCategories() 3076void CalendarView::manageCategories()
3040{ 3077{
3041 KOCatPrefs* cp = new KOCatPrefs(); 3078 KOCatPrefs* cp = new KOCatPrefs();
3042 cp->show(); 3079 cp->show();
3043 int w =cp->sizeHint().width() ; 3080 int w =cp->sizeHint().width() ;
3044 int h = cp->sizeHint().height() ; 3081 int h = cp->sizeHint().height() ;
3045 int dw = QApplication::desktop()->width(); 3082 int dw = QApplication::desktop()->width();
3046 int dh = QApplication::desktop()->height(); 3083 int dh = QApplication::desktop()->height();
3047 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 3084 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
3048 if ( !cp->exec() ) { 3085 if ( !cp->exec() ) {
3049 delete cp; 3086 delete cp;
3050 return; 3087 return;
3051 } 3088 }
3052 int count = 0; 3089 int count = 0;
3053 if ( cp->addCat() ) { 3090 if ( cp->addCat() ) {
3054 count = addCategories(); 3091 count = addCategories();
3055 if ( count ) { 3092 if ( count ) {
3056 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 3093 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
3057 writeSettings(); 3094 writeSettings();
3058 } else 3095 } else
3059 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 3096 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
3060 } else { 3097 } else {
3061 removeCategories(); 3098 removeCategories();
3062 updateView(); 3099 updateView();
3063 } 3100 }
3064 delete cp; 3101 delete cp;
3065} 3102}
3066 3103
3067void CalendarView::beamIncidence(Incidence * Inc) 3104void CalendarView::beamIncidence(Incidence * Inc)
3068{ 3105{
3069 QPtrList<Incidence> delSel ; 3106 QPtrList<Incidence> delSel ;
3070 delSel.append(Inc); 3107 delSel.append(Inc);
3071 beamIncidenceList( delSel ); 3108 beamIncidenceList( delSel );
3072} 3109}
3073void CalendarView::beamCalendar() 3110void CalendarView::beamCalendar()
3074{ 3111{
3075 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 3112 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
3076 //qDebug("beamCalendar() "); 3113 //qDebug("beamCalendar() ");
3077 beamIncidenceList( delSel ); 3114 beamIncidenceList( delSel );
3078} 3115}
3079void CalendarView::beamFilteredCalendar() 3116void CalendarView::beamFilteredCalendar()
3080{ 3117{
3081 QPtrList<Incidence> delSel = mCalendar->incidences(); 3118 QPtrList<Incidence> delSel = mCalendar->incidences();
3082 //qDebug("beamFilteredCalendar() "); 3119 //qDebug("beamFilteredCalendar() ");
3083 beamIncidenceList( delSel ); 3120 beamIncidenceList( delSel );
3084} 3121}
3085void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 3122void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
3086{ 3123{
3087 3124
3088 KOBeamPrefs beamDialog; 3125 KOBeamPrefs beamDialog;
3089 if ( beamDialog.exec () == QDialog::Rejected ) 3126 if ( beamDialog.exec () == QDialog::Rejected )
3090 return; 3127 return;
3091#ifdef DESKTOP_VERSION 3128#ifdef DESKTOP_VERSION
3092 QString fn = locateLocal( "tmp", "kopibeamfile" ); 3129 QString fn = locateLocal( "tmp", "kopibeamfile" );
3093#else 3130#else
3094 QString fn = "/tmp/kopibeamfile"; 3131 QString fn = "/tmp/kopibeamfile";
3095#endif 3132#endif
3096 QString mes; 3133 QString mes;
3097 bool createbup = true; 3134 bool createbup = true;
3098 if ( createbup ) { 3135 if ( createbup ) {
3099 QString description = "\n"; 3136 QString description = "\n";
3100 CalendarLocal* cal = new CalendarLocal(); 3137 CalendarLocal* cal = new CalendarLocal();
3101 if ( beamDialog.beamLocal() ) 3138 if ( beamDialog.beamLocal() )
3102 cal->setLocalTime(); 3139 cal->setLocalTime();
3103 else 3140 else
3104 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 3141 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
3105 Incidence *incidence = delSel.first(); 3142 Incidence *incidence = delSel.first();
3106 bool addText = false; 3143 bool addText = false;
3107 if ( delSel.count() < 10 ) 3144 if ( delSel.count() < 10 )
3108 addText = true; 3145 addText = true;
3109 else { 3146 else {
3110 description.sprintf(i18n(" %d items?"),delSel.count() ); 3147 description.sprintf(i18n(" %d items?"),delSel.count() );
3111 } 3148 }
3112 while ( incidence ) { 3149 while ( incidence ) {
3113 Incidence *in = incidence->clone(); 3150 Incidence *in = incidence->clone();
3114 if ( ! in->summary().isEmpty() ) { 3151 if ( ! in->summary().isEmpty() ) {
3115 in->setDescription(""); 3152 in->setDescription("");
3116 } else { 3153 } else {
3117 in->setSummary( in->description().left(20)); 3154 in->setSummary( in->description().left(20));
3118 in->setDescription(""); 3155 in->setDescription("");
3119 } 3156 }
3120 if ( addText ) 3157 if ( addText )
3121 description += in->summary() + "\n"; 3158 description += in->summary() + "\n";
3122 cal->addIncidence( in ); 3159 cal->addIncidence( in );
3123 incidence = delSel.next(); 3160 incidence = delSel.next();
3124 } 3161 }
3125 if ( beamDialog.beamVcal() ) { 3162 if ( beamDialog.beamVcal() ) {
3126 fn += ".vcs"; 3163 fn += ".vcs";
3127 FileStorage storage( cal, fn, new VCalFormat ); 3164 FileStorage storage( cal, fn, new VCalFormat );
3128 storage.save(); 3165 storage.save();
3129 } else { 3166 } else {
3130 fn += ".ics"; 3167 fn += ".ics";
3131 FileStorage storage( cal, fn, new ICalFormat( ) ); 3168 FileStorage storage( cal, fn, new ICalFormat( ) );
3132 storage.save(); 3169 storage.save();
3133 } 3170 }
3134 delete cal; 3171 delete cal;
3135 mes = i18n("KO/Pi: Ready for beaming"); 3172 mes = i18n("KO/Pi: Ready for beaming");
3136 topLevelWidget()->setCaption(mes); 3173 topLevelWidget()->setCaption(mes);
3137 KApplication::convert2latin1( fn ); 3174 KApplication::convert2latin1( fn );
3138#ifndef DESKTOP_VERSION 3175#ifndef DESKTOP_VERSION
3139 Ir *ir = new Ir( this ); 3176 Ir *ir = new Ir( this );
3140 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 3177 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
3141 ir->send( fn, description, "text/x-vCalendar" ); 3178 ir->send( fn, description, "text/x-vCalendar" );
3142#endif 3179#endif
3143 } 3180 }
3144} 3181}
3145 3182
3146#ifndef DESKTOP_VERSION 3183#ifndef DESKTOP_VERSION
3147void CalendarView::beamDone( Ir *ir ) 3184void CalendarView::beamDone( Ir *ir )
3148{ 3185{
3149 delete ir; 3186 delete ir;
3150 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 3187 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
3151 topLevelWidget()->raise(); 3188 topLevelWidget()->raise();
3152} 3189}
3153#else 3190#else
3154void CalendarView::beamDone( Ir *){;} 3191void CalendarView::beamDone( Ir *){;}
3155#endif 3192#endif
3156void CalendarView::moveIncidence(Incidence * inc ) 3193void CalendarView::moveIncidence(Incidence * inc )
3157{ 3194{
3158 if ( !inc ) return; 3195 if ( !inc ) return;
3159 showDatePickerPopup(); 3196 showDatePickerPopup();
3160 mDatePickerMode = 2; 3197 mDatePickerMode = 2;
3161 mMoveIncidence = inc ; 3198 mMoveIncidence = inc ;
3162 QDate da; 3199 QDate da;
3163 if ( mMoveIncidence->typeID() == todoID ) { 3200 if ( mMoveIncidence->typeID() == todoID ) {
3164 Todo * to = (Todo *) mMoveIncidence; 3201 Todo * to = (Todo *) mMoveIncidence;
3165 if ( to->hasDueDate() ) 3202 if ( to->hasDueDate() )
3166 da = to->dtDue().date(); 3203 da = to->dtDue().date();
3167 else 3204 else
3168 da = QDate::currentDate(); 3205 da = QDate::currentDate();
3169 } else { 3206 } else {
3170 da = mMoveIncidence->dtStart().date(); 3207 da = mMoveIncidence->dtStart().date();
3171 } 3208 }
3172 //PENDING set date for recurring incidence to date of recurrence 3209 //PENDING set date for recurring incidence to date of recurrence
3173 //mMoveIncidenceOldDate; 3210 //mMoveIncidenceOldDate;
3174 mDatePicker->setDate( da ); 3211 mDatePicker->setDate( da );
3175} 3212}
3176void CalendarView::showDatePickerPopup() 3213void CalendarView::showDatePickerPopup()
3177{ 3214{
3178 if ( mDateFrame->isVisible() ) 3215 if ( mDateFrame->isVisible() )
3179 mDateFrame->hide(); 3216 mDateFrame->hide();
3180 else { 3217 else {
3181 int offX = 0, offY = 0; 3218 int offX = 0, offY = 0;
3182#ifdef DESKTOP_VERSION 3219#ifdef DESKTOP_VERSION
3183 int w =mDatePicker->sizeHint().width() ; 3220 int w =mDatePicker->sizeHint().width() ;
3184 int h = mDatePicker->sizeHint().height() ; 3221 int h = mDatePicker->sizeHint().height() ;
3185 int dw = topLevelWidget()->width(); 3222 int dw = topLevelWidget()->width();
3186 int dh = topLevelWidget()->height(); 3223 int dh = topLevelWidget()->height();
3187 offX = topLevelWidget()->x(); 3224 offX = topLevelWidget()->x();
3188 offY = topLevelWidget()->y(); 3225 offY = topLevelWidget()->y();
3189#else 3226#else
3190 int w =mDatePicker->sizeHint().width() ; 3227 int w =mDatePicker->sizeHint().width() ;
3191 int h = mDatePicker->sizeHint().height() ; 3228 int h = mDatePicker->sizeHint().height() ;
3192 int dw = QApplication::desktop()->width(); 3229 int dw = QApplication::desktop()->width();
3193 int dh = QApplication::desktop()->height(); 3230 int dh = QApplication::desktop()->height();
3194#endif 3231#endif
3195 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); 3232 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
3196 mDateFrame->show(); 3233 mDateFrame->show();
3197 } 3234 }
3198} 3235}
3199void CalendarView::showDatePicker( ) 3236void CalendarView::showDatePicker( )
3200{ 3237{
3201 showDatePickerPopup(); 3238 showDatePickerPopup();
3202 mDatePickerMode = 1; 3239 mDatePickerMode = 1;
3203 mDatePicker->setDate( mNavigator->selectedDates().first() ); 3240 mDatePicker->setDate( mNavigator->selectedDates().first() );
3204} 3241}
3205 3242
3206void CalendarView::showEventEditor() 3243void CalendarView::showEventEditor()
3207{ 3244{
3208#ifdef DESKTOP_VERSION 3245#ifdef DESKTOP_VERSION
3209 int x,y,w,h; 3246 int x,y,w,h;
3210 x = mEventEditor->geometry().x(); 3247 x = mEventEditor->geometry().x();
3211 y = mEventEditor->geometry().y(); 3248 y = mEventEditor->geometry().y();
3212 w = mEventEditor->width(); 3249 w = mEventEditor->width();
3213 h = mEventEditor->height(); 3250 h = mEventEditor->height();
3214 mEventEditor->show(); 3251 mEventEditor->show();
3215 mEventEditor->setGeometry(x,y,w,h); 3252 mEventEditor->setGeometry(x,y,w,h);
3216#else 3253#else
3217 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 3254 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
3218 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3255 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3219 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 3256 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
3220 qApp->processEvents(); 3257 qApp->processEvents();
3221 delete mEventEditor; 3258 delete mEventEditor;
3222 mEventEditor = mDialogManager->getEventEditor(); 3259 mEventEditor = mDialogManager->getEventEditor();
3223 topLevelWidget()->setCaption( i18n("") ); 3260 topLevelWidget()->setCaption( i18n("") );
3224 } 3261 }
3225 mEventEditor->showMaximized(); 3262 mEventEditor->showMaximized();
3226#endif 3263#endif
3227} 3264}
3228void CalendarView::showTodoEditor() 3265void CalendarView::showTodoEditor()
3229{ 3266{
3230#ifdef DESKTOP_VERSION 3267#ifdef DESKTOP_VERSION
3231 int x,y,w,h; 3268 int x,y,w,h;
3232 x = mTodoEditor->geometry().x(); 3269 x = mTodoEditor->geometry().x();
3233 y = mTodoEditor->geometry().y(); 3270 y = mTodoEditor->geometry().y();
3234 w = mTodoEditor->width(); 3271 w = mTodoEditor->width();
3235 h = mTodoEditor->height(); 3272 h = mTodoEditor->height();
3236 mTodoEditor->show(); 3273 mTodoEditor->show();
3237 mTodoEditor->setGeometry(x,y,w,h); 3274 mTodoEditor->setGeometry(x,y,w,h);
3238#else 3275#else
3239 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { 3276 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
3240 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3277 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3241 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); 3278 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
3242 qApp->processEvents(); 3279 qApp->processEvents();
3243 delete mTodoEditor; 3280 delete mTodoEditor;
3244 mTodoEditor = mDialogManager->getTodoEditor(); 3281 mTodoEditor = mDialogManager->getTodoEditor();
3245 topLevelWidget()->setCaption( i18n("") ); 3282 topLevelWidget()->setCaption( i18n("") );
3246 } 3283 }
3247 mTodoEditor->showMaximized(); 3284 mTodoEditor->showMaximized();
3248#endif 3285#endif
3249} 3286}
3250 3287
3251void CalendarView::cloneIncidence() 3288void CalendarView::cloneIncidence()
3252{ 3289{
3253 Incidence *incidence = currentSelection(); 3290 Incidence *incidence = currentSelection();
3254 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3291 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3255 if ( incidence ) { 3292 if ( incidence ) {
3256 cloneIncidence(incidence); 3293 cloneIncidence(incidence);
3257 } 3294 }
3258} 3295}
3259void CalendarView::moveIncidence() 3296void CalendarView::moveIncidence()
3260{ 3297{
3261 Incidence *incidence = currentSelection(); 3298 Incidence *incidence = currentSelection();
3262 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3299 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3263 if ( incidence ) { 3300 if ( incidence ) {
3264 moveIncidence(incidence); 3301 moveIncidence(incidence);
3265 } 3302 }
3266} 3303}
3267void CalendarView::beamIncidence() 3304void CalendarView::beamIncidence()
3268{ 3305{
3269 Incidence *incidence = currentSelection(); 3306 Incidence *incidence = currentSelection();
3270 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3307 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3271 if ( incidence ) { 3308 if ( incidence ) {
3272 beamIncidence(incidence); 3309 beamIncidence(incidence);
3273 } 3310 }
3274} 3311}
3275void CalendarView::toggleCancelIncidence() 3312void CalendarView::toggleCancelIncidence()
3276{ 3313{
3277 Incidence *incidence = currentSelection(); 3314 Incidence *incidence = currentSelection();
3278 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3315 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3279 if ( incidence ) { 3316 if ( incidence ) {
3280 cancelIncidence(incidence); 3317 cancelIncidence(incidence);
3281 } 3318 }
3282} 3319}
3283 3320
3284 3321
3285void CalendarView::cancelIncidence(Incidence * inc ) 3322void CalendarView::cancelIncidence(Incidence * inc )
3286{ 3323{
3287 inc->setCancelled( ! inc->cancelled() ); 3324 inc->setCancelled( ! inc->cancelled() );
3288 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 3325 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
3289 updateView(); 3326 updateView();
3290} 3327}
3291void CalendarView::cloneIncidence(Incidence * orgInc ) 3328void CalendarView::cloneIncidence(Incidence * orgInc )
3292{ 3329{
3293 Incidence * newInc = orgInc->clone(); 3330 Incidence * newInc = orgInc->clone();
3294 newInc->recreate(); 3331 newInc->recreate();
3295 3332
3296 if ( newInc->typeID() == todoID ) { 3333 if ( newInc->typeID() == todoID ) {
3297 Todo* t = (Todo*) newInc; 3334 Todo* t = (Todo*) newInc;
3298 bool cloneSub = false; 3335 bool cloneSub = false;
3299 if ( orgInc->relations().count() ) { 3336 if ( orgInc->relations().count() ) {
3300 int result = KMessageBox::warningYesNoCancel(this, 3337 int result = KMessageBox::warningYesNoCancel(this,
3301 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 ) ), 3338 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 ) ),
3302 i18n("Todo has subtodos"), 3339 i18n("Todo has subtodos"),
3303 i18n("Yes"), 3340 i18n("Yes"),
3304 i18n("No")); 3341 i18n("No"));
3305 3342
3306 if ( result == KMessageBox::Cancel ) { 3343 if ( result == KMessageBox::Cancel ) {
3307 delete t; 3344 delete t;
3308 return; 3345 return;
3309 } 3346 }
3310 if (result == KMessageBox::Yes) cloneSub = true; 3347 if (result == KMessageBox::Yes) cloneSub = true;
3311 } 3348 }
3312 showTodoEditor(); 3349 showTodoEditor();
3313 mTodoEditor->editTodo( t ); 3350 mTodoEditor->editTodo( t );
3314 if ( mTodoEditor->exec() ) { 3351 if ( mTodoEditor->exec() ) {
3315 if ( cloneSub ) { 3352 if ( cloneSub ) {
3316 orgInc->cloneRelations( t ); 3353 orgInc->cloneRelations( t );
3317 mCalendar->addIncidenceBranch( t ); 3354 mCalendar->addIncidenceBranch( t );
3318 updateView(); 3355 updateView();
3319 3356
3320 } else { 3357 } else {
3321 mCalendar->addTodo( t ); 3358 mCalendar->addTodo( t );
3322 updateView(); 3359 updateView();
3323 } 3360 }
3324 } else { 3361 } else {
3325 delete t; 3362 delete t;
3326 } 3363 }
3327 } 3364 }
3328 else if ( newInc->typeID() == eventID ) { 3365 else if ( newInc->typeID() == eventID ) {
3329 Event* e = (Event*) newInc; 3366 Event* e = (Event*) newInc;
3330 showEventEditor(); 3367 showEventEditor();
3331 mEventEditor->editEvent( e ); 3368 mEventEditor->editEvent( e );
3332 if ( mEventEditor->exec() ) { 3369 if ( mEventEditor->exec() ) {
3333 mCalendar->addEvent( e ); 3370 mCalendar->addEvent( e );
3334 updateView(); 3371 updateView();
3335 } else { 3372 } else {
3336 delete e; 3373 delete e;
3337 } 3374 }
3338 } if ( newInc->typeID() == journalID ) { 3375 } if ( newInc->typeID() == journalID ) {
3339 mCalendar->addJournal( (Journal*) newInc ); 3376 mCalendar->addJournal( (Journal*) newInc );
3340 editJournal( (Journal*) newInc ); 3377 editJournal( (Journal*) newInc );
3341 } 3378 }
3342 setActiveWindow(); 3379 setActiveWindow();
3343} 3380}
3344 3381
3345void CalendarView::newEvent() 3382void CalendarView::newEvent()
3346{ 3383{
3347 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 3384 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
3348 KOAgendaView *aView = mViewManager->agendaView(); 3385 KOAgendaView *aView = mViewManager->agendaView();
3349 if (aView) { 3386 if (aView) {
3350 if (aView->selectionStart().isValid()) { 3387 if (aView->selectionStart().isValid()) {
3351 if (aView->selectedIsAllDay()) { 3388 if (aView->selectedIsAllDay()) {
3352 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 3389 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
3353 } else { 3390 } else {
3354 newEvent(aView->selectionStart(),aView->selectionEnd()); 3391 newEvent(aView->selectionStart(),aView->selectionEnd());
3355 } 3392 }
3356 return; 3393 return;
3357 } 3394 }
3358 } 3395 }
3359 3396
3360 QDate date = mNavigator->selectedDates().first(); 3397 QDate date = mNavigator->selectedDates().first();
3361 QDateTime current = QDateTime::currentDateTime(); 3398 QDateTime current = QDateTime::currentDateTime();
3362 if ( date <= current.date() ) { 3399 if ( date <= current.date() ) {
3363 int hour = current.time().hour() +1; 3400 int hour = current.time().hour() +1;
3364 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 3401 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
3365 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3402 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3366 } else 3403 } else
3367 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 3404 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
3368 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 3405 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
3369 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3406 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3370} 3407}
3371 3408
3372void CalendarView::newEvent(QDateTime fh) 3409void CalendarView::newEvent(QDateTime fh)
3373{ 3410{
3374 newEvent(fh, 3411 newEvent(fh,
3375 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 3412 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
3376} 3413}
3377 3414
3378void CalendarView::newEvent(QDate dt) 3415void CalendarView::newEvent(QDate dt)
3379{ 3416{
3380 newEvent(QDateTime(dt, QTime(0,0,0)), 3417 newEvent(QDateTime(dt, QTime(0,0,0)),
3381 QDateTime(dt, QTime(0,0,0)), true); 3418 QDateTime(dt, QTime(0,0,0)), true);
3382} 3419}
3383void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) 3420void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint)
3384{ 3421{
3385 newEvent(fromHint, toHint, false); 3422 newEvent(fromHint, toHint, false);
3386} 3423}
3387void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 3424void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
3388{ 3425{
3389 3426
3390 showEventEditor(); 3427 showEventEditor();
3391 mEventEditor->newEvent(fromHint,toHint,allDay); 3428 mEventEditor->newEvent(fromHint,toHint,allDay);
3392 if ( mFilterView->filtersEnabled() ) { 3429 if ( mFilterView->filtersEnabled() ) {
3393 CalFilter *filter = mFilterView->selectedFilter(); 3430 CalFilter *filter = mFilterView->selectedFilter();
3394 if (filter && filter->showCategories()) { 3431 if (filter && filter->showCategories()) {
3395 mEventEditor->setCategories(filter->categoryList().join(",") ); 3432 mEventEditor->setCategories(filter->categoryList().join(",") );
3396 } 3433 }
3397 if ( filter ) 3434 if ( filter )
3398 mEventEditor->setSecrecy( filter->getSecrecy() ); 3435 mEventEditor->setSecrecy( filter->getSecrecy() );
3399 } 3436 }
3400 mEventEditor->exec(); 3437 mEventEditor->exec();
3401 setActiveWindow(); 3438 setActiveWindow();
3402} 3439}
3403void CalendarView::todoAdded(Todo * t) 3440void CalendarView::todoAdded(Todo * t)
3404{ 3441{
3405 3442
3406 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 3443 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
3407 updateTodoViews(); 3444 updateTodoViews();
3408} 3445}
3409void CalendarView::todoChanged(Todo * t) 3446void CalendarView::todoChanged(Todo * t)
3410{ 3447{
3411 emit todoModified( t, 4 ); 3448 emit todoModified( t, 4 );
3412 // updateTodoViews(); 3449 // updateTodoViews();
3413} 3450}
3414void CalendarView::todoToBeDeleted(Todo *) 3451void CalendarView::todoToBeDeleted(Todo *)
3415{ 3452{
3416 //qDebug("todoToBeDeleted(Todo *) "); 3453 //qDebug("todoToBeDeleted(Todo *) ");
3417 updateTodoViews(); 3454 updateTodoViews();
3418} 3455}
3419void CalendarView::todoDeleted() 3456void CalendarView::todoDeleted()
3420{ 3457{
3421 //qDebug(" todoDeleted()"); 3458 //qDebug(" todoDeleted()");
3422 updateTodoViews(); 3459 updateTodoViews();
3423} 3460}
3424 3461
3425 3462
3426void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) 3463void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
3427{ 3464{
3428 showTodoEditor(); 3465 showTodoEditor();
3429 mTodoEditor->newTodo(dt,0,allday); 3466 mTodoEditor->newTodo(dt,0,allday);
3430 if ( mFilterView->filtersEnabled() ) { 3467 if ( mFilterView->filtersEnabled() ) {
3431 CalFilter *filter = mFilterView->selectedFilter(); 3468 CalFilter *filter = mFilterView->selectedFilter();
3432 if (filter && filter->showCategories()) { 3469 if (filter && filter->showCategories()) {
3433 mTodoEditor->setCategories(filter->categoryList().join(",") ); 3470 mTodoEditor->setCategories(filter->categoryList().join(",") );
3434 } 3471 }
3435 if ( filter ) 3472 if ( filter )
3436 mTodoEditor->setSecrecy( filter->getSecrecy() ); 3473 mTodoEditor->setSecrecy( filter->getSecrecy() );
3437 } 3474 }
3438 mTodoEditor->exec(); 3475 mTodoEditor->exec();
3439 setActiveWindow(); 3476 setActiveWindow();
3440} 3477}
3441 3478
3442void CalendarView::newTodo() 3479void CalendarView::newTodo()
3443{ 3480{
3444 newTodoDateTime( QDateTime(),true ); 3481 newTodoDateTime( QDateTime(),true );
3445} 3482}
3446 3483
3447void CalendarView::newSubTodo() 3484void CalendarView::newSubTodo()
3448{ 3485{
3449 Todo *todo = selectedTodo(); 3486 Todo *todo = selectedTodo();
3450 if ( todo ) newSubTodo( todo ); 3487 if ( todo ) newSubTodo( todo );
3451} 3488}
3452 3489
3453void CalendarView::newSubTodo(Todo *parentEvent) 3490void CalendarView::newSubTodo(Todo *parentEvent)
3454{ 3491{
3455 3492
3456 showTodoEditor(); 3493 showTodoEditor();
3457 mTodoEditor->newTodo(QDateTime(),parentEvent,true); 3494 mTodoEditor->newTodo(QDateTime(),parentEvent,true);
3458 mTodoEditor->exec(); 3495 mTodoEditor->exec();
3459 setActiveWindow(); 3496 setActiveWindow();
3460} 3497}
3461 3498
3462void CalendarView::newFloatingEvent() 3499void CalendarView::newFloatingEvent()
3463{ 3500{
3464 DateList tmpList = mNavigator->selectedDates(); 3501 DateList tmpList = mNavigator->selectedDates();
3465 QDate date = tmpList.first(); 3502 QDate date = tmpList.first();
3466 3503
3467 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 3504 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
3468 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 3505 QDateTime( date, QTime( 12, 0, 0 ) ), true );
3469} 3506}
3470 3507
3471 3508
3472void CalendarView::editEvent( Event *event ) 3509void CalendarView::editEvent( Event *event )
3473{ 3510{
3474 3511
3475 if ( !event ) return; 3512 if ( !event ) return;
3476 if ( event->isReadOnly() ) { 3513 if ( event->isReadOnly() ) {
3477 showEvent( event ); 3514 showEvent( event );
3478 return; 3515 return;
3479 } 3516 }
3480 showEventEditor(); 3517 showEventEditor();
3481 mEventEditor->editEvent( event , mFlagEditDescription); 3518 mEventEditor->editEvent( event , mFlagEditDescription);
3482 mEventEditor->exec(); 3519 mEventEditor->exec();
3483 setActiveWindow(); 3520 setActiveWindow();
3484 3521
3485} 3522}
3486void CalendarView::editJournal( Journal *jour ) 3523void CalendarView::editJournal( Journal *jour )
3487{ 3524{
3488 if ( !jour ) return; 3525 if ( !jour ) return;
3489 mDialogManager->hideSearchDialog(); 3526 mDialogManager->hideSearchDialog();
3490 mViewManager->showJournalView(); 3527 mViewManager->showJournalView();
3491 mNavigator->slotDaySelect( jour->dtStart().date() ); 3528 mNavigator->slotDaySelect( jour->dtStart().date() );
3492} 3529}
3493void CalendarView::editTodo( Todo *todo ) 3530void CalendarView::editTodo( Todo *todo )
3494{ 3531{
3495 if ( !todo ) return; 3532 if ( !todo ) return;
3496 3533
3497 if ( todo->isReadOnly() ) { 3534 if ( todo->isReadOnly() ) {
3498 showTodo( todo ); 3535 showTodo( todo );
3499 return; 3536 return;
3500 } 3537 }
3501 showTodoEditor(); 3538 showTodoEditor();
3502 mTodoEditor->editTodo( todo ,mFlagEditDescription); 3539 mTodoEditor->editTodo( todo ,mFlagEditDescription);
3503 mTodoEditor->exec(); 3540 mTodoEditor->exec();
3504 setActiveWindow(); 3541 setActiveWindow();
3505 3542
3506} 3543}
3507 3544
3508KOEventViewerDialog* CalendarView::getEventViewerDialog() 3545KOEventViewerDialog* CalendarView::getEventViewerDialog()
3509{ 3546{
3510 if ( !mEventViewerDialog ) { 3547 if ( !mEventViewerDialog ) {
3511 mEventViewerDialog = new KOEventViewerDialog(0); 3548 mEventViewerDialog = new KOEventViewerDialog(0);
3512 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 3549 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
3513 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 3550 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
3514 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 3551 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
3515 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 3552 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
3516 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 3553 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
3517 viewManager(), SLOT( showAgendaView( bool ) ) ); 3554 viewManager(), SLOT( showAgendaView( bool ) ) );
3518 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), 3555 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()),
3519 this, SLOT( slotViewerClosed() ) ); 3556 this, SLOT( slotViewerClosed() ) );
3520 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), 3557 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
3521 this, SLOT( todoChanged(Todo *) ) ); 3558 this, SLOT( todoChanged(Todo *) ) );
3522 connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 3559 connect( mEventViewerDialog, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
3523 mEventViewerDialog->resize( 640, 480 ); 3560 mEventViewerDialog->resize( 640, 480 );
3524 3561
3525 } 3562 }
3526 return mEventViewerDialog; 3563 return mEventViewerDialog;
3527} 3564}
3528void CalendarView::showEvent(Event *event) 3565void CalendarView::showEvent(Event *event)
3529{ 3566{
3530 getEventViewerDialog()->setEvent(event); 3567 getEventViewerDialog()->setEvent(event);
3531 getEventViewerDialog()->showMe(); 3568 getEventViewerDialog()->showMe();
3532} 3569}
3533 3570
3534void CalendarView::showTodo(Todo *event) 3571void CalendarView::showTodo(Todo *event)
3535{ 3572{
3536 getEventViewerDialog()->setTodo(event); 3573 getEventViewerDialog()->setTodo(event);
3537 getEventViewerDialog()->showMe(); 3574 getEventViewerDialog()->showMe();
3538} 3575}
3539void CalendarView::showJournal( Journal *jour ) 3576void CalendarView::showJournal( Journal *jour )
3540{ 3577{
3541 getEventViewerDialog()->setJournal(jour); 3578 getEventViewerDialog()->setJournal(jour);
3542 getEventViewerDialog()->showMe(); 3579 getEventViewerDialog()->showMe();
3543 3580
3544} 3581}
3545// void CalendarView::todoModified (Todo *event, int changed) 3582// void CalendarView::todoModified (Todo *event, int changed)
3546// { 3583// {
3547// // if (mDialogList.find (event) != mDialogList.end ()) { 3584// // if (mDialogList.find (event) != mDialogList.end ()) {
3548// // kdDebug() << "Todo modified and open" << endl; 3585// // kdDebug() << "Todo modified and open" << endl;
3549// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; 3586// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event];
3550// // temp->modified (changed); 3587// // temp->modified (changed);
3551 3588
3552// // } 3589// // }
3553 3590
3554// mViewManager->updateView(); 3591// mViewManager->updateView();
3555// } 3592// }
3556 3593
3557void CalendarView::appointment_show() 3594void CalendarView::appointment_show()
3558{ 3595{
3559 Event *anEvent = 0; 3596 Event *anEvent = 0;
3560 3597
3561 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3598 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3562 3599
3563 if (mViewManager->currentView()->isEventView()) { 3600 if (mViewManager->currentView()->isEventView()) {
3564 if ( incidence && incidence->typeID() == eventID ) { 3601 if ( incidence && incidence->typeID() == eventID ) {
3565 anEvent = static_cast<Event *>(incidence); 3602 anEvent = static_cast<Event *>(incidence);
3566 } 3603 }
3567 } 3604 }
3568 3605
3569 if (!anEvent) { 3606 if (!anEvent) {
3570 KNotifyClient::beep(); 3607 KNotifyClient::beep();
3571 return; 3608 return;
3572 } 3609 }
3573 3610
3574 showEvent(anEvent); 3611 showEvent(anEvent);
3575} 3612}
3576 3613
3577void CalendarView::appointment_edit() 3614void CalendarView::appointment_edit()
3578{ 3615{
3579 Event *anEvent = 0; 3616 Event *anEvent = 0;
3580 3617
3581 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3618 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3582 3619
3583 if (mViewManager->currentView()->isEventView()) { 3620 if (mViewManager->currentView()->isEventView()) {
3584 if ( incidence && incidence->typeID() == eventID ) { 3621 if ( incidence && incidence->typeID() == eventID ) {
3585 anEvent = static_cast<Event *>(incidence); 3622 anEvent = static_cast<Event *>(incidence);
3586 } 3623 }
3587 } 3624 }
3588 3625
3589 if (!anEvent) { 3626 if (!anEvent) {
3590 KNotifyClient::beep(); 3627 KNotifyClient::beep();
3591 return; 3628 return;
3592 } 3629 }
3593 3630
3594 editEvent(anEvent); 3631 editEvent(anEvent);
3595} 3632}
3596 3633
3597void CalendarView::appointment_delete() 3634void CalendarView::appointment_delete()
3598{ 3635{
3599 Event *anEvent = 0; 3636 Event *anEvent = 0;
3600 3637
3601 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3638 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3602 3639
3603 if (mViewManager->currentView()->isEventView()) { 3640 if (mViewManager->currentView()->isEventView()) {
3604 if ( incidence && incidence->typeID() == eventID ) { 3641 if ( incidence && incidence->typeID() == eventID ) {
3605 anEvent = static_cast<Event *>(incidence); 3642 anEvent = static_cast<Event *>(incidence);
3606 } 3643 }
3607 } 3644 }
3608 3645
3609 if (!anEvent) { 3646 if (!anEvent) {
3610 KNotifyClient::beep(); 3647 KNotifyClient::beep();
3611 return; 3648 return;
3612 } 3649 }
3613 3650
3614 deleteEvent(anEvent); 3651 deleteEvent(anEvent);
3615} 3652}
3616 3653
3617void CalendarView::todo_resub( Todo * parent, Todo * sub ) 3654void CalendarView::todo_resub( Todo * parent, Todo * sub )
3618{ 3655{
3619 if (!sub) return; 3656 if (!sub) return;
3620 if ( sub->relatedTo() == parent ) 3657 if ( sub->relatedTo() == parent )
3621 return; 3658 return;
3622 sub->setRelatedTo(parent); 3659 sub->setRelatedTo(parent);
3623 sub->updated(); 3660 sub->updated();
3624 setModified(true); 3661 setModified(true);
3625 updateView(); 3662 updateView();
3626} 3663}
3627void CalendarView::todo_unsub(Todo *anTodo ) 3664void CalendarView::todo_unsub(Todo *anTodo )
3628{ 3665{
3629 todo_resub( 0, anTodo ); 3666 todo_resub( 0, anTodo );
3630} 3667}
3631 3668
3632void CalendarView::deleteTodo(Todo *todo) 3669void CalendarView::deleteTodo(Todo *todo)
3633{ 3670{
3634 if (!todo) { 3671 if (!todo) {
3635 KNotifyClient::beep(); 3672 KNotifyClient::beep();
3636 return; 3673 return;
3637 } 3674 }
3638 if (KOPrefs::instance()->mConfirm) { 3675 if (KOPrefs::instance()->mConfirm) {
3639 QString text = KGlobal::formatMessage ( todo->summary(),0 ); 3676 QString text = KGlobal::formatMessage ( todo->summary(),0 );
3640 if (!todo->relations().isEmpty()) { 3677 if (!todo->relations().isEmpty()) {
3641 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); 3678 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
3642 3679
3643 } 3680 }
3644 switch (msgItemDelete(i18n("Todo:") +"\n"+text)) { 3681 switch (msgItemDelete(i18n("Todo:") +"\n"+text)) {
3645 case KMessageBox::Continue: // OK 3682 case KMessageBox::Continue: // OK
3646 bool deleteT = false; 3683 bool deleteT = false;
3647 if (!todo->relations().isEmpty()) { 3684 if (!todo->relations().isEmpty()) {
3648 deleteT = removeCompletedSubTodos( todo ); 3685 deleteT = removeCompletedSubTodos( todo );
3649 } 3686 }
3650 // deleteT == true: todo already deleted in removeCompletedSubTodos 3687 // deleteT == true: todo already deleted in removeCompletedSubTodos
3651 if ( !deleteT ) { 3688 if ( !deleteT ) {
3652 checkExternalId( todo ); 3689 checkExternalId( todo );
3653 calendar()->deleteTodo(todo); 3690 calendar()->deleteTodo(todo);
3654 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 3691 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
3655 updateView(); 3692 updateView();
3656 } 3693 }
3657 break; 3694 break;
3658 } // switch 3695 } // switch
3659 } else { 3696 } else {
3660 checkExternalId( todo ); 3697 checkExternalId( todo );
3661 mCalendar->deleteTodo(todo); 3698 mCalendar->deleteTodo(todo);
3662 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 3699 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
3663 updateView(); 3700 updateView();
3664 } 3701 }
3665 3702
3666 emit updateSearchDialog(); 3703 emit updateSearchDialog();
3667} 3704}
3668void CalendarView::deleteJournal(Journal *jour) 3705void CalendarView::deleteJournal(Journal *jour)
3669{ 3706{
3670 if (!jour) { 3707 if (!jour) {
3671 KNotifyClient::beep(); 3708 KNotifyClient::beep();
3672 return; 3709 return;
3673 } 3710 }
3674 if (KOPrefs::instance()->mConfirm) { 3711 if (KOPrefs::instance()->mConfirm) {
3675 3712
3676 QString des; 3713 QString des;
3677 if ( !jour->summary().isEmpty() ) { 3714 if ( !jour->summary().isEmpty() ) {
3678 des = jour->summary(); 3715 des = jour->summary();
3679 } else { 3716 } else {
3680 des = jour->description().left(30); 3717 des = jour->description().left(30);
3681 des = des.simplifyWhiteSpace (); 3718 des = des.simplifyWhiteSpace ();
3682 des.replace (QRegExp ("\\n"),"" ); 3719 des.replace (QRegExp ("\\n"),"" );
3683 des.replace (QRegExp ("\\r"),"" ); 3720 des.replace (QRegExp ("\\r"),"" );
3684 } 3721 }
3685 switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) { 3722 switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) {
3686 case KMessageBox::Continue: // OK 3723 case KMessageBox::Continue: // OK
3687 calendar()->deleteJournal(jour); 3724 calendar()->deleteJournal(jour);
3688 updateView(); 3725 updateView();
3689 break; 3726 break;
3690 } // switch 3727 } // switch
3691 } else { 3728 } else {
3692 calendar()->deleteJournal(jour);; 3729 calendar()->deleteJournal(jour);;
3693 updateView(); 3730 updateView();
3694 } 3731 }
3695 emit updateSearchDialog(); 3732 emit updateSearchDialog();
3696} 3733}
3697 3734
3698void CalendarView::deleteEvent(Event *anEvent) 3735void CalendarView::deleteEvent(Event *anEvent)
3699{ 3736{
3700 if (!anEvent) { 3737 if (!anEvent) {
3701 KNotifyClient::beep(); 3738 KNotifyClient::beep();
3702 return; 3739 return;
3703 } 3740 }
3704 3741
3705 if (anEvent->recurrence()->doesRecur()) { 3742 if (anEvent->recurrence()->doesRecur()) {
3706 QDate itemDate = mViewManager->currentSelectionDate(); 3743 QDate itemDate = mViewManager->currentSelectionDate();
3707 int km; 3744 int km;
3708 if (!itemDate.isValid()) { 3745 if (!itemDate.isValid()) {
3709 //kdDebug() << "Date Not Valid" << endl; 3746 //kdDebug() << "Date Not Valid" << endl;
3710 if (KOPrefs::instance()->mConfirm) { 3747 if (KOPrefs::instance()->mConfirm) {
3711 km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + 3748 km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3712 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 3749 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
3713 i18n("KO/Pi Confirmation"),i18n("Delete All")); 3750 i18n("KO/Pi Confirmation"),i18n("Delete All"));
3714 if ( km == KMessageBox::Continue ) 3751 if ( km == KMessageBox::Continue )
3715 km = KMessageBox::No; // No = all below 3752 km = KMessageBox::No; // No = all below
3716 } else 3753 } else
3717 km = KMessageBox::No; 3754 km = KMessageBox::No;
3718 } else { 3755 } else {
3719 km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + 3756 km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3720 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 3757 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
3721 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), 3758 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
3722 i18n("KO/Pi Confirmation"),i18n("Current"), 3759 i18n("KO/Pi Confirmation"),i18n("Current"),
3723 i18n("All")); 3760 i18n("All"));
3724 } 3761 }
3725 switch(km) { 3762 switch(km) {
3726 3763
3727 case KMessageBox::No: // Continue // all 3764 case KMessageBox::No: // Continue // all
3728 //qDebug("KMessageBox::No "); 3765 //qDebug("KMessageBox::No ");
3729 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3766 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3730 schedule(Scheduler::Cancel,anEvent); 3767 schedule(Scheduler::Cancel,anEvent);
3731 3768
3732 checkExternalId( anEvent); 3769 checkExternalId( anEvent);
3733 mCalendar->deleteEvent(anEvent); 3770 mCalendar->deleteEvent(anEvent);
3734 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); 3771 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED);
3735 break; 3772 break;
3736 3773
3737 // Disabled because it does not work 3774 // Disabled because it does not work
3738 //#if 0 3775 //#if 0
3739 case KMessageBox::Yes: // just this one 3776 case KMessageBox::Yes: // just this one
3740 //QDate qd = mNavigator->selectedDates().first(); 3777 //QDate qd = mNavigator->selectedDates().first();
3741 //if (!qd.isValid()) { 3778 //if (!qd.isValid()) {
3742 // kdDebug() << "no date selected, or invalid date" << endl; 3779 // kdDebug() << "no date selected, or invalid date" << endl;
3743 // KNotifyClient::beep(); 3780 // KNotifyClient::beep();
3744 // return; 3781 // return;
3745 //} 3782 //}
3746 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); 3783 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1);
3747 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { 3784 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) {
3748 anEvent->addExDate(itemDate); 3785 anEvent->addExDate(itemDate);
3749 int duration = anEvent->recurrence()->duration(); 3786 int duration = anEvent->recurrence()->duration();
3750 if ( duration > 0 ) { 3787 if ( duration > 0 ) {
3751 anEvent->recurrence()->setDuration( duration - 1 ); 3788 anEvent->recurrence()->setDuration( duration - 1 );
3752 } 3789 }
3753 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); 3790 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
3754 } 3791 }
3755 break; 3792 break;
3756 //#endif 3793 //#endif
3757 } // switch 3794 } // switch
3758 } else { 3795 } else {
3759 if (KOPrefs::instance()->mConfirm) { 3796 if (KOPrefs::instance()->mConfirm) {
3760 switch (KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + 3797 switch (KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3761 i18n("\nAre you sure you want\nto delete this event?"), 3798 i18n("\nAre you sure you want\nto delete this event?"),
3762 i18n("KO/Pi Confirmation"),i18n("Delete"))) { 3799 i18n("KO/Pi Confirmation"),i18n("Delete"))) {
3763 case KMessageBox::Continue: // OK 3800 case KMessageBox::Continue: // OK
3764 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3801 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3765 schedule(Scheduler::Cancel,anEvent); 3802 schedule(Scheduler::Cancel,anEvent);
3766 checkExternalId( anEvent); 3803 checkExternalId( anEvent);
3767 mCalendar->deleteEvent(anEvent); 3804 mCalendar->deleteEvent(anEvent);
3768 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3805 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3769 break; 3806 break;
3770 } // switch 3807 } // switch
3771 } else { 3808 } else {
3772 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3809 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3773 schedule(Scheduler::Cancel,anEvent); 3810 schedule(Scheduler::Cancel,anEvent);
3774 checkExternalId( anEvent); 3811 checkExternalId( anEvent);
3775 mCalendar->deleteEvent(anEvent); 3812 mCalendar->deleteEvent(anEvent);
3776 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3813 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3777 } 3814 }
3778 } // if-else 3815 } // if-else
3779 emit updateSearchDialog(); 3816 emit updateSearchDialog();
3780} 3817}
3781 3818
3782bool CalendarView::deleteEvent(const QString &uid) 3819bool CalendarView::deleteEvent(const QString &uid)
3783{ 3820{
3784 Event *ev = mCalendar->event(uid); 3821 Event *ev = mCalendar->event(uid);
3785 if (ev) { 3822 if (ev) {
3786 deleteEvent(ev); 3823 deleteEvent(ev);
3787 return true; 3824 return true;
3788 } else { 3825 } else {
3789 return false; 3826 return false;
3790 } 3827 }
3791} 3828}
3792 3829
3793/*****************************************************************************/ 3830/*****************************************************************************/
3794 3831
3795void CalendarView::action_mail() 3832void CalendarView::action_mail()
3796{ 3833{
3797#ifndef KORG_NOMAIL 3834#ifndef KORG_NOMAIL
3798 KOMailClient mailClient; 3835 KOMailClient mailClient;
3799 3836
3800 Incidence *incidence = currentSelection(); 3837 Incidence *incidence = currentSelection();
3801 3838
3802 if (!incidence) { 3839 if (!incidence) {
3803 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3840 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3804 return; 3841 return;
3805 } 3842 }
3806 if(incidence->attendeeCount() == 0 ) { 3843 if(incidence->attendeeCount() == 0 ) {
3807 KMessageBox::sorry(this, 3844 KMessageBox::sorry(this,
3808 i18n("Can't generate mail:\nNo attendees defined.\n")); 3845 i18n("Can't generate mail:\nNo attendees defined.\n"));
3809 return; 3846 return;
3810 } 3847 }
3811 3848
3812 CalendarLocal cal_tmp; 3849 CalendarLocal cal_tmp;
3813 Event *event = 0; 3850 Event *event = 0;
3814 Event *ev = 0; 3851 Event *ev = 0;
3815 if ( incidence && incidence->typeID() == eventID ) { 3852 if ( incidence && incidence->typeID() == eventID ) {
3816 event = static_cast<Event *>(incidence); 3853 event = static_cast<Event *>(incidence);
3817 ev = new Event(*event); 3854 ev = new Event(*event);
3818 cal_tmp.addEvent(ev); 3855 cal_tmp.addEvent(ev);
3819 } 3856 }
3820 ICalFormat mForm(); 3857 ICalFormat mForm();
3821 QString attachment = mForm.toString( &cal_tmp ); 3858 QString attachment = mForm.toString( &cal_tmp );
3822 if (ev) delete(ev); 3859 if (ev) delete(ev);
3823 3860
3824 mailClient.mailAttendees(currentSelection(), attachment); 3861 mailClient.mailAttendees(currentSelection(), attachment);
3825 3862
3826#endif 3863#endif
3827 3864
3828#if 0 3865#if 0
3829 Event *anEvent = 0; 3866 Event *anEvent = 0;
3830 if (mViewManager->currentView()->isEventView()) { 3867 if (mViewManager->currentView()->isEventView()) {
3831 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); 3868 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first());
3832 } 3869 }
3833 3870
3834 if (!anEvent) { 3871 if (!anEvent) {
3835 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3872 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3836 return; 3873 return;
3837 } 3874 }
3838 if(anEvent->attendeeCount() == 0 ) { 3875 if(anEvent->attendeeCount() == 0 ) {
3839 KMessageBox::sorry(this, 3876 KMessageBox::sorry(this,
3840 i18n("Can't generate mail:\nNo attendees defined.\n")); 3877 i18n("Can't generate mail:\nNo attendees defined.\n"));
3841 return; 3878 return;
3842 } 3879 }
3843 3880
3844 mailobject.emailEvent(anEvent); 3881 mailobject.emailEvent(anEvent);
3845#endif 3882#endif
3846} 3883}
3847 3884
3848 3885
3849void CalendarView::schedule_publish(Incidence *incidence) 3886void CalendarView::schedule_publish(Incidence *incidence)
3850{ 3887{
3851 Event *event = 0; 3888 Event *event = 0;
3852 Todo *todo = 0; 3889 Todo *todo = 0;
3853 3890
3854 if (incidence == 0) { 3891 if (incidence == 0) {
3855 incidence = mViewManager->currentView()->selectedIncidences().first(); 3892 incidence = mViewManager->currentView()->selectedIncidences().first();
3856 if (incidence == 0) { 3893 if (incidence == 0) {
3857 incidence = mTodoList->selectedIncidences().first(); 3894 incidence = mTodoList->selectedIncidences().first();
3858 } 3895 }
3859 } 3896 }
3860 if ( incidence && incidence->typeID() == eventID ) { 3897 if ( incidence && incidence->typeID() == eventID ) {
3861 event = static_cast<Event *>(incidence); 3898 event = static_cast<Event *>(incidence);
3862 } else { 3899 } else {
3863 if ( incidence && incidence->typeID() == todoID ) { 3900 if ( incidence && incidence->typeID() == todoID ) {
3864 todo = static_cast<Todo *>(incidence); 3901 todo = static_cast<Todo *>(incidence);
3865 } 3902 }
3866 } 3903 }
3867 3904
3868 if (!event && !todo) { 3905 if (!event && !todo) {
3869 KMessageBox::sorry(this,i18n("No event selected.")); 3906 KMessageBox::sorry(this,i18n("No event selected."));
3870 return; 3907 return;
3871 } 3908 }
3872 3909
3873 PublishDialog *publishdlg = new PublishDialog(); 3910 PublishDialog *publishdlg = new PublishDialog();
3874 if (incidence->attendeeCount()>0) { 3911 if (incidence->attendeeCount()>0) {
3875 QPtrList<Attendee> attendees = incidence->attendees(); 3912 QPtrList<Attendee> attendees = incidence->attendees();
3876 attendees.first(); 3913 attendees.first();
3877 while ( attendees.current()!=0 ) { 3914 while ( attendees.current()!=0 ) {
3878 publishdlg->addAttendee(attendees.current()); 3915 publishdlg->addAttendee(attendees.current());
3879 attendees.next(); 3916 attendees.next();
3880 } 3917 }
3881 } 3918 }
3882 bool send = true; 3919 bool send = true;
3883 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { 3920 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) {
3884 if ( publishdlg->exec() != QDialog::Accepted ) 3921 if ( publishdlg->exec() != QDialog::Accepted )
3885 send = false; 3922 send = false;
3886 } 3923 }
3887 if ( send ) { 3924 if ( send ) {
3888 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3925 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3889 if ( event ) { 3926 if ( event ) {
3890 Event *ev = new Event(*event); 3927 Event *ev = new Event(*event);
3891 ev->registerObserver(0); 3928 ev->registerObserver(0);
3892 ev->clearAttendees(); 3929 ev->clearAttendees();
3893 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3930 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3894 delete(ev); 3931 delete(ev);
3895 } 3932 }
3896 } else { 3933 } else {
3897 if ( todo ) { 3934 if ( todo ) {
3898 Todo *ev = new Todo(*todo); 3935 Todo *ev = new Todo(*todo);
3899 ev->registerObserver(0); 3936 ev->registerObserver(0);
3900 ev->clearAttendees(); 3937 ev->clearAttendees();
3901 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3938 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3902 delete(ev); 3939 delete(ev);
3903 } 3940 }
3904 } 3941 }
3905 } 3942 }
3906 } 3943 }
3907 delete publishdlg; 3944 delete publishdlg;
3908} 3945}
3909 3946
3910void CalendarView::schedule_request(Incidence *incidence) 3947void CalendarView::schedule_request(Incidence *incidence)
3911{ 3948{
3912 schedule(Scheduler::Request,incidence); 3949 schedule(Scheduler::Request,incidence);
3913} 3950}
3914 3951
3915void CalendarView::schedule_refresh(Incidence *incidence) 3952void CalendarView::schedule_refresh(Incidence *incidence)
3916{ 3953{
3917 schedule(Scheduler::Refresh,incidence); 3954 schedule(Scheduler::Refresh,incidence);
3918} 3955}
3919 3956
3920void CalendarView::schedule_cancel(Incidence *incidence) 3957void CalendarView::schedule_cancel(Incidence *incidence)
3921{ 3958{
3922 schedule(Scheduler::Cancel,incidence); 3959 schedule(Scheduler::Cancel,incidence);
3923} 3960}
3924 3961
3925void CalendarView::schedule_add(Incidence *incidence) 3962void CalendarView::schedule_add(Incidence *incidence)
3926{ 3963{
3927 schedule(Scheduler::Add,incidence); 3964 schedule(Scheduler::Add,incidence);
3928} 3965}
3929 3966
3930void CalendarView::schedule_reply(Incidence *incidence) 3967void CalendarView::schedule_reply(Incidence *incidence)
3931{ 3968{
3932 schedule(Scheduler::Reply,incidence); 3969 schedule(Scheduler::Reply,incidence);
3933} 3970}
3934 3971
3935void CalendarView::schedule_counter(Incidence *incidence) 3972void CalendarView::schedule_counter(Incidence *incidence)
3936{ 3973{
3937 schedule(Scheduler::Counter,incidence); 3974 schedule(Scheduler::Counter,incidence);
3938} 3975}
3939 3976
3940void CalendarView::schedule_declinecounter(Incidence *incidence) 3977void CalendarView::schedule_declinecounter(Incidence *incidence)
3941{ 3978{
3942 schedule(Scheduler::Declinecounter,incidence); 3979 schedule(Scheduler::Declinecounter,incidence);
3943} 3980}
3944 3981
3945void CalendarView::schedule_publish_freebusy(int daysToPublish) 3982void CalendarView::schedule_publish_freebusy(int daysToPublish)
3946{ 3983{
3947 QDateTime start = QDateTime::currentDateTime(); 3984 QDateTime start = QDateTime::currentDateTime();
3948 QDateTime end = start.addDays(daysToPublish); 3985 QDateTime end = start.addDays(daysToPublish);
3949 3986
3950 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); 3987 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
3951 freebusy->setOrganizer(KOPrefs::instance()->email()); 3988 freebusy->setOrganizer(KOPrefs::instance()->email());
3952 3989
3953 3990
3954 PublishDialog *publishdlg = new PublishDialog(); 3991 PublishDialog *publishdlg = new PublishDialog();
3955 if ( publishdlg->exec() == QDialog::Accepted ) { 3992 if ( publishdlg->exec() == QDialog::Accepted ) {
3956 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3993 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3957 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { 3994 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) {
3958 delete(freebusy); 3995 delete(freebusy);
3959 } 3996 }
3960 } 3997 }
3961 delete publishdlg; 3998 delete publishdlg;
3962} 3999}
3963 4000
3964void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) 4001void CalendarView::schedule(Scheduler::Method method, Incidence *incidence)
3965{ 4002{
3966 Event *event = 0; 4003 Event *event = 0;
3967 Todo *todo = 0; 4004 Todo *todo = 0;
3968 4005
3969 if (incidence == 0) { 4006 if (incidence == 0) {
3970 incidence = mViewManager->currentView()->selectedIncidences().first(); 4007 incidence = mViewManager->currentView()->selectedIncidences().first();
3971 if (incidence == 0) { 4008 if (incidence == 0) {
3972 incidence = mTodoList->selectedIncidences().first(); 4009 incidence = mTodoList->selectedIncidences().first();
3973 } 4010 }
3974 } 4011 }
3975 if ( incidence && incidence->typeID() == eventID ) { 4012 if ( incidence && incidence->typeID() == eventID ) {
3976 event = static_cast<Event *>(incidence); 4013 event = static_cast<Event *>(incidence);
3977 } 4014 }
3978 if ( incidence && incidence->typeID() == todoID ) { 4015 if ( incidence && incidence->typeID() == todoID ) {
3979 todo = static_cast<Todo *>(incidence); 4016 todo = static_cast<Todo *>(incidence);
3980 } 4017 }
3981 4018
3982 if (!event && !todo) { 4019 if (!event && !todo) {
3983 KMessageBox::sorry(this,i18n("No event selected.")); 4020 KMessageBox::sorry(this,i18n("No event selected."));
3984 return; 4021 return;
3985 } 4022 }
3986 4023
3987 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { 4024 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) {
3988 KMessageBox::sorry(this,i18n("The event has no attendees.")); 4025 KMessageBox::sorry(this,i18n("The event has no attendees."));
3989 return; 4026 return;
3990 } 4027 }
3991 4028
3992 Event *ev = 0; 4029 Event *ev = 0;
3993 if (event) ev = new Event(*event); 4030 if (event) ev = new Event(*event);
3994 Todo *to = 0; 4031 Todo *to = 0;
3995 if (todo) to = new Todo(*todo); 4032 if (todo) to = new Todo(*todo);
3996 4033
3997 if (method == Scheduler::Reply || method == Scheduler::Refresh) { 4034 if (method == Scheduler::Reply || method == Scheduler::Refresh) {
3998 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 4035 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
3999 if (!me) { 4036 if (!me) {
4000 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); 4037 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails."));
4001 return; 4038 return;
4002 } 4039 }
4003 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { 4040 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) {
4004 StatusDialog *statdlg = new StatusDialog(this); 4041 StatusDialog *statdlg = new StatusDialog(this);
4005 if (!statdlg->exec()==QDialog::Accepted) return; 4042 if (!statdlg->exec()==QDialog::Accepted) return;
4006 me->setStatus( statdlg->status() ); 4043 me->setStatus( statdlg->status() );
4007 delete(statdlg); 4044 delete(statdlg);
4008 } 4045 }
4009 Attendee *menew = new Attendee(*me); 4046 Attendee *menew = new Attendee(*me);
4010 if (ev) { 4047 if (ev) {
4011 ev->clearAttendees(); 4048 ev->clearAttendees();
4012 ev->addAttendee(menew,false); 4049 ev->addAttendee(menew,false);
4013 } else { 4050 } else {
4014 if (to) { 4051 if (to) {
4015 todo->clearAttendees(); 4052 todo->clearAttendees();
4016 todo->addAttendee(menew,false); 4053 todo->addAttendee(menew,false);
4017 } 4054 }
4018 } 4055 }
4019 } 4056 }
4020 4057
4021 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 4058 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
4022 if (ev) { 4059 if (ev) {
4023 if ( !dlg->addMessage(ev,method) ) delete(ev); 4060 if ( !dlg->addMessage(ev,method) ) delete(ev);
4024 } else { 4061 } else {
4025 if (to) { 4062 if (to) {
4026 if ( !dlg->addMessage(to,method) ) delete(to); 4063 if ( !dlg->addMessage(to,method) ) delete(to);
4027 } 4064 }
4028 } 4065 }
4029} 4066}
4030 4067
4031void CalendarView::openAddressbook() 4068void CalendarView::openAddressbook()
4032{ 4069{
4033 KRun::runCommand("kaddressbook"); 4070 KRun::runCommand("kaddressbook");
4034} 4071}
4035 4072
4036void CalendarView::setModified(bool modified) 4073void CalendarView::setModified(bool modified)
4037{ 4074{
4038 if ( modified ) 4075 if ( modified )
4039 emit signalmodified(); 4076 emit signalmodified();
4040 if (mModified != modified) { 4077 if (mModified != modified) {
4041 mModified = modified; 4078 mModified = modified;
4042 emit modifiedChanged(mModified); 4079 emit modifiedChanged(mModified);
4043 } 4080 }
4044} 4081}
4045 4082
4046bool CalendarView::isReadOnly() 4083bool CalendarView::isReadOnly()
4047{ 4084{
4048 return mReadOnly; 4085 return mReadOnly;
4049} 4086}
4050 4087
4051void CalendarView::setReadOnly(bool readOnly) 4088void CalendarView::setReadOnly(bool readOnly)
4052{ 4089{
4053 if (mReadOnly != readOnly) { 4090 if (mReadOnly != readOnly) {
4054 mReadOnly = readOnly; 4091 mReadOnly = readOnly;
4055 emit readOnlyChanged(mReadOnly); 4092 emit readOnlyChanged(mReadOnly);
4056 } 4093 }
4057} 4094}
4058 4095
4059bool CalendarView::isModified() 4096bool CalendarView::isModified()
4060{ 4097{
4061 return mModified; 4098 return mModified;
4062} 4099}
4063void CalendarView::slotprintSelInc() 4100void CalendarView::slotprintSelInc()
4064{ 4101{
4065 if ( currentSelection() == 0 ) { 4102 if ( currentSelection() == 0 ) {
4066 KMessageBox::sorry(this,i18n("There is nothing selected!")); 4103 KMessageBox::sorry(this,i18n("There is nothing selected!"));
4067 return; 4104 return;
4068 } 4105 }
4069 showIncidence(); 4106 showIncidence();
4070 getEventViewerDialog()->print(); 4107 getEventViewerDialog()->print();
4071 4108
4072} 4109}
4073void CalendarView::printSetup() 4110void CalendarView::printSetup()
4074{ 4111{
4075#ifndef KORG_NOPRINTER 4112#ifndef KORG_NOPRINTER
4076 createPrinter(); 4113 createPrinter();
4077 4114
4078 mCalPrinter->setupPrinter(); 4115 mCalPrinter->setupPrinter();
4079#endif 4116#endif
4080} 4117}
4081 4118
4082void CalendarView::print() 4119void CalendarView::print()
4083{ 4120{
4084#ifndef KORG_NOPRINTER 4121#ifndef KORG_NOPRINTER
4085 createPrinter(); 4122 createPrinter();
4086 4123
4087 DateList tmpDateList = mNavigator->selectedDates(); 4124 DateList tmpDateList = mNavigator->selectedDates();
4088 mCalPrinter->print(CalPrinter::Month, 4125 mCalPrinter->print(CalPrinter::Month,
4089 tmpDateList.first(), tmpDateList.last()); 4126 tmpDateList.first(), tmpDateList.last());
4090#endif 4127#endif
4091} 4128}
4092 4129
4093void CalendarView::printPreview() 4130void CalendarView::printPreview()
4094{ 4131{
4095#ifndef KORG_NOPRINTER 4132#ifndef KORG_NOPRINTER
4096 kdDebug() << "CalendarView::printPreview()" << endl; 4133 kdDebug() << "CalendarView::printPreview()" << endl;
4097 4134
4098 createPrinter(); 4135 createPrinter();
4099 4136
4100 DateList tmpDateList = mNavigator->selectedDates(); 4137 DateList tmpDateList = mNavigator->selectedDates();
4101 4138
4102 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), 4139 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(),
4103 tmpDateList.last()); 4140 tmpDateList.last());
4104#endif 4141#endif
4105} 4142}
4106 4143
4107void CalendarView::exportICalendar() 4144void CalendarView::exportICalendar()
4108{ 4145{
4109 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); 4146 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this);
4110 4147
4111 // Force correct extension 4148 // Force correct extension
4112 if (filename.right(4) != ".ics") filename += ".ics"; 4149 if (filename.right(4) != ".ics") filename += ".ics";
4113 4150
4114 FileStorage storage( mCalendar, filename, new ICalFormat() ); 4151 FileStorage storage( mCalendar, filename, new ICalFormat() );
4115 storage.save(); 4152 storage.save();
4116} 4153}
4117 4154
4118bool CalendarView::exportVCalendar( QString filename ) 4155bool CalendarView::exportVCalendar( QString filename )
4119{ 4156{
4120 if (mCalendar->journals().count() > 0) { 4157 if (mCalendar->journals().count() > 0) {
4121 int result = KMessageBox::warningContinueCancel(this, 4158 int result = KMessageBox::warningContinueCancel(this,
4122 i18n("The journal entries can not be\nexported to a vCalendar file."), 4159 i18n("The journal entries can not be\nexported to a vCalendar file."),
4123 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 4160 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
4124 true); 4161 true);
4125 if (result != KMessageBox::Continue) return false; 4162 if (result != KMessageBox::Continue) return false;
4126 } 4163 }
4127 4164
4128 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 4165 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
4129 4166
4130 // Force correct extension 4167 // Force correct extension
4131 if (filename.right(4) != ".vcs") filename += ".vcs"; 4168 if (filename.right(4) != ".vcs") filename += ".vcs";
4132 4169
4133 FileStorage storage( mCalendar, filename, new VCalFormat ); 4170 FileStorage storage( mCalendar, filename, new VCalFormat );
4134 return storage.save(); 4171 return storage.save();
4135 4172
4136} 4173}
4137 4174
4138void CalendarView::eventUpdated(Incidence *) 4175void CalendarView::eventUpdated(Incidence *)
4139{ 4176{
4140 setModified(); 4177 setModified();
4141 // Don't call updateView here. The code, which has caused the update of the 4178 // Don't call updateView here. The code, which has caused the update of the
4142 // event is responsible for updating the view. 4179 // event is responsible for updating the view.
4143 // updateView(); 4180 // updateView();
4144} 4181}
4145 4182
4146void CalendarView::adaptNavigationUnits() 4183void CalendarView::adaptNavigationUnits()
4147{ 4184{
4148 if (mViewManager->currentView()->isEventView()) { 4185 if (mViewManager->currentView()->isEventView()) {
4149 int days = mViewManager->currentView()->currentDateCount(); 4186 int days = mViewManager->currentView()->currentDateCount();
4150 if (days == 1) { 4187 if (days == 1) {
4151 emit changeNavStringPrev(i18n("&Previous Day")); 4188 emit changeNavStringPrev(i18n("&Previous Day"));
4152 emit changeNavStringNext(i18n("&Next Day")); 4189 emit changeNavStringNext(i18n("&Next Day"));
4153 } else { 4190 } else {
4154 emit changeNavStringPrev(i18n("&Previous Week")); 4191 emit changeNavStringPrev(i18n("&Previous Week"));
4155 emit changeNavStringNext(i18n("&Next Week")); 4192 emit changeNavStringNext(i18n("&Next Week"));
4156 } 4193 }
4157 } 4194 }
4158} 4195}
4159 4196
4160void CalendarView::processMainViewSelection( Incidence *incidence ) 4197void CalendarView::processMainViewSelection( Incidence *incidence )
4161{ 4198{
4162 if ( incidence ) mTodoList->clearSelection(); 4199 if ( incidence ) mTodoList->clearSelection();
4163 processIncidenceSelection( incidence ); 4200 processIncidenceSelection( incidence );
4164} 4201}
4165 4202
4166void CalendarView::processTodoListSelection( Incidence *incidence ) 4203void CalendarView::processTodoListSelection( Incidence *incidence )
4167{ 4204{
4168 if ( incidence && mViewManager->currentView() ) { 4205 if ( incidence && mViewManager->currentView() ) {
4169 mViewManager->currentView()->clearSelection(); 4206 mViewManager->currentView()->clearSelection();
4170 } 4207 }
4171 processIncidenceSelection( incidence ); 4208 processIncidenceSelection( incidence );
4172} 4209}
4173 4210
4174void CalendarView::processIncidenceSelection( Incidence *incidence ) 4211void CalendarView::processIncidenceSelection( Incidence *incidence )
4175{ 4212{
4176 emit incidenceSelected( incidence ); 4213 emit incidenceSelected( incidence );
4177 if ( incidence == mSelectedIncidence ) return; 4214 if ( incidence == mSelectedIncidence ) return;
4178 mSelectedIncidence = incidence; 4215 mSelectedIncidence = incidence;
4179 4216
4180 if ( incidence && incidence->typeID() == eventID ) { 4217 if ( incidence && incidence->typeID() == eventID ) {
4181 Event *event = static_cast<Event *>( incidence ); 4218 Event *event = static_cast<Event *>( incidence );
4182 if ( event->organizer() == KOPrefs::instance()->email() ) { 4219 if ( event->organizer() == KOPrefs::instance()->email() ) {
4183 emit organizerEventsSelected( true ); 4220 emit organizerEventsSelected( true );
4184 } else { 4221 } else {
4185 emit organizerEventsSelected(false); 4222 emit organizerEventsSelected(false);
4186 } 4223 }
4187 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 4224 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
4188 KOPrefs::instance()->email() ) ) { 4225 KOPrefs::instance()->email() ) ) {
4189 emit groupEventsSelected( true ); 4226 emit groupEventsSelected( true );
4190 } else { 4227 } else {
4191 emit groupEventsSelected(false); 4228 emit groupEventsSelected(false);
4192 } 4229 }
4193 return; 4230 return;
4194 } else { 4231 } else {
4195 if ( incidence && incidence->typeID() == todoID ) { 4232 if ( incidence && incidence->typeID() == todoID ) {
4196 emit todoSelected( true ); 4233 emit todoSelected( true );
4197 Todo *event = static_cast<Todo *>( incidence ); 4234 Todo *event = static_cast<Todo *>( incidence );
4198 if ( event->organizer() == KOPrefs::instance()->email() ) { 4235 if ( event->organizer() == KOPrefs::instance()->email() ) {
4199 emit organizerEventsSelected( true ); 4236 emit organizerEventsSelected( true );
4200 } else { 4237 } else {
4201 emit organizerEventsSelected(false); 4238 emit organizerEventsSelected(false);
4202 } 4239 }
4203 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 4240 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
4204 KOPrefs::instance()->email() ) ) { 4241 KOPrefs::instance()->email() ) ) {
4205 emit groupEventsSelected( true ); 4242 emit groupEventsSelected( true );
4206 } else { 4243 } else {
4207 emit groupEventsSelected(false); 4244 emit groupEventsSelected(false);
4208 } 4245 }
4209 return; 4246 return;
4210 } else { 4247 } else {
4211 emit todoSelected( false ); 4248 emit todoSelected( false );
4212 emit organizerEventsSelected(false); 4249 emit organizerEventsSelected(false);
4213 emit groupEventsSelected(false); 4250 emit groupEventsSelected(false);
4214 } 4251 }
4215 return; 4252 return;
4216 } 4253 }
4217 4254
4218 /* if ( incidence && incidence->typeID() == todoID ) { 4255 /* if ( incidence && incidence->typeID() == todoID ) {
4219 emit todoSelected( true ); 4256 emit todoSelected( true );
4220 } else { 4257 } else {
4221 emit todoSelected( false ); 4258 emit todoSelected( false );
4222 }*/ 4259 }*/
4223} 4260}
4224 4261
4225 4262
4226void CalendarView::checkClipboard() 4263void CalendarView::checkClipboard()
4227{ 4264{
4228#ifndef KORG_NODND 4265#ifndef KORG_NODND
4229 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 4266 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
4230 emit pasteEnabled(true); 4267 emit pasteEnabled(true);
4231 } else { 4268 } else {
4232 emit pasteEnabled(false); 4269 emit pasteEnabled(false);
4233 } 4270 }
4234#endif 4271#endif
4235} 4272}
4236 4273
4237void CalendarView::showDates(const DateList &selectedDates) 4274void CalendarView::showDates(const DateList &selectedDates)
4238{ 4275{
4239 // kdDebug() << "CalendarView::selectDates()" << endl; 4276 // kdDebug() << "CalendarView::selectDates()" << endl;
4240 4277
4241 4278
4242 if ( !mBlockShowDates ) { 4279 if ( !mBlockShowDates ) {
4243 if ( mViewManager->currentView() ) { 4280 if ( mViewManager->currentView() ) {
4244 updateView( selectedDates.first(), selectedDates.last() ); 4281 updateView( selectedDates.first(), selectedDates.last() );
4245 } else { 4282 } else {
4246 mViewManager->showAgendaView(); 4283 mViewManager->showAgendaView();
4247 } 4284 }
4248 } 4285 }
4249 4286
4250 QDate date = selectedDates.first(); 4287 QDate date = selectedDates.first();
4251 if ( ! date.isValid() ) { 4288 if ( ! date.isValid() ) {
4252 topLevelWidget()->setCaption(""); 4289 topLevelWidget()->setCaption("");
4253 return; 4290 return;
4254 } 4291 }
4255 4292
4256 QString selDates; 4293 QString selDates;
4257 selDates = KGlobal::locale()->formatDate( date, true); 4294 selDates = KGlobal::locale()->formatDate( date, true);
4258 if (selectedDates.first() < selectedDates.last() ) 4295 if (selectedDates.first() < selectedDates.last() )
4259 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 4296 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
4260 else { 4297 else {
4261 QString addString; 4298 QString addString;
4262 if ( date == QDateTime::currentDateTime().date() ) 4299 if ( date == QDateTime::currentDateTime().date() )
4263 addString = i18n("Today"); 4300 addString = i18n("Today");
4264 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 4301 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
4265 addString = i18n("Tomorrow"); 4302 addString = i18n("Tomorrow");
4266 else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) 4303 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
4267 addString = i18n("Yesterday"); 4304 addString = i18n("Yesterday");
4268 else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) 4305 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
4269 addString = i18n("Day before yesterday"); 4306 addString = i18n("Day before yesterday");
4270 else if ( date == QDateTime::currentDateTime().date().addDays(2) ) 4307 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
4271 addString = i18n("Day after tomorrow"); 4308 addString = i18n("Day after tomorrow");
4272 if ( !addString.isEmpty() ) { 4309 if ( !addString.isEmpty() ) {
4273 topLevelWidget()->setCaption( addString+", " + selDates ); 4310 topLevelWidget()->setCaption( addString+", " + selDates );
4274 return; 4311 return;
4275 } 4312 }
4276 } 4313 }
4277 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 4314 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
4278 4315
4279} 4316}
4280 4317
4281QPtrList<CalFilter> CalendarView::filters() 4318QPtrList<CalFilter> CalendarView::filters()
4282{ 4319{
4283 return mFilters; 4320 return mFilters;
4284 4321
4285} 4322}
4286void CalendarView::editFilters() 4323void CalendarView::editFilters()
4287{ 4324{
4288 // kdDebug() << "CalendarView::editFilters()" << endl; 4325 // kdDebug() << "CalendarView::editFilters()" << endl;
4289 4326
4290 CalFilter *filter = mFilters.first(); 4327 CalFilter *filter = mFilters.first();
4291 while(filter) { 4328 while(filter) {
4292 filter = mFilters.next(); 4329 filter = mFilters.next();
4293 } 4330 }
4294 4331
4295 mDialogManager->showFilterEditDialog(&mFilters); 4332 mDialogManager->showFilterEditDialog(&mFilters);
4296 updateFilter(); 4333 updateFilter();
4297} 4334}
4298void CalendarView::toggleFilter() 4335void CalendarView::toggleFilter()
4299{ 4336{
4300 if ( mLeftFrame->isHidden() ) { 4337 if ( mLeftFrame->isHidden() ) {
4301 toggleExpand(); 4338 toggleExpand();
4302 showFilter( true ); 4339 showFilter( true );
4303 } else 4340 } else
4304 showFilter(! mCalEditView->isVisible()); 4341 showFilter(! mCalEditView->isVisible());
4305} 4342}
4306 4343
4307KOFilterView *CalendarView::filterView() 4344KOFilterView *CalendarView::filterView()
4308{ 4345{
4309 return mFilterView; 4346 return mFilterView;
4310} 4347}
4311void CalendarView::selectFilter( int fil ) 4348void CalendarView::selectFilter( int fil )
4312{ 4349{
4313 mFilterView->setSelectedFilter( fil ); 4350 mFilterView->setSelectedFilter( fil );
4314 updateUnmanagedViews(); 4351 updateUnmanagedViews();
4315} 4352}
4316void CalendarView::showFilter(bool visible) 4353void CalendarView::showFilter(bool visible)
4317{ 4354{
4318#if 1 4355#if 1
4319 if (visible) { 4356 if (visible) {
4320 mCalEditView->readConfig(); 4357 mCalEditView->readConfig();
4321 mCalEditView->show(); 4358 mCalEditView->show();
4322 QValueList<int> sizes; 4359 QValueList<int> sizes;
4323 sizes = mLeftFrame->sizes(); 4360 sizes = mLeftFrame->sizes();
4324 if ( sizes.count() == 4 && sizes[3] < 20 ) { 4361 if ( sizes.count() == 4 && sizes[3] < 20 ) {
4325 sizes.clear(); 4362 sizes.clear();
4326 sizes << 100; 4363 sizes << 100;
4327 sizes << 0; 4364 sizes << 0;
4328 sizes << 0; 4365 sizes << 0;
4329 sizes << 100; 4366 sizes << 100;
4330 mLeftFrame->setSizes(sizes); 4367 mLeftFrame->setSizes(sizes);
4331 } 4368 }
4332#if 0 4369#if 0
4333 sizes = mLeftFrame->sizes(); 4370 sizes = mLeftFrame->sizes();
4334 int ccc = 0; 4371 int ccc = 0;
4335 while ( ccc < sizes.count()) { 4372 while ( ccc < sizes.count()) {
4336 qDebug("size %d %d ", ccc, sizes[ccc]); 4373 qDebug("size %d %d ", ccc, sizes[ccc]);
4337 ++ccc; 4374 ++ccc;
4338 } 4375 }
4339#endif 4376#endif
4340 4377
4341 } 4378 }
4342 else { 4379 else {
4343 mCalEditView->hide(); 4380 mCalEditView->hide();
4344 } 4381 }
4345#else 4382#else
4346 if (visible) mFilterView->show(); 4383 if (visible) mFilterView->show();
4347 else mFilterView->hide(); 4384 else mFilterView->hide();
4348#endif 4385#endif
4349} 4386}
4350void CalendarView::toggleFilerEnabled( ) 4387void CalendarView::toggleFilerEnabled( )
4351{ 4388{
4352 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 4389 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
4353 if ( !mFilterView->filtersEnabled() ) 4390 if ( !mFilterView->filtersEnabled() )
4354 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 4391 topLevelWidget()->setCaption( i18n("Filter disabled ") );
4355 updateUnmanagedViews(); 4392 updateUnmanagedViews();
4356 4393
4357} 4394}
4358void CalendarView::updateFilter() 4395void CalendarView::updateFilter()
4359{ 4396{
4360 CalFilter *filter = mFilterView->selectedFilter(); 4397 CalFilter *filter = mFilterView->selectedFilter();
4361 if (filter) { 4398 if (filter) {
4362 QString mess; 4399 QString mess;
4363 if (mFilterView->filtersEnabled()) { 4400 if (mFilterView->filtersEnabled()) {
4364 mess = i18n("Filter selected: ")+filter->name(); 4401 mess = i18n("Filter selected: ")+filter->name();
4365 filter->setEnabled(true); 4402 filter->setEnabled(true);
4366 } 4403 }
4367 else filter->setEnabled(false); 4404 else filter->setEnabled(false);
4368 mCalendar->setFilter(filter); 4405 mCalendar->setFilter(filter);
4369 updateView(); 4406 updateView();
4370 if ( !mess.isEmpty() ) 4407 if ( !mess.isEmpty() )
4371 topLevelWidget()->setCaption( mess ); 4408 topLevelWidget()->setCaption( mess );
4372 4409
4373 } 4410 }
4374 emit filtersUpdated(); 4411 emit filtersUpdated();
4375} 4412}
4376 4413
4377void CalendarView::filterEdited() 4414void CalendarView::filterEdited()
4378{ 4415{
4379 mFilterView->updateFilters(); 4416 mFilterView->updateFilters();
4380 updateFilter(); 4417 updateFilter();
4381 writeSettings(); 4418 writeSettings();
4382} 4419}
4383 4420
4384 4421
4385void CalendarView::takeOverEvent() 4422void CalendarView::takeOverEvent()
4386{ 4423{
4387 Incidence *incidence = currentSelection(); 4424 Incidence *incidence = currentSelection();
4388 4425
4389 if (!incidence) return; 4426 if (!incidence) return;
4390 4427
4391 incidence->setOrganizer(KOPrefs::instance()->email()); 4428 incidence->setOrganizer(KOPrefs::instance()->email());
4392 incidence->recreate(); 4429 incidence->recreate();
4393 incidence->setReadOnly(false); 4430 incidence->setReadOnly(false);
4394 4431
4395 updateView(); 4432 updateView();
4396} 4433}
4397 4434
4398void CalendarView::takeOverCalendar() 4435void CalendarView::takeOverCalendar()
4399{ 4436{
4400 // TODO: Create Calendar::allIncidences() function and use it here 4437 // TODO: Create Calendar::allIncidences() function and use it here
4401 4438
4402 clearAllViews(); 4439 clearAllViews();
4403 QPtrList<Event> events = mCalendar->events(); 4440 QPtrList<Event> events = mCalendar->events();
4404 for(uint i=0; i<events.count(); ++i) { 4441 for(uint i=0; i<events.count(); ++i) {
4405 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 4442 events.at(i)->setOrganizer(KOPrefs::instance()->email());
4406 events.at(i)->recreate(); 4443 events.at(i)->recreate();
4407 events.at(i)->setReadOnly(false); 4444 events.at(i)->setReadOnly(false);
4408 } 4445 }
4409 4446
4410 QPtrList<Todo> todos = mCalendar->todos(); 4447 QPtrList<Todo> todos = mCalendar->todos();
4411 for(uint i=0; i<todos.count(); ++i) { 4448 for(uint i=0; i<todos.count(); ++i) {
4412 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 4449 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
4413 todos.at(i)->recreate(); 4450 todos.at(i)->recreate();
4414 todos.at(i)->setReadOnly(false); 4451 todos.at(i)->setReadOnly(false);
4415 } 4452 }
4416 4453
4417 QPtrList<Journal> journals = mCalendar->journals(); 4454 QPtrList<Journal> journals = mCalendar->journals();
4418 for(uint i=0; i<journals.count(); ++i) { 4455 for(uint i=0; i<journals.count(); ++i) {
4419 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 4456 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
4420 journals.at(i)->recreate(); 4457 journals.at(i)->recreate();
4421 journals.at(i)->setReadOnly(false); 4458 journals.at(i)->setReadOnly(false);
4422 } 4459 }
4423 4460
4424 updateView(); 4461 updateView();
4425} 4462}
4426 4463
4427void CalendarView::showIntro() 4464void CalendarView::showIntro()
4428{ 4465{
4429 kdDebug() << "To be implemented." << endl; 4466 kdDebug() << "To be implemented." << endl;
4430} 4467}
4431 4468
4432QWidgetStack *CalendarView::viewStack() 4469QWidgetStack *CalendarView::viewStack()
4433{ 4470{
4434 return mRightFrame; 4471 return mRightFrame;
4435} 4472}
4436 4473
4437QWidget *CalendarView::leftFrame() 4474QWidget *CalendarView::leftFrame()
4438{ 4475{
4439 return ( QWidget *)mLeftFrame; 4476 return ( QWidget *)mLeftFrame;
4440} 4477}
4441 4478
4442DateNavigator *CalendarView::dateNavigator() 4479DateNavigator *CalendarView::dateNavigator()
4443{ 4480{
4444 return mNavigator; 4481 return mNavigator;
4445} 4482}
4446 4483
4447KDateNavigator* CalendarView::dateNavigatorWidget() 4484KDateNavigator* CalendarView::dateNavigatorWidget()
4448{ 4485{
4449 return mDateNavigator->navigatorView(); 4486 return mDateNavigator->navigatorView();
4450} 4487}
4451void CalendarView::toggleDateNavigatorWidget() 4488void CalendarView::toggleDateNavigatorWidget()
4452{ 4489{
4453 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; 4490 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
4454 4491
4455 if (!KOPrefs::instance()->mShowDateNavigator ) 4492 if (!KOPrefs::instance()->mShowDateNavigator )
4456 mDateNavigator->hide(); 4493 mDateNavigator->hide();
4457 else 4494 else
4458 mDateNavigator->show(); 4495 mDateNavigator->show();
4459} 4496}
4460void CalendarView::addView(KOrg::BaseView *view) 4497void CalendarView::addView(KOrg::BaseView *view)
4461{ 4498{
4462 mViewManager->addView(view); 4499 mViewManager->addView(view);
4463} 4500}
4464 4501
4465void CalendarView::showView(KOrg::BaseView *view) 4502void CalendarView::showView(KOrg::BaseView *view)
4466{ 4503{
4467 mViewManager->showView(view, mLeftFrame->isVisible()); 4504 mViewManager->showView(view, mLeftFrame->isVisible());
4468} 4505}
4469 4506
4470Incidence *CalendarView::currentSelection() 4507Incidence *CalendarView::currentSelection()
4471{ 4508{
4472 return mViewManager->currentSelection(); 4509 return mViewManager->currentSelection();
4473} 4510}
4474void CalendarView::toggleAllDaySize() 4511void CalendarView::toggleAllDaySize()
4475{ 4512{
4476 /* 4513 /*
4477 if ( KOPrefs::instance()->mAllDaySize > 47 ) 4514 if ( KOPrefs::instance()->mAllDaySize > 47 )
4478 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 4515 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
4479 else 4516 else
4480 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 4517 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
4481 */ 4518 */
4482 viewManager()->agendaView()->toggleAllDay(); 4519 viewManager()->agendaView()->toggleAllDay();
4483} 4520}
4484void CalendarView::toggleExpand() 4521void CalendarView::toggleExpand()
4485{ 4522{
4486 // if ( mLeftFrame->isHidden() ) { 4523 // if ( mLeftFrame->isHidden() ) {
4487 // mLeftFrame->show(); 4524 // mLeftFrame->show();
4488 // emit calendarViewExpanded( false ); 4525 // emit calendarViewExpanded( false );
4489 // } else { 4526 // } else {
4490 // mLeftFrame->hide(); 4527 // mLeftFrame->hide();
4491 // emit calendarViewExpanded( true ); 4528 // emit calendarViewExpanded( true );
4492 // } 4529 // }
4493 //qDebug(" CalendarView::toggleExpand()"); 4530 //qDebug(" CalendarView::toggleExpand()");
4494 globalFlagBlockAgenda = 1; 4531 globalFlagBlockAgenda = 1;
4495 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 4532 emit calendarViewExpanded( !mLeftFrame->isHidden() );
4496 globalFlagBlockAgenda = 5; 4533 globalFlagBlockAgenda = 5;
4497 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 4534 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
4498 //mViewManager->showView( 0, true ); 4535 //mViewManager->showView( 0, true );
4499} 4536}
4500 4537
4501void CalendarView::calendarModified( bool modified, Calendar * ) 4538void CalendarView::calendarModified( bool modified, Calendar * )
4502{ 4539{
4503 setModified( modified ); 4540 setModified( modified );
4504} 4541}
4505 4542
4506Todo *CalendarView::selectedTodo() 4543Todo *CalendarView::selectedTodo()
4507{ 4544{
4508 Incidence *incidence = currentSelection(); 4545 Incidence *incidence = currentSelection();
4509 if ( incidence && incidence->typeID() == todoID ) { 4546 if ( incidence && incidence->typeID() == todoID ) {
4510 return static_cast<Todo *>( incidence ); 4547 return static_cast<Todo *>( incidence );
4511 } 4548 }
4512 4549
4513 incidence = mTodoList->selectedIncidences().first(); 4550 incidence = mTodoList->selectedIncidences().first();
4514 if ( incidence && incidence->typeID() == todoID ) { 4551 if ( incidence && incidence->typeID() == todoID ) {
4515 return static_cast<Todo *>( incidence ); 4552 return static_cast<Todo *>( incidence );
4516 } 4553 }
4517 4554
4518 return 0; 4555 return 0;
4519} 4556}
4520 4557
4521void CalendarView::showIncidence() 4558void CalendarView::showIncidence()
4522{ 4559{
4523 mViewerCallerIsSearchDialog = false; 4560 mViewerCallerIsSearchDialog = false;
4524 Incidence *incidence = currentSelection(); 4561 Incidence *incidence = currentSelection();
4525 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4562 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4526 if ( incidence ) { 4563 if ( incidence ) {
4527 ShowIncidenceVisitor v; 4564 ShowIncidenceVisitor v;
4528 v.act( incidence, this ); 4565 v.act( incidence, this );
4529 } 4566 }
4530} 4567}
4531void CalendarView::editIncidenceDescription() 4568void CalendarView::editIncidenceDescription()
4532{ 4569{
4533 mFlagEditDescription = true; 4570 mFlagEditDescription = true;
4534 editIncidence(); 4571 editIncidence();
4535 mFlagEditDescription = false; 4572 mFlagEditDescription = false;
4536} 4573}
4537void CalendarView::editIncidence() 4574void CalendarView::editIncidence()
4538{ 4575{
4539 // qDebug("editIncidence() "); 4576 // qDebug("editIncidence() ");
4540 Incidence *incidence = currentSelection(); 4577 Incidence *incidence = currentSelection();
4541 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4578 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4542 if ( incidence ) { 4579 if ( incidence ) {
4543 EditIncidenceVisitor v; 4580 EditIncidenceVisitor v;
4544 v.act( incidence, this ); 4581 v.act( incidence, this );
4545 } 4582 }
4546} 4583}
4547 4584
4548void CalendarView::deleteIncidence() 4585void CalendarView::deleteIncidence()
4549{ 4586{
4550 Incidence *incidence = currentSelection(); 4587 Incidence *incidence = currentSelection();
4551 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4588 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4552 if ( incidence ) { 4589 if ( incidence ) {
4553 deleteIncidence(incidence); 4590 deleteIncidence(incidence);
4554 } 4591 }
4555} 4592}
4556void CalendarView::showIncidence(QString uid) 4593void CalendarView::showIncidence(QString uid)
4557{ 4594{
4558 Incidence *inc = mCalendar->incidence( uid ); 4595 Incidence *inc = mCalendar->incidence( uid );
4559 if ( inc ) 4596 if ( inc )
4560 showIncidence( inc ); 4597 showIncidence( inc );
4561} 4598}
4562void CalendarView::showIncidence(Incidence *incidence) 4599void CalendarView::showIncidence(Incidence *incidence)
4563{ 4600{
4564 mViewerCallerIsSearchDialog = false; 4601 mViewerCallerIsSearchDialog = false;
4565 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); 4602 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() );
4566 if ( sender() && mDialogManager->getSearchDialog() ) { 4603 if ( sender() && mDialogManager->getSearchDialog() ) {
4567 if ( sender () == mDialogManager->getSearchDialog()->listview() ) { 4604 if ( sender () == mDialogManager->getSearchDialog()->listview() ) {
4568 mViewerCallerIsSearchDialog = true; 4605 mViewerCallerIsSearchDialog = true;
4569 } 4606 }
4570 } 4607 }
4571 if ( incidence ) { 4608 if ( incidence ) {
4572 ShowIncidenceVisitor v; 4609 ShowIncidenceVisitor v;
4573 v.act( incidence, this ); 4610 v.act( incidence, this );
4574 } 4611 }
4575} 4612}
4576 4613
4577void CalendarView::editIncidence(Incidence *incidence) 4614void CalendarView::editIncidence(Incidence *incidence)
4578{ 4615{
4579 if ( incidence ) { 4616 if ( incidence ) {
4580 4617
4581 EditIncidenceVisitor v; 4618 EditIncidenceVisitor v;
4582 v.act( incidence, this ); 4619 v.act( incidence, this );
4583 4620
4584 } 4621 }
4585} 4622}
4586 4623
4587void CalendarView::deleteIncidence(Incidence *incidence) 4624void CalendarView::deleteIncidence(Incidence *incidence)
4588{ 4625{
4589 //qDebug(" CalendarView::deleteIncidence "); 4626 //qDebug(" CalendarView::deleteIncidence ");
4590 if ( incidence == 0 ) { 4627 if ( incidence == 0 ) {
4591 updateView(); 4628 updateView();
4592 emit updateSearchDialog(); 4629 emit updateSearchDialog();
4593 return; 4630 return;
4594 } 4631 }
4595 if ( incidence ) { 4632 if ( incidence ) {
4596 DeleteIncidenceVisitor v; 4633 DeleteIncidenceVisitor v;
4597 v.act( incidence, this ); 4634 v.act( incidence, this );
4598 } 4635 }
4599} 4636}
4600 4637
4601 4638
4602void CalendarView::lookForOutgoingMessages() 4639void CalendarView::lookForOutgoingMessages()
4603{ 4640{
4604 OutgoingDialog *ogd = mDialogManager->outgoingDialog(); 4641 OutgoingDialog *ogd = mDialogManager->outgoingDialog();
4605 ogd->loadMessages(); 4642 ogd->loadMessages();
4606} 4643}
4607 4644
4608void CalendarView::lookForIncomingMessages() 4645void CalendarView::lookForIncomingMessages()
4609{ 4646{
4610 IncomingDialog *icd = mDialogManager->incomingDialog(); 4647 IncomingDialog *icd = mDialogManager->incomingDialog();
4611 icd->retrieve(); 4648 icd->retrieve();
4612} 4649}
4613 4650
4614bool CalendarView::removeCompletedSubTodos( Todo* t ) 4651bool CalendarView::removeCompletedSubTodos( Todo* t )
4615{ 4652{
4616 bool deleteTodo = true; 4653 bool deleteTodo = true;
4617 QPtrList<Incidence> subTodos; 4654 QPtrList<Incidence> subTodos;
4618 Incidence *aTodo; 4655 Incidence *aTodo;
4619 subTodos = t->relations(); 4656 subTodos = t->relations();
4620 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 4657 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
4621 if (! removeCompletedSubTodos( (Todo*) aTodo )) 4658 if (! removeCompletedSubTodos( (Todo*) aTodo ))
4622 deleteTodo = false; 4659 deleteTodo = false;
4623 } 4660 }
4624 if ( deleteTodo ) { 4661 if ( deleteTodo ) {
4625 if ( t->isCompleted() && !t->doesRecur()) { 4662 if ( t->isCompleted() && !t->doesRecur()) {
4626 checkExternalId( t ); 4663 checkExternalId( t );
4627 mCalendar->deleteTodo( t ); 4664 mCalendar->deleteTodo( t );
4628 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 4665 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
4629 } 4666 }
4630 else 4667 else
4631 deleteTodo = false; 4668 deleteTodo = false;
4632 } 4669 }
4633 return deleteTodo; 4670 return deleteTodo;
4634 4671
4635} 4672}
4636void CalendarView::purgeCompleted() 4673void CalendarView::purgeCompleted()
4637{ 4674{
4638 int result = KMessageBox::warningContinueCancel(this, 4675 int result = KMessageBox::warningContinueCancel(this,
4639 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); 4676 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge"));
4640 4677
4641 if (result == KMessageBox::Continue) { 4678 if (result == KMessageBox::Continue) {
4642 4679
4643 QPtrList<Todo> todoCal; 4680 QPtrList<Todo> todoCal;
4644 QPtrList<Todo> rootTodos; 4681 QPtrList<Todo> rootTodos;
4645 //QPtrList<Incidence> rel; 4682 //QPtrList<Incidence> rel;
4646 Todo *aTodo; 4683 Todo *aTodo;
4647 todoCal = calendar()->todos(); 4684 todoCal = calendar()->todos();
4648 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { 4685 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
4649 if ( !aTodo->relatedTo() ) 4686 if ( !aTodo->relatedTo() )
4650 rootTodos.append( aTodo ); 4687 rootTodos.append( aTodo );
4651 } 4688 }
4652 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { 4689 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
4653 removeCompletedSubTodos( aTodo ); 4690 removeCompletedSubTodos( aTodo );
4654 } 4691 }
4655 4692
4656 updateView(); 4693 updateView();
4657 } 4694 }
4658} 4695}
4659 4696
4660void CalendarView::slotCalendarChanged() 4697void CalendarView::slotCalendarChanged()
4661{ 4698{
4662 ; 4699 ;
4663} 4700}
4664 4701
4665void CalendarView::keyPressEvent ( QKeyEvent *e) 4702void CalendarView::keyPressEvent ( QKeyEvent *e)
4666{ 4703{
4667 //qDebug(" alendarView::keyPressEvent "); 4704 //qDebug(" alendarView::keyPressEvent ");
4668 e->ignore(); 4705 e->ignore();
4669} 4706}
4670 4707
4671 4708
4672bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) 4709bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
4673{ 4710{
4674 4711
4675 if ( manager != mSyncManager) 4712 if ( manager != mSyncManager)
4676 qDebug("KO: Internal error-1. SyncManager mismatch "); 4713 qDebug("KO: Internal error-1. SyncManager mismatch ");
4677 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { 4714 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
4678 qDebug("KO: SyncKDE request detected!"); 4715 qDebug("KO: SyncKDE request detected!");
4679 } 4716 }
4680 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 4717 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
4681 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 4718 mCurrentSyncName = mSyncManager->getCurrentSyncName();
4682 return syncCalendar( filename, mode ); 4719 return syncCalendar( filename, mode );
4683} 4720}
4684bool CalendarView::syncExternal(KSyncManager* manager, QString resource) 4721bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
4685{ 4722{
4686 //mSyncManager = manager; 4723 //mSyncManager = manager;
4687 if ( manager != mSyncManager) 4724 if ( manager != mSyncManager)
4688 qDebug("KO: Internal error-2. SyncManager mismatch "); 4725 qDebug("KO: Internal error-2. SyncManager mismatch ");
4689 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 4726 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
4690 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 4727 mCurrentSyncName = mSyncManager->getCurrentSyncName();
4691 if ( resource == "sharp" ) 4728 if ( resource == "sharp" )
4692 syncExternal( 0 ); 4729 syncExternal( 0 );
4693 if ( resource == "phone" ) 4730 if ( resource == "phone" )
4694 syncExternal( 1 ); 4731 syncExternal( 1 );
4695 // pending setmodified 4732 // pending setmodified
4696 return true; 4733 return true;
4697} 4734}
4698void CalendarView::setSyncManager(KSyncManager* manager) 4735void CalendarView::setSyncManager(KSyncManager* manager)
4699{ 4736{
4700 mSyncManager = manager; 4737 mSyncManager = manager;
4701} 4738}
4702 4739
4703void CalendarView::removeSyncInfo( QString syncProfile) 4740void CalendarView::removeSyncInfo( QString syncProfile)
4704{ 4741{
4705 qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); 4742 qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1());
4706 mCalendar->removeSyncInfo( syncProfile ); 4743 mCalendar->removeSyncInfo( syncProfile );
4707 4744
4708} 4745}
4709 4746
4710void CalendarView::undo_delete() 4747void CalendarView::undo_delete()
4711{ 4748{
4712 //qDebug("undo_delete() "); 4749 //qDebug("undo_delete() ");
4713 Incidence* undo = mCalendar->undoIncidence(); 4750 Incidence* undo = mCalendar->undoIncidence();
4714 if ( !undo ) { 4751 if ( !undo ) {
4715 KMessageBox::sorry(this,i18n("There is nothing to undo!"), 4752 KMessageBox::sorry(this,i18n("There is nothing to undo!"),
4716 i18n("KO/Pi")); 4753 i18n("KO/Pi"));
4717 return; 4754 return;
4718 } 4755 }
4719 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) + 4756 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) +
4720 i18n("\nAre you sure you want\nto restore this?"), 4757 i18n("\nAre you sure you want\nto restore this?"),
4721 i18n("KO/Pi Confirmation"),i18n("Restore"))) { 4758 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
4722 mCalendar->undoDeleteIncidence(); 4759 mCalendar->undoDeleteIncidence();
4723 updateView(); 4760 updateView();
4724 } 4761 }
4725} 4762}
4726 4763
4727void CalendarView::slotViewerClosed() 4764void CalendarView::slotViewerClosed()
4728{ 4765{
4729 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); 4766 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
4730} 4767}
4731 4768
4732void CalendarView::resetFocus() 4769void CalendarView::resetFocus()
4733{ 4770{
4734 if ( mViewerCallerIsSearchDialog ) { 4771 if ( mViewerCallerIsSearchDialog ) {
4735 if ( mDialogManager->getSearchDialog()->isVisible() ){ 4772 if ( mDialogManager->getSearchDialog()->isVisible() ){
4736 mDialogManager->getSearchDialog()->raise(); 4773 mDialogManager->getSearchDialog()->raise();
4737 mDialogManager->getSearchDialog()->setActiveWindow(); 4774 mDialogManager->getSearchDialog()->setActiveWindow();
4738 mDialogManager->getSearchDialog()->listview()->resetFocus(); 4775 mDialogManager->getSearchDialog()->listview()->resetFocus();
4739 } else 4776 } else
4740 mViewerCallerIsSearchDialog = false; 4777 mViewerCallerIsSearchDialog = false;
4741 } 4778 }
4742 if ( !mViewerCallerIsSearchDialog ) { 4779 if ( !mViewerCallerIsSearchDialog ) {
4743 //mViewManager->currentView()->setFocus(); 4780 //mViewManager->currentView()->setFocus();
4744 //qDebug("sssssssssssssssset focus "); 4781 //qDebug("sssssssssssssssset focus ");
4745 topLevelWidget()->raise(); 4782 topLevelWidget()->raise();
4746 setActiveWindow(); 4783 setActiveWindow();
4747 //setFocus(); 4784 //setFocus();
4748 } 4785 }
4749 mViewerCallerIsSearchDialog = false; 4786 mViewerCallerIsSearchDialog = false;
4750} 4787}
4751 4788
4752void CalendarView::showNextAlarms() 4789void CalendarView::showNextAlarms()
4753{ 4790{
4754 QString message; 4791 QString message;
4755 QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); 4792 QDateTime nextAl = mCalendar->nextAlarmEventDateTime();
4756 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { 4793 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) {
4757 QString sum = mCalendar->nextSummary(); 4794 QString sum = mCalendar->nextSummary();
4758 QDateTime nextA = mNextAlarmDateTime; 4795 QDateTime nextA = mNextAlarmDateTime;
4759 QDateTime cur = QDateTime::currentDateTime(); 4796 QDateTime cur = QDateTime::currentDateTime();
4760 int secs = cur.secsTo( nextA ); 4797 int secs = cur.secsTo( nextA );
4761 int min = secs /60; 4798 int min = secs /60;
4762 int hours = min /60; 4799 int hours = min /60;
4763 min = min % 60; 4800 min = min % 60;
4764 int days = hours /24; 4801 int days = hours /24;
4765 hours = hours % 24; 4802 hours = hours % 24;
4766 4803
4767 //message = i18n("The next alarm is in:\n"); 4804 //message = i18n("The next alarm is in:\n");
4768 if ( days > 1 ) 4805 if ( days > 1 )
4769 message += i18n("%1 days\n").arg( days ); 4806 message += i18n("%1 days\n").arg( days );
4770 else if ( days == 1 ) 4807 else if ( days == 1 )
4771 message += i18n("1 day\n"); 4808 message += i18n("1 day\n");
4772 if ( hours > 1 ) 4809 if ( hours > 1 )
4773 message += i18n("%1 hours\n").arg( hours ); 4810 message += i18n("%1 hours\n").arg( hours );
4774 else if ( hours == 1 ) 4811 else if ( hours == 1 )
4775 message += i18n("1 hour\n"); 4812 message += i18n("1 hour\n");
4776 if ( min > 1 ) 4813 if ( min > 1 )
4777 message += i18n("%1 minutes\n").arg( min ); 4814 message += i18n("%1 minutes\n").arg( min );
4778 else if ( min == 1 ) 4815 else if ( min == 1 )
4779 message += i18n("1 minute\n"); 4816 message += i18n("1 minute\n");
4780 if ( message.isEmpty() ) 4817 if ( message.isEmpty() )
4781 message = i18n("The next alarm is in\nless than one minute!"); 4818 message = i18n("The next alarm is in\nless than one minute!");
4782 else 4819 else
4783 message = i18n("The next alarm is in:\n") + message; 4820 message = i18n("The next alarm is in:\n") + message;
4784 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; 4821 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ;
4785 } else { 4822 } else {
4786 message = i18n("There is no next alarm."); 4823 message = i18n("There is no next alarm.");
4787 4824
4788 } 4825 }
4789#ifdef DESKTOP_VERSION 4826#ifdef DESKTOP_VERSION
4790 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 4827 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
4791 message += i18n("\nThe internal alarm notification is disabled!\n"); 4828 message += i18n("\nThe internal alarm notification is disabled!\n");
4792 message += i18n("Enable it in the settings menu, TAB alarm."); 4829 message += i18n("Enable it in the settings menu, TAB alarm.");
4793 } 4830 }
4794 4831
4795#endif 4832#endif
4796 KMessageBox::information( this, message); 4833 KMessageBox::information( this, message);
4797} 4834}
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 2c017e1..c2ad886 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -1,1697 +1,1711 @@
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() ) {
406 e->ignore();
407 return;
408 }
405 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 409 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
406 e->ignore(); 410 e->ignore();
407 // qDebug(" ignore %d",e->isAutoRepeat() ); 411 // qDebug(" ignore %d",e->isAutoRepeat() );
408 return; 412 return;
409 } 413 }
410 if (! e->isAutoRepeat() ) 414 if (! e->isAutoRepeat() )
411 mFlagKeyPressed = true; 415 mFlagKeyPressed = true;
412 QListViewItem* cn; 416 QListViewItem* cn;
413 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { 417 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
414 cn = currentItem(); 418 cn = currentItem();
415 if ( cn ) { 419 if ( cn ) {
416 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 420 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
417 if ( ci ){ 421 if ( ci ){
418 if ( e->state() == ShiftButton ) 422 if ( e->state() == ShiftButton )
419 ci->setOn( false ); 423 ci->setOn( false );
420 else 424 else
421 ci->setOn( true ); 425 ci->setOn( true );
422 cn = cn->itemBelow(); 426 cn = cn->itemBelow();
423 if ( cn ) { 427 if ( cn ) {
424 setCurrentItem ( cn ); 428 setCurrentItem ( cn );
425 ensureItemVisible ( cn ); 429 ensureItemVisible ( cn );
426 } 430 }
427 431
428 } 432 }
429 } 433 }
430 434
431 return; 435 return;
432 } 436 }
433 437
434 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 438 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
435 switch ( e->key() ) { 439 switch ( e->key() ) {
436 case Qt::Key_Down: 440 case Qt::Key_Down:
437 case Qt::Key_Up: 441 case Qt::Key_Up:
438 QListView::keyPressEvent ( e ); 442 QListView::keyPressEvent ( e );
439 break; 443 break;
440 case Qt::Key_Left: 444 case Qt::Key_Left:
441 case Qt::Key_Right: 445 case Qt::Key_Right:
442 QListView::keyPressEvent ( e ); 446 QListView::keyPressEvent ( e );
443 e->accept(); 447 e->accept();
444 return; 448 return;
445 break; 449 break;
446 default: 450 default:
447 e->ignore(); 451 e->ignore();
448 break; 452 break;
449 } 453 }
450 return; 454 return;
451 } 455 }
452 e->ignore(); 456 e->ignore();
453} 457}
454void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 458void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
455{ 459{
456 QListView::contentsMouseReleaseEvent(e); 460 QListView::contentsMouseReleaseEvent(e);
457 mMousePressed = false; 461 mMousePressed = false;
458} 462}
459 463
460void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 464void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
461{ 465{
462 if (!e) return; 466 if (!e) return;
463 467
464 QPoint vp = contentsToViewport(e->pos()); 468 QPoint vp = contentsToViewport(e->pos());
465 469
466 QListViewItem *item = itemAt(vp); 470 QListViewItem *item = itemAt(vp);
467 471
468 emit double_Clicked(item); 472 emit double_Clicked(item);
469 if (!item) return; 473 if (!item) return;
470 474
471 emit doubleClicked(item,vp,0); 475 emit doubleClicked(item,vp,0);
472} 476}
473 477
474///////////////////////////////////////////////////////////////////////////// 478/////////////////////////////////////////////////////////////////////////////
475 479
476KOQuickTodo::KOQuickTodo(QWidget *parent) : 480KOQuickTodo::KOQuickTodo(QWidget *parent) :
477 QLineEdit(parent) 481 QLineEdit(parent)
478{ 482{
479 setText(i18n("Click to add new Todo")); 483 setText(i18n("Click to add new Todo"));
480} 484}
481 485
482void KOQuickTodo::focusInEvent(QFocusEvent *ev) 486void KOQuickTodo::focusInEvent(QFocusEvent *ev)
483{ 487{
484 if ( text()==i18n("Click to add new Todo") ) 488 if ( text()==i18n("Click to add new Todo") )
485 setText(""); 489 setText("");
486 QLineEdit::focusInEvent(ev); 490 QLineEdit::focusInEvent(ev);
487} 491}
488 492
489void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 493void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
490{ 494{
491 setText(i18n("Click to add new Todo")); 495 setText(i18n("Click to add new Todo"));
492 QLineEdit::focusOutEvent(ev); 496 QLineEdit::focusOutEvent(ev);
493} 497}
494 498
495///////////////////////////////////////////////////////////////////////////// 499/////////////////////////////////////////////////////////////////////////////
496 500
497KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 501KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
498 KOrg::BaseView(calendar,parent,name) 502 KOrg::BaseView(calendar,parent,name)
499{ 503{
500 mCategoryPopupMenu = 0; 504 mCategoryPopupMenu = 0;
501 mPendingUpdateBeforeRepaint = false; 505 mPendingUpdateBeforeRepaint = false;
502 isFlatDisplay = false; 506 isFlatDisplay = false;
503 mNavigator = 0; 507 mNavigator = 0;
504 QBoxLayout *topLayout = new QVBoxLayout(this); 508 QBoxLayout *topLayout = new QVBoxLayout(this);
505 mName = QString ( name ); 509 mName = QString ( name );
506 mBlockUpdate = false; 510 mBlockUpdate = false;
507 mQuickBar = new QWidget( this ); 511 mQuickBar = new QWidget( this );
508 topLayout->addWidget(mQuickBar); 512 topLayout->addWidget(mQuickBar);
509 513
510 mQuickAdd = new KOQuickTodo(mQuickBar); 514 mQuickAdd = new KOQuickTodo(mQuickBar);
511 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); 515 QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar);
512 quickLayout->addWidget( mQuickAdd ); 516 quickLayout->addWidget( mQuickAdd );
513 QPushButton * flat = new QPushButton( "F",mQuickBar ); 517 QPushButton * flat = new QPushButton( "F",mQuickBar );
514 int fixwid = flat->sizeHint().height(); 518 int fixwid = flat->sizeHint().height();
515 if ( QApplication::desktop()->width() > 320 ) 519 if ( QApplication::desktop()->width() > 320 )
516 fixwid *= 2; 520 fixwid *= 2;
517 flat->setFixedWidth( fixwid ); 521 flat->setFixedWidth( fixwid );
518 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); 522 connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat()));
519 QPushButton * allopen = new QPushButton( "O",mQuickBar ); 523 QPushButton * allopen = new QPushButton( "O",mQuickBar );
520 allopen->setFixedWidth( fixwid ); 524 allopen->setFixedWidth( fixwid );
521 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); 525 connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen()));
522 QPushButton * allclose = new QPushButton( "C",mQuickBar ); 526 QPushButton * allclose = new QPushButton( "C",mQuickBar );
523 allclose->setFixedWidth( fixwid ); 527 allclose->setFixedWidth( fixwid );
524 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); 528 connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose()));
525 QPushButton * s_done = new QPushButton( "D",mQuickBar ); 529 QPushButton * s_done = new QPushButton( "D",mQuickBar );
526 s_done->setPixmap( SmallIcon("greenhook16")); 530 s_done->setPixmap( SmallIcon("greenhook16"));
527 s_done->setFixedWidth( fixwid ); 531 s_done->setFixedWidth( fixwid );
528 s_done->setFixedHeight( flat->sizeHint().height() ); 532 s_done->setFixedHeight( flat->sizeHint().height() );
529 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); 533 connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted()));
530 QPushButton * s_run = new QPushButton( "R",mQuickBar ); 534 QPushButton * s_run = new QPushButton( "R",mQuickBar );
531 s_run->setPixmap( SmallIcon("ko16old")); 535 s_run->setPixmap( SmallIcon("ko16old"));
532 s_run->setFixedWidth( fixwid ); 536 s_run->setFixedWidth( fixwid );
533 s_run->setFixedHeight( flat->sizeHint().height() ); 537 s_run->setFixedHeight( flat->sizeHint().height() );
534 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); 538 connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning()));
535 539
536 mNewSubBut = new QPushButton( "sub",mQuickBar ); 540 mNewSubBut = new QPushButton( "sub",mQuickBar );
537 mNewSubBut->setFixedWidth( fixwid*3/2 ); 541 mNewSubBut->setFixedWidth( fixwid*3/2 );
538 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); 542 connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo()));
539 mNewSubBut->setEnabled( false ); 543 mNewSubBut->setEnabled( false );
540 quickLayout->addWidget( mNewSubBut ); 544 quickLayout->addWidget( mNewSubBut );
541 quickLayout->addWidget( s_done ); 545 quickLayout->addWidget( s_done );
542 quickLayout->addWidget( s_run ); 546 quickLayout->addWidget( s_run );
543 547
544 quickLayout->addWidget( allopen ); 548 quickLayout->addWidget( allopen );
545 quickLayout->addWidget( allclose ); 549 quickLayout->addWidget( allclose );
546 quickLayout->addWidget( flat ); 550 quickLayout->addWidget( flat );
547 551
548 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); 552 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide();
549 553
550 mTodoListView = new KOTodoListView(calendar,this, name ); 554 mTodoListView = new KOTodoListView(calendar,this, name );
551 topLayout->addWidget(mTodoListView); 555 topLayout->addWidget(mTodoListView);
552 //mTodoListView->header()->setMaximumHeight(30); 556 //mTodoListView->header()->setMaximumHeight(30);
553 mTodoListView->setRootIsDecorated(true); 557 mTodoListView->setRootIsDecorated(true);
554 mTodoListView->setAllColumnsShowFocus(true); 558 mTodoListView->setAllColumnsShowFocus(true);
555 559
556 mTodoListView->setShowSortIndicator(true); 560 mTodoListView->setShowSortIndicator(true);
557 561
558 mTodoListView->addColumn(i18n("Todo")); 562 mTodoListView->addColumn(i18n("Todo"));
559 mTodoListView->addColumn(i18n("Prio")); 563 mTodoListView->addColumn(i18n("Prio"));
560 mTodoListView->setColumnAlignment(1,AlignHCenter); 564 mTodoListView->setColumnAlignment(1,AlignHCenter);
561 mTodoListView->addColumn(i18n("Complete")); 565 mTodoListView->addColumn(i18n("Complete"));
562 mTodoListView->setColumnAlignment(2,AlignCenter); 566 mTodoListView->setColumnAlignment(2,AlignCenter);
563 567
564 mTodoListView->addColumn(i18n("Due Date")); 568 mTodoListView->addColumn(i18n("Due Date"));
565 mTodoListView->setColumnAlignment(3,AlignLeft); 569 mTodoListView->setColumnAlignment(3,AlignLeft);
566 mTodoListView->addColumn(i18n("Due Time")); 570 mTodoListView->addColumn(i18n("Due Time"));
567 mTodoListView->setColumnAlignment(4,AlignHCenter); 571 mTodoListView->setColumnAlignment(4,AlignHCenter);
568 572
569 mTodoListView->addColumn(i18n("Start Date")); 573 mTodoListView->addColumn(i18n("Start Date"));
570 mTodoListView->setColumnAlignment(5,AlignLeft); 574 mTodoListView->setColumnAlignment(5,AlignLeft);
571 mTodoListView->addColumn(i18n("Start Time")); 575 mTodoListView->addColumn(i18n("Start Time"));
572 mTodoListView->setColumnAlignment(6,AlignHCenter); 576 mTodoListView->setColumnAlignment(6,AlignHCenter);
573 577
574 mTodoListView->addColumn(i18n("Cancelled")); 578 mTodoListView->addColumn(i18n("Cancelled"));
575 mTodoListView->addColumn(i18n("Categories")); 579 mTodoListView->addColumn(i18n("Categories"));
576 mTodoListView->addColumn(i18n("Calendar")); 580 mTodoListView->addColumn(i18n("Calendar"));
577#if 0 581#if 0
578 mTodoListView->addColumn(i18n("Sort Id")); 582 mTodoListView->addColumn(i18n("Sort Id"));
579 mTodoListView->setColumnAlignment(4,AlignHCenter); 583 mTodoListView->setColumnAlignment(4,AlignHCenter);
580#endif 584#endif
581 585
582 mTodoListView->setMinimumHeight( 60 ); 586 mTodoListView->setMinimumHeight( 60 );
583 mTodoListView->setItemsRenameable( true ); 587 mTodoListView->setItemsRenameable( true );
584 mTodoListView->setRenameable( 0 ); 588 mTodoListView->setRenameable( 0 );
585 mTodoListView->setColumnWidth( 0, 120 ); 589 mTodoListView->setColumnWidth( 0, 120 );
586 int iii = 0; 590 int iii = 0;
587 for ( iii = 0; iii< 10 ; ++iii ) 591 for ( iii = 0; iii< 10 ; ++iii )
588 mTodoListView->setColumnWidthMode( iii, QListView::Manual ); 592 mTodoListView->setColumnWidthMode( iii, QListView::Manual );
589 593
590 594
591 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 595 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
592 596
593 mPriorityPopupMenu = new QPopupMenu(this); 597 mPriorityPopupMenu = new QPopupMenu(this);
594 for (int i = 1; i <= 5; i++) { 598 for (int i = 1; i <= 5; i++) {
595 QString label = QString ("%1").arg (i); 599 QString label = QString ("%1").arg (i);
596 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 600 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
597 } 601 }
598 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 602 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
599 603
600 mPercentageCompletedPopupMenu = new QPopupMenu(this); 604 mPercentageCompletedPopupMenu = new QPopupMenu(this);
601 for (int i = 0; i <= 100; i+=20) { 605 for (int i = 0; i <= 100; i+=20) {
602 QString label = QString ("%1 %").arg (i); 606 QString label = QString ("%1 %").arg (i);
603 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 607 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
604 } 608 }
605 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 609 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
606 610
607 611
608 mCategoryPopupMenu = new QPopupMenu (this); 612 mCategoryPopupMenu = new QPopupMenu (this);
609 mCategoryPopupMenu->setCheckable (true); 613 mCategoryPopupMenu->setCheckable (true);
610 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); 614 connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int)));
611 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); 615 connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ()));
612 616
613 mCalPopupMenu = new QPopupMenu (this); 617 mCalPopupMenu = new QPopupMenu (this);
614 mCalPopupMenu->setCheckable (true); 618 mCalPopupMenu->setCheckable (true);
615 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); 619 connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int)));
616 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); 620 connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ()));
617 621
618 622
619 623
620 624
621 mItemPopupMenu = new QPopupMenu(this); 625 mItemPopupMenu = new QPopupMenu(this);
622 mItemPopupMenu->insertItem(i18n("Show"), this, 626 mItemPopupMenu->insertItem(i18n("Show"), this,
623 SLOT (showTodo())); 627 SLOT (showTodo()));
624 mItemPopupMenu->insertItem(i18n("Edit..."), this, 628 mItemPopupMenu->insertItem(i18n("Edit..."), this,
625 SLOT (editTodo())); 629 SLOT (editTodo()));
626 mItemPopupMenu->insertItem( i18n("Delete..."), this, 630 mItemPopupMenu->insertItem( i18n("Delete..."), this,
627 SLOT (deleteTodo())); 631 SLOT (deleteTodo()));
628 mItemPopupMenu->insertItem( i18n("Clone..."), this, 632 mItemPopupMenu->insertItem( i18n("Clone..."), this,
629 SLOT (cloneTodo())); 633 SLOT (cloneTodo()));
630 mItemPopupMenu->insertItem( i18n("Move..."), this, 634 mItemPopupMenu->insertItem( i18n("Move..."), this,
631 SLOT (moveTodo())); 635 SLOT (moveTodo()));
632#ifndef DESKTOP_VERSION 636#ifndef DESKTOP_VERSION
633 mItemPopupMenu->insertItem( i18n("Beam..."), this, 637 mItemPopupMenu->insertItem( i18n("Beam..."), this,
634 SLOT (beamTodo())); 638 SLOT (beamTodo()));
635#endif 639#endif
636 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 640 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
637 SLOT (cancelTodo())); 641 SLOT (cancelTodo()));
638 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu); 642 mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu);
639 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu); 643 mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu);
640 mItemPopupMenu->insertSeparator(); 644 mItemPopupMenu->insertSeparator();
641 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, 645 mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this,
642 SLOT (toggleRunningItem())); 646 SLOT (toggleRunningItem()));
643 mItemPopupMenu->insertSeparator(); 647 mItemPopupMenu->insertSeparator();
644 /* 648 /*
645 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 649 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
646 SLOT (newTodo())); 650 SLOT (newTodo()));
647 */ 651 */
648 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 652 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
649 SLOT (newSubTodo())); 653 SLOT (newSubTodo()));
650 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 654 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
651 SLOT (unparentTodo()),0,21); 655 SLOT (unparentTodo()),0,21);
652 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 656 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
653 SLOT (reparentTodo()),0,22); 657 SLOT (reparentTodo()),0,22);
654 mItemPopupMenu->insertSeparator(); 658 mItemPopupMenu->insertSeparator();
655#if 0 659#if 0
656 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), 660 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."),
657 this, SLOT( purgeCompleted() ) ); 661 this, SLOT( purgeCompleted() ) );
658 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 662 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
659 this, SLOT( toggleCompleted() ),0, 33 ); 663 this, SLOT( toggleCompleted() ),0, 33 );
660 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 664 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
661 this, SLOT( toggleQuickTodo() ),0, 34 ); 665 this, SLOT( toggleQuickTodo() ),0, 34 );
662 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 666 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
663 this, SLOT( toggleRunning() ),0, 35 ); 667 this, SLOT( toggleRunning() ),0, 35 );
664 668
665#endif 669#endif
666 mPopupMenu = new QPopupMenu(this); 670 mPopupMenu = new QPopupMenu(this);
667 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 671 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
668 SLOT (newTodo()),0,1); 672 SLOT (newTodo()),0,1);
669 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), 673 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."),
670 this, SLOT(purgeCompleted()),0,2); 674 this, SLOT(purgeCompleted()),0,2);
671 mPopupMenu->insertItem(i18n("Show Completed"), 675 mPopupMenu->insertItem(i18n("Show Completed"),
672 this, SLOT( toggleCompleted() ),0,3 ); 676 this, SLOT( toggleCompleted() ),0,3 );
673 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), 677 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
674 this, SLOT( toggleRunning() ),0,5 ); 678 this, SLOT( toggleRunning() ),0,5 );
675 mPopupMenu->insertItem(i18n(" set all open","Display all opened"), 679 mPopupMenu->insertItem(i18n(" set all open","Display all opened"),
676 this, SLOT( setAllOpen() ),0,6 ); 680 this, SLOT( setAllOpen() ),0,6 );
677 mPopupMenu->insertItem(i18n(" set all close","Display all closed"), 681 mPopupMenu->insertItem(i18n(" set all close","Display all closed"),
678 this, SLOT( setAllClose() ),0,7 ); 682 this, SLOT( setAllClose() ),0,7 );
679 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), 683 mPopupMenu->insertItem(i18n(" set all flat","Display all flat"),
680 this, SLOT( setAllFlat() ),0,8 ); 684 this, SLOT( setAllFlat() ),0,8 );
681 mPopupMenu->insertSeparator(); 685 mPopupMenu->insertSeparator();
682 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 686 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
683 this, SLOT( toggleQuickTodo() ),0,4 ); 687 this, SLOT( toggleQuickTodo() ),0,4 );
684 mDocPrefs = new DocPrefs( name ); 688 mDocPrefs = new DocPrefs( name );
685 689
686 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); 690 mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu );
687 mPopupMenu->setCheckable( true ); 691 mPopupMenu->setCheckable( true );
688 mItemPopupMenu->setCheckable( true ); 692 mItemPopupMenu->setCheckable( true );
689 693
690 694
691 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 695 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
692 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 696 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
693 697
694 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 698 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
695 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 699 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
696 700
697 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 701 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
698 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 702 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
699 703
700 704
701 // Double clicking conflicts with opening/closing the subtree 705 // Double clicking conflicts with opening/closing the subtree
702 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 706 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
703 SLOT( editItem( QListViewItem *) ) ); 707 SLOT( editItem( QListViewItem *) ) );
704 /* 708 /*
705 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 709 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
706 const QPoint &,int ) ), 710 const QPoint &,int ) ),
707 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 711 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
708 */ 712 */
709 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 713 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
710 const QPoint &,int ) ), 714 const QPoint &,int ) ),
711 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 715 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
712 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 716 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
713 SLOT( itemClicked( QListViewItem * ) ) ); 717 SLOT( itemClicked( QListViewItem * ) ) );
714 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 718 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
715 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 719 SLOT( itemDoubleClicked( QListViewItem * ) ) );
716 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 720 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
717 SLOT( updateView() ) ); 721 SLOT( updateView() ) );
718 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 722 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
719 SLOT( todoModified(Todo *, int) ) ); 723 SLOT( todoModified(Todo *, int) ) );
720 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 724 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
721 SLOT( itemStateChanged( QListViewItem * ) ) ); 725 SLOT( itemStateChanged( QListViewItem * ) ) );
722 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 726 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
723 SLOT( itemStateChanged( QListViewItem * ) ) ); 727 SLOT( itemStateChanged( QListViewItem * ) ) );
724 connect( mTodoListView, SIGNAL( paintNeeded() ), 728 connect( mTodoListView, SIGNAL( paintNeeded() ),
725 SLOT( paintNeeded()) ); 729 SLOT( paintNeeded()) );
726 730
727#if 0 731#if 0
728 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 732 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
729 SLOT(selectionChanged(QListViewItem *))); 733 SLOT(selectionChanged(QListViewItem *)));
730 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 734 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
731 SLOT(selectionChanged(QListViewItem *))); 735 SLOT(selectionChanged(QListViewItem *)));
732 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 736 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
733 SLOT(selectionChanged(QListViewItem *))); 737 SLOT(selectionChanged(QListViewItem *)));
734#endif 738#endif
735 739
736 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 740 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
737 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 741 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
738 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 742 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
739 743
740 connect( mTodoListView, SIGNAL(selectionChanged() ), 744 connect( mTodoListView, SIGNAL(selectionChanged() ),
741 SLOT( processSelectionChange() ) ); 745 SLOT( processSelectionChange() ) );
742 connect( mQuickAdd, SIGNAL( returnPressed () ), 746 connect( mQuickAdd, SIGNAL( returnPressed () ),
743 SLOT( addQuickTodo() ) ); 747 SLOT( addQuickTodo() ) );
744 748
745} 749}
746 750
747KOTodoView::~KOTodoView() 751KOTodoView::~KOTodoView()
748{ 752{
749 753
750#if QT_VERSION >= 0x030000 754#if QT_VERSION >= 0x030000
751 755
752#else 756#else
753 delete mKOTodoViewWhatsThis; 757 delete mKOTodoViewWhatsThis;
754#endif 758#endif
755 759
756 delete mDocPrefs; 760 delete mDocPrefs;
757} 761}
758QString KOTodoView::getWhatsThisText(QPoint p) 762QString KOTodoView::getWhatsThisText(QPoint p)
759{ 763{
760 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 764 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
761 if ( item ) 765 if ( item )
762 return KIncidenceFormatter::instance()->getFormattedText( item->todo(), 766 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
763 KOPrefs::instance()->mWTshowDetails, 767 KOPrefs::instance()->mWTshowDetails,
764 KOPrefs::instance()->mWTshowCreated, 768 KOPrefs::instance()->mWTshowCreated,
765 KOPrefs::instance()->mWTshowChanged); 769 KOPrefs::instance()->mWTshowChanged);
766 return i18n("That is the todo view" ); 770 return i18n("That is the todo view" );
767 771
768} 772}
769 773
770void KOTodoView::jumpToDate () 774void KOTodoView::jumpToDate ()
771{ 775{
772 // if (mActiveItem) { 776 // if (mActiveItem) {
773// mActiveItem->todo()); 777// mActiveItem->todo());
774// if ( mActiveItem->todo()->hasDueDate() ) 778// if ( mActiveItem->todo()->hasDueDate() )
775// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 779// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
776} 780}
777void KOTodoView::paintNeeded() 781void KOTodoView::paintNeeded()
778{ 782{
779 if ( mPendingUpdateBeforeRepaint ) { 783 if ( mPendingUpdateBeforeRepaint ) {
780 updateView(); 784 updateView();
781 mPendingUpdateBeforeRepaint = false; 785 mPendingUpdateBeforeRepaint = false;
782 } 786 }
783} 787}
784void KOTodoView::paintEvent(QPaintEvent * pevent) 788void KOTodoView::paintEvent(QPaintEvent * pevent)
785{ 789{
786 if ( mPendingUpdateBeforeRepaint ) { 790 if ( mPendingUpdateBeforeRepaint ) {
787 updateView(); 791 updateView();
788 mPendingUpdateBeforeRepaint = false; 792 mPendingUpdateBeforeRepaint = false;
789 } 793 }
790 KOrg::BaseView::paintEvent( pevent); 794 KOrg::BaseView::paintEvent( pevent);
791} 795}
792 796
793void KOTodoView::updateView() 797void KOTodoView::updateView()
794{ 798{
795 pendingSubtodo = 0; 799 pendingSubtodo = 0;
796 if ( mBlockUpdate ) { 800 if ( mBlockUpdate ) {
797 return; 801 return;
798 } 802 }
799 if ( !isVisible() ) { 803 if ( !isVisible() ) {
800 mPendingUpdateBeforeRepaint = true; 804 mPendingUpdateBeforeRepaint = true;
801 return; 805 return;
802 } 806 }
803 //qDebug("KOTodoView::updateView() %x", this); 807 //qDebug("KOTodoView::updateView() %x", this);
804 if ( isFlatDisplay ) { 808 if ( isFlatDisplay ) {
805 displayAllFlat(); 809 displayAllFlat();
806 return; 810 return;
807 } 811 }
808 storeCurrentItem(); 812 storeCurrentItem();
809 //qDebug("update "); 813 //qDebug("update ");
810// kdDebug() << "KOTodoView::updateView()" << endl; 814// kdDebug() << "KOTodoView::updateView()" << endl;
811 QFont fo = KOPrefs::instance()->mTodoViewFont; 815 QFont fo = KOPrefs::instance()->mTodoViewFont;
812 816
813 817
814 mTodoListView->clear(); 818 mTodoListView->clear();
815 if ( mName == "todolistsmall" ) { 819 if ( mName == "todolistsmall" ) {
816 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { 820 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
817 int ps = fo.pointSize() -2; 821 int ps = fo.pointSize() -2;
818 if ( ps > 12 ) 822 if ( ps > 12 )
819 ps -= 2; 823 ps -= 2;
820 fo.setPointSize( ps ); 824 fo.setPointSize( ps );
821 } 825 }
822 } 826 }
823 827
824 mTodoListView->setFont( fo ); 828 mTodoListView->setFont( fo );
825 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); 829 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
826 //mTodoListView->header()->setMaximumHeight(fm.height()); 830 //mTodoListView->header()->setMaximumHeight(fm.height());
827 QPtrList<Todo> todoList = calendar()->todos(); 831 QPtrList<Todo> todoList = calendar()->todos();
828 832
829/* 833/*
830 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; 834 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
831 Event *t; 835 Event *t;
832 for(t = todoList.first(); t; t = todoList.next()) { 836 for(t = todoList.first(); t; t = todoList.next()) {
833 kdDebug() << " " << t->getSummary() << endl; 837 kdDebug() << " " << t->getSummary() << endl;
834 838
835 if (t->getRelatedTo()) { 839 if (t->getRelatedTo()) {
836 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; 840 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
837 } 841 }
838 842
839 QPtrList<Event> l = t->getRelations(); 843 QPtrList<Event> l = t->getRelations();
840 Event *c; 844 Event *c;
841 for(c=l.first();c;c=l.next()) { 845 for(c=l.first();c;c=l.next()) {
842 kdDebug() << " - relation: " << c->getSummary() << endl; 846 kdDebug() << " - relation: " << c->getSummary() << endl;
843 } 847 }
844 } 848 }
845*/ 849*/
846 850
847 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a 851 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a
848 // specific order of events. That means that we have to generate parent items 852 // specific order of events. That means that we have to generate parent items
849 // recursively for proper hierarchical display of Todos. 853 // recursively for proper hierarchical display of Todos.
850 mTodoMap.clear(); 854 mTodoMap.clear();
851 Todo *todo; 855 Todo *todo;
852 todo = todoList.first();// todo; todo = todoList.next()) { 856 todo = todoList.first();// todo; todo = todoList.next()) {
853 while ( todo ) { 857 while ( todo ) {
854 bool next = true; 858 bool next = true;
855 // qDebug("todo %s ", todo->summary().latin1()); 859 // qDebug("todo %s ", todo->summary().latin1());
856 Incidence *incidence = todo->relatedTo(); 860 Incidence *incidence = todo->relatedTo();
857 while ( incidence ) { 861 while ( incidence ) {
858 if ( incidence->typeID() == todoID ) { 862 if ( incidence->typeID() == todoID ) {
859 //qDebug("related %s ",incidence->summary().latin1() ); 863 //qDebug("related %s ",incidence->summary().latin1() );
860 if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) { 864 if ( !(todoList.contains ( ((Todo* )incidence ) ) ) && incidence->calEnabled() ) {
861 //qDebug("related not found "); 865 //qDebug("related not found ");
862 todoList.remove( ); 866 todoList.remove( );
863 todo = todoList.current(); 867 todo = todoList.current();
864 next = false; 868 next = false;
865 incidence = 0; 869 incidence = 0;
866 870
867 } else { 871 } else {
868 //qDebug("related found "); 872 //qDebug("related found ");
869 incidence = incidence->relatedTo(); 873 incidence = incidence->relatedTo();
870 } 874 }
871 } else 875 } else
872 incidence = 0; 876 incidence = 0;
873 } 877 }
874 if ( next ) 878 if ( next )
875 todo = todoList.next(); 879 todo = todoList.next();
876 } 880 }
877 881
878 for(todo = todoList.first(); todo; todo = todoList.next()) { 882 for(todo = todoList.first(); todo; todo = todoList.next()) {
879 if (!mTodoMap.contains(todo) && checkTodo( todo ) ) 883 if (!mTodoMap.contains(todo) && checkTodo( todo ) )
880 { 884 {
881 insertTodoItem(todo); 885 insertTodoItem(todo);
882 } 886 }
883 } 887 }
884 // Restore opened/closed state 888 // Restore opened/closed state
885 mTodoListView->blockSignals( true ); 889 mTodoListView->blockSignals( true );
886 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); 890 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() );
887 mTodoListView->blockSignals( false ); 891 mTodoListView->blockSignals( false );
888 resetCurrentItem(); 892 resetCurrentItem();
889} 893}
890 894
891void KOTodoView::storeCurrentItem() 895void KOTodoView::storeCurrentItem()
892{ 896{
893 mCurItem = 0; 897 mCurItem = 0;
894 mCurItemRootParent = 0; 898 mCurItemRootParent = 0;
895 mCurItemParent = 0; 899 mCurItemParent = 0;
896 mCurItemAbove = 0; 900 mCurItemAbove = 0;
897 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 901 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
898 if (mActiveItem) { 902 if (mActiveItem) {
899 mCurItem = mActiveItem->todo(); 903 mCurItem = mActiveItem->todo();
900 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove (); 904 KOTodoViewItem* activeItemAbove = (KOTodoViewItem*)mActiveItem->itemAbove ();
901 if ( activeItemAbove ) 905 if ( activeItemAbove )
902 mCurItemAbove = activeItemAbove->todo(); 906 mCurItemAbove = activeItemAbove->todo();
903 mCurItemRootParent = mCurItem; 907 mCurItemRootParent = mCurItem;
904 mCurItemParent = mCurItemRootParent->relatedTo(); 908 mCurItemParent = mCurItemRootParent->relatedTo();
905 while ( mCurItemRootParent->relatedTo() != 0 ) 909 while ( mCurItemRootParent->relatedTo() != 0 )
906 mCurItemRootParent = mCurItemRootParent->relatedTo(); 910 mCurItemRootParent = mCurItemRootParent->relatedTo();
907 } 911 }
908 mActiveItem = 0; 912 mActiveItem = 0;
909} 913}
910 914
911void KOTodoView::resetCurrentItem() 915void KOTodoView::resetCurrentItem()
912{ 916{
913 //mTodoListView->setFocus(); 917 //mTodoListView->setFocus();
914 KOTodoViewItem* foundItem = 0; 918 KOTodoViewItem* foundItem = 0;
915 KOTodoViewItem* foundItemRoot = 0; 919 KOTodoViewItem* foundItemRoot = 0;
916 KOTodoViewItem* foundItemParent = 0; 920 KOTodoViewItem* foundItemParent = 0;
917 KOTodoViewItem* foundItemAbove = 0; 921 KOTodoViewItem* foundItemAbove = 0;
918 if ( mTodoListView->firstChild () ) { 922 if ( mTodoListView->firstChild () ) {
919 if ( mCurItem ) { 923 if ( mCurItem ) {
920 KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild (); 924 KOTodoViewItem* item = (KOTodoViewItem*)mTodoListView->firstChild ();
921 while ( item ) { 925 while ( item ) {
922 if ( item->todo() == mCurItem ) { 926 if ( item->todo() == mCurItem ) {
923 foundItem = item; 927 foundItem = item;
924 break; 928 break;
925 } else if ( item->todo() == mCurItemAbove ) { 929 } else if ( item->todo() == mCurItemAbove ) {
926 foundItemAbove = item; 930 foundItemAbove = item;
927 931
928 } 932 }
929 if ( item->todo() == mCurItemRootParent ) { 933 if ( item->todo() == mCurItemRootParent ) {
930 foundItemRoot = item; 934 foundItemRoot = item;
931 } 935 }
932 if ( item->todo() == mCurItemParent ) { 936 if ( item->todo() == mCurItemParent ) {
933 foundItemParent = item; 937 foundItemParent = item;
934 } 938 }
935 item = (KOTodoViewItem*)item->itemBelow(); 939 item = (KOTodoViewItem*)item->itemBelow();
936 } 940 }
937 if ( ! foundItem ) { 941 if ( ! foundItem ) {
938 if ( foundItemParent ) { 942 if ( foundItemParent ) {
939 foundItem = foundItemParent; 943 foundItem = foundItemParent;
940 } else { 944 } else {
941 if ( foundItemRoot ) 945 if ( foundItemRoot )
942 foundItem = foundItemRoot; 946 foundItem = foundItemRoot;
943 else 947 else
944 foundItem = foundItemAbove; 948 foundItem = foundItemAbove;
945 } 949 }
946 } 950 }
947 } 951 }
948 if ( foundItem ) { 952 if ( foundItem ) {
949 mTodoListView->setSelected ( foundItem, true ); 953 mTodoListView->setSelected ( foundItem, true );
950 mTodoListView->setCurrentItem( foundItem ); 954 mTodoListView->setCurrentItem( foundItem );
951 mTodoListView->ensureItemVisible( foundItem ); 955 mTodoListView->ensureItemVisible( foundItem );
952 } else { 956 } else {
953 if ( mTodoListView->firstChild () ) { 957 if ( mTodoListView->firstChild () ) {
954 mTodoListView->setSelected ( mTodoListView->firstChild (), true ); 958 mTodoListView->setSelected ( mTodoListView->firstChild (), true );
955 mTodoListView->setCurrentItem( mTodoListView->firstChild () ); 959 mTodoListView->setCurrentItem( mTodoListView->firstChild () );
956 } 960 }
957 } 961 }
958 } 962 }
959 processSelectionChange(); 963 processSelectionChange();
960 QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); 964 QTimer::singleShot( 100, this, SLOT ( resetFocusToList() ));
961} 965}
962void KOTodoView::resetFocusToList() 966void KOTodoView::resetFocusToList()
963{ 967{
964 topLevelWidget()->setActiveWindow(); 968 topLevelWidget()->setActiveWindow();
965 mTodoListView->setFocus(); 969 mTodoListView->setFocus();
966} 970}
967//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove; 971//Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove;
968bool KOTodoView::checkTodo( Todo * todo ) 972bool KOTodoView::checkTodo( Todo * todo )
969{ 973{
970 974
971 if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) 975 if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() )
972 return false; 976 return false;
973 if ( !todo->isCompleted() ) { 977 if ( !todo->isCompleted() ) {
974 if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() ) 978 if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() )
975 return true; 979 return true;
976 } 980 }
977 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { 981 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) {
978 if ( todo->hasStartDate() ) 982 if ( todo->hasStartDate() )
979 if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) 983 if ( mNavigator->selectedDates().last() < todo->dtStart().date() )
980 return false; 984 return false;
981 if ( todo->hasDueDate() ) 985 if ( todo->hasDueDate() )
982 if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) 986 if ( mNavigator->selectedDates().first() > todo->dtDue().date() )
983 return false; 987 return false;
984 } 988 }
985 return true; 989 return true;
986} 990}
987 991
988void KOTodoView::restoreItemState( QListViewItem *item ) 992void KOTodoView::restoreItemState( QListViewItem *item )
989{ 993{
990 pendingSubtodo = 0; 994 pendingSubtodo = 0;
991 while( item ) { 995 while( item ) {
992 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 996 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
993 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); 997 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
994 if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); 998 if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
995 item = item->nextSibling(); 999 item = item->nextSibling();
996 } 1000 }
997} 1001}
998 1002
999 1003
1000QMap<Todo *,KOTodoViewItem *>::ConstIterator 1004QMap<Todo *,KOTodoViewItem *>::ConstIterator
1001KOTodoView::insertTodoItem(Todo *todo) 1005KOTodoView::insertTodoItem(Todo *todo)
1002{ 1006{
1003 1007
1004 // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; 1008 // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
1005 // TODO: Check, if dynmaic cast is necessary 1009 // TODO: Check, if dynmaic cast is necessary
1006 1010
1007 pendingSubtodo = 0; 1011 pendingSubtodo = 0;
1008 Incidence *incidence = todo->relatedTo(); 1012 Incidence *incidence = todo->relatedTo();
1009 while ( incidence && !incidence->calEnabled() ) 1013 while ( incidence && !incidence->calEnabled() )
1010 incidence = incidence->relatedTo(); 1014 incidence = incidence->relatedTo();
1011 if (incidence && incidence->typeID() == todoID ) { 1015 if (incidence && incidence->typeID() == todoID ) {
1012 Todo *relatedTodo = static_cast<Todo *>(incidence); 1016 Todo *relatedTodo = static_cast<Todo *>(incidence);
1013 1017
1014 // kdDebug() << " has Related" << endl; 1018 // kdDebug() << " has Related" << endl;
1015 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 1019 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
1016 itemIterator = mTodoMap.find(relatedTodo); 1020 itemIterator = mTodoMap.find(relatedTodo);
1017 if (itemIterator == mTodoMap.end()) { 1021 if (itemIterator == mTodoMap.end()) {
1018 // kdDebug() << " related not yet in list" << endl; 1022 // kdDebug() << " related not yet in list" << endl;
1019 itemIterator = insertTodoItem (relatedTodo); 1023 itemIterator = insertTodoItem (relatedTodo);
1020 } 1024 }
1021 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem 1025 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem
1022 // and one into the map. Sure finding is more easy but why? -zecke 1026 // and one into the map. Sure finding is more easy but why? -zecke
1023 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); 1027 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this);
1024 return mTodoMap.insert(todo,todoItem); 1028 return mTodoMap.insert(todo,todoItem);
1025 } else { 1029 } else {
1026 // kdDebug() << " no Related" << endl; 1030 // kdDebug() << " no Related" << endl;
1027 // see above -zecke 1031 // see above -zecke
1028 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1032 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1029 return mTodoMap.insert(todo,todoItem); 1033 return mTodoMap.insert(todo,todoItem);
1030 } 1034 }
1031} 1035}
1032 1036
1033 1037
1034void KOTodoView::updateConfig() 1038void KOTodoView::updateConfig()
1035{ 1039{
1036 updateView(); 1040 updateView();
1037 mTodoListView->repaintContents(); 1041 mTodoListView->repaintContents();
1038} 1042}
1039 1043
1040QPtrList<Incidence> KOTodoView::selectedIncidences() 1044QPtrList<Incidence> KOTodoView::selectedIncidences()
1041{ 1045{
1042 QPtrList<Incidence> selected; 1046 QPtrList<Incidence> selected;
1043 1047
1044 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1048 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1045// if (!item) item = mActiveItem; 1049// if (!item) item = mActiveItem;
1046 if (item) selected.append(item->todo()); 1050 if (item) selected.append(item->todo());
1047 1051
1048 return selected; 1052 return selected;
1049} 1053}
1050 1054
1051QPtrList<Todo> KOTodoView::selectedTodos() 1055QPtrList<Todo> KOTodoView::selectedTodos()
1052{ 1056{
1053 QPtrList<Todo> selected; 1057 QPtrList<Todo> selected;
1054 1058
1055 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 1059 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
1056// if (!item) item = mActiveItem; 1060// if (!item) item = mActiveItem;
1057 if (item) selected.append(item->todo()); 1061 if (item) selected.append(item->todo());
1058 1062
1059 return selected; 1063 return selected;
1060} 1064}
1061 1065
1062void KOTodoView::changeEventDisplay(Event *, int) 1066void KOTodoView::changeEventDisplay(Event *, int)
1063{ 1067{
1064 updateView(); 1068 updateView();
1065} 1069}
1066 1070
1067void KOTodoView::showDates(const QDate &, const QDate &) 1071void KOTodoView::showDates(const QDate &, const QDate &)
1068{ 1072{
1069} 1073}
1070 1074
1071void KOTodoView::showEvents(QPtrList<Event>) 1075void KOTodoView::showEvents(QPtrList<Event>)
1072{ 1076{
1073 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; 1077 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
1074} 1078}
1075 1079
1076void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1080void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1077 const QDate &td) 1081 const QDate &td)
1078{ 1082{
1079#ifndef KORG_NOPRINTER 1083#ifndef KORG_NOPRINTER
1080 calPrinter->preview(CalPrinter::Todolist, fd, td); 1084 calPrinter->preview(CalPrinter::Todolist, fd, td);
1081#endif 1085#endif
1082} 1086}
1083 1087
1084void KOTodoView::editItem(QListViewItem *item ) 1088void KOTodoView::editItem(QListViewItem *item )
1085{ 1089{
1086 emit editTodoSignal(((KOTodoViewItem *)item)->todo()); 1090 emit editTodoSignal(((KOTodoViewItem *)item)->todo());
1087} 1091}
1088 1092
1089void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) 1093void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
1090{ 1094{
1091 emit showTodoSignal(((KOTodoViewItem *)item)->todo()); 1095 emit showTodoSignal(((KOTodoViewItem *)item)->todo());
1092} 1096}
1093 1097
1094void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) 1098void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
1095{ 1099{
1096 pendingSubtodo = 0; 1100 pendingSubtodo = 0;
1097 mActiveItem = (KOTodoViewItem *)item; 1101 mActiveItem = (KOTodoViewItem *)item;
1098 if (item) { 1102 if (item) {
1099 switch (column){ 1103 switch (column){
1100 case 1: 1104 case 1:
1101 mPriorityPopupMenu->popup(QCursor::pos ()); break; 1105 mPriorityPopupMenu->popup(QCursor::pos ()); break;
1102 case 2: 1106 case 2:
1103 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; 1107 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
1104 case 3: 1108 case 3:
1105 moveTodo(); 1109 moveTodo();
1106 break; 1110 break;
1107 case 8: 1111 case 8:
1108 mCategoryPopupMenu->popup(QCursor::pos ()); break; 1112 mCategoryPopupMenu->popup(QCursor::pos ()); break;
1109 case 9: 1113 case 9:
1110 mCalPopupMenu->popup(QCursor::pos ()); break; 1114 mCalPopupMenu->popup(QCursor::pos ()); break;
1111 default: 1115 default:
1112 mItemPopupMenu->popup(QCursor::pos()); 1116 mItemPopupMenu->popup(QCursor::pos());
1113 } 1117 }
1114 } else mPopupMenu->popup(QCursor::pos()); 1118 } else mPopupMenu->popup(QCursor::pos());
1115} 1119}
1116void KOTodoView::newTodo() 1120void KOTodoView::newTodo()
1117{ 1121{
1118 emit newTodoSignal(); 1122 emit newTodoSignal();
1119} 1123}
1120 1124
1121void KOTodoView::newSubTodo() 1125void KOTodoView::newSubTodo()
1122{ 1126{
1123 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1127 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1124 if (mActiveItem) { 1128 if (mActiveItem) {
1125 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) { 1129 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add new Todo") ) {
1126 addQuickTodoPar( mActiveItem->todo()); 1130 addQuickTodoPar( mActiveItem->todo());
1127 } else 1131 } else
1128 emit newSubTodoSignal(mActiveItem->todo()); 1132 emit newSubTodoSignal(mActiveItem->todo());
1129 } 1133 }
1130} 1134}
1131void KOTodoView::unparentTodo() 1135void KOTodoView::unparentTodo()
1132{ 1136{
1133 if (mActiveItem) { 1137 if (mActiveItem) {
1134 emit unparentTodoSignal(mActiveItem->todo()); 1138 emit unparentTodoSignal(mActiveItem->todo());
1135 } 1139 }
1136} 1140}
1137 1141
1138void KOTodoView::reparentTodo() 1142void KOTodoView::reparentTodo()
1139{ 1143{
1140 if (mActiveItem) { 1144 if (mActiveItem) {
1141 topLevelWidget()->setCaption(i18n("Click on new parent item")); 1145 topLevelWidget()->setCaption(i18n("Click on new parent item"));
1142 pendingSubtodo = mActiveItem; 1146 pendingSubtodo = mActiveItem;
1143 } 1147 }
1144} 1148}
1145void KOTodoView::editTodo() 1149void KOTodoView::editTodo()
1146{ 1150{
1147 if (mActiveItem) { 1151 if (mActiveItem) {
1148 emit editTodoSignal(mActiveItem->todo()); 1152 emit editTodoSignal(mActiveItem->todo());
1149 } 1153 }
1150} 1154}
1151void KOTodoView::cloneTodo() 1155void KOTodoView::cloneTodo()
1152{ 1156{
1153 if (mActiveItem) { 1157 if (mActiveItem) {
1154 emit cloneTodoSignal((Incidence*)mActiveItem->todo()); 1158 emit cloneTodoSignal((Incidence*)mActiveItem->todo());
1155 } 1159 }
1156} 1160}
1157void KOTodoView::cancelTodo() 1161void KOTodoView::cancelTodo()
1158{ 1162{
1159 if (mActiveItem) { 1163 if (mActiveItem) {
1160 emit cancelTodoSignal((Incidence*)mActiveItem->todo()); 1164 emit cancelTodoSignal((Incidence*)mActiveItem->todo());
1161 } 1165 }
1162} 1166}
1163void KOTodoView::moveTodo() 1167void KOTodoView::moveTodo()
1164{ 1168{
1165 if (mActiveItem) { 1169 if (mActiveItem) {
1166 emit moveTodoSignal((Incidence*)mActiveItem->todo()); 1170 emit moveTodoSignal((Incidence*)mActiveItem->todo());
1167 } 1171 }
1168} 1172}
1169void KOTodoView::beamTodo() 1173void KOTodoView::beamTodo()
1170{ 1174{
1171 if (mActiveItem) { 1175 if (mActiveItem) {
1172 emit beamTodoSignal((Incidence*)mActiveItem->todo()); 1176 emit beamTodoSignal((Incidence*)mActiveItem->todo());
1173 } 1177 }
1174} 1178}
1175 1179
1176 1180
1177void KOTodoView::showTodo() 1181void KOTodoView::showTodo()
1178{ 1182{
1179 if (mActiveItem) { 1183 if (mActiveItem) {
1180 emit showTodoSignal(mActiveItem->todo()); 1184 emit showTodoSignal(mActiveItem->todo());
1181 } 1185 }
1182} 1186}
1183 1187
1184void KOTodoView::deleteTodo() 1188void KOTodoView::deleteTodo()
1185{ 1189{
1186 if (mActiveItem) { 1190 if (mActiveItem) {
1187 emit deleteTodoSignal(mActiveItem->todo()); 1191 emit deleteTodoSignal(mActiveItem->todo());
1188 } 1192 }
1189} 1193}
1190 1194
1191void KOTodoView::setNewPriority(int index) 1195void KOTodoView::setNewPriority(int index)
1192{ 1196{
1193 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1197 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1194 mActiveItem->todo()->setPriority(mPriority[index]); 1198 mActiveItem->todo()->setPriority(mPriority[index]);
1195 mActiveItem->construct(); 1199 mActiveItem->construct();
1196 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); 1200 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED);
1197 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1201 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1198 } 1202 }
1199 processSelectionChange(); 1203 processSelectionChange();
1200} 1204}
1201 1205
1202void KOTodoView::setNewPercentage(int index) 1206void KOTodoView::setNewPercentage(int index)
1203{ 1207{
1204 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1208 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1205 1209
1206 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { 1210 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) {
1207 mActiveItem->setOn( true ); 1211 mActiveItem->setOn( true );
1208 processSelectionChange(); 1212 processSelectionChange();
1209 return; 1213 return;
1210 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { 1214 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) {
1211 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); 1215 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent()));
1212 if ( par && par->isOn() ) 1216 if ( par && par->isOn() )
1213 par->setOn( false ); 1217 par->setOn( false );
1214 } 1218 }
1215 if (mPercentage[index] == 100) { 1219 if (mPercentage[index] == 100) {
1216 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); 1220 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime());
1217 } else { 1221 } else {
1218 mActiveItem->todo()->setCompleted(false); 1222 mActiveItem->todo()->setCompleted(false);
1219 } 1223 }
1220 mActiveItem->todo()->setPercentComplete(mPercentage[index]); 1224 mActiveItem->todo()->setPercentComplete(mPercentage[index]);
1221 mActiveItem->construct(); 1225 mActiveItem->construct();
1222 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); 1226 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED);
1223 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1227 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1224 } 1228 }
1225 processSelectionChange(); 1229 processSelectionChange();
1226} 1230}
1227 1231
1228void KOTodoView::fillCategories () 1232void KOTodoView::fillCategories ()
1229{ 1233{
1230 mCategoryPopupMenu->clear(); 1234 mCategoryPopupMenu->clear();
1231 if ( ! mActiveItem ) return; 1235 if ( ! mActiveItem ) return;
1232 QStringList checkedCategories = mActiveItem->todo()->categories (); 1236 QStringList checkedCategories = mActiveItem->todo()->categories ();
1233 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 1237 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
1234 it != KOPrefs::instance()->mCustomCategories.end (); 1238 it != KOPrefs::instance()->mCustomCategories.end ();
1235 ++it) { 1239 ++it) {
1236 int index = mCategoryPopupMenu->insertItem (*it); 1240 int index = mCategoryPopupMenu->insertItem (*it);
1237 mCategory[index] = *it; 1241 mCategory[index] = *it;
1238 if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); 1242 if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true);
1239 } 1243 }
1240} 1244}
1241void KOTodoView::fillCal () 1245void KOTodoView::fillCal ()
1242{ 1246{
1243 mCalPopupMenu->clear(); 1247 mCalPopupMenu->clear();
1244 if (!mActiveItem) return; 1248 if (!mActiveItem) return;
1245 bool readO = mActiveItem->todo()->isReadOnly(); 1249 bool readO = mActiveItem->todo()->isReadOnly();
1246 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 1250 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
1247 while ( kkf ) { 1251 while ( kkf ) {
1248 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); 1252 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber);
1249 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) 1253 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
1250 mCalPopupMenu->setItemEnabled( index, false ); 1254 mCalPopupMenu->setItemEnabled( index, false );
1251 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID()); 1255 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID());
1252 kkf = KOPrefs::instance()->mCalendars.next(); 1256 kkf = KOPrefs::instance()->mCalendars.next();
1253 } 1257 }
1254} 1258}
1255void KOTodoView::changedCal (int index ) 1259void KOTodoView::changedCal (int index )
1256{ 1260{
1257 if (!mActiveItem) return; 1261 if (!mActiveItem) return;
1258 mActiveItem->todo()->setCalID( index ); 1262 mActiveItem->todo()->setCalID( index );
1259 mActiveItem->construct(); 1263 mActiveItem->construct();
1260} 1264}
1261void KOTodoView::changedCategories(int index) 1265void KOTodoView::changedCategories(int index)
1262{ 1266{
1263 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1267 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1264 QStringList categories = mActiveItem->todo()->categories (); 1268 QStringList categories = mActiveItem->todo()->categories ();
1265 QString colcat = categories.first(); 1269 QString colcat = categories.first();
1266 if (categories.find (mCategory[index]) != categories.end ()) 1270 if (categories.find (mCategory[index]) != categories.end ())
1267 categories.remove (mCategory[index]); 1271 categories.remove (mCategory[index]);
1268 else 1272 else
1269 categories.insert (categories.end(), mCategory[index]); 1273 categories.insert (categories.end(), mCategory[index]);
1270 categories.sort (); 1274 categories.sort ();
1271 if ( !colcat.isEmpty() ) { 1275 if ( !colcat.isEmpty() ) {
1272 if ( categories.find ( colcat ) != categories.end () ) { 1276 if ( categories.find ( colcat ) != categories.end () ) {
1273 categories.remove( colcat ); 1277 categories.remove( colcat );
1274 categories.prepend( colcat ); 1278 categories.prepend( colcat );
1275 } 1279 }
1276 } 1280 }
1277 mActiveItem->todo()->setCategories (categories); 1281 mActiveItem->todo()->setCategories (categories);
1278 mActiveItem->construct(); 1282 mActiveItem->construct();
1279 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1283 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1280 todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); 1284 todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED);
1281 } 1285 }
1282} 1286}
1283void KOTodoView::itemDoubleClicked(QListViewItem *item) 1287void KOTodoView::itemDoubleClicked(QListViewItem *item)
1284{ 1288{
1285 if ( pendingSubtodo != 0 ) { 1289 if ( pendingSubtodo != 0 ) {
1286 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1290 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1287 } 1291 }
1288 pendingSubtodo = 0; 1292 pendingSubtodo = 0;
1289 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); 1293 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() );
1290 int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); 1294 int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() );
1291 //qDebug("ROW %d ", row); 1295 //qDebug("ROW %d ", row);
1292 if (!item) { 1296 if (!item) {
1293 newTodo(); 1297 newTodo();
1294 return; 1298 return;
1295 } else { 1299 } else {
1296 if ( row == 1 ) { 1300 if ( row == 1 ) {
1297 mActiveItem = (KOTodoViewItem *) item; 1301 mActiveItem = (KOTodoViewItem *) item;
1298 newSubTodo(); 1302 newSubTodo();
1299 return; 1303 return;
1300 } 1304 }
1301 if ( row == 5 || row == 6 || row == 2) { 1305 if ( row == 5 || row == 6 || row == 2) {
1302 mActiveItem = (KOTodoViewItem *) item; 1306 mActiveItem = (KOTodoViewItem *) item;
1303 Todo * t = mActiveItem->todo(); 1307 Todo * t = mActiveItem->todo();
1304 if ( t->isRunning() ) { 1308 if ( t->isRunning() ) {
1305 if ( t->runTime() < 15) { 1309 if ( t->runTime() < 15) {
1306 t->stopRunning(); 1310 t->stopRunning();
1307 mActiveItem->construct(); 1311 mActiveItem->construct();
1308 topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); 1312 topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!"));
1309 return; 1313 return;
1310 } 1314 }
1311 else 1315 else
1312 toggleRunningItem(); 1316 toggleRunningItem();
1313 return; 1317 return;
1314 } else { 1318 } else {
1315 t->setRunning( true ); 1319 t->setRunning( true );
1316 mActiveItem->construct(); 1320 mActiveItem->construct();
1317 topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); 1321 topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!"));
1318 return; 1322 return;
1319 } 1323 }
1320 } 1324 }
1321 } 1325 }
1322 if ( KOPrefs::instance()->mEditOnDoubleClick ) 1326 if ( KOPrefs::instance()->mEditOnDoubleClick )
1323 editItem( item ); 1327 editItem( item );
1324 else 1328 else
1325 showItem( item , QPoint(), 0 ); 1329 showItem( item , QPoint(), 0 );
1326} 1330}
1327void KOTodoView::toggleRunningItem() 1331void KOTodoView::toggleRunningItem()
1328{ 1332{
1329 // qDebug("KOTodoView::toggleRunning() "); 1333 // qDebug("KOTodoView::toggleRunning() ");
1330 if ( ! mActiveItem ) 1334 if ( ! mActiveItem )
1331 return; 1335 return;
1332 Todo * t = mActiveItem->todo(); 1336 Todo * t = mActiveItem->todo();
1333 if ( t->isRunning() ) { 1337 if ( t->isRunning() ) {
1334 KOStopTodoPrefs tp ( t, this ); 1338 KOStopTodoPrefs tp ( t, this );
1335 if (QApplication::desktop()->width() <= 800 ){ 1339 if (QApplication::desktop()->width() <= 800 ){
1336 int wid = tp.width(); 1340 int wid = tp.width();
1337 int hei = tp.height(); 1341 int hei = tp.height();
1338 int xx = (QApplication::desktop()->width()-wid)/2; 1342 int xx = (QApplication::desktop()->width()-wid)/2;
1339 int yy = (QApplication::desktop()->height()-hei)/2; 1343 int yy = (QApplication::desktop()->height()-hei)/2;
1340 tp.setGeometry( xx,yy,wid,hei ); 1344 tp.setGeometry( xx,yy,wid,hei );
1341 } 1345 }
1342 tp.exec(); 1346 tp.exec();
1343 mActiveItem->construct(); 1347 mActiveItem->construct();
1344 } else { 1348 } else {
1345 KOStartTodoPrefs tp ( t->summary(), this ); 1349 KOStartTodoPrefs tp ( t->summary(), this );
1346 if (QApplication::desktop()->width() <= 800 ){ 1350 if (QApplication::desktop()->width() <= 800 ){
1347 int wid = tp.width(); 1351 int wid = tp.width();
1348 int hei = tp.height(); 1352 int hei = tp.height();
1349 int xx = (QApplication::desktop()->width()-wid)/2; 1353 int xx = (QApplication::desktop()->width()-wid)/2;
1350 int yy = (QApplication::desktop()->height()-hei)/2; 1354 int yy = (QApplication::desktop()->height()-hei)/2;
1351 tp.setGeometry( xx,yy,wid,hei ); 1355 tp.setGeometry( xx,yy,wid,hei );
1352 } 1356 }
1353 if ( !tp.exec() ) return; 1357 if ( !tp.exec() ) return;
1354 if ( tp.stopAll() ) { 1358 if ( tp.stopAll() ) {
1355 mCalendar->stopAllTodos(); 1359 mCalendar->stopAllTodos();
1356 t->setRunning( true ); 1360 t->setRunning( true );
1357 updateView(); 1361 updateView();
1358 } else { 1362 } else {
1359 t->setRunning( true ); 1363 t->setRunning( true );
1360 mActiveItem->construct(); 1364 mActiveItem->construct();
1361 } 1365 }
1362 } 1366 }
1363} 1367}
1364 1368
1365void KOTodoView::itemClicked(QListViewItem *item) 1369void KOTodoView::itemClicked(QListViewItem *item)
1366{ 1370{
1367 //qDebug("KOTodoView::itemClicked %d", item); 1371 //qDebug("KOTodoView::itemClicked %d", item);
1368 if (!item) { 1372 if (!item) {
1369 if ( pendingSubtodo != 0 ) { 1373 if ( pendingSubtodo != 0 ) {
1370 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1374 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1371 } 1375 }
1372 pendingSubtodo = 0; 1376 pendingSubtodo = 0;
1373 return; 1377 return;
1374 } 1378 }
1375 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1379 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1376 if ( pendingSubtodo != 0 ) { 1380 if ( pendingSubtodo != 0 ) {
1377 bool allowReparent = true; 1381 bool allowReparent = true;
1378 QListViewItem *par = item; 1382 QListViewItem *par = item;
1379 while ( par ) { 1383 while ( par ) {
1380 if ( par == pendingSubtodo ) { 1384 if ( par == pendingSubtodo ) {
1381 allowReparent = false; 1385 allowReparent = false;
1382 break; 1386 break;
1383 } 1387 }
1384 par = par->parent(); 1388 par = par->parent();
1385 } 1389 }
1386 if ( !allowReparent ) { 1390 if ( !allowReparent ) {
1387 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); 1391 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
1388 pendingSubtodo = 0; 1392 pendingSubtodo = 0;
1389 } else { 1393 } else {
1390 Todo* newParent = todoItem->todo(); 1394 Todo* newParent = todoItem->todo();
1391 Todo* newSub = pendingSubtodo->todo(); 1395 Todo* newSub = pendingSubtodo->todo();
1392 pendingSubtodo = 0; 1396 pendingSubtodo = 0;
1393 emit reparentTodoSignal( newParent,newSub ); 1397 emit reparentTodoSignal( newParent,newSub );
1394 return; 1398 return;
1395 } 1399 }
1396 } 1400 }
1397 1401
1398} 1402}
1399 1403
1400void KOTodoView::setDocumentId( const QString &id ) 1404void KOTodoView::setDocumentId( const QString &id )
1401{ 1405{
1402 1406
1403 mDocPrefs->setDoc( id ); 1407 mDocPrefs->setDoc( id );
1404} 1408}
1405 1409
1406void KOTodoView::itemStateChanged( QListViewItem *item ) 1410void KOTodoView::itemStateChanged( QListViewItem *item )
1407{ 1411{
1408 if (!item) return; 1412 if (!item) return;
1409 1413
1410 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1414 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1411 1415
1412// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; 1416// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
1413 1417
1414 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); 1418 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
1415} 1419}
1416 1420
1417void KOTodoView::saveLayout(KConfig *config, const QString &group) const 1421void KOTodoView::saveLayout(KConfig *config, const QString &group) const
1418{ 1422{
1419 mTodoListView->saveLayout(config,group); 1423 mTodoListView->saveLayout(config,group);
1420} 1424}
1421 1425
1422void KOTodoView::restoreLayout(KConfig *config, const QString &group) 1426void KOTodoView::restoreLayout(KConfig *config, const QString &group)
1423{ 1427{
1424 mTodoListView->restoreLayout(config,group); 1428 mTodoListView->restoreLayout(config,group);
1425} 1429}
1426 1430
1427void KOTodoView::processSelectionChange() 1431void KOTodoView::processSelectionChange()
1428{ 1432{
1429// kdDebug() << "KOTodoView::processSelectionChange()" << endl; 1433// kdDebug() << "KOTodoView::processSelectionChange()" << endl;
1430 1434
1431 KOTodoViewItem *item = 1435 KOTodoViewItem *item =
1432 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); 1436 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() );
1433 1437
1434 if ( !item ) { 1438 if ( !item ) {
1435 emit incidenceSelected( 0 ); 1439 emit incidenceSelected( 0 );
1436 mNewSubBut->setEnabled( false ); 1440 mNewSubBut->setEnabled( false );
1437 } else { 1441 } else {
1438 emit incidenceSelected( item->todo() ); 1442 emit incidenceSelected( item->todo() );
1439 mNewSubBut->setEnabled( true ); 1443 mNewSubBut->setEnabled( true );
1440 } 1444 }
1441} 1445}
1442 1446
1443void KOTodoView::modified(bool b) 1447void KOTodoView::modified(bool b)
1444{ 1448{
1445 emit isModified(b); 1449 emit isModified(b);
1446} 1450}
1447void KOTodoView::setTodoModified( Todo* todo ) 1451void KOTodoView::setTodoModified( Todo* todo )
1448{ 1452{
1449 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); 1453 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED );
1450} 1454}
1451void KOTodoView::clearSelection() 1455void KOTodoView::clearSelection()
1452{ 1456{
1453 mTodoListView->selectAll( false ); 1457 mTodoListView->selectAll( false );
1454} 1458}
1455void KOTodoView::setAllOpen() 1459void KOTodoView::setAllOpen()
1456{ 1460{
1457 if ( isFlatDisplay ) { 1461 if ( isFlatDisplay ) {
1458 isFlatDisplay = false; 1462 isFlatDisplay = false;
1459 mPopupMenu->setItemChecked( 8,false ); 1463 mPopupMenu->setItemChecked( 8,false );
1460 updateView(); 1464 updateView();
1461 } else { 1465 } else {
1462 storeCurrentItem(); 1466 storeCurrentItem();
1463 } 1467 }
1464 setOpen(mTodoListView->firstChild(), true); 1468 setOpen(mTodoListView->firstChild(), true);
1465 resetCurrentItem(); 1469 resetCurrentItem();
1466} 1470}
1467void KOTodoView::setAllClose() 1471void KOTodoView::setAllClose()
1468{ 1472{
1469 if ( isFlatDisplay ) { 1473 if ( isFlatDisplay ) {
1470 isFlatDisplay = false; 1474 isFlatDisplay = false;
1471 mPopupMenu->setItemChecked( 8,false ); 1475 mPopupMenu->setItemChecked( 8,false );
1472 updateView(); 1476 updateView();
1473 } else { 1477 } else {
1474 storeCurrentItem(); 1478 storeCurrentItem();
1475 } 1479 }
1476 setOpen(mTodoListView->firstChild(), false); 1480 setOpen(mTodoListView->firstChild(), false);
1477 resetCurrentItem(); 1481 resetCurrentItem();
1478} 1482}
1479void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) 1483void KOTodoView::setOpen( QListViewItem* item, bool setOpenI)
1480{ 1484{
1481 1485
1482 while ( item ) { 1486 while ( item ) {
1483 setOpen( item->firstChild(), setOpenI ); 1487 setOpen( item->firstChild(), setOpenI );
1484 item->setOpen( setOpenI ); 1488 item->setOpen( setOpenI );
1485 item = item->nextSibling(); 1489 item = item->nextSibling();
1486 } 1490 }
1487} 1491}
1488 1492
1489void KOTodoView::displayAllFlat() 1493void KOTodoView::displayAllFlat()
1490{ 1494{
1491 storeCurrentItem(); 1495 storeCurrentItem();
1492 pendingSubtodo = 0; 1496 pendingSubtodo = 0;
1493 if ( mBlockUpdate ) { 1497 if ( mBlockUpdate ) {
1494 return; 1498 return;
1495 } 1499 }
1496 mPopupMenu->setItemChecked( 8,true ); 1500 mPopupMenu->setItemChecked( 8,true );
1497 isFlatDisplay = true; 1501 isFlatDisplay = true;
1498 QPtrList<Todo> todoList = calendar()->todos(); 1502 QPtrList<Todo> todoList = calendar()->todos();
1499 mTodoMap.clear(); 1503 mTodoMap.clear();
1500 mTodoListView->clear(); 1504 mTodoListView->clear();
1501 Todo *todo; 1505 Todo *todo;
1502 for(todo = todoList.first(); todo; todo = todoList.next()) { 1506 for(todo = todoList.first(); todo; todo = todoList.next()) {
1503 if ( checkTodo( todo ) ) { 1507 if ( checkTodo( todo ) ) {
1504 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1508 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1505 mTodoMap.insert(todo,todoItem); 1509 mTodoMap.insert(todo,todoItem);
1506 } 1510 }
1507 } 1511 }
1508 resetCurrentItem(); 1512 resetCurrentItem();
1509} 1513}
1510 1514
1511void KOTodoView::setAllFlat() 1515void KOTodoView::setAllFlat()
1512{ 1516{
1513 if ( isFlatDisplay ) { 1517 if ( isFlatDisplay ) {
1514 isFlatDisplay = false; 1518 isFlatDisplay = false;
1515 mPopupMenu->setItemChecked( 8,false ); 1519 mPopupMenu->setItemChecked( 8,false );
1516 updateView(); 1520 updateView();
1517 return; 1521 return;
1518 } 1522 }
1519 displayAllFlat(); 1523 displayAllFlat();
1520} 1524}
1521 1525
1522void KOTodoView::purgeCompleted() 1526void KOTodoView::purgeCompleted()
1523{ 1527{
1524 emit purgeCompletedSignal(); 1528 emit purgeCompletedSignal();
1525 1529
1526} 1530}
1527void KOTodoView::toggleQuickTodo() 1531void KOTodoView::toggleQuickTodo()
1528{ 1532{
1529 if ( mQuickBar->isVisible() ) { 1533 if ( mQuickBar->isVisible() ) {
1530 mQuickBar->hide(); 1534 mQuickBar->hide();
1531 KOPrefs::instance()->mEnableQuickTodo = false; 1535 KOPrefs::instance()->mEnableQuickTodo = false;
1532 } 1536 }
1533 else { 1537 else {
1534 mQuickBar->show(); 1538 mQuickBar->show();
1535 KOPrefs::instance()->mEnableQuickTodo = true; 1539 KOPrefs::instance()->mEnableQuickTodo = true;
1536 } 1540 }
1537 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 1541 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
1538 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 1542 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
1539} 1543}
1540 1544
1541void KOTodoView::toggleRunning() 1545void KOTodoView::toggleRunning()
1542{ 1546{
1543 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; 1547 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos;
1544 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 1548 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
1545 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 1549 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
1546 updateView(); 1550 updateView();
1547 if ( KOPrefs::instance()->mHideNonStartedTodos ) 1551 if ( KOPrefs::instance()->mHideNonStartedTodos )
1548 topLevelWidget()->setCaption(i18n("Hide not Running")); 1552 topLevelWidget()->setCaption(i18n("Hide not Running"));
1549 else 1553 else
1550 topLevelWidget()->setCaption(i18n("Show not Running")); 1554 topLevelWidget()->setCaption(i18n("Show not Running"));
1551} 1555}
1552 1556
1553void KOTodoView::toggleCompleted() 1557void KOTodoView::toggleCompleted()
1554{ 1558{
1555 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; 1559 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
1556 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 1560 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
1557 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 1561 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
1558 updateView(); 1562 updateView();
1559 if ( KOPrefs::instance()->mShowCompletedTodo ) 1563 if ( KOPrefs::instance()->mShowCompletedTodo )
1560 topLevelWidget()->setCaption(i18n("Show Completed")); 1564 topLevelWidget()->setCaption(i18n("Show Completed"));
1561 else 1565 else
1562 topLevelWidget()->setCaption(i18n("Hide Completed")); 1566 topLevelWidget()->setCaption(i18n("Hide Completed"));
1563} 1567}
1564 1568
1565void KOTodoView::addQuickTodo() 1569void KOTodoView::addQuickTodo()
1566{ 1570{
1567 addQuickTodoPar( 0 ); 1571 addQuickTodoPar( 0 );
1568} 1572}
1569void KOTodoView::addQuickTodoPar( Todo * parentTodo) 1573void KOTodoView::addQuickTodoPar( Todo * parentTodo)
1570{ 1574{
1571 Todo *todo = new Todo(); 1575 Todo *todo = new Todo();
1572 todo->setSummary(mQuickAdd->text()); 1576 todo->setSummary(mQuickAdd->text());
1573 todo->setOrganizer(KOPrefs::instance()->email()); 1577 todo->setOrganizer(KOPrefs::instance()->email());
1574 if ( parentTodo ) { 1578 if ( parentTodo ) {
1575 todo->setRelatedTo(parentTodo); 1579 todo->setRelatedTo(parentTodo);
1576 1580
1577 todo->setCategories (parentTodo->categoriesStr ()); 1581 todo->setCategories (parentTodo->categoriesStr ());
1578 todo->setSecrecy (parentTodo->secrecy ()); 1582 todo->setSecrecy (parentTodo->secrecy ());
1579 if ( parentTodo->priority() < 3 ) 1583 if ( parentTodo->priority() < 3 )
1580 todo->setPriority( parentTodo->priority() ); 1584 todo->setPriority( parentTodo->priority() );
1581 todo->setCalID( parentTodo->calID() ); 1585 todo->setCalID( parentTodo->calID() );
1582 } else { 1586 } else {
1583 CalFilter * cf = mCalendar->filter(); 1587 CalFilter * cf = mCalendar->filter();
1584 if ( cf ) { 1588 if ( cf ) {
1585 if ( cf->isEnabled()&& cf->showCategories()) { 1589 if ( cf->isEnabled()&& cf->showCategories()) {
1586 todo->setCategories(cf->categoryList()); 1590 todo->setCategories(cf->categoryList());
1587 } 1591 }
1588 if ( cf->isEnabled() ) 1592 if ( cf->isEnabled() )
1589 todo->setSecrecy( cf->getSecrecy()); 1593 todo->setSecrecy( cf->getSecrecy());
1590 } 1594 }
1591 } 1595 }
1592 mCalendar->addTodo(todo); 1596 mCalendar->addTodo(todo);
1593 mQuickAdd->setText(""); 1597 mQuickAdd->setText("");
1594 todoModified (todo, KOGlobals::EVENTADDED ); 1598 todoModified (todo, KOGlobals::EVENTADDED );
1595 updateView(); 1599 updateView();
1596 1600
1597} 1601}
1598void KOTodoView::keyPressEvent ( QKeyEvent * e ) 1602void KOTodoView::keyPressEvent ( QKeyEvent * e )
1599{ 1603{
1600 // e->ignore(); 1604 // e->ignore();
1601 //return; 1605 //return;
1602 //qDebug("KOTodoView::keyPressEvent "); 1606 //qDebug("KOTodoView::keyPressEvent ");
1607 if ( !isVisible() ) {
1608 e->ignore();
1609 return;
1610 }
1603 switch ( e->key() ) { 1611 switch ( e->key() ) {
1604 case Qt::Key_Down: 1612 case Qt::Key_Down:
1605 case Qt::Key_Up: 1613 case Qt::Key_Up:
1606 QWidget::keyPressEvent ( e ); 1614 QWidget::keyPressEvent ( e );
1607 break; 1615 break;
1608 1616
1609 case Qt::Key_Q: 1617 case Qt::Key_Q:
1618
1619
1620 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) {
1621 e->ignore();
1622 break;
1623 }
1610 toggleQuickTodo(); 1624 toggleQuickTodo();
1611 break; 1625 break;
1612 case Qt::Key_U: 1626 case Qt::Key_U:
1613 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1627 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1614 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1628 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1615 unparentTodo(); 1629 unparentTodo();
1616 e->accept(); 1630 e->accept();
1617 } else 1631 } else
1618 e->ignore(); 1632 e->ignore();
1619 break; 1633 break;
1620 case Qt::Key_S: 1634 case Qt::Key_S:
1621 if ( e->state() == Qt::ControlButton ) { 1635 if ( e->state() == Qt::ControlButton ) {
1622 e->ignore(); 1636 e->ignore();
1623 break; 1637 break;
1624 } 1638 }
1625 if ( e->state() == Qt::ShiftButton ) { 1639 if ( e->state() == Qt::ShiftButton ) {
1626 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1640 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1627 reparentTodo(); 1641 reparentTodo();
1628 e->accept(); 1642 e->accept();
1629 } else 1643 } else
1630 e->ignore(); 1644 e->ignore();
1631 break; 1645 break;
1632 case Qt::Key_P: 1646 case Qt::Key_P:
1633 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1647 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1634 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1648 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1635 if ( pendingSubtodo ) 1649 if ( pendingSubtodo )
1636 itemClicked(mActiveItem); 1650 itemClicked(mActiveItem);
1637 e->accept(); 1651 e->accept();
1638 } else 1652 } else
1639 e->ignore(); 1653 e->ignore();
1640 break; 1654 break;
1641 case Qt::Key_Escape: 1655 case Qt::Key_Escape:
1642 if ( pendingSubtodo ) { 1656 if ( pendingSubtodo ) {
1643 itemClicked(0); 1657 itemClicked(0);
1644 e->accept(); 1658 e->accept();
1645 } else 1659 } else
1646 e->ignore(); 1660 e->ignore();
1647 break; 1661 break;
1648 default: 1662 default:
1649 e->ignore(); 1663 e->ignore();
1650 } 1664 }
1651 1665
1652 if ( true ) { 1666 if ( true ) {
1653 if ( e->key() == Qt::Key_I ) { 1667 if ( e->key() == Qt::Key_I ) {
1654 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); 1668 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem();
1655 if ( cn ) { 1669 if ( cn ) {
1656 mActiveItem = cn; 1670 mActiveItem = cn;
1657 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 1671 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
1658 if ( ci ){ 1672 if ( ci ){
1659 showTodo(); 1673 showTodo();
1660 cn = (KOTodoViewItem*)cn->itemBelow(); 1674 cn = (KOTodoViewItem*)cn->itemBelow();
1661 if ( cn ) { 1675 if ( cn ) {
1662 mTodoListView->setCurrentItem ( cn ); 1676 mTodoListView->setCurrentItem ( cn );
1663 mTodoListView->ensureItemVisible ( cn ); 1677 mTodoListView->ensureItemVisible ( cn );
1664 } 1678 }
1665 1679
1666 } 1680 }
1667 } 1681 }
1668 e->accept(); 1682 e->accept();
1669 1683
1670 } 1684 }
1671 1685
1672 } 1686 }
1673 1687
1674} 1688}
1675void KOTodoView::updateTodo( Todo * t, int type ) 1689void KOTodoView::updateTodo( Todo * t, int type )
1676{ 1690{
1677 if ( mBlockUpdate) 1691 if ( mBlockUpdate)
1678 return; 1692 return;
1679 1693
1680 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 1694 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
1681 itemIterator = mTodoMap.find(t); 1695 itemIterator = mTodoMap.find(t);
1682 if (itemIterator != mTodoMap.end()) { 1696 if (itemIterator != mTodoMap.end()) {
1683 (*itemIterator)->construct(); 1697 (*itemIterator)->construct();
1684 } else { 1698 } else {
1685 if ( type == KOGlobals::EVENTADDED ) { 1699 if ( type == KOGlobals::EVENTADDED ) {
1686 insertTodoItem( t ); 1700 insertTodoItem( t );
1687 } 1701 }
1688 } 1702 }
1689 1703
1690} 1704}
1691 1705
1692void KOTodoView::todoModified(Todo * t , int p ) 1706void KOTodoView::todoModified(Todo * t , int p )
1693{ 1707{
1694 mBlockUpdate = true; 1708 mBlockUpdate = true;
1695 emit todoModifiedSignal ( t, p ); 1709 emit todoModifiedSignal ( t, p );
1696 mBlockUpdate = false; 1710 mBlockUpdate = false;
1697} 1711}
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index 7cd81fa..235ae55 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -1,223 +1,338 @@
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 "event.h" 25#include "event.h"
26 26
27using namespace KCal; 27using namespace KCal;
28 28
29Event::Event() : 29Event::Event() :
30 mHasEndDate( false ), mTransparency( Opaque ) 30 mHasEndDate( false ), mTransparency( Opaque )
31{ 31{
32} 32}
33 33
34Event::Event(const Event &e) : Incidence(e) 34Event::Event(const Event &e) : Incidence(e)
35{ 35{
36 mDtEnd = e.mDtEnd; 36 mDtEnd = e.mDtEnd;
37 mHasEndDate = e.mHasEndDate; 37 mHasEndDate = e.mHasEndDate;
38 mTransparency = e.mTransparency; 38 mTransparency = e.mTransparency;
39} 39}
40 40
41Event::~Event() 41Event::~Event()
42{ 42{
43} 43}
44 44
45Incidence *Event::clone() 45Incidence *Event::clone()
46{ 46{
47 return new Event(*this); 47 return new Event(*this);
48} 48}
49 49
50bool KCal::operator==( const Event& e1, const Event& e2 ) 50bool KCal::operator==( const Event& e1, const Event& e2 )
51{ 51{
52 return operator==( (const Incidence&)e1, (const Incidence&)e2 ) && 52 return operator==( (const Incidence&)e1, (const Incidence&)e2 ) &&
53 e1.dtEnd() == e2.dtEnd() && 53 e1.dtEnd() == e2.dtEnd() &&
54 e1.hasEndDate() == e2.hasEndDate() && 54 e1.hasEndDate() == e2.hasEndDate() &&
55 e1.transparency() == e2.transparency(); 55 e1.transparency() == e2.transparency();
56} 56}
57 57
58 58
59bool Event::contains ( Event* from ) 59bool Event::contains ( Event* from )
60{ 60{
61 61
62 if ( !from->summary().isEmpty() ) 62 if ( !from->summary().isEmpty() )
63 if ( !summary().startsWith( from->summary() )) 63 if ( !summary().startsWith( from->summary() ))
64 return false; 64 return false;
65 if ( from->dtStart().isValid() ) 65 if ( from->dtStart().isValid() )
66 if (dtStart() != from->dtStart() ) 66 if (dtStart() != from->dtStart() )
67 return false; 67 return false;
68 if ( from->dtEnd().isValid() ) 68 if ( from->dtEnd().isValid() )
69 if ( dtEnd() != from->dtEnd() ) 69 if ( dtEnd() != from->dtEnd() )
70 return false; 70 return false;
71 if ( !from->location().isEmpty() ) 71 if ( !from->location().isEmpty() )
72 if ( !location().startsWith( from->location() ) ) 72 if ( !location().startsWith( from->location() ) )
73 return false; 73 return false;
74 if ( !from->description().isEmpty() ) 74 if ( !from->description().isEmpty() )
75 if ( !description().startsWith( from->description() )) 75 if ( !description().startsWith( from->description() ))
76 return false; 76 return false;
77 if ( from->alarms().count() ) { 77 if ( from->alarms().count() ) {
78 Alarm *a = from->alarms().first(); 78 Alarm *a = from->alarms().first();
79 if ( a->enabled() ){ 79 if ( a->enabled() ){
80 if ( !alarms().count() ) 80 if ( !alarms().count() )
81 return false; 81 return false;
82 Alarm *b = alarms().first(); 82 Alarm *b = alarms().first();
83 if( ! b->enabled() ) 83 if( ! b->enabled() )
84 return false; 84 return false;
85 if ( ! (a->offset() == b->offset() )) 85 if ( ! (a->offset() == b->offset() ))
86 return false; 86 return false;
87 } 87 }
88 } 88 }
89 QStringList cat = categories(); 89 QStringList cat = categories();
90 QStringList catFrom = from->categories(); 90 QStringList catFrom = from->categories();
91 QString nCat; 91 QString nCat;
92 unsigned int iii; 92 unsigned int iii;
93 for ( iii = 0; iii < catFrom.count();++iii ) { 93 for ( iii = 0; iii < catFrom.count();++iii ) {
94 nCat = catFrom[iii]; 94 nCat = catFrom[iii];
95 if ( !nCat.isEmpty() ) 95 if ( !nCat.isEmpty() )
96 if ( !cat.contains( nCat )) { 96 if ( !cat.contains( nCat )) {
97 return false; 97 return false;
98 } 98 }
99 } 99 }
100 if ( from->doesRecur() ) 100 if ( from->doesRecur() )
101 if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) 101 if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) )
102 return false; 102 return false;
103 return true; 103 return true;
104} 104}
105 105
106void Event::setDtEnd(const QDateTime &dtEnd) 106void Event::setDtEnd(const QDateTime &dtEnd)
107{ 107{
108 if (mReadOnly) return; 108 if (mReadOnly) return;
109 109
110 mDtEnd = getEvenTime( dtEnd ); 110 mDtEnd = getEvenTime( dtEnd );
111 111
112 setHasEndDate(true); 112 setHasEndDate(true);
113 setHasDuration(false); 113 setHasDuration(false);
114 114
115 updated(); 115 updated();
116} 116}
117 117
118QDateTime Event::dtEnd() const 118QDateTime Event::dtEnd() const
119{ 119{
120 if (hasEndDate()) return mDtEnd; 120 if (hasEndDate()) return mDtEnd;
121 if (hasDuration()) return dtStart().addSecs(duration()); 121 if (hasDuration()) return dtStart().addSecs(duration());
122 122
123 return dtStart(); 123 return dtStart();
124} 124}
125 125
126QString Event::dtEndTimeStr() const 126QString Event::dtEndTimeStr() const
127{ 127{
128 return KGlobal::locale()->formatTime(mDtEnd.time()); 128 return KGlobal::locale()->formatTime(mDtEnd.time());
129} 129}
130 130
131QString Event::dtEndDateStr(bool shortfmt) const 131QString Event::dtEndDateStr(bool shortfmt) const
132{ 132{
133 return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); 133 return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt);
134} 134}
135 135
136QString Event::dtEndStr(bool shortfmt) const 136QString Event::dtEndStr(bool shortfmt) const
137{ 137{
138 return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); 138 return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt);
139} 139}
140 140
141void Event::setHasEndDate(bool b) 141void Event::setHasEndDate(bool b)
142{ 142{
143 mHasEndDate = b; 143 mHasEndDate = b;
144} 144}
145 145
146bool Event::hasEndDate() const 146bool Event::hasEndDate() const
147{ 147{
148 return mHasEndDate; 148 return mHasEndDate;
149} 149}
150 150
151bool Event::isMultiDay() const 151bool Event::isMultiDay() const
152{ 152{
153 bool multi = !(dtStart().date() == dtEnd().date()); 153 bool multi = !(dtStart().date() == dtEnd().date());
154 return multi; 154 return multi;
155} 155}
156 156
157void Event::setTransparency(Event::Transparency transparency) 157void Event::setTransparency(Event::Transparency transparency)
158{ 158{
159 if (mReadOnly) return; 159 if (mReadOnly) return;
160 mTransparency = transparency; 160 mTransparency = transparency;
161 updated(); 161 updated();
162} 162}
163 163
164Event::Transparency Event::transparency() const 164Event::Transparency Event::transparency() const
165{ 165{
166 return mTransparency; 166 return mTransparency;
167} 167}
168 168
169void Event::setDuration(int seconds) 169void Event::setDuration(int seconds)
170{ 170{
171 setHasEndDate(false); 171 setHasEndDate(false);
172 Incidence::setDuration(seconds); 172 Incidence::setDuration(seconds);
173} 173}
174bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, bool inFutureOnly )
175{
176 if ( testEvent == this )
177 return false;
178 if ( ! doesRecur() && !testEvent->doesRecur() ) {
179 QDateTime te;
180 if ( testEvent->doesFloat() )
181 te = testEvent->mDtEnd.addDays( 1 );
182 else
183 te = testEvent->mDtEnd;
184 QDateTime e;
185 if ( doesFloat() )
186 e = mDtEnd.addDays( 1 );
187 else
188 e = mDtEnd;
189 if ( mDtStart < te && testEvent->mDtStart < e ) {
190 if ( mDtStart < testEvent->mDtStart )
191 *overlapDT = testEvent->mDtStart;
192 else
193 *overlapDT = mDtStart;
194 if ( inFutureOnly )
195 return (*overlapDT >= QDateTime::currentDateTime() );
196 return true;
197 }
198 return false;
199 }
200 Event *nonRecur = 0;
201 Event *recurEvent = 0;
202 if ( ! doesRecur() ) {
203 nonRecur = this;
204 recurEvent = testEvent;
205 }
206 else if ( !testEvent->doesRecur() ) {
207 nonRecur = testEvent;
208 recurEvent = this;
209 }
210 if ( nonRecur ) {
211 QDateTime enr;
212 if ( nonRecur->doesFloat() )
213 enr = nonRecur->mDtEnd.addDays( 1 );
214 else
215 enr = nonRecur->mDtEnd;
216 if ( enr < recurEvent->mDtStart )
217 return false;
218 if ( inFutureOnly && enr < QDateTime::currentDateTime() )
219 return false;
220 int recDuration = recurEvent->mDtStart.secsTo( recurEvent->mDtEnd );
221 if ( recurEvent->doesFloat() )
222 recDuration += 86400;
223 bool ok = true;
224 QDateTime recStart = recurEvent->mDtStart.addSecs( -300);;
225 while ( ok ) {
226 recStart = recurEvent->getNextOccurence( recStart.addSecs( 60 ), &ok );
227 if ( ok ) {
228 if ( recStart > enr )
229 return false;
230 QDateTime recEnd = recStart.addSecs( recDuration );
231 if ( nonRecur->mDtStart < recEnd && recStart < nonRecur->mDtEnd ) {
232 if ( nonRecur->mDtStart < recStart )
233 *overlapDT = recStart;
234 else
235 *overlapDT = nonRecur->mDtStart;
236 if ( inFutureOnly ) {
237 if ( *overlapDT >= QDateTime::currentDateTime() )
238 return true;
239 } else
240 return true;
241 }
242 }
243 }
244 return false;
245 }
246
247 QDateTime incidenceStart = mDtStart;
248 int duration = mDtStart.secsTo( mDtEnd );
249 if ( doesFloat() )
250 duration += 86400;
251 QDateTime testincidenceStart = testEvent->mDtStart;
252 int testduration = testEvent->mDtStart.secsTo( testEvent->mDtEnd );
253 if ( testEvent->doesFloat() )
254 testduration += 86400;
255 bool computeThis = false;
256 if ( incidenceStart < testincidenceStart )
257 computeThis = true;
258 bool ok = true;
259 if ( computeThis )
260 incidenceStart = incidenceStart.addSecs( -300 );
261 else
262 testincidenceStart = testincidenceStart.addSecs( -300 );
263 int count = 0;
264 while ( ok ) {
265 ++count;
266 if ( count > 1000 ) break;
267 if ( computeThis )
268 incidenceStart = getNextOccurence( incidenceStart.addSecs( 60 ), &ok );
269 else
270 testincidenceStart = testEvent->getNextOccurence( testincidenceStart.addSecs( 60 ), &ok );
271 if ( ok ) {
272 if ( incidenceStart < testincidenceStart.addSecs( testduration ) && testincidenceStart < incidenceStart.addSecs( duration ) ) {
273 if ( incidenceStart < testincidenceStart )
274 *overlapDT = testincidenceStart;
275 else
276 *overlapDT = incidenceStart;
277 if ( inFutureOnly ) {
278 if ( *overlapDT >= QDateTime::currentDateTime() )
279 return true;
280 } else
281 return true;
282 }
283 computeThis = ( incidenceStart < testincidenceStart );
284 }
285
286 }
287 return false;
288}
174QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const 289QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset, QDateTime start_dt ) const
175{ 290{
176 *ok = false; 291 *ok = false;
177 if ( !alarmEnabled() ) 292 if ( !alarmEnabled() )
178 return QDateTime (); 293 return QDateTime ();
179 bool yes; 294 bool yes;
180 QDateTime incidenceStart = getNextOccurence( start_dt, &yes ); 295 QDateTime incidenceStart = getNextOccurence( start_dt, &yes );
181 if ( ! yes || cancelled() ) { 296 if ( ! yes || cancelled() ) {
182 *ok = false; 297 *ok = false;
183 return QDateTime (); 298 return QDateTime ();
184 } 299 }
185 300
186 bool enabled = false; 301 bool enabled = false;
187 Alarm* alarm; 302 Alarm* alarm;
188 int off = 0; 303 int off = 0;
189 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; 304 QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );;
190 // if ( QDateTime::currentDateTime() > incidenceStart ){ 305 // if ( QDateTime::currentDateTime() > incidenceStart ){
191// *ok = false; 306// *ok = false;
192// return incidenceStart; 307// return incidenceStart;
193// } 308// }
194 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { 309 for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) {
195 if (alarm->enabled()) { 310 if (alarm->enabled()) {
196 if ( alarm->hasTime () ) { 311 if ( alarm->hasTime () ) {
197 if ( alarm->time() < alarmStart ) { 312 if ( alarm->time() < alarmStart ) {
198 alarmStart = alarm->time(); 313 alarmStart = alarm->time();
199 enabled = true; 314 enabled = true;
200 off = alarmStart.secsTo( incidenceStart ); 315 off = alarmStart.secsTo( incidenceStart );
201 } 316 }
202 317
203 } else { 318 } else {
204 int secs = alarm->startOffset().asSeconds(); 319 int secs = alarm->startOffset().asSeconds();
205 if ( incidenceStart.addSecs( secs ) < alarmStart ) { 320 if ( incidenceStart.addSecs( secs ) < alarmStart ) {
206 alarmStart = incidenceStart.addSecs( secs ); 321 alarmStart = incidenceStart.addSecs( secs );
207 enabled = true; 322 enabled = true;
208 off = -secs; 323 off = -secs;
209 } 324 }
210 } 325 }
211 } 326 }
212 } 327 }
213 if ( enabled ) { 328 if ( enabled ) {
214 if ( alarmStart > start_dt ) { 329 if ( alarmStart > start_dt ) {
215 *ok = true; 330 *ok = true;
216 * offset = off; 331 * offset = off;
217 return alarmStart; 332 return alarmStart;
218 } 333 }
219 } 334 }
220 *ok = false; 335 *ok = false;
221 return QDateTime (); 336 return QDateTime ();
222 337
223} 338}
diff --git a/libkcal/event.h b/libkcal/event.h
index 287d403..80c11c4 100644
--- a/libkcal/event.h
+++ b/libkcal/event.h
@@ -1,91 +1,93 @@
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#ifndef EVENT_H 21#ifndef EVENT_H
22#define EVENT_H 22#define EVENT_H
23// 23//
24// Event component, representing a VEVENT object 24// Event component, representing a VEVENT object
25// 25//
26 26
27#include "incidence.h" 27#include "incidence.h"
28namespace KCal { 28namespace KCal {
29 29
30/** 30/**
31 This class provides an Event in the sense of RFC2445. 31 This class provides an Event in the sense of RFC2445.
32*/ 32*/
33class Event : public Incidence 33class Event : public Incidence
34{ 34{
35 public: 35 public:
36 enum Transparency { Opaque, Transparent }; 36 enum Transparency { Opaque, Transparent };
37 typedef ListBase<Event> List; 37 typedef ListBase<Event> List;
38 Event(); 38 Event();
39 Event(const Event &); 39 Event(const Event &);
40 ~Event(); 40 ~Event();
41 41
42 QCString type() const { return "Event"; } 42 QCString type() const { return "Event"; }
43 IncTypeID typeID() const { return eventID; } 43 IncTypeID typeID() const { return eventID; }
44 44
45 Incidence *clone(); 45 Incidence *clone();
46 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const; 46 QDateTime getNextAlarmDateTime( bool * ok, int * offset ,QDateTime start_dt ) const;
47 47
48 /** for setting an event's ending date/time with a QDateTime. */ 48 /** for setting an event's ending date/time with a QDateTime. */
49 void setDtEnd(const QDateTime &dtEnd); 49 void setDtEnd(const QDateTime &dtEnd);
50 /** Return the event's ending date/time as a QDateTime. */ 50 /** Return the event's ending date/time as a QDateTime. */
51 virtual QDateTime dtEnd() const; 51 virtual QDateTime dtEnd() const;
52 /** returns an event's end time as a string formatted according to the 52 /** returns an event's end time as a string formatted according to the
53 users locale settings */ 53 users locale settings */
54 QString dtEndTimeStr() const; 54 QString dtEndTimeStr() const;
55 /** returns an event's end date as a string formatted according to the 55 /** returns an event's end date as a string formatted according to the
56 users locale settings */ 56 users locale settings */
57 QString dtEndDateStr(bool shortfmt=true) const; 57 QString dtEndDateStr(bool shortfmt=true) const;
58 /** returns an event's end date and time as a string formatted according 58 /** returns an event's end date and time as a string formatted according
59 to the users locale settings */ 59 to the users locale settings */
60 QString dtEndStr(bool shortfmt=true) const; 60 QString dtEndStr(bool shortfmt=true) const;
61 void setHasEndDate(bool); 61 void setHasEndDate(bool);
62 /** Return whether the event has an end date/time. */ 62 /** Return whether the event has an end date/time. */
63 bool hasEndDate() const; 63 bool hasEndDate() const;
64 64
65 /** Return true if the event spans multiple days, otherwise return false. */ 65 /** Return true if the event spans multiple days, otherwise return false. */
66 bool isMultiDay() const; 66 bool isMultiDay() const;
67 67
68 /** set the event's time transparency level. */ 68 /** set the event's time transparency level. */
69 void setTransparency(Transparency transparency); 69 void setTransparency(Transparency transparency);
70 /** get the event's time transparency level. */ 70 /** get the event's time transparency level. */
71 Transparency transparency() const; 71 Transparency transparency() const;
72 72
73 void setDuration(int seconds); 73 void setDuration(int seconds);
74 74
75 bool contains ( Event*); 75 bool contains ( Event*);
76 76
77 bool isOverlapping ( Event*, QDateTime*, bool inFutureOnly );
78
77 private: 79 private:
78 bool accept(Visitor &v) { return v.visit(this); } 80 bool accept(Visitor &v) { return v.visit(this); }
79 81
80 QDateTime mDtEnd; 82 QDateTime mDtEnd;
81 bool mHasEndDate; 83 bool mHasEndDate;
82 Transparency mTransparency; 84 Transparency mTransparency;
83}; 85};
84 86
85bool operator==( const Event&, const Event& ); 87bool operator==( const Event&, const Event& );
86 88
87 89
88} 90}
89 91
90 92
91#endif 93#endif
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp
index 96039df..dcead02 100644
--- a/libkcal/incidencebase.cpp
+++ b/libkcal/incidencebase.cpp
@@ -1,464 +1,472 @@
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 setUid(CalFormat::createUniqueId()); 37 setUid(CalFormat::createUniqueId());
38 mOrganizer = ""; 38 mOrganizer = "";
39 mFloats = false; 39 mFloats = false;
40 mDuration = 0; 40 mDuration = 0;
41 mHasDuration = false; 41 mHasDuration = false;
42 mPilotId = 0; 42 mPilotId = 0;
43 mExternalId = ":"; 43 mExternalId = ":";
44 mTempSyncStat = SYNC_TEMPSTATE_INITIAL; 44 mTempSyncStat = SYNC_TEMPSTATE_INITIAL;
45 mSyncStatus = 0; 45 mSyncStatus = 0;
46 mAttendees.setAutoDelete( true ); 46 mAttendees.setAutoDelete( true );
47 mCalEnabled = true; 47 mCalEnabled = true;
48 mAlarmEnabled = true; 48 mAlarmEnabled = true;
49 mCalID = 0; 49 mCalID = 0;
50} 50}
51 51
52IncidenceBase::IncidenceBase(const IncidenceBase &i) : 52IncidenceBase::IncidenceBase(const IncidenceBase &i) :
53 CustomProperties( i ) 53 CustomProperties( i )
54{ 54{
55 55
56 mReadOnly = i.mReadOnly; 56 mReadOnly = i.mReadOnly;
57 mDtStart = i.mDtStart; 57 mDtStart = i.mDtStart;
58 mDuration = i.mDuration; 58 mDuration = i.mDuration;
59 mHasDuration = i.mHasDuration; 59 mHasDuration = i.mHasDuration;
60 mOrganizer = i.mOrganizer; 60 mOrganizer = i.mOrganizer;
61 mUid = i.mUid; 61 mUid = i.mUid;
62 mCalEnabled = i.mCalEnabled; 62 mCalEnabled = i.mCalEnabled;
63 mAlarmEnabled = i.mAlarmEnabled; 63 mAlarmEnabled = i.mAlarmEnabled;
64 mCalID = i.mCalID; 64 mCalID = i.mCalID;
65 QPtrList<Attendee> attendees = i.attendees(); 65 QPtrList<Attendee> attendees = i.attendees();
66 for( Attendee *a = attendees.first(); a; a = attendees.next() ) { 66 for( Attendee *a = attendees.first(); a; a = attendees.next() ) {
67 mAttendees.append( new Attendee( *a ) ); 67 mAttendees.append( new Attendee( *a ) );
68 } 68 }
69 mFloats = i.mFloats; 69 mFloats = i.mFloats;
70 mLastModified = i.mLastModified; 70 mLastModified = i.mLastModified;
71 mPilotId = i.mPilotId; 71 mPilotId = i.mPilotId;
72 mTempSyncStat = i.mTempSyncStat; 72 mTempSyncStat = i.mTempSyncStat;
73 mSyncStatus = i.mSyncStatus; 73 mSyncStatus = i.mSyncStatus;
74 mExternalId = i.mExternalId; 74 mExternalId = i.mExternalId;
75 // The copied object is a new one, so it isn't observed by the observer 75 // The copied object is a new one, so it isn't observed by the observer
76 // of the original object. 76 // of the original object.
77 mObservers.clear(); 77 mObservers.clear();
78 78
79 mAttendees.setAutoDelete( true ); 79 mAttendees.setAutoDelete( true );
80} 80}
81 81
82IncidenceBase::~IncidenceBase() 82IncidenceBase::~IncidenceBase()
83{ 83{
84} 84}
85 85
86 86
87bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 ) 87bool KCal::operator==( const IncidenceBase& i1, const IncidenceBase& i2 )
88{ 88{
89 // do not compare mSyncStatus and mExternalId 89 // do not compare mSyncStatus and mExternalId
90 if( i1.attendees().count() != i2.attendees().count() ) { 90 if( i1.attendees().count() != i2.attendees().count() ) {
91 return false; // no need to check further 91 return false; // no need to check further
92 } 92 }
93 if ( i1.attendees().count() > 0 ) { 93 if ( i1.attendees().count() > 0 ) {
94 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ; 94 Attendee * a1 = i1.attendees().first(), *a2 =i2.attendees().first() ;
95 while ( a1 ) { 95 while ( a1 ) {
96 if ( !( (*a1) == (*a2)) ) 96 if ( !( (*a1) == (*a2)) )
97 { 97 {
98 //qDebug("Attendee not equal "); 98 //qDebug("Attendee not equal ");
99 return false; 99 return false;
100 } 100 }
101 a1 = i1.attendees().next(); 101 a1 = i1.attendees().next();
102 a2 = i2.attendees().next(); 102 a2 = i2.attendees().next();
103 } 103 }
104 } 104 }
105 //if ( i1.dtStart() != i2.dtStart() ) 105 //if ( i1.dtStart() != i2.dtStart() )
106 // return false; 106 // return false;
107#if 0 107#if 0
108 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() ); 108 qDebug("1 %d ",i1.doesFloat() == i2.doesFloat() );
109 qDebug("1 %d ",i1.duration() == i2.duration() ); 109 qDebug("1 %d ",i1.duration() == i2.duration() );
110 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() ); 110 qDebug("3 %d ",i1.hasDuration() == i2.hasDuration() );
111 qDebug("1 %d ",i1.pilotId() == i2.pilotId() ); 111 qDebug("1 %d ",i1.pilotId() == i2.pilotId() );
112 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() ); 112 qDebug("1 %d %d %d",i1.syncStatus() == i2.syncStatus() , i1.syncStatus(),i2.syncStatus() );
113 qDebug("6 %d ",i1.organizer() == i2.organizer() ); 113 qDebug("6 %d ",i1.organizer() == i2.organizer() );
114 114
115#endif 115#endif
116 if ( i1.hasDuration() == i2.hasDuration() ) { 116 if ( i1.hasDuration() == i2.hasDuration() ) {
117 if ( i1.hasDuration() ) { 117 if ( i1.hasDuration() ) {
118 if ( i1.duration() != i2.duration() ) 118 if ( i1.duration() != i2.duration() )
119 return false; 119 return false;
120 } 120 }
121 } else { 121 } else {
122 return false; 122 return false;
123 } 123 }
124 124
125 return ( i1.organizer() == i2.organizer() && 125 return ( i1.organizer() == i2.organizer() &&
126 // i1.uid() == i2.uid() && 126 // i1.uid() == i2.uid() &&
127 // Don't compare lastModified, otherwise the operator is not 127 // Don't compare lastModified, otherwise the operator is not
128 // of much use. We are not comparing for identity, after all. 128 // of much use. We are not comparing for identity, after all.
129 i1.doesFloat() == i2.doesFloat() && 129 i1.doesFloat() == i2.doesFloat() &&
130 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() ); 130 i1.pilotId() == i2.pilotId() );// && i1.syncStatus() == i2.syncStatus() );
131 // no need to compare mObserver 131 // no need to compare mObserver
132} 132}
133 133
134 134
135QDateTime IncidenceBase::getEvenTime( QDateTime dt ) 135QDateTime IncidenceBase::getEvenTime( QDateTime dt )
136{ 136{
137 QTime t = dt.time(); 137 QTime t = dt.time();
138 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) ); 138 dt.setTime( QTime (t.hour (), t.minute (), t.second () ) );
139 return dt; 139 return dt;
140} 140}
141 141
142bool IncidenceBase::isTagged() const
143{
144 return mIsTagged;
145}
146void IncidenceBase::setTagged( bool b)
147{
148 mIsTagged = b;
149}
142void IncidenceBase::setCalID( int id ) 150void IncidenceBase::setCalID( int id )
143{ 151{
144 if ( mCalID > 0 ) 152 if ( mCalID > 0 )
145 updated(); 153 updated();
146 mCalID = id; 154 mCalID = id;
147} 155}
148int IncidenceBase::calID() const 156int IncidenceBase::calID() const
149{ 157{
150 return mCalID; 158 return mCalID;
151} 159}
152void IncidenceBase::setCalEnabled( bool b ) 160void IncidenceBase::setCalEnabled( bool b )
153{ 161{
154 mCalEnabled = b; 162 mCalEnabled = b;
155} 163}
156bool IncidenceBase::calEnabled() const 164bool IncidenceBase::calEnabled() const
157{ 165{
158 return mCalEnabled; 166 return mCalEnabled;
159} 167}
160 168
161void IncidenceBase::setAlarmEnabled( bool b ) 169void IncidenceBase::setAlarmEnabled( bool b )
162{ 170{
163 mAlarmEnabled = b; 171 mAlarmEnabled = b;
164} 172}
165bool IncidenceBase::alarmEnabled() const 173bool IncidenceBase::alarmEnabled() const
166{ 174{
167 return mAlarmEnabled; 175 return mAlarmEnabled;
168} 176}
169 177
170 178
171void IncidenceBase::setUid(const QString &uid) 179void IncidenceBase::setUid(const QString &uid)
172{ 180{
173 mUid = uid; 181 mUid = uid;
174 updated(); 182 updated();
175} 183}
176 184
177QString IncidenceBase::uid() const 185QString IncidenceBase::uid() const
178{ 186{
179 return mUid; 187 return mUid;
180} 188}
181 189
182void IncidenceBase::setLastModified(const QDateTime &lm) 190void IncidenceBase::setLastModified(const QDateTime &lm)
183{ 191{
184 // DON'T! updated() because we call this from 192 // DON'T! updated() because we call this from
185 // Calendar::updateEvent(). 193 // Calendar::updateEvent().
186 mLastModified = getEvenTime(lm); 194 mLastModified = getEvenTime(lm);
187 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1()); 195 //qDebug("IncidenceBase::setLastModified %s ",lm.toString().latin1());
188} 196}
189 197
190QDateTime IncidenceBase::lastModified() const 198QDateTime IncidenceBase::lastModified() const
191{ 199{
192 return mLastModified; 200 return mLastModified;
193} 201}
194 202
195void IncidenceBase::setOrganizer(const QString &o) 203void IncidenceBase::setOrganizer(const QString &o)
196{ 204{
197 // we don't check for readonly here, because it is 205 // we don't check for readonly here, because it is
198 // possible that by setting the organizer we are changing 206 // possible that by setting the organizer we are changing
199 // the event's readonly status... 207 // the event's readonly status...
200 mOrganizer = o; 208 mOrganizer = o;
201 if (mOrganizer.left(7).upper() == "MAILTO:") 209 if (mOrganizer.left(7).upper() == "MAILTO:")
202 mOrganizer = mOrganizer.remove(0,7); 210 mOrganizer = mOrganizer.remove(0,7);
203 211
204 updated(); 212 updated();
205} 213}
206 214
207QString IncidenceBase::organizer() const 215QString IncidenceBase::organizer() const
208{ 216{
209 return mOrganizer; 217 return mOrganizer;
210} 218}
211 219
212void IncidenceBase::setReadOnly( bool readOnly ) 220void IncidenceBase::setReadOnly( bool readOnly )
213{ 221{
214 mReadOnly = readOnly; 222 mReadOnly = readOnly;
215} 223}
216 224
217void IncidenceBase::setDtStart(const QDateTime &dtStart) 225void IncidenceBase::setDtStart(const QDateTime &dtStart)
218{ 226{
219// if (mReadOnly) return; 227// if (mReadOnly) return;
220 mDtStart = getEvenTime(dtStart); 228 mDtStart = getEvenTime(dtStart);
221 updated(); 229 updated();
222} 230}
223 231
224 232
225QDateTime IncidenceBase::dtStart() const 233QDateTime IncidenceBase::dtStart() const
226{ 234{
227 return mDtStart; 235 return mDtStart;
228} 236}
229 237
230QString IncidenceBase::dtStartTimeStr() const 238QString IncidenceBase::dtStartTimeStr() const
231{ 239{
232 return KGlobal::locale()->formatTime(dtStart().time()); 240 return KGlobal::locale()->formatTime(dtStart().time());
233} 241}
234 242
235QString IncidenceBase::dtStartDateStr(bool shortfmt) const 243QString IncidenceBase::dtStartDateStr(bool shortfmt) const
236{ 244{
237 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); 245 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt);
238} 246}
239 247
240QString IncidenceBase::dtStartStr(bool shortfmt) const 248QString IncidenceBase::dtStartStr(bool shortfmt) const
241{ 249{
242 if ( doesFloat() ) 250 if ( doesFloat() )
243 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); 251 return KGlobal::locale()->formatDate(dtStart().date(),shortfmt);
244 return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); 252 return KGlobal::locale()->formatDateTime(dtStart(), shortfmt);
245} 253}
246 254
247 255
248bool IncidenceBase::doesFloat() const 256bool IncidenceBase::doesFloat() const
249{ 257{
250 return mFloats; 258 return mFloats;
251} 259}
252 260
253void IncidenceBase::setFloats(bool f) 261void IncidenceBase::setFloats(bool f)
254{ 262{
255 if (mReadOnly) return; 263 if (mReadOnly) return;
256 mFloats = f; 264 mFloats = f;
257 updated(); 265 updated();
258} 266}
259 267
260 268
261bool IncidenceBase::addAttendee(Attendee *a, bool doupdate) 269bool IncidenceBase::addAttendee(Attendee *a, bool doupdate)
262{ 270{
263 if (mReadOnly) return false; 271 if (mReadOnly) return false;
264 if (a->name().left(7).upper() == "MAILTO:") 272 if (a->name().left(7).upper() == "MAILTO:")
265 a->setName(a->name().remove(0,7)); 273 a->setName(a->name().remove(0,7));
266 274
267 QPtrListIterator<Attendee> qli(mAttendees); 275 QPtrListIterator<Attendee> qli(mAttendees);
268 276
269 qli.toFirst(); 277 qli.toFirst();
270 while (qli) { 278 while (qli) {
271 if (*qli.current() == *a) 279 if (*qli.current() == *a)
272 return false; 280 return false;
273 ++qli; 281 ++qli;
274 } 282 }
275 mAttendees.append(a); 283 mAttendees.append(a);
276 if (doupdate) updated(); 284 if (doupdate) updated();
277 return true; 285 return true;
278} 286}
279 287
280#if 0 288#if 0
281void IncidenceBase::removeAttendee(Attendee *a) 289void IncidenceBase::removeAttendee(Attendee *a)
282{ 290{
283 if (mReadOnly) return; 291 if (mReadOnly) return;
284 mAttendees.removeRef(a); 292 mAttendees.removeRef(a);
285 updated(); 293 updated();
286} 294}
287 295
288void IncidenceBase::removeAttendee(const char *n) 296void IncidenceBase::removeAttendee(const char *n)
289{ 297{
290 Attendee *a; 298 Attendee *a;
291 299
292 if (mReadOnly) return; 300 if (mReadOnly) return;
293 for (a = mAttendees.first(); a; a = mAttendees.next()) 301 for (a = mAttendees.first(); a; a = mAttendees.next())
294 if (a->getName() == n) { 302 if (a->getName() == n) {
295 mAttendees.remove(); 303 mAttendees.remove();
296 break; 304 break;
297 } 305 }
298} 306}
299#endif 307#endif
300 308
301void IncidenceBase::clearAttendees() 309void IncidenceBase::clearAttendees()
302{ 310{
303 if (mReadOnly) return; 311 if (mReadOnly) return;
304 mAttendees.clear(); 312 mAttendees.clear();
305} 313}
306 314
307#if 0 315#if 0
308Attendee *IncidenceBase::getAttendee(const char *n) const 316Attendee *IncidenceBase::getAttendee(const char *n) const
309{ 317{
310 QPtrListIterator<Attendee> qli(mAttendees); 318 QPtrListIterator<Attendee> qli(mAttendees);
311 319
312 qli.toFirst(); 320 qli.toFirst();
313 while (qli) { 321 while (qli) {
314 if (qli.current()->getName() == n) 322 if (qli.current()->getName() == n)
315 return qli.current(); 323 return qli.current();
316 ++qli; 324 ++qli;
317 } 325 }
318 return 0L; 326 return 0L;
319} 327}
320#endif 328#endif
321 329
322Attendee *IncidenceBase::attendeeByMail(const QString &email) 330Attendee *IncidenceBase::attendeeByMail(const QString &email)
323{ 331{
324 QPtrListIterator<Attendee> qli(mAttendees); 332 QPtrListIterator<Attendee> qli(mAttendees);
325 333
326 qli.toFirst(); 334 qli.toFirst();
327 while (qli) { 335 while (qli) {
328 if (qli.current()->email().lower() == email.lower()) 336 if (qli.current()->email().lower() == email.lower())
329 return qli.current(); 337 return qli.current();
330 ++qli; 338 ++qli;
331 } 339 }
332 return 0L; 340 return 0L;
333} 341}
334 342
335Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email) 343Attendee *IncidenceBase::attendeeByMails(const QStringList &emails, const QString& email)
336{ 344{
337 QPtrListIterator<Attendee> qli(mAttendees); 345 QPtrListIterator<Attendee> qli(mAttendees);
338 346
339 QStringList mails = emails; 347 QStringList mails = emails;
340 if (!email.isEmpty()) { 348 if (!email.isEmpty()) {
341 mails.append(email); 349 mails.append(email);
342 } 350 }
343 qli.toFirst(); 351 qli.toFirst();
344 while (qli) { 352 while (qli) {
345 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) { 353 for ( QStringList::Iterator it = mails.begin(); it != mails.end(); ++it ) {
346 if (qli.current()->email().lower() == (*it).lower()) 354 if (qli.current()->email().lower() == (*it).lower())
347 return qli.current(); 355 return qli.current();
348 } 356 }
349 357
350 ++qli; 358 ++qli;
351 } 359 }
352 return 0L; 360 return 0L;
353} 361}
354 362
355void IncidenceBase::setDuration(int seconds) 363void IncidenceBase::setDuration(int seconds)
356{ 364{
357 mDuration = seconds; 365 mDuration = seconds;
358 setHasDuration(true); 366 setHasDuration(true);
359} 367}
360 368
361int IncidenceBase::duration() const 369int IncidenceBase::duration() const
362{ 370{
363 return mDuration; 371 return mDuration;
364} 372}
365 373
366void IncidenceBase::setHasDuration(bool b) 374void IncidenceBase::setHasDuration(bool b)
367{ 375{
368 mHasDuration = b; 376 mHasDuration = b;
369} 377}
370 378
371bool IncidenceBase::hasDuration() const 379bool IncidenceBase::hasDuration() const
372{ 380{
373 return mHasDuration; 381 return mHasDuration;
374} 382}
375 383
376void IncidenceBase::setSyncStatus(int stat) 384void IncidenceBase::setSyncStatus(int stat)
377{ 385{
378 if (mReadOnly) return; 386 if (mReadOnly) return;
379 mSyncStatus = stat; 387 mSyncStatus = stat;
380} 388}
381 389
382int IncidenceBase::syncStatus() const 390int IncidenceBase::syncStatus() const
383{ 391{
384 return mSyncStatus; 392 return mSyncStatus;
385} 393}
386 394
387void IncidenceBase::setPilotId( int id ) 395void IncidenceBase::setPilotId( int id )
388{ 396{
389 if (mReadOnly) return; 397 if (mReadOnly) return;
390 mPilotId = id; 398 mPilotId = id;
391} 399}
392 400
393int IncidenceBase::pilotId() const 401int IncidenceBase::pilotId() const
394{ 402{
395 return mPilotId; 403 return mPilotId;
396} 404}
397 405
398int IncidenceBase::tempSyncStat() const 406int IncidenceBase::tempSyncStat() const
399{ 407{
400 return mTempSyncStat; 408 return mTempSyncStat;
401} 409}
402void IncidenceBase::setTempSyncStat( int id ) 410void IncidenceBase::setTempSyncStat( int id )
403{ 411{
404 if (mReadOnly) return; 412 if (mReadOnly) return;
405 mTempSyncStat = id; 413 mTempSyncStat = id;
406} 414}
407 415
408void IncidenceBase::removeID(const QString &prof) 416void IncidenceBase::removeID(const QString &prof)
409{ 417{
410 if ( prof.isEmpty() ) 418 if ( prof.isEmpty() )
411 mExternalId = ":"; 419 mExternalId = ":";
412 else 420 else
413 mExternalId = KIdManager::removeId ( mExternalId, prof); 421 mExternalId = KIdManager::removeId ( mExternalId, prof);
414 422
415} 423}
416void IncidenceBase::setID( const QString & prof , const QString & id ) 424void IncidenceBase::setID( const QString & prof , const QString & id )
417{ 425{
418 mExternalId = KIdManager::setId ( mExternalId, prof, id ); 426 mExternalId = KIdManager::setId ( mExternalId, prof, id );
419} 427}
420QString IncidenceBase::getID( const QString & prof) 428QString IncidenceBase::getID( const QString & prof)
421{ 429{
422 return KIdManager::getId ( mExternalId, prof ); 430 return KIdManager::getId ( mExternalId, prof );
423} 431}
424 432
425// example :Sharp_DTM;22;23566:TP;-1;8654:TPP;18;0: 433// example :Sharp_DTM;22;23566:TP;-1;8654:TPP;18;0:
426// format name;III;JJJ: III >= 0, may be -1. JJJ always >= 0 434// format name;III;JJJ: III >= 0, may be -1. JJJ always >= 0
427void IncidenceBase::setCsum( const QString & prof , const QString & id ) 435void IncidenceBase::setCsum( const QString & prof , const QString & id )
428{ 436{
429 mExternalId = KIdManager::setCsum ( mExternalId, prof, id ); 437 mExternalId = KIdManager::setCsum ( mExternalId, prof, id );
430} 438}
431QString IncidenceBase::getCsum( const QString & prof) 439QString IncidenceBase::getCsum( const QString & prof)
432{ 440{
433 return KIdManager::getCsum ( mExternalId, prof ); 441 return KIdManager::getCsum ( mExternalId, prof );
434} 442}
435 443
436void IncidenceBase::setIDStr( const QString & s ) 444void IncidenceBase::setIDStr( const QString & s )
437{ 445{
438 if (mReadOnly) return; 446 if (mReadOnly) return;
439 mExternalId = s; 447 mExternalId = s;
440} 448}
441 449
442QString IncidenceBase::IDStr() const 450QString IncidenceBase::IDStr() const
443{ 451{
444 return mExternalId ; 452 return mExternalId ;
445} 453}
446void IncidenceBase::registerObserver( IncidenceBase::Observer *observer ) 454void IncidenceBase::registerObserver( IncidenceBase::Observer *observer )
447{ 455{
448 if( !mObservers.contains(observer) ) mObservers.append( observer ); 456 if( !mObservers.contains(observer) ) mObservers.append( observer );
449} 457}
450 458
451void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer ) 459void IncidenceBase::unRegisterObserver( IncidenceBase::Observer *observer )
452{ 460{
453 mObservers.remove( observer ); 461 mObservers.remove( observer );
454} 462}
455 463
456void IncidenceBase::updated() 464void IncidenceBase::updated()
457{ 465{
458 QPtrListIterator<Observer> it(mObservers); 466 QPtrListIterator<Observer> it(mObservers);
459 while( it.current() ) { 467 while( it.current() ) {
460 Observer *o = it.current(); 468 Observer *o = it.current();
461 ++it; 469 ++it;
462 o->incidenceUpdated( this ); 470 o->incidenceUpdated( this );
463 } 471 }
464} 472}
diff --git a/libkcal/incidencebase.h b/libkcal/incidencebase.h
index dc6024a..bccf287 100644
--- a/libkcal/incidencebase.h
+++ b/libkcal/incidencebase.h
@@ -1,183 +1,185 @@
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 150 bool isTagged() const;
151 void setTagged( bool );
151 protected: 152 protected:
153 bool mIsTagged;
152 QDateTime mDtStart; 154 QDateTime mDtStart;
153 bool mReadOnly; 155 bool mReadOnly;
154 QDateTime getEvenTime( QDateTime ); 156 QDateTime getEvenTime( QDateTime );
155 157
156 private: 158 private:
157 // base components 159 // base components
158 QString mOrganizer; 160 QString mOrganizer;
159 QString mUid; 161 QString mUid;
160 int mCalID; 162 int mCalID;
161 bool mCalEnabled; 163 bool mCalEnabled;
162 bool mAlarmEnabled; 164 bool mAlarmEnabled;
163 QDateTime mLastModified; 165 QDateTime mLastModified;
164 QPtrList<Attendee> mAttendees; 166 QPtrList<Attendee> mAttendees;
165 167
166 bool mFloats; 168 bool mFloats;
167 169
168 int mDuration; 170 int mDuration;
169 bool mHasDuration; 171 bool mHasDuration;
170 QString mExternalId; 172 QString mExternalId;
171 int mTempSyncStat; 173 int mTempSyncStat;
172 174
173 // PILOT SYNCHRONIZATION STUFF 175 // PILOT SYNCHRONIZATION STUFF
174 int mPilotId; // unique id for pilot sync 176 int mPilotId; // unique id for pilot sync
175 int mSyncStatus; // status (for sync) 177 int mSyncStatus; // status (for sync)
176 178
177 QPtrList<Observer> mObservers; 179 QPtrList<Observer> mObservers;
178}; 180};
179 181
180bool operator==( const IncidenceBase&, const IncidenceBase& ); 182bool operator==( const IncidenceBase&, const IncidenceBase& );
181} 183}
182 184
183#endif 185#endif