author | zautrix <zautrix> | 2005-04-09 17:18:57 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-09 17:18:57 (UTC) |
commit | 2c39ac46121e8796e780a5321ab777f08792e5ba (patch) (unidiff) | |
tree | 65625ab02b77ef197411935808aa1ee6ff9341f8 | |
parent | d1982b1423417eb59c275bb09d4e3012a67ca086 (diff) | |
download | kdepimpi-2c39ac46121e8796e780a5321ab777f08792e5ba.zip kdepimpi-2c39ac46121e8796e780a5321ab777f08792e5ba.tar.gz kdepimpi-2c39ac46121e8796e780a5321ab777f08792e5ba.tar.bz2 |
nf
-rw-r--r-- | Makefile | 662 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 4 |
2 files changed, 386 insertions, 280 deletions
@@ -1,279 +1,385 @@ | |||
1 | ############################################################################# | 1 | export KDEPIMDIR = $(shell pwd) |
2 | # Makefile for building: kdepim-desktop | 2 | |
3 | # Generated by qmake (1.07a) (Qt 3.3.4) on: Sat Apr 9 15:21:46 2005 | 3 | export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) |
4 | # Project: kdepim-desktop.pro | 4 | |
5 | # Template: subdirs | 5 | ifeq ($(PLATFORM) , zaurus) |
6 | # Command: $(QMAKE) -o Makefile kdepim-desktop.pro | 6 | BUILD_NO_LDAP_PLUGIN=1 |
7 | ############################################################################# | 7 | endif |
8 | 8 | ||
9 | MAKEFILE =Makefile | 9 | ifneq ($(PLATFORM) , zaurus) |
10 | QMAKE =qmake | 10 | BUILD_NO_SHARP_PLUGIN=1 |
11 | DEL_FILE = rm -f | 11 | endif |
12 | CHK_DIR_EXISTS= test -d | 12 | |
13 | MKDIR = mkdir -p | 13 | #opie plugin is deprecated. The qtopia plugin handles the task from now on. |
14 | INSTALL_FILE= | 14 | BUILD_NO_OPIE_PLUGIN=1 |
15 | INSTALL_DIR = | 15 | |
16 | SUBTARGETS = \ | 16 | SUBDIRS_MICROKDE = \ |
17 | sub-kabc-plugins-file \ | 17 | libical/src/libical \ |
18 | sub-kabc-plugins-dir \ | 18 | libical/src/libicalss \ |
19 | sub-kabc-plugins-qtopia \ | 19 | qtcompat \ |
20 | sub-libical \ | 20 | microkde \ |
21 | sub-libkcal \ | 21 | libkcal \ |
22 | sub-kabc \ | 22 | libkdepim \ |
23 | sub-libkdepim \ | 23 | kabc \ |
24 | sub-microkde \ | 24 | kabc/formats/binary \ |
25 | sub-korganizer \ | 25 | kabc/plugins/file \ |
26 | sub-kaddressbook \ | 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 \ | 31 | SUBDIRS_QTOPIA_PLUGIN = \ |
32 | sub-pwmanager-libcrypt-cipher \ | 32 | kabc/plugins/qtopia |
33 | sub-pwmanager-libcrypt-error \ | 33 | |
34 | sub-pwmanager-libcrypt-mpi \ | 34 | SUBDIRS_OPIE_PLUGIN = \ |
35 | sub-pwmanager-libcrypt-zlib \ | 35 | kabc/plugins/opie |
36 | sub-pwmanager-pwmanager | 36 | |
37 | 37 | SUBDIRS_SHARP_PLUGIN = \ | |
38 | first: all | 38 | kabc/plugins/sharpdtm |
39 | 39 | ||
40 | all: Makefile $(SUBTARGETS) | 40 | SUBDIRS_LDAP_PLUGIN = \ |
41 | 41 | kabc/plugins/ldap | |
42 | kabc/plugins/file/$(MAKEFILE): | 42 | |
43 | @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file" | 43 | SUBDIRS_MICROMAIL = \ |
44 | cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE) | 44 | libetpan \ |
45 | sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE | 45 | kmicromail/libmailwrapper \ |
46 | cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE) | 46 | kmicromail |
47 | 47 | ||
48 | kabc/plugins/dir/$(MAKEFILE): | 48 | SUBDIRS_GAMMU = \ |
49 | @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir" | 49 | gammu/emb/common \ |
50 | cd kabc/plugins/dir && $(QMAKE) dir.pro -o $(MAKEFILE) | 50 | gammu/emb/gammu |
51 | sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE | 51 | |
52 | cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE) | 52 | SUBDIRS_PWMANAGER = \ |
53 | 53 | pwmanager/libcrypt/mpi \ | |
54 | kabc/plugins/qtopia/$(MAKEFILE): | 54 | pwmanager/libcrypt/error \ |
55 | @$(CHK_DIR_EXISTS) "kabc/plugins/qtopia" || $(MKDIR) "kabc/plugins/qtopia" | 55 | pwmanager/libcrypt/cipher \ |
56 | cd kabc/plugins/qtopia && $(QMAKE) qtopia.pro -o $(MAKEFILE) | 56 | pwmanager/libcrypt/zlib \ |
57 | sub-kabc-plugins-qtopia: kabc/plugins/qtopia/$(MAKEFILE) FORCE | 57 | pwmanager/pwmanager |
58 | cd kabc/plugins/qtopia && $(MAKE) -f $(MAKEFILE) | 58 | |
59 | 59 | SUBDIRS = \ | |
60 | libical/$(MAKEFILE): | 60 | $(SUBDIRS_MICROKDE) \ |
61 | @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical" | 61 | $(SUBDIRS_QTOPIA_PLUGIN) \ |
62 | cd libical && $(QMAKE) libical.pro -o $(MAKEFILE) | 62 | $(SUBDIRS_OPIE_PLUGIN) \ |
63 | sub-libical: libical/$(MAKEFILE) FORCE | 63 | $(SUBDIRS_SHARP_PLUGIN) \ |
64 | cd libical && $(MAKE) -f $(MAKEFILE) | 64 | $(SUBDIRS_LDAP_PLUGIN) \ |
65 | 65 | $(SUBDIRS_MICROMAIL) \ | |
66 | libkcal/$(MAKEFILE): | 66 | $(SUBDIRS_GAMMU) \ |
67 | @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal" | 67 | $(SUBDIRS_PWMANAGER) |
68 | cd libkcal && $(QMAKE) libkcal.pro -o $(MAKEFILE) | 68 | |
69 | sub-libkcal: libkcal/$(MAKEFILE) FORCE | 69 | |
70 | cd libkcal && $(MAKE) -f $(MAKEFILE) | 70 | all: build_microkde \ |
71 | 71 | build_qtopia_plugin \ | |
72 | kabc/$(MAKEFILE): | 72 | build_opie_plugin \ |
73 | @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc" | 73 | build_sharp_plugin \ |
74 | cd kabc && $(QMAKE) kabc.pro -o $(MAKEFILE) | 74 | build_ldap_plugin \ |
75 | sub-kabc: kabc/$(MAKEFILE) FORCE | 75 | build_micromail \ |
76 | cd kabc && $(MAKE) -f $(MAKEFILE) | 76 | build_gammu \ |
77 | 77 | build_pwmanager | |
78 | libkdepim/$(MAKEFILE): | 78 | |
79 | @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim" | 79 | |
80 | cd libkdepim && $(QMAKE) libkdepim.pro -o $(MAKEFILE) | 80 | build_microkde: variable_test tmake |
81 | sub-libkdepim: libkdepim/$(MAKEFILE) FORCE | 81 | for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ |
82 | cd libkdepim && $(MAKE) -f $(MAKEFILE) | 82 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
83 | 83 | done | |
84 | microkde/$(MAKEFILE): | 84 | |
85 | @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde" | 85 | build_qtopia_plugin: build_microkde |
86 | cd microkde && $(QMAKE) microkde.pro -o $(MAKEFILE) | 86 | ifdef BUILD_NO_QTOPIA_PLUGIN |
87 | sub-microkde: microkde/$(MAKEFILE) FORCE | 87 | @echo == qtopia plugin not build. |
88 | cd microkde && $(MAKE) -f $(MAKEFILE) | 88 | else |
89 | 89 | for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ | |
90 | korganizer/$(MAKEFILE): | 90 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
91 | @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer" | 91 | done |
92 | cd korganizer && $(QMAKE) korganizer.pro -o $(MAKEFILE) | 92 | endif |
93 | sub-korganizer: korganizer/$(MAKEFILE) FORCE | 93 | |
94 | cd korganizer && $(MAKE) -f $(MAKEFILE) | 94 | build_opie_plugin: build_microkde |
95 | 95 | ifdef BUILD_NO_OPIE_PLUGIN | |
96 | kaddressbook/$(MAKEFILE): | 96 | @echo == opie plugin not build. |
97 | @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook" | 97 | else |
98 | cd kaddressbook && $(QMAKE) kaddressbook.pro -o $(MAKEFILE) | 98 | for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ |
99 | sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE | 99 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
100 | cd kaddressbook && $(MAKE) -f $(MAKEFILE) | 100 | done |
101 | 101 | endif | |
102 | gammu/emb/common/$(MAKEFILE): | 102 | |
103 | @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common" | 103 | build_sharp_plugin: build_microkde |
104 | cd gammu/emb/common && $(QMAKE) common.pro -o $(MAKEFILE) | 104 | ifdef BUILD_NO_SHARP_PLUGIN |
105 | sub-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; \ | |
108 | gammu/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 |
111 | sub-gammu-emb-gammu: gammu/emb/gammu/$(MAKEFILE) FORCE | 111 | |
112 | cd gammu/emb/gammu && $(MAKE) -f $(MAKEFILE) | 112 | build_ldap_plugin: build_microkde |
113 | 113 | ifdef BUILD_NO_LDAP_PLUGIN | |
114 | libetpan/$(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; \ |
117 | sub-libetpan: libetpan/$(MAKEFILE) FORCE | 117 | make -f Makefile$(PLATFORM) || exit 1; popd; \ |
118 | cd libetpan && $(MAKE) -f $(MAKEFILE) | 118 | done |
119 | 119 | endif | |
120 | kmicromail/libmailwrapper/$(MAKEFILE): | 120 | |
121 | @$(CHK_DIR_EXISTS) "kmicromail/libmailwrapper" || $(MKDIR) "kmicromail/libmailwrapper" | 121 | |
122 | cd kmicromail/libmailwrapper && $(QMAKE) libmailwrapper.pro -o $(MAKEFILE) | 122 | build_micromail: build_microkde |
123 | sub-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 | |
126 | kmicromail/$(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 |
129 | sub-kmicromail: kmicromail/$(MAKEFILE) FORCE | 129 | endif |
130 | cd kmicromail && $(MAKE) -f $(MAKEFILE) | 130 | |
131 | 131 | build_gammu: variable_test tmake | |
132 | pwmanager/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 |
135 | sub-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 | |
138 | pwmanager/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) | 140 | build_pwmanager: build_microkde |
141 | sub-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 | |
144 | pwmanager/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 |
147 | sub-pwmanager-libcrypt-mpi: pwmanager/libcrypt/mpi/$(MAKEFILE) FORCE | 147 | endif |
148 | cd pwmanager/libcrypt/mpi && $(MAKE) -f $(MAKEFILE) | 148 | |
149 | 149 | ||
150 | pwmanager/libcrypt/zlib/$(MAKEFILE): | 150 | variable_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... |
153 | sub-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) | |
156 | pwmanager/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) |
159 | sub-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) | |
162 | Makefile: kdepim-desktop.pro /usr/lib/qt3/mkspecs/default/qmake.conf variables.pri | 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) |
164 | qmake: qmake_all | 164 | ifndef BUILD_NO_SHARP_PLUGIN |
165 | @$(QMAKE) -o Makefile kdepim-desktop.pro | 165 | @echo SHARPDTMSDK=$(SHARPDTMSDK) |
166 | 166 | endif | |
167 | all: $(SUBTARGETS) | 167 | @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) |
168 | qmake_all: kabc/plugins/file/$(MAKEFILE) kabc/plugins/dir/$(MAKEFILE) kabc/plugins/qtopia/$(MAKEFILE) libical/$(MAKEFILE) libkcal/$(MAKEFILE) kabc/$(MAKEFILE) libkdepim/$(MAKEFILE) microkde/$(MAKEFILE) korganizer/$(MAKEFILE) kaddressbook/$(MAKEFILE) gammu/emb/common/$(MAKEFILE) gammu/emb/gammu/$(MAKEFILE) libetpan/$(MAKEFILE) kmicromail/libmailwrapper/$(MAKEFILE) kmicromail/$(MAKEFILE) pwmanager/libcrypt/cipher/$(MAKEFILE) pwmanager/libcrypt/error/$(MAKEFILE) pwmanager/libcrypt/mpi/$(MAKEFILE) pwmanager/libcrypt/zlib/$(MAKEFILE) pwmanager/pwmanager/$(MAKEFILE) | 168 | @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) |
169 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 169 | @echo -------------------------------------- |
170 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 170 | |
171 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 171 | variable_test: variable_info |
172 | ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 172 | @echo KDEPIM buildsystem, variablecheck... |
173 | ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 173 | ifndef KDEPIMDIR |
174 | ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 174 | @echo KDEPIMDIR is not defined. |
175 | ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 175 | $(error KDEPIMDIR is not defined) |
176 | ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 176 | endif |
177 | ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true | 177 | ifndef PLATFORM |
178 | ( [ -d kaddressbook ] && cd kaddressbook ; 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) |
189 | clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE | 189 | endif |
190 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true | 190 | ifdef BUILD_NO_MICROMAIL |
191 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true | 191 | @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) |
192 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; ) || true | 192 | endif |
193 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true | 193 | ifdef BUILD_NO_SHARP_PLUGIN |
194 | ( [ -d libkcal ] && cd libkcal ; $(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 kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true | 195 | else |
196 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true | 196 | ifndef SHARPDTMSDK |
197 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true | 197 | @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) |
198 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true | 198 | $(error SHARPDTMSDK is not defined) |
199 | ( [ -d kaddressbook ] && cd kaddressbook ; $(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 | |
210 | uninstall_subdirs: qmake_all FORCE | 210 | objects: |
211 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 211 | for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done |
212 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 212 | for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done |
213 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 213 | mkdir -p libical/lib/$(PLATFORM) |
214 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 214 | mkdir -p dest |
215 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 215 | mkdir -p dest$(LIBICAL_PATH) |
216 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 216 | mkdir -p pwmanager/libcrypt/$(PLATFORM) |
217 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 217 | |
218 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 218 | clean: |
219 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true | 219 | rm -rf libical/lib/$(PLATFORM)/*; |
220 | ( [ -d kaddressbook ] && cd kaddressbook ; $(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 | 225 | pac: |
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 |
231 | install_subdirs: qmake_all FORCE | 231 | install: |
232 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true | 232 | |
233 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true | 233 | cd bin/kdepim; make install |
234 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) install; ) || true | 234 | cp -r Pim $(QPEDIR)/apps |
235 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true | 235 | cp db2file/db2file $(QPEDIR)/bin/db2file |
236 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true | 236 | chmod ugo+x $(QPEDIR)/bin/db2file |
237 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true | 237 | cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop |
238 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true | 238 | cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop |
239 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true | 239 | cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop |
240 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true | 240 | cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop |
241 | ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true | 241 | |
242 | ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true | 242 | dist: |
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 |
252 | distclean: qmake_all FORCE | 252 | mkipks korganizer.control |
253 | ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 253 | mkipks kaddressbook.control |
254 | ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 254 | ifndef BUILD_NO_MICROMAIL |
255 | ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 255 | mkipks kopiemail.control |
256 | ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 256 | endif |
257 | ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 257 | ifndef BUILD_NO_SHARP_PLUGIN |
258 | ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 258 | mkipks ksharpPIM-DTMaccess.control |
259 | ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 259 | endif |
260 | ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 260 | mkipks korganizer-alarm.control |
261 | ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true | 261 | ifndef BUILD_NO_GAMMU |
262 | ( [ -d kaddressbook ] && cd kaddressbook ; $(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 | 273 | tmake: objects \ | |
274 | install: install_subdirs | 274 | qtcompat/Makefile$(PLATFORM) \ |
275 | 275 | microkde/Makefile$(PLATFORM) \ | |
276 | uninstall: uninstall_subdirs | 276 | libkcal/Makefile$(PLATFORM) \ |
277 | 277 | libkdepim/Makefile$(PLATFORM) \ | |
278 | FORCE: | 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 | |||
302 | qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro | ||
303 | cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) | ||
304 | |||
305 | microkde/Makefile$(PLATFORM): microkde/microkdeE.pro | ||
306 | cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) | ||
307 | |||
308 | libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro | ||
309 | cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) | ||
310 | |||
311 | |||
312 | libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro | ||
313 | cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) | ||
314 | |||
315 | kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro | ||
316 | cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) | ||
317 | |||
318 | korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro | ||
319 | cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) | ||
320 | |||
321 | libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro | ||
322 | cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) | ||
323 | |||
324 | libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro | ||
325 | cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) | ||
326 | |||
327 | kabc/Makefile$(PLATFORM): kabc/kabcE.pro | ||
328 | cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) | ||
329 | |||
330 | kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro | ||
331 | cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) | ||
332 | |||
333 | kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro | ||
334 | cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) | ||
335 | |||
336 | kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro | ||
337 | cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) | ||
338 | |||
339 | kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro | ||
340 | cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) | ||
341 | |||
342 | kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro | ||
343 | cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) | ||
344 | |||
345 | kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro | ||
346 | cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) | ||
347 | |||
348 | kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro | ||
349 | cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) | ||
350 | |||
351 | kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro | ||
352 | cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) | ||
353 | |||
354 | kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro | ||
355 | cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) | ||
356 | |||
357 | libetpan/Makefile$(PLATFORM): libetpan/libetpanE.pro | ||
358 | cd libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) | ||
359 | |||
360 | kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro | ||
361 | cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) | ||
362 | |||
363 | gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro | ||
364 | cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) | ||
365 | |||
366 | gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro | ||
367 | cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) | ||
368 | |||
369 | pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro | ||
370 | cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) | ||
371 | |||
372 | |||
373 | pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro | ||
374 | cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM) | ||
375 | |||
376 | pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro | ||
377 | cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM) | ||
378 | |||
379 | pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro | ||
380 | cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM) | ||
381 | |||
382 | pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro | ||
383 | cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM) | ||
384 | |||
279 | 385 | ||
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index f53e5d5..17f791d 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -146,1514 +146,1514 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch) | |||
146 | sFont.setPointSize( sFont.pointSize()/2 ); | 146 | sFont.setPointSize( sFont.pointSize()/2 ); |
147 | QFontMetrics fmS( sFont ); | 147 | QFontMetrics fmS( sFont ); |
148 | int sHei = fmS.ascent() ; | 148 | int sHei = fmS.ascent() ; |
149 | //sHei -= (sHei/4-2); | 149 | //sHei -= (sHei/4-2); |
150 | int startW = mMiniWidth - frameWidth()-2 ; | 150 | int startW = mMiniWidth - frameWidth()-2 ; |
151 | int tw2 = fmS.width(suffix); | 151 | int tw2 = fmS.width(suffix); |
152 | timeHeight = (timeHeight-1) /2 -1; | 152 | timeHeight = (timeHeight-1) /2 -1; |
153 | //testline | 153 | //testline |
154 | //p->drawLine(0,0,0,contentsHeight()); | 154 | //p->drawLine(0,0,0,contentsHeight()); |
155 | while (y < cy + ch+mCellHeight) { | 155 | while (y < cy + ch+mCellHeight) { |
156 | p->drawLine(startW-tw2+1 ,y,cw+2,y); | 156 | p->drawLine(startW-tw2+1 ,y,cw+2,y); |
157 | hour.setNum(cell); | 157 | hour.setNum(cell); |
158 | // handle 24h and am/pm time formats | 158 | // handle 24h and am/pm time formats |
159 | if (KGlobal::locale()->use12Clock()) { | 159 | if (KGlobal::locale()->use12Clock()) { |
160 | if (cell == 12) suffix = "pm"; | 160 | if (cell == 12) suffix = "pm"; |
161 | if (cell == 0) hour.setNum(12); | 161 | if (cell == 0) hour.setNum(12); |
162 | if (cell > 12) hour.setNum(cell - 12); | 162 | if (cell > 12) hour.setNum(cell - 12); |
163 | } | 163 | } |
164 | 164 | ||
165 | // center and draw the time label | 165 | // center and draw the time label |
166 | int timeWidth = fm.width(hour); | 166 | int timeWidth = fm.width(hour); |
167 | int offset = startW - timeWidth - tw2 -1 ; | 167 | int offset = startW - timeWidth - tw2 -1 ; |
168 | p->setFont( nFont ); | 168 | p->setFont( nFont ); |
169 | p->drawText( offset, y+ timeHeight, hour); | 169 | p->drawText( offset, y+ timeHeight, hour); |
170 | p->setFont( sFont ); | 170 | p->setFont( sFont ); |
171 | offset = startW - tw2; | 171 | offset = startW - tw2; |
172 | p->drawText( offset, y -1, suffix); | 172 | p->drawText( offset, y -1, suffix); |
173 | 173 | ||
174 | // increment indices | 174 | // increment indices |
175 | y += mCellHeight; | 175 | y += mCellHeight; |
176 | cell++; | 176 | cell++; |
177 | } | 177 | } |
178 | 178 | ||
179 | 179 | ||
180 | 180 | ||
181 | 181 | ||
182 | } | 182 | } |
183 | 183 | ||
184 | /** | 184 | /** |
185 | Calculates the minimum width. | 185 | Calculates the minimum width. |
186 | */ | 186 | */ |
187 | int TimeLabels::minimumWidth() const | 187 | int TimeLabels::minimumWidth() const |
188 | { | 188 | { |
189 | return mMiniWidth; | 189 | return mMiniWidth; |
190 | } | 190 | } |
191 | 191 | ||
192 | /** updates widget's internal state */ | 192 | /** updates widget's internal state */ |
193 | void TimeLabels::updateConfig() | 193 | void TimeLabels::updateConfig() |
194 | { | 194 | { |
195 | mRedrawNeeded = true; | 195 | mRedrawNeeded = true; |
196 | // set the font | 196 | // set the font |
197 | // config->setGroup("Fonts"); | 197 | // config->setGroup("Fonts"); |
198 | // QFont font = config->readFontEntry("TimeBar Font"); | 198 | // QFont font = config->readFontEntry("TimeBar Font"); |
199 | setFont(KOPrefs::instance()->mTimeBarFont); | 199 | setFont(KOPrefs::instance()->mTimeBarFont); |
200 | QString test = "20"; | 200 | QString test = "20"; |
201 | if (KGlobal::locale()->use12Clock()) | 201 | if (KGlobal::locale()->use12Clock()) |
202 | test = "12"; | 202 | test = "12"; |
203 | mMiniWidth = fontMetrics().width(test); | 203 | mMiniWidth = fontMetrics().width(test); |
204 | if (KGlobal::locale()->use12Clock()) | 204 | if (KGlobal::locale()->use12Clock()) |
205 | test = "pm"; | 205 | test = "pm"; |
206 | else { | 206 | else { |
207 | test = "00"; | 207 | test = "00"; |
208 | } | 208 | } |
209 | QFont sFont = font(); | 209 | QFont sFont = font(); |
210 | sFont.setPointSize( sFont.pointSize()/2 ); | 210 | sFont.setPointSize( sFont.pointSize()/2 ); |
211 | QFontMetrics fmS( sFont ); | 211 | QFontMetrics fmS( sFont ); |
212 | mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; | 212 | mMiniWidth += fmS.width( test ) + frameWidth()*2+4 ; |
213 | // update geometry restrictions based on new settings | 213 | // update geometry restrictions based on new settings |
214 | setFixedWidth( mMiniWidth ); | 214 | setFixedWidth( mMiniWidth ); |
215 | 215 | ||
216 | // update HourSize | 216 | // update HourSize |
217 | mCellHeight = KOPrefs::instance()->mHourSize*4; | 217 | mCellHeight = KOPrefs::instance()->mHourSize*4; |
218 | resizeContents(mMiniWidth,mRows * mCellHeight+1); | 218 | resizeContents(mMiniWidth,mRows * mCellHeight+1); |
219 | } | 219 | } |
220 | 220 | ||
221 | /** update time label positions */ | 221 | /** update time label positions */ |
222 | void TimeLabels::positionChanged() | 222 | void TimeLabels::positionChanged() |
223 | { | 223 | { |
224 | int adjustment = mAgenda->contentsY(); | 224 | int adjustment = mAgenda->contentsY(); |
225 | setContentsPos(0, adjustment); | 225 | setContentsPos(0, adjustment); |
226 | } | 226 | } |
227 | 227 | ||
228 | /** */ | 228 | /** */ |
229 | void TimeLabels::setAgenda(KOAgenda* agenda) | 229 | void TimeLabels::setAgenda(KOAgenda* agenda) |
230 | { | 230 | { |
231 | mAgenda = agenda; | 231 | mAgenda = agenda; |
232 | } | 232 | } |
233 | 233 | ||
234 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) | 234 | void TimeLabels::contentsMousePressEvent ( QMouseEvent * e) |
235 | { | 235 | { |
236 | mMouseDownY = e->pos().y(); | 236 | mMouseDownY = e->pos().y(); |
237 | mOrgCap = topLevelWidget()->caption(); | 237 | mOrgCap = topLevelWidget()->caption(); |
238 | } | 238 | } |
239 | 239 | ||
240 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) | 240 | void TimeLabels::contentsMouseMoveEvent ( QMouseEvent * e ) |
241 | { | 241 | { |
242 | int diff = mMouseDownY - e->pos().y(); | 242 | int diff = mMouseDownY - e->pos().y(); |
243 | if ( diff < 10 && diff > -10 ) | 243 | if ( diff < 10 && diff > -10 ) |
244 | return; | 244 | return; |
245 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; | 245 | int tSize = KOPrefs::instance()->mHourSize + (diff/10) ; |
246 | if ( tSize < 4 ) | 246 | if ( tSize < 4 ) |
247 | tSize = 4; | 247 | tSize = 4; |
248 | if ( tSize > 22 ) | 248 | if ( tSize > 22 ) |
249 | tSize = 22; | 249 | tSize = 22; |
250 | tSize = (tSize-2)/2; | 250 | tSize = (tSize-2)/2; |
251 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); | 251 | topLevelWidget()->setCaption(i18n("New Agendasize: %1").arg(tSize)); |
252 | 252 | ||
253 | } | 253 | } |
254 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) | 254 | void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e ) |
255 | { | 255 | { |
256 | topLevelWidget()->setCaption( mOrgCap ); | 256 | topLevelWidget()->setCaption( mOrgCap ); |
257 | int diff = mMouseDownY - e->pos().y(); | 257 | int diff = mMouseDownY - e->pos().y(); |
258 | if ( diff < 10 && diff > -10 ) | 258 | if ( diff < 10 && diff > -10 ) |
259 | return; | 259 | return; |
260 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); | 260 | int tSize = KOPrefs::instance()->mHourSize + (diff/10); |
261 | if ( tSize < 4 ) | 261 | if ( tSize < 4 ) |
262 | tSize = 4; | 262 | tSize = 4; |
263 | if ( tSize > 22 ) | 263 | if ( tSize > 22 ) |
264 | tSize = 22; | 264 | tSize = 22; |
265 | tSize = (tSize/2)*2; | 265 | tSize = (tSize/2)*2; |
266 | if ( tSize == KOPrefs::instance()->mHourSize ) | 266 | if ( tSize == KOPrefs::instance()->mHourSize ) |
267 | return; | 267 | return; |
268 | KOPrefs::instance()->mHourSize = tSize; | 268 | KOPrefs::instance()->mHourSize = tSize; |
269 | emit scaleChanged(); | 269 | emit scaleChanged(); |
270 | } | 270 | } |
271 | 271 | ||
272 | /** This is called in response to repaint() */ | 272 | /** This is called in response to repaint() */ |
273 | void TimeLabels::paintEvent(QPaintEvent*) | 273 | void TimeLabels::paintEvent(QPaintEvent*) |
274 | { | 274 | { |
275 | 275 | ||
276 | // kdDebug() << "paintevent..." << endl; | 276 | // kdDebug() << "paintevent..." << endl; |
277 | // this is another hack! | 277 | // this is another hack! |
278 | // QPainter painter(this); | 278 | // QPainter painter(this); |
279 | //QString c | 279 | //QString c |
280 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); | 280 | repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); |
281 | } | 281 | } |
282 | 282 | ||
283 | //////////////////////////////////////////////////////////////////////////// | 283 | //////////////////////////////////////////////////////////////////////////// |
284 | 284 | ||
285 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) | 285 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) |
286 | : QFrame(parent,name) | 286 | : QFrame(parent,name) |
287 | { | 287 | { |
288 | mColumns = 1; | 288 | mColumns = 1; |
289 | mTopBox = 0; | 289 | mTopBox = 0; |
290 | mLocation = loc; | 290 | mLocation = loc; |
291 | mTopLayout = 0; | 291 | mTopLayout = 0; |
292 | mPaintWidget = 0; | 292 | mPaintWidget = 0; |
293 | mXOffset = 0; | 293 | mXOffset = 0; |
294 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); | 294 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); |
295 | else mPixmap = SmallIcon("1downarrow"); | 295 | else mPixmap = SmallIcon("1downarrow"); |
296 | mEnabled.resize(mColumns); | 296 | mEnabled.resize(mColumns); |
297 | mEnabled.fill( false ); | 297 | mEnabled.fill( false ); |
298 | setMinimumHeight(mPixmap.height()); | 298 | setMinimumHeight(mPixmap.height()); |
299 | } | 299 | } |
300 | 300 | ||
301 | EventIndicator::~EventIndicator() | 301 | EventIndicator::~EventIndicator() |
302 | { | 302 | { |
303 | } | 303 | } |
304 | 304 | ||
305 | void EventIndicator::drawContents(QPainter *p) | 305 | void EventIndicator::drawContents(QPainter *p) |
306 | { | 306 | { |
307 | 307 | ||
308 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; | 308 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; |
309 | KDGanttSplitterHandle* han = 0; | 309 | KDGanttSplitterHandle* han = 0; |
310 | if ( mPaintWidget ) | 310 | if ( mPaintWidget ) |
311 | han = mPaintWidget->firstHandle(); | 311 | han = mPaintWidget->firstHandle(); |
312 | if ( ! han ) { | 312 | if ( ! han ) { |
313 | int i; | 313 | int i; |
314 | for(i=0;i<mColumns;++i) { | 314 | for(i=0;i<mColumns;++i) { |
315 | if (mEnabled[i]) { | 315 | if (mEnabled[i]) { |
316 | int cellWidth = contentsRect().right()/mColumns; | 316 | int cellWidth = contentsRect().right()/mColumns; |
317 | int xOffset = KOGlobals::self()->reverseLayout() ? | 317 | int xOffset = KOGlobals::self()->reverseLayout() ? |
318 | (mColumns - 1 - i)*cellWidth + (cellWidth -mPixmap.width())/2 : | 318 | (mColumns - 1 - i)*cellWidth + (cellWidth -mPixmap.width())/2 : |
319 | i*cellWidth + (cellWidth -mPixmap.width()) /2; | 319 | i*cellWidth + (cellWidth -mPixmap.width()) /2; |
320 | p->drawPixmap(QPoint(1+xOffset,0),mPixmap); | 320 | p->drawPixmap(QPoint(1+xOffset,0),mPixmap); |
321 | } | 321 | } |
322 | } | 322 | } |
323 | } else { | 323 | } else { |
324 | han->repaint(); | 324 | han->repaint(); |
325 | //mPaintWidget->setBackgroundColor( red ); | 325 | //mPaintWidget->setBackgroundColor( red ); |
326 | 326 | ||
327 | QPainter pa( han ); | 327 | QPainter pa( han ); |
328 | int i; | 328 | int i; |
329 | bool setColor = false; | 329 | bool setColor = false; |
330 | for(i=0;i<mColumns;++i) { | 330 | for(i=0;i<mColumns;++i) { |
331 | if (mEnabled[i]) { | 331 | if (mEnabled[i]) { |
332 | setColor = true; | 332 | setColor = true; |
333 | 333 | ||
334 | int cellWidth = contentsRect().right()/mColumns; | 334 | int cellWidth = contentsRect().right()/mColumns; |
335 | int xOffset = KOGlobals::self()->reverseLayout() ? | 335 | int xOffset = KOGlobals::self()->reverseLayout() ? |
336 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : | 336 | (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : |
337 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; | 337 | i*cellWidth + cellWidth/2 -mPixmap.width()/2; |
338 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); | 338 | pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); |
339 | //qDebug("222draw pix %d ",xOffset ); | 339 | //qDebug("222draw pix %d ",xOffset ); |
340 | 340 | ||
341 | } | 341 | } |
342 | 342 | ||
343 | } | 343 | } |
344 | pa.end(); | 344 | pa.end(); |
345 | 345 | ||
346 | } | 346 | } |
347 | } | 347 | } |
348 | 348 | ||
349 | void EventIndicator::setXOffset( int x ) | 349 | void EventIndicator::setXOffset( int x ) |
350 | { | 350 | { |
351 | mXOffset = x; | 351 | mXOffset = x; |
352 | } | 352 | } |
353 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) | 353 | void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) |
354 | { | 354 | { |
355 | mPaintWidget = w; | 355 | mPaintWidget = w; |
356 | setMaximumHeight(0); | 356 | setMaximumHeight(0); |
357 | setMinimumHeight(0); | 357 | setMinimumHeight(0); |
358 | } | 358 | } |
359 | void EventIndicator::changeColumns(int columns) | 359 | void EventIndicator::changeColumns(int columns) |
360 | { | 360 | { |
361 | mColumns = columns; | 361 | mColumns = columns; |
362 | mEnabled.resize(mColumns); | 362 | mEnabled.resize(mColumns); |
363 | 363 | ||
364 | update(); | 364 | update(); |
365 | } | 365 | } |
366 | 366 | ||
367 | void EventIndicator::enableColumn(int column, bool enable) | 367 | void EventIndicator::enableColumn(int column, bool enable) |
368 | { | 368 | { |
369 | mEnabled[column] = enable; | 369 | mEnabled[column] = enable; |
370 | } | 370 | } |
371 | 371 | ||
372 | 372 | ||
373 | //////////////////////////////////////////////////////////////////////////// | 373 | //////////////////////////////////////////////////////////////////////////// |
374 | //////////////////////////////////////////////////////////////////////////// | 374 | //////////////////////////////////////////////////////////////////////////// |
375 | //////////////////////////////////////////////////////////////////////////// | 375 | //////////////////////////////////////////////////////////////////////////// |
376 | 376 | ||
377 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : | 377 | KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : |
378 | KOEventView (cal,parent,name) | 378 | KOEventView (cal,parent,name) |
379 | { | 379 | { |
380 | mBlockUpdating = true; | 380 | mBlockUpdating = true; |
381 | mStartHour = 8; | 381 | mStartHour = 8; |
382 | mSelectedDates.append(QDate::currentDate()); | 382 | mSelectedDates.append(QDate::currentDate()); |
383 | 383 | ||
384 | mLayoutDayLabels = 0; | 384 | mLayoutDayLabels = 0; |
385 | mDayLabelsFrame = 0; | 385 | mDayLabelsFrame = 0; |
386 | mDayLabels = 0; | 386 | mDayLabels = 0; |
387 | bool isRTL = KOGlobals::self()->reverseLayout(); | 387 | bool isRTL = KOGlobals::self()->reverseLayout(); |
388 | QPixmap expandPix; | 388 | QPixmap expandPix; |
389 | if ( KOPrefs::instance()->mVerticalScreen ) { | 389 | if ( KOPrefs::instance()->mVerticalScreen ) { |
390 | expandPix = SmallIcon( "1updownarrow" ); | 390 | expandPix = SmallIcon( "1updownarrow" ); |
391 | } else { | 391 | } else { |
392 | expandPix = SmallIcon("1leftrightarrow" ); | 392 | expandPix = SmallIcon("1leftrightarrow" ); |
393 | } | 393 | } |
394 | 394 | ||
395 | QBoxLayout *topLayout = new QVBoxLayout(this); | 395 | QBoxLayout *topLayout = new QVBoxLayout(this); |
396 | 396 | ||
397 | // Create day name labels for agenda columns | 397 | // Create day name labels for agenda columns |
398 | // Create agenda splitter | 398 | // Create agenda splitter |
399 | 399 | ||
400 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); | 400 | mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); |
401 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 401 | mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
402 | topLayout->addWidget( mSplitterAgenda ); | 402 | topLayout->addWidget( mSplitterAgenda ); |
403 | mAllDayFrame = new QHBox(mSplitterAgenda); | 403 | mAllDayFrame = new QHBox(mSplitterAgenda); |
404 | mAllDayFrame->setFocusPolicy(NoFocus); | 404 | mAllDayFrame->setFocusPolicy(NoFocus); |
405 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); | 405 | QWidget *agendaFrame = new QWidget(mSplitterAgenda); |
406 | agendaFrame->setFocusPolicy(NoFocus); | 406 | agendaFrame->setFocusPolicy(NoFocus); |
407 | 407 | ||
408 | // Create all-day agenda widget | 408 | // Create all-day agenda widget |
409 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); | 409 | mDummyAllDayLeft = new QVBox( mAllDayFrame ); |
410 | 410 | ||
411 | mExpandButton = new QPushButton(mDummyAllDayLeft); | 411 | mExpandButton = new QPushButton(mDummyAllDayLeft); |
412 | mExpandButton->setPixmap( expandPix ); | 412 | mExpandButton->setPixmap( expandPix ); |
413 | int widebut = mExpandButton->sizeHint().width()+4; | 413 | int widebut = mExpandButton->sizeHint().width()+4; |
414 | int heibut = mExpandButton->sizeHint().height()+4; | 414 | int heibut = mExpandButton->sizeHint().height()+4; |
415 | if ( heibut > widebut ) | 415 | if ( heibut > widebut ) |
416 | widebut = heibut ; | 416 | widebut = heibut ; |
417 | 417 | ||
418 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, | 418 | //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, |
419 | // QSizePolicy::Fixed ) ); | 419 | // QSizePolicy::Fixed ) ); |
420 | mExpandButton->setFixedSize( widebut, widebut); | 420 | mExpandButton->setFixedSize( widebut, widebut); |
421 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); | 421 | connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); |
422 | mExpandButton->setFocusPolicy(NoFocus); | 422 | mExpandButton->setFocusPolicy(NoFocus); |
423 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); | 423 | mAllDayAgenda = new KOAgenda(1,mAllDayFrame); |
424 | mAllDayAgenda->setFocusPolicy(NoFocus); | 424 | mAllDayAgenda->setFocusPolicy(NoFocus); |
425 | QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); | 425 | QLabel *dummyAllDayRight = new QLabel (mAllDayFrame); |
426 | 426 | ||
427 | // Create event context menu for all day agenda | 427 | // Create event context menu for all day agenda |
428 | //mAllDayAgendaPopup = eventPopup(); | 428 | //mAllDayAgendaPopup = eventPopup(); |
429 | 429 | ||
430 | // Create agenda frame | 430 | // Create agenda frame |
431 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); | 431 | QGridLayout *agendaLayout = new QGridLayout(agendaFrame,4,3); |
432 | // QHBox *agendaFrame = new QHBox(splitterAgenda); | 432 | // QHBox *agendaFrame = new QHBox(splitterAgenda); |
433 | 433 | ||
434 | // create event indicator bars | 434 | // create event indicator bars |
435 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); | 435 | mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); |
436 | #ifndef DESKTOP_VERSION | 436 | #ifndef DESKTOP_VERSION |
437 | // FIX | 437 | // FIX |
438 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); | 438 | mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); |
439 | #endif | 439 | #endif |
440 | mDayLabelsFrame = new QHBox(agendaFrame); | 440 | mDayLabelsFrame = new QHBox(agendaFrame); |
441 | //topLayout->addWidget(mDayLabelsFrame); | 441 | //topLayout->addWidget(mDayLabelsFrame); |
442 | mDayLabels = new QFrame (mDayLabelsFrame); | 442 | mDayLabels = new QFrame (mDayLabelsFrame); |
443 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); | 443 | mLayoutDayLabels = new QHBoxLayout(mDayLabels); |
444 | agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); | 444 | agendaLayout->addMultiCellWidget(mDayLabelsFrame ,0,0,0,2); |
445 | agendaLayout->addWidget(mEventIndicatorTop,1,1); | 445 | agendaLayout->addWidget(mEventIndicatorTop,1,1); |
446 | 446 | ||
447 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, | 447 | mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, |
448 | agendaFrame); | 448 | agendaFrame); |
449 | agendaLayout->addWidget(mEventIndicatorBottom,3,1); | 449 | agendaLayout->addWidget(mEventIndicatorBottom,3,1); |
450 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); | 450 | QWidget *dummyAgendaRight = new QWidget(agendaFrame); |
451 | agendaLayout->addWidget(dummyAgendaRight,1,2); | 451 | agendaLayout->addWidget(dummyAgendaRight,1,2); |
452 | 452 | ||
453 | // Create time labels | 453 | // Create time labels |
454 | mTimeLabels = new TimeLabels(24,agendaFrame); | 454 | mTimeLabels = new TimeLabels(24,agendaFrame); |
455 | agendaLayout->addWidget(mTimeLabels,2,0); | 455 | agendaLayout->addWidget(mTimeLabels,2,0); |
456 | connect(mTimeLabels,SIGNAL( scaleChanged()), | 456 | connect(mTimeLabels,SIGNAL( scaleChanged()), |
457 | this,SLOT(updateConfig())); | 457 | this,SLOT(updateConfig())); |
458 | 458 | ||
459 | // Create agenda | 459 | // Create agenda |
460 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); | 460 | mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); |
461 | agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); | 461 | agendaLayout->addMultiCellWidget(mAgenda,2,2,1,2); |
462 | agendaLayout->setColStretch(1,1); | 462 | agendaLayout->setColStretch(1,1); |
463 | mAgenda->setFocusPolicy(NoFocus); | 463 | mAgenda->setFocusPolicy(NoFocus); |
464 | // Create event context menu for agenda | 464 | // Create event context menu for agenda |
465 | mAllAgendaPopup = eventPopup(); | 465 | mAllAgendaPopup = eventPopup(); |
466 | 466 | ||
467 | #if 0 | 467 | #if 0 |
468 | mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), | 468 | mAllAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), |
469 | i18n("Toggle Alarm"),mAgenda, | 469 | i18n("Toggle Alarm"),mAgenda, |
470 | SLOT(popupAlarm()),true); | 470 | SLOT(popupAlarm()),true); |
471 | 471 | ||
472 | #endif | 472 | #endif |
473 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 473 | connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
474 | mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 474 | mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
475 | 475 | ||
476 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), | 476 | connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), |
477 | mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); | 477 | mAllAgendaPopup,SLOT(showIncidencePopup(Incidence *))); |
478 | mAgenda->setPopup( mAllAgendaPopup ); | 478 | mAgenda->setPopup( mAllAgendaPopup ); |
479 | mAllDayAgenda->setPopup( mAllAgendaPopup ); | 479 | mAllDayAgenda->setPopup( mAllAgendaPopup ); |
480 | // make connections between dependent widgets | 480 | // make connections between dependent widgets |
481 | mTimeLabels->setAgenda(mAgenda); | 481 | mTimeLabels->setAgenda(mAgenda); |
482 | 482 | ||
483 | // Update widgets to reflect user preferences | 483 | // Update widgets to reflect user preferences |
484 | // updateConfig(); | 484 | // updateConfig(); |
485 | 485 | ||
486 | // createDayLabels(); | 486 | // createDayLabels(); |
487 | 487 | ||
488 | // these blank widgets make the All Day Event box line up with the agenda | 488 | // these blank widgets make the All Day Event box line up with the agenda |
489 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 489 | dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
490 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); | 490 | dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); |
491 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 491 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
492 | 492 | ||
493 | // Scrolling | 493 | // Scrolling |
494 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), | 494 | connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), |
495 | mTimeLabels, SLOT(positionChanged())); | 495 | mTimeLabels, SLOT(positionChanged())); |
496 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), | 496 | connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), |
497 | SLOT(setContentsPos(int))); | 497 | SLOT(setContentsPos(int))); |
498 | 498 | ||
499 | connect(mAgenda,SIGNAL(showDateView( int, int)),SLOT(slotShowDateView( int, int ))); | 499 | connect(mAgenda,SIGNAL(showDateView( int, int)),SLOT(slotShowDateView( int, int ))); |
500 | connect(mAllDayAgenda,SIGNAL(showDateView( int, int )), SLOT(slotShowDateView( int, int ) )); | 500 | connect(mAllDayAgenda,SIGNAL(showDateView( int, int )), SLOT(slotShowDateView( int, int ) )); |
501 | 501 | ||
502 | // Create/Show/Edit/Delete Event | 502 | // Create/Show/Edit/Delete Event |
503 | connect(mAgenda,SIGNAL(newEventSignal(int,int)), | 503 | connect(mAgenda,SIGNAL(newEventSignal(int,int)), |
504 | SLOT(newEvent(int,int))); | 504 | SLOT(newEvent(int,int))); |
505 | connect(mAgenda,SIGNAL(newTodoSignal(int,int)), | 505 | connect(mAgenda,SIGNAL(newTodoSignal(int,int)), |
506 | SLOT(newTodo(int,int))); | 506 | SLOT(newTodo(int,int))); |
507 | connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 507 | connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
508 | SLOT(newEvent(int,int,int,int))); | 508 | SLOT(newEvent(int,int,int,int))); |
509 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), | 509 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), |
510 | SLOT(newEventAllDay(int,int))); | 510 | SLOT(newEventAllDay(int,int))); |
511 | connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), | 511 | connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), |
512 | SLOT(newTodoAllDay(int,int))); | 512 | SLOT(newTodoAllDay(int,int))); |
513 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), | 513 | connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), |
514 | SLOT(newEventAllDay(int,int))); | 514 | SLOT(newEventAllDay(int,int))); |
515 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 515 | connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
516 | SLOT(newTimeSpanSelected(int,int,int,int))); | 516 | SLOT(newTimeSpanSelected(int,int,int,int))); |
517 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), | 517 | connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), |
518 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); | 518 | SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); |
519 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 519 | connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
520 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); | 520 | connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); |
521 | 521 | ||
522 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 522 | connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
523 | SIGNAL(editIncidenceSignal(Incidence *))); | 523 | SIGNAL(editIncidenceSignal(Incidence *))); |
524 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), | 524 | connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), |
525 | SIGNAL(editIncidenceSignal(Incidence *))); | 525 | SIGNAL(editIncidenceSignal(Incidence *))); |
526 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 526 | connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
527 | SIGNAL(showIncidenceSignal(Incidence *))); | 527 | SIGNAL(showIncidenceSignal(Incidence *))); |
528 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), | 528 | connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), |
529 | SIGNAL(showIncidenceSignal(Incidence *))); | 529 | SIGNAL(showIncidenceSignal(Incidence *))); |
530 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 530 | connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
531 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 531 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
532 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), | 532 | connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), |
533 | SIGNAL(deleteIncidenceSignal(Incidence *))); | 533 | SIGNAL(deleteIncidenceSignal(Incidence *))); |
534 | 534 | ||
535 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 535 | connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
536 | SLOT(updateEventDates(KOAgendaItem *, int ))); | 536 | SLOT(updateEventDates(KOAgendaItem *, int ))); |
537 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), | 537 | connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), |
538 | SLOT(updateEventDates(KOAgendaItem *, int))); | 538 | SLOT(updateEventDates(KOAgendaItem *, int))); |
539 | 539 | ||
540 | // event indicator update | 540 | // event indicator update |
541 | connect(mAgenda,SIGNAL(lowerYChanged(int)), | 541 | connect(mAgenda,SIGNAL(lowerYChanged(int)), |
542 | SLOT(updateEventIndicatorTop(int))); | 542 | SLOT(updateEventIndicatorTop(int))); |
543 | connect(mAgenda,SIGNAL(upperYChanged(int)), | 543 | connect(mAgenda,SIGNAL(upperYChanged(int)), |
544 | SLOT(updateEventIndicatorBottom(int))); | 544 | SLOT(updateEventIndicatorBottom(int))); |
545 | // drag signals | 545 | // drag signals |
546 | /* | 546 | /* |
547 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), | 547 | connect(mAgenda,SIGNAL(startDragSignal(Event *)), |
548 | SLOT(startDrag(Event *))); | 548 | SLOT(startDrag(Event *))); |
549 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), | 549 | connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), |
550 | SLOT(startDrag(Event *))); | 550 | SLOT(startDrag(Event *))); |
551 | */ | 551 | */ |
552 | // synchronize selections | 552 | // synchronize selections |
553 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 553 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
554 | mAllDayAgenda, SLOT( deselectItem() ) ); | 554 | mAllDayAgenda, SLOT( deselectItem() ) ); |
555 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 555 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
556 | mAgenda, SLOT( deselectItem() ) ); | 556 | mAgenda, SLOT( deselectItem() ) ); |
557 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 557 | connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
558 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 558 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
559 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), | 559 | connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), |
560 | SIGNAL( incidenceSelected( Incidence * ) ) ); | 560 | SIGNAL( incidenceSelected( Incidence * ) ) ); |
561 | connect( mAgenda, SIGNAL( resizedSignal() ), | 561 | connect( mAgenda, SIGNAL( resizedSignal() ), |
562 | SLOT( updateConfig( ) ) ); | 562 | SLOT( updateConfig( ) ) ); |
563 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), | 563 | connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), |
564 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); | 564 | SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); |
565 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), | 565 | connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), |
566 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); | 566 | SLOT( addToCalSlot(Incidence * , Incidence *) ) ); |
567 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 567 | // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
568 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); | 568 | //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); |
569 | 569 | ||
570 | 570 | ||
571 | } | 571 | } |
572 | 572 | ||
573 | void KOAgendaView::toggleAllDay() | 573 | void KOAgendaView::toggleAllDay() |
574 | { | 574 | { |
575 | if ( mSplitterAgenda->firstHandle() ) | 575 | if ( mSplitterAgenda->firstHandle() ) |
576 | mSplitterAgenda->firstHandle()->toggle(); | 576 | mSplitterAgenda->firstHandle()->toggle(); |
577 | } | 577 | } |
578 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) | 578 | void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) |
579 | { | 579 | { |
580 | calendar()->addIncidence( inc ); | 580 | calendar()->addIncidence( inc ); |
581 | 581 | ||
582 | if ( incOld ) { | 582 | if ( incOld ) { |
583 | if ( incOld->type() == "Todo" ) | 583 | if ( incOld->type() == "Todo" ) |
584 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); | 584 | emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); |
585 | else | 585 | else |
586 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); | 586 | emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); |
587 | } | 587 | } |
588 | 588 | ||
589 | } | 589 | } |
590 | 590 | ||
591 | KOAgendaView::~KOAgendaView() | 591 | KOAgendaView::~KOAgendaView() |
592 | { | 592 | { |
593 | delete mAllAgendaPopup; | 593 | delete mAllAgendaPopup; |
594 | //delete mAllDayAgendaPopup; | 594 | //delete mAllDayAgendaPopup; |
595 | delete KOAgendaItem::paintPix(); | 595 | delete KOAgendaItem::paintPix(); |
596 | delete KOAgendaItem::paintPixSel(); | 596 | delete KOAgendaItem::paintPixSel(); |
597 | } | 597 | } |
598 | void KOAgendaView::resizeEvent( QResizeEvent* e ) | 598 | void KOAgendaView::resizeEvent( QResizeEvent* e ) |
599 | { | 599 | { |
600 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); | 600 | //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); |
601 | bool uc = false; | 601 | bool uc = false; |
602 | int ow = e->oldSize().width(); | 602 | int ow = e->oldSize().width(); |
603 | int oh = e->oldSize().height(); | 603 | int oh = e->oldSize().height(); |
604 | int w = e->size().width(); | 604 | int w = e->size().width(); |
605 | int h = e->size().height(); | 605 | int h = e->size().height(); |
606 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { | 606 | if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { |
607 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) | 607 | if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) |
608 | uc = true; | 608 | uc = true; |
609 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); | 609 | //qDebug("view changed %d %d %d %d ", ow, oh , w , h); |
610 | } | 610 | } |
611 | mUpcomingWidth = e->size().width() ; | 611 | mUpcomingWidth = e->size().width() ; |
612 | if ( mBlockUpdating || uc ) { | 612 | if ( mBlockUpdating || uc ) { |
613 | mBlockUpdating = false; | 613 | mBlockUpdating = false; |
614 | //mAgenda->setMinimumSize(800 , 600 ); | 614 | //mAgenda->setMinimumSize(800 , 600 ); |
615 | //qDebug("mAgenda->resize+++++++++++++++ "); | 615 | //qDebug("mAgenda->resize+++++++++++++++ "); |
616 | updateConfig(); | 616 | updateConfig(); |
617 | //qDebug("KOAgendaView::Updating now possible "); | 617 | //qDebug("KOAgendaView::Updating now possible "); |
618 | } else | 618 | } else |
619 | createDayLabels(); | 619 | createDayLabels(); |
620 | //qDebug("resizeEvent end "); | 620 | //qDebug("resizeEvent end "); |
621 | 621 | ||
622 | } | 622 | } |
623 | void KOAgendaView::slotDaylabelClicked( int num ) | 623 | void KOAgendaView::slotDaylabelClicked( int num ) |
624 | { | 624 | { |
625 | 625 | ||
626 | QDate firstDate = mSelectedDates.first(); | 626 | QDate firstDate = mSelectedDates.first(); |
627 | if ( num == -1 ) | 627 | if ( num == -1 ) |
628 | emit showDateView( 6, firstDate ); | 628 | emit showDateView( 6, firstDate ); |
629 | else if (num >= 0 ) { | 629 | else if (num >= 0 ) { |
630 | if ( mSelectedDates.count() == 1) | 630 | if ( mSelectedDates.count() == 1) |
631 | emit showDateView( 9, firstDate.addDays( num ) ); | 631 | emit showDateView( 9, firstDate.addDays( num ) ); |
632 | else | 632 | else |
633 | emit showDateView( 3, firstDate.addDays( num ) ); | 633 | emit showDateView( 3, firstDate.addDays( num ) ); |
634 | } | 634 | } |
635 | else | 635 | else |
636 | showDateView( 10, firstDate.addDays(1) ); | 636 | showDateView( 10, firstDate.addDays(1) ); |
637 | } | 637 | } |
638 | 638 | ||
639 | KOAgendaButton* KOAgendaView::getNewDaylabel() | 639 | KOAgendaButton* KOAgendaView::getNewDaylabel() |
640 | { | 640 | { |
641 | 641 | ||
642 | KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); | 642 | KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); |
643 | connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); | 643 | connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); |
644 | mDayLabelsList.append( dayLabel ); | 644 | mDayLabelsList.append( dayLabel ); |
645 | mLayoutDayLabels->addWidget(dayLabel); | 645 | mLayoutDayLabels->addWidget(dayLabel); |
646 | return dayLabel ; | 646 | return dayLabel ; |
647 | } | 647 | } |
648 | 648 | ||
649 | void KOAgendaView::createDayLabels() | 649 | void KOAgendaView::createDayLabels() |
650 | { | 650 | { |
651 | 651 | ||
652 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { | 652 | if ( mBlockUpdating || globalFlagBlockLabel == 1) { |
653 | // qDebug(" KOAgendaView::createDayLabels() blocked "); | 653 | // qDebug(" KOAgendaView::createDayLabels() blocked "); |
654 | return; | 654 | return; |
655 | 655 | ||
656 | } | 656 | } |
657 | int newHight; | 657 | int newHight; |
658 | if ( !mSelectedDates.count()) | 658 | if ( !mSelectedDates.count()) |
659 | return; | 659 | return; |
660 | 660 | ||
661 | // ### Before deleting and recreating we could check if mSelectedDates changed... | 661 | // ### Before deleting and recreating we could check if mSelectedDates changed... |
662 | // It would remove some flickering and gain speed (since this is called by | 662 | // It would remove some flickering and gain speed (since this is called by |
663 | // each updateView() call) | 663 | // each updateView() call) |
664 | 664 | ||
665 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; | 665 | int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - mAgenda->frameWidth()*2; |
666 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); | 666 | mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); |
667 | if ( maxWid < 20 ) | 667 | if ( maxWid < 20 ) |
668 | maxWid = 20; | 668 | maxWid = 20; |
669 | 669 | ||
670 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; | 670 | QFont dlf = KOPrefs::instance()->mTimeLabelsFont; |
671 | QFontMetrics fm ( dlf ); | 671 | QFontMetrics fm ( dlf ); |
672 | int selCount = mSelectedDates.count(); | 672 | int selCount = mSelectedDates.count(); |
673 | int widModulo = maxWid - (mAgenda->gridSpacingX() * selCount)+1; | 673 | int widModulo = maxWid - (mAgenda->gridSpacingX() * selCount)+1; |
674 | QString dayTest = "Mon 20"; | 674 | QString dayTest = "Mon 20"; |
675 | //QString dayTest = "Mon 20"; | 675 | //QString dayTest = "Mon 20"; |
676 | int wid = fm.width( dayTest ); | 676 | int wid = fm.width( dayTest ); |
677 | //maxWid -= ( selCount * 3 ); //working for QLabels | 677 | //maxWid -= ( selCount * 3 ); //working for QLabels |
678 | if ( QApplication::desktop()->width() <= 320 ) | 678 | if ( QApplication::desktop()->width() <= 320 ) |
679 | maxWid -= ( selCount * 3 ); //working for QPushButton | 679 | maxWid -= ( selCount * 3 ); //working for QPushButton |
680 | else | 680 | else |
681 | maxWid -= ( selCount * 3 ); //working for QPushButton | 681 | maxWid -= ( selCount * 3 ); //working for QPushButton |
682 | if ( maxWid < 0 ) | 682 | if ( maxWid < 0 ) |
683 | maxWid = 20; | 683 | maxWid = 20; |
684 | int needWid = wid * selCount; | 684 | int needWid = wid * selCount; |
685 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); | 685 | //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); |
686 | //if ( needWid > maxWid ) | 686 | //if ( needWid > maxWid ) |
687 | // qDebug("DAYLABELS TOOOOOOO BIG "); | 687 | // qDebug("DAYLABELS TOOOOOOO BIG "); |
688 | while ( needWid > maxWid ) { | 688 | while ( needWid > maxWid ) { |
689 | dayTest = dayTest.left( dayTest.length() - 1 ); | 689 | dayTest = dayTest.left( dayTest.length() - 1 ); |
690 | wid = fm.width( dayTest ); | 690 | wid = fm.width( dayTest ); |
691 | needWid = wid * selCount; | 691 | needWid = wid * selCount; |
692 | } | 692 | } |
693 | int maxLen = dayTest.length(); | 693 | int maxLen = dayTest.length(); |
694 | int fontPoint = dlf.pointSize(); | 694 | int fontPoint = dlf.pointSize(); |
695 | if ( maxLen < 2 ) { | 695 | if ( maxLen < 2 ) { |
696 | int fontPoint = dlf.pointSize(); | 696 | int fontPoint = dlf.pointSize(); |
697 | while ( fontPoint > 4 ) { | 697 | while ( fontPoint > 4 ) { |
698 | --fontPoint; | 698 | --fontPoint; |
699 | dlf.setPointSize( fontPoint ); | 699 | dlf.setPointSize( fontPoint ); |
700 | QFontMetrics f( dlf ); | 700 | QFontMetrics f( dlf ); |
701 | wid = f.width( "30" ); | 701 | wid = f.width( "30" ); |
702 | needWid = wid * selCount; | 702 | needWid = wid * selCount; |
703 | if ( needWid < maxWid ) | 703 | if ( needWid < maxWid ) |
704 | break; | 704 | break; |
705 | } | 705 | } |
706 | maxLen = 2; | 706 | maxLen = 2; |
707 | } | 707 | } |
708 | //qDebug("Max len %d ", dayTest.length() ); | 708 | //qDebug("Max len %d ", dayTest.length() ); |
709 | 709 | ||
710 | QFontMetrics tempF( dlf ); | 710 | QFontMetrics tempF( dlf ); |
711 | newHight = tempF.height(); | 711 | newHight = tempF.height(); |
712 | mDayLabels->setFont( dlf ); | 712 | mDayLabels->setFont( dlf ); |
713 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; | 713 | // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; |
714 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); | 714 | // mLayoutDayLabels->addSpacing(mTimeLabels->width()); |
715 | //mLayoutDayLabels->addSpacing( 2 ); | 715 | //mLayoutDayLabels->addSpacing( 2 ); |
716 | // QFont lFont = dlf; | 716 | // QFont lFont = dlf; |
717 | bool appendLabels = false; | 717 | bool appendLabels = false; |
718 | KOAgendaButton *dayLabel; | 718 | KOAgendaButton *dayLabel; |
719 | dayLabel = mDayLabelsList.first(); | 719 | dayLabel = mDayLabelsList.first(); |
720 | if ( !dayLabel ) { | 720 | if ( !dayLabel ) { |
721 | appendLabels = true; | 721 | appendLabels = true; |
722 | dayLabel = getNewDaylabel(); | 722 | dayLabel = getNewDaylabel(); |
723 | } | 723 | } |
724 | dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() ); | 724 | dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() ); |
725 | dayLabel->setFont( dlf ); | 725 | dayLabel->setFont( dlf ); |
726 | dayLabel->setNum( -1 ); | 726 | dayLabel->setNum( -1 ); |
727 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 727 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
728 | #if 0 | 728 | #if 0 |
729 | if ( QApplication::desktop()->width() <= 320 ) | 729 | if ( QApplication::desktop()->width() <= 320 ) |
730 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ).left(2) ); | 730 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ).left(2) ); |
731 | else | 731 | else |
732 | #endif | 732 | #endif |
733 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); | 733 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); |
734 | dayLabel->show(); | 734 | dayLabel->show(); |
735 | DateList::ConstIterator dit; | 735 | DateList::ConstIterator dit; |
736 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); | 736 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); |
737 | int counter = -1; | 737 | int counter = -1; |
738 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 738 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
739 | ++counter; | 739 | ++counter; |
740 | QDate date = *dit; | 740 | QDate date = *dit; |
741 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); | 741 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); |
742 | if ( ! appendLabels ) { | 742 | if ( ! appendLabels ) { |
743 | dayLabel = mDayLabelsList.next(); | 743 | dayLabel = mDayLabelsList.next(); |
744 | if ( !dayLabel ) | 744 | if ( !dayLabel ) |
745 | appendLabels = true; | 745 | appendLabels = true; |
746 | } | 746 | } |
747 | if ( appendLabels ) { | 747 | if ( appendLabels ) { |
748 | dayLabel = getNewDaylabel(); | 748 | dayLabel = getNewDaylabel(); |
749 | } | 749 | } |
750 | dayLabel->setMinimumWidth( 1 ); | 750 | dayLabel->setMinimumWidth( 1 ); |
751 | dayLabel->setMaximumWidth( 10240 ); | 751 | dayLabel->setMaximumWidth( 10240 ); |
752 | dayLabel->setFont( dlf ); | 752 | dayLabel->setFont( dlf ); |
753 | dayLabel->show(); | 753 | dayLabel->show(); |
754 | dayLabel->setAutoRepeat( false ); | 754 | dayLabel->setAutoRepeat( false ); |
755 | dayLabel->setNum( counter ); | 755 | dayLabel->setNum( counter ); |
756 | QString str; | 756 | QString str; |
757 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); | 757 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); |
758 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); | 758 | QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); |
759 | switch ( maxLen ) { | 759 | switch ( maxLen ) { |
760 | case 2: | 760 | case 2: |
761 | str = QString::number( date.day() ); | 761 | str = QString::number( date.day() ); |
762 | break; | 762 | break; |
763 | 763 | ||
764 | case 3: | 764 | case 3: |
765 | str = dayName.left( 1 ) +QString::number( date.day()); | 765 | str = dayName.left( 1 ) +QString::number( date.day()); |
766 | 766 | ||
767 | break; | 767 | break; |
768 | case 4: | 768 | case 4: |
769 | str = dayName.left( 1 ) + " " +QString::number( date.day()); | 769 | str = dayName.left( 1 ) + " " +QString::number( date.day()); |
770 | 770 | ||
771 | break; | 771 | break; |
772 | case 5: | 772 | case 5: |
773 | str = dayName.left( 2 ) + " " +QString::number( date.day()); | 773 | str = dayName.left( 2 ) + " " +QString::number( date.day()); |
774 | 774 | ||
775 | break; | 775 | break; |
776 | case 6: | 776 | case 6: |
777 | str = dayName.left( 3 ) + " " +QString::number( date.day()); | 777 | str = dayName.left( 3 ) + " " +QString::number( date.day()); |
778 | break; | 778 | break; |
779 | 779 | ||
780 | default: | 780 | default: |
781 | break; | 781 | break; |
782 | } | 782 | } |
783 | if ( oneday ) { | 783 | if ( oneday ) { |
784 | QString addString; | 784 | QString addString; |
785 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) | 785 | if ( mSelectedDates.first() == QDateTime::currentDateTime().date() ) |
786 | addString = i18n("Today"); | 786 | addString = i18n("Today"); |
787 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | 787 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) |
788 | addString = i18n("Tomorrow"); | 788 | addString = i18n("Tomorrow"); |
789 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | 789 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) |
790 | addString = i18n("Yesterday"); | 790 | addString = i18n("Yesterday"); |
791 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | 791 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) |
792 | addString = i18n("Day before yesterday"); | 792 | addString = i18n("Day before yesterday"); |
793 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | 793 | else if ( mSelectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) |
794 | addString = i18n("Day after tomorrow"); | 794 | addString = i18n("Day after tomorrow"); |
795 | if ( !addString.isEmpty() ) { | 795 | if ( !addString.isEmpty() ) { |
796 | str = addString+", " + str; | 796 | str = addString+", " + str; |
797 | } else { | 797 | } else { |
798 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); | 798 | str = KGlobal::locale()->formatDate( date, KOPrefs::instance()->mShortDateInViewer); |
799 | } | 799 | } |
800 | } | 800 | } |
801 | dayLabel->setText(str); | 801 | dayLabel->setText(str); |
802 | //dayLabel->setAlignment(QLabel::AlignHCenter); | 802 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
803 | if (date == QDate::currentDate()) { | 803 | if (date == QDate::currentDate()) { |
804 | QFont bFont = dlf; | 804 | QFont bFont = dlf; |
805 | bFont.setBold( true ); | 805 | bFont.setBold( true ); |
806 | dayLabel->setFont(bFont); | 806 | dayLabel->setFont(bFont); |
807 | } | 807 | } |
808 | //dayLayout->addWidget(dayLabel); | 808 | //dayLayout->addWidget(dayLabel); |
809 | 809 | ||
810 | #ifndef KORG_NOPLUGINS | 810 | #ifndef KORG_NOPLUGINS |
811 | CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); | 811 | CalendarDecoration::List cds = KOCore::self()->calendarDecorations(); |
812 | CalendarDecoration *it; | 812 | CalendarDecoration *it; |
813 | for(it = cds.first(); it; it = cds.next()) { | 813 | for(it = cds.first(); it; it = cds.next()) { |
814 | QString text = it->shortText( date ); | 814 | QString text = it->shortText( date ); |
815 | if ( !text.isEmpty() ) { | 815 | if ( !text.isEmpty() ) { |
816 | QLabel *label = new QLabel(text,mDayLabels); | 816 | QLabel *label = new QLabel(text,mDayLabels); |
817 | label->setAlignment(AlignCenter); | 817 | label->setAlignment(AlignCenter); |
818 | dayLayout->addWidget(label); | 818 | dayLayout->addWidget(label); |
819 | } | 819 | } |
820 | } | 820 | } |
821 | 821 | ||
822 | for(it = cds.first(); it; it = cds.next()) { | 822 | for(it = cds.first(); it; it = cds.next()) { |
823 | QWidget *wid = it->smallWidget(mDayLabels,date); | 823 | QWidget *wid = it->smallWidget(mDayLabels,date); |
824 | if ( wid ) { | 824 | if ( wid ) { |
825 | // wid->setHeight(20); | 825 | // wid->setHeight(20); |
826 | dayLayout->addWidget(wid); | 826 | dayLayout->addWidget(wid); |
827 | } | 827 | } |
828 | } | 828 | } |
829 | #endif | 829 | #endif |
830 | } | 830 | } |
831 | if ( ! appendLabels ) { | 831 | if ( ! appendLabels ) { |
832 | dayLabel = mDayLabelsList.next(); | 832 | dayLabel = mDayLabelsList.next(); |
833 | if ( !dayLabel ) | 833 | if ( !dayLabel ) |
834 | appendLabels = true; | 834 | appendLabels = true; |
835 | } | 835 | } |
836 | if ( appendLabels ) { | 836 | if ( appendLabels ) { |
837 | dayLabel = getNewDaylabel(); | 837 | dayLabel = getNewDaylabel(); |
838 | } | 838 | } |
839 | //dayLabel->hide();//test only | 839 | //dayLabel->hide();//test only |
840 | 840 | ||
841 | dayLabel->setText(">"); | 841 | dayLabel->setText(">"); |
842 | dayLabel->setFont( dlf ); | 842 | dayLabel->setFont( dlf ); |
843 | dayLabel->setAutoRepeat( true ); | 843 | dayLabel->setAutoRepeat( true ); |
844 | dayLabel->show(); | 844 | dayLabel->show(); |
845 | dayLabel->setNum( -2 ); | 845 | dayLabel->setNum( -2 ); |
846 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ widModulo ); | 846 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ widModulo ); |
847 | 847 | ||
848 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); | 848 | //mLayoutDayLabels->addSpacing(mAgenda->verticalScrollBar()->width()+ offset+2); |
849 | if ( !appendLabels ) { | 849 | if ( !appendLabels ) { |
850 | dayLabel = mDayLabelsList.next(); | 850 | dayLabel = mDayLabelsList.next(); |
851 | while ( dayLabel ) { | 851 | while ( dayLabel ) { |
852 | //qDebug("!dayLabel %d",dayLabel ); | 852 | //qDebug("!dayLabel %d",dayLabel ); |
853 | dayLabel->hide(); | 853 | dayLabel->hide(); |
854 | dayLabel = mDayLabelsList.next(); | 854 | dayLabel = mDayLabelsList.next(); |
855 | } | 855 | } |
856 | } | 856 | } |
857 | 857 | ||
858 | mDayLabelsFrame->setFixedHeight( newHight + 4 ); | 858 | mDayLabelsFrame->setFixedHeight( newHight + 4 ); |
859 | } | 859 | } |
860 | 860 | ||
861 | int KOAgendaView::maxDatesHint() | 861 | int KOAgendaView::maxDatesHint() |
862 | { | 862 | { |
863 | // Not sure about the max number of events, so return 0 for now. | 863 | // Not sure about the max number of events, so return 0 for now. |
864 | return 0; | 864 | return 0; |
865 | } | 865 | } |
866 | 866 | ||
867 | int KOAgendaView::currentDateCount() | 867 | int KOAgendaView::currentDateCount() |
868 | { | 868 | { |
869 | return mSelectedDates.count(); | 869 | return mSelectedDates.count(); |
870 | } | 870 | } |
871 | 871 | ||
872 | QPtrList<Incidence> KOAgendaView::selectedIncidences() | 872 | QPtrList<Incidence> KOAgendaView::selectedIncidences() |
873 | { | 873 | { |
874 | QPtrList<Incidence> selected; | 874 | QPtrList<Incidence> selected; |
875 | Incidence *incidence; | 875 | Incidence *incidence; |
876 | 876 | ||
877 | incidence = mAgenda->selectedIncidence(); | 877 | incidence = mAgenda->selectedIncidence(); |
878 | if (incidence) selected.append(incidence); | 878 | if (incidence) selected.append(incidence); |
879 | 879 | ||
880 | incidence = mAllDayAgenda->selectedIncidence(); | 880 | incidence = mAllDayAgenda->selectedIncidence(); |
881 | if (incidence) selected.append(incidence); | 881 | if (incidence) selected.append(incidence); |
882 | 882 | ||
883 | return selected; | 883 | return selected; |
884 | } | 884 | } |
885 | 885 | ||
886 | DateList KOAgendaView::selectedDates() | 886 | DateList KOAgendaView::selectedDates() |
887 | { | 887 | { |
888 | DateList selected; | 888 | DateList selected; |
889 | QDate qd; | 889 | QDate qd; |
890 | 890 | ||
891 | qd = mAgenda->selectedIncidenceDate(); | 891 | qd = mAgenda->selectedIncidenceDate(); |
892 | if (qd.isValid()) selected.append(qd); | 892 | if (qd.isValid()) selected.append(qd); |
893 | 893 | ||
894 | qd = mAllDayAgenda->selectedIncidenceDate(); | 894 | qd = mAllDayAgenda->selectedIncidenceDate(); |
895 | if (qd.isValid()) selected.append(qd); | 895 | if (qd.isValid()) selected.append(qd); |
896 | 896 | ||
897 | return selected; | 897 | return selected; |
898 | } | 898 | } |
899 | 899 | ||
900 | 900 | ||
901 | void KOAgendaView::updateView() | 901 | void KOAgendaView::updateView() |
902 | { | 902 | { |
903 | if ( mBlockUpdating ) | 903 | if ( mBlockUpdating ) |
904 | return; | 904 | return; |
905 | // kdDebug() << "KOAgendaView::updateView()" << endl; | 905 | // kdDebug() << "KOAgendaView::updateView()" << endl; |
906 | fillAgenda(); | 906 | fillAgenda(); |
907 | 907 | ||
908 | } | 908 | } |
909 | 909 | ||
910 | 910 | ||
911 | /* | 911 | /* |
912 | Update configuration settings for the agenda view. This method is not | 912 | Update configuration settings for the agenda view. This method is not |
913 | complete. | 913 | complete. |
914 | */ | 914 | */ |
915 | void KOAgendaView::updateConfig() | 915 | void KOAgendaView::updateConfig() |
916 | { | 916 | { |
917 | if ( mBlockUpdating ) | 917 | if ( mBlockUpdating ) |
918 | return; | 918 | return; |
919 | if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) { | 919 | if ( mAgenda->height() > 96 * KOPrefs::instance()->mHourSize ) { |
920 | int old = KOPrefs::instance()->mHourSize; | 920 | int old = KOPrefs::instance()->mHourSize; |
921 | KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1; | 921 | KOPrefs::instance()->mHourSize = mAgenda->height()/96 +1; |
922 | qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize ); | 922 | qDebug("KOPrefs::instance()->mHourSize adjusted %d to %d ", old,KOPrefs::instance()->mHourSize ); |
923 | } | 923 | } |
924 | 924 | ||
925 | 925 | ||
926 | // update config for children | 926 | // update config for children |
927 | mTimeLabels->updateConfig(); | 927 | mTimeLabels->updateConfig(); |
928 | mAgenda->storePosition(); | 928 | mAgenda->storePosition(); |
929 | mAgenda->updateConfig(); | 929 | mAgenda->updateConfig(); |
930 | mAllDayAgenda->updateConfig(); | 930 | mAllDayAgenda->updateConfig(); |
931 | // widget synchronization | 931 | // widget synchronization |
932 | //TODO: find a better way, maybe signal/slot | 932 | //TODO: find a better way, maybe signal/slot |
933 | mTimeLabels->positionChanged(); | 933 | mTimeLabels->positionChanged(); |
934 | 934 | ||
935 | // for some reason, this needs to be called explicitly | 935 | // for some reason, this needs to be called explicitly |
936 | mTimeLabels->repaint(); | 936 | mTimeLabels->repaint(); |
937 | 937 | ||
938 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); | 938 | mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); |
939 | 939 | ||
940 | // ToolTips displaying summary of events | 940 | // ToolTips displaying summary of events |
941 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() | 941 | KOAgendaItem::toolTipGroup()->setEnabled(KOPrefs::instance() |
942 | ->mEnableToolTips); | 942 | ->mEnableToolTips); |
943 | 943 | ||
944 | //setHolidayMasks(); | 944 | //setHolidayMasks(); |
945 | 945 | ||
946 | //createDayLabels(); called by via updateView(); | 946 | //createDayLabels(); called by via updateView(); |
947 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); | 947 | mEventIndicatorTop->setXOffset(mTimeLabels->width() + mAgenda->frameWidth()); |
948 | updateView(); | 948 | updateView(); |
949 | mAgenda->restorePosition(); | 949 | mAgenda->restorePosition(); |
950 | } | 950 | } |
951 | 951 | ||
952 | 952 | ||
953 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) | 953 | void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) |
954 | { | 954 | { |
955 | 955 | ||
956 | 956 | ||
957 | int xxx = item->cellX(); | 957 | int xxx = item->cellX(); |
958 | //qDebug("KOAgendaView::updateEventDates %d %d %d %d %d", xxx, mMinY.at(xxx),mMaxY.at(xxx),item->cellYTop(),item->cellYBottom() ); | 958 | //qDebug("KOAgendaView::updateEventDates %d %d %d %d %d", xxx, mMinY.at(xxx),mMaxY.at(xxx),item->cellYTop(),item->cellYBottom() ); |
959 | if ( mMinY.at(xxx) > item->cellYTop() ) | 959 | if ( mMinY.at(xxx) > item->cellYTop() ) |
960 | mMinY.at(xxx) = item->cellYTop(); | 960 | mMinY.at(xxx) = item->cellYTop(); |
961 | if ( mMaxY.at(xxx) < item->cellYBottom() ) | 961 | if ( mMaxY.at(xxx) < item->cellYBottom() ) |
962 | mMaxY.at(xxx) = item->cellYBottom(); | 962 | mMaxY.at(xxx) = item->cellYBottom(); |
963 | 963 | ||
964 | QDateTime startDt,endDt; | 964 | QDateTime startDt,endDt; |
965 | QDate startDate; | 965 | QDate startDate; |
966 | int lenInSecs; | 966 | int lenInSecs; |
967 | // if ( type == KOAgenda::RESIZETOP ) | 967 | // if ( type == KOAgenda::RESIZETOP ) |
968 | // qDebug("RESIZETOP "); | 968 | // qDebug("RESIZETOP "); |
969 | // if ( type == KOAgenda::RESIZEBOTTOM ) | 969 | // if ( type == KOAgenda::RESIZEBOTTOM ) |
970 | // qDebug("RESIZEBOTTOM "); | 970 | // qDebug("RESIZEBOTTOM "); |
971 | // if ( type == KOAgenda::MOVE ) | 971 | // if ( type == KOAgenda::MOVE ) |
972 | // qDebug("MOVE "); | 972 | // qDebug("MOVE "); |
973 | if ( item->incidence()->type() == "Event" ) { | 973 | if ( item->incidence()->type() == "Event" ) { |
974 | startDt =item->incidence()->dtStart(); | 974 | startDt =item->incidence()->dtStart(); |
975 | endDt = item->incidence()->dtEnd(); | 975 | endDt = item->incidence()->dtEnd(); |
976 | lenInSecs = startDt.secsTo( endDt ); | 976 | lenInSecs = startDt.secsTo( endDt ); |
977 | } | 977 | } |
978 | 978 | ||
979 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); | 979 | // emit incidenceItemChanged( item->incidence(), KOGlobals::EVENTEDITED ); |
980 | 980 | ||
981 | if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { | 981 | if ( item->incidence()->type()=="Todo" && item->mLastMoveXPos > 0 ) { |
982 | startDate = mSelectedDates[item->mLastMoveXPos]; | 982 | startDate = mSelectedDates[item->mLastMoveXPos]; |
983 | } else { | 983 | } else { |
984 | if (item->cellX() < 0) { | 984 | if (item->cellX() < 0) { |
985 | startDate = (mSelectedDates.first()).addDays(item->cellX()); | 985 | startDate = (mSelectedDates.first()).addDays(item->cellX()); |
986 | } else { | 986 | } else { |
987 | startDate = mSelectedDates[item->cellX()]; | 987 | startDate = mSelectedDates[item->cellX()]; |
988 | } | 988 | } |
989 | } | 989 | } |
990 | startDt.setDate(startDate); | 990 | startDt.setDate(startDate); |
991 | 991 | ||
992 | if (item->incidence()->doesFloat()) { | 992 | if (item->incidence()->doesFloat()) { |
993 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); | 993 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); |
994 | } else { | 994 | } else { |
995 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) | 995 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) |
996 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); | 996 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); |
997 | if ( item->incidence()->type() == "Event" ) { | 997 | if ( item->incidence()->type() == "Event" ) { |
998 | if ( type == KOAgenda::MOVE ) { | 998 | if ( type == KOAgenda::MOVE ) { |
999 | endDt = startDt.addSecs(lenInSecs); | 999 | endDt = startDt.addSecs(lenInSecs); |
1000 | 1000 | ||
1001 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { | 1001 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { |
1002 | if (item->lastMultiItem()) { | 1002 | if (item->lastMultiItem()) { |
1003 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 1003 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
1004 | endDt.setDate(startDate. | 1004 | endDt.setDate(startDate. |
1005 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 1005 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
1006 | } else { | 1006 | } else { |
1007 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 1007 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
1008 | endDt.setDate(startDate); | 1008 | endDt.setDate(startDate); |
1009 | } | 1009 | } |
1010 | } | 1010 | } |
1011 | } else { | 1011 | } else { |
1012 | // todo | 1012 | // todo |
1013 | if (item->lastMultiItem()) { | 1013 | if (item->lastMultiItem()) { |
1014 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 1014 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
1015 | endDt.setDate(startDate. | 1015 | endDt.setDate(startDate. |
1016 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 1016 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
1017 | } else { | 1017 | } else { |
1018 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); | 1018 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); |
1019 | if ( item->cellYBottom() > 0 ) | 1019 | if ( item->cellYBottom() > 0 ) |
1020 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 1020 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
1021 | else | 1021 | else |
1022 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); | 1022 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); |
1023 | endDt.setDate(startDate); | 1023 | endDt.setDate(startDate); |
1024 | } | 1024 | } |
1025 | } | 1025 | } |
1026 | } | 1026 | } |
1027 | if ( item->incidence()->type() == "Event" ) { | 1027 | if ( item->incidence()->type() == "Event" ) { |
1028 | item->incidence()->setDtStart(startDt); | 1028 | item->incidence()->setDtStart(startDt); |
1029 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); | 1029 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); |
1030 | } else if ( item->incidence()->type() == "Todo" ) { | 1030 | } else if ( item->incidence()->type() == "Todo" ) { |
1031 | Todo* to = static_cast<Todo*>(item->incidence()); | 1031 | Todo* to = static_cast<Todo*>(item->incidence()); |
1032 | 1032 | ||
1033 | to->setDtDue(endDt); | 1033 | to->setDtDue(endDt); |
1034 | if ( to->hasStartDate() ) { | 1034 | if ( to->hasStartDate() ) { |
1035 | if (to->dtStart() >= to->dtDue() ) | 1035 | if (to->dtStart() >= to->dtDue() ) |
1036 | to->setDtStart(to->dtDue().addDays( -2 )); | 1036 | to->setDtStart(to->dtDue().addDays( -2 )); |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | } | 1039 | } |
1040 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); | 1040 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); |
1041 | item->incidence()->setRevision(item->incidence()->revision()+1); | 1041 | item->incidence()->setRevision(item->incidence()->revision()+1); |
1042 | item->setItemDate(startDt.date()); | 1042 | item->setItemDate(startDt.date()); |
1043 | //item->updateItem(); | 1043 | //item->updateItem(); |
1044 | if ( item->incidence()->type() == "Todo" ) { | 1044 | if ( item->incidence()->type() == "Todo" ) { |
1045 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); | 1045 | emit todoMoved((Todo*)item->incidence(), KOGlobals::EVENTEDITED ); |
1046 | 1046 | ||
1047 | } | 1047 | } |
1048 | else | 1048 | else |
1049 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); | 1049 | emit incidenceChanged(item->incidence(), KOGlobals::EVENTEDITED); |
1050 | item->updateItem(); | 1050 | item->updateItem(); |
1051 | } | 1051 | } |
1052 | 1052 | ||
1053 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) | 1053 | void KOAgendaView::showDates( const QDate &start, const QDate &end ) |
1054 | { | 1054 | { |
1055 | // kdDebug() << "KOAgendaView::selectDates" << endl; | 1055 | // kdDebug() << "KOAgendaView::selectDates" << endl; |
1056 | 1056 | ||
1057 | mSelectedDates.clear(); | 1057 | mSelectedDates.clear(); |
1058 | // qDebug("KOAgendaView::showDates "); | 1058 | // qDebug("KOAgendaView::showDates "); |
1059 | QDate d = start; | 1059 | QDate d = start; |
1060 | while (d <= end) { | 1060 | while (d <= end) { |
1061 | mSelectedDates.append(d); | 1061 | mSelectedDates.append(d); |
1062 | d = d.addDays( 1 ); | 1062 | d = d.addDays( 1 ); |
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | // and update the view | 1065 | // and update the view |
1066 | fillAgenda(); | 1066 | fillAgenda(); |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | 1069 | ||
1070 | void KOAgendaView::showEvents(QPtrList<Event>) | 1070 | void KOAgendaView::showEvents(QPtrList<Event>) |
1071 | { | 1071 | { |
1072 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; | 1072 | kdDebug() << "KOAgendaView::showEvents() is not yet implemented" << endl; |
1073 | } | 1073 | } |
1074 | 1074 | ||
1075 | void KOAgendaView::changeEventDisplay(Event *, int) | 1075 | void KOAgendaView::changeEventDisplay(Event *, int) |
1076 | { | 1076 | { |
1077 | // qDebug("KOAgendaView::changeEventDisplay "); | 1077 | // qDebug("KOAgendaView::changeEventDisplay "); |
1078 | // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; | 1078 | // kdDebug() << "KOAgendaView::changeEventDisplay" << endl; |
1079 | // this should be re-written to be MUCH smarter. Right now we | 1079 | // this should be re-written to be MUCH smarter. Right now we |
1080 | // are just playing dumb. | 1080 | // are just playing dumb. |
1081 | fillAgenda(); | 1081 | fillAgenda(); |
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | void KOAgendaView::fillAgenda(const QDate &) | 1084 | void KOAgendaView::fillAgenda(const QDate &) |
1085 | { | 1085 | { |
1086 | // qDebug("KOAgendaView::fillAgenda "); | 1086 | // qDebug("KOAgendaView::fillAgenda "); |
1087 | fillAgenda(); | 1087 | fillAgenda(); |
1088 | } | 1088 | } |
1089 | 1089 | ||
1090 | void KOAgendaView::fillAgenda() | 1090 | void KOAgendaView::fillAgenda() |
1091 | { | 1091 | { |
1092 | if ( globalFlagBlockStartup ) | 1092 | if ( globalFlagBlockStartup ) |
1093 | return; | 1093 | return; |
1094 | if ( globalFlagBlockAgenda == 1 ) | 1094 | if ( globalFlagBlockAgenda == 1 ) |
1095 | return; | 1095 | return; |
1096 | static bool onlyOne = false; | 1096 | static bool onlyOne = false; |
1097 | if ( onlyOne ) | 1097 | if ( onlyOne ) |
1098 | return; | 1098 | return; |
1099 | onlyOne = true; | 1099 | onlyOne = true; |
1100 | //if ( globalFlagBlockAgenda == 2 ) | 1100 | //if ( globalFlagBlockAgenda == 2 ) |
1101 | //globalFlagBlockAgenda = 0; | 1101 | //globalFlagBlockAgenda = 0; |
1102 | // globalFlagBlockPainting = false; | 1102 | // globalFlagBlockPainting = false; |
1103 | if ( globalFlagBlockAgenda == 0 ) | 1103 | if ( globalFlagBlockAgenda == 0 ) |
1104 | globalFlagBlockAgenda = 1; | 1104 | globalFlagBlockAgenda = 1; |
1105 | // clearView(); | 1105 | // clearView(); |
1106 | //qDebug("fillAgenda()++++ "); | 1106 | //qDebug("fillAgenda()++++ "); |
1107 | globalFlagBlockAgendaItemPaint = 1; | 1107 | globalFlagBlockAgendaItemPaint = 1; |
1108 | 1108 | ||
1109 | mAllDayAgenda->changeColumns(mSelectedDates.count()); | 1109 | mAllDayAgenda->changeColumns(mSelectedDates.count()); |
1110 | mAgenda->changeColumns(mSelectedDates.count()); | 1110 | mAgenda->changeColumns(mSelectedDates.count()); |
1111 | qApp->processEvents(); | 1111 | qApp->processEvents(); |
1112 | mEventIndicatorTop->changeColumns(mSelectedDates.count()); | 1112 | mEventIndicatorTop->changeColumns(mSelectedDates.count()); |
1113 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); | 1113 | mEventIndicatorBottom->changeColumns(mSelectedDates.count()); |
1114 | setHolidayMasks(); | 1114 | setHolidayMasks(); |
1115 | 1115 | ||
1116 | //mAgenda->hideUnused(); | 1116 | //mAgenda->hideUnused(); |
1117 | //mAllDayAgenda->hideUnused(); | 1117 | //mAllDayAgenda->hideUnused(); |
1118 | 1118 | ||
1119 | // mAgenda->blockNextRepaint( false ); | 1119 | // mAgenda->blockNextRepaint( false ); |
1120 | // mAgenda->viewport()->repaint(); | 1120 | // mAgenda->viewport()->repaint(); |
1121 | // mAgenda->blockNextRepaint( true ); | 1121 | // mAgenda->blockNextRepaint( true ); |
1122 | mMinY.resize(mSelectedDates.count()); | 1122 | mMinY.resize(mSelectedDates.count()); |
1123 | mMaxY.resize(mSelectedDates.count()); | 1123 | mMaxY.resize(mSelectedDates.count()); |
1124 | 1124 | ||
1125 | QPtrList<Event> dayEvents; | 1125 | QPtrList<Event> dayEvents; |
1126 | 1126 | ||
1127 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1127 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1128 | // Therefore, gtodoset all of them. | 1128 | // Therefore, gtodoset all of them. |
1129 | QPtrList<Todo> todos = calendar()->todos(); | 1129 | QPtrList<Todo> todos = calendar()->todos(); |
1130 | 1130 | ||
1131 | mAgenda->setDateList(mSelectedDates); | 1131 | mAgenda->setDateList(mSelectedDates); |
1132 | 1132 | ||
1133 | QDate today = QDate::currentDate(); | 1133 | QDate today = QDate::currentDate(); |
1134 | 1134 | ||
1135 | DateList::ConstIterator dit; | 1135 | DateList::ConstIterator dit; |
1136 | int curCol = 0; | 1136 | int curCol = 0; |
1137 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 1137 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
1138 | QDate currentDate = *dit; | 1138 | QDate currentDate = *dit; |
1139 | // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() | 1139 | // kdDebug() << "KOAgendaView::fillAgenda(): " << currentDate.toString() |
1140 | // << endl; | 1140 | // << endl; |
1141 | 1141 | ||
1142 | dayEvents = calendar()->events(currentDate,true); | 1142 | dayEvents = calendar()->events(currentDate,true); |
1143 | 1143 | ||
1144 | // Default values, which can never be reached | 1144 | // Default values, which can never be reached |
1145 | mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; | 1145 | mMinY[curCol] = mAgenda->timeToY(QTime(23,59)) + 1; |
1146 | mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; | 1146 | mMaxY[curCol] = mAgenda->timeToY(QTime(0,0)) - 1; |
1147 | 1147 | ||
1148 | unsigned int numEvent; | 1148 | unsigned int numEvent; |
1149 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { | 1149 | for(numEvent=0;numEvent<dayEvents.count();++numEvent) { |
1150 | Event *event = dayEvents.at(numEvent); | 1150 | Event *event = dayEvents.at(numEvent); |
1151 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) | 1151 | if ( !KOPrefs::instance()->mShowSyncEvents && event->uid().left(2) == QString("la") ) |
1152 | if ( event->uid().left(15) == QString("last-syncEvent-") ) | 1152 | if ( event->uid().left(15) == QString("last-syncEvent-") ) |
1153 | continue; | 1153 | continue; |
1154 | // kdDebug() << " Event: " << event->summary() << endl; | 1154 | // kdDebug() << " Event: " << event->summary() << endl; |
1155 | 1155 | ||
1156 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; | 1156 | int beginX = currentDate.daysTo(event->dtStart().date()) + curCol; |
1157 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; | 1157 | int endX = currentDate.daysTo(event->dtEnd().date()) + curCol; |
1158 | 1158 | ||
1159 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; | 1159 | // kdDebug() << " beginX: " << beginX << " endX: " << endX << endl; |
1160 | 1160 | ||
1161 | if (event->doesFloat()) { | 1161 | if (event->doesFloat()) { |
1162 | if (event->recurrence()->doesRecur()) { | 1162 | if (event->recurrence()->doesRecur()) { |
1163 | if (event->isMultiDay() ) { | 1163 | if (event->isMultiDay() ) { |
1164 | endX = endX - beginX;// endX is now number of days | 1164 | endX = endX - beginX;// endX is now number of days |
1165 | if ( event->recursOn( currentDate ) ) { | 1165 | if ( event->recursOn( currentDate ) ) { |
1166 | endX += curCol; | 1166 | endX += curCol; |
1167 | beginX = curCol; | 1167 | beginX = curCol; |
1168 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1168 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1169 | } else { | 1169 | } else { |
1170 | //qDebug("days %d %s",endX , currentDate.toString().latin1()); | 1170 | qDebug("days %d %s",endX , currentDate.toString().latin1()); |
1171 | QDate dateit = currentDate.addDays( -endX ); | 1171 | QDate dateit = currentDate.addDays( -endX ); |
1172 | if ( event->recursOn( dateit ) ) { | 1172 | if ( event->recursOn( dateit ) ) { |
1173 | //qDebug("found %d %d %d %s", endX,curCol, curCol-endX ,dateit.toString().latin1() ); | 1173 | qDebug("found %d %d %d %s", endX,curCol, curCol-endX ,dateit.toString().latin1() ); |
1174 | if ( curCol-endX < 0 ) { | 1174 | if ( curCol-endX < 0 ) { |
1175 | mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); | 1175 | mAllDayAgenda->insertAllDayItem(event,currentDate,0,curCol); |
1176 | } | 1176 | } |
1177 | } | 1177 | } |
1178 | } | 1178 | } |
1179 | } else { | 1179 | } else { |
1180 | mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); | 1180 | mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); |
1181 | } | 1181 | } |
1182 | #if 0 | 1182 | #if 0 |
1183 | if (beginX <= 0 && curCol == 0) { | 1183 | if (beginX <= 0 && curCol == 0) { |
1184 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1184 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1185 | } else if (beginX == curCol) { | 1185 | } else if (beginX == curCol) { |
1186 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1186 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1187 | } else { | 1187 | } else { |
1188 | qDebug("skipped %d %d %d ",beginX , endX, curCol); | 1188 | qDebug("skipped %d %d %d ",beginX , endX, curCol); |
1189 | } | 1189 | } |
1190 | #endif | 1190 | #endif |
1191 | //mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); | 1191 | //mAllDayAgenda->insertAllDayItem(event,currentDate,curCol,curCol); |
1192 | } else { | 1192 | } else { |
1193 | if (beginX <= 0 && curCol == 0) { | 1193 | if (beginX <= 0 && curCol == 0) { |
1194 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1194 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1195 | } else if (beginX == curCol) { | 1195 | } else if (beginX == curCol) { |
1196 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); | 1196 | mAllDayAgenda->insertAllDayItem(event,currentDate,beginX,endX); |
1197 | } | 1197 | } |
1198 | } | 1198 | } |
1199 | } else if (event->isMultiDay()) { | 1199 | } else if (event->isMultiDay()) { |
1200 | if ( event->doesRecur () ) { | 1200 | if ( event->doesRecur () ) { |
1201 | QDate dateit = currentDate; | 1201 | QDate dateit = currentDate; |
1202 | int count = 0; | 1202 | int count = 0; |
1203 | int max = event->dtStart().daysTo( event->dtEnd() ) +2; | 1203 | int max = event->dtStart().daysTo( event->dtEnd() ) +2; |
1204 | while (! event->recursOn( dateit ) && count <= max ) { | 1204 | while (! event->recursOn( dateit ) && count <= max ) { |
1205 | ++count; | 1205 | ++count; |
1206 | dateit = dateit.addDays( -1 ); | 1206 | dateit = dateit.addDays( -1 ); |
1207 | } | 1207 | } |
1208 | bool ok; | 1208 | bool ok; |
1209 | QDateTime nextOcstart = event->getNextOccurence( QDateTime(dateit) ,&ok ); | 1209 | QDateTime nextOcstart = event->getNextOccurence( QDateTime(dateit) ,&ok ); |
1210 | if ( ok ) | 1210 | if ( ok ) |
1211 | { | 1211 | { |
1212 | int secs = event->dtStart().secsTo( event->dtEnd() ); | 1212 | int secs = event->dtStart().secsTo( event->dtEnd() ); |
1213 | QDateTime nextOcend =nextOcstart.addSecs( secs ); ; | 1213 | QDateTime nextOcend =nextOcstart.addSecs( secs ); ; |
1214 | beginX = currentDate.daysTo(nextOcstart.date()) + curCol; | 1214 | beginX = currentDate.daysTo(nextOcstart.date()) + curCol; |
1215 | endX = currentDate.daysTo(nextOcend.date()) + curCol; | 1215 | endX = currentDate.daysTo(nextOcend.date()) + curCol; |
1216 | 1216 | ||
1217 | } | 1217 | } |
1218 | } | 1218 | } |
1219 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1219 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1220 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1220 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1221 | //qDebug("insert %d %d %d %d %d ",beginX,endX,startY,endY , curCol ); | 1221 | //qDebug("insert %d %d %d %d %d ",beginX,endX,startY,endY , curCol ); |
1222 | if ((beginX <= 0 && curCol == 0) || beginX == curCol) { | 1222 | if ((beginX <= 0 && curCol == 0) || beginX == curCol) { |
1223 | //qDebug("insert!!! "); | 1223 | //qDebug("insert!!! "); |
1224 | mAgenda->insertMultiItem(event,currentDate,beginX,endX,startY,endY); | 1224 | mAgenda->insertMultiItem(event,currentDate,beginX,endX,startY,endY); |
1225 | } | 1225 | } |
1226 | if (beginX == curCol) { | 1226 | if (beginX == curCol) { |
1227 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1227 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1228 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1228 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1229 | } else if (endX == curCol) { | 1229 | } else if (endX == curCol) { |
1230 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1230 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1231 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1231 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1232 | } else { | 1232 | } else { |
1233 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); | 1233 | mMinY[curCol] = mAgenda->timeToY(QTime(0,0)); |
1234 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); | 1234 | mMaxY[curCol] = mAgenda->timeToY(QTime(23,59)); |
1235 | } | 1235 | } |
1236 | } else { | 1236 | } else { |
1237 | int startY = mAgenda->timeToY(event->dtStart().time()); | 1237 | int startY = mAgenda->timeToY(event->dtStart().time()); |
1238 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; | 1238 | int endY = mAgenda->timeToY(event->dtEnd().time()) - 1; |
1239 | if (endY < startY) endY = startY; | 1239 | if (endY < startY) endY = startY; |
1240 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); | 1240 | mAgenda->insertItem(event,currentDate,curCol,startY,endY); |
1241 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1241 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1242 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1242 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1243 | } | 1243 | } |
1244 | } | 1244 | } |
1245 | // ---------- [display Todos -------------- | 1245 | // ---------- [display Todos -------------- |
1246 | unsigned int numTodo; | 1246 | unsigned int numTodo; |
1247 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { | 1247 | for (numTodo = 0; numTodo < todos.count(); ++numTodo) { |
1248 | Todo *todo = todos.at(numTodo); | 1248 | Todo *todo = todos.at(numTodo); |
1249 | 1249 | ||
1250 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date | 1250 | if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date |
1251 | 1251 | ||
1252 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. | 1252 | // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. |
1253 | // Already completed items can be displayed on their original due date | 1253 | // Already completed items can be displayed on their original due date |
1254 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda | 1254 | //if not KOPrefs::instance()->mShowTodoInAgenda, show overdue in agenda |
1255 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; | 1255 | bool overdue = (!todo->isCompleted()) && (todo->dtDue() < today) && KOPrefs::instance()->mShowTodoInAgenda; |
1256 | bool fillIn = false; | 1256 | bool fillIn = false; |
1257 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) | 1257 | if ( todo->hasCompletedDate() && todo->completed().date() == currentDate ) |
1258 | fillIn = true; | 1258 | fillIn = true; |
1259 | if ( ! fillIn && !todo->hasCompletedDate() ) | 1259 | if ( ! fillIn && !todo->hasCompletedDate() ) |
1260 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); | 1260 | fillIn = ((todo->dtDue().date() == currentDate) && !overdue) || ((currentDate == today) && overdue); |
1261 | if ( fillIn ) { | 1261 | if ( fillIn ) { |
1262 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue | 1262 | if ( (todo->doesFloat() || overdue ) && !todo->hasCompletedDate() ) { // Todo has no due-time set or is already overdue |
1263 | if ( KOPrefs::instance()->mShowTodoInAgenda ) | 1263 | if ( KOPrefs::instance()->mShowTodoInAgenda ) |
1264 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); | 1264 | mAllDayAgenda->insertAllDayItem(todo, currentDate, curCol, curCol); |
1265 | } | 1265 | } |
1266 | else { | 1266 | else { |
1267 | QDateTime dt; | 1267 | QDateTime dt; |
1268 | if ( todo->hasCompletedDate() ) | 1268 | if ( todo->hasCompletedDate() ) |
1269 | dt = todo->completed(); | 1269 | dt = todo->completed(); |
1270 | else | 1270 | else |
1271 | dt = todo->dtDue();; | 1271 | dt = todo->dtDue();; |
1272 | 1272 | ||
1273 | 1273 | ||
1274 | int endY = mAgenda->timeToY(dt.time()) - 1; | 1274 | int endY = mAgenda->timeToY(dt.time()) - 1; |
1275 | int hi = (18/KOPrefs::instance()->mHourSize); | 1275 | int hi = (18/KOPrefs::instance()->mHourSize); |
1276 | //qDebug("hei %d ",KOPrefs::instance()->mHourSize); | 1276 | //qDebug("hei %d ",KOPrefs::instance()->mHourSize); |
1277 | int startY = endY -hi; | 1277 | int startY = endY -hi; |
1278 | 1278 | ||
1279 | mAgenda->insertItem(todo,currentDate,curCol,startY,endY); | 1279 | mAgenda->insertItem(todo,currentDate,curCol,startY,endY); |
1280 | 1280 | ||
1281 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; | 1281 | if (startY < mMinY[curCol]) mMinY[curCol] = startY; |
1282 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; | 1282 | if (endY > mMaxY[curCol]) mMaxY[curCol] = endY; |
1283 | } | 1283 | } |
1284 | } | 1284 | } |
1285 | } | 1285 | } |
1286 | // ---------- display Todos] -------------- | 1286 | // ---------- display Todos] -------------- |
1287 | 1287 | ||
1288 | ++curCol; | 1288 | ++curCol; |
1289 | } | 1289 | } |
1290 | mAgenda->hideUnused(); | 1290 | mAgenda->hideUnused(); |
1291 | mAllDayAgenda->hideUnused(); | 1291 | mAllDayAgenda->hideUnused(); |
1292 | mAgenda->checkScrollBoundaries(); | 1292 | mAgenda->checkScrollBoundaries(); |
1293 | 1293 | ||
1294 | deleteSelectedDateTime(); | 1294 | deleteSelectedDateTime(); |
1295 | 1295 | ||
1296 | createDayLabels(); | 1296 | createDayLabels(); |
1297 | emit incidenceSelected( 0 ); | 1297 | emit incidenceSelected( 0 ); |
1298 | 1298 | ||
1299 | if ( globalFlagBlockAgenda == 2 ) { | 1299 | if ( globalFlagBlockAgenda == 2 ) { |
1300 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 1300 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
1301 | setStartHour( KOPrefs::instance()->mDayBegins ); | 1301 | setStartHour( KOPrefs::instance()->mDayBegins ); |
1302 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 1302 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
1303 | setStartHour( QTime::currentTime ().hour() ); | 1303 | setStartHour( QTime::currentTime ().hour() ); |
1304 | // qApp->processEvents(); | 1304 | // qApp->processEvents(); |
1305 | } | 1305 | } |
1306 | qApp->processEvents(); | 1306 | qApp->processEvents(); |
1307 | //qDebug("qApp->processEvents(); END "); | 1307 | //qDebug("qApp->processEvents(); END "); |
1308 | globalFlagBlockAgenda = 0; | 1308 | globalFlagBlockAgenda = 0; |
1309 | 1309 | ||
1310 | // mAgenda->hideUnused(); | 1310 | // mAgenda->hideUnused(); |
1311 | //mAllDayAgenda->hideUnused(); | 1311 | //mAllDayAgenda->hideUnused(); |
1312 | mAllDayAgenda->drawContentsToPainter(); | 1312 | mAllDayAgenda->drawContentsToPainter(); |
1313 | mAgenda->drawContentsToPainter(); | 1313 | mAgenda->drawContentsToPainter(); |
1314 | repaintAgenda(); | 1314 | repaintAgenda(); |
1315 | onlyOne = false; | 1315 | onlyOne = false; |
1316 | // mAgenda->finishUpdate(); | 1316 | // mAgenda->finishUpdate(); |
1317 | //mAllDayAgenda->finishUpdate(); | 1317 | //mAllDayAgenda->finishUpdate(); |
1318 | 1318 | ||
1319 | // repaintAgenda(); | 1319 | // repaintAgenda(); |
1320 | //qApp->processEvents(); | 1320 | //qApp->processEvents(); |
1321 | // globalFlagBlockAgenda = 0; | 1321 | // globalFlagBlockAgenda = 0; |
1322 | } | 1322 | } |
1323 | void KOAgendaView::repaintAgenda() | 1323 | void KOAgendaView::repaintAgenda() |
1324 | { | 1324 | { |
1325 | // mAllDayAgenda->drawContentsToPainter(); | 1325 | // mAllDayAgenda->drawContentsToPainter(); |
1326 | // mAllDayAgenda->viewport()->repaint( false ); | 1326 | // mAllDayAgenda->viewport()->repaint( false ); |
1327 | // mAgenda->drawContentsToPainter(); | 1327 | // mAgenda->drawContentsToPainter(); |
1328 | // mAgenda->viewport()->repaint( false ); | 1328 | // mAgenda->viewport()->repaint( false ); |
1329 | // qApp->processEvents(); | 1329 | // qApp->processEvents(); |
1330 | 1330 | ||
1331 | //qDebug("KOAgendaView::repaintAgenda() "); | 1331 | //qDebug("KOAgendaView::repaintAgenda() "); |
1332 | //qApp->processEvents(); | 1332 | //qApp->processEvents(); |
1333 | mAgenda->viewport()->repaint( false ); | 1333 | mAgenda->viewport()->repaint( false ); |
1334 | mAllDayAgenda->viewport()->repaint( false ); | 1334 | mAllDayAgenda->viewport()->repaint( false ); |
1335 | mAgenda->finishUpdate(); | 1335 | mAgenda->finishUpdate(); |
1336 | mAllDayAgenda->finishUpdate(); | 1336 | mAllDayAgenda->finishUpdate(); |
1337 | } | 1337 | } |
1338 | 1338 | ||
1339 | 1339 | ||
1340 | void KOAgendaView::clearView() | 1340 | void KOAgendaView::clearView() |
1341 | { | 1341 | { |
1342 | // kdDebug() << "ClearView" << endl; | 1342 | // kdDebug() << "ClearView" << endl; |
1343 | mAllDayAgenda->clear(); | 1343 | mAllDayAgenda->clear(); |
1344 | mAgenda->clear(); | 1344 | mAgenda->clear(); |
1345 | } | 1345 | } |
1346 | 1346 | ||
1347 | void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, | 1347 | void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, |
1348 | const QDate &td) | 1348 | const QDate &td) |
1349 | { | 1349 | { |
1350 | #ifndef KORG_NOPRINTER | 1350 | #ifndef KORG_NOPRINTER |
1351 | if (fd == td) | 1351 | if (fd == td) |
1352 | calPrinter->preview(CalPrinter::Day, fd, td); | 1352 | calPrinter->preview(CalPrinter::Day, fd, td); |
1353 | else | 1353 | else |
1354 | calPrinter->preview(CalPrinter::Week, fd, td); | 1354 | calPrinter->preview(CalPrinter::Week, fd, td); |
1355 | #endif | 1355 | #endif |
1356 | } | 1356 | } |
1357 | 1357 | ||
1358 | // void KOAgendaView::updateMovedTodo() | 1358 | // void KOAgendaView::updateMovedTodo() |
1359 | // { | 1359 | // { |
1360 | // // updateConfig(); | 1360 | // // updateConfig(); |
1361 | // // emit updateTodoViews(); | 1361 | // // emit updateTodoViews(); |
1362 | // } | 1362 | // } |
1363 | 1363 | ||
1364 | void KOAgendaView::slotShowDateView( int mode , int d ) | 1364 | void KOAgendaView::slotShowDateView( int mode , int d ) |
1365 | { | 1365 | { |
1366 | if ( d >= mSelectedDates.count() ) { | 1366 | if ( d >= mSelectedDates.count() ) { |
1367 | qDebug("KOAgendaView::slotShowDateView datecounterror %d d ", d, mSelectedDates.count() ); | 1367 | qDebug("KOAgendaView::slotShowDateView datecounterror %d d ", d, mSelectedDates.count() ); |
1368 | 1368 | ||
1369 | } else { | 1369 | } else { |
1370 | QDate day = mSelectedDates[d]; | 1370 | QDate day = mSelectedDates[d]; |
1371 | emit showDateView(mode , day ); | 1371 | emit showDateView(mode , day ); |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | } | 1374 | } |
1375 | void KOAgendaView::newEvent(int gx, int gy) | 1375 | void KOAgendaView::newEvent(int gx, int gy) |
1376 | { | 1376 | { |
1377 | if (!mSelectedDates.count()) return; | 1377 | if (!mSelectedDates.count()) return; |
1378 | 1378 | ||
1379 | QDate day = mSelectedDates[gx]; | 1379 | QDate day = mSelectedDates[gx]; |
1380 | 1380 | ||
1381 | QTime time = mAgenda->gyToTime(gy); | 1381 | QTime time = mAgenda->gyToTime(gy); |
1382 | QDateTime dt(day,time); | 1382 | QDateTime dt(day,time); |
1383 | // if ( dt < QDateTime::currentDateTime () ) | 1383 | // if ( dt < QDateTime::currentDateTime () ) |
1384 | // dt = QDateTime::currentDateTime ().addSecs( 3600 ); | 1384 | // dt = QDateTime::currentDateTime ().addSecs( 3600 ); |
1385 | emit newEventSignal(dt); | 1385 | emit newEventSignal(dt); |
1386 | } | 1386 | } |
1387 | 1387 | ||
1388 | void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) | 1388 | void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) |
1389 | { | 1389 | { |
1390 | if (!mSelectedDates.count()) return; | 1390 | if (!mSelectedDates.count()) return; |
1391 | 1391 | ||
1392 | QDate dayStart = mSelectedDates[gxStart]; | 1392 | QDate dayStart = mSelectedDates[gxStart]; |
1393 | QDate dayEnd = mSelectedDates[gxEnd]; | 1393 | QDate dayEnd = mSelectedDates[gxEnd]; |
1394 | 1394 | ||
1395 | QTime timeStart = mAgenda->gyToTime(gyStart); | 1395 | QTime timeStart = mAgenda->gyToTime(gyStart); |
1396 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); | 1396 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); |
1397 | 1397 | ||
1398 | QDateTime dtStart(dayStart,timeStart); | 1398 | QDateTime dtStart(dayStart,timeStart); |
1399 | QDateTime dtEnd(dayEnd,timeEnd); | 1399 | QDateTime dtEnd(dayEnd,timeEnd); |
1400 | 1400 | ||
1401 | emit newEventSignal(dtStart,dtEnd); | 1401 | emit newEventSignal(dtStart,dtEnd); |
1402 | } | 1402 | } |
1403 | 1403 | ||
1404 | void KOAgendaView::newEventAllDay(int gx, int ) | 1404 | void KOAgendaView::newEventAllDay(int gx, int ) |
1405 | { | 1405 | { |
1406 | if (!mSelectedDates.count()) return; | 1406 | if (!mSelectedDates.count()) return; |
1407 | 1407 | ||
1408 | QDate day = mSelectedDates[gx]; | 1408 | QDate day = mSelectedDates[gx]; |
1409 | 1409 | ||
1410 | emit newEventSignal(day); | 1410 | emit newEventSignal(day); |
1411 | } | 1411 | } |
1412 | void KOAgendaView::newTodoAllDay(int gx, int ) | 1412 | void KOAgendaView::newTodoAllDay(int gx, int ) |
1413 | { | 1413 | { |
1414 | if (!mSelectedDates.count()) return; | 1414 | if (!mSelectedDates.count()) return; |
1415 | 1415 | ||
1416 | QDateTime day (mSelectedDates[gx] ); | 1416 | QDateTime day (mSelectedDates[gx] ); |
1417 | emit newTodoSignal(day, true); | 1417 | emit newTodoSignal(day, true); |
1418 | } | 1418 | } |
1419 | void KOAgendaView::newTodo(int gx, int gy ) | 1419 | void KOAgendaView::newTodo(int gx, int gy ) |
1420 | { | 1420 | { |
1421 | if (!mSelectedDates.count()) return; | 1421 | if (!mSelectedDates.count()) return; |
1422 | QDate dayStart = mSelectedDates[gx]; | 1422 | QDate dayStart = mSelectedDates[gx]; |
1423 | QTime timeStart = mAgenda->gyToTime(gy); | 1423 | QTime timeStart = mAgenda->gyToTime(gy); |
1424 | QDateTime dt (dayStart,timeStart); | 1424 | QDateTime dt (dayStart,timeStart); |
1425 | emit newTodoSignal( dt, false ); | 1425 | emit newTodoSignal( dt, false ); |
1426 | } | 1426 | } |
1427 | 1427 | ||
1428 | void KOAgendaView::updateEventIndicatorTop(int newY) | 1428 | void KOAgendaView::updateEventIndicatorTop(int newY) |
1429 | { | 1429 | { |
1430 | uint i; | 1430 | uint i; |
1431 | for(i=0;i<mMinY.size();++i) { | 1431 | for(i=0;i<mMinY.size();++i) { |
1432 | if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true); | 1432 | if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true); |
1433 | else mEventIndicatorTop->enableColumn(i,false); | 1433 | else mEventIndicatorTop->enableColumn(i,false); |
1434 | } | 1434 | } |
1435 | 1435 | ||
1436 | mEventIndicatorTop->update(); | 1436 | mEventIndicatorTop->update(); |
1437 | } | 1437 | } |
1438 | 1438 | ||
1439 | void KOAgendaView::updateEventIndicatorBottom(int newY) | 1439 | void KOAgendaView::updateEventIndicatorBottom(int newY) |
1440 | { | 1440 | { |
1441 | uint i; | 1441 | uint i; |
1442 | for(i=0;i<mMaxY.size();++i) { | 1442 | for(i=0;i<mMaxY.size();++i) { |
1443 | if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true); | 1443 | if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true); |
1444 | else mEventIndicatorBottom->enableColumn(i,false); | 1444 | else mEventIndicatorBottom->enableColumn(i,false); |
1445 | } | 1445 | } |
1446 | 1446 | ||
1447 | mEventIndicatorBottom->update(); | 1447 | mEventIndicatorBottom->update(); |
1448 | } | 1448 | } |
1449 | 1449 | ||
1450 | void KOAgendaView::startDrag(Event *event) | 1450 | void KOAgendaView::startDrag(Event *event) |
1451 | { | 1451 | { |
1452 | #ifndef KORG_NODND | 1452 | #ifndef KORG_NODND |
1453 | DndFactory factory( calendar() ); | 1453 | DndFactory factory( calendar() ); |
1454 | ICalDrag *vd = factory.createDrag(event,this); | 1454 | ICalDrag *vd = factory.createDrag(event,this); |
1455 | if (vd->drag()) { | 1455 | if (vd->drag()) { |
1456 | kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl; | 1456 | kdDebug() << "KOAgendaView::startDrag(): Delete drag source" << endl; |
1457 | } | 1457 | } |
1458 | #endif | 1458 | #endif |
1459 | } | 1459 | } |
1460 | 1460 | ||
1461 | void KOAgendaView::readSettings() | 1461 | void KOAgendaView::readSettings() |
1462 | { | 1462 | { |
1463 | readSettings(KOGlobals::config()); | 1463 | readSettings(KOGlobals::config()); |
1464 | } | 1464 | } |
1465 | 1465 | ||
1466 | void KOAgendaView::readSettings(KConfig *config) | 1466 | void KOAgendaView::readSettings(KConfig *config) |
1467 | { | 1467 | { |
1468 | // kdDebug() << "KOAgendaView::readSettings()" << endl; | 1468 | // kdDebug() << "KOAgendaView::readSettings()" << endl; |
1469 | 1469 | ||
1470 | config->setGroup("Views"); | 1470 | config->setGroup("Views"); |
1471 | 1471 | ||
1472 | //#ifndef KORG_NOSPLITTER | 1472 | //#ifndef KORG_NOSPLITTER |
1473 | QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); | 1473 | QValueList<int> sizes = config->readIntListEntry("Separator AgendaView"); |
1474 | if (sizes.count() == 2) { | 1474 | if (sizes.count() == 2) { |
1475 | if ( sizes[0] < 20 ) { | 1475 | if ( sizes[0] < 20 ) { |
1476 | sizes[1] = sizes[1] +20 - sizes[0]; | 1476 | sizes[1] = sizes[1] +20 - sizes[0]; |
1477 | sizes[0] = 20; | 1477 | sizes[0] = 20; |
1478 | } | 1478 | } |
1479 | mSplitterAgenda->setSizes(sizes); | 1479 | mSplitterAgenda->setSizes(sizes); |
1480 | // qDebug("read %d %d ",sizes[0],sizes[1] ); | 1480 | // qDebug("read %d %d ",sizes[0],sizes[1] ); |
1481 | } | 1481 | } |
1482 | //#endif | 1482 | //#endif |
1483 | 1483 | ||
1484 | // updateConfig(); | 1484 | // updateConfig(); |
1485 | } | 1485 | } |
1486 | 1486 | ||
1487 | void KOAgendaView::writeSettings(KConfig *config) | 1487 | void KOAgendaView::writeSettings(KConfig *config) |
1488 | { | 1488 | { |
1489 | // kdDebug() << "KOAgendaView::writeSettings()" << endl; | 1489 | // kdDebug() << "KOAgendaView::writeSettings()" << endl; |
1490 | 1490 | ||
1491 | config->setGroup("Views"); | 1491 | config->setGroup("Views"); |
1492 | 1492 | ||
1493 | //#ifndef KORG_NOSPLITTER | 1493 | //#ifndef KORG_NOSPLITTER |
1494 | QValueList<int> list = mSplitterAgenda->sizes(); | 1494 | QValueList<int> list = mSplitterAgenda->sizes(); |
1495 | config->writeEntry("Separator AgendaView",list); | 1495 | config->writeEntry("Separator AgendaView",list); |
1496 | //qDebug("write %d %d ", list[0],list[1] ); | 1496 | //qDebug("write %d %d ", list[0],list[1] ); |
1497 | //#endif | 1497 | //#endif |
1498 | } | 1498 | } |
1499 | 1499 | ||
1500 | void KOAgendaView::setHolidayMasks() | 1500 | void KOAgendaView::setHolidayMasks() |
1501 | { | 1501 | { |
1502 | mHolidayMask.resize(mSelectedDates.count()); | 1502 | mHolidayMask.resize(mSelectedDates.count()); |
1503 | 1503 | ||
1504 | uint i; | 1504 | uint i; |
1505 | for(i=0;i<mSelectedDates.count();++i) { | 1505 | for(i=0;i<mSelectedDates.count();++i) { |
1506 | QDate date = mSelectedDates[i]; | 1506 | QDate date = mSelectedDates[i]; |
1507 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); | 1507 | bool showSaturday = KOPrefs::instance()->mExcludeSaturdays && (date.dayOfWeek() == 6); |
1508 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); | 1508 | bool showSunday = KOPrefs::instance()->mExcludeHolidays && (date.dayOfWeek() == 7); |
1509 | bool showHoliday = false; | 1509 | bool showHoliday = false; |
1510 | if ( KOPrefs::instance()->mExcludeHolidays ) { | 1510 | if ( KOPrefs::instance()->mExcludeHolidays ) { |
1511 | QPtrList<Event> events = calendar()->events( date, true ); | 1511 | QPtrList<Event> events = calendar()->events( date, true ); |
1512 | Event *event; | 1512 | Event *event; |
1513 | for( event = events.first(); event; event = events.next() ) { | 1513 | for( event = events.first(); event; event = events.next() ) { |
1514 | if ( event->isHoliday()) { | 1514 | if ( event->isHoliday()) { |
1515 | showHoliday = true; | 1515 | showHoliday = true; |
1516 | break; | 1516 | break; |
1517 | } | 1517 | } |
1518 | } | 1518 | } |
1519 | 1519 | ||
1520 | } | 1520 | } |
1521 | 1521 | ||
1522 | #ifndef KORG_NOPLUGINS | 1522 | #ifndef KORG_NOPLUGINS |
1523 | bool showHoliday = KOPrefs::instance()->mExcludeHolidays && | 1523 | bool showHoliday = KOPrefs::instance()->mExcludeHolidays && |
1524 | !KOCore::self()->holiday(date).isEmpty(); | 1524 | !KOCore::self()->holiday(date).isEmpty(); |
1525 | #endif | 1525 | #endif |
1526 | bool showDay = showSaturday || showSunday || showHoliday; | 1526 | bool showDay = showSaturday || showSunday || showHoliday; |
1527 | 1527 | ||
1528 | if (showDay) { | 1528 | if (showDay) { |
1529 | mHolidayMask.at(i) = true; | 1529 | mHolidayMask.at(i) = true; |
1530 | } else { | 1530 | } else { |
1531 | mHolidayMask.at(i) = false; | 1531 | mHolidayMask.at(i) = false; |
1532 | } | 1532 | } |
1533 | } | 1533 | } |
1534 | 1534 | ||
1535 | mAgenda->setHolidayMask(&mHolidayMask); | 1535 | mAgenda->setHolidayMask(&mHolidayMask); |
1536 | mAllDayAgenda->setHolidayMask(&mHolidayMask); | 1536 | mAllDayAgenda->setHolidayMask(&mHolidayMask); |
1537 | } | 1537 | } |
1538 | 1538 | ||
1539 | void KOAgendaView::setContentsPos(int y) | 1539 | void KOAgendaView::setContentsPos(int y) |
1540 | { | 1540 | { |
1541 | mAgenda->setContentsPos(0,y); | 1541 | mAgenda->setContentsPos(0,y); |
1542 | } | 1542 | } |
1543 | 1543 | ||
1544 | void KOAgendaView::clearSelection() | 1544 | void KOAgendaView::clearSelection() |
1545 | { | 1545 | { |
1546 | mAgenda->deselectItem(); | 1546 | mAgenda->deselectItem(); |
1547 | mAllDayAgenda->deselectItem(); | 1547 | mAllDayAgenda->deselectItem(); |
1548 | } | 1548 | } |
1549 | 1549 | ||
1550 | void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart, | 1550 | void KOAgendaView::newTimeSpanSelectedAllDay(int gxStart, int gyStart, |
1551 | int gxEnd, int gyEnd) | 1551 | int gxEnd, int gyEnd) |
1552 | { | 1552 | { |
1553 | mTimeSpanInAllDay = true; | 1553 | mTimeSpanInAllDay = true; |
1554 | newTimeSpanSelected(gxStart,gyStart,gxEnd,gyEnd); | 1554 | newTimeSpanSelected(gxStart,gyStart,gxEnd,gyEnd); |
1555 | } | 1555 | } |
1556 | 1556 | ||
1557 | 1557 | ||
1558 | 1558 | ||
1559 | 1559 | ||
1560 | void KOAgendaView::newTimeSpanSelected(int gxStart, int gyStart, | 1560 | void KOAgendaView::newTimeSpanSelected(int gxStart, int gyStart, |
1561 | int gxEnd, int gyEnd) | 1561 | int gxEnd, int gyEnd) |
1562 | { | 1562 | { |
1563 | if (!mSelectedDates.count()) return; | 1563 | if (!mSelectedDates.count()) return; |
1564 | 1564 | ||
1565 | QDate dayStart = mSelectedDates[gxStart]; | 1565 | QDate dayStart = mSelectedDates[gxStart]; |
1566 | QDate dayEnd = mSelectedDates[gxEnd]; | 1566 | QDate dayEnd = mSelectedDates[gxEnd]; |
1567 | 1567 | ||
1568 | QTime timeStart = mAgenda->gyToTime(gyStart); | 1568 | QTime timeStart = mAgenda->gyToTime(gyStart); |
1569 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); | 1569 | QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); |
1570 | 1570 | ||
1571 | QDateTime dtStart(dayStart,timeStart); | 1571 | QDateTime dtStart(dayStart,timeStart); |
1572 | QDateTime dtEnd(dayEnd,timeEnd); | 1572 | QDateTime dtEnd(dayEnd,timeEnd); |
1573 | 1573 | ||
1574 | mTimeSpanBegin = dtStart; | 1574 | mTimeSpanBegin = dtStart; |
1575 | mTimeSpanEnd = dtEnd; | 1575 | mTimeSpanEnd = dtEnd; |
1576 | 1576 | ||
1577 | } | 1577 | } |
1578 | 1578 | ||
1579 | void KOAgendaView::deleteSelectedDateTime() | 1579 | void KOAgendaView::deleteSelectedDateTime() |
1580 | { | 1580 | { |
1581 | mTimeSpanBegin.setDate(QDate()); | 1581 | mTimeSpanBegin.setDate(QDate()); |
1582 | mTimeSpanEnd.setDate(QDate()); | 1582 | mTimeSpanEnd.setDate(QDate()); |
1583 | mTimeSpanInAllDay = false; | 1583 | mTimeSpanInAllDay = false; |
1584 | } | 1584 | } |
1585 | 1585 | ||
1586 | void KOAgendaView::keyPressEvent ( QKeyEvent * e ) | 1586 | void KOAgendaView::keyPressEvent ( QKeyEvent * e ) |
1587 | { | 1587 | { |
1588 | e->ignore(); | 1588 | e->ignore(); |
1589 | } | 1589 | } |
1590 | 1590 | ||
1591 | void KOAgendaView::scrollOneHourUp() | 1591 | void KOAgendaView::scrollOneHourUp() |
1592 | { | 1592 | { |
1593 | 1593 | ||
1594 | mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 ); | 1594 | mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 ); |
1595 | } | 1595 | } |
1596 | void KOAgendaView::scrollOneHourDown() | 1596 | void KOAgendaView::scrollOneHourDown() |
1597 | { | 1597 | { |
1598 | mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 ); | 1598 | mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 ); |
1599 | } | 1599 | } |
1600 | 1600 | ||
1601 | void KOAgendaView::setStartHour( int h ) | 1601 | void KOAgendaView::setStartHour( int h ) |
1602 | { | 1602 | { |
1603 | mAgenda->setStartHour( h ); | 1603 | mAgenda->setStartHour( h ); |
1604 | 1604 | ||
1605 | } | 1605 | } |
1606 | void KOAgendaView::setInitStartHour() | 1606 | void KOAgendaView::setInitStartHour() |
1607 | { | 1607 | { |
1608 | 1608 | ||
1609 | if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 1609 | if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
1610 | setStartHour( QTime::currentTime ().hour() ); | 1610 | setStartHour( QTime::currentTime ().hour() ); |
1611 | else | 1611 | else |
1612 | setStartHour( KOPrefs::instance()->mDayBegins ); | 1612 | setStartHour( KOPrefs::instance()->mDayBegins ); |
1613 | 1613 | ||
1614 | } | 1614 | } |
1615 | 1615 | ||
1616 | 1616 | ||
1617 | void KOAgendaView::updateTodo( Todo * t, int ) | 1617 | void KOAgendaView::updateTodo( Todo * t, int ) |
1618 | { | 1618 | { |
1619 | if ( !isVisible() ) | 1619 | if ( !isVisible() ) |
1620 | return; | 1620 | return; |
1621 | bool remove = false; | 1621 | bool remove = false; |
1622 | bool removeAD = false; | 1622 | bool removeAD = false; |
1623 | QDate da; | 1623 | QDate da; |
1624 | if ( t->hasCompletedDate() ) | 1624 | if ( t->hasCompletedDate() ) |
1625 | da = t->completed().date(); | 1625 | da = t->completed().date(); |
1626 | else | 1626 | else |
1627 | da = t->dtDue().date(); | 1627 | da = t->dtDue().date(); |
1628 | if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { | 1628 | if ( ! t->hasDueDate() && !t->hasCompletedDate() ) { |
1629 | remove = true; | 1629 | remove = true; |
1630 | removeAD = true; | 1630 | removeAD = true; |
1631 | } | 1631 | } |
1632 | else { | 1632 | else { |
1633 | bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; | 1633 | bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ; |
1634 | if ( overdue && | 1634 | if ( overdue && |
1635 | QDate::currentDate() >= mSelectedDates.first() && | 1635 | QDate::currentDate() >= mSelectedDates.first() && |
1636 | QDate::currentDate() <= mSelectedDates.last()) { | 1636 | QDate::currentDate() <= mSelectedDates.last()) { |
1637 | removeAD = false; | 1637 | removeAD = false; |
1638 | remove = true; | 1638 | remove = true; |
1639 | } | 1639 | } |
1640 | else { | 1640 | else { |
1641 | 1641 | ||
1642 | if ( da < mSelectedDates.first() || | 1642 | if ( da < mSelectedDates.first() || |
1643 | da > mSelectedDates.last() ) { | 1643 | da > mSelectedDates.last() ) { |
1644 | remove = true; | 1644 | remove = true; |
1645 | removeAD = true; | 1645 | removeAD = true; |
1646 | } else { | 1646 | } else { |
1647 | remove = t->doesFloat() && !t->hasCompletedDate(); | 1647 | remove = t->doesFloat() && !t->hasCompletedDate(); |
1648 | removeAD = !remove; | 1648 | removeAD = !remove; |
1649 | } | 1649 | } |
1650 | } | 1650 | } |
1651 | } | 1651 | } |
1652 | int days = mSelectedDates.first().daysTo( da ); | 1652 | int days = mSelectedDates.first().daysTo( da ); |
1653 | //qDebug("daysto %d %d %d", days, remove,removeAD ); | 1653 | //qDebug("daysto %d %d %d", days, remove,removeAD ); |
1654 | mAgenda->updateTodo( t , days, remove); | 1654 | mAgenda->updateTodo( t , days, remove); |
1655 | if ( KOPrefs::instance()->mShowTodoInAgenda ) | 1655 | if ( KOPrefs::instance()->mShowTodoInAgenda ) |
1656 | mAllDayAgenda->updateTodo( t , days, removeAD); | 1656 | mAllDayAgenda->updateTodo( t , days, removeAD); |
1657 | //qDebug("KOAgendaView::updateTodo( Todo *, int ) "); | 1657 | //qDebug("KOAgendaView::updateTodo( Todo *, int ) "); |
1658 | 1658 | ||
1659 | } | 1659 | } |