-rw-r--r-- | bin/kdepim/WhatsNew.txt | 3 | ||||
-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 17 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 32 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 3 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 4 | ||||
-rw-r--r-- | korganizer/main.cpp | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 9 |
8 files changed, 60 insertions, 13 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index dfc9553..2e120df 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,100 +1,103 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.10 ************ | 3 | ********** VERSION 2.1.10 ************ |
4 | 4 | ||
5 | KO/Pi: | ||
6 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. | ||
7 | |||
5 | ********** VERSION 2.1.9 ************ | 8 | ********** VERSION 2.1.9 ************ |
6 | 9 | ||
7 | KO/Pi: | 10 | KO/Pi: |
8 | Fixed some problems of the new search options in the search dialog. | 11 | Fixed some problems of the new search options in the search dialog. |
9 | Fixed some problems in the new resource config options. | 12 | Fixed some problems in the new resource config options. |
10 | Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. | 13 | Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. |
11 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: | 14 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: |
12 | Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. | 15 | Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. |
13 | 16 | ||
14 | Fixed a problem in recurrence range in syncing with DTM. | 17 | Fixed a problem in recurrence range in syncing with DTM. |
15 | 18 | ||
16 | KA/Pi: | 19 | KA/Pi: |
17 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) | 20 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) |
18 | 21 | ||
19 | PwM/Pi: | 22 | PwM/Pi: |
20 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. | 23 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. |
21 | 24 | ||
22 | ********** VERSION 2.1.8 ************ | 25 | ********** VERSION 2.1.8 ************ |
23 | 26 | ||
24 | KO/Pi: | 27 | KO/Pi: |
25 | Added info about the completion state of a todo in the ListView/Searchdialog. | 28 | Added info about the completion state of a todo in the ListView/Searchdialog. |
26 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. | 29 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. |
27 | Fixed some updating problems when changing the filter. | 30 | Fixed some updating problems when changing the filter. |
28 | 31 | ||
29 | KA/Pi: | 32 | KA/Pi: |
30 | In the addressee selection dialog now the formatted name is shown, if not empty. | 33 | In the addressee selection dialog now the formatted name is shown, if not empty. |
31 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. | 34 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. |
32 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. | 35 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. |
33 | 36 | ||
34 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. | 37 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. |
35 | Fixed the sorting for size in the file selector on the Z. | 38 | Fixed the sorting for size in the file selector on the Z. |
36 | 39 | ||
37 | Changed the color selection dialog on the Zaurus to a more user friendly version. | 40 | Changed the color selection dialog on the Zaurus to a more user friendly version. |
38 | 41 | ||
39 | ********** VERSION 2.1.7 ************ | 42 | ********** VERSION 2.1.7 ************ |
40 | 43 | ||
41 | KO/Pi: | 44 | KO/Pi: |
42 | Fixed several problems in the new Resource handling. | 45 | Fixed several problems in the new Resource handling. |
43 | Added more options to the search dialog. | 46 | Added more options to the search dialog. |
44 | Fixed a problem in the Month view. | 47 | Fixed a problem in the Month view. |
45 | Added more options to the dialog when setting a todo to stopped. | 48 | Added more options to the dialog when setting a todo to stopped. |
46 | 49 | ||
47 | Fixed two small problems in KO/Pi Alarm applet. | 50 | Fixed two small problems in KO/Pi Alarm applet. |
48 | 51 | ||
49 | ********** VERSION 2.1.6 ************ | 52 | ********** VERSION 2.1.6 ************ |
50 | 53 | ||
51 | This release is for testing only. | 54 | This release is for testing only. |
52 | 55 | ||
53 | KO/Pi: | 56 | KO/Pi: |
54 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. | 57 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. |
55 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. | 58 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. |
56 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. | 59 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. |
57 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. | 60 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. |
58 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. | 61 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. |
59 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. | 62 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. |
60 | 63 | ||
61 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. | 64 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. |
62 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. | 65 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. |
63 | Now on every sync the set of calendars is synced which are enabled in the resource view. | 66 | Now on every sync the set of calendars is synced which are enabled in the resource view. |
64 | 67 | ||
65 | A calendar is enabled in the resource view if the "eye" column is checked. | 68 | A calendar is enabled in the resource view if the "eye" column is checked. |
66 | You can set a calendar to be the default for new items( "+" column ). | 69 | You can set a calendar to be the default for new items( "+" column ). |
67 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. | 70 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. |
68 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... | 71 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... |
69 | 72 | ||
70 | 73 | ||
71 | ********** VERSION 2.1.5 ************ | 74 | ********** VERSION 2.1.5 ************ |
72 | 75 | ||
73 | This is the new stable version. | 76 | This is the new stable version. |
74 | Bugfix: | 77 | Bugfix: |
75 | Fixed a problem with agenda popup on the desktop in KO/Pi. | 78 | Fixed a problem with agenda popup on the desktop in KO/Pi. |
76 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. | 79 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. |
77 | Added config option to not display completed todos in agenda view. | 80 | Added config option to not display completed todos in agenda view. |
78 | Addressee view is now using the formatted name, if defined. | 81 | Addressee view is now using the formatted name, if defined. |
79 | That makes it possible to display "lastname, firstname" in that view now. | 82 | That makes it possible to display "lastname, firstname" in that view now. |
80 | To set the formatted name for all contacts, please use menu: | 83 | To set the formatted name for all contacts, please use menu: |
81 | Edit->Change->Set formatted name. | 84 | Edit->Change->Set formatted name. |
82 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. | 85 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. |
83 | 86 | ||
84 | ********** VERSION 2.1.4 ************ | 87 | ********** VERSION 2.1.4 ************ |
85 | 88 | ||
86 | Fixed two more bugs in the KA/Pi CSV import dialog: | 89 | Fixed two more bugs in the KA/Pi CSV import dialog: |
87 | Made it possible to read multi-line fields and import it to the "Note" field. | 90 | Made it possible to read multi-line fields and import it to the "Note" field. |
88 | Fixed a problem in mapping custom fields, whatever a custem field is... | 91 | Fixed a problem in mapping custom fields, whatever a custem field is... |
89 | 92 | ||
90 | ********** VERSION 2.1.3 ************ | 93 | ********** VERSION 2.1.3 ************ |
91 | 94 | ||
92 | Changed the menu structure of the alarm applet: | 95 | Changed the menu structure of the alarm applet: |
93 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". | 96 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". |
94 | 97 | ||
95 | Fixed several problems in the KA/Pi CSV import dialog: | 98 | Fixed several problems in the KA/Pi CSV import dialog: |
96 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. | 99 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. |
97 | 100 | ||
98 | 101 | ||
99 | ********** VERSION 2.1.2 ************ | 102 | ********** VERSION 2.1.2 ************ |
100 | 103 | ||
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 2ade5bd..01c707e 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt | |||
@@ -1362,103 +1362,103 @@ | |||
1362 | { "Try again now","Versuche jetzt nochmal" }, | 1362 | { "Try again now","Versuche jetzt nochmal" }, |
1363 | { "Try again later","Versuche später nochmal" }, | 1363 | { "Try again later","Versuche später nochmal" }, |
1364 | { "Try again tomorrow","Versuche morgen nochmal" }, | 1364 | { "Try again tomorrow","Versuche morgen nochmal" }, |
1365 | { "Disable backup","Schalte Backup ab" }, | 1365 | { "Disable backup","Schalte Backup ab" }, |
1366 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, | 1366 | { "<b>Backup directory does not exist: </b>","<b>Backup Verzeichnis existiert nicht: </b>" }, |
1367 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, | 1367 | { "<b>The backup copy command failed!</b>","<b>Das Backup Kopierkommando is fehlgeschlagen!</b>" }, |
1368 | { "Choose action","Wähle Aktion" }, | 1368 | { "Choose action","Wähle Aktion" }, |
1369 | { "Comment for todo:","Kommentar zum Todo:" }, | 1369 | { "Comment for todo:","Kommentar zum Todo:" }, |
1370 | { "Stop+note","Stop+Notiz" }, | 1370 | { "Stop+note","Stop+Notiz" }, |
1371 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, | 1371 | { "Agenda view shows completed todos","Agenda Ansicht zeigt erledigte Todos" }, |
1372 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, | 1372 | { "KO/Pi: Missing alarms!","KO/Pi: Verpasste Alarme!" }, |
1373 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, | 1373 | { "You missed the alarms for the following events or todos:","Sie verpassten die Alarme für folgende Termine oder Todos:" }, |
1374 | { "Print complete list","Drucke komplette Liste" }, | 1374 | { "Print complete list","Drucke komplette Liste" }, |
1375 | { "Hide all selected","Verstecke Selektierte" }, | 1375 | { "Hide all selected","Verstecke Selektierte" }, |
1376 | { "Add items","hinzufügen" }, | 1376 | { "Add items","hinzufügen" }, |
1377 | { "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?" }, | 1377 | { "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?" }, |
1378 | { "Print List View...","Drucke Listenansicht..." }, | 1378 | { "Print List View...","Drucke Listenansicht..." }, |
1379 | { "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." }, | 1379 | { "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." }, |
1380 | { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, | 1380 | { "Configure KO/Pi...","Konfiguriere KO/Pi..." }, |
1381 | { "Global Settings...","Globale Einstellungen..." }, | 1381 | { "Global Settings...","Globale Einstellungen..." }, |
1382 | { "<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" }, | 1382 | { "<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" }, |
1383 | { "(disabled)","(abgeschaltet)" }, | 1383 | { "(disabled)","(abgeschaltet)" }, |
1384 | { "New Calendar","Neuer Kalender" }, | 1384 | { "New Calendar","Neuer Kalender" }, |
1385 | { "Calendar","Kalender" }, | 1385 | { "Calendar","Kalender" }, |
1386 | { "Filter selector","Filterauswahl" }, | 1386 | { "Filter selector","Filterauswahl" }, |
1387 | { "Filtermenu","Filtermenu" }, | 1387 | { "Filtermenu","Filtermenu" }, |
1388 | { "Toggle Fullscreen","Vollbild umschalten" }, | 1388 | { "Toggle Fullscreen","Vollbild umschalten" }, |
1389 | { "Toggle Resource View","Resourcenansicht umschalten" }, | 1389 | { "Toggle Resource View","Resourcenansicht umschalten" }, |
1390 | { "Storage HowTo...","Speicherort HowTo..." }, | 1390 | { "Storage HowTo...","Speicherort HowTo..." }, |
1391 | { "Timetracking HowTo...","Timetracking HowTo..." }, | 1391 | { "Timetracking HowTo...","Timetracking HowTo..." }, |
1392 | { "Juni","Juni" }, | 1392 | { "Juni","Juni" }, |
1393 | { "Juli","Juli" }, | 1393 | { "Juli","Juli" }, |
1394 | { "ToDo:","ToDo:" }, | 1394 | { "ToDo:","ToDo:" }, |
1395 | { "Set Calendar","Setze Kalender" }, | 1395 | { "Set Calendar","Setze Kalender" }, |
1396 | { "Todo: %1","Todo: %1" }, | 1396 | { "Todo: %1","Todo: %1" }, |
1397 | { ": (Prio ",": (Prio " }, | 1397 | { ": (Prio ",": (Prio " }, |
1398 | { "Todos","Todos" }, | 1398 | { "Todos","Todos" }, |
1399 | { "Todo Viewer","Todo Viewer" }, | 1399 | { "Todo Viewer","Todo Viewer" }, |
1400 | { "Todo ","Todo " }, | 1400 | { "Todo ","Todo " }, |
1401 | { " Calendar \n Resource "," Kalender \n Resource " }, | 1401 | { " Calendar \n Resource "," Kalender \n Resource " }, |
1402 | { " Color "," Farbe " }, | 1402 | { " Color "," Farbe " }, |
1403 | { "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!)" }, | 1403 | { "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!)" }, |
1404 | { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, | 1404 | { "The calendar <b>%1</b> is displaying file <b>%2</b>","Der Kalender <b>%1</b> zeigt die Datei <b>%2</b>" }, |
1405 | { "Add new Calendar","Füge Kalender hinzu" }, | 1405 | { "Add new Calendar","Füge Kalender hinzu" }, |
1406 | { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, | 1406 | { "<b>Name of new calendar:</b>","<b>Name des Kalenders:</b>" }, |
1407 | { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, | 1407 | { "<b>Local ical (*.ics) file:</b>","<b>Lokale ical (*.ics) Datei:</b>" }, |
1408 | { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, | 1408 | { "Sorry, the calendar name is empty!","Sorry, der Kalendername ist leer!" }, |
1409 | { "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, | 1409 | { "Sorry, the file name is empty!","Sorry, der Dateiname ist leer!" }, |
1410 | { "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, | 1410 | { "Error loading calendar file\n%1.","Fehler beim Laden der Kalenderdatei\n%1." }, |
1411 | { "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>" }, | 1411 | { "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>" }, |
1412 | { "Global application font for all apps:","Globale Schriftart:" }, | 1412 | { "Global application font for all apps:","Globale Schriftart:" }, |
1413 | { "Application Font","Applikationsschriftart" }, | 1413 | { "Application Font","Applikationsschriftart" }, |
1414 | { "Kx/Pi","Kx/Pi" }, | 1414 | { "Kx/Pi","Kx/Pi" }, |
1415 | { "Backup","Backup" }, | 1415 | { "Backup","Backup" }, |
1416 | { "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, | 1416 | { "KDE-Pim Global Settings","KDE-Pim Globale Einstellungen" }, |
1417 | { "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!" }, | 1417 | { "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!" }, |
1418 | { "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!" }, | 1418 | { "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!" }, |
1419 | { "Choose Color","Wähle Farbe" }, | 1419 | { "Choose Color","Wähle Farbe" }, |
1420 | { " OK "," OK " }, | 1420 | { " OK "," OK " }, |
1421 | { " Cancel "," Abbrechen " }, | 1421 | { " Cancel "," Abbrechen " }, |
1422 | { "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, | 1422 | { "Matching items will be added to list","Passende werden zur Liste hinzugefügt" }, |
1423 | { "Matching items will be removed from list","Passende werden von der Liste entfernt" }, | 1423 | { "Matching items will be removed from list","Passende werden von der Liste entfernt" }, |
1424 | { "Search on displayed list only","Suche auf der dargestellten Liste" }, | 1424 | { "Search on displayed list only","Suche auf der dargestellten Liste" }, |
1425 | { "List will be cleared before search","Liste wird vor der Suche gelöscht" }, | 1425 | { "List will be cleared before search","Liste wird vor der Suche gelöscht" }, |
1426 | { "<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>" }, | 1426 | { "<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>" }, |
1427 | { "%1\nis running!","%1\nist am Laufen!" }, | 1427 | { "%1\nis running!","%1\nist am Laufen!" }, |
1428 | { "Additional Comment:","Zusätzlicher Kommentar:" }, | 1428 | { "Additional Comment:","Zusätzlicher Kommentar:" }, |
1429 | { "Stop and save","Stopp und Speichern" }, | 1429 | { "Stop and save","Stopp und Speichern" }, |
1430 | { "Continue running","Weiter laufen lassen" }, | 1430 | { "Continue running","Weiter laufen lassen" }, |
1431 | { "Stop - do not save","Stopp - nicht Speichern" }, | 1431 | { "Stop - do not save","Stopp - nicht Speichern" }, |
1432 | { "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?" }, | 1432 | { "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?" }, |
1433 | { "Time mismatch!","Zeiten stimmen nicht!" }, | 1433 | { "Time mismatch!","Zeiten stimmen nicht!" }, |
1434 | { "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, | 1434 | { "The start time is\nafter the end time!","Die Startzeit ist\nhinter der Endzeit!" }, |
1435 | { "Yes, stop todo","Ja, stoppe Todo" }, | 1435 | { "Yes, stop todo","Ja, stoppe Todo" }, |
1436 | { "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, | 1436 | { "Todo stopped - no data saved because runtime was < 15 sec!","Todo gestoppt - nichts gespeichert da Laufzeit < 15 sec!" }, |
1437 | { "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, | 1437 | { "Todo started! Double click again to stop!","Todo gestartet! Doppelklicke um es zu stoppen!" }, |
1438 | { "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." }, | 1438 | { "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." }, |
1439 | { "Spouse","Ehegatte" }, | 1439 | { "Spouse","Ehegatte" }, |
1440 | { "Notes","Notizen" }, | 1440 | { "Notes","Notizen" }, |
1441 | { "Messanger","Messanger" }, | 1441 | { "Messanger","Messanger" }, |
1442 | { "Assistant","Assistent" }, | 1442 | { "Assistant","Assistent" }, |
1443 | { "Manager","Manager" }, | 1443 | { "Manager","Manager" }, |
1444 | { "Secrecy","Sichtbar" }, | 1444 | { "Secrecy","Sichtbar" }, |
1445 | { "male","männlich" }, | 1445 | { "male","männlich" }, |
1446 | { "female","weiblich" }, | 1446 | { "female","weiblich" }, |
1447 | { "Hide!","Verbergen!" }, | 1447 | { "Hide!","Verbergen!" }, |
1448 | { "Show!","Anzeigen!" }, | 1448 | { "Show!","Anzeigen!" }, |
1449 | { "Details","Details" }, | 1449 | { "Details","Details" }, |
1450 | { "Profession","Beruf" }, | 1450 | { "Profession","Beruf" }, |
1451 | { "Children","Kinder" }, | 1451 | { "Children","Kinder" }, |
1452 | { "Department","Abteilung" }, | 1452 | { "Department","Abteilung" }, |
1453 | { "Backup cancelled","Backup abgebrochen" }, | 1453 | { "Backup cancelled","Backup abgebrochen" }, |
1454 | { "Backup globally disabled","Backup global abgeschaltet" }, | 1454 | { "Backup globally disabled","Backup global abgeschaltet" }, |
1455 | { "Backup succesfully finished","Backup erfolgreich beendet" }, | 1455 | { "Backup succesfully finished","Backup erfolgreich beendet" }, |
1456 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, | 1456 | { "(Hint: You can enable automatic backup in the global settings!)","(Hinweis: Sie können ein automatisches Backup in den globalen Einstellungen konfigurieren!)" }, |
1457 | { "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" }, | 1457 | { "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" }, |
1458 | { "","" }, | 1458 | { "Birthdays","Geburtstage" }, |
1459 | { "","" }, | 1459 | { "KO/Pi import information!","KO/Pi Import Information!" }, |
1460 | { "","" }, | 1460 | { "","" }, |
1461 | { "","" }, | 1461 | { "","" }, |
1462 | { "","" }, | 1462 | { "","" }, |
1463 | { "","" }, | 1463 | { "","" }, |
1464 | { "","" }, \ No newline at end of file | 1464 | { "","" }, \ No newline at end of file |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 08909ed..f179c58 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1514,316 +1514,331 @@ bool CalendarView::syncCalendar(QString filename, int mode) | |||
1514 | } | 1514 | } |
1515 | 1515 | ||
1516 | void CalendarView::syncExternal( int mode ) | 1516 | void CalendarView::syncExternal( int mode ) |
1517 | { | 1517 | { |
1518 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 1518 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
1519 | 1519 | ||
1520 | qApp->processEvents(); | 1520 | qApp->processEvents(); |
1521 | CalendarLocal* calendar = new CalendarLocal(); | 1521 | CalendarLocal* calendar = new CalendarLocal(); |
1522 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 1522 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
1523 | bool syncOK = false; | 1523 | bool syncOK = false; |
1524 | bool loadSuccess = false; | 1524 | bool loadSuccess = false; |
1525 | PhoneFormat* phoneFormat = 0; | 1525 | PhoneFormat* phoneFormat = 0; |
1526 | emit tempDisableBR(true); | 1526 | emit tempDisableBR(true); |
1527 | #ifndef DESKTOP_VERSION | 1527 | #ifndef DESKTOP_VERSION |
1528 | SharpFormat* sharpFormat = 0; | 1528 | SharpFormat* sharpFormat = 0; |
1529 | if ( mode == 0 ) { // sharp | 1529 | if ( mode == 0 ) { // sharp |
1530 | sharpFormat = new SharpFormat () ; | 1530 | sharpFormat = new SharpFormat () ; |
1531 | loadSuccess = sharpFormat->load( calendar, mCalendar ); | 1531 | loadSuccess = sharpFormat->load( calendar, mCalendar ); |
1532 | 1532 | ||
1533 | } else | 1533 | } else |
1534 | #endif | 1534 | #endif |
1535 | if ( mode == 1 ) { // phone | 1535 | if ( mode == 1 ) { // phone |
1536 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, | 1536 | phoneFormat = new PhoneFormat (mCurrentSyncDevice, |
1537 | mSyncManager->mPhoneDevice, | 1537 | mSyncManager->mPhoneDevice, |
1538 | mSyncManager->mPhoneConnection, | 1538 | mSyncManager->mPhoneConnection, |
1539 | mSyncManager->mPhoneModel); | 1539 | mSyncManager->mPhoneModel); |
1540 | loadSuccess = phoneFormat->load( calendar,mCalendar); | 1540 | loadSuccess = phoneFormat->load( calendar,mCalendar); |
1541 | 1541 | ||
1542 | } else { | 1542 | } else { |
1543 | emit tempDisableBR(false); | 1543 | emit tempDisableBR(false); |
1544 | return; | 1544 | return; |
1545 | } | 1545 | } |
1546 | if ( loadSuccess ) { | 1546 | if ( loadSuccess ) { |
1547 | getEventViewerDialog()->setSyncMode( true ); | 1547 | getEventViewerDialog()->setSyncMode( true ); |
1548 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); | 1548 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); |
1549 | getEventViewerDialog()->setSyncMode( false ); | 1549 | getEventViewerDialog()->setSyncMode( false ); |
1550 | qApp->processEvents(); | 1550 | qApp->processEvents(); |
1551 | if ( syncOK ) { | 1551 | if ( syncOK ) { |
1552 | if ( mSyncManager->mWriteBackFile ) | 1552 | if ( mSyncManager->mWriteBackFile ) |
1553 | { | 1553 | { |
1554 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); | 1554 | QPtrList<Incidence> iL = mCalendar->rawIncidences(); |
1555 | Incidence* inc = iL.first(); | 1555 | Incidence* inc = iL.first(); |
1556 | if ( phoneFormat ) { | 1556 | if ( phoneFormat ) { |
1557 | while ( inc ) { | 1557 | while ( inc ) { |
1558 | inc->removeID(mCurrentSyncDevice); | 1558 | inc->removeID(mCurrentSyncDevice); |
1559 | inc = iL.next(); | 1559 | inc = iL.next(); |
1560 | } | 1560 | } |
1561 | } | 1561 | } |
1562 | #ifndef DESKTOP_VERSION | 1562 | #ifndef DESKTOP_VERSION |
1563 | if ( sharpFormat ) | 1563 | if ( sharpFormat ) |
1564 | sharpFormat->save(calendar); | 1564 | sharpFormat->save(calendar); |
1565 | #endif | 1565 | #endif |
1566 | if ( phoneFormat ) | 1566 | if ( phoneFormat ) |
1567 | phoneFormat->save(calendar); | 1567 | phoneFormat->save(calendar); |
1568 | iL = calendar->rawIncidences(); | 1568 | iL = calendar->rawIncidences(); |
1569 | inc = iL.first(); | 1569 | inc = iL.first(); |
1570 | Incidence* loc; | 1570 | Incidence* loc; |
1571 | while ( inc ) { | 1571 | while ( inc ) { |
1572 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { | 1572 | if ( inc->tempSyncStat() == SYNC_TEMPSTATE_NEW_ID ) { |
1573 | loc = mCalendar->incidence(inc->uid() ); | 1573 | loc = mCalendar->incidence(inc->uid() ); |
1574 | if ( loc ) { | 1574 | if ( loc ) { |
1575 | loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); | 1575 | loc->setID(mCurrentSyncDevice, inc->getID(mCurrentSyncDevice) ); |
1576 | loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); | 1576 | loc->setCsum( mCurrentSyncDevice, inc->getCsum(mCurrentSyncDevice) ); |
1577 | } | 1577 | } |
1578 | } | 1578 | } |
1579 | inc = iL.next(); | 1579 | inc = iL.next(); |
1580 | } | 1580 | } |
1581 | Incidence* lse = getLastSyncEvent(); | 1581 | Incidence* lse = getLastSyncEvent(); |
1582 | if ( lse ) { | 1582 | if ( lse ) { |
1583 | lse->setReadOnly( false ); | 1583 | lse->setReadOnly( false ); |
1584 | lse->setDescription( "" ); | 1584 | lse->setDescription( "" ); |
1585 | lse->setReadOnly( true ); | 1585 | lse->setReadOnly( true ); |
1586 | } | 1586 | } |
1587 | } | 1587 | } |
1588 | } else { | 1588 | } else { |
1589 | topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); | 1589 | topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); |
1590 | } | 1590 | } |
1591 | setModified( true ); | 1591 | setModified( true ); |
1592 | } else { | 1592 | } else { |
1593 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; | 1593 | QString question = i18n("Sorry, the database access\ncommand failed!\n\nNothing synced!\n") ; |
1594 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), | 1594 | QMessageBox::information( 0, i18n("KO/Pi Import - ERROR"), |
1595 | question, i18n("Ok")) ; | 1595 | question, i18n("Ok")) ; |
1596 | 1596 | ||
1597 | } | 1597 | } |
1598 | delete calendar; | 1598 | delete calendar; |
1599 | updateView(); | 1599 | updateView(); |
1600 | emit tempDisableBR(false); | 1600 | emit tempDisableBR(false); |
1601 | return ;//syncOK; | 1601 | return ;//syncOK; |
1602 | 1602 | ||
1603 | } | 1603 | } |
1604 | 1604 | ||
1605 | bool CalendarView::importBday() | 1605 | bool CalendarView::importBday() |
1606 | { | 1606 | { |
1607 | #ifndef KORG_NOKABC | 1607 | #ifndef KORG_NOKABC |
1608 | 1608 | ||
1609 | #ifdef DESKTOP_VERSION | 1609 | #ifdef DESKTOP_VERSION |
1610 | int curCal = mCalendar->defaultCalendar(); | ||
1611 | int bd = mCalEditView->getBirtdayID(); | ||
1612 | if ( bd == 0 ) | ||
1613 | return; | ||
1614 | mCalendar->setDefaultCalendar( bd ); | ||
1610 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 1615 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
1611 | KABC::AddressBook::Iterator it; | 1616 | KABC::AddressBook::Iterator it; |
1612 | int count = 0; | 1617 | int count = 0; |
1613 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1618 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
1614 | ++count; | 1619 | ++count; |
1615 | } | 1620 | } |
1616 | QProgressBar bar(count,0 ); | 1621 | QProgressBar bar(count,0 ); |
1617 | int w = 300; | 1622 | int w = 300; |
1618 | if ( QApplication::desktop()->width() < 320 ) | 1623 | if ( QApplication::desktop()->width() < 320 ) |
1619 | w = 220; | 1624 | w = 220; |
1620 | int h = bar.sizeHint().height() ; | 1625 | int h = bar.sizeHint().height() ; |
1621 | int dw = QApplication::desktop()->width(); | 1626 | int dw = QApplication::desktop()->width(); |
1622 | int dh = QApplication::desktop()->height(); | 1627 | int dh = QApplication::desktop()->height(); |
1623 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1628 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1624 | bar.show(); | 1629 | bar.show(); |
1625 | bar.setCaption (i18n("Reading addressbook - close to abort!") ); | 1630 | bar.setCaption (i18n("Reading addressbook - close to abort!") ); |
1626 | qApp->processEvents(); | 1631 | qApp->processEvents(); |
1627 | count = 0; | 1632 | count = 0; |
1628 | int addCount = 0; | 1633 | int addCount = 0; |
1629 | KCal::Attendee* a = 0; | 1634 | KCal::Attendee* a = 0; |
1630 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 1635 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
1631 | if ( ! bar.isVisible() ) | 1636 | if ( ! bar.isVisible() ) |
1632 | return false; | 1637 | return false; |
1633 | bar.setProgress( count++ ); | 1638 | bar.setProgress( count++ ); |
1634 | qApp->processEvents(); | 1639 | qApp->processEvents(); |
1635 | //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); | 1640 | //qDebug("add BDay %s %s", (*it).realName().latin1(),(*it).birthday().date().toString().latin1() ); |
1636 | if ( (*it).birthday().date().isValid() ){ | 1641 | if ( (*it).birthday().date().isValid() ){ |
1637 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; | 1642 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; |
1638 | if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) | 1643 | if ( addAnniversary( (*it).birthday().date(), (*it).assembledName(), a, true ) ) |
1639 | ++addCount; | 1644 | ++addCount; |
1640 | } | 1645 | } |
1641 | QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); | 1646 | QDate anni = KGlobal::locale()->readDate( (*it).custom("KADDRESSBOOK", "X-Anniversary" ), "%Y-%m-%d"); |
1642 | if ( anni.isValid() ){ | 1647 | if ( anni.isValid() ){ |
1643 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; | 1648 | a = new KCal::Attendee( (*it).realName(), (*it).preferredEmail(),false,KCal::Attendee::NeedsAction,KCal::Attendee::ReqParticipant,(*it).uid()) ; |
1644 | if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) | 1649 | if ( addAnniversary( anni, (*it).assembledName(), a, false ) ) |
1645 | ++addCount; | 1650 | ++addCount; |
1646 | } | 1651 | } |
1647 | } | 1652 | } |
1653 | mCalendar->setDefaultCalendar( curCal ); | ||
1648 | updateView(); | 1654 | updateView(); |
1649 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1655 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1650 | #else //DESKTOP_VERSION | 1656 | #else //DESKTOP_VERSION |
1651 | 1657 | ||
1652 | ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | 1658 | ExternalAppHandler::instance()->requestBirthdayListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); |
1653 | // the result should now arrive through method insertBirthdays | 1659 | // the result should now arrive through method insertBirthdays |
1654 | 1660 | ||
1655 | #endif //DESKTOP_VERSION | 1661 | #endif //DESKTOP_VERSION |
1656 | 1662 | ||
1657 | #endif //KORG_NOKABC | 1663 | #endif //KORG_NOKABC |
1658 | 1664 | ||
1659 | 1665 | ||
1660 | return true; | 1666 | return true; |
1661 | } | 1667 | } |
1662 | 1668 | ||
1663 | // This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI | 1669 | // This method will be called from Ka/Pi as a response to requestBirthdayListFromKAPI |
1664 | void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, | 1670 | void CalendarView::insertBirthdays(const QString& uid, const QStringList& birthdayList, |
1665 | const QStringList& anniversaryList, const QStringList& realNameList, | 1671 | const QStringList& anniversaryList, const QStringList& realNameList, |
1666 | const QStringList& emailList, const QStringList& assembledNameList, | 1672 | const QStringList& emailList, const QStringList& assembledNameList, |
1667 | const QStringList& uidList) | 1673 | const QStringList& uidList) |
1668 | { | 1674 | { |
1675 | |||
1669 | //qDebug("KO::CalendarView::insertBirthdays"); | 1676 | //qDebug("KO::CalendarView::insertBirthdays"); |
1670 | if (uid == this->name()) | 1677 | if (uid == this->name()) |
1671 | { | 1678 | { |
1679 | int curCal = mCalendar->defaultCalendar(); | ||
1680 | int bd = mCalEditView->getBirtdayID(); | ||
1681 | if ( bd == 0 ) | ||
1682 | return; | ||
1683 | mCalendar->setDefaultCalendar( bd ); | ||
1684 | |||
1685 | |||
1672 | int count = birthdayList.count(); | 1686 | int count = birthdayList.count(); |
1673 | int addCount = 0; | 1687 | int addCount = 0; |
1674 | KCal::Attendee* a = 0; | 1688 | KCal::Attendee* a = 0; |
1675 | 1689 | ||
1676 | //qDebug("CalView 1 %i", count); | 1690 | //qDebug("CalView 1 %i", count); |
1677 | 1691 | ||
1678 | QProgressBar bar(count,0 ); | 1692 | QProgressBar bar(count,0 ); |
1679 | int w = 300; | 1693 | int w = 300; |
1680 | if ( QApplication::desktop()->width() < 320 ) | 1694 | if ( QApplication::desktop()->width() < 320 ) |
1681 | w = 220; | 1695 | w = 220; |
1682 | int h = bar.sizeHint().height() ; | 1696 | int h = bar.sizeHint().height() ; |
1683 | int dw = QApplication::desktop()->width(); | 1697 | int dw = QApplication::desktop()->width(); |
1684 | int dh = QApplication::desktop()->height(); | 1698 | int dh = QApplication::desktop()->height(); |
1685 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1699 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1686 | bar.show(); | 1700 | bar.show(); |
1687 | bar.setCaption (i18n("inserting birthdays - close to abort!") ); | 1701 | bar.setCaption (i18n("inserting birthdays - close to abort!") ); |
1688 | qApp->processEvents(); | 1702 | qApp->processEvents(); |
1689 | 1703 | ||
1690 | QDate birthday; | 1704 | QDate birthday; |
1691 | QDate anniversary; | 1705 | QDate anniversary; |
1692 | QString realName; | 1706 | QString realName; |
1693 | QString email; | 1707 | QString email; |
1694 | QString assembledName; | 1708 | QString assembledName; |
1695 | QString uid; | 1709 | QString uid; |
1696 | bool ok = true; | 1710 | bool ok = true; |
1697 | for ( int i = 0; i < count; i++) | 1711 | for ( int i = 0; i < count; i++) |
1698 | { | 1712 | { |
1699 | if ( ! bar.isVisible() ) | 1713 | if ( ! bar.isVisible() ) |
1700 | return; | 1714 | return; |
1701 | bar.setProgress( i ); | 1715 | bar.setProgress( i ); |
1702 | qApp->processEvents(); | 1716 | qApp->processEvents(); |
1703 | 1717 | ||
1704 | birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); | 1718 | birthday = KGlobal::locale()->readDate(birthdayList[i], KLocale::ISODate, &ok); |
1705 | if (!ok) { | 1719 | if (!ok) { |
1706 | ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); | 1720 | ;//qDebug("CalendarView::insertBirthdays found invalid birthday: %s",birthdayList[i].latin1()); |
1707 | } | 1721 | } |
1708 | 1722 | ||
1709 | anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); | 1723 | anniversary = KGlobal::locale()->readDate(anniversaryList[i], KLocale::ISODate, &ok); |
1710 | if (!ok) { | 1724 | if (!ok) { |
1711 | ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); | 1725 | ;//qDebug("CalendarView::insertBirthdays found invalid anniversary: %s",anniversaryList[i].latin1()); |
1712 | } | 1726 | } |
1713 | realName = realNameList[i]; | 1727 | realName = realNameList[i]; |
1714 | email = emailList[i]; | 1728 | email = emailList[i]; |
1715 | assembledName = assembledNameList[i]; | 1729 | assembledName = assembledNameList[i]; |
1716 | uid = uidList[i]; | 1730 | uid = uidList[i]; |
1717 | //qDebug("insert birthday in KO/Pi: %s,%s,%s,%s: %s, %s", realName.latin1(), email.latin1(), assembledName.latin1(), uid.latin1(), birthdayList[i].latin1(), anniversaryList[i].latin1() ); | 1731 | //qDebug("insert birthday in KO/Pi: %s,%s,%s,%s: %s, %s", realName.latin1(), email.latin1(), assembledName.latin1(), uid.latin1(), birthdayList[i].latin1(), anniversaryList[i].latin1() ); |
1718 | 1732 | ||
1719 | if ( birthday.isValid() ){ | 1733 | if ( birthday.isValid() ){ |
1720 | a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, | 1734 | a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, |
1721 | KCal::Attendee::ReqParticipant,uid) ; | 1735 | KCal::Attendee::ReqParticipant,uid) ; |
1722 | if ( addAnniversary( birthday, assembledName, a, true ) ) | 1736 | if ( addAnniversary( birthday, assembledName, a, true ) ) |
1723 | ++addCount; | 1737 | ++addCount; |
1724 | } | 1738 | } |
1725 | 1739 | ||
1726 | if ( anniversary.isValid() ){ | 1740 | if ( anniversary.isValid() ){ |
1727 | a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, | 1741 | a = new KCal::Attendee( realName, email,false,KCal::Attendee::NeedsAction, |
1728 | KCal::Attendee::ReqParticipant,uid) ; | 1742 | KCal::Attendee::ReqParticipant,uid) ; |
1729 | if ( addAnniversary( anniversary, assembledName, a, false ) ) | 1743 | if ( addAnniversary( anniversary, assembledName, a, false ) ) |
1730 | ++addCount; | 1744 | ++addCount; |
1731 | } | 1745 | } |
1732 | } | 1746 | } |
1733 | 1747 | ||
1748 | mCalendar->setDefaultCalendar( curCal ); | ||
1734 | updateView(); | 1749 | updateView(); |
1735 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); | 1750 | topLevelWidget()->setCaption(QString::number( addCount )+ i18n(" birthdays/anniversaries added!")); |
1736 | 1751 | ||
1737 | } | 1752 | } |
1738 | 1753 | ||
1739 | } | 1754 | } |
1740 | 1755 | ||
1741 | 1756 | ||
1742 | 1757 | ||
1743 | bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) | 1758 | bool CalendarView::addAnniversary( QDate date, QString name, KCal::Attendee* a, bool birthday) |
1744 | { | 1759 | { |
1745 | //qDebug("addAnni "); | 1760 | //qDebug("addAnni "); |
1746 | Event * ev = new Event(); | 1761 | Event * ev = new Event(); |
1747 | ev->setOrganizer(KOPrefs::instance()->email()); | 1762 | ev->setOrganizer(KOPrefs::instance()->email()); |
1748 | if ( a ) { | 1763 | if ( a ) { |
1749 | ev->addAttendee( a ); | 1764 | ev->addAttendee( a ); |
1750 | } | 1765 | } |
1751 | QString kind; | 1766 | QString kind; |
1752 | if ( birthday ) { | 1767 | if ( birthday ) { |
1753 | kind = i18n( "Birthday" ); | 1768 | kind = i18n( "Birthday" ); |
1754 | ev->setSummary( name + " (" + QString::number(date.year()) +")"); | 1769 | ev->setSummary( name + " (" + QString::number(date.year()) +")"); |
1755 | } | 1770 | } |
1756 | else { | 1771 | else { |
1757 | kind = i18n( "Anniversary" ); | 1772 | kind = i18n( "Anniversary" ); |
1758 | ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); | 1773 | ev->setSummary( name + " (" + QString::number(date.year()) +") " + kind ); |
1759 | } | 1774 | } |
1760 | ev->setCategories( kind ); | 1775 | ev->setCategories( kind ); |
1761 | ev->setDtStart( QDateTime(date) ); | 1776 | ev->setDtStart( QDateTime(date) ); |
1762 | ev->setDtEnd( QDateTime(date) ); | 1777 | ev->setDtEnd( QDateTime(date) ); |
1763 | ev->setFloats( true ); | 1778 | ev->setFloats( true ); |
1764 | Recurrence * rec = ev->recurrence(); | 1779 | Recurrence * rec = ev->recurrence(); |
1765 | rec->setYearly(Recurrence::rYearlyMonth,1,-1); | 1780 | rec->setYearly(Recurrence::rYearlyMonth,1,-1); |
1766 | rec->addYearlyNum( date.month() ); | 1781 | rec->addYearlyNum( date.month() ); |
1767 | if ( !mCalendar->addAnniversaryNoDup( ev ) ) { | 1782 | if ( !mCalendar->addAnniversaryNoDup( ev ) ) { |
1768 | delete ev; | 1783 | delete ev; |
1769 | return false; | 1784 | return false; |
1770 | } | 1785 | } |
1771 | return true; | 1786 | return true; |
1772 | 1787 | ||
1773 | } | 1788 | } |
1774 | bool CalendarView::importQtopia( const QString &categories, | 1789 | bool CalendarView::importQtopia( const QString &categories, |
1775 | const QString &datebook, | 1790 | const QString &datebook, |
1776 | const QString &todolist ) | 1791 | const QString &todolist ) |
1777 | { | 1792 | { |
1778 | 1793 | ||
1779 | QtopiaFormat qtopiaFormat; | 1794 | QtopiaFormat qtopiaFormat; |
1780 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); | 1795 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); |
1781 | if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); | 1796 | if ( !categories.isEmpty() ) qtopiaFormat.load( mCalendar, categories ); |
1782 | if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); | 1797 | if ( !datebook.isEmpty() ) qtopiaFormat.load( mCalendar, datebook ); |
1783 | if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); | 1798 | if ( !todolist.isEmpty() ) qtopiaFormat.load( mCalendar, todolist ); |
1784 | 1799 | ||
1785 | updateView(); | 1800 | updateView(); |
1786 | return true; | 1801 | return true; |
1787 | 1802 | ||
1788 | #if 0 | 1803 | #if 0 |
1789 | mGlobalSyncMode = SYNC_MODE_QTOPIA; | 1804 | mGlobalSyncMode = SYNC_MODE_QTOPIA; |
1790 | mCurrentSyncDevice = "qtopia-XML"; | 1805 | mCurrentSyncDevice = "qtopia-XML"; |
1791 | if ( mSyncManager->mAskForPreferences ) | 1806 | if ( mSyncManager->mAskForPreferences ) |
1792 | edit_sync_options(); | 1807 | edit_sync_options(); |
1793 | qApp->processEvents(); | 1808 | qApp->processEvents(); |
1794 | CalendarLocal* calendar = new CalendarLocal(); | 1809 | CalendarLocal* calendar = new CalendarLocal(); |
1795 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 1810 | calendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
1796 | bool syncOK = false; | 1811 | bool syncOK = false; |
1797 | QtopiaFormat qtopiaFormat; | 1812 | QtopiaFormat qtopiaFormat; |
1798 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); | 1813 | qtopiaFormat.setCategoriesList ( &(KOPrefs::instance()->mCustomCategories)); |
1799 | bool loadOk = true; | 1814 | bool loadOk = true; |
1800 | if ( !categories.isEmpty() ) | 1815 | if ( !categories.isEmpty() ) |
1801 | loadOk = qtopiaFormat.load( calendar, categories ); | 1816 | loadOk = qtopiaFormat.load( calendar, categories ); |
1802 | if ( loadOk && !datebook.isEmpty() ) | 1817 | if ( loadOk && !datebook.isEmpty() ) |
1803 | loadOk = qtopiaFormat.load( calendar, datebook ); | 1818 | loadOk = qtopiaFormat.load( calendar, datebook ); |
1804 | if ( loadOk && !todolist.isEmpty() ) | 1819 | if ( loadOk && !todolist.isEmpty() ) |
1805 | loadOk = qtopiaFormat.load( calendar, todolist ); | 1820 | loadOk = qtopiaFormat.load( calendar, todolist ); |
1806 | 1821 | ||
1807 | if ( loadOk ) { | 1822 | if ( loadOk ) { |
1808 | getEventViewerDialog()->setSyncMode( true ); | 1823 | getEventViewerDialog()->setSyncMode( true ); |
1809 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); | 1824 | syncOK = synchronizeCalendar( mCalendar, calendar, mSyncManager->mSyncAlgoPrefs ); |
1810 | getEventViewerDialog()->setSyncMode( false ); | 1825 | getEventViewerDialog()->setSyncMode( false ); |
1811 | qApp->processEvents(); | 1826 | qApp->processEvents(); |
1812 | if ( syncOK ) { | 1827 | if ( syncOK ) { |
1813 | if ( mSyncManager->mWriteBackFile ) | 1828 | if ( mSyncManager->mWriteBackFile ) |
1814 | { | 1829 | { |
1815 | // write back XML file | 1830 | // write back XML file |
1816 | 1831 | ||
1817 | } | 1832 | } |
1818 | setModified( true ); | 1833 | setModified( true ); |
1819 | } | 1834 | } |
1820 | } else { | 1835 | } else { |
1821 | QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; | 1836 | QString question = i18n("Sorry, the file loading\ncommand failed!\n\nNothing synced!\n") ; |
1822 | QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), | 1837 | QMessageBox::information( 0, i18n("KO/Pi Sync - ERROR"), |
1823 | question, i18n("Ok")) ; | 1838 | question, i18n("Ok")) ; |
1824 | } | 1839 | } |
1825 | delete calendar; | 1840 | delete calendar; |
1826 | updateView(); | 1841 | updateView(); |
1827 | return syncOK; | 1842 | return syncOK; |
1828 | 1843 | ||
1829 | 1844 | ||
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index a8a3052..3cde103 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -261,174 +261,194 @@ void KOCalEditView::readConfig() | |||
261 | addBut->setPixmap ( SmallIcon("bell")); | 261 | addBut->setPixmap ( SmallIcon("bell")); |
262 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); | 262 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); |
263 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 263 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
264 | 264 | ||
265 | addBut = new QPushButton ( mw ); | 265 | addBut = new QPushButton ( mw ); |
266 | addBut->setFocusPolicy(NoFocus); | 266 | addBut->setFocusPolicy(NoFocus); |
267 | mainLayout->addWidget( addBut,0,++ii ); | 267 | mainLayout->addWidget( addBut,0,++ii ); |
268 | addBut->setPixmap ( SmallIcon("pencil")); | 268 | addBut->setPixmap ( SmallIcon("pencil")); |
269 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); | 269 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); |
270 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 270 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
271 | lab = new QLabel ( "", mw ); | 271 | lab = new QLabel ( "", mw ); |
272 | mainLayout->addWidget( lab,0,++ii ); | 272 | mainLayout->addWidget( lab,0,++ii ); |
273 | 273 | ||
274 | addBut = new QPushButton ( mw ); | 274 | addBut = new QPushButton ( mw ); |
275 | addBut->setFocusPolicy(NoFocus); | 275 | addBut->setFocusPolicy(NoFocus); |
276 | mainLayout->addWidget( addBut,0,++ii ); | 276 | mainLayout->addWidget( addBut,0,++ii ); |
277 | addBut->setPixmap ( SmallIcon("plus")); | 277 | addBut->setPixmap ( SmallIcon("plus")); |
278 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); | 278 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); |
279 | 279 | ||
280 | lab = new QLabel ( " ", mw ); | 280 | lab = new QLabel ( " ", mw ); |
281 | mainLayout->addWidget( lab,0,++ii ); | 281 | mainLayout->addWidget( lab,0,++ii ); |
282 | 282 | ||
283 | 283 | ||
284 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 284 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
285 | int row = 1; | 285 | int row = 1; |
286 | while ( kkf ) { | 286 | while ( kkf ) { |
287 | int iii = 0; | 287 | int iii = 0; |
288 | KOCalRadioButton* rb = new KOCalRadioButton( mw ); | 288 | KOCalRadioButton* rb = new KOCalRadioButton( mw ); |
289 | mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb ); | 289 | mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb ); |
290 | rb->setChecked( kkf->isStandard ); | 290 | rb->setChecked( kkf->isStandard ); |
291 | rb->setNum( kkf->mCalNumber ); | 291 | rb->setNum( kkf->mCalNumber ); |
292 | connect (rb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); | 292 | connect (rb, SIGNAL (selectNum(int,bool)), SLOT ( selectStdCal(int,bool) ) ); |
293 | if ( kkf->mErrorOnLoad || kkf->isReadOnly ) | 293 | if ( kkf->mErrorOnLoad || kkf->isReadOnly ) |
294 | rb->setEnabled( false ); | 294 | rb->setEnabled( false ); |
295 | KOCalCheckButton* cb = new KOCalCheckButton( mw ); | 295 | KOCalCheckButton* cb = new KOCalCheckButton( mw ); |
296 | mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); | 296 | mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); |
297 | cb->setChecked( kkf->isEnabled ); | 297 | cb->setChecked( kkf->isEnabled ); |
298 | cb->setNum( kkf->mCalNumber ); | 298 | cb->setNum( kkf->mCalNumber ); |
299 | if ( kkf->mErrorOnLoad ) | 299 | if ( kkf->mErrorOnLoad ) |
300 | cb->setEnabled( false ); | 300 | cb->setEnabled( false ); |
301 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); | 301 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); |
302 | KOCalButton* name = new KOCalButton( mw ); | 302 | KOCalButton* name = new KOCalButton( mw ); |
303 | name->setNum( kkf->mCalNumber ); | 303 | name->setNum( kkf->mCalNumber ); |
304 | name->setText( kkf->mName ); | 304 | name->setText( kkf->mName ); |
305 | mainLayout->addWidget( name,row,++iii ); | 305 | mainLayout->addWidget( name,row,++iii ); |
306 | connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); | 306 | connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); |
307 | //lab = new QLabel (" ", mw ); | 307 | //lab = new QLabel (" ", mw ); |
308 | //mainLayout->addWidget( lab,row,++iii ); | 308 | //mainLayout->addWidget( lab,row,++iii ); |
309 | cb = new KOCalCheckButton( mw ); | 309 | cb = new KOCalCheckButton( mw ); |
310 | mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); | 310 | mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); |
311 | cb->setChecked( kkf->isAlarmEnabled ); | 311 | cb->setChecked( kkf->isAlarmEnabled ); |
312 | cb->setNum( kkf->mCalNumber ); | 312 | cb->setNum( kkf->mCalNumber ); |
313 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) ); | 313 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCalAlarm(int,bool) ) ); |
314 | if ( kkf->mErrorOnLoad ) | 314 | if ( kkf->mErrorOnLoad ) |
315 | cb->setEnabled( false ); | 315 | cb->setEnabled( false ); |
316 | cb = new KOCalCheckButton( mw ); | 316 | cb = new KOCalCheckButton( mw ); |
317 | mainLayout->addWidget( cb,row,++iii );mROB.append( cb ); | 317 | mainLayout->addWidget( cb,row,++iii );mROB.append( cb ); |
318 | cb->setChecked( kkf->isReadOnly ); | 318 | cb->setChecked( kkf->isReadOnly ); |
319 | cb->setNum( kkf->mCalNumber ); | 319 | cb->setNum( kkf->mCalNumber ); |
320 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); | 320 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectReadOnly(int,bool) ) ); |
321 | if ( kkf->mErrorOnLoad ) | 321 | if ( kkf->mErrorOnLoad ) |
322 | cb->setEnabled( false ); | 322 | cb->setEnabled( false ); |
323 | if ( row > 1) { | 323 | if ( row > 1) { |
324 | KColorButton *colb = new KColorButton( mw ); | 324 | KColorButton *colb = new KColorButton( mw ); |
325 | mainLayout->addWidget( colb,row,++iii ); | 325 | mainLayout->addWidget( colb,row,++iii ); |
326 | colb->setID( kkf->mCalNumber ); | 326 | colb->setID( kkf->mCalNumber ); |
327 | colb->setColor( kkf->mDefaultColor ); | 327 | colb->setColor( kkf->mDefaultColor ); |
328 | connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); | 328 | connect (colb, SIGNAL (changedID(const QColor&, int )), SLOT ( setColor(const QColor&,int) ) ); |
329 | KOCalButton* calb = new KOCalButton( mw ); | 329 | KOCalButton* calb = new KOCalButton( mw ); |
330 | mainLayout->addWidget( calb,row,++iii ); | 330 | mainLayout->addWidget( calb,row,++iii ); |
331 | calb->setNum( kkf->mCalNumber ); | 331 | calb->setNum( kkf->mCalNumber ); |
332 | calb->setPixmap ( SmallIcon("minus")); | 332 | calb->setPixmap ( SmallIcon("minus")); |
333 | connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); | 333 | connect (calb, SIGNAL (selectNum(int)), SLOT ( deleteCal(int) ) ); |
334 | int hei = calb->sizeHint().height(); | 334 | int hei = calb->sizeHint().height(); |
335 | //calb->setMaximumSize( hei*9/10, hei*9/10 ); | 335 | //calb->setMaximumSize( hei*9/10, hei*9/10 ); |
336 | } | 336 | } |
337 | ++row; | 337 | ++row; |
338 | kkf = KOPrefs::instance()->mCalendars.next(); | 338 | kkf = KOPrefs::instance()->mCalendars.next(); |
339 | } | 339 | } |
340 | lab = new QLabel ( "", mw ); | 340 | lab = new QLabel ( "", mw ); |
341 | mainLayout->addWidget( lab,row,0 ); | 341 | mainLayout->addWidget( lab,row,0 ); |
342 | mw->show(); | 342 | mw->show(); |
343 | 343 | ||
344 | } | 344 | } |
345 | 345 | ||
346 | 346 | ||
347 | void KOCalEditView::defaultInfo() | 347 | void KOCalEditView::defaultInfo() |
348 | { | 348 | { |
349 | KMessageBox::information( this, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); | 349 | KMessageBox::information( this, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); |
350 | } | 350 | } |
351 | void KOCalEditView::addCal() | 351 | void KOCalEditView::addCal() |
352 | { | 352 | { |
353 | bool tryagain = true; | 353 | bool tryagain = true; |
354 | QString name, file; | 354 | QString name, file; |
355 | while ( tryagain ) { | 355 | while ( tryagain ) { |
356 | KONewCalPrefs prefs ( this ); | 356 | KONewCalPrefs prefs ( this ); |
357 | prefs.nameE->setText( name ); | 357 | prefs.nameE->setText( name ); |
358 | prefs.url->setURL( file ); | 358 | prefs.url->setURL( file ); |
359 | if ( ! prefs.exec() ) | 359 | if ( ! prefs.exec() ) |
360 | return; | 360 | return; |
361 | name = prefs.calName(); | 361 | name = prefs.calName(); |
362 | file = prefs.calFileName(); | 362 | file = prefs.calFileName(); |
363 | tryagain = false; | 363 | tryagain = false; |
364 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 364 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
365 | while ( kkf ) { | 365 | while ( kkf ) { |
366 | if ( kkf->mName == name ) { | 366 | if ( kkf->mName == name ) { |
367 | KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) ); | 367 | KMessageBox::information( this, i18n("Sorry, the calendar name \n%1\nalready exists!\nPlease choose another name!").arg( name ) ); |
368 | name = ""; | 368 | name = ""; |
369 | tryagain = true; | 369 | tryagain = true; |
370 | break; | 370 | break; |
371 | } | 371 | } |
372 | if ( kkf->mFileName == file ) { | 372 | if ( kkf->mFileName == file ) { |
373 | KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); | 373 | KMessageBox::information( this, i18n("Sorry, the file \n%1\nis already loaded!\nPlease choose another file!").arg( KGlobal::formatMessage (file, 0 )) ); |
374 | tryagain = true; | 374 | tryagain = true; |
375 | file = ""; | 375 | file = ""; |
376 | break; | 376 | break; |
377 | } | 377 | } |
378 | kkf = KOPrefs::instance()->mCalendars.next(); | 378 | kkf = KOPrefs::instance()->mCalendars.next(); |
379 | } | 379 | } |
380 | } | 380 | } |
381 | addCalendar ( name, file ); | ||
382 | } | ||
383 | int KOCalEditView::addCalendar( QString name, QString file, bool ask ) | ||
384 | { | ||
385 | |||
381 | QFileInfo fi ( file ); | 386 | QFileInfo fi ( file ); |
382 | if (!fi.exists() ) { | 387 | if (!fi.exists() ) { |
383 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) | 388 | if ( ask ) |
384 | return; | 389 | if ( KMessageBox::questionYesNo(this, i18n("The file\n%1\ndoes not exist!\nShall I create it for you?").arg( file ) )== KMessageBox::No ) |
390 | return 0; | ||
385 | QFile fileIn( file ); | 391 | QFile fileIn( file ); |
386 | if (!fileIn.open( IO_WriteOnly ) ) { | 392 | if (!fileIn.open( IO_WriteOnly ) ) { |
387 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); | 393 | KMessageBox::sorry( this, i18n("Sorry, cannot create the file\n%1!\nNo calendar added!").arg( file ) ); |
388 | return; | 394 | return 0; |
389 | } | 395 | } |
390 | QTextStream tsIn( &fileIn ); | 396 | QTextStream tsIn( &fileIn ); |
391 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 397 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
392 | tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; | 398 | tsIn << "BEGIN:VCALENDAR\nPRODID:-//KDE-Pim//Platform-independent 2.1.0\nVERSION:2.0\nEND:VCALENDAR\n"; |
393 | fileIn.close(); | 399 | fileIn.close(); |
394 | } | 400 | } |
395 | KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); | 401 | KopiCalendarFile * kkf = KOPrefs::instance()->getNewCalendar(); |
396 | kkf->mName = name; | 402 | kkf->mName = name; |
397 | kkf->mFileName = file; | 403 | kkf->mFileName = file; |
398 | emit calendarAdded( kkf->mCalNumber ); | 404 | emit calendarAdded( kkf->mCalNumber ); |
399 | emit needsUpdate(); | 405 | if ( ask ) |
400 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 406 | emit needsUpdate(); |
407 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | ||
408 | return kkf->mCalNumber; | ||
401 | } | 409 | } |
410 | int KOCalEditView::getBirtdayID() | ||
411 | { | ||
412 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | ||
413 | while ( kkf ) { | ||
414 | if ( kkf->mName == i18n("Birthdays") ) | ||
415 | return kkf->mCalNumber; | ||
416 | kkf = KOPrefs::instance()->mCalendars.next(); | ||
417 | } | ||
418 | QString file = locateLocal( "data", "korganizer/birthdays.ics" ); | ||
419 | return addCalendar( i18n("Birthdays"), file, false ); | ||
420 | } | ||
421 | |||
402 | void KOCalEditView::enableAll() | 422 | void KOCalEditView::enableAll() |
403 | { | 423 | { |
404 | toggleList( mEnabledB ); | 424 | toggleList( mEnabledB ); |
405 | } | 425 | } |
406 | void KOCalEditView::enableAlarm() | 426 | void KOCalEditView::enableAlarm() |
407 | { | 427 | { |
408 | toggleList( mAlarmB ); | 428 | toggleList( mAlarmB ); |
409 | } | 429 | } |
410 | void KOCalEditView::disableRO() | 430 | void KOCalEditView::disableRO() |
411 | { | 431 | { |
412 | toggleList( mROB ); | 432 | toggleList( mROB ); |
413 | } | 433 | } |
414 | void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list ) | 434 | void KOCalEditView::toggleList ( QPtrList<KOCalCheckButton> list ) |
415 | { | 435 | { |
416 | bool dis = false; | 436 | bool dis = false; |
417 | KOCalCheckButton* it = list.first(); | 437 | KOCalCheckButton* it = list.first(); |
418 | while ( it ) { | 438 | while ( it ) { |
419 | if ( !it->isChecked() ) { | 439 | if ( !it->isChecked() ) { |
420 | dis = true; | 440 | dis = true; |
421 | break; | 441 | break; |
422 | } | 442 | } |
423 | it = list.next(); | 443 | it = list.next(); |
424 | } | 444 | } |
425 | it = list.first(); | 445 | it = list.first(); |
426 | while ( it ) { | 446 | while ( it ) { |
427 | it->setChecked(dis); | 447 | it->setChecked(dis); |
428 | it = list.next(); | 448 | it = list.next(); |
429 | } | 449 | } |
430 | } | 450 | } |
431 | void KOCalEditView::deleteAll() | 451 | void KOCalEditView::deleteAll() |
432 | { | 452 | { |
433 | qDebug("delteAll"); | 453 | qDebug("delteAll"); |
434 | } | 454 | } |
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index b57a6e9..54fe2c5 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -115,134 +115,135 @@ private: | |||
115 | int mNumber; | 115 | int mNumber; |
116 | void keyPressEvent ( QKeyEvent * e ) | 116 | void keyPressEvent ( QKeyEvent * e ) |
117 | { | 117 | { |
118 | e->ignore(); | 118 | e->ignore(); |
119 | } | 119 | } |
120 | 120 | ||
121 | private slots : | 121 | private slots : |
122 | void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } | 122 | void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); } |
123 | }; | 123 | }; |
124 | class KOCalCheckButton : public QCheckBox | 124 | class KOCalCheckButton : public QCheckBox |
125 | { | 125 | { |
126 | Q_OBJECT | 126 | Q_OBJECT |
127 | public: | 127 | public: |
128 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : | 128 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : |
129 | QCheckBox( parent, name) | 129 | QCheckBox( parent, name) |
130 | { | 130 | { |
131 | connect( this, SIGNAL( toggled ( bool ) ), | 131 | connect( this, SIGNAL( toggled ( bool ) ), |
132 | SLOT( bottonClicked( bool ) )); | 132 | SLOT( bottonClicked( bool ) )); |
133 | mNumber = -1; | 133 | mNumber = -1; |
134 | setFocusPolicy(NoFocus); | 134 | setFocusPolicy(NoFocus); |
135 | //setMaximumWidth( 10 ); | 135 | //setMaximumWidth( 10 ); |
136 | 136 | ||
137 | } | 137 | } |
138 | void setNum ( int num ) {mNumber = num; } | 138 | void setNum ( int num ) {mNumber = num; } |
139 | signals: | 139 | signals: |
140 | void selectNum ( int, bool ); | 140 | void selectNum ( int, bool ); |
141 | private: | 141 | private: |
142 | int mNumber; | 142 | int mNumber; |
143 | void keyPressEvent ( QKeyEvent * e ) | 143 | void keyPressEvent ( QKeyEvent * e ) |
144 | { | 144 | { |
145 | e->ignore(); | 145 | e->ignore(); |
146 | } | 146 | } |
147 | 147 | ||
148 | private slots : | 148 | private slots : |
149 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } | 149 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } |
150 | }; | 150 | }; |
151 | 151 | ||
152 | class KOCalRadioButton : public QRadioButton | 152 | class KOCalRadioButton : public QRadioButton |
153 | { | 153 | { |
154 | Q_OBJECT | 154 | Q_OBJECT |
155 | public: | 155 | public: |
156 | KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : | 156 | KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : |
157 | QRadioButton( parent, name) | 157 | QRadioButton( parent, name) |
158 | { | 158 | { |
159 | connect( this, SIGNAL( toggled ( bool ) ), | 159 | connect( this, SIGNAL( toggled ( bool ) ), |
160 | SLOT( bottonClicked( bool ) )); | 160 | SLOT( bottonClicked( bool ) )); |
161 | mNumber = -1; | 161 | mNumber = -1; |
162 | setFocusPolicy(NoFocus); | 162 | setFocusPolicy(NoFocus); |
163 | //setMaximumWidth( 10 ); | 163 | //setMaximumWidth( 10 ); |
164 | 164 | ||
165 | } | 165 | } |
166 | void setNum ( int num ) {mNumber = num; } | 166 | void setNum ( int num ) {mNumber = num; } |
167 | signals: | 167 | signals: |
168 | void selectNum ( int, bool ); | 168 | void selectNum ( int, bool ); |
169 | private: | 169 | private: |
170 | int mNumber; | 170 | int mNumber; |
171 | void keyPressEvent ( QKeyEvent * e ) | 171 | void keyPressEvent ( QKeyEvent * e ) |
172 | { | 172 | { |
173 | e->ignore(); | 173 | e->ignore(); |
174 | } | 174 | } |
175 | 175 | ||
176 | private slots : | 176 | private slots : |
177 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } | 177 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } |
178 | }; | 178 | }; |
179 | 179 | ||
180 | 180 | ||
181 | 181 | ||
182 | class KOFilterView : public KOFilterView_base | 182 | class KOFilterView : public KOFilterView_base |
183 | { | 183 | { |
184 | Q_OBJECT | 184 | Q_OBJECT |
185 | public: | 185 | public: |
186 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); | 186 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); |
187 | ~KOFilterView(); | 187 | ~KOFilterView(); |
188 | 188 | ||
189 | void updateFilters(); | 189 | void updateFilters(); |
190 | 190 | ||
191 | bool filtersEnabled(); | 191 | bool filtersEnabled(); |
192 | void setFiltersEnabled(bool); | 192 | void setFiltersEnabled(bool); |
193 | CalFilter *selectedFilter(); | 193 | CalFilter *selectedFilter(); |
194 | void setSelectedFilter(QString); | 194 | void setSelectedFilter(QString); |
195 | void setSelectedFilter( int ); | 195 | void setSelectedFilter( int ); |
196 | 196 | ||
197 | signals: | 197 | signals: |
198 | void filterChanged(); | 198 | void filterChanged(); |
199 | void editFilters(); | 199 | void editFilters(); |
200 | 200 | ||
201 | private: | 201 | private: |
202 | QPtrList<CalFilter> *mFilters; | 202 | QPtrList<CalFilter> *mFilters; |
203 | }; | 203 | }; |
204 | 204 | ||
205 | class KOCalEditView : public QScrollView | 205 | class KOCalEditView : public QScrollView |
206 | { | 206 | { |
207 | Q_OBJECT | 207 | Q_OBJECT |
208 | public: | 208 | public: |
209 | KOCalEditView( QWidget* parent=0,const char* name=0); | 209 | KOCalEditView( QWidget* parent=0,const char* name=0); |
210 | ~KOCalEditView(); | 210 | ~KOCalEditView(); |
211 | 211 | int addCalendar( QString calName, QString fileName, bool ask = true ); | |
212 | int getBirtdayID(); | ||
212 | public slots: | 213 | public slots: |
213 | void addCal(); | 214 | void addCal(); |
214 | void enableAll(); | 215 | void enableAll(); |
215 | void enableAlarm(); | 216 | void enableAlarm(); |
216 | void disableRO(); | 217 | void disableRO(); |
217 | void deleteAll(); | 218 | void deleteAll(); |
218 | void selectStdCal(int,bool ); | 219 | void selectStdCal(int,bool ); |
219 | void selectCal(int,bool ); | 220 | void selectCal(int,bool ); |
220 | void selectCalAlarm(int,bool ); | 221 | void selectCalAlarm(int,bool ); |
221 | void selectReadOnly(int,bool ); | 222 | void selectReadOnly(int,bool ); |
222 | void setColor(const QColor &,int) ; | 223 | void setColor(const QColor &,int) ; |
223 | void deleteCal(int) ; | 224 | void deleteCal(int) ; |
224 | void infoCal(int) ; | 225 | void infoCal(int) ; |
225 | void readConfig(); | 226 | void readConfig(); |
226 | void defaultInfo(); | 227 | void defaultInfo(); |
227 | signals: | 228 | signals: |
228 | void alarmEnabled ( int cal, bool enable ); | 229 | void alarmEnabled ( int cal, bool enable ); |
229 | void calendarEnabled ( int cal, bool enable ); | 230 | void calendarEnabled ( int cal, bool enable ); |
230 | void calendarReadonly ( int cal, bool readonly ); | 231 | void calendarReadonly ( int cal, bool readonly ); |
231 | void setCalendarDefault ( int cal ); | 232 | void setCalendarDefault ( int cal ); |
232 | void removeCalendar ( int cal ); | 233 | void removeCalendar ( int cal ); |
233 | void calendarAdded( int ); | 234 | void calendarAdded( int ); |
234 | void needsUpdate(); | 235 | void needsUpdate(); |
235 | 236 | ||
236 | private: | 237 | private: |
237 | QWidget *mw; | 238 | QWidget *mw; |
238 | void toggleList ( QPtrList<KOCalCheckButton> ); | 239 | void toggleList ( QPtrList<KOCalCheckButton> ); |
239 | QPtrList<KOCalRadioButton> mStdandardB; | 240 | QPtrList<KOCalRadioButton> mStdandardB; |
240 | QPtrList<KOCalCheckButton> mEnabledB; | 241 | QPtrList<KOCalCheckButton> mEnabledB; |
241 | QPtrList<KOCalCheckButton> mAlarmB; | 242 | QPtrList<KOCalCheckButton> mAlarmB; |
242 | QPtrList<KOCalCheckButton> mROB; | 243 | QPtrList<KOCalCheckButton> mROB; |
243 | QGridLayout* mainLayout; | 244 | QGridLayout* mainLayout; |
244 | }; | 245 | }; |
245 | 246 | ||
246 | 247 | ||
247 | 248 | ||
248 | #endif // KOFILTERVIEW_H | 249 | #endif // KOFILTERVIEW_H |
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index a4ea3d3..7ba7269 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -367,192 +367,196 @@ void KOPrefs::setAllDefaults() | |||
367 | } | 367 | } |
368 | 368 | ||
369 | void KOPrefs::setCategoryDefaults() | 369 | void KOPrefs::setCategoryDefaults() |
370 | { | 370 | { |
371 | mCustomCategories.clear(); | 371 | mCustomCategories.clear(); |
372 | mCustomCategories = getDefaultList(); | 372 | mCustomCategories = getDefaultList(); |
373 | 373 | ||
374 | QStringList::Iterator it; | 374 | QStringList::Iterator it; |
375 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 375 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
376 | setCategoryColor(*it,mDefaultCategoryColor); | 376 | setCategoryColor(*it,mDefaultCategoryColor); |
377 | } | 377 | } |
378 | } | 378 | } |
379 | QStringList KOPrefs::getLocationDefaultList() | 379 | QStringList KOPrefs::getLocationDefaultList() |
380 | { | 380 | { |
381 | QStringList retval ; | 381 | QStringList retval ; |
382 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 382 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
383 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") | 383 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") |
384 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 384 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
385 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 385 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
386 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 386 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
387 | 387 | ||
388 | retval.sort(); | 388 | retval.sort(); |
389 | return retval; | 389 | return retval; |
390 | } | 390 | } |
391 | QStringList KOPrefs::getDefaultList() | 391 | QStringList KOPrefs::getDefaultList() |
392 | { | 392 | { |
393 | QStringList retval ; | 393 | QStringList retval ; |
394 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") | 394 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") |
395 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") | 395 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") |
396 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") | 396 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") |
397 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") | 397 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") |
398 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") | 398 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") |
399 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") | 399 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") |
400 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") | 400 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") |
401 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; | 401 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; |
402 | retval.sort(); | 402 | retval.sort(); |
403 | //qDebug("cat %s ", retval.join("-").latin1()); | 403 | //qDebug("cat %s ", retval.join("-").latin1()); |
404 | return retval; | 404 | return retval; |
405 | } | 405 | } |
406 | 406 | ||
407 | void KOPrefs::usrReadConfig() | 407 | void KOPrefs::usrReadConfig() |
408 | { | 408 | { |
409 | config()->setGroup("General"); | 409 | config()->setGroup("General"); |
410 | 410 | ||
411 | //qDebug("KOPrefs::usrReadConfig() "); | 411 | //qDebug("KOPrefs::usrReadConfig() "); |
412 | mCustomCategories = config()->readListEntry("Custom Categories"); | 412 | mCustomCategories = config()->readListEntry("Custom Categories"); |
413 | mOldLoadedLanguage = mOldLanguage ; | 413 | mOldLoadedLanguage = mOldLanguage ; |
414 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 414 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
415 | if (mLocationDefaults.isEmpty()) { | 415 | if (mLocationDefaults.isEmpty()) { |
416 | mLocationDefaults = getLocationDefaultList(); | 416 | mLocationDefaults = getLocationDefaultList(); |
417 | } | 417 | } |
418 | 418 | ||
419 | if (mEventSummaryUser.isEmpty()) { | 419 | if (mEventSummaryUser.isEmpty()) { |
420 | mEventSummaryUser = getDefaultList() ; | 420 | mEventSummaryUser = getDefaultList() ; |
421 | } | 421 | } |
422 | if (mTodoSummaryUser.isEmpty()) { | 422 | if (mTodoSummaryUser.isEmpty()) { |
423 | mTodoSummaryUser = getDefaultList() ; | 423 | mTodoSummaryUser = getDefaultList() ; |
424 | } | 424 | } |
425 | 425 | ||
426 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); | 426 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); |
427 | 427 | ||
428 | config()->setGroup("Personal Settings"); | 428 | config()->setGroup("Personal Settings"); |
429 | mName = config()->readEntry("user_name",""); | 429 | mName = config()->readEntry("user_name",""); |
430 | mEmail = config()->readEntry("user_email",""); | 430 | mEmail = config()->readEntry("user_email",""); |
431 | fillMailDefaults(); | 431 | fillMailDefaults(); |
432 | 432 | ||
433 | config()->setGroup("Category Colors"); | 433 | config()->setGroup("Category Colors"); |
434 | QStringList::Iterator it; | 434 | QStringList::Iterator it; |
435 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 435 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
436 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); | 436 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); |
437 | 437 | ||
438 | } | 438 | } |
439 | KConfig fc (locateLocal("config","kopicalendarrc")); | 439 | KConfig fc (locateLocal("config","kopicalendarrc")); |
440 | fc.setGroup("CC"); | 440 | fc.setGroup("CC"); |
441 | int numCals = fc.readNumEntry("NumberCalendars",0 ); | 441 | int numCals = fc.readNumEntry("NumberCalendars",0 ); |
442 | mNextAvailableCalendar = 1; | 442 | mNextAvailableCalendar = 1; |
443 | if ( numCals == 0 ) { | 443 | if ( numCals == 0 ) { |
444 | KopiCalendarFile *kkf = getNewCalendar(); | 444 | KopiCalendarFile *kkf = getNewCalendar(); |
445 | kkf->isStandard = true; | 445 | kkf->isStandard = true; |
446 | kkf->mName = i18n("Standard"); | 446 | kkf->mName = i18n("Standard"); |
447 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 447 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |
448 | } | 448 | } |
449 | while ( mNextAvailableCalendar <= numCals ) { | 449 | while ( mNextAvailableCalendar <= numCals ) { |
450 | //qDebug("Read cal #%d ", mNextAvailableCalendar ); | 450 | //qDebug("Read cal #%d ", mNextAvailableCalendar ); |
451 | QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); | 451 | QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); |
452 | KopiCalendarFile *kkf = getNewCalendar(); | 452 | KopiCalendarFile *kkf = getNewCalendar(); |
453 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); | 453 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); |
454 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); | 454 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); |
455 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); | 455 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); |
456 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); | 456 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); |
457 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); | 457 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); |
458 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); | 458 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); |
459 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); | 459 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); |
460 | if ( kkf->mCalNumber == 1 ) { | 460 | if ( kkf->mCalNumber == 1 ) { |
461 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 461 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |
462 | } | 462 | } |
463 | //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); | ||
464 | if ( kkf->mName == i18n("Birthdays") ) { | ||
465 | kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); | ||
466 | } | ||
463 | } | 467 | } |
464 | 468 | ||
465 | KPimPrefs::usrReadConfig(); | 469 | KPimPrefs::usrReadConfig(); |
466 | } | 470 | } |
467 | 471 | ||
468 | KopiCalendarFile * KOPrefs::getCalendar( int num ) | 472 | KopiCalendarFile * KOPrefs::getCalendar( int num ) |
469 | { | 473 | { |
470 | return mDefCalColors[num-1]; | 474 | return mDefCalColors[num-1]; |
471 | } | 475 | } |
472 | 476 | ||
473 | KopiCalendarFile * KOPrefs::getNewCalendar() | 477 | KopiCalendarFile * KOPrefs::getNewCalendar() |
474 | { | 478 | { |
475 | KopiCalendarFile * kkf = new KopiCalendarFile(); | 479 | KopiCalendarFile * kkf = new KopiCalendarFile(); |
476 | kkf->mCalNumber = mNextAvailableCalendar; | 480 | kkf->mCalNumber = mNextAvailableCalendar; |
477 | mDefCalColors.resize( mNextAvailableCalendar ); | 481 | mDefCalColors.resize( mNextAvailableCalendar ); |
478 | mDefCalColors[mNextAvailableCalendar-1] = kkf; | 482 | mDefCalColors[mNextAvailableCalendar-1] = kkf; |
479 | ++mNextAvailableCalendar; | 483 | ++mNextAvailableCalendar; |
480 | kkf->mDefaultColor = mEventColor; | 484 | kkf->mDefaultColor = mEventColor; |
481 | kkf->mName = i18n("New Calendar"); | 485 | kkf->mName = i18n("New Calendar"); |
482 | mCalendars.append( kkf ); | 486 | mCalendars.append( kkf ); |
483 | return kkf; | 487 | return kkf; |
484 | } | 488 | } |
485 | void KOPrefs::deleteCalendar( int num ) | 489 | void KOPrefs::deleteCalendar( int num ) |
486 | { | 490 | { |
487 | KopiCalendarFile * kkf = mCalendars.first(); | 491 | KopiCalendarFile * kkf = mCalendars.first(); |
488 | while ( kkf ) { | 492 | while ( kkf ) { |
489 | if ( kkf->mCalNumber == num ) { | 493 | if ( kkf->mCalNumber == num ) { |
490 | qDebug("KOPrefs::deleteCalendar %d ", num ); | 494 | qDebug("KOPrefs::deleteCalendar %d ", num ); |
491 | mCalendars.remove( kkf ); | 495 | mCalendars.remove( kkf ); |
492 | delete kkf; | 496 | delete kkf; |
493 | return; | 497 | return; |
494 | } | 498 | } |
495 | kkf = mCalendars.next(); | 499 | kkf = mCalendars.next(); |
496 | } | 500 | } |
497 | } | 501 | } |
498 | QString KOPrefs::calName( int calNum) const | 502 | QString KOPrefs::calName( int calNum) const |
499 | { | 503 | { |
500 | return (mDefCalColors[calNum-1])->mName; | 504 | return (mDefCalColors[calNum-1])->mName; |
501 | } | 505 | } |
502 | QColor KOPrefs::defaultColor( int calNum ) const | 506 | QColor KOPrefs::defaultColor( int calNum ) const |
503 | { | 507 | { |
504 | if ( calNum == 1 ) return mEventColor; | 508 | if ( calNum == 1 ) return mEventColor; |
505 | return (mDefCalColors[calNum-1])->mDefaultColor; | 509 | return (mDefCalColors[calNum-1])->mDefaultColor; |
506 | } | 510 | } |
507 | void KOPrefs::usrWriteConfig() | 511 | void KOPrefs::usrWriteConfig() |
508 | { | 512 | { |
509 | config()->setGroup("General"); | 513 | config()->setGroup("General"); |
510 | config()->writeEntry("Custom Categories",mCustomCategories); | 514 | config()->writeEntry("Custom Categories",mCustomCategories); |
511 | 515 | ||
512 | config()->setGroup("Personal Settings"); | 516 | config()->setGroup("Personal Settings"); |
513 | config()->writeEntry("user_name",mName); | 517 | config()->writeEntry("user_name",mName); |
514 | config()->writeEntry("user_email",mEmail); | 518 | config()->writeEntry("user_email",mEmail); |
515 | 519 | ||
516 | config()->setGroup("Category Colors"); | 520 | config()->setGroup("Category Colors"); |
517 | QDictIterator<QColor> it(mCategoryColors); | 521 | QDictIterator<QColor> it(mCategoryColors); |
518 | while (it.current()) { | 522 | while (it.current()) { |
519 | config()->writeEntry(it.currentKey(),*(it.current())); | 523 | config()->writeEntry(it.currentKey(),*(it.current())); |
520 | ++it; | 524 | ++it; |
521 | } | 525 | } |
522 | KConfig fc (locateLocal("config","kopicalendarrc")); | 526 | KConfig fc (locateLocal("config","kopicalendarrc")); |
523 | fc.setGroup("CC"); | 527 | fc.setGroup("CC"); |
524 | fc.writeEntry("NumberCalendars",mCalendars.count()); | 528 | fc.writeEntry("NumberCalendars",mCalendars.count()); |
525 | int numCal = 1; | 529 | int numCal = 1; |
526 | int writeCal = 0; | 530 | int writeCal = 0; |
527 | while ( numCal < mNextAvailableCalendar ) { | 531 | while ( numCal < mNextAvailableCalendar ) { |
528 | KopiCalendarFile * kkf = mCalendars.first(); | 532 | KopiCalendarFile * kkf = mCalendars.first(); |
529 | while ( kkf ) { | 533 | while ( kkf ) { |
530 | //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); | 534 | //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); |
531 | if ( kkf->mCalNumber == numCal ) { | 535 | if ( kkf->mCalNumber == numCal ) { |
532 | ++writeCal; | 536 | ++writeCal; |
533 | //qDebug("Write calendar %d %d ", numCal , writeCal); | 537 | //qDebug("Write calendar %d %d ", numCal , writeCal); |
534 | QString prefix = "Cal_" + QString::number( writeCal ); | 538 | QString prefix = "Cal_" + QString::number( writeCal ); |
535 | fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); | 539 | fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); |
536 | fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); | 540 | fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); |
537 | fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); | 541 | fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); |
538 | fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); | 542 | fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); |
539 | fc.writeEntry( prefix+"_Name", kkf->mName); | 543 | fc.writeEntry( prefix+"_Name", kkf->mName); |
540 | fc.writeEntry( prefix+"_FileName", kkf->mFileName); | 544 | fc.writeEntry( prefix+"_FileName", kkf->mFileName); |
541 | fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); | 545 | fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); |
542 | } | 546 | } |
543 | kkf = mCalendars.next(); | 547 | kkf = mCalendars.next(); |
544 | } | 548 | } |
545 | ++numCal; | 549 | ++numCal; |
546 | } | 550 | } |
547 | fc.sync(); | 551 | fc.sync(); |
548 | KPimPrefs::usrWriteConfig(); | 552 | KPimPrefs::usrWriteConfig(); |
549 | } | 553 | } |
550 | 554 | ||
551 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) | 555 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) |
552 | { | 556 | { |
553 | mCategoryColors.replace(cat,new QColor(color)); | 557 | mCategoryColors.replace(cat,new QColor(color)); |
554 | } | 558 | } |
555 | 559 | ||
556 | QColor *KOPrefs::categoryColor(QString cat) | 560 | QColor *KOPrefs::categoryColor(QString cat) |
557 | { | 561 | { |
558 | QColor *color = 0; | 562 | QColor *color = 0; |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 2bf46b9..c9d1345 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -1,114 +1,115 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | #ifndef DESKTOP_VERSION | 3 | #ifndef DESKTOP_VERSION |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qcopchannel_qws.h> | 5 | #include <qcopchannel_qws.h> |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #else | 8 | #else |
9 | #include <qapplication.h> | 9 | #include <qapplication.h> |
10 | #include <qstring.h> | 10 | #include <qstring.h> |
11 | #include <qwindowsstyle.h> | 11 | #include <qwindowsstyle.h> |
12 | #include <qplatinumstyle.h> | 12 | #include <qplatinumstyle.h> |
13 | #include <qsgistyle.h> | 13 | #include <qsgistyle.h> |
14 | #include <stdlib.h> | 14 | #include <stdlib.h> |
15 | #endif | 15 | #endif |
16 | #include <qtextcodec.h> | 16 | #include <qtextcodec.h> |
17 | 17 | ||
18 | #include <qdir.h> | 18 | #include <qdir.h> |
19 | #include <kstandarddirs.h> | 19 | #include <kstandarddirs.h> |
20 | #include <kglobal.h> | 20 | #include <kglobal.h> |
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | #include <libkdepim/kpimglobalprefs.h> | 23 | #include <libkdepim/kpimglobalprefs.h> |
24 | void dumpMissing(); | 24 | void dumpMissing(); |
25 | 25 | ||
26 | 26 | ||
27 | int main( int argc, char **argv ) | 27 | int main( int argc, char **argv ) |
28 | { | 28 | { |
29 | #ifndef DESKTOP_VERSION | 29 | #ifndef DESKTOP_VERSION |
30 | QPEApplication a( argc, argv ); | 30 | QPEApplication a( argc, argv ); |
31 | a.setKeepRunning (); | 31 | a.setKeepRunning (); |
32 | #else | 32 | #else |
33 | QApplication a( argc, argv ); | 33 | QApplication a( argc, argv ); |
34 | QApplication::setStyle( new QPlatinumStyle ()); | 34 | QApplication::setStyle( new QPlatinumStyle ()); |
35 | #ifdef _WIN32_ | 35 | #ifdef _WIN32_ |
36 | QString hdir ( getenv( "HOME") ); | 36 | QString hdir ( getenv( "HOME") ); |
37 | if ( hdir.isEmpty() ) { | 37 | if ( hdir.isEmpty() ) { |
38 | QString hd ("C:/" ); | 38 | QString hd ("C:/" ); |
39 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); | 39 | //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); |
40 | if ( QDir::homeDirPath().lower() == hd.lower() ) { | 40 | if ( QDir::homeDirPath().lower() == hd.lower() ) { |
41 | _putenv( "HOME=C:"); | 41 | _putenv( "HOME=C:"); |
42 | //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); | 42 | //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); |
43 | } | 43 | } |
44 | } else { | 44 | } else { |
45 | QDir app_dir; | 45 | QDir app_dir; |
46 | if ( !app_dir.exists(hdir) ) | 46 | if ( !app_dir.exists(hdir) ) |
47 | app_dir.mkdir (hdir); | 47 | app_dir.mkdir (hdir); |
48 | } | 48 | } |
49 | #endif | 49 | #endif |
50 | #endif | 50 | #endif |
51 | bool exitHelp = false; | 51 | bool exitHelp = false; |
52 | if ( argc > 1 ) { | 52 | if ( argc > 1 ) { |
53 | QString command = argv[1]; | 53 | QString command = argv[1]; |
54 | if ( command == "-help" ){ | 54 | if ( command == "-help" ){ |
55 | printf("KO/Pi command line commands:\n"); | 55 | printf("KO/Pi command line commands:\n"); |
56 | printf(" no command: Start KO/Pi in usual way\n"); | 56 | printf(" no command: Start KO/Pi in usual way\n"); |
57 | printf(" -help: This output\n"); | 57 | printf(" -help: This output\n"); |
58 | printf("Next Option: Open or Show after start:\n"); | 58 | printf("Next Option: Open or Show after start:\n"); |
59 | printf(" -newTodo: New Todo dialog\n"); | 59 | printf(" -newTodo: New Todo dialog\n"); |
60 | printf(" -newEvent: New Event dialog\n"); | 60 | printf(" -newEvent: New Event dialog\n"); |
61 | printf(" -showList: List view\n"); | 61 | printf(" -showList: List view\n"); |
62 | printf(" -showDay: Day view\n"); | 62 | printf(" -showDay: Day view\n"); |
63 | printf(" -showWWeek: Work Week view\n"); | 63 | printf(" -showWWeek: Work Week view\n"); |
64 | printf(" -showWeek: Week view\n"); | 64 | printf(" -showWeek: Week view\n"); |
65 | printf(" -showTodo: Todo view\n"); | 65 | printf(" -showTodo: Todo view\n"); |
66 | printf(" -showJournal: Journal view\n"); | 66 | printf(" -showJournal: Journal view\n"); |
67 | printf(" -showKO: Next Days view\n"); | 67 | printf(" -showKO: Next Days view\n"); |
68 | printf(" -showWNext: What's Next view\n"); | 68 | printf(" -showWNext: What's Next view\n"); |
69 | printf(" -showNextXView: Next X View\n"); | 69 | printf(" -showNextXView: Next X View\n"); |
70 | printf(" -new[Y] and -show[X] may be used togehther\n"); | 70 | printf(" -new[Y] and -show[X] may be used togehther\n"); |
71 | printf(" KO/Pi is exiting now. Bye!\n"); | 71 | printf(" KO/Pi is exiting now. Bye!\n"); |
72 | exitHelp = true; | 72 | exitHelp = true; |
73 | } | 73 | } |
74 | } | 74 | } |
75 | if ( ! exitHelp ) { | 75 | if ( ! exitHelp ) { |
76 | KGlobal::setAppName( "korganizer" ); | 76 | KGlobal::setAppName( "korganizer" ); |
77 | QString fileName ; | 77 | QString fileName ; |
78 | #ifndef DESKTOP_VERSION | 78 | #ifndef DESKTOP_VERSION |
79 | fileName = getenv("QPEDIR"); | 79 | fileName = getenv("QPEDIR"); |
80 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); | 80 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); |
81 | #else | 81 | #else |
82 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; | 82 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; |
83 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 83 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
84 | #endif | 84 | #endif |
85 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); | 85 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); |
86 | 86 | ||
87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); | 87 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); |
88 | KPimGlobalPrefs::instance()->setGlobalConfig(); | ||
88 | MainWindow m; | 89 | MainWindow m; |
89 | #ifndef DESKTOP_VERSION | 90 | #ifndef DESKTOP_VERSION |
90 | 91 | ||
91 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 92 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
92 | a.showMainWidget(&m ); | 93 | a.showMainWidget(&m ); |
93 | #else | 94 | #else |
94 | a.setMainWidget(&m ); | 95 | a.setMainWidget(&m ); |
95 | m.show(); | 96 | m.show(); |
96 | //m.resize( 800, 600 ); | 97 | //m.resize( 800, 600 ); |
97 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | 98 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); |
98 | #endif | 99 | #endif |
99 | if ( argc > 1 ) { | 100 | if ( argc > 1 ) { |
100 | QCString command = argv[1]; | 101 | QCString command = argv[1]; |
101 | if ( argc > 2 ) | 102 | if ( argc > 2 ) |
102 | command += argv[2]; | 103 | command += argv[2]; |
103 | qApp->processEvents(); | 104 | qApp->processEvents(); |
104 | m.recieve(command, QByteArray() ); | 105 | m.recieve(command, QByteArray() ); |
105 | 106 | ||
106 | } | 107 | } |
107 | 108 | ||
108 | a.exec(); | 109 | a.exec(); |
109 | dumpMissing(); | 110 | dumpMissing(); |
110 | 111 | ||
111 | KPimGlobalPrefs::instance()->writeConfig(); | 112 | KPimGlobalPrefs::instance()->writeConfig(); |
112 | } | 113 | } |
113 | qDebug("KO: Bye! "); | 114 | qDebug("KO: Bye! "); |
114 | } | 115 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index b9d8742..68233e8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -80,193 +80,193 @@ class KOex2phonePrefs : public QDialog | |||
80 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : | 80 | KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : |
81 | QDialog( parent, name, true ) | 81 | QDialog( parent, name, true ) |
82 | { | 82 | { |
83 | setCaption( i18n("Export to phone options") ); | 83 | setCaption( i18n("Export to phone options") ); |
84 | QVBoxLayout* lay = new QVBoxLayout( this ); | 84 | QVBoxLayout* lay = new QVBoxLayout( this ); |
85 | lay->setSpacing( 3 ); | 85 | lay->setSpacing( 3 ); |
86 | lay->setMargin( 3 ); | 86 | lay->setMargin( 3 ); |
87 | QLabel *lab; | 87 | QLabel *lab; |
88 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); | 88 | lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); |
89 | lab->setAlignment (AlignHCenter ); | 89 | lab->setAlignment (AlignHCenter ); |
90 | QHBox* temphb; | 90 | QHBox* temphb; |
91 | temphb = new QHBox( this ); | 91 | temphb = new QHBox( this ); |
92 | new QLabel( i18n("I/O device: "), temphb ); | 92 | new QLabel( i18n("I/O device: "), temphb ); |
93 | mPhoneDevice = new QLineEdit( temphb); | 93 | mPhoneDevice = new QLineEdit( temphb); |
94 | lay->addWidget( temphb ); | 94 | lay->addWidget( temphb ); |
95 | temphb = new QHBox( this ); | 95 | temphb = new QHBox( this ); |
96 | new QLabel( i18n("Connection: "), temphb ); | 96 | new QLabel( i18n("Connection: "), temphb ); |
97 | mPhoneConnection = new QLineEdit( temphb); | 97 | mPhoneConnection = new QLineEdit( temphb); |
98 | lay->addWidget( temphb ); | 98 | lay->addWidget( temphb ); |
99 | temphb = new QHBox( this ); | 99 | temphb = new QHBox( this ); |
100 | new QLabel( i18n("Model(opt.): "), temphb ); | 100 | new QLabel( i18n("Model(opt.): "), temphb ); |
101 | mPhoneModel = new QLineEdit( temphb); | 101 | mPhoneModel = new QLineEdit( temphb); |
102 | lay->addWidget( temphb ); | 102 | lay->addWidget( temphb ); |
103 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); | 103 | mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); |
104 | mWriteBackFuture->setChecked( true ); | 104 | mWriteBackFuture->setChecked( true ); |
105 | lay->addWidget( mWriteBackFuture ); | 105 | lay->addWidget( mWriteBackFuture ); |
106 | temphb = new QHBox( this ); | 106 | temphb = new QHBox( this ); |
107 | new QLabel( i18n("Max. weeks in future: ") , temphb ); | 107 | new QLabel( i18n("Max. weeks in future: ") , temphb ); |
108 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); | 108 | mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); |
109 | mWriteBackFutureWeeks->setValue( 8 ); | 109 | mWriteBackFutureWeeks->setValue( 8 ); |
110 | lay->addWidget( temphb ); | 110 | lay->addWidget( temphb ); |
111 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); | 111 | lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); |
112 | lab->setAlignment (AlignHCenter ); | 112 | lab->setAlignment (AlignHCenter ); |
113 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); | 113 | QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); |
114 | lay->addWidget( ok ); | 114 | lay->addWidget( ok ); |
115 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 115 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
116 | lay->addWidget( cancel ); | 116 | lay->addWidget( cancel ); |
117 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 117 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
118 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 118 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
119 | resize( 220, 240 ); | 119 | resize( 220, 240 ); |
120 | qApp->processEvents(); | 120 | qApp->processEvents(); |
121 | int dw = QApplication::desktop()->width(); | 121 | int dw = QApplication::desktop()->width(); |
122 | int dh = QApplication::desktop()->height(); | 122 | int dh = QApplication::desktop()->height(); |
123 | move( (dw-width())/2, (dh - height() )/2 ); | 123 | move( (dw-width())/2, (dh - height() )/2 ); |
124 | } | 124 | } |
125 | 125 | ||
126 | public: | 126 | public: |
127 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 127 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
128 | QCheckBox* mWriteBackFuture; | 128 | QCheckBox* mWriteBackFuture; |
129 | QSpinBox* mWriteBackFutureWeeks; | 129 | QSpinBox* mWriteBackFutureWeeks; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | QPixmap* sgListViewCompletedPix[6]; | 132 | QPixmap* sgListViewCompletedPix[6]; |
133 | 133 | ||
134 | 134 | ||
135 | int globalFlagBlockStartup; | 135 | int globalFlagBlockStartup; |
136 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : | 136 | MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : |
137 | QMainWindow( parent, name ) | 137 | QMainWindow( parent, name ) |
138 | { | 138 | { |
139 | sgListViewCompletedPix[5] = &listviewPix; | 139 | sgListViewCompletedPix[5] = &listviewPix; |
140 | sgListViewCompletedPix[0] = &listviewPix0; | 140 | sgListViewCompletedPix[0] = &listviewPix0; |
141 | sgListViewCompletedPix[1] = &listviewPix20; | 141 | sgListViewCompletedPix[1] = &listviewPix20; |
142 | sgListViewCompletedPix[2] = &listviewPix40; | 142 | sgListViewCompletedPix[2] = &listviewPix40; |
143 | sgListViewCompletedPix[3] = &listviewPix60; | 143 | sgListViewCompletedPix[3] = &listviewPix60; |
144 | sgListViewCompletedPix[4] = &listviewPix80; | 144 | sgListViewCompletedPix[4] = &listviewPix80; |
145 | if ( sgListViewCompletedPix[5]->height() < 5 ) { | 145 | if ( sgListViewCompletedPix[5]->height() < 5 ) { |
146 | int size = 12; | 146 | int size = 12; |
147 | sgListViewCompletedPix[5]->resize( 11, 11 ); | 147 | sgListViewCompletedPix[5]->resize( 11, 11 ); |
148 | sgListViewCompletedPix[5]->fill( Qt::white ); | 148 | sgListViewCompletedPix[5]->fill( Qt::white ); |
149 | QPainter p ( sgListViewCompletedPix[5] ); | 149 | QPainter p ( sgListViewCompletedPix[5] ); |
150 | p.drawRect( 0,0,11,11); | 150 | p.drawRect( 0,0,11,11); |
151 | int half = size/2; | 151 | int half = size/2; |
152 | int heihei = size/2; | 152 | int heihei = size/2; |
153 | int x = 1; | 153 | int x = 1; |
154 | p.drawLine ( 2, 5, 4 , 7 ) ; | 154 | p.drawLine ( 2, 5, 4 , 7 ) ; |
155 | p.drawLine ( 4 , 7 , 8, 3) ; | 155 | p.drawLine ( 4 , 7 , 8, 3) ; |
156 | int iii = 0; | 156 | int iii = 0; |
157 | for ( iii = 0; iii < 5; ++iii ) { | 157 | for ( iii = 0; iii < 5; ++iii ) { |
158 | sgListViewCompletedPix[iii]->resize( 11, 11 ); | 158 | sgListViewCompletedPix[iii]->resize( 11, 11 ); |
159 | sgListViewCompletedPix[iii]->fill( Qt::white ); | 159 | sgListViewCompletedPix[iii]->fill( Qt::white ); |
160 | QPainter p ( sgListViewCompletedPix[iii] ); | 160 | QPainter p ( sgListViewCompletedPix[iii] ); |
161 | p.drawRect( 0,0,11,11); | 161 | p.drawRect( 0,0,11,11); |
162 | if ( iii ) | 162 | if ( iii ) |
163 | p.fillRect( 1,1,iii*2,9,Qt::gray ); | 163 | p.fillRect( 1,1,iii*2,9,Qt::gray ); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | mClosed = false; | 166 | mClosed = false; |
167 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; | 167 | //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; |
168 | QString confFile = locateLocal("config","korganizerrc"); | 168 | QString confFile = locateLocal("config","korganizerrc"); |
169 | QFileInfo finf ( confFile ); | 169 | QFileInfo finf ( confFile ); |
170 | bool showWarning = !finf.exists(); | 170 | bool showWarning = !finf.exists(); |
171 | setIcon(SmallIcon( "ko24" ) ); | 171 | setIcon(SmallIcon( "ko24" ) ); |
172 | mBlockAtStartup = true; | 172 | mBlockAtStartup = true; |
173 | mFlagKeyPressed = false; | 173 | mFlagKeyPressed = false; |
174 | setCaption("KO/Pi"); | 174 | setCaption("KO/Pi"); |
175 | KOPrefs *p = KOPrefs::instance(); | 175 | KOPrefs *p = KOPrefs::instance(); |
176 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 176 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
177 | p->mCurrentDisplayedView = 0; | 177 | p->mCurrentDisplayedView = 0; |
178 | if ( p->mHourSize > 22 ) | 178 | if ( p->mHourSize > 22 ) |
179 | p->mHourSize = 22; | 179 | p->mHourSize = 22; |
180 | QMainWindow::ToolBarDock tbd; | 180 | QMainWindow::ToolBarDock tbd; |
181 | if ( p->mToolBarHor ) { | 181 | if ( p->mToolBarHor ) { |
182 | if ( p->mToolBarUp ) | 182 | if ( p->mToolBarUp ) |
183 | tbd = Bottom; | 183 | tbd = Bottom; |
184 | else | 184 | else |
185 | tbd = Top; | 185 | tbd = Top; |
186 | } | 186 | } |
187 | else { | 187 | else { |
188 | if ( p->mToolBarUp ) | 188 | if ( p->mToolBarUp ) |
189 | tbd = Right; | 189 | tbd = Right; |
190 | else | 190 | else |
191 | tbd = Left; | 191 | tbd = Left; |
192 | } | 192 | } |
193 | if ( KOPrefs::instance()->mUseAppColors ) | 193 | if ( KOPrefs::instance()->mUseAppColors ) |
194 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 194 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
195 | globalFlagBlockStartup = 1; | 195 | globalFlagBlockStartup = 1; |
196 | iconToolBar = new QPEToolBar( this ); | 196 | iconToolBar = new QPEToolBar( this ); |
197 | addToolBar (iconToolBar , tbd ); | 197 | addToolBar (iconToolBar , tbd ); |
198 | 198 | ||
199 | #ifdef DESKTOP_VERSION | 199 | #ifdef DESKTOP_VERSION |
200 | if ( KOPrefs::instance()->mShowIconFilter ) | 200 | if ( KOPrefs::instance()->mShowIconFilter ) |
201 | #else | 201 | #else |
202 | if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) | 202 | if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) |
203 | #endif | 203 | #endif |
204 | 204 | ||
205 | { | 205 | { |
206 | if ( p->mToolBarHorF ) { | 206 | if ( p->mToolBarHorF ) { |
207 | if ( p->mToolBarUpF ) | 207 | if ( p->mToolBarUpF ) |
208 | tbd = Bottom; | 208 | tbd = Bottom; |
209 | else | 209 | else |
210 | tbd = Top; | 210 | tbd = Top; |
211 | } | 211 | } |
212 | else { | 212 | else { |
213 | if ( p->mToolBarUpF ) | 213 | if ( p->mToolBarUpF ) |
214 | tbd = Right; | 214 | tbd = Right; |
215 | else | 215 | else |
216 | tbd = Left; | 216 | tbd = Left; |
217 | } | 217 | } |
218 | filterToolBar = new QPEToolBar ( this ); | 218 | filterToolBar = new QPEToolBar ( this ); |
219 | filterMenubar = new QMenuBar( 0 ); | 219 | filterMenubar = new QMenuBar( 0 ); |
220 | QFontMetrics fm ( filterMenubar->font() ); | 220 | QFontMetrics fm ( filterMenubar->font() ); |
221 | 221 | ||
222 | filterPopupMenu = new QPopupMenu( this ); | 222 | filterPopupMenu = new QPopupMenu( this ); |
223 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); | 223 | filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); |
224 | QString addTest = "A"; | 224 | QString addTest = "A"; |
225 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); | 225 | filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); |
226 | #ifdef DESKTOP_VERSION | 226 | #ifdef DESKTOP_VERSION |
227 | addTest = "AAABBBCCCx"; | 227 | addTest = "AAABBBCCCx"; |
228 | #else | 228 | #else |
229 | addTest = "AAx"; | 229 | addTest = "AAx"; |
230 | #endif | 230 | #endif |
231 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); | 231 | filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); |
232 | addToolBar (filterToolBar , tbd ); | 232 | addToolBar (filterToolBar , tbd ); |
233 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); | 233 | connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); |
234 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); | 234 | connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); |
235 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) | 235 | if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) |
236 | filterToolBar->hide(); | 236 | filterToolBar->hide(); |
237 | } else { | 237 | } else { |
238 | filterToolBar = 0; | 238 | filterToolBar = 0; |
239 | filterMenubar = 0; | 239 | filterMenubar = 0; |
240 | filterPopupMenu = 0; | 240 | filterPopupMenu = 0; |
241 | } | 241 | } |
242 | if ( p->mShowIconOnetoolbar ) { | 242 | if ( p->mShowIconOnetoolbar ) { |
243 | viewToolBar = iconToolBar ; | 243 | viewToolBar = iconToolBar ; |
244 | navigatorToolBar = iconToolBar ; | 244 | navigatorToolBar = iconToolBar ; |
245 | } else { | 245 | } else { |
246 | #ifndef DESKTOP_VERSION | 246 | #ifndef DESKTOP_VERSION |
247 | setToolBarsMovable( false ); | 247 | setToolBarsMovable( false ); |
248 | #endif | 248 | #endif |
249 | if ( p->mToolBarHorV ) { | 249 | if ( p->mToolBarHorV ) { |
250 | if ( p->mToolBarUpV ) | 250 | if ( p->mToolBarUpV ) |
251 | tbd = Bottom; | 251 | tbd = Bottom; |
252 | else | 252 | else |
253 | tbd = Top; | 253 | tbd = Top; |
254 | } | 254 | } |
255 | else { | 255 | else { |
256 | if ( p->mToolBarUpV ) | 256 | if ( p->mToolBarUpV ) |
257 | tbd = Right; | 257 | tbd = Right; |
258 | else | 258 | else |
259 | tbd = Left; | 259 | tbd = Left; |
260 | } | 260 | } |
261 | viewToolBar = new QPEToolBar( this ); | 261 | viewToolBar = new QPEToolBar( this ); |
262 | addToolBar (viewToolBar , tbd ); | 262 | addToolBar (viewToolBar , tbd ); |
263 | if ( p->mToolBarHorN ) { | 263 | if ( p->mToolBarHorN ) { |
264 | if ( p->mToolBarUpN ) | 264 | if ( p->mToolBarUpN ) |
265 | tbd = Bottom; | 265 | tbd = Bottom; |
266 | else | 266 | else |
267 | tbd = Top; | 267 | tbd = Top; |
268 | } | 268 | } |
269 | else { | 269 | else { |
270 | if ( p->mToolBarUpN ) | 270 | if ( p->mToolBarUpN ) |
271 | tbd = Right; | 271 | tbd = Right; |
272 | else | 272 | else |
@@ -1630,193 +1630,193 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1630 | 1630 | ||
1631 | if ( !incidence ) { | 1631 | if ( !incidence ) { |
1632 | enableIncidenceActions( false ); | 1632 | enableIncidenceActions( false ); |
1633 | 1633 | ||
1634 | mNewSubTodoAction->setEnabled( false ); | 1634 | mNewSubTodoAction->setEnabled( false ); |
1635 | setCaptionToDates(); | 1635 | setCaptionToDates(); |
1636 | return; | 1636 | return; |
1637 | 1637 | ||
1638 | } | 1638 | } |
1639 | 1639 | ||
1640 | //KGlobal::locale()->formatDateTime(nextA, true); | 1640 | //KGlobal::locale()->formatDateTime(nextA, true); |
1641 | QString startString = ""; | 1641 | QString startString = ""; |
1642 | if ( incidence->typeID() != todoID ) { | 1642 | if ( incidence->typeID() != todoID ) { |
1643 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1643 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1644 | if ( incidence->doesFloat() ) { | 1644 | if ( incidence->doesFloat() ) { |
1645 | startString += ": "+incidence->dtStartDateStr( true ); | 1645 | startString += ": "+incidence->dtStartDateStr( true ); |
1646 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1646 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1647 | 1647 | ||
1648 | } else { | 1648 | } else { |
1649 | startString = ": "+incidence->dtStartStr(true); | 1649 | startString = ": "+incidence->dtStartStr(true); |
1650 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1650 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1651 | 1651 | ||
1652 | } | 1652 | } |
1653 | 1653 | ||
1654 | } else { | 1654 | } else { |
1655 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1655 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1656 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1656 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1657 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1657 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1658 | 1658 | ||
1659 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1659 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1660 | bool ok; | 1660 | bool ok; |
1661 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1661 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1662 | if ( ok ) { | 1662 | if ( ok ) { |
1663 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1663 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1664 | startString += i18n(" (%1 y.)"). arg( years ); | 1664 | startString += i18n(" (%1 y.)"). arg( years ); |
1665 | } | 1665 | } |
1666 | } | 1666 | } |
1667 | else | 1667 | else |
1668 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1668 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1669 | } | 1669 | } |
1670 | 1670 | ||
1671 | } | 1671 | } |
1672 | else | 1672 | else |
1673 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1673 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1674 | if ( !incidence->location().isEmpty() ) | 1674 | if ( !incidence->location().isEmpty() ) |
1675 | startString += " (" +incidence->location()+")"; | 1675 | startString += " (" +incidence->location()+")"; |
1676 | setCaption( incidence->summary()+startString); | 1676 | setCaption( incidence->summary()+startString); |
1677 | 1677 | ||
1678 | enableIncidenceActions( true ); | 1678 | enableIncidenceActions( true ); |
1679 | 1679 | ||
1680 | if ( incidence->typeID() == eventID ) { | 1680 | if ( incidence->typeID() == eventID ) { |
1681 | mShowAction->setText( i18n("Show Event...") ); | 1681 | mShowAction->setText( i18n("Show Event...") ); |
1682 | mEditAction->setText( i18n("Edit Event...") ); | 1682 | mEditAction->setText( i18n("Edit Event...") ); |
1683 | mDeleteAction->setText( i18n("Delete Event...") ); | 1683 | mDeleteAction->setText( i18n("Delete Event...") ); |
1684 | 1684 | ||
1685 | mNewSubTodoAction->setEnabled( false ); | 1685 | mNewSubTodoAction->setEnabled( false ); |
1686 | } else if ( incidence->typeID() == todoID ) { | 1686 | } else if ( incidence->typeID() == todoID ) { |
1687 | mShowAction->setText( i18n("Show Todo...") ); | 1687 | mShowAction->setText( i18n("Show Todo...") ); |
1688 | mEditAction->setText( i18n("Edit Todo...") ); | 1688 | mEditAction->setText( i18n("Edit Todo...") ); |
1689 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1689 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1690 | 1690 | ||
1691 | mNewSubTodoAction->setEnabled( true ); | 1691 | mNewSubTodoAction->setEnabled( true ); |
1692 | } else { | 1692 | } else { |
1693 | mShowAction->setText( i18n("Show...") ); | 1693 | mShowAction->setText( i18n("Show...") ); |
1694 | mShowAction->setText( i18n("Edit...") ); | 1694 | mShowAction->setText( i18n("Edit...") ); |
1695 | mShowAction->setText( i18n("Delete...") ); | 1695 | mShowAction->setText( i18n("Delete...") ); |
1696 | 1696 | ||
1697 | mNewSubTodoAction->setEnabled( false ); | 1697 | mNewSubTodoAction->setEnabled( false ); |
1698 | } | 1698 | } |
1699 | } | 1699 | } |
1700 | 1700 | ||
1701 | void MainWindow::enableIncidenceActions( bool enabled ) | 1701 | void MainWindow::enableIncidenceActions( bool enabled ) |
1702 | { | 1702 | { |
1703 | mShowAction->setEnabled( enabled ); | 1703 | mShowAction->setEnabled( enabled ); |
1704 | mEditAction->setEnabled( enabled ); | 1704 | mEditAction->setEnabled( enabled ); |
1705 | mDeleteAction->setEnabled( enabled ); | 1705 | mDeleteAction->setEnabled( enabled ); |
1706 | 1706 | ||
1707 | mCloneAction->setEnabled( enabled ); | 1707 | mCloneAction->setEnabled( enabled ); |
1708 | mMoveAction->setEnabled( enabled ); | 1708 | mMoveAction->setEnabled( enabled ); |
1709 | mBeamAction->setEnabled( enabled ); | 1709 | mBeamAction->setEnabled( enabled ); |
1710 | mCancelAction->setEnabled( enabled ); | 1710 | mCancelAction->setEnabled( enabled ); |
1711 | } | 1711 | } |
1712 | 1712 | ||
1713 | void MainWindow::importOL() | 1713 | void MainWindow::importOL() |
1714 | { | 1714 | { |
1715 | #ifdef _OL_IMPORT_ | 1715 | #ifdef _OL_IMPORT_ |
1716 | mView->clearAllViews(); | 1716 | mView->clearAllViews(); |
1717 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1717 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1718 | id->exec(); | 1718 | id->exec(); |
1719 | delete id; | 1719 | delete id; |
1720 | mView->calendar()->checkAlarmForIncidence( 0, true ); | 1720 | mView->calendar()->checkAlarmForIncidence( 0, true ); |
1721 | mView->updateView(); | 1721 | mView->updateView(); |
1722 | #endif | 1722 | #endif |
1723 | } | 1723 | } |
1724 | void MainWindow::importBday() | 1724 | void MainWindow::importBday() |
1725 | { | 1725 | { |
1726 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1726 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), |
1727 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1727 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1728 | i18n("Import!"), i18n("Cancel"), 0, | 1728 | i18n("Import!"), i18n("Cancel"), 0, |
1729 | 0, 1 ); | 1729 | 0, 1 ); |
1730 | if ( result == 0 ) { | 1730 | if ( result == 0 ) { |
1731 | mView->importBday(); | 1731 | mView->importBday(); |
1732 | 1732 | ||
1733 | } | 1733 | } |
1734 | 1734 | ||
1735 | 1735 | ||
1736 | } | 1736 | } |
1737 | void MainWindow::importQtopia() | 1737 | void MainWindow::importQtopia() |
1738 | { | 1738 | { |
1739 | //#ifndef DESKTOP_VERSION | 1739 | //#ifndef DESKTOP_VERSION |
1740 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); | 1740 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); |
1741 | #ifdef DESKTOP_VERSION | 1741 | #ifdef DESKTOP_VERSION |
1742 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1742 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
1743 | #endif | 1743 | #endif |
1744 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1744 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1745 | i18n("Import!"), i18n("Cancel"), 0, | 1745 | i18n("Import!"), i18n("Cancel"), 0, |
1746 | 0, 1 ); | 1746 | 0, 1 ); |
1747 | if ( result == 0 ) { | 1747 | if ( result == 0 ) { |
1748 | #ifndef DESKTOP_VERSION | 1748 | #ifndef DESKTOP_VERSION |
1749 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1749 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1750 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1750 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1751 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1751 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1752 | #else | 1752 | #else |
1753 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1753 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1754 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1754 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1755 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1755 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1756 | #endif | 1756 | #endif |
1757 | mView->importQtopia( categories, datebook, todolist ); | 1757 | mView->importQtopia( categories, datebook, todolist ); |
1758 | } | 1758 | } |
1759 | mView->calendar()->reInitAlarmSettings(); | 1759 | mView->calendar()->reInitAlarmSettings(); |
1760 | #if 0 | 1760 | #if 0 |
1761 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1761 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1762 | i18n("Not supported \non desktop!\n"), | 1762 | i18n("Not supported \non desktop!\n"), |
1763 | i18n("Ok"), i18n("Cancel"), 0, | 1763 | i18n("Ok"), i18n("Cancel"), 0, |
1764 | 0, 1 ); | 1764 | 0, 1 ); |
1765 | 1765 | ||
1766 | #endif | 1766 | #endif |
1767 | } | 1767 | } |
1768 | 1768 | ||
1769 | void MainWindow::saveOnClose() | 1769 | void MainWindow::saveOnClose() |
1770 | { | 1770 | { |
1771 | KOPrefs *p = KOPrefs::instance(); | 1771 | KOPrefs *p = KOPrefs::instance(); |
1772 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1772 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1773 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); | 1773 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); |
1774 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); | 1774 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); |
1775 | if ( filterToolBar ) { | 1775 | if ( filterToolBar ) { |
1776 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); | 1776 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); |
1777 | } | 1777 | } |
1778 | #ifdef DESKTOP_VERSION | 1778 | #ifdef DESKTOP_VERSION |
1779 | 1779 | ||
1780 | QPoint myP; | 1780 | QPoint myP; |
1781 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1781 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1782 | if ( p->mToolBarHor ) | 1782 | if ( p->mToolBarHor ) |
1783 | p->mToolBarUp = myP.y() > height()/2; | 1783 | p->mToolBarUp = myP.y() > height()/2; |
1784 | else | 1784 | else |
1785 | p->mToolBarUp = myP.x() > width()/2; | 1785 | p->mToolBarUp = myP.x() > width()/2; |
1786 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1786 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1787 | if ( p->mToolBarHorV ) | 1787 | if ( p->mToolBarHorV ) |
1788 | p->mToolBarUpV = myP.y() > height()/2; | 1788 | p->mToolBarUpV = myP.y() > height()/2; |
1789 | else | 1789 | else |
1790 | p->mToolBarUpV = myP.x() > width()/2 ; | 1790 | p->mToolBarUpV = myP.x() > width()/2 ; |
1791 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1791 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1792 | if ( p->mToolBarHorN ) | 1792 | if ( p->mToolBarHorN ) |
1793 | p->mToolBarUpN = myP.y() > height()/2; | 1793 | p->mToolBarUpN = myP.y() > height()/2; |
1794 | else | 1794 | else |
1795 | p->mToolBarUpN = myP.x() > width()/2 ; | 1795 | p->mToolBarUpN = myP.x() > width()/2 ; |
1796 | if ( filterToolBar ) { | 1796 | if ( filterToolBar ) { |
1797 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1797 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1798 | if ( p->mToolBarHorF ) | 1798 | if ( p->mToolBarHorF ) |
1799 | p->mToolBarUpF = myP.y() > height()/2; | 1799 | p->mToolBarUpF = myP.y() > height()/2; |
1800 | else | 1800 | else |
1801 | p->mToolBarUpF = myP.x() > width()/2 ; | 1801 | p->mToolBarUpF = myP.x() > width()/2 ; |
1802 | } | 1802 | } |
1803 | #else | 1803 | #else |
1804 | if ( p->mToolBarHor ) | 1804 | if ( p->mToolBarHor ) |
1805 | p->mToolBarUp = iconToolBar->y() > height()/2; | 1805 | p->mToolBarUp = iconToolBar->y() > height()/2; |
1806 | else | 1806 | else |
1807 | p->mToolBarUp = iconToolBar->x() > width()/2; | 1807 | p->mToolBarUp = iconToolBar->x() > width()/2; |
1808 | if ( p->mToolBarHorV ) | 1808 | if ( p->mToolBarHorV ) |
1809 | p->mToolBarUpV = viewToolBar->y() > height()/2; | 1809 | p->mToolBarUpV = viewToolBar->y() > height()/2; |
1810 | else | 1810 | else |
1811 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; | 1811 | p->mToolBarUpV = viewToolBar->x() > width()/2 ; |
1812 | 1812 | ||
1813 | if ( p->mToolBarHorN ) | 1813 | if ( p->mToolBarHorN ) |
1814 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; | 1814 | p->mToolBarUpN = navigatorToolBar->y() > height()/2; |
1815 | else | 1815 | else |
1816 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; | 1816 | p->mToolBarUpN = navigatorToolBar->x() > width()/2 ; |
1817 | if ( filterToolBar ) { | 1817 | if ( filterToolBar ) { |
1818 | if ( p->mToolBarHorF ) | 1818 | if ( p->mToolBarHorF ) |
1819 | p->mToolBarUpF = filterToolBar->y() > height()/2; | 1819 | p->mToolBarUpF = filterToolBar->y() > height()/2; |
1820 | else | 1820 | else |
1821 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; | 1821 | p->mToolBarUpF = filterToolBar->x() > width()/2 ; |
1822 | } | 1822 | } |
@@ -2217,201 +2217,204 @@ void MainWindow::updateFilterToolbar() | |||
2217 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2217 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2218 | if ( curfilter ) { | 2218 | if ( curfilter ) { |
2219 | filterMenubar->changeItem( 0, curfilter->name() ); | 2219 | filterMenubar->changeItem( 0, curfilter->name() ); |
2220 | } | 2220 | } |
2221 | } | 2221 | } |
2222 | } | 2222 | } |
2223 | } | 2223 | } |
2224 | void MainWindow::selectFilterPopup( int fil ) | 2224 | void MainWindow::selectFilterPopup( int fil ) |
2225 | { | 2225 | { |
2226 | selectFilter( fil + 1 ); | 2226 | selectFilter( fil + 1 ); |
2227 | 2227 | ||
2228 | } | 2228 | } |
2229 | void MainWindow::configureToolBar( int item ) | 2229 | void MainWindow::configureToolBar( int item ) |
2230 | { | 2230 | { |
2231 | 2231 | ||
2232 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 2232 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
2233 | KOPrefs *p = KOPrefs::instance(); | 2233 | KOPrefs *p = KOPrefs::instance(); |
2234 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 2234 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
2235 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); | 2235 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); |
2236 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); | 2236 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); |
2237 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 2237 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
2238 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 2238 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
2239 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); | 2239 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); |
2240 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); | 2240 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); |
2241 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); | 2241 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); |
2242 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); | 2242 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); |
2243 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 2243 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
2244 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 2244 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
2245 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 2245 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
2246 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 2246 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
2247 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 2247 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
2248 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 2248 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
2249 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 2249 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
2250 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 2250 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
2251 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 2251 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
2252 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 2252 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
2253 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 2253 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
2254 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 2254 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
2255 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 2255 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
2256 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 2256 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
2257 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 2257 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
2258 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 2258 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
2259 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 2259 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
2260 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 2260 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
2261 | // initActions(); | 2261 | // initActions(); |
2262 | } | 2262 | } |
2263 | void MainWindow::setCaption ( const QString & c ) | 2263 | void MainWindow::setCaption ( const QString & c ) |
2264 | { | 2264 | { |
2265 | QString cap = c; | 2265 | QString cap = c; |
2266 | cap.replace( QRegExp("\n"), " " ); | 2266 | cap.replace( QRegExp("\n"), " " ); |
2267 | cap = cap.stripWhiteSpace(); | 2267 | cap = cap.stripWhiteSpace(); |
2268 | if ( cap.isEmpty() ) | 2268 | if ( cap.isEmpty() ) |
2269 | cap = "KO/Pi"; | 2269 | cap = "KO/Pi"; |
2270 | QWidget::setCaption( cap ); | 2270 | QWidget::setCaption( cap ); |
2271 | } | 2271 | } |
2272 | void MainWindow::setCaptionToDates() | 2272 | void MainWindow::setCaptionToDates() |
2273 | { | 2273 | { |
2274 | QString selDates; | 2274 | QString selDates; |
2275 | QDate date = mView->startDate(); | 2275 | QDate date = mView->startDate(); |
2276 | if ( ! date.isValid() ) { | 2276 | if ( ! date.isValid() ) { |
2277 | setCaption(""); | 2277 | setCaption(""); |
2278 | return; | 2278 | return; |
2279 | } | 2279 | } |
2280 | selDates = KGlobal::locale()->formatDate( date, true); | 2280 | selDates = KGlobal::locale()->formatDate( date, true); |
2281 | if (mView->startDate() < mView->endDate() ) | 2281 | if (mView->startDate() < mView->endDate() ) |
2282 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 2282 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
2283 | else { | 2283 | else { |
2284 | QString addString; | 2284 | QString addString; |
2285 | if ( date == QDateTime::currentDateTime().date() ) | 2285 | if ( date == QDateTime::currentDateTime().date() ) |
2286 | addString = i18n("Today"); | 2286 | addString = i18n("Today"); |
2287 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) | 2287 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
2288 | addString = i18n("Tomorrow"); | 2288 | addString = i18n("Tomorrow"); |
2289 | if ( !addString.isEmpty() ) | 2289 | if ( !addString.isEmpty() ) |
2290 | selDates = addString+", "+selDates ; | 2290 | selDates = addString+", "+selDates ; |
2291 | } | 2291 | } |
2292 | setCaption( i18n("Dates: ") + selDates ); | 2292 | setCaption( i18n("Dates: ") + selDates ); |
2293 | 2293 | ||
2294 | } | 2294 | } |
2295 | void MainWindow::showConfigureAgenda( ) | 2295 | void MainWindow::showConfigureAgenda( ) |
2296 | { | 2296 | { |
2297 | int iii; | 2297 | int iii; |
2298 | for ( iii = 1;iii<= 10 ;++iii ){ | 2298 | for ( iii = 1;iii<= 10 ;++iii ){ |
2299 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 2299 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
2300 | } | 2300 | } |
2301 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 2301 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
2302 | } | 2302 | } |
2303 | void MainWindow::configureAgenda( int item ) | 2303 | void MainWindow::configureAgenda( int item ) |
2304 | { | 2304 | { |
2305 | if ( KOPrefs::instance()->mHourSize == item ) | 2305 | if ( KOPrefs::instance()->mHourSize == item ) |
2306 | return; | 2306 | return; |
2307 | KOPrefs::instance()->mHourSize=item; | 2307 | KOPrefs::instance()->mHourSize=item; |
2308 | mView->viewManager()->agendaView()->updateConfig(); | 2308 | mView->viewManager()->agendaView()->updateConfig(); |
2309 | } | 2309 | } |
2310 | 2310 | ||
2311 | void MainWindow::saveCalendar() | 2311 | void MainWindow::saveCalendar() |
2312 | { | 2312 | { |
2313 | |||
2314 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; | 2313 | QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; |
2315 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) | 2314 | if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) |
2316 | bupDir = KGlobalSettings::backupDataDir(); | 2315 | bupDir = KGlobalSettings::backupDataDir(); |
2317 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); | 2316 | bupDir = KGlobal::formatMessage ( bupDir, 0 ); |
2318 | QString bupHint; | 2317 | QString bupHint; |
2319 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) | 2318 | if ( !KPimGlobalPrefs::instance()->mBackupEnabled ) |
2320 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); | 2319 | bupHint = i18n("(Hint: You can enable automatic backup in the global settings!)"); |
2321 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; | 2320 | if ( KMessageBox::warningContinueCancel( this, i18n("This will <b>backup all calendar files</b> to the directory %1 %2").arg(bupDir).arg(bupHint),i18n("Information") ) != KMessageBox::Continue ) return; |
2321 | bool enabled = KPimGlobalPrefs::instance()->mBackupEnabled; | ||
2322 | KPimGlobalPrefs::instance()->mBackupEnabled = false; | ||
2323 | save(); | ||
2324 | KPimGlobalPrefs::instance()->mBackupEnabled = enabled; | ||
2322 | backupAllFiles(); | 2325 | backupAllFiles(); |
2323 | } | 2326 | } |
2324 | void MainWindow::loadCalendar() | 2327 | void MainWindow::loadCalendar() |
2325 | { | 2328 | { |
2326 | 2329 | ||
2327 | 2330 | ||
2328 | #if 0 | 2331 | #if 0 |
2329 | QString fn = KOPrefs::instance()->mLastLoadFile; | 2332 | QString fn = KOPrefs::instance()->mLastLoadFile; |
2330 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); | 2333 | fn = KFileDialog::getOpenFileName( fn, i18n("Load backup filename"), this ); |
2331 | 2334 | ||
2332 | if ( fn == "" ) | 2335 | if ( fn == "" ) |
2333 | return; | 2336 | return; |
2334 | QFileInfo info; | 2337 | QFileInfo info; |
2335 | info.setFile( fn ); | 2338 | info.setFile( fn ); |
2336 | QString mess; | 2339 | QString mess; |
2337 | bool loadbup = true; | 2340 | bool loadbup = true; |
2338 | if ( info. exists() ) { | 2341 | if ( info. exists() ) { |
2339 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2342 | mess = i18n("Backup file from:\n%1\nLoading backup\nfile will delete\nyour current Data!\n").arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2340 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2343 | int result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2341 | mess, | 2344 | mess, |
2342 | i18n("Load!"), i18n("Cancel"), 0, | 2345 | i18n("Load!"), i18n("Cancel"), 0, |
2343 | 0, 1 ); | 2346 | 0, 1 ); |
2344 | if ( result != 0 ) { | 2347 | if ( result != 0 ) { |
2345 | loadbup = false; | 2348 | loadbup = false; |
2346 | } | 2349 | } |
2347 | } else { | 2350 | } else { |
2348 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2351 | QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2349 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, | 2352 | i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, |
2350 | 0, 1 ); | 2353 | 0, 1 ); |
2351 | 2354 | ||
2352 | return; | 2355 | return; |
2353 | } | 2356 | } |
2354 | if ( loadbup ) { | 2357 | if ( loadbup ) { |
2355 | mView->openCalendar( fn ); | 2358 | mView->openCalendar( fn ); |
2356 | KOPrefs::instance()->mLastLoadFile = fn; | 2359 | KOPrefs::instance()->mLastLoadFile = fn; |
2357 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; | 2360 | mess = i18n("KO/Pi:Loaded %1").arg(fn) ; |
2358 | setCaption(mess); | 2361 | setCaption(mess); |
2359 | } | 2362 | } |
2360 | #endif | 2363 | #endif |
2361 | 2364 | ||
2362 | } | 2365 | } |
2363 | void MainWindow::quickImportIcal() | 2366 | void MainWindow::quickImportIcal() |
2364 | { | 2367 | { |
2365 | importFile( KOPrefs::instance()->mLastImportFile, false ); | 2368 | importFile( KOPrefs::instance()->mLastImportFile, false ); |
2366 | } | 2369 | } |
2367 | void MainWindow::importFile( QString fn, bool quick ) | 2370 | void MainWindow::importFile( QString fn, bool quick ) |
2368 | { | 2371 | { |
2369 | QFileInfo info; | 2372 | QFileInfo info; |
2370 | info.setFile( fn ); | 2373 | info.setFile( fn ); |
2371 | QString mess; | 2374 | QString mess; |
2372 | bool loadbup = true; | 2375 | bool loadbup = true; |
2373 | if ( !info. exists() ) { | 2376 | if ( !info. exists() ) { |
2374 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); | 2377 | mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); |
2375 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 2378 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
2376 | mess ); | 2379 | mess ); |
2377 | return; | 2380 | return; |
2378 | } | 2381 | } |
2379 | int result = 0; | 2382 | int result = 0; |
2380 | if ( !quick ) { | 2383 | if ( !quick ) { |
2381 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 2384 | mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
2382 | result = QMessageBox::warning( this, "KO/Pi: Warning!", | 2385 | result = QMessageBox::warning( this, "KO/Pi: Warning!", |
2383 | mess, | 2386 | mess, |
2384 | "Import", "Cancel", 0, | 2387 | "Import", "Cancel", 0, |
2385 | 0, 1 ); | 2388 | 0, 1 ); |
2386 | } | 2389 | } |
2387 | if ( result == 0 ) { | 2390 | if ( result == 0 ) { |
2388 | if ( mView->openCalendar( fn, true )) { | 2391 | if ( mView->openCalendar( fn, true )) { |
2389 | KOPrefs::instance()->mLastImportFile = fn; | 2392 | KOPrefs::instance()->mLastImportFile = fn; |
2390 | setCaption(i18n("Imported file successfully")); | 2393 | setCaption(i18n("Imported file successfully")); |
2391 | } else { | 2394 | } else { |
2392 | setCaption(i18n("Error importing file")); | 2395 | setCaption(i18n("Error importing file")); |
2393 | } | 2396 | } |
2394 | } | 2397 | } |
2395 | } | 2398 | } |
2396 | 2399 | ||
2397 | void MainWindow::importIcal() | 2400 | void MainWindow::importIcal() |
2398 | { | 2401 | { |
2399 | 2402 | ||
2400 | QString fn =KOPrefs::instance()->mLastImportFile; | 2403 | QString fn =KOPrefs::instance()->mLastImportFile; |
2401 | 2404 | ||
2402 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); | 2405 | fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); |
2403 | if ( fn == "" ) | 2406 | if ( fn == "" ) |
2404 | return; | 2407 | return; |
2405 | importFile( fn, true ); | 2408 | importFile( fn, true ); |
2406 | 2409 | ||
2407 | } | 2410 | } |
2408 | 2411 | ||
2409 | void MainWindow::exportVCalendar() | 2412 | void MainWindow::exportVCalendar() |
2410 | { | 2413 | { |
2411 | QString fn = KOPrefs::instance()->mLastVcalFile; | 2414 | QString fn = KOPrefs::instance()->mLastVcalFile; |
2412 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); | 2415 | fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); |
2413 | if ( fn == "" ) | 2416 | if ( fn == "" ) |
2414 | return; | 2417 | return; |
2415 | QFileInfo info; | 2418 | QFileInfo info; |
2416 | info.setFile( fn ); | 2419 | info.setFile( fn ); |
2417 | QString mes; | 2420 | QString mes; |