-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 9 | ||||
-rw-r--r-- | korganizer/kotodoeditor.cpp | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 108 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 3 |
4 files changed, 94 insertions, 27 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index a5e2597..cb92677 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1303,203 +1303,204 @@ | |||
1303 | { "Only one toolbar","Nur eine Toolbar" }, | 1303 | { "Only one toolbar","Nur eine Toolbar" }, |
1304 | { "Print","Drucke" }, | 1304 | { "Print","Drucke" }, |
1305 | { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, | 1305 | { "Print selected event / todo...","Drucke ausgewählten Termin / Todo..." }, |
1306 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, | 1306 | { "There is nothing selected!","Es ist nichts ausgewählt!" }, |
1307 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, | 1307 | { "\n\nDo you really want to print this item?","\n\nMöchten Sie wirklich diesen Eintrag ausdrucken? " }, |
1308 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, | 1308 | { "KO/Pi Print Confirmation","KO/Pi Druckbestätigung" }, |
1309 | { "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" }, | 1309 | { "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" }, |
1310 | { "KO/Pi Printout","KO/Pi Ausdruck" }, | 1310 | { "KO/Pi Printout","KO/Pi Ausdruck" }, |
1311 | { "Print unscaled","Drucke unskaliert" }, | 1311 | { "Print unscaled","Drucke unskaliert" }, |
1312 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, | 1312 | { "Print scaled down to fit one page","Drucke runterskaliert um auf eine Seite zu passen." }, |
1313 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, | 1313 | { "Print scaled up/down to fit one page","Drucke hoch/runterskaliert um genau auf eine Seite zu passen." }, |
1314 | { "Printout Mode","Druck Modus" }, | 1314 | { "Printout Mode","Druck Modus" }, |
1315 | { "Filter menu icon","Filtermenu Icon" }, | 1315 | { "Filter menu icon","Filtermenu Icon" }, |
1316 | { "<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" }, | 1316 | { "<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" }, |
1317 | { "<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" }, | 1317 | { "<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" }, |
1318 | { "%1d","%1t" }, | 1318 | { "%1d","%1t" }, |
1319 | { "%1h","%1std" }, | 1319 | { "%1h","%1std" }, |
1320 | { "%1min","%1min" }, | 1320 | { "%1min","%1min" }, |
1321 | { "( %1 before )","( %1 vorher )" }, | 1321 | { "( %1 before )","( %1 vorher )" }, |
1322 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, | 1322 | { "The next alarm is in\nless than one minute!","Der nächste Alarm kommt in\nweniger als einer Minute!" }, |
1323 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, | 1323 | { "\nThe internal alarm notification is disabled!\n","\nDie interne Alarmbenachrichtigung ist ausgeschaltet!\n" }, |
1324 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, | 1324 | { "Enable it in the settings menu, TAB alarm.","Schalten Sie sie an im Menu Einstellungen, TAB Alarm." }, |
1325 | { "Show Sync Events","Zeige Sync-Ereignisse" }, | 1325 | { "Show Sync Events","Zeige Sync-Ereignisse" }, |
1326 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, | 1326 | { "Use short date in WN+Event view","Zeige Kurzdatum in WN+Terminanzeige" }, |
1327 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, | 1327 | { "Number of max.displayed todo prios:","Anzahl max.angezeigter Todo-Prios:" }, |
1328 | { " on "," am " }, | 1328 | { " on "," am " }, |
1329 | { "On: ","Am: " }, | 1329 | { "On: ","Am: " }, |
1330 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, | 1330 | { "<i>The recurrence is computed from the start datetime!</i>","<i>Die Wiederholung wird vom Startwert aus berechnet!</i>" }, |
1331 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, | 1331 | { "Start/Stop todo...","Starte/Stoppe Todo..." }, |
1332 | { "Color for running todos:","Farbe für laufende Todos:" }, | 1332 | { "Color for running todos:","Farbe für laufende Todos:" }, |
1333 | { "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?" }, | 1333 | { "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?" }, |
1334 | { "Todo is started","Todo ist gestartet" }, | 1334 | { "Todo is started","Todo ist gestartet" }, |
1335 | { "Stop todo","Stoppe Todo" }, | 1335 | { "Stop todo","Stoppe Todo" }, |
1336 | { "Todo is stopped","Todo ist gestoppt" }, | 1336 | { "Todo is stopped","Todo ist gestoppt" }, |
1337 | { "Start todo","Starte Todo" }, | 1337 | { "Start todo","Starte Todo" }, |
1338 | { "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?" }, | 1338 | { "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?" }, |
1339 | { "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?" }, | 1339 | { "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?" }, |
1340 | { "Todo has subtodos","Todo hat Untertodos" }, | 1340 | { "Todo has subtodos","Todo hat Untertodos" }, |
1341 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, | 1341 | { "Block popup until mouse button release","Sperre Popup bis Mausknopf losgelassen" }, |
1342 | { "Colors","Farben" }, | 1342 | { "Colors","Farben" }, |
1343 | { "Click on new parent item","Klicke auf neues Übertodo" }, | 1343 | { "Click on new parent item","Klicke auf neues Übertodo" }, |
1344 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, | 1344 | { "Reparenting aborted!","Übertodo setzen abgebrochen" }, |
1345 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, | 1345 | { "Cannot move Todo to itself\nor a child of itself","Kann nicht Todo auf\nsich selbst oder\nein Untertodo verschieben" }, |
1346 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, | 1346 | { "Recursive reparenting not possible!","Rekursives Verschieben nicht möglich" }, |
1347 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, | 1347 | { "Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)","Entferne alle erledigten Todos?\n(Erledigte wiederholende Todos\nwerden nicht gelöscht!)" }, |
1348 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, | 1348 | { "Alternating background of list views","Abwechselnder Hintergrund für Listen" }, |
1349 | { "times","Zeiten" }, | 1349 | { "times","Zeiten" }, |
1350 | { "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?" }, | 1350 | { "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?" }, |
1351 | { "Backup enabled","Backup angeschaltet" }, | 1351 | { "Backup enabled","Backup angeschaltet" }, |
1352 | { "Use standard backup dir","Standard Backupverzeichnis" }, | 1352 | { "Use standard backup dir","Standard Backupverzeichnis" }, |
1353 | { "Number of Backups:","Anzahl der Backups" }, | 1353 | { "Number of Backups:","Anzahl der Backups" }, |
1354 | { "Make backup every ","Mache ein Backup alle " }, | 1354 | { "Make backup every ","Mache ein Backup alle " }, |
1355 | { " days"," Tage" }, | 1355 | { " days"," Tage" }, |
1356 | { "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, | 1356 | { "Creating backup ... please wait ...","Erstelle Backup ... bitte warten ..." }, |
1357 | { "Backup Failed!","Backup Problem!" }, | 1357 | { "Backup Failed!","Backup Problem!" }, |
1358 | { "Try again now","Versuche jetzt nochmal" }, | 1358 | { "Try again now","Versuche jetzt nochmal" }, |
1359 | { "Try again later","Versuche später nochmal" }, | 1359 | { "Try again later","Versuche später nochmal" }, |
1360 | { "Try again tomorrow","Versuche morgen nochmal" }, | 1360 | { "Try again tomorrow","Versuche morgen nochmal" }, |
1361 | { "Disable backup","Schalte Backup ab" }, | 1361 | { "Disable backup","Schalte Backup ab" }, |
1362 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 1362 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
1363 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 1363 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
1364 | { "Choose action","Wähle Aktion" }, | 1364 | { "Choose action","Wähle Aktion" }, |
1365 | { "Comment for todo:","Kommentar zum Todo:" }, | 1365 | { "Comment for todo:","Kommentar zum Todo:" }, |
1366 | { "Stop+note","Stop+Notiz" }, | 1366 | { "Stop+note","Stop+Notiz" }, |
1367 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, | 1367 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, |
1368 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, | 1368 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, |
1369 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, | 1369 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, |
1370 | { "Print complete list...","Drucke komplette Liste..." }, | 1370 | { "Print complete list...","Drucke komplette Liste..." }, |
1371 | { "Hide all selected","Verstecke Ausgewählte" }, | 1371 | { "Hide all selected","Verstecke Ausgewählte" }, |
1372 | { "Add items","hinzufügen" }, | 1372 | { "Add items","hinzufügen" }, |
1373 | { "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, | 1373 | { "One (or more) selected\ntodo has subtodos!\nDo you want to select\nall subtodos of all\nselected todos as well?","Ein (oder mehrere) ausgewähltes\nTodo hat Untertodos!\nMöchten Sie der Auswahlliste\nalle Untertodos von allen\nausgewählten Todos hinzufügen?" }, |
1374 | { "Print List View...","Drucke Listenansicht..." }, | 1374 | { "Print List View...","Drucke Listenansicht..." }, |
1375 | { "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, | 1375 | { "You can make a printout of the <b>List View</b> and the list view in the <b>Search Dialog</b>! To do this, please go to the <b>List View/Search Dialog</b>. Right click on the list. Select in the popup menu the entry <b>Print complete list</b>. That prints the list as you see it. You can remove items from the list before printing without deleting the corresponding event/todo! Simply select all items you do not want to print out. Then right click on one of the items and choose <b>Hide selected items</b>. After that you can print the list without these items.","Sie können die <b>Listenansicht</b> und die Listenansicht im <b>Suchdialog</b> ausdrucken! Um das zu machen gehen Sie bitte zur <b>Listenansicht</b> oder zum <b>Suchdialog</b>. Rechtsklicken Sie auf die Liste. Wählen Sie im Popupmenu den Eintrag <b>Drucke komplette Liste</b>. Das druckt die Liste so, wie man sie sieht. Sie können Listeneinträge entfernen ohne die korrespondierenden Ereignisse/Todos zu löschen! Selektieren sie einfach alle Einträge, die sie nicht ausdrucken möchten. Dann Rechtsklicken Sie auf einen Eintrag und wählen <b>Verstecke Selektierte</b>. Danach können Sie die Liste ohne diese Einträge ausdrucken." }, |
1376 | { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, | 1376 | { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, |
1377 | { "Global Settings...","Globale Einstellungen..." }, | 1377 | { "Global Settings...","Globale Einstellungen..." }, |
1378 | { "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, | 1378 | { "<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n","<p><b>R</b>: Zeige Resource Ansicht | <b>F</b>: Editiere Filter </p>\n" }, |
1379 | { "(disabled)","(abgeschaltet)" }, | 1379 | { "(disabled)","(abgeschaltet)" }, |
1380 | { "New Calendar","Neuer Kalender" }, | 1380 | { "New Calendar","Neuer Kalender" }, |
1381 | { "Calendar","Kalender" }, | 1381 | { "Calendar","Kalender" }, |
1382 | { "Filter selector","Filterauswahl" }, | 1382 | { "Filter selector","Filterauswahl" }, |
1383 | { "Filtermenu","Filtermenu" }, | 1383 | { "Filtermenu","Filtermenu" }, |
1384 | { "Toggle Fullscreen","Vollbild umschalten" }, | 1384 | { "Toggle Fullscreen","Vollbild umschalten" }, |
1385 | { "Toggle Resource View","Resourcenansicht umschalten" }, | 1385 | { "Toggle Resource View","Resourcenansicht umschalten" }, |
1386 | { "Storage HowTo...","Speicherort HowTo..." }, | 1386 | { "Storage HowTo...","Speicherort HowTo..." }, |
1387 | { "Timetracking HowTo...","Timetracking HowTo..." }, | 1387 | { "Timetracking HowTo...","Timetracking HowTo..." }, |
1388 | { "Juni","Juni" }, | 1388 | { "Juni","Juni" }, |
1389 | { "Juli","Juli" }, | 1389 | { "Juli","Juli" }, |
1390 | { "ToDo:","ToDo:" }, | 1390 | { "ToDo:","ToDo:" }, |
1391 | { "Set Calendar","Setze Kalender" }, | 1391 | { "Set Calendar","Setze Kalender" }, |
1392 | { "Todo: %1","Todo: %1" }, | 1392 | { "Todo: %1","Todo: %1" }, |
1393 | { ": (Prio ",": (Prio " }, | 1393 | { ": (Prio ",": (Prio " }, |
1394 | { "Todos","Todos" }, | 1394 | { "Todos","Todos" }, |
1395 | { "Todo Viewer","Todo Anzeige" }, | 1395 | { "Todo Viewer","Todo Anzeige" }, |
1396 | { "Todo ","Todo " }, | 1396 | { "Todo ","Todo " }, |
1397 | { " Calendar \n Resource "," Kalender \n Resource " }, | 1397 | { " Calendar \n Resource "," Kalender \n Resource " }, |
1398 | { " Color "," Farbe " }, | 1398 | { " Color "," Farbe " }, |
1399 | { "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, | 1399 | { "The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>. Möchten Sie diesen Kalender aus KO/Pi entfernen? (Die Datei wird dabei nicht gelöscht!)" }, |
1400 | { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, | 1400 | { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, |
1401 | { "Add new Calendar","Füge Kalender hinzu" }, | 1401 | { "Add new Calendar","Füge Kalender hinzu" }, |
1402 | { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, | 1402 | { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, |
1403 | { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, | 1403 | { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, |
1404 | { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, | 1404 | { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, |
1405 | { "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, | 1405 | { "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, |
1406 | { "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, | 1406 | { "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, |
1407 | { "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" }, | 1407 | { "The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>","Der Kalender <b>%1</b> ist nicht geladen! Das Laden der Datei <b>%2</b> schlug fehl! <b>Soll erneut versucht werden den Kalender zu laden?</b>" }, |
1408 | { "Global application font for all apps:","Globale Schriftart:" }, | 1408 | { "Global application font for all apps:","Globale Schriftart:" }, |
1409 | { "Application Font","Applikationsschriftart" }, | 1409 | { "Application Font","Applikationsschriftart" }, |
1410 | { "Kx/Pi","Kx/Pi" }, | 1410 | { "Kx/Pi","Kx/Pi" }, |
1411 | { "Backup","Backup" }, | 1411 | { "Backup","Backup" }, |
1412 | { "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, | 1412 | { "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, |
1413 | { "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" }, | 1413 | { "Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!","Sorry, der Kalendername \n%1\nist schon in Benutzung!\nBitte wählen Sie einen anderen!" }, |
1414 | { "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" }, | 1414 | { "Sorry, the file \n%1\nis already loaded!\nPlease choose another file!","Sorry, die Datei \n%1\nist schon geladen!\nBitte wählen Sie eine andere!" }, |
1415 | { "Choose Color","Wähle Farbe" }, | 1415 | { "Choose Color","Wähle Farbe" }, |
1416 | { " OK "," OK " }, | 1416 | { " OK "," OK " }, |
1417 | { " Cancel "," Abbrechen " }, | 1417 | { " Cancel "," Abbrechen " }, |
1418 | { "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, | 1418 | { "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, |
1419 | { "Matching items will be removed from list","Passende werden von der Liste entfernt" }, | 1419 | { "Matching items will be removed from list","Passende werden von der Liste entfernt" }, |
1420 | { "Search on displayed list only","Suche auf der dargestellten Liste" }, | 1420 | { "Search on displayed list only","Suche auf der dargestellten Liste" }, |
1421 | { "List will be cleared before search","Liste wird vor der Suche gelöscht" }, | 1421 | { "List will be cleared before search","Liste wird vor der Suche gelöscht" }, |
1422 | { "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" }, | 1422 | { "<center>%1</center> <center>is not running. Do you want to set\nthe state to running?</center>","<center>%1</center> <center>ist nicht am Laufen. Möchten Sie den Zustand auf "laufend" setzen?</center>" }, |
1423 | { "%1\nis running!","%1\nist am Laufen!" }, | 1423 | { "%1\nis running!","%1\nist am Laufen!" }, |
1424 | { "Additional Comment:","Zusätzlicher Kommentar:" }, | 1424 | { "Additional Comment:","Zusätzlicher Kommentar:" }, |
1425 | { "Stop and save","Stopp und Speichern" }, | 1425 | { "Stop and save","Stopp und Speichern" }, |
1426 | { "Continue running","Weiter laufen lassen" }, | 1426 | { "Continue running","Weiter laufen lassen" }, |
1427 | { "Stop - do not save","Stopp - nicht Speichern" }, | 1427 | { "Stop - do not save","Stopp - nicht Speichern" }, |
1428 | { "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" }, | 1428 | { "Do you really want to set\nthe state to stopped\nwithout saving the data?","Möchten sie den Zustand\nwirklich auf gestoppt setzen\nohne die Daten abzuspeichern?" }, |
1429 | { "Time mismatch!","Zeiten stimmen nicht!" }, | 1429 | { "Time mismatch!","Zeiten stimmen nicht!" }, |
1430 | { "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, | 1430 | { "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, |
1431 | { "Yes, stop todo","Ja, stoppe Todo" }, | 1431 | { "Yes, stop todo","Ja, stoppe Todo" }, |
1432 | { "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, | 1432 | { "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, |
1433 | { "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, | 1433 | { "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, |
1434 | { "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." }, | 1434 | { "Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.","Bitte wählen Sie den <b>Default-Kalender</b> in dieser Spalte. Neu angelegte oder importierte Einträge werden dem Default-Kalender hinzugefügt." }, |
1435 | { "Spouse","Ehegatte" }, | 1435 | { "Spouse","Ehegatte" }, |
1436 | { "Notes","Notizen" }, | 1436 | { "Notes","Notizen" }, |
1437 | { "Messanger","Messanger" }, | 1437 | { "Messanger","Messanger" }, |
1438 | { "Assistant","Assistent" }, | 1438 | { "Assistant","Assistent" }, |
1439 | { "Manager","Manager" }, | 1439 | { "Manager","Manager" }, |
1440 | { "Secrecy","Sichtbar" }, | 1440 | { "Secrecy","Sichtbar" }, |
1441 | { "male","männlich" }, | 1441 | { "male","männlich" }, |
1442 | { "female","weiblich" }, | 1442 | { "female","weiblich" }, |
1443 | { "Hide!","Verbergen!" }, | 1443 | { "Hide!","Verbergen!" }, |
1444 | { "Show!","Anzeigen!" }, | 1444 | { "Show!","Anzeigen!" }, |
1445 | { "Details","Details" }, | 1445 | { "Details","Details" }, |
1446 | { "Profession","Beruf" }, | 1446 | { "Profession","Beruf" }, |
1447 | { "Children","Kinder" }, | 1447 | { "Children","Kinder" }, |
1448 | { "Department","Abteilung" }, | 1448 | { "Department","Abteilung" }, |
1449 | { "Backup cancelled","Backup abgebrochen" }, | 1449 | { "Backup cancelled","Backup abgebrochen" }, |
1450 | { "Backup globally disabled","Backup global abgeschaltet" }, | 1450 | { "Backup globally disabled","Backup global abgeschaltet" }, |
1451 | { "Backup succesfully finished","Backup erfolgreich beendet" }, | 1451 | { "Backup succesfully finished","Backup erfolgreich beendet" }, |
1452 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, | 1452 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, |
1453 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, | 1453 | { "This will <b>backup all calendar files</b> to the directory %1 %2","Das schreibt ein <b>Backup aller Kalenderdateien</b> in das Verzeichnis %1 %2" }, |
1454 | { "Birthdays","Geburtstage" }, | 1454 | { "Birthdays","Geburtstage" }, |
1455 | { "KO/Pi import information!","KO/Pi Import Information!" }, | 1455 | { "KO/Pi import information!","KO/Pi Import Information!" }, |
1456 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, | 1456 | { "Start this todo\nand stop all running","Starte dieses Todo\nund stoppe alle Laufenden" }, |
1457 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, | 1457 | { "Cancel - do not start"," Abbrechen - Todo nicht starten" }, |
1458 | { "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, | 1458 | { "The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n"How do I change the timezone?"\nas well!","Die Zeitzone wurde geändert!\nSollen die Kalender neu geladen\nwerden num die Zeiten\nder Termine zu ändern?\nBitte lesen Sie auch\nMenu: Help->FAQ:\n"How do I change the timezone?"" }, |
1459 | { "Reload","Neu laden" }, | 1459 | { "Reload","Neu laden" }, |
1460 | { "Timezone settings","Zeitzoneneinstellung" }, | 1460 | { "Timezone settings","Zeitzoneneinstellung" }, |
1461 | { "Title: ","Titel: " }, | 1461 | { "Title: ","Titel: " }, |
1462 | { "Journal from: ","Journal vom: " }, | 1462 | { "Journal from: ","Journal vom: " }, |
1463 | { "Journal: %1 from ","Journal: %1 vom " }, | 1463 | { "Journal: %1 from ","Journal: %1 vom " }, |
1464 | { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, | 1464 | { "<b>Click here to edit categories: </b>","<b>Klicke hier um Kategorien zu ändern: </b>" }, |
1465 | { "Selected Item","Ausgewähltes Item" }, | 1465 | { "Selected Item","Ausgewähltes Item" }, |
1466 | { "Select Date...","Wähle Datum..." }, | 1466 | { "Select Date...","Wähle Datum..." }, |
1467 | { "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, | 1467 | { "After importing/loading/syncing there may be new categories in events or todos which are not added automatically to the category list. Please choose what to do <b>now</b>:","Nach dem Importieren/Laden/Syncen kann es neue Kategorien in den Terminen oder Todos geben, die nicht automatisch der Kategorieliste hinzugefügt werden. Bitte wählen Sie, was <b>jetzt</b> passieren soll:" }, |
1468 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, | 1468 | { "Change category list now!","Ändere Kategorieliste jetzt!" }, |
1469 | { "Edit category list...","Ändere Kategorieliste..." }, | 1469 | { "Edit category list...","Ändere Kategorieliste..." }, |
1470 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, | 1470 | { "Toolbar changes needs a restart!","Neustart benötigt für Toolbaränderungen!" }, |
1471 | { "Filepath: ","Dateipfad: " }, | 1471 | { "Filepath: ","Dateipfad: " }, |
1472 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, | 1472 | { "You can try to reload the calendar in the Resource View!","In der Resourcenansicht können Sie erneut versuchen den Kalender zu laden!" }, |
1473 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, | 1473 | { "<b>WARNING:</b> There is a pending suspended alarm!","<b>WARNUNG:</b> Es gibt einen laufenden Suspendalarm!" }, |
1474 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, | 1474 | { "Pending Suspend Alarm","Laufender Suspend Alarm" }, |
1475 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, | 1475 | { "Error loading calendar %1","Fehler beim Laden von Kalender %1" }, |
1476 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, | 1476 | { "Calendar(s) not loaded:","Nicht geladene(r) Kalender:" }, |
1477 | { "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, | 1477 | { "Loding of calendar(s) failed","Laden von Kalendern fehlgeschlagen" }, |
1478 | { "Alarm Options","Alarm Einstellungen" }, | 1478 | { "Alarm Options","Alarm Einstellungen" }, |
1479 | { "Delete selected...","Lösche Ausgewählte..." }, | 1479 | { "Delete selected...","Lösche Ausgewählte..." }, |
1480 | { "None","Nichts" }, | 1480 | { "None","Nichts" }, |
1481 | { "Selection","Auswahl" }, | 1481 | { "Selection","Auswahl" }, |
1482 | { "Set categories","Setze Kategorien" }, | 1482 | { "Set categories","Setze Kategorien" }, |
1483 | { "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, | 1483 | { "This adds the selected\nitems to the calendar\n%1\nand removes them from\ntheir current calendar!","Das fügt die ausgewählten\nEinträge dem Kalender\n%1\nhinzu und entfernt sie von\nihrem aktuellen Kalender!" }, |
1484 | { "Reset","Neu setzen" }, | 1484 | { "Reset","Neu setzen" }, |
1485 | { "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, | 1485 | { "Do you want to <b>add</b> categories to the selected items or <b>reset</b> the list (i.e. remove current categories)?","Möchten Sie Kategorien zu den ausgewählten Einträgen <b>hinzufügen</b> oder die Liste <b>neu setzen</b> (d.h. vorhandene Kategorien löschen)?" }, |
1486 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, | 1486 | { "The file\n%1\ndoes not exist!\nShall I create it for you?","Die Datei\n%1\nexistiert nicht!\nSoll sie neu angelegt werden?" }, |
1487 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, | 1487 | { "Sorry, cannot create the file\n%1!\nNo calendar added!","Kann leider die Datei\n%1\nnicht anlegen!\nKein Kalender hinzugefügt!" }, |
1488 | { "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, | 1488 | { "\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n","\nKEIN\n SCHREIBBARER\n KALENDER\n GEFUNDEN!\n\nBitte korrigieren Sie\nihre Kalendereinstellungen!\n" }, |
1489 | { "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, | 1489 | { "\nThe file\n%1\non disk has changed!\nFile size: %2 bytes.\nLast modified: %3\nDo you want to:\n\n - Save and overwrite file?\n - Sync with file, then save?\n - Cancel without saving? \n","\nDie Datei\n%1\nwurde verändert!\nDatei Grösse: %2 Bytes.\nZuletzt geändert: %3\nMöchten Sie:\n\n - Speichern und die Datei überschreiben?\n - Mit Datei Synchronisieren, dann speichern?\n - Abbrechen ohne zu speichern? \n" }, |
1490 | { "Edit","Edit" }, | 1490 | { "Edit","Edit" }, |
1491 | { "Last Modified","Zuletzt geändert" }, | 1491 | { "Last Modified","Zuletzt geändert" }, |
1492 | { "Journal viewer","Journal Anzeige" }, | 1492 | { "Journal viewer","Journal Anzeige" }, |
1493 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, | 1493 | { "Configure Calendar Files...","Konfiguriere Kalenderdateien..." }, |
1494 | { "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, | 1494 | { "You can use and display <b>more than one</b> calendar file in KO/Pi. A calendar file is called a <b>resource</b>. To add a calendar or change calendar settings please use menu: <b>View -> Toggle Resource View</b>.","Sie können <b>mehr als eine</b> Kalenderdatei in KO/Pi darstellen und benutzen. Eine Kalenderdatei wird <b>Resource</b> genannt. Um einen Kalender hinzuzufügen oder die Kalendereinstellungen zu ändern benutzen Sie bitte das Menu: <b>Ansicht -> Resourcenansicht umschalten</b>." }, |
1495 | { "Hide Completed","Verstecke erledigte Todos" }, | ||
1496 | { "Show not Running","Zeige nicht Laufende" }, | ||
1495 | { "","" }, | 1497 | { "","" }, |
1496 | { "","" }, | 1498 | { "","" }, |
1497 | { "","" }, | 1499 | { "","" }, |
1498 | { "","" }, | 1500 | { "","" }, |
1499 | { "","" }, | 1501 | { "","" }, |
1500 | { "","" }, | 1502 | { "","" }, |
1501 | { "","" }, | 1503 | { "","" }, |
1502 | { "","" }, | 1504 | |
1503 | { "","" }, | 1505 | |
1504 | { "","" }, | 1506 | |
1505 | { "","" }, | ||
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index 555c1b1..100a81b 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp | |||
@@ -109,344 +109,345 @@ void KOTodoEditor::setupGeneral() | |||
109 | //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), | 109 | //connect(mCategoryDialog, SIGNAL(categoriesSelected(const QString &)), |
110 | // mGeneral,SLOT(setCategories(const QString &))); | 110 | // mGeneral,SLOT(setCategories(const QString &))); |
111 | 111 | ||
112 | if (KOPrefs::instance()->mCompactDialogs) { | 112 | if (KOPrefs::instance()->mCompactDialogs) { |
113 | QFrame *topFrame = addPage(i18n("General")); | 113 | QFrame *topFrame = addPage(i18n("General")); |
114 | 114 | ||
115 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 115 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); |
116 | if ( QApplication::desktop()->width() < 480 ) { | 116 | if ( QApplication::desktop()->width() < 480 ) { |
117 | topLayout->setMargin(marginHintSmall()); | 117 | topLayout->setMargin(marginHintSmall()); |
118 | topLayout->setSpacing(spacingHintSmall()); | 118 | topLayout->setSpacing(spacingHintSmall()); |
119 | } else { | 119 | } else { |
120 | topLayout->setMargin(marginHint()); | 120 | topLayout->setMargin(marginHint()); |
121 | topLayout->setSpacing(spacingHint()); | 121 | topLayout->setSpacing(spacingHint()); |
122 | } | 122 | } |
123 | topLayout->addStretch( 1 ); | 123 | topLayout->addStretch( 1 ); |
124 | mGeneral->initHeader(topFrame,topLayout); | 124 | mGeneral->initHeader(topFrame,topLayout); |
125 | topLayout->addStretch( 1 ); | 125 | topLayout->addStretch( 1 ); |
126 | mGeneral->initTime(topFrame,topLayout); | 126 | mGeneral->initTime(topFrame,topLayout); |
127 | topLayout->addStretch( 1 ); | 127 | topLayout->addStretch( 1 ); |
128 | mGeneral->initAlarm(topFrame,topLayout); | 128 | mGeneral->initAlarm(topFrame,topLayout); |
129 | topLayout->addStretch( 1 ); | 129 | topLayout->addStretch( 1 ); |
130 | mGeneral->enableAlarm( false ); | 130 | mGeneral->enableAlarm( false ); |
131 | 131 | ||
132 | 132 | ||
133 | QBoxLayout *priorityLayout; | 133 | QBoxLayout *priorityLayout; |
134 | if ( QApplication::desktop()->width() < 500 ) | 134 | if ( QApplication::desktop()->width() < 500 ) |
135 | priorityLayout = new QVBoxLayout( topLayout ); | 135 | priorityLayout = new QVBoxLayout( topLayout ); |
136 | else | 136 | else |
137 | priorityLayout = new QHBoxLayout( topLayout ); | 137 | priorityLayout = new QHBoxLayout( topLayout ); |
138 | QWidget* prioWidget = new QWidget (topFrame); | 138 | QWidget* prioWidget = new QWidget (topFrame); |
139 | priorityLayout->addWidget( prioWidget ); | 139 | priorityLayout->addWidget( prioWidget ); |
140 | QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); | 140 | QHBoxLayout* priorityLayout2 = new QHBoxLayout( prioWidget); |
141 | 141 | ||
142 | 142 | ||
143 | QIconSet icon; | 143 | QIconSet icon; |
144 | if ( QApplication::desktop()->width() < 321 ) | 144 | if ( QApplication::desktop()->width() < 321 ) |
145 | icon = SmallIcon("fileimport16"); | 145 | icon = SmallIcon("fileimport16"); |
146 | else | 146 | else |
147 | icon = SmallIcon("fileimport"); | 147 | icon = SmallIcon("fileimport"); |
148 | QPushButton * loadTemplate = new QPushButton( prioWidget); | 148 | QPushButton * loadTemplate = new QPushButton( prioWidget); |
149 | loadTemplate->setIconSet (icon ) ; | 149 | loadTemplate->setIconSet (icon ) ; |
150 | int size = loadTemplate->sizeHint().height(); | 150 | int size = loadTemplate->sizeHint().height(); |
151 | loadTemplate->setFixedSize( size, size ); | 151 | loadTemplate->setFixedSize( size, size ); |
152 | if ( QApplication::desktop()->width() < 321 ) | 152 | if ( QApplication::desktop()->width() < 321 ) |
153 | icon = SmallIcon("fileexport16"); | 153 | icon = SmallIcon("fileexport16"); |
154 | else | 154 | else |
155 | icon = SmallIcon("fileexport"); | 155 | icon = SmallIcon("fileexport"); |
156 | QPushButton * saveTemplate = new QPushButton( prioWidget); | 156 | QPushButton * saveTemplate = new QPushButton( prioWidget); |
157 | saveTemplate->setIconSet (icon ) ; | 157 | saveTemplate->setIconSet (icon ) ; |
158 | saveTemplate->setFixedSize( size, size ); | 158 | saveTemplate->setFixedSize( size, size ); |
159 | 159 | ||
160 | priorityLayout2->addWidget(loadTemplate); | 160 | priorityLayout2->addWidget(loadTemplate); |
161 | priorityLayout2->addWidget(saveTemplate); | 161 | priorityLayout2->addWidget(saveTemplate); |
162 | mGeneral->initPriority(prioWidget,priorityLayout2); | 162 | mGeneral->initPriority(prioWidget,priorityLayout2); |
163 | mGeneral->initCategories( topFrame, priorityLayout ); | 163 | mGeneral->initCategories( topFrame, priorityLayout ); |
164 | topLayout->addStretch(1); | 164 | topLayout->addStretch(1); |
165 | 165 | ||
166 | QFrame *topFrame2 = addPage(i18n("Details")); | 166 | QFrame *topFrame2 = addPage(i18n("Details")); |
167 | 167 | ||
168 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); | 168 | QBoxLayout *topLayout2 = new QVBoxLayout(topFrame2); |
169 | topLayout2->setMargin(marginHint()); | 169 | topLayout2->setMargin(marginHint()); |
170 | topLayout2->setSpacing(spacingHint()); | 170 | topLayout2->setSpacing(spacingHint()); |
171 | 171 | ||
172 | QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); | 172 | QHBoxLayout *completionLayout = new QHBoxLayout( topLayout2 ); |
173 | mGeneral->initCompletion(topFrame2,completionLayout); | 173 | mGeneral->initCompletion(topFrame2,completionLayout); |
174 | 174 | ||
175 | 175 | ||
176 | mGeneral->initSecrecy( topFrame2, topLayout2 ); | 176 | mGeneral->initSecrecy( topFrame2, topLayout2 ); |
177 | mGeneral->initDescription(topFrame2,topLayout2); | 177 | mGeneral->initDescription(topFrame2,topLayout2); |
178 | 178 | ||
179 | // QHBox * hb = new QHBox ( topFrame2 ); | 179 | // QHBox * hb = new QHBox ( topFrame2 ); |
180 | // topLayout2->addWidget(hb); | 180 | // topLayout2->addWidget(hb); |
181 | // hb->setSpacing( 3 ); | 181 | // hb->setSpacing( 3 ); |
182 | 182 | ||
183 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); | 183 | connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) ); |
184 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); | 184 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( slotLoadTemplate() ) ); |
185 | 185 | ||
186 | } else { | 186 | } else { |
187 | QFrame *topFrame = addPage(i18n("General")); | 187 | QFrame *topFrame = addPage(i18n("General")); |
188 | 188 | ||
189 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); | 189 | QBoxLayout *topLayout = new QVBoxLayout(topFrame); |
190 | topLayout->setSpacing(spacingHint()); | 190 | topLayout->setSpacing(spacingHint()); |
191 | 191 | ||
192 | mGeneral->initHeader(topFrame,topLayout); | 192 | mGeneral->initHeader(topFrame,topLayout); |
193 | mGeneral->initTime(topFrame,topLayout); | 193 | mGeneral->initTime(topFrame,topLayout); |
194 | mGeneral->initStatus(topFrame,topLayout); | 194 | mGeneral->initStatus(topFrame,topLayout); |
195 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); | 195 | QBoxLayout *alarmLineLayout = new QHBoxLayout(topLayout); |
196 | mGeneral->initAlarm(topFrame,alarmLineLayout); | 196 | mGeneral->initAlarm(topFrame,alarmLineLayout); |
197 | mGeneral->initDescription(topFrame,topLayout); | 197 | mGeneral->initDescription(topFrame,topLayout); |
198 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); | 198 | QBoxLayout *detailsLayout = new QHBoxLayout(topLayout); |
199 | mGeneral->initCategories( topFrame, detailsLayout ); | 199 | mGeneral->initCategories( topFrame, detailsLayout ); |
200 | mGeneral->initSecrecy( topFrame, detailsLayout ); | 200 | mGeneral->initSecrecy( topFrame, detailsLayout ); |
201 | } | 201 | } |
202 | mGeneral->finishSetup(); | 202 | mGeneral->finishSetup(); |
203 | 203 | ||
204 | } | 204 | } |
205 | 205 | ||
206 | void KOTodoEditor::editTodo(Todo *todo, bool editDescription) | 206 | void KOTodoEditor::editTodo(Todo *todo, bool editDescription) |
207 | { | 207 | { |
208 | //init(); | 208 | //init(); |
209 | 209 | ||
210 | mTodo = todo; | 210 | mTodo = todo; |
211 | readTodo(mTodo); | 211 | readTodo(mTodo); |
212 | if ( editDescription ) { | 212 | if ( editDescription ) { |
213 | showPage( 1 ); | 213 | showPage( 1 ); |
214 | mGeneral->setFocusOn( 1 ); | 214 | mGeneral->setFocusOn( 1 ); |
215 | } else { | 215 | } else { |
216 | showPage( 0 ); | 216 | showPage( 0 ); |
217 | mGeneral->setFocusOn( 2 ); | 217 | mGeneral->setFocusOn( 2 ); |
218 | } | 218 | } |
219 | checkRecurrence(); | 219 | checkRecurrence(); |
220 | } | 220 | } |
221 | 221 | ||
222 | void KOTodoEditor::newTodo(QDateTime due,Todo *relatedTodo,bool allDay) | 222 | void KOTodoEditor::newTodo(QDateTime due,Todo *relatedTodo,bool allDay) |
223 | { | 223 | { |
224 | //init(); | 224 | //init(); |
225 | 225 | ||
226 | mTodo = 0; | 226 | mTodo = 0; |
227 | setDefaults(due,relatedTodo,allDay); | 227 | setDefaults(due,relatedTodo,allDay); |
228 | } | 228 | } |
229 | 229 | ||
230 | void KOTodoEditor::loadDefaults() | 230 | void KOTodoEditor::loadDefaults() |
231 | { | 231 | { |
232 | setDefaults(QDateTime::currentDateTime().addDays(7),0,false); | 232 | setDefaults(QDateTime::currentDateTime().addDays(7),0,false); |
233 | } | 233 | } |
234 | 234 | ||
235 | bool KOTodoEditor::processInput( bool emitTime ) | 235 | bool KOTodoEditor::processInput( bool emitTime ) |
236 | { | 236 | { |
237 | if (!validateInput()) return false; | 237 | if (!validateInput()) return false; |
238 | 238 | ||
239 | Todo *todo = 0; | 239 | Todo *todo = 0; |
240 | 240 | ||
241 | if (mTodo) todo = mTodo; | 241 | if (mTodo) todo = mTodo; |
242 | else { | 242 | else { |
243 | todo = new Todo; | 243 | todo = new Todo; |
244 | todo->setOrganizer(KOPrefs::instance()->email()); | 244 | todo->setOrganizer(KOPrefs::instance()->email()); |
245 | } | 245 | } |
246 | 246 | ||
247 | writeTodo(todo); | 247 | writeTodo(todo); |
248 | if ( emitTime ) { | 248 | if ( emitTime ) { |
249 | globalFlagBlockAgenda = 1; | 249 | globalFlagBlockAgenda = 1; |
250 | emit showAgendaView( false ); | 250 | emit showAgendaView( false ); |
251 | if ( todo->hasDueDate() ) | 251 | if ( todo->hasDueDate() ) |
252 | emit jumpToTime( todo->dtDue().date() ); | 252 | emit jumpToTime( todo->dtDue().date() ); |
253 | globalFlagBlockAgenda = 2; | 253 | globalFlagBlockAgenda = 2; |
254 | } | 254 | } |
255 | if (mTodo) { | 255 | if (mTodo) { |
256 | todo->setRevision(todo->revision()+1); | 256 | todo->setRevision(todo->revision()+1); |
257 | emit todoChanged(todo); | 257 | emit todoChanged(todo); |
258 | } else { | 258 | } else { |
259 | mCalendar->addTodo(todo); | 259 | mCalendar->addTodo(todo); |
260 | mTodo = todo; | 260 | mTodo = todo; |
261 | emit todoAdded(todo); | 261 | emit todoAdded(todo); |
262 | } | 262 | } |
263 | 263 | ||
264 | return true; | 264 | return true; |
265 | } | 265 | } |
266 | 266 | ||
267 | void KOTodoEditor::deleteTodo() | 267 | void KOTodoEditor::deleteTodo() |
268 | { | 268 | { |
269 | if (mTodo) { | 269 | if (mTodo) { |
270 | if (KOPrefs::instance()->mConfirm) { | 270 | if (KOPrefs::instance()->mConfirm) { |
271 | switch (msgItemDelete()) { | 271 | switch (msgItemDelete()) { |
272 | case KMessageBox::Continue: // OK | 272 | case KMessageBox::Continue: // OK |
273 | emit todoToBeDeleted(mTodo); | 273 | emit todoToBeDeleted(mTodo); |
274 | emit dialogClose(mTodo); | 274 | emit dialogClose(mTodo); |
275 | mCalendar->deleteTodo(mTodo); | 275 | mCalendar->deleteTodo(mTodo); |
276 | emit todoDeleted(); | 276 | emit todoDeleted(); |
277 | reject(); | 277 | reject(); |
278 | break; | 278 | break; |
279 | } | 279 | } |
280 | } | 280 | } |
281 | else { | 281 | else { |
282 | emit todoToBeDeleted(mTodo); | 282 | emit todoToBeDeleted(mTodo); |
283 | emit dialogClose(mTodo); | 283 | emit dialogClose(mTodo); |
284 | mCalendar->deleteTodo(mTodo); | 284 | mCalendar->deleteTodo(mTodo); |
285 | emit todoDeleted(); | 285 | emit todoDeleted(); |
286 | reject(); | 286 | reject(); |
287 | } | 287 | } |
288 | } else { | 288 | } else { |
289 | reject(); | 289 | reject(); |
290 | } | 290 | } |
291 | } | 291 | } |
292 | 292 | ||
293 | void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) | 293 | void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay) |
294 | { | 294 | { |
295 | mRelatedTodo = relatedEvent; | 295 | mRelatedTodo = relatedEvent; |
296 | 296 | ||
297 | mGeneral->setDefaults(due,allDay); | 297 | mGeneral->setDefaults(due,allDay); |
298 | mDetails->setDefaults(); | 298 | mDetails->setDefaults(); |
299 | showPage( 0 ); | 299 | showPage( 0 ); |
300 | if ( mRelatedTodo ) { | 300 | if ( mRelatedTodo ) { |
301 | mGeneral->fillCalCombo(mRelatedTodo->calID() ); | ||
301 | mGeneral->setCategories (mRelatedTodo->categoriesStr ()); | 302 | mGeneral->setCategories (mRelatedTodo->categoriesStr ()); |
302 | mGeneral->setSecrecy (mRelatedTodo->secrecy ()); | 303 | mGeneral->setSecrecy (mRelatedTodo->secrecy ()); |
303 | if ( mRelatedTodo->priority() < 3 ) | 304 | if ( mRelatedTodo->priority() < 3 ) |
304 | mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1); | 305 | mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1); |
305 | mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": "); | 306 | mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": "); |
306 | int len = mRelatedTodo->summary().length(); | 307 | int len = mRelatedTodo->summary().length(); |
307 | mGeneral->mSummaryEdit->lineEdit()->setFocus(); | 308 | mGeneral->mSummaryEdit->lineEdit()->setFocus(); |
308 | mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 ); | 309 | mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 ); |
309 | mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 ); | 310 | mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 ); |
310 | 311 | ||
311 | } else | 312 | } else |
312 | mGeneral->setFocusOn( 2 ); | 313 | mGeneral->setFocusOn( 2 ); |
313 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); | 314 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); |
314 | mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 )); | 315 | mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 )); |
315 | } | 316 | } |
316 | void KOTodoEditor::checkRecurrence() | 317 | void KOTodoEditor::checkRecurrence() |
317 | { | 318 | { |
318 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { | 319 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { |
319 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), true ); | 320 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), true ); |
320 | 321 | ||
321 | if ( mTodo ) | 322 | if ( mTodo ) |
322 | mRecurrence->readEvent( mTodo ); | 323 | mRecurrence->readEvent( mTodo ); |
323 | else { | 324 | else { |
324 | bool time = mGeneral->mTimeButton->isChecked(); | 325 | bool time = mGeneral->mTimeButton->isChecked(); |
325 | QDateTime from,to; | 326 | QDateTime from,to; |
326 | if ( time ) { | 327 | if ( time ) { |
327 | to = QDateTime( mGeneral->mDueDateEdit->date(), mGeneral->mDueTimeEdit->getTime() ) ; | 328 | to = QDateTime( mGeneral->mDueDateEdit->date(), mGeneral->mDueTimeEdit->getTime() ) ; |
328 | from = QDateTime( mGeneral->mStartDateEdit->date(),mGeneral->mStartTimeEdit->getTime( )) ; | 329 | from = QDateTime( mGeneral->mStartDateEdit->date(),mGeneral->mStartTimeEdit->getTime( )) ; |
329 | } else { | 330 | } else { |
330 | to = QDateTime( mGeneral->mDueDateEdit->date(), QTime( 0,0,0) ) ; | 331 | to = QDateTime( mGeneral->mDueDateEdit->date(), QTime( 0,0,0) ) ; |
331 | from = QDateTime( mGeneral->mStartDateEdit->date(),QTime( 0,0,0) ) ; | 332 | from = QDateTime( mGeneral->mStartDateEdit->date(),QTime( 0,0,0) ) ; |
332 | } | 333 | } |
333 | if ( to < from ) | 334 | if ( to < from ) |
334 | to = from; | 335 | to = from; |
335 | mRecurrence->setDefaults(from,to); | 336 | mRecurrence->setDefaults(from,to); |
336 | } | 337 | } |
337 | } else { | 338 | } else { |
338 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); | 339 | tabWidget()->setTabEnabled ( mRecurrence->parentWidget(), false ); |
339 | mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 )); | 340 | mRecurrence->setDefaults(QDateTime::currentDateTime(),QDateTime::currentDateTime().addSecs( 3600 )); |
340 | } | 341 | } |
341 | } | 342 | } |
342 | void KOTodoEditor::readTodo(Todo *todo) | 343 | void KOTodoEditor::readTodo(Todo *todo) |
343 | { | 344 | { |
344 | mGeneral->readTodo(todo); | 345 | mGeneral->readTodo(todo); |
345 | mDetails->readEvent(todo); | 346 | mDetails->readEvent(todo); |
346 | mRelatedTodo = 0;//todo->relatedTo(); | 347 | mRelatedTodo = 0;//todo->relatedTo(); |
347 | // categories | 348 | // categories |
348 | // mCategoryDialog->setSelected(todo->categories()); | 349 | // mCategoryDialog->setSelected(todo->categories()); |
349 | 350 | ||
350 | // We should handle read-only events here. | 351 | // We should handle read-only events here. |
351 | } | 352 | } |
352 | 353 | ||
353 | void KOTodoEditor::writeTodo(Todo *event) | 354 | void KOTodoEditor::writeTodo(Todo *event) |
354 | { | 355 | { |
355 | bool maybeComputeRecurrenceTime = false; | 356 | bool maybeComputeRecurrenceTime = false; |
356 | if( event->hasRecurrenceID() && event->percentComplete() < 100) | 357 | if( event->hasRecurrenceID() && event->percentComplete() < 100) |
357 | maybeComputeRecurrenceTime = true; | 358 | maybeComputeRecurrenceTime = true; |
358 | event->setHasRecurrenceID( false ); | 359 | event->setHasRecurrenceID( false ); |
359 | mGeneral->writeTodo(event); | 360 | mGeneral->writeTodo(event); |
360 | mDetails->writeEvent(event); | 361 | mDetails->writeEvent(event); |
361 | 362 | ||
362 | // set related event, i.e. parent to-do in this case. | 363 | // set related event, i.e. parent to-do in this case. |
363 | if (mRelatedTodo) { | 364 | if (mRelatedTodo) { |
364 | event->setRelatedTo(mRelatedTodo); | 365 | event->setRelatedTo(mRelatedTodo); |
365 | } | 366 | } |
366 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { | 367 | if ( mGeneral->mDueCheck->isChecked() && mGeneral->mStartCheck->isChecked()) { |
367 | mRecurrence->writeEvent(event); | 368 | mRecurrence->writeEvent(event); |
368 | if ( event->doesRecur() ) { | 369 | if ( event->doesRecur() ) { |
369 | int addSec = -1 ; | 370 | int addSec = -1 ; |
370 | if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 ) | 371 | if ( maybeComputeRecurrenceTime && event->percentComplete() == 100 ) |
371 | addSec = 1; | 372 | addSec = 1; |
372 | event->setRecurrenceID( event->dtStart().addSecs( addSec ) ); | 373 | event->setRecurrenceID( event->dtStart().addSecs( addSec ) ); |
373 | event->setRecurDates(); | 374 | event->setRecurDates(); |
374 | } else { | 375 | } else { |
375 | event->setHasRecurrenceID( false ); | 376 | event->setHasRecurrenceID( false ); |
376 | } | 377 | } |
377 | } else { | 378 | } else { |
378 | event->setHasRecurrenceID( false ); | 379 | event->setHasRecurrenceID( false ); |
379 | event->recurrence()->unsetRecurs(); | 380 | event->recurrence()->unsetRecurs(); |
380 | } | 381 | } |
381 | } | 382 | } |
382 | 383 | ||
383 | bool KOTodoEditor::validateInput() | 384 | bool KOTodoEditor::validateInput() |
384 | { | 385 | { |
385 | if (!mGeneral->validateInput()) return false; | 386 | if (!mGeneral->validateInput()) return false; |
386 | if (!mDetails->validateInput()) return false; | 387 | if (!mDetails->validateInput()) return false; |
387 | return true; | 388 | return true; |
388 | } | 389 | } |
389 | 390 | ||
390 | int KOTodoEditor::msgItemDelete() | 391 | int KOTodoEditor::msgItemDelete() |
391 | { | 392 | { |
392 | return KMessageBox::warningContinueCancel(this, | 393 | return KMessageBox::warningContinueCancel(this, |
393 | i18n("This item will be permanently deleted."), | 394 | i18n("This item will be permanently deleted."), |
394 | i18n("KOrganizer Confirmation"),i18n("Delete")); | 395 | i18n("KOrganizer Confirmation"),i18n("Delete")); |
395 | } | 396 | } |
396 | 397 | ||
397 | void KOTodoEditor::modified (int modification) | 398 | void KOTodoEditor::modified (int modification) |
398 | { | 399 | { |
399 | if (modification == KOGlobals::CATEGORY_MODIFIED || | 400 | if (modification == KOGlobals::CATEGORY_MODIFIED || |
400 | KOGlobals::UNKNOWN_MODIFIED == modification ) | 401 | KOGlobals::UNKNOWN_MODIFIED == modification ) |
401 | // mCategoryDialog->setSelected (mTodo->categories ()); | 402 | // mCategoryDialog->setSelected (mTodo->categories ()); |
402 | mGeneral->modified (mTodo, modification); | 403 | mGeneral->modified (mTodo, modification); |
403 | 404 | ||
404 | } | 405 | } |
405 | 406 | ||
406 | void KOTodoEditor::slotLoadTemplate() | 407 | void KOTodoEditor::slotLoadTemplate() |
407 | { | 408 | { |
408 | 409 | ||
409 | QString fileName =locateLocal( "templates", "todos" ); | 410 | QString fileName =locateLocal( "templates", "todos" ); |
410 | QDir t_dir; | 411 | QDir t_dir; |
411 | if ( !t_dir.exists(fileName) ) | 412 | if ( !t_dir.exists(fileName) ) |
412 | t_dir.mkdir ( fileName ); | 413 | t_dir.mkdir ( fileName ); |
413 | fileName += "/todo"; | 414 | fileName += "/todo"; |
414 | fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this ); | 415 | fileName = KFileDialog::getSaveFileName( fileName , "Load Todo template", this ); |
415 | if ( fileName.length() == 0 ) | 416 | if ( fileName.length() == 0 ) |
416 | return; | 417 | return; |
417 | CalendarLocal cal; | 418 | CalendarLocal cal; |
418 | ICalFormat format; | 419 | ICalFormat format; |
419 | if ( !format.load( &cal, fileName ) ) { | 420 | if ( !format.load( &cal, fileName ) ) { |
420 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 421 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
421 | .arg( fileName ) ); | 422 | .arg( fileName ) ); |
422 | return ; | 423 | return ; |
423 | } | 424 | } |
424 | QPtrList<Todo> todos = cal.todos(); | 425 | QPtrList<Todo> todos = cal.todos(); |
425 | Todo * todo = todos.first(); | 426 | Todo * todo = todos.first(); |
426 | if ( !todo ) { | 427 | if ( !todo ) { |
427 | KMessageBox::error( this, | 428 | KMessageBox::error( this, |
428 | i18n("Template does not\ncontain a valid Todo.")); | 429 | i18n("Template does not\ncontain a valid Todo.")); |
429 | } else { | 430 | } else { |
430 | readTodo( todo ); | 431 | readTodo( todo ); |
431 | } | 432 | } |
432 | 433 | ||
433 | } | 434 | } |
434 | 435 | ||
435 | void KOTodoEditor::slotSaveTemplate() | 436 | void KOTodoEditor::slotSaveTemplate() |
436 | { | 437 | { |
437 | QString fileName =locateLocal( "templates", "todos" ); | 438 | QString fileName =locateLocal( "templates", "todos" ); |
438 | QDir t_dir; | 439 | QDir t_dir; |
439 | if ( !t_dir.exists(fileName) ) | 440 | if ( !t_dir.exists(fileName) ) |
440 | t_dir.mkdir ( fileName ); | 441 | t_dir.mkdir ( fileName ); |
441 | fileName += "/todo"; | 442 | fileName += "/todo"; |
442 | fileName = KFileDialog::getSaveFileName( fileName , "Save as Todo template", this ); | 443 | fileName = KFileDialog::getSaveFileName( fileName , "Save as Todo template", this ); |
443 | if ( fileName.length() > 0 ) | 444 | if ( fileName.length() > 0 ) |
444 | saveTemplate( fileName ); | 445 | saveTemplate( fileName ); |
445 | } | 446 | } |
446 | 447 | ||
447 | void KOTodoEditor::saveTemplate( const QString &templateName ) | 448 | void KOTodoEditor::saveTemplate( const QString &templateName ) |
448 | { | 449 | { |
449 | Todo *todo = new Todo; | 450 | Todo *todo = new Todo; |
450 | writeTodo( todo ); | 451 | writeTodo( todo ); |
451 | saveAsTemplate( todo, templateName ); | 452 | saveAsTemplate( todo, templateName ); |
452 | } | 453 | } |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index a87e6fc..c23a8ee 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -315,388 +315,422 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e) | |||
315 | void KOTodoListView::wheelEvent (QWheelEvent *e) | 315 | void KOTodoListView::wheelEvent (QWheelEvent *e) |
316 | { | 316 | { |
317 | QListView::wheelEvent (e); | 317 | QListView::wheelEvent (e); |
318 | } | 318 | } |
319 | 319 | ||
320 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) | 320 | void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) |
321 | { | 321 | { |
322 | 322 | ||
323 | QPoint p(contentsToViewport(e->pos())); | 323 | QPoint p(contentsToViewport(e->pos())); |
324 | QListViewItem *i = itemAt(p); | 324 | QListViewItem *i = itemAt(p); |
325 | bool rootClicked = true; | 325 | bool rootClicked = true; |
326 | if (i) { | 326 | if (i) { |
327 | // if the user clicked into the root decoration of the item, don't | 327 | // if the user clicked into the root decoration of the item, don't |
328 | // try to start a drag! | 328 | // try to start a drag! |
329 | int X = p.x(); | 329 | int X = p.x(); |
330 | //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); | 330 | //qDebug("%d %d %d", X, header()->sectionPos(0), treeStepSize() ); |
331 | if (X > header()->sectionPos(0) + | 331 | if (X > header()->sectionPos(0) + |
332 | treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + | 332 | treeStepSize() * (i->depth() + (rootIsDecorated() ? 1 : 0)) + |
333 | itemMargin() +i->height()|| | 333 | itemMargin() +i->height()|| |
334 | X < header()->sectionPos(0)) { | 334 | X < header()->sectionPos(0)) { |
335 | rootClicked = false; | 335 | rootClicked = false; |
336 | } | 336 | } |
337 | } else { | 337 | } else { |
338 | rootClicked = false; | 338 | rootClicked = false; |
339 | } | 339 | } |
340 | #ifndef KORG_NODND | 340 | #ifndef KORG_NODND |
341 | mMousePressed = false; | 341 | mMousePressed = false; |
342 | if (! rootClicked && !( e->button() == RightButton) ) { | 342 | if (! rootClicked && !( e->button() == RightButton) ) { |
343 | mPressPos = e->pos(); | 343 | mPressPos = e->pos(); |
344 | mMousePressed = true; | 344 | mMousePressed = true; |
345 | } else { | 345 | } else { |
346 | mMousePressed = false; | 346 | mMousePressed = false; |
347 | } | 347 | } |
348 | #endif | 348 | #endif |
349 | //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); | 349 | //qDebug("KOTodoListView::contentsMousePressEvent %d", rootClicked); |
350 | #ifndef DESKTOP_VERSION | 350 | #ifndef DESKTOP_VERSION |
351 | if (!( e->button() == RightButton && rootClicked) ) | 351 | if (!( e->button() == RightButton && rootClicked) ) |
352 | QListView::contentsMousePressEvent(e); | 352 | QListView::contentsMousePressEvent(e); |
353 | #else | 353 | #else |
354 | QListView::contentsMousePressEvent(e); | 354 | QListView::contentsMousePressEvent(e); |
355 | #endif | 355 | #endif |
356 | } | 356 | } |
357 | void KOTodoListView::paintEvent(QPaintEvent* e) | 357 | void KOTodoListView::paintEvent(QPaintEvent* e) |
358 | { | 358 | { |
359 | emit paintNeeded(); | 359 | emit paintNeeded(); |
360 | QListView::paintEvent( e); | 360 | QListView::paintEvent( e); |
361 | } | 361 | } |
362 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) | 362 | void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) |
363 | { | 363 | { |
364 | 364 | ||
365 | #ifndef KORG_NODND | 365 | #ifndef KORG_NODND |
366 | //QListView::contentsMouseMoveEvent(e); | 366 | //QListView::contentsMouseMoveEvent(e); |
367 | if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > | 367 | if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > |
368 | QApplication::startDragDistance()*3) { | 368 | QApplication::startDragDistance()*3) { |
369 | mMousePressed = false; | 369 | mMousePressed = false; |
370 | QListViewItem *item = itemAt(contentsToViewport(mPressPos)); | 370 | QListViewItem *item = itemAt(contentsToViewport(mPressPos)); |
371 | if (item) { | 371 | if (item) { |
372 | DndFactory factory( mCalendar ); | 372 | DndFactory factory( mCalendar ); |
373 | ICalDrag *vd = factory.createDrag( | 373 | ICalDrag *vd = factory.createDrag( |
374 | ((KOTodoViewItem *)item)->todo(),viewport()); | 374 | ((KOTodoViewItem *)item)->todo(),viewport()); |
375 | internalDrop = false; | 375 | internalDrop = false; |
376 | // we cannot do any senseful here, because the DnD is still broken in Qt | 376 | // we cannot do any senseful here, because the DnD is still broken in Qt |
377 | if (vd->drag()) { | 377 | if (vd->drag()) { |
378 | if ( !internalDrop ) { | 378 | if ( !internalDrop ) { |
379 | //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); | 379 | //emit deleteTodo( ((KOTodoViewItem *)item)->todo() ); |
380 | qDebug("Dnd: External move: Delete drag source "); | 380 | qDebug("Dnd: External move: Delete drag source "); |
381 | } else | 381 | } else |
382 | qDebug("Dnd: Internal move "); | 382 | qDebug("Dnd: Internal move "); |
383 | 383 | ||
384 | } else { | 384 | } else { |
385 | if ( !internalDrop ) { | 385 | if ( !internalDrop ) { |
386 | qDebug("Dnd: External Copy"); | 386 | qDebug("Dnd: External Copy"); |
387 | } else | 387 | } else |
388 | qDebug("DnD: Internal copy: Copy pending"); | 388 | qDebug("DnD: Internal copy: Copy pending"); |
389 | } | 389 | } |
390 | } | 390 | } |
391 | } | 391 | } |
392 | #endif | 392 | #endif |
393 | } | 393 | } |
394 | void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) | 394 | void KOTodoListView::keyReleaseEvent ( QKeyEvent *e ) |
395 | { | 395 | { |
396 | if ( !e->isAutoRepeat() ) { | 396 | if ( !e->isAutoRepeat() ) { |
397 | mFlagKeyPressed = false; | 397 | mFlagKeyPressed = false; |
398 | } | 398 | } |
399 | } | 399 | } |
400 | 400 | ||
401 | 401 | ||
402 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) | 402 | void KOTodoListView::keyPressEvent ( QKeyEvent * e ) |
403 | { | 403 | { |
404 | qApp->processEvents(); | 404 | qApp->processEvents(); |
405 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { | 405 | if ( e->isAutoRepeat() && !mFlagKeyPressed ) { |
406 | e->ignore(); | 406 | e->ignore(); |
407 | // qDebug(" ignore %d",e->isAutoRepeat() ); | 407 | // qDebug(" ignore %d",e->isAutoRepeat() ); |
408 | return; | 408 | return; |
409 | } | 409 | } |
410 | if (! e->isAutoRepeat() ) | 410 | if (! e->isAutoRepeat() ) |
411 | mFlagKeyPressed = true; | 411 | mFlagKeyPressed = true; |
412 | QListViewItem* cn; | 412 | QListViewItem* cn; |
413 | if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { | 413 | if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { |
414 | cn = currentItem(); | 414 | cn = currentItem(); |
415 | if ( cn ) { | 415 | if ( cn ) { |
416 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 416 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
417 | if ( ci ){ | 417 | if ( ci ){ |
418 | if ( e->state() == ShiftButton ) | 418 | if ( e->state() == ShiftButton ) |
419 | ci->setOn( false ); | 419 | ci->setOn( false ); |
420 | else | 420 | else |
421 | ci->setOn( true ); | 421 | ci->setOn( true ); |
422 | cn = cn->itemBelow(); | 422 | cn = cn->itemBelow(); |
423 | if ( cn ) { | 423 | if ( cn ) { |
424 | setCurrentItem ( cn ); | 424 | setCurrentItem ( cn ); |
425 | ensureItemVisible ( cn ); | 425 | ensureItemVisible ( cn ); |
426 | } | 426 | } |
427 | 427 | ||
428 | } | 428 | } |
429 | } | 429 | } |
430 | 430 | ||
431 | return; | 431 | return; |
432 | } | 432 | } |
433 | 433 | ||
434 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { | 434 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { |
435 | switch ( e->key() ) { | 435 | switch ( e->key() ) { |
436 | case Qt::Key_Down: | 436 | case Qt::Key_Down: |
437 | case Qt::Key_Up: | 437 | case Qt::Key_Up: |
438 | QListView::keyPressEvent ( e ); | 438 | QListView::keyPressEvent ( e ); |
439 | break; | 439 | break; |
440 | case Qt::Key_Left: | 440 | case Qt::Key_Left: |
441 | case Qt::Key_Right: | 441 | case Qt::Key_Right: |
442 | QListView::keyPressEvent ( e ); | 442 | QListView::keyPressEvent ( e ); |
443 | e->accept(); | 443 | e->accept(); |
444 | return; | 444 | return; |
445 | break; | 445 | break; |
446 | default: | 446 | default: |
447 | e->ignore(); | 447 | e->ignore(); |
448 | break; | 448 | break; |
449 | } | 449 | } |
450 | return; | 450 | return; |
451 | } | 451 | } |
452 | e->ignore(); | 452 | e->ignore(); |
453 | } | 453 | } |
454 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) | 454 | void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) |
455 | { | 455 | { |
456 | QListView::contentsMouseReleaseEvent(e); | 456 | QListView::contentsMouseReleaseEvent(e); |
457 | mMousePressed = false; | 457 | mMousePressed = false; |
458 | } | 458 | } |
459 | 459 | ||
460 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) | 460 | void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) |
461 | { | 461 | { |
462 | if (!e) return; | 462 | if (!e) return; |
463 | 463 | ||
464 | QPoint vp = contentsToViewport(e->pos()); | 464 | QPoint vp = contentsToViewport(e->pos()); |
465 | 465 | ||
466 | QListViewItem *item = itemAt(vp); | 466 | QListViewItem *item = itemAt(vp); |
467 | 467 | ||
468 | emit double_Clicked(item); | 468 | emit double_Clicked(item); |
469 | if (!item) return; | 469 | if (!item) return; |
470 | 470 | ||
471 | emit doubleClicked(item,vp,0); | 471 | emit doubleClicked(item,vp,0); |
472 | } | 472 | } |
473 | 473 | ||
474 | ///////////////////////////////////////////////////////////////////////////// | 474 | ///////////////////////////////////////////////////////////////////////////// |
475 | 475 | ||
476 | KOQuickTodo::KOQuickTodo(QWidget *parent) : | 476 | KOQuickTodo::KOQuickTodo(QWidget *parent) : |
477 | QLineEdit(parent) | 477 | QLineEdit(parent) |
478 | { | 478 | { |
479 | setText(i18n("Click to add a new Todo")); | 479 | setText(i18n("Click to add a new Todo")); |
480 | } | 480 | } |
481 | 481 | ||
482 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) | 482 | void KOQuickTodo::focusInEvent(QFocusEvent *ev) |
483 | { | 483 | { |
484 | if ( text()==i18n("Click to add a new Todo") ) | 484 | if ( text()==i18n("Click to add a new Todo") ) |
485 | setText(""); | 485 | setText(""); |
486 | QLineEdit::focusInEvent(ev); | 486 | QLineEdit::focusInEvent(ev); |
487 | } | 487 | } |
488 | 488 | ||
489 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) | 489 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) |
490 | { | 490 | { |
491 | setText(i18n("Click to add a new Todo")); | 491 | setText(i18n("Click to add a new Todo")); |
492 | QLineEdit::focusOutEvent(ev); | 492 | QLineEdit::focusOutEvent(ev); |
493 | } | 493 | } |
494 | 494 | ||
495 | ///////////////////////////////////////////////////////////////////////////// | 495 | ///////////////////////////////////////////////////////////////////////////// |
496 | 496 | ||
497 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | 497 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : |
498 | KOrg::BaseView(calendar,parent,name) | 498 | KOrg::BaseView(calendar,parent,name) |
499 | { | 499 | { |
500 | mCategoryPopupMenu = 0; | 500 | mCategoryPopupMenu = 0; |
501 | mPendingUpdateBeforeRepaint = false; | 501 | mPendingUpdateBeforeRepaint = false; |
502 | isFlatDisplay = false; | 502 | isFlatDisplay = false; |
503 | mNavigator = 0; | 503 | mNavigator = 0; |
504 | QBoxLayout *topLayout = new QVBoxLayout(this); | 504 | QBoxLayout *topLayout = new QVBoxLayout(this); |
505 | mName = QString ( name ); | 505 | mName = QString ( name ); |
506 | mBlockUpdate = false; | 506 | mBlockUpdate = false; |
507 | mQuickAdd = new KOQuickTodo(this); | 507 | mQuickBar = new QWidget( this ); |
508 | topLayout->addWidget(mQuickAdd); | 508 | topLayout->addWidget(mQuickBar); |
509 | 509 | ||
510 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); | 510 | mQuickAdd = new KOQuickTodo(mQuickBar); |
511 | QBoxLayout *quickLayout = new QHBoxLayout(mQuickBar); | ||
512 | quickLayout->addWidget( mQuickAdd ); | ||
513 | QPushButton * flat = new QPushButton( "F",mQuickBar ); | ||
514 | int fixwid = flat->sizeHint().height(); | ||
515 | if ( QApplication::desktop()->width() > 320 ) | ||
516 | fixwid *= 2; | ||
517 | flat->setFixedWidth( fixwid ); | ||
518 | connect ( flat, SIGNAL ( clicked()), SLOT ( setAllFlat())); | ||
519 | QPushButton * allopen = new QPushButton( "O",mQuickBar ); | ||
520 | allopen->setFixedWidth( fixwid ); | ||
521 | connect ( allopen, SIGNAL ( clicked()), SLOT ( setAllOpen())); | ||
522 | QPushButton * allclose = new QPushButton( "C",mQuickBar ); | ||
523 | allclose->setFixedWidth( fixwid ); | ||
524 | connect ( allclose, SIGNAL ( clicked()), SLOT ( setAllClose())); | ||
525 | QPushButton * s_done = new QPushButton( "D",mQuickBar ); | ||
526 | s_done->setFixedWidth( fixwid ); | ||
527 | connect ( s_done, SIGNAL ( clicked()), SLOT ( toggleCompleted())); | ||
528 | QPushButton * s_run = new QPushButton( "R",mQuickBar ); | ||
529 | s_run->setFixedWidth( fixwid ); | ||
530 | connect ( s_run, SIGNAL ( clicked()), SLOT ( toggleRunning())); | ||
531 | |||
532 | mNewSubBut = new QPushButton( "sub",mQuickBar ); | ||
533 | mNewSubBut->setFixedWidth( fixwid*3/2 ); | ||
534 | connect ( mNewSubBut, SIGNAL ( clicked()), SLOT ( newSubTodo())); | ||
535 | mNewSubBut->setEnabled( false ); | ||
536 | quickLayout->addWidget( mNewSubBut ); | ||
537 | quickLayout->addWidget( s_done ); | ||
538 | quickLayout->addWidget( s_run ); | ||
539 | |||
540 | quickLayout->addWidget( allopen ); | ||
541 | quickLayout->addWidget( allclose ); | ||
542 | quickLayout->addWidget( flat ); | ||
543 | |||
544 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickBar->hide(); | ||
511 | 545 | ||
512 | mTodoListView = new KOTodoListView(calendar,this, name ); | 546 | mTodoListView = new KOTodoListView(calendar,this, name ); |
513 | topLayout->addWidget(mTodoListView); | 547 | topLayout->addWidget(mTodoListView); |
514 | //mTodoListView->header()->setMaximumHeight(30); | 548 | //mTodoListView->header()->setMaximumHeight(30); |
515 | mTodoListView->setRootIsDecorated(true); | 549 | mTodoListView->setRootIsDecorated(true); |
516 | mTodoListView->setAllColumnsShowFocus(true); | 550 | mTodoListView->setAllColumnsShowFocus(true); |
517 | 551 | ||
518 | mTodoListView->setShowSortIndicator(true); | 552 | mTodoListView->setShowSortIndicator(true); |
519 | 553 | ||
520 | mTodoListView->addColumn(i18n("Todo")); | 554 | mTodoListView->addColumn(i18n("Todo")); |
521 | mTodoListView->addColumn(i18n("Prio")); | 555 | mTodoListView->addColumn(i18n("Prio")); |
522 | mTodoListView->setColumnAlignment(1,AlignHCenter); | 556 | mTodoListView->setColumnAlignment(1,AlignHCenter); |
523 | mTodoListView->addColumn(i18n("Complete")); | 557 | mTodoListView->addColumn(i18n("Complete")); |
524 | mTodoListView->setColumnAlignment(2,AlignCenter); | 558 | mTodoListView->setColumnAlignment(2,AlignCenter); |
525 | 559 | ||
526 | mTodoListView->addColumn(i18n("Due Date")); | 560 | mTodoListView->addColumn(i18n("Due Date")); |
527 | mTodoListView->setColumnAlignment(3,AlignLeft); | 561 | mTodoListView->setColumnAlignment(3,AlignLeft); |
528 | mTodoListView->addColumn(i18n("Due Time")); | 562 | mTodoListView->addColumn(i18n("Due Time")); |
529 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 563 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
530 | 564 | ||
531 | mTodoListView->addColumn(i18n("Start Date")); | 565 | mTodoListView->addColumn(i18n("Start Date")); |
532 | mTodoListView->setColumnAlignment(5,AlignLeft); | 566 | mTodoListView->setColumnAlignment(5,AlignLeft); |
533 | mTodoListView->addColumn(i18n("Start Time")); | 567 | mTodoListView->addColumn(i18n("Start Time")); |
534 | mTodoListView->setColumnAlignment(6,AlignHCenter); | 568 | mTodoListView->setColumnAlignment(6,AlignHCenter); |
535 | 569 | ||
536 | mTodoListView->addColumn(i18n("Cancelled")); | 570 | mTodoListView->addColumn(i18n("Cancelled")); |
537 | mTodoListView->addColumn(i18n("Categories")); | 571 | mTodoListView->addColumn(i18n("Categories")); |
538 | mTodoListView->addColumn(i18n("Calendar")); | 572 | mTodoListView->addColumn(i18n("Calendar")); |
539 | #if 0 | 573 | #if 0 |
540 | mTodoListView->addColumn(i18n("Sort Id")); | 574 | mTodoListView->addColumn(i18n("Sort Id")); |
541 | mTodoListView->setColumnAlignment(4,AlignHCenter); | 575 | mTodoListView->setColumnAlignment(4,AlignHCenter); |
542 | #endif | 576 | #endif |
543 | 577 | ||
544 | mTodoListView->setMinimumHeight( 60 ); | 578 | mTodoListView->setMinimumHeight( 60 ); |
545 | mTodoListView->setItemsRenameable( true ); | 579 | mTodoListView->setItemsRenameable( true ); |
546 | mTodoListView->setRenameable( 0 ); | 580 | mTodoListView->setRenameable( 0 ); |
547 | mTodoListView->setColumnWidth( 0, 120 ); | 581 | mTodoListView->setColumnWidth( 0, 120 ); |
548 | int iii = 0; | 582 | int iii = 0; |
549 | for ( iii = 0; iii< 10 ; ++iii ) | 583 | for ( iii = 0; iii< 10 ; ++iii ) |
550 | mTodoListView->setColumnWidthMode( iii, QListView::Manual ); | 584 | mTodoListView->setColumnWidthMode( iii, QListView::Manual ); |
551 | 585 | ||
552 | 586 | ||
553 | mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); | 587 | mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this); |
554 | 588 | ||
555 | mPriorityPopupMenu = new QPopupMenu(this); | 589 | mPriorityPopupMenu = new QPopupMenu(this); |
556 | for (int i = 1; i <= 5; i++) { | 590 | for (int i = 1; i <= 5; i++) { |
557 | QString label = QString ("%1").arg (i); | 591 | QString label = QString ("%1").arg (i); |
558 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; | 592 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; |
559 | } | 593 | } |
560 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); | 594 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); |
561 | 595 | ||
562 | mPercentageCompletedPopupMenu = new QPopupMenu(this); | 596 | mPercentageCompletedPopupMenu = new QPopupMenu(this); |
563 | for (int i = 0; i <= 100; i+=20) { | 597 | for (int i = 0; i <= 100; i+=20) { |
564 | QString label = QString ("%1 %").arg (i); | 598 | QString label = QString ("%1 %").arg (i); |
565 | mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; | 599 | mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; |
566 | } | 600 | } |
567 | connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); | 601 | connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); |
568 | 602 | ||
569 | 603 | ||
570 | mCategoryPopupMenu = new QPopupMenu (this); | 604 | mCategoryPopupMenu = new QPopupMenu (this); |
571 | mCategoryPopupMenu->setCheckable (true); | 605 | mCategoryPopupMenu->setCheckable (true); |
572 | connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); | 606 | connect (mCategoryPopupMenu, SIGNAL (activated (int)), SLOT (changedCategories (int))); |
573 | connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); | 607 | connect (mCategoryPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCategories ())); |
574 | 608 | ||
575 | mCalPopupMenu = new QPopupMenu (this); | 609 | mCalPopupMenu = new QPopupMenu (this); |
576 | mCalPopupMenu->setCheckable (true); | 610 | mCalPopupMenu->setCheckable (true); |
577 | connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); | 611 | connect (mCalPopupMenu, SIGNAL (activated (int)), SLOT (changedCal (int))); |
578 | connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); | 612 | connect (mCalPopupMenu, SIGNAL (aboutToShow ()), SLOT (fillCal ())); |
579 | 613 | ||
580 | 614 | ||
581 | 615 | ||
582 | 616 | ||
583 | mItemPopupMenu = new QPopupMenu(this); | 617 | mItemPopupMenu = new QPopupMenu(this); |
584 | mItemPopupMenu->insertItem(i18n("Show"), this, | 618 | mItemPopupMenu->insertItem(i18n("Show"), this, |
585 | SLOT (showTodo())); | 619 | SLOT (showTodo())); |
586 | mItemPopupMenu->insertItem(i18n("Edit..."), this, | 620 | mItemPopupMenu->insertItem(i18n("Edit..."), this, |
587 | SLOT (editTodo())); | 621 | SLOT (editTodo())); |
588 | mItemPopupMenu->insertItem( i18n("Delete..."), this, | 622 | mItemPopupMenu->insertItem( i18n("Delete..."), this, |
589 | SLOT (deleteTodo())); | 623 | SLOT (deleteTodo())); |
590 | mItemPopupMenu->insertItem( i18n("Clone..."), this, | 624 | mItemPopupMenu->insertItem( i18n("Clone..."), this, |
591 | SLOT (cloneTodo())); | 625 | SLOT (cloneTodo())); |
592 | mItemPopupMenu->insertItem( i18n("Move..."), this, | 626 | mItemPopupMenu->insertItem( i18n("Move..."), this, |
593 | SLOT (moveTodo())); | 627 | SLOT (moveTodo())); |
594 | #ifndef DESKTOP_VERSION | 628 | #ifndef DESKTOP_VERSION |
595 | mItemPopupMenu->insertItem( i18n("Beam..."), this, | 629 | mItemPopupMenu->insertItem( i18n("Beam..."), this, |
596 | SLOT (beamTodo())); | 630 | SLOT (beamTodo())); |
597 | #endif | 631 | #endif |
598 | mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, | 632 | mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, |
599 | SLOT (cancelTodo())); | 633 | SLOT (cancelTodo())); |
600 | mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu); | 634 | mItemPopupMenu->insertItem( i18n("Categories"), mCategoryPopupMenu); |
601 | mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu); | 635 | mItemPopupMenu->insertItem( i18n("Calendar"), mCalPopupMenu); |
602 | mItemPopupMenu->insertSeparator(); | 636 | mItemPopupMenu->insertSeparator(); |
603 | mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, | 637 | mItemPopupMenu->insertItem( i18n("Start/Stop todo..."), this, |
604 | SLOT (toggleRunningItem())); | 638 | SLOT (toggleRunningItem())); |
605 | mItemPopupMenu->insertSeparator(); | 639 | mItemPopupMenu->insertSeparator(); |
606 | /* | 640 | /* |
607 | mItemPopupMenu->insertItem( i18n("New Todo..."), this, | 641 | mItemPopupMenu->insertItem( i18n("New Todo..."), this, |
608 | SLOT (newTodo())); | 642 | SLOT (newTodo())); |
609 | */ | 643 | */ |
610 | mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, | 644 | mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, |
611 | SLOT (newSubTodo())); | 645 | SLOT (newSubTodo())); |
612 | mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, | 646 | mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, |
613 | SLOT (unparentTodo()),0,21); | 647 | SLOT (unparentTodo()),0,21); |
614 | mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, | 648 | mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, |
615 | SLOT (reparentTodo()),0,22); | 649 | SLOT (reparentTodo()),0,22); |
616 | mItemPopupMenu->insertSeparator(); | 650 | mItemPopupMenu->insertSeparator(); |
617 | #if 0 | 651 | #if 0 |
618 | mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), | 652 | mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed..."), |
619 | this, SLOT( purgeCompleted() ) ); | 653 | this, SLOT( purgeCompleted() ) ); |
620 | mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), | 654 | mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), |
621 | this, SLOT( toggleCompleted() ),0, 33 ); | 655 | this, SLOT( toggleCompleted() ),0, 33 ); |
622 | mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), | 656 | mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), |
623 | this, SLOT( toggleQuickTodo() ),0, 34 ); | 657 | this, SLOT( toggleQuickTodo() ),0, 34 ); |
624 | mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), | 658 | mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), |
625 | this, SLOT( toggleRunning() ),0, 35 ); | 659 | this, SLOT( toggleRunning() ),0, 35 ); |
626 | 660 | ||
627 | #endif | 661 | #endif |
628 | mPopupMenu = new QPopupMenu(this); | 662 | mPopupMenu = new QPopupMenu(this); |
629 | mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, | 663 | mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, |
630 | SLOT (newTodo()),0,1); | 664 | SLOT (newTodo()),0,1); |
631 | mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), | 665 | mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed..."), |
632 | this, SLOT(purgeCompleted()),0,2); | 666 | this, SLOT(purgeCompleted()),0,2); |
633 | mPopupMenu->insertItem(i18n("Show Completed"), | 667 | mPopupMenu->insertItem(i18n("Show Completed"), |
634 | this, SLOT( toggleCompleted() ),0,3 ); | 668 | this, SLOT( toggleCompleted() ),0,3 ); |
635 | mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), | 669 | mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), |
636 | this, SLOT( toggleRunning() ),0,5 ); | 670 | this, SLOT( toggleRunning() ),0,5 ); |
637 | mPopupMenu->insertItem(i18n(" set all open","Display all opened"), | 671 | mPopupMenu->insertItem(i18n(" set all open","Display all opened"), |
638 | this, SLOT( setAllOpen() ),0,6 ); | 672 | this, SLOT( setAllOpen() ),0,6 ); |
639 | mPopupMenu->insertItem(i18n(" set all close","Display all closed"), | 673 | mPopupMenu->insertItem(i18n(" set all close","Display all closed"), |
640 | this, SLOT( setAllClose() ),0,7 ); | 674 | this, SLOT( setAllClose() ),0,7 ); |
641 | mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), | 675 | mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), |
642 | this, SLOT( setAllFlat() ),0,8 ); | 676 | this, SLOT( setAllFlat() ),0,8 ); |
643 | mPopupMenu->insertSeparator(); | 677 | mPopupMenu->insertSeparator(); |
644 | mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), | 678 | mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), |
645 | this, SLOT( toggleQuickTodo() ),0,4 ); | 679 | this, SLOT( toggleQuickTodo() ),0,4 ); |
646 | mDocPrefs = new DocPrefs( name ); | 680 | mDocPrefs = new DocPrefs( name ); |
647 | 681 | ||
648 | mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); | 682 | mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); |
649 | mPopupMenu->setCheckable( true ); | 683 | mPopupMenu->setCheckable( true ); |
650 | mItemPopupMenu->setCheckable( true ); | 684 | mItemPopupMenu->setCheckable( true ); |
651 | 685 | ||
652 | 686 | ||
653 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 687 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
654 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 688 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
655 | 689 | ||
656 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 690 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
657 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 691 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
658 | 692 | ||
659 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 693 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
660 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 694 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
661 | 695 | ||
662 | 696 | ||
663 | // Double clicking conflicts with opening/closing the subtree | 697 | // Double clicking conflicts with opening/closing the subtree |
664 | connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), | 698 | connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), |
665 | SLOT( editItem( QListViewItem *) ) ); | 699 | SLOT( editItem( QListViewItem *) ) ); |
666 | /* | 700 | /* |
667 | connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, | 701 | connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, |
668 | const QPoint &,int ) ), | 702 | const QPoint &,int ) ), |
669 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); | 703 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); |
670 | */ | 704 | */ |
671 | connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, | 705 | connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, |
672 | const QPoint &,int ) ), | 706 | const QPoint &,int ) ), |
673 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); | 707 | SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); |
674 | connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), | 708 | connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), |
675 | SLOT( itemClicked( QListViewItem * ) ) ); | 709 | SLOT( itemClicked( QListViewItem * ) ) ); |
676 | connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), | 710 | connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), |
677 | SLOT( itemDoubleClicked( QListViewItem * ) ) ); | 711 | SLOT( itemDoubleClicked( QListViewItem * ) ) ); |
678 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), | 712 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), |
679 | SLOT( updateView() ) ); | 713 | SLOT( updateView() ) ); |
680 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), | 714 | connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), |
681 | SLOT( todoModified(Todo *, int) ) ); | 715 | SLOT( todoModified(Todo *, int) ) ); |
682 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), | 716 | connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), |
683 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 717 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
684 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), | 718 | connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), |
685 | SLOT( itemStateChanged( QListViewItem * ) ) ); | 719 | SLOT( itemStateChanged( QListViewItem * ) ) ); |
686 | connect( mTodoListView, SIGNAL( paintNeeded() ), | 720 | connect( mTodoListView, SIGNAL( paintNeeded() ), |
687 | SLOT( paintNeeded()) ); | 721 | SLOT( paintNeeded()) ); |
688 | 722 | ||
689 | #if 0 | 723 | #if 0 |
690 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), | 724 | connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), |
691 | SLOT(selectionChanged(QListViewItem *))); | 725 | SLOT(selectionChanged(QListViewItem *))); |
692 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), | 726 | connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), |
693 | SLOT(selectionChanged(QListViewItem *))); | 727 | SLOT(selectionChanged(QListViewItem *))); |
694 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), | 728 | connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), |
695 | SLOT(selectionChanged(QListViewItem *))); | 729 | SLOT(selectionChanged(QListViewItem *))); |
696 | #endif | 730 | #endif |
697 | 731 | ||
698 | connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); | 732 | connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); |
699 | connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); | 733 | connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); |
700 | connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); | 734 | connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); |
701 | 735 | ||
702 | connect( mTodoListView, SIGNAL(selectionChanged() ), | 736 | connect( mTodoListView, SIGNAL(selectionChanged() ), |
@@ -893,737 +927,765 @@ void KOTodoView::resetCurrentItem() | |||
893 | } | 927 | } |
894 | if ( item->todo() == mCurItemParent ) { | 928 | if ( item->todo() == mCurItemParent ) { |
895 | foundItemParent = item; | 929 | foundItemParent = item; |
896 | } | 930 | } |
897 | item = (KOTodoViewItem*)item->itemBelow(); | 931 | item = (KOTodoViewItem*)item->itemBelow(); |
898 | } | 932 | } |
899 | if ( ! foundItem ) { | 933 | if ( ! foundItem ) { |
900 | if ( foundItemParent ) { | 934 | if ( foundItemParent ) { |
901 | foundItem = foundItemParent; | 935 | foundItem = foundItemParent; |
902 | } else { | 936 | } else { |
903 | if ( foundItemRoot ) | 937 | if ( foundItemRoot ) |
904 | foundItem = foundItemRoot; | 938 | foundItem = foundItemRoot; |
905 | else | 939 | else |
906 | foundItem = foundItemAbove; | 940 | foundItem = foundItemAbove; |
907 | } | 941 | } |
908 | } | 942 | } |
909 | } | 943 | } |
910 | if ( foundItem ) { | 944 | if ( foundItem ) { |
911 | mTodoListView->setSelected ( foundItem, true ); | 945 | mTodoListView->setSelected ( foundItem, true ); |
912 | mTodoListView->setCurrentItem( foundItem ); | 946 | mTodoListView->setCurrentItem( foundItem ); |
913 | mTodoListView->ensureItemVisible( foundItem ); | 947 | mTodoListView->ensureItemVisible( foundItem ); |
914 | } else { | 948 | } else { |
915 | if ( mTodoListView->firstChild () ) { | 949 | if ( mTodoListView->firstChild () ) { |
916 | mTodoListView->setSelected ( mTodoListView->firstChild (), true ); | 950 | mTodoListView->setSelected ( mTodoListView->firstChild (), true ); |
917 | mTodoListView->setCurrentItem( mTodoListView->firstChild () ); | 951 | mTodoListView->setCurrentItem( mTodoListView->firstChild () ); |
918 | } | 952 | } |
919 | } | 953 | } |
920 | } | 954 | } |
921 | processSelectionChange(); | 955 | processSelectionChange(); |
922 | QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); | 956 | QTimer::singleShot( 100, this, SLOT ( resetFocusToList() )); |
923 | } | 957 | } |
924 | void KOTodoView::resetFocusToList() | 958 | void KOTodoView::resetFocusToList() |
925 | { | 959 | { |
926 | topLevelWidget()->setActiveWindow(); | 960 | topLevelWidget()->setActiveWindow(); |
927 | mTodoListView->setFocus(); | 961 | mTodoListView->setFocus(); |
928 | } | 962 | } |
929 | //Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove; | 963 | //Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove; |
930 | bool KOTodoView::checkTodo( Todo * todo ) | 964 | bool KOTodoView::checkTodo( Todo * todo ) |
931 | { | 965 | { |
932 | 966 | ||
933 | if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) | 967 | if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) |
934 | return false; | 968 | return false; |
935 | if ( !todo->isCompleted() ) { | 969 | if ( !todo->isCompleted() ) { |
936 | if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() ) | 970 | if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() ) |
937 | return true; | 971 | return true; |
938 | } | 972 | } |
939 | if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { | 973 | if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { |
940 | if ( todo->hasStartDate() ) | 974 | if ( todo->hasStartDate() ) |
941 | if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) | 975 | if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) |
942 | return false; | 976 | return false; |
943 | if ( todo->hasDueDate() ) | 977 | if ( todo->hasDueDate() ) |
944 | if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) | 978 | if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) |
945 | return false; | 979 | return false; |
946 | } | 980 | } |
947 | return true; | 981 | return true; |
948 | } | 982 | } |
949 | 983 | ||
950 | void KOTodoView::restoreItemState( QListViewItem *item ) | 984 | void KOTodoView::restoreItemState( QListViewItem *item ) |
951 | { | 985 | { |
952 | pendingSubtodo = 0; | 986 | pendingSubtodo = 0; |
953 | while( item ) { | 987 | while( item ) { |
954 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 988 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
955 | todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); | 989 | todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); |
956 | if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); | 990 | if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); |
957 | item = item->nextSibling(); | 991 | item = item->nextSibling(); |
958 | } | 992 | } |
959 | } | 993 | } |
960 | 994 | ||
961 | 995 | ||
962 | QMap<Todo *,KOTodoViewItem *>::ConstIterator | 996 | QMap<Todo *,KOTodoViewItem *>::ConstIterator |
963 | KOTodoView::insertTodoItem(Todo *todo) | 997 | KOTodoView::insertTodoItem(Todo *todo) |
964 | { | 998 | { |
965 | 999 | ||
966 | // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; | 1000 | // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; |
967 | // TODO: Check, if dynmaic cast is necessary | 1001 | // TODO: Check, if dynmaic cast is necessary |
968 | 1002 | ||
969 | pendingSubtodo = 0; | 1003 | pendingSubtodo = 0; |
970 | Incidence *incidence = todo->relatedTo(); | 1004 | Incidence *incidence = todo->relatedTo(); |
971 | while ( incidence && !incidence->calEnabled() ) | 1005 | while ( incidence && !incidence->calEnabled() ) |
972 | incidence = incidence->relatedTo(); | 1006 | incidence = incidence->relatedTo(); |
973 | if (incidence && incidence->typeID() == todoID ) { | 1007 | if (incidence && incidence->typeID() == todoID ) { |
974 | Todo *relatedTodo = static_cast<Todo *>(incidence); | 1008 | Todo *relatedTodo = static_cast<Todo *>(incidence); |
975 | 1009 | ||
976 | // kdDebug() << " has Related" << endl; | 1010 | // kdDebug() << " has Related" << endl; |
977 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 1011 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
978 | itemIterator = mTodoMap.find(relatedTodo); | 1012 | itemIterator = mTodoMap.find(relatedTodo); |
979 | if (itemIterator == mTodoMap.end()) { | 1013 | if (itemIterator == mTodoMap.end()) { |
980 | // kdDebug() << " related not yet in list" << endl; | 1014 | // kdDebug() << " related not yet in list" << endl; |
981 | itemIterator = insertTodoItem (relatedTodo); | 1015 | itemIterator = insertTodoItem (relatedTodo); |
982 | } | 1016 | } |
983 | // isn't this pretty stupid? We give one Todo to the KOTodoViewItem | 1017 | // isn't this pretty stupid? We give one Todo to the KOTodoViewItem |
984 | // and one into the map. Sure finding is more easy but why? -zecke | 1018 | // and one into the map. Sure finding is more easy but why? -zecke |
985 | KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); | 1019 | KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); |
986 | return mTodoMap.insert(todo,todoItem); | 1020 | return mTodoMap.insert(todo,todoItem); |
987 | } else { | 1021 | } else { |
988 | // kdDebug() << " no Related" << endl; | 1022 | // kdDebug() << " no Related" << endl; |
989 | // see above -zecke | 1023 | // see above -zecke |
990 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 1024 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
991 | return mTodoMap.insert(todo,todoItem); | 1025 | return mTodoMap.insert(todo,todoItem); |
992 | } | 1026 | } |
993 | } | 1027 | } |
994 | 1028 | ||
995 | 1029 | ||
996 | void KOTodoView::updateConfig() | 1030 | void KOTodoView::updateConfig() |
997 | { | 1031 | { |
998 | updateView(); | 1032 | updateView(); |
999 | mTodoListView->repaintContents(); | 1033 | mTodoListView->repaintContents(); |
1000 | } | 1034 | } |
1001 | 1035 | ||
1002 | QPtrList<Incidence> KOTodoView::selectedIncidences() | 1036 | QPtrList<Incidence> KOTodoView::selectedIncidences() |
1003 | { | 1037 | { |
1004 | QPtrList<Incidence> selected; | 1038 | QPtrList<Incidence> selected; |
1005 | 1039 | ||
1006 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); | 1040 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); |
1007 | // if (!item) item = mActiveItem; | 1041 | // if (!item) item = mActiveItem; |
1008 | if (item) selected.append(item->todo()); | 1042 | if (item) selected.append(item->todo()); |
1009 | 1043 | ||
1010 | return selected; | 1044 | return selected; |
1011 | } | 1045 | } |
1012 | 1046 | ||
1013 | QPtrList<Todo> KOTodoView::selectedTodos() | 1047 | QPtrList<Todo> KOTodoView::selectedTodos() |
1014 | { | 1048 | { |
1015 | QPtrList<Todo> selected; | 1049 | QPtrList<Todo> selected; |
1016 | 1050 | ||
1017 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); | 1051 | KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); |
1018 | // if (!item) item = mActiveItem; | 1052 | // if (!item) item = mActiveItem; |
1019 | if (item) selected.append(item->todo()); | 1053 | if (item) selected.append(item->todo()); |
1020 | 1054 | ||
1021 | return selected; | 1055 | return selected; |
1022 | } | 1056 | } |
1023 | 1057 | ||
1024 | void KOTodoView::changeEventDisplay(Event *, int) | 1058 | void KOTodoView::changeEventDisplay(Event *, int) |
1025 | { | 1059 | { |
1026 | updateView(); | 1060 | updateView(); |
1027 | } | 1061 | } |
1028 | 1062 | ||
1029 | void KOTodoView::showDates(const QDate &, const QDate &) | 1063 | void KOTodoView::showDates(const QDate &, const QDate &) |
1030 | { | 1064 | { |
1031 | } | 1065 | } |
1032 | 1066 | ||
1033 | void KOTodoView::showEvents(QPtrList<Event>) | 1067 | void KOTodoView::showEvents(QPtrList<Event>) |
1034 | { | 1068 | { |
1035 | kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; | 1069 | kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; |
1036 | } | 1070 | } |
1037 | 1071 | ||
1038 | void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 1072 | void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
1039 | const QDate &td) | 1073 | const QDate &td) |
1040 | { | 1074 | { |
1041 | #ifndef KORG_NOPRINTER | 1075 | #ifndef KORG_NOPRINTER |
1042 | calPrinter->preview(CalPrinter::Todolist, fd, td); | 1076 | calPrinter->preview(CalPrinter::Todolist, fd, td); |
1043 | #endif | 1077 | #endif |
1044 | } | 1078 | } |
1045 | 1079 | ||
1046 | void KOTodoView::editItem(QListViewItem *item ) | 1080 | void KOTodoView::editItem(QListViewItem *item ) |
1047 | { | 1081 | { |
1048 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); | 1082 | emit editTodoSignal(((KOTodoViewItem *)item)->todo()); |
1049 | } | 1083 | } |
1050 | 1084 | ||
1051 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) | 1085 | void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) |
1052 | { | 1086 | { |
1053 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); | 1087 | emit showTodoSignal(((KOTodoViewItem *)item)->todo()); |
1054 | } | 1088 | } |
1055 | 1089 | ||
1056 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) | 1090 | void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column) |
1057 | { | 1091 | { |
1058 | pendingSubtodo = 0; | 1092 | pendingSubtodo = 0; |
1059 | mActiveItem = (KOTodoViewItem *)item; | 1093 | mActiveItem = (KOTodoViewItem *)item; |
1060 | if (item) { | 1094 | if (item) { |
1061 | switch (column){ | 1095 | switch (column){ |
1062 | case 1: | 1096 | case 1: |
1063 | mPriorityPopupMenu->popup(QCursor::pos ()); break; | 1097 | mPriorityPopupMenu->popup(QCursor::pos ()); break; |
1064 | case 2: | 1098 | case 2: |
1065 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; | 1099 | mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; |
1066 | case 3: | 1100 | case 3: |
1067 | moveTodo(); | 1101 | moveTodo(); |
1068 | break; | 1102 | break; |
1069 | case 8: | 1103 | case 8: |
1070 | mCategoryPopupMenu->popup(QCursor::pos ()); break; | 1104 | mCategoryPopupMenu->popup(QCursor::pos ()); break; |
1071 | case 9: | 1105 | case 9: |
1072 | mCalPopupMenu->popup(QCursor::pos ()); break; | 1106 | mCalPopupMenu->popup(QCursor::pos ()); break; |
1073 | default: | 1107 | default: |
1074 | mItemPopupMenu->popup(QCursor::pos()); | 1108 | mItemPopupMenu->popup(QCursor::pos()); |
1075 | } | 1109 | } |
1076 | } else mPopupMenu->popup(QCursor::pos()); | 1110 | } else mPopupMenu->popup(QCursor::pos()); |
1077 | } | 1111 | } |
1078 | void KOTodoView::newTodo() | 1112 | void KOTodoView::newTodo() |
1079 | { | 1113 | { |
1080 | emit newTodoSignal(); | 1114 | emit newTodoSignal(); |
1081 | } | 1115 | } |
1082 | 1116 | ||
1083 | void KOTodoView::newSubTodo() | 1117 | void KOTodoView::newSubTodo() |
1084 | { | 1118 | { |
1119 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | ||
1085 | if (mActiveItem) { | 1120 | if (mActiveItem) { |
1086 | emit newSubTodoSignal(mActiveItem->todo()); | 1121 | if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add a new Todo") ) { |
1122 | addQuickTodoPar( mActiveItem->todo()); | ||
1123 | } else | ||
1124 | emit newSubTodoSignal(mActiveItem->todo()); | ||
1087 | } | 1125 | } |
1088 | } | 1126 | } |
1089 | void KOTodoView::unparentTodo() | 1127 | void KOTodoView::unparentTodo() |
1090 | { | 1128 | { |
1091 | if (mActiveItem) { | 1129 | if (mActiveItem) { |
1092 | emit unparentTodoSignal(mActiveItem->todo()); | 1130 | emit unparentTodoSignal(mActiveItem->todo()); |
1093 | } | 1131 | } |
1094 | } | 1132 | } |
1095 | 1133 | ||
1096 | void KOTodoView::reparentTodo() | 1134 | void KOTodoView::reparentTodo() |
1097 | { | 1135 | { |
1098 | if (mActiveItem) { | 1136 | if (mActiveItem) { |
1099 | topLevelWidget()->setCaption(i18n("Click on new parent item")); | 1137 | topLevelWidget()->setCaption(i18n("Click on new parent item")); |
1100 | pendingSubtodo = mActiveItem; | 1138 | pendingSubtodo = mActiveItem; |
1101 | } | 1139 | } |
1102 | } | 1140 | } |
1103 | void KOTodoView::editTodo() | 1141 | void KOTodoView::editTodo() |
1104 | { | 1142 | { |
1105 | if (mActiveItem) { | 1143 | if (mActiveItem) { |
1106 | emit editTodoSignal(mActiveItem->todo()); | 1144 | emit editTodoSignal(mActiveItem->todo()); |
1107 | } | 1145 | } |
1108 | } | 1146 | } |
1109 | void KOTodoView::cloneTodo() | 1147 | void KOTodoView::cloneTodo() |
1110 | { | 1148 | { |
1111 | if (mActiveItem) { | 1149 | if (mActiveItem) { |
1112 | emit cloneTodoSignal((Incidence*)mActiveItem->todo()); | 1150 | emit cloneTodoSignal((Incidence*)mActiveItem->todo()); |
1113 | } | 1151 | } |
1114 | } | 1152 | } |
1115 | void KOTodoView::cancelTodo() | 1153 | void KOTodoView::cancelTodo() |
1116 | { | 1154 | { |
1117 | if (mActiveItem) { | 1155 | if (mActiveItem) { |
1118 | emit cancelTodoSignal((Incidence*)mActiveItem->todo()); | 1156 | emit cancelTodoSignal((Incidence*)mActiveItem->todo()); |
1119 | } | 1157 | } |
1120 | } | 1158 | } |
1121 | void KOTodoView::moveTodo() | 1159 | void KOTodoView::moveTodo() |
1122 | { | 1160 | { |
1123 | if (mActiveItem) { | 1161 | if (mActiveItem) { |
1124 | emit moveTodoSignal((Incidence*)mActiveItem->todo()); | 1162 | emit moveTodoSignal((Incidence*)mActiveItem->todo()); |
1125 | } | 1163 | } |
1126 | } | 1164 | } |
1127 | void KOTodoView::beamTodo() | 1165 | void KOTodoView::beamTodo() |
1128 | { | 1166 | { |
1129 | if (mActiveItem) { | 1167 | if (mActiveItem) { |
1130 | emit beamTodoSignal((Incidence*)mActiveItem->todo()); | 1168 | emit beamTodoSignal((Incidence*)mActiveItem->todo()); |
1131 | } | 1169 | } |
1132 | } | 1170 | } |
1133 | 1171 | ||
1134 | 1172 | ||
1135 | void KOTodoView::showTodo() | 1173 | void KOTodoView::showTodo() |
1136 | { | 1174 | { |
1137 | if (mActiveItem) { | 1175 | if (mActiveItem) { |
1138 | emit showTodoSignal(mActiveItem->todo()); | 1176 | emit showTodoSignal(mActiveItem->todo()); |
1139 | } | 1177 | } |
1140 | } | 1178 | } |
1141 | 1179 | ||
1142 | void KOTodoView::deleteTodo() | 1180 | void KOTodoView::deleteTodo() |
1143 | { | 1181 | { |
1144 | if (mActiveItem) { | 1182 | if (mActiveItem) { |
1145 | emit deleteTodoSignal(mActiveItem->todo()); | 1183 | emit deleteTodoSignal(mActiveItem->todo()); |
1146 | } | 1184 | } |
1147 | } | 1185 | } |
1148 | 1186 | ||
1149 | void KOTodoView::setNewPriority(int index) | 1187 | void KOTodoView::setNewPriority(int index) |
1150 | { | 1188 | { |
1151 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 1189 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
1152 | mActiveItem->todo()->setPriority(mPriority[index]); | 1190 | mActiveItem->todo()->setPriority(mPriority[index]); |
1153 | mActiveItem->construct(); | 1191 | mActiveItem->construct(); |
1154 | todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); | 1192 | todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); |
1155 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1193 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1156 | } | 1194 | } |
1157 | processSelectionChange(); | 1195 | processSelectionChange(); |
1158 | } | 1196 | } |
1159 | 1197 | ||
1160 | void KOTodoView::setNewPercentage(int index) | 1198 | void KOTodoView::setNewPercentage(int index) |
1161 | { | 1199 | { |
1162 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 1200 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
1163 | 1201 | ||
1164 | if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { | 1202 | if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { |
1165 | mActiveItem->setOn( true ); | 1203 | mActiveItem->setOn( true ); |
1166 | processSelectionChange(); | 1204 | processSelectionChange(); |
1167 | return; | 1205 | return; |
1168 | } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { | 1206 | } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { |
1169 | KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); | 1207 | KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); |
1170 | if ( par && par->isOn() ) | 1208 | if ( par && par->isOn() ) |
1171 | par->setOn( false ); | 1209 | par->setOn( false ); |
1172 | } | 1210 | } |
1173 | if (mPercentage[index] == 100) { | 1211 | if (mPercentage[index] == 100) { |
1174 | mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); | 1212 | mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); |
1175 | } else { | 1213 | } else { |
1176 | mActiveItem->todo()->setCompleted(false); | 1214 | mActiveItem->todo()->setCompleted(false); |
1177 | } | 1215 | } |
1178 | mActiveItem->todo()->setPercentComplete(mPercentage[index]); | 1216 | mActiveItem->todo()->setPercentComplete(mPercentage[index]); |
1179 | mActiveItem->construct(); | 1217 | mActiveItem->construct(); |
1180 | todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); | 1218 | todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); |
1181 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1219 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1182 | } | 1220 | } |
1183 | processSelectionChange(); | 1221 | processSelectionChange(); |
1184 | } | 1222 | } |
1185 | 1223 | ||
1186 | void KOTodoView::fillCategories () | 1224 | void KOTodoView::fillCategories () |
1187 | { | 1225 | { |
1188 | mCategoryPopupMenu->clear(); | 1226 | mCategoryPopupMenu->clear(); |
1189 | if ( ! mActiveItem ) return; | 1227 | if ( ! mActiveItem ) return; |
1190 | QStringList checkedCategories = mActiveItem->todo()->categories (); | 1228 | QStringList checkedCategories = mActiveItem->todo()->categories (); |
1191 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); | 1229 | for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); |
1192 | it != KOPrefs::instance()->mCustomCategories.end (); | 1230 | it != KOPrefs::instance()->mCustomCategories.end (); |
1193 | ++it) { | 1231 | ++it) { |
1194 | int index = mCategoryPopupMenu->insertItem (*it); | 1232 | int index = mCategoryPopupMenu->insertItem (*it); |
1195 | mCategory[index] = *it; | 1233 | mCategory[index] = *it; |
1196 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); | 1234 | if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); |
1197 | } | 1235 | } |
1198 | } | 1236 | } |
1199 | void KOTodoView::fillCal () | 1237 | void KOTodoView::fillCal () |
1200 | { | 1238 | { |
1201 | mCalPopupMenu->clear(); | 1239 | mCalPopupMenu->clear(); |
1202 | if (!mActiveItem) return; | 1240 | if (!mActiveItem) return; |
1203 | bool readO = mActiveItem->todo()->isReadOnly(); | 1241 | bool readO = mActiveItem->todo()->isReadOnly(); |
1204 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 1242 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
1205 | while ( kkf ) { | 1243 | while ( kkf ) { |
1206 | int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); | 1244 | int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); |
1207 | if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) | 1245 | if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) |
1208 | mCalPopupMenu->setItemEnabled( index, false ); | 1246 | mCalPopupMenu->setItemEnabled( index, false ); |
1209 | mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID()); | 1247 | mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID()); |
1210 | kkf = KOPrefs::instance()->mCalendars.next(); | 1248 | kkf = KOPrefs::instance()->mCalendars.next(); |
1211 | } | 1249 | } |
1212 | } | 1250 | } |
1213 | void KOTodoView::changedCal (int index ) | 1251 | void KOTodoView::changedCal (int index ) |
1214 | { | 1252 | { |
1215 | if (!mActiveItem) return; | 1253 | if (!mActiveItem) return; |
1216 | mActiveItem->todo()->setCalID( index ); | 1254 | mActiveItem->todo()->setCalID( index ); |
1217 | mActiveItem->construct(); | 1255 | mActiveItem->construct(); |
1218 | } | 1256 | } |
1219 | void KOTodoView::changedCategories(int index) | 1257 | void KOTodoView::changedCategories(int index) |
1220 | { | 1258 | { |
1221 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { | 1259 | if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { |
1222 | QStringList categories = mActiveItem->todo()->categories (); | 1260 | QStringList categories = mActiveItem->todo()->categories (); |
1223 | QString colcat = categories.first(); | 1261 | QString colcat = categories.first(); |
1224 | if (categories.find (mCategory[index]) != categories.end ()) | 1262 | if (categories.find (mCategory[index]) != categories.end ()) |
1225 | categories.remove (mCategory[index]); | 1263 | categories.remove (mCategory[index]); |
1226 | else | 1264 | else |
1227 | categories.insert (categories.end(), mCategory[index]); | 1265 | categories.insert (categories.end(), mCategory[index]); |
1228 | categories.sort (); | 1266 | categories.sort (); |
1229 | if ( !colcat.isEmpty() ) { | 1267 | if ( !colcat.isEmpty() ) { |
1230 | if ( categories.find ( colcat ) != categories.end () ) { | 1268 | if ( categories.find ( colcat ) != categories.end () ) { |
1231 | categories.remove( colcat ); | 1269 | categories.remove( colcat ); |
1232 | categories.prepend( colcat ); | 1270 | categories.prepend( colcat ); |
1233 | } | 1271 | } |
1234 | } | 1272 | } |
1235 | mActiveItem->todo()->setCategories (categories); | 1273 | mActiveItem->todo()->setCategories (categories); |
1236 | mActiveItem->construct(); | 1274 | mActiveItem->construct(); |
1237 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1275 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1238 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); | 1276 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); |
1239 | } | 1277 | } |
1240 | } | 1278 | } |
1241 | void KOTodoView::itemDoubleClicked(QListViewItem *item) | 1279 | void KOTodoView::itemDoubleClicked(QListViewItem *item) |
1242 | { | 1280 | { |
1243 | if ( pendingSubtodo != 0 ) { | 1281 | if ( pendingSubtodo != 0 ) { |
1244 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1282 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1245 | } | 1283 | } |
1246 | pendingSubtodo = 0; | 1284 | pendingSubtodo = 0; |
1247 | //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); | 1285 | //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); |
1248 | int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); | 1286 | int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); |
1249 | //qDebug("ROW %d ", row); | 1287 | //qDebug("ROW %d ", row); |
1250 | if (!item) { | 1288 | if (!item) { |
1251 | newTodo(); | 1289 | newTodo(); |
1252 | return; | 1290 | return; |
1253 | } else { | 1291 | } else { |
1254 | if ( row == 1 ) { | 1292 | if ( row == 1 ) { |
1255 | mActiveItem = (KOTodoViewItem *) item; | 1293 | mActiveItem = (KOTodoViewItem *) item; |
1256 | newSubTodo(); | 1294 | newSubTodo(); |
1257 | return; | 1295 | return; |
1258 | } | 1296 | } |
1259 | if ( row == 5 || row == 6 || row == 2) { | 1297 | if ( row == 5 || row == 6 || row == 2) { |
1260 | mActiveItem = (KOTodoViewItem *) item; | 1298 | mActiveItem = (KOTodoViewItem *) item; |
1261 | Todo * t = mActiveItem->todo(); | 1299 | Todo * t = mActiveItem->todo(); |
1262 | if ( t->isRunning() ) { | 1300 | if ( t->isRunning() ) { |
1263 | if ( t->runTime() < 15) { | 1301 | if ( t->runTime() < 15) { |
1264 | t->stopRunning(); | 1302 | t->stopRunning(); |
1265 | mActiveItem->construct(); | 1303 | mActiveItem->construct(); |
1266 | topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); | 1304 | topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); |
1267 | return; | 1305 | return; |
1268 | } | 1306 | } |
1269 | else | 1307 | else |
1270 | toggleRunningItem(); | 1308 | toggleRunningItem(); |
1271 | return; | 1309 | return; |
1272 | } else { | 1310 | } else { |
1273 | t->setRunning( true ); | 1311 | t->setRunning( true ); |
1274 | mActiveItem->construct(); | 1312 | mActiveItem->construct(); |
1275 | topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); | 1313 | topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); |
1276 | return; | 1314 | return; |
1277 | } | 1315 | } |
1278 | } | 1316 | } |
1279 | } | 1317 | } |
1280 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 1318 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
1281 | editItem( item ); | 1319 | editItem( item ); |
1282 | else | 1320 | else |
1283 | showItem( item , QPoint(), 0 ); | 1321 | showItem( item , QPoint(), 0 ); |
1284 | } | 1322 | } |
1285 | void KOTodoView::toggleRunningItem() | 1323 | void KOTodoView::toggleRunningItem() |
1286 | { | 1324 | { |
1287 | // qDebug("KOTodoView::toggleRunning() "); | 1325 | // qDebug("KOTodoView::toggleRunning() "); |
1288 | if ( ! mActiveItem ) | 1326 | if ( ! mActiveItem ) |
1289 | return; | 1327 | return; |
1290 | Todo * t = mActiveItem->todo(); | 1328 | Todo * t = mActiveItem->todo(); |
1291 | if ( t->isRunning() ) { | 1329 | if ( t->isRunning() ) { |
1292 | KOStopTodoPrefs tp ( t, this ); | 1330 | KOStopTodoPrefs tp ( t, this ); |
1293 | if (QApplication::desktop()->width() <= 800 ){ | 1331 | if (QApplication::desktop()->width() <= 800 ){ |
1294 | int wid = tp.width(); | 1332 | int wid = tp.width(); |
1295 | int hei = tp.height(); | 1333 | int hei = tp.height(); |
1296 | int xx = (QApplication::desktop()->width()-wid)/2; | 1334 | int xx = (QApplication::desktop()->width()-wid)/2; |
1297 | int yy = (QApplication::desktop()->height()-hei)/2; | 1335 | int yy = (QApplication::desktop()->height()-hei)/2; |
1298 | tp.setGeometry( xx,yy,wid,hei ); | 1336 | tp.setGeometry( xx,yy,wid,hei ); |
1299 | } | 1337 | } |
1300 | tp.exec(); | 1338 | tp.exec(); |
1301 | mActiveItem->construct(); | 1339 | mActiveItem->construct(); |
1302 | } else { | 1340 | } else { |
1303 | KOStartTodoPrefs tp ( t->summary(), this ); | 1341 | KOStartTodoPrefs tp ( t->summary(), this ); |
1304 | if (QApplication::desktop()->width() <= 800 ){ | 1342 | if (QApplication::desktop()->width() <= 800 ){ |
1305 | int wid = tp.width(); | 1343 | int wid = tp.width(); |
1306 | int hei = tp.height(); | 1344 | int hei = tp.height(); |
1307 | int xx = (QApplication::desktop()->width()-wid)/2; | 1345 | int xx = (QApplication::desktop()->width()-wid)/2; |
1308 | int yy = (QApplication::desktop()->height()-hei)/2; | 1346 | int yy = (QApplication::desktop()->height()-hei)/2; |
1309 | tp.setGeometry( xx,yy,wid,hei ); | 1347 | tp.setGeometry( xx,yy,wid,hei ); |
1310 | } | 1348 | } |
1311 | if ( !tp.exec() ) return; | 1349 | if ( !tp.exec() ) return; |
1312 | if ( tp.stopAll() ) { | 1350 | if ( tp.stopAll() ) { |
1313 | mCalendar->stopAllTodos(); | 1351 | mCalendar->stopAllTodos(); |
1314 | t->setRunning( true ); | 1352 | t->setRunning( true ); |
1315 | updateView(); | 1353 | updateView(); |
1316 | } else { | 1354 | } else { |
1317 | t->setRunning( true ); | 1355 | t->setRunning( true ); |
1318 | mActiveItem->construct(); | 1356 | mActiveItem->construct(); |
1319 | } | 1357 | } |
1320 | } | 1358 | } |
1321 | } | 1359 | } |
1322 | 1360 | ||
1323 | void KOTodoView::itemClicked(QListViewItem *item) | 1361 | void KOTodoView::itemClicked(QListViewItem *item) |
1324 | { | 1362 | { |
1325 | //qDebug("KOTodoView::itemClicked %d", item); | 1363 | //qDebug("KOTodoView::itemClicked %d", item); |
1326 | if (!item) { | 1364 | if (!item) { |
1327 | if ( pendingSubtodo != 0 ) { | 1365 | if ( pendingSubtodo != 0 ) { |
1328 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1366 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1329 | } | 1367 | } |
1330 | pendingSubtodo = 0; | 1368 | pendingSubtodo = 0; |
1331 | return; | 1369 | return; |
1332 | } | 1370 | } |
1333 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1371 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1334 | if ( pendingSubtodo != 0 ) { | 1372 | if ( pendingSubtodo != 0 ) { |
1335 | bool allowReparent = true; | 1373 | bool allowReparent = true; |
1336 | QListViewItem *par = item; | 1374 | QListViewItem *par = item; |
1337 | while ( par ) { | 1375 | while ( par ) { |
1338 | if ( par == pendingSubtodo ) { | 1376 | if ( par == pendingSubtodo ) { |
1339 | allowReparent = false; | 1377 | allowReparent = false; |
1340 | break; | 1378 | break; |
1341 | } | 1379 | } |
1342 | par = par->parent(); | 1380 | par = par->parent(); |
1343 | } | 1381 | } |
1344 | if ( !allowReparent ) { | 1382 | if ( !allowReparent ) { |
1345 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); | 1383 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); |
1346 | pendingSubtodo = 0; | 1384 | pendingSubtodo = 0; |
1347 | } else { | 1385 | } else { |
1348 | Todo* newParent = todoItem->todo(); | 1386 | Todo* newParent = todoItem->todo(); |
1349 | Todo* newSub = pendingSubtodo->todo(); | 1387 | Todo* newSub = pendingSubtodo->todo(); |
1350 | pendingSubtodo = 0; | 1388 | pendingSubtodo = 0; |
1351 | emit reparentTodoSignal( newParent,newSub ); | 1389 | emit reparentTodoSignal( newParent,newSub ); |
1352 | return; | 1390 | return; |
1353 | } | 1391 | } |
1354 | } | 1392 | } |
1355 | 1393 | ||
1356 | } | 1394 | } |
1357 | 1395 | ||
1358 | void KOTodoView::setDocumentId( const QString &id ) | 1396 | void KOTodoView::setDocumentId( const QString &id ) |
1359 | { | 1397 | { |
1360 | 1398 | ||
1361 | mDocPrefs->setDoc( id ); | 1399 | mDocPrefs->setDoc( id ); |
1362 | } | 1400 | } |
1363 | 1401 | ||
1364 | void KOTodoView::itemStateChanged( QListViewItem *item ) | 1402 | void KOTodoView::itemStateChanged( QListViewItem *item ) |
1365 | { | 1403 | { |
1366 | if (!item) return; | 1404 | if (!item) return; |
1367 | 1405 | ||
1368 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1406 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1369 | 1407 | ||
1370 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; | 1408 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; |
1371 | 1409 | ||
1372 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); | 1410 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); |
1373 | } | 1411 | } |
1374 | 1412 | ||
1375 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const | 1413 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const |
1376 | { | 1414 | { |
1377 | mTodoListView->saveLayout(config,group); | 1415 | mTodoListView->saveLayout(config,group); |
1378 | } | 1416 | } |
1379 | 1417 | ||
1380 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) | 1418 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) |
1381 | { | 1419 | { |
1382 | mTodoListView->restoreLayout(config,group); | 1420 | mTodoListView->restoreLayout(config,group); |
1383 | } | 1421 | } |
1384 | 1422 | ||
1385 | void KOTodoView::processSelectionChange() | 1423 | void KOTodoView::processSelectionChange() |
1386 | { | 1424 | { |
1387 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; | 1425 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; |
1388 | 1426 | ||
1389 | KOTodoViewItem *item = | 1427 | KOTodoViewItem *item = |
1390 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); | 1428 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); |
1391 | 1429 | ||
1392 | if ( !item ) { | 1430 | if ( !item ) { |
1393 | emit incidenceSelected( 0 ); | 1431 | emit incidenceSelected( 0 ); |
1432 | mNewSubBut->setEnabled( false ); | ||
1394 | } else { | 1433 | } else { |
1395 | emit incidenceSelected( item->todo() ); | 1434 | emit incidenceSelected( item->todo() ); |
1435 | mNewSubBut->setEnabled( true ); | ||
1396 | } | 1436 | } |
1397 | } | 1437 | } |
1398 | 1438 | ||
1399 | void KOTodoView::modified(bool b) | 1439 | void KOTodoView::modified(bool b) |
1400 | { | 1440 | { |
1401 | emit isModified(b); | 1441 | emit isModified(b); |
1402 | } | 1442 | } |
1403 | void KOTodoView::setTodoModified( Todo* todo ) | 1443 | void KOTodoView::setTodoModified( Todo* todo ) |
1404 | { | 1444 | { |
1405 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); | 1445 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); |
1406 | } | 1446 | } |
1407 | void KOTodoView::clearSelection() | 1447 | void KOTodoView::clearSelection() |
1408 | { | 1448 | { |
1409 | mTodoListView->selectAll( false ); | 1449 | mTodoListView->selectAll( false ); |
1410 | } | 1450 | } |
1411 | void KOTodoView::setAllOpen() | 1451 | void KOTodoView::setAllOpen() |
1412 | { | 1452 | { |
1413 | if ( isFlatDisplay ) { | 1453 | if ( isFlatDisplay ) { |
1414 | isFlatDisplay = false; | 1454 | isFlatDisplay = false; |
1415 | mPopupMenu->setItemChecked( 8,false ); | 1455 | mPopupMenu->setItemChecked( 8,false ); |
1416 | updateView(); | 1456 | updateView(); |
1417 | } else { | 1457 | } else { |
1418 | storeCurrentItem(); | 1458 | storeCurrentItem(); |
1419 | } | 1459 | } |
1420 | setOpen(mTodoListView->firstChild(), true); | 1460 | setOpen(mTodoListView->firstChild(), true); |
1421 | resetCurrentItem(); | 1461 | resetCurrentItem(); |
1422 | } | 1462 | } |
1423 | void KOTodoView::setAllClose() | 1463 | void KOTodoView::setAllClose() |
1424 | { | 1464 | { |
1425 | if ( isFlatDisplay ) { | 1465 | if ( isFlatDisplay ) { |
1426 | isFlatDisplay = false; | 1466 | isFlatDisplay = false; |
1427 | mPopupMenu->setItemChecked( 8,false ); | 1467 | mPopupMenu->setItemChecked( 8,false ); |
1428 | updateView(); | 1468 | updateView(); |
1429 | } else { | 1469 | } else { |
1430 | storeCurrentItem(); | 1470 | storeCurrentItem(); |
1431 | } | 1471 | } |
1432 | setOpen(mTodoListView->firstChild(), false); | 1472 | setOpen(mTodoListView->firstChild(), false); |
1433 | resetCurrentItem(); | 1473 | resetCurrentItem(); |
1434 | } | 1474 | } |
1435 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) | 1475 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) |
1436 | { | 1476 | { |
1437 | 1477 | ||
1438 | while ( item ) { | 1478 | while ( item ) { |
1439 | setOpen( item->firstChild(), setOpenI ); | 1479 | setOpen( item->firstChild(), setOpenI ); |
1440 | item->setOpen( setOpenI ); | 1480 | item->setOpen( setOpenI ); |
1441 | item = item->nextSibling(); | 1481 | item = item->nextSibling(); |
1442 | } | 1482 | } |
1443 | } | 1483 | } |
1444 | 1484 | ||
1445 | void KOTodoView::displayAllFlat() | 1485 | void KOTodoView::displayAllFlat() |
1446 | { | 1486 | { |
1447 | storeCurrentItem(); | 1487 | storeCurrentItem(); |
1448 | pendingSubtodo = 0; | 1488 | pendingSubtodo = 0; |
1449 | if ( mBlockUpdate ) { | 1489 | if ( mBlockUpdate ) { |
1450 | return; | 1490 | return; |
1451 | } | 1491 | } |
1452 | mPopupMenu->setItemChecked( 8,true ); | 1492 | mPopupMenu->setItemChecked( 8,true ); |
1453 | isFlatDisplay = true; | 1493 | isFlatDisplay = true; |
1454 | QPtrList<Todo> todoList = calendar()->todos(); | 1494 | QPtrList<Todo> todoList = calendar()->todos(); |
1455 | mTodoMap.clear(); | 1495 | mTodoMap.clear(); |
1456 | mTodoListView->clear(); | 1496 | mTodoListView->clear(); |
1457 | Todo *todo; | 1497 | Todo *todo; |
1458 | for(todo = todoList.first(); todo; todo = todoList.next()) { | 1498 | for(todo = todoList.first(); todo; todo = todoList.next()) { |
1459 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 1499 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
1460 | mTodoMap.insert(todo,todoItem); | 1500 | mTodoMap.insert(todo,todoItem); |
1461 | } | 1501 | } |
1462 | resetCurrentItem(); | 1502 | resetCurrentItem(); |
1463 | } | 1503 | } |
1464 | 1504 | ||
1465 | void KOTodoView::setAllFlat() | 1505 | void KOTodoView::setAllFlat() |
1466 | { | 1506 | { |
1467 | if ( isFlatDisplay ) { | 1507 | if ( isFlatDisplay ) { |
1468 | isFlatDisplay = false; | 1508 | isFlatDisplay = false; |
1469 | mPopupMenu->setItemChecked( 8,false ); | 1509 | mPopupMenu->setItemChecked( 8,false ); |
1470 | updateView(); | 1510 | updateView(); |
1471 | return; | 1511 | return; |
1472 | } | 1512 | } |
1473 | displayAllFlat(); | 1513 | displayAllFlat(); |
1474 | } | 1514 | } |
1475 | 1515 | ||
1476 | void KOTodoView::purgeCompleted() | 1516 | void KOTodoView::purgeCompleted() |
1477 | { | 1517 | { |
1478 | emit purgeCompletedSignal(); | 1518 | emit purgeCompletedSignal(); |
1479 | 1519 | ||
1480 | } | 1520 | } |
1481 | void KOTodoView::toggleQuickTodo() | 1521 | void KOTodoView::toggleQuickTodo() |
1482 | { | 1522 | { |
1483 | if ( mQuickAdd->isVisible() ) { | 1523 | if ( mQuickBar->isVisible() ) { |
1484 | mQuickAdd->hide(); | 1524 | mQuickBar->hide(); |
1485 | KOPrefs::instance()->mEnableQuickTodo = false; | 1525 | KOPrefs::instance()->mEnableQuickTodo = false; |
1486 | } | 1526 | } |
1487 | else { | 1527 | else { |
1488 | mQuickAdd->show(); | 1528 | mQuickBar->show(); |
1489 | KOPrefs::instance()->mEnableQuickTodo = true; | 1529 | KOPrefs::instance()->mEnableQuickTodo = true; |
1490 | } | 1530 | } |
1491 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 1531 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
1492 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 1532 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
1493 | } | 1533 | } |
1494 | 1534 | ||
1495 | void KOTodoView::toggleRunning() | 1535 | void KOTodoView::toggleRunning() |
1496 | { | 1536 | { |
1497 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; | 1537 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; |
1498 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 1538 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
1499 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 1539 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
1500 | updateView(); | 1540 | updateView(); |
1541 | if ( KOPrefs::instance()->mHideNonStartedTodos ) | ||
1542 | topLevelWidget()->setCaption(i18n("Hide not Running")); | ||
1543 | else | ||
1544 | topLevelWidget()->setCaption(i18n("Show not Running")); | ||
1501 | } | 1545 | } |
1502 | 1546 | ||
1503 | void KOTodoView::toggleCompleted() | 1547 | void KOTodoView::toggleCompleted() |
1504 | { | 1548 | { |
1505 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; | 1549 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; |
1506 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 1550 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
1507 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 1551 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
1508 | updateView(); | 1552 | updateView(); |
1553 | if ( KOPrefs::instance()->mShowCompletedTodo ) | ||
1554 | topLevelWidget()->setCaption(i18n("Show Completed")); | ||
1555 | else | ||
1556 | topLevelWidget()->setCaption(i18n("Hide Completed")); | ||
1509 | } | 1557 | } |
1510 | 1558 | ||
1511 | void KOTodoView::addQuickTodo() | 1559 | void KOTodoView::addQuickTodo() |
1512 | { | 1560 | { |
1513 | Todo *todo = new Todo(); | 1561 | addQuickTodoPar( 0 ); |
1514 | todo->setSummary(mQuickAdd->text()); | ||
1515 | todo->setOrganizer(KOPrefs::instance()->email()); | ||
1516 | CalFilter * cf = mCalendar->filter(); | ||
1517 | if ( cf ) { | ||
1518 | if ( cf->isEnabled()&& cf->showCategories()) { | ||
1519 | todo->setCategories(cf->categoryList()); | ||
1520 | } | ||
1521 | if ( cf->isEnabled() ) | ||
1522 | todo->setSecrecy( cf->getSecrecy()); | ||
1523 | } | ||
1524 | mCalendar->addTodo(todo); | ||
1525 | mQuickAdd->setText(""); | ||
1526 | todoModified (todo, KOGlobals::EVENTADDED ); | ||
1527 | updateView(); | ||
1528 | } | 1562 | } |
1563 | void KOTodoView::addQuickTodoPar( Todo * parentTodo) | ||
1564 | { | ||
1565 | Todo *todo = new Todo(); | ||
1566 | todo->setSummary(mQuickAdd->text()); | ||
1567 | todo->setOrganizer(KOPrefs::instance()->email()); | ||
1568 | if ( parentTodo ) { | ||
1569 | todo->setRelatedTo(parentTodo); | ||
1570 | |||
1571 | todo->setCategories (parentTodo->categoriesStr ()); | ||
1572 | todo->setSecrecy (parentTodo->secrecy ()); | ||
1573 | if ( parentTodo->priority() < 3 ) | ||
1574 | todo->setPriority( parentTodo->priority() ); | ||
1575 | todo->setCalID( parentTodo->calID() ); | ||
1576 | } else { | ||
1577 | CalFilter * cf = mCalendar->filter(); | ||
1578 | if ( cf ) { | ||
1579 | if ( cf->isEnabled()&& cf->showCategories()) { | ||
1580 | todo->setCategories(cf->categoryList()); | ||
1581 | } | ||
1582 | if ( cf->isEnabled() ) | ||
1583 | todo->setSecrecy( cf->getSecrecy()); | ||
1584 | } | ||
1585 | } | ||
1586 | mCalendar->addTodo(todo); | ||
1587 | mQuickAdd->setText(""); | ||
1588 | todoModified (todo, KOGlobals::EVENTADDED ); | ||
1589 | updateView(); | ||
1529 | 1590 | ||
1591 | } | ||
1530 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 1592 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
1531 | { | 1593 | { |
1532 | // e->ignore(); | 1594 | // e->ignore(); |
1533 | //return; | 1595 | //return; |
1534 | //qDebug("KOTodoView::keyPressEvent "); | 1596 | //qDebug("KOTodoView::keyPressEvent "); |
1535 | switch ( e->key() ) { | 1597 | switch ( e->key() ) { |
1536 | case Qt::Key_Down: | 1598 | case Qt::Key_Down: |
1537 | case Qt::Key_Up: | 1599 | case Qt::Key_Up: |
1538 | QWidget::keyPressEvent ( e ); | 1600 | QWidget::keyPressEvent ( e ); |
1539 | break; | 1601 | break; |
1540 | 1602 | ||
1541 | case Qt::Key_Q: | 1603 | case Qt::Key_Q: |
1542 | toggleQuickTodo(); | 1604 | toggleQuickTodo(); |
1543 | break; | 1605 | break; |
1544 | case Qt::Key_U: | 1606 | case Qt::Key_U: |
1545 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1607 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1546 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1608 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1547 | unparentTodo(); | 1609 | unparentTodo(); |
1548 | e->accept(); | 1610 | e->accept(); |
1549 | } else | 1611 | } else |
1550 | e->ignore(); | 1612 | e->ignore(); |
1551 | break; | 1613 | break; |
1552 | case Qt::Key_S: | 1614 | case Qt::Key_S: |
1553 | if ( e->state() == Qt::ControlButton ) { | 1615 | if ( e->state() == Qt::ControlButton ) { |
1554 | e->ignore(); | 1616 | e->ignore(); |
1555 | break; | 1617 | break; |
1556 | } | 1618 | } |
1557 | if ( e->state() == Qt::ShiftButton ) { | 1619 | if ( e->state() == Qt::ShiftButton ) { |
1558 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1620 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1559 | reparentTodo(); | 1621 | reparentTodo(); |
1560 | e->accept(); | 1622 | e->accept(); |
1561 | } else | 1623 | } else |
1562 | e->ignore(); | 1624 | e->ignore(); |
1563 | break; | 1625 | break; |
1564 | case Qt::Key_P: | 1626 | case Qt::Key_P: |
1565 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1627 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1566 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1628 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1567 | if ( pendingSubtodo ) | 1629 | if ( pendingSubtodo ) |
1568 | itemClicked(mActiveItem); | 1630 | itemClicked(mActiveItem); |
1569 | e->accept(); | 1631 | e->accept(); |
1570 | } else | 1632 | } else |
1571 | e->ignore(); | 1633 | e->ignore(); |
1572 | break; | 1634 | break; |
1573 | case Qt::Key_Escape: | 1635 | case Qt::Key_Escape: |
1574 | if ( pendingSubtodo ) { | 1636 | if ( pendingSubtodo ) { |
1575 | itemClicked(0); | 1637 | itemClicked(0); |
1576 | e->accept(); | 1638 | e->accept(); |
1577 | } else | 1639 | } else |
1578 | e->ignore(); | 1640 | e->ignore(); |
1579 | break; | 1641 | break; |
1580 | default: | 1642 | default: |
1581 | e->ignore(); | 1643 | e->ignore(); |
1582 | } | 1644 | } |
1583 | 1645 | ||
1584 | if ( true ) { | 1646 | if ( true ) { |
1585 | if ( e->key() == Qt::Key_I ) { | 1647 | if ( e->key() == Qt::Key_I ) { |
1586 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); | 1648 | KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); |
1587 | if ( cn ) { | 1649 | if ( cn ) { |
1588 | mActiveItem = cn; | 1650 | mActiveItem = cn; |
1589 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); | 1651 | KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); |
1590 | if ( ci ){ | 1652 | if ( ci ){ |
1591 | showTodo(); | 1653 | showTodo(); |
1592 | cn = (KOTodoViewItem*)cn->itemBelow(); | 1654 | cn = (KOTodoViewItem*)cn->itemBelow(); |
1593 | if ( cn ) { | 1655 | if ( cn ) { |
1594 | mTodoListView->setCurrentItem ( cn ); | 1656 | mTodoListView->setCurrentItem ( cn ); |
1595 | mTodoListView->ensureItemVisible ( cn ); | 1657 | mTodoListView->ensureItemVisible ( cn ); |
1596 | } | 1658 | } |
1597 | 1659 | ||
1598 | } | 1660 | } |
1599 | } | 1661 | } |
1600 | e->accept(); | 1662 | e->accept(); |
1601 | 1663 | ||
1602 | } | 1664 | } |
1603 | 1665 | ||
1604 | } | 1666 | } |
1605 | 1667 | ||
1606 | } | 1668 | } |
1607 | void KOTodoView::updateTodo( Todo * t, int type ) | 1669 | void KOTodoView::updateTodo( Todo * t, int type ) |
1608 | { | 1670 | { |
1609 | if ( mBlockUpdate) | 1671 | if ( mBlockUpdate) |
1610 | return; | 1672 | return; |
1611 | 1673 | ||
1612 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; | 1674 | QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; |
1613 | itemIterator = mTodoMap.find(t); | 1675 | itemIterator = mTodoMap.find(t); |
1614 | if (itemIterator != mTodoMap.end()) { | 1676 | if (itemIterator != mTodoMap.end()) { |
1615 | (*itemIterator)->construct(); | 1677 | (*itemIterator)->construct(); |
1616 | } else { | 1678 | } else { |
1617 | if ( type == KOGlobals::EVENTADDED ) { | 1679 | if ( type == KOGlobals::EVENTADDED ) { |
1618 | insertTodoItem( t ); | 1680 | insertTodoItem( t ); |
1619 | } | 1681 | } |
1620 | } | 1682 | } |
1621 | 1683 | ||
1622 | } | 1684 | } |
1623 | 1685 | ||
1624 | void KOTodoView::todoModified(Todo * t , int p ) | 1686 | void KOTodoView::todoModified(Todo * t , int p ) |
1625 | { | 1687 | { |
1626 | mBlockUpdate = true; | 1688 | mBlockUpdate = true; |
1627 | emit todoModifiedSignal ( t, p ); | 1689 | emit todoModifiedSignal ( t, p ); |
1628 | mBlockUpdate = false; | 1690 | mBlockUpdate = false; |
1629 | } | 1691 | } |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 79cc756..a8e90e2 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -65,241 +65,244 @@ class KOStopTodoPrefs : public QDialog | |||
65 | KOStopTodoPrefs( Todo* todo, QWidget *parent=0, const char *name=0 ) ; | 65 | KOStopTodoPrefs( Todo* todo, QWidget *parent=0, const char *name=0 ) ; |
66 | 66 | ||
67 | 67 | ||
68 | private slots: | 68 | private slots: |
69 | void doNotSave(); | 69 | void doNotSave(); |
70 | void accept(); | 70 | void accept(); |
71 | private: | 71 | private: |
72 | Todo* mTodo; | 72 | Todo* mTodo; |
73 | QLineEdit* mComment; | 73 | QLineEdit* mComment; |
74 | KDateEdit *sde, *ede; | 74 | KDateEdit *sde, *ede; |
75 | KOTimeEdit *ste, *ete; | 75 | KOTimeEdit *ste, *ete; |
76 | 76 | ||
77 | }; | 77 | }; |
78 | 78 | ||
79 | class KOStartTodoPrefs : public QDialog | 79 | class KOStartTodoPrefs : public QDialog |
80 | { | 80 | { |
81 | Q_OBJECT | 81 | Q_OBJECT |
82 | public: | 82 | public: |
83 | KOStartTodoPrefs( QString sum, QWidget *parent=0, const char *name=0 ) ; | 83 | KOStartTodoPrefs( QString sum, QWidget *parent=0, const char *name=0 ) ; |
84 | 84 | ||
85 | bool stopAll() { return mStopAll; } | 85 | bool stopAll() { return mStopAll; } |
86 | private slots: | 86 | private slots: |
87 | void doStop(); | 87 | void doStop(); |
88 | private: | 88 | private: |
89 | bool mStopAll; | 89 | bool mStopAll; |
90 | 90 | ||
91 | }; | 91 | }; |
92 | 92 | ||
93 | class KOTodoListView : public KListView | 93 | class KOTodoListView : public KListView |
94 | { | 94 | { |
95 | Q_OBJECT | 95 | Q_OBJECT |
96 | public: | 96 | public: |
97 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); | 97 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); |
98 | virtual ~KOTodoListView() {} | 98 | virtual ~KOTodoListView() {} |
99 | 99 | ||
100 | signals: | 100 | signals: |
101 | void paintNeeded(); | 101 | void paintNeeded(); |
102 | void todoDropped(Todo *, int); | 102 | void todoDropped(Todo *, int); |
103 | void double_Clicked(QListViewItem *item); | 103 | void double_Clicked(QListViewItem *item); |
104 | void reparentTodoSignal( Todo *,Todo * ); | 104 | void reparentTodoSignal( Todo *,Todo * ); |
105 | void unparentTodoSignal(Todo *); | 105 | void unparentTodoSignal(Todo *); |
106 | void deleteTodo( Todo * ); | 106 | void deleteTodo( Todo * ); |
107 | protected: | 107 | protected: |
108 | void wheelEvent (QWheelEvent *e); | 108 | void wheelEvent (QWheelEvent *e); |
109 | void contentsDragEnterEvent(QDragEnterEvent *); | 109 | void contentsDragEnterEvent(QDragEnterEvent *); |
110 | void contentsDragMoveEvent(QDragMoveEvent *); | 110 | void contentsDragMoveEvent(QDragMoveEvent *); |
111 | void contentsDragLeaveEvent(QDragLeaveEvent *); | 111 | void contentsDragLeaveEvent(QDragLeaveEvent *); |
112 | void contentsDropEvent(QDropEvent *); | 112 | void contentsDropEvent(QDropEvent *); |
113 | 113 | ||
114 | void contentsMousePressEvent(QMouseEvent *); | 114 | void contentsMousePressEvent(QMouseEvent *); |
115 | void contentsMouseMoveEvent(QMouseEvent *); | 115 | void contentsMouseMoveEvent(QMouseEvent *); |
116 | void contentsMouseReleaseEvent(QMouseEvent *); | 116 | void contentsMouseReleaseEvent(QMouseEvent *); |
117 | void contentsMouseDoubleClickEvent(QMouseEvent *); | 117 | void contentsMouseDoubleClickEvent(QMouseEvent *); |
118 | 118 | ||
119 | private: | 119 | private: |
120 | void paintEvent(QPaintEvent * pevent); | 120 | void paintEvent(QPaintEvent * pevent); |
121 | bool internalDrop; | 121 | bool internalDrop; |
122 | QString mName; | 122 | QString mName; |
123 | Calendar *mCalendar; | 123 | Calendar *mCalendar; |
124 | QPoint mPressPos; | 124 | QPoint mPressPos; |
125 | bool mMousePressed; | 125 | bool mMousePressed; |
126 | QListViewItem *mOldCurrent; | 126 | QListViewItem *mOldCurrent; |
127 | bool mFlagKeyPressed; | 127 | bool mFlagKeyPressed; |
128 | void keyPressEvent ( QKeyEvent * ) ; | 128 | void keyPressEvent ( QKeyEvent * ) ; |
129 | void keyReleaseEvent ( QKeyEvent * ) ; | 129 | void keyReleaseEvent ( QKeyEvent * ) ; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | 132 | ||
133 | /** | 133 | /** |
134 | This is the line-edit on top of the todoview for fast addition of new todos | 134 | This is the line-edit on top of the todoview for fast addition of new todos |
135 | */ | 135 | */ |
136 | class KOQuickTodo : public QLineEdit | 136 | class KOQuickTodo : public QLineEdit |
137 | { | 137 | { |
138 | public: | 138 | public: |
139 | KOQuickTodo(QWidget *parent=0); | 139 | KOQuickTodo(QWidget *parent=0); |
140 | protected: | 140 | protected: |
141 | void focusInEvent(QFocusEvent *ev); | 141 | void focusInEvent(QFocusEvent *ev); |
142 | void focusOutEvent(QFocusEvent *ev); | 142 | void focusOutEvent(QFocusEvent *ev); |
143 | }; | 143 | }; |
144 | 144 | ||
145 | 145 | ||
146 | /** | 146 | /** |
147 | This class provides a multi-column list view of todo events. | 147 | This class provides a multi-column list view of todo events. |
148 | 148 | ||
149 | @short multi-column list view of todo events. | 149 | @short multi-column list view of todo events. |
150 | @author Cornelius Schumacher <schumacher@kde.org> | 150 | @author Cornelius Schumacher <schumacher@kde.org> |
151 | */ | 151 | */ |
152 | class KOTodoView : public KOrg::BaseView | 152 | class KOTodoView : public KOrg::BaseView |
153 | { | 153 | { |
154 | Q_OBJECT | 154 | Q_OBJECT |
155 | public: | 155 | public: |
156 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); | 156 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); |
157 | ~KOTodoView(); | 157 | ~KOTodoView(); |
158 | 158 | ||
159 | QPtrList<Incidence> selectedIncidences(); | 159 | QPtrList<Incidence> selectedIncidences(); |
160 | QPtrList<Todo> selectedTodos(); | 160 | QPtrList<Todo> selectedTodos(); |
161 | 161 | ||
162 | DateList selectedDates() | 162 | DateList selectedDates() |
163 | {DateList q; | 163 | {DateList q; |
164 | return q;} | 164 | return q;} |
165 | 165 | ||
166 | /** Return number of shown dates. TodoView does not show dates, */ | 166 | /** Return number of shown dates. TodoView does not show dates, */ |
167 | int currentDateCount() { return 0; } | 167 | int currentDateCount() { return 0; } |
168 | 168 | ||
169 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); | 169 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); |
170 | 170 | ||
171 | void setDocumentId( const QString & ); | 171 | void setDocumentId( const QString & ); |
172 | 172 | ||
173 | void saveLayout(KConfig *config, const QString &group) const; | 173 | void saveLayout(KConfig *config, const QString &group) const; |
174 | void restoreLayout(KConfig *config, const QString &group); | 174 | void restoreLayout(KConfig *config, const QString &group); |
175 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} | 175 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} |
176 | QString getWhatsThisText(QPoint p); | 176 | QString getWhatsThisText(QPoint p); |
177 | void clearList() {mTodoListView->clear(); } | 177 | void clearList() {mTodoListView->clear(); } |
178 | 178 | ||
179 | public slots: | 179 | public slots: |
180 | void updateView(); | 180 | void updateView(); |
181 | void updateConfig(); | 181 | void updateConfig(); |
182 | 182 | ||
183 | void changeEventDisplay(Event *, int); | 183 | void changeEventDisplay(Event *, int); |
184 | 184 | ||
185 | void showDates(const QDate &start, const QDate &end); | 185 | void showDates(const QDate &start, const QDate &end); |
186 | void showEvents(QPtrList<Event> eventList); | 186 | void showEvents(QPtrList<Event> eventList); |
187 | 187 | ||
188 | void clearSelection(); | 188 | void clearSelection(); |
189 | void jumpToDate (); | 189 | void jumpToDate (); |
190 | 190 | ||
191 | void editItem(QListViewItem *item); | 191 | void editItem(QListViewItem *item); |
192 | void showItem(QListViewItem *item,const QPoint &,int); | 192 | void showItem(QListViewItem *item,const QPoint &,int); |
193 | void popupMenu(QListViewItem *item,const QPoint &,int); | 193 | void popupMenu(QListViewItem *item,const QPoint &,int); |
194 | void newTodo(); | 194 | void newTodo(); |
195 | void newSubTodo(); | 195 | void newSubTodo(); |
196 | void unparentTodo(); | 196 | void unparentTodo(); |
197 | void reparentTodo(); | 197 | void reparentTodo(); |
198 | void showTodo(); | 198 | void showTodo(); |
199 | void editTodo(); | 199 | void editTodo(); |
200 | void cloneTodo(); | 200 | void cloneTodo(); |
201 | void cancelTodo(); | 201 | void cancelTodo(); |
202 | void moveTodo(); | 202 | void moveTodo(); |
203 | void beamTodo(); | 203 | void beamTodo(); |
204 | void deleteTodo(); | 204 | void deleteTodo(); |
205 | 205 | ||
206 | void setNewPriority(int); | 206 | void setNewPriority(int); |
207 | void setNewPercentage(int); | 207 | void setNewPercentage(int); |
208 | void changedCategories(int); | 208 | void changedCategories(int); |
209 | 209 | ||
210 | void setAllOpen(); | 210 | void setAllOpen(); |
211 | void setAllClose(); | 211 | void setAllClose(); |
212 | void setAllFlat(); | 212 | void setAllFlat(); |
213 | void displayAllFlat(); | 213 | void displayAllFlat(); |
214 | 214 | ||
215 | void purgeCompleted(); | 215 | void purgeCompleted(); |
216 | void toggleCompleted(); | 216 | void toggleCompleted(); |
217 | void toggleRunning(); | 217 | void toggleRunning(); |
218 | void toggleQuickTodo(); | 218 | void toggleQuickTodo(); |
219 | void updateTodo( Todo *, int ); | 219 | void updateTodo( Todo *, int ); |
220 | 220 | ||
221 | void itemClicked(QListViewItem *); | 221 | void itemClicked(QListViewItem *); |
222 | void itemStateChanged(QListViewItem *); | 222 | void itemStateChanged(QListViewItem *); |
223 | void modified(bool); | 223 | void modified(bool); |
224 | void itemDoubleClicked(QListViewItem *item); | 224 | void itemDoubleClicked(QListViewItem *item); |
225 | void resetFocusToList(); | 225 | void resetFocusToList(); |
226 | void fillCategories (); | 226 | void fillCategories (); |
227 | void fillCal (); | 227 | void fillCal (); |
228 | void changedCal (int); | 228 | void changedCal (int); |
229 | 229 | ||
230 | signals: | 230 | signals: |
231 | void newTodoSignal(); | 231 | void newTodoSignal(); |
232 | void newSubTodoSignal(Todo *); | 232 | void newSubTodoSignal(Todo *); |
233 | void unparentTodoSignal(Todo *); | 233 | void unparentTodoSignal(Todo *); |
234 | void reparentTodoSignal( Todo *,Todo * ); | 234 | void reparentTodoSignal( Todo *,Todo * ); |
235 | void showTodoSignal(Todo *); | 235 | void showTodoSignal(Todo *); |
236 | 236 | ||
237 | void editTodoSignal(Todo *); | 237 | void editTodoSignal(Todo *); |
238 | void deleteTodoSignal(Todo *); | 238 | void deleteTodoSignal(Todo *); |
239 | void todoModifiedSignal (Todo *, int); | 239 | void todoModifiedSignal (Todo *, int); |
240 | 240 | ||
241 | void isModified(bool); | 241 | void isModified(bool); |
242 | void cloneTodoSignal( Incidence * ); | 242 | void cloneTodoSignal( Incidence * ); |
243 | void cancelTodoSignal( Incidence * ); | 243 | void cancelTodoSignal( Incidence * ); |
244 | void moveTodoSignal( Incidence * ); | 244 | void moveTodoSignal( Incidence * ); |
245 | void beamTodoSignal( Incidence * ); | 245 | void beamTodoSignal( Incidence * ); |
246 | void purgeCompletedSignal(); | 246 | void purgeCompletedSignal(); |
247 | 247 | ||
248 | protected slots: | 248 | protected slots: |
249 | void toggleRunningItem(); | 249 | void toggleRunningItem(); |
250 | void paintNeeded(); | 250 | void paintNeeded(); |
251 | void processSelectionChange(); | 251 | void processSelectionChange(); |
252 | void addQuickTodo(); | 252 | void addQuickTodo(); |
253 | void setTodoModified( Todo* ); | 253 | void setTodoModified( Todo* ); |
254 | void todoModified(Todo *, int ); | 254 | void todoModified(Todo *, int ); |
255 | 255 | ||
256 | private: | 256 | private: |
257 | void addQuickTodoPar( Todo * parentTodo); | ||
257 | /* | 258 | /* |
258 | * the TodoEditor approach is rather unscaling in the long | 259 | * the TodoEditor approach is rather unscaling in the long |
259 | * run. | 260 | * run. |
260 | * Korganizer keeps it in memory and we need to update | 261 | * Korganizer keeps it in memory and we need to update |
261 | * 1. make KOTodoViewItem a QObject again? | 262 | * 1. make KOTodoViewItem a QObject again? |
262 | * 2. add a public method for setting one todo modified? | 263 | * 2. add a public method for setting one todo modified? |
263 | * 3. add a private method for setting a todo modified + friend here? | 264 | * 3. add a private method for setting a todo modified + friend here? |
264 | * -- zecke 2002-07-08 | 265 | * -- zecke 2002-07-08 |
265 | */ | 266 | */ |
266 | KOTodoViewWhatsThis* mKOTodoViewWhatsThis; | 267 | KOTodoViewWhatsThis* mKOTodoViewWhatsThis; |
267 | friend class KOTodoListView; | 268 | friend class KOTodoListView; |
268 | void paintEvent(QPaintEvent * pevent); | 269 | void paintEvent(QPaintEvent * pevent); |
269 | bool mPendingUpdateBeforeRepaint; | 270 | bool mPendingUpdateBeforeRepaint; |
270 | friend class KOTodoViewItem; | 271 | friend class KOTodoViewItem; |
271 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); | 272 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); |
272 | void restoreItemState( QListViewItem * ); | 273 | void restoreItemState( QListViewItem * ); |
273 | 274 | ||
274 | bool checkTodo( Todo * ); | 275 | bool checkTodo( Todo * ); |
275 | bool isFlatDisplay; | 276 | bool isFlatDisplay; |
276 | void setOpen( QListViewItem*, bool setOpen); | 277 | void setOpen( QListViewItem*, bool setOpen); |
277 | KOTodoListView *mTodoListView; | 278 | KOTodoListView *mTodoListView; |
278 | QPopupMenu *mItemPopupMenu; | 279 | QPopupMenu *mItemPopupMenu; |
279 | QPopupMenu *mPopupMenu; | 280 | QPopupMenu *mPopupMenu; |
280 | QPopupMenu *mPriorityPopupMenu; | 281 | QPopupMenu *mPriorityPopupMenu; |
281 | QPopupMenu *mPercentageCompletedPopupMenu; | 282 | QPopupMenu *mPercentageCompletedPopupMenu; |
282 | QPopupMenu *mCategoryPopupMenu; | 283 | QPopupMenu *mCategoryPopupMenu; |
283 | QPopupMenu *mCalPopupMenu; | 284 | QPopupMenu *mCalPopupMenu; |
284 | 285 | ||
285 | QMap<int, int> mPercentage; | 286 | QMap<int, int> mPercentage; |
286 | QMap<int, int> mPriority; | 287 | QMap<int, int> mPriority; |
287 | QMap<int, QString> mCategory; | 288 | QMap<int, QString> mCategory; |
288 | KOTodoViewItem *mActiveItem; | 289 | KOTodoViewItem *mActiveItem; |
289 | 290 | ||
290 | QMap<Todo *,KOTodoViewItem *> mTodoMap; | 291 | QMap<Todo *,KOTodoViewItem *> mTodoMap; |
291 | QString mName; | 292 | QString mName; |
293 | QWidget* mQuickBar; | ||
292 | 294 | ||
293 | DocPrefs *mDocPrefs; | 295 | DocPrefs *mDocPrefs; |
294 | QString mCurrentDoc; | 296 | QString mCurrentDoc; |
295 | KOQuickTodo *mQuickAdd; | 297 | KOQuickTodo *mQuickAdd; |
296 | bool mBlockUpdate; | 298 | bool mBlockUpdate; |
297 | void keyPressEvent ( QKeyEvent * ) ; | 299 | void keyPressEvent ( QKeyEvent * ) ; |
298 | KOTodoViewItem * pendingSubtodo; | 300 | KOTodoViewItem * pendingSubtodo; |
299 | DateNavigator* mNavigator; | 301 | DateNavigator* mNavigator; |
300 | void storeCurrentItem(); | 302 | void storeCurrentItem(); |
301 | void resetCurrentItem(); | 303 | void resetCurrentItem(); |
302 | Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove; | 304 | Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove; |
305 | QPushButton * mNewSubBut; | ||
303 | }; | 306 | }; |
304 | 307 | ||
305 | #endif | 308 | #endif |