summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-28 09:08:21 (UTC)
committer zautrix <zautrix>2005-04-28 09:08:21 (UTC)
commit8fbdf5d2b0ee1e1496cb856e0ead37c668066353 (patch) (unidiff)
tree964dd57f1492857fb9471a0af9943d08c56e5c6e
parent42786862c89c0de78cec783f251eae66bcbc53db (diff)
downloadkdepimpi-8fbdf5d2b0ee1e1496cb856e0ead37c668066353.zip
kdepimpi-8fbdf5d2b0ee1e1496cb856e0ead37c668066353.tar.gz
kdepimpi-8fbdf5d2b0ee1e1496cb856e0ead37c668066353.tar.bz2
added comment for todo
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt6
-rw-r--r--korganizer/kotodoview.cpp16
-rw-r--r--libkcal/todo.cpp13
-rw-r--r--libkcal/todo.h3
-rw-r--r--qtcompat/qinputdialog.cpp2
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
@@ -1243,131 +1243,133 @@
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,124 +1,126 @@
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"
56using namespace KOrg; 58using namespace KOrg;
57 59
58 60
59class KOTodoViewWhatsThis :public QWhatsThis 61class KOTodoViewWhatsThis :public QWhatsThis
60{ 62{
61public: 63public:
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
64protected: 66protected:
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 }
69private: 71private:
70 QWidget* _wid; 72 QWidget* _wid;
71 KOTodoView * _view; 73 KOTodoView * _view;
72}; 74};
73 75
74KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, 76KOTodoListView::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
95void KOTodoListView::contentsDragEnterEvent(QDragEnterEvent *e) 97void 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
110void KOTodoListView::contentsDragMoveEvent(QDragMoveEvent *e) 112void 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
@@ -1033,196 +1035,206 @@ void KOTodoView::setNewPercentage(int index)
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
1052QPopupMenu * KOTodoView::getCategoryPopupMenu (KOTodoViewItem *todoItem) 1054QPopupMenu * 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}
1071void KOTodoView::changedCategories(int index) 1073void 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}
1093void KOTodoView::itemDoubleClicked(QListViewItem *item) 1095void 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}
1122void KOTodoView::toggleRunningItem() 1124void 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
1143void KOTodoView::itemClicked(QListViewItem *item) 1155void 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
1178void KOTodoView::setDocumentId( const QString &id ) 1190void KOTodoView::setDocumentId( const QString &id )
1179{ 1191{
1180 1192
1181 mDocPrefs->setDoc( id ); 1193 mDocPrefs->setDoc( id );
1182} 1194}
1183 1195
1184void KOTodoView::itemStateChanged( QListViewItem *item ) 1196void 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
1195void KOTodoView::saveLayout(KConfig *config, const QString &group) const 1207void KOTodoView::saveLayout(KConfig *config, const QString &group) const
1196{ 1208{
1197 mTodoListView->saveLayout(config,group); 1209 mTodoListView->saveLayout(config,group);
1198} 1210}
1199 1211
1200void KOTodoView::restoreLayout(KConfig *config, const QString &group) 1212void KOTodoView::restoreLayout(KConfig *config, const QString &group)
1201{ 1213{
1202 mTodoListView->restoreLayout(config,group); 1214 mTodoListView->restoreLayout(config,group);
1203} 1215}
1204 1216
1205void KOTodoView::processSelectionChange() 1217void 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
1219void KOTodoView::modified(bool b) 1231void KOTodoView::modified(bool b)
1220{ 1232{
1221 emit isModified(b); 1233 emit isModified(b);
1222} 1234}
1223void KOTodoView::setTodoModified( Todo* todo ) 1235void KOTodoView::setTodoModified( Todo* todo )
1224{ 1236{
1225 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); 1237 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED );
1226} 1238}
1227void KOTodoView::clearSelection() 1239void KOTodoView::clearSelection()
1228{ 1240{
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 002d3f2..f7e38a7 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -1,201 +1,212 @@
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
32using namespace KCal; 32using namespace KCal;
33 33
34Todo::Todo(): QObject(), Incidence() 34Todo::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
47Todo::Todo(const Todo &t) : QObject(),Incidence(t) 47Todo::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
58Todo::~Todo() 58Todo::~Todo()
59{ 59{
60 setRunning( false ); 60 setRunning( false );
61 //qDebug("Todo::~Todo() "); 61 //qDebug("Todo::~Todo() ");
62} 62}
63 63
64void Todo::setRunningFalse( QString s )
65{
66 if ( ! mRunning )
67 return;
68 mRunning = false;
69 mRunSaveTimer->stop();
70 saveRunningInfoToFile( s );
71}
64void Todo::setRunning( bool run ) 72void 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
83void Todo::saveRunningInfoToFile() 91void 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}
113void Todo::saveParents() 124void 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
141int Todo::runTime() 152int 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}
147bool Todo::hasRunningSub() 158bool 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}
158Incidence *Todo::clone() 169Incidence *Todo::clone()
159{ 170{
160 return new Todo(*this); 171 return new Todo(*this);
161} 172}
162 173
163bool Todo::contains ( Todo* from ) 174bool 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();
diff --git a/libkcal/todo.h b/libkcal/todo.h
index ec1ffda..a5354ce 100644
--- a/libkcal/todo.h
+++ b/libkcal/todo.h
@@ -27,123 +27,124 @@
27 27
28#include <qtimer.h> 28#include <qtimer.h>
29 29
30namespace KCal { 30namespace 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
@@ -215,193 +215,193 @@ 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
223void QInputDialog::setType( Type t ) 223void 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
253QInputDialog::Type QInputDialog::type() const 253QInputDialog::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
262QInputDialog::~QInputDialog() 262QInputDialog::~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
290QString QInputDialog::getText( const QString &caption, const QString &label, const QString &text, 290QString 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
302QString QInputDialog::getText( const QString &caption, const QString &label, QLineEdit::EchoMode mode, 302QString 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
349int QInputDialog::getInteger( const QString &caption, const QString &label, int num, int from, int to, int step, 349int 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
394double QInputDialog::getDouble( const QString &caption, const QString &label, double num, 394double 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