summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt6
-rw-r--r--korganizer/calendarview.cpp20
-rw-r--r--korganizer/koeditordetails.cpp2
-rw-r--r--korganizer/koeditorgeneral.cpp9
-rw-r--r--korganizer/koeditorgeneralevent.cpp5
-rw-r--r--korganizer/koeditorgeneraltodo.cpp2
-rw-r--r--korganizer/koeventeditor.cpp6
-rw-r--r--korganizer/koincidenceeditor.cpp2
-rw-r--r--korganizer/kotodoeditor.cpp4
9 files changed, 43 insertions, 13 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index 11a0413..44e6bdf 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1,1481 +1,1481 @@
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{ "Actions","Aktionen" }, 47{ "Actions","Aktionen" },
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{ "Click to add a new Todo","Hier klicken, um ein neues Todo anzulegen" }, 93{ "Click to add a new Todo","Hier klicken, um ein neues Todo anzulegen" },
94{ "Clone Item","Klone Eintrag" }, 94{ "Clone Item","Klone Eintrag" },
95{ "&Close","S&chließen" }, 95{ "&Close","S&chließen" },
96{ "Close","Schließen" }, 96{ "Close","Schließen" },
97{ "Close this dialog to abort deletion!","Zum Abbrechen des Löschvorganges Dialog schließen!" }, 97{ "Close this dialog to abort deletion!","Zum Abbrechen des Löschvorganges Dialog schließen!" },
98{ "Colors","Farben" }, 98{ "Colors","Farben" },
99{ "completed","erledigt" }, 99{ "completed","erledigt" },
100{ "completed on %1","erledigt am %1" }, 100{ "completed on %1","erledigt am %1" },
101{ "Complete","Erledigt" }, 101{ "Complete","Erledigt" },
102{ "Confidential","Vertraulich" }, 102{ "Confidential","Vertraulich" },
103{ "Configure...","Einstellungen..." }, 103{ "Configure...","Einstellungen..." },
104{ "Confirm &deletes","Löschvogang bestätigen" }, 104{ "Confirm &deletes","Löschvogang bestätigen" },
105{ "Couldn't load calendar\n '%1'.","Kann Kalender\n '%1' nicht laden." }, 105{ "Couldn't load calendar\n '%1'.","Kann Kalender\n '%1' nicht laden." },
106{ "Counter-event Viewer","Terminzähler Ansicht" }, 106{ "Counter-event Viewer","Terminzähler Ansicht" },
107{ "Daily ending hour:","Feierabend:" }, 107{ "Daily ending hour:","Feierabend:" },
108{ "Daily starting hour:","Anfangszeit:" }, 108{ "Daily starting hour:","Anfangszeit:" },
109{ "Daily","Täglich" }, 109{ "Daily","Täglich" },
110{ "Date Format","Datums Format" }, 110{ "Date Format","Datums Format" },
111{ "Date Format:","Datums Format:" }, 111{ "Date Format:","Datums Format:" },
112{ "DateNavigator:(nr)","Datums Navigator" }, 112{ "DateNavigator:(nr)","Datums Navigator" },
113{ "Dates: ","Datum: " }, 113{ "Dates: ","Datum: " },
114{ "Date && Time","Datum && Zeit" }, 114{ "Date && Time","Datum && Zeit" },
115{ "Day begins at:","Der Tag beginnt um:" }, 115{ "Day begins at:","Der Tag beginnt um:" },
116{ "Days in Next-X-Days:","Tage in Nächste-X-Tage:" }, 116{ "Days in Next-X-Days:","Tage in Nächste-X-Tage:" },
117{ "Days in What's Next:","Tage in What's Next:" }, 117{ "Days in What's Next:","Tage in What's Next:" },
118{ "day(s)","Tag(e)" }, 118{ "day(s)","Tag(e)" },
119{ "Days to show in Next-X-Days view:","Welche Tage in Nächste-X-Tagen anzeigen:" }, 119{ "Days to show in Next-X-Days view:","Welche Tage in Nächste-X-Tagen anzeigen:" },
120{ "day","Tag" }, 120{ "day","Tag" },
121{ "Dec","Dez" }, 121{ "Dec","Dez" },
122{ "December","Dezember" }, 122{ "December","Dezember" },
123{ "Default alarm time:","Standard Alarmzeit:" }, 123{ "Default alarm time:","Standard Alarmzeit:" },
124{ "Default appointment time:","Standard Termin Startzeit:" }, 124{ "Default appointment time:","Standard Termin Startzeit:" },
125{ "Default event color:","Standard Terminfarbe:" }, 125{ "Default event color:","Standard Terminfarbe:" },
126{ "Default","Standard" }, 126{ "Default","Standard" },
127{ "Def. duration of new app.:","Standard Termin Länge:" }, 127{ "Def. duration of new app.:","Standard Termin Länge:" },
128{ "Delete All","Lösche alles" }, 128{ "Delete All","Lösche alles" },
129{ "Delete all selected","Lösche alle Selektierten" }, 129{ "Delete all selected","Lösche alle Selektierten" },
130{ "Delete Current","Aktuellen löschen" }, 130{ "Delete Current","Aktuellen löschen" },
131{ "Delete Event...","Lösche Termin..." }, 131{ "Delete Event...","Lösche Termin..." },
132{ "Delete Event","Lösche Termin" }, 132{ "Delete Event","Lösche Termin" },
133{ "&Delete","Löschen" }, 133{ "&Delete","Löschen" },
134{ "Delete...","Löschen..." }, 134{ "Delete...","Löschen..." },
135{ "Delete","Löschen" }, 135{ "Delete","Löschen" },
136{ "Delete Todo...","Lösche Todo..." }, 136{ "Delete Todo...","Lösche Todo..." },
137{ "Delete To-Do","Lösche Todo" }, 137{ "Delete To-Do","Lösche Todo" },
138{ "Deleting item %d ...","Lösche Eintrag %d..." }, 138{ "Deleting item %d ...","Lösche Eintrag %d..." },
139{ "Descriptions","Beschreibungen" }, 139{ "Descriptions","Beschreibungen" },
140{ "Deselect all","Deselektiere Alle" }, 140{ "Deselect all","Deselektiere Alle" },
141{ "Details","Details" }, 141{ "Details","Details" },
142{ "Dinner","Abendessen" }, 142{ "Dinner","Abendessen" },
143{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" }, 143{ "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" },
144{ "Due Date","Fällig am" }, 144{ "Due Date","Fällig am" },
145{ "Due: ","Fällig: "}, 145{ "Due: ","Fällig: "},
146{ "Due Time","Fällig um" }, 146{ "Due Time","Fällig um" },
147{ "Due:","Fällig:"}, 147{ "Due:","Fällig:"},
148{ "Duration: ","Dauer: " }, 148{ "Duration: ","Dauer: " },
149{ "Edit...","Bearbeite..." }, 149{ "Edit...","Bearbeite..." },
150{ "Edit","Bearbeite" }, 150{ "Edit","Bearbeite" },
151{ "Edit Event...","Bearbeite Termin..." }, 151{ "Edit Event...","Bearbeite Termin..." },
152{ "Edit Event","Bearbeite Termin" }, 152{ "Edit Event","Bearbeite Termin" },
153{ "Edit exceptions","Bearbeite Ausnahmen" }, 153{ "Edit exceptions","Bearbeite Ausnahmen" },
154{ "EditorBox:","Editor Fenster:" }, 154{ "EditorBox:","Editor Fenster:" },
155{ "Edit Recurrence Range","Bearbeite Wiederholung" }, 155{ "Edit Recurrence Range","Bearbeite Wiederholung" },
156{ "Edit Todo...","Berabeite Todo..." }, 156{ "Edit Todo...","Berabeite Todo..." },
157{ "Edit To-Do","Todo bearbeiten" }, 157{ "Edit To-Do","Todo bearbeiten" },
158{ "E&mail address:","E&mail Adresse:" }, 158{ "E&mail address:","E&mail Adresse:" },
159{ "(EmptyEmail)","(KeineEmail)" }, 159{ "(EmptyEmail)","(KeineEmail)" },
160{ "(EmptyName)","(KeinName)" }, 160{ "(EmptyName)","(KeinName)" },
161{ "Enable Recurrence","Wiederholung anschalten" }, 161{ "Enable Recurrence","Wiederholung anschalten" },
162{ "End after","Endet nach"}, 162{ "End after","Endet nach"},
163{ "End by:","Endet am"}, 163{ "End by:","Endet am"},
164{ "End Date","End Datum" }, 164{ "End Date","End Datum" },
165{ "End:","Ende:" }, 165{ "End:","Ende:" },
166{ "End Time","End Zeit" }, 166{ "End Time","End Zeit" },
167{ "English","Englisch" }, 167{ "English","Englisch" },
168{ "Event","Termin" }, 168{ "Event","Termin" },
169{ "Event list","Termin Liste" }, 169{ "Event list","Termin Liste" },
170{ "Events","Termine" }, 170{ "Events","Termine" },
171{ "Event Viewer:","Termin Übersicht:" }, 171{ "Event Viewer:","Termin Übersicht:" },
172{ "every","jede" }, 172{ "every","jede" },
173{ "Exceptions...","Ausnahmen..." }, 173{ "Exceptions...","Ausnahmen..." },
174{ "Exceptions","Ausnahmen" }, 174{ "Exceptions","Ausnahmen" },
175{ "Exclude holidays","Ohne freie Tage" }, 175{ "Exclude holidays","Ohne freie Tage" },
176{ "Exclude Saturdays","Ohne Samstage" }, 176{ "Exclude Saturdays","Ohne Samstage" },
177{ "Feb","Feb" }, 177{ "Feb","Feb" },
178{ "February","Februar" }, 178{ "February","Februar" },
179{ "&Find","Suche!" }, 179{ "&Find","Suche!" },
180{ "Fonts","Schriftart" }, 180{ "Fonts","Schriftart" },
181{ "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" }, 181{ "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" },
182{ "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"}, 182{ "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"},
183{ "Free","Frei" }, 183{ "Free","Frei" },
184{ "Friday","Freitag" }, 184{ "Friday","Freitag" },
185{ "Fri","Fr" }, 185{ "Fri","Fr" },
186{ "From:","Vom:" }, 186{ "From:","Vom:" },
187{ "Full &name:","Vor- und &Nachname:" }, 187{ "Full &name:","Vor- und &Nachname:" },
188{ "General","Allgemein" }, 188{ "General","Allgemein" },
189{ "German","Deutsch" }, 189{ "German","Deutsch" },
190{ "Gifts","Geschenke" }, 190{ "Gifts","Geschenke" },
191{ "Go to Today","Heute anzeigen" }, 191{ "Go to Today","Heute anzeigen" },
192{ "Help","Hilfe" }, 192{ "Help","Hilfe" },
193{ "Hide Dates","Daten ausblenden" }, 193{ "Hide Dates","Daten ausblenden" },
194{ "Highlight color:","Markierungen:" }, 194{ "Highlight color:","Markierungen:" },
195{ "Holiday color:","Freie Tage:" }, 195{ "Holiday color:","Freie Tage:" },
196{ "hour(s)","Stunde(n)" }, 196{ "hour(s)","Stunde(n)" },
197{ "In %1 days: ","In %1 Tagen: " }, 197{ "In %1 days: ","In %1 Tagen: " },
198{ "Incomplete Todo:","Unerledigte Aufgaben:" }, 198{ "Incomplete Todo:","Unerledigte Aufgaben:" },
199{ "Information","Information" }, 199{ "Information","Information" },
200{ "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" }, 200{ "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" },
201{ "Jan","Jan" }, 201{ "Jan","Jan" },
202{ "January","Januar" }, 202{ "January","Januar" },
203{ "JournalView:","Journal Ansicht:" }, 203{ "JournalView:","Journal Ansicht:" },
204{ "Journals","Journale" }, 204{ "Journals","Journale" },
205{ "Jul","Jul" }, 205{ "Jul","Jul" },
206{ "July","Juli" }, 206{ "July","Juli" },
207{ "Jump to date","Springe zum Datum" }, 207{ "Jump to date","Springe zum Datum" },
208{ "June","Juni" }, 208{ "June","Juni" },
209{ "Jun","Jun" }, 209{ "Jun","Jun" },
210{ "Key Bindings...","Tastenzuordnung..." }, 210{ "Key Bindings...","Tastenzuordnung..." },
211{ "Kids","Kinder" }, 211{ "Kids","Kinder" },
212{ "Known Problems...","Bekannte Probleme..." }, 212{ "Known Problems...","Bekannte Probleme..." },
213{ "KO/Pi Find ","KO/Pi Suchdialog " }, 213{ "KO/Pi Find ","KO/Pi Suchdialog " },
214{ "KO/Pi Find: ","KO/Pi Suchen: " }, 214{ "KO/Pi Find: ","KO/Pi Suchen: " },
215{ "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." }, 215{ "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." },
216{ "Language:(needs restart)","Sprache (Neustart!)" }, 216{ "Language:(needs restart)","Sprache (Neustart!)" },
217{ "Language:","Sprache" }, 217{ "Language:","Sprache" },
218{ "Large","Etwas mehr" }, 218{ "Large","Etwas mehr" },
219{ "List View:","Listenansicht:" }, 219{ "List View:","Listenansicht:" },
220{ "List View","Listenansicht" }, 220{ "List View","Listenansicht" },
221{ "Load/Save","Laden/Speichern" }, 221{ "Load/Save","Laden/Speichern" },
222{ "Load Template","Lade Vorlage" }, 222{ "Load Template","Lade Vorlage" },
223{ "Locale","Localisation" }, 223{ "Locale","Localisation" },
224{ "Local temp file:","Lokale temp. Datei:" }, 224{ "Local temp file:","Lokale temp. Datei:" },
225{ "Location: ","Ort: " }, 225{ "Location: ","Ort: " },
226{ "Location:","Ort:" }, 226{ "Location:","Ort:" },
227{ "Mail client","Mail Programm" }, 227{ "Mail client","Mail Programm" },
228{ "Mail Client","Mail Programm" }, 228{ "Mail Client","Mail Programm" },
229{ "March","März" }, 229{ "March","März" },
230{ "Mar","Mär" }, 230{ "Mar","Mär" },
231{ "May","Mai" }, 231{ "May","Mai" },
232{ "M. Bains line:","M. Bains Linie:" }, 232{ "M. Bains line:","M. Bains Linie:" },
233{ "Medium","Medium" }, 233{ "Medium","Medium" },
234{ "Method","Methode" }, 234{ "Method","Methode" },
235{ "minute(s)","Minute(n)" }, 235{ "minute(s)","Minute(n)" },
236{ "Monday","Montag" }, 236{ "Monday","Montag" },
237{ "Mon","Mo" }, 237{ "Mon","Mo" },
238{ "Monthly","Monatlich" }, 238{ "Monthly","Monatlich" },
239{ "Month not long enough","Monat ist nicht lang genug" }, 239{ "Month not long enough","Monat ist nicht lang genug" },
240{ "month(s)","Monat(e)" }, 240{ "month(s)","Monat(e)" },
241{ "Month view:","Monatsansicht:" }, 241{ "Month view:","Monatsansicht:" },
242{ "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" }, 242{ "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" },
243{ "Todo view uses category colors","To-Do Ansicht zeigt Kategorie Farben" }, 243{ "Todo view uses category colors","To-Do Ansicht zeigt Kategorie Farben" },
244{ "Move &Down","Nach unten verschieben" }, 244{ "Move &Down","Nach unten verschieben" },
245{ "Move &Up","Nach oben verschieben" }, 245{ "Move &Up","Nach oben verschieben" },
246{ "Name:","Name:" }, 246{ "Name:","Name:" },
247{ "Name","Name" }, 247{ "Name","Name" },
248{ "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" }, 248{ "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" },
249{ "%n Days","%n Tage" }, 249{ "%n Days","%n Tage" },
250{ "Never","Nie" }, 250{ "Never","Nie" },
251{ "New event...","Neuer Termin..." }, 251{ "New event...","Neuer Termin..." },
252{ "New event","Neuer Termin" }, 252{ "New event","Neuer Termin" },
253{ "New Event...","Neuer Termin..." }, 253{ "New Event...","Neuer Termin..." },
254{ "New Events/Todos should","Neue Termine/Todos sollten" }, 254{ "New Events/Todos should","Neue Termine/Todos sollten" },
255{ "&New","&Neu" }, 255{ "&New","&Neu" },
256{ "New","Neu", }, 256{ "New","Neu", },
257{ "New Sub-Todo...","Neues Sub-Todo..." }, 257{ "New Sub-Todo...","Neues Sub-Todo..." },
258{ "New Todo...","Neues Todo..." }, 258{ "New Todo...","Neues Todo..." },
259{ "Next Alarm: ","Nächster Alarm: ", }, 259{ "Next Alarm: ","Nächster Alarm: ", },
260{ "&Next Day","&Nächster Tag", }, 260{ "&Next Day","&Nächster Tag", },
261{ "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" }, 261{ "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" },
262{ "Next month","Nächster Monat" }, 262{ "Next month","Nächster Monat" },
263{ "&Next Week","&Nächste Woche" }, 263{ "&Next Week","&Nächste Woche" },
264{ "Next year","Nächstes Jahr" }, 264{ "Next year","Nächstes Jahr" },
265{ "Next Year","Nächstes Jahr" }, 265{ "Next Year","Nächstes Jahr" },
266{ "%n h","%n Std" }, 266{ "%n h","%n Std" },
267{ "No ending date","Kein End-Datum", }, 267{ "No ending date","Kein End-Datum", },
268{ "No event, nothing to do.","Kein Termin, nichts zu tun.", }, 268{ "No event, nothing to do.","Kein Termin, nichts zu tun.", },
269{ "No event selected.","Kein Termin selektiert" }, 269{ "No event selected.","Kein Termin selektiert" },
270{ "No","Nein" }, 270{ "No","Nein" },
271{ "No program set","Kein Programm ausgewählt", }, 271{ "No program set","Kein Programm ausgewählt", },
272{ "Normal","Normal" }, 272{ "Normal","Normal" },
273{ "[No selection]","Keine Selektion", }, 273{ "[No selection]","Keine Selektion", },
274{ "No sound set","Kein Sound ausgewählt", }, 274{ "No sound set","Kein Sound ausgewählt", },
275{ "no time ","keine Zeit ", }, 275{ "no time ","keine Zeit ", },
276{ "no time","keine Zeit", }, 276{ "no time","keine Zeit", },
277{ "No Time","Keine Zeit" }, 277{ "No Time","Keine Zeit" },
278{ "November","November" }, 278{ "November","November" },
279{ "Nov","Nov", }, 279{ "Nov","Nov", },
280{ "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" }, 280{ "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" },
281{ "occurrence(s)","Vorkommen" }, 281{ "occurrence(s)","Vorkommen" },
282{ "October","Oktober" }, 282{ "October","Oktober" },
283{ "Oct","Okt", }, 283{ "Oct","Okt", },
284{ "O-due!","Ü-fällig! " }, 284{ "O-due!","Ü-fällig! " },
285{ "&OK","&OK" }, 285{ "&OK","&OK" },
286{ "Ok+Show!","Ok+Anzeigen" }, 286{ "Ok+Show!","Ok+Anzeigen" },
287{ "Organizer: %1","Organisator %1" }, 287{ "Organizer: %1","Organisator %1" },
288{ "Organizer","Organisator" }, 288{ "Organizer","Organisator" },
289{ "Owner: ","Besitzer: " }, 289{ "Owner: ","Besitzer: " },
290{ "Owner:","Besitzer:" }, 290{ "Owner:","Besitzer:" },
291{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, 291{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" },
292{ "Pick a date to display","Wähle einen Tag zum anzeigen aus" }, 292{ "Pick a date to display","Wähle einen Tag zum anzeigen aus" },
293{ "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."}, 293{ "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."},
294{ "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." }, 294{ "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." },
295{ "Please specify a valid start date.","Bitte gültiges Startdatum angeben." }, 295{ "Please specify a valid start date.","Bitte gültiges Startdatum angeben." },
296{ "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." }, 296{ "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." },
297{ "Please specify a valid start time.","Bitte gültige Startzeit angeben."}, 297{ "Please specify a valid start time.","Bitte gültige Startzeit angeben."},
298{ "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." }, 298{ "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." },
299{ "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" }, 299{ "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" },
300{ "&Previous Day","Vorheriger Tag" }, 300{ "&Previous Day","Vorheriger Tag" },
301{ "Previous month","Vorheriger Monat" }, 301{ "Previous month","Vorheriger Monat" },
302{ "Previous Month","Vorheriger Monat" }, 302{ "Previous Month","Vorheriger Monat" },
303{ "&Previous Week","Vorherige Woche" }, 303{ "&Previous Week","Vorherige Woche" },
304{ "Previous year","Vorheriges Jahr" }, 304{ "Previous year","Vorheriges Jahr" },
305{ "Previous Year","Vorheriges Jahr" }, 305{ "Previous Year","Vorheriges Jahr" },
306{ "Printing","Drucken" }, 306{ "Printing","Drucken" },
307{ "Priority:","Priorität:" }, 307{ "Priority:","Priorität:" },
308{ "Private","Privat" }, 308{ "Private","Privat" },
309{ "Proceed","Weiter" }, 309{ "Proceed","Weiter" },
310{ "Public","Öffentlich" }, 310{ "Public","Öffentlich" },
311{ "Purge","Entferne" }, 311{ "Purge","Entferne" },
312{ "Purge Completed...","Entferne erledigte Todos..." }, 312{ "Purge Completed...","Entferne erledigte Todos..." },
313{ "Purge Todos","Todos bereinigen" }, 313{ "Purge Todos","Todos bereinigen" },
314{ "read-only","schreibgeschützt" }, 314{ "read-only","schreibgeschützt" },
315{ "Recur every","Wiederh. alle" }, 315{ "Recur every","Wiederh. alle" },
316{ "Recur in the month of","Wiederh. im Monat" }, 316{ "Recur in the month of","Wiederh. im Monat" },
317{ "Recur on the","Wiederh. am" }, 317{ "Recur on the","Wiederh. am" },
318{ "Recur on this day","Wiederh. am diesen Tag" }, 318{ "Recur on this day","Wiederh. am diesen Tag" },
319{ "Recurrence Range...","Wiederholungs Zeitraum..." }, 319{ "Recurrence Range...","Wiederholungs Zeitraum..." },
320{ "Recurrence Range","Wiederholungs Zeitraum" }, 320{ "Recurrence Range","Wiederholungs Zeitraum" },
321{ "Recurrence Rule","Wiederholungs Regel" }, 321{ "Recurrence Rule","Wiederholungs Regel" },
322{ "Recurrence","Wiederholung" }, 322{ "Recurrence","Wiederholung" },
323{ "Recurs","Wiederholung" }, 323{ "Recurs","Wiederholung" },
324{"&Reject","Abweisen"}, 324{"&Reject","Abweisen"},
325{ "Reminder:","Alarm:" }, 325{ "Reminder:","Alarm:" },
326{ "Rem.:","Alarm:" }, 326{ "Rem.:","Alarm:" },
327{ "Rem.","Alarm:" }, 327{ "Rem.","Alarm:" },
328{ "Remote file:","Remote Datei:"}, 328{ "Remote file:","Remote Datei:"},
329{ "Remote IP:","Remote (ferne) IP:" }, 329{ "Remote IP:","Remote (ferne) IP:" },
330{ "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " }, 330{ "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " },
331{ "Remote user:","Remote Benutzer"}, 331{ "Remote user:","Remote Benutzer"},
332{ "&Remove","Entfe&rnen" }, 332{ "&Remove","Entfe&rnen" },
333{ "Remove","Entfernen" }, 333{ "Remove","Entfernen" },
334{ "Request response","Bemerkung anfordern" }, 334{ "Request response","Bemerkung anfordern" },
335{ "Role:","Rolle:" }, 335{ "Role:","Rolle:" },
336{ "Role","Rolle" }, 336{ "Role","Rolle" },
337{ "Sat","Sa" }, 337{ "Sat","Sa" },
338{ "Saturday","Samstag" }, 338{ "Saturday","Samstag" },
339{ "Search for:","Suche nach:" }, 339{ "Search for:","Suche nach:" },
340{ "Search In","Suche in" }, 340{ "Search In","Suche in" },
341{ "Search...","Suche..." }, 341{ "Search...","Suche..." },
342{ "Search","Suche" }, 342{ "Search","Suche" },
343{ "Select Addresses","Wähle Adressen" }, 343{ "Select Addresses","Wähle Adressen" },
344{ "Select all","Selektiere Alle" }, 344{ "Select all","Selektiere Alle" },
345{ "Select a month","Wähle Monat" }, 345{ "Select a month","Wähle Monat" },
346{ "Select a week","Wähle Woche" }, 346{ "Select a week","Wähle Woche" },
347{ "Select a year","Wähle Jahr" }, 347{ "Select a year","Wähle Jahr" },
348{ "Send directly","Sende direkt" }, 348{ "Send directly","Sende direkt" },
349{ "&Send Messages","&Sende Nachrichten", }, 349{ "&Send Messages","&Sende Nachrichten", },
350{ "Sep","Sep" }, 350{ "Sep","Sep" },
351{ "September","September" }, 351{ "September","September" },
352{ "Shopping","Einkaufen" }, 352{ "Shopping","Einkaufen" },
353{ "Show Dates","Zeige Daten" }, 353{ "Show Dates","Zeige Daten" },
354{ "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." }, 354{ "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." },
355{ "Show Event...","Zeige Termin..." }, 355{ "Show Event...","Zeige Termin..." },
356{ "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." }, 356{ "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." },
357{ "Show Marcus Bains line","Zeige Marcus Bains Linie" }, 357{ "Show Marcus Bains line","Zeige Marcus Bains Linie" },
358{ "Show summary after syncing","Zeige Zusammenfassung nach Sync." }, 358{ "Show summary after syncing","Zeige Zusammenfassung nach Sync." },
359{ "Show time as:","Zeige Zeit als" }, 359{ "Show time as:","Zeige Zeit als" },
360{ "Show Todo...","Zeige To-Do" }, 360{ "Show Todo...","Zeige To-Do" },
361{ "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, 361{ "Vertical screen layout(Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" },
362{ "&Show","Zeige" }, 362{ "&Show","Zeige" },
363{ "Show...","Zeige..." }, 363{ "Show...","Zeige..." },
364{ "Show","Zeige" }, 364{ "Show","Zeige" },
365{ "Small","Klein" }, 365{ "Small","Klein" },
366{ "Sorry","Entschuldigung" }, 366{ "Sorry","Entschuldigung" },
367{"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, 367{"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"},
368{ "Start:","Start:" }, 368{ "Start:","Start:" },
369{ "Start Date","Start Datum" }, 369{ "Start Date","Start Datum" },
370{ "Start date: %1","Start Datum: %1" }, 370{ "Start date: %1","Start Datum: %1" },
371{ "Start Time","Start Zeit" }, 371{ "Start Time","Start Zeit" },
372{ "Status:","Status:" }, 372{ "Status:","Status:" },
373{ "Status","Status:" }, 373{ "Status","Status:" },
374{ "Summaries","Titel" }, 374{ "Summaries","Titel" },
375{ "Summary:","Titel:" }, 375{ "Summary:","Titel:" },
376{ "Summary","Titel" }, 376{ "Summary","Titel" },
377{ "Sunday","Sonntag" }, 377{ "Sunday","Sonntag" },
378{ "Sun","So" }, 378{ "Sun","So" },
379{ "Sync preferences:","Sync Einstellungen" }, 379{ "Sync preferences:","Sync Einstellungen" },
380{ "Sync Prefs","Sync Einstellungen" }, 380{ "Sync Prefs","Sync Einstellungen" },
381{ "Syncronize","Daten abgleich" }, 381{ "Syncronize","Daten abgleich" },
382{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, 382{ "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" },
383{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, 383{ "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" },
384{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" }, 384{ "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" },
385{ "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges To-Do" }, 385{ "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges To-Do" },
386{ "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" }, 386{ "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" },
387{ "Template...","Vorlage..." }, 387{ "Template...","Vorlage..." },
388{ "This day","Dieser Tag" }, 388{ "This day","Dieser Tag" },
389{ "This is an experimental feature. ","Dieses Feature ist experimentel" }, 389{ "This is an experimental feature. ","Dieses Feature ist experimentel" },
390{ "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." }, 390{ "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." },
391{ "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." }, 391{ "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." },
392{ "Thu","Do" }, 392{ "Thu","Do" },
393{ "Thursday","Donnerstag" }, 393{ "Thursday","Donnerstag" },
394{ "Time associated","Mit Zeit" }, 394{ "Time associated","Mit Zeit" },
395{ "Time bar:","Uhrzeit Zeile:" }, 395{ "Time bar:","Uhrzeit Zeile:" },
396{ "Time && Date","Zeit und Datum" }, 396{ "Time && Date","Zeit und Datum" },
397{ "Time Format","Zeit Format" }, 397{ "Time Format","Zeit Format" },
398{ "Time Format(nr):","Zeit Format(Neustart!)" }, 398{ "Time Format(nr):","Zeit Format(Neustart!)" },
399{ "Date Labels:","Datumsleiste:" }, 399{ "Date Labels:","Datumsleiste:" },
400{ "Time: ","Zeit: " }, 400{ "Time: ","Zeit: " },
401{ "Timezone:","Zeitzone:" }, 401{ "Timezone:","Zeitzone:" },
402{ "To: ","Bis: " }, 402{ "To: ","Bis: " },
403{ "To:","Bis:" }, 403{ "To:","Bis:" },
404{ "Today: ","Heute: " }, 404{ "Today: ","Heute: " },
405{ "Todo due today color:","Heute fällige To-Do's" }, 405{ "Todo due today color:","Heute fällige To-Do's" },
406{ "To-do items:","To-Do items:" }, 406{ "To-do items:","To-Do items:" },
407{ "Todo overdue color:","Überfällige To-Do's" }, 407{ "Todo overdue color:","Überfällige To-Do's" },
408{ "Todo","Todo" }, 408{ "Todo","Todo" },
409{ "To-do view shows completed Todos","To-do Ansicht zeigt erledigte To-dos" }, 409{ "To-do view shows completed Todos","To-do Ansicht zeigt erledigte To-dos" },
410{ "ToDoView:","Todo Ansicht:" }, 410{ "ToDoView:","Todo Ansicht:" },
411{ "Toggle Alarm","Wechsle Alarm" }, 411{ "Toggle Alarm","Wechsle Alarm" },
412{ "Toggle Allday","Umschalten Ganztag" }, 412{ "Toggle Allday","Umschalten Ganztag" },
413{ "Tomorrow: ","Morgen: " }, 413{ "Tomorrow: ","Morgen: " },
414{ "Tue","Di" }, 414{ "Tue","Di" },
415{ "Tuesday","Dienstag" }, 415{ "Tuesday","Dienstag" },
416{ "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" }, 416{ "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" },
417{ "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." }, 417{ "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." },
418{ "Unknown","Unbekannt" }, 418{ "Unknown","Unbekannt" },
419{ "Up","Hinauf" }, 419{ "Up","Hinauf" },
420{ "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" }, 420{ "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" },
421{ "User defined","Benutzerdefiniert" }, 421{ "User defined","Benutzerdefiniert" },
422{ "User long date:","Format langes Datum:" }, 422{ "User long date:","Format langes Datum:" },
423{ "User short date:","Forma kurzes Datum:" }, 423{ "User short date:","Forma kurzes Datum:" },
424{ "View","Ansicht" }, 424{ "View","Ansicht" },
425{ "View Fonts","Schriftarten Ansichten" }, 425{ "View Fonts","Schriftarten Ansichten" },
426{ "Views","Ansichten" }, 426{ "Views","Ansichten" },
427{ "Wed","Mi" }, 427{ "Wed","Mi" },
428{ "Wednesday","Mittwoch" }, 428{ "Wednesday","Mittwoch" },
429{ "Week %1","Woche %1" }, 429{ "Week %1","Woche %1" },
430{ "Weekly","Wöchentlich" }, 430{ "Weekly","Wöchentlich" },
431{ "Week starts on Sunday","Woche beginnt Sonntags" }, 431{ "Week starts on Sunday","Woche beginnt Sonntags" },
432{ "What's Next View:","What's Next Anz." }, 432{ "What's Next View:","What's Next Anz." },
433{ "What's next ?","Was kommt als nächstes?(What's Next)" }, 433{ "What's next ?","Was kommt als nächstes?(What's Next)" },
434{ "Working Hours","Tägliche Arbeitszeit" }, 434{ "Working Hours","Tägliche Arbeitszeit" },
435{ "Working hours color:","Arbeitszeit in der Agenda Ansicht:" }, 435{ "Working hours color:","Arbeitszeit in der Agenda Ansicht:" },
436{ "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" }, 436{ "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" },
437{ "Write back synced file","Syncronisierte Datei zurückschreiben" }, 437{ "Write back synced file","Syncronisierte Datei zurückschreiben" },
438{ "Yearly","Jährlich" }, 438{ "Yearly","Jährlich" },
439{ "year(s)","Jahr(e)" }, 439{ "year(s)","Jahr(e)" },
440{ "Yes","Ja" }, 440{ "Yes","Ja" },
441{ "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" }, 441{ "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" },
442{ "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." }, 442{ "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." },
443{ "week(s) on:","Woche(n) am: " }, 443{ "week(s) on:","Woche(n) am: " },
444{ "Full menu bar(nr)","Volle Menuleiste(bn)" }, 444{ "Full menu bar(nr)","Volle Menuleiste(bn)" },
445{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, 445{ "Timezone has daylight saving","Zeitzone hat Sommerzeit" },
446{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, 446{ "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" },
447{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, 447{ "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." },
448{ "Daylight start:","Sommerzeit Start:" }, 448{ "Daylight start:","Sommerzeit Start:" },
449{ "Daylight end:","Sommerzeit Ende:" }, 449{ "Daylight end:","Sommerzeit Ende:" },
450{ "Time Zone","Zeitzone" }, 450{ "Time Zone","Zeitzone" },
451{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, 451{ "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" },
452{ "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" }, 452{ "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" },
453{ "minutely","minütlich" }, 453{ "minutely","minütlich" },
454{ "hourly","stündlich" }, 454{ "hourly","stündlich" },
455{ "daily","täglich" }, 455{ "daily","täglich" },
456{ "weekly","wöchentlich" }, 456{ "weekly","wöchentlich" },
457{ "monthly","monatlich" }, 457{ "monthly","monatlich" },
458{ "day-monthly","tag-monatlich" }, 458{ "day-monthly","tag-monatlich" },
459{ "month-yearly","monat-jährlich" }, 459{ "month-yearly","monat-jährlich" },
460{ "day-yearly","tag-jährlich" }, 460{ "day-yearly","tag-jährlich" },
461{ "position-yearly","pos-jährlich" }, 461{ "position-yearly","pos-jährlich" },
462{ "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" }, 462{ "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" },
463{ "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" }, 463{ "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" },
464{ "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" }, 464{ "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" },
465{ "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" }, 465{ "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" },
466{ "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" }, 466{ "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" },
467{ "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." }, 467{ "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." },
468{ "Event list view uses full window","Listenansicht nutzt Vollbild" }, 468{ "Event list view uses full window","Listenansicht nutzt Vollbild" },
469{ "Set agenda to DayBeginsAt on change","Setze Agenda auf TagBeginntUm bei Wechsel" }, 469{ "Set agenda to DayBeginsAt on change","Setze Agenda auf TagBeginntUm bei Wechsel" },
470{ "Set agenda to current time on change","Setze Agenda auf gegenw.Zeit bei Wechsel" }, 470{ "Set agenda to current time on change","Setze Agenda auf gegenw.Zeit bei Wechsel" },
471{ "Listview uses monthly timespan","Listenansicht zeigt monatliche Zeitspanne" }, 471{ "Listview uses monthly timespan","Listenansicht zeigt monatliche Zeitspanne" },
472{ "ViewChange","Ansichtswechsel" }, 472{ "ViewChange","Ansichtswechsel" },
473{ "Default alarm *.wav file:","Standard Alarm *.wav Datei:" }, 473{ "Default alarm *.wav file:","Standard Alarm *.wav Datei:" },
474{ "This setting is useless for 5500 user!","Diese Einst. ist nutzlos für 5500 Nutzer" }, 474{ "This setting is useless for 5500 user!","Diese Einst. ist nutzlos für 5500 Nutzer" },
475{ "File","Datei" }, 475{ "File","Datei" },
476{ "Clone...","Dupliziere..." }, 476{ "Clone...","Dupliziere..." },
477{ "Move...","Bewege..." }, 477{ "Move...","Bewege..." },
478{ "Beam...","Sende via IR..." }, 478{ "Beam...","Sende via IR..." },
479{ "&Clone...","Dupliziere.." }, 479{ "&Clone...","Dupliziere.." },
480{ "&Move...","Bewege..." }, 480{ "&Move...","Bewege..." },
481{ "&Beam...","Sende via IR..." }, 481{ "&Beam...","Sende via IR..." },
482{ "Show Completed","Zeige erledigte Todos" }, 482{ "Show Completed","Zeige erledigte Todos" },
483{ "Show Quick Todo","Zeige Quick Todo" }, 483{ "Show Quick Todo","Zeige Quick Todo" },
484{ "Unparent Todo","Un-sub Todo" }, 484{ "Unparent Todo","Un-sub Todo" },
485{ "Save selected to file...","Speichere Selektierte..." }, 485{ "Save selected to file...","Speichere Selektierte..." },
486{ "Add Categ. to selected...","Füge zu Selekt. Kateg. hinzu..." }, 486{ "Add Categ. to selected...","Füge zu Selekt. Kateg. hinzu..." },
487{ "Set Categ. for selected...","Setze Kateg. für Selekt." }, 487{ "Set Categ. for selected...","Setze Kateg. für Selekt." },
488{ "Beam selected via IR","Sende Selekt. via IR..." }, 488{ "Beam selected via IR","Sende Selekt. via IR..." },
489{ "Search","Suchen" }, 489{ "Search","Suchen" },
490{ "Date Picker","Datum auswählen" }, 490{ "Date Picker","Datum auswählen" },
491{ "Day View","Tagesansicht" }, 491{ "Day View","Tagesansicht" },
492{ "Work Week","Arbeitswoche" }, 492{ "Work Week","Arbeitswoche" },
493{ "Week","Wochenansicht" }, 493{ "Week","Wochenansicht" },
494{ "Month","Monatsansicht" }, 494{ "Month","Monatsansicht" },
495{ "Todo View","Todo Liste" }, 495{ "Todo View","Todo Liste" },
496{ "Journal","Journal" }, 496{ "Journal","Journal" },
497{ "Next days","Nächste Tage" }, 497{ "Next days","Nächste Tage" },
498{ "Print agenda selection...","Drucke Agendaselektion..." }, 498{ "Print agenda selection...","Drucke Agendaselektion..." },
499{ "Toggle DateNavigator","Navigator umschalten" }, 499{ "Toggle DateNavigator","Navigator umschalten" },
500{ "Toggle FilterView","Filteransicht umschalten" }, 500{ "Toggle FilterView","Filteransicht umschalten" },
501{ "Prev. month","Vorheriger Monat" }, 501{ "Prev. month","Vorheriger Monat" },
502{ "Go backward","Gehe zurück" }, 502{ "Go backward","Gehe zurück" },
503{ "Go forward","Gehe weiter" }, 503{ "Go forward","Gehe weiter" },
504{ "Synchronize","Synchronisieren" }, 504{ "Synchronize","Synchronisieren" },
505{ "AgendaSize","Agendagröße" }, 505{ "AgendaSize","Agendagröße" },
506{ "Import (*.ics/*.vcs) file","Importiere (*.ics/*.vcs) Datei" }, 506{ "Import (*.ics/*.vcs) file","Importiere (*.ics/*.vcs) Datei" },
507{ "Import last file","Importiere letzte Datei" }, 507{ "Import last file","Importiere letzte Datei" },
508{ "Import Opie/Qtopia Cal.","Importiere Opie/Qtopia Kal." }, 508{ "Import Opie/Qtopia Cal.","Importiere Opie/Qtopia Kal." },
509{ "Load Calendar Backup","Lade Kalender Backup" }, 509{ "Load Calendar Backup","Lade Kalender Backup" },
510{ "Save Calendar Backup...","Speichere Kalender Backup..." }, 510{ "Save Calendar Backup...","Speichere Kalender Backup..." },
511{ "Export VCalendar","Exportiere VCalendar" }, 511{ "Export VCalendar","Exportiere VCalendar" },
512{ "Manage new categories...","Verwalte neue Kategorien..." }, 512{ "Manage new categories...","Verwalte neue Kategorien..." },
513{ "Beam complete calendar...","Sende kompletten Kalender..." }, 513{ "Beam complete calendar...","Sende kompletten Kalender..." },
514{ "Beam filtered calendar...","Sende gefilterten Kalender..." }, 514{ "Beam filtered calendar...","Sende gefilterten Kalender..." },
515{ "Remote via ssh","Über Netzwerk via ssh" }, 515{ "Remote via ssh","Über Netzwerk via ssh" },
516{ "With local file","Mit lokaler Datei" }, 516{ "With local file","Mit lokaler Datei" },
517{ "With last file","Mit letzter Datei" }, 517{ "With last file","Mit letzter Datei" },
518{ "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" }, 518{ "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" },
519{ "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" }, 519{ "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" },
520{ "Save filename","Speichern: Dateinamen wählen" }, 520{ "Save filename","Speichern: Dateinamen wählen" },
521{ "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" }, 521{ "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" },
522{ "KO/Pi: Warning!","KO/Pi: Warnung!" }, 522{ "KO/Pi: Warning!","KO/Pi: Warnung!" },
523{ "Overwrite!","Überschreibe!" }, 523{ "Overwrite!","Überschreibe!" },
524{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, 524{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" },
525{ "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" }, 525{ "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" },
526{ "KO/Pi Confirmation","KO/Pi Bestätigung" }, 526{ "KO/Pi Confirmation","KO/Pi Bestätigung" },
527{ "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" }, 527{ "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" },
528{ "Deleting item %d ...","Lösche Eintrag %d ..." }, 528{ "Deleting item %d ...","Lösche Eintrag %d ..." },
529{ "%d items remaining in list.","%d Einträge sind in der Liste verblieben." }, 529{ "%d items remaining in list.","%d Einträge sind in der Liste verblieben." },
530{ "Size","Größe" }, 530{ "Size","Größe" },
531{ "Date","Datum" }, 531{ "Date","Datum" },
532{ "Mime Type","Datei Typ" }, 532{ "Mime Type","Datei Typ" },
533{ "All Files","Alle Dateien" }, 533{ "All Files","Alle Dateien" },
534{ "Files","Dateien" }, 534{ "Files","Dateien" },
535{ "Documents","DoKumente" }, 535{ "Documents","DoKumente" },
536{ "Select Categories","Selektiere Kategorien" }, 536{ "Select Categories","Selektiere Kategorien" },
537{ " &Deselect All "," Auswahl aufheben " }, 537{ " &Deselect All "," Auswahl aufheben " },
538{ "A&dd","Hinzu" }, 538{ "A&dd","Hinzu" },
539{ "&Modify","Ändern" }, 539{ "&Modify","Ändern" },
540{ "Edit Categories","Editiere Kategorien" }, 540{ "Edit Categories","Editiere Kategorien" },
541{ " &Edit Categories "," &Editiere Kategorien " }, 541{ " &Edit Categories "," &Editiere Kategorien " },
542{ "Beam Options","Beam Einstellungen" }, 542{ "Beam Options","Beam Einstellungen" },
543{ " With timezone "," Mit Zeitzone " }, 543{ " With timezone "," Mit Zeitzone " },
544{ " Local time ", " Lokale Zeit " }, 544{ " Local time ", " Lokale Zeit " },
545{ "Manage new Categories","Verwalte neue Kategorien" }, 545{ "Manage new Categories","Verwalte neue Kategorien" },
546{ "Add to category list","Füge zur Kategorieliste hinzu" }, 546{ "Add to category list","Füge zur Kategorieliste hinzu" },
547{ "Remove from Events/Todos","Entferne von Terminen/Todos" }, 547{ "Remove from Events/Todos","Entferne von Terminen/Todos" },
548{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, 548{ "New categories not in list:","Kategorien, die nicht in der Liste sind:" },
549{ "File format","Datei Format" }, 549{ "File format","Datei Format" },
550{ "Time format","Zeit Format" }, 550{ "Time format","Zeit Format" },
551{ "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." }, 551{ "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." },
552{ "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" }, 552{ "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" },
553{ "h","Std" }, 553{ "h","Std" },
554{ "min","Min" }, 554{ "min","Min" },
555{ "hou","Std" }, 555{ "hou","Std" },
556{ "day","Tag" }, 556{ "day","Tag" },
557{ "French","Französich" }, 557{ "French","Französich" },
558{ "Time","Zeit" }, 558{ "Time","Zeit" },
559{ "Event Viewer","Termin Ansicht" }, 559{ "Event Viewer","Termin Ansicht" },
560{ "Cancel Sync","Sync Abbrechen" }, 560{ "Cancel Sync","Sync Abbrechen" },
561{ "Remote","Fern" }, 561{ "Remote","Fern" },
562{ "Local","Lokal" }, 562{ "Local","Lokal" },
563{ "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" }, 563{ "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" },
564{ "Local: ","Lokal: " }, 564{ "Local: ","Lokal: " },
565{ "Remote: ","Fern: " }, 565{ "Remote: ","Fern: " },
566{ "Last modified: ","Zuletzt geändert: " }, 566{ "Last modified: ","Zuletzt geändert: " },
567{ "Location: ","Ort: " }, 567{ "Location: ","Ort: " },
568{ "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" }, 568{ "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</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</p> ","<p><b>Von:</b> %1</p> " }, 570{ "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " },
571{ "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" }, 571{ "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" },
572{ "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " }, 572{ "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " },
573{ "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" }, 573{ "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" },
574{ "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." }, 574{ "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." },
575{ "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" }, 575{ "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" },
576{ "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" }, 576{ "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" },
577{ "( %1 min before )","( %1 min vorher )" }, 577{ "( %1 min before )","( %1 min vorher )" },
578{ "<b>Alarm on: ","<b>Alarm am: " }, 578{ "<b>Alarm on: ","<b>Alarm am: " },
579{ "<b>Details: </b>","<b>Details: </b>" }, 579{ "<b>Details: </b>","<b>Details: </b>" },
580{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, 580{ "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" },
581{ "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" }, 581{ "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" },
582{ "Organizer","Organisator" }, 582{ "Organizer","Organisator" },
583{ "Save","Speichern" }, 583{ "Save","Speichern" },
584{ "Exit (+save)","Beenden (+ speichern)" }, 584{ "Exit (+save)","Beenden (+ speichern)" },
585{ "Home","Zuhause" }, 585{ "Home","Zuhause" },
586{ "Office","Büro" }, 586{ "Office","Büro" },
587{ "Library","Bibliothek" }, 587{ "Library","Bibliothek" },
588{ "Doctor","Arzt" }, 588{ "Doctor","Arzt" },
589{ "Beach","Strand" }, 589{ "Beach","Strand" },
590{ "Conference room","Konferenzraum" }, 590{ "Conference room","Konferenzraum" },
591{ "Drive Home","Heimfahrt" }, 591{ "Drive Home","Heimfahrt" },
592{ "Watch TV","Tv gucken" }, 592{ "Watch TV","Tv gucken" },
593{ "Phone call","Telefonanruf" }, 593{ "Phone call","Telefonanruf" },
594{ "Pay bill","Rechnung bezahlen" }, 594{ "Pay bill","Rechnung bezahlen" },
595{ "Read book","Buch lesen" }, 595{ "Read book","Buch lesen" },
596{ "Watering plants","Pflanzen giessen" }, 596{ "Watering plants","Pflanzen giessen" },
597{"Appointment","Verabredung" }, 597{"Appointment","Verabredung" },
598{"Birthday","Geburtstag" }, 598{"Birthday","Geburtstag" },
599{"Business","Geschäft" }, 599{"Business","Geschäft" },
600{"Business Travel","Geschäftsreise" }, 600{"Business Travel","Geschäftsreise" },
601{"Cinema","Kino" }, 601{"Cinema","Kino" },
602{"Customer","Kunde" }, 602{"Customer","Kunde" },
603{"Break","Pause" }, 603{"Break","Pause" },
604{"Breakfast","Frühstück" }, 604{"Breakfast","Frühstück" },
605{"Competition","Wettkampf" }, 605{"Competition","Wettkampf" },
606{"Dinner","Abendessen" }, 606{"Dinner","Abendessen" },
607{"Education","Erziehung" }, 607{"Education","Erziehung" },
608{"Family","Familie" }, 608{"Family","Familie" },
609{"Favorites","Favoriten" }, 609{"Favorites","Favoriten" },
610{"Festival","Festival" }, 610{"Festival","Festival" },
611{"Fishing","Angeln" }, 611{"Fishing","Angeln" },
612{"Flight","Flug" }, 612{"Flight","Flug" },
613{"Gifts","Geschenk" }, 613{"Gifts","Geschenk" },
614{"Holiday","Feiertag" }, 614{"Holiday","Feiertag" },
615{"Holiday Cards","Ansichtskarten" }, 615{"Holiday Cards","Ansichtskarten" },
616{"Hot Contacts","Heisse Kontakte" }, 616{"Hot Contacts","Heisse Kontakte" },
617{"Hiking","Wandern" }, 617{"Hiking","Wandern" },
618{"Hunting","Jagen" }, 618{"Hunting","Jagen" },
619{"Key Customer","Wichtiger Kunde" }, 619{"Key Customer","Wichtiger Kunde" },
620{"Kids","Kinder" }, 620{"Kids","Kinder" },
621{"Lunch","Mittagessen" }, 621{"Lunch","Mittagessen" },
622{"Meeting","Treffen" }, 622{"Meeting","Treffen" },
623{"Miscellaneous","Verschiedenes" }, 623{"Miscellaneous","Verschiedenes" },
624{"Partner","Partner" }, 624{"Partner","Partner" },
625{"Party","Partie" }, 625{"Party","Partie" },
626{"Personal","Privat" }, 626{"Personal","Privat" },
627{"Personal Travel","Privatreise"}, 627{"Personal Travel","Privatreise"},
628{"PHB","PHB" }, 628{"PHB","PHB" },
629{"Phone Calls","Telefonanruf" }, 629{"Phone Calls","Telefonanruf" },
630{"Projects","Projekt" }, 630{"Projects","Projekt" },
631{"Recurring","Wiederholend" }, 631{"Recurring","Wiederholend" },
632{"School","Schule" }, 632{"School","Schule" },
633{"Shopping","Einkaufen" }, 633{"Shopping","Einkaufen" },
634{"Speach","Rede" }, 634{"Speach","Rede" },
635{"Special Occasion","Spez.Gelegenheit" }, 635{"Special Occasion","Spez.Gelegenheit" },
636{"Sports","Sport" }, 636{"Sports","Sport" },
637{"Talk","Vortrag" }, 637{"Talk","Vortrag" },
638{"Travel","Reise" }, 638{"Travel","Reise" },
639{"TV","TV" }, 639{"TV","TV" },
640{"Germany","Deutschland" }, 640{"Germany","Deutschland" },
641{"Sweden","Schweden" }, 641{"Sweden","Schweden" },
642{"Forest","Wald" }, 642{"Forest","Wald" },
643{ "Desert","Wüste" }, 643{ "Desert","Wüste" },
644{ "Kitchen","Küche" }, 644{ "Kitchen","Küche" },
645{ "Lake","See" }, 645{ "Lake","See" },
646{"University","Universität"}, 646{"University","Universität"},
647{"Vacation","Urlaub" }, 647{"Vacation","Urlaub" },
648{"VIP","VIP" }, 648{"VIP","VIP" },
649{ "Import Sharp Calendar","Importiere Sharp Kalender" }, 649{ "Import Sharp Calendar","Importiere Sharp Kalender" },
650{ "This todo has been cancelled!","Dieses Todo wurde gecancelt!" }, 650{ "This todo has been cancelled!","Dieses Todo wurde gecancelt!" },
651{ "This event has been cancelled!","Dieser Termin wurde gecancelt!" }, 651{ "This event has been cancelled!","Dieser Termin wurde gecancelt!" },
652{ "Cancelled","Gecancelt" }, 652{ "Cancelled","Gecancelt" },
653{ "Multiple sync","Mehrfach Sync" }, 653{ "Multiple sync","Mehrfach Sync" },
654{ "Local file","Lokale Datei" }, 654{ "Local file","Lokale Datei" },
655{ "Last file","Letzte Datei" }, 655{ "Last file","Letzte Datei" },
656{ "Keys + Colors...","Tasten + Farben..." }, 656{ "Keys + Colors...","Tasten + Farben..." },
657{ "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" }, 657{ "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" },
658{ "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" }, 658{ "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" },
659{ "Choose...","Wähle..." }, 659{ "Choose...","Wähle..." },
660{ "Use colors for application:","Setze Farben für Programm:" }, 660{ "Use colors for application:","Setze Farben für Programm:" },
661{ "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" }, 661{ "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" },
662{ "Frames, labels, etc.:","Rahmen, Label, etc.:" }, 662{ "Frames, labels, etc.:","Rahmen, Label, etc.:" },
663{ "Show parent To-Do's","Zeige Ober-Todos" }, 663{ "Show parent To-Do's","Zeige Ober-Todos" },
664{ "Show location","Zeige Orte" }, 664{ "Show location","Zeige Orte" },
665{ "Show events that recur ","Zeige Termine, die sich wiederholen:" }, 665{ "Show events that recur ","Zeige Termine, die sich wiederholen:" },
666{ "Show in every cell ","Zeige in jeder Zelle " }, 666{ "Show in every cell ","Zeige in jeder Zelle " },
667{ "short month","kurzen Monat" }, 667{ "short month","kurzen Monat" },
668{ "icons","Icons" }, 668{ "icons","Icons" },
669{ "Show Sat/Sun together","Zeige Sam/Son zusammen" }, 669{ "Show Sat/Sun together","Zeige Sam/Son zusammen" },
670{ "Category colors are applied to text","Kategorie Farben färben Text" }, 670{ "Category colors are applied to text","Kategorie Farben färben Text" },
671{ "Month view uses day colors","Monatsansicht zeigt Tagesfarben" }, 671{ "Month view uses day colors","Monatsansicht zeigt Tagesfarben" },
672{ "Day color odd months","Tagesfarbe ungerade Monate" }, 672{ "Day color odd months","Tagesfarbe ungerade Monate" },
673{ "Day color even months","Tagesfarbe gerade Monate" }, 673{ "Day color even months","Tagesfarbe gerade Monate" },
674{ "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" }, 674{ "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" },
675{ "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" }, 675{ "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" },
676{ "Small To-do view uses smaller font","Kleine To-do Ansicht nutzt kleineren Font" }, 676{ "Small To-do view uses smaller font","Kleine To-do Ansicht nutzt kleineren Font" },
677{ "Colors are applied to text","Farben werden auf Text angewendet" }, 677{ "Colors are applied to text","Farben werden auf Text angewendet" },
678{ "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" }, 678{ "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" },
679{ "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" }, 679{ "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" },
680{ "Play beeps count:","Anzahl der Alarmpiepse: " }, 680{ "Play beeps count:","Anzahl der Alarmpiepse: " },
681{ "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " }, 681{ "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " },
682{ "Default suspend time in min:","Standard Supendierungs Zeit: " }, 682{ "Default suspend time in min:","Standard Supendierungs Zeit: " },
683{ "Auto suspend count:","Anzahl der auto Suspendierungen" }, 683{ "Auto suspend count:","Anzahl der auto Suspendierungen" },
684{ "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" }, 684{ "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" },
685{ "New profile","Neues Profil" }, 685{ "New profile","Neues Profil" },
686{ "Clone profile","Klone Profil" }, 686{ "Clone profile","Klone Profil" },
687{ "Delete profile","Lösche Profil" }, 687{ "Delete profile","Lösche Profil" },
688{ "Profile:","Profil:" }, 688{ "Profile:","Profil:" },
689{ "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, 689{ "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" },
690{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, 690{ "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" },
691{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, 691{ "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" },
692{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, 692{ "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" },
693{ "Write back file","Schreibe Datei zurück" }, 693{ "Write back file","Schreibe Datei zurück" },
694{ "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, 694{ "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" },
695{ "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, 695{ "Pre sync (download) command:","Bevor Sync (download) Kommando:" },
696{ "Local device name:","Name dieses Gerätes:" }, 696{ "Local device name:","Name dieses Gerätes:" },
697{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, 697{ "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" },
698{ "Sync preferences","Synchronisations Einstellungen" }, 698{ "Sync preferences","Synchronisations Einstellungen" },
699{ "Profile kind","Profil Art" }, 699{ "Profile kind","Profil Art" },
700{ "Local file","Lokale Datei" }, 700{ "Local file","Lokale Datei" },
701{ "Local file:","Lokale Datei:" }, 701{ "Local file:","Lokale Datei:" },
702{ "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, 702{ "Post sync (upload) command:","Nach Sync (upload) Kommando:" },
703{ "Fill in default values for:","Setze Beispiel Werte ein für:" }, 703{ "Fill in default values for:","Setze Beispiel Werte ein für:" },
704{ "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, 704{ "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" },
705{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, 705{ "Synchronization Preferences","Einstellungen der Synchronisationsprofile"},
706{ "Device","Gerät:" }, 706{ "Device","Gerät:" },
707{ "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, 707{ "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" },
708{ "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" }, 708{ "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" },
709{ "Synchronization successful","Synchronisation erfolgreich" }, 709{ "Synchronization successful","Synchronisation erfolgreich" },
710{ "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, 710{ "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." },
711{ "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, 711{ "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" },
712{ "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, 712{ "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" },
713{ "Enter password","Passwort eingeben" }, 713{ "Enter password","Passwort eingeben" },
714{ "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, 714{ "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" },
715{ "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, 715{ "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." },
716{ "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" }, 716{ "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" },
717{ "Writing back file result: ","Resultat des Dateizurückschreibens: " }, 717{ "Writing back file result: ","Resultat des Dateizurückschreibens: " },
718{ "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, 718{ "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" },
719{ "Edit Calendar Filters","Editiere Kalendar Filter" }, 719{ "Edit Calendar Filters","Editiere Kalendar Filter" },
720{ "Enter filter name:","Neuer Filter Name:" }, 720{ "Enter filter name:","Neuer Filter Name:" },
721{ "Add Filter","Filter hinzufügen" }, 721{ "Add Filter","Filter hinzufügen" },
722{ "Question","Frage" }, 722{ "Question","Frage" },
723{ "Filter position: ","Filter Position: " }, 723{ "Filter position: ","Filter Position: " },
724{ "Month View","Monatsansicht" }, 724{ "Month View","Monatsansicht" },
725{ "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" }, 725{ "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" },
726{ "KO/Pi config error","KO/Pi Konfig. Fehler" }, 726{ "KO/Pi config error","KO/Pi Konfig. Fehler" },
727{ "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, 727{ "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" },
728{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" }, 728{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" },
729{ "Access: ","Zugriff: " }, 729{ "Access: ","Zugriff: " },
730{ "Needs Action","Aktion notwendig" }, 730{ "Needs Action","Aktion notwendig" },
731{ "Accepted","Akzeptiert" }, 731{ "Accepted","Akzeptiert" },
732{ "Declined","Abgelehnt" }, 732{ "Declined","Abgelehnt" },
733{ "Tentative","Vorläufig" }, 733{ "Tentative","Vorläufig" },
734{ "Delegated","Beauftragt" }, 734{ "Delegated","Beauftragt" },
735{ "Completed","Vollständig" }, 735{ "Completed","Vollständig" },
736{ "In Process","In Bearbeitung" }, 736{ "In Process","In Bearbeitung" },
737{ "Participant","Teilnehmer" }, 737{ "Participant","Teilnehmer" },
738{ "Optional Participant","Möglicher Teilnehmer" }, 738{ "Optional Participant","Möglicher Teilnehmer" },
739{ "Observer","Beobachter" }, 739{ "Observer","Beobachter" },
740{ "Chair","Vorsitzender" }, 740{ "Chair","Vorsitzender" },
741{ "Not supported \non desktop!\n","" }, 741{ "Not supported \non desktop!\n","" },
742{ "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) " }, 742{ "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) " },
743{ "Date range: ","Datums Zeitspanne: " }, 743{ "Date range: ","Datums Zeitspanne: " },
744{ "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " }, 744{ "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " },
745{ "Syncing - close to abort!","Syncing-schließe um abzubrechen." }, 745{ "Syncing - close to abort!","Syncing-schließe um abzubrechen." },
746{ "Add / remove events","Add./entferne Termine" }, 746{ "Add / remove events","Add./entferne Termine" },
747{ "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." }, 747{ "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." },
748{ "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." }, 748{ "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." },
749{ "\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie gepeicherte Datei wurde verändert!\nDatei Grösse: %1 Bytes.\nZuletzt geändert: %2\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, 749{ "\nThe file on disk has changed!\nFile size: %1 bytes.\nLast modified: %2\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie gepeicherte Datei wurde verändert!\nDatei Grösse: %1 Bytes.\nZuletzt geändert: %2\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" },
750{ "Overwrite","Überschreiben" }, 750{ "Overwrite","Überschreiben" },
751{ "Sync+save","Syncen+speichern" }, 751{ "Sync+save","Syncen+speichern" },
752{ "Default","Standard" }, 752{ "Default","Standard" },
753{ " Categories added to list! "," Kategorien zur Liste hinzugefügt! " }, 753{ " Categories added to list! "," Kategorien zur Liste hinzugefügt! " },
754{ " %d items?"," %d Einträge?" }, 754{ " %d items?"," %d Einträge?" },
755{ "\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?" }, 755{ "\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?" },
756{ " ?\n\nDelete:\n"," ?\n\nLösche:\n" }, 756{ " ?\n\nDelete:\n"," ?\n\nLösche:\n" },
757{ "Current","Aktuelle" }, 757{ "Current","Aktuelle" },
758{ "\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" }, 758{ "\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" },
759{ "All","Alle" }, 759{ "All","Alle" },
760{ "Data Loss Warning","Datenverlust Warnung" }, 760{ "Data Loss Warning","Datenverlust Warnung" },
761{ "Proceed","Weitermachen" }, 761{ "Proceed","Weitermachen" },
762{ "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" }, 762{ "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" },
763{ "Filter disabled ","Filter abgeschaltet" }, 763{ "Filter disabled ","Filter abgeschaltet" },
764{ "Filter selected: ","Gewählter Filter: " }, 764{ "Filter selected: ","Gewählter Filter: " },
765{ "Toggle Cancel","Gecancelt ändern" }, 765{ "Toggle Cancel","Gecancelt ändern" },
766{ "&Toggle Cancel","Gecancel&t ändern" }, 766{ "&Toggle Cancel","Gecancel&t ändern" },
767{ "Configure Toolbar","Konfiguriere Toolbar" }, 767{ "Configure Toolbar","Konfiguriere Toolbar" },
768{ "Stretched TB","Gedehnte TB" }, 768{ "Stretched TB","Gedehnte TB" },
769{ "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" }, 769{ "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" },
770{ "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" }, 770{ "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" },
771{ "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" }, 771{ "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" },
772{ "Not supported \non desktop!\n","Nur verfügbar auf PDA!" }, 772{ "Not supported \non desktop!\n","Nur verfügbar auf PDA!" },
773{ "Imported file successfully","Datei erfolgreich importiert" }, 773{ "Imported file successfully","Datei erfolgreich importiert" },
774{ "Error importing file","Fehler beim Importieren der Datei" }, 774{ "Error importing file","Fehler beim Importieren der Datei" },
775{ "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, 775{ "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" },
776{ "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" }, 776{ "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" },
777{ "Overwrite!","Überschreiben!" }, 777{ "Overwrite!","Überschreiben!" },
778{ "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" }, 778{ "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" },
779{ "Load backup filename","Lade Backup Dateiname" }, 779{ "Load backup filename","Lade Backup Dateiname" },
780{ "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" }, 780{ "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" },
781{ "KO/Pi:Loaded %1","KO/Pi:Geladen %1" }, 781{ "KO/Pi:Loaded %1","KO/Pi:Geladen %1" },
782{ "Save backup filename","Speichere Backup Dateiname" }, 782{ "Save backup filename","Speichere Backup Dateiname" },
783{ "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" }, 783{ "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" },
784{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, 784{ "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" },
785{ "Details of attendee","Teilnehmerdetails" }, 785{ "Details of attendee","Teilnehmerdetails" },
786{ "Work phone:\n","Telefon Arbeit:\n" }, 786{ "Work phone:\n","Telefon Arbeit:\n" },
787{ "Work mobile phone:\n","Mobiltelefon Arbeit:\n" }, 787{ "Work mobile phone:\n","Mobiltelefon Arbeit:\n" },
788{ "Home phone:\n","Telefon privat:\n" }, 788{ "Home phone:\n","Telefon privat:\n" },
789{ "Mobile home phone:\n","Mobiltelefon privat:\n" }, 789{ "Mobile home phone:\n","Mobiltelefon privat:\n" },
790{ "Email:\n","Email:\n" }, 790{ "Email:\n","Email:\n" },
791{ "Alarm disabled for this item","Alarm deaktiviert für dieses Item" }, 791{ "Alarm disabled for this item","Alarm deaktiviert für dieses Item" },
792{ "Audio Al.: ","Audio Al.: " }, 792{ "Audio Al.: ","Audio Al.: " },
793{ "Proc.Al.: ","Proz.Al.: " }, 793{ "Proc.Al.: ","Proz.Al.: " },
794{ "No sound set","Kein Sound definiert" }, 794{ "No sound set","Kein Sound definiert" },
795{ "*.wav|Wav Files","*.wav|Wav Dateien" }, 795{ "*.wav|Wav Files","*.wav|Wav Dateien" },
796{ "No program set","Kein Programm definiert" }, 796{ "No program set","Kein Programm definiert" },
797{ "Running '%1'","Ausführen '%1'" }, 797{ "Running '%1'","Ausführen '%1'" },
798{ "Playing '%1'","Abspielen '%1'" }, 798{ "Playing '%1'","Abspielen '%1'" },
799{ "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" }, 799{ "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" },
800{ "Load!","Laden!" }, 800{ "Load!","Laden!" },
801{ "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" }, 801{ "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" },
802{ "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" }, 802{ "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" },
803{ "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" }, 803{ "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" },
804{ "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" }, 804{ "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" },
805{ "Features + hints...","Eigenschaften + Tipps..." }, 805{ "Features + hints...","Eigenschaften + Tipps..." },
806{ "User translation...","Benutzer Übersetzung..." }, 806{ "User translation...","Benutzer Übersetzung..." },
807{ "Sync HowTo...","Synchronisation HowTo..." }, 807{ "Sync HowTo...","Synchronisation HowTo..." },
808{ "Print calendar...","Drucke Kalender..." }, 808{ "Print calendar...","Drucke Kalender..." },
809{ "Anniversary","Jahrestag" }, 809{ "Anniversary","Jahrestag" },
810{ "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" }, 810{ "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" },
811{ "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" }, 811{ "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" },
812{ "Next recurrence is on: ","Nächste Wiederholung ist am:" }, 812{ "Next recurrence is on: ","Nächste Wiederholung ist am:" },
813{ "<b>Alarm on: </b>","<b>Alarm am: </b>" }, 813{ "<b>Alarm on: </b>","<b>Alarm am: </b>" },
814{ "<b>Access: </b>","<b>Zugriff: </b>" }, 814{ "<b>Access: </b>","<b>Zugriff: </b>" },
815{ "(%1 min before)","(%1 min vorher)" }, 815{ "(%1 min before)","(%1 min vorher)" },
816{ "<b>Categories: </b>","<b>Kategorien: </b>" }, 816{ "<b>Categories: </b>","<b>Kategorien: </b>" },
817{ "Save Journal/Description...","Speichere Journal/Details..." }, 817{ "Save Journal/Description...","Speichere Journal/Details..." },
818{ "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." }, 818{ "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." },
819{ "Continue","Weitermachen" }, 819{ "Continue","Weitermachen" },
820{ " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" }, 820{ " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" },
821{ "Attendee:","Teilnehmer:" }, 821{ "Attendee:","Teilnehmer:" },
822{ "Click OK to search ->","Klicke zum Suchen auf OK ->" }, 822{ "Click OK to search ->","Klicke zum Suchen auf OK ->" },
823{ "On day ","Am Tag " }, 823{ "On day ","Am Tag " },
824{ "%1 of ","%1 des Monats" }, 824{ "%1 of ","%1 des Monats" },
825{ "%1 of the year","%1 des Jahres" }, 825{ "%1 of the year","%1 des Jahres" },
826{ "Anonymous","Anonymo" }, 826{ "Anonymous","Anonymo" },
827{ "nobody@nowhere","niemand@nirgendwo" }, 827{ "nobody@nowhere","niemand@nirgendwo" },
828{ "calendar.html","calendar.html" }, 828{ "calendar.html","calendar.html" },
829{ " Local Time"," Lokale Zeit" }, 829{ " Local Time"," Lokale Zeit" },
830{ "Unknown Name","Unbekannter Name" }, 830{ "Unknown Name","Unbekannter Name" },
831{ "unknown@nowhere","unbekannt@nirgendwo" }, 831{ "unknown@nowhere","unbekannt@nirgendwo" },
832{ "Beam via IR!","Beam via IR!" }, 832{ "Beam via IR!","Beam via IR!" },
833{ "Next Month","Nächster Monat" }, 833{ "Next Month","Nächster Monat" },
834{ "Prio","Prio" }, 834{ "Prio","Prio" },
835{ "Reparent Todo","Mache Sub-Todo" }, 835{ "Reparent Todo","Mache Sub-Todo" },
836{ "tomorrow","morgen" }, 836{ "tomorrow","morgen" },
837{ "today","heute" }, 837{ "today","heute" },
838{ "yesterday","gestern" }, 838{ "yesterday","gestern" },
839{ "Ok","Ok" }, 839{ "Ok","Ok" },
840{ "Ok+Agenda","Ok+Agenda" }, 840{ "Ok+Agenda","Ok+Agenda" },
841{ "Email","Email" }, 841{ "Email","Email" },
842{ "RSVP","RSVP" }, 842{ "RSVP","RSVP" },
843{ "Email:","Email:" }, 843{ "Email:","Email:" },
844{ "Appointment Time ","Termin Zeit " }, 844{ "Appointment Time ","Termin Zeit " },
845{ "2","2" }, 845{ "2","2" },
846{ "3","3" }, 846{ "3","3" },
847{ "4","4" }, 847{ "4","4" },
848{ " 0 %"," 0 %" }, 848{ " 0 %"," 0 %" },
849{ " 20 %"," 20 %" }, 849{ " 20 %"," 20 %" },
850{ " 40 %"," 40 %" }, 850{ " 40 %"," 40 %" },
851{ " 60 %"," 60 %" }, 851{ " 60 %"," 60 %" },
852{ " 80 %"," 80 %" }, 852{ " 80 %"," 80 %" },
853{ "100 %","100 %" }, 853{ "100 %","100 %" },
854{ "Filter","Filter" }, 854{ "Filter","Filter" },
855{ "Configure","Konfiguriere" }, 855{ "Configure","Konfiguriere" },
856{ "What's Next","What's Next" }, 856{ "What's Next","What's Next" },
857{ "Complete calendar...","Kompletten Kalender..." }, 857{ "Complete calendar...","Kompletten Kalender..." },
858{ "Filtered calendar...","Gefilterten Kalender..." }, 858{ "Filtered calendar...","Gefilterten Kalender..." },
859{ "Export to phone","Exportiere zum Handy" }, 859{ "Export to phone","Exportiere zum Handy" },
860{ "Beam receive enabled","Beam Empfang an" }, 860{ "Beam receive enabled","Beam Empfang an" },
861{ "What's new?","Was ist neu?" }, 861{ "What's new?","Was ist neu?" },
862{ "FAQ...","FAQ..." }, 862{ "FAQ...","FAQ..." },
863{ "Licence...","Licence..." }, 863{ "Licence...","Licence..." },
864{ "What's This?","What's This?" }, 864{ "What's This?","What's This?" },
865{ "&Edit...","&Editiere..." }, 865{ "&Edit...","&Editiere..." },
866{ "Oktober","Oktober" }, 866{ "Oktober","Oktober" },
867{ "Title","Titel" }, 867{ "Title","Titel" },
868{ "%1 %","%1 %" }, 868{ "%1 %","%1 %" },
869{ "Enable Pi-Sync","Schalte Pi-Sync an" }, 869{ "Enable Pi-Sync","Schalte Pi-Sync an" },
870{ "Import!","Importiere!" }, 870{ "Import!","Importiere!" },
871{ "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" }, 871{ "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" },
872{ "Export to phone options","Export ans Handy Optionen" }, 872{ "Export to phone options","Export ans Handy Optionen" },
873{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, 873{ "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." },
874{ "I/O device: ","I/O device: " }, 874{ "I/O device: ","I/O device: " },
875{ "Connection: ","Connection: " }, 875{ "Connection: ","Connection: " },
876{ "Model(opt.): ","Model(opt.): " }, 876{ "Model(opt.): ","Model(opt.): " },
877{ "Write back events in future only","Schreibe nur zukünftige Termine zurück" }, 877{ "Write back events in future only","Schreibe nur zukünftige Termine zurück" },
878{ "Max. weeks in future: ","Max. Wochen in der Zukunft: " }, 878{ "Max. weeks in future: ","Max. Wochen in der Zukunft: " },
879{ "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nTodo/Kalender Daten auf dem Handy!" }, 879{ "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nTodo/Kalender Daten auf dem Handy!" },
880{ "Export to mobile phone!","Exportiere auf das Handy!" }, 880{ "Export to mobile phone!","Exportiere auf das Handy!" },
881{ "Export complete calendar","Exportiere kompletten Kalender" }, 881{ "Export complete calendar","Exportiere kompletten Kalender" },
882{ "Writing to phone...","Sende Daten ans Handy..." }, 882{ "Writing to phone...","Sende Daten ans Handy..." },
883{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, 883{ " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" },
884{ "Retry","Nochmal versuchen" }, 884{ "Retry","Nochmal versuchen" },
885{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, 885{ "KDE/Pim phone access","KDE/Pim Handy Zugriff" },
886{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, 886{ "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" },
887{ "Error exporting to phone!","Fehler beim Export auf das Handy!" }, 887{ "Error exporting to phone!","Fehler beim Export auf das Handy!" },
888{ "Export filtered calendar","Exportiere gefilterten Kalender" }, 888{ "Export filtered calendar","Exportiere gefilterten Kalender" },
889{ "Preferences","Vorlieben" }, 889{ "Preferences","Vorlieben" },
890{ "Global","Global" }, 890{ "Global","Global" },
891{ "Phone","Phone" }, 891{ "Phone","Phone" },
892{ "SMS","SMS" }, 892{ "SMS","SMS" },
893{ "Fax","Fax" }, 893{ "Fax","Fax" },
894{ "Pager","Pager" }, 894{ "Pager","Pager" },
895{ "SIP","SIP" }, 895{ "SIP","SIP" },
896{ "Italian","Italienisch" }, 896{ "Italian","Italienisch" },
897{ "24:00","24:00" }, 897{ "24:00","24:00" },
898{ "12:00am","12:00am" }, 898{ "12:00am","12:00am" },
899{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, 899{ "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" },
900{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, 900{ "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" },
901{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, 901{ "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" },
902{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, 902{ "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" },
903{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, 903{ "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" },
904{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, 904{ "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" },
905{ "Used Mail Client","Benutzter Mail Client" }, 905{ "Used Mail Client","Benutzter Mail Client" },
906{ "Channel:","Channel:" }, 906{ "Channel:","Channel:" },
907{ "Message:","Message:" }, 907{ "Message:","Message:" },
908{ "Parameters:","Parameter:" }, 908{ "Parameters:","Parameter:" },
909{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, 909{ "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" },
910{ "extra Message:","extra Message:" }, 910{ "extra Message:","extra Message:" },
911{ "extra Parameters:","extra Parameter:" }, 911{ "extra Parameters:","extra Parameter:" },
912{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, 912{ "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" },
913{ "External Apps.","Externe Appl." }, 913{ "External Apps.","Externe Appl." },
914{ "24 hours","24 Std." }, 914{ "24 hours","24 Std." },
915{ "3 hours","3 Std." }, 915{ "3 hours","3 Std." },
916{ "1 hour","1 Std." }, 916{ "1 hour","1 Std." },
917{ "15 minutes","15 Min." }, 917{ "15 minutes","15 Min." },
918{ "5 minutes","5 Min." }, 918{ "5 minutes","5 Min." },
919{ "1 minute","1 Min." }, 919{ "1 minute","1 Min." },
920{ "23","23" }, 920{ "23","23" },
921{ "Mon 15","Mon 15" }, 921{ "Mon 15","Mon 15" },
922{ "Configure KO","Konfiguriere KO" }, 922{ "Configure KO","Konfiguriere KO" },
923{ "Event text","Termin Text" }, 923{ "Event text","Termin Text" },
924{ "ToDo","Todo" }, 924{ "ToDo","Todo" },
925{ "Today","Heute" }, 925{ "Today","Heute" },
926{ "What's Next View","What's Next Ansicht" }, 926{ "What's Next View","What's Next Ansicht" },
927{ "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" }, 927{ "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" },
928{ "Alarm","Alarm" }, 928{ "Alarm","Alarm" },
929{ "Used %1 Client","Benutzter %1 Client" }, 929{ "Used %1 Client","Benutzter %1 Client" },
930{ "No email client installed","Kein Email Klient installiert" }, 930{ "No email client installed","Kein Email Klient installiert" },
931{ "Userdefined email client","Benutzerdef. Email Klient" }, 931{ "Userdefined email client","Benutzerdef. Email Klient" },
932{ "OM/Pi email client","OM/Pi Email Klient" }, 932{ "OM/Pi email client","OM/Pi Email Klient" },
933{ "Include in multiple ","Beziehe in multiple " }, 933{ "Include in multiple ","Beziehe in multiple " },
934{ "calendar ","Kalender " }, 934{ "calendar ","Kalender " },
935{ "addressbook ","Adressbuch " }, 935{ "addressbook ","Adressbuch " },
936{ "pwmanager","PWmanager" }, 936{ "pwmanager","PWmanager" },
937{ " sync"," Sync ein" }, 937{ " sync"," Sync ein" },
938{ "Write back synced data","Schreibe gesyncte Daten zurück" }, 938{ "Write back synced data","Schreibe gesyncte Daten zurück" },
939{ "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, 939{ "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" },
940{ "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, 940{ "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" },
941{ "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, 941{ "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " },
942{ "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, 942{ "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" },
943{ "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, 943{ "Mobile device (cell phone)","Mobiles Gerät (Handy)" },
944{ "Help...","Hilfe..." }, 944{ "Help...","Hilfe..." },
945{ "Local file Cal:","Lokale Datei Kal:" }, 945{ "Local file Cal:","Lokale Datei Kal:" },
946{ "Local file ABook:","Lokale Datei ABuch:" }, 946{ "Local file ABook:","Lokale Datei ABuch:" },
947{ "Local file PWMgr:","Lokale Datei PWMgr:" }, 947{ "Local file PWMgr:","Lokale Datei PWMgr:" },
948{ "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, 948{ "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" },
949{ "Calendar:","Kalender:" }, 949{ "Calendar:","Kalender:" },
950{ "AddressBook:","AdressBuch:" }, 950{ "AddressBook:","AdressBuch:" },
951{ "PWManager:","PWManager:" }, 951{ "PWManager:","PWManager:" },
952{ "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, 952{ "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" },
953{ "ssh/scp","ssh/scp" }, 953{ "ssh/scp","ssh/scp" },
954{ "ftp","ftp" }, 954{ "ftp","ftp" },
955{ "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, 955{ "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" },
956{ "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, 956{ "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" },
957{ "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, 957{ "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" },
958{ "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, 958{ "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" },
959{ "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, 959{ "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" },
960{ "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, 960{ "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" },
961{ "KDE-Pim sync config","KDE-Pim sync Konfig" }, 961{ "KDE-Pim sync config","KDE-Pim sync Konfig" },
962{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, 962{ "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" },
963{ "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" }, 963{ "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" },
964{ "Port number (Default: %1)","Port Nummer (Default: %1)" }, 964{ "Port number (Default: %1)","Port Nummer (Default: %1)" },
965{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, 965{ "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" },
966{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, 966{ "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" },
967{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, 967{ "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" },
968{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, 968{ "Enter port for Pi-Sync","Port Nummer für Pi-Sync" },
969{ "Disable Pi-Sync","Schalte Pi-Sync aus" }, 969{ "Disable Pi-Sync","Schalte Pi-Sync aus" },
970{ "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!" }, 970{ "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!" },
971{ "KDE-Pim Sync","KDE-Pim Sync" }, 971{ "KDE-Pim Sync","KDE-Pim Sync" },
972{ "Multiple profiles","Multi-Sync Profile" }, 972{ "Multiple profiles","Multi-Sync Profile" },
973{ "Device: ","Gerät: " }, 973{ "Device: ","Gerät: " },
974{ "Multiple sync started.","Multi-Sync gestartet." }, 974{ "Multiple sync started.","Multi-Sync gestartet." },
975{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, 975{ "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" },
976{ "Turn filter on","Schalte Filter an" }, 976{ "Turn filter on","Schalte Filter an" },
977{ "Turn filter off","Schalte Filter aus" }, 977{ "Turn filter off","Schalte Filter aus" },
978{ "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, 978{ "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" },
979{ "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, 979{ "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" },
980{ "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, 980{ "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" },
981{ "<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" }, 981{ "<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" },
982{ "<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" }, 982{ "<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" },
983{ "<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" }, 983{ "<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" },
984{ "<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" }, 984{ "<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" },
985{ "<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" }, 985{ "<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" },
986{ "<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" }, 986{ "<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" },
987{ "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, 987{ "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" },
988{ "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, 988{ "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" },
989{ "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, 989{ "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" },
990{ "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, 990{ "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" },
991{ "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, 991{ "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" },
992{ "<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" }, 992{ "<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" },
993{ "<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" }, 993{ "<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" },
994{ "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, 994{ "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" },
995{ "<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" }, 995{ "<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" },
996{ "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, 996{ "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" },
997{ "<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" }, 997{ "<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" },
998{ "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, 998{ "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" },
999{ "<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" }, 999{ "<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" },
1000{ "<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" }, 1000{ "<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" },
1001{ "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, 1001{ "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" },
1002{ "<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" }, 1002{ "<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" },
1003{ "<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" }, 1003{ "<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" },
1004{ "<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" }, 1004{ "<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" },
1005{ "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, 1005{ "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" },
1006{ "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, 1006{ "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" },
1007{ "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, 1007{ "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" },
1008{ "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, 1008{ "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" },
1009{ "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, 1009{ "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" },
1010{ "<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" }, 1010{ "<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" },
1011{ "<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" }, 1011{ "<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" },
1012{ "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, 1012{ "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" },
1013{ "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, 1013{ "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" },
1014{ "<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" }, 1014{ "<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" },
1015{ "<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" }, 1015{ "<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" },
1016{ "<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" }, 1016{ "<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" },
1017{ "<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" }, 1017{ "<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" },
1018{ "<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" }, 1018{ "<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" },
1019{ "<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" }, 1019{ "<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" },
1020{ "<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" }, 1020{ "<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" },
1021{ "<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 " }, 1021{ "<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 " },
1022{ "<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" }, 1022{ "<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" },
1023{ "<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" }, 1023{ "<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" },
1024{ "<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" }, 1024{ "<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" },
1025{ "<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" }, 1025{ "<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" },
1026{ "<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" }, 1026{ "<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" },
1027{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, 1027{ "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" },
1028{ "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" }, 1028{ "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" },
1029{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, 1029{ "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" },
1030{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, 1030{ "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" },
1031{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, 1031{ "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" },
1032{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, 1032{ "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" },
1033{ "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" }, 1033{ "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" },
1034{ "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" }, 1034{ "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" },
1035{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, 1035{ "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" },
1036{ "KO/Pi FAQ","KO/Pi FAQ" }, 1036{ "KO/Pi FAQ","KO/Pi FAQ" },
1037{ "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, 1037{ "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" },
1038{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, 1038{ "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" },
1039{ "About KOrganizer/Pi","Über KOrganizer/Pi" }, 1039{ "About KOrganizer/Pi","Über KOrganizer/Pi" },
1040{ "From: ","Von: " }, 1040{ "From: ","Von: " },
1041{ "Remove sync info","Entferne Sync Info" }, 1041{ "Remove sync info","Entferne Sync Info" },
1042{ "For all profiles","Für alle Profile" }, 1042{ "For all profiles","Für alle Profile" },
1043{ "Hide not Running","Verstecke nicht Laufende" }, 1043{ "Hide not Running","Verstecke nicht Laufende" },
1044{ "ME","ME" }, 1044{ "ME","ME" },
1045{ "Toolbar","Toolbar" }, 1045{ "Toolbar","Toolbar" },
1046{ "Undo Delete...","Löschen rückgängig machen..." }, 1046{ "Undo Delete...","Löschen rückgängig machen..." },
1047{ "Undo Delete","Löschen rückgängig machen" }, 1047{ "Undo Delete","Löschen rückgängig machen" },
1048{ "KDE Sync HowTo...","KDE Sync HowTo..." }, 1048{ "KDE Sync HowTo...","KDE Sync HowTo..." },
1049{ "Multi Sync HowTo...","Multi Sync HowTo..." }, 1049{ "Multi Sync HowTo...","Multi Sync HowTo..." },
1050{ "Januar","Januar" }, 1050{ "Januar","Januar" },
1051{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, 1051{ "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" },
1052{ "No Filter","Kein Filter" }, 1052{ "No Filter","Kein Filter" },
1053{ "Multiple Sync options","Multi Sync Optionen" }, 1053{ "Multiple Sync options","Multi Sync Optionen" },
1054{ "Sync algo options","Sync Ablauf Optionen" }, 1054{ "Sync algo options","Sync Ablauf Optionen" },
1055{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, 1055{ "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" },
1056{ "Incoming calendar filter:","Eingehender Kalender Filter:" }, 1056{ "Incoming calendar filter:","Eingehender Kalender Filter:" },
1057{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, 1057{ "Incoming addressbook filter:","Eingehender Adressbuch Filter:" },
1058{ "Write back options","Optionen zum Zurückschreiben" }, 1058{ "Write back options","Optionen zum Zurückschreiben" },
1059{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, 1059{ "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" },
1060{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, 1060{ "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" },
1061{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, 1061{ "Outgoing calendar filter:","Ausgehender Kalender Filter:" },
1062{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, 1062{ "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" },
1063{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, 1063{ "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" },
1064{ "Time period","Zeitspanne" }, 1064{ "Time period","Zeitspanne" },
1065{ "From ","Von " }, 1065{ "From ","Von " },
1066{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, 1066{ " weeks in the past to "," Wochen in der Vergangenheit bis zu " },
1067{ " weeks in the future "," Wochen in der Zukunft " }, 1067{ " weeks in the future "," Wochen in der Zukunft " },
1068{ "Profile kind specific settings","Profil Art abhängige Einstellungen" }, 1068{ "Profile kind specific settings","Profil Art abhängige Einstellungen" },
1069{ "Local temp file:","Lokale temp Datei:" }, 1069{ "Local temp file:","Lokale temp Datei:" },
1070{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, 1070{ "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" },
1071{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, 1071{ "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" },
1072{ "Language","Sprache" }, 1072{ "Language","Sprache" },
1073{ "Time Format","Zeit Format" }, 1073{ "Time Format","Zeit Format" },
1074{ "Time Zone","Zeit Zone" }, 1074{ "Time Zone","Zeit Zone" },
1075{ "%1 groups subscribed","%1 Guppen abboniert" }, 1075{ "%1 groups subscribed","%1 Guppen abboniert" },
1076{ "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" }, 1076{ "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" },
1077{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, 1077{ "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" },
1078{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, 1078{ "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" },
1079{ "Save settings","Speichere Einstellungen" }, 1079{ "Save settings","Speichere Einstellungen" },
1080{ "Save standard","Speichere Standard" }, 1080{ "Save standard","Speichere Standard" },
1081{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, 1081{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
1082{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, 1082{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
1083{ "Data storage path","Daten Speicherpfad" }, 1083{ "Data storage path","Daten Speicherpfad" },
1084{ "Language","Sprache" }, 1084{ "Language","Sprache" },
1085{ "Show time in agenda items","Zeige Zeit in Agenda Items" }, 1085{ "Show time in agenda items","Zeige Zeit in Agenda Items" },
1086{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, 1086{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" },
1087{ "Show events that are done","Zeige abgelaufene Termine" }, 1087{ "Show events that are done","Zeige abgelaufene Termine" },
1088{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, 1088{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" },
1089{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, 1089{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" },
1090{ "KO/Pi","KO/Pi" }, 1090{ "KO/Pi","KO/Pi" },
1091{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, 1091{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" },
1092{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, 1092{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." },
1093{ "Sound.Al.: ","Sound.Al.: " }, 1093{ "Sound.Al.: ","Sound.Al.: " },
1094{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, 1094{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" },
1095{ "Restore","Wiederherstellen" }, 1095{ "Restore","Wiederherstellen" },
1096{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" }, 1096{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklich\nwiederherstellen?" },
1097{ "% completed","% erledigt" }, 1097{ "% completed","% erledigt" },
1098{ "%d item(s) found.","%d Item(s) gefunden." }, 1098{ "%d item(s) found.","%d Item(s) gefunden." },
1099{ "Set complete","Setze auf erledigt" }, 1099{ "Set complete","Setze auf erledigt" },
1100{ "(cancelled)","(gecancelt)" }, 1100{ "(cancelled)","(gecancelt)" },
1101{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, 1101{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" },
1102{ " Local time "," Locale Zeit " }, 1102{ " Local time "," Locale Zeit " },
1103{ "Form2","Form2" }, 1103{ "Form2","Form2" },
1104{ "Filter enabled","Filter angeschaltet" }, 1104{ "Filter enabled","Filter angeschaltet" },
1105{ "Edit Filters","Ändere Filter" }, 1105{ "Edit Filters","Ändere Filter" },
1106{ "Print What's Next View...","Drucke What's Next Ansicht..." }, 1106{ "Print What's Next View...","Drucke What's Next Ansicht..." },
1107{ "Agenda","Agenda" }, 1107{ "Agenda","Agenda" },
1108{ " ("," (" }, 1108{ " ("," (" },
1109{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, 1109{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" },
1110{ "Print","Print" }, 1110{ "Print","Print" },
1111{ "&Setup Printer...","Drucker &Setup..." }, 1111{ "&Setup Printer...","Drucker &Setup..." },
1112{ "View Type","Zeige Typ" }, 1112{ "View Type","Zeige Typ" },
1113{ "Page &orientation:","Seiten Ausrichtung:" }, 1113{ "Page &orientation:","Seiten Ausrichtung:" },
1114{ "Use Default of Selected Style","Default des selektierten Stils" }, 1114{ "Use Default of Selected Style","Default des selektierten Stils" },
1115{ "Use Default Setting of Printer","Default Einstellung des Druckers" }, 1115{ "Use Default Setting of Printer","Default Einstellung des Druckers" },
1116{ "Portrait","Portrait" }, 1116{ "Portrait","Portrait" },
1117{ "Landscape","Landschaft" }, 1117{ "Landscape","Landschaft" },
1118{ "Print day","Drucke Tag" }, 1118{ "Print day","Drucke Tag" },
1119{ "CalPrintDay_Base","CalPrintDay_Base" }, 1119{ "CalPrintDay_Base","CalPrintDay_Base" },
1120{ "Date && Time Range","Datum && Zeitspanne" }, 1120{ "Date && Time Range","Datum && Zeitspanne" },
1121{ "&End date:","&Enddatum:" }, 1121{ "&End date:","&Enddatum:" },
1122{ "&Start date:","&Startdatum:" }, 1122{ "&Start date:","&Startdatum:" },
1123{ "Start &time:","Startzeit:" }, 1123{ "Start &time:","Startzeit:" },
1124{ "End ti&me:","Endzeit:" }, 1124{ "End ti&me:","Endzeit:" },
1125{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, 1125{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" },
1126{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, 1126{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" },
1127{ "Alt+D","Alt+D" }, 1127{ "Alt+D","Alt+D" },
1128{ "&Use colors","Nutze Farben" }, 1128{ "&Use colors","Nutze Farben" },
1129{ "Alt+U","Alt+U" }, 1129{ "Alt+U","Alt+U" },
1130{ "Print week","Drucke Woche" }, 1130{ "Print week","Drucke Woche" },
1131{ "CalPrintWeek_Base","CalPrintWeek_Base" }, 1131{ "CalPrintWeek_Base","CalPrintWeek_Base" },
1132{ "Use &colors","Nutze Farben" }, 1132{ "Use &colors","Nutze Farben" },
1133{ "Type of View","Typ der Ansicht" }, 1133{ "Type of View","Typ der Ansicht" },
1134{ "Print as &Filofax page","Drucke als &Filofax Seite" }, 1134{ "Print as &Filofax page","Drucke als &Filofax Seite" },
1135{ "Alt+F","Alt+F" }, 1135{ "Alt+F","Alt+F" },
1136{ "Print as &timetable view:","Drucke als Zeittabelle:" }, 1136{ "Print as &timetable view:","Drucke als Zeittabelle:" },
1137{ "Alt+T","Alt+T" }, 1137{ "Alt+T","Alt+T" },
1138{ "Print as split week view","Drucke als gesplittete Wochenansicht" }, 1138{ "Print as split week view","Drucke als gesplittete Wochenansicht" },
1139{ "Print month","Drucke Monat" }, 1139{ "Print month","Drucke Monat" },
1140{ "CalPrintMonth_Base","CalPrintMonth_Base" }, 1140{ "CalPrintMonth_Base","CalPrintMonth_Base" },
1141{ "&Start month:","&Startmonat:" }, 1141{ "&Start month:","&Startmonat:" },
1142{ "&End month:","&Endmonat:" }, 1142{ "&End month:","&Endmonat:" },
1143{ "Print week &numbers","Drucke Wochen Nummer(n)" }, 1143{ "Print week &numbers","Drucke Wochen Nummer(n)" },
1144{ "Print todos","Drucke Todos" }, 1144{ "Print todos","Drucke Todos" },
1145{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, 1145{ "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" },
1146{ "Include &description of the item","Inclusive Itembeschreibung" }, 1146{ "Include &description of the item","Inclusive Itembeschreibung" },
1147{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, 1147{ "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" },
1148{ "Include &priority of the item","Inclusive Priorität des Items" }, 1148{ "Include &priority of the item","Inclusive Priorität des Items" },
1149{ "Items to Print","Zu druckende Items" }, 1149{ "Items to Print","Zu druckende Items" },
1150{ "&From:","Von:" }, 1150{ "&From:","Von:" },
1151{ "&To:","Bis:" }, 1151{ "&To:","Bis:" },
1152{ "Print &all todo items","Drucke alle Todo Items" }, 1152{ "Print &all todo items","Drucke alle Todo Items" },
1153{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, 1153{ "Print only &uncompleted items","Drucke nur nicht erledigte Todos" },
1154{ "Only items due in the &range:","Nur Items in dem Zeitraum:" }, 1154{ "Only items due in the &range:","Nur Items in dem Zeitraum:" },
1155{ "Todo List","Todo Liste" }, 1155{ "Todo List","Todo Liste" },
1156{ "&Title:","&Titel:" }, 1156{ "&Title:","&Titel:" },
1157{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, 1157{ "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" },
1158{ "Todo list","Todo Liste" }, 1158{ "Todo list","Todo Liste" },
1159{ "&Print...","Drucke..." }, 1159{ "&Print...","Drucke..." },
1160{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, 1160{ "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" },
1161{ "[Unconfigured]","[Unkonfiguriert]" }, 1161{ "[Unconfigured]","[Unkonfiguriert]" },
1162{ "OK","OK" }, 1162{ "OK","OK" },
1163{ "FilterEditor","FilterEditor" }, 1163{ "FilterEditor","FilterEditor" },
1164{ "Include","Inclusive" }, 1164{ "Include","Inclusive" },
1165{ "Exclude","Exclusive" }, 1165{ "Exclude","Exclusive" },
1166{ "Edit Selection...","Editiere Auswahl" }, 1166{ "Edit Selection...","Editiere Auswahl" },
1167{ "recurring events","wiederholende Termine" }, 1167{ "recurring events","wiederholende Termine" },
1168{ "recurr. events","wiederh.Termine" }, 1168{ "recurr. events","wiederh.Termine" },
1169{ "completed to-dos","erledigte Todos" }, 1169{ "completed to-dos","erledigte Todos" },
1170{ "events","Termine" }, 1170{ "events","Termine" },
1171{ "todos","Todos" }, 1171{ "todos","Todos" },
1172{ "journals","Journale" }, 1172{ "journals","Journale" },
1173{ "public","öffentl." }, 1173{ "public","öffentl." },
1174{ "private","privat" }, 1174{ "private","privat" },
1175{ "confidential","vertraul." }, 1175{ "confidential","vertraul." },
1176{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, 1176{ "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" },
1177{ "Yesterday","Gestern" }, 1177{ "Yesterday","Gestern" },
1178{ "Day after tomorrow","Übermorgen" }, 1178{ "Day after tomorrow","Übermorgen" },
1179{ "Tomorrow","Morgen" }, 1179{ "Tomorrow","Morgen" },
1180{ "Day before yesterday","Vorgestern" }, 1180{ "Day before yesterday","Vorgestern" },
1181{ "Size %1","Größe %1" }, 1181{ "Size %1","Größe %1" },
1182{ "New Agendasize: %1","Neue Agendagröße: %1" }, 1182{ "New Agendasize: %1","Neue Agendagröße: %1" },
1183{ " (%1 y.)"," (%1 J.)" }, 1183{ " (%1 y.)"," (%1 J.)" },
1184{ "Allday:","Ganztägig:" }, 1184{ "Allday:","Ganztägig:" },
1185{ "compl.todos","erled.Todos" }, 1185{ "compl.todos","erled.Todos" },
1186{ "Day view","Tagesansicht" }, 1186{ "Day view","Tagesansicht" },
1187{ "Next days","Nächste Tage" }, 1187{ "Next days","Nächste Tage" },
1188{ "Next week","Nächste Woche" }, 1188{ "Next week","Nächste Woche" },
1189{ "Next two weeks","Nächste zwei Wochen" }, 1189{ "Next two weeks","Nächste zwei Wochen" },
1190{ "This month","Dieser Monat" }, 1190{ "This month","Dieser Monat" },
1191{ "Journal view","Journal" }, 1191{ "Journal view","Journal" },
1192{ "Display all opened","Zeige alle geöffnet" }, 1192{ "Display all opened","Zeige alle geöffnet" },
1193{ "Display all closed","Zeige alle geschlossen" }, 1193{ "Display all closed","Zeige alle geschlossen" },
1194{ "Display all flat","Zeige alle flach" }, 1194{ "Display all flat","Zeige alle flach" },
1195{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, 1195{ "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" },
1196{ "Default todo done color:","Standard Todo erledigt Farbe" }, 1196{ "Default todo done color:","Standard Todo erledigt Farbe" },
1197{ "Select week %1-%2","Wähle Woche %1-%2" }, 1197{ "Select week %1-%2","Wähle Woche %1-%2" },
1198{ "Select Week","Wähle Woche" }, 1198{ "Select Week","Wähle Woche" },
1199{ "Set alarm for selected...","Setze Alarm für Selekt..." }, 1199{ "Set alarm for selected...","Setze Alarm für Selekt..." },
1200{ "Set Alarm!","Setze Alarm!" }, 1200{ "Set Alarm!","Setze Alarm!" },
1201{ "Changed alarm for %1 items","Alarm für %1 Items geändert" }, 1201{ "Changed alarm for %1 items","Alarm für %1 Items geändert" },
1202{ " and "," und " }, 1202{ " and "," und " },
1203{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, 1203{ "<IMG src="%1"> only )","nur <IMG src="%1"> )" },
1204{ "Mail to selected","Mail an Ausgewählte" }, 1204{ "Mail to selected","Mail an Ausgewählte" },
1205{ "Mail to all","Mail an Alle" }, 1205{ "Mail to all","Mail an Alle" },
1206{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, 1206{ "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" },
1207{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, 1207{ "Set reminder ON with offset to:","Alarm AN mit Offset auf:" },
1208{ " on"," am" }, 1208{ " on"," am" },
1209{ " completed on "," erledigt am " }, 1209{ " completed on "," erledigt am " },
1210{ "Save as Event template","Speichere als Vorlage" }, 1210{ "Save as Event template","Speichere als Vorlage" },
1211{ "Load Event template","Lade Termin Vorlage" }, 1211{ "Load Event template","Lade Termin Vorlage" },
1212{ "Save as Journal template","Speichere als Journal Vorlage" }, 1212{ "Save as Journal template","Speichere als Journal Vorlage" },
1213{ "Insert Journal template","Füge Journal Vorlage ein" }, 1213{ "Insert Journal template","Füge Journal Vorlage ein" },
1214{ "Sub todos:<br>","Unter Todos:<br>" }, 1214{ "Sub todos:<br>","Unter Todos:<br>" },
1215{ "Parent todo:<br>","Über Todo:<br>" }, 1215{ "Parent todo:<br>","Über Todo:<br>" },
1216{ "Set current as color category","Setze Gewählte als Farbkategorie" }, 1216{ "Set current as color category","Setze Gewählte als Farbkategorie" },
1217{ " completed"," erledigt" }, 1217{ " completed"," erledigt" },
1218{ "(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!" }, 1218{ "(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!" },
1219{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, 1219{ "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." },
1220{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, 1220{ "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." },
1221{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, 1221{ "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." },
1222{ "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?" }, 1222{ "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?" },
1223{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, 1223{ "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." },
1224{ "Error","Fehler" }, 1224{ "Error","Fehler" },
1225{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, 1225{ ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." },
1226{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, 1226{ "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." },
1227{ "Warning","Warnung" }, 1227{ "Warning","Warnung" },
1228{ "Select week number","Wähle Wochen Nummer" }, 1228{ "Select week number","Wähle Wochen Nummer" },
1229{ "Februar","Februar" }, 1229{ "Februar","Februar" },
1230{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, 1230{ "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" },
1231{ "W","W" }, 1231{ "W","W" },
1232{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, 1232{ "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" },
1233{ "T: %1","T: %1" }, 1233{ "T: %1","T: %1" },
1234{ "Start: ","Start: " }, 1234{ "Start: ","Start: " },
1235{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, 1235{ "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " },
1236{ "Password for remote access:","Passwort für fernen Zugriff:" }, 1236{ "Password for remote access:","Passwort für fernen Zugriff:" },
1237{ "Remote IP address:","Ferne IP Adresse:" }, 1237{ "Remote IP address:","Ferne IP Adresse:" },
1238{ "Remote port number:","Ferne Port Nummer:" }, 1238{ "Remote port number:","Ferne Port Nummer:" },
1239{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, 1239{ "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." },
1240{ "Remote from: ","Fern von: " }, 1240{ "Remote from: ","Fern von: " },
1241{ "Local from: ","Lokal von: " }, 1241{ "Local from: ","Lokal von: " },
1242{ "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" }, 1242{ "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" },
1243{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, 1243{ "Local calendar changed!\n","Lokaler Kalender geändert!\n" },
1244{ "Write back","Schreibe zurück" }, 1244{ "Write back","Schreibe zurück" },
1245{ "KO/Pi Synchronization","KO/Pi Synchronisation" }, 1245{ "KO/Pi Synchronization","KO/Pi Synchronisation" },
1246{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, 1246{ "Pi-Sync succesful!","Pi-Sync erfolgreich!" },
1247{ "Received sync request","Sync Anfrage erhalten" }, 1247{ "Received sync request","Sync Anfrage erhalten" },
1248{ "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." }, 1248{ "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." },
1249{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, 1249{ "Saving Data to temp file ...","Speichere Daten in temp Datei..." },
1250{ "Data saved to temp file!","Daten in temp Datei gespeichert!" }, 1250{ "Data saved to temp file!","Daten in temp Datei gespeichert!" },
1251{ "Sending file...","Sende Datei..." }, 1251{ "Sending file...","Sende Datei..." },
1252{ "Waiting for synced file...","Warte auf gesyncte Daten..." }, 1252{ "Waiting for synced file...","Warte auf gesyncte Daten..." },
1253{ "Receiving synced file...","Gesyncte Daten erhalten..." }, 1253{ "Receiving synced file...","Gesyncte Daten erhalten..." },
1254{ "Received %1 bytes","%1 Bytes erhalten" }, 1254{ "Received %1 bytes","%1 Bytes erhalten" },
1255{ "Writing file to disk...","Speichere Datei..." }, 1255{ "Writing file to disk...","Speichere Datei..." },
1256{ "Pi-Sync successful!","Pi-Sync erfolgreich!" }, 1256{ "Pi-Sync successful!","Pi-Sync erfolgreich!" },
1257{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, 1257{ "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" },
1258{ "Synchronize!","Synchronisiere!" }, 1258{ "Synchronize!","Synchronisiere!" },
1259{ "High clock skew!","Großer Uhrzeitunterschied!" }, 1259{ "High clock skew!","Großer Uhrzeitunterschied!" },
1260{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, 1260{ "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" },
1261{ "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!" }, 1261{ "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!" },
1262{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, 1262{ "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." },
1263{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, 1263{ "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" },
1264{ "List week view","Listenwochenansicht" }, 1264{ "List week view","Listenwochenansicht" },
1265{ "List week","Listenwochenansicht" }, 1265{ "List week","Listenwochenansicht" },
1266{ "Next Week","Nächste Woche" }, 1266{ "Next Week","Nächste Woche" },
1267{ "Previous Week","Vorherige Woche" }, 1267{ "Previous Week","Vorherige Woche" },
1268{ "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." }, 1268{ "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." },
1269{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, 1269{ "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" },
1270{ "Details","Details" }, 1270{ "Details","Details" },
1271{ "Created time","Erstellt Zeit" }, 1271{ "Created time","Erstellt Zeit" },
1272{ "Last modified time","Geändert Zeit" }, 1272{ "Last modified time","Geändert Zeit" },
1273{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, 1273{ "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" },
1274{ "View Options","Anzeige Optionen" }, 1274{ "View Options","Anzeige Optionen" },
1275{ "<b>Created: ","<b>Erstellt am: " }, 1275{ "<b>Created: ","<b>Erstellt am: " },
1276{ "<b>Last modified: ","<b>Zuletzt geändert am: " }, 1276{ "<b>Last modified: ","<b>Zuletzt geändert am: " },
1277{ "Journal: ","Journal: " }, 1277{ "Journal: ","Journal: " },
1278{ "yearly","jährlich" }, 1278{ "yearly","jährlich" },
1279{ "(%1) ","%1-" }, 1279{ "(%1) ","%1-" },
1280{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, 1280{ "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" },
1281{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, 1281{ "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" },
1282{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, 1282{ "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" },
1283{ "Summary/Loc.","Titel/Ort" }, 1283{ "Summary/Loc.","Titel/Ort" },
1284{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, 1284{ "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." },
1285{ "Week Number","Wochennummer" }, 1285{ "Week Number","Wochennummer" },
1286{ "Import","Importiere" }, 1286{ "Import","Importiere" },
1287{ "Export","Exportiere" }, 1287{ "Export","Exportiere" },
1288{ "Beam","Beame" }, 1288{ "Beam","Beame" },
1289{ "Export selected","Exportiere Selektierte" }, 1289{ "Export selected","Exportiere Selektierte" },
1290{ "As iCal (ics) file...","Als iCal (ics) Datei..." }, 1290{ "As iCal (ics) file...","Als iCal (ics) Datei..." },
1291{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, 1291{ "As vCal (vcs) file...","Als vCal (vcs) Datei..." },
1292{ "Journal/Details...","Journale/Details..." }, 1292{ "Journal/Details...","Journale/Details..." },
1293{ "Agenda View","Agenda Ansicht" }, 1293{ "Agenda View","Agenda Ansicht" },
1294{ "Show current time","Zeige aktuelle Zeit" }, 1294{ "Show current time","Zeige aktuelle Zeit" },
1295{ "Edit new item","Bearbeite neuen Eintrag" }, 1295{ "Edit new item","Bearbeite neuen Eintrag" },
1296{ "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" }, 1296{ "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" },
1297{ "There is no next alarm.","Es gibt keinen nächsten Alarm." }, 1297{ "There is no next alarm.","Es gibt keinen nächsten Alarm." },
1298{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, 1298{ "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" },
1299{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, 1299{ "The next alarm is in:\n","Der nächste Alarm ist in:\n" },
1300{ "%1 days\n","%1 Tagen\n" }, 1300{ "%1 days\n","%1 Tagen\n" },
1301{ "1 day\n","1 Tag\n" }, 1301{ "1 day\n","1 Tag\n" },
1302{ "%1 hours\n","%1 Stunden\n" }, 1302{ "%1 hours\n","%1 Stunden\n" },
1303{ "1 hour\n","1 Stunde\n" }, 1303{ "1 hour\n","1 Stunde\n" },
1304{ "%1 minutes\n","%1 Minuten\n" }, 1304{ "%1 minutes\n","%1 Minuten\n" },
1305{ "1 minute\n","1 Minute\n" }, 1305{ "1 minute\n","1 Minute\n" },
1306{ "Only one toolbar","Nur eine Toolbar" }, 1306{ "Only one toolbar","Nur eine Toolbar" },
1307{ "Print","Drucke" }, 1307{ "Print","Drucke" },
1308{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, 1308{ "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." },
1309{ "There is nothing selected!","Es ist nichts ausgewählt!" }, 1309{ "There is nothing selected!","Es ist nichts ausgewählt!" },
1310{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, 1310{ "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " },
1311{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, 1311{ "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" },
1312{ "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" }, 1312{ "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" },
1313{ "KO/Pi Printout","KO/Pi Ausdruck" }, 1313{ "KO/Pi Printout","KO/Pi Ausdruck" },
1314{ "Print unscaled","Drucke unskaliert" }, 1314{ "Print unscaled","Drucke unskaliert" },
1315{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, 1315{ "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." },
1316{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, 1316{ "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." },
1317{ "Printout Mode","Druck Modus" }, 1317{ "Printout Mode","Druck Modus" },
1318{ "Filter menu icon","Filtermenu Icon" }, 1318{ "Filter menu icon","Filtermenu Icon" },
1319{ "<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" }, 1319{ "<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" },
1320{ "<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" }, 1320{ "<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" },
1321{ "%1d","%1t" }, 1321{ "%1d","%1t" },
1322{ "%1h","%1std" }, 1322{ "%1h","%1std" },
1323{ "%1min","%1min" }, 1323{ "%1min","%1min" },
1324{ "( %1 before )","( %1 vorher )" }, 1324{ "( %1 before )","( %1 vorher )" },
1325{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, 1325{ "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" },
1326{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, 1326{ "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" },
1327{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, 1327{ "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." },
1328{ "Show Sync Events","Zeige Sync-Ereignisse" }, 1328{ "Show Sync Events","Zeige Sync-Ereignisse" },
1329{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, 1329{ "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" },
1330{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, 1330{ "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" },
1331{ " on "," am " }, 1331{ " on "," am " },
1332{ "On: ","Am: " }, 1332{ "On: ","Am: " },
1333{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, 1333{ "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" },
1334{ "Start/Stop todo...","Starte/Stoppe Todo..." }, 1334{ "Start/Stop todo...","Starte/Stoppe Todo..." },
1335{ "Color for running todos:","Farbe für laufende Todos:" }, 1335{ "Color for running todos:","Farbe für laufende Todos:" },
1336{ "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?" }, 1336{ "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?" },
1337{ "Todo is started","Todo ist gestartet" }, 1337{ "Todo is started","Todo ist gestartet" },
1338{ "Stop todo","Stoppe Todo" }, 1338{ "Stop todo","Stoppe Todo" },
1339{ "Todo is stopped","Todo ist gestoppt" }, 1339{ "Todo is stopped","Todo ist gestoppt" },
1340{ "Start todo","Starte Todo" }, 1340{ "Start todo","Starte Todo" },
1341{ "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?" }, 1341{ "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?" },
1342{ "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?" }, 1342{ "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?" },
1343{ "Todo has subtodos","Todo hat Untertodos" }, 1343{ "Todo has subtodos","Todo hat Untertodos" },
1344{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, 1344{ "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" },
1345{ "Colors","Farben" }, 1345{ "Colors","Farben" },
1346{ "Click on new parent item","Klicke auf neues Übertodo" }, 1346{ "Click on new parent item","Klicke auf neues Übertodo" },
1347{ "Reparenting aborted!","Übertodo setzen abgebrochen" }, 1347{ "Reparenting aborted!","Übertodo setzen abgebrochen" },
1348{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, 1348{ "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" },
1349{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, 1349{ "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" },
1350{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, 1350{ "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" },
1351{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, 1351{ "Alternating background of list views","Abwechselnder Hintergrund für Listen" },
1352{ "times","Zeiten" }, 1352{ "times","Zeiten" },
1353{ "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?" }, 1353{ "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?" },
1354{ "Backup enabled","Backup angeschaltet" }, 1354{ "Backup enabled","Backup angeschaltet" },
1355{ "Use standard backup dir","Standard Backupverzeichnis" }, 1355{ "Use standard backup dir","Standard Backupverzeichnis" },
1356{ "Number of Backups:","Anzahl der Backups" }, 1356{ "Number of Backups:","Anzahl der Backups" },
1357{ "Make backup every ","Mache ein Backup alle " }, 1357{ "Make backup every ","Mache ein Backup alle " },
1358{ " days"," Tage" }, 1358{ " days"," Tage" },
1359{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, 1359{ "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." },
1360{ "Backup Failed!","Backup Problem!" }, 1360{ "Backup Failed!","Backup Problem!" },
1361{ "Try again now","Versuche jetzt nochmal" }, 1361{ "Try again now","Versuche jetzt nochmal" },
1362{ "Try again later","Versuche später nochmal" }, 1362{ "Try again later","Versuche später nochmal" },
1363{ "Try again tomorrow","Versuche morgen nochmal" }, 1363{ "Try again tomorrow","Versuche morgen nochmal" },
1364{ "Disable backup","Schalte Backup ab" }, 1364{ "Disable backup","Schalte Backup ab" },
1365{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, 1365{ "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" },
1366{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, 1366{ "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" },
1367{ "Choose action","Wähle Aktion" }, 1367{ "Choose action","Wähle Aktion" },
1368{ "Comment for todo:","Kommentar zum Todo:" }, 1368{ "Comment for todo:","Kommentar zum Todo:" },
1369{ "Stop+note","Stop+Notiz" }, 1369{ "Stop+note","Stop+Notiz" },
1370{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, 1370{ "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" },
1371{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, 1371{ "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" },
1372{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, 1372{ "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" },
1373{ "Print complete list","Drucke komplette Liste" }, 1373{ "Print complete list","Drucke komplette Liste" },
1374{ "Hide all selected","Verstecke Selektierte" }, 1374{ "Hide all selected","Verstecke Selektierte" },
1375{ "Add items","hinzufügen" }, 1375{ "Add items","hinzufügen" },
1376{ "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?" }, 1376{ "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?" },
1377{ "Print List View...","Drucke Listenansicht..." }, 1377{ "Print List View...","Drucke Listenansicht..." },
1378{ "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." }, 1378{ "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." },
1379{ "Configure KO/Pi...","Konfiguriere KO/Pi..." }, 1379{ "Configure KO/Pi...","Konfiguriere KO/Pi..." },
1380{ "Global Settings...","Globale Einstellungen..." }, 1380{ "Global Settings...","Globale Einstellungen..." },
1381{ "<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" }, 1381{ "<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" },
1382{ "(disabled)","(abgeschaltet)" }, 1382{ "(disabled)","(abgeschaltet)" },
1383{ "New Calendar","Neuer Kalender" }, 1383{ "New Calendar","Neuer Kalender" },
1384{ "Calendar","Kalender" }, 1384{ "Calendar","Kalender" },
1385{ "Filter selector","Filterauswahl" }, 1385{ "Filter selector","Filterauswahl" },
1386{ "Filtermenu","Filtermenu" }, 1386{ "Filtermenu","Filtermenu" },
1387{ "Toggle Fullscreen","Vollbild umschalten" }, 1387{ "Toggle Fullscreen","Vollbild umschalten" },
1388{ "Toggle Resource View","Resourcenansicht umschalten" }, 1388{ "Toggle Resource View","Resourcenansicht umschalten" },
1389{ "Storage HowTo...","Speicherort HowTo..." }, 1389{ "Storage HowTo...","Speicherort HowTo..." },
1390{ "Timetracking HowTo...","Timetracking HowTo..." }, 1390{ "Timetracking HowTo...","Timetracking HowTo..." },
1391{ "Juni","Juni" }, 1391{ "Juni","Juni" },
1392{ "Juli","Juli" }, 1392{ "Juli","Juli" },
1393{ "ToDo:","ToDo:" }, 1393{ "ToDo:","ToDo:" },
1394{ "Set Calendar","Setze Kalender" }, 1394{ "Set Calendar","Setze Kalender" },
1395{ "Todo: %1","Todo: %1" }, 1395{ "Todo: %1","Todo: %1" },
1396{ ": (Prio ",": (Prio " }, 1396{ ": (Prio ",": (Prio " },
1397{ "Todos","Todos" }, 1397{ "Todos","Todos" },
1398{ "Todo Viewer","Todo Viewer" }, 1398{ "Todo Viewer","Todo Viewer" },
1399{ "Todo ","Todo " }, 1399{ "Todo ","Todo " },
1400{ " Calendar \n Resource "," Kalender \n Resource " }, 1400{ " Calendar \n Resource "," Kalender \n Resource " },
1401{ " Color "," Farbe " }, 1401{ " Color "," Farbe " },
1402{ "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!)" }, 1402{ "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!)" },
1403{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, 1403{ "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" },
1404{ "Add new Calendar","Füge Kalender hinzu" }, 1404{ "Add new Calendar","Füge Kalender hinzu" },
1405{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, 1405{ "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" },
1406{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, 1406{ "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" },
1407{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, 1407{ "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" },
1408{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, 1408{ "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" },
1409{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, 1409{ "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." },
1410{ "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>" }, 1410{ "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>" },
1411{ "Global application font for all apps:","Globale Schriftart:" }, 1411{ "Global application font for all apps:","Globale Schriftart:" },
1412{ "Application Font","Applikationsschriftart" }, 1412{ "Application Font","Applikationsschriftart" },
1413{ "Kx/Pi","Kx/Pi" }, 1413{ "Kx/Pi","Kx/Pi" },
1414{ "Backup","Backup" }, 1414{ "Backup","Backup" },
1415{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, 1415{ "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" },
1416{ "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!" }, 1416{ "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!" },
1417{ "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!" }, 1417{ "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!" },
1418{ "Choose Color","Wähle Farbe" }, 1418{ "Choose Color","Wähle Farbe" },
1419{ " OK "," OK " }, 1419{ " OK "," OK " },
1420{ " Cancel "," Abbrechen " }, 1420{ " Cancel "," Abbrechen " },
1421{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, 1421{ "Matching items will be added to list","Passende werden zur Liste hinzugefügt" },
1422{ "Matching items will be removed from list","Passende werden von der Liste entfernt" }, 1422{ "Matching items will be removed from list","Passende werden von der Liste entfernt" },
1423{ "Search on displayed list only","Suche auf der dargestellten Liste" }, 1423{ "Search on displayed list only","Suche auf der dargestellten Liste" },
1424{ "List will be cleared before search","Liste wird vor der Suche gelöscht" }, 1424{ "List will be cleared before search","Liste wird vor der Suche gelöscht" },
1425{ "<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>" }, 1425{ "<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>" },
1426{ "%1\nis running!","%1\nist am Laufen!" }, 1426{ "%1\nis running!","%1\nist am Laufen!" },
1427{ "Additional Comment:","Zusätzlicher Kommentar:" }, 1427{ "Additional Comment:","Zusätzlicher Kommentar:" },
1428{ "Stop and save","Stopp und Speichern" }, 1428{ "Stop and save","Stopp und Speichern" },
1429{ "Continue running","Weiter laufen lassen" }, 1429{ "Continue running","Weiter laufen lassen" },
1430{ "Stop - do not save","Stopp - nicht Speichern" }, 1430{ "Stop - do not save","Stopp - nicht Speichern" },
1431{ "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?" }, 1431{ "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?" },
1432{ "Time mismatch!","Zeiten stimmen nicht!" }, 1432{ "Time mismatch!","Zeiten stimmen nicht!" },
1433{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, 1433{ "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" },
1434{ "Yes, stop todo","Ja, stoppe Todo" }, 1434{ "Yes, stop todo","Ja, stoppe Todo" },
1435{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, 1435{ "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" },
1436{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, 1436{ "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" },
1437{ "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." }, 1437{ "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." },
1438{ "Spouse","Ehegatte" }, 1438{ "Spouse","Ehegatte" },
1439{ "Notes","Notizen" }, 1439{ "Notes","Notizen" },
1440{ "Messanger","Messanger" }, 1440{ "Messanger","Messanger" },
1441{ "Assistant","Assistent" }, 1441{ "Assistant","Assistent" },
1442{ "Manager","Manager" }, 1442{ "Manager","Manager" },
1443{ "Secrecy","Sichtbar" }, 1443{ "Secrecy","Sichtbar" },
1444{ "male","männlich" }, 1444{ "male","männlich" },
1445{ "female","weiblich" }, 1445{ "female","weiblich" },
1446{ "Hide!","Verbergen!" }, 1446{ "Hide!","Verbergen!" },
1447{ "Show!","Anzeigen!" }, 1447{ "Show!","Anzeigen!" },
1448{ "Details","Details" }, 1448{ "Details","Details" },
1449{ "Profession","Beruf" }, 1449{ "Profession","Beruf" },
1450{ "Children","Kinder" }, 1450{ "Children","Kinder" },
1451{ "Department","Abteilung" }, 1451{ "Department","Abteilung" },
1452{ "Backup cancelled","Backup abgebrochen" }, 1452{ "Backup cancelled","Backup abgebrochen" },
1453{ "Backup globally disabled","Backup global abgeschaltet" }, 1453{ "Backup globally disabled","Backup global abgeschaltet" },
1454{ "Backup succesfully finished","Backup erfolgreich beendet" }, 1454{ "Backup succesfully finished","Backup erfolgreich beendet" },
1455{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, 1455{ "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" },
1456{ "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" }, 1456{ "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" },
1457{ "Birthdays","Geburtstage" }, 1457{ "Birthdays","Geburtstage" },
1458{ "KO/Pi import information!","KO/Pi Import Information!" }, 1458{ "KO/Pi import information!","KO/Pi Import Information!" },
1459{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, 1459{ "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" },
1460{ "Cancel - do not start"," Abbrechen - Todo nicht starten" }, 1460{ "Cancel - do not start"," Abbrechen - Todo nicht starten" },
1461{ "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?"" }, 1461{ "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?"" },
1462{ "Reload","Neu laden" }, 1462{ "Reload","Neu laden" },
1463{ "Timezone settings","Zeitzoneneinstellung" }, 1463{ "Timezone settings","Zeitzoneneinstellung" },
1464{ "Title: ","Titel: " }, 1464{ "Title: ","Titel: " },
1465{ "Journal from: ","Journal vom: " }, 1465{ "Journal from: ","Journal vom: " },
1466{ "Journal: %1 from ","Journal: %1 vom " }, 1466{ "Journal: %1 from ","Journal: %1 vom " },
1467{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, 1467{ "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" },
1468{ "Selected Item","Ausgewähltes Item" }, 1468{ "Selected Item","Ausgewähltes Item" },
1469{ "Select Date...","Wähle Datum..." }, 1469{ "Select Date...","Wähle Datum..." },
1470{ "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:" }, 1470{ "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:" },
1471{ "Change category list now!","Ändere Kategorieliste jetzt!" }, 1471{ "Change category list now!","Ändere Kategorieliste jetzt!" },
1472{ "Edit category list...","Ändere Kategorieliste..." }, 1472{ "Edit category list...","Ändere Kategorieliste..." },
1473{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, 1473{ "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" },
1474{ "","" }, 1474{ "Filepath: ","Dateipfad: " },
1475{ "","" }, 1475{ "The loading of one or more calendar failed:","Das Laden eines oder mehrerer Kalender schlug fehl:" },
1476{ "","" }, 1476{ "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" },
1477{ "","" }, 1477{ "","" },
1478{ "","" }, 1478{ "","" },
1479{ "","" }, 1479{ "","" },
1480{ "","" }, 1480{ "","" },
1481{ "","" }, \ No newline at end of file 1481{ "","" }, \ No newline at end of file
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index c0f3be7..fd026fa 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1,4571 +1,4585 @@
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) ),mCalendar, SLOT( setReadOnly(int,bool)) ); 471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(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( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 477 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
478 478
479 mTodoList->setNavigator( mNavigator ); 479 mTodoList->setNavigator( mNavigator );
480#if 0 480#if 0
481 if ( QApplication::desktop()->width() < 480 ) { 481 if ( QApplication::desktop()->width() < 480 ) {
482 leftFrameLayout->addWidget(mFilterView); 482 leftFrameLayout->addWidget(mFilterView);
483 leftFrameLayout->addWidget(mTodoList, 2 ); 483 leftFrameLayout->addWidget(mTodoList, 2 );
484 484
485 } else { 485 } else {
486 leftFrameLayout->addWidget(mTodoList,2 ); 486 leftFrameLayout->addWidget(mTodoList,2 );
487 leftFrameLayout->addWidget(mFilterView ); 487 leftFrameLayout->addWidget(mFilterView );
488 } 488 }
489#endif 489#endif
490 mFilterView->hide(); 490 mFilterView->hide();
491 mCalEditView->hide(); 491 mCalEditView->hide();
492 QWidget *rightBox = new QWidget( mMainFrame ); 492 QWidget *rightBox = new QWidget( mMainFrame );
493 //mainBoxLayout->addWidget ( rightBox, 10 ); 493 //mainBoxLayout->addWidget ( rightBox, 10 );
494 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 494 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
495 mRightFrame = new QWidgetStack( rightBox ); 495 mRightFrame = new QWidgetStack( rightBox );
496 rightLayout->addWidget( mRightFrame, 10 ); 496 rightLayout->addWidget( mRightFrame, 10 );
497 497
498 //mLeftFrame = (QWidget *)leftFrame; 498 //mLeftFrame = (QWidget *)leftFrame;
499 if ( KOPrefs::instance()->mVerticalScreen ) { 499 if ( KOPrefs::instance()->mVerticalScreen ) {
500 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 500 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
501 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 501 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
502 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 502 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
503 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 503 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
504 } else { 504 } else {
505 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 505 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
506 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 506 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
507 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 507 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
508 } 508 }
509 if ( !KOPrefs::instance()->mShowDateNavigator) 509 if ( !KOPrefs::instance()->mShowDateNavigator)
510 mDateNavigator->hide(); 510 mDateNavigator->hide();
511 //qDebug("Calendarview Size %d %d ", width(), height()); 511 //qDebug("Calendarview Size %d %d ", width(), height());
512#endif 512#endif
513 513
514 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 514 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
515 SLOT( showDates( const KCal::DateList & ) ) ); 515 SLOT( showDates( const KCal::DateList & ) ) );
516 516
517 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 517 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
518 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 518 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
519 519
520 520
521 521
522 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 522 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
523 mViewManager, SLOT( showMonth( const QDate & ) ) ); 523 mViewManager, SLOT( showMonth( const QDate & ) ) );
524 524
525 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 525 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
526 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 526 mNavigator, SLOT( selectWeek( const QDate & ) ) );
527 527
528 connect( mDateNavigator, SIGNAL( goPrevYear() ), 528 connect( mDateNavigator, SIGNAL( goPrevYear() ),
529 mNavigator, SLOT( selectPreviousYear() ) ); 529 mNavigator, SLOT( selectPreviousYear() ) );
530 connect( mDateNavigator, SIGNAL( goNextYear() ), 530 connect( mDateNavigator, SIGNAL( goNextYear() ),
531 mNavigator, SLOT( selectNextYear() ) ); 531 mNavigator, SLOT( selectNextYear() ) );
532 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 532 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
533 mNavigator, SLOT( selectPreviousMonth() ) ); 533 mNavigator, SLOT( selectPreviousMonth() ) );
534 connect( mDateNavigator, SIGNAL( goNextMonth() ), 534 connect( mDateNavigator, SIGNAL( goNextMonth() ),
535 mNavigator, SLOT( selectNextMonth() ) ); 535 mNavigator, SLOT( selectNextMonth() ) );
536 536
537 connect( mDateNavigator, SIGNAL( goPrevious() ), 537 connect( mDateNavigator, SIGNAL( goPrevious() ),
538 mNavigator, SLOT( selectPrevious() ) ); 538 mNavigator, SLOT( selectPrevious() ) );
539 connect( mDateNavigator, SIGNAL( goNext() ), 539 connect( mDateNavigator, SIGNAL( goNext() ),
540 mNavigator, SLOT( selectNext() ) ); 540 mNavigator, SLOT( selectNext() ) );
541 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 541 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
542 mNavigator, SLOT( slotMonthSelect( int ) ) ); 542 mNavigator, SLOT( slotMonthSelect( int ) ) );
543 543
544 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 544 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
545 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 545 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
546#if 0 546#if 0
547 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 547 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
548 SLOT( incidenceAdded( Incidence *) ) ); 548 SLOT( incidenceAdded( Incidence *) ) );
549#endif 549#endif
550 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 550 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
551 551
552 connect( this, SIGNAL( configChanged() ), 552 connect( this, SIGNAL( configChanged() ),
553 mDateNavigator, SLOT( updateConfig() ) ); 553 mDateNavigator, SLOT( updateConfig() ) );
554 554
555 connect( mTodoList, SIGNAL( newTodoSignal() ), 555 connect( mTodoList, SIGNAL( newTodoSignal() ),
556 SLOT( newTodo() ) ); 556 SLOT( newTodo() ) );
557 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 557 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
558 SLOT( newSubTodo( Todo * ) ) ); 558 SLOT( newSubTodo( Todo * ) ) );
559 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 559 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
560 SLOT( editTodo( Todo * ) ) ); 560 SLOT( editTodo( Todo * ) ) );
561 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 561 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
562 SLOT( showTodo( Todo *) ) ); 562 SLOT( showTodo( Todo *) ) );
563 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 563 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
564 SLOT( deleteTodo( Todo *) ) ); 564 SLOT( deleteTodo( Todo *) ) );
565 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 565 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
566 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 566 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
567 SLOT( purgeCompleted() ) ); 567 SLOT( purgeCompleted() ) );
568 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 568 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
569 SIGNAL( todoModified( Todo *, int ) ) ); 569 SIGNAL( todoModified( Todo *, int ) ) );
570 570
571 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 571 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
572 this, SLOT ( cloneIncidence( Incidence * ) ) ); 572 this, SLOT ( cloneIncidence( Incidence * ) ) );
573 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 573 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
574 this, SLOT (cancelIncidence( Incidence * ) ) ); 574 this, SLOT (cancelIncidence( Incidence * ) ) );
575 575
576 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 576 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
577 this, SLOT ( moveIncidence( Incidence * ) ) ); 577 this, SLOT ( moveIncidence( Incidence * ) ) );
578 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 578 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
579 this, SLOT ( beamIncidence( Incidence * ) ) ); 579 this, SLOT ( beamIncidence( Incidence * ) ) );
580 580
581 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 581 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
582 this, SLOT ( todo_unsub( Todo * ) ) ); 582 this, SLOT ( todo_unsub( Todo * ) ) );
583 583
584 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 584 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
585 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 585 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
586 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 586 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
587 SLOT( updateTodo( Todo *, int ) ) ); 587 SLOT( updateTodo( Todo *, int ) ) );
588 connect( this, SIGNAL( todoModified( Todo *, int )), this, 588 connect( this, SIGNAL( todoModified( Todo *, int )), this,
589 SLOT( changeTodoDisplay( Todo *, int ) ) ); 589 SLOT( changeTodoDisplay( Todo *, int ) ) );
590 590
591 591
592 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 592 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
593 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 593 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
594 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 594 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
595 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 595 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
596 596
597 597
598 598
599 599
600 600
601 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 601 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
602 SLOT(checkClipboard())); 602 SLOT(checkClipboard()));
603 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 603 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
604 SLOT( processTodoListSelection( Incidence * ) ) ); 604 SLOT( processTodoListSelection( Incidence * ) ) );
605 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 605 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
606 606
607 // kdDebug() << "CalendarView::CalendarView() done" << endl; 607 // kdDebug() << "CalendarView::CalendarView() done" << endl;
608 608
609 mDateFrame = new QVBox(0,0,WType_Popup); 609 mDateFrame = new QVBox(0,0,WType_Popup);
610 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 610 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
611 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 611 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
612 mDateFrame->setLineWidth(3); 612 mDateFrame->setLineWidth(3);
613 mDateFrame->hide(); 613 mDateFrame->hide();
614 mDateFrame->setCaption( i18n( "Pick a date to display")); 614 mDateFrame->setCaption( i18n( "Pick a date to display"));
615 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 615 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
616 616
617 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 617 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
618 618
619 mEventEditor = mDialogManager->getEventEditor(); 619 mEventEditor = mDialogManager->getEventEditor();
620 mTodoEditor = mDialogManager->getTodoEditor(); 620 mTodoEditor = mDialogManager->getTodoEditor();
621 621
622 mFlagEditDescription = false; 622 mFlagEditDescription = false;
623 623
624 mSuspendTimer = new QTimer( this ); 624 mSuspendTimer = new QTimer( this );
625 mAlarmTimer = new QTimer( this ); 625 mAlarmTimer = new QTimer( this );
626 mRecheckAlarmTimer = new QTimer( this ); 626 mRecheckAlarmTimer = new QTimer( this );
627 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 627 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
628 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 628 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
629 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 629 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
630 mAlarmDialog = new AlarmDialog( this ); 630 mAlarmDialog = new AlarmDialog( this );
631 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 631 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
632 mAlarmDialog->setServerNotification( false ); 632 mAlarmDialog->setServerNotification( false );
633 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 633 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
634 634
635 635
636#ifndef DESKTOP_VERSION 636#ifndef DESKTOP_VERSION
637//US listen for arriving address resultsets 637//US listen for arriving address resultsets
638 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 638 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
639 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 639 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
640#endif 640#endif
641 mDateNavigator->setCalendar( mCalendar ); 641 mDateNavigator->setCalendar( mCalendar );
642} 642}
643 643
644 644
645CalendarView::~CalendarView() 645CalendarView::~CalendarView()
646{ 646{
647 // kdDebug() << "~CalendarView()" << endl; 647 // kdDebug() << "~CalendarView()" << endl;
648 //qDebug("CalendarView::~CalendarView() "); 648 //qDebug("CalendarView::~CalendarView() ");
649 delete mDialogManager; 649 delete mDialogManager;
650 delete mViewManager; 650 delete mViewManager;
651 delete mStorage; 651 delete mStorage;
652 delete mDateFrame ; 652 delete mDateFrame ;
653 delete mEventViewerDialog; 653 delete mEventViewerDialog;
654 //kdDebug() << "~CalendarView() done" << endl; 654 //kdDebug() << "~CalendarView() done" << endl;
655} 655}
656void CalendarView::setScrollBarStep(int val ) 656void CalendarView::setScrollBarStep(int val )
657{ 657{
658#ifdef DESKTOP_VERSION 658#ifdef DESKTOP_VERSION
659 mDateScrollBar->setLineStep ( val ); 659 mDateScrollBar->setLineStep ( val );
660#endif 660#endif
661} 661}
662void CalendarView::scrollBarValue(int val ) 662void CalendarView::scrollBarValue(int val )
663{ 663{
664#ifdef DESKTOP_VERSION 664#ifdef DESKTOP_VERSION
665 if ( QApplication::desktop()->width() < 800 ) return; 665 if ( QApplication::desktop()->width() < 800 ) return;
666 static bool block = false; 666 static bool block = false;
667 if ( block ) return; 667 if ( block ) return;
668 block = true; 668 block = true;
669 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 669 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
670 //qDebug("VAL %d ",val ); 670 //qDebug("VAL %d ",val );
671 int count = mNavigator->selectedDates().count(); 671 int count = mNavigator->selectedDates().count();
672 int year = mNavigator->selectedDates().first().year(); 672 int year = mNavigator->selectedDates().first().year();
673 int day = mNavigator->selectedDates().first().dayOfYear(); 673 int day = mNavigator->selectedDates().first().dayOfYear();
674 if ( val == day -1 ) { 674 if ( val == day -1 ) {
675 block = false; 675 block = false;
676 return; 676 return;
677 } 677 }
678 QDate d ( year,1,1 ); 678 QDate d ( year,1,1 );
679 mNavigator->selectDates( d.addDays( val ), count ); 679 mNavigator->selectDates( d.addDays( val ), count );
680 block = false; 680 block = false;
681#endif 681#endif
682 682
683} 683}
684 684
685void CalendarView::checkAlarms() 685void CalendarView::checkAlarms()
686{ 686{
687
688 QString message;
689 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
690 KopiCalendarFile * cal = calendars.first();
691 while ( cal ) {
692 if ( cal->mErrorOnLoad ) {
693 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
694 }
695 cal = calendars.next();
696 }
697 if ( !message.isEmpty() ) {
698 message = KGlobal::formatMessage( i18n("The loading of one or more calendar failed:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
699 KMessageBox::error(this,message);
700 }
687 KConfig *config = KOGlobals::config(); 701 KConfig *config = KOGlobals::config();
688 config->setGroup( "AppRun" ); 702 config->setGroup( "AppRun" );
689 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 703 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
690 int daysto = dt.daysTo( QDate::currentDate() ); 704 int daysto = dt.daysTo( QDate::currentDate() );
691 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 705 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
692 dt = dt.addDays( days ); 706 dt = dt.addDays( days );
693 int secto = dt.secsTo( QDateTime::currentDateTime() ); 707 int secto = dt.secsTo( QDateTime::currentDateTime() );
694 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 708 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
695 //qDebug("KO: Reading program stop %d ", secs); 709 //qDebug("KO: Reading program stop %d ", secs);
696 //secs -= ( 3600 * 24*3 ); // debug only 710 //secs -= ( 3600 * 24*3 ); // debug only
697 QDateTime latest = dt.addSecs ( secs ); 711 QDateTime latest = dt.addSecs ( secs );
698 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 712 qDebug("KO: Last termination on %s ", latest.toString().latin1());
699 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 713 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
700 QPtrList<Incidence> el = mCalendar->rawIncidences(); 714 QPtrList<Incidence> el = mCalendar->rawIncidences();
701 QPtrList<Incidence> al; 715 QPtrList<Incidence> al;
702 Incidence* inL = el.first(); 716 Incidence* inL = el.first();
703 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 717 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
704 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 718 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
705 while ( inL ) { 719 while ( inL ) {
706 bool ok = false; 720 bool ok = false;
707 int offset = 0; 721 int offset = 0;
708 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 722 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
709 if ( ok ) { 723 if ( ok ) {
710 //qDebug("OK %s",next.toString().latin1()); 724 //qDebug("OK %s",next.toString().latin1());
711 if ( next < cur ) { 725 if ( next < cur ) {
712 al.append( inL ); 726 al.append( inL );
713 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 727 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
714 } 728 }
715 } 729 }
716 inL = el.next(); 730 inL = el.next();
717 } 731 }
718 if ( al.count() ) { 732 if ( al.count() ) {
719 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 733 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
720 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 734 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
721 QVBoxLayout* lay = new QVBoxLayout( dia ); 735 QVBoxLayout* lay = new QVBoxLayout( dia );
722 lay->setSpacing( 0 ); 736 lay->setSpacing( 0 );
723 lay->setMargin( 0 ); 737 lay->setMargin( 0 );
724 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 738 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
725 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 739 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
726 lay->addWidget( matb ); 740 lay->addWidget( matb );
727 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 741 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
728 int wid = 210; 742 int wid = 210;
729 int x = QApplication::desktop()->width() - wid - 7; 743 int x = QApplication::desktop()->width() - wid - 7;
730 int y = QApplication::desktop()->height() - wid - 70; 744 int y = QApplication::desktop()->height() - wid - 70;
731 dia->setGeometry ( x,y,wid,wid); 745 dia->setGeometry ( x,y,wid,wid);
732 } else { 746 } else {
733 int si = 220; 747 int si = 220;
734 if ( QApplication::desktop()->width() > 470 ) 748 if ( QApplication::desktop()->width() > 470 )
735 si = 400; 749 si = 400;
736 dia->resize(si,si/2); 750 dia->resize(si,si/2);
737 } 751 }
738 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 752 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
739 dia->show(); 753 dia->show();
740 754
741 } 755 }
742} 756}
743void CalendarView::showDay( QDate d ) 757void CalendarView::showDay( QDate d )
744{ 758{
745 dateNavigator()->blockSignals( true ); 759 dateNavigator()->blockSignals( true );
746 dateNavigator()->selectDate( d ); 760 dateNavigator()->selectDate( d );
747 dateNavigator()->blockSignals( false ); 761 dateNavigator()->blockSignals( false );
748 mViewManager->showDayView(); 762 mViewManager->showDayView();
749 //dateNavigator()->selectDate( d ); 763 //dateNavigator()->selectDate( d );
750} 764}
751void CalendarView::timerAlarm() 765void CalendarView::timerAlarm()
752{ 766{
753 //qDebug("CalendarView::timerAlarm() "); 767 //qDebug("CalendarView::timerAlarm() ");
754 computeAlarm(mAlarmNotification ); 768 computeAlarm(mAlarmNotification );
755} 769}
756 770
757void CalendarView::suspendAlarm() 771void CalendarView::suspendAlarm()
758{ 772{
759 //qDebug(" CalendarView::suspendAlarm() "); 773 //qDebug(" CalendarView::suspendAlarm() ");
760 computeAlarm(mSuspendAlarmNotification ); 774 computeAlarm(mSuspendAlarmNotification );
761 775
762} 776}
763 777
764void CalendarView::startAlarm( QString mess , QString filename) 778void CalendarView::startAlarm( QString mess , QString filename)
765{ 779{
766 780
767 topLevelWidget()->showNormal(); 781 topLevelWidget()->showNormal();
768 topLevelWidget()->setActiveWindow(); 782 topLevelWidget()->setActiveWindow();
769 topLevelWidget()->raise(); 783 topLevelWidget()->raise();
770 784
771 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 785 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
772 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); 786 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) );
773 787
774} 788}
775 789
776void CalendarView::checkNextTimerAlarm() 790void CalendarView::checkNextTimerAlarm()
777{ 791{
778 mCalendar->checkAlarmForIncidence( 0, true ); 792 mCalendar->checkAlarmForIncidence( 0, true );
779} 793}
780 794
781void CalendarView::computeAlarm( QString msg ) 795void CalendarView::computeAlarm( QString msg )
782{ 796{
783 797
784 QString mess = msg; 798 QString mess = msg;
785 QString mAlarmMessage = mess.mid( 9 ); 799 QString mAlarmMessage = mess.mid( 9 );
786 QString filename = MainWindow::resourcePath(); 800 QString filename = MainWindow::resourcePath();
787 filename += "koalarm.wav"; 801 filename += "koalarm.wav";
788 QString tempfilename; 802 QString tempfilename;
789 if ( mess.left( 13 ) == "suspend_alarm") { 803 if ( mess.left( 13 ) == "suspend_alarm") {
790 bool error = false; 804 bool error = false;
791 int len = mess.mid( 13 ).find("+++"); 805 int len = mess.mid( 13 ).find("+++");
792 if ( len < 2 ) 806 if ( len < 2 )
793 error = true; 807 error = true;
794 else { 808 else {
795 tempfilename = mess.mid( 13, len ); 809 tempfilename = mess.mid( 13, len );
796 if ( !QFile::exists( tempfilename ) ) 810 if ( !QFile::exists( tempfilename ) )
797 error = true; 811 error = true;
798 } 812 }
799 if ( ! error ) { 813 if ( ! error ) {
800 filename = tempfilename; 814 filename = tempfilename;
801 } 815 }
802 mAlarmMessage = mess.mid( 13+len+3 ); 816 mAlarmMessage = mess.mid( 13+len+3 );
803 //qDebug("suspend file %s ",tempfilename.latin1() ); 817 //qDebug("suspend file %s ",tempfilename.latin1() );
804 startAlarm( mAlarmMessage, filename); 818 startAlarm( mAlarmMessage, filename);
805 return; 819 return;
806 } 820 }
807 if ( mess.left( 11 ) == "timer_alarm") { 821 if ( mess.left( 11 ) == "timer_alarm") {
808 //mTimerTime = 0; 822 //mTimerTime = 0;
809 startAlarm( mess.mid( 11 ), filename ); 823 startAlarm( mess.mid( 11 ), filename );
810 return; 824 return;
811 } 825 }
812 if ( mess.left( 10 ) == "proc_alarm") { 826 if ( mess.left( 10 ) == "proc_alarm") {
813 bool error = false; 827 bool error = false;
814 int len = mess.mid( 10 ).find("+++"); 828 int len = mess.mid( 10 ).find("+++");
815 if ( len < 2 ) 829 if ( len < 2 )
816 error = true; 830 error = true;
817 else { 831 else {
818 tempfilename = mess.mid( 10, len ); 832 tempfilename = mess.mid( 10, len );
819 if ( !QFile::exists( tempfilename ) ) 833 if ( !QFile::exists( tempfilename ) )
820 error = true; 834 error = true;
821 } 835 }
822 if ( error ) { 836 if ( error ) {
823 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 837 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
824 mAlarmMessage += mess.mid( 10+len+3+9 ); 838 mAlarmMessage += mess.mid( 10+len+3+9 );
825 } else { 839 } else {
826 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 840 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
827 //qDebug("-----system command %s ",tempfilename.latin1() ); 841 //qDebug("-----system command %s ",tempfilename.latin1() );
828#ifndef _WIN32_ 842#ifndef _WIN32_
829 if ( vfork () == 0 ) { 843 if ( vfork () == 0 ) {
830 execl ( tempfilename.latin1(), 0 ); 844 execl ( tempfilename.latin1(), 0 );
831 return; 845 return;
832 } 846 }
833#else 847#else
834 QProcess* p = new QProcess(); 848 QProcess* p = new QProcess();
835 p->addArgument( tempfilename.latin1() ); 849 p->addArgument( tempfilename.latin1() );
836 p->start(); 850 p->start();
837 return; 851 return;
838#endif 852#endif
839 853
840 return; 854 return;
841 } 855 }
842 856
843 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 857 //qDebug("+++++++system command %s ",tempfilename.latin1() );
844 } 858 }
845 if ( mess.left( 11 ) == "audio_alarm") { 859 if ( mess.left( 11 ) == "audio_alarm") {
846 bool error = false; 860 bool error = false;
847 int len = mess.mid( 11 ).find("+++"); 861 int len = mess.mid( 11 ).find("+++");
848 if ( len < 2 ) 862 if ( len < 2 )
849 error = true; 863 error = true;
850 else { 864 else {
851 tempfilename = mess.mid( 11, len ); 865 tempfilename = mess.mid( 11, len );
852 if ( !QFile::exists( tempfilename ) ) 866 if ( !QFile::exists( tempfilename ) )
853 error = true; 867 error = true;
854 } 868 }
855 if ( ! error ) { 869 if ( ! error ) {
856 filename = tempfilename; 870 filename = tempfilename;
857 } 871 }
858 mAlarmMessage = mess.mid( 11+len+3+9 ); 872 mAlarmMessage = mess.mid( 11+len+3+9 );
859 //qDebug("audio file command %s ",tempfilename.latin1() ); 873 //qDebug("audio file command %s ",tempfilename.latin1() );
860 } 874 }
861 if ( mess.left( 9 ) == "cal_alarm") { 875 if ( mess.left( 9 ) == "cal_alarm") {
862 mAlarmMessage = mess.mid( 9 ) ; 876 mAlarmMessage = mess.mid( 9 ) ;
863 } 877 }
864 878
865 startAlarm( mAlarmMessage, filename ); 879 startAlarm( mAlarmMessage, filename );
866 880
867 881
868} 882}
869 883
870void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti ) 884void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
871{ 885{
872 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 886 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
873 887
874 mSuspendAlarmNotification = noti; 888 mSuspendAlarmNotification = noti;
875 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 889 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
876 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 890 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
877 mSuspendTimer->start( ms , true ); 891 mSuspendTimer->start( ms , true );
878 892
879} 893}
880 894
881void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 895void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
882{ 896{
883 mNextAlarmDateTime = qdt; 897 mNextAlarmDateTime = qdt;
884 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 898 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
885 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 899 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
886#ifndef DESKTOP_VERSION 900#ifndef DESKTOP_VERSION
887 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() ); 901 AlarmServer::addAlarm ( qdt,"koalarm", noti.utf8() );
888#endif 902#endif
889 return; 903 return;
890 } 904 }
891 int maxSec; 905 int maxSec;
892 //maxSec = 5; //testing only 906 //maxSec = 5; //testing only
893 maxSec = 86400+3600; // one day+1hour 907 maxSec = 86400+3600; // one day+1hour
894 mAlarmNotification = noti; 908 mAlarmNotification = noti;
895 int sec = QDateTime::currentDateTime().secsTo( qdt ); 909 int sec = QDateTime::currentDateTime().secsTo( qdt );
896 if ( sec > maxSec ) { 910 if ( sec > maxSec ) {
897 mRecheckAlarmTimer->start( maxSec * 1000 ); 911 mRecheckAlarmTimer->start( maxSec * 1000 );
898 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec ); 912 // qDebug("recheck Alarm timer started with secs: %d next alarm in sec:%d", maxSec,sec );
899 return; 913 return;
900 } else { 914 } else {
901 mRecheckAlarmTimer->stop(); 915 mRecheckAlarmTimer->stop();
902 } 916 }
903 //qDebug("Alarm timer started with secs: %d ", sec); 917 //qDebug("Alarm timer started with secs: %d ", sec);
904 mAlarmTimer->start( sec *1000 , true ); 918 mAlarmTimer->start( sec *1000 , true );
905 919
906} 920}
907// called by mRecheckAlarmTimer to get next alarm 921// called by mRecheckAlarmTimer to get next alarm
908// we need this, because a QTimer has only a max range of 25 days 922// we need this, because a QTimer has only a max range of 25 days
909void CalendarView::recheckTimerAlarm() 923void CalendarView::recheckTimerAlarm()
910{ 924{
911 mAlarmTimer->stop(); 925 mAlarmTimer->stop();
912 mRecheckAlarmTimer->stop(); 926 mRecheckAlarmTimer->stop();
913 mCalendar->checkAlarmForIncidence( 0, true ); 927 mCalendar->checkAlarmForIncidence( 0, true );
914} 928}
915void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti ) 929void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
916{ 930{
917 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 931 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
918 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 932 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
919#ifndef DESKTOP_VERSION 933#ifndef DESKTOP_VERSION
920 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); 934 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() );
921#endif 935#endif
922 return; 936 return;
923 } 937 }
924 mAlarmTimer->stop(); 938 mAlarmTimer->stop();
925} 939}
926void CalendarView::selectWeekNum ( int num ) 940void CalendarView::selectWeekNum ( int num )
927{ 941{
928 dateNavigator()->blockSignals( true ); 942 dateNavigator()->blockSignals( true );
929 dateNavigator()->selectWeek( num ); 943 dateNavigator()->selectWeek( num );
930 dateNavigator()->blockSignals( false ); 944 dateNavigator()->blockSignals( false );
931 mViewManager->showWeekView(); 945 mViewManager->showWeekView();
932} 946}
933KOViewManager *CalendarView::viewManager() 947KOViewManager *CalendarView::viewManager()
934{ 948{
935 return mViewManager; 949 return mViewManager;
936} 950}
937 951
938KODialogManager *CalendarView::dialogManager() 952KODialogManager *CalendarView::dialogManager()
939{ 953{
940 return mDialogManager; 954 return mDialogManager;
941} 955}
942 956
943QDate CalendarView::startDate() 957QDate CalendarView::startDate()
944{ 958{
945 DateList dates = mNavigator->selectedDates(); 959 DateList dates = mNavigator->selectedDates();
946 960
947 return dates.first(); 961 return dates.first();
948} 962}
949 963
950QDate CalendarView::endDate() 964QDate CalendarView::endDate()
951{ 965{
952 DateList dates = mNavigator->selectedDates(); 966 DateList dates = mNavigator->selectedDates();
953 967
954 return dates.last(); 968 return dates.last();
955} 969}
956 970
957 971
958void CalendarView::createPrinter() 972void CalendarView::createPrinter()
959{ 973{
960#ifndef KORG_NOPRINTER 974#ifndef KORG_NOPRINTER
961 if (!mCalPrinter) { 975 if (!mCalPrinter) {
962 mCalPrinter = new CalPrinter(this, mCalendar); 976 mCalPrinter = new CalPrinter(this, mCalendar);
963 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); 977 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig()));
964 } 978 }
965#endif 979#endif
966} 980}
967 981
968 982
969//KOPrefs::instance()->mWriteBackFile 983//KOPrefs::instance()->mWriteBackFile
970//KOPrefs::instance()->mWriteBackExistingOnly 984//KOPrefs::instance()->mWriteBackExistingOnly
971 985
972// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 986// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
973// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 987// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
974// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 988// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
975// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 989// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
976// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 990// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
977// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 991// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
978 992
979int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) 993int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full )
980{ 994{
981 995
982 // 0 equal 996 // 0 equal
983 // 1 take local 997 // 1 take local
984 // 2 take remote 998 // 2 take remote
985 // 3 cancel 999 // 3 cancel
986 QDateTime lastSync = mLastCalendarSync; 1000 QDateTime lastSync = mLastCalendarSync;
987 QDateTime localMod = local->lastModified(); 1001 QDateTime localMod = local->lastModified();
988 QDateTime remoteMod = remote->lastModified(); 1002 QDateTime remoteMod = remote->lastModified();
989 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1003 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
990 bool remCh, locCh; 1004 bool remCh, locCh;
991 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); 1005 remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) );
992 //if ( remCh ) 1006 //if ( remCh )
993 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); 1007 //qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() );
994 locCh = ( localMod > mLastCalendarSync ); 1008 locCh = ( localMod > mLastCalendarSync );
995 if ( !remCh && ! locCh ) { 1009 if ( !remCh && ! locCh ) {
996 //qDebug("both not changed "); 1010 //qDebug("both not changed ");
997 lastSync = localMod.addDays(1); 1011 lastSync = localMod.addDays(1);
998 if ( mode <= SYNC_PREF_ASK ) 1012 if ( mode <= SYNC_PREF_ASK )
999 return 0; 1013 return 0;
1000 } else { 1014 } else {
1001 if ( locCh ) { 1015 if ( locCh ) {
1002 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1()); 1016 //qDebug("loc changed %d %s %s", local->revision() , localMod.toString().latin1(), mLastCalendarSync.toString().latin1());
1003 lastSync = localMod.addDays( -1 ); 1017 lastSync = localMod.addDays( -1 );
1004 if ( !remCh ) 1018 if ( !remCh )
1005 remoteMod = ( lastSync.addDays( -1 ) ); 1019 remoteMod = ( lastSync.addDays( -1 ) );
1006 } else { 1020 } else {
1007 //qDebug(" not loc changed "); 1021 //qDebug(" not loc changed ");
1008 lastSync = localMod.addDays( 1 ); 1022 lastSync = localMod.addDays( 1 );
1009 if ( remCh ) 1023 if ( remCh )
1010 remoteMod =( lastSync.addDays( 1 ) ); 1024 remoteMod =( lastSync.addDays( 1 ) );
1011 1025
1012 } 1026 }
1013 } 1027 }
1014 full = true; 1028 full = true;
1015 if ( mode < SYNC_PREF_ASK ) 1029 if ( mode < SYNC_PREF_ASK )
1016 mode = SYNC_PREF_ASK; 1030 mode = SYNC_PREF_ASK;
1017 } else { 1031 } else {
1018 if ( localMod == remoteMod ) 1032 if ( localMod == remoteMod )
1019 // if ( local->revision() == remote->revision() ) 1033 // if ( local->revision() == remote->revision() )
1020 return 0; 1034 return 0;
1021 1035
1022 } 1036 }
1023 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); 1037 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() );
1024 1038
1025 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision()); 1039 //qDebug("%s %d %s %d", localMod.toString().latin1() , local->revision(), remoteMod.toString().latin1(), remote->revision());
1026 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() ); 1040 //qDebug("%d %d %d %d ", localMod.time().second(), localMod.time().msec(), remoteMod.time().second(), remoteMod.time().msec() );
1027 //full = true; //debug only 1041 //full = true; //debug only
1028 if ( full ) { 1042 if ( full ) {
1029 bool equ = false; 1043 bool equ = false;
1030 if ( local->typeID() == eventID ) { 1044 if ( local->typeID() == eventID ) {
1031 equ = (*((Event*) local) == *((Event*) remote)); 1045 equ = (*((Event*) local) == *((Event*) remote));
1032 } 1046 }
1033 else if ( local->typeID() == todoID ) 1047 else if ( local->typeID() == todoID )
1034 equ = (*((Todo*) local) == (*(Todo*) remote)); 1048 equ = (*((Todo*) local) == (*(Todo*) remote));
1035 else if ( local->typeID() == journalID ) 1049 else if ( local->typeID() == journalID )
1036 equ = (*((Journal*) local) == *((Journal*) remote)); 1050 equ = (*((Journal*) local) == *((Journal*) remote));
1037 if ( equ ) { 1051 if ( equ ) {
1038 //qDebug("equal "); 1052 //qDebug("equal ");
1039 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1053 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1040 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) ); 1054 local->setCsum( mCurrentSyncDevice, remote->getCsum(mCurrentSyncDevice) );
1041 } 1055 }
1042 if ( mode < SYNC_PREF_FORCE_LOCAL ) 1056 if ( mode < SYNC_PREF_FORCE_LOCAL )
1043 return 0; 1057 return 0;
1044 1058
1045 }//else //debug only 1059 }//else //debug only
1046 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 1060 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
1047 } 1061 }
1048 int result; 1062 int result;
1049 bool localIsNew; 1063 bool localIsNew;
1050 //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() ); 1064 //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() );
1051 1065
1052 1066
1053 // ************************************************ 1067 // ************************************************
1054 // ************************************************ 1068 // ************************************************
1055 // ************************************************ 1069 // ************************************************
1056 // We may have that lastSync > remoteMod AND lastSync > localMod 1070 // We may have that lastSync > remoteMod AND lastSync > localMod
1057 // BUT remoteMod != localMod 1071 // BUT remoteMod != localMod
1058 1072
1059 1073
1060 if ( full && mode < SYNC_PREF_NEWEST ) 1074 if ( full && mode < SYNC_PREF_NEWEST )
1061 mode = SYNC_PREF_ASK; 1075 mode = SYNC_PREF_ASK;
1062 1076
1063 switch( mode ) { 1077 switch( mode ) {
1064 case SYNC_PREF_LOCAL: 1078 case SYNC_PREF_LOCAL:
1065 if ( lastSync > remoteMod ) 1079 if ( lastSync > remoteMod )
1066 return 1; 1080 return 1;
1067 if ( lastSync > localMod ) 1081 if ( lastSync > localMod )
1068 return 2; 1082 return 2;
1069 return 1; 1083 return 1;
1070 break; 1084 break;
1071 case SYNC_PREF_REMOTE: 1085 case SYNC_PREF_REMOTE:
1072 if ( lastSync > localMod ) 1086 if ( lastSync > localMod )
1073 return 2; 1087 return 2;
1074 if ( lastSync > remoteMod ) 1088 if ( lastSync > remoteMod )
1075 return 1; 1089 return 1;
1076 return 2; 1090 return 2;
1077 break; 1091 break;
1078 case SYNC_PREF_NEWEST: 1092 case SYNC_PREF_NEWEST:
1079 if ( localMod >= remoteMod ) 1093 if ( localMod >= remoteMod )
1080 return 1; 1094 return 1;
1081 else 1095 else
1082 return 2; 1096 return 2;
1083 break; 1097 break;
1084 case SYNC_PREF_ASK: 1098 case SYNC_PREF_ASK:
1085 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 1099 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
1086 if ( lastSync > remoteMod && lastSync > localMod) 1100 if ( lastSync > remoteMod && lastSync > localMod)
1087 return 0; 1101 return 0;
1088 if ( lastSync > remoteMod ) 1102 if ( lastSync > remoteMod )
1089 return 1; 1103 return 1;
1090 if ( lastSync > localMod ) 1104 if ( lastSync > localMod )
1091 return 2; 1105 return 2;
1092 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() ); 1106 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), localMod.toString().latin1(), remoteMod.toString().latin1() );
1093 localIsNew = localMod >= remoteMod; 1107 localIsNew = localMod >= remoteMod;
1094 if ( localIsNew ) 1108 if ( localIsNew )
1095 getEventViewerDialog()->setColorMode( 1 ); 1109 getEventViewerDialog()->setColorMode( 1 );
1096 else 1110 else
1097 getEventViewerDialog()->setColorMode( 2 ); 1111 getEventViewerDialog()->setColorMode( 2 );
1098 getEventViewerDialog()->setIncidence(local); 1112 getEventViewerDialog()->setIncidence(local);
1099 if ( localIsNew ) 1113 if ( localIsNew )
1100 getEventViewerDialog()->setColorMode( 2 ); 1114 getEventViewerDialog()->setColorMode( 2 );
1101 else 1115 else
1102 getEventViewerDialog()->setColorMode( 1 ); 1116 getEventViewerDialog()->setColorMode( 1 );
1103 getEventViewerDialog()->addIncidence(remote); 1117 getEventViewerDialog()->addIncidence(remote);
1104 getEventViewerDialog()->setColorMode( 0 ); 1118 getEventViewerDialog()->setColorMode( 0 );
1105 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() ); 1119 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() );
1106 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!")); 1120 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!"));
1107 getEventViewerDialog()->showMe(); 1121 getEventViewerDialog()->showMe();
1108 result = getEventViewerDialog()->executeS( localIsNew ); 1122 result = getEventViewerDialog()->executeS( localIsNew );
1109 return result; 1123 return result;
1110 1124
1111 break; 1125 break;
1112 case SYNC_PREF_FORCE_LOCAL: 1126 case SYNC_PREF_FORCE_LOCAL:
1113 return 1; 1127 return 1;
1114 break; 1128 break;
1115 case SYNC_PREF_FORCE_REMOTE: 1129 case SYNC_PREF_FORCE_REMOTE:
1116 return 2; 1130 return 2;
1117 break; 1131 break;
1118 1132
1119 default: 1133 default:
1120 // SYNC_PREF_TAKE_BOTH not implemented 1134 // SYNC_PREF_TAKE_BOTH not implemented
1121 break; 1135 break;
1122 } 1136 }
1123 return 0; 1137 return 0;
1124} 1138}
1125Event* CalendarView::getLastSyncEvent() 1139Event* CalendarView::getLastSyncEvent()
1126{ 1140{
1127 Event* lse; 1141 Event* lse;
1128 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 1142 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
1129 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice ); 1143 lse = mCalendar->event( "last-syncEvent-"+mCurrentSyncDevice );
1130 if (!lse) { 1144 if (!lse) {
1131 lse = new Event(); 1145 lse = new Event();
1132 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice ); 1146 lse->setUid( "last-syncEvent-"+mCurrentSyncDevice );
1133 QString sum = ""; 1147 QString sum = "";
1134 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) ) 1148 if ( mSyncManager->mExternSyncProfiles.contains( mCurrentSyncDevice ) )
1135 sum = "E: "; 1149 sum = "E: ";
1136 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event")); 1150 lse->setSummary(sum+mCurrentSyncDevice + i18n(" - sync event"));
1137 lse->setDtStart( mLastCalendarSync ); 1151 lse->setDtStart( mLastCalendarSync );
1138 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1152 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1139 lse->setCategories( i18n("SyncEvent") ); 1153 lse->setCategories( i18n("SyncEvent") );
1140 lse->setReadOnly( true ); 1154 lse->setReadOnly( true );
1141 mCalendar->addEvent( lse ); 1155 mCalendar->addEvent( lse );
1142 } 1156 }
1143 1157
1144 return lse; 1158 return lse;
1145 1159
1146} 1160}
1147 1161
1148// we check, if the to delete event has a id for a profile 1162// we check, if the to delete event has a id for a profile
1149// if yes, we set this id in the profile to delete 1163// if yes, we set this id in the profile to delete
1150void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ) 1164void CalendarView::checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete )
1151{ 1165{
1152 if ( lastSync.count() == 0 ) { 1166 if ( lastSync.count() == 0 ) {
1153 //qDebug(" lastSync.count() == 0"); 1167 //qDebug(" lastSync.count() == 0");
1154 return; 1168 return;
1155 } 1169 }
1156 if ( toDelete->typeID() == journalID ) 1170 if ( toDelete->typeID() == journalID )
1157 return; 1171 return;
1158 1172
1159 Event* eve = lastSync.first(); 1173 Event* eve = lastSync.first();
1160 1174
1161 while ( eve ) { 1175 while ( eve ) {
1162 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name 1176 QString id = toDelete->getID( eve->uid().mid( 15 ) ); // this is the sync profile name
1163 if ( !id.isEmpty() ) { 1177 if ( !id.isEmpty() ) {
1164 QString des = eve->description(); 1178 QString des = eve->description();
1165 QString pref = "e"; 1179 QString pref = "e";
1166 if ( toDelete->typeID() == todoID ) 1180 if ( toDelete->typeID() == todoID )
1167 pref = "t"; 1181 pref = "t";
1168 des += pref+ id + ","; 1182 des += pref+ id + ",";
1169 eve->setReadOnly( false ); 1183 eve->setReadOnly( false );
1170 eve->setDescription( des ); 1184 eve->setDescription( des );
1171 //qDebug("setdes %s ", des.latin1()); 1185 //qDebug("setdes %s ", des.latin1());
1172 eve->setReadOnly( true ); 1186 eve->setReadOnly( true );
1173 } 1187 }
1174 eve = lastSync.next(); 1188 eve = lastSync.next();
1175 } 1189 }
1176 1190
1177} 1191}
1178void CalendarView::checkExternalId( Incidence * inc ) 1192void CalendarView::checkExternalId( Incidence * inc )
1179{ 1193{
1180 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ; 1194 QPtrList<Event> lastSync = mCalendar->getExternLastSyncEvents() ;
1181 checkExternSyncEvent( lastSync, inc ); 1195 checkExternSyncEvent( lastSync, inc );
1182 1196
1183} 1197}
1184bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) 1198bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
1185{ 1199{
1186 bool syncOK = true; 1200 bool syncOK = true;
1187 int addedEvent = 0; 1201 int addedEvent = 0;
1188 int addedEventR = 0; 1202 int addedEventR = 0;
1189 int deletedEventR = 0; 1203 int deletedEventR = 0;
1190 int deletedEventL = 0; 1204 int deletedEventL = 0;
1191 int changedLocal = 0; 1205 int changedLocal = 0;
1192 int changedRemote = 0; 1206 int changedRemote = 0;
1193 int filteredIN = 0; 1207 int filteredIN = 0;
1194 int filteredOUT = 0; 1208 int filteredOUT = 0;
1195 //QPtrList<Event> el = local->rawEvents(); 1209 //QPtrList<Event> el = local->rawEvents();
1196 Event* eventR; 1210 Event* eventR;
1197 QString uid; 1211 QString uid;
1198 int take; 1212 int take;
1199 Event* eventL; 1213 Event* eventL;
1200 Event* eventRSync; 1214 Event* eventRSync;
1201 Event* eventLSync; 1215 Event* eventLSync;
1202 clearAllViews(); 1216 clearAllViews();
1203 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); 1217 QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents();
1204 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents(); 1218 QPtrList<Event> eventLSyncSharp = local->getExternLastSyncEvents();
1205 bool fullDateRange = false; 1219 bool fullDateRange = false;
1206 local->resetTempSyncStat(); 1220 local->resetTempSyncStat();
1207 mLastCalendarSync = QDateTime::currentDateTime(); 1221 mLastCalendarSync = QDateTime::currentDateTime();
1208 if ( mSyncManager->syncWithDesktop() ) { 1222 if ( mSyncManager->syncWithDesktop() ) {
1209 remote->resetPilotStat(1); 1223 remote->resetPilotStat(1);
1210 if ( KSyncManager::mRequestedSyncEvent.isValid() ) { 1224 if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
1211 mLastCalendarSync = KSyncManager::mRequestedSyncEvent; 1225 mLastCalendarSync = KSyncManager::mRequestedSyncEvent;
1212 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() ); 1226 qDebug("KO: using extern time for calendar sync: %s ", mLastCalendarSync.toString().latin1() );
1213 } else { 1227 } else {
1214 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); 1228 qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime ");
1215 } 1229 }
1216 } 1230 }
1217 QDateTime modifiedCalendar = mLastCalendarSync; 1231 QDateTime modifiedCalendar = mLastCalendarSync;
1218 eventLSync = getLastSyncEvent(); 1232 eventLSync = getLastSyncEvent();
1219 eventR = remote->event("last-syncEvent-"+mCurrentSyncName ); 1233 eventR = remote->event("last-syncEvent-"+mCurrentSyncName );
1220 if ( eventR ) { 1234 if ( eventR ) {
1221 eventRSync = (Event*) eventR->clone(); 1235 eventRSync = (Event*) eventR->clone();
1222 remote->deleteEvent(eventR ); 1236 remote->deleteEvent(eventR );
1223 1237
1224 } else { 1238 } else {
1225 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) { 1239 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL || mSyncManager->syncWithDesktop()) {
1226 eventRSync = (Event*)eventLSync->clone(); 1240 eventRSync = (Event*)eventLSync->clone();
1227 } else { 1241 } else {
1228 fullDateRange = true; 1242 fullDateRange = true;
1229 eventRSync = new Event(); 1243 eventRSync = new Event();
1230 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 1244 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
1231 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName ); 1245 eventRSync->setUid("last-syncEvent-"+mCurrentSyncName );
1232 eventRSync->setDtStart( mLastCalendarSync ); 1246 eventRSync->setDtStart( mLastCalendarSync );
1233 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 1247 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
1234 eventRSync->setCategories( i18n("SyncEvent") ); 1248 eventRSync->setCategories( i18n("SyncEvent") );
1235 } 1249 }
1236 } 1250 }
1237 if ( eventLSync->dtStart() == mLastCalendarSync ) 1251 if ( eventLSync->dtStart() == mLastCalendarSync )
1238 fullDateRange = true; 1252 fullDateRange = true;
1239 1253
1240 if ( ! fullDateRange ) { 1254 if ( ! fullDateRange ) {
1241 if ( eventLSync->dtStart() != eventRSync->dtStart() ) { 1255 if ( eventLSync->dtStart() != eventRSync->dtStart() ) {
1242 1256
1243 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() ); 1257 // qDebug("set fulldate to true %s %s" ,eventLSync->dtStart().toString().latin1(), eventRSync->dtStart().toString().latin1() );
1244 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec()); 1258 //qDebug("%d %d %d %d ", eventLSync->dtStart().time().second(), eventLSync->dtStart().time().msec() , eventRSync->dtStart().time().second(), eventRSync->dtStart().time().msec());
1245 fullDateRange = true; 1259 fullDateRange = true;
1246 } 1260 }
1247 } 1261 }
1248 if ( mSyncManager->syncWithDesktop() ) { 1262 if ( mSyncManager->syncWithDesktop() ) {
1249 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); 1263 fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync );
1250 } 1264 }
1251 if ( fullDateRange ) 1265 if ( fullDateRange )
1252 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); 1266 mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365);
1253 else 1267 else
1254 mLastCalendarSync = eventLSync->dtStart(); 1268 mLastCalendarSync = eventLSync->dtStart();
1255 // for resyncing if own file has changed 1269 // for resyncing if own file has changed
1256 if ( mCurrentSyncDevice == "deleteaftersync" ) { 1270 if ( mCurrentSyncDevice == "deleteaftersync" ) {
1257 mLastCalendarSync = loadedFileVersion; 1271 mLastCalendarSync = loadedFileVersion;
1258 //qDebug("setting mLastCalendarSync "); 1272 //qDebug("setting mLastCalendarSync ");
1259 } 1273 }
1260 //qDebug("*************************** "); 1274 //qDebug("*************************** ");
1261 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); 1275 qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange);
1262 QPtrList<Incidence> er = remote->rawIncidences(); 1276 QPtrList<Incidence> er = remote->rawIncidences();
1263 Incidence* inR = er.first(); 1277 Incidence* inR = er.first();
1264 Incidence* inL; 1278 Incidence* inL;
1265 QProgressBar bar( er.count(),0 ); 1279 QProgressBar bar( er.count(),0 );
1266 bar.setCaption (i18n("Syncing - close to abort!") ); 1280 bar.setCaption (i18n("Syncing - close to abort!") );
1267 1281
1268 // ************** setting up filter ************* 1282 // ************** setting up filter *************
1269 CalFilter *filterIN = 0; 1283 CalFilter *filterIN = 0;
1270 CalFilter *filterOUT = 0; 1284 CalFilter *filterOUT = 0;
1271 CalFilter *filter = mFilters.first(); 1285 CalFilter *filter = mFilters.first();
1272 while(filter) { 1286 while(filter) {
1273 if ( filter->name() == mSyncManager->mFilterInCal ) 1287 if ( filter->name() == mSyncManager->mFilterInCal )
1274 filterIN = filter; 1288 filterIN = filter;
1275 if ( filter->name() == mSyncManager->mFilterOutCal ) 1289 if ( filter->name() == mSyncManager->mFilterOutCal )
1276 filterOUT = filter; 1290 filterOUT = filter;
1277 filter = mFilters.next(); 1291 filter = mFilters.next();
1278 } 1292 }
1279 int w = 300; 1293 int w = 300;
1280 if ( QApplication::desktop()->width() < 320 ) 1294 if ( QApplication::desktop()->width() < 320 )
1281 w = 220; 1295 w = 220;
1282 int h = bar.sizeHint().height() ; 1296 int h = bar.sizeHint().height() ;
1283 int dw = QApplication::desktop()->width(); 1297 int dw = QApplication::desktop()->width();
1284 int dh = QApplication::desktop()->height(); 1298 int dh = QApplication::desktop()->height();
1285 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1299 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1286 bar.show(); 1300 bar.show();
1287 int modulo = (er.count()/10)+1; 1301 int modulo = (er.count()/10)+1;
1288 int incCounter = 0; 1302 int incCounter = 0;
1289 while ( inR ) { 1303 while ( inR ) {
1290 if ( ! bar.isVisible() ) 1304 if ( ! bar.isVisible() )
1291 return false; 1305 return false;
1292 if ( incCounter % modulo == 0 ) 1306 if ( incCounter % modulo == 0 )
1293 bar.setProgress( incCounter ); 1307 bar.setProgress( incCounter );
1294 ++incCounter; 1308 ++incCounter;
1295 uid = inR->uid(); 1309 uid = inR->uid();
1296 bool skipIncidence = false; 1310 bool skipIncidence = false;
1297 if ( uid.left(15) == QString("last-syncEvent-") ) 1311 if ( uid.left(15) == QString("last-syncEvent-") )
1298 skipIncidence = true; 1312 skipIncidence = true;
1299 QString idS; 1313 QString idS;
1300 qApp->processEvents(); 1314 qApp->processEvents();
1301 if ( !skipIncidence ) { 1315 if ( !skipIncidence ) {
1302 inL = local->incidence( uid ); 1316 inL = local->incidence( uid );
1303 if ( inL ) { // maybe conflict - same uid in both calendars 1317 if ( inL ) { // maybe conflict - same uid in both calendars
1304 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { 1318 if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) {
1305 //qDebug("take %d %s ", take, inL->summary().latin1()); 1319 //qDebug("take %d %s ", take, inL->summary().latin1());
1306 if ( take == 3 ) 1320 if ( take == 3 )
1307 return false; 1321 return false;
1308 if ( take == 1 ) {// take local ********************** 1322 if ( take == 1 ) {// take local **********************
1309 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) 1323 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL )
1310 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1324 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1311 else 1325 else
1312 idS = inR->IDStr(); 1326 idS = inR->IDStr();
1313 remote->deleteIncidence( inR ); 1327 remote->deleteIncidence( inR );
1314 inR = inL->clone(); 1328 inR = inL->clone();
1315 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1329 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1316 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) 1330 if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL )
1317 inR->setIDStr( idS ); 1331 inR->setIDStr( idS );
1318 remote->addIncidence( inR ); 1332 remote->addIncidence( inR );
1319 if ( mSyncManager->syncWithDesktop() ) 1333 if ( mSyncManager->syncWithDesktop() )
1320 inR->setPilotId( 2 ); 1334 inR->setPilotId( 2 );
1321 ++changedRemote; 1335 ++changedRemote;
1322 } else {// take remote ********************** 1336 } else {// take remote **********************
1323 idS = inL->IDStr(); 1337 idS = inL->IDStr();
1324 int pid = inL->pilotId(); 1338 int pid = inL->pilotId();
1325 local->deleteIncidence( inL ); 1339 local->deleteIncidence( inL );
1326 inL = inR->clone(); 1340 inL = inR->clone();
1327 if ( mSyncManager->syncWithDesktop() ) 1341 if ( mSyncManager->syncWithDesktop() )
1328 inL->setPilotId( pid ); 1342 inL->setPilotId( pid );
1329 inL->setIDStr( idS ); 1343 inL->setIDStr( idS );
1330 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1344 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1331 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1345 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1332 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1346 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1333 } 1347 }
1334 local->addIncidence( inL ); 1348 local->addIncidence( inL );
1335 ++changedLocal; 1349 ++changedLocal;
1336 } 1350 }
1337 } 1351 }
1338 } else { // no conflict ********** add or delete remote 1352 } else { // no conflict ********** add or delete remote
1339 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ 1353 if ( !filterIN || filterIN->filterCalendarItem( inR ) ){
1340 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1354 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1341 QString des = eventLSync->description(); 1355 QString des = eventLSync->description();
1342 QString pref = "e"; 1356 QString pref = "e";
1343 if ( inR->typeID() == todoID ) 1357 if ( inR->typeID() == todoID )
1344 pref = "t"; 1358 pref = "t";
1345 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it 1359 if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it
1346 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); 1360 inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE );
1347 //remote->deleteIncidence( inR ); 1361 //remote->deleteIncidence( inR );
1348 ++deletedEventR; 1362 ++deletedEventR;
1349 } else { 1363 } else {
1350 inR->setLastModified( modifiedCalendar ); 1364 inR->setLastModified( modifiedCalendar );
1351 inL = inR->clone(); 1365 inL = inR->clone();
1352 inL->setIDStr( ":" ); 1366 inL->setIDStr( ":" );
1353 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); 1367 inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) );
1354 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); 1368 inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) );
1355 local->addIncidence( inL ); 1369 local->addIncidence( inL );
1356 ++addedEvent; 1370 ++addedEvent;
1357 1371
1358 } 1372 }
1359 } else { 1373 } else {
1360 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { 1374 if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) {
1361 inR->setLastModified( modifiedCalendar ); 1375 inR->setLastModified( modifiedCalendar );
1362 inL = inR->clone(); 1376 inL = inR->clone();
1363 inL->setIDStr( ":" ); 1377 inL->setIDStr( ":" );
1364 local->addIncidence( inL ); 1378 local->addIncidence( inL );
1365 ++addedEvent; 1379 ++addedEvent;
1366 1380
1367 } else { 1381 } else {
1368 checkExternSyncEvent(eventRSyncSharp, inR); 1382 checkExternSyncEvent(eventRSyncSharp, inR);
1369 remote->deleteIncidence( inR ); 1383 remote->deleteIncidence( inR );
1370 ++deletedEventR; 1384 ++deletedEventR;
1371 } 1385 }
1372 } 1386 }
1373 } else { 1387 } else {
1374 ++filteredIN; 1388 ++filteredIN;
1375 } 1389 }
1376 } 1390 }
1377 } 1391 }
1378 inR = er.next(); 1392 inR = er.next();
1379 } 1393 }
1380 QPtrList<Incidence> el = local->rawIncidences(); 1394 QPtrList<Incidence> el = local->rawIncidences();
1381 inL = el.first(); 1395 inL = el.first();
1382 modulo = (el.count()/10)+1; 1396 modulo = (el.count()/10)+1;
1383 bar.setCaption (i18n("Add / remove events") ); 1397 bar.setCaption (i18n("Add / remove events") );
1384 bar.setTotalSteps ( el.count() ) ; 1398 bar.setTotalSteps ( el.count() ) ;
1385 bar.show(); 1399 bar.show();
1386 incCounter = 0; 1400 incCounter = 0;
1387 1401
1388 while ( inL ) { 1402 while ( inL ) {
1389 1403
1390 qApp->processEvents(); 1404 qApp->processEvents();
1391 if ( ! bar.isVisible() ) 1405 if ( ! bar.isVisible() )
1392 return false; 1406 return false;
1393 if ( incCounter % modulo == 0 ) 1407 if ( incCounter % modulo == 0 )
1394 bar.setProgress( incCounter ); 1408 bar.setProgress( incCounter );
1395 ++incCounter; 1409 ++incCounter;
1396 uid = inL->uid(); 1410 uid = inL->uid();
1397 bool skipIncidence = false; 1411 bool skipIncidence = false;
1398 if ( uid.left(15) == QString("last-syncEvent-") ) 1412 if ( uid.left(15) == QString("last-syncEvent-") )
1399 skipIncidence = true; 1413 skipIncidence = true;
1400 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) 1414 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID )
1401 skipIncidence = true; 1415 skipIncidence = true;
1402 if ( !skipIncidence ) { 1416 if ( !skipIncidence ) {
1403 inR = remote->incidence( uid ); 1417 inR = remote->incidence( uid );
1404 if ( ! inR ) { 1418 if ( ! inR ) {
1405 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ 1419 if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){
1406 // no conflict ********** add or delete local 1420 // no conflict ********** add or delete local
1407 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { 1421 if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) {
1408 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { 1422 if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) {
1409 checkExternSyncEvent(eventLSyncSharp, inL); 1423 checkExternSyncEvent(eventLSyncSharp, inL);
1410 local->deleteIncidence( inL ); 1424 local->deleteIncidence( inL );
1411 ++deletedEventL; 1425 ++deletedEventL;
1412 } else { 1426 } else {
1413 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1427 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1414 inL->removeID(mCurrentSyncDevice ); 1428 inL->removeID(mCurrentSyncDevice );
1415 ++addedEventR; 1429 ++addedEventR;
1416 //qDebug("remote added Incidence %s ", inL->summary().latin1()); 1430 //qDebug("remote added Incidence %s ", inL->summary().latin1());
1417 inL->setLastModified( modifiedCalendar ); 1431 inL->setLastModified( modifiedCalendar );
1418 inR = inL->clone(); 1432 inR = inL->clone();
1419 inR->setIDStr( ":" ); 1433 inR->setIDStr( ":" );
1420 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); 1434 inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL );
1421 remote->addIncidence( inR ); 1435 remote->addIncidence( inR );
1422 } 1436 }
1423 } 1437 }
1424 } else { 1438 } else {
1425 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { 1439 if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) {
1426 checkExternSyncEvent(eventLSyncSharp, inL); 1440 checkExternSyncEvent(eventLSyncSharp, inL);
1427 local->deleteIncidence( inL ); 1441 local->deleteIncidence( inL );
1428 ++deletedEventL; 1442 ++deletedEventL;
1429 } else { 1443 } else {
1430 if ( ! mSyncManager->mWriteBackExistingOnly ) { 1444 if ( ! mSyncManager->mWriteBackExistingOnly ) {
1431 ++addedEventR; 1445 ++addedEventR;
1432 inL->setLastModified( modifiedCalendar ); 1446 inL->setLastModified( modifiedCalendar );
1433 inR = inL->clone(); 1447 inR = inL->clone();
1434 inR->setIDStr( ":" ); 1448 inR->setIDStr( ":" );
1435 remote->addIncidence( inR ); 1449 remote->addIncidence( inR );
1436 } 1450 }
1437 } 1451 }
1438 } 1452 }
1439 } else { 1453 } else {
1440 ++filteredOUT; 1454 ++filteredOUT;
1441 } 1455 }
1442 } 1456 }
1443 } 1457 }
1444 inL = el.next(); 1458 inL = el.next();
1445 } 1459 }
1446 int delFut = 0; 1460 int delFut = 0;
1447 int remRem = 0; 1461 int remRem = 0;
1448 if ( mSyncManager->mWriteBackInFuture ) { 1462 if ( mSyncManager->mWriteBackInFuture ) {
1449 er = remote->rawIncidences(); 1463 er = remote->rawIncidences();
1450 remRem = er.count(); 1464 remRem = er.count();
1451 inR = er.first(); 1465 inR = er.first();
1452 QDateTime dt; 1466 QDateTime dt;
1453 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); 1467 QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) );
1454 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); 1468 QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 );
1455 while ( inR ) { 1469 while ( inR ) {
1456 if ( inR->typeID() == todoID ) { 1470 if ( inR->typeID() == todoID ) {
1457 Todo * t = (Todo*)inR; 1471 Todo * t = (Todo*)inR;
1458 if ( t->hasDueDate() ) 1472 if ( t->hasDueDate() )
1459 dt = t->dtDue(); 1473 dt = t->dtDue();
1460 else 1474 else
1461 dt = cur.addSecs( 62 ); 1475 dt = cur.addSecs( 62 );
1462 } 1476 }
1463 else if (inR->typeID() == eventID ) { 1477 else if (inR->typeID() == eventID ) {
1464 bool ok; 1478 bool ok;
1465 dt = inR->getNextOccurence( cur, &ok ); 1479 dt = inR->getNextOccurence( cur, &ok );
1466 if ( !ok ) 1480 if ( !ok )
1467 dt = cur.addSecs( -62 ); 1481 dt = cur.addSecs( -62 );
1468 } 1482 }
1469 else 1483 else
1470 dt = inR->dtStart(); 1484 dt = inR->dtStart();
1471 if ( dt < cur || dt > end ) { 1485 if ( dt < cur || dt > end ) {
1472 remote->deleteIncidence( inR ); 1486 remote->deleteIncidence( inR );
1473 ++delFut; 1487 ++delFut;
1474 } 1488 }
1475 inR = er.next(); 1489 inR = er.next();
1476 } 1490 }
1477 } 1491 }
1478 bar.hide(); 1492 bar.hide();
1479 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); 1493 mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 );
1480 eventLSync->setReadOnly( false ); 1494 eventLSync->setReadOnly( false );
1481 eventLSync->setDtStart( mLastCalendarSync ); 1495 eventLSync->setDtStart( mLastCalendarSync );
1482 eventRSync->setDtStart( mLastCalendarSync ); 1496 eventRSync->setDtStart( mLastCalendarSync );
1483 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1497 eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1484 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); 1498 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) );
1485 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; 1499 eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ;
1486 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); 1500 eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName );
1487 eventLSync->setReadOnly( true ); 1501 eventLSync->setReadOnly( true );
1488 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL ); 1502 qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL );
1489 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... 1503 if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal...
1490 remote->addEvent( eventRSync ); 1504 remote->addEvent( eventRSync );
1491 else 1505 else
1492 delete eventRSync; 1506 delete eventRSync;
1493 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() ); 1507 qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() );
1494 QString mes; 1508 QString mes;
1495 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 ); 1509 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 );
1496 QString delmess; 1510 QString delmess;
1497 if ( delFut ) { 1511 if ( delFut ) {
1498 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); 1512 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);
1499 mes += delmess; 1513 mes += delmess;
1500 } 1514 }
1501 mes = i18n("Local calendar changed!\n") +mes; 1515 mes = i18n("Local calendar changed!\n") +mes;
1502 mCalendar->checkAlarmForIncidence( 0, true ); 1516 mCalendar->checkAlarmForIncidence( 0, true );
1503 qDebug( mes ); 1517 qDebug( mes );
1504 if ( mSyncManager->mShowSyncSummary ) { 1518 if ( mSyncManager->mShowSyncSummary ) {
1505 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, 1519 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes,
1506 i18n("KO/Pi Synchronization"),i18n("Write back"))) { 1520 i18n("KO/Pi Synchronization"),i18n("Write back"))) {
1507 qDebug("KO: WB cancelled "); 1521 qDebug("KO: WB cancelled ");
1508 mSyncManager->mWriteBackFile = false; 1522 mSyncManager->mWriteBackFile = false;
1509 return syncOK; 1523 return syncOK;
1510 } 1524 }
1511 } 1525 }
1512 return syncOK; 1526 return syncOK;
1513} 1527}
1514 1528
1515void CalendarView::setSyncDevice( QString s ) 1529void CalendarView::setSyncDevice( QString s )
1516{ 1530{
1517 mCurrentSyncDevice= s; 1531 mCurrentSyncDevice= s;
1518} 1532}
1519void CalendarView::setSyncName( QString s ) 1533void CalendarView::setSyncName( QString s )
1520{ 1534{
1521 mCurrentSyncName= s; 1535 mCurrentSyncName= s;
1522} 1536}
1523bool CalendarView::syncCalendar(QString filename, int mode) 1537bool CalendarView::syncCalendar(QString filename, int mode)
1524{ 1538{
1525 //qDebug("syncCalendar %s ", filename.latin1()); 1539 //qDebug("syncCalendar %s ", filename.latin1());
1526 mGlobalSyncMode = SYNC_MODE_NORMAL; 1540 mGlobalSyncMode = SYNC_MODE_NORMAL;
1527 CalendarLocal* calendar = new CalendarLocal(); 1541 CalendarLocal* calendar = new CalendarLocal();
1528 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1542 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1529 FileStorage* storage = new FileStorage( calendar ); 1543 FileStorage* storage = new FileStorage( calendar );
1530 bool syncOK = false; 1544 bool syncOK = false;
1531 storage->setFileName( filename ); 1545 storage->setFileName( filename );
1532 // qDebug("loading ... "); 1546 // qDebug("loading ... ");
1533 if ( storage->load() ) { 1547 if ( storage->load() ) {
1534 getEventViewerDialog()->setSyncMode( true ); 1548 getEventViewerDialog()->setSyncMode( true );
1535 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 1549 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
1536 getEventViewerDialog()->setSyncMode( false ); 1550 getEventViewerDialog()->setSyncMode( false );
1537 if ( syncOK ) { 1551 if ( syncOK ) {
1538 if ( mSyncManager->mWriteBackFile ) 1552 if ( mSyncManager->mWriteBackFile )
1539 { 1553 {
1540 storage->setSaveFormat( new ICalFormat() ); 1554 storage->setSaveFormat( new ICalFormat() );
1541 storage->save(); 1555 storage->save();
1542 } 1556 }
1543 } 1557 }
1544 setModified( true ); 1558 setModified( true );
1545 } 1559 }
1546 delete storage; 1560 delete storage;
1547 delete calendar; 1561 delete calendar;
1548 if ( syncOK ) 1562 if ( syncOK )
1549 updateView(); 1563 updateView();
1550 return syncOK; 1564 return syncOK;
1551} 1565}
1552 1566
1553void CalendarView::syncExternal( int mode ) 1567void CalendarView::syncExternal( int mode )
1554{ 1568{
1555 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 1569 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
1556 1570
1557 qApp->processEvents(); 1571 qApp->processEvents();
1558 CalendarLocal* calendar = new CalendarLocal(); 1572 CalendarLocal* calendar = new CalendarLocal();
1559 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1573 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1560 bool syncOK = false; 1574 bool syncOK = false;
1561 bool loadSuccess = false; 1575 bool loadSuccess = false;
1562 PhoneFormat* phoneFormat = 0; 1576 PhoneFormat* phoneFormat = 0;
1563 emit tempDisableBR(true); 1577 emit tempDisableBR(true);
1564#ifndef DESKTOP_VERSION 1578#ifndef DESKTOP_VERSION
1565 SharpFormat* sharpFormat = 0; 1579 SharpFormat* sharpFormat = 0;
1566 if ( mode == 0 ) { // sharp 1580 if ( mode == 0 ) { // sharp
1567 sharpFormat = new SharpFormat () ; 1581 sharpFormat = new SharpFormat () ;
1568 loadSuccess = sharpFormat->load( calendar, mCalendar ); 1582 loadSuccess = sharpFormat->load( calendar, mCalendar );
1569 1583
1570 } else 1584 } else
1571#endif 1585#endif
1572 if ( mode == 1 ) { // phone 1586 if ( mode == 1 ) { // phone
1573 phoneFormat = new PhoneFormat (mCurrentSyncDevice, 1587 phoneFormat = new PhoneFormat (mCurrentSyncDevice,
1574 mSyncManager->mPhoneDevice, 1588 mSyncManager->mPhoneDevice,
1575 mSyncManager->mPhoneConnection, 1589 mSyncManager->mPhoneConnection,
1576 mSyncManager->mPhoneModel); 1590 mSyncManager->mPhoneModel);
1577 loadSuccess = phoneFormat->load( calendar,mCalendar); 1591 loadSuccess = phoneFormat->load( calendar,mCalendar);
1578 1592
1579 } else { 1593 } else {
1580 emit tempDisableBR(false); 1594 emit tempDisableBR(false);
1581 return; 1595 return;
1582 } 1596 }
1583 if ( loadSuccess ) { 1597 if ( loadSuccess ) {
1584 getEventViewerDialog()->setSyncMode( true ); 1598 getEventViewerDialog()->setSyncMode( true );
1585 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1599 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1586 getEventViewerDialog()->setSyncMode( false ); 1600 getEventViewerDialog()->setSyncMode( false );
1587 qApp->processEvents(); 1601 qApp->processEvents();
1588 if ( syncOK ) { 1602 if ( syncOK ) {
1589 if ( mSyncManager->mWriteBackFile ) 1603 if ( mSyncManager->mWriteBackFile )
1590 { 1604 {
1591 QPtrList<Incidence> iL = mCalendar->rawIncidences(); 1605 QPtrList<Incidence> iL = mCalendar->rawIncidences();
1592 Incidence* inc = iL.first(); 1606 Incidence* inc = iL.first();
1593 if ( phoneFormat ) { 1607 if ( phoneFormat ) {
1594 while ( inc ) { 1608 while ( inc ) {
1595 inc->removeID(mCurrentSyncDevice); 1609 inc->removeID(mCurrentSyncDevice);
1596 inc = iL.next(); 1610 inc = iL.next();
1597 } 1611 }
1598 } 1612 }
1599#ifndef DESKTOP_VERSION 1613#ifndef DESKTOP_VERSION
1600 if ( sharpFormat ) 1614 if ( sharpFormat )
1601 sharpFormat->save(calendar); 1615 sharpFormat->save(calendar);
1602#endif 1616#endif
1603 if ( phoneFormat ) 1617 if ( phoneFormat )
1604 phoneFormat->save(calendar); 1618 phoneFormat->save(calendar);
1605 iL = calendar->rawIncidences(); 1619 iL = calendar->rawIncidences();
1606 inc = iL.first(); 1620 inc = iL.first();
1607 Incidence* loc; 1621 Incidence* loc;
1608 while ( inc ) { 1622 while ( inc ) {
1609 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { 1623 if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) {
1610 loc = mCalendar->incidence(inc->uid() ); 1624 loc = mCalendar->incidence(inc->uid() );
1611 if ( loc ) { 1625 if ( loc ) {
1612 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); 1626 loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) );
1613 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); 1627 loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) );
1614 } 1628 }
1615 } 1629 }
1616 inc = iL.next(); 1630 inc = iL.next();
1617 } 1631 }
1618 Incidence* lse = getLastSyncEvent(); 1632 Incidence* lse = getLastSyncEvent();
1619 if ( lse ) { 1633 if ( lse ) {
1620 lse->setReadOnly( false ); 1634 lse->setReadOnly( false );
1621 lse->setDescription( "" ); 1635 lse->setDescription( "" );
1622 lse->setReadOnly( true ); 1636 lse->setReadOnly( true );
1623 } 1637 }
1624 } 1638 }
1625 } else { 1639 } else {
1626 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); 1640 topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
1627 } 1641 }
1628 setModified( true ); 1642 setModified( true );
1629 } else { 1643 } else {
1630 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; 1644 QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ;
1631 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), 1645 QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"),
1632 question, i18n("Ok")) ; 1646 question, i18n("Ok")) ;
1633 1647
1634 } 1648 }
1635 delete calendar; 1649 delete calendar;
1636 updateView(); 1650 updateView();
1637 emit tempDisableBR(false); 1651 emit tempDisableBR(false);
1638 return ;//syncOK; 1652 return ;//syncOK;
1639 1653
1640} 1654}
1641 1655
1642bool CalendarView::importBday() 1656bool CalendarView::importBday()
1643{ 1657{
1644#ifndef KORG_NOKABC 1658#ifndef KORG_NOKABC
1645 1659
1646#ifdef DESKTOP_VERSION 1660#ifdef DESKTOP_VERSION
1647 int curCal = mCalendar->defaultCalendar(); 1661 int curCal = mCalendar->defaultCalendar();
1648 int bd = mCalEditView->getBirtdayID(); 1662 int bd = mCalEditView->getBirtdayID();
1649 if ( bd == 0 ) 1663 if ( bd == 0 )
1650 return false; 1664 return false;
1651 mCalendar->setDefaultCalendar( bd ); 1665 mCalendar->setDefaultCalendar( bd );
1652 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); 1666 KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true );
1653 KABC::AddressBook::Iterator it; 1667 KABC::AddressBook::Iterator it;
1654 int count = 0; 1668 int count = 0;
1655 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1669 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1656 ++count; 1670 ++count;
1657 } 1671 }
1658 QProgressBar bar(count,0 ); 1672 QProgressBar bar(count,0 );
1659 int w = 300; 1673 int w = 300;
1660 if ( QApplication::desktop()->width() < 320 ) 1674 if ( QApplication::desktop()->width() < 320 )
1661 w = 220; 1675 w = 220;
1662 int h = bar.sizeHint().height() ; 1676 int h = bar.sizeHint().height() ;
1663 int dw = QApplication::desktop()->width(); 1677 int dw = QApplication::desktop()->width();
1664 int dh = QApplication::desktop()->height(); 1678 int dh = QApplication::desktop()->height();
1665 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1679 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1666 bar.show(); 1680 bar.show();
1667 bar.setCaption (i18n("Reading addressbook - close to abort!") ); 1681 bar.setCaption (i18n("Reading addressbook - close to abort!") );
1668 qApp->processEvents(); 1682 qApp->processEvents();
1669 count = 0; 1683 count = 0;
1670 int addCount = 0; 1684 int addCount = 0;
1671 KCal::Attendee* a = 0; 1685 KCal::Attendee* a = 0;
1672 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { 1686 for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) {
1673 if ( ! bar.isVisible() ) 1687 if ( ! bar.isVisible() )
1674 return false; 1688 return false;
1675 bar.setProgress( count++ ); 1689 bar.setProgress( count++ );
1676 qApp->processEvents(); 1690 qApp->processEvents();
1677 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); 1691 //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() );
1678 if ( (*it).birthday().date().isValid() ){ 1692 if ( (*it).birthday().date().isValid() ){
1679 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1693 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1680 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) 1694 if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) )
1681 ++addCount; 1695 ++addCount;
1682 } 1696 }
1683 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); 1697 QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d");
1684 if ( anni.isValid() ){ 1698 if ( anni.isValid() ){
1685 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; 1699 a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ;
1686 if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) 1700 if ( addAnniversary( anni, (*it).assembledName(), a, false ) )
1687 ++addCount; 1701 ++addCount;
1688 } 1702 }
1689 } 1703 }
1690 mCalendar->setDefaultCalendar( curCal ); 1704 mCalendar->setDefaultCalendar( curCal );
1691 updateView(); 1705 updateView();
1692 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1706 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1693#else //DESKTOP_VERSION 1707#else //DESKTOP_VERSION
1694 1708
1695 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 1709 ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
1696 // the result should now arrive through method insertBirthdays 1710 // the result should now arrive through method insertBirthdays
1697 1711
1698#endif //DESKTOP_VERSION 1712#endif //DESKTOP_VERSION
1699 1713
1700#endif //KORG_NOKABC 1714#endif //KORG_NOKABC
1701 1715
1702 1716
1703 return true; 1717 return true;
1704} 1718}
1705 1719
1706// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI 1720// This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI
1707void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, 1721void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList,
1708 const QStringList& anniversaryList, const QStringList& realNameList, 1722 const QStringList& anniversaryList, const QStringList& realNameList,
1709 const QStringList& emailList, const QStringList& assembledNameList, 1723 const QStringList& emailList, const QStringList& assembledNameList,
1710 const QStringList& uidList) 1724 const QStringList& uidList)
1711{ 1725{
1712 1726
1713 //qDebug("KO::CalendarView::insertBirthdays"); 1727 //qDebug("KO::CalendarView::insertBirthdays");
1714 if (uid == this->name()) 1728 if (uid == this->name())
1715 { 1729 {
1716 int curCal = mCalendar->defaultCalendar(); 1730 int curCal = mCalendar->defaultCalendar();
1717 int bd = mCalEditView->getBirtdayID(); 1731 int bd = mCalEditView->getBirtdayID();
1718 if ( bd == 0 ) 1732 if ( bd == 0 )
1719 return; 1733 return;
1720 mCalendar->setDefaultCalendar( bd ); 1734 mCalendar->setDefaultCalendar( bd );
1721 1735
1722 1736
1723 int count = birthdayList.count(); 1737 int count = birthdayList.count();
1724 int addCount = 0; 1738 int addCount = 0;
1725 KCal::Attendee* a = 0; 1739 KCal::Attendee* a = 0;
1726 1740
1727 //qDebug("CalView 1 %i", count); 1741 //qDebug("CalView 1 %i", count);
1728 1742
1729 QProgressBar bar(count,0 ); 1743 QProgressBar bar(count,0 );
1730 int w = 300; 1744 int w = 300;
1731 if ( QApplication::desktop()->width() < 320 ) 1745 if ( QApplication::desktop()->width() < 320 )
1732 w = 220; 1746 w = 220;
1733 int h = bar.sizeHint().height() ; 1747 int h = bar.sizeHint().height() ;
1734 int dw = QApplication::desktop()->width(); 1748 int dw = QApplication::desktop()->width();
1735 int dh = QApplication::desktop()->height(); 1749 int dh = QApplication::desktop()->height();
1736 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 1750 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
1737 bar.show(); 1751 bar.show();
1738 bar.setCaption (i18n("inserting birthdays - close to abort!") ); 1752 bar.setCaption (i18n("inserting birthdays - close to abort!") );
1739 qApp->processEvents(); 1753 qApp->processEvents();
1740 1754
1741 QDate birthday; 1755 QDate birthday;
1742 QDate anniversary; 1756 QDate anniversary;
1743 QString realName; 1757 QString realName;
1744 QString email; 1758 QString email;
1745 QString assembledName; 1759 QString assembledName;
1746 QString uid; 1760 QString uid;
1747 bool ok = true; 1761 bool ok = true;
1748 for ( int i = 0; i < count; i++) 1762 for ( int i = 0; i < count; i++)
1749 { 1763 {
1750 if ( ! bar.isVisible() ) 1764 if ( ! bar.isVisible() )
1751 return; 1765 return;
1752 bar.setProgress( i ); 1766 bar.setProgress( i );
1753 qApp->processEvents(); 1767 qApp->processEvents();
1754 1768
1755 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); 1769 birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok);
1756 if (!ok) { 1770 if (!ok) {
1757 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); 1771 ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1());
1758 } 1772 }
1759 1773
1760 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); 1774 anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok);
1761 if (!ok) { 1775 if (!ok) {
1762 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); 1776 ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1());
1763 } 1777 }
1764 realName = realNameList[i]; 1778 realName = realNameList[i];
1765 email = emailList[i]; 1779 email = emailList[i];
1766 assembledName = assembledNameList[i]; 1780 assembledName = assembledNameList[i];
1767 uid = uidList[i]; 1781 uid = uidList[i];
1768 //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() ); 1782 //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() );
1769 1783
1770 if ( birthday.isValid() ){ 1784 if ( birthday.isValid() ){
1771 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1785 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1772 KCal::Attendee::ReqParticipant,uid) ; 1786 KCal::Attendee::ReqParticipant,uid) ;
1773 if ( addAnniversary( birthday, assembledName, a, true ) ) 1787 if ( addAnniversary( birthday, assembledName, a, true ) )
1774 ++addCount; 1788 ++addCount;
1775 } 1789 }
1776 1790
1777 if ( anniversary.isValid() ){ 1791 if ( anniversary.isValid() ){
1778 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, 1792 a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction,
1779 KCal::Attendee::ReqParticipant,uid) ; 1793 KCal::Attendee::ReqParticipant,uid) ;
1780 if ( addAnniversary( anniversary, assembledName, a, false ) ) 1794 if ( addAnniversary( anniversary, assembledName, a, false ) )
1781 ++addCount; 1795 ++addCount;
1782 } 1796 }
1783 } 1797 }
1784 1798
1785 mCalendar->setDefaultCalendar( curCal ); 1799 mCalendar->setDefaultCalendar( curCal );
1786 updateView(); 1800 updateView();
1787 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); 1801 topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!"));
1788 1802
1789 } 1803 }
1790 1804
1791} 1805}
1792 1806
1793 1807
1794 1808
1795bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) 1809bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday)
1796{ 1810{
1797 //qDebug("addAnni "); 1811 //qDebug("addAnni ");
1798 Event * ev = new Event(); 1812 Event * ev = new Event();
1799 ev->setOrganizer(KOPrefs::instance()->email()); 1813 ev->setOrganizer(KOPrefs::instance()->email());
1800 if ( a ) { 1814 if ( a ) {
1801 ev->addAttendee( a ); 1815 ev->addAttendee( a );
1802 } 1816 }
1803 QString kind; 1817 QString kind;
1804 if ( birthday ) { 1818 if ( birthday ) {
1805 kind = i18n( "Birthday" ); 1819 kind = i18n( "Birthday" );
1806 ev->setSummary( name + " (" + QString::number(date.year()) +")"); 1820 ev->setSummary( name + " (" + QString::number(date.year()) +")");
1807 } 1821 }
1808 else { 1822 else {
1809 kind = i18n( "Anniversary" ); 1823 kind = i18n( "Anniversary" );
1810 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); 1824 ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind );
1811 } 1825 }
1812 ev->setCategories( kind ); 1826 ev->setCategories( kind );
1813 ev->setDtStart( QDateTime(date) ); 1827 ev->setDtStart( QDateTime(date) );
1814 ev->setDtEnd( QDateTime(date) ); 1828 ev->setDtEnd( QDateTime(date) );
1815 ev->setFloats( true ); 1829 ev->setFloats( true );
1816 Recurrence * rec = ev->recurrence(); 1830 Recurrence * rec = ev->recurrence();
1817 rec->setYearly(Recurrence::rYearlyMonth,1,-1); 1831 rec->setYearly(Recurrence::rYearlyMonth,1,-1);
1818 rec->addYearlyNum( date.month() ); 1832 rec->addYearlyNum( date.month() );
1819 if ( !mCalendar->addAnniversaryNoDup( ev ) ) { 1833 if ( !mCalendar->addAnniversaryNoDup( ev ) ) {
1820 delete ev; 1834 delete ev;
1821 return false; 1835 return false;
1822 } 1836 }
1823 return true; 1837 return true;
1824 1838
1825} 1839}
1826bool CalendarView::importQtopia( const QString &categories, 1840bool CalendarView::importQtopia( const QString &categories,
1827 const QString &datebook, 1841 const QString &datebook,
1828 const QString &todolist ) 1842 const QString &todolist )
1829{ 1843{
1830 1844
1831 QtopiaFormat qtopiaFormat; 1845 QtopiaFormat qtopiaFormat;
1832 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1846 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1833 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); 1847 if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories );
1834 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); 1848 if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook );
1835 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); 1849 if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist );
1836 1850
1837 updateView(); 1851 updateView();
1838 return true; 1852 return true;
1839 1853
1840#if 0 1854#if 0
1841 mGlobalSyncMode = SYNC_MODE_QTOPIA; 1855 mGlobalSyncMode = SYNC_MODE_QTOPIA;
1842 mCurrentSyncDevice = "qtopia-XML"; 1856 mCurrentSyncDevice = "qtopia-XML";
1843 if ( mSyncManager->mAskForPreferences ) 1857 if ( mSyncManager->mAskForPreferences )
1844 edit_sync_options(); 1858 edit_sync_options();
1845 qApp->processEvents(); 1859 qApp->processEvents();
1846 CalendarLocal* calendar = new CalendarLocal(); 1860 CalendarLocal* calendar = new CalendarLocal();
1847 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 1861 calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
1848 bool syncOK = false; 1862 bool syncOK = false;
1849 QtopiaFormat qtopiaFormat; 1863 QtopiaFormat qtopiaFormat;
1850 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); 1864 qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories));
1851 bool loadOk = true; 1865 bool loadOk = true;
1852 if ( !categories.isEmpty() ) 1866 if ( !categories.isEmpty() )
1853 loadOk = qtopiaFormat.load( calendar, categories ); 1867 loadOk = qtopiaFormat.load( calendar, categories );
1854 if ( loadOk && !datebook.isEmpty() ) 1868 if ( loadOk && !datebook.isEmpty() )
1855 loadOk = qtopiaFormat.load( calendar, datebook ); 1869 loadOk = qtopiaFormat.load( calendar, datebook );
1856 if ( loadOk && !todolist.isEmpty() ) 1870 if ( loadOk && !todolist.isEmpty() )
1857 loadOk = qtopiaFormat.load( calendar, todolist ); 1871 loadOk = qtopiaFormat.load( calendar, todolist );
1858 1872
1859 if ( loadOk ) { 1873 if ( loadOk ) {
1860 getEventViewerDialog()->setSyncMode( true ); 1874 getEventViewerDialog()->setSyncMode( true );
1861 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); 1875 syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs );
1862 getEventViewerDialog()->setSyncMode( false ); 1876 getEventViewerDialog()->setSyncMode( false );
1863 qApp->processEvents(); 1877 qApp->processEvents();
1864 if ( syncOK ) { 1878 if ( syncOK ) {
1865 if ( mSyncManager->mWriteBackFile ) 1879 if ( mSyncManager->mWriteBackFile )
1866 { 1880 {
1867 // write back XML file 1881 // write back XML file
1868 1882
1869 } 1883 }
1870 setModified( true ); 1884 setModified( true );
1871 } 1885 }
1872 } else { 1886 } else {
1873 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; 1887 QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ;
1874 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), 1888 QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"),
1875 question, i18n("Ok")) ; 1889 question, i18n("Ok")) ;
1876 } 1890 }
1877 delete calendar; 1891 delete calendar;
1878 updateView(); 1892 updateView();
1879 return syncOK; 1893 return syncOK;
1880 1894
1881 1895
1882#endif 1896#endif
1883 1897
1884} 1898}
1885 1899
1886void CalendarView::setSyncEventsReadOnly() 1900void CalendarView::setSyncEventsReadOnly()
1887{ 1901{
1888 mCalendar->setSyncEventsReadOnly(); 1902 mCalendar->setSyncEventsReadOnly();
1889} 1903}
1890 1904
1891bool CalendarView::loadCalendars() 1905bool CalendarView::loadCalendars()
1892{ 1906{
1893 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1907 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1894 KopiCalendarFile * cal = calendars.first(); 1908 KopiCalendarFile * cal = calendars.first();
1895 mCalendar->setDefaultCalendar( 1 ); 1909 mCalendar->setDefaultCalendar( 1 );
1896 openCalendar( MainWindow::defaultFileName(), false ); 1910 openCalendar( MainWindow::defaultFileName(), false );
1897 cal = calendars.next(); 1911 cal = calendars.next();
1898 while ( cal ) { 1912 while ( cal ) {
1899 addCalendar( cal ); 1913 addCalendar( cal );
1900 cal = calendars.next(); 1914 cal = calendars.next();
1901 } 1915 }
1902 restoreCalendarSettings(); 1916 restoreCalendarSettings();
1903 return true; 1917 return true;
1904} 1918}
1905bool CalendarView::restoreCalendarSettings() 1919bool CalendarView::restoreCalendarSettings()
1906{ 1920{
1907 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 1921 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
1908 KopiCalendarFile * cal = calendars.first(); 1922 KopiCalendarFile * cal = calendars.first();
1909 while ( cal ) { 1923 while ( cal ) {
1910 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled ); 1924 mCalendar->setCalendarEnabled( cal->mCalNumber,cal->isEnabled );
1911 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled ); 1925 mCalendar->setAlarmEnabled( cal->mCalNumber, cal->isAlarmEnabled );
1912 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly ); 1926 mCalendar->setReadOnly( cal->mCalNumber, cal->isReadOnly );
1913 if ( cal->isStandard ) 1927 if ( cal->isStandard )
1914 mCalendar->setDefaultCalendar( cal->mCalNumber ); 1928 mCalendar->setDefaultCalendar( cal->mCalNumber );
1915 cal = calendars.next(); 1929 cal = calendars.next();
1916 } 1930 }
1917 setSyncEventsReadOnly(); 1931 setSyncEventsReadOnly();
1918 mCalendar->reInitAlarmSettings(); 1932 mCalendar->reInitAlarmSettings();
1919 updateUnmanagedViews(); 1933 updateUnmanagedViews();
1920 updateView(); 1934 updateView();
1921 return true; 1935 return true;
1922} 1936}
1923void CalendarView::addCalendarId( int id ) 1937void CalendarView::addCalendarId( int id )
1924{ 1938{
1925 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id ); 1939 KopiCalendarFile * cal = KOPrefs::instance()->getCalendar( id );
1926 addCalendar( cal ); 1940 if ( cal )
1941 addCalendar( cal );
1927} 1942}
1928bool CalendarView::addCalendar( KopiCalendarFile * cal ) 1943bool CalendarView::addCalendar( KopiCalendarFile * cal )
1929{ 1944{
1930 cal->mErrorOnLoad = false; 1945 cal->mErrorOnLoad = false;
1931 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) { 1946 if ( mCalendar->addCalendarFile( cal->mFileName, cal->mCalNumber )) {
1932 cal->mLoadDt = QDateTime::currentDateTime(); 1947 cal->mLoadDt = QDateTime::currentDateTime();
1933 return true; 1948 return true;
1934 } 1949 }
1935 qDebug("KO: Error adding calendar file %1 ",cal->mFileName.latin1() ); 1950 qDebug("KO: Error adding calendar file %s ",cal->mFileName.latin1() );
1936 KMessageBox::error(this,i18n("Error loading calendar file\n%1.").arg(cal->mFileName));
1937 cal->mErrorOnLoad = true; 1951 cal->mErrorOnLoad = true;
1938 return false; 1952 return false;
1939} 1953}
1940bool CalendarView::openCalendar(QString filename, bool merge) 1954bool CalendarView::openCalendar(QString filename, bool merge)
1941{ 1955{
1942 1956
1943 if (filename.isEmpty()) { 1957 if (filename.isEmpty()) {
1944 return false; 1958 return false;
1945 } 1959 }
1946 1960
1947 if (!QFile::exists(filename)) { 1961 if (!QFile::exists(filename)) {
1948 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); 1962 KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename));
1949 return false; 1963 return false;
1950 } 1964 }
1951 1965
1952 globalFlagBlockAgenda = 1; 1966 globalFlagBlockAgenda = 1;
1953 clearAllViews(); 1967 clearAllViews();
1954 if (!merge) { 1968 if (!merge) {
1955 mViewManager->setDocumentId( filename ); 1969 mViewManager->setDocumentId( filename );
1956 mCalendar->close(); 1970 mCalendar->close();
1957 } 1971 }
1958 mStorage->setFileName( filename ); 1972 mStorage->setFileName( filename );
1959 1973
1960 if ( mStorage->load() ) { 1974 if ( mStorage->load() ) {
1961 if ( merge ) ;//setModified( true ); 1975 if ( merge ) ;//setModified( true );
1962 else { 1976 else {
1963 //setModified( true ); 1977 //setModified( true );
1964 mViewManager->setDocumentId( filename ); 1978 mViewManager->setDocumentId( filename );
1965 mDialogManager->setDocumentId( filename ); 1979 mDialogManager->setDocumentId( filename );
1966 mTodoList->setDocumentId( filename ); 1980 mTodoList->setDocumentId( filename );
1967 } 1981 }
1968 globalFlagBlockAgenda = 2; 1982 globalFlagBlockAgenda = 2;
1969 // if ( getLastSyncEvent() ) 1983 // if ( getLastSyncEvent() )
1970 // getLastSyncEvent()->setReadOnly( true ); 1984 // getLastSyncEvent()->setReadOnly( true );
1971 mCalendar->reInitAlarmSettings(); 1985 mCalendar->reInitAlarmSettings();
1972 setSyncEventsReadOnly(); 1986 setSyncEventsReadOnly();
1973 updateUnmanagedViews(); 1987 updateUnmanagedViews();
1974 updateView(); 1988 updateView();
1975 if ( filename != MainWindow::defaultFileName() ) { 1989 if ( filename != MainWindow::defaultFileName() ) {
1976 saveCalendar( MainWindow::defaultFileName() ); 1990 saveCalendar( MainWindow::defaultFileName() );
1977 } else { 1991 } else {
1978 QFileInfo finf ( MainWindow::defaultFileName()); 1992 QFileInfo finf ( MainWindow::defaultFileName());
1979 if ( finf.exists() ) { 1993 if ( finf.exists() ) {
1980 setLoadedFileVersion( finf.lastModified () ); 1994 setLoadedFileVersion( finf.lastModified () );
1981 } 1995 }
1982 } 1996 }
1983 return true; 1997 return true;
1984 } else { 1998 } else {
1985 // while failing to load, the calendar object could 1999 // while failing to load, the calendar object could
1986 // have become partially populated. Clear it out. 2000 // have become partially populated. Clear it out.
1987 if ( !merge ) { 2001 if ( !merge ) {
1988 mCalendar->close(); 2002 mCalendar->close();
1989 mViewManager->setDocumentId( filename ); 2003 mViewManager->setDocumentId( filename );
1990 mDialogManager->setDocumentId( filename ); 2004 mDialogManager->setDocumentId( filename );
1991 mTodoList->setDocumentId( filename ); 2005 mTodoList->setDocumentId( filename );
1992 } 2006 }
1993 2007
1994 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); 2008 //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename));
1995 2009
1996 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); 2010 QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) );
1997 globalFlagBlockAgenda = 2; 2011 globalFlagBlockAgenda = 2;
1998 mCalendar->reInitAlarmSettings(); 2012 mCalendar->reInitAlarmSettings();
1999 setSyncEventsReadOnly(); 2013 setSyncEventsReadOnly();
2000 updateUnmanagedViews(); 2014 updateUnmanagedViews();
2001 updateView(); 2015 updateView();
2002 } 2016 }
2003 return false; 2017 return false;
2004} 2018}
2005void CalendarView::showOpenError() 2019void CalendarView::showOpenError()
2006{ 2020{
2007 KMessageBox::error(this,i18n("Couldn't load calendar\n.")); 2021 KMessageBox::error(this,i18n("Couldn't load calendar\n."));
2008} 2022}
2009void CalendarView::setLoadedFileVersion(QDateTime dt) 2023void CalendarView::setLoadedFileVersion(QDateTime dt)
2010{ 2024{
2011 loadedFileVersion = dt; 2025 loadedFileVersion = dt;
2012} 2026}
2013bool CalendarView::checkFileChanged(QString fn) 2027bool CalendarView::checkFileChanged(QString fn)
2014{ 2028{
2015 QFileInfo finf ( fn ); 2029 QFileInfo finf ( fn );
2016 if ( !finf.exists() ) 2030 if ( !finf.exists() )
2017 return true; 2031 return true;
2018 QDateTime dt = finf.lastModified (); 2032 QDateTime dt = finf.lastModified ();
2019 if ( dt <= loadedFileVersion ) 2033 if ( dt <= loadedFileVersion )
2020 return false; 2034 return false;
2021 return true; 2035 return true;
2022 2036
2023} 2037}
2024void CalendarView::watchSavedFile() 2038void CalendarView::watchSavedFile()
2025{ 2039{
2026 QFileInfo finf ( MainWindow::defaultFileName()); 2040 QFileInfo finf ( MainWindow::defaultFileName());
2027 if ( !finf.exists() ) 2041 if ( !finf.exists() )
2028 return; 2042 return;
2029 QDateTime dt = finf.lastModified (); 2043 QDateTime dt = finf.lastModified ();
2030 if ( dt < loadedFileVersion ) { 2044 if ( dt < loadedFileVersion ) {
2031 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); 2045 //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1());
2032 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); 2046 QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) );
2033 return; 2047 return;
2034 } 2048 }
2035 loadedFileVersion = dt; 2049 loadedFileVersion = dt;
2036} 2050}
2037bool CalendarView::checkAllFileVersions() 2051bool CalendarView::checkAllFileVersions()
2038{ 2052{
2039 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2053 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2040 KopiCalendarFile * cal = calendars.first(); 2054 KopiCalendarFile * cal = calendars.first();
2041 mCalendar->setDefaultCalendar( 1 ); 2055 mCalendar->setDefaultCalendar( 1 );
2042 mCalendar->setDefaultCalendarEnabledOnly(); 2056 mCalendar->setDefaultCalendarEnabledOnly();
2043 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2057 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2044 if ( !checkFileVersion(MainWindow::defaultFileName())) { 2058 if ( !checkFileVersion(MainWindow::defaultFileName())) {
2045 restoreCalendarSettings(); 2059 restoreCalendarSettings();
2046 return false; 2060 return false;
2047 } 2061 }
2048 } 2062 }
2049 cal = calendars.next(); 2063 cal = calendars.next();
2050 QDateTime storeTemp = loadedFileVersion; 2064 QDateTime storeTemp = loadedFileVersion;
2051 while ( cal ) { 2065 while ( cal ) {
2052 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2066 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2053 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2067 mCalendar->setDefaultCalendar( cal->mCalNumber );
2054 mCalendar->setDefaultCalendarEnabledOnly(); 2068 mCalendar->setDefaultCalendarEnabledOnly();
2055 loadedFileVersion = cal->mLoadDt.addSecs( 15 ); 2069 loadedFileVersion = cal->mLoadDt.addSecs( 15 );
2056 if ( !checkFileVersion(cal->mFileName )) { 2070 if ( !checkFileVersion(cal->mFileName )) {
2057 loadedFileVersion = storeTemp; 2071 loadedFileVersion = storeTemp;
2058 restoreCalendarSettings(); 2072 restoreCalendarSettings();
2059 return false; 2073 return false;
2060 } 2074 }
2061 } 2075 }
2062 cal = calendars.next(); 2076 cal = calendars.next();
2063 } 2077 }
2064 loadedFileVersion = storeTemp; 2078 loadedFileVersion = storeTemp;
2065 return true; 2079 return true;
2066} 2080}
2067bool CalendarView::checkFileVersion(QString fn) 2081bool CalendarView::checkFileVersion(QString fn)
2068{ 2082{
2069 QFileInfo finf ( fn ); 2083 QFileInfo finf ( fn );
2070 if ( !finf.exists() ) 2084 if ( !finf.exists() )
2071 return true; 2085 return true;
2072 QDateTime dt = finf.lastModified (); 2086 QDateTime dt = finf.lastModified ();
2073 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1()); 2087 qDebug("loaded file version %s %s", fn.latin1(), loadedFileVersion.toString().latin1());
2074 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1()); 2088 qDebug("file on disk version %s %s", fn.latin1(),dt.toString().latin1());
2075 if ( dt <= loadedFileVersion ) 2089 if ( dt <= loadedFileVersion )
2076 return true; 2090 return true;
2077 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\n on 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(fn).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , 2091 int km = KMessageBox::warningYesNoCancel(this, i18n("\nThe file\n%1\n on 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(fn).arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) ,
2078 i18n("KO/Pi Warning"),i18n("Overwrite"), 2092 i18n("KO/Pi Warning"),i18n("Overwrite"),
2079 i18n("Sync+save")); 2093 i18n("Sync+save"));
2080 2094
2081 if ( km == KMessageBox::Cancel ) 2095 if ( km == KMessageBox::Cancel )
2082 return false; 2096 return false;
2083 if ( km == KMessageBox::Yes ) 2097 if ( km == KMessageBox::Yes )
2084 return true; 2098 return true;
2085 2099
2086 setSyncDevice("deleteaftersync" ); 2100 setSyncDevice("deleteaftersync" );
2087 mSyncManager->mAskForPreferences = true; 2101 mSyncManager->mAskForPreferences = true;
2088 mSyncManager->mSyncAlgoPrefs = 3; 2102 mSyncManager->mSyncAlgoPrefs = 3;
2089 mSyncManager->mWriteBackFile = false; 2103 mSyncManager->mWriteBackFile = false;
2090 mSyncManager->mWriteBackExistingOnly = false; 2104 mSyncManager->mWriteBackExistingOnly = false;
2091 mSyncManager->mShowSyncSummary = false; 2105 mSyncManager->mShowSyncSummary = false;
2092 syncCalendar( fn, 3 ); 2106 syncCalendar( fn, 3 );
2093 Event * e = getLastSyncEvent(); 2107 Event * e = getLastSyncEvent();
2094 if ( e ) 2108 if ( e )
2095 mCalendar->deleteEvent( e ); 2109 mCalendar->deleteEvent( e );
2096 return true; 2110 return true;
2097} 2111}
2098bool CalendarView::saveCalendars() 2112bool CalendarView::saveCalendars()
2099{ 2113{
2100 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 2114 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
2101 KopiCalendarFile * cal = calendars.first(); 2115 KopiCalendarFile * cal = calendars.first();
2102 mCalendar->setDefaultCalendar( 1 ); 2116 mCalendar->setDefaultCalendar( 1 );
2103 mCalendar->setDefaultCalendarEnabledOnly(); 2117 mCalendar->setDefaultCalendarEnabledOnly();
2104 saveCalendar( MainWindow::defaultFileName() ); 2118 saveCalendar( MainWindow::defaultFileName() );
2105 cal = calendars.next(); 2119 cal = calendars.next();
2106 while ( cal ) { 2120 while ( cal ) {
2107 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) { 2121 if ( !cal->isReadOnly && !cal->mErrorOnLoad ) {
2108 mCalendar->setDefaultCalendar( cal->mCalNumber ); 2122 mCalendar->setDefaultCalendar( cal->mCalNumber );
2109 mCalendar->setDefaultCalendarEnabledOnly(); 2123 mCalendar->setDefaultCalendarEnabledOnly();
2110 if ( saveCalendar( cal->mFileName ) ) 2124 if ( saveCalendar( cal->mFileName ) )
2111 cal->mLoadDt = QDateTime::currentDateTime(); 2125 cal->mLoadDt = QDateTime::currentDateTime();
2112 } 2126 }
2113 cal = calendars.next(); 2127 cal = calendars.next();
2114 } 2128 }
2115 restoreCalendarSettings(); 2129 restoreCalendarSettings();
2116 return true; 2130 return true;
2117} 2131}
2118bool CalendarView::saveCalendar( QString filename ) 2132bool CalendarView::saveCalendar( QString filename )
2119{ 2133{
2120 2134
2121 // Store back all unsaved data into calendar object 2135 // Store back all unsaved data into calendar object
2122 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); 2136 // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() );
2123 if ( mViewManager->currentView() ) 2137 if ( mViewManager->currentView() )
2124 mViewManager->currentView()->flushView(); 2138 mViewManager->currentView()->flushView();
2125 2139
2126 2140
2127 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); 2141 QDateTime lfv = QDateTime::currentDateTime().addSecs( -2);
2128 mStorage->setSaveFormat( new ICalFormat() ); 2142 mStorage->setSaveFormat( new ICalFormat() );
2129 mStorage->setFileName( filename ); 2143 mStorage->setFileName( filename );
2130 bool success; 2144 bool success;
2131 success = mStorage->save(); 2145 success = mStorage->save();
2132 if ( !success ) { 2146 if ( !success ) {
2133 return false; 2147 return false;
2134 } 2148 }
2135 if ( filename == MainWindow::defaultFileName() ) { 2149 if ( filename == MainWindow::defaultFileName() ) {
2136 setLoadedFileVersion( lfv ); 2150 setLoadedFileVersion( lfv );
2137 watchSavedFile(); 2151 watchSavedFile();
2138 } 2152 }
2139 return true; 2153 return true;
2140} 2154}
2141 2155
2142void CalendarView::closeCalendar() 2156void CalendarView::closeCalendar()
2143{ 2157{
2144 2158
2145 // child windows no longer valid 2159 // child windows no longer valid
2146 clearAllViews(); 2160 clearAllViews();
2147 emit closingDown(); 2161 emit closingDown();
2148 2162
2149 mCalendar->close(); 2163 mCalendar->close();
2150 setModified(false); 2164 setModified(false);
2151 updateView(); 2165 updateView();
2152} 2166}
2153 2167
2154void CalendarView::archiveCalendar() 2168void CalendarView::archiveCalendar()
2155{ 2169{
2156 mDialogManager->showArchiveDialog(); 2170 mDialogManager->showArchiveDialog();
2157} 2171}
2158 2172
2159 2173
2160void CalendarView::readSettings() 2174void CalendarView::readSettings()
2161{ 2175{
2162 2176
2163 2177
2164 // mViewManager->showAgendaView(); 2178 // mViewManager->showAgendaView();
2165 QString str; 2179 QString str;
2166 //qDebug("CalendarView::readSettings() "); 2180 //qDebug("CalendarView::readSettings() ");
2167 // read settings from the KConfig, supplying reasonable 2181 // read settings from the KConfig, supplying reasonable
2168 // defaults where none are to be found 2182 // defaults where none are to be found
2169 KConfig *config = KOGlobals::config(); 2183 KConfig *config = KOGlobals::config();
2170#ifndef KORG_NOSPLITTER 2184#ifndef KORG_NOSPLITTER
2171 config->setGroup("KOrganizer Geometry"); 2185 config->setGroup("KOrganizer Geometry");
2172 2186
2173 QValueList<int> sizes = config->readIntListEntry("Separator1"); 2187 QValueList<int> sizes = config->readIntListEntry("Separator1");
2174 if (sizes.count() != 2) { 2188 if (sizes.count() != 2) {
2175 sizes << mDateNavigator->minimumSizeHint().width(); 2189 sizes << mDateNavigator->minimumSizeHint().width();
2176 sizes << 300; 2190 sizes << 300;
2177 } 2191 }
2178 mPanner->setSizes(sizes); 2192 mPanner->setSizes(sizes);
2179 2193
2180 sizes = config->readIntListEntry("Separator2"); 2194 sizes = config->readIntListEntry("Separator2");
2181 if ( ( mResourceView && sizes.count() == 4 ) || 2195 if ( ( mResourceView && sizes.count() == 4 ) ||
2182 ( !mResourceView && sizes.count() == 3 ) ) { 2196 ( !mResourceView && sizes.count() == 3 ) ) {
2183 mLeftSplitter->setSizes(sizes); 2197 mLeftSplitter->setSizes(sizes);
2184 } 2198 }
2185#endif 2199#endif
2186 globalFlagBlockAgenda = 1; 2200 globalFlagBlockAgenda = 1;
2187 mViewManager->showAgendaView(); 2201 mViewManager->showAgendaView();
2188 //mViewManager->readSettings( config ); 2202 //mViewManager->readSettings( config );
2189 mTodoList->restoreLayout(config,QString("Todo Layout")); 2203 mTodoList->restoreLayout(config,QString("Todo Layout"));
2190 readFilterSettings(config); 2204 readFilterSettings(config);
2191 2205
2192#ifdef DESKTOP_VERSION 2206#ifdef DESKTOP_VERSION
2193 config->setGroup("WidgetLayout"); 2207 config->setGroup("WidgetLayout");
2194 QStringList list; 2208 QStringList list;
2195 list = config->readListEntry("MainLayout"); 2209 list = config->readListEntry("MainLayout");
2196 int x,y,w,h; 2210 int x,y,w,h;
2197 if ( ! list.isEmpty() ) { 2211 if ( ! list.isEmpty() ) {
2198 x = list[0].toInt(); 2212 x = list[0].toInt();
2199 y = list[1].toInt(); 2213 y = list[1].toInt();
2200 w = list[2].toInt(); 2214 w = list[2].toInt();
2201 h = list[3].toInt(); 2215 h = list[3].toInt();
2202 KApplication::testCoords( &x,&y,&w,&h ); 2216 KApplication::testCoords( &x,&y,&w,&h );
2203 topLevelWidget()->setGeometry(x,y,w,h); 2217 topLevelWidget()->setGeometry(x,y,w,h);
2204 2218
2205 } else { 2219 } else {
2206 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 2220 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
2207 } 2221 }
2208 list = config->readListEntry("EditEventLayout"); 2222 list = config->readListEntry("EditEventLayout");
2209 if ( ! list.isEmpty() ) { 2223 if ( ! list.isEmpty() ) {
2210 x = list[0].toInt(); 2224 x = list[0].toInt();
2211 y = list[1].toInt(); 2225 y = list[1].toInt();
2212 w = list[2].toInt(); 2226 w = list[2].toInt();
2213 h = list[3].toInt(); 2227 h = list[3].toInt();
2214 KApplication::testCoords( &x,&y,&w,&h ); 2228 KApplication::testCoords( &x,&y,&w,&h );
2215 mEventEditor->setGeometry(x,y,w,h); 2229 mEventEditor->setGeometry(x,y,w,h);
2216 2230
2217 } 2231 }
2218 list = config->readListEntry("EditTodoLayout"); 2232 list = config->readListEntry("EditTodoLayout");
2219 if ( ! list.isEmpty() ) { 2233 if ( ! list.isEmpty() ) {
2220 x = list[0].toInt(); 2234 x = list[0].toInt();
2221 y = list[1].toInt(); 2235 y = list[1].toInt();
2222 w = list[2].toInt(); 2236 w = list[2].toInt();
2223 h = list[3].toInt(); 2237 h = list[3].toInt();
2224 KApplication::testCoords( &x,&y,&w,&h ); 2238 KApplication::testCoords( &x,&y,&w,&h );
2225 mTodoEditor->setGeometry(x,y,w,h); 2239 mTodoEditor->setGeometry(x,y,w,h);
2226 2240
2227 } 2241 }
2228 list = config->readListEntry("ViewerLayout"); 2242 list = config->readListEntry("ViewerLayout");
2229 if ( ! list.isEmpty() ) { 2243 if ( ! list.isEmpty() ) {
2230 x = list[0].toInt(); 2244 x = list[0].toInt();
2231 y = list[1].toInt(); 2245 y = list[1].toInt();
2232 w = list[2].toInt(); 2246 w = list[2].toInt();
2233 h = list[3].toInt(); 2247 h = list[3].toInt();
2234 KApplication::testCoords( &x,&y,&w,&h ); 2248 KApplication::testCoords( &x,&y,&w,&h );
2235 getEventViewerDialog()->setGeometry(x,y,w,h); 2249 getEventViewerDialog()->setGeometry(x,y,w,h);
2236 } 2250 }
2237#endif 2251#endif
2238 config->setGroup( "Views" ); 2252 config->setGroup( "Views" );
2239 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2253 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2240 2254
2241 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2255 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2242 2256
2243 int resetval = 0; 2257 int resetval = 0;
2244 int maxVal = 0; 2258 int maxVal = 0;
2245 if (sizes.count() != 3) { 2259 if (sizes.count() != 3) {
2246 if ( KOPrefs::instance()->mVerticalScreen ) { 2260 if ( KOPrefs::instance()->mVerticalScreen ) {
2247 resetval = mDateNavigator->sizeHint().width()+2; 2261 resetval = mDateNavigator->sizeHint().width()+2;
2248 } else { 2262 } else {
2249 resetval = mDateNavigator->sizeHint().height()+2; 2263 resetval = mDateNavigator->sizeHint().height()+2;
2250 } 2264 }
2251 } 2265 }
2252 if ( resetval ) { 2266 if ( resetval ) {
2253 sizes.clear(); 2267 sizes.clear();
2254 if ( KOPrefs::instance()->mVerticalScreen ) { 2268 if ( KOPrefs::instance()->mVerticalScreen ) {
2255 maxVal = QApplication::desktop()->width() -10; 2269 maxVal = QApplication::desktop()->width() -10;
2256 } else { 2270 } else {
2257 maxVal = QApplication::desktop()->height()-10; 2271 maxVal = QApplication::desktop()->height()-10;
2258 } 2272 }
2259 sizes << resetval; 2273 sizes << resetval;
2260 if ( maxVal < resetval + resetval) 2274 if ( maxVal < resetval + resetval)
2261 resetval = maxVal - resetval; 2275 resetval = maxVal - resetval;
2262 sizes << resetval; 2276 sizes << resetval;
2263 sizes << 100; 2277 sizes << 100;
2264 } 2278 }
2265 mLeftFrame->setSizes(sizes); 2279 mLeftFrame->setSizes(sizes);
2266 sizes = config->readIntListEntry("Main Splitter Frame"); 2280 sizes = config->readIntListEntry("Main Splitter Frame");
2267 resetval = 0; 2281 resetval = 0;
2268 maxVal = 0; 2282 maxVal = 0;
2269 if (sizes.count() != 2) { 2283 if (sizes.count() != 2) {
2270 if ( !KOPrefs::instance()->mVerticalScreen ) { 2284 if ( !KOPrefs::instance()->mVerticalScreen ) {
2271 resetval = mDateNavigator->sizeHint().width()+2; 2285 resetval = mDateNavigator->sizeHint().width()+2;
2272 } else { 2286 } else {
2273 resetval = mDateNavigator->sizeHint().height()+2; 2287 resetval = mDateNavigator->sizeHint().height()+2;
2274 } 2288 }
2275 } 2289 }
2276 if ( resetval ) { 2290 if ( resetval ) {
2277 sizes.clear(); 2291 sizes.clear();
2278 if ( !KOPrefs::instance()->mVerticalScreen ) { 2292 if ( !KOPrefs::instance()->mVerticalScreen ) {
2279 maxVal = QApplication::desktop()->width() -10; 2293 maxVal = QApplication::desktop()->width() -10;
2280 } else { 2294 } else {
2281 maxVal = QApplication::desktop()->height()-10; 2295 maxVal = QApplication::desktop()->height()-10;
2282 } 2296 }
2283 sizes << resetval; 2297 sizes << resetval;
2284 if ( maxVal < resetval + resetval) 2298 if ( maxVal < resetval + resetval)
2285 resetval = maxVal - resetval; 2299 resetval = maxVal - resetval;
2286 sizes << resetval; 2300 sizes << resetval;
2287 } 2301 }
2288 mMainFrame->setSizes(sizes); 2302 mMainFrame->setSizes(sizes);
2289 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2303 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2290 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2304 else if ( dateCount == 7 ) mNavigator->selectWeek();
2291 else mNavigator->selectDates( dateCount ); 2305 else mNavigator->selectDates( dateCount );
2292 // mViewManager->readSettings( config ); 2306 // mViewManager->readSettings( config );
2293 updateConfig(); 2307 updateConfig();
2294 globalFlagBlockAgenda = 2; 2308 globalFlagBlockAgenda = 2;
2295 mViewManager->readSettings( config ); 2309 mViewManager->readSettings( config );
2296 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2310 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2297} 2311}
2298 2312
2299 2313
2300void CalendarView::writeSettings() 2314void CalendarView::writeSettings()
2301{ 2315{
2302 // kdDebug() << "CalendarView::writeSettings" << endl; 2316 // kdDebug() << "CalendarView::writeSettings" << endl;
2303 2317
2304 KConfig *config = KOGlobals::config(); 2318 KConfig *config = KOGlobals::config();
2305 2319
2306 mViewManager->writeSettings( config ); 2320 mViewManager->writeSettings( config );
2307 mTodoList->saveLayout(config,QString("Todo Layout")); 2321 mTodoList->saveLayout(config,QString("Todo Layout"));
2308 mDialogManager->writeSettings( config ); 2322 mDialogManager->writeSettings( config );
2309 //KOPrefs::instance()->usrWriteConfig(); 2323 //KOPrefs::instance()->usrWriteConfig();
2310 KOPrefs::instance()->writeConfig(); 2324 KOPrefs::instance()->writeConfig();
2311 2325
2312 writeFilterSettings(config); 2326 writeFilterSettings(config);
2313 config->setGroup( "AppRun" ); 2327 config->setGroup( "AppRun" );
2314 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2328 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2315 int days = dt.daysTo( QDate::currentDate() ); 2329 int days = dt.daysTo( QDate::currentDate() );
2316 dt = dt.addDays( days ); 2330 dt = dt.addDays( days );
2317 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2331 int secs = dt.secsTo( QDateTime::currentDateTime() );
2318 config->writeEntry( "LatestProgramStopDays", days ); 2332 config->writeEntry( "LatestProgramStopDays", days );
2319 config->writeEntry( "LatestProgramStopSecs", secs ); 2333 config->writeEntry( "LatestProgramStopSecs", secs );
2320 //qDebug("KO: Writing stop time: %d ", secs); 2334 //qDebug("KO: Writing stop time: %d ", secs);
2321 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2335 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2322 //QDateTime latest = dt.addSecs ( secs ); 2336 //QDateTime latest = dt.addSecs ( secs );
2323 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2337 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2324 config->setGroup( "Views" ); 2338 config->setGroup( "Views" );
2325 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2339 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2326 2340
2327#if 0 2341#if 0
2328 qDebug("********************* "); 2342 qDebug("********************* ");
2329 qDebug("Testcode secsto "); 2343 qDebug("Testcode secsto ");
2330 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2344 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2331 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2345 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2332 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2346 int secsto = dt_nodaylight.secsTo( dt_daylight );
2333 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2347 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2334 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2348 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2335 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2349 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2336 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2350 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2337 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2351 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2338 qDebug("********************* testcode end"); 2352 qDebug("********************* testcode end");
2339 2353
2340#endif 2354#endif
2341 2355
2342 QValueList<int> listINT = mLeftFrame->sizes(); 2356 QValueList<int> listINT = mLeftFrame->sizes();
2343 config->writeEntry("Left Splitter Frame",listINT); 2357 config->writeEntry("Left Splitter Frame",listINT);
2344 QValueList<int> listINT2 = mMainFrame->sizes(); 2358 QValueList<int> listINT2 = mMainFrame->sizes();
2345 config->writeEntry("Main Splitter Frame",listINT2); 2359 config->writeEntry("Main Splitter Frame",listINT2);
2346#ifdef DESKTOP_VERSION 2360#ifdef DESKTOP_VERSION
2347 config->setGroup("WidgetLayout"); 2361 config->setGroup("WidgetLayout");
2348 QStringList list ;//= config->readListEntry("MainLayout"); 2362 QStringList list ;//= config->readListEntry("MainLayout");
2349 int x,y,w,h; 2363 int x,y,w,h;
2350 QWidget* wid; 2364 QWidget* wid;
2351 wid = topLevelWidget(); 2365 wid = topLevelWidget();
2352 x = wid->geometry().x(); 2366 x = wid->geometry().x();
2353 y = wid->geometry().y(); 2367 y = wid->geometry().y();
2354 w = wid->width(); 2368 w = wid->width();
2355 h = wid->height(); 2369 h = wid->height();
2356 list.clear(); 2370 list.clear();
2357 list << QString::number( x ); 2371 list << QString::number( x );
2358 list << QString::number( y ); 2372 list << QString::number( y );
2359 list << QString::number( w ); 2373 list << QString::number( w );
2360 list << QString::number( h ); 2374 list << QString::number( h );
2361 config->writeEntry("MainLayout",list ); 2375 config->writeEntry("MainLayout",list );
2362 2376
2363 wid = mEventEditor; 2377 wid = mEventEditor;
2364 x = wid->geometry().x(); 2378 x = wid->geometry().x();
2365 y = wid->geometry().y(); 2379 y = wid->geometry().y();
2366 w = wid->width(); 2380 w = wid->width();
2367 h = wid->height(); 2381 h = wid->height();
2368 list.clear(); 2382 list.clear();
2369 list << QString::number( x ); 2383 list << QString::number( x );
2370 list << QString::number( y ); 2384 list << QString::number( y );
2371 list << QString::number( w ); 2385 list << QString::number( w );
2372 list << QString::number( h ); 2386 list << QString::number( h );
2373 config->writeEntry("EditEventLayout",list ); 2387 config->writeEntry("EditEventLayout",list );
2374 2388
2375 wid = mTodoEditor; 2389 wid = mTodoEditor;
2376 x = wid->geometry().x(); 2390 x = wid->geometry().x();
2377 y = wid->geometry().y(); 2391 y = wid->geometry().y();
2378 w = wid->width(); 2392 w = wid->width();
2379 h = wid->height(); 2393 h = wid->height();
2380 list.clear(); 2394 list.clear();
2381 list << QString::number( x ); 2395 list << QString::number( x );
2382 list << QString::number( y ); 2396 list << QString::number( y );
2383 list << QString::number( w ); 2397 list << QString::number( w );
2384 list << QString::number( h ); 2398 list << QString::number( h );
2385 config->writeEntry("EditTodoLayout",list ); 2399 config->writeEntry("EditTodoLayout",list );
2386 wid = getEventViewerDialog(); 2400 wid = getEventViewerDialog();
2387 x = wid->geometry().x(); 2401 x = wid->geometry().x();
2388 y = wid->geometry().y(); 2402 y = wid->geometry().y();
2389 w = wid->width(); 2403 w = wid->width();
2390 h = wid->height(); 2404 h = wid->height();
2391 list.clear(); 2405 list.clear();
2392 list << QString::number( x ); 2406 list << QString::number( x );
2393 list << QString::number( y ); 2407 list << QString::number( y );
2394 list << QString::number( w ); 2408 list << QString::number( w );
2395 list << QString::number( h ); 2409 list << QString::number( h );
2396 config->writeEntry("ViewerLayout",list ); 2410 config->writeEntry("ViewerLayout",list );
2397 wid = mDialogManager->getSearchDialog(); 2411 wid = mDialogManager->getSearchDialog();
2398 if ( wid ) { 2412 if ( wid ) {
2399 x = wid->geometry().x(); 2413 x = wid->geometry().x();
2400 y = wid->geometry().y(); 2414 y = wid->geometry().y();
2401 w = wid->width(); 2415 w = wid->width();
2402 h = wid->height(); 2416 h = wid->height();
2403 list.clear(); 2417 list.clear();
2404 list << QString::number( x ); 2418 list << QString::number( x );
2405 list << QString::number( y ); 2419 list << QString::number( y );
2406 list << QString::number( w ); 2420 list << QString::number( w );
2407 list << QString::number( h ); 2421 list << QString::number( h );
2408 config->writeEntry("SearchLayout",list ); 2422 config->writeEntry("SearchLayout",list );
2409 } 2423 }
2410#endif 2424#endif
2411 2425
2412 2426
2413 config->sync(); 2427 config->sync();
2414} 2428}
2415 2429
2416void CalendarView::readFilterSettings(KConfig *config) 2430void CalendarView::readFilterSettings(KConfig *config)
2417{ 2431{
2418 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2432 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2419 2433
2420 mFilters.clear(); 2434 mFilters.clear();
2421 2435
2422 config->setGroup("General"); 2436 config->setGroup("General");
2423 QStringList filterList = config->readListEntry("CalendarFilters"); 2437 QStringList filterList = config->readListEntry("CalendarFilters");
2424 2438
2425 QStringList::ConstIterator it = filterList.begin(); 2439 QStringList::ConstIterator it = filterList.begin();
2426 QStringList::ConstIterator end = filterList.end(); 2440 QStringList::ConstIterator end = filterList.end();
2427 while(it != end) { 2441 while(it != end) {
2428 // kdDebug() << " filter: " << (*it) << endl; 2442 // kdDebug() << " filter: " << (*it) << endl;
2429 2443
2430 CalFilter *filter; 2444 CalFilter *filter;
2431 filter = new CalFilter(*it); 2445 filter = new CalFilter(*it);
2432 config->setGroup("Filter_" + (*it).utf8()); 2446 config->setGroup("Filter_" + (*it).utf8());
2433 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2447 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2434 filter->setCriteria(config->readNumEntry("Criteria",0)); 2448 filter->setCriteria(config->readNumEntry("Criteria",0));
2435 filter->setCategoryList(config->readListEntry("CategoryList")); 2449 filter->setCategoryList(config->readListEntry("CategoryList"));
2436 mFilters.append(filter); 2450 mFilters.append(filter);
2437 2451
2438 ++it; 2452 ++it;
2439 } 2453 }
2440 2454
2441 if (mFilters.count() == 0) { 2455 if (mFilters.count() == 0) {
2442 CalFilter *filter = new CalFilter(i18n("Default")); 2456 CalFilter *filter = new CalFilter(i18n("Default"));
2443 mFilters.append(filter); 2457 mFilters.append(filter);
2444 } 2458 }
2445 mFilterView->updateFilters(); 2459 mFilterView->updateFilters();
2446 config->setGroup("FilterView"); 2460 config->setGroup("FilterView");
2447 2461
2448 mFilterView->blockSignals(true); 2462 mFilterView->blockSignals(true);
2449 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2463 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2450 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2464 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2451 mFilterView->blockSignals(false); 2465 mFilterView->blockSignals(false);
2452 // We do it manually to avoid it being done twice by the above calls 2466 // We do it manually to avoid it being done twice by the above calls
2453 updateFilter(); 2467 updateFilter();
2454} 2468}
2455 2469
2456void CalendarView::writeFilterSettings(KConfig *config) 2470void CalendarView::writeFilterSettings(KConfig *config)
2457{ 2471{
2458 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2472 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2459 2473
2460 QStringList filterList; 2474 QStringList filterList;
2461 2475
2462 CalFilter *filter = mFilters.first(); 2476 CalFilter *filter = mFilters.first();
2463 while(filter) { 2477 while(filter) {
2464 // kdDebug() << " fn: " << filter->name() << endl; 2478 // kdDebug() << " fn: " << filter->name() << endl;
2465 filterList << filter->name(); 2479 filterList << filter->name();
2466 config->setGroup("Filter_" + filter->name().utf8()); 2480 config->setGroup("Filter_" + filter->name().utf8());
2467 config->writeEntry("Criteria",filter->criteria()); 2481 config->writeEntry("Criteria",filter->criteria());
2468 config->writeEntry("CategoryList",filter->categoryList()); 2482 config->writeEntry("CategoryList",filter->categoryList());
2469 filter = mFilters.next(); 2483 filter = mFilters.next();
2470 } 2484 }
2471 config->setGroup("General"); 2485 config->setGroup("General");
2472 config->writeEntry("CalendarFilters",filterList); 2486 config->writeEntry("CalendarFilters",filterList);
2473 2487
2474 config->setGroup("FilterView"); 2488 config->setGroup("FilterView");
2475 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2489 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2476 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2490 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2477} 2491}
2478 2492
2479 2493
2480void CalendarView::goToday() 2494void CalendarView::goToday()
2481{ 2495{
2482 if ( mViewManager->currentView()->isMonthView() ) 2496 if ( mViewManager->currentView()->isMonthView() )
2483 mNavigator->selectTodayMonth(); 2497 mNavigator->selectTodayMonth();
2484 else 2498 else
2485 mNavigator->selectToday(); 2499 mNavigator->selectToday();
2486} 2500}
2487 2501
2488void CalendarView::goNext() 2502void CalendarView::goNext()
2489{ 2503{
2490 mNavigator->selectNext(); 2504 mNavigator->selectNext();
2491} 2505}
2492 2506
2493void CalendarView::goPrevious() 2507void CalendarView::goPrevious()
2494{ 2508{
2495 mNavigator->selectPrevious(); 2509 mNavigator->selectPrevious();
2496} 2510}
2497void CalendarView::goNextMonth() 2511void CalendarView::goNextMonth()
2498{ 2512{
2499 mNavigator->selectNextMonth(); 2513 mNavigator->selectNextMonth();
2500} 2514}
2501 2515
2502void CalendarView::goPreviousMonth() 2516void CalendarView::goPreviousMonth()
2503{ 2517{
2504 mNavigator->selectPreviousMonth(); 2518 mNavigator->selectPreviousMonth();
2505} 2519}
2506 2520
2507void CalendarView::updateConfig() 2521void CalendarView::updateConfig()
2508{ 2522{
2509 if ( KOPrefs::instance()->mUseAppColors ) 2523 if ( KOPrefs::instance()->mUseAppColors )
2510 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2524 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2511 emit configChanged(); 2525 emit configChanged();
2512 mTodoList->updateConfig(); 2526 mTodoList->updateConfig();
2513 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2527 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2514 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2528 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2515 // To make the "fill window" configurations work 2529 // To make the "fill window" configurations work
2516 //mViewManager->raiseCurrentView(); 2530 //mViewManager->raiseCurrentView();
2517} 2531}
2518 2532
2519 2533
2520void CalendarView::eventChanged(Event *event) 2534void CalendarView::eventChanged(Event *event)
2521{ 2535{
2522 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2536 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2523 //updateUnmanagedViews(); 2537 //updateUnmanagedViews();
2524} 2538}
2525 2539
2526void CalendarView::eventAdded(Event *event) 2540void CalendarView::eventAdded(Event *event)
2527{ 2541{
2528 changeEventDisplay(event,KOGlobals::EVENTADDED); 2542 changeEventDisplay(event,KOGlobals::EVENTADDED);
2529} 2543}
2530 2544
2531void CalendarView::eventToBeDeleted(Event *) 2545void CalendarView::eventToBeDeleted(Event *)
2532{ 2546{
2533 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2547 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2534} 2548}
2535 2549
2536void CalendarView::eventDeleted() 2550void CalendarView::eventDeleted()
2537{ 2551{
2538 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2552 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2539} 2553}
2540void CalendarView::changeTodoDisplay(Todo *which, int action) 2554void CalendarView::changeTodoDisplay(Todo *which, int action)
2541{ 2555{
2542 changeIncidenceDisplay((Incidence *)which, action); 2556 changeIncidenceDisplay((Incidence *)which, action);
2543 mDateNavigator->updateView(); //LR 2557 mDateNavigator->updateView(); //LR
2544 //mDialogManager->updateSearchDialog(); 2558 //mDialogManager->updateSearchDialog();
2545 2559
2546 if (which) { 2560 if (which) {
2547 mViewManager->updateWNview(); 2561 mViewManager->updateWNview();
2548 //mTodoList->updateView(); 2562 //mTodoList->updateView();
2549 } 2563 }
2550 2564
2551} 2565}
2552 2566
2553void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2567void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2554{ 2568{
2555 updateUnmanagedViews(); 2569 updateUnmanagedViews();
2556 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2570 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2557 if ( action == KOGlobals::EVENTDELETED ) { //delete 2571 if ( action == KOGlobals::EVENTDELETED ) { //delete
2558 mCalendar->checkAlarmForIncidence( 0, true ); 2572 mCalendar->checkAlarmForIncidence( 0, true );
2559 if ( mEventViewerDialog ) 2573 if ( mEventViewerDialog )
2560 mEventViewerDialog->hide(); 2574 mEventViewerDialog->hide();
2561 } 2575 }
2562 else 2576 else
2563 mCalendar->checkAlarmForIncidence( which , false ); 2577 mCalendar->checkAlarmForIncidence( which , false );
2564} 2578}
2565 2579
2566// most of the changeEventDisplays() right now just call the view's 2580// most of the changeEventDisplays() right now just call the view's
2567// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2581// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2568void CalendarView::changeEventDisplay(Event *which, int action) 2582void CalendarView::changeEventDisplay(Event *which, int action)
2569{ 2583{
2570 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2584 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2571 changeIncidenceDisplay((Incidence *)which, action); 2585 changeIncidenceDisplay((Incidence *)which, action);
2572 mDateNavigator->updateView(); 2586 mDateNavigator->updateView();
2573 //mDialogManager->updateSearchDialog(); 2587 //mDialogManager->updateSearchDialog();
2574 2588
2575 if (which) { 2589 if (which) {
2576 // If there is an event view visible update the display 2590 // If there is an event view visible update the display
2577 mViewManager->currentView()->changeEventDisplay(which,action); 2591 mViewManager->currentView()->changeEventDisplay(which,action);
2578 // TODO: check, if update needed 2592 // TODO: check, if update needed
2579 // if (which->getTodoStatus()) { 2593 // if (which->getTodoStatus()) {
2580 mTodoList->updateView(); 2594 mTodoList->updateView();
2581 // } 2595 // }
2582 } else { 2596 } else {
2583 mViewManager->currentView()->updateView(); 2597 mViewManager->currentView()->updateView();
2584 } 2598 }
2585} 2599}
2586 2600
2587 2601
2588void CalendarView::updateTodoViews() 2602void CalendarView::updateTodoViews()
2589{ 2603{
2590 mTodoList->updateView(); 2604 mTodoList->updateView();
2591 mViewManager->currentView()->updateView(); 2605 mViewManager->currentView()->updateView();
2592 2606
2593} 2607}
2594 2608
2595 2609
2596void CalendarView::updateView(const QDate &start, const QDate &end) 2610void CalendarView::updateView(const QDate &start, const QDate &end)
2597{ 2611{
2598#ifdef DESKTOP_VERSION 2612#ifdef DESKTOP_VERSION
2599 mDateScrollBar->blockSignals( true ); 2613 mDateScrollBar->blockSignals( true );
2600 mDateScrollBar->setValue( start.dayOfYear()-1); 2614 mDateScrollBar->setValue( start.dayOfYear()-1);
2601 mDateScrollBar->blockSignals( false ); 2615 mDateScrollBar->blockSignals( false );
2602#endif 2616#endif
2603 mTodoList->updateView(); 2617 mTodoList->updateView();
2604 mViewManager->updateView(start, end); 2618 mViewManager->updateView(start, end);
2605 //mDateNavigator->updateView(); 2619 //mDateNavigator->updateView();
2606} 2620}
2607 2621
2608void CalendarView::clearAllViews() 2622void CalendarView::clearAllViews()
2609{ 2623{
2610 mTodoList->clearList(); 2624 mTodoList->clearList();
2611 mViewManager->clearAllViews(); 2625 mViewManager->clearAllViews();
2612 SearchDialog * sd = mDialogManager->getSearchDialog(); 2626 SearchDialog * sd = mDialogManager->getSearchDialog();
2613 if ( sd ) { 2627 if ( sd ) {
2614 KOListView* kol = sd->listview(); 2628 KOListView* kol = sd->listview();
2615 if ( kol ) 2629 if ( kol )
2616 kol->clearList(); 2630 kol->clearList();
2617 } 2631 }
2618} 2632}
2619void CalendarView::updateView() 2633void CalendarView::updateView()
2620{ 2634{
2621 DateList tmpList = mNavigator->selectedDates(); 2635 DateList tmpList = mNavigator->selectedDates();
2622 2636
2623 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2637 if ( KOPrefs::instance()->mHideNonStartedTodos )
2624 mTodoList->updateView(); 2638 mTodoList->updateView();
2625 // We assume that the navigator only selects consecutive days. 2639 // We assume that the navigator only selects consecutive days.
2626 updateView( tmpList.first(), tmpList.last() ); 2640 updateView( tmpList.first(), tmpList.last() );
2627} 2641}
2628 2642
2629void CalendarView::updateUnmanagedViews() 2643void CalendarView::updateUnmanagedViews()
2630{ 2644{
2631 mDateNavigator->updateDayMatrix(); 2645 mDateNavigator->updateDayMatrix();
2632} 2646}
2633 2647
2634int CalendarView::msgItemDelete(const QString name) 2648int CalendarView::msgItemDelete(const QString name)
2635{ 2649{
2636 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 2650 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
2637 i18n("This item will be\npermanently deleted."), 2651 i18n("This item will be\npermanently deleted."),
2638 i18n("KO/Pi Confirmation"),i18n("Delete")); 2652 i18n("KO/Pi Confirmation"),i18n("Delete"));
2639} 2653}
2640 2654
2641 2655
2642void CalendarView::edit_cut() 2656void CalendarView::edit_cut()
2643{ 2657{
2644 Event *anEvent=0; 2658 Event *anEvent=0;
2645 2659
2646 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2660 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2647 2661
2648 if (mViewManager->currentView()->isEventView()) { 2662 if (mViewManager->currentView()->isEventView()) {
2649 if ( incidence && incidence->typeID() == eventID ) { 2663 if ( incidence && incidence->typeID() == eventID ) {
2650 anEvent = static_cast<Event *>(incidence); 2664 anEvent = static_cast<Event *>(incidence);
2651 } 2665 }
2652 } 2666 }
2653 2667
2654 if (!anEvent) { 2668 if (!anEvent) {
2655 KNotifyClient::beep(); 2669 KNotifyClient::beep();
2656 return; 2670 return;
2657 } 2671 }
2658 DndFactory factory( mCalendar ); 2672 DndFactory factory( mCalendar );
2659 factory.cutIncidence(anEvent); 2673 factory.cutIncidence(anEvent);
2660 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2674 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2661} 2675}
2662 2676
2663void CalendarView::edit_copy() 2677void CalendarView::edit_copy()
2664{ 2678{
2665 Event *anEvent=0; 2679 Event *anEvent=0;
2666 2680
2667 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2681 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2668 2682
2669 if (mViewManager->currentView()->isEventView()) { 2683 if (mViewManager->currentView()->isEventView()) {
2670 if ( incidence && incidence->typeID() == eventID ) { 2684 if ( incidence && incidence->typeID() == eventID ) {
2671 anEvent = static_cast<Event *>(incidence); 2685 anEvent = static_cast<Event *>(incidence);
2672 } 2686 }
2673 } 2687 }
2674 2688
2675 if (!anEvent) { 2689 if (!anEvent) {
2676 KNotifyClient::beep(); 2690 KNotifyClient::beep();
2677 return; 2691 return;
2678 } 2692 }
2679 DndFactory factory( mCalendar ); 2693 DndFactory factory( mCalendar );
2680 factory.copyIncidence(anEvent); 2694 factory.copyIncidence(anEvent);
2681} 2695}
2682 2696
2683void CalendarView::edit_paste() 2697void CalendarView::edit_paste()
2684{ 2698{
2685 QDate date = mNavigator->selectedDates().first(); 2699 QDate date = mNavigator->selectedDates().first();
2686 2700
2687 DndFactory factory( mCalendar ); 2701 DndFactory factory( mCalendar );
2688 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 2702 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
2689 2703
2690 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2704 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2691} 2705}
2692void CalendarView::edit_global_options() 2706void CalendarView::edit_global_options()
2693{ 2707{
2694 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 2708 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
2695 emit save(); 2709 emit save();
2696 emit saveStopTimer(); 2710 emit saveStopTimer();
2697 mDialogManager->showGlobalOptionsDialog(); 2711 mDialogManager->showGlobalOptionsDialog();
2698 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 2712 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
2699 emit saveStopTimer(); 2713 emit saveStopTimer();
2700 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!"), 2714 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!"),
2701 i18n("Timezone settings"),i18n("Reload"))) { 2715 i18n("Timezone settings"),i18n("Reload"))) {
2702 qDebug("KO: TZ reload cancelled "); 2716 qDebug("KO: TZ reload cancelled ");
2703 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2717 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2704 return; 2718 return;
2705 } 2719 }
2706 qDebug("KO: Timezone change "); 2720 qDebug("KO: Timezone change ");
2707 loadCalendars(); 2721 loadCalendars();
2708 setModified(true); 2722 setModified(true);
2709 } 2723 }
2710 else 2724 else
2711 qDebug("KO: No tz change "); 2725 qDebug("KO: No tz change ");
2712} 2726}
2713void CalendarView::edit_options() 2727void CalendarView::edit_options()
2714{ 2728{
2715 mDialogManager->showOptionsDialog(); 2729 mDialogManager->showOptionsDialog();
2716} 2730}
2717 2731
2718 2732
2719void CalendarView::slotSelectPickerDate( QDate d) 2733void CalendarView::slotSelectPickerDate( QDate d)
2720{ 2734{
2721 mDateFrame->hide(); 2735 mDateFrame->hide();
2722 if ( mDatePickerMode == 1 ) { 2736 if ( mDatePickerMode == 1 ) {
2723 mNavigator->slotDaySelect( d ); 2737 mNavigator->slotDaySelect( d );
2724 } else if ( mDatePickerMode == 2 ) { 2738 } else if ( mDatePickerMode == 2 ) {
2725 if ( mMoveIncidence->typeID() == todoID ) { 2739 if ( mMoveIncidence->typeID() == todoID ) {
2726 Todo * to = (Todo *) mMoveIncidence; 2740 Todo * to = (Todo *) mMoveIncidence;
2727 QTime tim; 2741 QTime tim;
2728 int len = 0; 2742 int len = 0;
2729 if ( to->hasStartDate() && to->hasDueDate() ) 2743 if ( to->hasStartDate() && to->hasDueDate() )
2730 len = to->dtStart().secsTo( to->dtDue()); 2744 len = to->dtStart().secsTo( to->dtDue());
2731 if ( to->hasDueDate() ) 2745 if ( to->hasDueDate() )
2732 tim = to->dtDue().time(); 2746 tim = to->dtDue().time();
2733 else { 2747 else {
2734 tim = QTime ( 0,0,0 ); 2748 tim = QTime ( 0,0,0 );
2735 to->setFloats( true ); 2749 to->setFloats( true );
2736 to->setHasDueDate( true ); 2750 to->setHasDueDate( true );
2737 } 2751 }
2738 QDateTime dt ( d,tim ); 2752 QDateTime dt ( d,tim );
2739 to->setDtDue( dt ); 2753 to->setDtDue( dt );
2740 2754
2741 if ( to->hasStartDate() ) { 2755 if ( to->hasStartDate() ) {
2742 if ( len>0 ) 2756 if ( len>0 )
2743 to->setDtStart(to->dtDue().addSecs( -len )); 2757 to->setDtStart(to->dtDue().addSecs( -len ));
2744 else 2758 else
2745 if (to->dtStart() > to->dtDue() ) 2759 if (to->dtStart() > to->dtDue() )
2746 to->setDtStart(to->dtDue().addDays( -3 )); 2760 to->setDtStart(to->dtDue().addDays( -3 ));
2747 } 2761 }
2748 2762
2749 todoChanged( to ); 2763 todoChanged( to );
2750 } else { 2764 } else {
2751 if ( mMoveIncidence->doesRecur() ) { 2765 if ( mMoveIncidence->doesRecur() ) {
2752#if 0 2766#if 0
2753 // PENDING implement this 2767 // PENDING implement this
2754 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 2768 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
2755 mCalendar()->addIncidence( newInc ); 2769 mCalendar()->addIncidence( newInc );
2756 if ( mMoveIncidence->typeID() == todoID ) 2770 if ( mMoveIncidence->typeID() == todoID )
2757 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 2771 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
2758 else 2772 else
2759 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 2773 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
2760 mMoveIncidence = newInc; 2774 mMoveIncidence = newInc;
2761 2775
2762#endif 2776#endif
2763 } 2777 }
2764 QTime tim = mMoveIncidence->dtStart().time(); 2778 QTime tim = mMoveIncidence->dtStart().time();
2765 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 2779 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
2766 QDateTime dt ( d,tim ); 2780 QDateTime dt ( d,tim );
2767 mMoveIncidence->setDtStart( dt ); 2781 mMoveIncidence->setDtStart( dt );
2768 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 2782 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
2769 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 2783 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
2770 } 2784 }
2771 2785
2772 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 2786 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
2773 } 2787 }
2774} 2788}
2775 2789
2776void CalendarView::removeCategories() 2790void CalendarView::removeCategories()
2777{ 2791{
2778 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2792 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2779 QStringList catList = KOPrefs::instance()->mCustomCategories; 2793 QStringList catList = KOPrefs::instance()->mCustomCategories;
2780 QStringList catIncList; 2794 QStringList catIncList;
2781 QStringList newCatList; 2795 QStringList newCatList;
2782 Incidence* inc = incList.first(); 2796 Incidence* inc = incList.first();
2783 int i; 2797 int i;
2784 int count = 0; 2798 int count = 0;
2785 while ( inc ) { 2799 while ( inc ) {
2786 newCatList.clear(); 2800 newCatList.clear();
2787 catIncList = inc->categories() ; 2801 catIncList = inc->categories() ;
2788 for( i = 0; i< catIncList.count(); ++i ) { 2802 for( i = 0; i< catIncList.count(); ++i ) {
2789 if ( catList.contains (catIncList[i])) 2803 if ( catList.contains (catIncList[i]))
2790 newCatList.append( catIncList[i] ); 2804 newCatList.append( catIncList[i] );
2791 } 2805 }
2792 newCatList.sort(); 2806 newCatList.sort();
2793 inc->setCategories( newCatList.join(",") ); 2807 inc->setCategories( newCatList.join(",") );
2794 inc = incList.next(); 2808 inc = incList.next();
2795 } 2809 }
2796} 2810}
2797 2811
2798int CalendarView::addCategories() 2812int CalendarView::addCategories()
2799{ 2813{
2800 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 2814 QPtrList<Incidence> incList = mCalendar->rawIncidences();
2801 QStringList catList = KOPrefs::instance()->mCustomCategories; 2815 QStringList catList = KOPrefs::instance()->mCustomCategories;
2802 QStringList catIncList; 2816 QStringList catIncList;
2803 Incidence* inc = incList.first(); 2817 Incidence* inc = incList.first();
2804 int i; 2818 int i;
2805 int count = 0; 2819 int count = 0;
2806 while ( inc ) { 2820 while ( inc ) {
2807 catIncList = inc->categories() ; 2821 catIncList = inc->categories() ;
2808 for( i = 0; i< catIncList.count(); ++i ) { 2822 for( i = 0; i< catIncList.count(); ++i ) {
2809 if ( !catList.contains (catIncList[i])) { 2823 if ( !catList.contains (catIncList[i])) {
2810 catList.append( catIncList[i] ); 2824 catList.append( catIncList[i] );
2811 //qDebug("add cat %s ", catIncList[i].latin1()); 2825 //qDebug("add cat %s ", catIncList[i].latin1());
2812 ++count; 2826 ++count;
2813 } 2827 }
2814 } 2828 }
2815 inc = incList.next(); 2829 inc = incList.next();
2816 } 2830 }
2817 catList.sort(); 2831 catList.sort();
2818 KOPrefs::instance()->mCustomCategories = catList; 2832 KOPrefs::instance()->mCustomCategories = catList;
2819 return count; 2833 return count;
2820} 2834}
2821 2835
2822void CalendarView::editCategories() 2836void CalendarView::editCategories()
2823{ 2837{
2824 qDebug("CalendarView::editCategories() "); 2838 qDebug("CalendarView::editCategories() ");
2825 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this ); 2839 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this );
2826 ced.exec(); 2840 ced.exec();
2827} 2841}
2828void CalendarView::manageCategories() 2842void CalendarView::manageCategories()
2829{ 2843{
2830 KOCatPrefs* cp = new KOCatPrefs(); 2844 KOCatPrefs* cp = new KOCatPrefs();
2831 cp->show(); 2845 cp->show();
2832 int w =cp->sizeHint().width() ; 2846 int w =cp->sizeHint().width() ;
2833 int h = cp->sizeHint().height() ; 2847 int h = cp->sizeHint().height() ;
2834 int dw = QApplication::desktop()->width(); 2848 int dw = QApplication::desktop()->width();
2835 int dh = QApplication::desktop()->height(); 2849 int dh = QApplication::desktop()->height();
2836 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2850 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2837 if ( !cp->exec() ) { 2851 if ( !cp->exec() ) {
2838 delete cp; 2852 delete cp;
2839 return; 2853 return;
2840 } 2854 }
2841 int count = 0; 2855 int count = 0;
2842 if ( cp->addCat() ) { 2856 if ( cp->addCat() ) {
2843 count = addCategories(); 2857 count = addCategories();
2844 if ( count ) { 2858 if ( count ) {
2845 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 2859 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
2846 writeSettings(); 2860 writeSettings();
2847 } else 2861 } else
2848 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 2862 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
2849 } else { 2863 } else {
2850 removeCategories(); 2864 removeCategories();
2851 updateView(); 2865 updateView();
2852 } 2866 }
2853 delete cp; 2867 delete cp;
2854} 2868}
2855 2869
2856void CalendarView::beamIncidence(Incidence * Inc) 2870void CalendarView::beamIncidence(Incidence * Inc)
2857{ 2871{
2858 QPtrList<Incidence> delSel ; 2872 QPtrList<Incidence> delSel ;
2859 delSel.append(Inc); 2873 delSel.append(Inc);
2860 beamIncidenceList( delSel ); 2874 beamIncidenceList( delSel );
2861} 2875}
2862void CalendarView::beamCalendar() 2876void CalendarView::beamCalendar()
2863{ 2877{
2864 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 2878 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
2865 //qDebug("beamCalendar() "); 2879 //qDebug("beamCalendar() ");
2866 beamIncidenceList( delSel ); 2880 beamIncidenceList( delSel );
2867} 2881}
2868void CalendarView::beamFilteredCalendar() 2882void CalendarView::beamFilteredCalendar()
2869{ 2883{
2870 QPtrList<Incidence> delSel = mCalendar->incidences(); 2884 QPtrList<Incidence> delSel = mCalendar->incidences();
2871 //qDebug("beamFilteredCalendar() "); 2885 //qDebug("beamFilteredCalendar() ");
2872 beamIncidenceList( delSel ); 2886 beamIncidenceList( delSel );
2873} 2887}
2874void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 2888void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
2875{ 2889{
2876 2890
2877 KOBeamPrefs beamDialog; 2891 KOBeamPrefs beamDialog;
2878 if ( beamDialog.exec () == QDialog::Rejected ) 2892 if ( beamDialog.exec () == QDialog::Rejected )
2879 return; 2893 return;
2880#ifdef DESKTOP_VERSION 2894#ifdef DESKTOP_VERSION
2881 QString fn = locateLocal( "tmp", "kopibeamfile" ); 2895 QString fn = locateLocal( "tmp", "kopibeamfile" );
2882#else 2896#else
2883 QString fn = "/tmp/kopibeamfile"; 2897 QString fn = "/tmp/kopibeamfile";
2884#endif 2898#endif
2885 QString mes; 2899 QString mes;
2886 bool createbup = true; 2900 bool createbup = true;
2887 if ( createbup ) { 2901 if ( createbup ) {
2888 QString description = "\n"; 2902 QString description = "\n";
2889 CalendarLocal* cal = new CalendarLocal(); 2903 CalendarLocal* cal = new CalendarLocal();
2890 if ( beamDialog.beamLocal() ) 2904 if ( beamDialog.beamLocal() )
2891 cal->setLocalTime(); 2905 cal->setLocalTime();
2892 else 2906 else
2893 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2907 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2894 Incidence *incidence = delSel.first(); 2908 Incidence *incidence = delSel.first();
2895 bool addText = false; 2909 bool addText = false;
2896 if ( delSel.count() < 10 ) 2910 if ( delSel.count() < 10 )
2897 addText = true; 2911 addText = true;
2898 else { 2912 else {
2899 description.sprintf(i18n(" %d items?"),delSel.count() ); 2913 description.sprintf(i18n(" %d items?"),delSel.count() );
2900 } 2914 }
2901 while ( incidence ) { 2915 while ( incidence ) {
2902 Incidence *in = incidence->clone(); 2916 Incidence *in = incidence->clone();
2903 if ( ! in->summary().isEmpty() ) { 2917 if ( ! in->summary().isEmpty() ) {
2904 in->setDescription(""); 2918 in->setDescription("");
2905 } else { 2919 } else {
2906 in->setSummary( in->description().left(20)); 2920 in->setSummary( in->description().left(20));
2907 in->setDescription(""); 2921 in->setDescription("");
2908 } 2922 }
2909 if ( addText ) 2923 if ( addText )
2910 description += in->summary() + "\n"; 2924 description += in->summary() + "\n";
2911 cal->addIncidence( in ); 2925 cal->addIncidence( in );
2912 incidence = delSel.next(); 2926 incidence = delSel.next();
2913 } 2927 }
2914 if ( beamDialog.beamVcal() ) { 2928 if ( beamDialog.beamVcal() ) {
2915 fn += ".vcs"; 2929 fn += ".vcs";
2916 FileStorage storage( cal, fn, new VCalFormat ); 2930 FileStorage storage( cal, fn, new VCalFormat );
2917 storage.save(); 2931 storage.save();
2918 } else { 2932 } else {
2919 fn += ".ics"; 2933 fn += ".ics";
2920 FileStorage storage( cal, fn, new ICalFormat( ) ); 2934 FileStorage storage( cal, fn, new ICalFormat( ) );
2921 storage.save(); 2935 storage.save();
2922 } 2936 }
2923 delete cal; 2937 delete cal;
2924 mes = i18n("KO/Pi: Ready for beaming"); 2938 mes = i18n("KO/Pi: Ready for beaming");
2925 topLevelWidget()->setCaption(mes); 2939 topLevelWidget()->setCaption(mes);
2926 KApplication::convert2latin1( fn ); 2940 KApplication::convert2latin1( fn );
2927#ifndef DESKTOP_VERSION 2941#ifndef DESKTOP_VERSION
2928 Ir *ir = new Ir( this ); 2942 Ir *ir = new Ir( this );
2929 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 2943 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
2930 ir->send( fn, description, "text/x-vCalendar" ); 2944 ir->send( fn, description, "text/x-vCalendar" );
2931#endif 2945#endif
2932 } 2946 }
2933} 2947}
2934void CalendarView::beamDone( Ir *ir ) 2948void CalendarView::beamDone( Ir *ir )
2935{ 2949{
2936#ifndef DESKTOP_VERSION 2950#ifndef DESKTOP_VERSION
2937 delete ir; 2951 delete ir;
2938#endif 2952#endif
2939 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 2953 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
2940 topLevelWidget()->raise(); 2954 topLevelWidget()->raise();
2941} 2955}
2942 2956
2943void CalendarView::moveIncidence(Incidence * inc ) 2957void CalendarView::moveIncidence(Incidence * inc )
2944{ 2958{
2945 if ( !inc ) return; 2959 if ( !inc ) return;
2946 showDatePickerPopup(); 2960 showDatePickerPopup();
2947 mDatePickerMode = 2; 2961 mDatePickerMode = 2;
2948 mMoveIncidence = inc ; 2962 mMoveIncidence = inc ;
2949 QDate da; 2963 QDate da;
2950 if ( mMoveIncidence->typeID() == todoID ) { 2964 if ( mMoveIncidence->typeID() == todoID ) {
2951 Todo * to = (Todo *) mMoveIncidence; 2965 Todo * to = (Todo *) mMoveIncidence;
2952 if ( to->hasDueDate() ) 2966 if ( to->hasDueDate() )
2953 da = to->dtDue().date(); 2967 da = to->dtDue().date();
2954 else 2968 else
2955 da = QDate::currentDate(); 2969 da = QDate::currentDate();
2956 } else { 2970 } else {
2957 da = mMoveIncidence->dtStart().date(); 2971 da = mMoveIncidence->dtStart().date();
2958 } 2972 }
2959 //PENDING set date for recurring incidence to date of recurrence 2973 //PENDING set date for recurring incidence to date of recurrence
2960 //mMoveIncidenceOldDate; 2974 //mMoveIncidenceOldDate;
2961 mDatePicker->setDate( da ); 2975 mDatePicker->setDate( da );
2962} 2976}
2963void CalendarView::showDatePickerPopup() 2977void CalendarView::showDatePickerPopup()
2964{ 2978{
2965 if ( mDateFrame->isVisible() ) 2979 if ( mDateFrame->isVisible() )
2966 mDateFrame->hide(); 2980 mDateFrame->hide();
2967 else { 2981 else {
2968 int offX = 0, offY = 0; 2982 int offX = 0, offY = 0;
2969#ifdef DESKTOP_VERSION 2983#ifdef DESKTOP_VERSION
2970 int w =mDatePicker->sizeHint().width() ; 2984 int w =mDatePicker->sizeHint().width() ;
2971 int h = mDatePicker->sizeHint().height() ; 2985 int h = mDatePicker->sizeHint().height() ;
2972 int dw = topLevelWidget()->width(); 2986 int dw = topLevelWidget()->width();
2973 int dh = topLevelWidget()->height(); 2987 int dh = topLevelWidget()->height();
2974 offX = topLevelWidget()->x(); 2988 offX = topLevelWidget()->x();
2975 offY = topLevelWidget()->y(); 2989 offY = topLevelWidget()->y();
2976#else 2990#else
2977 int w =mDatePicker->sizeHint().width() ; 2991 int w =mDatePicker->sizeHint().width() ;
2978 int h = mDatePicker->sizeHint().height() ; 2992 int h = mDatePicker->sizeHint().height() ;
2979 int dw = QApplication::desktop()->width(); 2993 int dw = QApplication::desktop()->width();
2980 int dh = QApplication::desktop()->height(); 2994 int dh = QApplication::desktop()->height();
2981#endif 2995#endif
2982 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); 2996 mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h );
2983 mDateFrame->show(); 2997 mDateFrame->show();
2984 } 2998 }
2985} 2999}
2986void CalendarView::showDatePicker( ) 3000void CalendarView::showDatePicker( )
2987{ 3001{
2988 showDatePickerPopup(); 3002 showDatePickerPopup();
2989 mDatePickerMode = 1; 3003 mDatePickerMode = 1;
2990 mDatePicker->setDate( mNavigator->selectedDates().first() ); 3004 mDatePicker->setDate( mNavigator->selectedDates().first() );
2991} 3005}
2992 3006
2993void CalendarView::showEventEditor() 3007void CalendarView::showEventEditor()
2994{ 3008{
2995#ifdef DESKTOP_VERSION 3009#ifdef DESKTOP_VERSION
2996 int x,y,w,h; 3010 int x,y,w,h;
2997 x = mEventEditor->geometry().x(); 3011 x = mEventEditor->geometry().x();
2998 y = mEventEditor->geometry().y(); 3012 y = mEventEditor->geometry().y();
2999 w = mEventEditor->width(); 3013 w = mEventEditor->width();
3000 h = mEventEditor->height(); 3014 h = mEventEditor->height();
3001 mEventEditor->show(); 3015 mEventEditor->show();
3002 mEventEditor->setGeometry(x,y,w,h); 3016 mEventEditor->setGeometry(x,y,w,h);
3003#else 3017#else
3004 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { 3018 if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) {
3005 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3019 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3006 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); 3020 qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() );
3007 qApp->processEvents(); 3021 qApp->processEvents();
3008 delete mEventEditor; 3022 delete mEventEditor;
3009 mEventEditor = mDialogManager->getEventEditor(); 3023 mEventEditor = mDialogManager->getEventEditor();
3010 topLevelWidget()->setCaption( i18n("") ); 3024 topLevelWidget()->setCaption( i18n("") );
3011 } 3025 }
3012 mEventEditor->showMaximized(); 3026 mEventEditor->showMaximized();
3013#endif 3027#endif
3014} 3028}
3015void CalendarView::showTodoEditor() 3029void CalendarView::showTodoEditor()
3016{ 3030{
3017#ifdef DESKTOP_VERSION 3031#ifdef DESKTOP_VERSION
3018 int x,y,w,h; 3032 int x,y,w,h;
3019 x = mTodoEditor->geometry().x(); 3033 x = mTodoEditor->geometry().x();
3020 y = mTodoEditor->geometry().y(); 3034 y = mTodoEditor->geometry().y();
3021 w = mTodoEditor->width(); 3035 w = mTodoEditor->width();
3022 h = mTodoEditor->height(); 3036 h = mTodoEditor->height();
3023 mTodoEditor->show(); 3037 mTodoEditor->show();
3024 mTodoEditor->setGeometry(x,y,w,h); 3038 mTodoEditor->setGeometry(x,y,w,h);
3025#else 3039#else
3026 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { 3040 if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) {
3027 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); 3041 topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") );
3028 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); 3042 qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() );
3029 qApp->processEvents(); 3043 qApp->processEvents();
3030 delete mTodoEditor; 3044 delete mTodoEditor;
3031 mTodoEditor = mDialogManager->getTodoEditor(); 3045 mTodoEditor = mDialogManager->getTodoEditor();
3032 topLevelWidget()->setCaption( i18n("") ); 3046 topLevelWidget()->setCaption( i18n("") );
3033 } 3047 }
3034 mTodoEditor->showMaximized(); 3048 mTodoEditor->showMaximized();
3035#endif 3049#endif
3036} 3050}
3037 3051
3038void CalendarView::cloneIncidence() 3052void CalendarView::cloneIncidence()
3039{ 3053{
3040 Incidence *incidence = currentSelection(); 3054 Incidence *incidence = currentSelection();
3041 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3055 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3042 if ( incidence ) { 3056 if ( incidence ) {
3043 cloneIncidence(incidence); 3057 cloneIncidence(incidence);
3044 } 3058 }
3045} 3059}
3046void CalendarView::moveIncidence() 3060void CalendarView::moveIncidence()
3047{ 3061{
3048 Incidence *incidence = currentSelection(); 3062 Incidence *incidence = currentSelection();
3049 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3063 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3050 if ( incidence ) { 3064 if ( incidence ) {
3051 moveIncidence(incidence); 3065 moveIncidence(incidence);
3052 } 3066 }
3053} 3067}
3054void CalendarView::beamIncidence() 3068void CalendarView::beamIncidence()
3055{ 3069{
3056 Incidence *incidence = currentSelection(); 3070 Incidence *incidence = currentSelection();
3057 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3071 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3058 if ( incidence ) { 3072 if ( incidence ) {
3059 beamIncidence(incidence); 3073 beamIncidence(incidence);
3060 } 3074 }
3061} 3075}
3062void CalendarView::toggleCancelIncidence() 3076void CalendarView::toggleCancelIncidence()
3063{ 3077{
3064 Incidence *incidence = currentSelection(); 3078 Incidence *incidence = currentSelection();
3065 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 3079 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
3066 if ( incidence ) { 3080 if ( incidence ) {
3067 cancelIncidence(incidence); 3081 cancelIncidence(incidence);
3068 } 3082 }
3069} 3083}
3070 3084
3071 3085
3072void CalendarView::cancelIncidence(Incidence * inc ) 3086void CalendarView::cancelIncidence(Incidence * inc )
3073{ 3087{
3074 inc->setCancelled( ! inc->cancelled() ); 3088 inc->setCancelled( ! inc->cancelled() );
3075 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 3089 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
3076 updateView(); 3090 updateView();
3077} 3091}
3078void CalendarView::cloneIncidence(Incidence * orgInc ) 3092void CalendarView::cloneIncidence(Incidence * orgInc )
3079{ 3093{
3080 Incidence * newInc = orgInc->clone(); 3094 Incidence * newInc = orgInc->clone();
3081 newInc->recreate(); 3095 newInc->recreate();
3082 3096
3083 if ( newInc->typeID() == todoID ) { 3097 if ( newInc->typeID() == todoID ) {
3084 Todo* t = (Todo*) newInc; 3098 Todo* t = (Todo*) newInc;
3085 bool cloneSub = false; 3099 bool cloneSub = false;
3086 if ( orgInc->relations().count() ) { 3100 if ( orgInc->relations().count() ) {
3087 int result = KMessageBox::warningYesNoCancel(this, 3101 int result = KMessageBox::warningYesNoCancel(this,
3088 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ), 3102 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ),
3089 i18n("Todo has subtodos"), 3103 i18n("Todo has subtodos"),
3090 i18n("Yes"), 3104 i18n("Yes"),
3091 i18n("No")); 3105 i18n("No"));
3092 3106
3093 if ( result == KMessageBox::Cancel ) { 3107 if ( result == KMessageBox::Cancel ) {
3094 delete t; 3108 delete t;
3095 return; 3109 return;
3096 } 3110 }
3097 if (result == KMessageBox::Yes) cloneSub = true; 3111 if (result == KMessageBox::Yes) cloneSub = true;
3098 } 3112 }
3099 showTodoEditor(); 3113 showTodoEditor();
3100 mTodoEditor->editTodo( t ); 3114 mTodoEditor->editTodo( t );
3101 if ( mTodoEditor->exec() ) { 3115 if ( mTodoEditor->exec() ) {
3102 if ( cloneSub ) { 3116 if ( cloneSub ) {
3103 orgInc->cloneRelations( t ); 3117 orgInc->cloneRelations( t );
3104 mCalendar->addIncidenceBranch( t ); 3118 mCalendar->addIncidenceBranch( t );
3105 updateView(); 3119 updateView();
3106 3120
3107 } else { 3121 } else {
3108 mCalendar->addTodo( t ); 3122 mCalendar->addTodo( t );
3109 updateView(); 3123 updateView();
3110 } 3124 }
3111 } else { 3125 } else {
3112 delete t; 3126 delete t;
3113 } 3127 }
3114 } 3128 }
3115 else { 3129 else {
3116 Event* e = (Event*) newInc; 3130 Event* e = (Event*) newInc;
3117 showEventEditor(); 3131 showEventEditor();
3118 mEventEditor->editEvent( e ); 3132 mEventEditor->editEvent( e );
3119 if ( mEventEditor->exec() ) { 3133 if ( mEventEditor->exec() ) {
3120 mCalendar->addEvent( e ); 3134 mCalendar->addEvent( e );
3121 updateView(); 3135 updateView();
3122 } else { 3136 } else {
3123 delete e; 3137 delete e;
3124 } 3138 }
3125 } 3139 }
3126 setActiveWindow(); 3140 setActiveWindow();
3127} 3141}
3128 3142
3129void CalendarView::newEvent() 3143void CalendarView::newEvent()
3130{ 3144{
3131 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 3145 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
3132 KOAgendaView *aView = mViewManager->agendaView(); 3146 KOAgendaView *aView = mViewManager->agendaView();
3133 if (aView) { 3147 if (aView) {
3134 if (aView->selectionStart().isValid()) { 3148 if (aView->selectionStart().isValid()) {
3135 if (aView->selectedIsAllDay()) { 3149 if (aView->selectedIsAllDay()) {
3136 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 3150 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
3137 } else { 3151 } else {
3138 newEvent(aView->selectionStart(),aView->selectionEnd()); 3152 newEvent(aView->selectionStart(),aView->selectionEnd());
3139 } 3153 }
3140 return; 3154 return;
3141 } 3155 }
3142 } 3156 }
3143 3157
3144 QDate date = mNavigator->selectedDates().first(); 3158 QDate date = mNavigator->selectedDates().first();
3145 QDateTime current = QDateTime::currentDateTime(); 3159 QDateTime current = QDateTime::currentDateTime();
3146 if ( date <= current.date() ) { 3160 if ( date <= current.date() ) {
3147 int hour = current.time().hour() +1; 3161 int hour = current.time().hour() +1;
3148 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 3162 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
3149 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3163 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3150 } else 3164 } else
3151 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 3165 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
3152 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 3166 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
3153 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 3167 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
3154} 3168}
3155 3169
3156void CalendarView::newEvent(QDateTime fh) 3170void CalendarView::newEvent(QDateTime fh)
3157{ 3171{
3158 newEvent(fh, 3172 newEvent(fh,
3159 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 3173 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
3160} 3174}
3161 3175
3162void CalendarView::newEvent(QDate dt) 3176void CalendarView::newEvent(QDate dt)
3163{ 3177{
3164 newEvent(QDateTime(dt, QTime(0,0,0)), 3178 newEvent(QDateTime(dt, QTime(0,0,0)),
3165 QDateTime(dt, QTime(0,0,0)), true); 3179 QDateTime(dt, QTime(0,0,0)), true);
3166} 3180}
3167void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) 3181void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint)
3168{ 3182{
3169 newEvent(fromHint, toHint, false); 3183 newEvent(fromHint, toHint, false);
3170} 3184}
3171void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 3185void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
3172{ 3186{
3173 3187
3174 showEventEditor(); 3188 showEventEditor();
3175 mEventEditor->newEvent(fromHint,toHint,allDay); 3189 mEventEditor->newEvent(fromHint,toHint,allDay);
3176 if ( mFilterView->filtersEnabled() ) { 3190 if ( mFilterView->filtersEnabled() ) {
3177 CalFilter *filter = mFilterView->selectedFilter(); 3191 CalFilter *filter = mFilterView->selectedFilter();
3178 if (filter && filter->showCategories()) { 3192 if (filter && filter->showCategories()) {
3179 mEventEditor->setCategories(filter->categoryList().join(",") ); 3193 mEventEditor->setCategories(filter->categoryList().join(",") );
3180 } 3194 }
3181 if ( filter ) 3195 if ( filter )
3182 mEventEditor->setSecrecy( filter->getSecrecy() ); 3196 mEventEditor->setSecrecy( filter->getSecrecy() );
3183 } 3197 }
3184 mEventEditor->exec(); 3198 mEventEditor->exec();
3185 setActiveWindow(); 3199 setActiveWindow();
3186} 3200}
3187void CalendarView::todoAdded(Todo * t) 3201void CalendarView::todoAdded(Todo * t)
3188{ 3202{
3189 3203
3190 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 3204 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
3191 updateTodoViews(); 3205 updateTodoViews();
3192} 3206}
3193void CalendarView::todoChanged(Todo * t) 3207void CalendarView::todoChanged(Todo * t)
3194{ 3208{
3195 emit todoModified( t, 4 ); 3209 emit todoModified( t, 4 );
3196 // updateTodoViews(); 3210 // updateTodoViews();
3197} 3211}
3198void CalendarView::todoToBeDeleted(Todo *) 3212void CalendarView::todoToBeDeleted(Todo *)
3199{ 3213{
3200 //qDebug("todoToBeDeleted(Todo *) "); 3214 //qDebug("todoToBeDeleted(Todo *) ");
3201 updateTodoViews(); 3215 updateTodoViews();
3202} 3216}
3203void CalendarView::todoDeleted() 3217void CalendarView::todoDeleted()
3204{ 3218{
3205 //qDebug(" todoDeleted()"); 3219 //qDebug(" todoDeleted()");
3206 updateTodoViews(); 3220 updateTodoViews();
3207} 3221}
3208 3222
3209 3223
3210void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) 3224void CalendarView::newTodoDateTime( QDateTime dt, bool allday )
3211{ 3225{
3212 showTodoEditor(); 3226 showTodoEditor();
3213 mTodoEditor->newTodo(dt,0,allday); 3227 mTodoEditor->newTodo(dt,0,allday);
3214 if ( mFilterView->filtersEnabled() ) { 3228 if ( mFilterView->filtersEnabled() ) {
3215 CalFilter *filter = mFilterView->selectedFilter(); 3229 CalFilter *filter = mFilterView->selectedFilter();
3216 if (filter && filter->showCategories()) { 3230 if (filter && filter->showCategories()) {
3217 mTodoEditor->setCategories(filter->categoryList().join(",") ); 3231 mTodoEditor->setCategories(filter->categoryList().join(",") );
3218 } 3232 }
3219 if ( filter ) 3233 if ( filter )
3220 mTodoEditor->setSecrecy( filter->getSecrecy() ); 3234 mTodoEditor->setSecrecy( filter->getSecrecy() );
3221 } 3235 }
3222 mTodoEditor->exec(); 3236 mTodoEditor->exec();
3223 setActiveWindow(); 3237 setActiveWindow();
3224} 3238}
3225 3239
3226void CalendarView::newTodo() 3240void CalendarView::newTodo()
3227{ 3241{
3228 newTodoDateTime( QDateTime(),true ); 3242 newTodoDateTime( QDateTime(),true );
3229} 3243}
3230 3244
3231void CalendarView::newSubTodo() 3245void CalendarView::newSubTodo()
3232{ 3246{
3233 Todo *todo = selectedTodo(); 3247 Todo *todo = selectedTodo();
3234 if ( todo ) newSubTodo( todo ); 3248 if ( todo ) newSubTodo( todo );
3235} 3249}
3236 3250
3237void CalendarView::newSubTodo(Todo *parentEvent) 3251void CalendarView::newSubTodo(Todo *parentEvent)
3238{ 3252{
3239 3253
3240 showTodoEditor(); 3254 showTodoEditor();
3241 mTodoEditor->newTodo(QDateTime(),parentEvent,true); 3255 mTodoEditor->newTodo(QDateTime(),parentEvent,true);
3242 mTodoEditor->exec(); 3256 mTodoEditor->exec();
3243 setActiveWindow(); 3257 setActiveWindow();
3244} 3258}
3245 3259
3246void CalendarView::newFloatingEvent() 3260void CalendarView::newFloatingEvent()
3247{ 3261{
3248 DateList tmpList = mNavigator->selectedDates(); 3262 DateList tmpList = mNavigator->selectedDates();
3249 QDate date = tmpList.first(); 3263 QDate date = tmpList.first();
3250 3264
3251 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 3265 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
3252 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 3266 QDateTime( date, QTime( 12, 0, 0 ) ), true );
3253} 3267}
3254 3268
3255 3269
3256void CalendarView::editEvent( Event *event ) 3270void CalendarView::editEvent( Event *event )
3257{ 3271{
3258 3272
3259 if ( !event ) return; 3273 if ( !event ) return;
3260 if ( event->isReadOnly() ) { 3274 if ( event->isReadOnly() ) {
3261 showEvent( event ); 3275 showEvent( event );
3262 return; 3276 return;
3263 } 3277 }
3264 showEventEditor(); 3278 showEventEditor();
3265 mEventEditor->editEvent( event , mFlagEditDescription); 3279 mEventEditor->editEvent( event , mFlagEditDescription);
3266 mEventEditor->exec(); 3280 mEventEditor->exec();
3267 setActiveWindow(); 3281 setActiveWindow();
3268 3282
3269} 3283}
3270void CalendarView::editJournal( Journal *jour ) 3284void CalendarView::editJournal( Journal *jour )
3271{ 3285{
3272 if ( !jour ) return; 3286 if ( !jour ) return;
3273 mDialogManager->hideSearchDialog(); 3287 mDialogManager->hideSearchDialog();
3274 mViewManager->showJournalView(); 3288 mViewManager->showJournalView();
3275 mNavigator->slotDaySelect( jour->dtStart().date() ); 3289 mNavigator->slotDaySelect( jour->dtStart().date() );
3276} 3290}
3277void CalendarView::editTodo( Todo *todo ) 3291void CalendarView::editTodo( Todo *todo )
3278{ 3292{
3279 if ( !todo ) return; 3293 if ( !todo ) return;
3280 3294
3281 if ( todo->isReadOnly() ) { 3295 if ( todo->isReadOnly() ) {
3282 showTodo( todo ); 3296 showTodo( todo );
3283 return; 3297 return;
3284 } 3298 }
3285 showTodoEditor(); 3299 showTodoEditor();
3286 mTodoEditor->editTodo( todo ,mFlagEditDescription); 3300 mTodoEditor->editTodo( todo ,mFlagEditDescription);
3287 mTodoEditor->exec(); 3301 mTodoEditor->exec();
3288 setActiveWindow(); 3302 setActiveWindow();
3289 3303
3290} 3304}
3291 3305
3292KOEventViewerDialog* CalendarView::getEventViewerDialog() 3306KOEventViewerDialog* CalendarView::getEventViewerDialog()
3293{ 3307{
3294 if ( !mEventViewerDialog ) { 3308 if ( !mEventViewerDialog ) {
3295 mEventViewerDialog = new KOEventViewerDialog(0); 3309 mEventViewerDialog = new KOEventViewerDialog(0);
3296 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 3310 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
3297 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 3311 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
3298 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 3312 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
3299 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 3313 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
3300 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 3314 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
3301 viewManager(), SLOT( showAgendaView( bool ) ) ); 3315 viewManager(), SLOT( showAgendaView( bool ) ) );
3302 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), 3316 connect( mEventViewerDialog, SIGNAL(signalViewerClosed()),
3303 this, SLOT( slotViewerClosed() ) ); 3317 this, SLOT( slotViewerClosed() ) );
3304 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), 3318 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
3305 this, SLOT( todoChanged(Todo *) ) ); 3319 this, SLOT( todoChanged(Todo *) ) );
3306 mEventViewerDialog->resize( 640, 480 ); 3320 mEventViewerDialog->resize( 640, 480 );
3307 3321
3308 } 3322 }
3309 return mEventViewerDialog; 3323 return mEventViewerDialog;
3310} 3324}
3311void CalendarView::showEvent(Event *event) 3325void CalendarView::showEvent(Event *event)
3312{ 3326{
3313 getEventViewerDialog()->setEvent(event); 3327 getEventViewerDialog()->setEvent(event);
3314 getEventViewerDialog()->showMe(); 3328 getEventViewerDialog()->showMe();
3315} 3329}
3316 3330
3317void CalendarView::showTodo(Todo *event) 3331void CalendarView::showTodo(Todo *event)
3318{ 3332{
3319 getEventViewerDialog()->setTodo(event); 3333 getEventViewerDialog()->setTodo(event);
3320 getEventViewerDialog()->showMe(); 3334 getEventViewerDialog()->showMe();
3321} 3335}
3322void CalendarView::showJournal( Journal *jour ) 3336void CalendarView::showJournal( Journal *jour )
3323{ 3337{
3324 getEventViewerDialog()->setJournal(jour); 3338 getEventViewerDialog()->setJournal(jour);
3325 getEventViewerDialog()->showMe(); 3339 getEventViewerDialog()->showMe();
3326 3340
3327} 3341}
3328// void CalendarView::todoModified (Todo *event, int changed) 3342// void CalendarView::todoModified (Todo *event, int changed)
3329// { 3343// {
3330// // if (mDialogList.find (event) != mDialogList.end ()) { 3344// // if (mDialogList.find (event) != mDialogList.end ()) {
3331// // kdDebug() << "Todo modified and open" << endl; 3345// // kdDebug() << "Todo modified and open" << endl;
3332// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; 3346// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event];
3333// // temp->modified (changed); 3347// // temp->modified (changed);
3334 3348
3335// // } 3349// // }
3336 3350
3337// mViewManager->updateView(); 3351// mViewManager->updateView();
3338// } 3352// }
3339 3353
3340void CalendarView::appointment_show() 3354void CalendarView::appointment_show()
3341{ 3355{
3342 Event *anEvent = 0; 3356 Event *anEvent = 0;
3343 3357
3344 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3358 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3345 3359
3346 if (mViewManager->currentView()->isEventView()) { 3360 if (mViewManager->currentView()->isEventView()) {
3347 if ( incidence && incidence->typeID() == eventID ) { 3361 if ( incidence && incidence->typeID() == eventID ) {
3348 anEvent = static_cast<Event *>(incidence); 3362 anEvent = static_cast<Event *>(incidence);
3349 } 3363 }
3350 } 3364 }
3351 3365
3352 if (!anEvent) { 3366 if (!anEvent) {
3353 KNotifyClient::beep(); 3367 KNotifyClient::beep();
3354 return; 3368 return;
3355 } 3369 }
3356 3370
3357 showEvent(anEvent); 3371 showEvent(anEvent);
3358} 3372}
3359 3373
3360void CalendarView::appointment_edit() 3374void CalendarView::appointment_edit()
3361{ 3375{
3362 Event *anEvent = 0; 3376 Event *anEvent = 0;
3363 3377
3364 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3378 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3365 3379
3366 if (mViewManager->currentView()->isEventView()) { 3380 if (mViewManager->currentView()->isEventView()) {
3367 if ( incidence && incidence->typeID() == eventID ) { 3381 if ( incidence && incidence->typeID() == eventID ) {
3368 anEvent = static_cast<Event *>(incidence); 3382 anEvent = static_cast<Event *>(incidence);
3369 } 3383 }
3370 } 3384 }
3371 3385
3372 if (!anEvent) { 3386 if (!anEvent) {
3373 KNotifyClient::beep(); 3387 KNotifyClient::beep();
3374 return; 3388 return;
3375 } 3389 }
3376 3390
3377 editEvent(anEvent); 3391 editEvent(anEvent);
3378} 3392}
3379 3393
3380void CalendarView::appointment_delete() 3394void CalendarView::appointment_delete()
3381{ 3395{
3382 Event *anEvent = 0; 3396 Event *anEvent = 0;
3383 3397
3384 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3398 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3385 3399
3386 if (mViewManager->currentView()->isEventView()) { 3400 if (mViewManager->currentView()->isEventView()) {
3387 if ( incidence && incidence->typeID() == eventID ) { 3401 if ( incidence && incidence->typeID() == eventID ) {
3388 anEvent = static_cast<Event *>(incidence); 3402 anEvent = static_cast<Event *>(incidence);
3389 } 3403 }
3390 } 3404 }
3391 3405
3392 if (!anEvent) { 3406 if (!anEvent) {
3393 KNotifyClient::beep(); 3407 KNotifyClient::beep();
3394 return; 3408 return;
3395 } 3409 }
3396 3410
3397 deleteEvent(anEvent); 3411 deleteEvent(anEvent);
3398} 3412}
3399 3413
3400void CalendarView::todo_resub( Todo * parent, Todo * sub ) 3414void CalendarView::todo_resub( Todo * parent, Todo * sub )
3401{ 3415{
3402 if (!sub) return; 3416 if (!sub) return;
3403 if ( sub->relatedTo() == parent ) 3417 if ( sub->relatedTo() == parent )
3404 return; 3418 return;
3405 sub->setRelatedTo(parent); 3419 sub->setRelatedTo(parent);
3406 sub->updated(); 3420 sub->updated();
3407 setModified(true); 3421 setModified(true);
3408 updateView(); 3422 updateView();
3409} 3423}
3410void CalendarView::todo_unsub(Todo *anTodo ) 3424void CalendarView::todo_unsub(Todo *anTodo )
3411{ 3425{
3412 todo_resub( 0, anTodo ); 3426 todo_resub( 0, anTodo );
3413} 3427}
3414 3428
3415void CalendarView::deleteTodo(Todo *todo) 3429void CalendarView::deleteTodo(Todo *todo)
3416{ 3430{
3417 if (!todo) { 3431 if (!todo) {
3418 KNotifyClient::beep(); 3432 KNotifyClient::beep();
3419 return; 3433 return;
3420 } 3434 }
3421 if (KOPrefs::instance()->mConfirm) { 3435 if (KOPrefs::instance()->mConfirm) {
3422 QString text = todo->summary().left(20); 3436 QString text = todo->summary().left(20);
3423 if (!todo->relations().isEmpty()) { 3437 if (!todo->relations().isEmpty()) {
3424 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); 3438 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
3425 3439
3426 } 3440 }
3427 switch (msgItemDelete(text)) { 3441 switch (msgItemDelete(text)) {
3428 case KMessageBox::Continue: // OK 3442 case KMessageBox::Continue: // OK
3429 bool deleteT = false; 3443 bool deleteT = false;
3430 if (!todo->relations().isEmpty()) { 3444 if (!todo->relations().isEmpty()) {
3431 deleteT = removeCompletedSubTodos( todo ); 3445 deleteT = removeCompletedSubTodos( todo );
3432 } 3446 }
3433 // deleteT == true: todo already deleted in removeCompletedSubTodos 3447 // deleteT == true: todo already deleted in removeCompletedSubTodos
3434 if ( !deleteT ) { 3448 if ( !deleteT ) {
3435 checkExternalId( todo ); 3449 checkExternalId( todo );
3436 calendar()->deleteTodo(todo); 3450 calendar()->deleteTodo(todo);
3437 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 3451 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
3438 updateView(); 3452 updateView();
3439 } 3453 }
3440 break; 3454 break;
3441 } // switch 3455 } // switch
3442 } else { 3456 } else {
3443 checkExternalId( todo ); 3457 checkExternalId( todo );
3444 mCalendar->deleteTodo(todo); 3458 mCalendar->deleteTodo(todo);
3445 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 3459 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
3446 updateView(); 3460 updateView();
3447 } 3461 }
3448 3462
3449 emit updateSearchDialog(); 3463 emit updateSearchDialog();
3450} 3464}
3451void CalendarView::deleteJournal(Journal *jour) 3465void CalendarView::deleteJournal(Journal *jour)
3452{ 3466{
3453 if (!jour) { 3467 if (!jour) {
3454 KNotifyClient::beep(); 3468 KNotifyClient::beep();
3455 return; 3469 return;
3456 } 3470 }
3457 if (KOPrefs::instance()->mConfirm) { 3471 if (KOPrefs::instance()->mConfirm) {
3458 switch (msgItemDelete( jour->description().left(20))) { 3472 switch (msgItemDelete( jour->description().left(20))) {
3459 case KMessageBox::Continue: // OK 3473 case KMessageBox::Continue: // OK
3460 calendar()->deleteJournal(jour); 3474 calendar()->deleteJournal(jour);
3461 updateView(); 3475 updateView();
3462 break; 3476 break;
3463 } // switch 3477 } // switch
3464 } else { 3478 } else {
3465 calendar()->deleteJournal(jour);; 3479 calendar()->deleteJournal(jour);;
3466 updateView(); 3480 updateView();
3467 } 3481 }
3468 emit updateSearchDialog(); 3482 emit updateSearchDialog();
3469} 3483}
3470 3484
3471void CalendarView::deleteEvent(Event *anEvent) 3485void CalendarView::deleteEvent(Event *anEvent)
3472{ 3486{
3473 if (!anEvent) { 3487 if (!anEvent) {
3474 KNotifyClient::beep(); 3488 KNotifyClient::beep();
3475 return; 3489 return;
3476 } 3490 }
3477 3491
3478 if (anEvent->recurrence()->doesRecur()) { 3492 if (anEvent->recurrence()->doesRecur()) {
3479 QDate itemDate = mViewManager->currentSelectionDate(); 3493 QDate itemDate = mViewManager->currentSelectionDate();
3480 int km; 3494 int km;
3481 if (!itemDate.isValid()) { 3495 if (!itemDate.isValid()) {
3482 //kdDebug() << "Date Not Valid" << endl; 3496 //kdDebug() << "Date Not Valid" << endl;
3483 if (KOPrefs::instance()->mConfirm) { 3497 if (KOPrefs::instance()->mConfirm) {
3484 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 3498 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
3485 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 3499 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
3486 i18n("KO/Pi Confirmation"),i18n("Delete All")); 3500 i18n("KO/Pi Confirmation"),i18n("Delete All"));
3487 if ( km == KMessageBox::Continue ) 3501 if ( km == KMessageBox::Continue )
3488 km = KMessageBox::No; // No = all below 3502 km = KMessageBox::No; // No = all below
3489 } else 3503 } else
3490 km = KMessageBox::No; 3504 km = KMessageBox::No;
3491 } else { 3505 } else {
3492 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + 3506 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) +
3493 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 3507 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
3494 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), 3508 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
3495 i18n("KO/Pi Confirmation"),i18n("Current"), 3509 i18n("KO/Pi Confirmation"),i18n("Current"),
3496 i18n("All")); 3510 i18n("All"));
3497 } 3511 }
3498 switch(km) { 3512 switch(km) {
3499 3513
3500 case KMessageBox::No: // Continue // all 3514 case KMessageBox::No: // Continue // all
3501 //qDebug("KMessageBox::No "); 3515 //qDebug("KMessageBox::No ");
3502 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3516 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3503 schedule(Scheduler::Cancel,anEvent); 3517 schedule(Scheduler::Cancel,anEvent);
3504 3518
3505 checkExternalId( anEvent); 3519 checkExternalId( anEvent);
3506 mCalendar->deleteEvent(anEvent); 3520 mCalendar->deleteEvent(anEvent);
3507 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); 3521 changeEventDisplay(anEvent,KOGlobals::EVENTDELETED);
3508 break; 3522 break;
3509 3523
3510 // Disabled because it does not work 3524 // Disabled because it does not work
3511 //#if 0 3525 //#if 0
3512 case KMessageBox::Yes: // just this one 3526 case KMessageBox::Yes: // just this one
3513 //QDate qd = mNavigator->selectedDates().first(); 3527 //QDate qd = mNavigator->selectedDates().first();
3514 //if (!qd.isValid()) { 3528 //if (!qd.isValid()) {
3515 // kdDebug() << "no date selected, or invalid date" << endl; 3529 // kdDebug() << "no date selected, or invalid date" << endl;
3516 // KNotifyClient::beep(); 3530 // KNotifyClient::beep();
3517 // return; 3531 // return;
3518 //} 3532 //}
3519 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); 3533 //while (!anEvent->recursOn(qd)) qd = qd.addDays(1);
3520 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { 3534 if (itemDate!=QDate(1,1,1) || itemDate.isValid()) {
3521 anEvent->addExDate(itemDate); 3535 anEvent->addExDate(itemDate);
3522 int duration = anEvent->recurrence()->duration(); 3536 int duration = anEvent->recurrence()->duration();
3523 if ( duration > 0 ) { 3537 if ( duration > 0 ) {
3524 anEvent->recurrence()->setDuration( duration - 1 ); 3538 anEvent->recurrence()->setDuration( duration - 1 );
3525 } 3539 }
3526 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); 3540 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
3527 } 3541 }
3528 break; 3542 break;
3529 //#endif 3543 //#endif
3530 } // switch 3544 } // switch
3531 } else { 3545 } else {
3532 if (KOPrefs::instance()->mConfirm) { 3546 if (KOPrefs::instance()->mConfirm) {
3533 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 3547 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
3534 i18n("\nAre you sure you want\nto delete this event?"), 3548 i18n("\nAre you sure you want\nto delete this event?"),
3535 i18n("KO/Pi Confirmation"),i18n("Delete"))) { 3549 i18n("KO/Pi Confirmation"),i18n("Delete"))) {
3536 case KMessageBox::Continue: // OK 3550 case KMessageBox::Continue: // OK
3537 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3551 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3538 schedule(Scheduler::Cancel,anEvent); 3552 schedule(Scheduler::Cancel,anEvent);
3539 checkExternalId( anEvent); 3553 checkExternalId( anEvent);
3540 mCalendar->deleteEvent(anEvent); 3554 mCalendar->deleteEvent(anEvent);
3541 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3555 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3542 break; 3556 break;
3543 } // switch 3557 } // switch
3544 } else { 3558 } else {
3545 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3559 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3546 schedule(Scheduler::Cancel,anEvent); 3560 schedule(Scheduler::Cancel,anEvent);
3547 checkExternalId( anEvent); 3561 checkExternalId( anEvent);
3548 mCalendar->deleteEvent(anEvent); 3562 mCalendar->deleteEvent(anEvent);
3549 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3563 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3550 } 3564 }
3551 } // if-else 3565 } // if-else
3552 emit updateSearchDialog(); 3566 emit updateSearchDialog();
3553} 3567}
3554 3568
3555bool CalendarView::deleteEvent(const QString &uid) 3569bool CalendarView::deleteEvent(const QString &uid)
3556{ 3570{
3557 Event *ev = mCalendar->event(uid); 3571 Event *ev = mCalendar->event(uid);
3558 if (ev) { 3572 if (ev) {
3559 deleteEvent(ev); 3573 deleteEvent(ev);
3560 return true; 3574 return true;
3561 } else { 3575 } else {
3562 return false; 3576 return false;
3563 } 3577 }
3564} 3578}
3565 3579
3566/*****************************************************************************/ 3580/*****************************************************************************/
3567 3581
3568void CalendarView::action_mail() 3582void CalendarView::action_mail()
3569{ 3583{
3570#ifndef KORG_NOMAIL 3584#ifndef KORG_NOMAIL
3571 KOMailClient mailClient; 3585 KOMailClient mailClient;
3572 3586
3573 Incidence *incidence = currentSelection(); 3587 Incidence *incidence = currentSelection();
3574 3588
3575 if (!incidence) { 3589 if (!incidence) {
3576 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3590 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3577 return; 3591 return;
3578 } 3592 }
3579 if(incidence->attendeeCount() == 0 ) { 3593 if(incidence->attendeeCount() == 0 ) {
3580 KMessageBox::sorry(this, 3594 KMessageBox::sorry(this,
3581 i18n("Can't generate mail:\nNo attendees defined.\n")); 3595 i18n("Can't generate mail:\nNo attendees defined.\n"));
3582 return; 3596 return;
3583 } 3597 }
3584 3598
3585 CalendarLocal cal_tmp; 3599 CalendarLocal cal_tmp;
3586 Event *event = 0; 3600 Event *event = 0;
3587 Event *ev = 0; 3601 Event *ev = 0;
3588 if ( incidence && incidence->typeID() == eventID ) { 3602 if ( incidence && incidence->typeID() == eventID ) {
3589 event = static_cast<Event *>(incidence); 3603 event = static_cast<Event *>(incidence);
3590 ev = new Event(*event); 3604 ev = new Event(*event);
3591 cal_tmp.addEvent(ev); 3605 cal_tmp.addEvent(ev);
3592 } 3606 }
3593 ICalFormat mForm(); 3607 ICalFormat mForm();
3594 QString attachment = mForm.toString( &cal_tmp ); 3608 QString attachment = mForm.toString( &cal_tmp );
3595 if (ev) delete(ev); 3609 if (ev) delete(ev);
3596 3610
3597 mailClient.mailAttendees(currentSelection(), attachment); 3611 mailClient.mailAttendees(currentSelection(), attachment);
3598 3612
3599#endif 3613#endif
3600 3614
3601#if 0 3615#if 0
3602 Event *anEvent = 0; 3616 Event *anEvent = 0;
3603 if (mViewManager->currentView()->isEventView()) { 3617 if (mViewManager->currentView()->isEventView()) {
3604 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); 3618 anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first());
3605 } 3619 }
3606 3620
3607 if (!anEvent) { 3621 if (!anEvent) {
3608 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); 3622 KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected."));
3609 return; 3623 return;
3610 } 3624 }
3611 if(anEvent->attendeeCount() == 0 ) { 3625 if(anEvent->attendeeCount() == 0 ) {
3612 KMessageBox::sorry(this, 3626 KMessageBox::sorry(this,
3613 i18n("Can't generate mail:\nNo attendees defined.\n")); 3627 i18n("Can't generate mail:\nNo attendees defined.\n"));
3614 return; 3628 return;
3615 } 3629 }
3616 3630
3617 mailobject.emailEvent(anEvent); 3631 mailobject.emailEvent(anEvent);
3618#endif 3632#endif
3619} 3633}
3620 3634
3621 3635
3622void CalendarView::schedule_publish(Incidence *incidence) 3636void CalendarView::schedule_publish(Incidence *incidence)
3623{ 3637{
3624 Event *event = 0; 3638 Event *event = 0;
3625 Todo *todo = 0; 3639 Todo *todo = 0;
3626 3640
3627 if (incidence == 0) { 3641 if (incidence == 0) {
3628 incidence = mViewManager->currentView()->selectedIncidences().first(); 3642 incidence = mViewManager->currentView()->selectedIncidences().first();
3629 if (incidence == 0) { 3643 if (incidence == 0) {
3630 incidence = mTodoList->selectedIncidences().first(); 3644 incidence = mTodoList->selectedIncidences().first();
3631 } 3645 }
3632 } 3646 }
3633 if ( incidence && incidence->typeID() == eventID ) { 3647 if ( incidence && incidence->typeID() == eventID ) {
3634 event = static_cast<Event *>(incidence); 3648 event = static_cast<Event *>(incidence);
3635 } else { 3649 } else {
3636 if ( incidence && incidence->typeID() == todoID ) { 3650 if ( incidence && incidence->typeID() == todoID ) {
3637 todo = static_cast<Todo *>(incidence); 3651 todo = static_cast<Todo *>(incidence);
3638 } 3652 }
3639 } 3653 }
3640 3654
3641 if (!event && !todo) { 3655 if (!event && !todo) {
3642 KMessageBox::sorry(this,i18n("No event selected.")); 3656 KMessageBox::sorry(this,i18n("No event selected."));
3643 return; 3657 return;
3644 } 3658 }
3645 3659
3646 PublishDialog *publishdlg = new PublishDialog(); 3660 PublishDialog *publishdlg = new PublishDialog();
3647 if (incidence->attendeeCount()>0) { 3661 if (incidence->attendeeCount()>0) {
3648 QPtrList<Attendee> attendees = incidence->attendees(); 3662 QPtrList<Attendee> attendees = incidence->attendees();
3649 attendees.first(); 3663 attendees.first();
3650 while ( attendees.current()!=0 ) { 3664 while ( attendees.current()!=0 ) {
3651 publishdlg->addAttendee(attendees.current()); 3665 publishdlg->addAttendee(attendees.current());
3652 attendees.next(); 3666 attendees.next();
3653 } 3667 }
3654 } 3668 }
3655 bool send = true; 3669 bool send = true;
3656 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { 3670 if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) {
3657 if ( publishdlg->exec() != QDialog::Accepted ) 3671 if ( publishdlg->exec() != QDialog::Accepted )
3658 send = false; 3672 send = false;
3659 } 3673 }
3660 if ( send ) { 3674 if ( send ) {
3661 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3675 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3662 if ( event ) { 3676 if ( event ) {
3663 Event *ev = new Event(*event); 3677 Event *ev = new Event(*event);
3664 ev->registerObserver(0); 3678 ev->registerObserver(0);
3665 ev->clearAttendees(); 3679 ev->clearAttendees();
3666 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3680 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3667 delete(ev); 3681 delete(ev);
3668 } 3682 }
3669 } else { 3683 } else {
3670 if ( todo ) { 3684 if ( todo ) {
3671 Todo *ev = new Todo(*todo); 3685 Todo *ev = new Todo(*todo);
3672 ev->registerObserver(0); 3686 ev->registerObserver(0);
3673 ev->clearAttendees(); 3687 ev->clearAttendees();
3674 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { 3688 if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) {
3675 delete(ev); 3689 delete(ev);
3676 } 3690 }
3677 } 3691 }
3678 } 3692 }
3679 } 3693 }
3680 delete publishdlg; 3694 delete publishdlg;
3681} 3695}
3682 3696
3683void CalendarView::schedule_request(Incidence *incidence) 3697void CalendarView::schedule_request(Incidence *incidence)
3684{ 3698{
3685 schedule(Scheduler::Request,incidence); 3699 schedule(Scheduler::Request,incidence);
3686} 3700}
3687 3701
3688void CalendarView::schedule_refresh(Incidence *incidence) 3702void CalendarView::schedule_refresh(Incidence *incidence)
3689{ 3703{
3690 schedule(Scheduler::Refresh,incidence); 3704 schedule(Scheduler::Refresh,incidence);
3691} 3705}
3692 3706
3693void CalendarView::schedule_cancel(Incidence *incidence) 3707void CalendarView::schedule_cancel(Incidence *incidence)
3694{ 3708{
3695 schedule(Scheduler::Cancel,incidence); 3709 schedule(Scheduler::Cancel,incidence);
3696} 3710}
3697 3711
3698void CalendarView::schedule_add(Incidence *incidence) 3712void CalendarView::schedule_add(Incidence *incidence)
3699{ 3713{
3700 schedule(Scheduler::Add,incidence); 3714 schedule(Scheduler::Add,incidence);
3701} 3715}
3702 3716
3703void CalendarView::schedule_reply(Incidence *incidence) 3717void CalendarView::schedule_reply(Incidence *incidence)
3704{ 3718{
3705 schedule(Scheduler::Reply,incidence); 3719 schedule(Scheduler::Reply,incidence);
3706} 3720}
3707 3721
3708void CalendarView::schedule_counter(Incidence *incidence) 3722void CalendarView::schedule_counter(Incidence *incidence)
3709{ 3723{
3710 schedule(Scheduler::Counter,incidence); 3724 schedule(Scheduler::Counter,incidence);
3711} 3725}
3712 3726
3713void CalendarView::schedule_declinecounter(Incidence *incidence) 3727void CalendarView::schedule_declinecounter(Incidence *incidence)
3714{ 3728{
3715 schedule(Scheduler::Declinecounter,incidence); 3729 schedule(Scheduler::Declinecounter,incidence);
3716} 3730}
3717 3731
3718void CalendarView::schedule_publish_freebusy(int daysToPublish) 3732void CalendarView::schedule_publish_freebusy(int daysToPublish)
3719{ 3733{
3720 QDateTime start = QDateTime::currentDateTime(); 3734 QDateTime start = QDateTime::currentDateTime();
3721 QDateTime end = start.addDays(daysToPublish); 3735 QDateTime end = start.addDays(daysToPublish);
3722 3736
3723 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); 3737 FreeBusy *freebusy = new FreeBusy(mCalendar, start, end);
3724 freebusy->setOrganizer(KOPrefs::instance()->email()); 3738 freebusy->setOrganizer(KOPrefs::instance()->email());
3725 3739
3726 3740
3727 PublishDialog *publishdlg = new PublishDialog(); 3741 PublishDialog *publishdlg = new PublishDialog();
3728 if ( publishdlg->exec() == QDialog::Accepted ) { 3742 if ( publishdlg->exec() == QDialog::Accepted ) {
3729 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3743 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3730 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { 3744 if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) {
3731 delete(freebusy); 3745 delete(freebusy);
3732 } 3746 }
3733 } 3747 }
3734 delete publishdlg; 3748 delete publishdlg;
3735} 3749}
3736 3750
3737void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) 3751void CalendarView::schedule(Scheduler::Method method, Incidence *incidence)
3738{ 3752{
3739 Event *event = 0; 3753 Event *event = 0;
3740 Todo *todo = 0; 3754 Todo *todo = 0;
3741 3755
3742 if (incidence == 0) { 3756 if (incidence == 0) {
3743 incidence = mViewManager->currentView()->selectedIncidences().first(); 3757 incidence = mViewManager->currentView()->selectedIncidences().first();
3744 if (incidence == 0) { 3758 if (incidence == 0) {
3745 incidence = mTodoList->selectedIncidences().first(); 3759 incidence = mTodoList->selectedIncidences().first();
3746 } 3760 }
3747 } 3761 }
3748 if ( incidence && incidence->typeID() == eventID ) { 3762 if ( incidence && incidence->typeID() == eventID ) {
3749 event = static_cast<Event *>(incidence); 3763 event = static_cast<Event *>(incidence);
3750 } 3764 }
3751 if ( incidence && incidence->typeID() == todoID ) { 3765 if ( incidence && incidence->typeID() == todoID ) {
3752 todo = static_cast<Todo *>(incidence); 3766 todo = static_cast<Todo *>(incidence);
3753 } 3767 }
3754 3768
3755 if (!event && !todo) { 3769 if (!event && !todo) {
3756 KMessageBox::sorry(this,i18n("No event selected.")); 3770 KMessageBox::sorry(this,i18n("No event selected."));
3757 return; 3771 return;
3758 } 3772 }
3759 3773
3760 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { 3774 if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) {
3761 KMessageBox::sorry(this,i18n("The event has no attendees.")); 3775 KMessageBox::sorry(this,i18n("The event has no attendees."));
3762 return; 3776 return;
3763 } 3777 }
3764 3778
3765 Event *ev = 0; 3779 Event *ev = 0;
3766 if (event) ev = new Event(*event); 3780 if (event) ev = new Event(*event);
3767 Todo *to = 0; 3781 Todo *to = 0;
3768 if (todo) to = new Todo(*todo); 3782 if (todo) to = new Todo(*todo);
3769 3783
3770 if (method == Scheduler::Reply || method == Scheduler::Refresh) { 3784 if (method == Scheduler::Reply || method == Scheduler::Refresh) {
3771 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 3785 Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
3772 if (!me) { 3786 if (!me) {
3773 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); 3787 KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails."));
3774 return; 3788 return;
3775 } 3789 }
3776 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { 3790 if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) {
3777 StatusDialog *statdlg = new StatusDialog(this); 3791 StatusDialog *statdlg = new StatusDialog(this);
3778 if (!statdlg->exec()==QDialog::Accepted) return; 3792 if (!statdlg->exec()==QDialog::Accepted) return;
3779 me->setStatus( statdlg->status() ); 3793 me->setStatus( statdlg->status() );
3780 delete(statdlg); 3794 delete(statdlg);
3781 } 3795 }
3782 Attendee *menew = new Attendee(*me); 3796 Attendee *menew = new Attendee(*me);
3783 if (ev) { 3797 if (ev) {
3784 ev->clearAttendees(); 3798 ev->clearAttendees();
3785 ev->addAttendee(menew,false); 3799 ev->addAttendee(menew,false);
3786 } else { 3800 } else {
3787 if (to) { 3801 if (to) {
3788 todo->clearAttendees(); 3802 todo->clearAttendees();
3789 todo->addAttendee(menew,false); 3803 todo->addAttendee(menew,false);
3790 } 3804 }
3791 } 3805 }
3792 } 3806 }
3793 3807
3794 OutgoingDialog *dlg = mDialogManager->outgoingDialog(); 3808 OutgoingDialog *dlg = mDialogManager->outgoingDialog();
3795 if (ev) { 3809 if (ev) {
3796 if ( !dlg->addMessage(ev,method) ) delete(ev); 3810 if ( !dlg->addMessage(ev,method) ) delete(ev);
3797 } else { 3811 } else {
3798 if (to) { 3812 if (to) {
3799 if ( !dlg->addMessage(to,method) ) delete(to); 3813 if ( !dlg->addMessage(to,method) ) delete(to);
3800 } 3814 }
3801 } 3815 }
3802} 3816}
3803 3817
3804void CalendarView::openAddressbook() 3818void CalendarView::openAddressbook()
3805{ 3819{
3806 KRun::runCommand("kaddressbook"); 3820 KRun::runCommand("kaddressbook");
3807} 3821}
3808 3822
3809void CalendarView::setModified(bool modified) 3823void CalendarView::setModified(bool modified)
3810{ 3824{
3811 if ( modified ) 3825 if ( modified )
3812 emit signalmodified(); 3826 emit signalmodified();
3813 if (mModified != modified) { 3827 if (mModified != modified) {
3814 mModified = modified; 3828 mModified = modified;
3815 emit modifiedChanged(mModified); 3829 emit modifiedChanged(mModified);
3816 } 3830 }
3817} 3831}
3818 3832
3819bool CalendarView::isReadOnly() 3833bool CalendarView::isReadOnly()
3820{ 3834{
3821 return mReadOnly; 3835 return mReadOnly;
3822} 3836}
3823 3837
3824void CalendarView::setReadOnly(bool readOnly) 3838void CalendarView::setReadOnly(bool readOnly)
3825{ 3839{
3826 if (mReadOnly != readOnly) { 3840 if (mReadOnly != readOnly) {
3827 mReadOnly = readOnly; 3841 mReadOnly = readOnly;
3828 emit readOnlyChanged(mReadOnly); 3842 emit readOnlyChanged(mReadOnly);
3829 } 3843 }
3830} 3844}
3831 3845
3832bool CalendarView::isModified() 3846bool CalendarView::isModified()
3833{ 3847{
3834 return mModified; 3848 return mModified;
3835} 3849}
3836void CalendarView::slotprintSelInc() 3850void CalendarView::slotprintSelInc()
3837{ 3851{
3838 if ( currentSelection() == 0 ) { 3852 if ( currentSelection() == 0 ) {
3839 KMessageBox::sorry(this,i18n("There is nothing selected!")); 3853 KMessageBox::sorry(this,i18n("There is nothing selected!"));
3840 return; 3854 return;
3841 } 3855 }
3842 showIncidence(); 3856 showIncidence();
3843 getEventViewerDialog()->print(); 3857 getEventViewerDialog()->print();
3844 3858
3845} 3859}
3846void CalendarView::printSetup() 3860void CalendarView::printSetup()
3847{ 3861{
3848#ifndef KORG_NOPRINTER 3862#ifndef KORG_NOPRINTER
3849 createPrinter(); 3863 createPrinter();
3850 3864
3851 mCalPrinter->setupPrinter(); 3865 mCalPrinter->setupPrinter();
3852#endif 3866#endif
3853} 3867}
3854 3868
3855void CalendarView::print() 3869void CalendarView::print()
3856{ 3870{
3857#ifndef KORG_NOPRINTER 3871#ifndef KORG_NOPRINTER
3858 createPrinter(); 3872 createPrinter();
3859 3873
3860 DateList tmpDateList = mNavigator->selectedDates(); 3874 DateList tmpDateList = mNavigator->selectedDates();
3861 mCalPrinter->print(CalPrinter::Month, 3875 mCalPrinter->print(CalPrinter::Month,
3862 tmpDateList.first(), tmpDateList.last()); 3876 tmpDateList.first(), tmpDateList.last());
3863#endif 3877#endif
3864} 3878}
3865 3879
3866void CalendarView::printPreview() 3880void CalendarView::printPreview()
3867{ 3881{
3868#ifndef KORG_NOPRINTER 3882#ifndef KORG_NOPRINTER
3869 kdDebug() << "CalendarView::printPreview()" << endl; 3883 kdDebug() << "CalendarView::printPreview()" << endl;
3870 3884
3871 createPrinter(); 3885 createPrinter();
3872 3886
3873 DateList tmpDateList = mNavigator->selectedDates(); 3887 DateList tmpDateList = mNavigator->selectedDates();
3874 3888
3875 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), 3889 mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(),
3876 tmpDateList.last()); 3890 tmpDateList.last());
3877#endif 3891#endif
3878} 3892}
3879 3893
3880void CalendarView::exportICalendar() 3894void CalendarView::exportICalendar()
3881{ 3895{
3882 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); 3896 QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this);
3883 3897
3884 // Force correct extension 3898 // Force correct extension
3885 if (filename.right(4) != ".ics") filename += ".ics"; 3899 if (filename.right(4) != ".ics") filename += ".ics";
3886 3900
3887 FileStorage storage( mCalendar, filename, new ICalFormat() ); 3901 FileStorage storage( mCalendar, filename, new ICalFormat() );
3888 storage.save(); 3902 storage.save();
3889} 3903}
3890 3904
3891bool CalendarView::exportVCalendar( QString filename ) 3905bool CalendarView::exportVCalendar( QString filename )
3892{ 3906{
3893 if (mCalendar->journals().count() > 0) { 3907 if (mCalendar->journals().count() > 0) {
3894 int result = KMessageBox::warningContinueCancel(this, 3908 int result = KMessageBox::warningContinueCancel(this,
3895 i18n("The journal entries can not be\nexported to a vCalendar file."), 3909 i18n("The journal entries can not be\nexported to a vCalendar file."),
3896 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 3910 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
3897 true); 3911 true);
3898 if (result != KMessageBox::Continue) return false; 3912 if (result != KMessageBox::Continue) return false;
3899 } 3913 }
3900 3914
3901 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 3915 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
3902 3916
3903 // Force correct extension 3917 // Force correct extension
3904 if (filename.right(4) != ".vcs") filename += ".vcs"; 3918 if (filename.right(4) != ".vcs") filename += ".vcs";
3905 3919
3906 FileStorage storage( mCalendar, filename, new VCalFormat ); 3920 FileStorage storage( mCalendar, filename, new VCalFormat );
3907 return storage.save(); 3921 return storage.save();
3908 3922
3909} 3923}
3910 3924
3911void CalendarView::eventUpdated(Incidence *) 3925void CalendarView::eventUpdated(Incidence *)
3912{ 3926{
3913 setModified(); 3927 setModified();
3914 // Don't call updateView here. The code, which has caused the update of the 3928 // Don't call updateView here. The code, which has caused the update of the
3915 // event is responsible for updating the view. 3929 // event is responsible for updating the view.
3916 // updateView(); 3930 // updateView();
3917} 3931}
3918 3932
3919void CalendarView::adaptNavigationUnits() 3933void CalendarView::adaptNavigationUnits()
3920{ 3934{
3921 if (mViewManager->currentView()->isEventView()) { 3935 if (mViewManager->currentView()->isEventView()) {
3922 int days = mViewManager->currentView()->currentDateCount(); 3936 int days = mViewManager->currentView()->currentDateCount();
3923 if (days == 1) { 3937 if (days == 1) {
3924 emit changeNavStringPrev(i18n("&Previous Day")); 3938 emit changeNavStringPrev(i18n("&Previous Day"));
3925 emit changeNavStringNext(i18n("&Next Day")); 3939 emit changeNavStringNext(i18n("&Next Day"));
3926 } else { 3940 } else {
3927 emit changeNavStringPrev(i18n("&Previous Week")); 3941 emit changeNavStringPrev(i18n("&Previous Week"));
3928 emit changeNavStringNext(i18n("&Next Week")); 3942 emit changeNavStringNext(i18n("&Next Week"));
3929 } 3943 }
3930 } 3944 }
3931} 3945}
3932 3946
3933void CalendarView::processMainViewSelection( Incidence *incidence ) 3947void CalendarView::processMainViewSelection( Incidence *incidence )
3934{ 3948{
3935 if ( incidence ) mTodoList->clearSelection(); 3949 if ( incidence ) mTodoList->clearSelection();
3936 processIncidenceSelection( incidence ); 3950 processIncidenceSelection( incidence );
3937} 3951}
3938 3952
3939void CalendarView::processTodoListSelection( Incidence *incidence ) 3953void CalendarView::processTodoListSelection( Incidence *incidence )
3940{ 3954{
3941 if ( incidence && mViewManager->currentView() ) { 3955 if ( incidence && mViewManager->currentView() ) {
3942 mViewManager->currentView()->clearSelection(); 3956 mViewManager->currentView()->clearSelection();
3943 } 3957 }
3944 processIncidenceSelection( incidence ); 3958 processIncidenceSelection( incidence );
3945} 3959}
3946 3960
3947void CalendarView::processIncidenceSelection( Incidence *incidence ) 3961void CalendarView::processIncidenceSelection( Incidence *incidence )
3948{ 3962{
3949 if ( incidence == mSelectedIncidence ) return; 3963 if ( incidence == mSelectedIncidence ) return;
3950 3964
3951 mSelectedIncidence = incidence; 3965 mSelectedIncidence = incidence;
3952 3966
3953 emit incidenceSelected( mSelectedIncidence ); 3967 emit incidenceSelected( mSelectedIncidence );
3954 3968
3955 if ( incidence && incidence->typeID() == eventID ) { 3969 if ( incidence && incidence->typeID() == eventID ) {
3956 Event *event = static_cast<Event *>( incidence ); 3970 Event *event = static_cast<Event *>( incidence );
3957 if ( event->organizer() == KOPrefs::instance()->email() ) { 3971 if ( event->organizer() == KOPrefs::instance()->email() ) {
3958 emit organizerEventsSelected( true ); 3972 emit organizerEventsSelected( true );
3959 } else { 3973 } else {
3960 emit organizerEventsSelected(false); 3974 emit organizerEventsSelected(false);
3961 } 3975 }
3962 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3976 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3963 KOPrefs::instance()->email() ) ) { 3977 KOPrefs::instance()->email() ) ) {
3964 emit groupEventsSelected( true ); 3978 emit groupEventsSelected( true );
3965 } else { 3979 } else {
3966 emit groupEventsSelected(false); 3980 emit groupEventsSelected(false);
3967 } 3981 }
3968 return; 3982 return;
3969 } else { 3983 } else {
3970 if ( incidence && incidence->typeID() == todoID ) { 3984 if ( incidence && incidence->typeID() == todoID ) {
3971 emit todoSelected( true ); 3985 emit todoSelected( true );
3972 Todo *event = static_cast<Todo *>( incidence ); 3986 Todo *event = static_cast<Todo *>( incidence );
3973 if ( event->organizer() == KOPrefs::instance()->email() ) { 3987 if ( event->organizer() == KOPrefs::instance()->email() ) {
3974 emit organizerEventsSelected( true ); 3988 emit organizerEventsSelected( true );
3975 } else { 3989 } else {
3976 emit organizerEventsSelected(false); 3990 emit organizerEventsSelected(false);
3977 } 3991 }
3978 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3992 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3979 KOPrefs::instance()->email() ) ) { 3993 KOPrefs::instance()->email() ) ) {
3980 emit groupEventsSelected( true ); 3994 emit groupEventsSelected( true );
3981 } else { 3995 } else {
3982 emit groupEventsSelected(false); 3996 emit groupEventsSelected(false);
3983 } 3997 }
3984 return; 3998 return;
3985 } else { 3999 } else {
3986 emit todoSelected( false ); 4000 emit todoSelected( false );
3987 emit organizerEventsSelected(false); 4001 emit organizerEventsSelected(false);
3988 emit groupEventsSelected(false); 4002 emit groupEventsSelected(false);
3989 } 4003 }
3990 return; 4004 return;
3991 } 4005 }
3992 4006
3993 /* if ( incidence && incidence->typeID() == todoID ) { 4007 /* if ( incidence && incidence->typeID() == todoID ) {
3994 emit todoSelected( true ); 4008 emit todoSelected( true );
3995 } else { 4009 } else {
3996 emit todoSelected( false ); 4010 emit todoSelected( false );
3997 }*/ 4011 }*/
3998} 4012}
3999 4013
4000 4014
4001void CalendarView::checkClipboard() 4015void CalendarView::checkClipboard()
4002{ 4016{
4003#ifndef KORG_NODND 4017#ifndef KORG_NODND
4004 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 4018 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
4005 emit pasteEnabled(true); 4019 emit pasteEnabled(true);
4006 } else { 4020 } else {
4007 emit pasteEnabled(false); 4021 emit pasteEnabled(false);
4008 } 4022 }
4009#endif 4023#endif
4010} 4024}
4011 4025
4012void CalendarView::showDates(const DateList &selectedDates) 4026void CalendarView::showDates(const DateList &selectedDates)
4013{ 4027{
4014 // kdDebug() << "CalendarView::selectDates()" << endl; 4028 // kdDebug() << "CalendarView::selectDates()" << endl;
4015 4029
4016 4030
4017 if ( !mBlockShowDates ) { 4031 if ( !mBlockShowDates ) {
4018 if ( mViewManager->currentView() ) { 4032 if ( mViewManager->currentView() ) {
4019 updateView( selectedDates.first(), selectedDates.last() ); 4033 updateView( selectedDates.first(), selectedDates.last() );
4020 } else { 4034 } else {
4021 mViewManager->showAgendaView(); 4035 mViewManager->showAgendaView();
4022 } 4036 }
4023 } 4037 }
4024 4038
4025 QDate date = selectedDates.first(); 4039 QDate date = selectedDates.first();
4026 if ( ! date.isValid() ) { 4040 if ( ! date.isValid() ) {
4027 topLevelWidget()->setCaption(""); 4041 topLevelWidget()->setCaption("");
4028 return; 4042 return;
4029 } 4043 }
4030 4044
4031 QString selDates; 4045 QString selDates;
4032 selDates = KGlobal::locale()->formatDate( date, true); 4046 selDates = KGlobal::locale()->formatDate( date, true);
4033 if (selectedDates.first() < selectedDates.last() ) 4047 if (selectedDates.first() < selectedDates.last() )
4034 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 4048 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
4035 else { 4049 else {
4036 QString addString; 4050 QString addString;
4037 if ( date == QDateTime::currentDateTime().date() ) 4051 if ( date == QDateTime::currentDateTime().date() )
4038 addString = i18n("Today"); 4052 addString = i18n("Today");
4039 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 4053 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
4040 addString = i18n("Tomorrow"); 4054 addString = i18n("Tomorrow");
4041 else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) 4055 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
4042 addString = i18n("Yesterday"); 4056 addString = i18n("Yesterday");
4043 else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) 4057 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
4044 addString = i18n("Day before yesterday"); 4058 addString = i18n("Day before yesterday");
4045 else if ( date == QDateTime::currentDateTime().date().addDays(2) ) 4059 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
4046 addString = i18n("Day after tomorrow"); 4060 addString = i18n("Day after tomorrow");
4047 if ( !addString.isEmpty() ) { 4061 if ( !addString.isEmpty() ) {
4048 topLevelWidget()->setCaption( addString+", " + selDates ); 4062 topLevelWidget()->setCaption( addString+", " + selDates );
4049 return; 4063 return;
4050 } 4064 }
4051 } 4065 }
4052 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 4066 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
4053 4067
4054} 4068}
4055 4069
4056QPtrList<CalFilter> CalendarView::filters() 4070QPtrList<CalFilter> CalendarView::filters()
4057{ 4071{
4058 return mFilters; 4072 return mFilters;
4059 4073
4060} 4074}
4061void CalendarView::editFilters() 4075void CalendarView::editFilters()
4062{ 4076{
4063 // kdDebug() << "CalendarView::editFilters()" << endl; 4077 // kdDebug() << "CalendarView::editFilters()" << endl;
4064 4078
4065 CalFilter *filter = mFilters.first(); 4079 CalFilter *filter = mFilters.first();
4066 while(filter) { 4080 while(filter) {
4067 filter = mFilters.next(); 4081 filter = mFilters.next();
4068 } 4082 }
4069 4083
4070 mDialogManager->showFilterEditDialog(&mFilters); 4084 mDialogManager->showFilterEditDialog(&mFilters);
4071 updateFilter(); 4085 updateFilter();
4072} 4086}
4073void CalendarView::toggleFilter() 4087void CalendarView::toggleFilter()
4074{ 4088{
4075 if ( mLeftFrame->isHidden() ) { 4089 if ( mLeftFrame->isHidden() ) {
4076 toggleExpand(); 4090 toggleExpand();
4077 showFilter( true ); 4091 showFilter( true );
4078 } else 4092 } else
4079 showFilter(! mCalEditView->isVisible()); 4093 showFilter(! mCalEditView->isVisible());
4080} 4094}
4081 4095
4082KOFilterView *CalendarView::filterView() 4096KOFilterView *CalendarView::filterView()
4083{ 4097{
4084 return mFilterView; 4098 return mFilterView;
4085} 4099}
4086void CalendarView::selectFilter( int fil ) 4100void CalendarView::selectFilter( int fil )
4087{ 4101{
4088 mFilterView->setSelectedFilter( fil ); 4102 mFilterView->setSelectedFilter( fil );
4089 updateUnmanagedViews(); 4103 updateUnmanagedViews();
4090} 4104}
4091void CalendarView::showFilter(bool visible) 4105void CalendarView::showFilter(bool visible)
4092{ 4106{
4093#if 1 4107#if 1
4094 if (visible) { 4108 if (visible) {
4095 mCalEditView->readConfig(); 4109 mCalEditView->readConfig();
4096 mCalEditView->show(); 4110 mCalEditView->show();
4097 QValueList<int> sizes; 4111 QValueList<int> sizes;
4098 sizes = mLeftFrame->sizes(); 4112 sizes = mLeftFrame->sizes();
4099 if ( sizes.count() == 4 && sizes[3] < 20 ) { 4113 if ( sizes.count() == 4 && sizes[3] < 20 ) {
4100 sizes.clear(); 4114 sizes.clear();
4101 sizes << 100; 4115 sizes << 100;
4102 sizes << 0; 4116 sizes << 0;
4103 sizes << 0; 4117 sizes << 0;
4104 sizes << 100; 4118 sizes << 100;
4105 mLeftFrame->setSizes(sizes); 4119 mLeftFrame->setSizes(sizes);
4106 } 4120 }
4107#if 0 4121#if 0
4108 sizes = mLeftFrame->sizes(); 4122 sizes = mLeftFrame->sizes();
4109 int ccc = 0; 4123 int ccc = 0;
4110 while ( ccc < sizes.count()) { 4124 while ( ccc < sizes.count()) {
4111 qDebug("size %d %d ", ccc, sizes[ccc]); 4125 qDebug("size %d %d ", ccc, sizes[ccc]);
4112 ++ccc; 4126 ++ccc;
4113 } 4127 }
4114#endif 4128#endif
4115 4129
4116 } 4130 }
4117 else { 4131 else {
4118 mCalEditView->hide(); 4132 mCalEditView->hide();
4119 } 4133 }
4120#else 4134#else
4121 if (visible) mFilterView->show(); 4135 if (visible) mFilterView->show();
4122 else mFilterView->hide(); 4136 else mFilterView->hide();
4123#endif 4137#endif
4124} 4138}
4125void CalendarView::toggleFilerEnabled( ) 4139void CalendarView::toggleFilerEnabled( )
4126{ 4140{
4127 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 4141 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
4128 if ( !mFilterView->filtersEnabled() ) 4142 if ( !mFilterView->filtersEnabled() )
4129 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 4143 topLevelWidget()->setCaption( i18n("Filter disabled ") );
4130 updateUnmanagedViews(); 4144 updateUnmanagedViews();
4131 4145
4132} 4146}
4133void CalendarView::updateFilter() 4147void CalendarView::updateFilter()
4134{ 4148{
4135 CalFilter *filter = mFilterView->selectedFilter(); 4149 CalFilter *filter = mFilterView->selectedFilter();
4136 if (filter) { 4150 if (filter) {
4137 QString mess; 4151 QString mess;
4138 if (mFilterView->filtersEnabled()) { 4152 if (mFilterView->filtersEnabled()) {
4139 mess = i18n("Filter selected: ")+filter->name(); 4153 mess = i18n("Filter selected: ")+filter->name();
4140 filter->setEnabled(true); 4154 filter->setEnabled(true);
4141 } 4155 }
4142 else filter->setEnabled(false); 4156 else filter->setEnabled(false);
4143 mCalendar->setFilter(filter); 4157 mCalendar->setFilter(filter);
4144 updateView(); 4158 updateView();
4145 if ( !mess.isEmpty() ) 4159 if ( !mess.isEmpty() )
4146 topLevelWidget()->setCaption( mess ); 4160 topLevelWidget()->setCaption( mess );
4147 4161
4148 } 4162 }
4149 emit filtersUpdated(); 4163 emit filtersUpdated();
4150} 4164}
4151 4165
4152void CalendarView::filterEdited() 4166void CalendarView::filterEdited()
4153{ 4167{
4154 mFilterView->updateFilters(); 4168 mFilterView->updateFilters();
4155 updateFilter(); 4169 updateFilter();
4156 writeSettings(); 4170 writeSettings();
4157} 4171}
4158 4172
4159 4173
4160void CalendarView::takeOverEvent() 4174void CalendarView::takeOverEvent()
4161{ 4175{
4162 Incidence *incidence = currentSelection(); 4176 Incidence *incidence = currentSelection();
4163 4177
4164 if (!incidence) return; 4178 if (!incidence) return;
4165 4179
4166 incidence->setOrganizer(KOPrefs::instance()->email()); 4180 incidence->setOrganizer(KOPrefs::instance()->email());
4167 incidence->recreate(); 4181 incidence->recreate();
4168 incidence->setReadOnly(false); 4182 incidence->setReadOnly(false);
4169 4183
4170 updateView(); 4184 updateView();
4171} 4185}
4172 4186
4173void CalendarView::takeOverCalendar() 4187void CalendarView::takeOverCalendar()
4174{ 4188{
4175 // TODO: Create Calendar::allIncidences() function and use it here 4189 // TODO: Create Calendar::allIncidences() function and use it here
4176 4190
4177 clearAllViews(); 4191 clearAllViews();
4178 QPtrList<Event> events = mCalendar->events(); 4192 QPtrList<Event> events = mCalendar->events();
4179 for(uint i=0; i<events.count(); ++i) { 4193 for(uint i=0; i<events.count(); ++i) {
4180 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 4194 events.at(i)->setOrganizer(KOPrefs::instance()->email());
4181 events.at(i)->recreate(); 4195 events.at(i)->recreate();
4182 events.at(i)->setReadOnly(false); 4196 events.at(i)->setReadOnly(false);
4183 } 4197 }
4184 4198
4185 QPtrList<Todo> todos = mCalendar->todos(); 4199 QPtrList<Todo> todos = mCalendar->todos();
4186 for(uint i=0; i<todos.count(); ++i) { 4200 for(uint i=0; i<todos.count(); ++i) {
4187 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 4201 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
4188 todos.at(i)->recreate(); 4202 todos.at(i)->recreate();
4189 todos.at(i)->setReadOnly(false); 4203 todos.at(i)->setReadOnly(false);
4190 } 4204 }
4191 4205
4192 QPtrList<Journal> journals = mCalendar->journals(); 4206 QPtrList<Journal> journals = mCalendar->journals();
4193 for(uint i=0; i<journals.count(); ++i) { 4207 for(uint i=0; i<journals.count(); ++i) {
4194 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 4208 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
4195 journals.at(i)->recreate(); 4209 journals.at(i)->recreate();
4196 journals.at(i)->setReadOnly(false); 4210 journals.at(i)->setReadOnly(false);
4197 } 4211 }
4198 4212
4199 updateView(); 4213 updateView();
4200} 4214}
4201 4215
4202void CalendarView::showIntro() 4216void CalendarView::showIntro()
4203{ 4217{
4204 kdDebug() << "To be implemented." << endl; 4218 kdDebug() << "To be implemented." << endl;
4205} 4219}
4206 4220
4207QWidgetStack *CalendarView::viewStack() 4221QWidgetStack *CalendarView::viewStack()
4208{ 4222{
4209 return mRightFrame; 4223 return mRightFrame;
4210} 4224}
4211 4225
4212QWidget *CalendarView::leftFrame() 4226QWidget *CalendarView::leftFrame()
4213{ 4227{
4214 return ( QWidget *)mLeftFrame; 4228 return ( QWidget *)mLeftFrame;
4215} 4229}
4216 4230
4217DateNavigator *CalendarView::dateNavigator() 4231DateNavigator *CalendarView::dateNavigator()
4218{ 4232{
4219 return mNavigator; 4233 return mNavigator;
4220} 4234}
4221 4235
4222KDateNavigator* CalendarView::dateNavigatorWidget() 4236KDateNavigator* CalendarView::dateNavigatorWidget()
4223{ 4237{
4224 return mDateNavigator->navigatorView(); 4238 return mDateNavigator->navigatorView();
4225} 4239}
4226void CalendarView::toggleDateNavigatorWidget() 4240void CalendarView::toggleDateNavigatorWidget()
4227{ 4241{
4228 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; 4242 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
4229 4243
4230 if (!KOPrefs::instance()->mShowDateNavigator ) 4244 if (!KOPrefs::instance()->mShowDateNavigator )
4231 mDateNavigator->hide(); 4245 mDateNavigator->hide();
4232 else 4246 else
4233 mDateNavigator->show(); 4247 mDateNavigator->show();
4234} 4248}
4235void CalendarView::addView(KOrg::BaseView *view) 4249void CalendarView::addView(KOrg::BaseView *view)
4236{ 4250{
4237 mViewManager->addView(view); 4251 mViewManager->addView(view);
4238} 4252}
4239 4253
4240void CalendarView::showView(KOrg::BaseView *view) 4254void CalendarView::showView(KOrg::BaseView *view)
4241{ 4255{
4242 mViewManager->showView(view, mLeftFrame->isVisible()); 4256 mViewManager->showView(view, mLeftFrame->isVisible());
4243} 4257}
4244 4258
4245Incidence *CalendarView::currentSelection() 4259Incidence *CalendarView::currentSelection()
4246{ 4260{
4247 return mViewManager->currentSelection(); 4261 return mViewManager->currentSelection();
4248} 4262}
4249void CalendarView::toggleAllDaySize() 4263void CalendarView::toggleAllDaySize()
4250{ 4264{
4251 /* 4265 /*
4252 if ( KOPrefs::instance()->mAllDaySize > 47 ) 4266 if ( KOPrefs::instance()->mAllDaySize > 47 )
4253 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 4267 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
4254 else 4268 else
4255 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 4269 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
4256 */ 4270 */
4257 viewManager()->agendaView()->toggleAllDay(); 4271 viewManager()->agendaView()->toggleAllDay();
4258} 4272}
4259void CalendarView::toggleExpand() 4273void CalendarView::toggleExpand()
4260{ 4274{
4261 // if ( mLeftFrame->isHidden() ) { 4275 // if ( mLeftFrame->isHidden() ) {
4262 // mLeftFrame->show(); 4276 // mLeftFrame->show();
4263 // emit calendarViewExpanded( false ); 4277 // emit calendarViewExpanded( false );
4264 // } else { 4278 // } else {
4265 // mLeftFrame->hide(); 4279 // mLeftFrame->hide();
4266 // emit calendarViewExpanded( true ); 4280 // emit calendarViewExpanded( true );
4267 // } 4281 // }
4268 //qDebug(" CalendarView::toggleExpand()"); 4282 //qDebug(" CalendarView::toggleExpand()");
4269 globalFlagBlockAgenda = 1; 4283 globalFlagBlockAgenda = 1;
4270 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 4284 emit calendarViewExpanded( !mLeftFrame->isHidden() );
4271 globalFlagBlockAgenda = 5; 4285 globalFlagBlockAgenda = 5;
4272 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 4286 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
4273 //mViewManager->showView( 0, true ); 4287 //mViewManager->showView( 0, true );
4274} 4288}
4275 4289
4276void CalendarView::calendarModified( bool modified, Calendar * ) 4290void CalendarView::calendarModified( bool modified, Calendar * )
4277{ 4291{
4278 setModified( modified ); 4292 setModified( modified );
4279} 4293}
4280 4294
4281Todo *CalendarView::selectedTodo() 4295Todo *CalendarView::selectedTodo()
4282{ 4296{
4283 Incidence *incidence = currentSelection(); 4297 Incidence *incidence = currentSelection();
4284 if ( incidence && incidence->typeID() == todoID ) { 4298 if ( incidence && incidence->typeID() == todoID ) {
4285 return static_cast<Todo *>( incidence ); 4299 return static_cast<Todo *>( incidence );
4286 } 4300 }
4287 4301
4288 incidence = mTodoList->selectedIncidences().first(); 4302 incidence = mTodoList->selectedIncidences().first();
4289 if ( incidence && incidence->typeID() == todoID ) { 4303 if ( incidence && incidence->typeID() == todoID ) {
4290 return static_cast<Todo *>( incidence ); 4304 return static_cast<Todo *>( incidence );
4291 } 4305 }
4292 4306
4293 return 0; 4307 return 0;
4294} 4308}
4295 4309
4296void CalendarView::dialogClosing(Incidence *in) 4310void CalendarView::dialogClosing(Incidence *in)
4297{ 4311{
4298 // mDialogList.remove(in); 4312 // mDialogList.remove(in);
4299} 4313}
4300 4314
4301void CalendarView::showIncidence() 4315void CalendarView::showIncidence()
4302{ 4316{
4303 mViewerCallerIsSearchDialog = false; 4317 mViewerCallerIsSearchDialog = false;
4304 Incidence *incidence = currentSelection(); 4318 Incidence *incidence = currentSelection();
4305 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4319 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4306 if ( incidence ) { 4320 if ( incidence ) {
4307 ShowIncidenceVisitor v; 4321 ShowIncidenceVisitor v;
4308 v.act( incidence, this ); 4322 v.act( incidence, this );
4309 } 4323 }
4310} 4324}
4311void CalendarView::editIncidenceDescription() 4325void CalendarView::editIncidenceDescription()
4312{ 4326{
4313 mFlagEditDescription = true; 4327 mFlagEditDescription = true;
4314 editIncidence(); 4328 editIncidence();
4315 mFlagEditDescription = false; 4329 mFlagEditDescription = false;
4316} 4330}
4317void CalendarView::editIncidence() 4331void CalendarView::editIncidence()
4318{ 4332{
4319 // qDebug("editIncidence() "); 4333 // qDebug("editIncidence() ");
4320 Incidence *incidence = currentSelection(); 4334 Incidence *incidence = currentSelection();
4321 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4335 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4322 if ( incidence ) { 4336 if ( incidence ) {
4323 EditIncidenceVisitor v; 4337 EditIncidenceVisitor v;
4324 v.act( incidence, this ); 4338 v.act( incidence, this );
4325 } 4339 }
4326} 4340}
4327 4341
4328void CalendarView::deleteIncidence() 4342void CalendarView::deleteIncidence()
4329{ 4343{
4330 Incidence *incidence = currentSelection(); 4344 Incidence *incidence = currentSelection();
4331 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4345 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4332 if ( incidence ) { 4346 if ( incidence ) {
4333 deleteIncidence(incidence); 4347 deleteIncidence(incidence);
4334 } 4348 }
4335} 4349}
4336void CalendarView::showIncidence(QString uid) 4350void CalendarView::showIncidence(QString uid)
4337{ 4351{
4338 Incidence *inc = mCalendar->incidence( uid ); 4352 Incidence *inc = mCalendar->incidence( uid );
4339 if ( inc ) 4353 if ( inc )
4340 showIncidence( inc ); 4354 showIncidence( inc );
4341} 4355}
4342void CalendarView::showIncidence(Incidence *incidence) 4356void CalendarView::showIncidence(Incidence *incidence)
4343{ 4357{
4344 mViewerCallerIsSearchDialog = false; 4358 mViewerCallerIsSearchDialog = false;
4345 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); 4359 //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() );
4346 if ( sender() && mDialogManager->getSearchDialog() ) { 4360 if ( sender() && mDialogManager->getSearchDialog() ) {
4347 if ( sender () == mDialogManager->getSearchDialog()->listview() ) { 4361 if ( sender () == mDialogManager->getSearchDialog()->listview() ) {
4348 mViewerCallerIsSearchDialog = true; 4362 mViewerCallerIsSearchDialog = true;
4349 } 4363 }
4350 } 4364 }
4351 if ( incidence ) { 4365 if ( incidence ) {
4352 ShowIncidenceVisitor v; 4366 ShowIncidenceVisitor v;
4353 v.act( incidence, this ); 4367 v.act( incidence, this );
4354 } 4368 }
4355} 4369}
4356 4370
4357void CalendarView::editIncidence(Incidence *incidence) 4371void CalendarView::editIncidence(Incidence *incidence)
4358{ 4372{
4359 if ( incidence ) { 4373 if ( incidence ) {
4360 4374
4361 EditIncidenceVisitor v; 4375 EditIncidenceVisitor v;
4362 v.act( incidence, this ); 4376 v.act( incidence, this );
4363 4377
4364 } 4378 }
4365} 4379}
4366 4380
4367void CalendarView::deleteIncidence(Incidence *incidence) 4381void CalendarView::deleteIncidence(Incidence *incidence)
4368{ 4382{
4369 //qDebug(" CalendarView::deleteIncidence "); 4383 //qDebug(" CalendarView::deleteIncidence ");
4370 if ( incidence ) { 4384 if ( incidence ) {
4371 DeleteIncidenceVisitor v; 4385 DeleteIncidenceVisitor v;
4372 v.act( incidence, this ); 4386 v.act( incidence, this );
4373 } 4387 }
4374} 4388}
4375 4389
4376 4390
4377void CalendarView::lookForOutgoingMessages() 4391void CalendarView::lookForOutgoingMessages()
4378{ 4392{
4379 OutgoingDialog *ogd = mDialogManager->outgoingDialog(); 4393 OutgoingDialog *ogd = mDialogManager->outgoingDialog();
4380 ogd->loadMessages(); 4394 ogd->loadMessages();
4381} 4395}
4382 4396
4383void CalendarView::lookForIncomingMessages() 4397void CalendarView::lookForIncomingMessages()
4384{ 4398{
4385 IncomingDialog *icd = mDialogManager->incomingDialog(); 4399 IncomingDialog *icd = mDialogManager->incomingDialog();
4386 icd->retrieve(); 4400 icd->retrieve();
4387} 4401}
4388 4402
4389bool CalendarView::removeCompletedSubTodos( Todo* t ) 4403bool CalendarView::removeCompletedSubTodos( Todo* t )
4390{ 4404{
4391 bool deleteTodo = true; 4405 bool deleteTodo = true;
4392 QPtrList<Incidence> subTodos; 4406 QPtrList<Incidence> subTodos;
4393 Incidence *aTodo; 4407 Incidence *aTodo;
4394 subTodos = t->relations(); 4408 subTodos = t->relations();
4395 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { 4409 for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) {
4396 if (! removeCompletedSubTodos( (Todo*) aTodo )) 4410 if (! removeCompletedSubTodos( (Todo*) aTodo ))
4397 deleteTodo = false; 4411 deleteTodo = false;
4398 } 4412 }
4399 if ( deleteTodo ) { 4413 if ( deleteTodo ) {
4400 if ( t->isCompleted() && !t->doesRecur()) { 4414 if ( t->isCompleted() && !t->doesRecur()) {
4401 checkExternalId( t ); 4415 checkExternalId( t );
4402 mCalendar->deleteTodo( t ); 4416 mCalendar->deleteTodo( t );
4403 changeTodoDisplay( t,KOGlobals::EVENTDELETED ); 4417 changeTodoDisplay( t,KOGlobals::EVENTDELETED );
4404 } 4418 }
4405 else 4419 else
4406 deleteTodo = false; 4420 deleteTodo = false;
4407 } 4421 }
4408 return deleteTodo; 4422 return deleteTodo;
4409 4423
4410} 4424}
4411void CalendarView::purgeCompleted() 4425void CalendarView::purgeCompleted()
4412{ 4426{
4413 int result = KMessageBox::warningContinueCancel(this, 4427 int result = KMessageBox::warningContinueCancel(this,
4414 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); 4428 i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge"));
4415 4429
4416 if (result == KMessageBox::Continue) { 4430 if (result == KMessageBox::Continue) {
4417 4431
4418 QPtrList<Todo> todoCal; 4432 QPtrList<Todo> todoCal;
4419 QPtrList<Todo> rootTodos; 4433 QPtrList<Todo> rootTodos;
4420 //QPtrList<Incidence> rel; 4434 //QPtrList<Incidence> rel;
4421 Todo *aTodo;//, *rTodo; 4435 Todo *aTodo;//, *rTodo;
4422 Incidence *rIncidence; 4436 Incidence *rIncidence;
4423 bool childDelete = false; 4437 bool childDelete = false;
4424 bool deletedOne = true; 4438 bool deletedOne = true;
4425 todoCal = calendar()->todos(); 4439 todoCal = calendar()->todos();
4426 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { 4440 for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) {
4427 if ( !aTodo->relatedTo() ) 4441 if ( !aTodo->relatedTo() )
4428 rootTodos.append( aTodo ); 4442 rootTodos.append( aTodo );
4429 } 4443 }
4430 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { 4444 for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) {
4431 removeCompletedSubTodos( aTodo ); 4445 removeCompletedSubTodos( aTodo );
4432 } 4446 }
4433 4447
4434 updateView(); 4448 updateView();
4435 } 4449 }
4436} 4450}
4437 4451
4438void CalendarView::slotCalendarChanged() 4452void CalendarView::slotCalendarChanged()
4439{ 4453{
4440 ; 4454 ;
4441} 4455}
4442 4456
4443void CalendarView::keyPressEvent ( QKeyEvent *e) 4457void CalendarView::keyPressEvent ( QKeyEvent *e)
4444{ 4458{
4445 //qDebug(" alendarView::keyPressEvent "); 4459 //qDebug(" alendarView::keyPressEvent ");
4446 e->ignore(); 4460 e->ignore();
4447} 4461}
4448 4462
4449 4463
4450bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) 4464bool CalendarView::sync(KSyncManager* manager, QString filename, int mode)
4451{ 4465{
4452 // mSyncManager = manager; 4466 // mSyncManager = manager;
4453 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { 4467 if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) {
4454 qDebug("KO: SyncKDE request detected!"); 4468 qDebug("KO: SyncKDE request detected!");
4455 } 4469 }
4456 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 4470 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
4457 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 4471 mCurrentSyncName = mSyncManager->getCurrentSyncName();
4458 return syncCalendar( filename, mode ); 4472 return syncCalendar( filename, mode );
4459} 4473}
4460bool CalendarView::syncExternal(KSyncManager* manager, QString resource) 4474bool CalendarView::syncExternal(KSyncManager* manager, QString resource)
4461{ 4475{
4462 //mSyncManager = manager; 4476 //mSyncManager = manager;
4463 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); 4477 mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice();
4464 mCurrentSyncName = mSyncManager->getCurrentSyncName(); 4478 mCurrentSyncName = mSyncManager->getCurrentSyncName();
4465 if ( resource == "sharp" ) 4479 if ( resource == "sharp" )
4466 syncExternal( 0 ); 4480 syncExternal( 0 );
4467 if ( resource == "phone" ) 4481 if ( resource == "phone" )
4468 syncExternal( 1 ); 4482 syncExternal( 1 );
4469 // pending setmodified 4483 // pending setmodified
4470 return true; 4484 return true;
4471} 4485}
4472void CalendarView::setSyncManager(KSyncManager* manager) 4486void CalendarView::setSyncManager(KSyncManager* manager)
4473{ 4487{
4474 mSyncManager = manager; 4488 mSyncManager = manager;
4475} 4489}
4476 4490
4477void CalendarView::removeSyncInfo( QString syncProfile) 4491void CalendarView::removeSyncInfo( QString syncProfile)
4478{ 4492{
4479 qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); 4493 qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1());
4480 mCalendar->removeSyncInfo( syncProfile ); 4494 mCalendar->removeSyncInfo( syncProfile );
4481 4495
4482} 4496}
4483 4497
4484void CalendarView::undo_delete() 4498void CalendarView::undo_delete()
4485{ 4499{
4486 //qDebug("undo_delete() "); 4500 //qDebug("undo_delete() ");
4487 Incidence* undo = mCalendar->undoIncidence(); 4501 Incidence* undo = mCalendar->undoIncidence();
4488 if ( !undo ) { 4502 if ( !undo ) {
4489 KMessageBox::sorry(this,i18n("There is nothing to undo!"), 4503 KMessageBox::sorry(this,i18n("There is nothing to undo!"),
4490 i18n("KO/Pi")); 4504 i18n("KO/Pi"));
4491 return; 4505 return;
4492 } 4506 }
4493 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + 4507 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) +
4494 i18n("\nAre you sure you want\nto restore this?"), 4508 i18n("\nAre you sure you want\nto restore this?"),
4495 i18n("KO/Pi Confirmation"),i18n("Restore"))) { 4509 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
4496 mCalendar->undoDeleteIncidence(); 4510 mCalendar->undoDeleteIncidence();
4497 updateView(); 4511 updateView();
4498 } 4512 }
4499} 4513}
4500 4514
4501void CalendarView::slotViewerClosed() 4515void CalendarView::slotViewerClosed()
4502{ 4516{
4503 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); 4517 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
4504} 4518}
4505 4519
4506void CalendarView::resetFocus() 4520void CalendarView::resetFocus()
4507{ 4521{
4508 if ( mViewerCallerIsSearchDialog ) { 4522 if ( mViewerCallerIsSearchDialog ) {
4509 if ( mDialogManager->getSearchDialog()->isVisible() ){ 4523 if ( mDialogManager->getSearchDialog()->isVisible() ){
4510 mDialogManager->getSearchDialog()->raise(); 4524 mDialogManager->getSearchDialog()->raise();
4511 mDialogManager->getSearchDialog()->setActiveWindow(); 4525 mDialogManager->getSearchDialog()->setActiveWindow();
4512 mDialogManager->getSearchDialog()->listview()->resetFocus(); 4526 mDialogManager->getSearchDialog()->listview()->resetFocus();
4513 } else 4527 } else
4514 mViewerCallerIsSearchDialog = false; 4528 mViewerCallerIsSearchDialog = false;
4515 } 4529 }
4516 if ( !mViewerCallerIsSearchDialog ) { 4530 if ( !mViewerCallerIsSearchDialog ) {
4517 //mViewManager->currentView()->setFocus(); 4531 //mViewManager->currentView()->setFocus();
4518 //qDebug("sssssssssssssssset focus "); 4532 //qDebug("sssssssssssssssset focus ");
4519 topLevelWidget()->raise(); 4533 topLevelWidget()->raise();
4520 setActiveWindow(); 4534 setActiveWindow();
4521 //setFocus(); 4535 //setFocus();
4522 } 4536 }
4523 mViewerCallerIsSearchDialog = false; 4537 mViewerCallerIsSearchDialog = false;
4524} 4538}
4525 4539
4526void CalendarView::showNextAlarms() 4540void CalendarView::showNextAlarms()
4527{ 4541{
4528 QString message; 4542 QString message;
4529 QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); 4543 QDateTime nextAl = mCalendar->nextAlarmEventDateTime();
4530 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { 4544 if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) {
4531 QString sum = mCalendar->nextSummary(); 4545 QString sum = mCalendar->nextSummary();
4532 QDateTime nextA = mNextAlarmDateTime; 4546 QDateTime nextA = mNextAlarmDateTime;
4533 QDateTime cur = QDateTime::currentDateTime(); 4547 QDateTime cur = QDateTime::currentDateTime();
4534 int secs = cur.secsTo( nextA ); 4548 int secs = cur.secsTo( nextA );
4535 int min = secs /60; 4549 int min = secs /60;
4536 int hours = min /60; 4550 int hours = min /60;
4537 min = min % 60; 4551 min = min % 60;
4538 int days = hours /24; 4552 int days = hours /24;
4539 hours = hours % 24; 4553 hours = hours % 24;
4540 4554
4541 //message = i18n("The next alarm is in:\n"); 4555 //message = i18n("The next alarm is in:\n");
4542 if ( days > 1 ) 4556 if ( days > 1 )
4543 message += i18n("%1 days\n").arg( days ); 4557 message += i18n("%1 days\n").arg( days );
4544 else if ( days == 1 ) 4558 else if ( days == 1 )
4545 message += i18n("1 day\n"); 4559 message += i18n("1 day\n");
4546 if ( hours > 1 ) 4560 if ( hours > 1 )
4547 message += i18n("%1 hours\n").arg( hours ); 4561 message += i18n("%1 hours\n").arg( hours );
4548 else if ( hours == 1 ) 4562 else if ( hours == 1 )
4549 message += i18n("1 hour\n"); 4563 message += i18n("1 hour\n");
4550 if ( min > 1 ) 4564 if ( min > 1 )
4551 message += i18n("%1 minutes\n").arg( min ); 4565 message += i18n("%1 minutes\n").arg( min );
4552 else if ( min == 1 ) 4566 else if ( min == 1 )
4553 message += i18n("1 minute\n"); 4567 message += i18n("1 minute\n");
4554 if ( message.isEmpty() ) 4568 if ( message.isEmpty() )
4555 message = i18n("The next alarm is in\nless than one minute!"); 4569 message = i18n("The next alarm is in\nless than one minute!");
4556 else 4570 else
4557 message = i18n("The next alarm is in:\n") + message; 4571 message = i18n("The next alarm is in:\n") + message;
4558 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; 4572 message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ;
4559 } else { 4573 } else {
4560 message = i18n("There is no next alarm."); 4574 message = i18n("There is no next alarm.");
4561 4575
4562 } 4576 }
4563#ifdef DESKTOP_VERSION 4577#ifdef DESKTOP_VERSION
4564 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 4578 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
4565 message += i18n("\nThe internal alarm notification is disabled!\n"); 4579 message += i18n("\nThe internal alarm notification is disabled!\n");
4566 message += i18n("Enable it in the settings menu, TAB alarm."); 4580 message += i18n("Enable it in the settings menu, TAB alarm.");
4567 } 4581 }
4568 4582
4569#endif 4583#endif
4570 KMessageBox::information( this, message); 4584 KMessageBox::information( this, message);
4571} 4585}
diff --git a/korganizer/koeditordetails.cpp b/korganizer/koeditordetails.cpp
index 7354940..479bd8b 100644
--- a/korganizer/koeditordetails.cpp
+++ b/korganizer/koeditordetails.cpp
@@ -1,480 +1,482 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 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 thse hope that it will be useful, 10 This program is distributed in thse 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 <qtooltip.h> 24#include <qtooltip.h>
25#include <qfiledialog.h> 25#include <qfiledialog.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapp.h> 32#include <qapp.h>
33 33
34#include <klocale.h> 34#include <klocale.h>
35#include <kglobal.h> 35#include <kglobal.h>
36#include <kdialog.h>
36#include <kiconloader.h> 37#include <kiconloader.h>
37#include <kstandarddirs.h> 38#include <kstandarddirs.h>
38#include <kmessagebox.h> 39#include <kmessagebox.h>
39#ifndef KORG_NOKABC 40#ifndef KORG_NOKABC
40 41
41#ifdef DESKTOP_VERSION 42#ifdef DESKTOP_VERSION
42#include <kabc/addresseedialog.h> 43#include <kabc/addresseedialog.h>
43#else //DESKTOP_VERSION 44#else //DESKTOP_VERSION
44#include <externalapphandler.h> 45#include <externalapphandler.h>
45#endif //DESKTOP_VERSION 46#endif //DESKTOP_VERSION
46 47
47#endif 48#endif
48 49
49#include <libkcal/incidence.h> 50#include <libkcal/incidence.h>
50 51
51#include "koprefs.h" 52#include "koprefs.h"
52 53
53#include "koeditordetails.h" 54#include "koeditordetails.h"
54 55
55template <> 56template <>
56CustomListViewItem<class Attendee *>::~CustomListViewItem() 57CustomListViewItem<class Attendee *>::~CustomListViewItem()
57{ 58{
58 delete mData; 59 delete mData;
59} 60}
60 61
61template <> 62template <>
62void CustomListViewItem<class Attendee *>::updateItem() 63void CustomListViewItem<class Attendee *>::updateItem()
63{ 64{
64 setText(0,mData->name()); 65 setText(0,mData->name());
65 setText(1,mData->email()); 66 setText(1,mData->email());
66 setText(2,mData->roleStr()); 67 setText(2,mData->roleStr());
67 setText(3,mData->statusStr()); 68 setText(3,mData->statusStr());
68 if (mData->RSVP() && !mData->email().isEmpty()) { 69 if (mData->RSVP() && !mData->email().isEmpty()) {
69 setPixmap(4,SmallIcon("mailappt")); 70 setPixmap(4,SmallIcon("mailappt"));
70 setSortKey(4,"j"); 71 setSortKey(4,"j");
71 } 72 }
72 else { 73 else {
73 setPixmap(4,SmallIcon("nomailappt")); 74 setPixmap(4,SmallIcon("nomailappt"));
74 setSortKey(4,"n"); 75 setSortKey(4,"n");
75 } 76 }
76} 77}
77 78
78 79
79KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name) 80KOEditorDetails::KOEditorDetails (int spacing,QWidget* parent,const char* name)
80 : QWidget( parent, name), mDisableItemUpdate( false ) 81 : QWidget( parent, name), mDisableItemUpdate( false )
81{ 82{
82 QGridLayout *topLayout = new QGridLayout(this); 83 QGridLayout *topLayout = new QGridLayout(this);
83 topLayout->setSpacing(spacing); 84 topLayout->setSpacing(spacing);
85 topLayout->setMargin(KDialog::marginHint()-2);
84 86
85 QString organizer = KOPrefs::instance()->email(); 87 QString organizer = KOPrefs::instance()->email();
86 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this); 88 mOrganizerLabel = new QLabel(i18n("Organizer: %1").arg(organizer),this);
87 89
88 mListView = new KListView(this,"mListView"); 90 mListView = new KListView(this,"mListView");
89 mListView->addColumn(i18n("Name"),180); 91 mListView->addColumn(i18n("Name"),180);
90 mListView->addColumn(i18n("Email"),180); 92 mListView->addColumn(i18n("Email"),180);
91 mListView->addColumn(i18n("Role"),60); 93 mListView->addColumn(i18n("Role"),60);
92 mListView->addColumn(i18n("Status"),100); 94 mListView->addColumn(i18n("Status"),100);
93 mListView->addColumn(i18n("RSVP"),35); 95 mListView->addColumn(i18n("RSVP"),35);
94 if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) { 96 if ( QApplication::desktop()->width() <= 320 || QApplication::desktop()->height() <= 240) {
95 int hei = 80; 97 int hei = 80;
96 if ( QApplication::desktop()->height() <= 240 ) 98 if ( QApplication::desktop()->height() <= 240 )
97 hei = 60; 99 hei = 60;
98 mListView->setFixedHeight(hei); 100 mListView->setFixedHeight(hei);
99 } 101 }
100 mListView->setAllColumnsShowFocus (true ); 102 mListView->setAllColumnsShowFocus (true );
101 //mListView->setSingleClick( true ); 103 //mListView->setSingleClick( true );
102 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)), 104 connect(mListView,SIGNAL(selectionChanged(QListViewItem *)),
103 SLOT(updateAttendeeInput())); 105 SLOT(updateAttendeeInput()));
104 106
105 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )), 107 connect(mListView,SIGNAL(executed(QListViewItem * ,const QPoint&, int )),
106 SLOT(itemClicked(QListViewItem * ,const QPoint& , int ))); 108 SLOT(itemClicked(QListViewItem * ,const QPoint& , int )));
107 109
108 mRsvpButton = new QCheckBox(this); 110 mRsvpButton = new QCheckBox(this);
109 mRsvpButton->setText(i18n("Request response")); 111 mRsvpButton->setText(i18n("Request response"));
110 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this); 112 mAddressBookButton = new QPushButton(i18n("Address &Book..."),this);
111 QLabel *attendeeLabel = new QLabel(this); 113 QLabel *attendeeLabel = new QLabel(this);
112 attendeeLabel->setText(i18n("Name:")); 114 attendeeLabel->setText(i18n("Name:"));
113 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() ); 115 attendeeLabel->setFixedSize( attendeeLabel->sizeHint() );
114 mNameEdit = new QLineEdit(this); 116 mNameEdit = new QLineEdit(this);
115 connect(mNameEdit,SIGNAL(textChanged(const QString &)), 117 connect(mNameEdit,SIGNAL(textChanged(const QString &)),
116 SLOT(updateAttendeeItem())); 118 SLOT(updateAttendeeItem()));
117 119
118 mUidEdit = new QLineEdit(0); 120 mUidEdit = new QLineEdit(0);
119 mUidEdit->setText(""); 121 mUidEdit->setText("");
120 122
121 QLabel *emailLabel = new QLabel(this); 123 QLabel *emailLabel = new QLabel(this);
122 emailLabel->setText(i18n("Email:")); 124 emailLabel->setText(i18n("Email:"));
123 mEmailEdit = new QLineEdit(this); 125 mEmailEdit = new QLineEdit(this);
124 connect(mEmailEdit,SIGNAL(textChanged(const QString &)), 126 connect(mEmailEdit,SIGNAL(textChanged(const QString &)),
125 SLOT(updateAttendeeItem())); 127 SLOT(updateAttendeeItem()));
126 128
127 QLabel *attendeeRoleLabel = new QLabel(this); 129 QLabel *attendeeRoleLabel = new QLabel(this);
128 attendeeRoleLabel->setText(i18n("Role:")); 130 attendeeRoleLabel->setText(i18n("Role:"));
129 mRoleCombo = new QComboBox(false,this); 131 mRoleCombo = new QComboBox(false,this);
130 mRoleCombo->insertStringList(Attendee::roleList()); 132 mRoleCombo->insertStringList(Attendee::roleList());
131 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 133 connect(mRoleCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
132 134
133 QLabel *statusLabel = new QLabel(this); 135 QLabel *statusLabel = new QLabel(this);
134 statusLabel->setText( i18n("Status:") ); 136 statusLabel->setText( i18n("Status:") );
135 137
136 mStatusCombo = new QComboBox(false,this); 138 mStatusCombo = new QComboBox(false,this);
137 mStatusCombo->insertStringList(Attendee::statusList()); 139 mStatusCombo->insertStringList(Attendee::statusList());
138 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem())); 140 connect(mStatusCombo,SIGNAL(activated(int)),SLOT(updateAttendeeItem()));
139 141
140 142
141 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem())); 143 connect(mRsvpButton,SIGNAL(clicked()),SLOT(updateAttendeeItem()));
142 QWidget *buttonBox = new QWidget(this); 144 QWidget *buttonBox = new QWidget(this);
143 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox); 145 QVBoxLayout *buttonLayout = new QVBoxLayout(buttonBox);
144 146
145 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox); 147 QPushButton *newButton = new QPushButton(i18n("&New"),buttonBox);
146 buttonLayout->addWidget(newButton); 148 buttonLayout->addWidget(newButton);
147 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee())); 149 connect(newButton,SIGNAL(clicked()),SLOT(addNewAttendee()));
148 150
149 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox); 151 mRemoveButton = new QPushButton(i18n("&Remove"),buttonBox);
150 buttonLayout->addWidget(mRemoveButton); 152 buttonLayout->addWidget(mRemoveButton);
151 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee())); 153 connect(mRemoveButton, SIGNAL(clicked()),SLOT(removeAttendee()));
152 154
153 // buttonLayout->addWidget(mAddressBookButton); 155 // buttonLayout->addWidget(mAddressBookButton);
154 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook())); 156 connect(mAddressBookButton,SIGNAL(clicked()),SLOT(openAddressBook()));
155 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () ); 157 //mRoleCombo->setFixedSize( mRoleCombo->sizeHint () );
156 if ( QApplication::desktop()->height() <= 240 ) { 158 if ( QApplication::desktop()->height() <= 240 ) {
157 mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); 159 mRoleCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
158 mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) ); 160 mStatusCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Minimum ,FALSE) );
159 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); 161 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);
160 topLayout->addMultiCellWidget(mListView,1,1,0,5); 162 topLayout->addMultiCellWidget(mListView,1,1,0,5);
161 topLayout->addWidget(attendeeLabel,3,0); 163 topLayout->addWidget(attendeeLabel,3,0);
162 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); 164 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4);
163 topLayout->addWidget(emailLabel,4,0); 165 topLayout->addWidget(emailLabel,4,0);
164 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); 166 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4);
165 topLayout->addWidget(attendeeRoleLabel,5,0); 167 topLayout->addWidget(attendeeRoleLabel,5,0);
166 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); 168 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2);
167 topLayout->addWidget(statusLabel,5,3); 169 topLayout->addWidget(statusLabel,5,3);
168 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); 170 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5);
169 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,5); 171 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,5);
170 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 172 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
171 topLayout->addMultiCellWidget(buttonBox,3,4,5,5); 173 topLayout->addMultiCellWidget(buttonBox,3,4,5,5);
172 topLayout->setRowStretch(1,5); 174 topLayout->setRowStretch(1,5);
173 topLayout->setColStretch(0,0); 175 topLayout->setColStretch(0,0);
174 } else { 176 } else {
175 if (qApp->desktop()->width() < 640 ) { 177 if (qApp->desktop()->width() < 640 ) {
176 if ( qApp->desktop()->width() < 300 ) 178 if ( qApp->desktop()->width() < 300 )
177 topLayout->setSpacing(1); 179 topLayout->setSpacing(1);
178 ;//mListView->setFixedHeight(80); 180 ;//mListView->setFixedHeight(80);
179 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3); 181 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,3);
180 topLayout->addMultiCellWidget(mListView,1,1,0,3); 182 topLayout->addMultiCellWidget(mListView,1,1,0,3);
181 topLayout->addWidget(attendeeLabel,3,0); 183 topLayout->addWidget(attendeeLabel,3,0);
182 topLayout->addMultiCellWidget(mNameEdit,3,3,1,2); 184 topLayout->addMultiCellWidget(mNameEdit,3,3,1,2);
183 topLayout->addWidget(emailLabel,4,0); 185 topLayout->addWidget(emailLabel,4,0);
184 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2); 186 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,2);
185 topLayout->addWidget(attendeeRoleLabel,5,0); 187 topLayout->addWidget(attendeeRoleLabel,5,0);
186 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3); 188 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,3);
187 topLayout->addWidget(statusLabel,6,0); 189 topLayout->addWidget(statusLabel,6,0);
188 topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3); 190 topLayout->addMultiCellWidget(mStatusCombo,6,6,1,3);
189 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3); 191 topLayout->addMultiCellWidget(mAddressBookButton,2,2,2,3);
190 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 192 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
191 topLayout->addMultiCellWidget(buttonBox,3,4,3,3); 193 topLayout->addMultiCellWidget(buttonBox,3,4,3,3);
192 topLayout->setRowStretch(1,2); 194 topLayout->setRowStretch(1,2);
193 topLayout->setColStretch(0,0); 195 topLayout->setColStretch(0,0);
194 topLayout->setColStretch(1,2); 196 topLayout->setColStretch(1,2);
195 topLayout->setColStretch(2,1); 197 topLayout->setColStretch(2,1);
196 topLayout->setColStretch(3,1); 198 topLayout->setColStretch(3,1);
197 } else { 199 } else {
198 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5); 200 topLayout->addMultiCellWidget(mOrganizerLabel,0,0,0,5);
199 topLayout->addMultiCellWidget(mListView,1,1,0,5); 201 topLayout->addMultiCellWidget(mListView,1,1,0,5);
200 topLayout->addWidget(attendeeLabel,3,0); 202 topLayout->addWidget(attendeeLabel,3,0);
201 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4); 203 topLayout->addMultiCellWidget(mNameEdit,3,3,1,4);
202 topLayout->addWidget(emailLabel,4,0); 204 topLayout->addWidget(emailLabel,4,0);
203 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4); 205 topLayout->addMultiCellWidget(mEmailEdit,4,4,1,4);
204 topLayout->addWidget(attendeeRoleLabel,5,0); 206 topLayout->addWidget(attendeeRoleLabel,5,0);
205 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2); 207 topLayout->addMultiCellWidget(mRoleCombo,5,5,1,2);
206 topLayout->addWidget(statusLabel,5,3); 208 topLayout->addWidget(statusLabel,5,3);
207 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5); 209 topLayout->addMultiCellWidget(mStatusCombo,5,5,4,5);
208 topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5); 210 topLayout->addMultiCellWidget(mAddressBookButton,2,2,4,5);
209 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1); 211 topLayout->addMultiCellWidget(mRsvpButton,2,2,0,1);
210 topLayout->addMultiCellWidget(buttonBox,3,4,5,5); 212 topLayout->addMultiCellWidget(buttonBox,3,4,5,5);
211 topLayout->setRowStretch(1,5); 213 topLayout->setRowStretch(1,5);
212 topLayout->setColStretch(0,0); 214 topLayout->setColStretch(0,0);
213 } 215 }
214 } 216 }
215// #if 0 217// #if 0
216// topLayout->setColStretch(2,1); 218// topLayout->setColStretch(2,1);
217// topLayout->addWidget(statusLabel,3,3); 219// topLayout->addWidget(statusLabel,3,3);
218// topLayout->addWidget(mStatusCombo,3,4); 220// topLayout->addWidget(mStatusCombo,3,4);
219// #else 221// #else
220// topLayout->addWidget(statusLabel,4,3); 222// topLayout->addWidget(statusLabel,4,3);
221// // topLayout->addWidget(mStatusCombo,4,3); 223// // topLayout->addWidget(mStatusCombo,4,3);
222// topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5); 224// topLayout->addMultiCellWidget(mStatusCombo,4,4,4,5);
223 225
224// #endif 226// #endif
225// // topLayout->setRowStretch(5,1); 227// // topLayout->setRowStretch(5,1);
226// topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1); 228// topLayout->addMultiCellWidget(mRsvpButton,5,5,0,1);
227// topLayout->addMultiCellWidget(buttonBox,2,3,5,5); 229// topLayout->addMultiCellWidget(buttonBox,2,3,5,5);
228// topLayout->setRowStretch(1,5); 230// topLayout->setRowStretch(1,5);
229// topLayout->setColStretch(0,0); 231// topLayout->setColStretch(0,0);
230 232
231#ifdef KORG_NOKABC 233#ifdef KORG_NOKABC
232 mAddressBookButton->hide(); 234 mAddressBookButton->hide();
233#endif 235#endif
234 236
235 updateAttendeeInput(); 237 updateAttendeeInput();
236#ifndef DESKTOP_VERSION 238#ifndef DESKTOP_VERSION
237//US listen for arriving address resultsets 239//US listen for arriving address resultsets
238 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)), 240 connect(ExternalAppHandler::instance(), SIGNAL(receivedNameEmailUidListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&)),
239 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&))); 241 this, SLOT(insertAttendees(const QString&, const QStringList&, const QStringList&, const QStringList&)));
240#endif 242#endif
241 243
242} 244}
243 245
244KOEditorDetails::~KOEditorDetails() 246KOEditorDetails::~KOEditorDetails()
245{ 247{
246} 248}
247 249
248void KOEditorDetails::removeAttendee() 250void KOEditorDetails::removeAttendee()
249{ 251{
250 AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem(); 252 AttendeeListItem *aItem = (AttendeeListItem *)mListView->selectedItem();
251 if (!aItem) return; 253 if (!aItem) return;
252 254
253 Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(), 255 Attendee *delA = new Attendee(aItem->data()->name(),aItem->data()->email(),
254 aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(), 256 aItem->data()->RSVP(),aItem->data()->status(),aItem->data()->role(),
255 aItem->data()->uid()); 257 aItem->data()->uid());
256 mdelAttendees.append(delA); 258 mdelAttendees.append(delA);
257 259
258 delete aItem; 260 delete aItem;
259 261
260 updateAttendeeInput(); 262 updateAttendeeInput();
261} 263}
262 264
263 265
264void KOEditorDetails::openAddressBook() 266void KOEditorDetails::openAddressBook()
265{ 267{
266#ifndef KORG_NOKABC 268#ifndef KORG_NOKABC
267 269
268#ifdef DESKTOP_VERSION 270#ifdef DESKTOP_VERSION
269 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 271 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
270 uint i=0; 272 uint i=0;
271 for (i=0; i < list.count(); i++) { 273 for (i=0; i < list.count(); i++) {
272 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) ); 274 insertAttendee( new Attendee( list[i].realName(), list[i].preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,list[i].uid()) );
273 } 275 }
274#else 276#else
275 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); 277 bool res = ExternalAppHandler::instance()->requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/);
276 // the result should now arrive through method insertAttendees 278 // the result should now arrive through method insertAttendees
277#endif 279#endif
278 280
279 281
280#if 0 282#if 0
281 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this); 283 KABC::Addressee a = KABC::AddresseeDialog::getAddressee(this);
282 if (!a.isEmpty()) { 284 if (!a.isEmpty()) {
283 insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) ); 285 insertAttendee( new Attendee( a.realName(), a.preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,a.uid()) );
284 } 286 }
285#endif 287#endif
286#endif 288#endif
287} 289}
288 290
289 291
290void KOEditorDetails::addNewAttendee() 292void KOEditorDetails::addNewAttendee()
291{ 293{
292#if 0 294#if 0
293 // this is cool. If they didn't enter an email address, 295 // this is cool. If they didn't enter an email address,
294 // try to look it up in the address book and fill it in for them. 296 // try to look it up in the address book and fill it in for them.
295 if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) { 297 if (QString(mEmailEdit->text()).stripWhiteSpace().isEmpty()) {
296 KabAPI addrBook; 298 KabAPI addrBook;
297 QString name; 299 QString name;
298 std::list<AddressBook::Entry> entries; 300 std::list<AddressBook::Entry> entries;
299 name = mNameEdit->text(); 301 name = mNameEdit->text();
300 if (addrBook.init() == AddressBook::NoError) { 302 if (addrBook.init() == AddressBook::NoError) {
301 if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) { 303 if (addrBook.getEntryByName(name, entries, 1) == AddressBook::NoError) {
302 kdDebug() << "positive match" << endl; 304 kdDebug() << "positive match" << endl;
303 // take first email address 305 // take first email address
304 if (!entries.front().emails.isEmpty() && 306 if (!entries.front().emails.isEmpty() &&
305 entries.front().emails.first().length()>0) 307 entries.front().emails.first().length()>0)
306 mEmailEdit->setText(entries.front().emails.first()); 308 mEmailEdit->setText(entries.front().emails.first());
307 } 309 }
308 } 310 }
309 } 311 }
310#endif 312#endif
311 313
312 Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)")); 314 Attendee *a = new Attendee(i18n("(EmptyName)"),i18n("(EmptyEmail)"));
313 insertAttendee(a); 315 insertAttendee(a);
314} 316}
315 317
316//the map includes name/email pairs, that comes from Ka/Pi 318//the map includes name/email pairs, that comes from Ka/Pi
317void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList) 319void KOEditorDetails::insertAttendees(const QString& uid,const QStringList& nameList,const QStringList& emailList,const QStringList& uidList)
318{ 320{
319 if (uid == this->name()) 321 if (uid == this->name())
320 { 322 {
321 for ( int i = 0; i < nameList.count(); i++) 323 for ( int i = 0; i < nameList.count(); i++)
322 { 324 {
323 QString _name = nameList[i]; 325 QString _name = nameList[i];
324 QString _email = emailList[i]; 326 QString _email = emailList[i];
325 QString _uid = uidList[i]; 327 QString _uid = uidList[i];
326 328
327 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid); 329 Attendee *a = new Attendee(_name,_email,false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant, _uid);
328 insertAttendee(a); 330 insertAttendee(a);
329 } 331 }
330 } 332 }
331 333
332} 334}
333 335
334void KOEditorDetails::insertAttendee(Attendee *a) 336void KOEditorDetails::insertAttendee(Attendee *a)
335{ 337{
336 AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild(); 338 AttendeeListItem *first = (AttendeeListItem*) mListView->firstChild();
337 while (first) { 339 while (first) {
338 if ( first->data()->name() == a->name() && first->data()->email() == a->email() ) 340 if ( first->data()->name() == a->name() && first->data()->email() == a->email() )
339 return; 341 return;
340 first = (AttendeeListItem*) first->nextSibling(); 342 first = (AttendeeListItem*) first->nextSibling();
341 } 343 }
342 344
343 AttendeeListItem *item = new AttendeeListItem(a,mListView); 345 AttendeeListItem *item = new AttendeeListItem(a,mListView);
344 mListView->setSelected( item, true ); 346 mListView->setSelected( item, true );
345} 347}
346 348
347void KOEditorDetails::setDefaults() 349void KOEditorDetails::setDefaults()
348{ 350{
349 mRsvpButton->setChecked(true); 351 mRsvpButton->setChecked(true);
350 mListView->clear(); 352 mListView->clear();
351 mdelAttendees.clear(); 353 mdelAttendees.clear();
352 clearAttendeeInput(); 354 clearAttendeeInput();
353 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email())); 355 mOrganizerLabel->setText(i18n("Organizer: %1").arg(KOPrefs::instance()->email()));
354 356
355 mNameEdit->setText(""); 357 mNameEdit->setText("");
356 mUidEdit->setText(""); 358 mUidEdit->setText("");
357 mEmailEdit->setText(""); 359 mEmailEdit->setText("");
358 mRoleCombo->setCurrentItem( 0 ); 360 mRoleCombo->setCurrentItem( 0 );
359 mStatusCombo->setCurrentItem( 0 ); 361 mStatusCombo->setCurrentItem( 0 );
360 362
361} 363}
362 364
363void KOEditorDetails::readEvent(Incidence *event) 365void KOEditorDetails::readEvent(Incidence *event)
364{ 366{
365 setDefaults(); 367 setDefaults();
366 //mListView->clear(); 368 //mListView->clear();
367 //mdelAttendees.clear(); 369 //mdelAttendees.clear();
368 QPtrList<Attendee> tmpAList = event->attendees(); 370 QPtrList<Attendee> tmpAList = event->attendees();
369 Attendee *a; 371 Attendee *a;
370 for (a = tmpAList.first(); a; a = tmpAList.next()) 372 for (a = tmpAList.first(); a; a = tmpAList.next())
371 insertAttendee(new Attendee(*a)); 373 insertAttendee(new Attendee(*a));
372 374
373 mListView->setSelected( mListView->firstChild(), true ); 375 mListView->setSelected( mListView->firstChild(), true );
374 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer())); 376 mOrganizerLabel->setText(i18n("Organizer: %1").arg(event->organizer()));
375} 377}
376 378
377void KOEditorDetails::writeEvent(Incidence *event) 379void KOEditorDetails::writeEvent(Incidence *event)
378{ 380{
379 event->clearAttendees(); 381 event->clearAttendees();
380 QListViewItem *item; 382 QListViewItem *item;
381 AttendeeListItem *a; 383 AttendeeListItem *a;
382 for (item = mListView->firstChild(); item; 384 for (item = mListView->firstChild(); item;
383 item = item->nextSibling()) { 385 item = item->nextSibling()) {
384 a = (AttendeeListItem *)item; 386 a = (AttendeeListItem *)item;
385 event->addAttendee(new Attendee(*(a->data()))); 387 event->addAttendee(new Attendee(*(a->data())));
386 } 388 }
387 event->setOrganizer(KOPrefs::instance()->email()); 389 event->setOrganizer(KOPrefs::instance()->email());
388} 390}
389 391
390void KOEditorDetails::cancelAttendeeEvent(Incidence *event) 392void KOEditorDetails::cancelAttendeeEvent(Incidence *event)
391{ 393{
392 event->clearAttendees(); 394 event->clearAttendees();
393 Attendee * att; 395 Attendee * att;
394 for (att=mdelAttendees.first();att;att=mdelAttendees.next()) { 396 for (att=mdelAttendees.first();att;att=mdelAttendees.next()) {
395 event->addAttendee(new Attendee(*att)); 397 event->addAttendee(new Attendee(*att));
396 } 398 }
397 mdelAttendees.clear(); 399 mdelAttendees.clear();
398} 400}
399 401
400bool KOEditorDetails::validateInput() 402bool KOEditorDetails::validateInput()
401{ 403{
402 return true; 404 return true;
403} 405}
404 406
405void KOEditorDetails::updateAttendeeInput() 407void KOEditorDetails::updateAttendeeInput()
406{ 408{
407 QListViewItem *item = mListView->selectedItem(); 409 QListViewItem *item = mListView->selectedItem();
408 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 410 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
409 if (aItem) { 411 if (aItem) {
410 fillAttendeeInput( aItem ); 412 fillAttendeeInput( aItem );
411 } else { 413 } else {
412 clearAttendeeInput(); 414 clearAttendeeInput();
413 } 415 }
414} 416}
415 417
416void KOEditorDetails::clearAttendeeInput() 418void KOEditorDetails::clearAttendeeInput()
417{ 419{
418 mNameEdit->setText(""); 420 mNameEdit->setText("");
419 mUidEdit->setText(""); 421 mUidEdit->setText("");
420 mEmailEdit->setText(""); 422 mEmailEdit->setText("");
421 mRoleCombo->setCurrentItem(0); 423 mRoleCombo->setCurrentItem(0);
422 mStatusCombo->setCurrentItem(0); 424 mStatusCombo->setCurrentItem(0);
423 mRsvpButton->setChecked(true); 425 mRsvpButton->setChecked(true);
424 setEnabledAttendeeInput( false ); 426 setEnabledAttendeeInput( false );
425} 427}
426 428
427void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem ) 429void KOEditorDetails::fillAttendeeInput( AttendeeListItem *aItem )
428{ 430{
429 Attendee *a = aItem->data(); 431 Attendee *a = aItem->data();
430 mDisableItemUpdate = true; 432 mDisableItemUpdate = true;
431 mNameEdit->setText(a->name()); 433 mNameEdit->setText(a->name());
432 mUidEdit->setText(a->uid()); 434 mUidEdit->setText(a->uid());
433 mEmailEdit->setText(a->email()); 435 mEmailEdit->setText(a->email());
434 mRoleCombo->setCurrentItem(a->role()); 436 mRoleCombo->setCurrentItem(a->role());
435 mStatusCombo->setCurrentItem(a->status()); 437 mStatusCombo->setCurrentItem(a->status());
436 mRsvpButton->setChecked(a->RSVP()); 438 mRsvpButton->setChecked(a->RSVP());
437 439
438 mDisableItemUpdate = false; 440 mDisableItemUpdate = false;
439 441
440 setEnabledAttendeeInput( true ); 442 setEnabledAttendeeInput( true );
441} 443}
442 444
443void KOEditorDetails::setEnabledAttendeeInput( bool enabled ) 445void KOEditorDetails::setEnabledAttendeeInput( bool enabled )
444{ 446{
445 mNameEdit->setEnabled( enabled ); 447 mNameEdit->setEnabled( enabled );
446 mEmailEdit->setEnabled( enabled ); 448 mEmailEdit->setEnabled( enabled );
447 mRoleCombo->setEnabled( enabled ); 449 mRoleCombo->setEnabled( enabled );
448 mStatusCombo->setEnabled( enabled ); 450 mStatusCombo->setEnabled( enabled );
449 mRsvpButton->setEnabled( enabled ); 451 mRsvpButton->setEnabled( enabled );
450 452
451 mRemoveButton->setEnabled( enabled ); 453 mRemoveButton->setEnabled( enabled );
452} 454}
453 455
454void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c ) 456void KOEditorDetails::itemClicked(QListViewItem * item ,const QPoint & pnt, int c )
455{ 457{
456 if ( item && c == 4 ) { 458 if ( item && c == 4 ) {
457 mRsvpButton->setChecked( !mRsvpButton->isChecked() ); 459 mRsvpButton->setChecked( !mRsvpButton->isChecked() );
458 updateAttendeeItem(); 460 updateAttendeeItem();
459 } 461 }
460} 462}
461void KOEditorDetails::updateAttendeeItem() 463void KOEditorDetails::updateAttendeeItem()
462{ 464{
463 if (mDisableItemUpdate) return; 465 if (mDisableItemUpdate) return;
464 466
465 QListViewItem *item = mListView->selectedItem(); 467 QListViewItem *item = mListView->selectedItem();
466 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item ); 468 AttendeeListItem *aItem = static_cast<AttendeeListItem *>( item );
467 if ( !aItem ) return; 469 if ( !aItem ) return;
468 470
469 Attendee *a = aItem->data(); 471 Attendee *a = aItem->data();
470 472
471 a->setName( mNameEdit->text() ); 473 a->setName( mNameEdit->text() );
472 a->setUid( mUidEdit->text() ); 474 a->setUid( mUidEdit->text() );
473 a->setEmail( mEmailEdit->text() ); 475 a->setEmail( mEmailEdit->text() );
474 if ( mEmailEdit->text().isEmpty() ) 476 if ( mEmailEdit->text().isEmpty() )
475 mRsvpButton->setChecked( false ); 477 mRsvpButton->setChecked( false );
476 a->setRSVP( mRsvpButton->isChecked() ); 478 a->setRSVP( mRsvpButton->isChecked() );
477 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) ); 479 a->setRole( Attendee::Role( mRoleCombo->currentItem() ) );
478 a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) ); 480 a->setStatus( Attendee::PartStat( mStatusCombo->currentItem() ) );
479 aItem->updateItem(); 481 aItem->updateItem();
480} 482}
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index e07bc53..29e68b3 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -1,569 +1,572 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 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 <qwidget.h> 24#include <qwidget.h>
25#include <qtooltip.h> 25#include <qtooltip.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qregexp.h> 34#include <qregexp.h>
35 35
36 36
37#include <kglobal.h> 37#include <kglobal.h>
38#include <kdialog.h>
38#include <kdebug.h> 39#include <kdebug.h>
39#include <klocale.h> 40#include <klocale.h>
40#include <kiconloader.h> 41#include <kiconloader.h>
41#include <kmessagebox.h> 42#include <kmessagebox.h>
42#include <kfiledialog.h> 43#include <kfiledialog.h>
43#include <kstandarddirs.h> 44#include <kstandarddirs.h>
44 45
45#include <libkcal/todo.h> 46#include <libkcal/todo.h>
46#include <libkcal/event.h> 47#include <libkcal/event.h>
47#include <libkdepim/categoryselectdialog.h> 48#include <libkdepim/categoryselectdialog.h>
48#include <libkdepim/kdateedit.h> 49#include <libkdepim/kdateedit.h>
49 50
50#include "koprefs.h" 51#include "koprefs.h"
51#include "koglobals.h" 52#include "koglobals.h"
52 53
53#include "koeditorgeneral.h" 54#include "koeditorgeneral.h"
54#include "kolocationbox.h" 55#include "kolocationbox.h"
55#ifndef DESKTOP_VERSION 56#ifndef DESKTOP_VERSION
56#include <qpe/qpeapplication.h> 57#include <qpe/qpeapplication.h>
57#else 58#else
58#include <qapplication.h> 59#include <qapplication.h>
59#endif 60#endif
60 61
61KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) : 62KOEditorGeneral::KOEditorGeneral(QObject* parent, const char* name) :
62 QObject( parent, name) 63 QObject( parent, name)
63{ 64{
64 mNextFocus = 0; 65 mNextFocus = 0;
65} 66}
66 67
67KOEditorGeneral::~KOEditorGeneral() 68KOEditorGeneral::~KOEditorGeneral()
68{ 69{
69} 70}
70 71
71void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) 72void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout)
72{ 73{
73 QGridLayout *headerLayout = new QGridLayout(topLayout); 74 QGridLayout *headerLayout = new QGridLayout(topLayout);
74 75
75#if 0 76#if 0
76 mOwnerLabel = new QLabel(i18n("Owner:"),parent); 77 mOwnerLabel = new QLabel(i18n("Owner:"),parent);
77 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1); 78 headerLayout->addMultiCellWidget(mOwnerLabel,0,0,0,1);
78#endif 79#endif
79 80 // 1 on pda
81 // 11 on desktop
82 headerLayout->setSpacing( (KDialog::spacingHint()-3)*2+1 );
80 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent); 83 QLabel *summaryLabel = new QLabel(i18n("Summary:"),parent);
81 headerLayout->addWidget(summaryLabel,1,0); 84 headerLayout->addWidget(summaryLabel,1,0);
82 85
83 mSummaryEdit = new KOLocationBox(TRUE,parent, 10); 86 mSummaryEdit = new KOLocationBox(TRUE,parent, 10);
84 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 87 mSummaryEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
85 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) ); 88 //mSummaryEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5 ,(QSizePolicy::SizeType)3 ,FALSE) );
86 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() ); 89 //qDebug("h %d %d ", summaryLabel->sizeHint().height(),mSummaryEdit->sizeHint().height() );
87 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2; 90 int hei = (summaryLabel->sizeHint().height() + mSummaryEdit->sizeHint().height())/2;
88 if ( QApplication::desktop()->width() > 320 ) 91 if ( QApplication::desktop()->width() > 320 )
89 mSummaryEdit->setMaximumHeight( hei +6 ); 92 mSummaryEdit->setMaximumHeight( hei +6 );
90 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding ); 93 //qDebug("%d %d %d %d %d %d ", QSizePolicy::Fixed , QSizePolicy::Minimum , QSizePolicy:: Maximum , QSizePolicy:: Preferred , QSizePolicy:: MinimumExpanding , QSizePolicy::Expanding );
91 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink } 94 // SizeType { Fixed = 0, Minimum = MayGrow, Maximum = MayShrink, Preferred = MayGrow|MayShrink, MinimumExpanding = Minimum|ExpMask, Expanding = MinimumExpanding|MayShrink }
92 // mSummaryEdit = new QLineEdit(parent); 95 // mSummaryEdit = new QLineEdit(parent);
93 headerLayout->addWidget(mSummaryEdit,1,1); 96 headerLayout->addWidget(mSummaryEdit,1,1);
94 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 97 connect ( mSummaryEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
95 98
96 QLabel *locationLabel = new QLabel(i18n("Location:"),parent); 99 QLabel *locationLabel = new QLabel(i18n("Location:"),parent);
97 if ( QApplication::desktop()->height() < 320 ) 100 if ( QApplication::desktop()->height() < 320 )
98 headerLayout->addWidget(locationLabel,1,2); 101 headerLayout->addWidget(locationLabel,1,2);
99 else 102 else
100 headerLayout->addWidget(locationLabel,2,0); 103 headerLayout->addWidget(locationLabel,2,0);
101 104
102 mLocationEdit = new KOLocationBox(TRUE,parent,10); 105 mLocationEdit = new KOLocationBox(TRUE,parent,10);
103 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 106 mLocationEdit->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) );
104 if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 ) 107 if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->height() > 240 )
105 mLocationEdit->setMaximumHeight( hei + 6); 108 mLocationEdit->setMaximumHeight( hei + 6);
106 109
107 // mLocationEdit = new QLineEdit(parent); 110 // mLocationEdit = new QLineEdit(parent);
108 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) ); 111 connect ( mLocationEdit->lineEdit(), SIGNAL ( returnPressed() ), this, SIGNAL (allAccepted () ) );
109 if ( QApplication::desktop()->height() < 320 ) { 112 if ( QApplication::desktop()->height() < 320 ) {
110 headerLayout->addWidget(mLocationEdit,1,3); 113 headerLayout->addWidget(mLocationEdit,1,3);
111 headerLayout->setColStretch( 1, 10); 114 headerLayout->setColStretch( 1, 10);
112 headerLayout->setColStretch( 3, 10); 115 headerLayout->setColStretch( 3, 10);
113 } 116 }
114 else { 117 else {
115 headerLayout->addWidget(mLocationEdit,2,1); 118 headerLayout->addWidget(mLocationEdit,2,1);
116 headerLayout->setColStretch( 1, 10); 119 headerLayout->setColStretch( 1, 10);
117 } 120 }
118} 121}
119void KOEditorGeneral::setFocusOn( int i ) 122void KOEditorGeneral::setFocusOn( int i )
120{ 123{
121 mNextFocus = i; 124 mNextFocus = i;
122 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); 125 QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() ));
123} 126}
124void KOEditorGeneral::slotSetFocusOn() 127void KOEditorGeneral::slotSetFocusOn()
125{ 128{
126 mNextFocus; 129 mNextFocus;
127 if ( mNextFocus == 1 ) { 130 if ( mNextFocus == 1 ) {
128 mDescriptionEdit->setFocus(); 131 mDescriptionEdit->setFocus();
129 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); 132 mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333);
130 } 133 }
131 if ( mNextFocus == 2 ) { 134 if ( mNextFocus == 2 ) {
132 mSummaryEdit->setFocus(); 135 mSummaryEdit->setFocus();
133 } 136 }
134} 137}
135void KOEditorGeneral::editCategories() 138void KOEditorGeneral::editCategories()
136{ 139{
137 // qDebug("KOEditorGeneral::editCategories() "); 140 // qDebug("KOEditorGeneral::editCategories() ");
138 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); 141 KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 );
139 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &))); 142 connect(csd,SIGNAL(categoriesSelected(const QString &)), this ,SLOT(setCategories(const QString &)));
140 //KOGlobals::fitDialogToScreen( csd ); 143 //KOGlobals::fitDialogToScreen( csd );
141 csd->setColorEnabled(); 144 csd->setColorEnabled();
142 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) ); 145 csd->setSelected( QStringList::split (",", mCategoriesLabel->text()) );
143 csd->exec(); 146 csd->exec();
144 delete csd; 147 delete csd;
145} 148}
146 149
147void KOEditorGeneral::showCatPopup() 150void KOEditorGeneral::showCatPopup()
148{ 151{
149 mCatPopup->clear(); 152 mCatPopup->clear();
150 QStringList checkedCategories = QStringList::split (",", mCategoriesLabel->text()); 153 QStringList checkedCategories = QStringList::split (",", mCategoriesLabel->text());
151 int index = 0; 154 int index = 0;
152 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 155 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
153 it != KOPrefs::instance()->mCustomCategories.end (); 156 it != KOPrefs::instance()->mCustomCategories.end ();
154 ++it) { 157 ++it) {
155 mCatPopup->insertItem (*it, index ); 158 mCatPopup->insertItem (*it, index );
156 //mCategory[index] = *it; 159 //mCategory[index] = *it;
157 if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true); 160 if (checkedCategories.find (*it) != checkedCategories.end ()) mCatPopup->setItemChecked (index, true);
158 ++index; 161 ++index;
159 } 162 }
160} 163}
161void KOEditorGeneral::selectedCatPopup( int index ) 164void KOEditorGeneral::selectedCatPopup( int index )
162{ 165{
163 QStringList categories = QStringList::split (",", mCategoriesLabel->text()); 166 QStringList categories = QStringList::split (",", mCategoriesLabel->text());
164 QString colcat = categories.first(); 167 QString colcat = categories.first();
165 if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ()) 168 if (categories.find (KOPrefs::instance()->mCustomCategories[index]) != categories.end ())
166 categories.remove (KOPrefs::instance()->mCustomCategories[index]); 169 categories.remove (KOPrefs::instance()->mCustomCategories[index]);
167 else 170 else
168 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]); 171 categories.insert (categories.end(), KOPrefs::instance()->mCustomCategories[index]);
169 categories.sort (); 172 categories.sort ();
170 if ( !colcat.isEmpty() ) { 173 if ( !colcat.isEmpty() ) {
171 if ( categories.find ( colcat ) != categories.end () ) { 174 if ( categories.find ( colcat ) != categories.end () ) {
172 categories.remove( colcat ); 175 categories.remove( colcat );
173 categories.prepend( colcat ); 176 categories.prepend( colcat );
174 } 177 }
175 } 178 }
176 setCategories( categories.join(",") ); 179 setCategories( categories.join(",") );
177} 180}
178 181
179void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout) 182void KOEditorGeneral::initCategories(QWidget *parent, QBoxLayout *topLayout)
180{ 183{
181 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout ); 184 QBoxLayout *categoriesLayout = new QHBoxLayout( topLayout );
182 mCatPopup = new QPopupMenu ( parent ); 185 mCatPopup = new QPopupMenu ( parent );
183 mCatPopup->setCheckable (true); 186 mCatPopup->setCheckable (true);
184 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup())); 187 connect(mCatPopup,SIGNAL(aboutToShow () ), this ,SLOT(showCatPopup()));
185 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int ))); 188 connect(mCatPopup,SIGNAL( activated ( int ) ), this ,SLOT(selectedCatPopup( int )));
186 mCategoriesButton = new QPushButton(parent); 189 mCategoriesButton = new QPushButton(parent);
187 mCategoriesButton->setText(i18n("Categories...")); 190 mCategoriesButton->setText(i18n("Categories..."));
188 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 191 connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
189 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() )); 192 //connect(mCategoriesButton,SIGNAL(clicked()),this, SLOT(editCategories() ));
190 categoriesLayout->addWidget(mCategoriesButton); 193 categoriesLayout->addWidget(mCategoriesButton);
191 mCategoriesLabel = new QPushButton(parent);//new QLabel(parent); 194 mCategoriesLabel = new QPushButton(parent);//new QLabel(parent);
192 mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::MinimumExpanding ,FALSE) ); 195 mCategoriesLabel->setSizePolicy( QSizePolicy( QSizePolicy::Preferred ,QSizePolicy::Fixed ,FALSE) );
193 mCategoriesLabel->setPopup( mCatPopup ); 196 mCategoriesLabel->setPopup( mCatPopup );
194 //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken); 197 //mCategoriesLabel->setFrameStyle(QFrame::Panel|QFrame::Sunken);
195 categoriesLayout->addWidget(mCategoriesLabel,1); 198 categoriesLayout->addWidget(mCategoriesLabel,1);
196} 199}
197 200
198void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout) 201void KOEditorGeneral::initSecrecy(QWidget *parent, QBoxLayout *topLayout)
199{ 202{
200 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout ); 203 QBoxLayout *secrecyLayout = new QHBoxLayout( topLayout );
201 204
202 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent); 205 QLabel *secrecyLabel = new QLabel(i18n("Access:"),parent);
203 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent); 206 mCancelBox = new QCheckBox ( i18n("Cancelled"), parent);
204 secrecyLayout->addWidget(mCancelBox); 207 secrecyLayout->addWidget(mCancelBox);
205 secrecyLayout->addWidget(secrecyLabel); 208 secrecyLayout->addWidget(secrecyLabel);
206 209
207 mSecrecyCombo = new QComboBox(parent); 210 mSecrecyCombo = new QComboBox(parent);
208 mSecrecyCombo->insertStringList(Incidence::secrecyList()); 211 mSecrecyCombo->insertStringList(Incidence::secrecyList());
209 secrecyLayout->addWidget(mSecrecyCombo); 212 secrecyLayout->addWidget(mSecrecyCombo);
210} 213}
211 214
212void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout) 215void KOEditorGeneral::initDescription(QWidget *parent,QBoxLayout *topLayout)
213{ 216{
214 mDescriptionEdit = new KTextEdit(parent); 217 mDescriptionEdit = new KTextEdit(parent);
215 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont ); 218 mDescriptionEdit->setFont(KOPrefs::instance()->mEditBoxFont );
216 mDescriptionEdit->append(""); 219 mDescriptionEdit->append("");
217 mDescriptionEdit->setReadOnly(false); 220 mDescriptionEdit->setReadOnly(false);
218 mDescriptionEdit->setOverwriteMode(false); 221 mDescriptionEdit->setOverwriteMode(false);
219 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth ); 222 mDescriptionEdit->setWordWrap( KTextEdit::WidgetWidth );
220 topLayout->addWidget(mDescriptionEdit); 223 topLayout->addWidget(mDescriptionEdit);
221#ifndef DESKTOP_VERSION 224#ifndef DESKTOP_VERSION
222 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold ); 225 QPEApplication::setStylusOperation( mDescriptionEdit, QPEApplication::RightOnHold );
223#endif 226#endif
224 227
225} 228}
226 229
227void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) 230void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout)
228{ 231{
229 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout); 232 QBoxLayout *alarmLayout = new QHBoxLayout(topLayout);
230 233
231 //mAlarmBell = new QLabel(parent); 234 //mAlarmBell = new QLabel(parent);
232 //mAlarmBell->setPixmap(SmallIcon("bell")); 235 //mAlarmBell->setPixmap(SmallIcon("bell"));
233 //alarmLayout->addWidget(mAlarmBell); 236 //alarmLayout->addWidget(mAlarmBell);
234 if ( QApplication::desktop()->width() < 320 ) 237 if ( QApplication::desktop()->width() < 320 )
235 mAlarmButton = new QCheckBox(i18n("Rem."),parent); 238 mAlarmButton = new QCheckBox(i18n("Rem."),parent);
236 else 239 else
237 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent); 240 mAlarmButton = new QCheckBox(i18n("Reminder:"),parent);
238 241
239 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool))); 242 connect(mAlarmButton, SIGNAL(toggled(bool)), SLOT(enableAlarmEdit(bool)));
240 alarmLayout->addWidget(mAlarmButton); 243 alarmLayout->addWidget(mAlarmButton);
241 244
242 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ; 245 mAlarmTimeEdit = new QSpinBox ( 0, 9999, 1, parent, "mAlarmTimeEdit " ) ;
243 mAlarmTimeEdit->setButtonSymbols( QSpinBox::PlusMinus ); 246 mAlarmTimeEdit->setButtonSymbols( QSpinBox::PlusMinus );
244 alarmLayout->addWidget(mAlarmTimeEdit); 247 alarmLayout->addWidget(mAlarmTimeEdit);
245 mAlarmIncrCombo = new QComboBox(false, parent); 248 mAlarmIncrCombo = new QComboBox(false, parent);
246 if ( QApplication::desktop()->width() < 320 ) { 249 if ( QApplication::desktop()->width() < 320 ) {
247 mAlarmIncrCombo->insertItem(i18n("min")); 250 mAlarmIncrCombo->insertItem(i18n("min"));
248 mAlarmIncrCombo->insertItem(i18n("hou")); 251 mAlarmIncrCombo->insertItem(i18n("hou"));
249 mAlarmIncrCombo->insertItem(i18n("day")); 252 mAlarmIncrCombo->insertItem(i18n("day"));
250 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() ); 253 mAlarmTimeEdit->setMaximumWidth( mAlarmTimeEdit->sizeHint().width() );
251 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() ); 254 mAlarmIncrCombo->setMaximumWidth( mAlarmIncrCombo->sizeHint().width() );
252 } else { 255 } else {
253 mAlarmIncrCombo->insertItem(i18n("minute(s)")); 256 mAlarmIncrCombo->insertItem(i18n("minute(s)"));
254 mAlarmIncrCombo->insertItem(i18n("hour(s)")); 257 mAlarmIncrCombo->insertItem(i18n("hour(s)"));
255 mAlarmIncrCombo->insertItem(i18n("day(s)")); 258 mAlarmIncrCombo->insertItem(i18n("day(s)"));
256 } 259 }
257 260
258 // mAlarmIncrCombo->setMinimumHeight(20); 261 // mAlarmIncrCombo->setMinimumHeight(20);
259 alarmLayout->addWidget(mAlarmIncrCombo); 262 alarmLayout->addWidget(mAlarmIncrCombo);
260 mAlarmSoundButton = new QPushButton(parent); 263 mAlarmSoundButton = new QPushButton(parent);
261 mAlarmSoundButton->setPixmap(SmallIcon("playsound")); 264 mAlarmSoundButton->setPixmap(SmallIcon("playsound"));
262 mAlarmSoundButton->setToggleButton(true); 265 mAlarmSoundButton->setToggleButton(true);
263 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 266 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
264 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); 267 connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound()));
265 alarmLayout->addWidget(mAlarmSoundButton); 268 alarmLayout->addWidget(mAlarmSoundButton);
266 269
267 mAlarmProgramButton = new QPushButton(parent); 270 mAlarmProgramButton = new QPushButton(parent);
268 mAlarmProgramButton->setPixmap(SmallIcon("run")); 271 mAlarmProgramButton->setPixmap(SmallIcon("run"));
269 mAlarmProgramButton->setToggleButton(true); 272 mAlarmProgramButton->setToggleButton(true);
270 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 273 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
271 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); 274 connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram()));
272 alarmLayout->addWidget(mAlarmProgramButton); 275 alarmLayout->addWidget(mAlarmProgramButton);
273 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); 276 mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 );
274 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); 277 mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 );
275 // if ( KOPrefs::instance()->mCompactDialogs ) { 278 // if ( KOPrefs::instance()->mCompactDialogs ) {
276 // mAlarmSoundButton->hide(); 279 // mAlarmSoundButton->hide();
277 // mAlarmProgramButton->hide(); 280 // mAlarmProgramButton->hide();
278 // } 281 // }
279} 282}
280 283
281void KOEditorGeneral::pickAlarmSound() 284void KOEditorGeneral::pickAlarmSound()
282{ 285{
283 286
284 //qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); 287 //qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() );
285 288
286 bool oldState = mAlarmSoundButton->isOn(); 289 bool oldState = mAlarmSoundButton->isOn();
287 290
288 QString fileName(KFileDialog::getOpenFileName(mAlarmSound, 291 QString fileName(KFileDialog::getOpenFileName(mAlarmSound,
289 i18n("*.wav|Wav Files"), 0)); 292 i18n("*.wav|Wav Files"), 0));
290 if (!fileName.isEmpty()) { 293 if (!fileName.isEmpty()) {
291 mAlarmSound = fileName; 294 mAlarmSound = fileName;
292 QToolTip::remove(mAlarmSoundButton); 295 QToolTip::remove(mAlarmSoundButton);
293 QString dispStr = i18n("Playing '%1'").arg(fileName); 296 QString dispStr = i18n("Playing '%1'").arg(fileName);
294 QToolTip::add(mAlarmSoundButton, dispStr); 297 QToolTip::add(mAlarmSoundButton, dispStr);
295 mAlarmProgramButton->setOn(false); 298 mAlarmProgramButton->setOn(false);
296 mAlarmSoundButton->setOn(true); 299 mAlarmSoundButton->setOn(true);
297 QToolTip::add(mAlarmProgramButton, i18n("No program set")); 300 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
298 } else { 301 } else {
299 mAlarmProgramButton->setOn(oldState); 302 mAlarmProgramButton->setOn(oldState);
300 mAlarmSoundButton->setOn(!oldState); 303 mAlarmSoundButton->setOn(!oldState);
301 304
302 305
303 } 306 }
304 307
305 if (mAlarmProgramButton->isOn()) 308 if (mAlarmProgramButton->isOn())
306 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 309 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
307 if ( mAlarmSoundButton->isOn()) 310 if ( mAlarmSoundButton->isOn())
308 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 311 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
309 312
310} 313}
311 314
312void KOEditorGeneral::pickAlarmProgram() 315void KOEditorGeneral::pickAlarmProgram()
313{ 316{
314 bool oldState = mAlarmProgramButton->isOn(); 317 bool oldState = mAlarmProgramButton->isOn();
315 318
316 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); 319 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0));
317 if (!fileName.isEmpty()) { 320 if (!fileName.isEmpty()) {
318 mAlarmProgram = fileName; 321 mAlarmProgram = fileName;
319 QToolTip::remove(mAlarmProgramButton); 322 QToolTip::remove(mAlarmProgramButton);
320 QString dispStr = i18n("Running '%1'").arg(fileName); 323 QString dispStr = i18n("Running '%1'").arg(fileName);
321 QToolTip::add(mAlarmProgramButton, dispStr); 324 QToolTip::add(mAlarmProgramButton, dispStr);
322 mAlarmSoundButton->setOn(false); 325 mAlarmSoundButton->setOn(false);
323 mAlarmProgramButton->setOn(true); 326 mAlarmProgramButton->setOn(true);
324 QToolTip::add(mAlarmSoundButton, i18n("No sound set")); 327 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
325 } else { 328 } else {
326 mAlarmProgramButton->setOn(!oldState); 329 mAlarmProgramButton->setOn(!oldState);
327 mAlarmSoundButton->setOn(oldState); 330 mAlarmSoundButton->setOn(oldState);
328 } 331 }
329 332
330 if (mAlarmProgramButton->isOn()) 333 if (mAlarmProgramButton->isOn())
331 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 334 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
332 if ( mAlarmSoundButton->isOn()) 335 if ( mAlarmSoundButton->isOn())
333 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 336 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
334 337
335} 338}
336 339
337 340
338QString KOEditorGeneral::getFittingPath( const QString s ) 341QString KOEditorGeneral::getFittingPath( const QString s )
339{ 342{
340 int maxlen = 50; 343 int maxlen = 50;
341 if ( QApplication::desktop()->width() < 640 ) { 344 if ( QApplication::desktop()->width() < 640 ) {
342 if ( QApplication::desktop()->width() < 320 ) 345 if ( QApplication::desktop()->width() < 320 )
343 maxlen = 22; 346 maxlen = 22;
344 else 347 else
345 maxlen = 35; 348 maxlen = 35;
346 } 349 }
347 if ( s.length() > maxlen ) { 350 if ( s.length() > maxlen ) {
348 return "..."+s.right(maxlen -3); 351 return "..."+s.right(maxlen -3);
349 } 352 }
350 return s; 353 return s;
351} 354}
352 355
353void KOEditorGeneral::enableAlarmEdit(bool enable) 356void KOEditorGeneral::enableAlarmEdit(bool enable)
354{ 357{
355 if ( enable ) { 358 if ( enable ) {
356 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { 359 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) {
357 mAlarmSoundButton->setOn( true ); 360 mAlarmSoundButton->setOn( true );
358 if ( mAlarmSound.isEmpty() ) 361 if ( mAlarmSound.isEmpty() )
359 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 362 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
360 else { 363 else {
361 if ( ! QFile::exists( mAlarmSound ) ) 364 if ( ! QFile::exists( mAlarmSound ) )
362 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 365 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
363 } 366 }
364 } 367 }
365 } 368 }
366 ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage); 369 ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage);
367 mAlarmTimeEdit->setEnabled(enable); 370 mAlarmTimeEdit->setEnabled(enable);
368 mAlarmSoundButton->setEnabled(enable); 371 mAlarmSoundButton->setEnabled(enable);
369 mAlarmProgramButton->setEnabled(enable); 372 mAlarmProgramButton->setEnabled(enable);
370 mAlarmIncrCombo->setEnabled(enable); 373 mAlarmIncrCombo->setEnabled(enable);
371} 374}
372 375
373void KOEditorGeneral::disableAlarmEdit(bool disable) 376void KOEditorGeneral::disableAlarmEdit(bool disable)
374{ 377{
375 enableAlarmEdit( !disable ); 378 enableAlarmEdit( !disable );
376} 379}
377 380
378void KOEditorGeneral::enableAlarm( bool enable ) 381void KOEditorGeneral::enableAlarm( bool enable )
379{ 382{
380 enableAlarmEdit( enable ); 383 enableAlarmEdit( enable );
381} 384}
382 385
383void KOEditorGeneral::alarmDisable(bool disable) 386void KOEditorGeneral::alarmDisable(bool disable)
384{ 387{
385 if (!disable) { 388 if (!disable) {
386 //mAlarmBell->setEnabled(true); 389 //mAlarmBell->setEnabled(true);
387 mAlarmButton->setEnabled(true); 390 mAlarmButton->setEnabled(true);
388 } else { 391 } else {
389 //mAlarmBell->setEnabled(false); 392 //mAlarmBell->setEnabled(false);
390 mAlarmButton->setEnabled(false); 393 mAlarmButton->setEnabled(false);
391 mAlarmButton->setChecked(false); 394 mAlarmButton->setChecked(false);
392 mAlarmTimeEdit->setEnabled(false); 395 mAlarmTimeEdit->setEnabled(false);
393 mAlarmSoundButton->setEnabled(false); 396 mAlarmSoundButton->setEnabled(false);
394 mAlarmProgramButton->setEnabled(false); 397 mAlarmProgramButton->setEnabled(false);
395 mAlarmIncrCombo->setEnabled(false); 398 mAlarmIncrCombo->setEnabled(false);
396 } 399 }
397} 400}
398 401
399void KOEditorGeneral::setCategories(const QString &str) 402void KOEditorGeneral::setCategories(const QString &str)
400{ 403{
401 QString tt = str; 404 QString tt = str;
402 QToolTip::add( mCategoriesLabel, i18n("<b>Click here to edit categories: </b>") +"<em>"+tt.replace( QRegExp(","),", ")+"</em>"); 405 QToolTip::add( mCategoriesLabel, i18n("<b>Click here to edit categories: </b>") +"<em>"+tt.replace( QRegExp(","),", ")+"</em>");
403 mCategoriesLabel->setText(str); 406 mCategoriesLabel->setText(str);
404} 407}
405 408
406void KOEditorGeneral::setDefaults(bool allDay) 409void KOEditorGeneral::setDefaults(bool allDay)
407{ 410{
408#if 0 411#if 0
409 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); 412 mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName());
410#endif 413#endif
411 414
412 mAlarmMessage = i18n("Edit new item"); 415 mAlarmMessage = i18n("Edit new item");
413 enableAlarmEdit( !allDay ); 416 enableAlarmEdit( !allDay );
414 417
415 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 418 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
416 int alarmTime; 419 int alarmTime;
417 int a[] = { 1,5,10,15,30,60,180, 1440 }; 420 int a[] = { 1,5,10,15,30,60,180, 1440 };
418 int index = KOPrefs::instance()->mAlarmTime; 421 int index = KOPrefs::instance()->mAlarmTime;
419 if (index < 0 || index > 7) { 422 if (index < 0 || index > 7) {
420 alarmTime = 15; 423 alarmTime = 15;
421 } else { 424 } else {
422 alarmTime = a[index]; 425 alarmTime = a[index];
423 } 426 }
424 mAlarmButton ->setChecked( false ); 427 mAlarmButton ->setChecked( false );
425 mAlarmTimeEdit->setValue(alarmTime); 428 mAlarmTimeEdit->setValue(alarmTime);
426 mAlarmIncrCombo->setCurrentItem(0); 429 mAlarmIncrCombo->setCurrentItem(0);
427 enableAlarmEdit( false ); 430 enableAlarmEdit( false );
428 //alarmDisable (false); 431 //alarmDisable (false);
429 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); 432 mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic);
430 mCancelBox->setChecked( false ); 433 mCancelBox->setChecked( false );
431 mSummaryEdit->setEditText(""); 434 mSummaryEdit->setEditText("");
432 mLocationEdit->setEditText(""); 435 mLocationEdit->setEditText("");
433 mDescriptionEdit->setText(""); 436 mDescriptionEdit->setText("");
434 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 437 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
435 setCategories(""); 438 setCategories("");
436} 439}
437void KOEditorGeneral::setSecrecy( int num ) 440void KOEditorGeneral::setSecrecy( int num )
438{ 441{
439 mSecrecyCombo->setCurrentItem(num); 442 mSecrecyCombo->setCurrentItem(num);
440} 443}
441void KOEditorGeneral::readIncidence(Incidence *event) 444void KOEditorGeneral::readIncidence(Incidence *event)
442{ 445{
443 446
444 mAlarmMessage = event->summary(); 447 mAlarmMessage = event->summary();
445 if ( ! event->location().isEmpty() ) 448 if ( ! event->location().isEmpty() )
446 mAlarmMessage += " ("+event->location()+")"; 449 mAlarmMessage += " ("+event->location()+")";
447 mAlarmIncrCombo->setCurrentItem(0); 450 mAlarmIncrCombo->setCurrentItem(0);
448 mSummaryEdit->setEditText(event->summary()); 451 mSummaryEdit->setEditText(event->summary());
449 mLocationEdit->setEditText(event->location()); 452 mLocationEdit->setEditText(event->location());
450 mDescriptionEdit->setText(event->description()); 453 mDescriptionEdit->setText(event->description());
451 454
452#if 0 455#if 0
453 // organizer information 456 // organizer information
454 mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); 457 mOwnerLabel->setText(i18n("Owner: ") + event->organizer());
455#endif 458#endif
456 459
457 enableAlarmEdit( event->isAlarmEnabled() ); 460 enableAlarmEdit( event->isAlarmEnabled() );
458 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); 461 //qDebug("KOEditorGeneral::readIncidence(Incidence *event) ");
459 if(!event->isAlarmEnabled()) { 462 if(!event->isAlarmEnabled()) {
460 // TODO: Implement a KPrefsComboItem to solve this in a clean way. 463 // TODO: Implement a KPrefsComboItem to solve this in a clean way.
461 int alarmTime; 464 int alarmTime;
462 int a[] = { 1,5,10,15,30,60,180, 1440 }; 465 int a[] = { 1,5,10,15,30,60,180, 1440 };
463 int index = KOPrefs::instance()->mAlarmTime; 466 int index = KOPrefs::instance()->mAlarmTime;
464 if (index < 0 || index > 7) { 467 if (index < 0 || index > 7) {
465 alarmTime = 15; 468 alarmTime = 15;
466 } else { 469 } else {
467 alarmTime = a[index]; 470 alarmTime = a[index];
468 } 471 }
469 mAlarmTimeEdit->setValue(alarmTime); 472 mAlarmTimeEdit->setValue(alarmTime);
470 } 473 }
471 mAlarmButton->setChecked( event->isAlarmEnabled() ); 474 mAlarmButton->setChecked( event->isAlarmEnabled() );
472 mSecrecyCombo->setCurrentItem(event->secrecy()); 475 mSecrecyCombo->setCurrentItem(event->secrecy());
473 mCancelBox->setChecked( event->cancelled() ); 476 mCancelBox->setChecked( event->cancelled() );
474 mAlarmProgramButton->setOn(false); 477 mAlarmProgramButton->setOn(false);
475 mAlarmSoundButton->setOn(false); 478 mAlarmSoundButton->setOn(false);
476 479
477 // set up alarm stuff 480 // set up alarm stuff
478 QPtrList<Alarm> alarms = event->alarms(); 481 QPtrList<Alarm> alarms = event->alarms();
479 Alarm* alarm; 482 Alarm* alarm;
480 mAlarmIncrCombo->setCurrentItem(0); 483 mAlarmIncrCombo->setCurrentItem(0);
481 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { 484 for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) {
482 int offset; 485 int offset;
483 if ( alarm->hasTime() ) { 486 if ( alarm->hasTime() ) {
484 QDateTime t = alarm->time(); 487 QDateTime t = alarm->time();
485 offset = event->dtStart().secsTo( t ); 488 offset = event->dtStart().secsTo( t );
486 } else { 489 } else {
487 offset = alarm->startOffset().asSeconds(); 490 offset = alarm->startOffset().asSeconds();
488 } 491 }
489 if ( offset != 0 ) { 492 if ( offset != 0 ) {
490 offset = offset / -60; // make minutes 493 offset = offset / -60; // make minutes
491 if (offset % 60 == 0) { // divides evenly into hours? 494 if (offset % 60 == 0) { // divides evenly into hours?
492 offset = offset / 60; 495 offset = offset / 60;
493 mAlarmIncrCombo->setCurrentItem(1); 496 mAlarmIncrCombo->setCurrentItem(1);
494 if (offset % 24 == 0) { // divides evenly into days? 497 if (offset % 24 == 0) { // divides evenly into days?
495 offset = offset / 24; 498 offset = offset / 24;
496 mAlarmIncrCombo->setCurrentItem(2); 499 mAlarmIncrCombo->setCurrentItem(2);
497 } 500 }
498 } 501 }
499 } 502 }
500 mAlarmTimeEdit->setValue( offset ); 503 mAlarmTimeEdit->setValue( offset );
501 if (alarm->type() == Alarm::Procedure) { 504 if (alarm->type() == Alarm::Procedure) {
502 505
503 mAlarmProgram = alarm->programFile(); 506 mAlarmProgram = alarm->programFile();
504 mAlarmProgramButton->setOn(true); 507 mAlarmProgramButton->setOn(true);
505 QString dispStr = i18n("Running '%1'").arg(mAlarmProgram); 508 QString dispStr = i18n("Running '%1'").arg(mAlarmProgram);
506 QToolTip::add(mAlarmProgramButton, dispStr); 509 QToolTip::add(mAlarmProgramButton, dispStr);
507 } 510 }
508 else if (alarm->type() == Alarm::Audio) { 511 else if (alarm->type() == Alarm::Audio) {
509 mAlarmSound = alarm->audioFile(); 512 mAlarmSound = alarm->audioFile();
510 if ( ! QFile::exists( mAlarmSound ) ) 513 if ( ! QFile::exists( mAlarmSound ) )
511 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 514 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
512 mAlarmSoundButton->setOn(true); 515 mAlarmSoundButton->setOn(true);
513 QString dispStr = i18n("Playing '%1'").arg(mAlarmSound); 516 QString dispStr = i18n("Playing '%1'").arg(mAlarmSound);
514 QToolTip::add(mAlarmSoundButton, dispStr); 517 QToolTip::add(mAlarmSoundButton, dispStr);
515 } 518 }
516 mAlarmButton->setChecked(alarm->enabled()); 519 mAlarmButton->setChecked(alarm->enabled());
517 enableAlarmEdit( alarm->enabled() ); 520 enableAlarmEdit( alarm->enabled() );
518 //qDebug("nableAlarmEdit( alarm->enabled() )********* "); 521 //qDebug("nableAlarmEdit( alarm->enabled() )********* ");
519 // TODO: Deal with multiple alarms 522 // TODO: Deal with multiple alarms
520 break; // For now, stop after the first alarm 523 break; // For now, stop after the first alarm
521 } 524 }
522 525
523 setCategories(event->categoriesStr()); 526 setCategories(event->categoriesStr());
524} 527}
525 528
526void KOEditorGeneral::writeIncidence(Incidence *event) 529void KOEditorGeneral::writeIncidence(Incidence *event)
527{ 530{
528 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl; 531 // kdDebug() << "KOEditorGeneral::writeEvent()" << endl;
529 mLocationEdit->save(KOLocationBox::LOCATION); 532 mLocationEdit->save(KOLocationBox::LOCATION);
530 event->setSummary(mSummaryEdit->currentText()); 533 event->setSummary(mSummaryEdit->currentText());
531 event->setLocation(mLocationEdit->currentText()); 534 event->setLocation(mLocationEdit->currentText());
532 event->setDescription(mDescriptionEdit->text()); 535 event->setDescription(mDescriptionEdit->text());
533 event->setCategories(mCategoriesLabel->text()); 536 event->setCategories(mCategoriesLabel->text());
534 event->setSecrecy(mSecrecyCombo->currentItem()); 537 event->setSecrecy(mSecrecyCombo->currentItem());
535 event->setCancelled(mCancelBox->isChecked() );; 538 event->setCancelled(mCancelBox->isChecked() );;
536 // alarm stuff 539 // alarm stuff
537 if (mAlarmButton->isChecked()) { 540 if (mAlarmButton->isChecked()) {
538 if (event->alarms().count() == 0) 541 if (event->alarms().count() == 0)
539 event->newAlarm(); 542 event->newAlarm();
540 QPtrList<Alarm> alarms = event->alarms(); 543 QPtrList<Alarm> alarms = event->alarms();
541 Alarm *alarm; 544 Alarm *alarm;
542 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) { 545 for (alarm = alarms.first(); alarm; alarm = alarms.next() ) {
543 alarm->setEnabled(true); 546 alarm->setEnabled(true);
544 int j = mAlarmTimeEdit->value()* -60; 547 int j = mAlarmTimeEdit->value()* -60;
545 if (mAlarmIncrCombo->currentItem() == 1) 548 if (mAlarmIncrCombo->currentItem() == 1)
546 j = j * 60; 549 j = j * 60;
547 else if (mAlarmIncrCombo->currentItem() == 2) 550 else if (mAlarmIncrCombo->currentItem() == 2)
548 j = j * (60 * 24); 551 j = j * (60 * 24);
549 alarm->setStartOffset( j ); 552 alarm->setStartOffset( j );
550 553
551 if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) { 554 if (!mAlarmProgram.isEmpty() && mAlarmProgramButton->isOn()) {
552 alarm->setProcedureAlarm(mAlarmProgram); 555 alarm->setProcedureAlarm(mAlarmProgram);
553 } 556 }
554 else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) 557 else if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn())
555 alarm->setAudioAlarm(mAlarmSound); 558 alarm->setAudioAlarm(mAlarmSound);
556 else 559 else
557 alarm->setType(Alarm::Invalid); 560 alarm->setType(Alarm::Invalid);
558 //alarm->setAudioAlarm("default"); 561 //alarm->setAudioAlarm("default");
559 // TODO: Deal with multiple alarms 562 // TODO: Deal with multiple alarms
560 break; // For now, stop after the first alarm 563 break; // For now, stop after the first alarm
561 } 564 }
562 } else { 565 } else {
563 Alarm* alarm = event->alarms().first(); 566 Alarm* alarm = event->alarms().first();
564 if ( alarm ) { 567 if ( alarm ) {
565 alarm->setEnabled(false); 568 alarm->setEnabled(false);
566 alarm->setType(Alarm::Invalid); 569 alarm->setType(Alarm::Invalid);
567 } 570 }
568 } 571 }
569} 572}
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp
index 3dd7f5c..2c6ed9f 100644
--- a/korganizer/koeditorgeneralevent.cpp
+++ b/korganizer/koeditorgeneralevent.cpp
@@ -1,443 +1,444 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 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 <qtooltip.h> 24#include <qtooltip.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qvbox.h> 26#include <qvbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qvgroupbox.h> 28#include <qvgroupbox.h>
29#include <qwidgetstack.h> 29#include <qwidgetstack.h>
30#include <qdatetime.h> 30#include <qdatetime.h>
31 31
32#include <kdebug.h> 32#include <kdebug.h>
33#include <kglobal.h> 33#include <kglobal.h>
34#include <kdialog.h>
34#include <klocale.h> 35#include <klocale.h>
35#include <kiconloader.h> 36#include <kiconloader.h>
36#include <kmessagebox.h> 37#include <kmessagebox.h>
37#include <kfiledialog.h> 38#include <kfiledialog.h>
38#include <kstandarddirs.h> 39#include <kstandarddirs.h>
39 40
40#include <libkcal/event.h> 41#include <libkcal/event.h>
41 42
42#include <libkdepim/kdateedit.h> 43#include <libkdepim/kdateedit.h>
43 44
44#include "koprefs.h" 45#include "koprefs.h"
45 46
46#include "koeditorgeneralevent.h" 47#include "koeditorgeneralevent.h"
47#include "kolocationbox.h" 48#include "kolocationbox.h"
48 49
49KOEditorGeneralEvent::KOEditorGeneralEvent(QObject* parent, 50KOEditorGeneralEvent::KOEditorGeneralEvent(QObject* parent,
50 const char* name) : 51 const char* name) :
51 KOEditorGeneral( parent, name) 52 KOEditorGeneral( parent, name)
52{ 53{
53 mTemplate = false; 54 mTemplate = false;
54 connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), 55 connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
55 SLOT(setDuration())); 56 SLOT(setDuration()));
56 connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), 57 connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
57 SLOT(emitDateTimeStr())); 58 SLOT(emitDateTimeStr()));
58} 59}
59 60
60KOEditorGeneralEvent::~KOEditorGeneralEvent() 61KOEditorGeneralEvent::~KOEditorGeneralEvent()
61{ 62{
62} 63}
63 64
64void KOEditorGeneralEvent::finishSetup() 65void KOEditorGeneralEvent::finishSetup()
65{ 66{
66 67
67 //disabled 68 //disabled
68// QWidget::setTabOrder( mSummaryEdit, mLocationEdit ); 69// QWidget::setTabOrder( mSummaryEdit, mLocationEdit );
69// QWidget::setTabOrder( mLocationEdit, mStartDateEdit ); 70// QWidget::setTabOrder( mLocationEdit, mStartDateEdit );
70// QWidget::setTabOrder( mStartDateEdit, mStartTimeEdit ); 71// QWidget::setTabOrder( mStartDateEdit, mStartTimeEdit );
71// QWidget::setTabOrder( mStartTimeEdit, mEndDateEdit ); 72// QWidget::setTabOrder( mStartTimeEdit, mEndDateEdit );
72// QWidget::setTabOrder( mEndDateEdit, mEndTimeEdit ); 73// QWidget::setTabOrder( mEndDateEdit, mEndTimeEdit );
73// QWidget::setTabOrder( mEndTimeEdit, mNoTimeButton ); 74// QWidget::setTabOrder( mEndTimeEdit, mNoTimeButton );
74// QWidget::setTabOrder( mNoTimeButton, mAlarmButton ); 75// QWidget::setTabOrder( mNoTimeButton, mAlarmButton );
75// QWidget::setTabOrder( mAlarmButton, mAlarmTimeEdit ); 76// QWidget::setTabOrder( mAlarmButton, mAlarmTimeEdit );
76// QWidget::setTabOrder( mFreeTimeCombo, mCategoriesButton ); 77// QWidget::setTabOrder( mFreeTimeCombo, mCategoriesButton );
77// QWidget::setTabOrder( mCategoriesButton, mSecrecyCombo ); 78// QWidget::setTabOrder( mCategoriesButton, mSecrecyCombo );
78// QWidget::setTabOrder( mSecrecyCombo, mDescriptionEdit ); 79// QWidget::setTabOrder( mSecrecyCombo, mDescriptionEdit );
79 80
80 81
81 82
82 mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); 83 mSummaryEdit->load(KOLocationBox::SUMMARYEVENT);
83 mSummaryEdit->setFocus(); 84 mSummaryEdit->setFocus();
84} 85}
85 86
86void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout) 87void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout)
87{ 88{
88 QBoxLayout *timeLayout = new QVBoxLayout(topLayout); 89 QBoxLayout *timeLayout = new QVBoxLayout(topLayout);
89 90
90 QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, 91 QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal,
91 i18n("Date && Time"),parent); 92 i18n("Date && Time"),parent);
92 timeLayout->addWidget(timeGroupBox); 93 timeLayout->addWidget(timeGroupBox);
93 94
94 timeGroupBox->layout()->setSpacing( 0 ); 95 timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() );
95 timeGroupBox->layout()->setMargin( 5 ); 96 timeGroupBox->layout()->setMargin( KDialog::marginHint() );
96 QFrame *timeBoxFrame = new QFrame(timeGroupBox); 97 QFrame *timeBoxFrame = new QFrame(timeGroupBox);
97 98
98 QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3); 99 QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,2,3);
99 layoutTimeBox->setSpacing(topLayout->spacing()); 100 layoutTimeBox->setSpacing(topLayout->spacing());
100 101
101 mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame); 102 mStartDateLabel = new QLabel(i18n("Start:"),timeBoxFrame);
102 layoutTimeBox->addWidget(mStartDateLabel,0,0); 103 layoutTimeBox->addWidget(mStartDateLabel,0,0);
103 104
104 mStartDateEdit = new KDateEdit(timeBoxFrame); 105 mStartDateEdit = new KDateEdit(timeBoxFrame);
105 layoutTimeBox->addWidget(mStartDateEdit,0,1); 106 layoutTimeBox->addWidget(mStartDateEdit,0,1);
106 107
107 mStartTimeEdit = new KOTimeEdit(timeBoxFrame); 108 mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
108 layoutTimeBox->addWidget(mStartTimeEdit,0,2); 109 layoutTimeBox->addWidget(mStartTimeEdit,0,2);
109 110
110 111
111 mEndDateLabel = new QLabel(i18n("End:"),timeBoxFrame); 112 mEndDateLabel = new QLabel(i18n("End:"),timeBoxFrame);
112 layoutTimeBox->addWidget(mEndDateLabel,1,0); 113 layoutTimeBox->addWidget(mEndDateLabel,1,0);
113 114
114 mEndDateEdit = new KDateEdit(timeBoxFrame); 115 mEndDateEdit = new KDateEdit(timeBoxFrame);
115 layoutTimeBox->addWidget(mEndDateEdit,1,1); 116 layoutTimeBox->addWidget(mEndDateEdit,1,1);
116 117
117 mEndTimeEdit = new KOTimeEdit(timeBoxFrame); 118 mEndTimeEdit = new KOTimeEdit(timeBoxFrame);
118 layoutTimeBox->addWidget(mEndTimeEdit,1,2); 119 layoutTimeBox->addWidget(mEndTimeEdit,1,2);
119 QWidget* duration = new QWidget( timeBoxFrame ); 120 QWidget* duration = new QWidget( timeBoxFrame );
120 QHBoxLayout *flagsBox = new QHBoxLayout( duration ); 121 QHBoxLayout *flagsBox = new QHBoxLayout( duration );
121 mNoTimeButton = new QCheckBox(i18n("All day event"),duration); 122 mNoTimeButton = new QCheckBox(i18n("All day event"),duration);
122 flagsBox->addWidget(mNoTimeButton); 123 flagsBox->addWidget(mNoTimeButton);
123 connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool))); 124 connect(mNoTimeButton, SIGNAL(toggled(bool)),SLOT(dontAssociateTime(bool)));
124 mDurationLabel = new QLabel( duration ); 125 mDurationLabel = new QLabel( duration );
125 // if ( KOPrefs::instance()->mCompactDialogs ) { 126 // if ( KOPrefs::instance()->mCompactDialogs ) {
126 //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 ); 127 //layoutTimeBox->addMultiCellWidget( mDurationLabel, 3, 3, 0, 3 );
127 //} else { 128 //} else {
128 flagsBox->addWidget( mDurationLabel ); 129 flagsBox->addWidget( mDurationLabel );
129 //} 130 //}
130 flagsBox->setStretchFactor(mDurationLabel, 10 ); 131 flagsBox->setStretchFactor(mDurationLabel, 10 );
131 mDurationLabel->setAlignment( AlignRight | AlignVCenter); 132 mDurationLabel->setAlignment( AlignRight | AlignVCenter);
132 layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 ); 133 layoutTimeBox->addMultiCellWidget( duration, 2, 2, 0, 3 );
133 134
134 // time widgets are checked if they contain a valid time 135 // time widgets are checked if they contain a valid time
135 connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)), 136 connect(mStartTimeEdit, SIGNAL(timeChanged(QTime)),
136 this, SLOT(startTimeChanged(QTime))); 137 this, SLOT(startTimeChanged(QTime)));
137 connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)), 138 connect(mEndTimeEdit, SIGNAL(timeChanged(QTime)),
138 this, SLOT(endTimeChanged(QTime))); 139 this, SLOT(endTimeChanged(QTime)));
139 140
140 // date widgets are checked if they contain a valid date 141 // date widgets are checked if they contain a valid date
141 connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), 142 connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
142 this, SLOT(startDateChanged(QDate))); 143 this, SLOT(startDateChanged(QDate)));
143 connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), 144 connect(mEndDateEdit, SIGNAL(dateChanged(QDate)),
144 this, SLOT(endDateChanged(QDate))); 145 this, SLOT(endDateChanged(QDate)));
145 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime))); 146 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime)));
146 connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime))); 147 connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime)));
147} 148}
148 149
149void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) 150void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout)
150{ 151{
151 QBoxLayout *classLayout = new QHBoxLayout(topLayout); 152 QBoxLayout *classLayout = new QHBoxLayout(topLayout);
152 153
153 QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent); 154 QLabel *freeTimeLabel = new QLabel(i18n("Show time as:"),parent);
154 classLayout->addWidget(freeTimeLabel); 155 classLayout->addWidget(freeTimeLabel);
155 156
156 mFreeTimeCombo = new QComboBox(false, parent); 157 mFreeTimeCombo = new QComboBox(false, parent);
157 mFreeTimeCombo->insertItem(i18n("Busy")); 158 mFreeTimeCombo->insertItem(i18n("Busy"));
158 mFreeTimeCombo->insertItem(i18n("Free")); 159 mFreeTimeCombo->insertItem(i18n("Free"));
159 classLayout->addWidget(mFreeTimeCombo); 160 classLayout->addWidget(mFreeTimeCombo);
160} 161}
161 162
162void KOEditorGeneralEvent::timeStuffDisable(bool disable) 163void KOEditorGeneralEvent::timeStuffDisable(bool disable)
163{ 164{
164 mStartTimeEdit->setEnabled( !disable ); 165 mStartTimeEdit->setEnabled( !disable );
165 mEndTimeEdit->setEnabled( !disable ); 166 mEndTimeEdit->setEnabled( !disable );
166 167
167 setDuration(); 168 setDuration();
168 emitDateTimeStr(); 169 emitDateTimeStr();
169} 170}
170 171
171void KOEditorGeneralEvent::dontAssociateTime(bool noTime) 172void KOEditorGeneralEvent::dontAssociateTime(bool noTime)
172{ 173{
173 timeStuffDisable(noTime); 174 timeStuffDisable(noTime);
174 //if(alarmButton->isChecked()) alarmStuffDisable(noTime); 175 //if(alarmButton->isChecked()) alarmStuffDisable(noTime);
175 allDayChanged(noTime); 176 allDayChanged(noTime);
176} 177}
177 178
178void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) 179void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end)
179{ 180{
180// kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl; 181// kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl;
181 if ( !mTemplate ) 182 if ( !mTemplate )
182 mStartDateEdit->setDate(start.date()); 183 mStartDateEdit->setDate(start.date());
183 // KTimeEdit seems to emit some signals when setTime() is called. 184 // KTimeEdit seems to emit some signals when setTime() is called.
184 mStartTimeEdit->blockSignals( true ); 185 mStartTimeEdit->blockSignals( true );
185 mStartTimeEdit->setTime(start.time()); 186 mStartTimeEdit->setTime(start.time());
186 mStartTimeEdit->blockSignals( false ); 187 mStartTimeEdit->blockSignals( false );
187 if ( !mTemplate ) 188 if ( !mTemplate )
188 mEndDateEdit->setDate(end.date()); 189 mEndDateEdit->setDate(end.date());
189 mEndTimeEdit->setTime(end.time()); 190 mEndTimeEdit->setTime(end.time());
190 191
191 mCurrStartDateTime = start; 192 mCurrStartDateTime = start;
192 mCurrEndDateTime = end; 193 mCurrEndDateTime = end;
193 194
194 setDuration(); 195 setDuration();
195 emitDateTimeStr(); 196 emitDateTimeStr();
196} 197}
197 198
198void KOEditorGeneralEvent::sTimeChanged(QTime ti) 199void KOEditorGeneralEvent::sTimeChanged(QTime ti)
199{ 200{
200 mStartTimeEdit->setTime( ti ); 201 mStartTimeEdit->setTime( ti );
201 startTimeChanged ( ti); 202 startTimeChanged ( ti);
202} 203}
203void KOEditorGeneralEvent::eTimeChanged(QTime ti ) 204void KOEditorGeneralEvent::eTimeChanged(QTime ti )
204{ 205{
205 mEndTimeEdit->setTime( ti ); 206 mEndTimeEdit->setTime( ti );
206 endTimeChanged( ti ); 207 endTimeChanged( ti );
207} 208}
208void KOEditorGeneralEvent::startTimeChanged(QTime newtime) 209void KOEditorGeneralEvent::startTimeChanged(QTime newtime)
209{ 210{
210 211
211 int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime); 212 int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime);
212 213
213 mCurrStartDateTime = QDateTime( mStartDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0) ); 214 mCurrStartDateTime = QDateTime( mStartDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0) );
214 // adjust end time so that the event has the same duration as before. 215 // adjust end time so that the event has the same duration as before.
215 if( secsep > 0 ) 216 if( secsep > 0 )
216 mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep); 217 mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep);
217 mEndTimeEdit->setTime(mCurrEndDateTime.time()); 218 mEndTimeEdit->setTime(mCurrEndDateTime.time());
218 mEndDateEdit->setDate(mCurrEndDateTime.date()); 219 mEndDateEdit->setDate(mCurrEndDateTime.date());
219 220
220 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); 221 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime);
221} 222}
222 223
223void KOEditorGeneralEvent::endTimeChanged(QTime newtime) 224void KOEditorGeneralEvent::endTimeChanged(QTime newtime)
224{ 225{
225 226
226 mCurrEndDateTime = QDateTime ( mEndDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0)); 227 mCurrEndDateTime = QDateTime ( mEndDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0));
227 228
228 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); 229 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime);
229} 230}
230 231
231void KOEditorGeneralEvent::startDateChanged(QDate newdate) 232void KOEditorGeneralEvent::startDateChanged(QDate newdate)
232{ 233{
233 int daysep = mCurrStartDateTime.daysTo(mCurrEndDateTime); 234 int daysep = mCurrStartDateTime.daysTo(mCurrEndDateTime);
234 235
235 mCurrStartDateTime.setDate(newdate); 236 mCurrStartDateTime.setDate(newdate);
236 237
237 // adjust end date so that the event has the same duration as before 238 // adjust end date so that the event has the same duration as before
238 mCurrEndDateTime.setDate(mCurrStartDateTime.date().addDays(daysep)); 239 mCurrEndDateTime.setDate(mCurrStartDateTime.date().addDays(daysep));
239 mEndDateEdit->setDate(mCurrEndDateTime.date()); 240 mEndDateEdit->setDate(mCurrEndDateTime.date());
240 qDebug("KOEditorGeneralEvent::startDateChanged "); 241 qDebug("KOEditorGeneralEvent::startDateChanged ");
241 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); 242 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime);
242} 243}
243 244
244void KOEditorGeneralEvent::endDateChanged(QDate newdate) 245void KOEditorGeneralEvent::endDateChanged(QDate newdate)
245{ 246{
246 QDateTime newdt(newdate, mCurrEndDateTime.time()); 247 QDateTime newdt(newdate, mCurrEndDateTime.time());
247 248
248 if(newdt < mCurrStartDateTime) { 249 if(newdt < mCurrStartDateTime) {
249 // oops, we can't let that happen. 250 // oops, we can't let that happen.
250 newdt = mCurrStartDateTime; 251 newdt = mCurrStartDateTime;
251 mEndDateEdit->setDate(newdt.date()); 252 mEndDateEdit->setDate(newdt.date());
252 mEndTimeEdit->setTime(newdt.time()); 253 mEndTimeEdit->setTime(newdt.time());
253 } 254 }
254 mCurrEndDateTime = newdt; 255 mCurrEndDateTime = newdt;
255 256
256 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); 257 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime);
257} 258}
258 259
259void KOEditorGeneralEvent::setDefaults(QDateTime from,QDateTime to,bool allDay) 260void KOEditorGeneralEvent::setDefaults(QDateTime from,QDateTime to,bool allDay)
260{ 261{
261 mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); 262 mSummaryEdit->load(KOLocationBox::SUMMARYEVENT);
262 mLocationEdit->load(KOLocationBox::LOCATION); 263 mLocationEdit->load(KOLocationBox::LOCATION);
263 KOEditorGeneral::setDefaults(allDay); 264 KOEditorGeneral::setDefaults(allDay);
264 265
265 mNoTimeButton->setChecked(allDay); 266 mNoTimeButton->setChecked(allDay);
266 timeStuffDisable(allDay); 267 timeStuffDisable(allDay);
267 mFreeTimeCombo->setCurrentItem( 0 ); 268 mFreeTimeCombo->setCurrentItem( 0 );
268 setDateTimes(from,to); 269 setDateTimes(from,to);
269} 270}
270 271
271void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) 272void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl )
272{ 273{
273 QString tmpStr; 274 QString tmpStr;
274 275
275 mTemplate = tmpl; 276 mTemplate = tmpl;
276 // the rest is for the events only 277 // the rest is for the events only
277 mNoTimeButton->setChecked(event->doesFloat()); 278 mNoTimeButton->setChecked(event->doesFloat());
278 timeStuffDisable(event->doesFloat()); 279 timeStuffDisable(event->doesFloat());
279 280
280 setDateTimes(event->dtStart(),event->dtEnd()); 281 setDateTimes(event->dtStart(),event->dtEnd());
281 282
282 mTemplate = false; 283 mTemplate = false;
283 switch( event->transparency() ) { 284 switch( event->transparency() ) {
284 case Event::Transparent: 285 case Event::Transparent:
285 mFreeTimeCombo->setCurrentItem(1); 286 mFreeTimeCombo->setCurrentItem(1);
286 break; 287 break;
287 case Event::Opaque: 288 case Event::Opaque:
288 mFreeTimeCombo->setCurrentItem(0); 289 mFreeTimeCombo->setCurrentItem(0);
289 break; 290 break;
290 } 291 }
291 292
292 mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); 293 mSummaryEdit->load(KOLocationBox::SUMMARYEVENT);
293 mLocationEdit->load(KOLocationBox::LOCATION); 294 mLocationEdit->load(KOLocationBox::LOCATION);
294 readIncidence(event); 295 readIncidence(event);
295} 296}
296 297
297void KOEditorGeneralEvent::writeEvent(Event *event) 298void KOEditorGeneralEvent::writeEvent(Event *event)
298{ 299{
299// kdDebug() << "KOEditorGeneralEvent::writeEvent()" << endl; 300// kdDebug() << "KOEditorGeneralEvent::writeEvent()" << endl;
300 301
301 writeIncidence(event); 302 writeIncidence(event);
302 303
303 QDate tmpDate; 304 QDate tmpDate;
304 QTime tmpTime; 305 QTime tmpTime;
305 QDateTime tmpDT; 306 QDateTime tmpDT;
306 307
307 // temp. until something better happens. 308 // temp. until something better happens.
308 QString tmpStr; 309 QString tmpStr;
309 310
310 if (mNoTimeButton->isChecked()) { 311 if (mNoTimeButton->isChecked()) {
311 event->setFloats(true); 312 event->setFloats(true);
312 // need to change this. 313 // need to change this.
313 tmpDate = mStartDateEdit->date(); 314 tmpDate = mStartDateEdit->date();
314 tmpTime.setHMS(0,0,0); 315 tmpTime.setHMS(0,0,0);
315 tmpDT.setDate(tmpDate); 316 tmpDT.setDate(tmpDate);
316 tmpDT.setTime(tmpTime); 317 tmpDT.setTime(tmpTime);
317 event->setDtStart(tmpDT); 318 event->setDtStart(tmpDT);
318 319
319 tmpDate = mEndDateEdit->date(); 320 tmpDate = mEndDateEdit->date();
320 tmpTime.setHMS(0,0,0); 321 tmpTime.setHMS(0,0,0);
321 tmpDT.setDate(tmpDate); 322 tmpDT.setDate(tmpDate);
322 tmpDT.setTime(tmpTime); 323 tmpDT.setTime(tmpTime);
323 event->setDtEnd(tmpDT); 324 event->setDtEnd(tmpDT);
324 } else { 325 } else {
325 event->setFloats(false); 326 event->setFloats(false);
326 327
327 // set date/time end 328 // set date/time end
328 tmpDate = mEndDateEdit->date(); 329 tmpDate = mEndDateEdit->date();
329 tmpTime = mEndTimeEdit->getTime(); 330 tmpTime = mEndTimeEdit->getTime();
330 tmpDT.setDate(tmpDate); 331 tmpDT.setDate(tmpDate);
331 tmpDT.setTime(tmpTime); 332 tmpDT.setTime(tmpTime);
332 event->setDtEnd(tmpDT); 333 event->setDtEnd(tmpDT);
333 334
334 // set date/time start 335 // set date/time start
335 tmpDate = mStartDateEdit->date(); 336 tmpDate = mStartDateEdit->date();
336 tmpTime = mStartTimeEdit->getTime(); 337 tmpTime = mStartTimeEdit->getTime();
337 tmpDT.setDate(tmpDate); 338 tmpDT.setDate(tmpDate);
338 tmpDT.setTime(tmpTime); 339 tmpDT.setTime(tmpTime);
339 event->setDtStart(tmpDT); 340 event->setDtStart(tmpDT);
340 } // check for float 341 } // check for float
341 mSummaryEdit->save(KOLocationBox::SUMMARYEVENT); 342 mSummaryEdit->save(KOLocationBox::SUMMARYEVENT);
342 343
343 event->setTransparency(mFreeTimeCombo->currentItem() > 0 344 event->setTransparency(mFreeTimeCombo->currentItem() > 0
344 ? KCal::Event::Transparent 345 ? KCal::Event::Transparent
345 : KCal::Event::Opaque); 346 : KCal::Event::Opaque);
346 347
347// kdDebug() << "KOEditorGeneralEvent::writeEvent() done" << endl; 348// kdDebug() << "KOEditorGeneralEvent::writeEvent() done" << endl;
348} 349}
349 350
350void KOEditorGeneralEvent::setDuration() 351void KOEditorGeneralEvent::setDuration()
351{ 352{
352 QString tmpStr = "", catStr; 353 QString tmpStr = "", catStr;
353 int hourdiff, minutediff; 354 int hourdiff, minutediff;
354 // end<date is an accepted temporary state while typing, but don't show 355 // end<date is an accepted temporary state while typing, but don't show
355 // any duration if this happens 356 // any duration if this happens
356 if(mCurrEndDateTime >= mCurrStartDateTime) { 357 if(mCurrEndDateTime >= mCurrStartDateTime) {
357 358
358 if (mNoTimeButton->isChecked()) { 359 if (mNoTimeButton->isChecked()) {
359 int daydiff = mCurrStartDateTime.date().daysTo(mCurrEndDateTime.date()) + 1; 360 int daydiff = mCurrStartDateTime.date().daysTo(mCurrEndDateTime.date()) + 1;
360 tmpStr = i18n("Duration: "); 361 tmpStr = i18n("Duration: ");
361 tmpStr.append(i18n("1 Day","%n Days",daydiff)); 362 tmpStr.append(i18n("1 Day","%n Days",daydiff));
362 } else { 363 } else {
363 int secto = mCurrStartDateTime.secsTo( mCurrEndDateTime ); 364 int secto = mCurrStartDateTime.secsTo( mCurrEndDateTime );
364 hourdiff = secto / 3600; 365 hourdiff = secto / 3600;
365 minutediff = (secto/60 ) % 60; 366 minutediff = (secto/60 ) % 60;
366 if (hourdiff || minutediff){ 367 if (hourdiff || minutediff){
367 tmpStr = i18n("Duration: "); 368 tmpStr = i18n("Duration: ");
368 if (hourdiff){ 369 if (hourdiff){
369 catStr = i18n("1 h","%n h",hourdiff); 370 catStr = i18n("1 h","%n h",hourdiff);
370 tmpStr.append(catStr); 371 tmpStr.append(catStr);
371 } 372 }
372 if (hourdiff && minutediff){ 373 if (hourdiff && minutediff){
373 tmpStr += i18n(", "); 374 tmpStr += i18n(", ");
374 } 375 }
375 if (minutediff){ 376 if (minutediff){
376 catStr = i18n("1 min","%n min",minutediff); 377 catStr = i18n("1 min","%n min",minutediff);
377 tmpStr += catStr; 378 tmpStr += catStr;
378 } 379 }
379 } else tmpStr = ""; 380 } else tmpStr = "";
380 } 381 }
381 } 382 }
382 mDurationLabel->setText(tmpStr); 383 mDurationLabel->setText(tmpStr);
383} 384}
384 385
385void KOEditorGeneralEvent::emitDateTimeStr() 386void KOEditorGeneralEvent::emitDateTimeStr()
386{ 387{
387 KLocale *l = KGlobal::locale(); 388 KLocale *l = KGlobal::locale();
388 QString startString = ""; 389 QString startString = "";
389 if ( mCurrStartDateTime.date() < mCurrEndDateTime.date() ) { 390 if ( mCurrStartDateTime.date() < mCurrEndDateTime.date() ) {
390 if ( mNoTimeButton->isChecked() ) { 391 if ( mNoTimeButton->isChecked() ) {
391 startString = i18n("From: ") + l->formatDate(mCurrStartDateTime.date() ); 392 startString = i18n("From: ") + l->formatDate(mCurrStartDateTime.date() );
392 startString += "\n"+i18n("To: ")+ l->formatDate(mCurrEndDateTime.date()); 393 startString += "\n"+i18n("To: ")+ l->formatDate(mCurrEndDateTime.date());
393 394
394 } else { 395 } else {
395 startString = i18n("From: ") +l->formatDateTime(mCurrStartDateTime, false); 396 startString = i18n("From: ") +l->formatDateTime(mCurrStartDateTime, false);
396 startString += "\n"+i18n("To: ")+l->formatDateTime(mCurrEndDateTime, false); 397 startString += "\n"+i18n("To: ")+l->formatDateTime(mCurrEndDateTime, false);
397 } 398 }
398 } else { 399 } else {
399 if ( mNoTimeButton->isChecked() ) { 400 if ( mNoTimeButton->isChecked() ) {
400 startString = i18n("On: ") + l->formatDate(mCurrStartDateTime.date() ); 401 startString = i18n("On: ") + l->formatDate(mCurrStartDateTime.date() );
401 } else { 402 } else {
402 startString = i18n("From: ") + KGlobal::locale()->formatTime(mCurrStartDateTime.time())+ 403 startString = i18n("From: ") + KGlobal::locale()->formatTime(mCurrStartDateTime.time())+
403 "-"+KGlobal::locale()->formatTime(mCurrEndDateTime.time()); 404 "-"+KGlobal::locale()->formatTime(mCurrEndDateTime.time());
404 startString += i18n(" on ")+KGlobal::locale()->formatDate( mCurrStartDateTime.date(), true); 405 startString += i18n(" on ")+KGlobal::locale()->formatDate( mCurrStartDateTime.date(), true);
405 } 406 }
406 } 407 }
407 startString +="\n"+mDurationLabel->text(); 408 startString +="\n"+mDurationLabel->text();
408 emit dateTimeStrChanged(startString); 409 emit dateTimeStrChanged(startString);
409} 410}
410 411
411bool KOEditorGeneralEvent::validateInput() 412bool KOEditorGeneralEvent::validateInput()
412{ 413{
413 414
414 if (!mStartDateEdit->inputIsValid()) { 415 if (!mStartDateEdit->inputIsValid()) {
415 KMessageBox::sorry( 0, 416 KMessageBox::sorry( 0,
416 i18n("Please specify a valid start date,\nfor example '%1'.") 417 i18n("Please specify a valid start date,\nfor example '%1'.")
417 .arg( KGlobal::locale()->formatDate( QDate::currentDate(), true ) ) ); 418 .arg( KGlobal::locale()->formatDate( QDate::currentDate(), true ) ) );
418 return false; 419 return false;
419 } 420 }
420 421
421 if (!mEndDateEdit->inputIsValid()) { 422 if (!mEndDateEdit->inputIsValid()) {
422 KMessageBox::sorry( 0, 423 KMessageBox::sorry( 0,
423 i18n("Please specify a valid end date,\nfor example '%1'.") 424 i18n("Please specify a valid end date,\nfor example '%1'.")
424 .arg( KGlobal::locale()->formatDate( QDate::currentDate(), true ) ) ); 425 .arg( KGlobal::locale()->formatDate( QDate::currentDate(), true ) ) );
425 return false; 426 return false;
426 } 427 }
427 428
428 QDateTime startDt,endDt; 429 QDateTime startDt,endDt;
429 startDt.setDate(mStartDateEdit->date()); 430 startDt.setDate(mStartDateEdit->date());
430 endDt.setDate(mEndDateEdit->date()); 431 endDt.setDate(mEndDateEdit->date());
431 if (!mNoTimeButton->isChecked()) { 432 if (!mNoTimeButton->isChecked()) {
432 startDt.setTime(mStartTimeEdit->getTime()); 433 startDt.setTime(mStartTimeEdit->getTime());
433 endDt.setTime(mEndTimeEdit->getTime()); 434 endDt.setTime(mEndTimeEdit->getTime());
434 } 435 }
435 436
436 if (startDt > endDt) { 437 if (startDt > endDt) {
437 KMessageBox::sorry(0,i18n("The event ends before it starts.\n" 438 KMessageBox::sorry(0,i18n("The event ends before it starts.\n"
438 "Please correct dates and times.")); 439 "Please correct dates and times."));
439 return false; 440 return false;
440 } 441 }
441 442
442 return KOEditorGeneral::validateInput(); 443 return KOEditorGeneral::validateInput();
443} 444}
diff --git a/korganizer/koeditorgeneraltodo.cpp b/korganizer/koeditorgeneraltodo.cpp
index 0a734ee..965cf47 100644
--- a/korganizer/koeditorgeneraltodo.cpp
+++ b/korganizer/koeditorgeneraltodo.cpp
@@ -1,508 +1,508 @@
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 <qtooltip.h> 24#include <qtooltip.h>
25#include <qfiledialog.h> 25#include <qfiledialog.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qbuttongroup.h> 28#include <qbuttongroup.h>
29#include <qvgroupbox.h> 29#include <qvgroupbox.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapplication.h> 32#include <qapplication.h>
33 33
34#include <kglobal.h> 34#include <kglobal.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kiconloader.h> 36#include <kiconloader.h>
37#include <kmessagebox.h> 37#include <kmessagebox.h>
38#include <kdebug.h> 38#include <kdebug.h>
39#include <krestrictedline.h> 39#include <krestrictedline.h>
40#include <kstandarddirs.h> 40#include <kstandarddirs.h>
41#include <kfiledialog.h> 41#include <kfiledialog.h>
42#include <kdialog.h> 42#include <kdialog.h>
43 43
44#include <libkcal/todo.h> 44#include <libkcal/todo.h>
45 45
46#include <libkdepim/kdateedit.h> 46#include <libkdepim/kdateedit.h>
47 47
48#include "koprefs.h" 48#include "koprefs.h"
49#include "ktimeedit.h" 49#include "ktimeedit.h"
50 50
51#include "koeditorgeneraltodo.h" 51#include "koeditorgeneraltodo.h"
52#include "kolocationbox.h" 52#include "kolocationbox.h"
53 53
54KOEditorGeneralTodo::KOEditorGeneralTodo(QObject* parent, 54KOEditorGeneralTodo::KOEditorGeneralTodo(QObject* parent,
55 const char* name) 55 const char* name)
56 : KOEditorGeneral( parent, name) 56 : KOEditorGeneral( parent, name)
57{ 57{
58} 58}
59 59
60KOEditorGeneralTodo::~KOEditorGeneralTodo() 60KOEditorGeneralTodo::~KOEditorGeneralTodo()
61{ 61{
62} 62}
63 63
64void KOEditorGeneralTodo::finishSetup() 64void KOEditorGeneralTodo::finishSetup()
65{ 65{
66 66
67// QWidget::setTabOrder(mSummaryEdit, mLocationEdit); 67// QWidget::setTabOrder(mSummaryEdit, mLocationEdit);
68// QWidget::setTabOrder(mLocationEdit, mDueCheck); 68// QWidget::setTabOrder(mLocationEdit, mDueCheck);
69// QWidget::setTabOrder(mDueCheck, mDueDateEdit); 69// QWidget::setTabOrder(mDueCheck, mDueDateEdit);
70// QWidget::setTabOrder(mDueDateEdit, mDueTimeEdit); 70// QWidget::setTabOrder(mDueDateEdit, mDueTimeEdit);
71// QWidget::setTabOrder(mDueTimeEdit, mStartCheck); 71// QWidget::setTabOrder(mDueTimeEdit, mStartCheck);
72// QWidget::setTabOrder(mStartCheck, mStartDateEdit); 72// QWidget::setTabOrder(mStartCheck, mStartDateEdit);
73// QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit); 73// QWidget::setTabOrder(mStartDateEdit, mStartTimeEdit);
74// QWidget::setTabOrder(mStartTimeEdit, mTimeButton); 74// QWidget::setTabOrder(mStartTimeEdit, mTimeButton);
75// QWidget::setTabOrder(mTimeButton, mCompletedCombo); 75// QWidget::setTabOrder(mTimeButton, mCompletedCombo);
76// QWidget::setTabOrder(mCompletedCombo, mPriorityCombo); 76// QWidget::setTabOrder(mCompletedCombo, mPriorityCombo);
77// QWidget::setTabOrder(mPriorityCombo, mAlarmButton); 77// QWidget::setTabOrder(mPriorityCombo, mAlarmButton);
78// QWidget::setTabOrder(mAlarmButton, mCategoriesButton); 78// QWidget::setTabOrder(mAlarmButton, mCategoriesButton);
79// QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo); 79// QWidget::setTabOrder(mCategoriesButton, mSecrecyCombo);
80// QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit); 80// QWidget::setTabOrder(mSecrecyCombo, mDescriptionEdit);
81 mSummaryEdit->load(KOLocationBox::SUMMARYTODO); 81 mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
82 mSummaryEdit->setFocus(); 82 mSummaryEdit->setFocus();
83} 83}
84 84
85void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout) 85void KOEditorGeneralTodo::initTime(QWidget *parent,QBoxLayout *topLayout)
86{ 86{
87 QBoxLayout *timeLayout = new QVBoxLayout(topLayout); 87 QBoxLayout *timeLayout = new QVBoxLayout(topLayout);
88 88
89 QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal, 89 QGroupBox *timeGroupBox = new QGroupBox(1,QGroupBox::Horizontal,
90 i18n("Date && Time"),parent); 90 i18n("Date && Time"),parent);
91 timeLayout->addWidget(timeGroupBox); 91 timeLayout->addWidget(timeGroupBox);
92 timeGroupBox->layout()->setSpacing( KDialog::spacingHintSmall() ); 92 timeGroupBox->layout()->setSpacing( KDialog::spacingHint()-2 );
93 timeGroupBox->layout()->setMargin( KDialog::marginHint() ); 93 timeGroupBox->layout()->setMargin( KDialog::marginHint() );
94 QFrame *timeBoxFrame = new QFrame(timeGroupBox); 94 QFrame *timeBoxFrame = new QFrame(timeGroupBox);
95 95
96 QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3); 96 QGridLayout *layoutTimeBox = new QGridLayout(timeBoxFrame,3,3);
97 layoutTimeBox->setSpacing(KDialog::spacingHintSmall()); 97 layoutTimeBox->setSpacing(KDialog::spacingHintSmall());
98 layoutTimeBox->setColStretch( 1, 1 ); 98 layoutTimeBox->setColStretch( 1, 1 );
99 99
100 mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame); 100 mDueCheck = new QCheckBox(i18n("Due:"),timeBoxFrame);
101 layoutTimeBox->addWidget(mDueCheck,1,0); 101 layoutTimeBox->addWidget(mDueCheck,1,0);
102 connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool))); 102 connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(enableDueEdit(bool)));
103 connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm())); 103 connect(mDueCheck,SIGNAL(toggled(bool)),SLOT(showAlarm()));
104 104
105 105
106 mDueDateEdit = new KDateEdit(timeBoxFrame); 106 mDueDateEdit = new KDateEdit(timeBoxFrame);
107 layoutTimeBox->addWidget(mDueDateEdit,1,1); 107 layoutTimeBox->addWidget(mDueDateEdit,1,1);
108 108
109 mDueTimeEdit = new KOTimeEdit(timeBoxFrame); 109 mDueTimeEdit = new KOTimeEdit(timeBoxFrame);
110 layoutTimeBox->addWidget(mDueTimeEdit,1,2); 110 layoutTimeBox->addWidget(mDueTimeEdit,1,2);
111 111
112 112
113 mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame); 113 mStartCheck = new QCheckBox(i18n("Start:"),timeBoxFrame);
114 layoutTimeBox->addWidget(mStartCheck,0,0); 114 layoutTimeBox->addWidget(mStartCheck,0,0);
115 connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool))); 115 connect(mStartCheck,SIGNAL(toggled(bool)),SLOT(enableStartEdit(bool)));
116 116
117 mStartDateEdit = new KDateEdit(timeBoxFrame); 117 mStartDateEdit = new KDateEdit(timeBoxFrame);
118 layoutTimeBox->addWidget(mStartDateEdit,0,1); 118 layoutTimeBox->addWidget(mStartDateEdit,0,1);
119 119
120 mStartTimeEdit = new KOTimeEdit(timeBoxFrame); 120 mStartTimeEdit = new KOTimeEdit(timeBoxFrame);
121 layoutTimeBox->addWidget(mStartTimeEdit,0,2); 121 layoutTimeBox->addWidget(mStartTimeEdit,0,2);
122 122
123 123
124 mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame); 124 mTimeButton = new QCheckBox(i18n("Time associated"),timeBoxFrame);
125 layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1); 125 layoutTimeBox->addMultiCellWidget(mTimeButton,2,2,0,1);
126 126
127 connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool))); 127 connect(mTimeButton,SIGNAL(toggled(bool)),SLOT(enableTimeEdits(bool)));
128 connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime))); 128 connect(mDueDateEdit,SIGNAL(setTimeTo(QTime)),mDueTimeEdit,SLOT(setTime(QTime)));
129 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); 129 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime)));
130 connect(mStartDateEdit, SIGNAL(dateChanged(QDate)), 130 connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
131 this, SLOT(startDateChanged(QDate))); 131 this, SLOT(startDateChanged(QDate)));
132 // some more layouting 132 // some more layouting
133 //layoutTimeBox->setColStretch(3,1); 133 //layoutTimeBox->setColStretch(3,1);
134} 134}
135 135
136 136
137void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout) 137void KOEditorGeneralTodo::initCompletion(QWidget *parent, QBoxLayout *topLayout)
138{ 138{
139 mCompletedCombo = new QComboBox(parent); 139 mCompletedCombo = new QComboBox(parent);
140 // xgettext:no-c-format 140 // xgettext:no-c-format
141 mCompletedCombo->insertItem(i18n(" 0 %")); 141 mCompletedCombo->insertItem(i18n(" 0 %"));
142 // xgettext:no-c-format 142 // xgettext:no-c-format
143 mCompletedCombo->insertItem(i18n(" 20 %")); 143 mCompletedCombo->insertItem(i18n(" 20 %"));
144 // xgettext:no-c-format 144 // xgettext:no-c-format
145 mCompletedCombo->insertItem(i18n(" 40 %")); 145 mCompletedCombo->insertItem(i18n(" 40 %"));
146 // xgettext:no-c-format 146 // xgettext:no-c-format
147 mCompletedCombo->insertItem(i18n(" 60 %")); 147 mCompletedCombo->insertItem(i18n(" 60 %"));
148 // xgettext:no-c-format 148 // xgettext:no-c-format
149 mCompletedCombo->insertItem(i18n(" 80 %")); 149 mCompletedCombo->insertItem(i18n(" 80 %"));
150 // xgettext:no-c-format 150 // xgettext:no-c-format
151 mCompletedCombo->insertItem(i18n("100 %")); 151 mCompletedCombo->insertItem(i18n("100 %"));
152 connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int))); 152 connect(mCompletedCombo,SIGNAL(activated(int)),SLOT(completedChanged(int)));
153 topLayout->addWidget(mCompletedCombo); 153 topLayout->addWidget(mCompletedCombo);
154 154
155 mCompletedLabel = new QLabel(i18n("completed"),parent); 155 mCompletedLabel = new QLabel(i18n("completed"),parent);
156 topLayout->addWidget(mCompletedLabel); 156 topLayout->addWidget(mCompletedLabel);
157 157
158 mCompleteDateEdit = new KDateEdit(parent); 158 mCompleteDateEdit = new KDateEdit(parent);
159 topLayout->addWidget(mCompleteDateEdit ); 159 topLayout->addWidget(mCompleteDateEdit );
160 160
161 mCompleteTimeEdit = new KOTimeEdit(parent); 161 mCompleteTimeEdit = new KOTimeEdit(parent);
162 topLayout->addWidget( mCompleteTimeEdit); 162 topLayout->addWidget( mCompleteTimeEdit);
163 163
164 mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) ); 164 mCompletedCombo->setSizePolicy( QSizePolicy( QSizePolicy::Preferred,QSizePolicy::Preferred) );
165 mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) ); 165 mCompletedLabel->setSizePolicy( QSizePolicy( QSizePolicy::Expanding,QSizePolicy::Preferred) );
166 connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime))); 166 connect(mCompleteDateEdit,SIGNAL(setTimeTo(QTime)),mCompleteTimeEdit,SLOT(setTime(QTime)));
167 167
168 if ( QApplication::desktop()->width() <= 480 ) { 168 if ( QApplication::desktop()->width() <= 480 ) {
169 if ( QApplication::desktop()->width() < 320 ) 169 if ( QApplication::desktop()->width() < 320 )
170 mCompleteDateEdit->setMaximumWidth( 85 ); 170 mCompleteDateEdit->setMaximumWidth( 85 );
171 else 171 else
172 mCompleteDateEdit->setMaximumWidth( 140 ); 172 mCompleteDateEdit->setMaximumWidth( 140 );
173 topLayout->setSpacing( 0 ); 173 topLayout->setSpacing( 0 );
174 } 174 }
175} 175}
176 176
177void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout) 177void KOEditorGeneralTodo::initPriority(QWidget *parent, QBoxLayout *topLayout)
178{ 178{
179 179
180 QHBox* h = new QHBox ( parent ); 180 QHBox* h = new QHBox ( parent );
181 topLayout->addWidget( h ); 181 topLayout->addWidget( h );
182 QLabel *priorityLabel = new QLabel(i18n("Priority:"), h); 182 QLabel *priorityLabel = new QLabel(i18n("Priority:"), h);
183 // topLayout->addWidget(priorityLabel); 183 // topLayout->addWidget(priorityLabel);
184 mPriorityCombo = new QComboBox( h ); 184 mPriorityCombo = new QComboBox( h );
185 mPriorityCombo->insertItem(i18n("1 (high)")); 185 mPriorityCombo->insertItem(i18n("1 (high)"));
186 mPriorityCombo->insertItem(i18n("2")); 186 mPriorityCombo->insertItem(i18n("2"));
187 mPriorityCombo->insertItem(i18n("3")); 187 mPriorityCombo->insertItem(i18n("3"));
188 mPriorityCombo->insertItem(i18n("4")); 188 mPriorityCombo->insertItem(i18n("4"));
189 mPriorityCombo->insertItem(i18n("5 (low)")); 189 mPriorityCombo->insertItem(i18n("5 (low)"));
190 //topLayout->addWidget(mPriorityCombo); 190 //topLayout->addWidget(mPriorityCombo);
191} 191}
192 192
193void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout) 193void KOEditorGeneralTodo::initStatus(QWidget *parent,QBoxLayout *topLayout)
194{ 194{
195 QBoxLayout *statusLayout = new QHBoxLayout(topLayout); 195 QBoxLayout *statusLayout = new QHBoxLayout(topLayout);
196 196
197 initCompletion( parent, statusLayout ); 197 initCompletion( parent, statusLayout );
198 198
199 statusLayout->addStretch( 1 ); 199 statusLayout->addStretch( 1 );
200 200
201 initPriority( parent, statusLayout ); 201 initPriority( parent, statusLayout );
202} 202}
203 203
204void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay) 204void KOEditorGeneralTodo::setDefaults(QDateTime due,bool allDay)
205{ 205{
206 206
207 mSummaryEdit->load(KOLocationBox::SUMMARYTODO); 207 mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
208 mLocationEdit->load(KOLocationBox::LOCATION); 208 mLocationEdit->load(KOLocationBox::LOCATION);
209 KOEditorGeneral::setDefaults(allDay); 209 KOEditorGeneral::setDefaults(allDay);
210 210
211 mTimeButton->setChecked( !allDay ); 211 mTimeButton->setChecked( !allDay );
212 if(mTimeButton->isChecked()) { 212 if(mTimeButton->isChecked()) {
213 mTimeButton->setEnabled(true); 213 mTimeButton->setEnabled(true);
214 } 214 }
215 else { 215 else {
216 mTimeButton->setEnabled(false); 216 mTimeButton->setEnabled(false);
217 } 217 }
218 218
219 enableTimeEdits( !allDay ); 219 enableTimeEdits( !allDay );
220 if ( due.isValid() ) { 220 if ( due.isValid() ) {
221 mDueCheck->setChecked(true); 221 mDueCheck->setChecked(true);
222 enableDueEdit(true); 222 enableDueEdit(true);
223 alarmDisable(false); 223 alarmDisable(false);
224 } else { 224 } else {
225 mDueCheck->setChecked(false); 225 mDueCheck->setChecked(false);
226 enableDueEdit(false); 226 enableDueEdit(false);
227 due = QDateTime::currentDateTime().addDays(7); 227 due = QDateTime::currentDateTime().addDays(7);
228 alarmDisable(true); 228 alarmDisable(true);
229 } 229 }
230 230
231 231
232 mStartCheck->setChecked(false); 232 mStartCheck->setChecked(false);
233 enableStartEdit(false); 233 enableStartEdit(false);
234 234
235 mDueDateEdit->setDate(due.date()); 235 mDueDateEdit->setDate(due.date());
236 mDueTimeEdit->setTime(due.time()); 236 mDueTimeEdit->setTime(due.time());
237 due = due.addDays(-7); 237 due = due.addDays(-7);
238 mStartDateEdit->setDate(due.date()); 238 mStartDateEdit->setDate(due.date());
239 mStartTimeEdit->setTime(due.time()); 239 mStartTimeEdit->setTime(due.time());
240 240
241 mPriorityCombo->setCurrentItem(2); 241 mPriorityCombo->setCurrentItem(2);
242 mCompletedLabel->setText(i18n(" completed"));; 242 mCompletedLabel->setText(i18n(" completed"));;
243 mCompletedCombo->setCurrentItem(0); 243 mCompletedCombo->setCurrentItem(0);
244 mCompleteDateEdit->hide(); 244 mCompleteDateEdit->hide();
245 mCompleteTimeEdit->hide(); 245 mCompleteTimeEdit->hide();
246} 246}
247 247
248void KOEditorGeneralTodo::readTodo(Todo *todo) 248void KOEditorGeneralTodo::readTodo(Todo *todo)
249{ 249{
250 250
251 mSummaryEdit->load(KOLocationBox::SUMMARYTODO); 251 mSummaryEdit->load(KOLocationBox::SUMMARYTODO);
252 mLocationEdit->load(KOLocationBox::LOCATION); 252 mLocationEdit->load(KOLocationBox::LOCATION);
253 KOEditorGeneral::readIncidence(todo); 253 KOEditorGeneral::readIncidence(todo);
254 254
255 QDateTime dueDT; 255 QDateTime dueDT;
256 256
257 if (todo->hasDueDate()) { 257 if (todo->hasDueDate()) {
258 enableAlarmEdit(true); 258 enableAlarmEdit(true);
259 dueDT = todo->dtDue(); 259 dueDT = todo->dtDue();
260 mDueDateEdit->setDate(todo->dtDue().date()); 260 mDueDateEdit->setDate(todo->dtDue().date());
261 mDueTimeEdit->setTime(todo->dtDue().time()); 261 mDueTimeEdit->setTime(todo->dtDue().time());
262 mDueCheck->setChecked(true); 262 mDueCheck->setChecked(true);
263 } else { 263 } else {
264 alarmDisable(true); 264 alarmDisable(true);
265 mDueDateEdit->setEnabled(false); 265 mDueDateEdit->setEnabled(false);
266 mDueTimeEdit->setEnabled(false); 266 mDueTimeEdit->setEnabled(false);
267 mDueDateEdit->setDate(QDate::currentDate()); 267 mDueDateEdit->setDate(QDate::currentDate());
268 mDueTimeEdit->setTime(QTime::currentTime()); 268 mDueTimeEdit->setTime(QTime::currentTime());
269 mDueCheck->setChecked(false); 269 mDueCheck->setChecked(false);
270 } 270 }
271 271
272 if (todo->hasStartDate()) { 272 if (todo->hasStartDate()) {
273 mStartDateEdit->setDate(todo->dtStart().date()); 273 mStartDateEdit->setDate(todo->dtStart().date());
274 mStartTimeEdit->setTime(todo->dtStart().time()); 274 mStartTimeEdit->setTime(todo->dtStart().time());
275 mStartCheck->setChecked(true); 275 mStartCheck->setChecked(true);
276 } else { 276 } else {
277 mStartDateEdit->setEnabled(false); 277 mStartDateEdit->setEnabled(false);
278 mStartTimeEdit->setEnabled(false); 278 mStartTimeEdit->setEnabled(false);
279 mStartDateEdit->setDate(QDate::currentDate()); 279 mStartDateEdit->setDate(QDate::currentDate());
280 mStartTimeEdit->setTime(QTime::currentTime()); 280 mStartTimeEdit->setTime(QTime::currentTime());
281 mStartCheck->setChecked(false); 281 mStartCheck->setChecked(false);
282 } 282 }
283 283
284 mTimeButton->setChecked( !todo->doesFloat() ); 284 mTimeButton->setChecked( !todo->doesFloat() );
285 285
286 mCompletedCombo->setCurrentItem(todo->percentComplete() / 20); 286 mCompletedCombo->setCurrentItem(todo->percentComplete() / 20);
287 if (todo->isCompleted() && todo->hasCompletedDate()) { 287 if (todo->isCompleted() && todo->hasCompletedDate()) {
288 mCompleted = todo->completed(); 288 mCompleted = todo->completed();
289 } 289 }
290 setCompletedDate(); 290 setCompletedDate();
291 291
292 mPriorityCombo->setCurrentItem(todo->priority()-1); 292 mPriorityCombo->setCurrentItem(todo->priority()-1);
293} 293}
294 294
295void KOEditorGeneralTodo::writeTodo(Todo *todo) 295void KOEditorGeneralTodo::writeTodo(Todo *todo)
296{ 296{
297 KOEditorGeneral::writeIncidence(todo); 297 KOEditorGeneral::writeIncidence(todo);
298 298
299 // temp. until something better happens. 299 // temp. until something better happens.
300 QString tmpStr; 300 QString tmpStr;
301 301
302 todo->setHasDueDate(mDueCheck->isChecked()); 302 todo->setHasDueDate(mDueCheck->isChecked());
303 todo->setHasStartDate(mStartCheck->isChecked()); 303 todo->setHasStartDate(mStartCheck->isChecked());
304 304
305 QDate tmpDate; 305 QDate tmpDate;
306 QTime tmpTime; 306 QTime tmpTime;
307 QDateTime tmpDT; 307 QDateTime tmpDT;
308 if ( mTimeButton->isChecked() ) { 308 if ( mTimeButton->isChecked() ) {
309 todo->setFloats(false); 309 todo->setFloats(false);
310 310
311 // set due date/time 311 // set due date/time
312 tmpDate = mDueDateEdit->date(); 312 tmpDate = mDueDateEdit->date();
313 tmpTime = mDueTimeEdit->getTime(); 313 tmpTime = mDueTimeEdit->getTime();
314 tmpDT.setDate(tmpDate); 314 tmpDT.setDate(tmpDate);
315 tmpDT.setTime(tmpTime); 315 tmpDT.setTime(tmpTime);
316 todo->setDtDue(tmpDT); 316 todo->setDtDue(tmpDT);
317 317
318 // set start date/time 318 // set start date/time
319 tmpDate = mStartDateEdit->date(); 319 tmpDate = mStartDateEdit->date();
320 tmpTime = mStartTimeEdit->getTime(); 320 tmpTime = mStartTimeEdit->getTime();
321 tmpDT.setDate(tmpDate); 321 tmpDT.setDate(tmpDate);
322 tmpDT.setTime(tmpTime); 322 tmpDT.setTime(tmpTime);
323 todo->setDtStart(tmpDT); 323 todo->setDtStart(tmpDT);
324 } else { 324 } else {
325 todo->setFloats(true); 325 todo->setFloats(true);
326 326
327 // need to change this. 327 // need to change this.
328 tmpDate = mDueDateEdit->date(); 328 tmpDate = mDueDateEdit->date();
329 tmpTime.setHMS(0,0,0); 329 tmpTime.setHMS(0,0,0);
330 tmpDT.setDate(tmpDate); 330 tmpDT.setDate(tmpDate);
331 tmpDT.setTime(tmpTime); 331 tmpDT.setTime(tmpTime);
332 todo->setDtDue(tmpDT); 332 todo->setDtDue(tmpDT);
333 333
334 tmpDate = mStartDateEdit->date(); 334 tmpDate = mStartDateEdit->date();
335 tmpTime.setHMS(0,0,0); 335 tmpTime.setHMS(0,0,0);
336 tmpDT.setDate(tmpDate); 336 tmpDT.setDate(tmpDate);
337 tmpDT.setTime(tmpTime); 337 tmpDT.setTime(tmpTime);
338 todo->setDtStart(tmpDT); 338 todo->setDtStart(tmpDT);
339 } 339 }
340 todo->setPriority(mPriorityCombo->currentItem()+1); 340 todo->setPriority(mPriorityCombo->currentItem()+1);
341 341
342 // set completion state 342 // set completion state
343 if ( mCompletedCombo->currentItem() == 5 ) { 343 if ( mCompletedCombo->currentItem() == 5 ) {
344 QDateTime comp ( mCompleteDateEdit->date(), mCompleteTimeEdit->getTime() ); 344 QDateTime comp ( mCompleteDateEdit->date(), mCompleteTimeEdit->getTime() );
345 if ( comp.isValid () ) { 345 if ( comp.isValid () ) {
346 todo->setPercentComplete(100); 346 todo->setPercentComplete(100);
347 todo->setCompleted(comp); 347 todo->setCompleted(comp);
348 } else { 348 } else {
349 todo->setPercentComplete( 100 ); 349 todo->setPercentComplete( 100 );
350 if ( mCompleted.isValid() ) 350 if ( mCompleted.isValid() )
351 todo->setCompleted(mCompleted); 351 todo->setCompleted(mCompleted);
352 } 352 }
353 } else { 353 } else {
354 todo->setPercentComplete(mCompletedCombo->currentItem() * 20); 354 todo->setPercentComplete(mCompletedCombo->currentItem() * 20);
355 } 355 }
356 356
357 mSummaryEdit->save(KOLocationBox::SUMMARYTODO); 357 mSummaryEdit->save(KOLocationBox::SUMMARYTODO);
358} 358}
359 359
360void KOEditorGeneralTodo::enableDueEdit(bool enable) 360void KOEditorGeneralTodo::enableDueEdit(bool enable)
361{ 361{
362 mDueDateEdit->setEnabled( enable ); 362 mDueDateEdit->setEnabled( enable );
363 363
364 if(mDueCheck->isChecked() || mStartCheck->isChecked()) { 364 if(mDueCheck->isChecked() || mStartCheck->isChecked()) {
365 mTimeButton->setEnabled(true); 365 mTimeButton->setEnabled(true);
366 } 366 }
367 else { 367 else {
368 mTimeButton->setEnabled(false); 368 mTimeButton->setEnabled(false);
369 mTimeButton->setChecked(false); 369 mTimeButton->setChecked(false);
370 } 370 }
371 371
372 if (enable) { 372 if (enable) {
373 mDueTimeEdit->setEnabled( mTimeButton->isChecked() ); 373 mDueTimeEdit->setEnabled( mTimeButton->isChecked() );
374 } else { 374 } else {
375 mDueTimeEdit->setEnabled( false ); 375 mDueTimeEdit->setEnabled( false );
376 } 376 }
377 emit datesChecked(); 377 emit datesChecked();
378} 378}
379 379
380void KOEditorGeneralTodo::enableStartEdit( bool enable ) 380void KOEditorGeneralTodo::enableStartEdit( bool enable )
381{ 381{
382 mStartDateEdit->setEnabled( enable ); 382 mStartDateEdit->setEnabled( enable );
383 383
384 if(mDueCheck->isChecked() || mStartCheck->isChecked()) { 384 if(mDueCheck->isChecked() || mStartCheck->isChecked()) {
385 mTimeButton->setEnabled(true); 385 mTimeButton->setEnabled(true);
386 } 386 }
387 else { 387 else {
388 mTimeButton->setEnabled(false); 388 mTimeButton->setEnabled(false);
389 mTimeButton->setChecked(false); 389 mTimeButton->setChecked(false);
390 } 390 }
391 391
392 if (enable) { 392 if (enable) {
393 mStartTimeEdit->setEnabled( mTimeButton->isChecked() ); 393 mStartTimeEdit->setEnabled( mTimeButton->isChecked() );
394 } else { 394 } else {
395 mStartTimeEdit->setEnabled( false ); 395 mStartTimeEdit->setEnabled( false );
396 } 396 }
397 emit datesChecked(); 397 emit datesChecked();
398} 398}
399void KOEditorGeneralTodo::startDateChanged(QDate newdate) 399void KOEditorGeneralTodo::startDateChanged(QDate newdate)
400{ 400{
401 if ( mDueCheck->isChecked() ) 401 if ( mDueCheck->isChecked() )
402 emit dateTimesChanged(newdate,mDueDateEdit->date()); 402 emit dateTimesChanged(newdate,mDueDateEdit->date());
403} 403}
404void KOEditorGeneralTodo::enableTimeEdits(bool enable) 404void KOEditorGeneralTodo::enableTimeEdits(bool enable)
405{ 405{
406 if(mStartCheck->isChecked()) { 406 if(mStartCheck->isChecked()) {
407 mStartTimeEdit->setEnabled( enable ); 407 mStartTimeEdit->setEnabled( enable );
408 } 408 }
409 if(mDueCheck->isChecked()) { 409 if(mDueCheck->isChecked()) {
410 mDueTimeEdit->setEnabled( enable ); 410 mDueTimeEdit->setEnabled( enable );
411 } 411 }
412} 412}
413 413
414void KOEditorGeneralTodo::showAlarm() 414void KOEditorGeneralTodo::showAlarm()
415{ 415{
416 if ( mDueCheck->isChecked() ) { 416 if ( mDueCheck->isChecked() ) {
417 alarmDisable(false); 417 alarmDisable(false);
418 } 418 }
419 else { 419 else {
420 alarmDisable(true); 420 alarmDisable(true);
421 } 421 }
422} 422}
423 423
424bool KOEditorGeneralTodo::validateInput() 424bool KOEditorGeneralTodo::validateInput()
425{ 425{
426 if (mDueCheck->isChecked()) { 426 if (mDueCheck->isChecked()) {
427 if (!mDueDateEdit->inputIsValid()) { 427 if (!mDueDateEdit->inputIsValid()) {
428 KMessageBox::sorry(0,i18n("Please specify a valid due date.")); 428 KMessageBox::sorry(0,i18n("Please specify a valid due date."));
429 return false; 429 return false;
430 } 430 }
431 } 431 }
432 432
433 if (mStartCheck->isChecked()) { 433 if (mStartCheck->isChecked()) {
434 if (!mStartDateEdit->inputIsValid()) { 434 if (!mStartDateEdit->inputIsValid()) {
435 KMessageBox::sorry(0,i18n("Please specify a valid start date.")); 435 KMessageBox::sorry(0,i18n("Please specify a valid start date."));
436 return false; 436 return false;
437 } 437 }
438 } 438 }
439 439
440 if (mStartCheck->isChecked() && mDueCheck->isChecked()) { 440 if (mStartCheck->isChecked() && mDueCheck->isChecked()) {
441 QDateTime startDate; 441 QDateTime startDate;
442 QDateTime dueDate; 442 QDateTime dueDate;
443 startDate.setDate(mStartDateEdit->date()); 443 startDate.setDate(mStartDateEdit->date());
444 dueDate.setDate(mDueDateEdit->date()); 444 dueDate.setDate(mDueDateEdit->date());
445 if (mTimeButton->isChecked()) { 445 if (mTimeButton->isChecked()) {
446 startDate.setTime(mStartTimeEdit->getTime()); 446 startDate.setTime(mStartTimeEdit->getTime());
447 dueDate.setTime(mDueTimeEdit->getTime()); 447 dueDate.setTime(mDueTimeEdit->getTime());
448 } 448 }
449 if (startDate > dueDate) { 449 if (startDate > dueDate) {
450 KMessageBox::sorry(0, 450 KMessageBox::sorry(0,
451 i18n("The start date cannot be after the due date.")); 451 i18n("The start date cannot be after the due date."));
452 return false; 452 return false;
453 } 453 }
454 } 454 }
455 455
456 return KOEditorGeneral::validateInput(); 456 return KOEditorGeneral::validateInput();
457} 457}
458 458
459void KOEditorGeneralTodo::completedChanged(int index) 459void KOEditorGeneralTodo::completedChanged(int index)
460{ 460{
461 if (index == 5) { 461 if (index == 5) {
462 //get rid of milli sec 462 //get rid of milli sec
463 mCompleted = QDateTime::currentDateTime(); 463 mCompleted = QDateTime::currentDateTime();
464 } 464 }
465 setCompletedDate(); 465 setCompletedDate();
466} 466}
467 467
468void KOEditorGeneralTodo::setCompletedDate() 468void KOEditorGeneralTodo::setCompletedDate()
469{ 469{
470 if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) { 470 if (mCompletedCombo->currentItem() == 5 && mCompleted.isValid()) {
471 if ( QApplication::desktop()->width() < 480 ) { 471 if ( QApplication::desktop()->width() < 480 ) {
472 mCompletedLabel->setText(i18n(" on")); 472 mCompletedLabel->setText(i18n(" on"));
473 } 473 }
474 else 474 else
475 mCompletedLabel->setText(i18n(" completed on ")); 475 mCompletedLabel->setText(i18n(" completed on "));
476 mCompleteDateEdit->show(); 476 mCompleteDateEdit->show();
477 mCompleteTimeEdit->show(); 477 mCompleteTimeEdit->show();
478 mCompleteTimeEdit->setTime( mCompleted.time() ); 478 mCompleteTimeEdit->setTime( mCompleted.time() );
479 mCompleteDateEdit->setDate( mCompleted.date() ); 479 mCompleteDateEdit->setDate( mCompleted.date() );
480 } else { 480 } else {
481 mCompletedLabel->setText(i18n(" completed")); 481 mCompletedLabel->setText(i18n(" completed"));
482 mCompleteDateEdit->hide(); 482 mCompleteDateEdit->hide();
483 mCompleteTimeEdit->hide(); 483 mCompleteTimeEdit->hide();
484 } 484 }
485} 485}
486 486
487void KOEditorGeneralTodo::modified (Todo* todo, int modification) 487void KOEditorGeneralTodo::modified (Todo* todo, int modification)
488{ 488{
489 switch (modification) { 489 switch (modification) {
490 case KOGlobals::PRIORITY_MODIFIED: 490 case KOGlobals::PRIORITY_MODIFIED:
491 mPriorityCombo->setCurrentItem(todo->priority()-1); 491 mPriorityCombo->setCurrentItem(todo->priority()-1);
492 break; 492 break;
493 case KOGlobals::COMPLETION_MODIFIED: 493 case KOGlobals::COMPLETION_MODIFIED:
494 mCompletedCombo->setCurrentItem(todo->percentComplete() / 20); 494 mCompletedCombo->setCurrentItem(todo->percentComplete() / 20);
495 if (todo->isCompleted() && todo->hasCompletedDate()) { 495 if (todo->isCompleted() && todo->hasCompletedDate()) {
496 mCompleted = todo->completed(); 496 mCompleted = todo->completed();
497 } 497 }
498 setCompletedDate(); 498 setCompletedDate();
499 break; 499 break;
500 case KOGlobals::CATEGORY_MODIFIED: 500 case KOGlobals::CATEGORY_MODIFIED:
501 setCategories (todo->categoriesStr ()); 501 setCategories (todo->categoriesStr ());
502 break; 502 break;
503 case KOGlobals::UNKNOWN_MODIFIED: // fall through 503 case KOGlobals::UNKNOWN_MODIFIED: // fall through
504 default: 504 default:
505 readTodo( todo ); 505 readTodo( todo );
506 break; 506 break;
507 } 507 }
508} 508}
diff --git a/korganizer/koeventeditor.cpp b/korganizer/koeventeditor.cpp
index 75dae34..9ede543 100644
--- a/korganizer/koeventeditor.cpp
+++ b/korganizer/koeventeditor.cpp
@@ -1,378 +1,384 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001,2002 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 <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qhbox.h> 27#include <qhbox.h>
28#include <qdir.h> 28#include <qdir.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qwidgetstack.h> 30#include <qwidgetstack.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#include <kiconloader.h> 33#include <kiconloader.h>
34#include <kstandarddirs.h> 34#include <kstandarddirs.h>
35#include <kdebug.h> 35#include <kdebug.h>
36#include <klocale.h> 36#include <klocale.h>
37#include <kfiledialog.h> 37#include <kfiledialog.h>
38#include <kmessagebox.h> 38#include <kmessagebox.h>
39#include <libkcal/calendarresources.h> 39#include <libkcal/calendarresources.h>
40#include <libkcal/resourcecalendar.h> 40#include <libkcal/resourcecalendar.h>
41#include <kresources/resourceselectdialog.h> 41#include <kresources/resourceselectdialog.h>
42 42
43#include <libkdepim/categoryselectdialog.h> 43#include <libkdepim/categoryselectdialog.h>
44#include <libkcal/calendarlocal.h> 44#include <libkcal/calendarlocal.h>
45#include <libkcal/icalformat.h> 45#include <libkcal/icalformat.h>
46 46
47#include "koprefs.h" 47#include "koprefs.h"
48 48
49#include "koeventeditor.h" 49#include "koeventeditor.h"
50extern int globalFlagBlockAgenda; 50extern int globalFlagBlockAgenda;
51 51
52KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) : 52KOEventEditor::KOEventEditor( Calendar *calendar, QWidget *parent ) :
53 KOIncidenceEditor( i18n("Edit Event"), calendar, parent ) 53 KOIncidenceEditor( i18n("Edit Event"), calendar, parent )
54{ 54{
55 mEvent = 0; 55 mEvent = 0;
56 init(); 56 init();
57 if ( QApplication::desktop()->height() <= 240 ) 57 if ( QApplication::desktop()->height() <= 240 )
58 hideButtons(); 58 hideButtons();
59} 59}
60 60
61KOEventEditor::~KOEventEditor() 61KOEventEditor::~KOEventEditor()
62{ 62{
63 //emit dialogClose( mEvent ); 63 //emit dialogClose( mEvent );
64} 64}
65 65
66void KOEventEditor::init() 66void KOEventEditor::init()
67{ 67{
68 68
69 setupGeneral(); 69 setupGeneral();
70 setupAttendeesTab(); 70 setupAttendeesTab();
71 setupRecurrence(); 71 setupRecurrence();
72 72
73 // Propagate date time settings to recurrence tab 73 // Propagate date time settings to recurrence tab
74 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), 74 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
75 mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime))); 75 mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime)));
76 connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)), 76 connect(mGeneral,SIGNAL(dateTimeStrChanged(const QString &)),
77 mRecurrence,SLOT(setDateTimeStr(const QString &))); 77 mRecurrence,SLOT(setDateTimeStr(const QString &)));
78 78
79 // Category dialog 79 // Category dialog
80 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); 80 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
81 //connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)), 81 //connect(mCategoryDialog,SIGNAL(categoriesSelected(const QString &)),
82 // mGeneral,SLOT(setCategories(const QString &))); 82 // mGeneral,SLOT(setCategories(const QString &)));
83 83
84 84
85} 85}
86 86
87void KOEventEditor::reload() 87void KOEventEditor::reload()
88{ 88{
89 if ( mEvent ) readEvent( mEvent ); 89 if ( mEvent ) readEvent( mEvent );
90} 90}
91 91
92void KOEventEditor::setSecrecy( int sec ) 92void KOEventEditor::setSecrecy( int sec )
93{ 93{
94 mGeneral->setSecrecy( sec ); 94 mGeneral->setSecrecy( sec );
95} 95}
96void KOEventEditor::setCategories( QString s ) 96void KOEventEditor::setCategories( QString s )
97{ 97{
98 mGeneral->setCategories(s); 98 mGeneral->setCategories(s);
99 99
100} 100}
101void KOEventEditor::setupGeneral() 101void KOEventEditor::setupGeneral()
102{ 102{
103 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" ); 103 mGeneral = new KOEditorGeneralEvent( this, "KOEditorGeneralEvent" );
104 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); 104 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
105 105
106 if( KOPrefs::instance()->mCompactDialogs ) { 106 if( KOPrefs::instance()->mCompactDialogs ) {
107 QFrame *topFrame = addPage(i18n("General")); 107 QFrame *topFrame = addPage(i18n("General"));
108 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 108 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
109 topLayout->setSpacing(spacingHint()-1); 109 topLayout->setSpacing(spacingHint()-1);
110 topLayout->setMargin(marginHint()-1); 110 topLayout->setMargin(marginHint()-1);
111 topLayout->addStretch ( 1 );
111 mGeneral->initHeader(topFrame,topLayout); 112 mGeneral->initHeader(topFrame,topLayout);
113 topLayout->addStretch ( 1 );
112 mGeneral->initTime(topFrame,topLayout); 114 mGeneral->initTime(topFrame,topLayout);
115 topLayout->addStretch ( 1 );
113// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 116// QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
114 mGeneral->initAlarm(topFrame,topLayout); 117 mGeneral->initAlarm(topFrame,topLayout);
118 topLayout->addStretch ( 1 );
115 mGeneral->enableAlarm( false ); 119 mGeneral->enableAlarm( false );
116 120
117 QBoxLayout *buttonLayout; 121 QBoxLayout *buttonLayout;
118 if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 ) 122 if ( QApplication::desktop()->width() < 500 && QApplication::desktop()->height() > 240 )
119 buttonLayout = new QVBoxLayout( topLayout ); 123 buttonLayout = new QVBoxLayout( topLayout );
120 else 124 else
121 buttonLayout = new QHBoxLayout( topLayout ); 125 buttonLayout = new QHBoxLayout( topLayout );
122 QHBox* buttonWidget = new QHBox (topFrame); 126 QHBox* buttonWidget = new QHBox (topFrame);
123 QIconSet icon; 127 QIconSet icon;
124 if ( QApplication::desktop()->width() < 321 ) 128 if ( QApplication::desktop()->width() < 321 )
125 icon = SmallIcon("fileexport16"); 129 icon = SmallIcon("fileexport16");
126 else 130 else
127 icon = SmallIcon("fileexport"); 131 icon = SmallIcon("fileexport");
128 QPushButton * loadTemplate = new QPushButton( buttonWidget); 132 QPushButton * loadTemplate = new QPushButton( buttonWidget);
129 QPushButton * saveTemplate = new QPushButton( buttonWidget); 133 QPushButton * saveTemplate = new QPushButton( buttonWidget);
130 saveTemplate->setIconSet (icon ) ; 134 saveTemplate->setIconSet (icon ) ;
131 int size = saveTemplate->sizeHint().height(); 135 int size = saveTemplate->sizeHint().height();
132 saveTemplate->setFixedSize( size, size ); 136 saveTemplate->setFixedSize( size, size );
133 if ( QApplication::desktop()->width() < 321 ) 137 if ( QApplication::desktop()->width() < 321 )
134 icon = SmallIcon("fileimport16"); 138 icon = SmallIcon("fileimport16");
135 else 139 else
136 icon = SmallIcon("fileimport"); 140 icon = SmallIcon("fileimport");
137 loadTemplate->setIconSet (icon ) ; 141 loadTemplate->setIconSet (icon ) ;
138 loadTemplate->setFixedSize( size, size ); 142 loadTemplate->setFixedSize( size, size );
139 buttonLayout->addWidget( buttonWidget ); 143 buttonLayout->addWidget( buttonWidget );
140 mGeneral->initCategories( topFrame, buttonLayout ); 144 mGeneral->initCategories( topFrame, buttonLayout );
141 145
142 topLayout->addStretch( 1 ); 146 topLayout->addStretch( 1 );
143 147
144 QFrame *topFrame2 = addPage(i18n("Details")); 148 QFrame *topFrame2 = addPage(i18n("Details"));
145 149
146 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); 150 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
151 topLayout2->setSpacing(spacingHint()-1);
152 topLayout2->setMargin(marginHint()-1);
147 topLayout2->setSpacing(spacingHint()); 153 topLayout2->setSpacing(spacingHint());
148 154
149 mGeneral->initClass(topFrame2,topLayout2); 155 mGeneral->initClass(topFrame2,topLayout2);
150 mGeneral->initSecrecy( topFrame2, topLayout2 ); 156 mGeneral->initSecrecy( topFrame2, topLayout2 );
151 mGeneral->initDescription(topFrame2,topLayout2); 157 mGeneral->initDescription(topFrame2,topLayout2);
152 158
153 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 159 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
154 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 160 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
155 } else { 161 } else {
156 QFrame *topFrame = addPage(i18n("General")); 162 QFrame *topFrame = addPage(i18n("General"));
157 163
158 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 164 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
159 topLayout->setSpacing(spacingHint()); 165 topLayout->setSpacing(spacingHint());
160 166
161 mGeneral->initHeader(topFrame,topLayout); 167 mGeneral->initHeader(topFrame,topLayout);
162 mGeneral->initTime(topFrame,topLayout); 168 mGeneral->initTime(topFrame,topLayout);
163 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 169 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
164 mGeneral->initAlarm(topFrame,alarmLineLayout); 170 mGeneral->initAlarm(topFrame,alarmLineLayout);
165 mGeneral->initClass(topFrame,alarmLineLayout); 171 mGeneral->initClass(topFrame,alarmLineLayout);
166 mGeneral->initDescription(topFrame,topLayout); 172 mGeneral->initDescription(topFrame,topLayout);
167 QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); 173 QBoxLayout *detailsLayout = new QHBoxLayout(topLayout);
168 mGeneral->initCategories( topFrame, detailsLayout ); 174 mGeneral->initCategories( topFrame, detailsLayout );
169 mGeneral->initSecrecy( topFrame, detailsLayout ); 175 mGeneral->initSecrecy( topFrame, detailsLayout );
170 } 176 }
171 177
172 mGeneral->finishSetup(); 178 mGeneral->finishSetup();
173 179
174} 180}
175 181
176void KOEventEditor::setupRecurrence() 182void KOEventEditor::setupRecurrence()
177{ 183{
178 QFrame *topFrame = addPage( i18n("Recurrence") ); 184 QFrame *topFrame = addPage( i18n("Recurrence") );
179 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 185 QBoxLayout *topLayout = new QVBoxLayout( topFrame );
180 186
181 mRecurrence = new KOEditorRecurrence( topFrame ); 187 mRecurrence = new KOEditorRecurrence( topFrame );
182 topLayout->addWidget( mRecurrence ); 188 topLayout->addWidget( mRecurrence );
183} 189}
184 190
185void KOEventEditor::editEvent(Event *event, bool showDescription) 191void KOEventEditor::editEvent(Event *event, bool showDescription)
186{ 192{
187 // init(); 193 // init();
188 194
189 mEvent = event; 195 mEvent = event;
190 readEvent(mEvent); 196 readEvent(mEvent);
191 if ( showDescription ) { 197 if ( showDescription ) {
192 showPage( 1 ); 198 showPage( 1 );
193 mGeneral->setFocusOn( 1 ); 199 mGeneral->setFocusOn( 1 );
194 } else { 200 } else {
195 showPage( 0 ); 201 showPage( 0 );
196 mGeneral->setFocusOn( 2 ); 202 mGeneral->setFocusOn( 2 );
197 } 203 }
198} 204}
199 205
200void KOEventEditor::newEvent( QDateTime from, QDateTime to, bool allDay ) 206void KOEventEditor::newEvent( QDateTime from, QDateTime to, bool allDay )
201{ 207{
202 // init(); 208 // init();
203 209
204 mEvent = 0; 210 mEvent = 0;
205 setDefaults(from,to,allDay); 211 setDefaults(from,to,allDay);
206} 212}
207 213
208void KOEventEditor::loadDefaults() 214void KOEventEditor::loadDefaults()
209{ 215{
210 int fmt = KOPrefs::instance()->mStartTime; 216 int fmt = KOPrefs::instance()->mStartTime;
211 217
212 QDateTime from(QDate::currentDate(), QTime(fmt,0,0)); 218 QDateTime from(QDate::currentDate(), QTime(fmt,0,0));
213 QDateTime to(QDate::currentDate(), 219 QDateTime to(QDate::currentDate(),
214 QTime(fmt+KOPrefs::instance()->mDefaultDuration,0,0)); 220 QTime(fmt+KOPrefs::instance()->mDefaultDuration,0,0));
215 221
216 setDefaults(from,to,false); 222 setDefaults(from,to,false);
217} 223}
218 224
219bool KOEventEditor::processInput( bool emitTime ) 225bool KOEventEditor::processInput( bool emitTime )
220{ 226{
221 if (!validateInput()) return false; 227 if (!validateInput()) return false;
222 228
223 Event *event = 0; 229 Event *event = 0;
224 230
225 if (mEvent) event = mEvent; 231 if (mEvent) event = mEvent;
226 else { 232 else {
227 event = new Event; 233 event = new Event;
228 event->setOrganizer(KOPrefs::instance()->email()); 234 event->setOrganizer(KOPrefs::instance()->email());
229 } 235 }
230 236
231 writeEvent(event); 237 writeEvent(event);
232 if ( emitTime ) { 238 if ( emitTime ) {
233 globalFlagBlockAgenda = 1; 239 globalFlagBlockAgenda = 1;
234 emit showAgendaView( false ); 240 emit showAgendaView( false );
235 emit jumpToTime( event->dtStart().date() ); 241 emit jumpToTime( event->dtStart().date() );
236 globalFlagBlockAgenda = 2; 242 globalFlagBlockAgenda = 2;
237 243
238 } 244 }
239 if (mEvent) { 245 if (mEvent) {
240 event->setRevision(event->revision()+1); 246 event->setRevision(event->revision()+1);
241 emit eventChanged(event); 247 emit eventChanged(event);
242 } else { 248 } else {
243 mCalendar->addEvent(event); 249 mCalendar->addEvent(event);
244 mEvent = event; 250 mEvent = event;
245 emit eventAdded(event); 251 emit eventAdded(event);
246 } 252 }
247 253
248 return true; 254 return true;
249} 255}
250 256
251void KOEventEditor::deleteEvent() 257void KOEventEditor::deleteEvent()
252{ 258{
253 kdDebug() << "Delete event" << endl; 259 kdDebug() << "Delete event" << endl;
254 260
255 if (mEvent) { 261 if (mEvent) {
256 if (KOPrefs::instance()->mConfirm) { 262 if (KOPrefs::instance()->mConfirm) {
257 switch (msgItemDelete()) { 263 switch (msgItemDelete()) {
258 case KMessageBox::Continue: // OK 264 case KMessageBox::Continue: // OK
259 emit eventToBeDeleted(mEvent); 265 emit eventToBeDeleted(mEvent);
260 emit dialogClose(mEvent); 266 emit dialogClose(mEvent);
261 mCalendar->deleteEvent(mEvent); 267 mCalendar->deleteEvent(mEvent);
262 emit eventDeleted(); 268 emit eventDeleted();
263 reject(); 269 reject();
264 break; 270 break;
265 } 271 }
266 } 272 }
267 else { 273 else {
268 emit eventToBeDeleted(mEvent); 274 emit eventToBeDeleted(mEvent);
269 emit dialogClose(mEvent); 275 emit dialogClose(mEvent);
270 mCalendar->deleteEvent(mEvent); 276 mCalendar->deleteEvent(mEvent);
271 emit eventDeleted(); 277 emit eventDeleted();
272 reject(); 278 reject();
273 } 279 }
274 } else { 280 } else {
275 reject(); 281 reject();
276 } 282 }
277} 283}
278 284
279void KOEventEditor::setDefaults(QDateTime from, QDateTime to, bool allDay) 285void KOEventEditor::setDefaults(QDateTime from, QDateTime to, bool allDay)
280{ 286{
281 mGeneral->setDefaults(from,to,allDay); 287 mGeneral->setDefaults(from,to,allDay);
282 mDetails->setDefaults(); 288 mDetails->setDefaults();
283 mRecurrence->setDefaults(from,to); 289 mRecurrence->setDefaults(from,to);
284 showPage( 0 ); 290 showPage( 0 );
285 mGeneral->setFocusOn( 2 ); 291 mGeneral->setFocusOn( 2 );
286} 292}
287 293
288void KOEventEditor::readEvent( Event *event, bool tmpl ) 294void KOEventEditor::readEvent( Event *event, bool tmpl )
289{ 295{
290 mGeneral->readEvent( event, tmpl ); 296 mGeneral->readEvent( event, tmpl );
291 mDetails->readEvent( event ); 297 mDetails->readEvent( event );
292 mRecurrence->readEvent( event ); 298 mRecurrence->readEvent( event );
293 299
294 // categories 300 // categories
295 //mCategoryDialog->setSelected( event->categories() ); 301 //mCategoryDialog->setSelected( event->categories() );
296} 302}
297 303
298void KOEventEditor::writeEvent(Event *event) 304void KOEventEditor::writeEvent(Event *event)
299{ 305{
300 mGeneral->writeEvent( event ); 306 mGeneral->writeEvent( event );
301 mDetails->writeEvent( event ); 307 mDetails->writeEvent( event );
302 308
303 if ( event->organizer() == KOPrefs::instance()->email() ) { 309 if ( event->organizer() == KOPrefs::instance()->email() ) {
304 Event *ev = new Event( *event ); 310 Event *ev = new Event( *event );
305 ev->registerObserver(0); 311 ev->registerObserver(0);
306 mDetails->cancelAttendeeEvent( ev ); 312 mDetails->cancelAttendeeEvent( ev );
307 if ( ev->attendeeCount() > 0 ) { 313 if ( ev->attendeeCount() > 0 ) {
308 emit deleteAttendee( ev ); 314 emit deleteAttendee( ev );
309 } 315 }
310 delete(ev); 316 delete(ev);
311 } 317 }
312 318
313 mRecurrence->writeEvent(event); 319 mRecurrence->writeEvent(event);
314} 320}
315 321
316bool KOEventEditor::validateInput() 322bool KOEventEditor::validateInput()
317{ 323{
318 if (!mGeneral->validateInput()) return false; 324 if (!mGeneral->validateInput()) return false;
319 if (!mDetails->validateInput()) return false; 325 if (!mDetails->validateInput()) return false;
320 if (!mRecurrence->validateInput()) return false; 326 if (!mRecurrence->validateInput()) return false;
321 return true; 327 return true;
322} 328}
323 329
324int KOEventEditor::msgItemDelete() 330int KOEventEditor::msgItemDelete()
325{ 331{
326 return KMessageBox::warningContinueCancel(this, 332 return KMessageBox::warningContinueCancel(this,
327 i18n("This item will be permanently deleted."), 333 i18n("This item will be permanently deleted."),
328 i18n("KOrganizer Confirmation"),i18n("Delete")); 334 i18n("KOrganizer Confirmation"),i18n("Delete"));
329} 335}
330 336
331void KOEventEditor::slotLoadTemplate() 337void KOEventEditor::slotLoadTemplate()
332{ 338{
333 339
334 QString fileName =locateLocal( "templates", "events" ); 340 QString fileName =locateLocal( "templates", "events" );
335 QDir t_dir; 341 QDir t_dir;
336 if ( !t_dir.exists(fileName) ) 342 if ( !t_dir.exists(fileName) )
337 t_dir.mkdir ( fileName ); 343 t_dir.mkdir ( fileName );
338 fileName += "/event"; 344 fileName += "/event";
339 fileName = KFileDialog::getOpenFileName( fileName , i18n("Load Event template"), this ); 345 fileName = KFileDialog::getOpenFileName( fileName , i18n("Load Event template"), this );
340 if ( fileName.length() == 0 ) 346 if ( fileName.length() == 0 )
341 return; 347 return;
342 CalendarLocal cal; 348 CalendarLocal cal;
343 ICalFormat format; 349 ICalFormat format;
344 if ( !format.load( &cal, fileName ) ) { 350 if ( !format.load( &cal, fileName ) ) {
345 KMessageBox::error( this, i18n("Error loading template file\n '%1'.") 351 KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
346 .arg( fileName ) ); 352 .arg( fileName ) );
347 return ; 353 return ;
348 } 354 }
349 QPtrList<Event> events = cal.events(); 355 QPtrList<Event> events = cal.events();
350 Event* event = events.first(); 356 Event* event = events.first();
351 if ( !event ) { 357 if ( !event ) {
352 KMessageBox::error( this, 358 KMessageBox::error( this,
353 i18n("Template does not contain\na valid Event.")); 359 i18n("Template does not contain\na valid Event."));
354 } else { 360 } else {
355 kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl; 361 kdDebug() << "KOEventEditor::slotLoadTemplate(): readTemplate" << endl;
356 readEvent( event, true ); 362 readEvent( event, true );
357 } 363 }
358} 364}
359 365
360 366
361void KOEventEditor::slotSaveTemplate() 367void KOEventEditor::slotSaveTemplate()
362{ 368{
363 QString fileName =locateLocal( "templates", "events" ); 369 QString fileName =locateLocal( "templates", "events" );
364 QDir t_dir; 370 QDir t_dir;
365 if ( !t_dir.exists(fileName) ) 371 if ( !t_dir.exists(fileName) )
366 t_dir.mkdir ( fileName ); 372 t_dir.mkdir ( fileName );
367 fileName += "/event"; 373 fileName += "/event";
368 fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Event template"), this ); 374 fileName = KFileDialog::getSaveFileName( fileName , i18n("Save as Event template"), this );
369 if ( fileName.length() > 0 ) 375 if ( fileName.length() > 0 )
370 saveTemplate( fileName ); 376 saveTemplate( fileName );
371} 377}
372 378
373void KOEventEditor::saveTemplate( const QString &templateName ) 379void KOEventEditor::saveTemplate( const QString &templateName )
374{ 380{
375 Event *event = new Event; 381 Event *event = new Event;
376 writeEvent( event ); 382 writeEvent( event );
377 saveAsTemplate( event, templateName ); 383 saveAsTemplate( event, templateName );
378} 384}
diff --git a/korganizer/koincidenceeditor.cpp b/korganizer/koincidenceeditor.cpp
index 9813a80..9bc0302 100644
--- a/korganizer/koincidenceeditor.cpp
+++ b/korganizer/koincidenceeditor.cpp
@@ -1,185 +1,185 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 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 <qtooltip.h> 24#include <qtooltip.h>
25#include <qframe.h> 25#include <qframe.h>
26#include <qpixmap.h> 26#include <qpixmap.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qwidgetstack.h> 28#include <qwidgetstack.h>
29#include <qdatetime.h> 29#include <qdatetime.h>
30#include <qdir.h> 30#include <qdir.h>
31 31
32#include <kdebug.h> 32#include <kdebug.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kstandarddirs.h> 34#include <kstandarddirs.h>
35#include <kmessagebox.h> 35#include <kmessagebox.h>
36#include <kfiledialog.h> 36#include <kfiledialog.h>
37 37
38#include <libkdepim/categoryselectdialog.h> 38#include <libkdepim/categoryselectdialog.h>
39#include <libkdepim/kinputdialog.h> 39#include <libkdepim/kinputdialog.h>
40 40
41#include <libkcal/calendarlocal.h> 41#include <libkcal/calendarlocal.h>
42#include <libkcal/icalformat.h> 42#include <libkcal/icalformat.h>
43 43
44#include "koprefs.h" 44#include "koprefs.h"
45 45
46#include "koincidenceeditor.h" 46#include "koincidenceeditor.h"
47 47
48KOIncidenceEditor::KOIncidenceEditor( const QString &caption, 48KOIncidenceEditor::KOIncidenceEditor( const QString &caption,
49 Calendar *calendar, QWidget *parent ) : 49 Calendar *calendar, QWidget *parent ) :
50 KDialogBase( Tabbed, caption, Ok | Apply | Cancel |/* Default | */User1, Ok, 50 KDialogBase( Tabbed, caption, Ok | Apply | Cancel |/* Default | */User1, Ok,
51 parent, caption, true, false ), 51 parent, caption, true, false ),
52 mSaveTemplateDialog( 0 ) 52 mSaveTemplateDialog( 0 )
53{ 53{
54 mCalendar = calendar; 54 mCalendar = calendar;
55 55
56 setButtonText( Default, i18n("Template...") ); 56 setButtonText( Default, i18n("Template...") );
57 57
58 QString saveTemplateText; 58 QString saveTemplateText;
59 // if ( KOPrefs::instance()->mCompactDialogs ) { 59 // if ( KOPrefs::instance()->mCompactDialogs ) {
60// showButton( User1, false ); 60// showButton( User1, false );
61// showButton( Apply, false ); 61// showButton( Apply, false );
62// } else { 62// } else {
63 showButton( Apply, false ); 63 showButton( Apply, false );
64 saveTemplateText = i18n("Ok+Agenda"); 64 saveTemplateText = i18n("Ok+Agenda");
65 // } 65 // }
66 setButtonText( User1, saveTemplateText ); 66 setButtonText( User1, saveTemplateText );
67 67
68 //mCategoryDialog = new KPIM::CategorySelectDialog( KOPrefs::instance(), this ); 68 //mCategoryDialog = new KPIM::CategorySelectDialog( KOPrefs::instance(), this );
69 // KOGlobals::fitDialogToScreen( mCategoryDialog ); 69 // KOGlobals::fitDialogToScreen( mCategoryDialog );
70 70
71 //connect(mCategoryDialog,SIGNAL(editCategories()),SIGNAL(editCategories())); 71 //connect(mCategoryDialog,SIGNAL(editCategories()),SIGNAL(editCategories()));
72 72
73 //connect( this, SIGNAL( defaultClicked() ), SLOT( slotLoadTemplate() ) ); 73 //connect( this, SIGNAL( defaultClicked() ), SLOT( slotLoadTemplate() ) );
74 // connect( this, SIGNAL( user1Clicked() ), SLOT( slotSaveTemplate() ) ); 74 // connect( this, SIGNAL( user1Clicked() ), SLOT( slotSaveTemplate() ) );
75 connect( this, SIGNAL( user1Clicked() ), SLOT( slotShowIncidence() ) ); 75 connect( this, SIGNAL( user1Clicked() ), SLOT( slotShowIncidence() ) );
76} 76}
77 77
78KOIncidenceEditor::~KOIncidenceEditor() 78KOIncidenceEditor::~KOIncidenceEditor()
79{ 79{
80 //delete mCategoryDialog; 80 //delete mCategoryDialog;
81} 81}
82 82
83void KOIncidenceEditor::setupAttendeesTab() 83void KOIncidenceEditor::setupAttendeesTab()
84{ 84{
85 QFrame *topFrame = addPage(i18n("Attendees")); 85 QFrame *topFrame = addPage(i18n("Attendees"));
86 86
87 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 87 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
88 88
89 mDetails = new KOEditorDetails(spacingHint(),topFrame); 89 mDetails = new KOEditorDetails(spacingHint()-2,topFrame);
90 topLayout->addWidget(mDetails); 90 topLayout->addWidget(mDetails);
91} 91}
92 92
93 93
94void KOIncidenceEditor::slotApply() 94void KOIncidenceEditor::slotApply()
95{ 95{
96 processInput( false ); 96 processInput( false );
97} 97}
98void KOIncidenceEditor::accept() 98void KOIncidenceEditor::accept()
99{ 99{
100 slotOk(); 100 slotOk();
101} 101}
102void KOIncidenceEditor::slotOk() 102void KOIncidenceEditor::slotOk()
103{ 103{
104 if ( processInput( false ) ) QDialog::accept(); 104 if ( processInput( false ) ) QDialog::accept();
105} 105}
106 106
107void KOIncidenceEditor::updateCategoryConfig() 107void KOIncidenceEditor::updateCategoryConfig()
108{ 108{
109 qDebug("KOIncidenceEditor::updateCategoryConfig() is dead! "); 109 qDebug("KOIncidenceEditor::updateCategoryConfig() is dead! ");
110 //mCategoryDialog->updateCategoryConfig(); 110 //mCategoryDialog->updateCategoryConfig();
111} 111}
112 112
113void KOIncidenceEditor::slotCancel() 113void KOIncidenceEditor::slotCancel()
114{ 114{
115 reject(); 115 reject();
116} 116}
117 117
118void KOIncidenceEditor::slotLoadTemplate() 118void KOIncidenceEditor::slotLoadTemplate()
119{ 119{
120 kdDebug() << "KOIncidenceEditor::loadTemplate()" << endl; 120 kdDebug() << "KOIncidenceEditor::loadTemplate()" << endl;
121} 121}
122void KOIncidenceEditor::slotShowIncidence() 122void KOIncidenceEditor::slotShowIncidence()
123{ 123{
124 124
125 if ( processInput(true ) ) { 125 if ( processInput(true ) ) {
126 accept(); 126 accept();
127 } 127 }
128} 128}
129 129
130void KOIncidenceEditor::slotSaveTemplate() 130void KOIncidenceEditor::slotSaveTemplate()
131{ 131{
132 kdDebug() << "KOIncidenceEditor::saveTemplate()" << endl; 132 kdDebug() << "KOIncidenceEditor::saveTemplate()" << endl;
133} 133}
134 134
135void KOIncidenceEditor::createSaveTemplateDialog( SaveTemplateDialog::IncidenceType type ) 135void KOIncidenceEditor::createSaveTemplateDialog( SaveTemplateDialog::IncidenceType type )
136{ 136{
137 if ( !mSaveTemplateDialog ) { 137 if ( !mSaveTemplateDialog ) {
138 mSaveTemplateDialog = new SaveTemplateDialog( type, this ); 138 mSaveTemplateDialog = new SaveTemplateDialog( type, this );
139 connect( mSaveTemplateDialog, SIGNAL( templateSelected( const QString & ) ), 139 connect( mSaveTemplateDialog, SIGNAL( templateSelected( const QString & ) ),
140 SLOT( saveTemplate( const QString & ) ) ); 140 SLOT( saveTemplate( const QString & ) ) );
141 } 141 }
142 mSaveTemplateDialog->show(); 142 mSaveTemplateDialog->show();
143 mSaveTemplateDialog->raise(); 143 mSaveTemplateDialog->raise();
144} 144}
145 145
146void KOIncidenceEditor::saveAsTemplate( Incidence *incidence, 146void KOIncidenceEditor::saveAsTemplate( Incidence *incidence,
147 const QString &templateName ) 147 const QString &templateName )
148{ 148{
149 CalendarLocal cal; 149 CalendarLocal cal;
150 cal.addIncidence( incidence ); 150 cal.addIncidence( incidence );
151 ICalFormat format; 151 ICalFormat format;
152 format.save( &cal, templateName ); 152 format.save( &cal, templateName );
153} 153}
154 154
155QString KOIncidenceEditor::loadTemplate( Calendar *cal, const QString &type, 155QString KOIncidenceEditor::loadTemplate( Calendar *cal, const QString &type,
156 const QStringList &templates ) 156 const QStringList &templates )
157{ 157{
158 // bool ok = false; 158 // bool ok = false;
159// QString templateName = KInputDialog::getItem( i18n("Load Template"), 159// QString templateName = KInputDialog::getItem( i18n("Load Template"),
160// i18n("Select a template to load:"), templates, 0, &ok ); 160// i18n("Select a template to load:"), templates, 0, &ok );
161// if ( !ok || templateName.isEmpty() ) return QString::null; 161// if ( !ok || templateName.isEmpty() ) return QString::null;
162 162
163// QString fileName = locateLocal( "data", "korganizer/templates/" + type + "/" + 163// QString fileName = locateLocal( "data", "korganizer/templates/" + type + "/" +
164// templateName ); 164// templateName );
165// fn =KFileDialog:: getOpenFileName( fn, "Import filename(*.ics/*.vcs)", this ); 165// fn =KFileDialog:: getOpenFileName( fn, "Import filename(*.ics/*.vcs)", this );
166 166
167 // QString fileName;// =locateLocal( "templates", incidence->type() ); 167 // QString fileName;// =locateLocal( "templates", incidence->type() );
168// fileName=KFileDialog:: getOpenFileName( fileName, "Load "+incidence()->type(), this ); 168// fileName=KFileDialog:: getOpenFileName( fileName, "Load "+incidence()->type(), this );
169// if ( fileNamelength() == 0) 169// if ( fileNamelength() == 0)
170// return QString::null; 170// return QString::null;
171// if ( fileName.isEmpty() ) { 171// if ( fileName.isEmpty() ) {
172// KMessageBox::error( this, i18n("Unable to find template '%1'.") 172// KMessageBox::error( this, i18n("Unable to find template '%1'.")
173// .arg( fileName ) ); 173// .arg( fileName ) );
174// return QString::null; 174// return QString::null;
175// } else { 175// } else {
176// ICalFormat format; 176// ICalFormat format;
177// if ( !format.load( cal, fileName ) ) { 177// if ( !format.load( cal, fileName ) ) {
178// KMessageBox::error( this, i18n("Error loading template file '%1'.") 178// KMessageBox::error( this, i18n("Error loading template file '%1'.")
179// .arg( fileName ) ); 179// .arg( fileName ) );
180// return QString::null; 180// return QString::null;
181// } 181// }
182// } 182// }
183 183
184 return ""; 184 return "";
185} 185}
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 8b90ae5..555c1b1 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -1,448 +1,452 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 1997, 1998 Preston Brown 3 Copyright (c) 1997, 1998 Preston Brown
4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24 24
25#include <qtooltip.h> 25#include <qtooltip.h>
26#include <qframe.h> 26#include <qframe.h>
27#include <qpixmap.h> 27#include <qpixmap.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qhbox.h> 29#include <qhbox.h>
30#include <qdir.h> 30#include <qdir.h>
31#include <qdatetime.h> 31#include <qdatetime.h>
32#include <qapplication.h> 32#include <qapplication.h>
33#include <qtabwidget.h> 33#include <qtabwidget.h>
34 34
35#include <kiconloader.h> 35#include <kiconloader.h>
36#include <klocale.h> 36#include <klocale.h>
37#include <kfiledialog.h> 37#include <kfiledialog.h>
38#include <kstandarddirs.h> 38#include <kstandarddirs.h>
39#include <kmessagebox.h> 39#include <kmessagebox.h>
40 40
41#include <libkdepim/categoryselectdialog.h> 41#include <libkdepim/categoryselectdialog.h>
42#include <libkcal/calendarlocal.h> 42#include <libkcal/calendarlocal.h>
43#include <libkcal/calendarresources.h> 43#include <libkcal/calendarresources.h>
44#include <libkcal/resourcecalendar.h> 44#include <libkcal/resourcecalendar.h>
45#include <libkcal/icalformat.h> 45#include <libkcal/icalformat.h>
46#include <kresources/resourceselectdialog.h> 46#include <kresources/resourceselectdialog.h>
47#include <libkdepim/kdateedit.h> 47#include <libkdepim/kdateedit.h>
48 48
49#include "koprefs.h" 49#include "koprefs.h"
50#include "kolocationbox.h" 50#include "kolocationbox.h"
51 51
52#include "kotodoeditor.h" 52#include "kotodoeditor.h"
53extern int globalFlagBlockAgenda; 53extern int globalFlagBlockAgenda;
54 54
55KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) : 55KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) :
56 KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent ) 56 KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent )
57{ 57{
58 mTodo = 0; 58 mTodo = 0;
59 mRelatedTodo = 0; 59 mRelatedTodo = 0;
60 findButton(User1)->hide(); 60 findButton(User1)->hide();
61 init(); 61 init();
62 if ( QApplication::desktop()->height() <= 240 ) 62 if ( QApplication::desktop()->height() <= 240 )
63 hideButtons(); 63 hideButtons();
64} 64}
65 65
66KOTodoEditor::~KOTodoEditor() 66KOTodoEditor::~KOTodoEditor()
67{ 67{
68 emit dialogClose( mTodo ); 68 emit dialogClose( mTodo );
69} 69}
70 70
71void KOTodoEditor::init() 71void KOTodoEditor::init()
72{ 72{
73 setupGeneral(); 73 setupGeneral();
74 setupAttendeesTab(); 74 setupAttendeesTab();
75 setupRecurrence(); 75 setupRecurrence();
76 connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence())); 76 connect(mGeneral,SIGNAL(datesChecked()),this ,SLOT(checkRecurrence()));
77 mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") ); 77 mRecurrence->setDateTimeStr( i18n("<i>The recurrence is computed from the start datetime!</i>") );
78 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), 78 connect(mGeneral,SIGNAL(dateTimesChanged(QDateTime,QDateTime)),
79 mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime))); 79 mRecurrence,SLOT(setDefaultsDates(QDateTime,QDateTime)));
80} 80}
81void KOTodoEditor::setupRecurrence() 81void KOTodoEditor::setupRecurrence()
82{ 82{
83 QFrame *topFrame = addPage( i18n("Recurrence") ); 83 QFrame *topFrame = addPage( i18n("Recurrence") );
84 QBoxLayout *topLayout = new QVBoxLayout( topFrame ); 84 QBoxLayout *topLayout = new QVBoxLayout( topFrame );
85 85
86 mRecurrence = new KOEditorRecurrence( topFrame ); 86 mRecurrence = new KOEditorRecurrence( topFrame );
87 topLayout->addWidget( mRecurrence ); 87 topLayout->addWidget( mRecurrence );
88} 88}
89 89
90void KOTodoEditor::setCategories( QString s ) 90void KOTodoEditor::setCategories( QString s )
91{ 91{
92 mGeneral->setCategories(s); 92 mGeneral->setCategories(s);
93} 93}
94void KOTodoEditor::setSecrecy( int sec ) 94void KOTodoEditor::setSecrecy( int sec )
95{ 95{
96 mGeneral->setSecrecy( sec ); 96 mGeneral->setSecrecy( sec );
97} 97}
98void KOTodoEditor::reload() 98void KOTodoEditor::reload()
99{ 99{
100 if ( mTodo ) readTodo( mTodo ); 100 if ( mTodo ) readTodo( mTodo );
101} 101}
102 102
103void KOTodoEditor::setupGeneral() 103void KOTodoEditor::setupGeneral()
104{ 104{
105 mGeneral = new KOEditorGeneralTodo(this); 105 mGeneral = new KOEditorGeneralTodo(this);
106 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) ); 106 connect ( mGeneral, SIGNAL ( allAccepted() ), this, SLOT ( slotOk () ) );
107 107
108 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show())); 108 // connect(mGeneral,SIGNAL(openCategoryDialog()),mCategoryDialog,SLOT(show()));
109 //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), 109 //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)),
110 // mGeneral,SLOT(setCategories(const QString &))); 110 // mGeneral,SLOT(setCategories(const QString &)));
111 111
112 if (KOPrefs::instance()->mCompactDialogs) { 112 if (KOPrefs::instance()->mCompactDialogs) {
113 QFrame *topFrame = addPage(i18n("General")); 113 QFrame *topFrame = addPage(i18n("General"));
114 114
115 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 115 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
116 if ( QApplication::desktop()->width() < 480 ) { 116 if ( QApplication::desktop()->width() < 480 ) {
117 topLayout->setMargin(marginHintSmall()); 117 topLayout->setMargin(marginHintSmall());
118 topLayout->setSpacing(spacingHintSmall()); 118 topLayout->setSpacing(spacingHintSmall());
119 } else { 119 } else {
120 topLayout->setMargin(marginHint()); 120 topLayout->setMargin(marginHint());
121 topLayout->setSpacing(spacingHint()); 121 topLayout->setSpacing(spacingHint());
122 } 122 }
123 topLayout->addStretch( 1 );
123 mGeneral->initHeader(topFrame,topLayout); 124 mGeneral->initHeader(topFrame,topLayout);
125 topLayout->addStretch( 1 );
124 mGeneral->initTime(topFrame,topLayout); 126 mGeneral->initTime(topFrame,topLayout);
127 topLayout->addStretch( 1 );
125 mGeneral->initAlarm(topFrame,topLayout); 128 mGeneral->initAlarm(topFrame,topLayout);
129 topLayout->addStretch( 1 );
126 mGeneral->enableAlarm( false ); 130 mGeneral->enableAlarm( false );
127 131
128 132
129 QBoxLayout *priorityLayout; 133 QBoxLayout *priorityLayout;
130 if ( QApplication::desktop()->width() < 500 ) 134 if ( QApplication::desktop()->width() < 500 )
131 priorityLayout = new QVBoxLayout( topLayout ); 135 priorityLayout = new QVBoxLayout( topLayout );
132 else 136 else
133 priorityLayout = new QHBoxLayout( topLayout ); 137 priorityLayout = new QHBoxLayout( topLayout );
134 QWidget* prioWidget = new QWidget (topFrame); 138 QWidget* prioWidget = new QWidget (topFrame);
135 priorityLayout->addWidget( prioWidget ); 139 priorityLayout->addWidget( prioWidget );
136 QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); 140 QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget);
137 141
138 142
139 QIconSet icon; 143 QIconSet icon;
140 if ( QApplication::desktop()->width() < 321 ) 144 if ( QApplication::desktop()->width() < 321 )
141 icon = SmallIcon("fileimport16"); 145 icon = SmallIcon("fileimport16");
142 else 146 else
143 icon = SmallIcon("fileimport"); 147 icon = SmallIcon("fileimport");
144 QPushButton * loadTemplate = new QPushButton( prioWidget); 148 QPushButton * loadTemplate = new QPushButton( prioWidget);
145 loadTemplate->setIconSet (icon ) ; 149 loadTemplate->setIconSet (icon ) ;
146 int size = loadTemplate->sizeHint().height(); 150 int size = loadTemplate->sizeHint().height();
147 loadTemplate->setFixedSize( size, size ); 151 loadTemplate->setFixedSize( size, size );
148 if ( QApplication::desktop()->width() < 321 ) 152 if ( QApplication::desktop()->width() < 321 )
149 icon = SmallIcon("fileexport16"); 153 icon = SmallIcon("fileexport16");
150 else 154 else
151 icon = SmallIcon("fileexport"); 155 icon = SmallIcon("fileexport");
152 QPushButton * saveTemplate = new QPushButton( prioWidget); 156 QPushButton * saveTemplate = new QPushButton( prioWidget);
153 saveTemplate->setIconSet (icon ) ; 157 saveTemplate->setIconSet (icon ) ;
154 saveTemplate->setFixedSize( size, size ); 158 saveTemplate->setFixedSize( size, size );
155 159
156 priorityLayout2->addWidget(loadTemplate); 160 priorityLayout2->addWidget(loadTemplate);
157 priorityLayout2->addWidget(saveTemplate); 161 priorityLayout2->addWidget(saveTemplate);
158 mGeneral->initPriority(prioWidget,priorityLayout2); 162 mGeneral->initPriority(prioWidget,priorityLayout2);
159 mGeneral->initCategories( topFrame, priorityLayout ); 163 mGeneral->initCategories( topFrame, priorityLayout );
160 topLayout->addStretch(1); 164 topLayout->addStretch(1);
161 165
162 QFrame *topFrame2 = addPage(i18n("Details")); 166 QFrame *topFrame2 = addPage(i18n("Details"));
163 167
164 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); 168 QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2);
165 topLayout2->setMargin(marginHint()); 169 topLayout2->setMargin(marginHint());
166 topLayout2->setSpacing(spacingHint()); 170 topLayout2->setSpacing(spacingHint());
167 171
168 QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); 172 QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 );
169 mGeneral->initCompletion(topFrame2,completionLayout); 173 mGeneral->initCompletion(topFrame2,completionLayout);
170 174
171 175
172 mGeneral->initSecrecy( topFrame2, topLayout2 ); 176 mGeneral->initSecrecy( topFrame2, topLayout2 );
173 mGeneral->initDescription(topFrame2,topLayout2); 177 mGeneral->initDescription(topFrame2,topLayout2);
174 178
175 // QHBox * hb = new QHBox ( topFrame2 ); 179 // QHBox * hb = new QHBox ( topFrame2 );
176 // topLayout2->addWidget(hb); 180 // topLayout2->addWidget(hb);
177 // hb->setSpacing( 3 ); 181 // hb->setSpacing( 3 );
178 182
179 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); 183 connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
180 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); 184 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) );
181 185
182 } else { 186 } else {
183 QFrame *topFrame = addPage(i18n("General")); 187 QFrame *topFrame = addPage(i18n("General"));
184 188
185 QBoxLayout *topLayout = new QVBoxLayout(topFrame); 189 QBoxLayout *topLayout = new QVBoxLayout(topFrame);
186 topLayout->setSpacing(spacingHint()); 190 topLayout->setSpacing(spacingHint());
187 191
188 mGeneral->initHeader(topFrame,topLayout); 192 mGeneral->initHeader(topFrame,topLayout);
189 mGeneral->initTime(topFrame,topLayout); 193 mGeneral->initTime(topFrame,topLayout);
190 mGeneral->initStatus(topFrame,topLayout); 194 mGeneral->initStatus(topFrame,topLayout);
191 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); 195 QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout);
192 mGeneral->initAlarm(topFrame,alarmLineLayout); 196 mGeneral->initAlarm(topFrame,alarmLineLayout);
193 mGeneral->initDescription(topFrame,topLayout); 197 mGeneral->initDescription(topFrame,topLayout);
194 QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); 198 QBoxLayout *detailsLayout = new QHBoxLayout(topLayout);
195 mGeneral->initCategories( topFrame, detailsLayout ); 199 mGeneral->initCategories( topFrame, detailsLayout );
196 mGeneral->initSecrecy( topFrame, detailsLayout ); 200 mGeneral->initSecrecy( topFrame, detailsLayout );
197 } 201 }
198 mGeneral->finishSetup(); 202 mGeneral->finishSetup();
199 203
200} 204}
201 205
202void KOTodoEditor::editTodo(Todo *todo, bool editDescription) 206void KOTodoEditor::editTodo(Todo *todo, bool editDescription)
203{ 207{
204 //init(); 208 //init();
205 209
206 mTodo = todo; 210 mTodo = todo;
207 readTodo(mTodo); 211 readTodo(mTodo);
208 if ( editDescription ) { 212 if ( editDescription ) {
209 showPage( 1 ); 213 showPage( 1 );
210 mGeneral->setFocusOn( 1 ); 214 mGeneral->setFocusOn( 1 );
211 } else { 215 } else {
212 showPage( 0 ); 216 showPage( 0 );
213 mGeneral->setFocusOn( 2 ); 217 mGeneral->setFocusOn( 2 );
214 } 218 }
215 checkRecurrence(); 219 checkRecurrence();
216} 220}
217 221
218void KOTodoEditor::newTodo(QDateTime due,Todo *relatedTodo,bool allDay) 222void KOTodoEditor::newTodo(QDateTime due,Todo *relatedTodo,bool allDay)
219{ 223{
220 //init(); 224 //init();
221 225
222 mTodo = 0; 226 mTodo = 0;
223 setDefaults(due,relatedTodo,allDay); 227 setDefaults(due,relatedTodo,allDay);
224} 228}
225 229
226void KOTodoEditor::loadDefaults() 230void KOTodoEditor::loadDefaults()
227{ 231{
228 setDefaults(QDateTime::currentDateTime().addDays(7),0,false); 232 setDefaults(QDateTime::currentDateTime().addDays(7),0,false);
229} 233}
230 234
231bool KOTodoEditor::processInput( bool emitTime ) 235bool KOTodoEditor::processInput( bool emitTime )
232{ 236{
233 if (!validateInput()) return false; 237 if (!validateInput()) return false;
234 238
235 Todo *todo = 0; 239 Todo *todo = 0;
236 240
237 if (mTodo) todo = mTodo; 241 if (mTodo) todo = mTodo;
238 else { 242 else {
239 todo = new Todo; 243 todo = new Todo;
240 todo->setOrganizer(KOPrefs::instance()->email()); 244 todo->setOrganizer(KOPrefs::instance()->email());
241 } 245 }
242 246
243 writeTodo(todo); 247 writeTodo(todo);
244 if ( emitTime ) { 248 if ( emitTime ) {
245 globalFlagBlockAgenda = 1; 249 globalFlagBlockAgenda = 1;
246 emit showAgendaView( false ); 250 emit showAgendaView( false );
247 if ( todo->hasDueDate() ) 251 if ( todo->hasDueDate() )
248 emit jumpToTime( todo->dtDue().date() ); 252 emit jumpToTime( todo->dtDue().date() );
249 globalFlagBlockAgenda = 2; 253 globalFlagBlockAgenda = 2;
250 } 254 }
251 if (mTodo) { 255 if (mTodo) {
252 todo->setRevision(todo->revision()+1); 256 todo->setRevision(todo->revision()+1);
253 emit todoChanged(todo); 257 emit todoChanged(todo);
254 } else { 258 } else {
255 mCalendar->addTodo(todo); 259 mCalendar->addTodo(todo);
256 mTodo = todo; 260 mTodo = todo;
257 emit todoAdded(todo); 261 emit todoAdded(todo);
258 } 262 }
259 263
260 return true; 264 return true;
261} 265}
262 266
263void KOTodoEditor::deleteTodo() 267void KOTodoEditor::deleteTodo()
264{ 268{
265 if (mTodo) { 269 if (mTodo) {
266 if (KOPrefs::instance()->mConfirm) { 270 if (KOPrefs::instance()->mConfirm) {
267 switch (msgItemDelete()) { 271 switch (msgItemDelete()) {
268 case KMessageBox::Continue: // OK 272 case KMessageBox::Continue: // OK
269 emit todoToBeDeleted(mTodo); 273 emit todoToBeDeleted(mTodo);
270 emit dialogClose(mTodo); 274 emit dialogClose(mTodo);
271 mCalendar->deleteTodo(mTodo); 275 mCalendar->deleteTodo(mTodo);
272 emit todoDeleted(); 276 emit todoDeleted();
273 reject(); 277 reject();
274 break; 278 break;
275 } 279 }
276 } 280 }
277 else { 281 else {
278 emit todoToBeDeleted(mTodo); 282 emit todoToBeDeleted(mTodo);
279 emit dialogClose(mTodo); 283 emit dialogClose(mTodo);
280 mCalendar->deleteTodo(mTodo); 284 mCalendar->deleteTodo(mTodo);
281 emit todoDeleted(); 285 emit todoDeleted();
282 reject(); 286 reject();
283 } 287 }
284 } else { 288 } else {
285 reject(); 289 reject();
286 } 290 }
287} 291}
288 292
289void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) 293void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay)
290{ 294{
291 mRelatedTodo = relatedEvent; 295 mRelatedTodo = relatedEvent;
292 296
293 mGeneral->setDefaults(due,allDay); 297 mGeneral->setDefaults(due,allDay);
294 mDetails->setDefaults(); 298 mDetails->setDefaults();
295 showPage( 0 ); 299 showPage( 0 );
296 if ( mRelatedTodo ) { 300 if ( mRelatedTodo ) {
297 mGeneral->setCategories (mRelatedTodo->categoriesStr ()); 301 mGeneral->setCategories (mRelatedTodo->categoriesStr ());
298 mGeneral->setSecrecy (mRelatedTodo->secrecy ()); 302 mGeneral->setSecrecy (mRelatedTodo->secrecy ());
299 if ( mRelatedTodo->priority() < 3 ) 303 if ( mRelatedTodo->priority() < 3 )
300 mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1); 304 mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1);
301 mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": "); 305 mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": ");
302 int len = mRelatedTodo->summary().length(); 306 int len = mRelatedTodo->summary().length();
303 mGeneral->mSummaryEdit->lineEdit()->setFocus(); 307 mGeneral->mSummaryEdit->lineEdit()->setFocus();
304 mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 ); 308 mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 );
305 mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 ); 309 mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 );
306 310
307 } else 311 } else
308 mGeneral->setFocusOn( 2 ); 312 mGeneral->setFocusOn( 2 );
309 tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); 313 tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false );
310 mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 )); 314 mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 ));
311} 315}
312void KOTodoEditor::checkRecurrence() 316void KOTodoEditor::checkRecurrence()
313{ 317{
314 if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { 318 if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) {
315 tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), true ); 319 tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), true );
316 320
317 if ( mTodo ) 321 if ( mTodo )
318 mRecurrence->readEvent( mTodo ); 322 mRecurrence->readEvent( mTodo );
319 else { 323 else {
320 bool time = mGeneral->mTimeButton->isChecked(); 324 bool time = mGeneral->mTimeButton->isChecked();
321 QDateTime from,to; 325 QDateTime from,to;
322 if ( time ) { 326 if ( time ) {
323 to = QDateTime( mGeneral->mDueDateEdit->date(), mGeneral->mDueTimeEdit->getTime() ) ; 327 to = QDateTime( mGeneral->mDueDateEdit->date(), mGeneral->mDueTimeEdit->getTime() ) ;
324 from = QDateTime( mGeneral->mStartDateEdit->date(),mGeneral->mStartTimeEdit->getTime( )) ; 328 from = QDateTime( mGeneral->mStartDateEdit->date(),mGeneral->mStartTimeEdit->getTime( )) ;
325 } else { 329 } else {
326 to = QDateTime( mGeneral->mDueDateEdit->date(), QTime( 0,0,0) ) ; 330 to = QDateTime( mGeneral->mDueDateEdit->date(), QTime( 0,0,0) ) ;
327 from = QDateTime( mGeneral->mStartDateEdit->date(),QTime( 0,0,0) ) ; 331 from = QDateTime( mGeneral->mStartDateEdit->date(),QTime( 0,0,0) ) ;
328 } 332 }
329 if ( to < from ) 333 if ( to < from )
330 to = from; 334 to = from;
331 mRecurrence->setDefaults(from,to); 335 mRecurrence->setDefaults(from,to);
332 } 336 }
333 } else { 337 } else {
334 tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); 338 tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false );
335 mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 )); 339 mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 ));
336 } 340 }
337} 341}
338void KOTodoEditor::readTodo(Todo *todo) 342void KOTodoEditor::readTodo(Todo *todo)
339{ 343{
340 mGeneral->readTodo(todo); 344 mGeneral->readTodo(todo);
341 mDetails->readEvent(todo); 345 mDetails->readEvent(todo);
342 mRelatedTodo = 0;//todo->relatedTo(); 346 mRelatedTodo = 0;//todo->relatedTo();
343 // categories 347 // categories
344 // mCategoryDialog->setSelected(todo->categories()); 348 // mCategoryDialog->setSelected(todo->categories());
345 349
346 // We should handle read-only events here. 350 // We should handle read-only events here.
347} 351}
348 352
349void KOTodoEditor::writeTodo(Todo *event) 353void KOTodoEditor::writeTodo(Todo *event)
350{ 354{
351 bool maybeComputeRecurrenceTime = false; 355 bool maybeComputeRecurrenceTime = false;
352 if( event->hasRecurrenceID() && event->percentComplete() < 100) 356 if( event->hasRecurrenceID() && event->percentComplete() < 100)
353 maybeComputeRecurrenceTime = true; 357 maybeComputeRecurrenceTime = true;
354 event->setHasRecurrenceID( false ); 358 event->setHasRecurrenceID( false );
355 mGeneral->writeTodo(event); 359 mGeneral->writeTodo(event);
356 mDetails->writeEvent(event); 360 mDetails->writeEvent(event);
357 361
358 // set related event, i.e. parent to-do in this case. 362 // set related event, i.e. parent to-do in this case.
359 if (mRelatedTodo) { 363 if (mRelatedTodo) {
360 event->setRelatedTo(mRelatedTodo); 364 event->setRelatedTo(mRelatedTodo);
361 } 365 }
362 if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { 366 if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) {
363 mRecurrence->writeEvent(event); 367 mRecurrence->writeEvent(event);
364 if ( event->doesRecur() ) { 368 if ( event->doesRecur() ) {
365 int addSec = -1 ; 369 int addSec = -1 ;
366 if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 ) 370 if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 )
367 addSec = 1; 371 addSec = 1;
368 event->setRecurrenceID( event->dtStart().addSecs( addSec ) ); 372 event->setRecurrenceID( event->dtStart().addSecs( addSec ) );
369 event->setRecurDates(); 373 event->setRecurDates();
370 } else { 374 } else {
371 event->setHasRecurrenceID( false ); 375 event->setHasRecurrenceID( false );
372 } 376 }
373 } else { 377 } else {
374 event->setHasRecurrenceID( false ); 378 event->setHasRecurrenceID( false );
375 event->recurrence()->unsetRecurs(); 379 event->recurrence()->unsetRecurs();
376 } 380 }
377} 381}
378 382
379bool KOTodoEditor::validateInput() 383bool KOTodoEditor::validateInput()
380{ 384{
381 if (!mGeneral->validateInput()) return false; 385 if (!mGeneral->validateInput()) return false;
382 if (!mDetails->validateInput()) return false; 386 if (!mDetails->validateInput()) return false;
383 return true; 387 return true;
384} 388}
385 389
386int KOTodoEditor::msgItemDelete() 390int KOTodoEditor::msgItemDelete()
387{ 391{
388 return KMessageBox::warningContinueCancel(this, 392 return KMessageBox::warningContinueCancel(this,
389 i18n("This item will be permanently deleted."), 393 i18n("This item will be permanently deleted."),
390 i18n("KOrganizer Confirmation"),i18n("Delete")); 394 i18n("KOrganizer Confirmation"),i18n("Delete"));
391} 395}
392 396
393void KOTodoEditor::modified (int modification) 397void KOTodoEditor::modified (int modification)
394{ 398{
395 if (modification == KOGlobals::CATEGORY_MODIFIED || 399 if (modification == KOGlobals::CATEGORY_MODIFIED ||
396 KOGlobals::UNKNOWN_MODIFIED == modification ) 400 KOGlobals::UNKNOWN_MODIFIED == modification )
397 // mCategoryDialog->setSelected (mTodo->categories ()); 401 // mCategoryDialog->setSelected (mTodo->categories ());
398 mGeneral->modified (mTodo, modification); 402 mGeneral->modified (mTodo, modification);
399 403
400} 404}
401 405
402void KOTodoEditor::slotLoadTemplate() 406void KOTodoEditor::slotLoadTemplate()
403{ 407{
404 408
405 QString fileName =locateLocal( "templates", "todos" ); 409 QString fileName =locateLocal( "templates", "todos" );
406 QDir t_dir; 410 QDir t_dir;
407 if ( !t_dir.exists(fileName) ) 411 if ( !t_dir.exists(fileName) )
408 t_dir.mkdir ( fileName ); 412 t_dir.mkdir ( fileName );
409 fileName += "/todo"; 413 fileName += "/todo";
410 fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this ); 414 fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this );
411 if ( fileName.length() == 0 ) 415 if ( fileName.length() == 0 )
412 return; 416 return;
413 CalendarLocal cal; 417 CalendarLocal cal;
414 ICalFormat format; 418 ICalFormat format;
415 if ( !format.load( &cal, fileName ) ) { 419 if ( !format.load( &cal, fileName ) ) {
416 KMessageBox::error( this, i18n("Error loading template file\n '%1'.") 420 KMessageBox::error( this, i18n("Error loading template file\n '%1'.")
417 .arg( fileName ) ); 421 .arg( fileName ) );
418 return ; 422 return ;
419 } 423 }
420 QPtrList<Todo> todos = cal.todos(); 424 QPtrList<Todo> todos = cal.todos();
421 Todo * todo = todos.first(); 425 Todo * todo = todos.first();
422 if ( !todo ) { 426 if ( !todo ) {
423 KMessageBox::error( this, 427 KMessageBox::error( this,
424 i18n("Template does not\ncontain a valid Todo.")); 428 i18n("Template does not\ncontain a valid Todo."));
425 } else { 429 } else {
426 readTodo( todo ); 430 readTodo( todo );
427 } 431 }
428 432
429} 433}
430 434
431void KOTodoEditor::slotSaveTemplate() 435void KOTodoEditor::slotSaveTemplate()
432{ 436{
433 QString fileName =locateLocal( "templates", "todos" ); 437 QString fileName =locateLocal( "templates", "todos" );
434 QDir t_dir; 438 QDir t_dir;
435 if ( !t_dir.exists(fileName) ) 439 if ( !t_dir.exists(fileName) )
436 t_dir.mkdir ( fileName ); 440 t_dir.mkdir ( fileName );
437 fileName += "/todo"; 441 fileName += "/todo";
438 fileName = KFileDialog::getSaveFileName( fileName , "Save as Todo template", this ); 442 fileName = KFileDialog::getSaveFileName( fileName , "Save as Todo template", this );
439 if ( fileName.length() > 0 ) 443 if ( fileName.length() > 0 )
440 saveTemplate( fileName ); 444 saveTemplate( fileName );
441} 445}
442 446
443void KOTodoEditor::saveTemplate( const QString &templateName ) 447void KOTodoEditor::saveTemplate( const QString &templateName )
444{ 448{
445 Todo *todo = new Todo; 449 Todo *todo = new Todo;
446 writeTodo( todo ); 450 writeTodo( todo );
447 saveAsTemplate( todo, templateName ); 451 saveAsTemplate( todo, templateName );
448} 452}