author | zautrix <zautrix> | 2004-09-17 00:39:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-17 00:39:46 (UTC) |
commit | 14f8adb33ca434d36e80b3b7e7e262f4ede24d0d (patch) (unidiff) | |
tree | 477f0cbf3c5b4d8e5b1c01c682c5e650f34c2912 | |
parent | 8462751df135b9ad08b1269661d2c7eb18c67976 (diff) | |
download | kdepimpi-14f8adb33ca434d36e80b3b7e7e262f4ede24d0d.zip kdepimpi-14f8adb33ca434d36e80b3b7e7e262f4ede24d0d.tar.gz kdepimpi-14f8adb33ca434d36e80b3b7e7e262f4ede24d0d.tar.bz2 |
More lib changes
-rw-r--r-- | kaddressbook/kaddressbookE.pro | 2 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 10 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 328 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.h | 42 | ||||
-rw-r--r-- | libkcal/libkcalE.pro | 2 | ||||
-rw-r--r-- | libkdepim/libkdepimE.pro | 6 | ||||
-rwxr-xr-x | setZaurus3 | 24 |
7 files changed, 405 insertions, 9 deletions
diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro index c027895..7eb85fd 100644 --- a/kaddressbook/kaddressbookE.pro +++ b/kaddressbook/kaddressbookE.pro | |||
@@ -1,161 +1,161 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | 3 | ||
4 | 4 | ||
5 | TARGET = kapi | 5 | TARGET = kapi |
6 | OBJECTS_DIR = obj/$(PLATFORM) | 6 | OBJECTS_DIR = obj/$(PLATFORM) |
7 | MOC_DIR = moc/$(PLATFORM) | 7 | MOC_DIR = moc/$(PLATFORM) |
8 | DESTDIR=$(QPEDIR)/bin | 8 | DESTDIR=$(QPEDIR)/bin |
9 | 9 | ||
10 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include | 10 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include |
11 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER | 11 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER |
12 | #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL | 12 | #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL |
13 | #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | 13 | #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER |
14 | #DEFINES += KORG_NOLVALTERNATION | 14 | #DEFINES += KORG_NOLVALTERNATION |
15 | #LIBS += -lmicrokdepim | 15 | LIBS += -lmicrokdepim |
16 | #LIBS += -lmicrokcal | 16 | #LIBS += -lmicrokcal |
17 | LIBS += -lmicrokde | 17 | LIBS += -lmicrokde |
18 | LIBS += -lmicroqtcompat | 18 | LIBS += -lmicroqtcompat |
19 | LIBS += -lmicrokabc | 19 | LIBS += -lmicrokabc |
20 | LIBS += -lqpe | 20 | LIBS += -lqpe |
21 | LIBS += -ljpeg | 21 | LIBS += -ljpeg |
22 | LIBS += $(QTOPIALIB) | 22 | LIBS += $(QTOPIALIB) |
23 | LIBS += -L$(QPEDIR)/lib | 23 | LIBS += -L$(QPEDIR)/lib |
24 | LIBS += -Wl,-export-dynamic | 24 | LIBS += -Wl,-export-dynamic |
25 | LIBS += $(GCC3EXTRALIB1) | 25 | LIBS += $(GCC3EXTRALIB1) |
26 | LIBS += $(GCC3EXTRALIB2) | 26 | LIBS += $(GCC3EXTRALIB2) |
27 | 27 | ||
28 | INTERFACES = \ | 28 | INTERFACES = \ |
29 | # filteredit_base.ui \ | 29 | # filteredit_base.ui \ |
30 | # kofilterview_base.ui \ | 30 | # kofilterview_base.ui \ |
31 | 31 | ||
32 | HEADERS = \ | 32 | HEADERS = \ |
33 | features/mergewidget.h \ | 33 | features/mergewidget.h \ |
34 | features/distributionlistwidget.h \ | 34 | features/distributionlistwidget.h \ |
35 | kcmconfigs/addresseewidget.h \ | 35 | kcmconfigs/addresseewidget.h \ |
36 | kcmconfigs/extensionconfigdialog.h \ | 36 | kcmconfigs/extensionconfigdialog.h \ |
37 | kcmconfigs/kcmkabconfig.h \ | 37 | kcmconfigs/kcmkabconfig.h \ |
38 | kcmconfigs/kabconfigwidget.h \ | 38 | kcmconfigs/kabconfigwidget.h \ |
39 | addresseeeditordialog.h \ | 39 | addresseeeditordialog.h \ |
40 | addresseeeditorwidget.h \ | 40 | addresseeeditorwidget.h \ |
41 | addresseditwidget.h \ | 41 | addresseditwidget.h \ |
42 | addresseeconfig.h \ | 42 | addresseeconfig.h \ |
43 | addresseeutil.h \ | 43 | addresseeutil.h \ |
44 | emaileditwidget.h \ | 44 | emaileditwidget.h \ |
45 | filtereditdialog.h \ | 45 | filtereditdialog.h \ |
46 | kaddressbookmain.h \ | 46 | kaddressbookmain.h \ |
47 | kabprefs.h \ | 47 | kabprefs.h \ |
48 | kabcore.h \ | 48 | kabcore.h \ |
49 | viewmanager.h \ | 49 | viewmanager.h \ |
50 | extensionmanager.h \ | 50 | extensionmanager.h \ |
51 | extensionwidget.h \ | 51 | extensionwidget.h \ |
52 | kaddressbookview.h \ | 52 | kaddressbookview.h \ |
53 | geowidget.h \ | 53 | geowidget.h \ |
54 | imagewidget.h \ | 54 | imagewidget.h \ |
55 | incsearchwidget.h \ | 55 | incsearchwidget.h \ |
56 | jumpbuttonbar.h \ | 56 | jumpbuttonbar.h \ |
57 | phoneeditwidget.h \ | 57 | phoneeditwidget.h \ |
58 | secrecywidget.h \ | 58 | secrecywidget.h \ |
59 | keywidget.h \ | 59 | keywidget.h \ |
60 | nameeditdialog.h \ | 60 | nameeditdialog.h \ |
61 | filter.h \ | 61 | filter.h \ |
62 | addviewdialog.h \ | 62 | addviewdialog.h \ |
63 | configurewidget.h \ | 63 | configurewidget.h \ |
64 | viewconfigurewidget.h \ | 64 | viewconfigurewidget.h \ |
65 | viewconfigurefieldspage.h \ | 65 | viewconfigurefieldspage.h \ |
66 | viewconfigurefilterpage.h \ | 66 | viewconfigurefilterpage.h \ |
67 | typecombo.h \ | 67 | typecombo.h \ |
68 | undo.h \ | 68 | undo.h \ |
69 | undocmds.h \ | 69 | undocmds.h \ |
70 | xxportmanager.h \ | 70 | xxportmanager.h \ |
71 | xxportobject.h \ | 71 | xxportobject.h \ |
72 | xxportselectdialog.h \ | 72 | xxportselectdialog.h \ |
73 | details/detailsviewcontainer.h \ | 73 | details/detailsviewcontainer.h \ |
74 | details/look_basic.h \ | 74 | details/look_basic.h \ |
75 | details/look_html.h \ | 75 | details/look_html.h \ |
76 | views/kaddressbookiconview.h \ | 76 | views/kaddressbookiconview.h \ |
77 | views/kaddressbooktableview.h \ | 77 | views/kaddressbooktableview.h \ |
78 | views/kaddressbookcardview.h \ | 78 | views/kaddressbookcardview.h \ |
79 | views/configuretableviewdialog.h \ | 79 | views/configuretableviewdialog.h \ |
80 | views/configurecardviewdialog.h \ | 80 | views/configurecardviewdialog.h \ |
81 | views/cardview.h \ | 81 | views/cardview.h \ |
82 | views/colorlistbox.h \ | 82 | views/colorlistbox.h \ |
83 | views/contactlistview.h \ | 83 | views/contactlistview.h \ |
84 | xxport/vcard_xxport.h \ | 84 | xxport/vcard_xxport.h \ |
85 | xxport/kde2_xxport.h \ | 85 | xxport/kde2_xxport.h \ |
86 | xxport/csv_xxport.h \ | 86 | xxport/csv_xxport.h \ |
87 | xxport/csvimportdialog.h \ | 87 | xxport/csvimportdialog.h \ |
88 | xxport/opie_xxport.h \ | 88 | xxport/opie_xxport.h \ |
89 | xxport/qtopia_xxport.h \ | 89 | xxport/qtopia_xxport.h \ |
90 | xxport/sharpdtm_xxport.h \ | 90 | xxport/sharpdtm_xxport.h \ |
91 | #details/look_details.h \ | 91 | #details/look_details.h \ |
92 | #mainwindoiw.h \ | 92 | #mainwindoiw.h \ |
93 | # alarmclient.h \ | 93 | # alarmclient.h \ |
94 | # calendarview.h \ | 94 | # calendarview.h \ |
95 | # customlistviewitem.h \ | 95 | # customlistviewitem.h \ |
96 | # datenavigator.h | 96 | # datenavigator.h |
97 | 97 | ||
98 | SOURCES = \ | 98 | SOURCES = \ |
99 | addresseeeditordialog.cpp \ | 99 | addresseeeditordialog.cpp \ |
100 | addresseeeditorwidget.cpp \ | 100 | addresseeeditorwidget.cpp \ |
101 | addresseditwidget.cpp \ | 101 | addresseditwidget.cpp \ |
102 | addresseeconfig.cpp \ | 102 | addresseeconfig.cpp \ |
103 | addresseeutil.cpp \ | 103 | addresseeutil.cpp \ |
104 | extensionmanager.cpp \ | 104 | extensionmanager.cpp \ |
105 | features/mergewidget.cpp \ | 105 | features/mergewidget.cpp \ |
106 | features/distributionlistwidget.cpp \ | 106 | features/distributionlistwidget.cpp \ |
107 | kcmconfigs/addresseewidget.cpp \ | 107 | kcmconfigs/addresseewidget.cpp \ |
108 | kcmconfigs/extensionconfigdialog.cpp \ | 108 | kcmconfigs/extensionconfigdialog.cpp \ |
109 | kcmconfigs/kcmkabconfig.cpp \ | 109 | kcmconfigs/kcmkabconfig.cpp \ |
110 | kcmconfigs/kabconfigwidget.cpp \ | 110 | kcmconfigs/kabconfigwidget.cpp \ |
111 | emaileditwidget.cpp \ | 111 | emaileditwidget.cpp \ |
112 | filtereditdialog.cpp \ | 112 | filtereditdialog.cpp \ |
113 | mainembedded.cpp \ | 113 | mainembedded.cpp \ |
114 | kaddressbookmain.cpp \ | 114 | kaddressbookmain.cpp \ |
115 | kabcore.cpp \ | 115 | kabcore.cpp \ |
116 | kabprefs.cpp \ | 116 | kabprefs.cpp \ |
117 | viewmanager.cpp \ | 117 | viewmanager.cpp \ |
118 | kaddressbookview.cpp \ | 118 | kaddressbookview.cpp \ |
119 | extensionwidget.cpp \ | 119 | extensionwidget.cpp \ |
120 | geowidget.cpp \ | 120 | geowidget.cpp \ |
121 | imagewidget.cpp \ | 121 | imagewidget.cpp \ |
122 | incsearchwidget.cpp \ | 122 | incsearchwidget.cpp \ |
123 | jumpbuttonbar.cpp \ | 123 | jumpbuttonbar.cpp \ |
124 | phoneeditwidget.cpp \ | 124 | phoneeditwidget.cpp \ |
125 | secrecywidget.cpp \ | 125 | secrecywidget.cpp \ |
126 | keywidget.cpp \ | 126 | keywidget.cpp \ |
127 | nameeditdialog.cpp \ | 127 | nameeditdialog.cpp \ |
128 | filter.cpp \ | 128 | filter.cpp \ |
129 | addviewdialog.cpp \ | 129 | addviewdialog.cpp \ |
130 | configurewidget.cpp \ | 130 | configurewidget.cpp \ |
131 | viewconfigurewidget.cpp \ | 131 | viewconfigurewidget.cpp \ |
132 | viewconfigurefieldspage.cpp \ | 132 | viewconfigurefieldspage.cpp \ |
133 | viewconfigurefilterpage.cpp \ | 133 | viewconfigurefilterpage.cpp \ |
134 | undo.cpp \ | 134 | undo.cpp \ |
135 | undocmds.cpp \ | 135 | undocmds.cpp \ |
136 | xxportmanager.cpp \ | 136 | xxportmanager.cpp \ |
137 | xxportobject.cpp \ | 137 | xxportobject.cpp \ |
138 | xxportselectdialog.cpp \ | 138 | xxportselectdialog.cpp \ |
139 | details/detailsviewcontainer.cpp \ | 139 | details/detailsviewcontainer.cpp \ |
140 | details/look_basic.cpp \ | 140 | details/look_basic.cpp \ |
141 | details/look_html.cpp \ | 141 | details/look_html.cpp \ |
142 | views/kaddressbookiconview.cpp \ | 142 | views/kaddressbookiconview.cpp \ |
143 | views/kaddressbooktableview.cpp \ | 143 | views/kaddressbooktableview.cpp \ |
144 | views/kaddressbookcardview.cpp \ | 144 | views/kaddressbookcardview.cpp \ |
145 | views/configuretableviewdialog.cpp \ | 145 | views/configuretableviewdialog.cpp \ |
146 | views/configurecardviewdialog.cpp \ | 146 | views/configurecardviewdialog.cpp \ |
147 | views/cardview.cpp \ | 147 | views/cardview.cpp \ |
148 | views/contactlistview.cpp \ | 148 | views/contactlistview.cpp \ |
149 | views/colorlistbox.cpp \ | 149 | views/colorlistbox.cpp \ |
150 | xxport/vcard_xxport.cpp \ | 150 | xxport/vcard_xxport.cpp \ |
151 | xxport/kde2_xxport.cpp \ | 151 | xxport/kde2_xxport.cpp \ |
152 | xxport/csv_xxport.cpp \ | 152 | xxport/csv_xxport.cpp \ |
153 | xxport/csvimportdialog.cpp \ | 153 | xxport/csvimportdialog.cpp \ |
154 | xxport/opie_xxport.cpp \ | 154 | xxport/opie_xxport.cpp \ |
155 | xxport/qtopia_xxport.cpp \ | 155 | xxport/qtopia_xxport.cpp \ |
156 | xxport/sharpdtm_xxport.cpp \ | 156 | xxport/sharpdtm_xxport.cpp \ |
157 | #details/look_details.cpp \ | 157 | #details/look_details.cpp \ |
158 | #mainwindow.cpp \ | 158 | #mainwindow.cpp \ |
159 | # calendarview.cpp \ | 159 | # calendarview.cpp \ |
160 | # timespanview.cpp | 160 | # timespanview.cpp |
161 | 161 | ||
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index 948047a..e938e4e 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -1,580 +1,580 @@ | |||
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 <libkdepim/addresseeview.h> | ||
39 | #include <kabc/stdaddressbook.h> | 38 | #include <kabc/stdaddressbook.h> |
40 | 39 | ||
41 | #ifndef KORG_NODCOP | 40 | #ifndef KORG_NODCOP |
42 | #include <dcopclient.h> | 41 | #include <dcopclient.h> |
43 | #include "korganizer.h" | 42 | #include "korganizer.h" |
44 | #include "koprefs.h" | 43 | #include "koprefs.h" |
45 | #include "actionmanager.h" | 44 | #include "actionmanager.h" |
46 | #endif | 45 | #endif |
47 | 46 | ||
48 | #include "koeventviewer.h" | 47 | #include "koeventviewer.h" |
49 | #ifndef KORG_NOKABC | 48 | //#ifndef KORG_NOKABC |
50 | #include <kabc/stdaddressbook.h> | 49 | //#include <kabc/stdaddressbook.h> |
51 | #define size count | 50 | //#define size count |
52 | #endif | 51 | //#endif |
53 | 52 | ||
54 | #ifdef DESKTOP_VERSION | 53 | #ifdef DESKTOP_VERSION |
55 | #include <kabc/addresseedialog.h> | 54 | #include <kabc/addresseedialog.h> |
55 | #include <kabc/addresseeview.h> | ||
56 | #else //DESKTOP_VERSION | 56 | #else //DESKTOP_VERSION |
57 | #include <externalapphandler.h> | 57 | #include <externalapphandler.h> |
58 | #include <qtopia/qcopenvelope_qws.h> | 58 | #include <qtopia/qcopenvelope_qws.h> |
59 | #endif //DESKTOP_VERSION | 59 | #endif //DESKTOP_VERSION |
60 | 60 | ||
61 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) | 61 | KOEventViewer::KOEventViewer(QWidget *parent,const char *name) |
62 | : QTextBrowser(parent,name) | 62 | : QTextBrowser(parent,name) |
63 | { | 63 | { |
64 | mSyncMode = false; | 64 | mSyncMode = false; |
65 | mColorMode = 0; | 65 | mColorMode = 0; |
66 | } | 66 | } |
67 | 67 | ||
68 | KOEventViewer::~KOEventViewer() | 68 | KOEventViewer::~KOEventViewer() |
69 | { | 69 | { |
70 | } | 70 | } |
71 | 71 | ||
72 | void KOEventViewer::setSource(const QString& n) | 72 | void KOEventViewer::setSource(const QString& n) |
73 | { | 73 | { |
74 | 74 | ||
75 | if ( n.left(3) == "uid" ) | 75 | if ( n.left(3) == "uid" ) |
76 | #ifdef DESKTOP_VERSION | 76 | #ifdef DESKTOP_VERSION |
77 | { | 77 | { |
78 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 78 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
79 | KABC::AddressBook::Iterator it; | 79 | KABC::AddressBook::Iterator it; |
80 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 80 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
81 | // LR I do not understand, why the uid string is different on zaurus and desktop | 81 | // LR I do not understand, why the uid string is different on zaurus and desktop |
82 | QString uid = "uid://"+(*it).uid(); | 82 | QString uid = "uid://"+(*it).uid(); |
83 | 83 | ||
84 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); | 84 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); |
85 | if (n == uid ) { | 85 | if (n == uid ) { |
86 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 86 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
87 | QDialog dia( this,"dia123", true ); | 87 | QDialog dia( this,"dia123", true ); |
88 | dia.setCaption( i18n("Details of attendee") ); | 88 | dia.setCaption( i18n("Details of attendee") ); |
89 | QVBoxLayout lay ( &dia ); | 89 | QVBoxLayout lay ( &dia ); |
90 | KPIM::AddresseeView av ( &dia ); | 90 | KPIM::AddresseeView av ( &dia ); |
91 | av.setAddressee( (*it) ); | 91 | av.setAddressee( (*it) ); |
92 | lay.addWidget( &av ); | 92 | lay.addWidget( &av ); |
93 | if ( QApplication::desktop()->width() < 480 ) | 93 | if ( QApplication::desktop()->width() < 480 ) |
94 | dia.resize( 220, 240); | 94 | dia.resize( 220, 240); |
95 | else { | 95 | else { |
96 | dia.resize( 400,400); | 96 | dia.resize( 400,400); |
97 | } | 97 | } |
98 | dia.exec(); | 98 | dia.exec(); |
99 | break; | 99 | break; |
100 | } | 100 | } |
101 | } | 101 | } |
102 | return; | 102 | return; |
103 | } | 103 | } |
104 | #else | 104 | #else |
105 | { | 105 | { |
106 | if ( "uid:organizer" == n ) { | 106 | if ( "uid:organizer" == n ) { |
107 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); | 107 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); |
108 | return; | 108 | return; |
109 | } | 109 | } |
110 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 110 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
111 | if (attendees.count()) { | 111 | if (attendees.count()) { |
112 | Attendee *a; | 112 | Attendee *a; |
113 | for(a=attendees.first();a;a=attendees.next()) { | 113 | for(a=attendees.first();a;a=attendees.next()) { |
114 | if ( "uid:"+a->uid() == n ) { | 114 | if ( "uid:"+a->uid() == n ) { |
115 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); | 115 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); |
116 | return; | 116 | return; |
117 | } | 117 | } |
118 | } | 118 | } |
119 | } | 119 | } |
120 | return; | 120 | return; |
121 | } | 121 | } |
122 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | 122 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); |
123 | // the result should now arrive through method insertAttendees | 123 | // the result should now arrive through method insertAttendees |
124 | //QString uid = "uid:"+(*it).uid(); | 124 | //QString uid = "uid:"+(*it).uid(); |
125 | #endif | 125 | #endif |
126 | if ( n.left(6) == "mailto" ) { | 126 | if ( n.left(6) == "mailto" ) { |
127 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); | 127 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); |
128 | #ifndef DESKTOP_VERSION | 128 | #ifndef DESKTOP_VERSION |
129 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); | 129 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); |
130 | e << n.mid(7); | 130 | e << n.mid(7); |
131 | #endif | 131 | #endif |
132 | 132 | ||
133 | } | 133 | } |
134 | 134 | ||
135 | 135 | ||
136 | #ifndef KORG_NODCOP | 136 | #ifndef KORG_NODCOP |
137 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; | 137 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; |
138 | QString tmpStr; | 138 | QString tmpStr; |
139 | if (n.startsWith("mailto:")) { | 139 | if (n.startsWith("mailto:")) { |
140 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); | 140 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); |
141 | //emit showIncidence(n); | 141 | //emit showIncidence(n); |
142 | return; | 142 | return; |
143 | } else if (n.startsWith("uid:")) { | 143 | } else if (n.startsWith("uid:")) { |
144 | DCOPClient *client = KApplication::kApplication()->dcopClient(); | 144 | DCOPClient *client = KApplication::kApplication()->dcopClient(); |
145 | const QByteArray noParamData; | 145 | const QByteArray noParamData; |
146 | const QByteArray paramData; | 146 | const QByteArray paramData; |
147 | QByteArray replyData; | 147 | QByteArray replyData; |
148 | QCString replyTypeStr; | 148 | QCString replyTypeStr; |
149 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) | 149 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) |
150 | bool foundAbbrowser = PING_ABBROWSER; | 150 | bool foundAbbrowser = PING_ABBROWSER; |
151 | 151 | ||
152 | if (foundAbbrowser) { | 152 | if (foundAbbrowser) { |
153 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor | 153 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor |
154 | //client->send("kaddressbook","KAddressBookIface", | 154 | //client->send("kaddressbook","KAddressBookIface", |
155 | QDataStream arg(paramData, IO_WriteOnly); | 155 | QDataStream arg(paramData, IO_WriteOnly); |
156 | arg << n.mid(6); | 156 | arg << n.mid(6); |
157 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); | 157 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); |
158 | return; | 158 | return; |
159 | } else { | 159 | } else { |
160 | /* | 160 | /* |
161 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. | 161 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. |
162 | We start it without its main interface | 162 | We start it without its main interface |
163 | */ | 163 | */ |
164 | KIconLoader* iconLoader = new KIconLoader(); | 164 | KIconLoader* iconLoader = new KIconLoader(); |
165 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); | 165 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); |
166 | ActionManager::setStartedKAddressBook(true); | 166 | ActionManager::setStartedKAddressBook(true); |
167 | tmpStr = "kaddressbook --editor-only --uid "; | 167 | tmpStr = "kaddressbook --editor-only --uid "; |
168 | tmpStr += KProcess::quote(n.mid(6)); | 168 | tmpStr += KProcess::quote(n.mid(6)); |
169 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); | 169 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); |
170 | return; | 170 | return; |
171 | } | 171 | } |
172 | } else { | 172 | } else { |
173 | //QTextBrowser::setSource(n); | 173 | //QTextBrowser::setSource(n); |
174 | } | 174 | } |
175 | #endif | 175 | #endif |
176 | } | 176 | } |
177 | 177 | ||
178 | void KOEventViewer::addTag(const QString & tag,const QString & text) | 178 | void KOEventViewer::addTag(const QString & tag,const QString & text) |
179 | { | 179 | { |
180 | int number=text.contains("\n"); | 180 | int number=text.contains("\n"); |
181 | QString str = "<" + tag + ">"; | 181 | QString str = "<" + tag + ">"; |
182 | QString tmpText=text; | 182 | QString tmpText=text; |
183 | QString tmpStr=str; | 183 | QString tmpStr=str; |
184 | if(number !=-1) | 184 | if(number !=-1) |
185 | { | 185 | { |
186 | if (number > 0) { | 186 | if (number > 0) { |
187 | int pos=0; | 187 | int pos=0; |
188 | QString tmp; | 188 | QString tmp; |
189 | for(int i=0;i<=number;i++) { | 189 | for(int i=0;i<=number;i++) { |
190 | pos=tmpText.find("\n"); | 190 | pos=tmpText.find("\n"); |
191 | tmp=tmpText.left(pos); | 191 | tmp=tmpText.left(pos); |
192 | tmpText=tmpText.right(tmpText.length()-pos-1); | 192 | tmpText=tmpText.right(tmpText.length()-pos-1); |
193 | tmpStr+=tmp+"<br>"; | 193 | tmpStr+=tmp+"<br>"; |
194 | } | 194 | } |
195 | } | 195 | } |
196 | else tmpStr += tmpText; | 196 | else tmpStr += tmpText; |
197 | tmpStr+="</" + tag + ">"; | 197 | tmpStr+="</" + tag + ">"; |
198 | mText.append(tmpStr); | 198 | mText.append(tmpStr); |
199 | } | 199 | } |
200 | else | 200 | else |
201 | { | 201 | { |
202 | str += text + "</" + tag + ">"; | 202 | str += text + "</" + tag + ">"; |
203 | mText.append(str); | 203 | mText.append(str); |
204 | } | 204 | } |
205 | } | 205 | } |
206 | 206 | ||
207 | void KOEventViewer::setColorMode( int m ) | 207 | void KOEventViewer::setColorMode( int m ) |
208 | { | 208 | { |
209 | mColorMode = m; | 209 | mColorMode = m; |
210 | } | 210 | } |
211 | void KOEventViewer::appendEvent(Event *event, int mode ) | 211 | void KOEventViewer::appendEvent(Event *event, int mode ) |
212 | { | 212 | { |
213 | mMailSubject = ""; | 213 | mMailSubject = ""; |
214 | mCurrentIncidence = event; | 214 | mCurrentIncidence = event; |
215 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 215 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
216 | topLevelWidget()->setCaption(i18n("Event Viewer")); | 216 | topLevelWidget()->setCaption(i18n("Event Viewer")); |
217 | if ( mode == 0 ) { | 217 | if ( mode == 0 ) { |
218 | addTag("h2",event->summary()); | 218 | addTag("h2",event->summary()); |
219 | } | 219 | } |
220 | else { | 220 | else { |
221 | if ( mColorMode == 1 ) { | 221 | if ( mColorMode == 1 ) { |
222 | mText +="<font color=\"#00A000\">"; | 222 | mText +="<font color=\"#00A000\">"; |
223 | } | 223 | } |
224 | if ( mColorMode == 2 ) { | 224 | if ( mColorMode == 2 ) { |
225 | mText +="<font color=\"#C00000\">"; | 225 | mText +="<font color=\"#C00000\">"; |
226 | } | 226 | } |
227 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 227 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
228 | if ( mode == 1 ) { | 228 | if ( mode == 1 ) { |
229 | addTag("h2",i18n( "Local: " ) +event->summary()); | 229 | addTag("h2",i18n( "Local: " ) +event->summary()); |
230 | } else { | 230 | } else { |
231 | addTag("h2",i18n( "Remote: " ) +event->summary()); | 231 | addTag("h2",i18n( "Remote: " ) +event->summary()); |
232 | } | 232 | } |
233 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 233 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
234 | if ( mColorMode ) | 234 | if ( mColorMode ) |
235 | mText += "</font>"; | 235 | mText += "</font>"; |
236 | } | 236 | } |
237 | mMailSubject += i18n( "Meeting " )+ event->summary(); | 237 | mMailSubject += i18n( "Meeting " )+ event->summary(); |
238 | if (event->cancelled ()) { | 238 | if (event->cancelled ()) { |
239 | mText +="<font color=\"#B00000\">"; | 239 | mText +="<font color=\"#B00000\">"; |
240 | addTag("i",i18n("This event has been cancelled!")); | 240 | addTag("i",i18n("This event has been cancelled!")); |
241 | mText.append("<br>"); | 241 | mText.append("<br>"); |
242 | mText += "</font>"; | 242 | mText += "</font>"; |
243 | mMailSubject += i18n("(cancelled)"); | 243 | mMailSubject += i18n("(cancelled)"); |
244 | } | 244 | } |
245 | if (!event->location().isEmpty()) { | 245 | if (!event->location().isEmpty()) { |
246 | addTag("b",i18n("Location: ")); | 246 | addTag("b",i18n("Location: ")); |
247 | mText.append(event->location()+"<br>"); | 247 | mText.append(event->location()+"<br>"); |
248 | mMailSubject += i18n(" at ") + event->location(); | 248 | mMailSubject += i18n(" at ") + event->location(); |
249 | } | 249 | } |
250 | if (event->doesFloat()) { | 250 | if (event->doesFloat()) { |
251 | if (event->isMultiDay()) { | 251 | if (event->isMultiDay()) { |
252 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 252 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
253 | .arg(event->dtStartDateStr(shortDate)) | 253 | .arg(event->dtStartDateStr(shortDate)) |
254 | .arg(event->dtEndDateStr(shortDate))); | 254 | .arg(event->dtEndDateStr(shortDate))); |
255 | } else { | 255 | } else { |
256 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 256 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
257 | } | 257 | } |
258 | } else { | 258 | } else { |
259 | if (event->isMultiDay()) { | 259 | if (event->isMultiDay()) { |
260 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 260 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
261 | .arg(event->dtStartStr( shortDate))); | 261 | .arg(event->dtStartStr( shortDate))); |
262 | mText.append(i18n("<p><b>To:</b> %1</p>") | 262 | mText.append(i18n("<p><b>To:</b> %1</p>") |
263 | .arg(event->dtEndStr(shortDate))); | 263 | .arg(event->dtEndStr(shortDate))); |
264 | } else { | 264 | } else { |
265 | mText.append(i18n("<p><b>On:</b> %1</p> ") | 265 | mText.append(i18n("<p><b>On:</b> %1</p> ") |
266 | .arg(event->dtStartDateStr( shortDate ))); | 266 | .arg(event->dtStartDateStr( shortDate ))); |
267 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 267 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
268 | .arg(event->dtStartTimeStr()) | 268 | .arg(event->dtStartTimeStr()) |
269 | .arg(event->dtEndTimeStr())); | 269 | .arg(event->dtEndTimeStr())); |
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | if (event->recurrence()->doesRecur()) { | 273 | if (event->recurrence()->doesRecur()) { |
274 | 274 | ||
275 | QString recurText = event->recurrence()->recurrenceText(); | 275 | QString recurText = event->recurrence()->recurrenceText(); |
276 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 276 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
277 | bool last; | 277 | bool last; |
278 | QDate start = QDate::currentDate(); | 278 | QDate start = QDate::currentDate(); |
279 | QDate next; | 279 | QDate next; |
280 | next = event->recurrence()->getPreviousDate( start , &last ); | 280 | next = event->recurrence()->getPreviousDate( start , &last ); |
281 | if ( !last ) { | 281 | if ( !last ) { |
282 | next = event->recurrence()->getNextDate( start.addDays( - 1 ) ); | 282 | next = event->recurrence()->getNextDate( start.addDays( - 1 ) ); |
283 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 283 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
284 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); | 284 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); |
285 | QDateTime nextdt = QDateTime( next, event->dtStart().time()); | 285 | QDateTime nextdt = QDateTime( next, event->dtStart().time()); |
286 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true ); | 286 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( nextdt, true ); |
287 | 287 | ||
288 | } else { | 288 | } else { |
289 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 289 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
290 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); | 290 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); |
291 | } | 291 | } |
292 | } else { | 292 | } else { |
293 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | 293 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); |
294 | 294 | ||
295 | } | 295 | } |
296 | 296 | ||
297 | 297 | ||
298 | if (event->isAlarmEnabled()) { | 298 | if (event->isAlarmEnabled()) { |
299 | Alarm *alarm =event->alarms().first() ; | 299 | Alarm *alarm =event->alarms().first() ; |
300 | QDateTime t = alarm->time(); | 300 | QDateTime t = alarm->time(); |
301 | int min = t.secsTo( event->dtStart() )/60; | 301 | int min = t.secsTo( event->dtStart() )/60; |
302 | QString s =i18n("( %1 min before )").arg( min ); | 302 | QString s =i18n("( %1 min before )").arg( min ); |
303 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 303 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
304 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 304 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
305 | //addTag("p",s); | 305 | //addTag("p",s); |
306 | } | 306 | } |
307 | 307 | ||
308 | addTag("b",i18n("Access: ")); | 308 | addTag("b",i18n("Access: ")); |
309 | mText.append(event->secrecyStr()+"<br>"); | 309 | mText.append(event->secrecyStr()+"<br>"); |
310 | if (!event->description().isEmpty()) { | 310 | if (!event->description().isEmpty()) { |
311 | addTag("p",i18n("<b>Details: </b>")); | 311 | addTag("p",i18n("<b>Details: </b>")); |
312 | addTag("p",event->description()); | 312 | addTag("p",event->description()); |
313 | } | 313 | } |
314 | 314 | ||
315 | formatCategories(event); | 315 | formatCategories(event); |
316 | 316 | ||
317 | formatReadOnly(event); | 317 | formatReadOnly(event); |
318 | formatAttendees(event); | 318 | formatAttendees(event); |
319 | 319 | ||
320 | setText(mText); | 320 | setText(mText); |
321 | //QWhatsThis::add(this,mText); | 321 | //QWhatsThis::add(this,mText); |
322 | 322 | ||
323 | } | 323 | } |
324 | 324 | ||
325 | void KOEventViewer::appendTodo(Todo *event, int mode ) | 325 | void KOEventViewer::appendTodo(Todo *event, int mode ) |
326 | { | 326 | { |
327 | mMailSubject = ""; | 327 | mMailSubject = ""; |
328 | mCurrentIncidence = event; | 328 | mCurrentIncidence = event; |
329 | topLevelWidget()->setCaption(i18n("Todo Viewer")); | 329 | topLevelWidget()->setCaption(i18n("Todo Viewer")); |
330 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 330 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
331 | if (mode == 0 ) | 331 | if (mode == 0 ) |
332 | addTag("h2",event->summary()); | 332 | addTag("h2",event->summary()); |
333 | else { | 333 | else { |
334 | if ( mColorMode == 1 ) { | 334 | if ( mColorMode == 1 ) { |
335 | mText +="<font color=\"#00A000\">"; | 335 | mText +="<font color=\"#00A000\">"; |
336 | } | 336 | } |
337 | if ( mColorMode == 2 ) { | 337 | if ( mColorMode == 2 ) { |
338 | mText +="<font color=\"#B00000\">"; | 338 | mText +="<font color=\"#B00000\">"; |
339 | } | 339 | } |
340 | if ( mode == 1 ) { | 340 | if ( mode == 1 ) { |
341 | addTag("h2",i18n( "Local: " ) +event->summary()); | 341 | addTag("h2",i18n( "Local: " ) +event->summary()); |
342 | } else { | 342 | } else { |
343 | addTag("h2",i18n( "Remote: " ) +event->summary()); | 343 | addTag("h2",i18n( "Remote: " ) +event->summary()); |
344 | } | 344 | } |
345 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 345 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
346 | if ( mColorMode ) | 346 | if ( mColorMode ) |
347 | mText += "</font>"; | 347 | mText += "</font>"; |
348 | } | 348 | } |
349 | mMailSubject += i18n( "Todo " )+ event->summary(); | 349 | mMailSubject += i18n( "Todo " )+ event->summary(); |
350 | if (event->cancelled ()) { | 350 | if (event->cancelled ()) { |
351 | mText +="<font color=\"#B00000\">"; | 351 | mText +="<font color=\"#B00000\">"; |
352 | addTag("i",i18n("This todo has been cancelled!")); | 352 | addTag("i",i18n("This todo has been cancelled!")); |
353 | mText.append("<br>"); | 353 | mText.append("<br>"); |
354 | mText += "</font>"; | 354 | mText += "</font>"; |
355 | mMailSubject += i18n("(cancelled)"); | 355 | mMailSubject += i18n("(cancelled)"); |
356 | } | 356 | } |
357 | 357 | ||
358 | if (!event->location().isEmpty()) { | 358 | if (!event->location().isEmpty()) { |
359 | addTag("b",i18n("Location: ")); | 359 | addTag("b",i18n("Location: ")); |
360 | mText.append(event->location()+"<br>"); | 360 | mText.append(event->location()+"<br>"); |
361 | mMailSubject += i18n(" at ") + event->location(); | 361 | mMailSubject += i18n(" at ") + event->location(); |
362 | } | 362 | } |
363 | if (event->hasDueDate()) { | 363 | if (event->hasDueDate()) { |
364 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 364 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
365 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 365 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
366 | } | 366 | } |
367 | addTag("b",i18n("Access: ")); | 367 | addTag("b",i18n("Access: ")); |
368 | mText.append(event->secrecyStr()+"<br>"); | 368 | mText.append(event->secrecyStr()+"<br>"); |
369 | if (!event->description().isEmpty()) { | 369 | if (!event->description().isEmpty()) { |
370 | addTag("p",i18n("<b>Details: </b>")); | 370 | addTag("p",i18n("<b>Details: </b>")); |
371 | addTag("p",event->description()); | 371 | addTag("p",event->description()); |
372 | } | 372 | } |
373 | 373 | ||
374 | formatCategories(event); | 374 | formatCategories(event); |
375 | 375 | ||
376 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 376 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
377 | .arg(QString::number(event->priority()))); | 377 | .arg(QString::number(event->priority()))); |
378 | 378 | ||
379 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 379 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
380 | .arg(event->percentComplete())); | 380 | .arg(event->percentComplete())); |
381 | 381 | ||
382 | formatReadOnly(event); | 382 | formatReadOnly(event); |
383 | formatAttendees(event); | 383 | formatAttendees(event); |
384 | 384 | ||
385 | setText(mText); | 385 | setText(mText); |
386 | } | 386 | } |
387 | 387 | ||
388 | void KOEventViewer::formatCategories(Incidence *event) | 388 | void KOEventViewer::formatCategories(Incidence *event) |
389 | { | 389 | { |
390 | if (!event->categoriesStr().isEmpty()) { | 390 | if (!event->categoriesStr().isEmpty()) { |
391 | if (event->categories().count() == 1) { | 391 | if (event->categories().count() == 1) { |
392 | addTag("h3",i18n("Category")); | 392 | addTag("h3",i18n("Category")); |
393 | } else { | 393 | } else { |
394 | addTag("h3",i18n("Categories")); | 394 | addTag("h3",i18n("Categories")); |
395 | } | 395 | } |
396 | addTag("p",event->categoriesStr()); | 396 | addTag("p",event->categoriesStr()); |
397 | } | 397 | } |
398 | } | 398 | } |
399 | void KOEventViewer::formatAttendees(Incidence *event) | 399 | void KOEventViewer::formatAttendees(Incidence *event) |
400 | { | 400 | { |
401 | QPtrList<Attendee> attendees = event->attendees(); | 401 | QPtrList<Attendee> attendees = event->attendees(); |
402 | if (attendees.count()) { | 402 | if (attendees.count()) { |
403 | 403 | ||
404 | 404 | ||
405 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 405 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
406 | addTag("h3",i18n("Organizer")); | 406 | addTag("h3",i18n("Organizer")); |
407 | mText.append("<ul><li>"); | 407 | mText.append("<ul><li>"); |
408 | #ifndef KORG_NOKABC | 408 | #ifndef KORG_NOKABC |
409 | 409 | ||
410 | #ifdef DESKTOP_VERSION | 410 | #ifdef DESKTOP_VERSION |
411 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 411 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
412 | KABC::Addressee::List addressList; | 412 | KABC::Addressee::List addressList; |
413 | addressList = add_book->findByEmail(event->organizer()); | 413 | addressList = add_book->findByEmail(event->organizer()); |
414 | KABC::Addressee o = addressList.first(); | 414 | KABC::Addressee o = addressList.first(); |
415 | if (!o.isEmpty() && addressList.size()<2) { | 415 | if (!o.isEmpty() && addressList.size()<2) { |
416 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 416 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
417 | mText += o.formattedName(); | 417 | mText += o.formattedName(); |
418 | mText += "</a>\n"; | 418 | mText += "</a>\n"; |
419 | } else { | 419 | } else { |
420 | mText.append(event->organizer()); | 420 | mText.append(event->organizer()); |
421 | } | 421 | } |
422 | #else //DESKTOP_VERSION | 422 | #else //DESKTOP_VERSION |
423 | mText += "<a href=\"uid:organizer\">"; | 423 | mText += "<a href=\"uid:organizer\">"; |
424 | mText += event->organizer(); | 424 | mText += event->organizer(); |
425 | mText += "</a>\n"; | 425 | mText += "</a>\n"; |
426 | #endif //DESKTOP_VERSION | 426 | #endif //DESKTOP_VERSION |
427 | 427 | ||
428 | 428 | ||
429 | #else | 429 | #else |
430 | mText.append(event->organizer()); | 430 | mText.append(event->organizer()); |
431 | #endif | 431 | #endif |
432 | 432 | ||
433 | if (iconPath) { | 433 | if (iconPath) { |
434 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; | 434 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; |
435 | mText += "<IMG src=\"" + iconPath + "\">"; | 435 | mText += "<IMG src=\"" + iconPath + "\">"; |
436 | mText += "</a>\n"; | 436 | mText += "</a>\n"; |
437 | } | 437 | } |
438 | mText.append("</li></ul>"); | 438 | mText.append("</li></ul>"); |
439 | 439 | ||
440 | addTag("h3",i18n("Attendees")); | 440 | addTag("h3",i18n("Attendees")); |
441 | Attendee *a; | 441 | Attendee *a; |
442 | mText.append("<ul>"); | 442 | mText.append("<ul>"); |
443 | for(a=attendees.first();a;a=attendees.next()) { | 443 | for(a=attendees.first();a;a=attendees.next()) { |
444 | #ifndef KORG_NOKABC | 444 | #ifndef KORG_NOKABC |
445 | #ifdef DESKTOP_VERSION | 445 | #ifdef DESKTOP_VERSION |
446 | if (a->name().isEmpty()) { | 446 | if (a->name().isEmpty()) { |
447 | addressList = add_book->findByEmail(a->email()); | 447 | addressList = add_book->findByEmail(a->email()); |
448 | KABC::Addressee o = addressList.first(); | 448 | KABC::Addressee o = addressList.first(); |
449 | if (!o.isEmpty() && addressList.size()<2) { | 449 | if (!o.isEmpty() && addressList.size()<2) { |
450 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 450 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
451 | mText += o.formattedName(); | 451 | mText += o.formattedName(); |
452 | mText += "</a>\n"; | 452 | mText += "</a>\n"; |
453 | } else { | 453 | } else { |
454 | mText += "<li>"; | 454 | mText += "<li>"; |
455 | mText.append(a->email()); | 455 | mText.append(a->email()); |
456 | mText += "\n"; | 456 | mText += "\n"; |
457 | } | 457 | } |
458 | } else { | 458 | } else { |
459 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 459 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
460 | if (!a->name().isEmpty()) mText += a->name(); | 460 | if (!a->name().isEmpty()) mText += a->name(); |
461 | else mText += a->email(); | 461 | else mText += a->email(); |
462 | mText += "</a>\n"; | 462 | mText += "</a>\n"; |
463 | } | 463 | } |
464 | #else //DESKTOP_VERSION | 464 | #else //DESKTOP_VERSION |
465 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 465 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
466 | if (!a->name().isEmpty()) mText += a->name(); | 466 | if (!a->name().isEmpty()) mText += a->name(); |
467 | else mText += a->email(); | 467 | else mText += a->email(); |
468 | mText += "</a>\n"; | 468 | mText += "</a>\n"; |
469 | #endif //DESKTOP_VERSION | 469 | #endif //DESKTOP_VERSION |
470 | #else | 470 | #else |
471 | //qDebug("nokabc "); | 471 | //qDebug("nokabc "); |
472 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 472 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
473 | if (!a->name().isEmpty()) mText += a->name(); | 473 | if (!a->name().isEmpty()) mText += a->name(); |
474 | else mText += a->email(); | 474 | else mText += a->email(); |
475 | mText += "</a>\n"; | 475 | mText += "</a>\n"; |
476 | #endif | 476 | #endif |
477 | 477 | ||
478 | 478 | ||
479 | if (!a->email().isEmpty()) { | 479 | if (!a->email().isEmpty()) { |
480 | if (iconPath) { | 480 | if (iconPath) { |
481 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; | 481 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; |
482 | mText += "<IMG src=\"" + iconPath + "\">"; | 482 | mText += "<IMG src=\"" + iconPath + "\">"; |
483 | mText += "</a>\n"; | 483 | mText += "</a>\n"; |
484 | } | 484 | } |
485 | } | 485 | } |
486 | if (a->status() != Attendee::NeedsAction ) | 486 | if (a->status() != Attendee::NeedsAction ) |
487 | mText +="[" + a->statusStr() + "] "; | 487 | mText +="[" + a->statusStr() + "] "; |
488 | if (a->role() == Attendee::Chair ) | 488 | if (a->role() == Attendee::Chair ) |
489 | mText +="(" + a->roleStr().left(1) + ".)"; | 489 | mText +="(" + a->roleStr().left(1) + ".)"; |
490 | } | 490 | } |
491 | mText.append("</li></ul>"); | 491 | mText.append("</li></ul>"); |
492 | } | 492 | } |
493 | 493 | ||
494 | } | 494 | } |
495 | void KOEventViewer::appendJournal(Journal *jour, int mode ) | 495 | void KOEventViewer::appendJournal(Journal *jour, int mode ) |
496 | { | 496 | { |
497 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 497 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
498 | if (mode == 0 ) | 498 | if (mode == 0 ) |
499 | addTag("h2",i18n("Journal from: ")); | 499 | addTag("h2",i18n("Journal from: ")); |
500 | else { | 500 | else { |
501 | if ( mode == 1 ) { | 501 | if ( mode == 1 ) { |
502 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); | 502 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); |
503 | } else { | 503 | } else { |
504 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); | 504 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); |
505 | } | 505 | } |
506 | addTag("h3",i18n( "Last modified " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); | 506 | addTag("h3",i18n( "Last modified " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); |
507 | } | 507 | } |
508 | topLevelWidget()->setCaption("Journal Viewer"); | 508 | topLevelWidget()->setCaption("Journal Viewer"); |
509 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); | 509 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); |
510 | if (!jour->description().isEmpty()) { | 510 | if (!jour->description().isEmpty()) { |
511 | addTag("p",jour->description()); | 511 | addTag("p",jour->description()); |
512 | } | 512 | } |
513 | setText(mText); | 513 | setText(mText); |
514 | } | 514 | } |
515 | 515 | ||
516 | void KOEventViewer::formatReadOnly(Incidence *event) | 516 | void KOEventViewer::formatReadOnly(Incidence *event) |
517 | { | 517 | { |
518 | if (event->isReadOnly()) { | 518 | if (event->isReadOnly()) { |
519 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); | 519 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); |
520 | } | 520 | } |
521 | } | 521 | } |
522 | void KOEventViewer::setSyncMode( bool b ) | 522 | void KOEventViewer::setSyncMode( bool b ) |
523 | { | 523 | { |
524 | mSyncMode = b; | 524 | mSyncMode = b; |
525 | } | 525 | } |
526 | 526 | ||
527 | 527 | ||
528 | void KOEventViewer::setTodo(Todo *event, bool clearV ) | 528 | void KOEventViewer::setTodo(Todo *event, bool clearV ) |
529 | { | 529 | { |
530 | if ( clearV ) | 530 | if ( clearV ) |
531 | clearEvents(); | 531 | clearEvents(); |
532 | if ( mSyncMode ) { | 532 | if ( mSyncMode ) { |
533 | if ( clearV ) | 533 | if ( clearV ) |
534 | appendTodo(event,1 ); | 534 | appendTodo(event,1 ); |
535 | else | 535 | else |
536 | appendTodo(event,2); | 536 | appendTodo(event,2); |
537 | } else | 537 | } else |
538 | appendTodo(event); | 538 | appendTodo(event); |
539 | } | 539 | } |
540 | void KOEventViewer::setJournal(Journal *event, bool clearV ) | 540 | void KOEventViewer::setJournal(Journal *event, bool clearV ) |
541 | { | 541 | { |
542 | if ( clearV ) | 542 | if ( clearV ) |
543 | clearEvents(); | 543 | clearEvents(); |
544 | if ( mSyncMode ) { | 544 | if ( mSyncMode ) { |
545 | if ( clearV ) | 545 | if ( clearV ) |
546 | appendJournal(event, 1); | 546 | appendJournal(event, 1); |
547 | else | 547 | else |
548 | appendJournal(event, 2); | 548 | appendJournal(event, 2); |
549 | } else | 549 | } else |
550 | appendJournal(event); | 550 | appendJournal(event); |
551 | } | 551 | } |
552 | 552 | ||
553 | void KOEventViewer::setEvent(Event *event) | 553 | void KOEventViewer::setEvent(Event *event) |
554 | { | 554 | { |
555 | clearEvents(); | 555 | clearEvents(); |
556 | if ( mSyncMode ) | 556 | if ( mSyncMode ) |
557 | appendEvent(event, 1); | 557 | appendEvent(event, 1); |
558 | else | 558 | else |
559 | appendEvent(event); | 559 | appendEvent(event); |
560 | } | 560 | } |
561 | 561 | ||
562 | void KOEventViewer::addEvent(Event *event) | 562 | void KOEventViewer::addEvent(Event *event) |
563 | { | 563 | { |
564 | if ( mSyncMode ) | 564 | if ( mSyncMode ) |
565 | appendEvent(event, 2); | 565 | appendEvent(event, 2); |
566 | else | 566 | else |
567 | appendEvent(event); | 567 | appendEvent(event); |
568 | } | 568 | } |
569 | 569 | ||
570 | void KOEventViewer::clearEvents(bool now) | 570 | void KOEventViewer::clearEvents(bool now) |
571 | { | 571 | { |
572 | mText = ""; | 572 | mText = ""; |
573 | if (now) setText(mText); | 573 | if (now) setText(mText); |
574 | } | 574 | } |
575 | 575 | ||
576 | void KOEventViewer::addText(QString text) | 576 | void KOEventViewer::addText(QString text) |
577 | { | 577 | { |
578 | mText.append(text); | 578 | mText.append(text); |
579 | setText(mText); | 579 | setText(mText); |
580 | } | 580 | } |
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp new file mode 100644 index 0000000..2c45f21 --- a/dev/null +++ b/libkcal/kincidenceformatter.cpp | |||
@@ -0,0 +1,328 @@ | |||
1 | #include "kincidenceformatter.h" | ||
2 | #include <kstaticdeleter.h> | ||
3 | #include <kglobal.h> | ||
4 | #include <klocale.h> | ||
5 | #ifdef DEKTOP_VERSION | ||
6 | #include <kabc/stdaddressbook.h> | ||
7 | #define size count | ||
8 | #endif | ||
9 | |||
10 | KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; | ||
11 | static KStaticDeleter<KIncidenceFormatter> insd; | ||
12 | |||
13 | QString KIncidenceFormatter::getFormattedText( Incidence * inc ) | ||
14 | { | ||
15 | // #ifndef QT_NO_INPUTDIALOG | ||
16 | // return QInputDialog::getItem( caption, label, items, current, editable ); | ||
17 | // #else | ||
18 | // return QString::null; | ||
19 | // #endif | ||
20 | mText = ""; | ||
21 | if ( inc->type() == "Event" ) | ||
22 | setEvent((Event *) inc ); | ||
23 | else if ( inc->type() == "Todo" ) | ||
24 | setTodo((Todo *) inc ); | ||
25 | return mText; | ||
26 | } | ||
27 | |||
28 | KIncidenceFormatter* KIncidenceFormatter::instance() | ||
29 | { | ||
30 | if (!mInstance) { | ||
31 | mInstance = insd.setObject(new KIncidenceFormatter()); | ||
32 | } | ||
33 | return mInstance; | ||
34 | } | ||
35 | KIncidenceFormatter::~KIncidenceFormatter() | ||
36 | { | ||
37 | if (mInstance == this) | ||
38 | mInstance = insd.setObject(0); | ||
39 | //qDebug("KIncidenceFormatter::~KIncidenceFormatter "); | ||
40 | } | ||
41 | KIncidenceFormatter::KIncidenceFormatter() | ||
42 | { | ||
43 | mColorMode = 0; | ||
44 | } | ||
45 | void KIncidenceFormatter::setEvent(Event *event) | ||
46 | { | ||
47 | int mode = 0; | ||
48 | mCurrentIncidence = event; | ||
49 | bool shortDate = true; | ||
50 | if ( mode == 0 ) { | ||
51 | addTag("h3",event->summary()); | ||
52 | } | ||
53 | else { | ||
54 | if ( mColorMode == 1 ) { | ||
55 | mText +="<font color=\"#00A000\">"; | ||
56 | } | ||
57 | if ( mColorMode == 2 ) { | ||
58 | mText +="<font color=\"#C00000\">"; | ||
59 | } | ||
60 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | ||
61 | if ( mode == 1 ) { | ||
62 | addTag("h2",i18n( "Local: " ) +event->summary()); | ||
63 | } else { | ||
64 | addTag("h2",i18n( "Remote: " ) +event->summary()); | ||
65 | } | ||
66 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | ||
67 | if ( mColorMode ) | ||
68 | mText += "</font>"; | ||
69 | } | ||
70 | if (event->cancelled ()) { | ||
71 | mText +="<font color=\"#B00000\">"; | ||
72 | addTag("i",i18n("This event has been cancelled!")); | ||
73 | mText.append("<br>"); | ||
74 | mText += "</font>"; | ||
75 | } | ||
76 | if (!event->location().isEmpty()) { | ||
77 | addTag("b",i18n("Location: ")); | ||
78 | mText.append(event->location()+"<br>"); | ||
79 | } | ||
80 | if (event->doesFloat()) { | ||
81 | if (event->isMultiDay()) { | ||
82 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | ||
83 | .arg(event->dtStartDateStr(shortDate)) | ||
84 | .arg(event->dtEndDateStr(shortDate))); | ||
85 | } else { | ||
86 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | ||
87 | } | ||
88 | } else { | ||
89 | if (event->isMultiDay()) { | ||
90 | mText.append(i18n("<p><b>From:</b> %1</p> ") | ||
91 | .arg(event->dtStartStr( shortDate))); | ||
92 | mText.append(i18n("<p><b>To:</b> %1</p>") | ||
93 | .arg(event->dtEndStr(shortDate))); | ||
94 | } else { | ||
95 | mText.append(i18n("<p><b>On:</b> %1</p> ") | ||
96 | .arg(event->dtStartDateStr( shortDate ))); | ||
97 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | ||
98 | .arg(event->dtStartTimeStr()) | ||
99 | .arg(event->dtEndTimeStr())); | ||
100 | } | ||
101 | } | ||
102 | |||
103 | if (event->recurrence()->doesRecur()) { | ||
104 | |||
105 | QString recurText = event->recurrence()->recurrenceText(); | ||
106 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | ||
107 | bool last; | ||
108 | QDate start = QDate::currentDate(); | ||
109 | QDate next; | ||
110 | next = event->recurrence()->getPreviousDate( start , &last ); | ||
111 | if ( !last ) { | ||
112 | next = event->recurrence()->getNextDate( start.addDays( - 1 ) ); | ||
113 | addTag("p",i18n("Next recurrence is on: ")+ KGlobal::locale()->formatDate( next, shortDate ) ); | ||
114 | //addTag("p", KGlobal::locale()->formatDate( next, shortDate )); | ||
115 | } else { | ||
116 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | ||
117 | addTag("p", KGlobal::locale()->formatDate( next, shortDate )); | ||
118 | } | ||
119 | } | ||
120 | |||
121 | |||
122 | if (event->isAlarmEnabled()) { | ||
123 | Alarm *alarm =event->alarms().first() ; | ||
124 | QDateTime t = alarm->time(); | ||
125 | int min = t.secsTo( event->dtStart() )/60; | ||
126 | QString s =i18n("(%1 min before)").arg( min ); | ||
127 | addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); | ||
128 | //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | ||
129 | //addTag("p",s); | ||
130 | } | ||
131 | |||
132 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); | ||
133 | // mText.append(event->secrecyStr()+"<br>"); | ||
134 | formatCategories(event); | ||
135 | if (!event->description().isEmpty()) { | ||
136 | addTag("p",i18n("<b>Details: </b>")); | ||
137 | addTag("p",event->description()); | ||
138 | } | ||
139 | |||
140 | |||
141 | formatReadOnly(event); | ||
142 | formatAttendees(event); | ||
143 | |||
144 | |||
145 | } | ||
146 | |||
147 | void KIncidenceFormatter::setTodo(Todo *event ) | ||
148 | { | ||
149 | int mode = 0; | ||
150 | mCurrentIncidence = event; | ||
151 | bool shortDate = true; | ||
152 | if (mode == 0 ) | ||
153 | addTag("h3",event->summary()); | ||
154 | else { | ||
155 | if ( mColorMode == 1 ) { | ||
156 | mText +="<font color=\"#00A000\">"; | ||
157 | } | ||
158 | if ( mColorMode == 2 ) { | ||
159 | mText +="<font color=\"#B00000\">"; | ||
160 | } | ||
161 | if ( mode == 1 ) { | ||
162 | addTag("h2",i18n( "Local: " ) +event->summary()); | ||
163 | } else { | ||
164 | addTag("h2",i18n( "Remote: " ) +event->summary()); | ||
165 | } | ||
166 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | ||
167 | if ( mColorMode ) | ||
168 | mText += "</font>"; | ||
169 | } | ||
170 | if (event->cancelled ()) { | ||
171 | mText +="<font color=\"#B00000\">"; | ||
172 | addTag("i",i18n("This todo has been cancelled!")); | ||
173 | mText.append("<br>"); | ||
174 | mText += "</font>"; | ||
175 | } | ||
176 | |||
177 | if (!event->location().isEmpty()) { | ||
178 | addTag("b",i18n("Location: ")); | ||
179 | mText.append(event->location()+"<br>"); | ||
180 | } | ||
181 | if (event->hasDueDate()) { | ||
182 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); | ||
183 | } | ||
184 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | ||
185 | .arg(QString::number(event->priority()))); | ||
186 | |||
187 | mText.append(i18n("<p><i>%1 % completed</i></p>") | ||
188 | .arg(event->percentComplete())); | ||
189 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); | ||
190 | formatCategories(event); | ||
191 | if (!event->description().isEmpty()) { | ||
192 | addTag("p",i18n("<b>Details: </b>")); | ||
193 | addTag("p",event->description()); | ||
194 | } | ||
195 | |||
196 | |||
197 | |||
198 | formatReadOnly(event); | ||
199 | formatAttendees(event); | ||
200 | |||
201 | } | ||
202 | |||
203 | void KIncidenceFormatter::setJournal(Journal* ) | ||
204 | { | ||
205 | |||
206 | } | ||
207 | |||
208 | void KIncidenceFormatter::formatCategories(Incidence *event) | ||
209 | { | ||
210 | if (!event->categoriesStr().isEmpty()) { | ||
211 | addTag("p",i18n("<b>Categories: </b>")+event->categoriesStr() ); | ||
212 | //mText.append(event->categoriesStr()); | ||
213 | } | ||
214 | } | ||
215 | void KIncidenceFormatter::addTag(const QString & tag,const QString & text) | ||
216 | { | ||
217 | int number=text.contains("\n"); | ||
218 | QString str = "<" + tag + ">"; | ||
219 | QString tmpText=text; | ||
220 | QString tmpStr=str; | ||
221 | if(number !=-1) | ||
222 | { | ||
223 | if (number > 0) { | ||
224 | int pos=0; | ||
225 | QString tmp; | ||
226 | for(int i=0;i<=number;i++) { | ||
227 | pos=tmpText.find("\n"); | ||
228 | tmp=tmpText.left(pos); | ||
229 | tmpText=tmpText.right(tmpText.length()-pos-1); | ||
230 | tmpStr+=tmp+"<br>"; | ||
231 | } | ||
232 | } | ||
233 | else tmpStr += tmpText; | ||
234 | tmpStr+="</" + tag + ">"; | ||
235 | mText.append(tmpStr); | ||
236 | } | ||
237 | else | ||
238 | { | ||
239 | str += text + "</" + tag + ">"; | ||
240 | mText.append(str); | ||
241 | } | ||
242 | } | ||
243 | |||
244 | void KIncidenceFormatter::formatAttendees(Incidence *event) | ||
245 | { | ||
246 | QPtrList<Attendee> attendees = event->attendees(); | ||
247 | if (attendees.count()) { | ||
248 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | ||
249 | addTag("h3",i18n("Organizer")); | ||
250 | mText.append("<ul><li>"); | ||
251 | #if 0 | ||
252 | //ndef KORG_NOKABC | ||
253 | |||
254 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | ||
255 | KABC::Addressee::List addressList; | ||
256 | addressList = add_book->findByEmail(event->organizer()); | ||
257 | KABC::Addressee o = addressList.first(); | ||
258 | if (!o.isEmpty() && addressList.size()<2) { | ||
259 | mText += "<a href=\"uid:" + o.uid() + "\">"; | ||
260 | mText += o.formattedName(); | ||
261 | mText += "</a>\n"; | ||
262 | } else { | ||
263 | mText.append(event->organizer()); | ||
264 | } | ||
265 | #else | ||
266 | mText.append(event->organizer()); | ||
267 | #endif | ||
268 | if (iconPath) { | ||
269 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; | ||
270 | mText += "<IMG src=\"" + iconPath + "\">"; | ||
271 | mText += "</a>\n"; | ||
272 | } | ||
273 | mText.append("</li></ul>"); | ||
274 | |||
275 | addTag("h3",i18n("Attendees")); | ||
276 | Attendee *a; | ||
277 | mText.append("<ul>"); | ||
278 | for(a=attendees.first();a;a=attendees.next()) { | ||
279 | #if 0 | ||
280 | //ndef KORG_NOKABC | ||
281 | if (a->name().isEmpty()) { | ||
282 | addressList = add_book->findByEmail(a->email()); | ||
283 | KABC::Addressee o = addressList.first(); | ||
284 | if (!o.isEmpty() && addressList.size()<2) { | ||
285 | mText += "<a href=\"uid:" + o.uid() + "\">"; | ||
286 | mText += o.formattedName(); | ||
287 | mText += "</a>\n"; | ||
288 | } else { | ||
289 | mText += "<li>"; | ||
290 | mText.append(a->email()); | ||
291 | mText += "\n"; | ||
292 | } | ||
293 | } else { | ||
294 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | ||
295 | if (!a->name().isEmpty()) mText += a->name(); | ||
296 | else mText += a->email(); | ||
297 | mText += "</a>\n"; | ||
298 | } | ||
299 | #else | ||
300 | //qDebug("nokabc "); | ||
301 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | ||
302 | if (!a->name().isEmpty()) mText += a->name(); | ||
303 | else mText += a->email(); | ||
304 | mText += "</a>\n"; | ||
305 | #endif | ||
306 | |||
307 | if (!a->email().isEmpty()) { | ||
308 | if (iconPath) { | ||
309 | mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; | ||
310 | mText += "<IMG src=\"" + iconPath + "\">"; | ||
311 | mText += "</a>\n"; | ||
312 | } | ||
313 | } | ||
314 | if (a->status() != Attendee::NeedsAction ) | ||
315 | mText +="[" + a->statusStr() + "] "; | ||
316 | if (a->role() == Attendee::Chair ) | ||
317 | mText +="(" + a->roleStr().left(1) + ".)"; | ||
318 | } | ||
319 | mText.append("</li></ul>"); | ||
320 | } | ||
321 | } | ||
322 | |||
323 | void KIncidenceFormatter::formatReadOnly(Incidence *event) | ||
324 | { | ||
325 | if (event->isReadOnly()) { | ||
326 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); | ||
327 | } | ||
328 | } | ||
diff --git a/libkcal/kincidenceformatter.h b/libkcal/kincidenceformatter.h new file mode 100644 index 0000000..6165a9f --- a/dev/null +++ b/libkcal/kincidenceformatter.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef KINCIDENCENFORMATTER_H | ||
2 | #define KINCIDENCENFORMATTER_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | #include <qobject.h> | ||
6 | |||
7 | #include "incidence.h" | ||
8 | #include "event.h" | ||
9 | #include "todo.h" | ||
10 | #include "journal.h" | ||
11 | |||
12 | using namespace KCal; | ||
13 | |||
14 | class KIncidenceFormatter : public QObject | ||
15 | { | ||
16 | public: | ||
17 | static KIncidenceFormatter* instance(); | ||
18 | KIncidenceFormatter(); | ||
19 | ~KIncidenceFormatter(); | ||
20 | QString getFormattedText( Incidence * inc ); | ||
21 | |||
22 | void setEvent(Event *event); | ||
23 | void setTodo(Todo *event ); | ||
24 | void setJournal(Journal* ); | ||
25 | |||
26 | protected: | ||
27 | int mColorMode; | ||
28 | void addTag(const QString & tag,const QString & text); | ||
29 | |||
30 | void formatCategories(Incidence *event); | ||
31 | void formatAttendees(Incidence *event); | ||
32 | void formatReadOnly(Incidence *event); | ||
33 | |||
34 | private: | ||
35 | bool mSyncMode; | ||
36 | |||
37 | QString mText; | ||
38 | Incidence* mCurrentIncidence; | ||
39 | static KIncidenceFormatter* mInstance; | ||
40 | }; | ||
41 | |||
42 | #endif | ||
diff --git a/libkcal/libkcalE.pro b/libkcal/libkcalE.pro index f5be980..1f5ef78 100644 --- a/libkcal/libkcalE.pro +++ b/libkcal/libkcalE.pro | |||
@@ -1,89 +1,91 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | TARGET = microkcal | 3 | TARGET = microkcal |
4 | 4 | ||
5 | INCLUDEPATH += ../microkde ../qtcompat versit ../microkde/kdecore $(QPEDIR)/include | 5 | INCLUDEPATH += ../microkde ../qtcompat versit ../microkde/kdecore $(QPEDIR)/include |
6 | INCLUDEPATH += ../libical/src/libical | 6 | INCLUDEPATH += ../libical/src/libical |
7 | INCLUDEPATH += ../libical/src/libicalss | 7 | INCLUDEPATH += ../libical/src/libicalss |
8 | OBJECTS_DIR = obj/$(PLATFORM) | 8 | OBJECTS_DIR = obj/$(PLATFORM) |
9 | MOC_DIR = moc/$(PLATFORM) | 9 | MOC_DIR = moc/$(PLATFORM) |
10 | DESTDIR = $(QPEDIR)/lib | 10 | DESTDIR = $(QPEDIR)/lib |
11 | LIBS += ../libical/lib/$(PLATFORM)/libical.a | 11 | LIBS += ../libical/lib/$(PLATFORM)/libical.a |
12 | LIBS += ../libical/lib/$(PLATFORM)/libicalss.a | 12 | LIBS += ../libical/lib/$(PLATFORM)/libicalss.a |
13 | 13 | ||
14 | INTERFACES = \ | 14 | INTERFACES = \ |
15 | 15 | ||
16 | HEADERS = \ | 16 | HEADERS = \ |
17 | alarm.h \ | 17 | alarm.h \ |
18 | attachment.h \ | 18 | attachment.h \ |
19 | attendee.h \ | 19 | attendee.h \ |
20 | calendar.h \ | 20 | calendar.h \ |
21 | calendarlocal.h \ | 21 | calendarlocal.h \ |
22 | calfilter.h \ | 22 | calfilter.h \ |
23 | calformat.h \ | 23 | calformat.h \ |
24 | calstorage.h \ | 24 | calstorage.h \ |
25 | compat.h \ | 25 | compat.h \ |
26 | customproperties.h \ | 26 | customproperties.h \ |
27 | dummyscheduler.h \ | 27 | dummyscheduler.h \ |
28 | duration.h \ | 28 | duration.h \ |
29 | event.h \ | 29 | event.h \ |
30 | exceptions.h \ | 30 | exceptions.h \ |
31 | filestorage.h \ | 31 | filestorage.h \ |
32 | freebusy.h \ | 32 | freebusy.h \ |
33 | icaldrag.h \ | 33 | icaldrag.h \ |
34 | icalformat.h \ | 34 | icalformat.h \ |
35 | icalformatimpl.h \ | 35 | icalformatimpl.h \ |
36 | imipscheduler.h \ | 36 | imipscheduler.h \ |
37 | incidence.h \ | 37 | incidence.h \ |
38 | incidencebase.h \ | 38 | incidencebase.h \ |
39 | kincidenceformatter.h \ | ||
39 | journal.h \ | 40 | journal.h \ |
40 | period.h \ | 41 | period.h \ |
41 | person.h \ | 42 | person.h \ |
42 | qtopiaformat.h \ | 43 | qtopiaformat.h \ |
43 | sharpformat.h \ | 44 | sharpformat.h \ |
44 | phoneformat.h \ | 45 | phoneformat.h \ |
45 | recurrence.h \ | 46 | recurrence.h \ |
46 | scheduler.h \ | 47 | scheduler.h \ |
47 | todo.h \ | 48 | todo.h \ |
48 | vcaldrag.h \ | 49 | vcaldrag.h \ |
49 | vcalformat.h \ | 50 | vcalformat.h \ |
50 | versit/port.h \ | 51 | versit/port.h \ |
51 | versit/vcc.h \ | 52 | versit/vcc.h \ |
52 | versit/vobject.h \ | 53 | versit/vobject.h \ |
53 | 54 | ||
54 | SOURCES = \ | 55 | SOURCES = \ |
55 | alarm.cpp \ | 56 | alarm.cpp \ |
56 | attachment.cpp \ | 57 | attachment.cpp \ |
57 | attendee.cpp \ | 58 | attendee.cpp \ |
58 | calendar.cpp \ | 59 | calendar.cpp \ |
59 | calendarlocal.cpp \ | 60 | calendarlocal.cpp \ |
60 | calfilter.cpp \ | 61 | calfilter.cpp \ |
61 | calformat.cpp \ | 62 | calformat.cpp \ |
62 | compat.cpp \ | 63 | compat.cpp \ |
63 | customproperties.cpp \ | 64 | customproperties.cpp \ |
64 | dummyscheduler.cpp \ | 65 | dummyscheduler.cpp \ |
65 | duration.cpp \ | 66 | duration.cpp \ |
66 | event.cpp \ | 67 | event.cpp \ |
67 | exceptions.cpp \ | 68 | exceptions.cpp \ |
68 | filestorage.cpp \ | 69 | filestorage.cpp \ |
69 | freebusy.cpp \ | 70 | freebusy.cpp \ |
70 | icaldrag.cpp \ | 71 | icaldrag.cpp \ |
71 | icalformat.cpp \ | 72 | icalformat.cpp \ |
72 | icalformatimpl.cpp \ | 73 | icalformatimpl.cpp \ |
73 | imipscheduler.cpp \ | 74 | imipscheduler.cpp \ |
74 | incidence.cpp \ | 75 | incidence.cpp \ |
75 | incidencebase.cpp \ | 76 | incidencebase.cpp \ |
77 | kincidenceformatter.cpp \ | ||
76 | journal.cpp \ | 78 | journal.cpp \ |
77 | period.cpp \ | 79 | period.cpp \ |
78 | person.cpp \ | 80 | person.cpp \ |
79 | qtopiaformat.cpp \ | 81 | qtopiaformat.cpp \ |
80 | sharpformat.cpp \ | 82 | sharpformat.cpp \ |
81 | phoneformat.cpp \ | 83 | phoneformat.cpp \ |
82 | recurrence.cpp \ | 84 | recurrence.cpp \ |
83 | scheduler.cpp \ | 85 | scheduler.cpp \ |
84 | todo.cpp \ | 86 | todo.cpp \ |
85 | vcaldrag.cpp \ | 87 | vcaldrag.cpp \ |
86 | vcalformat.cpp \ | 88 | vcalformat.cpp \ |
87 | versit/vcc.c \ | 89 | versit/vcc.c \ |
88 | versit/vobject.c \ | 90 | versit/vobject.c \ |
89 | 91 | ||
diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro index 102d827..69980e3 100644 --- a/libkdepim/libkdepimE.pro +++ b/libkdepim/libkdepimE.pro | |||
@@ -1,51 +1,51 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | TARGET = microkdepim | 3 | TARGET = microkdepim |
4 | INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include | 4 | INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/microkde $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde/kdecore $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include |
5 | LIBS += -lmicrokde | 5 | LIBS += -lmicrokde |
6 | LIBS += -lmicrokcal | 6 | #LIBS += -lmicrokcal |
7 | LIBS += -L$(QPEDIR)/lib | 7 | LIBS += -L$(QPEDIR)/lib |
8 | OBJECTS_DIR = obj/$(PLATFORM) | 8 | OBJECTS_DIR = obj/$(PLATFORM) |
9 | MOC_DIR = moc/$(PLATFORM) | 9 | MOC_DIR = moc/$(PLATFORM) |
10 | DESTDIR=$(QPEDIR)/lib | 10 | DESTDIR=$(QPEDIR)/lib |
11 | 11 | ||
12 | 12 | ||
13 | INTERFACES = \ | 13 | INTERFACES = \ |
14 | 14 | ||
15 | HEADERS = \ | 15 | HEADERS = \ |
16 | categoryeditdialog.h \ | 16 | categoryeditdialog.h \ |
17 | categoryeditdialog_base.h \ | 17 | categoryeditdialog_base.h \ |
18 | categoryselectdialog.h \ | 18 | categoryselectdialog.h \ |
19 | categoryselectdialog_base.h \ | 19 | categoryselectdialog_base.h \ |
20 | externalapphandler.h \ | 20 | externalapphandler.h \ |
21 | kdateedit.h \ | 21 | kdateedit.h \ |
22 | kdatepicker.h \ | 22 | kdatepicker.h \ |
23 | kinputdialog.h \ | 23 | kinputdialog.h \ |
24 | kincidenceformatter.h \ | ||
25 | kpimprefs.h \ | 24 | kpimprefs.h \ |
26 | kpimglobalprefs.h \ | 25 | kpimglobalprefs.h \ |
27 | kprefsdialog.h \ | 26 | kprefsdialog.h \ |
28 | ksyncprofile.h \ | 27 | ksyncprofile.h \ |
29 | ksyncprefsdialog.h \ | 28 | ksyncprefsdialog.h \ |
30 | kcmconfigs/kcmkdepimconfig.h \ | 29 | kcmconfigs/kcmkdepimconfig.h \ |
31 | kcmconfigs/kdepimconfigwidget.h | 30 | kcmconfigs/kdepimconfigwidget.h |
32 | 31 | ||
33 | 32 | ||
34 | 33 | ||
35 | SOURCES = \ | 34 | SOURCES = \ |
36 | categoryeditdialog.cpp \ | 35 | categoryeditdialog.cpp \ |
37 | categoryeditdialog_base.cpp \ | 36 | categoryeditdialog_base.cpp \ |
38 | categoryselectdialog.cpp \ | 37 | categoryselectdialog.cpp \ |
39 | categoryselectdialog_base.cpp \ | 38 | categoryselectdialog_base.cpp \ |
40 | externalapphandler.cpp \ | 39 | externalapphandler.cpp \ |
41 | kdateedit.cpp \ | 40 | kdateedit.cpp \ |
42 | kinputdialog.cpp \ | 41 | kinputdialog.cpp \ |
43 | kdatepicker.cpp \ | 42 | kdatepicker.cpp \ |
44 | kincidenceformatter.cpp \ | ||
45 | kpimprefs.cpp \ | 43 | kpimprefs.cpp \ |
46 | kpimglobalprefs.cpp \ | 44 | kpimglobalprefs.cpp \ |
47 | kprefsdialog.cpp \ | 45 | kprefsdialog.cpp \ |
48 | ksyncprofile.cpp \ | 46 | ksyncprofile.cpp \ |
49 | ksyncprefsdialog.cpp \ | 47 | ksyncprefsdialog.cpp \ |
50 | kcmconfigs/kcmkdepimconfig.cpp \ | 48 | kcmconfigs/kcmkdepimconfig.cpp \ |
51 | kcmconfigs/kdepimconfigwidget.cpp | 49 | kcmconfigs/kdepimconfigwidget.cpp |
50 | |||
51 | |||
diff --git a/setZaurus3 b/setZaurus3 new file mode 100755 index 0000000..2649292 --- a/dev/null +++ b/setZaurus3 | |||
@@ -0,0 +1,24 @@ | |||
1 | # Settings to compile KDE-Pim/Pi with gcc 3.3.2 cross compiler for Zaurus | ||
2 | # copy this dir to /opt/Qtopia/examples/ | ||
3 | # Now this file should be in the path /opt/Qtopia/examples/kdepim/setZaurus3 | ||
4 | # add the following line to ~/.bashrc without leading # | ||
5 | # alias cz='source /opt/Qtopia/examples/kdepim/setZaurus3' | ||
6 | # then type in terminal cz3<return> to set the variables | ||
7 | # for cross-compiling | ||
8 | export QPEDIR=/opt/Qtopia/sharp3 | ||
9 | export OPIEDIR=/kde_dev/opie | ||
10 | #export BUILD_NO_OPIE_PLUGIN=1 | ||
11 | export BUILD_NO_QTOPIA_PLUGIN=1 | ||
12 | export BUILD_NO_SHARP_PLUGIN=1 | ||
13 | #export BUILD_NO_GAMMU=1 | ||
14 | export QTDIR=/opt/Qtopia/sharp3 | ||
15 | #insert here path to your gcc 3.3.2 compiler | ||
16 | export PATH=$QTDIR/bin:/opt/cross/bin:$PATH | ||
17 | export TMAKEPATH=/opt/Qtopia/tmake/lib/qws/linux-sharp-g++ | ||
18 | export PLATFORM=zaurus3 | ||
19 | export RELEASE_DEBUG=release | ||
20 | export SHARPDTMSDK=/opt/dtm | ||
21 | #export RELEASE_DEBUG=debug | ||
22 | export GCC3EXTRALIB1=-lpng12 | ||
23 | export GCC3EXTRALIB2=-lz | ||
24 | export KDEPIM_VERSION=1.9.5c \ No newline at end of file | ||