-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 6 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 16 | ||||
-rw-r--r-- | libkcal/todo.cpp | 13 | ||||
-rw-r--r-- | libkcal/todo.h | 3 | ||||
-rw-r--r-- | qtcompat/qinputdialog.cpp | 2 |
5 files changed, 33 insertions, 7 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index bba9f87..2cb0132 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1147,227 +1147,229 @@ | |||
1147 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, | 1147 | { "CalPrintTodoConfig_Base","CalPrintTodoConfig_Base" }, |
1148 | { "Include &description of the item","Inclusive Itembeschreibung" }, | 1148 | { "Include &description of the item","Inclusive Itembeschreibung" }, |
1149 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, | 1149 | { "Include d&ue date of the item","Inclusive Fälligkeitsdatum des Items" }, |
1150 | { "Include &priority of the item","Inclusive Priorität des Items" }, | 1150 | { "Include &priority of the item","Inclusive Priorität des Items" }, |
1151 | { "Items to Print","Zu druckende Items" }, | 1151 | { "Items to Print","Zu druckende Items" }, |
1152 | { "&From:","Von:" }, | 1152 | { "&From:","Von:" }, |
1153 | { "&To:","Bis:" }, | 1153 | { "&To:","Bis:" }, |
1154 | { "Print &all todo items","Drucke alle Todo Items" }, | 1154 | { "Print &all todo items","Drucke alle Todo Items" }, |
1155 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, | 1155 | { "Print only &uncompleted items","Drucke nur nicht erledigte Todos" }, |
1156 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, | 1156 | { "Only items due in the &range:","Nur Items in dem Zeitraum:" }, |
1157 | { "Todo List","Todo Liste" }, | 1157 | { "Todo List","Todo Liste" }, |
1158 | { "&Title:","&Titel:" }, | 1158 | { "&Title:","&Titel:" }, |
1159 | { "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, | 1159 | { "Co&nnect subtodos with its parent","Verbinde Untertodos mit ihren Ober-Todos" }, |
1160 | { "Todo list","Todo Liste" }, | 1160 | { "Todo list","Todo Liste" }, |
1161 | { "&Print...","Drucke..." }, | 1161 | { "&Print...","Drucke..." }, |
1162 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, | 1162 | { "<qt>Printing on printer <b>%1</b></qt>","<qt>Drucke auf Drucker <b>%1</b></qt>" }, |
1163 | { "[Unconfigured]","[Unkonfiguriert]" }, | 1163 | { "[Unconfigured]","[Unkonfiguriert]" }, |
1164 | { "OK","OK" }, | 1164 | { "OK","OK" }, |
1165 | { "FilterEditor","FilterEditor" }, | 1165 | { "FilterEditor","FilterEditor" }, |
1166 | { "Include","Inclusive" }, | 1166 | { "Include","Inclusive" }, |
1167 | { "Exclude","Exclusive" }, | 1167 | { "Exclude","Exclusive" }, |
1168 | { "Edit Selection...","Editiere Auswahl" }, | 1168 | { "Edit Selection...","Editiere Auswahl" }, |
1169 | { "recurring events","wiederholende Termine" }, | 1169 | { "recurring events","wiederholende Termine" }, |
1170 | { "recurr. events","wiederh.Termine" }, | 1170 | { "recurr. events","wiederh.Termine" }, |
1171 | { "completed to-dos","erledigte Todos" }, | 1171 | { "completed to-dos","erledigte Todos" }, |
1172 | { "events","Termine" }, | 1172 | { "events","Termine" }, |
1173 | { "todos","Todos" }, | 1173 | { "todos","Todos" }, |
1174 | { "journals","Journale" }, | 1174 | { "journals","Journale" }, |
1175 | { "public","öffentl." }, | 1175 | { "public","öffentl." }, |
1176 | { "private","privat" }, | 1176 | { "private","privat" }, |
1177 | { "confidential","vertraul." }, | 1177 | { "confidential","vertraul." }, |
1178 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, | 1178 | { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Untertodos.\nAlle erledigten Untertodos\nwerden auch gelöscht!" }, |
1179 | { "Yesterday","Gestern" }, | 1179 | { "Yesterday","Gestern" }, |
1180 | { "Day after tomorrow","Übermorgen" }, | 1180 | { "Day after tomorrow","Übermorgen" }, |
1181 | { "Tomorrow","Morgen" }, | 1181 | { "Tomorrow","Morgen" }, |
1182 | { "Day before yesterday","Vorgestern" }, | 1182 | { "Day before yesterday","Vorgestern" }, |
1183 | { "Size %1","Größe %1" }, | 1183 | { "Size %1","Größe %1" }, |
1184 | { "New Agendasize: %1","Neue Agendagröße: %1" }, | 1184 | { "New Agendasize: %1","Neue Agendagröße: %1" }, |
1185 | { " (%1 y.)"," (%1 J.)" }, | 1185 | { " (%1 y.)"," (%1 J.)" }, |
1186 | { "Allday:","Ganztägig:" }, | 1186 | { "Allday:","Ganztägig:" }, |
1187 | { "compl.todos","erled.Todos" }, | 1187 | { "compl.todos","erled.Todos" }, |
1188 | { "Day view","Tagesansicht" }, | 1188 | { "Day view","Tagesansicht" }, |
1189 | { "Next days","Nächste Tage" }, | 1189 | { "Next days","Nächste Tage" }, |
1190 | { "Next week","Nächste Woche" }, | 1190 | { "Next week","Nächste Woche" }, |
1191 | { "Next two weeks","Nächste zwei Wochen" }, | 1191 | { "Next two weeks","Nächste zwei Wochen" }, |
1192 | { "This month","Dieser Monat" }, | 1192 | { "This month","Dieser Monat" }, |
1193 | { "Journal view","Journal" }, | 1193 | { "Journal view","Journal" }, |
1194 | { "Display all opened","Zeige alle geöffnet" }, | 1194 | { "Display all opened","Zeige alle geöffnet" }, |
1195 | { "Display all closed","Zeige alle geschlossen" }, | 1195 | { "Display all closed","Zeige alle geschlossen" }, |
1196 | { "Display all flat","Zeige alle flach" }, | 1196 | { "Display all flat","Zeige alle flach" }, |
1197 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, | 1197 | { "<p><i>Completed on %1</i></p>","<p><i>Erledigt am %1</i></p>" }, |
1198 | { "Default todo done color:","Standard Todo erledigt Farbe" }, | 1198 | { "Default todo done color:","Standard Todo erledigt Farbe" }, |
1199 | { "Select week %1-%2","Wähle Woche %1-%2" }, | 1199 | { "Select week %1-%2","Wähle Woche %1-%2" }, |
1200 | { "Select Week","Wähle Woche" }, | 1200 | { "Select Week","Wähle Woche" }, |
1201 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, | 1201 | { "Set alarm for selected...","Setze Alarm für Selekt..." }, |
1202 | { "Set Alarm!","Setze Alarm!" }, | 1202 | { "Set Alarm!","Setze Alarm!" }, |
1203 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, | 1203 | { "Canged alarm for %1 items","Alarm für %1 Items geändert" }, |
1204 | { " and "," und " }, | 1204 | { " and "," und " }, |
1205 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, | 1205 | { "<IMG src="%1"> only )","nur <IMG src="%1"> )" }, |
1206 | { "Mail to selected","Mail an Ausgewählte" }, | 1206 | { "Mail to selected","Mail an Ausgewählte" }, |
1207 | { "Mail to all","Mail an Alle" }, | 1207 | { "Mail to all","Mail an Alle" }, |
1208 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, | 1208 | { "Week view mode uses bigger font","Wochenansicht Modus nutzt größeren Font" }, |
1209 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, | 1209 | { "Set reminder ON with offset to:","Alarm AN mit Offset auf:" }, |
1210 | { " on"," am" }, | 1210 | { " on"," am" }, |
1211 | { " completed on "," erledigt am " }, | 1211 | { " completed on "," erledigt am " }, |
1212 | { "Save as Event template","Speichere als Vorlage" }, | 1212 | { "Save as Event template","Speichere als Vorlage" }, |
1213 | { "Load Event template","Lade Termin Vorlage" }, | 1213 | { "Load Event template","Lade Termin Vorlage" }, |
1214 | { "Save as Journal template","Speichere als Journal Vorlage" }, | 1214 | { "Save as Journal template","Speichere als Journal Vorlage" }, |
1215 | { "Insert Journal template","Füge Journal Vorlage ein" }, | 1215 | { "Insert Journal template","Füge Journal Vorlage ein" }, |
1216 | { "Sub todos:<br>","Unter Todos:<br>" }, | 1216 | { "Sub todos:<br>","Unter Todos:<br>" }, |
1217 | { "Parent todo:<br>","Über Todo:<br>" }, | 1217 | { "Parent todo:<br>","Über Todo:<br>" }, |
1218 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, | 1218 | { "Set current as color category","Setze Gewählte als Farbkategorie" }, |
1219 | { " completed"," erledigt" }, | 1219 | { " completed"," erledigt" }, |
1220 | { "(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!" }, | 1220 | { "(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!" }, |
1221 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, | 1221 | { "Syncing aborted. Nothing synced.","Syncing abgebrochen.Nichts wurde gesynct." }, |
1222 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, | 1222 | { "Connected! Sending request for remote file ...","Verbunden! Sende Daten Anfrage..." }, |
1223 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, | 1223 | { "Trying to connect to remote...","Versuche mit Gegenstelle zu verbinden..." }, |
1224 | { "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?" }, | 1224 | { "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?" }, |
1225 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, | 1225 | { "ERROR: Receiving remote file failed.","FEHLER: Empfang der entfernten Daten fehlgeschlagen." }, |
1226 | { "Error","Fehler" }, | 1226 | { "Error","Fehler" }, |
1227 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, | 1227 | { ""You entered an invalid date!\n Date changed to current date.","Ungültiges Datum eingegeben.\nSetze heutiges Datum." }, |
1228 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, | 1228 | { "You entered an invalid date!\n Will use current date instead.","Ungültiges Datum eingegeben.\nSetze stattdessen heutiges Datum." }, |
1229 | { "Warning","Warnung" }, | 1229 | { "Warning","Warnung" }, |
1230 | { "Select week number","Wähle Wochen Nummer" }, | 1230 | { "Select week number","Wähle Wochen Nummer" }, |
1231 | { "Februar","Februar" }, | 1231 | { "Februar","Februar" }, |
1232 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, | 1232 | { "Click on the week number to\nshow week zoomed","Klicke auf die Wochennummer\num die Woche groß zu zeigen" }, |
1233 | { "W","W" }, | 1233 | { "W","W" }, |
1234 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, | 1234 | { "Click on this to\nselect week number","Klicke hierauf um\ndie Woche auszuwählen" }, |
1235 | { "T: %1","T: %1" }, | 1235 | { "T: %1","T: %1" }, |
1236 | { "Start: ","Start: " }, | 1236 | { "Start: ","Start: " }, |
1237 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, | 1237 | { "Pi-Sync options for device: ","Pi-Sync Einstellungen für Gerät: " }, |
1238 | { "Password for remote access:","Passwort für fernen Zugriff:" }, | 1238 | { "Password for remote access:","Passwort für fernen Zugriff:" }, |
1239 | { "Remote IP address:","Ferne IP Adresse:" }, | 1239 | { "Remote IP address:","Ferne IP Adresse:" }, |
1240 | { "Remote port number:","Ferne Port Nummer:" }, | 1240 | { "Remote port number:","Ferne Port Nummer:" }, |
1241 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, | 1241 | { "Remote file saved to temp file.","Ferne Daten in temp Datei gespeichert." }, |
1242 | { "Remote from: ","Fern von: " }, | 1242 | { "Remote from: ","Fern von: " }, |
1243 | { "Local from: ","Lokal von: " }, | 1243 | { "Local from: ","Lokal von: " }, |
1244 | { "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" }, | 1244 | { "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" }, |
1245 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, | 1245 | { "Local calendar changed!\n","Lokaler Kalender geändert!\n" }, |
1246 | { "Write back","Schreibe zurück" }, | 1246 | { "Write back","Schreibe zurück" }, |
1247 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, | 1247 | { "KO/Pi Synchronization","KO/Pi Synchronisation" }, |
1248 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, | 1248 | { "Pi-Sync succesful!","Pi-Sync erfolgreich!" }, |
1249 | { "Received sync request","Sync Anfrage erhalten" }, | 1249 | { "Received sync request","Sync Anfrage erhalten" }, |
1250 | { "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." }, | 1250 | { "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." }, |
1251 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, | 1251 | { "Saving Data to temp file ...","Speichere Daten in temp Datei..." }, |
1252 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, | 1252 | { "Data saved to temp file!","Daten in temp Datei gespeichert!" }, |
1253 | { "Sending file...","Sende Datei..." }, | 1253 | { "Sending file...","Sende Datei..." }, |
1254 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, | 1254 | { "Waiting for synced file...","Warte auf gesyncte Daten..." }, |
1255 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, | 1255 | { "Receiving synced file...","Gesyncte Daten erhalten..." }, |
1256 | { "Received %1 bytes","%1 Bytes erhalten" }, | 1256 | { "Received %1 bytes","%1 Bytes erhalten" }, |
1257 | { "Writing file to disk...","Speichere Datei..." }, | 1257 | { "Writing file to disk...","Speichere Datei..." }, |
1258 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, | 1258 | { "Pi-Sync successful!","Pi-Sync erfolgreich!" }, |
1259 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, | 1259 | { "Clock skew of\nsyncing devices\nis %1 seconds!","Uhrzeitunterschied der\nsyncenden Geräte\nist %1 Sekunden!" }, |
1260 | { "Synchronize!","Synchronisiere!" }, | 1260 | { "Synchronize!","Synchronisiere!" }, |
1261 | { "High clock skew!","Großer Uhrzeitunterschied!" }, | 1261 | { "High clock skew!","Großer Uhrzeitunterschied!" }, |
1262 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, | 1262 | { "ADJUST\nYOUR\nCLOCKS!","JUSTIERE\nDIE\nUHREN!" }, |
1263 | { "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!" }, | 1263 | { "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!" }, |
1264 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, | 1264 | { "This is a %1 recurring todo.","Das ist eine %1 wiederholende Aufgabe." }, |
1265 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, | 1265 | { "<p><b>Start on:</b> %1</p>","<p><b>Start am:</b> %1</p>" }, |
1266 | { "List week view","Listenwochenansicht" }, | 1266 | { "List week view","Listenwochenansicht" }, |
1267 | { "List week","Listenwochenansicht" }, | 1267 | { "List week","Listenwochenansicht" }, |
1268 | { "Next Week","Nächste Woche" }, | 1268 | { "Next Week","Nächste Woche" }, |
1269 | { "Previous Week","Vorherige Woche" }, | 1269 | { "Previous Week","Vorherige Woche" }, |
1270 | { "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." }, | 1270 | { "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." }, |
1271 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, | 1271 | { "Show in todo/event viewer:","Zeige in Termin/Todo Anzeige:" }, |
1272 | { "Details","Details" }, | 1272 | { "Details","Details" }, |
1273 | { "Created time","Erstellt Zeit" }, | 1273 | { "Created time","Erstellt Zeit" }, |
1274 | { "Last modified time","Geändert Zeit" }, | 1274 | { "Last modified time","Geändert Zeit" }, |
1275 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, | 1275 | { "Show in What'sThis quick overview:","Zeige in What'sThis Schnellübersicht:" }, |
1276 | { "View Options","Anzeige Optionen" }, | 1276 | { "View Options","Anzeige Optionen" }, |
1277 | { "<b>Created: ","<b>Erstellt am: " }, | 1277 | { "<b>Created: ","<b>Erstellt am: " }, |
1278 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, | 1278 | { "<b>Last modified: ","<b>Zuletzt geändert am: " }, |
1279 | { "Journal: ","Journal: " }, | 1279 | { "Journal: ","Journal: " }, |
1280 | { "yearly","jährlich" }, | 1280 | { "yearly","jährlich" }, |
1281 | { "(%1) ","%1-" }, | 1281 | { "(%1) ","%1-" }, |
1282 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, | 1282 | { "<p><b>K</b>: Week view in Month view syle</p>\n","<p><b>K</b>: Wochenansicht in Art der Monatsansicht</p>\n" }, |
1283 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, | 1283 | { "Enable tooltips displaying summary of ev.","Titel-Tooltips anzeigen" }, |
1284 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, | 1284 | { "Enable scrollbars in month view cells","Scrollbar in Zellen anzeigen" }, |
1285 | { "Summary/Loc.","Titel/Ort" }, | 1285 | { "Summary/Loc.","Titel/Ort" }, |
1286 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, | 1286 | { "No items found. Use '*' and '?' where needed.","Nichts gefunden. Benutze '*' and '?' wo benötigt." }, |
1287 | { "Week Number","Wochennummer" }, | 1287 | { "Week Number","Wochennummer" }, |
1288 | { "Import","Importiere" }, | 1288 | { "Import","Importiere" }, |
1289 | { "Export","Exportiere" }, | 1289 | { "Export","Exportiere" }, |
1290 | { "Beam","Beame" }, | 1290 | { "Beam","Beame" }, |
1291 | { "Export selected","Exportiere Selektierte" }, | 1291 | { "Export selected","Exportiere Selektierte" }, |
1292 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, | 1292 | { "As iCal (ics) file...","Als iCal (ics) Datei..." }, |
1293 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, | 1293 | { "As vCal (vcs) file...","Als vCal (vcs) Datei..." }, |
1294 | { "Journal/Details...","Journale/Details..." }, | 1294 | { "Journal/Details...","Journale/Details..." }, |
1295 | { "Agenda View","Agenda Ansicht" }, | 1295 | { "Agenda View","Agenda Ansicht" }, |
1296 | { "Show current time","Zeige aktuelle Zeit" }, | 1296 | { "Show current time","Zeige aktuelle Zeit" }, |
1297 | { "Edit new item","Bearbeite neuen Eintrag" }, | 1297 | { "Edit new item","Bearbeite neuen Eintrag" }, |
1298 | { "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" }, | 1298 | { "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" }, |
1299 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, | 1299 | { "There is no next alarm.","Es gibt keinen nächsten Alarm." }, |
1300 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, | 1300 | { "%1 %2 - %3 (next event/todo with alarm)","%1 %2 - %3 (nächster Termin/Todo mit Alarm)" }, |
1301 | { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, | 1301 | { "The next alarm is in:\n","Der nächste Alarm ist in:\n" }, |
1302 | { "%1 days\n","%1 Tagen\n" }, | 1302 | { "%1 days\n","%1 Tagen\n" }, |
1303 | { "1 day\n","1 Tag\n" }, | 1303 | { "1 day\n","1 Tag\n" }, |
1304 | { "%1 hours\n","%1 Stunden\n" }, | 1304 | { "%1 hours\n","%1 Stunden\n" }, |
1305 | { "1 hour\n","1 Stunde\n" }, | 1305 | { "1 hour\n","1 Stunde\n" }, |
1306 | { "%1 minutes\n","%1 Minuten\n" }, | 1306 | { "%1 minutes\n","%1 Minuten\n" }, |
1307 | { "1 minute\n","1 Minute\n" }, | 1307 | { "1 minute\n","1 Minute\n" }, |
1308 | { "Only one toolbar","Nur eine Toolbar" }, | 1308 | { "Only one toolbar","Nur eine Toolbar" }, |
1309 | { "Print","Drucke" }, | 1309 | { "Print","Drucke" }, |
1310 | { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, | 1310 | { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, |
1311 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, | 1311 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, |
1312 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, | 1312 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, |
1313 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, | 1313 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, |
1314 | { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, | 1314 | { "This prints the view as you see it.\n(With the complete content, of course.)\nYou may change the print layout by resizing the view.\nPrint unscaled may print several pages\ndepending on the amount of data.\nPrint scaled down will print all on one page.\nPrint scaled up/down will print all on one page,\nbut will scale up the text to page boundaries,\nif the text is smaller than the page.\nYou can select page geometry setup in the next dialog.\n","Dies druckt die Ansicht wie man sie sieht.\n(Mit dem kompletten Inhalt natürlich.)\nMan kann das Layout ändern durch ändern der Fenstergröße.\nDrucke unskaliert druckt ggf. mehrere Seiten\nabhängig von der Menge der Daten.\nDrucke runterskaliert um auf eine Seite zu passen\ndruckt alles auf eine Seite.\nDrucke hoch/runterskaliert um genau auf eine Seite zu passen\nvergrößert den Text gegebenenfalls.\nDas Seitenlayout kann im nächsten Dialog gewählt werden.\n" }, |
1315 | { "KO/Pi Printout","KO/Pi Ausdruck" }, | 1315 | { "KO/Pi Printout","KO/Pi Ausdruck" }, |
1316 | { "Print unscaled","Drucke unskaliert" }, | 1316 | { "Print unscaled","Drucke unskaliert" }, |
1317 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, | 1317 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, |
1318 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, | 1318 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, |
1319 | { "Printout Mode","Druck Modus" }, | 1319 | { "Printout Mode","Druck Modus" }, |
1320 | { "Filter menu icon","Filtermenu Icon" }, | 1320 | { "Filter menu icon","Filtermenu Icon" }, |
1321 | { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, | 1321 | { "<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n","<p><b>A+(shift oder ctrl)</b>: Zeige Zeit bis zum nächsten Alarm</p>\n" }, |
1322 | { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, | 1322 | { "<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n","<p><b>N</b>: Wechsle zur nächsten Ansicht, die ein Icon in der Toolbar hat</p>\n" }, |
1323 | { "%1d","%1t" }, | 1323 | { "%1d","%1t" }, |
1324 | { "%1h","%1std" }, | 1324 | { "%1h","%1std" }, |
1325 | { "%1min","%1min" }, | 1325 | { "%1min","%1min" }, |
1326 | { "( %1 before )","( %1 vorher )" }, | 1326 | { "( %1 before )","( %1 vorher )" }, |
1327 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, | 1327 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, |
1328 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, | 1328 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, |
1329 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, | 1329 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, |
1330 | { "Show Sync Events","Zeige Sync-Ereignisse" }, | 1330 | { "Show Sync Events","Zeige Sync-Ereignisse" }, |
1331 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, | 1331 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, |
1332 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, | 1332 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, |
1333 | { " on "," am " }, | 1333 | { " on "," am " }, |
1334 | { "On: ","Am: " }, | 1334 | { "On: ","Am: " }, |
1335 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, | 1335 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, |
1336 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, | 1336 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, |
1337 | { "Color for running todos:","Farbe für laufende Todos:" }, | 1337 | { "Color for running todos:","Farbe für laufende Todos:" }, |
1338 | { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, | 1338 | { "The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?","Das Todo\n%1\nist gestartet.\nWollen Sie es\nauf gestoppt setzen?" }, |
1339 | { "Todo is started","Todo is gestarted" }, | 1339 | { "Todo is started","Todo ist gestartet" }, |
1340 | { "Stop todo","Stoppe Todo" }, | 1340 | { "Stop todo","Stoppe Todo" }, |
1341 | { "Todo is stopped","Todo ist gestoppt" }, | 1341 | { "Todo is stopped","Todo ist gestoppt" }, |
1342 | { "Start todo","Starte Todo" }, | 1342 | { "Start todo","Starte Todo" }, |
1343 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, | 1343 | { "The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?","Das Todo\n%1\nist gestoppt.\nWollen Sie es auf\ngestartet setzen?" }, |
1344 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, | 1344 | { "The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?","Das Todo\n%1\nwird geklont!\nEs hat Untertodos!\nMöchten Sie alle\nUntertodos auch klonen?" }, |
1345 | { "Todo has subtodos","Todo hat Untertodos" }, | 1345 | { "Todo has subtodos","Todo hat Untertodos" }, |
1346 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, | 1346 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, |
1347 | { "Colors","Farben" }, | 1347 | { "Colors","Farben" }, |
1348 | { "Click on new parent item","Klicke auf neues Übertodo" }, | 1348 | { "Click on new parent item","Klicke auf neues Übertodo" }, |
1349 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, | 1349 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, |
1350 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, | 1350 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, |
1351 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, | 1351 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, |
1352 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, | 1352 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, |
1353 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, | 1353 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, |
1354 | { "times","Zeiten" }, | 1354 | { "times","Zeiten" }, |
1355 | { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, | 1355 | { "The todo\n%1\nhas subtodos!\nDo you want to set\nthe categories for\nall subtodos as well?","Das Todo\n%1\nhat Untertodos!\nMöchten Sie die Kategorien\nauch für alle Untertodos setzen?" }, |
1356 | { "Backup enabled","Backup angeschaltet" }, | 1356 | { "Backup enabled","Backup angeschaltet" }, |
1357 | { "Use standard backup dir","Standard Backupverzeichnis" }, | 1357 | { "Use standard backup dir","Standard Backupverzeichnis" }, |
1358 | { "Number of Backups:","Anzahl der Backups" }, | 1358 | { "Number of Backups:","Anzahl der Backups" }, |
1359 | { "Make backup every ","Mache ein Backup alle " }, | 1359 | { "Make backup every ","Mache ein Backup alle " }, |
1360 | { " days"," Tage" }, | 1360 | { " days"," Tage" }, |
1361 | { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, | 1361 | { "Creating backup ... please wait ...","Erzeuge Backup ... bitte warten ..." }, |
1362 | { "Backup Failed!","Backup Problem!" }, | 1362 | { "Backup Failed!","Backup Problem!" }, |
1363 | { "Try again now","Versuche jetzt nochmal" }, | 1363 | { "Try again now","Versuche jetzt nochmal" }, |
1364 | { "Try again later","Versuche später nochmal" }, | 1364 | { "Try again later","Versuche später nochmal" }, |
1365 | { "Try again tomorrow","Versuche morgen nochmal" }, | 1365 | { "Try again tomorrow","Versuche morgen nochmal" }, |
1366 | { "Disable backup","Schalte Backup ab" }, | 1366 | { "Disable backup","Schalte Backup ab" }, |
1367 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 1367 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
1368 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 1368 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
1369 | { "Choose action","Wähle Aktion" }, | 1369 | { "Choose action","Wähle Aktion" }, |
1370 | { "Comment for todo:","Kommentar zum Todo:" }, | ||
1371 | { "Stop+note","Stop+Notiz" }, | ||
1370 | { "","" }, | 1372 | { "","" }, |
1371 | { "","" }, | 1373 | { "","" }, |
1372 | { "","" }, | 1374 | { "","" }, |
1373 | { "","" }, | 1375 | { "","" }, \ No newline at end of file |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index e95039d..8fe9999 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -1,220 +1,222 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qheader.h> | 25 | #include <qheader.h> |
26 | #include <qcursor.h> | 26 | #include <qcursor.h> |
27 | #include <qwhatsthis.h> | 27 | #include <qwhatsthis.h> |
28 | 28 | ||
29 | #include <qinputdialog.h> | ||
30 | |||
29 | #include <qvbox.h> | 31 | #include <qvbox.h> |
30 | #include <kdebug.h> | 32 | #include <kdebug.h> |
31 | #include "koprefs.h" | 33 | #include "koprefs.h" |
32 | #include <klocale.h> | 34 | #include <klocale.h> |
33 | #include <kglobal.h> | 35 | #include <kglobal.h> |
34 | #include <kiconloader.h> | 36 | #include <kiconloader.h> |
35 | #include <kmessagebox.h> | 37 | #include <kmessagebox.h> |
36 | 38 | ||
37 | #include <libkcal/icaldrag.h> | 39 | #include <libkcal/icaldrag.h> |
38 | #include <libkcal/vcaldrag.h> | 40 | #include <libkcal/vcaldrag.h> |
39 | #include <libkcal/calfilter.h> | 41 | #include <libkcal/calfilter.h> |
40 | #include <libkcal/dndfactory.h> | 42 | #include <libkcal/dndfactory.h> |
41 | #include <libkcal/calendarresources.h> | 43 | #include <libkcal/calendarresources.h> |
42 | #include <libkcal/resourcecalendar.h> | 44 | #include <libkcal/resourcecalendar.h> |
43 | #include <kresources/resourceselectdialog.h> | 45 | #include <kresources/resourceselectdialog.h> |
44 | #include <libkcal/kincidenceformatter.h> | 46 | #include <libkcal/kincidenceformatter.h> |
45 | #ifndef DESKTOP_VERSION | 47 | #ifndef DESKTOP_VERSION |
46 | #include <qpe/qpeapplication.h> | 48 | #include <qpe/qpeapplication.h> |
47 | #else | 49 | #else |
48 | #include <qapplication.h> | 50 | #include <qapplication.h> |
49 | #endif | 51 | #endif |
50 | #ifndef KORG_NOPRINTER | 52 | #ifndef KORG_NOPRINTER |
51 | #include "calprinter.h" | 53 | #include "calprinter.h" |
52 | #endif | 54 | #endif |
53 | #include "docprefs.h" | 55 | #include "docprefs.h" |
54 | 56 | ||
55 | #include "kotodoview.h" | 57 | #include "kotodoview.h" |
56 | using namespace KOrg; | 58 | using namespace KOrg; |
57 | 59 | ||
58 | 60 | ||
59 | class KOTodoViewWhatsThis :public QWhatsThis | 61 | class KOTodoViewWhatsThis :public QWhatsThis |
60 | { | 62 | { |
61 | public: | 63 | public: |
62 | KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | 64 | KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; |
63 | 65 | ||
64 | protected: | 66 | protected: |
65 | virtual QString text( const QPoint& p) | 67 | virtual QString text( const QPoint& p) |
66 | { | 68 | { |
67 | return _view->getWhatsThisText(p) ; | 69 | return _view->getWhatsThisText(p) ; |
68 | } | 70 | } |
69 | private: | 71 | private: |
70 | QWidget* _wid; | 72 | QWidget* _wid; |
71 | KOTodoView * _view; | 73 | KOTodoView * _view; |
72 | }; | 74 | }; |
73 | 75 | ||
74 | KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, | 76 | KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, |
75 | const char *name) : | 77 | const char *name) : |
76 | KListView(parent,name) | 78 | KListView(parent,name) |
77 | { | 79 | { |
78 | mName = QString ( name ); | 80 | mName = QString ( name ); |
79 | mCalendar = calendar; | 81 | mCalendar = calendar; |
80 | #ifndef DESKTOP_VERSION | 82 | #ifndef DESKTOP_VERSION |
81 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); | 83 | QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); |
82 | #endif | 84 | #endif |
83 | mOldCurrent = 0; | 85 | mOldCurrent = 0; |
84 | mMousePressed = false; | 86 | mMousePressed = false; |
85 | 87 | ||
86 | setAcceptDrops(true); | 88 | setAcceptDrops(true); |
87 | viewport()->setAcceptDrops(true); | 89 | viewport()->setAcceptDrops(true); |
88 | int size = 16; | 90 | int size = 16; |
89 | if (qApp->desktop()->width() < 300 ) | 91 | if (qApp->desktop()->width() < 300 ) |
90 | size = 12; | 92 | size = 12; |
91 | setTreeStepSize( size + 6 ); | 93 | setTreeStepSize( size + 6 ); |
92 | 94 | ||
93 | } | 95 | } |
94 | 96 | ||
95 | void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) | 97 | void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) |
96 | { | 98 | { |
97 | #ifndef KORG_NODND | 99 | #ifndef KORG_NODND |
98 | // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; | 100 | // kdDebug() << "KOTodoListView::contentsDragEnterEvent" << endl; |
99 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 101 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
100 | !QTextDrag::canDecode( e ) ) { | 102 | !QTextDrag::canDecode( e ) ) { |
101 | e->ignore(); | 103 | e->ignore(); |
102 | return; | 104 | return; |
103 | } | 105 | } |
104 | 106 | ||
105 | mOldCurrent = currentItem(); | 107 | mOldCurrent = currentItem(); |
106 | #endif | 108 | #endif |
107 | } | 109 | } |
108 | 110 | ||
109 | 111 | ||
110 | void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) | 112 | void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) |
111 | { | 113 | { |
112 | #ifndef KORG_NODND | 114 | #ifndef KORG_NODND |
113 | // kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; | 115 | // kdDebug() << "KOTodoListView::contentsDragMoveEvent" << endl; |
114 | 116 | ||
115 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 117 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
116 | !QTextDrag::canDecode( e ) ) { | 118 | !QTextDrag::canDecode( e ) ) { |
117 | e->ignore(); | 119 | e->ignore(); |
118 | return; | 120 | return; |
119 | } | 121 | } |
120 | 122 | ||
121 | e->accept(); | 123 | e->accept(); |
122 | #endif | 124 | #endif |
123 | } | 125 | } |
124 | 126 | ||
125 | void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) | 127 | void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) |
126 | { | 128 | { |
127 | #ifndef KORG_NODND | 129 | #ifndef KORG_NODND |
128 | // kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl; | 130 | // kdDebug() << "KOTodoListView::contentsDragLeaveEvent" << endl; |
129 | 131 | ||
130 | setCurrentItem(mOldCurrent); | 132 | setCurrentItem(mOldCurrent); |
131 | setSelected(mOldCurrent,true); | 133 | setSelected(mOldCurrent,true); |
132 | #endif | 134 | #endif |
133 | } | 135 | } |
134 | 136 | ||
135 | void KOTodoListView::contentsDropEvent(QDropEvent *e) | 137 | void KOTodoListView::contentsDropEvent(QDropEvent *e) |
136 | { | 138 | { |
137 | #ifndef KORG_NODND | 139 | #ifndef KORG_NODND |
138 | // kdDebug() << "KOTodoListView::contentsDropEvent" << endl; | 140 | // kdDebug() << "KOTodoListView::contentsDropEvent" << endl; |
139 | 141 | ||
140 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && | 142 | if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) && |
141 | !QTextDrag::canDecode( e ) ) { | 143 | !QTextDrag::canDecode( e ) ) { |
142 | e->ignore(); | 144 | e->ignore(); |
143 | return; | 145 | return; |
144 | } | 146 | } |
145 | 147 | ||
146 | DndFactory factory( mCalendar ); | 148 | DndFactory factory( mCalendar ); |
147 | Todo *todo = factory.createDropTodo(e); | 149 | Todo *todo = factory.createDropTodo(e); |
148 | 150 | ||
149 | if (todo) { | 151 | if (todo) { |
150 | e->acceptAction(); | 152 | e->acceptAction(); |
151 | 153 | ||
152 | KOTodoViewItem *destination = | 154 | KOTodoViewItem *destination = |
153 | (KOTodoViewItem *)itemAt(contentsToViewport(e->pos())); | 155 | (KOTodoViewItem *)itemAt(contentsToViewport(e->pos())); |
154 | Todo *destinationEvent = 0; | 156 | Todo *destinationEvent = 0; |
155 | if (destination) destinationEvent = destination->todo(); | 157 | if (destination) destinationEvent = destination->todo(); |
156 | 158 | ||
157 | Todo *existingTodo = mCalendar->todo(todo->uid()); | 159 | Todo *existingTodo = mCalendar->todo(todo->uid()); |
158 | 160 | ||
159 | if(existingTodo) { | 161 | if(existingTodo) { |
160 | Incidence *to = destinationEvent; | 162 | Incidence *to = destinationEvent; |
161 | while(to) { | 163 | while(to) { |
162 | if (to->uid() == todo->uid()) { | 164 | if (to->uid() == todo->uid()) { |
163 | KMessageBox::sorry(this, | 165 | KMessageBox::sorry(this, |
164 | i18n("Cannot move Todo to itself\nor a child of itself"), | 166 | i18n("Cannot move Todo to itself\nor a child of itself"), |
165 | i18n("Drop Todo")); | 167 | i18n("Drop Todo")); |
166 | delete todo; | 168 | delete todo; |
167 | return; | 169 | return; |
168 | } | 170 | } |
169 | to = to->relatedTo(); | 171 | to = to->relatedTo(); |
170 | } | 172 | } |
171 | internalDrop = true; | 173 | internalDrop = true; |
172 | if ( destinationEvent ) | 174 | if ( destinationEvent ) |
173 | reparentTodoSignal( destinationEvent, existingTodo ); | 175 | reparentTodoSignal( destinationEvent, existingTodo ); |
174 | else | 176 | else |
175 | unparentTodoSignal(existingTodo); | 177 | unparentTodoSignal(existingTodo); |
176 | delete todo; | 178 | delete todo; |
177 | } else { | 179 | } else { |
178 | mCalendar->addTodo(todo); | 180 | mCalendar->addTodo(todo); |
179 | emit todoDropped(todo, KOGlobals::EVENTADDED); | 181 | emit todoDropped(todo, KOGlobals::EVENTADDED); |
180 | if ( destinationEvent ) | 182 | if ( destinationEvent ) |
181 | reparentTodoSignal( destinationEvent, todo ); | 183 | reparentTodoSignal( destinationEvent, todo ); |
182 | } | 184 | } |
183 | } | 185 | } |
184 | else { | 186 | else { |
185 | QString text; | 187 | QString text; |
186 | if (QTextDrag::decode(e,text)) { | 188 | if (QTextDrag::decode(e,text)) { |
187 | //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); | 189 | //QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) ); |
188 | KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); | 190 | KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) )); |
189 | qDebug("Dropped : " + text); | 191 | qDebug("Dropped : " + text); |
190 | QStringList emails = QStringList::split(",",text); | 192 | QStringList emails = QStringList::split(",",text); |
191 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { | 193 | for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { |
192 | int pos = (*it).find("<"); | 194 | int pos = (*it).find("<"); |
193 | QString name = (*it).left(pos); | 195 | QString name = (*it).left(pos); |
194 | QString email = (*it).mid(pos); | 196 | QString email = (*it).mid(pos); |
195 | if (!email.isEmpty() && todoi) { | 197 | if (!email.isEmpty() && todoi) { |
196 | todoi->todo()->addAttendee(new Attendee(name,email)); | 198 | todoi->todo()->addAttendee(new Attendee(name,email)); |
197 | } | 199 | } |
198 | } | 200 | } |
199 | } | 201 | } |
200 | else { | 202 | else { |
201 | qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); | 203 | qDebug("KOTodoListView::contentsDropEvent(): Todo from drop not decodable "); |
202 | e->ignore(); | 204 | e->ignore(); |
203 | } | 205 | } |
204 | } | 206 | } |
205 | #endif | 207 | #endif |
206 | } | 208 | } |
207 | void KOTodoListView::wheelEvent (QWheelEvent *e) | 209 | void KOTodoListView::wheelEvent (QWheelEvent *e) |
208 | { | 210 | { |
209 | QListView::wheelEvent (e); | 211 | QListView::wheelEvent (e); |
210 | } | 212 | } |
211 | 213 | ||
212 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) | 214 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) |
213 | { | 215 | { |
214 | 216 | ||
215 | QPoint p(contentsToViewport(e->pos())); | 217 | QPoint p(contentsToViewport(e->pos())); |
216 | QListViewItem *i = itemAt(p); | 218 | QListViewItem *i = itemAt(p); |
217 | bool rootClicked = true; | 219 | bool rootClicked = true; |
218 | if (i) { | 220 | if (i) { |
219 | // if the user clicked into the root decoration of the item, don't | 221 | // if the user clicked into the root decoration of the item, don't |
220 | // try to start a drag! | 222 | // try to start a drag! |
@@ -937,388 +939,398 @@ void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) | |||
937 | moveTodo(); | 939 | moveTodo(); |
938 | break; | 940 | break; |
939 | case 8: | 941 | case 8: |
940 | getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; | 942 | getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; |
941 | default: | 943 | default: |
942 | mItemPopupMenu->popup(QCursor::pos()); | 944 | mItemPopupMenu->popup(QCursor::pos()); |
943 | } | 945 | } |
944 | } else mPopupMenu->popup(QCursor::pos()); | 946 | } else mPopupMenu->popup(QCursor::pos()); |
945 | } | 947 | } |
946 | void KOTodoView::newTodo() | 948 | void KOTodoView::newTodo() |
947 | { | 949 | { |
948 | emit newTodoSignal(); | 950 | emit newTodoSignal(); |
949 | } | 951 | } |
950 | 952 | ||
951 | void KOTodoView::newSubTodo() | 953 | void KOTodoView::newSubTodo() |
952 | { | 954 | { |
953 | if (mActiveItem) { | 955 | if (mActiveItem) { |
954 | emit newSubTodoSignal(mActiveItem->todo()); | 956 | emit newSubTodoSignal(mActiveItem->todo()); |
955 | } | 957 | } |
956 | } | 958 | } |
957 | void KOTodoView::unparentTodo() | 959 | void KOTodoView::unparentTodo() |
958 | { | 960 | { |
959 | if (mActiveItem) { | 961 | if (mActiveItem) { |
960 | emit unparentTodoSignal(mActiveItem->todo()); | 962 | emit unparentTodoSignal(mActiveItem->todo()); |
961 | } | 963 | } |
962 | } | 964 | } |
963 | 965 | ||
964 | void KOTodoView::reparentTodo() | 966 | void KOTodoView::reparentTodo() |
965 | { | 967 | { |
966 | if (mActiveItem) { | 968 | if (mActiveItem) { |
967 | topLevelWidget()->setCaption(i18n("Click on new parent item")); | 969 | topLevelWidget()->setCaption(i18n("Click on new parent item")); |
968 | pendingSubtodo = mActiveItem; | 970 | pendingSubtodo = mActiveItem; |
969 | } | 971 | } |
970 | } | 972 | } |
971 | void KOTodoView::editTodo() | 973 | void KOTodoView::editTodo() |
972 | { | 974 | { |
973 | if (mActiveItem) { | 975 | if (mActiveItem) { |
974 | emit editTodoSignal(mActiveItem->todo()); | 976 | emit editTodoSignal(mActiveItem->todo()); |
975 | } | 977 | } |
976 | } | 978 | } |
977 | void KOTodoView::cloneTodo() | 979 | void KOTodoView::cloneTodo() |
978 | { | 980 | { |
979 | if (mActiveItem) { | 981 | if (mActiveItem) { |
980 | emit cloneTodoSignal((Incidence*)mActiveItem->todo()); | 982 | emit cloneTodoSignal((Incidence*)mActiveItem->todo()); |
981 | } | 983 | } |
982 | } | 984 | } |
983 | void KOTodoView::cancelTodo() | 985 | void KOTodoView::cancelTodo() |
984 | { | 986 | { |
985 | if (mActiveItem) { | 987 | if (mActiveItem) { |
986 | emit cancelTodoSignal((Incidence*)mActiveItem->todo()); | 988 | emit cancelTodoSignal((Incidence*)mActiveItem->todo()); |
987 | } | 989 | } |
988 | } | 990 | } |
989 | void KOTodoView::moveTodo() | 991 | void KOTodoView::moveTodo() |
990 | { | 992 | { |
991 | if (mActiveItem) { | 993 | if (mActiveItem) { |
992 | emit moveTodoSignal((Incidence*)mActiveItem->todo()); | 994 | emit moveTodoSignal((Incidence*)mActiveItem->todo()); |
993 | } | 995 | } |
994 | } | 996 | } |
995 | void KOTodoView::beamTodo() | 997 | void KOTodoView::beamTodo() |
996 | { | 998 | { |
997 | if (mActiveItem) { | 999 | if (mActiveItem) { |
998 | emit beamTodoSignal((Incidence*)mActiveItem->todo()); | 1000 | emit beamTodoSignal((Incidence*)mActiveItem->todo()); |
999 | } | 1001 | } |
1000 | } | 1002 | } |
1001 | 1003 | ||
1002 | 1004 | ||
1003 | void KOTodoView::showTodo() | 1005 | void KOTodoView::showTodo() |
1004 | { | 1006 | { |
1005 | if (mActiveItem) { | 1007 | if (mActiveItem) { |
1006 | emit showTodoSignal(mActiveItem->todo()); | 1008 | emit showTodoSignal(mActiveItem->todo()); |
1007 | } | 1009 | } |
1008 | } | 1010 | } |
1009 | 1011 | ||
1010 | void KOTodoView::deleteTodo() | 1012 | void KOTodoView::deleteTodo() |
1011 | { | 1013 | { |
1012 | if (mActiveItem) { | 1014 | if (mActiveItem) { |
1013 | emit deleteTodoSignal(mActiveItem->todo()); | 1015 | emit deleteTodoSignal(mActiveItem->todo()); |
1014 | } | 1016 | } |
1015 | } | 1017 | } |
1016 | 1018 | ||
1017 | void KOTodoView::setNewPriority(int index) | 1019 | void KOTodoView::setNewPriority(int index) |
1018 | { | 1020 | { |
1019 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 1021 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
1020 | mActiveItem->todo()->setPriority(mPriority[index]); | 1022 | mActiveItem->todo()->setPriority(mPriority[index]); |
1021 | mActiveItem->construct(); | 1023 | mActiveItem->construct(); |
1022 | todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); | 1024 | todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); |
1023 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1025 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1024 | } | 1026 | } |
1025 | } | 1027 | } |
1026 | 1028 | ||
1027 | void KOTodoView::setNewPercentage(int index) | 1029 | void KOTodoView::setNewPercentage(int index) |
1028 | { | 1030 | { |
1029 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 1031 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
1030 | 1032 | ||
1031 | if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { | 1033 | if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { |
1032 | mActiveItem->setOn( true ); | 1034 | mActiveItem->setOn( true ); |
1033 | return; | 1035 | return; |
1034 | } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { | 1036 | } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { |
1035 | KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); | 1037 | KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); |
1036 | if ( par && par->isOn() ) | 1038 | if ( par && par->isOn() ) |
1037 | par->setOn( false ); | 1039 | par->setOn( false ); |
1038 | } | 1040 | } |
1039 | if (mPercentage[index] == 100) { | 1041 | if (mPercentage[index] == 100) { |
1040 | mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); | 1042 | mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); |
1041 | } else { | 1043 | } else { |
1042 | mActiveItem->todo()->setCompleted(false); | 1044 | mActiveItem->todo()->setCompleted(false); |
1043 | } | 1045 | } |
1044 | mActiveItem->todo()->setPercentComplete(mPercentage[index]); | 1046 | mActiveItem->todo()->setPercentComplete(mPercentage[index]); |
1045 | mActiveItem->construct(); | 1047 | mActiveItem->construct(); |
1046 | todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); | 1048 | todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); |
1047 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1049 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1048 | } | 1050 | } |
1049 | } | 1051 | } |
1050 | 1052 | ||
1051 | 1053 | ||
1052 | QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem) | 1054 | QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem) |
1053 | { | 1055 | { |
1054 | QPopupMenu* tempMenu = new QPopupMenu (this); | 1056 | QPopupMenu* tempMenu = new QPopupMenu (this); |
1055 | QStringList checkedCategories = todoItem->todo()->categories (); | 1057 | QStringList checkedCategories = todoItem->todo()->categories (); |
1056 | 1058 | ||
1057 | tempMenu->setCheckable (true); | 1059 | tempMenu->setCheckable (true); |
1058 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); | 1060 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); |
1059 | it != KOPrefs::instance()->mCustomCategories.end (); | 1061 | it != KOPrefs::instance()->mCustomCategories.end (); |
1060 | ++it) { | 1062 | ++it) { |
1061 | int index = tempMenu->insertItem (*it); | 1063 | int index = tempMenu->insertItem (*it); |
1062 | mCategory[index] = *it; | 1064 | mCategory[index] = *it; |
1063 | if (checkedCategories.find (*it) != checkedCategories.end ()) tempMenu->setItemChecked (index, true); | 1065 | if (checkedCategories.find (*it) != checkedCategories.end ()) tempMenu->setItemChecked (index, true); |
1064 | } | 1066 | } |
1065 | 1067 | ||
1066 | connect (tempMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); | 1068 | connect (tempMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); |
1067 | return tempMenu; | 1069 | return tempMenu; |
1068 | 1070 | ||
1069 | 1071 | ||
1070 | } | 1072 | } |
1071 | void KOTodoView::changedCategories(int index) | 1073 | void KOTodoView::changedCategories(int index) |
1072 | { | 1074 | { |
1073 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 1075 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
1074 | QStringList categories = mActiveItem->todo()->categories (); | 1076 | QStringList categories = mActiveItem->todo()->categories (); |
1075 | QString colcat = categories.first(); | 1077 | QString colcat = categories.first(); |
1076 | if (categories.find (mCategory[index]) != categories.end ()) | 1078 | if (categories.find (mCategory[index]) != categories.end ()) |
1077 | categories.remove (mCategory[index]); | 1079 | categories.remove (mCategory[index]); |
1078 | else | 1080 | else |
1079 | categories.insert (categories.end(), mCategory[index]); | 1081 | categories.insert (categories.end(), mCategory[index]); |
1080 | categories.sort (); | 1082 | categories.sort (); |
1081 | if ( !colcat.isEmpty() ) { | 1083 | if ( !colcat.isEmpty() ) { |
1082 | if ( categories.find ( colcat ) != categories.end () ) { | 1084 | if ( categories.find ( colcat ) != categories.end () ) { |
1083 | categories.remove( colcat ); | 1085 | categories.remove( colcat ); |
1084 | categories.prepend( colcat ); | 1086 | categories.prepend( colcat ); |
1085 | } | 1087 | } |
1086 | } | 1088 | } |
1087 | mActiveItem->todo()->setCategories (categories); | 1089 | mActiveItem->todo()->setCategories (categories); |
1088 | mActiveItem->construct(); | 1090 | mActiveItem->construct(); |
1089 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1091 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1090 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); | 1092 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); |
1091 | } | 1093 | } |
1092 | } | 1094 | } |
1093 | void KOTodoView::itemDoubleClicked(QListViewItem *item) | 1095 | void KOTodoView::itemDoubleClicked(QListViewItem *item) |
1094 | { | 1096 | { |
1095 | if ( pendingSubtodo != 0 ) { | 1097 | if ( pendingSubtodo != 0 ) { |
1096 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1098 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1097 | } | 1099 | } |
1098 | pendingSubtodo = 0; | 1100 | pendingSubtodo = 0; |
1099 | //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); | 1101 | //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); |
1100 | int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); | 1102 | int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); |
1101 | //qDebug("ROW %d ", row); | 1103 | //qDebug("ROW %d ", row); |
1102 | if (!item) { | 1104 | if (!item) { |
1103 | newTodo(); | 1105 | newTodo(); |
1104 | return; | 1106 | return; |
1105 | } else { | 1107 | } else { |
1106 | if ( row == 2 || row == 1 ) { | 1108 | if ( row == 2 || row == 1 ) { |
1107 | mActiveItem = (KOTodoViewItem *) item; | 1109 | mActiveItem = (KOTodoViewItem *) item; |
1108 | newSubTodo(); | 1110 | newSubTodo(); |
1109 | return; | 1111 | return; |
1110 | } | 1112 | } |
1111 | if ( row == 5 || row == 6 ) { | 1113 | if ( row == 5 || row == 6 ) { |
1112 | mActiveItem = (KOTodoViewItem *) item; | 1114 | mActiveItem = (KOTodoViewItem *) item; |
1113 | toggleRunningItem(); | 1115 | toggleRunningItem(); |
1114 | return; | 1116 | return; |
1115 | } | 1117 | } |
1116 | } | 1118 | } |
1117 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 1119 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
1118 | editItem( item ); | 1120 | editItem( item ); |
1119 | else | 1121 | else |
1120 | showItem( item , QPoint(), 0 ); | 1122 | showItem( item , QPoint(), 0 ); |
1121 | } | 1123 | } |
1122 | void KOTodoView::toggleRunningItem() | 1124 | void KOTodoView::toggleRunningItem() |
1123 | { | 1125 | { |
1124 | // qDebug("KOTodoView::toggleRunning() "); | 1126 | // qDebug("KOTodoView::toggleRunning() "); |
1125 | if ( ! mActiveItem ) | 1127 | if ( ! mActiveItem ) |
1126 | return; | 1128 | return; |
1127 | Todo * t = mActiveItem->todo(); | 1129 | Todo * t = mActiveItem->todo(); |
1128 | if ( t->isRunning() ) { | 1130 | if ( t->isRunning() ) { |
1131 | #if 0 | ||
1129 | int result = KMessageBox::warningContinueCancel(this, | 1132 | int result = KMessageBox::warningContinueCancel(this, |
1130 | i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop todo"),i18n("Cancel"), true); | 1133 | i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop todo"),i18n("Cancel"), true); |
1131 | if (result != KMessageBox::Continue) return; | 1134 | #endif |
1132 | t->setRunning( false ); | 1135 | |
1136 | int result = KMessageBox::warningYesNoCancel(this, | ||
1137 | i18n("The todo\n%1\nis started.\nDo you want to set\nthe state to stopped?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is started"),i18n("Stop"),i18n("Stop+note")); | ||
1138 | if (result == KMessageBox::Cancel) return; | ||
1139 | if ( result == KMessageBox::No ) { | ||
1140 | QString comment = QInputDialog::getText(mActiveItem->text(0).left( 25 ),i18n("Comment for todo:") ); | ||
1141 | t->setRunningFalse( comment ); | ||
1142 | } else { | ||
1143 | t->setRunning( false ); | ||
1144 | } | ||
1133 | mActiveItem->construct(); | 1145 | mActiveItem->construct(); |
1134 | } else { | 1146 | } else { |
1135 | int result = KMessageBox::warningContinueCancel(this, | 1147 | int result = KMessageBox::warningContinueCancel(this, |
1136 | i18n("The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is stopped"),i18n("Start todo"),i18n("Cancel"), true); | 1148 | i18n("The todo\n%1\nis stopped.\nDo you want to set\nthe state to started?").arg(mActiveItem->text(0).left( 25 ) ),i18n("Todo is stopped"),i18n("Start todo"),i18n("Cancel"), true); |
1137 | if (result != KMessageBox::Continue) return; | 1149 | if (result != KMessageBox::Continue) return; |
1138 | t->setRunning( true ); | 1150 | t->setRunning( true ); |
1139 | mActiveItem->construct(); | 1151 | mActiveItem->construct(); |
1140 | } | 1152 | } |
1141 | } | 1153 | } |
1142 | 1154 | ||
1143 | void KOTodoView::itemClicked(QListViewItem *item) | 1155 | void KOTodoView::itemClicked(QListViewItem *item) |
1144 | { | 1156 | { |
1145 | //qDebug("KOTodoView::itemClicked %d", item); | 1157 | //qDebug("KOTodoView::itemClicked %d", item); |
1146 | if (!item) { | 1158 | if (!item) { |
1147 | if ( pendingSubtodo != 0 ) { | 1159 | if ( pendingSubtodo != 0 ) { |
1148 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1160 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1149 | } | 1161 | } |
1150 | pendingSubtodo = 0; | 1162 | pendingSubtodo = 0; |
1151 | return; | 1163 | return; |
1152 | } | 1164 | } |
1153 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1165 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1154 | if ( pendingSubtodo != 0 ) { | 1166 | if ( pendingSubtodo != 0 ) { |
1155 | bool allowReparent = true; | 1167 | bool allowReparent = true; |
1156 | QListViewItem *par = item; | 1168 | QListViewItem *par = item; |
1157 | while ( par ) { | 1169 | while ( par ) { |
1158 | if ( par == pendingSubtodo ) { | 1170 | if ( par == pendingSubtodo ) { |
1159 | allowReparent = false; | 1171 | allowReparent = false; |
1160 | break; | 1172 | break; |
1161 | } | 1173 | } |
1162 | par = par->parent(); | 1174 | par = par->parent(); |
1163 | } | 1175 | } |
1164 | if ( !allowReparent ) { | 1176 | if ( !allowReparent ) { |
1165 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); | 1177 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); |
1166 | pendingSubtodo = 0; | 1178 | pendingSubtodo = 0; |
1167 | } else { | 1179 | } else { |
1168 | Todo* newParent = todoItem->todo(); | 1180 | Todo* newParent = todoItem->todo(); |
1169 | Todo* newSub = pendingSubtodo->todo(); | 1181 | Todo* newSub = pendingSubtodo->todo(); |
1170 | pendingSubtodo = 0; | 1182 | pendingSubtodo = 0; |
1171 | emit reparentTodoSignal( newParent,newSub ); | 1183 | emit reparentTodoSignal( newParent,newSub ); |
1172 | return; | 1184 | return; |
1173 | } | 1185 | } |
1174 | } | 1186 | } |
1175 | 1187 | ||
1176 | } | 1188 | } |
1177 | 1189 | ||
1178 | void KOTodoView::setDocumentId( const QString &id ) | 1190 | void KOTodoView::setDocumentId( const QString &id ) |
1179 | { | 1191 | { |
1180 | 1192 | ||
1181 | mDocPrefs->setDoc( id ); | 1193 | mDocPrefs->setDoc( id ); |
1182 | } | 1194 | } |
1183 | 1195 | ||
1184 | void KOTodoView::itemStateChanged( QListViewItem *item ) | 1196 | void KOTodoView::itemStateChanged( QListViewItem *item ) |
1185 | { | 1197 | { |
1186 | if (!item) return; | 1198 | if (!item) return; |
1187 | 1199 | ||
1188 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1200 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1189 | 1201 | ||
1190 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; | 1202 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; |
1191 | 1203 | ||
1192 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); | 1204 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); |
1193 | } | 1205 | } |
1194 | 1206 | ||
1195 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const | 1207 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const |
1196 | { | 1208 | { |
1197 | mTodoListView->saveLayout(config,group); | 1209 | mTodoListView->saveLayout(config,group); |
1198 | } | 1210 | } |
1199 | 1211 | ||
1200 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) | 1212 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) |
1201 | { | 1213 | { |
1202 | mTodoListView->restoreLayout(config,group); | 1214 | mTodoListView->restoreLayout(config,group); |
1203 | } | 1215 | } |
1204 | 1216 | ||
1205 | void KOTodoView::processSelectionChange() | 1217 | void KOTodoView::processSelectionChange() |
1206 | { | 1218 | { |
1207 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; | 1219 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; |
1208 | 1220 | ||
1209 | KOTodoViewItem *item = | 1221 | KOTodoViewItem *item = |
1210 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); | 1222 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); |
1211 | 1223 | ||
1212 | if ( !item ) { | 1224 | if ( !item ) { |
1213 | emit incidenceSelected( 0 ); | 1225 | emit incidenceSelected( 0 ); |
1214 | } else { | 1226 | } else { |
1215 | emit incidenceSelected( item->todo() ); | 1227 | emit incidenceSelected( item->todo() ); |
1216 | } | 1228 | } |
1217 | } | 1229 | } |
1218 | 1230 | ||
1219 | void KOTodoView::modified(bool b) | 1231 | void KOTodoView::modified(bool b) |
1220 | { | 1232 | { |
1221 | emit isModified(b); | 1233 | emit isModified(b); |
1222 | } | 1234 | } |
1223 | void KOTodoView::setTodoModified( Todo* todo ) | 1235 | void KOTodoView::setTodoModified( Todo* todo ) |
1224 | { | 1236 | { |
1225 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); | 1237 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); |
1226 | } | 1238 | } |
1227 | void KOTodoView::clearSelection() | 1239 | void KOTodoView::clearSelection() |
1228 | { | 1240 | { |
1229 | mTodoListView->selectAll( false ); | 1241 | mTodoListView->selectAll( false ); |
1230 | } | 1242 | } |
1231 | void KOTodoView::setAllOpen() | 1243 | void KOTodoView::setAllOpen() |
1232 | { | 1244 | { |
1233 | if ( isFlatDisplay ) { | 1245 | if ( isFlatDisplay ) { |
1234 | isFlatDisplay = false; | 1246 | isFlatDisplay = false; |
1235 | mPopupMenu->setItemChecked( 8,false ); | 1247 | mPopupMenu->setItemChecked( 8,false ); |
1236 | updateView(); | 1248 | updateView(); |
1237 | } else { | 1249 | } else { |
1238 | storeCurrentItem(); | 1250 | storeCurrentItem(); |
1239 | } | 1251 | } |
1240 | setOpen(mTodoListView->firstChild(), true); | 1252 | setOpen(mTodoListView->firstChild(), true); |
1241 | resetCurrentItem(); | 1253 | resetCurrentItem(); |
1242 | } | 1254 | } |
1243 | void KOTodoView::setAllClose() | 1255 | void KOTodoView::setAllClose() |
1244 | { | 1256 | { |
1245 | if ( isFlatDisplay ) { | 1257 | if ( isFlatDisplay ) { |
1246 | isFlatDisplay = false; | 1258 | isFlatDisplay = false; |
1247 | mPopupMenu->setItemChecked( 8,false ); | 1259 | mPopupMenu->setItemChecked( 8,false ); |
1248 | updateView(); | 1260 | updateView(); |
1249 | } else { | 1261 | } else { |
1250 | storeCurrentItem(); | 1262 | storeCurrentItem(); |
1251 | } | 1263 | } |
1252 | setOpen(mTodoListView->firstChild(), false); | 1264 | setOpen(mTodoListView->firstChild(), false); |
1253 | resetCurrentItem(); | 1265 | resetCurrentItem(); |
1254 | } | 1266 | } |
1255 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) | 1267 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) |
1256 | { | 1268 | { |
1257 | 1269 | ||
1258 | while ( item ) { | 1270 | while ( item ) { |
1259 | setOpen( item->firstChild(), setOpenI ); | 1271 | setOpen( item->firstChild(), setOpenI ); |
1260 | item->setOpen( setOpenI ); | 1272 | item->setOpen( setOpenI ); |
1261 | item = item->nextSibling(); | 1273 | item = item->nextSibling(); |
1262 | } | 1274 | } |
1263 | } | 1275 | } |
1264 | 1276 | ||
1265 | void KOTodoView::displayAllFlat() | 1277 | void KOTodoView::displayAllFlat() |
1266 | { | 1278 | { |
1267 | pendingSubtodo = 0; | 1279 | pendingSubtodo = 0; |
1268 | if ( mBlockUpdate ) { | 1280 | if ( mBlockUpdate ) { |
1269 | return; | 1281 | return; |
1270 | } | 1282 | } |
1271 | mPopupMenu->setItemChecked( 8,true ); | 1283 | mPopupMenu->setItemChecked( 8,true ); |
1272 | isFlatDisplay = true; | 1284 | isFlatDisplay = true; |
1273 | QPtrList<Todo> todoList = calendar()->todos(); | 1285 | QPtrList<Todo> todoList = calendar()->todos(); |
1274 | mTodoMap.clear(); | 1286 | mTodoMap.clear(); |
1275 | mTodoListView->clear(); | 1287 | mTodoListView->clear(); |
1276 | Todo *todo; | 1288 | Todo *todo; |
1277 | for(todo = todoList.first(); todo; todo = todoList.next()) { | 1289 | for(todo = todoList.first(); todo; todo = todoList.next()) { |
1278 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 1290 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
1279 | mTodoMap.insert(todo,todoItem); | 1291 | mTodoMap.insert(todo,todoItem); |
1280 | } | 1292 | } |
1281 | mTodoListView->setFocus(); | 1293 | mTodoListView->setFocus(); |
1282 | processSelectionChange(); | 1294 | processSelectionChange(); |
1283 | } | 1295 | } |
1284 | 1296 | ||
1285 | void KOTodoView::setAllFlat() | 1297 | void KOTodoView::setAllFlat() |
1286 | { | 1298 | { |
1287 | if ( isFlatDisplay ) { | 1299 | if ( isFlatDisplay ) { |
1288 | isFlatDisplay = false; | 1300 | isFlatDisplay = false; |
1289 | mPopupMenu->setItemChecked( 8,false ); | 1301 | mPopupMenu->setItemChecked( 8,false ); |
1290 | updateView(); | 1302 | updateView(); |
1291 | return; | 1303 | return; |
1292 | } | 1304 | } |
1293 | storeCurrentItem(); | 1305 | storeCurrentItem(); |
1294 | displayAllFlat(); | 1306 | displayAllFlat(); |
1295 | resetCurrentItem(); | 1307 | resetCurrentItem(); |
1296 | } | 1308 | } |
1297 | 1309 | ||
1298 | void KOTodoView::purgeCompleted() | 1310 | void KOTodoView::purgeCompleted() |
1299 | { | 1311 | { |
1300 | emit purgeCompletedSignal(); | 1312 | emit purgeCompletedSignal(); |
1301 | 1313 | ||
1302 | } | 1314 | } |
1303 | void KOTodoView::toggleQuickTodo() | 1315 | void KOTodoView::toggleQuickTodo() |
1304 | { | 1316 | { |
1305 | if ( mQuickAdd->isVisible() ) { | 1317 | if ( mQuickAdd->isVisible() ) { |
1306 | mQuickAdd->hide(); | 1318 | mQuickAdd->hide(); |
1307 | KOPrefs::instance()->mEnableQuickTodo = false; | 1319 | KOPrefs::instance()->mEnableQuickTodo = false; |
1308 | } | 1320 | } |
1309 | else { | 1321 | else { |
1310 | mQuickAdd->show(); | 1322 | mQuickAdd->show(); |
1311 | KOPrefs::instance()->mEnableQuickTodo = true; | 1323 | KOPrefs::instance()->mEnableQuickTodo = true; |
1312 | } | 1324 | } |
1313 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 1325 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
1314 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 1326 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
1315 | } | 1327 | } |
1316 | 1328 | ||
1317 | void KOTodoView::toggleRunning() | 1329 | void KOTodoView::toggleRunning() |
1318 | { | 1330 | { |
1319 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; | 1331 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; |
1320 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 1332 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
1321 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 1333 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
1322 | updateView(); | 1334 | updateView(); |
1323 | } | 1335 | } |
1324 | 1336 | ||
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 002d3f2..f7e38a7 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -1,297 +1,308 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <kglobal.h> | 21 | #include <kglobal.h> |
22 | #include <kglobalsettings.h> | 22 | #include <kglobalsettings.h> |
23 | #include <klocale.h> | 23 | #include <klocale.h> |
24 | #include <kdebug.h> | 24 | #include <kdebug.h> |
25 | #include <qregexp.h> | 25 | #include <qregexp.h> |
26 | #include <qfileinfo.h> | 26 | #include <qfileinfo.h> |
27 | 27 | ||
28 | #include "calendarlocal.h" | 28 | #include "calendarlocal.h" |
29 | #include "icalformat.h" | 29 | #include "icalformat.h" |
30 | #include "todo.h" | 30 | #include "todo.h" |
31 | 31 | ||
32 | using namespace KCal; | 32 | using namespace KCal; |
33 | 33 | ||
34 | Todo::Todo(): QObject(), Incidence() | 34 | Todo::Todo(): QObject(), Incidence() |
35 | { | 35 | { |
36 | // mStatus = TENTATIVE; | 36 | // mStatus = TENTATIVE; |
37 | 37 | ||
38 | mHasDueDate = false; | 38 | mHasDueDate = false; |
39 | setHasStartDate( false ); | 39 | setHasStartDate( false ); |
40 | mCompleted = getEvenTime(QDateTime::currentDateTime()); | 40 | mCompleted = getEvenTime(QDateTime::currentDateTime()); |
41 | mHasCompletedDate = false; | 41 | mHasCompletedDate = false; |
42 | mPercentComplete = 0; | 42 | mPercentComplete = 0; |
43 | mRunning = false; | 43 | mRunning = false; |
44 | mRunSaveTimer = 0; | 44 | mRunSaveTimer = 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | Todo::Todo(const Todo &t) : QObject(),Incidence(t) | 47 | Todo::Todo(const Todo &t) : QObject(),Incidence(t) |
48 | { | 48 | { |
49 | mDtDue = t.mDtDue; | 49 | mDtDue = t.mDtDue; |
50 | mHasDueDate = t.mHasDueDate; | 50 | mHasDueDate = t.mHasDueDate; |
51 | mCompleted = t.mCompleted; | 51 | mCompleted = t.mCompleted; |
52 | mHasCompletedDate = t.mHasCompletedDate; | 52 | mHasCompletedDate = t.mHasCompletedDate; |
53 | mPercentComplete = t.mPercentComplete; | 53 | mPercentComplete = t.mPercentComplete; |
54 | mRunning = false; | 54 | mRunning = false; |
55 | mRunSaveTimer = 0; | 55 | mRunSaveTimer = 0; |
56 | } | 56 | } |
57 | 57 | ||
58 | Todo::~Todo() | 58 | Todo::~Todo() |
59 | { | 59 | { |
60 | setRunning( false ); | 60 | setRunning( false ); |
61 | //qDebug("Todo::~Todo() "); | 61 | //qDebug("Todo::~Todo() "); |
62 | } | 62 | } |
63 | 63 | ||
64 | void Todo::setRunningFalse( QString s ) | ||
65 | { | ||
66 | if ( ! mRunning ) | ||
67 | return; | ||
68 | mRunning = false; | ||
69 | mRunSaveTimer->stop(); | ||
70 | saveRunningInfoToFile( s ); | ||
71 | } | ||
64 | void Todo::setRunning( bool run ) | 72 | void Todo::setRunning( bool run ) |
65 | { | 73 | { |
66 | if ( run == mRunning ) | 74 | if ( run == mRunning ) |
67 | return; | 75 | return; |
68 | //qDebug("Todo::setRunning %d ", run); | 76 | //qDebug("Todo::setRunning %d ", run); |
69 | if ( !mRunSaveTimer ) { | 77 | if ( !mRunSaveTimer ) { |
70 | mRunSaveTimer = new QTimer ( this ); | 78 | mRunSaveTimer = new QTimer ( this ); |
71 | connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); | 79 | connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); |
72 | } | 80 | } |
73 | mRunning = run; | 81 | mRunning = run; |
74 | if ( mRunning ) { | 82 | if ( mRunning ) { |
75 | mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min | 83 | mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min |
76 | mRunStart = QDateTime::currentDateTime(); | 84 | mRunStart = QDateTime::currentDateTime(); |
77 | } else { | 85 | } else { |
78 | mRunSaveTimer->stop(); | 86 | mRunSaveTimer->stop(); |
79 | saveRunningInfoToFile(); | 87 | saveRunningInfoToFile(); |
80 | } | 88 | } |
81 | } | 89 | } |
82 | 90 | ||
83 | void Todo::saveRunningInfoToFile() | 91 | void Todo::saveRunningInfoToFile( QString comment ) |
84 | { | 92 | { |
85 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); | 93 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); |
86 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { | 94 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { |
87 | qDebug("Running time < 30 seconds. Skipped. "); | 95 | qDebug("Running time < 30 seconds. Skipped. "); |
88 | return; | 96 | return; |
89 | } | 97 | } |
90 | QString dir = KGlobalSettings::timeTrackerDir(); | 98 | QString dir = KGlobalSettings::timeTrackerDir(); |
91 | //qDebug("%s ", dir.latin1()); | 99 | //qDebug("%s ", dir.latin1()); |
92 | QString file = "%1%2%3-%4%5%6-"; | 100 | QString file = "%1%2%3-%4%5%6-"; |
93 | file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ); | 101 | file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ); |
94 | file.replace ( QRegExp (" "), "0" ); | 102 | file.replace ( QRegExp (" "), "0" ); |
95 | file += uid(); | 103 | file += uid(); |
96 | //qDebug("File %s ",file.latin1() ); | 104 | //qDebug("File %s ",file.latin1() ); |
97 | CalendarLocal cal; | 105 | CalendarLocal cal; |
98 | cal.setLocalTime(); | 106 | cal.setLocalTime(); |
99 | Todo * to = (Todo*) clone(); | 107 | Todo * to = (Todo*) clone(); |
100 | to->setFloats( false ); | 108 | to->setFloats( false ); |
101 | to->setDtStart( mRunStart ); | 109 | to->setDtStart( mRunStart ); |
102 | to->setHasStartDate( true ); | 110 | to->setHasStartDate( true ); |
103 | to->setDtDue( QDateTime::currentDateTime() ); | 111 | to->setDtDue( QDateTime::currentDateTime() ); |
104 | to->setHasDueDate( true ); | 112 | to->setHasDueDate( true ); |
105 | to->setUid( file ); | 113 | to->setUid( file ); |
114 | if ( !comment.isEmpty() ) { | ||
115 | to->setDescription( comment ); | ||
116 | } | ||
106 | cal.addIncidence( to ); | 117 | cal.addIncidence( to ); |
107 | ICalFormat format; | 118 | ICalFormat format; |
108 | file = dir +"/" +file +".ics"; | 119 | file = dir +"/" +file +".ics"; |
109 | format.save( &cal, file ); | 120 | format.save( &cal, file ); |
110 | saveParents(); | 121 | saveParents(); |
111 | 122 | ||
112 | } | 123 | } |
113 | void Todo::saveParents() | 124 | void Todo::saveParents() |
114 | { | 125 | { |
115 | if (!relatedTo() ) | 126 | if (!relatedTo() ) |
116 | return; | 127 | return; |
117 | Incidence * inc = relatedTo(); | 128 | Incidence * inc = relatedTo(); |
118 | if ( inc->type() != "Todo" ) | 129 | if ( inc->type() != "Todo" ) |
119 | return; | 130 | return; |
120 | Todo* to = (Todo*)inc; | 131 | Todo* to = (Todo*)inc; |
121 | bool saveTodo = false; | 132 | bool saveTodo = false; |
122 | QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; | 133 | QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; |
123 | QFileInfo fi ( file ); | 134 | QFileInfo fi ( file ); |
124 | if ( fi.exists() ) { | 135 | if ( fi.exists() ) { |
125 | if ( fi.lastModified () < to->lastModified ()) | 136 | if ( fi.lastModified () < to->lastModified ()) |
126 | saveTodo = true; | 137 | saveTodo = true; |
127 | } else { | 138 | } else { |
128 | saveTodo = true; | 139 | saveTodo = true; |
129 | } | 140 | } |
130 | if ( saveTodo ) { | 141 | if ( saveTodo ) { |
131 | CalendarLocal cal; | 142 | CalendarLocal cal; |
132 | cal.setLocalTime(); | 143 | cal.setLocalTime(); |
133 | Todo * par = (Todo *) to->clone(); | 144 | Todo * par = (Todo *) to->clone(); |
134 | cal.addIncidence( par ); | 145 | cal.addIncidence( par ); |
135 | ICalFormat format; | 146 | ICalFormat format; |
136 | format.save( &cal, file ); | 147 | format.save( &cal, file ); |
137 | } | 148 | } |
138 | to->saveParents(); | 149 | to->saveParents(); |
139 | } | 150 | } |
140 | 151 | ||
141 | int Todo::runTime() | 152 | int Todo::runTime() |
142 | { | 153 | { |
143 | if ( !mRunning ) | 154 | if ( !mRunning ) |
144 | return 0; | 155 | return 0; |
145 | return mRunStart.secsTo( QDateTime::currentDateTime() ); | 156 | return mRunStart.secsTo( QDateTime::currentDateTime() ); |
146 | } | 157 | } |
147 | bool Todo::hasRunningSub() | 158 | bool Todo::hasRunningSub() |
148 | { | 159 | { |
149 | if ( mRunning ) | 160 | if ( mRunning ) |
150 | return true; | 161 | return true; |
151 | Incidence *aTodo; | 162 | Incidence *aTodo; |
152 | for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) { | 163 | for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) { |
153 | if ( ((Todo*)aTodo)->hasRunningSub() ) | 164 | if ( ((Todo*)aTodo)->hasRunningSub() ) |
154 | return true; | 165 | return true; |
155 | } | 166 | } |
156 | return false; | 167 | return false; |
157 | } | 168 | } |
158 | Incidence *Todo::clone() | 169 | Incidence *Todo::clone() |
159 | { | 170 | { |
160 | return new Todo(*this); | 171 | return new Todo(*this); |
161 | } | 172 | } |
162 | 173 | ||
163 | bool Todo::contains ( Todo* from ) | 174 | bool Todo::contains ( Todo* from ) |
164 | { | 175 | { |
165 | 176 | ||
166 | if ( !from->summary().isEmpty() ) | 177 | if ( !from->summary().isEmpty() ) |
167 | if ( !summary().startsWith( from->summary() )) | 178 | if ( !summary().startsWith( from->summary() )) |
168 | return false; | 179 | return false; |
169 | if ( from->hasStartDate() ) { | 180 | if ( from->hasStartDate() ) { |
170 | if ( !hasStartDate() ) | 181 | if ( !hasStartDate() ) |
171 | return false; | 182 | return false; |
172 | if ( from->dtStart() != dtStart()) | 183 | if ( from->dtStart() != dtStart()) |
173 | return false; | 184 | return false; |
174 | } | 185 | } |
175 | if ( from->hasDueDate() ){ | 186 | if ( from->hasDueDate() ){ |
176 | if ( !hasDueDate() ) | 187 | if ( !hasDueDate() ) |
177 | return false; | 188 | return false; |
178 | if ( from->dtDue() != dtDue()) | 189 | if ( from->dtDue() != dtDue()) |
179 | return false; | 190 | return false; |
180 | } | 191 | } |
181 | if ( !from->location().isEmpty() ) | 192 | if ( !from->location().isEmpty() ) |
182 | if ( !location().startsWith( from->location() ) ) | 193 | if ( !location().startsWith( from->location() ) ) |
183 | return false; | 194 | return false; |
184 | if ( !from->description().isEmpty() ) | 195 | if ( !from->description().isEmpty() ) |
185 | if ( !description().startsWith( from->description() )) | 196 | if ( !description().startsWith( from->description() )) |
186 | return false; | 197 | return false; |
187 | if ( from->alarms().count() ) { | 198 | if ( from->alarms().count() ) { |
188 | Alarm *a = from->alarms().first(); | 199 | Alarm *a = from->alarms().first(); |
189 | if ( a->enabled() ){ | 200 | if ( a->enabled() ){ |
190 | if ( !alarms().count() ) | 201 | if ( !alarms().count() ) |
191 | return false; | 202 | return false; |
192 | Alarm *b = alarms().first(); | 203 | Alarm *b = alarms().first(); |
193 | if( ! b->enabled() ) | 204 | if( ! b->enabled() ) |
194 | return false; | 205 | return false; |
195 | if ( ! (a->offset() == b->offset() )) | 206 | if ( ! (a->offset() == b->offset() )) |
196 | return false; | 207 | return false; |
197 | } | 208 | } |
198 | } | 209 | } |
199 | 210 | ||
200 | QStringList cat = categories(); | 211 | QStringList cat = categories(); |
201 | QStringList catFrom = from->categories(); | 212 | QStringList catFrom = from->categories(); |
202 | QString nCat; | 213 | QString nCat; |
203 | unsigned int iii; | 214 | unsigned int iii; |
204 | for ( iii = 0; iii < catFrom.count();++iii ) { | 215 | for ( iii = 0; iii < catFrom.count();++iii ) { |
205 | nCat = catFrom[iii]; | 216 | nCat = catFrom[iii]; |
206 | if ( !nCat.isEmpty() ) | 217 | if ( !nCat.isEmpty() ) |
207 | if ( !cat.contains( nCat )) { | 218 | if ( !cat.contains( nCat )) { |
208 | return false; | 219 | return false; |
209 | } | 220 | } |
210 | } | 221 | } |
211 | if ( from->isCompleted() ) { | 222 | if ( from->isCompleted() ) { |
212 | if ( !isCompleted() ) | 223 | if ( !isCompleted() ) |
213 | return false; | 224 | return false; |
214 | } | 225 | } |
215 | if( priority() != from->priority() ) | 226 | if( priority() != from->priority() ) |
216 | return false; | 227 | return false; |
217 | 228 | ||
218 | 229 | ||
219 | return true; | 230 | return true; |
220 | 231 | ||
221 | } | 232 | } |
222 | bool KCal::operator==( const Todo& t1, const Todo& t2 ) | 233 | bool KCal::operator==( const Todo& t1, const Todo& t2 ) |
223 | { | 234 | { |
224 | 235 | ||
225 | bool ret = operator==( (const Incidence&)t1, (const Incidence&)t2 ); | 236 | bool ret = operator==( (const Incidence&)t1, (const Incidence&)t2 ); |
226 | if ( ! ret ) | 237 | if ( ! ret ) |
227 | return false; | 238 | return false; |
228 | if ( t1.hasDueDate() == t2.hasDueDate() ) { | 239 | if ( t1.hasDueDate() == t2.hasDueDate() ) { |
229 | if ( t1.hasDueDate() ) { | 240 | if ( t1.hasDueDate() ) { |
230 | if ( t1.doesFloat() == t2.doesFloat() ) { | 241 | if ( t1.doesFloat() == t2.doesFloat() ) { |
231 | if ( t1.doesFloat() ) { | 242 | if ( t1.doesFloat() ) { |
232 | if ( t1.dtDue().date() != t2.dtDue().date() ) | 243 | if ( t1.dtDue().date() != t2.dtDue().date() ) |
233 | return false; | 244 | return false; |
234 | } else | 245 | } else |
235 | if ( t1.dtDue() != t2.dtDue() ) | 246 | if ( t1.dtDue() != t2.dtDue() ) |
236 | return false; | 247 | return false; |
237 | } else | 248 | } else |
238 | return false;// float != | 249 | return false;// float != |
239 | } | 250 | } |
240 | 251 | ||
241 | } else | 252 | } else |
242 | return false; | 253 | return false; |
243 | if ( t1.percentComplete() != t2.percentComplete() ) | 254 | if ( t1.percentComplete() != t2.percentComplete() ) |
244 | return false; | 255 | return false; |
245 | if ( t1.isCompleted() ) { | 256 | if ( t1.isCompleted() ) { |
246 | if ( t1.hasCompletedDate() == t2.hasCompletedDate() ) { | 257 | if ( t1.hasCompletedDate() == t2.hasCompletedDate() ) { |
247 | if ( t1.hasCompletedDate() ) { | 258 | if ( t1.hasCompletedDate() ) { |
248 | if ( t1.completed() != t2.completed() ) | 259 | if ( t1.completed() != t2.completed() ) |
249 | return false; | 260 | return false; |
250 | } | 261 | } |
251 | 262 | ||
252 | } else | 263 | } else |
253 | return false; | 264 | return false; |
254 | } | 265 | } |
255 | return true; | 266 | return true; |
256 | 267 | ||
257 | } | 268 | } |
258 | 269 | ||
259 | void Todo::setDtDue(const QDateTime &dtDue) | 270 | void Todo::setDtDue(const QDateTime &dtDue) |
260 | { | 271 | { |
261 | //int diffsecs = mDtDue.secsTo(dtDue); | 272 | //int diffsecs = mDtDue.secsTo(dtDue); |
262 | 273 | ||
263 | /*if (mReadOnly) return; | 274 | /*if (mReadOnly) return; |
264 | const QPtrList<Alarm>& alarms = alarms(); | 275 | const QPtrList<Alarm>& alarms = alarms(); |
265 | for (Alarm* alarm = alarms.first(); alarm; alarm = alarms.next()) { | 276 | for (Alarm* alarm = alarms.first(); alarm; alarm = alarms.next()) { |
266 | if (alarm->enabled()) { | 277 | if (alarm->enabled()) { |
267 | alarm->setTime(alarm->time().addSecs(diffsecs)); | 278 | alarm->setTime(alarm->time().addSecs(diffsecs)); |
268 | } | 279 | } |
269 | }*/ | 280 | }*/ |
270 | mDtDue = getEvenTime(dtDue); | 281 | mDtDue = getEvenTime(dtDue); |
271 | 282 | ||
272 | //kdDebug(5800) << "setDtDue says date is " << mDtDue.toString() << endl; | 283 | //kdDebug(5800) << "setDtDue says date is " << mDtDue.toString() << endl; |
273 | 284 | ||
274 | /*const QPtrList<Alarm>& alarms = alarms(); | 285 | /*const QPtrList<Alarm>& alarms = alarms(); |
275 | for (Alarm* alarm = alarms.first(); alarm; alarm = alarms.next()) | 286 | for (Alarm* alarm = alarms.first(); alarm; alarm = alarms.next()) |
276 | alarm->setAlarmStart(mDtDue);*/ | 287 | alarm->setAlarmStart(mDtDue);*/ |
277 | updated(); | 288 | updated(); |
278 | } | 289 | } |
279 | 290 | ||
280 | QDateTime Todo::dtDue() const | 291 | QDateTime Todo::dtDue() const |
281 | { | 292 | { |
282 | return mDtDue; | 293 | return mDtDue; |
283 | } | 294 | } |
284 | 295 | ||
285 | QString Todo::dtDueTimeStr() const | 296 | QString Todo::dtDueTimeStr() const |
286 | { | 297 | { |
287 | return KGlobal::locale()->formatTime(mDtDue.time()); | 298 | return KGlobal::locale()->formatTime(mDtDue.time()); |
288 | } | 299 | } |
289 | 300 | ||
290 | QString Todo::dtDueDateStr(bool shortfmt) const | 301 | QString Todo::dtDueDateStr(bool shortfmt) const |
291 | { | 302 | { |
292 | return KGlobal::locale()->formatDate(mDtDue.date(),shortfmt); | 303 | return KGlobal::locale()->formatDate(mDtDue.date(),shortfmt); |
293 | } | 304 | } |
294 | 305 | ||
295 | QString Todo::dtDueStr(bool shortfmt) const | 306 | QString Todo::dtDueStr(bool shortfmt) const |
296 | { | 307 | { |
297 | if ( doesFloat() ) | 308 | if ( doesFloat() ) |
diff --git a/libkcal/todo.h b/libkcal/todo.h index ec1ffda..a5354ce 100644 --- a/libkcal/todo.h +++ b/libkcal/todo.h | |||
@@ -1,149 +1,150 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkcal. | 2 | This file is part of libkcal. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | #ifndef TODO_H | 20 | #ifndef TODO_H |
21 | #define TODO_H | 21 | #define TODO_H |
22 | // | 22 | // |
23 | // Todo component, representing a VTODO object | 23 | // Todo component, representing a VTODO object |
24 | // | 24 | // |
25 | 25 | ||
26 | #include "incidence.h" | 26 | #include "incidence.h" |
27 | 27 | ||
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | 29 | ||
30 | namespace KCal { | 30 | namespace KCal { |
31 | 31 | ||
32 | /** | 32 | /** |
33 | This class provides a Todo in the sense of RFC2445. | 33 | This class provides a Todo in the sense of RFC2445. |
34 | */ | 34 | */ |
35 | class Todo : public QObject,public Incidence | 35 | class Todo : public QObject,public Incidence |
36 | { | 36 | { |
37 | Q_OBJECT | 37 | Q_OBJECT |
38 | public: | 38 | public: |
39 | Todo(); | 39 | Todo(); |
40 | Todo(const Todo &); | 40 | Todo(const Todo &); |
41 | ~Todo(); | 41 | ~Todo(); |
42 | typedef ListBase<Todo> List; | 42 | typedef ListBase<Todo> List; |
43 | QCString type() const { return "Todo"; } | 43 | QCString type() const { return "Todo"; } |
44 | 44 | ||
45 | /** Return an exact copy of this todo. */ | 45 | /** Return an exact copy of this todo. */ |
46 | Incidence *clone(); | 46 | Incidence *clone(); |
47 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; | 47 | QDateTime getNextAlarmDateTime( bool * ok, int * offset ) const; |
48 | 48 | ||
49 | /** for setting the todo's due date/time with a QDateTime. */ | 49 | /** for setting the todo's due date/time with a QDateTime. */ |
50 | void setDtDue(const QDateTime &dtDue); | 50 | void setDtDue(const QDateTime &dtDue); |
51 | /** returns an event's Due date/time as a QDateTime. */ | 51 | /** returns an event's Due date/time as a QDateTime. */ |
52 | QDateTime dtDue() const; | 52 | QDateTime dtDue() const; |
53 | /** returns an event's due time as a string formatted according to the | 53 | /** returns an event's due time as a string formatted according to the |
54 | users locale settings */ | 54 | users locale settings */ |
55 | QString dtDueTimeStr() const; | 55 | QString dtDueTimeStr() const; |
56 | /** returns an event's due date as a string formatted according to the | 56 | /** returns an event's due date as a string formatted according to the |
57 | users locale settings */ | 57 | users locale settings */ |
58 | QString dtDueDateStr(bool shortfmt=true) const; | 58 | QString dtDueDateStr(bool shortfmt=true) const; |
59 | /** returns an event's due date and time as a string formatted according | 59 | /** returns an event's due date and time as a string formatted according |
60 | to the users locale settings */ | 60 | to the users locale settings */ |
61 | QString dtDueStr(bool shortfmt=true) const; | 61 | QString dtDueStr(bool shortfmt=true) const; |
62 | 62 | ||
63 | /** returns TRUE or FALSE depending on whether the todo has a due date */ | 63 | /** returns TRUE or FALSE depending on whether the todo has a due date */ |
64 | bool hasDueDate() const; | 64 | bool hasDueDate() const; |
65 | /** sets the event's hasDueDate value. */ | 65 | /** sets the event's hasDueDate value. */ |
66 | void setHasDueDate(bool f); | 66 | void setHasDueDate(bool f); |
67 | 67 | ||
68 | /* | 68 | /* |
69 | Looks for a subtodo (including itself ) which is not complete and is | 69 | Looks for a subtodo (including itself ) which is not complete and is |
70 | - overdue, or | 70 | - overdue, or |
71 | - due today. | 71 | - due today. |
72 | It returns 0 for nothing found, | 72 | It returns 0 for nothing found, |
73 | 1 for found a todo which is due today and no overdue found | 73 | 1 for found a todo which is due today and no overdue found |
74 | 2 for found a overdue todo | 74 | 2 for found a overdue todo |
75 | */ | 75 | */ |
76 | int hasDueSubTodo( bool checkSubtodos = true ); | 76 | int hasDueSubTodo( bool checkSubtodos = true ); |
77 | /* same as above, but a specific date can be specified*/ | 77 | /* same as above, but a specific date can be specified*/ |
78 | int hasDueSubTodoForDate( const QDate & date, bool checkSubtodos ); | 78 | int hasDueSubTodoForDate( const QDate & date, bool checkSubtodos ); |
79 | 79 | ||
80 | 80 | ||
81 | /** sets the event's status to the string specified. The string | 81 | /** sets the event's status to the string specified. The string |
82 | * must be a recognized value for the status field, i.e. a string | 82 | * must be a recognized value for the status field, i.e. a string |
83 | * equivalent of the possible status enumerations previously described. */ | 83 | * equivalent of the possible status enumerations previously described. */ |
84 | // void setStatus(const QString &statStr); | 84 | // void setStatus(const QString &statStr); |
85 | /** sets the event's status to the value specified. See the enumeration | 85 | /** sets the event's status to the value specified. See the enumeration |
86 | * above for possible values. */ | 86 | * above for possible values. */ |
87 | // void setStatus(int); | 87 | // void setStatus(int); |
88 | /** return the event's status. */ | 88 | /** return the event's status. */ |
89 | // int status() const; | 89 | // int status() const; |
90 | /** return the event's status in string format. */ | 90 | /** return the event's status in string format. */ |
91 | // QString statusStr() const; | 91 | // QString statusStr() const; |
92 | 92 | ||
93 | /** return, if this todo is completed */ | 93 | /** return, if this todo is completed */ |
94 | bool isCompleted() const; | 94 | bool isCompleted() const; |
95 | /** set completed state of this todo */ | 95 | /** set completed state of this todo */ |
96 | void setCompleted(bool); | 96 | void setCompleted(bool); |
97 | 97 | ||
98 | /** | 98 | /** |
99 | Return how many percent of the task are completed. Returns a value | 99 | Return how many percent of the task are completed. Returns a value |
100 | between 0 and 100. | 100 | between 0 and 100. |
101 | */ | 101 | */ |
102 | int percentComplete() const; | 102 | int percentComplete() const; |
103 | /** | 103 | /** |
104 | Set how many percent of the task are completed. Valid values are in the | 104 | Set how many percent of the task are completed. Valid values are in the |
105 | range from 0 to 100. | 105 | range from 0 to 100. |
106 | */ | 106 | */ |
107 | void setPercentComplete(int); | 107 | void setPercentComplete(int); |
108 | 108 | ||
109 | /** return date and time when todo was completed */ | 109 | /** return date and time when todo was completed */ |
110 | QDateTime completed() const; | 110 | QDateTime completed() const; |
111 | QString completedStr(bool shortF = true) const; | 111 | QString completedStr(bool shortF = true) const; |
112 | /** set date and time of completion */ | 112 | /** set date and time of completion */ |
113 | void setCompleted(const QDateTime &completed); | 113 | void setCompleted(const QDateTime &completed); |
114 | 114 | ||
115 | /** Return true, if todo has a date associated with completion */ | 115 | /** Return true, if todo has a date associated with completion */ |
116 | bool hasCompletedDate() const; | 116 | bool hasCompletedDate() const; |
117 | bool contains ( Todo*); | 117 | bool contains ( Todo*); |
118 | void checkSetCompletedFalse(); | 118 | void checkSetCompletedFalse(); |
119 | bool setRecurDates(); | 119 | bool setRecurDates(); |
120 | bool isRunning() {return mRunning;} | 120 | bool isRunning() {return mRunning;} |
121 | bool hasRunningSub(); | 121 | bool hasRunningSub(); |
122 | void setRunning( bool ); | 122 | void setRunning( bool ); |
123 | void setRunningFalse( QString ); | ||
123 | int runTime(); | 124 | int runTime(); |
124 | QDateTime runStart () const { return mRunStart;} | 125 | QDateTime runStart () const { return mRunStart;} |
125 | public slots: | 126 | public slots: |
126 | void saveRunningInfoToFile(); | 127 | void saveRunningInfoToFile( QString st = QString::null ); |
127 | void saveParents(); | 128 | void saveParents(); |
128 | private: | 129 | private: |
129 | bool mRunning; | 130 | bool mRunning; |
130 | QTimer * mRunSaveTimer; | 131 | QTimer * mRunSaveTimer; |
131 | QDateTime mRunStart; | 132 | QDateTime mRunStart; |
132 | bool accept(Visitor &v) { return v.visit(this); } | 133 | bool accept(Visitor &v) { return v.visit(this); } |
133 | 134 | ||
134 | QDateTime mDtDue; // due date of todo | 135 | QDateTime mDtDue; // due date of todo |
135 | 136 | ||
136 | bool mHasDueDate; // if todo has associated due date | 137 | bool mHasDueDate; // if todo has associated due date |
137 | 138 | ||
138 | // int mStatus; // confirmed/delegated/tentative/etc | 139 | // int mStatus; // confirmed/delegated/tentative/etc |
139 | 140 | ||
140 | QDateTime mCompleted; | 141 | QDateTime mCompleted; |
141 | bool mHasCompletedDate; | 142 | bool mHasCompletedDate; |
142 | 143 | ||
143 | int mPercentComplete; | 144 | int mPercentComplete; |
144 | }; | 145 | }; |
145 | 146 | ||
146 | bool operator==( const Todo&, const Todo& ); | 147 | bool operator==( const Todo&, const Todo& ); |
147 | } | 148 | } |
148 | 149 | ||
149 | #endif | 150 | #endif |
diff --git a/qtcompat/qinputdialog.cpp b/qtcompat/qinputdialog.cpp index 64c581e..ce46118 100644 --- a/qtcompat/qinputdialog.cpp +++ b/qtcompat/qinputdialog.cpp | |||
@@ -119,384 +119,384 @@ public: | |||
119 | up modeless. With \a type you specify the type of the dialog. | 119 | up modeless. With \a type you specify the type of the dialog. |
120 | 120 | ||
121 | \sa getText(), getInteger(), getDouble(), getItem() | 121 | \sa getText(), getInteger(), getDouble(), getItem() |
122 | */ | 122 | */ |
123 | 123 | ||
124 | QInputDialog::QInputDialog( const QString &label, QWidget* parent, const char* name, | 124 | QInputDialog::QInputDialog( const QString &label, QWidget* parent, const char* name, |
125 | bool modal, Type type) | 125 | bool modal, Type type) |
126 | : QDialog( parent, name, modal ) | 126 | : QDialog( parent, name, modal ) |
127 | { | 127 | { |
128 | if ( parent && parent->icon() &&!parent->icon()->isNull() ) | 128 | if ( parent && parent->icon() &&!parent->icon()->isNull() ) |
129 | setIcon( *parent->icon() ); | 129 | setIcon( *parent->icon() ); |
130 | else if ( qApp->mainWidget() && qApp->mainWidget()->icon() && !qApp->mainWidget()->icon()->isNull() ) | 130 | else if ( qApp->mainWidget() && qApp->mainWidget()->icon() && !qApp->mainWidget()->icon()->isNull() ) |
131 | QDialog::setIcon( *qApp->mainWidget()->icon() ); | 131 | QDialog::setIcon( *qApp->mainWidget()->icon() ); |
132 | 132 | ||
133 | d = new QInputDialogPrivate; | 133 | d = new QInputDialogPrivate; |
134 | d->lineEdit = 0; | 134 | d->lineEdit = 0; |
135 | d->spinBox = 0; | 135 | d->spinBox = 0; |
136 | d->comboBox = 0; | 136 | d->comboBox = 0; |
137 | 137 | ||
138 | QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); | 138 | QVBoxLayout *vbox = new QVBoxLayout( this, 6, 6 ); |
139 | 139 | ||
140 | QLabel* l = new QLabel( label, this ); | 140 | QLabel* l = new QLabel( label, this ); |
141 | vbox->addWidget( l ); | 141 | vbox->addWidget( l ); |
142 | 142 | ||
143 | d->stack = new QWidgetStack( this ); | 143 | d->stack = new QWidgetStack( this ); |
144 | vbox->addWidget( d->stack ); | 144 | vbox->addWidget( d->stack ); |
145 | d->lineEdit = new QLineEdit( d->stack ); | 145 | d->lineEdit = new QLineEdit( d->stack ); |
146 | d->spinBox = new QSpinBox( d->stack ); | 146 | d->spinBox = new QSpinBox( d->stack ); |
147 | d->comboBox = new QComboBox( FALSE, d->stack ); | 147 | d->comboBox = new QComboBox( FALSE, d->stack ); |
148 | d->editComboBox = new QComboBox( TRUE, d->stack ); | 148 | d->editComboBox = new QComboBox( TRUE, d->stack ); |
149 | 149 | ||
150 | QHBoxLayout *hbox = new QHBoxLayout( 6 ); | 150 | QHBoxLayout *hbox = new QHBoxLayout( 6 ); |
151 | vbox->addLayout( hbox, AlignRight ); | 151 | vbox->addLayout( hbox, AlignRight ); |
152 | 152 | ||
153 | d->ok = new QPushButton( tr( "&OK" ), this ); | 153 | d->ok = new QPushButton( tr( "&OK" ), this ); |
154 | d->ok->setDefault( TRUE ); | 154 | d->ok->setDefault( TRUE ); |
155 | QPushButton *cancel = new QPushButton( tr( "&Cancel" ), this ); | 155 | QPushButton *cancel = new QPushButton( tr( "&Cancel" ), this ); |
156 | 156 | ||
157 | QSize bs( d->ok->sizeHint() ); | 157 | QSize bs( d->ok->sizeHint() ); |
158 | if ( cancel->sizeHint().width() > bs.width() ) | 158 | if ( cancel->sizeHint().width() > bs.width() ) |
159 | bs.setWidth( cancel->sizeHint().width() ); | 159 | bs.setWidth( cancel->sizeHint().width() ); |
160 | 160 | ||
161 | d->ok->setFixedSize( bs ); | 161 | d->ok->setFixedSize( bs ); |
162 | cancel->setFixedSize( bs ); | 162 | cancel->setFixedSize( bs ); |
163 | 163 | ||
164 | hbox->addWidget( new QWidget( this ) ); | 164 | hbox->addWidget( new QWidget( this ) ); |
165 | hbox->addWidget( d->ok ); | 165 | hbox->addWidget( d->ok ); |
166 | hbox->addWidget( cancel ); | 166 | hbox->addWidget( cancel ); |
167 | 167 | ||
168 | connect( d->lineEdit, SIGNAL( returnPressed() ), | 168 | connect( d->lineEdit, SIGNAL( returnPressed() ), |
169 | this, SLOT( tryAccept() ) ); | 169 | this, SLOT( tryAccept() ) ); |
170 | connect( d->lineEdit, SIGNAL( textChanged( const QString & ) ), | 170 | connect( d->lineEdit, SIGNAL( textChanged( const QString & ) ), |
171 | this, SLOT( textChanged( const QString & ) ) ); | 171 | this, SLOT( textChanged( const QString & ) ) ); |
172 | 172 | ||
173 | connect( d->ok, SIGNAL( clicked() ), this, SLOT( accept() ) ); | 173 | connect( d->ok, SIGNAL( clicked() ), this, SLOT( accept() ) ); |
174 | connect( cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); | 174 | connect( cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); |
175 | 175 | ||
176 | //US ToDo make size dependent of targetplatform | 176 | //US ToDo make size dependent of targetplatform |
177 | //US resize( QMAX( sizeHint().width(), 400 ), sizeHint().height() ); | 177 | //US resize( QMAX( sizeHint().width(), 400 ), sizeHint().height() ); |
178 | resize( sizeHint().width(), sizeHint().height() ); | 178 | resize( sizeHint().width(), sizeHint().height() ); |
179 | 179 | ||
180 | setType( type ); | 180 | setType( type ); |
181 | } | 181 | } |
182 | 182 | ||
183 | /*! | 183 | /*! |
184 | Returns the line edit, which is used in the LineEdit mode | 184 | Returns the line edit, which is used in the LineEdit mode |
185 | */ | 185 | */ |
186 | 186 | ||
187 | QLineEdit *QInputDialog::lineEdit() const | 187 | QLineEdit *QInputDialog::lineEdit() const |
188 | { | 188 | { |
189 | return d->lineEdit; | 189 | return d->lineEdit; |
190 | } | 190 | } |
191 | 191 | ||
192 | /*! | 192 | /*! |
193 | Returns the spinbox, which is used in the SpinBox mode | 193 | Returns the spinbox, which is used in the SpinBox mode |
194 | */ | 194 | */ |
195 | 195 | ||
196 | QSpinBox *QInputDialog::spinBox() const | 196 | QSpinBox *QInputDialog::spinBox() const |
197 | { | 197 | { |
198 | return d->spinBox; | 198 | return d->spinBox; |
199 | } | 199 | } |
200 | 200 | ||
201 | /*! | 201 | /*! |
202 | Returns the combobox, which is used in the ComboBox mode | 202 | Returns the combobox, which is used in the ComboBox mode |
203 | */ | 203 | */ |
204 | 204 | ||
205 | QComboBox *QInputDialog::comboBox() const | 205 | QComboBox *QInputDialog::comboBox() const |
206 | { | 206 | { |
207 | return d->comboBox; | 207 | return d->comboBox; |
208 | } | 208 | } |
209 | 209 | ||
210 | /*! | 210 | /*! |
211 | Returns the combobox, which is used in the EditableComboBox mode | 211 | Returns the combobox, which is used in the EditableComboBox mode |
212 | */ | 212 | */ |
213 | 213 | ||
214 | QComboBox *QInputDialog::editableComboBox() const | 214 | QComboBox *QInputDialog::editableComboBox() const |
215 | { | 215 | { |
216 | return d->editComboBox; | 216 | return d->editComboBox; |
217 | } | 217 | } |
218 | 218 | ||
219 | /*! | 219 | /*! |
220 | Sets the input type of the dialog to \a t. | 220 | Sets the input type of the dialog to \a t. |
221 | */ | 221 | */ |
222 | 222 | ||
223 | void QInputDialog::setType( Type t ) | 223 | void QInputDialog::setType( Type t ) |
224 | { | 224 | { |
225 | switch ( t ) { | 225 | switch ( t ) { |
226 | case LineEdit: | 226 | case LineEdit: |
227 | d->stack->raiseWidget( d->lineEdit ); | 227 | d->stack->raiseWidget( d->lineEdit ); |
228 | d->lineEdit->setFocus(); | 228 | d->lineEdit->setFocus(); |
229 | break; | 229 | break; |
230 | case SpinBox: | 230 | case SpinBox: |
231 | d->stack->raiseWidget( d->spinBox ); | 231 | d->stack->raiseWidget( d->spinBox ); |
232 | d->spinBox->setFocus(); | 232 | d->spinBox->setFocus(); |
233 | break; | 233 | break; |
234 | case ComboBox: | 234 | case ComboBox: |
235 | d->stack->raiseWidget( d->comboBox ); | 235 | d->stack->raiseWidget( d->comboBox ); |
236 | d->comboBox->setFocus(); | 236 | d->comboBox->setFocus(); |
237 | break; | 237 | break; |
238 | case EditableComboBox: | 238 | case EditableComboBox: |
239 | d->stack->raiseWidget( d->editComboBox ); | 239 | d->stack->raiseWidget( d->editComboBox ); |
240 | d->editComboBox->setFocus(); | 240 | d->editComboBox->setFocus(); |
241 | break; | 241 | break; |
242 | } | 242 | } |
243 | 243 | ||
244 | d->type = t; | 244 | d->type = t; |
245 | } | 245 | } |
246 | 246 | ||
247 | /*! | 247 | /*! |
248 | Returns the input type of the dialog. | 248 | Returns the input type of the dialog. |
249 | 249 | ||
250 | \sa setType() | 250 | \sa setType() |
251 | */ | 251 | */ |
252 | 252 | ||
253 | QInputDialog::Type QInputDialog::type() const | 253 | QInputDialog::Type QInputDialog::type() const |
254 | { | 254 | { |
255 | return d->type; | 255 | return d->type; |
256 | } | 256 | } |
257 | 257 | ||
258 | /*! | 258 | /*! |
259 | Destructor. | 259 | Destructor. |
260 | */ | 260 | */ |
261 | 261 | ||
262 | QInputDialog::~QInputDialog() | 262 | QInputDialog::~QInputDialog() |
263 | { | 263 | { |
264 | delete d; | 264 | delete d; |
265 | } | 265 | } |
266 | 266 | ||
267 | /*! | 267 | /*! |
268 | Static convenience function to get a textual input from the user. \a caption is the text | 268 | Static convenience function to get a textual input from the user. \a caption is the text |
269 | which is displayed in the title bar of the dialog. \a label is the text which | 269 | which is displayed in the title bar of the dialog. \a label is the text which |
270 | is shown to the user (it should mention to the user what he/she should input), \a text | 270 | is shown to the user (it should mention to the user what he/she should input), \a text |
271 | the default text which will be initially set to the line edit, \a ok a pointer to | 271 | the default text which will be initially set to the line edit, \a ok a pointer to |
272 | a bool which will be (if not 0!) set to TRUE if the user pressed ok or to FALSE if the | 272 | a bool which will be (if not 0!) set to TRUE if the user pressed ok or to FALSE if the |
273 | user pressed cancel, \a parent the parent widget of the dialog and \a name | 273 | user pressed cancel, \a parent the parent widget of the dialog and \a name |
274 | the name of it. The dialogs pops up modally! | 274 | the name of it. The dialogs pops up modally! |
275 | 275 | ||
276 | This method returns the text which has been entered in the line edit. | 276 | This method returns the text which has been entered in the line edit. |
277 | 277 | ||
278 | You will use this static method like this: | 278 | You will use this static method like this: |
279 | 279 | ||
280 | \code | 280 | \code |
281 | bool ok = FALSE; | 281 | bool ok = FALSE; |
282 | QString text = QInputDialog::getText( tr( "Please enter your name" ), QString::null, &ok, this ); | 282 | QString text = QInputDialog::getText( tr( "Please enter your name" ), QString::null, &ok, this ); |
283 | if ( ok && !text.isEmpty() ) | 283 | if ( ok && !text.isEmpty() ) |
284 | ;// user entered something and pressed ok | 284 | ;// user entered something and pressed ok |
285 | else | 285 | else |
286 | ;// user entered nothing or pressed cancel | 286 | ;// user entered nothing or pressed cancel |
287 | \endcode | 287 | \endcode |
288 | */ | 288 | */ |
289 | 289 | ||
290 | QString QInputDialog::getText( const QString &caption, const QString &label, const QString &text, | 290 | QString QInputDialog::getText( const QString &caption, const QString &label, const QString &text, |
291 | bool *ok, QWidget *parent, const char *name ) | 291 | bool *ok, QWidget *parent, const char *name ) |
292 | { | 292 | { |
293 | return getText( caption, label, QLineEdit::Normal, text, ok, parent, name ); | 293 | return getText( caption, label, QLineEdit::Normal, text, ok, parent, name ); |
294 | } | 294 | } |
295 | 295 | ||
296 | /*! | 296 | /*! |
297 | Like above, but accepts an a \a mode which the line edit will use to display text. | 297 | Like above, but accepts an a \a mode which the line edit will use to display text. |
298 | 298 | ||
299 | \sa getText() | 299 | \sa getText() |
300 | */ | 300 | */ |
301 | 301 | ||
302 | QString QInputDialog::getText( const QString &caption, const QString &label, QLineEdit::EchoMode mode, | 302 | QString QInputDialog::getText( const QString &caption, const QString &label, QLineEdit::EchoMode mode, |
303 | const QString &text, bool *ok, QWidget *parent, const char *name ) | 303 | const QString &text, bool *ok, QWidget *parent, const char *name ) |
304 | { | 304 | { |
305 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, LineEdit ); | 305 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, LineEdit ); |
306 | dlg->setCaption( caption ); | 306 | dlg->setCaption( caption ); |
307 | dlg->lineEdit()->setText( text ); | 307 | dlg->lineEdit()->setText( text ); |
308 | dlg->lineEdit()->setEchoMode( mode ); | 308 | dlg->lineEdit()->setEchoMode( mode ); |
309 | if ( !text.isEmpty() ) | 309 | if ( !text.isEmpty() ) |
310 | dlg->lineEdit()->selectAll(); | 310 | dlg->lineEdit()->selectAll(); |
311 | 311 | dlg->setMinimumWidth ( 230 ); | |
312 | bool ok_ = FALSE; | 312 | bool ok_ = FALSE; |
313 | QString result; | 313 | QString result; |
314 | ok_ = dlg->exec() == QDialog::Accepted; | 314 | ok_ = dlg->exec() == QDialog::Accepted; |
315 | if ( ok ) | 315 | if ( ok ) |
316 | *ok = ok_; | 316 | *ok = ok_; |
317 | if ( ok_ ) | 317 | if ( ok_ ) |
318 | result = dlg->lineEdit()->text(); | 318 | result = dlg->lineEdit()->text(); |
319 | 319 | ||
320 | delete dlg; | 320 | delete dlg; |
321 | return result; | 321 | return result; |
322 | } | 322 | } |
323 | 323 | ||
324 | /*! | 324 | /*! |
325 | Static convenience function to get an integral input from the user. \a caption is the text | 325 | Static convenience function to get an integral input from the user. \a caption is the text |
326 | which is displayed in the title bar of the dialog. \a label is the text which | 326 | which is displayed in the title bar of the dialog. \a label is the text which |
327 | is shown to the user (it should mention to the user what he/she should input), \a num | 327 | is shown to the user (it should mention to the user what he/she should input), \a num |
328 | the default number which will be initially set to the spinbox, \a from and \a to the | 328 | the default number which will be initially set to the spinbox, \a from and \a to the |
329 | range in which the entered number has to be, \a step the step in which the number can | 329 | range in which the entered number has to be, \a step the step in which the number can |
330 | be increased/decreased by the spinbox, \a ok a pointer to | 330 | be increased/decreased by the spinbox, \a ok a pointer to |
331 | a bool which will be (if not 0!) set to TRUE if the user pressed ok or to FALSE if the | 331 | a bool which will be (if not 0!) set to TRUE if the user pressed ok or to FALSE if the |
332 | user pressed cancel, \a parent the parent widget of the dialog and \a name | 332 | user pressed cancel, \a parent the parent widget of the dialog and \a name |
333 | the name of it. The dialogs pops up modally! | 333 | the name of it. The dialogs pops up modally! |
334 | 334 | ||
335 | This method returns the number which has been entered by the user. | 335 | This method returns the number which has been entered by the user. |
336 | 336 | ||
337 | You will use this static method like this: | 337 | You will use this static method like this: |
338 | 338 | ||
339 | \code | 339 | \code |
340 | bool ok = FALSE; | 340 | bool ok = FALSE; |
341 | int res = QInputDialog::getInteger( tr( "Please enter a number" ), 22, 0, 1000, 2, &ok, this ); | 341 | int res = QInputDialog::getInteger( tr( "Please enter a number" ), 22, 0, 1000, 2, &ok, this ); |
342 | if ( ok ) | 342 | if ( ok ) |
343 | ;// user entered something and pressed ok | 343 | ;// user entered something and pressed ok |
344 | else | 344 | else |
345 | ;// user pressed cancel | 345 | ;// user pressed cancel |
346 | \endcode | 346 | \endcode |
347 | */ | 347 | */ |
348 | 348 | ||
349 | int QInputDialog::getInteger( const QString &caption, const QString &label, int num, int from, int to, int step, | 349 | int QInputDialog::getInteger( const QString &caption, const QString &label, int num, int from, int to, int step, |
350 | bool *ok, QWidget *parent, const char *name ) | 350 | bool *ok, QWidget *parent, const char *name ) |
351 | { | 351 | { |
352 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, SpinBox ); | 352 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, SpinBox ); |
353 | dlg->setCaption( caption ); | 353 | dlg->setCaption( caption ); |
354 | dlg->spinBox()->setRange( from, to ); | 354 | dlg->spinBox()->setRange( from, to ); |
355 | dlg->spinBox()->setSteps( step, 0 ); | 355 | dlg->spinBox()->setSteps( step, 0 ); |
356 | dlg->spinBox()->setValue( num ); | 356 | dlg->spinBox()->setValue( num ); |
357 | 357 | ||
358 | bool ok_ = FALSE; | 358 | bool ok_ = FALSE; |
359 | int result; | 359 | int result; |
360 | ok_ = dlg->exec() == QDialog::Accepted; | 360 | ok_ = dlg->exec() == QDialog::Accepted; |
361 | if ( ok ) | 361 | if ( ok ) |
362 | *ok = ok_; | 362 | *ok = ok_; |
363 | result = dlg->spinBox()->value(); | 363 | result = dlg->spinBox()->value(); |
364 | 364 | ||
365 | delete dlg; | 365 | delete dlg; |
366 | return result; | 366 | return result; |
367 | } | 367 | } |
368 | 368 | ||
369 | /*! | 369 | /*! |
370 | Static convenience function to get a decimal input from the user. \a caption is the text | 370 | Static convenience function to get a decimal input from the user. \a caption is the text |
371 | which is displayed in the title bar of the dialog. \a label is the text which | 371 | which is displayed in the title bar of the dialog. \a label is the text which |
372 | is shown to the user (it should mention to the user what he/she should input), \a num | 372 | is shown to the user (it should mention to the user what he/she should input), \a num |
373 | the default decimal number which will be initially set to the line edit, \a from and \a to the | 373 | the default decimal number which will be initially set to the line edit, \a from and \a to the |
374 | range in which the entered number has to be, \a decimals the number of decimal which | 374 | range in which the entered number has to be, \a decimals the number of decimal which |
375 | the number may have, \a ok a pointer to | 375 | the number may have, \a ok a pointer to |
376 | a bool which will be (if not 0!) set to TRUE if the user pressed ok or to FALSE if the | 376 | a bool which will be (if not 0!) set to TRUE if the user pressed ok or to FALSE if the |
377 | user pressed cancel, \a parent the parent widget of the dialog and \a name | 377 | user pressed cancel, \a parent the parent widget of the dialog and \a name |
378 | the name of it. The dialogs pops up modally! | 378 | the name of it. The dialogs pops up modally! |
379 | 379 | ||
380 | This method returns the number which has been entered by the user. | 380 | This method returns the number which has been entered by the user. |
381 | 381 | ||
382 | You will use this static method like this: | 382 | You will use this static method like this: |
383 | 383 | ||
384 | \code | 384 | \code |
385 | bool ok = FALSE; | 385 | bool ok = FALSE; |
386 | double res = QInputDialog::getDouble( tr( "Please enter a decimal number" ), 33.7, 0, 1000, 2, &ok, this ); | 386 | double res = QInputDialog::getDouble( tr( "Please enter a decimal number" ), 33.7, 0, 1000, 2, &ok, this ); |
387 | if ( ok ) | 387 | if ( ok ) |
388 | ;// user entered something and pressed ok | 388 | ;// user entered something and pressed ok |
389 | else | 389 | else |
390 | ;// user pressed cancel | 390 | ;// user pressed cancel |
391 | \endcode | 391 | \endcode |
392 | */ | 392 | */ |
393 | 393 | ||
394 | double QInputDialog::getDouble( const QString &caption, const QString &label, double num, | 394 | double QInputDialog::getDouble( const QString &caption, const QString &label, double num, |
395 | double from, double to, int decimals, | 395 | double from, double to, int decimals, |
396 | bool *ok, QWidget *parent, const char *name ) | 396 | bool *ok, QWidget *parent, const char *name ) |
397 | { | 397 | { |
398 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, LineEdit ); | 398 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, LineEdit ); |
399 | dlg->setCaption( caption ); | 399 | dlg->setCaption( caption ); |
400 | dlg->lineEdit()->setValidator( new QDoubleValidator( from, to, decimals, dlg->lineEdit() ) ); | 400 | dlg->lineEdit()->setValidator( new QDoubleValidator( from, to, decimals, dlg->lineEdit() ) ); |
401 | dlg->lineEdit()->setText( QString::number( num, 'f', decimals ) ); | 401 | dlg->lineEdit()->setText( QString::number( num, 'f', decimals ) ); |
402 | dlg->lineEdit()->selectAll(); | 402 | dlg->lineEdit()->selectAll(); |
403 | 403 | ||
404 | bool accepted = ( dlg->exec() == QDialog::Accepted ); | 404 | bool accepted = ( dlg->exec() == QDialog::Accepted ); |
405 | if ( ok ) | 405 | if ( ok ) |
406 | *ok = accepted; | 406 | *ok = accepted; |
407 | 407 | ||
408 | double result = dlg->lineEdit()->text().toDouble(); | 408 | double result = dlg->lineEdit()->text().toDouble(); |
409 | 409 | ||
410 | delete dlg; | 410 | delete dlg; |
411 | return result; | 411 | return result; |
412 | } | 412 | } |
413 | 413 | ||
414 | /*! | 414 | /*! |
415 | Static convenience function to let the user select an item from a string list. \a caption is the text | 415 | Static convenience function to let the user select an item from a string list. \a caption is the text |
416 | which is displayed in the title bar of the dialog. \a label is the text which | 416 | which is displayed in the title bar of the dialog. \a label is the text which |
417 | is shown to the user (it should mention to the user what he/she should input), \a list the | 417 | is shown to the user (it should mention to the user what he/she should input), \a list the |
418 | string list which is inserted into the combobox, \a current the number of the item which should | 418 | string list which is inserted into the combobox, \a current the number of the item which should |
419 | be initially the current item, \a editable specifies if the combobox should be editable (if it is TRUE) | 419 | be initially the current item, \a editable specifies if the combobox should be editable (if it is TRUE) |
420 | or read-only (if \a editable is FALSE), \a ok a pointer to | 420 | or read-only (if \a editable is FALSE), \a ok a pointer to |
421 | a bool which will be (if not 0!) set to TRUE if the user pressed ok or to FALSE if the | 421 | a bool which will be (if not 0!) set to TRUE if the user pressed ok or to FALSE if the |
422 | user pressed cancel, \a parent the parent widget of the dialog and \a name | 422 | user pressed cancel, \a parent the parent widget of the dialog and \a name |
423 | the name of it. The dialogs pops up modally! | 423 | the name of it. The dialogs pops up modally! |
424 | 424 | ||
425 | This method returns the text of the current item, or if \a editable was TRUE, the current | 425 | This method returns the text of the current item, or if \a editable was TRUE, the current |
426 | text of the combobox. | 426 | text of the combobox. |
427 | 427 | ||
428 | You will use this static method like this: | 428 | You will use this static method like this: |
429 | 429 | ||
430 | \code | 430 | \code |
431 | QStringList lst; | 431 | QStringList lst; |
432 | lst << "First" << "Second" << "Third" << "Fourth" << "Fifth"; | 432 | lst << "First" << "Second" << "Third" << "Fourth" << "Fifth"; |
433 | bool ok = FALSE; | 433 | bool ok = FALSE; |
434 | QString res = QInputDialog::getItem( tr( "Please select an item" ), lst, 1, TRUE, &ok, this ); | 434 | QString res = QInputDialog::getItem( tr( "Please select an item" ), lst, 1, TRUE, &ok, this ); |
435 | if ( ok ) | 435 | if ( ok ) |
436 | ;// user selected an item and pressed ok | 436 | ;// user selected an item and pressed ok |
437 | else | 437 | else |
438 | ;// user pressed cancel | 438 | ;// user pressed cancel |
439 | \endcode | 439 | \endcode |
440 | */ | 440 | */ |
441 | 441 | ||
442 | QString QInputDialog::getItem( const QString &caption, const QString &label, const QStringList &list, | 442 | QString QInputDialog::getItem( const QString &caption, const QString &label, const QStringList &list, |
443 | int current, bool editable, | 443 | int current, bool editable, |
444 | bool *ok, QWidget *parent, const char *name ) | 444 | bool *ok, QWidget *parent, const char *name ) |
445 | { | 445 | { |
446 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, editable ? EditableComboBox : ComboBox ); | 446 | QInputDialog *dlg = new QInputDialog( label, parent, name, TRUE, editable ? EditableComboBox : ComboBox ); |
447 | dlg->setCaption( caption ); | 447 | dlg->setCaption( caption ); |
448 | if ( editable ) { | 448 | if ( editable ) { |
449 | dlg->editableComboBox()->insertStringList( list ); | 449 | dlg->editableComboBox()->insertStringList( list ); |
450 | dlg->editableComboBox()->setCurrentItem( current ); | 450 | dlg->editableComboBox()->setCurrentItem( current ); |
451 | } else { | 451 | } else { |
452 | dlg->comboBox()->insertStringList( list ); | 452 | dlg->comboBox()->insertStringList( list ); |
453 | dlg->comboBox()->setCurrentItem( current ); | 453 | dlg->comboBox()->setCurrentItem( current ); |
454 | } | 454 | } |
455 | 455 | ||
456 | bool ok_ = FALSE; | 456 | bool ok_ = FALSE; |
457 | QString result; | 457 | QString result; |
458 | int fixWid = 320; | 458 | int fixWid = 320; |
459 | if ( QApplication::desktop()->width() <= 240 ) { | 459 | if ( QApplication::desktop()->width() <= 240 ) { |
460 | fixWid = 230; | 460 | fixWid = 230; |
461 | } | 461 | } |
462 | dlg->setFixedWidth( fixWid); | 462 | dlg->setFixedWidth( fixWid); |
463 | ok_ = dlg->exec() == QDialog::Accepted; | 463 | ok_ = dlg->exec() == QDialog::Accepted; |
464 | if ( ok ) | 464 | if ( ok ) |
465 | *ok = ok_; | 465 | *ok = ok_; |
466 | if ( editable ) | 466 | if ( editable ) |
467 | result = dlg->editableComboBox()->currentText(); | 467 | result = dlg->editableComboBox()->currentText(); |
468 | else | 468 | else |
469 | result = dlg->comboBox()->currentText(); | 469 | result = dlg->comboBox()->currentText(); |
470 | 470 | ||
471 | delete dlg; | 471 | delete dlg; |
472 | return result; | 472 | return result; |
473 | } | 473 | } |
474 | 474 | ||
475 | /*! | 475 | /*! |
476 | \internal | 476 | \internal |
477 | */ | 477 | */ |
478 | 478 | ||
479 | void QInputDialog::textChanged( const QString &s ) | 479 | void QInputDialog::textChanged( const QString &s ) |
480 | { | 480 | { |
481 | bool on; | 481 | bool on; |
482 | if ( d->lineEdit->validator() ) { | 482 | if ( d->lineEdit->validator() ) { |
483 | QString str = d->lineEdit->text(); | 483 | QString str = d->lineEdit->text(); |
484 | int index = d->lineEdit->cursorPosition(); | 484 | int index = d->lineEdit->cursorPosition(); |
485 | on = ( d->lineEdit->validator()->validate(str, index) == | 485 | on = ( d->lineEdit->validator()->validate(str, index) == |
486 | QValidator::Acceptable ); | 486 | QValidator::Acceptable ); |
487 | } else { | 487 | } else { |
488 | on = !s.isEmpty(); | 488 | on = !s.isEmpty(); |
489 | } | 489 | } |
490 | d->ok->setEnabled( on ); | 490 | d->ok->setEnabled( on ); |
491 | } | 491 | } |
492 | 492 | ||
493 | /*! | 493 | /*! |
494 | \internal | 494 | \internal |
495 | */ | 495 | */ |
496 | 496 | ||
497 | void QInputDialog::tryAccept() | 497 | void QInputDialog::tryAccept() |
498 | { | 498 | { |
499 | if ( !d->lineEdit->text().isEmpty() ) | 499 | if ( !d->lineEdit->text().isEmpty() ) |
500 | accept(); | 500 | accept(); |
501 | } | 501 | } |
502 | 502 | ||