summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-06 21:26:48 (UTC)
committer zautrix <zautrix>2005-07-06 21:26:48 (UTC)
commit630904c92dc014538ff0b08731efb10dcc25426f (patch) (unidiff)
treefe27e7572546f070aa16445aaaa5084d5f84a965
parente1731d8790403a079613f291b4ac172d8f04c960 (diff)
downloadkdepimpi-630904c92dc014538ff0b08731efb10dcc25426f.zip
kdepimpi-630904c92dc014538ff0b08731efb10dcc25426f.tar.gz
kdepimpi-630904c92dc014538ff0b08731efb10dcc25426f.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt6
-rw-r--r--korganizer/kotodoview.cpp6
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index d6b2dc7..79de197 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,236 +1,242 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.1.14 ************
4
5Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done.
6Added a button to add a subtodo quickly.
7
8
3********** VERSION 2.1.13 ************ 9********** VERSION 2.1.13 ************
4 10
5Fixed a problem in KA/Pi search. 11Fixed a problem in KA/Pi search.
6Fixed some minor problems in KO/Pi. 12Fixed some minor problems in KO/Pi.
7Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. 13Added calendar selection possibility to the todo view popup and to the event/todo/journal editor.
8 14
9Fixed memory usage problems in KA/Pi: 15Fixed memory usage problems in KA/Pi:
10When loading data KA/Pi did load the file data twice. 16When loading data KA/Pi did load the file data twice.
11Example: 17Example:
12 A 600k file did consume 1200k memory during loading process. 18 A 600k file did consume 1200k memory during loading process.
13 This is fixed, it does now consume only 600k during loading process. 19 This is fixed, it does now consume only 600k during loading process.
14When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. 20When saving data KA/Pi did consume a lot of memory for the data parsing during the save process.
15This is fixed. 21This is fixed.
16Example: 22Example:
17 Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. 23 Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram.
18 When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system. 24 When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system.
19 Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. 25 Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process.
20Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. 26Note: The memory usage of KA/Pi after the data is loaded/saved has not changed.
21The saving of data may be a bit slower now. 27The saving of data may be a bit slower now.
22 28
23Fixed memory usage problems in KO/Pi: 29Fixed memory usage problems in KO/Pi:
24When KO/Pi did save the data to file, it did not release the used buffers after saving. 30When KO/Pi did save the data to file, it did not release the used buffers after saving.
25The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. 31The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation.
26This is fixed. 32This is fixed.
27Example: 33Example:
28 When saving a 400k file KO/Pi do now use 400k less memory now. 34 When saving a 400k file KO/Pi do now use 400k less memory now.
29 35
30Optimized memory usage in KO/Pi Agenda view: 36Optimized memory usage in KO/Pi Agenda view:
31KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. 37KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view.
32These buffers were not made smaller (i.e. downsized) because of performance reasons. 38These buffers were not made smaller (i.e. downsized) because of performance reasons.
33The handling of these buffers are now much smarter: 39The handling of these buffers are now much smarter:
34Two (of six) buffers are removed completely. 40Two (of six) buffers are removed completely.
35The remaing four buffers are now downsized after not using the agenda view for 45 seconds. 41The remaing four buffers are now downsized after not using the agenda view for 45 seconds.
36Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi. 42Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi.
37 43
38Worst case example ( for a maximum size agenda content): 44Worst case example ( for a maximum size agenda content):
39 When resizing the agenda content to a large scale, KO/Pi did use 17Meg of mem ( and did not use less memory until it was stopped). Now KO/Pi is using on the same operation only 14.3 Meg of mem and after 45 seconds not using the agenda view it uses only 9.4 Meg of mem. 45 When resizing the agenda content to a large scale, KO/Pi did use 17Meg of mem ( and did not use less memory until it was stopped). Now KO/Pi is using on the same operation only 14.3 Meg of mem and after 45 seconds not using the agenda view it uses only 9.4 Meg of mem.
40 46
41When switching to an unused Agenda view now KO/Pi is upizing the buffers again. This takes less than a second. Such that switching to Agenda view (after not using it for more than 45 seconds) is now a bit slower. 47When switching to an unused Agenda view now KO/Pi is upizing the buffers again. This takes less than a second. Such that switching to Agenda view (after not using it for more than 45 seconds) is now a bit slower.
42 48
43Summary: 49Summary:
44Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus. 50Many memory wasting problems of KA/Pi and KO/Pi fixed such that it is better to use on the Zaurus.
45 51
46********** VERSION 2.1.12 ************ 52********** VERSION 2.1.12 ************
47 53
48KO/Pi: 54KO/Pi:
49Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus. 55Many small usability fixes, e.g. rearranged the popup menus such that they are better to use on the Zaurus.
50Fixed a problem with the month view when file was saved but KO/Pi was not the active window. 56Fixed a problem with the month view when file was saved but KO/Pi was not the active window.
51Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only). 57Fixed some problems in the resource config dialog (e.g. added a warning if you set all calendars to read-only).
52Fixed some other small problems. 58Fixed some other small problems.
53 59
54********** VERSION 2.1.11 ************ 60********** VERSION 2.1.11 ************
55 61
56KO/Pi: 62KO/Pi:
57Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. 63Because we can have many calendars now in KO/Pi we can have more than one journal entry per day.
58Added features to handle (and add ) more than one journal entry per day. 64Added features to handle (and add ) more than one journal entry per day.
59Added option for a journal title. 65Added option for a journal title.
60 66
61Added info about the calendar, the item belongs to, to the event/todo/journal viewer. 67Added info about the calendar, the item belongs to, to the event/todo/journal viewer.
62Fixed a problem of the alarm of completed recurring todos. 68Fixed a problem of the alarm of completed recurring todos.
63Added to the event/todo editor to set quickly the category of an item. 69Added to the event/todo editor to set quickly the category of an item.
64 70
65 71
66Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet. 72Fixed some problems when calling KO/Pi or KA/Pi from the alarm applet.
67 73
68Added KA/Pi multi sync to the multi sync called from the alarm applet. 74Added KA/Pi multi sync to the multi sync called from the alarm applet.
69 75
70********** VERSION 2.1.10 ************ 76********** VERSION 2.1.10 ************
71 77
72KO/Pi: 78KO/Pi:
73Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. 79Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file.
74When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. 80When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted.
75Fixed a bug in searching for a small timerange, i.e. one day. 81Fixed a bug in searching for a small timerange, i.e. one day.
76 82
77KA/Pi: 83KA/Pi:
78Fixed two problems in csv export. 84Fixed two problems in csv export.
79Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. 85Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi.
80 86
81********** VERSION 2.1.9 ************ 87********** VERSION 2.1.9 ************
82 88
83KO/Pi: 89KO/Pi:
84Fixed some problems of the new search options in the search dialog. 90Fixed some problems of the new search options in the search dialog.
85Fixed some problems in the new resource config options. 91Fixed some problems in the new resource config options.
86Changed 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. 92Changed 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.
87Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: 93Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown:
88Now 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. 94Now 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.
89 95
90Fixed a problem in recurrence range in syncing with DTM. 96Fixed a problem in recurrence range in syncing with DTM.
91 97
92KA/Pi: 98KA/Pi:
93Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) 99Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...)
94 100
95PwM/Pi: 101PwM/Pi:
96Added "sec" to the timeout config settings to make it clear the timeout values are seconds. 102Added "sec" to the timeout config settings to make it clear the timeout values are seconds.
97 103
98********** VERSION 2.1.8 ************ 104********** VERSION 2.1.8 ************
99 105
100KO/Pi: 106KO/Pi:
101Added info about the completion state of a todo in the ListView/Searchdialog. 107Added info about the completion state of a todo in the ListView/Searchdialog.
102If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. 108If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well.
103Fixed some updating problems when changing the filter. 109Fixed some updating problems when changing the filter.
104 110
105KA/Pi: 111KA/Pi:
106In the addressee selection dialog now the formatted name is shown, if not empty. 112In the addressee selection dialog now the formatted name is shown, if not empty.
107Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. 113Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category.
108Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. 114Now in the addressee selection dialog a selected contact is remove with a single click from the selected list.
109 115
110Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. 116Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored.
111Fixed the sorting for size in the file selector on the Z. 117Fixed the sorting for size in the file selector on the Z.
112 118
113Changed the color selection dialog on the Zaurus to a more user friendly version. 119Changed the color selection dialog on the Zaurus to a more user friendly version.
114 120
115********** VERSION 2.1.7 ************ 121********** VERSION 2.1.7 ************
116 122
117KO/Pi: 123KO/Pi:
118Fixed several problems in the new Resource handling. 124Fixed several problems in the new Resource handling.
119Added more options to the search dialog. 125Added more options to the search dialog.
120Fixed a problem in the Month view. 126Fixed a problem in the Month view.
121Added more options to the dialog when setting a todo to stopped. 127Added more options to the dialog when setting a todo to stopped.
122 128
123Fixed two small problems in KO/Pi Alarm applet. 129Fixed two small problems in KO/Pi Alarm applet.
124 130
125********** VERSION 2.1.6 ************ 131********** VERSION 2.1.6 ************
126 132
127This release is for testing only. 133This release is for testing only.
128 134
129KO/Pi: 135KO/Pi:
130Added to the list view (the list view is used in search dialog as well) the possibility to print it. 136Added to the list view (the list view is used in search dialog as well) the possibility to print it.
131Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. 137Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view.
132Added to the list view the possibility to add all subtodos of selected todos to an export/beam. 138Added to the list view the possibility to add all subtodos of selected todos to an export/beam.
133Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. 139Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout.
134Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. 140Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus.
135Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. 141Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly.
136 142
137Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. 143Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars.
138In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. 144In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later.
139Now on every sync the set of calendars is synced which are enabled in the resource view. 145Now on every sync the set of calendars is synced which are enabled in the resource view.
140 146
141A calendar is enabled in the resource view if the "eye" column is checked. 147A calendar is enabled in the resource view if the "eye" column is checked.
142You can set a calendar to be the default for new items( "+" column ). 148You can set a calendar to be the default for new items( "+" column ).
143You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. 149You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly.
144To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... 150To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ...
145 151
146 152
147********** VERSION 2.1.5 ************ 153********** VERSION 2.1.5 ************
148 154
149This is the new stable version. 155This is the new stable version.
150Bugfix: 156Bugfix:
151Fixed a problem with agenda popup on the desktop in KO/Pi. 157Fixed a problem with agenda popup on the desktop in KO/Pi.
152Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. 158Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization.
153Added config option to not display completed todos in agenda view. 159Added config option to not display completed todos in agenda view.
154Addressee view is now using the formatted name, if defined. 160Addressee view is now using the formatted name, if defined.
155That makes it possible to display "lastname, firstname" in that view now. 161That makes it possible to display "lastname, firstname" in that view now.
156To set the formatted name for all contacts, please use menu: 162To set the formatted name for all contacts, please use menu:
157Edit->Change->Set formatted name. 163Edit->Change->Set formatted name.
158Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. 164Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows.
159 165
160********** VERSION 2.1.4 ************ 166********** VERSION 2.1.4 ************
161 167
162Fixed two more bugs in the KA/Pi CSV import dialog: 168Fixed two more bugs in the KA/Pi CSV import dialog:
163Made it possible to read multi-line fields and import it to the "Note" field. 169Made it possible to read multi-line fields and import it to the "Note" field.
164Fixed a problem in mapping custom fields, whatever a custem field is... 170Fixed a problem in mapping custom fields, whatever a custem field is...
165 171
166********** VERSION 2.1.3 ************ 172********** VERSION 2.1.3 ************
167 173
168Changed the menu structure of the alarm applet: 174Changed the menu structure of the alarm applet:
169Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". 175Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List".
170 176
171Fixed several problems in the KA/Pi CSV import dialog: 177Fixed several problems in the KA/Pi CSV import dialog:
172Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. 178Added "Category", made codec configureable and made it possible to map many fields to the "Note" field.
173 179
174 180
175********** VERSION 2.1.2 ************ 181********** VERSION 2.1.2 ************
176 182
177Fixed a problem closing the alarm dialog on Zaurus with "OK" button. 183Fixed a problem closing the alarm dialog on Zaurus with "OK" button.
178 184
179Fixed a problem when importing data from Outlook with mutiple categories set. 185Fixed a problem when importing data from Outlook with mutiple categories set.
180 186
181Changed display of days in datenavigator: 187Changed display of days in datenavigator:
182Birthdays are now blue, not dark green. 188Birthdays are now blue, not dark green.
183When todo view is shown, no birtdays are shown and days with due todos are shown blue. 189When todo view is shown, no birtdays are shown and days with due todos are shown blue.
184When journal view is shown, only holidays are shown and days with journals are blue. 190When journal view is shown, only holidays are shown and days with journals are blue.
185 191
186Added Backup options to global config: 192Added Backup options to global config:
187You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). 193You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ).
188It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. 194It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again.
189The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. 195The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups.
190 196
191********** VERSION 2.1.1 ************ 197********** VERSION 2.1.1 ************
192 198
193Stable release 2.1.1! 199Stable release 2.1.1!
194 200
195KO/Pi: 201KO/Pi:
196Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. 202Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display.
197 203
198********** VERSION 2.1.0 ************ 204********** VERSION 2.1.0 ************
199 205
200Stable release 2.1.0! 206Stable release 2.1.0!
201 207
202Summary of changes/fixes compared to version 2.0.6: 208Summary of changes/fixes compared to version 2.0.6:
203 209
204Many bugs of version 2.0.6 fixed. 210Many bugs of version 2.0.6 fixed.
205Most of them were small bugs, but some of them were important. 211Most of them were small bugs, but some of them were important.
206It is recommended to use version 2.1.0 and not version 2.0.6. 212It is recommended to use version 2.1.0 and not version 2.0.6.
207 213
208Important changes: 214Important changes:
209 215
210Added recurring todos to KO/Pi. 216Added recurring todos to KO/Pi.
211 217
212Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. 218Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
213 219
214Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 220Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
215 221
216Datenavigator can now display many months. Very useful on the desktop. 222Datenavigator can now display many months. Very useful on the desktop.
217 223
218KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. 224KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements.
219 225
220Made alarm sound working on Linux desktop. 226Made alarm sound working on Linux desktop.
221 227
222Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. 228Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details.
223 229
224Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. 230Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details.
225 231
226Many other usebility enhancements. 232Many other usebility enhancements.
227Special thanks to Ben for his suggestions! 233Special thanks to Ben for his suggestions!
228 234
229You can find the complete changelog 235You can find the complete changelog
230from version 1.7.7 to 2.1.0 236from version 1.7.7 to 2.1.0
231in the source package or on 237in the source package or on
232 238
233http://www.pi-sync.net/html/changelog.html 239http://www.pi-sync.net/html/changelog.html
234 240
235 241
236 242
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index c23a8ee..06d40b1 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -1115,577 +1115,579 @@ void KOTodoView::newTodo()
1115} 1115}
1116 1116
1117void KOTodoView::newSubTodo() 1117void KOTodoView::newSubTodo()
1118{ 1118{
1119 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1119 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1120 if (mActiveItem) { 1120 if (mActiveItem) {
1121 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add a new Todo") ) { 1121 if ( mQuickAdd->isVisible() && !mQuickAdd->text().isEmpty() && mQuickAdd->text() != i18n("Click to add a new Todo") ) {
1122 addQuickTodoPar( mActiveItem->todo()); 1122 addQuickTodoPar( mActiveItem->todo());
1123 } else 1123 } else
1124 emit newSubTodoSignal(mActiveItem->todo()); 1124 emit newSubTodoSignal(mActiveItem->todo());
1125 } 1125 }
1126} 1126}
1127void KOTodoView::unparentTodo() 1127void KOTodoView::unparentTodo()
1128{ 1128{
1129 if (mActiveItem) { 1129 if (mActiveItem) {
1130 emit unparentTodoSignal(mActiveItem->todo()); 1130 emit unparentTodoSignal(mActiveItem->todo());
1131 } 1131 }
1132} 1132}
1133 1133
1134void KOTodoView::reparentTodo() 1134void KOTodoView::reparentTodo()
1135{ 1135{
1136 if (mActiveItem) { 1136 if (mActiveItem) {
1137 topLevelWidget()->setCaption(i18n("Click on new parent item")); 1137 topLevelWidget()->setCaption(i18n("Click on new parent item"));
1138 pendingSubtodo = mActiveItem; 1138 pendingSubtodo = mActiveItem;
1139 } 1139 }
1140} 1140}
1141void KOTodoView::editTodo() 1141void KOTodoView::editTodo()
1142{ 1142{
1143 if (mActiveItem) { 1143 if (mActiveItem) {
1144 emit editTodoSignal(mActiveItem->todo()); 1144 emit editTodoSignal(mActiveItem->todo());
1145 } 1145 }
1146} 1146}
1147void KOTodoView::cloneTodo() 1147void KOTodoView::cloneTodo()
1148{ 1148{
1149 if (mActiveItem) { 1149 if (mActiveItem) {
1150 emit cloneTodoSignal((Incidence*)mActiveItem->todo()); 1150 emit cloneTodoSignal((Incidence*)mActiveItem->todo());
1151 } 1151 }
1152} 1152}
1153void KOTodoView::cancelTodo() 1153void KOTodoView::cancelTodo()
1154{ 1154{
1155 if (mActiveItem) { 1155 if (mActiveItem) {
1156 emit cancelTodoSignal((Incidence*)mActiveItem->todo()); 1156 emit cancelTodoSignal((Incidence*)mActiveItem->todo());
1157 } 1157 }
1158} 1158}
1159void KOTodoView::moveTodo() 1159void KOTodoView::moveTodo()
1160{ 1160{
1161 if (mActiveItem) { 1161 if (mActiveItem) {
1162 emit moveTodoSignal((Incidence*)mActiveItem->todo()); 1162 emit moveTodoSignal((Incidence*)mActiveItem->todo());
1163 } 1163 }
1164} 1164}
1165void KOTodoView::beamTodo() 1165void KOTodoView::beamTodo()
1166{ 1166{
1167 if (mActiveItem) { 1167 if (mActiveItem) {
1168 emit beamTodoSignal((Incidence*)mActiveItem->todo()); 1168 emit beamTodoSignal((Incidence*)mActiveItem->todo());
1169 } 1169 }
1170} 1170}
1171 1171
1172 1172
1173void KOTodoView::showTodo() 1173void KOTodoView::showTodo()
1174{ 1174{
1175 if (mActiveItem) { 1175 if (mActiveItem) {
1176 emit showTodoSignal(mActiveItem->todo()); 1176 emit showTodoSignal(mActiveItem->todo());
1177 } 1177 }
1178} 1178}
1179 1179
1180void KOTodoView::deleteTodo() 1180void KOTodoView::deleteTodo()
1181{ 1181{
1182 if (mActiveItem) { 1182 if (mActiveItem) {
1183 emit deleteTodoSignal(mActiveItem->todo()); 1183 emit deleteTodoSignal(mActiveItem->todo());
1184 } 1184 }
1185} 1185}
1186 1186
1187void KOTodoView::setNewPriority(int index) 1187void KOTodoView::setNewPriority(int index)
1188{ 1188{
1189 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1189 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1190 mActiveItem->todo()->setPriority(mPriority[index]); 1190 mActiveItem->todo()->setPriority(mPriority[index]);
1191 mActiveItem->construct(); 1191 mActiveItem->construct();
1192 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); 1192 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED);
1193 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1193 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1194 } 1194 }
1195 processSelectionChange(); 1195 processSelectionChange();
1196} 1196}
1197 1197
1198void KOTodoView::setNewPercentage(int index) 1198void KOTodoView::setNewPercentage(int index)
1199{ 1199{
1200 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1200 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1201 1201
1202 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) { 1202 if ( mPercentage[index] == 100 && !mActiveItem->isOn() ) {
1203 mActiveItem->setOn( true ); 1203 mActiveItem->setOn( true );
1204 processSelectionChange(); 1204 processSelectionChange();
1205 return; 1205 return;
1206 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) { 1206 } else if ( mPercentage[index] != 100 && mActiveItem->isOn() ) {
1207 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent())); 1207 KOTodoViewItem* par = (static_cast<KOTodoViewItem*>(mActiveItem->parent()));
1208 if ( par && par->isOn() ) 1208 if ( par && par->isOn() )
1209 par->setOn( false ); 1209 par->setOn( false );
1210 } 1210 }
1211 if (mPercentage[index] == 100) { 1211 if (mPercentage[index] == 100) {
1212 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime()); 1212 mActiveItem->todo()->setCompleted(QDateTime::currentDateTime());
1213 } else { 1213 } else {
1214 mActiveItem->todo()->setCompleted(false); 1214 mActiveItem->todo()->setCompleted(false);
1215 } 1215 }
1216 mActiveItem->todo()->setPercentComplete(mPercentage[index]); 1216 mActiveItem->todo()->setPercentComplete(mPercentage[index]);
1217 mActiveItem->construct(); 1217 mActiveItem->construct();
1218 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED); 1218 todoModified (mActiveItem->todo (), KOGlobals::COMPLETION_MODIFIED);
1219 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1219 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1220 } 1220 }
1221 processSelectionChange(); 1221 processSelectionChange();
1222} 1222}
1223 1223
1224void KOTodoView::fillCategories () 1224void KOTodoView::fillCategories ()
1225{ 1225{
1226 mCategoryPopupMenu->clear(); 1226 mCategoryPopupMenu->clear();
1227 if ( ! mActiveItem ) return; 1227 if ( ! mActiveItem ) return;
1228 QStringList checkedCategories = mActiveItem->todo()->categories (); 1228 QStringList checkedCategories = mActiveItem->todo()->categories ();
1229 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin (); 1229 for (QStringList::Iterator it = KOPrefs::instance()->mCustomCategories.begin ();
1230 it != KOPrefs::instance()->mCustomCategories.end (); 1230 it != KOPrefs::instance()->mCustomCategories.end ();
1231 ++it) { 1231 ++it) {
1232 int index = mCategoryPopupMenu->insertItem (*it); 1232 int index = mCategoryPopupMenu->insertItem (*it);
1233 mCategory[index] = *it; 1233 mCategory[index] = *it;
1234 if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true); 1234 if (checkedCategories.find (*it) != checkedCategories.end ()) mCategoryPopupMenu->setItemChecked (index, true);
1235 } 1235 }
1236} 1236}
1237void KOTodoView::fillCal () 1237void KOTodoView::fillCal ()
1238{ 1238{
1239 mCalPopupMenu->clear(); 1239 mCalPopupMenu->clear();
1240 if (!mActiveItem) return; 1240 if (!mActiveItem) return;
1241 bool readO = mActiveItem->todo()->isReadOnly(); 1241 bool readO = mActiveItem->todo()->isReadOnly();
1242 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 1242 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
1243 while ( kkf ) { 1243 while ( kkf ) {
1244 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber); 1244 int index = mCalPopupMenu->insertItem( kkf->mName, kkf->mCalNumber);
1245 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO ) 1245 if ( kkf->mErrorOnLoad || kkf->isReadOnly || readO )
1246 mCalPopupMenu->setItemEnabled( index, false ); 1246 mCalPopupMenu->setItemEnabled( index, false );
1247 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID()); 1247 mCalPopupMenu->setItemChecked (index, kkf->mCalNumber == mActiveItem->todo()->calID());
1248 kkf = KOPrefs::instance()->mCalendars.next(); 1248 kkf = KOPrefs::instance()->mCalendars.next();
1249 } 1249 }
1250} 1250}
1251void KOTodoView::changedCal (int index ) 1251void KOTodoView::changedCal (int index )
1252{ 1252{
1253 if (!mActiveItem) return; 1253 if (!mActiveItem) return;
1254 mActiveItem->todo()->setCalID( index ); 1254 mActiveItem->todo()->setCalID( index );
1255 mActiveItem->construct(); 1255 mActiveItem->construct();
1256} 1256}
1257void KOTodoView::changedCategories(int index) 1257void KOTodoView::changedCategories(int index)
1258{ 1258{
1259 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 1259 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
1260 QStringList categories = mActiveItem->todo()->categories (); 1260 QStringList categories = mActiveItem->todo()->categories ();
1261 QString colcat = categories.first(); 1261 QString colcat = categories.first();
1262 if (categories.find (mCategory[index]) != categories.end ()) 1262 if (categories.find (mCategory[index]) != categories.end ())
1263 categories.remove (mCategory[index]); 1263 categories.remove (mCategory[index]);
1264 else 1264 else
1265 categories.insert (categories.end(), mCategory[index]); 1265 categories.insert (categories.end(), mCategory[index]);
1266 categories.sort (); 1266 categories.sort ();
1267 if ( !colcat.isEmpty() ) { 1267 if ( !colcat.isEmpty() ) {
1268 if ( categories.find ( colcat ) != categories.end () ) { 1268 if ( categories.find ( colcat ) != categories.end () ) {
1269 categories.remove( colcat ); 1269 categories.remove( colcat );
1270 categories.prepend( colcat ); 1270 categories.prepend( colcat );
1271 } 1271 }
1272 } 1272 }
1273 mActiveItem->todo()->setCategories (categories); 1273 mActiveItem->todo()->setCategories (categories);
1274 mActiveItem->construct(); 1274 mActiveItem->construct();
1275 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 1275 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
1276 todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); 1276 todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED);
1277 } 1277 }
1278} 1278}
1279void KOTodoView::itemDoubleClicked(QListViewItem *item) 1279void KOTodoView::itemDoubleClicked(QListViewItem *item)
1280{ 1280{
1281 if ( pendingSubtodo != 0 ) { 1281 if ( pendingSubtodo != 0 ) {
1282 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1282 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1283 } 1283 }
1284 pendingSubtodo = 0; 1284 pendingSubtodo = 0;
1285 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); 1285 //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() );
1286 int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); 1286 int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() );
1287 //qDebug("ROW %d ", row); 1287 //qDebug("ROW %d ", row);
1288 if (!item) { 1288 if (!item) {
1289 newTodo(); 1289 newTodo();
1290 return; 1290 return;
1291 } else { 1291 } else {
1292 if ( row == 1 ) { 1292 if ( row == 1 ) {
1293 mActiveItem = (KOTodoViewItem *) item; 1293 mActiveItem = (KOTodoViewItem *) item;
1294 newSubTodo(); 1294 newSubTodo();
1295 return; 1295 return;
1296 } 1296 }
1297 if ( row == 5 || row == 6 || row == 2) { 1297 if ( row == 5 || row == 6 || row == 2) {
1298 mActiveItem = (KOTodoViewItem *) item; 1298 mActiveItem = (KOTodoViewItem *) item;
1299 Todo * t = mActiveItem->todo(); 1299 Todo * t = mActiveItem->todo();
1300 if ( t->isRunning() ) { 1300 if ( t->isRunning() ) {
1301 if ( t->runTime() < 15) { 1301 if ( t->runTime() < 15) {
1302 t->stopRunning(); 1302 t->stopRunning();
1303 mActiveItem->construct(); 1303 mActiveItem->construct();
1304 topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); 1304 topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!"));
1305 return; 1305 return;
1306 } 1306 }
1307 else 1307 else
1308 toggleRunningItem(); 1308 toggleRunningItem();
1309 return; 1309 return;
1310 } else { 1310 } else {
1311 t->setRunning( true ); 1311 t->setRunning( true );
1312 mActiveItem->construct(); 1312 mActiveItem->construct();
1313 topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); 1313 topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!"));
1314 return; 1314 return;
1315 } 1315 }
1316 } 1316 }
1317 } 1317 }
1318 if ( KOPrefs::instance()->mEditOnDoubleClick ) 1318 if ( KOPrefs::instance()->mEditOnDoubleClick )
1319 editItem( item ); 1319 editItem( item );
1320 else 1320 else
1321 showItem( item , QPoint(), 0 ); 1321 showItem( item , QPoint(), 0 );
1322} 1322}
1323void KOTodoView::toggleRunningItem() 1323void KOTodoView::toggleRunningItem()
1324{ 1324{
1325 // qDebug("KOTodoView::toggleRunning() "); 1325 // qDebug("KOTodoView::toggleRunning() ");
1326 if ( ! mActiveItem ) 1326 if ( ! mActiveItem )
1327 return; 1327 return;
1328 Todo * t = mActiveItem->todo(); 1328 Todo * t = mActiveItem->todo();
1329 if ( t->isRunning() ) { 1329 if ( t->isRunning() ) {
1330 KOStopTodoPrefs tp ( t, this ); 1330 KOStopTodoPrefs tp ( t, this );
1331 if (QApplication::desktop()->width() <= 800 ){ 1331 if (QApplication::desktop()->width() <= 800 ){
1332 int wid = tp.width(); 1332 int wid = tp.width();
1333 int hei = tp.height(); 1333 int hei = tp.height();
1334 int xx = (QApplication::desktop()->width()-wid)/2; 1334 int xx = (QApplication::desktop()->width()-wid)/2;
1335 int yy = (QApplication::desktop()->height()-hei)/2; 1335 int yy = (QApplication::desktop()->height()-hei)/2;
1336 tp.setGeometry( xx,yy,wid,hei ); 1336 tp.setGeometry( xx,yy,wid,hei );
1337 } 1337 }
1338 tp.exec(); 1338 tp.exec();
1339 mActiveItem->construct(); 1339 mActiveItem->construct();
1340 } else { 1340 } else {
1341 KOStartTodoPrefs tp ( t->summary(), this ); 1341 KOStartTodoPrefs tp ( t->summary(), this );
1342 if (QApplication::desktop()->width() <= 800 ){ 1342 if (QApplication::desktop()->width() <= 800 ){
1343 int wid = tp.width(); 1343 int wid = tp.width();
1344 int hei = tp.height(); 1344 int hei = tp.height();
1345 int xx = (QApplication::desktop()->width()-wid)/2; 1345 int xx = (QApplication::desktop()->width()-wid)/2;
1346 int yy = (QApplication::desktop()->height()-hei)/2; 1346 int yy = (QApplication::desktop()->height()-hei)/2;
1347 tp.setGeometry( xx,yy,wid,hei ); 1347 tp.setGeometry( xx,yy,wid,hei );
1348 } 1348 }
1349 if ( !tp.exec() ) return; 1349 if ( !tp.exec() ) return;
1350 if ( tp.stopAll() ) { 1350 if ( tp.stopAll() ) {
1351 mCalendar->stopAllTodos(); 1351 mCalendar->stopAllTodos();
1352 t->setRunning( true ); 1352 t->setRunning( true );
1353 updateView(); 1353 updateView();
1354 } else { 1354 } else {
1355 t->setRunning( true ); 1355 t->setRunning( true );
1356 mActiveItem->construct(); 1356 mActiveItem->construct();
1357 } 1357 }
1358 } 1358 }
1359} 1359}
1360 1360
1361void KOTodoView::itemClicked(QListViewItem *item) 1361void KOTodoView::itemClicked(QListViewItem *item)
1362{ 1362{
1363 //qDebug("KOTodoView::itemClicked %d", item); 1363 //qDebug("KOTodoView::itemClicked %d", item);
1364 if (!item) { 1364 if (!item) {
1365 if ( pendingSubtodo != 0 ) { 1365 if ( pendingSubtodo != 0 ) {
1366 topLevelWidget()->setCaption(i18n("Reparenting aborted!")); 1366 topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
1367 } 1367 }
1368 pendingSubtodo = 0; 1368 pendingSubtodo = 0;
1369 return; 1369 return;
1370 } 1370 }
1371 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1371 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1372 if ( pendingSubtodo != 0 ) { 1372 if ( pendingSubtodo != 0 ) {
1373 bool allowReparent = true; 1373 bool allowReparent = true;
1374 QListViewItem *par = item; 1374 QListViewItem *par = item;
1375 while ( par ) { 1375 while ( par ) {
1376 if ( par == pendingSubtodo ) { 1376 if ( par == pendingSubtodo ) {
1377 allowReparent = false; 1377 allowReparent = false;
1378 break; 1378 break;
1379 } 1379 }
1380 par = par->parent(); 1380 par = par->parent();
1381 } 1381 }
1382 if ( !allowReparent ) { 1382 if ( !allowReparent ) {
1383 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); 1383 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
1384 pendingSubtodo = 0; 1384 pendingSubtodo = 0;
1385 } else { 1385 } else {
1386 Todo* newParent = todoItem->todo(); 1386 Todo* newParent = todoItem->todo();
1387 Todo* newSub = pendingSubtodo->todo(); 1387 Todo* newSub = pendingSubtodo->todo();
1388 pendingSubtodo = 0; 1388 pendingSubtodo = 0;
1389 emit reparentTodoSignal( newParent,newSub ); 1389 emit reparentTodoSignal( newParent,newSub );
1390 return; 1390 return;
1391 } 1391 }
1392 } 1392 }
1393 1393
1394} 1394}
1395 1395
1396void KOTodoView::setDocumentId( const QString &id ) 1396void KOTodoView::setDocumentId( const QString &id )
1397{ 1397{
1398 1398
1399 mDocPrefs->setDoc( id ); 1399 mDocPrefs->setDoc( id );
1400} 1400}
1401 1401
1402void KOTodoView::itemStateChanged( QListViewItem *item ) 1402void KOTodoView::itemStateChanged( QListViewItem *item )
1403{ 1403{
1404 if (!item) return; 1404 if (!item) return;
1405 1405
1406 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 1406 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
1407 1407
1408// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; 1408// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
1409 1409
1410 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); 1410 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
1411} 1411}
1412 1412
1413void KOTodoView::saveLayout(KConfig *config, const QString &group) const 1413void KOTodoView::saveLayout(KConfig *config, const QString &group) const
1414{ 1414{
1415 mTodoListView->saveLayout(config,group); 1415 mTodoListView->saveLayout(config,group);
1416} 1416}
1417 1417
1418void KOTodoView::restoreLayout(KConfig *config, const QString &group) 1418void KOTodoView::restoreLayout(KConfig *config, const QString &group)
1419{ 1419{
1420 mTodoListView->restoreLayout(config,group); 1420 mTodoListView->restoreLayout(config,group);
1421} 1421}
1422 1422
1423void KOTodoView::processSelectionChange() 1423void KOTodoView::processSelectionChange()
1424{ 1424{
1425// kdDebug() << "KOTodoView::processSelectionChange()" << endl; 1425// kdDebug() << "KOTodoView::processSelectionChange()" << endl;
1426 1426
1427 KOTodoViewItem *item = 1427 KOTodoViewItem *item =
1428 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); 1428 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() );
1429 1429
1430 if ( !item ) { 1430 if ( !item ) {
1431 emit incidenceSelected( 0 ); 1431 emit incidenceSelected( 0 );
1432 mNewSubBut->setEnabled( false ); 1432 mNewSubBut->setEnabled( false );
1433 } else { 1433 } else {
1434 emit incidenceSelected( item->todo() ); 1434 emit incidenceSelected( item->todo() );
1435 mNewSubBut->setEnabled( true ); 1435 mNewSubBut->setEnabled( true );
1436 } 1436 }
1437} 1437}
1438 1438
1439void KOTodoView::modified(bool b) 1439void KOTodoView::modified(bool b)
1440{ 1440{
1441 emit isModified(b); 1441 emit isModified(b);
1442} 1442}
1443void KOTodoView::setTodoModified( Todo* todo ) 1443void KOTodoView::setTodoModified( Todo* todo )
1444{ 1444{
1445 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); 1445 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED );
1446} 1446}
1447void KOTodoView::clearSelection() 1447void KOTodoView::clearSelection()
1448{ 1448{
1449 mTodoListView->selectAll( false ); 1449 mTodoListView->selectAll( false );
1450} 1450}
1451void KOTodoView::setAllOpen() 1451void KOTodoView::setAllOpen()
1452{ 1452{
1453 if ( isFlatDisplay ) { 1453 if ( isFlatDisplay ) {
1454 isFlatDisplay = false; 1454 isFlatDisplay = false;
1455 mPopupMenu->setItemChecked( 8,false ); 1455 mPopupMenu->setItemChecked( 8,false );
1456 updateView(); 1456 updateView();
1457 } else { 1457 } else {
1458 storeCurrentItem(); 1458 storeCurrentItem();
1459 } 1459 }
1460 setOpen(mTodoListView->firstChild(), true); 1460 setOpen(mTodoListView->firstChild(), true);
1461 resetCurrentItem(); 1461 resetCurrentItem();
1462} 1462}
1463void KOTodoView::setAllClose() 1463void KOTodoView::setAllClose()
1464{ 1464{
1465 if ( isFlatDisplay ) { 1465 if ( isFlatDisplay ) {
1466 isFlatDisplay = false; 1466 isFlatDisplay = false;
1467 mPopupMenu->setItemChecked( 8,false ); 1467 mPopupMenu->setItemChecked( 8,false );
1468 updateView(); 1468 updateView();
1469 } else { 1469 } else {
1470 storeCurrentItem(); 1470 storeCurrentItem();
1471 } 1471 }
1472 setOpen(mTodoListView->firstChild(), false); 1472 setOpen(mTodoListView->firstChild(), false);
1473 resetCurrentItem(); 1473 resetCurrentItem();
1474} 1474}
1475void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) 1475void KOTodoView::setOpen( QListViewItem* item, bool setOpenI)
1476{ 1476{
1477 1477
1478 while ( item ) { 1478 while ( item ) {
1479 setOpen( item->firstChild(), setOpenI ); 1479 setOpen( item->firstChild(), setOpenI );
1480 item->setOpen( setOpenI ); 1480 item->setOpen( setOpenI );
1481 item = item->nextSibling(); 1481 item = item->nextSibling();
1482 } 1482 }
1483} 1483}
1484 1484
1485void KOTodoView::displayAllFlat() 1485void KOTodoView::displayAllFlat()
1486{ 1486{
1487 storeCurrentItem(); 1487 storeCurrentItem();
1488 pendingSubtodo = 0; 1488 pendingSubtodo = 0;
1489 if ( mBlockUpdate ) { 1489 if ( mBlockUpdate ) {
1490 return; 1490 return;
1491 } 1491 }
1492 mPopupMenu->setItemChecked( 8,true ); 1492 mPopupMenu->setItemChecked( 8,true );
1493 isFlatDisplay = true; 1493 isFlatDisplay = true;
1494 QPtrList<Todo> todoList = calendar()->todos(); 1494 QPtrList<Todo> todoList = calendar()->todos();
1495 mTodoMap.clear(); 1495 mTodoMap.clear();
1496 mTodoListView->clear(); 1496 mTodoListView->clear();
1497 Todo *todo; 1497 Todo *todo;
1498 for(todo = todoList.first(); todo; todo = todoList.next()) { 1498 for(todo = todoList.first(); todo; todo = todoList.next()) {
1499 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 1499 if ( checkTodo( todo ) ) {
1500 mTodoMap.insert(todo,todoItem); 1500 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
1501 mTodoMap.insert(todo,todoItem);
1502 }
1501 } 1503 }
1502 resetCurrentItem(); 1504 resetCurrentItem();
1503} 1505}
1504 1506
1505void KOTodoView::setAllFlat() 1507void KOTodoView::setAllFlat()
1506{ 1508{
1507 if ( isFlatDisplay ) { 1509 if ( isFlatDisplay ) {
1508 isFlatDisplay = false; 1510 isFlatDisplay = false;
1509 mPopupMenu->setItemChecked( 8,false ); 1511 mPopupMenu->setItemChecked( 8,false );
1510 updateView(); 1512 updateView();
1511 return; 1513 return;
1512 } 1514 }
1513 displayAllFlat(); 1515 displayAllFlat();
1514} 1516}
1515 1517
1516void KOTodoView::purgeCompleted() 1518void KOTodoView::purgeCompleted()
1517{ 1519{
1518 emit purgeCompletedSignal(); 1520 emit purgeCompletedSignal();
1519 1521
1520} 1522}
1521void KOTodoView::toggleQuickTodo() 1523void KOTodoView::toggleQuickTodo()
1522{ 1524{
1523 if ( mQuickBar->isVisible() ) { 1525 if ( mQuickBar->isVisible() ) {
1524 mQuickBar->hide(); 1526 mQuickBar->hide();
1525 KOPrefs::instance()->mEnableQuickTodo = false; 1527 KOPrefs::instance()->mEnableQuickTodo = false;
1526 } 1528 }
1527 else { 1529 else {
1528 mQuickBar->show(); 1530 mQuickBar->show();
1529 KOPrefs::instance()->mEnableQuickTodo = true; 1531 KOPrefs::instance()->mEnableQuickTodo = true;
1530 } 1532 }
1531 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 1533 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
1532 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 1534 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
1533} 1535}
1534 1536
1535void KOTodoView::toggleRunning() 1537void KOTodoView::toggleRunning()
1536{ 1538{
1537 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; 1539 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos;
1538 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); 1540 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
1539 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); 1541 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
1540 updateView(); 1542 updateView();
1541 if ( KOPrefs::instance()->mHideNonStartedTodos ) 1543 if ( KOPrefs::instance()->mHideNonStartedTodos )
1542 topLevelWidget()->setCaption(i18n("Hide not Running")); 1544 topLevelWidget()->setCaption(i18n("Hide not Running"));
1543 else 1545 else
1544 topLevelWidget()->setCaption(i18n("Show not Running")); 1546 topLevelWidget()->setCaption(i18n("Show not Running"));
1545} 1547}
1546 1548
1547void KOTodoView::toggleCompleted() 1549void KOTodoView::toggleCompleted()
1548{ 1550{
1549 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; 1551 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
1550 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 1552 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
1551 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 1553 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
1552 updateView(); 1554 updateView();
1553 if ( KOPrefs::instance()->mShowCompletedTodo ) 1555 if ( KOPrefs::instance()->mShowCompletedTodo )
1554 topLevelWidget()->setCaption(i18n("Show Completed")); 1556 topLevelWidget()->setCaption(i18n("Show Completed"));
1555 else 1557 else
1556 topLevelWidget()->setCaption(i18n("Hide Completed")); 1558 topLevelWidget()->setCaption(i18n("Hide Completed"));
1557} 1559}
1558 1560
1559void KOTodoView::addQuickTodo() 1561void KOTodoView::addQuickTodo()
1560{ 1562{
1561 addQuickTodoPar( 0 ); 1563 addQuickTodoPar( 0 );
1562} 1564}
1563void KOTodoView::addQuickTodoPar( Todo * parentTodo) 1565void KOTodoView::addQuickTodoPar( Todo * parentTodo)
1564{ 1566{
1565 Todo *todo = new Todo(); 1567 Todo *todo = new Todo();
1566 todo->setSummary(mQuickAdd->text()); 1568 todo->setSummary(mQuickAdd->text());
1567 todo->setOrganizer(KOPrefs::instance()->email()); 1569 todo->setOrganizer(KOPrefs::instance()->email());
1568 if ( parentTodo ) { 1570 if ( parentTodo ) {
1569 todo->setRelatedTo(parentTodo); 1571 todo->setRelatedTo(parentTodo);
1570 1572
1571 todo->setCategories (parentTodo->categoriesStr ()); 1573 todo->setCategories (parentTodo->categoriesStr ());
1572 todo->setSecrecy (parentTodo->secrecy ()); 1574 todo->setSecrecy (parentTodo->secrecy ());
1573 if ( parentTodo->priority() < 3 ) 1575 if ( parentTodo->priority() < 3 )
1574 todo->setPriority( parentTodo->priority() ); 1576 todo->setPriority( parentTodo->priority() );
1575 todo->setCalID( parentTodo->calID() ); 1577 todo->setCalID( parentTodo->calID() );
1576 } else { 1578 } else {
1577 CalFilter * cf = mCalendar->filter(); 1579 CalFilter * cf = mCalendar->filter();
1578 if ( cf ) { 1580 if ( cf ) {
1579 if ( cf->isEnabled()&& cf->showCategories()) { 1581 if ( cf->isEnabled()&& cf->showCategories()) {
1580 todo->setCategories(cf->categoryList()); 1582 todo->setCategories(cf->categoryList());
1581 } 1583 }
1582 if ( cf->isEnabled() ) 1584 if ( cf->isEnabled() )
1583 todo->setSecrecy( cf->getSecrecy()); 1585 todo->setSecrecy( cf->getSecrecy());
1584 } 1586 }
1585 } 1587 }
1586 mCalendar->addTodo(todo); 1588 mCalendar->addTodo(todo);
1587 mQuickAdd->setText(""); 1589 mQuickAdd->setText("");
1588 todoModified (todo, KOGlobals::EVENTADDED ); 1590 todoModified (todo, KOGlobals::EVENTADDED );
1589 updateView(); 1591 updateView();
1590 1592
1591} 1593}
1592void KOTodoView::keyPressEvent ( QKeyEvent * e ) 1594void KOTodoView::keyPressEvent ( QKeyEvent * e )
1593{ 1595{
1594 // e->ignore(); 1596 // e->ignore();
1595 //return; 1597 //return;
1596 //qDebug("KOTodoView::keyPressEvent "); 1598 //qDebug("KOTodoView::keyPressEvent ");
1597 switch ( e->key() ) { 1599 switch ( e->key() ) {
1598 case Qt::Key_Down: 1600 case Qt::Key_Down:
1599 case Qt::Key_Up: 1601 case Qt::Key_Up:
1600 QWidget::keyPressEvent ( e ); 1602 QWidget::keyPressEvent ( e );
1601 break; 1603 break;
1602 1604
1603 case Qt::Key_Q: 1605 case Qt::Key_Q:
1604 toggleQuickTodo(); 1606 toggleQuickTodo();
1605 break; 1607 break;
1606 case Qt::Key_U: 1608 case Qt::Key_U:
1607 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1609 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1608 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1610 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1609 unparentTodo(); 1611 unparentTodo();
1610 e->accept(); 1612 e->accept();
1611 } else 1613 } else
1612 e->ignore(); 1614 e->ignore();
1613 break; 1615 break;
1614 case Qt::Key_S: 1616 case Qt::Key_S:
1615 if ( e->state() == Qt::ControlButton ) { 1617 if ( e->state() == Qt::ControlButton ) {
1616 e->ignore(); 1618 e->ignore();
1617 break; 1619 break;
1618 } 1620 }
1619 if ( e->state() == Qt::ShiftButton ) { 1621 if ( e->state() == Qt::ShiftButton ) {
1620 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1622 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1621 reparentTodo(); 1623 reparentTodo();
1622 e->accept(); 1624 e->accept();
1623 } else 1625 } else
1624 e->ignore(); 1626 e->ignore();
1625 break; 1627 break;
1626 case Qt::Key_P: 1628 case Qt::Key_P:
1627 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1629 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1628 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1630 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1629 if ( pendingSubtodo ) 1631 if ( pendingSubtodo )
1630 itemClicked(mActiveItem); 1632 itemClicked(mActiveItem);
1631 e->accept(); 1633 e->accept();
1632 } else 1634 } else
1633 e->ignore(); 1635 e->ignore();
1634 break; 1636 break;
1635 case Qt::Key_Escape: 1637 case Qt::Key_Escape:
1636 if ( pendingSubtodo ) { 1638 if ( pendingSubtodo ) {
1637 itemClicked(0); 1639 itemClicked(0);
1638 e->accept(); 1640 e->accept();
1639 } else 1641 } else
1640 e->ignore(); 1642 e->ignore();
1641 break; 1643 break;
1642 default: 1644 default:
1643 e->ignore(); 1645 e->ignore();
1644 } 1646 }
1645 1647
1646 if ( true ) { 1648 if ( true ) {
1647 if ( e->key() == Qt::Key_I ) { 1649 if ( e->key() == Qt::Key_I ) {
1648 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); 1650 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem();
1649 if ( cn ) { 1651 if ( cn ) {
1650 mActiveItem = cn; 1652 mActiveItem = cn;
1651 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 1653 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
1652 if ( ci ){ 1654 if ( ci ){
1653 showTodo(); 1655 showTodo();
1654 cn = (KOTodoViewItem*)cn->itemBelow(); 1656 cn = (KOTodoViewItem*)cn->itemBelow();
1655 if ( cn ) { 1657 if ( cn ) {
1656 mTodoListView->setCurrentItem ( cn ); 1658 mTodoListView->setCurrentItem ( cn );
1657 mTodoListView->ensureItemVisible ( cn ); 1659 mTodoListView->ensureItemVisible ( cn );
1658 } 1660 }
1659 1661
1660 } 1662 }
1661 } 1663 }
1662 e->accept(); 1664 e->accept();
1663 1665
1664 } 1666 }
1665 1667
1666 } 1668 }
1667 1669
1668} 1670}
1669void KOTodoView::updateTodo( Todo * t, int type ) 1671void KOTodoView::updateTodo( Todo * t, int type )
1670{ 1672{
1671 if ( mBlockUpdate) 1673 if ( mBlockUpdate)
1672 return; 1674 return;
1673 1675
1674 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 1676 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
1675 itemIterator = mTodoMap.find(t); 1677 itemIterator = mTodoMap.find(t);
1676 if (itemIterator != mTodoMap.end()) { 1678 if (itemIterator != mTodoMap.end()) {
1677 (*itemIterator)->construct(); 1679 (*itemIterator)->construct();
1678 } else { 1680 } else {
1679 if ( type == KOGlobals::EVENTADDED ) { 1681 if ( type == KOGlobals::EVENTADDED ) {
1680 insertTodoItem( t ); 1682 insertTodoItem( t );
1681 } 1683 }
1682 } 1684 }
1683 1685
1684} 1686}
1685 1687
1686void KOTodoView::todoModified(Todo * t , int p ) 1688void KOTodoView::todoModified(Todo * t , int p )
1687{ 1689{
1688 mBlockUpdate = true; 1690 mBlockUpdate = true;
1689 emit todoModifiedSignal ( t, p ); 1691 emit todoModifiedSignal ( t, p );
1690 mBlockUpdate = false; 1692 mBlockUpdate = false;
1691} 1693}