-rw-r--r-- | bin/kdepim/WhatsNew.txt | 6 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index da5f365..6bc6be9 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,194 +1,200 @@ | |||
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.0.23 ************ | ||
4 | |||
5 | Fixed again a lot of small and strange bugs, e.g. the missing toolbar of KA/Pi after a new installation. | ||
6 | Fixed the (agenda) layout of KO/Pi on 5500er. | ||
7 | Some usebility enhancements (e.g. reselection the current item of the todo view after some changes). | ||
8 | |||
3 | ********** VERSION 2.0.22 ************ | 9 | ********** VERSION 2.0.22 ************ |
4 | 10 | ||
5 | KO/Pi: | 11 | KO/Pi: |
6 | Fix for creating events/todos via the abgenda context menu. | 12 | Fix for creating events/todos via the abgenda context menu. |
7 | Added option to split toolbar to 3 toolbars. | 13 | Added option to split toolbar to 3 toolbars. |
8 | (Toolbar moving s disabled for this option due to a bug in Qt somewhere). | 14 | (Toolbar moving s disabled for this option due to a bug in Qt somewhere). |
9 | Added option to show one small filter-view-toolbar. | 15 | Added option to show one small filter-view-toolbar. |
10 | Added a print option to the desktop version: | 16 | Added a print option to the desktop version: |
11 | Now you can print out the view of the "Event Viewer". | 17 | Now you can print out the view of the "Event Viewer". |
12 | That means you can print all data of one particular event/todo. | 18 | That means you can print all data of one particular event/todo. |
13 | Added scaling options to printout of Event Viewer and What'sNext View. | 19 | Added scaling options to printout of Event Viewer and What'sNext View. |
14 | Fixed some problems in the month view in "week start sunday" mode. | 20 | Fixed some problems in the month view in "week start sunday" mode. |
15 | KA/Pi: | 21 | KA/Pi: |
16 | Added two more config options. | 22 | Added two more config options. |
17 | Fixed resizing problem of address request dialog when orientation was switched. | 23 | Fixed resizing problem of address request dialog when orientation was switched. |
18 | Cleaned up the menu structure. | 24 | Cleaned up the menu structure. |
19 | Fixed some more problems. | 25 | Fixed some more problems. |
20 | 26 | ||
21 | Fixed the annoying problem that scrolling continued after the key was released in KO/Pi Monthview and the KA/Pi views. | 27 | Fixed the annoying problem that scrolling continued after the key was released in KO/Pi Monthview and the KA/Pi views. |
22 | 28 | ||
23 | And, this is a really cool option (Ben did suggest it): | 29 | And, this is a really cool option (Ben did suggest it): |
24 | Now KO/Pi and KA/Pi can be run from a USB stick: | 30 | Now KO/Pi and KA/Pi can be run from a USB stick: |
25 | All data is read from and written to the stick. | 31 | All data is read from and written to the stick. |
26 | You can enable this in the global configure option TAB with: | 32 | You can enable this in the global configure option TAB with: |
27 | Save using LOCAL storage. | 33 | Save using LOCAL storage. |
28 | Just put KDE-Pim/Pi on a memory stick and you can access all your PIM data on every computer with Windows XP. It will work with the ME and Linux versions as well. I will put a memory stick version for teh next stable release online. | 34 | Just put KDE-Pim/Pi on a memory stick and you can access all your PIM data on every computer with Windows XP. It will work with the ME and Linux versions as well. I will put a memory stick version for teh next stable release online. |
29 | 35 | ||
30 | ********** VERSION 2.0.21 ************ | 36 | ********** VERSION 2.0.21 ************ |
31 | 37 | ||
32 | Fixed another SMTP problem in OM/Pi. | 38 | Fixed another SMTP problem in OM/Pi. |
33 | Some small changed in the new datenavigator in KO/Pi. | 39 | Some small changed in the new datenavigator in KO/Pi. |
34 | Changed default setting for new filter in KA/Pi to "exclude categories". | 40 | Changed default setting for new filter in KA/Pi to "exclude categories". |
35 | Changed the default font size for 640x480 display . | 41 | Changed the default font size for 640x480 display . |
36 | Changed popup menu behaviour in agenda and list view. | 42 | Changed popup menu behaviour in agenda and list view. |
37 | Fixed some layout problems of the date label size in the month view. | 43 | Fixed some layout problems of the date label size in the month view. |
38 | Made month view update faster. | 44 | Made month view update faster. |
39 | Made first datenavigator repainting faster. | 45 | Made first datenavigator repainting faster. |
40 | Changed the title of the event/todo edit dialogs. | 46 | Changed the title of the event/todo edit dialogs. |
41 | Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course). | 47 | Timelabels in agenga changed from 22:00 to 22 oo. ( the oo higher, of course). |
42 | Many small usebility fixes in KO/Pi. | 48 | Many small usebility fixes in KO/Pi. |
43 | Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi. | 49 | Pressing the "Calendar" button on the Z switches now to the next view in KO/Pi. |
44 | The set of possible "next views" are the views you have toolbar buttons for. | 50 | The set of possible "next views" are the views you have toolbar buttons for. |
45 | 51 | ||
46 | Made alarm sound working on Linux. | 52 | Made alarm sound working on Linux. |
47 | 53 | ||
48 | KO/Pi alarm applet changed: | 54 | KO/Pi alarm applet changed: |
49 | Made buttons in alarm dialog much bigger. | 55 | Made buttons in alarm dialog much bigger. |
50 | Made setting of timer more user friendly by showing the actual timer fire time and making the buttons in the timer settings much bigger. | 56 | Made setting of timer more user friendly by showing the actual timer fire time and making the buttons in the timer settings much bigger. |
51 | The goal was it to make it possible to use a finger tip ( and not the stylus ) on the touchscreen to adjust the settings. | 57 | The goal was it to make it possible to use a finger tip ( and not the stylus ) on the touchscreen to adjust the settings. |
52 | 58 | ||
53 | And because this version is realeased at Easter, I added an Easter-egg: | 59 | And because this version is realeased at Easter, I added an Easter-egg: |
54 | With a new undocumented command you can get a message box about the next alarm. | 60 | With a new undocumented command you can get a message box about the next alarm. |
55 | Good luck to find it! | 61 | Good luck to find it! |
56 | 62 | ||
57 | 63 | ||
58 | 64 | ||
59 | ********** VERSION 2.0.20 ************ | 65 | ********** VERSION 2.0.20 ************ |
60 | 66 | ||
61 | Two small fixes in OM/Pi. | 67 | Two small fixes in OM/Pi. |
62 | 68 | ||
63 | Better resizing of the new datenavigator in KO/Pi. | 69 | Better resizing of the new datenavigator in KO/Pi. |
64 | 70 | ||
65 | ********** VERSION 2.0.19 ************ | 71 | ********** VERSION 2.0.19 ************ |
66 | KO/Pi: | 72 | KO/Pi: |
67 | Enhancements and bugfixes in the new datenavigator. | 73 | Enhancements and bugfixes in the new datenavigator. |
68 | Bugfix in this changelog: | 74 | Bugfix in this changelog: |
69 | The datenavigator was changed in version 2.0.18, not the datepicker. | 75 | The datenavigator was changed in version 2.0.18, not the datepicker. |
70 | 76 | ||
71 | ********** VERSION 2.0.18 ************ | 77 | ********** VERSION 2.0.18 ************ |
72 | KO/Pi: | 78 | KO/Pi: |
73 | Fixed some minor problems. | 79 | Fixed some minor problems. |
74 | Cleaned up the KO/Pi config dialog. | 80 | Cleaned up the KO/Pi config dialog. |
75 | Fixed problem moving events in aganda view. | 81 | Fixed problem moving events in aganda view. |
76 | Made datepicker scaleable, i.e. if the datenavigator shows now a | 82 | Made datepicker scaleable, i.e. if the datenavigator shows now a |
77 | datenavigator matrix depending on its size. | 83 | datenavigator matrix depending on its size. |
78 | Birthdays are now displayed green in the datenavigator. | 84 | Birthdays are now displayed green in the datenavigator. |
79 | What'sThis Help in datenavigator shows all events of the day. | 85 | What'sThis Help in datenavigator shows all events of the day. |
80 | 86 | ||
81 | OM/Pi: | 87 | OM/Pi: |
82 | Updated the backend mail library to the latest version. | 88 | Updated the backend mail library to the latest version. |
83 | Please backup your mail before using this version. | 89 | Please backup your mail before using this version. |
84 | 90 | ||
85 | ********** VERSION 2.0.17 ************ | 91 | ********** VERSION 2.0.17 ************ |
86 | 92 | ||
87 | KO/Pi: | 93 | KO/Pi: |
88 | Tooltips in month view were not sorted. Fixed. | 94 | Tooltips in month view were not sorted. Fixed. |
89 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. | 95 | Daylabel in agenda view ( for display of one day ) was too short. Fixed. |
90 | Conflict display dialog for syncing was not on top of other windows. Fixed. | 96 | Conflict display dialog for syncing was not on top of other windows. Fixed. |
91 | Fixed some minor problems. | 97 | Fixed some minor problems. |
92 | 98 | ||
93 | Fixed an endless loop when importing vcs file with RESOURCES entry. | 99 | Fixed an endless loop when importing vcs file with RESOURCES entry. |
94 | 100 | ||
95 | ********** VERSION 2.0.16 ************ | 101 | ********** VERSION 2.0.16 ************ |
96 | OM/Pi: | 102 | OM/Pi: |
97 | Fixed the SMTP account setting the option. | 103 | Fixed the SMTP account setting the option. |
98 | Fixed something in mail sending. | 104 | Fixed something in mail sending. |
99 | 105 | ||
100 | KO/Pi: | 106 | KO/Pi: |
101 | Added possibility to export selected events/todos as vcal file. | 107 | Added possibility to export selected events/todos as vcal file. |
102 | 108 | ||
103 | ********** VERSION 2.0.15 ************ | 109 | ********** VERSION 2.0.15 ************ |
104 | 110 | ||
105 | PwM/Pi: | 111 | PwM/Pi: |
106 | Added keyboard shorcuts for | 112 | Added keyboard shorcuts for |
107 | - toggling summary view (space bar) | 113 | - toggling summary view (space bar) |
108 | - delete item (delete + backspace key) | 114 | - delete item (delete + backspace key) |
109 | - add new item ( i + n key) | 115 | - add new item ( i + n key) |
110 | Fixed length of info in the title. | 116 | Fixed length of info in the title. |
111 | 117 | ||
112 | KO/Pi-KA/Pi: | 118 | KO/Pi-KA/Pi: |
113 | Changed "ME" menu bar entry to an icon. | 119 | Changed "ME" menu bar entry to an icon. |
114 | 120 | ||
115 | KO/Pi: | 121 | KO/Pi: |
116 | Fixed two minor bugs in displaying todos. | 122 | Fixed two minor bugs in displaying todos. |
117 | If in month view a cell is selected, the key shortcut "d" shows now that date. | 123 | If in month view a cell is selected, the key shortcut "d" shows now that date. |
118 | Added complete info for a todo in month view as an icon left of the text. | 124 | Added complete info for a todo in month view as an icon left of the text. |
119 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. | 125 | Fixed problems of displaying data when "<" or ">" are used in summary/location/description. |
120 | Fixed problem of search dialog size when switching displays. | 126 | Fixed problem of search dialog size when switching displays. |
121 | Cancel key now closes date picker. | 127 | Cancel key now closes date picker. |
122 | Rearranged KO/Pi file menu structure. | 128 | Rearranged KO/Pi file menu structure. |
123 | 129 | ||
124 | OM/Pi: | 130 | OM/Pi: |
125 | Added to the SMTP account setting the option | 131 | Added to the SMTP account setting the option |
126 | "No secure connection". | 132 | "No secure connection". |
127 | You have to configure your SMTP accounts again, sorry. | 133 | You have to configure your SMTP accounts again, sorry. |
128 | 134 | ||
129 | KA/Pi: | 135 | KA/Pi: |
130 | Added support for importing quoted-printable. | 136 | Added support for importing quoted-printable. |
131 | Support was added by Peter P.. Thanks, Peter! | 137 | Support was added by Peter P.. Thanks, Peter! |
132 | 138 | ||
133 | 139 | ||
134 | ********** VERSION 2.0.14 ************ | 140 | ********** VERSION 2.0.14 ************ |
135 | 141 | ||
136 | Made Passwordmanager PwM/Pi more userfriendly: | 142 | Made Passwordmanager PwM/Pi more userfriendly: |
137 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 143 | Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
138 | Fixed bug in KO/Pi todo printing. | 144 | Fixed bug in KO/Pi todo printing. |
139 | Made Qtopia calendar import possible on desktop . | 145 | Made Qtopia calendar import possible on desktop . |
140 | 146 | ||
141 | ********** VERSION 2.0.13 ************ | 147 | ********** VERSION 2.0.13 ************ |
142 | 148 | ||
143 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. | 149 | Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. |
144 | 150 | ||
145 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". | 151 | In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". |
146 | 152 | ||
147 | OM/Pi: | 153 | OM/Pi: |
148 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. | 154 | Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. |
149 | Added missing German translation. | 155 | Added missing German translation. |
150 | Added warning if path is specified in local folder settings of account config. | 156 | Added warning if path is specified in local folder settings of account config. |
151 | 157 | ||
152 | ********** VERSION 2.0.12 ************ | 158 | ********** VERSION 2.0.12 ************ |
153 | 159 | ||
154 | KO/Pi: | 160 | KO/Pi: |
155 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. | 161 | Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. |
156 | Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. | 162 | Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. |
157 | Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. | 163 | Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. |
158 | 164 | ||
159 | Fixed problem in pi-sync mode when wrong password was sent. | 165 | Fixed problem in pi-sync mode when wrong password was sent. |
160 | 166 | ||
161 | OM/Pi: | 167 | OM/Pi: |
162 | Fixed a crash when displaying mails with "Show mail as html" was checked in the config. | 168 | Fixed a crash when displaying mails with "Show mail as html" was checked in the config. |
163 | Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. | 169 | Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. |
164 | 170 | ||
165 | ********** VERSION 2.0.11 ************ | 171 | ********** VERSION 2.0.11 ************ |
166 | 172 | ||
167 | Fixed some problems in pi-sync mode | 173 | Fixed some problems in pi-sync mode |
168 | (e.g. details of events were not synced properly) | 174 | (e.g. details of events were not synced properly) |
169 | 175 | ||
170 | ********** VERSION 2.0.10 ************ | 176 | ********** VERSION 2.0.10 ************ |
171 | 177 | ||
172 | KO/Pi: | 178 | KO/Pi: |
173 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. | 179 | In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. |
174 | This is fixed. | 180 | This is fixed. |
175 | Changed the search dialog a bit to make it more user friendly. | 181 | Changed the search dialog a bit to make it more user friendly. |
176 | (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). | 182 | (E.g.: Removed message box about "no items found" and set key focus to search line edit after search). |
177 | 183 | ||
178 | Added config option to hide the week number in KO/Pi toolbar. | 184 | Added config option to hide the week number in KO/Pi toolbar. |
179 | 185 | ||
180 | ********** VERSION 2.0.9 ************ | 186 | ********** VERSION 2.0.9 ************ |
181 | 187 | ||
182 | Made month view icons for multiday events a bit nicer. | 188 | Made month view icons for multiday events a bit nicer. |
183 | Some minor fixes in KO/Pi | 189 | Some minor fixes in KO/Pi |
184 | (e.g. go to today did not work for new week view properly). | 190 | (e.g. go to today did not work for new week view properly). |
185 | 191 | ||
186 | 192 | ||
187 | ********** VERSION 2.0.8 ************ | 193 | ********** VERSION 2.0.8 ************ |
188 | 194 | ||
189 | Fixed a problem in dependency info in the ipk files for the Zaurus. | 195 | Fixed a problem in dependency info in the ipk files for the Zaurus. |
190 | 196 | ||
191 | Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. | 197 | Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. |
192 | 198 | ||
193 | Added a "go today" button to the datepicker. | 199 | Added a "go today" button to the datepicker. |
194 | 200 | ||
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 880d399..d450a97 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -21,385 +21,384 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qhbox.h> | 24 | #include <qhbox.h> |
25 | #include <qvbox.h> | 25 | #include <qvbox.h> |
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qframe.h> | 27 | #include <qframe.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #ifndef KORG_NOSPLITTER | 29 | #ifndef KORG_NOSPLITTER |
30 | #include <qsplitter.h> | 30 | #include <qsplitter.h> |
31 | #endif | 31 | #endif |
32 | #include <qfont.h> | 32 | #include <qfont.h> |
33 | #include <qfontmetrics.h> | 33 | #include <qfontmetrics.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <qtooltip.h> | 35 | #include <qtooltip.h> |
36 | #include <qpainter.h> | 36 | #include <qpainter.h> |
37 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
38 | #include <qapplication.h> | 38 | #include <qapplication.h> |
39 | 39 | ||
40 | #include <kapplication.h> | 40 | #include <kapplication.h> |
41 | #include <KDGanttMinimizeSplitter.h> | 41 | #include <KDGanttMinimizeSplitter.h> |
42 | #include <kdebug.h> | 42 | #include <kdebug.h> |
43 | #include <kstandarddirs.h> | 43 | #include <kstandarddirs.h> |
44 | #include <kiconloader.h> | 44 | #include <kiconloader.h> |
45 | #include <klocale.h> | 45 | #include <klocale.h> |
46 | #include <kconfig.h> | 46 | #include <kconfig.h> |
47 | #include <kglobal.h> | 47 | #include <kglobal.h> |
48 | #include "calendarview.h" | 48 | #include "calendarview.h" |
49 | #include "koviewmanager.h" | 49 | #include "koviewmanager.h" |
50 | 50 | ||
51 | #include <libkcal/calendar.h> | 51 | #include <libkcal/calendar.h> |
52 | #include <libkcal/icaldrag.h> | 52 | #include <libkcal/icaldrag.h> |
53 | #include <libkcal/dndfactory.h> | 53 | #include <libkcal/dndfactory.h> |
54 | 54 | ||
55 | #include <kcalendarsystem.h> | 55 | #include <kcalendarsystem.h> |
56 | 56 | ||
57 | #include "koglobals.h" | 57 | #include "koglobals.h" |
58 | #ifndef KORG_NOPLUGINS | 58 | #ifndef KORG_NOPLUGINS |
59 | #include "kocore.h" | 59 | #include "kocore.h" |
60 | #endif | 60 | #endif |
61 | #include "koprefs.h" | 61 | #include "koprefs.h" |
62 | #include "koagenda.h" | 62 | #include "koagenda.h" |
63 | #include "koagendaitem.h" | 63 | #include "koagendaitem.h" |
64 | #ifndef KORG_NOPRINTER | 64 | #ifndef KORG_NOPRINTER |
65 | #include "calprinter.h" | 65 | #include "calprinter.h" |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #include "koagendaview.h" | 68 | #include "koagendaview.h" |
69 | //#include "koagendaview.moc" | 69 | //#include "koagendaview.moc" |
70 | 70 | ||
71 | //extern bool globalFlagBlockPainting; | 71 | //extern bool globalFlagBlockPainting; |
72 | extern int globalFlagBlockAgenda; | 72 | extern int globalFlagBlockAgenda; |
73 | extern int globalFlagBlockStartup; | 73 | extern int globalFlagBlockStartup; |
74 | extern int globalFlagBlockAgendaItemPaint; | 74 | extern int globalFlagBlockAgendaItemPaint; |
75 | extern int globalFlagBlockAgendaItemUpdate; | 75 | extern int globalFlagBlockAgendaItemUpdate; |
76 | extern int globalFlagBlockLabel; | 76 | extern int globalFlagBlockLabel; |
77 | using namespace KOrg; | 77 | using namespace KOrg; |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : | 81 | TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : |
82 | QScrollView(parent,name,f) | 82 | QScrollView(parent,name,f) |
83 | { | 83 | { |
84 | myPix.resize( 1, 1 ); | 84 | myPix.resize( 1, 1 ); |
85 | mRows = rows; | 85 | mRows = rows; |
86 | 86 | ||
87 | mRedrawNeeded = true; | 87 | mRedrawNeeded = true; |
88 | setMinimumHeight( 20 ); | 88 | setMinimumHeight( 20 ); |
89 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 89 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
90 | 90 | ||
91 | enableClipper(true); | 91 | enableClipper(true); |
92 | 92 | ||
93 | setHScrollBarMode(AlwaysOff); | 93 | setHScrollBarMode(AlwaysOff); |
94 | setVScrollBarMode(AlwaysOff); | 94 | setVScrollBarMode(AlwaysOff); |
95 | 95 | ||
96 | resizeContents(50,mRows * mCellHeight); | 96 | resizeContents(50,mRows * mCellHeight); |
97 | 97 | ||
98 | viewport()->setBackgroundMode( PaletteBackground ); | 98 | viewport()->setBackgroundMode( PaletteBackground ); |
99 | } | 99 | } |
100 | 100 | ||
101 | void TimeLabels::setCellHeight(int height) | 101 | void TimeLabels::setCellHeight(int height) |
102 | { | 102 | { |
103 | mCellHeight = height; | 103 | mCellHeight = height; |
104 | } | 104 | } |
105 | 105 | ||
106 | /* | 106 | /* |
107 | Optimization so that only the "dirty" portion of the scroll view | 107 | Optimization so that only the "dirty" portion of the scroll view |
108 | is redrawn. Unfortunately, this is not called by default paintEvent() method. | 108 | is redrawn. Unfortunately, this is not called by default paintEvent() method. |
109 | */ | 109 | */ |
110 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | 110 | void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) |
111 | { | 111 | { |
112 | 112 | ||
113 | cx = contentsX() + frameWidth()*2; | 113 | cx = contentsX() + frameWidth()*2; |
114 | cw = contentsWidth() ; | 114 | cw = contentsWidth() ; |
115 | // end of workaround | 115 | // end of workaround |
116 | 116 | ||
117 | int cell = ((int)(cy/mCellHeight)); | 117 | int cell = ((int)(cy/mCellHeight)); |
118 | int y = cell * mCellHeight; | 118 | int y = cell * mCellHeight; |
119 | QFontMetrics fm = fontMetrics(); | 119 | QFontMetrics fm = fontMetrics(); |
120 | QString hour; | 120 | QString hour; |
121 | QString suffix = "am"; | 121 | QString suffix = "am"; |
122 | int timeHeight = fm.ascent(); | 122 | int timeHeight = fm.ascent(); |
123 | QFont nFont = font(); | 123 | QFont nFont = font(); |
124 | p->setFont( font()); | 124 | p->setFont( font()); |
125 | 125 | ||
126 | if (!KGlobal::locale()->use12Clock()) { | 126 | if (!KGlobal::locale()->use12Clock()) { |
127 | suffix = "00"; | 127 | suffix = "00"; |
128 | } else | 128 | } else |
129 | if (cell > 11) suffix = "pm"; | 129 | if (cell > 11) suffix = "pm"; |
130 | 130 | ||
131 | if ( timeHeight > mCellHeight ) { | 131 | if ( timeHeight > mCellHeight ) { |
132 | timeHeight = mCellHeight-1; | 132 | timeHeight = mCellHeight-1; |
133 | int pointS = nFont.pointSize(); | 133 | int pointS = nFont.pointSize(); |
134 | while ( pointS > 4 ) { | 134 | while ( pointS > 4 ) { |
135 | nFont.setPointSize( pointS ); | 135 | nFont.setPointSize( pointS ); |
136 | fm = QFontMetrics( nFont ); | 136 | fm = QFontMetrics( nFont ); |
137 | if ( fm.ascent() < mCellHeight ) | 137 | if ( fm.ascent() < mCellHeight ) |
138 | break; | 138 | break; |
139 | -- pointS; | 139 | -- pointS; |
140 | } | 140 | } |
141 | fm = QFontMetrics( nFont ); | 141 | fm = QFontMetrics( nFont ); |
142 | timeHeight = fm.ascent(); | 142 | timeHeight = fm.ascent(); |
143 | } | 143 | } |
144 | //timeHeight -= (timeHeight/4-2); | 144 | //timeHeight -= (timeHeight/4-2); |
145 | QFont sFont = nFont; | 145 | QFont sFont = nFont; |
146 | sFont.setPointSize( sFont.pointSize()/2 ); | 146 | sFont.setPointSize( sFont.pointSize()/2 ); |
147 | QFontMetrics fmS( sFont ); | 147 | QFontMetrics fmS( sFont ); |
148 | int sHei = fmS.ascent() ; | 148 | int sHei = fmS.ascent() ; |
149 | //sHei -= (sHei/4-2); | 149 | //sHei -= (sHei/4-2); |
150 | int startW = mMiniWidth - frameWidth()-2 ; | 150 | int startW = mMiniWidth - frameWidth()-2 ; |
151 | int tw2 = fmS.width(suffix); | 151 | int tw2 = fmS.width(suffix); |
152 | timeHeight = (timeHeight-1) /2 -1; | 152 | timeHeight = (timeHeight-1) /2 -1; |
153 | //testline | 153 | //testline |
154 | //p->drawLine(0,0,0,contentsHeight()); | 154 | //p->drawLine(0,0,0,contentsHeight()); |
155 | while (y < cy + ch+mCellHeight) { | 155 | while (y < cy + ch+mCellHeight) { |
156 | p->drawLine(startW-tw2 ,y,cw+2,y); | 156 | p->drawLine(startW-tw2 ,y,cw+2,y); |
157 | hour.setNum(cell); | 157 | hour.setNum(cell); |
158 | // handle 24h and am/pm time formats | 158 | // handle 24h and am/pm time formats |
159 | if (KGlobal::locale()->use12Clock()) { | 159 | if (KGlobal::locale()->use12Clock()) { |
160 | if (cell == 12) suffix = "pm"; | 160 | if (cell == 12) suffix = "pm"; |
161 | if (cell == 0) hour.setNum(12); | 161 | if (cell == 0) hour.setNum(12); |
162 | if (cell > 12) hour.setNum(cell - 12); | 162 | if (cell > 12) hour.setNum(cell - 12); |
163 | } | 163 | } |
164 | 164 | ||
165 | // center and draw the time label | 165 | // center and draw the time label |
166 | int timeWidth = fm.width(hour); | 166 | int timeWidth = fm.width(hour); |
167 | int offset = startW - timeWidth - tw2 -1 ; | 167 | int offset = startW - timeWidth - tw2 -1 ; |
168 | p->setFont( nFont ); | 168 | p->setFont( nFont ); |
169 | p->drawText( offset, y+ timeHeight, hour); | 169 | p->drawText( offset, y+ timeHeight, hour); |
170 | p->setFont( sFont ); | 170 | p->setFont( sFont ); |
171 | offset = startW - tw2; | 171 | offset = startW - tw2; |
172 | p->drawText( offset, y -1, suffix); | 172 | p->drawText( offset, y -1, suffix); |
173 | 173 | ||
174 | // increment indices | 174 | // increment indices |
175 | y += mCellHeight; | 175 | y += mCellHeight; |
176 | cell++; | 176 | cell++; |
177 | } | 177 | } |
178 | 178 | ||
179 | 179 | ||
180 | 180 | ||
181 | 181 | ||
182 | } | 182 | } |
183 | 183 | ||
184 | /** | 184 | /** |
185 | Calculates the minimum width. | 185 | Calculates the minimum width. |
186 | */ | 186 | */ |
187 | int TimeLabels::minimumWidth() const | 187 | int TimeLabels::minimumWidth() const |
188 | { | 188 | { |
189 | return mMiniWidth; | 189 | return mMiniWidth; |
190 | } | 190 | } |
191 | 191 | ||
192 | /** updates widget's internal state */ | 192 | /** updates widget's internal state */ |
193 | void TimeLabels::updateConfig() | 193 | void TimeLabels::updateConfig() |
194 | { | 194 | { |
195 | mRedrawNeeded = true; | 195 | mRedrawNeeded = true; |
196 | // set the font | 196 | // set the font |
197 | // config->setGroup("Fonts"); | 197 | // config->setGroup("Fonts"); |
198 | // QFont font = config->readFontEntry("TimeBar Font"); | 198 | // QFont font = config->readFontEntry("TimeBar Font"); |
199 | setFont(KOPrefs::instance()->mTimeBarFont); | 199 | setFont(KOPrefs::instance()->mTimeBarFont); |
200 | QString test = "20"; | 200 | QString test = "20"; |
201 | if (KGlobal::locale()->use12Clock()) | 201 | if (KGlobal::locale()->use12Clock()) |
202 | test = "12"; | 202 | test = "12"; |
203 | mMiniWidth = fontMetrics().width(test); | 203 | mMiniWidth = fontMetrics().width(test); |
204 | if (KGlobal::locale()->use12Clock()) | 204 | if (KGlobal::locale()->use12Clock()) |
205 | test = "pm"; | 205 | test = "pm"; |
206 | else { | 206 | else { |
207 | test = "00"; | 207 | test = "00"; |
208 | } | 208 | } |
209 | QFont sFont = font(); | 209 | QFont sFont = font(); |
210 | sFont.setPointSize( sFont.pointSize()/2 ); | 210 | sFont.setPointSize( sFont.pointSize()/2 ); |
211 | QFontMetrics fmS( sFont ); | 211 | QFontMetrics fmS( sFont ); |
212 | mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; | 212 | mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; |
213 | qDebug("testwid %d %d", mMiniWidth ,fmS.width( test )); | ||
214 | // update geometry restrictions based on new settings | 213 | // update geometry restrictions based on new settings |
215 | setFixedWidth( mMiniWidth ); | 214 | setFixedWidth( mMiniWidth ); |
216 | 215 | ||
217 | // update HourSize | 216 | // update HourSize |
218 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 217 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
219 | resizeContents(50,mRows * mCellHeight); | 218 | resizeContents(50,mRows * mCellHeight); |
220 | } | 219 | } |
221 | 220 | ||
222 | /** update time label positions */ | 221 | /** update time label positions */ |
223 | void TimeLabels::positionChanged() | 222 | void TimeLabels::positionChanged() |
224 | { | 223 | { |
225 | int adjustment = mAgenda->contentsY(); | 224 | int adjustment = mAgenda->contentsY(); |
226 | setContentsPos(0, adjustment); | 225 | setContentsPos(0, adjustment); |
227 | } | 226 | } |
228 | 227 | ||
229 | /** */ | 228 | /** */ |
230 | void TimeLabels::setAgenda(KOAgenda* agenda) | 229 | void TimeLabels::setAgenda(KOAgenda* agenda) |
231 | { | 230 | { |
232 | mAgenda = agenda; | 231 | mAgenda = agenda; |
233 | } | 232 | } |
234 | 233 | ||
235 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) | 234 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) |
236 | { | 235 | { |
237 | mMouseDownY = e->pos().y(); | 236 | mMouseDownY = e->pos().y(); |
238 | mOrgCap = topLevelWidget()->caption(); | 237 | mOrgCap = topLevelWidget()->caption(); |
239 | } | 238 | } |
240 | 239 | ||
241 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) | 240 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) |
242 | { | 241 | { |
243 | int diff = mMouseDownY - e->pos().y(); | 242 | int diff = mMouseDownY - e->pos().y(); |
244 | if ( diff < 10 && diff > -10 ) | 243 | if ( diff < 10 && diff > -10 ) |
245 | return; | 244 | return; |
246 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; | 245 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; |
247 | if ( tSize < 4 ) | 246 | if ( tSize < 4 ) |
248 | tSize = 4; | 247 | tSize = 4; |
249 | if ( tSize > 22 ) | 248 | if ( tSize > 22 ) |
250 | tSize = 22; | 249 | tSize = 22; |
251 | tSize = (tSize-2)/2; | 250 | tSize = (tSize-2)/2; |
252 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); | 251 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); |
253 | 252 | ||
254 | } | 253 | } |
255 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) | 254 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) |
256 | { | 255 | { |
257 | topLevelWidget()->setCaption( mOrgCap ); | 256 | topLevelWidget()->setCaption( mOrgCap ); |
258 | int diff = mMouseDownY - e->pos().y(); | 257 | int diff = mMouseDownY - e->pos().y(); |
259 | if ( diff < 10 && diff > -10 ) | 258 | if ( diff < 10 && diff > -10 ) |
260 | return; | 259 | return; |
261 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); | 260 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); |
262 | if ( tSize < 4 ) | 261 | if ( tSize < 4 ) |
263 | tSize = 4; | 262 | tSize = 4; |
264 | if ( tSize > 22 ) | 263 | if ( tSize > 22 ) |
265 | tSize = 22; | 264 | tSize = 22; |
266 | tSize = (tSize/2)*2; | 265 | tSize = (tSize/2)*2; |
267 | if ( tSize == KOPrefs::instance()->mHourSize ) | 266 | if ( tSize == KOPrefs::instance()->mHourSize ) |
268 | return; | 267 | return; |
269 | KOPrefs::instance()->mHourSize = tSize; | 268 | KOPrefs::instance()->mHourSize = tSize; |
270 | emit scaleChanged(); | 269 | emit scaleChanged(); |
271 | } | 270 | } |
272 | 271 | ||
273 | /** This is called in response to repaint() */ | 272 | /** This is called in response to repaint() */ |
274 | void TimeLabels::paintEvent(QPaintEvent*) | 273 | void TimeLabels::paintEvent(QPaintEvent*) |
275 | { | 274 | { |
276 | 275 | ||
277 | // kdDebug() << "paintevent..." << endl; | 276 | // kdDebug() << "paintevent..." << endl; |
278 | // this is another hack! | 277 | // this is another hack! |
279 | // QPainter painter(this); | 278 | // QPainter painter(this); |
280 | //QString c | 279 | //QString c |
281 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); | 280 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); |
282 | } | 281 | } |
283 | 282 | ||
284 | //////////////////////////////////////////////////////////////////////////// | 283 | //////////////////////////////////////////////////////////////////////////// |
285 | 284 | ||
286 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) | 285 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) |
287 | : QFrame(parent,name) | 286 | : QFrame(parent,name) |
288 | { | 287 | { |
289 | mColumns = 1; | 288 | mColumns = 1; |
290 | mTopBox = 0; | 289 | mTopBox = 0; |
291 | mLocation = loc; | 290 | mLocation = loc; |
292 | mTopLayout = 0; | 291 | mTopLayout = 0; |
293 | mPaintWidget = 0; | 292 | mPaintWidget = 0; |
294 | mXOffset = 0; | 293 | mXOffset = 0; |
295 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); | 294 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); |
296 | else mPixmap = SmallIcon("1downarrow"); | 295 | else mPixmap = SmallIcon("1downarrow"); |
297 | mEnabled.resize(mColumns); | 296 | mEnabled.resize(mColumns); |
298 | mEnabled.fill( false ); | 297 | mEnabled.fill( false ); |
299 | setMinimumHeight(mPixmap.height()); | 298 | setMinimumHeight(mPixmap.height()); |
300 | } | 299 | } |
301 | 300 | ||
302 | EventIndicator::~EventIndicator() | 301 | EventIndicator::~EventIndicator() |
303 | { | 302 | { |
304 | } | 303 | } |
305 | 304 | ||
306 | void EventIndicator::drawContents(QPainter *p) | 305 | void EventIndicator::drawContents(QPainter *p) |
307 | { | 306 | { |
308 | 307 | ||
309 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; | 308 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; |
310 | KDGanttSplitterHandle* han = 0; | 309 | KDGanttSplitterHandle* han = 0; |
311 | if ( mPaintWidget ) | 310 | if ( mPaintWidget ) |
312 | han = mPaintWidget->firstHandle(); | 311 | han = mPaintWidget->firstHandle(); |
313 | if ( ! han ) { | 312 | if ( ! han ) { |
314 | int i; | 313 | int i; |
315 | for(i=0;i<mColumns;++i) { | 314 | for(i=0;i<mColumns;++i) { |
316 | if (mEnabled[i]) { | 315 | if (mEnabled[i]) { |
317 | int cellWidth = contentsRect().right()/mColumns; | 316 | int cellWidth = contentsRect().right()/mColumns; |
318 | int xOffset = KOGlobals::self()->reverseLayout() ? | 317 | int xOffset = KOGlobals::self()->reverseLayout() ? |
319 | (mColumns - 1 - i)*cellWidth + (cellWidth -mPixmap.width())/2 : | 318 | (mColumns - 1 - i)*cellWidth + (cellWidth -mPixmap.width())/2 : |
320 | i*cellWidth + (cellWidth -mPixmap.width()) /2; | 319 | i*cellWidth + (cellWidth -mPixmap.width()) /2; |
321 | p->drawPixmap(QPoint(1+xOffset,0),mPixmap); | 320 | p->drawPixmap(QPoint(1+xOffset,0),mPixmap); |
322 | } | 321 | } |
323 | } | 322 | } |
324 | } else { | 323 | } else { |
325 | han->repaint(); | 324 | han->repaint(); |
326 | //mPaintWidget->setBackgroundColor( red ); | 325 | //mPaintWidget->setBackgroundColor( red ); |
327 | 326 | ||
328 | QPainter pa( han ); | 327 | QPainter pa( han ); |
329 | int i; | 328 | int i; |
330 | bool setColor = false; | 329 | bool setColor = false; |
331 | for(i=0;i<mColumns;++i) { | 330 | for(i=0;i<mColumns;++i) { |
332 | if (mEnabled[i]) { | 331 | if (mEnabled[i]) { |
333 | setColor = true; | 332 | setColor = true; |
334 | 333 | ||
335 | int cellWidth = contentsRect().right()/mColumns; | 334 | int cellWidth = contentsRect().right()/mColumns; |
336 | int xOffset = KOGlobals::self()->reverseLayout() ? | 335 | int xOffset = KOGlobals::self()->reverseLayout() ? |
337 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : | 336 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : |
338 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; | 337 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; |
339 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); | 338 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); |
340 | //qDebug("222draw pix %d ",xOffset ); | 339 | //qDebug("222draw pix %d ",xOffset ); |
341 | 340 | ||
342 | } | 341 | } |
343 | 342 | ||
344 | } | 343 | } |
345 | pa.end(); | 344 | pa.end(); |
346 | 345 | ||
347 | } | 346 | } |
348 | } | 347 | } |
349 | 348 | ||
350 | void EventIndicator::setXOffset( int x ) | 349 | void EventIndicator::setXOffset( int x ) |
351 | { | 350 | { |
352 | mXOffset = x; | 351 | mXOffset = x; |
353 | } | 352 | } |
354 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) | 353 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) |
355 | { | 354 | { |
356 | mPaintWidget = w; | 355 | mPaintWidget = w; |
357 | setMaximumHeight(0); | 356 | setMaximumHeight(0); |
358 | setMinimumHeight(0); | 357 | setMinimumHeight(0); |
359 | } | 358 | } |
360 | void EventIndicator::changeColumns(int columns) | 359 | void EventIndicator::changeColumns(int columns) |
361 | { | 360 | { |
362 | mColumns = columns; | 361 | mColumns = columns; |
363 | mEnabled.resize(mColumns); | 362 | mEnabled.resize(mColumns); |
364 | 363 | ||
365 | update(); | 364 | update(); |
366 | } | 365 | } |
367 | 366 | ||
368 | void EventIndicator::enableColumn(int column, bool enable) | 367 | void EventIndicator::enableColumn(int column, bool enable) |
369 | { | 368 | { |
370 | mEnabled[column] = enable; | 369 | mEnabled[column] = enable; |
371 | } | 370 | } |
372 | 371 | ||
373 | 372 | ||
374 | //////////////////////////////////////////////////////////////////////////// | 373 | //////////////////////////////////////////////////////////////////////////// |
375 | //////////////////////////////////////////////////////////////////////////// | 374 | //////////////////////////////////////////////////////////////////////////// |
376 | //////////////////////////////////////////////////////////////////////////// | 375 | //////////////////////////////////////////////////////////////////////////// |
377 | 376 | ||
378 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | 377 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : |
379 | KOEventView (cal,parent,name) | 378 | KOEventView (cal,parent,name) |
380 | { | 379 | { |
381 | mBlockUpdating = true; | 380 | mBlockUpdating = true; |
382 | mStartHour = 8; | 381 | mStartHour = 8; |
383 | mSelectedDates.append(QDate::currentDate()); | 382 | mSelectedDates.append(QDate::currentDate()); |
384 | 383 | ||
385 | mLayoutDayLabels = 0; | 384 | mLayoutDayLabels = 0; |
386 | mDayLabelsFrame = 0; | 385 | mDayLabelsFrame = 0; |
387 | mDayLabels = 0; | 386 | mDayLabels = 0; |
388 | bool isRTL = KOGlobals::self()->reverseLayout(); | 387 | bool isRTL = KOGlobals::self()->reverseLayout(); |
389 | QPixmap expandPix; | 388 | QPixmap expandPix; |
390 | if ( KOPrefs::instance()->mVerticalScreen ) { | 389 | if ( KOPrefs::instance()->mVerticalScreen ) { |
391 | expandPix = SmallIcon( "1updownarrow" ); | 390 | expandPix = SmallIcon( "1updownarrow" ); |
392 | } else { | 391 | } else { |
393 | expandPix = SmallIcon("1leftrightarrow" ); | 392 | expandPix = SmallIcon("1leftrightarrow" ); |
394 | } | 393 | } |
395 | 394 | ||
396 | QBoxLayout *topLayout = new QVBoxLayout(this); | 395 | QBoxLayout *topLayout = new QVBoxLayout(this); |
397 | 396 | ||
398 | // Create day name labels for agenda columns | 397 | // Create day name labels for agenda columns |
399 | // Create agenda splitter | 398 | // Create agenda splitter |
400 | 399 | ||
401 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 400 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
402 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 401 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
403 | topLayout->addWidget( mSplitterAgenda ); | 402 | topLayout->addWidget( mSplitterAgenda ); |
404 | mAllDayFrame = new QHBox(mSplitterAgenda); | 403 | mAllDayFrame = new QHBox(mSplitterAgenda); |
405 | mAllDayFrame->setFocusPolicy(NoFocus); | 404 | mAllDayFrame->setFocusPolicy(NoFocus); |