author | zautrix <zautrix> | 2005-04-15 09:18:49 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-15 09:18:49 (UTC) |
commit | ab47475f1b03a8c82f9b0388549a2618743f2a69 (patch) (unidiff) | |
tree | 381622b3ceb94daf771a2697ee10f0cd6572e947 | |
parent | acb5803cdda97ef1369388eb15eb669e2835c06a (diff) | |
download | kdepimpi-ab47475f1b03a8c82f9b0388549a2618743f2a69.zip kdepimpi-ab47475f1b03a8c82f9b0388549a2618743f2a69.tar.gz kdepimpi-ab47475f1b03a8c82f9b0388549a2618743f2a69.tar.bz2 |
fixxx
-rw-r--r-- | Makefile | 662 | ||||
-rw-r--r-- | korganizer/koeventviewer.cpp | 94 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 5 | ||||
-rw-r--r-- | libkcal/kincidenceformatter.cpp | 65 |
4 files changed, 379 insertions, 447 deletions
@@ -1,385 +1,279 @@ | |||
1 | export KDEPIMDIR = $(shell pwd) | 1 | ############################################################################# |
2 | 2 | # Makefile for building: kdepim-desktop | |
3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) | 3 | # Generated by qmake (1.07a) (Qt 3.3.4) on: Fri Apr 15 10:15:45 2005 |
4 | 4 | # Project: kdepim-desktop.pro | |
5 | ifeq ($(PLATFORM) , zaurus) | 5 | # Template: subdirs |
6 | BUILD_NO_LDAP_PLUGIN=1 | 6 | # Command: $(QMAKE) -o Makefile kdepim-desktop.pro |
7 | endif | 7 | ############################################################################# |
8 | 8 | ||
9 | ifneq ($(PLATFORM) , zaurus) | 9 | MAKEFILE =Makefile |
10 | BUILD_NO_SHARP_PLUGIN=1 | 10 | QMAKE =qmake |
11 | endif | 11 | DEL_FILE = rm -f |
12 | 12 | CHK_DIR_EXISTS= test -d | |
13 | #opie plugin is deprecated. The qtopia plugin handles the task from now on. | 13 | MKDIR = mkdir -p |
14 | BUILD_NO_OPIE_PLUGIN=1 | 14 | INSTALL_FILE= |
15 | 15 | INSTALL_DIR = | |
16 | SUBDIRS_MICROKDE = \ | 16 | SUBTARGETS = \ |
17 | libical/src/libical \ | 17 | sub-kabc-plugins-file \ |
18 | libical/src/libicalss \ | 18 | sub-kabc-plugins-dir \ |
19 | qtcompat \ | 19 | sub-kabc-plugins-qtopia \ |
20 | microkde \ | 20 | sub-libical \ |
21 | libkcal \ | 21 | sub-libkcal \ |
22 | libkdepim \ | 22 | sub-kabc \ |
23 | kabc \ | 23 | sub-libkdepim \ |
24 | kabc/formats/binary \ | 24 | sub-microkde \ |
25 | kabc/plugins/file \ | 25 | sub-korganizer \ |
26 | kabc/plugins/dir \ | 26 | sub-kaddressbook \ |
27 | korganizer \ | 27 | sub-gammu-emb-common \ |
28 | kalarmd \ | 28 | sub-gammu-emb-gammu \ |
29 | kaddressbook | 29 | sub-libetpan \ |
30 | 30 | sub-kmicromail-libmailwrapper \ | |
31 | SUBDIRS_QTOPIA_PLUGIN = \ | 31 | sub-kmicromail \ |
32 | kabc/plugins/qtopia | 32 | sub-pwmanager-libcrypt-cipher \ |
33 | 33 | sub-pwmanager-libcrypt-error \ | |
34 | SUBDIRS_OPIE_PLUGIN = \ | 34 | sub-pwmanager-libcrypt-mpi \ |
35 | kabc/plugins/opie | 35 | sub-pwmanager-libcrypt-zlib \ |
36 | 36 | sub-pwmanager-pwmanager | |
37 | SUBDIRS_SHARP_PLUGIN = \ | 37 | |
38 | kabc/plugins/sharpdtm | 38 | first: all |
39 | 39 | ||
40 | SUBDIRS_LDAP_PLUGIN = \ | 40 | all: Makefile $(SUBTARGETS) |
41 | kabc/plugins/ldap | 41 | |
42 | 42 | kabc/plugins/file/$(MAKEFILE): | |
43 | SUBDIRS_MICROMAIL = \ | 43 | @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file" |
44 | libetpan \ | 44 | cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE) |
45 | kmicromail/libmailwrapper \ | 45 | sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE |
46 | kmicromail | 46 | cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE) |
47 | 47 | ||
48 | SUBDIRS_GAMMU = \ | 48 | kabc/plugins/dir/$(MAKEFILE): |
49 | gammu/emb/common \ | 49 | @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir" |
50 | gammu/emb/gammu | 50 | cd kabc/plugins/dir && $(QMAKE) dir.pro -o $(MAKEFILE) |
51 | 51 | sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE | |
52 | SUBDIRS_PWMANAGER = \ | 52 | cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE) |
53 | pwmanager/libcrypt/mpi \ | 53 | |
54 | pwmanager/libcrypt/error \ | 54 | kabc/plugins/qtopia/$(MAKEFILE): |
55 | pwmanager/libcrypt/cipher \ | 55 | @$(CHK_DIR_EXISTS) "kabc/plugins/qtopia" || $(MKDIR) "kabc/plugins/qtopia" |
56 | pwmanager/libcrypt/zlib \ | 56 | cd kabc/plugins/qtopia && $(QMAKE) qtopia.pro -o $(MAKEFILE) |
57 | pwmanager/pwmanager | 57 | sub-kabc-plugins-qtopia: kabc/plugins/qtopia/$(MAKEFILE) FORCE |
58 | 58 | cd kabc/plugins/qtopia && $(MAKE) -f $(MAKEFILE) | |
59 | SUBDIRS = \ | 59 | |
60 | $(SUBDIRS_MICROKDE) \ | 60 | libical/$(MAKEFILE): |
61 | $(SUBDIRS_QTOPIA_PLUGIN) \ | 61 | @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical" |
62 | $(SUBDIRS_OPIE_PLUGIN) \ | 62 | cd libical && $(QMAKE) libical.pro -o $(MAKEFILE) |
63 | $(SUBDIRS_SHARP_PLUGIN) \ | 63 | sub-libical: libical/$(MAKEFILE) FORCE |
64 | $(SUBDIRS_LDAP_PLUGIN) \ | 64 | cd libical && $(MAKE) -f $(MAKEFILE) |
65 | $(SUBDIRS_MICROMAIL) \ | 65 | |
66 | $(SUBDIRS_GAMMU) \ | 66 | libkcal/$(MAKEFILE): |
67 | $(SUBDIRS_PWMANAGER) | 67 | @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal" |
68 | 68 | cd libkcal && $(QMAKE) libkcal.pro -o $(MAKEFILE) | |
69 | 69 | sub-libkcal: libkcal/$(MAKEFILE) FORCE | |
70 | all: build_microkde \ | 70 | cd libkcal && $(MAKE) -f $(MAKEFILE) |
71 | build_qtopia_plugin \ | 71 | |
72 | build_opie_plugin \ | 72 | kabc/$(MAKEFILE): |
73 | build_sharp_plugin \ | 73 | @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc" |
74 | build_ldap_plugin \ | 74 | cd kabc && $(QMAKE) kabc.pro -o $(MAKEFILE) |
75 | build_micromail \ | 75 | sub-kabc: kabc/$(MAKEFILE) FORCE |
76 | build_gammu \ | 76 | cd kabc && $(MAKE) -f $(MAKEFILE) |
77 | build_pwmanager | 77 | |
78 | 78 | libkdepim/$(MAKEFILE): | |
79 | 79 | @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim" | |
80 | build_microkde: variable_test tmake | 80 | cd libkdepim && $(QMAKE) libkdepim.pro -o $(MAKEFILE) |
81 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ | 81 | sub-libkdepim: libkdepim/$(MAKEFILE) FORCE |
82 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 82 | cd libkdepim && $(MAKE) -f $(MAKEFILE) |
83 | done | 83 | |
84 | 84 | microkde/$(MAKEFILE): | |
85 | build_qtopia_plugin: build_microkde | 85 | @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde" |
86 | ifdef BUILD_NO_QTOPIA_PLUGIN | 86 | cd microkde && $(QMAKE) microkde.pro -o $(MAKEFILE) |
87 | @echo == qtopia plugin not build. | 87 | sub-microkde: microkde/$(MAKEFILE) FORCE |
88 | else | 88 | cd microkde && $(MAKE) -f $(MAKEFILE) |
89 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ | 89 | |
90 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 90 | korganizer/$(MAKEFILE): |
91 | done | 91 | @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer" |
92 | endif | 92 | cd korganizer && $(QMAKE) korganizer.pro -o $(MAKEFILE) |
93 | 93 | sub-korganizer: korganizer/$(MAKEFILE) FORCE | |
94 | build_opie_plugin: build_microkde | 94 | cd korganizer && $(MAKE) -f $(MAKEFILE) |
95 | ifdef BUILD_NO_OPIE_PLUGIN | 95 | |
96 | @echo == opie plugin not build. | 96 | kaddressbook/$(MAKEFILE): |
97 | else | 97 | @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook" |
98 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ | 98 | cd kaddressbook && $(QMAKE) kaddressbook.pro -o $(MAKEFILE) |
99 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 99 | sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE |
100 | done | 100 | cd kaddressbook && $(MAKE) -f $(MAKEFILE) |
101 | endif | 101 | |
102 | 102 | gammu/emb/common/$(MAKEFILE): | |
103 | build_sharp_plugin: build_microkde | 103 | @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common" |
104 | ifdef BUILD_NO_SHARP_PLUGIN | 104 | cd gammu/emb/common && $(QMAKE) common.pro -o $(MAKEFILE) |
105 | @echo == ldap plugin not build. | 105 | sub-gammu-emb-common: gammu/emb/common/$(MAKEFILE) FORCE |
106 | else | 106 | cd gammu/emb/common && $(MAKE) -f $(MAKEFILE) |
107 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ | 107 | |
108 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 108 | gammu/emb/gammu/$(MAKEFILE): |
109 | done | 109 | @$(CHK_DIR_EXISTS) "gammu/emb/gammu" || $(MKDIR) "gammu/emb/gammu" |
110 | endif | 110 | cd gammu/emb/gammu && $(QMAKE) gammu.pro -o $(MAKEFILE) |
111 | 111 | sub-gammu-emb-gammu: gammu/emb/gammu/$(MAKEFILE) FORCE | |
112 | build_ldap_plugin: build_microkde | 112 | cd gammu/emb/gammu && $(MAKE) -f $(MAKEFILE) |
113 | ifdef BUILD_NO_LDAP_PLUGIN | 113 | |
114 | @echo == ldap plugin not build. | 114 | libetpan/$(MAKEFILE): |
115 | else | 115 | @$(CHK_DIR_EXISTS) "libetpan" || $(MKDIR) "libetpan" |
116 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ | 116 | cd libetpan && $(QMAKE) libetpan.pro -o $(MAKEFILE) |
117 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 117 | sub-libetpan: libetpan/$(MAKEFILE) FORCE |
118 | done | 118 | cd libetpan && $(MAKE) -f $(MAKEFILE) |
119 | endif | 119 | |
120 | 120 | kmicromail/libmailwrapper/$(MAKEFILE): | |
121 | 121 | @$(CHK_DIR_EXISTS) "kmicromail/libmailwrapper" || $(MKDIR) "kmicromail/libmailwrapper" | |
122 | build_micromail: build_microkde | 122 | cd kmicromail/libmailwrapper && $(QMAKE) libmailwrapper.pro -o $(MAKEFILE) |
123 | ifdef BUILD_NO_MICROMAIL | 123 | sub-kmicromail-libmailwrapper: kmicromail/libmailwrapper/$(MAKEFILE) FORCE |
124 | @echo == kmicromail not build. | 124 | cd kmicromail/libmailwrapper && $(MAKE) -f $(MAKEFILE) |
125 | else | 125 | |
126 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ | 126 | kmicromail/$(MAKEFILE): |
127 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 127 | @$(CHK_DIR_EXISTS) "kmicromail" || $(MKDIR) "kmicromail" |
128 | done | 128 | cd kmicromail && $(QMAKE) kmicromail.pro -o $(MAKEFILE) |
129 | endif | 129 | sub-kmicromail: kmicromail/$(MAKEFILE) FORCE |
130 | 130 | cd kmicromail && $(MAKE) -f $(MAKEFILE) | |
131 | build_gammu: variable_test tmake | 131 | |
132 | ifdef BUILD_NO_GAMMU | 132 | pwmanager/libcrypt/cipher/$(MAKEFILE): |
133 | @echo == gammu not build. | 133 | @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/cipher" || $(MKDIR) "pwmanager/libcrypt/cipher" |
134 | else | 134 | cd pwmanager/libcrypt/cipher && $(QMAKE) cipher.pro -o $(MAKEFILE) |
135 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ | 135 | sub-pwmanager-libcrypt-cipher: pwmanager/libcrypt/cipher/$(MAKEFILE) FORCE |
136 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 136 | cd pwmanager/libcrypt/cipher && $(MAKE) -f $(MAKEFILE) |
137 | done | 137 | |
138 | endif | 138 | pwmanager/libcrypt/error/$(MAKEFILE): |
139 | 139 | @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/error" || $(MKDIR) "pwmanager/libcrypt/error" | |
140 | build_pwmanager: build_microkde | 140 | cd pwmanager/libcrypt/error && $(QMAKE) error.pro -o $(MAKEFILE) |
141 | ifdef BUILD_NO_PWMANAGER | 141 | sub-pwmanager-libcrypt-error: pwmanager/libcrypt/error/$(MAKEFILE) FORCE |
142 | @echo == pwmanager not build. | 142 | cd pwmanager/libcrypt/error && $(MAKE) -f $(MAKEFILE) |
143 | else | 143 | |
144 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ | 144 | pwmanager/libcrypt/mpi/$(MAKEFILE): |
145 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 145 | @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/mpi" || $(MKDIR) "pwmanager/libcrypt/mpi" |
146 | done | 146 | cd pwmanager/libcrypt/mpi && $(QMAKE) mpi.pro -o $(MAKEFILE) |
147 | endif | 147 | sub-pwmanager-libcrypt-mpi: pwmanager/libcrypt/mpi/$(MAKEFILE) FORCE |
148 | 148 | cd pwmanager/libcrypt/mpi && $(MAKE) -f $(MAKEFILE) | |
149 | 149 | ||
150 | variable_info: | 150 | pwmanager/libcrypt/zlib/$(MAKEFILE): |
151 | @echo -------------------------------------- | 151 | @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/zlib" || $(MKDIR) "pwmanager/libcrypt/zlib" |
152 | @echo KDEPIM buildsystem, variableinfo... | 152 | cd pwmanager/libcrypt/zlib && $(QMAKE) zlib.pro -o $(MAKEFILE) |
153 | @echo KDEPIMDIR=$(KDEPIMDIR) | 153 | sub-pwmanager-libcrypt-zlib: pwmanager/libcrypt/zlib/$(MAKEFILE) FORCE |
154 | @echo QTDIR=$(QTDIR) | 154 | cd pwmanager/libcrypt/zlib && $(MAKE) -f $(MAKEFILE) |
155 | @echo QPEDIR=$(QPEDIR) | 155 | |
156 | @echo OPIEDIR=$(OPIEDIR) | 156 | pwmanager/pwmanager/$(MAKEFILE): |
157 | @echo PLATFORM=$(PLATFORM) | 157 | @$(CHK_DIR_EXISTS) "pwmanager/pwmanager" || $(MKDIR) "pwmanager/pwmanager" |
158 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) | 158 | cd pwmanager/pwmanager && $(QMAKE) pwmanager.pro -o $(MAKEFILE) |
159 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) | 159 | sub-pwmanager-pwmanager: pwmanager/pwmanager/$(MAKEFILE) FORCE |
160 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) | 160 | cd pwmanager/pwmanager && $(MAKE) -f $(MAKEFILE) |
161 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) | 161 | |
162 | @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) | 162 | Makefile: kdepim-desktop.pro /usr/lib/qt3/mkspecs/default/qmake.conf variables.pri |
163 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) | 163 | $(QMAKE) -o Makefile kdepim-desktop.pro |
164 | ifndef BUILD_NO_SHARP_PLUGIN | 164 | qmake: qmake_all |
165 | @echo SHARPDTMSDK=$(SHARPDTMSDK) | 165 | @$(QMAKE) -o Makefile kdepim-desktop.pro |
166 | endif | 166 | |
167 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) | 167 | all: $(SUBTARGETS) |
168 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) | 168 | qmake_all: kabc/plugins/file/$(MAKEFILE) kabc/plugins/dir/$(MAKEFILE) kabc/plugins/qtopia/$(MAKEFILE) libical/$(MAKEFILE) libkcal/$(MAKEFILE) kabc/$(MAKEFILE) libkdepim/$(MAKEFILE) microkde/$(MAKEFILE) korganizer/$(MAKEFILE) kaddressbook/$(MAKEFILE) gammu/emb/common/$(MAKEFILE) gammu/emb/gammu/$(MAKEFILE) libetpan/$(MAKEFILE) kmicromail/libmailwrapper/$(MAKEFILE) kmicromail/$(MAKEFILE) pwmanager/libcrypt/cipher/$(MAKEFILE) pwmanager/libcrypt/error/$(MAKEFILE) pwmanager/libcrypt/mpi/$(MAKEFILE) pwmanager/libcrypt/zlib/$(MAKEFILE) pwmanager/pwmanager/$(MAKEFILE) |
169 | @echo -------------------------------------- | 169 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
170 | 170 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | |
171 | variable_test: variable_info | 171 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
172 | @echo KDEPIM buildsystem, variablecheck... | 172 | ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
173 | ifndef KDEPIMDIR | 173 | ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
174 | @echo KDEPIMDIR is not defined. | 174 | ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
175 | $(error KDEPIMDIR is not defined) | 175 | ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
176 | endif | 176 | ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
177 | ifndef PLATFORM | 177 | ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
178 | @echo PLATFORM is not defined. | 178 | ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
179 | $(error PLATFORM is not defined) | 179 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
180 | endif | 180 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
181 | ifdef BUILD_NO_LDAP_PLUGIN | 181 | ( [ -d libetpan ] && cd libetpan ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
182 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) | 182 | ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
183 | endif | 183 | ( [ -d kmicromail ] && cd kmicromail ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
184 | ifdef BUILD_NO_OPIE_PLUGIN | 184 | ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
185 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) | 185 | ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
186 | endif | 186 | ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
187 | ifdef BUILD_NO_QTOPIA_PLUGIN | 187 | ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
188 | @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) | 188 | ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true |
189 | endif | 189 | clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE |
190 | ifdef BUILD_NO_MICROMAIL | 190 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
191 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) | 191 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
192 | endif | 192 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
193 | ifdef BUILD_NO_SHARP_PLUGIN | 193 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
194 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) | 194 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
195 | else | 195 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
196 | ifndef SHARPDTMSDK | 196 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
197 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) | 197 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
198 | $(error SHARPDTMSDK is not defined) | 198 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
199 | endif | 199 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
200 | endif | 200 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
201 | ifdef BUILD_NO_GAMMU | 201 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
202 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) | 202 | ( [ -d libetpan ] && cd libetpan ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
203 | endif | 203 | ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
204 | ifdef BUILD_NO_PWMANAGER | 204 | ( [ -d kmicromail ] && cd kmicromail ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
205 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) | 205 | ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
206 | endif | 206 | ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
207 | @echo -------------------------------------- | 207 | ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; ) || true |
208 | 208 | ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; ) || true | |
209 | 209 | ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; ) || true | |
210 | objects: | 210 | uninstall_subdirs: qmake_all FORCE |
211 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done | 211 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
212 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done | 212 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
213 | mkdir -p libical/lib/$(PLATFORM) | 213 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
214 | mkdir -p dest | 214 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
215 | mkdir -p dest$(LIBICAL_PATH) | 215 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
216 | mkdir -p pwmanager/libcrypt/$(PLATFORM) | 216 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
217 | 217 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | |
218 | clean: | 218 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
219 | rm -rf libical/lib/$(PLATFORM)/*; | 219 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
220 | rm -rf pwmanager/libcrypt/$(PLATFORM)/*; | 220 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
221 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ | 221 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
222 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ | 222 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
223 | done | 223 | ( [ -d libetpan ] && cd libetpan ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
224 | 224 | ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | |
225 | pac: | 225 | ( [ -d kmicromail ] && cd kmicromail ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
226 | rm -f $(QPEDIR)/lib/libmicro* | 226 | ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
227 | rm -f $(QPEDIR)/plugins/applets/libkopi* | 227 | ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
228 | make | 228 | ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
229 | make install | 229 | ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
230 | make dist | 230 | ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true |
231 | install: | 231 | install_subdirs: qmake_all FORCE |
232 | 232 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true | |
233 | cd bin/kdepim; make install | 233 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true |
234 | cp -r Pim $(QPEDIR)/apps | 234 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) install; ) || true |
235 | cp db2file/db2file $(QPEDIR)/bin/db2file | 235 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true |
236 | chmod ugo+x $(QPEDIR)/bin/db2file | 236 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true |
237 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop | 237 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true |
238 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop | 238 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true |
239 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop | 239 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true |
240 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop | 240 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true |
241 | 241 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true | |
242 | dist: | 242 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true |
243 | @echo Dont forget to do "make install" before "make dist" | 243 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) install; ) || true |
244 | rm -f *arm.ipk | 244 | ( [ -d libetpan ] && cd libetpan ; $(MAKE) -f $(MAKEFILE) install; ) || true |
245 | rm -f *ipk.zip | 245 | ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; $(MAKE) -f $(MAKEFILE) install; ) || true |
246 | rm -rf ../kdepimpi_$(KDEPIM_VERSION)/* | 246 | ( [ -d kmicromail ] && cd kmicromail ; $(MAKE) -f $(MAKEFILE) install; ) || true |
247 | rm -f *~ | 247 | ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) install; ) || true |
248 | cd ..;mkdir -p kdepimpi_$(KDEPIM_VERSION) | 248 | ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) install; ) || true |
249 | cd ../kdepimpi_$(KDEPIM_VERSION);mkdir -p ipk | 249 | ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) install; ) || true |
250 | cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim | 250 | ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) install; ) || true |
251 | mkipks kmicrokdelibs.control | 251 | ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) install; ) || true |
252 | mkipks korganizer.control | 252 | distclean: qmake_all FORCE |
253 | mkipks kaddressbook.control | 253 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
254 | ifndef BUILD_NO_MICROMAIL | 254 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
255 | mkipks kopiemail.control | 255 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
256 | endif | 256 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
257 | ifndef BUILD_NO_SHARP_PLUGIN | 257 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
258 | mkipks ksharpPIM-DTMaccess.control | 258 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
259 | endif | 259 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
260 | mkipks korganizer-alarm.control | 260 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
261 | ifndef BUILD_NO_GAMMU | 261 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
262 | mkipks kmobilephoneaccess.control | 262 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
263 | endif | 263 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
264 | ifndef BUILD_NO_PWMANAGER | 264 | ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
265 | mkipks pwmanager.control | 265 | ( [ -d libetpan ] && cd libetpan ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
266 | endif | 266 | ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
267 | mkipks pimTABicon.control | 267 | ( [ -d kmicromail ] && cd kmicromail ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
268 | zip kdepim_$(KDEPIM_VERSION)_for_SharpRom.ipk.zip *.ipk ReleaseNotes.txt | 268 | ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
269 | mv *.ipk ../kdepimpi_$(KDEPIM_VERSION)/ipk/ | 269 | ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
270 | mv *for_SharpRom.ipk.zip ../kdepimpi_$(KDEPIM_VERSION)/ | 270 | ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
271 | mv ../kdepimpi-$(KDEPIM_VERSION).tar.gz ../kdepimpi_$(KDEPIM_VERSION)/ | 271 | ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true |
272 | 272 | ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | |
273 | tmake: objects \ | 273 | |
274 | qtcompat/Makefile$(PLATFORM) \ | 274 | install: install_subdirs |
275 | microkde/Makefile$(PLATFORM) \ | 275 | |
276 | libkcal/Makefile$(PLATFORM) \ | 276 | uninstall: uninstall_subdirs |
277 | libkdepim/Makefile$(PLATFORM) \ | 277 | |
278 | korganizer/Makefile$(PLATFORM) \ | 278 | FORCE: |
279 | kalarmd/Makefile$(PLATFORM) \ | ||
280 | libical/src/libical/Makefile$(PLATFORM) \ | ||
281 | libical/src/libicalss/Makefile$(PLATFORM) \ | ||
282 | kabc/Makefile$(PLATFORM) \ | ||
283 | kabc/formats/binary/Makefile$(PLATFORM) \ | ||
284 | kabc/plugins/file/Makefile$(PLATFORM) \ | ||
285 | kabc/plugins/dir/Makefile$(PLATFORM) \ | ||
286 | kabc/plugins/ldap/Makefile$(PLATFORM) \ | ||
287 | kabc/plugins/opie/Makefile$(PLATFORM) \ | ||
288 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ | ||
289 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ | ||
290 | kaddressbook/Makefile$(PLATFORM) \ | ||
291 | kmicromail/Makefile$(PLATFORM) \ | ||
292 | libetpan/Makefile$(PLATFORM) \ | ||
293 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ | ||
294 | gammu/emb/common/Makefile$(PLATFORM) \ | ||
295 | gammu/emb/gammu/Makefile$(PLATFORM) \ | ||
296 | pwmanager/pwmanager/Makefile$(PLATFORM) \ | ||
297 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \ | ||
298 | pwmanager/libcrypt/error/Makefile$(PLATFORM) \ | ||
299 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \ | ||
300 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM) | ||
301 | |||
302 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro | ||
303 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) | ||
304 | |||
305 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro | ||
306 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) | ||
307 | |||
308 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro | ||
309 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) | ||
310 | |||
311 | |||
312 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro | ||
313 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) | ||
314 | |||
315 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro | ||
316 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) | ||
317 | |||
318 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro | ||
319 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) | ||
320 | |||
321 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro | ||
322 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) | ||
323 | |||
324 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro | ||
325 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) | ||
326 | |||
327 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro | ||
328 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) | ||
329 | |||
330 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro | ||
331 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) | ||
332 | |||
333 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro | ||
334 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) | ||
335 | |||
336 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro | ||
337 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) | ||
338 | |||
339 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro | ||
340 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) | ||
341 | |||
342 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro | ||
343 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) | ||
344 | |||
345 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro | ||
346 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) | ||
347 | |||
348 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro | ||
349 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) | ||
350 | |||
351 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro | ||
352 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) | ||
353 | |||
354 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro | ||
355 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) | ||
356 | |||
357 | libetpan/Makefile$(PLATFORM): libetpan/libetpanE.pro | ||
358 | cd libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) | ||
359 | |||
360 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro | ||
361 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) | ||
362 | |||
363 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro | ||
364 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) | ||
365 | |||
366 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro | ||
367 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) | ||
368 | |||
369 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro | ||
370 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) | ||
371 | |||
372 | |||
373 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro | ||
374 | cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM) | ||
375 | |||
376 | pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro | ||
377 | cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM) | ||
378 | |||
379 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro | ||
380 | cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM) | ||
381 | |||
382 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro | ||
383 | cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM) | ||
384 | |||
385 | 279 | ||
diff --git a/korganizer/koeventviewer.cpp b/korganizer/koeventviewer.cpp index bdad248..fefc778 100644 --- a/korganizer/koeventviewer.cpp +++ b/korganizer/koeventviewer.cpp | |||
@@ -1,771 +1,789 @@ | |||
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 | qDebug("Scale: %f ", scale ); | 102 | qDebug("Scale: %f ", scale ); |
103 | if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { | 103 | if ( scaleval == 2 || scaleval == 1 && scale < 1.0 ) { |
104 | qDebug("SCALE "); | 104 | qDebug("SCALE "); |
105 | p.scale( scale, scale ); | 105 | p.scale( scale, scale ); |
106 | } | 106 | } |
107 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); | 107 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); |
108 | p.end(); | 108 | p.end(); |
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | } | 111 | } |
112 | void KOEventViewer::setSource(const QString& n) | 112 | void KOEventViewer::setSource(const QString& n) |
113 | { | 113 | { |
114 | 114 | ||
115 | if ( n.left(3) == "uid" ) | 115 | if ( n.left(3) == "uid" ) |
116 | #ifdef DESKTOP_VERSION | 116 | #ifdef DESKTOP_VERSION |
117 | { | 117 | { |
118 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); | 118 | KABC::StdAddressBook* AddressBook = KABC::StdAddressBook::self( true ); |
119 | KABC::AddressBook::Iterator it; | 119 | KABC::AddressBook::Iterator it; |
120 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { | 120 | for( it = AddressBook->begin(); it != AddressBook->end(); ++it ) { |
121 | // LR I do not understand, why the uid string is different on zaurus and desktop | 121 | // LR I do not understand, why the uid string is different on zaurus and desktop |
122 | QString uid = "uid://"+(*it).uid(); | 122 | QString uid = "uid://"+(*it).uid(); |
123 | 123 | ||
124 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); | 124 | //qDebug("for *%s* +%s+ ", n.latin1(), uid.latin1()); |
125 | if (n == uid ) { | 125 | if (n == uid ) { |
126 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); | 126 | //qDebug("found %s ",(*it).mobileHomePhone().latin1() ); |
127 | QDialog dia( this,"dia123", true ); | 127 | QDialog dia( this,"dia123", true ); |
128 | dia.setCaption( i18n("Details of attendee") ); | 128 | dia.setCaption( i18n("Details of attendee") ); |
129 | QVBoxLayout lay ( &dia ); | 129 | QVBoxLayout lay ( &dia ); |
130 | KABC::AddresseeView av ( &dia ); | 130 | KABC::AddresseeView av ( &dia ); |
131 | av.setAddressee( (*it) ); | 131 | av.setAddressee( (*it) ); |
132 | lay.addWidget( &av ); | 132 | lay.addWidget( &av ); |
133 | if ( QApplication::desktop()->width() < 480 ) | 133 | if ( QApplication::desktop()->width() < 480 ) |
134 | dia.resize( 220, 240); | 134 | dia.resize( 220, 240); |
135 | else { | 135 | else { |
136 | dia.resize( 400,400); | 136 | dia.resize( 400,400); |
137 | } | 137 | } |
138 | dia.exec(); | 138 | dia.exec(); |
139 | break; | 139 | break; |
140 | } | 140 | } |
141 | } | 141 | } |
142 | return; | 142 | return; |
143 | } | 143 | } |
144 | #else | 144 | #else |
145 | { | 145 | { |
146 | if ( "uid:organizer" == n ) { | 146 | if ( "uid:organizer" == n ) { |
147 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); | 147 | ExternalAppHandler::instance()->requestDetailsFromKAPI("", mCurrentIncidence->organizer(),""); |
148 | return; | 148 | return; |
149 | } | 149 | } |
150 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 150 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
151 | if (attendees.count()) { | 151 | if (attendees.count()) { |
152 | Attendee *a; | 152 | Attendee *a; |
153 | for(a=attendees.first();a;a=attendees.next()) { | 153 | for(a=attendees.first();a;a=attendees.next()) { |
154 | if ( "uid:"+a->uid() == n ) { | 154 | if ( "uid:"+a->uid() == n ) { |
155 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); | 155 | bool res = ExternalAppHandler::instance()->requestDetailsFromKAPI(a->name(), a->email(), a->uid()); |
156 | return; | 156 | return; |
157 | } | 157 | } |
158 | } | 158 | } |
159 | } | 159 | } |
160 | return; | 160 | return; |
161 | } | 161 | } |
162 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); | 162 | //requestNameEmailUidListFromKAPI("QPE/Application/kopi", this->name() /* name is here the unique uid*/); |
163 | // the result should now arrive through method insertAttendees | 163 | // the result should now arrive through method insertAttendees |
164 | //QString uid = "uid:"+(*it).uid(); | 164 | //QString uid = "uid:"+(*it).uid(); |
165 | #endif | 165 | #endif |
166 | if ( n.left(6) == "mailto" ) { | 166 | if ( n.left(6) == "mailto" ) { |
167 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); | 167 | // qDebug("KOEventViewer::setSource %s ", n.mid(7).latin1()); |
168 | #ifndef DESKTOP_VERSION | 168 | #ifndef DESKTOP_VERSION |
169 | if ( n.mid(7,3) == "ALL" ) { | 169 | if ( n.mid(7,3) == "ALL" ) { |
170 | qDebug("all "); | 170 | qDebug("all "); |
171 | mailToAttendees( true ); | 171 | mailToAttendees( true ); |
172 | } else if ( n.mid(7,4) == "RSVP" ) { | 172 | } else if ( n.mid(7,4) == "RSVP" ) { |
173 | mailToAttendees( false ); | 173 | mailToAttendees( false ); |
174 | qDebug("rsvp "); | 174 | qDebug("rsvp "); |
175 | } else { | 175 | } else { |
176 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); | 176 | QCopEnvelope e("QPE/Application/ompi", "newMail(QString)" ); |
177 | e << n.mid(7); | 177 | e << n.mid(7); |
178 | } | 178 | } |
179 | #endif | 179 | #endif |
180 | 180 | ||
181 | } | 181 | } |
182 | 182 | ||
183 | 183 | ||
184 | #ifndef KORG_NODCOP | 184 | #ifndef KORG_NODCOP |
185 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; | 185 | kdDebug() << "KOEventViewer::setSource(): " << n << endl; |
186 | QString tmpStr; | 186 | QString tmpStr; |
187 | if (n.startsWith("mailto:")) { | 187 | if (n.startsWith("mailto:")) { |
188 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); | 188 | KApplication::kApplication()->invokeMailer(n.mid(7),QString::null); |
189 | //emit showIncidence(n); | 189 | //emit showIncidence(n); |
190 | return; | 190 | return; |
191 | } else if (n.startsWith("uid:")) { | 191 | } else if (n.startsWith("uid:")) { |
192 | DCOPClient *client = KApplication::kApplication()->dcopClient(); | 192 | DCOPClient *client = KApplication::kApplication()->dcopClient(); |
193 | const QByteArray noParamData; | 193 | const QByteArray noParamData; |
194 | const QByteArray paramData; | 194 | const QByteArray paramData; |
195 | QByteArray replyData; | 195 | QByteArray replyData; |
196 | QCString replyTypeStr; | 196 | QCString replyTypeStr; |
197 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) | 197 | #define PING_ABBROWSER (client->call("kaddressbook", "KAddressBookIface", "interfaces()", noParamData, replyTypeStr, replyData)) |
198 | bool foundAbbrowser = PING_ABBROWSER; | 198 | bool foundAbbrowser = PING_ABBROWSER; |
199 | 199 | ||
200 | if (foundAbbrowser) { | 200 | if (foundAbbrowser) { |
201 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor | 201 | //KAddressbook is already running, so just DCOP to it to bring up the contact editor |
202 | //client->send("kaddressbook","KAddressBookIface", | 202 | //client->send("kaddressbook","KAddressBookIface", |
203 | QDataStream arg(paramData, IO_WriteOnly); | 203 | QDataStream arg(paramData, IO_WriteOnly); |
204 | arg << n.mid(6); | 204 | arg << n.mid(6); |
205 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); | 205 | client->send("kaddressbook", "KAddressBookIface", "showContactEditor( QString )", paramData); |
206 | return; | 206 | return; |
207 | } else { | 207 | } else { |
208 | /* | 208 | /* |
209 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. | 209 | KaddressBook is not already running. Pass it the UID of the contact via the command line while starting it - its neater. |
210 | We start it without its main interface | 210 | We start it without its main interface |
211 | */ | 211 | */ |
212 | KIconLoader* iconLoader = new KIconLoader(); | 212 | KIconLoader* iconLoader = new KIconLoader(); |
213 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); | 213 | QString iconPath = iconLoader->iconPath("go",KIcon::Small); |
214 | ActionManager::setStartedKAddressBook(true); | 214 | ActionManager::setStartedKAddressBook(true); |
215 | tmpStr = "kaddressbook --editor-only --uid "; | 215 | tmpStr = "kaddressbook --editor-only --uid "; |
216 | tmpStr += KProcess::quote(n.mid(6)); | 216 | tmpStr += KProcess::quote(n.mid(6)); |
217 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); | 217 | KRun::runCommand(tmpStr,"KAddressBook",iconPath); |
218 | return; | 218 | return; |
219 | } | 219 | } |
220 | } else { | 220 | } else { |
221 | //QTextBrowser::setSource(n); | 221 | //QTextBrowser::setSource(n); |
222 | } | 222 | } |
223 | #endif | 223 | #endif |
224 | } | 224 | } |
225 | void KOEventViewer::mailToAttendees( bool all ) | 225 | void KOEventViewer::mailToAttendees( bool all ) |
226 | { | 226 | { |
227 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); | 227 | QPtrList<Attendee> attendees = mCurrentIncidence->attendees(); |
228 | if (attendees.count() == 0) return; | 228 | if (attendees.count() == 0) return; |
229 | QStringList nameList; | 229 | QStringList nameList; |
230 | QStringList emailList; | 230 | QStringList emailList; |
231 | QStringList uidList; | 231 | QStringList uidList; |
232 | Attendee* a; | 232 | Attendee* a; |
233 | for(a=attendees.first();a;a=attendees.next()) { | 233 | for(a=attendees.first();a;a=attendees.next()) { |
234 | if ( !all && !a->RSVP() ) continue; | 234 | if ( !all && !a->RSVP() ) continue; |
235 | if (!a->email().isEmpty()) { | 235 | if (!a->email().isEmpty()) { |
236 | nameList.append (a->name() ); | 236 | nameList.append (a->name() ); |
237 | emailList.append (a->email() ); | 237 | emailList.append (a->email() ); |
238 | uidList.append (a->uid() ); | 238 | uidList.append (a->uid() ); |
239 | } | 239 | } |
240 | } | 240 | } |
241 | QString uid = "ComposeMailUIpick2"+mMailSubject; | 241 | QString uid = "ComposeMailUIpick2"+mMailSubject; |
242 | #ifndef DESKTOP_VERSION | 242 | #ifndef DESKTOP_VERSION |
243 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); | 243 | bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI("QPE/Application/ompi", uid, nameList, emailList, uidList); |
244 | #endif | 244 | #endif |
245 | 245 | ||
246 | } | 246 | } |
247 | void KOEventViewer::addTag(const QString & tag,const QString & text) | 247 | void KOEventViewer::addTag(const QString & tag,const QString & text) |
248 | { | 248 | { |
249 | int number=text.contains("\n"); | 249 | int number=text.contains("\n"); |
250 | QString str = "<" + tag + ">"; | 250 | QString str = "<" + tag + ">"; |
251 | QString tmpText=text; | 251 | QString tmpText=text; |
252 | QString tmpStr=str; | 252 | QString tmpStr=str; |
253 | if(number !=-1) | 253 | if(number !=-1) |
254 | { | 254 | { |
255 | if (number > 0) { | 255 | if (number > 0) { |
256 | int pos=0; | 256 | int pos=0; |
257 | QString tmp; | 257 | QString tmp; |
258 | for(int i=0;i<=number;i++) { | 258 | for(int i=0;i<=number;i++) { |
259 | pos=tmpText.find("\n"); | 259 | pos=tmpText.find("\n"); |
260 | tmp=tmpText.left(pos); | 260 | tmp=tmpText.left(pos); |
261 | tmpText=tmpText.right(tmpText.length()-pos-1); | 261 | tmpText=tmpText.right(tmpText.length()-pos-1); |
262 | tmpStr+=tmp+"<br>"; | 262 | tmpStr+=tmp+"<br>"; |
263 | } | 263 | } |
264 | } | 264 | } |
265 | else tmpStr += tmpText; | 265 | else tmpStr += tmpText; |
266 | tmpStr+="</" + tag + ">"; | 266 | tmpStr+="</" + tag + ">"; |
267 | mText.append(tmpStr); | 267 | mText.append(tmpStr); |
268 | } | 268 | } |
269 | else | 269 | else |
270 | { | 270 | { |
271 | str += text + "</" + tag + ">"; | 271 | str += text + "</" + tag + ">"; |
272 | mText.append(str); | 272 | mText.append(str); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | void KOEventViewer::setColorMode( int m ) | 276 | void KOEventViewer::setColorMode( int m ) |
277 | { | 277 | { |
278 | mColorMode = m; | 278 | mColorMode = m; |
279 | } | 279 | } |
280 | void KOEventViewer::appendEvent(Event *event, int mode ) | 280 | void KOEventViewer::appendEvent(Event *event, int mode ) |
281 | { | 281 | { |
282 | mMailSubject = ""; | 282 | mMailSubject = ""; |
283 | mCurrentIncidence = event; | 283 | mCurrentIncidence = event; |
284 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 284 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
285 | topLevelWidget()->setCaption(i18n("Event Viewer")); | 285 | topLevelWidget()->setCaption(i18n("Event Viewer")); |
286 | if ( mode == 0 ) { | 286 | if ( mode == 0 ) { |
287 | addTag("h2",deTag(event->summary())); | 287 | addTag("h2",deTag(event->summary())); |
288 | } | 288 | } |
289 | else { | 289 | else { |
290 | if ( mColorMode == 1 ) { | 290 | if ( mColorMode == 1 ) { |
291 | mText +="<font color=\"#00A000\">"; | 291 | mText +="<font color=\"#00A000\">"; |
292 | } | 292 | } |
293 | if ( mColorMode == 2 ) { | 293 | if ( mColorMode == 2 ) { |
294 | mText +="<font color=\"#C00000\">"; | 294 | mText +="<font color=\"#C00000\">"; |
295 | } | 295 | } |
296 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 296 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
297 | if ( mode == 1 ) { | 297 | if ( mode == 1 ) { |
298 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 298 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
299 | } else { | 299 | } else { |
300 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 300 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
301 | } | 301 | } |
302 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 302 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
303 | if ( mColorMode ) | 303 | if ( mColorMode ) |
304 | mText += "</font>"; | 304 | mText += "</font>"; |
305 | } | 305 | } |
306 | mMailSubject += i18n( "Meeting " )+ event->summary(); | 306 | mMailSubject += i18n( "Meeting " )+ event->summary(); |
307 | if (event->cancelled ()) { | 307 | if (event->cancelled ()) { |
308 | mText +="<font color=\"#B00000\">"; | 308 | mText +="<font color=\"#B00000\">"; |
309 | addTag("i",i18n("This event has been cancelled!")); | 309 | addTag("i",i18n("This event has been cancelled!")); |
310 | mText.append("<br>"); | 310 | mText.append("<br>"); |
311 | mText += "</font>"; | 311 | mText += "</font>"; |
312 | mMailSubject += i18n("(cancelled)"); | 312 | mMailSubject += i18n("(cancelled)"); |
313 | } | 313 | } |
314 | if (!event->location().isEmpty()) { | 314 | |
315 | addTag("b",i18n("Location: ")); | ||
316 | mText.append(deTag(event->location())+"<br>"); | ||
317 | mMailSubject += i18n(" at ") + event->location(); | ||
318 | } | ||
319 | if (event->doesFloat()) { | 315 | if (event->doesFloat()) { |
320 | if (event->isMultiDay()) { | 316 | if (event->isMultiDay()) { |
321 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 317 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
322 | .arg(event->dtStartDateStr(shortDate)) | 318 | .arg(event->dtStartDateStr(shortDate)) |
323 | .arg(event->dtEndDateStr(shortDate))); | 319 | .arg(event->dtEndDateStr(shortDate))); |
324 | } else { | 320 | } else { |
325 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 321 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
326 | } | 322 | } |
327 | } else { | 323 | } else { |
328 | if (event->isMultiDay()) { | 324 | if (event->isMultiDay()) { |
329 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 325 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
330 | .arg(event->dtStartStr( shortDate))); | 326 | .arg(event->dtStartStr( shortDate))); |
331 | mText.append(i18n("<p><b>To:</b> %1</p>") | 327 | mText.append(i18n("<p><b>To:</b> %1</p>") |
332 | .arg(event->dtEndStr(shortDate))); | 328 | .arg(event->dtEndStr(shortDate))); |
333 | } else { | 329 | } else { |
334 | mText.append(i18n("<p><b>On:</b> %1</p> ") | ||
335 | .arg(event->dtStartDateStr( shortDate ))); | ||
336 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 330 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
337 | .arg(event->dtStartTimeStr()) | 331 | .arg(event->dtStartTimeStr()) |
338 | .arg(event->dtEndTimeStr())); | 332 | .arg(event->dtEndTimeStr())); |
333 | mText.append(i18n("<p><b>On:</b> %1</p> ") | ||
334 | .arg(event->dtStartDateStr( shortDate ))); | ||
339 | } | 335 | } |
340 | } | 336 | } |
341 | 337 | if (!event->location().isEmpty()) { | |
338 | addTag("b",i18n("Location: ")); | ||
339 | mText.append(deTag(event->location())+"<br>"); | ||
340 | mMailSubject += i18n(" at ") + event->location(); | ||
341 | } | ||
342 | if (event->recurrence()->doesRecur()) { | 342 | if (event->recurrence()->doesRecur()) { |
343 | 343 | ||
344 | QString recurText = event->recurrence()->recurrenceText(); | 344 | QString recurText = event->recurrence()->recurrenceText(); |
345 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 345 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
346 | bool ok; | 346 | bool ok; |
347 | QDate start = QDate::currentDate(); | 347 | QDate start = QDate::currentDate(); |
348 | QDateTime next; | 348 | QDateTime next; |
349 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); | 349 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
350 | if ( ok ) { | 350 | if ( ok ) { |
351 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 351 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
352 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); | 352 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
353 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); | 353 | mMailSubject += i18n(" - " )+ KGlobal::locale()->formatDateTime( next, true ); |
354 | 354 | ||
355 | } else { | 355 | } else { |
356 | bool last; | 356 | bool last; |
357 | QDate nextd; | 357 | QDate nextd; |
358 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); | 358 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); |
359 | if ( last ) { | 359 | if ( last ) { |
360 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 360 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
361 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | 361 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); |
362 | } | 362 | } |
363 | } | 363 | } |
364 | } else { | 364 | } else { |
365 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); | 365 | mMailSubject += i18n(" - " )+event->dtStartStr( true ); |
366 | 366 | ||
367 | } | 367 | } |
368 | 368 | ||
369 | 369 | ||
370 | if (event->isAlarmEnabled()) { | 370 | if (event->isAlarmEnabled()) { |
371 | Alarm *alarm =event->alarms().first() ; | 371 | Alarm *alarm =event->alarms().first() ; |
372 | QDateTime t = alarm->time(); | 372 | QDateTime t = alarm->time(); |
373 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 373 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
374 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 374 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
375 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 375 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
376 | //addTag("p",s); | 376 | //addTag("p",s); |
377 | } | 377 | } |
378 | 378 | ||
379 | addTag("b",i18n("Access: ")); | 379 | addTag("b",i18n("Access: ")); |
380 | mText.append(event->secrecyStr()+"<br>"); | 380 | mText.append(event->secrecyStr()+"<br>"); |
381 | 381 | ||
382 | 382 | ||
383 | if ( KOPrefs::instance()->mEVshowDetails ) { | 383 | |
384 | if (!event->description().isEmpty()) { | ||
385 | addTag("p",i18n("<b>Details: </b>")); | ||
386 | addTag("p",deTag(event->description())); | ||
387 | } | ||
388 | } | ||
389 | formatCategories(event); | 384 | formatCategories(event); |
390 | 385 | ||
391 | formatReadOnly(event); | 386 | formatReadOnly(event); |
392 | formatAttendees(event); | 387 | formatAttendees(event); |
393 | 388 | ||
394 | if ( KOPrefs::instance()->mEVshowCreated ) { | 389 | if ( KOPrefs::instance()->mEVshowCreated ) { |
390 | #ifdef DESKTOP_VERSION | ||
391 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
392 | #else | ||
395 | addTag("p",i18n("<b>Created: ") +" </b>"); | 393 | addTag("p",i18n("<b>Created: ") +" </b>"); |
396 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 394 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
395 | #endif | ||
397 | 396 | ||
398 | } | 397 | } |
399 | if ( KOPrefs::instance()->mEVshowChanged ) { | 398 | if ( KOPrefs::instance()->mEVshowChanged ) { |
399 | #ifdef DESKTOP_VERSION | ||
400 | addTag("p",i18n("<b>Last modified: ") +" </b>" + KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); | ||
401 | #else | ||
400 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | 402 | addTag("p",i18n("<b>Last modified: ") +" </b>"); |
401 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | 403 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); |
404 | #endif | ||
402 | 405 | ||
406 | } | ||
407 | if ( KOPrefs::instance()->mEVshowDetails ) { | ||
408 | if (!event->description().isEmpty()) { | ||
409 | addTag("p",i18n("<b>Details: </b>")); | ||
410 | addTag("p",deTag(event->description())); | ||
411 | } | ||
403 | } | 412 | } |
404 | setText(mText); | 413 | setText(mText); |
405 | //QWhatsThis::add(this,mText); | 414 | //QWhatsThis::add(this,mText); |
406 | 415 | ||
407 | } | 416 | } |
408 | 417 | ||
409 | void KOEventViewer::appendTodo(Todo *event, int mode ) | 418 | void KOEventViewer::appendTodo(Todo *event, int mode ) |
410 | { | 419 | { |
411 | mMailSubject = ""; | 420 | mMailSubject = ""; |
412 | mCurrentIncidence = event; | 421 | mCurrentIncidence = event; |
413 | topLevelWidget()->setCaption(i18n("Todo Viewer")); | 422 | topLevelWidget()->setCaption(i18n("Todo Viewer")); |
414 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 423 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
415 | if (mode == 0 ) | 424 | if (mode == 0 ) |
416 | addTag("h2",deTag(event->summary())); | 425 | addTag("h2",deTag(event->summary())); |
417 | else { | 426 | else { |
418 | if ( mColorMode == 1 ) { | 427 | if ( mColorMode == 1 ) { |
419 | mText +="<font color=\"#00A000\">"; | 428 | mText +="<font color=\"#00A000\">"; |
420 | } | 429 | } |
421 | if ( mColorMode == 2 ) { | 430 | if ( mColorMode == 2 ) { |
422 | mText +="<font color=\"#B00000\">"; | 431 | mText +="<font color=\"#B00000\">"; |
423 | } | 432 | } |
424 | if ( mode == 1 ) { | 433 | if ( mode == 1 ) { |
425 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 434 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
426 | } else { | 435 | } else { |
427 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 436 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
428 | } | 437 | } |
429 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 438 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
430 | if ( mColorMode ) | 439 | if ( mColorMode ) |
431 | mText += "</font>"; | 440 | mText += "</font>"; |
432 | } | 441 | } |
433 | mMailSubject += i18n( "Todo " )+ event->summary(); | 442 | mMailSubject += i18n( "Todo " )+ event->summary(); |
434 | 443 | ||
435 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 444 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
436 | mText +="<font color=\"#B00000\">"; | 445 | mText +="<font color=\"#B00000\">"; |
437 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); | 446 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(KOPrefs::instance()->mShortDateInViewer) ) ); |
438 | mText += "</font>"; | 447 | mText += "</font>"; |
439 | } else { | 448 | } else { |
440 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 449 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
441 | .arg(event->percentComplete())); | 450 | .arg(event->percentComplete())); |
442 | } | 451 | } |
443 | 452 | ||
444 | if (event->cancelled ()) { | 453 | if (event->cancelled ()) { |
445 | mText +="<font color=\"#B00000\">"; | 454 | mText +="<font color=\"#B00000\">"; |
446 | addTag("i",i18n("This todo has been cancelled!")); | 455 | addTag("i",i18n("This todo has been cancelled!")); |
447 | mText.append("<br>"); | 456 | mText.append("<br>"); |
448 | mText += "</font>"; | 457 | mText += "</font>"; |
449 | mMailSubject += i18n("(cancelled)"); | 458 | mMailSubject += i18n("(cancelled)"); |
450 | } | 459 | } |
451 | 460 | ||
452 | if (!event->location().isEmpty()) { | 461 | |
453 | addTag("b",i18n("Location: ")); | ||
454 | mText.append(deTag(event->location())+"<br>"); | ||
455 | mMailSubject += i18n(" at ") + event->location(); | ||
456 | } | ||
457 | 462 | ||
458 | if (event->recurrence()->doesRecur()) { | 463 | if (event->recurrence()->doesRecur()) { |
459 | 464 | ||
460 | QString recurText = event->recurrence()->recurrenceText(); | 465 | QString recurText = event->recurrence()->recurrenceText(); |
461 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | 466 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); |
462 | 467 | ||
463 | } | 468 | } |
464 | if (event->hasStartDate()) { | 469 | if (event->hasStartDate()) { |
465 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); | 470 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(KOPrefs::instance()->mShortDateInViewer))); |
466 | } | 471 | } |
467 | if (event->hasDueDate()) { | 472 | if (event->hasDueDate()) { |
468 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); | 473 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(KOPrefs::instance()->mShortDateInViewer))); |
469 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); | 474 | mMailSubject += i18n(" - " )+event->dtDueStr( true ); |
470 | } | 475 | } |
471 | 476 | if (!event->location().isEmpty()) { | |
477 | addTag("b",i18n("Location: ")); | ||
478 | mText.append(deTag(event->location())+"<br>"); | ||
479 | mMailSubject += i18n(" at ") + event->location(); | ||
480 | } | ||
481 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | ||
482 | .arg(QString::number(event->priority()))); | ||
472 | 483 | ||
473 | if (event->isAlarmEnabled()) { | 484 | if (event->isAlarmEnabled()) { |
474 | Alarm *alarm =event->alarms().first() ; | 485 | Alarm *alarm =event->alarms().first() ; |
475 | QDateTime t = alarm->time(); | 486 | QDateTime t = alarm->time(); |
476 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 487 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
477 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 488 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
478 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 489 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
479 | //addTag("p",s); | 490 | //addTag("p",s); |
480 | } | 491 | } |
481 | 492 | ||
482 | addTag("b",i18n("Access: ")); | 493 | addTag("b",i18n("Access: ")); |
483 | mText.append(event->secrecyStr()+"<br>"); | 494 | mText.append(event->secrecyStr()+"<br>"); |
484 | if ( KOPrefs::instance()->mEVshowDetails ) { | ||
485 | if (!event->description().isEmpty()) { | ||
486 | addTag("p",i18n("<b>Details: </b>")); | ||
487 | addTag("p",deTag(event->description())); | ||
488 | } | ||
489 | } | ||
490 | 495 | ||
491 | formatCategories(event); | 496 | formatCategories(event); |
492 | 497 | ||
493 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | ||
494 | .arg(QString::number(event->priority()))); | ||
495 | |||
496 | formatReadOnly(event); | 498 | formatReadOnly(event); |
497 | formatAttendees(event); | 499 | formatAttendees(event); |
500 | |||
501 | if ( KOPrefs::instance()->mEVshowCreated ) { | ||
502 | #ifdef DESKTOP_VERSION | ||
503 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
504 | #else | ||
505 | addTag("p",i18n("<b>Created: ") +" </b>"); | ||
506 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
507 | #endif | ||
508 | |||
509 | } | ||
510 | if ( KOPrefs::instance()->mEVshowChanged ) { | ||
511 | #ifdef DESKTOP_VERSION | ||
512 | addTag("p",i18n("<b>Last modified: ") +" </b>" +KGlobal::locale()->formatDateTime( event->lastModified(), shortDate ) ); | ||
513 | #else | ||
514 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | ||
515 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
516 | #endif | ||
517 | |||
518 | } | ||
498 | if ( event->relatedTo() ) { | 519 | if ( event->relatedTo() ) { |
499 | addTag("b",i18n("Parent todo:<br>")); | 520 | addTag("b",i18n("Parent todo:<br>")); |
500 | mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); | 521 | mText.append(deTag(event->relatedTo()->summary())+" [" +QString::number(event->relatedTo()->priority()) + "/" + QString::number(((Todo*)event->relatedTo())->percentComplete())+"%] <br>"); |
501 | } | 522 | } |
502 | QPtrList<Incidence> Relations = event->relations(); | 523 | QPtrList<Incidence> Relations = event->relations(); |
503 | Incidence *to; | 524 | Incidence *to; |
504 | if ( Relations.first() ) | 525 | if ( Relations.first() ) |
505 | addTag("b",i18n("Sub todos:<br>")); | 526 | addTag("b",i18n("Sub todos:<br>")); |
506 | for (to=Relations.first();to;to=Relations.next()) { | 527 | for (to=Relations.first();to;to=Relations.next()) { |
507 | mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); | 528 | mText.append( deTag(to->summary())+" [" +QString::number(to->priority()) + "/" + QString::number(((Todo*)to)->percentComplete())+"%]<br>"); |
508 | 529 | ||
509 | } | 530 | } |
510 | if ( KOPrefs::instance()->mEVshowCreated ) { | 531 | |
511 | addTag("p",i18n("<b>Created: ") +" </b>"); | 532 | if ( KOPrefs::instance()->mEVshowDetails ) { |
512 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 533 | if (!event->description().isEmpty()) { |
513 | 534 | addTag("p",i18n("<b>Details: </b>")); | |
514 | } | 535 | addTag("p",deTag(event->description())); |
515 | if ( KOPrefs::instance()->mEVshowChanged ) { | 536 | } |
516 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | ||
517 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
518 | |||
519 | } | 537 | } |
520 | setText(mText); | 538 | setText(mText); |
521 | } | 539 | } |
522 | 540 | ||
523 | void KOEventViewer::formatCategories(Incidence *event) | 541 | void KOEventViewer::formatCategories(Incidence *event) |
524 | { | 542 | { |
525 | if (!event->categoriesStr().isEmpty()) { | 543 | if (!event->categoriesStr().isEmpty()) { |
526 | if (event->categories().count() == 1) { | 544 | if (event->categories().count() == 1) { |
527 | addTag("h3",i18n("Category")); | 545 | addTag("h3",i18n("Category")); |
528 | } else { | 546 | } else { |
529 | addTag("h3",i18n("Categories")); | 547 | addTag("h3",i18n("Categories")); |
530 | } | 548 | } |
531 | addTag("p",event->categoriesStr()); | 549 | addTag("p",event->categoriesStr()); |
532 | } | 550 | } |
533 | } | 551 | } |
534 | void KOEventViewer::formatAttendees(Incidence *event) | 552 | void KOEventViewer::formatAttendees(Incidence *event) |
535 | { | 553 | { |
536 | QPtrList<Attendee> attendees = event->attendees(); | 554 | QPtrList<Attendee> attendees = event->attendees(); |
537 | if (attendees.count()) { | 555 | if (attendees.count()) { |
538 | 556 | ||
539 | 557 | ||
540 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 558 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
541 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 559 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
542 | addTag("h3",i18n("Organizer")); | 560 | addTag("h3",i18n("Organizer")); |
543 | mText.append("<ul><li>"); | 561 | mText.append("<ul><li>"); |
544 | #ifndef KORG_NOKABC | 562 | #ifndef KORG_NOKABC |
545 | 563 | ||
546 | #ifdef DESKTOP_VERSION | 564 | #ifdef DESKTOP_VERSION |
547 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 565 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
548 | KABC::Addressee::List addressList; | 566 | KABC::Addressee::List addressList; |
549 | addressList = add_book->findByEmail(event->organizer()); | 567 | addressList = add_book->findByEmail(event->organizer()); |
550 | KABC::Addressee o = addressList.first(); | 568 | KABC::Addressee o = addressList.first(); |
551 | if (!o.isEmpty() && addressList.size()<2) { | 569 | if (!o.isEmpty() && addressList.size()<2) { |
552 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 570 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
553 | mText += o.formattedName(); | 571 | mText += o.formattedName(); |
554 | mText += "</a>\n"; | 572 | mText += "</a>\n"; |
555 | } else { | 573 | } else { |
556 | mText.append(event->organizer()); | 574 | mText.append(event->organizer()); |
557 | } | 575 | } |
558 | #else //DESKTOP_VERSION | 576 | #else //DESKTOP_VERSION |
559 | mText += "<a href=\"uid:organizer\">"; | 577 | mText += "<a href=\"uid:organizer\">"; |
560 | mText += event->organizer(); | 578 | mText += event->organizer(); |
561 | mText += "</a>\n"; | 579 | mText += "</a>\n"; |
562 | #endif //DESKTOP_VERSION | 580 | #endif //DESKTOP_VERSION |
563 | 581 | ||
564 | 582 | ||
565 | #else | 583 | #else |
566 | mText.append(event->organizer()); | 584 | mText.append(event->organizer()); |
567 | #endif | 585 | #endif |
568 | 586 | ||
569 | if (iconPath) { | 587 | if (iconPath) { |
570 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; | 588 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; |
571 | mText += "<IMG src=\"" + iconPath + "\">"; | 589 | mText += "<IMG src=\"" + iconPath + "\">"; |
572 | mText += "</a>\n"; | 590 | mText += "</a>\n"; |
573 | } | 591 | } |
574 | mText.append("</li></ul>"); | 592 | mText.append("</li></ul>"); |
575 | 593 | ||
576 | addTag("h3",i18n("Attendees")); | 594 | addTag("h3",i18n("Attendees")); |
577 | Attendee *a; | 595 | Attendee *a; |
578 | mText.append("<ul>"); | 596 | mText.append("<ul>"); |
579 | int a_count = 0; | 597 | int a_count = 0; |
580 | int a_count_nr = 0; | 598 | int a_count_nr = 0; |
581 | 599 | ||
582 | for(a=attendees.first();a;a=attendees.next()) { | 600 | for(a=attendees.first();a;a=attendees.next()) { |
583 | #ifndef KORG_NOKABC | 601 | #ifndef KORG_NOKABC |
584 | #ifdef DESKTOP_VERSION | 602 | #ifdef DESKTOP_VERSION |
585 | if (a->name().isEmpty()) { | 603 | if (a->name().isEmpty()) { |
586 | addressList = add_book->findByEmail(a->email()); | 604 | addressList = add_book->findByEmail(a->email()); |
587 | KABC::Addressee o = addressList.first(); | 605 | KABC::Addressee o = addressList.first(); |
588 | if (!o.isEmpty() && addressList.size()<2) { | 606 | if (!o.isEmpty() && addressList.size()<2) { |
589 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 607 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
590 | mText += o.formattedName(); | 608 | mText += o.formattedName(); |
591 | mText += "</a>\n"; | 609 | mText += "</a>\n"; |
592 | } else { | 610 | } else { |
593 | mText += "<li>"; | 611 | mText += "<li>"; |
594 | mText.append(a->email()); | 612 | mText.append(a->email()); |
595 | mText += "\n"; | 613 | mText += "\n"; |
596 | } | 614 | } |
597 | } else { | 615 | } else { |
598 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 616 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
599 | if (!a->name().isEmpty()) mText += a->name(); | 617 | if (!a->name().isEmpty()) mText += a->name(); |
600 | else mText += a->email(); | 618 | else mText += a->email(); |
601 | mText += "</a>\n"; | 619 | mText += "</a>\n"; |
602 | } | 620 | } |
603 | #else //DESKTOP_VERSION | 621 | #else //DESKTOP_VERSION |
604 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 622 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
605 | if (!a->name().isEmpty()) mText += a->name(); | 623 | if (!a->name().isEmpty()) mText += a->name(); |
606 | else mText += a->email(); | 624 | else mText += a->email(); |
607 | mText += "</a>\n"; | 625 | mText += "</a>\n"; |
608 | #endif //DESKTOP_VERSION | 626 | #endif //DESKTOP_VERSION |
609 | #else | 627 | #else |
610 | //qDebug("nokabc "); | 628 | //qDebug("nokabc "); |
611 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 629 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
612 | if (!a->name().isEmpty()) mText += a->name(); | 630 | if (!a->name().isEmpty()) mText += a->name(); |
613 | else mText += a->email(); | 631 | else mText += a->email(); |
614 | mText += "</a>\n"; | 632 | mText += "</a>\n"; |
615 | #endif | 633 | #endif |
616 | 634 | ||
617 | 635 | ||
618 | if (!a->email().isEmpty()) { | 636 | if (!a->email().isEmpty()) { |
619 | if (iconPath) { | 637 | if (iconPath) { |
620 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; | 638 | mText += "<a href=\"mailto:" + a->name() +" <" + a->email() + ">:" + mMailSubject + "\">"; |
621 | if ( a->RSVP() ) { | 639 | if ( a->RSVP() ) { |
622 | ++a_count_nr; | 640 | ++a_count_nr; |
623 | mText += "<IMG src=\"" + iconPath + "\">"; | 641 | mText += "<IMG src=\"" + iconPath + "\">"; |
624 | } | 642 | } |
625 | else { | 643 | else { |
626 | ++a_count; | 644 | ++a_count; |
627 | mText += "<IMG src=\"" + NOiconPath + "\">"; | 645 | mText += "<IMG src=\"" + NOiconPath + "\">"; |
628 | } | 646 | } |
629 | mText += "</a>\n"; | 647 | mText += "</a>\n"; |
630 | } | 648 | } |
631 | } | 649 | } |
632 | if (a->status() != Attendee::NeedsAction ) | 650 | if (a->status() != Attendee::NeedsAction ) |
633 | mText +="[" + a->statusStr() + "] "; | 651 | mText +="[" + a->statusStr() + "] "; |
634 | if (a->role() == Attendee::Chair ) | 652 | if (a->role() == Attendee::Chair ) |
635 | mText +="(" + a->roleStr().left(1) + ".)"; | 653 | mText +="(" + a->roleStr().left(1) + ".)"; |
636 | } | 654 | } |
637 | mText.append("</li></ul>"); | 655 | mText.append("</li></ul>"); |
638 | if ( (a_count+a_count_nr) > 1 ) { | 656 | if ( (a_count+a_count_nr) > 1 ) { |
639 | mText += "<a href=\"mailto:ALL\">"; | 657 | mText += "<a href=\"mailto:ALL\">"; |
640 | mText += i18n( "Mail to all" ); | 658 | mText += i18n( "Mail to all" ); |
641 | mText += "</a> ( "; | 659 | mText += "</a> ( "; |
642 | mText += "<IMG src=\"" + iconPath + "\">"; | 660 | mText += "<IMG src=\"" + iconPath + "\">"; |
643 | mText += i18n( " and " ); | 661 | mText += i18n( " and " ); |
644 | mText += "<IMG src=\"" + NOiconPath + "\"> )"; | 662 | mText += "<IMG src=\"" + NOiconPath + "\"> )"; |
645 | mText += "<br>\n"; | 663 | mText += "<br>\n"; |
646 | 664 | ||
647 | 665 | ||
648 | } | 666 | } |
649 | if ( a_count_nr > 1 ) { | 667 | if ( a_count_nr > 1 ) { |
650 | mText += "<a href=\"mailto:RSVP\">"; | 668 | mText += "<a href=\"mailto:RSVP\">"; |
651 | mText += i18n( "Mail to selected" ); | 669 | mText += i18n( "Mail to selected" ); |
652 | mText += "</a> ( "; | 670 | mText += "</a> ( "; |
653 | mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); | 671 | mText += i18n( "<IMG src=\"%1\"> only )").arg ( iconPath ); |
654 | mText += "<br>\n"; | 672 | mText += "<br>\n"; |
655 | } | 673 | } |
656 | } | 674 | } |
657 | 675 | ||
658 | } | 676 | } |
659 | void KOEventViewer::appendJournal(Journal *jour, int mode ) | 677 | void KOEventViewer::appendJournal(Journal *jour, int mode ) |
660 | { | 678 | { |
661 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; | 679 | bool shortDate = KOPrefs::instance()->mShortDateInViewer; |
662 | if (mode == 0 ) { | 680 | if (mode == 0 ) { |
663 | addTag("h2",i18n("Journal from: ")); | 681 | addTag("h2",i18n("Journal from: ")); |
664 | } | 682 | } |
665 | else { | 683 | else { |
666 | if ( mode == 1 ) { | 684 | if ( mode == 1 ) { |
667 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); | 685 | addTag("h2",i18n( "Local: " ) +i18n("Journal from: ")); |
668 | } else { | 686 | } else { |
669 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); | 687 | addTag("h2",i18n( "Remote: " ) +i18n("Journal from: ")); |
670 | } | 688 | } |
671 | } | 689 | } |
672 | topLevelWidget()->setCaption("Journal Viewer"); | 690 | topLevelWidget()->setCaption("Journal Viewer"); |
673 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); | 691 | mText.append(i18n("<h3> %1 </h3> ").arg(jour->dtStartDateStr(KOPrefs::instance()->mShortDateInViewer))); |
674 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); | 692 | addTag("b",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(jour->lastModified(),shortDate ) ); |
675 | if (!jour->description().isEmpty()) { | 693 | if (!jour->description().isEmpty()) { |
676 | addTag("p",deTag(jour->description())); | 694 | addTag("p",deTag(jour->description())); |
677 | } | 695 | } |
678 | setText(mText); | 696 | setText(mText); |
679 | } | 697 | } |
680 | 698 | ||
681 | void KOEventViewer::formatReadOnly(Incidence *event) | 699 | void KOEventViewer::formatReadOnly(Incidence *event) |
682 | { | 700 | { |
683 | if (event->isReadOnly()) { | 701 | if (event->isReadOnly()) { |
684 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); | 702 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); |
685 | } | 703 | } |
686 | } | 704 | } |
687 | void KOEventViewer::setSyncMode( bool b ) | 705 | void KOEventViewer::setSyncMode( bool b ) |
688 | { | 706 | { |
689 | mSyncMode = b; | 707 | mSyncMode = b; |
690 | } | 708 | } |
691 | 709 | ||
692 | void KOEventViewer::setTodo(Todo *event, bool clearV ) | 710 | void KOEventViewer::setTodo(Todo *event, bool clearV ) |
693 | { | 711 | { |
694 | if ( clearV ) | 712 | if ( clearV ) |
695 | clearEvents(); | 713 | clearEvents(); |
696 | if ( mSyncMode ) { | 714 | if ( mSyncMode ) { |
697 | if ( clearV ) | 715 | if ( clearV ) |
698 | appendTodo(event,1 ); | 716 | appendTodo(event,1 ); |
699 | else | 717 | else |
700 | appendTodo(event,2); | 718 | appendTodo(event,2); |
701 | } else | 719 | } else |
702 | appendTodo(event); | 720 | appendTodo(event); |
703 | } | 721 | } |
704 | void KOEventViewer::setJournal(Journal *event, bool clearV ) | 722 | void KOEventViewer::setJournal(Journal *event, bool clearV ) |
705 | { | 723 | { |
706 | if ( clearV ) | 724 | if ( clearV ) |
707 | clearEvents(); | 725 | clearEvents(); |
708 | if ( mSyncMode ) { | 726 | if ( mSyncMode ) { |
709 | if ( clearV ) | 727 | if ( clearV ) |
710 | appendJournal(event, 1); | 728 | appendJournal(event, 1); |
711 | else | 729 | else |
712 | appendJournal(event, 2); | 730 | appendJournal(event, 2); |
713 | } else | 731 | } else |
714 | appendJournal(event); | 732 | appendJournal(event); |
715 | } | 733 | } |
716 | 734 | ||
717 | void KOEventViewer::setEvent(Event *event) | 735 | void KOEventViewer::setEvent(Event *event) |
718 | { | 736 | { |
719 | clearEvents(); | 737 | clearEvents(); |
720 | if ( mSyncMode ) | 738 | if ( mSyncMode ) |
721 | appendEvent(event, 1); | 739 | appendEvent(event, 1); |
722 | else | 740 | else |
723 | appendEvent(event); | 741 | appendEvent(event); |
724 | } | 742 | } |
725 | 743 | ||
726 | void KOEventViewer::addEvent(Event *event) | 744 | void KOEventViewer::addEvent(Event *event) |
727 | { | 745 | { |
728 | if ( mSyncMode ) | 746 | if ( mSyncMode ) |
729 | appendEvent(event, 2); | 747 | appendEvent(event, 2); |
730 | else | 748 | else |
731 | appendEvent(event); | 749 | appendEvent(event); |
732 | } | 750 | } |
733 | 751 | ||
734 | void KOEventViewer::clearEvents(bool now) | 752 | void KOEventViewer::clearEvents(bool now) |
735 | { | 753 | { |
736 | mText = ""; | 754 | mText = ""; |
737 | if (now) setText(mText); | 755 | if (now) setText(mText); |
738 | } | 756 | } |
739 | 757 | ||
740 | void KOEventViewer::addText(QString text) | 758 | void KOEventViewer::addText(QString text) |
741 | { | 759 | { |
742 | mText.append(text); | 760 | mText.append(text); |
743 | setText(mText); | 761 | setText(mText); |
744 | } | 762 | } |
745 | QString KOEventViewer::deTag(QString text) | 763 | QString KOEventViewer::deTag(QString text) |
746 | { | 764 | { |
747 | #if QT_VERSION >= 0x030000 | 765 | #if QT_VERSION >= 0x030000 |
748 | text.replace( '<' , "<" ); | 766 | text.replace( '<' , "<" ); |
749 | text.replace( '>' , ">" ); | 767 | text.replace( '>' , ">" ); |
750 | #else | 768 | #else |
751 | if ( text.find ('<') >= 0 ) { | 769 | if ( text.find ('<') >= 0 ) { |
752 | text.replace( QRegExp("<") , "<" ); | 770 | text.replace( QRegExp("<") , "<" ); |
753 | } | 771 | } |
754 | if ( text.find ('>') >= 0 ) { | 772 | if ( text.find ('>') >= 0 ) { |
755 | text.replace( QRegExp(">") , ">" ); | 773 | text.replace( QRegExp(">") , ">" ); |
756 | } | 774 | } |
757 | #endif | 775 | #endif |
758 | return text; | 776 | return text; |
759 | } | 777 | } |
760 | void KOEventViewer::keyPressEvent ( QKeyEvent * e ) | 778 | void KOEventViewer::keyPressEvent ( QKeyEvent * e ) |
761 | { | 779 | { |
762 | switch ( e->key() ) { | 780 | switch ( e->key() ) { |
763 | case Qt::Key_Return: | 781 | case Qt::Key_Return: |
764 | case Qt::Key_Enter : | 782 | case Qt::Key_Enter : |
765 | e->ignore(); | 783 | e->ignore(); |
766 | break; | 784 | break; |
767 | default: | 785 | default: |
768 | QTextBrowser::keyPressEvent ( e ); | 786 | QTextBrowser::keyPressEvent ( e ); |
769 | break; | 787 | break; |
770 | } | 788 | } |
771 | } | 789 | } |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 65d6acf..b175f9a 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -261,902 +261,903 @@ void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) | |||
261 | break; | 261 | break; |
262 | default: | 262 | default: |
263 | break; | 263 | break; |
264 | } | 264 | } |
265 | } | 265 | } |
266 | 266 | ||
267 | void KNoScrollListBox::mousePressEvent(QMouseEvent *e) | 267 | void KNoScrollListBox::mousePressEvent(QMouseEvent *e) |
268 | { | 268 | { |
269 | QListBox::mousePressEvent(e); | 269 | QListBox::mousePressEvent(e); |
270 | 270 | ||
271 | if(e->button() == RightButton) { | 271 | if(e->button() == RightButton) { |
272 | emit rightClick(); | 272 | emit rightClick(); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | 275 | ||
276 | MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) | 276 | MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) |
277 | : QListBoxItem() | 277 | : QListBoxItem() |
278 | { | 278 | { |
279 | mblockRepaint = true; | 279 | mblockRepaint = true; |
280 | setText( s ); | 280 | setText( s ); |
281 | mMultiday = 0; | 281 | mMultiday = 0; |
282 | mIncidence = incidence; | 282 | mIncidence = incidence; |
283 | mDate = qd; | 283 | mDate = qd; |
284 | mRecur = false; | 284 | mRecur = false; |
285 | mAlarm = false; | 285 | mAlarm = false; |
286 | mReply = false; | 286 | mReply = false; |
287 | mInfo = false; | 287 | mInfo = false; |
288 | mdayPos = 0; | 288 | mdayPos = 0; |
289 | isWeekItem = KOPrefs::instance()->mMonthViewWeek; | 289 | isWeekItem = KOPrefs::instance()->mMonthViewWeek; |
290 | //qDebug("NEWWWWWWWWWWWWW "); | 290 | //qDebug("NEWWWWWWWWWWWWW "); |
291 | } | 291 | } |
292 | void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) | 292 | void MonthViewItem::recycle( Incidence *incidence, QDate qd, const QString & s) |
293 | { | 293 | { |
294 | setText( s ); | 294 | setText( s ); |
295 | mMultiday = 0; | 295 | mMultiday = 0; |
296 | mIncidence = incidence; | 296 | mIncidence = incidence; |
297 | mDate = qd; | 297 | mDate = qd; |
298 | mRecur = false; | 298 | mRecur = false; |
299 | mAlarm = false; | 299 | mAlarm = false; |
300 | mReply = false; | 300 | mReply = false; |
301 | mInfo = false; | 301 | mInfo = false; |
302 | mdayPos = 0; | 302 | mdayPos = 0; |
303 | //qDebug("recucleeeeeeeeeeeeeeeee "); | 303 | //qDebug("recucleeeeeeeeeeeeeeeee "); |
304 | } | 304 | } |
305 | 305 | ||
306 | void MonthViewItem::paint(QPainter *p) | 306 | void MonthViewItem::paint(QPainter *p) |
307 | { | 307 | { |
308 | if ( mblockRepaint ) { | 308 | if ( mblockRepaint ) { |
309 | //qDebug("block "); | 309 | //qDebug("block "); |
310 | return; | 310 | return; |
311 | } | 311 | } |
312 | //qDebug("NON block "); | 312 | //qDebug("NON block "); |
313 | #if QT_VERSION >= 0x030000 | 313 | #if QT_VERSION >= 0x030000 |
314 | bool sel = isSelected(); | 314 | bool sel = isSelected(); |
315 | #else | 315 | #else |
316 | bool sel = selected(); | 316 | bool sel = selected(); |
317 | #endif | 317 | #endif |
318 | 318 | ||
319 | 319 | ||
320 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) | 320 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) |
321 | { | 321 | { |
322 | p->setBackgroundColor( palette().color( QPalette::Normal, \ | 322 | p->setBackgroundColor( palette().color( QPalette::Normal, \ |
323 | sel ? QColorGroup::Highlight : QColorGroup::Background ) ); | 323 | sel ? QColorGroup::Highlight : QColorGroup::Background ) ); |
324 | p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) ); | 324 | p->eraseRect( 0, 0, listBox()->maxItemWidth(), height( listBox() ) ); |
325 | } | 325 | } |
326 | int x = 1; | 326 | int x = 1; |
327 | //int y = 3;//(height() - mRecurPixmap.height()) /2; | 327 | //int y = 3;//(height() - mRecurPixmap.height()) /2; |
328 | int size = PIXMAP_SIZE; | 328 | int size = PIXMAP_SIZE; |
329 | if ( QApplication::desktop()->width() < 300 ) | 329 | if ( QApplication::desktop()->width() < 300 ) |
330 | size = 3; | 330 | size = 3; |
331 | int heihei = height( listBox () ); | 331 | int heihei = height( listBox () ); |
332 | int y = (heihei - size -1 ) /2; | 332 | int y = (heihei - size -1 ) /2; |
333 | 333 | ||
334 | if ( KOPrefs::instance()->mMonthShowIcons ) { | 334 | if ( KOPrefs::instance()->mMonthShowIcons ) { |
335 | if ( mInfo ) { | 335 | if ( mInfo ) { |
336 | p->fillRect ( x, y,size,size, Qt::darkGreen ); | 336 | p->fillRect ( x, y,size,size, Qt::darkGreen ); |
337 | x += size + 1; | 337 | x += size + 1; |
338 | } | 338 | } |
339 | if ( mRecur ) { | 339 | if ( mRecur ) { |
340 | p->fillRect ( x, y,size,size, Qt::blue ); | 340 | p->fillRect ( x, y,size,size, Qt::blue ); |
341 | x += size + 1; | 341 | x += size + 1; |
342 | } | 342 | } |
343 | if ( mAlarm ) { | 343 | if ( mAlarm ) { |
344 | p->fillRect ( x, y,size,size, Qt::red ); | 344 | p->fillRect ( x, y,size,size, Qt::red ); |
345 | x += size + 1; | 345 | x += size + 1; |
346 | } | 346 | } |
347 | if ( mReply ) { | 347 | if ( mReply ) { |
348 | p->fillRect ( x, y,size,size, Qt::yellow ); | 348 | p->fillRect ( x, y,size,size, Qt::yellow ); |
349 | x += size + 1; | 349 | x += size + 1; |
350 | } | 350 | } |
351 | } | 351 | } |
352 | if ( mMultiday ) { | 352 | if ( mMultiday ) { |
353 | int yyy = y+(size/2); | 353 | int yyy = y+(size/2); |
354 | int sizeM = size+2; | 354 | int sizeM = size+2; |
355 | p->setBrush( QBrush::SolidPattern ); | 355 | p->setBrush( QBrush::SolidPattern ); |
356 | p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; | 356 | p->drawLine ( x+1, yyy, x +sizeM +sizeM/2-1, yyy ) ; |
357 | if ( mMultiday == 2 || mMultiday == 3 ) { | 357 | if ( mMultiday == 2 || mMultiday == 3 ) { |
358 | QPointArray pa ( 3 ); | 358 | QPointArray pa ( 3 ); |
359 | pa.setPoint (0, x, yyy ); | 359 | pa.setPoint (0, x, yyy ); |
360 | pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); | 360 | pa.setPoint (1, x+sizeM/2, yyy+sizeM/2 ); |
361 | pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); | 361 | pa.setPoint (2, x+sizeM/2, yyy-sizeM/2 ); |
362 | p->drawPolygon( pa ); | 362 | p->drawPolygon( pa ); |
363 | } | 363 | } |
364 | if ( mMultiday == 2 || mMultiday == 1 ) { | 364 | if ( mMultiday == 2 || mMultiday == 1 ) { |
365 | QPointArray pa ( 3 ); | 365 | QPointArray pa ( 3 ); |
366 | pa.setPoint (0, x+sizeM +sizeM/2, yyy ); | 366 | pa.setPoint (0, x+sizeM +sizeM/2, yyy ); |
367 | pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); | 367 | pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); |
368 | pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); | 368 | pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); |
369 | p->drawPolygon( pa ); | 369 | p->drawPolygon( pa ); |
370 | } | 370 | } |
371 | if ( mMultiday == 1 ) { | 371 | if ( mMultiday == 1 ) { |
372 | // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); | 372 | // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); |
373 | 373 | ||
374 | p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 ); | 374 | p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 ); |
375 | } | 375 | } |
376 | if ( mMultiday == 3 ) { | 376 | if ( mMultiday == 3 ) { |
377 | // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); | 377 | // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); |
378 | p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 ); | 378 | p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 ); |
379 | 379 | ||
380 | } | 380 | } |
381 | x += sizeM/2 + 1; | 381 | x += sizeM/2 + 1; |
382 | x += sizeM + 1; | 382 | x += sizeM + 1; |
383 | } | 383 | } |
384 | 384 | ||
385 | if ( mIncidence->type() == "Todo" ){ | 385 | if ( mIncidence->type() == "Todo" ){ |
386 | Todo* td = ( Todo* ) mIncidence; | 386 | Todo* td = ( Todo* ) mIncidence; |
387 | if ( td->isCompleted() ) { | 387 | if ( td->isCompleted() ) { |
388 | int half = size/2; | 388 | int half = size/2; |
389 | p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; | 389 | p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; |
390 | p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; | 390 | p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; |
391 | x += half+half + 4; | 391 | x += half+half + 4; |
392 | 392 | ||
393 | } else { | 393 | } else { |
394 | int val = td->percentComplete()/20; | 394 | int val = td->percentComplete()/20; |
395 | p->fillRect ( x+1, y-2, val ,size+4,Qt::black ); | 395 | p->fillRect ( x+1, y-2, val ,size+4,Qt::black ); |
396 | p->drawRect ( x, y-2,7,size+4); | 396 | p->drawRect ( x, y-2,7,size+4); |
397 | x += size + 3; | 397 | x += size + 3; |
398 | } | 398 | } |
399 | } | 399 | } |
400 | QFontMetrics fm = p->fontMetrics(); | 400 | QFontMetrics fm = p->fontMetrics(); |
401 | int yPos; | 401 | int yPos; |
402 | int pmheight = size; | 402 | int pmheight = size; |
403 | if( pmheight < fm.height() ) | 403 | if( pmheight < fm.height() ) |
404 | yPos = fm.ascent() + fm.leading()/2; | 404 | yPos = fm.ascent() + fm.leading()/2; |
405 | else | 405 | else |
406 | yPos = pmheight/2 - fm.height()/2 + fm.ascent(); | 406 | yPos = pmheight/2 - fm.height()/2 + fm.ascent(); |
407 | p->setPen( palette().color( QPalette::Normal, sel ? \ | 407 | p->setPen( palette().color( QPalette::Normal, sel ? \ |
408 | QColorGroup::HighlightedText : QColorGroup::Foreground ) ); | 408 | QColorGroup::HighlightedText : QColorGroup::Foreground ) ); |
409 | p->drawText( x, yPos, text() ); | 409 | p->drawText( x, yPos, text() ); |
410 | if ( mIncidence->cancelled() ) { | 410 | if ( mIncidence->cancelled() ) { |
411 | int wid = fm.width( text() ); | 411 | int wid = fm.width( text() ); |
412 | p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); | 412 | p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); |
413 | } | 413 | } |
414 | 414 | ||
415 | } | 415 | } |
416 | 416 | ||
417 | int MonthViewItem::height(const QListBox *lb) const | 417 | int MonthViewItem::height(const QListBox *lb) const |
418 | { | 418 | { |
419 | int ret = 10; | 419 | int ret = 10; |
420 | if ( lb ) | 420 | if ( lb ) |
421 | ret = lb->fontMetrics().lineSpacing()+1; | 421 | ret = lb->fontMetrics().lineSpacing()+1; |
422 | return ret; | 422 | return ret; |
423 | } | 423 | } |
424 | 424 | ||
425 | int MonthViewItem::width(const QListBox *lb) const | 425 | int MonthViewItem::width(const QListBox *lb) const |
426 | { | 426 | { |
427 | if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { | 427 | if( KOPrefs::instance()->mEnableMonthScroll || isWeekItem ) { |
428 | int size = PIXMAP_SIZE; | 428 | int size = PIXMAP_SIZE; |
429 | if ( QApplication::desktop()->width() < 300 ) | 429 | if ( QApplication::desktop()->width() < 300 ) |
430 | size = 3; | 430 | size = 3; |
431 | int x = 1; | 431 | int x = 1; |
432 | if ( KOPrefs::instance()->mMonthShowIcons ) { | 432 | if ( KOPrefs::instance()->mMonthShowIcons ) { |
433 | if ( mInfo ) { | 433 | if ( mInfo ) { |
434 | x += size + 1; | 434 | x += size + 1; |
435 | } | 435 | } |
436 | if( mRecur ) { | 436 | if( mRecur ) { |
437 | x += size+1; | 437 | x += size+1; |
438 | } | 438 | } |
439 | if( mAlarm ) { | 439 | if( mAlarm ) { |
440 | x += size+1; | 440 | x += size+1; |
441 | } | 441 | } |
442 | if( mReply ) { | 442 | if( mReply ) { |
443 | x += size+1; | 443 | x += size+1; |
444 | } | 444 | } |
445 | } | 445 | } |
446 | if( mMultiday ) { | 446 | if( mMultiday ) { |
447 | x += size+1+2+size/2; | 447 | x += size+1+2+size/2; |
448 | } | 448 | } |
449 | return( x + lb->fontMetrics().width( text() ) + 1 ); | 449 | return( x + lb->fontMetrics().width( text() ) + 1 ); |
450 | } | 450 | } |
451 | if ( ! lb ) | 451 | if ( ! lb ) |
452 | return 10; | 452 | return 10; |
453 | //qDebug("ret wid %d ", lb->width()); | 453 | //qDebug("ret wid %d ", lb->width()); |
454 | return lb->width(); | 454 | return lb->width(); |
455 | } | 455 | } |
456 | 456 | ||
457 | 457 | ||
458 | MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) | 458 | MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) |
459 | : KNoScrollListBox( par ), | 459 | : KNoScrollListBox( par ), |
460 | mMonthView( parent ) | 460 | mMonthView( parent ) |
461 | { | 461 | { |
462 | //QVBoxLayout *topLayout = new QVBoxLayout( this ); | 462 | //QVBoxLayout *topLayout = new QVBoxLayout( this ); |
463 | currentPalette = 0; | 463 | currentPalette = 0; |
464 | // mLabel = new QLabel( this );QPushButton | 464 | // mLabel = new QLabel( this );QPushButton |
465 | mLabel = new QPushButton( this ); | 465 | mLabel = new QPushButton( this ); |
466 | //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); | 466 | //mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain ); |
467 | //mLabel->setLineWidth( 1 ); | 467 | //mLabel->setLineWidth( 1 ); |
468 | //mLabel->setAlignment( AlignCenter ); | 468 | //mLabel->setAlignment( AlignCenter ); |
469 | mLabel->setFlat( true ); | 469 | mLabel->setFlat( true ); |
470 | mLabel->setFocusPolicy(NoFocus); | 470 | mLabel->setFocusPolicy(NoFocus); |
471 | //mItemList = new KNoScrollListBox( this ); | 471 | //mItemList = new KNoScrollListBox( this ); |
472 | setMinimumSize( 10, 10 ); | 472 | setMinimumSize( 10, 10 ); |
473 | setFrameStyle( QFrame::Panel | QFrame::Plain ); | 473 | setFrameStyle( QFrame::Panel | QFrame::Plain ); |
474 | setLineWidth( 1 ); | 474 | setLineWidth( 1 ); |
475 | //topLayout->addWidget( mItemList ); | 475 | //topLayout->addWidget( mItemList ); |
476 | mLabel->raise(); | 476 | mLabel->raise(); |
477 | // QColor( 0,0,255 ) QColor( 160,1600,255 ) | 477 | // QColor( 0,0,255 ) QColor( 160,1600,255 ) |
478 | mStandardPalette = palette(); | 478 | mStandardPalette = palette(); |
479 | mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); | 479 | mStandardPalette.setColor(QColorGroup::Base, mStandardPalette.color( QPalette::Normal, QColorGroup::Background ) ); |
480 | 480 | ||
481 | enableScrollBars( false ); | 481 | enableScrollBars( false ); |
482 | updateConfig(); | 482 | updateConfig(); |
483 | //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); | 483 | //connect( mLabel, SIGNAL( clicked( )), SLOT( newEvent() )); |
484 | connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); | 484 | connect( mLabel, SIGNAL( clicked( )), SLOT( showDay() )); |
485 | connect( this , SIGNAL( doubleClicked( QListBoxItem *) ), | 485 | connect( this , SIGNAL( doubleClicked( QListBoxItem *) ), |
486 | SLOT( defaultAction( QListBoxItem * ) ) ); | 486 | SLOT( defaultAction( QListBoxItem * ) ) ); |
487 | connect( this, SIGNAL( rightButtonPressed( QListBoxItem *, | 487 | connect( this, SIGNAL( rightButtonPressed( QListBoxItem *, |
488 | const QPoint &) ), | 488 | const QPoint &) ), |
489 | SLOT( contextMenu( QListBoxItem * ) ) ); | 489 | SLOT( contextMenu( QListBoxItem * ) ) ); |
490 | connect( this, SIGNAL( highlighted( QListBoxItem *) ), | 490 | connect( this, SIGNAL( highlighted( QListBoxItem *) ), |
491 | SLOT( selection( QListBoxItem * ) ) ); | 491 | SLOT( selection( QListBoxItem * ) ) ); |
492 | 492 | ||
493 | /* | 493 | /* |
494 | connect( this, SIGNAL( clicked( QListBoxItem * ) ), | 494 | connect( this, SIGNAL( clicked( QListBoxItem * ) ), |
495 | SLOT( selection( QListBoxItem * ) ) ); | 495 | SLOT( selection( QListBoxItem * ) ) ); |
496 | */ | 496 | */ |
497 | } | 497 | } |
498 | #ifdef DESKTOP_VERSION | 498 | #ifdef DESKTOP_VERSION |
499 | QToolTipGroup *MonthViewCell::toolTipGroup() | 499 | QToolTipGroup *MonthViewCell::toolTipGroup() |
500 | { | 500 | { |
501 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); | 501 | if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); |
502 | return mToolTipGroup; | 502 | return mToolTipGroup; |
503 | } | 503 | } |
504 | #endif | 504 | #endif |
505 | 505 | ||
506 | void MonthViewCell::setDate( const QDate &date ) | 506 | void MonthViewCell::setDate( const QDate &date ) |
507 | { | 507 | { |
508 | // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; | 508 | // kdDebug() << "MonthViewCell::setDate(): " << date.toString() << endl; |
509 | mDate = date; | 509 | mDate = date; |
510 | 510 | ||
511 | 511 | ||
512 | 512 | ||
513 | //resizeEvent( 0 ); | 513 | //resizeEvent( 0 ); |
514 | } | 514 | } |
515 | 515 | ||
516 | QDate MonthViewCell::date() const | 516 | QDate MonthViewCell::date() const |
517 | { | 517 | { |
518 | return mDate; | 518 | return mDate; |
519 | } | 519 | } |
520 | 520 | ||
521 | void MonthViewCell::setPrimary( bool primary ) | 521 | void MonthViewCell::setPrimary( bool primary ) |
522 | { | 522 | { |
523 | mPrimary = primary; | 523 | mPrimary = primary; |
524 | //setMyPalette(); | 524 | //setMyPalette(); |
525 | } | 525 | } |
526 | void MonthViewCell::setMyPalette() | 526 | void MonthViewCell::setMyPalette() |
527 | { | 527 | { |
528 | 528 | ||
529 | if ( mHoliday) { | 529 | if ( mHoliday) { |
530 | if ( currentPalette == 1 ) return; | 530 | if ( currentPalette == 1 ) return; |
531 | mLabel->setPalette( QPalette ( mHolidayPalette.color( QPalette::Normal,QColorGroup::Base),mHolidayPalette.color(QPalette::Normal,QColorGroup::Base ) )); | 531 | mLabel->setPalette( QPalette ( mHolidayPalette.color( QPalette::Normal,QColorGroup::Base),mHolidayPalette.color(QPalette::Normal,QColorGroup::Base ) )); |
532 | setPalette( mHolidayPalette ); | 532 | setPalette( mHolidayPalette ); |
533 | //mLabel->setPalette( mHolidayPalette ); | 533 | //mLabel->setPalette( mHolidayPalette ); |
534 | currentPalette = 1; | 534 | currentPalette = 1; |
535 | 535 | ||
536 | } else { | 536 | } else { |
537 | if ( mPrimary ) { | 537 | if ( mPrimary ) { |
538 | if ( currentPalette == 2 ) return; | 538 | if ( currentPalette == 2 ) return; |
539 | mLabel->setPalette( QPalette ( mPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) )); | 539 | mLabel->setPalette( QPalette ( mPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) )); |
540 | //mLabel->setPalette( mPrimaryPalette ); | 540 | //mLabel->setPalette( mPrimaryPalette ); |
541 | setPalette( mPrimaryPalette ); | 541 | setPalette( mPrimaryPalette ); |
542 | currentPalette = 2; | 542 | currentPalette = 2; |
543 | 543 | ||
544 | } else { | 544 | } else { |
545 | if ( currentPalette == 3 ) return; | 545 | if ( currentPalette == 3 ) return; |
546 | setPalette( mNonPrimaryPalette ); | 546 | setPalette( mNonPrimaryPalette ); |
547 | mLabel->setPalette( QPalette ( mNonPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mNonPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) )); | 547 | mLabel->setPalette( QPalette ( mNonPrimaryPalette.color( QPalette::Normal,QColorGroup::Base),mNonPrimaryPalette.color(QPalette::Normal,QColorGroup::Base ) )); |
548 | //mLabel->setPalette( mNonPrimaryPalette );; | 548 | //mLabel->setPalette( mNonPrimaryPalette );; |
549 | currentPalette = 3; | 549 | currentPalette = 3; |
550 | } | 550 | } |
551 | } | 551 | } |
552 | //QPalette pal = palette(); | 552 | //QPalette pal = palette(); |
553 | 553 | ||
554 | //mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) )); | 554 | //mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) )); |
555 | } | 555 | } |
556 | QPalette MonthViewCell::getPalette () | 556 | QPalette MonthViewCell::getPalette () |
557 | { | 557 | { |
558 | if ( !KOPrefs::instance()->mMonthViewUsesDayColors ) | 558 | if ( !KOPrefs::instance()->mMonthViewUsesDayColors ) |
559 | return mStandardPalette; | 559 | return mStandardPalette; |
560 | if ( mHoliday) { | 560 | if ( mHoliday) { |
561 | return mHolidayPalette ; | 561 | return mHolidayPalette ; |
562 | } else { | 562 | } else { |
563 | if ( mPrimary ) { | 563 | if ( mPrimary ) { |
564 | return mPrimaryPalette ; | 564 | return mPrimaryPalette ; |
565 | } | 565 | } |
566 | } | 566 | } |
567 | return mNonPrimaryPalette; | 567 | return mNonPrimaryPalette; |
568 | } | 568 | } |
569 | bool MonthViewCell::isPrimary() const | 569 | bool MonthViewCell::isPrimary() const |
570 | { | 570 | { |
571 | return mPrimary; | 571 | return mPrimary; |
572 | } | 572 | } |
573 | 573 | ||
574 | void MonthViewCell::setHoliday( bool holiday ) | 574 | void MonthViewCell::setHoliday( bool holiday ) |
575 | { | 575 | { |
576 | mHoliday = holiday; | 576 | mHoliday = holiday; |
577 | //setMyPalette(); | 577 | //setMyPalette(); |
578 | } | 578 | } |
579 | 579 | ||
580 | void MonthViewCell::setHoliday( const QString &holiday ) | 580 | void MonthViewCell::setHoliday( const QString &holiday ) |
581 | { | 581 | { |
582 | mHolidayString = holiday; | 582 | mHolidayString = holiday; |
583 | 583 | ||
584 | if ( !holiday.isEmpty() ) { | 584 | if ( !holiday.isEmpty() ) { |
585 | setHoliday( true ); | 585 | setHoliday( true ); |
586 | } | 586 | } |
587 | } | 587 | } |
588 | 588 | ||
589 | void MonthViewCell::startUpdateCell() | 589 | void MonthViewCell::startUpdateCell() |
590 | { | 590 | { |
591 | mdayCount = 0; | 591 | mdayCount = 0; |
592 | setFocusPolicy(NoFocus); | 592 | setFocusPolicy(NoFocus); |
593 | if ( !mMonthView->isUpdatePossible() ) | 593 | if ( !mMonthView->isUpdatePossible() ) |
594 | return; | 594 | return; |
595 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); | 595 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); |
596 | while ( mitem ) { | 596 | while ( mitem ) { |
597 | mitem->setBlockRepaint( true ); | 597 | mitem->setBlockRepaint( true ); |
598 | mitem = (MonthViewItem *)mitem->next(); | 598 | mitem = (MonthViewItem *)mitem->next(); |
599 | } | 599 | } |
600 | if ( mAvailItemList.count() > 20 ) { | 600 | if ( mAvailItemList.count() > 20 ) { |
601 | mAvailItemList.setAutoDelete( true ); | 601 | mAvailItemList.setAutoDelete( true ); |
602 | mAvailItemList.clear(); | 602 | mAvailItemList.clear(); |
603 | mAvailItemList.setAutoDelete( false ); | 603 | mAvailItemList.setAutoDelete( false ); |
604 | } | 604 | } |
605 | /* | 605 | /* |
606 | if ( !isVisible() ){ | 606 | if ( !isVisible() ){ |
607 | return; | 607 | return; |
608 | } | 608 | } |
609 | */ | 609 | */ |
610 | // qDebug("MonthViewCell::updateCell() "); | 610 | // qDebug("MonthViewCell::updateCell() "); |
611 | setPrimary( mDate.month()%2 ); | 611 | setPrimary( mDate.month()%2 ); |
612 | setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); | 612 | setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); |
613 | if ( mDate == QDate::currentDate() ) { | 613 | if ( mDate == QDate::currentDate() ) { |
614 | setLineWidth( 3 ); | 614 | setLineWidth( 3 ); |
615 | } else { | 615 | } else { |
616 | setLineWidth( 1 ); | 616 | setLineWidth( 1 ); |
617 | } | 617 | } |
618 | MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem (); | 618 | MonthViewItem* CurrentAvailItem = (MonthViewItem*) firstItem (); |
619 | //clear(); | 619 | //clear(); |
620 | while ( CurrentAvailItem ) { | 620 | while ( CurrentAvailItem ) { |
621 | MonthViewItem *item = CurrentAvailItem; | 621 | MonthViewItem *item = CurrentAvailItem; |
622 | CurrentAvailItem = (MonthViewItem *)item->next(); | 622 | CurrentAvailItem = (MonthViewItem *)item->next(); |
623 | mAvailItemList.append( item ); | 623 | mAvailItemList.append( item ); |
624 | takeItem ( item ); | 624 | takeItem ( item ); |
625 | } | 625 | } |
626 | 626 | ||
627 | #ifdef DESKTOP_VERSION | 627 | #ifdef DESKTOP_VERSION |
628 | QToolTip::remove(this); | 628 | QToolTip::remove(this); |
629 | #endif | 629 | #endif |
630 | mToolTip.clear(); | 630 | mToolTip.clear(); |
631 | //qApp->processEvents(); | 631 | //qApp->processEvents(); |
632 | #if 0 | 632 | #if 0 |
633 | if ( !mHolidayString.isEmpty() ) { | 633 | if ( !mHolidayString.isEmpty() ) { |
634 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); | 634 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); |
635 | item->setPalette( mHolidayPalette ); | 635 | item->setPalette( mHolidayPalette ); |
636 | insertItem( item ); | 636 | insertItem( item ); |
637 | mToolTip.append ( mHolidayString ); | 637 | mToolTip.append ( mHolidayString ); |
638 | } | 638 | } |
639 | #endif | 639 | #endif |
640 | } | 640 | } |
641 | 641 | ||
642 | int MonthViewCell::insertEvent(Event *event) | 642 | int MonthViewCell::insertEvent(Event *event) |
643 | { | 643 | { |
644 | bool useToolTips = true; | 644 | bool useToolTips = true; |
645 | #ifndef DEKSTOP_VERSION | 645 | #ifndef DESKTOP_VERSION |
646 | useToolTips = false; | 646 | useToolTips = false; |
647 | #endif | 647 | #endif |
648 | QString mToolTipText; | 648 | QString mToolTipText; |
649 | setFocusPolicy(WheelFocus); | 649 | setFocusPolicy(WheelFocus); |
650 | if ( !(event->doesRecur() == Recurrence::rNone) ) { | 650 | if ( !(event->doesRecur() == Recurrence::rNone) ) { |
651 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) | 651 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) |
652 | return mdayCount; | 652 | return mdayCount; |
653 | else | 653 | else |
654 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) | 654 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) |
655 | return mdayCount; | 655 | return mdayCount; |
656 | } | 656 | } |
657 | 657 | ||
658 | if ( event->isHoliday()) { | 658 | if ( event->isHoliday()) { |
659 | setHoliday( true ); | 659 | setHoliday( true ); |
660 | if ( mDate.dayOfWeek() == 7 ) | 660 | if ( mDate.dayOfWeek() == 7 ) |
661 | setLineWidth( 3 ); | 661 | setLineWidth( 3 ); |
662 | } | 662 | } |
663 | QString text; | 663 | QString text; |
664 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day | 664 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day |
665 | if (event->isMultiDay()) { | 665 | if (event->isMultiDay()) { |
666 | QString prefix = "<->";multiday = 2; | 666 | QString prefix = "<->";multiday = 2; |
667 | QString time; | 667 | QString time; |
668 | if ( event->doesRecur() ) { | 668 | if ( event->doesRecur() ) { |
669 | if ( event->recursOn( mDate) ) { | 669 | if ( event->recursOn( mDate) ) { |
670 | prefix ="->" ;multiday = 1; | 670 | prefix ="->" ;multiday = 1; |
671 | } | 671 | } |
672 | else { | 672 | else { |
673 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 673 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
674 | if ( event->recursOn( mDate.addDays( -days)) ) { | 674 | if ( event->recursOn( mDate.addDays( -days)) ) { |
675 | prefix ="<-" ;multiday = 3; | 675 | prefix ="<-" ;multiday = 3; |
676 | } | 676 | } |
677 | } | 677 | } |
678 | 678 | ||
679 | } else { | 679 | } else { |
680 | if (mDate == event->dtStart().date()) { | 680 | if (mDate == event->dtStart().date()) { |
681 | prefix ="->" ;multiday = 1; | 681 | prefix ="->" ;multiday = 1; |
682 | } else if (mDate == event->dtEnd().date()) { | 682 | } else if (mDate == event->dtEnd().date()) { |
683 | prefix ="<-" ;multiday = 3; | 683 | prefix ="<-" ;multiday = 3; |
684 | } | 684 | } |
685 | } | 685 | } |
686 | if ( !event->doesFloat() ) { | 686 | if ( !event->doesFloat() ) { |
687 | if ( mDate == event->dtStart().date () ) | 687 | if ( mDate == event->dtStart().date () ) |
688 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; | 688 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; |
689 | else if ( mDate == event->dtEnd().date () ) | 689 | else if ( mDate == event->dtEnd().date () ) |
690 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; | 690 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; |
691 | 691 | ||
692 | } | 692 | } |
693 | text = time + event->summary(); | 693 | text = time + event->summary(); |
694 | if ( useToolTips ) | 694 | if ( useToolTips ) |
695 | mToolTipText += prefix + text; | 695 | mToolTipText += prefix + text; |
696 | } else { | 696 | } else { |
697 | if (event->doesFloat()) { | 697 | if (event->doesFloat()) { |
698 | text = event->summary(); | 698 | text = event->summary(); |
699 | if ( useToolTips ) | 699 | if ( useToolTips ) |
700 | mToolTipText += text; | 700 | mToolTipText += text; |
701 | } | 701 | } |
702 | else { | 702 | else { |
703 | text = KGlobal::locale()->formatTime(event->dtStart().time()); | 703 | text = KGlobal::locale()->formatTime(event->dtStart().time()); |
704 | text += " " + event->summary(); | 704 | text += " " + event->summary(); |
705 | if ( useToolTips ) | 705 | if ( useToolTips ) |
706 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | 706 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); |
707 | } | 707 | } |
708 | } | 708 | } |
709 | if ( useToolTips && ! event->location().isEmpty() ) { | 709 | if ( useToolTips && ! event->location().isEmpty() ) { |
710 | mToolTipText += " (" + event->location() +")"; | 710 | mToolTipText += " (" + event->location() +")"; |
711 | } | 711 | } |
712 | MonthViewItem *item ; | 712 | MonthViewItem *item ; |
713 | 713 | ||
714 | if ( mAvailItemList.count() ) { | 714 | if ( mAvailItemList.count() ) { |
715 | item = mAvailItemList.first(); | 715 | item = mAvailItemList.first(); |
716 | mAvailItemList.remove( item ); | 716 | mAvailItemList.remove( item ); |
717 | item->recycle( event, mDate, text ); | 717 | item->recycle( event, mDate, text ); |
718 | } else { | 718 | } else { |
719 | item = new MonthViewItem( event, mDate, text ); | 719 | item = new MonthViewItem( event, mDate, text ); |
720 | } | 720 | } |
721 | 721 | ||
722 | QPalette pal; | 722 | QPalette pal; |
723 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 723 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
724 | QStringList categories = event->categories(); | 724 | QStringList categories = event->categories(); |
725 | QString cat = categories.first(); | 725 | QString cat = categories.first(); |
726 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 726 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
727 | pal = getPalette(); | 727 | pal = getPalette(); |
728 | if (cat.isEmpty()) { | 728 | if (cat.isEmpty()) { |
729 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 729 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
730 | } else { | 730 | } else { |
731 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 731 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
732 | } | 732 | } |
733 | 733 | ||
734 | } else { | 734 | } else { |
735 | if (cat.isEmpty()) { | 735 | if (cat.isEmpty()) { |
736 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 736 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
737 | } else { | 737 | } else { |
738 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 738 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
739 | } | 739 | } |
740 | } | 740 | } |
741 | 741 | ||
742 | } else { | 742 | } else { |
743 | pal = mStandardPalette ; | 743 | pal = mStandardPalette ; |
744 | } | 744 | } |
745 | item->setPalette( pal ); | 745 | item->setPalette( pal ); |
746 | item->setRecur( event->recurrence()->doesRecur() ); | 746 | item->setRecur( event->recurrence()->doesRecur() ); |
747 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 ); | 747 | item->setAlarm( event->isAlarmEnabled() && multiday < 2 ); |
748 | item->setMoreInfo( event->description().length() > 0 ); | 748 | item->setMoreInfo( event->description().length() > 0 ); |
749 | #ifdef DESKTOP_VERSION | 749 | #ifdef DESKTOP_VERSION |
750 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, | 750 | Attendee *me = event->attendeeByMails(KOPrefs::instance()->mAdditionalMails, |
751 | KOPrefs::instance()->email()); | 751 | KOPrefs::instance()->email()); |
752 | if ( me != 0 ) { | 752 | if ( me != 0 ) { |
753 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) | 753 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) |
754 | item->setReply(true && multiday < 2); | 754 | item->setReply(true && multiday < 2); |
755 | else | 755 | else |
756 | item->setReply(false); | 756 | item->setReply(false); |
757 | } else | 757 | } else |
758 | item->setReply(false); | 758 | item->setReply(false); |
759 | #endif | 759 | #endif |
760 | item->setMultiDay( multiday ); | 760 | item->setMultiDay( multiday ); |
761 | if ( multiday ) { | 761 | if ( multiday ) { |
762 | insertItem( item ,mdayCount); | 762 | insertItem( item ,mdayCount); |
763 | ++mdayCount; | 763 | ++mdayCount; |
764 | } else { | 764 | } else { |
765 | uint i; | 765 | uint i; |
766 | int pos = mdayCount; | 766 | int pos = mdayCount; |
767 | for ( i = mdayCount; i < count();++i ) { | 767 | for ( i = mdayCount; i < count();++i ) { |
768 | QListBoxItem* it = this->item ( i ); | 768 | QListBoxItem* it = this->item ( i ); |
769 | if ( text < it->text() ) { | 769 | if ( text < it->text() ) { |
770 | pos = i; | 770 | pos = i; |
771 | break; | 771 | break; |
772 | } | 772 | } |
773 | ++pos; | 773 | ++pos; |
774 | } | 774 | } |
775 | insertItem( item ,pos); | 775 | insertItem( item ,pos); |
776 | } | 776 | } |
777 | if ( useToolTips ) | 777 | if ( useToolTips ) { |
778 | mToolTip.append( mToolTipText ); | 778 | mToolTip.append( mToolTipText ); |
779 | } | ||
779 | return mdayCount; | 780 | return mdayCount; |
780 | } | 781 | } |
781 | void MonthViewCell::insertTodo(Todo *todo) | 782 | void MonthViewCell::insertTodo(Todo *todo) |
782 | { | 783 | { |
783 | setFocusPolicy(WheelFocus); | 784 | setFocusPolicy(WheelFocus); |
784 | QString text; | 785 | QString text; |
785 | if (todo->hasDueDate()) { | 786 | if (todo->hasDueDate()) { |
786 | if (!todo->doesFloat()) { | 787 | if (!todo->doesFloat()) { |
787 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 788 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
788 | text += " "; | 789 | text += " "; |
789 | } | 790 | } |
790 | } | 791 | } |
791 | text += todo->summary(); | 792 | text += todo->summary(); |
792 | MonthViewItem *item ; | 793 | MonthViewItem *item ; |
793 | if ( mAvailItemList.count() ) { | 794 | if ( mAvailItemList.count() ) { |
794 | item = mAvailItemList.first(); | 795 | item = mAvailItemList.first(); |
795 | mAvailItemList.remove( item ); | 796 | mAvailItemList.remove( item ); |
796 | item->recycle( todo, mDate, text ); | 797 | item->recycle( todo, mDate, text ); |
797 | } else { | 798 | } else { |
798 | item = new MonthViewItem( todo, mDate, text ); | 799 | item = new MonthViewItem( todo, mDate, text ); |
799 | } | 800 | } |
800 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 801 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
801 | //item->setPalette( mStandardPalette ); | 802 | //item->setPalette( mStandardPalette ); |
802 | QPalette pal; | 803 | QPalette pal; |
803 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 804 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
804 | QStringList categories = todo->categories(); | 805 | QStringList categories = todo->categories(); |
805 | QString cat = categories.first(); | 806 | QString cat = categories.first(); |
806 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 807 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
807 | pal = getPalette(); | 808 | pal = getPalette(); |
808 | if (cat.isEmpty()) { | 809 | if (cat.isEmpty()) { |
809 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 810 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
810 | } else { | 811 | } else { |
811 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 812 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
812 | } | 813 | } |
813 | 814 | ||
814 | } else { | 815 | } else { |
815 | if (cat.isEmpty()) { | 816 | if (cat.isEmpty()) { |
816 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 817 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
817 | } else { | 818 | } else { |
818 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 819 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
819 | } | 820 | } |
820 | } | 821 | } |
821 | 822 | ||
822 | } else { | 823 | } else { |
823 | pal = mStandardPalette ; | 824 | pal = mStandardPalette ; |
824 | } | 825 | } |
825 | item->setPalette( pal ); | 826 | item->setPalette( pal ); |
826 | item->setRecur( todo->recurrence()->doesRecur() ); | 827 | item->setRecur( todo->recurrence()->doesRecur() ); |
827 | item->setAlarm( todo->isAlarmEnabled() ); | 828 | item->setAlarm( todo->isAlarmEnabled() ); |
828 | item->setMoreInfo( todo->description().length() > 0 ); | 829 | item->setMoreInfo( todo->description().length() > 0 ); |
829 | insertItem( item , count()); | 830 | insertItem( item , count()); |
830 | #ifdef DESKTOP_VERSION | 831 | #ifdef DESKTOP_VERSION |
831 | mToolTip.append( text ); | 832 | mToolTip.append( text ); |
832 | #endif | 833 | #endif |
833 | } | 834 | } |
834 | void MonthViewCell::repaintfinishUpdateCell() | 835 | void MonthViewCell::repaintfinishUpdateCell() |
835 | { | 836 | { |
836 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); | 837 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); |
837 | while ( mitem ) { | 838 | while ( mitem ) { |
838 | mitem->setBlockRepaint( false ); | 839 | mitem->setBlockRepaint( false ); |
839 | updateItem ( mitem ); | 840 | updateItem ( mitem ); |
840 | mitem = (MonthViewItem *)mitem->next(); | 841 | mitem = (MonthViewItem *)mitem->next(); |
841 | } | 842 | } |
842 | } | 843 | } |
843 | void MonthViewCell::finishUpdateCell() | 844 | void MonthViewCell::finishUpdateCell() |
844 | { | 845 | { |
845 | 846 | ||
846 | 847 | ||
847 | 848 | ||
848 | #ifdef DESKTOP_VERSION | 849 | #ifdef DESKTOP_VERSION |
849 | if (mToolTip.count() > 0 ) { | 850 | if (mToolTip.count() > 0 ) { |
850 | mToolTip.sort(); | 851 | mToolTip.sort(); |
851 | QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); | 852 | QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); |
852 | } | 853 | } |
853 | #endif | 854 | #endif |
854 | //sort(); | 855 | //sort(); |
855 | //setMyPalette(); | 856 | //setMyPalette(); |
856 | setMyPalette(); | 857 | setMyPalette(); |
857 | 858 | ||
858 | resizeEvent( 0 ); | 859 | resizeEvent( 0 ); |
859 | 860 | ||
860 | } | 861 | } |
861 | void MonthViewCell::updateCell() | 862 | void MonthViewCell::updateCell() |
862 | { | 863 | { |
863 | //qDebug("MonthViewCell::updateCell() "); | 864 | //qDebug("MonthViewCell::updateCell() "); |
864 | if ( !mMonthView->isUpdatePossible() ) | 865 | if ( !mMonthView->isUpdatePossible() ) |
865 | return; | 866 | return; |
866 | startUpdateCell(); | 867 | startUpdateCell(); |
867 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 868 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
868 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); | 869 | QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); |
869 | Event *event; | 870 | Event *event; |
870 | for( event = events.first(); event; event = events.next() ) { // for event | 871 | for( event = events.first(); event; event = events.next() ) { // for event |
871 | insertEvent(event); | 872 | insertEvent(event); |
872 | } | 873 | } |
873 | // insert due todos | 874 | // insert due todos |
874 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); | 875 | QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); |
875 | Todo *todo; | 876 | Todo *todo; |
876 | for(todo = todos.first(); todo; todo = todos.next()) { | 877 | for(todo = todos.first(); todo; todo = todos.next()) { |
877 | insertTodo( todo ); | 878 | insertTodo( todo ); |
878 | } | 879 | } |
879 | finishUpdateCell(); | 880 | finishUpdateCell(); |
880 | // if ( isVisible()) | 881 | // if ( isVisible()) |
881 | //qApp->processEvents(); | 882 | //qApp->processEvents(); |
882 | } | 883 | } |
883 | 884 | ||
884 | void MonthViewCell::updateConfig( bool bigFont ) // = false | 885 | void MonthViewCell::updateConfig( bool bigFont ) // = false |
885 | { | 886 | { |
886 | 887 | ||
887 | if ( bigFont ) { | 888 | if ( bigFont ) { |
888 | QFont fo = KOPrefs::instance()->mMonthViewFont; | 889 | QFont fo = KOPrefs::instance()->mMonthViewFont; |
889 | int ps = fo.pointSize() + 2; | 890 | int ps = fo.pointSize() + 2; |
890 | if ( ps < 18 ) | 891 | if ( ps < 18 ) |
891 | ps += 2; | 892 | ps += 2; |
892 | fo.setPointSize( ps ); | 893 | fo.setPointSize( ps ); |
893 | setFont( fo ); | 894 | setFont( fo ); |
894 | } else | 895 | } else |
895 | setFont( KOPrefs::instance()->mMonthViewFont ); | 896 | setFont( KOPrefs::instance()->mMonthViewFont ); |
896 | 897 | ||
897 | QFontMetrics fm( font() ); | 898 | QFontMetrics fm( font() ); |
898 | mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); | 899 | mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); |
899 | mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); | 900 | mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); |
900 | mHolidayPalette = mStandardPalette; | 901 | mHolidayPalette = mStandardPalette; |
901 | mPrimaryPalette = mStandardPalette; | 902 | mPrimaryPalette = mStandardPalette; |
902 | mNonPrimaryPalette = mStandardPalette; | 903 | mNonPrimaryPalette = mStandardPalette; |
903 | if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { | 904 | if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { |
904 | mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); | 905 | mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); |
905 | mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); | 906 | mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); |
906 | mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); | 907 | mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); |
907 | mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); | 908 | mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); |
908 | mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); | 909 | mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); |
909 | mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); | 910 | mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); |
910 | mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); | 911 | mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); |
911 | mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); | 912 | mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); |
912 | mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); | 913 | mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); |
913 | } | 914 | } |
914 | //updateCell(); | 915 | //updateCell(); |
915 | } | 916 | } |
916 | 917 | ||
917 | void MonthViewCell::enableScrollBars( bool enabled ) | 918 | void MonthViewCell::enableScrollBars( bool enabled ) |
918 | { | 919 | { |
919 | 920 | ||
920 | return; | 921 | return; |
921 | if ( enabled ) { | 922 | if ( enabled ) { |
922 | QListBoxItem *fi = firstItem (); | 923 | QListBoxItem *fi = firstItem (); |
923 | if (fi ) { | 924 | if (fi ) { |
924 | int ihei = fi->height( this ); | 925 | int ihei = fi->height( this ); |
925 | int hei = numRows () * ihei; | 926 | int hei = numRows () * ihei; |
926 | if ( hei < height() - horizontalScrollBar()->height () ) { | 927 | if ( hei < height() - horizontalScrollBar()->height () ) { |
927 | setVScrollBarMode(QScrollView::AlwaysOff); | 928 | setVScrollBarMode(QScrollView::AlwaysOff); |
928 | } | 929 | } |
929 | else | 930 | else |
930 | setVScrollBarMode(QScrollView::Auto); | 931 | setVScrollBarMode(QScrollView::Auto); |
931 | if ( ihei *3 > height() ) { | 932 | if ( ihei *3 > height() ) { |
932 | setHScrollBarMode(QScrollView::AlwaysOff); | 933 | setHScrollBarMode(QScrollView::AlwaysOff); |
933 | } | 934 | } |
934 | else { | 935 | else { |
935 | setHScrollBarMode(QScrollView::Auto); | 936 | setHScrollBarMode(QScrollView::Auto); |
936 | } | 937 | } |
937 | } else { | 938 | } else { |
938 | setVScrollBarMode(QScrollView::Auto); | 939 | setVScrollBarMode(QScrollView::Auto); |
939 | setHScrollBarMode(QScrollView::Auto); | 940 | setHScrollBarMode(QScrollView::Auto); |
940 | } | 941 | } |
941 | } else { | 942 | } else { |
942 | setVScrollBarMode(QScrollView::AlwaysOff); | 943 | setVScrollBarMode(QScrollView::AlwaysOff); |
943 | setHScrollBarMode(QScrollView::AlwaysOff); | 944 | setHScrollBarMode(QScrollView::AlwaysOff); |
944 | } | 945 | } |
945 | } | 946 | } |
946 | 947 | ||
947 | Incidence *MonthViewCell::selectedIncidence() | 948 | Incidence *MonthViewCell::selectedIncidence() |
948 | { | 949 | { |
949 | int index = currentItem(); | 950 | int index = currentItem(); |
950 | if ( index < 0 ) return 0; | 951 | if ( index < 0 ) return 0; |
951 | 952 | ||
952 | MonthViewItem *mitem = | 953 | MonthViewItem *mitem = |
953 | static_cast<MonthViewItem *>( item( index ) ); | 954 | static_cast<MonthViewItem *>( item( index ) ); |
954 | 955 | ||
955 | if ( !mitem ) return 0; | 956 | if ( !mitem ) return 0; |
956 | 957 | ||
957 | return mitem->incidence(); | 958 | return mitem->incidence(); |
958 | } | 959 | } |
959 | 960 | ||
960 | QDate MonthViewCell::selectedIncidenceDate() | 961 | QDate MonthViewCell::selectedIncidenceDate() |
961 | { | 962 | { |
962 | QDate qd; | 963 | QDate qd; |
963 | int index = currentItem(); | 964 | int index = currentItem(); |
964 | if ( index < 0 ) return qd; | 965 | if ( index < 0 ) return qd; |
965 | 966 | ||
966 | MonthViewItem *mitem = | 967 | MonthViewItem *mitem = |
967 | static_cast<MonthViewItem *>( item( index ) ); | 968 | static_cast<MonthViewItem *>( item( index ) ); |
968 | 969 | ||
969 | if ( !mitem ) return qd; | 970 | if ( !mitem ) return qd; |
970 | 971 | ||
971 | return mitem->incidenceDate(); | 972 | return mitem->incidenceDate(); |
972 | } | 973 | } |
973 | 974 | ||
974 | void MonthViewCell::deselect() | 975 | void MonthViewCell::deselect() |
975 | { | 976 | { |
976 | clearSelection(); | 977 | clearSelection(); |
977 | enableScrollBars( false ); | 978 | enableScrollBars( false ); |
978 | // updateCell(); | 979 | // updateCell(); |
979 | } | 980 | } |
980 | void MonthViewCell::select() | 981 | void MonthViewCell::select() |
981 | { | 982 | { |
982 | ;// updateCell(); | 983 | ;// updateCell(); |
983 | } | 984 | } |
984 | 985 | ||
985 | void MonthViewCell::resizeEvent ( QResizeEvent * e ) | 986 | void MonthViewCell::resizeEvent ( QResizeEvent * e ) |
986 | { | 987 | { |
987 | if ( !mMonthView->isUpdatePossible() ) | 988 | if ( !mMonthView->isUpdatePossible() ) |
988 | return; | 989 | return; |
989 | //qDebug("++++++++++++++MonthViewCell::resizeEvent %d %d ", width(), height()); | 990 | //qDebug("++++++++++++++MonthViewCell::resizeEvent %d %d ", width(), height()); |
990 | deselect(); | 991 | deselect(); |
991 | mLabel->setMaximumHeight( height() - lineWidth()*2 ); | 992 | mLabel->setMaximumHeight( height() - lineWidth()*2 ); |
992 | 993 | ||
993 | QString text; | 994 | QString text; |
994 | mLabel->setText( text ); | 995 | mLabel->setText( text ); |
995 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; | 996 | bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; |
996 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { | 997 | if ( KOPrefs::instance()->mMonthViewWeek || KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { |
997 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; | 998 | text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; |
998 | mLabel->resize( mLabelBigSize ); | 999 | mLabel->resize( mLabelBigSize ); |
999 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 1000 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); |
1000 | } else { | 1001 | } else { |
1001 | mLabel->resize( mLabelSize ); | 1002 | mLabel->resize( mLabelSize ); |
1002 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); | 1003 | text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); |
1003 | } | 1004 | } |
1004 | mLabel->setText( text ); | 1005 | mLabel->setText( text ); |
1005 | 1006 | ||
1006 | int size = height() - mLabel->height() - lineWidth()-1; | 1007 | int size = height() - mLabel->height() - lineWidth()-1; |
1007 | //qDebug("LW %d ", lineWidth()); | 1008 | //qDebug("LW %d ", lineWidth()); |
1008 | if ( size > 0 ) | 1009 | if ( size > 0 ) |
1009 | verticalScrollBar()->setMaximumHeight( size ); | 1010 | verticalScrollBar()->setMaximumHeight( size ); |
1010 | size = width() - mLabel->width() -lineWidth()-1; | 1011 | size = width() - mLabel->width() -lineWidth()-1; |
1011 | if ( size > 0 ) | 1012 | if ( size > 0 ) |
1012 | horizontalScrollBar()->setMaximumWidth( size ); | 1013 | horizontalScrollBar()->setMaximumWidth( size ); |
1013 | mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() ); | 1014 | mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() ); |
1014 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); | 1015 | //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); |
1015 | // mItemList->resize ( width(), height () ); | 1016 | // mItemList->resize ( width(), height () ); |
1016 | if ( e ) | 1017 | if ( e ) |
1017 | KNoScrollListBox::resizeEvent ( e ); | 1018 | KNoScrollListBox::resizeEvent ( e ); |
1018 | } | 1019 | } |
1019 | 1020 | ||
1020 | void MonthViewCell::defaultAction( QListBoxItem *item ) | 1021 | void MonthViewCell::defaultAction( QListBoxItem *item ) |
1021 | { | 1022 | { |
1022 | 1023 | ||
1023 | if ( !item ) { | 1024 | if ( !item ) { |
1024 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 1025 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
1025 | emit newEventSignal( dt ); | 1026 | emit newEventSignal( dt ); |
1026 | return; | 1027 | return; |
1027 | } | 1028 | } |
1028 | 1029 | ||
1029 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 1030 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
1030 | Incidence *incidence = eventItem->incidence(); | 1031 | Incidence *incidence = eventItem->incidence(); |
1031 | if ( incidence ) mMonthView->defaultAction( incidence ); | 1032 | if ( incidence ) mMonthView->defaultAction( incidence ); |
1032 | } | 1033 | } |
1033 | void MonthViewCell::showDay() | 1034 | void MonthViewCell::showDay() |
1034 | { | 1035 | { |
1035 | emit showDaySignal( date() ); | 1036 | emit showDaySignal( date() ); |
1036 | } | 1037 | } |
1037 | void MonthViewCell::newEvent() | 1038 | void MonthViewCell::newEvent() |
1038 | { | 1039 | { |
1039 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 1040 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
1040 | emit newEventSignal( dt ); | 1041 | emit newEventSignal( dt ); |
1041 | } | 1042 | } |
1042 | void MonthViewCell::cellClicked( QListBoxItem *item ) | 1043 | void MonthViewCell::cellClicked( QListBoxItem *item ) |
1043 | { | 1044 | { |
1044 | qDebug("CELL "); | 1045 | qDebug("CELL "); |
1045 | if ( item == 0 ) { | 1046 | if ( item == 0 ) { |
1046 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 1047 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
1047 | emit newEventSignal( dt ); | 1048 | emit newEventSignal( dt ); |
1048 | return; | 1049 | return; |
1049 | } | 1050 | } |
1050 | 1051 | ||
1051 | } | 1052 | } |
1052 | 1053 | ||
1053 | void MonthViewCell::contextMenu( QListBoxItem *item ) | 1054 | void MonthViewCell::contextMenu( QListBoxItem *item ) |
1054 | { | 1055 | { |
1055 | if ( !item ) return; | 1056 | if ( !item ) return; |
1056 | 1057 | ||
1057 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 1058 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
1058 | Incidence *incidence = eventItem->incidence(); | 1059 | Incidence *incidence = eventItem->incidence(); |
1059 | if ( incidence ) mMonthView->showContextMenu( incidence ); | 1060 | if ( incidence ) mMonthView->showContextMenu( incidence ); |
1060 | } | 1061 | } |
1061 | 1062 | ||
1062 | void MonthViewCell::selection( QListBoxItem *item ) | 1063 | void MonthViewCell::selection( QListBoxItem *item ) |
1063 | { | 1064 | { |
1064 | if ( !item ) return; | 1065 | if ( !item ) return; |
1065 | 1066 | ||
1066 | mMonthView->setSelectedCell( this ); | 1067 | mMonthView->setSelectedCell( this ); |
1067 | } | 1068 | } |
1068 | 1069 | ||
1069 | 1070 | ||
1070 | // ******************************************************************************* | 1071 | // ******************************************************************************* |
1071 | // ******************************************************************************* | 1072 | // ******************************************************************************* |
1072 | // ******************************************************************************* | 1073 | // ******************************************************************************* |
1073 | 1074 | ||
1074 | 1075 | ||
1075 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | 1076 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) |
1076 | : KOEventView( calendar, parent, name ), | 1077 | : KOEventView( calendar, parent, name ), |
1077 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), | 1078 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), |
1078 | mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) | 1079 | mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) |
1079 | { | 1080 | { |
1080 | mFlagKeyPressed = false; | 1081 | mFlagKeyPressed = false; |
1081 | mShortDayLabelsM = false; | 1082 | mShortDayLabelsM = false; |
1082 | mShortDayLabelsW = false; | 1083 | mShortDayLabelsW = false; |
1083 | skipResize = false; | 1084 | skipResize = false; |
1084 | clPending = true; | 1085 | clPending = true; |
1085 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); | 1086 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), this, "useBigPixmaps" ); |
1086 | mWidStack = new QWidgetStack( this ); | 1087 | mWidStack = new QWidgetStack( this ); |
1087 | QVBoxLayout* hb = new QVBoxLayout( this ); | 1088 | QVBoxLayout* hb = new QVBoxLayout( this ); |
1088 | mMonthView = new QWidget( mWidStack ); | 1089 | mMonthView = new QWidget( mWidStack ); |
1089 | mWeekView = new QWidget( mWidStack ); | 1090 | mWeekView = new QWidget( mWidStack ); |
1090 | #if QT_VERSION >= 0x030000 | 1091 | #if QT_VERSION >= 0x030000 |
1091 | mWidStack->addWidget(mMonthView ); | 1092 | mWidStack->addWidget(mMonthView ); |
1092 | mWidStack->addWidget(mWeekView ); | 1093 | mWidStack->addWidget(mWeekView ); |
1093 | #else | 1094 | #else |
1094 | mWidStack->addWidget( mMonthView, 1 ); | 1095 | mWidStack->addWidget( mMonthView, 1 ); |
1095 | mWidStack->addWidget( mWeekView , 1 ); | 1096 | mWidStack->addWidget( mWeekView , 1 ); |
1096 | #endif | 1097 | #endif |
1097 | hb->addWidget( mNavigatorBar ); | 1098 | hb->addWidget( mNavigatorBar ); |
1098 | hb->addWidget( mWidStack ); | 1099 | hb->addWidget( mWidStack ); |
1099 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; | 1100 | mShowWeekView = KOPrefs::instance()->mMonthViewWeek; |
1100 | updatePossible = false; | 1101 | updatePossible = false; |
1101 | //updatePossible = true; | 1102 | //updatePossible = true; |
1102 | mCells.setAutoDelete( true ); | 1103 | mCells.setAutoDelete( true ); |
1103 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; | 1104 | mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; |
1104 | mDayLabels.resize( mDaysPerWeek ); | 1105 | mDayLabels.resize( mDaysPerWeek ); |
1105 | mDayLabelsW.resize( mDaysPerWeek ); | 1106 | mDayLabelsW.resize( mDaysPerWeek ); |
1106 | QFont bfont = font(); | 1107 | QFont bfont = font(); |
1107 | if ( QApplication::desktop()->width() < 650 ) { | 1108 | if ( QApplication::desktop()->width() < 650 ) { |
1108 | bfont.setPointSize( bfont.pointSize() - 2 ); | 1109 | bfont.setPointSize( bfont.pointSize() - 2 ); |
1109 | } | 1110 | } |
1110 | bfont.setBold( true ); | 1111 | bfont.setBold( true ); |
1111 | int i; | 1112 | int i; |
1112 | 1113 | ||
1113 | for( i = 0; i < mDaysPerWeek; i++ ) { | 1114 | for( i = 0; i < mDaysPerWeek; i++ ) { |
1114 | QLabel *label = new QLabel( mMonthView ); | 1115 | QLabel *label = new QLabel( mMonthView ); |
1115 | label->setFont(bfont); | 1116 | label->setFont(bfont); |
1116 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 1117 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
1117 | label->setLineWidth(1); | 1118 | label->setLineWidth(1); |
1118 | label->setAlignment(AlignCenter); | 1119 | label->setAlignment(AlignCenter); |
1119 | mDayLabels.insert( i, label ); | 1120 | mDayLabels.insert( i, label ); |
1120 | label = new QLabel( mWeekView ); | 1121 | label = new QLabel( mWeekView ); |
1121 | label->setFont(bfont); | 1122 | label->setFont(bfont); |
1122 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 1123 | label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
1123 | label->setLineWidth(1); | 1124 | label->setLineWidth(1); |
1124 | label->setAlignment(AlignCenter); | 1125 | label->setAlignment(AlignCenter); |
1125 | mDayLabelsW.insert( i, label ); | 1126 | mDayLabelsW.insert( i, label ); |
1126 | } | 1127 | } |
1127 | 1128 | ||
1128 | bfont.setBold( false ); | 1129 | bfont.setBold( false ); |
1129 | mWeekLabels.resize( mNumWeeks+1 ); | 1130 | mWeekLabels.resize( mNumWeeks+1 ); |
1130 | mWeekLabelsW.resize( 2 ); | 1131 | mWeekLabelsW.resize( 2 ); |
1131 | for( i = 0; i < mNumWeeks+1; i++ ) { | 1132 | for( i = 0; i < mNumWeeks+1; i++ ) { |
1132 | KOWeekButton *label = new KOWeekButton( mMonthView ); | 1133 | KOWeekButton *label = new KOWeekButton( mMonthView ); |
1133 | label->setFocusPolicy(NoFocus); | 1134 | label->setFocusPolicy(NoFocus); |
1134 | label->setFont(bfont); | 1135 | label->setFont(bfont); |
1135 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); | 1136 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); |
1136 | label->setFlat(true); | 1137 | label->setFlat(true); |
1137 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); | 1138 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); |
1138 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 1139 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
1139 | //label->setLineWidth(1); | 1140 | //label->setLineWidth(1); |
1140 | //label->setAlignment(AlignCenter); | 1141 | //label->setAlignment(AlignCenter); |
1141 | mWeekLabels.insert( i, label ); | 1142 | mWeekLabels.insert( i, label ); |
1142 | } | 1143 | } |
1143 | mWeekLabels[mNumWeeks]->setText( i18n("W")); | 1144 | mWeekLabels[mNumWeeks]->setText( i18n("W")); |
1144 | mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus); | 1145 | mWeekLabels[mNumWeeks]->setFocusPolicy(WheelFocus); |
1145 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); | 1146 | QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number")); |
1146 | 1147 | ||
1147 | for( i = 0; i < 1+1; i++ ) { | 1148 | for( i = 0; i < 1+1; i++ ) { |
1148 | KOWeekButton *label = new KOWeekButton( mWeekView ); | 1149 | KOWeekButton *label = new KOWeekButton( mWeekView ); |
1149 | label->setFocusPolicy(NoFocus); | 1150 | label->setFocusPolicy(NoFocus); |
1150 | label->setFont(bfont); | 1151 | label->setFont(bfont); |
1151 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); | 1152 | connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) ); |
1152 | label->setFlat(true); | 1153 | label->setFlat(true); |
1153 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); | 1154 | QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed")); |
1154 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); | 1155 | //label->setFrameStyle(QFrame::Panel|QFrame::Raised); |
1155 | //label->setLineWidth(1); | 1156 | //label->setLineWidth(1); |
1156 | //label->setAlignment(AlignCenter); | 1157 | //label->setAlignment(AlignCenter); |
1157 | mWeekLabelsW.insert( i, label ); | 1158 | mWeekLabelsW.insert( i, label ); |
1158 | } | 1159 | } |
1159 | mWeekLabelsW[1]->setText( i18n("W")); | 1160 | mWeekLabelsW[1]->setText( i18n("W")); |
1160 | mWeekLabelsW[1]->setFocusPolicy(WheelFocus); | 1161 | mWeekLabelsW[1]->setFocusPolicy(WheelFocus); |
1161 | 1162 | ||
1162 | 1163 | ||
diff --git a/libkcal/kincidenceformatter.cpp b/libkcal/kincidenceformatter.cpp index d67ad52..8ae5b46 100644 --- a/libkcal/kincidenceformatter.cpp +++ b/libkcal/kincidenceformatter.cpp | |||
@@ -1,403 +1,422 @@ | |||
1 | #include "kincidenceformatter.h" | 1 | #include "kincidenceformatter.h" |
2 | #include <kstaticdeleter.h> | 2 | #include <kstaticdeleter.h> |
3 | #include <kglobal.h> | 3 | #include <kglobal.h> |
4 | #include <klocale.h> | 4 | #include <klocale.h> |
5 | #ifdef DEKTOP_VERSION | 5 | #ifdef DEKTOP_VERSION |
6 | #include <kabc/stdaddressbook.h> | 6 | #include <kabc/stdaddressbook.h> |
7 | #define size count | 7 | #define size count |
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; | 10 | KIncidenceFormatter* KIncidenceFormatter::mInstance = 0; |
11 | static KStaticDeleter<KIncidenceFormatter> insd; | 11 | static KStaticDeleter<KIncidenceFormatter> insd; |
12 | 12 | ||
13 | QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified ) | 13 | QString KIncidenceFormatter::getFormattedText( Incidence * inc, bool details, bool created , bool modified ) |
14 | { | 14 | { |
15 | // #ifndef QT_NO_INPUTDIALOG | 15 | // #ifndef QT_NO_INPUTDIALOG |
16 | // return QInputDialog::getItem( caption, label, items, current, editable ); | 16 | // return QInputDialog::getItem( caption, label, items, current, editable ); |
17 | // #else | 17 | // #else |
18 | // return QString::null; | 18 | // return QString::null; |
19 | // #endif | 19 | // #endif |
20 | mDetails = details; | 20 | mDetails = details; |
21 | mCreated = created ; | 21 | mCreated = created ; |
22 | mModified = modified; | 22 | mModified = modified; |
23 | mText = ""; | 23 | mText = ""; |
24 | if ( inc->type() == "Event" ) | 24 | if ( inc->type() == "Event" ) |
25 | setEvent((Event *) inc ); | 25 | setEvent((Event *) inc ); |
26 | else if ( inc->type() == "Todo" ) | 26 | else if ( inc->type() == "Todo" ) |
27 | setTodo((Todo *) inc ); | 27 | setTodo((Todo *) inc ); |
28 | return mText; | 28 | return mText; |
29 | } | 29 | } |
30 | 30 | ||
31 | KIncidenceFormatter* KIncidenceFormatter::instance() | 31 | KIncidenceFormatter* KIncidenceFormatter::instance() |
32 | { | 32 | { |
33 | if (!mInstance) { | 33 | if (!mInstance) { |
34 | mInstance = insd.setObject(new KIncidenceFormatter()); | 34 | mInstance = insd.setObject(new KIncidenceFormatter()); |
35 | } | 35 | } |
36 | return mInstance; | 36 | return mInstance; |
37 | } | 37 | } |
38 | KIncidenceFormatter::~KIncidenceFormatter() | 38 | KIncidenceFormatter::~KIncidenceFormatter() |
39 | { | 39 | { |
40 | if (mInstance == this) | 40 | if (mInstance == this) |
41 | mInstance = insd.setObject(0); | 41 | mInstance = insd.setObject(0); |
42 | //qDebug("KIncidenceFormatter::~KIncidenceFormatter "); | 42 | //qDebug("KIncidenceFormatter::~KIncidenceFormatter "); |
43 | } | 43 | } |
44 | KIncidenceFormatter::KIncidenceFormatter() | 44 | KIncidenceFormatter::KIncidenceFormatter() |
45 | { | 45 | { |
46 | mColorMode = 0; | 46 | mColorMode = 0; |
47 | } | 47 | } |
48 | void KIncidenceFormatter::setEvent(Event *event) | 48 | void KIncidenceFormatter::setEvent(Event *event) |
49 | { | 49 | { |
50 | int mode = 0; | 50 | int mode = 0; |
51 | mCurrentIncidence = event; | 51 | mCurrentIncidence = event; |
52 | bool shortDate = true; | 52 | bool shortDate = true; |
53 | if ( mode == 0 ) { | 53 | if ( mode == 0 ) { |
54 | addTag("h3",deTag(event->summary())); | 54 | addTag("h3",deTag(event->summary())); |
55 | } | 55 | } |
56 | else { | 56 | else { |
57 | if ( mColorMode == 1 ) { | 57 | if ( mColorMode == 1 ) { |
58 | mText +="<font color=\"#00A000\">"; | 58 | mText +="<font color=\"#00A000\">"; |
59 | } | 59 | } |
60 | if ( mColorMode == 2 ) { | 60 | if ( mColorMode == 2 ) { |
61 | mText +="<font color=\"#C00000\">"; | 61 | mText +="<font color=\"#C00000\">"; |
62 | } | 62 | } |
63 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 63 | // mText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
64 | if ( mode == 1 ) { | 64 | if ( mode == 1 ) { |
65 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 65 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
66 | } else { | 66 | } else { |
67 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 67 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
68 | } | 68 | } |
69 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 69 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
70 | if ( mColorMode ) | 70 | if ( mColorMode ) |
71 | mText += "</font>"; | 71 | mText += "</font>"; |
72 | } | 72 | } |
73 | if (event->cancelled ()) { | 73 | if (event->cancelled ()) { |
74 | mText +="<font color=\"#B00000\">"; | 74 | mText +="<font color=\"#B00000\">"; |
75 | addTag("i",i18n("This event has been cancelled!")); | 75 | addTag("i",i18n("This event has been cancelled!")); |
76 | mText.append("<br>"); | 76 | mText.append("<br>"); |
77 | mText += "</font>"; | 77 | mText += "</font>"; |
78 | } | 78 | } |
79 | if (!event->location().isEmpty()) { | ||
80 | addTag("b",i18n("Location: ")); | ||
81 | mText.append(deTag(event->location())+"<br>"); | ||
82 | } | ||
83 | if (event->doesFloat()) { | 79 | if (event->doesFloat()) { |
84 | if (event->isMultiDay()) { | 80 | if (event->isMultiDay()) { |
85 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") | 81 | mText.append(i18n("<p><b>From:</b> %1 </p><p><b>To:</b> %2</p>") |
86 | .arg(event->dtStartDateStr(shortDate)) | 82 | .arg(event->dtStartDateStr(shortDate)) |
87 | .arg(event->dtEndDateStr(shortDate))); | 83 | .arg(event->dtEndDateStr(shortDate))); |
88 | } else { | 84 | } else { |
89 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); | 85 | mText.append(i18n("<p><b>On:</b> %1</p>").arg(event->dtStartDateStr( shortDate ))); |
90 | } | 86 | } |
91 | } else { | 87 | } else { |
92 | if (event->isMultiDay()) { | 88 | if (event->isMultiDay()) { |
93 | mText.append(i18n("<p><b>From:</b> %1</p> ") | 89 | mText.append(i18n("<p><b>From:</b> %1</p> ") |
94 | .arg(event->dtStartStr( shortDate))); | 90 | .arg(event->dtStartStr( shortDate))); |
95 | mText.append(i18n("<p><b>To:</b> %1</p>") | 91 | mText.append(i18n("<p><b>To:</b> %1</p>") |
96 | .arg(event->dtEndStr(shortDate))); | 92 | .arg(event->dtEndStr(shortDate))); |
97 | } else { | 93 | } else { |
98 | mText.append(i18n("<p><b>On:</b> %1</p> ") | ||
99 | .arg(event->dtStartDateStr( shortDate ))); | ||
100 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") | 94 | mText.append(i18n("<p><b>From:</b> %1 <b>To:</b> %2</p>") |
101 | .arg(event->dtStartTimeStr()) | 95 | .arg(event->dtStartTimeStr()) |
102 | .arg(event->dtEndTimeStr())); | 96 | .arg(event->dtEndTimeStr())); |
97 | mText.append(i18n("<p><b>On:</b> %1</p> ") | ||
98 | .arg(event->dtStartDateStr( shortDate ))); | ||
103 | } | 99 | } |
104 | } | 100 | } |
101 | if (!event->location().isEmpty()) { | ||
102 | addTag("b",i18n("Location: ")); | ||
103 | mText.append(deTag(event->location())+"<br>"); | ||
104 | } | ||
105 | 105 | ||
106 | if (event->recurrence()->doesRecur()) { | 106 | if (event->recurrence()->doesRecur()) { |
107 | 107 | ||
108 | QString recurText = event->recurrence()->recurrenceText(); | 108 | QString recurText = event->recurrence()->recurrenceText(); |
109 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); | 109 | addTag("p","<em>" + i18n("This is a %1 recurring event.").arg(recurText ) + "</em>"); |
110 | 110 | ||
111 | bool ok; | 111 | bool ok; |
112 | QDate start = QDate::currentDate(); | 112 | QDate start = QDate::currentDate(); |
113 | QDateTime next; | 113 | QDateTime next; |
114 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); | 114 | next = event->getNextOccurence( QDateTime::currentDateTime() , &ok ); |
115 | if ( ok ) { | 115 | if ( ok ) { |
116 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); | 116 | addTag("p",i18n("<b>Next recurrence is on:</b>") ); |
117 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); | 117 | addTag("p", KGlobal::locale()->formatDate( next.date(), shortDate )); |
118 | 118 | ||
119 | } else { | 119 | } else { |
120 | bool last; | 120 | bool last; |
121 | QDate nextd; | 121 | QDate nextd; |
122 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); | 122 | nextd = event->recurrence()->getPreviousDate( QDate::currentDate() , &last ); |
123 | if ( last ) { | 123 | if ( last ) { |
124 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); | 124 | addTag("p",i18n("<b>Last recurrence was on:</b>") ); |
125 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); | 125 | addTag("p", KGlobal::locale()->formatDate( nextd, shortDate )); |
126 | } | 126 | } |
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | 130 | ||
131 | if (event->isAlarmEnabled()) { | 131 | if (event->isAlarmEnabled()) { |
132 | Alarm *alarm =event->alarms().first() ; | 132 | Alarm *alarm =event->alarms().first() ; |
133 | QDateTime t = alarm->time(); | 133 | QDateTime t = alarm->time(); |
134 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 134 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
135 | addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); | 135 | addTag("p",i18n("<b>Alarm on: </b>") + s + ": "+KGlobal::locale()->formatDateTime( t, shortDate )); |
136 | //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 136 | //addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
137 | //addTag("p",s); | 137 | //addTag("p",s); |
138 | } | 138 | } |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); | 142 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); |
143 | // mText.append(event->secrecyStr()+"<br>"); | 143 | // mText.append(event->secrecyStr()+"<br>"); |
144 | formatCategories(event); | 144 | formatCategories(event); |
145 | if ( mDetails ) { | ||
146 | if (!event->description().isEmpty()) { | ||
147 | addTag("p",i18n("<b>Details: </b>")); | ||
148 | addTag("p",deTag(event->description())); | ||
149 | } | ||
150 | } | ||
151 | 145 | ||
152 | formatReadOnly(event); | 146 | formatReadOnly(event); |
153 | formatAttendees(event); | 147 | formatAttendees(event); |
154 | 148 | ||
155 | if ( mCreated ) { | 149 | if ( mCreated ) { |
150 | #ifdef DESKTOP_VERSION | ||
151 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
152 | #else | ||
156 | addTag("p",i18n("<b>Created: ") +" </b>"); | 153 | addTag("p",i18n("<b>Created: ") +" </b>"); |
157 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 154 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
155 | #endif | ||
158 | 156 | ||
159 | } | 157 | } |
160 | if ( mModified ) { | 158 | if ( mModified ) { |
159 | #ifdef DESKTOP_VERSION | ||
160 | addTag("p",i18n("<b>Last modified: ") +" </b>"+KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
161 | #else | ||
161 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | 162 | addTag("p",i18n("<b>Last modified: ") +" </b>"); |
162 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | 163 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); |
164 | #endif | ||
163 | 165 | ||
164 | } | 166 | } |
167 | if ( mDetails ) { | ||
168 | if (!event->description().isEmpty()) { | ||
169 | addTag("p",i18n("<b>Details: </b>")); | ||
170 | addTag("p",deTag(event->description())); | ||
171 | } | ||
172 | } | ||
165 | 173 | ||
166 | } | 174 | } |
167 | 175 | ||
168 | void KIncidenceFormatter::setTodo(Todo *event ) | 176 | void KIncidenceFormatter::setTodo(Todo *event ) |
169 | { | 177 | { |
170 | int mode = 0; | 178 | int mode = 0; |
171 | mCurrentIncidence = event; | 179 | mCurrentIncidence = event; |
172 | bool shortDate = true; | 180 | bool shortDate = true; |
173 | if (mode == 0 ) | 181 | if (mode == 0 ) |
174 | addTag("h3",deTag(event->summary())); | 182 | addTag("h3",deTag(event->summary())); |
175 | else { | 183 | else { |
176 | if ( mColorMode == 1 ) { | 184 | if ( mColorMode == 1 ) { |
177 | mText +="<font color=\"#00A000\">"; | 185 | mText +="<font color=\"#00A000\">"; |
178 | } | 186 | } |
179 | if ( mColorMode == 2 ) { | 187 | if ( mColorMode == 2 ) { |
180 | mText +="<font color=\"#B00000\">"; | 188 | mText +="<font color=\"#B00000\">"; |
181 | } | 189 | } |
182 | if ( mode == 1 ) { | 190 | if ( mode == 1 ) { |
183 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); | 191 | addTag("h2",i18n( "Local: " ) +deTag(event->summary())); |
184 | } else { | 192 | } else { |
185 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); | 193 | addTag("h2",i18n( "Remote: " ) +deTag(event->summary())); |
186 | } | 194 | } |
187 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); | 195 | addTag("h3",i18n( "Last modified: " ) + KGlobal::locale()->formatDateTime(event->lastModified(),shortDate, true ) ); |
188 | if ( mColorMode ) | 196 | if ( mColorMode ) |
189 | mText += "</font>"; | 197 | mText += "</font>"; |
190 | } | 198 | } |
191 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { | 199 | if ( event->percentComplete() == 100 && event->hasCompletedDate() ) { |
192 | mText +="<font color=\"#B00000\">"; | 200 | mText +="<font color=\"#B00000\">"; |
193 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(shortDate) ) ); | 201 | addTag("i", i18n("<p><i>Completed on %1</i></p>").arg( event->completedStr(shortDate) ) ); |
194 | mText += "</font>"; | 202 | mText += "</font>"; |
195 | } else { | 203 | } else { |
196 | mText.append(i18n("<p><i>%1 % completed</i></p>") | 204 | mText.append(i18n("<p><i>%1 % completed</i></p>") |
197 | .arg(event->percentComplete())); | 205 | .arg(event->percentComplete())); |
198 | } | 206 | } |
199 | if (event->cancelled ()) { | 207 | if (event->cancelled ()) { |
200 | mText +="<font color=\"#B00000\">"; | 208 | mText +="<font color=\"#B00000\">"; |
201 | addTag("i",i18n("This todo has been cancelled!")); | 209 | addTag("i",i18n("This todo has been cancelled!")); |
202 | mText.append("<br>"); | 210 | mText.append("<br>"); |
203 | mText += "</font>"; | 211 | mText += "</font>"; |
204 | } | 212 | } |
205 | 213 | ||
206 | if (!event->location().isEmpty()) { | 214 | |
207 | addTag("b",i18n("Location: ")); | ||
208 | mText.append(deTag(event->location())+"<br>"); | ||
209 | } | ||
210 | |||
211 | if (event->recurrence()->doesRecur()) { | 215 | if (event->recurrence()->doesRecur()) { |
212 | 216 | ||
213 | QString recurText = event->recurrence()->recurrenceText(); | 217 | QString recurText = event->recurrence()->recurrenceText(); |
214 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); | 218 | addTag("p","<em>" + i18n("This is a %1 recurring todo.").arg(recurText ) + "</em>"); |
215 | } | 219 | } |
216 | 220 | ||
217 | if (event->hasStartDate()) { | 221 | if (event->hasStartDate()) { |
218 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate))); | 222 | mText.append(i18n("<p><b>Start on:</b> %1</p>").arg(event->dtStartStr(shortDate))); |
219 | } | 223 | } |
220 | 224 | ||
221 | 225 | ||
222 | if (event->hasDueDate()) { | 226 | if (event->hasDueDate()) { |
223 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); | 227 | mText.append(i18n("<p><b>Due on:</b> %1</p>").arg(event->dtDueStr(shortDate))); |
224 | } | 228 | } |
229 | |||
230 | if (!event->location().isEmpty()) { | ||
231 | addTag("b",i18n("Location: ")); | ||
232 | mText.append(deTag(event->location())+"<br>"); | ||
233 | } | ||
234 | |||
225 | mText.append(i18n("<p><b>Priority:</b> %2</p>") | 235 | mText.append(i18n("<p><b>Priority:</b> %2</p>") |
226 | .arg(QString::number(event->priority()))); | 236 | .arg(QString::number(event->priority()))); |
227 | 237 | ||
228 | if (event->isAlarmEnabled()) { | 238 | if (event->isAlarmEnabled()) { |
229 | Alarm *alarm =event->alarms().first() ; | 239 | Alarm *alarm =event->alarms().first() ; |
230 | QDateTime t = alarm->time(); | 240 | QDateTime t = alarm->time(); |
231 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); | 241 | QString s =i18n("( %1 before )").arg( alarm->offsetText() ); |
232 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); | 242 | addTag("p",i18n("<b>Alarm on: ") + s +" </b>"); |
233 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); | 243 | addTag("p", KGlobal::locale()->formatDateTime( t, shortDate )); |
234 | //addTag("p",s); | 244 | //addTag("p",s); |
235 | } | 245 | } |
236 | 246 | ||
237 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); | 247 | addTag("p",i18n("<b>Access: </b>") +event->secrecyStr() ); |
238 | formatCategories(event); | 248 | formatCategories(event); |
239 | if ( mDetails ) { | 249 | |
240 | if (!event->description().isEmpty()) { | ||
241 | addTag("p",i18n("<b>Details: </b>")); | ||
242 | addTag("p",deTag(event->description())); | ||
243 | } | ||
244 | } | ||
245 | formatReadOnly(event); | 250 | formatReadOnly(event); |
246 | formatAttendees(event); | 251 | formatAttendees(event); |
247 | if ( mCreated ) { | 252 | if ( mCreated ) { |
253 | #ifdef DESKTOP_VERSION | ||
254 | addTag("p",i18n("<b>Created: ") +" </b>"+KGlobal::locale()->formatDateTime( event->created(), shortDate )); | ||
255 | #else | ||
248 | addTag("p",i18n("<b>Created: ") +" </b>"); | 256 | addTag("p",i18n("<b>Created: ") +" </b>"); |
249 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); | 257 | addTag("p", KGlobal::locale()->formatDateTime( event->created(), shortDate )); |
258 | #endif | ||
250 | 259 | ||
251 | } | 260 | } |
252 | if ( mModified ) { | 261 | if ( mModified ) { |
262 | #ifdef DESKTOP_VERSION | ||
263 | addTag("p",i18n("<b>Last modified: ") +" </b>"+KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | ||
264 | #else | ||
253 | addTag("p",i18n("<b>Last modified: ") +" </b>"); | 265 | addTag("p",i18n("<b>Last modified: ") +" </b>"); |
254 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); | 266 | addTag("p", KGlobal::locale()->formatDateTime( event->lastModified(), shortDate )); |
267 | #endif | ||
255 | 268 | ||
256 | } | 269 | } |
270 | if ( mDetails ) { | ||
271 | if (!event->description().isEmpty()) { | ||
272 | addTag("p",i18n("<b>Details: </b>")); | ||
273 | addTag("p",deTag(event->description())); | ||
274 | } | ||
275 | } | ||
257 | } | 276 | } |
258 | 277 | ||
259 | void KIncidenceFormatter::setJournal(Journal* ) | 278 | void KIncidenceFormatter::setJournal(Journal* ) |
260 | { | 279 | { |
261 | 280 | ||
262 | } | 281 | } |
263 | 282 | ||
264 | void KIncidenceFormatter::formatCategories(Incidence *event) | 283 | void KIncidenceFormatter::formatCategories(Incidence *event) |
265 | { | 284 | { |
266 | if (!event->categoriesStr().isEmpty()) { | 285 | if (!event->categoriesStr().isEmpty()) { |
267 | addTag("p",i18n("<b>Categories: </b>")+event->categoriesStr() ); | 286 | addTag("p",i18n("<b>Categories: </b>")+event->categoriesStr() ); |
268 | //mText.append(event->categoriesStr()); | 287 | //mText.append(event->categoriesStr()); |
269 | } | 288 | } |
270 | } | 289 | } |
271 | void KIncidenceFormatter::addTag(const QString & tag,const QString & text) | 290 | void KIncidenceFormatter::addTag(const QString & tag,const QString & text) |
272 | { | 291 | { |
273 | int number=text.contains("\n"); | 292 | int number=text.contains("\n"); |
274 | QString str = "<" + tag + ">"; | 293 | QString str = "<" + tag + ">"; |
275 | QString tmpText=text; | 294 | QString tmpText=text; |
276 | QString tmpStr=str; | 295 | QString tmpStr=str; |
277 | if(number !=-1) | 296 | if(number !=-1) |
278 | { | 297 | { |
279 | if (number > 0) { | 298 | if (number > 0) { |
280 | int pos=0; | 299 | int pos=0; |
281 | QString tmp; | 300 | QString tmp; |
282 | for(int i=0;i<=number;i++) { | 301 | for(int i=0;i<=number;i++) { |
283 | pos=tmpText.find("\n"); | 302 | pos=tmpText.find("\n"); |
284 | tmp=tmpText.left(pos); | 303 | tmp=tmpText.left(pos); |
285 | tmpText=tmpText.right(tmpText.length()-pos-1); | 304 | tmpText=tmpText.right(tmpText.length()-pos-1); |
286 | tmpStr+=tmp+"<br>"; | 305 | tmpStr+=tmp+"<br>"; |
287 | } | 306 | } |
288 | } | 307 | } |
289 | else tmpStr += tmpText; | 308 | else tmpStr += tmpText; |
290 | tmpStr+="</" + tag + ">"; | 309 | tmpStr+="</" + tag + ">"; |
291 | mText.append(tmpStr); | 310 | mText.append(tmpStr); |
292 | } | 311 | } |
293 | else | 312 | else |
294 | { | 313 | { |
295 | str += text + "</" + tag + ">"; | 314 | str += text + "</" + tag + ">"; |
296 | mText.append(str); | 315 | mText.append(str); |
297 | } | 316 | } |
298 | } | 317 | } |
299 | 318 | ||
300 | void KIncidenceFormatter::formatAttendees(Incidence *event) | 319 | void KIncidenceFormatter::formatAttendees(Incidence *event) |
301 | { | 320 | { |
302 | QPtrList<Attendee> attendees = event->attendees(); | 321 | QPtrList<Attendee> attendees = event->attendees(); |
303 | if (attendees.count()) { | 322 | if (attendees.count()) { |
304 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); | 323 | QString iconPath = KGlobal::iconLoader()->iconPath("mailappt",KIcon::Small); |
305 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); | 324 | QString NOiconPath = KGlobal::iconLoader()->iconPath("nomailappt",KIcon::Small); |
306 | addTag("h3",i18n("Organizer")); | 325 | addTag("h3",i18n("Organizer")); |
307 | mText.append("<ul><li>"); | 326 | mText.append("<ul><li>"); |
308 | #if 0 | 327 | #if 0 |
309 | //ndef KORG_NOKABC | 328 | //ndef KORG_NOKABC |
310 | 329 | ||
311 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); | 330 | KABC::AddressBook *add_book = KABC::StdAddressBook::self(); |
312 | KABC::Addressee::List addressList; | 331 | KABC::Addressee::List addressList; |
313 | addressList = add_book->findByEmail(event->organizer()); | 332 | addressList = add_book->findByEmail(event->organizer()); |
314 | KABC::Addressee o = addressList.first(); | 333 | KABC::Addressee o = addressList.first(); |
315 | if (!o.isEmpty() && addressList.size()<2) { | 334 | if (!o.isEmpty() && addressList.size()<2) { |
316 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 335 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
317 | mText += o.formattedName(); | 336 | mText += o.formattedName(); |
318 | mText += "</a>\n"; | 337 | mText += "</a>\n"; |
319 | } else { | 338 | } else { |
320 | mText.append(event->organizer()); | 339 | mText.append(event->organizer()); |
321 | } | 340 | } |
322 | #else | 341 | #else |
323 | mText.append(event->organizer()); | 342 | mText.append(event->organizer()); |
324 | #endif | 343 | #endif |
325 | if (iconPath) { | 344 | if (iconPath) { |
326 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; | 345 | mText += " <a href=\"mailto:" + event->organizer() + "\">"; |
327 | mText += "<IMG src=\"" + iconPath + "\">"; | 346 | mText += "<IMG src=\"" + iconPath + "\">"; |
328 | mText += "</a>\n"; | 347 | mText += "</a>\n"; |
329 | } | 348 | } |
330 | mText.append("</li></ul>"); | 349 | mText.append("</li></ul>"); |
331 | 350 | ||
332 | addTag("h3",i18n("Attendees")); | 351 | addTag("h3",i18n("Attendees")); |
333 | Attendee *a; | 352 | Attendee *a; |
334 | mText.append("<ul>"); | 353 | mText.append("<ul>"); |
335 | for(a=attendees.first();a;a=attendees.next()) { | 354 | for(a=attendees.first();a;a=attendees.next()) { |
336 | #if 0 | 355 | #if 0 |
337 | //ndef KORG_NOKABC | 356 | //ndef KORG_NOKABC |
338 | if (a->name().isEmpty()) { | 357 | if (a->name().isEmpty()) { |
339 | addressList = add_book->findByEmail(a->email()); | 358 | addressList = add_book->findByEmail(a->email()); |
340 | KABC::Addressee o = addressList.first(); | 359 | KABC::Addressee o = addressList.first(); |
341 | if (!o.isEmpty() && addressList.size()<2) { | 360 | if (!o.isEmpty() && addressList.size()<2) { |
342 | mText += "<a href=\"uid:" + o.uid() + "\">"; | 361 | mText += "<a href=\"uid:" + o.uid() + "\">"; |
343 | mText += o.formattedName(); | 362 | mText += o.formattedName(); |
344 | mText += "</a>\n"; | 363 | mText += "</a>\n"; |
345 | } else { | 364 | } else { |
346 | mText += "<li>"; | 365 | mText += "<li>"; |
347 | mText.append(a->email()); | 366 | mText.append(a->email()); |
348 | mText += "\n"; | 367 | mText += "\n"; |
349 | } | 368 | } |
350 | } else { | 369 | } else { |
351 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 370 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
352 | if (!a->name().isEmpty()) mText += a->name(); | 371 | if (!a->name().isEmpty()) mText += a->name(); |
353 | else mText += a->email(); | 372 | else mText += a->email(); |
354 | mText += "</a>\n"; | 373 | mText += "</a>\n"; |
355 | } | 374 | } |
356 | #else | 375 | #else |
357 | //qDebug("nokabc "); | 376 | //qDebug("nokabc "); |
358 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; | 377 | mText += "<li><a href=\"uid:" + a->uid() + "\">"; |
359 | if (!a->name().isEmpty()) mText += a->name(); | 378 | if (!a->name().isEmpty()) mText += a->name(); |
360 | else mText += a->email(); | 379 | else mText += a->email(); |
361 | mText += "</a>\n"; | 380 | mText += "</a>\n"; |
362 | #endif | 381 | #endif |
363 | 382 | ||
364 | if (!a->email().isEmpty()) { | 383 | if (!a->email().isEmpty()) { |
365 | if (iconPath) { | 384 | if (iconPath) { |
366 | mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; | 385 | mText += "<a href=\"mailto:" + a->name() +" "+ "<" + a->email() + ">" + "\">"; |
367 | if ( a->RSVP() ) | 386 | if ( a->RSVP() ) |
368 | mText += "<IMG src=\"" + iconPath + "\">"; | 387 | mText += "<IMG src=\"" + iconPath + "\">"; |
369 | else | 388 | else |
370 | mText += "<IMG src=\"" + NOiconPath + "\">"; | 389 | mText += "<IMG src=\"" + NOiconPath + "\">"; |
371 | mText += "</a>\n"; | 390 | mText += "</a>\n"; |
372 | } | 391 | } |
373 | } | 392 | } |
374 | if (a->status() != Attendee::NeedsAction ) | 393 | if (a->status() != Attendee::NeedsAction ) |
375 | mText +="[" + a->statusStr() + "] "; | 394 | mText +="[" + a->statusStr() + "] "; |
376 | if (a->role() == Attendee::Chair ) | 395 | if (a->role() == Attendee::Chair ) |
377 | mText +="(" + a->roleStr().left(1) + ".)"; | 396 | mText +="(" + a->roleStr().left(1) + ".)"; |
378 | } | 397 | } |
379 | mText.append("</li></ul>"); | 398 | mText.append("</li></ul>"); |
380 | } | 399 | } |
381 | } | 400 | } |
382 | 401 | ||
383 | void KIncidenceFormatter::formatReadOnly(Incidence *event) | 402 | void KIncidenceFormatter::formatReadOnly(Incidence *event) |
384 | { | 403 | { |
385 | if (event->isReadOnly()) { | 404 | if (event->isReadOnly()) { |
386 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); | 405 | addTag("p","<em>(" + i18n("read-only") + ")</em>"); |
387 | } | 406 | } |
388 | } | 407 | } |
389 | QString KIncidenceFormatter::deTag(QString text) | 408 | QString KIncidenceFormatter::deTag(QString text) |
390 | { | 409 | { |
391 | #if QT_VERSION >= 0x030000 | 410 | #if QT_VERSION >= 0x030000 |
392 | text.replace( '<' , "<" ); | 411 | text.replace( '<' , "<" ); |
393 | text.replace( '>' , ">" ); | 412 | text.replace( '>' , ">" ); |
394 | #else | 413 | #else |
395 | if ( text.find ('<') >= 0 ) { | 414 | if ( text.find ('<') >= 0 ) { |
396 | text.replace( QRegExp("<") , "<" ); | 415 | text.replace( QRegExp("<") , "<" ); |
397 | } | 416 | } |
398 | if ( text.find ('>') >= 0 ) { | 417 | if ( text.find ('>') >= 0 ) { |
399 | text.replace( QRegExp(">") , ">" ); | 418 | text.replace( QRegExp(">") , ">" ); |
400 | } | 419 | } |
401 | #endif | 420 | #endif |
402 | return text; | 421 | return text; |
403 | } | 422 | } |