summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-30 13:24:56 (UTC)
committer zautrix <zautrix>2005-03-30 13:24:56 (UTC)
commit056f171723a9301aea5a65340dffeda34e078abf (patch) (unidiff)
tree7930525c801dd9c5d9a910b71bca7dc79e10f666
parentb5222dd7a607f78235b1ea39fea0f95a9c08ccd3 (diff)
downloadkdepimpi-056f171723a9301aea5a65340dffeda34e078abf.zip
kdepimpi-056f171723a9301aea5a65340dffeda34e078abf.tar.gz
kdepimpi-056f171723a9301aea5a65340dffeda34e078abf.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile662
-rw-r--r--kabc/plugins/file/resourcefile.cpp22
-rw-r--r--korganizer/datenavigatorcontainer.cpp36
-rw-r--r--korganizer/kdatenavigator.cpp1
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp26
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.h1
6 files changed, 442 insertions, 306 deletions
diff --git a/Makefile b/Makefile
index df71188..594d47d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,279 +1,385 @@
1############################################################################# 1export KDEPIMDIR = $(shell pwd)
2# Makefile for building: kdepim-desktop 2
3# Generated by qmake (1.07a) (Qt 3.3.4) on: Wed Mar 30 01:16:42 2005 3export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version)
4# Project: kdepim-desktop.pro 4
5# Template: subdirs 5ifeq ($(PLATFORM) , zaurus)
6# Command: $(QMAKE) -o Makefile kdepim-desktop.pro 6 BUILD_NO_LDAP_PLUGIN=1
7############################################################################# 7endif
8 8
9 MAKEFILE =Makefile 9ifneq ($(PLATFORM) , zaurus)
10 QMAKE =qmake 10 BUILD_NO_SHARP_PLUGIN=1
11DEL_FILE = rm -f 11endif
12CHK_DIR_EXISTS= test -d 12
13MKDIR = mkdir -p 13#opie plugin is deprecated. The qtopia plugin handles the task from now on.
14INSTALL_FILE= 14BUILD_NO_OPIE_PLUGIN=1
15INSTALL_DIR = 15
16 SUBTARGETS = \ 16SUBDIRS_MICROKDE = \
17 sub-libical \ 17 libical/src/libical \
18 sub-libkcal \ 18 libical/src/libicalss \
19 sub-kabc \ 19 qtcompat \
20 sub-libkdepim \ 20 microkde \
21 sub-microkde \ 21 libkcal \
22 sub-korganizer \ 22 libkdepim \
23 sub-kaddressbook \ 23 kabc \
24 sub-kabc-plugins-file \ 24 kabc/formats/binary \
25 sub-kabc-plugins-dir \ 25 kabc/plugins/file \
26 sub-kabc-plugins-qtopia \ 26 kabc/plugins/dir \
27 sub-gammu-emb-common \ 27 korganizer \
28 sub-gammu-emb-gammu \ 28 kalarmd \
29 sub-libetpan \ 29 kaddressbook
30 sub-kmicromail-libmailwrapper \ 30
31 sub-kmicromail \ 31SUBDIRS_QTOPIA_PLUGIN = \
32 sub-pwmanager-libcrypt-cipher \ 32 kabc/plugins/qtopia
33 sub-pwmanager-libcrypt-error \ 33
34 sub-pwmanager-libcrypt-mpi \ 34SUBDIRS_OPIE_PLUGIN = \
35 sub-pwmanager-libcrypt-zlib \ 35 kabc/plugins/opie
36 sub-pwmanager-pwmanager 36
37 37SUBDIRS_SHARP_PLUGIN = \
38first: all 38 kabc/plugins/sharpdtm
39 39
40all: Makefile $(SUBTARGETS) 40SUBDIRS_LDAP_PLUGIN = \
41 41 kabc/plugins/ldap
42libical/$(MAKEFILE): 42
43 @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical" 43SUBDIRS_MICROMAIL = \
44 cd libical && $(QMAKE) libical.pro -o $(MAKEFILE) 44 libetpan \
45sub-libical: libical/$(MAKEFILE) FORCE 45 kmicromail/libmailwrapper \
46 cd libical && $(MAKE) -f $(MAKEFILE) 46 kmicromail
47 47
48libkcal/$(MAKEFILE): 48SUBDIRS_GAMMU = \
49 @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal" 49 gammu/emb/common \
50 cd libkcal && $(QMAKE) libkcal.pro -o $(MAKEFILE) 50 gammu/emb/gammu
51sub-libkcal: libkcal/$(MAKEFILE) FORCE 51
52 cd libkcal && $(MAKE) -f $(MAKEFILE) 52SUBDIRS_PWMANAGER = \
53 53 pwmanager/libcrypt/mpi \
54kabc/$(MAKEFILE): 54 pwmanager/libcrypt/error \
55 @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc" 55 pwmanager/libcrypt/cipher \
56 cd kabc && $(QMAKE) kabc.pro -o $(MAKEFILE) 56 pwmanager/libcrypt/zlib \
57sub-kabc: kabc/$(MAKEFILE) FORCE 57 pwmanager/pwmanager
58 cd kabc && $(MAKE) -f $(MAKEFILE) 58
59 59SUBDIRS = \
60libkdepim/$(MAKEFILE): 60 $(SUBDIRS_MICROKDE) \
61 @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim" 61 $(SUBDIRS_QTOPIA_PLUGIN) \
62 cd libkdepim && $(QMAKE) libkdepim.pro -o $(MAKEFILE) 62 $(SUBDIRS_OPIE_PLUGIN) \
63sub-libkdepim: libkdepim/$(MAKEFILE) FORCE 63 $(SUBDIRS_SHARP_PLUGIN) \
64 cd libkdepim && $(MAKE) -f $(MAKEFILE) 64 $(SUBDIRS_LDAP_PLUGIN) \
65 65 $(SUBDIRS_MICROMAIL) \
66microkde/$(MAKEFILE): 66 $(SUBDIRS_GAMMU) \
67 @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde" 67 $(SUBDIRS_PWMANAGER)
68 cd microkde && $(QMAKE) microkde.pro -o $(MAKEFILE) 68
69sub-microkde: microkde/$(MAKEFILE) FORCE 69
70 cd microkde && $(MAKE) -f $(MAKEFILE) 70all: build_microkde \
71 71 build_qtopia_plugin \
72korganizer/$(MAKEFILE): 72 build_opie_plugin \
73 @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer" 73 build_sharp_plugin \
74 cd korganizer && $(QMAKE) korganizer.pro -o $(MAKEFILE) 74 build_ldap_plugin \
75sub-korganizer: korganizer/$(MAKEFILE) FORCE 75 build_micromail \
76 cd korganizer && $(MAKE) -f $(MAKEFILE) 76 build_gammu \
77 77 build_pwmanager
78kaddressbook/$(MAKEFILE): 78
79 @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook" 79
80 cd kaddressbook && $(QMAKE) kaddressbook.pro -o $(MAKEFILE) 80build_microkde: variable_test tmake
81sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE 81 for i in $(SUBDIRS_MICROKDE); do pushd $$i; \
82 cd kaddressbook && $(MAKE) -f $(MAKEFILE) 82 make -f Makefile$(PLATFORM) || exit 1; popd; \
83 83 done
84kabc/plugins/file/$(MAKEFILE): 84
85 @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file" 85build_qtopia_plugin: build_microkde
86 cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE) 86 ifdef BUILD_NO_QTOPIA_PLUGIN
87sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE 87 @echo == qtopia plugin not build.
88 cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE) 88 else
89 89 for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \
90kabc/plugins/dir/$(MAKEFILE): 90 make -f Makefile$(PLATFORM) || exit 1; popd; \
91 @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir" 91 done
92 cd kabc/plugins/dir && $(QMAKE) dir.pro -o $(MAKEFILE) 92 endif
93sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE 93
94 cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE) 94build_opie_plugin: build_microkde
95 95 ifdef BUILD_NO_OPIE_PLUGIN
96kabc/plugins/qtopia/$(MAKEFILE): 96 @echo == opie plugin not build.
97 @$(CHK_DIR_EXISTS) "kabc/plugins/qtopia" || $(MKDIR) "kabc/plugins/qtopia" 97 else
98 cd kabc/plugins/qtopia && $(QMAKE) qtopia.pro -o $(MAKEFILE) 98 for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \
99sub-kabc-plugins-qtopia: kabc/plugins/qtopia/$(MAKEFILE) FORCE 99 make -f Makefile$(PLATFORM) || exit 1; popd; \
100 cd kabc/plugins/qtopia && $(MAKE) -f $(MAKEFILE) 100 done
101 101 endif
102gammu/emb/common/$(MAKEFILE): 102
103 @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common" 103build_sharp_plugin: build_microkde
104 cd gammu/emb/common && $(QMAKE) common.pro -o $(MAKEFILE) 104 ifdef BUILD_NO_SHARP_PLUGIN
105sub-gammu-emb-common: gammu/emb/common/$(MAKEFILE) FORCE 105 @echo == ldap plugin not build.
106 cd gammu/emb/common && $(MAKE) -f $(MAKEFILE) 106 else
107 107 for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \
108gammu/emb/gammu/$(MAKEFILE): 108 make -f Makefile$(PLATFORM) || exit 1; popd; \
109 @$(CHK_DIR_EXISTS) "gammu/emb/gammu" || $(MKDIR) "gammu/emb/gammu" 109 done
110 cd gammu/emb/gammu && $(QMAKE) gammu.pro -o $(MAKEFILE) 110 endif
111sub-gammu-emb-gammu: gammu/emb/gammu/$(MAKEFILE) FORCE 111
112 cd gammu/emb/gammu && $(MAKE) -f $(MAKEFILE) 112build_ldap_plugin: build_microkde
113 113 ifdef BUILD_NO_LDAP_PLUGIN
114libetpan/$(MAKEFILE): 114 @echo == ldap plugin not build.
115 @$(CHK_DIR_EXISTS) "libetpan" || $(MKDIR) "libetpan" 115 else
116 cd libetpan && $(QMAKE) libetpan.pro -o $(MAKEFILE) 116 for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \
117sub-libetpan: libetpan/$(MAKEFILE) FORCE 117 make -f Makefile$(PLATFORM) || exit 1; popd; \
118 cd libetpan && $(MAKE) -f $(MAKEFILE) 118 done
119 119 endif
120kmicromail/libmailwrapper/$(MAKEFILE): 120
121 @$(CHK_DIR_EXISTS) "kmicromail/libmailwrapper" || $(MKDIR) "kmicromail/libmailwrapper" 121
122 cd kmicromail/libmailwrapper && $(QMAKE) libmailwrapper.pro -o $(MAKEFILE) 122build_micromail: build_microkde
123sub-kmicromail-libmailwrapper: kmicromail/libmailwrapper/$(MAKEFILE) FORCE 123 ifdef BUILD_NO_MICROMAIL
124 cd kmicromail/libmailwrapper && $(MAKE) -f $(MAKEFILE) 124 @echo == kmicromail not build.
125 125 else
126kmicromail/$(MAKEFILE): 126 for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \
127 @$(CHK_DIR_EXISTS) "kmicromail" || $(MKDIR) "kmicromail" 127 make -f Makefile$(PLATFORM) || exit 1; popd; \
128 cd kmicromail && $(QMAKE) kmicromail.pro -o $(MAKEFILE) 128 done
129sub-kmicromail: kmicromail/$(MAKEFILE) FORCE 129 endif
130 cd kmicromail && $(MAKE) -f $(MAKEFILE) 130
131 131build_gammu: variable_test tmake
132pwmanager/libcrypt/cipher/$(MAKEFILE): 132 ifdef BUILD_NO_GAMMU
133 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/cipher" || $(MKDIR) "pwmanager/libcrypt/cipher" 133 @echo == gammu not build.
134 cd pwmanager/libcrypt/cipher && $(QMAKE) cipher.pro -o $(MAKEFILE) 134 else
135sub-pwmanager-libcrypt-cipher: pwmanager/libcrypt/cipher/$(MAKEFILE) FORCE 135 for i in $(SUBDIRS_GAMMU); do pushd $$i; \
136 cd pwmanager/libcrypt/cipher && $(MAKE) -f $(MAKEFILE) 136 make -f Makefile$(PLATFORM) || exit 1; popd; \
137 137 done
138pwmanager/libcrypt/error/$(MAKEFILE): 138 endif
139 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/error" || $(MKDIR) "pwmanager/libcrypt/error" 139
140 cd pwmanager/libcrypt/error && $(QMAKE) error.pro -o $(MAKEFILE) 140build_pwmanager: build_microkde
141sub-pwmanager-libcrypt-error: pwmanager/libcrypt/error/$(MAKEFILE) FORCE 141 ifdef BUILD_NO_PWMANAGER
142 cd pwmanager/libcrypt/error && $(MAKE) -f $(MAKEFILE) 142 @echo == pwmanager not build.
143 143 else
144pwmanager/libcrypt/mpi/$(MAKEFILE): 144 for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \
145 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/mpi" || $(MKDIR) "pwmanager/libcrypt/mpi" 145 make -f Makefile$(PLATFORM) || exit 1; popd; \
146 cd pwmanager/libcrypt/mpi && $(QMAKE) mpi.pro -o $(MAKEFILE) 146 done
147sub-pwmanager-libcrypt-mpi: pwmanager/libcrypt/mpi/$(MAKEFILE) FORCE 147 endif
148 cd pwmanager/libcrypt/mpi && $(MAKE) -f $(MAKEFILE) 148
149 149
150pwmanager/libcrypt/zlib/$(MAKEFILE): 150variable_info:
151 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/zlib" || $(MKDIR) "pwmanager/libcrypt/zlib" 151 @echo --------------------------------------
152 cd pwmanager/libcrypt/zlib && $(QMAKE) zlib.pro -o $(MAKEFILE) 152 @echo KDEPIM buildsystem, variableinfo...
153sub-pwmanager-libcrypt-zlib: pwmanager/libcrypt/zlib/$(MAKEFILE) FORCE 153 @echo KDEPIMDIR=$(KDEPIMDIR)
154 cd pwmanager/libcrypt/zlib && $(MAKE) -f $(MAKEFILE) 154 @echo QTDIR=$(QTDIR)
155 155 @echo QPEDIR=$(QPEDIR)
156pwmanager/pwmanager/$(MAKEFILE): 156 @echo OPIEDIR=$(OPIEDIR)
157 @$(CHK_DIR_EXISTS) "pwmanager/pwmanager" || $(MKDIR) "pwmanager/pwmanager" 157 @echo PLATFORM=$(PLATFORM)
158 cd pwmanager/pwmanager && $(QMAKE) pwmanager.pro -o $(MAKEFILE) 158 @echo RELEASE_DEBUG=$(RELEASE_DEBUG)
159sub-pwmanager-pwmanager: pwmanager/pwmanager/$(MAKEFILE) FORCE 159 @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL)
160 cd pwmanager/pwmanager && $(MAKE) -f $(MAKEFILE) 160 @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN)
161 161 @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN)
162Makefile: kdepim-desktop.pro /usr/lib/qt3/mkspecs/default/qmake.conf 162 @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN)
163 $(QMAKE) -o Makefile kdepim-desktop.pro 163 @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN)
164qmake: qmake_all 164 ifndef BUILD_NO_SHARP_PLUGIN
165 @$(QMAKE) -o Makefile kdepim-desktop.pro 165 @echo SHARPDTMSDK=$(SHARPDTMSDK)
166 166 endif
167all: $(SUBTARGETS) 167 @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU)
168qmake_all: libical/$(MAKEFILE) libkcal/$(MAKEFILE) kabc/$(MAKEFILE) libkdepim/$(MAKEFILE) microkde/$(MAKEFILE) korganizer/$(MAKEFILE) kaddressbook/$(MAKEFILE) kabc/plugins/file/$(MAKEFILE) kabc/plugins/dir/$(MAKEFILE) kabc/plugins/qtopia/$(MAKEFILE) gammu/emb/common/$(MAKEFILE) gammu/emb/gammu/$(MAKEFILE) libetpan/$(MAKEFILE) kmicromail/libmailwrapper/$(MAKEFILE) kmicromail/$(MAKEFILE) pwmanager/libcrypt/cipher/$(MAKEFILE) pwmanager/libcrypt/error/$(MAKEFILE) pwmanager/libcrypt/mpi/$(MAKEFILE) pwmanager/libcrypt/zlib/$(MAKEFILE) pwmanager/pwmanager/$(MAKEFILE) 168 @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER)
169 ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 169 @echo --------------------------------------
170 ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 170
171 ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 171variable_test: variable_info
172 ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 172 @echo KDEPIM buildsystem, variablecheck...
173 ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 173 ifndef KDEPIMDIR
174 ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 174 @echo KDEPIMDIR is not defined.
175 ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 175 $(error KDEPIMDIR is not defined)
176 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 176 endif
177 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 177 ifndef PLATFORM
178 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 178 @echo PLATFORM is not defined.
179 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 179 $(error PLATFORM is not defined)
180 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 180 endif
181 ( [ -d libetpan ] && cd libetpan ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 181 ifdef BUILD_NO_LDAP_PLUGIN
182 ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 182 @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN)
183 ( [ -d kmicromail ] && cd kmicromail ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 183 endif
184 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 184 ifdef BUILD_NO_OPIE_PLUGIN
185 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 185 @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN)
186 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 186 endif
187 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 187 ifdef BUILD_NO_QTOPIA_PLUGIN
188 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true 188 @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN)
189clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE 189 endif
190 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true 190 ifdef BUILD_NO_MICROMAIL
191 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true 191 @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL)
192 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true 192 endif
193 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true 193 ifdef BUILD_NO_SHARP_PLUGIN
194 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true 194 @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN)
195 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true 195 else
196 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true 196 ifndef SHARPDTMSDK
197 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true 197 @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK)
198 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true 198 $(error SHARPDTMSDK is not defined)
199 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; ) || true 199 endif
200 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; ) || true 200 endif
201 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; ) || true 201 ifdef BUILD_NO_GAMMU
202 ( [ -d libetpan ] && cd libetpan ; $(MAKE) -f $(MAKEFILE) $@; ) || true 202 @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU)
203 ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; $(MAKE) -f $(MAKEFILE) $@; ) || true 203 endif
204 ( [ -d kmicromail ] && cd kmicromail ; $(MAKE) -f $(MAKEFILE) $@; ) || true 204 ifdef BUILD_NO_PWMANAGER
205 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; ) || true 205 @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER)
206 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; ) || true 206 endif
207 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; ) || true 207 @echo --------------------------------------
208 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; ) || true 208
209 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; ) || true 209
210uninstall_subdirs: qmake_all FORCE 210objects:
211 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 211 for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done
212 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 212 for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done
213 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 213 mkdir -p libical/lib/$(PLATFORM)
214 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 214 mkdir -p dest
215 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 215 mkdir -p dest$(LIBICAL_PATH)
216 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 216 mkdir -p pwmanager/libcrypt/$(PLATFORM)
217 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 217
218 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 218clean:
219 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 219 rm -rf libical/lib/$(PLATFORM)/*;
220 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 220 rm -rf pwmanager/libcrypt/$(PLATFORM)/*;
221 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 221 for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\
222 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 222 rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \
223 ( [ -d libetpan ] && cd libetpan ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 223 done
224 ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 224
225 ( [ -d kmicromail ] && cd kmicromail ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 225pac:
226 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 226 rm -f $(QPEDIR)/lib/libmicro*
227 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 227 rm -f $(QPEDIR)/plugins/applets/libkopi*
228 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 228 make
229 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 229 make install
230 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true 230 make dist
231install_subdirs: qmake_all FORCE 231install:
232 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true 232
233 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true 233 cd bin/kdepim; make install
234 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true 234 cp -r Pim $(QPEDIR)/apps
235 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true 235 cp db2file/db2file $(QPEDIR)/bin/db2file
236 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true 236 chmod ugo+x $(QPEDIR)/bin/db2file
237 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true 237 cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop
238 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true 238 cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop
239 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true 239 cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop
240 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true 240 cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop
241 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) install; ) || true 241
242 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true 242dist:
243 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) install; ) || true 243 @echo Dont forget to do "make install" before "make dist"
244 ( [ -d libetpan ] && cd libetpan ; $(MAKE) -f $(MAKEFILE) install; ) || true 244 rm -f *arm.ipk
245 ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; $(MAKE) -f $(MAKEFILE) install; ) || true 245 rm -f *ipk.zip
246 ( [ -d kmicromail ] && cd kmicromail ; $(MAKE) -f $(MAKEFILE) install; ) || true 246 rm -rf ../kdepimpi_$(KDEPIM_VERSION)/*
247 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) install; ) || true 247 rm -f *~
248 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) install; ) || true 248 cd ..;mkdir -p kdepimpi_$(KDEPIM_VERSION)
249 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) install; ) || true 249 cd ../kdepimpi_$(KDEPIM_VERSION);mkdir -p ipk
250 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) install; ) || true 250 cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim
251 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) install; ) || true 251 mkipks kmicrokdelibs.control
252distclean: qmake_all FORCE 252 mkipks korganizer.control
253 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 253 mkipks kaddressbook.control
254 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 254 ifndef BUILD_NO_MICROMAIL
255 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 255 mkipks kopiemail.control
256 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 256 endif
257 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 257 ifndef BUILD_NO_SHARP_PLUGIN
258 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 258 mkipks ksharpPIM-DTMaccess.control
259 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 259 endif
260 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 260 mkipks korganizer-alarm.control
261 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 261 ifndef BUILD_NO_GAMMU
262 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 262 mkipks kmobilephoneaccess.control
263 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 263 endif
264 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 264 ifndef BUILD_NO_PWMANAGER
265 ( [ -d libetpan ] && cd libetpan ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 265 mkipks pwmanager.control
266 ( [ -d kmicromail/libmailwrapper ] && cd kmicromail/libmailwrapper ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 266 endif
267 ( [ -d kmicromail ] && cd kmicromail ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 267 mkipks pimTABicon.control
268 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 268 zip kdepim_$(KDEPIM_VERSION)_for_SharpRom.ipk.zip *.ipk ReleaseNotes.txt
269 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 269 mv *.ipk ../kdepimpi_$(KDEPIM_VERSION)/ipk/
270 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 270 mv *for_SharpRom.ipk.zip ../kdepimpi_$(KDEPIM_VERSION)/
271 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 271 mv ../kdepimpi-$(KDEPIM_VERSION).tar.gz ../kdepimpi_$(KDEPIM_VERSION)/
272 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true 272
273 273tmake: objects \
274install: install_subdirs 274 qtcompat/Makefile$(PLATFORM) \
275 275 microkde/Makefile$(PLATFORM) \
276uninstall: uninstall_subdirs 276 libkcal/Makefile$(PLATFORM) \
277 277 libkdepim/Makefile$(PLATFORM) \
278FORCE: 278 korganizer/Makefile$(PLATFORM) \
279 kalarmd/Makefile$(PLATFORM) \
280 libical/src/libical/Makefile$(PLATFORM) \
281 libical/src/libicalss/Makefile$(PLATFORM) \
282 kabc/Makefile$(PLATFORM) \
283 kabc/formats/binary/Makefile$(PLATFORM) \
284 kabc/plugins/file/Makefile$(PLATFORM) \
285 kabc/plugins/dir/Makefile$(PLATFORM) \
286 kabc/plugins/ldap/Makefile$(PLATFORM) \
287 kabc/plugins/opie/Makefile$(PLATFORM) \
288 kabc/plugins/qtopia/Makefile$(PLATFORM) \
289 kabc/plugins/sharpdtm/Makefile$(PLATFORM) \
290 kaddressbook/Makefile$(PLATFORM) \
291 kmicromail/Makefile$(PLATFORM) \
292 libetpan/Makefile$(PLATFORM) \
293 kmicromail/libmailwrapper/Makefile$(PLATFORM) \
294 gammu/emb/common/Makefile$(PLATFORM) \
295 gammu/emb/gammu/Makefile$(PLATFORM) \
296 pwmanager/pwmanager/Makefile$(PLATFORM) \
297 pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \
298 pwmanager/libcrypt/error/Makefile$(PLATFORM) \
299 pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \
300 pwmanager/libcrypt/zlib/Makefile$(PLATFORM)
301
302qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro
303 cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM)
304
305microkde/Makefile$(PLATFORM): microkde/microkdeE.pro
306 cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM)
307
308libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro
309 cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM)
310
311
312libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro
313 cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM)
314
315kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro
316 cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM)
317
318korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro
319 cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM)
320
321libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro
322 cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM)
323
324libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro
325 cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM)
326
327kabc/Makefile$(PLATFORM): kabc/kabcE.pro
328 cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM)
329
330kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro
331 cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM)
332
333kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro
334 cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM)
335
336kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro
337 cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM)
338
339kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro
340 cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM)
341
342kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro
343 cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM)
344
345kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro
346 cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM)
347
348kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro
349 cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM)
350
351kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro
352 cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM)
353
354kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro
355 cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM)
356
357libetpan/Makefile$(PLATFORM): libetpan/libetpanE.pro
358 cd libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM)
359
360kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro
361 cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM)
362
363gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro
364 cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM)
365
366gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro
367 cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM)
368
369pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro
370 cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM)
371
372
373pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro
374 cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM)
375
376pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro
377 cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM)
378
379pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro
380 cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM)
381
382pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro
383 cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM)
384
279 385
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp
index 4ab7f02..0e6c2a3 100644
--- a/kabc/plugins/file/resourcefile.cpp
+++ b/kabc/plugins/file/resourcefile.cpp
@@ -1,330 +1,336 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library 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 GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#ifndef _WIN32_ 30#ifndef _WIN32_
31#include <unistd.h> 31#include <unistd.h>
32#endif 32#endif
33 33
34#include <qfile.h> 34#include <qfile.h>
35#include <qfileinfo.h> 35#include <qfileinfo.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qtimer.h> 37#include <qtimer.h>
38 38
39#include <kapplication.h> 39#include <kapplication.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <klocale.h> 42#include <klocale.h>
43//US #include <ksavefile.h> 43//US #include <ksavefile.h>
44#include <kstandarddirs.h> 44#include <kstandarddirs.h>
45#include <kmessagebox.h> 45#include <kmessagebox.h>
46 46
47#include "formatfactory.h" 47#include "formatfactory.h"
48 48
49#include "resource.h" 49#include "resource.h"
50#include "resourcefileconfig.h" 50#include "resourcefileconfig.h"
51#include "stdaddressbook.h" 51#include "stdaddressbook.h"
52#define NO_DIRWATCH 52#define NO_DIRWATCH
53#include "resourcefile.h" 53#include "resourcefile.h"
54 54
55//#define ALLOW_LOCKING 55//#define ALLOW_LOCKING
56 56
57 57
58using namespace KABC; 58using namespace KABC;
59 59
60extern "C" 60extern "C"
61#ifdef _WIN32_ 61#ifdef _WIN32_
62__declspec(dllexport) 62__declspec(dllexport)
63#else 63#else
64{ 64{
65#endif 65#endif
66 66
67//US void *init_kabc_file() 67//US void *init_kabc_file()
68 void *init_microkabc_file() 68 void *init_microkabc_file()
69 { 69 {
70 return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>(); 70 return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>();
71 } 71 }
72#ifndef _WIN32_ 72#ifndef _WIN32_
73} 73}
74#endif 74#endif
75 75
76ResourceFile::ResourceFile( const KConfig *config ) 76ResourceFile::ResourceFile( const KConfig *config )
77 : Resource( config ) , mFormat( 0 ) 77 : Resource( config ) , mFormat( 0 )
78{ 78{
79 QString fileName, formatName, default_fileName; 79 QString fileName, formatName, default_fileName;
80 80
81 default_fileName = StdAddressBook::fileName(); 81 default_fileName = StdAddressBook::fileName();
82 82
83 KConfig *cfg = (KConfig *)config; 83 KConfig *cfg = (KConfig *)config;
84 if ( cfg ) { 84 if ( cfg ) {
85 fileName = cfg->readEntry( "FileName", default_fileName ); 85 fileName = cfg->readEntry( "FileName", default_fileName );
86 formatName = cfg->readEntry( "FileFormat", "vcard" ); 86 formatName = cfg->readEntry( "FileFormat", "vcard" );
87 } else { 87 } else {
88 fileName = default_fileName; 88 fileName = default_fileName;
89 formatName = "vcard"; 89 formatName = "vcard";
90 } 90 }
91 91
92 init( fileName, formatName ); 92 init( fileName, formatName );
93} 93}
94 94
95ResourceFile::ResourceFile( const QString &fileName , 95ResourceFile::ResourceFile( const QString &fileName ,
96 const QString &formatName ) 96 const QString &formatName )
97 : Resource( 0 ) 97 : Resource( 0 )
98{ 98{
99// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); 99// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1());
100 100
101 101
102 102
103 init( fileName, formatName ); 103 init( fileName, formatName );
104} 104}
105 105
106void ResourceFile::init( const QString &fileName, const QString &formatName ) 106void ResourceFile::init( const QString &fileName, const QString &formatName )
107{ 107{
108 mFormatName = formatName; 108 mFormatName = formatName;
109 109
110 FormatFactory *factory = FormatFactory::self(); 110 FormatFactory *factory = FormatFactory::self();
111 mFormat = factory->format( mFormatName ); 111 mFormat = factory->format( mFormatName );
112 112
113 if ( !mFormat ) { 113 if ( !mFormat ) {
114 mFormatName = "vcard"; 114 mFormatName = "vcard";
115 mFormat = factory->format( mFormatName ); 115 mFormat = factory->format( mFormatName );
116 } 116 }
117 117
118#ifndef NO_DIRWATCH 118#ifndef NO_DIRWATCH
119 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 119 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
120 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 120 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
121 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 121 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
122#endif 122#endif
123 123
124 124
125 QString localKdeDir; 125 QString localKdeDir;
126 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 126 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
127 if ( ! localKdeDir.isEmpty() ) { 127 if ( ! localKdeDir.isEmpty() ) {
128 qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() ); 128 qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() );
129 129 QFileInfo fi ( fileName );
130 130 QString localname = localKdeDir + "/apps/kabc/" + fi.fileName ();
131 131 QFileInfo fi2 ( localname );
132 if ( ! fi2.exists() ) {
133 KMessageBox::error(0,i18n("Addressbook resource file not found:\n '%1'.\nIn LOCAL mode only resource files in\n'%2'\nare supported.\n(i.e. in the dir ./apps/kabc/ relative to the kapi(.exe) binary.)\n\nIf you are starting KA/Pi for the very first time\nyou will get this error message as well.\nIt will create the missing file automatically for you.").arg(localname).arg(localKdeDir+"/apps/kabc/") );
134 setFileName( localname );
135 return;
136
137 } else {
138 qDebug("Local resource file found. Changing filename to: %s",localname.latin1() );
139 setFileName( localname );
140 return;
141 }
132 142
133 } 143 }
134 qDebug("RESOURCE: %s ", fileName.latin1()); 144 setFileName( fileName );
135
136
137
138 setFileName( fileName );
139} 145}
140 146
141ResourceFile::~ResourceFile() 147ResourceFile::~ResourceFile()
142{ 148{
143 delete mFormat; 149 delete mFormat;
144 mFormat = 0; 150 mFormat = 0;
145} 151}
146 152
147void ResourceFile::writeConfig( KConfig *config ) 153void ResourceFile::writeConfig( KConfig *config )
148{ 154{
149 155
150 config->setGroup( "Resource_" + identifier() ); 156 config->setGroup( "Resource_" + identifier() );
151 Resource::writeConfig( config ); 157 Resource::writeConfig( config );
152 158
153 config->writeEntry( "FileName", fileName() ); 159 config->writeEntry( "FileName", fileName() );
154 config->writeEntry( "FileFormat", mFormatName ); 160 config->writeEntry( "FileFormat", mFormatName );
155 161
156// qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); 162// qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1());
157 163
158} 164}
159 165
160Ticket *ResourceFile::requestSaveTicket() 166Ticket *ResourceFile::requestSaveTicket()
161{ 167{
162 kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; 168 kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl;
163 169
164 if ( !addressBook() ) return 0; 170 if ( !addressBook() ) return 0;
165 171
166#ifdef ALLOW_LOCKING 172#ifdef ALLOW_LOCKING
167 if ( !lock( mFileName ) ) { 173 if ( !lock( mFileName ) ) {
168 qDebug("unablt to lock file "); 174 qDebug("unablt to lock file ");
169 return 0; 175 return 0;
170 } 176 }
171#endif 177#endif
172 return createTicket( this ); 178 return createTicket( this );
173} 179}
174 180
175 181
176bool ResourceFile::doOpen() 182bool ResourceFile::doOpen()
177{ 183{
178 QFile file( fileName() ); 184 QFile file( fileName() );
179 qDebug("ResourceFile::openfile %s ", fileName().latin1()); 185 qDebug("ResourceFile::openfile %s ", fileName().latin1());
180 186
181 if ( !file.exists() ) { 187 if ( !file.exists() ) {
182 // try to create the file 188 // try to create the file
183 bool ok = file.open( IO_WriteOnly ); 189 bool ok = file.open( IO_WriteOnly );
184 if ( ok ) 190 if ( ok )
185 file.close(); 191 file.close();
186 192
187 return ok; 193 return ok;
188 } else { 194 } else {
189 if ( !file.open( IO_ReadWrite ) ) 195 if ( !file.open( IO_ReadWrite ) )
190 return false; 196 return false;
191 197
192 if ( file.size() == 0 ) { 198 if ( file.size() == 0 ) {
193 file.close(); 199 file.close();
194 return true; 200 return true;
195 } 201 }
196 202
197 bool ok = mFormat->checkFormat( &file ); 203 bool ok = mFormat->checkFormat( &file );
198 file.close(); 204 file.close();
199 205
200 return ok; 206 return ok;
201 } 207 }
202} 208}
203 209
204void ResourceFile::doClose() 210void ResourceFile::doClose()
205{ 211{
206} 212}
207 213
208bool ResourceFile::load() 214bool ResourceFile::load()
209{ 215{
210 216
211 QFile file( fileName() ); 217 QFile file( fileName() );
212 if ( !file.open( IO_ReadOnly ) ) { 218 if ( !file.open( IO_ReadOnly ) ) {
213 addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) ); 219 addressBook()->error( i18n( "Unable to open file '%1'." ).arg( fileName() ) );
214 return false; 220 return false;
215 } 221 }
216 222
217// qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1()); 223// qDebug("ResourceFile::load format %s, %s", mFileName.latin1(), mFormatName.latin1());
218 224
219 return mFormat->loadAll( addressBook(), this, &file ); 225 return mFormat->loadAll( addressBook(), this, &file );
220} 226}
221 227
222bool ResourceFile::save( Ticket *ticket ) 228bool ResourceFile::save( Ticket *ticket )
223{ 229{
224// qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1()); 230// qDebug("ResourceFile::save format %s, %s", mFileName.latin1(), mFormatName.latin1());
225 231
226 232
227 // create backup file 233 // create backup file
228 QString extension = "_" + QString::number( QDate::currentDate().dayOfWeek() ); 234 QString extension = "_" + QString::number( QDate::currentDate().dayOfWeek() );
229 235
230/*US we use a simpler method to create a backupfile 236/*US we use a simpler method to create a backupfile
231 237
232 (void) KSaveFile::backupFile( mFileName, QString::null 238 (void) KSaveFile::backupFile( mFileName, QString::null
233 ,extension ); 239 ,extension );
234 240
235 KSaveFile saveFile( mFileName ); 241 KSaveFile saveFile( mFileName );
236 bool ok = false; 242 bool ok = false;
237 if ( saveFile.status() == 0 && saveFile.file() ) 243 if ( saveFile.status() == 0 && saveFile.file() )
238 { 244 {
239 mFormat->saveAll( addressBook(), this, saveFile.file() ); 245 mFormat->saveAll( addressBook(), this, saveFile.file() );
240 ok = saveFile.close(); 246 ok = saveFile.close();
241 } 247 }
242*/ 248*/
243 249
244//US ToDo: write backupfile 250//US ToDo: write backupfile
245#ifndef NO_DIRWATCH 251#ifndef NO_DIRWATCH
246 mDirWatch.stopScan(); 252 mDirWatch.stopScan();
247#endif 253#endif
248 QFile info; 254 QFile info;
249 info.setName( fileName() ); 255 info.setName( fileName() );
250 bool ok = info.open( IO_WriteOnly ); 256 bool ok = info.open( IO_WriteOnly );
251 if ( ok ) { 257 if ( ok ) {
252 mFormat->saveAll( addressBook(), this, &info ); 258 mFormat->saveAll( addressBook(), this, &info );
253 259
254 info.close(); 260 info.close();
255 ok = true; 261 ok = true;
256 } 262 }
257 else { 263 else {
258 264
259 } 265 }
260 266
261 if ( !ok ) 267 if ( !ok )
262 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( fileName() ) ); 268 addressBook()->error( i18n( "Unable to save file '%1'." ).arg( fileName() ) );
263#ifndef NO_DIRWATCH 269#ifndef NO_DIRWATCH
264 mDirWatch.startScan(); 270 mDirWatch.startScan();
265#endif 271#endif
266 delete ticket; 272 delete ticket;
267#ifdef ALLOW_LOCKING 273#ifdef ALLOW_LOCKING
268 unlock( mFileName ); 274 unlock( mFileName );
269#endif 275#endif
270 276
271 return ok; 277 return ok;
272} 278}
273 279
274bool ResourceFile::lock( const QString &fileName ) 280bool ResourceFile::lock( const QString &fileName )
275{ 281{
276#ifdef ALLOW_LOCKING 282#ifdef ALLOW_LOCKING
277 283
278 284
279 QString fn = fileName; 285 QString fn = fileName;
280 286
281//US change the implementation how the lockfilename is getting created 287//US change the implementation how the lockfilename is getting created
282//US fn.replace( QRegExp("/"), "_" ); 288//US fn.replace( QRegExp("/"), "_" );
283//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" ); 289//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" );
284 290
285 KURL url(fn); 291 KURL url(fn);
286 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" ); 292 QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
287 293
288 294
289 295
290 if (QFile::exists( lockName )) return false; 296 if (QFile::exists( lockName )) return false;
291 297
292 QString lockUniqueName; 298 QString lockUniqueName;
293 lockUniqueName = fn + KApplication::randomString( 8 ); 299 lockUniqueName = fn + KApplication::randomString( 8 );
294 300
295 url = lockUniqueName; 301 url = lockUniqueName;
296//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); 302//US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName );
297 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); 303 mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() );
298 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; 304 kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl;
299 305
300 // Create unique file 306 // Create unique file
301 QFile file( mLockUniqueName ); 307 QFile file( mLockUniqueName );
302 file.open( IO_WriteOnly ); 308 file.open( IO_WriteOnly );
303 file.close(); 309 file.close();
304 310
305 // Create lock file 311 // Create lock file
306 int result = 0; 312 int result = 0;
307#ifndef _WIN32_ 313#ifndef _WIN32_
308 result = ::link( QFile::encodeName( mLockUniqueName ), 314 result = ::link( QFile::encodeName( mLockUniqueName ),
309 QFile::encodeName( lockName ) ); 315 QFile::encodeName( lockName ) );
310#endif 316#endif
311 if ( result == 0 ) { 317 if ( result == 0 ) {
312 addressBook()->emitAddressBookLocked(); 318 addressBook()->emitAddressBookLocked();
313 return true; 319 return true;
314 } 320 }
315 321
316 // TODO: check stat 322 // TODO: check stat
317 323
318 return false; 324 return false;
319#else 325#else
320 return true; 326 return true;
321#endif 327#endif
322} 328}
323 329
324void ResourceFile::unlock( const QString &fileName ) 330void ResourceFile::unlock( const QString &fileName )
325{ 331{
326#ifdef ALLOW_LOCKING 332#ifdef ALLOW_LOCKING
327 QString fn = fileName; 333 QString fn = fileName;
328//US change the implementation how the lockfilename is getting created 334//US change the implementation how the lockfilename is getting created
329//US fn.replace( QRegExp( "/" ), "_" ); 335//US fn.replace( QRegExp( "/" ), "_" );
330//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" ); 336//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" );
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 27ba9e0..f6f62a4 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -16,416 +16,414 @@
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <kdebug.h> 26#include <kdebug.h>
27#include <klocale.h> 27#include <klocale.h>
28 28
29//#include "koglobals.h" 29//#include "koglobals.h"
30#include "navigatorbar.h" 30#include "navigatorbar.h"
31#include "kdatenavigator.h" 31#include "kdatenavigator.h"
32 32
33#include <kcalendarsystem.h> 33#include <kcalendarsystem.h>
34 34
35#include "datenavigatorcontainer.h" 35#include "datenavigatorcontainer.h"
36#include "koprefs.h" 36#include "koprefs.h"
37 37
38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, 38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
39 const char *name ) 39 const char *name )
40 : QWidget( parent, name ), mCalendar( 0 ), 40 : QWidget( parent, name ), mCalendar( 0 ),
41 mHorizontalCount( 1 ), mVerticalCount( 1 ) 41 mHorizontalCount( 1 ), mVerticalCount( 1 )
42{ 42{
43 mResizeEnabled = false; 43 mResizeEnabled = false;
44 mExtraViews.setAutoDelete( true ); 44 mExtraViews.setAutoDelete( true );
45 45
46 mNavigatorView = new KDateNavigator( this, name ); 46 mNavigatorView = new KDateNavigator( this, name );
47 mNavigatorView->hide(); 47 mNavigatorView->hide();
48 connectNavigatorView( mNavigatorView ); 48 connectNavigatorView( mNavigatorView );
49 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 49 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
50 mLastDisplayedDN = 0; 50 mLastDisplayedDN = 0;
51 mUpdateTimer; 51 mUpdateTimer;
52 mUpdateTimer = new QTimer( this ); 52 mUpdateTimer = new QTimer( this );
53 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); 53 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
54 mFirstSelectedDate = QDate::currentDate(); 54 mFirstSelectedDate = QDate::currentDate();
55 mSelectedDateCount = 1; 55 mSelectedDateCount = 1;
56} 56}
57 57
58DateNavigatorContainer::~DateNavigatorContainer() 58DateNavigatorContainer::~DateNavigatorContainer()
59{ 59{
60} 60}
61 61
62void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) 62void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v )
63{ 63{
64 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), 64 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ),
65 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 65 SIGNAL( datesSelected( const KCal::DateList & ) ) );
66#if 0 66#if 0
67 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), 67 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ),
68 SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); 68 SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) );
69 connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), 69 connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ),
70 SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); 70 SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) );
71#endif 71#endif
72 connect( v, SIGNAL( weekClicked( const QDate & ) ), 72 connect( v, SIGNAL( weekClicked( const QDate & ) ),
73 SIGNAL( weekClicked( const QDate & ) ) ); 73 SIGNAL( weekClicked( const QDate & ) ) );
74 connect( v, SIGNAL( showMonth( const QDate & ) ), 74 connect( v, SIGNAL( showMonth( const QDate & ) ),
75 SIGNAL( showMonth( const QDate & ) ) ); 75 SIGNAL( showMonth( const QDate & ) ) );
76 76
77 connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) ); 77 connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) );
78 connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) ); 78 connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) );
79 79
80 connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) ); 80 connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) );
81 connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) ); 81 connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) );
82 connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) ); 82 connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) );
83 connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) ); 83 connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) );
84 84
85 connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 85 connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
86} 86}
87void DateNavigatorContainer::slotgoNextYear() 87void DateNavigatorContainer::slotgoNextYear()
88{ 88{
89 jumpMonth( 12 ); 89 jumpMonth( 12 );
90 emit goNextYear(); 90 emit goNextYear();
91 91
92} 92}
93void DateNavigatorContainer::slotgoPrevYear() 93void DateNavigatorContainer::slotgoPrevYear()
94{ 94{
95 jumpMonth( -12 ); 95 jumpMonth( -12 );
96 emit goPrevYear(); 96 emit goPrevYear();
97 97
98} 98}
99void DateNavigatorContainer::slotgoPrevMonth() 99void DateNavigatorContainer::slotgoPrevMonth()
100{ 100{
101 jumpMonth( -1 ); 101 jumpMonth( -1 );
102 emit goPrevMonth(); 102 emit goPrevMonth();
103 103
104} 104}
105void DateNavigatorContainer::slotgoNextMonth() 105void DateNavigatorContainer::slotgoNextMonth()
106{ 106{
107 jumpMonth( 1 ); 107 jumpMonth( 1 );
108 emit goNextMonth(); 108 emit goNextMonth();
109} 109}
110void DateNavigatorContainer::jumpMonth( int month ) 110void DateNavigatorContainer::jumpMonth( int month )
111{ 111{
112 112
113 QDate baseDate = mNavigatorView->baseDate(); 113 QDate baseDate = mNavigatorView->baseDate();
114 computeMonthSelected( baseDate.month() + month, false ); 114 computeMonthSelected( baseDate.month() + month, false );
115} 115}
116void DateNavigatorContainer::slotMonthSelected( int month ) 116void DateNavigatorContainer::slotMonthSelected( int month )
117{ 117{
118 computeMonthSelected( month, true ); 118 computeMonthSelected( month, true );
119} 119}
120void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit ) 120void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit )
121{ 121{
122 //qDebug("slotMonthSelected %d ", month); 122 //qDebug("slotMonthSelected %d ", month);
123 QDate baseDate = mNavigatorView->baseDate(); 123 QDate baseDate = mNavigatorView->baseDate();
124 if ( baseDate.month() == month ) 124 if ( baseDate.month() == month )
125 return; 125 return;
126 //qDebug("month %d %d ",baseDate.month(),month); 126 //qDebug("month %d %d ",baseDate.month(),month);
127 QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); 127 QDate date = QDate ( baseDate.year(), baseDate.month() , 15 );
128 date = date.addDays( -(baseDate.month()-month ) *30 ); 128 date = date.addDays( -(baseDate.month()-month ) *30 );
129 QDate newBase = QDate ( date.year(), date.month() ,1 ); 129 QDate newBase = QDate ( date.year(), date.month() ,1 );
130 130
131 //qDebug("NEW BASE %s", newBase.toString().latin1()); 131 //qDebug("NEW BASE %s", newBase.toString().latin1());
132 mNavigatorView->setBaseDate( newBase ); 132 mNavigatorView->setBaseDate( newBase );
133 QDate last = lastAvailableDate(); 133 QDate last = lastAvailableDate();
134 QDate first = firstAvailableDate(); 134 QDate first = firstAvailableDate();
135 135
136 QDate selFirst = mFirstSelectedDate; 136 QDate selFirst = mFirstSelectedDate;
137 QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); 137 QDate selLast = selFirst.addDays( mSelectedDateCount-1 );
138 if ( selFirst >= first && selLast <= last ) { 138 if ( selFirst >= first && selLast <= last ) {
139 setBaseDates(); 139 setBaseDates();
140 if ( forceEmit ) 140 if ( forceEmit )
141 updateDayMatrixDates(); 141 updateDayMatrixDates();
142 } 142 }
143 else { 143 else {
144 setBaseDates(); 144 setBaseDates();
145 if ( forceEmit ) 145 if ( forceEmit )
146 updateDayMatrixDates(); 146 updateDayMatrixDates();
147 if ( forceEmit ) 147 if ( forceEmit )
148 emit monthSelected( month ); 148 emit monthSelected( month );
149 } 149 }
150} 150}
151void DateNavigatorContainer::setCalendar( Calendar *cal ) 151void DateNavigatorContainer::setCalendar( Calendar *cal )
152{ 152{
153 mCalendar = cal; 153 mCalendar = cal;
154 mNavigatorView->setCalendar( cal ); 154 mNavigatorView->setCalendar( cal );
155 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 155 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
156 KDateNavigator *n = mExtraViews.at( i ); 156 KDateNavigator *n = mExtraViews.at( i );
157 n->setCalendar( cal ); 157 n->setCalendar( cal );
158 } 158 }
159} 159}
160void DateNavigatorContainer::checkUpdateDayMatrixDates() 160void DateNavigatorContainer::checkUpdateDayMatrixDates()
161{ 161{
162 //qDebug("KODNC: wid %d hei %d ", width(), height()); 162 //qDebug("KODNC: wid %d hei %d ", width(), height());
163 mUpdateTimer->stop(); 163 mUpdateTimer->stop();
164 //return; 164 //return;
165 if ( width() < 3 || height() < 3 ) 165 if ( width() < 3 || height() < 3 )
166 return; 166 return;
167 static int lastWid = 0; 167 static int lastWid = 0;
168 static int lastHei = 0; 168 static int lastHei = 0;
169 if ( lastWid == width() && height() == lastHei ) { 169 if ( lastWid == width() && height() == lastHei ) {
170 qDebug("KODNC: No layout computing needed. "); 170 qDebug("KODNC: No layout computing needed. ");
171 } else { 171 } else {
172 lastWid = width(); 172 lastWid = width();
173 lastHei = height(); 173 lastHei = height();
174 174
175 QSize minSize = mNavigatorView->yourSizeHint(); 175 QSize minSize = mNavigatorView->yourSizeHint();
176 176
177 int verticalCount = size().height() / minSize.height(); 177 int verticalCount = size().height() / minSize.height();
178 int horizontalCount = size().width() / minSize.width(); 178 int horizontalCount = size().width() / minSize.width();
179 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); 179 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
180 //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); 180 //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount );
181 bool fontchange = false; 181 bool fontchange = false;
182 if ( horizontalCount == 1) 182 if ( horizontalCount == 1)
183 horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); 183 horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width();
184 QFont fo; 184 QFont fo;
185 if ( horizontalCount != mHorizontalCount || 185 if ( horizontalCount != mHorizontalCount ||
186 verticalCount != mVerticalCount ) { 186 verticalCount != mVerticalCount ) {
187 uint count = horizontalCount * verticalCount; 187 uint count = horizontalCount * verticalCount;
188 if ( count == 0 ) { 188 if ( count == 0 ) {
189 bool ok; 189 bool ok;
190 fo = mNavigatorView->yourFontHint( size() , &ok ); 190 fo = mNavigatorView->yourFontHint( size() , &ok );
191 //mNavigatorView->resize( size() ); 191 //mNavigatorView->resize( size() );
192 //if ( ! ok ) 192 //if ( ! ok )
193 // return; 193 // return;
194 int butt = 2; 194 int butt = 2;
195 horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); 195 horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width();
196 if ( horizontalCount <= 1 ) 196 if ( horizontalCount <= 1 )
197 minSize = mNavigatorView->sizeHintTwoButtons( 4 ); 197 minSize = mNavigatorView->sizeHintTwoButtons( 4 );
198 else 198 else
199 minSize = mNavigatorView->sizeHintTwoButtons(); 199 minSize = mNavigatorView->sizeHintTwoButtons();
200 verticalCount = size().height() / minSize.height(); 200 verticalCount = size().height() / minSize.height();
201 horizontalCount = size().width() / minSize.width(); 201 horizontalCount = size().width() / minSize.width();
202 if ( horizontalCount == 0 ) 202 if ( horizontalCount == 0 )
203 horizontalCount = 1; 203 horizontalCount = 1;
204 if ( verticalCount == 0 ) 204 if ( verticalCount == 0 )
205 verticalCount = 1; 205 verticalCount = 1;
206 fontchange = true; 206 fontchange = true;
207 count = horizontalCount * verticalCount; 207 count = horizontalCount * verticalCount;
208 } else { 208 }
209 if ( mNavigatorView->fontChanged() ) { 209
210 fontchange = true;
211 fo = KOPrefs::instance()->mDateNavigatorFont;
212 mNavigatorView->changeFont( fo );
213 mNavigatorView->unsetFontChanged();
214 }
215 }
216
217 mLastDisplayedDN = horizontalCount*verticalCount-1; 210 mLastDisplayedDN = horizontalCount*verticalCount-1;
218 while ( count > ( mExtraViews.count() + 1 ) ) { 211 while ( count > ( mExtraViews.count() + 1 ) ) {
219 KDateNavigator *n = new KDateNavigator( this ); 212 KDateNavigator *n = new KDateNavigator( this );
220 n->setMonthSignalOffset ( mExtraViews.count()+1 ); 213 n->setMonthSignalOffset ( mExtraViews.count()+1 );
221 mExtraViews.append( n ); 214 mExtraViews.append( n );
222 n->setCalendar( mCalendar ); 215 n->setCalendar( mCalendar );
223 connectNavigatorView( n ); 216 connectNavigatorView( n );
224 // n->show(); 217 // n->show();
225 } 218 }
226 219
227
228 setBaseDates(); 220 setBaseDates();
229 if ( fontchange ) {
230 //mNavigatorView->changeFont( fo );
231 uint i;
232 for( i = 0; i < mExtraViews.count(); ++i ) {
233 KDateNavigator *view = mExtraViews.at( i );
234 view->changeFont( fo );
235 }
236 }
237 mHorizontalCount = horizontalCount; 221 mHorizontalCount = horizontalCount;
238 mVerticalCount = verticalCount; 222 mVerticalCount = verticalCount;
239 223
240 } 224 }
241 225 if ( !fontchange ) {
226 if ( mNavigatorView->fontChanged() ) {
227 fontchange = true;
228 fo = KOPrefs::instance()->mDateNavigatorFont;
229 mNavigatorView->changeFont( fo );
230 mNavigatorView->unsetFontChanged();
231 }
232 }
233 if ( fontchange ) {
234 uint i;
235 for( i = 0; i < mLastDisplayedDN; ++i ) {
236 KDateNavigator *view = mExtraViews.at( i );
237 view->changeFont( fo );
238 }
239 }
242 int theight = height() / mVerticalCount; 240 int theight = height() / mVerticalCount;
243 int twidth = width() / mHorizontalCount; 241 int twidth = width() / mHorizontalCount;
244 242
245 NavigatorBar *bar = mNavigatorView->navigatorBar(); 243 NavigatorBar *bar = mNavigatorView->navigatorBar();
246 if ( mHorizontalCount > 1 ) bar->showButtons( true, false ); 244 if ( mHorizontalCount > 1 ) bar->showButtons( true, false );
247 else bar->showButtons( true, true ); 245 else bar->showButtons( true, true );
248 246
249 mNavigatorView->setGeometry(0, 247 mNavigatorView->setGeometry(0,
250 0, twidth, theight ); 248 0, twidth, theight );
251 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 249 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
252 int x = ( i + 1 ) % mHorizontalCount; 250 int x = ( i + 1 ) % mHorizontalCount;
253 int y = ( i + 1 ) / mHorizontalCount; 251 int y = ( i + 1 ) / mHorizontalCount;
254 252
255 KDateNavigator *view = mExtraViews.at( i ); 253 KDateNavigator *view = mExtraViews.at( i );
256 bar = view->navigatorBar(); 254 bar = view->navigatorBar();
257 if ( y > 0 ) bar->showButtons( false, false ); 255 if ( y > 0 ) bar->showButtons( false, false );
258 else { 256 else {
259 if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true ); 257 if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true );
260 else bar->showButtons( false, false ); 258 else bar->showButtons( false, false );
261 } 259 }
262 view->setGeometry( x * twidth, 260 view->setGeometry( x * twidth,
263 y * theight, twidth, theight ); 261 y * theight, twidth, theight );
264 } 262 }
265 int iii = 0; 263 int iii = 0;
266 int ccc = mHorizontalCount * mVerticalCount; 264 int ccc = mHorizontalCount * mVerticalCount;
267 mNavigatorView->show(); 265 mNavigatorView->show();
268 while ( iii < ( mExtraViews.count() ) ) { 266 while ( iii < ( mExtraViews.count() ) ) {
269 if ( iii < ccc-1 ) 267 if ( iii < ccc-1 )
270 mExtraViews.at( iii )->show(); 268 mExtraViews.at( iii )->show();
271 else 269 else
272 mExtraViews.at( iii )->hide(); 270 mExtraViews.at( iii )->hide();
273 ++iii; 271 ++iii;
274 } 272 }
275 } 273 }
276 274
277 QDate last = lastAvailableDate(); 275 QDate last = lastAvailableDate();
278 QDate first = firstAvailableDate(); 276 QDate first = firstAvailableDate();
279 277
280 QDate selFirst = mFirstSelectedDate; 278 QDate selFirst = mFirstSelectedDate;
281 QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); 279 QDate selLast = selFirst.addDays( mSelectedDateCount-1 );
282 if ( selFirst >= first && selLast <= last ) { 280 if ( selFirst >= first && selLast <= last ) {
283 updateDayMatrixDates(); 281 updateDayMatrixDates();
284 } 282 }
285 else { 283 else {
286 updateDayMatrixDates(); 284 updateDayMatrixDates();
287 emit monthSelected( mFirstSelectedDate.month() ); 285 emit monthSelected( mFirstSelectedDate.month() );
288 } 286 }
289} 287}
290void DateNavigatorContainer::updateDayMatrixDates() 288void DateNavigatorContainer::updateDayMatrixDates()
291{ 289{
292 QDate fDate = mFirstSelectedDate; 290 QDate fDate = mFirstSelectedDate;
293 QDate lDate = fDate.addDays( mSelectedDateCount - 1 ); 291 QDate lDate = fDate.addDays( mSelectedDateCount - 1 );
294 mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate ); 292 mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate );
295 mNavigatorView->dayMatrix()->repaint( false ); 293 mNavigatorView->dayMatrix()->repaint( false );
296 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 294 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
297 KDateNavigator *n = mExtraViews.at( i ); 295 KDateNavigator *n = mExtraViews.at( i );
298 if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) { 296 if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) {
299 n->dayMatrix()->repaint( false ); 297 n->dayMatrix()->repaint( false );
300 } 298 }
301 } 299 }
302} 300}
303 301
304void DateNavigatorContainer::updateDayMatrix() 302void DateNavigatorContainer::updateDayMatrix()
305{ 303{
306 mNavigatorView->updateDayMatrix(); 304 mNavigatorView->updateDayMatrix();
307 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 305 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
308 KDateNavigator *n = mExtraViews.at( i ); 306 KDateNavigator *n = mExtraViews.at( i );
309 n->updateDayMatrix(); 307 n->updateDayMatrix();
310 } 308 }
311} 309}
312 310
313void DateNavigatorContainer::updateToday() 311void DateNavigatorContainer::updateToday()
314{ 312{
315 qDebug("DateNavigatorContainer::updateToday() NOT IMPL "); 313 qDebug("DateNavigatorContainer::updateToday() NOT IMPL ");
316#if 0 314#if 0
317 mNavigatorView->updateToday(); 315 mNavigatorView->updateToday();
318 KDateNavigator *n; 316 KDateNavigator *n;
319 for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { 317 for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
320 n->updateToday(); 318 n->updateToday();
321 } 319 }
322#endif 320#endif
323} 321}
324 322
325void DateNavigatorContainer::updateView() 323void DateNavigatorContainer::updateView()
326{ 324{
327 mNavigatorView->updateView(); 325 mNavigatorView->updateView();
328 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 326 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
329 KDateNavigator *n = mExtraViews.at( i ); 327 KDateNavigator *n = mExtraViews.at( i );
330 n->updateView(); 328 n->updateView();
331 } 329 }
332} 330}
333 331
334void DateNavigatorContainer::updateConfig() 332void DateNavigatorContainer::updateConfig()
335{ 333{
336 mNavigatorView->updateConfig(); 334 mNavigatorView->updateConfig();
337 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 335 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
338 KDateNavigator *n = mExtraViews.at( i ); 336 KDateNavigator *n = mExtraViews.at( i );
339 n->updateConfig(); 337 n->updateConfig();
340 } 338 }
341} 339}
342QDate DateNavigatorContainer::lastAvailableDate() const 340QDate DateNavigatorContainer::lastAvailableDate() const
343{ 341{
344 QDate date = mNavigatorView->baseDate(); 342 QDate date = mNavigatorView->baseDate();
345 QDate last = QDate ( date.year(), date.month(), date.daysInMonth() ); 343 QDate last = QDate ( date.year(), date.month(), date.daysInMonth() );
346 int iii = mLastDisplayedDN; 344 int iii = mLastDisplayedDN;
347 if ( mLastDisplayedDN ) 345 if ( mLastDisplayedDN )
348 last = last.addDays( 1); 346 last = last.addDays( 1);
349 while ( iii ) { 347 while ( iii ) {
350 last = last.addDays( last.daysInMonth ()); 348 last = last.addDays( last.daysInMonth ());
351 //qDebug("DATE %s ", last.toString().latin1() ); 349 //qDebug("DATE %s ", last.toString().latin1() );
352 --iii; 350 --iii;
353 } 351 }
354 if ( mLastDisplayedDN ) 352 if ( mLastDisplayedDN )
355 last = last.addDays( -1); 353 last = last.addDays( -1);
356 return last; 354 return last;
357} 355}
358QDate DateNavigatorContainer::firstAvailableDate() const 356QDate DateNavigatorContainer::firstAvailableDate() const
359{ 357{
360 return QDate ( mNavigatorView->baseDate().year(), mNavigatorView->baseDate().month(), 1 ); 358 return QDate ( mNavigatorView->baseDate().year(), mNavigatorView->baseDate().month(), 1 );
361} 359}
362void DateNavigatorContainer::selectDates( const DateList &dateList ) 360void DateNavigatorContainer::selectDates( const DateList &dateList )
363{ 361{
364 mFirstSelectedDate = dateList.first() ; 362 mFirstSelectedDate = dateList.first() ;
365 mSelectedDateCount = dateList.count() ; 363 mSelectedDateCount = dateList.count() ;
366 if ( !mLastDisplayedDN ) { 364 if ( !mLastDisplayedDN ) {
367 mNavigatorView->selectDates( dateList ); 365 mNavigatorView->selectDates( dateList );
368 return; 366 return;
369 } 367 }
370 QDate fDate = dateList.first(); 368 QDate fDate = dateList.first();
371 QDate lDate = dateList.last(); 369 QDate lDate = dateList.last();
372 //qDebug("%s %s ", lastAvailableDate().toString().latin1(), firstAvailableDate().toString().latin1() ); 370 //qDebug("%s %s ", lastAvailableDate().toString().latin1(), firstAvailableDate().toString().latin1() );
373 //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() ); 371 //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() );
374 if ( lDate <= lastAvailableDate() && firstAvailableDate() <= fDate) { 372 if ( lDate <= lastAvailableDate() && firstAvailableDate() <= fDate) {
375 updateDayMatrixDates(); 373 updateDayMatrixDates();
376 return; 374 return;
377 } 375 }
378 mNavigatorView->selectDates( dateList ); 376 mNavigatorView->selectDates( dateList );
379 setBaseDates(); 377 setBaseDates();
380 if ( mLastDisplayedDN ) { 378 if ( mLastDisplayedDN ) {
381 KDateNavigator *view = mExtraViews.at( 0 ); 379 KDateNavigator *view = mExtraViews.at( 0 );
382 view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); 380 view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end()));
383 view->dayMatrix()->repaint( false ); 381 view->dayMatrix()->repaint( false );
384 if ( mLastDisplayedDN > 1 ) { 382 if ( mLastDisplayedDN > 1 ) {
385 KDateNavigator *view = mExtraViews.at( 1 ); 383 KDateNavigator *view = mExtraViews.at( 1 );
386 view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); 384 view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end()));
387 view->dayMatrix()->repaint( false ); 385 view->dayMatrix()->repaint( false );
388 } 386 }
389 } 387 }
390} 388}
391 389
392void DateNavigatorContainer::setBaseDates() 390void DateNavigatorContainer::setBaseDates()
393{ 391{
394 QDate baseDate = mNavigatorView->baseDate(); 392 QDate baseDate = mNavigatorView->baseDate();
395 bool doRepaint = true; 393 bool doRepaint = true;
396 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 394 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
397 KDateNavigator *n = mExtraViews.at( i ); 395 KDateNavigator *n = mExtraViews.at( i );
398 baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 ); 396 baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 );
399 n->setBaseDate( baseDate, doRepaint ); 397 n->setBaseDate( baseDate, doRepaint );
400 } 398 }
401} 399}
402void DateNavigatorContainer::setResizeEnabled() 400void DateNavigatorContainer::setResizeEnabled()
403{ 401{
404 mResizeEnabled = true; 402 mResizeEnabled = true;
405 //qDebug("DateNavigatorContainer::setResizeEnabled "); 403 //qDebug("DateNavigatorContainer::setResizeEnabled ");
406 checkUpdateDayMatrixDates(); 404 checkUpdateDayMatrixDates();
407} 405}
408void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) 406void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
409{ 407{
410 408
411 //qDebug("DateNavigatorContainer::resizeEvent %d %d ", width(), height()); 409 //qDebug("DateNavigatorContainer::resizeEvent %d %d ", width(), height());
412 //qDebug("COUNT %d ", mExtraViews.count()); 410 //qDebug("COUNT %d ", mExtraViews.count());
413 if ( ! mResizeEnabled ) { 411 if ( ! mResizeEnabled ) {
414 //qDebug("NOT ResizeEnabled"); 412 //qDebug("NOT ResizeEnabled");
415 return; 413 return;
416 } 414 }
417 else 415 else
418 mUpdateTimer->start( 250 ); 416 mUpdateTimer->start( 250 );
419 417
420 //updateDayMatrixDates(); 418 //updateDayMatrixDates();
421} 419}
422 420
423QSize DateNavigatorContainer::minimumSizeHint() const 421QSize DateNavigatorContainer::minimumSizeHint() const
424{ 422{
425 return mNavigatorView->minimumSizeHint(); 423 return mNavigatorView->minimumSizeHint();
426} 424}
427 425
428QSize DateNavigatorContainer::sizeHint() const 426QSize DateNavigatorContainer::sizeHint() const
429{ 427{
430 return mNavigatorView->yourSizeHint(); 428 return mNavigatorView->yourSizeHint();
431} 429}
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 2fca49e..1d09f40 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -1,256 +1,255 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001,2002 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 <qstring.h> 24#include <qstring.h>
25#include <qkeycode.h> 25#include <qkeycode.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qtimer.h> 27#include <qtimer.h>
28#include <qframe.h> 28#include <qframe.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qapplication.h> 30#include <qapplication.h>
31 31
32#include <kdebug.h> 32#include <kdebug.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kglobal.h> 34#include <kglobal.h>
35 35
36#include "koglobals.h" 36#include "koglobals.h"
37#include "koprefs.h" 37#include "koprefs.h"
38#ifndef KORG_NOPLUGINS 38#ifndef KORG_NOPLUGINS
39#include "kocore.h" 39#include "kocore.h"
40#endif 40#endif
41 41
42#include <kcalendarsystem.h> 42#include <kcalendarsystem.h>
43 43
44#include "navigatorbar.h" 44#include "navigatorbar.h"
45 45
46#include "kdatenavigator.h" 46#include "kdatenavigator.h"
47 47
48KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) 48KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
49 : QFrame(parent, name), 49 : QFrame(parent, name),
50 updateTimer(0L) 50 updateTimer(0L)
51{ 51{
52 setFrameStyle(QFrame::NoFrame); 52 setFrameStyle(QFrame::NoFrame);
53 QDate startDate = QDate::currentDate(); 53 QDate startDate = QDate::currentDate();
54 QGridLayout *topLayout = new QGridLayout(this,8,8); 54 QGridLayout *topLayout = new QGridLayout(this,8,8);
55 55
56 if (! startDate.isValid()) { 56 if (! startDate.isValid()) {
57 qDebug("KDateNavigator::invalid startdate "); 57 qDebug("KDateNavigator::invalid startdate ");
58 startDate = QDate::currentDate(); 58 startDate = QDate::currentDate();
59 } 59 }
60 mMonthSignalOffset = 0; 60 mMonthSignalOffset = 0;
61 mSelectedDates.append(startDate); 61 mSelectedDates.append(startDate);
62 m_MthYr = startDate; 62 m_MthYr = startDate;
63 m_bShowWeekNums = true; 63 m_bShowWeekNums = true;
64
65 setFont( KOPrefs::instance()->mDateNavigatorFont ); 64 setFont( KOPrefs::instance()->mDateNavigatorFont );
66 mNavigatorBar = new NavigatorBar( startDate, this ); 65 mNavigatorBar = new NavigatorBar( startDate, this );
67 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 ); 66 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 );
68 //mNavigatorBar->resize( 1,1); 67 //mNavigatorBar->resize( 1,1);
69 connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); 68 connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) );
70 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); 69 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) );
71 connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); 70 connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) );
72 connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); 71 connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) );
73 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 72 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
74 73
75 // get the day of the week on the first day 74 // get the day of the week on the first day
76 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); 75 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);
77 m_fstDayOfWk = dayone.dayOfWeek(); 76 m_fstDayOfWk = dayone.dayOfWeek();
78 77
79 int i; 78 int i;
80 79
81 // Set up the heading fields. 80 // Set up the heading fields.
82 for( i = 0; i < 7; i++ ) { 81 for( i = 0; i < 7; i++ ) {
83 headings[i] = new QLabel("",this); 82 headings[i] = new QLabel("",this);
84 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); 83 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
85 headings[i]->setAlignment(AlignCenter); 84 headings[i]->setAlignment(AlignCenter);
86 headings[i]->installEventFilter(this); 85 headings[i]->installEventFilter(this);
87 86
88 topLayout->addWidget(headings[i],1,i+1); 87 topLayout->addWidget(headings[i],1,i+1);
89 } 88 }
90 89
91 // Create the weeknumber labels 90 // Create the weeknumber labels
92 for( i = 0; i < 6; i++ ) { 91 for( i = 0; i < 6; i++ ) {
93 weeknos[i] = new QLabel(this); 92 weeknos[i] = new QLabel(this);
94 weeknos[i]->setAlignment(AlignCenter); 93 weeknos[i]->setAlignment(AlignCenter);
95 //weeknos[i]->setFont(QFont("Arial", 10)); 94 //weeknos[i]->setFont(QFont("Arial", 10));
96 if(!m_bShowWeekNums) { 95 if(!m_bShowWeekNums) {
97 weeknos[i]->hide(); 96 weeknos[i]->hide();
98 } 97 }
99 weeknos[i]->installEventFilter(this); 98 weeknos[i]->installEventFilter(this);
100 99
101 topLayout->addWidget(weeknos[i],i+2,0); 100 topLayout->addWidget(weeknos[i],i+2,0);
102 } 101 }
103 102
104 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); 103 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
105 daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); 104 daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken);
106 daymatrix->setLineWidth(1); 105 daymatrix->setLineWidth(1);
107 106
108 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), 107 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
109 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 108 SIGNAL( datesSelected( const KCal::DateList & ) ) );
110 109
111 connect( daymatrix, SIGNAL( eventDropped( Event * ) ), 110 connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
112 SIGNAL( eventDropped( Event * ) ) ); 111 SIGNAL( eventDropped( Event * ) ) );
113 112
114 topLayout->addMultiCellWidget(daymatrix,2,7,1,7); 113 topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
115 114
116 // read settings from configuration file. 115 // read settings from configuration file.
117 updateConfig(); 116 updateConfig();
118 enableRollover(FollowMonth); 117 enableRollover(FollowMonth);
119 mySizeHint = sizeHintTwoButtons(); 118 mySizeHint = sizeHintTwoButtons();
120 myFullSizeHint = sizeHintTwoButtons( 4 ); 119 myFullSizeHint = sizeHintTwoButtons( 4 );
121 mFontChanged = false; 120 mFontChanged = false;
122 //resize ( 3,3 ); 121 //resize ( 3,3 );
123 122
124} 123}
125void KDateNavigator::changeFont ( QFont fo ) 124void KDateNavigator::changeFont ( QFont fo )
126{ 125{
127 setFont( fo ); 126 setFont( fo );
128 mNavigatorBar->resetFont( fo ); 127 mNavigatorBar->resetFont( fo );
129} 128}
130QFont KDateNavigator::yourFontHint( QSize si , bool *b) 129QFont KDateNavigator::yourFontHint( QSize si , bool *b)
131{ 130{
132 QFont fo = KOPrefs::instance()->mDateNavigatorFont; 131 QFont fo = KOPrefs::instance()->mDateNavigatorFont;
133 *b = false; 132 *b = false;
134 int fontPoint = fo.pointSize(); 133 int fontPoint = fo.pointSize();
135 while ( fontPoint > 5 ) { 134 while ( fontPoint > 5 ) {
136 --fontPoint; 135 --fontPoint;
137 fo.setPointSize( fontPoint ); 136 fo.setPointSize( fontPoint );
138 setFont( fo ); 137 setFont( fo );
139 mFontChanged = true; 138 mFontChanged = true;
140 mNavigatorBar->resetFont( fo ); 139 mNavigatorBar->resetFont( fo );
141 QSize sh = sizeHintTwoButtons( 2 ); 140 QSize sh = sizeHintTwoButtons( 2 );
142 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); 141 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() );
143 if ( si.width() > sh.width() && si.height() > sh.height()) { 142 if ( si.width() > sh.width() && si.height() > sh.height()) {
144 if ( si.width() / sh.width() == 1 ) { 143 if ( si.width() / sh.width() == 1 ) {
145 if ( si.width() < sizeHintTwoButtons( 4 ).width()) 144 if ( si.width() < sizeHintTwoButtons( 4 ).width())
146 continue; 145 continue;
147 } 146 }
148 *b = true; 147 *b = true;
149 //qDebug("fooooooooooooooooooooooouuuuund "); 148 //qDebug("fooooooooooooooooooooooouuuuund ");
150 break; 149 break;
151 } 150 }
152 } 151 }
153 //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() ); 152 //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() );
154 return fo; 153 return fo;
155} 154}
156QSize KDateNavigator::sizeHint() const 155QSize KDateNavigator::sizeHint() const
157{ 156{
158 QFontMetrics fm ( font() ); 157 QFontMetrics fm ( font() );
159 QSize day = daymatrix->sizeHint(); 158 QSize day = daymatrix->sizeHint();
160 QSize nav = mNavigatorBar->sizeHint(); 159 QSize nav = mNavigatorBar->sizeHint();
161 int wid = fm.width( "30") + day.width()+3; 160 int wid = fm.width( "30") + day.width()+3;
162 int hei = fm.height() +day.height()+nav.height()+2; 161 int hei = fm.height() +day.height()+nav.height()+2;
163 if ( wid < nav.width() ) 162 if ( wid < nav.width() )
164 wid = nav.width() ; 163 wid = nav.width() ;
165 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); 164 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
166 return QSize ( wid, hei ); 165 return QSize ( wid, hei );
167} 166}
168QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const 167QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const
169{ 168{
170 QFontMetrics fm ( font() ); 169 QFontMetrics fm ( font() );
171 QSize day = daymatrix->sizeHint(); 170 QSize day = daymatrix->sizeHint();
172 QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum ); 171 QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum );
173 int wid = fm.width( "30") + day.width()+3; 172 int wid = fm.width( "30") + day.width()+3;
174 int hei = fm.height() +day.height()+nav.height()+2; 173 int hei = fm.height() +day.height()+nav.height()+2;
175 if ( wid < nav.width() ) 174 if ( wid < nav.width() )
176 wid = nav.width() ; 175 wid = nav.width() ;
177 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); 176 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
178 return QSize ( wid, hei ); 177 return QSize ( wid, hei );
179} 178}
180void KDateNavigator::slotMonthSelected( int m ) 179void KDateNavigator::slotMonthSelected( int m )
181{ 180{
182 if ( m_MthYr.month() <= mMonthSignalOffset) 181 if ( m_MthYr.month() <= mMonthSignalOffset)
183 m += 12; 182 m += 12;
184 //qDebug("%d mMonthSignalOffset %d emit %d", m, mMonthSignalOffset, m - mMonthSignalOffset); 183 //qDebug("%d mMonthSignalOffset %d emit %d", m, mMonthSignalOffset, m - mMonthSignalOffset);
185 emit monthSelected( m - mMonthSignalOffset ); 184 emit monthSelected( m - mMonthSignalOffset );
186 185
187} 186}
188void KDateNavigator::setCalendar( Calendar *cal ) 187void KDateNavigator::setCalendar( Calendar *cal )
189{ 188{
190 daymatrix->setCalendar( cal ); 189 daymatrix->setCalendar( cal );
191} 190}
192 191
193void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true 192void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true
194{ 193{
195 m_MthYr = date; 194 m_MthYr = date;
196 //qDebug("KDateNavigator::setBaseDate %s ", date.toString().latin1()); 195 //qDebug("KDateNavigator::setBaseDate %s ", date.toString().latin1());
197 196
198 updateDates(); 197 updateDates();
199 updateView(); 198 updateView();
200 199
201 KCal::DateList dates; 200 KCal::DateList dates;
202 dates.append( date ); 201 dates.append( date );
203 mNavigatorBar->selectDates( dates ); 202 mNavigatorBar->selectDates( dates );
204 203
205 daymatrix->clearSelection(); 204 daymatrix->clearSelection();
206 if ( doRepaint ) 205 if ( doRepaint )
207 daymatrix->repaint( false ); 206 daymatrix->repaint( false );
208} 207}
209 208
210void KDateNavigator::enableRollover(RolloverType r) 209void KDateNavigator::enableRollover(RolloverType r)
211{ 210{
212 switch(r) 211 switch(r)
213 { 212 {
214 case None : 213 case None :
215 if (updateTimer) 214 if (updateTimer)
216 { 215 {
217 updateTimer->stop(); 216 updateTimer->stop();
218 delete updateTimer; 217 delete updateTimer;
219 updateTimer=0L; 218 updateTimer=0L;
220 } 219 }
221 break; 220 break;
222 case FollowDay : 221 case FollowDay :
223 case FollowMonth : 222 case FollowMonth :
224 if (!updateTimer) 223 if (!updateTimer)
225 { 224 {
226 updateTimer = new QTimer(this); 225 updateTimer = new QTimer(this);
227 QObject::connect(updateTimer,SIGNAL(timeout()), 226 QObject::connect(updateTimer,SIGNAL(timeout()),
228 this,SLOT(possiblyPastMidnight())); 227 this,SLOT(possiblyPastMidnight()));
229 } 228 }
230 updateTimer->start(0,true); 229 updateTimer->start(0,true);
231 lastDayChecked = QDate::currentDate(); 230 lastDayChecked = QDate::currentDate();
232 } 231 }
233 updateRollover=r; 232 updateRollover=r;
234} 233}
235 234
236 235
237KDateNavigator::~KDateNavigator() 236KDateNavigator::~KDateNavigator()
238{ 237{
239} 238}
240 239
241 240
242void KDateNavigator::passedMidnight() 241void KDateNavigator::passedMidnight()
243{ 242{
244 QDate today = QDate::currentDate(); 243 QDate today = QDate::currentDate();
245 bool emitMonth = false; 244 bool emitMonth = false;
246 245
247 if (today.month() != lastDayChecked.month()) 246 if (today.month() != lastDayChecked.month())
248 { 247 {
249 if (updateRollover==FollowMonth && 248 if (updateRollover==FollowMonth &&
250 daymatrix->isEndOfMonth()) { 249 daymatrix->isEndOfMonth()) {
251 goNextMonth(); 250 goNextMonth();
252 emitMonth=true; 251 emitMonth=true;
253 } 252 }
254 } 253 }
255 daymatrix->recalculateToday(); 254 daymatrix->recalculateToday();
256 daymatrix->repaint( false ); 255 daymatrix->repaint( false );
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 5cd845e..4fe1e66 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,329 +1,355 @@
1/* 1/*
2 This file is part of KdePim/Pi. 2 This file is part of KdePim/Pi.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
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/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qgroupbox.h> 34#include <qgroupbox.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qbuttongroup.h> 37#include <qbuttongroup.h>
38#include <qfile.h> 38#include <qfile.h>
39#include <qvbox.h> 39#include <qvbox.h>
40#include <qdir.h> 40#include <qdir.h>
41#include <qregexp.h> 41#include <qregexp.h>
42 42
43#include <kdialog.h> 43#include <kdialog.h>
44#include <kprefsdialog.h> 44#include <kprefsdialog.h>
45#include <klocale.h> 45#include <klocale.h>
46#include <kdateedit.h> 46#include <kdateedit.h>
47#include <kglobal.h> 47#include <kglobal.h>
48#include <stdlib.h> 48#include <stdlib.h>
49 49
50/*US 50/*US
51#include <qcheckbox.h> 51#include <qcheckbox.h>
52#include <qframe.h> 52#include <qframe.h>
53#include <qpushbutton.h> 53#include <qpushbutton.h>
54#include <qcombobox.h> 54#include <qcombobox.h>
55#include <qlineedit.h> 55#include <qlineedit.h>
56#include <qlabel.h> 56#include <qlabel.h>
57#include <qfile.h> 57#include <qfile.h>
58 58
59#include <kconfig.h> 59#include <kconfig.h>
60#include <kdebug.h> 60#include <kdebug.h>
61#include <kdialog.h> 61#include <kdialog.h>
62#include <klistview.h> 62#include <klistview.h>
63#include <klocale.h> 63#include <klocale.h>
64#include <kglobal.h> 64#include <kglobal.h>
65#include <kmessagebox.h> 65#include <kmessagebox.h>
66#include <kstandarddirs.h> 66#include <kstandarddirs.h>
67 67
68#ifndef KAB_EMBEDDED 68#ifndef KAB_EMBEDDED
69#include <ktrader.h> 69#include <ktrader.h>
70#else // KAB_EMBEDDED 70#else // KAB_EMBEDDED
71#include <mergewidget.h> 71#include <mergewidget.h>
72#include <distributionlistwidget.h> 72#include <distributionlistwidget.h>
73#endif // KAB_EMBEDDED 73#endif // KAB_EMBEDDED
74 74
75#include "addresseewidget.h" 75#include "addresseewidget.h"
76#include "extensionconfigdialog.h" 76#include "extensionconfigdialog.h"
77#include "extensionwidget.h" 77#include "extensionwidget.h"
78*/ 78*/
79 79
80#include "qapplication.h" 80#include "qapplication.h"
81 81
82#include "kpimglobalprefs.h" 82#include "kpimglobalprefs.h"
83 83
84#include "kdepimconfigwidget.h" 84#include "kdepimconfigwidget.h"
85#include <kprefs.h> 85#include <kprefs.h>
86#include <kmessagebox.h>
86 87
87 88
88KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 89KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
89 : KPrefsWidget(prefs, parent, name ) 90 : KPrefsWidget(prefs, parent, name )
90{ 91{
91 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 92 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
92 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 93 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
93 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 94 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
94 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 95 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
95 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 96 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
96 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 97 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
97 98
98 99
99 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 100 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
100 KDialog::spacingHint() ); 101 KDialog::spacingHint() );
101 102
102 tabWidget = new QTabWidget( this ); 103 tabWidget = new QTabWidget( this );
103 topLayout->addWidget( tabWidget ); 104 topLayout->addWidget( tabWidget );
104 105
105 106
106 setupLocaleTab(); 107 setupLocaleTab();
107 setupLocaleDateTab(); 108 setupLocaleDateTab();
108 setupTimeZoneTab(); 109 setupTimeZoneTab();
109 setupExternalAppTab(); 110 setupExternalAppTab();
110 setupStoreTab(); 111 setupStoreTab();
111 112
112} 113}
113void KDEPIMConfigWidget::showTimeZoneTab() 114void KDEPIMConfigWidget::showTimeZoneTab()
114{ 115{
115 tabWidget->setCurrentPage ( 3 ) ; 116 tabWidget->setCurrentPage ( 3 ) ;
116} 117}
117void KDEPIMConfigWidget::setupStoreTab() 118void KDEPIMConfigWidget::setupStoreTab()
118{ 119{
119 QVBox *storePage = new QVBox( this ); 120 QVBox *storePage = new QVBox( this );
120 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 121 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
121 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 122 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
122 mStoreUrl = new KURLRequester( storePage ); 123 mStoreUrl = new KURLRequester( storePage );
123 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 124 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
125#ifdef DESKTOP_VERSION
126 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
127 QFileInfo fi ( confFile );
128 if ( fi.exists() ) {
129 KConfig cfg ( confFile );
130 cfg.setGroup("Global");
131 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
132 if ( localKdeDir != "x_x_x" ) {
133 mStoreUrl->setURL( localKdeDir );
134 qDebug("Reading config from %s ", confFile.latin1());
135 }
136 }
137
138#endif
124 new QLabel( i18n("New dirs are created automatically"), storePage ); 139 new QLabel( i18n("New dirs are created automatically"), storePage );
125 QHBox *bb = new QHBox( storePage ); 140 QHBox *bb = new QHBox( storePage );
126 QPushButton * pb; 141 QPushButton * pb;
127 if ( QApplication::desktop()->width() < 640 ) 142 if ( QApplication::desktop()->width() < 640 )
128 pb = new QPushButton ( i18n("Save"), bb ); 143 pb = new QPushButton ( i18n("Save"), bb );
129 else 144 else
130 pb = new QPushButton ( i18n("Save settings"), bb ); 145 pb = new QPushButton ( i18n("Save settings"), bb );
131 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 146 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
132 pb = new QPushButton ( i18n("Save standard"), bb ); 147 pb = new QPushButton ( i18n("Save standard"), bb );
133 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 148 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
149#ifdef DESKTOP_VERSION
150 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
151 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
152#endif
134 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 153 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
135 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 154 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
136 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 155 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
137} 156}
157void KDEPIMConfigWidget::setLocalStore()
158{
159 mStoreUrl->setURL( "LOCAL:kdepimpi" );
160 saveStoreSettings();
161 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data.");
162 KMessageBox::information( this, message);
163}
138void KDEPIMConfigWidget::setStandardStore() 164void KDEPIMConfigWidget::setStandardStore()
139{ 165{
140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 166 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
141 saveStoreSettings(); 167 saveStoreSettings();
142} 168}
143void KDEPIMConfigWidget::saveStoreSettings() 169void KDEPIMConfigWidget::saveStoreSettings()
144{ 170{
145 if ( !mStoreUrl->url().isEmpty() ) { 171 if ( !mStoreUrl->url().isEmpty() ) {
146 QString path = QDir::homeDirPath(); 172 QString path = QDir::homeDirPath();
147 QString url = mStoreUrl->url(); 173 QString url = mStoreUrl->url();
148#ifdef DESKTOP_VERSION 174#ifdef DESKTOP_VERSION
149 if ( url.startsWith( "LOCAL:" ) ) { 175 if ( url.startsWith( "LOCAL:" ) ) {
150 path = qApp->applicationDirPath () ; 176 path = qApp->applicationDirPath () ;
151 } 177 }
152#endif 178#endif
153 KConfig cfg ( path + "/.microkdehome" ); 179 KConfig cfg ( path + "/.microkdehome" );
154 cfg.setGroup("Global"); 180 cfg.setGroup("Global");
155 cfg.writeEntry( "MICROKDEHOME", url ); 181 cfg.writeEntry( "MICROKDEHOME", url );
156 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); 182 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
157 cfg.sync(); 183 cfg.sync();
158 } else { 184 } else {
159 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 185 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
160 saveStoreSettings(); 186 saveStoreSettings();
161 } 187 }
162} 188}
163void KDEPIMConfigWidget::setupExternalAppTab() 189void KDEPIMConfigWidget::setupExternalAppTab()
164{ 190{
165 QWidget *externalAppsPage = new QWidget( this ); 191 QWidget *externalAppsPage = new QWidget( this );
166 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 192 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
167 KDialog::spacingHintSmall() ); 193 KDialog::spacingHintSmall() );
168 194
169 mExternalApps = new QComboBox( externalAppsPage ); 195 mExternalApps = new QComboBox( externalAppsPage );
170 196
171 QMap<ExternalAppHandler::Types, QString>::Iterator it; 197 QMap<ExternalAppHandler::Types, QString>::Iterator it;
172 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 198 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
173 mExternalApps->insertItem( it.data(), it.key() ); 199 mExternalApps->insertItem( it.data(), it.key() );
174 200
175 layout->addWidget( mExternalApps ); 201 layout->addWidget( mExternalApps );
176 202
177 connect( mExternalApps, SIGNAL( activated( int ) ), 203 connect( mExternalApps, SIGNAL( activated( int ) ),
178 this, SLOT (externalapp_changed( int ) ) ); 204 this, SLOT (externalapp_changed( int ) ) );
179 205
180 206
181 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 207 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
182 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 208 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
183 mExternalAppGroupBox->layout()->setMargin(5); 209 mExternalAppGroupBox->layout()->setMargin(5);
184 210
185 mClient = new QComboBox( mExternalAppGroupBox ); 211 mClient = new QComboBox( mExternalAppGroupBox );
186 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 212 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
187 213
188 connect( mClient, SIGNAL( activated( int ) ), 214 connect( mClient, SIGNAL( activated( int ) ),
189 this, SLOT (client_changed( int ) ) ); 215 this, SLOT (client_changed( int ) ) );
190 216
191 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 217 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
192 boxLayout->addWidget( lab, 1, 0 ); 218 boxLayout->addWidget( lab, 1, 0 );
193 mChannel = new QLineEdit(mExternalAppGroupBox); 219 mChannel = new QLineEdit(mExternalAppGroupBox);
194 mChannel->setReadOnly(true); 220 mChannel->setReadOnly(true);
195 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 221 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
196 222
197 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 223 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
198 boxLayout->addWidget( lab, 3, 0 ); 224 boxLayout->addWidget( lab, 3, 0 );
199 mMessage = new QLineEdit(mExternalAppGroupBox); 225 mMessage = new QLineEdit(mExternalAppGroupBox);
200 mMessage->setReadOnly(true); 226 mMessage->setReadOnly(true);
201 boxLayout->addWidget( mMessage , 4, 0); 227 boxLayout->addWidget( mMessage , 4, 0);
202 228
203 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 229 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
204 boxLayout->addWidget( lab, 3, 1 ); 230 boxLayout->addWidget( lab, 3, 1 );
205 mParameters = new QLineEdit(mExternalAppGroupBox); 231 mParameters = new QLineEdit(mExternalAppGroupBox);
206 mParameters->setReadOnly(true); 232 mParameters->setReadOnly(true);
207 boxLayout->addWidget( mParameters, 4, 1 ); 233 boxLayout->addWidget( mParameters, 4, 1 );
208 234
209 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 235 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
210 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 236 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
211 237
212 238
213 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 239 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
214 boxLayout->addWidget( lab, 6, 0 ); 240 boxLayout->addWidget( lab, 6, 0 );
215 mMessage2 = new QLineEdit(mExternalAppGroupBox); 241 mMessage2 = new QLineEdit(mExternalAppGroupBox);
216 mMessage2->setReadOnly(true); 242 mMessage2->setReadOnly(true);
217 boxLayout->addWidget( mMessage2 , 7, 0); 243 boxLayout->addWidget( mMessage2 , 7, 0);
218 244
219 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 245 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
220 boxLayout->addWidget( lab, 6, 1 ); 246 boxLayout->addWidget( lab, 6, 1 );
221 mParameters2 = new QLineEdit(mExternalAppGroupBox); 247 mParameters2 = new QLineEdit(mExternalAppGroupBox);
222 mParameters2->setReadOnly(true); 248 mParameters2->setReadOnly(true);
223 boxLayout->addWidget( mParameters2, 7, 1 ); 249 boxLayout->addWidget( mParameters2, 7, 1 );
224 250
225 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 251 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
226 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 252 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
227 253
228 254
229 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 255 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
230 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 256 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
231 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 257 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
232 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 258 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
233 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 259 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
234 260
235 261
236 layout->addWidget( mExternalAppGroupBox ); 262 layout->addWidget( mExternalAppGroupBox );
237 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 263 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
238 264
239} 265}
240 266
241 267
242void KDEPIMConfigWidget::setupLocaleDateTab() 268void KDEPIMConfigWidget::setupLocaleDateTab()
243{ 269{
244 QWidget *topFrame = new QWidget( this ); 270 QWidget *topFrame = new QWidget( this );
245 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 271 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
246 272
247 topLayout->setSpacing(KDialog::spacingHintSmall()); 273 topLayout->setSpacing(KDialog::spacingHintSmall());
248 topLayout->setMargin(KDialog::marginHintSmall()); 274 topLayout->setMargin(KDialog::marginHintSmall());
249 int iii = 0; 275 int iii = 0;
250 276
251 277
252 KPrefsWidRadios *syncPrefsGroup = 278 KPrefsWidRadios *syncPrefsGroup =
253 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 279 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
254 QString format; 280 QString format;
255 if ( QApplication::desktop()->width() < 480 ) 281 if ( QApplication::desktop()->width() < 480 )
256 format = "(%d.%m.%Y)"; 282 format = "(%d.%m.%Y)";
257 else 283 else
258 format = "(%d.%m.%Y|%A %d %B %Y)"; 284 format = "(%d.%m.%Y|%A %d %B %Y)";
259 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 285 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
260 if ( QApplication::desktop()->width() < 480 ) 286 if ( QApplication::desktop()->width() < 480 )
261 format = "(%m.%d.%Y)"; 287 format = "(%m.%d.%Y)";
262 else 288 else
263 format = "(%m.%d.%Y|%A %B %d %Y)"; 289 format = "(%m.%d.%Y|%A %B %d %Y)";
264 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 290 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
265 if ( QApplication::desktop()->width() < 480 ) 291 if ( QApplication::desktop()->width() < 480 )
266 format = "(%Y-%m-%d)"; 292 format = "(%Y-%m-%d)";
267 else 293 else
268 format = "(%Y-%m-%d|%A %Y %B %d)"; 294 format = "(%Y-%m-%d|%A %Y %B %d)";
269 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 295 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
270 syncPrefsGroup->addRadio(i18n("User defined")); 296 syncPrefsGroup->addRadio(i18n("User defined"));
271 if ( QApplication::desktop()->width() < 480 ) { 297 if ( QApplication::desktop()->width() < 480 ) {
272 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 298 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
273 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 299 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
274 } 300 }
275 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 301 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
276 ++iii; 302 ++iii;
277 ++iii; 303 ++iii;
278 QLabel * lab; 304 QLabel * lab;
279 mUserDateFormatLong = new QLineEdit(topFrame); 305 mUserDateFormatLong = new QLineEdit(topFrame);
280 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 306 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
281 topLayout->addWidget(lab ,iii,0); 307 topLayout->addWidget(lab ,iii,0);
282 topLayout->addWidget(mUserDateFormatLong,iii,1); 308 topLayout->addWidget(mUserDateFormatLong,iii,1);
283 ++iii; 309 ++iii;
284 mUserDateFormatShort = new QLineEdit(topFrame); 310 mUserDateFormatShort = new QLineEdit(topFrame);
285 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 311 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
286 topLayout->addWidget(lab ,iii,0); 312 topLayout->addWidget(lab ,iii,0);
287 topLayout->addWidget(mUserDateFormatShort,iii,1); 313 topLayout->addWidget(mUserDateFormatShort,iii,1);
288 ++iii; 314 ++iii;
289 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 315 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
290 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 316 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
291 ++iii; 317 ++iii;
292 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 318 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
293 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 319 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
294 ++iii; 320 ++iii;
295 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 321 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
296 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 322 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
297 ++iii; 323 ++iii;
298 324
299 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 325 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
300 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 326 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
301 327
302 328
303 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 329 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
304} 330}
305 331
306void KDEPIMConfigWidget::setupLocaleTab() 332void KDEPIMConfigWidget::setupLocaleTab()
307{ 333{
308 334
309 QWidget *topFrame = new QWidget( this ); 335 QWidget *topFrame = new QWidget( this );
310 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 336 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
311 337
312 topLayout->setSpacing(KDialog::spacingHint()); 338 topLayout->setSpacing(KDialog::spacingHint());
313 topLayout->setMargin(KDialog::marginHint()); 339 topLayout->setMargin(KDialog::marginHint());
314 int iii = 0; 340 int iii = 0;
315 KPrefsWidRadios *syncPrefsGroup = 341 KPrefsWidRadios *syncPrefsGroup =
316 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 342 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
317 syncPrefsGroup->addRadio(i18n("English")); 343 syncPrefsGroup->addRadio(i18n("English"));
318 syncPrefsGroup->addRadio(i18n("German")); 344 syncPrefsGroup->addRadio(i18n("German"));
319 syncPrefsGroup->addRadio(i18n("French")); 345 syncPrefsGroup->addRadio(i18n("French"));
320 syncPrefsGroup->addRadio(i18n("Italian")); 346 syncPrefsGroup->addRadio(i18n("Italian"));
321 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 347 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
322 if ( QApplication::desktop()->width() < 300 ) { 348 if ( QApplication::desktop()->width() < 300 ) {
323 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 349 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
324 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 350 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
325 } 351 }
326 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 352 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
327 ++iii; 353 ++iii;
328 354
329 355
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h
index c545207..984e4e0 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.h
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h
@@ -1,160 +1,161 @@
1/* 1/*
2 This file is part of KDEPim/Pi. 2 This file is part of KDEPim/Pi.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
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/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef KDEPIMCONFIGWIDGET_H 31#ifndef KDEPIMCONFIGWIDGET_H
32#define KDEPIMCONFIGWIDGET_H 32#define KDEPIMCONFIGWIDGET_H
33 33
34#include <kprefswidget.h> 34#include <kprefswidget.h>
35#include <kio/kfile/kurlrequester.h> 35#include <kio/kfile/kurlrequester.h>
36#include <qmap.h> 36#include <qmap.h>
37 37
38#include "externalapphandler.h" 38#include "externalapphandler.h"
39 39
40 40
41class QComboBox; 41class QComboBox;
42class QLineEdit; 42class QLineEdit;
43class KPimGlobalPrefs; 43class KPimGlobalPrefs;
44class QGroupBox; 44class QGroupBox;
45class QTabWidget; 45class QTabWidget;
46class KDateEdit; 46class KDateEdit;
47 47
48class KDEPIMConfigWidget : public KPrefsWidget 48class KDEPIMConfigWidget : public KPrefsWidget
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 51
52 public: 52 public:
53 KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 ); 53 KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 );
54 54
55 public slots: 55 public slots:
56 void textChanged( const QString& text ); 56 void textChanged( const QString& text );
57 void showTimeZoneTab(); 57 void showTimeZoneTab();
58 58
59 protected: 59 protected:
60 /** Implement this to read custom configuration widgets. */ 60 /** Implement this to read custom configuration widgets. */
61 virtual void usrReadConfig(); 61 virtual void usrReadConfig();
62 /** Implement this to write custom configuration widgets. */ 62 /** Implement this to write custom configuration widgets. */
63 virtual void usrWriteConfig(); 63 virtual void usrWriteConfig();
64 64
65 65
66 private slots: 66 private slots:
67// void configureExtension(); 67// void configureExtension();
68// void selectionChanged( QListViewItem* ); 68// void selectionChanged( QListViewItem* );
69// void itemClicked( QListViewItem* ); 69// void itemClicked( QListViewItem* );
70 void client_changed( int newClient ); 70 void client_changed( int newClient );
71 void externalapp_changed( int newApp ); 71 void externalapp_changed( int newApp );
72 void saveStoreSettings(); 72 void saveStoreSettings();
73 void setStandardStore(); 73 void setStandardStore();
74 void setLocalStore();
74 75
75 private: 76 private:
76 void setupExternalAppTab(); 77 void setupExternalAppTab();
77 void setupLocaleDateTab(); 78 void setupLocaleDateTab();
78 void setupLocaleTab(); 79 void setupLocaleTab();
79 void setupTimeZoneTab(); 80 void setupTimeZoneTab();
80 void setupStoreTab(); 81 void setupStoreTab();
81 KURLRequester* mStoreUrl; 82 KURLRequester* mStoreUrl;
82 83
83 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 84 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
84 85
85 86
86 void saveEditFieldSettings(); 87 void saveEditFieldSettings();
87 void updateClientWidgets(); 88 void updateClientWidgets();
88 89
89 QTabWidget *tabWidget; 90 QTabWidget *tabWidget;
90 91
91 92
92 QLineEdit* mUserDateFormatShort; 93 QLineEdit* mUserDateFormatShort;
93 QLineEdit* mUserDateFormatLong; 94 QLineEdit* mUserDateFormatLong;
94 QComboBox* mTimeZoneCombo; 95 QComboBox* mTimeZoneCombo;
95 KDateEdit* mStartDateSavingEdit; 96 KDateEdit* mStartDateSavingEdit;
96 KDateEdit* mEndDateSavingEdit; 97 KDateEdit* mEndDateSavingEdit;
97 98
98// void restoreExtensionSettings(); 99// void restoreExtensionSettings();
99// void saveExtensionSettings(); 100// void saveExtensionSettings();
100 101
101// KListView *mExtensionView; 102// KListView *mExtensionView;
102 103
103// QCheckBox *mNameParsing; 104// QCheckBox *mNameParsing;
104// QCheckBox *mViewsSingleClickBox; 105// QCheckBox *mViewsSingleClickBox;
105// QPushButton *mConfigureButton; 106// QPushButton *mConfigureButton;
106 QComboBox* mExternalApps; 107 QComboBox* mExternalApps;
107 QGroupBox* mExternalAppGroupBox; 108 QGroupBox* mExternalAppGroupBox;
108 109
109 110
110 QComboBox* mClient; 111 QComboBox* mClient;
111 QLineEdit* mChannel; 112 QLineEdit* mChannel;
112 QLineEdit* mMessage; 113 QLineEdit* mMessage;
113 QLineEdit* mParameters; 114 QLineEdit* mParameters;
114 QLineEdit* mMessage2; 115 QLineEdit* mMessage2;
115 QLineEdit* mParameters2; 116 QLineEdit* mParameters2;
116 117
117 ExternalAppHandler::Types mCurrentApp; 118 ExternalAppHandler::Types mCurrentApp;
118 int mCurrentClient; 119 int mCurrentClient;
119 120
120 121
121 int mEmailClient; 122 int mEmailClient;
122 QString mEmailOtherChannel; 123 QString mEmailOtherChannel;
123 QString mEmailOtherMessage; 124 QString mEmailOtherMessage;
124 QString mEmailOtherMessageParameters; 125 QString mEmailOtherMessageParameters;
125 QString mEmailOtherMessage2; 126 QString mEmailOtherMessage2;
126 QString mEmailOtherMessageParameters2; 127 QString mEmailOtherMessageParameters2;
127 128
128 int mPhoneClient; 129 int mPhoneClient;
129 QString mPhoneOtherChannel; 130 QString mPhoneOtherChannel;
130 QString mPhoneOtherMessage; 131 QString mPhoneOtherMessage;
131 QString mPhoneOtherMessageParameters; 132 QString mPhoneOtherMessageParameters;
132 133
133 int mFaxClient; 134 int mFaxClient;
134 QString mFaxOtherChannel; 135 QString mFaxOtherChannel;
135 QString mFaxOtherMessage; 136 QString mFaxOtherMessage;
136 QString mFaxOtherMessageParameters; 137 QString mFaxOtherMessageParameters;
137 138
138 int mSMSClient; 139 int mSMSClient;
139 QString mSMSOtherChannel; 140 QString mSMSOtherChannel;
140 QString mSMSOtherMessage; 141 QString mSMSOtherMessage;
141 QString mSMSOtherMessageParameters; 142 QString mSMSOtherMessageParameters;
142 143
143 int mPagerClient; 144 int mPagerClient;
144 QString mPagerOtherChannel; 145 QString mPagerOtherChannel;
145 QString mPagerOtherMessage; 146 QString mPagerOtherMessage;
146 QString mPagerOtherMessageParameters; 147 QString mPagerOtherMessageParameters;
147 148
148 int mSipClient; 149 int mSipClient;
149 QString mSipOtherChannel; 150 QString mSipOtherChannel;
150 QString mSipOtherMessage; 151 QString mSipOtherMessage;
151 QString mSipOtherMessageParameters; 152 QString mSipOtherMessageParameters;
152 153
153 154
154 155
155 QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; 156 QMap<ExternalAppHandler::Types, QString> mExternalAppsMap;
156 157
157// AddresseeWidget *mAddresseeWidget; 158// AddresseeWidget *mAddresseeWidget;
158}; 159};
159 160
160#endif 161#endif