-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | Makefile.Embedded | 9 | ||||
-rw-r--r-- | bin/kdepim/kopiemail/germantranslation.txt | 10 | ||||
-rw-r--r-- | kmicromail/koprefs.cpp | 5 | ||||
-rw-r--r-- | kmicromail/koprefs.h | 1 | ||||
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 19 | ||||
-rw-r--r-- | kmicromail/mainwindow.cpp | 64 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 3 | ||||
-rw-r--r-- | korganizer/kowhatsnextview.cpp | 2 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.cpp | 10 | ||||
-rw-r--r-- | microkde/KDGanttMinimizeSplitter.h | 2 |
11 files changed, 101 insertions, 33 deletions
@@ -1,382 +1,383 @@ | |||
1 | export KDEPIMDIR = $(shell pwd) | 1 | export KDEPIMDIR = $(shell pwd) |
2 | 2 | ||
3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) | 3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) |
4 | 4 | ||
5 | ifeq ($(PLATFORM) , zaurus) | 5 | ifeq ($(PLATFORM) , zaurus) |
6 | BUILD_NO_LDAP_PLUGIN=1 | 6 | BUILD_NO_LDAP_PLUGIN=1 |
7 | endif | 7 | endif |
8 | 8 | ||
9 | ifneq ($(PLATFORM) , zaurus) | 9 | ifneq ($(PLATFORM) , zaurus) |
10 | BUILD_NO_SHARP_PLUGIN=1 | 10 | BUILD_NO_SHARP_PLUGIN=1 |
11 | endif | 11 | endif |
12 | 12 | ||
13 | #opie plugin is deprecated. The qtopia plugin handles the task from now on. | 13 | #opie plugin is deprecated. The qtopia plugin handles the task from now on. |
14 | BUILD_NO_OPIE_PLUGIN=1 | 14 | BUILD_NO_OPIE_PLUGIN=1 |
15 | 15 | ||
16 | SUBDIRS_MICROKDE = \ | 16 | SUBDIRS_MICROKDE = \ |
17 | libical/src/libical \ | 17 | libical/src/libical \ |
18 | libical/src/libicalss \ | 18 | libical/src/libicalss \ |
19 | qtcompat \ | 19 | qtcompat \ |
20 | microkde \ | 20 | microkde \ |
21 | libkcal \ | 21 | libkcal \ |
22 | libkdepim \ | 22 | libkdepim \ |
23 | kabc \ | 23 | kabc \ |
24 | kabc/formats/binary \ | 24 | kabc/formats/binary \ |
25 | kabc/plugins/file \ | 25 | kabc/plugins/file \ |
26 | kabc/plugins/dir \ | 26 | kabc/plugins/dir \ |
27 | korganizer \ | 27 | korganizer \ |
28 | kalarmd \ | 28 | kalarmd \ |
29 | kaddressbook | 29 | kaddressbook |
30 | 30 | ||
31 | SUBDIRS_QTOPIA_PLUGIN = \ | 31 | SUBDIRS_QTOPIA_PLUGIN = \ |
32 | kabc/plugins/qtopia | 32 | kabc/plugins/qtopia |
33 | 33 | ||
34 | SUBDIRS_OPIE_PLUGIN = \ | 34 | SUBDIRS_OPIE_PLUGIN = \ |
35 | kabc/plugins/opie | 35 | kabc/plugins/opie |
36 | 36 | ||
37 | SUBDIRS_SHARP_PLUGIN = \ | 37 | SUBDIRS_SHARP_PLUGIN = \ |
38 | kabc/plugins/sharpdtm | 38 | kabc/plugins/sharpdtm |
39 | 39 | ||
40 | SUBDIRS_LDAP_PLUGIN = \ | 40 | SUBDIRS_LDAP_PLUGIN = \ |
41 | kabc/plugins/ldap | 41 | kabc/plugins/ldap |
42 | 42 | ||
43 | SUBDIRS_MICROMAIL = \ | 43 | SUBDIRS_MICROMAIL = \ |
44 | kmicromail/libetpan \ | 44 | kmicromail/libetpan \ |
45 | kmicromail/libmailwrapper \ | 45 | kmicromail/libmailwrapper \ |
46 | kmicromail | 46 | kmicromail |
47 | 47 | ||
48 | SUBDIRS_GAMMU = \ | 48 | SUBDIRS_GAMMU = \ |
49 | gammu/emb/common \ | 49 | gammu/emb/common \ |
50 | gammu/emb/gammu | 50 | gammu/emb/gammu |
51 | 51 | ||
52 | SUBDIRS_PWMANAGER = \ | 52 | SUBDIRS_PWMANAGER = \ |
53 | pwmanager/libcrypt/mpi \ | 53 | pwmanager/libcrypt/mpi \ |
54 | pwmanager/libcrypt/error \ | 54 | pwmanager/libcrypt/error \ |
55 | pwmanager/libcrypt/cipher \ | 55 | pwmanager/libcrypt/cipher \ |
56 | pwmanager/libcrypt/zlib \ | 56 | pwmanager/libcrypt/zlib \ |
57 | pwmanager/pwmanager | 57 | pwmanager/pwmanager |
58 | 58 | ||
59 | SUBDIRS = \ | 59 | SUBDIRS = \ |
60 | $(SUBDIRS_MICROKDE) \ | 60 | $(SUBDIRS_MICROKDE) \ |
61 | $(SUBDIRS_QTOPIA_PLUGIN) \ | 61 | $(SUBDIRS_QTOPIA_PLUGIN) \ |
62 | $(SUBDIRS_OPIE_PLUGIN) \ | 62 | $(SUBDIRS_OPIE_PLUGIN) \ |
63 | $(SUBDIRS_SHARP_PLUGIN) \ | 63 | $(SUBDIRS_SHARP_PLUGIN) \ |
64 | $(SUBDIRS_LDAP_PLUGIN) \ | 64 | $(SUBDIRS_LDAP_PLUGIN) \ |
65 | $(SUBDIRS_MICROMAIL) \ | 65 | $(SUBDIRS_MICROMAIL) \ |
66 | $(SUBDIRS_GAMMU) \ | 66 | $(SUBDIRS_GAMMU) \ |
67 | $(SUBDIRS_PWMANAGER) | 67 | $(SUBDIRS_PWMANAGER) |
68 | 68 | ||
69 | 69 | ||
70 | all: build_microkde \ | 70 | all: build_microkde \ |
71 | build_qtopia_plugin \ | 71 | build_qtopia_plugin \ |
72 | build_opie_plugin \ | 72 | build_opie_plugin \ |
73 | build_sharp_plugin \ | 73 | build_sharp_plugin \ |
74 | build_ldap_plugin \ | 74 | build_ldap_plugin \ |
75 | build_micromail \ | 75 | build_micromail \ |
76 | build_gammu \ | 76 | build_gammu \ |
77 | build_pwmanager | 77 | build_pwmanager |
78 | 78 | ||
79 | 79 | ||
80 | build_microkde: variable_test tmake | 80 | build_microkde: variable_test tmake |
81 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ | 81 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ |
82 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 82 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
83 | done | 83 | done |
84 | 84 | ||
85 | build_qtopia_plugin: build_microkde | 85 | build_qtopia_plugin: build_microkde |
86 | ifdef BUILD_NO_QTOPIA_PLUGIN | 86 | ifdef BUILD_NO_QTOPIA_PLUGIN |
87 | @echo == qtopia plugin not build. | 87 | @echo == qtopia plugin not build. |
88 | else | 88 | else |
89 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ | 89 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ |
90 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 90 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
91 | done | 91 | done |
92 | endif | 92 | endif |
93 | 93 | ||
94 | build_opie_plugin: build_microkde | 94 | build_opie_plugin: build_microkde |
95 | ifdef BUILD_NO_OPIE_PLUGIN | 95 | ifdef BUILD_NO_OPIE_PLUGIN |
96 | @echo == opie plugin not build. | 96 | @echo == opie plugin not build. |
97 | else | 97 | else |
98 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ | 98 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ |
99 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 99 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
100 | done | 100 | done |
101 | endif | 101 | endif |
102 | 102 | ||
103 | build_sharp_plugin: build_microkde | 103 | build_sharp_plugin: build_microkde |
104 | ifdef BUILD_NO_SHARP_PLUGIN | 104 | ifdef BUILD_NO_SHARP_PLUGIN |
105 | @echo == ldap plugin not build. | 105 | @echo == ldap plugin not build. |
106 | else | 106 | else |
107 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ | 107 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ |
108 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 108 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
109 | done | 109 | done |
110 | endif | 110 | endif |
111 | 111 | ||
112 | build_ldap_plugin: build_microkde | 112 | build_ldap_plugin: build_microkde |
113 | ifdef BUILD_NO_LDAP_PLUGIN | 113 | ifdef BUILD_NO_LDAP_PLUGIN |
114 | @echo == ldap plugin not build. | 114 | @echo == ldap plugin not build. |
115 | else | 115 | else |
116 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ | 116 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ |
117 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 117 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
118 | done | 118 | done |
119 | endif | 119 | endif |
120 | 120 | ||
121 | 121 | ||
122 | build_micromail: build_microkde | 122 | build_micromail: build_microkde |
123 | ifdef BUILD_NO_MICROMAIL | 123 | ifdef BUILD_NO_MICROMAIL |
124 | @echo == kmicromail not build. | 124 | @echo == kmicromail not build. |
125 | else | 125 | else |
126 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ | 126 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ |
127 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 127 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
128 | done | 128 | done |
129 | endif | 129 | endif |
130 | 130 | ||
131 | build_gammu: variable_test tmake | 131 | build_gammu: variable_test tmake |
132 | ifdef BUILD_NO_GAMMU | 132 | ifdef BUILD_NO_GAMMU |
133 | @echo == gammu not build. | 133 | @echo == gammu not build. |
134 | else | 134 | else |
135 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ | 135 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ |
136 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 136 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
137 | done | 137 | done |
138 | endif | 138 | endif |
139 | 139 | ||
140 | build_pwmanager: build_microkde | 140 | build_pwmanager: build_microkde |
141 | ifdef BUILD_NO_PWMANAGER | 141 | ifdef BUILD_NO_PWMANAGER |
142 | @echo == pwmanager not build. | 142 | @echo == pwmanager not build. |
143 | else | 143 | else |
144 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ | 144 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ |
145 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 145 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
146 | done | 146 | done |
147 | endif | 147 | endif |
148 | 148 | ||
149 | 149 | ||
150 | variable_info: | 150 | variable_info: |
151 | @echo -------------------------------------- | 151 | @echo -------------------------------------- |
152 | @echo KDEPIM buildsystem, variableinfo... | 152 | @echo KDEPIM buildsystem, variableinfo... |
153 | @echo KDEPIMDIR=$(KDEPIMDIR) | 153 | @echo KDEPIMDIR=$(KDEPIMDIR) |
154 | @echo QTDIR=$(QTDIR) | 154 | @echo QTDIR=$(QTDIR) |
155 | @echo QPEDIR=$(QPEDIR) | 155 | @echo QPEDIR=$(QPEDIR) |
156 | @echo OPIEDIR=$(OPIEDIR) | 156 | @echo OPIEDIR=$(OPIEDIR) |
157 | @echo PLATFORM=$(PLATFORM) | 157 | @echo PLATFORM=$(PLATFORM) |
158 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) | 158 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) |
159 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) | 159 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) |
160 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) | 160 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) |
161 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) | 161 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) |
162 | @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) | 162 | @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) |
163 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) | 163 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) |
164 | ifndef BUILD_NO_SHARP_PLUGIN | 164 | ifndef BUILD_NO_SHARP_PLUGIN |
165 | @echo SHARPDTMSDK=$(SHARPDTMSDK) | 165 | @echo SHARPDTMSDK=$(SHARPDTMSDK) |
166 | endif | 166 | endif |
167 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) | 167 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) |
168 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) | 168 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) |
169 | @echo -------------------------------------- | 169 | @echo -------------------------------------- |
170 | 170 | ||
171 | variable_test: variable_info | 171 | variable_test: variable_info |
172 | @echo KDEPIM buildsystem, variablecheck... | 172 | @echo KDEPIM buildsystem, variablecheck... |
173 | ifndef KDEPIMDIR | 173 | ifndef KDEPIMDIR |
174 | @echo KDEPIMDIR is not defined. | 174 | @echo KDEPIMDIR is not defined. |
175 | $(error KDEPIMDIR is not defined) | 175 | $(error KDEPIMDIR is not defined) |
176 | endif | 176 | endif |
177 | ifndef PLATFORM | 177 | ifndef PLATFORM |
178 | @echo PLATFORM is not defined. | 178 | @echo PLATFORM is not defined. |
179 | $(error PLATFORM is not defined) | 179 | $(error PLATFORM is not defined) |
180 | endif | 180 | endif |
181 | ifdef BUILD_NO_LDAP_PLUGIN | 181 | ifdef BUILD_NO_LDAP_PLUGIN |
182 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) | 182 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) |
183 | endif | 183 | endif |
184 | ifdef BUILD_NO_OPIE_PLUGIN | 184 | ifdef BUILD_NO_OPIE_PLUGIN |
185 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) | 185 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) |
186 | endif | 186 | endif |
187 | ifdef BUILD_NO_QTOPIA_PLUGIN | 187 | ifdef BUILD_NO_QTOPIA_PLUGIN |
188 | @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) | 188 | @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) |
189 | endif | 189 | endif |
190 | ifdef BUILD_NO_MICROMAIL | 190 | ifdef BUILD_NO_MICROMAIL |
191 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) | 191 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) |
192 | endif | 192 | endif |
193 | ifdef BUILD_NO_SHARP_PLUGIN | 193 | ifdef BUILD_NO_SHARP_PLUGIN |
194 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) | 194 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) |
195 | else | 195 | else |
196 | ifndef SHARPDTMSDK | 196 | ifndef SHARPDTMSDK |
197 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) | 197 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) |
198 | $(error SHARPDTMSDK is not defined) | 198 | $(error SHARPDTMSDK is not defined) |
199 | endif | 199 | endif |
200 | endif | 200 | endif |
201 | ifdef BUILD_NO_GAMMU | 201 | ifdef BUILD_NO_GAMMU |
202 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) | 202 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) |
203 | endif | 203 | endif |
204 | ifdef BUILD_NO_PWMANAGER | 204 | ifdef BUILD_NO_PWMANAGER |
205 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) | 205 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) |
206 | endif | 206 | endif |
207 | @echo -------------------------------------- | 207 | @echo -------------------------------------- |
208 | 208 | ||
209 | 209 | ||
210 | objects: | 210 | objects: |
211 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done | 211 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done |
212 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done | 212 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done |
213 | mkdir -p libical/lib/$(PLATFORM) | 213 | mkdir -p libical/lib/$(PLATFORM) |
214 | mkdir -p pwmanager/libcrypt/$(PLATFORM) | 214 | mkdir -p pwmanager/libcrypt/$(PLATFORM) |
215 | 215 | ||
216 | clean: | 216 | clean: |
217 | rm -rf libical/lib/$(PLATFORM)/*; | 217 | rm -rf libical/lib/$(PLATFORM)/*; |
218 | rm -rf pwmanager/libcrypt/$(PLATFORM)/*; | 218 | rm -rf pwmanager/libcrypt/$(PLATFORM)/*; |
219 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ | 219 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ |
220 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ | 220 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ |
221 | done | 221 | done |
222 | 222 | ||
223 | pac: | 223 | pac: |
224 | rm -f $(QPEDIR)/lib/libmicro* | 224 | rm -f $(QPEDIR)/lib/libmicro* |
225 | rm -f $(QPEDIR)/plugins/applets/libkopi* | 225 | rm -f $(QPEDIR)/plugins/applets/libkopi* |
226 | make | 226 | make |
227 | make install | 227 | make install |
228 | make dist | 228 | make dist |
229 | install: | 229 | install: |
230 | 230 | ||
231 | cd bin/kdepim; make install | 231 | cd bin/kdepim; make install |
232 | cp -r Pim $(QPEDIR)/apps | 232 | cp -r Pim $(QPEDIR)/apps |
233 | cp db2file/db2file $(QPEDIR)/bin/db2file | 233 | cp db2file/db2file $(QPEDIR)/bin/db2file |
234 | chmod ugo+x $(QPEDIR)/bin/db2file | 234 | chmod ugo+x $(QPEDIR)/bin/db2file |
235 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop | 235 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop |
236 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop | 236 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop |
237 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop | 237 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop |
238 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop | 238 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop |
239 | 239 | ||
240 | dist: | 240 | dist: |
241 | @echo Dont forget to do "make install" before "make dist" | 241 | @echo Dont forget to do "make install" before "make dist" |
242 | rm -f *arm.ipk | 242 | rm -f *arm.ipk |
243 | rm -f *ipk.zip | 243 | rm -f *ipk.zip |
244 | rm -f ../new_$(KDEPIM_VERSION)/* | 244 | rm -f ../new_$(KDEPIM_VERSION)/* |
245 | rm -f *~ | 245 | rm -f *~ |
246 | cd ..;mkdir -p new_$(KDEPIM_VERSION) | 246 | cd ..;mkdir -p kdepimpi_$(KDEPIM_VERSION) |
247 | cd ../kdepimpi_$(KDEPIM_VERSION);mkdir -p ipk | ||
247 | cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim | 248 | cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim |
248 | mkipks kmicrokdelibs.control | 249 | mkipks kmicrokdelibs.control |
249 | mkipks korganizer.control | 250 | mkipks korganizer.control |
250 | mkipks kaddressbook.control | 251 | mkipks kaddressbook.control |
251 | ifndef BUILD_NO_MICROMAIL | 252 | ifndef BUILD_NO_MICROMAIL |
252 | mkipks kopiemail.control | 253 | mkipks kopiemail.control |
253 | endif | 254 | endif |
254 | ifndef BUILD_NO_SHARP_PLUGIN | 255 | ifndef BUILD_NO_SHARP_PLUGIN |
255 | mkipks ksharpPIM-DTMaccess.control | 256 | mkipks ksharpPIM-DTMaccess.control |
256 | endif | 257 | endif |
257 | mkipks korganizer-alarm.control | 258 | mkipks korganizer-alarm.control |
258 | ifndef BUILD_NO_GAMMU | 259 | ifndef BUILD_NO_GAMMU |
259 | mkipks kmobilephoneaccess.control | 260 | mkipks kmobilephoneaccess.control |
260 | endif | 261 | endif |
261 | ifndef BUILD_NO_PWMANAGER | 262 | ifndef BUILD_NO_PWMANAGER |
262 | mkipks pwmanager.control | 263 | mkipks pwmanager.control |
263 | endif | 264 | endif |
264 | mkipks pimTABicon.control | 265 | mkipks pimTABicon.control |
265 | zip kdepim_$(KDEPIM_VERSION)_for_SharpRom.ipk.zip *.ipk ReleaseNotes.txt | 266 | zip kdepim_$(KDEPIM_VERSION)_for_SharpRom.ipk.zip *.ipk ReleaseNotes.txt |
266 | mv *.ipk ../new_$(KDEPIM_VERSION)/ | 267 | mv *.ipk ../kdepimpi_$(KDEPIM_VERSION)/ipk/ |
267 | mv *for_SharpRom.ipk.zip ../new_$(KDEPIM_VERSION)/ | 268 | mv *for_SharpRom.ipk.zip ../kdepimpi_$(KDEPIM_VERSION)/ |
268 | mv ../kdepimpi-$(KDEPIM_VERSION).tar.gz ../new_$(KDEPIM_VERSION)/ | 269 | mv ../kdepimpi-$(KDEPIM_VERSION).tar.gz ../kdepimpi_$(KDEPIM_VERSION)/ |
269 | 270 | ||
270 | tmake: objects \ | 271 | tmake: objects \ |
271 | qtcompat/Makefile$(PLATFORM) \ | 272 | qtcompat/Makefile$(PLATFORM) \ |
272 | microkde/Makefile$(PLATFORM) \ | 273 | microkde/Makefile$(PLATFORM) \ |
273 | libkcal/Makefile$(PLATFORM) \ | 274 | libkcal/Makefile$(PLATFORM) \ |
274 | libkdepim/Makefile$(PLATFORM) \ | 275 | libkdepim/Makefile$(PLATFORM) \ |
275 | korganizer/Makefile$(PLATFORM) \ | 276 | korganizer/Makefile$(PLATFORM) \ |
276 | kalarmd/Makefile$(PLATFORM) \ | 277 | kalarmd/Makefile$(PLATFORM) \ |
277 | libical/src/libical/Makefile$(PLATFORM) \ | 278 | libical/src/libical/Makefile$(PLATFORM) \ |
278 | libical/src/libicalss/Makefile$(PLATFORM) \ | 279 | libical/src/libicalss/Makefile$(PLATFORM) \ |
279 | kabc/Makefile$(PLATFORM) \ | 280 | kabc/Makefile$(PLATFORM) \ |
280 | kabc/formats/binary/Makefile$(PLATFORM) \ | 281 | kabc/formats/binary/Makefile$(PLATFORM) \ |
281 | kabc/plugins/file/Makefile$(PLATFORM) \ | 282 | kabc/plugins/file/Makefile$(PLATFORM) \ |
282 | kabc/plugins/dir/Makefile$(PLATFORM) \ | 283 | kabc/plugins/dir/Makefile$(PLATFORM) \ |
283 | kabc/plugins/ldap/Makefile$(PLATFORM) \ | 284 | kabc/plugins/ldap/Makefile$(PLATFORM) \ |
284 | kabc/plugins/opie/Makefile$(PLATFORM) \ | 285 | kabc/plugins/opie/Makefile$(PLATFORM) \ |
285 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ | 286 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ |
286 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ | 287 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ |
287 | kaddressbook/Makefile$(PLATFORM) \ | 288 | kaddressbook/Makefile$(PLATFORM) \ |
288 | kmicromail/Makefile$(PLATFORM) \ | 289 | kmicromail/Makefile$(PLATFORM) \ |
289 | kmicromail/libetpan/Makefile$(PLATFORM) \ | 290 | kmicromail/libetpan/Makefile$(PLATFORM) \ |
290 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ | 291 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ |
291 | gammu/emb/common/Makefile$(PLATFORM) \ | 292 | gammu/emb/common/Makefile$(PLATFORM) \ |
292 | gammu/emb/gammu/Makefile$(PLATFORM) \ | 293 | gammu/emb/gammu/Makefile$(PLATFORM) \ |
293 | pwmanager/pwmanager/Makefile$(PLATFORM) \ | 294 | pwmanager/pwmanager/Makefile$(PLATFORM) \ |
294 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \ | 295 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \ |
295 | pwmanager/libcrypt/error/Makefile$(PLATFORM) \ | 296 | pwmanager/libcrypt/error/Makefile$(PLATFORM) \ |
296 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \ | 297 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \ |
297 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM) | 298 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM) |
298 | 299 | ||
299 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro | 300 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro |
300 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) | 301 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) |
301 | 302 | ||
302 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro | 303 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro |
303 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) | 304 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) |
304 | 305 | ||
305 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro | 306 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro |
306 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) | 307 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) |
307 | 308 | ||
308 | 309 | ||
309 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro | 310 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro |
310 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) | 311 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) |
311 | 312 | ||
312 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro | 313 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro |
313 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) | 314 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) |
314 | 315 | ||
315 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro | 316 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro |
316 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) | 317 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) |
317 | 318 | ||
318 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro | 319 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro |
319 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) | 320 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) |
320 | 321 | ||
321 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro | 322 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro |
322 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) | 323 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) |
323 | 324 | ||
324 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro | 325 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro |
325 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) | 326 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) |
326 | 327 | ||
327 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro | 328 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro |
328 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) | 329 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) |
329 | 330 | ||
330 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro | 331 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro |
331 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) | 332 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) |
332 | 333 | ||
333 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro | 334 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro |
334 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) | 335 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) |
335 | 336 | ||
336 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro | 337 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro |
337 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) | 338 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) |
338 | 339 | ||
339 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro | 340 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro |
340 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) | 341 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) |
341 | 342 | ||
342 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro | 343 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro |
343 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) | 344 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) |
344 | 345 | ||
345 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro | 346 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro |
346 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) | 347 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) |
347 | 348 | ||
348 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro | 349 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro |
349 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) | 350 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) |
350 | 351 | ||
351 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro | 352 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro |
352 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) | 353 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) |
353 | 354 | ||
354 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro | 355 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro |
355 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) | 356 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) |
356 | 357 | ||
357 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro | 358 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro |
358 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) | 359 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) |
359 | 360 | ||
360 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro | 361 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro |
361 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) | 362 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) |
362 | 363 | ||
363 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro | 364 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro |
364 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) | 365 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) |
365 | 366 | ||
366 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro | 367 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro |
367 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) | 368 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) |
368 | 369 | ||
369 | 370 | ||
370 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro | 371 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro |
371 | cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM) | 372 | cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM) |
372 | 373 | ||
373 | pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro | 374 | pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro |
374 | cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM) | 375 | cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM) |
375 | 376 | ||
376 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro | 377 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro |
377 | cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM) | 378 | cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM) |
378 | 379 | ||
379 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro | 380 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro |
380 | cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM) | 381 | cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM) |
381 | 382 | ||
382 | 383 | ||
diff --git a/Makefile.Embedded b/Makefile.Embedded index 68619b9..9656532 100644 --- a/Makefile.Embedded +++ b/Makefile.Embedded | |||
@@ -1,382 +1,383 @@ | |||
1 | export KDEPIMDIR = $(shell pwd) | 1 | export KDEPIMDIR = $(shell pwd) |
2 | 2 | ||
3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) | 3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) |
4 | 4 | ||
5 | ifeq ($(PLATFORM) , zaurus) | 5 | ifeq ($(PLATFORM) , zaurus) |
6 | BUILD_NO_LDAP_PLUGIN=1 | 6 | BUILD_NO_LDAP_PLUGIN=1 |
7 | endif | 7 | endif |
8 | 8 | ||
9 | ifneq ($(PLATFORM) , zaurus) | 9 | ifneq ($(PLATFORM) , zaurus) |
10 | BUILD_NO_SHARP_PLUGIN=1 | 10 | BUILD_NO_SHARP_PLUGIN=1 |
11 | endif | 11 | endif |
12 | 12 | ||
13 | #opie plugin is deprecated. The qtopia plugin handles the task from now on. | 13 | #opie plugin is deprecated. The qtopia plugin handles the task from now on. |
14 | BUILD_NO_OPIE_PLUGIN=1 | 14 | BUILD_NO_OPIE_PLUGIN=1 |
15 | 15 | ||
16 | SUBDIRS_MICROKDE = \ | 16 | SUBDIRS_MICROKDE = \ |
17 | libical/src/libical \ | 17 | libical/src/libical \ |
18 | libical/src/libicalss \ | 18 | libical/src/libicalss \ |
19 | qtcompat \ | 19 | qtcompat \ |
20 | microkde \ | 20 | microkde \ |
21 | libkcal \ | 21 | libkcal \ |
22 | libkdepim \ | 22 | libkdepim \ |
23 | kabc \ | 23 | kabc \ |
24 | kabc/formats/binary \ | 24 | kabc/formats/binary \ |
25 | kabc/plugins/file \ | 25 | kabc/plugins/file \ |
26 | kabc/plugins/dir \ | 26 | kabc/plugins/dir \ |
27 | korganizer \ | 27 | korganizer \ |
28 | kalarmd \ | 28 | kalarmd \ |
29 | kaddressbook | 29 | kaddressbook |
30 | 30 | ||
31 | SUBDIRS_QTOPIA_PLUGIN = \ | 31 | SUBDIRS_QTOPIA_PLUGIN = \ |
32 | kabc/plugins/qtopia | 32 | kabc/plugins/qtopia |
33 | 33 | ||
34 | SUBDIRS_OPIE_PLUGIN = \ | 34 | SUBDIRS_OPIE_PLUGIN = \ |
35 | kabc/plugins/opie | 35 | kabc/plugins/opie |
36 | 36 | ||
37 | SUBDIRS_SHARP_PLUGIN = \ | 37 | SUBDIRS_SHARP_PLUGIN = \ |
38 | kabc/plugins/sharpdtm | 38 | kabc/plugins/sharpdtm |
39 | 39 | ||
40 | SUBDIRS_LDAP_PLUGIN = \ | 40 | SUBDIRS_LDAP_PLUGIN = \ |
41 | kabc/plugins/ldap | 41 | kabc/plugins/ldap |
42 | 42 | ||
43 | SUBDIRS_MICROMAIL = \ | 43 | SUBDIRS_MICROMAIL = \ |
44 | kmicromail/libetpan \ | 44 | kmicromail/libetpan \ |
45 | kmicromail/libmailwrapper \ | 45 | kmicromail/libmailwrapper \ |
46 | kmicromail | 46 | kmicromail |
47 | 47 | ||
48 | SUBDIRS_GAMMU = \ | 48 | SUBDIRS_GAMMU = \ |
49 | gammu/emb/common \ | 49 | gammu/emb/common \ |
50 | gammu/emb/gammu | 50 | gammu/emb/gammu |
51 | 51 | ||
52 | SUBDIRS_PWMANAGER = \ | 52 | SUBDIRS_PWMANAGER = \ |
53 | pwmanager/libcrypt/mpi \ | 53 | pwmanager/libcrypt/mpi \ |
54 | pwmanager/libcrypt/error \ | 54 | pwmanager/libcrypt/error \ |
55 | pwmanager/libcrypt/cipher \ | 55 | pwmanager/libcrypt/cipher \ |
56 | pwmanager/libcrypt/zlib \ | 56 | pwmanager/libcrypt/zlib \ |
57 | pwmanager/pwmanager | 57 | pwmanager/pwmanager |
58 | 58 | ||
59 | SUBDIRS = \ | 59 | SUBDIRS = \ |
60 | $(SUBDIRS_MICROKDE) \ | 60 | $(SUBDIRS_MICROKDE) \ |
61 | $(SUBDIRS_QTOPIA_PLUGIN) \ | 61 | $(SUBDIRS_QTOPIA_PLUGIN) \ |
62 | $(SUBDIRS_OPIE_PLUGIN) \ | 62 | $(SUBDIRS_OPIE_PLUGIN) \ |
63 | $(SUBDIRS_SHARP_PLUGIN) \ | 63 | $(SUBDIRS_SHARP_PLUGIN) \ |
64 | $(SUBDIRS_LDAP_PLUGIN) \ | 64 | $(SUBDIRS_LDAP_PLUGIN) \ |
65 | $(SUBDIRS_MICROMAIL) \ | 65 | $(SUBDIRS_MICROMAIL) \ |
66 | $(SUBDIRS_GAMMU) \ | 66 | $(SUBDIRS_GAMMU) \ |
67 | $(SUBDIRS_PWMANAGER) | 67 | $(SUBDIRS_PWMANAGER) |
68 | 68 | ||
69 | 69 | ||
70 | all: build_microkde \ | 70 | all: build_microkde \ |
71 | build_qtopia_plugin \ | 71 | build_qtopia_plugin \ |
72 | build_opie_plugin \ | 72 | build_opie_plugin \ |
73 | build_sharp_plugin \ | 73 | build_sharp_plugin \ |
74 | build_ldap_plugin \ | 74 | build_ldap_plugin \ |
75 | build_micromail \ | 75 | build_micromail \ |
76 | build_gammu \ | 76 | build_gammu \ |
77 | build_pwmanager | 77 | build_pwmanager |
78 | 78 | ||
79 | 79 | ||
80 | build_microkde: variable_test tmake | 80 | build_microkde: variable_test tmake |
81 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ | 81 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ |
82 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 82 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
83 | done | 83 | done |
84 | 84 | ||
85 | build_qtopia_plugin: build_microkde | 85 | build_qtopia_plugin: build_microkde |
86 | ifdef BUILD_NO_QTOPIA_PLUGIN | 86 | ifdef BUILD_NO_QTOPIA_PLUGIN |
87 | @echo == qtopia plugin not build. | 87 | @echo == qtopia plugin not build. |
88 | else | 88 | else |
89 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ | 89 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ |
90 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 90 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
91 | done | 91 | done |
92 | endif | 92 | endif |
93 | 93 | ||
94 | build_opie_plugin: build_microkde | 94 | build_opie_plugin: build_microkde |
95 | ifdef BUILD_NO_OPIE_PLUGIN | 95 | ifdef BUILD_NO_OPIE_PLUGIN |
96 | @echo == opie plugin not build. | 96 | @echo == opie plugin not build. |
97 | else | 97 | else |
98 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ | 98 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ |
99 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 99 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
100 | done | 100 | done |
101 | endif | 101 | endif |
102 | 102 | ||
103 | build_sharp_plugin: build_microkde | 103 | build_sharp_plugin: build_microkde |
104 | ifdef BUILD_NO_SHARP_PLUGIN | 104 | ifdef BUILD_NO_SHARP_PLUGIN |
105 | @echo == ldap plugin not build. | 105 | @echo == ldap plugin not build. |
106 | else | 106 | else |
107 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ | 107 | for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ |
108 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 108 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
109 | done | 109 | done |
110 | endif | 110 | endif |
111 | 111 | ||
112 | build_ldap_plugin: build_microkde | 112 | build_ldap_plugin: build_microkde |
113 | ifdef BUILD_NO_LDAP_PLUGIN | 113 | ifdef BUILD_NO_LDAP_PLUGIN |
114 | @echo == ldap plugin not build. | 114 | @echo == ldap plugin not build. |
115 | else | 115 | else |
116 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ | 116 | for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ |
117 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 117 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
118 | done | 118 | done |
119 | endif | 119 | endif |
120 | 120 | ||
121 | 121 | ||
122 | build_micromail: build_microkde | 122 | build_micromail: build_microkde |
123 | ifdef BUILD_NO_MICROMAIL | 123 | ifdef BUILD_NO_MICROMAIL |
124 | @echo == kmicromail not build. | 124 | @echo == kmicromail not build. |
125 | else | 125 | else |
126 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ | 126 | for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ |
127 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 127 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
128 | done | 128 | done |
129 | endif | 129 | endif |
130 | 130 | ||
131 | build_gammu: variable_test tmake | 131 | build_gammu: variable_test tmake |
132 | ifdef BUILD_NO_GAMMU | 132 | ifdef BUILD_NO_GAMMU |
133 | @echo == gammu not build. | 133 | @echo == gammu not build. |
134 | else | 134 | else |
135 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ | 135 | for i in $(SUBDIRS_GAMMU); do pushd $$i; \ |
136 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 136 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
137 | done | 137 | done |
138 | endif | 138 | endif |
139 | 139 | ||
140 | build_pwmanager: build_microkde | 140 | build_pwmanager: build_microkde |
141 | ifdef BUILD_NO_PWMANAGER | 141 | ifdef BUILD_NO_PWMANAGER |
142 | @echo == pwmanager not build. | 142 | @echo == pwmanager not build. |
143 | else | 143 | else |
144 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ | 144 | for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ |
145 | make -f Makefile$(PLATFORM) || exit 1; popd; \ | 145 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
146 | done | 146 | done |
147 | endif | 147 | endif |
148 | 148 | ||
149 | 149 | ||
150 | variable_info: | 150 | variable_info: |
151 | @echo -------------------------------------- | 151 | @echo -------------------------------------- |
152 | @echo KDEPIM buildsystem, variableinfo... | 152 | @echo KDEPIM buildsystem, variableinfo... |
153 | @echo KDEPIMDIR=$(KDEPIMDIR) | 153 | @echo KDEPIMDIR=$(KDEPIMDIR) |
154 | @echo QTDIR=$(QTDIR) | 154 | @echo QTDIR=$(QTDIR) |
155 | @echo QPEDIR=$(QPEDIR) | 155 | @echo QPEDIR=$(QPEDIR) |
156 | @echo OPIEDIR=$(OPIEDIR) | 156 | @echo OPIEDIR=$(OPIEDIR) |
157 | @echo PLATFORM=$(PLATFORM) | 157 | @echo PLATFORM=$(PLATFORM) |
158 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) | 158 | @echo RELEASE_DEBUG=$(RELEASE_DEBUG) |
159 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) | 159 | @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) |
160 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) | 160 | @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) |
161 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) | 161 | @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) |
162 | @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) | 162 | @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) |
163 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) | 163 | @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) |
164 | ifndef BUILD_NO_SHARP_PLUGIN | 164 | ifndef BUILD_NO_SHARP_PLUGIN |
165 | @echo SHARPDTMSDK=$(SHARPDTMSDK) | 165 | @echo SHARPDTMSDK=$(SHARPDTMSDK) |
166 | endif | 166 | endif |
167 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) | 167 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) |
168 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) | 168 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) |
169 | @echo -------------------------------------- | 169 | @echo -------------------------------------- |
170 | 170 | ||
171 | variable_test: variable_info | 171 | variable_test: variable_info |
172 | @echo KDEPIM buildsystem, variablecheck... | 172 | @echo KDEPIM buildsystem, variablecheck... |
173 | ifndef KDEPIMDIR | 173 | ifndef KDEPIMDIR |
174 | @echo KDEPIMDIR is not defined. | 174 | @echo KDEPIMDIR is not defined. |
175 | $(error KDEPIMDIR is not defined) | 175 | $(error KDEPIMDIR is not defined) |
176 | endif | 176 | endif |
177 | ifndef PLATFORM | 177 | ifndef PLATFORM |
178 | @echo PLATFORM is not defined. | 178 | @echo PLATFORM is not defined. |
179 | $(error PLATFORM is not defined) | 179 | $(error PLATFORM is not defined) |
180 | endif | 180 | endif |
181 | ifdef BUILD_NO_LDAP_PLUGIN | 181 | ifdef BUILD_NO_LDAP_PLUGIN |
182 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) | 182 | @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) |
183 | endif | 183 | endif |
184 | ifdef BUILD_NO_OPIE_PLUGIN | 184 | ifdef BUILD_NO_OPIE_PLUGIN |
185 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) | 185 | @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) |
186 | endif | 186 | endif |
187 | ifdef BUILD_NO_QTOPIA_PLUGIN | 187 | ifdef BUILD_NO_QTOPIA_PLUGIN |
188 | @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) | 188 | @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) |
189 | endif | 189 | endif |
190 | ifdef BUILD_NO_MICROMAIL | 190 | ifdef BUILD_NO_MICROMAIL |
191 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) | 191 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) |
192 | endif | 192 | endif |
193 | ifdef BUILD_NO_SHARP_PLUGIN | 193 | ifdef BUILD_NO_SHARP_PLUGIN |
194 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) | 194 | @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) |
195 | else | 195 | else |
196 | ifndef SHARPDTMSDK | 196 | ifndef SHARPDTMSDK |
197 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) | 197 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) |
198 | $(error SHARPDTMSDK is not defined) | 198 | $(error SHARPDTMSDK is not defined) |
199 | endif | 199 | endif |
200 | endif | 200 | endif |
201 | ifdef BUILD_NO_GAMMU | 201 | ifdef BUILD_NO_GAMMU |
202 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) | 202 | @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) |
203 | endif | 203 | endif |
204 | ifdef BUILD_NO_PWMANAGER | 204 | ifdef BUILD_NO_PWMANAGER |
205 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) | 205 | @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) |
206 | endif | 206 | endif |
207 | @echo -------------------------------------- | 207 | @echo -------------------------------------- |
208 | 208 | ||
209 | 209 | ||
210 | objects: | 210 | objects: |
211 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done | 211 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done |
212 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done | 212 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done |
213 | mkdir -p libical/lib/$(PLATFORM) | 213 | mkdir -p libical/lib/$(PLATFORM) |
214 | mkdir -p pwmanager/libcrypt/$(PLATFORM) | 214 | mkdir -p pwmanager/libcrypt/$(PLATFORM) |
215 | 215 | ||
216 | clean: | 216 | clean: |
217 | rm -rf libical/lib/$(PLATFORM)/*; | 217 | rm -rf libical/lib/$(PLATFORM)/*; |
218 | rm -rf pwmanager/libcrypt/$(PLATFORM)/*; | 218 | rm -rf pwmanager/libcrypt/$(PLATFORM)/*; |
219 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ | 219 | for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ |
220 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ | 220 | rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ |
221 | done | 221 | done |
222 | 222 | ||
223 | pac: | 223 | pac: |
224 | rm -f $(QPEDIR)/lib/libmicro* | 224 | rm -f $(QPEDIR)/lib/libmicro* |
225 | rm -f $(QPEDIR)/plugins/applets/libkopi* | 225 | rm -f $(QPEDIR)/plugins/applets/libkopi* |
226 | make | 226 | make |
227 | make install | 227 | make install |
228 | make dist | 228 | make dist |
229 | install: | 229 | install: |
230 | 230 | ||
231 | cd bin/kdepim; make install | 231 | cd bin/kdepim; make install |
232 | cp -r Pim $(QPEDIR)/apps | 232 | cp -r Pim $(QPEDIR)/apps |
233 | cp db2file/db2file $(QPEDIR)/bin/db2file | 233 | cp db2file/db2file $(QPEDIR)/bin/db2file |
234 | chmod ugo+x $(QPEDIR)/bin/db2file | 234 | chmod ugo+x $(QPEDIR)/bin/db2file |
235 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop | 235 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop |
236 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop | 236 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop |
237 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop | 237 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop |
238 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop | 238 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop |
239 | 239 | ||
240 | dist: | 240 | dist: |
241 | @echo Dont forget to do "make install" before "make dist" | 241 | @echo Dont forget to do "make install" before "make dist" |
242 | rm -f *arm.ipk | 242 | rm -f *arm.ipk |
243 | rm -f *ipk.zip | 243 | rm -f *ipk.zip |
244 | rm -f ../new_$(KDEPIM_VERSION)/* | 244 | rm -f ../new_$(KDEPIM_VERSION)/* |
245 | rm -f *~ | 245 | rm -f *~ |
246 | cd ..;mkdir -p new_$(KDEPIM_VERSION) | 246 | cd ..;mkdir -p kdepimpi_$(KDEPIM_VERSION) |
247 | cd ../kdepimpi_$(KDEPIM_VERSION);mkdir -p ipk | ||
247 | cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim | 248 | cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim |
248 | mkipks kmicrokdelibs.control | 249 | mkipks kmicrokdelibs.control |
249 | mkipks korganizer.control | 250 | mkipks korganizer.control |
250 | mkipks kaddressbook.control | 251 | mkipks kaddressbook.control |
251 | ifndef BUILD_NO_MICROMAIL | 252 | ifndef BUILD_NO_MICROMAIL |
252 | mkipks kopiemail.control | 253 | mkipks kopiemail.control |
253 | endif | 254 | endif |
254 | ifndef BUILD_NO_SHARP_PLUGIN | 255 | ifndef BUILD_NO_SHARP_PLUGIN |
255 | mkipks ksharpPIM-DTMaccess.control | 256 | mkipks ksharpPIM-DTMaccess.control |
256 | endif | 257 | endif |
257 | mkipks korganizer-alarm.control | 258 | mkipks korganizer-alarm.control |
258 | ifndef BUILD_NO_GAMMU | 259 | ifndef BUILD_NO_GAMMU |
259 | mkipks kmobilephoneaccess.control | 260 | mkipks kmobilephoneaccess.control |
260 | endif | 261 | endif |
261 | ifndef BUILD_NO_PWMANAGER | 262 | ifndef BUILD_NO_PWMANAGER |
262 | mkipks pwmanager.control | 263 | mkipks pwmanager.control |
263 | endif | 264 | endif |
264 | mkipks pimTABicon.control | 265 | mkipks pimTABicon.control |
265 | zip kdepim_$(KDEPIM_VERSION)_for_SharpRom.ipk.zip *.ipk ReleaseNotes.txt | 266 | zip kdepim_$(KDEPIM_VERSION)_for_SharpRom.ipk.zip *.ipk ReleaseNotes.txt |
266 | mv *.ipk ../new_$(KDEPIM_VERSION)/ | 267 | mv *.ipk ../kdepimpi_$(KDEPIM_VERSION)/ipk/ |
267 | mv *for_SharpRom.ipk.zip ../new_$(KDEPIM_VERSION)/ | 268 | mv *for_SharpRom.ipk.zip ../kdepimpi_$(KDEPIM_VERSION)/ |
268 | mv ../kdepimpi-$(KDEPIM_VERSION).tar.gz ../new_$(KDEPIM_VERSION)/ | 269 | mv ../kdepimpi-$(KDEPIM_VERSION).tar.gz ../kdepimpi_$(KDEPIM_VERSION)/ |
269 | 270 | ||
270 | tmake: objects \ | 271 | tmake: objects \ |
271 | qtcompat/Makefile$(PLATFORM) \ | 272 | qtcompat/Makefile$(PLATFORM) \ |
272 | microkde/Makefile$(PLATFORM) \ | 273 | microkde/Makefile$(PLATFORM) \ |
273 | libkcal/Makefile$(PLATFORM) \ | 274 | libkcal/Makefile$(PLATFORM) \ |
274 | libkdepim/Makefile$(PLATFORM) \ | 275 | libkdepim/Makefile$(PLATFORM) \ |
275 | korganizer/Makefile$(PLATFORM) \ | 276 | korganizer/Makefile$(PLATFORM) \ |
276 | kalarmd/Makefile$(PLATFORM) \ | 277 | kalarmd/Makefile$(PLATFORM) \ |
277 | libical/src/libical/Makefile$(PLATFORM) \ | 278 | libical/src/libical/Makefile$(PLATFORM) \ |
278 | libical/src/libicalss/Makefile$(PLATFORM) \ | 279 | libical/src/libicalss/Makefile$(PLATFORM) \ |
279 | kabc/Makefile$(PLATFORM) \ | 280 | kabc/Makefile$(PLATFORM) \ |
280 | kabc/formats/binary/Makefile$(PLATFORM) \ | 281 | kabc/formats/binary/Makefile$(PLATFORM) \ |
281 | kabc/plugins/file/Makefile$(PLATFORM) \ | 282 | kabc/plugins/file/Makefile$(PLATFORM) \ |
282 | kabc/plugins/dir/Makefile$(PLATFORM) \ | 283 | kabc/plugins/dir/Makefile$(PLATFORM) \ |
283 | kabc/plugins/ldap/Makefile$(PLATFORM) \ | 284 | kabc/plugins/ldap/Makefile$(PLATFORM) \ |
284 | kabc/plugins/opie/Makefile$(PLATFORM) \ | 285 | kabc/plugins/opie/Makefile$(PLATFORM) \ |
285 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ | 286 | kabc/plugins/qtopia/Makefile$(PLATFORM) \ |
286 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ | 287 | kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ |
287 | kaddressbook/Makefile$(PLATFORM) \ | 288 | kaddressbook/Makefile$(PLATFORM) \ |
288 | kmicromail/Makefile$(PLATFORM) \ | 289 | kmicromail/Makefile$(PLATFORM) \ |
289 | kmicromail/libetpan/Makefile$(PLATFORM) \ | 290 | kmicromail/libetpan/Makefile$(PLATFORM) \ |
290 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ | 291 | kmicromail/libmailwrapper/Makefile$(PLATFORM) \ |
291 | gammu/emb/common/Makefile$(PLATFORM) \ | 292 | gammu/emb/common/Makefile$(PLATFORM) \ |
292 | gammu/emb/gammu/Makefile$(PLATFORM) \ | 293 | gammu/emb/gammu/Makefile$(PLATFORM) \ |
293 | pwmanager/pwmanager/Makefile$(PLATFORM) \ | 294 | pwmanager/pwmanager/Makefile$(PLATFORM) \ |
294 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \ | 295 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \ |
295 | pwmanager/libcrypt/error/Makefile$(PLATFORM) \ | 296 | pwmanager/libcrypt/error/Makefile$(PLATFORM) \ |
296 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \ | 297 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \ |
297 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM) | 298 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM) |
298 | 299 | ||
299 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro | 300 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro |
300 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) | 301 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) |
301 | 302 | ||
302 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro | 303 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro |
303 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) | 304 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) |
304 | 305 | ||
305 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro | 306 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro |
306 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) | 307 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) |
307 | 308 | ||
308 | 309 | ||
309 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro | 310 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro |
310 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) | 311 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) |
311 | 312 | ||
312 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro | 313 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro |
313 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) | 314 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) |
314 | 315 | ||
315 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro | 316 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro |
316 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) | 317 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) |
317 | 318 | ||
318 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro | 319 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro |
319 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) | 320 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) |
320 | 321 | ||
321 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro | 322 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro |
322 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) | 323 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) |
323 | 324 | ||
324 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro | 325 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro |
325 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) | 326 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) |
326 | 327 | ||
327 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro | 328 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro |
328 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) | 329 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) |
329 | 330 | ||
330 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro | 331 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro |
331 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) | 332 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) |
332 | 333 | ||
333 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro | 334 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro |
334 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) | 335 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) |
335 | 336 | ||
336 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro | 337 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro |
337 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) | 338 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) |
338 | 339 | ||
339 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro | 340 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro |
340 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) | 341 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) |
341 | 342 | ||
342 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro | 343 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro |
343 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) | 344 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) |
344 | 345 | ||
345 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro | 346 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro |
346 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) | 347 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) |
347 | 348 | ||
348 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro | 349 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro |
349 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) | 350 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) |
350 | 351 | ||
351 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro | 352 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro |
352 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) | 353 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) |
353 | 354 | ||
354 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro | 355 | kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro |
355 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) | 356 | cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) |
356 | 357 | ||
357 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro | 358 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro |
358 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) | 359 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) |
359 | 360 | ||
360 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro | 361 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro |
361 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) | 362 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) |
362 | 363 | ||
363 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro | 364 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro |
364 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) | 365 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) |
365 | 366 | ||
366 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro | 367 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro |
367 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) | 368 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) |
368 | 369 | ||
369 | 370 | ||
370 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro | 371 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro |
371 | cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM) | 372 | cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM) |
372 | 373 | ||
373 | pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro | 374 | pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro |
374 | cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM) | 375 | cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM) |
375 | 376 | ||
376 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro | 377 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro |
377 | cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM) | 378 | cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM) |
378 | 379 | ||
379 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro | 380 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro |
380 | cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM) | 381 | cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM) |
381 | 382 | ||
382 | 383 | ||
diff --git a/bin/kdepim/kopiemail/germantranslation.txt b/bin/kdepim/kopiemail/germantranslation.txt index 86819b7..68dc6db 100644 --- a/bin/kdepim/kopiemail/germantranslation.txt +++ b/bin/kdepim/kopiemail/germantranslation.txt | |||
@@ -1,264 +1,274 @@ | |||
1 | { " Local Time"," Locale Zeit" }, | 1 | { " Local Time"," Locale Zeit" }, |
2 | { "Preferences","Vorlieben" }, | 2 | { "Preferences","Vorlieben" }, |
3 | { "Ok","Ok" }, | 3 | { "Ok","Ok" }, |
4 | { "Default","Standard" }, | 4 | { "Default","Standard" }, |
5 | { "Cancel","Abbrechen" }, | 5 | { "Cancel","Abbrechen" }, |
6 | { "Global","Global" }, | 6 | { "Global","Global" }, |
7 | { "Email","Email" }, | 7 | { "Email","Email" }, |
8 | { "Phone","Phone" }, | 8 | { "Phone","Phone" }, |
9 | { "SMS","SMS" }, | 9 | { "SMS","SMS" }, |
10 | { "Fax","Fax" }, | 10 | { "Fax","Fax" }, |
11 | { "Pager","Pager" }, | 11 | { "Pager","Pager" }, |
12 | { "SIP","SIP" }, | 12 | { "SIP","SIP" }, |
13 | { "Language:(needs restart)","Sprache (Neustart!)" }, | 13 | { "Language:(needs restart)","Sprache (Neustart!)" }, |
14 | { "English","Englisch" }, | 14 | { "English","Englisch" }, |
15 | { "German","Deutsch" }, | 15 | { "German","Deutsch" }, |
16 | { "French","Französich" }, | 16 | { "French","Französich" }, |
17 | { "Italian","Italienisch" }, | 17 | { "Italian","Italienisch" }, |
18 | { "User defined (usertranslation.txt)","Benutzerdef.(usertranslation.txt)" }, | 18 | { "User defined (usertranslation.txt)","Benutzerdef.(usertranslation.txt)" }, |
19 | { "Time Format(nr):","Zeit Format(Neustart!)" }, | 19 | { "Time Format(nr):","Zeit Format(Neustart!)" }, |
20 | { "24:00","24:00" }, | 20 | { "24:00","24:00" }, |
21 | { "12:00am","12:00am" }, | 21 | { "12:00am","12:00am" }, |
22 | { "Week starts on Sunday","Woche beginnt Sonntags" }, | 22 | { "Week starts on Sunday","Woche beginnt Sonntags" }, |
23 | { "Locale","Localisation" }, | 23 | { "Locale","Localisation" }, |
24 | { "Date Format:","Datums Format:" }, | 24 | { "Date Format:","Datums Format:" }, |
25 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, | 25 | { "24.03.2004 (%d.%m.%Y|%A %d %B %Y)","24.03.2004 (%d.%m.%Y|%A %d %B %Y)" }, |
26 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, | 26 | { "03.24.2004 (%m.%d.%Y|%A %B %d %Y)","03.24.2004 (%m.%d.%Y|%A %B %d %Y)" }, |
27 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, | 27 | { "2004-03-24 (%Y-%m-%d|%A %Y %B %d)","2004-03-24 (%Y-%m-%d|%A %Y %B %d)" }, |
28 | { "User defined","Benutzerdefiniert" }, | 28 | { "User defined","Benutzerdefiniert" }, |
29 | { "User long date:","Format langes Datum:" }, | 29 | { "User long date:","Format langes Datum:" }, |
30 | { "User short date:","Format kurzes Datum:" }, | 30 | { "User short date:","Format kurzes Datum:" }, |
31 | { "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, | 31 | { "Monday 19 April 2004: %A %d %B %Y","Montag 19 April 2004: %A %d %B %Y" }, |
32 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, | 32 | { "Mon 19.04.04: %a %d.%m.%y","Mon 19.04.04: %a %d.%m.%y" }, |
33 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, | 33 | { "Mon, 19.Apr.04: %a, %d.%b.%y","Mon, 19.Apr.04: %a, %d.%b.%y" }, |
34 | { "Date Format","Datums Format" }, | 34 | { "Date Format","Datums Format" }, |
35 | { "Timezone:","Zeitzone:" }, | 35 | { "Timezone:","Zeitzone:" }, |
36 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, | 36 | { "Add 30 min to selected Timezone","Addiere 30 min zur Zeitzone" }, |
37 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, | 37 | { "Timezone has daylight saving","Zeitzone hat Sommerzeit" }, |
38 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, | 38 | { "Actual start and end is the\nsunday before this date.","Tatsächlicher Beginn/Ende ist der\nSonntag vor diesem Datum!" }, |
39 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, | 39 | { "The year in the date is ignored.","Das Jahr vom Datum wird ignoriert." }, |
40 | { "Daylight start:","Sommerzeit Beginn:" }, | 40 | { "Daylight start:","Sommerzeit Beginn:" }, |
41 | { "Mon","Mo" }, | 41 | { "Mon","Mo" }, |
42 | { "Tue","Di" }, | 42 | { "Tue","Di" }, |
43 | { "Wed","Mi" }, | 43 | { "Wed","Mi" }, |
44 | { "Thu","Do" }, | 44 | { "Thu","Do" }, |
45 | { "Fri","Fr" }, | 45 | { "Fri","Fr" }, |
46 | { "Sat","Sa" }, | 46 | { "Sat","Sa" }, |
47 | { "Sun","So" }, | 47 | { "Sun","So" }, |
48 | { "January","Januar" }, | 48 | { "January","Januar" }, |
49 | { "February","Februar" }, | 49 | { "February","Februar" }, |
50 | { "March","März" }, | 50 | { "March","März" }, |
51 | { "April","April" }, | 51 | { "April","April" }, |
52 | { "May","Mai" }, | 52 | { "May","Mai" }, |
53 | { "June","Juni" }, | 53 | { "June","Juni" }, |
54 | { "July","Juli" }, | 54 | { "July","Juli" }, |
55 | { "August","August" }, | 55 | { "August","August" }, |
56 | { "September","September" }, | 56 | { "September","September" }, |
57 | { "October","Oktober" }, | 57 | { "October","Oktober" }, |
58 | { "November","November" }, | 58 | { "November","November" }, |
59 | { "December","Dezember" }, | 59 | { "December","Dezember" }, |
60 | { "tomorrow","morgen" }, | 60 | { "tomorrow","morgen" }, |
61 | { "today","heute" }, | 61 | { "today","heute" }, |
62 | { "yesterday","gestern" }, | 62 | { "yesterday","gestern" }, |
63 | { "Monday","Montag" }, | 63 | { "Monday","Montag" }, |
64 | { "Tuesday","Dienstag" }, | 64 | { "Tuesday","Dienstag" }, |
65 | { "Wednesday","Mittwoch" }, | 65 | { "Wednesday","Mittwoch" }, |
66 | { "Thursday","Donnerstag" }, | 66 | { "Thursday","Donnerstag" }, |
67 | { "Friday","Freitag" }, | 67 | { "Friday","Freitag" }, |
68 | { "Saturday","Samstag" }, | 68 | { "Saturday","Samstag" }, |
69 | { "Sunday","Sonntag" }, | 69 | { "Sunday","Sonntag" }, |
70 | { "Daylight end:","Sommerzeit Ende:" }, | 70 | { "Daylight end:","Sommerzeit Ende:" }, |
71 | { "Time Zone","Zeitzone" }, | 71 | { "Time Zone","Zeitzone" }, |
72 | { "Used Mail Client","Benutzter Mail Client" }, | 72 | { "Used Mail Client","Benutzter Mail Client" }, |
73 | { "Channel:","Channel:" }, | 73 | { "Channel:","Channel:" }, |
74 | { "Message:","Message:" }, | 74 | { "Message:","Message:" }, |
75 | { "Parameters:","Parameter:" }, | 75 | { "Parameters:","Parameter:" }, |
76 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, | 76 | { "HINT: Delimiter=; Name=%1,Email=%2","Hinweis: Begrenzer=; Name=%1,Email=%2" }, |
77 | { "extra Message:","extra Message:" }, | 77 | { "extra Message:","extra Message:" }, |
78 | { "extra Parameters:","extra Parameter:" }, | 78 | { "extra Parameters:","extra Parameter:" }, |
79 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, | 79 | { "HINT: Emails=%1,Attachments=%2","Hinweis: Emails=%1,Attachments=%2" }, |
80 | { "External Apps.","Externe Appl." }, | 80 | { "External Apps.","Externe Appl." }, |
81 | { "General","Allgemein" }, | 81 | { "General","Allgemein" }, |
82 | { "Full &name:","Vor- und &Nachname:" }, | 82 | { "Full &name:","Vor- und &Nachname:" }, |
83 | { "E&mail address:","E&mail Adresse:" }, | 83 | { "E&mail address:","E&mail Adresse:" }, |
84 | { "Fonts","Schriftart" }, | 84 | { "Fonts","Schriftart" }, |
85 | { "Choose...","Wähle..." }, | 85 | { "Choose...","Wähle..." }, |
86 | { "Used %1 Client","Benutzter %1 Client" }, | 86 | { "Used %1 Client","Benutzter %1 Client" }, |
87 | { "No email client installed","Kein Email Klient installiert" }, | 87 | { "No email client installed","Kein Email Klient installiert" }, |
88 | { "Userdefined email client","Benutzerdef. Email Klient" }, | 88 | { "Userdefined email client","Benutzerdef. Email Klient" }, |
89 | { "OM/Pi email client","OM/Pi Email Klient" }, | 89 | { "OM/Pi email client","OM/Pi Email Klient" }, |
90 | { "Delete","Löschen" }, | 90 | { "Delete","Löschen" }, |
91 | { "New","Neu" }, | 91 | { "New","Neu" }, |
92 | { "Edit","Bearbeite" }, | 92 | { "Edit","Bearbeite" }, |
93 | { "Close","Schließen" }, | 93 | { "Close","Schließen" }, |
94 | { "Size","Größe" }, | 94 | { "Size","Größe" }, |
95 | { "Date","Datum" }, | 95 | { "Date","Datum" }, |
96 | { "Please set at","Bitte einstellen in" }, | 96 | { "Please set at","Bitte einstellen in" }, |
97 | { "Settings@General TAB","Einstellungen@Allgemein TAB" }, | 97 | { "Settings@General TAB","Einstellungen@Allgemein TAB" }, |
98 | { "KOpieMail/Pi","KOpieMail/Pi" }, | 98 | { "KOpieMail/Pi","KOpieMail/Pi" }, |
99 | { "Mail","Mail" }, | 99 | { "Mail","Mail" }, |
100 | { "Settings","Konfig" }, | 100 | { "Settings","Konfig" }, |
101 | { "Get all new mails","Hole alle neuen Mails" }, | 101 | { "Get all new mails","Hole alle neuen Mails" }, |
102 | { "Get new messages","Hole neue mails" }, | 102 | { "Get new messages","Hole neue mails" }, |
103 | { "Compose new mail","Schreibe neue Mail" }, | 103 | { "Compose new mail","Schreibe neue Mail" }, |
104 | { "Send queued mails","Sende gespeicherte Mails" }, | 104 | { "Send queued mails","Sende gespeicherte Mails" }, |
105 | { "Show/Hide folders","Zeige Verzeichnisse" }, | 105 | { "Show/Hide folders","Zeige Verzeichnisse" }, |
106 | { "Delete Mail","Lösche Mail" }, | 106 | { "Delete Mail","Lösche Mail" }, |
107 | { "Edit settings","Ändere Einstellungen" }, | 107 | { "Edit settings","Ändere Einstellungen" }, |
108 | { "Configure accounts","Konfiguriere Zugänge" }, | 108 | { "Configure accounts","Konfiguriere Zugänge" }, |
109 | { "Mailbox","Mailbox" }, | 109 | { "Mailbox","Mailbox" }, |
110 | { "Subject","Betreff" }, | 110 | { "Subject","Betreff" }, |
111 | { "Sender","Sender" }, | 111 | { "Sender","Sender" }, |
112 | { "Size","Größe" }, | 112 | { "Size","Größe" }, |
113 | { "Date","Datum" }, | 113 | { "Date","Datum" }, |
114 | { "Close","Schliessen" }, | 114 | { "Close","Schliessen" }, |
115 | { "Help","Hilfe" }, | 115 | { "Help","Hilfe" }, |
116 | { "About","Über" }, | 116 | { "About","Über" }, |
117 | { "Licence","Lizenz" }, | 117 | { "Licence","Lizenz" }, |
118 | { "LibEtPan Licence","LibEtPan Lizenz" }, | 118 | { "LibEtPan Licence","LibEtPan Lizenz" }, |
119 | { "Settings - some need a restart (nr)","Einstellungen - manche benötigen einen Neustart (nr)" }, | 119 | { "Settings - some need a restart (nr)","Einstellungen - manche benötigen einen Neustart (nr)" }, |
120 | { "HINT: Separate multiple\neMail addresses by ";"","Hinweis:Trenne mehrere\nAddressen mit einem ";"" }, | 120 | { "HINT: Separate multiple\neMail addresses by ";"","Hinweis:Trenne mehrere\nAddressen mit einem ";"" }, |
121 | { "Ignore above settings and\nuse KA/Pi "Who am I" instead!","Ignoriere obige Einstellungen und\nbenutze KA/Pi "Wer bin ich"\nstattdessen!" }, | 121 | { "Ignore above settings and\nuse KA/Pi "Who am I" instead!","Ignoriere obige Einstellungen und\nbenutze KA/Pi "Wer bin ich"\nstattdessen!" }, |
122 | { "View mail as html","Zeige Mails als html" }, | 122 | { "View mail as html","Zeige Mails als html" }, |
123 | { "Send mails later","Sende Mails später" }, | 123 | { "Send mails later","Sende Mails später" }, |
124 | { "Application(nr)","Applikation(nr)" }, | 124 | { "Application(nr)","Applikation(nr)" }, |
125 | { "OK","OK" }, | 125 | { "OK","OK" }, |
126 | { "Compose mail:","Verfasse Mail:" }, | 126 | { "Compose mail:","Verfasse Mail:" }, |
127 | { "Dear Mr.","Hallo Herr" }, | 127 | { "Dear Mr.","Hallo Herr" }, |
128 | { "Read mail:","Lese Mail:" }, | 128 | { "Read mail:","Lese Mail:" }, |
129 | { "Hello","Hallo" }, | 129 | { "Hello","Hallo" }, |
130 | { "Configure Accounts","Konfigure Zugänge" }, | 130 | { "Configure Accounts","Konfigure Zugänge" }, |
131 | { "Name of the Account","Name des Zugangs" }, | 131 | { "Name of the Account","Name des Zugangs" }, |
132 | { "News","News" }, | 132 | { "News","News" }, |
133 | { "Account","Zugang" }, | 133 | { "Account","Zugang" }, |
134 | { "Type","Typ" }, | 134 | { "Type","Typ" }, |
135 | { "<p>Please select an account.</p>","<p>Bitte wähle einen Zugang.</p>" }, | 135 | { "<p>Please select an account.</p>","<p>Bitte wähle einen Zugang.</p>" }, |
136 | { "Error","Fehler" }, | 136 | { "Error","Fehler" }, |
137 | { "Configure NNTP","Konfiguriere News" }, | 137 | { "Configure NNTP","Konfiguriere News" }, |
138 | { "Port","Port" }, | 138 | { "Port","Port" }, |
139 | { "Server","Server" }, | 139 | { "Server","Server" }, |
140 | { "Use SSL","Benutze SSL" }, | 140 | { "Use SSL","Benutze SSL" }, |
141 | { "User","Benutzer" }, | 141 | { "User","Benutzer" }, |
142 | { "Password","Passwort" }, | 142 | { "Password","Passwort" }, |
143 | { "Use Login","Benutze Login" }, | 143 | { "Use Login","Benutze Login" }, |
144 | { "Newsgroup","Newsgroup" }, | 144 | { "Newsgroup","Newsgroup" }, |
145 | { "Get newsgroup list from server","Hole Newsgroup Liste vom Server" }, | 145 | { "Get newsgroup list from server","Hole Newsgroup Liste vom Server" }, |
146 | { "Filter:","Filter:" }, | 146 | { "Filter:","Filter:" }, |
147 | { "Show subscribed","Zeige abbonnierte" }, | 147 | { "Show subscribed","Zeige abbonnierte" }, |
148 | { "Groups","NewsGroups" }, | 148 | { "Groups","NewsGroups" }, |
149 | { "Configure IMAP","Konfiguriere IMAP" }, | 149 | { "Configure IMAP","Konfiguriere IMAP" }, |
150 | { "Use secure sockets:","Benutze sichere Verbindung:" }, | 150 | { "Use secure sockets:","Benutze sichere Verbindung:" }, |
151 | { "ssh $SERVER exec","ssh $SERVER exec" }, | 151 | { "ssh $SERVER exec","ssh $SERVER exec" }, |
152 | { "Prefix","Prefix" }, | 152 | { "Prefix","Prefix" }, |
153 | { "Local storage folder:","Lokales Verzeichnis:" }, | 153 | { "Local storage folder:","Lokales Verzeichnis:" }, |
154 | { "Get only messages smaller","Hole nur Nachrichten kleiner" }, | 154 | { "Get only messages smaller","Hole nur Nachrichten kleiner" }, |
155 | { "kB","kB" }, | 155 | { "kB","kB" }, |
156 | { "Leave Messages on Server","Belasse Nachrichten auf dem Server" }, | 156 | { "Leave Messages on Server","Belasse Nachrichten auf dem Server" }, |
157 | { "Configure POP3","Konfiguriere POP3" }, | 157 | { "Configure POP3","Konfiguriere POP3" }, |
158 | { "ssh $SERVER exec imapd","ssh $SERVER exec imapd" }, | 158 | { "ssh $SERVER exec imapd","ssh $SERVER exec imapd" }, |
159 | { "Configure SMTP","Konfiguriere SMTP" }, | 159 | { "Configure SMTP","Konfiguriere SMTP" }, |
160 | { "Name of the SMTP Server","Name des SMTP Servers" }, | 160 | { "Name of the SMTP Server","Name des SMTP Servers" }, |
161 | { "Port of the SMTP Server","Port des SMTP Servers" }, | 161 | { "Port of the SMTP Server","Port des SMTP Servers" }, |
162 | { "Fetching folder list","Hole Verzeichnis Liste" }, | 162 | { "Fetching folder list","Hole Verzeichnis Liste" }, |
163 | { "Fetch ","Hole " }, | 163 | { "Fetch ","Hole " }, |
164 | { "Fetching header list","Hole Titel Liste" }, | 164 | { "Fetching header list","Hole Titel Liste" }, |
165 | { "Mailbox has %1 mails","Mailbox hat %1 Mails" }, | 165 | { "Mailbox has %1 mails","Mailbox hat %1 Mails" }, |
166 | { "Read this mail","Lies diese Mail" }, | 166 | { "Read this mail","Lies diese Mail" }, |
167 | { "Move/Copy this mail","Verschiebe/kopiere diese Mail" }, | 167 | { "Move/Copy this mail","Verschiebe/kopiere diese Mail" }, |
168 | { "Delete this mail","Lösche diese Mail" }, | 168 | { "Delete this mail","Lösche diese Mail" }, |
169 | { "Move/Copy all selected mail","Verschiebe/kopiere selektierte Mails" }, | 169 | { "Move/Copy all selected mail","Verschiebe/kopiere selektierte Mails" }, |
170 | { "Delete all selected mails","Lösche alle selektierten Mails" }, | 170 | { "Delete all selected mails","Lösche alle selektierten Mails" }, |
171 | { "Clear selection","Selektion aufheben" }, | 171 | { "Clear selection","Selektion aufheben" }, |
172 | { "Reply","Antworten" }, | 172 | { "Reply","Antworten" }, |
173 | { "Forward","Weiterleiten" }, | 173 | { "Forward","Weiterleiten" }, |
174 | { "Attachments","Anhang" }, | 174 | { "Attachments","Anhang" }, |
175 | { "Show Html","Zeige in html" }, | 175 | { "Show Html","Zeige in html" }, |
176 | { "Description","Beschreibung" }, | 176 | { "Description","Beschreibung" }, |
177 | { "Filename","Dateiname" }, | 177 | { "Filename","Dateiname" }, |
178 | { "E-Mail by %1","E-Mail von %1" }, | 178 | { "E-Mail by %1","E-Mail von %1" }, |
179 | { "Cc","Kopie" }, | 179 | { "Cc","Kopie" }, |
180 | { "To","An" }, | 180 | { "To","An" }, |
181 | { "From","Von" }, | 181 | { "From","Von" }, |
182 | { "<p>Do you really want to delete this mail? <br><br>","<p>Wollen Sie diese Mail wirklich löschen? <br><br>" }, | 182 | { "<p>Do you really want to delete this mail? <br><br>","<p>Wollen Sie diese Mail wirklich löschen? <br><br>" }, |
183 | { "Mailbox has %1 mail(s)","Mailbox hat %1 Mail(s)" }, | 183 | { "Mailbox has %1 mail(s)","Mailbox hat %1 Mail(s)" }, |
184 | { "Move/Copie all mails","Verschiebe/kopiere alle Mails" }, | 184 | { "Move/Copie all mails","Verschiebe/kopiere alle Mails" }, |
185 | { "Delete all mails","Lösche alle Mails" }, | 185 | { "Delete all mails","Lösche alle Mails" }, |
186 | { "Create new subfolder","Neues Unterverzeichnis" }, | 186 | { "Create new subfolder","Neues Unterverzeichnis" }, |
187 | { "Delete folder","Lösche Verzeichnis" }, | 187 | { "Delete folder","Lösche Verzeichnis" }, |
188 | { "Refresh folder list","Aktualisiere Liste" }, | 188 | { "Refresh folder list","Aktualisiere Liste" }, |
189 | { "Create new folder","Neues Verzeichnis" }, | 189 | { "Create new folder","Neues Verzeichnis" }, |
190 | { "Disconnect","Diskonnect" }, | 190 | { "Disconnect","Diskonnect" }, |
191 | { "Set offline","Gehe offline" }, | 191 | { "Set offline","Gehe offline" }, |
192 | { "Select target box","Wähle Ziel Box" }, | 192 | { "Select target box","Wähle Ziel Box" }, |
193 | { "<b>Store mail(s) to</b>","<b>Speichere Mail(s) nach</b>" }, | 193 | { "<b>Store mail(s) to</b>","<b>Speichere Mail(s) nach</b>" }, |
194 | { "Folder:","Verzeichnis:" }, | 194 | { "Folder:","Verzeichnis:" }, |
195 | { "Account:","Zugang:" }, | 195 | { "Account:","Zugang:" }, |
196 | { "Prefix will prepend, do not enter","Pfad-Prefix wird vorangestellt" }, | 196 | { "Prefix will prepend, do not enter","Pfad-Prefix wird vorangestellt" }, |
197 | { "Move mail(s)","Verschiebe Mail(s)" }, | 197 | { "Move mail(s)","Verschiebe Mail(s)" }, |
198 | { "only mails smaller","nur Mails kleiner" }, | 198 | { "only mails smaller","nur Mails kleiner" }, |
199 | { " kB"," kB" }, | 199 | { " kB"," kB" }, |
200 | { " message %1 of %2"," Nachricht %1 von %2" }, | 200 | { " message %1 of %2"," Nachricht %1 von %2" }, |
201 | { "Copying...","Am Kopieren..." }, | 201 | { "Copying...","Am Kopieren..." }, |
202 | { "Copy message %1 of %2","Kopiere Nachricht %1 von %2" }, | 202 | { "Copy message %1 of %2","Kopiere Nachricht %1 von %2" }, |
203 | { "Do you really want to delete\nall selected mails?","Wollen Sie wirklich alle\nselektierten Mails Löschen?" }, | 203 | { "Do you really want to delete\nall selected mails?","Wollen Sie wirklich alle\nselektierten Mails Löschen?" }, |
204 | { "Delete All Mails","Lösche alle Mails" }, | 204 | { "Delete All Mails","Lösche alle Mails" }, |
205 | { "Deleting ...","Am Löschen..." }, | 205 | { "Deleting ...","Am Löschen..." }, |
206 | { "Delete message %1 of %2","Lösche Nachricht %1 von %2" }, | 206 | { "Delete message %1 of %2","Lösche Nachricht %1 von %2" }, |
207 | { "Compose Message","Verfasse Nachricht" }, | 207 | { "Compose Message","Verfasse Nachricht" }, |
208 | { "Reply-To","Antwort-An" }, | 208 | { "Reply-To","Antwort-An" }, |
209 | { "BCC","BCC" }, | 209 | { "BCC","BCC" }, |
210 | { "Signature","Signatur" }, | 210 | { "Signature","Signatur" }, |
211 | { "CC","Kopie" }, | 211 | { "CC","Kopie" }, |
212 | { "Options","Optionen" }, | 212 | { "Options","Optionen" }, |
213 | { "Delete File","Lösche Datei" }, | 213 | { "Delete File","Lösche Datei" }, |
214 | { "Add File","Füge Datei hinzu" }, | 214 | { "Add File","Füge Datei hinzu" }, |
215 | { "Attachment","Anhang" }, | 215 | { "Attachment","Anhang" }, |
216 | { "send later","sende später" }, | 216 | { "send later","sende später" }, |
217 | { "use:","via:" }, | 217 | { "use:","via:" }, |
218 | { "Save","Speichern" }, | 218 | { "Save","Speichern" }, |
219 | { "Name","Name" }, | 219 | { "Name","Name" }, |
220 | { "No Receiver spezified","Kein Empfänger angegeben" }, | 220 | { "No Receiver spezified","Kein Empfänger angegeben" }, |
221 | { "Sending mail","Sende Mail" }, | 221 | { "Sending mail","Sende Mail" }, |
222 | { "No","Nein" }, | 222 | { "No","Nein" }, |
223 | { "Yes","Ja" }, | 223 | { "Yes","Ja" }, |
224 | { "Store message into drafts?\n","Speichere Nachricht in Entwürfe?\n" }, | 224 | { "Store message into drafts?\n","Speichere Nachricht in Entwürfe?\n" }, |
225 | { "Store message?","Nachricht speichern?" }, | 225 | { "Store message?","Nachricht speichern?" }, |
226 | { "Select Type","Selektiere Typ" }, | 226 | { "Select Type","Selektiere Typ" }, |
227 | { "Select Account Type","Wähle Art des Zugangs" }, | 227 | { "Select Account Type","Wähle Art des Zugangs" }, |
228 | { "IMAP","IMAP (online lesen)" }, | 228 | { "IMAP","IMAP (online lesen)" }, |
229 | { "POP3","POP3 (holen)" }, | 229 | { "POP3","POP3 (holen)" }, |
230 | { "SMTP","SMTP (senden)" }, | 230 | { "SMTP","SMTP (senden)" }, |
231 | { "<p>Do you really want to delete the selected Account?</p>","<p>Möchten Sie wirklich den ausgewählten Account löschen?</p>" }, | 231 | { "<p>Do you really want to delete the selected Account?</p>","<p>Möchten Sie wirklich den ausgewählten Account löschen?</p>" }, |
232 | { "Question","Eine Frage..." }, | 232 | { "Question","Eine Frage..." }, |
233 | { "Send this message?","Nachricht wirklich senden?" }, | 233 | { "Send this message?","Nachricht wirklich senden?" }, |
234 | { "Stop editing message","Stop editing message" }, | 234 | { "Stop editing message","Stop editing message" }, |
235 | { "Sending mail %1 of %2","Sende Mail %1 von %2" }, | 235 | { "Sending mail %1 of %2","Sende Mail %1 von %2" }, |
236 | { "%1 of %2 bytes send","%1 von %2 Bytes gesendet" }, | 236 | { "%1 of %2 bytes send","%1 von %2 Bytes gesendet" }, |
237 | { "Refresh header list","Aktualisiere Titel Liste" }, | 237 | { "Refresh header list","Aktualisiere Titel Liste" }, |
238 | { "Define a smtp\n account first!\n","Bitte zuerst einen\nSMTP Account anlegen!\n" }, | 238 | { "Define a smtp\n account first!\n","Bitte zuerst einen\nSMTP Account anlegen!\n" }, |
239 | { "Mail queue flushed","Gespeicherte Mails gesendet!" }, | 239 | { "Mail queue flushed","Gespeicherte Mails gesendet!" }, |
240 | { "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n","Bitte legen Sie einen\nSMTP Account an.\nDer SMTP Account wird\nfür das Versenden von\nMails benötigt!" }, | 240 | { "Please create an\nSMTP account first.\nThe SMTP is needed\nfor sending mail.\n","Bitte legen Sie einen\nSMTP Account an.\nDer SMTP Account wird\nfür das Versenden von\nMails benötigt!" }, |
241 | { "Show next mail","Zeige nächste Mail" }, | 241 | { "Show next mail","Zeige nächste Mail" }, |
242 | { "End of List","Ende der Liste" }, | 242 | { "End of List","Ende der Liste" }, |
243 | { "Language","Sprache" }, | 243 | { "Language","Sprache" }, |
244 | { "Time Format","Zeit Format" }, | 244 | { "Time Format","Zeit Format" }, |
245 | { "%1 groups subscribed","%1 Guppen abboniert" }, | 245 | { "%1 groups subscribed","%1 Guppen abboniert" }, |
246 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Ihr gerade genutztes Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverzeichnis)/apps/kopiemail/localmail" }, | 246 | { "Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail","Ihr gerade genutztes Speicherverzeichnis ist:\n%1\nIhre Mail wird gespeichert in:\n(speicherverzeichnis)/apps/kopiemail/localmail" }, |
247 | { "<b>Set new data storage dir:</b>","<b>Setze neues Datenspeicherverzeichnis:</b>" }, | 247 | { "<b>Set new data storage dir:</b>","<b>Setze neues Datenspeicherverzeichnis:</b>" }, |
248 | { "Not existing dirs are created automatically","Nicht existierende Verzeichnisse werden erstellt" }, | 248 | { "Not existing dirs are created automatically","Nicht existierende Verzeichnisse werden erstellt" }, |
249 | { "Save settings","Speichere Einstellungen" }, | 249 | { "Save settings","Speichere Einstellungen" }, |
250 | { "Save standard","Speichere Standard" }, | 250 | { "Save standard","Speichere Standard" }, |
251 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, | 251 | { "<b>New settings are used\nafter a restart</b>","<b>Neue Einstellungen werden nach\neinem Neustart genutzt</b>" }, |
252 | { "The settings of the storage\ndir is saved in the file\n%1","Die Einstellungen des Speicherverzeichnisses\nwerden in folgender Datei gespeichert:\n%1" }, | 252 | { "The settings of the storage\ndir is saved in the file\n%1","Die Einstellungen des Speicherverzeichnisses\nwerden in folgender Datei gespeichert:\n%1" }, |
253 | { "Data storage path","Daten Speicherpfad" }, | 253 | { "Data storage path","Daten Speicherpfad" }, |
254 | { "userdefined","benutzerdefiniert" }, | 254 | { "userdefined","benutzerdefiniert" }, |
255 | { "Reply to this mail","Beantworte diese Mail" }, | 255 | { "Reply to this mail","Beantworte diese Mail" }, |
256 | { "Su:","Be:" }, | 256 | { "Su:","Be:" }, |
257 | { "Fr:","Vo:" }, | 257 | { "Fr:","Vo:" }, |
258 | { "To:","An:" }, | 258 | { "To:","An:" }, |
259 | { "Download Mail","Mail runterladen" }, | 259 | { "Download Mail","Mail runterladen" }, |
260 | { "View Source","Zeige Source" }, | 260 | { "View Source","Zeige Source" }, |
261 | { "Show "To" field in list view","Zeige "An" Feld in Listenansicht" }, | ||
262 | { "Show info fields at startup","Zeige Info Felder beim Start" }, | ||
263 | { "Show "Subject" info field","Zeige "Betreff" Info Feld" }, | ||
264 | { "Show "From" info field","Zeige "Von" Info Feld" }, | ||
265 | { "Show "To" info field","Zeige "An" Info Feld" }, | ||
266 | { "","" }, | ||
267 | { "","" }, | ||
268 | { "","" }, | ||
269 | { "","" }, | ||
270 | { "","" }, | ||
261 | { "","" }, | 271 | { "","" }, |
262 | { "","" }, | 272 | { "","" }, |
263 | { "","" }, | 273 | { "","" }, |
264 | { "","" }, | 274 | { "","" }, |
diff --git a/kmicromail/koprefs.cpp b/kmicromail/koprefs.cpp index 2bae5f6..7b1e169 100644 --- a/kmicromail/koprefs.cpp +++ b/kmicromail/koprefs.cpp | |||
@@ -1,126 +1,129 @@ | |||
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 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <time.h> | 24 | #include <time.h> |
25 | #ifndef _WIN32_ | 25 | #ifndef _WIN32_ |
26 | #include <unistd.h> | 26 | #include <unistd.h> |
27 | #endif | 27 | #endif |
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qtextstream.h> | 29 | #include <qtextstream.h> |
30 | #include <qtextcodec.h> | 30 | #include <qtextcodec.h> |
31 | #include <qstring.h> | 31 | #include <qstring.h> |
32 | #include <qregexp.h> | 32 | #include <qregexp.h> |
33 | #include <qfont.h> | 33 | #include <qfont.h> |
34 | #include <qcolor.h> | 34 | #include <qcolor.h> |
35 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
36 | #include <stdlib.h> | 36 | #include <stdlib.h> |
37 | 37 | ||
38 | #include <kglobal.h> | 38 | #include <kglobal.h> |
39 | #include <kconfig.h> | 39 | #include <kconfig.h> |
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <kdebug.h> | 41 | #include <kdebug.h> |
42 | #include <kemailsettings.h> | 42 | #include <kemailsettings.h> |
43 | #include <kstaticdeleter.h> | 43 | #include <kstaticdeleter.h> |
44 | 44 | ||
45 | #include "koprefs.h" | 45 | #include "koprefs.h" |
46 | #include "mainwindow.h" | 46 | #include "mainwindow.h" |
47 | 47 | ||
48 | 48 | ||
49 | KOPrefs *KOPrefs::mInstance = 0; | 49 | KOPrefs *KOPrefs::mInstance = 0; |
50 | static KStaticDeleter<KOPrefs> insd; | 50 | static KStaticDeleter<KOPrefs> insd; |
51 | 51 | ||
52 | KOPrefs::KOPrefs() : | 52 | KOPrefs::KOPrefs() : |
53 | KPimPrefs("kopiemailrc") | 53 | KPimPrefs("kopiemailrc") |
54 | { | 54 | { |
55 | mAppFont = QFont("helvetica",12); | 55 | mAppFont = QFont("helvetica",12); |
56 | mComposeFont = QFont("helvetica",12); | 56 | mComposeFont = QFont("helvetica",12); |
57 | mReadFont = QFont("helvetica",12); | 57 | mReadFont = QFont("helvetica",12); |
58 | 58 | ||
59 | KPrefs::setCurrentGroup("General"); | 59 | KPrefs::setCurrentGroup("General"); |
60 | addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); | 60 | addItemString("SendCodec",&mSendCodec,i18n ("userdefined") ); |
61 | addItemString("SenderName",&mName,i18n ("Please set at") ); | 61 | addItemString("SenderName",&mName,i18n ("Please set at") ); |
62 | addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); | 62 | addItemString("SenderEmail",&mEmail,i18n ("Settings@General TAB") ); |
63 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); | 63 | addItemBool("ViewMailAsHtml",&mViewAsHtml,false); |
64 | addItemBool("SendMailLater",&mSendLater,true); | 64 | addItemBool("SendMailLater",&mSendLater,true); |
65 | addItemBool("ShowToField",&mShowToField,false); | 65 | addItemBool("ShowToField",&mShowToField,false); |
66 | addItemBool("UseKapi",&mUseKapi,false); | 66 | addItemBool("UseKapi",&mUseKapi,false); |
67 | addItemInt("CurrentCodec",&mCurrentCodec,0); | 67 | addItemInt("CurrentCodec",&mCurrentCodec,0); |
68 | 68 | addItemBool("ShowInfoSub",&mShowInfoSub,true); | |
69 | addItemBool("ShowInfoFrom",&mShowInfoFrom,true); | ||
70 | addItemBool("ShowInfoTo",&mShowInfoTo,true); | ||
71 | addItemBool("ShowInfoStart",&mShowInfoStart,true); | ||
69 | KPrefs::setCurrentGroup("Fonts"); | 72 | KPrefs::setCurrentGroup("Fonts"); |
70 | addItemFont("Application Font",&mAppFont); | 73 | addItemFont("Application Font",&mAppFont); |
71 | addItemFont("Compose Font",&mComposeFont); | 74 | addItemFont("Compose Font",&mComposeFont); |
72 | addItemFont("Read Font",&mReadFont); | 75 | addItemFont("Read Font",&mReadFont); |
73 | fillMailDefaults(); | 76 | fillMailDefaults(); |
74 | isDirty = false; | 77 | isDirty = false; |
75 | } | 78 | } |
76 | 79 | ||
77 | 80 | ||
78 | KOPrefs::~KOPrefs() | 81 | KOPrefs::~KOPrefs() |
79 | { | 82 | { |
80 | if ( isDirty ) | 83 | if ( isDirty ) |
81 | writeConfig(); | 84 | writeConfig(); |
82 | if (mInstance == this) | 85 | if (mInstance == this) |
83 | mInstance = insd.setObject(0); | 86 | mInstance = insd.setObject(0); |
84 | 87 | ||
85 | } | 88 | } |
86 | 89 | ||
87 | 90 | ||
88 | KOPrefs *KOPrefs::instance() | 91 | KOPrefs *KOPrefs::instance() |
89 | { | 92 | { |
90 | if (!mInstance) { | 93 | if (!mInstance) { |
91 | mInstance = insd.setObject(new KOPrefs()); | 94 | mInstance = insd.setObject(new KOPrefs()); |
92 | mInstance->readConfig(); | 95 | mInstance->readConfig(); |
93 | } | 96 | } |
94 | 97 | ||
95 | return mInstance; | 98 | return mInstance; |
96 | } | 99 | } |
97 | 100 | ||
98 | void KOPrefs::usrSetDefaults() | 101 | void KOPrefs::usrSetDefaults() |
99 | { | 102 | { |
100 | 103 | ||
101 | } | 104 | } |
102 | 105 | ||
103 | void KOPrefs::fillMailDefaults() | 106 | void KOPrefs::fillMailDefaults() |
104 | { | 107 | { |
105 | if (mName.isEmpty()) mName = i18n ("Please set at"); | 108 | if (mName.isEmpty()) mName = i18n ("Please set at"); |
106 | if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); | 109 | if (mEmail.isEmpty()) mEmail = i18n ("Settings@General TAB"); |
107 | } | 110 | } |
108 | 111 | ||
109 | void KOPrefs::usrReadConfig() | 112 | void KOPrefs::usrReadConfig() |
110 | { | 113 | { |
111 | 114 | ||
112 | KPimPrefs::usrReadConfig(); | 115 | KPimPrefs::usrReadConfig(); |
113 | } | 116 | } |
114 | 117 | ||
115 | 118 | ||
116 | void KOPrefs::usrWriteConfig() | 119 | void KOPrefs::usrWriteConfig() |
117 | { | 120 | { |
118 | KPimPrefs::usrWriteConfig(); | 121 | KPimPrefs::usrWriteConfig(); |
119 | } | 122 | } |
120 | 123 | ||
121 | 124 | ||
122 | 125 | ||
123 | KConfig* KOPrefs::getConfig() | 126 | KConfig* KOPrefs::getConfig() |
124 | { | 127 | { |
125 | return config(); | 128 | return config(); |
126 | } | 129 | } |
diff --git a/kmicromail/koprefs.h b/kmicromail/koprefs.h index f2c4fbb..f2501e3 100644 --- a/kmicromail/koprefs.h +++ b/kmicromail/koprefs.h | |||
@@ -1,80 +1,81 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,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 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef KOPREFS_H | 23 | #ifndef KOPREFS_H |
24 | #define KOPREFS_H | 24 | #define KOPREFS_H |
25 | 25 | ||
26 | 26 | ||
27 | #include <libkdepim/kpimprefs.h> | 27 | #include <libkdepim/kpimprefs.h> |
28 | 28 | ||
29 | class KConfig; | 29 | class KConfig; |
30 | class QFont; | 30 | class QFont; |
31 | class QColor; | 31 | class QColor; |
32 | class QStringList; | 32 | class QStringList; |
33 | 33 | ||
34 | class KOPrefs : public KPimPrefs | 34 | class KOPrefs : public KPimPrefs |
35 | { | 35 | { |
36 | public: | 36 | public: |
37 | virtual ~KOPrefs(); | 37 | virtual ~KOPrefs(); |
38 | 38 | ||
39 | /** Get instance of KOPrefs. It is made sure that there is only one | 39 | /** Get instance of KOPrefs. It is made sure that there is only one |
40 | instance. */ | 40 | instance. */ |
41 | static KOPrefs *instance(); | 41 | static KOPrefs *instance(); |
42 | 42 | ||
43 | /** Set preferences to default values */ | 43 | /** Set preferences to default values */ |
44 | void usrSetDefaults(); | 44 | void usrSetDefaults(); |
45 | 45 | ||
46 | /** Read preferences from config file */ | 46 | /** Read preferences from config file */ |
47 | void usrReadConfig(); | 47 | void usrReadConfig(); |
48 | 48 | ||
49 | /** Write preferences to config file */ | 49 | /** Write preferences to config file */ |
50 | void usrWriteConfig(); | 50 | void usrWriteConfig(); |
51 | void setCategoryDefaults(){;}; | 51 | void setCategoryDefaults(){;}; |
52 | 52 | ||
53 | protected: | 53 | protected: |
54 | 54 | ||
55 | /** Fill empty mail fields with default values. */ | 55 | /** Fill empty mail fields with default values. */ |
56 | void fillMailDefaults(); | 56 | void fillMailDefaults(); |
57 | 57 | ||
58 | private: | 58 | private: |
59 | /** Constructor disabled for public. Use instance() to create a KOPrefs | 59 | /** Constructor disabled for public. Use instance() to create a KOPrefs |
60 | object. */ | 60 | object. */ |
61 | KOPrefs(); | 61 | KOPrefs(); |
62 | 62 | ||
63 | static KOPrefs *mInstance; | 63 | static KOPrefs *mInstance; |
64 | public: | 64 | public: |
65 | // preferences data | 65 | // preferences data |
66 | KConfig* getConfig(); | 66 | KConfig* getConfig(); |
67 | QFont mAppFont; | 67 | QFont mAppFont; |
68 | QFont mComposeFont; | 68 | QFont mComposeFont; |
69 | QFont mReadFont; | 69 | QFont mReadFont; |
70 | QString mName; | 70 | QString mName; |
71 | QString mSendCodec; | 71 | QString mSendCodec; |
72 | QString mEmail; | 72 | QString mEmail; |
73 | QString mCurrentCodeName; | 73 | QString mCurrentCodeName; |
74 | int mCurrentCodec; | 74 | int mCurrentCodec; |
75 | bool mSendLater, mViewAsHtml, mUseKapi, isDirty, mShowToField; | 75 | bool mSendLater, mViewAsHtml, mUseKapi, isDirty, mShowToField; |
76 | bool mShowInfoSub, mShowInfoFrom, mShowInfoTo, mShowInfoStart; | ||
76 | private: | 77 | private: |
77 | 78 | ||
78 | }; | 79 | }; |
79 | 80 | ||
80 | #endif | 81 | #endif |
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 5c8a5a9..4af4a8c 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp | |||
@@ -1,1727 +1,1746 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2000,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 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #include <kdialog.h> | 23 | #include <kdialog.h> |
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qlabel.h> | 25 | #include <qlabel.h> |
26 | #include <qgroupbox.h> | 26 | #include <qgroupbox.h> |
27 | #include <qbuttongroup.h> | 27 | #include <qbuttongroup.h> |
28 | #include <qlineedit.h> | 28 | #include <qlineedit.h> |
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qvbox.h> | 34 | #include <qvbox.h> |
35 | #include <qhbox.h> | 35 | #include <qhbox.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qdatetime.h> | 38 | #include <qdatetime.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qradiobutton.h> | 40 | #include <qradiobutton.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qstrlist.h> | 42 | #include <qstrlist.h> |
43 | #include <qapplication.h> | 43 | #include <qapplication.h> |
44 | 44 | ||
45 | #include <kcolorbutton.h> | 45 | #include <kcolorbutton.h> |
46 | #include <kdebug.h> | 46 | #include <kdebug.h> |
47 | #include <klocale.h> | 47 | #include <klocale.h> |
48 | #include <kglobal.h> | 48 | #include <kglobal.h> |
49 | #include <kfontdialog.h> | 49 | #include <kfontdialog.h> |
50 | #include <kfiledialog.h> | 50 | #include <kfiledialog.h> |
51 | #include <kmessagebox.h> | 51 | #include <kmessagebox.h> |
52 | #include <kcolordialog.h> | 52 | #include <kcolordialog.h> |
53 | #include <kiconloader.h> | 53 | #include <kiconloader.h> |
54 | #include <kemailsettings.h> | 54 | #include <kemailsettings.h> |
55 | #include <kstandarddirs.h> | 55 | #include <kstandarddirs.h> |
56 | 56 | ||
57 | #include <klineedit.h> | 57 | #include <klineedit.h> |
58 | 58 | ||
59 | 59 | ||
60 | #include "koprefs.h" | 60 | #include "koprefs.h" |
61 | 61 | ||
62 | #include "koprefsdialog.h" | 62 | #include "koprefsdialog.h" |
63 | //#include <kprefswidget.h> | 63 | //#include <kprefswidget.h> |
64 | 64 | ||
65 | 65 | ||
66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | 66 | KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : |
67 | KPrefsDialog(KOPrefs::instance(),parent,name,true) | 67 | KPrefsDialog(KOPrefs::instance(),parent,name,true) |
68 | { | 68 | { |
69 | 69 | ||
70 | setCaption( i18n("Settings - some need a restart (nr)")); | 70 | setCaption( i18n("Settings - some need a restart (nr)")); |
71 | setupGlobalTab(); | 71 | setupGlobalTab(); |
72 | setupMainTab(); | 72 | setupMainTab(); |
73 | setupMailTab();; | 73 | setupMailTab();; |
74 | setupFontsTab(); | 74 | setupFontsTab(); |
75 | readConfig(); | 75 | readConfig(); |
76 | 76 | ||
77 | #if 0 | 77 | #if 0 |
78 | 78 | ||
79 | setupMainTab(); | 79 | setupMainTab(); |
80 | setupLocaleTab(); | 80 | setupLocaleTab(); |
81 | setupTimeZoneTab(); | 81 | setupTimeZoneTab(); |
82 | setupTimeTab(); | 82 | setupTimeTab(); |
83 | setupLocaleDateTab(); | 83 | setupLocaleDateTab(); |
84 | setupFontsTab(); | 84 | setupFontsTab(); |
85 | setupColorsTab(); | 85 | setupColorsTab(); |
86 | setupViewsTab(); | 86 | setupViewsTab(); |
87 | //setupSyncTab(); | 87 | //setupSyncTab(); |
88 | //setupSyncAlgTab(); | 88 | //setupSyncAlgTab(); |
89 | //setupPrinterTab(); | 89 | //setupPrinterTab(); |
90 | //setupGroupSchedulingTab(); | 90 | //setupGroupSchedulingTab(); |
91 | //setupGroupAutomationTab(); | 91 | //setupGroupAutomationTab(); |
92 | #endif | 92 | #endif |
93 | } | 93 | } |
94 | 94 | ||
95 | #include "kpimglobalprefs.h" | 95 | #include "kpimglobalprefs.h" |
96 | 96 | ||
97 | KOPrefsDialog::~KOPrefsDialog() | 97 | KOPrefsDialog::~KOPrefsDialog() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | void KOPrefsDialog::setupGlobalTab() | 100 | void KOPrefsDialog::setupGlobalTab() |
101 | { | 101 | { |
102 | QFrame *topFrame = addPage(i18n("Global"),0,0); | 102 | QFrame *topFrame = addPage(i18n("Global"),0,0); |
103 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); | 103 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); |
104 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 104 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
105 | topLayout->addWidget( kdelibcfg ); | 105 | topLayout->addWidget( kdelibcfg ); |
106 | 106 | ||
107 | 107 | ||
108 | } | 108 | } |
109 | void KOPrefsDialog::setupMainTab() | 109 | void KOPrefsDialog::setupMainTab() |
110 | { | 110 | { |
111 | QFrame *topFrame = addPage(i18n("General"),0,0); | 111 | QFrame *topFrame = addPage(i18n("General"),0,0); |
112 | 112 | ||
113 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 113 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
114 | topLayout->setSpacing(spacingHint()); | 114 | topLayout->setSpacing(spacingHint()); |
115 | topLayout->setMargin(marginHint()); | 115 | topLayout->setMargin(marginHint()); |
116 | 116 | ||
117 | 117 | ||
118 | mNameEdit = new QLineEdit(topFrame); | 118 | mNameEdit = new QLineEdit(topFrame); |
119 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 119 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
120 | topLayout->addWidget(mNameLabel,0,0); | 120 | topLayout->addWidget(mNameLabel,0,0); |
121 | topLayout->addWidget(mNameEdit,0,1); | 121 | topLayout->addWidget(mNameEdit,0,1); |
122 | 122 | ||
123 | mEmailEdit = new QLineEdit(topFrame); | 123 | mEmailEdit = new QLineEdit(topFrame); |
124 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 124 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
125 | topLayout->addWidget(mEmailLabel,1,0); | 125 | topLayout->addWidget(mEmailLabel,1,0); |
126 | topLayout->addWidget(mEmailEdit,1,1); | 126 | topLayout->addWidget(mEmailEdit,1,1); |
127 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); | 127 | QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); |
128 | topLayout->addMultiCellWidget(lab,2,2,0,1); | 128 | topLayout->addMultiCellWidget(lab,2,2,0,1); |
129 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), | 129 | KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), |
130 | &(KOPrefs::instance()->mUseKapi),topFrame); | 130 | &(KOPrefs::instance()->mUseKapi),topFrame); |
131 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); | 131 | topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); |
132 | } | 132 | } |
133 | 133 | ||
134 | void KOPrefsDialog::setupMailTab() | 134 | void KOPrefsDialog::setupMailTab() |
135 | { | 135 | { |
136 | QFrame *topFrame = addPage(i18n("Mail"),0,0); | 136 | QFrame *topFrame = addPage(i18n("Mail"),0,0); |
137 | 137 | ||
138 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 138 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
139 | topLayout->setSpacing(spacingHint()); | 139 | topLayout->setSpacing(spacingHint()); |
140 | topLayout->setMargin(marginHint()); | 140 | topLayout->setMargin(marginHint()); |
141 | 141 | ||
142 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), | 142 | KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), |
143 | &(KOPrefs::instance()->mViewAsHtml),topFrame); | 143 | &(KOPrefs::instance()->mViewAsHtml),topFrame); |
144 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); | 144 | topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); |
145 | 145 | ||
146 | 146 | ||
147 | ttt = addWidBool(i18n("Send mails later"), | 147 | ttt = addWidBool(i18n("Send mails later"), |
148 | &(KOPrefs::instance()->mSendLater),topFrame); | 148 | &(KOPrefs::instance()->mSendLater),topFrame); |
149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); | 149 | topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); |
150 | ttt = addWidBool(i18n("Show \"To\" field in list view"), | 150 | ttt = addWidBool(i18n("Show \"To\" field in list view"), |
151 | &(KOPrefs::instance()->mShowToField),topFrame); | 151 | &(KOPrefs::instance()->mShowToField),topFrame); |
152 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); | 152 | topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); |
153 | |||
154 | int iii =3; | ||
155 | ttt = addWidBool(i18n("Show info fields at startup"), | ||
156 | &(KOPrefs::instance()->mShowInfoStart),topFrame); | ||
157 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | ||
158 | ++iii; | ||
159 | ttt = addWidBool(i18n("Show \"Subject\" info field"), | ||
160 | &(KOPrefs::instance()->mShowInfoSub),topFrame); | ||
161 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | ||
162 | ++iii; | ||
163 | ttt = addWidBool(i18n("Show \"From\" info field"), | ||
164 | &(KOPrefs::instance()->mShowInfoFrom),topFrame); | ||
165 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | ||
166 | ++iii; | ||
167 | ttt = addWidBool(i18n("Show \"To\" info field"), | ||
168 | &(KOPrefs::instance()->mShowInfoTo),topFrame); | ||
169 | topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); | ||
170 | ++iii; | ||
171 | |||
153 | /* | 172 | /* |
154 | mCodecEdit = new QLineEdit(topFrame); | 173 | mCodecEdit = new QLineEdit(topFrame); |
155 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); | 174 | topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); |
156 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); | 175 | topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); |
157 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); | 176 | topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); |
158 | */ | 177 | */ |
159 | } | 178 | } |
160 | void KOPrefsDialog::setupFontsTab() | 179 | void KOPrefsDialog::setupFontsTab() |
161 | { | 180 | { |
162 | 181 | ||
163 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 182 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
164 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 183 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
165 | 184 | ||
166 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 185 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
167 | topLayout->setSpacing(1); | 186 | topLayout->setSpacing(1); |
168 | topLayout->setMargin(3); | 187 | topLayout->setMargin(3); |
169 | KPrefsDialogWidFont * tVFont; | 188 | KPrefsDialogWidFont * tVFont; |
170 | int i = 0; | 189 | int i = 0; |
171 | KPrefsDialogWidFont *timeLabelsFont = | 190 | KPrefsDialogWidFont *timeLabelsFont = |
172 | addWidFont(i18n("OK"),i18n("Application(nr)"), | 191 | addWidFont(i18n("OK"),i18n("Application(nr)"), |
173 | &(KOPrefs::instance()->mAppFont),topFrame); | 192 | &(KOPrefs::instance()->mAppFont),topFrame); |
174 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 193 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
175 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 194 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
176 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 195 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
177 | ++i; | 196 | ++i; |
178 | 197 | ||
179 | 198 | ||
180 | timeLabelsFont = | 199 | timeLabelsFont = |
181 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), | 200 | addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), |
182 | &(KOPrefs::instance()->mComposeFont),topFrame); | 201 | &(KOPrefs::instance()->mComposeFont),topFrame); |
183 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 202 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
184 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 203 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
185 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 204 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
186 | ++i; | 205 | ++i; |
187 | 206 | ||
188 | KPrefsDialogWidFont *timeBarFont = | 207 | KPrefsDialogWidFont *timeBarFont = |
189 | addWidFont(i18n("Hello"),i18n("Read mail:"), | 208 | addWidFont(i18n("Hello"),i18n("Read mail:"), |
190 | &(KOPrefs::instance()->mReadFont),topFrame); | 209 | &(KOPrefs::instance()->mReadFont),topFrame); |
191 | topLayout->addWidget(timeBarFont->label(),i,0); | 210 | topLayout->addWidget(timeBarFont->label(),i,0); |
192 | topLayout->addWidget(timeBarFont->preview(),i,1); | 211 | topLayout->addWidget(timeBarFont->preview(),i,1); |
193 | topLayout->addWidget(timeBarFont->button(),i,2); | 212 | topLayout->addWidget(timeBarFont->button(),i,2); |
194 | ++i; | 213 | ++i; |
195 | 214 | ||
196 | topLayout->setColStretch(1,1); | 215 | topLayout->setColStretch(1,1); |
197 | topLayout->setRowStretch(4,1); | 216 | topLayout->setRowStretch(4,1); |
198 | 217 | ||
199 | } | 218 | } |
200 | void KOPrefsDialog::usrReadConfig() | 219 | void KOPrefsDialog::usrReadConfig() |
201 | { | 220 | { |
202 | 221 | ||
203 | mNameEdit->setText(KOPrefs::instance()->mName); | 222 | mNameEdit->setText(KOPrefs::instance()->mName); |
204 | mEmailEdit->setText(KOPrefs::instance()->mEmail); | 223 | mEmailEdit->setText(KOPrefs::instance()->mEmail); |
205 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); | 224 | //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); |
206 | kdelibcfg->readConfig(); | 225 | kdelibcfg->readConfig(); |
207 | } | 226 | } |
208 | void KOPrefsDialog::usrWriteConfig() | 227 | void KOPrefsDialog::usrWriteConfig() |
209 | { | 228 | { |
210 | KOPrefs::instance()->mName = mNameEdit->text(); | 229 | KOPrefs::instance()->mName = mNameEdit->text(); |
211 | KOPrefs::instance()->mEmail = mEmailEdit->text(); | 230 | KOPrefs::instance()->mEmail = mEmailEdit->text(); |
212 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); | 231 | //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); |
213 | kdelibcfg->writeConfig(); | 232 | kdelibcfg->writeConfig(); |
214 | 233 | ||
215 | 234 | ||
216 | } | 235 | } |
217 | 236 | ||
218 | #if 0 | 237 | #if 0 |
219 | void KOPrefsDialog::setupLocaleDateTab() | 238 | void KOPrefsDialog::setupLocaleDateTab() |
220 | { | 239 | { |
221 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 240 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); |
222 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 241 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); |
223 | topLayout->setSpacing(spacingHint()); | 242 | topLayout->setSpacing(spacingHint()); |
224 | topLayout->setMargin(marginHint()); | 243 | topLayout->setMargin(marginHint()); |
225 | int iii = 0; | 244 | int iii = 0; |
226 | 245 | ||
227 | 246 | ||
228 | KPrefsWidRadios *syncPrefsGroup = | 247 | KPrefsWidRadios *syncPrefsGroup = |
229 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); | 248 | addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); |
230 | QString format; | 249 | QString format; |
231 | if ( QApplication::desktop()->width() < 480 ) | 250 | if ( QApplication::desktop()->width() < 480 ) |
232 | format = "(%d.%m.%Y)"; | 251 | format = "(%d.%m.%Y)"; |
233 | else | 252 | else |
234 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 253 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
235 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 254 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
236 | if ( QApplication::desktop()->width() < 480 ) | 255 | if ( QApplication::desktop()->width() < 480 ) |
237 | format = "(%m.%d.%Y)"; | 256 | format = "(%m.%d.%Y)"; |
238 | else | 257 | else |
239 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 258 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
240 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 259 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
241 | if ( QApplication::desktop()->width() < 480 ) | 260 | if ( QApplication::desktop()->width() < 480 ) |
242 | format = "(%Y-%m-%d)"; | 261 | format = "(%Y-%m-%d)"; |
243 | else | 262 | else |
244 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 263 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
245 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 264 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
246 | syncPrefsGroup->addRadio(i18n("User defined")); | 265 | syncPrefsGroup->addRadio(i18n("User defined")); |
247 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 266 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
248 | ++iii; | 267 | ++iii; |
249 | ++iii; | 268 | ++iii; |
250 | QLabel * lab; | 269 | QLabel * lab; |
251 | mUserDateFormatLong = new QLineEdit(topFrame); | 270 | mUserDateFormatLong = new QLineEdit(topFrame); |
252 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 271 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
253 | topLayout->addWidget(lab ,iii,0); | 272 | topLayout->addWidget(lab ,iii,0); |
254 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 273 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
255 | ++iii; | 274 | ++iii; |
256 | mUserDateFormatShort = new QLineEdit(topFrame); | 275 | mUserDateFormatShort = new QLineEdit(topFrame); |
257 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 276 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
258 | topLayout->addWidget(lab ,iii,0); | 277 | topLayout->addWidget(lab ,iii,0); |
259 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 278 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
260 | ++iii; | 279 | ++iii; |
261 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 280 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
262 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 281 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
263 | ++iii; | 282 | ++iii; |
264 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 283 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
265 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 284 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
266 | ++iii; | 285 | ++iii; |
267 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 286 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
268 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 287 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
269 | ++iii; | 288 | ++iii; |
270 | 289 | ||
271 | } | 290 | } |
272 | 291 | ||
273 | void KOPrefsDialog::setupLocaleTab() | 292 | void KOPrefsDialog::setupLocaleTab() |
274 | { | 293 | { |
275 | QFrame *topFrame = addPage(i18n("Locale"),0,0); | 294 | QFrame *topFrame = addPage(i18n("Locale"),0,0); |
276 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 295 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
277 | topLayout->setSpacing(spacingHint()); | 296 | topLayout->setSpacing(spacingHint()); |
278 | topLayout->setMargin(marginHint()); | 297 | topLayout->setMargin(marginHint()); |
279 | int iii = 0; | 298 | int iii = 0; |
280 | KPrefsWidRadios *syncPrefsGroup = | 299 | KPrefsWidRadios *syncPrefsGroup = |
281 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); | 300 | addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); |
282 | syncPrefsGroup->addRadio(i18n("English")); | 301 | syncPrefsGroup->addRadio(i18n("English")); |
283 | syncPrefsGroup->addRadio(i18n("German")); | 302 | syncPrefsGroup->addRadio(i18n("German")); |
284 | syncPrefsGroup->addRadio(i18n("French")); | 303 | syncPrefsGroup->addRadio(i18n("French")); |
285 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 304 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
286 | if ( QApplication::desktop()->width() < 300 ) | 305 | if ( QApplication::desktop()->width() < 300 ) |
287 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 306 | ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
288 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 307 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
289 | ++iii; | 308 | ++iii; |
290 | 309 | ||
291 | syncPrefsGroup = | 310 | syncPrefsGroup = |
292 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); | 311 | addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); |
293 | if ( QApplication::desktop()->width() > 300 ) | 312 | if ( QApplication::desktop()->width() > 300 ) |
294 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 313 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
295 | syncPrefsGroup->addRadio(i18n("24:00")); | 314 | syncPrefsGroup->addRadio(i18n("24:00")); |
296 | syncPrefsGroup->addRadio(i18n("12:00am")); | 315 | syncPrefsGroup->addRadio(i18n("12:00am")); |
297 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); | 316 | syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); |
298 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 317 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
299 | ++iii; | 318 | ++iii; |
300 | KPrefsDialogWidBool *sb; | 319 | KPrefsDialogWidBool *sb; |
301 | if ( QApplication::desktop()->width() < 300 ) { | 320 | if ( QApplication::desktop()->width() < 300 ) { |
302 | sb = | 321 | sb = |
303 | addWidBool(i18n("Week starts on Sunday"), | 322 | addWidBool(i18n("Week starts on Sunday"), |
304 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); | 323 | &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); |
305 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 324 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
306 | ++iii; | 325 | ++iii; |
307 | sb = | 326 | sb = |
308 | addWidBool(i18n("Use short date in (WN/E) view"), | 327 | addWidBool(i18n("Use short date in (WN/E) view"), |
309 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); | 328 | &(KOPrefs::instance()->mShortDateInViewer),topFrame); |
310 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 329 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
311 | } | 330 | } |
312 | else { | 331 | else { |
313 | QWidget * hb = new QWidget( topFrame ); | 332 | QWidget * hb = new QWidget( topFrame ); |
314 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); | 333 | QHBoxLayout *hbLayout = new QHBoxLayout(hb); |
315 | sb = | 334 | sb = |
316 | addWidBool(i18n("Week starts on Sunday"), | 335 | addWidBool(i18n("Week starts on Sunday"), |
317 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); | 336 | &(KOPrefs::instance()->mWeekStartsOnSunday),hb); |
318 | hbLayout->addWidget(sb->checkBox() ); | 337 | hbLayout->addWidget(sb->checkBox() ); |
319 | sb = | 338 | sb = |
320 | addWidBool(i18n("Use short date in (WN/E) view"), | 339 | addWidBool(i18n("Use short date in (WN/E) view"), |
321 | &(KOPrefs::instance()->mShortDateInViewer),hb); | 340 | &(KOPrefs::instance()->mShortDateInViewer),hb); |
322 | hbLayout->addWidget(sb->checkBox() ); | 341 | hbLayout->addWidget(sb->checkBox() ); |
323 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); | 342 | topLayout->addMultiCellWidget(hb, iii,iii,0,1); |
324 | 343 | ||
325 | } | 344 | } |
326 | //#ifndef DESKTOP_VERSION | 345 | //#ifndef DESKTOP_VERSION |
327 | #if 0 | 346 | #if 0 |
328 | ++iii; | 347 | ++iii; |
329 | sb = | 348 | sb = |
330 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | 349 | addWidBool(i18n("Quick load/save (w/o Unicode)"), |
331 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | 350 | &(KOPrefs::instance()->mUseQuicksave),topFrame); |
332 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 351 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
333 | #endif | 352 | #endif |
334 | } | 353 | } |
335 | void KOPrefsDialog::showSyncPage() | 354 | void KOPrefsDialog::showSyncPage() |
336 | { | 355 | { |
337 | showPage ( 2 ) ; | 356 | showPage ( 2 ) ; |
338 | 357 | ||
339 | } | 358 | } |
340 | void KOPrefsDialog::setupSyncAlgTab() | 359 | void KOPrefsDialog::setupSyncAlgTab() |
341 | { | 360 | { |
342 | #if 0 | 361 | #if 0 |
343 | QLabel * lab; | 362 | QLabel * lab; |
344 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); | 363 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); |
345 | mSetupSyncAlgTab = topFrame; | 364 | mSetupSyncAlgTab = topFrame; |
346 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 365 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
347 | topLayout->setSpacing(spacingHint()); | 366 | topLayout->setSpacing(spacingHint()); |
348 | topLayout->setMargin(marginHint()); | 367 | topLayout->setMargin(marginHint()); |
349 | int iii = 0; | 368 | int iii = 0; |
350 | 369 | ||
351 | KPrefsDialogWidBool *sb = | 370 | KPrefsDialogWidBool *sb = |
352 | addWidBool(i18n("Ask for preferences before syncing"), | 371 | addWidBool(i18n("Ask for preferences before syncing"), |
353 | &(KOPrefs::instance()->mAskForPreferences),topFrame); | 372 | &(KOPrefs::instance()->mAskForPreferences),topFrame); |
354 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 373 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
355 | 374 | ||
356 | ++iii; | 375 | ++iii; |
357 | 376 | ||
358 | KPrefsWidRadios *syncPrefsGroup = | 377 | KPrefsWidRadios *syncPrefsGroup = |
359 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), | 378 | addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), |
360 | topFrame); | 379 | topFrame); |
361 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); | 380 | syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); |
362 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); | 381 | syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); |
363 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); | 382 | syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); |
364 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); | 383 | syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); |
365 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); | 384 | syncPrefsGroup->addRadio(i18n("Force take local entry always")); |
366 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); | 385 | syncPrefsGroup->addRadio(i18n("Force take remote entry always")); |
367 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 386 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
368 | ++iii; | 387 | ++iii; |
369 | sb = | 388 | sb = |
370 | addWidBool(i18n("Show summary after syncing"), | 389 | addWidBool(i18n("Show summary after syncing"), |
371 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); | 390 | &(KOPrefs::instance()->mShowSyncSummary),topFrame); |
372 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 391 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
373 | 392 | ||
374 | ++iii; | 393 | ++iii; |
375 | #endif | 394 | #endif |
376 | 395 | ||
377 | 396 | ||
378 | 397 | ||
379 | } | 398 | } |
380 | 399 | ||
381 | 400 | ||
382 | void KOPrefsDialog::setupSyncTab() | 401 | void KOPrefsDialog::setupSyncTab() |
383 | { | 402 | { |
384 | #if 0 | 403 | #if 0 |
385 | QLabel * lab; | 404 | QLabel * lab; |
386 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); | 405 | QFrame *topFrame = addPage(i18n("Sync Network"),0,0); |
387 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 406 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
388 | topLayout->setSpacing(spacingHint()); | 407 | topLayout->setSpacing(spacingHint()); |
389 | topLayout->setMargin(marginHint()); | 408 | topLayout->setMargin(marginHint()); |
390 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); | 409 | lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); |
391 | int iii = 0; | 410 | int iii = 0; |
392 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); | 411 | topLayout->addMultiCellWidget(lab , iii,iii,0,1); |
393 | ++iii; | 412 | ++iii; |
394 | 413 | ||
395 | mRemoteIPEdit = new QLineEdit(topFrame); | 414 | mRemoteIPEdit = new QLineEdit(topFrame); |
396 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); | 415 | lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); |
397 | topLayout->addWidget(lab ,iii,0); | 416 | topLayout->addWidget(lab ,iii,0); |
398 | topLayout->addWidget(mRemoteIPEdit,iii,1); | 417 | topLayout->addWidget(mRemoteIPEdit,iii,1); |
399 | ++iii; | 418 | ++iii; |
400 | mRemoteUser = new QLineEdit(topFrame); | 419 | mRemoteUser = new QLineEdit(topFrame); |
401 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); | 420 | lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); |
402 | topLayout->addWidget(lab ,iii,0); | 421 | topLayout->addWidget(lab ,iii,0); |
403 | topLayout->addWidget(mRemoteUser, iii,1); | 422 | topLayout->addWidget(mRemoteUser, iii,1); |
404 | ++iii; | 423 | ++iii; |
405 | 424 | ||
406 | mRemoteFile = new QLineEdit(topFrame); | 425 | mRemoteFile = new QLineEdit(topFrame); |
407 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); | 426 | lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); |
408 | topLayout->addWidget(lab ,iii,0); | 427 | topLayout->addWidget(lab ,iii,0); |
409 | topLayout->addWidget(mRemoteFile,iii,1); | 428 | topLayout->addWidget(mRemoteFile,iii,1); |
410 | ++iii; | 429 | ++iii; |
411 | 430 | ||
412 | mLocalTempFile = new QLineEdit(topFrame); | 431 | mLocalTempFile = new QLineEdit(topFrame); |
413 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); | 432 | lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); |
414 | topLayout->addWidget(lab ,iii,0); | 433 | topLayout->addWidget(lab ,iii,0); |
415 | topLayout->addWidget(mLocalTempFile,iii,1); | 434 | topLayout->addWidget(mLocalTempFile,iii,1); |
416 | ++iii; | 435 | ++iii; |
417 | 436 | ||
418 | KPrefsDialogWidBool *wb = | 437 | KPrefsDialogWidBool *wb = |
419 | addWidBool(i18n("Write back synced file"), | 438 | addWidBool(i18n("Write back synced file"), |
420 | &(KOPrefs::instance()->mWriteBackFile),topFrame); | 439 | &(KOPrefs::instance()->mWriteBackFile),topFrame); |
421 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 440 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
422 | ++iii; | 441 | ++iii; |
423 | wb = | 442 | wb = |
424 | addWidBool(i18n("Write back existing entries only"), | 443 | addWidBool(i18n("Write back existing entries only"), |
425 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); | 444 | &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); |
426 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); | 445 | topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); |
427 | ++iii; | 446 | ++iii; |
428 | 447 | ||
429 | #endif | 448 | #endif |
430 | } | 449 | } |
431 | 450 | ||
432 | void KOPrefsDialog::setupMainTab() | 451 | void KOPrefsDialog::setupMainTab() |
433 | { | 452 | { |
434 | QFrame *topFrame = addPage(i18n("General"),0,0); | 453 | QFrame *topFrame = addPage(i18n("General"),0,0); |
435 | // DesktopIcon("identity",KIcon::SizeMedium)); | 454 | // DesktopIcon("identity",KIcon::SizeMedium)); |
436 | 455 | ||
437 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 456 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
438 | topLayout->setSpacing(spacingHint()); | 457 | topLayout->setSpacing(spacingHint()); |
439 | topLayout->setMargin(marginHint()); | 458 | topLayout->setMargin(marginHint()); |
440 | 459 | ||
441 | // KPrefsDialogWidBool *emailControlCenter = | 460 | // KPrefsDialogWidBool *emailControlCenter = |
442 | // addWidBool(i18n("&Use email settings from Control Center"), | 461 | // addWidBool(i18n("&Use email settings from Control Center"), |
443 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); | 462 | // &(KOPrefs::instance()->mEmailControlCenter),topFrame); |
444 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); | 463 | // topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); |
445 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), | 464 | // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), |
446 | // SLOT(toggleEmailSettings(bool))); | 465 | // SLOT(toggleEmailSettings(bool))); |
447 | 466 | ||
448 | mNameEdit = new QLineEdit(topFrame); | 467 | mNameEdit = new QLineEdit(topFrame); |
449 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); | 468 | mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); |
450 | topLayout->addWidget(mNameLabel,0,0); | 469 | topLayout->addWidget(mNameLabel,0,0); |
451 | topLayout->addWidget(mNameEdit,0,1); | 470 | topLayout->addWidget(mNameEdit,0,1); |
452 | 471 | ||
453 | mEmailEdit = new QLineEdit(topFrame); | 472 | mEmailEdit = new QLineEdit(topFrame); |
454 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); | 473 | mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); |
455 | topLayout->addWidget(mEmailLabel,1,0); | 474 | topLayout->addWidget(mEmailLabel,1,0); |
456 | topLayout->addWidget(mEmailEdit,1,1); | 475 | topLayout->addWidget(mEmailEdit,1,1); |
457 | KPrefsDialogWidBool *wb; | 476 | KPrefsDialogWidBool *wb; |
458 | QHBox *dummy; | 477 | QHBox *dummy; |
459 | if ( QApplication::desktop()->width() > 480 ) { | 478 | if ( QApplication::desktop()->width() > 480 ) { |
460 | dummy = new QHBox(topFrame); | 479 | dummy = new QHBox(topFrame); |
461 | } else { | 480 | } else { |
462 | dummy = new QVBox(topFrame); | 481 | dummy = new QVBox(topFrame); |
463 | } | 482 | } |
464 | 483 | ||
465 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); | 484 | topLayout->addMultiCellWidget(dummy, 2,2,0,1); |
466 | addWidBool(i18n("Full menu bar(nr)"), | 485 | addWidBool(i18n("Full menu bar(nr)"), |
467 | &(KOPrefs::instance()->mShowFullMenu),dummy); | 486 | &(KOPrefs::instance()->mShowFullMenu),dummy); |
468 | 487 | ||
469 | 488 | ||
470 | addWidBool(i18n("Mini icons in toolbar(nr)"), | 489 | addWidBool(i18n("Mini icons in toolbar(nr)"), |
471 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); | 490 | &(KOPrefs::instance()->mToolBarMiniIcons),dummy); |
472 | 491 | ||
473 | 492 | ||
474 | dummy = new QHBox(topFrame); | 493 | dummy = new QHBox(topFrame); |
475 | new QLabel(i18n("Days in What's Next:"),dummy); | 494 | new QLabel(i18n("Days in What's Next:"),dummy); |
476 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); | 495 | mWhatsNextSpin = new QSpinBox(1,14,1,dummy); |
477 | 496 | ||
478 | topLayout->addMultiCellWidget(dummy,3,3,0,1); | 497 | topLayout->addMultiCellWidget(dummy,3,3,0,1); |
479 | 498 | ||
480 | 499 | ||
481 | 500 | ||
482 | dummy = new QHBox(topFrame); | 501 | dummy = new QHBox(topFrame); |
483 | new QLabel(i18n("Days in Next-X-Days:"),dummy); | 502 | new QLabel(i18n("Days in Next-X-Days:"),dummy); |
484 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); | 503 | mNextXDaysSpin = new QSpinBox(2,14,1,dummy); |
485 | 504 | ||
486 | topLayout->addMultiCellWidget(dummy,4,4,0,1); | 505 | topLayout->addMultiCellWidget(dummy,4,4,0,1); |
487 | 506 | ||
488 | QHBox *prioBox = new QHBox(topFrame); | 507 | QHBox *prioBox = new QHBox(topFrame); |
489 | // intervalBox->setSpacing(spacingHint()); | 508 | // intervalBox->setSpacing(spacingHint()); |
490 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); | 509 | topLayout->addMultiCellWidget(prioBox,5,5,0,1); |
491 | QString messa = i18n("Show topmost todo prios in What's Next:"); | 510 | QString messa = i18n("Show topmost todo prios in What's Next:"); |
492 | 511 | ||
493 | if ( QApplication::desktop()->width() < 300 ) | 512 | if ( QApplication::desktop()->width() < 300 ) |
494 | messa = i18n("Show topmost todo prios in What's N.:"); | 513 | messa = i18n("Show topmost todo prios in What's N.:"); |
495 | QLabel *prioLabel = new QLabel(messa, prioBox); | 514 | QLabel *prioLabel = new QLabel(messa, prioBox); |
496 | mPrioSpin = new QSpinBox(0,5,1,prioBox); | 515 | mPrioSpin = new QSpinBox(0,5,1,prioBox); |
497 | if ( QApplication::desktop()->width() < 300 ) | 516 | if ( QApplication::desktop()->width() < 300 ) |
498 | mPrioSpin->setFixedWidth( 40 ); | 517 | mPrioSpin->setFixedWidth( 40 ); |
499 | 518 | ||
500 | // KPrefsDialogWidBool *bcc = | 519 | // KPrefsDialogWidBool *bcc = |
501 | // addWidBool(i18n("Send copy to owner when mailing events"), | 520 | // addWidBool(i18n("Send copy to owner when mailing events"), |
502 | // &(KOPrefs::instance()->mBcc),topFrame); | 521 | // &(KOPrefs::instance()->mBcc),topFrame); |
503 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); | 522 | // topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); |
504 | 523 | ||
505 | 524 | ||
506 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); | 525 | // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); |
507 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); | 526 | //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); |
508 | 527 | ||
509 | // addWidBool(i18n("Enable automatic saving of calendar"), | 528 | // addWidBool(i18n("Enable automatic saving of calendar"), |
510 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); | 529 | // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); |
511 | 530 | ||
512 | QHBox *intervalBox = new QHBox(topFrame); | 531 | QHBox *intervalBox = new QHBox(topFrame); |
513 | // intervalBox->setSpacing(spacingHint()); | 532 | // intervalBox->setSpacing(spacingHint()); |
514 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); | 533 | topLayout->addMultiCellWidget(intervalBox,6,6,0,1); |
515 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); | 534 | QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); |
516 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); | 535 | mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); |
517 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); | 536 | autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); |
518 | /* | 537 | /* |
519 | QHBox * agendasize = new QHBox ( topFrame ); | 538 | QHBox * agendasize = new QHBox ( topFrame ); |
520 | 539 | ||
521 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); | 540 | new QLabel (i18n("AllDayAgenda Height:"), agendasize ); |
522 | 541 | ||
523 | 542 | ||
524 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); | 543 | mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); |
525 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); | 544 | topLayout->addMultiCellWidget(agendasize,7,7,0,1); |
526 | */ | 545 | */ |
527 | KPrefsDialogWidBool *verticalScreen = | 546 | KPrefsDialogWidBool *verticalScreen = |
528 | addWidBool(i18n("Show vertical screen (Needs restart)"), | 547 | addWidBool(i18n("Show vertical screen (Needs restart)"), |
529 | &(KOPrefs::instance()->mVerticalScreen),topFrame); | 548 | &(KOPrefs::instance()->mVerticalScreen),topFrame); |
530 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); | 549 | //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); |
531 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); | 550 | topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); |
532 | 551 | ||
533 | KPrefsDialogWidBool *ask = | 552 | KPrefsDialogWidBool *ask = |
534 | addWidBool(i18n("Ask for quit when closing KO/Pi"), | 553 | addWidBool(i18n("Ask for quit when closing KO/Pi"), |
535 | &(KOPrefs::instance()->mAskForQuit),topFrame); | 554 | &(KOPrefs::instance()->mAskForQuit),topFrame); |
536 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); | 555 | topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); |
537 | 556 | ||
538 | 557 | ||
539 | /* | 558 | /* |
540 | KPrefsDialogWidBool *confirmCheck = | 559 | KPrefsDialogWidBool *confirmCheck = |
541 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), | 560 | addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), |
542 | topFrame); | 561 | topFrame); |
543 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); | 562 | topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); |
544 | 563 | ||
545 | 564 | ||
546 | mEnableGroupScheduling = | 565 | mEnableGroupScheduling = |
547 | addWidBool(i18n("Enable group scheduling"), | 566 | addWidBool(i18n("Enable group scheduling"), |
548 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); | 567 | &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); |
549 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); | 568 | topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); |
550 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), | 569 | connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), |
551 | SLOT(warningGroupScheduling())); | 570 | SLOT(warningGroupScheduling())); |
552 | 571 | ||
553 | mEnableProjectView = | 572 | mEnableProjectView = |
554 | addWidBool(i18n("Enable project view"), | 573 | addWidBool(i18n("Enable project view"), |
555 | &(KOPrefs::instance()->mEnableProjectView),topFrame); | 574 | &(KOPrefs::instance()->mEnableProjectView),topFrame); |
556 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); | 575 | topLayout->addWidget(mEnableProjectView->checkBox(),9,0); |
557 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), | 576 | connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), |
558 | SLOT(warningProjectView())); | 577 | SLOT(warningProjectView())); |
559 | 578 | ||
560 | // Can't be disabled anymore | 579 | // Can't be disabled anymore |
561 | mEnableGroupScheduling->checkBox()->hide(); | 580 | mEnableGroupScheduling->checkBox()->hide(); |
562 | 581 | ||
563 | // Disable setting, because this feature now becomes stable | 582 | // Disable setting, because this feature now becomes stable |
564 | mEnableProjectView->checkBox()->hide(); | 583 | mEnableProjectView->checkBox()->hide(); |
565 | 584 | ||
566 | KPrefsWidRadios *defaultFormatGroup = | 585 | KPrefsWidRadios *defaultFormatGroup = |
567 | addWidRadios(i18n("Default Calendar Format"), | 586 | addWidRadios(i18n("Default Calendar Format"), |
568 | &(KOPrefs::instance()->mDefaultFormat),topFrame); | 587 | &(KOPrefs::instance()->mDefaultFormat),topFrame); |
569 | defaultFormatGroup->addRadio(i18n("vCalendar")); | 588 | defaultFormatGroup->addRadio(i18n("vCalendar")); |
570 | defaultFormatGroup->addRadio(i18n("iCalendar")); | 589 | defaultFormatGroup->addRadio(i18n("iCalendar")); |
571 | 590 | ||
572 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); | 591 | topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); |
573 | 592 | ||
574 | // Default format unconditionally is iCalendar | 593 | // Default format unconditionally is iCalendar |
575 | defaultFormatGroup->groupBox()->hide(); | 594 | defaultFormatGroup->groupBox()->hide(); |
576 | 595 | ||
577 | KPrefsWidRadios *mailClientGroup = | 596 | KPrefsWidRadios *mailClientGroup = |
578 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), | 597 | addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), |
579 | topFrame); | 598 | topFrame); |
580 | mailClientGroup->addRadio(i18n("KMail")); | 599 | mailClientGroup->addRadio(i18n("KMail")); |
581 | mailClientGroup->addRadio(i18n("Sendmail")); | 600 | mailClientGroup->addRadio(i18n("Sendmail")); |
582 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); | 601 | topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); |
583 | 602 | ||
584 | KPrefsDialogWidBool *htmlsave = | 603 | KPrefsDialogWidBool *htmlsave = |
585 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), | 604 | addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), |
586 | topFrame); | 605 | topFrame); |
587 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); | 606 | topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); |
588 | 607 | ||
589 | KPrefsWidRadios *destinationGroup = | 608 | KPrefsWidRadios *destinationGroup = |
590 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), | 609 | addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), |
591 | topFrame); | 610 | topFrame); |
592 | destinationGroup->addRadio(i18n("be added to the standard resource")); | 611 | destinationGroup->addRadio(i18n("be added to the standard resource")); |
593 | destinationGroup->addRadio(i18n("be asked which resource to use")); | 612 | destinationGroup->addRadio(i18n("be asked which resource to use")); |
594 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); | 613 | topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); |
595 | 614 | ||
596 | topLayout->setRowStretch(14,1); | 615 | topLayout->setRowStretch(14,1); |
597 | */ | 616 | */ |
598 | } | 617 | } |
599 | 618 | ||
600 | 619 | ||
601 | void KOPrefsDialog::setupTimeTab() | 620 | void KOPrefsDialog::setupTimeTab() |
602 | { | 621 | { |
603 | QFrame *topFrame = addPage(i18n("Time"),0,0); | 622 | QFrame *topFrame = addPage(i18n("Time"),0,0); |
604 | // DesktopIcon("clock",KIcon::SizeMedium)); | 623 | // DesktopIcon("clock",KIcon::SizeMedium)); |
605 | 624 | ||
606 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 625 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
607 | topLayout->setSpacing(spacingHint()); | 626 | topLayout->setSpacing(spacingHint()); |
608 | topLayout->setMargin(marginHint()); | 627 | topLayout->setMargin(marginHint()); |
609 | 628 | ||
610 | QHBox *dummy = new QHBox(topFrame); | 629 | QHBox *dummy = new QHBox(topFrame); |
611 | KPrefsWidTime *dayBegins = | 630 | KPrefsWidTime *dayBegins = |
612 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 631 | addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
613 | dummy); | 632 | dummy); |
614 | //topLayout->addWidget(dayBegins->label(),2,0); | 633 | //topLayout->addWidget(dayBegins->label(),2,0); |
615 | 634 | ||
616 | //topLayout->addWidget(dayBegins->spinBox(),2,1); | 635 | //topLayout->addWidget(dayBegins->spinBox(),2,1); |
617 | topLayout->addMultiCellWidget(dummy,0,0,0,1); | 636 | topLayout->addMultiCellWidget(dummy,0,0,0,1); |
618 | 637 | ||
619 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), | 638 | topLayout->addWidget(new QLabel(i18n("Default appointment time:"), |
620 | topFrame),1,0); | 639 | topFrame),1,0); |
621 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); | 640 | mStartTimeSpin = new QSpinBox(0,23,1,topFrame); |
622 | mStartTimeSpin->setSuffix(":00"); | 641 | mStartTimeSpin->setSuffix(":00"); |
623 | topLayout->addWidget(mStartTimeSpin,1,1); | 642 | topLayout->addWidget(mStartTimeSpin,1,1); |
624 | 643 | ||
625 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), | 644 | topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), |
626 | topFrame),2,0); | 645 | topFrame),2,0); |
627 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); | 646 | mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); |
628 | mDefaultDurationSpin->setSuffix(":00"); | 647 | mDefaultDurationSpin->setSuffix(":00"); |
629 | topLayout->addWidget(mDefaultDurationSpin,2,1); | 648 | topLayout->addWidget(mDefaultDurationSpin,2,1); |
630 | 649 | ||
631 | QStringList alarmList; | 650 | QStringList alarmList; |
632 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") | 651 | alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") |
633 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; | 652 | << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; |
634 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), | 653 | topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), |
635 | 3,0); | 654 | 3,0); |
636 | mAlarmTimeCombo = new QComboBox(topFrame); | 655 | mAlarmTimeCombo = new QComboBox(topFrame); |
637 | mAlarmTimeCombo->insertStringList(alarmList); | 656 | mAlarmTimeCombo->insertStringList(alarmList); |
638 | topLayout->addWidget(mAlarmTimeCombo,3,1); | 657 | topLayout->addWidget(mAlarmTimeCombo,3,1); |
639 | 658 | ||
640 | 659 | ||
641 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, | 660 | QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, |
642 | i18n("Working Hours"), | 661 | i18n("Working Hours"), |
643 | topFrame); | 662 | topFrame); |
644 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); | 663 | topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); |
645 | workingHoursGroup->layout()->setSpacing( 0 ); | 664 | workingHoursGroup->layout()->setSpacing( 0 ); |
646 | workingHoursGroup->layout()->setMargin( 4 ); | 665 | workingHoursGroup->layout()->setMargin( 4 ); |
647 | QHBox *workStartBox = new QHBox(workingHoursGroup); | 666 | QHBox *workStartBox = new QHBox(workingHoursGroup); |
648 | // workStartBox->setMargin( 0 ); | 667 | // workStartBox->setMargin( 0 ); |
649 | addWidTime(i18n("Daily starting hour:"), | 668 | addWidTime(i18n("Daily starting hour:"), |
650 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); | 669 | &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); |
651 | 670 | ||
652 | QHBox *workEndBox = new QHBox(workingHoursGroup); | 671 | QHBox *workEndBox = new QHBox(workingHoursGroup); |
653 | //workEndBox->setMargin( 0 ); | 672 | //workEndBox->setMargin( 0 ); |
654 | addWidTime(i18n("Daily ending hour:"), | 673 | addWidTime(i18n("Daily ending hour:"), |
655 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); | 674 | &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); |
656 | QVBox *excludeBox = new QVBox(workingHoursGroup); | 675 | QVBox *excludeBox = new QVBox(workingHoursGroup); |
657 | //excludeBox->setMargin( 0 ); | 676 | //excludeBox->setMargin( 0 ); |
658 | addWidBool(i18n("Exclude holidays"), | 677 | addWidBool(i18n("Exclude holidays"), |
659 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); | 678 | &(KOPrefs::instance()->mExcludeHolidays),excludeBox); |
660 | 679 | ||
661 | addWidBool(i18n("Exclude Saturdays"), | 680 | addWidBool(i18n("Exclude Saturdays"), |
662 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); | 681 | &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); |
663 | 682 | ||
664 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), | 683 | // KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), |
665 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), | 684 | // &(KOPrefs::instance()->mMarcusBainsShowSeconds), |
666 | // topFrame); | 685 | // topFrame); |
667 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); | 686 | // topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); |
668 | 687 | ||
669 | // topLayout->setRowStretch(6,1); | 688 | // topLayout->setRowStretch(6,1); |
670 | } | 689 | } |
671 | 690 | ||
672 | 691 | ||
673 | void KOPrefsDialog::setupViewsTab() | 692 | void KOPrefsDialog::setupViewsTab() |
674 | { | 693 | { |
675 | 694 | ||
676 | QFrame *topFrame = addPage(i18n("Views"),0,0); | 695 | QFrame *topFrame = addPage(i18n("Views"),0,0); |
677 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 696 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
678 | 697 | ||
679 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); | 698 | QGridLayout *topLayout = new QGridLayout(topFrame,6,1); |
680 | topLayout->setSpacing(spacingHint()); | 699 | topLayout->setSpacing(spacingHint()); |
681 | topLayout->setMargin(marginHint()); | 700 | topLayout->setMargin(marginHint()); |
682 | 701 | ||
683 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; | 702 | // QBoxLayout *dayBeginsLayout = new QHBoxLayout; |
684 | // topLayout->addLayout(dayBeginsLayout,0,0); | 703 | // topLayout->addLayout(dayBeginsLayout,0,0); |
685 | 704 | ||
686 | // KPrefsWidTime *dayBegins = | 705 | // KPrefsWidTime *dayBegins = |
687 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), | 706 | // addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), |
688 | // topFrame); | 707 | // topFrame); |
689 | // dayBeginsLayout->addWidget(dayBegins->label()); | 708 | // dayBeginsLayout->addWidget(dayBegins->label()); |
690 | // dayBeginsLayout->addStretch(1); | 709 | // dayBeginsLayout->addStretch(1); |
691 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); | 710 | // dayBeginsLayout->addWidget(dayBegins->spinBox()); |
692 | 711 | ||
693 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; | 712 | // QBoxLayout *nextDaysLayout = new QHBoxLayout; |
694 | // topLayout->addLayout(nextDaysLayout,1,0); | 713 | // topLayout->addLayout(nextDaysLayout,1,0); |
695 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); | 714 | // nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); |
696 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); | 715 | // mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); |
697 | // nextDaysLayout->addStretch(1); | 716 | // nextDaysLayout->addStretch(1); |
698 | // nextDaysLayout->addWidget(mNextXDaysSpin); | 717 | // nextDaysLayout->addWidget(mNextXDaysSpin); |
699 | 718 | ||
700 | 719 | ||
701 | int ii = 0; | 720 | int ii = 0; |
702 | KPrefsDialogWidBool *dummy = | 721 | KPrefsDialogWidBool *dummy = |
703 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), | 722 | addWidBool(i18n("Edit item on doubleclick (if not, show)"), |
704 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); | 723 | &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); |
705 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 724 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
706 | 725 | ||
707 | dummy = | 726 | dummy = |
708 | addWidBool(i18n("Highlight current day in agenda"), | 727 | addWidBool(i18n("Highlight current day in agenda"), |
709 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); | 728 | &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); |
710 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 729 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
711 | 730 | ||
712 | dummy = | 731 | dummy = |
713 | addWidBool(i18n("Use light color for highlight current day"), | 732 | addWidBool(i18n("Use light color for highlight current day"), |
714 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); | 733 | &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); |
715 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 734 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
716 | 735 | ||
717 | KPrefsDialogWidBool *dailyRecur = | 736 | KPrefsDialogWidBool *dailyRecur = |
718 | addWidBool(i18n("Show events that recur daily in date nav."), | 737 | addWidBool(i18n("Show events that recur daily in date nav."), |
719 | &(KOPrefs::instance()->mDailyRecur),topFrame); | 738 | &(KOPrefs::instance()->mDailyRecur),topFrame); |
720 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 739 | topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
721 | 740 | ||
722 | KPrefsDialogWidBool *weeklyRecur = | 741 | KPrefsDialogWidBool *weeklyRecur = |
723 | addWidBool(i18n("Show ev. that recur weekly in date nav."), | 742 | addWidBool(i18n("Show ev. that recur weekly in date nav."), |
724 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); | 743 | &(KOPrefs::instance()->mWeeklyRecur),topFrame); |
725 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); | 744 | topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); |
726 | if ( QApplication::desktop()->width() > 640 ) { | 745 | if ( QApplication::desktop()->width() > 640 ) { |
727 | 746 | ||
728 | KPrefsDialogWidBool *enableToolTips = | 747 | KPrefsDialogWidBool *enableToolTips = |
729 | addWidBool(i18n("Enable tooltips displaying summary of ev."), | 748 | addWidBool(i18n("Enable tooltips displaying summary of ev."), |
730 | &(KOPrefs::instance()->mEnableToolTips),topFrame); | 749 | &(KOPrefs::instance()->mEnableToolTips),topFrame); |
731 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); | 750 | topLayout->addWidget(enableToolTips->checkBox(),ii++,0); |
732 | 751 | ||
733 | } | 752 | } |
734 | KPrefsDialogWidBool *passwdk = | 753 | KPrefsDialogWidBool *passwdk = |
735 | addWidBool(i18n("Show parent To-Do's in What's Next view"), | 754 | addWidBool(i18n("Show parent To-Do's in What's Next view"), |
736 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); | 755 | &(KOPrefs::instance()->mWNViewShowsParents),topFrame); |
737 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 756 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
738 | 757 | ||
739 | passwdk = | 758 | passwdk = |
740 | addWidBool(i18n("Show location in What's Next view"), | 759 | addWidBool(i18n("Show location in What's Next view"), |
741 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); | 760 | &(KOPrefs::instance()->mWNViewShowLocation),topFrame); |
742 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 761 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
743 | 762 | ||
744 | passwdk = | 763 | passwdk = |
745 | addWidBool(i18n("Show Sync Events in WN/Agenda view"), | 764 | addWidBool(i18n("Show Sync Events in WN/Agenda view"), |
746 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); | 765 | &(KOPrefs::instance()->mShowSyncEvents),topFrame); |
747 | topLayout->addWidget(passwdk->checkBox(), ii++,0); | 766 | topLayout->addWidget(passwdk->checkBox(), ii++,0); |
748 | 767 | ||
749 | 768 | ||
750 | KPrefsDialogWidBool *marcusBainsEnabled = | 769 | KPrefsDialogWidBool *marcusBainsEnabled = |
751 | addWidBool(i18n("Show Marcus Bains line"), | 770 | addWidBool(i18n("Show Marcus Bains line"), |
752 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); | 771 | &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); |
753 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); | 772 | topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); |
754 | 773 | ||
755 | 774 | ||
756 | // topLayout->addWidget(hourSizeGroup,ii++,0); | 775 | // topLayout->addWidget(hourSizeGroup,ii++,0); |
757 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); | 776 | // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); |
758 | //topLayout->setRowStretch(11,1); | 777 | //topLayout->setRowStretch(11,1); |
759 | 778 | ||
760 | 779 | ||
761 | 780 | ||
762 | 781 | ||
763 | 782 | ||
764 | 783 | ||
765 | topFrame = addPage(i18n("ViewChange"),0,0); | 784 | topFrame = addPage(i18n("ViewChange"),0,0); |
766 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 785 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
767 | 786 | ||
768 | topLayout = new QGridLayout(topFrame,6,1); | 787 | topLayout = new QGridLayout(topFrame,6,1); |
769 | topLayout->setSpacing(spacingHint()); | 788 | topLayout->setSpacing(spacingHint()); |
770 | topLayout->setMargin(marginHint()); | 789 | topLayout->setMargin(marginHint()); |
771 | ii = 0; | 790 | ii = 0; |
772 | 791 | ||
773 | 792 | ||
774 | dummy = | 793 | dummy = |
775 | addWidBool(i18n("Hold fullscreen on view change"), | 794 | addWidBool(i18n("Hold fullscreen on view change"), |
776 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); | 795 | &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); |
777 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 796 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
778 | 797 | ||
779 | dummy = | 798 | dummy = |
780 | addWidBool(i18n("Hold non-fullscreen on view change"), | 799 | addWidBool(i18n("Hold non-fullscreen on view change"), |
781 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); | 800 | &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); |
782 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 801 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
783 | 802 | ||
784 | 803 | ||
785 | KPrefsDialogWidBool *fullViewTodo = | 804 | KPrefsDialogWidBool *fullViewTodo = |
786 | addWidBool(i18n("Event list view uses full window"), | 805 | addWidBool(i18n("Event list view uses full window"), |
787 | &(KOPrefs::instance()->mFullViewTodo),topFrame); | 806 | &(KOPrefs::instance()->mFullViewTodo),topFrame); |
788 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); | 807 | topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); |
789 | 808 | ||
790 | KPrefsDialogWidBool *fullViewMonth = | 809 | KPrefsDialogWidBool *fullViewMonth = |
791 | addWidBool(i18n("Next days view uses full window"), | 810 | addWidBool(i18n("Next days view uses full window"), |
792 | &(KOPrefs::instance()->mFullViewMonth),topFrame); | 811 | &(KOPrefs::instance()->mFullViewMonth),topFrame); |
793 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); | 812 | topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); |
794 | 813 | ||
795 | dummy = | 814 | dummy = |
796 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), | 815 | addWidBool(i18n("Set agenda to DayBeginsAt on change"), |
797 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); | 816 | &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); |
798 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 817 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
799 | 818 | ||
800 | dummy = | 819 | dummy = |
801 | addWidBool(i18n("Set agenda to current time on change"), | 820 | addWidBool(i18n("Set agenda to current time on change"), |
802 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); | 821 | &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); |
803 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 822 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
804 | 823 | ||
805 | dummy = | 824 | dummy = |
806 | addWidBool(i18n("Listview uses monthly timespan"), | 825 | addWidBool(i18n("Listview uses monthly timespan"), |
807 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); | 826 | &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); |
808 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 827 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
809 | dummy = | 828 | dummy = |
810 | addWidBool(i18n("Highlight selection in Time Edit"), | 829 | addWidBool(i18n("Highlight selection in Time Edit"), |
811 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); | 830 | &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); |
812 | topLayout->addWidget( dummy->checkBox(), ii++,0); | 831 | topLayout->addWidget( dummy->checkBox(), ii++,0); |
813 | 832 | ||
814 | 833 | ||
815 | 834 | ||
816 | 835 | ||
817 | 836 | ||
818 | topFrame = addPage(i18n("Month View"),0,0); | 837 | topFrame = addPage(i18n("Month View"),0,0); |
819 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 838 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
820 | 839 | ||
821 | topLayout = new QGridLayout(topFrame,5,1); | 840 | topLayout = new QGridLayout(topFrame,5,1); |
822 | topLayout->setSpacing(spacingHint()); | 841 | topLayout->setSpacing(spacingHint()); |
823 | topLayout->setMargin(marginHint()); | 842 | topLayout->setMargin(marginHint()); |
824 | ii = 0; | 843 | ii = 0; |
825 | QLabel *lab; | 844 | QLabel *lab; |
826 | QHBox *habo = new QHBox( topFrame ); | 845 | QHBox *habo = new QHBox( topFrame ); |
827 | if ( QApplication::desktop()->width() < 320 ) { | 846 | if ( QApplication::desktop()->width() < 320 ) { |
828 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); | 847 | lab = new QLabel ( i18n("Show events that recur "), topFrame ); |
829 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 848 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
830 | ii++; | 849 | ii++; |
831 | 850 | ||
832 | } else { | 851 | } else { |
833 | new QLabel ( i18n("Show events that recur "), habo ); | 852 | new QLabel ( i18n("Show events that recur "), habo ); |
834 | 853 | ||
835 | } | 854 | } |
836 | dailyRecur = | 855 | dailyRecur = |
837 | addWidBool(i18n("daily"), | 856 | addWidBool(i18n("daily"), |
838 | &(KOPrefs::instance()->mMonthDailyRecur),habo); | 857 | &(KOPrefs::instance()->mMonthDailyRecur),habo); |
839 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); | 858 | // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); |
840 | 859 | ||
841 | weeklyRecur = | 860 | weeklyRecur = |
842 | addWidBool(i18n("weekly"), | 861 | addWidBool(i18n("weekly"), |
843 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); | 862 | &(KOPrefs::instance()->mMonthWeeklyRecur),habo); |
844 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 863 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
845 | ii++; | 864 | ii++; |
846 | 865 | ||
847 | 866 | ||
848 | habo = new QHBox( topFrame ); | 867 | habo = new QHBox( topFrame ); |
849 | if ( QApplication::desktop()->width() < 320 ) { | 868 | if ( QApplication::desktop()->width() < 320 ) { |
850 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); | 869 | lab = new QLabel (i18n("Show in every cell ") , topFrame ); |
851 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); | 870 | topLayout->addMultiCellWidget(lab,ii, ii,0,1); |
852 | ii++; | 871 | ii++; |
853 | 872 | ||
854 | } else { | 873 | } else { |
855 | new QLabel ( i18n("Show in every cell "), habo ); | 874 | new QLabel ( i18n("Show in every cell "), habo ); |
856 | } | 875 | } |
857 | weeklyRecur = | 876 | weeklyRecur = |
858 | addWidBool(i18n("short month"), | 877 | addWidBool(i18n("short month"), |
859 | &(KOPrefs::instance()->mMonthShowShort),habo); | 878 | &(KOPrefs::instance()->mMonthShowShort),habo); |
860 | weeklyRecur = | 879 | weeklyRecur = |
861 | addWidBool(i18n("icons"), | 880 | addWidBool(i18n("icons"), |
862 | &(KOPrefs::instance()->mMonthShowIcons),habo); | 881 | &(KOPrefs::instance()->mMonthShowIcons),habo); |
863 | 882 | ||
864 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); | 883 | topLayout->addMultiCellWidget(habo,ii, ii,0,1); |
865 | ii++; | 884 | ii++; |
866 | #ifdef DESKTOP_VERSION | 885 | #ifdef DESKTOP_VERSION |
867 | KPrefsDialogWidBool *enableMonthScroll = | 886 | KPrefsDialogWidBool *enableMonthScroll = |
868 | addWidBool(i18n("Enable scrollbars in month view cells"), | 887 | addWidBool(i18n("Enable scrollbars in month view cells"), |
869 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); | 888 | &(KOPrefs::instance()->mEnableMonthScroll),topFrame); |
870 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); | 889 | topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); |
871 | #endif | 890 | #endif |
872 | 891 | ||
873 | dummy = | 892 | dummy = |
874 | addWidBool(i18n("Show Sat/Sun together"), | 893 | addWidBool(i18n("Show Sat/Sun together"), |
875 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); | 894 | &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); |
876 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 895 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
877 | 896 | ||
878 | KPrefsDialogWidBool *coloredCategoriesInMonthView = | 897 | KPrefsDialogWidBool *coloredCategoriesInMonthView = |
879 | addWidBool(i18n("Month view uses category colors"), | 898 | addWidBool(i18n("Month view uses category colors"), |
880 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); | 899 | &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); |
881 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 900 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
882 | 901 | ||
883 | dummy = | 902 | dummy = |
884 | addWidBool(i18n("Categorie colors are applied to text"), | 903 | addWidBool(i18n("Categorie colors are applied to text"), |
885 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); | 904 | &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); |
886 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 905 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
887 | coloredCategoriesInMonthView = | 906 | coloredCategoriesInMonthView = |
888 | addWidBool(i18n("Month view uses day colors"), | 907 | addWidBool(i18n("Month view uses day colors"), |
889 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); | 908 | &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); |
890 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); | 909 | topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); |
891 | 910 | ||
892 | KPrefsWidColor *holidayColor = | 911 | KPrefsWidColor *holidayColor = |
893 | addWidColor(i18n("Day color odd months"), | 912 | addWidColor(i18n("Day color odd months"), |
894 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); | 913 | &(KOPrefs::instance()->mMonthViewOddColor),topFrame); |
895 | topLayout->addWidget(holidayColor->label(),ii,0); | 914 | topLayout->addWidget(holidayColor->label(),ii,0); |
896 | topLayout->addWidget(holidayColor->button(),ii++,1); | 915 | topLayout->addWidget(holidayColor->button(),ii++,1); |
897 | 916 | ||
898 | holidayColor = | 917 | holidayColor = |
899 | addWidColor(i18n("Day color even months"), | 918 | addWidColor(i18n("Day color even months"), |
900 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); | 919 | &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); |
901 | topLayout->addWidget(holidayColor->label(),ii,0); | 920 | topLayout->addWidget(holidayColor->label(),ii,0); |
902 | topLayout->addWidget(holidayColor->button(),ii++,1); | 921 | topLayout->addWidget(holidayColor->button(),ii++,1); |
903 | 922 | ||
904 | 923 | ||
905 | holidayColor = | 924 | holidayColor = |
906 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), | 925 | addWidColor(i18n("Color for Sundays + category \"Holiday\""), |
907 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); | 926 | &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); |
908 | topLayout->addWidget(holidayColor->label(),ii,0); | 927 | topLayout->addWidget(holidayColor->label(),ii,0); |
909 | topLayout->addWidget(holidayColor->button(),ii++,1); | 928 | topLayout->addWidget(holidayColor->button(),ii++,1); |
910 | 929 | ||
911 | // *********************** Todo View | 930 | // *********************** Todo View |
912 | 931 | ||
913 | topFrame = addPage(i18n("Todo View"),0,0); | 932 | topFrame = addPage(i18n("Todo View"),0,0); |
914 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 933 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
915 | 934 | ||
916 | topLayout = new QGridLayout(topFrame,4,1); | 935 | topLayout = new QGridLayout(topFrame,4,1); |
917 | topLayout->setSpacing(spacingHint()); | 936 | topLayout->setSpacing(spacingHint()); |
918 | topLayout->setMargin(marginHint()); | 937 | topLayout->setMargin(marginHint()); |
919 | ii = 0; | 938 | ii = 0; |
920 | 939 | ||
921 | KPrefsDialogWidBool *showCompletedTodo = | 940 | KPrefsDialogWidBool *showCompletedTodo = |
922 | addWidBool(i18n("To-do view shows completed Todos"), | 941 | addWidBool(i18n("To-do view shows completed Todos"), |
923 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); | 942 | &(KOPrefs::instance()->mShowCompletedTodo),topFrame); |
924 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); | 943 | topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); |
925 | dummy = | 944 | dummy = |
926 | addWidBool(i18n("To-do view shows complete as 'xx %'"), | 945 | addWidBool(i18n("To-do view shows complete as 'xx %'"), |
927 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); | 946 | &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); |
928 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 947 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
929 | 948 | ||
930 | dummy = | 949 | dummy = |
931 | addWidBool(i18n("Small To-do view uses smaller font"), | 950 | addWidBool(i18n("Small To-do view uses smaller font"), |
932 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); | 951 | &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); |
933 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 952 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
934 | 953 | ||
935 | 954 | ||
936 | 955 | ||
937 | dummy = | 956 | dummy = |
938 | addWidBool(i18n("Todo view uses category colors"), | 957 | addWidBool(i18n("Todo view uses category colors"), |
939 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); | 958 | &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); |
940 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 959 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
941 | 960 | ||
942 | 961 | ||
943 | QWidget* wid = new QWidget( topFrame ); | 962 | QWidget* wid = new QWidget( topFrame ); |
944 | // Todo due today color | 963 | // Todo due today color |
945 | KPrefsWidColor *todoDueTodayColor = | 964 | KPrefsWidColor *todoDueTodayColor = |
946 | addWidColor(i18n("Todo due today color:"), | 965 | addWidColor(i18n("Todo due today color:"), |
947 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); | 966 | &(KOPrefs::instance()->mTodoDueTodayColor),wid); |
948 | QHBoxLayout *widLayout = new QHBoxLayout(wid); | 967 | QHBoxLayout *widLayout = new QHBoxLayout(wid); |
949 | widLayout->addWidget( todoDueTodayColor->label() ); | 968 | widLayout->addWidget( todoDueTodayColor->label() ); |
950 | widLayout->addWidget( todoDueTodayColor->button() ); | 969 | widLayout->addWidget( todoDueTodayColor->button() ); |
951 | topLayout->addWidget(wid,ii++,0); | 970 | topLayout->addWidget(wid,ii++,0); |
952 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); | 971 | //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); |
953 | 972 | ||
954 | // Todo overdue color | 973 | // Todo overdue color |
955 | wid = new QWidget( topFrame ); | 974 | wid = new QWidget( topFrame ); |
956 | widLayout = new QHBoxLayout(wid); | 975 | widLayout = new QHBoxLayout(wid); |
957 | KPrefsWidColor *todoOverdueColor = | 976 | KPrefsWidColor *todoOverdueColor = |
958 | addWidColor(i18n("Todo overdue color:"), | 977 | addWidColor(i18n("Todo overdue color:"), |
959 | &(KOPrefs::instance()->mTodoOverdueColor),wid); | 978 | &(KOPrefs::instance()->mTodoOverdueColor),wid); |
960 | widLayout->addWidget(todoOverdueColor->label()); | 979 | widLayout->addWidget(todoOverdueColor->label()); |
961 | widLayout->addWidget(todoOverdueColor->button()); | 980 | widLayout->addWidget(todoOverdueColor->button()); |
962 | topLayout->addWidget(wid,ii++,0); | 981 | topLayout->addWidget(wid,ii++,0); |
963 | 982 | ||
964 | dummy = | 983 | dummy = |
965 | addWidBool(i18n("Colors are applied to text"), | 984 | addWidBool(i18n("Colors are applied to text"), |
966 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); | 985 | &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); |
967 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 986 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
968 | 987 | ||
969 | dummy = | 988 | dummy = |
970 | addWidBool(i18n("Allday Agenda view shows todos"), | 989 | addWidBool(i18n("Allday Agenda view shows todos"), |
971 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); | 990 | &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); |
972 | topLayout->addWidget(dummy->checkBox(),ii++,0); | 991 | topLayout->addWidget(dummy->checkBox(),ii++,0); |
973 | 992 | ||
974 | 993 | ||
975 | 994 | ||
976 | 995 | ||
977 | topFrame = addPage(i18n("Alarm"),0,0); | 996 | topFrame = addPage(i18n("Alarm"),0,0); |
978 | // DesktopIcon("viewmag",KIcon::SizeMedium)); | 997 | // DesktopIcon("viewmag",KIcon::SizeMedium)); |
979 | 998 | ||
980 | topLayout = new QGridLayout(topFrame,2,1); | 999 | topLayout = new QGridLayout(topFrame,2,1); |
981 | topLayout->setSpacing(spacingHint()); | 1000 | topLayout->setSpacing(spacingHint()); |
982 | topLayout->setMargin(marginHint()); | 1001 | topLayout->setMargin(marginHint()); |
983 | int iii = 0; | 1002 | int iii = 0; |
984 | 1003 | ||
985 | dummy = | 1004 | dummy = |
986 | addWidBool(i18n("Use internal alarm notification"), | 1005 | addWidBool(i18n("Use internal alarm notification"), |
987 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); | 1006 | &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); |
988 | topLayout->addWidget(dummy->checkBox(),iii++,0); | 1007 | topLayout->addWidget(dummy->checkBox(),iii++,0); |
989 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); | 1008 | lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); |
990 | 1009 | ||
991 | topLayout->addWidget(lab ,iii++,0); | 1010 | topLayout->addWidget(lab ,iii++,0); |
992 | #ifndef DESKTOP_VERSION | 1011 | #ifndef DESKTOP_VERSION |
993 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 1012 | lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
994 | #else | 1013 | #else |
995 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 1014 | lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
996 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 1015 | lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
997 | #endif | 1016 | #endif |
998 | 1017 | ||
999 | QHBox* dummyBox = new QHBox(topFrame); | 1018 | QHBox* dummyBox = new QHBox(topFrame); |
1000 | new QLabel(i18n("Play beeps count:"),dummyBox); | 1019 | new QLabel(i18n("Play beeps count:"),dummyBox); |
1001 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); | 1020 | mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); |
1002 | topLayout->addWidget(dummyBox,iii++,0); | 1021 | topLayout->addWidget(dummyBox,iii++,0); |
1003 | 1022 | ||
1004 | dummyBox = new QHBox(topFrame); | 1023 | dummyBox = new QHBox(topFrame); |
1005 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); | 1024 | new QLabel(i18n("Beeps interval in sec:"),dummyBox); |
1006 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); | 1025 | mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); |
1007 | topLayout->addWidget(dummyBox,iii++,0); | 1026 | topLayout->addWidget(dummyBox,iii++,0); |
1008 | 1027 | ||
1009 | dummyBox = new QHBox(topFrame); | 1028 | dummyBox = new QHBox(topFrame); |
1010 | new QLabel(i18n("Default suspend time in min:"),dummyBox); | 1029 | new QLabel(i18n("Default suspend time in min:"),dummyBox); |
1011 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); | 1030 | mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); |
1012 | topLayout->addWidget(dummyBox,iii++,0); | 1031 | topLayout->addWidget(dummyBox,iii++,0); |
1013 | 1032 | ||
1014 | dummyBox = new QHBox(topFrame); | 1033 | dummyBox = new QHBox(topFrame); |
1015 | new QLabel(i18n("Auto suspend count:"),dummyBox); | 1034 | new QLabel(i18n("Auto suspend count:"),dummyBox); |
1016 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); | 1035 | mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); |
1017 | topLayout->addWidget(dummyBox,iii++,0); | 1036 | topLayout->addWidget(dummyBox,iii++,0); |
1018 | 1037 | ||
1019 | 1038 | ||
1020 | 1039 | ||
1021 | 1040 | ||
1022 | 1041 | ||
1023 | 1042 | ||
1024 | 1043 | ||
1025 | QHBox* hbo = new QHBox ( topFrame ); | 1044 | QHBox* hbo = new QHBox ( topFrame ); |
1026 | mDefaultAlarmFile = new QLineEdit(hbo); | 1045 | mDefaultAlarmFile = new QLineEdit(hbo); |
1027 | QPushButton * loadTemplate = new QPushButton(hbo); | 1046 | QPushButton * loadTemplate = new QPushButton(hbo); |
1028 | QPixmap icon; | 1047 | QPixmap icon; |
1029 | if ( QApplication::desktop()->width() < 321 ) | 1048 | if ( QApplication::desktop()->width() < 321 ) |
1030 | icon = SmallIcon("fileimport16"); | 1049 | icon = SmallIcon("fileimport16"); |
1031 | else | 1050 | else |
1032 | icon = SmallIcon("fileimport"); | 1051 | icon = SmallIcon("fileimport"); |
1033 | loadTemplate->setIconSet (icon ) ; | 1052 | loadTemplate->setIconSet (icon ) ; |
1034 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); | 1053 | connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); |
1035 | int size = loadTemplate->sizeHint().height(); | 1054 | int size = loadTemplate->sizeHint().height(); |
1036 | loadTemplate->setFixedSize( size, size ); | 1055 | loadTemplate->setFixedSize( size, size ); |
1037 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); | 1056 | //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); |
1038 | // topLayout->addWidget(lab ,iii++,0); | 1057 | // topLayout->addWidget(lab ,iii++,0); |
1039 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); | 1058 | lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); |
1040 | topLayout->addWidget(lab ,iii++,0); | 1059 | topLayout->addWidget(lab ,iii++,0); |
1041 | topLayout->addWidget(hbo,iii++,0); | 1060 | topLayout->addWidget(hbo,iii++,0); |
1042 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); | 1061 | // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); |
1043 | 1062 | ||
1044 | // topLayout->addWidget(lab ,iii++,0); | 1063 | // topLayout->addWidget(lab ,iii++,0); |
1045 | // #ifndef DESKTOP_VERSION | 1064 | // #ifndef DESKTOP_VERSION |
1046 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); | 1065 | // lab->setAlignment( AlignLeft|WordBreak|AlignTop); |
1047 | // #else | 1066 | // #else |
1048 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); | 1067 | // lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); |
1049 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); | 1068 | // lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); |
1050 | // #endif | 1069 | // #endif |
1051 | 1070 | ||
1052 | 1071 | ||
1053 | } | 1072 | } |
1054 | 1073 | ||
1055 | void KOPrefsDialog::selectSoundFile() | 1074 | void KOPrefsDialog::selectSoundFile() |
1056 | { | 1075 | { |
1057 | QString fileName = mDefaultAlarmFile->text(); | 1076 | QString fileName = mDefaultAlarmFile->text(); |
1058 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); | 1077 | fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); |
1059 | if ( fileName.length() > 0 ) | 1078 | if ( fileName.length() > 0 ) |
1060 | mDefaultAlarmFile->setText( fileName ); | 1079 | mDefaultAlarmFile->setText( fileName ); |
1061 | } | 1080 | } |
1062 | void KOPrefsDialog::setupFontsTab() | 1081 | void KOPrefsDialog::setupFontsTab() |
1063 | { | 1082 | { |
1064 | 1083 | ||
1065 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); | 1084 | QFrame *topFrame = addPage(i18n("Fonts"),0,0); |
1066 | // DesktopIcon("fonts",KIcon::SizeMedium)); | 1085 | // DesktopIcon("fonts",KIcon::SizeMedium)); |
1067 | 1086 | ||
1068 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); | 1087 | QGridLayout *topLayout = new QGridLayout(topFrame,7,3); |
1069 | topLayout->setSpacing(1); | 1088 | topLayout->setSpacing(1); |
1070 | topLayout->setMargin(3); | 1089 | topLayout->setMargin(3); |
1071 | KPrefsDialogWidFont * tVFont; | 1090 | KPrefsDialogWidFont * tVFont; |
1072 | int i = 0; | 1091 | int i = 0; |
1073 | KPrefsDialogWidFont *timeLabelsFont = | 1092 | KPrefsDialogWidFont *timeLabelsFont = |
1074 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), | 1093 | addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), |
1075 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); | 1094 | &(KOPrefs::instance()->mDateNavigatorFont),topFrame); |
1076 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 1095 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
1077 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 1096 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
1078 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 1097 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
1079 | ++i; | 1098 | ++i; |
1080 | 1099 | ||
1081 | 1100 | ||
1082 | timeLabelsFont = | 1101 | timeLabelsFont = |
1083 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), | 1102 | addWidFont(i18n("Mon 15"),i18n("Date Labels:"), |
1084 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); | 1103 | &(KOPrefs::instance()->mTimeLabelsFont),topFrame); |
1085 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 1104 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
1086 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 1105 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
1087 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 1106 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
1088 | ++i; | 1107 | ++i; |
1089 | 1108 | ||
1090 | KPrefsDialogWidFont *timeBarFont = | 1109 | KPrefsDialogWidFont *timeBarFont = |
1091 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), | 1110 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), |
1092 | &(KOPrefs::instance()->mTimeBarFont),topFrame); | 1111 | &(KOPrefs::instance()->mTimeBarFont),topFrame); |
1093 | topLayout->addWidget(timeBarFont->label(),i,0); | 1112 | topLayout->addWidget(timeBarFont->label(),i,0); |
1094 | topLayout->addWidget(timeBarFont->preview(),i,1); | 1113 | topLayout->addWidget(timeBarFont->preview(),i,1); |
1095 | topLayout->addWidget(timeBarFont->button(),i,2); | 1114 | topLayout->addWidget(timeBarFont->button(),i,2); |
1096 | ++i; | 1115 | ++i; |
1097 | 1116 | ||
1098 | 1117 | ||
1099 | KPrefsDialogWidFont *marcusBainsFont = | 1118 | KPrefsDialogWidFont *marcusBainsFont = |
1100 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), | 1119 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), |
1101 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); | 1120 | &(KOPrefs::instance()->mMarcusBainsFont),topFrame); |
1102 | topLayout->addWidget(marcusBainsFont->label(),i,0); | 1121 | topLayout->addWidget(marcusBainsFont->label(),i,0); |
1103 | topLayout->addWidget(marcusBainsFont->preview(),i,1); | 1122 | topLayout->addWidget(marcusBainsFont->preview(),i,1); |
1104 | topLayout->addWidget(marcusBainsFont->button(),i,2); | 1123 | topLayout->addWidget(marcusBainsFont->button(),i,2); |
1105 | ++i; | 1124 | ++i; |
1106 | 1125 | ||
1107 | tVFont = | 1126 | tVFont = |
1108 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), | 1127 | addWidFont(i18n("Summary"),i18n("Event Viewer:"), |
1109 | &(KOPrefs::instance()->mEventViewFont),topFrame); | 1128 | &(KOPrefs::instance()->mEventViewFont),topFrame); |
1110 | topLayout->addWidget(tVFont->label(),i,0); | 1129 | topLayout->addWidget(tVFont->label(),i,0); |
1111 | topLayout->addWidget(tVFont->preview(),i,1); | 1130 | topLayout->addWidget(tVFont->preview(),i,1); |
1112 | topLayout->addWidget(tVFont->button(),i,2); | 1131 | topLayout->addWidget(tVFont->button(),i,2); |
1113 | ++i; | 1132 | ++i; |
1114 | 1133 | ||
1115 | 1134 | ||
1116 | 1135 | ||
1117 | tVFont = | 1136 | tVFont = |
1118 | addWidFont(i18n("Details"),i18n("EditorBox:"), | 1137 | addWidFont(i18n("Details"),i18n("EditorBox:"), |
1119 | &(KOPrefs::instance()->mEditBoxFont),topFrame); | 1138 | &(KOPrefs::instance()->mEditBoxFont),topFrame); |
1120 | topLayout->addWidget(tVFont->label(),i,0); | 1139 | topLayout->addWidget(tVFont->label(),i,0); |
1121 | topLayout->addWidget(tVFont->preview(),i,1); | 1140 | topLayout->addWidget(tVFont->preview(),i,1); |
1122 | topLayout->addWidget(tVFont->button(),i,2); | 1141 | topLayout->addWidget(tVFont->button(),i,2); |
1123 | ++i; | 1142 | ++i; |
1124 | 1143 | ||
1125 | 1144 | ||
1126 | 1145 | ||
1127 | topLayout->setColStretch(1,1); | 1146 | topLayout->setColStretch(1,1); |
1128 | topLayout->setRowStretch(4,1); | 1147 | topLayout->setRowStretch(4,1); |
1129 | 1148 | ||
1130 | 1149 | ||
1131 | i = 0; | 1150 | i = 0; |
1132 | topFrame = addPage(i18n("View Fonts"),0, | 1151 | topFrame = addPage(i18n("View Fonts"),0, |
1133 | DesktopIcon("fonts",KIcon::SizeMedium)); | 1152 | DesktopIcon("fonts",KIcon::SizeMedium)); |
1134 | 1153 | ||
1135 | topLayout = new QGridLayout(topFrame,7,3); | 1154 | topLayout = new QGridLayout(topFrame,7,3); |
1136 | topLayout->setSpacing(1); | 1155 | topLayout->setSpacing(1); |
1137 | topLayout->setMargin(3); | 1156 | topLayout->setMargin(3); |
1138 | 1157 | ||
1139 | tVFont = | 1158 | tVFont = |
1140 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), | 1159 | addWidFont(i18n("Configure KO"),i18n("What's Next View:"), |
1141 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); | 1160 | &(KOPrefs::instance()->mWhatsNextFont),topFrame); |
1142 | topLayout->addWidget(tVFont->label(),i,0); | 1161 | topLayout->addWidget(tVFont->label(),i,0); |
1143 | topLayout->addWidget(tVFont->preview(),i,1); | 1162 | topLayout->addWidget(tVFont->preview(),i,1); |
1144 | topLayout->addWidget(tVFont->button(),i,2); | 1163 | topLayout->addWidget(tVFont->button(),i,2); |
1145 | ++i; | 1164 | ++i; |
1146 | KPrefsDialogWidFont *agendaViewFont = | 1165 | KPrefsDialogWidFont *agendaViewFont = |
1147 | addWidFont(i18n("Event text"),i18n("Agenda view:"), | 1166 | addWidFont(i18n("Event text"),i18n("Agenda view:"), |
1148 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); | 1167 | &(KOPrefs::instance()->mAgendaViewFont),topFrame); |
1149 | topLayout->addWidget(agendaViewFont->label(),i,0); | 1168 | topLayout->addWidget(agendaViewFont->label(),i,0); |
1150 | topLayout->addWidget(agendaViewFont->preview(),i,1); | 1169 | topLayout->addWidget(agendaViewFont->preview(),i,1); |
1151 | topLayout->addWidget(agendaViewFont->button(),i,2); | 1170 | topLayout->addWidget(agendaViewFont->button(),i,2); |
1152 | ++i; | 1171 | ++i; |
1153 | 1172 | ||
1154 | 1173 | ||
1155 | KPrefsDialogWidFont *monthViewFont = | 1174 | KPrefsDialogWidFont *monthViewFont = |
1156 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), | 1175 | addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), |
1157 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); | 1176 | i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); |
1158 | topLayout->addWidget(monthViewFont->label(),i,0); | 1177 | topLayout->addWidget(monthViewFont->label(),i,0); |
1159 | topLayout->addWidget(monthViewFont->preview(),i,1); | 1178 | topLayout->addWidget(monthViewFont->preview(),i,1); |
1160 | topLayout->addWidget(monthViewFont->button(),i,2); | 1179 | topLayout->addWidget(monthViewFont->button(),i,2); |
1161 | ++i; | 1180 | ++i; |
1162 | 1181 | ||
1163 | 1182 | ||
1164 | KPrefsDialogWidFont *lVFont = | 1183 | KPrefsDialogWidFont *lVFont = |
1165 | addWidFont(i18n("Event"),i18n("List View:"), | 1184 | addWidFont(i18n("Event"),i18n("List View:"), |
1166 | &(KOPrefs::instance()->mListViewFont),topFrame); | 1185 | &(KOPrefs::instance()->mListViewFont),topFrame); |
1167 | topLayout->addWidget(lVFont->label(),i,0); | 1186 | topLayout->addWidget(lVFont->label(),i,0); |
1168 | topLayout->addWidget(lVFont->preview(),i,1); | 1187 | topLayout->addWidget(lVFont->preview(),i,1); |
1169 | topLayout->addWidget(lVFont->button(),i,2); | 1188 | topLayout->addWidget(lVFont->button(),i,2); |
1170 | ++i; | 1189 | ++i; |
1171 | 1190 | ||
1172 | 1191 | ||
1173 | tVFont = | 1192 | tVFont = |
1174 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), | 1193 | addWidFont(i18n("ToDo"),i18n("ToDoView:"), |
1175 | &(KOPrefs::instance()->mTodoViewFont),topFrame); | 1194 | &(KOPrefs::instance()->mTodoViewFont),topFrame); |
1176 | topLayout->addWidget(tVFont->label(),i,0); | 1195 | topLayout->addWidget(tVFont->label(),i,0); |
1177 | topLayout->addWidget(tVFont->preview(),i,1); | 1196 | topLayout->addWidget(tVFont->preview(),i,1); |
1178 | topLayout->addWidget(tVFont->button(),i,2); | 1197 | topLayout->addWidget(tVFont->button(),i,2); |
1179 | ++i; | 1198 | ++i; |
1180 | 1199 | ||
1181 | 1200 | ||
1182 | tVFont = | 1201 | tVFont = |
1183 | addWidFont(i18n("Today"),i18n("JournalView:"), | 1202 | addWidFont(i18n("Today"),i18n("JournalView:"), |
1184 | &(KOPrefs::instance()->mJornalViewFont),topFrame); | 1203 | &(KOPrefs::instance()->mJornalViewFont),topFrame); |
1185 | topLayout->addWidget(tVFont->label(),i,0); | 1204 | topLayout->addWidget(tVFont->label(),i,0); |
1186 | topLayout->addWidget(tVFont->preview(),i,1); | 1205 | topLayout->addWidget(tVFont->preview(),i,1); |
1187 | topLayout->addWidget(tVFont->button(),i,2); | 1206 | topLayout->addWidget(tVFont->button(),i,2); |
1188 | ++i; | 1207 | ++i; |
1189 | 1208 | ||
1190 | 1209 | ||
1191 | 1210 | ||
1192 | 1211 | ||
1193 | topLayout->setColStretch(1,1); | 1212 | topLayout->setColStretch(1,1); |
1194 | topLayout->setRowStretch(4,1); | 1213 | topLayout->setRowStretch(4,1); |
1195 | 1214 | ||
1196 | 1215 | ||
1197 | 1216 | ||
1198 | 1217 | ||
1199 | } | 1218 | } |
1200 | 1219 | ||
1201 | void KOPrefsDialog::setupColorsTab() | 1220 | void KOPrefsDialog::setupColorsTab() |
1202 | { | 1221 | { |
1203 | QFrame *topFrame = addPage(i18n("Colors"),0,0); | 1222 | QFrame *topFrame = addPage(i18n("Colors"),0,0); |
1204 | // DesktopIcon("colorize",KIcon::SizeMedium)); | 1223 | // DesktopIcon("colorize",KIcon::SizeMedium)); |
1205 | 1224 | ||
1206 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 1225 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); |
1207 | // topLayout->setSpacing(spacingHint()); | 1226 | // topLayout->setSpacing(spacingHint()); |
1208 | // topLayout->setMargin(marginHint()); | 1227 | // topLayout->setMargin(marginHint()); |
1209 | 1228 | ||
1210 | topLayout->setSpacing(2); | 1229 | topLayout->setSpacing(2); |
1211 | topLayout->setMargin(3); | 1230 | topLayout->setMargin(3); |
1212 | 1231 | ||
1213 | int ii = 1; | 1232 | int ii = 1; |
1214 | QGroupBox *categoryGroup ; | 1233 | QGroupBox *categoryGroup ; |
1215 | 1234 | ||
1216 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), | 1235 | categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), |
1217 | topFrame); | 1236 | topFrame); |
1218 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); | 1237 | topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); |
1219 | 1238 | ||
1220 | mCategoryCombo = new QComboBox(categoryGroup); | 1239 | mCategoryCombo = new QComboBox(categoryGroup); |
1221 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1240 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1222 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); | 1241 | connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); |
1223 | 1242 | ||
1224 | mCategoryButton = new KColorButton(categoryGroup); | 1243 | mCategoryButton = new KColorButton(categoryGroup); |
1225 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); | 1244 | connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); |
1226 | updateCategoryColor(); | 1245 | updateCategoryColor(); |
1227 | 1246 | ||
1228 | 1247 | ||
1229 | // Holiday Color | 1248 | // Holiday Color |
1230 | 1249 | ||
1231 | KPrefsWidColor *holidayColor = | 1250 | KPrefsWidColor *holidayColor = |
1232 | addWidColor(i18n("Holiday color:"), | 1251 | addWidColor(i18n("Holiday color:"), |
1233 | &(KOPrefs::instance()->mHolidayColor),topFrame); | 1252 | &(KOPrefs::instance()->mHolidayColor),topFrame); |
1234 | topLayout->addWidget(holidayColor->label(),ii,0); | 1253 | topLayout->addWidget(holidayColor->label(),ii,0); |
1235 | topLayout->addWidget(holidayColor->button(),ii++,1); | 1254 | topLayout->addWidget(holidayColor->button(),ii++,1); |
1236 | 1255 | ||
1237 | // Highlight Color | 1256 | // Highlight Color |
1238 | KPrefsWidColor *highlightColor = | 1257 | KPrefsWidColor *highlightColor = |
1239 | addWidColor(i18n("Highlight color:"), | 1258 | addWidColor(i18n("Highlight color:"), |
1240 | &(KOPrefs::instance()->mHighlightColor),topFrame); | 1259 | &(KOPrefs::instance()->mHighlightColor),topFrame); |
1241 | topLayout->addWidget(highlightColor->label(),ii,0); | 1260 | topLayout->addWidget(highlightColor->label(),ii,0); |
1242 | topLayout->addWidget(highlightColor->button(),ii++,1); | 1261 | topLayout->addWidget(highlightColor->button(),ii++,1); |
1243 | 1262 | ||
1244 | // Event color | 1263 | // Event color |
1245 | KPrefsWidColor *eventColor = | 1264 | KPrefsWidColor *eventColor = |
1246 | addWidColor(i18n("Default event color:"), | 1265 | addWidColor(i18n("Default event color:"), |
1247 | &(KOPrefs::instance()->mEventColor),topFrame); | 1266 | &(KOPrefs::instance()->mEventColor),topFrame); |
1248 | topLayout->addWidget(eventColor->label(),ii,0); | 1267 | topLayout->addWidget(eventColor->label(),ii,0); |
1249 | topLayout->addWidget(eventColor->button(),ii++,1); | 1268 | topLayout->addWidget(eventColor->button(),ii++,1); |
1250 | 1269 | ||
1251 | // agenda view background color | 1270 | // agenda view background color |
1252 | KPrefsWidColor *agendaBgColor = | 1271 | KPrefsWidColor *agendaBgColor = |
1253 | addWidColor(i18n("Agenda view background color:"), | 1272 | addWidColor(i18n("Agenda view background color:"), |
1254 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); | 1273 | &(KOPrefs::instance()->mAgendaBgColor),topFrame); |
1255 | topLayout->addWidget(agendaBgColor->label(),ii,0); | 1274 | topLayout->addWidget(agendaBgColor->label(),ii,0); |
1256 | topLayout->addWidget(agendaBgColor->button(),ii++,1); | 1275 | topLayout->addWidget(agendaBgColor->button(),ii++,1); |
1257 | 1276 | ||
1258 | // working hours color | 1277 | // working hours color |
1259 | KPrefsWidColor *workingHoursColor = | 1278 | KPrefsWidColor *workingHoursColor = |
1260 | addWidColor(i18n("Working hours color:"), | 1279 | addWidColor(i18n("Working hours color:"), |
1261 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); | 1280 | &(KOPrefs::instance()->mWorkingHoursColor),topFrame); |
1262 | topLayout->addWidget(workingHoursColor->label(),ii,0); | 1281 | topLayout->addWidget(workingHoursColor->label(),ii,0); |
1263 | topLayout->addWidget(workingHoursColor->button(),ii++,1); | 1282 | topLayout->addWidget(workingHoursColor->button(),ii++,1); |
1264 | 1283 | ||
1265 | KPrefsDialogWidBool *sb = | 1284 | KPrefsDialogWidBool *sb = |
1266 | addWidBool(i18n("Use colors for application:"), | 1285 | addWidBool(i18n("Use colors for application:"), |
1267 | &(KOPrefs::instance()->mUseAppColors),topFrame); | 1286 | &(KOPrefs::instance()->mUseAppColors),topFrame); |
1268 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); | 1287 | topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); |
1269 | 1288 | ||
1270 | ii++; | 1289 | ii++; |
1271 | KPrefsWidColor * workingHoursColor1 = | 1290 | KPrefsWidColor * workingHoursColor1 = |
1272 | addWidColor(i18n("Buttons, menus, etc.:"), | 1291 | addWidColor(i18n("Buttons, menus, etc.:"), |
1273 | &(KOPrefs::instance()->mAppColor1),topFrame); | 1292 | &(KOPrefs::instance()->mAppColor1),topFrame); |
1274 | topLayout->addWidget(workingHoursColor1->label(),ii,0); | 1293 | topLayout->addWidget(workingHoursColor1->label(),ii,0); |
1275 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); | 1294 | topLayout->addWidget(workingHoursColor1->button(),ii++,1); |
1276 | 1295 | ||
1277 | KPrefsWidColor * workingHoursColor2 = | 1296 | KPrefsWidColor * workingHoursColor2 = |
1278 | addWidColor(i18n("Frames, labels, etc.:"), | 1297 | addWidColor(i18n("Frames, labels, etc.:"), |
1279 | &(KOPrefs::instance()->mAppColor2),topFrame); | 1298 | &(KOPrefs::instance()->mAppColor2),topFrame); |
1280 | topLayout->addWidget(workingHoursColor2->label(),ii,0); | 1299 | topLayout->addWidget(workingHoursColor2->label(),ii,0); |
1281 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); | 1300 | topLayout->addWidget(workingHoursColor2->button(),ii++,1); |
1282 | 1301 | ||
1283 | 1302 | ||
1284 | 1303 | ||
1285 | } | 1304 | } |
1286 | 1305 | ||
1287 | void KOPrefsDialog::setCategoryColor() | 1306 | void KOPrefsDialog::setCategoryColor() |
1288 | { | 1307 | { |
1289 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); | 1308 | mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); |
1290 | } | 1309 | } |
1291 | 1310 | ||
1292 | void KOPrefsDialog::updateCategoryColor() | 1311 | void KOPrefsDialog::updateCategoryColor() |
1293 | { | 1312 | { |
1294 | QString cat = mCategoryCombo->currentText(); | 1313 | QString cat = mCategoryCombo->currentText(); |
1295 | QColor *color = mCategoryDict.find(cat); | 1314 | QColor *color = mCategoryDict.find(cat); |
1296 | if (!color) { | 1315 | if (!color) { |
1297 | color = KOPrefs::instance()->categoryColor(cat); | 1316 | color = KOPrefs::instance()->categoryColor(cat); |
1298 | } | 1317 | } |
1299 | if (color) { | 1318 | if (color) { |
1300 | mCategoryButton->setColor(*color); | 1319 | mCategoryButton->setColor(*color); |
1301 | } | 1320 | } |
1302 | } | 1321 | } |
1303 | 1322 | ||
1304 | void KOPrefsDialog::setupPrinterTab() | 1323 | void KOPrefsDialog::setupPrinterTab() |
1305 | { | 1324 | { |
1306 | mPrinterTab = addPage(i18n("Printing"),0, | 1325 | mPrinterTab = addPage(i18n("Printing"),0, |
1307 | DesktopIcon("fileprint",KIcon::SizeMedium)); | 1326 | DesktopIcon("fileprint",KIcon::SizeMedium)); |
1308 | 1327 | ||
1309 | QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); | 1328 | QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); |
1310 | topLayout->setSpacing(spacingHint()); | 1329 | topLayout->setSpacing(spacingHint()); |
1311 | topLayout->setMargin(marginHint()); | 1330 | topLayout->setMargin(marginHint()); |
1312 | 1331 | ||
1313 | topLayout->setRowStretch(4,1); | 1332 | topLayout->setRowStretch(4,1); |
1314 | } | 1333 | } |
1315 | 1334 | ||
1316 | void KOPrefsDialog::setupGroupSchedulingTab() | 1335 | void KOPrefsDialog::setupGroupSchedulingTab() |
1317 | { | 1336 | { |
1318 | #if 0 | 1337 | #if 0 |
1319 | QFrame *topFrame = addPage(i18n("Group Scheduling"),0, | 1338 | QFrame *topFrame = addPage(i18n("Group Scheduling"),0, |
1320 | DesktopIcon("personal",KIcon::SizeMedium)); | 1339 | DesktopIcon("personal",KIcon::SizeMedium)); |
1321 | 1340 | ||
1322 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); | 1341 | QGridLayout *topLayout = new QGridLayout(topFrame,6,2); |
1323 | topLayout->setSpacing(spacingHint()); | 1342 | topLayout->setSpacing(spacingHint()); |
1324 | topLayout->setMargin(marginHint()); | 1343 | topLayout->setMargin(marginHint()); |
1325 | 1344 | ||
1326 | #if 0 | 1345 | #if 0 |
1327 | KPrefsWidRadios *schedulerGroup = | 1346 | KPrefsWidRadios *schedulerGroup = |
1328 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), | 1347 | addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), |
1329 | topFrame); | 1348 | topFrame); |
1330 | schedulerGroup->addRadio("Dummy"); // Only for debugging | 1349 | schedulerGroup->addRadio("Dummy"); // Only for debugging |
1331 | schedulerGroup->addRadio(i18n("Mail client")); | 1350 | schedulerGroup->addRadio(i18n("Mail client")); |
1332 | 1351 | ||
1333 | topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); | 1352 | topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); |
1334 | #endif | 1353 | #endif |
1335 | 1354 | ||
1336 | KPrefsWidRadios *sendGroup = | 1355 | KPrefsWidRadios *sendGroup = |
1337 | addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), | 1356 | addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), |
1338 | topFrame); | 1357 | topFrame); |
1339 | sendGroup->addRadio(i18n("Send to outbox")); | 1358 | sendGroup->addRadio(i18n("Send to outbox")); |
1340 | sendGroup->addRadio(i18n("Send directly")); | 1359 | sendGroup->addRadio(i18n("Send directly")); |
1341 | 1360 | ||
1342 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); | 1361 | topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); |
1343 | 1362 | ||
1344 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); | 1363 | topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); |
1345 | mAMails = new QListView(topFrame); | 1364 | mAMails = new QListView(topFrame); |
1346 | mAMails->addColumn(i18n("Email"),300); | 1365 | mAMails->addColumn(i18n("Email"),300); |
1347 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); | 1366 | topLayout->addMultiCellWidget(mAMails,3,3,0,1); |
1348 | 1367 | ||
1349 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); | 1368 | topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); |
1350 | aEmailsEdit = new QLineEdit(topFrame); | 1369 | aEmailsEdit = new QLineEdit(topFrame); |
1351 | aEmailsEdit->setEnabled(false); | 1370 | aEmailsEdit->setEnabled(false); |
1352 | topLayout->addWidget(aEmailsEdit,4,1); | 1371 | topLayout->addWidget(aEmailsEdit,4,1); |
1353 | 1372 | ||
1354 | QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); | 1373 | QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); |
1355 | topLayout->addWidget(add,5,0); | 1374 | topLayout->addWidget(add,5,0); |
1356 | QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); | 1375 | QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); |
1357 | topLayout->addWidget(del,5,1); | 1376 | topLayout->addWidget(del,5,1); |
1358 | 1377 | ||
1359 | //topLayout->setRowStretch(2,1); | 1378 | //topLayout->setRowStretch(2,1); |
1360 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); | 1379 | connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); |
1361 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); | 1380 | connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); |
1362 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); | 1381 | connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); |
1363 | connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); | 1382 | connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); |
1364 | #endif | 1383 | #endif |
1365 | } | 1384 | } |
1366 | 1385 | ||
1367 | void KOPrefsDialog::setupGroupAutomationTab() | 1386 | void KOPrefsDialog::setupGroupAutomationTab() |
1368 | { | 1387 | { |
1369 | return; | 1388 | return; |
1370 | QFrame *topFrame = addPage(i18n("Group Automation"),0, | 1389 | QFrame *topFrame = addPage(i18n("Group Automation"),0, |
1371 | DesktopIcon("personal",KIcon::SizeMedium)); | 1390 | DesktopIcon("personal",KIcon::SizeMedium)); |
1372 | 1391 | ||
1373 | QGridLayout *topLayout = new QGridLayout(topFrame,5,1); | 1392 | QGridLayout *topLayout = new QGridLayout(topFrame,5,1); |
1374 | topLayout->setSpacing(spacingHint()); | 1393 | topLayout->setSpacing(spacingHint()); |
1375 | topLayout->setMargin(marginHint()); | 1394 | topLayout->setMargin(marginHint()); |
1376 | 1395 | ||
1377 | KPrefsWidRadios *autoRefreshGroup = | 1396 | KPrefsWidRadios *autoRefreshGroup = |
1378 | addWidRadios(i18n("Auto Send Refresh"), | 1397 | addWidRadios(i18n("Auto Send Refresh"), |
1379 | &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); | 1398 | &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); |
1380 | autoRefreshGroup->addRadio(i18n("Never")); | 1399 | autoRefreshGroup->addRadio(i18n("Never")); |
1381 | autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); | 1400 | autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); |
1382 | //autoRefreshGroup->addRadio(i18n("selected emails")); | 1401 | //autoRefreshGroup->addRadio(i18n("selected emails")); |
1383 | topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); | 1402 | topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); |
1384 | 1403 | ||
1385 | KPrefsWidRadios *autoInsertGroup = | 1404 | KPrefsWidRadios *autoInsertGroup = |
1386 | addWidRadios(i18n("Auto Insert IMIP Replies"), | 1405 | addWidRadios(i18n("Auto Insert IMIP Replies"), |
1387 | &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); | 1406 | &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); |
1388 | autoInsertGroup->addRadio(i18n("Never")); | 1407 | autoInsertGroup->addRadio(i18n("Never")); |
1389 | autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); | 1408 | autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); |
1390 | //autoInsertGroup->addRadio(i18n("selected emails")); | 1409 | //autoInsertGroup->addRadio(i18n("selected emails")); |
1391 | topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); | 1410 | topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); |
1392 | 1411 | ||
1393 | KPrefsWidRadios *autoRequestGroup = | 1412 | KPrefsWidRadios *autoRequestGroup = |
1394 | addWidRadios(i18n("Auto Insert IMIP Requests"), | 1413 | addWidRadios(i18n("Auto Insert IMIP Requests"), |
1395 | &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); | 1414 | &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); |
1396 | autoRequestGroup->addRadio(i18n("Never")); | 1415 | autoRequestGroup->addRadio(i18n("Never")); |
1397 | autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); | 1416 | autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); |
1398 | //autoInsertGroup->addRadio(i18n("selected emails")); | 1417 | //autoInsertGroup->addRadio(i18n("selected emails")); |
1399 | topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); | 1418 | topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); |
1400 | 1419 | ||
1401 | KPrefsWidRadios *autoFreeBusyGroup = | 1420 | KPrefsWidRadios *autoFreeBusyGroup = |
1402 | addWidRadios(i18n("Auto Send FreeBusy Information"), | 1421 | addWidRadios(i18n("Auto Send FreeBusy Information"), |
1403 | &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); | 1422 | &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); |
1404 | autoFreeBusyGroup->addRadio(i18n("Never")); | 1423 | autoFreeBusyGroup->addRadio(i18n("Never")); |
1405 | autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); | 1424 | autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); |
1406 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); | 1425 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); |
1407 | topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); | 1426 | topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); |
1408 | 1427 | ||
1409 | KPrefsWidRadios *autoFreeBusyReplyGroup = | 1428 | KPrefsWidRadios *autoFreeBusyReplyGroup = |
1410 | addWidRadios(i18n("Auto Save FreeBusy Replies"), | 1429 | addWidRadios(i18n("Auto Save FreeBusy Replies"), |
1411 | &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); | 1430 | &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); |
1412 | autoFreeBusyReplyGroup->addRadio(i18n("Never")); | 1431 | autoFreeBusyReplyGroup->addRadio(i18n("Never")); |
1413 | autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); | 1432 | autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); |
1414 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); | 1433 | //autoFreeBusyGroup->addRadio(i18n("selected emails")); |
1415 | topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); | 1434 | topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); |
1416 | } | 1435 | } |
1417 | 1436 | ||
1418 | void KOPrefsDialog::showPrinterTab() | 1437 | void KOPrefsDialog::showPrinterTab() |
1419 | { | 1438 | { |
1420 | showPage(pageIndex(mPrinterTab)); | 1439 | showPage(pageIndex(mPrinterTab)); |
1421 | } | 1440 | } |
1422 | 1441 | ||
1423 | 1442 | ||
1424 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, | 1443 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, |
1425 | const QStringList *tags) | 1444 | const QStringList *tags) |
1426 | { | 1445 | { |
1427 | if (tags) { | 1446 | if (tags) { |
1428 | int i = tags->findIndex(text); | 1447 | int i = tags->findIndex(text); |
1429 | if (i > 0) combo->setCurrentItem(i); | 1448 | if (i > 0) combo->setCurrentItem(i); |
1430 | } else { | 1449 | } else { |
1431 | for(int i=0;i<combo->count();++i) { | 1450 | for(int i=0;i<combo->count();++i) { |
1432 | if (combo->text(i) == text) { | 1451 | if (combo->text(i) == text) { |
1433 | combo->setCurrentItem(i); | 1452 | combo->setCurrentItem(i); |
1434 | break; | 1453 | break; |
1435 | } | 1454 | } |
1436 | } | 1455 | } |
1437 | } | 1456 | } |
1438 | } | 1457 | } |
1439 | 1458 | ||
1440 | void KOPrefsDialog::usrReadConfig() | 1459 | void KOPrefsDialog::usrReadConfig() |
1441 | { | 1460 | { |
1442 | mNameEdit->setText(KOPrefs::instance()->fullName()); | 1461 | mNameEdit->setText(KOPrefs::instance()->fullName()); |
1443 | mEmailEdit->setText(KOPrefs::instance()->email()); | 1462 | mEmailEdit->setText(KOPrefs::instance()->email()); |
1444 | 1463 | ||
1445 | mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); | 1464 | mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); |
1446 | QDate current ( 2001, 1,1); | 1465 | QDate current ( 2001, 1,1); |
1447 | mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); | 1466 | mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); |
1448 | mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); | 1467 | mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); |
1449 | setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); | 1468 | setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); |
1450 | //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); | 1469 | //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); |
1451 | mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); | 1470 | mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); |
1452 | mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); | 1471 | mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); |
1453 | mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); | 1472 | mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); |
1454 | // if (KOPrefs::instance()->mAllDaySize > 47 ) | 1473 | // if (KOPrefs::instance()->mAllDaySize > 47 ) |
1455 | // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; | 1474 | // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; |
1456 | //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); | 1475 | //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); |
1457 | 1476 | ||
1458 | mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); | 1477 | mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); |
1459 | mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); | 1478 | mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); |
1460 | mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); | 1479 | mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); |
1461 | // mAMails->clear(); | 1480 | // mAMails->clear(); |
1462 | // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); | 1481 | // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); |
1463 | // it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { | 1482 | // it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { |
1464 | // QListViewItem *item = new QListViewItem(mAMails); | 1483 | // QListViewItem *item = new QListViewItem(mAMails); |
1465 | // item->setText(0,*it); | 1484 | // item->setText(0,*it); |
1466 | // mAMails->insertItem(item); | 1485 | // mAMails->insertItem(item); |
1467 | // } | 1486 | // } |
1468 | 1487 | ||
1469 | // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); | 1488 | // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); |
1470 | //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); | 1489 | //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); |
1471 | //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); | 1490 | //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); |
1472 | //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); | 1491 | //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); |
1473 | 1492 | ||
1474 | //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); | 1493 | //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); |
1475 | mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); | 1494 | mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); |
1476 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; | 1495 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; |
1477 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | 1496 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); |
1478 | dummy = KOPrefs::instance()->mUserDateFormatShort; | 1497 | dummy = KOPrefs::instance()->mUserDateFormatShort; |
1479 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | 1498 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); |
1480 | updateCategories(); | 1499 | updateCategories(); |
1481 | mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); | 1500 | mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); |
1482 | mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); | 1501 | mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); |
1483 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); | 1502 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); |
1484 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); | 1503 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); |
1485 | } | 1504 | } |
1486 | 1505 | ||
1487 | 1506 | ||
1488 | void KOPrefsDialog::usrWriteConfig() | 1507 | void KOPrefsDialog::usrWriteConfig() |
1489 | { | 1508 | { |
1490 | 1509 | ||
1491 | // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); | 1510 | // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); |
1492 | //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); | 1511 | //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); |
1493 | //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); | 1512 | //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); |
1494 | //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); | 1513 | //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); |
1495 | //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); | 1514 | //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); |
1496 | KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); | 1515 | KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); |
1497 | 1516 | ||
1498 | KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); | 1517 | KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); |
1499 | KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); | 1518 | KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); |
1500 | KOPrefs::instance()->setFullName(mNameEdit->text()); | 1519 | KOPrefs::instance()->setFullName(mNameEdit->text()); |
1501 | KOPrefs::instance()->setEmail(mEmailEdit->text()); | 1520 | KOPrefs::instance()->setEmail(mEmailEdit->text()); |
1502 | 1521 | ||
1503 | KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); | 1522 | KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); |
1504 | 1523 | ||
1505 | KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); | 1524 | KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); |
1506 | QDate date; | 1525 | QDate date; |
1507 | date = mStartDateSavingEdit->date(); | 1526 | date = mStartDateSavingEdit->date(); |
1508 | int sub = 0; | 1527 | int sub = 0; |
1509 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | 1528 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) |
1510 | sub = 1; | 1529 | sub = 1; |
1511 | KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; | 1530 | KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; |
1512 | date = mEndDateSavingEdit->date(); | 1531 | date = mEndDateSavingEdit->date(); |
1513 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | 1532 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) |
1514 | sub = 1; | 1533 | sub = 1; |
1515 | else | 1534 | else |
1516 | sub = 0; | 1535 | sub = 0; |
1517 | KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; | 1536 | KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; |
1518 | // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); | 1537 | // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); |
1519 | 1538 | ||
1520 | KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); | 1539 | KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); |
1521 | KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); | 1540 | KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); |
1522 | KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); | 1541 | KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); |
1523 | 1542 | ||
1524 | //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); | 1543 | //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); |
1525 | 1544 | ||
1526 | QDictIterator<QColor> it(mCategoryDict); | 1545 | QDictIterator<QColor> it(mCategoryDict); |
1527 | while (it.current()) { | 1546 | while (it.current()) { |
1528 | KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); | 1547 | KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); |
1529 | ++it; | 1548 | ++it; |
1530 | } | 1549 | } |
1531 | 1550 | ||
1532 | KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); | 1551 | KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); |
1533 | KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); | 1552 | KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); |
1534 | KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); | 1553 | KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); |
1535 | 1554 | ||
1536 | KOPrefs::instance()->mAdditionalMails.clear(); | 1555 | KOPrefs::instance()->mAdditionalMails.clear(); |
1537 | // QListViewItem *item; | 1556 | // QListViewItem *item; |
1538 | // item = mAMails->firstChild(); | 1557 | // item = mAMails->firstChild(); |
1539 | // while (item) | 1558 | // while (item) |
1540 | // { | 1559 | // { |
1541 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); | 1560 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); |
1542 | // item = item->nextSibling(); | 1561 | // item = item->nextSibling(); |
1543 | // } | 1562 | // } |
1544 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); | 1563 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); |
1545 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; | 1564 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; |
1546 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; | 1565 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; |
1547 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; | 1566 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; |
1548 | 1567 | ||
1549 | } | 1568 | } |
1550 | 1569 | ||
1551 | void KOPrefsDialog::updateCategories() | 1570 | void KOPrefsDialog::updateCategories() |
1552 | { | 1571 | { |
1553 | mCategoryCombo->clear(); | 1572 | mCategoryCombo->clear(); |
1554 | mCategoryDict.clear(); | 1573 | mCategoryDict.clear(); |
1555 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1574 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1556 | updateCategoryColor(); | 1575 | updateCategoryColor(); |
1557 | } | 1576 | } |
1558 | 1577 | ||
1559 | void KOPrefsDialog::warningGroupScheduling() | 1578 | void KOPrefsDialog::warningGroupScheduling() |
1560 | { | 1579 | { |
1561 | warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); | 1580 | warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); |
1562 | } | 1581 | } |
1563 | 1582 | ||
1564 | void KOPrefsDialog::warningProjectView() | 1583 | void KOPrefsDialog::warningProjectView() |
1565 | { | 1584 | { |
1566 | warningExperimental(mEnableProjectView->checkBox()->isChecked()); | 1585 | warningExperimental(mEnableProjectView->checkBox()->isChecked()); |
1567 | } | 1586 | } |
1568 | 1587 | ||
1569 | void KOPrefsDialog::warningExperimental(bool on) | 1588 | void KOPrefsDialog::warningExperimental(bool on) |
1570 | { | 1589 | { |
1571 | if (on) { | 1590 | if (on) { |
1572 | KMessageBox::information(this,i18n("This is an experimental feature. " | 1591 | KMessageBox::information(this,i18n("This is an experimental feature. " |
1573 | "It may not work, it may do nothing useful and it may cause data loss. " | 1592 | "It may not work, it may do nothing useful and it may cause data loss. " |
1574 | "Use with care.\n" | 1593 | "Use with care.\n" |
1575 | "You have to restart KOrganizer for this setting to take effect.")); | 1594 | "You have to restart KOrganizer for this setting to take effect.")); |
1576 | } else { | 1595 | } else { |
1577 | KMessageBox::information(this, | 1596 | KMessageBox::information(this, |
1578 | i18n("You have to restart KOrganizer for this setting to take effect.")); | 1597 | i18n("You have to restart KOrganizer for this setting to take effect.")); |
1579 | } | 1598 | } |
1580 | } | 1599 | } |
1581 | 1600 | ||
1582 | void KOPrefsDialog::toggleEmailSettings(bool on) | 1601 | void KOPrefsDialog::toggleEmailSettings(bool on) |
1583 | { | 1602 | { |
1584 | if (on) { | 1603 | if (on) { |
1585 | mEmailEdit->setEnabled(false); | 1604 | mEmailEdit->setEnabled(false); |
1586 | mNameEdit->setEnabled(false); | 1605 | mNameEdit->setEnabled(false); |
1587 | mEmailLabel->setEnabled(false); | 1606 | mEmailLabel->setEnabled(false); |
1588 | mNameLabel->setEnabled(false); | 1607 | mNameLabel->setEnabled(false); |
1589 | 1608 | ||
1590 | KEMailSettings settings; | 1609 | KEMailSettings settings; |
1591 | mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); | 1610 | mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); |
1592 | mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); | 1611 | mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); |
1593 | } else { | 1612 | } else { |
1594 | mEmailEdit->setEnabled(true); | 1613 | mEmailEdit->setEnabled(true); |
1595 | mNameEdit->setEnabled(true); | 1614 | mNameEdit->setEnabled(true); |
1596 | mEmailLabel->setEnabled(true); | 1615 | mEmailLabel->setEnabled(true); |
1597 | mNameLabel->setEnabled(true); | 1616 | mNameLabel->setEnabled(true); |
1598 | } | 1617 | } |
1599 | } | 1618 | } |
1600 | 1619 | ||
1601 | void KOPrefsDialog::addItem() | 1620 | void KOPrefsDialog::addItem() |
1602 | { | 1621 | { |
1603 | // aEmailsEdit->setEnabled(true); | 1622 | // aEmailsEdit->setEnabled(true); |
1604 | // QListViewItem *item = new QListViewItem(mAMails); | 1623 | // QListViewItem *item = new QListViewItem(mAMails); |
1605 | // mAMails->insertItem(item); | 1624 | // mAMails->insertItem(item); |
1606 | // mAMails->setSelected(item,true); | 1625 | // mAMails->setSelected(item,true); |
1607 | // aEmailsEdit->setText(i18n("(EmptyEmail)")); | 1626 | // aEmailsEdit->setText(i18n("(EmptyEmail)")); |
1608 | } | 1627 | } |
1609 | 1628 | ||
1610 | void KOPrefsDialog::removeItem() | 1629 | void KOPrefsDialog::removeItem() |
1611 | { | 1630 | { |
1612 | // QListViewItem *item; | 1631 | // QListViewItem *item; |
1613 | // item = mAMails->selectedItem(); | 1632 | // item = mAMails->selectedItem(); |
1614 | // if (!item) return; | 1633 | // if (!item) return; |
1615 | // mAMails->takeItem(item); | 1634 | // mAMails->takeItem(item); |
1616 | // item = mAMails->selectedItem(); | 1635 | // item = mAMails->selectedItem(); |
1617 | // if (!item) { | 1636 | // if (!item) { |
1618 | // aEmailsEdit->setText(""); | 1637 | // aEmailsEdit->setText(""); |
1619 | // aEmailsEdit->setEnabled(false); | 1638 | // aEmailsEdit->setEnabled(false); |
1620 | // } | 1639 | // } |
1621 | // if (mAMails->childCount() == 0) { | 1640 | // if (mAMails->childCount() == 0) { |
1622 | // aEmailsEdit->setEnabled(false); | 1641 | // aEmailsEdit->setEnabled(false); |
1623 | // } | 1642 | // } |
1624 | } | 1643 | } |
1625 | 1644 | ||
1626 | void KOPrefsDialog::updateItem() | 1645 | void KOPrefsDialog::updateItem() |
1627 | { | 1646 | { |
1628 | // QListViewItem *item; | 1647 | // QListViewItem *item; |
1629 | // item = mAMails->selectedItem(); | 1648 | // item = mAMails->selectedItem(); |
1630 | // if (!item) return; | 1649 | // if (!item) return; |
1631 | // item->setText(0,aEmailsEdit->text()); | 1650 | // item->setText(0,aEmailsEdit->text()); |
1632 | } | 1651 | } |
1633 | 1652 | ||
1634 | void KOPrefsDialog::updateInput() | 1653 | void KOPrefsDialog::updateInput() |
1635 | { | 1654 | { |
1636 | // QListViewItem *item; | 1655 | // QListViewItem *item; |
1637 | // item = mAMails->selectedItem(); | 1656 | // item = mAMails->selectedItem(); |
1638 | // if (!item) return; | 1657 | // if (!item) return; |
1639 | // aEmailsEdit->setEnabled(true); | 1658 | // aEmailsEdit->setEnabled(true); |
1640 | // aEmailsEdit->setText(item->text(0)); | 1659 | // aEmailsEdit->setText(item->text(0)); |
1641 | } | 1660 | } |
1642 | void KOPrefsDialog::updateTimezoneOffset( int index ) | 1661 | void KOPrefsDialog::updateTimezoneOffset( int index ) |
1643 | { | 1662 | { |
1644 | /* | 1663 | /* |
1645 | qDebug("updateTimezoneOffset %d ", index); | 1664 | qDebug("updateTimezoneOffset %d ", index); |
1646 | if ( index < 24 ) { | 1665 | if ( index < 24 ) { |
1647 | mTimezoneOffsetSpin->setEnabled ( false ); | 1666 | mTimezoneOffsetSpin->setEnabled ( false ); |
1648 | mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); | 1667 | mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); |
1649 | 1668 | ||
1650 | 1669 | ||
1651 | } else { | 1670 | } else { |
1652 | if ( index == 24 ) { | 1671 | if ( index == 24 ) { |
1653 | mTimezoneOffsetSpin->setEnabled ( true ); | 1672 | mTimezoneOffsetSpin->setEnabled ( true ); |
1654 | mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); | 1673 | mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); |
1655 | 1674 | ||
1656 | } else { | 1675 | } else { |
1657 | mTimezoneOffsetSpin->setEnabled ( false ); | 1676 | mTimezoneOffsetSpin->setEnabled ( false ); |
1658 | mTimezoneOffsetSpin->setValue( 0 ); | 1677 | mTimezoneOffsetSpin->setValue( 0 ); |
1659 | } | 1678 | } |
1660 | } | 1679 | } |
1661 | */ | 1680 | */ |
1662 | } | 1681 | } |
1663 | 1682 | ||
1664 | void KOPrefsDialog::setupTimeZoneTab() | 1683 | void KOPrefsDialog::setupTimeZoneTab() |
1665 | { | 1684 | { |
1666 | QFrame *topFrame = addPage(i18n("Time Zone"),0,0); | 1685 | QFrame *topFrame = addPage(i18n("Time Zone"),0,0); |
1667 | // DesktopIcon("clock",KIcon::SizeMedium)); | 1686 | // DesktopIcon("clock",KIcon::SizeMedium)); |
1668 | 1687 | ||
1669 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); | 1688 | QGridLayout *topLayout = new QGridLayout(topFrame,5,2); |
1670 | topLayout->setSpacing(spacingHint()); | 1689 | topLayout->setSpacing(spacingHint()); |
1671 | topLayout->setMargin(marginHint()); | 1690 | topLayout->setMargin(marginHint()); |
1672 | 1691 | ||
1673 | QHBox *timeZoneBox = new QHBox( topFrame ); | 1692 | QHBox *timeZoneBox = new QHBox( topFrame ); |
1674 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); | 1693 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); |
1675 | 1694 | ||
1676 | new QLabel( i18n("Timezone:"), timeZoneBox ); | 1695 | new QLabel( i18n("Timezone:"), timeZoneBox ); |
1677 | mTimeZoneCombo = new QComboBox( timeZoneBox ); | 1696 | mTimeZoneCombo = new QComboBox( timeZoneBox ); |
1678 | if ( QApplication::desktop()->width() < 300 ) { | 1697 | if ( QApplication::desktop()->width() < 300 ) { |
1679 | mTimeZoneCombo->setMaximumWidth(150); | 1698 | mTimeZoneCombo->setMaximumWidth(150); |
1680 | } | 1699 | } |
1681 | 1700 | ||
1682 | QStringList list; | 1701 | QStringList list; |
1683 | list = KGlobal::locale()->timeZoneList(); | 1702 | list = KGlobal::locale()->timeZoneList(); |
1684 | mTimeZoneCombo->insertStringList(list); | 1703 | mTimeZoneCombo->insertStringList(list); |
1685 | 1704 | ||
1686 | // find the currently set time zone and select it | 1705 | // find the currently set time zone and select it |
1687 | QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; | 1706 | QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; |
1688 | int nCurrentlySet = 11; | 1707 | int nCurrentlySet = 11; |
1689 | for (int i = 0; i < mTimeZoneCombo->count(); i++) | 1708 | for (int i = 0; i < mTimeZoneCombo->count(); i++) |
1690 | { | 1709 | { |
1691 | if (mTimeZoneCombo->text(i) == sCurrentlySet) | 1710 | if (mTimeZoneCombo->text(i) == sCurrentlySet) |
1692 | { | 1711 | { |
1693 | nCurrentlySet = i; | 1712 | nCurrentlySet = i; |
1694 | break; | 1713 | break; |
1695 | } | 1714 | } |
1696 | } | 1715 | } |
1697 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); | 1716 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); |
1698 | int iii = 1; | 1717 | int iii = 1; |
1699 | KPrefsDialogWidBool *sb = | 1718 | KPrefsDialogWidBool *sb = |
1700 | addWidBool(i18n("Timezone has daylight saving"), | 1719 | addWidBool(i18n("Timezone has daylight saving"), |
1701 | &(KOPrefs::instance()->mUseDaylightsaving),topFrame); | 1720 | &(KOPrefs::instance()->mUseDaylightsaving),topFrame); |
1702 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 1721 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
1703 | ++iii; | 1722 | ++iii; |
1704 | QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); | 1723 | QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); |
1705 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 1724 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |
1706 | ++iii; | 1725 | ++iii; |
1707 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); | 1726 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); |
1708 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 1727 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |
1709 | ++iii; | 1728 | ++iii; |
1710 | lab = new QLabel( i18n("Daylight start:"), topFrame ); | 1729 | lab = new QLabel( i18n("Daylight start:"), topFrame ); |
1711 | topLayout->addWidget(lab, iii,0); | 1730 | topLayout->addWidget(lab, iii,0); |
1712 | mStartDateSavingEdit = new KDateEdit(topFrame); | 1731 | mStartDateSavingEdit = new KDateEdit(topFrame); |
1713 | topLayout->addWidget(mStartDateSavingEdit, iii,1); | 1732 | topLayout->addWidget(mStartDateSavingEdit, iii,1); |
1714 | ++iii; | 1733 | ++iii; |
1715 | 1734 | ||
1716 | lab = new QLabel( i18n("Daylight end:"), topFrame ); | 1735 | lab = new QLabel( i18n("Daylight end:"), topFrame ); |
1717 | topLayout->addWidget(lab, iii,0); | 1736 | topLayout->addWidget(lab, iii,0); |
1718 | mEndDateSavingEdit = new KDateEdit(topFrame); | 1737 | mEndDateSavingEdit = new KDateEdit(topFrame); |
1719 | topLayout->addWidget(mEndDateSavingEdit, iii,1); | 1738 | topLayout->addWidget(mEndDateSavingEdit, iii,1); |
1720 | ++iii; | 1739 | ++iii; |
1721 | QDate current ( 2001, 1,1); | 1740 | QDate current ( 2001, 1,1); |
1722 | mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); | 1741 | mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); |
1723 | mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); | 1742 | mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); |
1724 | 1743 | ||
1725 | 1744 | ||
1726 | } | 1745 | } |
1727 | #endif | 1746 | #endif |
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 250d114..0794e00 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -1,394 +1,414 @@ | |||
1 | 1 | ||
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qvbox.h> | 4 | #include <qvbox.h> |
5 | #include <qheader.h> | 5 | #include <qheader.h> |
6 | #include <qtimer.h> | 6 | #include <qtimer.h> |
7 | #include <qlayout.h> | 7 | #include <qlayout.h> |
8 | //#include <kdialog.h> | 8 | //#include <kdialog.h> |
9 | #include <kiconloader.h> | 9 | #include <kiconloader.h> |
10 | #include <kapplication.h> | 10 | #include <kapplication.h> |
11 | 11 | ||
12 | #ifdef DESKTOP_VERSION | 12 | #ifdef DESKTOP_VERSION |
13 | #include <qapplication.h> | 13 | #include <qapplication.h> |
14 | #include <qstatusbar.h> | 14 | #include <qstatusbar.h> |
15 | #include <kabc/stdaddressbook.h> | 15 | #include <kabc/stdaddressbook.h> |
16 | extern QStatusBar* globalSstatusBarMainWindow; | 16 | extern QStatusBar* globalSstatusBarMainWindow; |
17 | #else | 17 | #else |
18 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
19 | #include <klocale.h> | 19 | #include <klocale.h> |
20 | #endif | 20 | #endif |
21 | #include "defines.h" | 21 | #include "defines.h" |
22 | #include "koprefs.h" | ||
22 | #include "mainwindow.h" | 23 | #include "mainwindow.h" |
23 | #include "mailistviewitem.h" | 24 | #include "mailistviewitem.h" |
24 | #include <KDGanttMinimizeSplitter.h> | 25 | #include <KDGanttMinimizeSplitter.h> |
25 | 26 | ||
26 | #include "koprefs.h" | 27 | #include "koprefs.h" |
27 | 28 | ||
28 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | 29 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) |
29 | : QMainWindow( parent, name ) //, flags ) | 30 | : QMainWindow( parent, name ) //, flags ) |
30 | { | 31 | { |
31 | #ifdef DESKTOP_VERSION | 32 | #ifdef DESKTOP_VERSION |
32 | globalSstatusBarMainWindow = statusBar(); | 33 | globalSstatusBarMainWindow = statusBar(); |
33 | #endif | 34 | #endif |
34 | setCaption( i18n( "KOpieMail/Pi" ) ); | 35 | setCaption( i18n( "KOpieMail/Pi" ) ); |
35 | setToolBarsMovable( false ); | 36 | setToolBarsMovable( false ); |
36 | //KABC::StdAddressBook::self(); | 37 | //KABC::StdAddressBook::self(); |
37 | toolBar = new QToolBar( this ); | 38 | toolBar = new QToolBar( this ); |
38 | menuBar = new QPEMenuBar( toolBar ); | 39 | menuBar = new QPEMenuBar( toolBar ); |
39 | mailMenu = new QPopupMenu( menuBar ); | 40 | mailMenu = new QPopupMenu( menuBar ); |
40 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); | 41 | menuBar->insertItem( i18n( "Mail" ), mailMenu ); |
41 | settingsMenu = new QPopupMenu( menuBar ); | 42 | settingsMenu = new QPopupMenu( menuBar ); |
42 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); | 43 | menuBar->insertItem( i18n( "Settings" ), settingsMenu ); |
43 | 44 | ||
44 | addToolBar( toolBar ); | 45 | addToolBar( toolBar ); |
45 | toolBar->setHorizontalStretchable( true ); | 46 | toolBar->setHorizontalStretchable( true ); |
46 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), | 47 | QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"), |
47 | 0, 0, this ); | 48 | 0, 0, this ); |
48 | connect(getMail, SIGNAL( activated() ), | 49 | connect(getMail, SIGNAL( activated() ), |
49 | SLOT( slotGetAllMail() ) ); | 50 | SLOT( slotGetAllMail() ) ); |
50 | getMail->addTo( mailMenu ); | 51 | getMail->addTo( mailMenu ); |
51 | 52 | ||
52 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), | 53 | getMail = new QAction( i18n( "Get new messages" ), SmallIcon("add"), |
53 | 0, 0, this ); | 54 | 0, 0, this ); |
54 | getMail->addTo( toolBar ); | 55 | getMail->addTo( toolBar ); |
55 | getMail->addTo( mailMenu ); | 56 | getMail->addTo( mailMenu ); |
56 | connect(getMail, SIGNAL( activated() ), | 57 | connect(getMail, SIGNAL( activated() ), |
57 | SLOT( slotGetMail() ) ); | 58 | SLOT( slotGetMail() ) ); |
58 | 59 | ||
59 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), | 60 | composeMail = new QAction( i18n( "Compose new mail" ), SmallIcon("composemail"), |
60 | 0, 0, this ); | 61 | 0, 0, this ); |
61 | composeMail->addTo( toolBar ); | 62 | composeMail->addTo( toolBar ); |
62 | composeMail->addTo( mailMenu ); | 63 | composeMail->addTo( mailMenu ); |
63 | 64 | ||
64 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , | 65 | sendQueued = new QAction( i18n( "Send queued mails" ), SmallIcon("sendqueued") , |
65 | 0, 0, this ); | 66 | 0, 0, this ); |
66 | sendQueued->addTo( toolBar ); | 67 | sendQueued->addTo( toolBar ); |
67 | sendQueued->addTo( mailMenu ); | 68 | sendQueued->addTo( mailMenu ); |
68 | 69 | ||
69 | /* | 70 | /* |
70 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, | 71 | syncFolders = new QAction( i18n( "Sync mailfolders" ), ICON_SYNC, |
71 | 0, 0, this ); | 72 | 0, 0, this ); |
72 | syncFolders->addTo( toolBar ); | 73 | syncFolders->addTo( toolBar ); |
73 | syncFolders->addTo( mailMenu ); | 74 | syncFolders->addTo( mailMenu ); |
74 | */ | 75 | */ |
75 | 76 | ||
76 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , | 77 | showFolders = new QAction( i18n( "Show/Hide folders" ), SmallIcon("showfolders") , |
77 | 0, 0, this, 0, true ); | 78 | 0, 0, this, 0, true ); |
78 | showFolders->addTo( toolBar ); | 79 | showFolders->addTo( toolBar ); |
79 | showFolders->addTo( mailMenu ); | 80 | showFolders->addTo( mailMenu ); |
80 | showFolders->setOn( true ); | 81 | showFolders->setOn( true ); |
81 | connect(showFolders, SIGNAL( toggled(bool) ), | 82 | connect(showFolders, SIGNAL( toggled(bool) ), |
82 | SLOT( slotShowFolders(bool) ) ); | 83 | SLOT( slotShowFolders(bool) ) ); |
83 | 84 | ||
84 | /* | 85 | /* |
85 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), | 86 | searchMails = new QAction( i18n( "Search mails" ), SmallIcon("find") ), |
86 | 0, 0, this ); | 87 | 0, 0, this ); |
87 | searchMails->addTo( toolBar ); | 88 | searchMails->kopddTo( toolBar ); |
88 | searchMails->addTo( mailMenu ); | 89 | searchMails->addTo( mailMenu ); |
89 | */ | 90 | */ |
90 | 91 | ||
91 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); | 92 | deleteMails = new QAction(i18n("Delete Mail"), SmallIcon("trash"), 0, 0, this); |
92 | deleteMails->addTo( toolBar ); | 93 | deleteMails->addTo( toolBar ); |
93 | deleteMails->addTo( mailMenu ); | 94 | deleteMails->addTo( mailMenu ); |
94 | connect( deleteMails, SIGNAL( activated() ), | 95 | connect( deleteMails, SIGNAL( activated() ), |
95 | SLOT( slotDeleteAllMail() ) ); | 96 | SLOT( slotDeleteAllMail() ) ); |
96 | 97 | ||
97 | editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , | 98 | editSettings = new QAction( i18n( "Edit settings" ), SmallIcon("SettingsIcon") , |
98 | 0, 0, this ); | 99 | 0, 0, this ); |
99 | editSettings->addTo( settingsMenu ); | 100 | editSettings->addTo( settingsMenu ); |
100 | connect( editSettings, SIGNAL( activated() ), | 101 | connect( editSettings, SIGNAL( activated() ), |
101 | SLOT( slotEditSettings() ) ); | 102 | SLOT( slotEditSettings() ) ); |
102 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , | 103 | editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") , |
103 | 0, 0, this ); | 104 | 0, 0, this ); |
104 | editAccounts->addTo( settingsMenu ); | 105 | editAccounts->addTo( settingsMenu ); |
105 | codecMenu = new QPopupMenu( menuBar ); | 106 | codecMenu = new QPopupMenu( menuBar ); |
106 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); | 107 | codecMenu->insertItem( "Western (iso-8859-1)",0,0); |
107 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); | 108 | codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1); |
108 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); | 109 | codecMenu->insertItem( "Western (iso-8859-15)",2,2); |
109 | codecMenu->insertItem( "Chinese (big-5)",3,3); | 110 | codecMenu->insertItem( "Chinese (big-5)",3,3); |
110 | codecMenu->insertItem( "Unicode (utf-8)",4,4); | 111 | codecMenu->insertItem( "Unicode (utf-8)",4,4); |
111 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); | 112 | codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5); |
112 | //disabled | 113 | //disabled |
113 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); | 114 | //settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu); |
114 | //setCentralWidget( view ); | 115 | //setCentralWidget( view ); |
115 | 116 | ||
116 | QVBox* wrapperBox = new QVBox( this ); | 117 | QVBox* wrapperBox = new QVBox( this ); |
117 | setCentralWidget( wrapperBox ); | 118 | setCentralWidget( wrapperBox ); |
118 | 119 | ||
119 | // QWidget *view = new QWidget( wrapperBox ); | 120 | // QWidget *view = new QWidget( wrapperBox ); |
120 | KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); | 121 | KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox); |
121 | splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); | 122 | splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down); |
122 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); | 123 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor); |
123 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 124 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
124 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 125 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
125 | QWidget* infoBox = new QWidget( splithor ); | 126 | subLE = 0; |
126 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); | 127 | fromLE = 0; |
127 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); | 128 | toLE = 0; |
128 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | 129 | if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) { |
129 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | 130 | QWidget* infoBox = new QWidget( splithor ); |
130 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; | 131 | QGridLayout *griLay = new QGridLayout( infoBox, 2,2); |
131 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; | 132 | if ( KOPrefs::instance()->mShowInfoSub ) { |
132 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | 133 | griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 ); |
133 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); | 134 | griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ; |
135 | } | ||
136 | if ( KOPrefs::instance()->mShowInfoFrom ) { | ||
137 | griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 ); | ||
138 | griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ; | ||
139 | } | ||
140 | if ( KOPrefs::instance()->mShowInfoTo ) { | ||
141 | griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 ); | ||
142 | griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ; | ||
143 | } | ||
144 | infoBox->setMaximumHeight( infoBox->sizeHint().height() ); | ||
145 | if ( !KOPrefs::instance()->mShowInfoStart ) { | ||
146 | QTimer::singleShot( 1,splithor, SLOT ( toggle() ) ); | ||
147 | } | ||
148 | } | ||
149 | |||
150 | |||
134 | folderView = new AccountView( split ); | 151 | folderView = new AccountView( split ); |
135 | folderView->header()->hide(); | 152 | folderView->header()->hide(); |
136 | folderView->setRootIsDecorated( false ); | 153 | folderView->setRootIsDecorated( false ); |
137 | folderView->addColumn( i18n( "Mailbox" ) ); | 154 | folderView->addColumn( i18n( "Mailbox" ) ); |
138 | 155 | ||
139 | //layout->addWidget( folderView ); | 156 | //layout->addWidget( folderView ); |
140 | 157 | ||
141 | mailView = new QListView( split ); | 158 | mailView = new QListView( split ); |
142 | mailView->addColumn( i18n( " " ) ); | 159 | mailView->addColumn( i18n( " " ) ); |
143 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); | 160 | mailView->addColumn( i18n( "Subject" ),QListView::Manual ); |
144 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); | 161 | mailView->addColumn( i18n( "Sender" ),QListView::Manual ); |
145 | mailView->addColumn( i18n( "Size" ),QListView::Manual); | 162 | mailView->addColumn( i18n( "Size" ),QListView::Manual); |
146 | mailView->addColumn( i18n( "Date" ),QListView::Manual); | 163 | mailView->addColumn( i18n( "Date" ),QListView::Manual); |
147 | if ( KOPrefs::instance()->mShowToField ) | 164 | if ( KOPrefs::instance()->mShowToField ) |
148 | mailView->addColumn( i18n( "To" ),QListView::Manual); | 165 | mailView->addColumn( i18n( "To" ),QListView::Manual); |
149 | mailView->setAllColumnsShowFocus(true); | 166 | mailView->setAllColumnsShowFocus(true); |
150 | //mailView->setSorting(-1); | 167 | //mailView->setSorting(-1); |
151 | mailView->setRootIsDecorated( false ); | 168 | mailView->setRootIsDecorated( false ); |
152 | statusWidget = new StatusWidget( wrapperBox ); | 169 | statusWidget = new StatusWidget( wrapperBox ); |
153 | statusWidget->hide(); | 170 | statusWidget->hide(); |
154 | 171 | ||
155 | //layout->addWidget( mailView ); | 172 | //layout->addWidget( mailView ); |
156 | //layout->setStretchFactor( folderView, 1 ); | 173 | //layout->setStretchFactor( folderView, 1 ); |
157 | //layout->setStretchFactor( mailView, 2 ); | 174 | //layout->setStretchFactor( mailView, 2 ); |
158 | 175 | ||
159 | slotAdjustLayout(); | 176 | slotAdjustLayout(); |
160 | #ifndef DESKTOP_VERSION | 177 | #ifndef DESKTOP_VERSION |
161 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 178 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
162 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 179 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
163 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); | 180 | if ( subLE ) |
164 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); | 181 | QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold); |
165 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); | 182 | if ( fromLE ) |
183 | QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold); | ||
184 | if ( toLE ) | ||
185 | QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold); | ||
166 | #endif | 186 | #endif |
167 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 187 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
168 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 188 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
169 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 189 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
170 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 190 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
171 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 191 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
172 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 192 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
173 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 193 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
174 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 194 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
175 | 195 | ||
176 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, | 196 | connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this, |
177 | SLOT( setInfoFields(QListViewItem*) ) ); | 197 | SLOT( setInfoFields(QListViewItem*) ) ); |
178 | 198 | ||
179 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 199 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
180 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 200 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
181 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 201 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
182 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 202 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
183 | //mailView->setMultiSelection ( true ); | 203 | //mailView->setMultiSelection ( true ); |
184 | mailView->setSelectionMode( QListView::Extended ); | 204 | mailView->setSelectionMode( QListView::Extended ); |
185 | QValueList<int> list; | 205 | QValueList<int> list; |
186 | int fw = 100; | 206 | int fw = 100; |
187 | if ( QApplication::desktop()->width() > 320 ) | 207 | if ( QApplication::desktop()->width() > 320 ) |
188 | fw = 50; | 208 | fw = 50; |
189 | list.append( fw ); | 209 | list.append( fw ); |
190 | list.append( 100 ); | 210 | list.append( 100 ); |
191 | split->setSizes( list ); | 211 | split->setSizes( list ); |
192 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 212 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
193 | mailView->setShowSortIndicator ( true ); | 213 | mailView->setShowSortIndicator ( true ); |
194 | QLabel *spacer = new QLabel( toolBar ); | 214 | QLabel *spacer = new QLabel( toolBar ); |
195 | spacer->setBackgroundMode( QWidget::PaletteButton ); | 215 | spacer->setBackgroundMode( QWidget::PaletteButton ); |
196 | toolBar->setStretchableWidget( spacer ); | 216 | toolBar->setStretchableWidget( spacer ); |
197 | 217 | ||
198 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); | 218 | QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this); |
199 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); | 219 | connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); |
200 | if ( QApplication::desktop()->width() > 320 ) | 220 | if ( QApplication::desktop()->width() > 320 ) |
201 | closeMail->addTo(toolBar); | 221 | closeMail->addTo(toolBar); |
202 | closeMail->addTo(mailMenu); | 222 | closeMail->addTo(mailMenu); |
203 | 223 | ||
204 | 224 | ||
205 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); | 225 | QPopupMenu* helpMenu = new QPopupMenu( menuBar ); |
206 | menuBar->insertItem( i18n( "Help" ), helpMenu ); | 226 | menuBar->insertItem( i18n( "Help" ), helpMenu ); |
207 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); | 227 | QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this); |
208 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); | 228 | connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); |
209 | li->addTo(helpMenu); | 229 | li->addTo(helpMenu); |
210 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); | 230 | li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this); |
211 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); | 231 | connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); |
212 | li->addTo(helpMenu); | 232 | li->addTo(helpMenu); |
213 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); | 233 | li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this); |
214 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); | 234 | connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); |
215 | li->addTo(helpMenu); | 235 | li->addTo(helpMenu); |
216 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); | 236 | connect( codecMenu, SIGNAL( activated(int) ), this, SLOT( slotSetCodec( int )) ); |
217 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 237 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
218 | #ifdef DESKTOP_VERSION | 238 | #ifdef DESKTOP_VERSION |
219 | resize ( 640, 480 ); | 239 | resize ( 640, 480 ); |
220 | #endif | 240 | #endif |
221 | } | 241 | } |
222 | 242 | ||
223 | MainWindow::~MainWindow() | 243 | MainWindow::~MainWindow() |
224 | { | 244 | { |
225 | } | 245 | } |
226 | 246 | ||
227 | void MainWindow::setInfoFields(QListViewItem* item ) | 247 | void MainWindow::setInfoFields(QListViewItem* item ) |
228 | { | 248 | { |
229 | if ( item == 0) { | 249 | if ( item == 0) { |
230 | subLE->setText(""); | 250 | if ( subLE ) subLE->setText(""); |
231 | fromLE->setText(""); | 251 | if ( fromLE ) fromLE->setText(""); |
232 | toLE->setText(""); | 252 | if ( toLE ) toLE->setText(""); |
233 | return; | 253 | return; |
234 | } | 254 | } |
235 | RecMailP mail = ((MailListViewItem*)item)->data(); | 255 | RecMailP mail = ((MailListViewItem*)item)->data(); |
236 | subLE->setText(mail->getSubject()); | 256 | if ( subLE ) subLE->setText(mail->getSubject()); |
237 | fromLE->setText(mail->getFrom()); | 257 | if ( fromLE ) fromLE->setText(mail->getFrom()); |
238 | toLE->setText(mail->To().join(";" )); | 258 | if ( toLE ) toLE->setText(mail->To().join(";" )); |
239 | subLE->setCursorPosition(0); | 259 | if ( subLE ) subLE->setCursorPosition(0); |
240 | fromLE->setCursorPosition(0); | 260 | if ( fromLE ) fromLE->setCursorPosition(0); |
241 | toLE->setCursorPosition(0); | 261 | if ( toLE ) toLE->setCursorPosition(0); |
242 | 262 | ||
243 | } | 263 | } |
244 | void MainWindow::slotSetCodec( int codec ) | 264 | void MainWindow::slotSetCodec( int codec ) |
245 | { | 265 | { |
246 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); | 266 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false ); |
247 | //qDebug("codec %d ", codec); | 267 | //qDebug("codec %d ", codec); |
248 | KOPrefs::instance()->mCurrentCodec = codec; | 268 | KOPrefs::instance()->mCurrentCodec = codec; |
249 | KOPrefs::instance()->isDirty = true; | 269 | KOPrefs::instance()->isDirty = true; |
250 | QString name; | 270 | QString name; |
251 | switch ( codec ) { | 271 | switch ( codec ) { |
252 | case 0: | 272 | case 0: |
253 | name = "iso-8859-1"; | 273 | name = "iso-8859-1"; |
254 | break; | 274 | break; |
255 | case 1: | 275 | case 1: |
256 | name = "iso-8859-5"; | 276 | name = "iso-8859-5"; |
257 | break; | 277 | break; |
258 | case 2: | 278 | case 2: |
259 | name = "iso-8859-15"; | 279 | name = "iso-8859-15"; |
260 | break; | 280 | break; |
261 | case 3: | 281 | case 3: |
262 | name = "big-5"; | 282 | name = "big-5"; |
263 | break; | 283 | break; |
264 | case 4: | 284 | case 4: |
265 | name = "utf-8"; | 285 | name = "utf-8"; |
266 | break; | 286 | break; |
267 | case 5: | 287 | case 5: |
268 | name = KOPrefs::instance()->mSendCodec.lower(); | 288 | name = KOPrefs::instance()->mSendCodec.lower(); |
269 | break; | 289 | break; |
270 | } | 290 | } |
271 | KOPrefs::instance()->mCurrentCodeName = name ; | 291 | KOPrefs::instance()->mCurrentCodeName = name ; |
272 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); | 292 | codecMenu->changeItem ( 5, "Userdefined ("+KOPrefs::instance()->mSendCodec+")"); |
273 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); | 293 | codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, true ); |
274 | } | 294 | } |
275 | void MainWindow::showLicence() | 295 | void MainWindow::showLicence() |
276 | { | 296 | { |
277 | KApplication::showLicence(); | 297 | KApplication::showLicence(); |
278 | } | 298 | } |
279 | void MainWindow::showAbout() | 299 | void MainWindow::showAbout() |
280 | { | 300 | { |
281 | QString version; | 301 | QString version; |
282 | #include <../version> | 302 | #include <../version> |
283 | 303 | ||
284 | QString cap = "About KOpieMail/Pi"; | 304 | QString cap = "About KOpieMail/Pi"; |
285 | QString text =i18n("KOpieMail/Platform-independent\n") + | 305 | QString text =i18n("KOpieMail/Platform-independent\n") + |
286 | "(OM/Pi) " + version + " - " | 306 | "(OM/Pi) " + version + " - " |
287 | 307 | ||
288 | #ifdef DESKTOP_VERSION | 308 | #ifdef DESKTOP_VERSION |
289 | "Desktop Edition\n" | 309 | "Desktop Edition\n" |
290 | #else | 310 | #else |
291 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" | 311 | "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" |
292 | #endif | 312 | #endif |
293 | "www.pi-sync.net\n\n" | 313 | "www.pi-sync.net\n\n" |
294 | 314 | ||
295 | 315 | ||
296 | 316 | ||
297 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" | 317 | "Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" |
298 | "KOpieMail/Pi is based on Opie Mail\n" | 318 | "KOpieMail/Pi is based on Opie Mail\n" |
299 | "Copyright (c) Rajko Albrecht and the Opie team\n" | 319 | "Copyright (c) Rajko Albrecht and the Opie team\n" |
300 | "KOpieMail/Pi is licensed under the GPL\n" | 320 | "KOpieMail/Pi is licensed under the GPL\n" |
301 | "\n" | 321 | "\n" |
302 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" | 322 | "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" |
303 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" | 323 | "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" |
304 | "libEtPan has its own licence - see LibEtPan licence\n"; | 324 | "libEtPan has its own licence - see LibEtPan licence\n"; |
305 | 325 | ||
306 | KApplication::showText( cap, text ); | 326 | KApplication::showText( cap, text ); |
307 | } | 327 | } |
308 | void MainWindow::showEtpanLicence() | 328 | void MainWindow::showEtpanLicence() |
309 | { | 329 | { |
310 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); | 330 | KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); |
311 | 331 | ||
312 | } | 332 | } |
313 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 333 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
314 | { | 334 | { |
315 | qDebug("appMessage implemented by subclass"); | 335 | qDebug("appMessage implemented by subclass"); |
316 | } | 336 | } |
317 | 337 | ||
318 | void MainWindow::slotAdjustLayout() { | 338 | void MainWindow::slotAdjustLayout() { |
319 | 339 | ||
320 | /* | 340 | /* |
321 | QWidget *d = QApplication::desktop(); | 341 | QWidget *d = QApplication::desktop(); |
322 | 342 | ||
323 | if ( d->width() < d->height() ) { | 343 | if ( d->width() < d->height() ) { |
324 | layout->setDirection( QBoxLayout::TopToBottom ); | 344 | layout->setDirection( QBoxLayout::TopToBottom ); |
325 | } else { | 345 | } else { |
326 | layout->setDirection( QBoxLayout::LeftToRight ); | 346 | layout->setDirection( QBoxLayout::LeftToRight ); |
327 | } | 347 | } |
328 | */ | 348 | */ |
329 | } | 349 | } |
330 | 350 | ||
331 | void MainWindow::slotAdjustColumns() | 351 | void MainWindow::slotAdjustColumns() |
332 | { | 352 | { |
333 | bool hidden = folderView->isHidden(); | 353 | bool hidden = folderView->isHidden(); |
334 | if ( hidden ) folderView->show(); | 354 | if ( hidden ) folderView->show(); |
335 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 355 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
336 | if ( hidden ) folderView->hide(); | 356 | if ( hidden ) folderView->hide(); |
337 | 357 | ||
338 | mailView->setColumnWidth( 0, 10 ); | 358 | mailView->setColumnWidth( 0, 10 ); |
339 | mailView->setColumnWidth( 1, 100 ); | 359 | mailView->setColumnWidth( 1, 100 ); |
340 | mailView->setColumnWidth( 2, 100 ); | 360 | mailView->setColumnWidth( 2, 100 ); |
341 | mailView->setColumnWidth( 3, 50 ); | 361 | mailView->setColumnWidth( 3, 50 ); |
342 | mailView->setColumnWidth( 4, 120 ); | 362 | mailView->setColumnWidth( 4, 120 ); |
343 | if ( KOPrefs::instance()->mShowToField ) | 363 | if ( KOPrefs::instance()->mShowToField ) |
344 | mailView->setColumnWidth( 5, 100 ); | 364 | mailView->setColumnWidth( 5, 100 ); |
345 | } | 365 | } |
346 | 366 | ||
347 | void MainWindow::slotEditSettings() | 367 | void MainWindow::slotEditSettings() |
348 | { | 368 | { |
349 | } | 369 | } |
350 | 370 | ||
351 | void MainWindow::slotShowFolders( bool ) | 371 | void MainWindow::slotShowFolders( bool ) |
352 | { | 372 | { |
353 | qDebug("not implemented: "); | 373 | qDebug("not implemented: "); |
354 | } | 374 | } |
355 | 375 | ||
356 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 376 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
357 | { | 377 | { |
358 | qDebug("not implemented: "); | 378 | qDebug("not implemented: "); |
359 | } | 379 | } |
360 | 380 | ||
361 | void MainWindow::mailLeftClicked(QListViewItem * ) | 381 | void MainWindow::mailLeftClicked(QListViewItem * ) |
362 | { | 382 | { |
363 | qDebug("not implemented: "); | 383 | qDebug("not implemented: "); |
364 | } | 384 | } |
365 | 385 | ||
366 | void MainWindow::displayMail() | 386 | void MainWindow::displayMail() |
367 | { | 387 | { |
368 | qDebug("not implemented: "); | 388 | qDebug("not implemented: "); |
369 | } | 389 | } |
370 | 390 | ||
371 | void MainWindow::slotDeleteMail() | 391 | void MainWindow::slotDeleteMail() |
372 | { | 392 | { |
373 | qDebug("not implemented: "); | 393 | qDebug("not implemented: "); |
374 | } | 394 | } |
375 | 395 | ||
376 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 396 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
377 | { | 397 | { |
378 | qDebug("not implemented: "); | 398 | qDebug("not implemented: "); |
379 | } | 399 | } |
380 | 400 | ||
381 | void MainWindow::slotSendQueued() | 401 | void MainWindow::slotSendQueued() |
382 | { | 402 | { |
383 | qDebug("not implemented: "); | 403 | qDebug("not implemented: "); |
384 | } | 404 | } |
385 | 405 | ||
386 | void MainWindow::slotEditAccounts() | 406 | void MainWindow::slotEditAccounts() |
387 | { | 407 | { |
388 | qDebug("not implemented: "); | 408 | qDebug("not implemented: "); |
389 | } | 409 | } |
390 | 410 | ||
391 | void MainWindow::slotComposeMail() | 411 | void MainWindow::slotComposeMail() |
392 | { | 412 | { |
393 | qDebug("not implemented: "); | 413 | qDebug("not implemented: "); |
394 | } | 414 | } |
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 68f0eb3..f56711d 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp | |||
@@ -1,640 +1,641 @@ | |||
1 | // CHANGED 2004-09-31 Lutz Rogowski | 1 | // CHANGED 2004-09-31 Lutz Rogowski |
2 | // CHANGED 2004-08-06 Lutz Rogowski | 2 | // CHANGED 2004-08-06 Lutz Rogowski |
3 | 3 | ||
4 | 4 | ||
5 | #define protected public | 5 | #define protected public |
6 | #include <qwidget.h> | 6 | #include <qwidget.h> |
7 | #undef protected | 7 | #undef protected |
8 | #include "koprefsdialog.h" | 8 | #include "koprefsdialog.h" |
9 | #include <kapplication.h> | 9 | #include <kapplication.h> |
10 | #include <libkdepim/externalapphandler.h> | 10 | #include <libkdepim/externalapphandler.h> |
11 | #include <libkdepim/kpimglobalprefs.h> | 11 | #include <libkdepim/kpimglobalprefs.h> |
12 | #ifdef MINIKDE_KDIALOG_H | 12 | #ifdef MINIKDE_KDIALOG_H |
13 | #undef MINIKDE_KDIALOG_H | 13 | #undef MINIKDE_KDIALOG_H |
14 | #endif | 14 | #endif |
15 | #include "settingsdialog.h" | 15 | #include "settingsdialog.h" |
16 | #include "opiemail.h" | 16 | #include "opiemail.h" |
17 | #include "editaccounts.h" | 17 | #include "editaccounts.h" |
18 | #include "composemail.h" | 18 | #include "composemail.h" |
19 | #include "mailistviewitem.h" | 19 | #include "mailistviewitem.h" |
20 | #include "viewmail.h" | 20 | #include "viewmail.h" |
21 | #include "selectstore.h" | 21 | #include "selectstore.h" |
22 | #include "selectsmtp.h" | 22 | #include "selectsmtp.h" |
23 | #include "accountitem.h" | 23 | #include "accountitem.h" |
24 | #include "accountview.h" | 24 | #include "accountview.h" |
25 | #include "klocale.h" | 25 | #include "klocale.h" |
26 | 26 | ||
27 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qcursor.h> | 29 | #include <qcursor.h> |
30 | #include <qtextbrowser.h> | 30 | #include <qtextbrowser.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | #include <qpe/global.h> | 32 | #include <qpe/global.h> |
33 | 33 | ||
34 | #ifdef DESKTOP_VERSION | 34 | #ifdef DESKTOP_VERSION |
35 | #include <qapplication.h> | 35 | #include <qapplication.h> |
36 | #else | 36 | #else |
37 | #include <qpe/qpeapplication.h> | 37 | #include <qpe/qpeapplication.h> |
38 | #endif | 38 | #endif |
39 | #include <libmailwrapper/smtpwrapper.h> | 39 | #include <libmailwrapper/smtpwrapper.h> |
40 | #include <libmailwrapper/mailtypes.h> | 40 | #include <libmailwrapper/mailtypes.h> |
41 | #include <libmailwrapper/abstractmail.h> | 41 | #include <libmailwrapper/abstractmail.h> |
42 | #include "koprefs.h" | 42 | #include "koprefs.h" |
43 | 43 | ||
44 | //using namespace Opie::Core; | 44 | //using namespace Opie::Core; |
45 | 45 | ||
46 | OpieMail::OpieMail( QWidget *parent, const char *name ) | 46 | OpieMail::OpieMail( QWidget *parent, const char *name ) |
47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) | 47 | : MainWindow( parent, name) //, WStyle_ContextHelp ) |
48 | { | 48 | { |
49 | settings = new Settings(); | 49 | settings = new Settings(); |
50 | tb = 0; | 50 | tb = 0; |
51 | setIcon(SmallIcon( "kmicromail" ) ); | 51 | setIcon(SmallIcon( "kmicromail" ) ); |
52 | folderView->populate( settings->getAccounts() ); | 52 | folderView->populate( settings->getAccounts() ); |
53 | 53 | ||
54 | } | 54 | } |
55 | 55 | ||
56 | OpieMail::~OpieMail() | 56 | OpieMail::~OpieMail() |
57 | { | 57 | { |
58 | if (settings) delete settings; | 58 | if (settings) delete settings; |
59 | if ( tb ) | 59 | if ( tb ) |
60 | delete tb; | 60 | delete tb; |
61 | } | 61 | } |
62 | 62 | ||
63 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | 63 | void OpieMail::appMessage(const QCString &msg, const QByteArray &data) |
64 | { | 64 | { |
65 | 65 | ||
66 | } | 66 | } |
67 | #include <stdlib.h> | 67 | #include <stdlib.h> |
68 | void OpieMail::message(const QCString &msg, const QByteArray &data) | 68 | void OpieMail::message(const QCString &msg, const QByteArray &data) |
69 | { | 69 | { |
70 | // copied from old mail2 | 70 | // copied from old mail2 |
71 | static int ii = 0; | 71 | static int ii = 0; |
72 | //qDebug("QCOP CALL ############################# %d ", ii); | 72 | //qDebug("QCOP CALL ############################# %d ", ii); |
73 | //QString mess ( msg ); | 73 | //QString mess ( msg ); |
74 | //qDebug("Message = %s ",mess.latin1()); | 74 | //qDebug("Message = %s ",mess.latin1()); |
75 | ++ii; | 75 | ++ii; |
76 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); | 76 | //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); |
77 | 77 | ||
78 | mPendingEmail = QString::null; | 78 | mPendingEmail = QString::null; |
79 | mPendingName = QString::null; | 79 | mPendingName = QString::null; |
80 | if (msg == "writeMail(QString,QString)") | 80 | if (msg == "writeMail(QString,QString)") |
81 | { | 81 | { |
82 | //qDebug("writeMail(QString,QString) "); | 82 | //qDebug("writeMail(QString,QString) "); |
83 | QDataStream stream(data,IO_ReadOnly); | 83 | QDataStream stream(data,IO_ReadOnly); |
84 | stream >> mPendingName >> mPendingEmail; | 84 | stream >> mPendingName >> mPendingEmail; |
85 | // removing the whitespaces at beginning and end is needed! | 85 | // removing the whitespaces at beginning and end is needed! |
86 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 86 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
87 | } | 87 | } |
88 | else if (msg == "newMail()") | 88 | else if (msg == "newMail()") |
89 | { | 89 | { |
90 | //qDebug("slotComposeMail() "); | 90 | //qDebug("slotComposeMail() "); |
91 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call | 91 | // we cannot call slotComposeMail(); directly, because may be executing a QCOP call |
92 | // and a QCOP call does not like a processevents in his execution | 92 | // and a QCOP call does not like a processevents in his execution |
93 | // with the Qtimer we call slotComposeMail() after we reached the main event loop | 93 | // with the Qtimer we call slotComposeMail() after we reached the main event loop |
94 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 94 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
95 | // slotComposeMail(); | 95 | // slotComposeMail(); |
96 | } | 96 | } |
97 | else if (msg == "newMail(QString)") | 97 | else if (msg == "newMail(QString)") |
98 | { | 98 | { |
99 | //qDebug(" newMail(QString)"); | 99 | //qDebug(" newMail(QString)"); |
100 | QDataStream stream(data,IO_ReadOnly); | 100 | QDataStream stream(data,IO_ReadOnly); |
101 | stream >> mPendingName; | 101 | stream >> mPendingName; |
102 | // the format is | 102 | // the format is |
103 | // NAME <EMAIL>:SUBJECT | 103 | // NAME <EMAIL>:SUBJECT |
104 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); | 104 | QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); |
105 | } else { | 105 | } else { |
106 | mPendingData = data; | 106 | mPendingData = data; |
107 | mPendingMessage = msg; | 107 | mPendingMessage = msg; |
108 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); | 108 | QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); |
109 | } | 109 | } |
110 | 110 | ||
111 | //qDebug("END OpieMail::message "); | 111 | //qDebug("END OpieMail::message "); |
112 | } | 112 | } |
113 | void OpieMail::slotExtAppHandler() | 113 | void OpieMail::slotExtAppHandler() |
114 | { | 114 | { |
115 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); | 115 | ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); |
116 | } | 116 | } |
117 | void OpieMail::slotwriteMail2(const QString& namemail ) | 117 | void OpieMail::slotwriteMail2(const QString& namemail ) |
118 | { | 118 | { |
119 | //qDebug("OpieMail::slotwriteMail2 "); | 119 | //qDebug("OpieMail::slotwriteMail2 "); |
120 | //qApp->processEvents(); | 120 | //qApp->processEvents(); |
121 | ComposeMail compose( settings, this, 0, true ); | 121 | ComposeMail compose( settings, this, 0, true ); |
122 | if ( !namemail.isEmpty() ) { | 122 | if ( !namemail.isEmpty() ) { |
123 | QString to = namemail; | 123 | QString to = namemail; |
124 | if ( namemail.find( " <") > 1 ) { | 124 | if ( namemail.find( " <") > 1 ) { |
125 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; | 125 | to = "\"" +to.replace( QRegExp( " <"), "\" <") ; |
126 | } else | 126 | } else |
127 | if ( namemail.find( "<") > 1 ) { | 127 | if ( namemail.find( "<") > 1 ) { |
128 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; | 128 | to = "\"" +to.replace( QRegExp( "<"), "\" <") ; |
129 | } | 129 | } |
130 | int sub = to.find( ">:"); | 130 | int sub = to.find( ">:"); |
131 | if ( sub > 0 ) { | 131 | if ( sub > 0 ) { |
132 | compose.setTo( to.left(sub+1) ); | 132 | compose.setTo( to.left(sub+1) ); |
133 | compose.setSubject( to.mid(sub+2) ); | 133 | compose.setSubject( to.mid(sub+2) ); |
134 | } else | 134 | } else |
135 | compose.setTo( to ); | 135 | compose.setTo( to ); |
136 | } | 136 | } |
137 | compose.slotAdjustColumns(); | 137 | compose.slotAdjustColumns(); |
138 | #ifndef DESKTOP_VERSION | 138 | #ifndef DESKTOP_VERSION |
139 | compose.showMaximized(); | 139 | compose.showMaximized(); |
140 | #endif | 140 | #endif |
141 | compose.exec(); | 141 | compose.exec(); |
142 | raise(); | 142 | raise(); |
143 | //qDebug("retttich "); | 143 | //qDebug("retttich "); |
144 | } | 144 | } |
145 | void OpieMail::slotwriteMail(const QString&name,const QString&email) | 145 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
146 | { | 146 | { |
147 | // qDebug("OpieMail::slotwriteMail "); | 147 | // qDebug("OpieMail::slotwriteMail "); |
148 | ComposeMail compose( settings, this, 0, true ); | 148 | ComposeMail compose( settings, this, 0, true ); |
149 | if (!email.isEmpty()) | 149 | if (!email.isEmpty()) |
150 | { | 150 | { |
151 | if (!name.isEmpty()) | 151 | if (!name.isEmpty()) |
152 | { | 152 | { |
153 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | 153 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); |
154 | } | 154 | } |
155 | else | 155 | else |
156 | { | 156 | { |
157 | compose.setTo(email); | 157 | compose.setTo(email); |
158 | } | 158 | } |
159 | } | 159 | } |
160 | compose.slotAdjustColumns(); | 160 | compose.slotAdjustColumns(); |
161 | #ifndef DESKTOP_VERSION | 161 | #ifndef DESKTOP_VERSION |
162 | compose.showMaximized(); | 162 | compose.showMaximized(); |
163 | #endif | 163 | #endif |
164 | compose.exec(); | 164 | compose.exec(); |
165 | raise(); | 165 | raise(); |
166 | } | 166 | } |
167 | 167 | ||
168 | void OpieMail::slotComposeMail() | 168 | void OpieMail::slotComposeMail() |
169 | { | 169 | { |
170 | if ( mPendingEmail == QString::null && mPendingName == QString::null) | 170 | if ( mPendingEmail == QString::null && mPendingName == QString::null) |
171 | slotwriteMail2( QString () ); | 171 | slotwriteMail2( QString () ); |
172 | else { | 172 | else { |
173 | if ( mPendingEmail == QString::null ) | 173 | if ( mPendingEmail == QString::null ) |
174 | slotwriteMail2( mPendingName ); | 174 | slotwriteMail2( mPendingName ); |
175 | else | 175 | else |
176 | slotwriteMail( mPendingName, mPendingEmail ); | 176 | slotwriteMail( mPendingName, mPendingEmail ); |
177 | } | 177 | } |
178 | //slotwriteMail(0l,0l); | 178 | //slotwriteMail(0l,0l); |
179 | } | 179 | } |
180 | 180 | ||
181 | void OpieMail::slotSendQueued() | 181 | void OpieMail::slotSendQueued() |
182 | { | 182 | { |
183 | SMTPaccount *smtp = 0; | 183 | SMTPaccount *smtp = 0; |
184 | 184 | ||
185 | QList<Account> list = settings->getAccounts(); | 185 | QList<Account> list = settings->getAccounts(); |
186 | QList<SMTPaccount> smtpList; | 186 | QList<SMTPaccount> smtpList; |
187 | smtpList.setAutoDelete(false); | 187 | smtpList.setAutoDelete(false); |
188 | Account *it; | 188 | Account *it; |
189 | for ( it = list.first(); it; it = list.next() ) | 189 | for ( it = list.first(); it; it = list.next() ) |
190 | { | 190 | { |
191 | if ( it->getType() == MAILLIB::A_SMTP ) | 191 | if ( it->getType() == MAILLIB::A_SMTP ) |
192 | { | 192 | { |
193 | smtp = static_cast<SMTPaccount *>(it); | 193 | smtp = static_cast<SMTPaccount *>(it); |
194 | smtpList.append(smtp); | 194 | smtpList.append(smtp); |
195 | } | 195 | } |
196 | } | 196 | } |
197 | if (smtpList.count()==0) | 197 | if (smtpList.count()==0) |
198 | { | 198 | { |
199 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); | 199 | QMessageBox::information(0,i18n("Info"),i18n("Define a smtp account first!\n")); |
200 | return; | 200 | return; |
201 | } | 201 | } |
202 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) | 202 | if ( QMessageBox::warning(this, i18n("Sending all mails"), i18n("Do you really want to send\nall queued mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) |
203 | return; | 203 | return; |
204 | if (smtpList.count()==1) | 204 | if (smtpList.count()==1) |
205 | { | 205 | { |
206 | smtp = smtpList.at(0); | 206 | smtp = smtpList.at(0); |
207 | } | 207 | } |
208 | else | 208 | else |
209 | { | 209 | { |
210 | smtp = 0; | 210 | smtp = 0; |
211 | selectsmtp selsmtp; | 211 | selectsmtp selsmtp; |
212 | selsmtp.setSelectionlist(&smtpList); | 212 | selsmtp.setSelectionlist(&smtpList); |
213 | #ifndef DESKTOP_VERSION | 213 | #ifndef DESKTOP_VERSION |
214 | selsmtp.showMaximized(); | 214 | selsmtp.showMaximized(); |
215 | #endif | 215 | #endif |
216 | if ( selsmtp.exec() == QDialog::Accepted ) | 216 | if ( selsmtp.exec() == QDialog::Accepted ) |
217 | { | 217 | { |
218 | smtp = selsmtp.selected_smtp(); | 218 | smtp = selsmtp.selected_smtp(); |
219 | } | 219 | } |
220 | } | 220 | } |
221 | if (smtp) | 221 | if (smtp) |
222 | { | 222 | { |
223 | 223 | ||
224 | Global::statusMessage("Sending mails...!"); | 224 | Global::statusMessage("Sending mails...!"); |
225 | SMTPwrapper * wrap = new SMTPwrapper(smtp); | 225 | SMTPwrapper * wrap = new SMTPwrapper(smtp); |
226 | if ( wrap->flushOutbox() ) | 226 | if ( wrap->flushOutbox() ) |
227 | { | 227 | { |
228 | Global::statusMessage("Mails sent!"); | 228 | Global::statusMessage("Mails sent!"); |
229 | } | 229 | } |
230 | delete wrap; | 230 | delete wrap; |
231 | } | 231 | } |
232 | // pending refresh list view, if outgoing is displayed | 232 | // pending refresh list view, if outgoing is displayed |
233 | } | 233 | } |
234 | 234 | ||
235 | void OpieMail::slotSearchMails() | 235 | void OpieMail::slotSearchMails() |
236 | { | 236 | { |
237 | qDebug("OpieMail::slotSearchMails():not implemented "); | 237 | qDebug("OpieMail::slotSearchMails():not implemented "); |
238 | } | 238 | } |
239 | 239 | ||
240 | void OpieMail::slotEditSettings() | 240 | void OpieMail::slotEditSettings() |
241 | { | 241 | { |
242 | 242 | ||
243 | KOPrefsDialog settingsDialog( this, "koprefs", true ); | 243 | KOPrefsDialog settingsDialog( this, "koprefs", true ); |
244 | #ifndef DESKTOP_VERSION | 244 | #ifndef DESKTOP_VERSION |
245 | settingsDialog.showMaximized(); | 245 | settingsDialog.showMaximized(); |
246 | #endif | 246 | #endif |
247 | settingsDialog.exec(); | 247 | settingsDialog.exec(); |
248 | 248 | ||
249 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); | 249 | slotSetCodec( KOPrefs::instance()->mCurrentCodec ); |
250 | // KApplication::execDialog(settingsDialog); | 250 | // KApplication::execDialog(settingsDialog); |
251 | } | 251 | } |
252 | 252 | ||
253 | void OpieMail::slotEditAccounts() | 253 | void OpieMail::slotEditAccounts() |
254 | { | 254 | { |
255 | EditAccounts eaDialog( settings, this, 0, true ); | 255 | EditAccounts eaDialog( settings, this, 0, true ); |
256 | eaDialog.slotAdjustColumns(); | 256 | eaDialog.slotAdjustColumns(); |
257 | #ifndef DESKTOP_VERSION | 257 | #ifndef DESKTOP_VERSION |
258 | eaDialog.showMaximized(); | 258 | eaDialog.showMaximized(); |
259 | #endif | 259 | #endif |
260 | eaDialog.exec(); | 260 | eaDialog.exec(); |
261 | if ( settings ) delete settings; | 261 | if ( settings ) delete settings; |
262 | settings = new Settings(); | 262 | settings = new Settings(); |
263 | 263 | ||
264 | folderView->populate( settings->getAccounts() ); | 264 | folderView->populate( settings->getAccounts() ); |
265 | } | 265 | } |
266 | void OpieMail::replyMail() | 266 | void OpieMail::replyMail() |
267 | { | 267 | { |
268 | 268 | ||
269 | QListViewItem*item = mailView->currentItem(); | 269 | QListViewItem*item = mailView->currentItem(); |
270 | if (!item) return; | 270 | if (!item) return; |
271 | RecMailP mail = ((MailListViewItem*)item)->data(); | 271 | RecMailP mail = ((MailListViewItem*)item)->data(); |
272 | RecBodyP body = folderView->fetchBody(mail); | 272 | RecBodyP body = folderView->fetchBody(mail); |
273 | 273 | ||
274 | QString rtext; | 274 | QString rtext; |
275 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose | 275 | rtext += QString("* %1 wrote on %2:\n") // no i18n on purpose |
276 | .arg( mail->getFrom()) | 276 | .arg( mail->getFrom()) |
277 | .arg( mail->getDate()); | 277 | .arg( mail->getDate()); |
278 | 278 | ||
279 | QString text = body->Bodytext(); | 279 | QString text = body->Bodytext(); |
280 | QStringList lines = QStringList::split(QRegExp("\\n"), text); | 280 | QStringList lines = QStringList::split(QRegExp("\\n"), text); |
281 | QStringList::Iterator it; | 281 | QStringList::Iterator it; |
282 | for (it = lines.begin(); it != lines.end(); it++) | 282 | for (it = lines.begin(); it != lines.end(); it++) |
283 | { | 283 | { |
284 | rtext += "> " + *it + "\n"; | 284 | rtext += "> " + *it + "\n"; |
285 | } | 285 | } |
286 | rtext += "\n"; | 286 | rtext += "\n"; |
287 | 287 | ||
288 | QString prefix; | 288 | QString prefix; |
289 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; | 289 | if ( mail->getSubject().find(QRegExp("^Re: .*$")) != -1) prefix = ""; |
290 | else prefix = "Re: "; // no i18n on purpose | 290 | else prefix = "Re: "; // no i18n on purpose |
291 | 291 | ||
292 | Settings *settings = new Settings(); | 292 | Settings *settings = new Settings(); |
293 | ComposeMail composer( settings ,this, 0, true); | 293 | ComposeMail composer( settings ,this, 0, true); |
294 | if (mail->Replyto().isEmpty()) { | 294 | if (mail->Replyto().isEmpty()) { |
295 | composer.setTo( mail->getFrom()); | 295 | composer.setTo( mail->getFrom()); |
296 | } else { | 296 | } else { |
297 | composer.setTo( mail->Replyto()); | 297 | composer.setTo( mail->Replyto()); |
298 | } | 298 | } |
299 | composer.setSubject( prefix + mail->getSubject()); | 299 | composer.setSubject( prefix + mail->getSubject()); |
300 | composer.setMessage( rtext ); | 300 | composer.setMessage( rtext ); |
301 | composer.setInReplyTo( mail->Msgid()); | 301 | composer.setInReplyTo( mail->Msgid()); |
302 | composer.setCharset( body->getCharset() ); | 302 | composer.setCharset( body->getCharset() ); |
303 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) | 303 | if ( QDialog::Accepted == KApplication::execDialog( &composer ) ) |
304 | { | 304 | { |
305 | mail->Wrapper()->answeredMail(mail); | 305 | mail->Wrapper()->answeredMail(mail); |
306 | } | 306 | } |
307 | delete settings; | 307 | delete settings; |
308 | 308 | ||
309 | } | 309 | } |
310 | void OpieMail::closeViewMail(ViewMail * vm) | 310 | void OpieMail::closeViewMail(ViewMail * vm) |
311 | { | 311 | { |
312 | vm->hide(); | 312 | vm->hide(); |
313 | } | 313 | } |
314 | 314 | ||
315 | void OpieMail::slotDownloadMail( ) | 315 | void OpieMail::slotDownloadMail( ) |
316 | { | 316 | { |
317 | QListViewItem*item = mailView->currentItem(); | 317 | QListViewItem*item = mailView->currentItem(); |
318 | if (!item ) { | 318 | if (!item ) { |
319 | Global::statusMessage("Error: No item slected!"); | 319 | Global::statusMessage("Error: No item slected!"); |
320 | return; | 320 | return; |
321 | } | 321 | } |
322 | RecMailP mail = ((MailListViewItem*)item)->data(); | 322 | RecMailP mail = ((MailListViewItem*)item)->data(); |
323 | Account * acc = mail->Wrapper()->getAccount(); | 323 | Account * acc = mail->Wrapper()->getAccount(); |
324 | if ( !acc ) { | 324 | if ( !acc ) { |
325 | Global::statusMessage("Mail is already stored locally!"); | 325 | Global::statusMessage("Mail is already stored locally!"); |
326 | return; | 326 | return; |
327 | } | 327 | } |
328 | QString lfName = acc->getLocalFolder(); | 328 | QString lfName = acc->getLocalFolder(); |
329 | //qDebug("local folder " + lfName ); | 329 | //qDebug("local folder " + lfName ); |
330 | if ( lfName.isEmpty() ) | 330 | if ( lfName.isEmpty() ) |
331 | lfName = acc->getAccountName(); | 331 | lfName = acc->getAccountName(); |
332 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); | 332 | AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper(); |
333 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); | 333 | //qDebug("target %d %d ",targetMail,mail->Wrapper() ); |
334 | if ( targetMail == mail->Wrapper() ) { | 334 | if ( targetMail == mail->Wrapper() ) { |
335 | Global::statusMessage("Mail is already locally stored!"); | 335 | Global::statusMessage("Mail is already locally stored!"); |
336 | return; | 336 | return; |
337 | } | 337 | } |
338 | if ( !targetMail->createMbox(lfName)) { | 338 | if ( !targetMail->createMbox(lfName)) { |
339 | Global::statusMessage("Error creating folder!"); | 339 | Global::statusMessage("Error creating folder!"); |
340 | return; | 340 | return; |
341 | } | 341 | } |
342 | Global::statusMessage("Fetching mail...please wait!"); | 342 | Global::statusMessage("Fetching mail...please wait!"); |
343 | qApp->processEvents(); | 343 | qApp->processEvents(); |
344 | encodedString*st = 0; | 344 | encodedString*st = 0; |
345 | st = mail->Wrapper()->fetchRawBody(mail); | 345 | st = mail->Wrapper()->fetchRawBody(mail); |
346 | if ( st ) { | 346 | if ( st ) { |
347 | targetMail->storeMessage(st->Content(),st->Length(),lfName); | 347 | targetMail->storeMessage(st->Content(),st->Length(),lfName); |
348 | Global::statusMessage("Mail stored in "+ lfName); | 348 | Global::statusMessage("Mail stored in "+ lfName); |
349 | delete st; | 349 | delete st; |
350 | } else { | 350 | } else { |
351 | Global::statusMessage("Error: Cannot fetch mail!"); | 351 | Global::statusMessage("Error: Cannot fetch mail!"); |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | 355 | ||
356 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) | 356 | void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) |
357 | { | 357 | { |
358 | QListViewItem*item = mailView->currentItem(); | 358 | QListViewItem*item = mailView->currentItem(); |
359 | if (!item ) { | 359 | if (!item ) { |
360 | closeViewMail(vm); | 360 | closeViewMail(vm); |
361 | return; | 361 | return; |
362 | } | 362 | } |
363 | RecMailP mail = ((MailListViewItem*)item)->data(); | 363 | RecMailP mail = ((MailListViewItem*)item)->data(); |
364 | mail->Wrapper()->deleteMail( mail ); | 364 | mail->Wrapper()->deleteMail( mail ); |
365 | item = item->itemBelow(); | 365 | item = item->itemBelow(); |
366 | if (!item ) { | 366 | if (!item ) { |
367 | closeViewMail(vm); | 367 | closeViewMail(vm); |
368 | return; | 368 | return; |
369 | } | 369 | } |
370 | mailView->setCurrentItem(item); | 370 | mailView->setCurrentItem(item); |
371 | mail = ((MailListViewItem*)item)->data(); | 371 | mail = ((MailListViewItem*)item)->data(); |
372 | RecBodyP body = folderView->fetchBody(mail); | 372 | RecBodyP body = folderView->fetchBody(mail); |
373 | vm->setBody( body ); | 373 | vm->setBody( body ); |
374 | vm->setMail( mail ); | 374 | vm->setMail( mail ); |
375 | } | 375 | } |
376 | void OpieMail::displayNextMail(ViewMail * vm) | 376 | void OpieMail::displayNextMail(ViewMail * vm) |
377 | { | 377 | { |
378 | QListViewItem*item = mailView->currentItem(); | 378 | QListViewItem*item = mailView->currentItem(); |
379 | if (!item) return; | 379 | if (!item) return; |
380 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 380 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
381 | item = item->itemBelow(); | 381 | item = item->itemBelow(); |
382 | if (!item) { | 382 | if (!item) { |
383 | vm->setCaption(i18n("End of List" )); | 383 | vm->setCaption(i18n("End of List" )); |
384 | return; | 384 | return; |
385 | } | 385 | } |
386 | mailView->setCurrentItem(item); | 386 | mailView->setCurrentItem(item); |
387 | RecMailP mail = ((MailListViewItem*)item)->data(); | 387 | RecMailP mail = ((MailListViewItem*)item)->data(); |
388 | RecBodyP body = folderView->fetchBody(mail); | 388 | RecBodyP body = folderView->fetchBody(mail); |
389 | vm->setBody( body ); | 389 | vm->setBody( body ); |
390 | vm->setMail( mail ); | 390 | vm->setMail( mail ); |
391 | } | 391 | } |
392 | void OpieMail::displayMail() | 392 | void OpieMail::displayMail() |
393 | { | 393 | { |
394 | QListViewItem*item = mailView->currentItem(); | 394 | QListViewItem*item = mailView->currentItem(); |
395 | if (!item) return; | 395 | if (!item) return; |
396 | RecMailP mail = ((MailListViewItem*)item)->data(); | 396 | RecMailP mail = ((MailListViewItem*)item)->data(); |
397 | RecBodyP body = folderView->fetchBody(mail); | 397 | RecBodyP body = folderView->fetchBody(mail); |
398 | ViewMail readMail( this,"", Qt::WType_Modal ); | 398 | ViewMail readMail( this,"", Qt::WType_Modal ); |
399 | readMail.setBody( body ); | 399 | readMail.setBody( body ); |
400 | readMail.setMail( mail ); | 400 | readMail.setMail( mail ); |
401 | #ifndef DESKTOP_VERSION | 401 | #ifndef DESKTOP_VERSION |
402 | readMail.showMaximized(); | 402 | readMail.showMaximized(); |
403 | #else | 403 | #else |
404 | readMail.resize( 640, 480); | 404 | readMail.resize( 640, 480); |
405 | #endif | 405 | #endif |
406 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); | 406 | connect( &readMail,SIGNAL( showNextMail(ViewMail *) ), this, SLOT( displayNextMail(ViewMail *) ) ); |
407 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); | 407 | connect( &readMail,SIGNAL( deleteAndDisplayNextMail(ViewMail *) ), this, SLOT(deleteAndDisplayNextMail(ViewMail *) ) ); |
408 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); | 408 | connect( &readMail,SIGNAL( signalDownloadMail() ), this, SLOT( slotDownloadMail() ) ); |
409 | 409 | ||
410 | readMail.exec(); | 410 | readMail.exec(); |
411 | 411 | ||
412 | if ( readMail.deleted ) | 412 | if ( readMail.deleted ) |
413 | { | 413 | { |
414 | folderView->refreshCurrent(); | 414 | folderView->refreshCurrent(); |
415 | } | 415 | } |
416 | else | 416 | else |
417 | { | 417 | { |
418 | QListViewItem*item = mailView->currentItem(); | 418 | QListViewItem*item = mailView->currentItem(); |
419 | if (item) | 419 | if (item) |
420 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); | 420 | ( (MailListViewItem*)item )->setPixmap( 0, QPixmap() ); |
421 | } | 421 | } |
422 | } | 422 | } |
423 | void OpieMail::slotGetAllMail() | 423 | void OpieMail::slotGetAllMail() |
424 | { | 424 | { |
425 | QListViewItem * item = folderView->firstChild(); | 425 | QListViewItem * item = folderView->firstChild(); |
426 | while ( item ){ | 426 | while ( item ){ |
427 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 427 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
428 | item = item->nextSibling (); | 428 | item = item->nextSibling (); |
429 | } | 429 | } |
430 | } | 430 | } |
431 | void OpieMail::slotGetMail() | 431 | void OpieMail::slotGetMail() |
432 | { | 432 | { |
433 | QListViewItem * item = folderView->currentItem(); | 433 | QListViewItem * item = folderView->currentItem(); |
434 | if ( ! item ) return; | 434 | if ( ! item ) return; |
435 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); | 435 | ((AccountViewItem *)item)->contextMenuSelected( 101 ); |
436 | } | 436 | } |
437 | void OpieMail::slotDeleteMail() | 437 | void OpieMail::slotDeleteMail() |
438 | { | 438 | { |
439 | if (!mailView->currentItem()) return; | 439 | if (!mailView->currentItem()) return; |
440 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 440 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
441 | if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 441 | if ( QMessageBox::warning(this, i18n("Delete Mail"), QString( i18n("<p>Do you really want to delete this mail? <br><br>" ) + mail->getFrom() + " - " + mail->getSubject() ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
442 | { | 442 | { |
443 | mail->Wrapper()->deleteMail( mail ); | 443 | mail->Wrapper()->deleteMail( mail ); |
444 | folderView->refreshCurrent(); | 444 | folderView->refreshCurrent(); |
445 | } | 445 | } |
446 | } | 446 | } |
447 | void OpieMail::slotDeleteAllMail() | 447 | void OpieMail::slotDeleteAllMail() |
448 | { | 448 | { |
449 | 449 | ||
450 | QValueList<RecMailP> t; | 450 | QValueList<RecMailP> t; |
451 | if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 451 | if ( QMessageBox::warning(this, i18n("Delete All Mails"), i18n("Do you really want to delete\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
452 | { | 452 | { |
453 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 453 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
454 | while ( item ) { | 454 | while ( item ) { |
455 | if ( item->isSelected() ) { | 455 | if ( item->isSelected() ) { |
456 | t.append( item->data() ); | 456 | t.append( item->data() ); |
457 | } | 457 | } |
458 | item = (MailListViewItem*)item->nextSibling(); | 458 | item = (MailListViewItem*)item->nextSibling(); |
459 | } | 459 | } |
460 | } | 460 | } |
461 | else | 461 | else |
462 | return; | 462 | return; |
463 | if ( t.count() == 0 ) | 463 | if ( t.count() == 0 ) |
464 | return; | 464 | return; |
465 | RecMailP mail = t.first(); | 465 | RecMailP mail = t.first(); |
466 | mail->Wrapper()->deleteMailList(t); | 466 | mail->Wrapper()->deleteMailList(t); |
467 | folderView->refreshCurrent(); | 467 | folderView->refreshCurrent(); |
468 | 468 | ||
469 | 469 | ||
470 | } | 470 | } |
471 | void OpieMail::clearSelection() | 471 | void OpieMail::clearSelection() |
472 | { | 472 | { |
473 | mailView->clearSelection(); | 473 | mailView->clearSelection(); |
474 | 474 | ||
475 | } | 475 | } |
476 | 476 | ||
477 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) | 477 | void OpieMail::mailHold(int button, QListViewItem *item,const QPoint&,int ) |
478 | { | 478 | { |
479 | if (!mailView->currentItem()) return; | 479 | if (!mailView->currentItem()) return; |
480 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); | 480 | MAILLIB::ATYPE mailtype = ((MailListViewItem*)mailView->currentItem() )->wrapperType(); |
481 | /* just the RIGHT button - or hold on pda */ | 481 | /* just the RIGHT button - or hold on pda */ |
482 | if (button!=2) {return;} | 482 | if (button!=2) {return;} |
483 | if (!item) return; | 483 | if (!item) return; |
484 | QPopupMenu *m = new QPopupMenu(0); | 484 | QPopupMenu *m = new QPopupMenu(0); |
485 | if (m) | 485 | if (m) |
486 | { | 486 | { |
487 | if (mailtype==MAILLIB::A_NNTP) { | 487 | if (mailtype==MAILLIB::A_NNTP) { |
488 | m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); | 488 | m->insertItem(i18n("Read this posting"),this,SLOT(displayMail())); |
489 | m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); | 489 | m->insertItem(i18n("Copy this posting"),this,SLOT(slotMoveCopyMail())); |
490 | m->insertSeparator(); | 490 | m->insertSeparator(); |
491 | m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); | 491 | m->insertItem(i18n("Copy all selected postings"),this,SLOT(slotMoveCopyAllMail())); |
492 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); | 492 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); |
493 | } else { | 493 | } else { |
494 | if (folderView->currentisDraft()) { | 494 | if (folderView->currentisDraft()) { |
495 | m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); | 495 | m->insertItem(i18n("Edit this mail"),this,SLOT(reEditMail())); |
496 | } | 496 | } |
497 | m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); | 497 | m->insertItem(i18n("Reply to this mail"),this,SLOT(replyMail())); |
498 | m->insertSeparator(); | ||
499 | m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); | 498 | m->insertItem(i18n("Read this mail"),this,SLOT(displayMail())); |
499 | m->insertSeparator(); | ||
500 | m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); | 500 | m->insertItem(i18n("Move/Copy this mail"),this,SLOT(slotMoveCopyMail())); |
501 | m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); | 501 | m->insertItem(i18n("Delete this mail"),this,SLOT(slotDeleteMail())); |
502 | m->insertSeparator(); | 502 | m->insertSeparator(); |
503 | m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); | 503 | m->insertItem(i18n("Move/Copy all selected mail"),this,SLOT(slotMoveCopyAllMail())); |
504 | m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); | 504 | m->insertItem(i18n("Delete all selected mails"),this,SLOT(slotDeleteAllMail())); |
505 | m->insertSeparator(); | ||
505 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); | 506 | m->insertItem(i18n("Clear selection"),this,SLOT(clearSelection())); |
506 | } | 507 | } |
507 | m->setFocus(); | 508 | m->setFocus(); |
508 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 509 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
509 | delete m; | 510 | delete m; |
510 | } | 511 | } |
511 | } | 512 | } |
512 | 513 | ||
513 | void OpieMail::slotShowFolders( bool show ) | 514 | void OpieMail::slotShowFolders( bool show ) |
514 | { | 515 | { |
515 | if ( show && folderView->isHidden() ) | 516 | if ( show && folderView->isHidden() ) |
516 | { | 517 | { |
517 | folderView->show(); | 518 | folderView->show(); |
518 | } | 519 | } |
519 | else if ( !show && !folderView->isHidden() ) | 520 | else if ( !show && !folderView->isHidden() ) |
520 | { | 521 | { |
521 | folderView->hide(); | 522 | folderView->hide(); |
522 | } | 523 | } |
523 | } | 524 | } |
524 | 525 | ||
525 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) | 526 | void OpieMail::refreshMailView(const QValueList<RecMailP>&list) |
526 | { | 527 | { |
527 | MailListViewItem*item = 0; | 528 | MailListViewItem*item = 0; |
528 | mailView->clear(); | 529 | mailView->clear(); |
529 | 530 | ||
530 | QValueList<RecMailP>::ConstIterator it; | 531 | QValueList<RecMailP>::ConstIterator it; |
531 | for (it = list.begin(); it != list.end();++it) | 532 | for (it = list.begin(); it != list.end();++it) |
532 | { | 533 | { |
533 | item = new MailListViewItem(mailView,item); | 534 | item = new MailListViewItem(mailView,item); |
534 | item->storeData((*it)); | 535 | item->storeData((*it)); |
535 | item->showEntry(); | 536 | item->showEntry(); |
536 | } | 537 | } |
537 | mailView->setSorting ( 4, false ); | 538 | mailView->setSorting ( 4, false ); |
538 | } | 539 | } |
539 | 540 | ||
540 | void OpieMail::mailLeftClicked( QListViewItem *item ) | 541 | void OpieMail::mailLeftClicked( QListViewItem *item ) |
541 | { | 542 | { |
542 | mailView->clearSelection(); | 543 | mailView->clearSelection(); |
543 | /* just LEFT button - or tap with stylus on pda */ | 544 | /* just LEFT button - or tap with stylus on pda */ |
544 | //if (button!=1) return; | 545 | //if (button!=1) return; |
545 | if (!item) return; | 546 | if (!item) return; |
546 | if (folderView->currentisDraft()) { | 547 | if (folderView->currentisDraft()) { |
547 | reEditMail(); | 548 | reEditMail(); |
548 | } else { | 549 | } else { |
549 | displayMail(); | 550 | displayMail(); |
550 | } | 551 | } |
551 | } | 552 | } |
552 | 553 | ||
553 | void OpieMail::slotMoveCopyMail() | 554 | void OpieMail::slotMoveCopyMail() |
554 | { | 555 | { |
555 | if (!mailView->currentItem()) return; | 556 | if (!mailView->currentItem()) return; |
556 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); | 557 | RecMailP mail = ((MailListViewItem*)mailView->currentItem() )->data(); |
557 | AbstractMail*targetMail = 0; | 558 | AbstractMail*targetMail = 0; |
558 | QString targetFolder = ""; | 559 | QString targetFolder = ""; |
559 | Selectstore sels; | 560 | Selectstore sels; |
560 | folderView->setupFolderselect(&sels); | 561 | folderView->setupFolderselect(&sels); |
561 | if (!sels.exec()) return; | 562 | if (!sels.exec()) return; |
562 | targetMail = sels.currentMail(); | 563 | targetMail = sels.currentMail(); |
563 | targetFolder = sels.currentFolder(); | 564 | targetFolder = sels.currentFolder(); |
564 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 565 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
565 | targetFolder.isEmpty()) | 566 | targetFolder.isEmpty()) |
566 | { | 567 | { |
567 | return; | 568 | return; |
568 | } | 569 | } |
569 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 570 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
570 | { | 571 | { |
571 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 572 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
572 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 573 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
573 | return; | 574 | return; |
574 | } | 575 | } |
575 | sels.hide(); | 576 | sels.hide(); |
576 | qApp->processEvents(); | 577 | qApp->processEvents(); |
577 | // qDebug("hiding sels "); | 578 | // qDebug("hiding sels "); |
578 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); | 579 | mail->Wrapper()->mvcpMail(mail,targetFolder,targetMail,sels.moveMails()); |
579 | folderView->refreshCurrent(); | 580 | folderView->refreshCurrent(); |
580 | } | 581 | } |
581 | 582 | ||
582 | void OpieMail::slotMoveCopyAllMail() | 583 | void OpieMail::slotMoveCopyAllMail() |
583 | { | 584 | { |
584 | 585 | ||
585 | if (!mailView->currentItem()) return; | 586 | if (!mailView->currentItem()) return; |
586 | QValueList<RecMailP> t; | 587 | QValueList<RecMailP> t; |
587 | // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) | 588 | // if ( QMessageBox::warning(this, i18n("Move/Copy all selected mails"), i18n("Do you really want to copy/move\nall selected mails?" ) , QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) |
588 | { | 589 | { |
589 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); | 590 | MailListViewItem* item = (MailListViewItem*)mailView->firstChild (); |
590 | while ( item ) { | 591 | while ( item ) { |
591 | if ( item->isSelected() ) { | 592 | if ( item->isSelected() ) { |
592 | t.append( item->data() ); | 593 | t.append( item->data() ); |
593 | } | 594 | } |
594 | item = (MailListViewItem*)item->nextSibling(); | 595 | item = (MailListViewItem*)item->nextSibling(); |
595 | } | 596 | } |
596 | } | 597 | } |
597 | // else | 598 | // else |
598 | // return; | 599 | // return; |
599 | if ( t.count() == 0 ) | 600 | if ( t.count() == 0 ) |
600 | return; | 601 | return; |
601 | RecMailP mail = t.first(); | 602 | RecMailP mail = t.first(); |
602 | AbstractMail*targetMail = 0; | 603 | AbstractMail*targetMail = 0; |
603 | QString targetFolder = ""; | 604 | QString targetFolder = ""; |
604 | Selectstore sels; | 605 | Selectstore sels; |
605 | folderView->setupFolderselect(&sels); | 606 | folderView->setupFolderselect(&sels); |
606 | if (!sels.exec()) return; | 607 | if (!sels.exec()) return; |
607 | targetMail = sels.currentMail(); | 608 | targetMail = sels.currentMail(); |
608 | targetFolder = sels.currentFolder(); | 609 | targetFolder = sels.currentFolder(); |
609 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || | 610 | if ( (mail->Wrapper()==targetMail && mail->getMbox()==targetFolder) || |
610 | targetFolder.isEmpty()) | 611 | targetFolder.isEmpty()) |
611 | { | 612 | { |
612 | return; | 613 | return; |
613 | } | 614 | } |
614 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) | 615 | if (sels.newFolder() && !targetMail->createMbox(targetFolder)) |
615 | { | 616 | { |
616 | QMessageBox::critical(0,i18n("Error creating new Folder"), | 617 | QMessageBox::critical(0,i18n("Error creating new Folder"), |
617 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); | 618 | i18n("<center>Error while creating<br>new folder - breaking.</center>")); |
618 | return; | 619 | return; |
619 | } | 620 | } |
620 | sels.hide(); | 621 | sels.hide(); |
621 | qApp->processEvents(); | 622 | qApp->processEvents(); |
622 | //qDebug("hiding sels "); | 623 | //qDebug("hiding sels "); |
623 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); | 624 | mail->Wrapper()->mvcpMailList(t,targetFolder,targetMail,sels.moveMails()); |
624 | folderView->refreshCurrent(); | 625 | folderView->refreshCurrent(); |
625 | } | 626 | } |
626 | 627 | ||
627 | void OpieMail::reEditMail() | 628 | void OpieMail::reEditMail() |
628 | { | 629 | { |
629 | if (!mailView->currentItem()) return; | 630 | if (!mailView->currentItem()) return; |
630 | 631 | ||
631 | ComposeMail compose( settings, this, 0, true ); | 632 | ComposeMail compose( settings, this, 0, true ); |
632 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); | 633 | compose.reEditMail(((MailListViewItem*)mailView->currentItem() )->data()); |
633 | compose.slotAdjustColumns(); | 634 | compose.slotAdjustColumns(); |
634 | #ifndef DESKTOP_VERSION | 635 | #ifndef DESKTOP_VERSION |
635 | compose.showMaximized(); | 636 | compose.showMaximized(); |
636 | #else | 637 | #else |
637 | compose.resize(640,480); | 638 | compose.resize(640,480); |
638 | #endif | 639 | #endif |
639 | compose.exec(); | 640 | compose.exec(); |
640 | } | 641 | } |
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp index 57623e6..d7ff9f2 100644 --- a/korganizer/kowhatsnextview.cpp +++ b/korganizer/kowhatsnextview.cpp | |||
@@ -1,763 +1,763 @@ | |||
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 <qlayout.h> | 20 | #include <qlayout.h> |
21 | #include <qtextbrowser.h> | 21 | #include <qtextbrowser.h> |
22 | #include <qtextcodec.h> | 22 | #include <qtextcodec.h> |
23 | #include <qfileinfo.h> | 23 | #include <qfileinfo.h> |
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | 25 | ||
26 | #include <qapplication.h> | 26 | #include <qapplication.h> |
27 | #ifdef DESKTOP_VERSION | 27 | #ifdef DESKTOP_VERSION |
28 | #include <qpaintdevicemetrics.h> | 28 | #include <qpaintdevicemetrics.h> |
29 | #endif | 29 | #endif |
30 | #include <kglobal.h> | 30 | #include <kglobal.h> |
31 | #include <klocale.h> | 31 | #include <klocale.h> |
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <kiconloader.h> | 33 | #include <kiconloader.h> |
34 | #include <kmessagebox.h> | 34 | #include <kmessagebox.h> |
35 | 35 | ||
36 | #include <libkcal/calendar.h> | 36 | #include <libkcal/calendar.h> |
37 | 37 | ||
38 | #ifndef KORG_NOPRINTER | 38 | #ifndef KORG_NOPRINTER |
39 | #include "calprinter.h" | 39 | #include "calprinter.h" |
40 | #endif | 40 | #endif |
41 | #include "koglobals.h" | 41 | #include "koglobals.h" |
42 | #include "koprefs.h" | 42 | #include "koprefs.h" |
43 | #include "koeventviewerdialog.h" | 43 | #include "koeventviewerdialog.h" |
44 | #include <qstylesheet.h> | 44 | #include <qstylesheet.h> |
45 | #include "kowhatsnextview.h" | 45 | #include "kowhatsnextview.h" |
46 | using namespace KOrg; | 46 | using namespace KOrg; |
47 | 47 | ||
48 | void WhatsNextTextBrowser::setSource(const QString& n) | 48 | void WhatsNextTextBrowser::setSource(const QString& n) |
49 | { | 49 | { |
50 | 50 | ||
51 | if (n.startsWith("event:")) { | 51 | if (n.startsWith("event:")) { |
52 | emit showIncidence(n); | 52 | emit showIncidence(n); |
53 | return; | 53 | return; |
54 | } else if (n.startsWith("todo:")) { | 54 | } else if (n.startsWith("todo:")) { |
55 | emit showIncidence(n); | 55 | emit showIncidence(n); |
56 | return; | 56 | return; |
57 | } else { | 57 | } else { |
58 | QTextBrowser::setSource(n); | 58 | QTextBrowser::setSource(n); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | void WhatsNextTextBrowser::printMe() | 61 | void WhatsNextTextBrowser::printMe() |
62 | { | 62 | { |
63 | #ifdef DESKTOP_VERSION | 63 | #ifdef DESKTOP_VERSION |
64 | QPrinter printer; | 64 | QPrinter printer; |
65 | if (!printer.setup() ) | 65 | if (!printer.setup() ) |
66 | return; | 66 | return; |
67 | QPainter p; | 67 | QPainter p; |
68 | p.begin ( &printer ); | 68 | p.begin ( &printer ); |
69 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); | 69 | QPaintDeviceMetrics m = QPaintDeviceMetrics ( &printer ); |
70 | float dx, dy; | 70 | float dx, dy; |
71 | int wid = (m.width() * 9)/10; | 71 | int wid = (m.width() * 9)/10; |
72 | dx = (float) wid/(float)contentsWidth (); | 72 | dx = (float) wid/(float)contentsWidth (); |
73 | dy = (float)(m.height()) / (float)contentsHeight (); | 73 | dy = (float)(m.height()) / (float)contentsHeight (); |
74 | float scale; | 74 | float scale; |
75 | // scale to fit the width or height of the paper | 75 | // scale to fit the width or height of the paper |
76 | if ( dx < dy ) | 76 | if ( dx < dy ) |
77 | scale = dx; | 77 | scale = dx; |
78 | else | 78 | else |
79 | scale = dy; | 79 | scale = dy; |
80 | p.translate( m.width()/10,0 ); | 80 | p.translate( m.width()/10,0 ); |
81 | p.scale( scale, scale ); | 81 | p.scale( scale, scale ); |
82 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); | 82 | drawContents ( &p, 0,0, contentsWidth (), contentsHeight () ); |
83 | p.end(); | 83 | p.end(); |
84 | #endif | 84 | #endif |
85 | } | 85 | } |
86 | 86 | ||
87 | KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, | 87 | KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, |
88 | const char *name) | 88 | const char *name) |
89 | : KOrg::BaseView(calendar, parent, name) | 89 | : KOrg::BaseView(calendar, parent, name) |
90 | { | 90 | { |
91 | // mDateLabel = | 91 | // mDateLabel = |
92 | // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); | 92 | // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); |
93 | // mDateLabel->setMargin(2); | 93 | // mDateLabel->setMargin(2); |
94 | // mDateLabel->setAlignment(AlignCenter); | 94 | // mDateLabel->setAlignment(AlignCenter); |
95 | setFont( KOPrefs::instance()->mWhatsNextFont ); | 95 | setFont( KOPrefs::instance()->mWhatsNextFont ); |
96 | mView = new WhatsNextTextBrowser(this); | 96 | mView = new WhatsNextTextBrowser(this); |
97 | connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); | 97 | connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); |
98 | QStyleSheet* stsh = mView->styleSheet(); | 98 | QStyleSheet* stsh = mView->styleSheet(); |
99 | QStyleSheetItem * style ; | 99 | QStyleSheetItem * style ; |
100 | style = stsh->item ("h2" ); | 100 | style = stsh->item ("h2" ); |
101 | if ( style ) { | 101 | if ( style ) { |
102 | style->setMargin(QStyleSheetItem::MarginAll,0); | 102 | style->setMargin(QStyleSheetItem::MarginAll,0); |
103 | } | 103 | } |
104 | style = stsh->item ("h3" ); | 104 | style = stsh->item ("h3" ); |
105 | if ( style ) { | 105 | if ( style ) { |
106 | style->setMargin(QStyleSheetItem::MarginAll,0); | 106 | style->setMargin(QStyleSheetItem::MarginAll,0); |
107 | } | 107 | } |
108 | mEventViewer = 0; | 108 | mEventViewer = 0; |
109 | 109 | ||
110 | QBoxLayout *topLayout = new QVBoxLayout(this); | 110 | QBoxLayout *topLayout = new QVBoxLayout(this); |
111 | // topLayout->addWidget(mDateLabel); | 111 | // topLayout->addWidget(mDateLabel); |
112 | topLayout->addWidget(mView); | 112 | topLayout->addWidget(mView); |
113 | mTimer = new QTimer( this ); | 113 | mTimer = new QTimer( this ); |
114 | connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); | 114 | connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); |
115 | 115 | ||
116 | connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); | 116 | connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); |
117 | connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); | 117 | connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); |
118 | } | 118 | } |
119 | 119 | ||
120 | KOWhatsNextView::~KOWhatsNextView() | 120 | KOWhatsNextView::~KOWhatsNextView() |
121 | { | 121 | { |
122 | } | 122 | } |
123 | 123 | ||
124 | int KOWhatsNextView::maxDatesHint() | 124 | int KOWhatsNextView::maxDatesHint() |
125 | { | 125 | { |
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | int KOWhatsNextView::currentDateCount() | 129 | int KOWhatsNextView::currentDateCount() |
130 | { | 130 | { |
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
133 | 133 | ||
134 | QPtrList<Incidence> KOWhatsNextView::selectedIncidences() | 134 | QPtrList<Incidence> KOWhatsNextView::selectedIncidences() |
135 | { | 135 | { |
136 | QPtrList<Incidence> eventList; | 136 | QPtrList<Incidence> eventList; |
137 | 137 | ||
138 | return eventList; | 138 | return eventList; |
139 | } | 139 | } |
140 | 140 | ||
141 | void KOWhatsNextView::printMe() | 141 | void KOWhatsNextView::printMe() |
142 | { | 142 | { |
143 | #ifdef DESKTOP_VERSION | 143 | #ifdef DESKTOP_VERSION |
144 | mView->printMe(); | 144 | mView->printMe(); |
145 | #endif | 145 | #endif |
146 | } | 146 | } |
147 | void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 147 | void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
148 | const QDate &td) | 148 | const QDate &td) |
149 | { | 149 | { |
150 | #ifndef KORG_NOPRINTER | 150 | #ifndef KORG_NOPRINTER |
151 | calPrinter->preview(CalPrinter::Day, fd, td); | 151 | calPrinter->preview(CalPrinter::Day, fd, td); |
152 | #endif | 152 | #endif |
153 | } | 153 | } |
154 | void KOWhatsNextView::updateConfig() | 154 | void KOWhatsNextView::updateConfig() |
155 | { | 155 | { |
156 | setFont( KOPrefs::instance()->mWhatsNextFont ); | 156 | setFont( KOPrefs::instance()->mWhatsNextFont ); |
157 | updateView(); | 157 | updateView(); |
158 | 158 | ||
159 | } | 159 | } |
160 | void KOWhatsNextView::showEvent ( QShowEvent * e ) | 160 | void KOWhatsNextView::showEvent ( QShowEvent * e ) |
161 | { | 161 | { |
162 | //qDebug("KOWhatsNextView::showEvent "); | 162 | //qDebug("KOWhatsNextView::showEvent "); |
163 | restartTimer(); | 163 | restartTimer(); |
164 | QWidget::showEvent ( e ); | 164 | QWidget::showEvent ( e ); |
165 | } | 165 | } |
166 | void KOWhatsNextView::hideEvent ( QHideEvent * e) | 166 | void KOWhatsNextView::hideEvent ( QHideEvent * e) |
167 | { | 167 | { |
168 | //qDebug(" KOWhatsNextView::hideEvent"); | 168 | //qDebug(" KOWhatsNextView::hideEvent"); |
169 | mTimer->stop(); | 169 | mTimer->stop(); |
170 | QWidget::hideEvent ( e ); | 170 | QWidget::hideEvent ( e ); |
171 | } | 171 | } |
172 | void KOWhatsNextView::restartTimer() | 172 | void KOWhatsNextView::restartTimer() |
173 | { | 173 | { |
174 | //qDebug("KOWhatsNextView::restartTimer() "); | 174 | //qDebug("KOWhatsNextView::restartTimer() "); |
175 | mTimer->start( 300000 ); | 175 | mTimer->start( 300000 ); |
176 | //mTimer->start( 5000 ); | 176 | //mTimer->start( 5000 ); |
177 | } | 177 | } |
178 | void KOWhatsNextView::updateView() | 178 | void KOWhatsNextView::updateView() |
179 | { | 179 | { |
180 | if ( mTimer->isActive() ) | 180 | if ( mTimer->isActive() ) |
181 | restartTimer(); | 181 | restartTimer(); |
182 | //qDebug("KOWhatsNextView::updateView() "); | 182 | //qDebug("KOWhatsNextView::updateView() "); |
183 | // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); | 183 | // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); |
184 | KIconLoader kil("korganizer"); | 184 | KIconLoader kil("korganizer"); |
185 | QString ipath;// = new QString(); | 185 | QString ipath;// = new QString(); |
186 | // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); | 186 | // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); |
187 | //<big><big><strong>" + date + "</strong></big></big>\n"; | 187 | //<big><big><strong>" + date + "</strong></big></big>\n"; |
188 | mText = "<table width=\"100%\">\n"; | 188 | mText = "<table width=\"100%\">\n"; |
189 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; | 189 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; |
190 | #ifdef DESKTOP_VERSION | 190 | #ifdef DESKTOP_VERSION |
191 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; | 191 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; |
192 | #else | 192 | #else |
193 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; | 193 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; |
194 | #endif | 194 | #endif |
195 | // mText += "<img src=\""; | 195 | // mText += "<img src=\""; |
196 | // mText += ipath; | 196 | // mText += ipath; |
197 | // mText += "\">"; | 197 | // mText += "\">"; |
198 | mEventDate = QDate::currentDate(); | 198 | mEventDate = QDate::currentDate(); |
199 | #ifdef DESKTOP_VERSION | 199 | #ifdef DESKTOP_VERSION |
200 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; | 200 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; |
201 | #else | 201 | #else |
202 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; | 202 | mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; |
203 | #endif | 203 | #endif |
204 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; | 204 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; |
205 | int iii; | 205 | int iii; |
206 | mTodos.clear(); | 206 | mTodos.clear(); |
207 | QPtrList<Event> events; | 207 | QPtrList<Event> events; |
208 | QPtrList<Todo> todos = calendar()->todos(); | 208 | QPtrList<Todo> todos = calendar()->todos(); |
209 | Todo * todo; | 209 | Todo * todo; |
210 | //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; | 210 | //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; |
211 | int daysToShow = KOPrefs::instance()->mWhatsNextDays ; | 211 | int daysToShow = KOPrefs::instance()->mWhatsNextDays ; |
212 | bool itemAdded = false; | 212 | bool itemAdded = false; |
213 | for ( iii = 0; iii < daysToShow; ++iii ) { | 213 | for ( iii = 0; iii < daysToShow; ++iii ) { |
214 | QString date; | 214 | QString date; |
215 | itemAdded = false; | 215 | itemAdded = false; |
216 | events = calendar()->events( mEventDate, true ); | 216 | events = calendar()->events( mEventDate, true ); |
217 | 217 | ||
218 | if ( iii == 0 ) { // today !!! | 218 | if ( iii == 0 ) { // today !!! |
219 | todo = todos.first(); | 219 | todo = todos.first(); |
220 | while(todo) { | 220 | while(todo) { |
221 | if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) { | 221 | if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) { |
222 | if ( ! itemAdded ) { | 222 | if ( ! itemAdded ) { |
223 | appendDay ( iii, mEventDate ); | 223 | appendDay ( iii, mEventDate ); |
224 | //itemAdded = true; | 224 | //itemAdded = true; |
225 | 225 | ||
226 | } //bool reply=false, bool notRed = true, bool appendTable = false); | 226 | } //bool reply=false, bool notRed = true, bool appendTable = false); |
227 | appendEvent(todo, false, false, !itemAdded ); | 227 | appendEvent(todo, false, false, !itemAdded ); |
228 | itemAdded = true; | 228 | itemAdded = true; |
229 | } | 229 | } |
230 | todo = todos.next(); | 230 | todo = todos.next(); |
231 | } | 231 | } |
232 | } | 232 | } |
233 | 233 | ||
234 | 234 | ||
235 | if (events.count() > 0) { | 235 | if (events.count() > 0) { |
236 | // mText += "<p></p>"; | 236 | // mText += "<p></p>"; |
237 | // kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); | 237 | // kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); |
238 | // mText += "<h2>"; | 238 | // mText += "<h2>"; |
239 | //mText += " <img src=\""; | 239 | //mText += " <img src=\""; |
240 | //mText += ipath; | 240 | //mText += ipath; |
241 | //mText += "\">"; | 241 | //mText += "\">"; |
242 | if ( ! itemAdded ) { | 242 | if ( ! itemAdded ) { |
243 | appendDay ( iii, mEventDate ); | 243 | appendDay ( iii, mEventDate ); |
244 | 244 | ||
245 | } | 245 | } |
246 | // for first day (iii == 0) | 246 | // for first day (iii == 0) |
247 | // we may have syncevents, or events in the past, which maybe should not be diaplayed | 247 | // we may have syncevents, or events in the past, which maybe should not be diaplayed |
248 | // for that reason we cannot append <table> in appendDay () for iii == 0 | 248 | // for that reason we cannot append <table> in appendDay () for iii == 0 |
249 | // we must append it in the first successful call of appendEvent() | 249 | // we must append it in the first successful call of appendEvent() |
250 | Event *ev = events.first(); | 250 | Event *ev = events.first(); |
251 | while(ev) { | 251 | while(ev) { |
252 | //qDebug("+++++event append %s", ev->summary().latin1()); | 252 | //qDebug("+++++event append %s", ev->summary().latin1()); |
253 | if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { | 253 | if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { |
254 | if ( appendEvent(ev, false , iii!= 0,!itemAdded ) ) | 254 | if ( appendEvent(ev, false , iii!= 0,!itemAdded ) ) |
255 | itemAdded = true; | 255 | itemAdded = true; |
256 | } | 256 | } |
257 | ev = events.next(); | 257 | ev = events.next(); |
258 | } | 258 | } |
259 | 259 | ||
260 | //mText += "</table>\n"; | 260 | //mText += "</table>\n"; |
261 | } | 261 | } |
262 | 262 | ||
263 | todo = todos.first(); | 263 | todo = todos.first(); |
264 | while(todo) { | 264 | while(todo) { |
265 | if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) { | 265 | if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) { |
266 | if ( ! itemAdded ) { | 266 | if ( ! itemAdded ) { |
267 | appendDay ( iii, mEventDate ); | 267 | appendDay ( iii, mEventDate ); |
268 | //itemAdded = true; | 268 | //itemAdded = true; |
269 | } | 269 | } |
270 | appendEvent(todo, false , iii!= 0,!itemAdded); | 270 | appendEvent(todo, false , iii!= 0,!itemAdded); |
271 | itemAdded = true; | 271 | itemAdded = true; |
272 | } | 272 | } |
273 | todo = todos.next(); | 273 | todo = todos.next(); |
274 | } | 274 | } |
275 | if ( !itemAdded && iii == 0 ) { | 275 | if ( !itemAdded && iii == 0 ) { |
276 | // appendDay ( iii, mEventDate ); | 276 | // appendDay ( iii, mEventDate ); |
277 | //mText += "<table>"; | 277 | //mText += "<table>"; |
278 | // mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n"; | 278 | // mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n"; |
279 | mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n"; | 279 | mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n"; |
280 | //mText +="</table>"; | 280 | //mText +="</table>"; |
281 | } | 281 | } |
282 | if ( itemAdded ) | 282 | if ( itemAdded ) |
283 | mText += "</table>\n"; | 283 | mText += "</table>\n"; |
284 | mEventDate = mEventDate.addDays( 1 ); | 284 | mEventDate = mEventDate.addDays( 1 ); |
285 | } | 285 | } |
286 | 286 | ||
287 | int topmostPrios = KOPrefs::instance()->mWhatsNextPrios; | 287 | int topmostPrios = KOPrefs::instance()->mWhatsNextPrios; |
288 | if (todos.count() > 0 && topmostPrios > 0 ) { | 288 | if (todos.count() > 0 && topmostPrios > 0 ) { |
289 | // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); | 289 | // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); |
290 | // mText += "<h2>"; | 290 | // mText += "<h2>"; |
291 | //<img src=\""; | 291 | //<img src=\""; |
292 | // mText += ipath; | 292 | // mText += ipath; |
293 | // mText += "\">"; | 293 | // mText += "\">"; |
294 | // mText += i18n("Overdue To-Do:") + "</h2>\n"; | 294 | // mText += i18n("Overdue To-Do:") + "</h2>\n"; |
295 | 295 | ||
296 | //mText += "<ul>\n"; | 296 | //mText += "<ul>\n"; |
297 | bool gotone = false; | 297 | bool gotone = false; |
298 | int priority = 1; | 298 | int priority = 1; |
299 | int priosFound = 0; | 299 | int priosFound = 0; |
300 | #ifdef DESKTOP_VERSION | 300 | #ifdef DESKTOP_VERSION |
301 | mText +="<p></p>"; | 301 | mText +="<p></p>"; |
302 | #endif | 302 | #endif |
303 | 303 | ||
304 | mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n"; | 304 | mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n"; |
305 | mText += "<ul>\n"; | 305 | mText += "<ul>\n"; |
306 | while (!gotone && priority<6) { | 306 | while (!gotone && priority<6) { |
307 | todo = todos.first(); | 307 | todo = todos.first(); |
308 | while(todo) { | 308 | while(todo) { |
309 | if (!todo->isCompleted() && (todo->priority() == priority) ) { | 309 | if (!todo->isCompleted() && (todo->priority() == priority) ) { |
310 | if ( appendTodo(todo) ) | 310 | if ( appendTodo(todo) ) |
311 | gotone = true; | 311 | gotone = true; |
312 | } | 312 | } |
313 | todo = todos.next(); | 313 | todo = todos.next(); |
314 | } | 314 | } |
315 | if ( gotone ) { | 315 | if ( gotone ) { |
316 | gotone = false; | 316 | gotone = false; |
317 | ++priosFound; | 317 | ++priosFound; |
318 | if ( priosFound == topmostPrios ) | 318 | if ( priosFound == topmostPrios ) |
319 | break; | 319 | break; |
320 | } | 320 | } |
321 | priority++; | 321 | priority++; |
322 | // kdDebug() << "adding the todos..." << endl; | 322 | // kdDebug() << "adding the todos..." << endl; |
323 | } | 323 | } |
324 | mText += "</ul>\n"; | 324 | mText += "</ul>\n"; |
325 | } | 325 | } |
326 | 326 | ||
327 | int replys = 0; | 327 | int replys = 0; |
328 | events = calendar()->events(QDate::currentDate(), QDate(2975,12,6)); | 328 | events = calendar()->events(QDate::currentDate(), QDate(2975,12,6)); |
329 | if (events.count() > 0) { | 329 | if (events.count() > 0) { |
330 | Event *ev = events.first(); | 330 | Event *ev = events.first(); |
331 | while(ev) { | 331 | while(ev) { |
332 | Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 332 | Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
333 | if (me!=0) { | 333 | if (me!=0) { |
334 | if (me->status()==Attendee::NeedsAction && me->RSVP()) { | 334 | if (me->status()==Attendee::NeedsAction && me->RSVP()) { |
335 | if (replys == 0) { | 335 | if (replys == 0) { |
336 | mText += "<p></p>"; | 336 | mText += "<p></p>"; |
337 | // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); | 337 | // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); |
338 | //mText += "<h2>"; | 338 | //mText += "<h2>"; |
339 | //<img src=\""; | 339 | //<img src=\""; |
340 | // mText += ipath; | 340 | // mText += ipath; |
341 | // mText += "\">"; | 341 | // mText += "\">"; |
342 | //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n"; | 342 | //mText += i18n("Events and To-Dos that need a reply:") + "</h2>\n"; |
343 | mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; | 343 | mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; |
344 | mText += "<table>\n"; | 344 | mText += "<table>\n"; |
345 | } | 345 | } |
346 | replys++; | 346 | replys++; |
347 | appendEvent(ev,true); | 347 | appendEvent(ev,true); |
348 | } | 348 | } |
349 | } | 349 | } |
350 | ev = events.next(); | 350 | ev = events.next(); |
351 | } | 351 | } |
352 | } | 352 | } |
353 | todos = calendar()->todos(); | 353 | todos = calendar()->todos(); |
354 | if (todos.count() > 0) { | 354 | if (todos.count() > 0) { |
355 | Todo *to = todos.first(); | 355 | Todo *to = todos.first(); |
356 | while(to) { | 356 | while(to) { |
357 | if ( !to->isCompleted() ){ | 357 | if ( !to->isCompleted() ){ |
358 | Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); | 358 | Attendee *me = to->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); |
359 | if (me!=0) { | 359 | if (me!=0) { |
360 | if (me->status()==Attendee::NeedsAction && me->RSVP()) { | 360 | if (me->status()==Attendee::NeedsAction && me->RSVP()) { |
361 | if (replys == 0) { | 361 | if (replys == 0) { |
362 | mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; | 362 | mText +="<h2><em><font color=\"#000080\">" + i18n("Events and To-Dos that need a reply:") + "</font></em></h2>\n"; |
363 | mText += "<table>\n"; | 363 | mText += "<table>\n"; |
364 | } | 364 | } |
365 | replys++; | 365 | replys++; |
366 | appendEvent(to, true); | 366 | appendEvent(to, true); |
367 | } | 367 | } |
368 | } | 368 | } |
369 | } | 369 | } |
370 | to = todos.next(); | 370 | to = todos.next(); |
371 | } | 371 | } |
372 | } | 372 | } |
373 | if (replys > 0 ) mText += "</table>\n"; | 373 | if (replys > 0 ) mText += "</table>\n"; |
374 | 374 | ||
375 | 375 | ||
376 | mText += "</td></tr>\n</table>\n"; | 376 | mText += "</td></tr>\n</table>\n"; |
377 | 377 | ||
378 | mView->setText(mText); | 378 | mView->setText(mText); |
379 | mView->setFocus(); | 379 | mView->setFocus(); |
380 | 380 | ||
381 | // QPixmap bPix = SmallIcon( "back" ); | 381 | // QPixmap bPix = SmallIcon( "back" ); |
382 | // qDebug("xxxxxxxxxxxxxxxxxxxxx "); | 382 | // qDebug("xxxxxxxxxxxxxxxxxxxxx "); |
383 | // QWidget* test = new QWidget(); | 383 | // QWidget* test = new QWidget(); |
384 | // test->setBackgroundMode(FixedPixmap ); | 384 | // test->setBackgroundMode(FixedPixmap ); |
385 | // test->setBackgroundPixmap ( bPix ); | 385 | // test->setBackgroundPixmap ( bPix ); |
386 | // test->resize( 300, 400 ); | 386 | // test->resize( 300, 400 ); |
387 | // test->show(); | 387 | // test->show(); |
388 | // mView->setBackgroundMode(FixedPixmap ); | 388 | // mView->setBackgroundMode(FixedPixmap ); |
389 | // mView->setBackgroundPixmap ( bPix ); | 389 | // mView->setBackgroundPixmap ( bPix ); |
390 | // qDebug("%s ",mText.latin1()); | 390 | // qDebug("%s ",mText.latin1()); |
391 | } | 391 | } |
392 | 392 | ||
393 | void KOWhatsNextView::appendDay( int i, QDate eventDate ) | 393 | void KOWhatsNextView::appendDay( int i, QDate eventDate ) |
394 | { | 394 | { |
395 | QString date; | 395 | QString date; |
396 | QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); | 396 | QString day = KGlobal::locale()->formatDate( eventDate , KOPrefs::instance()->mShortDateInViewer); |
397 | if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { | 397 | if ( ! KOPrefs::instance()->mShortDateInViewer && QApplication::desktop()->width() < 320 ) { |
398 | if ( i == 0 ) { | 398 | if ( i == 0 ) { |
399 | //mText += "<table>\n"; | 399 | //mText += "<table>\n"; |
400 | return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; | 400 | return;//date = "<em><font color=\"#008000\"><em>" + day+"</font></em>"; |
401 | } | 401 | } |
402 | else if ( i == 1 ) | 402 | else if ( i == 1 ) |
403 | date = "<em><font color=\"#000080\">" + day + "</font></em>" ; | 403 | date = "<em><font color=\"#000080\">" + day + "</font></em>" ; |
404 | else date = "<em><font color=\"#000080\">" + day + "</font></em>"; | 404 | else date = "<em><font color=\"#000080\">" + day + "</font></em>"; |
405 | mText += "<h2>" + date + "</h2>\n"; | 405 | mText += "<h2>" + date + "</h2>\n"; |
406 | //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; | 406 | //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; |
407 | mText += "<table>\n"; | 407 | mText += "<table>\n"; |
408 | 408 | ||
409 | 409 | ||
410 | 410 | ||
411 | } else { | 411 | } else { |
412 | if ( i == 0 ) { | 412 | if ( i == 0 ) { |
413 | //mText += "<table>\n"; | 413 | //mText += "<table>\n"; |
414 | return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; | 414 | return;// date = "<font color=\"#008000\"><em>" +i18n("Today: ") +"</em>" + day+"</font>"; |
415 | } | 415 | } |
416 | 416 | ||
417 | #ifdef DESKTOP_VERSION | 417 | #ifdef DESKTOP_VERSION |
418 | else if ( i == 1 ) { | 418 | else if ( i == 1 ) { |
419 | date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ; | 419 | date = "<h2><em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em></h2>" ; |
420 | } | 420 | } |
421 | else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>"; | 421 | else date = "<h2><em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em></h2>"; |
422 | #else | 422 | #else |
423 | else if ( i == 1 ) { | 423 | else if ( i == 1 ) { |
424 | date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ; | 424 | date = "<em><font color=\"#000080\">" + i18n("Tomorrow: ") + day +"</font></em>" ; |
425 | } | 425 | } |
426 | else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>"; | 426 | else date = "<em><font color=\"#000080\">" + i18n("In %1 days: ").arg( i ) +day + "</font></em>"; |
427 | 427 | ||
428 | #endif | 428 | #endif |
429 | mText += "<h2>" + date + "</h2>\n"; | 429 | mText += "<h2>" + date + "</h2>\n"; |
430 | //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; | 430 | //mText += "<big><big><strong>" + date + "</strong></big></big>\n"; |
431 | mText += "<table>\n"; | 431 | mText += "<table>\n"; |
432 | } | 432 | } |
433 | } | 433 | } |
434 | 434 | ||
435 | 435 | ||
436 | void KOWhatsNextView::showDates(const QDate &, const QDate &) | 436 | void KOWhatsNextView::showDates(const QDate &, const QDate &) |
437 | { | 437 | { |
438 | updateView(); | 438 | updateView(); |
439 | } | 439 | } |
440 | 440 | ||
441 | void KOWhatsNextView::showEvents(QPtrList<Event>) | 441 | void KOWhatsNextView::showEvents(QPtrList<Event>) |
442 | { | 442 | { |
443 | } | 443 | } |
444 | 444 | ||
445 | void KOWhatsNextView::changeEventDisplay(Event *, int action) | 445 | void KOWhatsNextView::changeEventDisplay(Event *, int action) |
446 | { | 446 | { |
447 | switch(action) { | 447 | switch(action) { |
448 | case KOGlobals::EVENTADDED: | 448 | case KOGlobals::EVENTADDED: |
449 | updateView(); | 449 | updateView(); |
450 | break; | 450 | break; |
451 | case KOGlobals::EVENTEDITED: | 451 | case KOGlobals::EVENTEDITED: |
452 | updateView(); | 452 | updateView(); |
453 | break; | 453 | break; |
454 | case KOGlobals::EVENTDELETED: | 454 | case KOGlobals::EVENTDELETED: |
455 | updateView(); | 455 | updateView(); |
456 | break; | 456 | break; |
457 | default: | 457 | default: |
458 | updateView(); | 458 | updateView(); |
459 | kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; | 459 | kdDebug() << "KOWhatsNextView::changeEventDisplay(): Illegal action " << action << endl; |
460 | } | 460 | } |
461 | } | 461 | } |
462 | 462 | ||
463 | bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable ) | 463 | bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool appendTable ) |
464 | { | 464 | { |
465 | if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) | 465 | if ( !KOPrefs::instance()->mShowSyncEvents && ev->uid().left(15) == QString("last-syncEvent-") ) |
466 | return false; | 466 | return false; |
467 | QDateTime cdt = QDateTime::currentDateTime(); | 467 | QDateTime cdt = QDateTime::currentDateTime(); |
468 | QDateTime noc; | 468 | QDateTime noc; |
469 | QString tempText; | 469 | QString tempText; |
470 | if ( appendTable && !notRed ) { | 470 | if ( appendTable && !notRed ) { |
471 | tempText = "<table>"; | 471 | tempText = "<table>"; |
472 | } | 472 | } |
473 | bool ok = true; | 473 | bool ok = true; |
474 | if ( reply ) { | 474 | if ( reply ) { |
475 | noc = ev->getNextOccurence( cdt, &ok ); | 475 | noc = ev->getNextOccurence( cdt, &ok ); |
476 | if (! ok && ev->type() == "Event") | 476 | if (! ok && ev->type() == "Event") |
477 | return false; | 477 | return false; |
478 | } | 478 | } |
479 | bool bDay = false; | 479 | bool bDay = false; |
480 | if ( ev->categories().contains( i18n("Birthday") ) || ev->categories().contains( i18n("Anniversary") ) ) | 480 | if ( ev->categories().contains( i18n("Birthday") ) || ev->categories().contains( i18n("Anniversary") ) ) |
481 | bDay = true; | 481 | bDay = true; |
482 | tempText += "<tr><td><b>"; | 482 | tempText += "<tr><td><b>"; |
483 | if (ev->type()=="Event") { | 483 | if (ev->type()=="Event") { |
484 | if (reply) { | 484 | if (reply) { |
485 | if (!ev->doesFloat()) | 485 | if (!ev->doesFloat()) |
486 | tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; | 486 | tempText += KGlobal::locale()->formatDateTime( noc , KOPrefs::instance()->mShortDateInViewer) +": "; |
487 | else | 487 | else |
488 | tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; | 488 | tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; |
489 | 489 | ||
490 | } else { | 490 | } else { |
491 | if (!ev->doesFloat()) { | 491 | if (!ev->doesFloat()) { |
492 | Event *event = static_cast<Event *>(ev); | 492 | Event *event = static_cast<Event *>(ev); |
493 | QDateTime st,end; | 493 | QDateTime st,end; |
494 | if ( event->recurrence()->doesRecur() ) { | 494 | if ( event->recurrence()->doesRecur() ) { |
495 | QDate recDate= mEventDate; | 495 | QDate recDate= mEventDate; |
496 | int days = event->dtStart().date().daysTo (event->dtEnd().date() ); | 496 | int days = event->dtStart().date().daysTo (event->dtEnd().date() ); |
497 | while ( ! event->recursOn( recDate ) ) { | 497 | while ( ! event->recursOn( recDate ) ) { |
498 | recDate = recDate.addDays( -1 ); | 498 | recDate = recDate.addDays( -1 ); |
499 | 499 | ||
500 | } | 500 | } |
501 | st = QDateTime ( recDate, event->dtStart().time() ); | 501 | st = QDateTime ( recDate, event->dtStart().time() ); |
502 | end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); | 502 | end = QDateTime ( recDate.addDays( days ), event->dtEnd().time() ); |
503 | } | 503 | } |
504 | else { | 504 | else { |
505 | st = event->dtStart(); | 505 | st = event->dtStart(); |
506 | end = event->dtEnd(); | 506 | end = event->dtEnd(); |
507 | } | 507 | } |
508 | 508 | ||
509 | 509 | ||
510 | QString dateText; | 510 | QString dateText; |
511 | // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); | 511 | // qDebug("%s %s %s %s ", mEventDate.toString().latin1(),event->summary().latin1(), st .toString().latin1(),end.toString().latin1() ); |
512 | if ( st.date() < mEventDate ) | 512 | if ( st.date() < mEventDate ) |
513 | dateText = "++:++-"; | 513 | dateText = "++:++-"; |
514 | else | 514 | else |
515 | dateText = event->dtStartTimeStr() + "-"; | 515 | dateText = event->dtStartTimeStr() + "-"; |
516 | if ( end.date() > mEventDate ) | 516 | if ( end.date() > mEventDate ) |
517 | dateText += "++:++"; | 517 | dateText += "++:++"; |
518 | else | 518 | else |
519 | dateText += event->dtEndTimeStr(); | 519 | dateText += event->dtEndTimeStr(); |
520 | if ( notRed ) | 520 | if ( notRed ) |
521 | tempText += dateText; | 521 | tempText += dateText; |
522 | else { | 522 | else { |
523 | if ( end < cdt ) { | 523 | if ( end < cdt ) { |
524 | if ( !KOPrefs::instance()->mWNViewShowsPast ) | 524 | if ( !KOPrefs::instance()->mWNViewShowsPast ) |
525 | return false; | 525 | return false; |
526 | tempText += "<font color=\"#F00000\">" + dateText + "</font>"; | 526 | tempText += "<font color=\"#F00000\">" + dateText + "</font>"; |
527 | } | 527 | } |
528 | else if ( st < cdt ) | 528 | else if ( st < cdt ) |
529 | tempText += "<font color=\"#008000\">" + dateText + "</font>"; | 529 | tempText += "<font color=\"#008000\">" + dateText + "</font>"; |
530 | else | 530 | else |
531 | tempText += dateText; | 531 | tempText += dateText; |
532 | 532 | ||
533 | } | 533 | } |
534 | 534 | ||
535 | } else { | 535 | } else { |
536 | if ( bDay ) { | 536 | if ( bDay ) { |
537 | 537 | ||
538 | if ( ev->categories().contains( i18n("Birthday") )) | 538 | if ( ev->categories().contains( i18n("Birthday") )) |
539 | tempText += "<font color=\"#F00000\">" + i18n("Birthday") +":</font>"; | 539 | tempText += "<font color=\"#F00000\">" + i18n("Birthday") +":</font>"; |
540 | else | 540 | else |
541 | tempText += "<font color=\"#F00000\">" + i18n("Anniversary")+":</font>"; | 541 | tempText += "<font color=\"#F00000\">" + i18n("Anniversary")+":</font>"; |
542 | } else { | 542 | } else { |
543 | tempText += i18n("Allday:"); | 543 | tempText += i18n("Allday:"); |
544 | } | 544 | } |
545 | 545 | ||
546 | } | 546 | } |
547 | } | 547 | } |
548 | } else { | 548 | } else { |
549 | mTodos.append( ev ); | 549 | mTodos.append( ev ); |
550 | tempText += i18n("ToDo:"); | 550 | tempText += i18n("ToDo:"); |
551 | if (reply) { | 551 | if (reply) { |
552 | tempText += " "; | 552 | tempText += " "; |
553 | if ( noc != cdt ) { | 553 | if ( noc != cdt ) { |
554 | tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; | 554 | tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; |
555 | } | 555 | } |
556 | } else { | 556 | } else { |
557 | if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { | 557 | if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { |
558 | // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; | 558 | // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; |
559 | QString dfs = KGlobal::locale()->dateFormatShort(); | 559 | QString dfs = KGlobal::locale()->dateFormatShort(); |
560 | KGlobal::locale()->setDateFormatShort("%d.%b"); | 560 | KGlobal::locale()->setDateFormatShort("%d.%b"); |
561 | tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; | 561 | tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; |
562 | KGlobal::locale()->setDateFormatShort(dfs); | 562 | KGlobal::locale()->setDateFormatShort(dfs); |
563 | } else { | 563 | } else { |
564 | if (!ev->doesFloat() ) | 564 | if (!ev->doesFloat() ) |
565 | if( ( (Todo*)ev)->dtDue() < cdt ) { | 565 | if( ( (Todo*)ev)->dtDue() < cdt ) { |
566 | tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; | 566 | tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; |
567 | 567 | ||
568 | 568 | ||
569 | } else | 569 | } else |
570 | tempText +=((Todo*)ev)->dtDueTimeStr(); | 570 | tempText +=((Todo*)ev)->dtDueTimeStr(); |
571 | mTodos.append( ev ); | 571 | mTodos.append( ev ); |
572 | } | 572 | } |
573 | } | 573 | } |
574 | } | 574 | } |
575 | tempText += "</b></td><td>"; | 575 | tempText += "</b></td><td>"; |
576 | bool needClose = false; | 576 | bool needClose = false; |
577 | if ( ev->cancelled() ) { | 577 | if ( ev->cancelled() ) { |
578 | tempText += "<font color=\"#F00000\">[c"; | 578 | tempText += "<font color=\"#F00000\">[c"; |
579 | needClose =true; | 579 | needClose =true; |
580 | 580 | ||
581 | } | 581 | } |
582 | if ( ev->isAlarmEnabled() ) { | 582 | if ( ev->isAlarmEnabled() ) { |
583 | if ( !needClose) | 583 | if ( !needClose) |
584 | tempText +="["; | 584 | tempText +="["; |
585 | tempText += "a"; | 585 | tempText += "a"; |
586 | needClose =true; | 586 | needClose =true; |
587 | 587 | ||
588 | } | 588 | } |
589 | if ( ev->description().length() > 0 ) { | 589 | if ( ev->description().length() > 0 ) { |
590 | if ( !needClose) | 590 | if ( !needClose) |
591 | tempText +="["; | 591 | tempText +="["; |
592 | tempText += "i"; | 592 | tempText += "i"; |
593 | needClose =true; | 593 | needClose =true; |
594 | } | 594 | } |
595 | if ( ev->recurrence()->doesRecur() ) { | 595 | if ( ev->recurrence()->doesRecur() ) { |
596 | if ( !needClose) | 596 | if ( !needClose) |
597 | tempText +="["; | 597 | tempText +="["; |
598 | tempText += "r"; | 598 | tempText += "r"; |
599 | needClose =true; | 599 | needClose =true; |
600 | } | 600 | } |
601 | if ( needClose ) { | 601 | if ( needClose ) { |
602 | tempText += "] "; | 602 | tempText += "] "; |
603 | } | 603 | } |
604 | if ( ev->cancelled() ) | 604 | if ( ev->cancelled() ) |
605 | tempText += "</font>"; | 605 | tempText += "</font>"; |
606 | tempText += "<a "; | 606 | tempText += "<a "; |
607 | if (ev->type()=="Event") tempText += "href=\"event:"; | 607 | if (ev->type()=="Event") tempText += "href=\"event:"; |
608 | if (ev->type()=="Todo") tempText += "href=\"todo:"; | 608 | if (ev->type()=="Todo") tempText += "href=\"todo:"; |
609 | tempText += ev->uid() + "\">"; | 609 | tempText += ev->uid() + "\">"; |
610 | if ( ev->summary().length() > 0 ) | 610 | if ( ev->summary().length() > 0 ) |
611 | tempText += ev->summary(); | 611 | tempText += ev->summary(); |
612 | else | 612 | else |
613 | tempText += i18n("-no summary-"); | 613 | tempText += i18n("-no summary-"); |
614 | if ( bDay ) { | 614 | if ( bDay ) { |
615 | noc = ev->getNextOccurence( cdt, &ok ); | 615 | noc = ev->getNextOccurence( cdt.addDays(-1), &ok ); |
616 | if ( ok ) { | 616 | if ( ok ) { |
617 | int years = noc.date().year() - ev->dtStart().date().year(); | 617 | int years = noc.date().year() - ev->dtStart().date().year(); |
618 | tempText += i18n(" (%1 y.)"). arg( years ); | 618 | tempText += i18n(" (%1 y.)"). arg( years ); |
619 | } | 619 | } |
620 | } | 620 | } |
621 | 621 | ||
622 | tempText += "</a>"; | 622 | tempText += "</a>"; |
623 | if ( KOPrefs::instance()->mWNViewShowLocation ) | 623 | if ( KOPrefs::instance()->mWNViewShowLocation ) |
624 | if ( !ev->location().isEmpty() ) | 624 | if ( !ev->location().isEmpty() ) |
625 | tempText += " ("+ev->location() +")"; | 625 | tempText += " ("+ev->location() +")"; |
626 | if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) | 626 | if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) |
627 | tempText += " ["+ev->relatedTo()->summary() +"]"; | 627 | tempText += " ["+ev->relatedTo()->summary() +"]"; |
628 | tempText += "</td></tr>\n"; | 628 | tempText += "</td></tr>\n"; |
629 | mText += tempText; | 629 | mText += tempText; |
630 | return true; | 630 | return true; |
631 | } | 631 | } |
632 | 632 | ||
633 | bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) | 633 | bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) |
634 | { | 634 | { |
635 | if ( mTodos.find( ev ) != mTodos.end() ) return false; | 635 | if ( mTodos.find( ev ) != mTodos.end() ) return false; |
636 | 636 | ||
637 | mTodos.append( ev ); | 637 | mTodos.append( ev ); |
638 | if ( !isSub ) | 638 | if ( !isSub ) |
639 | mText += "<p>"; | 639 | mText += "<p>"; |
640 | else | 640 | else |
641 | mText += "<li>"; | 641 | mText += "<li>"; |
642 | mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; | 642 | mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; |
643 | 643 | ||
644 | 644 | ||
645 | mText += ind; | 645 | mText += ind; |
646 | bool needClose = false; | 646 | bool needClose = false; |
647 | if ( ev->cancelled() ) { | 647 | if ( ev->cancelled() ) { |
648 | mText += "<font color=\"#F00000\">[c"; | 648 | mText += "<font color=\"#F00000\">[c"; |
649 | needClose =true; | 649 | needClose =true; |
650 | 650 | ||
651 | } | 651 | } |
652 | if ( ev->isAlarmEnabled() ) { | 652 | if ( ev->isAlarmEnabled() ) { |
653 | if ( !needClose) | 653 | if ( !needClose) |
654 | mText +="["; | 654 | mText +="["; |
655 | mText += "a"; | 655 | mText += "a"; |
656 | needClose =true; | 656 | needClose =true; |
657 | 657 | ||
658 | } | 658 | } |
659 | 659 | ||
660 | if ( ev->description().length() > 0 ) { | 660 | if ( ev->description().length() > 0 ) { |
661 | if ( !needClose) | 661 | if ( !needClose) |
662 | mText +="["; | 662 | mText +="["; |
663 | mText += "i"; | 663 | mText += "i"; |
664 | needClose =true; | 664 | needClose =true; |
665 | } | 665 | } |
666 | // if ( ev->recurrence()->doesRecur() ) { | 666 | // if ( ev->recurrence()->doesRecur() ) { |
667 | // if ( !needClose) | 667 | // if ( !needClose) |
668 | // mText +="("; | 668 | // mText +="("; |
669 | // mText += "r"; | 669 | // mText += "r"; |
670 | // needClose =true; | 670 | // needClose =true; |
671 | // } | 671 | // } |
672 | if ( needClose ) | 672 | if ( needClose ) |
673 | mText += "] "; | 673 | mText += "] "; |
674 | if ( ev->cancelled() ) | 674 | if ( ev->cancelled() ) |
675 | mText += "</font>"; | 675 | mText += "</font>"; |
676 | mText += "<a href=\"todo:" + ev->uid() + "\">"; | 676 | mText += "<a href=\"todo:" + ev->uid() + "\">"; |
677 | if ( ev->summary().length() > 0 ) | 677 | if ( ev->summary().length() > 0 ) |
678 | mText += ev->summary(); | 678 | mText += ev->summary(); |
679 | else | 679 | else |
680 | mText += i18n("-no summary-"); | 680 | mText += i18n("-no summary-"); |
681 | mText += "</a>"; | 681 | mText += "</a>"; |
682 | if ( ((Todo*)ev)->hasDueDate () ) { | 682 | if ( ((Todo*)ev)->hasDueDate () ) { |
683 | QString year = ""; | 683 | QString year = ""; |
684 | int ye = ((Todo*)ev)->dtDue().date().year(); | 684 | int ye = ((Todo*)ev)->dtDue().date().year(); |
685 | if ( QDateTime::currentDateTime().date().year() != ye ) | 685 | if ( QDateTime::currentDateTime().date().year() != ye ) |
686 | year = QString::number( ye ); | 686 | year = QString::number( ye ); |
687 | QString dfs = KGlobal::locale()->dateFormatShort(); | 687 | QString dfs = KGlobal::locale()->dateFormatShort(); |
688 | KGlobal::locale()->setDateFormatShort("%d.%b"); | 688 | KGlobal::locale()->setDateFormatShort("%d.%b"); |
689 | mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>"; | 689 | mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>"; |
690 | KGlobal::locale()->setDateFormatShort(dfs); | 690 | KGlobal::locale()->setDateFormatShort(dfs); |
691 | } | 691 | } |
692 | if ( KOPrefs::instance()->mWNViewShowLocation ) | 692 | if ( KOPrefs::instance()->mWNViewShowLocation ) |
693 | if ( !ev->location().isEmpty() ) | 693 | if ( !ev->location().isEmpty() ) |
694 | mText += " ("+ev->location() +")"; | 694 | mText += " ("+ev->location() +")"; |
695 | if ( !isSub ) { | 695 | if ( !isSub ) { |
696 | if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents) | 696 | if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents) |
697 | mText += " ["+ev->relatedTo()->summary() +"]"; | 697 | mText += " ["+ev->relatedTo()->summary() +"]"; |
698 | mText += "</p>\n"; | 698 | mText += "</p>\n"; |
699 | } | 699 | } |
700 | else { | 700 | else { |
701 | ind += "-"; | 701 | ind += "-"; |
702 | mText += "</li>\n"; | 702 | mText += "</li>\n"; |
703 | } | 703 | } |
704 | QPtrList<Incidence> Relations = ev->relations(); | 704 | QPtrList<Incidence> Relations = ev->relations(); |
705 | Incidence *to; | 705 | Incidence *to; |
706 | for (to=Relations.first();to;to=Relations.next()) { | 706 | for (to=Relations.first();to;to=Relations.next()) { |
707 | if (!((Todo*)to)->isCompleted()) | 707 | if (!((Todo*)to)->isCompleted()) |
708 | appendTodo( to, ind , true ); | 708 | appendTodo( to, ind , true ); |
709 | } | 709 | } |
710 | 710 | ||
711 | return true; | 711 | return true; |
712 | } | 712 | } |
713 | 713 | ||
714 | /* | 714 | /* |
715 | void KOWhatsNextView::createEventViewer() | 715 | void KOWhatsNextView::createEventViewer() |
716 | { | 716 | { |
717 | if (!mEventViewer) { | 717 | if (!mEventViewer) { |
718 | 718 | ||
719 | mEventViewer = new KOEventViewerDialog(this); | 719 | mEventViewer = new KOEventViewerDialog(this); |
720 | } | 720 | } |
721 | } | 721 | } |
722 | */ | 722 | */ |
723 | void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) | 723 | void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) |
724 | { | 724 | { |
725 | mEventViewer = v; | 725 | mEventViewer = v; |
726 | } | 726 | } |
727 | 727 | ||
728 | // TODO: Create this function in CalendarView and remove it from here | 728 | // TODO: Create this function in CalendarView and remove it from here |
729 | void KOWhatsNextView::showIncidence(const QString &uid) | 729 | void KOWhatsNextView::showIncidence(const QString &uid) |
730 | { | 730 | { |
731 | 731 | ||
732 | if ( !mEventViewer ) { | 732 | if ( !mEventViewer ) { |
733 | qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set "); | 733 | qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set "); |
734 | return; | 734 | return; |
735 | } | 735 | } |
736 | //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl; | 736 | //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl; |
737 | //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1()); | 737 | //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1()); |
738 | if (uid.startsWith("event:")) { | 738 | if (uid.startsWith("event:")) { |
739 | #ifdef DESKTOP_VERSION | 739 | #ifdef DESKTOP_VERSION |
740 | Event *event = calendar()->event(uid.mid(8)); | 740 | Event *event = calendar()->event(uid.mid(8)); |
741 | #else | 741 | #else |
742 | Event *event = calendar()->event(uid.mid(6)); | 742 | Event *event = calendar()->event(uid.mid(6)); |
743 | #endif | 743 | #endif |
744 | //qDebug("event %d uid %s ", event, uid.mid(6).latin1()); | 744 | //qDebug("event %d uid %s ", event, uid.mid(6).latin1()); |
745 | if (!event) return; | 745 | if (!event) return; |
746 | //createEventViewer(); | 746 | //createEventViewer(); |
747 | mEventViewer->setEvent(event); | 747 | mEventViewer->setEvent(event); |
748 | } else if (uid.startsWith("todo:")) { | 748 | } else if (uid.startsWith("todo:")) { |
749 | #ifdef DESKTOP_VERSION | 749 | #ifdef DESKTOP_VERSION |
750 | Todo *todo = calendar()->todo(uid.mid(7)); | 750 | Todo *todo = calendar()->todo(uid.mid(7)); |
751 | #else | 751 | #else |
752 | Todo *todo = calendar()->todo(uid.mid(5)); | 752 | Todo *todo = calendar()->todo(uid.mid(5)); |
753 | #endif | 753 | #endif |
754 | if (!todo) return; | 754 | if (!todo) return; |
755 | //createEventViewer(); | 755 | //createEventViewer(); |
756 | mEventViewer->setTodo(todo); | 756 | mEventViewer->setTodo(todo); |
757 | } else { | 757 | } else { |
758 | return; | 758 | return; |
759 | 759 | ||
760 | } | 760 | } |
761 | mEventViewer->showMe(); | 761 | mEventViewer->showMe(); |
762 | mEventViewer->raise(); | 762 | mEventViewer->raise(); |
763 | } | 763 | } |
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp index 567ae54..84edc0d 100644 --- a/microkde/KDGanttMinimizeSplitter.cpp +++ b/microkde/KDGanttMinimizeSplitter.cpp | |||
@@ -1,1636 +1,1646 @@ | |||
1 | /* -*- Mode: C++ -*- | 1 | /* -*- Mode: C++ -*- |
2 | $Id$ | 2 | $Id$ |
3 | */ | 3 | */ |
4 | 4 | ||
5 | /**************************************************************************** | 5 | /**************************************************************************** |
6 | ** Copyright (C) 2002-2004 Klarälvdalens Datakonsult AB. All rights reserved. | 6 | ** Copyright (C) 2002-2004 Klarälvdalens Datakonsult AB. All rights reserved. |
7 | ** | 7 | ** |
8 | ** This file is part of the KDGantt library. | 8 | ** This file is part of the KDGantt library. |
9 | ** | 9 | ** |
10 | ** This file may be distributed and/or modified under the terms of the | 10 | ** This file may be distributed and/or modified under the terms of the |
11 | ** GNU General Public License version 2 as published by the Free Software | 11 | ** GNU General Public License version 2 as published by the Free Software |
12 | ** Foundation and appearing in the file LICENSE.GPL included in the | 12 | ** Foundation and appearing in the file LICENSE.GPL included in the |
13 | ** packaging of this file. | 13 | ** packaging of this file. |
14 | ** | 14 | ** |
15 | ** Licensees holding valid commercial KDGantt licenses may use this file in | 15 | ** Licensees holding valid commercial KDGantt licenses may use this file in |
16 | ** accordance with the KDGantt Commercial License Agreement provided with | 16 | ** accordance with the KDGantt Commercial License Agreement provided with |
17 | ** the Software. | 17 | ** the Software. |
18 | ** | 18 | ** |
19 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 19 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
20 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 20 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
21 | ** | 21 | ** |
22 | ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for | 22 | ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for |
23 | ** information about KDGantt Commercial License Agreements. | 23 | ** information about KDGantt Commercial License Agreements. |
24 | ** | 24 | ** |
25 | ** Contact info@klaralvdalens-datakonsult.se if any conditions of this | 25 | ** Contact info@klaralvdalens-datakonsult.se if any conditions of this |
26 | ** licensing are not clear to you. | 26 | ** licensing are not clear to you. |
27 | ** | 27 | ** |
28 | ** As a special exception, permission is given to link this program | 28 | ** As a special exception, permission is given to link this program |
29 | ** with any edition of Qt, and distribute the resulting executable, | 29 | ** with any edition of Qt, and distribute the resulting executable, |
30 | ** without including the source code for Qt in the source distribution. | 30 | ** without including the source code for Qt in the source distribution. |
31 | ** | 31 | ** |
32 | **********************************************************************/ | 32 | **********************************************************************/ |
33 | 33 | ||
34 | #include "KDGanttMinimizeSplitter.h" | 34 | #include "KDGanttMinimizeSplitter.h" |
35 | #ifndef QT_NO_SPLITTER___ | 35 | #ifndef QT_NO_SPLITTER___ |
36 | 36 | ||
37 | #include "qpainter.h" | 37 | #include "qpainter.h" |
38 | #include "qdrawutil.h" | 38 | #include "qdrawutil.h" |
39 | #include "qbitmap.h" | 39 | #include "qbitmap.h" |
40 | #if QT_VERSION >= 0x030000 | 40 | #if QT_VERSION >= 0x030000 |
41 | #include "qptrlist.h" | 41 | #include "qptrlist.h" |
42 | #include "qmemarray.h" | 42 | #include "qmemarray.h" |
43 | #else | 43 | #else |
44 | #include <qlist.h> | 44 | #include <qlist.h> |
45 | #include <qarray.h> | 45 | #include <qarray.h> |
46 | #define QPtrList QList | 46 | #define QPtrList QList |
47 | #define QMemArray QArray | 47 | #define QMemArray QArray |
48 | #endif | 48 | #endif |
49 | #include "qlayoutengine_p.h" | 49 | #include "qlayoutengine_p.h" |
50 | #include "qobjectlist.h" | 50 | #include "qobjectlist.h" |
51 | #include "qstyle.h" | 51 | #include "qstyle.h" |
52 | #include "qapplication.h" //sendPostedEvents | 52 | #include "qapplication.h" //sendPostedEvents |
53 | #include <qvaluelist.h> | 53 | #include <qvaluelist.h> |
54 | #include <qcursor.h> | 54 | #include <qcursor.h> |
55 | #ifndef KDGANTT_MASTER_CVS | 55 | #ifndef KDGANTT_MASTER_CVS |
56 | //#include "KDGanttMinimizeSplitter.moc" | 56 | //#include "KDGanttMinimizeSplitter.moc" |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | #ifndef DOXYGEN_SKIP_INTERNAL | 61 | #ifndef DOXYGEN_SKIP_INTERNAL |
62 | 62 | ||
63 | #if QT_VERSION >= 232 | 63 | #if QT_VERSION >= 232 |
64 | static int mouseOffset; | 64 | static int mouseOffset; |
65 | static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky | 65 | static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky |
66 | 66 | ||
67 | 67 | ||
68 | KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, | 68 | KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, |
69 | KDGanttMinimizeSplitter *parent, const char * name ) | 69 | KDGanttMinimizeSplitter *parent, const char * name ) |
70 | : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) | 70 | : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) |
71 | { | 71 | { |
72 | 72 | ||
73 | if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->width() < 650 ) { | 73 | if ( QApplication::desktop()->width() > 320 && QApplication::desktop()->width() < 650 ) { |
74 | mSizeHint = QSize(7,7); | 74 | mSizeHint = QSize(7,7); |
75 | mUseOffset = true; | 75 | mUseOffset = true; |
76 | } else { | 76 | } else { |
77 | mSizeHint = QSize(6,6); | 77 | mSizeHint = QSize(6,6); |
78 | mUseOffset = false; | 78 | mUseOffset = false; |
79 | } | 79 | } |
80 | s = parent; | 80 | s = parent; |
81 | setOrientation(o); | 81 | setOrientation(o); |
82 | setMouseTracking( true ); | 82 | setMouseTracking( true ); |
83 | //setMaximumHeight( 5 ); // test only | 83 | //setMaximumHeight( 5 ); // test only |
84 | } | 84 | } |
85 | 85 | ||
86 | QSize KDGanttSplitterHandle::sizeHint() const | 86 | QSize KDGanttSplitterHandle::sizeHint() const |
87 | { | 87 | { |
88 | return mSizeHint; | 88 | return mSizeHint; |
89 | } | 89 | } |
90 | 90 | ||
91 | void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) | 91 | void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) |
92 | { | 92 | { |
93 | orient = o; | 93 | orient = o; |
94 | #ifndef QT_NO_CURSOR | 94 | #ifndef QT_NO_CURSOR |
95 | if ( o == KDGanttMinimizeSplitter::Horizontal ) | 95 | if ( o == KDGanttMinimizeSplitter::Horizontal ) |
96 | setCursor( splitHCursor ); | 96 | setCursor( splitHCursor ); |
97 | else | 97 | else |
98 | setCursor( splitVCursor ); | 98 | setCursor( splitVCursor ); |
99 | #endif | 99 | #endif |
100 | } | 100 | } |
101 | 101 | ||
102 | 102 | ||
103 | void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) | 103 | void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) |
104 | { | 104 | { |
105 | updateCursor( e->pos() ); | 105 | updateCursor( e->pos() ); |
106 | if ( !(e->state()&LeftButton) ) | 106 | if ( !(e->state()&LeftButton) ) |
107 | return; | 107 | return; |
108 | 108 | ||
109 | if ( _activeButton != 0) | 109 | if ( _activeButton != 0) |
110 | return; | 110 | return; |
111 | 111 | ||
112 | QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) | 112 | QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) |
113 | - mouseOffset; | 113 | - mouseOffset; |
114 | if ( true /*opaque()*/ ) { | 114 | if ( true /*opaque()*/ ) { |
115 | s->moveSplitter( pos, id() ); | 115 | s->moveSplitter( pos, id() ); |
116 | } else { | 116 | } else { |
117 | int min = pos; int max = pos; | 117 | int min = pos; int max = pos; |
118 | s->getRange( id(), &min, &max ); | 118 | s->getRange( id(), &min, &max ); |
119 | s->setRubberband( QMAX( min, QMIN(max, pos ))); | 119 | s->setRubberband( QMAX( min, QMIN(max, pos ))); |
120 | } | 120 | } |
121 | _collapsed = false; | 121 | _collapsed = false; |
122 | } | 122 | } |
123 | 123 | ||
124 | void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) | 124 | void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) |
125 | { | 125 | { |
126 | if ( e->button() == LeftButton ) { | 126 | if ( e->button() == LeftButton ) { |
127 | _activeButton = onButton( e->pos() ); | 127 | _activeButton = onButton( e->pos() ); |
128 | mouseOffset = s->pick(e->pos()); | 128 | mouseOffset = s->pick(e->pos()); |
129 | if ( _activeButton != 0) | 129 | if ( _activeButton != 0) |
130 | repaint(); | 130 | repaint(); |
131 | updateCursor( e->pos() ); | 131 | updateCursor( e->pos() ); |
132 | } | 132 | } |
133 | } | 133 | } |
134 | 134 | ||
135 | void KDGanttSplitterHandle::updateCursor( const QPoint& p) | 135 | void KDGanttSplitterHandle::updateCursor( const QPoint& p) |
136 | { | 136 | { |
137 | if ( onButton( p ) != 0 ) { | 137 | if ( onButton( p ) != 0 ) { |
138 | setCursor( arrowCursor ); | 138 | setCursor( arrowCursor ); |
139 | } | 139 | } |
140 | else { | 140 | else { |
141 | if ( orient == KDGanttMinimizeSplitter::Horizontal ) | 141 | if ( orient == KDGanttMinimizeSplitter::Horizontal ) |
142 | setCursor( splitHCursor ); | 142 | setCursor( splitHCursor ); |
143 | else | 143 | else |
144 | setCursor( splitVCursor ); | 144 | setCursor( splitVCursor ); |
145 | } | 145 | } |
146 | } | 146 | } |
147 | void KDGanttSplitterHandle::toggle() | 147 | void KDGanttSplitterHandle::toggle() |
148 | { | 148 | { |
149 | int pos; | 149 | int pos; |
150 | int min, max; | 150 | int min, max; |
151 | if ( !_collapsed ) { | 151 | if ( !_collapsed ) { |
152 | s->expandPos( id(), &min, &max ); | 152 | s->expandPos( id(), &min, &max ); |
153 | if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Left | 153 | if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Left |
154 | || s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) { | 154 | || s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) { |
155 | pos = min; | 155 | pos = min; |
156 | } | 156 | } |
157 | else { | 157 | else { |
158 | pos = max; | 158 | pos = max; |
159 | } | 159 | } |
160 | 160 | ||
161 | _origPos = s->pick(mapToParent( QPoint( 0,0 ) )); | 161 | _origPos = s->pick(mapToParent( QPoint( 0,0 ) )); |
162 | s->moveSplitter( pos, id() ); | 162 | s->moveSplitter( pos, id() ); |
163 | _collapsed = true; | 163 | _collapsed = true; |
164 | } | 164 | } |
165 | else { | 165 | else { |
166 | s->moveSplitter( _origPos, id() ); | 166 | s->moveSplitter( _origPos, id() ); |
167 | _collapsed = false; | 167 | _collapsed = false; |
168 | } | 168 | } |
169 | repaint(); | ||
169 | } | 170 | } |
170 | 171 | ||
171 | void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) | 172 | void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) |
172 | { | 173 | { |
173 | if ( _activeButton != 0 ) { | 174 | if ( _activeButton != 0 ) { |
174 | if ( onButton( e->pos() ) == _activeButton ) | 175 | if ( onButton( e->pos() ) == _activeButton ) |
175 | { | 176 | { |
176 | toggle(); | 177 | toggle(); |
177 | } | 178 | } |
178 | _activeButton = 0; | 179 | _activeButton = 0; |
179 | updateCursor( e->pos() ); | 180 | updateCursor( e->pos() ); |
180 | } | 181 | } |
181 | else { | 182 | else { |
182 | if ( !opaque() && e->button() == LeftButton ) { | 183 | if ( !opaque() && e->button() == LeftButton ) { |
183 | QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) | 184 | QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) |
184 | - mouseOffset; | 185 | - mouseOffset; |
185 | s->setRubberband( -1 ); | 186 | s->setRubberband( -1 ); |
186 | s->moveSplitter( pos, id() ); | 187 | s->moveSplitter( pos, id() ); |
187 | } | 188 | } |
188 | } | 189 | } |
189 | repaint(); | 190 | repaint(); |
190 | } | 191 | } |
191 | 192 | ||
192 | int KDGanttSplitterHandle::onButton( const QPoint& p ) | 193 | int KDGanttSplitterHandle::onButton( const QPoint& p ) |
193 | { | 194 | { |
194 | QValueList<QPointArray> list = buttonRegions(); | 195 | QValueList<QPointArray> list = buttonRegions(); |
195 | int index = 1; | 196 | int index = 1; |
196 | int add = 12; | 197 | int add = 12; |
197 | for( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { | 198 | for( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { |
198 | QRect rect = (*it).boundingRect(); | 199 | QRect rect = (*it).boundingRect(); |
199 | rect.setLeft( rect.left()- add ); | 200 | rect.setLeft( rect.left()- add ); |
200 | rect.setRight( rect.right() + add); | 201 | rect.setRight( rect.right() + add); |
201 | rect.setTop( rect.top()- add ); | 202 | rect.setTop( rect.top()- add ); |
202 | rect.setBottom( rect.bottom() + add); | 203 | rect.setBottom( rect.bottom() + add); |
203 | if ( rect.contains( p ) ) { | 204 | if ( rect.contains( p ) ) { |
204 | return index; | 205 | return index; |
205 | } | 206 | } |
206 | index++; | 207 | index++; |
207 | } | 208 | } |
208 | return 0; | 209 | return 0; |
209 | } | 210 | } |
210 | 211 | ||
211 | 212 | ||
212 | QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() | 213 | QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() |
213 | { | 214 | { |
214 | QValueList<QPointArray> list; | 215 | QValueList<QPointArray> list; |
215 | 216 | ||
216 | int sw = 8; | 217 | int sw = 8; |
217 | int yyy = 1; | 218 | int yyy = 1; |
218 | int xxx = 1; | 219 | int xxx = 1; |
219 | int voffset[] = { (int) -sw*3, (int) sw*3 }; | 220 | int voffset[] = { (int) -sw*3, (int) sw*3 }; |
220 | for ( int i = 0; i < 2; i++ ) { | 221 | for ( int i = 0; i < 2; i++ ) { |
221 | QPointArray arr; | 222 | QPointArray arr; |
222 | if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right || | 223 | if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right || |
223 | _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left) { | 224 | _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left) { |
224 | int mid = height()/2 + voffset[i]; | 225 | int mid = height()/2 + voffset[i]; |
225 | arr.setPoints( 3, | 226 | arr.setPoints( 3, |
226 | 1-xxx, mid - sw + 4, | 227 | 1-xxx, mid - sw + 4, |
227 | sw-3-xxx, mid, | 228 | sw-3-xxx, mid, |
228 | 1-xxx, mid + sw -4); | 229 | 1-xxx, mid + sw -4); |
229 | } | 230 | } |
230 | else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left || | 231 | else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left || |
231 | _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) { | 232 | _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) { |
232 | int mid = height()/2 + voffset[i]; | 233 | int mid = height()/2 + voffset[i]; |
233 | arr.setPoints( 3, | 234 | arr.setPoints( 3, |
234 | sw-4, mid - sw + 4, | 235 | sw-4, mid - sw + 4, |
235 | 0, mid, | 236 | 0, mid, |
236 | sw-4, mid + sw - 4); | 237 | sw-4, mid + sw - 4); |
237 | } | 238 | } |
238 | else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up || | 239 | else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up || |
239 | _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down) { | 240 | _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down) { |
240 | int mid = width()/2 + voffset[i]; | 241 | int mid = width()/2 + voffset[i]; |
241 | arr.setPoints( 3, | 242 | arr.setPoints( 3, |
242 | mid - sw + 4, sw-4, | 243 | mid - sw + 4, sw-4, |
243 | mid, 0, | 244 | mid, 0, |
244 | mid + sw - 4, sw-4 ); | 245 | mid + sw - 4, sw-4 ); |
245 | } | 246 | } |
246 | else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down || | 247 | else if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Down || |
247 | _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) { | 248 | _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Up ) { |
248 | int mid = width()/2 + voffset[i]; | 249 | int mid = width()/2 + voffset[i]; |
249 | arr.setPoints( 3, | 250 | arr.setPoints( 3, |
250 | mid - sw + 4, 1-yyy, | 251 | mid - sw + 4, 1-yyy, |
251 | mid, sw-3-yyy, | 252 | mid, sw-3-yyy, |
252 | mid + sw -4, 1-yyy); | 253 | mid + sw -4, 1-yyy); |
253 | } | 254 | } |
254 | list.append( arr ); | 255 | list.append( arr ); |
255 | } | 256 | } |
256 | return list; | 257 | return list; |
257 | } | 258 | } |
258 | 259 | ||
259 | void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) | 260 | void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) |
260 | { | 261 | { |
261 | QPixmap buffer( size() ); | 262 | QPixmap buffer( size() ); |
262 | QPainter p( &buffer ); | 263 | QPainter p( &buffer ); |
263 | 264 | ||
264 | //LR | 265 | //LR |
265 | // Draw the splitter rectangle | 266 | // Draw the splitter rectangle |
266 | p.setBrush( colorGroup().background() ); | 267 | p.setBrush( colorGroup().background() ); |
267 | p.setPen( colorGroup().foreground() ); | 268 | p.setPen( colorGroup().foreground() ); |
268 | //p.drawRect( rect() ); | 269 | //p.drawRect( rect() ); |
269 | buffer.fill( colorGroup().background() ); | 270 | buffer.fill( colorGroup().background() ); |
270 | //buffer.fill( backgroundColor() ); | 271 | //buffer.fill( backgroundColor() ); |
271 | // parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), parentWidget()->colorGroup()); | 272 | // parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), parentWidget()->colorGroup()); |
272 | 273 | ||
273 | int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size | 274 | int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size |
274 | 275 | ||
275 | // arrow color | 276 | // arrow color |
276 | QColor col; | 277 | QColor col; |
277 | if ( _activeButton ) | 278 | if ( _activeButton ) |
278 | col = colorGroup().background().dark( 250 ); | 279 | col = colorGroup().background().dark( 250 ); |
279 | else | 280 | else |
280 | col = colorGroup().background().dark( 150 ); | 281 | col = colorGroup().background().dark( 150 ); |
281 | //QColor col = backgroundColor().dark( 130 ); | 282 | //QColor col = backgroundColor().dark( 130 ); |
282 | p.setBrush( col ); | 283 | p.setBrush( col ); |
283 | p.setPen( col ); | 284 | p.setPen( col ); |
284 | 285 | ||
285 | QValueList<QPointArray> list = buttonRegions(); | 286 | QValueList<QPointArray> list = buttonRegions(); |
286 | int index = 1; | 287 | int index = 1; |
287 | if ( mUseOffset ) | 288 | if ( mUseOffset ) |
288 | p.translate( 0, 1 ); | 289 | p.translate( 0, 1 ); |
289 | for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { | 290 | for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { |
290 | if ( index == _activeButton ) { | 291 | if ( index == _activeButton ) { |
291 | 292 | ||
292 | /* | 293 | /* |
293 | if ( ! _collapsed ) { | 294 | if ( ! _collapsed ) { |
294 | p.save(); | 295 | p.save(); |
295 | // p.translate( parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftHorizontal ), | 296 | // p.translate( parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftHorizontal ), |
296 | // parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftVertical ) ); | 297 | // parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftVertical ) ); |
297 | p.translate( -1, 0 ); | 298 | p.translate( -1, 0 ); |
298 | p.drawPolygon( *it, true ); | 299 | p.drawPolygon( *it, true ); |
299 | p.restore(); } else | 300 | p.restore(); } else |
300 | */ | 301 | */ |
301 | p.drawPolygon( *it, true ); | 302 | p.drawPolygon( *it, true ); |
302 | 303 | ||
303 | } | 304 | } |
304 | else { | 305 | else { |
305 | /* | 306 | /* |
306 | if ( ! _collapsed ) { | 307 | if ( ! _collapsed ) { |
307 | p.save(); | 308 | p.save(); |
308 | p.translate( -1, 0 ); | 309 | p.translate( -1, 0 ); |
309 | p.drawPolygon( *it, true ); | 310 | p.drawPolygon( *it, true ); |
310 | p.restore(); | 311 | p.restore(); |
311 | } else | 312 | } else |
312 | */ | 313 | */ |
313 | p.drawPolygon( *it, true ); | 314 | p.drawPolygon( *it, true ); |
314 | 315 | ||
315 | } | 316 | } |
316 | index++; | 317 | index++; |
317 | } | 318 | } |
318 | 319 | ||
319 | // Draw the lines between the arrows | 320 | // Draw the lines between the arrows |
320 | if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Left || | 321 | if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Left || |
321 | s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) { | 322 | s->minimizeDirection() == KDGanttMinimizeSplitter::Right ) { |
322 | int mid = height()/2; | 323 | int mid = height()/2; |
323 | p.drawLine ( 1, mid - sw, 1, mid + sw ); | 324 | p.drawLine ( 1, mid - sw, 1, mid + sw ); |
324 | p.drawLine ( 3, mid - sw, 3, mid + sw ); | 325 | p.drawLine ( 3, mid - sw, 3, mid + sw ); |
325 | } | 326 | } |
326 | else if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Up || | 327 | else if ( s->minimizeDirection() == KDGanttMinimizeSplitter::Up || |
327 | s->minimizeDirection() == KDGanttMinimizeSplitter::Down ) { | 328 | s->minimizeDirection() == KDGanttMinimizeSplitter::Down ) { |
328 | int mid = width()/2; | 329 | int mid = width()/2; |
329 | p.drawLine( mid -sw, 1, mid +sw, 1 ); | 330 | p.drawLine( mid -sw, 1, mid +sw, 1 ); |
330 | p.drawLine( mid -sw, 3, mid +sw, 3 ); | 331 | p.drawLine( mid -sw, 3, mid +sw, 3 ); |
331 | } | 332 | } |
332 | bitBlt( this, 0, 0, &buffer ); | 333 | bitBlt( this, 0, 0, &buffer ); |
333 | 334 | ||
334 | } | 335 | } |
335 | #endif | 336 | #endif |
336 | 337 | ||
337 | class QSplitterLayoutStruct | 338 | class QSplitterLayoutStruct |
338 | { | 339 | { |
339 | public: | 340 | public: |
340 | KDGanttMinimizeSplitter::ResizeMode mode; | 341 | KDGanttMinimizeSplitter::ResizeMode mode; |
341 | QCOORD sizer; | 342 | QCOORD sizer; |
342 | bool isSplitter; | 343 | bool isSplitter; |
343 | QWidget *wid; | 344 | QWidget *wid; |
344 | }; | 345 | }; |
345 | 346 | ||
346 | class QSplitterData | 347 | class QSplitterData |
347 | { | 348 | { |
348 | public: | 349 | public: |
349 | QSplitterData() : opaque( FALSE ), firstShow( TRUE ) {} | 350 | QSplitterData() : opaque( FALSE ), firstShow( TRUE ) {} |
350 | 351 | ||
351 | QPtrList<QSplitterLayoutStruct> list; | 352 | QPtrList<QSplitterLayoutStruct> list; |
352 | bool opaque; | 353 | bool opaque; |
353 | bool firstShow; | 354 | bool firstShow; |
354 | }; | 355 | }; |
355 | 356 | ||
356 | void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, | 357 | void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, |
357 | int space, int spacer ); | 358 | int space, int spacer ); |
358 | #endif // DOXYGEN_SKIP_INTERNAL | 359 | #endif // DOXYGEN_SKIP_INTERNAL |
359 | 360 | ||
360 | 361 | ||
361 | /*! | 362 | /*! |
362 | \class KDGanttMinimizeSplitter KDGanttMinimizeSplitter.h | 363 | \class KDGanttMinimizeSplitter KDGanttMinimizeSplitter.h |
363 | \brief The KDGanttMinimizeSplitter class implements a splitter | 364 | \brief The KDGanttMinimizeSplitter class implements a splitter |
364 | widget with minimize buttons. | 365 | widget with minimize buttons. |
365 | 366 | ||
366 | This class (and its documentation) is largely a copy of Qt's | 367 | This class (and its documentation) is largely a copy of Qt's |
367 | QSplitter; the copying was necessary because QSplitter is not | 368 | QSplitter; the copying was necessary because QSplitter is not |
368 | extensible at all. QSplitter and its documentation are licensed | 369 | extensible at all. QSplitter and its documentation are licensed |
369 | according to the GPL and the Qt Professional License (if you hold | 370 | according to the GPL and the Qt Professional License (if you hold |
370 | such a license) and are (C) Trolltech AS. | 371 | such a license) and are (C) Trolltech AS. |
371 | 372 | ||
372 | A splitter lets the user control the size of child widgets by | 373 | A splitter lets the user control the size of child widgets by |
373 | dragging the boundary between the children. Any number of widgets | 374 | dragging the boundary between the children. Any number of widgets |
374 | may be controlled. | 375 | may be controlled. |
375 | 376 | ||
376 | To show a QListBox, a QListView and a QTextEdit side by side: | 377 | To show a QListBox, a QListView and a QTextEdit side by side: |
377 | 378 | ||
378 | \code | 379 | \code |
379 | KDGanttMinimizeSplitter *split = new KDGanttMinimizeSplitter( parent ); | 380 | KDGanttMinimizeSplitter *split = new KDGanttMinimizeSplitter( parent ); |
380 | QListBox *lb = new QListBox( split ); | 381 | QListBox *lb = new QListBox( split ); |
381 | QListView *lv = new QListView( split ); | 382 | QListView *lv = new QListView( split ); |
382 | QTextEdit *ed = new QTextEdit( split ); | 383 | QTextEdit *ed = new QTextEdit( split ); |
383 | \endcode | 384 | \endcode |
384 | 385 | ||
385 | In KDGanttMinimizeSplitter, the boundary can be either horizontal or | 386 | In KDGanttMinimizeSplitter, the boundary can be either horizontal or |
386 | vertical. The default is horizontal (the children are side by side) | 387 | vertical. The default is horizontal (the children are side by side) |
387 | but you can use setOrientation( QSplitter::Vertical ) to set it to | 388 | but you can use setOrientation( QSplitter::Vertical ) to set it to |
388 | vertical. | 389 | vertical. |
389 | 390 | ||
390 | Use setResizeMode() to specify | 391 | Use setResizeMode() to specify |
391 | that a widget should keep its size when the splitter is resized. | 392 | that a widget should keep its size when the splitter is resized. |
392 | 393 | ||
393 | Although KDGanttMinimizeSplitter normally resizes the children only | 394 | Although KDGanttMinimizeSplitter normally resizes the children only |
394 | at the end of a resize operation, if you call setOpaqueResize( TRUE | 395 | at the end of a resize operation, if you call setOpaqueResize( TRUE |
395 | ) the widgets are resized as often as possible. | 396 | ) the widgets are resized as often as possible. |
396 | 397 | ||
397 | The initial distribution of size between the widgets is determined | 398 | The initial distribution of size between the widgets is determined |
398 | by the initial size of each widget. You can also use setSizes() to | 399 | by the initial size of each widget. You can also use setSizes() to |
399 | set the sizes of all the widgets. The function sizes() returns the | 400 | set the sizes of all the widgets. The function sizes() returns the |
400 | sizes set by the user. | 401 | sizes set by the user. |
401 | 402 | ||
402 | If you hide() a child, its space will be distributed among the other | 403 | If you hide() a child, its space will be distributed among the other |
403 | children. It will be reinstated when you show() it again. It is also | 404 | children. It will be reinstated when you show() it again. It is also |
404 | possible to reorder the widgets within the splitter using | 405 | possible to reorder the widgets within the splitter using |
405 | moveToFirst() and moveToLast(). | 406 | moveToFirst() and moveToLast(). |
406 | */ | 407 | */ |
407 | 408 | ||
408 | 409 | ||
409 | 410 | ||
410 | static QSize minSize( const QWidget* /*w*/ ) | 411 | static QSize minSize( const QWidget* /*w*/ ) |
411 | { | 412 | { |
412 | return QSize(0,0); | 413 | return QSize(0,0); |
413 | } | 414 | } |
414 | 415 | ||
415 | // This is the original version of minSize | 416 | // This is the original version of minSize |
416 | static QSize minSizeHint( const QWidget* w ) | 417 | static QSize minSizeHint( const QWidget* w ) |
417 | { | 418 | { |
418 | QSize min = w->minimumSize(); | 419 | QSize min = w->minimumSize(); |
419 | QSize s; | 420 | QSize s; |
420 | if ( min.height() <= 0 || min.width() <= 0 ) | 421 | if ( min.height() <= 0 || min.width() <= 0 ) |
421 | s = w->minimumSizeHint(); | 422 | s = w->minimumSizeHint(); |
422 | if ( min.height() > 0 ) | 423 | if ( min.height() > 0 ) |
423 | s.setHeight( min.height() ); | 424 | s.setHeight( min.height() ); |
424 | if ( min.width() > 0 ) | 425 | if ( min.width() > 0 ) |
425 | s.setWidth( min.width() ); | 426 | s.setWidth( min.width() ); |
426 | return s.expandedTo(QSize(0,0)); | 427 | return s.expandedTo(QSize(0,0)); |
427 | } | 428 | } |
428 | 429 | ||
429 | 430 | ||
430 | 431 | ||
431 | /*! | 432 | /*! |
432 | Constructs a horizontal splitter with the \a parent and \a | 433 | Constructs a horizontal splitter with the \a parent and \a |
433 | name arguments being passed on to the QFrame constructor. | 434 | name arguments being passed on to the QFrame constructor. |
434 | */ | 435 | */ |
435 | KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *name ) | 436 | KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *name ) |
436 | :QFrame(parent,name,WPaintUnclipped) | 437 | :QFrame(parent,name,WPaintUnclipped) |
437 | { | 438 | { |
438 | mFirstHandle = 0; | 439 | mFirstHandle = 0; |
439 | #if QT_VERSION >= 232 | 440 | #if QT_VERSION >= 232 |
440 | orient = Horizontal; | 441 | orient = Horizontal; |
441 | init(); | 442 | init(); |
442 | #endif | 443 | #endif |
443 | } | 444 | } |
444 | 445 | ||
445 | /*! | 446 | /*! |
446 | Constructs a splitter with orientation \a o with the \a parent | 447 | Constructs a splitter with orientation \a o with the \a parent |
447 | and \a name arguments being passed on to the QFrame constructor. | 448 | and \a name arguments being passed on to the QFrame constructor. |
448 | */ | 449 | */ |
449 | KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name ) | 450 | KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name ) |
450 | :QFrame(parent,name,WPaintUnclipped) | 451 | :QFrame(parent,name,WPaintUnclipped) |
451 | { | 452 | { |
452 | mFirstHandle = 0; | 453 | mFirstHandle = 0; |
453 | #if QT_VERSION >= 232 | 454 | #if QT_VERSION >= 232 |
454 | orient = o; | 455 | orient = o; |
455 | init(); | 456 | init(); |
456 | #endif | 457 | #endif |
457 | } | 458 | } |
458 | 459 | ||
459 | /*! | 460 | /*! |
460 | Destroys the splitter and any children. | 461 | Destroys the splitter and any children. |
461 | */ | 462 | */ |
462 | KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() | 463 | KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() |
463 | { | 464 | { |
464 | #if QT_VERSION >= 232 | 465 | #if QT_VERSION >= 232 |
465 | data->list.setAutoDelete( TRUE ); | 466 | data->list.setAutoDelete( TRUE ); |
466 | delete data; | 467 | delete data; |
467 | #endif | 468 | #endif |
468 | } | 469 | } |
469 | 470 | ||
470 | 471 | ||
471 | #if QT_VERSION >= 232 | 472 | #if QT_VERSION >= 232 |
472 | void KDGanttMinimizeSplitter::init() | 473 | void KDGanttMinimizeSplitter::init() |
473 | { | 474 | { |
474 | data = new QSplitterData; | 475 | data = new QSplitterData; |
475 | if ( orient == Horizontal ) | 476 | if ( orient == Horizontal ) |
476 | setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); | 477 | setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); |
477 | else | 478 | else |
478 | setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); | 479 | setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); |
479 | } | 480 | } |
480 | #endif | 481 | #endif |
481 | 482 | ||
482 | 483 | ||
484 | void KDGanttMinimizeSplitter::toggle() | ||
485 | { | ||
486 | if ( mFirstHandle ) | ||
487 | mFirstHandle->toggle(); | ||
488 | else | ||
489 | qDebug("KDGanttMinimizeSplitter::toggle::sorry, handle not available "); | ||
490 | |||
491 | } | ||
492 | |||
483 | 493 | ||
484 | /*! | 494 | /*! |
485 | \brief the orientation of the splitter | 495 | \brief the orientation of the splitter |
486 | 496 | ||
487 | By default the orientation is horizontal (the widgets are side by side). | 497 | By default the orientation is horizontal (the widgets are side by side). |
488 | The possible orientations are Qt:Vertical and Qt::Horizontal (the default). | 498 | The possible orientations are Qt:Vertical and Qt::Horizontal (the default). |
489 | */ | 499 | */ |
490 | void KDGanttMinimizeSplitter::setOrientation( Orientation o ) | 500 | void KDGanttMinimizeSplitter::setOrientation( Orientation o ) |
491 | { | 501 | { |
492 | #if QT_VERSION >= 232 | 502 | #if QT_VERSION >= 232 |
493 | if ( orient == o ) | 503 | if ( orient == o ) |
494 | return; | 504 | return; |
495 | orient = o; | 505 | orient = o; |
496 | 506 | ||
497 | if ( orient == Horizontal ) | 507 | if ( orient == Horizontal ) |
498 | setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); | 508 | setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); |
499 | else | 509 | else |
500 | setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); | 510 | setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); |
501 | 511 | ||
502 | QSplitterLayoutStruct *s = data->list.first(); | 512 | QSplitterLayoutStruct *s = data->list.first(); |
503 | while ( s ) { | 513 | while ( s ) { |
504 | if ( s->isSplitter ) | 514 | if ( s->isSplitter ) |
505 | ((KDGanttSplitterHandle*)s->wid)->setOrientation( o ); | 515 | ((KDGanttSplitterHandle*)s->wid)->setOrientation( o ); |
506 | s = data->list.next(); // ### next at end of loop, no iterator | 516 | s = data->list.next(); // ### next at end of loop, no iterator |
507 | } | 517 | } |
508 | recalc( isVisible() ); | 518 | recalc( isVisible() ); |
509 | #endif | 519 | #endif |
510 | } | 520 | } |
511 | 521 | ||
512 | 522 | ||
513 | #if QT_VERSION >= 232 | 523 | #if QT_VERSION >= 232 |
514 | /*! | 524 | /*! |
515 | \reimp | 525 | \reimp |
516 | */ | 526 | */ |
517 | void KDGanttMinimizeSplitter::resizeEvent( QResizeEvent * ) | 527 | void KDGanttMinimizeSplitter::resizeEvent( QResizeEvent * ) |
518 | { | 528 | { |
519 | doResize(); | 529 | doResize(); |
520 | } | 530 | } |
521 | 531 | ||
522 | 532 | ||
523 | /* | 533 | /* |
524 | Inserts the widget \a w at the end (or at the beginning if \a first | 534 | Inserts the widget \a w at the end (or at the beginning if \a first |
525 | is TRUE) of the splitter's list of widgets. | 535 | is TRUE) of the splitter's list of widgets. |
526 | 536 | ||
527 | It is the responsibility of the caller of this function to make sure | 537 | It is the responsibility of the caller of this function to make sure |
528 | that \a w is not already in the splitter and to call recalcId if | 538 | that \a w is not already in the splitter and to call recalcId if |
529 | needed. (If \a first is TRUE, then recalcId is very probably | 539 | needed. (If \a first is TRUE, then recalcId is very probably |
530 | needed.) | 540 | needed.) |
531 | */ | 541 | */ |
532 | QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool first ) | 542 | QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool first ) |
533 | { | 543 | { |
534 | QSplitterLayoutStruct *s; | 544 | QSplitterLayoutStruct *s; |
535 | KDGanttSplitterHandle *newHandle = 0; | 545 | KDGanttSplitterHandle *newHandle = 0; |
536 | if ( data->list.count() > 0 ) { | 546 | if ( data->list.count() > 0 ) { |
537 | s = new QSplitterLayoutStruct; | 547 | s = new QSplitterLayoutStruct; |
538 | s->mode = KeepSize; | 548 | s->mode = KeepSize; |
539 | QString tmp = "qt_splithandle_"; | 549 | QString tmp = "qt_splithandle_"; |
540 | tmp += w->name(); | 550 | tmp += w->name(); |
541 | newHandle = new KDGanttSplitterHandle( orientation(), this, tmp.latin1() ); | 551 | newHandle = new KDGanttSplitterHandle( orientation(), this, tmp.latin1() ); |
542 | if ( ! mFirstHandle ) | 552 | if ( ! mFirstHandle ) |
543 | mFirstHandle = newHandle; | 553 | mFirstHandle = newHandle; |
544 | s->wid = newHandle; | 554 | s->wid = newHandle; |
545 | newHandle->setId(data->list.count()); | 555 | newHandle->setId(data->list.count()); |
546 | s->isSplitter = TRUE; | 556 | s->isSplitter = TRUE; |
547 | s->sizer = pick( newHandle->sizeHint() ); | 557 | s->sizer = pick( newHandle->sizeHint() ); |
548 | if ( first ) | 558 | if ( first ) |
549 | data->list.insert( 0, s ); | 559 | data->list.insert( 0, s ); |
550 | else | 560 | else |
551 | data->list.append( s ); | 561 | data->list.append( s ); |
552 | } | 562 | } |
553 | s = new QSplitterLayoutStruct; | 563 | s = new QSplitterLayoutStruct; |
554 | s->mode = Stretch; | 564 | s->mode = Stretch; |
555 | s->wid = w; | 565 | s->wid = w; |
556 | if ( !testWState( WState_Resized ) && w->sizeHint().isValid() ) | 566 | if ( !testWState( WState_Resized ) && w->sizeHint().isValid() ) |
557 | s->sizer = pick( w->sizeHint() ); | 567 | s->sizer = pick( w->sizeHint() ); |
558 | else | 568 | else |
559 | s->sizer = pick( w->size() ); | 569 | s->sizer = pick( w->size() ); |
560 | s->isSplitter = FALSE; | 570 | s->isSplitter = FALSE; |
561 | if ( first ) | 571 | if ( first ) |
562 | data->list.insert( 0, s ); | 572 | data->list.insert( 0, s ); |
563 | else | 573 | else |
564 | data->list.append( s ); | 574 | data->list.append( s ); |
565 | if ( newHandle && isVisible() ) | 575 | if ( newHandle && isVisible() ) |
566 | newHandle->show(); //will trigger sending of post events | 576 | newHandle->show(); //will trigger sending of post events |
567 | return s; | 577 | return s; |
568 | } | 578 | } |
569 | 579 | ||
570 | 580 | ||
571 | /*! | 581 | /*! |
572 | Tells the splitter that a child widget has been inserted or removed. | 582 | Tells the splitter that a child widget has been inserted or removed. |
573 | The event is passed in \a c. | 583 | The event is passed in \a c. |
574 | */ | 584 | */ |
575 | void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) | 585 | void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) |
576 | { | 586 | { |
577 | if ( c->type() == QEvent::ChildInserted ) { | 587 | if ( c->type() == QEvent::ChildInserted ) { |
578 | if ( !c->child()->isWidgetType() ) | 588 | if ( !c->child()->isWidgetType() ) |
579 | return; | 589 | return; |
580 | 590 | ||
581 | if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) ) | 591 | if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) ) |
582 | return; | 592 | return; |
583 | 593 | ||
584 | QSplitterLayoutStruct *s = data->list.first(); | 594 | QSplitterLayoutStruct *s = data->list.first(); |
585 | while ( s ) { | 595 | while ( s ) { |
586 | if ( s->wid == c->child() ) | 596 | if ( s->wid == c->child() ) |
587 | return; | 597 | return; |
588 | s = data->list.next(); | 598 | s = data->list.next(); |
589 | } | 599 | } |
590 | addWidget( (QWidget*)c->child() ); | 600 | addWidget( (QWidget*)c->child() ); |
591 | recalc( isVisible() ); | 601 | recalc( isVisible() ); |
592 | 602 | ||
593 | } else if ( c->type() == QEvent::ChildRemoved ) { | 603 | } else if ( c->type() == QEvent::ChildRemoved ) { |
594 | QSplitterLayoutStruct *p = 0; | 604 | QSplitterLayoutStruct *p = 0; |
595 | if ( data->list.count() > 1 ) | 605 | if ( data->list.count() > 1 ) |
596 | p = data->list.at(1); //remove handle _after_ first widget. | 606 | p = data->list.at(1); //remove handle _after_ first widget. |
597 | QSplitterLayoutStruct *s = data->list.first(); | 607 | QSplitterLayoutStruct *s = data->list.first(); |
598 | while ( s ) { | 608 | while ( s ) { |
599 | if ( s->wid == c->child() ) { | 609 | if ( s->wid == c->child() ) { |
600 | data->list.removeRef( s ); | 610 | data->list.removeRef( s ); |
601 | delete s; | 611 | delete s; |
602 | if ( p && p->isSplitter ) { | 612 | if ( p && p->isSplitter ) { |
603 | data->list.removeRef( p ); | 613 | data->list.removeRef( p ); |
604 | delete p->wid; //will call childEvent | 614 | delete p->wid; //will call childEvent |
605 | delete p; | 615 | delete p; |
606 | } | 616 | } |
607 | recalcId(); | 617 | recalcId(); |
608 | doResize(); | 618 | doResize(); |
609 | return; | 619 | return; |
610 | } | 620 | } |
611 | p = s; | 621 | p = s; |
612 | s = data->list.next(); | 622 | s = data->list.next(); |
613 | } | 623 | } |
614 | } | 624 | } |
615 | } | 625 | } |
616 | 626 | ||
617 | 627 | ||
618 | /*! | 628 | /*! |
619 | Shows a rubber band at position \a p. If \a p is negative, the | 629 | Shows a rubber band at position \a p. If \a p is negative, the |
620 | rubber band is removed. | 630 | rubber band is removed. |
621 | */ | 631 | */ |
622 | void KDGanttMinimizeSplitter::setRubberband( int p ) | 632 | void KDGanttMinimizeSplitter::setRubberband( int p ) |
623 | { | 633 | { |
624 | QPainter paint( this ); | 634 | QPainter paint( this ); |
625 | paint.setPen( gray ); | 635 | paint.setPen( gray ); |
626 | paint.setBrush( gray ); | 636 | paint.setBrush( gray ); |
627 | paint.setRasterOp( XorROP ); | 637 | paint.setRasterOp( XorROP ); |
628 | QRect r = contentsRect(); | 638 | QRect r = contentsRect(); |
629 | const int rBord = 3; //Themable???? | 639 | const int rBord = 3; //Themable???? |
630 | #if QT_VERSION >= 0x030000 | 640 | #if QT_VERSION >= 0x030000 |
631 | int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); | 641 | int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); |
632 | #else | 642 | #else |
633 | int sw = style().splitterWidth(); | 643 | int sw = style().splitterWidth(); |
634 | #endif | 644 | #endif |
635 | if ( orient == Horizontal ) { | 645 | if ( orient == Horizontal ) { |
636 | if ( opaqueOldPos >= 0 ) | 646 | if ( opaqueOldPos >= 0 ) |
637 | paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), | 647 | paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), |
638 | 2*rBord, r.height() ); | 648 | 2*rBord, r.height() ); |
639 | if ( p >= 0 ) | 649 | if ( p >= 0 ) |
640 | paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() ); | 650 | paint.drawRect( p + sw/2 - rBord, r.y(), 2*rBord, r.height() ); |
641 | } else { | 651 | } else { |
642 | if ( opaqueOldPos >= 0 ) | 652 | if ( opaqueOldPos >= 0 ) |
643 | paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, | 653 | paint.drawRect( r.x(), opaqueOldPos + sw/2 - rBord, |
644 | r.width(), 2*rBord ); | 654 | r.width(), 2*rBord ); |
645 | if ( p >= 0 ) | 655 | if ( p >= 0 ) |
646 | paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); | 656 | paint.drawRect( r.x(), p + sw/2 - rBord, r.width(), 2*rBord ); |
647 | } | 657 | } |
648 | opaqueOldPos = p; | 658 | opaqueOldPos = p; |
649 | } | 659 | } |
650 | 660 | ||
651 | 661 | ||
652 | /*! \reimp */ | 662 | /*! \reimp */ |
653 | bool KDGanttMinimizeSplitter::event( QEvent *e ) | 663 | bool KDGanttMinimizeSplitter::event( QEvent *e ) |
654 | { | 664 | { |
655 | if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { | 665 | if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { |
656 | recalc( isVisible() ); | 666 | recalc( isVisible() ); |
657 | if ( e->type() == QEvent::Show ) | 667 | if ( e->type() == QEvent::Show ) |
658 | data->firstShow = FALSE; | 668 | data->firstShow = FALSE; |
659 | } | 669 | } |
660 | return QWidget::event( e ); | 670 | return QWidget::event( e ); |
661 | } | 671 | } |
662 | 672 | ||
663 | 673 | ||
664 | /*! | 674 | /*! |
665 | \obsolete | 675 | \obsolete |
666 | 676 | ||
667 | Draws the splitter handle in the rectangle described by \a x, \a y, | 677 | Draws the splitter handle in the rectangle described by \a x, \a y, |
668 | \a w, \a h using painter \a p. | 678 | \a w, \a h using painter \a p. |
669 | \sa QStyle::drawPrimitive() | 679 | \sa QStyle::drawPrimitive() |
670 | */ | 680 | */ |
671 | void KDGanttMinimizeSplitter::drawSplitter( QPainter *p, | 681 | void KDGanttMinimizeSplitter::drawSplitter( QPainter *p, |
672 | QCOORD x, QCOORD y, QCOORD w, QCOORD h ) | 682 | QCOORD x, QCOORD y, QCOORD w, QCOORD h ) |
673 | { | 683 | { |
674 | #if 0 | 684 | #if 0 |
675 | // LR | 685 | // LR |
676 | style().drawPrimitive(QStyle::PE_Splitter, p, QRect(x, y, w, h), colorGroup(), | 686 | style().drawPrimitive(QStyle::PE_Splitter, p, QRect(x, y, w, h), colorGroup(), |
677 | (orientation() == Qt::Horizontal ? | 687 | (orientation() == Qt::Horizontal ? |
678 | QStyle::Style_Horizontal : 0)); | 688 | QStyle::Style_Horizontal : 0)); |
679 | #endif | 689 | #endif |
680 | } | 690 | } |
681 | 691 | ||
682 | 692 | ||
683 | /*! | 693 | /*! |
684 | Returns the id of the splitter to the right of or below the widget \a w, | 694 | Returns the id of the splitter to the right of or below the widget \a w, |
685 | or 0 if there is no such splitter | 695 | or 0 if there is no such splitter |
686 | (i.e. it is either not in this KDGanttMinimizeSplitter or it is at the end). | 696 | (i.e. it is either not in this KDGanttMinimizeSplitter or it is at the end). |
687 | */ | 697 | */ |
688 | int KDGanttMinimizeSplitter::idAfter( QWidget* w ) const | 698 | int KDGanttMinimizeSplitter::idAfter( QWidget* w ) const |
689 | { | 699 | { |
690 | QSplitterLayoutStruct *s = data->list.first(); | 700 | QSplitterLayoutStruct *s = data->list.first(); |
691 | bool seen_w = FALSE; | 701 | bool seen_w = FALSE; |
692 | while ( s ) { | 702 | while ( s ) { |
693 | if ( s->isSplitter && seen_w ) | 703 | if ( s->isSplitter && seen_w ) |
694 | return data->list.at(); | 704 | return data->list.at(); |
695 | if ( !s->isSplitter && s->wid == w ) | 705 | if ( !s->isSplitter && s->wid == w ) |
696 | seen_w = TRUE; | 706 | seen_w = TRUE; |
697 | s = data->list.next(); | 707 | s = data->list.next(); |
698 | } | 708 | } |
699 | return 0; | 709 | return 0; |
700 | } | 710 | } |
701 | 711 | ||
702 | 712 | ||
703 | /*! | 713 | /*! |
704 | Moves the left/top edge of the splitter handle with id \a id as | 714 | Moves the left/top edge of the splitter handle with id \a id as |
705 | close as possible to position \a p, which is the distance from the | 715 | close as possible to position \a p, which is the distance from the |
706 | left (or top) edge of the widget. | 716 | left (or top) edge of the widget. |
707 | 717 | ||
708 | For Arabic and Hebrew the layout is reversed, and using this | 718 | For Arabic and Hebrew the layout is reversed, and using this |
709 | function to set the position of the splitter might lead to | 719 | function to set the position of the splitter might lead to |
710 | unexpected results, since in Arabic and Hebrew the position of | 720 | unexpected results, since in Arabic and Hebrew the position of |
711 | splitter one is to the left of the position of splitter zero. | 721 | splitter one is to the left of the position of splitter zero. |
712 | 722 | ||
713 | \sa idAfter() | 723 | \sa idAfter() |
714 | */ | 724 | */ |
715 | void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id ) | 725 | void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id ) |
716 | { | 726 | { |
717 | p = adjustPos( p, id ); | 727 | p = adjustPos( p, id ); |
718 | QSplitterLayoutStruct *s = data->list.at(id); | 728 | QSplitterLayoutStruct *s = data->list.at(id); |
719 | int oldP = orient == Horizontal ? s->wid->x() : s->wid->y(); | 729 | int oldP = orient == Horizontal ? s->wid->x() : s->wid->y(); |
720 | bool upLeft; | 730 | bool upLeft; |
721 | if ( false && orient == Horizontal ) { | 731 | if ( false && orient == Horizontal ) { |
722 | p += s->wid->width(); | 732 | p += s->wid->width(); |
723 | upLeft = p > oldP; | 733 | upLeft = p > oldP; |
724 | } else | 734 | } else |
725 | upLeft = p < oldP; | 735 | upLeft = p < oldP; |
726 | 736 | ||
727 | moveAfter( p, id, upLeft ); | 737 | moveAfter( p, id, upLeft ); |
728 | moveBefore( p-1, id-1, upLeft ); | 738 | moveBefore( p-1, id-1, upLeft ); |
729 | 739 | ||
730 | storeSizes(); | 740 | storeSizes(); |
731 | } | 741 | } |
732 | 742 | ||
733 | 743 | ||
734 | void KDGanttMinimizeSplitter::setG( QWidget *w, int p, int s, bool isSplitter ) | 744 | void KDGanttMinimizeSplitter::setG( QWidget *w, int p, int s, bool isSplitter ) |
735 | { | 745 | { |
736 | if ( orient == Horizontal ) { | 746 | if ( orient == Horizontal ) { |
737 | if ( false && orient == Horizontal && !isSplitter ) | 747 | if ( false && orient == Horizontal && !isSplitter ) |
738 | p = contentsRect().width() - p - s; | 748 | p = contentsRect().width() - p - s; |
739 | w->setGeometry( p, contentsRect().y(), s, contentsRect().height() ); | 749 | w->setGeometry( p, contentsRect().y(), s, contentsRect().height() ); |
740 | } else | 750 | } else |
741 | w->setGeometry( contentsRect().x(), p, contentsRect().width(), s ); | 751 | w->setGeometry( contentsRect().x(), p, contentsRect().width(), s ); |
742 | } | 752 | } |
743 | 753 | ||
744 | 754 | ||
745 | /* | 755 | /* |
746 | Places the right/bottom edge of the widget at \a id at position \a pos. | 756 | Places the right/bottom edge of the widget at \a id at position \a pos. |
747 | 757 | ||
748 | \sa idAfter() | 758 | \sa idAfter() |
749 | */ | 759 | */ |
750 | void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) | 760 | void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) |
751 | { | 761 | { |
752 | if( id < 0 ) | 762 | if( id < 0 ) |
753 | return; | 763 | return; |
754 | QSplitterLayoutStruct *s = data->list.at(id); | 764 | QSplitterLayoutStruct *s = data->list.at(id); |
755 | if ( !s ) | 765 | if ( !s ) |
756 | return; | 766 | return; |
757 | QWidget *w = s->wid; | 767 | QWidget *w = s->wid; |
758 | if ( w->isHidden() ) { | 768 | if ( w->isHidden() ) { |
759 | moveBefore( pos, id-1, upLeft ); | 769 | moveBefore( pos, id-1, upLeft ); |
760 | } else if ( s->isSplitter ) { | 770 | } else if ( s->isSplitter ) { |
761 | int pos1, pos2; | 771 | int pos1, pos2; |
762 | int dd = s->sizer; | 772 | int dd = s->sizer; |
763 | if( false && orient == Horizontal ) { | 773 | if( false && orient == Horizontal ) { |
764 | pos1 = pos; | 774 | pos1 = pos; |
765 | pos2 = pos + dd; | 775 | pos2 = pos + dd; |
766 | } else { | 776 | } else { |
767 | pos2 = pos - dd; | 777 | pos2 = pos - dd; |
768 | pos1 = pos2 + 1; | 778 | pos1 = pos2 + 1; |
769 | } | 779 | } |
770 | if ( upLeft ) { | 780 | if ( upLeft ) { |
771 | setG( w, pos1, dd, TRUE ); | 781 | setG( w, pos1, dd, TRUE ); |
772 | moveBefore( pos2, id-1, upLeft ); | 782 | moveBefore( pos2, id-1, upLeft ); |
773 | } else { | 783 | } else { |
774 | moveBefore( pos2, id-1, upLeft ); | 784 | moveBefore( pos2, id-1, upLeft ); |
775 | setG( w, pos1, dd, TRUE ); | 785 | setG( w, pos1, dd, TRUE ); |
776 | } | 786 | } |
777 | } else { | 787 | } else { |
778 | int dd, newLeft, nextPos; | 788 | int dd, newLeft, nextPos; |
779 | if( false && orient == Horizontal ) { | 789 | if( false && orient == Horizontal ) { |
780 | dd = w->geometry().right() - pos; | 790 | dd = w->geometry().right() - pos; |
781 | dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); | 791 | dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); |
782 | newLeft = pos+1; | 792 | newLeft = pos+1; |
783 | nextPos = newLeft + dd; | 793 | nextPos = newLeft + dd; |
784 | } else { | 794 | } else { |
785 | dd = pos - pick( w->pos() ) + 1; | 795 | dd = pos - pick( w->pos() ) + 1; |
786 | dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); | 796 | dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); |
787 | newLeft = pos-dd+1; | 797 | newLeft = pos-dd+1; |
788 | nextPos = newLeft - 1; | 798 | nextPos = newLeft - 1; |
789 | } | 799 | } |
790 | setG( w, newLeft, dd, TRUE ); | 800 | setG( w, newLeft, dd, TRUE ); |
791 | moveBefore( nextPos, id-1, upLeft ); | 801 | moveBefore( nextPos, id-1, upLeft ); |
792 | } | 802 | } |
793 | } | 803 | } |
794 | 804 | ||
795 | 805 | ||
796 | /* | 806 | /* |
797 | Places the left/top edge of the widget at \a id at position \a pos. | 807 | Places the left/top edge of the widget at \a id at position \a pos. |
798 | 808 | ||
799 | \sa idAfter() | 809 | \sa idAfter() |
800 | */ | 810 | */ |
801 | void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) | 811 | void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) |
802 | { | 812 | { |
803 | QSplitterLayoutStruct *s = id < int(data->list.count()) ? | 813 | QSplitterLayoutStruct *s = id < int(data->list.count()) ? |
804 | data->list.at(id) : 0; | 814 | data->list.at(id) : 0; |
805 | if ( !s ) | 815 | if ( !s ) |
806 | return; | 816 | return; |
807 | QWidget *w = s->wid; | 817 | QWidget *w = s->wid; |
808 | if ( w->isHidden() ) { | 818 | if ( w->isHidden() ) { |
809 | moveAfter( pos, id+1, upLeft ); | 819 | moveAfter( pos, id+1, upLeft ); |
810 | } else if ( pick( w->pos() ) == pos ) { | 820 | } else if ( pick( w->pos() ) == pos ) { |
811 | //No need to do anything if it's already there. | 821 | //No need to do anything if it's already there. |
812 | return; | 822 | return; |
813 | } else if ( s->isSplitter ) { | 823 | } else if ( s->isSplitter ) { |
814 | int dd = s->sizer; | 824 | int dd = s->sizer; |
815 | int pos1, pos2; | 825 | int pos1, pos2; |
816 | if( false && orient == Horizontal ) { | 826 | if( false && orient == Horizontal ) { |
817 | pos2 = pos - dd; | 827 | pos2 = pos - dd; |
818 | pos1 = pos2 + 1; | 828 | pos1 = pos2 + 1; |
819 | } else { | 829 | } else { |
820 | pos1 = pos; | 830 | pos1 = pos; |
821 | pos2 = pos + dd; | 831 | pos2 = pos + dd; |
822 | } | 832 | } |
823 | if ( upLeft ) { | 833 | if ( upLeft ) { |
824 | setG( w, pos1, dd, TRUE ); | 834 | setG( w, pos1, dd, TRUE ); |
825 | moveAfter( pos2, id+1, upLeft ); | 835 | moveAfter( pos2, id+1, upLeft ); |
826 | } else { | 836 | } else { |
827 | moveAfter( pos2, id+1, upLeft ); | 837 | moveAfter( pos2, id+1, upLeft ); |
828 | setG( w, pos1, dd, TRUE ); | 838 | setG( w, pos1, dd, TRUE ); |
829 | } | 839 | } |
830 | } else { | 840 | } else { |
831 | int left = pick( w->pos() ); | 841 | int left = pick( w->pos() ); |
832 | int right, dd,/* newRight,*/ newLeft, nextPos; | 842 | int right, dd,/* newRight,*/ newLeft, nextPos; |
833 | if ( false && orient == Horizontal ) { | 843 | if ( false && orient == Horizontal ) { |
834 | dd = pos - left + 1; | 844 | dd = pos - left + 1; |
835 | dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); | 845 | dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); |
836 | newLeft = pos-dd+1; | 846 | newLeft = pos-dd+1; |
837 | nextPos = newLeft - 1; | 847 | nextPos = newLeft - 1; |
838 | } else { | 848 | } else { |
839 | right = pick( w->geometry().bottomRight() ); | 849 | right = pick( w->geometry().bottomRight() ); |
840 | dd = right - pos + 1; | 850 | dd = right - pos + 1; |
841 | dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); | 851 | dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); |
842 | /*newRight = pos+dd-1;*/ | 852 | /*newRight = pos+dd-1;*/ |
843 | newLeft = pos; | 853 | newLeft = pos; |
844 | nextPos = newLeft + dd; | 854 | nextPos = newLeft + dd; |
845 | } | 855 | } |
846 | setG( w, newLeft, dd, TRUE ); | 856 | setG( w, newLeft, dd, TRUE ); |
847 | /*if( right != newRight )*/ | 857 | /*if( right != newRight )*/ |
848 | moveAfter( nextPos, id+1, upLeft ); | 858 | moveAfter( nextPos, id+1, upLeft ); |
849 | } | 859 | } |
850 | } | 860 | } |
851 | 861 | ||
852 | 862 | ||
853 | void KDGanttMinimizeSplitter::expandPos( int id, int* min, int* max ) | 863 | void KDGanttMinimizeSplitter::expandPos( int id, int* min, int* max ) |
854 | { | 864 | { |
855 | QSplitterLayoutStruct *s = data->list.at(id-1); | 865 | QSplitterLayoutStruct *s = data->list.at(id-1); |
856 | QWidget* w = s->wid; | 866 | QWidget* w = s->wid; |
857 | *min = pick( w->mapToParent( QPoint(0,0) ) ); | 867 | *min = pick( w->mapToParent( QPoint(0,0) ) ); |
858 | 868 | ||
859 | if ( (uint) id == data->list.count() ) { | 869 | if ( (uint) id == data->list.count() ) { |
860 | pick( size() ); | 870 | pick( size() ); |
861 | } | 871 | } |
862 | else { | 872 | else { |
863 | QSplitterLayoutStruct *s = data->list.at(id+1); | 873 | QSplitterLayoutStruct *s = data->list.at(id+1); |
864 | QWidget* w = s->wid; | 874 | QWidget* w = s->wid; |
865 | *max = pick( w->mapToParent( QPoint( w->width(), w->height() ) ) ) -8; | 875 | *max = pick( w->mapToParent( QPoint( w->width(), w->height() ) ) ) -8; |
866 | } | 876 | } |
867 | } | 877 | } |
868 | 878 | ||
869 | 879 | ||
870 | /*! | 880 | /*! |
871 | Returns the valid range of the splitter with id \a id in \a *min and \a *max. | 881 | Returns the valid range of the splitter with id \a id in \a *min and \a *max. |
872 | 882 | ||
873 | \sa idAfter() | 883 | \sa idAfter() |
874 | */ | 884 | */ |
875 | 885 | ||
876 | void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) | 886 | void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) |
877 | { | 887 | { |
878 | int minB = 0;//before | 888 | int minB = 0;//before |
879 | int maxB = 0; | 889 | int maxB = 0; |
880 | int minA = 0; | 890 | int minA = 0; |
881 | int maxA = 0;//after | 891 | int maxA = 0;//after |
882 | int n = data->list.count(); | 892 | int n = data->list.count(); |
883 | if ( id < 0 || id >= n ) | 893 | if ( id < 0 || id >= n ) |
884 | return; | 894 | return; |
885 | int i; | 895 | int i; |
886 | for ( i = 0; i < id; i++ ) { | 896 | for ( i = 0; i < id; i++ ) { |
887 | QSplitterLayoutStruct *s = data->list.at(i); | 897 | QSplitterLayoutStruct *s = data->list.at(i); |
888 | if ( s->wid->isHidden() ) { | 898 | if ( s->wid->isHidden() ) { |
889 | //ignore | 899 | //ignore |
890 | } else if ( s->isSplitter ) { | 900 | } else if ( s->isSplitter ) { |
891 | minB += s->sizer; | 901 | minB += s->sizer; |
892 | maxB += s->sizer; | 902 | maxB += s->sizer; |
893 | } else { | 903 | } else { |
894 | minB += pick( minSize(s->wid) ); | 904 | minB += pick( minSize(s->wid) ); |
895 | maxB += pick( s->wid->maximumSize() ); | 905 | maxB += pick( s->wid->maximumSize() ); |
896 | } | 906 | } |
897 | } | 907 | } |
898 | for ( i = id; i < n; i++ ) { | 908 | for ( i = id; i < n; i++ ) { |
899 | QSplitterLayoutStruct *s = data->list.at(i); | 909 | QSplitterLayoutStruct *s = data->list.at(i); |
900 | if ( s->wid->isHidden() ) { | 910 | if ( s->wid->isHidden() ) { |
901 | //ignore | 911 | //ignore |
902 | } else if ( s->isSplitter ) { | 912 | } else if ( s->isSplitter ) { |
903 | minA += s->sizer; | 913 | minA += s->sizer; |
904 | maxA += s->sizer; | 914 | maxA += s->sizer; |
905 | } else { | 915 | } else { |
906 | minA += pick( minSize(s->wid) ); | 916 | minA += pick( minSize(s->wid) ); |
907 | maxA += pick( s->wid->maximumSize() ); | 917 | maxA += pick( s->wid->maximumSize() ); |
908 | } | 918 | } |
909 | } | 919 | } |
910 | QRect r = contentsRect(); | 920 | QRect r = contentsRect(); |
911 | if ( orient == Horizontal && false ) { | 921 | if ( orient == Horizontal && false ) { |
912 | #if QT_VERSION >= 0x030000 | 922 | #if QT_VERSION >= 0x030000 |
913 | int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this); | 923 | int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this); |
914 | #else | 924 | #else |
915 | int splitterWidth = style().splitterWidth(); | 925 | int splitterWidth = style().splitterWidth(); |
916 | #endif | 926 | #endif |
917 | 927 | ||
918 | if ( min ) | 928 | if ( min ) |
919 | *min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth; | 929 | *min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth; |
920 | if ( max ) | 930 | if ( max ) |
921 | *max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth; | 931 | *max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth; |
922 | } else { | 932 | } else { |
923 | if ( min ) | 933 | if ( min ) |
924 | *min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA ); | 934 | *min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA ); |
925 | if ( max ) | 935 | if ( max ) |
926 | *max = pick(r.topLeft()) + QMIN( maxB, pick(r.size())-minA ); | 936 | *max = pick(r.topLeft()) + QMIN( maxB, pick(r.size())-minA ); |
927 | } | 937 | } |
928 | } | 938 | } |
929 | 939 | ||
930 | 940 | ||
931 | /*! | 941 | /*! |
932 | Returns the closest legal position to \a p of the splitter with id \a id. | 942 | Returns the closest legal position to \a p of the splitter with id \a id. |
933 | 943 | ||
934 | \sa idAfter() | 944 | \sa idAfter() |
935 | */ | 945 | */ |
936 | 946 | ||
937 | int KDGanttMinimizeSplitter::adjustPos( int p, int id ) | 947 | int KDGanttMinimizeSplitter::adjustPos( int p, int id ) |
938 | { | 948 | { |
939 | int min = 0; | 949 | int min = 0; |
940 | int max = 0; | 950 | int max = 0; |
941 | getRange( id, &min, &max ); | 951 | getRange( id, &min, &max ); |
942 | p = QMAX( min, QMIN( p, max ) ); | 952 | p = QMAX( min, QMIN( p, max ) ); |
943 | 953 | ||
944 | return p; | 954 | return p; |
945 | } | 955 | } |
946 | 956 | ||
947 | 957 | ||
948 | void KDGanttMinimizeSplitter::doResize() | 958 | void KDGanttMinimizeSplitter::doResize() |
949 | { | 959 | { |
950 | QRect r = contentsRect(); | 960 | QRect r = contentsRect(); |
951 | int i; | 961 | int i; |
952 | int n = data->list.count(); | 962 | int n = data->list.count(); |
953 | QMemArray<QLayoutStruct> a( n ); | 963 | QMemArray<QLayoutStruct> a( n ); |
954 | for ( i = 0; i< n; i++ ) { | 964 | for ( i = 0; i< n; i++ ) { |
955 | a[i].init(); | 965 | a[i].init(); |
956 | QSplitterLayoutStruct *s = data->list.at(i); | 966 | QSplitterLayoutStruct *s = data->list.at(i); |
957 | if ( s->wid->isHidden() ) { | 967 | if ( s->wid->isHidden() ) { |
958 | a[i].stretch = 0; | 968 | a[i].stretch = 0; |
959 | a[i].sizeHint = a[i].minimumSize = 0; | 969 | a[i].sizeHint = a[i].minimumSize = 0; |
960 | a[i].maximumSize = 0; | 970 | a[i].maximumSize = 0; |
961 | } else if ( s->isSplitter ) { | 971 | } else if ( s->isSplitter ) { |
962 | a[i].stretch = 0; | 972 | a[i].stretch = 0; |
963 | a[i].sizeHint = a[i].minimumSize = a[i].maximumSize = s->sizer; | 973 | a[i].sizeHint = a[i].minimumSize = a[i].maximumSize = s->sizer; |
964 | a[i].empty = FALSE; | 974 | a[i].empty = FALSE; |
965 | } else if ( s->mode == KeepSize ) { | 975 | } else if ( s->mode == KeepSize ) { |
966 | a[i].stretch = 0; | 976 | a[i].stretch = 0; |
967 | a[i].minimumSize = pick( minSize(s->wid) ); | 977 | a[i].minimumSize = pick( minSize(s->wid) ); |
968 | a[i].sizeHint = s->sizer; | 978 | a[i].sizeHint = s->sizer; |
969 | a[i].maximumSize = pick( s->wid->maximumSize() ); | 979 | a[i].maximumSize = pick( s->wid->maximumSize() ); |
970 | a[i].empty = FALSE; | 980 | a[i].empty = FALSE; |
971 | } else if ( s->mode == FollowSizeHint ) { | 981 | } else if ( s->mode == FollowSizeHint ) { |
972 | a[i].stretch = 0; | 982 | a[i].stretch = 0; |
973 | a[i].minimumSize = a[i].sizeHint = pick( s->wid->sizeHint() ); | 983 | a[i].minimumSize = a[i].sizeHint = pick( s->wid->sizeHint() ); |
974 | a[i].maximumSize = pick( s->wid->maximumSize() ); | 984 | a[i].maximumSize = pick( s->wid->maximumSize() ); |
975 | a[i].empty = FALSE; | 985 | a[i].empty = FALSE; |
976 | } else { //proportional | 986 | } else { //proportional |
977 | a[i].stretch = s->sizer; | 987 | a[i].stretch = s->sizer; |
978 | a[i].maximumSize = pick( s->wid->maximumSize() ); | 988 | a[i].maximumSize = pick( s->wid->maximumSize() ); |
979 | a[i].sizeHint = a[i].minimumSize = pick( minSize(s->wid) ); | 989 | a[i].sizeHint = a[i].minimumSize = pick( minSize(s->wid) ); |
980 | a[i].empty = FALSE; | 990 | a[i].empty = FALSE; |
981 | } | 991 | } |
982 | } | 992 | } |
983 | 993 | ||
984 | kdganttGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 ); | 994 | kdganttGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 ); |
985 | 995 | ||
986 | for ( i = 0; i< n; i++ ) { | 996 | for ( i = 0; i< n; i++ ) { |
987 | QSplitterLayoutStruct *s = data->list.at(i); | 997 | QSplitterLayoutStruct *s = data->list.at(i); |
988 | setG( s->wid, a[i].pos, a[i].size ); | 998 | setG( s->wid, a[i].pos, a[i].size ); |
989 | } | 999 | } |
990 | 1000 | ||
991 | } | 1001 | } |
992 | 1002 | ||
993 | 1003 | ||
994 | void KDGanttMinimizeSplitter::recalc( bool update ) | 1004 | void KDGanttMinimizeSplitter::recalc( bool update ) |
995 | { | 1005 | { |
996 | int fi = 2*frameWidth(); | 1006 | int fi = 2*frameWidth(); |
997 | int maxl = fi; | 1007 | int maxl = fi; |
998 | int minl = fi; | 1008 | int minl = fi; |
999 | int maxt = QWIDGETSIZE_MAX; | 1009 | int maxt = QWIDGETSIZE_MAX; |
1000 | int mint = fi; | 1010 | int mint = fi; |
1001 | int n = data->list.count(); | 1011 | int n = data->list.count(); |
1002 | bool first = TRUE; | 1012 | bool first = TRUE; |
1003 | /* | 1013 | /* |
1004 | The splitter before a hidden widget is always hidden. | 1014 | The splitter before a hidden widget is always hidden. |
1005 | The splitter before the first visible widget is hidden. | 1015 | The splitter before the first visible widget is hidden. |
1006 | The splitter before any other visible widget is visible. | 1016 | The splitter before any other visible widget is visible. |
1007 | */ | 1017 | */ |
1008 | for ( int i = 0; i< n; i++ ) { | 1018 | for ( int i = 0; i< n; i++ ) { |
1009 | QSplitterLayoutStruct *s = data->list.at(i); | 1019 | QSplitterLayoutStruct *s = data->list.at(i); |
1010 | if ( !s->isSplitter ) { | 1020 | if ( !s->isSplitter ) { |
1011 | QSplitterLayoutStruct *p = (i > 0) ? p = data->list.at( i-1 ) : 0; | 1021 | QSplitterLayoutStruct *p = (i > 0) ? p = data->list.at( i-1 ) : 0; |
1012 | if ( p && p->isSplitter ) | 1022 | if ( p && p->isSplitter ) |
1013 | if ( first || s->wid->isHidden() ) | 1023 | if ( first || s->wid->isHidden() ) |
1014 | p->wid->hide(); //may trigger new recalc | 1024 | p->wid->hide(); //may trigger new recalc |
1015 | else | 1025 | else |
1016 | p->wid->show(); //may trigger new recalc | 1026 | p->wid->show(); //may trigger new recalc |
1017 | if ( !s->wid->isHidden() ) | 1027 | if ( !s->wid->isHidden() ) |
1018 | first = FALSE; | 1028 | first = FALSE; |
1019 | } | 1029 | } |
1020 | } | 1030 | } |
1021 | 1031 | ||
1022 | bool empty=TRUE; | 1032 | bool empty=TRUE; |
1023 | for ( int j = 0; j< n; j++ ) { | 1033 | for ( int j = 0; j< n; j++ ) { |
1024 | QSplitterLayoutStruct *s = data->list.at(j); | 1034 | QSplitterLayoutStruct *s = data->list.at(j); |
1025 | if ( !s->wid->isHidden() ) { | 1035 | if ( !s->wid->isHidden() ) { |
1026 | empty = FALSE; | 1036 | empty = FALSE; |
1027 | if ( s->isSplitter ) { | 1037 | if ( s->isSplitter ) { |
1028 | minl += s->sizer; | 1038 | minl += s->sizer; |
1029 | maxl += s->sizer; | 1039 | maxl += s->sizer; |
1030 | } else { | 1040 | } else { |
1031 | QSize minS = minSize(s->wid); | 1041 | QSize minS = minSize(s->wid); |
1032 | minl += pick( minS ); | 1042 | minl += pick( minS ); |
1033 | maxl += pick( s->wid->maximumSize() ); | 1043 | maxl += pick( s->wid->maximumSize() ); |
1034 | mint = QMAX( mint, trans( minS )); | 1044 | mint = QMAX( mint, trans( minS )); |
1035 | int tm = trans( s->wid->maximumSize() ); | 1045 | int tm = trans( s->wid->maximumSize() ); |
1036 | if ( tm > 0 ) | 1046 | if ( tm > 0 ) |
1037 | maxt = QMIN( maxt, tm ); | 1047 | maxt = QMIN( maxt, tm ); |
1038 | } | 1048 | } |
1039 | } | 1049 | } |
1040 | } | 1050 | } |
1041 | if ( empty ) { | 1051 | if ( empty ) { |
1042 | if ( parentWidget() != 0 && parentWidget()->inherits("KDGanttMinimizeSplitter") ) { | 1052 | if ( parentWidget() != 0 && parentWidget()->inherits("KDGanttMinimizeSplitter") ) { |
1043 | // nested splitters; be nice | 1053 | // nested splitters; be nice |
1044 | maxl = maxt = 0; | 1054 | maxl = maxt = 0; |
1045 | } else { | 1055 | } else { |
1046 | // KDGanttMinimizeSplitter with no children yet | 1056 | // KDGanttMinimizeSplitter with no children yet |
1047 | maxl = QWIDGETSIZE_MAX; | 1057 | maxl = QWIDGETSIZE_MAX; |
1048 | } | 1058 | } |
1049 | } else { | 1059 | } else { |
1050 | maxl = QMIN( maxl, QWIDGETSIZE_MAX ); | 1060 | maxl = QMIN( maxl, QWIDGETSIZE_MAX ); |
1051 | } | 1061 | } |
1052 | if ( maxt < mint ) | 1062 | if ( maxt < mint ) |
1053 | maxt = mint; | 1063 | maxt = mint; |
1054 | 1064 | ||
1055 | if ( orient == Horizontal ) { | 1065 | if ( orient == Horizontal ) { |
1056 | setMaximumSize( maxl, maxt ); | 1066 | setMaximumSize( maxl, maxt ); |
1057 | setMinimumSize( minl, mint ); | 1067 | setMinimumSize( minl, mint ); |
1058 | } else { | 1068 | } else { |
1059 | setMaximumSize( maxt, maxl ); | 1069 | setMaximumSize( maxt, maxl ); |
1060 | setMinimumSize( mint, minl ); | 1070 | setMinimumSize( mint, minl ); |
1061 | } | 1071 | } |
1062 | if ( update ) | 1072 | if ( update ) |
1063 | doResize(); | 1073 | doResize(); |
1064 | } | 1074 | } |
1065 | 1075 | ||
1066 | /*! | 1076 | /*! |
1067 | Sets resize mode of \a w to \a mode. | 1077 | Sets resize mode of \a w to \a mode. |
1068 | 1078 | ||
1069 | \sa ResizeMode | 1079 | \sa ResizeMode |
1070 | */ | 1080 | */ |
1071 | 1081 | ||
1072 | void KDGanttMinimizeSplitter::setResizeMode( QWidget *w, ResizeMode mode ) | 1082 | void KDGanttMinimizeSplitter::setResizeMode( QWidget *w, ResizeMode mode ) |
1073 | { | 1083 | { |
1074 | processChildEvents(); | 1084 | processChildEvents(); |
1075 | QSplitterLayoutStruct *s = data->list.first(); | 1085 | QSplitterLayoutStruct *s = data->list.first(); |
1076 | while ( s ) { | 1086 | while ( s ) { |
1077 | if ( s->wid == w ) { | 1087 | if ( s->wid == w ) { |
1078 | s->mode = mode; | 1088 | s->mode = mode; |
1079 | return; | 1089 | return; |
1080 | } | 1090 | } |
1081 | s = data->list.next(); | 1091 | s = data->list.next(); |
1082 | } | 1092 | } |
1083 | s = addWidget( w, TRUE ); | 1093 | s = addWidget( w, TRUE ); |
1084 | s->mode = mode; | 1094 | s->mode = mode; |
1085 | } | 1095 | } |
1086 | 1096 | ||
1087 | 1097 | ||
1088 | /*! | 1098 | /*! |
1089 | Returns TRUE if opaque resize is on; otherwise returns FALSE. | 1099 | Returns TRUE if opaque resize is on; otherwise returns FALSE. |
1090 | 1100 | ||
1091 | \sa setOpaqueResize() | 1101 | \sa setOpaqueResize() |
1092 | */ | 1102 | */ |
1093 | 1103 | ||
1094 | bool KDGanttMinimizeSplitter::opaqueResize() const | 1104 | bool KDGanttMinimizeSplitter::opaqueResize() const |
1095 | { | 1105 | { |
1096 | return data->opaque; | 1106 | return data->opaque; |
1097 | } | 1107 | } |
1098 | 1108 | ||
1099 | 1109 | ||
1100 | /*! | 1110 | /*! |
1101 | If \a on is TRUE then opaque resizing is turned on; otherwise | 1111 | If \a on is TRUE then opaque resizing is turned on; otherwise |
1102 | opaque resizing is turned off. | 1112 | opaque resizing is turned off. |
1103 | Opaque resizing is initially turned off. | 1113 | Opaque resizing is initially turned off. |
1104 | 1114 | ||
1105 | \sa opaqueResize() | 1115 | \sa opaqueResize() |
1106 | */ | 1116 | */ |
1107 | 1117 | ||
1108 | void KDGanttMinimizeSplitter::setOpaqueResize( bool on ) | 1118 | void KDGanttMinimizeSplitter::setOpaqueResize( bool on ) |
1109 | { | 1119 | { |
1110 | data->opaque = on; | 1120 | data->opaque = on; |
1111 | } | 1121 | } |
1112 | 1122 | ||
1113 | 1123 | ||
1114 | /*! | 1124 | /*! |
1115 | Moves widget \a w to the leftmost/top position. | 1125 | Moves widget \a w to the leftmost/top position. |
1116 | */ | 1126 | */ |
1117 | 1127 | ||
1118 | void KDGanttMinimizeSplitter::moveToFirst( QWidget *w ) | 1128 | void KDGanttMinimizeSplitter::moveToFirst( QWidget *w ) |
1119 | { | 1129 | { |
1120 | processChildEvents(); | 1130 | processChildEvents(); |
1121 | bool found = FALSE; | 1131 | bool found = FALSE; |
1122 | QSplitterLayoutStruct *s = data->list.first(); | 1132 | QSplitterLayoutStruct *s = data->list.first(); |
1123 | while ( s ) { | 1133 | while ( s ) { |
1124 | if ( s->wid == w ) { | 1134 | if ( s->wid == w ) { |
1125 | found = TRUE; | 1135 | found = TRUE; |
1126 | QSplitterLayoutStruct *p = data->list.prev(); | 1136 | QSplitterLayoutStruct *p = data->list.prev(); |
1127 | if ( p ) { // not already at first place | 1137 | if ( p ) { // not already at first place |
1128 | data->list.take(); //take p | 1138 | data->list.take(); //take p |
1129 | data->list.take(); // take s | 1139 | data->list.take(); // take s |
1130 | data->list.insert( 0, p ); | 1140 | data->list.insert( 0, p ); |
1131 | data->list.insert( 0, s ); | 1141 | data->list.insert( 0, s ); |
1132 | } | 1142 | } |
1133 | break; | 1143 | break; |
1134 | } | 1144 | } |
1135 | s = data->list.next(); | 1145 | s = data->list.next(); |
1136 | } | 1146 | } |
1137 | if ( !found ) | 1147 | if ( !found ) |
1138 | addWidget( w, TRUE ); | 1148 | addWidget( w, TRUE ); |
1139 | recalcId(); | 1149 | recalcId(); |
1140 | } | 1150 | } |
1141 | 1151 | ||
1142 | 1152 | ||
1143 | /*! | 1153 | /*! |
1144 | Moves widget \a w to the rightmost/bottom position. | 1154 | Moves widget \a w to the rightmost/bottom position. |
1145 | */ | 1155 | */ |
1146 | 1156 | ||
1147 | void KDGanttMinimizeSplitter::moveToLast( QWidget *w ) | 1157 | void KDGanttMinimizeSplitter::moveToLast( QWidget *w ) |
1148 | { | 1158 | { |
1149 | processChildEvents(); | 1159 | processChildEvents(); |
1150 | bool found = FALSE; | 1160 | bool found = FALSE; |
1151 | QSplitterLayoutStruct *s = data->list.first(); | 1161 | QSplitterLayoutStruct *s = data->list.first(); |
1152 | while ( s ) { | 1162 | while ( s ) { |
1153 | if ( s->wid == w ) { | 1163 | if ( s->wid == w ) { |
1154 | found = TRUE; | 1164 | found = TRUE; |
1155 | data->list.take(); // take s | 1165 | data->list.take(); // take s |
1156 | QSplitterLayoutStruct *p = data->list.current(); | 1166 | QSplitterLayoutStruct *p = data->list.current(); |
1157 | if ( p ) { // the splitter handle after s | 1167 | if ( p ) { // the splitter handle after s |
1158 | data->list.take(); //take p | 1168 | data->list.take(); //take p |
1159 | data->list.append( p ); | 1169 | data->list.append( p ); |
1160 | } | 1170 | } |
1161 | data->list.append( s ); | 1171 | data->list.append( s ); |
1162 | break; | 1172 | break; |
1163 | } | 1173 | } |
1164 | s = data->list.next(); | 1174 | s = data->list.next(); |
1165 | } | 1175 | } |
1166 | if ( !found ) | 1176 | if ( !found ) |
1167 | addWidget( w); | 1177 | addWidget( w); |
1168 | recalcId(); | 1178 | recalcId(); |
1169 | } | 1179 | } |
1170 | 1180 | ||
1171 | 1181 | ||
1172 | void KDGanttMinimizeSplitter::recalcId() | 1182 | void KDGanttMinimizeSplitter::recalcId() |
1173 | { | 1183 | { |
1174 | int n = data->list.count(); | 1184 | int n = data->list.count(); |
1175 | for ( int i = 0; i < n; i++ ) { | 1185 | for ( int i = 0; i < n; i++ ) { |
1176 | QSplitterLayoutStruct *s = data->list.at(i); | 1186 | QSplitterLayoutStruct *s = data->list.at(i); |
1177 | if ( s->isSplitter ) | 1187 | if ( s->isSplitter ) |
1178 | ((KDGanttSplitterHandle*)s->wid)->setId(i); | 1188 | ((KDGanttSplitterHandle*)s->wid)->setId(i); |
1179 | } | 1189 | } |
1180 | } | 1190 | } |
1181 | 1191 | ||
1182 | 1192 | ||
1183 | /*!\reimp | 1193 | /*!\reimp |
1184 | */ | 1194 | */ |
1185 | QSize KDGanttMinimizeSplitter::sizeHint() const | 1195 | QSize KDGanttMinimizeSplitter::sizeHint() const |
1186 | { | 1196 | { |
1187 | constPolish(); | 1197 | constPolish(); |
1188 | int l = 0; | 1198 | int l = 0; |
1189 | int t = 0; | 1199 | int t = 0; |
1190 | if ( children() ) { | 1200 | if ( children() ) { |
1191 | const QObjectList * c = children(); | 1201 | const QObjectList * c = children(); |
1192 | QObjectListIt it( *c ); | 1202 | QObjectListIt it( *c ); |
1193 | QObject * o; | 1203 | QObject * o; |
1194 | 1204 | ||
1195 | while( (o=it.current()) != 0 ) { | 1205 | while( (o=it.current()) != 0 ) { |
1196 | ++it; | 1206 | ++it; |
1197 | if ( o->isWidgetType() && | 1207 | if ( o->isWidgetType() && |
1198 | !((QWidget*)o)->isHidden() ) { | 1208 | !((QWidget*)o)->isHidden() ) { |
1199 | QSize s = ((QWidget*)o)->sizeHint(); | 1209 | QSize s = ((QWidget*)o)->sizeHint(); |
1200 | if ( s.isValid() ) { | 1210 | if ( s.isValid() ) { |
1201 | l += pick( s ); | 1211 | l += pick( s ); |
1202 | t = QMAX( t, trans( s ) ); | 1212 | t = QMAX( t, trans( s ) ); |
1203 | } | 1213 | } |
1204 | } | 1214 | } |
1205 | } | 1215 | } |
1206 | } | 1216 | } |
1207 | return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); | 1217 | return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); |
1208 | } | 1218 | } |
1209 | 1219 | ||
1210 | 1220 | ||
1211 | /*! | 1221 | /*! |
1212 | \reimp | 1222 | \reimp |
1213 | */ | 1223 | */ |
1214 | 1224 | ||
1215 | QSize KDGanttMinimizeSplitter::minimumSizeHint() const | 1225 | QSize KDGanttMinimizeSplitter::minimumSizeHint() const |
1216 | { | 1226 | { |
1217 | constPolish(); | 1227 | constPolish(); |
1218 | int l = 0; | 1228 | int l = 0; |
1219 | int t = 0; | 1229 | int t = 0; |
1220 | if ( children() ) { | 1230 | if ( children() ) { |
1221 | const QObjectList * c = children(); | 1231 | const QObjectList * c = children(); |
1222 | QObjectListIt it( *c ); | 1232 | QObjectListIt it( *c ); |
1223 | QObject * o; | 1233 | QObject * o; |
1224 | 1234 | ||
1225 | while( (o=it.current()) != 0 ) { | 1235 | while( (o=it.current()) != 0 ) { |
1226 | ++it; | 1236 | ++it; |
1227 | if ( o->isWidgetType() && | 1237 | if ( o->isWidgetType() && |
1228 | !((QWidget*)o)->isHidden() ) { | 1238 | !((QWidget*)o)->isHidden() ) { |
1229 | QSize s = minSizeHint((QWidget*)o); | 1239 | QSize s = minSizeHint((QWidget*)o); |
1230 | if ( s.isValid() ) { | 1240 | if ( s.isValid() ) { |
1231 | l += pick( s ); | 1241 | l += pick( s ); |
1232 | t = QMAX( t, trans( s ) ); | 1242 | t = QMAX( t, trans( s ) ); |
1233 | } | 1243 | } |
1234 | } | 1244 | } |
1235 | } | 1245 | } |
1236 | } | 1246 | } |
1237 | return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); | 1247 | return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); |
1238 | } | 1248 | } |
1239 | 1249 | ||
1240 | 1250 | ||
1241 | /* | 1251 | /* |
1242 | Calculates stretch parameters from current sizes | 1252 | Calculates stretch parameters from current sizes |
1243 | */ | 1253 | */ |
1244 | 1254 | ||
1245 | void KDGanttMinimizeSplitter::storeSizes() | 1255 | void KDGanttMinimizeSplitter::storeSizes() |
1246 | { | 1256 | { |
1247 | QSplitterLayoutStruct *s = data->list.first(); | 1257 | QSplitterLayoutStruct *s = data->list.first(); |
1248 | while ( s ) { | 1258 | while ( s ) { |
1249 | if ( !s->isSplitter ) | 1259 | if ( !s->isSplitter ) |
1250 | s->sizer = pick( s->wid->size() ); | 1260 | s->sizer = pick( s->wid->size() ); |
1251 | s = data->list.next(); | 1261 | s = data->list.next(); |
1252 | } | 1262 | } |
1253 | } | 1263 | } |
1254 | 1264 | ||
1255 | 1265 | ||
1256 | #if 0 // ### remove this code ASAP | 1266 | #if 0 // ### remove this code ASAP |
1257 | 1267 | ||
1258 | /*! | 1268 | /*! |
1259 | Hides \a w if \a hide is TRUE and updates the splitter. | 1269 | Hides \a w if \a hide is TRUE and updates the splitter. |
1260 | 1270 | ||
1261 | \warning Due to a limitation in the current implementation, | 1271 | \warning Due to a limitation in the current implementation, |
1262 | calling QWidget::hide() will not work. | 1272 | calling QWidget::hide() will not work. |
1263 | */ | 1273 | */ |
1264 | 1274 | ||
1265 | void KDGanttMinimizeSplitter::setHidden( QWidget *w, bool hide ) | 1275 | void KDGanttMinimizeSplitter::setHidden( QWidget *w, bool hide ) |
1266 | { | 1276 | { |
1267 | if ( w == w1 ) { | 1277 | if ( w == w1 ) { |
1268 | w1show = !hide; | 1278 | w1show = !hide; |
1269 | } else if ( w == w2 ) { | 1279 | } else if ( w == w2 ) { |
1270 | w2show = !hide; | 1280 | w2show = !hide; |
1271 | } else { | 1281 | } else { |
1272 | #ifdef QT_CHECK_RANGE | 1282 | #ifdef QT_CHECK_RANGE |
1273 | qWarning( "KDGanttMinimizeSplitter::setHidden(), unknown widget" ); | 1283 | qWarning( "KDGanttMinimizeSplitter::setHidden(), unknown widget" ); |
1274 | #endif | 1284 | #endif |
1275 | return; | 1285 | return; |
1276 | } | 1286 | } |
1277 | if ( hide ) | 1287 | if ( hide ) |
1278 | w->hide(); | 1288 | w->hide(); |
1279 | else | 1289 | else |
1280 | w->show(); | 1290 | w->show(); |
1281 | recalc( TRUE ); | 1291 | recalc( TRUE ); |
1282 | } | 1292 | } |
1283 | 1293 | ||
1284 | 1294 | ||
1285 | /*! | 1295 | /*! |
1286 | Returns the hidden status of \a w | 1296 | Returns the hidden status of \a w |
1287 | */ | 1297 | */ |
1288 | 1298 | ||
1289 | bool KDGanttMinimizeSplitter::isHidden( QWidget *w ) const | 1299 | bool KDGanttMinimizeSplitter::isHidden( QWidget *w ) const |
1290 | { | 1300 | { |
1291 | if ( w == w1 ) | 1301 | if ( w == w1 ) |
1292 | return !w1show; | 1302 | return !w1show; |
1293 | else if ( w == w2 ) | 1303 | else if ( w == w2 ) |
1294 | return !w2show; | 1304 | return !w2show; |
1295 | #ifdef QT_CHECK_RANGE | 1305 | #ifdef QT_CHECK_RANGE |
1296 | else | 1306 | else |
1297 | qWarning( "KDGanttMinimizeSplitter::isHidden(), unknown widget" ); | 1307 | qWarning( "KDGanttMinimizeSplitter::isHidden(), unknown widget" ); |
1298 | #endif | 1308 | #endif |
1299 | return FALSE; | 1309 | return FALSE; |
1300 | } | 1310 | } |
1301 | #endif | 1311 | #endif |
1302 | 1312 | ||
1303 | 1313 | ||
1304 | /*! | 1314 | /*! |
1305 | Returns a list of the size parameters of all the widgets in this | 1315 | Returns a list of the size parameters of all the widgets in this |
1306 | splitter. | 1316 | splitter. |
1307 | 1317 | ||
1308 | Giving the values to another splitter's setSizes() function will | 1318 | Giving the values to another splitter's setSizes() function will |
1309 | produce a splitter with the same layout as this one. | 1319 | produce a splitter with the same layout as this one. |
1310 | 1320 | ||
1311 | Note that if you want to iterate over the list, you should | 1321 | Note that if you want to iterate over the list, you should |
1312 | iterate over a copy, e.g. | 1322 | iterate over a copy, e.g. |
1313 | \code | 1323 | \code |
1314 | QValueList<int> list = mySplitter.sizes(); | 1324 | QValueList<int> list = mySplitter.sizes(); |
1315 | QValueList<int>::Iterator it = list.begin(); | 1325 | QValueList<int>::Iterator it = list.begin(); |
1316 | while( it != list.end() ) { | 1326 | while( it != list.end() ) { |
1317 | myProcessing( *it ); | 1327 | myProcessing( *it ); |
1318 | ++it; | 1328 | ++it; |
1319 | } | 1329 | } |
1320 | \endcode | 1330 | \endcode |
1321 | 1331 | ||
1322 | \sa setSizes() | 1332 | \sa setSizes() |
1323 | */ | 1333 | */ |
1324 | 1334 | ||
1325 | QValueList<int> KDGanttMinimizeSplitter::sizes() const | 1335 | QValueList<int> KDGanttMinimizeSplitter::sizes() const |
1326 | { | 1336 | { |
1327 | if ( !testWState(WState_Polished) ) { | 1337 | if ( !testWState(WState_Polished) ) { |
1328 | QWidget* that = (QWidget*) this; | 1338 | QWidget* that = (QWidget*) this; |
1329 | that->polish(); | 1339 | that->polish(); |
1330 | } | 1340 | } |
1331 | QValueList<int> list; | 1341 | QValueList<int> list; |
1332 | QSplitterLayoutStruct *s = data->list.first(); | 1342 | QSplitterLayoutStruct *s = data->list.first(); |
1333 | while ( s ) { | 1343 | while ( s ) { |
1334 | if ( !s->isSplitter ) | 1344 | if ( !s->isSplitter ) |
1335 | list.append( s->sizer ); | 1345 | list.append( s->sizer ); |
1336 | s = data->list.next(); | 1346 | s = data->list.next(); |
1337 | } | 1347 | } |
1338 | return list; | 1348 | return list; |
1339 | } | 1349 | } |
1340 | 1350 | ||
1341 | 1351 | ||
1342 | 1352 | ||
1343 | /*! | 1353 | /*! |
1344 | Sets the size parameters to the values given in \a list. | 1354 | Sets the size parameters to the values given in \a list. |
1345 | If the splitter is horizontal, the values set the sizes from | 1355 | If the splitter is horizontal, the values set the sizes from |
1346 | left to right. If it is vertical, the sizes are applied from | 1356 | left to right. If it is vertical, the sizes are applied from |
1347 | top to bottom. | 1357 | top to bottom. |
1348 | Extra values in \a list are ignored. | 1358 | Extra values in \a list are ignored. |
1349 | 1359 | ||
1350 | If \a list contains too few values, the result is undefined | 1360 | If \a list contains too few values, the result is undefined |
1351 | but the program will still be well-behaved. | 1361 | but the program will still be well-behaved. |
1352 | 1362 | ||
1353 | \sa sizes() | 1363 | \sa sizes() |
1354 | */ | 1364 | */ |
1355 | 1365 | ||
1356 | void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) | 1366 | void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) |
1357 | { | 1367 | { |
1358 | processChildEvents(); | 1368 | processChildEvents(); |
1359 | QValueList<int>::Iterator it = list.begin(); | 1369 | QValueList<int>::Iterator it = list.begin(); |
1360 | QSplitterLayoutStruct *s = data->list.first(); | 1370 | QSplitterLayoutStruct *s = data->list.first(); |
1361 | while ( s && it != list.end() ) { | 1371 | while ( s && it != list.end() ) { |
1362 | if ( !s->isSplitter ) { | 1372 | if ( !s->isSplitter ) { |
1363 | s->sizer = *it; | 1373 | s->sizer = *it; |
1364 | ++it; | 1374 | ++it; |
1365 | } | 1375 | } |
1366 | s = data->list.next(); | 1376 | s = data->list.next(); |
1367 | } | 1377 | } |
1368 | doResize(); | 1378 | doResize(); |
1369 | } | 1379 | } |
1370 | 1380 | ||
1371 | 1381 | ||
1372 | /*! | 1382 | /*! |
1373 | Gets all posted child events, ensuring that the internal state of | 1383 | Gets all posted child events, ensuring that the internal state of |
1374 | the splitter is consistent. | 1384 | the splitter is consistent. |
1375 | */ | 1385 | */ |
1376 | 1386 | ||
1377 | void KDGanttMinimizeSplitter::processChildEvents() | 1387 | void KDGanttMinimizeSplitter::processChildEvents() |
1378 | { | 1388 | { |
1379 | QApplication::sendPostedEvents( this, QEvent::ChildInserted ); | 1389 | QApplication::sendPostedEvents( this, QEvent::ChildInserted ); |
1380 | } | 1390 | } |
1381 | 1391 | ||
1382 | 1392 | ||
1383 | /*! | 1393 | /*! |
1384 | \reimp | 1394 | \reimp |
1385 | */ | 1395 | */ |
1386 | 1396 | ||
1387 | void KDGanttMinimizeSplitter::styleChange( QStyle& old ) | 1397 | void KDGanttMinimizeSplitter::styleChange( QStyle& old ) |
1388 | { | 1398 | { |
1389 | 1399 | ||
1390 | #if QT_VERSION >= 0x030000 | 1400 | #if QT_VERSION >= 0x030000 |
1391 | int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); | 1401 | int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); |
1392 | #else | 1402 | #else |
1393 | int sw = style().splitterWidth(); | 1403 | int sw = style().splitterWidth(); |
1394 | #endif | 1404 | #endif |
1395 | QSplitterLayoutStruct *s = data->list.first(); | 1405 | QSplitterLayoutStruct *s = data->list.first(); |
1396 | while ( s ) { | 1406 | while ( s ) { |
1397 | if ( s->isSplitter ) | 1407 | if ( s->isSplitter ) |
1398 | s->sizer = sw; | 1408 | s->sizer = sw; |
1399 | s = data->list.next(); | 1409 | s = data->list.next(); |
1400 | } | 1410 | } |
1401 | doResize(); | 1411 | doResize(); |
1402 | QFrame::styleChange( old ); | 1412 | QFrame::styleChange( old ); |
1403 | } | 1413 | } |
1404 | 1414 | ||
1405 | #endif | 1415 | #endif |
1406 | 1416 | ||
1407 | /*! | 1417 | /*! |
1408 | Specifies the direction of the minimize buttons. | 1418 | Specifies the direction of the minimize buttons. |
1409 | If the orientation of the splitter is horizontal then with | 1419 | If the orientation of the splitter is horizontal then with |
1410 | KDGanttMinimizeSplitter::Left or KDGanttMinimizeSplitter::Right should be used, | 1420 | KDGanttMinimizeSplitter::Left or KDGanttMinimizeSplitter::Right should be used, |
1411 | otherwise either KDGanttMinimizeSplitter::Up or KDGanttMinimizeSplitter::Down | 1421 | otherwise either KDGanttMinimizeSplitter::Up or KDGanttMinimizeSplitter::Down |
1412 | should be used. | 1422 | should be used. |
1413 | */ | 1423 | */ |
1414 | void KDGanttMinimizeSplitter::setMinimizeDirection( Direction direction ) | 1424 | void KDGanttMinimizeSplitter::setMinimizeDirection( Direction direction ) |
1415 | { | 1425 | { |
1416 | _direction = direction; | 1426 | _direction = direction; |
1417 | } | 1427 | } |
1418 | 1428 | ||
1419 | /*! | 1429 | /*! |
1420 | Returns the direction of the minimize buttons. | 1430 | Returns the direction of the minimize buttons. |
1421 | */ | 1431 | */ |
1422 | KDGanttMinimizeSplitter::Direction KDGanttMinimizeSplitter::minimizeDirection() const | 1432 | KDGanttMinimizeSplitter::Direction KDGanttMinimizeSplitter::minimizeDirection() const |
1423 | { | 1433 | { |
1424 | return _direction; | 1434 | return _direction; |
1425 | } | 1435 | } |
1426 | 1436 | ||
1427 | /* | 1437 | /* |
1428 | This is a copy of qGeomCalc() in qlayoutengine.cpp which | 1438 | This is a copy of qGeomCalc() in qlayoutengine.cpp which |
1429 | unfortunately isn't exported. | 1439 | unfortunately isn't exported. |
1430 | */ | 1440 | */ |
1431 | static inline int toFixed( int i ) { return i * 256; } | 1441 | static inline int toFixed( int i ) { return i * 256; } |
1432 | static inline int fRound( int i ) { | 1442 | static inline int fRound( int i ) { |
1433 | return ( i % 256 < 128 ) ? i / 256 : 1 + i / 256; | 1443 | return ( i % 256 < 128 ) ? i / 256 : 1 + i / 256; |
1434 | } | 1444 | } |
1435 | void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, | 1445 | void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, |
1436 | int space, int spacer ) | 1446 | int space, int spacer ) |
1437 | { | 1447 | { |
1438 | typedef int fixed; | 1448 | typedef int fixed; |
1439 | int cHint = 0; | 1449 | int cHint = 0; |
1440 | int cMin = 0; | 1450 | int cMin = 0; |
1441 | int cMax = 0; | 1451 | int cMax = 0; |
1442 | int sumStretch = 0; | 1452 | int sumStretch = 0; |
1443 | int spacerCount = 0; | 1453 | int spacerCount = 0; |
1444 | 1454 | ||
1445 | bool wannaGrow = FALSE; // anyone who really wants to grow? | 1455 | bool wannaGrow = FALSE; // anyone who really wants to grow? |
1446 | // bool canShrink = FALSE; // anyone who could be persuaded to shrink? | 1456 | // bool canShrink = FALSE; // anyone who could be persuaded to shrink? |
1447 | 1457 | ||
1448 | int i; | 1458 | int i; |
1449 | for ( i = start; i < start + count; i++ ) { | 1459 | for ( i = start; i < start + count; i++ ) { |
1450 | chain[i].done = FALSE; | 1460 | chain[i].done = FALSE; |
1451 | cHint += chain[i].sizeHint; | 1461 | cHint += chain[i].sizeHint; |
1452 | cMin += chain[i].minimumSize; | 1462 | cMin += chain[i].minimumSize; |
1453 | cMax += chain[i].maximumSize; | 1463 | cMax += chain[i].maximumSize; |
1454 | sumStretch += chain[i].stretch; | 1464 | sumStretch += chain[i].stretch; |
1455 | if ( !chain[i].empty ) | 1465 | if ( !chain[i].empty ) |
1456 | spacerCount++; | 1466 | spacerCount++; |
1457 | wannaGrow = wannaGrow || chain[i].expansive; | 1467 | wannaGrow = wannaGrow || chain[i].expansive; |
1458 | } | 1468 | } |
1459 | 1469 | ||
1460 | int extraspace = 0; | 1470 | int extraspace = 0; |
1461 | if ( spacerCount ) | 1471 | if ( spacerCount ) |
1462 | spacerCount--; // only spacers between things | 1472 | spacerCount--; // only spacers between things |
1463 | if ( space < cMin + spacerCount * spacer ) { | 1473 | if ( space < cMin + spacerCount * spacer ) { |
1464 | //qDebug("not enough space"); | 1474 | //qDebug("not enough space"); |
1465 | for ( i = start; i < start+count; i++ ) { | 1475 | for ( i = start; i < start+count; i++ ) { |
1466 | chain[i].size = chain[i].minimumSize; | 1476 | chain[i].size = chain[i].minimumSize; |
1467 | chain[i].done = TRUE; | 1477 | chain[i].done = TRUE; |
1468 | } | 1478 | } |
1469 | } else if ( space < cHint + spacerCount*spacer ) { | 1479 | } else if ( space < cHint + spacerCount*spacer ) { |
1470 | // Less space than sizeHint, but more than minimum. | 1480 | // Less space than sizeHint, but more than minimum. |
1471 | // Currently take space equally from each, like in Qt 2.x. | 1481 | // Currently take space equally from each, like in Qt 2.x. |
1472 | // Commented-out lines will give more space to stretchier items. | 1482 | // Commented-out lines will give more space to stretchier items. |
1473 | int n = count; | 1483 | int n = count; |
1474 | int space_left = space - spacerCount*spacer; | 1484 | int space_left = space - spacerCount*spacer; |
1475 | int overdraft = cHint - space_left; | 1485 | int overdraft = cHint - space_left; |
1476 | //first give to the fixed ones: | 1486 | //first give to the fixed ones: |
1477 | for ( i = start; i < start+count; i++ ) { | 1487 | for ( i = start; i < start+count; i++ ) { |
1478 | if ( !chain[i].done && chain[i].minimumSize >= chain[i].sizeHint) { | 1488 | if ( !chain[i].done && chain[i].minimumSize >= chain[i].sizeHint) { |
1479 | chain[i].size = chain[i].sizeHint; | 1489 | chain[i].size = chain[i].sizeHint; |
1480 | chain[i].done = TRUE; | 1490 | chain[i].done = TRUE; |
1481 | space_left -= chain[i].sizeHint; | 1491 | space_left -= chain[i].sizeHint; |
1482 | // sumStretch -= chain[i].stretch; | 1492 | // sumStretch -= chain[i].stretch; |
1483 | n--; | 1493 | n--; |
1484 | } | 1494 | } |
1485 | } | 1495 | } |
1486 | bool finished = n == 0; | 1496 | bool finished = n == 0; |
1487 | while ( !finished ) { | 1497 | while ( !finished ) { |
1488 | finished = TRUE; | 1498 | finished = TRUE; |
1489 | fixed fp_over = toFixed( overdraft ); | 1499 | fixed fp_over = toFixed( overdraft ); |
1490 | fixed fp_w = 0; | 1500 | fixed fp_w = 0; |
1491 | 1501 | ||
1492 | for ( i = start; i < start+count; i++ ) { | 1502 | for ( i = start; i < start+count; i++ ) { |
1493 | if ( chain[i].done ) | 1503 | if ( chain[i].done ) |
1494 | continue; | 1504 | continue; |
1495 | // if ( sumStretch <= 0 ) | 1505 | // if ( sumStretch <= 0 ) |
1496 | fp_w += fp_over / n; | 1506 | fp_w += fp_over / n; |
1497 | // else | 1507 | // else |
1498 | // fp_w += (fp_over * chain[i].stretch) / sumStretch; | 1508 | // fp_w += (fp_over * chain[i].stretch) / sumStretch; |
1499 | int w = fRound( fp_w ); | 1509 | int w = fRound( fp_w ); |
1500 | chain[i].size = chain[i].sizeHint - w; | 1510 | chain[i].size = chain[i].sizeHint - w; |
1501 | fp_w -= toFixed( w ); //give the difference to the next | 1511 | fp_w -= toFixed( w ); //give the difference to the next |
1502 | if ( chain[i].size < chain[i].minimumSize ) { | 1512 | if ( chain[i].size < chain[i].minimumSize ) { |
1503 | chain[i].done = TRUE; | 1513 | chain[i].done = TRUE; |
1504 | chain[i].size = chain[i].minimumSize; | 1514 | chain[i].size = chain[i].minimumSize; |
1505 | finished = FALSE; | 1515 | finished = FALSE; |
1506 | overdraft -= chain[i].sizeHint - chain[i].minimumSize; | 1516 | overdraft -= chain[i].sizeHint - chain[i].minimumSize; |
1507 | // sumStretch -= chain[i].stretch; | 1517 | // sumStretch -= chain[i].stretch; |
1508 | n--; | 1518 | n--; |
1509 | break; | 1519 | break; |
1510 | } | 1520 | } |
1511 | } | 1521 | } |
1512 | } | 1522 | } |
1513 | } else { //extra space | 1523 | } else { //extra space |
1514 | int n = count; | 1524 | int n = count; |
1515 | int space_left = space - spacerCount*spacer; | 1525 | int space_left = space - spacerCount*spacer; |
1516 | // first give to the fixed ones, and handle non-expansiveness | 1526 | // first give to the fixed ones, and handle non-expansiveness |
1517 | for ( i = start; i < start + count; i++ ) { | 1527 | for ( i = start; i < start + count; i++ ) { |
1518 | if ( !chain[i].done && (chain[i].maximumSize <= chain[i].sizeHint | 1528 | if ( !chain[i].done && (chain[i].maximumSize <= chain[i].sizeHint |
1519 | || wannaGrow && !chain[i].expansive) ) { | 1529 | || wannaGrow && !chain[i].expansive) ) { |
1520 | chain[i].size = chain[i].sizeHint; | 1530 | chain[i].size = chain[i].sizeHint; |
1521 | chain[i].done = TRUE; | 1531 | chain[i].done = TRUE; |
1522 | space_left -= chain[i].sizeHint; | 1532 | space_left -= chain[i].sizeHint; |
1523 | sumStretch -= chain[i].stretch; | 1533 | sumStretch -= chain[i].stretch; |
1524 | n--; | 1534 | n--; |
1525 | } | 1535 | } |
1526 | } | 1536 | } |
1527 | extraspace = space_left; | 1537 | extraspace = space_left; |
1528 | /* | 1538 | /* |
1529 | Do a trial distribution and calculate how much it is off. | 1539 | Do a trial distribution and calculate how much it is off. |
1530 | If there are more deficit pixels than surplus pixels, give | 1540 | If there are more deficit pixels than surplus pixels, give |
1531 | the minimum size items what they need, and repeat. | 1541 | the minimum size items what they need, and repeat. |
1532 | Otherwise give to the maximum size items, and repeat. | 1542 | Otherwise give to the maximum size items, and repeat. |
1533 | 1543 | ||
1534 | I have a wonderful mathematical proof for the correctness | 1544 | I have a wonderful mathematical proof for the correctness |
1535 | of this principle, but unfortunately this comment is too | 1545 | of this principle, but unfortunately this comment is too |
1536 | small to contain it. | 1546 | small to contain it. |
1537 | */ | 1547 | */ |
1538 | int surplus, deficit; | 1548 | int surplus, deficit; |
1539 | do { | 1549 | do { |
1540 | surplus = deficit = 0; | 1550 | surplus = deficit = 0; |
1541 | fixed fp_space = toFixed( space_left ); | 1551 | fixed fp_space = toFixed( space_left ); |
1542 | fixed fp_w = 0; | 1552 | fixed fp_w = 0; |
1543 | for ( i = start; i < start+count; i++ ) { | 1553 | for ( i = start; i < start+count; i++ ) { |
1544 | if ( chain[i].done ) | 1554 | if ( chain[i].done ) |
1545 | continue; | 1555 | continue; |
1546 | extraspace = 0; | 1556 | extraspace = 0; |
1547 | if ( sumStretch <= 0 ) | 1557 | if ( sumStretch <= 0 ) |
1548 | fp_w += fp_space / n; | 1558 | fp_w += fp_space / n; |
1549 | else | 1559 | else |
1550 | fp_w += (fp_space * chain[i].stretch) / sumStretch; | 1560 | fp_w += (fp_space * chain[i].stretch) / sumStretch; |
1551 | int w = fRound( fp_w ); | 1561 | int w = fRound( fp_w ); |
1552 | chain[i].size = w; | 1562 | chain[i].size = w; |
1553 | fp_w -= toFixed( w ); // give the difference to the next | 1563 | fp_w -= toFixed( w ); // give the difference to the next |
1554 | if ( w < chain[i].sizeHint ) { | 1564 | if ( w < chain[i].sizeHint ) { |
1555 | deficit += chain[i].sizeHint - w; | 1565 | deficit += chain[i].sizeHint - w; |
1556 | } else if ( w > chain[i].maximumSize ) { | 1566 | } else if ( w > chain[i].maximumSize ) { |
1557 | surplus += w - chain[i].maximumSize; | 1567 | surplus += w - chain[i].maximumSize; |
1558 | } | 1568 | } |
1559 | } | 1569 | } |
1560 | if ( deficit > 0 && surplus <= deficit ) { | 1570 | if ( deficit > 0 && surplus <= deficit ) { |
1561 | // give to the ones that have too little | 1571 | // give to the ones that have too little |
1562 | for ( i = start; i < start+count; i++ ) { | 1572 | for ( i = start; i < start+count; i++ ) { |
1563 | if ( !chain[i].done && | 1573 | if ( !chain[i].done && |
1564 | chain[i].size < chain[i].sizeHint ) { | 1574 | chain[i].size < chain[i].sizeHint ) { |
1565 | chain[i].size = chain[i].sizeHint; | 1575 | chain[i].size = chain[i].sizeHint; |
1566 | chain[i].done = TRUE; | 1576 | chain[i].done = TRUE; |
1567 | space_left -= chain[i].sizeHint; | 1577 | space_left -= chain[i].sizeHint; |
1568 | sumStretch -= chain[i].stretch; | 1578 | sumStretch -= chain[i].stretch; |
1569 | n--; | 1579 | n--; |
1570 | } | 1580 | } |
1571 | } | 1581 | } |
1572 | } | 1582 | } |
1573 | if ( surplus > 0 && surplus >= deficit ) { | 1583 | if ( surplus > 0 && surplus >= deficit ) { |
1574 | // take from the ones that have too much | 1584 | // take from the ones that have too much |
1575 | for ( i = start; i < start+count; i++ ) { | 1585 | for ( i = start; i < start+count; i++ ) { |
1576 | if ( !chain[i].done && | 1586 | if ( !chain[i].done && |
1577 | chain[i].size > chain[i].maximumSize ) { | 1587 | chain[i].size > chain[i].maximumSize ) { |
1578 | chain[i].size = chain[i].maximumSize; | 1588 | chain[i].size = chain[i].maximumSize; |
1579 | chain[i].done = TRUE; | 1589 | chain[i].done = TRUE; |
1580 | space_left -= chain[i].maximumSize; | 1590 | space_left -= chain[i].maximumSize; |
1581 | sumStretch -= chain[i].stretch; | 1591 | sumStretch -= chain[i].stretch; |
1582 | n--; | 1592 | n--; |
1583 | } | 1593 | } |
1584 | } | 1594 | } |
1585 | } | 1595 | } |
1586 | } while ( n > 0 && surplus != deficit ); | 1596 | } while ( n > 0 && surplus != deficit ); |
1587 | if ( n == 0 ) | 1597 | if ( n == 0 ) |
1588 | extraspace = space_left; | 1598 | extraspace = space_left; |
1589 | } | 1599 | } |
1590 | 1600 | ||
1591 | // as a last resort, we distribute the unwanted space equally | 1601 | // as a last resort, we distribute the unwanted space equally |
1592 | // among the spacers (counting the start and end of the chain). | 1602 | // among the spacers (counting the start and end of the chain). |
1593 | 1603 | ||
1594 | //### should do a sub-pixel allocation of extra space | 1604 | //### should do a sub-pixel allocation of extra space |
1595 | int extra = extraspace / ( spacerCount + 2 ); | 1605 | int extra = extraspace / ( spacerCount + 2 ); |
1596 | int p = pos + extra; | 1606 | int p = pos + extra; |
1597 | for ( i = start; i < start+count; i++ ) { | 1607 | for ( i = start; i < start+count; i++ ) { |
1598 | chain[i].pos = p; | 1608 | chain[i].pos = p; |
1599 | p = p + chain[i].size; | 1609 | p = p + chain[i].size; |
1600 | if ( !chain[i].empty ) | 1610 | if ( !chain[i].empty ) |
1601 | p += spacer+extra; | 1611 | p += spacer+extra; |
1602 | } | 1612 | } |
1603 | } | 1613 | } |
1604 | 1614 | ||
1605 | #endif | 1615 | #endif |
1606 | 1616 | ||
1607 | /*! | 1617 | /*! |
1608 | \enum KDGanttMinimizeSplitter::Direction | 1618 | \enum KDGanttMinimizeSplitter::Direction |
1609 | 1619 | ||
1610 | The values of this enumeration describe into which direction the | 1620 | The values of this enumeration describe into which direction the |
1611 | splitter will collapse its child widgets. By extension, it also | 1621 | splitter will collapse its child widgets. By extension, it also |
1612 | specifies the orientation of the splitter; collapsing to the left or | 1622 | specifies the orientation of the splitter; collapsing to the left or |
1613 | to the right results in a horizontal splitter, collapsing to the top | 1623 | to the right results in a horizontal splitter, collapsing to the top |
1614 | or bottom in a vertical splitter. | 1624 | or bottom in a vertical splitter. |
1615 | */ | 1625 | */ |
1616 | 1626 | ||
1617 | /*! | 1627 | /*! |
1618 | \fn Orientation KDGanttMinimizeSplitter::orientation() const | 1628 | \fn Orientation KDGanttMinimizeSplitter::orientation() const |
1619 | 1629 | ||
1620 | Returns the orientation of the splitter. | 1630 | Returns the orientation of the splitter. |
1621 | */ | 1631 | */ |
1622 | 1632 | ||
1623 | /*! \enum KDGanttMinimizeSplitter::ResizeMode | 1633 | /*! \enum KDGanttMinimizeSplitter::ResizeMode |
1624 | 1634 | ||
1625 | This enum type describes how KDGanttMinimizeSplitter will resize each of its child widgets. The currently defined values are: | 1635 | This enum type describes how KDGanttMinimizeSplitter will resize each of its child widgets. The currently defined values are: |
1626 | 1636 | ||
1627 | Stretch: the widget will be resized when the splitter | 1637 | Stretch: the widget will be resized when the splitter |
1628 | itself is resized. | 1638 | itself is resized. |
1629 | 1639 | ||
1630 | KeepSize: KDGanttMinimizeSplitter will try to keep this widget's size | 1640 | KeepSize: KDGanttMinimizeSplitter will try to keep this widget's size |
1631 | unchanged. | 1641 | unchanged. |
1632 | 1642 | ||
1633 | FollowSizeHint: KDGanttMinimizeSplitter will resize the widget when the | 1643 | FollowSizeHint: KDGanttMinimizeSplitter will resize the widget when the |
1634 | widget's size hint changes. | 1644 | widget's size hint changes. |
1635 | */ | 1645 | */ |
1636 | 1646 | ||
diff --git a/microkde/KDGanttMinimizeSplitter.h b/microkde/KDGanttMinimizeSplitter.h index 75e0443..8120d14 100644 --- a/microkde/KDGanttMinimizeSplitter.h +++ b/microkde/KDGanttMinimizeSplitter.h | |||
@@ -1,186 +1,188 @@ | |||
1 | /* -*- Mode: C++ -*- | 1 | /* -*- Mode: C++ -*- |
2 | $Id$ | 2 | $Id$ |
3 | */ | 3 | */ |
4 | 4 | ||
5 | /**************************************************************************** | 5 | /**************************************************************************** |
6 | ** Copyright (C) 2001-2004 Klarälvdalens Datakonsult AB. All rights reserved. | 6 | ** Copyright (C) 2001-2004 Klarälvdalens Datakonsult AB. All rights reserved. |
7 | ** | 7 | ** |
8 | ** This file is part of the KDGantt library. | 8 | ** This file is part of the KDGantt library. |
9 | ** | 9 | ** |
10 | ** This file may be distributed and/or modified under the terms of the | 10 | ** This file may be distributed and/or modified under the terms of the |
11 | ** GNU General Public License version 2 as published by the Free Software | 11 | ** GNU General Public License version 2 as published by the Free Software |
12 | ** Foundation and appearing in the file LICENSE.GPL included in the | 12 | ** Foundation and appearing in the file LICENSE.GPL included in the |
13 | ** packaging of this file. | 13 | ** packaging of this file. |
14 | ** | 14 | ** |
15 | ** Licensees holding valid commercial KDGantt licenses may use this file in | 15 | ** Licensees holding valid commercial KDGantt licenses may use this file in |
16 | ** accordance with the KDGantt Commercial License Agreement provided with | 16 | ** accordance with the KDGantt Commercial License Agreement provided with |
17 | ** the Software. | 17 | ** the Software. |
18 | ** | 18 | ** |
19 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 19 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
20 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 20 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
21 | ** | 21 | ** |
22 | ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for | 22 | ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for |
23 | ** information about KDGantt Commercial License Agreements. | 23 | ** information about KDGantt Commercial License Agreements. |
24 | ** | 24 | ** |
25 | ** Contact info@klaralvdalens-datakonsult.se if any conditions of this | 25 | ** Contact info@klaralvdalens-datakonsult.se if any conditions of this |
26 | ** licensing are not clear to you. | 26 | ** licensing are not clear to you. |
27 | ** | 27 | ** |
28 | ** As a special exception, permission is given to link this program | 28 | ** As a special exception, permission is given to link this program |
29 | ** with any edition of Qt, and distribute the resulting executable, | 29 | ** with any edition of Qt, and distribute the resulting executable, |
30 | ** without including the source code for Qt in the source distribution. | 30 | ** without including the source code for Qt in the source distribution. |
31 | ** | 31 | ** |
32 | **********************************************************************/ | 32 | **********************************************************************/ |
33 | 33 | ||
34 | #ifndef KDGANTTMINIMIZESPLITTER_H | 34 | #ifndef KDGANTTMINIMIZESPLITTER_H |
35 | #define KDGANTTMINIMIZESPLITTER_H | 35 | #define KDGANTTMINIMIZESPLITTER_H |
36 | 36 | ||
37 | #ifndef QT_H | 37 | #ifndef QT_H |
38 | #include "qframe.h" | 38 | #include "qframe.h" |
39 | #include "qvaluelist.h" | 39 | #include "qvaluelist.h" |
40 | #endif // QT_H | 40 | #endif // QT_H |
41 | 41 | ||
42 | #ifndef QT_NO_SPLITTER___ | 42 | #ifndef QT_NO_SPLITTER___ |
43 | class QSplitterData; | 43 | class QSplitterData; |
44 | class QSplitterLayoutStruct; | 44 | class QSplitterLayoutStruct; |
45 | class KDGanttSplitterHandle; | 45 | class KDGanttSplitterHandle; |
46 | class KDGanttMinimizeSplitter : public QFrame | 46 | class KDGanttMinimizeSplitter : public QFrame |
47 | { | 47 | { |
48 | Q_OBJECT | 48 | Q_OBJECT |
49 | // Q_ENUMS( Direction ) | 49 | // Q_ENUMS( Direction ) |
50 | // Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) | 50 | // Q_PROPERTY( Orientation orientation READ orientation WRITE setOrientation ) |
51 | // Q_PROPERTY( Direction minimizeDirection READ minimizeDirection WRITE setMinimizeDirection ) | 51 | // Q_PROPERTY( Direction minimizeDirection READ minimizeDirection WRITE setMinimizeDirection ) |
52 | 52 | ||
53 | public: | 53 | public: |
54 | enum ResizeMode { Stretch, KeepSize, FollowSizeHint }; | 54 | enum ResizeMode { Stretch, KeepSize, FollowSizeHint }; |
55 | enum Direction { Left, Right, Up, Down }; | 55 | enum Direction { Left, Right, Up, Down }; |
56 | 56 | ||
57 | KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); | 57 | KDGanttMinimizeSplitter( QWidget* parent=0, const char* name=0 ); |
58 | KDGanttMinimizeSplitter( Orientation, QWidget* parent=0, const char* name=0 ); | 58 | KDGanttMinimizeSplitter( Orientation, QWidget* parent=0, const char* name=0 ); |
59 | ~KDGanttMinimizeSplitter(); | 59 | ~KDGanttMinimizeSplitter(); |
60 | 60 | ||
61 | virtual void setOrientation( Orientation ); | 61 | virtual void setOrientation( Orientation ); |
62 | Orientation orientation() const { return orient; } | 62 | Orientation orientation() const { return orient; } |
63 | 63 | ||
64 | void setMinimizeDirection( Direction ); | 64 | void setMinimizeDirection( Direction ); |
65 | Direction minimizeDirection() const; | 65 | Direction minimizeDirection() const; |
66 | 66 | ||
67 | #if QT_VERSION >= 232 | 67 | #if QT_VERSION >= 232 |
68 | virtual void setResizeMode( QWidget *w, ResizeMode ); | 68 | virtual void setResizeMode( QWidget *w, ResizeMode ); |
69 | virtual void setOpaqueResize( bool = TRUE ); | 69 | virtual void setOpaqueResize( bool = TRUE ); |
70 | bool opaqueResize() const; | 70 | bool opaqueResize() const; |
71 | 71 | ||
72 | void moveToFirst( QWidget * ); | 72 | void moveToFirst( QWidget * ); |
73 | void moveToLast( QWidget * ); | 73 | void moveToLast( QWidget * ); |
74 | 74 | ||
75 | void refresh() { recalc( TRUE ); } | 75 | void refresh() { recalc( TRUE ); } |
76 | QSize sizeHint() const; | 76 | QSize sizeHint() const; |
77 | QSize minimumSizeHint() const; | 77 | QSize minimumSizeHint() const; |
78 | 78 | ||
79 | QValueList<int> sizes() const; | 79 | QValueList<int> sizes() const; |
80 | void setSizes( QValueList<int> ); | 80 | void setSizes( QValueList<int> ); |
81 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} | 81 | KDGanttSplitterHandle* firstHandle(){ return mFirstHandle;} |
82 | void expandPos( int id, int* min, int* max ); | 82 | void expandPos( int id, int* min, int* max ); |
83 | public slots: | ||
84 | void toggle(); | ||
83 | protected: | 85 | protected: |
84 | void childEvent( QChildEvent * ); | 86 | void childEvent( QChildEvent * ); |
85 | 87 | ||
86 | bool event( QEvent * ); | 88 | bool event( QEvent * ); |
87 | void resizeEvent( QResizeEvent * ); | 89 | void resizeEvent( QResizeEvent * ); |
88 | 90 | ||
89 | int idAfter( QWidget* ) const; | 91 | int idAfter( QWidget* ) const; |
90 | 92 | ||
91 | void moveSplitter( QCOORD pos, int id ); | 93 | void moveSplitter( QCOORD pos, int id ); |
92 | virtual void drawSplitter( QPainter*, QCOORD x, QCOORD y, | 94 | virtual void drawSplitter( QPainter*, QCOORD x, QCOORD y, |
93 | QCOORD w, QCOORD h ); | 95 | QCOORD w, QCOORD h ); |
94 | void styleChange( QStyle& ); | 96 | void styleChange( QStyle& ); |
95 | int adjustPos( int , int ); | 97 | int adjustPos( int , int ); |
96 | virtual void setRubberband( int ); | 98 | virtual void setRubberband( int ); |
97 | void getRange( int id, int*, int* ); | 99 | void getRange( int id, int*, int* ); |
98 | 100 | ||
99 | private: | 101 | private: |
100 | void init(); | 102 | void init(); |
101 | void recalc( bool update = FALSE ); | 103 | void recalc( bool update = FALSE ); |
102 | void doResize(); | 104 | void doResize(); |
103 | void storeSizes(); | 105 | void storeSizes(); |
104 | void processChildEvents(); | 106 | void processChildEvents(); |
105 | QSplitterLayoutStruct *addWidget( QWidget*, bool first = FALSE ); | 107 | QSplitterLayoutStruct *addWidget( QWidget*, bool first = FALSE ); |
106 | void recalcId(); | 108 | void recalcId(); |
107 | void moveBefore( int pos, int id, bool upLeft ); | 109 | void moveBefore( int pos, int id, bool upLeft ); |
108 | void moveAfter( int pos, int id, bool upLeft ); | 110 | void moveAfter( int pos, int id, bool upLeft ); |
109 | void setG( QWidget *w, int p, int s, bool isSplitter = FALSE ); | 111 | void setG( QWidget *w, int p, int s, bool isSplitter = FALSE ); |
110 | 112 | ||
111 | QCOORD pick( const QPoint &p ) const | 113 | QCOORD pick( const QPoint &p ) const |
112 | { return orient == Horizontal ? p.x() : p.y(); } | 114 | { return orient == Horizontal ? p.x() : p.y(); } |
113 | QCOORD pick( const QSize &s ) const | 115 | QCOORD pick( const QSize &s ) const |
114 | { return orient == Horizontal ? s.width() : s.height(); } | 116 | { return orient == Horizontal ? s.width() : s.height(); } |
115 | 117 | ||
116 | QCOORD trans( const QPoint &p ) const | 118 | QCOORD trans( const QPoint &p ) const |
117 | { return orient == Vertical ? p.x() : p.y(); } | 119 | { return orient == Vertical ? p.x() : p.y(); } |
118 | QCOORD trans( const QSize &s ) const | 120 | QCOORD trans( const QSize &s ) const |
119 | { return orient == Vertical ? s.width() : s.height(); } | 121 | { return orient == Vertical ? s.width() : s.height(); } |
120 | KDGanttSplitterHandle* mFirstHandle; | 122 | KDGanttSplitterHandle* mFirstHandle; |
121 | QSplitterData *data; | 123 | QSplitterData *data; |
122 | #endif | 124 | #endif |
123 | 125 | ||
124 | private: | 126 | private: |
125 | Orientation orient; | 127 | Orientation orient; |
126 | Direction _direction; | 128 | Direction _direction; |
127 | #ifndef DOXYGEN_SKIP_INTERNAL | 129 | #ifndef DOXYGEN_SKIP_INTERNAL |
128 | friend class KDGanttSplitterHandle; | 130 | friend class KDGanttSplitterHandle; |
129 | #endif | 131 | #endif |
130 | private:// Disabled copy constructor and operator= | 132 | private:// Disabled copy constructor and operator= |
131 | #if defined(Q_DISABLE_COPY) | 133 | #if defined(Q_DISABLE_COPY) |
132 | KDGanttMinimizeSplitter( const KDGanttMinimizeSplitter & ); | 134 | KDGanttMinimizeSplitter( const KDGanttMinimizeSplitter & ); |
133 | KDGanttMinimizeSplitter& operator=( const KDGanttMinimizeSplitter & ); | 135 | KDGanttMinimizeSplitter& operator=( const KDGanttMinimizeSplitter & ); |
134 | #endif | 136 | #endif |
135 | }; | 137 | }; |
136 | 138 | ||
137 | #ifndef DOXYGEN_SKIP_INTERNAL | 139 | #ifndef DOXYGEN_SKIP_INTERNAL |
138 | // This class was continued from a verbatim copy of the | 140 | // This class was continued from a verbatim copy of the |
139 | // QSplitterHandle pertaining to the Qt Enterprise License and the | 141 | // QSplitterHandle pertaining to the Qt Enterprise License and the |
140 | // GPL. It has only been renamed to KDGanttSplitterHandler in order to | 142 | // GPL. It has only been renamed to KDGanttSplitterHandler in order to |
141 | // avoid a symbol clash on some platforms. | 143 | // avoid a symbol clash on some platforms. |
142 | class KDGanttSplitterHandle : public QWidget | 144 | class KDGanttSplitterHandle : public QWidget |
143 | { | 145 | { |
144 | Q_OBJECT | 146 | Q_OBJECT |
145 | #if QT_VERSION >= 232 | 147 | #if QT_VERSION >= 232 |
146 | public: | 148 | public: |
147 | KDGanttSplitterHandle( Qt::Orientation o, | 149 | KDGanttSplitterHandle( Qt::Orientation o, |
148 | KDGanttMinimizeSplitter *parent, const char* name=0 ); | 150 | KDGanttMinimizeSplitter *parent, const char* name=0 ); |
149 | void setOrientation( Qt::Orientation o ); | 151 | void setOrientation( Qt::Orientation o ); |
150 | Qt::Orientation orientation() const { return orient; } | 152 | Qt::Orientation orientation() const { return orient; } |
151 | 153 | ||
152 | bool opaque() const { return s->opaqueResize(); } | 154 | bool opaque() const { return s->opaqueResize(); } |
153 | 155 | ||
154 | QSize sizeHint() const; | 156 | QSize sizeHint() const; |
155 | void toggle(); | 157 | void toggle(); |
156 | 158 | ||
157 | int id() const { return myId; } // data->list.at(id())->wid == this | 159 | int id() const { return myId; } // data->list.at(id())->wid == this |
158 | void setId( int i ) { myId = i; } | 160 | void setId( int i ) { myId = i; } |
159 | 161 | ||
160 | protected: | 162 | protected: |
161 | QValueList<QPointArray> buttonRegions(); | 163 | QValueList<QPointArray> buttonRegions(); |
162 | void paintEvent( QPaintEvent * ); | 164 | void paintEvent( QPaintEvent * ); |
163 | void mouseMoveEvent( QMouseEvent * ); | 165 | void mouseMoveEvent( QMouseEvent * ); |
164 | void mousePressEvent( QMouseEvent * ); | 166 | void mousePressEvent( QMouseEvent * ); |
165 | void mouseReleaseEvent( QMouseEvent * ); | 167 | void mouseReleaseEvent( QMouseEvent * ); |
166 | int onButton( const QPoint& p ); | 168 | int onButton( const QPoint& p ); |
167 | void updateCursor( const QPoint& p ); | 169 | void updateCursor( const QPoint& p ); |
168 | 170 | ||
169 | private: | 171 | private: |
170 | QSize mSizeHint; | 172 | QSize mSizeHint; |
171 | bool mUseOffset; | 173 | bool mUseOffset; |
172 | Qt::Orientation orient; | 174 | Qt::Orientation orient; |
173 | bool opaq; | 175 | bool opaq; |
174 | int myId; | 176 | int myId; |
175 | 177 | ||
176 | KDGanttMinimizeSplitter *s; | 178 | KDGanttMinimizeSplitter *s; |
177 | int _activeButton; | 179 | int _activeButton; |
178 | bool _collapsed; | 180 | bool _collapsed; |
179 | int _origPos; | 181 | int _origPos; |
180 | #endif | 182 | #endif |
181 | }; | 183 | }; |
182 | #endif | 184 | #endif |
183 | 185 | ||
184 | #endif // QT_NO_SPLITTER | 186 | #endif // QT_NO_SPLITTER |
185 | 187 | ||
186 | #endif // KDGANTTMINIMIZESPLITTER_H | 188 | #endif // KDGANTTMINIMIZESPLITTER_H |