-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 13 | ||||
-rw-r--r-- | kalarmd/alarmdialog.cpp | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 28 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 27 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 8 | ||||
-rw-r--r-- | libkcal/calendarlocal.cpp | 1 |
6 files changed, 59 insertions, 22 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index ce55780..5ef60be 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1,1316 +1,1325 @@ | |||
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 completed To-Dos?","Alle bereits erledigten Todos löschen?" }, | 128 | { "Delete all completed To-Dos?","Alle bereits erledigten Todos löschen?" }, |
129 | { "Delete All","Lösche alles" }, | 129 | { "Delete All","Lösche alles" }, |
130 | { "Delete all selected","Lösche alle Selektierten" }, | 130 | { "Delete all selected","Lösche alle Selektierten" }, |
131 | { "Delete Current","Aktuellen löschen" }, | 131 | { "Delete Current","Aktuellen löschen" }, |
132 | { "Delete Event...","Lösche Termin..." }, | 132 | { "Delete Event...","Lösche Termin..." }, |
133 | { "Delete Event","Lösche Termin" }, | 133 | { "Delete Event","Lösche Termin" }, |
134 | { "&Delete","Löschen" }, | 134 | { "&Delete","Löschen" }, |
135 | { "Delete...","Löschen..." }, | 135 | { "Delete...","Löschen..." }, |
136 | { "Delete","Löschen" }, | 136 | { "Delete","Löschen" }, |
137 | { "Delete Todo...","Lösche Todo..." }, | 137 | { "Delete Todo...","Lösche Todo..." }, |
138 | { "Delete To-Do","Lösche Todo" }, | 138 | { "Delete To-Do","Lösche Todo" }, |
139 | { "Deleting item %d ...","Lösche Eintrag %d..." }, | 139 | { "Deleting item %d ...","Lösche Eintrag %d..." }, |
140 | { "Descriptions","Beschreibungen" }, | 140 | { "Descriptions","Beschreibungen" }, |
141 | { "Deselect all","Deselektiere Alle" }, | 141 | { "Deselect all","Deselektiere Alle" }, |
142 | { "Details","Details" }, | 142 | { "Details","Details" }, |
143 | { "Dinner","Abendessen" }, | 143 | { "Dinner","Abendessen" }, |
144 | { "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" }, | 144 | { "Do you really want\nto close KO/Pi?","Möchten Sie wirklich\nKO/PI verlassen?" }, |
145 | { "Due Date","Fällig am" }, | 145 | { "Due Date","Fällig am" }, |
146 | { "Due: ","Fällig: "}, | 146 | { "Due: ","Fällig: "}, |
147 | { "Due Time","Fällig um" }, | 147 | { "Due Time","Fällig um" }, |
148 | { "Due:","Fällig:"}, | 148 | { "Due:","Fällig:"}, |
149 | { "Duration: ","Dauer: " }, | 149 | { "Duration: ","Dauer: " }, |
150 | { "Edit...","Bearbeite..." }, | 150 | { "Edit...","Bearbeite..." }, |
151 | { "Edit","Bearbeite" }, | 151 | { "Edit","Bearbeite" }, |
152 | { "Edit Event...","Bearbeite Termin..." }, | 152 | { "Edit Event...","Bearbeite Termin..." }, |
153 | { "Edit Event","Bearbeite Termin" }, | 153 | { "Edit Event","Bearbeite Termin" }, |
154 | { "Edit exceptions","Bearbeite Ausnahmen" }, | 154 | { "Edit exceptions","Bearbeite Ausnahmen" }, |
155 | { "EditorBox:","Editor Fenster:" }, | 155 | { "EditorBox:","Editor Fenster:" }, |
156 | { "Edit Recurrence Range","Bearbeite Wiederholung" }, | 156 | { "Edit Recurrence Range","Bearbeite Wiederholung" }, |
157 | { "Edit Todo...","Berabeite Todo..." }, | 157 | { "Edit Todo...","Berabeite Todo..." }, |
158 | { "Edit To-Do","Todo bearbeiten" }, | 158 | { "Edit To-Do","Todo bearbeiten" }, |
159 | { "E&mail address:","E&mail Adresse:" }, | 159 | { "E&mail address:","E&mail Adresse:" }, |
160 | { "(EmptyEmail)","(KeineEmail)" }, | 160 | { "(EmptyEmail)","(KeineEmail)" }, |
161 | { "(EmptyName)","(KeinName)" }, | 161 | { "(EmptyName)","(KeinName)" }, |
162 | { "Enable Recurrence","Wiederholender Termin" }, | 162 | { "Enable Recurrence","Wiederholender Termin" }, |
163 | { "End after","Endet nach"}, | 163 | { "End after","Endet nach"}, |
164 | { "End by:","Endet am"}, | 164 | { "End by:","Endet am"}, |
165 | { "End Date","End Datum" }, | 165 | { "End Date","End Datum" }, |
166 | { "End:","Ende:" }, | 166 | { "End:","Ende:" }, |
167 | { "End Time","End Zeit" }, | 167 | { "End Time","End Zeit" }, |
168 | { "English","Englisch" }, | 168 | { "English","Englisch" }, |
169 | { "Event","Termin" }, | 169 | { "Event","Termin" }, |
170 | { "Event list","Termin Liste" }, | 170 | { "Event list","Termin Liste" }, |
171 | { "Events","Termine" }, | 171 | { "Events","Termine" }, |
172 | { "Event Viewer:","Termin Übersicht:" }, | 172 | { "Event Viewer:","Termin Übersicht:" }, |
173 | { "every","jede" }, | 173 | { "every","jede" }, |
174 | { "Exceptions...","Ausnahmen..." }, | 174 | { "Exceptions...","Ausnahmen..." }, |
175 | { "Exceptions","Ausnahmen" }, | 175 | { "Exceptions","Ausnahmen" }, |
176 | { "Exclude holidays","Ohne freie Tage" }, | 176 | { "Exclude holidays","Ohne freie Tage" }, |
177 | { "Exclude Saturdays","Ohne Samstage" }, | 177 | { "Exclude Saturdays","Ohne Samstage" }, |
178 | { "Feb","Feb" }, | 178 | { "Feb","Feb" }, |
179 | { "February","Februar" }, | 179 | { "February","Februar" }, |
180 | { "&Find","Suche!" }, | 180 | { "&Find","Suche!" }, |
181 | { "Fonts","Schriftart" }, | 181 | { "Fonts","Schriftart" }, |
182 | { "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" }, | 182 | { "Force take local entry always","Erzwinge:Nimm immer lokalen Eintrag" }, |
183 | { "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"}, | 183 | { "Force take remote entry always","Erzwinge:Nimm immer fernen Eintrag"}, |
184 | { "Free","Frei" }, | 184 | { "Free","Frei" }, |
185 | { "Friday","Freitag" }, | 185 | { "Friday","Freitag" }, |
186 | { "Fri","Fr" }, | 186 | { "Fri","Fr" }, |
187 | { "From:","Vom:" }, | 187 | { "From:","Vom:" }, |
188 | { "Full &name:","Vor- und &Nachname:" }, | 188 | { "Full &name:","Vor- und &Nachname:" }, |
189 | { "General","Allgemein" }, | 189 | { "General","Allgemein" }, |
190 | { "German","Deutsch" }, | 190 | { "German","Deutsch" }, |
191 | { "Gifts","Geschenke" }, | 191 | { "Gifts","Geschenke" }, |
192 | { "Go to Today","Heute anzeigen" }, | 192 | { "Go to Today","Heute anzeigen" }, |
193 | { "Help","Hilfe" }, | 193 | { "Help","Hilfe" }, |
194 | { "Hide Dates","Daten ausblenden" }, | 194 | { "Hide Dates","Daten ausblenden" }, |
195 | { "Highlight color:","Markierungen:" }, | 195 | { "Highlight color:","Markierungen:" }, |
196 | { "Holiday color:","Freie Tage:" }, | 196 | { "Holiday color:","Freie Tage:" }, |
197 | { "hour(s)","Stunde(n)" }, | 197 | { "hour(s)","Stunde(n)" }, |
198 | { "In %1 days: ","In %1 Tagen: " }, | 198 | { "In %1 days: ","In %1 Tagen: " }, |
199 | { "Incomplete Todo:","Unerledigte Aufgaben:" }, | 199 | { "Incomplete Todo:","Unerledigte Aufgaben:" }, |
200 | { "Information","Information" }, | 200 | { "Information","Information" }, |
201 | { "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" }, | 201 | { "Invalid search expression,\ncannot perform ","Kann Suche nicht ausführen" }, |
202 | { "Jan","Jan" }, | 202 | { "Jan","Jan" }, |
203 | { "January","Januar" }, | 203 | { "January","Januar" }, |
204 | { "JournalView:","Journal Ansicht:" }, | 204 | { "JournalView:","Journal Ansicht:" }, |
205 | { "Journals","Journale" }, | 205 | { "Journals","Journale" }, |
206 | { "Jul","Jul" }, | 206 | { "Jul","Jul" }, |
207 | { "July","Juli" }, | 207 | { "July","Juli" }, |
208 | { "Jump to date","Springe zum Datum" }, | 208 | { "Jump to date","Springe zum Datum" }, |
209 | { "June","Juni" }, | 209 | { "June","Juni" }, |
210 | { "Jun","Jun" }, | 210 | { "Jun","Jun" }, |
211 | { "Key Bindings...","Tastenzuordnung..." }, | 211 | { "Key Bindings...","Tastenzuordnung..." }, |
212 | { "Kids","Kinder" }, | 212 | { "Kids","Kinder" }, |
213 | { "Known Problems...","Bekannte Probleme..." }, | 213 | { "Known Problems...","Bekannte Probleme..." }, |
214 | { "KO/Pi Find ","KO/Pi Suchdialog " }, | 214 | { "KO/Pi Find ","KO/Pi Suchdialog " }, |
215 | { "KO/Pi Find: ","KO/Pi Suchen: " }, | 215 | { "KO/Pi Find: ","KO/Pi Suchen: " }, |
216 | { "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." }, | 216 | { "KO/Pi is starting ... "," KO/Pi startet ... \n... Zeit für eine Kaffeepause ..." }, |
217 | { "Language:(needs restart)","Sprache (Neustart!)" }, | 217 | { "Language:(needs restart)","Sprache (Neustart!)" }, |
218 | { "Language:","Sprache" }, | 218 | { "Language:","Sprache" }, |
219 | { "Large","Etwas mehr" }, | 219 | { "Large","Etwas mehr" }, |
220 | { "List View:","Listenansicht:" }, | 220 | { "List View:","Listenansicht:" }, |
221 | { "List View","Listenansicht" }, | 221 | { "List View","Listenansicht" }, |
222 | { "Load/Save","Laden/Speichern" }, | 222 | { "Load/Save","Laden/Speichern" }, |
223 | { "Load Template","Lade Vorlage" }, | 223 | { "Load Template","Lade Vorlage" }, |
224 | { "Locale","Localisation" }, | 224 | { "Locale","Localisation" }, |
225 | { "Local temp file:","Lokale temp. Datei:" }, | 225 | { "Local temp file:","Lokale temp. Datei:" }, |
226 | { "Location: ","Ort: " }, | 226 | { "Location: ","Ort: " }, |
227 | { "Location:","Ort:" }, | 227 | { "Location:","Ort:" }, |
228 | { "Mail client","Mail Programm" }, | 228 | { "Mail client","Mail Programm" }, |
229 | { "Mail Client","Mail Programm" }, | 229 | { "Mail Client","Mail Programm" }, |
230 | { "March","März" }, | 230 | { "March","März" }, |
231 | { "Mar","Mär" }, | 231 | { "Mar","Mär" }, |
232 | { "May","Mai" }, | 232 | { "May","Mai" }, |
233 | { "M. Bains line:","M. Bains Linie:" }, | 233 | { "M. Bains line:","M. Bains Linie:" }, |
234 | { "Medium","Medium" }, | 234 | { "Medium","Medium" }, |
235 | { "Method","Methode" }, | 235 | { "Method","Methode" }, |
236 | { "minute(s)","Minute(n)" }, | 236 | { "minute(s)","Minute(n)" }, |
237 | { "Monday","Montag" }, | 237 | { "Monday","Montag" }, |
238 | { "Mon","Mo" }, | 238 | { "Mon","Mo" }, |
239 | { "Monthly","Monatlich" }, | 239 | { "Monthly","Monatlich" }, |
240 | { "Month not long enough","Monat ist nicht lang genug" }, | 240 | { "Month not long enough","Monat ist nicht lang genug" }, |
241 | { "month(s)","Monat(e)" }, | 241 | { "month(s)","Monat(e)" }, |
242 | { "Month view:","Monatsansicht:" }, | 242 | { "Month view:","Monatsansicht:" }, |
243 | { "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" }, | 243 | { "Month view uses category colors","Monatsansicht zeigt Kategorie Farben" }, |
244 | { "Todo view uses category colors","To-Do Ansicht zeigt Kategorie Farben" }, | 244 | { "Todo view uses category colors","To-Do Ansicht zeigt Kategorie Farben" }, |
245 | { "Move &Down","Nach unten verschieben" }, | 245 | { "Move &Down","Nach unten verschieben" }, |
246 | { "Move &Up","Nach oben verschieben" }, | 246 | { "Move &Up","Nach oben verschieben" }, |
247 | { "Name:","Name:" }, | 247 | { "Name:","Name:" }, |
248 | { "Name","Name" }, | 248 | { "Name","Name" }, |
249 | { "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" }, | 249 | { "\nAre you sure you want\nto delete this event?","\nSind Sie sicher, dass Sie\nden Termin löschen möchten?" }, |
250 | { "%n Days","%n Tage" }, | 250 | { "%n Days","%n Tage" }, |
251 | { "Never","Nie" }, | 251 | { "Never","Nie" }, |
252 | { "New event...","Neuer Termin..." }, | 252 | { "New event...","Neuer Termin..." }, |
253 | { "New event","Neuer Termin" }, | 253 | { "New event","Neuer Termin" }, |
254 | { "New Event...","Neuer Termin..." }, | 254 | { "New Event...","Neuer Termin..." }, |
255 | { "New Events/Todos should","Neue Termine/Todos sollten" }, | 255 | { "New Events/Todos should","Neue Termine/Todos sollten" }, |
256 | { "&New","&Neu" }, | 256 | { "&New","&Neu" }, |
257 | { "New","Neu", }, | 257 | { "New","Neu", }, |
258 | { "New Sub-Todo...","Neues Sub-Todo..." }, | 258 | { "New Sub-Todo...","Neues Sub-Todo..." }, |
259 | { "New Todo...","Neues Todo..." }, | 259 | { "New Todo...","Neues Todo..." }, |
260 | { "Next Alarm: ","Nächster Alarm: ", }, | 260 | { "Next Alarm: ","Nächster Alarm: ", }, |
261 | { "&Next Day","&Nächster Tag", }, | 261 | { "&Next Day","&Nächster Tag", }, |
262 | { "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" }, | 262 | { "Next days view uses full window","Nächste-X-Tage nutzt Vollbild" }, |
263 | { "Next month","Nächster Monat" }, | 263 | { "Next month","Nächster Monat" }, |
264 | { "&Next Week","&Nächste Woche" }, | 264 | { "&Next Week","&Nächste Woche" }, |
265 | { "Next year","Nächstes Jahr" }, | 265 | { "Next year","Nächstes Jahr" }, |
266 | { "Next Year","Nächstes Jahr" }, | 266 | { "Next Year","Nächstes Jahr" }, |
267 | { "%n h","%n Std" }, | 267 | { "%n h","%n Std" }, |
268 | { "No ending date","Kein End-Datum", }, | 268 | { "No ending date","Kein End-Datum", }, |
269 | { "No event, nothing to do.","Kein Termin, nichts zu tun.", }, | 269 | { "No event, nothing to do.","Kein Termin, nichts zu tun.", }, |
270 | { "No event selected.","Kein Termin selektiert" }, | 270 | { "No event selected.","Kein Termin selektiert" }, |
271 | { "No","Nein" }, | 271 | { "No","Nein" }, |
272 | { "No program set","Kein Programm ausgewählt", }, | 272 | { "No program set","Kein Programm ausgewählt", }, |
273 | { "Normal","Normal" }, | 273 | { "Normal","Normal" }, |
274 | { "[No selection]","Keine Selektion", }, | 274 | { "[No selection]","Keine Selektion", }, |
275 | { "No sound set","Kein Sound ausgewählt", }, | 275 | { "No sound set","Kein Sound ausgewählt", }, |
276 | { "no time ","keine Zeit ", }, | 276 | { "no time ","keine Zeit ", }, |
277 | { "no time","keine Zeit", }, | 277 | { "no time","keine Zeit", }, |
278 | { "No Time","Keine Zeit" }, | 278 | { "No Time","Keine Zeit" }, |
279 | { "November","November" }, | 279 | { "November","November" }, |
280 | { "Nov","Nov", }, | 280 | { "Nov","Nov", }, |
281 | { "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" }, | 281 | { "\nThis event recurs\nover multiple dates.\n","\nDieser Termin wiederholt sich an mehreren Tagen.\n" }, |
282 | { "occurrence(s)","Vorkommen" }, | 282 | { "occurrence(s)","Vorkommen" }, |
283 | { "October","Oktober" }, | 283 | { "October","Oktober" }, |
284 | { "Oct","Okt", }, | 284 | { "Oct","Okt", }, |
285 | { "O-due!","Ü-fällig! " }, | 285 | { "O-due!","Ü-fällig! " }, |
286 | { "&OK","&OK" }, | 286 | { "&OK","&OK" }, |
287 | { "Ok+Show!","Ok+Anzeigen" }, | 287 | { "Ok+Show!","Ok+Anzeigen" }, |
288 | { "Organizer: %1","Organisator %1" }, | 288 | { "Organizer: %1","Organisator %1" }, |
289 | { "Organizer","Organisator" }, | 289 | { "Organizer","Organisator" }, |
290 | { "Owner: ","Besitzer: " }, | 290 | { "Owner: ","Besitzer: " }, |
291 | { "Owner:","Besitzer:" }, | 291 | { "Owner:","Besitzer:" }, |
292 | { "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, | 292 | { "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, |
293 | { "Pick a date to display","Wähle einen Tag zum anzeigen aus" }, | 293 | { "Pick a date to display","Wähle einen Tag zum anzeigen aus" }, |
294 | { "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."}, | 294 | { "Please specify a valid due date.","Bitte gültiges Fälligkeitsdatum angeben."}, |
295 | { "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." }, | 295 | { "Please specify a valid end date,\nfor example '%1'.","Bitte gültiges Enddatum angeben,\nz.B.'%1'." }, |
296 | { "Please specify a valid start date.","Bitte gültiges Startdatum angeben." }, | 296 | { "Please specify a valid start date.","Bitte gültiges Startdatum angeben." }, |
297 | { "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." }, | 297 | { "Please specify a valid start date,\nfor example '%1'.","Bitte gültiges Startdatum angeben,\nz.B. '%1'." }, |
298 | { "Please specify a valid start time.","Bitte gültige Startzeit angeben."}, | 298 | { "Please specify a valid start time.","Bitte gültige Startzeit angeben."}, |
299 | { "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." }, | 299 | { "Please specify a valid start time,\nfor example '%1'.","Bitte gültige Startzeit angeben,\nz.B. '%1'." }, |
300 | { "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" }, | 300 | { "Preferences - some settings need a restart (nr)","Einstellungen - teilweise Neustart erforderlich (bn)" }, |
301 | { "&Previous Day","Vorheriger Tag" }, | 301 | { "&Previous Day","Vorheriger Tag" }, |
302 | { "Previous month","Vorheriger Monat" }, | 302 | { "Previous month","Vorheriger Monat" }, |
303 | { "Previous Month","Vorheriger Monat" }, | 303 | { "Previous Month","Vorheriger Monat" }, |
304 | { "&Previous Week","Vorherige Woche" }, | 304 | { "&Previous Week","Vorherige Woche" }, |
305 | { "Previous year","Vorheriges Jahr" }, | 305 | { "Previous year","Vorheriges Jahr" }, |
306 | { "Previous Year","Vorheriges Jahr" }, | 306 | { "Previous Year","Vorheriges Jahr" }, |
307 | { "Printing","Drucken" }, | 307 | { "Printing","Drucken" }, |
308 | { "Priority:","Priorität:" }, | 308 | { "Priority:","Priorität:" }, |
309 | { "Private","Privat" }, | 309 | { "Private","Privat" }, |
310 | { "Proceed","Weiter" }, | 310 | { "Proceed","Weiter" }, |
311 | { "Public","Öffentlich" }, | 311 | { "Public","Öffentlich" }, |
312 | { "Purge","Entferne" }, | 312 | { "Purge","Entferne" }, |
313 | { "Purge Completed","Entferne erledigte ToDos" }, | 313 | { "Purge Completed","Entferne erledigte ToDos" }, |
314 | { "Purge To-Dos","Todos bereinigen" }, | 314 | { "Purge To-Dos","Todos bereinigen" }, |
315 | { "read-only","schreibgeschützt" }, | 315 | { "read-only","schreibgeschützt" }, |
316 | { "Recur every","Wiederh. alle" }, | 316 | { "Recur every","Wiederh. alle" }, |
317 | { "Recur in the month of","Wiederh. im Monat" }, | 317 | { "Recur in the month of","Wiederh. im Monat" }, |
318 | { "Recur on the","Wiederh. am" }, | 318 | { "Recur on the","Wiederh. am" }, |
319 | { "Recur on this day","Wiederh. am diesen Tag" }, | 319 | { "Recur on this day","Wiederh. am diesen Tag" }, |
320 | { "Recurrence Range...","Wiederholungs Zeitraum..." }, | 320 | { "Recurrence Range...","Wiederholungs Zeitraum..." }, |
321 | { "Recurrence Range","Wiederholungs Zeitraum" }, | 321 | { "Recurrence Range","Wiederholungs Zeitraum" }, |
322 | { "Recurrence Rule","Wiederholungs Regel" }, | 322 | { "Recurrence Rule","Wiederholungs Regel" }, |
323 | { "Recurrence","Wiederholung" }, | 323 | { "Recurrence","Wiederholung" }, |
324 | { "Recurs","Wiederholung" }, | 324 | { "Recurs","Wiederholung" }, |
325 | {"&Reject","Abweisen"}, | 325 | {"&Reject","Abweisen"}, |
326 | { "Reminder:","Alarm:" }, | 326 | { "Reminder:","Alarm:" }, |
327 | { "Rem.:","Alarm:" }, | 327 | { "Rem.:","Alarm:" }, |
328 | { "Rem.","Alarm:" }, | 328 | { "Rem.","Alarm:" }, |
329 | { "Remote file:","Remote Datei:"}, | 329 | { "Remote file:","Remote Datei:"}, |
330 | { "Remote IP:","Remote (ferne) IP:" }, | 330 | { "Remote IP:","Remote (ferne) IP:" }, |
331 | { "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " }, | 331 | { "Remote syncing (via ssh/scp) network settings ","Remote Sync (via ssh/scp) Netzwerk Einstellungen " }, |
332 | { "Remote user:","Remote Benutzer"}, | 332 | { "Remote user:","Remote Benutzer"}, |
333 | { "&Remove","Entfe&rnen" }, | 333 | { "&Remove","Entfe&rnen" }, |
334 | { "Remove","Entfernen" }, | 334 | { "Remove","Entfernen" }, |
335 | { "Request response","Bemerkung anfordern" }, | 335 | { "Request response","Bemerkung anfordern" }, |
336 | { "Role:","Rolle:" }, | 336 | { "Role:","Rolle:" }, |
337 | { "Role","Rolle" }, | 337 | { "Role","Rolle" }, |
338 | { "Sat","Sa" }, | 338 | { "Sat","Sa" }, |
339 | { "Saturday","Samstag" }, | 339 | { "Saturday","Samstag" }, |
340 | { "Search for:","Suche nach:" }, | 340 | { "Search for:","Suche nach:" }, |
341 | { "Search In","Suche in" }, | 341 | { "Search In","Suche in" }, |
342 | { "Search...","Suche..." }, | 342 | { "Search...","Suche..." }, |
343 | { "Search","Suche" }, | 343 | { "Search","Suche" }, |
344 | { "Select Addresses","Wähle Adressen" }, | 344 | { "Select Addresses","Wähle Adressen" }, |
345 | { "Select all","Selektiere Alle" }, | 345 | { "Select all","Selektiere Alle" }, |
346 | { "Select a month","Wähle Monat" }, | 346 | { "Select a month","Wähle Monat" }, |
347 | { "Select a week","Wähle Woche" }, | 347 | { "Select a week","Wähle Woche" }, |
348 | { "Select a year","Wähle Jahr" }, | 348 | { "Select a year","Wähle Jahr" }, |
349 | { "Send directly","Sende direkt" }, | 349 | { "Send directly","Sende direkt" }, |
350 | { "&Send Messages","&Sende Nachrichten", }, | 350 | { "&Send Messages","&Sende Nachrichten", }, |
351 | { "Sep","Sep" }, | 351 | { "Sep","Sep" }, |
352 | { "September","September" }, | 352 | { "September","September" }, |
353 | { "Shopping","Einkaufen" }, | 353 | { "Shopping","Einkaufen" }, |
354 | { "Use short date in (WN/E) view","Kurzdatum in (WN/Termin) Ansicht" }, | 354 | { "Use short date in (WN/E) view","Kurzdatum in (WN/Termin) Ansicht" }, |
355 | { "Show Dates","Zeige Daten" }, | 355 | { "Show Dates","Zeige Daten" }, |
356 | { "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." }, | 356 | { "Show events that recur daily in date nav.","Zeige tägl.wiederh.Term.in Datums Nav." }, |
357 | { "Show Event...","Zeige Termin..." }, | 357 | { "Show Event...","Zeige Termin..." }, |
358 | { "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." }, | 358 | { "Show ev. that recur weekly in date nav.","Zeige wöch.wiederh.Term.in Datums Nav." }, |
359 | { "Show Marcus Bains line","Zeige Marcus Bains Linie" }, | 359 | { "Show Marcus Bains line","Zeige Marcus Bains Linie" }, |
360 | { "Show summary after syncing","Zeige Zusammenfassung nach Sync." }, | 360 | { "Show summary after syncing","Zeige Zusammenfassung nach Sync." }, |
361 | { "Show time as:","Zeige Zeit als" }, | 361 | { "Show time as:","Zeige Zeit als" }, |
362 | { "Show Todo...","Zeige To-Do" }, | 362 | { "Show Todo...","Zeige To-Do" }, |
363 | { "Show topmost todo prios in What's N.:","Anz. höchster Prios in What's N.:"}, | 363 | { "Show topmost todo prios in What's N.:","Anz. höchster Prios in What's N.:"}, |
364 | { "Show topmost todo prios in What's Next:","Anz. höchster Prios in What's Next:"}, | 364 | { "Show topmost todo prios in What's Next:","Anz. höchster Prios in What's Next:"}, |
365 | { "Show vertical screen (Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, | 365 | { "Show vertical screen (Needs restart)","Vertikaler Bildschirm-Layout (Neustart!)" }, |
366 | { "&Show","Zeige" }, | 366 | { "&Show","Zeige" }, |
367 | { "Show...","Zeige..." }, | 367 | { "Show...","Zeige..." }, |
368 | { "Show","Zeige" }, | 368 | { "Show","Zeige" }, |
369 | { "Small","Klein" }, | 369 | { "Small","Klein" }, |
370 | { "Sorry","Entschuldigung" }, | 370 | { "Sorry","Entschuldigung" }, |
371 | {"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, | 371 | {"Sorry, the copy command failed!\nCommand was:\n","Der Kopierbefehl schlug fehl!\nBefehl war:\n"}, |
372 | { "Start:","Start:" }, | 372 | { "Start:","Start:" }, |
373 | { "Start Date","Start Datum" }, | 373 | { "Start Date","Start Datum" }, |
374 | { "Start date: %1","Start Datum: %1" }, | 374 | { "Start date: %1","Start Datum: %1" }, |
375 | { "Start Time","Start Zeit" }, | 375 | { "Start Time","Start Zeit" }, |
376 | { "Status:","Status:" }, | 376 | { "Status:","Status:" }, |
377 | { "Status","Status:" }, | 377 | { "Status","Status:" }, |
378 | { "Summaries","Titel" }, | 378 | { "Summaries","Titel" }, |
379 | { "Summary:","Titel:" }, | 379 | { "Summary:","Titel:" }, |
380 | { "Summary","Titel" }, | 380 | { "Summary","Titel" }, |
381 | { "Sunday","Sonntag" }, | 381 | { "Sunday","Sonntag" }, |
382 | { "Sun","So" }, | 382 | { "Sun","So" }, |
383 | { "Sync preferences:","Sync Einstellungen" }, | 383 | { "Sync preferences:","Sync Einstellungen" }, |
384 | { "Sync Prefs","Sync Einstellungen" }, | 384 | { "Sync Prefs","Sync Einstellungen" }, |
385 | { "Syncronize","Daten abgleich" }, | 385 | { "Syncronize","Daten abgleich" }, |
386 | { "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, | 386 | { "Take local entry on conflict","Nimm lokalen Eintrag beim Konflikt" }, |
387 | { "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, | 387 | { "Take newest entry on conflict","Nimm neuesten Eintrag beim Konflikt" }, |
388 | { "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" }, | 388 | { "Take remote entry on conflict","Nimm fernen Eintrag beim Konflikt" }, |
389 | { "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges To-Do" }, | 389 | { "Template '%1' does not contain a valid Todo.","Template '%1' enthält kein gültiges To-Do" }, |
390 | { "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" }, | 390 | { "Template does not contain a valid Event.","Template '%1' enthält keinen gültigen Termin" }, |
391 | { "Template...","Vorlage..." }, | 391 | { "Template...","Vorlage..." }, |
392 | { "This day","Dieser Tag" }, | 392 | { "This day","Dieser Tag" }, |
393 | { "This is an experimental feature. ","Dieses Feature ist experimentel" }, | 393 | { "This is an experimental feature. ","Dieses Feature ist experimentel" }, |
394 | { "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." }, | 394 | { "This item will be\npermanently deleted.","Dieser Eintrag wird\nkomplett gelöscht." }, |
395 | { "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." }, | 395 | { "This item will be permanently deleted.", "Dieser Eintrag wird komplett gelöscht." }, |
396 | { "Thu","Do" }, | 396 | { "Thu","Do" }, |
397 | { "Thursday","Donnerstag" }, | 397 | { "Thursday","Donnerstag" }, |
398 | { "Time associated","Mit Zeit" }, | 398 | { "Time associated","Mit Zeit" }, |
399 | { "Time bar:","Uhrzeit Zeile:" }, | 399 | { "Time bar:","Uhrzeit Zeile:" }, |
400 | { "Time && Date","Zeit und Datum" }, | 400 | { "Time && Date","Zeit und Datum" }, |
401 | { "Time Format","Zeit Format" }, | 401 | { "Time Format","Zeit Format" }, |
402 | { "Time Format(nr):","Zeit Format(Neustart!)" }, | 402 | { "Time Format(nr):","Zeit Format(Neustart!)" }, |
403 | { "Date Labels:","Datumsleiste:" }, | 403 | { "Date Labels:","Datumsleiste:" }, |
404 | { "Time: ","Zeit: " }, | 404 | { "Time: ","Zeit: " }, |
405 | { "Timezone:","Zeitzone:" }, | 405 | { "Timezone:","Zeitzone:" }, |
406 | { "To: ","Bis: " }, | 406 | { "To: ","Bis: " }, |
407 | { "To:","Bis:" }, | 407 | { "To:","Bis:" }, |
408 | { "Today: ","Heute: " }, | 408 | { "Today: ","Heute: " }, |
409 | { "Todo due today color:","Heute fällige To-Do's" }, | 409 | { "Todo due today color:","Heute fällige To-Do's" }, |
410 | { "To-do items:","To-Do items:" }, | 410 | { "To-do items:","To-Do items:" }, |
411 | { "Todo overdue color:","Überfällige To-Do's" }, | 411 | { "Todo overdue color:","Überfällige To-Do's" }, |
412 | { "Todo","Todo" }, | 412 | { "Todo","Todo" }, |
413 | { "To-do view shows completed Todos","To-do Ansicht zeigt erledigte To-dos" }, | 413 | { "To-do view shows completed Todos","To-do Ansicht zeigt erledigte To-dos" }, |
414 | { "ToDoView:","Todo Ansicht:" }, | 414 | { "ToDoView:","Todo Ansicht:" }, |
415 | { "Toggle Alarm","Wechsle Alarm" }, | 415 | { "Toggle Alarm","Wechsle Alarm" }, |
416 | { "Toggle Allday","Umschalten Ganztag" }, | 416 | { "Toggle Allday","Umschalten Ganztag" }, |
417 | { "Tomorrow: ","Morgen: " }, | 417 | { "Tomorrow: ","Morgen: " }, |
418 | { "Tue","Di" }, | 418 | { "Tue","Di" }, |
419 | { "Tuesday","Dienstag" }, | 419 | { "Tuesday","Dienstag" }, |
420 | { "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" }, | 420 | { "Two entries are in conflict, if: ","Zwei Einträge haben einen Konflikt, wenn:" }, |
421 | { "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." }, | 421 | { "Unable to find template '%1'.","Kann Vorlage '%1' nicht finden." }, |
422 | { "Unknown","Unbekannt" }, | 422 | { "Unknown","Unbekannt" }, |
423 | { "Up","Hinauf" }, | 423 | { "Up","Hinauf" }, |
424 | { "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" }, | 424 | { "Use password (if not, ask when syncing)","Passwort: (sonst jedesmal anfragen)" }, |
425 | { "User defined","Benutzerdefiniert" }, | 425 | { "User defined","Benutzerdefiniert" }, |
426 | { "User long date:","Format langes Datum:" }, | 426 | { "User long date:","Format langes Datum:" }, |
427 | { "User short date:","Forma kurzes Datum:" }, | 427 | { "User short date:","Forma kurzes Datum:" }, |
428 | { "View","Ansicht" }, | 428 | { "View","Ansicht" }, |
429 | { "View Fonts","Schriftarten Ansichten" }, | 429 | { "View Fonts","Schriftarten Ansichten" }, |
430 | { "Views","Ansichten" }, | 430 | { "Views","Ansichten" }, |
431 | { "Wed","Mi" }, | 431 | { "Wed","Mi" }, |
432 | { "Wednesday","Mittwoch" }, | 432 | { "Wednesday","Mittwoch" }, |
433 | { "Week %1","Woche %1" }, | 433 | { "Week %1","Woche %1" }, |
434 | { "Weekly","Wöchentlich" }, | 434 | { "Weekly","Wöchentlich" }, |
435 | { "Week starts on Sunday","Woche beginnt Sonntags" }, | 435 | { "Week starts on Sunday","Woche beginnt Sonntags" }, |
436 | { "What's Next View:","What's Next Anz." }, | 436 | { "What's Next View:","What's Next Anz." }, |
437 | { "What's next ?","Was kommt als nächstes?(What's Next)" }, | 437 | { "What's next ?","Was kommt als nächstes?(What's Next)" }, |
438 | { "Working Hours","Tägliche Arbeitszeit" }, | 438 | { "Working Hours","Tägliche Arbeitszeit" }, |
439 | { "Working hours color:","Arbeitszeit in der Agenda Ansicht:" }, | 439 | { "Working hours color:","Arbeitszeit in der Agenda Ansicht:" }, |
440 | { "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" }, | 440 | { "Write back existing entries only","Nur exisitierende Einträge zurückschreiben" }, |
441 | { "Write back synced file","Syncronisierte Datei zurückschreiben" }, | 441 | { "Write back synced file","Syncronisierte Datei zurückschreiben" }, |
442 | { "Yearly","Jährlich" }, | 442 | { "Yearly","Jährlich" }, |
443 | { "year(s)","Jahr(e)" }, | 443 | { "year(s)","Jahr(e)" }, |
444 | { "Yes","Ja" }, | 444 | { "Yes","Ja" }, |
445 | { "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" }, | 445 | { "You have %d item(s) selected.\n","Sie haben %d Einträge ausgewählt.\n" }, |
446 | { "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." }, | 446 | { "You have to restart KOrganizer for this setting to take effect.","Sie müssem Korganizer neu starten, damit diese Einstellung aktiviert wird." }, |
447 | { "week(s) on:","Woche(n) am: " }, | 447 | { "week(s) on:","Woche(n) am: " }, |
448 | { "Full menu bar(nr)","Volle Menuleiste(bn)" }, | 448 | { "Full menu bar(nr)","Volle Menuleiste(bn)" }, |
449 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, | 449 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, |
450 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, | 450 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, |
451 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, | 451 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, |
452 | { "Daylight start:","Sommerzeit Beginn:" }, | 452 | { "Daylight start:","Sommerzeit Beginn:" }, |
453 | { "Daylight end:","Sommerzeit Ende:" }, | 453 | { "Daylight end:","Sommerzeit Ende:" }, |
454 | { "Time Zone","Zeitzone" }, | 454 | { "Time Zone","Zeitzone" }, |
455 | { "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, | 455 | { "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, |
456 | { "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" }, | 456 | { "%A: Monday --- %a: Mon","%A: Montag --- %a: Mon" }, |
457 | { "minutely","minütlich" }, | 457 | { "minutely","minütlich" }, |
458 | { "hourly","stündlich" }, | 458 | { "hourly","stündlich" }, |
459 | { "daily","täglich" }, | 459 | { "daily","täglich" }, |
460 | { "weekly","wöchentlich" }, | 460 | { "weekly","wöchentlich" }, |
461 | { "monthly","monatlich" }, | 461 | { "monthly","monatlich" }, |
462 | { "day-monthly","tag-monatlich" }, | 462 | { "day-monthly","tag-monatlich" }, |
463 | { "month-yearly","monat-jährlich" }, | 463 | { "month-yearly","monat-jährlich" }, |
464 | { "day-yearly","tag-jährlich" }, | 464 | { "day-yearly","tag-jährlich" }, |
465 | { "position-yearly","pos-jährlich" }, | 465 | { "position-yearly","pos-jährlich" }, |
466 | { "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" }, | 466 | { "Edit item on doubleclick (if not, show)","Editiere mit Doppelklick(wenn nicht, zeige)" }, |
467 | { "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" }, | 467 | { "Highlight current day in agenda","Hebe >>heute<< in Agenda hervor" }, |
468 | { "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" }, | 468 | { "Use light color for highlight current day","Helle Farbe für >>heute<< Hervorhebung" }, |
469 | { "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" }, | 469 | { "Highlight selection in Time Edit","Hebe Auswahl in Zeit Edit hervor" }, |
470 | { "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" }, | 470 | { "Hold fullscreen on view change","Behalte Vollbild bei Ansichswechsel" }, |
471 | { "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." }, | 471 | { "Hold non-fullscreen on view change","Behalte Nicht-Vollbild bei Ansichtsw." }, |
472 | { "Event list view uses full window","Listenansicht nutzt Vollbild" }, | 472 | { "Event list view uses full window","Listenansicht nutzt Vollbild" }, |
473 | { "Set agenda to DayBeginsAt on change","Setze Agenda auf TagBeginntUm bei Wechsel" }, | 473 | { "Set agenda to DayBeginsAt on change","Setze Agenda auf TagBeginntUm bei Wechsel" }, |
474 | { "Set agenda to current time on change","Setze Agenda auf gegenw.Zeit bei Wechsel" }, | 474 | { "Set agenda to current time on change","Setze Agenda auf gegenw.Zeit bei Wechsel" }, |
475 | { "Listview uses monthly timespan","Listenansicht zeigt monatliche Zeitspanne" }, | 475 | { "Listview uses monthly timespan","Listenansicht zeigt monatliche Zeitspanne" }, |
476 | { "ViewChange","Ansichtswechsel" }, | 476 | { "ViewChange","Ansichtswechsel" }, |
477 | { "Default alarm *.wav file:","Standard Alarm *.wav Datei:" }, | 477 | { "Default alarm *.wav file:","Standard Alarm *.wav Datei:" }, |
478 | { "This setting is useless for 5500 user!","Diese Einst. ist nutzlos für 5500 Nutzer" }, | 478 | { "This setting is useless for 5500 user!","Diese Einst. ist nutzlos für 5500 Nutzer" }, |
479 | { "File","Datei" }, | 479 | { "File","Datei" }, |
480 | { "Clone...","Dupliziere.." }, | 480 | { "Clone...","Dupliziere.." }, |
481 | { "Move...","Bewege..." }, | 481 | { "Move...","Bewege..." }, |
482 | { "Beam...","Sende via IR..." }, | 482 | { "Beam...","Sende via IR..." }, |
483 | { "&Clone...","Dupliziere.." }, | 483 | { "&Clone...","Dupliziere.." }, |
484 | { "&Move...","Bewege..." }, | 484 | { "&Move...","Bewege..." }, |
485 | { "&Beam...","Sende via IR..." }, | 485 | { "&Beam...","Sende via IR..." }, |
486 | { "Show Completed","Zeige erledigte Todos" }, | 486 | { "Show Completed","Zeige erledigte Todos" }, |
487 | { "Show Quick Todo","Zeige Quick Todo" }, | 487 | { "Show Quick Todo","Zeige Quick Todo" }, |
488 | { "Unparent Todo","Un-sub Todo" }, | 488 | { "Unparent Todo","Un-sub Todo" }, |
489 | { "Save selected to file...","Speichere Selektierte..." }, | 489 | { "Save selected to file...","Speichere Selektierte..." }, |
490 | { "Add Categ. to selected...","Füge zu Selekt. Kateg. hinzu..." }, | 490 | { "Add Categ. to selected...","Füge zu Selekt. Kateg. hinzu..." }, |
491 | { "Set Categ. for selected...","Setze Kateg. für Selekt." }, | 491 | { "Set Categ. for selected...","Setze Kateg. für Selekt." }, |
492 | { "Beam selected via IR","Sende Selekt. via IR..." }, | 492 | { "Beam selected via IR","Sende Selekt. via IR..." }, |
493 | { "Search","Suchen" }, | 493 | { "Search","Suchen" }, |
494 | { "Date Picker","Datum auswählen" }, | 494 | { "Date Picker","Datum auswählen" }, |
495 | { "Day View","Tagesansicht" }, | 495 | { "Day View","Tagesansicht" }, |
496 | { "Work Week","Arbeitswoche" }, | 496 | { "Work Week","Arbeitswoche" }, |
497 | { "Week","Wochenansicht" }, | 497 | { "Week","Wochenansicht" }, |
498 | { "Month","Monatsansicht" }, | 498 | { "Month","Monatsansicht" }, |
499 | { "Todo View","Todo Liste" }, | 499 | { "Todo View","Todo Liste" }, |
500 | { "Journal","Journal Ansicht" }, | 500 | { "Journal","Journal Ansicht" }, |
501 | { "Next days","Nächste Tage" }, | 501 | { "Next days","Nächste Tage" }, |
502 | { "Print agenda selection...","Drucke Agendaselektion..." }, | 502 | { "Print agenda selection...","Drucke Agendaselektion..." }, |
503 | { "Toggle DateNavigator","Navigator umschalten" }, | 503 | { "Toggle DateNavigator","Navigator umschalten" }, |
504 | { "Toggle FilterView","Filteransicht umschalten" }, | 504 | { "Toggle FilterView","Filteransicht umschalten" }, |
505 | { "Prev. month","Vorheriger Monat" }, | 505 | { "Prev. month","Vorheriger Monat" }, |
506 | { "Go backward","Gehe zurück" }, | 506 | { "Go backward","Gehe zurück" }, |
507 | { "Go forward","Gehe weiter" }, | 507 | { "Go forward","Gehe weiter" }, |
508 | { "Synchronize","Synchronisieren" }, | 508 | { "Synchronize","Synchronisieren" }, |
509 | { "AgendaSize","Agendagröße" }, | 509 | { "AgendaSize","Agendagröße" }, |
510 | { "Import (*.ics/*.vcs) file","Importiere (*.ics/*.vcs) Datei" }, | 510 | { "Import (*.ics/*.vcs) file","Importiere (*.ics/*.vcs) Datei" }, |
511 | { "Import last file","Importiere letzte Datei" }, | 511 | { "Import last file","Importiere letzte Datei" }, |
512 | { "Import Opie/Qtopia Cal.","Importiere Opie/Qtopia Kal." }, | 512 | { "Import Opie/Qtopia Cal.","Importiere Opie/Qtopia Kal." }, |
513 | { "Load Calendar Backup","Lade Kalender Backup" }, | 513 | { "Load Calendar Backup","Lade Kalender Backup" }, |
514 | { "Save Calendar Backup","Speichere Kalender Backup" }, | 514 | { "Save Calendar Backup","Speichere Kalender Backup" }, |
515 | { "Export VCalendar","Exportiere VCalendar" }, | 515 | { "Export VCalendar","Exportiere VCalendar" }, |
516 | { "Manage new categories...","Verwalte neue Kategorien..." }, | 516 | { "Manage new categories...","Verwalte neue Kategorien..." }, |
517 | { "Beam complete calendar...","Sende kompletten Kalender via IR" }, | 517 | { "Beam complete calendar...","Sende kompletten Kalender via IR" }, |
518 | { "Beam filtered calendar...","Sende gefilterten Kalender via IR" }, | 518 | { "Beam filtered calendar...","Sende gefilterten Kalender via IR" }, |
519 | { "Remote via ssh","Über Netzwerk via ssh" }, | 519 | { "Remote via ssh","Über Netzwerk via ssh" }, |
520 | { "With local file","Mit lokaler Datei" }, | 520 | { "With local file","Mit lokaler Datei" }, |
521 | { "With last file","Mit letzter Datei" }, | 521 | { "With last file","Mit letzter Datei" }, |
522 | { "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" }, | 522 | { "KO/Pi: Ready for beaming","KO/Pi: Bereit zum Senden" }, |
523 | { "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" }, | 523 | { "KO/Pi:Beaming done","KO/Pi: Senden erfolgt" }, |
524 | { "Save filename","Speichern: Dateinamen wählen" }, | 524 | { "Save filename","Speichern: Dateinamen wählen" }, |
525 | { "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" }, | 525 | { "File already exists!\nOld file from:\n%1\nOverwrite?\n","Dateiname existiert bereits!\nAlte Datei vom:\n%1\nÜberschreiben?\n" }, |
526 | { "KO/Pi: Warning!","KO/Pi: Warnung!" }, | 526 | { "KO/Pi: Warning!","KO/Pi: Warnung!" }, |
527 | { "Overwrite!","Überschreibe!" }, | 527 | { "Overwrite!","Überschreibe!" }, |
528 | { "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, | 528 | { "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, |
529 | { "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" }, | 529 | { "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" }, |
530 | { "KO/Pi Confirmation","KO/Pi Bestätigung" }, | 530 | { "KO/Pi Confirmation","KO/Pi Bestätigung" }, |
531 | { "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" }, | 531 | { "Close dialog to abort deletion!","Schließe Dialog um das Löschen abzubrechen!" }, |
532 | { "Deleting item %d ...","Lösche Eintrag %d ..." }, | 532 | { "Deleting item %d ...","Lösche Eintrag %d ..." }, |
533 | { "%d items remaining in list.","%d Einträge sind in der Liste verblieben." }, | 533 | { "%d items remaining in list.","%d Einträge sind in der Liste verblieben." }, |
534 | { "Size","Größe" }, | 534 | { "Size","Größe" }, |
535 | { "Date","Datum" }, | 535 | { "Date","Datum" }, |
536 | { "Mime Type","Datei Typ" }, | 536 | { "Mime Type","Datei Typ" }, |
537 | { "All Files","Alle Dateien" }, | 537 | { "All Files","Alle Dateien" }, |
538 | { "Files","Dateien" }, | 538 | { "Files","Dateien" }, |
539 | { "Documents","DoKumente" }, | 539 | { "Documents","DoKumente" }, |
540 | { "Select Categories","Selektiere Kategorien" }, | 540 | { "Select Categories","Selektiere Kategorien" }, |
541 | { " &Deselect All "," Auswahl aufheben " }, | 541 | { " &Deselect All "," Auswahl aufheben " }, |
542 | { "A&dd","Hinzu" }, | 542 | { "A&dd","Hinzu" }, |
543 | { "&Modify","Ändern" }, | 543 | { "&Modify","Ändern" }, |
544 | { "Edit Categories","Editiere Kategorien" }, | 544 | { "Edit Categories","Editiere Kategorien" }, |
545 | { " &Edit Categories "," &Editiere Kategorien " }, | 545 | { " &Edit Categories "," &Editiere Kategorien " }, |
546 | { "Beam Options","Beam Einstellungen" }, | 546 | { "Beam Options","Beam Einstellungen" }, |
547 | { " With timezone "," Mit Zeitzone " }, | 547 | { " With timezone "," Mit Zeitzone " }, |
548 | { " Local time ", " Lokale Zeit " }, | 548 | { " Local time ", " Lokale Zeit " }, |
549 | { "Manage new Categories","Verwalte neue Kategorien" }, | 549 | { "Manage new Categories","Verwalte neue Kategorien" }, |
550 | { "Add to category list","Füge zur Kategorieliste hinzu" }, | 550 | { "Add to category list","Füge zur Kategorieliste hinzu" }, |
551 | { "Remove from Events/Todos","Entferne von Terminen/Todos" }, | 551 | { "Remove from Events/Todos","Entferne von Terminen/Todos" }, |
552 | { "After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nTerminen oder Todos geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, | 552 | { "After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n ","Nach dem Importieren/Laden/Syncen\nkann es neue Kategorien in den \nTerminen oder Todos geben, die nicht\nin der Kategorieliste enthalten sind.\nBitte wählen Sie, was passieren soll:\n " }, |
553 | { "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, | 553 | { "New categories not in list:","Kategorien, die nicht in der Liste sind:" }, |
554 | { "File format","Datei Format" }, | 554 | { "File format","Datei Format" }, |
555 | { "Time format","Zeit Format" }, | 555 | { "Time format","Zeit Format" }, |
556 | { "Delete all\ncompleted To-Dos?","Lösche alle\nerledigten To-Dos?" }, | 556 | { "Delete all\ncompleted To-Dos?","Lösche alle\nerledigten To-Dos?" }, |
557 | { "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." }, | 557 | { "KO/Pi:Saving Data to File ...","KO/Pi: Speichere Kalender in Datei ..." }, |
558 | { "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" }, | 558 | { "KO/Pi:File Saved. Needed %d sec, %d ms","KO/Pi: Abgespeichert in %d sec, %d ms" }, |
559 | { "h","Std" }, | 559 | { "h","Std" }, |
560 | { "min","Min" }, | 560 | { "min","Min" }, |
561 | { "hou","Std" }, | 561 | { "hou","Std" }, |
562 | { "day","Tag" }, | 562 | { "day","Tag" }, |
563 | { "French","Französich" }, | 563 | { "French","Französich" }, |
564 | { "Time","Zeit" }, | 564 | { "Time","Zeit" }, |
565 | { "Event Viewer","Termin Ansicht" }, | 565 | { "Event Viewer","Termin Ansicht" }, |
566 | { "Cancel Sync","Sync Abbrechen" }, | 566 | { "Cancel Sync","Sync Abbrechen" }, |
567 | { "Remote","Fern" }, | 567 | { "Remote","Fern" }, |
568 | { "Local","Lokal" }, | 568 | { "Local","Lokal" }, |
569 | { "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" }, | 569 | { "Conflict! Please choose entry","Konflikt! Bitte Eintrag wählen" }, |
570 | { "Local: ","Lokal: " }, | 570 | { "Local: ","Lokal: " }, |
571 | { "Remote: ","Fern: " }, | 571 | { "Remote: ","Fern: " }, |
572 | { "Last modified: ","Zuletzt geändert: " }, | 572 | { "Last modified: ","Zuletzt geändert: " }, |
573 | { "Location: ","Ort: " }, | 573 | { "Location: ","Ort: " }, |
574 | { "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" }, | 574 | { "<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>","<p><b>Von:</b> %1 </p><p><b>Bis:</b> %2</p>" }, |
575 | { "<p><b>On:</b> %1</p>","<p><b>Am:</b> %1</p>" }, | 575 | { "<p><b>On:</b> %1</p>","<p><b>Am:</b> %1</p>" }, |
576 | { "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " }, | 576 | { "<p><b>From:</b> %1</p> ","<p><b>Von:</b> %1</p> " }, |
577 | { "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" }, | 577 | { "<p><b>To:</b> %1</p>","<p><b>Bis:</b> %1</p>" }, |
578 | { "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " }, | 578 | { "<p><b>On:</b> %1</p> ","<p><b>Am:</b> %1</p> " }, |
579 | { "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" }, | 579 | { "<p><b>From:</b> %1 <b>To:</b> %2</p>","<p><b>Von:</b> %1 <b>Bis:</b> %2</p>" }, |
580 | { "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." }, | 580 | { "This is a %1 recurring event.","Das ist ein %1 wiederholender Termin." }, |
581 | { "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" }, | 581 | { "<b>Next recurrence is on:</b>","<b>Nächste Wiederholung ist am:</b>" }, |
582 | { "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" }, | 582 | { "<b>Last recurrence was on:</b>","<b>Letzte Wiederholung war am:</b>" }, |
583 | { "( %1 min before )","( %1 min vorher )" }, | 583 | { "( %1 min before )","( %1 min vorher )" }, |
584 | { "<b>Alarm on: ","<b>Alarm am: " }, | 584 | { "<b>Alarm on: ","<b>Alarm am: " }, |
585 | { "<b>Details: </b>","<b>Details: </b>" }, | 585 | { "<b>Details: </b>","<b>Details: </b>" }, |
586 | { "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, | 586 | { "<p><b>Priority:</b> %2</p>","<p><b>Priorität:</b> %2</p>" }, |
587 | { "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" }, | 587 | { "<p><i>%1 % completed</i></p>","<p><i>%1 % erledigt</i></p>" }, |
588 | { "Organizer","Organisator" }, | 588 | { "Organizer","Organisator" }, |
589 | { "Save","Speichern" }, | 589 | { "Save","Speichern" }, |
590 | { "Exit (+save)","Beenden (+ speichern)" }, | 590 | { "Exit (+save)","Beenden (+ speichern)" }, |
591 | { "Home","Zuhause" }, | 591 | { "Home","Zuhause" }, |
592 | { "Office","Büro" }, | 592 | { "Office","Büro" }, |
593 | { "Libary","Bücherei" }, | 593 | { "Libary","Bücherei" }, |
594 | { "Doctor","Arzt" }, | 594 | { "Doctor","Arzt" }, |
595 | { "Beach","Strand" }, | 595 | { "Beach","Strand" }, |
596 | { "Conference room","Konferenzraum" }, | 596 | { "Conference room","Konferenzraum" }, |
597 | { "Drive Home","Heimfahrt" }, | 597 | { "Drive Home","Heimfahrt" }, |
598 | { "Watch TV","Tv gucken" }, | 598 | { "Watch TV","Tv gucken" }, |
599 | { "Phone call","Telefonanruf" }, | 599 | { "Phone call","Telefonanruf" }, |
600 | { "Pay bill","Rechnung bezahlen" }, | 600 | { "Pay bill","Rechnung bezahlen" }, |
601 | { "Read book","Buch lesen" }, | 601 | { "Read book","Buch lesen" }, |
602 | { "Watering plants","Pflanzen giessen" }, | 602 | { "Watering plants","Pflanzen giessen" }, |
603 | {"Appointment","Verabredung" }, | 603 | {"Appointment","Verabredung" }, |
604 | {"Birthday","Geburtstag" }, | 604 | {"Birthday","Geburtstag" }, |
605 | {"Business","Geschäft" }, | 605 | {"Business","Geschäft" }, |
606 | {"Business Travel","Geschäftsreise" }, | 606 | {"Business Travel","Geschäftsreise" }, |
607 | {"Cinema","Kino" }, | 607 | {"Cinema","Kino" }, |
608 | {"Customer","Kunde" }, | 608 | {"Customer","Kunde" }, |
609 | {"Break","Pause" }, | 609 | {"Break","Pause" }, |
610 | {"Breakfast","Frühstück" }, | 610 | {"Breakfast","Frühstück" }, |
611 | {"Competition","Wettkampf" }, | 611 | {"Competition","Wettkampf" }, |
612 | {"Dinner","Abendessen" }, | 612 | {"Dinner","Abendessen" }, |
613 | {"Education","Erziehung" }, | 613 | {"Education","Erziehung" }, |
614 | {"Family","Familie" }, | 614 | {"Family","Familie" }, |
615 | {"Favorites","Favoriten" }, | 615 | {"Favorites","Favoriten" }, |
616 | {"Festival","Festival" }, | 616 | {"Festival","Festival" }, |
617 | {"Fishing","Angeln" }, | 617 | {"Fishing","Angeln" }, |
618 | {"Flight","Flug" }, | 618 | {"Flight","Flug" }, |
619 | {"Gifts","Geschenk" }, | 619 | {"Gifts","Geschenk" }, |
620 | {"Holiday","Feiertag" }, | 620 | {"Holiday","Feiertag" }, |
621 | {"Holiday Cards","Ansichtskarten" }, | 621 | {"Holiday Cards","Ansichtskarten" }, |
622 | {"Hot Contacts","Heisse Kontakte" }, | 622 | {"Hot Contacts","Heisse Kontakte" }, |
623 | {"Hiking","Wandern" }, | 623 | {"Hiking","Wandern" }, |
624 | {"Hunting","Jagen" }, | 624 | {"Hunting","Jagen" }, |
625 | {"Key Customer","Wichtiger Kunde" }, | 625 | {"Key Customer","Wichtiger Kunde" }, |
626 | {"Kids","Kinder" }, | 626 | {"Kids","Kinder" }, |
627 | {"Lunch","Mittagessen" }, | 627 | {"Lunch","Mittagessen" }, |
628 | {"Meeting","Treffen" }, | 628 | {"Meeting","Treffen" }, |
629 | {"Miscellaneous","Verschiedenes" }, | 629 | {"Miscellaneous","Verschiedenes" }, |
630 | {"Partner","Partner" }, | 630 | {"Partner","Partner" }, |
631 | {"Party","Partie" }, | 631 | {"Party","Partie" }, |
632 | {"Personal","Privat" }, | 632 | {"Personal","Privat" }, |
633 | {"Personal Travel","Privatreise"}, | 633 | {"Personal Travel","Privatreise"}, |
634 | {"PHB","PHB" }, | 634 | {"PHB","PHB" }, |
635 | {"Phone Calls","Telefonanruf" }, | 635 | {"Phone Calls","Telefonanruf" }, |
636 | {"Projects","Projekt" }, | 636 | {"Projects","Projekt" }, |
637 | {"Recurring","Wiederholend" }, | 637 | {"Recurring","Wiederholend" }, |
638 | {"School","Schule" }, | 638 | {"School","Schule" }, |
639 | {"Shopping","Einkaufen" }, | 639 | {"Shopping","Einkaufen" }, |
640 | {"Speach","Rede" }, | 640 | {"Speach","Rede" }, |
641 | {"Special Occasion","Spez.Gelegenheit" }, | 641 | {"Special Occasion","Spez.Gelegenheit" }, |
642 | {"Sports","Sport" }, | 642 | {"Sports","Sport" }, |
643 | {"Talk","Vortrag" }, | 643 | {"Talk","Vortrag" }, |
644 | {"Travel","Reise" }, | 644 | {"Travel","Reise" }, |
645 | {"TV","TV" }, | 645 | {"TV","TV" }, |
646 | {"Germany","Deutschland" }, | 646 | {"Germany","Deutschland" }, |
647 | {"Sweden","Schweden" }, | 647 | {"Sweden","Schweden" }, |
648 | {"Forest","Wald" }, | 648 | {"Forest","Wald" }, |
649 | { "Desert","Wüste" }, | 649 | { "Desert","Wüste" }, |
650 | { "Kitchen","Küche" }, | 650 | { "Kitchen","Küche" }, |
651 | { "Lake","See" }, | 651 | { "Lake","See" }, |
652 | {"University","Universität"}, | 652 | {"University","Universität"}, |
653 | {"Vacation","Urlaub" }, | 653 | {"Vacation","Urlaub" }, |
654 | {"VIP","VIP" }, | 654 | {"VIP","VIP" }, |
655 | { "Import Sharp Calendar","Importiere Sharp Kalender" }, | 655 | { "Import Sharp Calendar","Importiere Sharp Kalender" }, |
656 | { "This todo has been cancelled!","Dieses Todo wurde gecancelt!" }, | 656 | { "This todo has been cancelled!","Dieses Todo wurde gecancelt!" }, |
657 | { "This event has been cancelled!","Dieser Termin wurde gecancelt!" }, | 657 | { "This event has been cancelled!","Dieser Termin wurde gecancelt!" }, |
658 | { "Cancelled","Gecancelt" }, | 658 | { "Cancelled","Gecancelt" }, |
659 | { "Multiple sync","Mehrfach Sync" }, | 659 | { "Multiple sync","Mehrfach Sync" }, |
660 | { "Local file","Lokale Datei" }, | 660 | { "Local file","Lokale Datei" }, |
661 | { "Last file","Letzte Datei" }, | 661 | { "Last file","Letzte Datei" }, |
662 | { "Keys + Colors...","Tasten + Farben..." }, | 662 | { "Keys + Colors...","Tasten + Farben..." }, |
663 | { "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" }, | 663 | { "Mini icons in toolbar(nr)","Mini Icons in ToolBar(bn)" }, |
664 | { "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" }, | 664 | { "Quick load/save (w/o Unicode)","Schnelles Laden/Speichern (o Unicode)" }, |
665 | { "Choose...","Wähle..." }, | 665 | { "Choose...","Wähle..." }, |
666 | { "Use colors for application:","Setze Farben für Programm:" }, | 666 | { "Use colors for application:","Setze Farben für Programm:" }, |
667 | { "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" }, | 667 | { "Buttons, menus, etc.:","Knöpfe, Menu, etc.:" }, |
668 | { "Frames, labels, etc.:","Rahmen, Label, etc.:" }, | 668 | { "Frames, labels, etc.:","Rahmen, Label, etc.:" }, |
669 | { "Show parent To-Do's in What's Next view","Zeige Ober-Todo in What's Next Anz." }, | 669 | { "Show parent To-Do's in What's Next view","Zeige Ober-Todo in What's Next Anz." }, |
670 | { "Show location in What's Next view","Zeige Ort in What's Next Anz." }, | 670 | { "Show location in What's Next view","Zeige Ort in What's Next Anz." }, |
671 | { "Show events that recur ","Zeige Termine, die sich wiederholen:" }, | 671 | { "Show events that recur ","Zeige Termine, die sich wiederholen:" }, |
672 | { "Show in every cell ","Zeige in jeder Zelle " }, | 672 | { "Show in every cell ","Zeige in jeder Zelle " }, |
673 | { "short month","kurzen Monat" }, | 673 | { "short month","kurzen Monat" }, |
674 | { "icons","Icons" }, | 674 | { "icons","Icons" }, |
675 | { "Show Sat/Sun together","Zeige Sam/Son zusammen" }, | 675 | { "Show Sat/Sun together","Zeige Sam/Son zusammen" }, |
676 | { "Categorie colors are applied to text","Kategorie Farben färben Text" }, | 676 | { "Categorie colors are applied to text","Kategorie Farben färben Text" }, |
677 | { "Month view uses day colors","Monatsansicht zeigt Tagesfarben" }, | 677 | { "Month view uses day colors","Monatsansicht zeigt Tagesfarben" }, |
678 | { "Day color odd months","Tagesfarbe ungerade Monate" }, | 678 | { "Day color odd months","Tagesfarbe ungerade Monate" }, |
679 | { "Day color even months","Tagesfarbe gerade Monate" }, | 679 | { "Day color even months","Tagesfarbe gerade Monate" }, |
680 | { "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" }, | 680 | { "Color for Sundays + category \"Holiday\"","Farbe für Sonntag + Kateg.\" Feiertag\"" }, |
681 | { "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" }, | 681 | { "To-do view shows complete as 'xx %'","Zeige Prozent erledigt als 'xx %'" }, |
682 | { "Small To-do view uses smaller font","Kleine To-do Ansicht nutzt kleineren Font" }, | 682 | { "Small To-do view uses smaller font","Kleine To-do Ansicht nutzt kleineren Font" }, |
683 | { "Colors are applied to text","Farben werden auf Text angewendet" }, | 683 | { "Colors are applied to text","Farben werden auf Text angewendet" }, |
684 | { "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" }, | 684 | { "Use internal alarm notification","Nutze interne Alarm Benachrichtigung" }, |
685 | { "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" }, | 685 | { "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" }, |
686 | { "Play beeps count:","Anzahl der Alarmpiepse: " }, | 686 | { "Play beeps count:","Anzahl der Alarmpiepse: " }, |
687 | { "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " }, | 687 | { "Beeps interval in sec:","Zeitintervall der Alarmpiepse: " }, |
688 | { "Default suspend time in min:","Standard Supendierungs Zeit: " }, | 688 | { "Default suspend time in min:","Standard Supendierungs Zeit: " }, |
689 | { "Auto suspend count:","Anzahl der auto Suspendierungen" }, | 689 | { "Auto suspend count:","Anzahl der auto Suspendierungen" }, |
690 | { "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" }, | 690 | { "Alarm *.wav file for newly created alarm:","Alarm *.wav Datei für neu angelegte Alarme:" }, |
691 | { "New profile","Neues Profil" }, | 691 | { "New profile","Neues Profil" }, |
692 | { "Clone profile","Klone Profil" }, | 692 | { "Clone profile","Klone Profil" }, |
693 | { "Delete profile","Lösche Profil" }, | 693 | { "Delete profile","Lösche Profil" }, |
694 | { "Profile:","Profil:" }, | 694 | { "Profile:","Profil:" }, |
695 | { "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, | 695 | { "Include in multiple sync","Beziehe Profil in mehrfach Sync mit ein" }, |
696 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, | 696 | { "Force: Take local entry always","Erzwinge: Nimm immer lokalen Eintrag" }, |
697 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, | 697 | { "Force: Take remote entry always","Erzwinge: Nimm immer fernen Eintrag" }, |
698 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, | 698 | { "Show summary after sync","Zeige Zusammenfassung nach dem Synchronisieren" }, |
699 | { "Write back file","Schreibe Datei zurück" }, | 699 | { "Write back file","Schreibe Datei zurück" }, |
700 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, | 700 | { "Remote file (w down/upload command)","Entfernte Datei (via down/upload Kommando)" }, |
701 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, | 701 | { "Pre sync (download) command:","Bevor Sync (download) Kommando:" }, |
702 | { "Local device name:","Name dieses Gerätes:" }, | 702 | { "Local device name:","Name dieses Gerätes:" }, |
703 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, | 703 | { "Ask for preferences before sync","Frage nach Synchronisationseinstellungen vor dem Syncen" }, |
704 | { "Sync preferences","Synchronisations Einstellungen" }, | 704 | { "Sync preferences","Synchronisations Einstellungen" }, |
705 | { "Profile kind","Profil Art" }, | 705 | { "Profile kind","Profil Art" }, |
706 | { "Local file","Lokale Datei" }, | 706 | { "Local file","Lokale Datei" }, |
707 | { "Local file:","Lokale Datei:" }, | 707 | { "Local file:","Lokale Datei:" }, |
708 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, | 708 | { "Post sync (upload) command:","Nach Sync (upload) Kommando:" }, |
709 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, | 709 | { "Fill in default values for:","Setze Beispiel Werte ein für:" }, |
710 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, | 710 | { "Hint: Use $PWD$ for placeholder of password!","Hinweis: Benutze $PWD$ als Platzhalter für ein Passwort!" }, |
711 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, | 711 | { "Synchronization Preferences","Einstellungen der Synchronisationsprofile"}, |
712 | { "Device","Gerät:" }, | 712 | { "Device","Gerät:" }, |
713 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, | 713 | { "Sync with file \n...%1\nfrom:\n%2\n","Sync mit Datei \n...%1\nvom:\n%2\n" }, |
714 | { "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" }, | 714 | { "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" }, |
715 | { "Synchronization successful","Synchronisation erfolgreich" }, | 715 | { "Synchronization successful","Synchronisation erfolgreich" }, |
716 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, | 716 | { "Sync cancelled or failed. Nothing synced.","Sync abgebrochen oder fehlgeschlagen. Nichts wurde gesynced." }, |
717 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, | 717 | { "Sync file \n...%1\ndoes not exist!\nNothing synced!\n","Sync Datei \n...%1\nexistiert nicht!\nNichts wurde gesynced!\n" }, |
718 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, | 718 | { "Sync filename(*.ics/*.vcs)","Sync Dateiname(*.ics/*.vcs)" }, |
719 | { "Enter password","Passwort eingeben" }, | 719 | { "Enter password","Passwort eingeben" }, |
720 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, | 720 | { "Do you really want\nto remote sync\nwith profile \n","Wollen Sie wirklich\nmit dem entfernten\nProfil syncen: \n" }, |
721 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, | 721 | { "Copy remote file to local machine...","Kopiere entfernte Datei auf lokalen Rechner..." }, |
722 | { "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" }, | 722 | { "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" }, |
723 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, | 723 | { "Writing back file result: ","Resultat des Dateizurückschreibens: " }, |
724 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, | 724 | { "Syncronization sucessfully completed","Synchronisation erfolgreich abgeschlossen" }, |
725 | { "Edit Calendar Filters","Editiere Kalendar Filter" }, | 725 | { "Edit Calendar Filters","Editiere Kalendar Filter" }, |
726 | { "Enter filter name:","Neuer Filter Name:" }, | 726 | { "Enter filter name:","Neuer Filter Name:" }, |
727 | { "Add Filter","Filter hinzufügen" }, | 727 | { "Add Filter","Filter hinzufügen" }, |
728 | { "Question","Frage" }, | 728 | { "Question","Frage" }, |
729 | { "Filter position: ","Filter Position: " }, | 729 | { "Filter position: ","Filter Position: " }, |
730 | { "Month View","Monatsansicht" }, | 730 | { "Month View","Monatsansicht" }, |
731 | { "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" }, | 731 | { "This profil cannot be deleted!\n","Dieses Profil kann\nnicht gelöscht werden!" }, |
732 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, | 732 | { "KO/Pi config error","KO/Pi Konfig. Fehler" }, |
733 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, | 733 | { "Local device name undefined!\nPlease define device name!","Name dieses Gerätes undefiniert!\nBitte Namen angeben!" }, |
734 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" }, | 734 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile haben denselben Namen!\nBitte unterschiedliche Namen wählen!" }, |
735 | { "Access: ","Zugriff: " }, | 735 | { "Access: ","Zugriff: " }, |
736 | { "Needs Action","Aktion notwendig" }, | 736 | { "Needs Action","Aktion notwendig" }, |
737 | { "Accepted","Akzeptiert" }, | 737 | { "Accepted","Akzeptiert" }, |
738 | { "Declined","Abgelehnt" }, | 738 | { "Declined","Abgelehnt" }, |
739 | { "Tentative","Vorläufig" }, | 739 | { "Tentative","Vorläufig" }, |
740 | { "Delegated","Beauftragt" }, | 740 | { "Delegated","Beauftragt" }, |
741 | { "Completed","Vollständig" }, | 741 | { "Completed","Vollständig" }, |
742 | { "In Process","In Bearbeitung" }, | 742 | { "In Process","In Bearbeitung" }, |
743 | { "Participant","Teilnehmer" }, | 743 | { "Participant","Teilnehmer" }, |
744 | { "Optional Participant","Möglicher Teilnehmer" }, | 744 | { "Optional Participant","Möglicher Teilnehmer" }, |
745 | { "Observer","Beobachter" }, | 745 | { "Observer","Beobachter" }, |
746 | { "Chair","Vorsitzender" }, | 746 | { "Chair","Vorsitzender" }, |
747 | { "Not supported \non desktop!\n","" }, | 747 | { "Not supported \non desktop!\n","" }, |
748 | { "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 verticale Auswahl zum Drucken zu bestimmen,\nbitte einen verticalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen. " }, | 748 | { "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 verticale Auswahl zum Drucken zu bestimmen,\nbitte einen verticalen Zeitraum (mit gedrückter linker Maustaste)\nin einer Spalte auswählen. " }, |
749 | { "Date range: ","Datums Zeitspanne: " }, | 749 | { "Date range: ","Datums Zeitspanne: " }, |
750 | { "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " }, | 750 | { "Not supported \non PDA!\n","Nicht verfügbar\nauf dem PDA. " }, |
751 | { "Syncing - close to abort!","Syncing-schließe um abzubrechen." }, | 751 | { "Syncing - close to abort!","Syncing-schließe um abzubrechen." }, |
752 | { "Add / remove events","Add./entferne Termine" }, | 752 | { "Add / remove events","Add./entferne Termine" }, |
753 | { "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." }, | 753 | { "File does not exist:\n '%1'.","Datei existiert nicht:\n '%1'." }, |
754 | { "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." }, | 754 | { "Couldn't load calendar\n '%1'.","Kann Kalender nicht laden:\n '%1'." }, |
755 | { "\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" }, | 755 | { "\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" }, |
756 | { "Overwrite","Überschreiben" }, | 756 | { "Overwrite","Überschreiben" }, |
757 | { "Sync+save","Syncen+speichern" }, | 757 | { "Sync+save","Syncen+speichern" }, |
758 | { "Default","Standard" }, | 758 | { "Default","Standard" }, |
759 | { " Categories added to list! "," Kategorien zur Liste hinzugefügt! " }, | 759 | { " Categories added to list! "," Kategorien zur Liste hinzugefügt! " }, |
760 | { " %d items?"," %d Einträge?" }, | 760 | { " %d items?"," %d Einträge?" }, |
761 | { "\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?" }, | 761 | { "\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?" }, |
762 | { " ?\n\nDelete:\n"," ?\n\nLösche:\n" }, | 762 | { " ?\n\nDelete:\n"," ?\n\nLösche:\n" }, |
763 | { "Current","Aktuelle" }, | 763 | { "Current","Aktuelle" }, |
764 | { "\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" }, | 764 | { "\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" }, |
765 | { "All","Alle" }, | 765 | { "All","Alle" }, |
766 | { "Data Loss Warning","Datenverlust Warnung" }, | 766 | { "Data Loss Warning","Datenverlust Warnung" }, |
767 | { "Proceed","Weitermachen" }, | 767 | { "Proceed","Weitermachen" }, |
768 | { "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" }, | 768 | { "The journal entries can not be\nexported to a vCalendar file.","Die Journal Einträge können\nnicht in eine vCalendar\nDatei exportiert werden!" }, |
769 | { "Filter disabled ","Filter abgeschaltet" }, | 769 | { "Filter disabled ","Filter abgeschaltet" }, |
770 | { "Filter selected: ","Gewählter Filter: " }, | 770 | { "Filter selected: ","Gewählter Filter: " }, |
771 | { "Toggle Cancel","Gecancelt ändern" }, | 771 | { "Toggle Cancel","Gecancelt ändern" }, |
772 | { "&Toggle Cancel","Gecancel&t ändern" }, | 772 | { "&Toggle Cancel","Gecancel&t ändern" }, |
773 | { "Configure Toolbar","Konfiguriere Toolbar" }, | 773 | { "Configure Toolbar","Konfiguriere Toolbar" }, |
774 | { "Stretched TB","Gedehnte TB" }, | 774 | { "Stretched TB","Gedehnte TB" }, |
775 | { "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" }, | 775 | { "Import file \n...%1\ndoes not exist!\nNothing imported!\n","Import Datei \n...%1\nexistiert nicht!\nNichts importiert!\n" }, |
776 | { "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" }, | 776 | { "Import filename(*.ics/*.vcs)","Import Dateiname(*.ics/*.vcs)" }, |
777 | { "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" }, | 777 | { "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" }, |
778 | { "Not supported \non desktop!\n","Nur verfügbar auf PDA!" }, | 778 | { "Not supported \non desktop!\n","Nur verfügbar auf PDA!" }, |
779 | { "Imported file successfully","Datei erfolgreich importiert" }, | 779 | { "Imported file successfully","Datei erfolgreich importiert" }, |
780 | { "Error importing file","Fehler beim Importieren der Datei" }, | 780 | { "Error importing file","Fehler beim Importieren der Datei" }, |
781 | { "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, | 781 | { "Export vcal filename(*.vcs)","Export vcal Dateiname(*.vcs)" }, |
782 | { "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" }, | 782 | { "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" }, |
783 | { "Overwrite!","Überschreiben!" }, | 783 | { "Overwrite!","Überschreiben!" }, |
784 | { "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" }, | 784 | { "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" }, |
785 | { "Load backup filename","Lade Backup Dateiname" }, | 785 | { "Load backup filename","Lade Backup Dateiname" }, |
786 | { "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" }, | 786 | { "Backup file\ndoes not exist!\nNothing loaded!","Backup Datei\nexistiert nicht!\nNichts geladen!" }, |
787 | { "KO/Pi:Loaded %1","KO/Pi:Geladen %1" }, | 787 | { "KO/Pi:Loaded %1","KO/Pi:Geladen %1" }, |
788 | { "Save backup filename","Speichere Backup Dateiname" }, | 788 | { "Save backup filename","Speichere Backup Dateiname" }, |
789 | { "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" }, | 789 | { "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" }, |
790 | { "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, | 790 | { "KO/Pi:Saved %1","KO/Pi:Gespeichert %1" }, |
791 | { "Details of attendee","Teilnehmerdetails" }, | 791 | { "Details of attendee","Teilnehmerdetails" }, |
792 | { "Work phone:\n","Telefon Arbeit:\n" }, | 792 | { "Work phone:\n","Telefon Arbeit:\n" }, |
793 | { "Work mobile phone:\n","Mobiltelefon Arbeit:\n" }, | 793 | { "Work mobile phone:\n","Mobiltelefon Arbeit:\n" }, |
794 | { "Home phone:\n","Telefon privat:\n" }, | 794 | { "Home phone:\n","Telefon privat:\n" }, |
795 | { "Mobile home phone:\n","Mobiltelefon privat:\n" }, | 795 | { "Mobile home phone:\n","Mobiltelefon privat:\n" }, |
796 | { "Email:\n","Email:\n" }, | 796 | { "Email:\n","Email:\n" }, |
797 | { "Alarm disabled for this item","Alarm deaktiviert für dieses Item" }, | 797 | { "Alarm disabled for this item","Alarm deaktiviert für dieses Item" }, |
798 | { "Audio Al.: ","Audio Al.: " }, | 798 | { "Audio Al.: ","Audio Al.: " }, |
799 | { "Proc.Al.: ","Proz.Al.: " }, | 799 | { "Proc.Al.: ","Proz.Al.: " }, |
800 | { "No sound set","Kein Sound definiert" }, | 800 | { "No sound set","Kein Sound definiert" }, |
801 | { "*.wav|Wav Files","*.wav|Wav Dateien" }, | 801 | { "*.wav|Wav Files","*.wav|Wav Dateien" }, |
802 | { "No program set","Kein Programm definiert" }, | 802 | { "No program set","Kein Programm definiert" }, |
803 | { "Running '%1'","Ausführen '%1'" }, | 803 | { "Running '%1'","Ausführen '%1'" }, |
804 | { "Playing '%1'","Abspielen '%1'" }, | 804 | { "Playing '%1'","Abspielen '%1'" }, |
805 | { "Show Sync Events in WN/Agenda view","Zeige Sync Events in WN/Agenda Ansicht" }, | 805 | { "Show Sync Events in WN/Agenda view","Zeige Sync Events in WN/Agenda Ansicht" }, |
806 | { "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" }, | 806 | { "User defined (usertranslation.txt)","Benutzerdefiniert (usertranslation.txt)" }, |
807 | { "Load!","Laden!" }, | 807 | { "Load!","Laden!" }, |
808 | { "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" }, | 808 | { "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" }, |
809 | { "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" }, | 809 | { "KO/Pi Features and hints","KO/Pi Eigenschaften und Tipps" }, |
810 | { "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" }, | 810 | { "KO/Pi User translation HowTo","KO/Pi Benutzer-Übersetzung HowTo" }, |
811 | { "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" }, | 811 | { "KO/Pi Synchronization HowTo","KO/Pi Synchronisation HowTo" }, |
812 | { "Features + hints...","Eigenschaften + Tipps..." }, | 812 | { "Features + hints...","Eigenschaften + Tipps..." }, |
813 | { "User translation...","Benutzer Übersetzung..." }, | 813 | { "User translation...","Benutzer Übersetzung..." }, |
814 | { "Sync HowTo...","Synchronisation HowTo..." }, | 814 | { "Sync HowTo...","Synchronisation HowTo..." }, |
815 | { "Print calendar...","Drucke Kalender..." }, | 815 | { "Print calendar...","Drucke Kalender..." }, |
816 | { "Anniversary","Jahrestag" }, | 816 | { "Anniversary","Jahrestag" }, |
817 | { "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" }, | 817 | { "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" }, |
818 | { "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" }, | 818 | { "Import Birthdays (KA/Pi)","Importiere Geburtstage (KA/Pi)" }, |
819 | { "Next recurrence is on: ","Nächste Wiederholung ist am:" }, | 819 | { "Next recurrence is on: ","Nächste Wiederholung ist am:" }, |
820 | { "<b>Alarm on: </b>","<b>Alarm am: </b>" }, | 820 | { "<b>Alarm on: </b>","<b>Alarm am: </b>" }, |
821 | { "<b>Access: </b>","<b>Zugriff: </b>" }, | 821 | { "<b>Access: </b>","<b>Zugriff: </b>" }, |
822 | { "(%1 min before)","(%1 min vorher)" }, | 822 | { "(%1 min before)","(%1 min vorher)" }, |
823 | { "<b>Categories: </b>","<b>Kategorien: </b>" }, | 823 | { "<b>Categories: </b>","<b>Kategorien: </b>" }, |
824 | { "Save Journal/Description...","Speichere Journal/Details..." }, | 824 | { "Save Journal/Description...","Speichere Journal/Details..." }, |
825 | { "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." }, | 825 | { "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." }, |
826 | { "Continue","Weitermachen" }, | 826 | { "Continue","Weitermachen" }, |
827 | { " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" }, | 827 | { " birthdays/anniversaries added!"," Geburts-/Jahrestage hinzugefügt" }, |
828 | { "Attendee:","Teilnehmer:" }, | 828 | { "Attendee:","Teilnehmer:" }, |
829 | { "Click OK to search ->","Klicke zum Suchen auf OK ->" }, | 829 | { "Click OK to search ->","Klicke zum Suchen auf OK ->" }, |
830 | { "On day ","Am Tag " }, | 830 | { "On day ","Am Tag " }, |
831 | { "%1 of ","%1 des Monats" }, | 831 | { "%1 of ","%1 des Monats" }, |
832 | { "%1 of the year","%1 des Jahres" }, | 832 | { "%1 of the year","%1 des Jahres" }, |
833 | { "Anonymous","Anonymo" }, | 833 | { "Anonymous","Anonymo" }, |
834 | { "nobody@nowhere","niemand@nirgendwo" }, | 834 | { "nobody@nowhere","niemand@nirgendwo" }, |
835 | { "calendar.html","calendar.html" }, | 835 | { "calendar.html","calendar.html" }, |
836 | { " Local Time"," Locale Zeit" }, | 836 | { " Local Time"," Locale Zeit" }, |
837 | { "Unknown Name","Unbekannter Name" }, | 837 | { "Unknown Name","Unbekannter Name" }, |
838 | { "unknown@nowhere","unbekannt@nirgendwo" }, | 838 | { "unknown@nowhere","unbekannt@nirgendwo" }, |
839 | { "Beam via IR!","Beam via IR!" }, | 839 | { "Beam via IR!","Beam via IR!" }, |
840 | { "Next Month","Nächster Monat" }, | 840 | { "Next Month","Nächster Monat" }, |
841 | { "Prio","Prio" }, | 841 | { "Prio","Prio" }, |
842 | { "Reparent Todo","Mache Sub-Todo" }, | 842 | { "Reparent Todo","Mache Sub-Todo" }, |
843 | { "tomorrow","morgen" }, | 843 | { "tomorrow","morgen" }, |
844 | { "today","heute" }, | 844 | { "today","heute" }, |
845 | { "yesterday","gestern" }, | 845 | { "yesterday","gestern" }, |
846 | { "Ok","Ok" }, | 846 | { "Ok","Ok" }, |
847 | { "Ok+Agenda","Ok+Agenda" }, | 847 | { "Ok+Agenda","Ok+Agenda" }, |
848 | { "Email","Email" }, | 848 | { "Email","Email" }, |
849 | { "RSVP","RSVP" }, | 849 | { "RSVP","RSVP" }, |
850 | { "Email:","Email:" }, | 850 | { "Email:","Email:" }, |
851 | { "Appointment Time ","Termin Zeit " }, | 851 | { "Appointment Time ","Termin Zeit " }, |
852 | { "2","2" }, | 852 | { "2","2" }, |
853 | { "3","3" }, | 853 | { "3","3" }, |
854 | { "4","4" }, | 854 | { "4","4" }, |
855 | { " 0 %"," 0 %" }, | 855 | { " 0 %"," 0 %" }, |
856 | { " 20 %"," 20 %" }, | 856 | { " 20 %"," 20 %" }, |
857 | { " 40 %"," 40 %" }, | 857 | { " 40 %"," 40 %" }, |
858 | { " 60 %"," 60 %" }, | 858 | { " 60 %"," 60 %" }, |
859 | { " 80 %"," 80 %" }, | 859 | { " 80 %"," 80 %" }, |
860 | { "100 %","100 %" }, | 860 | { "100 %","100 %" }, |
861 | { "Filter","Filter" }, | 861 | { "Filter","Filter" }, |
862 | { "Configure","Konfiguriere" }, | 862 | { "Configure","Konfiguriere" }, |
863 | { "What's Next","What's Next" }, | 863 | { "What's Next","What's Next" }, |
864 | { "Complete calendar...","Kompletten Kalender..." }, | 864 | { "Complete calendar...","Kompletten Kalender..." }, |
865 | { "Filtered calendar...","Gefilterten Kalender..." }, | 865 | { "Filtered calendar...","Gefilterten Kalender..." }, |
866 | { "Export to phone","Exportiere zum Handy" }, | 866 | { "Export to phone","Exportiere zum Handy" }, |
867 | { "Beam receive enabled","Beam Empfang an" }, | 867 | { "Beam receive enabled","Beam Empfang an" }, |
868 | { "What's new?","Was ist neu?" }, | 868 | { "What's new?","Was ist neu?" }, |
869 | { "FAQ...","FAQ..." }, | 869 | { "FAQ...","FAQ..." }, |
870 | { "Licence...","Licence..." }, | 870 | { "Licence...","Licence..." }, |
871 | { "What's This?","What's This?" }, | 871 | { "What's This?","What's This?" }, |
872 | { "&Edit...","&Editiere..." }, | 872 | { "&Edit...","&Editiere..." }, |
873 | { "Oktober","Oktober" }, | 873 | { "Oktober","Oktober" }, |
874 | { "Title","Titel" }, | 874 | { "Title","Titel" }, |
875 | { "%1 %","%1 %" }, | 875 | { "%1 %","%1 %" }, |
876 | { "Enable Pi-Sync","Schalte Pi-Sync an" }, | 876 | { "Enable Pi-Sync","Schalte Pi-Sync an" }, |
877 | { "Import!","Importiere!" }, | 877 | { "Import!","Importiere!" }, |
878 | { "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" }, | 878 | { "inserting birthdays - close to abort!","Burzeltage werden eingefügt - schließe um abzubrechen!" }, |
879 | { "Export to phone options","Export ans Handy Optionen" }, | 879 | { "Export to phone options","Export ans Handy Optionen" }, |
880 | { "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, | 880 | { "Please read Help-Sync Howto\nto know what settings to use.","Bitte lese Hilfe-Sync Howto\num zu erfahren welche Einstellungen\ndie richtigen sind." }, |
881 | { "I/O device: ","I/O device: " }, | 881 | { "I/O device: ","I/O device: " }, |
882 | { "Connection: ","Connection: " }, | 882 | { "Connection: ","Connection: " }, |
883 | { "Model(opt.): ","Model(opt.): " }, | 883 | { "Model(opt.): ","Model(opt.): " }, |
884 | { "Write back events in future only","Schreibe nur zukünftige Termine zurück" }, | 884 | { "Write back events in future only","Schreibe nur zukünftige Termine zurück" }, |
885 | { "Max. weeks in future: ","Max. Wochen in der Zukunft: " }, | 885 | { "Max. weeks in future: ","Max. Wochen in der Zukunft: " }, |
886 | { "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nToDo/Kalender Daten auf dem Handy!" }, | 886 | { "NOTE: This will remove all old\ntodo/calendar data on phone!","ACHTUNG: Das löscht alle alten\nToDo/Kalender Daten auf dem Handy!" }, |
887 | { "Export to mobile phone!","Exportiere auf das Handy!" }, | 887 | { "Export to mobile phone!","Exportiere auf das Handy!" }, |
888 | { "Export complete calendar","Exportiere kompletten Kalender" }, | 888 | { "Export complete calendar","Exportiere kompletten Kalender" }, |
889 | { "Writing to phone...","Sende Daten ans Handy..." }, | 889 | { "Writing to phone...","Sende Daten ans Handy..." }, |
890 | { " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, | 890 | { " This may take 1-3 minutes!"," Das kann 1-3 Minuten dauern!" }, |
891 | { "Retry","Nochmal versuchen" }, | 891 | { "Retry","Nochmal versuchen" }, |
892 | { "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, | 892 | { "KDE/Pim phone access","KDE/Pim Handy Zugriff" }, |
893 | { "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, | 893 | { "Error accessing device!\nPlease turn on connection\nand retry!","Fehler beim Zugriff auf das Gerät!\nBitte die Verbindung aktivieren\nund nochmal versuchen!" }, |
894 | { "Error exporting to phone!","Fehler beim Export auf das Handy!" }, | 894 | { "Error exporting to phone!","Fehler beim Export auf das Handy!" }, |
895 | { "Export filtered calendar","Exportiere gefilterten Kalender" }, | 895 | { "Export filtered calendar","Exportiere gefilterten Kalender" }, |
896 | { "Preferences","Vorlieben" }, | 896 | { "Preferences","Vorlieben" }, |
897 | { "Global","Global" }, | 897 | { "Global","Global" }, |
898 | { "Phone","Phone" }, | 898 | { "Phone","Phone" }, |
899 | { "SMS","SMS" }, | 899 | { "SMS","SMS" }, |
900 | { "Fax","Fax" }, | 900 | { "Fax","Fax" }, |
901 | { "Pager","Pager" }, | 901 | { "Pager","Pager" }, |
902 | { "SIP","SIP" }, | 902 | { "SIP","SIP" }, |
903 | { "Italian","Italienisch" }, | 903 | { "Italian","Italienisch" }, |
904 | { "24:00","24:00" }, | 904 | { "24:00","24:00" }, |
905 | { "12:00am","12:00am" }, | 905 | { "12:00am","12:00am" }, |
906 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, | 906 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, |
907 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, | 907 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, |
908 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, | 908 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, |
909 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, | 909 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, |
910 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, | 910 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, |
911 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, | 911 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, |
912 | { "Used Mail Client","Benutzter Mail Client" }, | 912 | { "Used Mail Client","Benutzter Mail Client" }, |
913 | { "Channel:","Channel:" }, | 913 | { "Channel:","Channel:" }, |
914 | { "Message:","Message:" }, | 914 | { "Message:","Message:" }, |
915 | { "Parameters:","Parameter:" }, | 915 | { "Parameters:","Parameter:" }, |
916 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, | 916 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, |
917 | { "extra Message:","extra Message:" }, | 917 | { "extra Message:","extra Message:" }, |
918 | { "extra Parameters:","extra Parameter:" }, | 918 | { "extra Parameters:","extra Parameter:" }, |
919 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, | 919 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, |
920 | { "External Apps.","Externe Appl." }, | 920 | { "External Apps.","Externe Appl." }, |
921 | { "24 hours","24 Std." }, | 921 | { "24 hours","24 Std." }, |
922 | { "3 hours","3 Std." }, | 922 | { "3 hours","3 Std." }, |
923 | { "1 hour","1 Std." }, | 923 | { "1 hour","1 Std." }, |
924 | { "15 minutes","15 Min." }, | 924 | { "15 minutes","15 Min." }, |
925 | { "5 minutes","5 Min." }, | 925 | { "5 minutes","5 Min." }, |
926 | { "1 minute","1 Min." }, | 926 | { "1 minute","1 Min." }, |
927 | { "23","23" }, | 927 | { "23","23" }, |
928 | { "Mon 15","Mon 15" }, | 928 | { "Mon 15","Mon 15" }, |
929 | { "Configure KO","Konfiguriere KO" }, | 929 | { "Configure KO","Konfiguriere KO" }, |
930 | { "Event text","Termin Text" }, | 930 | { "Event text","Termin Text" }, |
931 | { "ToDo","ToDo" }, | 931 | { "ToDo","ToDo" }, |
932 | { "Today","Heute" }, | 932 | { "Today","Heute" }, |
933 | { "What's Next View","What's Next Ansicht" }, | 933 | { "What's Next View","What's Next Ansicht" }, |
934 | { "Show Sync Events in \nWhat's Next/Agenda view","Zeige Sync Termine in \nWhat's Next/Agenda view" }, | 934 | { "Show Sync Events in \nWhat's Next/Agenda view","Zeige Sync Termine in \nWhat's Next/Agenda view" }, |
935 | { "Use short date in \nWhat's Next/Event view","Zeige Kurzdatum in \nWhat's Next/Event view" }, | 935 | { "Use short date in \nWhat's Next/Event view","Zeige Kurzdatum in \nWhat's Next/Event view" }, |
936 | { "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" }, | 936 | { "Allday Agenda view shows todos","Ganztag Agenda zeigt Todos" }, |
937 | { "Alarm","Alarm" }, | 937 | { "Alarm","Alarm" }, |
938 | { "Used %1 Client","Benutzter %1 Client" }, | 938 | { "Used %1 Client","Benutzter %1 Client" }, |
939 | { "No email client installed","Kein Email Klient installiert" }, | 939 | { "No email client installed","Kein Email Klient installiert" }, |
940 | { "Userdefined email client","Benutzerdef. Email Klient" }, | 940 | { "Userdefined email client","Benutzerdef. Email Klient" }, |
941 | { "OM/Pi email client","OM/Pi Email Klient" }, | 941 | { "OM/Pi email client","OM/Pi Email Klient" }, |
942 | { "Include in multiple ","Beziehe in multiple " }, | 942 | { "Include in multiple ","Beziehe in multiple " }, |
943 | { "calendar ","Kalender " }, | 943 | { "calendar ","Kalender " }, |
944 | { "addressbook ","Adressbuch " }, | 944 | { "addressbook ","Adressbuch " }, |
945 | { "pwmanager","PWmanager" }, | 945 | { "pwmanager","PWmanager" }, |
946 | { " sync"," Sync ein" }, | 946 | { " sync"," Sync ein" }, |
947 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, | 947 | { "Write back synced data","Schreibe gesyncte Daten zurück" }, |
948 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, | 948 | { "-- Write back (on remote) existing entries only","-- Schreibe nur existierende (entfernte) Einträge zurück" }, |
949 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, | 949 | { "-- Write back (calendar) entries in future only","-- Schreibe nur zukünftige Kalender-Einträge zurück" }, |
950 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, | 950 | { "---- Max. weeks in future: ","---- Max. wochen in der Zukunft: " }, |
951 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, | 951 | { "Pi-Sync ( direct Kx/Pi to Kx/Pi sync )","Pi-Sync ( direktes Kx/Pi zu Kx/Pi sync )" }, |
952 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, | 952 | { "Mobile device (cell phone)","Mobiles Gerät (Handy)" }, |
953 | { "Help...","Hilfe..." }, | 953 | { "Help...","Hilfe..." }, |
954 | { "Local file Cal:","Lokale Datei Kal:" }, | 954 | { "Local file Cal:","Lokale Datei Kal:" }, |
955 | { "Local file ABook:","Lokale Datei ABuch:" }, | 955 | { "Local file ABook:","Lokale Datei ABuch:" }, |
956 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, | 956 | { "Local file PWMgr:","Lokale Datei PWMgr:" }, |
957 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, | 957 | { "Addressbook file (*.vcf) is used by KA/Pi","Adressbuch Datei (*.vcf) wird von KA/Pi genutzt" }, |
958 | { "Calendar:","Kalender:" }, | 958 | { "Calendar:","Kalender:" }, |
959 | { "AddressBook:","AdressBuch:" }, | 959 | { "AddressBook:","AdressBuch:" }, |
960 | { "PWManager:","PWManager:" }, | 960 | { "PWManager:","PWManager:" }, |
961 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, | 961 | { "Addressbook file is used by KA/Pi","Adressbuch Datei wird von KA/Pi genutzt" }, |
962 | { "ssh/scp","ssh/scp" }, | 962 | { "ssh/scp","ssh/scp" }, |
963 | { "ftp","ftp" }, | 963 | { "ftp","ftp" }, |
964 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, | 964 | { "Password for remote access: (could be the same for each)","Passwort für entfernten Zugriff: (kann dasselbe sein für alle)" }, |
965 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, | 965 | { "Remote IP address: (could be the same for each)","Entfernte IP Adresse: (kann dasselbe sein für alle)" }, |
966 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, | 966 | { "Remote port number: (should be different for each)","Entfernte Port Nummer: (Sollte für alle unterschiedlich sein)" }, |
967 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, | 967 | { "command for downloading remote file to local device","Kommando zum Download der entfernten Datei zum lokalen Gerät" }, |
968 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, | 968 | { "command for uploading local temp file to remote device","Kommando zum Upload der lokalen temp. Datei zum entfernten Gerät" }, |
969 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, | 969 | { "Insert device where\nphone is connected. E.g.:\n","Füge Device ein, an dem\ndas Handy angeschlossen ist. Z.B.:\n" }, |
970 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, | 970 | { "KDE-Pim sync config","KDE-Pim sync Konfig" }, |
971 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, | 971 | { "Insert kind of connection,e.g.:\n","Füge Art der Verbindung ein,z.B.:\n" }, |
972 | { "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" }, | 972 | { "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" }, |
973 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, | 973 | { "Port number (Default: %1)","Port Nummer (Default: %1)" }, |
974 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, | 974 | { "Password to enable\naccess from remote:","Passwort um entfernten\nZugriff zuzulassen:" }, |
975 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, | 975 | { "Automatically start\nat application startup","Starte automatisch\nbeim Programmstart" }, |
976 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, | 976 | { "Automatically sync\nwith KDE-Desktop","Automatischer Sync\nmit dem KDE-Desktop" }, |
977 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, | 977 | { "Enter port for Pi-Sync","Port Nummer für Pi-Sync" }, |
978 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, | 978 | { "Disable Pi-Sync","Schalte Pi-Sync aus" }, |
979 | { "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!" }, | 979 | { "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!" }, |
980 | { "KDE-Pim Sync","KDE-Pim Sync" }, | 980 | { "KDE-Pim Sync","KDE-Pim Sync" }, |
981 | { "Multiple profiles","Multi-Sync Profile" }, | 981 | { "Multiple profiles","Multi-Sync Profile" }, |
982 | { "Device: ","Gerät: " }, | 982 | { "Device: ","Gerät: " }, |
983 | { "Multiple sync started.","Multi-Sync gestartet." }, | 983 | { "Multiple sync started.","Multi-Sync gestartet." }, |
984 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, | 984 | { "Nothing synced! No profiles defined for multisync!","Nichts gesynct! Keine Profile\nselektiert für Multi-Sync" }, |
985 | { "Turn filter on","Schalte Filter an" }, | 985 | { "Turn filter on","Schalte Filter an" }, |
986 | { "Turn filter off","Schalte Filter aus" }, | 986 | { "Turn filter off","Schalte Filter aus" }, |
987 | { "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, | 987 | { "Key bindings KOrganizer/Pi","Tastatur Belegung KOrganizer/Pi" }, |
988 | { "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, | 988 | { "<p><b>White</b>: Item readonly</p>\n","<p><b>Weiss</b>: Eintrag schreibgeschützt</p>\n" }, |
989 | { "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, | 989 | { "<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n","<p><b>Dunkelgelb</b>: Termin/Todo mit Teilnehmern.</p>\n" }, |
990 | { "<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" }, | 990 | { "<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" }, |
991 | { "<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" }, | 991 | { "<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" }, |
992 | { "<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" }, | 992 | { "<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" }, |
993 | { "<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" }, | 993 | { "<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" }, |
994 | { "<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" }, | 994 | { "<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" }, |
995 | { "<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" }, | 995 | { "<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" }, |
996 | { "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, | 996 | { "<p><h2>KO/Pi icon colors:</h2></p>\n","<p><h2>KO/Pi Icon Farben:</h2></p>\n" }, |
997 | { "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, | 997 | { "<p><b>E</b>: Edit item</p>\n","<p><b>E</b>: Editiere Eintrag</p>\n" }, |
998 | { "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, | 998 | { "<p><b>A</b>: Show agenda view.</p>\n","<p><b>A</b>: Zeige Agenda Ansicht.</p>\n" }, |
999 | { "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, | 999 | { "<p><b>I,C</b>: Close dialog.</p>\n","<p><b>I,C</b>: Schließe Dialog.</p>\n" }, |
1000 | { "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, | 1000 | { "<p><h3>In event/todo viewer:</h3></p>\n","<p><h3>In Termin/Todo Detail-Anzeige:</h3></p>\n" }, |
1001 | { "<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" }, | 1001 | { "<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" }, |
1002 | { "<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" }, | 1002 | { "<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" }, |
1003 | { "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, | 1003 | { "<p><b>up/down</b>: Next/prev item</p>\n","<p><b>up/down</b>: Nächster/vorheriger Eintrag</p>\n" }, |
1004 | { "<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" }, | 1004 | { "<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" }, |
1005 | { "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, | 1005 | { "<p><b>return</b>: Select item+one step down</p>\n","<p><b>return</b>: Selektiere Item+Cursor einen Eintrag runter</p>\n" }, |
1006 | { "<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" }, | 1006 | { "<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" }, |
1007 | { "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, | 1007 | { "<p><h3>In list view:</h3></p>\n","<p><h3>In Listen Ansicht:</h3></p>\n" }, |
1008 | { "<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" }, | 1008 | { "<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" }, |
1009 | { "<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" }, | 1009 | { "<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" }, |
1010 | { "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, | 1010 | { "<p><b>Q</b>: Toggle quick todo line edit.</p>\n","<p><b>Q</b>: Zeige/verstecke Quick Todo Eingabe Zeile.</p>\n" }, |
1011 | { "<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" }, | 1011 | { "<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" }, |
1012 | { "<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" }, | 1012 | { "<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" }, |
1013 | { "<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" }, | 1013 | { "<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" }, |
1014 | { "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, | 1014 | { "<p><h3>In todo view:</h3></p>\n","<p><h3>In Todo Anzige:</h3></p>\n" }, |
1015 | { "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, | 1015 | { "<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n","<p><b>ctrl+up/down</b>: Scrolle kleine Todo Ansicht</p>\n" }, |
1016 | { "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, | 1016 | { "<p><b>up/down</b>: Scroll agenda view</p>\n","<p><b>up/down</b>: Scrolle Agenda Ansicht</p>\n" }, |
1017 | { "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, | 1017 | { "<p><h3>In agenda view:</h3></p>\n","<p><h3>In Agenda Ansicht:</h3></p>\n" }, |
1018 | { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, | 1018 | { "<p><b>del,backspace</b>: Delete selected item</p>\n","<p><b>del,backspace</b>: Lösche selektiertes Item</p>\n" }, |
1019 | { "<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" }, | 1019 | { "<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" }, |
1020 | { "<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" }, | 1020 | { "<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" }, |
1021 | { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, | 1021 | { "<p><b>B</b>: Edit description (details) of selected item</p>\n","<p><b>B</b>: Editiere Beschreibung (Details) des selektierten Items</p>\n" }, |
1022 | { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, | 1022 | { "<p><b>C</b>: Show current time in agenda view</p>\n","<p><b>C</b>: Zeige aktuelle Zeit in Agenda Ansicht</p>\n" }, |
1023 | { "<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" }, | 1023 | { "<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" }, |
1024 | { "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datumsnavigator</p>\n" }, | 1024 | { "<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n","<p><b>S+ctrl</b>: Füge Sub-Todo hinzu | <b>X</b>: Zeige/verstecke Datumsnavigator</p>\n" }, |
1025 | { "<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" }, | 1025 | { "<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" }, |
1026 | { "<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" }, | 1026 | { "<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" }, |
1027 | { "<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" }, | 1027 | { "<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" }, |
1028 | { "<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" }, | 1028 | { "<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" }, |
1029 | { "<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" }, | 1029 | { "<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" }, |
1030 | { "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " }, | 1030 | { "<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ","<p><b>N</b>: Nächste-Tage Ansicht | <b>W</b>: What's Next Ansicht\n " }, |
1031 | { "<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" }, | 1031 | { "<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" }, |
1032 | { "<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" }, | 1032 | { "<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" }, |
1033 | { "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" }, | 1033 | { "<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n","<p><b>F</b>: Zeige/verstecke Filter Ansicht |<b>F+ctrl</b>: Editiere Filter </p>\n" }, |
1034 | { "<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" }, | 1034 | { "<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" }, |
1035 | { "<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" }, | 1035 | { "<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" }, |
1036 | { "<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" }, | 1036 | { "<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" }, |
1037 | { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, | 1037 | { "<p><h2>KO/Pi key shortcuts:</h2></p>\n","<p><h2>KO/Pi Tastatur Kurzbefehle:</h2></p>\n" }, |
1038 | { "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" }, | 1038 | { "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" }, |
1039 | { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, | 1039 | { "Auto Saving in KOrganizer/Pi","Auto Speichern in KOrganizer/Pi" }, |
1040 | { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, | 1040 | { "\nhttp://sourceforge.net/projects/kdepimpi\n","\nhttp://sourceforge.net/projects/kdepimpi\n" }, |
1041 | { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, | 1041 | { "\nor report them in the bugtracker on\n","\noder trage sie in dem Bugtracker ein auf\n" }, |
1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, | 1042 | { "\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n","\nBitte melde fehlerhaftes Verhalten an\nlutz@pi-sync.info\n" }, |
1043 | { "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" }, | 1043 | { "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" }, |
1044 | { "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" }, | 1044 | { "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" }, |
1045 | { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, | 1045 | { "Known Problems in KOrganizer/Pi","Bekannte Probleme in KOrganizer/Pi" }, |
1046 | { "KO/Pi FAQ","KO/Pi FAQ" }, | 1046 | { "KO/Pi FAQ","KO/Pi FAQ" }, |
1047 | { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, | 1047 | { "PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n","PDA-Edition\nfür: Zaurus 5x00/7x0/860/3000/6000\n" }, |
1048 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, | 1048 | { "KOrganizer/Platform-independent\n","KOrganizer/Platform-independent\n" }, |
1049 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, | 1049 | { "About KOrganizer/Pi","Über KOrganizer/Pi" }, |
1050 | { "From: ","Von: " }, | 1050 | { "From: ","Von: " }, |
1051 | { "Remove sync info","Entferne Sync Info" }, | 1051 | { "Remove sync info","Entferne Sync Info" }, |
1052 | { "For all profiles","Für alle Profile" }, | 1052 | { "For all profiles","Für alle Profile" }, |
1053 | { "Hide not Running","Verstecke nicht Laufende" }, | 1053 | { "Hide not Running","Verstecke nicht Laufende" }, |
1054 | { "ME","ME" }, | 1054 | { "ME","ME" }, |
1055 | { "Toolbar","Toolbar" }, | 1055 | { "Toolbar","Toolbar" }, |
1056 | { "Undo Delete...","Löschen rückgängig machen..." }, | 1056 | { "Undo Delete...","Löschen rückgängig machen..." }, |
1057 | { "Undo Delete","Löschen rückgängig machen" }, | 1057 | { "Undo Delete","Löschen rückgängig machen" }, |
1058 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, | 1058 | { "KDE Sync HowTo...","KDE Sync HowTo..." }, |
1059 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, | 1059 | { "Multi Sync HowTo...","Multi Sync HowTo..." }, |
1060 | { "Januar","Januar" }, | 1060 | { "Januar","Januar" }, |
1061 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, | 1061 | { "KO/Pi Keys + Colors","KO/Pi Tasten + Farben" }, |
1062 | { "No Filter","Kein Filter" }, | 1062 | { "No Filter","Kein Filter" }, |
1063 | { "Multiple Sync options","Multi Sync Optionen" }, | 1063 | { "Multiple Sync options","Multi Sync Optionen" }, |
1064 | { "Sync algo options","Sync Ablauf Optionen" }, | 1064 | { "Sync algo options","Sync Ablauf Optionen" }, |
1065 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, | 1065 | { "Apply filter when adding data to local:","Filter für das Hinzufügen von Daten zu Lokal:" }, |
1066 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, | 1066 | { "Incoming calendar filter:","Eingehender Kalender Filter:" }, |
1067 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, | 1067 | { "Incoming addressbook filter:","Eingehender Adressbuch Filter:" }, |
1068 | { "Write back options","Optionen zum Zurückschreiben" }, | 1068 | { "Write back options","Optionen zum Zurückschreiben" }, |
1069 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, | 1069 | { "Write back (on remote) existing entries only","Schreibe nur existierende (auf Entfernt) Einträge zurück" }, |
1070 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, | 1070 | { "Apply filter when adding data to remote:","Filter für das Hinzufügen von Daten zu Entfernt:" }, |
1071 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, | 1071 | { "Outgoing calendar filter:","Ausgehender Kalender Filter:" }, |
1072 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, | 1072 | { "Outgoing addressbook filter:","Ausgehender Adressbuch Filter:" }, |
1073 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, | 1073 | { "Write back (calendar) entries for time period only","Schreibe nur Kalender Einträge für Zeitspanne zurück" }, |
1074 | { "Time period","Zeitspanne" }, | 1074 | { "Time period","Zeitspanne" }, |
1075 | { "From ","Von " }, | 1075 | { "From ","Von " }, |
1076 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, | 1076 | { " weeks in the past to "," Wochen in der Vergangenheit bis zu " }, |
1077 | { " weeks in the future "," Wochen in der Zukunft " }, | 1077 | { " weeks in the future "," Wochen in der Zukunft " }, |
1078 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, | 1078 | { "Profile kind specific settings","Profil Art abhängige Einstellungen" }, |
1079 | { "Local temp file:","Lokale temp Datei:" }, | 1079 | { "Local temp file:","Lokale temp Datei:" }, |
1080 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, | 1080 | { "Multiple profiles with same name!\nPlease use unique profile names!","Mehrere Profile mit demselben Namen!\nBitte verschiedene Namen benutzen!" }, |
1081 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, | 1081 | { "Aborted! Nothing synced!","Abgebrochen! Nichts wurde gesynct!" }, |
1082 | { "Language","Sprache" }, | 1082 | { "Language","Sprache" }, |
1083 | { "Time Format","Zeit Format" }, | 1083 | { "Time Format","Zeit Format" }, |
1084 | { "Time Zone","Zeit Zone" }, | 1084 | { "Time Zone","Zeit Zone" }, |
1085 | { "%1 groups subscribed","%1 Guppen abboniert" }, | 1085 | { "%1 groups subscribed","%1 Guppen abboniert" }, |
1086 | { "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" }, | 1086 | { "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" }, |
1087 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, | 1087 | { "<b>New data storage dir:</b>","<b>Neues Datenspeicherverzeichnis:</b>" }, |
1088 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, | 1088 | { "New dirs are created automatically","Neue Verzeichnisse werden aut. erstellt" }, |
1089 | { "Save settings","Speichere Einstellungen" }, | 1089 | { "Save settings","Speichere Einstellungen" }, |
1090 | { "Save standard","Speichere Standard" }, | 1090 | { "Save standard","Speichere Standard" }, |
1091 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 1091 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
1092 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, | 1092 | { "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, |
1093 | { "Data storage path","Daten Speicherpfad" }, | 1093 | { "Data storage path","Daten Speicherpfad" }, |
1094 | { "Language","Sprache" }, | 1094 | { "Language","Sprache" }, |
1095 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, | 1095 | { "Show time in agenda items","Zeige Zeit in Agenda Items" }, |
1096 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, | 1096 | { "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, |
1097 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, | 1097 | { "Show events, that are done in \nWhat's Next view","Zeige abgelaufene Termine in\nWhat's Next Ansicht" }, |
1098 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, | 1098 | { "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, |
1099 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, | 1099 | { "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, |
1100 | { "KO/Pi","KO/Pi" }, | 1100 | { "KO/Pi","KO/Pi" }, |
1101 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, | 1101 | { "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, |
1102 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, | 1102 | { "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, |
1103 | { "Sound.Al.: ","Sound.Al.: " }, | 1103 | { "Sound.Al.: ","Sound.Al.: " }, |
1104 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, | 1104 | { "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, |
1105 | { "Restore","Wiederherstellen" }, | 1105 | { "Restore","Wiederherstellen" }, |
1106 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, | 1106 | { "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, |
1107 | { "% completed","% erledigt" }, | 1107 | { "% completed","% erledigt" }, |
1108 | { "%d item(s) found.","%d Item(s) gefunden." }, | 1108 | { "%d item(s) found.","%d Item(s) gefunden." }, |
1109 | { "Set complete","Setze auf erledigt" }, | 1109 | { "Set complete","Setze auf erledigt" }, |
1110 | { "(cancelled)","(gecancelt)" }, | 1110 | { "(cancelled)","(gecancelt)" }, |
1111 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, | 1111 | { "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, |
1112 | { " Local time "," Locale Zeit " }, | 1112 | { " Local time "," Locale Zeit " }, |
1113 | { "Form2","Form2" }, | 1113 | { "Form2","Form2" }, |
1114 | { "Filter enabled","Filter angeschaltet" }, | 1114 | { "Filter enabled","Filter angeschaltet" }, |
1115 | { "Edit Filters","Ändere Filter" }, | 1115 | { "Edit Filters","Ändere Filter" }, |
1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, | 1116 | { "Print What's Next View...","Drucke What's Next Ansicht..." }, |
1117 | { "Agenda","Agenda" }, | 1117 | { "Agenda","Agenda" }, |
1118 | { " ("," (" }, | 1118 | { " ("," (" }, |
1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, | 1119 | { "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, |
1120 | { "Print","Print" }, | 1120 | { "Print","Print" }, |
1121 | { "&Setup Printer...","Drucker &Setup..." }, | 1121 | { "&Setup Printer...","Drucker &Setup..." }, |
1122 | { "View Type","Zeige Typ" }, | 1122 | { "View Type","Zeige Typ" }, |
1123 | { "Page &orientation:","Seiten Ausrichtung:" }, | 1123 | { "Page &orientation:","Seiten Ausrichtung:" }, |
1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, | 1124 | { "Use Default of Selected Style","Default des selektierten Stils" }, |
1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, | 1125 | { "Use Default Setting of Printer","Default Einstellung des Druckers" }, |
1126 | { "Portrait","Portrait" }, | 1126 | { "Portrait","Portrait" }, |
1127 | { "Landscape","Landschaft" }, | 1127 | { "Landscape","Landschaft" }, |
1128 | { "Print day","Drucke Tag" }, | 1128 | { "Print day","Drucke Tag" }, |
1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, | 1129 | { "CalPrintDay_Base","CalPrintDay_Base" }, |
1130 | { "Date && Time Range","Datum && Zeitspanne" }, | 1130 | { "Date && Time Range","Datum && Zeitspanne" }, |
1131 | { "&End date:","&Enddatum:" }, | 1131 | { "&End date:","&Enddatum:" }, |
1132 | { "&Start date:","&Startdatum:" }, | 1132 | { "&Start date:","&Startdatum:" }, |
1133 | { "Start &time:","Startzeit:" }, | 1133 | { "Start &time:","Startzeit:" }, |
1134 | { "End ti&me:","Endzeit:" }, | 1134 | { "End ti&me:","Endzeit:" }, |
1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, | 1135 | { "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, |
1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, | 1136 | { "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, |
1137 | { "Alt+D","Alt+D" }, | 1137 | { "Alt+D","Alt+D" }, |
1138 | { "&Use colors","Nutze Farben" }, | 1138 | { "&Use colors","Nutze Farben" }, |
1139 | { "Alt+U","Alt+U" }, | 1139 | { "Alt+U","Alt+U" }, |
1140 | { "Print week","Drucke Woche" }, | 1140 | { "Print week","Drucke Woche" }, |
1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, | 1141 | { "CalPrintWeek_Base","CalPrintWeek_Base" }, |
1142 | { "Use &colors","Nutze Farben" }, | 1142 | { "Use &colors","Nutze Farben" }, |
1143 | { "Type of View","Typ der Ansicht" }, | 1143 | { "Type of View","Typ der Ansicht" }, |
1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, | 1144 | { "Print as &Filofax page","Drucke als &Filofax Seite" }, |
1145 | { "Alt+F","Alt+F" }, | 1145 | { "Alt+F","Alt+F" }, |
1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, | 1146 | { "Print as &timetable view:","Drucke als Zeittabelle:" }, |
1147 | { "Alt+T","Alt+T" }, | 1147 | { "Alt+T","Alt+T" }, |
1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, | 1148 | { "Print as split week view","Drucke als gesplittete Wochenansicht" }, |
1149 | { "Print month","Drucke Monat" }, | 1149 | { "Print month","Drucke Monat" }, |
1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, | 1150 | { "CalPrintMonth_Base","CalPrintMonth_Base" }, |
1151 | { "&Start month:","&Startmonat:" }, | 1151 | { "&Start month:","&Startmonat:" }, |
1152 | { "&End month:","&Endmonat:" }, | 1152 | { "&End month:","&Endmonat:" }, |
1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, | 1153 | { "Print week &numbers","Drucke Wochen Nummer(n)" }, |
1154 | { "Print todos","Drucke Todos" }, | 1154 | { "Print todos","Drucke Todos" }, |
1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1155 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1156 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1157 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1158 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1159 | { "Items to Print","Zu druckende Items" }, | 1159 | { "Items to Print","Zu druckende Items" }, |
1160 | { "&From:","Von:" }, | 1160 | { "&From:","Von:" }, |
1161 | { "&To:","Bis:" }, | 1161 | { "&To:","Bis:" }, |
1162 | { "Print &all todo items","Drucke alle Todo Items" }, | 1162 | { "Print &all todo items","Drucke alle Todo Items" }, |
1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1163 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1164 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1165 | { "Todo List","Todo Liste" }, | 1165 | { "Todo List","Todo Liste" }, |
1166 | { "&Title:","&Titel:" }, | 1166 | { "&Title:","&Titel:" }, |
1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, | 1167 | { "Co&nnect subtodos with its parent","Verbinde Unter-Todos mit ihren Ober-Todos" }, |
1168 | { "Todo list","Todo Liste" }, | 1168 | { "Todo list","Todo Liste" }, |
1169 | { "&Print...","Drucke..." }, | 1169 | { "&Print...","Drucke..." }, |
1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1170 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1171 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1171 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1172 | { "OK","OK" }, | 1172 | { "OK","OK" }, |
1173 | { "FilterEditor","FilterEditor" }, | 1173 | { "FilterEditor","FilterEditor" }, |
1174 | { "Include","Inclusive" }, | 1174 | { "Include","Inclusive" }, |
1175 | { "Exclude","Exclusive" }, | 1175 | { "Exclude","Exclusive" }, |
1176 | { "Edit Selection...","Editiere Auswahl" }, | 1176 | { "Edit Selection...","Editiere Auswahl" }, |
1177 | { "recurring events","wiederholende Termine" }, | 1177 | { "recurring events","wiederholende Termine" }, |
1178 | { "recurr. events","wiederh.Termine" }, | 1178 | { "recurr. events","wiederh.Termine" }, |
1179 | { "completed to-dos","erledigte Todos" }, | 1179 | { "completed to-dos","erledigte Todos" }, |
1180 | { "events","Termine" }, | 1180 | { "events","Termine" }, |
1181 | { "todos","Todos" }, | 1181 | { "todos","Todos" }, |
1182 | { "journals","Journale" }, | 1182 | { "journals","Journale" }, |
1183 | { "public","öffentl." }, | 1183 | { "public","öffentl." }, |
1184 | { "private","privat" }, | 1184 | { "private","privat" }, |
1185 | { "confidential","vertraul." }, | 1185 | { "confidential","vertraul." }, |
1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, | 1186 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, |
1187 | { "Yesterday","Gestern" }, | 1187 | { "Yesterday","Gestern" }, |
1188 | { "Day after tomorrow","Übermorgen" }, | 1188 | { "Day after tomorrow","Übermorgen" }, |
1189 | { "Tomorrow","Morgen" }, | 1189 | { "Tomorrow","Morgen" }, |
1190 | { "Day before yesterday","Vorgestern" }, | 1190 | { "Day before yesterday","Vorgestern" }, |
1191 | { "Size %1","Größe %1" }, | 1191 | { "Size %1","Größe %1" }, |
1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1192 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1193 | { " (%1 y.)"," (%1 J.)" }, | 1193 | { " (%1 y.)"," (%1 J.)" }, |
1194 | { "Allday:","Ganztägig:" }, | 1194 | { "Allday:","Ganztägig:" }, |
1195 | { "compl.todos","erled.Todos" }, | 1195 | { "compl.todos","erled.Todos" }, |
1196 | { "Day view","Tagesansicht" }, | 1196 | { "Day view","Tagesansicht" }, |
1197 | { "Next days","Nächste Tage" }, | 1197 | { "Next days","Nächste Tage" }, |
1198 | { "Next week","Nächste Woche" }, | 1198 | { "Next week","Nächste Woche" }, |
1199 | { "Next two weeks","Nächste zwei Wochen" }, | 1199 | { "Next two weeks","Nächste zwei Wochen" }, |
1200 | { "Next month","Nächster Monat" }, | 1200 | { "Next month","Nächster Monat" }, |
1201 | { "Journal view","Journal" }, | 1201 | { "Journal view","Journal" }, |
1202 | { "Display all opened","Zeige alle geöffnet" }, | 1202 | { "Display all opened","Zeige alle geöffnet" }, |
1203 | { "Display all closed","Zeige alle geschlossen" }, | 1203 | { "Display all closed","Zeige alle geschlossen" }, |
1204 | { "Display all flat","Zeige alle flach" }, | 1204 | { "Display all flat","Zeige alle flach" }, |
1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1205 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1206 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, | 1207 | { "Select week %1-%2","Wähle Woche %1-%2" }, |
1208 | { "Select Week","Wähle Woche" }, | 1208 | { "Select Week","Wähle Woche" }, |
1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, | 1209 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, |
1210 | { "Set Alarm!","Setze Alarm!" }, | 1210 | { "Set Alarm!","Setze Alarm!" }, |
1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1211 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1212 | { " and "," und " }, | 1212 | { " and "," und " }, |
1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | 1213 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, |
1214 | { "Mail to selected","Mail an Ausgewählte" }, | 1214 | { "Mail to selected","Mail an Ausgewählte" }, |
1215 | { "Mail to all","Mail an Alle" }, | 1215 | { "Mail to all","Mail an Alle" }, |
1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1216 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1217 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1218 | { " on"," am" }, | 1218 | { " on"," am" }, |
1219 | { " completed on "," erledigt am " }, | 1219 | { " completed on "," erledigt am " }, |
1220 | { "Save as Event template","Speichere als Vorlage" }, | 1220 | { "Save as Event template","Speichere als Vorlage" }, |
1221 | { "Load Event template","Lade Termin Vorlage" }, | 1221 | { "Load Event template","Lade Termin Vorlage" }, |
1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, | 1222 | { "Save as Journal template","Speichere als Journal Vorlage" }, |
1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, | 1223 | { "Insert Journal template","Füge Journal Vorlage ein" }, |
1224 | { "Sub todos:<br>","Unter Todos:<br>" }, | 1224 | { "Sub todos:<br>","Unter Todos:<br>" }, |
1225 | { "Parent todo:<br>","Über Todo:<br>" }, | 1225 | { "Parent todo:<br>","Über Todo:<br>" }, |
1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, | 1226 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, |
1227 | { " completed"," erledigt" }, | 1227 | { " completed"," erledigt" }, |
1228 | { "(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!" }, | 1228 | { "(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!" }, |
1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 1229 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 1230 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 1231 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
1232 | { "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?" }, | 1232 | { "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?" }, |
1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 1233 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
1234 | { "Error","Fehler" }, | 1234 | { "Error","Fehler" }, |
1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 1235 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 1236 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
1237 | { "Warning","Warnung" }, | 1237 | { "Warning","Warnung" }, |
1238 | { "Select week number","Wähle Wochen Nummer" }, | 1238 | { "Select week number","Wähle Wochen Nummer" }, |
1239 | { "Februar","Februar" }, | 1239 | { "Februar","Februar" }, |
1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, | 1240 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, |
1241 | { "W","W" }, | 1241 | { "W","W" }, |
1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, | 1242 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, |
1243 | { "T: %1","T: %1" }, | 1243 | { "T: %1","T: %1" }, |
1244 | { "Start: ","Start: " }, | 1244 | { "Start: ","Start: " }, |
1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 1245 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 1246 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
1247 | { "Remote IP address:","Ferne IP Adresse:" }, | 1247 | { "Remote IP address:","Ferne IP Adresse:" }, |
1248 | { "Remote port number:","Ferne Port Nummer:" }, | 1248 | { "Remote port number:","Ferne Port Nummer:" }, |
1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 1249 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
1250 | { "Remote from: ","Fern von: " }, | 1250 | { "Remote from: ","Fern von: " }, |
1251 | { "Local from: ","Lokal von: " }, | 1251 | { "Local from: ","Lokal von: " }, |
1252 | { "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" }, | 1252 | { "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" }, |
1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 1253 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
1254 | { "Write back","Schreibe zurück" }, | 1254 | { "Write back","Schreibe zurück" }, |
1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1255 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1256 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1257 | { "Received sync request","Sync Anfrage erhalten" }, | 1257 | { "Received sync request","Sync Anfrage erhalten" }, |
1258 | { "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." }, | 1258 | { "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." }, |
1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1259 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1260 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1261 | { "Sending file...","Sende Datei..." }, | 1261 | { "Sending file...","Sende Datei..." }, |
1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1262 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1263 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1264 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1264 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1265 | { "Writing file to disk...","Speichere Datei..." }, | 1265 | { "Writing file to disk...","Speichere Datei..." }, |
1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1266 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1267 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1268 | { "Synchronize!","Synchronisiere!" }, | 1268 | { "Synchronize!","Synchronisiere!" }, |
1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1269 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1270 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1271 | { "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!" }, | 1271 | { "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!" }, |
1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1272 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1273 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1274 | { "List week view","Listenwochenansicht" }, | 1274 | { "List week view","Listenwochenansicht" }, |
1275 | { "List week","Listenwochenansicht" }, | 1275 | { "List week","Listenwochenansicht" }, |
1276 | { "Next Week","Nächste Woche" }, | 1276 | { "Next Week","Nächste Woche" }, |
1277 | { "Previous Week","Vorherige Woche" }, | 1277 | { "Previous Week","Vorherige Woche" }, |
1278 | { "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." }, | 1278 | { "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." }, |
1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, | 1279 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, |
1280 | { "Details","Details" }, | 1280 | { "Details","Details" }, |
1281 | { "Created time","Erstellt Zeit" }, | 1281 | { "Created time","Erstellt Zeit" }, |
1282 | { "Last modified time","Geändert Zeit" }, | 1282 | { "Last modified time","Geändert Zeit" }, |
1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, | 1283 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, |
1284 | { "View Options","Anzeige Optionen" }, | 1284 | { "View Options","Anzeige Optionen" }, |
1285 | { "<b>Created: ","<b>Erstellt am: " }, | 1285 | { "<b>Created: ","<b>Erstellt am: " }, |
1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, | 1286 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, |
1287 | { "Journal: ","Journal: " }, | 1287 | { "Journal: ","Journal: " }, |
1288 | { "yearly","jährlich" }, | 1288 | { "yearly","jährlich" }, |
1289 | { "(%1) ","%1-" }, | 1289 | { "(%1) ","%1-" }, |
1290 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, | 1290 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, |
1291 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, | 1291 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, |
1292 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, | 1292 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, |
1293 | { "Summary/Loc.","Titel/Ort" }, | 1293 | { "Summary/Loc.","Titel/Ort" }, |
1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, | 1294 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, |
1295 | { "Week Number","Wochennummer" }, | 1295 | { "Week Number","Wochennummer" }, |
1296 | { "Import","Importiere" }, | 1296 | { "Import","Importiere" }, |
1297 | { "Export","Exportiere" }, | 1297 | { "Export","Exportiere" }, |
1298 | { "Beam","Beame" }, | 1298 | { "Beam","Beame" }, |
1299 | { "Export selected","Exportiere Selektierte" }, | 1299 | { "Export selected","Exportiere Selektierte" }, |
1300 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, | 1300 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, |
1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, | 1301 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, |
1302 | { "Journal/Details...","Journale/Details..." }, | 1302 | { "Journal/Details...","Journale/Details..." }, |
1303 | { "Agenda View","Agenda Ansicht" }, | 1303 | { "Agenda View","Agenda Ansicht" }, |
1304 | { "Show current time","Zeige aktuelle Zeit" }, | 1304 | { "Show current time","Zeige aktuelle Zeit" }, |
1305 | { "Edit new item","Bearbeite neuen Eintrag" }, | 1305 | { "Edit new item","Bearbeite neuen Eintrag" }, |
1306 | { "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" }, | 1306 | { "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" }, |
1307 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, | 1307 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, |
1308 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, | 1308 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, |
1309 | { "The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)","Der nächste Alarm in am:\n%1\num: %2\n\n%3\n(%4)" }, | 1309 | { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, |
1310 | { "%1 days\n","%1 Tagen\n" }, | ||
1311 | { "1 day\n","1 Tag\n" }, | ||
1312 | { "%1 hours\n","%1 Stunden\n" }, | ||
1313 | { "1 hour\n","1 Stunde\n" }, | ||
1314 | { "%1 minutes\n","%1 Minuten\n" }, | ||
1315 | { "1 minute\n","1 Minute\n" }, | ||
1310 | { "","" }, | 1316 | { "","" }, |
1311 | { "","" }, | 1317 | { "","" }, |
1312 | { "","" }, | 1318 | { "","" }, |
1313 | { "","" }, | 1319 | { "","" }, |
1314 | { "","" }, | 1320 | { "","" }, |
1315 | { "","" }, | 1321 | { "","" }, |
1316 | \ No newline at end of file | 1322 | { "","" }, |
1323 | { "","" }, | ||
1324 | { "","" }, | ||
1325 | { "","" }, \ No newline at end of file | ||
diff --git a/kalarmd/alarmdialog.cpp b/kalarmd/alarmdialog.cpp index 7ead3b9..7b888ab 100644 --- a/kalarmd/alarmdialog.cpp +++ b/kalarmd/alarmdialog.cpp | |||
@@ -1,312 +1,316 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the KDE alarm daemon. | 2 | This file is part of the KDE alarm daemon. |
3 | Copyright (c) 2000 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000 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 | // $Id$ | 24 | // $Id$ |
25 | 25 | ||
26 | #include <qhbox.h> | 26 | #include <qhbox.h> |
27 | #include <qvbox.h> | 27 | #include <qvbox.h> |
28 | #include <qapp.h> | 28 | #include <qapp.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtimer.h> | 32 | #include <qtimer.h> |
33 | #include <qsound.h> | 33 | #include <qsound.h> |
34 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
35 | #ifndef DESKTOP_VERSION | ||
35 | #define protected public | 36 | #define protected public |
36 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
37 | #undef protected | 38 | #undef protected |
39 | #else | ||
40 | #include <qspinbox.h> | ||
41 | #endif | ||
38 | #include <stdlib.h> | 42 | #include <stdlib.h> |
39 | #ifndef _WIN32_ | 43 | #ifndef _WIN32_ |
40 | #include <unistd.h> | 44 | #include <unistd.h> |
41 | #include <sys/ioctl.h> | 45 | #include <sys/ioctl.h> |
42 | #endif | 46 | #endif |
43 | #include <stdio.h> | 47 | #include <stdio.h> |
44 | #include <fcntl.h> | 48 | #include <fcntl.h> |
45 | 49 | ||
46 | #ifndef DESKTOP_VERSION | 50 | #ifndef DESKTOP_VERSION |
47 | #include <qtopia/alarmserver.h> | 51 | #include <qtopia/alarmserver.h> |
48 | #include <qpe/resource.h> | 52 | #include <qpe/resource.h> |
49 | #include <qtopia/sound.h> | 53 | #include <qtopia/sound.h> |
50 | 54 | ||
51 | #endif | 55 | #endif |
52 | 56 | ||
53 | #include "alarmdialog.h" | 57 | #include "alarmdialog.h" |
54 | 58 | ||
55 | 59 | ||
56 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) | 60 | AlarmDialog::AlarmDialog(QWidget *parent,const char *name) |
57 | : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) | 61 | : QDialog (parent, name, true, Qt::WStyle_StaysOnTop ) |
58 | { | 62 | { |
59 | setCaption( "KO/Pi Alarm!" ); | 63 | setCaption( "KO/Pi Alarm!" ); |
60 | QVBoxLayout* layout = new QVBoxLayout( this); | 64 | QVBoxLayout* layout = new QVBoxLayout( this); |
61 | QLabel* l = new QLabel("The following event triggered alarm:",this); | 65 | QLabel* l = new QLabel("The following event triggered alarm:",this); |
62 | layout->addWidget ( l ); | 66 | layout->addWidget ( l ); |
63 | l->setAlignment( AlignCenter); | 67 | l->setAlignment( AlignCenter); |
64 | mMessage = new QLabel ( " ", this ); | 68 | mMessage = new QLabel ( " ", this ); |
65 | int fs = 18; | 69 | int fs = 18; |
66 | int fs2 = 12; | 70 | int fs2 = 12; |
67 | if ( QApplication::desktop()->width() < 480 ) { | 71 | if ( QApplication::desktop()->width() < 480 ) { |
68 | setMaximumSize(220, 260); | 72 | setMaximumSize(220, 260); |
69 | fs2 = 10; | 73 | fs2 = 10; |
70 | } | 74 | } |
71 | else { | 75 | else { |
72 | setMaximumSize(440, 440); | 76 | setMaximumSize(440, 440); |
73 | } | 77 | } |
74 | layout->setSpacing( 3 ); | 78 | layout->setSpacing( 3 ); |
75 | layout->setMargin( 3 ); | 79 | layout->setMargin( 3 ); |
76 | QFont fo = QApplication::font(); | 80 | QFont fo = QApplication::font(); |
77 | fo.setBold( true ); | 81 | fo.setBold( true ); |
78 | fo.setPointSize( fs2 ); | 82 | fo.setPointSize( fs2 ); |
79 | l->setFont( fo ); | 83 | l->setFont( fo ); |
80 | fo.setPointSize( fs ); | 84 | fo.setPointSize( fs ); |
81 | mMessage->setFont(fo ); | 85 | mMessage->setFont(fo ); |
82 | mMessage->setAlignment( AlignCenter); | 86 | mMessage->setAlignment( AlignCenter); |
83 | layout->addWidget ( mMessage ); | 87 | layout->addWidget ( mMessage ); |
84 | mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); | 88 | mMissedAlarms= new QLabel ( "(No missed Alarms)", this ); |
85 | mMissedAlarms->setAlignment( AlignCenter); | 89 | mMissedAlarms->setAlignment( AlignCenter); |
86 | 90 | ||
87 | playSoundTimer = new QTimer( this ); | 91 | playSoundTimer = new QTimer( this ); |
88 | connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); | 92 | connect ( playSoundTimer, SIGNAL( timeout() ), this, SLOT (playSound() ) ); |
89 | 93 | ||
90 | playSoundTimer->stop(); | 94 | playSoundTimer->stop(); |
91 | 95 | ||
92 | layout->addWidget ( mMissedAlarms ); | 96 | layout->addWidget ( mMissedAlarms ); |
93 | mMissedAlarmsCombo = new QComboBox ( this ); | 97 | mMissedAlarmsCombo = new QComboBox ( this ); |
94 | layout->addWidget ( mMissedAlarmsCombo ); | 98 | layout->addWidget ( mMissedAlarmsCombo ); |
95 | 99 | ||
96 | QLabel* labb = new QLabel("Suspend duration (minutes):",this); | 100 | QLabel* labb = new QLabel("Suspend duration (minutes):",this); |
97 | labb->setAlignment(AlignCenter); | 101 | labb->setAlignment(AlignCenter); |
98 | layout->addWidget ( labb ); | 102 | layout->addWidget ( labb ); |
99 | fo = font(); | 103 | fo = font(); |
100 | int pointSize = 36; | 104 | int pointSize = 36; |
101 | if ( QApplication::desktop()->width() <= 320 ) | 105 | if ( QApplication::desktop()->width() <= 320 ) |
102 | pointSize = 24; | 106 | pointSize = 24; |
103 | fo.setPointSize( pointSize ); | 107 | fo.setPointSize( pointSize ); |
104 | mSuspendSpin = new QSpinBox(1,1440,1,this); | 108 | mSuspendSpin = new QSpinBox(1,1440,1,this); |
105 | mSuspendSpin->setFont( fo ); | 109 | mSuspendSpin->setFont( fo ); |
106 | mSuspendSpin->setValue(7); // default suspend duration | 110 | mSuspendSpin->setValue(7); // default suspend duration |
107 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); | 111 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); |
108 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); | 112 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); |
109 | #if QT_VERSION < 0x030000 | 113 | #if QT_VERSION < 0x030000 |
110 | mSuspendSpin->upButton ()->setFixedSize( QSize( 48, 30 )); | 114 | mSuspendSpin->upButton ()->setFixedSize( QSize( 48, 30 )); |
111 | mSuspendSpin->downButton ()->setFixedSize( QSize( 48, 30 )); | 115 | mSuspendSpin->downButton ()->setFixedSize( QSize( 48, 30 )); |
112 | #endif | 116 | #endif |
113 | mSuspendSpin->setFixedSize( 100,62 ); | 117 | mSuspendSpin->setFixedSize( 100,62 ); |
114 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); | 118 | mSuspendSpin->setButtonSymbols( QSpinBox::PlusMinus ); |
115 | QHBoxLayout* layoutSpin = new QHBoxLayout( layout ); | 119 | QHBoxLayout* layoutSpin = new QHBoxLayout( layout ); |
116 | layoutSpin->addStretch (); | 120 | layoutSpin->addStretch (); |
117 | layoutSpin->addWidget ( mSuspendSpin ); | 121 | layoutSpin->addWidget ( mSuspendSpin ); |
118 | layoutSpin->addStretch (); | 122 | layoutSpin->addStretch (); |
119 | 123 | ||
120 | QVBox * bbox = new QVBox ( this ); | 124 | QVBox * bbox = new QVBox ( this ); |
121 | layout->addWidget ( bbox ); | 125 | layout->addWidget ( bbox ); |
122 | bbox->layout()->setSpacing( 2 ); | 126 | bbox->layout()->setSpacing( 2 ); |
123 | labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox); | 127 | labb = new QLabel("Press \"Cancel\" or \"Esc\" to suspend!",bbox); |
124 | labb->setAlignment(AlignCenter); | 128 | labb->setAlignment(AlignCenter); |
125 | mSuspendButton = new QPushButton( "Suspend", bbox); | 129 | mSuspendButton = new QPushButton( "Suspend", bbox); |
126 | QPushButton* silen = new QPushButton( " Stop sound ", bbox); | 130 | QPushButton* silen = new QPushButton( " Stop sound ", bbox); |
127 | QPushButton* okbut = new QPushButton( "Ok", bbox); | 131 | QPushButton* okbut = new QPushButton( "Ok", bbox); |
128 | mSuspendButton->setFont( fo ); | 132 | mSuspendButton->setFont( fo ); |
129 | silen->setFont( fo ); | 133 | silen->setFont( fo ); |
130 | okbut->setFont( fo ); | 134 | okbut->setFont( fo ); |
131 | okbut->setDefault( true ); | 135 | okbut->setDefault( true ); |
132 | connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); | 136 | connect (silen , SIGNAL( clicked() ), this, SLOT (silent() ) ); |
133 | connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); | 137 | connect (mSuspendButton, SIGNAL( clicked() ), this, SLOT (slotSuspend() ) ); |
134 | connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); | 138 | connect (okbut , SIGNAL( clicked() ), this, SLOT (slotOk() ) ); |
135 | #ifndef _WIN32_ | 139 | #ifndef _WIN32_ |
136 | if ( QFile::exists ( "/dev/sharp_led" ) ) | 140 | if ( QFile::exists ( "/dev/sharp_led" ) ) |
137 | fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); | 141 | fd_led = open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); |
138 | else | 142 | else |
139 | #endif | 143 | #endif |
140 | fd_led = 0; | 144 | fd_led = 0; |
141 | statusLED.which = SHARP_LED_SALARM; | 145 | statusLED.which = SHARP_LED_SALARM; |
142 | mSilent = false; | 146 | mSilent = false; |
143 | mSuspendCounter = 0; | 147 | mSuspendCounter = 0; |
144 | setServerNotification( true ); | 148 | setServerNotification( true ); |
145 | } | 149 | } |
146 | void AlarmDialog::reject () | 150 | void AlarmDialog::reject () |
147 | { | 151 | { |
148 | QTimer::singleShot ( 3000, this, SLOT (suspend()) ); | 152 | QTimer::singleShot ( 3000, this, SLOT (suspend()) ); |
149 | slotSuspend(); | 153 | slotSuspend(); |
150 | } | 154 | } |
151 | AlarmDialog::~AlarmDialog() | 155 | AlarmDialog::~AlarmDialog() |
152 | { | 156 | { |
153 | } | 157 | } |
154 | void AlarmDialog::silent () | 158 | void AlarmDialog::silent () |
155 | { | 159 | { |
156 | mSilent = true; | 160 | mSilent = true; |
157 | } | 161 | } |
158 | void AlarmDialog::accept() | 162 | void AlarmDialog::accept() |
159 | { | 163 | { |
160 | slotOk(); | 164 | slotOk(); |
161 | } | 165 | } |
162 | 166 | ||
163 | void AlarmDialog::suspend() | 167 | void AlarmDialog::suspend() |
164 | { | 168 | { |
165 | #ifdef DESKTOP_VERSION | 169 | #ifdef DESKTOP_VERSION |
166 | 170 | ||
167 | #else | 171 | #else |
168 | Sound::soundAlarm (); | 172 | Sound::soundAlarm (); |
169 | #endif | 173 | #endif |
170 | } | 174 | } |
171 | void AlarmDialog::slotOk() | 175 | void AlarmDialog::slotOk() |
172 | { | 176 | { |
173 | mStopAlarm = true; | 177 | mStopAlarm = true; |
174 | mMissedAlarms->setText("(No missed Alarms)"); | 178 | mMissedAlarms->setText("(No missed Alarms)"); |
175 | mMessage->setText(""); | 179 | mMessage->setText(""); |
176 | mMissedAlarmsCombo->clear(); | 180 | mMissedAlarmsCombo->clear(); |
177 | #ifndef _WIN32_ | 181 | #ifndef _WIN32_ |
178 | if ( fd_led > 0 ) { | 182 | if ( fd_led > 0 ) { |
179 | statusLED.status = LED_SALARM_OFF ; | 183 | statusLED.status = LED_SALARM_OFF ; |
180 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); | 184 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); |
181 | } | 185 | } |
182 | #endif | 186 | #endif |
183 | QDialog::accept(); | 187 | QDialog::accept(); |
184 | } | 188 | } |
185 | 189 | ||
186 | void AlarmDialog::slotSuspend() | 190 | void AlarmDialog::slotSuspend() |
187 | { | 191 | { |
188 | //qDebug("AlarmDialog::suspend() "); // emit suspendSignal(mSuspendSpin->value()); | 192 | //qDebug("AlarmDialog::suspend() "); // emit suspendSignal(mSuspendSpin->value()); |
189 | mStopAlarm = true; | 193 | mStopAlarm = true; |
190 | QDateTime nextA = QDateTime::currentDateTime().addSecs( mSuspendSpin->value() * 60 ); | 194 | QDateTime nextA = QDateTime::currentDateTime().addSecs( mSuspendSpin->value() * 60 ); |
191 | QString mess = "suspend_alarm" +mFileName+"+++" ; | 195 | QString mess = "suspend_alarm" +mFileName+"+++" ; |
192 | if ( mMessage->text().left( 10 ) !="Suspended:" ) | 196 | if ( mMessage->text().left( 10 ) !="Suspended:" ) |
193 | mess += "Suspended:\n"; | 197 | mess += "Suspended:\n"; |
194 | mess +=mMessage->text(); | 198 | mess +=mMessage->text(); |
195 | #ifndef DESKTOP_VERSION | 199 | #ifndef DESKTOP_VERSION |
196 | if ( mServerNotification ) | 200 | if ( mServerNotification ) |
197 | AlarmServer::addAlarm ( nextA,"koalarm",mess.latin1()); | 201 | AlarmServer::addAlarm ( nextA,"koalarm",mess.latin1()); |
198 | #endif | 202 | #endif |
199 | emit addAlarm( nextA , mess ); | 203 | emit addAlarm( nextA , mess ); |
200 | slotOk(); | 204 | slotOk(); |
201 | } | 205 | } |
202 | 206 | ||
203 | void AlarmDialog::setServerNotification( bool b ) | 207 | void AlarmDialog::setServerNotification( bool b ) |
204 | { | 208 | { |
205 | mServerNotification = b; | 209 | mServerNotification = b; |
206 | } | 210 | } |
207 | int AlarmDialog::getSuspendTime( ) | 211 | int AlarmDialog::getSuspendTime( ) |
208 | { | 212 | { |
209 | return mSuspendSpin->value(); | 213 | return mSuspendSpin->value(); |
210 | 214 | ||
211 | } | 215 | } |
212 | void AlarmDialog::setSuspendTime( int val ) | 216 | void AlarmDialog::setSuspendTime( int val ) |
213 | { | 217 | { |
214 | mSuspendSpin->setValue( val ); | 218 | mSuspendSpin->setValue( val ); |
215 | } | 219 | } |
216 | bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, bool playwav, int pause , int suspendtimes) | 220 | bool AlarmDialog::eventNotification( QString mess, int replay , QString fn, bool playwav, int pause , int suspendtimes) |
217 | { | 221 | { |
218 | if ( mess.left( 9) != "Suspended" ) | 222 | if ( mess.left( 9) != "Suspended" ) |
219 | mSuspendCounter = suspendtimes; | 223 | mSuspendCounter = suspendtimes; |
220 | mPauseCount = pause; | 224 | mPauseCount = pause; |
221 | mFileName = fn; | 225 | mFileName = fn; |
222 | mPlayWav = playwav; | 226 | mPlayWav = playwav; |
223 | if ( !QFile::exists( fn ) ) | 227 | if ( !QFile::exists( fn ) ) |
224 | mFileName = ""; | 228 | mFileName = ""; |
225 | alarmCounter = 0 ; | 229 | alarmCounter = 0 ; |
226 | maxAlarmReplay = replay ; | 230 | maxAlarmReplay = replay ; |
227 | mStopAlarm = false; | 231 | mStopAlarm = false; |
228 | mSilent = false; | 232 | mSilent = false; |
229 | if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { | 233 | if ( !mMessage->text().stripWhiteSpace().isEmpty() ) { |
230 | mMissedAlarmsCombo->show(); | 234 | mMissedAlarmsCombo->show(); |
231 | mMissedAlarmsCombo->insertItem( mMessage->text().stripWhiteSpace() ); | 235 | mMissedAlarmsCombo->insertItem( mMessage->text().stripWhiteSpace() ); |
232 | mMissedAlarms->setText( "Missed alarms:"); | 236 | mMissedAlarms->setText( "Missed alarms:"); |
233 | } else | 237 | } else |
234 | mMissedAlarmsCombo->hide(); | 238 | mMissedAlarmsCombo->hide(); |
235 | mMessage->setText(mess); | 239 | mMessage->setText(mess); |
236 | int w =sizeHint().width() ; | 240 | int w =sizeHint().width() ; |
237 | int h = sizeHint().height() ; | 241 | int h = sizeHint().height() ; |
238 | int dw = QApplication::desktop()->width(); | 242 | int dw = QApplication::desktop()->width(); |
239 | int dh = QApplication::desktop()->height(); | 243 | int dh = QApplication::desktop()->height(); |
240 | setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 244 | setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
241 | show(); | 245 | show(); |
242 | raise(); | 246 | raise(); |
243 | qApp->processEvents(); | 247 | qApp->processEvents(); |
244 | repaint(); | 248 | repaint(); |
245 | qApp->processEvents(); | 249 | qApp->processEvents(); |
246 | 250 | ||
247 | #ifndef _WIN32_ | 251 | #ifndef _WIN32_ |
248 | if ( fd_led > 0 ) { | 252 | if ( fd_led > 0 ) { |
249 | statusLED.status = LED_SALARM_ON ; | 253 | statusLED.status = LED_SALARM_ON ; |
250 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); | 254 | ioctl (fd_led, SHARP_LED_SETSTATUS, &statusLED); |
251 | } | 255 | } |
252 | #endif | 256 | #endif |
253 | playSoundTimer->start( 1000, true ); | 257 | playSoundTimer->start( 1000, true ); |
254 | return true; | 258 | return true; |
255 | 259 | ||
256 | } | 260 | } |
257 | 261 | ||
258 | 262 | ||
259 | void AlarmDialog::playSound () | 263 | void AlarmDialog::playSound () |
260 | { | 264 | { |
261 | if (mStopAlarm ) | 265 | if (mStopAlarm ) |
262 | return; | 266 | return; |
263 | showNormal(); | 267 | showNormal(); |
264 | setActiveWindow(); | 268 | setActiveWindow(); |
265 | mSuspendSpin->setFocus(); | 269 | mSuspendSpin->setFocus(); |
266 | raise(); | 270 | raise(); |
267 | 271 | ||
268 | qApp->processEvents(); | 272 | qApp->processEvents(); |
269 | if ( alarmCounter < maxAlarmReplay && ! mSilent) { | 273 | if ( alarmCounter < maxAlarmReplay && ! mSilent) { |
270 | ++alarmCounter; | 274 | ++alarmCounter; |
271 | #ifdef DESKTOP_VERSION | 275 | #ifdef DESKTOP_VERSION |
272 | mPlayWav = true; | 276 | mPlayWav = true; |
273 | #endif | 277 | #endif |
274 | if ( !mPlayWav || mFileName.length() < 2 ) { | 278 | if ( !mPlayWav || mFileName.length() < 2 ) { |
275 | 279 | ||
276 | #ifdef DESKTOP_VERSION | 280 | #ifdef DESKTOP_VERSION |
277 | qDebug("Sound play not possible - file not found"); | 281 | qDebug("Sound play not possible - file not found"); |
278 | #else | 282 | #else |
279 | Sound::soundAlarm (); | 283 | Sound::soundAlarm (); |
280 | #endif | 284 | #endif |
281 | } else | 285 | } else |
282 | 286 | ||
283 | { | 287 | { |
284 | #ifdef DESKTOP_VERSION | 288 | #ifdef DESKTOP_VERSION |
285 | #ifdef _WIN32_ | 289 | #ifdef _WIN32_ |
286 | QSound::play ( mFileName ); | 290 | QSound::play ( mFileName ); |
287 | #else | 291 | #else |
288 | 292 | ||
289 | QString command = "playwave -r 22050 " + mFileName; | 293 | QString command = "playwave -r 22050 " + mFileName; |
290 | qDebug("KO: Playing file %s with 22kHz",mFileName.latin1() ); | 294 | qDebug("KO: Playing file %s with 22kHz",mFileName.latin1() ); |
291 | int ret = system ( command.latin1() ); | 295 | int ret = system ( command.latin1() ); |
292 | if ( ret != 0 ) { | 296 | if ( ret != 0 ) { |
293 | qDebug("Sound play command failed: %s ",command.latin1() ); | 297 | qDebug("Sound play command failed: %s ",command.latin1() ); |
294 | } | 298 | } |
295 | 299 | ||
296 | #endif | 300 | #endif |
297 | 301 | ||
298 | #else | 302 | #else |
299 | QSound::play ( mFileName ); | 303 | QSound::play ( mFileName ); |
300 | #endif | 304 | #endif |
301 | //qDebug("BEEP!"); | 305 | //qDebug("BEEP!"); |
302 | } | 306 | } |
303 | } else { | 307 | } else { |
304 | if ( ! mSilent && mSuspendCounter > 0 ) { | 308 | if ( ! mSilent && mSuspendCounter > 0 ) { |
305 | --mSuspendCounter; | 309 | --mSuspendCounter; |
306 | reject (); | 310 | reject (); |
307 | hide(); | 311 | hide(); |
308 | return; | 312 | return; |
309 | } | 313 | } |
310 | } | 314 | } |
311 | playSoundTimer->start( mPauseCount * 1000, true ); | 315 | playSoundTimer->start( mPauseCount * 1000, true ); |
312 | } | 316 | } |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 73aa733..a330414 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1000,3083 +1000,3105 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1000 | fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); | 1000 | fullDateRange = ( eventLSync->dtStart() <= mLastCalendarSync && eventLSync->dtStart().addSecs(1) >= mLastCalendarSync ); |
1001 | } | 1001 | } |
1002 | if ( fullDateRange ) | 1002 | if ( fullDateRange ) |
1003 | mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); | 1003 | mLastCalendarSync = QDateTime::currentDateTime().addDays( -100*365); |
1004 | else | 1004 | else |
1005 | mLastCalendarSync = eventLSync->dtStart(); | 1005 | mLastCalendarSync = eventLSync->dtStart(); |
1006 | // for resyncing if own file has changed | 1006 | // for resyncing if own file has changed |
1007 | if ( mCurrentSyncDevice == "deleteaftersync" ) { | 1007 | if ( mCurrentSyncDevice == "deleteaftersync" ) { |
1008 | mLastCalendarSync = loadedFileVersion; | 1008 | mLastCalendarSync = loadedFileVersion; |
1009 | //qDebug("setting mLastCalendarSync "); | 1009 | //qDebug("setting mLastCalendarSync "); |
1010 | } | 1010 | } |
1011 | //qDebug("*************************** "); | 1011 | //qDebug("*************************** "); |
1012 | qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); | 1012 | qDebug("KO: mLastCalendarSync %s .Full: %d",mLastCalendarSync.toString().latin1(), fullDateRange); |
1013 | QPtrList<Incidence> er = remote->rawIncidences(); | 1013 | QPtrList<Incidence> er = remote->rawIncidences(); |
1014 | Incidence* inR = er.first(); | 1014 | Incidence* inR = er.first(); |
1015 | Incidence* inL; | 1015 | Incidence* inL; |
1016 | QProgressBar bar( er.count(),0 ); | 1016 | QProgressBar bar( er.count(),0 ); |
1017 | bar.setCaption (i18n("Syncing - close to abort!") ); | 1017 | bar.setCaption (i18n("Syncing - close to abort!") ); |
1018 | 1018 | ||
1019 | // ************** setting up filter ************* | 1019 | // ************** setting up filter ************* |
1020 | CalFilter *filterIN = 0; | 1020 | CalFilter *filterIN = 0; |
1021 | CalFilter *filterOUT = 0; | 1021 | CalFilter *filterOUT = 0; |
1022 | CalFilter *filter = mFilters.first(); | 1022 | CalFilter *filter = mFilters.first(); |
1023 | while(filter) { | 1023 | while(filter) { |
1024 | if ( filter->name() == mSyncManager->mFilterInCal ) | 1024 | if ( filter->name() == mSyncManager->mFilterInCal ) |
1025 | filterIN = filter; | 1025 | filterIN = filter; |
1026 | if ( filter->name() == mSyncManager->mFilterOutCal ) | 1026 | if ( filter->name() == mSyncManager->mFilterOutCal ) |
1027 | filterOUT = filter; | 1027 | filterOUT = filter; |
1028 | filter = mFilters.next(); | 1028 | filter = mFilters.next(); |
1029 | } | 1029 | } |
1030 | int w = 300; | 1030 | int w = 300; |
1031 | if ( QApplication::desktop()->width() < 320 ) | 1031 | if ( QApplication::desktop()->width() < 320 ) |
1032 | w = 220; | 1032 | w = 220; |
1033 | int h = bar.sizeHint().height() ; | 1033 | int h = bar.sizeHint().height() ; |
1034 | int dw = QApplication::desktop()->width(); | 1034 | int dw = QApplication::desktop()->width(); |
1035 | int dh = QApplication::desktop()->height(); | 1035 | int dh = QApplication::desktop()->height(); |
1036 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1036 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1037 | bar.show(); | 1037 | bar.show(); |
1038 | int modulo = (er.count()/10)+1; | 1038 | int modulo = (er.count()/10)+1; |
1039 | int incCounter = 0; | 1039 | int incCounter = 0; |
1040 | while ( inR ) { | 1040 | while ( inR ) { |
1041 | if ( ! bar.isVisible() ) | 1041 | if ( ! bar.isVisible() ) |
1042 | return false; | 1042 | return false; |
1043 | if ( incCounter % modulo == 0 ) | 1043 | if ( incCounter % modulo == 0 ) |
1044 | bar.setProgress( incCounter ); | 1044 | bar.setProgress( incCounter ); |
1045 | ++incCounter; | 1045 | ++incCounter; |
1046 | uid = inR->uid(); | 1046 | uid = inR->uid(); |
1047 | bool skipIncidence = false; | 1047 | bool skipIncidence = false; |
1048 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1048 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1049 | skipIncidence = true; | 1049 | skipIncidence = true; |
1050 | QString idS; | 1050 | QString idS; |
1051 | qApp->processEvents(); | 1051 | qApp->processEvents(); |
1052 | if ( !skipIncidence ) { | 1052 | if ( !skipIncidence ) { |
1053 | inL = local->incidence( uid ); | 1053 | inL = local->incidence( uid ); |
1054 | if ( inL ) { // maybe conflict - same uid in both calendars | 1054 | if ( inL ) { // maybe conflict - same uid in both calendars |
1055 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { | 1055 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { |
1056 | //qDebug("take %d %s ", take, inL->summary().latin1()); | 1056 | //qDebug("take %d %s ", take, inL->summary().latin1()); |
1057 | if ( take == 3 ) | 1057 | if ( take == 3 ) |
1058 | return false; | 1058 | return false; |
1059 | if ( take == 1 ) {// take local ********************** | 1059 | if ( take == 1 ) {// take local ********************** |
1060 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 1060 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
1061 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1061 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1062 | else | 1062 | else |
1063 | idS = inR->IDStr(); | 1063 | idS = inR->IDStr(); |
1064 | remote->deleteIncidence( inR ); | 1064 | remote->deleteIncidence( inR ); |
1065 | inR = inL->clone(); | 1065 | inR = inL->clone(); |
1066 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1066 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
1067 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) | 1067 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) |
1068 | inR->setIDStr( idS ); | 1068 | inR->setIDStr( idS ); |
1069 | remote->addIncidence( inR ); | 1069 | remote->addIncidence( inR ); |
1070 | if ( mSyncManager->syncWithDesktop() ) | 1070 | if ( mSyncManager->syncWithDesktop() ) |
1071 | inR->setPilotId( 2 ); | 1071 | inR->setPilotId( 2 ); |
1072 | ++changedRemote; | 1072 | ++changedRemote; |
1073 | } else {// take remote ********************** | 1073 | } else {// take remote ********************** |
1074 | idS = inL->IDStr(); | 1074 | idS = inL->IDStr(); |
1075 | int pid = inL->pilotId(); | 1075 | int pid = inL->pilotId(); |
1076 | local->deleteIncidence( inL ); | 1076 | local->deleteIncidence( inL ); |
1077 | inL = inR->clone(); | 1077 | inL = inR->clone(); |
1078 | if ( mSyncManager->syncWithDesktop() ) | 1078 | if ( mSyncManager->syncWithDesktop() ) |
1079 | inL->setPilotId( pid ); | 1079 | inL->setPilotId( pid ); |
1080 | inL->setIDStr( idS ); | 1080 | inL->setIDStr( idS ); |
1081 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1081 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1082 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1082 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1083 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); | 1083 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); |
1084 | } | 1084 | } |
1085 | local->addIncidence( inL ); | 1085 | local->addIncidence( inL ); |
1086 | ++changedLocal; | 1086 | ++changedLocal; |
1087 | } | 1087 | } |
1088 | } | 1088 | } |
1089 | } else { // no conflict ********** add or delete remote | 1089 | } else { // no conflict ********** add or delete remote |
1090 | if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ | 1090 | if ( !filterIN || filterIN->filterCalendarItem( inR ) ){ |
1091 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1091 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1092 | QString des = eventLSync->description(); | 1092 | QString des = eventLSync->description(); |
1093 | QString pref = "e"; | 1093 | QString pref = "e"; |
1094 | if ( inR->type() == "Todo" ) | 1094 | if ( inR->type() == "Todo" ) |
1095 | pref = "t"; | 1095 | pref = "t"; |
1096 | if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it | 1096 | if ( des.find(pref+ inR->getID(mCurrentSyncDevice) +"," ) >= 0 && mode != 5) { // delete it |
1097 | inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); | 1097 | inR->setTempSyncStat( SYNC_TEMPSTATE_DELETE ); |
1098 | //remote->deleteIncidence( inR ); | 1098 | //remote->deleteIncidence( inR ); |
1099 | ++deletedEventR; | 1099 | ++deletedEventR; |
1100 | } else { | 1100 | } else { |
1101 | inR->setLastModified( modifiedCalendar ); | 1101 | inR->setLastModified( modifiedCalendar ); |
1102 | inL = inR->clone(); | 1102 | inL = inR->clone(); |
1103 | inL->setIDStr( ":" ); | 1103 | inL->setIDStr( ":" ); |
1104 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1104 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1105 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); | 1105 | inL->setID( mCurrentSyncDevice, inR->getID(mCurrentSyncDevice) ); |
1106 | local->addIncidence( inL ); | 1106 | local->addIncidence( inL ); |
1107 | ++addedEvent; | 1107 | ++addedEvent; |
1108 | 1108 | ||
1109 | } | 1109 | } |
1110 | } else { | 1110 | } else { |
1111 | if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { | 1111 | if ( inR->lastModified() > mLastCalendarSync || mode == 5 ) { |
1112 | inR->setLastModified( modifiedCalendar ); | 1112 | inR->setLastModified( modifiedCalendar ); |
1113 | inL = inR->clone(); | 1113 | inL = inR->clone(); |
1114 | inL->setIDStr( ":" ); | 1114 | inL->setIDStr( ":" ); |
1115 | local->addIncidence( inL ); | 1115 | local->addIncidence( inL ); |
1116 | ++addedEvent; | 1116 | ++addedEvent; |
1117 | 1117 | ||
1118 | } else { | 1118 | } else { |
1119 | checkExternSyncEvent(eventRSyncSharp, inR); | 1119 | checkExternSyncEvent(eventRSyncSharp, inR); |
1120 | remote->deleteIncidence( inR ); | 1120 | remote->deleteIncidence( inR ); |
1121 | ++deletedEventR; | 1121 | ++deletedEventR; |
1122 | } | 1122 | } |
1123 | } | 1123 | } |
1124 | } else { | 1124 | } else { |
1125 | ++filteredIN; | 1125 | ++filteredIN; |
1126 | } | 1126 | } |
1127 | } | 1127 | } |
1128 | } | 1128 | } |
1129 | inR = er.next(); | 1129 | inR = er.next(); |
1130 | } | 1130 | } |
1131 | QPtrList<Incidence> el = local->rawIncidences(); | 1131 | QPtrList<Incidence> el = local->rawIncidences(); |
1132 | inL = el.first(); | 1132 | inL = el.first(); |
1133 | modulo = (el.count()/10)+1; | 1133 | modulo = (el.count()/10)+1; |
1134 | bar.setCaption (i18n("Add / remove events") ); | 1134 | bar.setCaption (i18n("Add / remove events") ); |
1135 | bar.setTotalSteps ( el.count() ) ; | 1135 | bar.setTotalSteps ( el.count() ) ; |
1136 | bar.show(); | 1136 | bar.show(); |
1137 | incCounter = 0; | 1137 | incCounter = 0; |
1138 | 1138 | ||
1139 | while ( inL ) { | 1139 | while ( inL ) { |
1140 | 1140 | ||
1141 | qApp->processEvents(); | 1141 | qApp->processEvents(); |
1142 | if ( ! bar.isVisible() ) | 1142 | if ( ! bar.isVisible() ) |
1143 | return false; | 1143 | return false; |
1144 | if ( incCounter % modulo == 0 ) | 1144 | if ( incCounter % modulo == 0 ) |
1145 | bar.setProgress( incCounter ); | 1145 | bar.setProgress( incCounter ); |
1146 | ++incCounter; | 1146 | ++incCounter; |
1147 | uid = inL->uid(); | 1147 | uid = inL->uid(); |
1148 | bool skipIncidence = false; | 1148 | bool skipIncidence = false; |
1149 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1149 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1150 | skipIncidence = true; | 1150 | skipIncidence = true; |
1151 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) | 1151 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->type() == "Journal" ) |
1152 | skipIncidence = true; | 1152 | skipIncidence = true; |
1153 | if ( !skipIncidence ) { | 1153 | if ( !skipIncidence ) { |
1154 | inR = remote->incidence( uid ); | 1154 | inR = remote->incidence( uid ); |
1155 | if ( ! inR ) { | 1155 | if ( ! inR ) { |
1156 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ | 1156 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ |
1157 | // no conflict ********** add or delete local | 1157 | // no conflict ********** add or delete local |
1158 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1158 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1159 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 1159 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
1160 | checkExternSyncEvent(eventLSyncSharp, inL); | 1160 | checkExternSyncEvent(eventLSyncSharp, inL); |
1161 | local->deleteIncidence( inL ); | 1161 | local->deleteIncidence( inL ); |
1162 | ++deletedEventL; | 1162 | ++deletedEventL; |
1163 | } else { | 1163 | } else { |
1164 | if ( ! mSyncManager->mWriteBackExistingOnly ) { | 1164 | if ( ! mSyncManager->mWriteBackExistingOnly ) { |
1165 | inL->removeID(mCurrentSyncDevice ); | 1165 | inL->removeID(mCurrentSyncDevice ); |
1166 | ++addedEventR; | 1166 | ++addedEventR; |
1167 | //qDebug("remote added Incidence %s ", inL->summary().latin1()); | 1167 | //qDebug("remote added Incidence %s ", inL->summary().latin1()); |
1168 | inL->setLastModified( modifiedCalendar ); | 1168 | inL->setLastModified( modifiedCalendar ); |
1169 | inR = inL->clone(); | 1169 | inR = inL->clone(); |
1170 | inR->setIDStr( ":" ); | 1170 | inR->setIDStr( ":" ); |
1171 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1171 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
1172 | remote->addIncidence( inR ); | 1172 | remote->addIncidence( inR ); |
1173 | } | 1173 | } |
1174 | } | 1174 | } |
1175 | } else { | 1175 | } else { |
1176 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { | 1176 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { |
1177 | checkExternSyncEvent(eventLSyncSharp, inL); | 1177 | checkExternSyncEvent(eventLSyncSharp, inL); |
1178 | local->deleteIncidence( inL ); | 1178 | local->deleteIncidence( inL ); |
1179 | ++deletedEventL; | 1179 | ++deletedEventL; |
1180 | } else { | 1180 | } else { |
1181 | if ( ! mSyncManager->mWriteBackExistingOnly ) { | 1181 | if ( ! mSyncManager->mWriteBackExistingOnly ) { |
1182 | ++addedEventR; | 1182 | ++addedEventR; |
1183 | inL->setLastModified( modifiedCalendar ); | 1183 | inL->setLastModified( modifiedCalendar ); |
1184 | inR = inL->clone(); | 1184 | inR = inL->clone(); |
1185 | inR->setIDStr( ":" ); | 1185 | inR->setIDStr( ":" ); |
1186 | remote->addIncidence( inR ); | 1186 | remote->addIncidence( inR ); |
1187 | } | 1187 | } |
1188 | } | 1188 | } |
1189 | } | 1189 | } |
1190 | } else { | 1190 | } else { |
1191 | ++filteredOUT; | 1191 | ++filteredOUT; |
1192 | } | 1192 | } |
1193 | } | 1193 | } |
1194 | } | 1194 | } |
1195 | inL = el.next(); | 1195 | inL = el.next(); |
1196 | } | 1196 | } |
1197 | int delFut = 0; | 1197 | int delFut = 0; |
1198 | int remRem = 0; | 1198 | int remRem = 0; |
1199 | if ( mSyncManager->mWriteBackInFuture ) { | 1199 | if ( mSyncManager->mWriteBackInFuture ) { |
1200 | er = remote->rawIncidences(); | 1200 | er = remote->rawIncidences(); |
1201 | remRem = er.count(); | 1201 | remRem = er.count(); |
1202 | inR = er.first(); | 1202 | inR = er.first(); |
1203 | QDateTime dt; | 1203 | QDateTime dt; |
1204 | QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); | 1204 | QDateTime cur = QDateTime::currentDateTime().addDays( -(mSyncManager->mWriteBackInPast * 7) ); |
1205 | QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); | 1205 | QDateTime end = QDateTime::currentDateTime().addDays( (mSyncManager->mWriteBackInFuture ) *7 ); |
1206 | while ( inR ) { | 1206 | while ( inR ) { |
1207 | if ( inR->type() == "Todo" ) { | 1207 | if ( inR->type() == "Todo" ) { |
1208 | Todo * t = (Todo*)inR; | 1208 | Todo * t = (Todo*)inR; |
1209 | if ( t->hasDueDate() ) | 1209 | if ( t->hasDueDate() ) |
1210 | dt = t->dtDue(); | 1210 | dt = t->dtDue(); |
1211 | else | 1211 | else |
1212 | dt = cur.addSecs( 62 ); | 1212 | dt = cur.addSecs( 62 ); |
1213 | } | 1213 | } |
1214 | else if (inR->type() == "Event" ) { | 1214 | else if (inR->type() == "Event" ) { |
1215 | bool ok; | 1215 | bool ok; |
1216 | dt = inR->getNextOccurence( cur, &ok ); | 1216 | dt = inR->getNextOccurence( cur, &ok ); |
1217 | if ( !ok ) | 1217 | if ( !ok ) |
1218 | dt = cur.addSecs( -62 ); | 1218 | dt = cur.addSecs( -62 ); |
1219 | } | 1219 | } |
1220 | else | 1220 | else |
1221 | dt = inR->dtStart(); | 1221 | dt = inR->dtStart(); |
1222 | if ( dt < cur || dt > end ) { | 1222 | if ( dt < cur || dt > end ) { |
1223 | remote->deleteIncidence( inR ); | 1223 | remote->deleteIncidence( inR ); |
1224 | ++delFut; | 1224 | ++delFut; |
1225 | } | 1225 | } |
1226 | inR = er.next(); | 1226 | inR = er.next(); |
1227 | } | 1227 | } |
1228 | } | 1228 | } |
1229 | bar.hide(); | 1229 | bar.hide(); |
1230 | mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); | 1230 | mLastCalendarSync = QDateTime::currentDateTime().addSecs( 1 ); |
1231 | eventLSync->setReadOnly( false ); | 1231 | eventLSync->setReadOnly( false ); |
1232 | eventLSync->setDtStart( mLastCalendarSync ); | 1232 | eventLSync->setDtStart( mLastCalendarSync ); |
1233 | eventRSync->setDtStart( mLastCalendarSync ); | 1233 | eventRSync->setDtStart( mLastCalendarSync ); |
1234 | eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); | 1234 | eventLSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); |
1235 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); | 1235 | eventRSync->setDtEnd( mLastCalendarSync.addSecs( 3600 ) ); |
1236 | eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; | 1236 | eventRSync->setLocation( i18n("Remote from: ")+mCurrentSyncName ) ; |
1237 | eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); | 1237 | eventLSync->setLocation(i18n("Local from: ") + mCurrentSyncName ); |
1238 | eventLSync->setReadOnly( true ); | 1238 | eventLSync->setReadOnly( true ); |
1239 | qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL ); | 1239 | qDebug("KO: Normal sync: %d ",mGlobalSyncMode == SYNC_MODE_NORMAL ); |
1240 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... | 1240 | if ( mGlobalSyncMode == SYNC_MODE_NORMAL && !mSyncManager->syncWithDesktop()) // kde is abnormal... |
1241 | remote->addEvent( eventRSync ); | 1241 | remote->addEvent( eventRSync ); |
1242 | else | 1242 | else |
1243 | delete eventRSync; | 1243 | delete eventRSync; |
1244 | qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() ); | 1244 | qDebug("KO: Sync with desktop %d ",mSyncManager->syncWithDesktop() ); |
1245 | QString mes; | 1245 | QString mes; |
1246 | 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 ); | 1246 | 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 ); |
1247 | QString delmess; | 1247 | QString delmess; |
1248 | if ( delFut ) { | 1248 | if ( delFut ) { |
1249 | 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); | 1249 | 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); |
1250 | mes += delmess; | 1250 | mes += delmess; |
1251 | } | 1251 | } |
1252 | mes = i18n("Local calendar changed!\n") +mes; | 1252 | mes = i18n("Local calendar changed!\n") +mes; |
1253 | mCalendar->checkAlarmForIncidence( 0, true ); | 1253 | mCalendar->checkAlarmForIncidence( 0, true ); |
1254 | qDebug( mes ); | 1254 | qDebug( mes ); |
1255 | if ( mSyncManager->mShowSyncSummary ) { | 1255 | if ( mSyncManager->mShowSyncSummary ) { |
1256 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, | 1256 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, |
1257 | i18n("KO/Pi Synchronization"),i18n("Write back"))) { | 1257 | i18n("KO/Pi Synchronization"),i18n("Write back"))) { |
1258 | qDebug("KO: WB cancelled "); | 1258 | qDebug("KO: WB cancelled "); |
1259 | mSyncManager->mWriteBackFile = false; | 1259 | mSyncManager->mWriteBackFile = false; |
1260 | return syncOK; | 1260 | return syncOK; |
1261 | } | 1261 | } |
1262 | } | 1262 | } |
1263 | return syncOK; | 1263 | return syncOK; |
1264 | } | 1264 | } |
1265 | 1265 | ||
1266 | void CalendarView::setSyncDevice( QString s ) | 1266 | void CalendarView::setSyncDevice( QString s ) |
1267 | { | 1267 | { |
1268 | mCurrentSyncDevice= s; | 1268 | mCurrentSyncDevice= s; |
1269 | } | 1269 | } |
1270 | void CalendarView::setSyncName( QString s ) | 1270 | void CalendarView::setSyncName( QString s ) |
1271 | { | 1271 | { |
1272 | mCurrentSyncName= s; | 1272 | mCurrentSyncName= s; |
1273 | } | 1273 | } |
1274 | bool CalendarView::syncCalendar(QString filename, int mode) | 1274 | bool CalendarView::syncCalendar(QString filename, int mode) |
1275 | { | 1275 | { |
1276 | //qDebug("syncCalendar %s ", filename.latin1()); | 1276 | //qDebug("syncCalendar %s ", filename.latin1()); |
1277 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 1277 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
1278 | CalendarLocal* calendar = new CalendarLocal(); | 1278 | CalendarLocal* calendar = new CalendarLocal(); |
1279 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 1279 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
1280 | FileStorage* storage = new FileStorage( calendar ); | 1280 | FileStorage* storage = new FileStorage( calendar ); |
1281 | bool syncOK = false; | 1281 | bool syncOK = false; |
1282 | storage->setFileName( filename ); | 1282 | storage->setFileName( filename ); |
1283 | // qDebug("loading ... "); | 1283 | // qDebug("loading ... "); |
1284 | if ( storage->load() ) { | 1284 | if ( storage->load() ) { |
1285 | getEventViewerDialog()->setSyncMode( true ); | 1285 | getEventViewerDialog()->setSyncMode( true ); |
1286 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); | 1286 | syncOK = synchronizeCalendar( mCalendar, calendar, mode ); |
1287 | getEventViewerDialog()->setSyncMode( false ); | 1287 | getEventViewerDialog()->setSyncMode( false ); |
1288 | if ( syncOK ) { | 1288 | if ( syncOK ) { |
1289 | if ( mSyncManager->mWriteBackFile ) | 1289 | if ( mSyncManager->mWriteBackFile ) |
1290 | { | 1290 | { |
1291 | storage->setSaveFormat( new ICalFormat() ); | 1291 | storage->setSaveFormat( new ICalFormat() ); |
1292 | storage->save(); | 1292 | storage->save(); |
1293 | } | 1293 | } |
1294 | } | 1294 | } |
1295 | setModified( true ); | 1295 | setModified( true ); |
1296 | } | 1296 | } |
1297 | delete storage; | 1297 | delete storage; |
1298 | delete calendar; | 1298 | delete calendar; |
1299 | if ( syncOK ) | 1299 | if ( syncOK ) |
1300 | updateView(); | 1300 | updateView(); |
1301 | return syncOK; | 1301 | return syncOK; |
1302 | } | 1302 | } |
1303 | 1303 | ||
1304 | void CalendarView::syncExternal( int mode ) | 1304 | void CalendarView::syncExternal( int mode ) |
1305 | { | 1305 | { |
1306 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 1306 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
1307 | 1307 | ||
1308 | qApp->processEvents(); | 1308 | qApp->processEvents(); |
1309 | CalendarLocal* calendar = new CalendarLocal(); | 1309 | CalendarLocal* calendar = new CalendarLocal(); |
1310 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 1310 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
1311 | bool syncOK = false; | 1311 | bool syncOK = false; |
1312 | bool loadSuccess = false; | 1312 | bool loadSuccess = false; |
1313 | PhoneFormat* phoneFormat = 0; | 1313 | PhoneFormat* phoneFormat = 0; |
1314 | emit tempDisableBR(true); | 1314 | emit tempDisableBR(true); |
1315 | #ifndef DESKTOP_VERSION | 1315 | #ifndef DESKTOP_VERSION |
1316 | SharpFormat* sharpFormat = 0; | 1316 | SharpFormat* sharpFormat = 0; |
1317 | if ( mode == 0 ) { // sharp | 1317 | if ( mode == 0 ) { // sharp |
1318 | sharpFormat = new SharpFormat () ; | 1318 | sharpFormat = new SharpFormat () ; |
1319 | loadSuccess = sharpFormat->load( calendar, mCalendar ); | 1319 | loadSuccess = sharpFormat->load( calendar, mCalendar ); |
1320 | 1320 | ||
1321 | } else | 1321 | } else |
1322 | #endif | 1322 | #endif |
1323 | if ( mode == 1 ) { // phone | 1323 | if ( mode == 1 ) { // phone |
1324 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, | 1324 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, |
1325 | mSyncManager->mPhoneDevice, | 1325 | mSyncManager->mPhoneDevice, |
1326 | mSyncManager->mPhoneConnection, | 1326 | mSyncManager->mPhoneConnection, |
1327 | mSyncManager->mPhoneModel); | 1327 | mSyncManager->mPhoneModel); |
1328 | loadSuccess = phoneFormat->load( calendar,mCalendar); | 1328 | loadSuccess = phoneFormat->load( calendar,mCalendar); |
1329 | 1329 | ||
1330 | } else { | 1330 | } else { |
1331 | emit tempDisableBR(false); | 1331 | emit tempDisableBR(false); |
1332 | return; | 1332 | return; |
1333 | } | 1333 | } |
1334 | if ( loadSuccess ) { | 1334 | if ( loadSuccess ) { |
1335 | getEventViewerDialog()->setSyncMode( true ); | 1335 | getEventViewerDialog()->setSyncMode( true ); |
1336 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); | 1336 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); |
1337 | getEventViewerDialog()->setSyncMode( false ); | 1337 | getEventViewerDialog()->setSyncMode( false ); |
1338 | qApp->processEvents(); | 1338 | qApp->processEvents(); |
1339 | if ( syncOK ) { | 1339 | if ( syncOK ) { |
1340 | if ( mSyncManager->mWriteBackFile ) | 1340 | if ( mSyncManager->mWriteBackFile ) |
1341 | { | 1341 | { |
1342 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); | 1342 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); |
1343 | Incidence* inc = iL.first(); | 1343 | Incidence* inc = iL.first(); |
1344 | if ( phoneFormat ) { | 1344 | if ( phoneFormat ) { |
1345 | while ( inc ) { | 1345 | while ( inc ) { |
1346 | inc->removeID(mCurrentSyncDevice); | 1346 | inc->removeID(mCurrentSyncDevice); |
1347 | inc = iL.next(); | 1347 | inc = iL.next(); |
1348 | } | 1348 | } |
1349 | } | 1349 | } |
1350 | #ifndef DESKTOP_VERSION | 1350 | #ifndef DESKTOP_VERSION |
1351 | if ( sharpFormat ) | 1351 | if ( sharpFormat ) |
1352 | sharpFormat->save(calendar); | 1352 | sharpFormat->save(calendar); |
1353 | #endif | 1353 | #endif |
1354 | if ( phoneFormat ) | 1354 | if ( phoneFormat ) |
1355 | phoneFormat->save(calendar); | 1355 | phoneFormat->save(calendar); |
1356 | iL = calendar->rawIncidences(); | 1356 | iL = calendar->rawIncidences(); |
1357 | inc = iL.first(); | 1357 | inc = iL.first(); |
1358 | Incidence* loc; | 1358 | Incidence* loc; |
1359 | while ( inc ) { | 1359 | while ( inc ) { |
1360 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { | 1360 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { |
1361 | loc = mCalendar->incidence(inc->uid() ); | 1361 | loc = mCalendar->incidence(inc->uid() ); |
1362 | if ( loc ) { | 1362 | if ( loc ) { |
1363 | loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); | 1363 | loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); |
1364 | loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); | 1364 | loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); |
1365 | } | 1365 | } |
1366 | } | 1366 | } |
1367 | inc = iL.next(); | 1367 | inc = iL.next(); |
1368 | } | 1368 | } |
1369 | Incidence* lse = getLastSyncEvent(); | 1369 | Incidence* lse = getLastSyncEvent(); |
1370 | if ( lse ) { | 1370 | if ( lse ) { |
1371 | lse->setReadOnly( false ); | 1371 | lse->setReadOnly( false ); |
1372 | lse->setDescription( "" ); | 1372 | lse->setDescription( "" ); |
1373 | lse->setReadOnly( true ); | 1373 | lse->setReadOnly( true ); |
1374 | } | 1374 | } |
1375 | } | 1375 | } |
1376 | } else { | 1376 | } else { |
1377 | topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); | 1377 | topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); |
1378 | } | 1378 | } |
1379 | setModified( true ); | 1379 | setModified( true ); |
1380 | } else { | 1380 | } else { |
1381 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; | 1381 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; |
1382 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), | 1382 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), |
1383 | question, i18n("Ok")) ; | 1383 | question, i18n("Ok")) ; |
1384 | 1384 | ||
1385 | } | 1385 | } |
1386 | delete calendar; | 1386 | delete calendar; |
1387 | updateView(); | 1387 | updateView(); |
1388 | emit tempDisableBR(false); | 1388 | emit tempDisableBR(false); |
1389 | return ;//syncOK; | 1389 | return ;//syncOK; |
1390 | 1390 | ||
1391 | } | 1391 | } |
1392 | 1392 | ||
1393 | bool CalendarView::importBday() | 1393 | bool CalendarView::importBday() |
1394 | { | 1394 | { |
1395 | #ifndef KORG_NOKABC | 1395 | #ifndef KORG_NOKABC |
1396 | 1396 | ||
1397 | #ifdef DESKTOP_VERSION | 1397 | #ifdef DESKTOP_VERSION |
1398 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 1398 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
1399 | KABC::AddressBook::Iterator it; | 1399 | KABC::AddressBook::Iterator it; |
1400 | int count = 0; | 1400 | int count = 0; |
1401 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1401 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
1402 | ++count; | 1402 | ++count; |
1403 | } | 1403 | } |
1404 | QProgressBar bar(count,0 ); | 1404 | QProgressBar bar(count,0 ); |
1405 | int w = 300; | 1405 | int w = 300; |
1406 | if ( QApplication::desktop()->width() < 320 ) | 1406 | if ( QApplication::desktop()->width() < 320 ) |
1407 | w = 220; | 1407 | w = 220; |
1408 | int h = bar.sizeHint().height() ; | 1408 | int h = bar.sizeHint().height() ; |
1409 | int dw = QApplication::desktop()->width(); | 1409 | int dw = QApplication::desktop()->width(); |
1410 | int dh = QApplication::desktop()->height(); | 1410 | int dh = QApplication::desktop()->height(); |
1411 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1411 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1412 | bar.show(); | 1412 | bar.show(); |
1413 | bar.setCaption (i18n("Reading addressbook - close to abort!") ); | 1413 | bar.setCaption (i18n("Reading addressbook - close to abort!") ); |
1414 | qApp->processEvents(); | 1414 | qApp->processEvents(); |
1415 | count = 0; | 1415 | count = 0; |
1416 | int addCount = 0; | 1416 | int addCount = 0; |
1417 | KCal::Attendee* a = 0; | 1417 | KCal::Attendee* a = 0; |
1418 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1418 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
1419 | if ( ! bar.isVisible() ) | 1419 | if ( ! bar.isVisible() ) |
1420 | return false; | 1420 | return false; |
1421 | bar.setProgress( count++ ); | 1421 | bar.setProgress( count++ ); |
1422 | qApp->processEvents(); | 1422 | qApp->processEvents(); |
1423 | //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); | 1423 | //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); |
1424 | if ( (*it).birthday().date().isValid() ){ | 1424 | if ( (*it).birthday().date().isValid() ){ |
1425 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; | 1425 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; |
1426 | if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) | 1426 | if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) |
1427 | ++addCount; | 1427 | ++addCount; |
1428 | } | 1428 | } |
1429 | QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); | 1429 | QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); |
1430 | if ( anni.isValid() ){ | 1430 | if ( anni.isValid() ){ |
1431 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; | 1431 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; |
1432 | if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) | 1432 | if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) |
1433 | ++addCount; | 1433 | ++addCount; |
1434 | } | 1434 | } |
1435 | } | 1435 | } |
1436 | updateView(); | 1436 | updateView(); |
1437 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1437 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1438 | #else //DESKTOP_VERSION | 1438 | #else //DESKTOP_VERSION |
1439 | 1439 | ||
1440 | ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | 1440 | ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); |
1441 | // the result should now arrive through method insertBirthdays | 1441 | // the result should now arrive through method insertBirthdays |
1442 | 1442 | ||
1443 | #endif //DESKTOP_VERSION | 1443 | #endif //DESKTOP_VERSION |
1444 | 1444 | ||
1445 | #endif //KORG_NOKABC | 1445 | #endif //KORG_NOKABC |
1446 | 1446 | ||
1447 | 1447 | ||
1448 | return true; | 1448 | return true; |
1449 | } | 1449 | } |
1450 | 1450 | ||
1451 | // This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI | 1451 | // This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI |
1452 | void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, | 1452 | void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, |
1453 | const QStringList& anniversaryList, const QStringList& realNameList, | 1453 | const QStringList& anniversaryList, const QStringList& realNameList, |
1454 | const QStringList& emailList, const QStringList& assembledNameList, | 1454 | const QStringList& emailList, const QStringList& assembledNameList, |
1455 | const QStringList& uidList) | 1455 | const QStringList& uidList) |
1456 | { | 1456 | { |
1457 | //qDebug("KO::CalendarView::insertBirthdays"); | 1457 | //qDebug("KO::CalendarView::insertBirthdays"); |
1458 | if (uid == this->name()) | 1458 | if (uid == this->name()) |
1459 | { | 1459 | { |
1460 | int count = birthdayList.count(); | 1460 | int count = birthdayList.count(); |
1461 | int addCount = 0; | 1461 | int addCount = 0; |
1462 | KCal::Attendee* a = 0; | 1462 | KCal::Attendee* a = 0; |
1463 | 1463 | ||
1464 | //qDebug("CalView 1 %i", count); | 1464 | //qDebug("CalView 1 %i", count); |
1465 | 1465 | ||
1466 | QProgressBar bar(count,0 ); | 1466 | QProgressBar bar(count,0 ); |
1467 | int w = 300; | 1467 | int w = 300; |
1468 | if ( QApplication::desktop()->width() < 320 ) | 1468 | if ( QApplication::desktop()->width() < 320 ) |
1469 | w = 220; | 1469 | w = 220; |
1470 | int h = bar.sizeHint().height() ; | 1470 | int h = bar.sizeHint().height() ; |
1471 | int dw = QApplication::desktop()->width(); | 1471 | int dw = QApplication::desktop()->width(); |
1472 | int dh = QApplication::desktop()->height(); | 1472 | int dh = QApplication::desktop()->height(); |
1473 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1473 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1474 | bar.show(); | 1474 | bar.show(); |
1475 | bar.setCaption (i18n("inserting birthdays - close to abort!") ); | 1475 | bar.setCaption (i18n("inserting birthdays - close to abort!") ); |
1476 | qApp->processEvents(); | 1476 | qApp->processEvents(); |
1477 | 1477 | ||
1478 | QDate birthday; | 1478 | QDate birthday; |
1479 | QDate anniversary; | 1479 | QDate anniversary; |
1480 | QString realName; | 1480 | QString realName; |
1481 | QString email; | 1481 | QString email; |
1482 | QString assembledName; | 1482 | QString assembledName; |
1483 | QString uid; | 1483 | QString uid; |
1484 | bool ok = true; | 1484 | bool ok = true; |
1485 | for ( int i = 0; i < count; i++) | 1485 | for ( int i = 0; i < count; i++) |
1486 | { | 1486 | { |
1487 | if ( ! bar.isVisible() ) | 1487 | if ( ! bar.isVisible() ) |
1488 | return; | 1488 | return; |
1489 | bar.setProgress( i ); | 1489 | bar.setProgress( i ); |
1490 | qApp->processEvents(); | 1490 | qApp->processEvents(); |
1491 | 1491 | ||
1492 | birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); | 1492 | birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); |
1493 | if (!ok) { | 1493 | if (!ok) { |
1494 | ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); | 1494 | ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); |
1495 | } | 1495 | } |
1496 | 1496 | ||
1497 | anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); | 1497 | anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); |
1498 | if (!ok) { | 1498 | if (!ok) { |
1499 | ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); | 1499 | ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); |
1500 | } | 1500 | } |
1501 | realName = realNameList[i]; | 1501 | realName = realNameList[i]; |
1502 | email = emailList[i]; | 1502 | email = emailList[i]; |
1503 | assembledName = assembledNameList[i]; | 1503 | assembledName = assembledNameList[i]; |
1504 | uid = uidList[i]; | 1504 | uid = uidList[i]; |
1505 | //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() ); | 1505 | //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() ); |
1506 | 1506 | ||
1507 | if ( birthday.isValid() ){ | 1507 | if ( birthday.isValid() ){ |
1508 | a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, | 1508 | a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, |
1509 | KCal::Attendee::ReqParticipant,uid) ; | 1509 | KCal::Attendee::ReqParticipant,uid) ; |
1510 | if ( addAnniversary( birthday, assembledName, a, true ) ) | 1510 | if ( addAnniversary( birthday, assembledName, a, true ) ) |
1511 | ++addCount; | 1511 | ++addCount; |
1512 | } | 1512 | } |
1513 | 1513 | ||
1514 | if ( anniversary.isValid() ){ | 1514 | if ( anniversary.isValid() ){ |
1515 | a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, | 1515 | a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, |
1516 | KCal::Attendee::ReqParticipant,uid) ; | 1516 | KCal::Attendee::ReqParticipant,uid) ; |
1517 | if ( addAnniversary( anniversary, assembledName, a, false ) ) | 1517 | if ( addAnniversary( anniversary, assembledName, a, false ) ) |
1518 | ++addCount; | 1518 | ++addCount; |
1519 | } | 1519 | } |
1520 | } | 1520 | } |
1521 | 1521 | ||
1522 | updateView(); | 1522 | updateView(); |
1523 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1523 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1524 | 1524 | ||
1525 | } | 1525 | } |
1526 | 1526 | ||
1527 | } | 1527 | } |
1528 | 1528 | ||
1529 | 1529 | ||
1530 | 1530 | ||
1531 | bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) | 1531 | bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) |
1532 | { | 1532 | { |
1533 | //qDebug("addAnni "); | 1533 | //qDebug("addAnni "); |
1534 | Event * ev = new Event(); | 1534 | Event * ev = new Event(); |
1535 | ev->setOrganizer(KOPrefs::instance()->email()); | 1535 | ev->setOrganizer(KOPrefs::instance()->email()); |
1536 | if ( a ) { | 1536 | if ( a ) { |
1537 | ev->addAttendee( a ); | 1537 | ev->addAttendee( a ); |
1538 | } | 1538 | } |
1539 | QString kind; | 1539 | QString kind; |
1540 | if ( birthday ) { | 1540 | if ( birthday ) { |
1541 | kind = i18n( "Birthday" ); | 1541 | kind = i18n( "Birthday" ); |
1542 | ev->setSummary( name + " (" + QString::number(date.year()) +")"); | 1542 | ev->setSummary( name + " (" + QString::number(date.year()) +")"); |
1543 | } | 1543 | } |
1544 | else { | 1544 | else { |
1545 | kind = i18n( "Anniversary" ); | 1545 | kind = i18n( "Anniversary" ); |
1546 | ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); | 1546 | ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); |
1547 | } | 1547 | } |
1548 | ev->setCategories( kind ); | 1548 | ev->setCategories( kind ); |
1549 | ev->setDtStart( QDateTime(date) ); | 1549 | ev->setDtStart( QDateTime(date) ); |
1550 | ev->setDtEnd( QDateTime(date) ); | 1550 | ev->setDtEnd( QDateTime(date) ); |
1551 | ev->setFloats( true ); | 1551 | ev->setFloats( true ); |
1552 | Recurrence * rec = ev->recurrence(); | 1552 | Recurrence * rec = ev->recurrence(); |
1553 | rec->setYearly(Recurrence::rYearlyMonth,1,-1); | 1553 | rec->setYearly(Recurrence::rYearlyMonth,1,-1); |
1554 | rec->addYearlyNum( date.month() ); | 1554 | rec->addYearlyNum( date.month() ); |
1555 | if ( !mCalendar->addAnniversaryNoDup( ev ) ) { | 1555 | if ( !mCalendar->addAnniversaryNoDup( ev ) ) { |
1556 | delete ev; | 1556 | delete ev; |
1557 | return false; | 1557 | return false; |
1558 | } | 1558 | } |
1559 | return true; | 1559 | return true; |
1560 | 1560 | ||
1561 | } | 1561 | } |
1562 | bool CalendarView::importQtopia( const QString &categories, | 1562 | bool CalendarView::importQtopia( const QString &categories, |
1563 | const QString &datebook, | 1563 | const QString &datebook, |
1564 | const QString &todolist ) | 1564 | const QString &todolist ) |
1565 | { | 1565 | { |
1566 | 1566 | ||
1567 | QtopiaFormat qtopiaFormat; | 1567 | QtopiaFormat qtopiaFormat; |
1568 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); | 1568 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); |
1569 | if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); | 1569 | if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); |
1570 | if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); | 1570 | if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); |
1571 | if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); | 1571 | if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); |
1572 | 1572 | ||
1573 | updateView(); | 1573 | updateView(); |
1574 | return true; | 1574 | return true; |
1575 | 1575 | ||
1576 | #if 0 | 1576 | #if 0 |
1577 | mGlobalSyncMode = SYNC_MODE_QTOPIA; | 1577 | mGlobalSyncMode = SYNC_MODE_QTOPIA; |
1578 | mCurrentSyncDevice = "qtopia-XML"; | 1578 | mCurrentSyncDevice = "qtopia-XML"; |
1579 | if ( mSyncManager->mAskForPreferences ) | 1579 | if ( mSyncManager->mAskForPreferences ) |
1580 | edit_sync_options(); | 1580 | edit_sync_options(); |
1581 | qApp->processEvents(); | 1581 | qApp->processEvents(); |
1582 | CalendarLocal* calendar = new CalendarLocal(); | 1582 | CalendarLocal* calendar = new CalendarLocal(); |
1583 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 1583 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
1584 | bool syncOK = false; | 1584 | bool syncOK = false; |
1585 | QtopiaFormat qtopiaFormat; | 1585 | QtopiaFormat qtopiaFormat; |
1586 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); | 1586 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); |
1587 | bool loadOk = true; | 1587 | bool loadOk = true; |
1588 | if ( !categories.isEmpty() ) | 1588 | if ( !categories.isEmpty() ) |
1589 | loadOk = qtopiaFormat.load( calendar, categories ); | 1589 | loadOk = qtopiaFormat.load( calendar, categories ); |
1590 | if ( loadOk && !datebook.isEmpty() ) | 1590 | if ( loadOk && !datebook.isEmpty() ) |
1591 | loadOk = qtopiaFormat.load( calendar, datebook ); | 1591 | loadOk = qtopiaFormat.load( calendar, datebook ); |
1592 | if ( loadOk && !todolist.isEmpty() ) | 1592 | if ( loadOk && !todolist.isEmpty() ) |
1593 | loadOk = qtopiaFormat.load( calendar, todolist ); | 1593 | loadOk = qtopiaFormat.load( calendar, todolist ); |
1594 | 1594 | ||
1595 | if ( loadOk ) { | 1595 | if ( loadOk ) { |
1596 | getEventViewerDialog()->setSyncMode( true ); | 1596 | getEventViewerDialog()->setSyncMode( true ); |
1597 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); | 1597 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); |
1598 | getEventViewerDialog()->setSyncMode( false ); | 1598 | getEventViewerDialog()->setSyncMode( false ); |
1599 | qApp->processEvents(); | 1599 | qApp->processEvents(); |
1600 | if ( syncOK ) { | 1600 | if ( syncOK ) { |
1601 | if ( mSyncManager->mWriteBackFile ) | 1601 | if ( mSyncManager->mWriteBackFile ) |
1602 | { | 1602 | { |
1603 | // write back XML file | 1603 | // write back XML file |
1604 | 1604 | ||
1605 | } | 1605 | } |
1606 | setModified( true ); | 1606 | setModified( true ); |
1607 | } | 1607 | } |
1608 | } else { | 1608 | } else { |
1609 | QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; | 1609 | QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; |
1610 | QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), | 1610 | QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), |
1611 | question, i18n("Ok")) ; | 1611 | question, i18n("Ok")) ; |
1612 | } | 1612 | } |
1613 | delete calendar; | 1613 | delete calendar; |
1614 | updateView(); | 1614 | updateView(); |
1615 | return syncOK; | 1615 | return syncOK; |
1616 | 1616 | ||
1617 | 1617 | ||
1618 | #endif | 1618 | #endif |
1619 | 1619 | ||
1620 | } | 1620 | } |
1621 | 1621 | ||
1622 | void CalendarView::setSyncEventsReadOnly() | 1622 | void CalendarView::setSyncEventsReadOnly() |
1623 | { | 1623 | { |
1624 | Event * ev; | 1624 | Event * ev; |
1625 | QPtrList<Event> eL = mCalendar->rawEvents(); | 1625 | QPtrList<Event> eL = mCalendar->rawEvents(); |
1626 | ev = eL.first(); | 1626 | ev = eL.first(); |
1627 | while ( ev ) { | 1627 | while ( ev ) { |
1628 | if ( ev->uid().left(15) == QString("last-syncEvent-") ) | 1628 | if ( ev->uid().left(15) == QString("last-syncEvent-") ) |
1629 | ev->setReadOnly( true ); | 1629 | ev->setReadOnly( true ); |
1630 | ev = eL.next(); | 1630 | ev = eL.next(); |
1631 | } | 1631 | } |
1632 | } | 1632 | } |
1633 | bool CalendarView::openCalendar(QString filename, bool merge) | 1633 | bool CalendarView::openCalendar(QString filename, bool merge) |
1634 | { | 1634 | { |
1635 | 1635 | ||
1636 | if (filename.isEmpty()) { | 1636 | if (filename.isEmpty()) { |
1637 | return false; | 1637 | return false; |
1638 | } | 1638 | } |
1639 | 1639 | ||
1640 | if (!QFile::exists(filename)) { | 1640 | if (!QFile::exists(filename)) { |
1641 | KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); | 1641 | KMessageBox::error(this,i18n("File does not exist:\n '%1'.").arg(filename)); |
1642 | return false; | 1642 | return false; |
1643 | } | 1643 | } |
1644 | 1644 | ||
1645 | globalFlagBlockAgenda = 1; | 1645 | globalFlagBlockAgenda = 1; |
1646 | if (!merge) mCalendar->close(); | 1646 | if (!merge) mCalendar->close(); |
1647 | 1647 | ||
1648 | mStorage->setFileName( filename ); | 1648 | mStorage->setFileName( filename ); |
1649 | 1649 | ||
1650 | if ( mStorage->load() ) { | 1650 | if ( mStorage->load() ) { |
1651 | if ( merge ) ;//setModified( true ); | 1651 | if ( merge ) ;//setModified( true ); |
1652 | else { | 1652 | else { |
1653 | //setModified( true ); | 1653 | //setModified( true ); |
1654 | mViewManager->setDocumentId( filename ); | 1654 | mViewManager->setDocumentId( filename ); |
1655 | mDialogManager->setDocumentId( filename ); | 1655 | mDialogManager->setDocumentId( filename ); |
1656 | mTodoList->setDocumentId( filename ); | 1656 | mTodoList->setDocumentId( filename ); |
1657 | } | 1657 | } |
1658 | globalFlagBlockAgenda = 2; | 1658 | globalFlagBlockAgenda = 2; |
1659 | // if ( getLastSyncEvent() ) | 1659 | // if ( getLastSyncEvent() ) |
1660 | // getLastSyncEvent()->setReadOnly( true ); | 1660 | // getLastSyncEvent()->setReadOnly( true ); |
1661 | mCalendar->reInitAlarmSettings(); | 1661 | mCalendar->reInitAlarmSettings(); |
1662 | setSyncEventsReadOnly(); | 1662 | setSyncEventsReadOnly(); |
1663 | updateUnmanagedViews(); | 1663 | updateUnmanagedViews(); |
1664 | updateView(); | 1664 | updateView(); |
1665 | if ( filename != MainWindow::defaultFileName() ) { | 1665 | if ( filename != MainWindow::defaultFileName() ) { |
1666 | saveCalendar( MainWindow::defaultFileName() ); | 1666 | saveCalendar( MainWindow::defaultFileName() ); |
1667 | } else { | 1667 | } else { |
1668 | QFileInfo finf ( MainWindow::defaultFileName()); | 1668 | QFileInfo finf ( MainWindow::defaultFileName()); |
1669 | if ( finf.exists() ) { | 1669 | if ( finf.exists() ) { |
1670 | setLoadedFileVersion( finf.lastModified () ); | 1670 | setLoadedFileVersion( finf.lastModified () ); |
1671 | } | 1671 | } |
1672 | } | 1672 | } |
1673 | return true; | 1673 | return true; |
1674 | } else { | 1674 | } else { |
1675 | // while failing to load, the calendar object could | 1675 | // while failing to load, the calendar object could |
1676 | // have become partially populated. Clear it out. | 1676 | // have become partially populated. Clear it out. |
1677 | if ( !merge ) { | 1677 | if ( !merge ) { |
1678 | mCalendar->close(); | 1678 | mCalendar->close(); |
1679 | mViewManager->setDocumentId( filename ); | 1679 | mViewManager->setDocumentId( filename ); |
1680 | mDialogManager->setDocumentId( filename ); | 1680 | mDialogManager->setDocumentId( filename ); |
1681 | mTodoList->setDocumentId( filename ); | 1681 | mTodoList->setDocumentId( filename ); |
1682 | } | 1682 | } |
1683 | 1683 | ||
1684 | //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); | 1684 | //KMessageBox::error(this,i18n("Couldn't load calendar\n '%1'.").arg(filename)); |
1685 | 1685 | ||
1686 | QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); | 1686 | QTimer::singleShot ( 1, this, SLOT ( showOpenError() ) ); |
1687 | globalFlagBlockAgenda = 2; | 1687 | globalFlagBlockAgenda = 2; |
1688 | mCalendar->reInitAlarmSettings(); | 1688 | mCalendar->reInitAlarmSettings(); |
1689 | setSyncEventsReadOnly(); | 1689 | setSyncEventsReadOnly(); |
1690 | updateUnmanagedViews(); | 1690 | updateUnmanagedViews(); |
1691 | updateView(); | 1691 | updateView(); |
1692 | } | 1692 | } |
1693 | return false; | 1693 | return false; |
1694 | } | 1694 | } |
1695 | void CalendarView::showOpenError() | 1695 | void CalendarView::showOpenError() |
1696 | { | 1696 | { |
1697 | KMessageBox::error(this,i18n("Couldn't load calendar\n.")); | 1697 | KMessageBox::error(this,i18n("Couldn't load calendar\n.")); |
1698 | } | 1698 | } |
1699 | void CalendarView::setLoadedFileVersion(QDateTime dt) | 1699 | void CalendarView::setLoadedFileVersion(QDateTime dt) |
1700 | { | 1700 | { |
1701 | loadedFileVersion = dt; | 1701 | loadedFileVersion = dt; |
1702 | } | 1702 | } |
1703 | bool CalendarView::checkFileChanged(QString fn) | 1703 | bool CalendarView::checkFileChanged(QString fn) |
1704 | { | 1704 | { |
1705 | QFileInfo finf ( fn ); | 1705 | QFileInfo finf ( fn ); |
1706 | if ( !finf.exists() ) | 1706 | if ( !finf.exists() ) |
1707 | return true; | 1707 | return true; |
1708 | QDateTime dt = finf.lastModified (); | 1708 | QDateTime dt = finf.lastModified (); |
1709 | if ( dt <= loadedFileVersion ) | 1709 | if ( dt <= loadedFileVersion ) |
1710 | return false; | 1710 | return false; |
1711 | return true; | 1711 | return true; |
1712 | 1712 | ||
1713 | } | 1713 | } |
1714 | void CalendarView::watchSavedFile() | 1714 | void CalendarView::watchSavedFile() |
1715 | { | 1715 | { |
1716 | QFileInfo finf ( MainWindow::defaultFileName()); | 1716 | QFileInfo finf ( MainWindow::defaultFileName()); |
1717 | if ( !finf.exists() ) | 1717 | if ( !finf.exists() ) |
1718 | return; | 1718 | return; |
1719 | QDateTime dt = finf.lastModified (); | 1719 | QDateTime dt = finf.lastModified (); |
1720 | if ( dt < loadedFileVersion ) { | 1720 | if ( dt < loadedFileVersion ) { |
1721 | //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); | 1721 | //qDebug("watch %s %s ", dt.toString().latin1(), loadedFileVersion.toString().latin1()); |
1722 | QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); | 1722 | QTimer::singleShot( 1000 , this, SLOT ( watchSavedFile() ) ); |
1723 | return; | 1723 | return; |
1724 | } | 1724 | } |
1725 | loadedFileVersion = dt; | 1725 | loadedFileVersion = dt; |
1726 | } | 1726 | } |
1727 | 1727 | ||
1728 | bool CalendarView::checkFileVersion(QString fn) | 1728 | bool CalendarView::checkFileVersion(QString fn) |
1729 | { | 1729 | { |
1730 | QFileInfo finf ( fn ); | 1730 | QFileInfo finf ( fn ); |
1731 | if ( !finf.exists() ) | 1731 | if ( !finf.exists() ) |
1732 | return true; | 1732 | return true; |
1733 | QDateTime dt = finf.lastModified (); | 1733 | QDateTime dt = finf.lastModified (); |
1734 | //qDebug("loaded file version %s",loadedFileVersion.toString().latin1()); | 1734 | //qDebug("loaded file version %s",loadedFileVersion.toString().latin1()); |
1735 | //qDebug("file on disk version %s",dt.toString().latin1()); | 1735 | //qDebug("file on disk version %s",dt.toString().latin1()); |
1736 | if ( dt <= loadedFileVersion ) | 1736 | if ( dt <= loadedFileVersion ) |
1737 | return true; | 1737 | return true; |
1738 | int km = KMessageBox::warningYesNoCancel(this, i18n("\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").arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , | 1738 | int km = KMessageBox::warningYesNoCancel(this, i18n("\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").arg( QString::number( finf.size())).arg( KGlobal::locale()->formatDateTime(finf.lastModified (), true, true)) , |
1739 | i18n("KO/Pi Warning"),i18n("Overwrite"), | 1739 | i18n("KO/Pi Warning"),i18n("Overwrite"), |
1740 | i18n("Sync+save")); | 1740 | i18n("Sync+save")); |
1741 | 1741 | ||
1742 | if ( km == KMessageBox::Cancel ) | 1742 | if ( km == KMessageBox::Cancel ) |
1743 | return false; | 1743 | return false; |
1744 | if ( km == KMessageBox::Yes ) | 1744 | if ( km == KMessageBox::Yes ) |
1745 | return true; | 1745 | return true; |
1746 | 1746 | ||
1747 | setSyncDevice("deleteaftersync" ); | 1747 | setSyncDevice("deleteaftersync" ); |
1748 | mSyncManager->mAskForPreferences = true; | 1748 | mSyncManager->mAskForPreferences = true; |
1749 | mSyncManager->mSyncAlgoPrefs = 3; | 1749 | mSyncManager->mSyncAlgoPrefs = 3; |
1750 | mSyncManager->mWriteBackFile = false; | 1750 | mSyncManager->mWriteBackFile = false; |
1751 | mSyncManager->mWriteBackExistingOnly = false; | 1751 | mSyncManager->mWriteBackExistingOnly = false; |
1752 | mSyncManager->mShowSyncSummary = false; | 1752 | mSyncManager->mShowSyncSummary = false; |
1753 | syncCalendar( fn, 3 ); | 1753 | syncCalendar( fn, 3 ); |
1754 | Event * e = getLastSyncEvent(); | 1754 | Event * e = getLastSyncEvent(); |
1755 | mCalendar->deleteEvent ( e ); | 1755 | mCalendar->deleteEvent ( e ); |
1756 | updateView(); | 1756 | updateView(); |
1757 | return true; | 1757 | return true; |
1758 | } | 1758 | } |
1759 | 1759 | ||
1760 | bool CalendarView::saveCalendar( QString filename ) | 1760 | bool CalendarView::saveCalendar( QString filename ) |
1761 | { | 1761 | { |
1762 | 1762 | ||
1763 | // Store back all unsaved data into calendar object | 1763 | // Store back all unsaved data into calendar object |
1764 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); | 1764 | // qDebug("file %s %d ", filename.latin1() , mViewManager->currentView() ); |
1765 | if ( mViewManager->currentView() ) | 1765 | if ( mViewManager->currentView() ) |
1766 | mViewManager->currentView()->flushView(); | 1766 | mViewManager->currentView()->flushView(); |
1767 | 1767 | ||
1768 | 1768 | ||
1769 | QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); | 1769 | QDateTime lfv = QDateTime::currentDateTime().addSecs( -2); |
1770 | mStorage->setSaveFormat( new ICalFormat() ); | 1770 | mStorage->setSaveFormat( new ICalFormat() ); |
1771 | mStorage->setFileName( filename ); | 1771 | mStorage->setFileName( filename ); |
1772 | bool success; | 1772 | bool success; |
1773 | success = mStorage->save(); | 1773 | success = mStorage->save(); |
1774 | if ( !success ) { | 1774 | if ( !success ) { |
1775 | return false; | 1775 | return false; |
1776 | } | 1776 | } |
1777 | if ( filename == MainWindow::defaultFileName() ) { | 1777 | if ( filename == MainWindow::defaultFileName() ) { |
1778 | setLoadedFileVersion( lfv ); | 1778 | setLoadedFileVersion( lfv ); |
1779 | watchSavedFile(); | 1779 | watchSavedFile(); |
1780 | } | 1780 | } |
1781 | return true; | 1781 | return true; |
1782 | } | 1782 | } |
1783 | 1783 | ||
1784 | void CalendarView::closeCalendar() | 1784 | void CalendarView::closeCalendar() |
1785 | { | 1785 | { |
1786 | 1786 | ||
1787 | // child windows no longer valid | 1787 | // child windows no longer valid |
1788 | emit closingDown(); | 1788 | emit closingDown(); |
1789 | 1789 | ||
1790 | mCalendar->close(); | 1790 | mCalendar->close(); |
1791 | setModified(false); | 1791 | setModified(false); |
1792 | updateView(); | 1792 | updateView(); |
1793 | } | 1793 | } |
1794 | 1794 | ||
1795 | void CalendarView::archiveCalendar() | 1795 | void CalendarView::archiveCalendar() |
1796 | { | 1796 | { |
1797 | mDialogManager->showArchiveDialog(); | 1797 | mDialogManager->showArchiveDialog(); |
1798 | } | 1798 | } |
1799 | 1799 | ||
1800 | 1800 | ||
1801 | void CalendarView::readSettings() | 1801 | void CalendarView::readSettings() |
1802 | { | 1802 | { |
1803 | 1803 | ||
1804 | 1804 | ||
1805 | // mViewManager->showAgendaView(); | 1805 | // mViewManager->showAgendaView(); |
1806 | QString str; | 1806 | QString str; |
1807 | //qDebug("CalendarView::readSettings() "); | 1807 | //qDebug("CalendarView::readSettings() "); |
1808 | // read settings from the KConfig, supplying reasonable | 1808 | // read settings from the KConfig, supplying reasonable |
1809 | // defaults where none are to be found | 1809 | // defaults where none are to be found |
1810 | KConfig *config = KOGlobals::config(); | 1810 | KConfig *config = KOGlobals::config(); |
1811 | #ifndef KORG_NOSPLITTER | 1811 | #ifndef KORG_NOSPLITTER |
1812 | config->setGroup("KOrganizer Geometry"); | 1812 | config->setGroup("KOrganizer Geometry"); |
1813 | 1813 | ||
1814 | QValueList<int> sizes = config->readIntListEntry("Separator1"); | 1814 | QValueList<int> sizes = config->readIntListEntry("Separator1"); |
1815 | if (sizes.count() != 2) { | 1815 | if (sizes.count() != 2) { |
1816 | sizes << mDateNavigator->minimumSizeHint().width(); | 1816 | sizes << mDateNavigator->minimumSizeHint().width(); |
1817 | sizes << 300; | 1817 | sizes << 300; |
1818 | } | 1818 | } |
1819 | mPanner->setSizes(sizes); | 1819 | mPanner->setSizes(sizes); |
1820 | 1820 | ||
1821 | sizes = config->readIntListEntry("Separator2"); | 1821 | sizes = config->readIntListEntry("Separator2"); |
1822 | if ( ( mResourceView && sizes.count() == 4 ) || | 1822 | if ( ( mResourceView && sizes.count() == 4 ) || |
1823 | ( !mResourceView && sizes.count() == 3 ) ) { | 1823 | ( !mResourceView && sizes.count() == 3 ) ) { |
1824 | mLeftSplitter->setSizes(sizes); | 1824 | mLeftSplitter->setSizes(sizes); |
1825 | } | 1825 | } |
1826 | #endif | 1826 | #endif |
1827 | globalFlagBlockAgenda = 1; | 1827 | globalFlagBlockAgenda = 1; |
1828 | mViewManager->showAgendaView(); | 1828 | mViewManager->showAgendaView(); |
1829 | //mViewManager->readSettings( config ); | 1829 | //mViewManager->readSettings( config ); |
1830 | mTodoList->restoreLayout(config,QString("Todo Layout")); | 1830 | mTodoList->restoreLayout(config,QString("Todo Layout")); |
1831 | readFilterSettings(config); | 1831 | readFilterSettings(config); |
1832 | 1832 | ||
1833 | #ifdef DESKTOP_VERSION | 1833 | #ifdef DESKTOP_VERSION |
1834 | config->setGroup("WidgetLayout"); | 1834 | config->setGroup("WidgetLayout"); |
1835 | QStringList list; | 1835 | QStringList list; |
1836 | list = config->readListEntry("MainLayout"); | 1836 | list = config->readListEntry("MainLayout"); |
1837 | int x,y,w,h; | 1837 | int x,y,w,h; |
1838 | if ( ! list.isEmpty() ) { | 1838 | if ( ! list.isEmpty() ) { |
1839 | x = list[0].toInt(); | 1839 | x = list[0].toInt(); |
1840 | y = list[1].toInt(); | 1840 | y = list[1].toInt(); |
1841 | w = list[2].toInt(); | 1841 | w = list[2].toInt(); |
1842 | h = list[3].toInt(); | 1842 | h = list[3].toInt(); |
1843 | topLevelWidget()->setGeometry(x,y,w,h); | 1843 | topLevelWidget()->setGeometry(x,y,w,h); |
1844 | 1844 | ||
1845 | } else { | 1845 | } else { |
1846 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | 1846 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); |
1847 | } | 1847 | } |
1848 | list = config->readListEntry("EditEventLayout"); | 1848 | list = config->readListEntry("EditEventLayout"); |
1849 | if ( ! list.isEmpty() ) { | 1849 | if ( ! list.isEmpty() ) { |
1850 | x = list[0].toInt(); | 1850 | x = list[0].toInt(); |
1851 | y = list[1].toInt(); | 1851 | y = list[1].toInt(); |
1852 | w = list[2].toInt(); | 1852 | w = list[2].toInt(); |
1853 | h = list[3].toInt(); | 1853 | h = list[3].toInt(); |
1854 | mEventEditor->setGeometry(x,y,w,h); | 1854 | mEventEditor->setGeometry(x,y,w,h); |
1855 | 1855 | ||
1856 | } | 1856 | } |
1857 | list = config->readListEntry("EditTodoLayout"); | 1857 | list = config->readListEntry("EditTodoLayout"); |
1858 | if ( ! list.isEmpty() ) { | 1858 | if ( ! list.isEmpty() ) { |
1859 | x = list[0].toInt(); | 1859 | x = list[0].toInt(); |
1860 | y = list[1].toInt(); | 1860 | y = list[1].toInt(); |
1861 | w = list[2].toInt(); | 1861 | w = list[2].toInt(); |
1862 | h = list[3].toInt(); | 1862 | h = list[3].toInt(); |
1863 | mTodoEditor->setGeometry(x,y,w,h); | 1863 | mTodoEditor->setGeometry(x,y,w,h); |
1864 | 1864 | ||
1865 | } | 1865 | } |
1866 | list = config->readListEntry("ViewerLayout"); | 1866 | list = config->readListEntry("ViewerLayout"); |
1867 | if ( ! list.isEmpty() ) { | 1867 | if ( ! list.isEmpty() ) { |
1868 | x = list[0].toInt(); | 1868 | x = list[0].toInt(); |
1869 | y = list[1].toInt(); | 1869 | y = list[1].toInt(); |
1870 | w = list[2].toInt(); | 1870 | w = list[2].toInt(); |
1871 | h = list[3].toInt(); | 1871 | h = list[3].toInt(); |
1872 | getEventViewerDialog()->setGeometry(x,y,w,h); | 1872 | getEventViewerDialog()->setGeometry(x,y,w,h); |
1873 | } | 1873 | } |
1874 | #endif | 1874 | #endif |
1875 | config->setGroup( "Views" ); | 1875 | config->setGroup( "Views" ); |
1876 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 1876 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
1877 | 1877 | ||
1878 | QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); | 1878 | QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); |
1879 | 1879 | ||
1880 | int resetval = 0; | 1880 | int resetval = 0; |
1881 | int maxVal = 0; | 1881 | int maxVal = 0; |
1882 | if (sizes.count() != 3) { | 1882 | if (sizes.count() != 3) { |
1883 | if ( KOPrefs::instance()->mVerticalScreen ) { | 1883 | if ( KOPrefs::instance()->mVerticalScreen ) { |
1884 | resetval = mDateNavigator->sizeHint().width()+2; | 1884 | resetval = mDateNavigator->sizeHint().width()+2; |
1885 | } else { | 1885 | } else { |
1886 | resetval = mDateNavigator->sizeHint().height()+2; | 1886 | resetval = mDateNavigator->sizeHint().height()+2; |
1887 | } | 1887 | } |
1888 | } | 1888 | } |
1889 | if ( resetval ) { | 1889 | if ( resetval ) { |
1890 | sizes.clear(); | 1890 | sizes.clear(); |
1891 | if ( KOPrefs::instance()->mVerticalScreen ) { | 1891 | if ( KOPrefs::instance()->mVerticalScreen ) { |
1892 | maxVal = QApplication::desktop()->width() -10; | 1892 | maxVal = QApplication::desktop()->width() -10; |
1893 | } else { | 1893 | } else { |
1894 | maxVal = QApplication::desktop()->height()-10; | 1894 | maxVal = QApplication::desktop()->height()-10; |
1895 | } | 1895 | } |
1896 | sizes << resetval; | 1896 | sizes << resetval; |
1897 | if ( maxVal < resetval + resetval) | 1897 | if ( maxVal < resetval + resetval) |
1898 | resetval = maxVal - resetval; | 1898 | resetval = maxVal - resetval; |
1899 | sizes << resetval; | 1899 | sizes << resetval; |
1900 | sizes << 100; | 1900 | sizes << 100; |
1901 | } | 1901 | } |
1902 | mLeftFrame->setSizes(sizes); | 1902 | mLeftFrame->setSizes(sizes); |
1903 | sizes = config->readIntListEntry("Main Splitter Frame"); | 1903 | sizes = config->readIntListEntry("Main Splitter Frame"); |
1904 | resetval = 0; | 1904 | resetval = 0; |
1905 | maxVal = 0; | 1905 | maxVal = 0; |
1906 | if (sizes.count() != 2) { | 1906 | if (sizes.count() != 2) { |
1907 | if ( !KOPrefs::instance()->mVerticalScreen ) { | 1907 | if ( !KOPrefs::instance()->mVerticalScreen ) { |
1908 | resetval = mDateNavigator->sizeHint().width()+2; | 1908 | resetval = mDateNavigator->sizeHint().width()+2; |
1909 | } else { | 1909 | } else { |
1910 | resetval = mDateNavigator->sizeHint().height()+2; | 1910 | resetval = mDateNavigator->sizeHint().height()+2; |
1911 | } | 1911 | } |
1912 | } | 1912 | } |
1913 | if ( resetval ) { | 1913 | if ( resetval ) { |
1914 | sizes.clear(); | 1914 | sizes.clear(); |
1915 | if ( !KOPrefs::instance()->mVerticalScreen ) { | 1915 | if ( !KOPrefs::instance()->mVerticalScreen ) { |
1916 | maxVal = QApplication::desktop()->width() -10; | 1916 | maxVal = QApplication::desktop()->width() -10; |
1917 | } else { | 1917 | } else { |
1918 | maxVal = QApplication::desktop()->height()-10; | 1918 | maxVal = QApplication::desktop()->height()-10; |
1919 | } | 1919 | } |
1920 | sizes << resetval; | 1920 | sizes << resetval; |
1921 | if ( maxVal < resetval + resetval) | 1921 | if ( maxVal < resetval + resetval) |
1922 | resetval = maxVal - resetval; | 1922 | resetval = maxVal - resetval; |
1923 | sizes << resetval; | 1923 | sizes << resetval; |
1924 | } | 1924 | } |
1925 | mMainFrame->setSizes(sizes); | 1925 | mMainFrame->setSizes(sizes); |
1926 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1926 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1927 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1927 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
1928 | else mNavigator->selectDates( dateCount ); | 1928 | else mNavigator->selectDates( dateCount ); |
1929 | // mViewManager->readSettings( config ); | 1929 | // mViewManager->readSettings( config ); |
1930 | updateConfig(); | 1930 | updateConfig(); |
1931 | globalFlagBlockAgenda = 2; | 1931 | globalFlagBlockAgenda = 2; |
1932 | mViewManager->readSettings( config ); | 1932 | mViewManager->readSettings( config ); |
1933 | QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); | 1933 | QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); |
1934 | } | 1934 | } |
1935 | 1935 | ||
1936 | 1936 | ||
1937 | void CalendarView::writeSettings() | 1937 | void CalendarView::writeSettings() |
1938 | { | 1938 | { |
1939 | // kdDebug() << "CalendarView::writeSettings" << endl; | 1939 | // kdDebug() << "CalendarView::writeSettings" << endl; |
1940 | 1940 | ||
1941 | KConfig *config = KOGlobals::config(); | 1941 | KConfig *config = KOGlobals::config(); |
1942 | 1942 | ||
1943 | mViewManager->writeSettings( config ); | 1943 | mViewManager->writeSettings( config ); |
1944 | mTodoList->saveLayout(config,QString("Todo Layout")); | 1944 | mTodoList->saveLayout(config,QString("Todo Layout")); |
1945 | mDialogManager->writeSettings( config ); | 1945 | mDialogManager->writeSettings( config ); |
1946 | //KOPrefs::instance()->usrWriteConfig(); | 1946 | //KOPrefs::instance()->usrWriteConfig(); |
1947 | KOPrefs::instance()->writeConfig(); | 1947 | KOPrefs::instance()->writeConfig(); |
1948 | 1948 | ||
1949 | writeFilterSettings(config); | 1949 | writeFilterSettings(config); |
1950 | 1950 | ||
1951 | config->setGroup( "Views" ); | 1951 | config->setGroup( "Views" ); |
1952 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); | 1952 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); |
1953 | 1953 | ||
1954 | QValueList<int> listINT = mLeftFrame->sizes(); | 1954 | QValueList<int> listINT = mLeftFrame->sizes(); |
1955 | config->writeEntry("Left Splitter Frame",listINT); | 1955 | config->writeEntry("Left Splitter Frame",listINT); |
1956 | QValueList<int> listINT2 = mMainFrame->sizes(); | 1956 | QValueList<int> listINT2 = mMainFrame->sizes(); |
1957 | config->writeEntry("Main Splitter Frame",listINT2); | 1957 | config->writeEntry("Main Splitter Frame",listINT2); |
1958 | #ifdef DESKTOP_VERSION | 1958 | #ifdef DESKTOP_VERSION |
1959 | config->setGroup("WidgetLayout"); | 1959 | config->setGroup("WidgetLayout"); |
1960 | QStringList list ;//= config->readListEntry("MainLayout"); | 1960 | QStringList list ;//= config->readListEntry("MainLayout"); |
1961 | int x,y,w,h; | 1961 | int x,y,w,h; |
1962 | QWidget* wid; | 1962 | QWidget* wid; |
1963 | wid = topLevelWidget(); | 1963 | wid = topLevelWidget(); |
1964 | x = wid->geometry().x(); | 1964 | x = wid->geometry().x(); |
1965 | y = wid->geometry().y(); | 1965 | y = wid->geometry().y(); |
1966 | w = wid->width(); | 1966 | w = wid->width(); |
1967 | h = wid->height(); | 1967 | h = wid->height(); |
1968 | list.clear(); | 1968 | list.clear(); |
1969 | list << QString::number( x ); | 1969 | list << QString::number( x ); |
1970 | list << QString::number( y ); | 1970 | list << QString::number( y ); |
1971 | list << QString::number( w ); | 1971 | list << QString::number( w ); |
1972 | list << QString::number( h ); | 1972 | list << QString::number( h ); |
1973 | config->writeEntry("MainLayout",list ); | 1973 | config->writeEntry("MainLayout",list ); |
1974 | 1974 | ||
1975 | wid = mEventEditor; | 1975 | wid = mEventEditor; |
1976 | x = wid->geometry().x(); | 1976 | x = wid->geometry().x(); |
1977 | y = wid->geometry().y(); | 1977 | y = wid->geometry().y(); |
1978 | w = wid->width(); | 1978 | w = wid->width(); |
1979 | h = wid->height(); | 1979 | h = wid->height(); |
1980 | list.clear(); | 1980 | list.clear(); |
1981 | list << QString::number( x ); | 1981 | list << QString::number( x ); |
1982 | list << QString::number( y ); | 1982 | list << QString::number( y ); |
1983 | list << QString::number( w ); | 1983 | list << QString::number( w ); |
1984 | list << QString::number( h ); | 1984 | list << QString::number( h ); |
1985 | config->writeEntry("EditEventLayout",list ); | 1985 | config->writeEntry("EditEventLayout",list ); |
1986 | 1986 | ||
1987 | wid = mTodoEditor; | 1987 | wid = mTodoEditor; |
1988 | x = wid->geometry().x(); | 1988 | x = wid->geometry().x(); |
1989 | y = wid->geometry().y(); | 1989 | y = wid->geometry().y(); |
1990 | w = wid->width(); | 1990 | w = wid->width(); |
1991 | h = wid->height(); | 1991 | h = wid->height(); |
1992 | list.clear(); | 1992 | list.clear(); |
1993 | list << QString::number( x ); | 1993 | list << QString::number( x ); |
1994 | list << QString::number( y ); | 1994 | list << QString::number( y ); |
1995 | list << QString::number( w ); | 1995 | list << QString::number( w ); |
1996 | list << QString::number( h ); | 1996 | list << QString::number( h ); |
1997 | config->writeEntry("EditTodoLayout",list ); | 1997 | config->writeEntry("EditTodoLayout",list ); |
1998 | wid = getEventViewerDialog(); | 1998 | wid = getEventViewerDialog(); |
1999 | x = wid->geometry().x(); | 1999 | x = wid->geometry().x(); |
2000 | y = wid->geometry().y(); | 2000 | y = wid->geometry().y(); |
2001 | w = wid->width(); | 2001 | w = wid->width(); |
2002 | h = wid->height(); | 2002 | h = wid->height(); |
2003 | list.clear(); | 2003 | list.clear(); |
2004 | list << QString::number( x ); | 2004 | list << QString::number( x ); |
2005 | list << QString::number( y ); | 2005 | list << QString::number( y ); |
2006 | list << QString::number( w ); | 2006 | list << QString::number( w ); |
2007 | list << QString::number( h ); | 2007 | list << QString::number( h ); |
2008 | config->writeEntry("ViewerLayout",list ); | 2008 | config->writeEntry("ViewerLayout",list ); |
2009 | wid = mDialogManager->getSearchDialog(); | 2009 | wid = mDialogManager->getSearchDialog(); |
2010 | if ( wid ) { | 2010 | if ( wid ) { |
2011 | x = wid->geometry().x(); | 2011 | x = wid->geometry().x(); |
2012 | y = wid->geometry().y(); | 2012 | y = wid->geometry().y(); |
2013 | w = wid->width(); | 2013 | w = wid->width(); |
2014 | h = wid->height(); | 2014 | h = wid->height(); |
2015 | list.clear(); | 2015 | list.clear(); |
2016 | list << QString::number( x ); | 2016 | list << QString::number( x ); |
2017 | list << QString::number( y ); | 2017 | list << QString::number( y ); |
2018 | list << QString::number( w ); | 2018 | list << QString::number( w ); |
2019 | list << QString::number( h ); | 2019 | list << QString::number( h ); |
2020 | config->writeEntry("SearchLayout",list ); | 2020 | config->writeEntry("SearchLayout",list ); |
2021 | } | 2021 | } |
2022 | #endif | 2022 | #endif |
2023 | 2023 | ||
2024 | 2024 | ||
2025 | config->sync(); | 2025 | config->sync(); |
2026 | } | 2026 | } |
2027 | 2027 | ||
2028 | void CalendarView::readFilterSettings(KConfig *config) | 2028 | void CalendarView::readFilterSettings(KConfig *config) |
2029 | { | 2029 | { |
2030 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; | 2030 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; |
2031 | 2031 | ||
2032 | mFilters.clear(); | 2032 | mFilters.clear(); |
2033 | 2033 | ||
2034 | config->setGroup("General"); | 2034 | config->setGroup("General"); |
2035 | QStringList filterList = config->readListEntry("CalendarFilters"); | 2035 | QStringList filterList = config->readListEntry("CalendarFilters"); |
2036 | 2036 | ||
2037 | QStringList::ConstIterator it = filterList.begin(); | 2037 | QStringList::ConstIterator it = filterList.begin(); |
2038 | QStringList::ConstIterator end = filterList.end(); | 2038 | QStringList::ConstIterator end = filterList.end(); |
2039 | while(it != end) { | 2039 | while(it != end) { |
2040 | // kdDebug() << " filter: " << (*it) << endl; | 2040 | // kdDebug() << " filter: " << (*it) << endl; |
2041 | 2041 | ||
2042 | CalFilter *filter; | 2042 | CalFilter *filter; |
2043 | filter = new CalFilter(*it); | 2043 | filter = new CalFilter(*it); |
2044 | config->setGroup("Filter_" + (*it)); | 2044 | config->setGroup("Filter_" + (*it)); |
2045 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); | 2045 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); |
2046 | filter->setCriteria(config->readNumEntry("Criteria",0)); | 2046 | filter->setCriteria(config->readNumEntry("Criteria",0)); |
2047 | filter->setCategoryList(config->readListEntry("CategoryList")); | 2047 | filter->setCategoryList(config->readListEntry("CategoryList")); |
2048 | mFilters.append(filter); | 2048 | mFilters.append(filter); |
2049 | 2049 | ||
2050 | ++it; | 2050 | ++it; |
2051 | } | 2051 | } |
2052 | 2052 | ||
2053 | if (mFilters.count() == 0) { | 2053 | if (mFilters.count() == 0) { |
2054 | CalFilter *filter = new CalFilter(i18n("Default")); | 2054 | CalFilter *filter = new CalFilter(i18n("Default")); |
2055 | mFilters.append(filter); | 2055 | mFilters.append(filter); |
2056 | } | 2056 | } |
2057 | mFilterView->updateFilters(); | 2057 | mFilterView->updateFilters(); |
2058 | config->setGroup("FilterView"); | 2058 | config->setGroup("FilterView"); |
2059 | 2059 | ||
2060 | mFilterView->blockSignals(true); | 2060 | mFilterView->blockSignals(true); |
2061 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); | 2061 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); |
2062 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); | 2062 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); |
2063 | mFilterView->blockSignals(false); | 2063 | mFilterView->blockSignals(false); |
2064 | // We do it manually to avoid it being done twice by the above calls | 2064 | // We do it manually to avoid it being done twice by the above calls |
2065 | updateFilter(); | 2065 | updateFilter(); |
2066 | } | 2066 | } |
2067 | 2067 | ||
2068 | void CalendarView::writeFilterSettings(KConfig *config) | 2068 | void CalendarView::writeFilterSettings(KConfig *config) |
2069 | { | 2069 | { |
2070 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; | 2070 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; |
2071 | 2071 | ||
2072 | QStringList filterList; | 2072 | QStringList filterList; |
2073 | 2073 | ||
2074 | CalFilter *filter = mFilters.first(); | 2074 | CalFilter *filter = mFilters.first(); |
2075 | while(filter) { | 2075 | while(filter) { |
2076 | // kdDebug() << " fn: " << filter->name() << endl; | 2076 | // kdDebug() << " fn: " << filter->name() << endl; |
2077 | filterList << filter->name(); | 2077 | filterList << filter->name(); |
2078 | config->setGroup("Filter_" + filter->name()); | 2078 | config->setGroup("Filter_" + filter->name()); |
2079 | config->writeEntry("Criteria",filter->criteria()); | 2079 | config->writeEntry("Criteria",filter->criteria()); |
2080 | config->writeEntry("CategoryList",filter->categoryList()); | 2080 | config->writeEntry("CategoryList",filter->categoryList()); |
2081 | filter = mFilters.next(); | 2081 | filter = mFilters.next(); |
2082 | } | 2082 | } |
2083 | config->setGroup("General"); | 2083 | config->setGroup("General"); |
2084 | config->writeEntry("CalendarFilters",filterList); | 2084 | config->writeEntry("CalendarFilters",filterList); |
2085 | 2085 | ||
2086 | config->setGroup("FilterView"); | 2086 | config->setGroup("FilterView"); |
2087 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); | 2087 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); |
2088 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); | 2088 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); |
2089 | } | 2089 | } |
2090 | 2090 | ||
2091 | 2091 | ||
2092 | void CalendarView::goToday() | 2092 | void CalendarView::goToday() |
2093 | { | 2093 | { |
2094 | if ( mViewManager->currentView()->isMonthView() ) | 2094 | if ( mViewManager->currentView()->isMonthView() ) |
2095 | mNavigator->selectTodayMonth(); | 2095 | mNavigator->selectTodayMonth(); |
2096 | else | 2096 | else |
2097 | mNavigator->selectToday(); | 2097 | mNavigator->selectToday(); |
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | void CalendarView::goNext() | 2100 | void CalendarView::goNext() |
2101 | { | 2101 | { |
2102 | mNavigator->selectNext(); | 2102 | mNavigator->selectNext(); |
2103 | } | 2103 | } |
2104 | 2104 | ||
2105 | void CalendarView::goPrevious() | 2105 | void CalendarView::goPrevious() |
2106 | { | 2106 | { |
2107 | mNavigator->selectPrevious(); | 2107 | mNavigator->selectPrevious(); |
2108 | } | 2108 | } |
2109 | void CalendarView::goNextMonth() | 2109 | void CalendarView::goNextMonth() |
2110 | { | 2110 | { |
2111 | mNavigator->selectNextMonth(); | 2111 | mNavigator->selectNextMonth(); |
2112 | } | 2112 | } |
2113 | 2113 | ||
2114 | void CalendarView::goPreviousMonth() | 2114 | void CalendarView::goPreviousMonth() |
2115 | { | 2115 | { |
2116 | mNavigator->selectPreviousMonth(); | 2116 | mNavigator->selectPreviousMonth(); |
2117 | } | 2117 | } |
2118 | void CalendarView::writeLocale() | 2118 | void CalendarView::writeLocale() |
2119 | { | 2119 | { |
2120 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 2120 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
2121 | #if 0 | 2121 | #if 0 |
2122 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); | 2122 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); |
2123 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); | 2123 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); |
2124 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); | 2124 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); |
2125 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); | 2125 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); |
2126 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; | 2126 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; |
2127 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 2127 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
2128 | dummy = KOPrefs::instance()->mUserDateFormatShort; | 2128 | dummy = KOPrefs::instance()->mUserDateFormatShort; |
2129 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 2129 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
2130 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, | 2130 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, |
2131 | KOPrefs::instance()->mDaylightsavingStart, | 2131 | KOPrefs::instance()->mDaylightsavingStart, |
2132 | KOPrefs::instance()->mDaylightsavingEnd ); | 2132 | KOPrefs::instance()->mDaylightsavingEnd ); |
2133 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); | 2133 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); |
2134 | #endif | 2134 | #endif |
2135 | } | 2135 | } |
2136 | void CalendarView::updateConfig() | 2136 | void CalendarView::updateConfig() |
2137 | { | 2137 | { |
2138 | writeLocale(); | 2138 | writeLocale(); |
2139 | if ( KOPrefs::instance()->mUseAppColors ) | 2139 | if ( KOPrefs::instance()->mUseAppColors ) |
2140 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2140 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2141 | emit configChanged(); | 2141 | emit configChanged(); |
2142 | mTodoList->updateConfig(); | 2142 | mTodoList->updateConfig(); |
2143 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2143 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2144 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2144 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2145 | // To make the "fill window" configurations work | 2145 | // To make the "fill window" configurations work |
2146 | //mViewManager->raiseCurrentView(); | 2146 | //mViewManager->raiseCurrentView(); |
2147 | } | 2147 | } |
2148 | 2148 | ||
2149 | 2149 | ||
2150 | void CalendarView::eventChanged(Event *event) | 2150 | void CalendarView::eventChanged(Event *event) |
2151 | { | 2151 | { |
2152 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2152 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2153 | //updateUnmanagedViews(); | 2153 | //updateUnmanagedViews(); |
2154 | } | 2154 | } |
2155 | 2155 | ||
2156 | void CalendarView::eventAdded(Event *event) | 2156 | void CalendarView::eventAdded(Event *event) |
2157 | { | 2157 | { |
2158 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2158 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2159 | } | 2159 | } |
2160 | 2160 | ||
2161 | void CalendarView::eventToBeDeleted(Event *) | 2161 | void CalendarView::eventToBeDeleted(Event *) |
2162 | { | 2162 | { |
2163 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2163 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2164 | } | 2164 | } |
2165 | 2165 | ||
2166 | void CalendarView::eventDeleted() | 2166 | void CalendarView::eventDeleted() |
2167 | { | 2167 | { |
2168 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2168 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2169 | } | 2169 | } |
2170 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2170 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2171 | { | 2171 | { |
2172 | changeIncidenceDisplay((Incidence *)which, action); | 2172 | changeIncidenceDisplay((Incidence *)which, action); |
2173 | mDateNavigator->updateView(); //LR | 2173 | mDateNavigator->updateView(); //LR |
2174 | //mDialogManager->updateSearchDialog(); | 2174 | //mDialogManager->updateSearchDialog(); |
2175 | 2175 | ||
2176 | if (which) { | 2176 | if (which) { |
2177 | mViewManager->updateWNview(); | 2177 | mViewManager->updateWNview(); |
2178 | //mTodoList->updateView(); | 2178 | //mTodoList->updateView(); |
2179 | } | 2179 | } |
2180 | 2180 | ||
2181 | } | 2181 | } |
2182 | 2182 | ||
2183 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) | 2183 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) |
2184 | { | 2184 | { |
2185 | updateUnmanagedViews(); | 2185 | updateUnmanagedViews(); |
2186 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); | 2186 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); |
2187 | if ( action == KOGlobals::EVENTDELETED ) { //delete | 2187 | if ( action == KOGlobals::EVENTDELETED ) { //delete |
2188 | mCalendar->checkAlarmForIncidence( 0, true ); | 2188 | mCalendar->checkAlarmForIncidence( 0, true ); |
2189 | if ( mEventViewerDialog ) | 2189 | if ( mEventViewerDialog ) |
2190 | mEventViewerDialog->hide(); | 2190 | mEventViewerDialog->hide(); |
2191 | } | 2191 | } |
2192 | else | 2192 | else |
2193 | mCalendar->checkAlarmForIncidence( which , false ); | 2193 | mCalendar->checkAlarmForIncidence( which , false ); |
2194 | } | 2194 | } |
2195 | 2195 | ||
2196 | // most of the changeEventDisplays() right now just call the view's | 2196 | // most of the changeEventDisplays() right now just call the view's |
2197 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. | 2197 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. |
2198 | void CalendarView::changeEventDisplay(Event *which, int action) | 2198 | void CalendarView::changeEventDisplay(Event *which, int action) |
2199 | { | 2199 | { |
2200 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; | 2200 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; |
2201 | changeIncidenceDisplay((Incidence *)which, action); | 2201 | changeIncidenceDisplay((Incidence *)which, action); |
2202 | mDateNavigator->updateView(); | 2202 | mDateNavigator->updateView(); |
2203 | //mDialogManager->updateSearchDialog(); | 2203 | //mDialogManager->updateSearchDialog(); |
2204 | 2204 | ||
2205 | if (which) { | 2205 | if (which) { |
2206 | // If there is an event view visible update the display | 2206 | // If there is an event view visible update the display |
2207 | mViewManager->currentView()->changeEventDisplay(which,action); | 2207 | mViewManager->currentView()->changeEventDisplay(which,action); |
2208 | // TODO: check, if update needed | 2208 | // TODO: check, if update needed |
2209 | // if (which->getTodoStatus()) { | 2209 | // if (which->getTodoStatus()) { |
2210 | mTodoList->updateView(); | 2210 | mTodoList->updateView(); |
2211 | // } | 2211 | // } |
2212 | } else { | 2212 | } else { |
2213 | mViewManager->currentView()->updateView(); | 2213 | mViewManager->currentView()->updateView(); |
2214 | } | 2214 | } |
2215 | } | 2215 | } |
2216 | 2216 | ||
2217 | 2217 | ||
2218 | void CalendarView::updateTodoViews() | 2218 | void CalendarView::updateTodoViews() |
2219 | { | 2219 | { |
2220 | mTodoList->updateView(); | 2220 | mTodoList->updateView(); |
2221 | mViewManager->currentView()->updateView(); | 2221 | mViewManager->currentView()->updateView(); |
2222 | 2222 | ||
2223 | } | 2223 | } |
2224 | 2224 | ||
2225 | 2225 | ||
2226 | void CalendarView::updateView(const QDate &start, const QDate &end) | 2226 | void CalendarView::updateView(const QDate &start, const QDate &end) |
2227 | { | 2227 | { |
2228 | mTodoList->updateView(); | 2228 | mTodoList->updateView(); |
2229 | mViewManager->updateView(start, end); | 2229 | mViewManager->updateView(start, end); |
2230 | //mDateNavigator->updateView(); | 2230 | //mDateNavigator->updateView(); |
2231 | } | 2231 | } |
2232 | 2232 | ||
2233 | void CalendarView::updateView() | 2233 | void CalendarView::updateView() |
2234 | { | 2234 | { |
2235 | DateList tmpList = mNavigator->selectedDates(); | 2235 | DateList tmpList = mNavigator->selectedDates(); |
2236 | 2236 | ||
2237 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | 2237 | if ( KOPrefs::instance()->mHideNonStartedTodos ) |
2238 | mTodoList->updateView(); | 2238 | mTodoList->updateView(); |
2239 | // We assume that the navigator only selects consecutive days. | 2239 | // We assume that the navigator only selects consecutive days. |
2240 | updateView( tmpList.first(), tmpList.last() ); | 2240 | updateView( tmpList.first(), tmpList.last() ); |
2241 | } | 2241 | } |
2242 | 2242 | ||
2243 | void CalendarView::updateUnmanagedViews() | 2243 | void CalendarView::updateUnmanagedViews() |
2244 | { | 2244 | { |
2245 | mDateNavigator->updateDayMatrix(); | 2245 | mDateNavigator->updateDayMatrix(); |
2246 | } | 2246 | } |
2247 | 2247 | ||
2248 | int CalendarView::msgItemDelete(const QString name) | 2248 | int CalendarView::msgItemDelete(const QString name) |
2249 | { | 2249 | { |
2250 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ | 2250 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ |
2251 | i18n("This item will be\npermanently deleted."), | 2251 | i18n("This item will be\npermanently deleted."), |
2252 | i18n("KO/Pi Confirmation"),i18n("Delete")); | 2252 | i18n("KO/Pi Confirmation"),i18n("Delete")); |
2253 | } | 2253 | } |
2254 | 2254 | ||
2255 | 2255 | ||
2256 | void CalendarView::edit_cut() | 2256 | void CalendarView::edit_cut() |
2257 | { | 2257 | { |
2258 | Event *anEvent=0; | 2258 | Event *anEvent=0; |
2259 | 2259 | ||
2260 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2260 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2261 | 2261 | ||
2262 | if (mViewManager->currentView()->isEventView()) { | 2262 | if (mViewManager->currentView()->isEventView()) { |
2263 | if ( incidence && incidence->type() == "Event" ) { | 2263 | if ( incidence && incidence->type() == "Event" ) { |
2264 | anEvent = static_cast<Event *>(incidence); | 2264 | anEvent = static_cast<Event *>(incidence); |
2265 | } | 2265 | } |
2266 | } | 2266 | } |
2267 | 2267 | ||
2268 | if (!anEvent) { | 2268 | if (!anEvent) { |
2269 | KNotifyClient::beep(); | 2269 | KNotifyClient::beep(); |
2270 | return; | 2270 | return; |
2271 | } | 2271 | } |
2272 | DndFactory factory( mCalendar ); | 2272 | DndFactory factory( mCalendar ); |
2273 | factory.cutIncidence(anEvent); | 2273 | factory.cutIncidence(anEvent); |
2274 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 2274 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
2275 | } | 2275 | } |
2276 | 2276 | ||
2277 | void CalendarView::edit_copy() | 2277 | void CalendarView::edit_copy() |
2278 | { | 2278 | { |
2279 | Event *anEvent=0; | 2279 | Event *anEvent=0; |
2280 | 2280 | ||
2281 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2281 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2282 | 2282 | ||
2283 | if (mViewManager->currentView()->isEventView()) { | 2283 | if (mViewManager->currentView()->isEventView()) { |
2284 | if ( incidence && incidence->type() == "Event" ) { | 2284 | if ( incidence && incidence->type() == "Event" ) { |
2285 | anEvent = static_cast<Event *>(incidence); | 2285 | anEvent = static_cast<Event *>(incidence); |
2286 | } | 2286 | } |
2287 | } | 2287 | } |
2288 | 2288 | ||
2289 | if (!anEvent) { | 2289 | if (!anEvent) { |
2290 | KNotifyClient::beep(); | 2290 | KNotifyClient::beep(); |
2291 | return; | 2291 | return; |
2292 | } | 2292 | } |
2293 | DndFactory factory( mCalendar ); | 2293 | DndFactory factory( mCalendar ); |
2294 | factory.copyIncidence(anEvent); | 2294 | factory.copyIncidence(anEvent); |
2295 | } | 2295 | } |
2296 | 2296 | ||
2297 | void CalendarView::edit_paste() | 2297 | void CalendarView::edit_paste() |
2298 | { | 2298 | { |
2299 | QDate date = mNavigator->selectedDates().first(); | 2299 | QDate date = mNavigator->selectedDates().first(); |
2300 | 2300 | ||
2301 | DndFactory factory( mCalendar ); | 2301 | DndFactory factory( mCalendar ); |
2302 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); | 2302 | Event *pastedEvent = (Event *)factory.pasteIncidence( date ); |
2303 | 2303 | ||
2304 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); | 2304 | changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); |
2305 | } | 2305 | } |
2306 | 2306 | ||
2307 | void CalendarView::edit_options() | 2307 | void CalendarView::edit_options() |
2308 | { | 2308 | { |
2309 | QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; | 2309 | QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; |
2310 | emit save(); | 2310 | emit save(); |
2311 | emit saveStopTimer(); | 2311 | emit saveStopTimer(); |
2312 | mDialogManager->showOptionsDialog(); | 2312 | mDialogManager->showOptionsDialog(); |
2313 | if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { | 2313 | if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { |
2314 | emit saveStopTimer(); | 2314 | emit saveStopTimer(); |
2315 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), | 2315 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), |
2316 | i18n("Timezone settings"),i18n("Reload"))) { | 2316 | i18n("Timezone settings"),i18n("Reload"))) { |
2317 | qDebug("KO: TZ reload cancelled "); | 2317 | qDebug("KO: TZ reload cancelled "); |
2318 | return; | 2318 | return; |
2319 | } | 2319 | } |
2320 | qDebug("KO: Timezone change "); | 2320 | qDebug("KO: Timezone change "); |
2321 | openCalendar( MainWindow::defaultFileName() ); | 2321 | openCalendar( MainWindow::defaultFileName() ); |
2322 | setModified(true); | 2322 | setModified(true); |
2323 | } | 2323 | } |
2324 | else | 2324 | else |
2325 | qDebug("KO: No tz change "); | 2325 | qDebug("KO: No tz change "); |
2326 | 2326 | ||
2327 | } | 2327 | } |
2328 | 2328 | ||
2329 | 2329 | ||
2330 | void CalendarView::slotSelectPickerDate( QDate d) | 2330 | void CalendarView::slotSelectPickerDate( QDate d) |
2331 | { | 2331 | { |
2332 | mDateFrame->hide(); | 2332 | mDateFrame->hide(); |
2333 | if ( mDatePickerMode == 1 ) { | 2333 | if ( mDatePickerMode == 1 ) { |
2334 | mNavigator->slotDaySelect( d ); | 2334 | mNavigator->slotDaySelect( d ); |
2335 | } else if ( mDatePickerMode == 2 ) { | 2335 | } else if ( mDatePickerMode == 2 ) { |
2336 | if ( mMoveIncidence->type() == "Todo" ) { | 2336 | if ( mMoveIncidence->type() == "Todo" ) { |
2337 | Todo * to = (Todo *) mMoveIncidence; | 2337 | Todo * to = (Todo *) mMoveIncidence; |
2338 | QTime tim; | 2338 | QTime tim; |
2339 | int len = 0; | 2339 | int len = 0; |
2340 | if ( to->hasStartDate() && to->hasDueDate() ) | 2340 | if ( to->hasStartDate() && to->hasDueDate() ) |
2341 | len = to->dtStart().secsTo( to->dtDue()); | 2341 | len = to->dtStart().secsTo( to->dtDue()); |
2342 | if ( to->hasDueDate() ) | 2342 | if ( to->hasDueDate() ) |
2343 | tim = to->dtDue().time(); | 2343 | tim = to->dtDue().time(); |
2344 | else { | 2344 | else { |
2345 | tim = QTime ( 0,0,0 ); | 2345 | tim = QTime ( 0,0,0 ); |
2346 | to->setFloats( true ); | 2346 | to->setFloats( true ); |
2347 | to->setHasDueDate( true ); | 2347 | to->setHasDueDate( true ); |
2348 | } | 2348 | } |
2349 | QDateTime dt ( d,tim ); | 2349 | QDateTime dt ( d,tim ); |
2350 | to->setDtDue( dt ); | 2350 | to->setDtDue( dt ); |
2351 | 2351 | ||
2352 | if ( to->hasStartDate() ) { | 2352 | if ( to->hasStartDate() ) { |
2353 | if ( len>0 ) | 2353 | if ( len>0 ) |
2354 | to->setDtStart(to->dtDue().addSecs( -len )); | 2354 | to->setDtStart(to->dtDue().addSecs( -len )); |
2355 | else | 2355 | else |
2356 | if (to->dtStart() > to->dtDue() ) | 2356 | if (to->dtStart() > to->dtDue() ) |
2357 | to->setDtStart(to->dtDue().addDays( -3 )); | 2357 | to->setDtStart(to->dtDue().addDays( -3 )); |
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | todoChanged( to ); | 2360 | todoChanged( to ); |
2361 | } else { | 2361 | } else { |
2362 | if ( mMoveIncidence->doesRecur() ) { | 2362 | if ( mMoveIncidence->doesRecur() ) { |
2363 | #if 0 | 2363 | #if 0 |
2364 | // PENDING implement this | 2364 | // PENDING implement this |
2365 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); | 2365 | Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); |
2366 | mCalendar()->addIncidence( newInc ); | 2366 | mCalendar()->addIncidence( newInc ); |
2367 | if ( mMoveIncidence->type() == "Todo" ) | 2367 | if ( mMoveIncidence->type() == "Todo" ) |
2368 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); | 2368 | emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); |
2369 | else | 2369 | else |
2370 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); | 2370 | emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); |
2371 | mMoveIncidence = newInc; | 2371 | mMoveIncidence = newInc; |
2372 | 2372 | ||
2373 | #endif | 2373 | #endif |
2374 | } | 2374 | } |
2375 | QTime tim = mMoveIncidence->dtStart().time(); | 2375 | QTime tim = mMoveIncidence->dtStart().time(); |
2376 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); | 2376 | int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); |
2377 | QDateTime dt ( d,tim ); | 2377 | QDateTime dt ( d,tim ); |
2378 | mMoveIncidence->setDtStart( dt ); | 2378 | mMoveIncidence->setDtStart( dt ); |
2379 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); | 2379 | ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); |
2380 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); | 2380 | changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); |
2381 | } | 2381 | } |
2382 | 2382 | ||
2383 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); | 2383 | mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); |
2384 | } | 2384 | } |
2385 | } | 2385 | } |
2386 | 2386 | ||
2387 | void CalendarView::removeCategories() | 2387 | void CalendarView::removeCategories() |
2388 | { | 2388 | { |
2389 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2389 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2390 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2390 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2391 | QStringList catIncList; | 2391 | QStringList catIncList; |
2392 | QStringList newCatList; | 2392 | QStringList newCatList; |
2393 | Incidence* inc = incList.first(); | 2393 | Incidence* inc = incList.first(); |
2394 | int i; | 2394 | int i; |
2395 | int count = 0; | 2395 | int count = 0; |
2396 | while ( inc ) { | 2396 | while ( inc ) { |
2397 | newCatList.clear(); | 2397 | newCatList.clear(); |
2398 | catIncList = inc->categories() ; | 2398 | catIncList = inc->categories() ; |
2399 | for( i = 0; i< catIncList.count(); ++i ) { | 2399 | for( i = 0; i< catIncList.count(); ++i ) { |
2400 | if ( catList.contains (catIncList[i])) | 2400 | if ( catList.contains (catIncList[i])) |
2401 | newCatList.append( catIncList[i] ); | 2401 | newCatList.append( catIncList[i] ); |
2402 | } | 2402 | } |
2403 | newCatList.sort(); | 2403 | newCatList.sort(); |
2404 | inc->setCategories( newCatList.join(",") ); | 2404 | inc->setCategories( newCatList.join(",") ); |
2405 | inc = incList.next(); | 2405 | inc = incList.next(); |
2406 | } | 2406 | } |
2407 | } | 2407 | } |
2408 | 2408 | ||
2409 | int CalendarView::addCategories() | 2409 | int CalendarView::addCategories() |
2410 | { | 2410 | { |
2411 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2411 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2412 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2412 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2413 | QStringList catIncList; | 2413 | QStringList catIncList; |
2414 | Incidence* inc = incList.first(); | 2414 | Incidence* inc = incList.first(); |
2415 | int i; | 2415 | int i; |
2416 | int count = 0; | 2416 | int count = 0; |
2417 | while ( inc ) { | 2417 | while ( inc ) { |
2418 | catIncList = inc->categories() ; | 2418 | catIncList = inc->categories() ; |
2419 | for( i = 0; i< catIncList.count(); ++i ) { | 2419 | for( i = 0; i< catIncList.count(); ++i ) { |
2420 | if ( !catList.contains (catIncList[i])) { | 2420 | if ( !catList.contains (catIncList[i])) { |
2421 | catList.append( catIncList[i] ); | 2421 | catList.append( catIncList[i] ); |
2422 | //qDebug("add cat %s ", catIncList[i].latin1()); | 2422 | //qDebug("add cat %s ", catIncList[i].latin1()); |
2423 | ++count; | 2423 | ++count; |
2424 | } | 2424 | } |
2425 | } | 2425 | } |
2426 | inc = incList.next(); | 2426 | inc = incList.next(); |
2427 | } | 2427 | } |
2428 | catList.sort(); | 2428 | catList.sort(); |
2429 | KOPrefs::instance()->mCustomCategories = catList; | 2429 | KOPrefs::instance()->mCustomCategories = catList; |
2430 | return count; | 2430 | return count; |
2431 | } | 2431 | } |
2432 | 2432 | ||
2433 | void CalendarView::manageCategories() | 2433 | void CalendarView::manageCategories() |
2434 | { | 2434 | { |
2435 | KOCatPrefs* cp = new KOCatPrefs(); | 2435 | KOCatPrefs* cp = new KOCatPrefs(); |
2436 | cp->show(); | 2436 | cp->show(); |
2437 | int w =cp->sizeHint().width() ; | 2437 | int w =cp->sizeHint().width() ; |
2438 | int h = cp->sizeHint().height() ; | 2438 | int h = cp->sizeHint().height() ; |
2439 | int dw = QApplication::desktop()->width(); | 2439 | int dw = QApplication::desktop()->width(); |
2440 | int dh = QApplication::desktop()->height(); | 2440 | int dh = QApplication::desktop()->height(); |
2441 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 2441 | cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
2442 | if ( !cp->exec() ) { | 2442 | if ( !cp->exec() ) { |
2443 | delete cp; | 2443 | delete cp; |
2444 | return; | 2444 | return; |
2445 | } | 2445 | } |
2446 | int count = 0; | 2446 | int count = 0; |
2447 | if ( cp->addCat() ) { | 2447 | if ( cp->addCat() ) { |
2448 | count = addCategories(); | 2448 | count = addCategories(); |
2449 | if ( count ) { | 2449 | if ( count ) { |
2450 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); | 2450 | topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); |
2451 | writeSettings(); | 2451 | writeSettings(); |
2452 | } else | 2452 | } else |
2453 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); | 2453 | topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); |
2454 | } else { | 2454 | } else { |
2455 | removeCategories(); | 2455 | removeCategories(); |
2456 | updateView(); | 2456 | updateView(); |
2457 | } | 2457 | } |
2458 | delete cp; | 2458 | delete cp; |
2459 | } | 2459 | } |
2460 | 2460 | ||
2461 | void CalendarView::beamIncidence(Incidence * Inc) | 2461 | void CalendarView::beamIncidence(Incidence * Inc) |
2462 | { | 2462 | { |
2463 | QPtrList<Incidence> delSel ; | 2463 | QPtrList<Incidence> delSel ; |
2464 | delSel.append(Inc); | 2464 | delSel.append(Inc); |
2465 | beamIncidenceList( delSel ); | 2465 | beamIncidenceList( delSel ); |
2466 | } | 2466 | } |
2467 | void CalendarView::beamCalendar() | 2467 | void CalendarView::beamCalendar() |
2468 | { | 2468 | { |
2469 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); | 2469 | QPtrList<Incidence> delSel = mCalendar->rawIncidences(); |
2470 | //qDebug("beamCalendar() "); | 2470 | //qDebug("beamCalendar() "); |
2471 | beamIncidenceList( delSel ); | 2471 | beamIncidenceList( delSel ); |
2472 | } | 2472 | } |
2473 | void CalendarView::beamFilteredCalendar() | 2473 | void CalendarView::beamFilteredCalendar() |
2474 | { | 2474 | { |
2475 | QPtrList<Incidence> delSel = mCalendar->incidences(); | 2475 | QPtrList<Incidence> delSel = mCalendar->incidences(); |
2476 | //qDebug("beamFilteredCalendar() "); | 2476 | //qDebug("beamFilteredCalendar() "); |
2477 | beamIncidenceList( delSel ); | 2477 | beamIncidenceList( delSel ); |
2478 | } | 2478 | } |
2479 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | 2479 | void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) |
2480 | { | 2480 | { |
2481 | if ( beamDialog->exec () == QDialog::Rejected ) | 2481 | if ( beamDialog->exec () == QDialog::Rejected ) |
2482 | return; | 2482 | return; |
2483 | #ifdef DESKTOP_VERSION | 2483 | #ifdef DESKTOP_VERSION |
2484 | QString fn = locateLocal( "tmp", "kopibeamfile" ); | 2484 | QString fn = locateLocal( "tmp", "kopibeamfile" ); |
2485 | #else | 2485 | #else |
2486 | QString fn = "/tmp/kopibeamfile"; | 2486 | QString fn = "/tmp/kopibeamfile"; |
2487 | #endif | 2487 | #endif |
2488 | QString mes; | 2488 | QString mes; |
2489 | bool createbup = true; | 2489 | bool createbup = true; |
2490 | if ( createbup ) { | 2490 | if ( createbup ) { |
2491 | QString description = "\n"; | 2491 | QString description = "\n"; |
2492 | CalendarLocal* cal = new CalendarLocal(); | 2492 | CalendarLocal* cal = new CalendarLocal(); |
2493 | if ( beamDialog->beamLocal() ) | 2493 | if ( beamDialog->beamLocal() ) |
2494 | cal->setLocalTime(); | 2494 | cal->setLocalTime(); |
2495 | else | 2495 | else |
2496 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2496 | cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2497 | Incidence *incidence = delSel.first(); | 2497 | Incidence *incidence = delSel.first(); |
2498 | bool addText = false; | 2498 | bool addText = false; |
2499 | if ( delSel.count() < 10 ) | 2499 | if ( delSel.count() < 10 ) |
2500 | addText = true; | 2500 | addText = true; |
2501 | else { | 2501 | else { |
2502 | description.sprintf(i18n(" %d items?"),delSel.count() ); | 2502 | description.sprintf(i18n(" %d items?"),delSel.count() ); |
2503 | } | 2503 | } |
2504 | while ( incidence ) { | 2504 | while ( incidence ) { |
2505 | Incidence *in = incidence->clone(); | 2505 | Incidence *in = incidence->clone(); |
2506 | if ( ! in->summary().isEmpty() ) { | 2506 | if ( ! in->summary().isEmpty() ) { |
2507 | in->setDescription(""); | 2507 | in->setDescription(""); |
2508 | } else { | 2508 | } else { |
2509 | in->setSummary( in->description().left(20)); | 2509 | in->setSummary( in->description().left(20)); |
2510 | in->setDescription(""); | 2510 | in->setDescription(""); |
2511 | } | 2511 | } |
2512 | if ( addText ) | 2512 | if ( addText ) |
2513 | description += in->summary() + "\n"; | 2513 | description += in->summary() + "\n"; |
2514 | cal->addIncidence( in ); | 2514 | cal->addIncidence( in ); |
2515 | incidence = delSel.next(); | 2515 | incidence = delSel.next(); |
2516 | } | 2516 | } |
2517 | if ( beamDialog->beamVcal() ) { | 2517 | if ( beamDialog->beamVcal() ) { |
2518 | fn += ".vcs"; | 2518 | fn += ".vcs"; |
2519 | FileStorage storage( cal, fn, new VCalFormat ); | 2519 | FileStorage storage( cal, fn, new VCalFormat ); |
2520 | storage.save(); | 2520 | storage.save(); |
2521 | } else { | 2521 | } else { |
2522 | fn += ".ics"; | 2522 | fn += ".ics"; |
2523 | FileStorage storage( cal, fn, new ICalFormat( ) ); | 2523 | FileStorage storage( cal, fn, new ICalFormat( ) ); |
2524 | storage.save(); | 2524 | storage.save(); |
2525 | } | 2525 | } |
2526 | delete cal; | 2526 | delete cal; |
2527 | mes = i18n("KO/Pi: Ready for beaming"); | 2527 | mes = i18n("KO/Pi: Ready for beaming"); |
2528 | topLevelWidget()->setCaption(mes); | 2528 | topLevelWidget()->setCaption(mes); |
2529 | KApplication::convert2latin1( fn ); | 2529 | KApplication::convert2latin1( fn ); |
2530 | #ifndef DESKTOP_VERSION | 2530 | #ifndef DESKTOP_VERSION |
2531 | Ir *ir = new Ir( this ); | 2531 | Ir *ir = new Ir( this ); |
2532 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 2532 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
2533 | ir->send( fn, description, "text/x-vCalendar" ); | 2533 | ir->send( fn, description, "text/x-vCalendar" ); |
2534 | #endif | 2534 | #endif |
2535 | } | 2535 | } |
2536 | } | 2536 | } |
2537 | void CalendarView::beamDone( Ir *ir ) | 2537 | void CalendarView::beamDone( Ir *ir ) |
2538 | { | 2538 | { |
2539 | #ifndef DESKTOP_VERSION | 2539 | #ifndef DESKTOP_VERSION |
2540 | delete ir; | 2540 | delete ir; |
2541 | #endif | 2541 | #endif |
2542 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); | 2542 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); |
2543 | topLevelWidget()->raise(); | 2543 | topLevelWidget()->raise(); |
2544 | } | 2544 | } |
2545 | 2545 | ||
2546 | void CalendarView::moveIncidence(Incidence * inc ) | 2546 | void CalendarView::moveIncidence(Incidence * inc ) |
2547 | { | 2547 | { |
2548 | if ( !inc ) return; | 2548 | if ( !inc ) return; |
2549 | showDatePickerPopup(); | 2549 | showDatePickerPopup(); |
2550 | mDatePickerMode = 2; | 2550 | mDatePickerMode = 2; |
2551 | mMoveIncidence = inc ; | 2551 | mMoveIncidence = inc ; |
2552 | QDate da; | 2552 | QDate da; |
2553 | if ( mMoveIncidence->type() == "Todo" ) { | 2553 | if ( mMoveIncidence->type() == "Todo" ) { |
2554 | Todo * to = (Todo *) mMoveIncidence; | 2554 | Todo * to = (Todo *) mMoveIncidence; |
2555 | if ( to->hasDueDate() ) | 2555 | if ( to->hasDueDate() ) |
2556 | da = to->dtDue().date(); | 2556 | da = to->dtDue().date(); |
2557 | else | 2557 | else |
2558 | da = QDate::currentDate(); | 2558 | da = QDate::currentDate(); |
2559 | } else { | 2559 | } else { |
2560 | da = mMoveIncidence->dtStart().date(); | 2560 | da = mMoveIncidence->dtStart().date(); |
2561 | } | 2561 | } |
2562 | //PENDING set date for recurring incidence to date of recurrence | 2562 | //PENDING set date for recurring incidence to date of recurrence |
2563 | //mMoveIncidenceOldDate; | 2563 | //mMoveIncidenceOldDate; |
2564 | mDatePicker->setDate( da ); | 2564 | mDatePicker->setDate( da ); |
2565 | } | 2565 | } |
2566 | void CalendarView::showDatePickerPopup() | 2566 | void CalendarView::showDatePickerPopup() |
2567 | { | 2567 | { |
2568 | if ( mDateFrame->isVisible() ) | 2568 | if ( mDateFrame->isVisible() ) |
2569 | mDateFrame->hide(); | 2569 | mDateFrame->hide(); |
2570 | else { | 2570 | else { |
2571 | int offX = 0, offY = 0; | 2571 | int offX = 0, offY = 0; |
2572 | #ifdef DESKTOP_VERSION | 2572 | #ifdef DESKTOP_VERSION |
2573 | int w =mDatePicker->sizeHint().width() ; | 2573 | int w =mDatePicker->sizeHint().width() ; |
2574 | int h = mDatePicker->sizeHint().height() ; | 2574 | int h = mDatePicker->sizeHint().height() ; |
2575 | int dw = topLevelWidget()->width(); | 2575 | int dw = topLevelWidget()->width(); |
2576 | int dh = topLevelWidget()->height(); | 2576 | int dh = topLevelWidget()->height(); |
2577 | offX = topLevelWidget()->x(); | 2577 | offX = topLevelWidget()->x(); |
2578 | offY = topLevelWidget()->y(); | 2578 | offY = topLevelWidget()->y(); |
2579 | #else | 2579 | #else |
2580 | int w =mDatePicker->sizeHint().width() ; | 2580 | int w =mDatePicker->sizeHint().width() ; |
2581 | int h = mDatePicker->sizeHint().height() ; | 2581 | int h = mDatePicker->sizeHint().height() ; |
2582 | int dw = QApplication::desktop()->width(); | 2582 | int dw = QApplication::desktop()->width(); |
2583 | int dh = QApplication::desktop()->height(); | 2583 | int dh = QApplication::desktop()->height(); |
2584 | #endif | 2584 | #endif |
2585 | mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); | 2585 | mDateFrame->setGeometry( (dw-w)/2+offX, (dh - h )/2+offY ,w,h ); |
2586 | mDateFrame->show(); | 2586 | mDateFrame->show(); |
2587 | } | 2587 | } |
2588 | } | 2588 | } |
2589 | void CalendarView::showDatePicker( ) | 2589 | void CalendarView::showDatePicker( ) |
2590 | { | 2590 | { |
2591 | showDatePickerPopup(); | 2591 | showDatePickerPopup(); |
2592 | mDatePickerMode = 1; | 2592 | mDatePickerMode = 1; |
2593 | mDatePicker->setDate( mNavigator->selectedDates().first() ); | 2593 | mDatePicker->setDate( mNavigator->selectedDates().first() ); |
2594 | } | 2594 | } |
2595 | 2595 | ||
2596 | void CalendarView::showEventEditor() | 2596 | void CalendarView::showEventEditor() |
2597 | { | 2597 | { |
2598 | #ifdef DESKTOP_VERSION | 2598 | #ifdef DESKTOP_VERSION |
2599 | int x,y,w,h; | 2599 | int x,y,w,h; |
2600 | x = mEventEditor->geometry().x(); | 2600 | x = mEventEditor->geometry().x(); |
2601 | y = mEventEditor->geometry().y(); | 2601 | y = mEventEditor->geometry().y(); |
2602 | w = mEventEditor->width(); | 2602 | w = mEventEditor->width(); |
2603 | h = mEventEditor->height(); | 2603 | h = mEventEditor->height(); |
2604 | mEventEditor->show(); | 2604 | mEventEditor->show(); |
2605 | mEventEditor->setGeometry(x,y,w,h); | 2605 | mEventEditor->setGeometry(x,y,w,h); |
2606 | #else | 2606 | #else |
2607 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { | 2607 | if ( mEventEditor->width() < QApplication::desktop()->width() -60 || mEventEditor->width() > QApplication::desktop()->width() ) { |
2608 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2608 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2609 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); | 2609 | qDebug("KO: CalendarView: recreate mEventEditor %d %d", mEventEditor->width(), QApplication::desktop()->width() ); |
2610 | qApp->processEvents(); | 2610 | qApp->processEvents(); |
2611 | delete mEventEditor; | 2611 | delete mEventEditor; |
2612 | mEventEditor = mDialogManager->getEventEditor(); | 2612 | mEventEditor = mDialogManager->getEventEditor(); |
2613 | topLevelWidget()->setCaption( i18n("") ); | 2613 | topLevelWidget()->setCaption( i18n("") ); |
2614 | } | 2614 | } |
2615 | mEventEditor->showMaximized(); | 2615 | mEventEditor->showMaximized(); |
2616 | #endif | 2616 | #endif |
2617 | } | 2617 | } |
2618 | void CalendarView::showTodoEditor() | 2618 | void CalendarView::showTodoEditor() |
2619 | { | 2619 | { |
2620 | #ifdef DESKTOP_VERSION | 2620 | #ifdef DESKTOP_VERSION |
2621 | int x,y,w,h; | 2621 | int x,y,w,h; |
2622 | x = mTodoEditor->geometry().x(); | 2622 | x = mTodoEditor->geometry().x(); |
2623 | y = mTodoEditor->geometry().y(); | 2623 | y = mTodoEditor->geometry().y(); |
2624 | w = mTodoEditor->width(); | 2624 | w = mTodoEditor->width(); |
2625 | h = mTodoEditor->height(); | 2625 | h = mTodoEditor->height(); |
2626 | mTodoEditor->show(); | 2626 | mTodoEditor->show(); |
2627 | mTodoEditor->setGeometry(x,y,w,h); | 2627 | mTodoEditor->setGeometry(x,y,w,h); |
2628 | #else | 2628 | #else |
2629 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 2629 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
2630 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 2630 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
2631 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 2631 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
2632 | qApp->processEvents(); | 2632 | qApp->processEvents(); |
2633 | delete mTodoEditor; | 2633 | delete mTodoEditor; |
2634 | mTodoEditor = mDialogManager->getTodoEditor(); | 2634 | mTodoEditor = mDialogManager->getTodoEditor(); |
2635 | topLevelWidget()->setCaption( i18n("") ); | 2635 | topLevelWidget()->setCaption( i18n("") ); |
2636 | } | 2636 | } |
2637 | mTodoEditor->showMaximized(); | 2637 | mTodoEditor->showMaximized(); |
2638 | #endif | 2638 | #endif |
2639 | } | 2639 | } |
2640 | 2640 | ||
2641 | void CalendarView::cloneIncidence() | 2641 | void CalendarView::cloneIncidence() |
2642 | { | 2642 | { |
2643 | Incidence *incidence = currentSelection(); | 2643 | Incidence *incidence = currentSelection(); |
2644 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2644 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2645 | if ( incidence ) { | 2645 | if ( incidence ) { |
2646 | cloneIncidence(incidence); | 2646 | cloneIncidence(incidence); |
2647 | } | 2647 | } |
2648 | } | 2648 | } |
2649 | void CalendarView::moveIncidence() | 2649 | void CalendarView::moveIncidence() |
2650 | { | 2650 | { |
2651 | Incidence *incidence = currentSelection(); | 2651 | Incidence *incidence = currentSelection(); |
2652 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2652 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2653 | if ( incidence ) { | 2653 | if ( incidence ) { |
2654 | moveIncidence(incidence); | 2654 | moveIncidence(incidence); |
2655 | } | 2655 | } |
2656 | } | 2656 | } |
2657 | void CalendarView::beamIncidence() | 2657 | void CalendarView::beamIncidence() |
2658 | { | 2658 | { |
2659 | Incidence *incidence = currentSelection(); | 2659 | Incidence *incidence = currentSelection(); |
2660 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2660 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2661 | if ( incidence ) { | 2661 | if ( incidence ) { |
2662 | beamIncidence(incidence); | 2662 | beamIncidence(incidence); |
2663 | } | 2663 | } |
2664 | } | 2664 | } |
2665 | void CalendarView::toggleCancelIncidence() | 2665 | void CalendarView::toggleCancelIncidence() |
2666 | { | 2666 | { |
2667 | Incidence *incidence = currentSelection(); | 2667 | Incidence *incidence = currentSelection(); |
2668 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 2668 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
2669 | if ( incidence ) { | 2669 | if ( incidence ) { |
2670 | cancelIncidence(incidence); | 2670 | cancelIncidence(incidence); |
2671 | } | 2671 | } |
2672 | } | 2672 | } |
2673 | 2673 | ||
2674 | 2674 | ||
2675 | void CalendarView::cancelIncidence(Incidence * inc ) | 2675 | void CalendarView::cancelIncidence(Incidence * inc ) |
2676 | { | 2676 | { |
2677 | inc->setCancelled( ! inc->cancelled() ); | 2677 | inc->setCancelled( ! inc->cancelled() ); |
2678 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 2678 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
2679 | updateView(); | 2679 | updateView(); |
2680 | } | 2680 | } |
2681 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 2681 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
2682 | { | 2682 | { |
2683 | Incidence * newInc = orgInc->clone(); | 2683 | Incidence * newInc = orgInc->clone(); |
2684 | newInc->recreate(); | 2684 | newInc->recreate(); |
2685 | 2685 | ||
2686 | if ( newInc->type() == "Todo" ) { | 2686 | if ( newInc->type() == "Todo" ) { |
2687 | Todo* t = (Todo*) newInc; | 2687 | Todo* t = (Todo*) newInc; |
2688 | showTodoEditor(); | 2688 | showTodoEditor(); |
2689 | mTodoEditor->editTodo( t ); | 2689 | mTodoEditor->editTodo( t ); |
2690 | if ( mTodoEditor->exec() ) { | 2690 | if ( mTodoEditor->exec() ) { |
2691 | mCalendar->addTodo( t ); | 2691 | mCalendar->addTodo( t ); |
2692 | updateView(); | 2692 | updateView(); |
2693 | } else { | 2693 | } else { |
2694 | delete t; | 2694 | delete t; |
2695 | } | 2695 | } |
2696 | } | 2696 | } |
2697 | else { | 2697 | else { |
2698 | Event* e = (Event*) newInc; | 2698 | Event* e = (Event*) newInc; |
2699 | showEventEditor(); | 2699 | showEventEditor(); |
2700 | mEventEditor->editEvent( e ); | 2700 | mEventEditor->editEvent( e ); |
2701 | if ( mEventEditor->exec() ) { | 2701 | if ( mEventEditor->exec() ) { |
2702 | mCalendar->addEvent( e ); | 2702 | mCalendar->addEvent( e ); |
2703 | updateView(); | 2703 | updateView(); |
2704 | } else { | 2704 | } else { |
2705 | delete e; | 2705 | delete e; |
2706 | } | 2706 | } |
2707 | } | 2707 | } |
2708 | setActiveWindow(); | 2708 | setActiveWindow(); |
2709 | } | 2709 | } |
2710 | 2710 | ||
2711 | void CalendarView::newEvent() | 2711 | void CalendarView::newEvent() |
2712 | { | 2712 | { |
2713 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. | 2713 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. |
2714 | KOAgendaView *aView = mViewManager->agendaView(); | 2714 | KOAgendaView *aView = mViewManager->agendaView(); |
2715 | if (aView) { | 2715 | if (aView) { |
2716 | if (aView->selectionStart().isValid()) { | 2716 | if (aView->selectionStart().isValid()) { |
2717 | if (aView->selectedIsAllDay()) { | 2717 | if (aView->selectedIsAllDay()) { |
2718 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); | 2718 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); |
2719 | } else { | 2719 | } else { |
2720 | newEvent(aView->selectionStart(),aView->selectionEnd()); | 2720 | newEvent(aView->selectionStart(),aView->selectionEnd()); |
2721 | } | 2721 | } |
2722 | return; | 2722 | return; |
2723 | } | 2723 | } |
2724 | } | 2724 | } |
2725 | 2725 | ||
2726 | QDate date = mNavigator->selectedDates().first(); | 2726 | QDate date = mNavigator->selectedDates().first(); |
2727 | QDateTime current = QDateTime::currentDateTime(); | 2727 | QDateTime current = QDateTime::currentDateTime(); |
2728 | if ( date <= current.date() ) { | 2728 | if ( date <= current.date() ) { |
2729 | int hour = current.time().hour() +1; | 2729 | int hour = current.time().hour() +1; |
2730 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), | 2730 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), |
2731 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2731 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2732 | } else | 2732 | } else |
2733 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), | 2733 | newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), |
2734 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + | 2734 | QDateTime( date, QTime( KOPrefs::instance()->mStartTime + |
2735 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 2735 | KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
2736 | } | 2736 | } |
2737 | 2737 | ||
2738 | void CalendarView::newEvent(QDateTime fh) | 2738 | void CalendarView::newEvent(QDateTime fh) |
2739 | { | 2739 | { |
2740 | newEvent(fh, | 2740 | newEvent(fh, |
2741 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); | 2741 | QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); |
2742 | } | 2742 | } |
2743 | 2743 | ||
2744 | void CalendarView::newEvent(QDate dt) | 2744 | void CalendarView::newEvent(QDate dt) |
2745 | { | 2745 | { |
2746 | newEvent(QDateTime(dt, QTime(0,0,0)), | 2746 | newEvent(QDateTime(dt, QTime(0,0,0)), |
2747 | QDateTime(dt, QTime(0,0,0)), true); | 2747 | QDateTime(dt, QTime(0,0,0)), true); |
2748 | } | 2748 | } |
2749 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) | 2749 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint) |
2750 | { | 2750 | { |
2751 | newEvent(fromHint, toHint, false); | 2751 | newEvent(fromHint, toHint, false); |
2752 | } | 2752 | } |
2753 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) | 2753 | void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) |
2754 | { | 2754 | { |
2755 | 2755 | ||
2756 | showEventEditor(); | 2756 | showEventEditor(); |
2757 | mEventEditor->newEvent(fromHint,toHint,allDay); | 2757 | mEventEditor->newEvent(fromHint,toHint,allDay); |
2758 | if ( mFilterView->filtersEnabled() ) { | 2758 | if ( mFilterView->filtersEnabled() ) { |
2759 | CalFilter *filter = mFilterView->selectedFilter(); | 2759 | CalFilter *filter = mFilterView->selectedFilter(); |
2760 | if (filter && filter->showCategories()) { | 2760 | if (filter && filter->showCategories()) { |
2761 | mEventEditor->setCategories(filter->categoryList().join(",") ); | 2761 | mEventEditor->setCategories(filter->categoryList().join(",") ); |
2762 | } | 2762 | } |
2763 | if ( filter ) | 2763 | if ( filter ) |
2764 | mEventEditor->setSecrecy( filter->getSecrecy() ); | 2764 | mEventEditor->setSecrecy( filter->getSecrecy() ); |
2765 | } | 2765 | } |
2766 | mEventEditor->exec(); | 2766 | mEventEditor->exec(); |
2767 | setActiveWindow(); | 2767 | setActiveWindow(); |
2768 | } | 2768 | } |
2769 | void CalendarView::todoAdded(Todo * t) | 2769 | void CalendarView::todoAdded(Todo * t) |
2770 | { | 2770 | { |
2771 | 2771 | ||
2772 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); | 2772 | changeTodoDisplay ( t ,KOGlobals::EVENTADDED); |
2773 | updateTodoViews(); | 2773 | updateTodoViews(); |
2774 | } | 2774 | } |
2775 | void CalendarView::todoChanged(Todo * t) | 2775 | void CalendarView::todoChanged(Todo * t) |
2776 | { | 2776 | { |
2777 | emit todoModified( t, 4 ); | 2777 | emit todoModified( t, 4 ); |
2778 | // updateTodoViews(); | 2778 | // updateTodoViews(); |
2779 | } | 2779 | } |
2780 | void CalendarView::todoToBeDeleted(Todo *) | 2780 | void CalendarView::todoToBeDeleted(Todo *) |
2781 | { | 2781 | { |
2782 | //qDebug("todoToBeDeleted(Todo *) "); | 2782 | //qDebug("todoToBeDeleted(Todo *) "); |
2783 | updateTodoViews(); | 2783 | updateTodoViews(); |
2784 | } | 2784 | } |
2785 | void CalendarView::todoDeleted() | 2785 | void CalendarView::todoDeleted() |
2786 | { | 2786 | { |
2787 | //qDebug(" todoDeleted()"); | 2787 | //qDebug(" todoDeleted()"); |
2788 | updateTodoViews(); | 2788 | updateTodoViews(); |
2789 | } | 2789 | } |
2790 | 2790 | ||
2791 | 2791 | ||
2792 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) | 2792 | void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) |
2793 | { | 2793 | { |
2794 | showTodoEditor(); | 2794 | showTodoEditor(); |
2795 | mTodoEditor->newTodo(dt,0,allday); | 2795 | mTodoEditor->newTodo(dt,0,allday); |
2796 | if ( mFilterView->filtersEnabled() ) { | 2796 | if ( mFilterView->filtersEnabled() ) { |
2797 | CalFilter *filter = mFilterView->selectedFilter(); | 2797 | CalFilter *filter = mFilterView->selectedFilter(); |
2798 | if (filter && filter->showCategories()) { | 2798 | if (filter && filter->showCategories()) { |
2799 | mTodoEditor->setCategories(filter->categoryList().join(",") ); | 2799 | mTodoEditor->setCategories(filter->categoryList().join(",") ); |
2800 | } | 2800 | } |
2801 | if ( filter ) | 2801 | if ( filter ) |
2802 | mTodoEditor->setSecrecy( filter->getSecrecy() ); | 2802 | mTodoEditor->setSecrecy( filter->getSecrecy() ); |
2803 | } | 2803 | } |
2804 | mTodoEditor->exec(); | 2804 | mTodoEditor->exec(); |
2805 | setActiveWindow(); | 2805 | setActiveWindow(); |
2806 | } | 2806 | } |
2807 | 2807 | ||
2808 | void CalendarView::newTodo() | 2808 | void CalendarView::newTodo() |
2809 | { | 2809 | { |
2810 | newTodoDateTime( QDateTime(),true ); | 2810 | newTodoDateTime( QDateTime(),true ); |
2811 | } | 2811 | } |
2812 | 2812 | ||
2813 | void CalendarView::newSubTodo() | 2813 | void CalendarView::newSubTodo() |
2814 | { | 2814 | { |
2815 | Todo *todo = selectedTodo(); | 2815 | Todo *todo = selectedTodo(); |
2816 | if ( todo ) newSubTodo( todo ); | 2816 | if ( todo ) newSubTodo( todo ); |
2817 | } | 2817 | } |
2818 | 2818 | ||
2819 | void CalendarView::newSubTodo(Todo *parentEvent) | 2819 | void CalendarView::newSubTodo(Todo *parentEvent) |
2820 | { | 2820 | { |
2821 | 2821 | ||
2822 | showTodoEditor(); | 2822 | showTodoEditor(); |
2823 | mTodoEditor->newTodo(QDateTime(),parentEvent,true); | 2823 | mTodoEditor->newTodo(QDateTime(),parentEvent,true); |
2824 | mTodoEditor->exec(); | 2824 | mTodoEditor->exec(); |
2825 | setActiveWindow(); | 2825 | setActiveWindow(); |
2826 | } | 2826 | } |
2827 | 2827 | ||
2828 | void CalendarView::newFloatingEvent() | 2828 | void CalendarView::newFloatingEvent() |
2829 | { | 2829 | { |
2830 | DateList tmpList = mNavigator->selectedDates(); | 2830 | DateList tmpList = mNavigator->selectedDates(); |
2831 | QDate date = tmpList.first(); | 2831 | QDate date = tmpList.first(); |
2832 | 2832 | ||
2833 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), | 2833 | newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), |
2834 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); | 2834 | QDateTime( date, QTime( 12, 0, 0 ) ), true ); |
2835 | } | 2835 | } |
2836 | 2836 | ||
2837 | 2837 | ||
2838 | void CalendarView::editEvent( Event *event ) | 2838 | void CalendarView::editEvent( Event *event ) |
2839 | { | 2839 | { |
2840 | 2840 | ||
2841 | if ( !event ) return; | 2841 | if ( !event ) return; |
2842 | if ( event->isReadOnly() ) { | 2842 | if ( event->isReadOnly() ) { |
2843 | showEvent( event ); | 2843 | showEvent( event ); |
2844 | return; | 2844 | return; |
2845 | } | 2845 | } |
2846 | showEventEditor(); | 2846 | showEventEditor(); |
2847 | mEventEditor->editEvent( event , mFlagEditDescription); | 2847 | mEventEditor->editEvent( event , mFlagEditDescription); |
2848 | mEventEditor->exec(); | 2848 | mEventEditor->exec(); |
2849 | setActiveWindow(); | 2849 | setActiveWindow(); |
2850 | 2850 | ||
2851 | } | 2851 | } |
2852 | void CalendarView::editJournal( Journal *jour ) | 2852 | void CalendarView::editJournal( Journal *jour ) |
2853 | { | 2853 | { |
2854 | if ( !jour ) return; | 2854 | if ( !jour ) return; |
2855 | mDialogManager->hideSearchDialog(); | 2855 | mDialogManager->hideSearchDialog(); |
2856 | mViewManager->showJournalView(); | 2856 | mViewManager->showJournalView(); |
2857 | mNavigator->slotDaySelect( jour->dtStart().date() ); | 2857 | mNavigator->slotDaySelect( jour->dtStart().date() ); |
2858 | } | 2858 | } |
2859 | void CalendarView::editTodo( Todo *todo ) | 2859 | void CalendarView::editTodo( Todo *todo ) |
2860 | { | 2860 | { |
2861 | if ( !todo ) return; | 2861 | if ( !todo ) return; |
2862 | 2862 | ||
2863 | if ( todo->isReadOnly() ) { | 2863 | if ( todo->isReadOnly() ) { |
2864 | showTodo( todo ); | 2864 | showTodo( todo ); |
2865 | return; | 2865 | return; |
2866 | } | 2866 | } |
2867 | showTodoEditor(); | 2867 | showTodoEditor(); |
2868 | mTodoEditor->editTodo( todo ,mFlagEditDescription); | 2868 | mTodoEditor->editTodo( todo ,mFlagEditDescription); |
2869 | mTodoEditor->exec(); | 2869 | mTodoEditor->exec(); |
2870 | setActiveWindow(); | 2870 | setActiveWindow(); |
2871 | 2871 | ||
2872 | } | 2872 | } |
2873 | 2873 | ||
2874 | KOEventViewerDialog* CalendarView::getEventViewerDialog() | 2874 | KOEventViewerDialog* CalendarView::getEventViewerDialog() |
2875 | { | 2875 | { |
2876 | if ( !mEventViewerDialog ) { | 2876 | if ( !mEventViewerDialog ) { |
2877 | mEventViewerDialog = new KOEventViewerDialog(0); | 2877 | mEventViewerDialog = new KOEventViewerDialog(0); |
2878 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); | 2878 | connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); |
2879 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); | 2879 | connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); |
2880 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), | 2880 | connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), |
2881 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); | 2881 | dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); |
2882 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), | 2882 | connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), |
2883 | viewManager(), SLOT( showAgendaView( bool ) ) ); | 2883 | viewManager(), SLOT( showAgendaView( bool ) ) ); |
2884 | connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), | 2884 | connect( mEventViewerDialog, SIGNAL(signalViewerClosed()), |
2885 | this, SLOT( slotViewerClosed() ) ); | 2885 | this, SLOT( slotViewerClosed() ) ); |
2886 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), | 2886 | connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ), |
2887 | this, SLOT( todoChanged(Todo *) ) ); | 2887 | this, SLOT( todoChanged(Todo *) ) ); |
2888 | mEventViewerDialog->resize( 640, 480 ); | 2888 | mEventViewerDialog->resize( 640, 480 ); |
2889 | 2889 | ||
2890 | } | 2890 | } |
2891 | return mEventViewerDialog; | 2891 | return mEventViewerDialog; |
2892 | } | 2892 | } |
2893 | void CalendarView::showEvent(Event *event) | 2893 | void CalendarView::showEvent(Event *event) |
2894 | { | 2894 | { |
2895 | getEventViewerDialog()->setEvent(event); | 2895 | getEventViewerDialog()->setEvent(event); |
2896 | getEventViewerDialog()->showMe(); | 2896 | getEventViewerDialog()->showMe(); |
2897 | } | 2897 | } |
2898 | 2898 | ||
2899 | void CalendarView::showTodo(Todo *event) | 2899 | void CalendarView::showTodo(Todo *event) |
2900 | { | 2900 | { |
2901 | getEventViewerDialog()->setTodo(event); | 2901 | getEventViewerDialog()->setTodo(event); |
2902 | getEventViewerDialog()->showMe(); | 2902 | getEventViewerDialog()->showMe(); |
2903 | } | 2903 | } |
2904 | void CalendarView::showJournal( Journal *jour ) | 2904 | void CalendarView::showJournal( Journal *jour ) |
2905 | { | 2905 | { |
2906 | getEventViewerDialog()->setJournal(jour); | 2906 | getEventViewerDialog()->setJournal(jour); |
2907 | getEventViewerDialog()->showMe(); | 2907 | getEventViewerDialog()->showMe(); |
2908 | 2908 | ||
2909 | } | 2909 | } |
2910 | // void CalendarView::todoModified (Todo *event, int changed) | 2910 | // void CalendarView::todoModified (Todo *event, int changed) |
2911 | // { | 2911 | // { |
2912 | // // if (mDialogList.find (event) != mDialogList.end ()) { | 2912 | // // if (mDialogList.find (event) != mDialogList.end ()) { |
2913 | // // kdDebug() << "Todo modified and open" << endl; | 2913 | // // kdDebug() << "Todo modified and open" << endl; |
2914 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; | 2914 | // // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; |
2915 | // // temp->modified (changed); | 2915 | // // temp->modified (changed); |
2916 | 2916 | ||
2917 | // // } | 2917 | // // } |
2918 | 2918 | ||
2919 | // mViewManager->updateView(); | 2919 | // mViewManager->updateView(); |
2920 | // } | 2920 | // } |
2921 | 2921 | ||
2922 | void CalendarView::appointment_show() | 2922 | void CalendarView::appointment_show() |
2923 | { | 2923 | { |
2924 | Event *anEvent = 0; | 2924 | Event *anEvent = 0; |
2925 | 2925 | ||
2926 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2926 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2927 | 2927 | ||
2928 | if (mViewManager->currentView()->isEventView()) { | 2928 | if (mViewManager->currentView()->isEventView()) { |
2929 | if ( incidence && incidence->type() == "Event" ) { | 2929 | if ( incidence && incidence->type() == "Event" ) { |
2930 | anEvent = static_cast<Event *>(incidence); | 2930 | anEvent = static_cast<Event *>(incidence); |
2931 | } | 2931 | } |
2932 | } | 2932 | } |
2933 | 2933 | ||
2934 | if (!anEvent) { | 2934 | if (!anEvent) { |
2935 | KNotifyClient::beep(); | 2935 | KNotifyClient::beep(); |
2936 | return; | 2936 | return; |
2937 | } | 2937 | } |
2938 | 2938 | ||
2939 | showEvent(anEvent); | 2939 | showEvent(anEvent); |
2940 | } | 2940 | } |
2941 | 2941 | ||
2942 | void CalendarView::appointment_edit() | 2942 | void CalendarView::appointment_edit() |
2943 | { | 2943 | { |
2944 | Event *anEvent = 0; | 2944 | Event *anEvent = 0; |
2945 | 2945 | ||
2946 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2946 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2947 | 2947 | ||
2948 | if (mViewManager->currentView()->isEventView()) { | 2948 | if (mViewManager->currentView()->isEventView()) { |
2949 | if ( incidence && incidence->type() == "Event" ) { | 2949 | if ( incidence && incidence->type() == "Event" ) { |
2950 | anEvent = static_cast<Event *>(incidence); | 2950 | anEvent = static_cast<Event *>(incidence); |
2951 | } | 2951 | } |
2952 | } | 2952 | } |
2953 | 2953 | ||
2954 | if (!anEvent) { | 2954 | if (!anEvent) { |
2955 | KNotifyClient::beep(); | 2955 | KNotifyClient::beep(); |
2956 | return; | 2956 | return; |
2957 | } | 2957 | } |
2958 | 2958 | ||
2959 | editEvent(anEvent); | 2959 | editEvent(anEvent); |
2960 | } | 2960 | } |
2961 | 2961 | ||
2962 | void CalendarView::appointment_delete() | 2962 | void CalendarView::appointment_delete() |
2963 | { | 2963 | { |
2964 | Event *anEvent = 0; | 2964 | Event *anEvent = 0; |
2965 | 2965 | ||
2966 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 2966 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
2967 | 2967 | ||
2968 | if (mViewManager->currentView()->isEventView()) { | 2968 | if (mViewManager->currentView()->isEventView()) { |
2969 | if ( incidence && incidence->type() == "Event" ) { | 2969 | if ( incidence && incidence->type() == "Event" ) { |
2970 | anEvent = static_cast<Event *>(incidence); | 2970 | anEvent = static_cast<Event *>(incidence); |
2971 | } | 2971 | } |
2972 | } | 2972 | } |
2973 | 2973 | ||
2974 | if (!anEvent) { | 2974 | if (!anEvent) { |
2975 | KNotifyClient::beep(); | 2975 | KNotifyClient::beep(); |
2976 | return; | 2976 | return; |
2977 | } | 2977 | } |
2978 | 2978 | ||
2979 | deleteEvent(anEvent); | 2979 | deleteEvent(anEvent); |
2980 | } | 2980 | } |
2981 | 2981 | ||
2982 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) | 2982 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) |
2983 | { | 2983 | { |
2984 | if (!sub) return; | 2984 | if (!sub) return; |
2985 | if (!parent) return; | 2985 | if (!parent) return; |
2986 | if ( sub->relatedTo() ) | 2986 | if ( sub->relatedTo() ) |
2987 | sub->relatedTo()->removeRelation(sub); | 2987 | sub->relatedTo()->removeRelation(sub); |
2988 | sub->setRelatedTo(parent); | 2988 | sub->setRelatedTo(parent); |
2989 | sub->setRelatedToUid(parent->uid()); | 2989 | sub->setRelatedToUid(parent->uid()); |
2990 | parent->addRelation(sub); | 2990 | parent->addRelation(sub); |
2991 | sub->updated(); | 2991 | sub->updated(); |
2992 | parent->updated(); | 2992 | parent->updated(); |
2993 | setModified(true); | 2993 | setModified(true); |
2994 | updateView(); | 2994 | updateView(); |
2995 | } | 2995 | } |
2996 | void CalendarView::todo_unsub(Todo *anTodo ) | 2996 | void CalendarView::todo_unsub(Todo *anTodo ) |
2997 | { | 2997 | { |
2998 | // Todo *anTodo = selectedTodo(); | 2998 | // Todo *anTodo = selectedTodo(); |
2999 | if (!anTodo) return; | 2999 | if (!anTodo) return; |
3000 | if (!anTodo->relatedTo()) return; | 3000 | if (!anTodo->relatedTo()) return; |
3001 | anTodo->relatedTo()->removeRelation(anTodo); | 3001 | anTodo->relatedTo()->removeRelation(anTodo); |
3002 | anTodo->setRelatedTo(0); | 3002 | anTodo->setRelatedTo(0); |
3003 | anTodo->updated(); | 3003 | anTodo->updated(); |
3004 | anTodo->setRelatedToUid(""); | 3004 | anTodo->setRelatedToUid(""); |
3005 | setModified(true); | 3005 | setModified(true); |
3006 | updateView(); | 3006 | updateView(); |
3007 | } | 3007 | } |
3008 | 3008 | ||
3009 | void CalendarView::deleteTodo(Todo *todo) | 3009 | void CalendarView::deleteTodo(Todo *todo) |
3010 | { | 3010 | { |
3011 | if (!todo) { | 3011 | if (!todo) { |
3012 | KNotifyClient::beep(); | 3012 | KNotifyClient::beep(); |
3013 | return; | 3013 | return; |
3014 | } | 3014 | } |
3015 | if (KOPrefs::instance()->mConfirm) { | 3015 | if (KOPrefs::instance()->mConfirm) { |
3016 | QString text = todo->summary().left(20); | 3016 | QString text = todo->summary().left(20); |
3017 | if (!todo->relations().isEmpty()) { | 3017 | if (!todo->relations().isEmpty()) { |
3018 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); | 3018 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); |
3019 | 3019 | ||
3020 | } | 3020 | } |
3021 | switch (msgItemDelete(text)) { | 3021 | switch (msgItemDelete(text)) { |
3022 | case KMessageBox::Continue: // OK | 3022 | case KMessageBox::Continue: // OK |
3023 | bool deleteT = false; | 3023 | bool deleteT = false; |
3024 | if (!todo->relations().isEmpty()) { | 3024 | if (!todo->relations().isEmpty()) { |
3025 | deleteT = removeCompletedSubTodos( todo ); | 3025 | deleteT = removeCompletedSubTodos( todo ); |
3026 | } | 3026 | } |
3027 | // deleteT == true: todo already deleted in removeCompletedSubTodos | 3027 | // deleteT == true: todo already deleted in removeCompletedSubTodos |
3028 | if ( !deleteT ) { | 3028 | if ( !deleteT ) { |
3029 | checkExternalId( todo ); | 3029 | checkExternalId( todo ); |
3030 | calendar()->deleteTodo(todo); | 3030 | calendar()->deleteTodo(todo); |
3031 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | 3031 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
3032 | updateView(); | 3032 | updateView(); |
3033 | } | 3033 | } |
3034 | break; | 3034 | break; |
3035 | } // switch | 3035 | } // switch |
3036 | } else { | 3036 | } else { |
3037 | checkExternalId( todo ); | 3037 | checkExternalId( todo ); |
3038 | mCalendar->deleteTodo(todo); | 3038 | mCalendar->deleteTodo(todo); |
3039 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | 3039 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
3040 | updateView(); | 3040 | updateView(); |
3041 | } | 3041 | } |
3042 | 3042 | ||
3043 | emit updateSearchDialog(); | 3043 | emit updateSearchDialog(); |
3044 | } | 3044 | } |
3045 | void CalendarView::deleteJournal(Journal *jour) | 3045 | void CalendarView::deleteJournal(Journal *jour) |
3046 | { | 3046 | { |
3047 | if (!jour) { | 3047 | if (!jour) { |
3048 | KNotifyClient::beep(); | 3048 | KNotifyClient::beep(); |
3049 | return; | 3049 | return; |
3050 | } | 3050 | } |
3051 | if (KOPrefs::instance()->mConfirm) { | 3051 | if (KOPrefs::instance()->mConfirm) { |
3052 | switch (msgItemDelete( jour->description().left(20))) { | 3052 | switch (msgItemDelete( jour->description().left(20))) { |
3053 | case KMessageBox::Continue: // OK | 3053 | case KMessageBox::Continue: // OK |
3054 | calendar()->deleteJournal(jour); | 3054 | calendar()->deleteJournal(jour); |
3055 | updateView(); | 3055 | updateView(); |
3056 | break; | 3056 | break; |
3057 | } // switch | 3057 | } // switch |
3058 | } else { | 3058 | } else { |
3059 | calendar()->deleteJournal(jour);; | 3059 | calendar()->deleteJournal(jour);; |
3060 | updateView(); | 3060 | updateView(); |
3061 | } | 3061 | } |
3062 | emit updateSearchDialog(); | 3062 | emit updateSearchDialog(); |
3063 | } | 3063 | } |
3064 | 3064 | ||
3065 | void CalendarView::deleteEvent(Event *anEvent) | 3065 | void CalendarView::deleteEvent(Event *anEvent) |
3066 | { | 3066 | { |
3067 | if (!anEvent) { | 3067 | if (!anEvent) { |
3068 | KNotifyClient::beep(); | 3068 | KNotifyClient::beep(); |
3069 | return; | 3069 | return; |
3070 | } | 3070 | } |
3071 | 3071 | ||
3072 | if (anEvent->recurrence()->doesRecur()) { | 3072 | if (anEvent->recurrence()->doesRecur()) { |
3073 | QDate itemDate = mViewManager->currentSelectionDate(); | 3073 | QDate itemDate = mViewManager->currentSelectionDate(); |
3074 | int km; | 3074 | int km; |
3075 | if (!itemDate.isValid()) { | 3075 | if (!itemDate.isValid()) { |
3076 | //kdDebug() << "Date Not Valid" << endl; | 3076 | //kdDebug() << "Date Not Valid" << endl; |
3077 | if (KOPrefs::instance()->mConfirm) { | 3077 | if (KOPrefs::instance()->mConfirm) { |
3078 | km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + | 3078 | km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + |
3079 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), | 3079 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), |
3080 | i18n("KO/Pi Confirmation"),i18n("Delete All")); | 3080 | i18n("KO/Pi Confirmation"),i18n("Delete All")); |
3081 | if ( km == KMessageBox::Continue ) | 3081 | if ( km == KMessageBox::Continue ) |
3082 | km = KMessageBox::No; // No = all below | 3082 | km = KMessageBox::No; // No = all below |
3083 | } else | 3083 | } else |
3084 | km = KMessageBox::No; | 3084 | km = KMessageBox::No; |
3085 | } else { | 3085 | } else { |
3086 | km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + | 3086 | km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + |
3087 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ | 3087 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ |
3088 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), | 3088 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), |
3089 | i18n("KO/Pi Confirmation"),i18n("Current"), | 3089 | i18n("KO/Pi Confirmation"),i18n("Current"), |
3090 | i18n("All")); | 3090 | i18n("All")); |
3091 | } | 3091 | } |
3092 | switch(km) { | 3092 | switch(km) { |
3093 | 3093 | ||
3094 | case KMessageBox::No: // Continue // all | 3094 | case KMessageBox::No: // Continue // all |
3095 | //qDebug("KMessageBox::No "); | 3095 | //qDebug("KMessageBox::No "); |
3096 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3096 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3097 | schedule(Scheduler::Cancel,anEvent); | 3097 | schedule(Scheduler::Cancel,anEvent); |
3098 | 3098 | ||
3099 | checkExternalId( anEvent); | 3099 | checkExternalId( anEvent); |
3100 | mCalendar->deleteEvent(anEvent); | 3100 | mCalendar->deleteEvent(anEvent); |
3101 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); | 3101 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); |
3102 | break; | 3102 | break; |
3103 | 3103 | ||
3104 | // Disabled because it does not work | 3104 | // Disabled because it does not work |
3105 | //#if 0 | 3105 | //#if 0 |
3106 | case KMessageBox::Yes: // just this one | 3106 | case KMessageBox::Yes: // just this one |
3107 | //QDate qd = mNavigator->selectedDates().first(); | 3107 | //QDate qd = mNavigator->selectedDates().first(); |
3108 | //if (!qd.isValid()) { | 3108 | //if (!qd.isValid()) { |
3109 | // kdDebug() << "no date selected, or invalid date" << endl; | 3109 | // kdDebug() << "no date selected, or invalid date" << endl; |
3110 | // KNotifyClient::beep(); | 3110 | // KNotifyClient::beep(); |
3111 | // return; | 3111 | // return; |
3112 | //} | 3112 | //} |
3113 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); | 3113 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); |
3114 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { | 3114 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { |
3115 | anEvent->addExDate(itemDate); | 3115 | anEvent->addExDate(itemDate); |
3116 | int duration = anEvent->recurrence()->duration(); | 3116 | int duration = anEvent->recurrence()->duration(); |
3117 | if ( duration > 0 ) { | 3117 | if ( duration > 0 ) { |
3118 | anEvent->recurrence()->setDuration( duration - 1 ); | 3118 | anEvent->recurrence()->setDuration( duration - 1 ); |
3119 | } | 3119 | } |
3120 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); | 3120 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); |
3121 | } | 3121 | } |
3122 | break; | 3122 | break; |
3123 | //#endif | 3123 | //#endif |
3124 | } // switch | 3124 | } // switch |
3125 | } else { | 3125 | } else { |
3126 | if (KOPrefs::instance()->mConfirm) { | 3126 | if (KOPrefs::instance()->mConfirm) { |
3127 | switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + | 3127 | switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + |
3128 | i18n("\nAre you sure you want\nto delete this event?"), | 3128 | i18n("\nAre you sure you want\nto delete this event?"), |
3129 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { | 3129 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { |
3130 | case KMessageBox::Continue: // OK | 3130 | case KMessageBox::Continue: // OK |
3131 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3131 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3132 | schedule(Scheduler::Cancel,anEvent); | 3132 | schedule(Scheduler::Cancel,anEvent); |
3133 | checkExternalId( anEvent); | 3133 | checkExternalId( anEvent); |
3134 | mCalendar->deleteEvent(anEvent); | 3134 | mCalendar->deleteEvent(anEvent); |
3135 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 3135 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
3136 | break; | 3136 | break; |
3137 | } // switch | 3137 | } // switch |
3138 | } else { | 3138 | } else { |
3139 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3139 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3140 | schedule(Scheduler::Cancel,anEvent); | 3140 | schedule(Scheduler::Cancel,anEvent); |
3141 | checkExternalId( anEvent); | 3141 | checkExternalId( anEvent); |
3142 | mCalendar->deleteEvent(anEvent); | 3142 | mCalendar->deleteEvent(anEvent); |
3143 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 3143 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
3144 | } | 3144 | } |
3145 | } // if-else | 3145 | } // if-else |
3146 | emit updateSearchDialog(); | 3146 | emit updateSearchDialog(); |
3147 | } | 3147 | } |
3148 | 3148 | ||
3149 | bool CalendarView::deleteEvent(const QString &uid) | 3149 | bool CalendarView::deleteEvent(const QString &uid) |
3150 | { | 3150 | { |
3151 | Event *ev = mCalendar->event(uid); | 3151 | Event *ev = mCalendar->event(uid); |
3152 | if (ev) { | 3152 | if (ev) { |
3153 | deleteEvent(ev); | 3153 | deleteEvent(ev); |
3154 | return true; | 3154 | return true; |
3155 | } else { | 3155 | } else { |
3156 | return false; | 3156 | return false; |
3157 | } | 3157 | } |
3158 | } | 3158 | } |
3159 | 3159 | ||
3160 | /*****************************************************************************/ | 3160 | /*****************************************************************************/ |
3161 | 3161 | ||
3162 | void CalendarView::action_mail() | 3162 | void CalendarView::action_mail() |
3163 | { | 3163 | { |
3164 | #ifndef KORG_NOMAIL | 3164 | #ifndef KORG_NOMAIL |
3165 | KOMailClient mailClient; | 3165 | KOMailClient mailClient; |
3166 | 3166 | ||
3167 | Incidence *incidence = currentSelection(); | 3167 | Incidence *incidence = currentSelection(); |
3168 | 3168 | ||
3169 | if (!incidence) { | 3169 | if (!incidence) { |
3170 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); | 3170 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); |
3171 | return; | 3171 | return; |
3172 | } | 3172 | } |
3173 | if(incidence->attendeeCount() == 0 ) { | 3173 | if(incidence->attendeeCount() == 0 ) { |
3174 | KMessageBox::sorry(this, | 3174 | KMessageBox::sorry(this, |
3175 | i18n("Can't generate mail:\nNo attendees defined.\n")); | 3175 | i18n("Can't generate mail:\nNo attendees defined.\n")); |
3176 | return; | 3176 | return; |
3177 | } | 3177 | } |
3178 | 3178 | ||
3179 | CalendarLocal cal_tmp; | 3179 | CalendarLocal cal_tmp; |
3180 | Event *event = 0; | 3180 | Event *event = 0; |
3181 | Event *ev = 0; | 3181 | Event *ev = 0; |
3182 | if ( incidence && incidence->type() == "Event" ) { | 3182 | if ( incidence && incidence->type() == "Event" ) { |
3183 | event = static_cast<Event *>(incidence); | 3183 | event = static_cast<Event *>(incidence); |
3184 | ev = new Event(*event); | 3184 | ev = new Event(*event); |
3185 | cal_tmp.addEvent(ev); | 3185 | cal_tmp.addEvent(ev); |
3186 | } | 3186 | } |
3187 | ICalFormat mForm(); | 3187 | ICalFormat mForm(); |
3188 | QString attachment = mForm.toString( &cal_tmp ); | 3188 | QString attachment = mForm.toString( &cal_tmp ); |
3189 | if (ev) delete(ev); | 3189 | if (ev) delete(ev); |
3190 | 3190 | ||
3191 | mailClient.mailAttendees(currentSelection(), attachment); | 3191 | mailClient.mailAttendees(currentSelection(), attachment); |
3192 | 3192 | ||
3193 | #endif | 3193 | #endif |
3194 | 3194 | ||
3195 | #if 0 | 3195 | #if 0 |
3196 | Event *anEvent = 0; | 3196 | Event *anEvent = 0; |
3197 | if (mViewManager->currentView()->isEventView()) { | 3197 | if (mViewManager->currentView()->isEventView()) { |
3198 | anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); | 3198 | anEvent = dynamic_cast<Event *>((mViewManager->currentView()->selectedIncidences()).first()); |
3199 | } | 3199 | } |
3200 | 3200 | ||
3201 | if (!anEvent) { | 3201 | if (!anEvent) { |
3202 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); | 3202 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); |
3203 | return; | 3203 | return; |
3204 | } | 3204 | } |
3205 | if(anEvent->attendeeCount() == 0 ) { | 3205 | if(anEvent->attendeeCount() == 0 ) { |
3206 | KMessageBox::sorry(this, | 3206 | KMessageBox::sorry(this, |
3207 | i18n("Can't generate mail:\nNo attendees defined.\n")); | 3207 | i18n("Can't generate mail:\nNo attendees defined.\n")); |
3208 | return; | 3208 | return; |
3209 | } | 3209 | } |
3210 | 3210 | ||
3211 | mailobject.emailEvent(anEvent); | 3211 | mailobject.emailEvent(anEvent); |
3212 | #endif | 3212 | #endif |
3213 | } | 3213 | } |
3214 | 3214 | ||
3215 | 3215 | ||
3216 | void CalendarView::schedule_publish(Incidence *incidence) | 3216 | void CalendarView::schedule_publish(Incidence *incidence) |
3217 | { | 3217 | { |
3218 | Event *event = 0; | 3218 | Event *event = 0; |
3219 | Todo *todo = 0; | 3219 | Todo *todo = 0; |
3220 | 3220 | ||
3221 | if (incidence == 0) { | 3221 | if (incidence == 0) { |
3222 | incidence = mViewManager->currentView()->selectedIncidences().first(); | 3222 | incidence = mViewManager->currentView()->selectedIncidences().first(); |
3223 | if (incidence == 0) { | 3223 | if (incidence == 0) { |
3224 | incidence = mTodoList->selectedIncidences().first(); | 3224 | incidence = mTodoList->selectedIncidences().first(); |
3225 | } | 3225 | } |
3226 | } | 3226 | } |
3227 | if ( incidence && incidence->type() == "Event" ) { | 3227 | if ( incidence && incidence->type() == "Event" ) { |
3228 | event = static_cast<Event *>(incidence); | 3228 | event = static_cast<Event *>(incidence); |
3229 | } else { | 3229 | } else { |
3230 | if ( incidence && incidence->type() == "Todo" ) { | 3230 | if ( incidence && incidence->type() == "Todo" ) { |
3231 | todo = static_cast<Todo *>(incidence); | 3231 | todo = static_cast<Todo *>(incidence); |
3232 | } | 3232 | } |
3233 | } | 3233 | } |
3234 | 3234 | ||
3235 | if (!event && !todo) { | 3235 | if (!event && !todo) { |
3236 | KMessageBox::sorry(this,i18n("No event selected.")); | 3236 | KMessageBox::sorry(this,i18n("No event selected.")); |
3237 | return; | 3237 | return; |
3238 | } | 3238 | } |
3239 | 3239 | ||
3240 | PublishDialog *publishdlg = new PublishDialog(); | 3240 | PublishDialog *publishdlg = new PublishDialog(); |
3241 | if (incidence->attendeeCount()>0) { | 3241 | if (incidence->attendeeCount()>0) { |
3242 | QPtrList<Attendee> attendees = incidence->attendees(); | 3242 | QPtrList<Attendee> attendees = incidence->attendees(); |
3243 | attendees.first(); | 3243 | attendees.first(); |
3244 | while ( attendees.current()!=0 ) { | 3244 | while ( attendees.current()!=0 ) { |
3245 | publishdlg->addAttendee(attendees.current()); | 3245 | publishdlg->addAttendee(attendees.current()); |
3246 | attendees.next(); | 3246 | attendees.next(); |
3247 | } | 3247 | } |
3248 | } | 3248 | } |
3249 | bool send = true; | 3249 | bool send = true; |
3250 | if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { | 3250 | if ( KOPrefs::instance()->mMailClient == KOPrefs::MailClientSendmail ) { |
3251 | if ( publishdlg->exec() != QDialog::Accepted ) | 3251 | if ( publishdlg->exec() != QDialog::Accepted ) |
3252 | send = false; | 3252 | send = false; |
3253 | } | 3253 | } |
3254 | if ( send ) { | 3254 | if ( send ) { |
3255 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); | 3255 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); |
3256 | if ( event ) { | 3256 | if ( event ) { |
3257 | Event *ev = new Event(*event); | 3257 | Event *ev = new Event(*event); |
3258 | ev->registerObserver(0); | 3258 | ev->registerObserver(0); |
3259 | ev->clearAttendees(); | 3259 | ev->clearAttendees(); |
3260 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { | 3260 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { |
3261 | delete(ev); | 3261 | delete(ev); |
3262 | } | 3262 | } |
3263 | } else { | 3263 | } else { |
3264 | if ( todo ) { | 3264 | if ( todo ) { |
3265 | Todo *ev = new Todo(*todo); | 3265 | Todo *ev = new Todo(*todo); |
3266 | ev->registerObserver(0); | 3266 | ev->registerObserver(0); |
3267 | ev->clearAttendees(); | 3267 | ev->clearAttendees(); |
3268 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { | 3268 | if (!dlg->addMessage(ev,Scheduler::Publish,publishdlg->addresses())) { |
3269 | delete(ev); | 3269 | delete(ev); |
3270 | } | 3270 | } |
3271 | } | 3271 | } |
3272 | } | 3272 | } |
3273 | } | 3273 | } |
3274 | delete publishdlg; | 3274 | delete publishdlg; |
3275 | } | 3275 | } |
3276 | 3276 | ||
3277 | void CalendarView::schedule_request(Incidence *incidence) | 3277 | void CalendarView::schedule_request(Incidence *incidence) |
3278 | { | 3278 | { |
3279 | schedule(Scheduler::Request,incidence); | 3279 | schedule(Scheduler::Request,incidence); |
3280 | } | 3280 | } |
3281 | 3281 | ||
3282 | void CalendarView::schedule_refresh(Incidence *incidence) | 3282 | void CalendarView::schedule_refresh(Incidence *incidence) |
3283 | { | 3283 | { |
3284 | schedule(Scheduler::Refresh,incidence); | 3284 | schedule(Scheduler::Refresh,incidence); |
3285 | } | 3285 | } |
3286 | 3286 | ||
3287 | void CalendarView::schedule_cancel(Incidence *incidence) | 3287 | void CalendarView::schedule_cancel(Incidence *incidence) |
3288 | { | 3288 | { |
3289 | schedule(Scheduler::Cancel,incidence); | 3289 | schedule(Scheduler::Cancel,incidence); |
3290 | } | 3290 | } |
3291 | 3291 | ||
3292 | void CalendarView::schedule_add(Incidence *incidence) | 3292 | void CalendarView::schedule_add(Incidence *incidence) |
3293 | { | 3293 | { |
3294 | schedule(Scheduler::Add,incidence); | 3294 | schedule(Scheduler::Add,incidence); |
3295 | } | 3295 | } |
3296 | 3296 | ||
3297 | void CalendarView::schedule_reply(Incidence *incidence) | 3297 | void CalendarView::schedule_reply(Incidence *incidence) |
3298 | { | 3298 | { |
3299 | schedule(Scheduler::Reply,incidence); | 3299 | schedule(Scheduler::Reply,incidence); |
3300 | } | 3300 | } |
3301 | 3301 | ||
3302 | void CalendarView::schedule_counter(Incidence *incidence) | 3302 | void CalendarView::schedule_counter(Incidence *incidence) |
3303 | { | 3303 | { |
3304 | schedule(Scheduler::Counter,incidence); | 3304 | schedule(Scheduler::Counter,incidence); |
3305 | } | 3305 | } |
3306 | 3306 | ||
3307 | void CalendarView::schedule_declinecounter(Incidence *incidence) | 3307 | void CalendarView::schedule_declinecounter(Incidence *incidence) |
3308 | { | 3308 | { |
3309 | schedule(Scheduler::Declinecounter,incidence); | 3309 | schedule(Scheduler::Declinecounter,incidence); |
3310 | } | 3310 | } |
3311 | 3311 | ||
3312 | void CalendarView::schedule_publish_freebusy(int daysToPublish) | 3312 | void CalendarView::schedule_publish_freebusy(int daysToPublish) |
3313 | { | 3313 | { |
3314 | QDateTime start = QDateTime::currentDateTime(); | 3314 | QDateTime start = QDateTime::currentDateTime(); |
3315 | QDateTime end = start.addDays(daysToPublish); | 3315 | QDateTime end = start.addDays(daysToPublish); |
3316 | 3316 | ||
3317 | FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); | 3317 | FreeBusy *freebusy = new FreeBusy(mCalendar, start, end); |
3318 | freebusy->setOrganizer(KOPrefs::instance()->email()); | 3318 | freebusy->setOrganizer(KOPrefs::instance()->email()); |
3319 | 3319 | ||
3320 | 3320 | ||
3321 | PublishDialog *publishdlg = new PublishDialog(); | 3321 | PublishDialog *publishdlg = new PublishDialog(); |
3322 | if ( publishdlg->exec() == QDialog::Accepted ) { | 3322 | if ( publishdlg->exec() == QDialog::Accepted ) { |
3323 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); | 3323 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); |
3324 | if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { | 3324 | if (!dlg->addMessage(freebusy,Scheduler::Publish,publishdlg->addresses())) { |
3325 | delete(freebusy); | 3325 | delete(freebusy); |
3326 | } | 3326 | } |
3327 | } | 3327 | } |
3328 | delete publishdlg; | 3328 | delete publishdlg; |
3329 | } | 3329 | } |
3330 | 3330 | ||
3331 | void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) | 3331 | void CalendarView::schedule(Scheduler::Method method, Incidence *incidence) |
3332 | { | 3332 | { |
3333 | Event *event = 0; | 3333 | Event *event = 0; |
3334 | Todo *todo = 0; | 3334 | Todo *todo = 0; |
3335 | 3335 | ||
3336 | if (incidence == 0) { | 3336 | if (incidence == 0) { |
3337 | incidence = mViewManager->currentView()->selectedIncidences().first(); | 3337 | incidence = mViewManager->currentView()->selectedIncidences().first(); |
3338 | if (incidence == 0) { | 3338 | if (incidence == 0) { |
3339 | incidence = mTodoList->selectedIncidences().first(); | 3339 | incidence = mTodoList->selectedIncidences().first(); |
3340 | } | 3340 | } |
3341 | } | 3341 | } |
3342 | if ( incidence && incidence->type() == "Event" ) { | 3342 | if ( incidence && incidence->type() == "Event" ) { |
3343 | event = static_cast<Event *>(incidence); | 3343 | event = static_cast<Event *>(incidence); |
3344 | } | 3344 | } |
3345 | if ( incidence && incidence->type() == "Todo" ) { | 3345 | if ( incidence && incidence->type() == "Todo" ) { |
3346 | todo = static_cast<Todo *>(incidence); | 3346 | todo = static_cast<Todo *>(incidence); |
3347 | } | 3347 | } |
3348 | 3348 | ||
3349 | if (!event && !todo) { | 3349 | if (!event && !todo) { |
3350 | KMessageBox::sorry(this,i18n("No event selected.")); | 3350 | KMessageBox::sorry(this,i18n("No event selected.")); |
3351 | return; | 3351 | return; |
3352 | } | 3352 | } |
3353 | 3353 | ||
3354 | if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { | 3354 | if( incidence->attendeeCount() == 0 && method != Scheduler::Publish ) { |
3355 | KMessageBox::sorry(this,i18n("The event has no attendees.")); | 3355 | KMessageBox::sorry(this,i18n("The event has no attendees.")); |
3356 | return; | 3356 | return; |
3357 | } | 3357 | } |
3358 | 3358 | ||
3359 | Event *ev = 0; | 3359 | Event *ev = 0; |
3360 | if (event) ev = new Event(*event); | 3360 | if (event) ev = new Event(*event); |
3361 | Todo *to = 0; | 3361 | Todo *to = 0; |
3362 | if (todo) to = new Todo(*todo); | 3362 | if (todo) to = new Todo(*todo); |
3363 | 3363 | ||
3364 | if (method == Scheduler::Reply || method == Scheduler::Refresh) { | 3364 | if (method == Scheduler::Reply || method == Scheduler::Refresh) { |
3365 | Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 3365 | Attendee *me = incidence->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
3366 | if (!me) { | 3366 | if (!me) { |
3367 | KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); | 3367 | KMessageBox::sorry(this,i18n("Could not find your attendee entry.\nPlease check the emails.")); |
3368 | return; | 3368 | return; |
3369 | } | 3369 | } |
3370 | if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { | 3370 | if (me->status()==Attendee::NeedsAction && me->RSVP() && method==Scheduler::Reply) { |
3371 | StatusDialog *statdlg = new StatusDialog(this); | 3371 | StatusDialog *statdlg = new StatusDialog(this); |
3372 | if (!statdlg->exec()==QDialog::Accepted) return; | 3372 | if (!statdlg->exec()==QDialog::Accepted) return; |
3373 | me->setStatus( statdlg->status() ); | 3373 | me->setStatus( statdlg->status() ); |
3374 | delete(statdlg); | 3374 | delete(statdlg); |
3375 | } | 3375 | } |
3376 | Attendee *menew = new Attendee(*me); | 3376 | Attendee *menew = new Attendee(*me); |
3377 | if (ev) { | 3377 | if (ev) { |
3378 | ev->clearAttendees(); | 3378 | ev->clearAttendees(); |
3379 | ev->addAttendee(menew,false); | 3379 | ev->addAttendee(menew,false); |
3380 | } else { | 3380 | } else { |
3381 | if (to) { | 3381 | if (to) { |
3382 | todo->clearAttendees(); | 3382 | todo->clearAttendees(); |
3383 | todo->addAttendee(menew,false); | 3383 | todo->addAttendee(menew,false); |
3384 | } | 3384 | } |
3385 | } | 3385 | } |
3386 | } | 3386 | } |
3387 | 3387 | ||
3388 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); | 3388 | OutgoingDialog *dlg = mDialogManager->outgoingDialog(); |
3389 | if (ev) { | 3389 | if (ev) { |
3390 | if ( !dlg->addMessage(ev,method) ) delete(ev); | 3390 | if ( !dlg->addMessage(ev,method) ) delete(ev); |
3391 | } else { | 3391 | } else { |
3392 | if (to) { | 3392 | if (to) { |
3393 | if ( !dlg->addMessage(to,method) ) delete(to); | 3393 | if ( !dlg->addMessage(to,method) ) delete(to); |
3394 | } | 3394 | } |
3395 | } | 3395 | } |
3396 | } | 3396 | } |
3397 | 3397 | ||
3398 | void CalendarView::openAddressbook() | 3398 | void CalendarView::openAddressbook() |
3399 | { | 3399 | { |
3400 | KRun::runCommand("kaddressbook"); | 3400 | KRun::runCommand("kaddressbook"); |
3401 | } | 3401 | } |
3402 | 3402 | ||
3403 | void CalendarView::setModified(bool modified) | 3403 | void CalendarView::setModified(bool modified) |
3404 | { | 3404 | { |
3405 | if ( modified ) | 3405 | if ( modified ) |
3406 | emit signalmodified(); | 3406 | emit signalmodified(); |
3407 | if (mModified != modified) { | 3407 | if (mModified != modified) { |
3408 | mModified = modified; | 3408 | mModified = modified; |
3409 | emit modifiedChanged(mModified); | 3409 | emit modifiedChanged(mModified); |
3410 | } | 3410 | } |
3411 | } | 3411 | } |
3412 | 3412 | ||
3413 | bool CalendarView::isReadOnly() | 3413 | bool CalendarView::isReadOnly() |
3414 | { | 3414 | { |
3415 | return mReadOnly; | 3415 | return mReadOnly; |
3416 | } | 3416 | } |
3417 | 3417 | ||
3418 | void CalendarView::setReadOnly(bool readOnly) | 3418 | void CalendarView::setReadOnly(bool readOnly) |
3419 | { | 3419 | { |
3420 | if (mReadOnly != readOnly) { | 3420 | if (mReadOnly != readOnly) { |
3421 | mReadOnly = readOnly; | 3421 | mReadOnly = readOnly; |
3422 | emit readOnlyChanged(mReadOnly); | 3422 | emit readOnlyChanged(mReadOnly); |
3423 | } | 3423 | } |
3424 | } | 3424 | } |
3425 | 3425 | ||
3426 | bool CalendarView::isModified() | 3426 | bool CalendarView::isModified() |
3427 | { | 3427 | { |
3428 | return mModified; | 3428 | return mModified; |
3429 | } | 3429 | } |
3430 | 3430 | ||
3431 | void CalendarView::printSetup() | 3431 | void CalendarView::printSetup() |
3432 | { | 3432 | { |
3433 | #ifndef KORG_NOPRINTER | 3433 | #ifndef KORG_NOPRINTER |
3434 | createPrinter(); | 3434 | createPrinter(); |
3435 | 3435 | ||
3436 | mCalPrinter->setupPrinter(); | 3436 | mCalPrinter->setupPrinter(); |
3437 | #endif | 3437 | #endif |
3438 | } | 3438 | } |
3439 | 3439 | ||
3440 | void CalendarView::print() | 3440 | void CalendarView::print() |
3441 | { | 3441 | { |
3442 | #ifndef KORG_NOPRINTER | 3442 | #ifndef KORG_NOPRINTER |
3443 | createPrinter(); | 3443 | createPrinter(); |
3444 | 3444 | ||
3445 | DateList tmpDateList = mNavigator->selectedDates(); | 3445 | DateList tmpDateList = mNavigator->selectedDates(); |
3446 | mCalPrinter->print(CalPrinter::Month, | 3446 | mCalPrinter->print(CalPrinter::Month, |
3447 | tmpDateList.first(), tmpDateList.last()); | 3447 | tmpDateList.first(), tmpDateList.last()); |
3448 | #endif | 3448 | #endif |
3449 | } | 3449 | } |
3450 | 3450 | ||
3451 | void CalendarView::printPreview() | 3451 | void CalendarView::printPreview() |
3452 | { | 3452 | { |
3453 | #ifndef KORG_NOPRINTER | 3453 | #ifndef KORG_NOPRINTER |
3454 | kdDebug() << "CalendarView::printPreview()" << endl; | 3454 | kdDebug() << "CalendarView::printPreview()" << endl; |
3455 | 3455 | ||
3456 | createPrinter(); | 3456 | createPrinter(); |
3457 | 3457 | ||
3458 | DateList tmpDateList = mNavigator->selectedDates(); | 3458 | DateList tmpDateList = mNavigator->selectedDates(); |
3459 | 3459 | ||
3460 | mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), | 3460 | mViewManager->currentView()->printPreview(mCalPrinter,tmpDateList.first(), |
3461 | tmpDateList.last()); | 3461 | tmpDateList.last()); |
3462 | #endif | 3462 | #endif |
3463 | } | 3463 | } |
3464 | 3464 | ||
3465 | void CalendarView::exportICalendar() | 3465 | void CalendarView::exportICalendar() |
3466 | { | 3466 | { |
3467 | QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); | 3467 | QString filename = KFileDialog::getSaveFileName("icalout.ics",i18n("*.ics|ICalendars"),this); |
3468 | 3468 | ||
3469 | // Force correct extension | 3469 | // Force correct extension |
3470 | if (filename.right(4) != ".ics") filename += ".ics"; | 3470 | if (filename.right(4) != ".ics") filename += ".ics"; |
3471 | 3471 | ||
3472 | FileStorage storage( mCalendar, filename, new ICalFormat() ); | 3472 | FileStorage storage( mCalendar, filename, new ICalFormat() ); |
3473 | storage.save(); | 3473 | storage.save(); |
3474 | } | 3474 | } |
3475 | 3475 | ||
3476 | bool CalendarView::exportVCalendar( QString filename ) | 3476 | bool CalendarView::exportVCalendar( QString filename ) |
3477 | { | 3477 | { |
3478 | if (mCalendar->journals().count() > 0) { | 3478 | if (mCalendar->journals().count() > 0) { |
3479 | int result = KMessageBox::warningContinueCancel(this, | 3479 | int result = KMessageBox::warningContinueCancel(this, |
3480 | i18n("The journal entries can not be\nexported to a vCalendar file."), | 3480 | i18n("The journal entries can not be\nexported to a vCalendar file."), |
3481 | i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), | 3481 | i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), |
3482 | true); | 3482 | true); |
3483 | if (result != KMessageBox::Continue) return false; | 3483 | if (result != KMessageBox::Continue) return false; |
3484 | } | 3484 | } |
3485 | 3485 | ||
3486 | //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); | 3486 | //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); |
3487 | 3487 | ||
3488 | // Force correct extension | 3488 | // Force correct extension |
3489 | if (filename.right(4) != ".vcs") filename += ".vcs"; | 3489 | if (filename.right(4) != ".vcs") filename += ".vcs"; |
3490 | 3490 | ||
3491 | FileStorage storage( mCalendar, filename, new VCalFormat ); | 3491 | FileStorage storage( mCalendar, filename, new VCalFormat ); |
3492 | return storage.save(); | 3492 | return storage.save(); |
3493 | 3493 | ||
3494 | } | 3494 | } |
3495 | 3495 | ||
3496 | void CalendarView::eventUpdated(Incidence *) | 3496 | void CalendarView::eventUpdated(Incidence *) |
3497 | { | 3497 | { |
3498 | setModified(); | 3498 | setModified(); |
3499 | // Don't call updateView here. The code, which has caused the update of the | 3499 | // Don't call updateView here. The code, which has caused the update of the |
3500 | // event is responsible for updating the view. | 3500 | // event is responsible for updating the view. |
3501 | // updateView(); | 3501 | // updateView(); |
3502 | } | 3502 | } |
3503 | 3503 | ||
3504 | void CalendarView::adaptNavigationUnits() | 3504 | void CalendarView::adaptNavigationUnits() |
3505 | { | 3505 | { |
3506 | if (mViewManager->currentView()->isEventView()) { | 3506 | if (mViewManager->currentView()->isEventView()) { |
3507 | int days = mViewManager->currentView()->currentDateCount(); | 3507 | int days = mViewManager->currentView()->currentDateCount(); |
3508 | if (days == 1) { | 3508 | if (days == 1) { |
3509 | emit changeNavStringPrev(i18n("&Previous Day")); | 3509 | emit changeNavStringPrev(i18n("&Previous Day")); |
3510 | emit changeNavStringNext(i18n("&Next Day")); | 3510 | emit changeNavStringNext(i18n("&Next Day")); |
3511 | } else { | 3511 | } else { |
3512 | emit changeNavStringPrev(i18n("&Previous Week")); | 3512 | emit changeNavStringPrev(i18n("&Previous Week")); |
3513 | emit changeNavStringNext(i18n("&Next Week")); | 3513 | emit changeNavStringNext(i18n("&Next Week")); |
3514 | } | 3514 | } |
3515 | } | 3515 | } |
3516 | } | 3516 | } |
3517 | 3517 | ||
3518 | void CalendarView::processMainViewSelection( Incidence *incidence ) | 3518 | void CalendarView::processMainViewSelection( Incidence *incidence ) |
3519 | { | 3519 | { |
3520 | if ( incidence ) mTodoList->clearSelection(); | 3520 | if ( incidence ) mTodoList->clearSelection(); |
3521 | processIncidenceSelection( incidence ); | 3521 | processIncidenceSelection( incidence ); |
3522 | } | 3522 | } |
3523 | 3523 | ||
3524 | void CalendarView::processTodoListSelection( Incidence *incidence ) | 3524 | void CalendarView::processTodoListSelection( Incidence *incidence ) |
3525 | { | 3525 | { |
3526 | if ( incidence && mViewManager->currentView() ) { | 3526 | if ( incidence && mViewManager->currentView() ) { |
3527 | mViewManager->currentView()->clearSelection(); | 3527 | mViewManager->currentView()->clearSelection(); |
3528 | } | 3528 | } |
3529 | processIncidenceSelection( incidence ); | 3529 | processIncidenceSelection( incidence ); |
3530 | } | 3530 | } |
3531 | 3531 | ||
3532 | void CalendarView::processIncidenceSelection( Incidence *incidence ) | 3532 | void CalendarView::processIncidenceSelection( Incidence *incidence ) |
3533 | { | 3533 | { |
3534 | if ( incidence == mSelectedIncidence ) return; | 3534 | if ( incidence == mSelectedIncidence ) return; |
3535 | 3535 | ||
3536 | mSelectedIncidence = incidence; | 3536 | mSelectedIncidence = incidence; |
3537 | 3537 | ||
3538 | emit incidenceSelected( mSelectedIncidence ); | 3538 | emit incidenceSelected( mSelectedIncidence ); |
3539 | 3539 | ||
3540 | if ( incidence && incidence->type() == "Event" ) { | 3540 | if ( incidence && incidence->type() == "Event" ) { |
3541 | Event *event = static_cast<Event *>( incidence ); | 3541 | Event *event = static_cast<Event *>( incidence ); |
3542 | if ( event->organizer() == KOPrefs::instance()->email() ) { | 3542 | if ( event->organizer() == KOPrefs::instance()->email() ) { |
3543 | emit organizerEventsSelected( true ); | 3543 | emit organizerEventsSelected( true ); |
3544 | } else { | 3544 | } else { |
3545 | emit organizerEventsSelected(false); | 3545 | emit organizerEventsSelected(false); |
3546 | } | 3546 | } |
3547 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, | 3547 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, |
3548 | KOPrefs::instance()->email() ) ) { | 3548 | KOPrefs::instance()->email() ) ) { |
3549 | emit groupEventsSelected( true ); | 3549 | emit groupEventsSelected( true ); |
3550 | } else { | 3550 | } else { |
3551 | emit groupEventsSelected(false); | 3551 | emit groupEventsSelected(false); |
3552 | } | 3552 | } |
3553 | return; | 3553 | return; |
3554 | } else { | 3554 | } else { |
3555 | if ( incidence && incidence->type() == "Todo" ) { | 3555 | if ( incidence && incidence->type() == "Todo" ) { |
3556 | emit todoSelected( true ); | 3556 | emit todoSelected( true ); |
3557 | Todo *event = static_cast<Todo *>( incidence ); | 3557 | Todo *event = static_cast<Todo *>( incidence ); |
3558 | if ( event->organizer() == KOPrefs::instance()->email() ) { | 3558 | if ( event->organizer() == KOPrefs::instance()->email() ) { |
3559 | emit organizerEventsSelected( true ); | 3559 | emit organizerEventsSelected( true ); |
3560 | } else { | 3560 | } else { |
3561 | emit organizerEventsSelected(false); | 3561 | emit organizerEventsSelected(false); |
3562 | } | 3562 | } |
3563 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, | 3563 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, |
3564 | KOPrefs::instance()->email() ) ) { | 3564 | KOPrefs::instance()->email() ) ) { |
3565 | emit groupEventsSelected( true ); | 3565 | emit groupEventsSelected( true ); |
3566 | } else { | 3566 | } else { |
3567 | emit groupEventsSelected(false); | 3567 | emit groupEventsSelected(false); |
3568 | } | 3568 | } |
3569 | return; | 3569 | return; |
3570 | } else { | 3570 | } else { |
3571 | emit todoSelected( false ); | 3571 | emit todoSelected( false ); |
3572 | emit organizerEventsSelected(false); | 3572 | emit organizerEventsSelected(false); |
3573 | emit groupEventsSelected(false); | 3573 | emit groupEventsSelected(false); |
3574 | } | 3574 | } |
3575 | return; | 3575 | return; |
3576 | } | 3576 | } |
3577 | 3577 | ||
3578 | /* if ( incidence && incidence->type() == "Todo" ) { | 3578 | /* if ( incidence && incidence->type() == "Todo" ) { |
3579 | emit todoSelected( true ); | 3579 | emit todoSelected( true ); |
3580 | } else { | 3580 | } else { |
3581 | emit todoSelected( false ); | 3581 | emit todoSelected( false ); |
3582 | }*/ | 3582 | }*/ |
3583 | } | 3583 | } |
3584 | 3584 | ||
3585 | 3585 | ||
3586 | void CalendarView::checkClipboard() | 3586 | void CalendarView::checkClipboard() |
3587 | { | 3587 | { |
3588 | #ifndef KORG_NODND | 3588 | #ifndef KORG_NODND |
3589 | if (ICalDrag::canDecode(QApplication::clipboard()->data())) { | 3589 | if (ICalDrag::canDecode(QApplication::clipboard()->data())) { |
3590 | emit pasteEnabled(true); | 3590 | emit pasteEnabled(true); |
3591 | } else { | 3591 | } else { |
3592 | emit pasteEnabled(false); | 3592 | emit pasteEnabled(false); |
3593 | } | 3593 | } |
3594 | #endif | 3594 | #endif |
3595 | } | 3595 | } |
3596 | 3596 | ||
3597 | void CalendarView::showDates(const DateList &selectedDates) | 3597 | void CalendarView::showDates(const DateList &selectedDates) |
3598 | { | 3598 | { |
3599 | // kdDebug() << "CalendarView::selectDates()" << endl; | 3599 | // kdDebug() << "CalendarView::selectDates()" << endl; |
3600 | 3600 | ||
3601 | 3601 | ||
3602 | if ( !mBlockShowDates ) { | 3602 | if ( !mBlockShowDates ) { |
3603 | if ( mViewManager->currentView() ) { | 3603 | if ( mViewManager->currentView() ) { |
3604 | updateView( selectedDates.first(), selectedDates.last() ); | 3604 | updateView( selectedDates.first(), selectedDates.last() ); |
3605 | } else { | 3605 | } else { |
3606 | mViewManager->showAgendaView(); | 3606 | mViewManager->showAgendaView(); |
3607 | } | 3607 | } |
3608 | } | 3608 | } |
3609 | 3609 | ||
3610 | QDate date = selectedDates.first(); | 3610 | QDate date = selectedDates.first(); |
3611 | if ( ! date.isValid() ) { | 3611 | if ( ! date.isValid() ) { |
3612 | topLevelWidget()->setCaption(""); | 3612 | topLevelWidget()->setCaption(""); |
3613 | return; | 3613 | return; |
3614 | } | 3614 | } |
3615 | 3615 | ||
3616 | QString selDates; | 3616 | QString selDates; |
3617 | selDates = KGlobal::locale()->formatDate( date, true); | 3617 | selDates = KGlobal::locale()->formatDate( date, true); |
3618 | if (selectedDates.first() < selectedDates.last() ) | 3618 | if (selectedDates.first() < selectedDates.last() ) |
3619 | selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); | 3619 | selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); |
3620 | else { | 3620 | else { |
3621 | QString addString; | 3621 | QString addString; |
3622 | if ( date == QDateTime::currentDateTime().date() ) | 3622 | if ( date == QDateTime::currentDateTime().date() ) |
3623 | addString = i18n("Today"); | 3623 | addString = i18n("Today"); |
3624 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) | 3624 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
3625 | addString = i18n("Tomorrow"); | 3625 | addString = i18n("Tomorrow"); |
3626 | else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) | 3626 | else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) |
3627 | addString = i18n("Yesterday"); | 3627 | addString = i18n("Yesterday"); |
3628 | else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) | 3628 | else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) |
3629 | addString = i18n("Day before yesterday"); | 3629 | addString = i18n("Day before yesterday"); |
3630 | else if ( date == QDateTime::currentDateTime().date().addDays(2) ) | 3630 | else if ( date == QDateTime::currentDateTime().date().addDays(2) ) |
3631 | addString = i18n("Day after tomorrow"); | 3631 | addString = i18n("Day after tomorrow"); |
3632 | if ( !addString.isEmpty() ) { | 3632 | if ( !addString.isEmpty() ) { |
3633 | topLevelWidget()->setCaption( addString+", " + selDates ); | 3633 | topLevelWidget()->setCaption( addString+", " + selDates ); |
3634 | return; | 3634 | return; |
3635 | } | 3635 | } |
3636 | } | 3636 | } |
3637 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); | 3637 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); |
3638 | 3638 | ||
3639 | } | 3639 | } |
3640 | 3640 | ||
3641 | QPtrList<CalFilter> CalendarView::filters() | 3641 | QPtrList<CalFilter> CalendarView::filters() |
3642 | { | 3642 | { |
3643 | return mFilters; | 3643 | return mFilters; |
3644 | 3644 | ||
3645 | } | 3645 | } |
3646 | void CalendarView::editFilters() | 3646 | void CalendarView::editFilters() |
3647 | { | 3647 | { |
3648 | // kdDebug() << "CalendarView::editFilters()" << endl; | 3648 | // kdDebug() << "CalendarView::editFilters()" << endl; |
3649 | 3649 | ||
3650 | CalFilter *filter = mFilters.first(); | 3650 | CalFilter *filter = mFilters.first(); |
3651 | while(filter) { | 3651 | while(filter) { |
3652 | kdDebug() << " Filter: " << filter->name() << endl; | 3652 | kdDebug() << " Filter: " << filter->name() << endl; |
3653 | filter = mFilters.next(); | 3653 | filter = mFilters.next(); |
3654 | } | 3654 | } |
3655 | 3655 | ||
3656 | mDialogManager->showFilterEditDialog(&mFilters); | 3656 | mDialogManager->showFilterEditDialog(&mFilters); |
3657 | } | 3657 | } |
3658 | void CalendarView::toggleFilter() | 3658 | void CalendarView::toggleFilter() |
3659 | { | 3659 | { |
3660 | showFilter(! mFilterView->isVisible()); | 3660 | showFilter(! mFilterView->isVisible()); |
3661 | } | 3661 | } |
3662 | 3662 | ||
3663 | KOFilterView *CalendarView::filterView() | 3663 | KOFilterView *CalendarView::filterView() |
3664 | { | 3664 | { |
3665 | return mFilterView; | 3665 | return mFilterView; |
3666 | } | 3666 | } |
3667 | void CalendarView::selectFilter( int fil ) | 3667 | void CalendarView::selectFilter( int fil ) |
3668 | { | 3668 | { |
3669 | mFilterView->setSelectedFilter( fil ); | 3669 | mFilterView->setSelectedFilter( fil ); |
3670 | } | 3670 | } |
3671 | void CalendarView::showFilter(bool visible) | 3671 | void CalendarView::showFilter(bool visible) |
3672 | { | 3672 | { |
3673 | if (visible) mFilterView->show(); | 3673 | if (visible) mFilterView->show(); |
3674 | else mFilterView->hide(); | 3674 | else mFilterView->hide(); |
3675 | } | 3675 | } |
3676 | void CalendarView::toggleFilerEnabled( ) | 3676 | void CalendarView::toggleFilerEnabled( ) |
3677 | { | 3677 | { |
3678 | mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); | 3678 | mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); |
3679 | if ( !mFilterView->filtersEnabled() ) | 3679 | if ( !mFilterView->filtersEnabled() ) |
3680 | topLevelWidget()->setCaption( i18n("Filter disabled ") ); | 3680 | topLevelWidget()->setCaption( i18n("Filter disabled ") ); |
3681 | 3681 | ||
3682 | } | 3682 | } |
3683 | void CalendarView::updateFilter() | 3683 | void CalendarView::updateFilter() |
3684 | { | 3684 | { |
3685 | CalFilter *filter = mFilterView->selectedFilter(); | 3685 | CalFilter *filter = mFilterView->selectedFilter(); |
3686 | if (filter) { | 3686 | if (filter) { |
3687 | QString mess; | 3687 | QString mess; |
3688 | if (mFilterView->filtersEnabled()) { | 3688 | if (mFilterView->filtersEnabled()) { |
3689 | mess = i18n("Filter selected: ")+filter->name(); | 3689 | mess = i18n("Filter selected: ")+filter->name(); |
3690 | filter->setEnabled(true); | 3690 | filter->setEnabled(true); |
3691 | } | 3691 | } |
3692 | else filter->setEnabled(false); | 3692 | else filter->setEnabled(false); |
3693 | mCalendar->setFilter(filter); | 3693 | mCalendar->setFilter(filter); |
3694 | updateView(); | 3694 | updateView(); |
3695 | if ( !mess.isEmpty() ) | 3695 | if ( !mess.isEmpty() ) |
3696 | topLevelWidget()->setCaption( mess ); | 3696 | topLevelWidget()->setCaption( mess ); |
3697 | 3697 | ||
3698 | } | 3698 | } |
3699 | } | 3699 | } |
3700 | 3700 | ||
3701 | void CalendarView::filterEdited() | 3701 | void CalendarView::filterEdited() |
3702 | { | 3702 | { |
3703 | mFilterView->updateFilters(); | 3703 | mFilterView->updateFilters(); |
3704 | updateFilter(); | 3704 | updateFilter(); |
3705 | writeSettings(); | 3705 | writeSettings(); |
3706 | } | 3706 | } |
3707 | 3707 | ||
3708 | 3708 | ||
3709 | void CalendarView::takeOverEvent() | 3709 | void CalendarView::takeOverEvent() |
3710 | { | 3710 | { |
3711 | Incidence *incidence = currentSelection(); | 3711 | Incidence *incidence = currentSelection(); |
3712 | 3712 | ||
3713 | if (!incidence) return; | 3713 | if (!incidence) return; |
3714 | 3714 | ||
3715 | incidence->setOrganizer(KOPrefs::instance()->email()); | 3715 | incidence->setOrganizer(KOPrefs::instance()->email()); |
3716 | incidence->recreate(); | 3716 | incidence->recreate(); |
3717 | incidence->setReadOnly(false); | 3717 | incidence->setReadOnly(false); |
3718 | 3718 | ||
3719 | updateView(); | 3719 | updateView(); |
3720 | } | 3720 | } |
3721 | 3721 | ||
3722 | void CalendarView::takeOverCalendar() | 3722 | void CalendarView::takeOverCalendar() |
3723 | { | 3723 | { |
3724 | // TODO: Create Calendar::allIncidences() function and use it here | 3724 | // TODO: Create Calendar::allIncidences() function and use it here |
3725 | 3725 | ||
3726 | QPtrList<Event> events = mCalendar->events(); | 3726 | QPtrList<Event> events = mCalendar->events(); |
3727 | for(uint i=0; i<events.count(); ++i) { | 3727 | for(uint i=0; i<events.count(); ++i) { |
3728 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3728 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3729 | events.at(i)->recreate(); | 3729 | events.at(i)->recreate(); |
3730 | events.at(i)->setReadOnly(false); | 3730 | events.at(i)->setReadOnly(false); |
3731 | } | 3731 | } |
3732 | 3732 | ||
3733 | QPtrList<Todo> todos = mCalendar->todos(); | 3733 | QPtrList<Todo> todos = mCalendar->todos(); |
3734 | for(uint i=0; i<todos.count(); ++i) { | 3734 | for(uint i=0; i<todos.count(); ++i) { |
3735 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3735 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3736 | todos.at(i)->recreate(); | 3736 | todos.at(i)->recreate(); |
3737 | todos.at(i)->setReadOnly(false); | 3737 | todos.at(i)->setReadOnly(false); |
3738 | } | 3738 | } |
3739 | 3739 | ||
3740 | QPtrList<Journal> journals = mCalendar->journals(); | 3740 | QPtrList<Journal> journals = mCalendar->journals(); |
3741 | for(uint i=0; i<journals.count(); ++i) { | 3741 | for(uint i=0; i<journals.count(); ++i) { |
3742 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3742 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3743 | journals.at(i)->recreate(); | 3743 | journals.at(i)->recreate(); |
3744 | journals.at(i)->setReadOnly(false); | 3744 | journals.at(i)->setReadOnly(false); |
3745 | } | 3745 | } |
3746 | 3746 | ||
3747 | updateView(); | 3747 | updateView(); |
3748 | } | 3748 | } |
3749 | 3749 | ||
3750 | void CalendarView::showIntro() | 3750 | void CalendarView::showIntro() |
3751 | { | 3751 | { |
3752 | kdDebug() << "To be implemented." << endl; | 3752 | kdDebug() << "To be implemented." << endl; |
3753 | } | 3753 | } |
3754 | 3754 | ||
3755 | QWidgetStack *CalendarView::viewStack() | 3755 | QWidgetStack *CalendarView::viewStack() |
3756 | { | 3756 | { |
3757 | return mRightFrame; | 3757 | return mRightFrame; |
3758 | } | 3758 | } |
3759 | 3759 | ||
3760 | QWidget *CalendarView::leftFrame() | 3760 | QWidget *CalendarView::leftFrame() |
3761 | { | 3761 | { |
3762 | return ( QWidget *)mLeftFrame; | 3762 | return ( QWidget *)mLeftFrame; |
3763 | } | 3763 | } |
3764 | 3764 | ||
3765 | DateNavigator *CalendarView::dateNavigator() | 3765 | DateNavigator *CalendarView::dateNavigator() |
3766 | { | 3766 | { |
3767 | return mNavigator; | 3767 | return mNavigator; |
3768 | } | 3768 | } |
3769 | 3769 | ||
3770 | KDateNavigator* CalendarView::dateNavigatorWidget() | 3770 | KDateNavigator* CalendarView::dateNavigatorWidget() |
3771 | { | 3771 | { |
3772 | return mDateNavigator->navigatorView(); | 3772 | return mDateNavigator->navigatorView(); |
3773 | } | 3773 | } |
3774 | void CalendarView::toggleDateNavigatorWidget() | 3774 | void CalendarView::toggleDateNavigatorWidget() |
3775 | { | 3775 | { |
3776 | KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; | 3776 | KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; |
3777 | 3777 | ||
3778 | if (!KOPrefs::instance()->mShowDateNavigator ) | 3778 | if (!KOPrefs::instance()->mShowDateNavigator ) |
3779 | mDateNavigator->hide(); | 3779 | mDateNavigator->hide(); |
3780 | else | 3780 | else |
3781 | mDateNavigator->show(); | 3781 | mDateNavigator->show(); |
3782 | } | 3782 | } |
3783 | void CalendarView::addView(KOrg::BaseView *view) | 3783 | void CalendarView::addView(KOrg::BaseView *view) |
3784 | { | 3784 | { |
3785 | mViewManager->addView(view); | 3785 | mViewManager->addView(view); |
3786 | } | 3786 | } |
3787 | 3787 | ||
3788 | void CalendarView::showView(KOrg::BaseView *view) | 3788 | void CalendarView::showView(KOrg::BaseView *view) |
3789 | { | 3789 | { |
3790 | mViewManager->showView(view, mLeftFrame->isVisible()); | 3790 | mViewManager->showView(view, mLeftFrame->isVisible()); |
3791 | } | 3791 | } |
3792 | 3792 | ||
3793 | Incidence *CalendarView::currentSelection() | 3793 | Incidence *CalendarView::currentSelection() |
3794 | { | 3794 | { |
3795 | return mViewManager->currentSelection(); | 3795 | return mViewManager->currentSelection(); |
3796 | } | 3796 | } |
3797 | void CalendarView::toggleAllDaySize() | 3797 | void CalendarView::toggleAllDaySize() |
3798 | { | 3798 | { |
3799 | /* | 3799 | /* |
3800 | if ( KOPrefs::instance()->mAllDaySize > 47 ) | 3800 | if ( KOPrefs::instance()->mAllDaySize > 47 ) |
3801 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; | 3801 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; |
3802 | else | 3802 | else |
3803 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; | 3803 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; |
3804 | */ | 3804 | */ |
3805 | viewManager()->agendaView()->toggleAllDay(); | 3805 | viewManager()->agendaView()->toggleAllDay(); |
3806 | } | 3806 | } |
3807 | void CalendarView::toggleExpand() | 3807 | void CalendarView::toggleExpand() |
3808 | { | 3808 | { |
3809 | // if ( mLeftFrame->isHidden() ) { | 3809 | // if ( mLeftFrame->isHidden() ) { |
3810 | // mLeftFrame->show(); | 3810 | // mLeftFrame->show(); |
3811 | // emit calendarViewExpanded( false ); | 3811 | // emit calendarViewExpanded( false ); |
3812 | // } else { | 3812 | // } else { |
3813 | // mLeftFrame->hide(); | 3813 | // mLeftFrame->hide(); |
3814 | // emit calendarViewExpanded( true ); | 3814 | // emit calendarViewExpanded( true ); |
3815 | // } | 3815 | // } |
3816 | //qDebug(" CalendarView::toggleExpand()"); | 3816 | //qDebug(" CalendarView::toggleExpand()"); |
3817 | globalFlagBlockAgenda = 1; | 3817 | globalFlagBlockAgenda = 1; |
3818 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); | 3818 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); |
3819 | globalFlagBlockAgenda = 5; | 3819 | globalFlagBlockAgenda = 5; |
3820 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); | 3820 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); |
3821 | //mViewManager->showView( 0, true ); | 3821 | //mViewManager->showView( 0, true ); |
3822 | } | 3822 | } |
3823 | 3823 | ||
3824 | void CalendarView::calendarModified( bool modified, Calendar * ) | 3824 | void CalendarView::calendarModified( bool modified, Calendar * ) |
3825 | { | 3825 | { |
3826 | setModified( modified ); | 3826 | setModified( modified ); |
3827 | } | 3827 | } |
3828 | 3828 | ||
3829 | Todo *CalendarView::selectedTodo() | 3829 | Todo *CalendarView::selectedTodo() |
3830 | { | 3830 | { |
3831 | Incidence *incidence = currentSelection(); | 3831 | Incidence *incidence = currentSelection(); |
3832 | if ( incidence && incidence->type() == "Todo" ) { | 3832 | if ( incidence && incidence->type() == "Todo" ) { |
3833 | return static_cast<Todo *>( incidence ); | 3833 | return static_cast<Todo *>( incidence ); |
3834 | } | 3834 | } |
3835 | 3835 | ||
3836 | incidence = mTodoList->selectedIncidences().first(); | 3836 | incidence = mTodoList->selectedIncidences().first(); |
3837 | if ( incidence && incidence->type() == "Todo" ) { | 3837 | if ( incidence && incidence->type() == "Todo" ) { |
3838 | return static_cast<Todo *>( incidence ); | 3838 | return static_cast<Todo *>( incidence ); |
3839 | } | 3839 | } |
3840 | 3840 | ||
3841 | return 0; | 3841 | return 0; |
3842 | } | 3842 | } |
3843 | 3843 | ||
3844 | void CalendarView::dialogClosing(Incidence *in) | 3844 | void CalendarView::dialogClosing(Incidence *in) |
3845 | { | 3845 | { |
3846 | // mDialogList.remove(in); | 3846 | // mDialogList.remove(in); |
3847 | } | 3847 | } |
3848 | 3848 | ||
3849 | void CalendarView::showIncidence() | 3849 | void CalendarView::showIncidence() |
3850 | { | 3850 | { |
3851 | mViewerCallerIsSearchDialog = false; | 3851 | mViewerCallerIsSearchDialog = false; |
3852 | Incidence *incidence = currentSelection(); | 3852 | Incidence *incidence = currentSelection(); |
3853 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3853 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3854 | if ( incidence ) { | 3854 | if ( incidence ) { |
3855 | ShowIncidenceVisitor v; | 3855 | ShowIncidenceVisitor v; |
3856 | v.act( incidence, this ); | 3856 | v.act( incidence, this ); |
3857 | } | 3857 | } |
3858 | } | 3858 | } |
3859 | void CalendarView::editIncidenceDescription() | 3859 | void CalendarView::editIncidenceDescription() |
3860 | { | 3860 | { |
3861 | mFlagEditDescription = true; | 3861 | mFlagEditDescription = true; |
3862 | editIncidence(); | 3862 | editIncidence(); |
3863 | mFlagEditDescription = false; | 3863 | mFlagEditDescription = false; |
3864 | } | 3864 | } |
3865 | void CalendarView::editIncidence() | 3865 | void CalendarView::editIncidence() |
3866 | { | 3866 | { |
3867 | // qDebug("editIncidence() "); | 3867 | // qDebug("editIncidence() "); |
3868 | Incidence *incidence = currentSelection(); | 3868 | Incidence *incidence = currentSelection(); |
3869 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3869 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3870 | if ( incidence ) { | 3870 | if ( incidence ) { |
3871 | EditIncidenceVisitor v; | 3871 | EditIncidenceVisitor v; |
3872 | v.act( incidence, this ); | 3872 | v.act( incidence, this ); |
3873 | } | 3873 | } |
3874 | } | 3874 | } |
3875 | 3875 | ||
3876 | void CalendarView::deleteIncidence() | 3876 | void CalendarView::deleteIncidence() |
3877 | { | 3877 | { |
3878 | Incidence *incidence = currentSelection(); | 3878 | Incidence *incidence = currentSelection(); |
3879 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3879 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3880 | if ( incidence ) { | 3880 | if ( incidence ) { |
3881 | deleteIncidence(incidence); | 3881 | deleteIncidence(incidence); |
3882 | } | 3882 | } |
3883 | } | 3883 | } |
3884 | 3884 | ||
3885 | void CalendarView::showIncidence(Incidence *incidence) | 3885 | void CalendarView::showIncidence(Incidence *incidence) |
3886 | { | 3886 | { |
3887 | mViewerCallerIsSearchDialog = false; | 3887 | mViewerCallerIsSearchDialog = false; |
3888 | //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); | 3888 | //qDebug("%x %x ",sender (), mDialogManager->getSearchDialog() ); |
3889 | if ( sender() && mDialogManager->getSearchDialog() ) { | 3889 | if ( sender() && mDialogManager->getSearchDialog() ) { |
3890 | if ( sender () == mDialogManager->getSearchDialog()->listview() ) { | 3890 | if ( sender () == mDialogManager->getSearchDialog()->listview() ) { |
3891 | mViewerCallerIsSearchDialog = true; | 3891 | mViewerCallerIsSearchDialog = true; |
3892 | } | 3892 | } |
3893 | } | 3893 | } |
3894 | if ( incidence ) { | 3894 | if ( incidence ) { |
3895 | ShowIncidenceVisitor v; | 3895 | ShowIncidenceVisitor v; |
3896 | v.act( incidence, this ); | 3896 | v.act( incidence, this ); |
3897 | } | 3897 | } |
3898 | } | 3898 | } |
3899 | 3899 | ||
3900 | void CalendarView::editIncidence(Incidence *incidence) | 3900 | void CalendarView::editIncidence(Incidence *incidence) |
3901 | { | 3901 | { |
3902 | if ( incidence ) { | 3902 | if ( incidence ) { |
3903 | 3903 | ||
3904 | EditIncidenceVisitor v; | 3904 | EditIncidenceVisitor v; |
3905 | v.act( incidence, this ); | 3905 | v.act( incidence, this ); |
3906 | 3906 | ||
3907 | } | 3907 | } |
3908 | } | 3908 | } |
3909 | 3909 | ||
3910 | void CalendarView::deleteIncidence(Incidence *incidence) | 3910 | void CalendarView::deleteIncidence(Incidence *incidence) |
3911 | { | 3911 | { |
3912 | //qDebug(" CalendarView::deleteIncidence "); | 3912 | //qDebug(" CalendarView::deleteIncidence "); |
3913 | if ( incidence ) { | 3913 | if ( incidence ) { |
3914 | DeleteIncidenceVisitor v; | 3914 | DeleteIncidenceVisitor v; |
3915 | v.act( incidence, this ); | 3915 | v.act( incidence, this ); |
3916 | } | 3916 | } |
3917 | } | 3917 | } |
3918 | 3918 | ||
3919 | 3919 | ||
3920 | void CalendarView::lookForOutgoingMessages() | 3920 | void CalendarView::lookForOutgoingMessages() |
3921 | { | 3921 | { |
3922 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); | 3922 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); |
3923 | ogd->loadMessages(); | 3923 | ogd->loadMessages(); |
3924 | } | 3924 | } |
3925 | 3925 | ||
3926 | void CalendarView::lookForIncomingMessages() | 3926 | void CalendarView::lookForIncomingMessages() |
3927 | { | 3927 | { |
3928 | IncomingDialog *icd = mDialogManager->incomingDialog(); | 3928 | IncomingDialog *icd = mDialogManager->incomingDialog(); |
3929 | icd->retrieve(); | 3929 | icd->retrieve(); |
3930 | } | 3930 | } |
3931 | 3931 | ||
3932 | bool CalendarView::removeCompletedSubTodos( Todo* t ) | 3932 | bool CalendarView::removeCompletedSubTodos( Todo* t ) |
3933 | { | 3933 | { |
3934 | bool deleteTodo = true; | 3934 | bool deleteTodo = true; |
3935 | QPtrList<Incidence> subTodos; | 3935 | QPtrList<Incidence> subTodos; |
3936 | Incidence *aTodo; | 3936 | Incidence *aTodo; |
3937 | subTodos = t->relations(); | 3937 | subTodos = t->relations(); |
3938 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { | 3938 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { |
3939 | if (! removeCompletedSubTodos( (Todo*) aTodo )) | 3939 | if (! removeCompletedSubTodos( (Todo*) aTodo )) |
3940 | deleteTodo = false; | 3940 | deleteTodo = false; |
3941 | } | 3941 | } |
3942 | if ( deleteTodo ) { | 3942 | if ( deleteTodo ) { |
3943 | if ( t->isCompleted() && !t->doesRecur()) { | 3943 | if ( t->isCompleted() && !t->doesRecur()) { |
3944 | checkExternalId( t ); | 3944 | checkExternalId( t ); |
3945 | mCalendar->deleteTodo( t ); | 3945 | mCalendar->deleteTodo( t ); |
3946 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); | 3946 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); |
3947 | } | 3947 | } |
3948 | else | 3948 | else |
3949 | deleteTodo = false; | 3949 | deleteTodo = false; |
3950 | } | 3950 | } |
3951 | return deleteTodo; | 3951 | return deleteTodo; |
3952 | 3952 | ||
3953 | } | 3953 | } |
3954 | void CalendarView::purgeCompleted() | 3954 | void CalendarView::purgeCompleted() |
3955 | { | 3955 | { |
3956 | int result = KMessageBox::warningContinueCancel(this, | 3956 | int result = KMessageBox::warningContinueCancel(this, |
3957 | i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); | 3957 | i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); |
3958 | 3958 | ||
3959 | if (result == KMessageBox::Continue) { | 3959 | if (result == KMessageBox::Continue) { |
3960 | 3960 | ||
3961 | QPtrList<Todo> todoCal; | 3961 | QPtrList<Todo> todoCal; |
3962 | QPtrList<Todo> rootTodos; | 3962 | QPtrList<Todo> rootTodos; |
3963 | //QPtrList<Incidence> rel; | 3963 | //QPtrList<Incidence> rel; |
3964 | Todo *aTodo;//, *rTodo; | 3964 | Todo *aTodo;//, *rTodo; |
3965 | Incidence *rIncidence; | 3965 | Incidence *rIncidence; |
3966 | bool childDelete = false; | 3966 | bool childDelete = false; |
3967 | bool deletedOne = true; | 3967 | bool deletedOne = true; |
3968 | todoCal = calendar()->todos(); | 3968 | todoCal = calendar()->todos(); |
3969 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 3969 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
3970 | if ( !aTodo->relatedTo() ) | 3970 | if ( !aTodo->relatedTo() ) |
3971 | rootTodos.append( aTodo ); | 3971 | rootTodos.append( aTodo ); |
3972 | } | 3972 | } |
3973 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { | 3973 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { |
3974 | removeCompletedSubTodos( aTodo ); | 3974 | removeCompletedSubTodos( aTodo ); |
3975 | } | 3975 | } |
3976 | 3976 | ||
3977 | updateView(); | 3977 | updateView(); |
3978 | } | 3978 | } |
3979 | } | 3979 | } |
3980 | 3980 | ||
3981 | void CalendarView::slotCalendarChanged() | 3981 | void CalendarView::slotCalendarChanged() |
3982 | { | 3982 | { |
3983 | ; | 3983 | ; |
3984 | } | 3984 | } |
3985 | 3985 | ||
3986 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 3986 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
3987 | { | 3987 | { |
3988 | //qDebug(" alendarView::keyPressEvent "); | 3988 | //qDebug(" alendarView::keyPressEvent "); |
3989 | e->ignore(); | 3989 | e->ignore(); |
3990 | } | 3990 | } |
3991 | 3991 | ||
3992 | 3992 | ||
3993 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 3993 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
3994 | { | 3994 | { |
3995 | // mSyncManager = manager; | 3995 | // mSyncManager = manager; |
3996 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 3996 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
3997 | qDebug("KO: SyncKDE request detected!"); | 3997 | qDebug("KO: SyncKDE request detected!"); |
3998 | } | 3998 | } |
3999 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3999 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4000 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4000 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4001 | return syncCalendar( filename, mode ); | 4001 | return syncCalendar( filename, mode ); |
4002 | } | 4002 | } |
4003 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 4003 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
4004 | { | 4004 | { |
4005 | //mSyncManager = manager; | 4005 | //mSyncManager = manager; |
4006 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4006 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4007 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4007 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4008 | if ( resource == "sharp" ) | 4008 | if ( resource == "sharp" ) |
4009 | syncExternal( 0 ); | 4009 | syncExternal( 0 ); |
4010 | if ( resource == "phone" ) | 4010 | if ( resource == "phone" ) |
4011 | syncExternal( 1 ); | 4011 | syncExternal( 1 ); |
4012 | // pending setmodified | 4012 | // pending setmodified |
4013 | return true; | 4013 | return true; |
4014 | } | 4014 | } |
4015 | void CalendarView::setSyncManager(KSyncManager* manager) | 4015 | void CalendarView::setSyncManager(KSyncManager* manager) |
4016 | { | 4016 | { |
4017 | mSyncManager = manager; | 4017 | mSyncManager = manager; |
4018 | } | 4018 | } |
4019 | 4019 | ||
4020 | void CalendarView::removeSyncInfo( QString syncProfile) | 4020 | void CalendarView::removeSyncInfo( QString syncProfile) |
4021 | { | 4021 | { |
4022 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); | 4022 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); |
4023 | mCalendar->removeSyncInfo( syncProfile ); | 4023 | mCalendar->removeSyncInfo( syncProfile ); |
4024 | 4024 | ||
4025 | } | 4025 | } |
4026 | 4026 | ||
4027 | void CalendarView::undo_delete() | 4027 | void CalendarView::undo_delete() |
4028 | { | 4028 | { |
4029 | //qDebug("undo_delete() "); | 4029 | //qDebug("undo_delete() "); |
4030 | Incidence* undo = mCalendar->undoIncidence(); | 4030 | Incidence* undo = mCalendar->undoIncidence(); |
4031 | if ( !undo ) { | 4031 | if ( !undo ) { |
4032 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), | 4032 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), |
4033 | i18n("KO/Pi")); | 4033 | i18n("KO/Pi")); |
4034 | return; | 4034 | return; |
4035 | } | 4035 | } |
4036 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + | 4036 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + |
4037 | i18n("\nAre you sure you want\nto restore this?"), | 4037 | i18n("\nAre you sure you want\nto restore this?"), |
4038 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { | 4038 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { |
4039 | mCalendar->undoDeleteIncidence(); | 4039 | mCalendar->undoDeleteIncidence(); |
4040 | updateView(); | 4040 | updateView(); |
4041 | } | 4041 | } |
4042 | } | 4042 | } |
4043 | 4043 | ||
4044 | void CalendarView::slotViewerClosed() | 4044 | void CalendarView::slotViewerClosed() |
4045 | { | 4045 | { |
4046 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); | 4046 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); |
4047 | } | 4047 | } |
4048 | 4048 | ||
4049 | void CalendarView::resetFocus() | 4049 | void CalendarView::resetFocus() |
4050 | { | 4050 | { |
4051 | if ( mViewerCallerIsSearchDialog ) { | 4051 | if ( mViewerCallerIsSearchDialog ) { |
4052 | if ( mDialogManager->getSearchDialog()->isVisible() ){ | 4052 | if ( mDialogManager->getSearchDialog()->isVisible() ){ |
4053 | mDialogManager->getSearchDialog()->raise(); | 4053 | mDialogManager->getSearchDialog()->raise(); |
4054 | mDialogManager->getSearchDialog()->setActiveWindow(); | 4054 | mDialogManager->getSearchDialog()->setActiveWindow(); |
4055 | mDialogManager->getSearchDialog()->listview()->resetFocus(); | 4055 | mDialogManager->getSearchDialog()->listview()->resetFocus(); |
4056 | } else | 4056 | } else |
4057 | mViewerCallerIsSearchDialog = false; | 4057 | mViewerCallerIsSearchDialog = false; |
4058 | } | 4058 | } |
4059 | if ( !mViewerCallerIsSearchDialog ) { | 4059 | if ( !mViewerCallerIsSearchDialog ) { |
4060 | //mViewManager->currentView()->setFocus(); | 4060 | //mViewManager->currentView()->setFocus(); |
4061 | //qDebug("sssssssssssssssset focus "); | 4061 | //qDebug("sssssssssssssssset focus "); |
4062 | topLevelWidget()->raise(); | 4062 | topLevelWidget()->raise(); |
4063 | setActiveWindow(); | 4063 | setActiveWindow(); |
4064 | //setFocus(); | 4064 | //setFocus(); |
4065 | } | 4065 | } |
4066 | mViewerCallerIsSearchDialog = false; | 4066 | mViewerCallerIsSearchDialog = false; |
4067 | } | 4067 | } |
4068 | 4068 | ||
4069 | void CalendarView::showNextAlarms() | 4069 | void CalendarView::showNextAlarms() |
4070 | { | 4070 | { |
4071 | QString message; | 4071 | QString message; |
4072 | if ( mNextAlarmDateTime > QDateTime::currentDateTime() ) { | 4072 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); |
4073 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { | ||
4073 | QString sum = mCalendar->nextSummary(); | 4074 | QString sum = mCalendar->nextSummary(); |
4074 | QDateTime nextA = mNextAlarmDateTime; | 4075 | QDateTime nextA = mNextAlarmDateTime; |
4075 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); | 4076 | QDateTime cur = QDateTime::currentDateTime(); |
4076 | message = i18n("The next alarm is on:\n%1\nat: %2\n\n%3\n(%4)").arg( KGlobal::locale()->formatDate(nextA.date() , false)).arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; | 4077 | int secs = cur.secsTo( nextA ); |
4078 | int min = secs /60; | ||
4079 | int hours = min /60; | ||
4080 | min = min % 60; | ||
4081 | int days = hours /24; | ||
4082 | hours = hours % 24; | ||
4083 | |||
4084 | message = i18n("The next alarm is in:\n"); | ||
4085 | if ( days > 1 ) | ||
4086 | message += i18n("%1 days\n").arg( days ); | ||
4087 | else if ( days == 1 ) | ||
4088 | message += i18n("1 day\n"); | ||
4089 | if ( hours > 1 ) | ||
4090 | message += i18n("%1 hours\n").arg( hours ); | ||
4091 | else if ( hours == 1 ) | ||
4092 | message += i18n("1 hour\n"); | ||
4093 | if ( min > 1 ) | ||
4094 | message += i18n("%1 minutes\n").arg( min ); | ||
4095 | else if ( min == 1 ) | ||
4096 | message += i18n("1 minute\n"); | ||
4097 | |||
4098 | message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; | ||
4077 | } else { | 4099 | } else { |
4078 | message = i18n("There is no next alarm."); | 4100 | message = i18n("There is no next alarm."); |
4079 | 4101 | ||
4080 | } | 4102 | } |
4081 | KMessageBox::information( this, message); | 4103 | KMessageBox::information( this, message); |
4082 | } | 4104 | } |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 18f242c..f6f390b 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -1,1593 +1,1590 @@ | |||
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 <qhbox.h> | 24 | #include <qhbox.h> |
25 | #include <qvbox.h> | 25 | #include <qvbox.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qframe.h> | 27 | #include <qframe.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #ifndef KORG_NOSPLITTER | 29 | #ifndef KORG_NOSPLITTER |
30 | #include <qsplitter.h> | 30 | #include <qsplitter.h> |
31 | #endif | 31 | #endif |
32 | #include <qfont.h> | 32 | #include <qfont.h> |
33 | #include <qfontmetrics.h> | 33 | #include <qfontmetrics.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <qtooltip.h> | 35 | #include <qtooltip.h> |
36 | #include <qpainter.h> | 36 | #include <qpainter.h> |
37 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
38 | #include <qapplication.h> | 38 | #include <qapplication.h> |
39 | 39 | ||
40 | #include <kapplication.h> | 40 | #include <kapplication.h> |
41 | #include <KDGanttMinimizeSplitter.h> | 41 | #include <KDGanttMinimizeSplitter.h> |
42 | #include <kdebug.h> | 42 | #include <kdebug.h> |
43 | #include <kstandarddirs.h> | 43 | #include <kstandarddirs.h> |
44 | #include <kiconloader.h> | 44 | #include <kiconloader.h> |
45 | #include <klocale.h> | 45 | #include <klocale.h> |
46 | #include <kconfig.h> | 46 | #include <kconfig.h> |
47 | #include <kglobal.h> | 47 | #include <kglobal.h> |
48 | #include "calendarview.h" | 48 | #include "calendarview.h" |
49 | #include "koviewmanager.h" | 49 | #include "koviewmanager.h" |
50 | 50 | ||
51 | #include <libkcal/calendar.h> | 51 | #include <libkcal/calendar.h> |
52 | #include <libkcal/icaldrag.h> | 52 | #include <libkcal/icaldrag.h> |
53 | #include <libkcal/dndfactory.h> | 53 | #include <libkcal/dndfactory.h> |
54 | 54 | ||
55 | #include <kcalendarsystem.h> | 55 | #include <kcalendarsystem.h> |
56 | 56 | ||
57 | #include "koglobals.h" | 57 | #include "koglobals.h" |
58 | #ifndef KORG_NOPLUGINS | 58 | #ifndef KORG_NOPLUGINS |
59 | #include "kocore.h" | 59 | #include "kocore.h" |
60 | #endif | 60 | #endif |
61 | #include "koprefs.h" | 61 | #include "koprefs.h" |
62 | #include "koagenda.h" | 62 | #include "koagenda.h" |
63 | #include "koagendaitem.h" | 63 | #include "koagendaitem.h" |
64 | #ifndef KORG_NOPRINTER | 64 | #ifndef KORG_NOPRINTER |
65 | #include "calprinter.h" | 65 | #include "calprinter.h" |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #include "koagendaview.h" | 68 | #include "koagendaview.h" |
69 | //#include "koagendaview.moc" | 69 | //#include "koagendaview.moc" |
70 | 70 | ||
71 | //extern bool globalFlagBlockPainting; | 71 | //extern bool globalFlagBlockPainting; |
72 | extern int globalFlagBlockAgenda; | 72 | extern int globalFlagBlockAgenda; |
73 | extern int globalFlagBlockStartup; | 73 | extern int globalFlagBlockStartup; |
74 | extern int globalFlagBlockAgendaItemPaint; | 74 | extern int globalFlagBlockAgendaItemPaint; |
75 | extern int globalFlagBlockAgendaItemUpdate; | 75 | extern int globalFlagBlockAgendaItemUpdate; |
76 | extern int globalFlagBlockLabel; | 76 | extern int globalFlagBlockLabel; |
77 | using namespace KOrg; | 77 | using namespace KOrg; |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : | 81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : |
82 | QScrollView(parent,name,f) | 82 | QScrollView(parent,name,f) |
83 | { | 83 | { |
84 | mRows = rows; | 84 | mRows = rows; |
85 | 85 | ||
86 | setMinimumHeight( 20 ); | 86 | setMinimumHeight( 20 ); |
87 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 87 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
88 | 88 | ||
89 | enableClipper(true); | 89 | enableClipper(true); |
90 | 90 | ||
91 | setHScrollBarMode(AlwaysOff); | 91 | setHScrollBarMode(AlwaysOff); |
92 | setVScrollBarMode(AlwaysOff); | 92 | setVScrollBarMode(AlwaysOff); |
93 | 93 | ||
94 | resizeContents(50,mRows * mCellHeight); | 94 | resizeContents(50,mRows * mCellHeight); |
95 | 95 | ||
96 | viewport()->setBackgroundMode( PaletteBackground ); | 96 | viewport()->setBackgroundMode( PaletteBackground ); |
97 | } | 97 | } |
98 | 98 | ||
99 | void TimeLabels::setCellHeight(int height) | 99 | void TimeLabels::setCellHeight(int height) |
100 | { | 100 | { |
101 | mCellHeight = height; | 101 | mCellHeight = height; |
102 | } | 102 | } |
103 | 103 | ||
104 | /* | 104 | /* |
105 | Optimization so that only the "dirty" portion of the scroll view | 105 | Optimization so that only the "dirty" portion of the scroll view |
106 | is redrawn. Unfortunately, this is not called by default paintEvent() method. | 106 | is redrawn. Unfortunately, this is not called by default paintEvent() method. |
107 | */ | 107 | */ |
108 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | 108 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) |
109 | { | 109 | { |
110 | 110 | ||
111 | // if ( globalFlagBlockAgenda ) | 111 | // if ( globalFlagBlockAgenda ) |
112 | // return; | 112 | // return; |
113 | // bug: the parameters cx, cy, cw, ch are the areas that need to be | 113 | // bug: the parameters cx, cy, cw, ch are the areas that need to be |
114 | // redrawn, not the area of the widget. unfortunately, this | 114 | // redrawn, not the area of the widget. unfortunately, this |
115 | // code assumes the latter... | 115 | // code assumes the latter... |
116 | 116 | ||
117 | // now, for a workaround... | 117 | // now, for a workaround... |
118 | // these two assignments fix the weird redraw bug | 118 | // these two assignments fix the weird redraw bug |
119 | cx = contentsX() + 2; | 119 | cx = contentsX() + 2; |
120 | cw = contentsWidth() - 2; | 120 | cw = contentsWidth() - 2; |
121 | // end of workaround | 121 | // end of workaround |
122 | 122 | ||
123 | int cell = ((int)(cy/mCellHeight)); | 123 | int cell = ((int)(cy/mCellHeight)); |
124 | int y = cell * mCellHeight; | 124 | int y = cell * mCellHeight; |
125 | QFontMetrics fm = fontMetrics(); | 125 | QFontMetrics fm = fontMetrics(); |
126 | QString hour; | 126 | QString hour; |
127 | QString suffix; | 127 | QString suffix; |
128 | QString fullTime; | ||
129 | int tW = fm.width("24:00i"); | 128 | int tW = fm.width("24:00i"); |
130 | int timeHeight = fm.height(); | 129 | int timeHeight = fm.height(); |
131 | //timeHeight -= (timeHeight/4-2); | 130 | //timeHeight -= (timeHeight/4-2); |
132 | int borderWidth = 0; | 131 | int borderWidth = 0; |
133 | QFont nFont = p->font(); | 132 | QFont nFont = p->font(); |
134 | 133 | ||
135 | if (!KGlobal::locale()->use12Clock()) | 134 | if (!KGlobal::locale()->use12Clock()) |
136 | suffix = "00"; | 135 | suffix = "00"; |
137 | else | 136 | else |
138 | borderWidth = 0; | 137 | borderWidth = 0; |
139 | if ( timeHeight > mCellHeight ) { | 138 | if ( timeHeight > mCellHeight ) { |
140 | timeHeight = mCellHeight-1; | 139 | timeHeight = mCellHeight-1; |
141 | int pointS = nFont.pointSize(); | 140 | int pointS = nFont.pointSize(); |
142 | while ( pointS > 4 ) { | 141 | while ( pointS > 4 ) { |
143 | nFont.setPointSize( pointS ); | 142 | nFont.setPointSize( pointS ); |
144 | fm = QFontMetrics( nFont ); | 143 | fm = QFontMetrics( nFont ); |
145 | if ( fm.height() < mCellHeight ) | 144 | if ( fm.height() < mCellHeight ) |
146 | break; | 145 | break; |
147 | -- pointS; | 146 | -- pointS; |
148 | } | 147 | } |
149 | fm = QFontMetrics( nFont ); | 148 | fm = QFontMetrics( nFont ); |
150 | borderWidth = 4; | 149 | borderWidth = 4; |
151 | timeHeight = fm.height(); | 150 | timeHeight = fm.height(); |
152 | } | 151 | } |
153 | timeHeight -= (timeHeight/4-2); | 152 | timeHeight -= (timeHeight/4-2); |
154 | QFont sFont = nFont; | 153 | QFont sFont = nFont; |
155 | sFont.setPointSize( sFont.pointSize()/2+2 ); | 154 | sFont.setPointSize( sFont.pointSize()/2+2 ); |
156 | QFontMetrics fmS( sFont ); | 155 | QFontMetrics fmS( sFont ); |
157 | int sHei = fmS.height(); | 156 | int sHei = fmS.height(); |
158 | 157 | sHei -= (sHei/4-2); | |
158 | int startW = this->width() - frameWidth(); | ||
159 | while (y < cy + ch) { | 159 | while (y < cy + ch) { |
160 | p->drawLine(cx,y,cx+tW,y); | 160 | p->drawLine(cx,y,cx+tW,y); |
161 | hour.setNum(cell); | 161 | hour.setNum(cell); |
162 | 162 | ||
163 | // handle 24h and am/pm time formats | 163 | // handle 24h and am/pm time formats |
164 | if (KGlobal::locale()->use12Clock()) { | 164 | if (KGlobal::locale()->use12Clock()) { |
165 | if (cell > 11) suffix = "pm"; | 165 | if (cell > 11) suffix = "pm"; |
166 | else | 166 | else |
167 | suffix = "am"; | 167 | suffix = "am"; |
168 | if (cell == 0) hour.setNum(12); | 168 | if (cell == 0) hour.setNum(12); |
169 | if (cell > 12) hour.setNum(cell - 12); | 169 | if (cell > 12) hour.setNum(cell - 12); |
170 | } | 170 | } |
171 | 171 | ||
172 | // create string in format of "XX:XX" or "XXpm/am" | ||
173 | fullTime = hour;// + suffix; | ||
174 | |||
175 | // center and draw the time label | 172 | // center and draw the time label |
176 | int timeWidth = fm.width(fullTime+"i"); | 173 | int timeWidth = fm.width(hour+"i"); |
177 | int tw2 = fm.width(suffix); | 174 | int tw2 = fm.width(suffix); |
178 | int offset = this->width() - timeWidth - tw2; | 175 | int offset = startW - timeWidth - tw2 ; |
179 | p->setFont( nFont ); | 176 | p->setFont( nFont ); |
180 | p->drawText(cx - borderWidth + offset, y+ timeHeight, fullTime); | 177 | p->drawText(cx - borderWidth + offset, y+ timeHeight, hour); |
181 | p->setFont( sFont ); | 178 | p->setFont( sFont ); |
182 | offset += timeWidth; | 179 | offset = startW - tw2-1; |
183 | p->drawText(cx - borderWidth + offset, y+ sHei, suffix); | 180 | p->drawText(cx - borderWidth + offset, y+ sHei, suffix); |
184 | 181 | ||
185 | // increment indices | 182 | // increment indices |
186 | y += mCellHeight; | 183 | y += mCellHeight; |
187 | cell++; | 184 | cell++; |
188 | } | 185 | } |
189 | } | 186 | } |
190 | 187 | ||
191 | /** | 188 | /** |
192 | Calculates the minimum width. | 189 | Calculates the minimum width. |
193 | */ | 190 | */ |
194 | int TimeLabels::minimumWidth() const | 191 | int TimeLabels::minimumWidth() const |
195 | { | 192 | { |
196 | return mMiniWidth; | 193 | return mMiniWidth; |
197 | } | 194 | } |
198 | 195 | ||
199 | /** updates widget's internal state */ | 196 | /** updates widget's internal state */ |
200 | void TimeLabels::updateConfig() | 197 | void TimeLabels::updateConfig() |
201 | { | 198 | { |
202 | // set the font | 199 | // set the font |
203 | // config->setGroup("Fonts"); | 200 | // config->setGroup("Fonts"); |
204 | // QFont font = config->readFontEntry("TimeBar Font"); | 201 | // QFont font = config->readFontEntry("TimeBar Font"); |
205 | setFont(KOPrefs::instance()->mTimeBarFont); | 202 | setFont(KOPrefs::instance()->mTimeBarFont); |
206 | mMiniWidth = fontMetrics().width("88:88") + 2 ; | 203 | QString test = "88:88"; |
204 | if (KGlobal::locale()->use12Clock()) | ||
205 | test += "i"; | ||
206 | mMiniWidth = fontMetrics().width(test) + frameWidth()*2 +1 ; | ||
207 | // update geometry restrictions based on new settings | 207 | // update geometry restrictions based on new settings |
208 | setFixedWidth(minimumWidth()); | 208 | setFixedWidth(minimumWidth()); |
209 | 209 | ||
210 | // update HourSize | 210 | // update HourSize |
211 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 211 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
212 | resizeContents(50,mRows * mCellHeight); | 212 | resizeContents(50,mRows * mCellHeight); |
213 | } | 213 | } |
214 | 214 | ||
215 | /** update time label positions */ | 215 | /** update time label positions */ |
216 | void TimeLabels::positionChanged() | 216 | void TimeLabels::positionChanged() |
217 | { | 217 | { |
218 | int adjustment = mAgenda->contentsY(); | 218 | int adjustment = mAgenda->contentsY(); |
219 | setContentsPos(0, adjustment); | 219 | setContentsPos(0, adjustment); |
220 | } | 220 | } |
221 | 221 | ||
222 | /** */ | 222 | /** */ |
223 | void TimeLabels::setAgenda(KOAgenda* agenda) | 223 | void TimeLabels::setAgenda(KOAgenda* agenda) |
224 | { | 224 | { |
225 | mAgenda = agenda; | 225 | mAgenda = agenda; |
226 | } | 226 | } |
227 | 227 | ||
228 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) | 228 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) |
229 | { | 229 | { |
230 | mMouseDownY = e->pos().y(); | 230 | mMouseDownY = e->pos().y(); |
231 | mOrgCap = topLevelWidget()->caption(); | 231 | mOrgCap = topLevelWidget()->caption(); |
232 | } | 232 | } |
233 | 233 | ||
234 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) | 234 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) |
235 | { | 235 | { |
236 | int diff = mMouseDownY - e->pos().y(); | 236 | int diff = mMouseDownY - e->pos().y(); |
237 | if ( diff < 10 && diff > -10 ) | 237 | if ( diff < 10 && diff > -10 ) |
238 | return; | 238 | return; |
239 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; | 239 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; |
240 | if ( tSize < 4 ) | 240 | if ( tSize < 4 ) |
241 | tSize = 4; | 241 | tSize = 4; |
242 | if ( tSize > 22 ) | 242 | if ( tSize > 22 ) |
243 | tSize = 22; | 243 | tSize = 22; |
244 | tSize = (tSize-2)/2; | 244 | tSize = (tSize-2)/2; |
245 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); | 245 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); |
246 | 246 | ||
247 | } | 247 | } |
248 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) | 248 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) |
249 | { | 249 | { |
250 | topLevelWidget()->setCaption( mOrgCap ); | 250 | topLevelWidget()->setCaption( mOrgCap ); |
251 | int diff = mMouseDownY - e->pos().y(); | 251 | int diff = mMouseDownY - e->pos().y(); |
252 | if ( diff < 10 && diff > -10 ) | 252 | if ( diff < 10 && diff > -10 ) |
253 | return; | 253 | return; |
254 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); | 254 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); |
255 | if ( tSize < 4 ) | 255 | if ( tSize < 4 ) |
256 | tSize = 4; | 256 | tSize = 4; |
257 | if ( tSize > 22 ) | 257 | if ( tSize > 22 ) |
258 | tSize = 22; | 258 | tSize = 22; |
259 | tSize = (tSize/2)*2; | 259 | tSize = (tSize/2)*2; |
260 | if ( tSize == KOPrefs::instance()->mHourSize ) | 260 | if ( tSize == KOPrefs::instance()->mHourSize ) |
261 | return; | 261 | return; |
262 | KOPrefs::instance()->mHourSize = tSize; | 262 | KOPrefs::instance()->mHourSize = tSize; |
263 | emit scaleChanged(); | 263 | emit scaleChanged(); |
264 | } | 264 | } |
265 | 265 | ||
266 | /** This is called in response to repaint() */ | 266 | /** This is called in response to repaint() */ |
267 | void TimeLabels::paintEvent(QPaintEvent*) | 267 | void TimeLabels::paintEvent(QPaintEvent*) |
268 | { | 268 | { |
269 | 269 | ||
270 | // kdDebug() << "paintevent..." << endl; | 270 | // kdDebug() << "paintevent..." << endl; |
271 | // this is another hack! | 271 | // this is another hack! |
272 | // QPainter painter(this); | 272 | // QPainter painter(this); |
273 | //QString c | 273 | //QString c |
274 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); | 274 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); |
275 | } | 275 | } |
276 | 276 | ||
277 | //////////////////////////////////////////////////////////////////////////// | 277 | //////////////////////////////////////////////////////////////////////////// |
278 | 278 | ||
279 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) | 279 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) |
280 | : QFrame(parent,name) | 280 | : QFrame(parent,name) |
281 | { | 281 | { |
282 | mColumns = 1; | 282 | mColumns = 1; |
283 | mTopBox = 0; | 283 | mTopBox = 0; |
284 | mLocation = loc; | 284 | mLocation = loc; |
285 | mTopLayout = 0; | 285 | mTopLayout = 0; |
286 | mPaintWidget = 0; | 286 | mPaintWidget = 0; |
287 | mXOffset = 0; | 287 | mXOffset = 0; |
288 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); | 288 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); |
289 | else mPixmap = SmallIcon("1downarrow"); | 289 | else mPixmap = SmallIcon("1downarrow"); |
290 | mEnabled.resize(mColumns); | 290 | mEnabled.resize(mColumns); |
291 | mEnabled.fill( false ); | 291 | mEnabled.fill( false ); |
292 | setMinimumHeight(mPixmap.height()); | 292 | setMinimumHeight(mPixmap.height()); |
293 | } | 293 | } |
294 | 294 | ||
295 | EventIndicator::~EventIndicator() | 295 | EventIndicator::~EventIndicator() |
296 | { | 296 | { |
297 | } | 297 | } |
298 | 298 | ||
299 | void EventIndicator::drawContents(QPainter *p) | 299 | void EventIndicator::drawContents(QPainter *p) |
300 | { | 300 | { |
301 | 301 | ||
302 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; | 302 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; |
303 | KDGanttSplitterHandle* han = 0; | 303 | KDGanttSplitterHandle* han = 0; |
304 | if ( mPaintWidget ) | 304 | if ( mPaintWidget ) |
305 | han = mPaintWidget->firstHandle(); | 305 | han = mPaintWidget->firstHandle(); |
306 | if ( ! han ) { | 306 | if ( ! han ) { |
307 | int i; | 307 | int i; |
308 | for(i=0;i<mColumns;++i) { | 308 | for(i=0;i<mColumns;++i) { |
309 | if (mEnabled[i]) { | 309 | if (mEnabled[i]) { |
310 | int cellWidth = contentsRect().right()/mColumns; | 310 | int cellWidth = contentsRect().right()/mColumns; |
311 | int xOffset = KOGlobals::self()->reverseLayout() ? | 311 | int xOffset = KOGlobals::self()->reverseLayout() ? |
312 | (mColumns - 1 - i)*cellWidth + (cellWidth -mPixmap.width())/2 : | 312 | (mColumns - 1 - i)*cellWidth + (cellWidth -mPixmap.width())/2 : |
313 | i*cellWidth + (cellWidth -mPixmap.width()) /2; | 313 | i*cellWidth + (cellWidth -mPixmap.width()) /2; |
314 | p->drawPixmap(QPoint(1+xOffset,0),mPixmap); | 314 | p->drawPixmap(QPoint(1+xOffset,0),mPixmap); |
315 | } | 315 | } |
316 | } | 316 | } |
317 | } else { | 317 | } else { |
318 | han->repaint(); | 318 | han->repaint(); |
319 | //mPaintWidget->setBackgroundColor( red ); | 319 | //mPaintWidget->setBackgroundColor( red ); |
320 | 320 | ||
321 | QPainter pa( han ); | 321 | QPainter pa( han ); |
322 | int i; | 322 | int i; |
323 | bool setColor = false; | 323 | bool setColor = false; |
324 | for(i=0;i<mColumns;++i) { | 324 | for(i=0;i<mColumns;++i) { |
325 | if (mEnabled[i]) { | 325 | if (mEnabled[i]) { |
326 | setColor = true; | 326 | setColor = true; |
327 | 327 | ||
328 | int cellWidth = contentsRect().right()/mColumns; | 328 | int cellWidth = contentsRect().right()/mColumns; |
329 | int xOffset = KOGlobals::self()->reverseLayout() ? | 329 | int xOffset = KOGlobals::self()->reverseLayout() ? |
330 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : | 330 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : |
331 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; | 331 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; |
332 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); | 332 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); |
333 | //qDebug("222draw pix %d ",xOffset ); | 333 | //qDebug("222draw pix %d ",xOffset ); |
334 | 334 | ||
335 | } | 335 | } |
336 | 336 | ||
337 | } | 337 | } |
338 | pa.end(); | 338 | pa.end(); |
339 | 339 | ||
340 | } | 340 | } |
341 | } | 341 | } |
342 | 342 | ||
343 | void EventIndicator::setXOffset( int x ) | 343 | void EventIndicator::setXOffset( int x ) |
344 | { | 344 | { |
345 | mXOffset = x; | 345 | mXOffset = x; |
346 | } | 346 | } |
347 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) | 347 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) |
348 | { | 348 | { |
349 | mPaintWidget = w; | 349 | mPaintWidget = w; |
350 | setMaximumHeight(0); | 350 | setMaximumHeight(0); |
351 | setMinimumHeight(0); | 351 | setMinimumHeight(0); |
352 | } | 352 | } |
353 | void EventIndicator::changeColumns(int columns) | 353 | void EventIndicator::changeColumns(int columns) |
354 | { | 354 | { |
355 | mColumns = columns; | 355 | mColumns = columns; |
356 | mEnabled.resize(mColumns); | 356 | mEnabled.resize(mColumns); |
357 | 357 | ||
358 | update(); | 358 | update(); |
359 | } | 359 | } |
360 | 360 | ||
361 | void EventIndicator::enableColumn(int column, bool enable) | 361 | void EventIndicator::enableColumn(int column, bool enable) |
362 | { | 362 | { |
363 | mEnabled[column] = enable; | 363 | mEnabled[column] = enable; |
364 | } | 364 | } |
365 | 365 | ||
366 | 366 | ||
367 | //////////////////////////////////////////////////////////////////////////// | 367 | //////////////////////////////////////////////////////////////////////////// |
368 | //////////////////////////////////////////////////////////////////////////// | 368 | //////////////////////////////////////////////////////////////////////////// |
369 | //////////////////////////////////////////////////////////////////////////// | 369 | //////////////////////////////////////////////////////////////////////////// |
370 | 370 | ||
371 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | 371 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : |
372 | KOEventView (cal,parent,name) | 372 | KOEventView (cal,parent,name) |
373 | { | 373 | { |
374 | mBlockUpdating = true; | 374 | mBlockUpdating = true; |
375 | mStartHour = 8; | 375 | mStartHour = 8; |
376 | mSelectedDates.append(QDate::currentDate()); | 376 | mSelectedDates.append(QDate::currentDate()); |
377 | 377 | ||
378 | mLayoutDayLabels = 0; | 378 | mLayoutDayLabels = 0; |
379 | mDayLabelsFrame = 0; | 379 | mDayLabelsFrame = 0; |
380 | mDayLabels = 0; | 380 | mDayLabels = 0; |
381 | bool isRTL = KOGlobals::self()->reverseLayout(); | 381 | bool isRTL = KOGlobals::self()->reverseLayout(); |
382 | QPixmap expandPix; | 382 | QPixmap expandPix; |
383 | if ( KOPrefs::instance()->mVerticalScreen ) { | 383 | if ( KOPrefs::instance()->mVerticalScreen ) { |
384 | expandPix = SmallIcon( "1updownarrow" ); | 384 | expandPix = SmallIcon( "1updownarrow" ); |
385 | } else { | 385 | } else { |
386 | expandPix = SmallIcon("1leftrightarrow" ); | 386 | expandPix = SmallIcon("1leftrightarrow" ); |
387 | } | 387 | } |
388 | 388 | ||
389 | QBoxLayout *topLayout = new QVBoxLayout(this); | 389 | QBoxLayout *topLayout = new QVBoxLayout(this); |
390 | 390 | ||
391 | // Create day name labels for agenda columns | 391 | // Create day name labels for agenda columns |
392 | // Create agenda splitter | 392 | // Create agenda splitter |
393 | 393 | ||
394 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 394 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
395 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 395 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
396 | topLayout->addWidget( mSplitterAgenda ); | 396 | topLayout->addWidget( mSplitterAgenda ); |
397 | mAllDayFrame = new QHBox(mSplitterAgenda); | 397 | mAllDayFrame = new QHBox(mSplitterAgenda); |
398 | mAllDayFrame->setFocusPolicy(NoFocus); | 398 | mAllDayFrame->setFocusPolicy(NoFocus); |
399 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 399 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
400 | agendaFrame->setFocusPolicy(NoFocus); | 400 | agendaFrame->setFocusPolicy(NoFocus); |
401 | 401 | ||
402 | // Create all-day agenda widget | 402 | // Create all-day agenda widget |
403 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); | 403 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); |
404 | 404 | ||
405 | mExpandButton = new QPushButton(mDummyAllDayLeft); | 405 | mExpandButton = new QPushButton(mDummyAllDayLeft); |
406 | mExpandButton->setPixmap( expandPix ); | 406 | mExpandButton->setPixmap( expandPix ); |
407 | int widebut = mExpandButton->sizeHint().width()+4; | 407 | int widebut = mExpandButton->sizeHint().width()+4; |
408 | int heibut = mExpandButton->sizeHint().height()+4; | 408 | int heibut = mExpandButton->sizeHint().height()+4; |
409 | if ( heibut > widebut ) | 409 | if ( heibut > widebut ) |
410 | widebut = heibut ; | 410 | widebut = heibut ; |
411 | if ( QApplication::desktop()->width() < 480 ) | 411 | if ( QApplication::desktop()->width() < 480 ) |
412 | widebut = widebut*3/2; | 412 | widebut = widebut*3/2; |
413 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, | 413 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, |
414 | // QSizePolicy::Fixed ) ); | 414 | // QSizePolicy::Fixed ) ); |
415 | mExpandButton->setFixedSize( widebut, widebut); | 415 | mExpandButton->setFixedSize( widebut, widebut); |
416 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); | 416 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); |
417 | mExpandButton->setFocusPolicy(NoFocus); | 417 | mExpandButton->setFocusPolicy(NoFocus); |
418 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); | 418 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); |
419 | mAllDayAgenda->setFocusPolicy(NoFocus); | 419 | mAllDayAgenda->setFocusPolicy(NoFocus); |
420 | QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); | 420 | QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); |
421 | 421 | ||
422 | // Create event context menu for all day agenda | 422 | // Create event context menu for all day agenda |
423 | mAllDayAgendaPopup = eventPopup(); | 423 | mAllDayAgendaPopup = eventPopup(); |
424 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 424 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
425 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 425 | mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
426 | 426 | ||
427 | // Create agenda frame | 427 | // Create agenda frame |
428 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); | 428 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); |
429 | // QHBox *agendaFrame = new QHBox(splitterAgenda); | 429 | // QHBox *agendaFrame = new QHBox(splitterAgenda); |
430 | 430 | ||
431 | // create event indicator bars | 431 | // create event indicator bars |
432 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); | 432 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); |
433 | #ifndef DESKTOP_VERSION | 433 | #ifndef DESKTOP_VERSION |
434 | // FIX | 434 | // FIX |
435 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); | 435 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); |
436 | #endif | 436 | #endif |
437 | mDayLabelsFrame = new QHBox(agendaFrame); | 437 | mDayLabelsFrame = new QHBox(agendaFrame); |
438 | //topLayout->addWidget(mDayLabelsFrame); | 438 | //topLayout->addWidget(mDayLabelsFrame); |
439 | mDayLabels = new QFrame (mDayLabelsFrame); | 439 | mDayLabels = new QFrame (mDayLabelsFrame); |
440 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); | 440 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); |
441 | agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); | 441 | agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); |
442 | agendaLayout->addWidget(mEventIndicatorTop,1,1); | 442 | agendaLayout->addWidget(mEventIndicatorTop,1,1); |
443 | 443 | ||
444 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, | 444 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, |
445 | agendaFrame); | 445 | agendaFrame); |
446 | agendaLayout->addWidget(mEventIndicatorBottom,3,1); | 446 | agendaLayout->addWidget(mEventIndicatorBottom,3,1); |
447 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); | 447 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); |
448 | agendaLayout->addWidget(dummyAgendaRight,1,2); | 448 | agendaLayout->addWidget(dummyAgendaRight,1,2); |
449 | 449 | ||
450 | // Create time labels | 450 | // Create time labels |
451 | mTimeLabels = new TimeLabels(24,agendaFrame); | 451 | mTimeLabels = new TimeLabels(24,agendaFrame); |
452 | agendaLayout->addWidget(mTimeLabels,2,0); | 452 | agendaLayout->addWidget(mTimeLabels,2,0); |
453 | connect(mTimeLabels,SIGNAL( scaleChanged()), | 453 | connect(mTimeLabels,SIGNAL( scaleChanged()), |
454 | this,SLOT(updateConfig())); | 454 | this,SLOT(updateConfig())); |
455 | 455 | ||
456 | // Create agenda | 456 | // Create agenda |
457 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); | 457 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); |
458 | agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); | 458 | agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); |
459 | agendaLayout->setColStretch(1,1); | 459 | agendaLayout->setColStretch(1,1); |
460 | mAgenda->setFocusPolicy(NoFocus); | 460 | mAgenda->setFocusPolicy(NoFocus); |
461 | // Create event context menu for agenda | 461 | // Create event context menu for agenda |
462 | mAgendaPopup = eventPopup(); | 462 | mAgendaPopup = eventPopup(); |
463 | 463 | ||
464 | mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), | 464 | mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), |
465 | i18n("Toggle Alarm"),mAgenda, | 465 | i18n("Toggle Alarm"),mAgenda, |
466 | SLOT(popupAlarm()),true); | 466 | SLOT(popupAlarm()),true); |
467 | 467 | ||
468 | 468 | ||
469 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 469 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
470 | mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 470 | mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
471 | 471 | ||
472 | // make connections between dependent widgets | 472 | // make connections between dependent widgets |
473 | mTimeLabels->setAgenda(mAgenda); | 473 | mTimeLabels->setAgenda(mAgenda); |
474 | 474 | ||
475 | // Update widgets to reflect user preferences | 475 | // Update widgets to reflect user preferences |
476 | // updateConfig(); | 476 | // updateConfig(); |
477 | 477 | ||
478 | // createDayLabels(); | 478 | // createDayLabels(); |
479 | 479 | ||
480 | // these blank widgets make the All Day Event box line up with the agenda | 480 | // these blank widgets make the All Day Event box line up with the agenda |
481 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 481 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
482 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 482 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
483 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 483 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
484 | 484 | ||
485 | // Scrolling | 485 | // Scrolling |
486 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), | 486 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), |
487 | mTimeLabels, SLOT(positionChanged())); | 487 | mTimeLabels, SLOT(positionChanged())); |
488 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), | 488 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), |
489 | SLOT(setContentsPos(int))); | 489 | SLOT(setContentsPos(int))); |
490 | 490 | ||
491 | connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); | 491 | connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); |
492 | connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); | 492 | connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); |
493 | 493 | ||
494 | // Create/Show/Edit/Delete Event | 494 | // Create/Show/Edit/Delete Event |
495 | connect(mAgenda,SIGNAL(newEventSignal(int,int)), | 495 | connect(mAgenda,SIGNAL(newEventSignal(int,int)), |
496 | SLOT(newEvent(int,int))); | 496 | SLOT(newEvent(int,int))); |
497 | connect(mAgenda,SIGNAL(newTodoSignal(int,int)), | 497 | connect(mAgenda,SIGNAL(newTodoSignal(int,int)), |
498 | SLOT(newTodo(int,int))); | 498 | SLOT(newTodo(int,int))); |
499 | connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 499 | connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
500 | SLOT(newEvent(int,int,int,int))); | 500 | SLOT(newEvent(int,int,int,int))); |
501 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), | 501 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), |
502 | SLOT(newEventAllDay(int,int))); | 502 | SLOT(newEventAllDay(int,int))); |
503 | connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), | 503 | connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), |
504 | SLOT(newTodoAllDay(int,int))); | 504 | SLOT(newTodoAllDay(int,int))); |
505 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 505 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
506 | SLOT(newEventAllDay(int,int))); | 506 | SLOT(newEventAllDay(int,int))); |
507 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 507 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
508 | SLOT(newTimeSpanSelected(int,int,int,int))); | 508 | SLOT(newTimeSpanSelected(int,int,int,int))); |
509 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 509 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
510 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); | 510 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); |
511 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 511 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
512 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 512 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
513 | 513 | ||
514 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 514 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
515 | SIGNAL(editIncidenceSignal(Incidence *))); | 515 | SIGNAL(editIncidenceSignal(Incidence *))); |
516 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 516 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
517 | SIGNAL(editIncidenceSignal(Incidence *))); | 517 | SIGNAL(editIncidenceSignal(Incidence *))); |
518 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 518 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
519 | SIGNAL(showIncidenceSignal(Incidence *))); | 519 | SIGNAL(showIncidenceSignal(Incidence *))); |
520 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 520 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
521 | SIGNAL(showIncidenceSignal(Incidence *))); | 521 | SIGNAL(showIncidenceSignal(Incidence *))); |
522 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 522 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
523 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 523 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
524 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 524 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
525 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 525 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
526 | 526 | ||
527 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 527 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
528 | SLOT(updateEventDates(KOAgendaItem *, int ))); | 528 | SLOT(updateEventDates(KOAgendaItem *, int ))); |
529 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 529 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
530 | SLOT(updateEventDates(KOAgendaItem *, int))); | 530 | SLOT(updateEventDates(KOAgendaItem *, int))); |
531 | 531 | ||
532 | // event indicator update | 532 | // event indicator update |
533 | connect(mAgenda,SIGNAL(lowerYChanged(int)), | 533 | connect(mAgenda,SIGNAL(lowerYChanged(int)), |
534 | SLOT(updateEventIndicatorTop(int))); | 534 | SLOT(updateEventIndicatorTop(int))); |
535 | connect(mAgenda,SIGNAL(upperYChanged(int)), | 535 | connect(mAgenda,SIGNAL(upperYChanged(int)), |
536 | SLOT(updateEventIndicatorBottom(int))); | 536 | SLOT(updateEventIndicatorBottom(int))); |
537 | // drag signals | 537 | // drag signals |
538 | /* | 538 | /* |
539 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), | 539 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), |
540 | SLOT(startDrag(Event *))); | 540 | SLOT(startDrag(Event *))); |
541 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), | 541 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), |
542 | SLOT(startDrag(Event *))); | 542 | SLOT(startDrag(Event *))); |
543 | */ | 543 | */ |
544 | // synchronize selections | 544 | // synchronize selections |
545 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 545 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
546 | mAllDayAgenda, SLOT( deselectItem() ) ); | 546 | mAllDayAgenda, SLOT( deselectItem() ) ); |
547 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 547 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
548 | mAgenda, SLOT( deselectItem() ) ); | 548 | mAgenda, SLOT( deselectItem() ) ); |
549 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 549 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
550 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 550 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
551 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 551 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
552 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 552 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
553 | connect( mAgenda, SIGNAL( resizedSignal() ), | 553 | connect( mAgenda, SIGNAL( resizedSignal() ), |
554 | SLOT( updateConfig( ) ) ); | 554 | SLOT( updateConfig( ) ) ); |
555 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), | 555 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), |
556 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); | 556 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); |
557 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), | 557 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), |
558 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); | 558 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); |
559 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 559 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
560 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 560 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
561 | 561 | ||
562 | 562 | ||
563 | } | 563 | } |
564 | 564 | ||
565 | void KOAgendaView::toggleAllDay() | 565 | void KOAgendaView::toggleAllDay() |
566 | { | 566 | { |
567 | if ( mSplitterAgenda->firstHandle() ) | 567 | if ( mSplitterAgenda->firstHandle() ) |
568 | mSplitterAgenda->firstHandle()->toggle(); | 568 | mSplitterAgenda->firstHandle()->toggle(); |
569 | } | 569 | } |
570 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) | 570 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) |
571 | { | 571 | { |
572 | calendar()->addIncidence( inc ); | 572 | calendar()->addIncidence( inc ); |
573 | 573 | ||
574 | if ( incOld ) { | 574 | if ( incOld ) { |
575 | if ( incOld->type() == "Todo" ) | 575 | if ( incOld->type() == "Todo" ) |
576 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); | 576 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); |
577 | else | 577 | else |
578 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); | 578 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); |
579 | } | 579 | } |
580 | 580 | ||
581 | } | 581 | } |
582 | 582 | ||
583 | KOAgendaView::~KOAgendaView() | 583 | KOAgendaView::~KOAgendaView() |
584 | { | 584 | { |
585 | delete mAgendaPopup; | 585 | delete mAgendaPopup; |
586 | delete mAllDayAgendaPopup; | 586 | delete mAllDayAgendaPopup; |
587 | delete KOAgendaItem::paintPix(); | 587 | delete KOAgendaItem::paintPix(); |
588 | delete KOAgendaItem::paintPixSel(); | 588 | delete KOAgendaItem::paintPixSel(); |
589 | } | 589 | } |
590 | void KOAgendaView::resizeEvent( QResizeEvent* e ) | 590 | void KOAgendaView::resizeEvent( QResizeEvent* e ) |
591 | { | 591 | { |
592 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); | 592 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); |
593 | bool uc = false; | 593 | bool uc = false; |
594 | int ow = e->oldSize().width(); | 594 | int ow = e->oldSize().width(); |
595 | int oh = e->oldSize().height(); | 595 | int oh = e->oldSize().height(); |
596 | int w = e->size().width(); | 596 | int w = e->size().width(); |
597 | int h = e->size().height(); | 597 | int h = e->size().height(); |
598 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { | 598 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { |
599 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) | 599 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) |
600 | uc = true; | 600 | uc = true; |
601 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); | 601 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); |
602 | } | 602 | } |
603 | mUpcomingWidth = e->size().width() ; | 603 | mUpcomingWidth = e->size().width() ; |
604 | if ( mBlockUpdating || uc ) { | 604 | if ( mBlockUpdating || uc ) { |
605 | mBlockUpdating = false; | 605 | mBlockUpdating = false; |
606 | //mAgenda->setMinimumSize(800 , 600 ); | 606 | //mAgenda->setMinimumSize(800 , 600 ); |
607 | //qDebug("mAgenda->resize+++++++++++++++ "); | 607 | //qDebug("mAgenda->resize+++++++++++++++ "); |
608 | updateConfig(); | 608 | updateConfig(); |
609 | //qDebug("KOAgendaView::Updating now possible "); | 609 | //qDebug("KOAgendaView::Updating now possible "); |
610 | } else | 610 | } else |
611 | createDayLabels(); | 611 | createDayLabels(); |
612 | //qDebug("resizeEvent end "); | 612 | //qDebug("resizeEvent end "); |
613 | 613 | ||
614 | } | 614 | } |
615 | void KOAgendaView::slotDaylabelClicked( int num ) | 615 | void KOAgendaView::slotDaylabelClicked( int num ) |
616 | { | 616 | { |
617 | 617 | ||
618 | QDate firstDate = mSelectedDates.first(); | 618 | QDate firstDate = mSelectedDates.first(); |
619 | if ( num == -1 ) | 619 | if ( num == -1 ) |
620 | emit showDateView( 6, firstDate ); | 620 | emit showDateView( 6, firstDate ); |
621 | else if (num >= 0 ) { | 621 | else if (num >= 0 ) { |
622 | if ( mSelectedDates.count() == 1) | 622 | if ( mSelectedDates.count() == 1) |
623 | emit showDateView( 9, firstDate.addDays( num ) ); | 623 | emit showDateView( 9, firstDate.addDays( num ) ); |
624 | else | 624 | else |
625 | emit showDateView( 3, firstDate.addDays( num ) ); | 625 | emit showDateView( 3, firstDate.addDays( num ) ); |
626 | } | 626 | } |
627 | else | 627 | else |
628 | showDateView( 10, firstDate.addDays(1) ); | 628 | showDateView( 10, firstDate.addDays(1) ); |
629 | } | 629 | } |
630 | 630 | ||
631 | KOAgendaButton* KOAgendaView::getNewDaylabel() | 631 | KOAgendaButton* KOAgendaView::getNewDaylabel() |
632 | { | 632 | { |
633 | 633 | ||
634 | KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); | 634 | KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); |
635 | connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); | 635 | connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); |
636 | mDayLabelsList.append( dayLabel ); | 636 | mDayLabelsList.append( dayLabel ); |
637 | mLayoutDayLabels->addWidget(dayLabel); | 637 | mLayoutDayLabels->addWidget(dayLabel); |
638 | return dayLabel ; | 638 | return dayLabel ; |
639 | } | 639 | } |
640 | 640 | ||
641 | void KOAgendaView::createDayLabels() | 641 | void KOAgendaView::createDayLabels() |
642 | { | 642 | { |
643 | 643 | ||
644 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { | 644 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { |
645 | // qDebug(" KOAgendaView::createDayLabels() blocked "); | 645 | // qDebug(" KOAgendaView::createDayLabels() blocked "); |
646 | return; | 646 | return; |
647 | 647 | ||
648 | } | 648 | } |
649 | int newHight; | 649 | int newHight; |
650 | 650 | ||
651 | // ### Before deleting and recreating we could check if mSelectedDates changed... | 651 | // ### Before deleting and recreating we could check if mSelectedDates changed... |
652 | // It would remove some flickering and gain speed (since this is called by | 652 | // It would remove some flickering and gain speed (since this is called by |
653 | // each updateView() call) | 653 | // each updateView() call) |
654 | 654 | ||
655 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2; | 655 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2; |
656 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); | 656 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); |
657 | if ( maxWid < 0 ) | 657 | if ( maxWid < 0 ) |
658 | maxWid = 20; | 658 | maxWid = 20; |
659 | 659 | ||
660 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | 660 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; |
661 | QFontMetrics fm ( dlf ); | 661 | QFontMetrics fm ( dlf ); |
662 | int selCount = mSelectedDates.count(); | 662 | int selCount = mSelectedDates.count(); |
663 | QString dayTest = "Mon 20"; | 663 | QString dayTest = "Mon 20"; |
664 | //QString dayTest = "Mon 20"; | 664 | //QString dayTest = "Mon 20"; |
665 | int wid = fm.width( dayTest ); | 665 | int wid = fm.width( dayTest ); |
666 | //maxWid -= ( selCount * 3 ); //working for QLabels | 666 | //maxWid -= ( selCount * 3 ); //working for QLabels |
667 | maxWid -= ( selCount * 3 ); //working for QPushButton | 667 | maxWid -= ( selCount * 3 ); //working for QPushButton |
668 | if ( maxWid < 0 ) | 668 | if ( maxWid < 0 ) |
669 | maxWid = 20; | 669 | maxWid = 20; |
670 | int needWid = wid * selCount; | 670 | int needWid = wid * selCount; |
671 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); | 671 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); |
672 | //if ( needWid > maxWid ) | 672 | //if ( needWid > maxWid ) |
673 | // qDebug("DAYLABELS TOOOOOOO BIG "); | 673 | // qDebug("DAYLABELS TOOOOOOO BIG "); |
674 | while ( needWid > maxWid ) { | 674 | while ( needWid > maxWid ) { |
675 | dayTest = dayTest.left( dayTest.length() - 1 ); | 675 | dayTest = dayTest.left( dayTest.length() - 1 ); |
676 | wid = fm.width( dayTest ); | 676 | wid = fm.width( dayTest ); |
677 | needWid = wid * selCount; | 677 | needWid = wid * selCount; |
678 | } | 678 | } |
679 | int maxLen = dayTest.length(); | 679 | int maxLen = dayTest.length(); |
680 | int fontPoint = dlf.pointSize(); | 680 | int fontPoint = dlf.pointSize(); |
681 | if ( maxLen < 2 ) { | 681 | if ( maxLen < 2 ) { |
682 | int fontPoint = dlf.pointSize(); | 682 | int fontPoint = dlf.pointSize(); |
683 | while ( fontPoint > 4 ) { | 683 | while ( fontPoint > 4 ) { |
684 | --fontPoint; | 684 | --fontPoint; |
685 | dlf.setPointSize( fontPoint ); | 685 | dlf.setPointSize( fontPoint ); |
686 | QFontMetrics f( dlf ); | 686 | QFontMetrics f( dlf ); |
687 | wid = f.width( "30" ); | 687 | wid = f.width( "30" ); |
688 | needWid = wid * selCount; | 688 | needWid = wid * selCount; |
689 | if ( needWid < maxWid ) | 689 | if ( needWid < maxWid ) |
690 | break; | 690 | break; |
691 | } | 691 | } |
692 | maxLen = 2; | 692 | maxLen = 2; |
693 | } | 693 | } |
694 | //qDebug("Max len %d ", dayTest.length() ); | 694 | //qDebug("Max len %d ", dayTest.length() ); |
695 | 695 | ||
696 | QFontMetrics tempF( dlf ); | 696 | QFontMetrics tempF( dlf ); |
697 | newHight = tempF.height(); | 697 | newHight = tempF.height(); |
698 | mDayLabels->setFont( dlf ); | 698 | mDayLabels->setFont( dlf ); |
699 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; | 699 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; |
700 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); | 700 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); |
701 | //mLayoutDayLabels->addSpacing( 2 ); | 701 | //mLayoutDayLabels->addSpacing( 2 ); |
702 | // QFont lFont = dlf; | 702 | // QFont lFont = dlf; |
703 | bool appendLabels = false; | 703 | bool appendLabels = false; |
704 | KOAgendaButton *dayLabel; | 704 | KOAgendaButton *dayLabel; |
705 | dayLabel = mDayLabelsList.first(); | 705 | dayLabel = mDayLabelsList.first(); |
706 | if ( !dayLabel ) { | 706 | if ( !dayLabel ) { |
707 | appendLabels = true; | 707 | appendLabels = true; |
708 | dayLabel = getNewDaylabel(); | 708 | dayLabel = getNewDaylabel(); |
709 | } | 709 | } |
710 | dayLabel->setFixedWidth( mTimeLabels->width()+2 ); | 710 | dayLabel->setFixedWidth( mTimeLabels->width()+2 ); |
711 | dayLabel->setFont( dlf ); | 711 | dayLabel->setFont( dlf ); |
712 | dayLabel->setNum( -1 ); | 712 | dayLabel->setNum( -1 ); |
713 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 713 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
714 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); | 714 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); |
715 | dayLabel->show(); | 715 | dayLabel->show(); |
716 | DateList::ConstIterator dit; | 716 | DateList::ConstIterator dit; |
717 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); | 717 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); |
718 | int counter = -1; | 718 | int counter = -1; |
719 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 719 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
720 | ++counter; | 720 | ++counter; |
721 | QDate date = *dit; | 721 | QDate date = *dit; |
722 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); | 722 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); |
723 | if ( ! appendLabels ) { | 723 | if ( ! appendLabels ) { |
724 | dayLabel = mDayLabelsList.next(); | 724 | dayLabel = mDayLabelsList.next(); |
725 | if ( !dayLabel ) | 725 | if ( !dayLabel ) |
726 | appendLabels = true; | 726 | appendLabels = true; |
727 | } | 727 | } |
728 | if ( appendLabels ) { | 728 | if ( appendLabels ) { |
729 | dayLabel = getNewDaylabel(); | 729 | dayLabel = getNewDaylabel(); |
730 | } | 730 | } |
731 | dayLabel->setMinimumWidth( 1 ); | 731 | dayLabel->setMinimumWidth( 1 ); |
732 | dayLabel->setMaximumWidth( 10240 ); | 732 | dayLabel->setMaximumWidth( 10240 ); |
733 | dayLabel->setFont( dlf ); | 733 | dayLabel->setFont( dlf ); |
734 | dayLabel->show(); | 734 | dayLabel->show(); |
735 | dayLabel->setNum( counter ); | 735 | dayLabel->setNum( counter ); |
736 | QString str; | 736 | QString str; |
737 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); | 737 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); |
738 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); | 738 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); |
739 | switch ( maxLen ) { | 739 | switch ( maxLen ) { |
740 | case 2: | 740 | case 2: |
741 | str = QString::number( date.day() ); | 741 | str = QString::number( date.day() ); |
742 | break; | 742 | break; |
743 | 743 | ||
744 | case 3: | 744 | case 3: |
745 | str = dayName.left( 1 ) +QString::number( date.day()); | 745 | str = dayName.left( 1 ) +QString::number( date.day()); |
746 | 746 | ||
747 | break; | 747 | break; |
748 | case 4: | 748 | case 4: |
749 | str = dayName.left( 1 ) + " " +QString::number( date.day()); | 749 | str = dayName.left( 1 ) + " " +QString::number( date.day()); |
750 | 750 | ||
751 | break; | 751 | break; |
752 | case 5: | 752 | case 5: |
753 | str = dayName.left( 2 ) + " " +QString::number( date.day()); | 753 | str = dayName.left( 2 ) + " " +QString::number( date.day()); |
754 | 754 | ||
755 | break; | 755 | break; |
756 | case 6: | 756 | case 6: |
757 | str = dayName.left( 3 ) + " " +QString::number( date.day()); | 757 | str = dayName.left( 3 ) + " " +QString::number( date.day()); |
758 | break; | 758 | break; |
759 | 759 | ||
760 | default: | 760 | default: |
761 | break; | 761 | break; |
762 | } | 762 | } |
763 | if ( oneday ) { | 763 | if ( oneday ) { |
764 | QString addString; | 764 | QString addString; |
765 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) | 765 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) |
766 | addString = i18n("Today"); | 766 | addString = i18n("Today"); |
767 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | 767 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) |
768 | addString = i18n("Tomorrow"); | 768 | addString = i18n("Tomorrow"); |
769 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | 769 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) |
770 | addString = i18n("Yesterday"); | 770 | addString = i18n("Yesterday"); |
771 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | 771 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) |
772 | addString = i18n("Day before yesterday"); | 772 | addString = i18n("Day before yesterday"); |
773 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | 773 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) |
774 | addString = i18n("Day after tomorrow"); | 774 | addString = i18n("Day after tomorrow"); |
775 | if ( !addString.isEmpty() ) { | 775 | if ( !addString.isEmpty() ) { |
776 | str = addString+", " + str; | 776 | str = addString+", " + str; |
777 | } else { | 777 | } else { |
778 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); | 778 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); |
779 | } | 779 | } |
780 | } | 780 | } |
781 | dayLabel->setText(str); | 781 | dayLabel->setText(str); |
782 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 782 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
783 | if (date == QDate::currentDate()) { | 783 | if (date == QDate::currentDate()) { |
784 | QFont bFont = dlf; | 784 | QFont bFont = dlf; |
785 | bFont.setBold( true ); | 785 | bFont.setBold( true ); |
786 | dayLabel->setFont(bFont); | 786 | dayLabel->setFont(bFont); |
787 | } | 787 | } |
788 | //dayLayout->addWidget(dayLabel); | 788 | //dayLayout->addWidget(dayLabel); |
789 | 789 | ||
790 | #ifndef KORG_NOPLUGINS | 790 | #ifndef KORG_NOPLUGINS |
791 | CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); | 791 | CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); |
792 | CalendarDecoration *it; | 792 | CalendarDecoration *it; |
793 | for(it = cds.first(); it; it = cds.next()) { | 793 | for(it = cds.first(); it; it = cds.next()) { |
794 | QString text = it->shortText( date ); | 794 | QString text = it->shortText( date ); |
795 | if ( !text.isEmpty() ) { | 795 | if ( !text.isEmpty() ) { |
796 | QLabel *label = new QLabel(text,mDayLabels); | 796 | QLabel *label = new QLabel(text,mDayLabels); |
797 | label->setAlignment(AlignCenter); | 797 | label->setAlignment(AlignCenter); |
798 | dayLayout->addWidget(label); | 798 | dayLayout->addWidget(label); |
799 | } | 799 | } |
800 | } | 800 | } |
801 | 801 | ||
802 | for(it = cds.first(); it; it = cds.next()) { | 802 | for(it = cds.first(); it; it = cds.next()) { |
803 | QWidget *wid = it->smallWidget(mDayLabels,date); | 803 | QWidget *wid = it->smallWidget(mDayLabels,date); |
804 | if ( wid ) { | 804 | if ( wid ) { |
805 | // wid->setHeight(20); | 805 | // wid->setHeight(20); |
806 | dayLayout->addWidget(wid); | 806 | dayLayout->addWidget(wid); |
807 | } | 807 | } |
808 | } | 808 | } |
809 | #endif | 809 | #endif |
810 | } | 810 | } |
811 | if ( ! appendLabels ) { | 811 | if ( ! appendLabels ) { |
812 | dayLabel = mDayLabelsList.next(); | 812 | dayLabel = mDayLabelsList.next(); |
813 | if ( !dayLabel ) | 813 | if ( !dayLabel ) |
814 | appendLabels = true; | 814 | appendLabels = true; |
815 | } | 815 | } |
816 | if ( appendLabels ) { | 816 | if ( appendLabels ) { |
817 | dayLabel = getNewDaylabel(); | 817 | dayLabel = getNewDaylabel(); |
818 | } | 818 | } |
819 | //dayLabel->hide();//test only | 819 | //dayLabel->hide();//test only |
820 | 820 | ||
821 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; | 821 | int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; |
822 | if ( offset < 0 ) offset = 0; | 822 | if ( offset < 0 ) offset = 0; |
823 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); | 823 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); |
824 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); | 824 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); |
825 | dayLabel->setFont( dlf ); | 825 | dayLabel->setFont( dlf ); |
826 | dayLabel->show(); | 826 | dayLabel->show(); |
827 | dayLabel->setNum( -2 ); | 827 | dayLabel->setNum( -2 ); |
828 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); | 828 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); |
829 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); | 829 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); |
830 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); | 830 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); |
831 | if ( !appendLabels ) { | 831 | if ( !appendLabels ) { |
832 | dayLabel = mDayLabelsList.next(); | 832 | dayLabel = mDayLabelsList.next(); |
833 | while ( dayLabel ) { | 833 | while ( dayLabel ) { |
834 | //qDebug("!dayLabel %d",dayLabel ); | 834 | //qDebug("!dayLabel %d",dayLabel ); |
835 | dayLabel->hide(); | 835 | dayLabel->hide(); |
836 | dayLabel = mDayLabelsList.next(); | 836 | dayLabel = mDayLabelsList.next(); |
837 | } | 837 | } |
838 | } | 838 | } |
839 | //mDayLabelsFrame->show(); | 839 | |
840 | //mDayLabels->show(); | 840 | mDayLabelsFrame->setFixedHeight( newHight + 4 ); |
841 | //qDebug("heigt %d %d %d ",mDayLabelsFrame->height(), mDayLabelsFrame->sizeHint().height(), newHight); | ||
842 | //mDayLabelsFrame->resize( mAgenda->visibleWidth(), newHight ); | ||
843 | mDayLabelsFrame->setFixedHeight( newHight ); | ||
844 | } | 841 | } |
845 | 842 | ||
846 | int KOAgendaView::maxDatesHint() | 843 | int KOAgendaView::maxDatesHint() |
847 | { | 844 | { |
848 | // Not sure about the max number of events, so return 0 for now. | 845 | // Not sure about the max number of events, so return 0 for now. |
849 | return 0; | 846 | return 0; |
850 | } | 847 | } |
851 | 848 | ||
852 | int KOAgendaView::currentDateCount() | 849 | int KOAgendaView::currentDateCount() |
853 | { | 850 | { |
854 | return mSelectedDates.count(); | 851 | return mSelectedDates.count(); |
855 | } | 852 | } |
856 | 853 | ||
857 | QPtrList<Incidence> KOAgendaView::selectedIncidences() | 854 | QPtrList<Incidence> KOAgendaView::selectedIncidences() |
858 | { | 855 | { |
859 | QPtrList<Incidence> selected; | 856 | QPtrList<Incidence> selected; |
860 | Incidence *incidence; | 857 | Incidence *incidence; |
861 | 858 | ||
862 | incidence = mAgenda->selectedIncidence(); | 859 | incidence = mAgenda->selectedIncidence(); |
863 | if (incidence) selected.append(incidence); | 860 | if (incidence) selected.append(incidence); |
864 | 861 | ||
865 | incidence = mAllDayAgenda->selectedIncidence(); | 862 | incidence = mAllDayAgenda->selectedIncidence(); |
866 | if (incidence) selected.append(incidence); | 863 | if (incidence) selected.append(incidence); |
867 | 864 | ||
868 | return selected; | 865 | return selected; |
869 | } | 866 | } |
870 | 867 | ||
871 | DateList KOAgendaView::selectedDates() | 868 | DateList KOAgendaView::selectedDates() |
872 | { | 869 | { |
873 | DateList selected; | 870 | DateList selected; |
874 | QDate qd; | 871 | QDate qd; |
875 | 872 | ||
876 | qd = mAgenda->selectedIncidenceDate(); | 873 | qd = mAgenda->selectedIncidenceDate(); |
877 | if (qd.isValid()) selected.append(qd); | 874 | if (qd.isValid()) selected.append(qd); |
878 | 875 | ||
879 | qd = mAllDayAgenda->selectedIncidenceDate(); | 876 | qd = mAllDayAgenda->selectedIncidenceDate(); |
880 | if (qd.isValid()) selected.append(qd); | 877 | if (qd.isValid()) selected.append(qd); |
881 | 878 | ||
882 | return selected; | 879 | return selected; |
883 | } | 880 | } |
884 | 881 | ||
885 | 882 | ||
886 | void KOAgendaView::updateView() | 883 | void KOAgendaView::updateView() |
887 | { | 884 | { |
888 | if ( mBlockUpdating ) | 885 | if ( mBlockUpdating ) |
889 | return; | 886 | return; |
890 | // kdDebug() << "KOAgendaView::updateView()" << endl; | 887 | // kdDebug() << "KOAgendaView::updateView()" << endl; |
891 | fillAgenda(); | 888 | fillAgenda(); |
892 | 889 | ||
893 | } | 890 | } |
894 | 891 | ||
895 | 892 | ||
896 | /* | 893 | /* |
897 | Update configuration settings for the agenda view. This method is not | 894 | Update configuration settings for the agenda view. This method is not |
898 | complete. | 895 | complete. |
899 | */ | 896 | */ |
900 | void KOAgendaView::updateConfig() | 897 | void KOAgendaView::updateConfig() |
901 | { | 898 | { |
902 | if ( mBlockUpdating ) | 899 | if ( mBlockUpdating ) |
903 | return; | 900 | return; |
904 | if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) { | 901 | if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) { |
905 | int old = KOPrefs::instance()->mHourSize; | 902 | int old = KOPrefs::instance()->mHourSize; |
906 | KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1; | 903 | KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1; |
907 | qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize ); | 904 | qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize ); |
908 | } | 905 | } |
909 | 906 | ||
910 | 907 | ||
911 | // update config for children | 908 | // update config for children |
912 | mTimeLabels->updateConfig(); | 909 | mTimeLabels->updateConfig(); |
913 | mAgenda->storePosition(); | 910 | mAgenda->storePosition(); |
914 | mAgenda->updateConfig(); | 911 | mAgenda->updateConfig(); |
915 | mAllDayAgenda->updateConfig(); | 912 | mAllDayAgenda->updateConfig(); |
916 | // widget synchronization | 913 | // widget synchronization |
917 | //TODO: find a better way, maybe signal/slot | 914 | //TODO: find a better way, maybe signal/slot |
918 | mTimeLabels->positionChanged(); | 915 | mTimeLabels->positionChanged(); |
919 | 916 | ||
920 | // for some reason, this needs to be called explicitly | 917 | // for some reason, this needs to be called explicitly |
921 | mTimeLabels->repaint(); | 918 | mTimeLabels->repaint(); |
922 | 919 | ||
923 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 920 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
924 | 921 | ||
925 | // ToolTips displaying summary of events | 922 | // ToolTips displaying summary of events |
926 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() | 923 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() |
927 | ->mEnableToolTips); | 924 | ->mEnableToolTips); |
928 | 925 | ||
929 | //setHolidayMasks(); | 926 | //setHolidayMasks(); |
930 | 927 | ||
931 | //createDayLabels(); called by via updateView(); | 928 | //createDayLabels(); called by via updateView(); |
932 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); | 929 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); |
933 | updateView(); | 930 | updateView(); |
934 | mAgenda->restorePosition(); | 931 | mAgenda->restorePosition(); |
935 | } | 932 | } |
936 | 933 | ||
937 | 934 | ||
938 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) | 935 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) |
939 | { | 936 | { |
940 | // kdDebug() << "KOAgendaView::updateEventDates(): " << item->text() << endl; | 937 | // kdDebug() << "KOAgendaView::updateEventDates(): " << item->text() << endl; |
941 | //qDebug("KOAgendaView::updateEventDates "); | 938 | //qDebug("KOAgendaView::updateEventDates "); |
942 | QDateTime startDt,endDt; | 939 | QDateTime startDt,endDt; |
943 | QDate startDate; | 940 | QDate startDate; |
944 | int lenInSecs; | 941 | int lenInSecs; |
945 | // if ( type == KOAgenda::RESIZETOP ) | 942 | // if ( type == KOAgenda::RESIZETOP ) |
946 | // qDebug("RESIZETOP "); | 943 | // qDebug("RESIZETOP "); |
947 | // if ( type == KOAgenda::RESIZEBOTTOM ) | 944 | // if ( type == KOAgenda::RESIZEBOTTOM ) |
948 | // qDebug("RESIZEBOTTOM "); | 945 | // qDebug("RESIZEBOTTOM "); |
949 | // if ( type == KOAgenda::MOVE ) | 946 | // if ( type == KOAgenda::MOVE ) |
950 | // qDebug("MOVE "); | 947 | // qDebug("MOVE "); |
951 | if ( item->incidence()->type() == "Event" ) { | 948 | if ( item->incidence()->type() == "Event" ) { |
952 | startDt =item->incidence()->dtStart(); | 949 | startDt =item->incidence()->dtStart(); |
953 | endDt = item->incidence()->dtEnd(); | 950 | endDt = item->incidence()->dtEnd(); |
954 | lenInSecs = startDt.secsTo( endDt ); | 951 | lenInSecs = startDt.secsTo( endDt ); |
955 | } | 952 | } |
956 | 953 | ||
957 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); | 954 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); |
958 | 955 | ||
959 | if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { | 956 | if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { |
960 | startDate = mSelectedDates[item->mLastMoveXPos]; | 957 | startDate = mSelectedDates[item->mLastMoveXPos]; |
961 | } else { | 958 | } else { |
962 | if (item->cellX() < 0) { | 959 | if (item->cellX() < 0) { |
963 | startDate = (mSelectedDates.first()).addDays(item->cellX()); | 960 | startDate = (mSelectedDates.first()).addDays(item->cellX()); |
964 | } else { | 961 | } else { |
965 | startDate = mSelectedDates[item->cellX()]; | 962 | startDate = mSelectedDates[item->cellX()]; |
966 | } | 963 | } |
967 | } | 964 | } |
968 | startDt.setDate(startDate); | 965 | startDt.setDate(startDate); |
969 | 966 | ||
970 | if (item->incidence()->doesFloat()) { | 967 | if (item->incidence()->doesFloat()) { |
971 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); | 968 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); |
972 | } else { | 969 | } else { |
973 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) | 970 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) |
974 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); | 971 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); |
975 | if ( item->incidence()->type() == "Event" ) { | 972 | if ( item->incidence()->type() == "Event" ) { |
976 | if ( type == KOAgenda::MOVE ) { | 973 | if ( type == KOAgenda::MOVE ) { |
977 | endDt = startDt.addSecs(lenInSecs); | 974 | endDt = startDt.addSecs(lenInSecs); |
978 | 975 | ||
979 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { | 976 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { |
980 | if (item->lastMultiItem()) { | 977 | if (item->lastMultiItem()) { |
981 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 978 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
982 | endDt.setDate(startDate. | 979 | endDt.setDate(startDate. |
983 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 980 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
984 | } else { | 981 | } else { |
985 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 982 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
986 | endDt.setDate(startDate); | 983 | endDt.setDate(startDate); |
987 | } | 984 | } |
988 | } | 985 | } |
989 | } else { | 986 | } else { |
990 | // todo | 987 | // todo |
991 | if (item->lastMultiItem()) { | 988 | if (item->lastMultiItem()) { |
992 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 989 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
993 | endDt.setDate(startDate. | 990 | endDt.setDate(startDate. |
994 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 991 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
995 | } else { | 992 | } else { |
996 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); | 993 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); |
997 | if ( item->cellYBottom() > 0 ) | 994 | if ( item->cellYBottom() > 0 ) |
998 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 995 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
999 | else | 996 | else |
1000 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); | 997 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); |
1001 | endDt.setDate(startDate); | 998 | endDt.setDate(startDate); |
1002 | } | 999 | } |
1003 | } | 1000 | } |
1004 | } | 1001 | } |
1005 | if ( item->incidence()->type() == "Event" ) { | 1002 | if ( item->incidence()->type() == "Event" ) { |
1006 | item->incidence()->setDtStart(startDt); | 1003 | item->incidence()->setDtStart(startDt); |
1007 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); | 1004 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); |
1008 | } else if ( item->incidence()->type() == "Todo" ) { | 1005 | } else if ( item->incidence()->type() == "Todo" ) { |
1009 | Todo* to = static_cast<Todo*>(item->incidence()); | 1006 | Todo* to = static_cast<Todo*>(item->incidence()); |
1010 | 1007 | ||
1011 | to->setDtDue(endDt); | 1008 | to->setDtDue(endDt); |
1012 | if ( to->hasStartDate() ) { | 1009 | if ( to->hasStartDate() ) { |
1013 | if (to->dtStart() >= to->dtDue() ) | 1010 | if (to->dtStart() >= to->dtDue() ) |
1014 | to->setDtStart(to->dtDue().addDays( -2 )); | 1011 | to->setDtStart(to->dtDue().addDays( -2 )); |
1015 | } | 1012 | } |
1016 | 1013 | ||
1017 | } | 1014 | } |
1018 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); | 1015 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); |
1019 | item->incidence()->setRevision(item->incidence()->revision()+1); | 1016 | item->incidence()->setRevision(item->incidence()->revision()+1); |
1020 | item->setItemDate(startDt.date()); | 1017 | item->setItemDate(startDt.date()); |
1021 | //item->updateItem(); | 1018 | //item->updateItem(); |
1022 | if ( item->incidence()->type() == "Todo" ) { | 1019 | if ( item->incidence()->type() == "Todo" ) { |
1023 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); | 1020 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); |
1024 | 1021 | ||
1025 | } | 1022 | } |
1026 | else | 1023 | else |
1027 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); | 1024 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); |
1028 | item->updateItem(); | 1025 | item->updateItem(); |
1029 | } | 1026 | } |
1030 | 1027 | ||
1031 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) | 1028 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) |
1032 | { | 1029 | { |
1033 | // kdDebug() << "KOAgendaView::selectDates" << endl; | 1030 | // kdDebug() << "KOAgendaView::selectDates" << endl; |
1034 | 1031 | ||
1035 | mSelectedDates.clear(); | 1032 | mSelectedDates.clear(); |
1036 | // qDebug("KOAgendaView::showDates "); | 1033 | // qDebug("KOAgendaView::showDates "); |
1037 | QDate d = start; | 1034 | QDate d = start; |
1038 | while (d <= end) { | 1035 | while (d <= end) { |
1039 | mSelectedDates.append(d); | 1036 | mSelectedDates.append(d); |
1040 | d = d.addDays( 1 ); | 1037 | d = d.addDays( 1 ); |
1041 | } | 1038 | } |
1042 | 1039 | ||
1043 | // and update the view | 1040 | // and update the view |
1044 | fillAgenda(); | 1041 | fillAgenda(); |
1045 | } | 1042 | } |
1046 | 1043 | ||
1047 | 1044 | ||
1048 | void KOAgendaView::showEvents(QPtrList<Event>) | 1045 | void KOAgendaView::showEvents(QPtrList<Event>) |
1049 | { | 1046 | { |
1050 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; | 1047 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; |
1051 | } | 1048 | } |
1052 | 1049 | ||
1053 | void KOAgendaView::changeEventDisplay(Event *, int) | 1050 | void KOAgendaView::changeEventDisplay(Event *, int) |
1054 | { | 1051 | { |
1055 | // qDebug("KOAgendaView::changeEventDisplay "); | 1052 | // qDebug("KOAgendaView::changeEventDisplay "); |
1056 | // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; | 1053 | // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; |
1057 | // this should be re-written to be MUCH smarter. Right now we | 1054 | // this should be re-written to be MUCH smarter. Right now we |
1058 | // are just playing dumb. | 1055 | // are just playing dumb. |
1059 | fillAgenda(); | 1056 | fillAgenda(); |
1060 | } | 1057 | } |
1061 | 1058 | ||
1062 | void KOAgendaView::fillAgenda(const QDate &) | 1059 | void KOAgendaView::fillAgenda(const QDate &) |
1063 | { | 1060 | { |
1064 | // qDebug("KOAgendaView::fillAgenda "); | 1061 | // qDebug("KOAgendaView::fillAgenda "); |
1065 | fillAgenda(); | 1062 | fillAgenda(); |
1066 | } | 1063 | } |
1067 | 1064 | ||
1068 | void KOAgendaView::fillAgenda() | 1065 | void KOAgendaView::fillAgenda() |
1069 | { | 1066 | { |
1070 | if ( globalFlagBlockStartup ) | 1067 | if ( globalFlagBlockStartup ) |
1071 | return; | 1068 | return; |
1072 | if ( globalFlagBlockAgenda == 1 ) | 1069 | if ( globalFlagBlockAgenda == 1 ) |
1073 | return; | 1070 | return; |
1074 | //if ( globalFlagBlockAgenda == 2 ) | 1071 | //if ( globalFlagBlockAgenda == 2 ) |
1075 | //globalFlagBlockAgenda = 0; | 1072 | //globalFlagBlockAgenda = 0; |
1076 | // globalFlagBlockPainting = false; | 1073 | // globalFlagBlockPainting = false; |
1077 | if ( globalFlagBlockAgenda == 0 ) | 1074 | if ( globalFlagBlockAgenda == 0 ) |
1078 | globalFlagBlockAgenda = 1; | 1075 | globalFlagBlockAgenda = 1; |
1079 | // clearView(); | 1076 | // clearView(); |
1080 | //qDebug("fillAgenda()++++ "); | 1077 | //qDebug("fillAgenda()++++ "); |
1081 | globalFlagBlockAgendaItemPaint = 1; | 1078 | globalFlagBlockAgendaItemPaint = 1; |
1082 | 1079 | ||
1083 | mAllDayAgenda->changeColumns(mSelectedDates.count()); | 1080 | mAllDayAgenda->changeColumns(mSelectedDates.count()); |
1084 | mAgenda->changeColumns(mSelectedDates.count()); | 1081 | mAgenda->changeColumns(mSelectedDates.count()); |
1085 | qApp->processEvents(); | 1082 | qApp->processEvents(); |
1086 | mEventIndicatorTop->changeColumns(mSelectedDates.count()); | 1083 | mEventIndicatorTop->changeColumns(mSelectedDates.count()); |
1087 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); | 1084 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); |
1088 | setHolidayMasks(); | 1085 | setHolidayMasks(); |
1089 | 1086 | ||
1090 | //mAgenda->hideUnused(); | 1087 | //mAgenda->hideUnused(); |
1091 | //mAllDayAgenda->hideUnused(); | 1088 | //mAllDayAgenda->hideUnused(); |
1092 | 1089 | ||
1093 | // mAgenda->blockNextRepaint( false ); | 1090 | // mAgenda->blockNextRepaint( false ); |
1094 | // mAgenda->viewport()->repaint(); | 1091 | // mAgenda->viewport()->repaint(); |
1095 | // mAgenda->blockNextRepaint( true ); | 1092 | // mAgenda->blockNextRepaint( true ); |
1096 | mMinY.resize(mSelectedDates.count()); | 1093 | mMinY.resize(mSelectedDates.count()); |
1097 | mMaxY.resize(mSelectedDates.count()); | 1094 | mMaxY.resize(mSelectedDates.count()); |
1098 | 1095 | ||
1099 | QPtrList<Event> dayEvents; | 1096 | QPtrList<Event> dayEvents; |
1100 | 1097 | ||
1101 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1098 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1102 | // Therefore, gtodoset all of them. | 1099 | // Therefore, gtodoset all of them. |
1103 | QPtrList<Todo> todos = calendar()->todos(); | 1100 | QPtrList<Todo> todos = calendar()->todos(); |
1104 | 1101 | ||
1105 | mAgenda->setDateList(mSelectedDates); | 1102 | mAgenda->setDateList(mSelectedDates); |
1106 | 1103 | ||
1107 | QDate today = QDate::currentDate(); | 1104 | QDate today = QDate::currentDate(); |
1108 | 1105 | ||
1109 | DateList::ConstIterator dit; | 1106 | DateList::ConstIterator dit; |
1110 | int curCol = 0; | 1107 | int curCol = 0; |
1111 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 1108 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
1112 | QDate currentDate = *dit; | 1109 | QDate currentDate = *dit; |
1113 | // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() | 1110 | // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() |
1114 | // << endl; | 1111 | // << endl; |
1115 | 1112 | ||
1116 | dayEvents = calendar()->events(currentDate,true); | 1113 | dayEvents = calendar()->events(currentDate,true); |
1117 | 1114 | ||
1118 | // Default values, which can never be reached | 1115 | // Default values, which can never be reached |
1119 | mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; | 1116 | mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; |
1120 | mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; | 1117 | mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; |
1121 | 1118 | ||
1122 | unsigned int numEvent; | 1119 | unsigned int numEvent; |
1123 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { | 1120 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { |
1124 | Event *event = dayEvents.at(numEvent); | 1121 | Event *event = dayEvents.at(numEvent); |
1125 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) | 1122 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) |
1126 | if ( event->uid().left(15) == QString("last-syncEvent-") ) | 1123 | if ( event->uid().left(15) == QString("last-syncEvent-") ) |
1127 | continue; | 1124 | continue; |
1128 | // kdDebug() << " Event: " << event->summary() << endl; | 1125 | // kdDebug() << " Event: " << event->summary() << endl; |
1129 | 1126 | ||
1130 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; | 1127 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; |
1131 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; | 1128 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; |
1132 | 1129 | ||
1133 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; | 1130 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; |
1134 | 1131 | ||
1135 | if (event->doesFloat()) { | 1132 | if (event->doesFloat()) { |
1136 | if (event->recurrence()->doesRecur()) { | 1133 | if (event->recurrence()->doesRecur()) { |
1137 | mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); | 1134 | mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); |
1138 | } else { | 1135 | } else { |
1139 | if (beginX <= 0 && curCol == 0) { | 1136 | if (beginX <= 0 && curCol == 0) { |
1140 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1137 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1141 | } else if (beginX == curCol) { | 1138 | } else if (beginX == curCol) { |
1142 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1139 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1143 | } | 1140 | } |
1144 | } | 1141 | } |
1145 | } else if (event->isMultiDay()) { | 1142 | } else if (event->isMultiDay()) { |
1146 | if ( event->doesRecur () ) { | 1143 | if ( event->doesRecur () ) { |
1147 | QDate dateit = currentDate; | 1144 | QDate dateit = currentDate; |
1148 | int count = 0; | 1145 | int count = 0; |
1149 | int max = event->dtStart().daysTo( event->dtEnd() ) +2; | 1146 | int max = event->dtStart().daysTo( event->dtEnd() ) +2; |
1150 | while (! event->recursOn( dateit ) && count <= max ) { | 1147 | while (! event->recursOn( dateit ) && count <= max ) { |
1151 | ++count; | 1148 | ++count; |
1152 | dateit = dateit.addDays( -1 ); | 1149 | dateit = dateit.addDays( -1 ); |
1153 | } | 1150 | } |
1154 | bool ok; | 1151 | bool ok; |
1155 | QDateTime nextOcstart = event->getNextOccurence( QDateTime(dateit) ,&ok ); | 1152 | QDateTime nextOcstart = event->getNextOccurence( QDateTime(dateit) ,&ok ); |
1156 | if ( ok ) | 1153 | if ( ok ) |
1157 | { | 1154 | { |
1158 | int secs = event->dtStart().secsTo( event->dtEnd() ); | 1155 | int secs = event->dtStart().secsTo( event->dtEnd() ); |
1159 | QDateTime nextOcend =nextOcstart.addSecs( secs ); ; | 1156 | QDateTime nextOcend =nextOcstart.addSecs( secs ); ; |
1160 | beginX = currentDate.daysTo(nextOcstart.date()) + curCol; | 1157 | beginX = currentDate.daysTo(nextOcstart.date()) + curCol; |
1161 | endX = currentDate.daysTo(nextOcend.date()) + curCol; | 1158 | endX = currentDate.daysTo(nextOcend.date()) + curCol; |
1162 | 1159 | ||
1163 | } | 1160 | } |
1164 | } | 1161 | } |
1165 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1162 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1166 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1163 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1167 | //qDebug("insert %d %d %d %d %d ",beginX,endX,startY,endY , curCol ); | 1164 | //qDebug("insert %d %d %d %d %d ",beginX,endX,startY,endY , curCol ); |
1168 | if ((beginX <= 0 && curCol == 0) || beginX == curCol) { | 1165 | if ((beginX <= 0 && curCol == 0) || beginX == curCol) { |
1169 | //qDebug("insert!!! "); | 1166 | //qDebug("insert!!! "); |
1170 | mAgenda->insertMultiItem(event,currentDate,beginX,endX,startY,endY); | 1167 | mAgenda->insertMultiItem(event,currentDate,beginX,endX,startY,endY); |
1171 | } | 1168 | } |
1172 | if (beginX == curCol) { | 1169 | if (beginX == curCol) { |
1173 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1170 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1174 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1171 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1175 | } else if (endX == curCol) { | 1172 | } else if (endX == curCol) { |
1176 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1173 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1177 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1174 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1178 | } else { | 1175 | } else { |
1179 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1176 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1180 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1177 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1181 | } | 1178 | } |
1182 | } else { | 1179 | } else { |
1183 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1180 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1184 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1181 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1185 | if (endY < startY) endY = startY; | 1182 | if (endY < startY) endY = startY; |
1186 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); | 1183 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); |
1187 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1184 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1188 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1185 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1189 | } | 1186 | } |
1190 | } | 1187 | } |
1191 | // ---------- [display Todos -------------- | 1188 | // ---------- [display Todos -------------- |
1192 | unsigned int numTodo; | 1189 | unsigned int numTodo; |
1193 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { | 1190 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { |
1194 | Todo *todo = todos.at(numTodo); | 1191 | Todo *todo = todos.at(numTodo); |
1195 | 1192 | ||
1196 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date | 1193 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date |
1197 | 1194 | ||
1198 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1195 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1199 | // Already completed items can be displayed on their original due date | 1196 | // Already completed items can be displayed on their original due date |
1200 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda | 1197 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda |
1201 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; | 1198 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; |
1202 | bool fillIn = false; | 1199 | bool fillIn = false; |
1203 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) | 1200 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) |
1204 | fillIn = true; | 1201 | fillIn = true; |
1205 | if ( ! fillIn && !todo->hasCompletedDate() ) | 1202 | if ( ! fillIn && !todo->hasCompletedDate() ) |
1206 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); | 1203 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); |
1207 | if ( fillIn ) { | 1204 | if ( fillIn ) { |
1208 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue | 1205 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue |
1209 | if ( KOPrefs::instance()->mShowTodoInAgenda ) | 1206 | if ( KOPrefs::instance()->mShowTodoInAgenda ) |
1210 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); | 1207 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); |
1211 | } | 1208 | } |
1212 | else { | 1209 | else { |
1213 | QDateTime dt; | 1210 | QDateTime dt; |
1214 | if ( todo->hasCompletedDate() ) | 1211 | if ( todo->hasCompletedDate() ) |
1215 | dt = todo->completed(); | 1212 | dt = todo->completed(); |
1216 | else | 1213 | else |
1217 | dt = todo->dtDue();; | 1214 | dt = todo->dtDue();; |
1218 | 1215 | ||
1219 | 1216 | ||
1220 | int endY = mAgenda->timeToY(dt.time()) - 1; | 1217 | int endY = mAgenda->timeToY(dt.time()) - 1; |
1221 | int hi = (18/KOPrefs::instance()->mHourSize); | 1218 | int hi = (18/KOPrefs::instance()->mHourSize); |
1222 | //qDebug("hei %d ",KOPrefs::instance()->mHourSize); | 1219 | //qDebug("hei %d ",KOPrefs::instance()->mHourSize); |
1223 | int startY = endY -hi; | 1220 | int startY = endY -hi; |
1224 | 1221 | ||
1225 | mAgenda->insertItem(todo,currentDate,curCol,startY,endY); | 1222 | mAgenda->insertItem(todo,currentDate,curCol,startY,endY); |
1226 | 1223 | ||
1227 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1224 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1228 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1225 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1229 | } | 1226 | } |
1230 | } | 1227 | } |
1231 | } | 1228 | } |
1232 | // ---------- display Todos] -------------- | 1229 | // ---------- display Todos] -------------- |
1233 | 1230 | ||
1234 | ++curCol; | 1231 | ++curCol; |
1235 | } | 1232 | } |
1236 | mAgenda->hideUnused(); | 1233 | mAgenda->hideUnused(); |
1237 | mAllDayAgenda->hideUnused(); | 1234 | mAllDayAgenda->hideUnused(); |
1238 | mAgenda->checkScrollBoundaries(); | 1235 | mAgenda->checkScrollBoundaries(); |
1239 | 1236 | ||
1240 | deleteSelectedDateTime(); | 1237 | deleteSelectedDateTime(); |
1241 | 1238 | ||
1242 | createDayLabels(); | 1239 | createDayLabels(); |
1243 | emit incidenceSelected( 0 ); | 1240 | emit incidenceSelected( 0 ); |
1244 | 1241 | ||
1245 | if ( globalFlagBlockAgenda == 2 ) { | 1242 | if ( globalFlagBlockAgenda == 2 ) { |
1246 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 1243 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
1247 | setStartHour( KOPrefs::instance()->mDayBegins ); | 1244 | setStartHour( KOPrefs::instance()->mDayBegins ); |
1248 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 1245 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
1249 | setStartHour( QTime::currentTime ().hour() ); | 1246 | setStartHour( QTime::currentTime ().hour() ); |
1250 | // qApp->processEvents(); | 1247 | // qApp->processEvents(); |
1251 | } | 1248 | } |
1252 | qApp->processEvents(); | 1249 | qApp->processEvents(); |
1253 | //qDebug("qApp->processEvents(); END "); | 1250 | //qDebug("qApp->processEvents(); END "); |
1254 | globalFlagBlockAgenda = 0; | 1251 | globalFlagBlockAgenda = 0; |
1255 | 1252 | ||
1256 | // mAgenda->hideUnused(); | 1253 | // mAgenda->hideUnused(); |
1257 | //mAllDayAgenda->hideUnused(); | 1254 | //mAllDayAgenda->hideUnused(); |
1258 | mAllDayAgenda->drawContentsToPainter(); | 1255 | mAllDayAgenda->drawContentsToPainter(); |
1259 | mAgenda->drawContentsToPainter(); | 1256 | mAgenda->drawContentsToPainter(); |
1260 | repaintAgenda(); | 1257 | repaintAgenda(); |
1261 | // mAgenda->finishUpdate(); | 1258 | // mAgenda->finishUpdate(); |
1262 | //mAllDayAgenda->finishUpdate(); | 1259 | //mAllDayAgenda->finishUpdate(); |
1263 | 1260 | ||
1264 | // repaintAgenda(); | 1261 | // repaintAgenda(); |
1265 | //qApp->processEvents(); | 1262 | //qApp->processEvents(); |
1266 | // globalFlagBlockAgenda = 0; | 1263 | // globalFlagBlockAgenda = 0; |
1267 | } | 1264 | } |
1268 | void KOAgendaView::repaintAgenda() | 1265 | void KOAgendaView::repaintAgenda() |
1269 | { | 1266 | { |
1270 | // mAllDayAgenda->drawContentsToPainter(); | 1267 | // mAllDayAgenda->drawContentsToPainter(); |
1271 | // mAllDayAgenda->viewport()->repaint( false ); | 1268 | // mAllDayAgenda->viewport()->repaint( false ); |
1272 | // mAgenda->drawContentsToPainter(); | 1269 | // mAgenda->drawContentsToPainter(); |
1273 | // mAgenda->viewport()->repaint( false ); | 1270 | // mAgenda->viewport()->repaint( false ); |
1274 | // qApp->processEvents(); | 1271 | // qApp->processEvents(); |
1275 | 1272 | ||
1276 | //qDebug("KOAgendaView::repaintAgenda() "); | 1273 | //qDebug("KOAgendaView::repaintAgenda() "); |
1277 | //qApp->processEvents(); | 1274 | //qApp->processEvents(); |
1278 | mAgenda->viewport()->repaint( false ); | 1275 | mAgenda->viewport()->repaint( false ); |
1279 | mAllDayAgenda->viewport()->repaint( false ); | 1276 | mAllDayAgenda->viewport()->repaint( false ); |
1280 | mAgenda->finishUpdate(); | 1277 | mAgenda->finishUpdate(); |
1281 | mAllDayAgenda->finishUpdate(); | 1278 | mAllDayAgenda->finishUpdate(); |
1282 | } | 1279 | } |
1283 | 1280 | ||
1284 | 1281 | ||
1285 | void KOAgendaView::clearView() | 1282 | void KOAgendaView::clearView() |
1286 | { | 1283 | { |
1287 | // kdDebug() << "ClearView" << endl; | 1284 | // kdDebug() << "ClearView" << endl; |
1288 | mAllDayAgenda->clear(); | 1285 | mAllDayAgenda->clear(); |
1289 | mAgenda->clear(); | 1286 | mAgenda->clear(); |
1290 | } | 1287 | } |
1291 | 1288 | ||
1292 | void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 1289 | void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
1293 | const QDate &td) | 1290 | const QDate &td) |
1294 | { | 1291 | { |
1295 | #ifndef KORG_NOPRINTER | 1292 | #ifndef KORG_NOPRINTER |
1296 | if (fd == td) | 1293 | if (fd == td) |
1297 | calPrinter->preview(CalPrinter::Day, fd, td); | 1294 | calPrinter->preview(CalPrinter::Day, fd, td); |
1298 | else | 1295 | else |
1299 | calPrinter->preview(CalPrinter::Week, fd, td); | 1296 | calPrinter->preview(CalPrinter::Week, fd, td); |
1300 | #endif | 1297 | #endif |
1301 | } | 1298 | } |
1302 | 1299 | ||
1303 | // void KOAgendaView::updateMovedTodo() | 1300 | // void KOAgendaView::updateMovedTodo() |
1304 | // { | 1301 | // { |
1305 | // // updateConfig(); | 1302 | // // updateConfig(); |
1306 | // // emit updateTodoViews(); | 1303 | // // emit updateTodoViews(); |
1307 | // } | 1304 | // } |
1308 | 1305 | ||
1309 | void KOAgendaView::newEvent(int gx, int gy) | 1306 | void KOAgendaView::newEvent(int gx, int gy) |
1310 | { | 1307 | { |
1311 | if (!mSelectedDates.count()) return; | 1308 | if (!mSelectedDates.count()) return; |
1312 | 1309 | ||
1313 | QDate day = mSelectedDates[gx]; | 1310 | QDate day = mSelectedDates[gx]; |
1314 | 1311 | ||
1315 | QTime time = mAgenda->gyToTime(gy); | 1312 | QTime time = mAgenda->gyToTime(gy); |
1316 | QDateTime dt(day,time); | 1313 | QDateTime dt(day,time); |
1317 | // if ( dt < QDateTime::currentDateTime () ) | 1314 | // if ( dt < QDateTime::currentDateTime () ) |
1318 | // dt = QDateTime::currentDateTime ().addSecs( 3600 ); | 1315 | // dt = QDateTime::currentDateTime ().addSecs( 3600 ); |
1319 | emit newEventSignal(dt); | 1316 | emit newEventSignal(dt); |
1320 | } | 1317 | } |
1321 | 1318 | ||
1322 | void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) | 1319 | void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) |
1323 | { | 1320 | { |
1324 | if (!mSelectedDates.count()) return; | 1321 | if (!mSelectedDates.count()) return; |
1325 | 1322 | ||
1326 | QDate dayStart = mSelectedDates[gxStart]; | 1323 | QDate dayStart = mSelectedDates[gxStart]; |
1327 | QDate dayEnd = mSelectedDates[gxEnd]; | 1324 | QDate dayEnd = mSelectedDates[gxEnd]; |
1328 | 1325 | ||
1329 | QTime timeStart = mAgenda->gyToTime(gyStart); | 1326 | QTime timeStart = mAgenda->gyToTime(gyStart); |
1330 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); | 1327 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); |
1331 | 1328 | ||
1332 | QDateTime dtStart(dayStart,timeStart); | 1329 | QDateTime dtStart(dayStart,timeStart); |
1333 | QDateTime dtEnd(dayEnd,timeEnd); | 1330 | QDateTime dtEnd(dayEnd,timeEnd); |
1334 | 1331 | ||
1335 | emit newEventSignal(dtStart,dtEnd); | 1332 | emit newEventSignal(dtStart,dtEnd); |
1336 | } | 1333 | } |
1337 | 1334 | ||
1338 | void KOAgendaView::newEventAllDay(int gx, int ) | 1335 | void KOAgendaView::newEventAllDay(int gx, int ) |
1339 | { | 1336 | { |
1340 | if (!mSelectedDates.count()) return; | 1337 | if (!mSelectedDates.count()) return; |
1341 | 1338 | ||
1342 | QDate day = mSelectedDates[gx]; | 1339 | QDate day = mSelectedDates[gx]; |
1343 | 1340 | ||
1344 | emit newEventSignal(day); | 1341 | emit newEventSignal(day); |
1345 | } | 1342 | } |
1346 | void KOAgendaView::newTodoAllDay(int gx, int ) | 1343 | void KOAgendaView::newTodoAllDay(int gx, int ) |
1347 | { | 1344 | { |
1348 | if (!mSelectedDates.count()) return; | 1345 | if (!mSelectedDates.count()) return; |
1349 | 1346 | ||
1350 | QDateTime day (mSelectedDates[gx] ); | 1347 | QDateTime day (mSelectedDates[gx] ); |
1351 | emit newTodoSignal(day, true); | 1348 | emit newTodoSignal(day, true); |
1352 | } | 1349 | } |
1353 | void KOAgendaView::newTodo(int gx, int gy ) | 1350 | void KOAgendaView::newTodo(int gx, int gy ) |
1354 | { | 1351 | { |
1355 | if (!mSelectedDates.count()) return; | 1352 | if (!mSelectedDates.count()) return; |
1356 | QDate dayStart = mSelectedDates[gx]; | 1353 | QDate dayStart = mSelectedDates[gx]; |
1357 | QTime timeStart = mAgenda->gyToTime(gy); | 1354 | QTime timeStart = mAgenda->gyToTime(gy); |
1358 | QDateTime dt (dayStart,timeStart); | 1355 | QDateTime dt (dayStart,timeStart); |
1359 | emit newTodoSignal( dt, false ); | 1356 | emit newTodoSignal( dt, false ); |
1360 | } | 1357 | } |
1361 | 1358 | ||
1362 | void KOAgendaView::updateEventIndicatorTop(int newY) | 1359 | void KOAgendaView::updateEventIndicatorTop(int newY) |
1363 | { | 1360 | { |
1364 | uint i; | 1361 | uint i; |
1365 | for(i=0;i<mMinY.size();++i) { | 1362 | for(i=0;i<mMinY.size();++i) { |
1366 | if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true); | 1363 | if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true); |
1367 | else mEventIndicatorTop->enableColumn(i,false); | 1364 | else mEventIndicatorTop->enableColumn(i,false); |
1368 | } | 1365 | } |
1369 | 1366 | ||
1370 | mEventIndicatorTop->update(); | 1367 | mEventIndicatorTop->update(); |
1371 | } | 1368 | } |
1372 | 1369 | ||
1373 | void KOAgendaView::updateEventIndicatorBottom(int newY) | 1370 | void KOAgendaView::updateEventIndicatorBottom(int newY) |
1374 | { | 1371 | { |
1375 | uint i; | 1372 | uint i; |
1376 | for(i=0;i<mMaxY.size();++i) { | 1373 | for(i=0;i<mMaxY.size();++i) { |
1377 | if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true); | 1374 | if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true); |
1378 | else mEventIndicatorBottom->enableColumn(i,false); | 1375 | else mEventIndicatorBottom->enableColumn(i,false); |
1379 | } | 1376 | } |
1380 | 1377 | ||
1381 | mEventIndicatorBottom->update(); | 1378 | mEventIndicatorBottom->update(); |
1382 | } | 1379 | } |
1383 | 1380 | ||
1384 | void KOAgendaView::startDrag(Event *event) | 1381 | void KOAgendaView::startDrag(Event *event) |
1385 | { | 1382 | { |
1386 | #ifndef KORG_NODND | 1383 | #ifndef KORG_NODND |
1387 | DndFactory factory( calendar() ); | 1384 | DndFactory factory( calendar() ); |
1388 | ICalDrag *vd = factory.createDrag(event,this); | 1385 | ICalDrag *vd = factory.createDrag(event,this); |
1389 | if (vd->drag()) { | 1386 | if (vd->drag()) { |
1390 | kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl; | 1387 | kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl; |
1391 | } | 1388 | } |
1392 | #endif | 1389 | #endif |
1393 | } | 1390 | } |
1394 | 1391 | ||
1395 | void KOAgendaView::readSettings() | 1392 | void KOAgendaView::readSettings() |
1396 | { | 1393 | { |
1397 | readSettings(KOGlobals::config()); | 1394 | readSettings(KOGlobals::config()); |
1398 | } | 1395 | } |
1399 | 1396 | ||
1400 | void KOAgendaView::readSettings(KConfig *config) | 1397 | void KOAgendaView::readSettings(KConfig *config) |
1401 | { | 1398 | { |
1402 | // kdDebug() << "KOAgendaView::readSettings()" << endl; | 1399 | // kdDebug() << "KOAgendaView::readSettings()" << endl; |
1403 | 1400 | ||
1404 | config->setGroup("Views"); | 1401 | config->setGroup("Views"); |
1405 | 1402 | ||
1406 | //#ifndef KORG_NOSPLITTER | 1403 | //#ifndef KORG_NOSPLITTER |
1407 | QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); | 1404 | QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); |
1408 | if (sizes.count() == 2) { | 1405 | if (sizes.count() == 2) { |
1409 | if ( sizes[0] < 20 ) { | 1406 | if ( sizes[0] < 20 ) { |
1410 | sizes[1] = sizes[1] +20 - sizes[0]; | 1407 | sizes[1] = sizes[1] +20 - sizes[0]; |
1411 | sizes[0] = 20; | 1408 | sizes[0] = 20; |
1412 | } | 1409 | } |
1413 | mSplitterAgenda->setSizes(sizes); | 1410 | mSplitterAgenda->setSizes(sizes); |
1414 | // qDebug("read %d %d ",sizes[0],sizes[1] ); | 1411 | // qDebug("read %d %d ",sizes[0],sizes[1] ); |
1415 | } | 1412 | } |
1416 | //#endif | 1413 | //#endif |
1417 | 1414 | ||
1418 | // updateConfig(); | 1415 | // updateConfig(); |
1419 | } | 1416 | } |
1420 | 1417 | ||
1421 | void KOAgendaView::writeSettings(KConfig *config) | 1418 | void KOAgendaView::writeSettings(KConfig *config) |
1422 | { | 1419 | { |
1423 | // kdDebug() << "KOAgendaView::writeSettings()" << endl; | 1420 | // kdDebug() << "KOAgendaView::writeSettings()" << endl; |
1424 | 1421 | ||
1425 | config->setGroup("Views"); | 1422 | config->setGroup("Views"); |
1426 | 1423 | ||
1427 | //#ifndef KORG_NOSPLITTER | 1424 | //#ifndef KORG_NOSPLITTER |
1428 | QValueList<int> list = mSplitterAgenda->sizes(); | 1425 | QValueList<int> list = mSplitterAgenda->sizes(); |
1429 | config->writeEntry("Separator AgendaView",list); | 1426 | config->writeEntry("Separator AgendaView",list); |
1430 | //qDebug("write %d %d ", list[0],list[1] ); | 1427 | //qDebug("write %d %d ", list[0],list[1] ); |
1431 | //#endif | 1428 | //#endif |
1432 | } | 1429 | } |
1433 | 1430 | ||
1434 | void KOAgendaView::setHolidayMasks() | 1431 | void KOAgendaView::setHolidayMasks() |
1435 | { | 1432 | { |
1436 | mHolidayMask.resize(mSelectedDates.count()); | 1433 | mHolidayMask.resize(mSelectedDates.count()); |
1437 | 1434 | ||
1438 | uint i; | 1435 | uint i; |
1439 | for(i=0;i<mSelectedDates.count();++i) { | 1436 | for(i=0;i<mSelectedDates.count();++i) { |
1440 | QDate date = mSelectedDates[i]; | 1437 | QDate date = mSelectedDates[i]; |
1441 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); | 1438 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); |
1442 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); | 1439 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); |
1443 | bool showHoliday = false; | 1440 | bool showHoliday = false; |
1444 | if ( KOPrefs::instance()->mExcludeHolidays ) { | 1441 | if ( KOPrefs::instance()->mExcludeHolidays ) { |
1445 | QPtrList<Event> events = calendar()->events( date, true ); | 1442 | QPtrList<Event> events = calendar()->events( date, true ); |
1446 | Event *event; | 1443 | Event *event; |
1447 | for( event = events.first(); event; event = events.next() ) { | 1444 | for( event = events.first(); event; event = events.next() ) { |
1448 | if ( event->isHoliday()) { | 1445 | if ( event->isHoliday()) { |
1449 | showHoliday = true; | 1446 | showHoliday = true; |
1450 | break; | 1447 | break; |
1451 | } | 1448 | } |
1452 | } | 1449 | } |
1453 | 1450 | ||
1454 | } | 1451 | } |
1455 | 1452 | ||
1456 | #ifndef KORG_NOPLUGINS | 1453 | #ifndef KORG_NOPLUGINS |
1457 | bool showHoliday = KOPrefs::instance()->mExcludeHolidays && | 1454 | bool showHoliday = KOPrefs::instance()->mExcludeHolidays && |
1458 | !KOCore::self()->holiday(date).isEmpty(); | 1455 | !KOCore::self()->holiday(date).isEmpty(); |
1459 | #endif | 1456 | #endif |
1460 | bool showDay = showSaturday || showSunday || showHoliday; | 1457 | bool showDay = showSaturday || showSunday || showHoliday; |
1461 | 1458 | ||
1462 | if (showDay) { | 1459 | if (showDay) { |
1463 | mHolidayMask.at(i) = true; | 1460 | mHolidayMask.at(i) = true; |
1464 | } else { | 1461 | } else { |
1465 | mHolidayMask.at(i) = false; | 1462 | mHolidayMask.at(i) = false; |
1466 | } | 1463 | } |
1467 | } | 1464 | } |
1468 | 1465 | ||
1469 | mAgenda->setHolidayMask(&mHolidayMask); | 1466 | mAgenda->setHolidayMask(&mHolidayMask); |
1470 | mAllDayAgenda->setHolidayMask(&mHolidayMask); | 1467 | mAllDayAgenda->setHolidayMask(&mHolidayMask); |
1471 | } | 1468 | } |
1472 | 1469 | ||
1473 | void KOAgendaView::setContentsPos(int y) | 1470 | void KOAgendaView::setContentsPos(int y) |
1474 | { | 1471 | { |
1475 | mAgenda->setContentsPos(0,y); | 1472 | mAgenda->setContentsPos(0,y); |
1476 | } | 1473 | } |
1477 | 1474 | ||
1478 | void KOAgendaView::clearSelection() | 1475 | void KOAgendaView::clearSelection() |
1479 | { | 1476 | { |
1480 | mAgenda->deselectItem(); | 1477 | mAgenda->deselectItem(); |
1481 | mAllDayAgenda->deselectItem(); | 1478 | mAllDayAgenda->deselectItem(); |
1482 | } | 1479 | } |
1483 | 1480 | ||
1484 | void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart, | 1481 | void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart, |
1485 | int gxEnd, int gyEnd) | 1482 | int gxEnd, int gyEnd) |
1486 | { | 1483 | { |
1487 | mTimeSpanInAllDay = true; | 1484 | mTimeSpanInAllDay = true; |
1488 | newTimeSpanSelected(gxStart,gyStart,gxEnd,gyEnd); | 1485 | newTimeSpanSelected(gxStart,gyStart,gxEnd,gyEnd); |
1489 | } | 1486 | } |
1490 | 1487 | ||
1491 | 1488 | ||
1492 | 1489 | ||
1493 | 1490 | ||
1494 | void KOAgendaView::newTimeSpanSelected(int gxStart, int gyStart, | 1491 | void KOAgendaView::newTimeSpanSelected(int gxStart, int gyStart, |
1495 | int gxEnd, int gyEnd) | 1492 | int gxEnd, int gyEnd) |
1496 | { | 1493 | { |
1497 | if (!mSelectedDates.count()) return; | 1494 | if (!mSelectedDates.count()) return; |
1498 | 1495 | ||
1499 | QDate dayStart = mSelectedDates[gxStart]; | 1496 | QDate dayStart = mSelectedDates[gxStart]; |
1500 | QDate dayEnd = mSelectedDates[gxEnd]; | 1497 | QDate dayEnd = mSelectedDates[gxEnd]; |
1501 | 1498 | ||
1502 | QTime timeStart = mAgenda->gyToTime(gyStart); | 1499 | QTime timeStart = mAgenda->gyToTime(gyStart); |
1503 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); | 1500 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); |
1504 | 1501 | ||
1505 | QDateTime dtStart(dayStart,timeStart); | 1502 | QDateTime dtStart(dayStart,timeStart); |
1506 | QDateTime dtEnd(dayEnd,timeEnd); | 1503 | QDateTime dtEnd(dayEnd,timeEnd); |
1507 | 1504 | ||
1508 | mTimeSpanBegin = dtStart; | 1505 | mTimeSpanBegin = dtStart; |
1509 | mTimeSpanEnd = dtEnd; | 1506 | mTimeSpanEnd = dtEnd; |
1510 | 1507 | ||
1511 | } | 1508 | } |
1512 | 1509 | ||
1513 | void KOAgendaView::deleteSelectedDateTime() | 1510 | void KOAgendaView::deleteSelectedDateTime() |
1514 | { | 1511 | { |
1515 | mTimeSpanBegin.setDate(QDate()); | 1512 | mTimeSpanBegin.setDate(QDate()); |
1516 | mTimeSpanEnd.setDate(QDate()); | 1513 | mTimeSpanEnd.setDate(QDate()); |
1517 | mTimeSpanInAllDay = false; | 1514 | mTimeSpanInAllDay = false; |
1518 | } | 1515 | } |
1519 | 1516 | ||
1520 | void KOAgendaView::keyPressEvent ( QKeyEvent * e ) | 1517 | void KOAgendaView::keyPressEvent ( QKeyEvent * e ) |
1521 | { | 1518 | { |
1522 | e->ignore(); | 1519 | e->ignore(); |
1523 | } | 1520 | } |
1524 | 1521 | ||
1525 | void KOAgendaView::scrollOneHourUp() | 1522 | void KOAgendaView::scrollOneHourUp() |
1526 | { | 1523 | { |
1527 | 1524 | ||
1528 | mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 ); | 1525 | mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 ); |
1529 | } | 1526 | } |
1530 | void KOAgendaView::scrollOneHourDown() | 1527 | void KOAgendaView::scrollOneHourDown() |
1531 | { | 1528 | { |
1532 | mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 ); | 1529 | mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 ); |
1533 | } | 1530 | } |
1534 | 1531 | ||
1535 | void KOAgendaView::setStartHour( int h ) | 1532 | void KOAgendaView::setStartHour( int h ) |
1536 | { | 1533 | { |
1537 | mAgenda->setStartHour( h ); | 1534 | mAgenda->setStartHour( h ); |
1538 | 1535 | ||
1539 | } | 1536 | } |
1540 | void KOAgendaView::setInitStartHour() | 1537 | void KOAgendaView::setInitStartHour() |
1541 | { | 1538 | { |
1542 | 1539 | ||
1543 | if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 1540 | if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
1544 | setStartHour( QTime::currentTime ().hour() ); | 1541 | setStartHour( QTime::currentTime ().hour() ); |
1545 | else | 1542 | else |
1546 | setStartHour( KOPrefs::instance()->mDayBegins ); | 1543 | setStartHour( KOPrefs::instance()->mDayBegins ); |
1547 | 1544 | ||
1548 | } | 1545 | } |
1549 | 1546 | ||
1550 | 1547 | ||
1551 | void KOAgendaView::updateTodo( Todo * t, int ) | 1548 | void KOAgendaView::updateTodo( Todo * t, int ) |
1552 | { | 1549 | { |
1553 | if ( !isVisible() ) | 1550 | if ( !isVisible() ) |
1554 | return; | 1551 | return; |
1555 | bool remove = false; | 1552 | bool remove = false; |
1556 | bool removeAD = false; | 1553 | bool removeAD = false; |
1557 | QDate da; | 1554 | QDate da; |
1558 | if ( t->hasCompletedDate() ) | 1555 | if ( t->hasCompletedDate() ) |
1559 | da = t->completed().date(); | 1556 | da = t->completed().date(); |
1560 | else | 1557 | else |
1561 | da = t->dtDue().date(); | 1558 | da = t->dtDue().date(); |
1562 | if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { | 1559 | if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { |
1563 | remove = true; | 1560 | remove = true; |
1564 | removeAD = true; | 1561 | removeAD = true; |
1565 | } | 1562 | } |
1566 | else { | 1563 | else { |
1567 | bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; | 1564 | bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; |
1568 | if ( overdue && | 1565 | if ( overdue && |
1569 | QDate::currentDate() >= mSelectedDates.first() && | 1566 | QDate::currentDate() >= mSelectedDates.first() && |
1570 | QDate::currentDate() <= mSelectedDates.last()) { | 1567 | QDate::currentDate() <= mSelectedDates.last()) { |
1571 | removeAD = false; | 1568 | removeAD = false; |
1572 | remove = true; | 1569 | remove = true; |
1573 | } | 1570 | } |
1574 | else { | 1571 | else { |
1575 | 1572 | ||
1576 | if ( da < mSelectedDates.first() || | 1573 | if ( da < mSelectedDates.first() || |
1577 | da > mSelectedDates.last() ) { | 1574 | da > mSelectedDates.last() ) { |
1578 | remove = true; | 1575 | remove = true; |
1579 | removeAD = true; | 1576 | removeAD = true; |
1580 | } else { | 1577 | } else { |
1581 | remove = t->doesFloat() && !t->hasCompletedDate(); | 1578 | remove = t->doesFloat() && !t->hasCompletedDate(); |
1582 | removeAD = !remove; | 1579 | removeAD = !remove; |
1583 | } | 1580 | } |
1584 | } | 1581 | } |
1585 | } | 1582 | } |
1586 | int days = mSelectedDates.first().daysTo( da ); | 1583 | int days = mSelectedDates.first().daysTo( da ); |
1587 | //qDebug("daysto %d %d %d", days, remove,removeAD ); | 1584 | //qDebug("daysto %d %d %d", days, remove,removeAD ); |
1588 | mAgenda->updateTodo( t , days, remove); | 1585 | mAgenda->updateTodo( t , days, remove); |
1589 | if ( KOPrefs::instance()->mShowTodoInAgenda ) | 1586 | if ( KOPrefs::instance()->mShowTodoInAgenda ) |
1590 | mAllDayAgenda->updateTodo( t , days, removeAD); | 1587 | mAllDayAgenda->updateTodo( t , days, removeAD); |
1591 | //qDebug("KOAgendaView::updateTodo( Todo *, int ) "); | 1588 | //qDebug("KOAgendaView::updateTodo( Todo *, int ) "); |
1592 | 1589 | ||
1593 | } | 1590 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 7a4275b..ca0d542 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1,2150 +1,2154 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qaction.h> | 3 | #include <qaction.h> |
4 | #include <qpopupmenu.h> | 4 | #include <qpopupmenu.h> |
5 | #include <qpainter.h> | 5 | #include <qpainter.h> |
6 | #include <qwhatsthis.h> | 6 | #include <qwhatsthis.h> |
7 | #include <qpushbutton.h> | 7 | #include <qpushbutton.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qtextcodec.h> | 10 | #include <qtextcodec.h> |
11 | #include <qfile.h> | 11 | #include <qfile.h> |
12 | #include <qdir.h> | 12 | #include <qdir.h> |
13 | #include <qapp.h> | 13 | #include <qapp.h> |
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 15 | #include <qlabel.h> |
16 | #include <qspinbox.h> | 16 | #include <qspinbox.h> |
17 | #include <qcheckbox.h> | 17 | #include <qcheckbox.h> |
18 | #include <qmap.h> | 18 | #include <qmap.h> |
19 | #include <qwmatrix.h> | 19 | #include <qwmatrix.h> |
20 | #include <qtextbrowser.h> | 20 | #include <qtextbrowser.h> |
21 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
22 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
23 | #include <qpe/global.h> | 23 | #include <qpe/global.h> |
24 | #include <qpe/qpemenubar.h> | 24 | #include <qpe/qpemenubar.h> |
25 | #include <qpe/qpetoolbar.h> | 25 | #include <qpe/qpetoolbar.h> |
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qtopia/alarmserver.h> | 28 | #include <qtopia/alarmserver.h> |
29 | #include <qtopia/qcopenvelope_qws.h> | 29 | #include <qtopia/qcopenvelope_qws.h> |
30 | #include <unistd.h> // for sleep | 30 | #include <unistd.h> // for sleep |
31 | #else | 31 | #else |
32 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
33 | #include <qtoolbar.h> | 33 | #include <qtoolbar.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | //#include <resource.h> | 35 | //#include <resource.h> |
36 | 36 | ||
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendarlocal.h> | 38 | #include <libkcal/calendarlocal.h> |
39 | #include <libkcal/todo.h> | 39 | #include <libkcal/todo.h> |
40 | #include <libkcal/phoneformat.h> | 40 | #include <libkcal/phoneformat.h> |
41 | #include <libkdepim/ksyncprofile.h> | 41 | #include <libkdepim/ksyncprofile.h> |
42 | #include <libkdepim/phoneaccess.h> | 42 | #include <libkdepim/phoneaccess.h> |
43 | #include <libkcal/kincidenceformatter.h> | 43 | #include <libkcal/kincidenceformatter.h> |
44 | #include <libkdepim/kpimglobalprefs.h> | 44 | #include <libkdepim/kpimglobalprefs.h> |
45 | 45 | ||
46 | #include "calendarview.h" | 46 | #include "calendarview.h" |
47 | #include "koviewmanager.h" | 47 | #include "koviewmanager.h" |
48 | #include "datenavigator.h" | 48 | #include "datenavigator.h" |
49 | #include "koagendaview.h" | 49 | #include "koagendaview.h" |
50 | #include "koagenda.h" | 50 | #include "koagenda.h" |
51 | #include "kodialogmanager.h" | 51 | #include "kodialogmanager.h" |
52 | #include "kdialogbase.h" | 52 | #include "kdialogbase.h" |
53 | #include "kapplication.h" | 53 | #include "kapplication.h" |
54 | #include "kofilterview.h" | 54 | #include "kofilterview.h" |
55 | #include "kstandarddirs.h" | 55 | #include "kstandarddirs.h" |
56 | #include "koprefs.h" | 56 | #include "koprefs.h" |
57 | #include "kfiledialog.h" | 57 | #include "kfiledialog.h" |
58 | #include "koglobals.h" | 58 | #include "koglobals.h" |
59 | #include "kglobal.h" | 59 | #include "kglobal.h" |
60 | #include "klocale.h" | 60 | #include "klocale.h" |
61 | #include "kconfig.h" | 61 | #include "kconfig.h" |
62 | #include "simplealarmclient.h" | 62 | #include "simplealarmclient.h" |
63 | #include "externalapphandler.h" | 63 | #include "externalapphandler.h" |
64 | 64 | ||
65 | using namespace KCal; | 65 | using namespace KCal; |
66 | #ifndef _WIN32_ | 66 | #ifndef _WIN32_ |
67 | #include <unistd.h> | 67 | #include <unistd.h> |
68 | #else | 68 | #else |
69 | #ifdef _OL_IMPORT_ | 69 | #ifdef _OL_IMPORT_ |
70 | #include "koimportoldialog.h" | 70 | #include "koimportoldialog.h" |
71 | #endif | 71 | #endif |
72 | #endif | 72 | #endif |
73 | #include "mainwindow.h" | 73 | #include "mainwindow.h" |
74 | 74 | ||
75 | 75 | ||
76 | class KOex2phonePrefs : public QDialog | 76 | class KOex2phonePrefs : public QDialog |
77 | { | 77 | { |
78 | public: | 78 | public: |
79 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 79 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
80 | QDialog( parent, name, true ) | 80 | QDialog( parent, name, true ) |
81 | { | 81 | { |
82 | setCaption( i18n("Export to phone options") ); | 82 | setCaption( i18n("Export to phone options") ); |
83 | QVBoxLayout* lay = new QVBoxLayout( this ); | 83 | QVBoxLayout* lay = new QVBoxLayout( this ); |
84 | lay->setSpacing( 3 ); | 84 | lay->setSpacing( 3 ); |
85 | lay->setMargin( 3 ); | 85 | lay->setMargin( 3 ); |
86 | QLabel *lab; | 86 | QLabel *lab; |
87 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 87 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
88 | lab->setAlignment (AlignHCenter ); | 88 | lab->setAlignment (AlignHCenter ); |
89 | QHBox* temphb; | 89 | QHBox* temphb; |
90 | temphb = new QHBox( this ); | 90 | temphb = new QHBox( this ); |
91 | new QLabel( i18n("I/O device: "), temphb ); | 91 | new QLabel( i18n("I/O device: "), temphb ); |
92 | mPhoneDevice = new QLineEdit( temphb); | 92 | mPhoneDevice = new QLineEdit( temphb); |
93 | lay->addWidget( temphb ); | 93 | lay->addWidget( temphb ); |
94 | temphb = new QHBox( this ); | 94 | temphb = new QHBox( this ); |
95 | new QLabel( i18n("Connection: "), temphb ); | 95 | new QLabel( i18n("Connection: "), temphb ); |
96 | mPhoneConnection = new QLineEdit( temphb); | 96 | mPhoneConnection = new QLineEdit( temphb); |
97 | lay->addWidget( temphb ); | 97 | lay->addWidget( temphb ); |
98 | temphb = new QHBox( this ); | 98 | temphb = new QHBox( this ); |
99 | new QLabel( i18n("Model(opt.): "), temphb ); | 99 | new QLabel( i18n("Model(opt.): "), temphb ); |
100 | mPhoneModel = new QLineEdit( temphb); | 100 | mPhoneModel = new QLineEdit( temphb); |
101 | lay->addWidget( temphb ); | 101 | lay->addWidget( temphb ); |
102 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 102 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
103 | mWriteBackFuture->setChecked( true ); | 103 | mWriteBackFuture->setChecked( true ); |
104 | lay->addWidget( mWriteBackFuture ); | 104 | lay->addWidget( mWriteBackFuture ); |
105 | temphb = new QHBox( this ); | 105 | temphb = new QHBox( this ); |
106 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 106 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
107 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 107 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
108 | mWriteBackFutureWeeks->setValue( 8 ); | 108 | mWriteBackFutureWeeks->setValue( 8 ); |
109 | lay->addWidget( temphb ); | 109 | lay->addWidget( temphb ); |
110 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 110 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
111 | lab->setAlignment (AlignHCenter ); | 111 | lab->setAlignment (AlignHCenter ); |
112 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 112 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
113 | lay->addWidget( ok ); | 113 | lay->addWidget( ok ); |
114 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 114 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
115 | lay->addWidget( cancel ); | 115 | lay->addWidget( cancel ); |
116 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 116 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
117 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 117 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
118 | resize( 220, 240 ); | 118 | resize( 220, 240 ); |
119 | qApp->processEvents(); | 119 | qApp->processEvents(); |
120 | int dw = QApplication::desktop()->width(); | 120 | int dw = QApplication::desktop()->width(); |
121 | int dh = QApplication::desktop()->height(); | 121 | int dh = QApplication::desktop()->height(); |
122 | move( (dw-width())/2, (dh - height() )/2 ); | 122 | move( (dw-width())/2, (dh - height() )/2 ); |
123 | } | 123 | } |
124 | 124 | ||
125 | public: | 125 | public: |
126 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 126 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
127 | QCheckBox* mWriteBackFuture; | 127 | QCheckBox* mWriteBackFuture; |
128 | QSpinBox* mWriteBackFutureWeeks; | 128 | QSpinBox* mWriteBackFutureWeeks; |
129 | }; | 129 | }; |
130 | 130 | ||
131 | int globalFlagBlockStartup; | 131 | int globalFlagBlockStartup; |
132 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 132 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
133 | QMainWindow( parent, name ) | 133 | QMainWindow( parent, name ) |
134 | { | 134 | { |
135 | 135 | ||
136 | mClosed = false; | 136 | mClosed = false; |
137 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 137 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
138 | QString confFile = locateLocal("config","korganizerrc"); | 138 | QString confFile = locateLocal("config","korganizerrc"); |
139 | QFileInfo finf ( confFile ); | 139 | QFileInfo finf ( confFile ); |
140 | bool showWarning = !finf.exists(); | 140 | bool showWarning = !finf.exists(); |
141 | setIcon(SmallIcon( "ko24" ) ); | 141 | setIcon(SmallIcon( "ko24" ) ); |
142 | mBlockAtStartup = true; | 142 | mBlockAtStartup = true; |
143 | mFlagKeyPressed = false; | 143 | mFlagKeyPressed = false; |
144 | setCaption("KO/Pi"); | 144 | setCaption("KO/Pi"); |
145 | KOPrefs *p = KOPrefs::instance(); | 145 | KOPrefs *p = KOPrefs::instance(); |
146 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 146 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
147 | if ( p->mHourSize > 22 ) | 147 | if ( p->mHourSize > 22 ) |
148 | p->mHourSize = 22; | 148 | p->mHourSize = 22; |
149 | QMainWindow::ToolBarDock tbd; | 149 | QMainWindow::ToolBarDock tbd; |
150 | if ( p->mToolBarHor ) { | 150 | if ( p->mToolBarHor ) { |
151 | if ( p->mToolBarUp ) | 151 | if ( p->mToolBarUp ) |
152 | tbd = Bottom; | 152 | tbd = Bottom; |
153 | else | 153 | else |
154 | tbd = Top; | 154 | tbd = Top; |
155 | } | 155 | } |
156 | else { | 156 | else { |
157 | if ( p->mToolBarUp ) | 157 | if ( p->mToolBarUp ) |
158 | tbd = Right; | 158 | tbd = Right; |
159 | else | 159 | else |
160 | tbd = Left; | 160 | tbd = Left; |
161 | } | 161 | } |
162 | if ( KOPrefs::instance()->mUseAppColors ) | 162 | if ( KOPrefs::instance()->mUseAppColors ) |
163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 163 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
164 | globalFlagBlockStartup = 1; | 164 | globalFlagBlockStartup = 1; |
165 | iconToolBar = new QPEToolBar( this ); | 165 | iconToolBar = new QPEToolBar( this ); |
166 | addToolBar (iconToolBar , tbd ); | 166 | addToolBar (iconToolBar , tbd ); |
167 | mCalendarModifiedFlag = false; | 167 | mCalendarModifiedFlag = false; |
168 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); | 168 | QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); |
169 | splash->setAlignment ( AlignCenter ); | 169 | splash->setAlignment ( AlignCenter ); |
170 | setCentralWidget( splash ); | 170 | setCentralWidget( splash ); |
171 | #ifndef DESKTOP_VERSION | 171 | #ifndef DESKTOP_VERSION |
172 | showMaximized(); | 172 | showMaximized(); |
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); | 175 | //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); |
176 | setDefaultPreferences(); | 176 | setDefaultPreferences(); |
177 | mCalendar = new CalendarLocal(); | 177 | mCalendar = new CalendarLocal(); |
178 | mView = new CalendarView( mCalendar, this,"mCalendar " ); | 178 | mView = new CalendarView( mCalendar, this,"mCalendar " ); |
179 | mView->hide(); | 179 | mView->hide(); |
180 | //mView->resize(splash->size() ); | 180 | //mView->resize(splash->size() ); |
181 | initActions(); | 181 | initActions(); |
182 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); | 182 | mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); |
183 | mSyncManager->setBlockSave(false); | 183 | mSyncManager->setBlockSave(false); |
184 | mView->setSyncManager(mSyncManager); | 184 | mView->setSyncManager(mSyncManager); |
185 | #ifndef DESKTOP_VERSION | 185 | #ifndef DESKTOP_VERSION |
186 | iconToolBar->show(); | 186 | iconToolBar->show(); |
187 | qApp->processEvents(); | 187 | qApp->processEvents(); |
188 | #endif | 188 | #endif |
189 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); | 189 | //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); |
190 | int vh = height() ; | 190 | int vh = height() ; |
191 | int vw = width(); | 191 | int vw = width(); |
192 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); | 192 | //qDebug("Toolbar hei %d ",iconToolBar->height() ); |
193 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 193 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
194 | vh -= iconToolBar->height(); | 194 | vh -= iconToolBar->height(); |
195 | } else { | 195 | } else { |
196 | vw -= iconToolBar->height(); | 196 | vw -= iconToolBar->height(); |
197 | } | 197 | } |
198 | //mView->setMaximumSize( splash->size() ); | 198 | //mView->setMaximumSize( splash->size() ); |
199 | //mView->resize( splash->size() ); | 199 | //mView->resize( splash->size() ); |
200 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 200 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
201 | mView->readSettings(); | 201 | mView->readSettings(); |
202 | bool newFile = false; | 202 | bool newFile = false; |
203 | if( !QFile::exists( defaultFileName() ) ) { | 203 | if( !QFile::exists( defaultFileName() ) ) { |
204 | QFileInfo finfo ( defaultFileName() ); | 204 | QFileInfo finfo ( defaultFileName() ); |
205 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); | 205 | QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); |
206 | qDebug("oldfile %s ", oldFile.latin1()); | 206 | qDebug("oldfile %s ", oldFile.latin1()); |
207 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; | 207 | QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; |
208 | finfo.setFile( oldFile ); | 208 | finfo.setFile( oldFile ); |
209 | if (finfo.exists() ) { | 209 | if (finfo.exists() ) { |
210 | KMessageBox::information( this, message); | 210 | KMessageBox::information( this, message); |
211 | mView->openCalendar( oldFile ); | 211 | mView->openCalendar( oldFile ); |
212 | qApp->processEvents(); | 212 | qApp->processEvents(); |
213 | } else { | 213 | } else { |
214 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); | 214 | oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); |
215 | finfo.setFile( oldFile ); | 215 | finfo.setFile( oldFile ); |
216 | if (finfo.exists() ) { | 216 | if (finfo.exists() ) { |
217 | KMessageBox::information( this, message); | 217 | KMessageBox::information( this, message); |
218 | mView->openCalendar( oldFile ); | 218 | mView->openCalendar( oldFile ); |
219 | qApp->processEvents(); | 219 | qApp->processEvents(); |
220 | } | 220 | } |
221 | } | 221 | } |
222 | mView->saveCalendar( defaultFileName() ); | 222 | mView->saveCalendar( defaultFileName() ); |
223 | newFile = true; | 223 | newFile = true; |
224 | } | 224 | } |
225 | 225 | ||
226 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 226 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
227 | mView->openCalendar( defaultFileName() ); | 227 | mView->openCalendar( defaultFileName() ); |
228 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 228 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
229 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); | 229 | qDebug("KO: Calendar loading time: %d ms",msNeeded ); |
230 | 230 | ||
231 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { | 231 | if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { |
232 | KOPrefs::instance()->setAllDefaults(); | 232 | KOPrefs::instance()->setAllDefaults(); |
233 | int count = mView->addCategories(); | 233 | int count = mView->addCategories(); |
234 | } | 234 | } |
235 | processIncidenceSelection( 0 ); | 235 | processIncidenceSelection( 0 ); |
236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), | 236 | connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), |
237 | SLOT( processIncidenceSelection( Incidence * ) ) ); | 237 | SLOT( processIncidenceSelection( Incidence * ) ) ); |
238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), | 238 | connect( mView, SIGNAL( modifiedChanged( bool ) ), |
239 | SLOT( slotModifiedChanged( bool ) ) ); | 239 | SLOT( slotModifiedChanged( bool ) ) ); |
240 | 240 | ||
241 | 241 | ||
242 | connect( mView, SIGNAL( tempDisableBR(bool) ), | 242 | connect( mView, SIGNAL( tempDisableBR(bool) ), |
243 | SLOT( disableBR(bool) ) ); | 243 | SLOT( disableBR(bool) ) ); |
244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); | 244 | connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); |
245 | mView->setModified( false ); | 245 | mView->setModified( false ); |
246 | mBlockAtStartup = false; | 246 | mBlockAtStartup = false; |
247 | mView->setModified( false ); | 247 | mView->setModified( false ); |
248 | setCentralWidget( mView ); | 248 | setCentralWidget( mView ); |
249 | globalFlagBlockStartup = 0; | 249 | globalFlagBlockStartup = 0; |
250 | mView->show(); | 250 | mView->show(); |
251 | delete splash; | 251 | delete splash; |
252 | if ( newFile ) | 252 | if ( newFile ) |
253 | mView->updateConfig(); | 253 | mView->updateConfig(); |
254 | // qApp->processEvents(); | 254 | // qApp->processEvents(); |
255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); | 255 | //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); |
256 | //fillSyncMenu(); | 256 | //fillSyncMenu(); |
257 | 257 | ||
258 | 258 | ||
259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); | 259 | connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); |
260 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); | 260 | connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); |
261 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); | 261 | connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); |
262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); | 262 | connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); |
263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); | 263 | connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); |
264 | mSyncManager->setDefaultFileName( sentSyncFile()); | 264 | mSyncManager->setDefaultFileName( sentSyncFile()); |
265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); | 265 | connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); |
266 | mSyncManager->fillSyncMenu(); | 266 | mSyncManager->fillSyncMenu(); |
267 | 267 | ||
268 | 268 | ||
269 | 269 | ||
270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); | 270 | mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); |
271 | if ( showWarning ) { | 271 | if ( showWarning ) { |
272 | KMessageBox::information( this, | 272 | KMessageBox::information( this, |
273 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); | 273 | "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); |
274 | qApp->processEvents(); | 274 | qApp->processEvents(); |
275 | mView->dialogManager()->showSyncOptions(); | 275 | mView->dialogManager()->showSyncOptions(); |
276 | } | 276 | } |
277 | 277 | ||
278 | //US listen for result adressed from Ka/Pi | 278 | //US listen for result adressed from Ka/Pi |
279 | #ifndef DESKTOP_VERSION | 279 | #ifndef DESKTOP_VERSION |
280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 280 | connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
281 | #endif | 281 | #endif |
282 | #ifndef DESKTOP_VERSION | 282 | #ifndef DESKTOP_VERSION |
283 | infrared = 0; | 283 | infrared = 0; |
284 | #endif | 284 | #endif |
285 | updateWeek( mView->startDate() ); | 285 | updateWeek( mView->startDate() ); |
286 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), | 286 | connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), |
287 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); | 287 | SLOT( updateWeekNum( const KCal::DateList & ) ) ); |
288 | mBRdisabled = false; | 288 | mBRdisabled = false; |
289 | //toggleBeamReceive(); | 289 | //toggleBeamReceive(); |
290 | } | 290 | } |
291 | MainWindow::~MainWindow() | 291 | MainWindow::~MainWindow() |
292 | { | 292 | { |
293 | //qDebug("MainWindow::~MainWindow() "); | 293 | //qDebug("MainWindow::~MainWindow() "); |
294 | //save toolbar location | 294 | //save toolbar location |
295 | delete mCalendar; | 295 | delete mCalendar; |
296 | delete mSyncManager; | 296 | delete mSyncManager; |
297 | #ifndef DESKTOP_VERSION | 297 | #ifndef DESKTOP_VERSION |
298 | if ( infrared ) | 298 | if ( infrared ) |
299 | delete infrared; | 299 | delete infrared; |
300 | #endif | 300 | #endif |
301 | 301 | ||
302 | 302 | ||
303 | } | 303 | } |
304 | 304 | ||
305 | void MainWindow::disableBR(bool b) | 305 | void MainWindow::disableBR(bool b) |
306 | { | 306 | { |
307 | #ifndef DESKTOP_VERSION | 307 | #ifndef DESKTOP_VERSION |
308 | if ( b ) { | 308 | if ( b ) { |
309 | if ( infrared ) { | 309 | if ( infrared ) { |
310 | toggleBeamReceive(); | 310 | toggleBeamReceive(); |
311 | mBRdisabled = true; | 311 | mBRdisabled = true; |
312 | } | 312 | } |
313 | mBRdisabled = true; | 313 | mBRdisabled = true; |
314 | } else { | 314 | } else { |
315 | if ( mBRdisabled ) { | 315 | if ( mBRdisabled ) { |
316 | mBRdisabled = false; | 316 | mBRdisabled = false; |
317 | //makes no sense,because other cal ap is probably running | 317 | //makes no sense,because other cal ap is probably running |
318 | // toggleBeamReceive(); | 318 | // toggleBeamReceive(); |
319 | } | 319 | } |
320 | } | 320 | } |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | } | 323 | } |
324 | bool MainWindow::beamReceiveEnabled() | 324 | bool MainWindow::beamReceiveEnabled() |
325 | { | 325 | { |
326 | #ifndef DESKTOP_VERSION | 326 | #ifndef DESKTOP_VERSION |
327 | return ( infrared != 0 ); | 327 | return ( infrared != 0 ); |
328 | #endif | 328 | #endif |
329 | return false; | 329 | return false; |
330 | } | 330 | } |
331 | 331 | ||
332 | void MainWindow::toggleBeamReceive() | 332 | void MainWindow::toggleBeamReceive() |
333 | { | 333 | { |
334 | if ( mBRdisabled ) | 334 | if ( mBRdisabled ) |
335 | return; | 335 | return; |
336 | #ifndef DESKTOP_VERSION | 336 | #ifndef DESKTOP_VERSION |
337 | if ( infrared ) { | 337 | if ( infrared ) { |
338 | qDebug("disable BeamReceive "); | 338 | qDebug("disable BeamReceive "); |
339 | delete infrared; | 339 | delete infrared; |
340 | infrared = 0; | 340 | infrared = 0; |
341 | brAction->setOn(false); | 341 | brAction->setOn(false); |
342 | return; | 342 | return; |
343 | } | 343 | } |
344 | qDebug("enable BeamReceive "); | 344 | qDebug("enable BeamReceive "); |
345 | brAction->setOn(true); | 345 | brAction->setOn(true); |
346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; | 346 | infrared = new QCopChannel("QPE/Application/datebook",this, "channel" ) ; |
347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); | 347 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(recieve( const QCString&, const QByteArray& ))); |
348 | #endif | 348 | #endif |
349 | } | 349 | } |
350 | void MainWindow::showMaximized () | 350 | void MainWindow::showMaximized () |
351 | { | 351 | { |
352 | #ifndef DESKTOP_VERSION | 352 | #ifndef DESKTOP_VERSION |
353 | if ( ! globalFlagBlockStartup ) | 353 | if ( ! globalFlagBlockStartup ) |
354 | if ( mClosed ) | 354 | if ( mClosed ) |
355 | mView->goToday(); | 355 | mView->goToday(); |
356 | #endif | 356 | #endif |
357 | QWidget::showMaximized () ; | 357 | QWidget::showMaximized () ; |
358 | mClosed = false; | 358 | mClosed = false; |
359 | } | 359 | } |
360 | void MainWindow::closeEvent( QCloseEvent* ce ) | 360 | void MainWindow::closeEvent( QCloseEvent* ce ) |
361 | { | 361 | { |
362 | 362 | ||
363 | 363 | ||
364 | 364 | ||
365 | if ( ! KOPrefs::instance()->mAskForQuit ) { | 365 | if ( ! KOPrefs::instance()->mAskForQuit ) { |
366 | saveOnClose(); | 366 | saveOnClose(); |
367 | mClosed = true; | 367 | mClosed = true; |
368 | ce->accept(); | 368 | ce->accept(); |
369 | return; | 369 | return; |
370 | 370 | ||
371 | } | 371 | } |
372 | 372 | ||
373 | switch( QMessageBox::information( this, "KO/Pi", | 373 | switch( QMessageBox::information( this, "KO/Pi", |
374 | i18n("Do you really want\nto close KO/Pi?"), | 374 | i18n("Do you really want\nto close KO/Pi?"), |
375 | i18n("Close"), i18n("No"), | 375 | i18n("Close"), i18n("No"), |
376 | 0, 0 ) ) { | 376 | 0, 0 ) ) { |
377 | case 0: | 377 | case 0: |
378 | saveOnClose(); | 378 | saveOnClose(); |
379 | mClosed = true; | 379 | mClosed = true; |
380 | ce->accept(); | 380 | ce->accept(); |
381 | break; | 381 | break; |
382 | case 1: | 382 | case 1: |
383 | ce->ignore(); | 383 | ce->ignore(); |
384 | break; | 384 | break; |
385 | case 2: | 385 | case 2: |
386 | 386 | ||
387 | default: | 387 | default: |
388 | break; | 388 | break; |
389 | } | 389 | } |
390 | 390 | ||
391 | 391 | ||
392 | } | 392 | } |
393 | 393 | ||
394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | 394 | void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) |
395 | { | 395 | { |
396 | QDataStream stream( data, IO_ReadOnly ); | 396 | QDataStream stream( data, IO_ReadOnly ); |
397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); | 397 | // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); |
398 | //QString datamess; | 398 | //QString datamess; |
399 | //qDebug("message "); | 399 | //qDebug("message "); |
400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); | 400 | qDebug("KO: QCOP message received: %s ", cmsg.data() ); |
401 | 401 | ||
402 | if ( cmsg == "setDocument(QString)" ) { | 402 | if ( cmsg == "setDocument(QString)" ) { |
403 | QDataStream stream( data, IO_ReadOnly ); | 403 | QDataStream stream( data, IO_ReadOnly ); |
404 | QString fileName; | 404 | QString fileName; |
405 | stream >> fileName; | 405 | stream >> fileName; |
406 | //qDebug("filename %s ", fileName.latin1()); | 406 | //qDebug("filename %s ", fileName.latin1()); |
407 | showMaximized(); | 407 | showMaximized(); |
408 | raise(); | 408 | raise(); |
409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; | 409 | KOPrefs::instance()->mLastSyncedLocalFile = fileName ; |
410 | mSyncManager->slotSyncMenu( 1002 ); | 410 | mSyncManager->slotSyncMenu( 1002 ); |
411 | return; | 411 | return; |
412 | } | 412 | } |
413 | 413 | ||
414 | if ( cmsg == "-writeFile" ) { | 414 | if ( cmsg == "-writeFile" ) { |
415 | // I made from the "-writeFile" an "-writeAlarm" | 415 | // I made from the "-writeFile" an "-writeAlarm" |
416 | mView->viewManager()->showWhatsNextView(); | 416 | mView->viewManager()->showWhatsNextView(); |
417 | mCalendar->checkAlarmForIncidence( 0, true); | 417 | mCalendar->checkAlarmForIncidence( 0, true); |
418 | showMaximized(); | 418 | showMaximized(); |
419 | raise(); | 419 | raise(); |
420 | return; | 420 | return; |
421 | 421 | ||
422 | } | 422 | } |
423 | if ( cmsg == "-writeFileSilent" ) { | 423 | if ( cmsg == "-writeFileSilent" ) { |
424 | // I made from the "-writeFile" an "-writeAlarm" | 424 | // I made from the "-writeFile" an "-writeAlarm" |
425 | // mView->viewManager()->showWhatsNextView(); | 425 | // mView->viewManager()->showWhatsNextView(); |
426 | mCalendar->checkAlarmForIncidence( 0, true); | 426 | mCalendar->checkAlarmForIncidence( 0, true); |
427 | //showMaximized(); | 427 | //showMaximized(); |
428 | //raise(); | 428 | //raise(); |
429 | hide(); | 429 | hide(); |
430 | return; | 430 | return; |
431 | } | 431 | } |
432 | if ( cmsg == "-newCountdown" ) { | 432 | if ( cmsg == "-newCountdown" ) { |
433 | qDebug("newCountdown "); | 433 | qDebug("newCountdown "); |
434 | 434 | ||
435 | } | 435 | } |
436 | QString msg ; | 436 | QString msg ; |
437 | QString allmsg = cmsg; | 437 | QString allmsg = cmsg; |
438 | while ( allmsg.length() > 0 ) { | 438 | while ( allmsg.length() > 0 ) { |
439 | int nextC = allmsg.find( "-", 1 ); | 439 | int nextC = allmsg.find( "-", 1 ); |
440 | if ( nextC == -1 ) { | 440 | if ( nextC == -1 ) { |
441 | msg = allmsg; | 441 | msg = allmsg; |
442 | allmsg = ""; | 442 | allmsg = ""; |
443 | } else{ | 443 | } else{ |
444 | msg = allmsg.left( nextC ); | 444 | msg = allmsg.left( nextC ); |
445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); | 445 | allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); |
446 | } | 446 | } |
447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); | 447 | //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); |
448 | if ( msg == "-newEvent" ) { | 448 | if ( msg == "-newEvent" ) { |
449 | mView->newEvent(); | 449 | mView->newEvent(); |
450 | } | 450 | } |
451 | if ( msg == "-newTodo" ) { | 451 | if ( msg == "-newTodo" ) { |
452 | mView->newTodo(); | 452 | mView->newTodo(); |
453 | 453 | ||
454 | } | 454 | } |
455 | if ( msg == "-showWN" ) { | 455 | if ( msg == "-showWN" ) { |
456 | mView->viewManager()->showWhatsNextView(); | 456 | mView->viewManager()->showWhatsNextView(); |
457 | } | 457 | } |
458 | if ( msg == "-showTodo" ) { | 458 | if ( msg == "-showTodo" ) { |
459 | mView->viewManager()->showTodoView(); | 459 | mView->viewManager()->showTodoView(); |
460 | } | 460 | } |
461 | if ( msg == "-showList" ) { | 461 | if ( msg == "-showList" ) { |
462 | mView->viewManager()->showListView(); | 462 | mView->viewManager()->showListView(); |
463 | } | 463 | } |
464 | else if ( msg == "-showDay" ) { | 464 | else if ( msg == "-showDay" ) { |
465 | mView->viewManager()->showDayView(); | 465 | mView->viewManager()->showDayView(); |
466 | } | 466 | } |
467 | else if ( msg == "-showWWeek" ) { | 467 | else if ( msg == "-showWWeek" ) { |
468 | mView->viewManager()->showWorkWeekView(); | 468 | mView->viewManager()->showWorkWeekView(); |
469 | } | 469 | } |
470 | else if ( msg == "-ringSync" ) { | 470 | else if ( msg == "-ringSync" ) { |
471 | mSyncManager->multiSync( false ); | 471 | mSyncManager->multiSync( false ); |
472 | } | 472 | } |
473 | else if ( msg == "-showWeek" ) { | 473 | else if ( msg == "-showWeek" ) { |
474 | mView->viewManager()->showWeekView(); | 474 | mView->viewManager()->showWeekView(); |
475 | } | 475 | } |
476 | else if ( msg == "-showTodo" ) { | 476 | else if ( msg == "-showTodo" ) { |
477 | mView->viewManager()->showTodoView(); | 477 | mView->viewManager()->showTodoView(); |
478 | } | 478 | } |
479 | else if ( msg == "-showJournal" ) { | 479 | else if ( msg == "-showJournal" ) { |
480 | mView->dateNavigator()->selectDates( 1 ); | 480 | mView->dateNavigator()->selectDates( 1 ); |
481 | mView->dateNavigator()->selectToday(); | 481 | mView->dateNavigator()->selectToday(); |
482 | mView->viewManager()->showJournalView(); | 482 | mView->viewManager()->showJournalView(); |
483 | } | 483 | } |
484 | else if ( msg == "-showKO" ) { | 484 | else if ( msg == "-showKO" ) { |
485 | mView->viewManager()->showNextXView(); | 485 | mView->viewManager()->showNextXView(); |
486 | } | 486 | } |
487 | else if ( msg == "-showWNext" ) { | 487 | else if ( msg == "-showWNext" ) { |
488 | mView->viewManager()->showWhatsNextView(); | 488 | mView->viewManager()->showWhatsNextView(); |
489 | } | 489 | } |
490 | else if ( msg == "nextView()" ) { | 490 | else if ( msg == "nextView()" ) { |
491 | mView->viewManager()->showNextView(); | 491 | mView->viewManager()->showNextView(); |
492 | } | 492 | } |
493 | else if ( msg == "-showNextXView" ) { | 493 | else if ( msg == "-showNextXView" ) { |
494 | mView->viewManager()->showNextXView(); | 494 | mView->viewManager()->showNextXView(); |
495 | } | 495 | } |
496 | 496 | ||
497 | 497 | ||
498 | } | 498 | } |
499 | 499 | ||
500 | showMaximized(); | 500 | showMaximized(); |
501 | raise(); | 501 | raise(); |
502 | } | 502 | } |
503 | 503 | ||
504 | QPixmap MainWindow::loadPixmap( QString name ) | 504 | QPixmap MainWindow::loadPixmap( QString name ) |
505 | { | 505 | { |
506 | return SmallIcon( name ); | 506 | return SmallIcon( name ); |
507 | 507 | ||
508 | } | 508 | } |
509 | void MainWindow::initActions() | 509 | void MainWindow::initActions() |
510 | { | 510 | { |
511 | //KOPrefs::instance()->mShowFullMenu | 511 | //KOPrefs::instance()->mShowFullMenu |
512 | iconToolBar->clear(); | 512 | iconToolBar->clear(); |
513 | KOPrefs *p = KOPrefs::instance(); | 513 | KOPrefs *p = KOPrefs::instance(); |
514 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 514 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
515 | 515 | ||
516 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 516 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
517 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 517 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
518 | QPopupMenu *importMenu = new QPopupMenu( this ); | 518 | QPopupMenu *importMenu = new QPopupMenu( this ); |
519 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 519 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
520 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 520 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
521 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 521 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
522 | selectFilterMenu = new QPopupMenu( this ); | 522 | selectFilterMenu = new QPopupMenu( this ); |
523 | selectFilterMenu->setCheckable( true ); | 523 | selectFilterMenu->setCheckable( true ); |
524 | syncMenu = new QPopupMenu( this ); | 524 | syncMenu = new QPopupMenu( this ); |
525 | configureAgendaMenu = new QPopupMenu( this ); | 525 | configureAgendaMenu = new QPopupMenu( this ); |
526 | configureToolBarMenu = new QPopupMenu( this ); | 526 | configureToolBarMenu = new QPopupMenu( this ); |
527 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 527 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
528 | QIconSet icon; | 528 | QIconSet icon; |
529 | int pixWid = 22, pixHei = 22; | 529 | int pixWid = 22, pixHei = 22; |
530 | QString pathString = ""; | 530 | QString pathString = ""; |
531 | if ( !p->mToolBarMiniIcons ) { | 531 | if ( !p->mToolBarMiniIcons ) { |
532 | if ( QApplication::desktop()->width() < 480 ) { | 532 | if ( QApplication::desktop()->width() < 480 ) { |
533 | pathString += "icons16/"; | 533 | pathString += "icons16/"; |
534 | pixWid = 18; pixHei = 16; | 534 | pixWid = 18; pixHei = 16; |
535 | } | 535 | } |
536 | } else { | 536 | } else { |
537 | pathString += "iconsmini/"; | 537 | pathString += "iconsmini/"; |
538 | pixWid = 18; pixHei = 16; | 538 | pixWid = 18; pixHei = 16; |
539 | } | 539 | } |
540 | if ( KOPrefs::instance()->mShowFullMenu ) { | 540 | if ( KOPrefs::instance()->mShowFullMenu ) { |
541 | QMenuBar *menuBar1; | 541 | QMenuBar *menuBar1; |
542 | menuBar1 = menuBar(); | 542 | menuBar1 = menuBar(); |
543 | menuBar1->insertItem( i18n("File"), importMenu ); | 543 | menuBar1->insertItem( i18n("File"), importMenu ); |
544 | menuBar1->insertItem( i18n("View"), viewMenu ); | 544 | menuBar1->insertItem( i18n("View"), viewMenu ); |
545 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 545 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
546 | #ifdef DESKTOP_VERSION | 546 | #ifdef DESKTOP_VERSION |
547 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 547 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
548 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 548 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
549 | #else | 549 | #else |
550 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 550 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
551 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 551 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
552 | #endif | 552 | #endif |
553 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 553 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
554 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 554 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
555 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 555 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
556 | } else { | 556 | } else { |
557 | QPEMenuBar *menuBar1; | 557 | QPEMenuBar *menuBar1; |
558 | menuBar1 = new QPEMenuBar( iconToolBar ); | 558 | menuBar1 = new QPEMenuBar( iconToolBar ); |
559 | QPopupMenu *menuBar = new QPopupMenu( this ); | 559 | QPopupMenu *menuBar = new QPopupMenu( this ); |
560 | icon = loadPixmap( pathString + "z_menu" ); | 560 | icon = loadPixmap( pathString + "z_menu" ); |
561 | menuBar1->insertItem( icon.pixmap(), menuBar); | 561 | menuBar1->insertItem( icon.pixmap(), menuBar); |
562 | //menuBar1->insertItem( i18n("ME"), menuBar); | 562 | //menuBar1->insertItem( i18n("ME"), menuBar); |
563 | menuBar->insertItem( i18n("File"), importMenu ); | 563 | menuBar->insertItem( i18n("File"), importMenu ); |
564 | menuBar->insertItem( i18n("View"), viewMenu ); | 564 | menuBar->insertItem( i18n("View"), viewMenu ); |
565 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 565 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
566 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 566 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
567 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 567 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
568 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 568 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
569 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 569 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
570 | menuBar->insertItem( i18n("Help"), helpMenu ); | 570 | menuBar->insertItem( i18n("Help"), helpMenu ); |
571 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 571 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
572 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 572 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
573 | } | 573 | } |
574 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 574 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
575 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 575 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
576 | mWeekBgColor = iconToolBar->backgroundColor(); | 576 | mWeekBgColor = iconToolBar->backgroundColor(); |
577 | mWeekPixmap.resize( pixWid , pixHei ); | 577 | mWeekPixmap.resize( pixWid , pixHei ); |
578 | mWeekPixmap.fill( mWeekBgColor ); | 578 | mWeekPixmap.fill( mWeekBgColor ); |
579 | icon = mWeekPixmap; | 579 | icon = mWeekPixmap; |
580 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 580 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
581 | if ( p-> mShowIconWeekNum ) | 581 | if ( p-> mShowIconWeekNum ) |
582 | mWeekAction->addTo( iconToolBar ); | 582 | mWeekAction->addTo( iconToolBar ); |
583 | mWeekFont = font(); | 583 | mWeekFont = font(); |
584 | 584 | ||
585 | int fontPoint = mWeekFont.pointSize(); | 585 | int fontPoint = mWeekFont.pointSize(); |
586 | QFontMetrics f( mWeekFont ); | 586 | QFontMetrics f( mWeekFont ); |
587 | int fontWid = f.width( "30" ); | 587 | int fontWid = f.width( "30" ); |
588 | while ( fontWid > pixWid ) { | 588 | while ( fontWid > pixWid ) { |
589 | --fontPoint; | 589 | --fontPoint; |
590 | mWeekFont.setPointSize( fontPoint ); | 590 | mWeekFont.setPointSize( fontPoint ); |
591 | QFontMetrics f( mWeekFont ); | 591 | QFontMetrics f( mWeekFont ); |
592 | fontWid = f.width( "30" ); | 592 | fontWid = f.width( "30" ); |
593 | //qDebug("dec-- "); | 593 | //qDebug("dec-- "); |
594 | } | 594 | } |
595 | 595 | ||
596 | connect( mWeekAction, SIGNAL( activated() ), | 596 | connect( mWeekAction, SIGNAL( activated() ), |
597 | this, SLOT( weekAction() ) ); | 597 | this, SLOT( weekAction() ) ); |
598 | 598 | ||
599 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 599 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
600 | 600 | ||
601 | //#endif | 601 | //#endif |
602 | // ****************** | 602 | // ****************** |
603 | QAction *action; | 603 | QAction *action; |
604 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 604 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
605 | configureToolBarMenu->setCheckable( true ); | 605 | configureToolBarMenu->setCheckable( true ); |
606 | 606 | ||
607 | 607 | ||
608 | configureAgendaMenu->setCheckable( true ); | 608 | configureAgendaMenu->setCheckable( true ); |
609 | int iii ; | 609 | int iii ; |
610 | for ( iii = 1;iii<= 10 ;++iii ){ | 610 | for ( iii = 1;iii<= 10 ;++iii ){ |
611 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 611 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
612 | } | 612 | } |
613 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 613 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
614 | 614 | ||
615 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 615 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
616 | this, SLOT( showConfigureAgenda( ) ) ); | 616 | this, SLOT( showConfigureAgenda( ) ) ); |
617 | 617 | ||
618 | icon = loadPixmap( pathString + "configure" ); | 618 | icon = loadPixmap( pathString + "configure" ); |
619 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); | 619 | action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); |
620 | action->addTo( actionMenu ); | 620 | action->addTo( actionMenu ); |
621 | connect( action, SIGNAL( activated() ), | 621 | connect( action, SIGNAL( activated() ), |
622 | mView, SLOT( edit_options() ) ); | 622 | mView, SLOT( edit_options() ) ); |
623 | actionMenu->insertSeparator(); | 623 | actionMenu->insertSeparator(); |
624 | 624 | ||
625 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 625 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
626 | action->addTo( actionMenu ); | 626 | action->addTo( actionMenu ); |
627 | connect( action, SIGNAL( activated() ), | 627 | connect( action, SIGNAL( activated() ), |
628 | mView, SLOT( undo_delete() ) ); | 628 | mView, SLOT( undo_delete() ) ); |
629 | actionMenu->insertSeparator(); | 629 | actionMenu->insertSeparator(); |
630 | 630 | ||
631 | icon = loadPixmap( pathString + "newevent" ); | 631 | icon = loadPixmap( pathString + "newevent" ); |
632 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 632 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
633 | configureToolBarMenu->insertSeparator(); | 633 | configureToolBarMenu->insertSeparator(); |
634 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 634 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
635 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 635 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
636 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 636 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
637 | ne_action->addTo( actionMenu ); | 637 | ne_action->addTo( actionMenu ); |
638 | connect( ne_action, SIGNAL( activated() ), | 638 | connect( ne_action, SIGNAL( activated() ), |
639 | mView, SLOT( newEvent() ) ); | 639 | mView, SLOT( newEvent() ) ); |
640 | icon = loadPixmap( pathString + "newtodo" ); | 640 | icon = loadPixmap( pathString + "newtodo" ); |
641 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 641 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
642 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 642 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
643 | nt_action->addTo( actionMenu ); | 643 | nt_action->addTo( actionMenu ); |
644 | connect( nt_action, SIGNAL( activated() ), | 644 | connect( nt_action, SIGNAL( activated() ), |
645 | mView, SLOT( newTodo() ) ); | 645 | mView, SLOT( newTodo() ) ); |
646 | 646 | ||
647 | icon = loadPixmap( pathString + "today" ); | 647 | icon = loadPixmap( pathString + "today" ); |
648 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 648 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
649 | today_action->addTo( viewMenu ); | 649 | today_action->addTo( viewMenu ); |
650 | connect( today_action, SIGNAL( activated() ), | 650 | connect( today_action, SIGNAL( activated() ), |
651 | mView, SLOT( goToday() ) ); | 651 | mView, SLOT( goToday() ) ); |
652 | viewMenu->insertSeparator(); | 652 | viewMenu->insertSeparator(); |
653 | 653 | ||
654 | icon = loadPixmap( pathString + "navi" ); | 654 | icon = loadPixmap( pathString + "navi" ); |
655 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 655 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
656 | action->addTo( viewMenu ); | 656 | action->addTo( viewMenu ); |
657 | connect( action, SIGNAL( activated() ), | 657 | connect( action, SIGNAL( activated() ), |
658 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 658 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
659 | mToggleNav = action ; | 659 | mToggleNav = action ; |
660 | icon = loadPixmap( pathString + "filter" ); | 660 | icon = loadPixmap( pathString + "filter" ); |
661 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); | 661 | action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); |
662 | action->addTo( viewMenu ); | 662 | action->addTo( viewMenu ); |
663 | connect( action, SIGNAL( activated() ), | 663 | connect( action, SIGNAL( activated() ), |
664 | mView, SLOT( toggleFilter() ) ); | 664 | mView, SLOT( toggleFilter() ) ); |
665 | mToggleFilter = action; | 665 | mToggleFilter = action; |
666 | icon = loadPixmap( pathString + "allday" ); | 666 | icon = loadPixmap( pathString + "allday" ); |
667 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 667 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
668 | action->addTo( viewMenu ); | 668 | action->addTo( viewMenu ); |
669 | connect( action, SIGNAL( activated() ), | 669 | connect( action, SIGNAL( activated() ), |
670 | mView, SLOT( toggleAllDaySize() ) ); | 670 | mView, SLOT( toggleAllDaySize() ) ); |
671 | mToggleAllday = action; | 671 | mToggleAllday = action; |
672 | 672 | ||
673 | 673 | ||
674 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 674 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
675 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 675 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
676 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 676 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
677 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 677 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
678 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 678 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
679 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 679 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
680 | 680 | ||
681 | viewMenu->insertSeparator(); | 681 | viewMenu->insertSeparator(); |
682 | icon = loadPixmap( pathString + "picker" ); | 682 | icon = loadPixmap( pathString + "picker" ); |
683 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 683 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
684 | action->addTo( viewMenu ); | 684 | action->addTo( viewMenu ); |
685 | connect( action, SIGNAL( activated() ), | 685 | connect( action, SIGNAL( activated() ), |
686 | mView, SLOT( showDatePicker() ) ); | 686 | mView, SLOT( showDatePicker() ) ); |
687 | action->addTo( iconToolBar ); | 687 | action->addTo( iconToolBar ); |
688 | viewMenu->insertSeparator(); | 688 | viewMenu->insertSeparator(); |
689 | 689 | ||
690 | 690 | ||
691 | icon = loadPixmap( pathString + "whatsnext" ); | 691 | icon = loadPixmap( pathString + "whatsnext" ); |
692 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 692 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
693 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 693 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
694 | whatsnext_action->addTo( viewMenu ); | 694 | whatsnext_action->addTo( viewMenu ); |
695 | connect( whatsnext_action, SIGNAL( activated() ), | 695 | connect( whatsnext_action, SIGNAL( activated() ), |
696 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 696 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
697 | 697 | ||
698 | icon = loadPixmap( pathString + "xdays" ); | 698 | icon = loadPixmap( pathString + "xdays" ); |
699 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 699 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
700 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 700 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
701 | xdays_action->addTo( viewMenu ); | 701 | xdays_action->addTo( viewMenu ); |
702 | connect( xdays_action, SIGNAL( activated() ), | 702 | connect( xdays_action, SIGNAL( activated() ), |
703 | mView->viewManager(), SLOT( showNextXView() ) ); | 703 | mView->viewManager(), SLOT( showNextXView() ) ); |
704 | 704 | ||
705 | 705 | ||
706 | icon = loadPixmap( pathString + "journal" ); | 706 | icon = loadPixmap( pathString + "journal" ); |
707 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 707 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
708 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 708 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
709 | viewjournal_action->addTo( viewMenu ); | 709 | viewjournal_action->addTo( viewMenu ); |
710 | connect( viewjournal_action, SIGNAL( activated() ), | 710 | connect( viewjournal_action, SIGNAL( activated() ), |
711 | mView->viewManager(), SLOT( showJournalView() ) ); | 711 | mView->viewManager(), SLOT( showJournalView() ) ); |
712 | 712 | ||
713 | 713 | ||
714 | icon = loadPixmap( pathString + "day" ); | 714 | icon = loadPixmap( pathString + "day" ); |
715 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 715 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
716 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 716 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
717 | day1_action->addTo( viewMenu ); | 717 | day1_action->addTo( viewMenu ); |
718 | // action->addTo( toolBar ); | 718 | // action->addTo( toolBar ); |
719 | connect( day1_action, SIGNAL( activated() ), | 719 | connect( day1_action, SIGNAL( activated() ), |
720 | mView->viewManager(), SLOT( showDayView() ) ); | 720 | mView->viewManager(), SLOT( showDayView() ) ); |
721 | 721 | ||
722 | icon = loadPixmap( pathString + "workweek" ); | 722 | icon = loadPixmap( pathString + "workweek" ); |
723 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 723 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
724 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 724 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
725 | day5_action->addTo( viewMenu ); | 725 | day5_action->addTo( viewMenu ); |
726 | connect( day5_action, SIGNAL( activated() ), | 726 | connect( day5_action, SIGNAL( activated() ), |
727 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 727 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
728 | 728 | ||
729 | icon = loadPixmap( pathString + "week" ); | 729 | icon = loadPixmap( pathString + "week" ); |
730 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 730 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
731 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 731 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
732 | day7_action->addTo( viewMenu ); | 732 | day7_action->addTo( viewMenu ); |
733 | connect( day7_action, SIGNAL( activated() ), | 733 | connect( day7_action, SIGNAL( activated() ), |
734 | mView->viewManager(), SLOT( showWeekView() ) ); | 734 | mView->viewManager(), SLOT( showWeekView() ) ); |
735 | 735 | ||
736 | icon = loadPixmap( pathString + "workweek2" ); | 736 | icon = loadPixmap( pathString + "workweek2" ); |
737 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 737 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
738 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 738 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
739 | day6_action->addTo( viewMenu ); | 739 | day6_action->addTo( viewMenu ); |
740 | connect( day6_action, SIGNAL( activated() ), | 740 | connect( day6_action, SIGNAL( activated() ), |
741 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 741 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
742 | 742 | ||
743 | icon = loadPixmap( pathString + "month" ); | 743 | icon = loadPixmap( pathString + "month" ); |
744 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 744 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
745 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 745 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
746 | month_action->addTo( viewMenu ); | 746 | month_action->addTo( viewMenu ); |
747 | connect( month_action, SIGNAL( activated() ), | 747 | connect( month_action, SIGNAL( activated() ), |
748 | mView->viewManager(), SLOT( showMonthView() ) ); | 748 | mView->viewManager(), SLOT( showMonthView() ) ); |
749 | 749 | ||
750 | icon = loadPixmap( pathString + "list" ); | 750 | icon = loadPixmap( pathString + "list" ); |
751 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 751 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
752 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 752 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
753 | showlist_action->addTo( viewMenu ); | 753 | showlist_action->addTo( viewMenu ); |
754 | connect( showlist_action, SIGNAL( activated() ), | 754 | connect( showlist_action, SIGNAL( activated() ), |
755 | mView->viewManager(), SLOT( showListView() ) ); | 755 | mView->viewManager(), SLOT( showListView() ) ); |
756 | 756 | ||
757 | icon = loadPixmap( pathString + "todo" ); | 757 | icon = loadPixmap( pathString + "todo" ); |
758 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 758 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
759 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 759 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
760 | todoview_action->addTo( viewMenu ); | 760 | todoview_action->addTo( viewMenu ); |
761 | connect( todoview_action, SIGNAL( activated() ), | 761 | connect( todoview_action, SIGNAL( activated() ), |
762 | mView->viewManager(), SLOT( showTodoView() ) ); | 762 | mView->viewManager(), SLOT( showTodoView() ) ); |
763 | 763 | ||
764 | 764 | ||
765 | 765 | ||
766 | #if 0 | 766 | #if 0 |
767 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 767 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
768 | action->addTo( viewMenu ); | 768 | action->addTo( viewMenu ); |
769 | connect( action, SIGNAL( activated() ), | 769 | connect( action, SIGNAL( activated() ), |
770 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 770 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
771 | #endif | 771 | #endif |
772 | 772 | ||
773 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 773 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
774 | this ); | 774 | this ); |
775 | mNewSubTodoAction->addTo( actionMenu ); | 775 | mNewSubTodoAction->addTo( actionMenu ); |
776 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 776 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
777 | mView, SLOT( newSubTodo() ) ); | 777 | mView, SLOT( newSubTodo() ) ); |
778 | 778 | ||
779 | actionMenu->insertSeparator(); | 779 | actionMenu->insertSeparator(); |
780 | 780 | ||
781 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 781 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
782 | mShowAction->addTo( actionMenu ); | 782 | mShowAction->addTo( actionMenu ); |
783 | connect( mShowAction, SIGNAL( activated() ), | 783 | connect( mShowAction, SIGNAL( activated() ), |
784 | mView, SLOT( showIncidence() ) ); | 784 | mView, SLOT( showIncidence() ) ); |
785 | 785 | ||
786 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 786 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
787 | mEditAction->addTo( actionMenu ); | 787 | mEditAction->addTo( actionMenu ); |
788 | connect( mEditAction, SIGNAL( activated() ), | 788 | connect( mEditAction, SIGNAL( activated() ), |
789 | mView, SLOT( editIncidence() ) ); | 789 | mView, SLOT( editIncidence() ) ); |
790 | 790 | ||
791 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 791 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
792 | mDeleteAction->addTo( actionMenu ); | 792 | mDeleteAction->addTo( actionMenu ); |
793 | connect( mDeleteAction, SIGNAL( activated() ), | 793 | connect( mDeleteAction, SIGNAL( activated() ), |
794 | mView, SLOT( deleteIncidence() ) ); | 794 | mView, SLOT( deleteIncidence() ) ); |
795 | 795 | ||
796 | 796 | ||
797 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 797 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
798 | mCloneAction->addTo( actionMenu ); | 798 | mCloneAction->addTo( actionMenu ); |
799 | connect( mCloneAction, SIGNAL( activated() ), | 799 | connect( mCloneAction, SIGNAL( activated() ), |
800 | mView, SLOT( cloneIncidence() ) ); | 800 | mView, SLOT( cloneIncidence() ) ); |
801 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 801 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
802 | mMoveAction->addTo( actionMenu ); | 802 | mMoveAction->addTo( actionMenu ); |
803 | connect( mMoveAction, SIGNAL( activated() ), | 803 | connect( mMoveAction, SIGNAL( activated() ), |
804 | mView, SLOT( moveIncidence() ) ); | 804 | mView, SLOT( moveIncidence() ) ); |
805 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 805 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
806 | mBeamAction->addTo( actionMenu ); | 806 | mBeamAction->addTo( actionMenu ); |
807 | connect( mBeamAction, SIGNAL( activated() ), | 807 | connect( mBeamAction, SIGNAL( activated() ), |
808 | mView, SLOT( beamIncidence() ) ); | 808 | mView, SLOT( beamIncidence() ) ); |
809 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 809 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
810 | mCancelAction->addTo( actionMenu ); | 810 | mCancelAction->addTo( actionMenu ); |
811 | connect( mCancelAction, SIGNAL( activated() ), | 811 | connect( mCancelAction, SIGNAL( activated() ), |
812 | mView, SLOT( toggleCancelIncidence() ) ); | 812 | mView, SLOT( toggleCancelIncidence() ) ); |
813 | 813 | ||
814 | actionMenu->insertSeparator(); | 814 | actionMenu->insertSeparator(); |
815 | 815 | ||
816 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 816 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
817 | this ); | 817 | this ); |
818 | action->addTo( actionMenu ); | 818 | action->addTo( actionMenu ); |
819 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 819 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
820 | 820 | ||
821 | icon = loadPixmap( pathString + "search" ); | 821 | icon = loadPixmap( pathString + "search" ); |
822 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 822 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
823 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 823 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
824 | search_action->addTo( actionMenu ); | 824 | search_action->addTo( actionMenu ); |
825 | connect( search_action, SIGNAL( activated() ), | 825 | connect( search_action, SIGNAL( activated() ), |
826 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 826 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
827 | 827 | ||
828 | 828 | ||
829 | 829 | ||
830 | if ( KOPrefs::instance()->mShowFullMenu ) { | 830 | if ( KOPrefs::instance()->mShowFullMenu ) { |
831 | actionMenu->insertSeparator(); | 831 | actionMenu->insertSeparator(); |
832 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 832 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
833 | 833 | ||
834 | } | 834 | } |
835 | // actionMenu->insertSeparator(); | 835 | // actionMenu->insertSeparator(); |
836 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 836 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
837 | this ); | 837 | this ); |
838 | action->addTo( importMenu_X ); | 838 | action->addTo( importMenu_X ); |
839 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 839 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
840 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 840 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
841 | this ); | 841 | this ); |
842 | action->addTo( importMenu_X ); | 842 | action->addTo( importMenu_X ); |
843 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 843 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
844 | importMenu_X->insertSeparator(); | 844 | importMenu_X->insertSeparator(); |
845 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 845 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
846 | this ); | 846 | this ); |
847 | action->addTo( importMenu_X ); | 847 | action->addTo( importMenu_X ); |
848 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 848 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
849 | //#ifndef DESKTOP_VERSION | 849 | //#ifndef DESKTOP_VERSION |
850 | importMenu_X->insertSeparator(); | 850 | importMenu_X->insertSeparator(); |
851 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 851 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
852 | this ); | 852 | this ); |
853 | action->addTo( importMenu_X ); | 853 | action->addTo( importMenu_X ); |
854 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 854 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
855 | //#else | 855 | //#else |
856 | #ifdef _OL_IMPORT_ | 856 | #ifdef _OL_IMPORT_ |
857 | importMenu_X->insertSeparator(); | 857 | importMenu_X->insertSeparator(); |
858 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 858 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
859 | this ); | 859 | this ); |
860 | action->addTo( importMenu_X ); | 860 | action->addTo( importMenu_X ); |
861 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 861 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
862 | #endif | 862 | #endif |
863 | //#endif | 863 | //#endif |
864 | 864 | ||
865 | //importMenu->insertSeparator(); | 865 | //importMenu->insertSeparator(); |
866 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 866 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
867 | this ); | 867 | this ); |
868 | action->addTo( importMenu ); | 868 | action->addTo( importMenu ); |
869 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 869 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
870 | 870 | ||
871 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 871 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
872 | this ); | 872 | this ); |
873 | action->addTo( importMenu ); | 873 | action->addTo( importMenu ); |
874 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 874 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
875 | importMenu->insertSeparator(); | 875 | importMenu->insertSeparator(); |
876 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 876 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
877 | //importMenu->insertSeparator(); | 877 | //importMenu->insertSeparator(); |
878 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 878 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
879 | this ); | 879 | this ); |
880 | action->addTo( exportMenu_X ); | 880 | action->addTo( exportMenu_X ); |
881 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); | 881 | connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); |
882 | 882 | ||
883 | 883 | ||
884 | //LR | 884 | //LR |
885 | QPopupMenu *ex2phone = new QPopupMenu( this ); | 885 | QPopupMenu *ex2phone = new QPopupMenu( this ); |
886 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 886 | ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
887 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 887 | ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
888 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); | 888 | connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); |
889 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); | 889 | exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); |
890 | 890 | ||
891 | importMenu->insertItem( i18n("Export"), exportMenu_X ); | 891 | importMenu->insertItem( i18n("Export"), exportMenu_X ); |
892 | #ifndef DESKTOP_VERSION | 892 | #ifndef DESKTOP_VERSION |
893 | //importMenu->insertSeparator(); | 893 | //importMenu->insertSeparator(); |
894 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 894 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
895 | this ); | 895 | this ); |
896 | brAction->addTo( beamMenu_X ); | 896 | brAction->addTo( beamMenu_X ); |
897 | brAction->setToggleAction (true ) ; | 897 | brAction->setToggleAction (true ) ; |
898 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 898 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
899 | 899 | ||
900 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 900 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
901 | this ); | 901 | this ); |
902 | action->addTo( beamMenu_X ); | 902 | action->addTo( beamMenu_X ); |
903 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 903 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
904 | 904 | ||
905 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 905 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
906 | this ); | 906 | this ); |
907 | action->addTo( beamMenu_X ); | 907 | action->addTo( beamMenu_X ); |
908 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 908 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
909 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 909 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
910 | #else | 910 | #else |
911 | //importMenu->insertSeparator(); | 911 | //importMenu->insertSeparator(); |
912 | icon = loadPixmap( pathString + "print" ); | 912 | icon = loadPixmap( pathString + "print" ); |
913 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 913 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
914 | action->addTo( beamMenu_X ); | 914 | action->addTo( beamMenu_X ); |
915 | connect( action, SIGNAL( activated() ), | 915 | connect( action, SIGNAL( activated() ), |
916 | this, SLOT( printCal() ) ); | 916 | this, SLOT( printCal() ) ); |
917 | 917 | ||
918 | icon = loadPixmap( pathString + "print" ); | 918 | icon = loadPixmap( pathString + "print" ); |
919 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 919 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
920 | action->addTo( beamMenu_X ); | 920 | action->addTo( beamMenu_X ); |
921 | connect( action, SIGNAL( activated() ), | 921 | connect( action, SIGNAL( activated() ), |
922 | this, SLOT( printSel() ) ); | 922 | this, SLOT( printSel() ) ); |
923 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 923 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
924 | action->addTo( beamMenu_X ); | 924 | action->addTo( beamMenu_X ); |
925 | connect( action, SIGNAL( activated() ), | 925 | connect( action, SIGNAL( activated() ), |
926 | mView->viewManager(), SIGNAL( printWNV() ) ); | 926 | mView->viewManager(), SIGNAL( printWNV() ) ); |
927 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 927 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
928 | #endif | 928 | #endif |
929 | importMenu->insertSeparator(); | 929 | importMenu->insertSeparator(); |
930 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 930 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
931 | this ); | 931 | this ); |
932 | action->addTo( importMenu ); | 932 | action->addTo( importMenu ); |
933 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 933 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
934 | importMenu->insertSeparator(); | 934 | importMenu->insertSeparator(); |
935 | action = new QAction( "beam all", i18n("Save"), 0, | 935 | action = new QAction( "beam all", i18n("Save"), 0, |
936 | this ); | 936 | this ); |
937 | action->addTo( importMenu ); | 937 | action->addTo( importMenu ); |
938 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 938 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
939 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 939 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
940 | this ); | 940 | this ); |
941 | action->addTo( importMenu ); | 941 | action->addTo( importMenu ); |
942 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 942 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
943 | 943 | ||
944 | //menuBar->insertItem( "Configure",configureMenu ); | 944 | //menuBar->insertItem( "Configure",configureMenu ); |
945 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 945 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
946 | icon = loadPixmap( "korganizer/korganizer" ); | 946 | icon = loadPixmap( "korganizer/korganizer" ); |
947 | 947 | ||
948 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 948 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
949 | action->addTo( helpMenu ); | 949 | action->addTo( helpMenu ); |
950 | connect( action, SIGNAL( activated() ), | 950 | connect( action, SIGNAL( activated() ), |
951 | SLOT( whatsNew() ) ); | 951 | SLOT( whatsNew() ) ); |
952 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 952 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
953 | action->addTo( helpMenu ); | 953 | action->addTo( helpMenu ); |
954 | connect( action, SIGNAL( activated() ), | 954 | connect( action, SIGNAL( activated() ), |
955 | SLOT( features() ) ); | 955 | SLOT( features() ) ); |
956 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 956 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
957 | action->addTo( helpMenu ); | 957 | action->addTo( helpMenu ); |
958 | connect( action, SIGNAL( activated() ), | 958 | connect( action, SIGNAL( activated() ), |
959 | SLOT( keyBindings() ) ); | 959 | SLOT( keyBindings() ) ); |
960 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 960 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
961 | action->addTo( helpMenu ); | 961 | action->addTo( helpMenu ); |
962 | connect( action, SIGNAL( activated() ), | 962 | connect( action, SIGNAL( activated() ), |
963 | SLOT( synchowto() ) ); | 963 | SLOT( synchowto() ) ); |
964 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 964 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
965 | action->addTo( helpMenu ); | 965 | action->addTo( helpMenu ); |
966 | connect( action, SIGNAL( activated() ), | 966 | connect( action, SIGNAL( activated() ), |
967 | SLOT( kdesynchowto() ) ); | 967 | SLOT( kdesynchowto() ) ); |
968 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 968 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
969 | action->addTo( helpMenu ); | 969 | action->addTo( helpMenu ); |
970 | connect( action, SIGNAL( activated() ), | 970 | connect( action, SIGNAL( activated() ), |
971 | SLOT( multisynchowto() ) ); | 971 | SLOT( multisynchowto() ) ); |
972 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 972 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
973 | action->addTo( helpMenu ); | 973 | action->addTo( helpMenu ); |
974 | connect( action, SIGNAL( activated() ), | 974 | connect( action, SIGNAL( activated() ), |
975 | SLOT( aboutAutoSaving() ) ); | 975 | SLOT( aboutAutoSaving() ) ); |
976 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); | 976 | action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); |
977 | action->addTo( helpMenu ); | 977 | action->addTo( helpMenu ); |
978 | connect( action, SIGNAL( activated() ), | 978 | connect( action, SIGNAL( activated() ), |
979 | SLOT( aboutKnownBugs() ) ); | 979 | SLOT( aboutKnownBugs() ) ); |
980 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); | 980 | action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); |
981 | action->addTo( helpMenu ); | 981 | action->addTo( helpMenu ); |
982 | connect( action, SIGNAL( activated() ), | 982 | connect( action, SIGNAL( activated() ), |
983 | SLOT( usertrans() ) ); | 983 | SLOT( usertrans() ) ); |
984 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); | 984 | action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); |
985 | action->addTo( helpMenu ); | 985 | action->addTo( helpMenu ); |
986 | connect( action, SIGNAL( activated() ), | 986 | connect( action, SIGNAL( activated() ), |
987 | SLOT( faq() ) ); | 987 | SLOT( faq() ) ); |
988 | action = new QAction( "licence", i18n("Licence..."), 0, this ); | 988 | action = new QAction( "licence", i18n("Licence..."), 0, this ); |
989 | action->addTo( helpMenu ); | 989 | action->addTo( helpMenu ); |
990 | connect( action, SIGNAL( activated() ), | 990 | connect( action, SIGNAL( activated() ), |
991 | SLOT( licence() ) ); | 991 | SLOT( licence() ) ); |
992 | action = new QAction( "about", i18n("About..."), 0, this ); | 992 | action = new QAction( "about", i18n("About..."), 0, this ); |
993 | action->addTo( helpMenu ); | 993 | action->addTo( helpMenu ); |
994 | connect( action, SIGNAL( activated() ), | 994 | connect( action, SIGNAL( activated() ), |
995 | SLOT( about() ) ); | 995 | SLOT( about() ) ); |
996 | //menuBar->insertSeparator(); | 996 | //menuBar->insertSeparator(); |
997 | 997 | ||
998 | // ****************************************************** | 998 | // ****************************************************** |
999 | // menubar icons | 999 | // menubar icons |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | iconToolBar->setHorizontalStretchable (true ); | 1002 | iconToolBar->setHorizontalStretchable (true ); |
1003 | //menuBar->insertItem( iconToolBar ); | 1003 | //menuBar->insertItem( iconToolBar ); |
1004 | //xdays_action | 1004 | //xdays_action |
1005 | if (p-> mShowIconNewEvent) | 1005 | if (p-> mShowIconNewEvent) |
1006 | ne_action->addTo( iconToolBar ); | 1006 | ne_action->addTo( iconToolBar ); |
1007 | if (p->mShowIconNewTodo ) | 1007 | if (p->mShowIconNewTodo ) |
1008 | nt_action->addTo( iconToolBar ); | 1008 | nt_action->addTo( iconToolBar ); |
1009 | if (p-> mShowIconSearch) | 1009 | if (p-> mShowIconSearch) |
1010 | search_action->addTo( iconToolBar ); | 1010 | search_action->addTo( iconToolBar ); |
1011 | if (p-> mShowIconWhatsThis) | 1011 | if (p-> mShowIconWhatsThis) |
1012 | QWhatsThis::whatsThisButton ( iconToolBar ); | 1012 | QWhatsThis::whatsThisButton ( iconToolBar ); |
1013 | if (p-> mShowIconNext) | 1013 | if (p-> mShowIconNext) |
1014 | whatsnext_action->addTo( iconToolBar ); | 1014 | whatsnext_action->addTo( iconToolBar ); |
1015 | if (p-> mShowIconNextDays) | 1015 | if (p-> mShowIconNextDays) |
1016 | xdays_action->addTo( iconToolBar ); | 1016 | xdays_action->addTo( iconToolBar ); |
1017 | if (p-> mShowIconJournal) | 1017 | if (p-> mShowIconJournal) |
1018 | viewjournal_action->addTo( iconToolBar ); | 1018 | viewjournal_action->addTo( iconToolBar ); |
1019 | if (p-> mShowIconDay1) | 1019 | if (p-> mShowIconDay1) |
1020 | day1_action->addTo( iconToolBar ); | 1020 | day1_action->addTo( iconToolBar ); |
1021 | if (p-> mShowIconDay5) | 1021 | if (p-> mShowIconDay5) |
1022 | day5_action->addTo( iconToolBar ); | 1022 | day5_action->addTo( iconToolBar ); |
1023 | if (p-> mShowIconDay7) | 1023 | if (p-> mShowIconDay7) |
1024 | day7_action->addTo( iconToolBar ); | 1024 | day7_action->addTo( iconToolBar ); |
1025 | if (p-> mShowIconDay6) | 1025 | if (p-> mShowIconDay6) |
1026 | day6_action->addTo( iconToolBar ); | 1026 | day6_action->addTo( iconToolBar ); |
1027 | if (p-> mShowIconMonth) | 1027 | if (p-> mShowIconMonth) |
1028 | month_action->addTo( iconToolBar ); | 1028 | month_action->addTo( iconToolBar ); |
1029 | if (p-> mShowIconList) | 1029 | if (p-> mShowIconList) |
1030 | showlist_action->addTo( iconToolBar ); | 1030 | showlist_action->addTo( iconToolBar ); |
1031 | if (p-> mShowIconTodoview) | 1031 | if (p-> mShowIconTodoview) |
1032 | todoview_action->addTo( iconToolBar ); | 1032 | todoview_action->addTo( iconToolBar ); |
1033 | 1033 | ||
1034 | icon = loadPixmap( pathString + "2leftarrowB" ); | 1034 | icon = loadPixmap( pathString + "2leftarrowB" ); |
1035 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); | 1035 | configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200); |
1036 | if (p-> mShowIconBackFast) { | 1036 | if (p-> mShowIconBackFast) { |
1037 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); | 1037 | action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); |
1038 | connect( action, SIGNAL( activated() ), | 1038 | connect( action, SIGNAL( activated() ), |
1039 | mView, SLOT( goPreviousMonth() ) ); | 1039 | mView, SLOT( goPreviousMonth() ) ); |
1040 | action->addTo( iconToolBar ); | 1040 | action->addTo( iconToolBar ); |
1041 | } | 1041 | } |
1042 | icon = loadPixmap( pathString + "1leftarrowB" ); | 1042 | icon = loadPixmap( pathString + "1leftarrowB" ); |
1043 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); | 1043 | configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210); |
1044 | if (p-> mShowIconBack) { | 1044 | if (p-> mShowIconBack) { |
1045 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); | 1045 | action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); |
1046 | connect( action, SIGNAL( activated() ), | 1046 | connect( action, SIGNAL( activated() ), |
1047 | mView, SLOT( goPrevious() ) ); | 1047 | mView, SLOT( goPrevious() ) ); |
1048 | action->addTo( iconToolBar ); | 1048 | action->addTo( iconToolBar ); |
1049 | } | 1049 | } |
1050 | icon = loadPixmap( pathString + "today" ); | 1050 | icon = loadPixmap( pathString + "today" ); |
1051 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); | 1051 | configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); |
1052 | if (p-> mShowIconToday) | 1052 | if (p-> mShowIconToday) |
1053 | today_action->addTo( iconToolBar ); | 1053 | today_action->addTo( iconToolBar ); |
1054 | icon = loadPixmap( pathString + "1rightarrowB" ); | 1054 | icon = loadPixmap( pathString + "1rightarrowB" ); |
1055 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); | 1055 | configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); |
1056 | if (p-> mShowIconForward) { | 1056 | if (p-> mShowIconForward) { |
1057 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); | 1057 | action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); |
1058 | connect( action, SIGNAL( activated() ), | 1058 | connect( action, SIGNAL( activated() ), |
1059 | mView, SLOT( goNext() ) ); | 1059 | mView, SLOT( goNext() ) ); |
1060 | action->addTo( iconToolBar ); | 1060 | action->addTo( iconToolBar ); |
1061 | } | 1061 | } |
1062 | icon = loadPixmap( pathString + "2rightarrowB" ); | 1062 | icon = loadPixmap( pathString + "2rightarrowB" ); |
1063 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); | 1063 | configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); |
1064 | if (p-> mShowIconForwardFast) { | 1064 | if (p-> mShowIconForwardFast) { |
1065 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); | 1065 | action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); |
1066 | connect( action, SIGNAL( activated() ), | 1066 | connect( action, SIGNAL( activated() ), |
1067 | mView, SLOT( goNextMonth() ) ); | 1067 | mView, SLOT( goNextMonth() ) ); |
1068 | action->addTo( iconToolBar ); | 1068 | action->addTo( iconToolBar ); |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | 1071 | ||
1072 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); | 1072 | configureToolBarMenu->insertItem(i18n("What's This?"), 300, 6); |
1073 | 1073 | ||
1074 | if (p-> mShowIconNewEvent) | 1074 | if (p-> mShowIconNewEvent) |
1075 | configureToolBarMenu->setItemChecked( 10, true ); | 1075 | configureToolBarMenu->setItemChecked( 10, true ); |
1076 | if (p->mShowIconNewTodo ) | 1076 | if (p->mShowIconNewTodo ) |
1077 | configureToolBarMenu->setItemChecked( 20, true ); | 1077 | configureToolBarMenu->setItemChecked( 20, true ); |
1078 | if (p-> mShowIconSearch) | 1078 | if (p-> mShowIconSearch) |
1079 | configureToolBarMenu->setItemChecked( 120, true ); | 1079 | configureToolBarMenu->setItemChecked( 120, true ); |
1080 | if (p-> mShowIconList) | 1080 | if (p-> mShowIconList) |
1081 | configureToolBarMenu->setItemChecked( 30, true ); | 1081 | configureToolBarMenu->setItemChecked( 30, true ); |
1082 | if (p-> mShowIconDay1) | 1082 | if (p-> mShowIconDay1) |
1083 | configureToolBarMenu->setItemChecked( 40, true ); | 1083 | configureToolBarMenu->setItemChecked( 40, true ); |
1084 | if (p-> mShowIconDay5) | 1084 | if (p-> mShowIconDay5) |
1085 | configureToolBarMenu->setItemChecked( 50, true ); | 1085 | configureToolBarMenu->setItemChecked( 50, true ); |
1086 | if (p-> mShowIconDay6) | 1086 | if (p-> mShowIconDay6) |
1087 | configureToolBarMenu->setItemChecked( 75, true ); | 1087 | configureToolBarMenu->setItemChecked( 75, true ); |
1088 | if (p-> mShowIconDay7) | 1088 | if (p-> mShowIconDay7) |
1089 | configureToolBarMenu->setItemChecked( 60, true ); | 1089 | configureToolBarMenu->setItemChecked( 60, true ); |
1090 | if (p-> mShowIconMonth) | 1090 | if (p-> mShowIconMonth) |
1091 | configureToolBarMenu->setItemChecked( 70, true ); | 1091 | configureToolBarMenu->setItemChecked( 70, true ); |
1092 | if (p-> mShowIconTodoview) | 1092 | if (p-> mShowIconTodoview) |
1093 | configureToolBarMenu->setItemChecked( 80, true ); | 1093 | configureToolBarMenu->setItemChecked( 80, true ); |
1094 | if (p-> mShowIconBackFast) | 1094 | if (p-> mShowIconBackFast) |
1095 | configureToolBarMenu->setItemChecked( 200, true ); | 1095 | configureToolBarMenu->setItemChecked( 200, true ); |
1096 | if (p-> mShowIconBack) | 1096 | if (p-> mShowIconBack) |
1097 | configureToolBarMenu->setItemChecked( 210, true ); | 1097 | configureToolBarMenu->setItemChecked( 210, true ); |
1098 | if (p-> mShowIconToday) | 1098 | if (p-> mShowIconToday) |
1099 | configureToolBarMenu->setItemChecked( 130, true ); | 1099 | configureToolBarMenu->setItemChecked( 130, true ); |
1100 | if (p-> mShowIconForward) | 1100 | if (p-> mShowIconForward) |
1101 | configureToolBarMenu->setItemChecked( 220, true ); | 1101 | configureToolBarMenu->setItemChecked( 220, true ); |
1102 | if (p-> mShowIconForwardFast) | 1102 | if (p-> mShowIconForwardFast) |
1103 | configureToolBarMenu->setItemChecked( 230, true ); | 1103 | configureToolBarMenu->setItemChecked( 230, true ); |
1104 | if (p-> mShowIconNextDays) | 1104 | if (p-> mShowIconNextDays) |
1105 | configureToolBarMenu->setItemChecked( 100, true ); | 1105 | configureToolBarMenu->setItemChecked( 100, true ); |
1106 | if (p-> mShowIconNext) | 1106 | if (p-> mShowIconNext) |
1107 | configureToolBarMenu->setItemChecked( 110, true ); | 1107 | configureToolBarMenu->setItemChecked( 110, true ); |
1108 | if (p-> mShowIconJournal) | 1108 | if (p-> mShowIconJournal) |
1109 | configureToolBarMenu->setItemChecked( 90, true ); | 1109 | configureToolBarMenu->setItemChecked( 90, true ); |
1110 | if (p-> mShowIconWhatsThis) | 1110 | if (p-> mShowIconWhatsThis) |
1111 | configureToolBarMenu->setItemChecked( 300, true ); | 1111 | configureToolBarMenu->setItemChecked( 300, true ); |
1112 | if (p-> mShowIconWeekNum) | 1112 | if (p-> mShowIconWeekNum) |
1113 | configureToolBarMenu->setItemChecked( 400, true ); | 1113 | configureToolBarMenu->setItemChecked( 400, true ); |
1114 | QLabel* dummy = new QLabel( iconToolBar ); | 1114 | QLabel* dummy = new QLabel( iconToolBar ); |
1115 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); | 1115 | dummy->setBackgroundColor( iconToolBar->backgroundColor() ); |
1116 | if (!p-> mShowIconStretch) | 1116 | if (!p-> mShowIconStretch) |
1117 | iconToolBar->setStretchableWidget ( dummy ) ; | 1117 | iconToolBar->setStretchableWidget ( dummy ) ; |
1118 | else | 1118 | else |
1119 | configureToolBarMenu->setItemChecked( 5, true ); | 1119 | configureToolBarMenu->setItemChecked( 5, true ); |
1120 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); | 1120 | connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); |
1121 | configureAgenda( p->mHourSize ); | 1121 | configureAgenda( p->mHourSize ); |
1122 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); | 1122 | connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); |
1123 | } | 1123 | } |
1124 | 1124 | ||
1125 | void MainWindow::exportToPhone( int mode ) | 1125 | void MainWindow::exportToPhone( int mode ) |
1126 | { | 1126 | { |
1127 | 1127 | ||
1128 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); | 1128 | //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); |
1129 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); | 1129 | //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); |
1130 | KOex2phonePrefs ex2phone; | 1130 | KOex2phonePrefs ex2phone; |
1131 | 1131 | ||
1132 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); | 1132 | ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); |
1133 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); | 1133 | ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); |
1134 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1134 | ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1135 | if ( mode == 1 ) | 1135 | if ( mode == 1 ) |
1136 | ex2phone.setCaption(i18n("Export complete calendar")); | 1136 | ex2phone.setCaption(i18n("Export complete calendar")); |
1137 | if ( mode == 2 ) | 1137 | if ( mode == 2 ) |
1138 | ex2phone.setCaption(i18n("Export filtered calendar")); | 1138 | ex2phone.setCaption(i18n("Export filtered calendar")); |
1139 | 1139 | ||
1140 | if ( !ex2phone.exec() ) { | 1140 | if ( !ex2phone.exec() ) { |
1141 | return; | 1141 | return; |
1142 | } | 1142 | } |
1143 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); | 1143 | KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); |
1144 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); | 1144 | KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); |
1145 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); | 1145 | KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); |
1146 | 1146 | ||
1147 | int inFuture = 0; | 1147 | int inFuture = 0; |
1148 | if ( ex2phone.mWriteBackFuture->isChecked() ) | 1148 | if ( ex2phone.mWriteBackFuture->isChecked() ) |
1149 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); | 1149 | inFuture = ex2phone.mWriteBackFutureWeeks->value(); |
1150 | QPtrList<Incidence> delSel; | 1150 | QPtrList<Incidence> delSel; |
1151 | if ( mode == 1 ) | 1151 | if ( mode == 1 ) |
1152 | delSel = mCalendar->rawIncidences(); | 1152 | delSel = mCalendar->rawIncidences(); |
1153 | if ( mode == 2 ) | 1153 | if ( mode == 2 ) |
1154 | delSel = mCalendar->incidences(); | 1154 | delSel = mCalendar->incidences(); |
1155 | CalendarLocal* cal = new CalendarLocal(); | 1155 | CalendarLocal* cal = new CalendarLocal(); |
1156 | cal->setLocalTime(); | 1156 | cal->setLocalTime(); |
1157 | Incidence *incidence = delSel.first(); | 1157 | Incidence *incidence = delSel.first(); |
1158 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); | 1158 | QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); |
1159 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); | 1159 | QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); |
1160 | while ( incidence ) { | 1160 | while ( incidence ) { |
1161 | if ( incidence->type() != "Journal" ) { | 1161 | if ( incidence->type() != "Journal" ) { |
1162 | bool add = true; | 1162 | bool add = true; |
1163 | if ( inFuture ) { | 1163 | if ( inFuture ) { |
1164 | QDateTime dt; | 1164 | QDateTime dt; |
1165 | if ( incidence->type() == "Todo" ) { | 1165 | if ( incidence->type() == "Todo" ) { |
1166 | Todo * t = (Todo*)incidence; | 1166 | Todo * t = (Todo*)incidence; |
1167 | if ( t->hasDueDate() ) | 1167 | if ( t->hasDueDate() ) |
1168 | dt = t->dtDue(); | 1168 | dt = t->dtDue(); |
1169 | else | 1169 | else |
1170 | dt = cur.addSecs( 62 ); | 1170 | dt = cur.addSecs( 62 ); |
1171 | } | 1171 | } |
1172 | else { | 1172 | else { |
1173 | bool ok; | 1173 | bool ok; |
1174 | dt = incidence->getNextOccurence( cur, &ok ); | 1174 | dt = incidence->getNextOccurence( cur, &ok ); |
1175 | if ( !ok ) | 1175 | if ( !ok ) |
1176 | dt = cur.addSecs( -62 ); | 1176 | dt = cur.addSecs( -62 ); |
1177 | } | 1177 | } |
1178 | if ( dt < cur || dt > end ) { | 1178 | if ( dt < cur || dt > end ) { |
1179 | add = false; | 1179 | add = false; |
1180 | } | 1180 | } |
1181 | } | 1181 | } |
1182 | if ( add ) { | 1182 | if ( add ) { |
1183 | Incidence *in = incidence->clone(); | 1183 | Incidence *in = incidence->clone(); |
1184 | cal->addIncidence( in ); | 1184 | cal->addIncidence( in ); |
1185 | } | 1185 | } |
1186 | } | 1186 | } |
1187 | incidence = delSel.next(); | 1187 | incidence = delSel.next(); |
1188 | } | 1188 | } |
1189 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, | 1189 | PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, |
1190 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, | 1190 | KPimGlobalPrefs::instance()->mEx2PhoneConnection, |
1191 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); | 1191 | KPimGlobalPrefs::instance()->mEx2PhoneModel ); |
1192 | 1192 | ||
1193 | setCaption( i18n("Writing to phone...")); | 1193 | setCaption( i18n("Writing to phone...")); |
1194 | if ( PhoneFormat::writeToPhone( cal ) ) | 1194 | if ( PhoneFormat::writeToPhone( cal ) ) |
1195 | setCaption( i18n("Export to phone successful!")); | 1195 | setCaption( i18n("Export to phone successful!")); |
1196 | else | 1196 | else |
1197 | setCaption( i18n("Error exporting to phone!")); | 1197 | setCaption( i18n("Error exporting to phone!")); |
1198 | delete cal; | 1198 | delete cal; |
1199 | } | 1199 | } |
1200 | 1200 | ||
1201 | 1201 | ||
1202 | void MainWindow::setDefaultPreferences() | 1202 | void MainWindow::setDefaultPreferences() |
1203 | { | 1203 | { |
1204 | KOPrefs *p = KOPrefs::instance(); | 1204 | KOPrefs *p = KOPrefs::instance(); |
1205 | 1205 | ||
1206 | p->mCompactDialogs = true; | 1206 | p->mCompactDialogs = true; |
1207 | p->mConfirm = true; | 1207 | p->mConfirm = true; |
1208 | // p->mEnableQuickTodo = false; | 1208 | // p->mEnableQuickTodo = false; |
1209 | 1209 | ||
1210 | } | 1210 | } |
1211 | 1211 | ||
1212 | QString MainWindow::resourcePath() | 1212 | QString MainWindow::resourcePath() |
1213 | { | 1213 | { |
1214 | return KGlobal::iconLoader()->iconPath(); | 1214 | return KGlobal::iconLoader()->iconPath(); |
1215 | } | 1215 | } |
1216 | 1216 | ||
1217 | void MainWindow::displayText( QString text ,QString cap ) | 1217 | void MainWindow::displayText( QString text ,QString cap ) |
1218 | { | 1218 | { |
1219 | QDialog dia( this, "name", true ); ; | 1219 | QDialog dia( this, "name", true ); ; |
1220 | dia.setCaption( cap ); | 1220 | dia.setCaption( cap ); |
1221 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 1221 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
1222 | lay->setSpacing( 3 ); | 1222 | lay->setSpacing( 3 ); |
1223 | lay->setMargin( 3 ); | 1223 | lay->setMargin( 3 ); |
1224 | QTextBrowser tb ( &dia ); | 1224 | QTextBrowser tb ( &dia ); |
1225 | lay->addWidget( &tb ); | 1225 | lay->addWidget( &tb ); |
1226 | tb.setText( text ); | 1226 | tb.setText( text ); |
1227 | #ifdef DESKTOP_VERSION | 1227 | #ifdef DESKTOP_VERSION |
1228 | dia.resize( 640, 480); | 1228 | dia.resize( 640, 480); |
1229 | #else | 1229 | #else |
1230 | dia.showMaximized(); | 1230 | dia.showMaximized(); |
1231 | #endif | 1231 | #endif |
1232 | dia.exec(); | 1232 | dia.exec(); |
1233 | } | 1233 | } |
1234 | 1234 | ||
1235 | void MainWindow::features() | 1235 | void MainWindow::features() |
1236 | { | 1236 | { |
1237 | 1237 | ||
1238 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); | 1238 | KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); |
1239 | } | 1239 | } |
1240 | 1240 | ||
1241 | void MainWindow::usertrans() | 1241 | void MainWindow::usertrans() |
1242 | { | 1242 | { |
1243 | 1243 | ||
1244 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); | 1244 | KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | void MainWindow::kdesynchowto() | 1247 | void MainWindow::kdesynchowto() |
1248 | { | 1248 | { |
1249 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1249 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1250 | } | 1250 | } |
1251 | void MainWindow::multisynchowto() | 1251 | void MainWindow::multisynchowto() |
1252 | { | 1252 | { |
1253 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1253 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1254 | } | 1254 | } |
1255 | void MainWindow::synchowto() | 1255 | void MainWindow::synchowto() |
1256 | { | 1256 | { |
1257 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1257 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1258 | } | 1258 | } |
1259 | void MainWindow::faq() | 1259 | void MainWindow::faq() |
1260 | { | 1260 | { |
1261 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1261 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1262 | 1262 | ||
1263 | } | 1263 | } |
1264 | void MainWindow::whatsNew() | 1264 | void MainWindow::whatsNew() |
1265 | { | 1265 | { |
1266 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1266 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1267 | 1267 | ||
1268 | } | 1268 | } |
1269 | void MainWindow::licence() | 1269 | void MainWindow::licence() |
1270 | { | 1270 | { |
1271 | KApplication::showLicence(); | 1271 | KApplication::showLicence(); |
1272 | 1272 | ||
1273 | } | 1273 | } |
1274 | void MainWindow::about() | 1274 | void MainWindow::about() |
1275 | { | 1275 | { |
1276 | QString version; | 1276 | QString version; |
1277 | #include <../version> | 1277 | #include <../version> |
1278 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1278 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1279 | i18n("KOrganizer/Platform-independent\n") + | 1279 | i18n("KOrganizer/Platform-independent\n") + |
1280 | "(KO/Pi) " + version + " - " + | 1280 | "(KO/Pi) " + version + " - " + |
1281 | 1281 | ||
1282 | #ifdef DESKTOP_VERSION | 1282 | #ifdef DESKTOP_VERSION |
1283 | i18n("Desktop Edition\n") + | 1283 | i18n("Desktop Edition\n") + |
1284 | #else | 1284 | #else |
1285 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1285 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1286 | #endif | 1286 | #endif |
1287 | i18n("(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!") ); | 1287 | i18n("(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!") ); |
1288 | } | 1288 | } |
1289 | void MainWindow::keyBindings() | 1289 | void MainWindow::keyBindings() |
1290 | { | 1290 | { |
1291 | QString cap = i18n("KO/Pi Keys + Colors"); | 1291 | QString cap = i18n("KO/Pi Keys + Colors"); |
1292 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1292 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1293 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1293 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1294 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1294 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1295 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1295 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1296 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ | 1296 | i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ |
1297 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1297 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1298 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1298 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1299 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ | 1299 | i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ |
1300 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1300 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1301 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1301 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1302 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1302 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1303 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1303 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1304 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1304 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1305 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1305 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1306 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ | 1306 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ |
1307 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1307 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1308 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1308 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1309 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1309 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1310 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1310 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1311 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1311 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1312 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1312 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1313 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1313 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1314 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1314 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1315 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1315 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1316 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1316 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1317 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1317 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1318 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1318 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1319 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1319 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1320 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1320 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1321 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1321 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1322 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1322 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1323 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1323 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1324 | i18n("<p><h3>In list view:</h3></p>\n") + | 1324 | i18n("<p><h3>In list view:</h3></p>\n") + |
1325 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1325 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1326 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1326 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1327 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1327 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1328 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1328 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1329 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1329 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1330 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1330 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1331 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1331 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1332 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1332 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1333 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1333 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1334 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1334 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1335 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1335 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1336 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1336 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1337 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1337 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1338 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1338 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1339 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1339 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1340 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1340 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1341 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1341 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1342 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1342 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1343 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1343 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1344 | displayText( text, cap); | 1344 | displayText( text, cap); |
1345 | } | 1345 | } |
1346 | void MainWindow::aboutAutoSaving() | 1346 | void MainWindow::aboutAutoSaving() |
1347 | { | 1347 | { |
1348 | QString text = i18n("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"); | 1348 | QString text = i18n("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"); |
1349 | 1349 | ||
1350 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1350 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1351 | 1351 | ||
1352 | } | 1352 | } |
1353 | void MainWindow::aboutKnownBugs() | 1353 | void MainWindow::aboutKnownBugs() |
1354 | { | 1354 | { |
1355 | QMessageBox* msg; | 1355 | QMessageBox* msg; |
1356 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1356 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1357 | i18n("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")+ | 1357 | i18n("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")+ |
1358 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1358 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1359 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + | 1359 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + |
1360 | i18n("\nor report them in the bugtracker on\n") + | 1360 | i18n("\nor report them in the bugtracker on\n") + |
1361 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1361 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1362 | QMessageBox::NoIcon, | 1362 | QMessageBox::NoIcon, |
1363 | QMessageBox::Ok, | 1363 | QMessageBox::Ok, |
1364 | QMessageBox::NoButton, | 1364 | QMessageBox::NoButton, |
1365 | QMessageBox::NoButton); | 1365 | QMessageBox::NoButton); |
1366 | msg->exec(); | 1366 | msg->exec(); |
1367 | delete msg; | 1367 | delete msg; |
1368 | 1368 | ||
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | QString MainWindow::defaultFileName() | 1371 | QString MainWindow::defaultFileName() |
1372 | { | 1372 | { |
1373 | return locateLocal( "data", "korganizer/mycalendar.ics" ); | 1373 | return locateLocal( "data", "korganizer/mycalendar.ics" ); |
1374 | } | 1374 | } |
1375 | QString MainWindow::syncFileName() | 1375 | QString MainWindow::syncFileName() |
1376 | { | 1376 | { |
1377 | #ifdef DESKTOP_VERSION | 1377 | #ifdef DESKTOP_VERSION |
1378 | return locateLocal( "tmp", "synccalendar.ics" ); | 1378 | return locateLocal( "tmp", "synccalendar.ics" ); |
1379 | #else | 1379 | #else |
1380 | return QString( "/tmp/synccalendar.ics" ); | 1380 | return QString( "/tmp/synccalendar.ics" ); |
1381 | #endif | 1381 | #endif |
1382 | } | 1382 | } |
1383 | void MainWindow::updateWeek(QDate seda) | 1383 | void MainWindow::updateWeek(QDate seda) |
1384 | { | 1384 | { |
1385 | int weekNum = 0; | 1385 | int weekNum = 0; |
1386 | QDate d = QDate ( seda.year(), 1,1); | 1386 | QDate d = QDate ( seda.year(), 1,1); |
1387 | seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday | 1387 | seda = seda.addDays( 1-seda.dayOfWeek() );//we are on monday |
1388 | if ( seda.addDays(6).year() != seda.year() ) { | 1388 | if ( seda.addDays(6).year() != seda.year() ) { |
1389 | if ( seda.year() != d.year() ) { | 1389 | if ( seda.year() != d.year() ) { |
1390 | if ( d.dayOfWeek() > 4 ) | 1390 | if ( d.dayOfWeek() > 4 ) |
1391 | d = QDate ( seda.year(), 1,1); | 1391 | d = QDate ( seda.year(), 1,1); |
1392 | else | 1392 | else |
1393 | weekNum = 1; | 1393 | weekNum = 1; |
1394 | } else { | 1394 | } else { |
1395 | QDate dd( seda.year()+1, 1,1); | 1395 | QDate dd( seda.year()+1, 1,1); |
1396 | if ( dd.dayOfWeek() <= 4 ) | 1396 | if ( dd.dayOfWeek() <= 4 ) |
1397 | weekNum = 1; | 1397 | weekNum = 1; |
1398 | } | 1398 | } |
1399 | } | 1399 | } |
1400 | if ( weekNum == 0 ){ | 1400 | if ( weekNum == 0 ){ |
1401 | int dow = d.dayOfWeek(); | 1401 | int dow = d.dayOfWeek(); |
1402 | if ( dow <= 4 ) | 1402 | if ( dow <= 4 ) |
1403 | d = d.addDays( 1-dow ); | 1403 | d = d.addDays( 1-dow ); |
1404 | else // 5,6,7 | 1404 | else // 5,6,7 |
1405 | d = d.addDays( 8-dow ); | 1405 | d = d.addDays( 8-dow ); |
1406 | // we have the first week of the year.we are on monday | 1406 | // we have the first week of the year.we are on monday |
1407 | weekNum = d.daysTo( seda ) / 7 +1; | 1407 | weekNum = d.daysTo( seda ) / 7 +1; |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | mWeekPixmap.fill( mWeekBgColor ); | 1410 | mWeekPixmap.fill( mWeekBgColor ); |
1411 | QPainter p ( &mWeekPixmap ); | 1411 | QPainter p ( &mWeekPixmap ); |
1412 | p.setFont( mWeekFont ); | 1412 | p.setFont( mWeekFont ); |
1413 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1413 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); |
1414 | p.end(); | 1414 | p.end(); |
1415 | QIconSet icon3 ( mWeekPixmap ); | 1415 | QIconSet icon3 ( mWeekPixmap ); |
1416 | mWeekAction->setIconSet ( icon3 ); | 1416 | mWeekAction->setIconSet ( icon3 ); |
1417 | 1417 | ||
1418 | } | 1418 | } |
1419 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1419 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1420 | { | 1420 | { |
1421 | updateWeek( selectedDates.first() ); | 1421 | updateWeek( selectedDates.first() ); |
1422 | } | 1422 | } |
1423 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1423 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1424 | { | 1424 | { |
1425 | 1425 | ||
1426 | if ( !incidence ) { | 1426 | if ( !incidence ) { |
1427 | enableIncidenceActions( false ); | 1427 | enableIncidenceActions( false ); |
1428 | 1428 | ||
1429 | mNewSubTodoAction->setEnabled( false ); | 1429 | mNewSubTodoAction->setEnabled( false ); |
1430 | setCaptionToDates(); | 1430 | setCaptionToDates(); |
1431 | return; | 1431 | return; |
1432 | 1432 | ||
1433 | } | 1433 | } |
1434 | 1434 | ||
1435 | //KGlobal::locale()->formatDateTime(nextA, true); | 1435 | //KGlobal::locale()->formatDateTime(nextA, true); |
1436 | QString startString = ""; | 1436 | QString startString = ""; |
1437 | if ( incidence->type() != "Todo" ) { | 1437 | if ( incidence->type() != "Todo" ) { |
1438 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1438 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1439 | if ( incidence->doesFloat() ) { | 1439 | if ( incidence->doesFloat() ) { |
1440 | startString += ": "+incidence->dtStartDateStr( true ); | 1440 | startString += ": "+incidence->dtStartDateStr( true ); |
1441 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1441 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1442 | 1442 | ||
1443 | } else { | 1443 | } else { |
1444 | startString = ": "+incidence->dtStartStr(true); | 1444 | startString = ": "+incidence->dtStartStr(true); |
1445 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1445 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1446 | 1446 | ||
1447 | } | 1447 | } |
1448 | 1448 | ||
1449 | } else { | 1449 | } else { |
1450 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1450 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1451 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1451 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1452 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1452 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1453 | if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { | 1453 | if ( incidence->categories().contains( i18n("Birthday") ) || incidence->categories().contains( i18n("Anniversary") ) ) { |
1454 | bool ok; | 1454 | bool ok; |
1455 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1455 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1456 | if ( ok ) { | 1456 | if ( ok ) { |
1457 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1457 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1458 | startString += i18n(" (%1 y.)"). arg( years ); | 1458 | startString += i18n(" (%1 y.)"). arg( years ); |
1459 | } | 1459 | } |
1460 | } | 1460 | } |
1461 | else | 1461 | else |
1462 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1462 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1463 | } | 1463 | } |
1464 | 1464 | ||
1465 | } | 1465 | } |
1466 | else | 1466 | else |
1467 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1467 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1468 | if ( !incidence->location().isEmpty() ) | 1468 | if ( !incidence->location().isEmpty() ) |
1469 | startString += " (" +incidence->location()+")"; | 1469 | startString += " (" +incidence->location()+")"; |
1470 | setCaption( incidence->summary()+startString); | 1470 | setCaption( incidence->summary()+startString); |
1471 | 1471 | ||
1472 | enableIncidenceActions( true ); | 1472 | enableIncidenceActions( true ); |
1473 | 1473 | ||
1474 | if ( incidence->type() == "Event" ) { | 1474 | if ( incidence->type() == "Event" ) { |
1475 | mShowAction->setText( i18n("Show Event...") ); | 1475 | mShowAction->setText( i18n("Show Event...") ); |
1476 | mEditAction->setText( i18n("Edit Event...") ); | 1476 | mEditAction->setText( i18n("Edit Event...") ); |
1477 | mDeleteAction->setText( i18n("Delete Event...") ); | 1477 | mDeleteAction->setText( i18n("Delete Event...") ); |
1478 | 1478 | ||
1479 | mNewSubTodoAction->setEnabled( false ); | 1479 | mNewSubTodoAction->setEnabled( false ); |
1480 | } else if ( incidence->type() == "Todo" ) { | 1480 | } else if ( incidence->type() == "Todo" ) { |
1481 | mShowAction->setText( i18n("Show Todo...") ); | 1481 | mShowAction->setText( i18n("Show Todo...") ); |
1482 | mEditAction->setText( i18n("Edit Todo...") ); | 1482 | mEditAction->setText( i18n("Edit Todo...") ); |
1483 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1483 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1484 | 1484 | ||
1485 | mNewSubTodoAction->setEnabled( true ); | 1485 | mNewSubTodoAction->setEnabled( true ); |
1486 | } else { | 1486 | } else { |
1487 | mShowAction->setText( i18n("Show...") ); | 1487 | mShowAction->setText( i18n("Show...") ); |
1488 | mShowAction->setText( i18n("Edit...") ); | 1488 | mShowAction->setText( i18n("Edit...") ); |
1489 | mShowAction->setText( i18n("Delete...") ); | 1489 | mShowAction->setText( i18n("Delete...") ); |
1490 | 1490 | ||
1491 | mNewSubTodoAction->setEnabled( false ); | 1491 | mNewSubTodoAction->setEnabled( false ); |
1492 | } | 1492 | } |
1493 | } | 1493 | } |
1494 | 1494 | ||
1495 | void MainWindow::enableIncidenceActions( bool enabled ) | 1495 | void MainWindow::enableIncidenceActions( bool enabled ) |
1496 | { | 1496 | { |
1497 | mShowAction->setEnabled( enabled ); | 1497 | mShowAction->setEnabled( enabled ); |
1498 | mEditAction->setEnabled( enabled ); | 1498 | mEditAction->setEnabled( enabled ); |
1499 | mDeleteAction->setEnabled( enabled ); | 1499 | mDeleteAction->setEnabled( enabled ); |
1500 | 1500 | ||
1501 | mCloneAction->setEnabled( enabled ); | 1501 | mCloneAction->setEnabled( enabled ); |
1502 | mMoveAction->setEnabled( enabled ); | 1502 | mMoveAction->setEnabled( enabled ); |
1503 | mBeamAction->setEnabled( enabled ); | 1503 | mBeamAction->setEnabled( enabled ); |
1504 | mCancelAction->setEnabled( enabled ); | 1504 | mCancelAction->setEnabled( enabled ); |
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | void MainWindow::importOL() | 1507 | void MainWindow::importOL() |
1508 | { | 1508 | { |
1509 | #ifdef _OL_IMPORT_ | 1509 | #ifdef _OL_IMPORT_ |
1510 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1510 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1511 | id->exec(); | 1511 | id->exec(); |
1512 | delete id; | 1512 | delete id; |
1513 | mView->updateView(); | 1513 | mView->updateView(); |
1514 | #endif | 1514 | #endif |
1515 | } | 1515 | } |
1516 | void MainWindow::importBday() | 1516 | void MainWindow::importBday() |
1517 | { | 1517 | { |
1518 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1518 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1519 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1519 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1520 | i18n("Import!"), i18n("Cancel"), 0, | 1520 | i18n("Import!"), i18n("Cancel"), 0, |
1521 | 0, 1 ); | 1521 | 0, 1 ); |
1522 | if ( result == 0 ) { | 1522 | if ( result == 0 ) { |
1523 | mView->importBday(); | 1523 | mView->importBday(); |
1524 | 1524 | ||
1525 | } | 1525 | } |
1526 | 1526 | ||
1527 | 1527 | ||
1528 | } | 1528 | } |
1529 | void MainWindow::importQtopia() | 1529 | void MainWindow::importQtopia() |
1530 | { | 1530 | { |
1531 | //#ifndef DESKTOP_VERSION | 1531 | //#ifndef DESKTOP_VERSION |
1532 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); | 1532 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); |
1533 | #ifdef DESKTOP_VERSION | 1533 | #ifdef DESKTOP_VERSION |
1534 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1534 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
1535 | #endif | 1535 | #endif |
1536 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1536 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1537 | i18n("Import!"), i18n("Cancel"), 0, | 1537 | i18n("Import!"), i18n("Cancel"), 0, |
1538 | 0, 1 ); | 1538 | 0, 1 ); |
1539 | if ( result == 0 ) { | 1539 | if ( result == 0 ) { |
1540 | #ifndef DESKTOP_VERSION | 1540 | #ifndef DESKTOP_VERSION |
1541 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1541 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1542 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1542 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1543 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1543 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1544 | #else | 1544 | #else |
1545 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1545 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1546 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1546 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1547 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1547 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1548 | #endif | 1548 | #endif |
1549 | mView->importQtopia( categories, datebook, todolist ); | 1549 | mView->importQtopia( categories, datebook, todolist ); |
1550 | } | 1550 | } |
1551 | #if 0 | 1551 | #if 0 |
1552 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1552 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1553 | i18n("Not supported \non desktop!\n"), | 1553 | i18n("Not supported \non desktop!\n"), |
1554 | i18n("Ok"), i18n("Cancel"), 0, | 1554 | i18n("Ok"), i18n("Cancel"), 0, |
1555 | 0, 1 ); | 1555 | 0, 1 ); |
1556 | 1556 | ||
1557 | #endif | 1557 | #endif |
1558 | } | 1558 | } |
1559 | 1559 | ||
1560 | void MainWindow::saveOnClose() | 1560 | void MainWindow::saveOnClose() |
1561 | { | 1561 | { |
1562 | KOPrefs *p = KOPrefs::instance(); | 1562 | KOPrefs *p = KOPrefs::instance(); |
1563 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1563 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1564 | p->mToolBarUp = iconToolBar->x() > width()/2 || | 1564 | p->mToolBarUp = iconToolBar->x() > width()/2 || |
1565 | iconToolBar->y() > height()/2; | 1565 | iconToolBar->y() > height()/2; |
1566 | mView->writeSettings(); | 1566 | mView->writeSettings(); |
1567 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) | 1567 | if ( mCalendarModifiedFlag || mView->checkFileChanged( defaultFileName())) |
1568 | save(); | 1568 | save(); |
1569 | } | 1569 | } |
1570 | void MainWindow::slotModifiedChanged( bool changed ) | 1570 | void MainWindow::slotModifiedChanged( bool changed ) |
1571 | { | 1571 | { |
1572 | if ( mBlockAtStartup ) | 1572 | if ( mBlockAtStartup ) |
1573 | return; | 1573 | return; |
1574 | 1574 | ||
1575 | int msec; | 1575 | int msec; |
1576 | // we store the changes after 1 minute, | 1576 | // we store the changes after 1 minute, |
1577 | // and for safety reasons after 10 minutes again | 1577 | // and for safety reasons after 10 minutes again |
1578 | if ( !mSyncManager->blockSave() ) | 1578 | if ( !mSyncManager->blockSave() ) |
1579 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; | 1579 | msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; |
1580 | else | 1580 | else |
1581 | msec = 1000 * 600; | 1581 | msec = 1000 * 600; |
1582 | mSaveTimer.start( msec, true ); // 1 minute | 1582 | mSaveTimer.start( msec, true ); // 1 minute |
1583 | qDebug("KO: Saving File in %d secs!", msec/1000); | 1583 | qDebug("KO: Saving File in %d secs!", msec/1000); |
1584 | mCalendarModifiedFlag = true; | 1584 | mCalendarModifiedFlag = true; |
1585 | } | 1585 | } |
1586 | void MainWindow::saveStopTimer() | 1586 | void MainWindow::saveStopTimer() |
1587 | { | 1587 | { |
1588 | mSaveTimer.stop(); | 1588 | mSaveTimer.stop(); |
1589 | if (mSaveTimer.isActive() ) | 1589 | if (mSaveTimer.isActive() ) |
1590 | qDebug("ti active "); | 1590 | qDebug("ti active "); |
1591 | else | 1591 | else |
1592 | qDebug("KO: Save timer stopped"); | 1592 | qDebug("KO: Save timer stopped"); |
1593 | } | 1593 | } |
1594 | void MainWindow::save() | 1594 | void MainWindow::save() |
1595 | { | 1595 | { |
1596 | if ( !mCalendarModifiedFlag ) { | 1596 | if ( !mCalendarModifiedFlag ) { |
1597 | qDebug("KO: Calendar not modified. Nothing saved."); | 1597 | qDebug("KO: Calendar not modified. Nothing saved."); |
1598 | return; | 1598 | return; |
1599 | } | 1599 | } |
1600 | if ( mSyncManager->blockSave() ) | 1600 | if ( mSyncManager->blockSave() ) |
1601 | return; | 1601 | return; |
1602 | mSyncManager->setBlockSave(true); | 1602 | mSyncManager->setBlockSave(true); |
1603 | if ( mView->checkFileVersion( defaultFileName()) ) { | 1603 | if ( mView->checkFileVersion( defaultFileName()) ) { |
1604 | QTime neededSaveTime = QDateTime::currentDateTime().time(); | 1604 | QTime neededSaveTime = QDateTime::currentDateTime().time(); |
1605 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); | 1605 | setCaption(i18n("KO/Pi:Saving Data to File ..." )); |
1606 | qDebug("KO: Start saving data to file!"); | 1606 | qDebug("KO: Start saving data to file!"); |
1607 | mView->saveCalendar( defaultFileName() ); | 1607 | mView->saveCalendar( defaultFileName() ); |
1608 | mCalendarModifiedFlag = false; | 1608 | mCalendarModifiedFlag = false; |
1609 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); | 1609 | int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); |
1610 | qDebug("KO: Needed %d ms for saving.",msNeeded ); | 1610 | qDebug("KO: Needed %d ms for saving.",msNeeded ); |
1611 | QString savemes; | 1611 | QString savemes; |
1612 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); | 1612 | savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); |
1613 | setCaption(savemes); | 1613 | setCaption(savemes); |
1614 | } else | 1614 | } else |
1615 | setCaption(i18n("Saving cancelled!")); | 1615 | setCaption(i18n("Saving cancelled!")); |
1616 | mSyncManager->setBlockSave( false ); | 1616 | mSyncManager->setBlockSave( false ); |
1617 | } | 1617 | } |
1618 | 1618 | ||
1619 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) | 1619 | void MainWindow::keyReleaseEvent ( QKeyEvent * e) |
1620 | { | 1620 | { |
1621 | if ( !e->isAutoRepeat() ) { | 1621 | if ( !e->isAutoRepeat() ) { |
1622 | mFlagKeyPressed = false; | 1622 | mFlagKeyPressed = false; |
1623 | } | 1623 | } |
1624 | } | 1624 | } |
1625 | void MainWindow::keyPressEvent ( QKeyEvent * e ) | 1625 | void MainWindow::keyPressEvent ( QKeyEvent * e ) |
1626 | { | 1626 | { |
1627 | qApp->processEvents(); | 1627 | qApp->processEvents(); |
1628 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 1628 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
1629 | e->ignore(); | 1629 | e->ignore(); |
1630 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 1630 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
1631 | return; | 1631 | return; |
1632 | } | 1632 | } |
1633 | if (! e->isAutoRepeat() ) | 1633 | if (! e->isAutoRepeat() ) |
1634 | mFlagKeyPressed = true; | 1634 | mFlagKeyPressed = true; |
1635 | KOPrefs *p = KOPrefs::instance(); | 1635 | KOPrefs *p = KOPrefs::instance(); |
1636 | bool showSelectedDates = false; | 1636 | bool showSelectedDates = false; |
1637 | int size; | 1637 | int size; |
1638 | int pro = 0; | 1638 | int pro = 0; |
1639 | //qDebug("MainWindow::keyPressEvent "); | 1639 | //qDebug("MainWindow::keyPressEvent "); |
1640 | switch ( e->key() ) { | 1640 | switch ( e->key() ) { |
1641 | case Qt::Key_Right: | 1641 | case Qt::Key_Right: |
1642 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1642 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1643 | mView->goNextMonth(); | 1643 | mView->goNextMonth(); |
1644 | else | 1644 | else |
1645 | mView->goNext(); | 1645 | mView->goNext(); |
1646 | showSelectedDates = true; | 1646 | showSelectedDates = true; |
1647 | break; | 1647 | break; |
1648 | case Qt::Key_Left: | 1648 | case Qt::Key_Left: |
1649 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1649 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1650 | mView->goPreviousMonth(); | 1650 | mView->goPreviousMonth(); |
1651 | else | 1651 | else |
1652 | mView->goPrevious(); | 1652 | mView->goPrevious(); |
1653 | showSelectedDates = true; | 1653 | showSelectedDates = true; |
1654 | break; | 1654 | break; |
1655 | case Qt::Key_Down: | 1655 | case Qt::Key_Down: |
1656 | mView->viewManager()->agendaView()->scrollOneHourDown(); | 1656 | mView->viewManager()->agendaView()->scrollOneHourDown(); |
1657 | break; | 1657 | break; |
1658 | case Qt::Key_Up: | 1658 | case Qt::Key_Up: |
1659 | mView->viewManager()->agendaView()->scrollOneHourUp(); | 1659 | mView->viewManager()->agendaView()->scrollOneHourUp(); |
1660 | break; | 1660 | break; |
1661 | case Qt::Key_K: | 1661 | case Qt::Key_K: |
1662 | mView->viewManager()->showMonthViewWeek(); | 1662 | mView->viewManager()->showMonthViewWeek(); |
1663 | break; | 1663 | break; |
1664 | case Qt::Key_I: | 1664 | case Qt::Key_I: |
1665 | mView->showIncidence(); | 1665 | mView->showIncidence(); |
1666 | break; | 1666 | break; |
1667 | case Qt::Key_Delete: | 1667 | case Qt::Key_Delete: |
1668 | case Qt::Key_Backspace: | 1668 | case Qt::Key_Backspace: |
1669 | mView->deleteIncidence(); | 1669 | mView->deleteIncidence(); |
1670 | break; | 1670 | break; |
1671 | case Qt::Key_D: | 1671 | case Qt::Key_D: |
1672 | mView->viewManager()->showDayView(); | 1672 | mView->viewManager()->showDayView(); |
1673 | showSelectedDates = true; | 1673 | showSelectedDates = true; |
1674 | break; | 1674 | break; |
1675 | case Qt::Key_O: | 1675 | case Qt::Key_O: |
1676 | mView->toggleFilerEnabled( ); | 1676 | mView->toggleFilerEnabled( ); |
1677 | break; | 1677 | break; |
1678 | case Qt::Key_0: | 1678 | case Qt::Key_0: |
1679 | case Qt::Key_1: | 1679 | case Qt::Key_1: |
1680 | case Qt::Key_2: | 1680 | case Qt::Key_2: |
1681 | case Qt::Key_3: | 1681 | case Qt::Key_3: |
1682 | case Qt::Key_4: | 1682 | case Qt::Key_4: |
1683 | case Qt::Key_5: | 1683 | case Qt::Key_5: |
1684 | case Qt::Key_6: | 1684 | case Qt::Key_6: |
1685 | case Qt::Key_7: | 1685 | case Qt::Key_7: |
1686 | case Qt::Key_8: | 1686 | case Qt::Key_8: |
1687 | case Qt::Key_9: | 1687 | case Qt::Key_9: |
1688 | pro = e->key()-48; | 1688 | pro = e->key()-48; |
1689 | if ( pro == 0 ) | 1689 | if ( pro == 0 ) |
1690 | pro = 10; | 1690 | pro = 10; |
1691 | if ( e->state() == Qt::ControlButton) | 1691 | if ( e->state() == Qt::ControlButton) |
1692 | pro += 10; | 1692 | pro += 10; |
1693 | break; | 1693 | break; |
1694 | case Qt::Key_M: | 1694 | case Qt::Key_M: |
1695 | mView->viewManager()->showMonthView(); | 1695 | mView->viewManager()->showMonthView(); |
1696 | showSelectedDates = true; | 1696 | showSelectedDates = true; |
1697 | break; | 1697 | break; |
1698 | case Qt::Key_Insert: | 1698 | case Qt::Key_Insert: |
1699 | mView->newEvent(); | 1699 | mView->newEvent(); |
1700 | break; | 1700 | break; |
1701 | case Qt::Key_S : | 1701 | case Qt::Key_S : |
1702 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) | 1702 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1703 | mView->newSubTodo(); | 1703 | mView->newSubTodo(); |
1704 | else | 1704 | else |
1705 | mView->dialogManager()->showSearchDialog(); | 1705 | mView->dialogManager()->showSearchDialog(); |
1706 | break; | 1706 | break; |
1707 | case Qt::Key_Y : | 1707 | case Qt::Key_Y : |
1708 | case Qt::Key_Z : | 1708 | case Qt::Key_Z : |
1709 | mView->viewManager()->showWorkWeekView(); | 1709 | mView->viewManager()->showWorkWeekView(); |
1710 | showSelectedDates = true; | 1710 | showSelectedDates = true; |
1711 | break; | 1711 | break; |
1712 | case Qt::Key_U : | 1712 | case Qt::Key_U : |
1713 | mView->viewManager()->showWeekView(); | 1713 | mView->viewManager()->showWeekView(); |
1714 | showSelectedDates = true; | 1714 | showSelectedDates = true; |
1715 | break; | 1715 | break; |
1716 | case Qt::Key_H : | 1716 | case Qt::Key_H : |
1717 | keyBindings(); | 1717 | keyBindings(); |
1718 | break; | 1718 | break; |
1719 | case Qt::Key_W: | 1719 | case Qt::Key_W: |
1720 | mView->viewManager()->showWhatsNextView(); | 1720 | mView->viewManager()->showWhatsNextView(); |
1721 | break; | 1721 | break; |
1722 | case Qt::Key_L: | 1722 | case Qt::Key_L: |
1723 | mView->viewManager()->showListView(); | 1723 | mView->viewManager()->showListView(); |
1724 | break; | 1724 | break; |
1725 | case Qt::Key_N: | 1725 | case Qt::Key_N: |
1726 | mView->viewManager()->showNextXView(); | 1726 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) |
1727 | showSelectedDates = true; | 1727 | mView->viewManager()->showNextView(); |
1728 | else { | ||
1729 | mView->viewManager()->showNextXView(); | ||
1730 | showSelectedDates = true; | ||
1731 | } | ||
1728 | break; | 1732 | break; |
1729 | case Qt::Key_V: | 1733 | case Qt::Key_V: |
1730 | mView->viewManager()->showTodoView(); | 1734 | mView->viewManager()->showTodoView(); |
1731 | break; | 1735 | break; |
1732 | case Qt::Key_C: | 1736 | case Qt::Key_C: |
1733 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 1737 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
1734 | break; | 1738 | break; |
1735 | case Qt::Key_P: | 1739 | case Qt::Key_P: |
1736 | mView->showDatePicker( ); | 1740 | mView->showDatePicker( ); |
1737 | break; | 1741 | break; |
1738 | case Qt::Key_F: | 1742 | case Qt::Key_F: |
1739 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1743 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1740 | mView->editFilters(); | 1744 | mView->editFilters(); |
1741 | else | 1745 | else |
1742 | mView->toggleFilter(); | 1746 | mView->toggleFilter(); |
1743 | break; | 1747 | break; |
1744 | case Qt::Key_X: | 1748 | case Qt::Key_X: |
1745 | mView->toggleDateNavigatorWidget(); | 1749 | mView->toggleDateNavigatorWidget(); |
1746 | break; | 1750 | break; |
1747 | case Qt::Key_Space: | 1751 | case Qt::Key_Space: |
1748 | mView->toggleExpand(); | 1752 | mView->toggleExpand(); |
1749 | break; | 1753 | break; |
1750 | case Qt::Key_A: | 1754 | case Qt::Key_A: |
1751 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) | 1755 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) |
1752 | mView->showNextAlarms(); | 1756 | mView->showNextAlarms(); |
1753 | else | 1757 | else |
1754 | mView->toggleAllDaySize(); | 1758 | mView->toggleAllDaySize(); |
1755 | break; | 1759 | break; |
1756 | case Qt::Key_T: | 1760 | case Qt::Key_T: |
1757 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1761 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1758 | mView->newTodo(); | 1762 | mView->newTodo(); |
1759 | else { | 1763 | else { |
1760 | mView->goToday(); | 1764 | mView->goToday(); |
1761 | showSelectedDates = true; | 1765 | showSelectedDates = true; |
1762 | } | 1766 | } |
1763 | break; | 1767 | break; |
1764 | case Qt::Key_J: | 1768 | case Qt::Key_J: |
1765 | mView->viewManager()->showJournalView(); | 1769 | mView->viewManager()->showJournalView(); |
1766 | break; | 1770 | break; |
1767 | case Qt::Key_B: | 1771 | case Qt::Key_B: |
1768 | mView->editIncidenceDescription();; | 1772 | mView->editIncidenceDescription();; |
1769 | break; | 1773 | break; |
1770 | // case Qt::Key_Return: | 1774 | // case Qt::Key_Return: |
1771 | case Qt::Key_E: | 1775 | case Qt::Key_E: |
1772 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 1776 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
1773 | mView->newEvent(); | 1777 | mView->newEvent(); |
1774 | else | 1778 | else |
1775 | mView->editIncidence(); | 1779 | mView->editIncidence(); |
1776 | break; | 1780 | break; |
1777 | case Qt::Key_Plus: | 1781 | case Qt::Key_Plus: |
1778 | size = p->mHourSize +2; | 1782 | size = p->mHourSize +2; |
1779 | if ( size <= 22 ) | 1783 | if ( size <= 22 ) |
1780 | configureAgenda( size ); | 1784 | configureAgenda( size ); |
1781 | break; | 1785 | break; |
1782 | case Qt::Key_Minus: | 1786 | case Qt::Key_Minus: |
1783 | size = p->mHourSize - 2; | 1787 | size = p->mHourSize - 2; |
1784 | if ( size >= 4 ) | 1788 | if ( size >= 4 ) |
1785 | configureAgenda( size ); | 1789 | configureAgenda( size ); |
1786 | break; | 1790 | break; |
1787 | 1791 | ||
1788 | 1792 | ||
1789 | default: | 1793 | default: |
1790 | e->ignore(); | 1794 | e->ignore(); |
1791 | } | 1795 | } |
1792 | if ( pro > 0 ) { | 1796 | if ( pro > 0 ) { |
1793 | mView->selectFilter( pro-1 ); | 1797 | mView->selectFilter( pro-1 ); |
1794 | } | 1798 | } |
1795 | if ( showSelectedDates ) { | 1799 | if ( showSelectedDates ) { |
1796 | ;// setCaptionToDates(); | 1800 | ;// setCaptionToDates(); |
1797 | } | 1801 | } |
1798 | 1802 | ||
1799 | } | 1803 | } |
1800 | 1804 | ||
1801 | void MainWindow::fillFilterMenu() | 1805 | void MainWindow::fillFilterMenu() |
1802 | { | 1806 | { |
1803 | selectFilterMenu->clear(); | 1807 | selectFilterMenu->clear(); |
1804 | bool disable = false; | 1808 | bool disable = false; |
1805 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); | 1809 | selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); |
1806 | selectFilterMenu->insertSeparator(); | 1810 | selectFilterMenu->insertSeparator(); |
1807 | if ( mView->filterView()->filtersEnabled() ) { | 1811 | if ( mView->filterView()->filtersEnabled() ) { |
1808 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); | 1812 | selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 ); |
1809 | } | 1813 | } |
1810 | else { | 1814 | else { |
1811 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); | 1815 | selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 ); |
1812 | disable = true; | 1816 | disable = true; |
1813 | } | 1817 | } |
1814 | selectFilterMenu->insertSeparator(); | 1818 | selectFilterMenu->insertSeparator(); |
1815 | QPtrList<CalFilter> fili = mView->filters(); | 1819 | QPtrList<CalFilter> fili = mView->filters(); |
1816 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 1820 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
1817 | CalFilter *filter = fili.first(); | 1821 | CalFilter *filter = fili.first(); |
1818 | int iii = 2; | 1822 | int iii = 2; |
1819 | while(filter) { | 1823 | while(filter) { |
1820 | selectFilterMenu->insertItem( filter->name(), iii ); | 1824 | selectFilterMenu->insertItem( filter->name(), iii ); |
1821 | if ( filter == curfilter) | 1825 | if ( filter == curfilter) |
1822 | selectFilterMenu->setItemChecked( iii, true ); | 1826 | selectFilterMenu->setItemChecked( iii, true ); |
1823 | if ( disable ) | 1827 | if ( disable ) |
1824 | selectFilterMenu->setItemEnabled( iii, false ); | 1828 | selectFilterMenu->setItemEnabled( iii, false ); |
1825 | filter = fili.next(); | 1829 | filter = fili.next(); |
1826 | ++iii; | 1830 | ++iii; |
1827 | } | 1831 | } |
1828 | } | 1832 | } |
1829 | void MainWindow::selectFilter( int fil ) | 1833 | void MainWindow::selectFilter( int fil ) |
1830 | { | 1834 | { |
1831 | if ( fil == 0 ) { | 1835 | if ( fil == 0 ) { |
1832 | mView->editFilters( ); | 1836 | mView->editFilters( ); |
1833 | } else if ( fil == 1 ){ | 1837 | } else if ( fil == 1 ){ |
1834 | mView->toggleFilerEnabled( ); | 1838 | mView->toggleFilerEnabled( ); |
1835 | } else { | 1839 | } else { |
1836 | mView->selectFilter( fil-2 ); | 1840 | mView->selectFilter( fil-2 ); |
1837 | } | 1841 | } |
1838 | } | 1842 | } |
1839 | void MainWindow::configureToolBar( int item ) | 1843 | void MainWindow::configureToolBar( int item ) |
1840 | { | 1844 | { |
1841 | 1845 | ||
1842 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 1846 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
1843 | KOPrefs *p = KOPrefs::instance(); | 1847 | KOPrefs *p = KOPrefs::instance(); |
1844 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 1848 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
1845 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 1849 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
1846 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 1850 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
1847 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 1851 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
1848 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 1852 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
1849 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 1853 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
1850 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 1854 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
1851 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 1855 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
1852 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 1856 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
1853 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 1857 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
1854 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 1858 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
1855 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 1859 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
1856 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 1860 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
1857 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 1861 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
1858 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 1862 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
1859 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 1863 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
1860 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 1864 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
1861 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 1865 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
1862 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 1866 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
1863 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 1867 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
1864 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 1868 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
1865 | // initActions(); | 1869 | // initActions(); |
1866 | } | 1870 | } |
1867 | void MainWindow::setCaption ( const QString & c ) | 1871 | void MainWindow::setCaption ( const QString & c ) |
1868 | { | 1872 | { |
1869 | QString cap = c; | 1873 | QString cap = c; |
1870 | cap.replace( QRegExp("\n"), " " ); | 1874 | cap.replace( QRegExp("\n"), " " ); |
1871 | cap = cap.stripWhiteSpace(); | 1875 | cap = cap.stripWhiteSpace(); |
1872 | if ( cap.isEmpty() ) | 1876 | if ( cap.isEmpty() ) |
1873 | cap = "KO/Pi"; | 1877 | cap = "KO/Pi"; |
1874 | QWidget::setCaption( cap ); | 1878 | QWidget::setCaption( cap ); |
1875 | } | 1879 | } |
1876 | void MainWindow::setCaptionToDates() | 1880 | void MainWindow::setCaptionToDates() |
1877 | { | 1881 | { |
1878 | QString selDates; | 1882 | QString selDates; |
1879 | QDate date = mView->startDate(); | 1883 | QDate date = mView->startDate(); |
1880 | if ( ! date.isValid() ) { | 1884 | if ( ! date.isValid() ) { |
1881 | setCaption(""); | 1885 | setCaption(""); |
1882 | return; | 1886 | return; |
1883 | } | 1887 | } |
1884 | selDates = KGlobal::locale()->formatDate( date, true); | 1888 | selDates = KGlobal::locale()->formatDate( date, true); |
1885 | if (mView->startDate() < mView->endDate() ) | 1889 | if (mView->startDate() < mView->endDate() ) |
1886 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1890 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1887 | else { | 1891 | else { |
1888 | QString addString; | 1892 | QString addString; |
1889 | if ( date == QDateTime::currentDateTime().date() ) | 1893 | if ( date == QDateTime::currentDateTime().date() ) |
1890 | addString = i18n("Today"); | 1894 | addString = i18n("Today"); |
1891 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) | 1895 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
1892 | addString = i18n("Tomorrow"); | 1896 | addString = i18n("Tomorrow"); |
1893 | if ( !addString.isEmpty() ) | 1897 | if ( !addString.isEmpty() ) |
1894 | selDates = addString+", "+selDates ; | 1898 | selDates = addString+", "+selDates ; |
1895 | } | 1899 | } |
1896 | setCaption( i18n("Dates: ") + selDates ); | 1900 | setCaption( i18n("Dates: ") + selDates ); |
1897 | 1901 | ||
1898 | } | 1902 | } |
1899 | void MainWindow::showConfigureAgenda( ) | 1903 | void MainWindow::showConfigureAgenda( ) |
1900 | { | 1904 | { |
1901 | int iii; | 1905 | int iii; |
1902 | for ( iii = 1;iii<= 10 ;++iii ){ | 1906 | for ( iii = 1;iii<= 10 ;++iii ){ |
1903 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 1907 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
1904 | } | 1908 | } |
1905 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 1909 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
1906 | } | 1910 | } |
1907 | void MainWindow::configureAgenda( int item ) | 1911 | void MainWindow::configureAgenda( int item ) |
1908 | { | 1912 | { |
1909 | if ( KOPrefs::instance()->mHourSize == item ) | 1913 | if ( KOPrefs::instance()->mHourSize == item ) |
1910 | return; | 1914 | return; |
1911 | KOPrefs::instance()->mHourSize=item; | 1915 | KOPrefs::instance()->mHourSize=item; |
1912 | mView->viewManager()->agendaView()->updateConfig(); | 1916 | mView->viewManager()->agendaView()->updateConfig(); |
1913 | } | 1917 | } |
1914 | 1918 | ||
1915 | void MainWindow::saveCalendar() | 1919 | void MainWindow::saveCalendar() |
1916 | { | 1920 | { |
1917 | QString fn = KOPrefs::instance()->mLastSaveFile; | 1921 | QString fn = KOPrefs::instance()->mLastSaveFile; |
1918 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); | 1922 | fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); |
1919 | 1923 | ||
1920 | if ( fn == "" ) | 1924 | if ( fn == "" ) |
1921 | return; | 1925 | return; |
1922 | QFileInfo info; | 1926 | QFileInfo info; |
1923 | info.setFile( fn ); | 1927 | info.setFile( fn ); |
1924 | QString mes; | 1928 | QString mes; |
1925 | bool createbup = true; | 1929 | bool createbup = true; |
1926 | if ( info. exists() ) { | 1930 | if ( info. exists() ) { |
1927 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; | 1931 | mes = i18n("Backup file\nalready exists!\nOld backup file from:\n%1\nOverwrite?\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )) ; |
1928 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 1932 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
1929 | i18n("Overwrite!"), i18n("Cancel"), 0, | 1933 | i18n("Overwrite!"), i18n("Cancel"), 0, |
1930 | 0, 1 ); | 1934 | 0, 1 ); |
1931 | if ( result != 0 ) { | 1935 | if ( result != 0 ) { |
1932 | createbup = false; | 1936 | createbup = false; |
1933 | } | 1937 | } |
1934 | } | 1938 | } |
1935 | if ( createbup ) { | 1939 | if ( createbup ) { |
1936 | mView->saveCalendar( fn ); | 1940 | mView->saveCalendar( fn ); |
1937 | mes = i18n("KO/Pi:Saved %1").arg(fn); | 1941 | mes = i18n("KO/Pi:Saved %1").arg(fn); |
1938 | KOPrefs::instance()->mLastSaveFile = fn; | 1942 | KOPrefs::instance()->mLastSaveFile = fn; |
1939 | setCaption(mes); | 1943 | setCaption(mes); |
1940 | } | 1944 | } |
1941 | } | 1945 | } |
1942 | void MainWindow::loadCalendar() | 1946 | void MainWindow::loadCalendar() |
1943 | { | 1947 | { |
1944 | 1948 | ||
1945 | QString fn = KOPrefs::instance()->mLastLoadFile; | 1949 | QString fn = KOPrefs::instance()->mLastLoadFile; |
1946 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 1950 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
1947 | 1951 | ||
1948 | if ( fn == "" ) | 1952 | if ( fn == "" ) |
1949 | return; | 1953 | return; |
1950 | QFileInfo info; | 1954 | QFileInfo info; |
1951 | info.setFile( fn ); | 1955 | info.setFile( fn ); |
1952 | QString mess; | 1956 | QString mess; |
1953 | bool loadbup = true; | 1957 | bool loadbup = true; |
1954 | if ( info. exists() ) { | 1958 | if ( info. exists() ) { |
1955 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 1959 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1956 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 1960 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1957 | mess, | 1961 | mess, |
1958 | i18n("Load!"), i18n("Cancel"), 0, | 1962 | i18n("Load!"), i18n("Cancel"), 0, |
1959 | 0, 1 ); | 1963 | 0, 1 ); |
1960 | if ( result != 0 ) { | 1964 | if ( result != 0 ) { |
1961 | loadbup = false; | 1965 | loadbup = false; |
1962 | } | 1966 | } |
1963 | } else { | 1967 | } else { |
1964 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1968 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1965 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 1969 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
1966 | 0, 1 ); | 1970 | 0, 1 ); |
1967 | 1971 | ||
1968 | return; | 1972 | return; |
1969 | } | 1973 | } |
1970 | if ( loadbup ) { | 1974 | if ( loadbup ) { |
1971 | mView->openCalendar( fn ); | 1975 | mView->openCalendar( fn ); |
1972 | KOPrefs::instance()->mLastLoadFile = fn; | 1976 | KOPrefs::instance()->mLastLoadFile = fn; |
1973 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 1977 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
1974 | setCaption(mess); | 1978 | setCaption(mess); |
1975 | } | 1979 | } |
1976 | 1980 | ||
1977 | } | 1981 | } |
1978 | void MainWindow::quickImportIcal() | 1982 | void MainWindow::quickImportIcal() |
1979 | { | 1983 | { |
1980 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 1984 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
1981 | } | 1985 | } |
1982 | void MainWindow::importFile( QString fn, bool quick ) | 1986 | void MainWindow::importFile( QString fn, bool quick ) |
1983 | { | 1987 | { |
1984 | QFileInfo info; | 1988 | QFileInfo info; |
1985 | info.setFile( fn ); | 1989 | info.setFile( fn ); |
1986 | QString mess; | 1990 | QString mess; |
1987 | bool loadbup = true; | 1991 | bool loadbup = true; |
1988 | if ( !info. exists() ) { | 1992 | if ( !info. exists() ) { |
1989 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 1993 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
1990 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1994 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1991 | mess ); | 1995 | mess ); |
1992 | return; | 1996 | return; |
1993 | } | 1997 | } |
1994 | int result = 0; | 1998 | int result = 0; |
1995 | if ( !quick ) { | 1999 | if ( !quick ) { |
1996 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2000 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
1997 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2001 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
1998 | mess, | 2002 | mess, |
1999 | "Import", "Cancel", 0, | 2003 | "Import", "Cancel", 0, |
2000 | 0, 1 ); | 2004 | 0, 1 ); |
2001 | } | 2005 | } |
2002 | if ( result == 0 ) { | 2006 | if ( result == 0 ) { |
2003 | if ( mView->openCalendar( fn, true )) { | 2007 | if ( mView->openCalendar( fn, true )) { |
2004 | KOPrefs::instance()->mLastImportFile = fn; | 2008 | KOPrefs::instance()->mLastImportFile = fn; |
2005 | setCaption(i18n("Imported file successfully")); | 2009 | setCaption(i18n("Imported file successfully")); |
2006 | } else { | 2010 | } else { |
2007 | setCaption(i18n("Error importing file")); | 2011 | setCaption(i18n("Error importing file")); |
2008 | } | 2012 | } |
2009 | } | 2013 | } |
2010 | } | 2014 | } |
2011 | 2015 | ||
2012 | void MainWindow::importIcal() | 2016 | void MainWindow::importIcal() |
2013 | { | 2017 | { |
2014 | 2018 | ||
2015 | QString fn =KOPrefs::instance()->mLastImportFile; | 2019 | QString fn =KOPrefs::instance()->mLastImportFile; |
2016 | 2020 | ||
2017 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 2021 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
2018 | if ( fn == "" ) | 2022 | if ( fn == "" ) |
2019 | return; | 2023 | return; |
2020 | importFile( fn, true ); | 2024 | importFile( fn, true ); |
2021 | 2025 | ||
2022 | } | 2026 | } |
2023 | 2027 | ||
2024 | void MainWindow::exportVCalendar() | 2028 | void MainWindow::exportVCalendar() |
2025 | { | 2029 | { |
2026 | QString fn = KOPrefs::instance()->mLastVcalFile; | 2030 | QString fn = KOPrefs::instance()->mLastVcalFile; |
2027 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 2031 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
2028 | if ( fn == "" ) | 2032 | if ( fn == "" ) |
2029 | return; | 2033 | return; |
2030 | QFileInfo info; | 2034 | QFileInfo info; |
2031 | info.setFile( fn ); | 2035 | info.setFile( fn ); |
2032 | QString mes; | 2036 | QString mes; |
2033 | bool createbup = true; | 2037 | bool createbup = true; |
2034 | if ( info. exists() ) { | 2038 | if ( info. exists() ) { |
2035 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); | 2039 | mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); |
2036 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, | 2040 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, |
2037 | i18n("Overwrite!"), i18n("Cancel"), 0, | 2041 | i18n("Overwrite!"), i18n("Cancel"), 0, |
2038 | 0, 1 ); | 2042 | 0, 1 ); |
2039 | if ( result != 0 ) { | 2043 | if ( result != 0 ) { |
2040 | createbup = false; | 2044 | createbup = false; |
2041 | } | 2045 | } |
2042 | } | 2046 | } |
2043 | if ( createbup ) { | 2047 | if ( createbup ) { |
2044 | if ( mView->exportVCalendar( fn ) ) { | 2048 | if ( mView->exportVCalendar( fn ) ) { |
2045 | KOPrefs::instance()->mLastVcalFile = fn; | 2049 | KOPrefs::instance()->mLastVcalFile = fn; |
2046 | if ( fn.length() > 20 ) | 2050 | if ( fn.length() > 20 ) |
2047 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; | 2051 | mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; |
2048 | else | 2052 | else |
2049 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); | 2053 | mes = i18n("KO/Pi:Exported to %1").arg(fn ); |
2050 | setCaption(mes); | 2054 | setCaption(mes); |
2051 | } | 2055 | } |
2052 | } | 2056 | } |
2053 | 2057 | ||
2054 | } | 2058 | } |
2055 | QString MainWindow::sentSyncFile() | 2059 | QString MainWindow::sentSyncFile() |
2056 | { | 2060 | { |
2057 | #ifdef DESKTOP_VERSION | 2061 | #ifdef DESKTOP_VERSION |
2058 | return locateLocal( "tmp", "copysynccal.ics" ); | 2062 | return locateLocal( "tmp", "copysynccal.ics" ); |
2059 | #else | 2063 | #else |
2060 | return QString( "/tmp/copysynccal.ics" ); | 2064 | return QString( "/tmp/copysynccal.ics" ); |
2061 | #endif | 2065 | #endif |
2062 | } | 2066 | } |
2063 | 2067 | ||
2064 | void MainWindow::syncFileRequest() | 2068 | void MainWindow::syncFileRequest() |
2065 | { | 2069 | { |
2066 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2070 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2067 | mSyncManager->slotSyncMenu( 999 ); | 2071 | mSyncManager->slotSyncMenu( 999 ); |
2068 | } | 2072 | } |
2069 | 2073 | ||
2070 | setCaption(i18n("Saving Data to temp file ..." )); | 2074 | setCaption(i18n("Saving Data to temp file ..." )); |
2071 | mView->saveCalendar( sentSyncFile() ); | 2075 | mView->saveCalendar( sentSyncFile() ); |
2072 | setCaption(i18n("Data saved to temp file!" )); | 2076 | setCaption(i18n("Data saved to temp file!" )); |
2073 | 2077 | ||
2074 | } | 2078 | } |
2075 | void MainWindow::getFile( bool success ) | 2079 | void MainWindow::getFile( bool success ) |
2076 | { | 2080 | { |
2077 | if ( ! success ) { | 2081 | if ( ! success ) { |
2078 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2082 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2079 | return; | 2083 | return; |
2080 | } | 2084 | } |
2081 | mView->openCalendar( sentSyncFile() ); | 2085 | mView->openCalendar( sentSyncFile() ); |
2082 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { | 2086 | if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { |
2083 | mSyncManager->slotSyncMenu( 999 ); | 2087 | mSyncManager->slotSyncMenu( 999 ); |
2084 | } | 2088 | } |
2085 | setCaption( i18n("Pi-Sync successful!") ); | 2089 | setCaption( i18n("Pi-Sync successful!") ); |
2086 | } | 2090 | } |
2087 | 2091 | ||
2088 | void MainWindow::printSel( ) | 2092 | void MainWindow::printSel( ) |
2089 | { | 2093 | { |
2090 | mView->viewManager()->agendaView()->agenda()->printSelection(); | 2094 | mView->viewManager()->agendaView()->agenda()->printSelection(); |
2091 | } | 2095 | } |
2092 | 2096 | ||
2093 | void MainWindow::printCal() | 2097 | void MainWindow::printCal() |
2094 | { | 2098 | { |
2095 | mView->print();//mCp->showDialog(); | 2099 | mView->print();//mCp->showDialog(); |
2096 | } | 2100 | } |
2097 | 2101 | ||
2098 | 2102 | ||
2099 | #include "libkdepim/kdatepicker.h" | 2103 | #include "libkdepim/kdatepicker.h" |
2100 | #include <kdatetbl.h> | 2104 | #include <kdatetbl.h> |
2101 | void MainWindow::weekAction() | 2105 | void MainWindow::weekAction() |
2102 | { | 2106 | { |
2103 | int month; | 2107 | int month; |
2104 | KPopupFrame* popup = new KPopupFrame(this); | 2108 | KPopupFrame* popup = new KPopupFrame(this); |
2105 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); | 2109 | KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); |
2106 | // ----- | 2110 | // ----- |
2107 | picker->resize(picker->sizeHint()); | 2111 | picker->resize(picker->sizeHint()); |
2108 | popup->setMainWidget(picker); | 2112 | popup->setMainWidget(picker); |
2109 | picker->setFocus(); | 2113 | picker->setFocus(); |
2110 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); | 2114 | connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); |
2111 | int x = 0; | 2115 | int x = 0; |
2112 | int y = iconToolBar->height(); | 2116 | int y = iconToolBar->height(); |
2113 | int dX = 0; | 2117 | int dX = 0; |
2114 | int dY = 0; | 2118 | int dY = 0; |
2115 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2119 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |
2116 | if ( iconToolBar->y() > height()/2 ) { | 2120 | if ( iconToolBar->y() > height()/2 ) { |
2117 | dY = picker->sizeHint().height()+8; | 2121 | dY = picker->sizeHint().height()+8; |
2118 | y = 0; | 2122 | y = 0; |
2119 | } | 2123 | } |
2120 | } else { | 2124 | } else { |
2121 | if ( iconToolBar->x() > width()/2 ) { // right side | 2125 | if ( iconToolBar->x() > width()/2 ) { // right side |
2122 | x=0; | 2126 | x=0; |
2123 | dX= picker->sizeHint().width()+8; | 2127 | dX= picker->sizeHint().width()+8; |
2124 | y = 0; | 2128 | y = 0; |
2125 | } else { | 2129 | } else { |
2126 | x= iconToolBar->width(); | 2130 | x= iconToolBar->width(); |
2127 | y = 0; | 2131 | y = 0; |
2128 | } | 2132 | } |
2129 | } | 2133 | } |
2130 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); | 2134 | //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); |
2131 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) | 2135 | if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) |
2132 | { | 2136 | { |
2133 | month = picker->getResult(); | 2137 | month = picker->getResult(); |
2134 | emit selectWeek ( month ); | 2138 | emit selectWeek ( month ); |
2135 | //qDebug("weekSelected %d ", month); | 2139 | //qDebug("weekSelected %d ", month); |
2136 | } | 2140 | } |
2137 | delete popup; | 2141 | delete popup; |
2138 | } | 2142 | } |
2139 | 2143 | ||
2140 | void MainWindow::hideEvent ( QHideEvent * ) | 2144 | void MainWindow::hideEvent ( QHideEvent * ) |
2141 | { | 2145 | { |
2142 | QString message; | 2146 | QString message; |
2143 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); | 2147 | QDateTime nextA = mCalendar->nextAlarmEventDateTime(); |
2144 | if ( nextA.isValid() ) { | 2148 | if ( nextA.isValid() ) { |
2145 | QString sum = mCalendar->nextSummary(); | 2149 | QString sum = mCalendar->nextSummary(); |
2146 | 2150 | ||
2147 | message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); | 2151 | message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); |
2148 | setCaption( message ); | 2152 | setCaption( message ); |
2149 | } | 2153 | } |
2150 | } | 2154 | } |
diff --git a/libkcal/calendarlocal.cpp b/libkcal/calendarlocal.cpp index 52c298b..5c889c3 100644 --- a/libkcal/calendarlocal.cpp +++ b/libkcal/calendarlocal.cpp | |||
@@ -1,725 +1,726 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | 3 | ||
4 | Copyright (c) 1998 Preston Brown | 4 | Copyright (c) 1998 Preston Brown |
5 | Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org> | 5 | Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org> |
6 | 6 | ||
7 | This library is free software; you can redistribute it and/or | 7 | This library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public | 8 | modify it under the terms of the GNU Library General Public |
9 | License as published by the Free Software Foundation; either | 9 | License as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. | 10 | version 2 of the License, or (at your option) any later version. |
11 | 11 | ||
12 | This library is distributed in the hope that it will be useful, | 12 | This library is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Library General Public License for more details. | 15 | Library General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU Library General Public License | 17 | You should have received a copy of the GNU Library General Public License |
18 | along with this library; see the file COPYING.LIB. If not, write to | 18 | along with this library; see the file COPYING.LIB. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <qdatetime.h> | 23 | #include <qdatetime.h> |
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qptrlist.h> | 25 | #include <qptrlist.h> |
26 | 26 | ||
27 | #include <kdebug.h> | 27 | #include <kdebug.h> |
28 | #include <kconfig.h> | 28 | #include <kconfig.h> |
29 | #include <kglobal.h> | 29 | #include <kglobal.h> |
30 | #include <klocale.h> | 30 | #include <klocale.h> |
31 | 31 | ||
32 | #include "vcaldrag.h" | 32 | #include "vcaldrag.h" |
33 | #include "vcalformat.h" | 33 | #include "vcalformat.h" |
34 | #include "icalformat.h" | 34 | #include "icalformat.h" |
35 | #include "exceptions.h" | 35 | #include "exceptions.h" |
36 | #include "incidence.h" | 36 | #include "incidence.h" |
37 | #include "journal.h" | 37 | #include "journal.h" |
38 | #include "filestorage.h" | 38 | #include "filestorage.h" |
39 | #include "calfilter.h" | 39 | #include "calfilter.h" |
40 | 40 | ||
41 | #include "calendarlocal.h" | 41 | #include "calendarlocal.h" |
42 | 42 | ||
43 | // #ifndef DESKTOP_VERSION | 43 | // #ifndef DESKTOP_VERSION |
44 | // #include <qtopia/alarmserver.h> | 44 | // #include <qtopia/alarmserver.h> |
45 | // #endif | 45 | // #endif |
46 | using namespace KCal; | 46 | using namespace KCal; |
47 | 47 | ||
48 | CalendarLocal::CalendarLocal() | 48 | CalendarLocal::CalendarLocal() |
49 | : Calendar() | 49 | : Calendar() |
50 | { | 50 | { |
51 | init(); | 51 | init(); |
52 | } | 52 | } |
53 | 53 | ||
54 | CalendarLocal::CalendarLocal(const QString &timeZoneId) | 54 | CalendarLocal::CalendarLocal(const QString &timeZoneId) |
55 | : Calendar(timeZoneId) | 55 | : Calendar(timeZoneId) |
56 | { | 56 | { |
57 | init(); | 57 | init(); |
58 | } | 58 | } |
59 | 59 | ||
60 | void CalendarLocal::init() | 60 | void CalendarLocal::init() |
61 | { | 61 | { |
62 | mNextAlarmIncidence = 0; | 62 | mNextAlarmIncidence = 0; |
63 | } | 63 | } |
64 | 64 | ||
65 | 65 | ||
66 | CalendarLocal::~CalendarLocal() | 66 | CalendarLocal::~CalendarLocal() |
67 | { | 67 | { |
68 | close(); | 68 | close(); |
69 | } | 69 | } |
70 | 70 | ||
71 | bool CalendarLocal::load( const QString &fileName ) | 71 | bool CalendarLocal::load( const QString &fileName ) |
72 | { | 72 | { |
73 | FileStorage storage( this, fileName ); | 73 | FileStorage storage( this, fileName ); |
74 | return storage.load(); | 74 | return storage.load(); |
75 | } | 75 | } |
76 | 76 | ||
77 | bool CalendarLocal::save( const QString &fileName, CalFormat *format ) | 77 | bool CalendarLocal::save( const QString &fileName, CalFormat *format ) |
78 | { | 78 | { |
79 | FileStorage storage( this, fileName, format ); | 79 | FileStorage storage( this, fileName, format ); |
80 | return storage.save(); | 80 | return storage.save(); |
81 | } | 81 | } |
82 | 82 | ||
83 | void CalendarLocal::close() | 83 | void CalendarLocal::close() |
84 | { | 84 | { |
85 | mEventList.setAutoDelete( true ); | 85 | mEventList.setAutoDelete( true ); |
86 | mTodoList.setAutoDelete( true ); | 86 | mTodoList.setAutoDelete( true ); |
87 | mJournalList.setAutoDelete( false ); | 87 | mJournalList.setAutoDelete( false ); |
88 | 88 | ||
89 | mEventList.clear(); | 89 | mEventList.clear(); |
90 | mTodoList.clear(); | 90 | mTodoList.clear(); |
91 | mJournalList.clear(); | 91 | mJournalList.clear(); |
92 | 92 | ||
93 | mEventList.setAutoDelete( false ); | 93 | mEventList.setAutoDelete( false ); |
94 | mTodoList.setAutoDelete( false ); | 94 | mTodoList.setAutoDelete( false ); |
95 | mJournalList.setAutoDelete( false ); | 95 | mJournalList.setAutoDelete( false ); |
96 | 96 | ||
97 | setModified( false ); | 97 | setModified( false ); |
98 | } | 98 | } |
99 | 99 | ||
100 | bool CalendarLocal::addAnniversaryNoDup( Event *event ) | 100 | bool CalendarLocal::addAnniversaryNoDup( Event *event ) |
101 | { | 101 | { |
102 | QString cat; | 102 | QString cat; |
103 | bool isBirthday = true; | 103 | bool isBirthday = true; |
104 | if( event->categoriesStr() == i18n( "Anniversary" ) ) { | 104 | if( event->categoriesStr() == i18n( "Anniversary" ) ) { |
105 | isBirthday = false; | 105 | isBirthday = false; |
106 | cat = i18n( "Anniversary" ); | 106 | cat = i18n( "Anniversary" ); |
107 | } else if( event->categoriesStr() == i18n( "Birthday" ) ) { | 107 | } else if( event->categoriesStr() == i18n( "Birthday" ) ) { |
108 | isBirthday = true; | 108 | isBirthday = true; |
109 | cat = i18n( "Birthday" ); | 109 | cat = i18n( "Birthday" ); |
110 | } else { | 110 | } else { |
111 | qDebug("addAnniversaryNoDup called without fitting category! "); | 111 | qDebug("addAnniversaryNoDup called without fitting category! "); |
112 | return false; | 112 | return false; |
113 | } | 113 | } |
114 | Event * eve; | 114 | Event * eve; |
115 | for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { | 115 | for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { |
116 | if ( !(eve->categories().contains( cat ) )) | 116 | if ( !(eve->categories().contains( cat ) )) |
117 | continue; | 117 | continue; |
118 | // now we have an event with fitting category | 118 | // now we have an event with fitting category |
119 | if ( eve->dtStart().date() != event->dtStart().date() ) | 119 | if ( eve->dtStart().date() != event->dtStart().date() ) |
120 | continue; | 120 | continue; |
121 | // now we have an event with fitting category+date | 121 | // now we have an event with fitting category+date |
122 | if ( eve->summary() != event->summary() ) | 122 | if ( eve->summary() != event->summary() ) |
123 | continue; | 123 | continue; |
124 | // now we have an event with fitting category+date+summary | 124 | // now we have an event with fitting category+date+summary |
125 | return false; | 125 | return false; |
126 | } | 126 | } |
127 | return addEvent( event ); | 127 | return addEvent( event ); |
128 | 128 | ||
129 | } | 129 | } |
130 | bool CalendarLocal::addEventNoDup( Event *event ) | 130 | bool CalendarLocal::addEventNoDup( Event *event ) |
131 | { | 131 | { |
132 | Event * eve; | 132 | Event * eve; |
133 | for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { | 133 | for ( eve = mEventList.first(); eve ; eve = mEventList.next() ) { |
134 | if ( *eve == *event ) { | 134 | if ( *eve == *event ) { |
135 | //qDebug("CalendarLocal::Duplicate event found! Not inserted! "); | 135 | //qDebug("CalendarLocal::Duplicate event found! Not inserted! "); |
136 | return false; | 136 | return false; |
137 | } | 137 | } |
138 | } | 138 | } |
139 | return addEvent( event ); | 139 | return addEvent( event ); |
140 | } | 140 | } |
141 | 141 | ||
142 | bool CalendarLocal::addEvent( Event *event ) | 142 | bool CalendarLocal::addEvent( Event *event ) |
143 | { | 143 | { |
144 | insertEvent( event ); | 144 | insertEvent( event ); |
145 | 145 | ||
146 | event->registerObserver( this ); | 146 | event->registerObserver( this ); |
147 | 147 | ||
148 | setModified( true ); | 148 | setModified( true ); |
149 | 149 | ||
150 | return true; | 150 | return true; |
151 | } | 151 | } |
152 | 152 | ||
153 | void CalendarLocal::deleteEvent( Event *event ) | 153 | void CalendarLocal::deleteEvent( Event *event ) |
154 | { | 154 | { |
155 | if ( mUndoIncidence ) delete mUndoIncidence; | 155 | if ( mUndoIncidence ) delete mUndoIncidence; |
156 | mUndoIncidence = event->clone(); | 156 | mUndoIncidence = event->clone(); |
157 | if ( mEventList.removeRef( event ) ) { | 157 | if ( mEventList.removeRef( event ) ) { |
158 | setModified( true ); | 158 | setModified( true ); |
159 | } | 159 | } |
160 | } | 160 | } |
161 | 161 | ||
162 | 162 | ||
163 | Event *CalendarLocal::event( const QString &uid ) | 163 | Event *CalendarLocal::event( const QString &uid ) |
164 | { | 164 | { |
165 | 165 | ||
166 | Event *event; | 166 | Event *event; |
167 | 167 | ||
168 | for ( event = mEventList.first(); event; event = mEventList.next() ) { | 168 | for ( event = mEventList.first(); event; event = mEventList.next() ) { |
169 | if ( event->uid() == uid ) { | 169 | if ( event->uid() == uid ) { |
170 | return event; | 170 | return event; |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | return 0; | 174 | return 0; |
175 | } | 175 | } |
176 | bool CalendarLocal::addTodoNoDup( Todo *todo ) | 176 | bool CalendarLocal::addTodoNoDup( Todo *todo ) |
177 | { | 177 | { |
178 | Todo * eve; | 178 | Todo * eve; |
179 | for ( eve = mTodoList.first(); eve ; eve = mTodoList.next() ) { | 179 | for ( eve = mTodoList.first(); eve ; eve = mTodoList.next() ) { |
180 | if ( *eve == *todo ) { | 180 | if ( *eve == *todo ) { |
181 | //qDebug("duplicate todo found! not inserted! "); | 181 | //qDebug("duplicate todo found! not inserted! "); |
182 | return false; | 182 | return false; |
183 | } | 183 | } |
184 | } | 184 | } |
185 | return addTodo( todo ); | 185 | return addTodo( todo ); |
186 | } | 186 | } |
187 | bool CalendarLocal::addTodo( Todo *todo ) | 187 | bool CalendarLocal::addTodo( Todo *todo ) |
188 | { | 188 | { |
189 | mTodoList.append( todo ); | 189 | mTodoList.append( todo ); |
190 | 190 | ||
191 | todo->registerObserver( this ); | 191 | todo->registerObserver( this ); |
192 | 192 | ||
193 | // Set up subtask relations | 193 | // Set up subtask relations |
194 | setupRelations( todo ); | 194 | setupRelations( todo ); |
195 | 195 | ||
196 | setModified( true ); | 196 | setModified( true ); |
197 | 197 | ||
198 | return true; | 198 | return true; |
199 | } | 199 | } |
200 | 200 | ||
201 | void CalendarLocal::deleteTodo( Todo *todo ) | 201 | void CalendarLocal::deleteTodo( Todo *todo ) |
202 | { | 202 | { |
203 | // Handle orphaned children | 203 | // Handle orphaned children |
204 | if ( mUndoIncidence ) delete mUndoIncidence; | 204 | if ( mUndoIncidence ) delete mUndoIncidence; |
205 | removeRelations( todo ); | 205 | removeRelations( todo ); |
206 | mUndoIncidence = todo->clone(); | 206 | mUndoIncidence = todo->clone(); |
207 | 207 | ||
208 | if ( mTodoList.removeRef( todo ) ) { | 208 | if ( mTodoList.removeRef( todo ) ) { |
209 | setModified( true ); | 209 | setModified( true ); |
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | QPtrList<Todo> CalendarLocal::rawTodos() | 213 | QPtrList<Todo> CalendarLocal::rawTodos() |
214 | { | 214 | { |
215 | return mTodoList; | 215 | return mTodoList; |
216 | } | 216 | } |
217 | Todo *CalendarLocal::todo( QString syncProf, QString id ) | 217 | Todo *CalendarLocal::todo( QString syncProf, QString id ) |
218 | { | 218 | { |
219 | Todo *todo; | 219 | Todo *todo; |
220 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 220 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
221 | if ( todo->getID( syncProf ) == id ) return todo; | 221 | if ( todo->getID( syncProf ) == id ) return todo; |
222 | } | 222 | } |
223 | 223 | ||
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
226 | void CalendarLocal::removeSyncInfo( QString syncProfile) | 226 | void CalendarLocal::removeSyncInfo( QString syncProfile) |
227 | { | 227 | { |
228 | QPtrList<Incidence> all = rawIncidences() ; | 228 | QPtrList<Incidence> all = rawIncidences() ; |
229 | Incidence *inc; | 229 | Incidence *inc; |
230 | for ( inc = all.first(); inc; inc = all.next() ) { | 230 | for ( inc = all.first(); inc; inc = all.next() ) { |
231 | inc->removeID( syncProfile ); | 231 | inc->removeID( syncProfile ); |
232 | } | 232 | } |
233 | if ( syncProfile.isEmpty() ) { | 233 | if ( syncProfile.isEmpty() ) { |
234 | QPtrList<Event> el; | 234 | QPtrList<Event> el; |
235 | Event *todo; | 235 | Event *todo; |
236 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { | 236 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { |
237 | if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) | 237 | if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) |
238 | el.append( todo ); | 238 | el.append( todo ); |
239 | } | 239 | } |
240 | for ( todo = el.first(); todo; todo = el.next() ) { | 240 | for ( todo = el.first(); todo; todo = el.next() ) { |
241 | deleteIncidence ( todo ); | 241 | deleteIncidence ( todo ); |
242 | } | 242 | } |
243 | } else { | 243 | } else { |
244 | Event *lse = event( "last-syncEvent-"+ syncProfile); | 244 | Event *lse = event( "last-syncEvent-"+ syncProfile); |
245 | if ( lse ) | 245 | if ( lse ) |
246 | deleteIncidence ( lse ); | 246 | deleteIncidence ( lse ); |
247 | } | 247 | } |
248 | } | 248 | } |
249 | QPtrList<Event> CalendarLocal::getExternLastSyncEvents() | 249 | QPtrList<Event> CalendarLocal::getExternLastSyncEvents() |
250 | { | 250 | { |
251 | QPtrList<Event> el; | 251 | QPtrList<Event> el; |
252 | Event *todo; | 252 | Event *todo; |
253 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { | 253 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { |
254 | if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) | 254 | if ( todo->uid().left( 15 ) == QString("last-syncEvent-") ) |
255 | if ( todo->summary().left(3) == "E: " ) | 255 | if ( todo->summary().left(3) == "E: " ) |
256 | el.append( todo ); | 256 | el.append( todo ); |
257 | } | 257 | } |
258 | 258 | ||
259 | return el; | 259 | return el; |
260 | 260 | ||
261 | } | 261 | } |
262 | Event *CalendarLocal::event( QString syncProf, QString id ) | 262 | Event *CalendarLocal::event( QString syncProf, QString id ) |
263 | { | 263 | { |
264 | Event *todo; | 264 | Event *todo; |
265 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { | 265 | for ( todo = mEventList.first(); todo; todo = mEventList.next() ) { |
266 | if ( todo->getID( syncProf ) == id ) return todo; | 266 | if ( todo->getID( syncProf ) == id ) return todo; |
267 | } | 267 | } |
268 | 268 | ||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | Todo *CalendarLocal::todo( const QString &uid ) | 271 | Todo *CalendarLocal::todo( const QString &uid ) |
272 | { | 272 | { |
273 | Todo *todo; | 273 | Todo *todo; |
274 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 274 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
275 | if ( todo->uid() == uid ) return todo; | 275 | if ( todo->uid() == uid ) return todo; |
276 | } | 276 | } |
277 | 277 | ||
278 | return 0; | 278 | return 0; |
279 | } | 279 | } |
280 | QString CalendarLocal::nextSummary() const | 280 | QString CalendarLocal::nextSummary() const |
281 | { | 281 | { |
282 | return mNextSummary; | 282 | return mNextSummary; |
283 | } | 283 | } |
284 | QDateTime CalendarLocal::nextAlarmEventDateTime() const | 284 | QDateTime CalendarLocal::nextAlarmEventDateTime() const |
285 | { | 285 | { |
286 | return mNextAlarmEventDateTime; | 286 | return mNextAlarmEventDateTime; |
287 | } | 287 | } |
288 | void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted) | 288 | void CalendarLocal::checkAlarmForIncidence( Incidence * incidence, bool deleted) |
289 | { | 289 | { |
290 | //mNextAlarmIncidence | 290 | //mNextAlarmIncidence |
291 | //mNextAlarmDateTime | 291 | //mNextAlarmDateTime |
292 | //return mNextSummary; | 292 | //return mNextSummary; |
293 | //return mNextAlarmEventDateTime; | 293 | //return mNextAlarmEventDateTime; |
294 | bool newNextAlarm = false; | 294 | bool newNextAlarm = false; |
295 | bool computeNextAlarm = false; | 295 | bool computeNextAlarm = false; |
296 | bool ok; | 296 | bool ok; |
297 | int offset; | 297 | int offset; |
298 | QDateTime nextA; | 298 | QDateTime nextA; |
299 | // QString nextSum; | 299 | // QString nextSum; |
300 | //QDateTime nextEvent; | 300 | //QDateTime nextEvent; |
301 | mNextAlarmEventDateTime = QDateTime(); | ||
301 | if ( mNextAlarmIncidence == 0 || incidence == 0 ) { | 302 | if ( mNextAlarmIncidence == 0 || incidence == 0 ) { |
302 | computeNextAlarm = true; | 303 | computeNextAlarm = true; |
303 | } else { | 304 | } else { |
304 | if ( ! deleted ) { | 305 | if ( ! deleted ) { |
305 | nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ; | 306 | nextA = incidence->getNextAlarmDateTime(& ok, &offset ) ; |
306 | if ( ok ) { | 307 | if ( ok ) { |
307 | if ( nextA < mNextAlarmDateTime ) { | 308 | if ( nextA < mNextAlarmDateTime ) { |
308 | deRegisterAlarm(); | 309 | deRegisterAlarm(); |
309 | mNextAlarmDateTime = nextA; | 310 | mNextAlarmDateTime = nextA; |
310 | mNextSummary = incidence->summary(); | 311 | mNextSummary = incidence->summary(); |
311 | mNextAlarmEventDateTime = nextA.addSecs(offset ) ; | 312 | mNextAlarmEventDateTime = nextA.addSecs(offset ) ; |
312 | mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); | 313 | mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); |
313 | newNextAlarm = true; | 314 | newNextAlarm = true; |
314 | mNextAlarmIncidence = incidence; | 315 | mNextAlarmIncidence = incidence; |
315 | } else { | 316 | } else { |
316 | if ( incidence == mNextAlarmIncidence ) { | 317 | if ( incidence == mNextAlarmIncidence ) { |
317 | computeNextAlarm = true; | 318 | computeNextAlarm = true; |
318 | } | 319 | } |
319 | } | 320 | } |
320 | } else { | 321 | } else { |
321 | if ( mNextAlarmIncidence == incidence ) { | 322 | if ( mNextAlarmIncidence == incidence ) { |
322 | computeNextAlarm = true; | 323 | computeNextAlarm = true; |
323 | } | 324 | } |
324 | } | 325 | } |
325 | } else { // deleted | 326 | } else { // deleted |
326 | if ( incidence == mNextAlarmIncidence ) { | 327 | if ( incidence == mNextAlarmIncidence ) { |
327 | computeNextAlarm = true; | 328 | computeNextAlarm = true; |
328 | } | 329 | } |
329 | } | 330 | } |
330 | } | 331 | } |
331 | if ( computeNextAlarm ) { | 332 | if ( computeNextAlarm ) { |
332 | deRegisterAlarm(); | 333 | deRegisterAlarm(); |
333 | nextA = nextAlarm( 1000 ); | 334 | nextA = nextAlarm( 1000 ); |
334 | if (! mNextAlarmIncidence ) { | 335 | if (! mNextAlarmIncidence ) { |
335 | return; | 336 | return; |
336 | } | 337 | } |
337 | newNextAlarm = true; | 338 | newNextAlarm = true; |
338 | } | 339 | } |
339 | if ( newNextAlarm ) | 340 | if ( newNextAlarm ) |
340 | registerAlarm(); | 341 | registerAlarm(); |
341 | } | 342 | } |
342 | QString CalendarLocal:: getAlarmNotification() | 343 | QString CalendarLocal:: getAlarmNotification() |
343 | { | 344 | { |
344 | QString ret; | 345 | QString ret; |
345 | // this should not happen | 346 | // this should not happen |
346 | if (! mNextAlarmIncidence ) | 347 | if (! mNextAlarmIncidence ) |
347 | return "cal_alarm"+ mNextSummary.left( 25 )+"\n"+mNextAlarmEventDateTimeString; | 348 | return "cal_alarm"+ mNextSummary.left( 25 )+"\n"+mNextAlarmEventDateTimeString; |
348 | Alarm* alarm = mNextAlarmIncidence->alarms().first(); | 349 | Alarm* alarm = mNextAlarmIncidence->alarms().first(); |
349 | if ( alarm->type() == Alarm::Procedure ) { | 350 | if ( alarm->type() == Alarm::Procedure ) { |
350 | ret = "proc_alarm" + alarm->programFile()+"+++"; | 351 | ret = "proc_alarm" + alarm->programFile()+"+++"; |
351 | } else { | 352 | } else { |
352 | ret = "audio_alarm" +alarm->audioFile() +"+++"; | 353 | ret = "audio_alarm" +alarm->audioFile() +"+++"; |
353 | } | 354 | } |
354 | ret += "cal_alarm"+ mNextSummary.left( 25 ); | 355 | ret += "cal_alarm"+ mNextSummary.left( 25 ); |
355 | if ( mNextSummary.length() > 25 ) | 356 | if ( mNextSummary.length() > 25 ) |
356 | ret += "\n" + mNextSummary.mid(25, 25 ); | 357 | ret += "\n" + mNextSummary.mid(25, 25 ); |
357 | ret+= "\n"+mNextAlarmEventDateTimeString; | 358 | ret+= "\n"+mNextAlarmEventDateTimeString; |
358 | return ret; | 359 | return ret; |
359 | } | 360 | } |
360 | void CalendarLocal::registerAlarm() | 361 | void CalendarLocal::registerAlarm() |
361 | { | 362 | { |
362 | mLastAlarmNotificationString = getAlarmNotification(); | 363 | mLastAlarmNotificationString = getAlarmNotification(); |
363 | // qDebug("++ register Alarm %s %s",mNextAlarmDateTime.toString().latin1(), mLastAlarmNotificationString.latin1() ); | 364 | // qDebug("++ register Alarm %s %s",mNextAlarmDateTime.toString().latin1(), mLastAlarmNotificationString.latin1() ); |
364 | emit addAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); | 365 | emit addAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); |
365 | // #ifndef DESKTOP_VERSION | 366 | // #ifndef DESKTOP_VERSION |
366 | // AlarmServer::addAlarm ( mNextAlarmDateTime,"koalarm", mLastAlarmNotificationString.latin1() ); | 367 | // AlarmServer::addAlarm ( mNextAlarmDateTime,"koalarm", mLastAlarmNotificationString.latin1() ); |
367 | // #endif | 368 | // #endif |
368 | } | 369 | } |
369 | void CalendarLocal::deRegisterAlarm() | 370 | void CalendarLocal::deRegisterAlarm() |
370 | { | 371 | { |
371 | if ( mLastAlarmNotificationString.isNull() ) | 372 | if ( mLastAlarmNotificationString.isNull() ) |
372 | return; | 373 | return; |
373 | //qDebug("-- deregister Alarm %s ", mLastAlarmNotificationString.latin1() ); | 374 | //qDebug("-- deregister Alarm %s ", mLastAlarmNotificationString.latin1() ); |
374 | 375 | ||
375 | emit removeAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); | 376 | emit removeAlarm ( mNextAlarmDateTime, mLastAlarmNotificationString ); |
376 | // #ifndef DESKTOP_VERSION | 377 | // #ifndef DESKTOP_VERSION |
377 | // AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() ); | 378 | // AlarmServer::deleteAlarm (mNextAlarmDateTime ,"koalarm" ,mLastAlarmNotificationString.latin1() ); |
378 | // #endif | 379 | // #endif |
379 | } | 380 | } |
380 | 381 | ||
381 | QPtrList<Todo> CalendarLocal::todos( const QDate &date ) | 382 | QPtrList<Todo> CalendarLocal::todos( const QDate &date ) |
382 | { | 383 | { |
383 | QPtrList<Todo> todos; | 384 | QPtrList<Todo> todos; |
384 | 385 | ||
385 | Todo *todo; | 386 | Todo *todo; |
386 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { | 387 | for ( todo = mTodoList.first(); todo; todo = mTodoList.next() ) { |
387 | if ( todo->hasDueDate() && todo->dtDue().date() == date ) { | 388 | if ( todo->hasDueDate() && todo->dtDue().date() == date ) { |
388 | todos.append( todo ); | 389 | todos.append( todo ); |
389 | } | 390 | } |
390 | } | 391 | } |
391 | 392 | ||
392 | filter()->apply( &todos ); | 393 | filter()->apply( &todos ); |
393 | return todos; | 394 | return todos; |
394 | } | 395 | } |
395 | void CalendarLocal::reInitAlarmSettings() | 396 | void CalendarLocal::reInitAlarmSettings() |
396 | { | 397 | { |
397 | if ( !mNextAlarmIncidence ) { | 398 | if ( !mNextAlarmIncidence ) { |
398 | nextAlarm( 1000 ); | 399 | nextAlarm( 1000 ); |
399 | } | 400 | } |
400 | deRegisterAlarm(); | 401 | deRegisterAlarm(); |
401 | mNextAlarmIncidence = 0; | 402 | mNextAlarmIncidence = 0; |
402 | checkAlarmForIncidence( 0, false ); | 403 | checkAlarmForIncidence( 0, false ); |
403 | 404 | ||
404 | } | 405 | } |
405 | 406 | ||
406 | 407 | ||
407 | 408 | ||
408 | QDateTime CalendarLocal::nextAlarm( int daysTo ) | 409 | QDateTime CalendarLocal::nextAlarm( int daysTo ) |
409 | { | 410 | { |
410 | QDateTime nextA = QDateTime::currentDateTime().addDays( daysTo ); | 411 | QDateTime nextA = QDateTime::currentDateTime().addDays( daysTo ); |
411 | QDateTime start = QDateTime::currentDateTime().addSecs( 30 ); | 412 | QDateTime start = QDateTime::currentDateTime().addSecs( 30 ); |
412 | QDateTime next; | 413 | QDateTime next; |
413 | Event *e; | 414 | Event *e; |
414 | bool ok; | 415 | bool ok; |
415 | bool found = false; | 416 | bool found = false; |
416 | int offset; | 417 | int offset; |
417 | mNextAlarmIncidence = 0; | 418 | mNextAlarmIncidence = 0; |
418 | for( e = mEventList.first(); e; e = mEventList.next() ) { | 419 | for( e = mEventList.first(); e; e = mEventList.next() ) { |
419 | next = e->getNextAlarmDateTime(& ok, &offset ) ; | 420 | next = e->getNextAlarmDateTime(& ok, &offset ) ; |
420 | if ( ok ) { | 421 | if ( ok ) { |
421 | if ( next < nextA ) { | 422 | if ( next < nextA ) { |
422 | nextA = next; | 423 | nextA = next; |
423 | found = true; | 424 | found = true; |
424 | mNextSummary = e->summary(); | 425 | mNextSummary = e->summary(); |
425 | mNextAlarmEventDateTime = next.addSecs(offset ) ; | 426 | mNextAlarmEventDateTime = next.addSecs(offset ) ; |
426 | mNextAlarmIncidence = (Incidence *) e; | 427 | mNextAlarmIncidence = (Incidence *) e; |
427 | } | 428 | } |
428 | } | 429 | } |
429 | } | 430 | } |
430 | Todo *t; | 431 | Todo *t; |
431 | for( t = mTodoList.first(); t; t = mTodoList.next() ) { | 432 | for( t = mTodoList.first(); t; t = mTodoList.next() ) { |
432 | next = t->getNextAlarmDateTime(& ok, &offset ) ; | 433 | next = t->getNextAlarmDateTime(& ok, &offset ) ; |
433 | if ( ok ) { | 434 | if ( ok ) { |
434 | if ( next < nextA ) { | 435 | if ( next < nextA ) { |
435 | nextA = next; | 436 | nextA = next; |
436 | found = true; | 437 | found = true; |
437 | mNextSummary = t->summary(); | 438 | mNextSummary = t->summary(); |
438 | mNextAlarmEventDateTime = next.addSecs(offset ); | 439 | mNextAlarmEventDateTime = next.addSecs(offset ); |
439 | mNextAlarmIncidence = (Incidence *) t; | 440 | mNextAlarmIncidence = (Incidence *) t; |
440 | } | 441 | } |
441 | } | 442 | } |
442 | } | 443 | } |
443 | if ( mNextAlarmIncidence ) { | 444 | if ( mNextAlarmIncidence ) { |
444 | mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); | 445 | mNextAlarmEventDateTimeString = KGlobal::locale()->formatDateTime(mNextAlarmEventDateTime); |
445 | mNextAlarmDateTime = nextA; | 446 | mNextAlarmDateTime = nextA; |
446 | } | 447 | } |
447 | return nextA; | 448 | return nextA; |
448 | } | 449 | } |
449 | Alarm::List CalendarLocal::alarmsTo( const QDateTime &to ) | 450 | Alarm::List CalendarLocal::alarmsTo( const QDateTime &to ) |
450 | { | 451 | { |
451 | return alarms( QDateTime( QDate( 1900, 1, 1 ) ), to ); | 452 | return alarms( QDateTime( QDate( 1900, 1, 1 ) ), to ); |
452 | } | 453 | } |
453 | 454 | ||
454 | Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) | 455 | Alarm::List CalendarLocal::alarms( const QDateTime &from, const QDateTime &to ) |
455 | { | 456 | { |
456 | kdDebug(5800) << "CalendarLocal::alarms(" << from.toString() << " - " | 457 | kdDebug(5800) << "CalendarLocal::alarms(" << from.toString() << " - " |
457 | << to.toString() << ")\n"; | 458 | << to.toString() << ")\n"; |
458 | 459 | ||
459 | Alarm::List alarms; | 460 | Alarm::List alarms; |
460 | 461 | ||
461 | Event *e; | 462 | Event *e; |
462 | 463 | ||
463 | for( e = mEventList.first(); e; e = mEventList.next() ) { | 464 | for( e = mEventList.first(); e; e = mEventList.next() ) { |
464 | if ( e->doesRecur() ) appendRecurringAlarms( alarms, e, from, to ); | 465 | if ( e->doesRecur() ) appendRecurringAlarms( alarms, e, from, to ); |
465 | else appendAlarms( alarms, e, from, to ); | 466 | else appendAlarms( alarms, e, from, to ); |
466 | } | 467 | } |
467 | 468 | ||
468 | Todo *t; | 469 | Todo *t; |
469 | for( t = mTodoList.first(); t; t = mTodoList.next() ) { | 470 | for( t = mTodoList.first(); t; t = mTodoList.next() ) { |
470 | appendAlarms( alarms, t, from, to ); | 471 | appendAlarms( alarms, t, from, to ); |
471 | } | 472 | } |
472 | 473 | ||
473 | return alarms; | 474 | return alarms; |
474 | } | 475 | } |
475 | 476 | ||
476 | void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, | 477 | void CalendarLocal::appendAlarms( Alarm::List &alarms, Incidence *incidence, |
477 | const QDateTime &from, const QDateTime &to ) | 478 | const QDateTime &from, const QDateTime &to ) |
478 | { | 479 | { |
479 | QPtrList<Alarm> alarmList = incidence->alarms(); | 480 | QPtrList<Alarm> alarmList = incidence->alarms(); |
480 | Alarm *alarm; | 481 | Alarm *alarm; |
481 | for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { | 482 | for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { |
482 | // kdDebug(5800) << "CalendarLocal::appendAlarms() '" << alarm->text() | 483 | // kdDebug(5800) << "CalendarLocal::appendAlarms() '" << alarm->text() |
483 | // << "': " << alarm->time().toString() << " - " << alarm->enabled() << endl; | 484 | // << "': " << alarm->time().toString() << " - " << alarm->enabled() << endl; |
484 | if ( alarm->enabled() ) { | 485 | if ( alarm->enabled() ) { |
485 | if ( alarm->time() >= from && alarm->time() <= to ) { | 486 | if ( alarm->time() >= from && alarm->time() <= to ) { |
486 | kdDebug(5800) << "CalendarLocal::appendAlarms() '" << incidence->summary() | 487 | kdDebug(5800) << "CalendarLocal::appendAlarms() '" << incidence->summary() |
487 | << "': " << alarm->time().toString() << endl; | 488 | << "': " << alarm->time().toString() << endl; |
488 | alarms.append( alarm ); | 489 | alarms.append( alarm ); |
489 | } | 490 | } |
490 | } | 491 | } |
491 | } | 492 | } |
492 | } | 493 | } |
493 | 494 | ||
494 | void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, | 495 | void CalendarLocal::appendRecurringAlarms( Alarm::List &alarms, |
495 | Incidence *incidence, | 496 | Incidence *incidence, |
496 | const QDateTime &from, | 497 | const QDateTime &from, |
497 | const QDateTime &to ) | 498 | const QDateTime &to ) |
498 | { | 499 | { |
499 | 500 | ||
500 | QPtrList<Alarm> alarmList = incidence->alarms(); | 501 | QPtrList<Alarm> alarmList = incidence->alarms(); |
501 | Alarm *alarm; | 502 | Alarm *alarm; |
502 | QDateTime qdt; | 503 | QDateTime qdt; |
503 | for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { | 504 | for( alarm = alarmList.first(); alarm; alarm = alarmList.next() ) { |
504 | if (incidence->recursOn(from.date())) { | 505 | if (incidence->recursOn(from.date())) { |
505 | qdt.setTime(alarm->time().time()); | 506 | qdt.setTime(alarm->time().time()); |
506 | qdt.setDate(from.date()); | 507 | qdt.setDate(from.date()); |
507 | } | 508 | } |
508 | else qdt = alarm->time(); | 509 | else qdt = alarm->time(); |
509 | // qDebug("1 %s %s %s", qdt.toString().latin1(), from.toString().latin1(), to.toString().latin1()); | 510 | // qDebug("1 %s %s %s", qdt.toString().latin1(), from.toString().latin1(), to.toString().latin1()); |
510 | if ( alarm->enabled() ) { | 511 | if ( alarm->enabled() ) { |
511 | if ( qdt >= from && qdt <= to ) { | 512 | if ( qdt >= from && qdt <= to ) { |
512 | alarms.append( alarm ); | 513 | alarms.append( alarm ); |
513 | } | 514 | } |
514 | } | 515 | } |
515 | } | 516 | } |
516 | } | 517 | } |
517 | 518 | ||
518 | 519 | ||
519 | /****************************** PROTECTED METHODS ****************************/ | 520 | /****************************** PROTECTED METHODS ****************************/ |
520 | 521 | ||
521 | // after changes are made to an event, this should be called. | 522 | // after changes are made to an event, this should be called. |
522 | void CalendarLocal::update( IncidenceBase *incidence ) | 523 | void CalendarLocal::update( IncidenceBase *incidence ) |
523 | { | 524 | { |
524 | incidence->setSyncStatus( Event::SYNCMOD ); | 525 | incidence->setSyncStatus( Event::SYNCMOD ); |
525 | incidence->setLastModified( QDateTime::currentDateTime() ); | 526 | incidence->setLastModified( QDateTime::currentDateTime() ); |
526 | // we should probably update the revision number here, | 527 | // we should probably update the revision number here, |
527 | // or internally in the Event itself when certain things change. | 528 | // or internally in the Event itself when certain things change. |
528 | // need to verify with ical documentation. | 529 | // need to verify with ical documentation. |
529 | 530 | ||
530 | setModified( true ); | 531 | setModified( true ); |
531 | } | 532 | } |
532 | 533 | ||
533 | void CalendarLocal::insertEvent( Event *event ) | 534 | void CalendarLocal::insertEvent( Event *event ) |
534 | { | 535 | { |
535 | if ( mEventList.findRef( event ) < 0 ) mEventList.append( event ); | 536 | if ( mEventList.findRef( event ) < 0 ) mEventList.append( event ); |
536 | } | 537 | } |
537 | 538 | ||
538 | 539 | ||
539 | QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) | 540 | QPtrList<Event> CalendarLocal::rawEventsForDate( const QDate &qd, bool sorted ) |
540 | { | 541 | { |
541 | QPtrList<Event> eventList; | 542 | QPtrList<Event> eventList; |
542 | 543 | ||
543 | Event *event; | 544 | Event *event; |
544 | for( event = mEventList.first(); event; event = mEventList.next() ) { | 545 | for( event = mEventList.first(); event; event = mEventList.next() ) { |
545 | if ( event->doesRecur() ) { | 546 | if ( event->doesRecur() ) { |
546 | if ( event->isMultiDay() ) { | 547 | if ( event->isMultiDay() ) { |
547 | int extraDays = event->dtStart().date().daysTo( event->dtEnd().date() ); | 548 | int extraDays = event->dtStart().date().daysTo( event->dtEnd().date() ); |
548 | int i; | 549 | int i; |
549 | for ( i = 0; i <= extraDays; i++ ) { | 550 | for ( i = 0; i <= extraDays; i++ ) { |
550 | if ( event->recursOn( qd.addDays( -i ) ) ) { | 551 | if ( event->recursOn( qd.addDays( -i ) ) ) { |
551 | eventList.append( event ); | 552 | eventList.append( event ); |
552 | break; | 553 | break; |
553 | } | 554 | } |
554 | } | 555 | } |
555 | } else { | 556 | } else { |
556 | if ( event->recursOn( qd ) ) | 557 | if ( event->recursOn( qd ) ) |
557 | eventList.append( event ); | 558 | eventList.append( event ); |
558 | } | 559 | } |
559 | } else { | 560 | } else { |
560 | if ( event->dtStart().date() <= qd && event->dtEnd().date() >= qd ) { | 561 | if ( event->dtStart().date() <= qd && event->dtEnd().date() >= qd ) { |
561 | eventList.append( event ); | 562 | eventList.append( event ); |
562 | } | 563 | } |
563 | } | 564 | } |
564 | } | 565 | } |
565 | 566 | ||
566 | if ( !sorted ) { | 567 | if ( !sorted ) { |
567 | return eventList; | 568 | return eventList; |
568 | } | 569 | } |
569 | 570 | ||
570 | // kdDebug(5800) << "Sorting events for date\n" << endl; | 571 | // kdDebug(5800) << "Sorting events for date\n" << endl; |
571 | // now, we have to sort it based on dtStart.time() | 572 | // now, we have to sort it based on dtStart.time() |
572 | QPtrList<Event> eventListSorted; | 573 | QPtrList<Event> eventListSorted; |
573 | Event *sortEvent; | 574 | Event *sortEvent; |
574 | for ( event = eventList.first(); event; event = eventList.next() ) { | 575 | for ( event = eventList.first(); event; event = eventList.next() ) { |
575 | sortEvent = eventListSorted.first(); | 576 | sortEvent = eventListSorted.first(); |
576 | int i = 0; | 577 | int i = 0; |
577 | while ( sortEvent && event->dtStart().time()>=sortEvent->dtStart().time() ) | 578 | while ( sortEvent && event->dtStart().time()>=sortEvent->dtStart().time() ) |
578 | { | 579 | { |
579 | i++; | 580 | i++; |
580 | sortEvent = eventListSorted.next(); | 581 | sortEvent = eventListSorted.next(); |
581 | } | 582 | } |
582 | eventListSorted.insert( i, event ); | 583 | eventListSorted.insert( i, event ); |
583 | } | 584 | } |
584 | return eventListSorted; | 585 | return eventListSorted; |
585 | } | 586 | } |
586 | 587 | ||
587 | 588 | ||
588 | QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, | 589 | QPtrList<Event> CalendarLocal::rawEvents( const QDate &start, const QDate &end, |
589 | bool inclusive ) | 590 | bool inclusive ) |
590 | { | 591 | { |
591 | Event *event = 0; | 592 | Event *event = 0; |
592 | 593 | ||
593 | QPtrList<Event> eventList; | 594 | QPtrList<Event> eventList; |
594 | 595 | ||
595 | // Get non-recurring events | 596 | // Get non-recurring events |
596 | for( event = mEventList.first(); event; event = mEventList.next() ) { | 597 | for( event = mEventList.first(); event; event = mEventList.next() ) { |
597 | if ( event->doesRecur() ) { | 598 | if ( event->doesRecur() ) { |
598 | QDate rStart = event->dtStart().date(); | 599 | QDate rStart = event->dtStart().date(); |
599 | bool found = false; | 600 | bool found = false; |
600 | if ( inclusive ) { | 601 | if ( inclusive ) { |
601 | if ( rStart >= start && rStart <= end ) { | 602 | if ( rStart >= start && rStart <= end ) { |
602 | // Start date of event is in range. Now check for end date. | 603 | // Start date of event is in range. Now check for end date. |
603 | // if duration is negative, event recurs forever, so do not include it. | 604 | // if duration is negative, event recurs forever, so do not include it. |
604 | if ( event->recurrence()->duration() == 0 ) { // End date set | 605 | if ( event->recurrence()->duration() == 0 ) { // End date set |
605 | QDate rEnd = event->recurrence()->endDate(); | 606 | QDate rEnd = event->recurrence()->endDate(); |
606 | if ( rEnd >= start && rEnd <= end ) { // End date within range | 607 | if ( rEnd >= start && rEnd <= end ) { // End date within range |
607 | found = true; | 608 | found = true; |
608 | } | 609 | } |
609 | } else if ( event->recurrence()->duration() > 0 ) { // Duration set | 610 | } else if ( event->recurrence()->duration() > 0 ) { // Duration set |
610 | // TODO: Calculate end date from duration. Should be done in Event | 611 | // TODO: Calculate end date from duration. Should be done in Event |
611 | // For now exclude all events with a duration. | 612 | // For now exclude all events with a duration. |
612 | } | 613 | } |
613 | } | 614 | } |
614 | } else { | 615 | } else { |
615 | bool founOne; | 616 | bool founOne; |
616 | QDate next = event->getNextOccurence( start, &founOne ).date(); | 617 | QDate next = event->getNextOccurence( start, &founOne ).date(); |
617 | if ( founOne ) { | 618 | if ( founOne ) { |
618 | if ( next <= end ) { | 619 | if ( next <= end ) { |
619 | found = true; | 620 | found = true; |
620 | } | 621 | } |
621 | } | 622 | } |
622 | 623 | ||
623 | /* | 624 | /* |
624 | // crap !!! | 625 | // crap !!! |
625 | if ( rStart <= end ) { // Start date not after range | 626 | if ( rStart <= end ) { // Start date not after range |
626 | if ( rStart >= start ) { // Start date within range | 627 | if ( rStart >= start ) { // Start date within range |
627 | found = true; | 628 | found = true; |
628 | } else if ( event->recurrence()->duration() == -1 ) { // Recurs forever | 629 | } else if ( event->recurrence()->duration() == -1 ) { // Recurs forever |
629 | found = true; | 630 | found = true; |
630 | } else if ( event->recurrence()->duration() == 0 ) { // End date set | 631 | } else if ( event->recurrence()->duration() == 0 ) { // End date set |
631 | QDate rEnd = event->recurrence()->endDate(); | 632 | QDate rEnd = event->recurrence()->endDate(); |
632 | if ( rEnd >= start && rEnd <= end ) { // End date within range | 633 | if ( rEnd >= start && rEnd <= end ) { // End date within range |
633 | found = true; | 634 | found = true; |
634 | } | 635 | } |
635 | } else { // Duration set | 636 | } else { // Duration set |
636 | // TODO: Calculate end date from duration. Should be done in Event | 637 | // TODO: Calculate end date from duration. Should be done in Event |
637 | // For now include all events with a duration. | 638 | // For now include all events with a duration. |
638 | found = true; | 639 | found = true; |
639 | } | 640 | } |
640 | } | 641 | } |
641 | */ | 642 | */ |
642 | 643 | ||
643 | } | 644 | } |
644 | 645 | ||
645 | if ( found ) eventList.append( event ); | 646 | if ( found ) eventList.append( event ); |
646 | } else { | 647 | } else { |
647 | QDate s = event->dtStart().date(); | 648 | QDate s = event->dtStart().date(); |
648 | QDate e = event->dtEnd().date(); | 649 | QDate e = event->dtEnd().date(); |
649 | 650 | ||
650 | if ( inclusive ) { | 651 | if ( inclusive ) { |
651 | if ( s >= start && e <= end ) { | 652 | if ( s >= start && e <= end ) { |
652 | eventList.append( event ); | 653 | eventList.append( event ); |
653 | } | 654 | } |
654 | } else { | 655 | } else { |
655 | if ( ( s >= start && s <= end ) || ( e >= start && e <= end ) ) { | 656 | if ( ( s >= start && s <= end ) || ( e >= start && e <= end ) ) { |
656 | eventList.append( event ); | 657 | eventList.append( event ); |
657 | } | 658 | } |
658 | } | 659 | } |
659 | } | 660 | } |
660 | } | 661 | } |
661 | 662 | ||
662 | return eventList; | 663 | return eventList; |
663 | } | 664 | } |
664 | 665 | ||
665 | QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) | 666 | QPtrList<Event> CalendarLocal::rawEventsForDate( const QDateTime &qdt ) |
666 | { | 667 | { |
667 | return rawEventsForDate( qdt.date() ); | 668 | return rawEventsForDate( qdt.date() ); |
668 | } | 669 | } |
669 | 670 | ||
670 | QPtrList<Event> CalendarLocal::rawEvents() | 671 | QPtrList<Event> CalendarLocal::rawEvents() |
671 | { | 672 | { |
672 | return mEventList; | 673 | return mEventList; |
673 | } | 674 | } |
674 | 675 | ||
675 | bool CalendarLocal::addJournal(Journal *journal) | 676 | bool CalendarLocal::addJournal(Journal *journal) |
676 | { | 677 | { |
677 | if ( journal->dtStart().isValid()) | 678 | if ( journal->dtStart().isValid()) |
678 | kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl; | 679 | kdDebug(5800) << "Adding Journal on " << journal->dtStart().toString() << endl; |
679 | else | 680 | else |
680 | kdDebug(5800) << "Adding Journal without a DTSTART" << endl; | 681 | kdDebug(5800) << "Adding Journal without a DTSTART" << endl; |
681 | 682 | ||
682 | mJournalList.append(journal); | 683 | mJournalList.append(journal); |
683 | 684 | ||
684 | journal->registerObserver( this ); | 685 | journal->registerObserver( this ); |
685 | 686 | ||
686 | setModified( true ); | 687 | setModified( true ); |
687 | 688 | ||
688 | return true; | 689 | return true; |
689 | } | 690 | } |
690 | 691 | ||
691 | void CalendarLocal::deleteJournal( Journal *journal ) | 692 | void CalendarLocal::deleteJournal( Journal *journal ) |
692 | { | 693 | { |
693 | if ( mUndoIncidence ) delete mUndoIncidence; | 694 | if ( mUndoIncidence ) delete mUndoIncidence; |
694 | mUndoIncidence = journal->clone(); | 695 | mUndoIncidence = journal->clone(); |
695 | mUndoIncidence->setSummary( mUndoIncidence->description().left(25)); | 696 | mUndoIncidence->setSummary( mUndoIncidence->description().left(25)); |
696 | if ( mJournalList.removeRef(journal) ) { | 697 | if ( mJournalList.removeRef(journal) ) { |
697 | setModified( true ); | 698 | setModified( true ); |
698 | } | 699 | } |
699 | } | 700 | } |
700 | 701 | ||
701 | Journal *CalendarLocal::journal( const QDate &date ) | 702 | Journal *CalendarLocal::journal( const QDate &date ) |
702 | { | 703 | { |
703 | // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; | 704 | // kdDebug(5800) << "CalendarLocal::journal() " << date.toString() << endl; |
704 | 705 | ||
705 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 706 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
706 | if ( it->dtStart().date() == date ) | 707 | if ( it->dtStart().date() == date ) |
707 | return it; | 708 | return it; |
708 | 709 | ||
709 | return 0; | 710 | return 0; |
710 | } | 711 | } |
711 | 712 | ||
712 | Journal *CalendarLocal::journal( const QString &uid ) | 713 | Journal *CalendarLocal::journal( const QString &uid ) |
713 | { | 714 | { |
714 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) | 715 | for ( Journal *it = mJournalList.first(); it; it = mJournalList.next() ) |
715 | if ( it->uid() == uid ) | 716 | if ( it->uid() == uid ) |
716 | return it; | 717 | return it; |
717 | 718 | ||
718 | return 0; | 719 | return 0; |
719 | } | 720 | } |
720 | 721 | ||
721 | QPtrList<Journal> CalendarLocal::journals() | 722 | QPtrList<Journal> CalendarLocal::journals() |
722 | { | 723 | { |
723 | return mJournalList; | 724 | return mJournalList; |
724 | } | 725 | } |
725 | 726 | ||