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
@@ -1083,291 +1083,293 @@
1083{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, 1083{ "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" },
1084{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" }, 1084{ "Settings are stored in\n%1","Einstellungen werden gespeichert in:\n%1" },
1085{ "Data storage path","Daten Speicherpfad" }, 1085{ "Data storage path","Daten Speicherpfad" },
1086{ "Language","Sprache" }, 1086{ "Language","Sprache" },
1087{ "Show time in agenda items","Zeige Zeit in Agenda Items" }, 1087{ "Show time in agenda items","Zeige Zeit in Agenda Items" },
1088{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" }, 1088{ "Color for Sundays + category "Holiday"","Farbe für Sonntags + Kategorie "Feiertag"" },
1089{ "Show events, that are done","Zeige abgelaufene Termine" }, 1089{ "Show events, that are done","Zeige abgelaufene Termine" },
1090{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" }, 1090{ "Hide not running Todos in To-do view","Verstecke nicht laufende Todos" },
1091{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" }, 1091{ "+01:00 Europe/Oslo(CET)","+01:00 Europe/Oslo(CET)" },
1092{ "KO/Pi","KO/Pi" }, 1092{ "KO/Pi","KO/Pi" },
1093{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" }, 1093{ "There is nothing to undo!","Es gibt nichts zum\nRückgängigmachen!" },
1094{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." }, 1094{ "Recreating edit dialog. Please wait...","Recreating edit dialog. Please wait..." },
1095{ "Sound.Al.: ","Sound.Al.: " }, 1095{ "Sound.Al.: ","Sound.Al.: " },
1096{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" }, 1096{ "From: %1 To: %2 %3","Von: %1 Bis: %2 %3" },
1097{ "Restore","Wiederherstellen" }, 1097{ "Restore","Wiederherstellen" },
1098{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" }, 1098{ "\nAre you sure you want\nto restore this?","\nMöchten Sie das wirklicht\nwiederherstellen?" },
1099{ "% completed","% erledigt" }, 1099{ "% completed","% erledigt" },
1100{ "%d item(s) found.","%d Item(s) gefunden." }, 1100{ "%d item(s) found.","%d Item(s) gefunden." },
1101{ "Set complete","Setze auf erledigt" }, 1101{ "Set complete","Setze auf erledigt" },
1102{ "(cancelled)","(gecancelt)" }, 1102{ "(cancelled)","(gecancelt)" },
1103{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" }, 1103{ "Click on the week number to\nshow week in agenda view","Klicke auf die Wochennummer\num die Woche in der Agenda anzuzeigen" },
1104{ " Local time "," Locale Zeit " }, 1104{ " Local time "," Locale Zeit " },
1105{ "Form2","Form2" }, 1105{ "Form2","Form2" },
1106{ "Filter enabled","Filter angeschaltet" }, 1106{ "Filter enabled","Filter angeschaltet" },
1107{ "Edit Filters","Ändere Filter" }, 1107{ "Edit Filters","Ändere Filter" },
1108{ "Print What's Next View...","Drucke What's Next Ansicht..." }, 1108{ "Print What's Next View...","Drucke What's Next Ansicht..." },
1109{ "Agenda","Agenda" }, 1109{ "Agenda","Agenda" },
1110{ " ("," (" }, 1110{ " ("," (" },
1111{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" }, 1111{ "<p><b>Due on:</b> %1</p>","<p><b>Fällig am:</b> %1</p>" },
1112{ "Print","Print" }, 1112{ "Print","Print" },
1113{ "&Setup Printer...","Drucker &Setup..." }, 1113{ "&Setup Printer...","Drucker &Setup..." },
1114{ "View Type","Zeige Typ" }, 1114{ "View Type","Zeige Typ" },
1115{ "Page &orientation:","Seiten Ausrichtung:" }, 1115{ "Page &orientation:","Seiten Ausrichtung:" },
1116{ "Use Default of Selected Style","Default des selektierten Stils" }, 1116{ "Use Default of Selected Style","Default des selektierten Stils" },
1117{ "Use Default Setting of Printer","Default Einstellung des Druckers" }, 1117{ "Use Default Setting of Printer","Default Einstellung des Druckers" },
1118{ "Portrait","Portrait" }, 1118{ "Portrait","Portrait" },
1119{ "Landscape","Landschaft" }, 1119{ "Landscape","Landschaft" },
1120{ "Print day","Drucke Tag" }, 1120{ "Print day","Drucke Tag" },
1121{ "CalPrintDay_Base","CalPrintDay_Base" }, 1121{ "CalPrintDay_Base","CalPrintDay_Base" },
1122{ "Date && Time Range","Datum && Zeitspanne" }, 1122{ "Date && Time Range","Datum && Zeitspanne" },
1123{ "&End date:","&Enddatum:" }, 1123{ "&End date:","&Enddatum:" },
1124{ "&Start date:","&Startdatum:" }, 1124{ "&Start date:","&Startdatum:" },
1125{ "Start &time:","Startzeit:" }, 1125{ "Start &time:","Startzeit:" },
1126{ "End ti&me:","Endzeit:" }, 1126{ "End ti&me:","Endzeit:" },
1127{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" }, 1127{ "E&xtend time range to include all events","Erweitere Zeitspanne um alle Termine einzuschliessen" },
1128{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" }, 1128{ "Include to&dos that are due on the printed day(s)","Inclusive To&dos, die an den selektierten Tagen fällig sind" },
1129{ "Alt+D","Alt+D" }, 1129{ "Alt+D","Alt+D" },
1130{ "&Use colors","Nutze Farben" }, 1130{ "&Use colors","Nutze Farben" },
1131{ "Alt+U","Alt+U" }, 1131{ "Alt+U","Alt+U" },
1132{ "Print week","Drucke Woche" }, 1132{ "Print week","Drucke Woche" },
1133{ "CalPrintWeek_Base","CalPrintWeek_Base" }, 1133{ "CalPrintWeek_Base","CalPrintWeek_Base" },
1134{ "Use &colors","Nutze Farben" }, 1134{ "Use &colors","Nutze Farben" },
1135{ "Type of View","Typ der Ansicht" }, 1135{ "Type of View","Typ der Ansicht" },
1136{ "Print as &Filofax page","Drucke als &Filofax Seite" }, 1136{ "Print as &Filofax page","Drucke als &Filofax Seite" },
1137{ "Alt+F","Alt+F" }, 1137{ "Alt+F","Alt+F" },
1138{ "Print as &timetable view:","Drucke als Zeittabelle:" }, 1138{ "Print as &timetable view:","Drucke als Zeittabelle:" },
1139{ "Alt+T","Alt+T" }, 1139{ "Alt+T","Alt+T" },
1140{ "Print as split week view","Drucke als gesplittete Wochenansicht" }, 1140{ "Print as split week view","Drucke als gesplittete Wochenansicht" },
1141{ "Print month","Drucke Monat" }, 1141{ "Print month","Drucke Monat" },
1142{ "CalPrintMonth_Base","CalPrintMonth_Base" }, 1142{ "CalPrintMonth_Base","CalPrintMonth_Base" },
1143{ "&Start month:","&Startmonat:" }, 1143{ "&Start month:","&Startmonat:" },
1144{ "&End month:","&Endmonat:" }, 1144{ "&End month:","&Endmonat:" },
1145{ "Print week &numbers","Drucke Wochen Nummer(n)" }, 1145{ "Print week &numbers","Drucke Wochen Nummer(n)" },
1146{ "Print todos","Drucke Todos" }, 1146{ "Print todos","Drucke Todos" },
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,284 +1,286 @@
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
125void KOTodoListView::contentsDragLeaveEvent(QDragLeaveEvent *) 127void 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
135void KOTodoListView::contentsDropEvent(QDropEvent *e) 137void 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}
207void KOTodoListView::wheelEvent (QWheelEvent *e) 209void KOTodoListView::wheelEvent (QWheelEvent *e)
208{ 210{
209 QListView::wheelEvent (e); 211 QListView::wheelEvent (e);
210} 212}
211 213
212void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) 214void 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!
221 int X = p.x(); 223 int X = p.x();
222 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); 224 //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() );
223 if (X > header()->sectionPos(0) + 225 if (X > header()->sectionPos(0) +
224 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + 226 treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) +
225 itemMargin() +i->height()|| 227 itemMargin() +i->height()||
226 X < header()->sectionPos(0)) { 228 X < header()->sectionPos(0)) {
227 rootClicked = false; 229 rootClicked = false;
228 } 230 }
229 } else { 231 } else {
230 rootClicked = false; 232 rootClicked = false;
231 } 233 }
232#ifndef KORG_NODND 234#ifndef KORG_NODND
233 mMousePressed = false; 235 mMousePressed = false;
234 if (! rootClicked && !( e->button() == RightButton) ) { 236 if (! rootClicked && !( e->button() == RightButton) ) {
235 mPressPos = e->pos(); 237 mPressPos = e->pos();
236 mMousePressed = true; 238 mMousePressed = true;
237 } else { 239 } else {
238 mMousePressed = false; 240 mMousePressed = false;
239 } 241 }
240#endif 242#endif
241 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); 243 //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked);
242#ifndef DESKTOP_VERSION 244#ifndef DESKTOP_VERSION
243 if (!( e->button() == RightButton && rootClicked) ) 245 if (!( e->button() == RightButton && rootClicked) )
244 QListView::contentsMousePressEvent(e); 246 QListView::contentsMousePressEvent(e);
245#else 247#else
246 QListView::contentsMousePressEvent(e); 248 QListView::contentsMousePressEvent(e);
247#endif 249#endif
248} 250}
249void KOTodoListView::paintEvent(QPaintEvent* e) 251void KOTodoListView::paintEvent(QPaintEvent* e)
250{ 252{
251 emit paintNeeded(); 253 emit paintNeeded();
252 QListView::paintEvent( e); 254 QListView::paintEvent( e);
253} 255}
254void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) 256void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
255{ 257{
256 258
257#ifndef KORG_NODND 259#ifndef KORG_NODND
258 //QListView::contentsMouseMoveEvent(e); 260 //QListView::contentsMouseMoveEvent(e);
259 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > 261 if (mMousePressed && (mPressPos - e->pos()).manhattanLength() >
260 QApplication::startDragDistance()*3) { 262 QApplication::startDragDistance()*3) {
261 mMousePressed = false; 263 mMousePressed = false;
262 QListViewItem *item = itemAt(contentsToViewport(mPressPos)); 264 QListViewItem *item = itemAt(contentsToViewport(mPressPos));
263 if (item) { 265 if (item) {
264 DndFactory factory( mCalendar ); 266 DndFactory factory( mCalendar );
265 ICalDrag *vd = factory.createDrag( 267 ICalDrag *vd = factory.createDrag(
266 ((KOTodoViewItem *)item)->todo(),viewport()); 268 ((KOTodoViewItem *)item)->todo(),viewport());
267 internalDrop = false; 269 internalDrop = false;
268 // we cannot do any senseful here, because the DnD is still broken in Qt 270 // we cannot do any senseful here, because the DnD is still broken in Qt
269 if (vd->drag()) { 271 if (vd->drag()) {
270 if ( !internalDrop ) { 272 if ( !internalDrop ) {
271 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); 273 //emit deleteTodo( ((KOTodoViewItem *)item)->todo() );
272 qDebug("Dnd: External move: Delete drag source "); 274 qDebug("Dnd: External move: Delete drag source ");
273 } else 275 } else
274 qDebug("Dnd: Internal move "); 276 qDebug("Dnd: Internal move ");
275 277
276 } else { 278 } else {
277 if ( !internalDrop ) { 279 if ( !internalDrop ) {
278 qDebug("Dnd: External Copy"); 280 qDebug("Dnd: External Copy");
279 } else 281 } else
280 qDebug("DnD: Internal copy: Copy pending"); 282 qDebug("DnD: Internal copy: Copy pending");
281 } 283 }
282 } 284 }
283 } 285 }
284#endif 286#endif
@@ -873,516 +875,526 @@ QPtrList<Incidence> KOTodoView::selectedIncidences()
873{ 875{
874 QPtrList<Incidence> selected; 876 QPtrList<Incidence> selected;
875 877
876 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 878 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
877// if (!item) item = mActiveItem; 879// if (!item) item = mActiveItem;
878 if (item) selected.append(item->todo()); 880 if (item) selected.append(item->todo());
879 881
880 return selected; 882 return selected;
881} 883}
882 884
883QPtrList<Todo> KOTodoView::selectedTodos() 885QPtrList<Todo> KOTodoView::selectedTodos()
884{ 886{
885 QPtrList<Todo> selected; 887 QPtrList<Todo> selected;
886 888
887 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 889 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
888// if (!item) item = mActiveItem; 890// if (!item) item = mActiveItem;
889 if (item) selected.append(item->todo()); 891 if (item) selected.append(item->todo());
890 892
891 return selected; 893 return selected;
892} 894}
893 895
894void KOTodoView::changeEventDisplay(Event *, int) 896void KOTodoView::changeEventDisplay(Event *, int)
895{ 897{
896 updateView(); 898 updateView();
897} 899}
898 900
899void KOTodoView::showDates(const QDate &, const QDate &) 901void KOTodoView::showDates(const QDate &, const QDate &)
900{ 902{
901} 903}
902 904
903void KOTodoView::showEvents(QPtrList<Event>) 905void KOTodoView::showEvents(QPtrList<Event>)
904{ 906{
905 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; 907 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
906} 908}
907 909
908void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, 910void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
909 const QDate &td) 911 const QDate &td)
910{ 912{
911#ifndef KORG_NOPRINTER 913#ifndef KORG_NOPRINTER
912 calPrinter->preview(CalPrinter::Todolist, fd, td); 914 calPrinter->preview(CalPrinter::Todolist, fd, td);
913#endif 915#endif
914} 916}
915 917
916void KOTodoView::editItem(QListViewItem *item ) 918void KOTodoView::editItem(QListViewItem *item )
917{ 919{
918 emit editTodoSignal(((KOTodoViewItem *)item)->todo()); 920 emit editTodoSignal(((KOTodoViewItem *)item)->todo());
919} 921}
920 922
921void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) 923void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
922{ 924{
923 emit showTodoSignal(((KOTodoViewItem *)item)->todo()); 925 emit showTodoSignal(((KOTodoViewItem *)item)->todo());
924} 926}
925 927
926void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) 928void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
927{ 929{
928 pendingSubtodo = 0; 930 pendingSubtodo = 0;
929 mActiveItem = (KOTodoViewItem *)item; 931 mActiveItem = (KOTodoViewItem *)item;
930 if (item) { 932 if (item) {
931 switch (column){ 933 switch (column){
932 case 1: 934 case 1:
933 mPriorityPopupMenu->popup(QCursor::pos ()); break; 935 mPriorityPopupMenu->popup(QCursor::pos ()); break;
934 case 2: 936 case 2:
935 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; 937 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
936 case 3: 938 case 3:
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}
946void KOTodoView::newTodo() 948void KOTodoView::newTodo()
947{ 949{
948 emit newTodoSignal(); 950 emit newTodoSignal();
949} 951}
950 952
951void KOTodoView::newSubTodo() 953void KOTodoView::newSubTodo()
952{ 954{
953 if (mActiveItem) { 955 if (mActiveItem) {
954 emit newSubTodoSignal(mActiveItem->todo()); 956 emit newSubTodoSignal(mActiveItem->todo());
955 } 957 }
956} 958}
957void KOTodoView::unparentTodo() 959void 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
964void KOTodoView::reparentTodo() 966void 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}
971void KOTodoView::editTodo() 973void KOTodoView::editTodo()
972{ 974{
973 if (mActiveItem) { 975 if (mActiveItem) {
974 emit editTodoSignal(mActiveItem->todo()); 976 emit editTodoSignal(mActiveItem->todo());
975 } 977 }
976} 978}
977void KOTodoView::cloneTodo() 979void 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}
983void KOTodoView::cancelTodo() 985void 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}
989void KOTodoView::moveTodo() 991void 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}
995void KOTodoView::beamTodo() 997void 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
1003void KOTodoView::showTodo() 1005void 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
1010void KOTodoView::deleteTodo() 1012void 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
1017void KOTodoView::setNewPriority(int index) 1019void 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
1027void KOTodoView::setNewPercentage(int index) 1029void 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
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{
1229 mTodoListView->selectAll( false ); 1241 mTodoListView->selectAll( false );
1230} 1242}
1231void KOTodoView::setAllOpen() 1243void 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}
1243void KOTodoView::setAllClose() 1255void 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}
1255void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) 1267void 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
1265void KOTodoView::displayAllFlat() 1277void 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
1285void KOTodoView::setAllFlat() 1297void 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
1298void KOTodoView::purgeCompleted() 1310void KOTodoView::purgeCompleted()
1299{ 1311{
1300 emit purgeCompletedSignal(); 1312 emit purgeCompletedSignal();
1301 1313
1302} 1314}
1303void KOTodoView::toggleQuickTodo() 1315void 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
1317void KOTodoView::toggleRunning() 1329void 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
1325void KOTodoView::toggleCompleted() 1337void KOTodoView::toggleCompleted()
1326{ 1338{
1327 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; 1339 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
1328 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 1340 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
1329 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 1341 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
1330 updateView(); 1342 updateView();
1331} 1343}
1332 1344
1333void KOTodoView::addQuickTodo() 1345void KOTodoView::addQuickTodo()
1334{ 1346{
1335 Todo *todo = new Todo(); 1347 Todo *todo = new Todo();
1336 todo->setSummary(mQuickAdd->text()); 1348 todo->setSummary(mQuickAdd->text());
1337 todo->setOrganizer(KOPrefs::instance()->email()); 1349 todo->setOrganizer(KOPrefs::instance()->email());
1338 CalFilter * cf = mCalendar->filter(); 1350 CalFilter * cf = mCalendar->filter();
1339 if ( cf ) { 1351 if ( cf ) {
1340 if ( cf->isEnabled()&& cf->showCategories()) { 1352 if ( cf->isEnabled()&& cf->showCategories()) {
1341 todo->setCategories(cf->categoryList()); 1353 todo->setCategories(cf->categoryList());
1342 } 1354 }
1343 if ( cf->isEnabled() ) 1355 if ( cf->isEnabled() )
1344 todo->setSecrecy( cf->getSecrecy()); 1356 todo->setSecrecy( cf->getSecrecy());
1345 } 1357 }
1346 mCalendar->addTodo(todo); 1358 mCalendar->addTodo(todo);
1347 mQuickAdd->setText(""); 1359 mQuickAdd->setText("");
1348 todoModified (todo, KOGlobals::EVENTADDED ); 1360 todoModified (todo, KOGlobals::EVENTADDED );
1349 updateView(); 1361 updateView();
1350} 1362}
1351 1363
1352void KOTodoView::keyPressEvent ( QKeyEvent * e ) 1364void KOTodoView::keyPressEvent ( QKeyEvent * e )
1353{ 1365{
1354 // e->ignore(); 1366 // e->ignore();
1355 //return; 1367 //return;
1356 //qDebug("KOTodoView::keyPressEvent "); 1368 //qDebug("KOTodoView::keyPressEvent ");
1357 switch ( e->key() ) { 1369 switch ( e->key() ) {
1358 case Qt::Key_Down: 1370 case Qt::Key_Down:
1359 case Qt::Key_Up: 1371 case Qt::Key_Up:
1360 QWidget::keyPressEvent ( e ); 1372 QWidget::keyPressEvent ( e );
1361 break; 1373 break;
1362 1374
1363 case Qt::Key_Q: 1375 case Qt::Key_Q:
1364 toggleQuickTodo(); 1376 toggleQuickTodo();
1365 break; 1377 break;
1366 case Qt::Key_U: 1378 case Qt::Key_U:
1367 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1379 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1368 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1380 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1369 unparentTodo(); 1381 unparentTodo();
1370 e->accept(); 1382 e->accept();
1371 } else 1383 } else
1372 e->ignore(); 1384 e->ignore();
1373 break; 1385 break;
1374 case Qt::Key_S: 1386 case Qt::Key_S:
1375 if ( e->state() == Qt::ControlButton ) { 1387 if ( e->state() == Qt::ControlButton ) {
1376 e->ignore(); 1388 e->ignore();
1377 break; 1389 break;
1378 } 1390 }
1379 if ( e->state() == Qt::ShiftButton ) { 1391 if ( e->state() == Qt::ShiftButton ) {
1380 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1392 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1381 reparentTodo(); 1393 reparentTodo();
1382 e->accept(); 1394 e->accept();
1383 } else 1395 } else
1384 e->ignore(); 1396 e->ignore();
1385 break; 1397 break;
1386 case Qt::Key_P: 1398 case Qt::Key_P:
1387 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1399 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1388 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1400 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 002d3f2..f7e38a7 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -1,361 +1,372 @@
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();
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}
222bool KCal::operator==( const Todo& t1, const Todo& t2 ) 233bool 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
259void Todo::setDtDue(const QDateTime &dtDue) 270void 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
280QDateTime Todo::dtDue() const 291QDateTime Todo::dtDue() const
281{ 292{
282 return mDtDue; 293 return mDtDue;
283} 294}
284 295
285QString Todo::dtDueTimeStr() const 296QString Todo::dtDueTimeStr() const
286{ 297{
287 return KGlobal::locale()->formatTime(mDtDue.time()); 298 return KGlobal::locale()->formatTime(mDtDue.time());
288} 299}
289 300
290QString Todo::dtDueDateStr(bool shortfmt) const 301QString 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
295QString Todo::dtDueStr(bool shortfmt) const 306QString Todo::dtDueStr(bool shortfmt) const
296{ 307{
297 if ( doesFloat() ) 308 if ( doesFloat() )
298 return KGlobal::locale()->formatDate(mDtDue.date(),shortfmt); 309 return KGlobal::locale()->formatDate(mDtDue.date(),shortfmt);
299 return KGlobal::locale()->formatDateTime(mDtDue, shortfmt); 310 return KGlobal::locale()->formatDateTime(mDtDue, shortfmt);
300} 311}
301// retval 0 : no found 312// retval 0 : no found
302// 1 : due for date found 313// 1 : due for date found
303// 2 : overdue for date found 314// 2 : overdue for date found
304int Todo::hasDueSubTodoForDate( const QDate & date, bool checkSubtodos ) 315int Todo::hasDueSubTodoForDate( const QDate & date, bool checkSubtodos )
305{ 316{
306 int retval = 0; 317 int retval = 0;
307 if ( isCompleted() ) 318 if ( isCompleted() )
308 return 0; 319 return 0;
309 if ( hasDueDate() ) { 320 if ( hasDueDate() ) {
310 if ( dtDue().date() < date ) 321 if ( dtDue().date() < date )
311 return 2; 322 return 2;
312 // we do not return, because we may find an overdue sub todo 323 // we do not return, because we may find an overdue sub todo
313 if ( dtDue().date() == date ) 324 if ( dtDue().date() == date )
314 retval = 1; 325 retval = 1;
315 } 326 }
316 if ( checkSubtodos ) { 327 if ( checkSubtodos ) {
317 Incidence *aTodo; 328 Incidence *aTodo;
318 for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) { 329 for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) {
319 int ret = ((Todo*)aTodo)->hasDueSubTodoForDate( date ,checkSubtodos ); 330 int ret = ((Todo*)aTodo)->hasDueSubTodoForDate( date ,checkSubtodos );
320 if ( ret == 2 ) 331 if ( ret == 2 )
321 return 2; 332 return 2;
322 if ( ret == 1) 333 if ( ret == 1)
323 retval = 1; 334 retval = 1;
324 } 335 }
325 } 336 }
326 return retval; 337 return retval;
327} 338}
328int Todo::hasDueSubTodo( bool checkSubtodos ) //= true 339int Todo::hasDueSubTodo( bool checkSubtodos ) //= true
329{ 340{
330 return hasDueSubTodoForDate(QDate::currentDate(), checkSubtodos ); 341 return hasDueSubTodoForDate(QDate::currentDate(), checkSubtodos );
331} 342}
332bool Todo::hasDueDate() const 343bool Todo::hasDueDate() const
333{ 344{
334 return mHasDueDate; 345 return mHasDueDate;
335} 346}
336 347
337void Todo::setHasDueDate(bool f) 348void Todo::setHasDueDate(bool f)
338{ 349{
339 if (mReadOnly) return; 350 if (mReadOnly) return;
340 mHasDueDate = f; 351 mHasDueDate = f;
341 updated(); 352 updated();
342} 353}
343 354
344 355
345#if 0 356#if 0
346void Todo::setStatus(const QString &statStr) 357void Todo::setStatus(const QString &statStr)
347{ 358{
348 if (mReadOnly) return; 359 if (mReadOnly) return;
349 QString ss(statStr.upper()); 360 QString ss(statStr.upper());
350 361
351 if (ss == "X-ACTION") 362 if (ss == "X-ACTION")
352 mStatus = NEEDS_ACTION; 363 mStatus = NEEDS_ACTION;
353 else if (ss == "NEEDS ACTION") 364 else if (ss == "NEEDS ACTION")
354 mStatus = NEEDS_ACTION; 365 mStatus = NEEDS_ACTION;
355 else if (ss == "ACCEPTED") 366 else if (ss == "ACCEPTED")
356 mStatus = ACCEPTED; 367 mStatus = ACCEPTED;
357 else if (ss == "SENT") 368 else if (ss == "SENT")
358 mStatus = SENT; 369 mStatus = SENT;
359 else if (ss == "TENTATIVE") 370 else if (ss == "TENTATIVE")
360 mStatus = TENTATIVE; 371 mStatus = TENTATIVE;
361 else if (ss == "CONFIRMED") 372 else if (ss == "CONFIRMED")
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
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
@@ -55,448 +55,448 @@ public:
55 friend class QInputDialog; 55 friend class QInputDialog;
56 QLineEdit *lineEdit; 56 QLineEdit *lineEdit;
57 QSpinBox *spinBox; 57 QSpinBox *spinBox;
58 QComboBox *comboBox, *editComboBox; 58 QComboBox *comboBox, *editComboBox;
59 QPushButton *ok; 59 QPushButton *ok;
60 QWidgetStack *stack; 60 QWidgetStack *stack;
61 QInputDialog::Type type; 61 QInputDialog::Type type;
62}; 62};
63 63
64/*! 64/*!
65 \class QInputDialog qinputdialog.h 65 \class QInputDialog qinputdialog.h
66 \brief A convenience dialog to get a simple input from the user 66 \brief A convenience dialog to get a simple input from the user
67 \ingroup dialogs 67 \ingroup dialogs
68 68
69 The QInputDialog is a simple dialog which can be used if you 69 The QInputDialog is a simple dialog which can be used if you
70 need a simple input from the user. This can be text, a number or 70 need a simple input from the user. This can be text, a number or
71 an item from a list. Also a label has to be set to tell the user 71 an item from a list. Also a label has to be set to tell the user
72 what he/she should input. 72 what he/she should input.
73 73
74 In this Qt version only the 4 static convenience functions 74 In this Qt version only the 4 static convenience functions
75 getText(), getInteger(), getDouble() and getItem() of QInputDialog 75 getText(), getInteger(), getDouble() and getItem() of QInputDialog
76 are available. 76 are available.
77 77
78 Use it like this: 78 Use it like this:
79 79
80 \code 80 \code
81 bool ok = FALSE; 81 bool ok = FALSE;
82 QString text = QInputDialog::getText( tr( "Make an input" ), tr( "Please enter your name" ), QString::null, &ok, this ); 82 QString text = QInputDialog::getText( tr( "Make an input" ), tr( "Please enter your name" ), QString::null, &ok, this );
83 if ( ok && !text.isEmpty() ) 83 if ( ok && !text.isEmpty() )
84 ;// user entered something and pressed ok 84 ;// user entered something and pressed ok
85 else 85 else
86 ;// user entered nothing or pressed cancel 86 ;// user entered nothing or pressed cancel
87 \endcode 87 \endcode
88 88
89 There are more static convenience methods! 89 There are more static convenience methods!
90 90
91 \sa getText(), getInteger(), getDouble(), getItem() 91 \sa getText(), getInteger(), getDouble(), getItem()
92*/ 92*/
93 93
94/*! 94/*!
95 \enum QInputDialog::Type 95 \enum QInputDialog::Type
96 96
97 This enum type specifies the type of the dialog 97 This enum type specifies the type of the dialog
98 (which kind of input can be done): 98 (which kind of input can be done):
99 99
100 <ul> 100 <ul>
101 <li>\c LineEdit - A QLineEdit is used for taking the input, so a textual or 101 <li>\c LineEdit - A QLineEdit is used for taking the input, so a textual or
102 (e.g. using a QValidator) a numerical input can be done. Using lineEdit() 102 (e.g. using a QValidator) a numerical input can be done. Using lineEdit()
103 the QLineEdit can be accessed. 103 the QLineEdit can be accessed.
104 <li>\c SpinBox - A QSpinBox is used for taking the input, so a decimal 104 <li>\c SpinBox - A QSpinBox is used for taking the input, so a decimal
105 input can be done. Using spinBox() the QSpinBox can be accessed. 105 input can be done. Using spinBox() the QSpinBox can be accessed.
106 <li>\c ComboBox - A read-only QComboBox is used for taking the input, 106 <li>\c ComboBox - A read-only QComboBox is used for taking the input,
107 so one item of a list can be chosen. Using comboBox() the QComboBox 107 so one item of a list can be chosen. Using comboBox() the QComboBox
108 can be accessed. 108 can be accessed.
109 <li>\c EditableComboBox - An editable QComboBox is used for taking the input, 109 <li>\c EditableComboBox - An editable QComboBox is used for taking the input,
110 so either one item of a list can be chosen or a text can be entered. Using 110 so either one item of a list can be chosen or a text can be entered. Using
111 editableComboBox() the QComboBox can be accessed. 111 editableComboBox() the QComboBox can be accessed.
112 </ul> 112 </ul>
113*/ 113*/
114 114
115/*! 115/*!
116 Constructs the dialog. \a label is the text which is shown to the user (it should mention 116 Constructs the dialog. \a label is the text which is shown to the user (it should mention
117 to the user what he/she should input), \a parent the parent widget of the dialog, \a name 117 to the user what he/she should input), \a parent the parent widget of the dialog, \a name
118 the name of it and if you set \a modal to TRUE, the dialog pops up modally, else it pops 118 the name of it and if you set \a modal to TRUE, the dialog pops up modally, else it pops
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
124QInputDialog::QInputDialog( const QString &label, QWidget* parent, const char* name, 124QInputDialog::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
187QLineEdit *QInputDialog::lineEdit() const 187QLineEdit *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
196QSpinBox *QInputDialog::spinBox() const 196QSpinBox *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
205QComboBox *QInputDialog::comboBox() const 205QComboBox *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
214QComboBox *QInputDialog::editableComboBox() const 214QComboBox *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
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
442QString QInputDialog::getItem( const QString &caption, const QString &label, const QStringList &list, 442QString 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
479void QInputDialog::textChanged( const QString &s ) 479void 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
497void QInputDialog::tryAccept() 497void QInputDialog::tryAccept()
498{ 498{
499 if ( !d->lineEdit->text().isEmpty() ) 499 if ( !d->lineEdit->text().isEmpty() )
500 accept(); 500 accept();
501} 501}
502 502