-rw-r--r-- | bin/kdepim/WhatsNew.txt | 9 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 0dad1c1..54376a0 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,169 +1,178 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.1.11 ************ | ||
4 | |||
5 | KO/Pi: | ||
6 | Because we can have many calendars now in KO/Pi we can have more than one journal entry per day. | ||
7 | Added features to handle (and add ) more than one journal entry per day. | ||
8 | Added option for a journal title. | ||
9 | |||
10 | Added info about the calendar, the item belongs to, to the event/todo/journal viewer. | ||
11 | |||
3 | ********** VERSION 2.1.10 ************ | 12 | ********** VERSION 2.1.10 ************ |
4 | 13 | ||
5 | KO/Pi: | 14 | KO/Pi: |
6 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. | 15 | Importing Birthdays will now create another file resource "Birthdays" and import the birthday data from KA/Pi into that file. |
7 | When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. | 16 | When a multidayevent is selected in monthview all occurences of this event in the monthview are now hightlighted. |
8 | Fixed a bug in searching for a small timerange, i.e. one day. | 17 | Fixed a bug in searching for a small timerange, i.e. one day. |
9 | 18 | ||
10 | KA/Pi: | 19 | KA/Pi: |
11 | Fixed two problems in csv export. | 20 | Fixed two problems in csv export. |
12 | Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. | 21 | Fixed problems when calling the contact selection dialog from KO/Pi or OM/Pi. |
13 | 22 | ||
14 | ********** VERSION 2.1.9 ************ | 23 | ********** VERSION 2.1.9 ************ |
15 | 24 | ||
16 | KO/Pi: | 25 | KO/Pi: |
17 | Fixed some problems of the new search options in the search dialog. | 26 | Fixed some problems of the new search options in the search dialog. |
18 | Fixed some problems in the new resource config options. | 27 | Fixed some problems in the new resource config options. |
19 | Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. | 28 | Changed the recurrence edit of events and todos such that the recurrence edit page now is notified about a change of the start date on the first page. |
20 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: | 29 | Fixed a problem creating new events in the agenda view if at the day/time is already an agenda item shown: |
21 | Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. | 30 | Now you can click on the bottom/top of an allday agenda item or on the left/right side of an agenda item to get the "new todo/new event" popup. |
22 | 31 | ||
23 | Fixed a problem in recurrence range in syncing with DTM. | 32 | Fixed a problem in recurrence range in syncing with DTM. |
24 | 33 | ||
25 | KA/Pi: | 34 | KA/Pi: |
26 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) | 35 | Made it posiible to show in the contact overview the details of all data available for that contact( e.g. office, spouse, children, nickname ...) |
27 | 36 | ||
28 | PwM/Pi: | 37 | PwM/Pi: |
29 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. | 38 | Added "sec" to the timeout config settings to make it clear the timeout values are seconds. |
30 | 39 | ||
31 | ********** VERSION 2.1.8 ************ | 40 | ********** VERSION 2.1.8 ************ |
32 | 41 | ||
33 | KO/Pi: | 42 | KO/Pi: |
34 | Added info about the completion state of a todo in the ListView/Searchdialog. | 43 | Added info about the completion state of a todo in the ListView/Searchdialog. |
35 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. | 44 | If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. |
36 | Fixed some updating problems when changing the filter. | 45 | Fixed some updating problems when changing the filter. |
37 | 46 | ||
38 | KA/Pi: | 47 | KA/Pi: |
39 | In the addressee selection dialog now the formatted name is shown, if not empty. | 48 | In the addressee selection dialog now the formatted name is shown, if not empty. |
40 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. | 49 | Added a column "category" to the addressee selection dialog to make it possible to sort addressees after category. |
41 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. | 50 | Now in the addressee selection dialog a selected contact is remove with a single click from the selected list. |
42 | 51 | ||
43 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. | 52 | Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. |
44 | Fixed the sorting for size in the file selector on the Z. | 53 | Fixed the sorting for size in the file selector on the Z. |
45 | 54 | ||
46 | Changed the color selection dialog on the Zaurus to a more user friendly version. | 55 | Changed the color selection dialog on the Zaurus to a more user friendly version. |
47 | 56 | ||
48 | ********** VERSION 2.1.7 ************ | 57 | ********** VERSION 2.1.7 ************ |
49 | 58 | ||
50 | KO/Pi: | 59 | KO/Pi: |
51 | Fixed several problems in the new Resource handling. | 60 | Fixed several problems in the new Resource handling. |
52 | Added more options to the search dialog. | 61 | Added more options to the search dialog. |
53 | Fixed a problem in the Month view. | 62 | Fixed a problem in the Month view. |
54 | Added more options to the dialog when setting a todo to stopped. | 63 | Added more options to the dialog when setting a todo to stopped. |
55 | 64 | ||
56 | Fixed two small problems in KO/Pi Alarm applet. | 65 | Fixed two small problems in KO/Pi Alarm applet. |
57 | 66 | ||
58 | ********** VERSION 2.1.6 ************ | 67 | ********** VERSION 2.1.6 ************ |
59 | 68 | ||
60 | This release is for testing only. | 69 | This release is for testing only. |
61 | 70 | ||
62 | KO/Pi: | 71 | KO/Pi: |
63 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. | 72 | Added to the list view (the list view is used in search dialog as well) the possibility to print it. |
64 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. | 73 | Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. |
65 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. | 74 | Added to the list view the possibility to add all subtodos of selected todos to an export/beam. |
66 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. | 75 | Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. |
67 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. | 76 | Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. |
68 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. | 77 | Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. |
69 | 78 | ||
70 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. | 79 | Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. |
71 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. | 80 | In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. |
72 | Now on every sync the set of calendars is synced which are enabled in the resource view. | 81 | Now on every sync the set of calendars is synced which are enabled in the resource view. |
73 | 82 | ||
74 | A calendar is enabled in the resource view if the "eye" column is checked. | 83 | A calendar is enabled in the resource view if the "eye" column is checked. |
75 | You can set a calendar to be the default for new items( "+" column ). | 84 | You can set a calendar to be the default for new items( "+" column ). |
76 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. | 85 | You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. |
77 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... | 86 | To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... |
78 | 87 | ||
79 | 88 | ||
80 | ********** VERSION 2.1.5 ************ | 89 | ********** VERSION 2.1.5 ************ |
81 | 90 | ||
82 | This is the new stable version. | 91 | This is the new stable version. |
83 | Bugfix: | 92 | Bugfix: |
84 | Fixed a problem with agenda popup on the desktop in KO/Pi. | 93 | Fixed a problem with agenda popup on the desktop in KO/Pi. |
85 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. | 94 | Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. |
86 | Added config option to not display completed todos in agenda view. | 95 | Added config option to not display completed todos in agenda view. |
87 | Addressee view is now using the formatted name, if defined. | 96 | Addressee view is now using the formatted name, if defined. |
88 | That makes it possible to display "lastname, firstname" in that view now. | 97 | That makes it possible to display "lastname, firstname" in that view now. |
89 | To set the formatted name for all contacts, please use menu: | 98 | To set the formatted name for all contacts, please use menu: |
90 | Edit->Change->Set formatted name. | 99 | Edit->Change->Set formatted name. |
91 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. | 100 | Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. |
92 | 101 | ||
93 | ********** VERSION 2.1.4 ************ | 102 | ********** VERSION 2.1.4 ************ |
94 | 103 | ||
95 | Fixed two more bugs in the KA/Pi CSV import dialog: | 104 | Fixed two more bugs in the KA/Pi CSV import dialog: |
96 | Made it possible to read multi-line fields and import it to the "Note" field. | 105 | Made it possible to read multi-line fields and import it to the "Note" field. |
97 | Fixed a problem in mapping custom fields, whatever a custem field is... | 106 | Fixed a problem in mapping custom fields, whatever a custem field is... |
98 | 107 | ||
99 | ********** VERSION 2.1.3 ************ | 108 | ********** VERSION 2.1.3 ************ |
100 | 109 | ||
101 | Changed the menu structure of the alarm applet: | 110 | Changed the menu structure of the alarm applet: |
102 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". | 111 | Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". |
103 | 112 | ||
104 | Fixed several problems in the KA/Pi CSV import dialog: | 113 | Fixed several problems in the KA/Pi CSV import dialog: |
105 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. | 114 | Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. |
106 | 115 | ||
107 | 116 | ||
108 | ********** VERSION 2.1.2 ************ | 117 | ********** VERSION 2.1.2 ************ |
109 | 118 | ||
110 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. | 119 | Fixed a problem closing the alarm dialog on Zaurus with "OK" button. |
111 | 120 | ||
112 | Fixed a problem when importing data from Outlook with mutiple categories set. | 121 | Fixed a problem when importing data from Outlook with mutiple categories set. |
113 | 122 | ||
114 | Changed display of days in datenavigator: | 123 | Changed display of days in datenavigator: |
115 | Birthdays are now blue, not dark green. | 124 | Birthdays are now blue, not dark green. |
116 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. | 125 | When todo view is shown, no birtdays are shown and days with due todos are shown blue. |
117 | When journal view is shown, only holidays are shown and days with journals are blue. | 126 | When journal view is shown, only holidays are shown and days with journals are blue. |
118 | 127 | ||
119 | Added Backup options to global config: | 128 | Added Backup options to global config: |
120 | You 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 ). | 129 | You 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 ). |
121 | It 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. | 130 | It 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. |
122 | The 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. | 131 | The 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. |
123 | 132 | ||
124 | ********** VERSION 2.1.1 ************ | 133 | ********** VERSION 2.1.1 ************ |
125 | 134 | ||
126 | Stable release 2.1.1! | 135 | Stable release 2.1.1! |
127 | 136 | ||
128 | KO/Pi: | 137 | KO/Pi: |
129 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. | 138 | Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. |
130 | 139 | ||
131 | ********** VERSION 2.1.0 ************ | 140 | ********** VERSION 2.1.0 ************ |
132 | 141 | ||
133 | Stable release 2.1.0! | 142 | Stable release 2.1.0! |
134 | 143 | ||
135 | Summary of changes/fixes compared to version 2.0.6: | 144 | Summary of changes/fixes compared to version 2.0.6: |
136 | 145 | ||
137 | Many bugs of version 2.0.6 fixed. | 146 | Many bugs of version 2.0.6 fixed. |
138 | Most of them were small bugs, but some of them were important. | 147 | Most of them were small bugs, but some of them were important. |
139 | It is recommended to use version 2.1.0 and not version 2.0.6. | 148 | It is recommended to use version 2.1.0 and not version 2.0.6. |
140 | 149 | ||
141 | Important changes: | 150 | Important changes: |
142 | 151 | ||
143 | Added recurring todos to KO/Pi. | 152 | Added recurring todos to KO/Pi. |
144 | 153 | ||
145 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. | 154 | Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. |
146 | 155 | ||
147 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. | 156 | Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. |
148 | 157 | ||
149 | Datenavigator can now display many months. Very useful on the desktop. | 158 | Datenavigator can now display many months. Very useful on the desktop. |
150 | 159 | ||
151 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. | 160 | KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. |
152 | 161 | ||
153 | Made alarm sound working on Linux desktop. | 162 | Made alarm sound working on Linux desktop. |
154 | 163 | ||
155 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. | 164 | Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. |
156 | 165 | ||
157 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. | 166 | Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. |
158 | 167 | ||
159 | Many other usebility enhancements. | 168 | Many other usebility enhancements. |
160 | Special thanks to Ben for his suggestions! | 169 | Special thanks to Ben for his suggestions! |
161 | 170 | ||
162 | You can find the complete changelog | 171 | You can find the complete changelog |
163 | from version 1.7.7 to 2.1.0 | 172 | from version 1.7.7 to 2.1.0 |
164 | in the source package or on | 173 | in the source package or on |
165 | 174 | ||
166 | http://www.pi-sync.net/html/changelog.html | 175 | http://www.pi-sync.net/html/changelog.html |
167 | 176 | ||
168 | 177 | ||
169 | 178 | ||
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 8c1e5b2..52c5247 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -1,809 +1,809 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <qcstring.h> | 20 | #include <qcstring.h> |
21 | #include <qwhatsthis.h> | 21 | #include <qwhatsthis.h> |
22 | #include <qdialog.h> | 22 | #include <qdialog.h> |
23 | #include <qapplication.h> | 23 | #include <qapplication.h> |
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | 26 | ||
27 | #include <klocale.h> | 27 | #include <klocale.h> |
28 | #include <kapplication.h> | 28 | #include <kapplication.h> |
29 | #include <libkcal/event.h> | 29 | #include <libkcal/event.h> |
30 | #include <libkcal/todo.h> | 30 | #include <libkcal/todo.h> |
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kiconloader.h> | 32 | #include <kiconloader.h> |
33 | #include <krun.h> | 33 | #include <krun.h> |
34 | #include <kglobal.h> | 34 | #include <kglobal.h> |
35 | #include <kprocess.h> | 35 | #include <kprocess.h> |
36 | #include "koprefs.h" | 36 | #include "koprefs.h" |
37 | 37 | ||
38 | #include <kabc/stdaddressbook.h> | 38 | #include <kabc/stdaddressbook.h> |
39 | 39 | ||
40 | #ifndef KORG_NODCOP | 40 | #ifndef KORG_NODCOP |
41 | #include <dcopclient.h> | 41 | #include <dcopclient.h> |
42 | #include "korganizer.h" | 42 | #include "korganizer.h" |
43 | #include "koprefs.h" | 43 | #include "koprefs.h" |
44 | #include "actionmanager.h" | 44 | #include "actionmanager.h" |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #include "koeventviewer.h" | 47 | #include "koeventviewer.h" |
48 | //#ifndef KORG_NOKABC | 48 | //#ifndef KORG_NOKABC |
49 | //#include <kabc/stdaddressbook.h> | 49 | //#include <kabc/stdaddressbook.h> |
50 | //#define size count | 50 | //#define size count |
51 | //#endif | 51 | //#endif |
52 | 52 | ||
53 | #ifdef DESKTOP_VERSION | 53 | #ifdef DESKTOP_VERSION |
54 | #include <kabc/addresseedialog.h> | 54 | #include <kabc/addresseedialog.h> |
55 | #include <kabc/addresseeview.h> | 55 | #include <kabc/addresseeview.h> |
56 | #include <qprinter.h> | 56 | #include <qprinter.h> |
57 | #include <qpainter.h> | 57 | #include <qpainter.h> |
58 | #include <qpaintdevicemetrics.h> | 58 | #include <qpaintdevicemetrics.h> |
59 | #else //DESKTOP_VERSION | 59 | #else //DESKTOP_VERSION |
60 | #include <externalapphandler.h> | 60 | #include <externalapphandler.h> |
61 | #include <qtopia/qcopenvelope_qws.h> | 61 | #include <qtopia/qcopenvelope_qws.h> |
62 | #endif //DESKTOP_VERSION | 62 | #endif //DESKTOP_VERSION |
63 | 63 | ||
64 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) | 64 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) |
65 | : QTextBrowser(parent,name) | 65 | : QTextBrowser(parent,name) |
66 | { | 66 | { |
67 | mSyncMode = false; | 67 | mSyncMode = false; |
68 | mColorMode = 0; | 68 | mColorMode = 0; |
69 | } | 69 | } |
70 | 70 | ||
71 | KOEventViewer::~KOEventViewer() | 71 | KOEventViewer::~KOEventViewer() |
72 | { | 72 | { |
73 | } | 73 | } |
74 | 74 | ||
75 | void KOEventViewer::printMe() | 75 | void KOEventViewer::printMe() |
76 | { | 76 | { |
77 | #ifdef DESKTOP_VERSION | 77 | #ifdef DESKTOP_VERSION |
78 | 78 | ||
79 | KOPrintPrefs pp ( this ); | 79 | KOPrintPrefs pp ( this ); |
80 | if (!pp.exec() ) | 80 | if (!pp.exec() ) |
81 | return; | 81 | return; |
82 | int scaleval = pp.printMode() ; | 82 | int scaleval = pp.printMode() ; |
83 | 83 | ||
84 | QPrinter printer; | 84 | QPrinter printer; |
85 | if (!printer.setup() ) | 85 | if (!printer.setup() ) |
86 | return; | 86 | return; |
87 | QPainter p; | 87 | QPainter p; |
88 | p.begin ( &printer ); | 88 | p.begin ( &printer ); |
89 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | 89 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); |
90 | float dx, dy; | 90 | float dx, dy; |
91 | int wid = (m.width() * 9)/10; | 91 | int wid = (m.width() * 9)/10; |
92 | dx = (float) wid/(float)contentsWidth (); | 92 | dx = (float) wid/(float)contentsWidth (); |
93 | dy = (float)(m.height()) / (float)contentsHeight (); | 93 | dy = (float)(m.height()) / (float)contentsHeight (); |
94 | float scale; | 94 | float scale; |
95 | // scale to fit the width or height of the paper | 95 | // scale to fit the width or height of the paper |
96 | if ( dx < dy ) | 96 | if ( dx < dy ) |
97 | scale = dx; | 97 | scale = dx; |
98 | else | 98 | else |
99 | scale = dy; | 99 | scale = dy; |
100 | 100 | ||
101 | p.translate( m.width()/10,0 ); | 101 | p.translate( m.width()/10,0 ); |
102 | if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { | 102 | if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { |
103 | p.scale( scale, scale ); | 103 | p.scale( scale, scale ); |
104 | } | 104 | } |
105 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); | 105 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); |
106 | p.end(); | 106 | p.end(); |
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | } | 109 | } |
110 | void KOEventViewer::setSource(const QString& n) | 110 | void KOEventViewer::setSource(const QString& n) |
111 | { | 111 | { |
112 | 112 | ||
113 | if ( n.left(3) == "uid" ) | 113 | if ( n.left(3) == "uid" ) |
114 | #ifdef DESKTOP_VERSION | 114 | #ifdef DESKTOP_VERSION |
115 | { | 115 | { |
116 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 116 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
117 | KABC::AddressBook::Iterator it; | 117 | KABC::AddressBook::Iterator it; |
118 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 118 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
119 | // LR I do not understand, why the uid string is different on zaurus and desktop | 119 | // LR I do not understand, why the uid string is different on zaurus and desktop |
120 | QString uid = "uid://"+(*it).uid(); | 120 | QString uid = "uid://"+(*it).uid(); |
121 | 121 | ||
122 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); | 122 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); |
123 | if (n == uid ) { | 123 | if (n == uid ) { |
124 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 124 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
125 | QDialog dia( this,"dia123", true ); | 125 | QDialog dia( this,"dia123", true ); |
126 | dia.setCaption( i18n("Details of attendee") ); | 126 | dia.setCaption( i18n("Details of attendee") ); |
127 | QVBoxLayout lay ( &dia ); | 127 | QVBoxLayout lay ( &dia ); |
128 | KABC::AddresseeView av ( &dia ); | 128 | KABC::AddresseeView av ( &dia ); |
129 | av.setAddressee( (*it) ); | 129 | av.setAddressee( (*it) ); |
130 | lay.addWidget( &av ); | 130 | lay.addWidget( &av ); |
131 | if ( QApplication::desktop()->width() < 480 ) | 131 | if ( QApplication::desktop()->width() < 480 ) |
132 | dia.resize( 220, 240); | 132 | dia.resize( 220, 240); |
133 | else { | 133 | else { |
134 | dia.resize( 400,400); | 134 | dia.resize( 400,400); |
135 | } | 135 | } |
136 | dia.exec(); | 136 | dia.exec(); |
137 | break; | 137 | break; |
138 | } | 138 | } |
139 | } | 139 | } |
140 | return; | 140 | return; |
141 | } | 141 | } |
142 | #else | 142 | #else |
143 | { | 143 | { |
144 | if ( "uid:organizer" == n ) { | 144 | if ( "uid:organizer" == n ) { |
145 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); | 145 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); |
146 | return; | 146 | return; |
147 | } | 147 | } |
148 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 148 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
149 | if (attendees.count()) { | 149 | if (attendees.count()) { |
150 | Attendee *a; | 150 | Attendee *a; |
151 | for(a=attendees.first();a;a=attendees.next()) { | 151 | for(a=attendees.first();a;a=attendees.next()) { |
152 | if ( "uid:"+a->uid() == n ) { | 152 | if ( "uid:"+a->uid() == n ) { |
153 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); | 153 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); |
154 | return; | 154 | return; |
155 | } | 155 | } |
156 | } | 156 | } |
157 | } | 157 | } |
158 | return; | 158 | return; |
159 | } | 159 | } |
160 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | 160 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); |
161 | // the result should now arrive through method insertAttendees | 161 | // the result should now arrive through method insertAttendees |
162 | //QString uid = "uid:"+(*it).uid(); | 162 | //QString uid = "uid:"+(*it).uid(); |
163 | #endif | 163 | #endif |
164 | if ( n.left(6) == "mailto" ) { | 164 | if ( n.left(6) == "mailto" ) { |
165 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); | 165 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); |
166 | #ifndef DESKTOP_VERSION | 166 | #ifndef DESKTOP_VERSION |
167 | if ( n.mid(7,3) == "ALL" ) { | 167 | if ( n.mid(7,3) == "ALL" ) { |
168 | mailToAttendees( true ); | 168 | mailToAttendees( true ); |
169 | } else if ( n.mid(7,4) == "RSVP" ) { | 169 | } else if ( n.mid(7,4) == "RSVP" ) { |
170 | mailToAttendees( false ); | 170 | mailToAttendees( false ); |
171 | } else { | 171 | } else { |
172 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); | 172 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); |
173 | e << n.mid(7); | 173 | e << n.mid(7); |
174 | } | 174 | } |
175 | #endif | 175 | #endif |
176 | 176 | ||
177 | } | 177 | } |
178 | 178 | ||
179 | 179 | ||
180 | #ifndef KORG_NODCOP | 180 | #ifndef KORG_NODCOP |
181 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; | 181 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; |
182 | QString tmpStr; | 182 | QString tmpStr; |
183 | if (n.startsWith("mailto:")) { | 183 | if (n.startsWith("mailto:")) { |
184 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); | 184 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); |
185 | //emit showIncidence(n); | 185 | //emit showIncidence(n); |
186 | return; | 186 | return; |
187 | } else if (n.startsWith("uid:")) { | 187 | } else if (n.startsWith("uid:")) { |
188 | DCOPClient *client = KApplication::kApplication()->dcopClient(); | 188 | DCOPClient *client = KApplication::kApplication()->dcopClient(); |
189 | const QByteArray noParamData; | 189 | const QByteArray noParamData; |
190 | const QByteArray paramData; | 190 | const QByteArray paramData; |
191 | QByteArray replyData; | 191 | QByteArray replyData; |
192 | QCString replyTypeStr; | 192 | QCString replyTypeStr; |
193 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) | 193 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) |
194 | bool foundAbbrowser = PING_ABBROWSER; | 194 | bool foundAbbrowser = PING_ABBROWSER; |
195 | 195 | ||
196 | if (foundAbbrowser) { | 196 | if (foundAbbrowser) { |
197 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor | 197 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor |
198 | //client->send("kaddressbook","KAddressBookIface", | 198 | //client->send("kaddressbook","KAddressBookIface", |
199 | QDataStream arg(paramData, IO_WriteOnly); | 199 | QDataStream arg(paramData, IO_WriteOnly); |
200 | arg << n.mid(6); | 200 | arg << n.mid(6); |
201 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); | 201 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); |
202 | return; | 202 | return; |
203 | } else { | 203 | } else { |
204 | /* | 204 | /* |
205 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. | 205 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. |
206 | We start it without its main interface | 206 | We start it without its main interface |
207 | */ | 207 | */ |
208 | KIconLoader* iconLoader = new KIconLoader(); | 208 | KIconLoader* iconLoader = new KIconLoader(); |
209 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); | 209 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); |
210 | ActionManager::setStartedKAddressBook(true); | 210 | ActionManager::setStartedKAddressBook(true); |
211 | tmpStr = "kaddressbook --editor-only --uid "; | 211 | tmpStr = "kaddressbook --editor-only --uid "; |
212 | tmpStr += KProcess::quote(n.mid(6)); | 212 | tmpStr += KProcess::quote(n.mid(6)); |
213 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); | 213 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); |
214 | return; | 214 | return; |
215 | } | 215 | } |
216 | } else { | 216 | } else { |
217 | //QTextBrowser::setSource(n); | 217 | //QTextBrowser::setSource(n); |
218 | } | 218 | } |
219 | #endif | 219 | #endif |
220 | } | 220 | } |
221 | void KOEventViewer::mailToAttendees( bool all ) | 221 | void KOEventViewer::mailToAttendees( bool all ) |
222 | { | 222 | { |
223 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 223 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
224 | if (attendees.count() == 0) return; | 224 | if (attendees.count() == 0) return; |
225 | QStringList nameList; | 225 | QStringList nameList; |
226 | QStringList emailList; | 226 | QStringList emailList; |
227 | QStringList uidList; | 227 | QStringList uidList; |
228 | Attendee* a; | 228 | Attendee* a; |
229 | for(a=attendees.first();a;a=attendees.next()) { | 229 | for(a=attendees.first();a;a=attendees.next()) { |
230 | if ( !all && !a->RSVP() ) continue; | 230 | if ( !all && !a->RSVP() ) continue; |
231 | if (!a->email().isEmpty()) { | 231 | if (!a->email().isEmpty()) { |
232 | nameList.append (a->name() ); | 232 | nameList.append (a->name() ); |
233 | emailList.append (a->email() ); | 233 | emailList.append (a->email() ); |
234 | uidList.append (a->uid() ); | 234 | uidList.append (a->uid() ); |
235 | } | 235 | } |
236 | } | 236 | } |
237 | QString uid = "ComposeMailUIpick2"+mMailSubject; | 237 | QString uid = "ComposeMailUIpick2"+mMailSubject; |
238 | #ifndef DESKTOP_VERSION | 238 | #ifndef DESKTOP_VERSION |
239 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); | 239 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); |
240 | #endif | 240 | #endif |
241 | 241 | ||
242 | } | 242 | } |
243 | void KOEventViewer::addTag(const QString & tag,const QString & text) | 243 | void KOEventViewer::addTag(const QString & tag,const QString & text) |
244 | { | 244 | { |
245 | int number=text.contains("\n"); | 245 | int number=text.contains("\n"); |
246 | QString str = "<" + tag + ">"; | 246 | QString str = "<" + tag + ">"; |
247 | QString tmpText=text; | 247 | QString tmpText=text; |
248 | QString tmpStr=str; | 248 | QString tmpStr=str; |
249 | if(number !=-1) | 249 | if(number !=-1) |
250 | { | 250 | { |
251 | if (number > 0) { | 251 | if (number > 0) { |
252 | int pos=0; | 252 | int pos=0; |
253 | QString tmp; | 253 | QString tmp; |
254 | for(int i=0;i<=number;i++) { | 254 | for(int i=0;i<=number;i++) { |
255 | pos=tmpText.find("\n"); | 255 | pos=tmpText.find("\n"); |
256 | tmp=tmpText.left(pos); | 256 | tmp=tmpText.left(pos); |
257 | tmpText=tmpText.right(tmpText.length()-pos-1); | 257 | tmpText=tmpText.right(tmpText.length()-pos-1); |
258 | tmpStr+=tmp+"<br>"; | 258 | tmpStr+=tmp+"<br>"; |
259 | } | 259 | } |
260 | } | 260 | } |
261 | else tmpStr += tmpText; | 261 | else tmpStr += tmpText; |
262 | tmpStr+="</" + tag + ">"; | 262 | tmpStr+="</" + tag + ">"; |
263 | mText.append(tmpStr); | 263 | mText.append(tmpStr); |
264 | } | 264 | } |
265 | else | 265 | else |
266 | { | 266 | { |
267 | str += text + "</" + tag + ">"; | 267 | str += text + "</" + tag + ">"; |
268 | mText.append(str); | 268 | mText.append(str); |
269 | } | 269 | } |
270 | } | 270 | } |
271 | 271 | ||
272 | void KOEventViewer::setColorMode( int m ) | 272 | void KOEventViewer::setColorMode( int m ) |
273 | { | 273 | { |
274 | mColorMode = m; | 274 | mColorMode = m; |
275 | } | 275 | } |
276 | void KOEventViewer::appendEvent(Event *event, int mode ) | 276 | void KOEventViewer::appendEvent(Event *event, int mode ) |
277 | { | 277 | { |
278 | mMailSubject = ""; | 278 | mMailSubject = ""; |
279 | mCurrentIncidence = event; | 279 | mCurrentIncidence = event; |
280 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 280 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
281 | bool wideScreen = ( QApplication::desktop()->width() >= 640 ); | 281 | bool wideScreen = ( QApplication::desktop()->width() >= 640 ); |
282 | topLevelWidget()->setCaption(i18n("Event Viewer")); | 282 | topLevelWidget()->setCaption(i18n("Event Viewer")); |
283 | if ( mode == 0 ) { | 283 | if ( mode == 0 ) { |
284 | addTag("h2",deTag(event->summary())); | 284 | addTag("h2",deTag(event->summary())); |
285 | formatReadOnly(event); | 285 | formatReadOnly(event); |
286 | } | 286 | } |
287 | else { | 287 | else { |
288 | if ( mColorMode == 1 ) { | 288 | if ( mColorMode == 1 ) { |
289 | mText +="<font color=\"#00A000\">"; | 289 | mText +="<font color=\"#00A000\">"; |
290 | } | 290 | } |
291 | if ( mColorMode == 2 ) { | 291 | if ( mColorMode == 2 ) { |
292 | mText +="<font color=\"#C00000\">"; | 292 | mText +="<font color=\"#C00000\">"; |
293 | } | 293 | } |
294 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 294 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
295 | if ( mode == 1 ) { | 295 | if ( mode == 1 ) { |
296 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 296 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
297 | } else { | 297 | } else { |
298 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 298 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
299 | } | 299 | } |
300 | formatReadOnly(event); | 300 | formatReadOnly(event); |
301 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 301 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
302 | if ( mColorMode ) | 302 | if ( mColorMode ) |
303 | mText += "</font>"; | 303 | mText += "</font>"; |
304 | } | 304 | } |
305 | mMailSubject += i18n( "Meeting " )+ event->summary(); | 305 | mMailSubject += i18n( "Meeting " )+ event->summary(); |
306 | if (event->cancelled ()) { | 306 | if (event->cancelled ()) { |
307 | mText +="<font color=\"#B00000\">"; | 307 | mText +="<font color=\"#B00000\">"; |
308 | addTag("i",i18n("This event has been cancelled!")); | 308 | addTag("i",i18n("This event has been cancelled!")); |
309 | mText.append("<br>"); | 309 | mText.append("<br>"); |
310 | mText += "</font>"; | 310 | mText += "</font>"; |
311 | mMailSubject += i18n("(cancelled)"); | 311 | mMailSubject += i18n("(cancelled)"); |
312 | } | 312 | } |
313 | 313 | ||
314 | if (event->doesFloat()) { | 314 | if (event->doesFloat()) { |
315 | if (event->isMultiDay()) { | 315 | if (event->isMultiDay()) { |
316 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 316 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
317 | .arg(event->dtStartDateStr(shortDate)) | 317 | .arg(event->dtStartDateStr(shortDate)) |
318 | .arg(event->dtEndDateStr(shortDate))); | 318 | .arg(event->dtEndDateStr(shortDate))); |
319 | } else { | 319 | } else { |
320 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 320 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
321 | } | 321 | } |
322 | } else { | 322 | } else { |
323 | if (event->isMultiDay()) { | 323 | if (event->isMultiDay()) { |
324 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 324 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
325 | .arg(event->dtStartStr( shortDate))); | 325 | .arg(event->dtStartStr( shortDate))); |
326 | mText.append(i18n("<p><b>To:</b> %1</p>") | 326 | mText.append(i18n("<p><b>To:</b> %1</p>") |
327 | .arg(event->dtEndStr(shortDate))); | 327 | .arg(event->dtEndStr(shortDate))); |
328 | } else { | 328 | } else { |
329 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 329 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
330 | .arg(event->dtStartTimeStr()) | 330 | .arg(event->dtStartTimeStr()) |
331 | .arg(event->dtEndTimeStr())); | 331 | .arg(event->dtEndTimeStr())); |
332 | mText.append(i18n("<p><b>On:</b> %1</p> ") | 332 | mText.append(i18n("<p><b>On:</b> %1</p> ") |
333 | .arg(event->dtStartDateStr( shortDate ))); | 333 | .arg(event->dtStartDateStr( shortDate ))); |
334 | } | 334 | } |
335 | } | 335 | } |
336 | if (!event->location().isEmpty()) { | 336 | if (!event->location().isEmpty()) { |
337 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); | 337 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); |
338 | mMailSubject += i18n(" at ") + event->location(); | 338 | mMailSubject += i18n(" at ") + event->location(); |
339 | } | 339 | } |
340 | if (event->recurrence()->doesRecur()) { | 340 | if (event->recurrence()->doesRecur()) { |
341 | 341 | ||
342 | QString recurText = event->recurrence()->recurrenceText(); | 342 | QString recurText = event->recurrence()->recurrenceText(); |
343 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 343 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
344 | bool ok; | 344 | bool ok; |
345 | QDate start = QDate::currentDate(); | 345 | QDate start = QDate::currentDate(); |
346 | QDateTime next; | 346 | QDateTime next; |
347 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); | 347 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
348 | if ( ok ) { | 348 | if ( ok ) { |
349 | if ( wideScreen ){ | 349 | if ( wideScreen ){ |
350 | addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) ); | 350 | addTag("p",i18n("<b>Next recurrence is on:</b>") +" " + KGlobal::locale()->formatDate( next.date(), shortDate ) ); |
351 | } else { | 351 | } else { |
352 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 352 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
353 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); | 353 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
354 | } | 354 | } |
355 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); | 355 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); |
356 | 356 | ||
357 | } else { | 357 | } else { |
358 | bool last; | 358 | bool last; |
359 | QDate nextd; | 359 | QDate nextd; |
360 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); | 360 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); |
361 | if ( last ) { | 361 | if ( last ) { |
362 | if ( wideScreen ){ | 362 | if ( wideScreen ){ |
363 | addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate )); | 363 | addTag("p",i18n("<b>Last recurrence was on:</b>") +" " + KGlobal::locale()->formatDate( nextd, shortDate )); |
364 | } else{ | 364 | } else{ |
365 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 365 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
366 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | 366 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); |
367 | } | 367 | } |
368 | } | 368 | } |
369 | } | 369 | } |
370 | } else { | 370 | } else { |
371 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | 371 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); |
372 | 372 | ||
373 | } | 373 | } |
374 | 374 | ||
375 | 375 | ||
376 | if (event->isAlarmEnabled()) { | 376 | if (event->isAlarmEnabled()) { |
377 | Alarm *alarm =event->alarms().first() ; | 377 | Alarm *alarm =event->alarms().first() ; |
378 | QDateTime t = alarm->time(); | 378 | QDateTime t = alarm->time(); |
379 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 379 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
380 | if(wideScreen ){ | 380 | if(wideScreen ){ |
381 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); | 381 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); |
382 | }else{ | 382 | }else{ |
383 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 383 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
384 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 384 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
385 | } | 385 | } |
386 | //addTag("p",s); | 386 | //addTag("p",s); |
387 | } | 387 | } |
388 | 388 | ||
389 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); | 389 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); |
390 | 390 | ||
391 | formatCategories(event); | 391 | formatCategories(event); |
392 | 392 | ||
393 | formatAttendees(event); | 393 | formatAttendees(event); |
394 | 394 | ||
395 | if ( KOPrefs::instance()->mEVshowCreated ) { | 395 | if ( KOPrefs::instance()->mEVshowCreated ) { |
396 | if(wideScreen ){ | 396 | if(wideScreen ){ |
397 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 397 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
398 | }else{ | 398 | }else{ |
399 | addTag("p",i18n("<b>Created: ") +" </b>"); | 399 | addTag("p",i18n("<b>Created: ") +" </b>"); |
400 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 400 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
401 | } | 401 | } |
402 | 402 | ||
403 | 403 | ||
404 | } | 404 | } |
405 | if ( KOPrefs::instance()->mEVshowChanged ) { | 405 | if ( KOPrefs::instance()->mEVshowChanged ) { |
406 | if(wideScreen ){ | 406 | if(wideScreen ){ |
407 | addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); | 407 | addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); |
408 | }else{ | 408 | }else{ |
409 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | 409 | addTag("p",i18n("<b>Last modified: ") +" </b>"); |
410 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | 410 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); |
411 | } | 411 | } |
412 | 412 | ||
413 | } | 413 | } |
414 | if ( KOPrefs::instance()->mEVshowDetails ) { | 414 | if ( KOPrefs::instance()->mEVshowDetails ) { |
415 | if (!event->description().isEmpty()) { | 415 | if (!event->description().isEmpty()) { |
416 | addTag("p",i18n("<b>Details: </b>")); | 416 | addTag("p",i18n("<b>Details: </b>")); |
417 | addTag("p",deTag(event->description())); | 417 | addTag("p",deTag(event->description())); |
418 | } | 418 | } |
419 | } | 419 | } |
420 | setText(mText); | 420 | setText(mText); |
421 | //QWhatsThis::add(this,mText); | 421 | //QWhatsThis::add(this,mText); |
422 | 422 | ||
423 | } | 423 | } |
424 | 424 | ||
425 | void KOEventViewer::appendTodo(Todo *event, int mode ) | 425 | void KOEventViewer::appendTodo(Todo *event, int mode ) |
426 | { | 426 | { |
427 | mMailSubject = ""; | 427 | mMailSubject = ""; |
428 | mCurrentIncidence = event; | 428 | mCurrentIncidence = event; |
429 | topLevelWidget()->setCaption(i18n("Todo Viewer")); | 429 | topLevelWidget()->setCaption(i18n("Todo Viewer")); |
430 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 430 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
431 | bool wideScreen = ( QApplication::desktop()->width() >= 640 ); | 431 | bool wideScreen = ( QApplication::desktop()->width() >= 640 ); |
432 | if (mode == 0 ) { | 432 | if (mode == 0 ) { |
433 | addTag("h2",deTag(event->summary())); | 433 | addTag("h2",deTag(event->summary())); |
434 | formatReadOnly(event); | 434 | formatReadOnly(event); |
435 | } | 435 | } |
436 | else { | 436 | else { |
437 | if ( mColorMode == 1 ) { | 437 | if ( mColorMode == 1 ) { |
438 | mText +="<font color=\"#00A000\">"; | 438 | mText +="<font color=\"#00A000\">"; |
439 | } | 439 | } |
440 | if ( mColorMode == 2 ) { | 440 | if ( mColorMode == 2 ) { |
441 | mText +="<font color=\"#B00000\">"; | 441 | mText +="<font color=\"#B00000\">"; |
442 | } | 442 | } |
443 | if ( mode == 1 ) { | 443 | if ( mode == 1 ) { |
444 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 444 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
445 | } else { | 445 | } else { |
446 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 446 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
447 | } | 447 | } |
448 | formatReadOnly(event); | 448 | formatReadOnly(event); |
449 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 449 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
450 | if ( mColorMode ) | 450 | if ( mColorMode ) |
451 | mText += "</font>"; | 451 | mText += "</font>"; |
452 | } | 452 | } |
453 | mMailSubject += i18n( "Todo " )+ event->summary(); | 453 | mMailSubject += i18n( "Todo " )+ event->summary(); |
454 | 454 | ||
455 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 455 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
456 | mText +="<font color=\"#B00000\">"; | 456 | mText +="<font color=\"#B00000\">"; |
457 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); | 457 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); |
458 | mText += "</font>"; | 458 | mText += "</font>"; |
459 | } else { | 459 | } else { |
460 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 460 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
461 | .arg(event->percentComplete())); | 461 | .arg(event->percentComplete())); |
462 | } | 462 | } |
463 | 463 | ||
464 | if (event->cancelled ()) { | 464 | if (event->cancelled ()) { |
465 | mText +="<font color=\"#B00000\">"; | 465 | mText +="<font color=\"#B00000\">"; |
466 | addTag("i",i18n("This todo has been cancelled!")); | 466 | addTag("i",i18n("This todo has been cancelled!")); |
467 | mText.append("<br>"); | 467 | mText.append("<br>"); |
468 | mText += "</font>"; | 468 | mText += "</font>"; |
469 | mMailSubject += i18n("(cancelled)"); | 469 | mMailSubject += i18n("(cancelled)"); |
470 | } | 470 | } |
471 | 471 | ||
472 | 472 | ||
473 | 473 | ||
474 | if (event->recurrence()->doesRecur()) { | 474 | if (event->recurrence()->doesRecur()) { |
475 | 475 | ||
476 | QString recurText = event->recurrence()->recurrenceText(); | 476 | QString recurText = event->recurrence()->recurrenceText(); |
477 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | 477 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); |
478 | 478 | ||
479 | } | 479 | } |
480 | if (event->hasStartDate()) { | 480 | if (event->hasStartDate()) { |
481 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 481 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
482 | } | 482 | } |
483 | if (event->hasDueDate()) { | 483 | if (event->hasDueDate()) { |
484 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 484 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
485 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 485 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
486 | } | 486 | } |
487 | if (!event->location().isEmpty()) { | 487 | if (!event->location().isEmpty()) { |
488 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); | 488 | addTag("p","<b>"+i18n("Location: ")+"</b>"+ deTag(event->location() ) ); |
489 | mMailSubject += i18n(" at ") + event->location(); | 489 | mMailSubject += i18n(" at ") + event->location(); |
490 | } | 490 | } |
491 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 491 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
492 | .arg(QString::number(event->priority()))); | 492 | .arg(QString::number(event->priority()))); |
493 | 493 | ||
494 | if (event->isAlarmEnabled()) { | 494 | if (event->isAlarmEnabled()) { |
495 | Alarm *alarm =event->alarms().first() ; | 495 | Alarm *alarm =event->alarms().first() ; |
496 | QDateTime t = alarm->time(); | 496 | QDateTime t = alarm->time(); |
497 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 497 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
498 | if ( wideScreen ) { | 498 | if ( wideScreen ) { |
499 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); | 499 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"+ KGlobal::locale()->formatDateTime( t, shortDate )); |
500 | } else { | 500 | } else { |
501 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 501 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
502 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 502 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
503 | } | 503 | } |
504 | } | 504 | } |
505 | 505 | ||
506 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); | 506 | addTag("p","<b>"+i18n("Access: ") + "</b>" + event->secrecyStr()); |
507 | 507 | ||
508 | formatCategories(event); | 508 | formatCategories(event); |
509 | 509 | ||
510 | formatAttendees(event); | 510 | formatAttendees(event); |
511 | 511 | ||
512 | if ( KOPrefs::instance()->mEVshowCreated ) { | 512 | if ( KOPrefs::instance()->mEVshowCreated ) { |
513 | if(wideScreen ){ | 513 | if(wideScreen ){ |
514 | 514 | ||
515 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 515 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
516 | 516 | ||
517 | } else { | 517 | } else { |
518 | addTag("p",i18n("<b>Created: ") +" </b>"); | 518 | addTag("p",i18n("<b>Created: ") +" </b>"); |
519 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 519 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
520 | } | 520 | } |
521 | } | 521 | } |
522 | if ( KOPrefs::instance()->mEVshowChanged ) { | 522 | if ( KOPrefs::instance()->mEVshowChanged ) { |
523 | if(wideScreen ){ | 523 | if(wideScreen ){ |
524 | addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); | 524 | addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); |
525 | 525 | ||
526 | } else { | 526 | } else { |
527 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | 527 | addTag("p",i18n("<b>Last modified: ") +" </b>"); |
528 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | 528 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); |
529 | } | 529 | } |
530 | } | 530 | } |
531 | if ( event->relatedTo() ) { | 531 | if ( event->relatedTo() ) { |
532 | addTag("b",i18n("Parent todo:<br>")); | 532 | addTag("b",i18n("Parent todo:<br>")); |
533 | mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); | 533 | mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); |
534 | } | 534 | } |
535 | QPtrList<Incidence> Relations = event->relations(); | 535 | QPtrList<Incidence> Relations = event->relations(); |
536 | Incidence *to; | 536 | Incidence *to; |
537 | if ( Relations.first() ) | 537 | if ( Relations.first() ) |
538 | addTag("b",i18n("Sub todos:<br>")); | 538 | addTag("b",i18n("Sub todos:<br>")); |
539 | for (to=Relations.first();to;to=Relations.next()) { | 539 | for (to=Relations.first();to;to=Relations.next()) { |
540 | mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); | 540 | mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); |
541 | 541 | ||
542 | } | 542 | } |
543 | 543 | ||
544 | if ( KOPrefs::instance()->mEVshowDetails ) { | 544 | if ( KOPrefs::instance()->mEVshowDetails ) { |
545 | if (!event->description().isEmpty()) { | 545 | if (!event->description().isEmpty()) { |
546 | addTag("p",i18n("<b>Details: </b>")); | 546 | addTag("p",i18n("<b>Details: </b>")); |
547 | addTag("p",deTag(event->description())); | 547 | addTag("p",deTag(event->description())); |
548 | } | 548 | } |
549 | } | 549 | } |
550 | setText(mText); | 550 | setText(mText); |
551 | } | 551 | } |
552 | 552 | ||
553 | void KOEventViewer::formatCategories(Incidence *event) | 553 | void KOEventViewer::formatCategories(Incidence *event) |
554 | { | 554 | { |
555 | if (!event->categoriesStr().isEmpty()) { | 555 | if (!event->categoriesStr().isEmpty()) { |
556 | if (event->categories().count() == 1) { | 556 | if (event->categories().count() == 1) { |
557 | addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace()); | 557 | addTag("p","<b>"+i18n("Category") + ":</b> " + event->categoriesStrWithSpace()); |
558 | } else { | 558 | } else { |
559 | addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ; | 559 | addTag("p","<b>"+i18n("Categories")+":</b> " + event->categoriesStrWithSpace() ) ; |
560 | } | 560 | } |
561 | } | 561 | } |
562 | } | 562 | } |
563 | void KOEventViewer::formatAttendees(Incidence *event) | 563 | void KOEventViewer::formatAttendees(Incidence *event) |
564 | { | 564 | { |
565 | QPtrList<Attendee> attendees = event->attendees(); | 565 | QPtrList<Attendee> attendees = event->attendees(); |
566 | if (attendees.count()) { | 566 | if (attendees.count()) { |
567 | 567 | ||
568 | 568 | ||
569 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 569 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
570 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 570 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
571 | addTag("h3",i18n("Organizer")); | 571 | addTag("h3",i18n("Organizer")); |
572 | mText.append("<ul><li>"); | 572 | mText.append("<ul><li>"); |
573 | #ifndef KORG_NOKABC | 573 | #ifndef KORG_NOKABC |
574 | 574 | ||
575 | #ifdef DESKTOP_VERSION | 575 | #ifdef DESKTOP_VERSION |
576 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 576 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
577 | KABC::Addressee::List addressList; | 577 | KABC::Addressee::List addressList; |
578 | addressList = add_book->findByEmail(event->organizer()); | 578 | addressList = add_book->findByEmail(event->organizer()); |
579 | KABC::Addressee o = addressList.first(); | 579 | KABC::Addressee o = addressList.first(); |
580 | if (!o.isEmpty() && addressList.size()<2) { | 580 | if (!o.isEmpty() && addressList.size()<2) { |
581 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 581 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
582 | mText += o.formattedName(); | 582 | mText += o.formattedName(); |
583 | mText += "</a>\n"; | 583 | mText += "</a>\n"; |
584 | } else { | 584 | } else { |
585 | mText.append(event->organizer()); | 585 | mText.append(event->organizer()); |
586 | } | 586 | } |
587 | #else //DESKTOP_VERSION | 587 | #else //DESKTOP_VERSION |
588 | mText += "<a href=\"uid:organizer\">"; | 588 | mText += "<a href=\"uid:organizer\">"; |
589 | mText += event->organizer(); | 589 | mText += event->organizer(); |
590 | mText += "</a>\n"; | 590 | mText += "</a>\n"; |
591 | #endif //DESKTOP_VERSION | 591 | #endif //DESKTOP_VERSION |
592 | 592 | ||
593 | 593 | ||
594 | #else | 594 | #else |
595 | mText.append(event->organizer()); | 595 | mText.append(event->organizer()); |
596 | #endif | 596 | #endif |
597 | 597 | ||
598 | if (iconPath) { | 598 | if (iconPath) { |
599 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; | 599 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; |
600 | mText += "<IMG src=\"" + iconPath + "\">"; | 600 | mText += "<IMG src=\"" + iconPath + "\">"; |
601 | mText += "</a>\n"; | 601 | mText += "</a>\n"; |
602 | } | 602 | } |
603 | mText.append("</li></ul>"); | 603 | mText.append("</li></ul>"); |
604 | 604 | ||
605 | addTag("h3",i18n("Attendees")); | 605 | addTag("h3",i18n("Attendees")); |
606 | Attendee *a; | 606 | Attendee *a; |
607 | mText.append("<ul>"); | 607 | mText.append("<ul>"); |
608 | int a_count = 0; | 608 | int a_count = 0; |
609 | int a_count_nr = 0; | 609 | int a_count_nr = 0; |
610 | 610 | ||
611 | for(a=attendees.first();a;a=attendees.next()) { | 611 | for(a=attendees.first();a;a=attendees.next()) { |
612 | #ifndef KORG_NOKABC | 612 | #ifndef KORG_NOKABC |
613 | #ifdef DESKTOP_VERSION | 613 | #ifdef DESKTOP_VERSION |
614 | if (a->name().isEmpty()) { | 614 | if (a->name().isEmpty()) { |
615 | addressList = add_book->findByEmail(a->email()); | 615 | addressList = add_book->findByEmail(a->email()); |
616 | KABC::Addressee o = addressList.first(); | 616 | KABC::Addressee o = addressList.first(); |
617 | if (!o.isEmpty() && addressList.size()<2) { | 617 | if (!o.isEmpty() && addressList.size()<2) { |
618 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 618 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
619 | mText += o.formattedName(); | 619 | mText += o.formattedName(); |
620 | mText += "</a>\n"; | 620 | mText += "</a>\n"; |
621 | } else { | 621 | } else { |
622 | mText += "<li>"; | 622 | mText += "<li>"; |
623 | mText.append(a->email()); | 623 | mText.append(a->email()); |
624 | mText += "\n"; | 624 | mText += "\n"; |
625 | } | 625 | } |
626 | } else { | 626 | } else { |
627 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 627 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
628 | if (!a->name().isEmpty()) mText += a->name(); | 628 | if (!a->name().isEmpty()) mText += a->name(); |
629 | else mText += a->email(); | 629 | else mText += a->email(); |
630 | mText += "</a>\n"; | 630 | mText += "</a>\n"; |
631 | } | 631 | } |
632 | #else //DESKTOP_VERSION | 632 | #else //DESKTOP_VERSION |
633 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 633 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
634 | if (!a->name().isEmpty()) mText += a->name(); | 634 | if (!a->name().isEmpty()) mText += a->name(); |
635 | else mText += a->email(); | 635 | else mText += a->email(); |
636 | mText += "</a>\n"; | 636 | mText += "</a>\n"; |
637 | #endif //DESKTOP_VERSION | 637 | #endif //DESKTOP_VERSION |
638 | #else | 638 | #else |
639 | //qDebug("nokabc "); | 639 | //qDebug("nokabc "); |
640 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 640 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
641 | if (!a->name().isEmpty()) mText += a->name(); | 641 | if (!a->name().isEmpty()) mText += a->name(); |
642 | else mText += a->email(); | 642 | else mText += a->email(); |
643 | mText += "</a>\n"; | 643 | mText += "</a>\n"; |
644 | #endif | 644 | #endif |
645 | 645 | ||
646 | 646 | ||
647 | if (!a->email().isEmpty()) { | 647 | if (!a->email().isEmpty()) { |
648 | if (iconPath) { | 648 | if (iconPath) { |
649 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; | 649 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; |
650 | if ( a->RSVP() ) { | 650 | if ( a->RSVP() ) { |
651 | ++a_count_nr; | 651 | ++a_count_nr; |
652 | mText += "<IMG src=\"" + iconPath + "\">"; | 652 | mText += "<IMG src=\"" + iconPath + "\">"; |
653 | } | 653 | } |
654 | else { | 654 | else { |
655 | ++a_count; | 655 | ++a_count; |
656 | mText += "<IMG src=\"" + NOiconPath + "\">"; | 656 | mText += "<IMG src=\"" + NOiconPath + "\">"; |
657 | } | 657 | } |
658 | mText += "</a>\n"; | 658 | mText += "</a>\n"; |
659 | } | 659 | } |
660 | } | 660 | } |
661 | if (a->status() != Attendee::NeedsAction ) | 661 | if (a->status() != Attendee::NeedsAction ) |
662 | mText +="[" + a->statusStr() + "] "; | 662 | mText +="[" + a->statusStr() + "] "; |
663 | if (a->role() == Attendee::Chair ) | 663 | if (a->role() == Attendee::Chair ) |
664 | mText +="(" + a->roleStr().left(1) + ".)"; | 664 | mText +="(" + a->roleStr().left(1) + ".)"; |
665 | } | 665 | } |
666 | mText.append("</li></ul>"); | 666 | mText.append("</li></ul>"); |
667 | if ( (a_count+a_count_nr) > 1 ) { | 667 | if ( (a_count+a_count_nr) > 1 ) { |
668 | mText += "<a href=\"mailto:ALL\">"; | 668 | mText += "<a href=\"mailto:ALL\">"; |
669 | mText += i18n( "Mail to all" ); | 669 | mText += i18n( "Mail to all" ); |
670 | mText += "</a> ( "; | 670 | mText += "</a> ( "; |
671 | mText += "<IMG src=\"" + iconPath + "\">"; | 671 | mText += "<IMG src=\"" + iconPath + "\">"; |
672 | mText += i18n( " and " ); | 672 | mText += i18n( " and " ); |
673 | mText += "<IMG src=\"" + NOiconPath + "\"> )"; | 673 | mText += "<IMG src=\"" + NOiconPath + "\"> )"; |
674 | mText += "<br>\n"; | 674 | mText += "<br>\n"; |
675 | 675 | ||
676 | 676 | ||
677 | } | 677 | } |
678 | if ( a_count_nr > 1 ) { | 678 | if ( a_count_nr > 1 ) { |
679 | mText += "<a href=\"mailto:RSVP\">"; | 679 | mText += "<a href=\"mailto:RSVP\">"; |
680 | mText += i18n( "Mail to selected" ); | 680 | mText += i18n( "Mail to selected" ); |
681 | mText += "</a> ( "; | 681 | mText += "</a> ( "; |
682 | mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); | 682 | mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); |
683 | mText += "<br>\n"; | 683 | mText += "<br>\n"; |
684 | } | 684 | } |
685 | } | 685 | } |
686 | 686 | ||
687 | } | 687 | } |
688 | void KOEventViewer::appendJournal(Journal *jour, int mode ) | 688 | void KOEventViewer::appendJournal(Journal *jour, int mode ) |
689 | { | 689 | { |
690 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 690 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
691 | if (mode == 0 ) { | 691 | if (mode == 0 ) { |
692 | addTag("h2",i18n("Journal from: ")); | 692 | addTag("h2",i18n("Journal from: ")); |
693 | } | 693 | } |
694 | else { | 694 | else { |
695 | if ( mode == 1 ) { | 695 | if ( mode == 1 ) { |
696 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); | 696 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); |
697 | } else { | 697 | } else { |
698 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); | 698 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); |
699 | } | 699 | } |
700 | } | 700 | } |
701 | topLevelWidget()->setCaption("Journal Viewer"); | 701 | topLevelWidget()->setCaption("Journal Viewer"); |
702 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); | 702 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); |
703 | if (!jour->summary().isEmpty()) { | 703 | if (!jour->summary().isEmpty()) { |
704 | addTag("b",i18n(" Title: ") + deTag(jour->summary())); | 704 | addTag("b",i18n(" Title: ") + deTag(jour->summary())); |
705 | } | 705 | } |
706 | formatReadOnly(jour); | 706 | formatReadOnly(jour); |
707 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); | 707 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); |
708 | 708 | ||
709 | if (!jour->description().isEmpty()) { | 709 | if (!jour->description().isEmpty()) { |
710 | addTag("p",deTag(jour->description())); | 710 | addTag("p",deTag(jour->description())); |
711 | } | 711 | } |
712 | setText(mText); | 712 | setText(mText); |
713 | } | 713 | } |
714 | 714 | ||
715 | void KOEventViewer::formatReadOnly(Incidence *event) | 715 | void KOEventViewer::formatReadOnly(Incidence *event) |
716 | { | 716 | { |
717 | int id = event->calID(); | 717 | int id = event->calID(); |
718 | if ( id > 1 ) { | 718 | if ( id > 1 ) { |
719 | addTag("p", i18n("Calendar:")+" " + KOPrefs::instance()->getCalendar( id )->mName ); | 719 | addTag("p", "<em>("+i18n("Calendar:")+" " + KOPrefs::instance()->getCalendar( id )->mName + ")</em>"); |
720 | } | 720 | } |
721 | if (event->isReadOnly()) { | 721 | if (event->isReadOnly()) { |
722 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); | 722 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); |
723 | } | 723 | } |
724 | } | 724 | } |
725 | void KOEventViewer::setSyncMode( bool b ) | 725 | void KOEventViewer::setSyncMode( bool b ) |
726 | { | 726 | { |
727 | mSyncMode = b; | 727 | mSyncMode = b; |
728 | } | 728 | } |
729 | 729 | ||
730 | void KOEventViewer::setTodo(Todo *event, bool clearV ) | 730 | void KOEventViewer::setTodo(Todo *event, bool clearV ) |
731 | { | 731 | { |
732 | if ( clearV ) | 732 | if ( clearV ) |
733 | clearEvents(); | 733 | clearEvents(); |
734 | if ( mSyncMode ) { | 734 | if ( mSyncMode ) { |
735 | if ( clearV ) | 735 | if ( clearV ) |
736 | appendTodo(event,1 ); | 736 | appendTodo(event,1 ); |
737 | else | 737 | else |
738 | appendTodo(event,2); | 738 | appendTodo(event,2); |
739 | } else | 739 | } else |
740 | appendTodo(event); | 740 | appendTodo(event); |
741 | } | 741 | } |
742 | void KOEventViewer::setJournal(Journal *event, bool clearV ) | 742 | void KOEventViewer::setJournal(Journal *event, bool clearV ) |
743 | { | 743 | { |
744 | if ( clearV ) | 744 | if ( clearV ) |
745 | clearEvents(); | 745 | clearEvents(); |
746 | if ( mSyncMode ) { | 746 | if ( mSyncMode ) { |
747 | if ( clearV ) | 747 | if ( clearV ) |
748 | appendJournal(event, 1); | 748 | appendJournal(event, 1); |
749 | else | 749 | else |
750 | appendJournal(event, 2); | 750 | appendJournal(event, 2); |
751 | } else | 751 | } else |
752 | appendJournal(event); | 752 | appendJournal(event); |
753 | } | 753 | } |
754 | 754 | ||
755 | void KOEventViewer::setEvent(Event *event) | 755 | void KOEventViewer::setEvent(Event *event) |
756 | { | 756 | { |
757 | clearEvents(); | 757 | clearEvents(); |
758 | if ( mSyncMode ) | 758 | if ( mSyncMode ) |
759 | appendEvent(event, 1); | 759 | appendEvent(event, 1); |
760 | else | 760 | else |
761 | appendEvent(event); | 761 | appendEvent(event); |
762 | } | 762 | } |
763 | 763 | ||
764 | void KOEventViewer::addEvent(Event *event) | 764 | void KOEventViewer::addEvent(Event *event) |
765 | { | 765 | { |
766 | if ( mSyncMode ) | 766 | if ( mSyncMode ) |
767 | appendEvent(event, 2); | 767 | appendEvent(event, 2); |
768 | else | 768 | else |
769 | appendEvent(event); | 769 | appendEvent(event); |
770 | } | 770 | } |
771 | 771 | ||
772 | void KOEventViewer::clearEvents(bool now) | 772 | void KOEventViewer::clearEvents(bool now) |
773 | { | 773 | { |
774 | mText = ""; | 774 | mText = ""; |
775 | if (now) setText(mText); | 775 | if (now) setText(mText); |
776 | } | 776 | } |
777 | 777 | ||
778 | void KOEventViewer::addText(QString text) | 778 | void KOEventViewer::addText(QString text) |
779 | { | 779 | { |
780 | mText.append(text); | 780 | mText.append(text); |
781 | setText(mText); | 781 | setText(mText); |
782 | } | 782 | } |
783 | QString KOEventViewer::deTag(QString text) | 783 | QString KOEventViewer::deTag(QString text) |
784 | { | 784 | { |
785 | #if QT_VERSION >= 0x030000 | 785 | #if QT_VERSION >= 0x030000 |
786 | text.replace( '<' , "<" ); | 786 | text.replace( '<' , "<" ); |
787 | text.replace( '>' , ">" ); | 787 | text.replace( '>' , ">" ); |
788 | #else | 788 | #else |
789 | if ( text.find ('<') >= 0 ) { | 789 | if ( text.find ('<') >= 0 ) { |
790 | text.replace( QRegExp("<") , "<" ); | 790 | text.replace( QRegExp("<") , "<" ); |
791 | } | 791 | } |
792 | if ( text.find ('>') >= 0 ) { | 792 | if ( text.find ('>') >= 0 ) { |
793 | text.replace( QRegExp(">") , ">" ); | 793 | text.replace( QRegExp(">") , ">" ); |
794 | } | 794 | } |
795 | #endif | 795 | #endif |
796 | return text; | 796 | return text; |
797 | } | 797 | } |
798 | void KOEventViewer::keyPressEvent ( QKeyEvent * e ) | 798 | void KOEventViewer::keyPressEvent ( QKeyEvent * e ) |
799 | { | 799 | { |
800 | switch ( e->key() ) { | 800 | switch ( e->key() ) { |
801 | case Qt::Key_Return: | 801 | case Qt::Key_Return: |
802 | case Qt::Key_Enter : | 802 | case Qt::Key_Enter : |
803 | e->ignore(); | 803 | e->ignore(); |
804 | break; | 804 | break; |
805 | default: | 805 | default: |
806 | QTextBrowser::keyPressEvent ( e ); | 806 | QTextBrowser::keyPressEvent ( e ); |
807 | break; | 807 | break; |
808 | } | 808 | } |
809 | } | 809 | } |