summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile613
-rw-r--r--microkde/kdeui/kmainwindow.cpp1
-rw-r--r--microkde/kdeui/kmainwindow.h5
-rw-r--r--pwmanager/pwmanager/getmasterpwwnd_emb.cpp2
-rw-r--r--pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp4
-rw-r--r--pwmanager/pwmanager/libgcryptif.cpp5
-rw-r--r--pwmanager/pwmanager/main.cpp1
-rw-r--r--pwmanager/pwmanager/pwm.cpp10
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp1
-rw-r--r--pwmanager/pwmanager/pwmdocui.cpp15
-rw-r--r--pwmanager/pwmanager/pwminit.cpp17
11 files changed, 296 insertions, 378 deletions
diff --git a/Makefile b/Makefile
index da5feba..19e1685 100644
--- a/Makefile
+++ b/Makefile
@@ -1,362 +1,253 @@
1export KDEPIMDIR = $(shell pwd) 1#############################################################################
2 2# Makefile for building: kdepim-desktop
3export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) 3# Generated by qmake (1.07a) (Qt 3.3.1) on: Mon Oct 25 11:25:22 2004
4 4# Project: kdepim-desktop.pro
5ifeq ($(PLATFORM) , zaurus) 5# Template: subdirs
6 BUILD_NO_LDAP_PLUGIN=1 6# Command: $(QMAKE) -o Makefile kdepim-desktop.pro
7endif 7#############################################################################
8 8
9ifneq ($(PLATFORM) , zaurus) 9 MAKEFILE =Makefile
10 BUILD_NO_SHARP_PLUGIN=1 10 QMAKE =qmake
11endif 11DEL_FILE = rm -f
12 12CHK_DIR_EXISTS= test -d
13SUBDIRS_MICROKDE = \ 13MKDIR = mkdir -p
14 libical/src/libical \ 14 SUBTARGETS = \
15 libical/src/libicalss \ 15 sub-gammu-emb-common \
16 qtcompat \ 16 sub-gammu-emb-gammu \
17 microkde \ 17 sub-libical \
18 libkcal \ 18 sub-libkcal \
19 libkdepim \ 19 sub-microkde \
20 kabc \ 20 sub-libkdepim \
21 kabc/formats/binary \ 21 sub-kabc \
22 kabc/plugins/file \ 22 sub-korganizer \
23 kabc/plugins/dir \ 23 sub-kaddressbook \
24 korganizer \ 24 sub-kabc-plugins-file \
25 kalarmd \ 25 sub-kabc-plugins-dir \
26 kaddressbook 26 sub-kabc-plugins-file \
27 27 sub-kabc-plugins-qtopia \
28SUBDIRS_QTOPIA_PLUGIN = \ 28 sub-pwmanager-libcrypt-cipher \
29 kabc/plugins/qtopia 29 sub-pwmanager-libcrypt-error \
30 30 sub-pwmanager-libcrypt-mpi \
31SUBDIRS_OPIE_PLUGIN = \ 31 sub-pwmanager-libcrypt-zlib \
32 kabc/plugins/opie 32 sub-pwmanager-pwmanager
33 33
34SUBDIRS_SHARP_PLUGIN = \ 34first: all
35 kabc/plugins/sharpdtm 35
36 36all: Makefile $(SUBTARGETS)
37SUBDIRS_LDAP_PLUGIN = \ 37
38 kabc/plugins/ldap 38gammu/emb/common/$(MAKEFILE):
39 39 @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common"
40SUBDIRS_MICROMAIL = \ 40 cd gammu/emb/common && $(QMAKE) common.pro -o $(MAKEFILE)
41 kmicromail/libetpan \ 41sub-gammu-emb-common: gammu/emb/common/$(MAKEFILE) FORCE
42 kmicromail/libmailwrapper \ 42 cd gammu/emb/common && $(MAKE) -f $(MAKEFILE)
43 kmicromail 43
44 44gammu/emb/gammu/$(MAKEFILE):
45SUBDIRS_GAMMU = \ 45 @$(CHK_DIR_EXISTS) "gammu/emb/gammu" || $(MKDIR) "gammu/emb/gammu"
46 gammu/emb/common \ 46 cd gammu/emb/gammu && $(QMAKE) gammu.pro -o $(MAKEFILE)
47 gammu/emb/gammu 47sub-gammu-emb-gammu: gammu/emb/gammu/$(MAKEFILE) FORCE
48 48 cd gammu/emb/gammu && $(MAKE) -f $(MAKEFILE)
49SUBDIRS_PWMANAGER = \ 49
50 pwmanager/libcrypt/mpi \ 50libical/$(MAKEFILE):
51 pwmanager/libcrypt/error \ 51 @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical"
52 pwmanager/libcrypt/cipher \ 52 cd libical && $(QMAKE) libical.pro -o $(MAKEFILE)
53 pwmanager/libcrypt/zlib \ 53sub-libical: libical/$(MAKEFILE) FORCE
54 pwmanager/pwmanager 54 cd libical && $(MAKE) -f $(MAKEFILE)
55 55
56SUBDIRS = \ 56libkcal/$(MAKEFILE):
57 $(SUBDIRS_MICROKDE) \ 57 @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal"
58 $(SUBDIRS_QTOPIA_PLUGIN) \ 58 cd libkcal && $(QMAKE) libkcal.pro -o $(MAKEFILE)
59 $(SUBDIRS_OPIE_PLUGIN) \ 59sub-libkcal: libkcal/$(MAKEFILE) FORCE
60 $(SUBDIRS_SHARP_PLUGIN) \ 60 cd libkcal && $(MAKE) -f $(MAKEFILE)
61 $(SUBDIRS_LDAP_PLUGIN) \ 61
62 $(SUBDIRS_MICROMAIL) \ 62microkde/$(MAKEFILE):
63 $(SUBDIRS_GAMMU) \ 63 @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde"
64 $(SUBDIRS_PWMANAGER) 64 cd microkde && $(QMAKE) microkde.pro -o $(MAKEFILE)
65 65sub-microkde: microkde/$(MAKEFILE) FORCE
66 66 cd microkde && $(MAKE) -f $(MAKEFILE)
67all: build_microkde \ 67
68 build_qtopia_plugin \ 68libkdepim/$(MAKEFILE):
69 build_opie_plugin \ 69 @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim"
70 build_sharp_plugin \ 70 cd libkdepim && $(QMAKE) libkdepim.pro -o $(MAKEFILE)
71 build_ldap_plugin \ 71sub-libkdepim: libkdepim/$(MAKEFILE) FORCE
72 build_micromail \ 72 cd libkdepim && $(MAKE) -f $(MAKEFILE)
73 build_gammu \ 73
74 build_pwmanager 74kabc/$(MAKEFILE):
75 75 @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc"
76 76 cd kabc && $(QMAKE) kabc.pro -o $(MAKEFILE)
77build_microkde: variable_test tmake 77sub-kabc: kabc/$(MAKEFILE) FORCE
78 for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ 78 cd kabc && $(MAKE) -f $(MAKEFILE)
79 make -f Makefile$(PLATFORM) || exit 1; popd; \ 79
80 done 80korganizer/$(MAKEFILE):
81 81 @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer"
82build_qtopia_plugin: build_microkde 82 cd korganizer && $(QMAKE) korganizer.pro -o $(MAKEFILE)
83 ifdef BUILD_NO_QTOPIA_PLUGIN 83sub-korganizer: korganizer/$(MAKEFILE) FORCE
84 @echo == qtopia plugin not build. 84 cd korganizer && $(MAKE) -f $(MAKEFILE)
85 else 85
86 for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ 86kaddressbook/$(MAKEFILE):
87 make -f Makefile$(PLATFORM) || exit 1; popd; \ 87 @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook"
88 done 88 cd kaddressbook && $(QMAKE) kaddressbook.pro -o $(MAKEFILE)
89 endif 89sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE
90 90 cd kaddressbook && $(MAKE) -f $(MAKEFILE)
91build_opie_plugin: build_microkde 91
92 ifdef BUILD_NO_OPIE_PLUGIN 92kabc/plugins/file/$(MAKEFILE):
93 @echo == opie plugin not build. 93 @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file"
94 else 94 cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE)
95 for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ 95sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE
96 make -f Makefile$(PLATFORM) || exit 1; popd; \ 96 cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE)
97 done 97
98 endif 98kabc/plugins/dir/$(MAKEFILE):
99 99 @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir"
100build_sharp_plugin: build_microkde 100 cd kabc/plugins/dir && $(QMAKE) dir.pro -o $(MAKEFILE)
101 ifdef BUILD_NO_SHARP_PLUGIN 101sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE
102 @echo == ldap plugin not build. 102 cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE)
103 else 103
104 for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ 104kabc/plugins/file/$(MAKEFILE):
105 make -f Makefile$(PLATFORM) || exit 1; popd; \ 105 @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file"
106 done 106 cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE)
107 endif 107sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE
108 108 cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE)
109build_ldap_plugin: build_microkde 109
110 ifdef BUILD_NO_LDAP_PLUGIN 110kabc/plugins/qtopia/$(MAKEFILE):
111 @echo == ldap plugin not build. 111 @$(CHK_DIR_EXISTS) "kabc/plugins/qtopia" || $(MKDIR) "kabc/plugins/qtopia"
112 else 112 cd kabc/plugins/qtopia && $(QMAKE) qtopia.pro -o $(MAKEFILE)
113 for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ 113sub-kabc-plugins-qtopia: kabc/plugins/qtopia/$(MAKEFILE) FORCE
114 make -f Makefile$(PLATFORM) || exit 1; popd; \ 114 cd kabc/plugins/qtopia && $(MAKE) -f $(MAKEFILE)
115 done 115
116 endif 116pwmanager/libcrypt/cipher/$(MAKEFILE):
117 117 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/cipher" || $(MKDIR) "pwmanager/libcrypt/cipher"
118 118 cd pwmanager/libcrypt/cipher && $(QMAKE) cipher.pro -o $(MAKEFILE)
119build_micromail: build_microkde 119sub-pwmanager-libcrypt-cipher: pwmanager/libcrypt/cipher/$(MAKEFILE) FORCE
120 ifdef BUILD_NO_MICROMAIL 120 cd pwmanager/libcrypt/cipher && $(MAKE) -f $(MAKEFILE)
121 @echo == kmicromail not build. 121
122 else 122pwmanager/libcrypt/error/$(MAKEFILE):
123 for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ 123 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/error" || $(MKDIR) "pwmanager/libcrypt/error"
124 make -f Makefile$(PLATFORM) || exit 1; popd; \ 124 cd pwmanager/libcrypt/error && $(QMAKE) error.pro -o $(MAKEFILE)
125 done 125sub-pwmanager-libcrypt-error: pwmanager/libcrypt/error/$(MAKEFILE) FORCE
126 endif 126 cd pwmanager/libcrypt/error && $(MAKE) -f $(MAKEFILE)
127 127
128build_gammu: variable_test tmake 128pwmanager/libcrypt/mpi/$(MAKEFILE):
129 ifdef BUILD_NO_GAMMU 129 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/mpi" || $(MKDIR) "pwmanager/libcrypt/mpi"
130 @echo == gammu not build. 130 cd pwmanager/libcrypt/mpi && $(QMAKE) mpi.pro -o $(MAKEFILE)
131 else 131sub-pwmanager-libcrypt-mpi: pwmanager/libcrypt/mpi/$(MAKEFILE) FORCE
132 for i in $(SUBDIRS_GAMMU); do pushd $$i; \ 132 cd pwmanager/libcrypt/mpi && $(MAKE) -f $(MAKEFILE)
133 make -f Makefile$(PLATFORM) || exit 1; popd; \ 133
134 done 134pwmanager/libcrypt/zlib/$(MAKEFILE):
135 endif 135 @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/zlib" || $(MKDIR) "pwmanager/libcrypt/zlib"
136 136 cd pwmanager/libcrypt/zlib && $(QMAKE) zlib.pro -o $(MAKEFILE)
137build_pwmanager: build_microkde 137sub-pwmanager-libcrypt-zlib: pwmanager/libcrypt/zlib/$(MAKEFILE) FORCE
138 ifdef BUILD_NO_PWMANAGER 138 cd pwmanager/libcrypt/zlib && $(MAKE) -f $(MAKEFILE)
139 @echo == pwmanager not build. 139
140 else 140pwmanager/pwmanager/$(MAKEFILE):
141 for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ 141 @$(CHK_DIR_EXISTS) "pwmanager/pwmanager" || $(MKDIR) "pwmanager/pwmanager"
142 make -f Makefile$(PLATFORM) || exit 1; popd; \ 142 cd pwmanager/pwmanager && $(QMAKE) pwmanager.pro -o $(MAKEFILE)
143 done 143sub-pwmanager-pwmanager: pwmanager/pwmanager/$(MAKEFILE) FORCE
144 endif 144 cd pwmanager/pwmanager && $(MAKE) -f $(MAKEFILE)
145 145
146 146Makefile: kdepim-desktop.pro /usr/lib/qt3/mkspecs/default/qmake.conf
147variable_info: 147 $(QMAKE) -o Makefile kdepim-desktop.pro
148 @echo -------------------------------------- 148qmake: qmake_all
149 @echo KDEPIM buildsystem, variableinfo... 149 @$(QMAKE) -o Makefile kdepim-desktop.pro
150 @echo KDEPIMDIR=$(KDEPIMDIR) 150
151 @echo QTDIR=$(QTDIR) 151all: $(SUBTARGETS)
152 @echo QPEDIR=$(QPEDIR) 152qmake_all: gammu/emb/common/$(MAKEFILE) gammu/emb/gammu/$(MAKEFILE) libical/$(MAKEFILE) libkcal/$(MAKEFILE) microkde/$(MAKEFILE) libkdepim/$(MAKEFILE) kabc/$(MAKEFILE) korganizer/$(MAKEFILE) kaddressbook/$(MAKEFILE) kabc/plugins/file/$(MAKEFILE) kabc/plugins/dir/$(MAKEFILE) kabc/plugins/file/$(MAKEFILE) kabc/plugins/qtopia/$(MAKEFILE) pwmanager/libcrypt/cipher/$(MAKEFILE) pwmanager/libcrypt/error/$(MAKEFILE) pwmanager/libcrypt/mpi/$(MAKEFILE) pwmanager/libcrypt/zlib/$(MAKEFILE) pwmanager/pwmanager/$(MAKEFILE)
153 @echo OPIEDIR=$(OPIEDIR) 153 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
154 @echo PLATFORM=$(PLATFORM) 154 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
155 @echo RELEASE_DEBUG=$(RELEASE_DEBUG) 155 ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
156 @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) 156 ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
157 @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) 157 ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
158 @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) 158 ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
159 @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) 159 ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
160 @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) 160 ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
161 ifndef BUILD_NO_SHARP_PLUGIN 161 ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
162 @echo SHARPDTMSDK=$(SHARPDTMSDK) 162 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
163 endif 163 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
164 @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) 164 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
165 @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) 165 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
166 @echo -------------------------------------- 166 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
167 167 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
168variable_test: variable_info 168 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
169 @echo KDEPIM buildsystem, variablecheck... 169 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
170 ifndef KDEPIMDIR 170 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true
171 @echo KDEPIMDIR is not defined. 171clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE
172 $(error KDEPIMDIR is not defined) 172 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; ) || true
173 endif 173 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; ) || true
174 ifndef PLATFORM 174 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true
175 @echo PLATFORM is not defined. 175 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true
176 $(error PLATFORM is not defined) 176 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true
177 endif 177 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true
178 ifdef BUILD_NO_LDAP_PLUGIN 178 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true
179 @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) 179 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true
180 endif 180 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true
181 ifdef BUILD_NO_OPIE_PLUGIN 181 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true
182 @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) 182 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true
183 endif 183 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true
184 ifdef BUILD_NO_QTOPIA_PLUGIN 184 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; ) || true
185 @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) 185 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; ) || true
186 endif 186 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; ) || true
187 ifdef BUILD_NO_MICROMAIL 187 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; ) || true
188 @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) 188 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; ) || true
189 endif 189 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; ) || true
190 ifdef BUILD_NO_SHARP_PLUGIN 190uninstall_subdirs: qmake_all FORCE
191 @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) 191 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
192 else 192 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
193 ifndef SHARPDTMSDK 193 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
194 @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) 194 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
195 $(error SHARPDTMSDK is not defined) 195 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
196 endif 196 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
197 endif 197 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
198 ifdef BUILD_NO_GAMMU 198 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
199 @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) 199 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
200 endif 200 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
201 ifdef BUILD_NO_PWMANAGER 201 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
202 @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) 202 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
203 endif 203 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
204 @echo -------------------------------------- 204 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
205 205 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
206 206 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
207objects: 207 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
208 for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done 208 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true
209 for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done 209install_subdirs: qmake_all FORCE
210 mkdir -p libical/lib/$(PLATFORM) 210 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true
211 mkdir -p pwmanager/libcrypt/$(PLATFORM) 211 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) install; ) || true
212 212 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true
213clean: 213 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true
214 rm -rf libical/lib/$(PLATFORM)/*; 214 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true
215 rm -rf pwmanager/libcrypt/$(PLATFORM)/*; 215 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true
216 for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ 216 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true
217 rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ 217 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true
218 done 218 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true
219 219 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true
220install: 220 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true
221 221 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true
222 cd bin/kdepim; make install 222 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) install; ) || true
223 cp -r Pim $(QPEDIR)/apps 223 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) install; ) || true
224 cp db2file/db2file $(QPEDIR)/bin/db2file 224 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) install; ) || true
225 cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop 225 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) install; ) || true
226 cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop 226 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) install; ) || true
227 cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop 227 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) install; ) || true
228 cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop 228distclean: qmake_all FORCE
229 229 ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
230dist: 230 ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
231 @echo Dont forget to do "make install" before "make dist" 231 ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
232 rm -f *arm.ipk 232 ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
233 rm -f *~ 233 ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
234 cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim 234 ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
235 mkipks kmicrokdelibs.control 235 ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
236 mkipks korganizer.control 236 ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
237 mkipks kaddressbook.control 237 ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
238 ifndef BUILD_NO_MICROMAIL 238 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
239 mkipks kopiemail.control 239 ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
240 endif 240 ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
241 mkipks korganizer-alarm.control 241 ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
242 ifndef BUILD_NO_GAMMU 242 ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
243 mkipks phoneaccess.control 243 ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
244 endif 244 ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
245 ifndef BUILD_NO_PWMANAGER 245 ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
246 mkipks pwmanager.control 246 ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true
247 endif 247
248 mkipks pim_TAB_icon.control 248install: install_subdirs
249 249
250tmake: objects \ 250uninstall: uninstall_subdirs
251 qtcompat/Makefile$(PLATFORM) \ 251
252 microkde/Makefile$(PLATFORM) \ 252FORCE:
253 libkcal/Makefile$(PLATFORM) \
254 libkdepim/Makefile$(PLATFORM) \
255 korganizer/Makefile$(PLATFORM) \
256 kalarmd/Makefile$(PLATFORM) \
257 libical/src/libical/Makefile$(PLATFORM) \
258 libical/src/libicalss/Makefile$(PLATFORM) \
259 kabc/Makefile$(PLATFORM) \
260 kabc/formats/binary/Makefile$(PLATFORM) \
261 kabc/plugins/file/Makefile$(PLATFORM) \
262 kabc/plugins/dir/Makefile$(PLATFORM) \
263 kabc/plugins/ldap/Makefile$(PLATFORM) \
264 kabc/plugins/opie/Makefile$(PLATFORM) \
265 kabc/plugins/qtopia/Makefile$(PLATFORM) \
266 kabc/plugins/sharpdtm/Makefile$(PLATFORM) \
267 kaddressbook/Makefile$(PLATFORM) \
268 kmicromail/Makefile$(PLATFORM) \
269 kmicromail/libetpan/Makefile$(PLATFORM) \
270 kmicromail/libmailwrapper/Makefile$(PLATFORM) \
271 gammu/emb/common/Makefile$(PLATFORM) \
272 gammu/emb/gammu/Makefile$(PLATFORM) \
273 pwmanager/pwmanager/Makefile$(PLATFORM) \
274 pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \
275 pwmanager/libcrypt/error/Makefile$(PLATFORM) \
276 pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \
277 pwmanager/libcrypt/zlib/Makefile$(PLATFORM)
278
279qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro
280 cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM)
281
282microkde/Makefile$(PLATFORM): microkde/microkdeE.pro
283 cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM)
284
285libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro
286 cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM)
287
288
289libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro
290 cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM)
291
292kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro
293 cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM)
294
295korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro
296 cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM)
297
298libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro
299 cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM)
300
301libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro
302 cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM)
303
304kabc/Makefile$(PLATFORM): kabc/kabcE.pro
305 cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM)
306
307kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro
308 cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM)
309
310kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro
311 cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM)
312
313kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro
314 cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM)
315
316kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro
317 cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM)
318
319kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro
320 cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM)
321
322kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro
323 cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM)
324
325kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro
326 cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM)
327
328kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro
329 cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM)
330
331kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro
332 cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM)
333
334kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro
335 cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM)
336
337kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro
338 cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM)
339
340gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro
341 cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM)
342
343gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro
344 cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM)
345
346pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro
347 cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM)
348
349
350pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro
351 cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM)
352
353pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro
354 cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM)
355
356pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro
357 cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM)
358
359pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro
360 cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM)
361
362 253
diff --git a/microkde/kdeui/kmainwindow.cpp b/microkde/kdeui/kmainwindow.cpp
index bd5a2cc..3ae4c87 100644
--- a/microkde/kdeui/kmainwindow.cpp
+++ b/microkde/kdeui/kmainwindow.cpp
@@ -207,192 +207,193 @@ KAction *KMainWindow::toolBarMenuAction()
207 207
208bool KMainWindow::canBeRestored( int number ) 208bool KMainWindow::canBeRestored( int number )
209{ 209{
210/*US we do not have and want to save sessioninformation. Use info from the default 210/*US we do not have and want to save sessioninformation. Use info from the default
211application config. 211application config.
212*/ 212*/
213//US if ( !kapp->isRestored() ) 213//US if ( !kapp->isRestored() )
214//US return FALSE; 214//US return FALSE;
215//US KConfig *config = kapp->sessionConfig(); 215//US KConfig *config = kapp->sessionConfig();
216 KConfig *config = KGlobal::config(); 216 KConfig *config = KGlobal::config();
217 if ( !config ) 217 if ( !config )
218 return FALSE; 218 return FALSE;
219 config->setGroup( QString::fromLatin1("Number") ); 219 config->setGroup( QString::fromLatin1("Number") );
220 int n = config->readNumEntry( QString::fromLatin1("NumberOfWindows") , 1 ); 220 int n = config->readNumEntry( QString::fromLatin1("NumberOfWindows") , 1 );
221 return number >= 1 && number <= n; 221 return number >= 1 && number <= n;
222 222
223} 223}
224 224
225const QString KMainWindow::classNameOfToplevel( int number ) 225const QString KMainWindow::classNameOfToplevel( int number )
226{ 226{
227/*US we do not have and want to save sessioninformation. Use info from the default 227/*US we do not have and want to save sessioninformation. Use info from the default
228application config. 228application config.
229*/ 229*/
230//US if ( !kapp->isRestored() ) 230//US if ( !kapp->isRestored() )
231//US return QString::null; 231//US return QString::null;
232//US KConfig *config = kapp->sessionConfig(); 232//US KConfig *config = kapp->sessionConfig();
233 KConfig *config = KGlobal::config(); 233 KConfig *config = KGlobal::config();
234 if ( !config ) 234 if ( !config )
235 return QString::null; 235 return QString::null;
236 QString s; 236 QString s;
237 s.setNum( number ); 237 s.setNum( number );
238 s.prepend( QString::fromLatin1("WindowProperties") ); 238 s.prepend( QString::fromLatin1("WindowProperties") );
239 config->setGroup( s ); 239 config->setGroup( s );
240 if ( !config->hasKey( QString::fromLatin1("ClassName") ) ) 240 if ( !config->hasKey( QString::fromLatin1("ClassName") ) )
241 return QString::null; 241 return QString::null;
242 else 242 else
243 return config->readEntry( QString::fromLatin1("ClassName") ); 243 return config->readEntry( QString::fromLatin1("ClassName") );
244} 244}
245 245
246bool KMainWindow::restore( int number, bool show ) 246bool KMainWindow::restore( int number, bool show )
247{ 247{
248/*US we do not have and want to save sessioninformation. Use info from the default 248/*US we do not have and want to save sessioninformation. Use info from the default
249application config. 249application config.
250*/ 250*/
251 if ( !canBeRestored( number ) ) 251 if ( !canBeRestored( number ) )
252 return FALSE; 252 return FALSE;
253//US KConfig *config = kapp->sessionConfig(); 253//US KConfig *config = kapp->sessionConfig();
254 KConfig *config = KGlobal::config(); 254 KConfig *config = KGlobal::config();
255 255
256 if ( readPropertiesInternal( config, number ) ){ 256 if ( readPropertiesInternal( config, number ) ){
257 if ( show ) 257 if ( show )
258 KMainWindow::show(); 258 KMainWindow::show();
259 return FALSE; 259 return FALSE;
260 } 260 }
261 return FALSE; 261 return FALSE;
262 262
263} 263}
264 264
265void KMainWindow::setCaption( const QString &caption ) 265void KMainWindow::setCaption( const QString &caption )
266{ 266{
267//US setPlainCaption( kapp->makeStdCaption(caption) ); 267//US setPlainCaption( kapp->makeStdCaption(caption) );
268 setPlainCaption( caption ); 268 setPlainCaption( caption );
269} 269}
270 270
271void KMainWindow::setCaption( const QString &caption, bool modified ) 271void KMainWindow::setCaption( const QString &caption, bool modified )
272{ 272{
273//US setPlainCaption( kapp->makeStdCaption(caption, true, modified) ); 273//US setPlainCaption( kapp->makeStdCaption(caption, true, modified) );
274 setPlainCaption( caption + "modified:" ); 274 setPlainCaption( caption + "modified:" );
275} 275}
276 276
277void KMainWindow::setPlainCaption( const QString &caption ) 277void KMainWindow::setPlainCaption( const QString &caption )
278{ 278{
279 QMainWindow::setCaption( caption ); 279 QMainWindow::setCaption( caption );
280#ifndef Q_WS_QWS 280#ifndef Q_WS_QWS
281//US the following is disabled for the embedded version 281//US the following is disabled for the embedded version
282//US NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 ); 282//US NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 );
283//US info.setName( caption.utf8().data() ); 283//US info.setName( caption.utf8().data() );
284#endif 284#endif
285} 285}
286 286
287void KMainWindow::slotStateChanged(const QString &newstate) 287void KMainWindow::slotStateChanged(const QString &newstate)
288{ 288{
289 stateChanged(newstate, KXMLGUIClient::StateNoReverse); 289 stateChanged(newstate, KXMLGUIClient::StateNoReverse);
290} 290}
291 291
292/* 292/*
293 * Get rid of this for KDE 4.0 293 * Get rid of this for KDE 4.0
294 */ 294 */
295void KMainWindow::slotStateChanged(const QString &newstate, 295void KMainWindow::slotStateChanged(const QString &newstate,
296 KXMLGUIClient::ReverseStateChange reverse) 296 KXMLGUIClient::ReverseStateChange reverse)
297{ 297{
298 stateChanged(newstate, reverse); 298 stateChanged(newstate, reverse);
299} 299}
300 300
301void KMainWindow::closeEvent ( QCloseEvent *e ) 301void KMainWindow::closeEvent ( QCloseEvent *e )
302{ 302{
303 //qDebug("MainWindow::closeEvent ");
303 // Save settings if auto-save is enabled, and settings have changed 304 // Save settings if auto-save is enabled, and settings have changed
304 if (d->settingsDirty && d->autoSaveSettings) 305 if (d->settingsDirty && d->autoSaveSettings)
305 saveAutoSaveSettings(); 306 saveAutoSaveSettings();
306 307
307 if (queryClose()) { 308 if (queryClose()) {
308 e->accept(); 309 e->accept();
309 310
310 int not_withdrawn = 0; 311 int not_withdrawn = 0;
311/*US 312/*US
312 QPtrListIterator<KMainWindow> it(*KMainWindow::memberList); 313 QPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
313 for (it.toFirst(); it.current(); ++it){ 314 for (it.toFirst(); it.current(); ++it){
314 if ( !it.current()->isHidden() && it.current()->isTopLevel() && it.current() != this ) 315 if ( !it.current()->isHidden() && it.current()->isTopLevel() && it.current() != this )
315 not_withdrawn++; 316 not_withdrawn++;
316 } 317 }
317*/ 318*/
318 if ( !no_query_exit && not_withdrawn <= 0 ) { // last window close accepted? 319 if ( !no_query_exit && not_withdrawn <= 0 ) { // last window close accepted?
319/*US 320/*US
320 if ( queryExit() && !kapp->sessionSaving()) { // Yes, Quit app? 321 if ( queryExit() && !kapp->sessionSaving()) { // Yes, Quit app?
321 // don't call queryExit() twice 322 // don't call queryExit() twice
322 disconnect(kapp, SIGNAL(shutDown()), this, SLOT(shuttingDown())); 323 disconnect(kapp, SIGNAL(shutDown()), this, SLOT(shuttingDown()));
323 kapp->deref(); // ...and quit aplication. 324 kapp->deref(); // ...and quit aplication.
324 } else { 325 } else {
325 // cancel closing, it's stupid to end up with no windows at all.... 326 // cancel closing, it's stupid to end up with no windows at all....
326 e->ignore(); 327 e->ignore();
327 } 328 }
328*/ 329*/
329//US we have no sessionmanagement. Simply close app. 330//US we have no sessionmanagement. Simply close app.
330 if ( queryExit() ) { // Yes, Quit app? 331 if ( queryExit() ) { // Yes, Quit app?
331 qDebug("KMainWindow::closeEvent: Exit application ???"); 332 qDebug("KMainWindow::closeEvent: Exit application ???");
332 // don't call queryExit() twice 333 // don't call queryExit() twice
333//US disconnect(kapp, SIGNAL(shutDown()), this, SLOT(shuttingDown())); 334//US disconnect(kapp, SIGNAL(shutDown()), this, SLOT(shuttingDown()));
334 } 335 }
335 336
336 } 337 }
337 } 338 }
338} 339}
339 340
340bool KMainWindow::queryExit() 341bool KMainWindow::queryExit()
341{ 342{
342 return TRUE; 343 return TRUE;
343} 344}
344 345
345bool KMainWindow::queryClose() 346bool KMainWindow::queryClose()
346{ 347{
347 return TRUE; 348 return TRUE;
348} 349}
349 350
350void KMainWindow::saveGlobalProperties( KConfig* ) 351void KMainWindow::saveGlobalProperties( KConfig* )
351{ 352{
352} 353}
353 354
354void KMainWindow::readGlobalProperties( KConfig* ) 355void KMainWindow::readGlobalProperties( KConfig* )
355{ 356{
356} 357}
357 358
358void KMainWindow::savePropertiesInternal( KConfig *config, int number ) 359void KMainWindow::savePropertiesInternal( KConfig *config, int number )
359{ 360{
360 bool oldASWS = d->autoSaveWindowSize; 361 bool oldASWS = d->autoSaveWindowSize;
361 d->autoSaveWindowSize = true; // make saveMainWindowSettings save the window size 362 d->autoSaveWindowSize = true; // make saveMainWindowSettings save the window size
362 363
363 QString s; 364 QString s;
364 s.setNum(number); 365 s.setNum(number);
365 s.prepend(QString::fromLatin1("WindowProperties")); 366 s.prepend(QString::fromLatin1("WindowProperties"));
366 config->setGroup(s); 367 config->setGroup(s);
367 368
368 // store objectName, className, Width and Height for later restoring 369 // store objectName, className, Width and Height for later restoring
369 // (Only useful for session management) 370 // (Only useful for session management)
370 config->writeEntry(QString::fromLatin1("ObjectName"), name()); 371 config->writeEntry(QString::fromLatin1("ObjectName"), name());
371 config->writeEntry(QString::fromLatin1("ClassName"), className()); 372 config->writeEntry(QString::fromLatin1("ClassName"), className());
372 373
373 saveMainWindowSettings(config); // Menubar, statusbar and Toolbar settings. 374 saveMainWindowSettings(config); // Menubar, statusbar and Toolbar settings.
374 375
375 s.setNum(number); 376 s.setNum(number);
376 config->setGroup(s); 377 config->setGroup(s);
377 saveProperties(config); 378 saveProperties(config);
378 379
379 d->autoSaveWindowSize = oldASWS; 380 d->autoSaveWindowSize = oldASWS;
380} 381}
381 382
382void KMainWindow::setStandardToolBarMenuEnabled( bool enable ) 383void KMainWindow::setStandardToolBarMenuEnabled( bool enable )
383{ 384{
384 if ( enable ) 385 if ( enable )
385 { 386 {
386 if ( d->toolBarHandler ) 387 if ( d->toolBarHandler )
387 return; 388 return;
388 389
389 d->toolBarHandler = new KDEPrivate::ToolBarHandler( this ); 390 d->toolBarHandler = new KDEPrivate::ToolBarHandler( this );
390 391
391/*US if ( factory() ) 392/*US if ( factory() )
392 factory()->addClient( d->toolBarHandler ); 393 factory()->addClient( d->toolBarHandler );
393*/ 394*/
394 } 395 }
395 else 396 else
396 { 397 {
397 if ( !d->toolBarHandler ) 398 if ( !d->toolBarHandler )
398 return; 399 return;
diff --git a/microkde/kdeui/kmainwindow.h b/microkde/kdeui/kmainwindow.h
index e76e732..2aafb9d 100644
--- a/microkde/kdeui/kmainwindow.h
+++ b/microkde/kdeui/kmainwindow.h
@@ -1,192 +1,193 @@
1/* 1/*
2 This file is part of the KDE libraries 2 This file is part of the KDE libraries
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation. 6 License version 2 as published by the Free Software Foundation.
7 7
8 This library is distributed in the hope that it will be useful, 8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of 9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details. 11 Library General Public License for more details.
12 12
13 You should have received a copy of the GNU Library General Public License 13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to 14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 15 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
16 Boston, MA 02111-1307, USA. 16 Boston, MA 02111-1307, USA.
17 17
18 $Id$ 18 $Id$
19 19
20*/ 20*/
21 21
22 22
23 23
24#ifndef KMAINWINDOW_H 24#ifndef KMAINWINDOW_H
25#define KMAINWINDOW_H 25#define KMAINWINDOW_H
26 26
27/*US 27/*US
28#include "kxmlguifactory.h" 28#include "kxmlguifactory.h"
29#include "kxmlguiclient.h" 29#include "kxmlguiclient.h"
30#include "kxmlguibuilder.h" 30#include "kxmlguibuilder.h"
31#include <qmetaobject.h> 31#include <qmetaobject.h>
32 32
33class KPopupMenu; 33class KPopupMenu;
34class KXMLGUIFactory; 34class KXMLGUIFactory;
35class KConfig; 35class KConfig;
36class KHelpMenu; 36class KHelpMenu;
37class KStatusBar; 37class KStatusBar;
38class QStatusBar; 38class QStatusBar;
39class KMenuBar; 39class KMenuBar;
40class KMWSessionManaged; 40class KMWSessionManaged;
41class KAccel; 41class KAccel;
42class KToolBarMenuAction; 42class KToolBarMenuAction;
43*/ 43*/
44 44
45class QMenuBar; 45class QMenuBar;
46class QStatusBar; 46class QStatusBar;
47class KMainWindowPrivate; 47class KMainWindowPrivate;
48class KAction; 48class KAction;
49 49
50#include <ktoolbar.h> 50#include <ktoolbar.h>
51#include <ktoolbarhandler.h> 51#include <ktoolbarhandler.h>
52#include <kxmlguiclient.h> 52#include <kxmlguiclient.h>
53#include <qmainwindow.h> 53#include <qmainwindow.h>
54#include <qptrlist.h> 54#include <qptrlist.h>
55 55
56class KActionCollection; 56class KActionCollection;
57 57
58class KMainWindow : public QMainWindow, virtual public KXMLGUIClient 58class KMainWindow : public QMainWindow, virtual public KXMLGUIClient
59{ 59{
60 Q_OBJECT 60 Q_OBJECT
61 61
62private: 62private:
63//US create private defaultconstructor 63//US create private defaultconstructor
64 KMainWindow() {;}; 64 KMainWindow() {;};
65 65
66public: 66
67public: 67public:
68 /** 68 /**
69 * Construct a main window. 69 * Construct a main window.
70 * 70 *
71 * @param parent The widget parent. This is usually 0 but it may also be the window 71 * @param parent The widget parent. This is usually 0 but it may also be the window
72 * group leader. In that case, the KMainWindow becomes sort of a 72 * group leader. In that case, the KMainWindow becomes sort of a
73 * secondary window. 73 * secondary window.
74 * 74 *
75 * @param name The object name. For session management and window management to work 75 * @param name The object name. For session management and window management to work
76 * properly, all main windows in the application should have a 76 * properly, all main windows in the application should have a
77 * different name. When passing 0 (the default), KMainWindow will create 77 * different name. When passing 0 (the default), KMainWindow will create
78 * a unique name, but it's recommended to explicitly pass a window name that will 78 * a unique name, but it's recommended to explicitly pass a window name that will
79 * also describe the type of the window. If there can be several windows of the same 79 * also describe the type of the window. If there can be several windows of the same
80 * type, append '#' (hash) to the name, and KMainWindow will append numbers to make 80 * type, append '#' (hash) to the name, and KMainWindow will append numbers to make
81 * the names unique. For example, for a mail client which has one main window showing 81 * the names unique. For example, for a mail client which has one main window showing
82 * the mails and folders, and which can also have one or more windows for composing 82 * the mails and folders, and which can also have one or more windows for composing
83 * mails, the name for the folders window should be e.g. "mainwindow" and 83 * mails, the name for the folders window should be e.g. "mainwindow" and
84 * for the composer windows "composer#". 84 * for the composer windows "composer#".
85 * 85 *
86 * @param f Specify the widget flags. The default is 86 * @param f Specify the widget flags. The default is
87 * WType_TopLevel and WDestructiveClose. TopLevel indicates that a 87 * WType_TopLevel and WDestructiveClose. TopLevel indicates that a
88 * main window is a toplevel window, regardless of whether it has a 88 * main window is a toplevel window, regardless of whether it has a
89 * parent or not. DestructiveClose indicates that a main window is 89 * parent or not. DestructiveClose indicates that a main window is
90 * automatically destroyed when its window is closed. Pass 0 if 90 * automatically destroyed when its window is closed. Pass 0 if
91 * you do not want this behavior. 91 * you do not want this behavior.
92 * 92 *
93 * KMainWindows must be created on the heap with 'new', like: 93 * KMainWindows must be created on the heap with 'new', like:
94 * <pre> KMainWindow *kmw = new KMainWindow (...</pre> 94 * <pre> KMainWindow *kmw = new KMainWindow (...</pre>
95 **/ 95 **/
96 KMainWindow( QWidget* parent = 0, const char *name = 0, WFlags f = WType_TopLevel | WDestructiveClose ); 96 //LR remove WDestructiveClose
97 KMainWindow( QWidget* parent = 0, const char *name = 0, WFlags f = WType_TopLevel /*| WDestructiveClose*/ );
97 98
98 99
99 /** 100 /**
100 * Destructor. 101 * Destructor.
101 * 102 *
102 * Will also destroy the toolbars, and menubar if 103 * Will also destroy the toolbars, and menubar if
103 * needed. 104 * needed.
104 */ 105 */
105 virtual ~KMainWindow(); 106 virtual ~KMainWindow();
106 107
107 /** 108 /**
108 * Retrieve the standard help menu. 109 * Retrieve the standard help menu.
109 * 110 *
110 * It contains entires for the 111 * It contains entires for the
111 * help system (activated by F1), an optional "What's This?" entry 112 * help system (activated by F1), an optional "What's This?" entry
112 * (activated by Shift F1), an application specific dialog box, 113 * (activated by Shift F1), an application specific dialog box,
113 * and an "About KDE" dialog box. 114 * and an "About KDE" dialog box.
114 * 115 *
115 * Example (adding a standard help menu to your application): 116 * Example (adding a standard help menu to your application):
116 * <pre> 117 * <pre>
117 * KPopupMenu *help = helpMenu( <myTextString> ); 118 * KPopupMenu *help = helpMenu( <myTextString> );
118 * menuBar()->insertItem( i18n("&Help"), help ); 119 * menuBar()->insertItem( i18n("&Help"), help );
119 * </pre> 120 * </pre>
120 * 121 *
121 * @param aboutAppText The string that is used in the application 122 * @param aboutAppText The string that is used in the application
122 * specific dialog box. If you leave this string empty the 123 * specific dialog box. If you leave this string empty the
123 * information in the global @ref KAboutData of the 124 * information in the global @ref KAboutData of the
124 * application will be used to make a standard dialog box. 125 * application will be used to make a standard dialog box.
125 * 126 *
126 * @param showWhatsThis Set this to false if you do not want to include 127 * @param showWhatsThis Set this to false if you do not want to include
127 * the "What's This" menu entry. 128 * the "What's This" menu entry.
128 * 129 *
129 * @return A standard help menu. 130 * @return A standard help menu.
130 */ 131 */
131//US KPopupMenu* helpMenu( const QString &aboutAppText = QString::null, 132//US KPopupMenu* helpMenu( const QString &aboutAppText = QString::null,
132//US bool showWhatsThis = TRUE ); 133//US bool showWhatsThis = TRUE );
133 134
134 /** 135 /**
135 * Returns the help menu. Creates a standard help menu if none exists yet. 136 * Returns the help menu. Creates a standard help menu if none exists yet.
136 * 137 *
137 * It contains entries for the 138 * It contains entries for the
138 * help system (activated by F1), an optional "What's This?" entry 139 * help system (activated by F1), an optional "What's This?" entry
139 * (activated by Shift F1), an application specific dialog box, 140 * (activated by Shift F1), an application specific dialog box,
140 * and an "About KDE" dialog box. You must create the application 141 * and an "About KDE" dialog box. You must create the application
141 * specific dialog box yourself. When the "About application" 142 * specific dialog box yourself. When the "About application"
142 * menu entry is activated, a signal will trigger the 143 * menu entry is activated, a signal will trigger the
143 * @ref showAboutApplication slot. See @ref showAboutApplication for more 144 * @ref showAboutApplication slot. See @ref showAboutApplication for more
144 * information. 145 * information.
145 * 146 *
146 * Example (adding a help menu to your application): 147 * Example (adding a help menu to your application):
147 * <pre> 148 * <pre>
148 * menuBar()->insertItem( i18n("&Help"), customHelpMenu() ); 149 * menuBar()->insertItem( i18n("&Help"), customHelpMenu() );
149 * </pre> 150 * </pre>
150 * 151 *
151 * @param showWhatsThis Set this to @p false if you do not want to include 152 * @param showWhatsThis Set this to @p false if you do not want to include
152 * the "What's This" menu entry. 153 * the "What's This" menu entry.
153 * 154 *
154 * @return A standard help menu. 155 * @return A standard help menu.
155 */ 156 */
156//US KPopupMenu* customHelpMenu( bool showWhatsThis = TRUE ); 157//US KPopupMenu* customHelpMenu( bool showWhatsThis = TRUE );
157 158
158 /** 159 /**
159 * @sect Session Management 160 * @sect Session Management
160 * 161 *
161 * Try to restore the toplevel widget as defined by the number (1..X). 162 * Try to restore the toplevel widget as defined by the number (1..X).
162 * 163 *
163 * If the session did not contain so high a number, the configuration 164 * If the session did not contain so high a number, the configuration
164 * is not changed and @p false returned. 165 * is not changed and @p false returned.
165 * 166 *
166 * That means clients could simply do the following: 167 * That means clients could simply do the following:
167 * <pre> 168 * <pre>
168 * if (kapp->isRestored()){ 169 * if (kapp->isRestored()){
169 * int n = 1; 170 * int n = 1;
170 * while (KMainWindow::canBeRestored(n)){ 171 * while (KMainWindow::canBeRestored(n)){
171 * (new childMW)->restore(n); 172 * (new childMW)->restore(n);
172 * n++; 173 * n++;
173 * } 174 * }
174 * } else { 175 * } else {
175 * // create default application as usual 176 * // create default application as usual
176 * } 177 * }
177 * </pre> 178 * </pre>
178 * Note that @ref QWidget::show() is called implicitly in restore. 179 * Note that @ref QWidget::show() is called implicitly in restore.
179 * 180 *
180 * With this you can easily restore all toplevel windows of your 181 * With this you can easily restore all toplevel windows of your
181 * application. 182 * application.
182 * 183 *
183 * If your application uses different kinds of toplevel 184 * If your application uses different kinds of toplevel
184 * windows, then you can use @ref KMainWindow::classNameOfToplevel(n) 185 * windows, then you can use @ref KMainWindow::classNameOfToplevel(n)
185 * to determine the exact type before calling the childMW 186 * to determine the exact type before calling the childMW
186 * constructor in the example from above. 187 * constructor in the example from above.
187 * 188 *
188 * If your client has only one kind of toplevel widgets (which 189 * If your client has only one kind of toplevel widgets (which
189 * should be pretty usual) then you should use the RESTORE-macro 190 * should be pretty usual) then you should use the RESTORE-macro
190 * for backwards compatibility with 3.1 and 3.0 branches: 191 * for backwards compatibility with 3.1 and 3.0 branches:
191 * 192 *
192 * <pre> 193 * <pre>
diff --git a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
index 8404c3e..678f05f 100644
--- a/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
+++ b/pwmanager/pwmanager/getmasterpwwnd_emb.cpp
@@ -33,176 +33,176 @@ $Id$
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qlineedit.h> 34#include <qlineedit.h>
35#include <qlayout.h> 35#include <qlayout.h>
36#include <qtooltip.h> 36#include <qtooltip.h>
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38*/ 38*/
39 39
40#include <qwidget.h> 40#include <qwidget.h>
41#include <qlayout.h> 41#include <qlayout.h>
42#include <qlabel.h> 42#include <qlabel.h>
43#include <qlineedit.h> 43#include <qlineedit.h>
44#include <qpushbutton.h> 44#include <qpushbutton.h>
45#include <qapplication.h> 45#include <qapplication.h>
46 46
47/* 47/*
48 * Constructs a getMasterPwWnd as a child of 'parent', with the 48 * Constructs a getMasterPwWnd as a child of 'parent', with the
49 * name 'name' 49 * name 'name'
50 */ 50 */
51getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) 51getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name)
52 : KDialogBase( KDialogBase::Plain, i18n( "Master-password" ), 52 : KDialogBase( KDialogBase::Plain, i18n( "Master-password" ),
53 KDialogBase::Ok | KDialogBase::Cancel, 53 KDialogBase::Ok | KDialogBase::Cancel,
54 KDialogBase::Ok, parent, name, true ) 54 KDialogBase::Ok, parent, name, true )
55{ 55{
56 QWidget *page = plainPage(); 56 QWidget *page = plainPage();
57 QVBoxLayout *pageLayout = new QVBoxLayout( page ); 57 QVBoxLayout *pageLayout = new QVBoxLayout( page );
58 58
59 pwLineEdit = new QLineEdit( page, "pwLineEdit" ); 59 pwLineEdit = new QLineEdit( page, "pwLineEdit" );
60 pwLineEdit->setEchoMode( QLineEdit::Password ); 60 pwLineEdit->setEchoMode( QLineEdit::Password );
61 61
62 QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" ); 62 QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" );
63 textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); 63 textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) );
64 pageLayout->addWidget(textLabel1); 64 pageLayout->addWidget(textLabel1);
65 pageLayout->addWidget(pwLineEdit); 65 pageLayout->addWidget(pwLineEdit);
66 66
67 QWidget* numberBox = new QWidget( page ); 67 QWidget* numberBox = new QWidget( page );
68#ifndef DESKTOP_VERSION 68#ifndef DESKTOP_VERSION
69 if ( QApplication::desktop()->width() > 320 ) { 69 if ( QApplication::desktop()->width() > 320 ) {
70 numberBox->setFixedHeight(250); 70 numberBox->setFixedHeight(250);
71 numberBox->setFixedWidth(200); 71 numberBox->setFixedWidth(200);
72 } 72 }
73 else{ 73 else{
74 numberBox->setFixedHeight(150); 74 numberBox->setFixedHeight(150);
75 numberBox->setFixedWidth(150); 75 numberBox->setFixedWidth(150);
76 } 76 }
77#endif 77#endif
78 78
79 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 ); 79 QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 );
80 numberLayout->setMargin( 0 ); 80 numberLayout->setMargin( 0 );
81 numberLayout->setSpacing( 0 ); 81 numberLayout->setSpacing( 0 );
82 82
83 QPushButton* p1 = new QPushButton( i18n("1"), numberBox ); 83 QPushButton* p1 = new QPushButton( i18n("1"), numberBox );
84 numberLayout->addWidget( p1, 0, 0 ); 84 numberLayout->addWidget( p1, 0, 0 );
85 QPushButton* p2 = new QPushButton( i18n("2"), numberBox ); 85 QPushButton* p2 = new QPushButton( i18n("2"), numberBox );
86 numberLayout->addWidget( p2, 0, 1 ); 86 numberLayout->addWidget( p2, 0, 1 );
87 QPushButton* p3 = new QPushButton( i18n("3"), numberBox ); 87 QPushButton* p3 = new QPushButton( i18n("3"), numberBox );
88 numberLayout->addWidget( p3, 0, 2 ); 88 numberLayout->addWidget( p3, 0, 2 );
89 QPushButton* p4 = new QPushButton( i18n("4"), numberBox ); 89 QPushButton* p4 = new QPushButton( i18n("4"), numberBox );
90 numberLayout->addWidget( p4, 1, 0 ); 90 numberLayout->addWidget( p4, 1, 0 );
91 QPushButton* p5 = new QPushButton( i18n("5"), numberBox ); 91 QPushButton* p5 = new QPushButton( i18n("5"), numberBox );
92 numberLayout->addWidget( p5, 1, 1 ); 92 numberLayout->addWidget( p5, 1, 1 );
93 QPushButton* p6 = new QPushButton( i18n("6"), numberBox ); 93 QPushButton* p6 = new QPushButton( i18n("6"), numberBox );
94 numberLayout->addWidget( p6, 1, 2 ); 94 numberLayout->addWidget( p6, 1, 2 );
95 QPushButton* p7 = new QPushButton( i18n("7"), numberBox ); 95 QPushButton* p7 = new QPushButton( i18n("7"), numberBox );
96 numberLayout->addWidget( p7, 2, 0 ); 96 numberLayout->addWidget( p7, 2, 0 );
97 QPushButton* p8 = new QPushButton( i18n("8"), numberBox ); 97 QPushButton* p8 = new QPushButton( i18n("8"), numberBox );
98 numberLayout->addWidget( p8, 2, 1 ); 98 numberLayout->addWidget( p8, 2, 1 );
99 QPushButton* p9 = new QPushButton( i18n("9"), numberBox ); 99 QPushButton* p9 = new QPushButton( i18n("9"), numberBox );
100 numberLayout->addWidget( p9, 2, 2 ); 100 numberLayout->addWidget( p9, 2, 2 );
101 QPushButton* clear = new QPushButton( i18n("x"), numberBox ); 101 QPushButton* clear = new QPushButton( i18n("x"), numberBox );
102 numberLayout->addWidget( clear, 3, 0 ); 102 numberLayout->addWidget( clear, 3, 0 );
103 QPushButton* p0 = new QPushButton( i18n("0"), numberBox ); 103 QPushButton* p0 = new QPushButton( i18n("0"), numberBox );
104 numberLayout->addWidget( p0, 3, 1 ); 104 numberLayout->addWidget( p0, 3, 1 );
105 QPushButton* backspace = new QPushButton( i18n("-"), numberBox ); 105 QPushButton* backspace = new QPushButton( i18n("-"), numberBox );
106 numberLayout->addWidget( backspace, 3, 2 ); 106 numberLayout->addWidget( backspace, 3, 2 );
107 107
108 108
109 pageLayout->addWidget(numberBox); 109 pageLayout->addWidget(numberBox);
110#ifdef DESKTOP_VERSION 110#ifdef DESKTOP_VERSION
111 resize( sizeHint() ); 111 resize( sizeHint() );
112#else 112#else
113 resize( 200,sizeHint().height() ); 113 resize( 200,sizeHint().height() );
114#endif 114#endif
115 115
116 connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) ); 116 connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) );
117 connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) ); 117 connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) );
118 connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) ); 118 connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) );
119 connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) ); 119 connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) );
120 connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) ); 120 connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) );
121 connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) ); 121 connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) );
122 connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) ); 122 connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) );
123 connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) ); 123 connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) );
124 connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) ); 124 connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) );
125 connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) ); 125 connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) );
126 connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) ); 126 connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) );
127 connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) ); 127 connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) );
128 128
129 129 pwLineEdit->setFocus();
130 130
131} 131}
132 132
133/* 133/*
134 * Destroys the object and frees any allocated resources 134 * Destroys the object and frees any allocated resources
135 */ 135 */
136getMasterPwWnd::~getMasterPwWnd() 136getMasterPwWnd::~getMasterPwWnd()
137{ 137{
138 // no need to delete child widgets, Qt does it all for us 138 // no need to delete child widgets, Qt does it all for us
139} 139}
140 140
141void getMasterPwWnd::okButton_slot() 141void getMasterPwWnd::okButton_slot()
142{ 142{
143 qWarning( "getMasterPwWnd::okButton_slot(): Not implemented yet" ); 143 qWarning( "getMasterPwWnd::okButton_slot(): Not implemented yet" );
144} 144}
145 145
146void getMasterPwWnd::cancelButton_slot() 146void getMasterPwWnd::cancelButton_slot()
147{ 147{
148 qWarning( "getMasterPwWnd::cancelButton_slot(): Not implemented yet" ); 148 qWarning( "getMasterPwWnd::cancelButton_slot(): Not implemented yet" );
149} 149}
150 150
151void getMasterPwWnd::add0() 151void getMasterPwWnd::add0()
152{ 152{
153 addCharacter("0"); 153 addCharacter("0");
154} 154}
155void getMasterPwWnd::add1() 155void getMasterPwWnd::add1()
156{ 156{
157 addCharacter("1"); 157 addCharacter("1");
158} 158}
159void getMasterPwWnd::add2() 159void getMasterPwWnd::add2()
160{ 160{
161 addCharacter("2"); 161 addCharacter("2");
162} 162}
163void getMasterPwWnd::add3() 163void getMasterPwWnd::add3()
164{ 164{
165 addCharacter("3"); 165 addCharacter("3");
166} 166}
167void getMasterPwWnd::add4() 167void getMasterPwWnd::add4()
168{ 168{
169 addCharacter("4"); 169 addCharacter("4");
170} 170}
171void getMasterPwWnd::add5() 171void getMasterPwWnd::add5()
172{ 172{
173 addCharacter("5"); 173 addCharacter("5");
174} 174}
175void getMasterPwWnd::add6() 175void getMasterPwWnd::add6()
176{ 176{
177 addCharacter("6"); 177 addCharacter("6");
178} 178}
179void getMasterPwWnd::add7() 179void getMasterPwWnd::add7()
180{ 180{
181 addCharacter("7"); 181 addCharacter("7");
182} 182}
183void getMasterPwWnd::add8() 183void getMasterPwWnd::add8()
184{ 184{
185 addCharacter("8"); 185 addCharacter("8");
186} 186}
187void getMasterPwWnd::add9() 187void getMasterPwWnd::add9()
188{ 188{
189 addCharacter("9"); 189 addCharacter("9");
190} 190}
191void getMasterPwWnd::backspace() 191void getMasterPwWnd::backspace()
192{ 192{
193 QString old = pwLineEdit->text(); 193 QString old = pwLineEdit->text();
194 old.truncate(old.length()-1); 194 old.truncate(old.length()-1);
195 pwLineEdit->setText(old); 195 pwLineEdit->setText(old);
196} 196}
197 197
198void getMasterPwWnd::clear() 198void getMasterPwWnd::clear()
199{ 199{
200 pwLineEdit->setText(""); 200 pwLineEdit->setText("");
201} 201}
202 202
203void getMasterPwWnd::addCharacter(const QString& s) 203void getMasterPwWnd::addCharacter(const QString& s)
204{ 204{
205 QString old = pwLineEdit->text(); 205 QString old = pwLineEdit->text();
206 pwLineEdit->setText(old + s); 206 pwLineEdit->setText(old + s);
207} 207}
208 208
diff --git a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
index 26b9708..a8696ea 100644
--- a/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
+++ b/pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp
@@ -55,199 +55,199 @@ PWMConfigWidget::PWMConfigWidget(PWMPrefs *prefs, QWidget *parent, const char *n
55 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 55 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
56 KDialog::spacingHint() ); 56 KDialog::spacingHint() );
57 57
58 QTabWidget *tabWidget = new QTabWidget( this ); 58 QTabWidget *tabWidget = new QTabWidget( this );
59 topLayout->addWidget( tabWidget ); 59 topLayout->addWidget( tabWidget );
60 60
61 // windowsStyle page 61 // windowsStyle page
62 ////////////////////////////////////////////////////// 62 //////////////////////////////////////////////////////
63 QWidget *windowStylePage = new QWidget( this ); 63 QWidget *windowStylePage = new QWidget( this );
64 QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3); 64 QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3);
65 65
66 int i = 0; 66 int i = 0;
67 KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); 67 KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage);
68 windowStyle->addRadio(i18n("Category on top")); 68 windowStyle->addRadio(i18n("Category on top"));
69 windowStyle->addRadio(i18n("Category-list left/top")); 69 windowStyle->addRadio(i18n("Category-list left/top"));
70 windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); 70 windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2);
71 ++i; 71 ++i;
72 72
73 QLabel* lab = new QLabel(i18n("<b>Font for Password entries:</b>"), windowStylePage); 73 QLabel* lab = new QLabel(i18n("<b>Font for Password entries:</b>"), windowStylePage);
74 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); 74 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2);
75 75
76 76
77 ++i; 77 ++i;
78 78
79 KPrefsWidFont *selEntrFont = 79 KPrefsWidFont *selEntrFont =
80 addWidFont(i18n("Password"),i18n("Font:"), 80 addWidFont(i18n("Password"),i18n("Font:"),
81 &(prefs->mEntryFont),windowStylePage); 81 &(prefs->mEntryFont),windowStylePage);
82 windowStyleLayout->addWidget(selEntrFont->label(),i,0); 82 windowStyleLayout->addWidget(selEntrFont->label(),i,0);
83 windowStyleLayout->addWidget(selEntrFont->preview(),i,1); 83 windowStyleLayout->addWidget(selEntrFont->preview(),i,1);
84 windowStyleLayout->addWidget(selEntrFont->button(),i,2); 84 windowStyleLayout->addWidget(selEntrFont->button(),i,2);
85 ++i; 85 ++i;
86 lab = new QLabel(i18n(""), windowStylePage); 86 lab = new QLabel(i18n(""), windowStylePage);
87 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); 87 windowStyleLayout->addMultiCellWidget( lab,i,i,0,2);
88 88
89 // File page 89 // File page
90 ////////////////////////////////////////////////////// 90 //////////////////////////////////////////////////////
91 QWidget *filePage = new QWidget( this ); 91 QWidget *filePage = new QWidget( this );
92 QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); 92 QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2);
93 93
94 i = 0; 94 i = 0;
95 QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); 95 QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage);
96 fileLayout->addWidget(kcfg_compression_label,i,0); 96 fileLayout->addWidget(kcfg_compression_label,i,0);
97 kcfg_compression = new QComboBox(filePage, "kcfg_compression"); 97 kcfg_compression = new QComboBox(filePage, "kcfg_compression");
98 kcfg_compression->insertItem(i18n("None")); 98 kcfg_compression->insertItem(i18n("None"));
99 kcfg_compression->insertItem(i18n("gzip")); 99 kcfg_compression->insertItem(i18n("gzip"));
100 //US not yet supported: kcfg_compression->insertItem(i18n("bzip2")); 100 //US not yet supported: kcfg_compression->insertItem(i18n("bzip2"));
101 fileLayout->addWidget( kcfg_compression,i,1); 101 fileLayout->addWidget( kcfg_compression,i,1);
102 ++i; 102 ++i;
103 103
104 QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage); 104 QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage);
105 fileLayout->addWidget(kcfg_crypt_label,i,0); 105 fileLayout->addWidget(kcfg_crypt_label,i,0);
106 kcfg_cryptAlgo = new QComboBox(filePage, "kcfg_cryptAlgo"); 106 kcfg_cryptAlgo = new QComboBox(filePage, "kcfg_cryptAlgo");
107 kcfg_cryptAlgo->insertItem(i18n("Blowfish (128 bit)")); 107 kcfg_cryptAlgo->insertItem(i18n("Blowfish (128 bit)"));
108#ifdef CONFIG_PWMANAGER_GCRY 108#ifdef CONFIG_PWMANAGER_GCRY
109 kcfg_cryptAlgo->insertItem(i18n("AES-128, Rijndael (128 bit)")); 109 kcfg_cryptAlgo->insertItem(i18n("AES-128, Rijndael (128 bit)"));
110 kcfg_cryptAlgo->insertItem(i18n("AES-192, Rijndael (192 bit)")); 110 kcfg_cryptAlgo->insertItem(i18n("AES-192, Rijndael (192 bit)"));
111 kcfg_cryptAlgo->insertItem(i18n("AES-256, Rijndael (256 bit)")); 111 kcfg_cryptAlgo->insertItem(i18n("AES-256, Rijndael (256 bit)"));
112 kcfg_cryptAlgo->insertItem(i18n("Triple-DES (168 bit)")); 112 kcfg_cryptAlgo->insertItem(i18n("Triple-DES (168 bit)"));
113 kcfg_cryptAlgo->insertItem(i18n("Twofish (256 bit)")); 113 kcfg_cryptAlgo->insertItem(i18n("Twofish (256 bit)"));
114 kcfg_cryptAlgo->insertItem(i18n("Twofish-128 (128 bit)")); 114 kcfg_cryptAlgo->insertItem(i18n("Twofish-128 (128 bit)"));
115#endif // CONFIG_PWMANAGER_GCRY 115#endif // CONFIG_PWMANAGER_GCRY
116 fileLayout->addWidget( kcfg_cryptAlgo,i,1); 116 fileLayout->addWidget( kcfg_cryptAlgo,i,1);
117 ++i; 117 ++i;
118 118
119 QLabel* kcfg_hash_label = new QLabel(i18n("Hashing:"), filePage); 119 QLabel* kcfg_hash_label = new QLabel(i18n("Hashing:"), filePage);
120 fileLayout->addWidget(kcfg_hash_label,i,0); 120 fileLayout->addWidget(kcfg_hash_label,i,0);
121 kcfg_hashAlgo = new QComboBox(filePage, "kcfg_hashAlgo"); 121 kcfg_hashAlgo = new QComboBox(filePage, "kcfg_hashAlgo");
122 kcfg_hashAlgo->insertItem(i18n("SHA-160, SHA1 (160 bit)")); 122 kcfg_hashAlgo->insertItem(i18n("SHA-160, SHA1 (160 bit)"));
123#ifdef CONFIG_PWMANAGER_GCRY 123#ifdef CONFIG_PWMANAGER_GCRY
124 kcfg_hashAlgo->insertItem(i18n("SHA-256 (256 bit)")); 124 kcfg_hashAlgo->insertItem(i18n("SHA-256 (256 bit)"));
125 kcfg_hashAlgo->insertItem(i18n("SHA-384 (384 bit)")); 125 kcfg_hashAlgo->insertItem(i18n("SHA-384 (384 bit)"));
126 kcfg_hashAlgo->insertItem(i18n("SHA-512 (512 bit)")); 126 kcfg_hashAlgo->insertItem(i18n("SHA-512 (512 bit)"));
127 kcfg_hashAlgo->insertItem(i18n("MD5 (128 bit)")); 127 kcfg_hashAlgo->insertItem(i18n("MD5 (128 bit)"));
128 kcfg_hashAlgo->insertItem(i18n("RIPE-MD-160 (160 bit)")); 128 kcfg_hashAlgo->insertItem(i18n("RIPE-MD-160 (160 bit)"));
129 kcfg_hashAlgo->insertItem(i18n("Tiger (192 bit)")); 129 kcfg_hashAlgo->insertItem(i18n("Tiger (192 bit)"));
130#endif // CONFIG_PWMANAGER_GCRY 130#endif // CONFIG_PWMANAGER_GCRY
131 fileLayout->addWidget( kcfg_hashAlgo,i,1); 131 fileLayout->addWidget( kcfg_hashAlgo,i,1);
132 ++i; 132 ++i;
133 133
134 permissionLineEdit = new QLineEdit(filePage); 134 permissionLineEdit = new QLineEdit(filePage);
135 QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage); 135 QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage);
136 fileLayout->addWidget(permissionLineLabel,i,0); 136 fileLayout->addWidget(permissionLineLabel,i,0);
137 fileLayout->addWidget(permissionLineEdit,i,1); 137 fileLayout->addWidget(permissionLineEdit,i,1);
138 ++i; 138 ++i;
139 139
140 KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), 140 KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"),
141 &(prefs->mMakeFileBackup),filePage); 141 &(prefs->mMakeFileBackup),filePage);
142 fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 142 fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
143 ++i; 143 ++i;
144 144
145 // Timeout page 145 // Timeout page
146 ////////////////////////////////////////////////////// 146 //////////////////////////////////////////////////////
147 QWidget *timeoutPage = new QWidget( this ); 147 QWidget *timeoutPage = new QWidget( this );
148 QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); 148 QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2);
149 149
150 i = 0; 150 i = 0;
151 pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" ); 151 pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" );
152 QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:"), timeoutPage); 152 QLabel* timeoutLabel = new QLabel(pwTimeoutSpinBox, i18n("Password timeout\n(timeout to hold password in\nmemory,so you don't have to\nre-enter it,if you\nalready have entered it)\n[set to 0 to disable]:"), timeoutPage);
153 timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0); 153 timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0);
154 timeoutLayout->addWidget(pwTimeoutSpinBox,i,1); 154 timeoutLayout->addWidget(pwTimeoutSpinBox,i,1);
155 ++i; 155 ++i;
156 156
157 lockTimeoutSpinBox = new QSpinBox( timeoutPage, "lockTimeoutSpinBox" ); 157 lockTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "lockTimeoutSpinBox" );
158 QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:"), timeoutPage); 158 QLabel* lockTimeoutLabel = new QLabel(lockTimeoutSpinBox, i18n("Auto-lock timeout\n(auto lock document after this\namount of seconds)\n[set to 0 to disable]:"), timeoutPage);
159 timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0); 159 timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0);
160 timeoutLayout->addWidget(lockTimeoutSpinBox,i,1); 160 timeoutLayout->addWidget(lockTimeoutSpinBox,i,1);
161 ++i; 161 ++i;
162 162
163 sb = addWidBool(i18n("deep-lock on autolock"), 163 sb = addWidBool(i18n("deep-lock on autolock"),
164 &(prefs->mAutoDeeplock),timeoutPage); 164 &(prefs->mAutoDeeplock),timeoutPage);
165 timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 165 timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
166 ++i; 166 ++i;
167 167
168 168
169 // Autostart page 169 // Autostart page
170 ////////////////////////////////////////////////////// 170 //////////////////////////////////////////////////////
171 QWidget *autostartPage = new QWidget( this ); 171 QWidget *autostartPage = new QWidget( this );
172 QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); 172 QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2);
173 173
174 i = 0; 174 i = 0;
175 175
176 autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); 176 autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit");
177 QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); 177 QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage);
178 autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); 178 autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1);
179 ++i; 179 ++i;
180 autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); 180 autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1);
181 ++i; 181 ++i;
182 182
183 sb = addWidBool(i18n("open deeplocked"), 183 sb = addWidBool(i18n("open deeplocked"),
184 &(prefs->mAutostartDeeplocked),autostartPage); 184 &(prefs->mAutostartDeeplocked),autostartPage);
185 autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 185 autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
186 ++i; 186 ++i;
187 187
188 188
189 // external app page 189 // external app page
190 ////////////////////////////////////////////////////// 190 //////////////////////////////////////////////////////
191 QWidget *externalappPage = new QWidget( this ); 191 QWidget *externalappPage = new QWidget( this );
192 QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); 192 QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2);
193 193
194 i = 0; 194 i = 0;
195 195
196 browserLineEdit = new QLineEdit(externalappPage); 196 browserLineEdit = new QLineEdit(externalappPage);
197 QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); 197 QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage);
198 externalappLayout->addWidget(browserLineLabel,i,0); 198 externalappLayout->addWidget(browserLineLabel,i,0);
199 externalappLayout->addWidget(browserLineEdit,i,1); 199 externalappLayout->addWidget(browserLineEdit,i,1);
200 ++i; 200 ++i;
201 201
202 xtermLineEdit = new QLineEdit(externalappPage); 202 xtermLineEdit = new QLineEdit(externalappPage);
203 QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage); 203 QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage);
204 externalappLayout->addWidget(xtermLineLabel,i,0); 204 externalappLayout->addWidget(xtermLineLabel,i,0);
205 externalappLayout->addWidget(xtermLineEdit,i,1); 205 externalappLayout->addWidget(xtermLineEdit,i,1);
206 ++i; 206 ++i;
207 207
208 208
209 // miscelaneous page 209 // miscelaneous page
210 ////////////////////////////////////////////////////// 210 //////////////////////////////////////////////////////
211 QWidget *miscPage = new QWidget( this ); 211 QWidget *miscPage = new QWidget( this );
212 QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); 212 QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2);
213 213
214 i = 0; 214 i = 0;
215 215
216 /*US ENH: PWM/Pi has no tray and con be minimized 216 /*US ENH: PWM/Pi has no tray and con be minimized
217 sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); 217 sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage);
218 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 218 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
219 ++i; 219 ++i;
220 */ 220 */
221 221
222 sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage); 222 sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage);
223 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 223 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
224 ++i; 224 ++i;
225 225
226 /*US ENH: PWM/Pi has no tray and con be minimized 226 /*US ENH: PWM/Pi has no tray and con be minimized
227 sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage); 227 sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage);
228 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 228 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
229 ++i; 229 ++i;
230 230
231 KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage); 231 KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage);
232 minimizeRadio->addRadio(i18n("don't lock")); 232 minimizeRadio->addRadio(i18n("don't lock"));
233 minimizeRadio->addRadio(i18n("normal lock")); 233 minimizeRadio->addRadio(i18n("normal lock"));
234 minimizeRadio->addRadio(i18n("deep-lock")); 234 minimizeRadio->addRadio(i18n("deep-lock"));
235 miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2); 235 miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2);
236 ++i; 236 ++i;
237 237
238 sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage); 238 sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage);
239 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 239 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
240 ++i; 240 ++i;
241 241
242 sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage); 242 sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage);
243 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); 243 miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1);
244 ++i; 244 ++i;
245 */ 245 */
246 246
247 247
248 tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) ); 248 tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) );
249 tabWidget->addTab( filePage, i18n( "File" ) ); 249 tabWidget->addTab( filePage, i18n( "File" ) );
250 tabWidget->addTab( timeoutPage, i18n( "Timeout" ) ); 250 tabWidget->addTab( timeoutPage, i18n( "Timeout" ) );
251 tabWidget->addTab( autostartPage, i18n( "Autostart" ) ); 251 tabWidget->addTab( autostartPage, i18n( "Autostart" ) );
252 tabWidget->addTab( externalappPage, i18n( "External apps" ) ); 252 tabWidget->addTab( externalappPage, i18n( "External apps" ) );
253 tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) ); 253 tabWidget->addTab( miscPage, i18n( "Miscellaneous" ) );
diff --git a/pwmanager/pwmanager/libgcryptif.cpp b/pwmanager/pwmanager/libgcryptif.cpp
index eafd318..ff94bf6 100644
--- a/pwmanager/pwmanager/libgcryptif.cpp
+++ b/pwmanager/pwmanager/libgcryptif.cpp
@@ -346,104 +346,109 @@ bool LibGCryptIf::doHashPassphrase(DEK *dek,
346 size_t pwlen, 346 size_t pwlen,
347 STRING2KEY *s2k, 347 STRING2KEY *s2k,
348 bool create) 348 bool create)
349{ 349{
350 // This function is derived from GnuPG-1.2.5-rc2 350 // This function is derived from GnuPG-1.2.5-rc2
351 gcry_md_hd_t md; 351 gcry_md_hd_t md;
352 gcry_error_t err; 352 gcry_error_t err;
353 bool ret = true; 353 bool ret = true;
354 size_t pass, i; 354 size_t pass, i;
355 size_t used = 0; 355 size_t used = 0;
356 356
357 PWM_ASSERT(s2k->hash_algo); 357 PWM_ASSERT(s2k->hash_algo);
358 BUG_ON(!(dek->keylen > 0 && dek->keylen <= array_size(dek->key))); 358 BUG_ON(!(dek->keylen > 0 && dek->keylen <= array_size(dek->key)));
359 359
360 err = gcry_md_open(&md, s2k->hash_algo, 0); 360 err = gcry_md_open(&md, s2k->hash_algo, 0);
361 if (err != GPG_ERR_NO_ERROR) { 361 if (err != GPG_ERR_NO_ERROR) {
362 ret = false; 362 ret = false;
363 goto out; 363 goto out;
364 } 364 }
365 for (pass = 0; used < dek->keylen; pass++) { 365 for (pass = 0; used < dek->keylen; pass++) {
366 if (pass) { 366 if (pass) {
367 gcry_md_reset(md); 367 gcry_md_reset(md);
368 for (i = 0; i < pass; i++) // preset the hash context 368 for (i = 0; i < pass; i++) // preset the hash context
369 gcry_md_putc(md, 0); 369 gcry_md_putc(md, 0);
370 } 370 }
371 if (s2k->mode == 1 || s2k->mode == 3) { 371 if (s2k->mode == 1 || s2k->mode == 3) {
372 size_t len2 = pwlen + 8; 372 size_t len2 = pwlen + 8;
373 size_t count = len2; 373 size_t count = len2;
374 374
375 if (create && !pass) { 375 if (create && !pass) {
376 Randomizer *rnd = Randomizer::obj(); 376 Randomizer *rnd = Randomizer::obj();
377 const unsigned int salt_len = 8; 377 const unsigned int salt_len = 8;
378 string rndBuf(rnd->genRndBuf(salt_len)); 378 string rndBuf(rnd->genRndBuf(salt_len));
379 memcpy(s2k->salt, rndBuf.c_str(), salt_len); 379 memcpy(s2k->salt, rndBuf.c_str(), salt_len);
380 if (s2k->mode == 3) 380 if (s2k->mode == 3)
381 s2k->count = 96; // 65536 iterations 381 s2k->count = 96; // 65536 iterations
382 } 382 }
383 if (s2k->mode == 3) { 383 if (s2k->mode == 3) {
384 count = (16ul + (s2k->count & 15)) << ((s2k->count >> 4) + 6); 384 count = (16ul + (s2k->count & 15)) << ((s2k->count >> 4) + 6);
385 if (count < len2) 385 if (count < len2)
386 count = len2; 386 count = len2;
387 } 387 }
388 // a little bit complicated because we need a ulong for count 388 // a little bit complicated because we need a ulong for count
389 while (count > len2) { // maybe iterated+salted 389 while (count > len2) { // maybe iterated+salted
390 gcry_md_write(md, s2k->salt, 8); 390 gcry_md_write(md, s2k->salt, 8);
391 gcry_md_write(md, pw, pwlen); 391 gcry_md_write(md, pw, pwlen);
392 count -= len2; 392 count -= len2;
393 } 393 }
394 if (count < 8) { 394 if (count < 8) {
395 gcry_md_write(md, s2k->salt, count); 395 gcry_md_write(md, s2k->salt, count);
396 } else { 396 } else {
397 gcry_md_write(md, s2k->salt, 8); 397 gcry_md_write(md, s2k->salt, 8);
398 count -= 8; 398 count -= 8;
399 gcry_md_write(md, pw, count); 399 gcry_md_write(md, pw, count);
400 } 400 }
401 } else 401 } else
402 gcry_md_write(md, pw, pwlen); 402 gcry_md_write(md, pw, pwlen);
403 gcry_md_final(md); 403 gcry_md_final(md);
404 i = gcry_md_get_algo_dlen(s2k->hash_algo); 404 i = gcry_md_get_algo_dlen(s2k->hash_algo);
405 if (i > dek->keylen - used) 405 if (i > dek->keylen - used)
406 i = dek->keylen - used; 406 i = dek->keylen - used;
407 memcpy(dek->key+used, gcry_md_read(md, s2k->hash_algo), i); 407 memcpy(dek->key+used, gcry_md_read(md, s2k->hash_algo), i);
408 used += i; 408 used += i;
409 } 409 }
410 gcry_md_close(md); 410 gcry_md_close(md);
411out: 411out:
412 return ret; 412 return ret;
413} 413}
414 414
415void LibGCryptIf::padData(unsigned char *buf, 415void LibGCryptIf::padData(unsigned char *buf,
416 size_t bufLen, 416 size_t bufLen,
417 size_t boundary) 417 size_t boundary)
418{ 418{
419 size_t numPadBytes = boundary - ((bufLen + 1) % boundary); 419 size_t numPadBytes = boundary - ((bufLen + 1) % boundary);
420 buf[bufLen] = static_cast<char>(0x01); 420 buf[bufLen] = static_cast<char>(0x01);
421 size_t i = 0; 421 size_t i = 0;
422 Randomizer *rnd = Randomizer::obj(); 422 Randomizer *rnd = Randomizer::obj();
423 char c; 423 char c;
424 unsigned char *b; 424 unsigned char *b;
425 while (i < numPadBytes) { 425 while (i < numPadBytes) {
426 c = rnd->genRndChar(); 426 c = rnd->genRndChar();
427 if (c == static_cast<char>(0x01)) 427 if (c == static_cast<char>(0x01))
428 continue; 428 continue;
429 b = buf + bufLen + 1 + i; 429 b = buf + bufLen + 1 + i;
430 *b = c; 430 *b = c;
431 ++i; 431 ++i;
432 } 432 }
433} 433}
434 434
435void LibGCryptIf::unpadData(const unsigned char *buf, 435void LibGCryptIf::unpadData(const unsigned char *buf,
436 size_t *bufLen) 436 size_t *bufLen)
437{ 437{
438 size_t pos; 438 size_t pos;
439 BUG_ON(*bufLen % 8); 439 BUG_ON(*bufLen % 8);
440 pos = *bufLen - 1; 440 pos = *bufLen - 1;
441 while (buf[pos] != static_cast<char>(0x01)) { 441 while (buf[pos] != static_cast<char>(0x01)) {
442 qDebug("pos %d %d %d", pos, buf[pos], static_cast<char>(0x01) );
442 BUG_ON(!pos); 443 BUG_ON(!pos);
444 //LR BUG we should terminte the loop if p == 0
445 if ( pos == 0 )
446 break;
443 --pos; 447 --pos;
444 } 448 }
445 *bufLen = pos; 449 *bufLen = pos;
450 qDebug("ente ");
446} 451}
447 452
448#endif // CONFIG_PWMANAGER_GCRY 453#endif // CONFIG_PWMANAGER_GCRY
449 454
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 1ca7ba8..70df15d 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -116,104 +116,105 @@ static void addAuthors(KAboutData *aboutData)
116 "Gentoo ebuild maintainer."), 116 "Gentoo ebuild maintainer."),
117 "elias.probst@gmx.de"); 117 "elias.probst@gmx.de");
118 aboutData->addCredit("George Staikos", 118 aboutData->addCredit("George Staikos",
119 I18N_NOOP("KWallet"), 119 I18N_NOOP("KWallet"),
120 "staikos@kde.org"); 120 "staikos@kde.org");
121 aboutData->addCredit("Matthew Palmer", 121 aboutData->addCredit("Matthew Palmer",
122 I18N_NOOP("rc2 code"), 122 I18N_NOOP("rc2 code"),
123 "mjp16@uow.edu.au"); 123 "mjp16@uow.edu.au");
124 aboutData->addCredit("Olivier Sessink", 124 aboutData->addCredit("Olivier Sessink",
125 I18N_NOOP("gpasman"), 125 I18N_NOOP("gpasman"),
126 "gpasman@nl.linux.org"); 126 "gpasman@nl.linux.org");
127 aboutData->addCredit("The libgcrypt developers", 127 aboutData->addCredit("The libgcrypt developers",
128 I18N_NOOP("Blowfish and SHA1 algorithms"), 128 I18N_NOOP("Blowfish and SHA1 algorithms"),
129 0, "ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/"); 129 0, "ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/");
130 aboutData->addCredit("Troy Engel", 130 aboutData->addCredit("Troy Engel",
131 I18N_NOOP("kpasman"), 131 I18N_NOOP("kpasman"),
132 "tengel@sonic.net"); 132 "tengel@sonic.net");
133 aboutData->addCredit("Wickey", 133 aboutData->addCredit("Wickey",
134 I18N_NOOP("graphics-design in older versions."), 134 I18N_NOOP("graphics-design in older versions."),
135 "wickey@gmx.at"); 135 "wickey@gmx.at");
136 aboutData->addCredit("Ian MacGregor", 136 aboutData->addCredit("Ian MacGregor",
137 I18N_NOOP( 137 I18N_NOOP(
138 "original documentation author.")); 138 "original documentation author."));
139} 139}
140#endif 140#endif
141 141
142int main(int argc, char *argv[]) 142int main(int argc, char *argv[])
143{ 143{
144 printDebugConfigureInfo(); 144 printDebugConfigureInfo();
145#ifndef PWM_EMBEDDED 145#ifndef PWM_EMBEDDED
146 KAboutData aboutData(PACKAGE_NAME, PROG_NAME, 146 KAboutData aboutData(PACKAGE_NAME, PROG_NAME,
147 PACKAGE_VER, description, KAboutData::License_File, 147 PACKAGE_VER, description, KAboutData::License_File,
148 "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0, 148 "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0,
149 "http://passwordmanager.sourceforge.net/", 149 "http://passwordmanager.sourceforge.net/",
150 "mbuesch@freenet.de"); 150 "mbuesch@freenet.de");
151 addAuthors(&aboutData); 151 addAuthors(&aboutData);
152 152
153 KCmdLineArgs::init(argc, argv, &aboutData); 153 KCmdLineArgs::init(argc, argv, &aboutData);
154 KCmdLineArgs::addCmdLineOptions(options); 154 KCmdLineArgs::addCmdLineOptions(options);
155 155
156 KUniqueApplication::addCmdLineOptions(); 156 KUniqueApplication::addCmdLineOptions();
157 if (!KUniqueApplication::start()) { 157 if (!KUniqueApplication::start()) {
158 printInfo("already running."); 158 printInfo("already running.");
159 return EXIT_SUCCESS; 159 return EXIT_SUCCESS;
160 } 160 }
161 PwMApplication a; 161 PwMApplication a;
162 aboutData.setLicenseTextFile(LICENSE_FILE); 162 aboutData.setLicenseTextFile(LICENSE_FILE);
163 return a.exec(); 163 return a.exec();
164#else 164#else
165 165
166 bool exitHelp = false; 166 bool exitHelp = false;
167 if ( argc > 1 ) { 167 if ( argc > 1 ) {
168 QString command = argv[1]; 168 QString command = argv[1];
169 if ( command == "-help" ){ 169 if ( command == "-help" ){
170 printf("PWM/PI command line commands:\n"); 170 printf("PWM/PI command line commands:\n");
171 printf(" no command: Start PWM/PI in usual way\n"); 171 printf(" no command: Start PWM/PI in usual way\n");
172 printf(" -help: This output\n"); 172 printf(" -help: This output\n");
173 printf(" PWM/PI is exiting now. Bye!\n"); 173 printf(" PWM/PI is exiting now. Bye!\n");
174 exitHelp = true; 174 exitHelp = true;
175 } 175 }
176 } 176 }
177 if ( ! exitHelp ) { 177 if ( ! exitHelp ) {
178 178
179 PwMApplication a(argc, argv); 179 PwMApplication a(argc, argv);
180 180
181 KGlobal::setAppName( "pwmanager" ); 181 KGlobal::setAppName( "pwmanager" );
182#ifndef DESKTOP_VERSION 182#ifndef DESKTOP_VERSION
183 //qDebug("width %d ",QApplication::desktop()->width() ); 183 //qDebug("width %d ",QApplication::desktop()->width() );
184 if ( QApplication::desktop()->width() > 320 ) 184 if ( QApplication::desktop()->width() > 320 )
185 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/"); 185 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/");
186 else 186 else
187 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/"); 187 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/");
188#else 188#else
189 QString fileName ; 189 QString fileName ;
190 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; 190 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/";
191 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 191 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
192 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 192 QApplication::addLibraryPath ( qApp->applicationDirPath () );
193 193
194#endif 194#endif
195 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); 195 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager")));
196 KPimGlobalPrefs::instance()->setGlobalConfig(); 196 KPimGlobalPrefs::instance()->setGlobalConfig();
197 197
198 a.newInstance(); 198 a.newInstance();
199 199
200 //US KAddressBookMain m ; 200 //US KAddressBookMain m ;
201 201
202 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 202 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
203 /*US 203 /*US
204#ifndef DESKTOP_VERSION 204#ifndef DESKTOP_VERSION
205 a.showMainWidget( &m ); 205 a.showMainWidget( &m );
206#else 206#else
207 a.setMainWidget( &m ); 207 a.setMainWidget( &m );
208 m.resize (640, 480 ); 208 m.resize (640, 480 );
209 m.show(); 209 m.show();
210#endif 210#endif
211 */ 211 */
212 QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit()));
212 a.exec(); 213 a.exec();
213 KPimGlobalPrefs::instance()->writeConfig(); 214 KPimGlobalPrefs::instance()->writeConfig();
214 } 215 }
215 qDebug("PWMPI: Bye! "); 216 qDebug("PWMPI: Bye! ");
216 217
217#endif 218#endif
218 219
219} 220}
diff --git a/pwmanager/pwmanager/pwm.cpp b/pwmanager/pwmanager/pwm.cpp
index 1ab2b71..2b8f2fa 100644
--- a/pwmanager/pwmanager/pwm.cpp
+++ b/pwmanager/pwmanager/pwm.cpp
@@ -100,197 +100,199 @@ enum {
100#ifdef CONFIG_KEYCARD 100#ifdef CONFIG_KEYCARD
101 BUTTON_POPUP_CHIPCARD_GENNEW = 0, 101 BUTTON_POPUP_CHIPCARD_GENNEW = 0,
102 BUTTON_POPUP_CHIPCARD_DEL, 102 BUTTON_POPUP_CHIPCARD_DEL,
103 BUTTON_POPUP_CHIPCARD_READID, 103 BUTTON_POPUP_CHIPCARD_READID,
104 BUTTON_POPUP_CHIPCARD_SAVEBACKUP, 104 BUTTON_POPUP_CHIPCARD_SAVEBACKUP,
105 BUTTON_POPUP_CHIPCARD_REPLAYBACKUP 105 BUTTON_POPUP_CHIPCARD_REPLAYBACKUP
106#else // CONFIG_KEYCARD 106#else // CONFIG_KEYCARD
107 BUTTON_POPUP_CHIPCARD_NO = 0 107 BUTTON_POPUP_CHIPCARD_NO = 0
108#endif // CONFIG_KEYCARD 108#endif // CONFIG_KEYCARD
109}; 109};
110// Button IDs for "view" popup menu 110// Button IDs for "view" popup menu
111enum { 111enum {
112 BUTTON_POPUP_VIEW_FIND = 0, 112 BUTTON_POPUP_VIEW_FIND = 0,
113 BUTTON_POPUP_VIEW_LOCK, 113 BUTTON_POPUP_VIEW_LOCK,
114 BUTTON_POPUP_VIEW_DEEPLOCK, 114 BUTTON_POPUP_VIEW_DEEPLOCK,
115 BUTTON_POPUP_VIEW_UNLOCK 115 BUTTON_POPUP_VIEW_UNLOCK
116}; 116};
117// Button IDs for "options" popup menu 117// Button IDs for "options" popup menu
118enum { 118enum {
119 BUTTON_POPUP_OPTIONS_CONFIG = 0 119 BUTTON_POPUP_OPTIONS_CONFIG = 0
120}; 120};
121// Button IDs for "export" popup menu (in "file" popup menu) 121// Button IDs for "export" popup menu (in "file" popup menu)
122enum { 122enum {
123 BUTTON_POPUP_EXPORT_TEXT = 0, 123 BUTTON_POPUP_EXPORT_TEXT = 0,
124 BUTTON_POPUP_EXPORT_GPASMAN, 124 BUTTON_POPUP_EXPORT_GPASMAN,
125 BUTTON_POPUP_EXPORT_CSV 125 BUTTON_POPUP_EXPORT_CSV
126#ifdef CONFIG_KWALLETIF 126#ifdef CONFIG_KWALLETIF
127 ,BUTTON_POPUP_EXPORT_KWALLET 127 ,BUTTON_POPUP_EXPORT_KWALLET
128#endif 128#endif
129}; 129};
130// Button IDs for "import" popup menu (in "file" popup menu) 130// Button IDs for "import" popup menu (in "file" popup menu)
131enum { 131enum {
132 BUTTON_POPUP_IMPORT_TEXT = 0, 132 BUTTON_POPUP_IMPORT_TEXT = 0,
133 BUTTON_POPUP_IMPORT_GPASMAN, 133 BUTTON_POPUP_IMPORT_GPASMAN,
134 BUTTON_POPUP_IMPORT_CSV 134 BUTTON_POPUP_IMPORT_CSV
135#ifdef CONFIG_KWALLETIF 135#ifdef CONFIG_KWALLETIF
136 ,BUTTON_POPUP_IMPORT_KWALLET 136 ,BUTTON_POPUP_IMPORT_KWALLET
137#endif 137#endif
138}; 138};
139 139
140#ifdef PWM_EMBEDDED 140#ifdef PWM_EMBEDDED
141// Button IDs for "help" popup menu 141// Button IDs for "help" popup menu
142enum { 142enum {
143 BUTTON_POPUP_HELP_LICENSE = 0, 143 BUTTON_POPUP_HELP_LICENSE = 0,
144 BUTTON_POPUP_HELP_FAQ, 144 BUTTON_POPUP_HELP_FAQ,
145 BUTTON_POPUP_HELP_ABOUT, 145 BUTTON_POPUP_HELP_ABOUT,
146 BUTTON_POPUP_HELP_SYNC, 146 BUTTON_POPUP_HELP_SYNC,
147 BUTTON_POPUP_HELP_WHATSNEW 147 BUTTON_POPUP_HELP_WHATSNEW
148}; 148};
149#endif 149#endif
150 150
151// Button IDs for toolbar 151// Button IDs for toolbar
152enum { 152enum {
153 BUTTON_TOOL_NEW = 0, 153 BUTTON_TOOL_NEW = 0,
154 BUTTON_TOOL_OPEN, 154 BUTTON_TOOL_OPEN,
155 BUTTON_TOOL_SAVE, 155 BUTTON_TOOL_SAVE,
156 BUTTON_TOOL_SAVEAS, 156 BUTTON_TOOL_SAVEAS,
157 BUTTON_TOOL_PRINT, 157 BUTTON_TOOL_PRINT,
158 BUTTON_TOOL_ADD, 158 BUTTON_TOOL_ADD,
159 BUTTON_TOOL_EDIT, 159 BUTTON_TOOL_EDIT,
160 BUTTON_TOOL_DEL, 160 BUTTON_TOOL_DEL,
161 BUTTON_TOOL_FIND, 161 BUTTON_TOOL_FIND,
162 BUTTON_TOOL_LOCK, 162 BUTTON_TOOL_LOCK,
163 BUTTON_TOOL_DEEPLOCK, 163 BUTTON_TOOL_DEEPLOCK,
164 BUTTON_TOOL_UNLOCK 164 BUTTON_TOOL_UNLOCK
165}; 165};
166 166
167 167
168PwM::PwM(PwMInit *_init, PwMDoc *doc, 168PwM::PwM(PwMInit *_init, PwMDoc *doc,
169 bool virginity, 169 bool virginity,
170 QWidget *parent, const char *name) 170 QWidget *parent, const char *name)
171 : KMainWindow(parent, "HALLO") 171 : KMainWindow(parent, "HALLO")
172 , forceQuit (false) 172 , forceQuit (false)
173 , forceMinimizeToTray (false) 173 , forceMinimizeToTray (false)
174{ 174{
175 syncManager = 0; 175 syncManager = 0;
176 virgin = !virginity; 176 virgin = !virginity;
177 init = _init; 177 init = _init;
178 connect(doc, SIGNAL(docClosed(PwMDoc *)), 178 connect(doc, SIGNAL(docClosed(PwMDoc *)),
179 this, SLOT(docClosed(PwMDoc *))); 179 this, SLOT(docClosed(PwMDoc *)));
180 initMenubar(); 180 initMenubar();
181 initToolbar(); 181 initToolbar();
182 initMetrics(); 182 initMetrics();
183 setVirgin(virginity); 183 setVirgin(virginity);
184 setFocusPolicy(QWidget::WheelFocus); 184 setFocusPolicy(QWidget::WheelFocus);
185#ifndef PWM_EMBEDDED 185#ifndef PWM_EMBEDDED
186 statusBar()->show(); 186 statusBar()->show();
187#endif 187#endif
188 view = makeNewListView(doc); 188 view = makeNewListView(doc);
189 setCentralWidget(view); 189 setCentralWidget(view);
190 updateCaption(); 190 updateCaption();
191 showStatMsg(i18n("Ready.")); 191 showStatMsg(i18n("Ready."));
192} 192}
193 193
194PwM::~PwM() 194PwM::~PwM()
195{ 195{
196 //qDebug("PwM::~PwM()"); 196 qDebug("PwM::~PwM() %x", this);
197 disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), 197 disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)),
198 this, SLOT(docClosed(PwMDoc *))); 198 this, SLOT(docClosed(PwMDoc *)));
199 conf()->confWndMainWndSize(size()); 199 conf()->confWndMainWndSize(size());
200 emit closed(this); 200 //LR closing of windows changed
201 //needed for fastload option on PDA
202 //emit closed(this);
201 //qDebug("PwM::~PwM() emited closed(this)"); 203 //qDebug("PwM::~PwM() emited closed(this)");
202 delete view; 204 delete view;
203 delete syncManager; 205 delete syncManager;
204} 206}
205 207
206void PwM::initMenubar() 208void PwM::initMenubar()
207{ 209{
208 KIconLoader* picons; 210 KIconLoader* picons;
209#ifndef PWM_EMBEDDED 211#ifndef PWM_EMBEDDED
210 KIconLoader icons; 212 KIconLoader icons;
211 picons = &icons; 213 picons = &icons;
212#else 214#else
213 picons = KGlobal::iconLoader(); 215 picons = KGlobal::iconLoader();
214 216
215 217
216 syncPopup = new KPopupMenu(this); 218 syncPopup = new KPopupMenu(this);
217 219
218 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup); 220 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup);
219 syncManager->setBlockSave(false); 221 syncManager->setBlockSave(false);
220 222
221 connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); 223 connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) );
222 syncManager->fillSyncMenu(); 224 syncManager->fillSyncMenu();
223 225
224#endif 226#endif
225 filePopup = new KPopupMenu(this); 227 filePopup = new KPopupMenu(this);
226 importPopup = new KPopupMenu(filePopup); 228 importPopup = new KPopupMenu(filePopup);
227 exportPopup = new KPopupMenu(filePopup); 229 exportPopup = new KPopupMenu(filePopup);
228 managePopup = new KPopupMenu(this); 230 managePopup = new KPopupMenu(this);
229#ifdef CONFIG_KEYCARD 231#ifdef CONFIG_KEYCARD
230 chipcardPopup = new KPopupMenu(this); 232 chipcardPopup = new KPopupMenu(this);
231#endif // CONFIG_KEYCARD 233#endif // CONFIG_KEYCARD
232 viewPopup = new KPopupMenu(this); 234 viewPopup = new KPopupMenu(this);
233 optionsPopup = new KPopupMenu(this); 235 optionsPopup = new KPopupMenu(this);
234 236
235// "file" popup menu 237// "file" popup menu
236 filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), 238 filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)),
237 i18n("&New"), this, 239 i18n("&New"), this,
238 SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); 240 SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW);
239 filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), 241 filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)),
240 i18n("&Open"), this, 242 i18n("&Open"), this,
241 SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); 243 SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN);
242 filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), 244 filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)),
243 i18n("&Close"), this, 245 i18n("&Close"), this,
244 SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); 246 SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE);
245 filePopup->insertSeparator(); 247 filePopup->insertSeparator();
246 filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), 248 filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)),
247 i18n("&Save"), this, 249 i18n("&Save"), this,
248 SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); 250 SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE);
249 filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), 251 filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)),
250 i18n("Save &as..."), 252 i18n("Save &as..."),
251 this, SLOT(saveAs_slot()), 0, 253 this, SLOT(saveAs_slot()), 0,
252 BUTTON_POPUP_FILE_SAVEAS); 254 BUTTON_POPUP_FILE_SAVEAS);
253 filePopup->insertSeparator(); 255 filePopup->insertSeparator();
254 // "file/export" popup menu 256 // "file/export" popup menu
255 exportPopup->insertItem(i18n("&Text-file..."), this, 257 exportPopup->insertItem(i18n("&Text-file..."), this,
256 SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); 258 SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT);
257 exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, 259 exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
258 SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); 260 SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN);
259 exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, 261 exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
260 SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV); 262 SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV);
261#ifdef CONFIG_KWALLETIF 263#ifdef CONFIG_KWALLETIF
262 exportPopup->insertItem(i18n("&KWallet..."), this, 264 exportPopup->insertItem(i18n("&KWallet..."), this,
263 SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); 265 SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET);
264#endif 266#endif
265 filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), 267 filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)),
266 i18n("E&xport"), exportPopup, 268 i18n("E&xport"), exportPopup,
267 BUTTON_POPUP_FILE_EXPORT); 269 BUTTON_POPUP_FILE_EXPORT);
268 // "file/import" popup menu 270 // "file/import" popup menu
269 importPopup->insertItem(i18n("&Text-file..."), this, 271 importPopup->insertItem(i18n("&Text-file..."), this,
270 SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT); 272 SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT);
271 importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, 273 importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this,
272 SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN); 274 SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN);
273 importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, 275 importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this,
274 SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV); 276 SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV);
275#ifdef CONFIG_KWALLETIF 277#ifdef CONFIG_KWALLETIF
276 importPopup->insertItem(i18n("&KWallet..."), this, 278 importPopup->insertItem(i18n("&KWallet..."), this,
277 SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); 279 SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET);
278#endif 280#endif
279 filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), 281 filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)),
280 i18n("I&mport"), importPopup, 282 i18n("I&mport"), importPopup,
281 BUTTON_POPUP_FILE_IMPORT); 283 BUTTON_POPUP_FILE_IMPORT);
282 filePopup->insertSeparator(); 284 filePopup->insertSeparator();
283 filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), 285 filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)),
284 i18n("&Print..."), this, 286 i18n("&Print..."), this,
285 SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); 287 SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT);
286 filePopup->insertSeparator(); 288 filePopup->insertSeparator();
287 filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)), 289 filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)),
288 i18n("&Quit"), this, 290 i18n("&Quit"), this,
289 SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT); 291 SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT);
290 menuBar()->insertItem(i18n("&File"), filePopup); 292 menuBar()->insertItem(i18n("&File"), filePopup);
291// "manage" popup menu 293// "manage" popup menu
292 managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)), 294 managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)),
293 i18n("&Add password"), this, 295 i18n("&Add password"), this,
294 SLOT(addPwd_slot()), 0, 296 SLOT(addPwd_slot()), 0,
295 BUTTON_POPUP_MANAGE_ADD); 297 BUTTON_POPUP_MANAGE_ADD);
296 managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)), 298 managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)),
@@ -794,197 +796,201 @@ void PwM::deletePwd_slot()
794void PwM::changeMasterPwd_slot() 796void PwM::changeMasterPwd_slot()
795{ 797{
796 PWM_ASSERT(curDoc()); 798 PWM_ASSERT(curDoc());
797 curDoc()->changeCurrentPw(); 799 curDoc()->changeCurrentPw();
798} 800}
799 801
800void PwM::lockWnd_slot() 802void PwM::lockWnd_slot()
801{ 803{
802 PWM_ASSERT(curDoc()); 804 PWM_ASSERT(curDoc());
803 curDoc()->lockAll(true); 805 curDoc()->lockAll(true);
804} 806}
805 807
806void PwM::deepLockWnd_slot() 808void PwM::deepLockWnd_slot()
807{ 809{
808 PWM_ASSERT(curDoc()); 810 PWM_ASSERT(curDoc());
809 curDoc()->deepLock(); 811 curDoc()->deepLock();
810} 812}
811 813
812void PwM::unlockWnd_slot() 814void PwM::unlockWnd_slot()
813{ 815{
814 PWM_ASSERT(curDoc()); 816 PWM_ASSERT(curDoc());
815 curDoc()->lockAll(false); 817 curDoc()->lockAll(false);
816} 818}
817 819
818void PwM::config_slot() 820void PwM::config_slot()
819{ 821{
820 int oldStyle = conf()->confWndMainViewStyle(); 822 int oldStyle = conf()->confWndMainViewStyle();
821#ifdef PWM_EMBEDDED 823#ifdef PWM_EMBEDDED
822 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"pwmconfigdialog", true ); 824 KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"pwmconfigdialog", true );
823 825
824 KCMPwmConfig* pwmcfg = new KCMPwmConfig( ConfigureDialog->getNewVBoxPage(i18n( "PwManager")) , "KCMPwmConfig" ); 826 KCMPwmConfig* pwmcfg = new KCMPwmConfig( ConfigureDialog->getNewVBoxPage(i18n( "PwManager")) , "KCMPwmConfig" );
825 ConfigureDialog->addModule(pwmcfg ); 827 ConfigureDialog->addModule(pwmcfg );
826 828
827 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); 829 KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" );
828 ConfigureDialog->addModule(kdelibcfg ); 830 ConfigureDialog->addModule(kdelibcfg );
829 831
830#ifndef DESKTOP_VERSION 832#ifndef DESKTOP_VERSION
831 ConfigureDialog->showMaximized(); 833 ConfigureDialog->showMaximized();
832#endif 834#endif
833 if ( ConfigureDialog->exec() ) 835 if ( ConfigureDialog->exec() )
834 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); 836 KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") );
835 delete ConfigureDialog; 837 delete ConfigureDialog;
836 838
837#else //PWM_EMBEDDED 839#else //PWM_EMBEDDED
838 // display the configuration window (modal mode) 840 // display the configuration window (modal mode)
839 if (!conf()->showConfWnd(this)) 841 if (!conf()->showConfWnd(this))
840 return; 842 return;
841#endif 843#endif
842 844
843 int newStyle = conf()->confWndMainViewStyle(); 845 int newStyle = conf()->confWndMainViewStyle();
844 // reinitialize tray 846 // reinitialize tray
845 init->initTray(); 847 init->initTray();
846 // reinitialize KWallet emulation 848 // reinitialize KWallet emulation
847 init->initKWalletEmu(); 849 init->initKWalletEmu();
848 850
849 PwMDocList *_dl = PwMDoc::getOpenDocList(); 851 PwMDocList *_dl = PwMDoc::getOpenDocList();
850 const vector<PwMDocList::listItem> *dl = _dl->getList(); 852 const vector<PwMDocList::listItem> *dl = _dl->getList();
851 vector<PwMDocList::listItem>::const_iterator i = dl->begin(), 853 vector<PwMDocList::listItem>::const_iterator i = dl->begin(),
852 end = dl->end(); 854 end = dl->end();
853 PwMDoc *doc; 855 PwMDoc *doc;
854 while (i != end) { 856 while (i != end) {
855 doc = (*i).doc; 857 doc = (*i).doc;
856 // unlock-without-mpw timeout 858 // unlock-without-mpw timeout
857 doc->timer()->start(DocTimer::id_mpwTimer); 859 doc->timer()->start(DocTimer::id_mpwTimer);
858 // auto-lock timeout 860 // auto-lock timeout
859 doc->timer()->start(DocTimer::id_autoLockTimer); 861 doc->timer()->start(DocTimer::id_autoLockTimer);
860 ++i; 862 ++i;
861 } 863 }
862 864
863 const QValueList<PwM *> *ml = init->mainWndList(); 865 const QValueList<PwM *> *ml = init->mainWndList();
864#ifndef PWM_EMBEDDED 866#ifndef PWM_EMBEDDED
865 QValueList<PwM *>::const_iterator i2 = ml->begin(), 867 QValueList<PwM *>::const_iterator i2 = ml->begin(),
866 end2 = ml->end(); 868 end2 = ml->end();
867#else 869#else
868 QValueList<PwM *>::ConstIterator i2 = ml->begin(), 870 QValueList<PwM *>::ConstIterator i2 = ml->begin(),
869 end2 = ml->end(); 871 end2 = ml->end();
870#endif 872#endif
871 PwM *pwm; 873 PwM *pwm;
872 while (i2 != end2) { 874 while (i2 != end2) {
873 pwm = *i2; 875 pwm = *i2;
874 // reinitialize the window style. 876 // reinitialize the window style.
875 if (oldStyle != newStyle) 877 if (oldStyle != newStyle)
876 pwm->curView()->initStyle(newStyle); 878 pwm->curView()->initStyle(newStyle);
877 // set the new font 879 // set the new font
878 pwm->curView()->setFont(conf()->confGlobEntryFont()); 880 pwm->curView()->setFont(conf()->confGlobEntryFont());
879 ++i2; 881 ++i2;
880 } 882 }
881} 883}
882 884
883void PwM::activateMpButton(bool activate) 885void PwM::activateMpButton(bool activate)
884{ 886{
885 managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, activate); 887 managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, activate);
886} 888}
887 889
888void PwM::closeEvent(QCloseEvent *e) 890void PwM::closeEvent(QCloseEvent *e)
889{ 891{
892 qDebug("PwM::closeEvent ");
893 emit closed( this );
894 return;
890 e->accept(); 895 e->accept();
891} 896}
892 897
893void PwM::docClosed(PwMDoc *doc) 898void PwM::docClosed(PwMDoc *doc)
894{ 899{
900 qDebug("PwM::docClosed ");
895 PARAM_UNUSED(doc); 901 PARAM_UNUSED(doc);
896 PWM_ASSERT(doc == curDoc()); 902 PWM_ASSERT(doc == curDoc());
897 close(); 903 close();
898} 904}
899 905
900void PwM::find_slot() 906void PwM::find_slot()
901{ 907{
902 PWM_ASSERT(curDoc()); 908 PWM_ASSERT(curDoc());
903 if (curDoc()->isDocEmpty()) 909 if (curDoc()->isDocEmpty())
904 return; 910 return;
905 if (curDoc()->isDeepLocked()) 911 if (curDoc()->isDeepLocked())
906 return; 912 return;
907 curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); 913 curDoc()->timer()->getLock(DocTimer::id_autoLockTimer);
908 FindWndImpl findWnd(view); 914 FindWndImpl findWnd(view);
909 findWnd.exec(); 915 findWnd.exec();
910 curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); 916 curDoc()->timer()->putLock(DocTimer::id_autoLockTimer);
911} 917}
912 918
913void PwM::exportToText() 919void PwM::exportToText()
914{ 920{
915 PWM_ASSERT(curDoc()); 921 PWM_ASSERT(curDoc());
916 if (curDoc()->isDocEmpty()) { 922 if (curDoc()->isDocEmpty()) {
917 KMessageBox::information(this, 923 KMessageBox::information(this,
918 i18n 924 i18n
919 ("Sorry, there's nothing to export.\n" 925 ("Sorry, there's nothing to export.\n"
920 "Please first add some passwords."), 926 "Please first add some passwords."),
921 i18n("nothing to do")); 927 i18n("nothing to do"));
922 return; 928 return;
923 } 929 }
924 curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); 930 curDoc()->timer()->getLock(DocTimer::id_autoLockTimer);
925 QString fn(KFileDialog::getSaveFileName(QString::null, 931 QString fn(KFileDialog::getSaveFileName(QString::null,
926 i18n("*|plain-text file"), 932 i18n("*|plain-text file"),
927 this)); 933 this));
928 if (fn == "") { 934 if (fn == "") {
929 curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); 935 curDoc()->timer()->putLock(DocTimer::id_autoLockTimer);
930 return; 936 return;
931 } 937 }
932 938
933 PwMerror ret = curDoc()->exportToText(&fn); 939 PwMerror ret = curDoc()->exportToText(&fn);
934 if (ret != e_success) { 940 if (ret != e_success) {
935 KMessageBox::error(this, 941 KMessageBox::error(this,
936 i18n("Error: Couldn't write to file.\n" 942 i18n("Error: Couldn't write to file.\n"
937 "Please check if you have permission to write\n" 943 "Please check if you have permission to write\n"
938 "to the file in that directory."), 944 "to the file in that directory."),
939 i18n("error while writing")); 945 i18n("error while writing"));
940 } else 946 } else
941 showStatMsg(i18n("Successfully exported data.")); 947 showStatMsg(i18n("Successfully exported data."));
942 curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); 948 curDoc()->timer()->putLock(DocTimer::id_autoLockTimer);
943} 949}
944 950
945bool PwM::importFromText() 951bool PwM::importFromText()
946{ 952{
947 if (!isVirgin()) { 953 if (!isVirgin()) {
948 if (KMessageBox::questionYesNo(this, 954 if (KMessageBox::questionYesNo(this,
949 i18n("Do you want to import the data\n" 955 i18n("Do you want to import the data\n"
950 "into the current document? (If you\n" 956 "into the current document? (If you\n"
951 "select \"no\", a new document will be\n" 957 "select \"no\", a new document will be\n"
952 "opened.)"), 958 "opened.)"),
953 i18n("import into this document?")) 959 i18n("import into this document?"))
954 == KMessageBox::No) { 960 == KMessageBox::No) {
955 // import the data to a new window. 961 // import the data to a new window.
956 PwM *newInstance = init->createMainWnd(); 962 PwM *newInstance = init->createMainWnd();
957 bool ok = newInstance->importFromText(); 963 bool ok = newInstance->importFromText();
958 if (!ok) { 964 if (!ok) {
959 newInstance->setForceQuit(true); 965 newInstance->setForceQuit(true);
960 delete_and_null(newInstance); 966 delete_and_null(newInstance);
961 } 967 }
962 return ok; 968 return ok;
963 } 969 }
964 } 970 }
965 971
966 curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); 972 curDoc()->timer()->getLock(DocTimer::id_autoLockTimer);
967 PwMerror ret; 973 PwMerror ret;
968 QString path(KFileDialog::getOpenFileName(QString::null, 974 QString path(KFileDialog::getOpenFileName(QString::null,
969 i18n("*|PWM-exported text file"), 975 i18n("*|PWM-exported text file"),
970 this)); 976 this));
971 if (path == "") 977 if (path == "")
972 goto cancelImport; 978 goto cancelImport;
973 979
974 ret = curDoc()->importFromText(&path, 0); 980 ret = curDoc()->importFromText(&path, 0);
975 if (ret == e_fileFormat) { 981 if (ret == e_fileFormat) {
976 KMessageBox::error(this, 982 KMessageBox::error(this,
977 i18n("Could not read file-format.\n" 983 i18n("Could not read file-format.\n"
978 "This seems to be _not_ a valid file\n" 984 "This seems to be _not_ a valid file\n"
979 "exported by PwM."), 985 "exported by PwM."),
980 i18n("invalid file-format")); 986 i18n("invalid file-format"));
981 goto cancelImport; 987 goto cancelImport;
982 } else if (ret == e_invalidArg) { 988 } else if (ret == e_invalidArg) {
983 BUG(); 989 BUG();
984 goto cancelImport; 990 goto cancelImport;
985 } else if (ret != e_success) { 991 } else if (ret != e_success) {
986 KMessageBox::error(this, 992 KMessageBox::error(this,
987 i18n("Could not import file!\n" 993 i18n("Could not import file!\n"
988 "Do you have permission to read this file?\n" 994 "Do you have permission to read this file?\n"
989 "Do you have enough free memory?"), 995 "Do you have enough free memory?"),
990 i18n("import failed")); 996 i18n("import failed"));
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index 129bf7b..cf8690f 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -2884,192 +2884,193 @@ void PwMDoc::ensureLvp()
2884 //is not sufficient, because there might be empty spaces 2884 //is not sufficient, because there might be empty spaces
2885 // at the beginning. But the old algorythm only can add elements 2885 // at the beginning. But the old algorythm only can add elements
2886 //to the end.The result are crashes because of list overflows 2886 //to the end.The result are crashes because of list overflows
2887 //we need something to fill all gaps. 2887 //we need something to fill all gaps.
2888 vector<PwMDataItem*> sorted; 2888 vector<PwMDataItem*> sorted;
2889 vector< PwMDataItem*>::iterator sortedBegin, 2889 vector< PwMDataItem*>::iterator sortedBegin,
2890 sortedEnd, 2890 sortedEnd,
2891 sortedI; 2891 sortedI;
2892 vector<PwMCategoryItem>::iterator catBegin = dti.dta.begin(), 2892 vector<PwMCategoryItem>::iterator catBegin = dti.dta.begin(),
2893 catEnd = dti.dta.end(), 2893 catEnd = dti.dta.end(),
2894 catI = catBegin; 2894 catI = catBegin;
2895 vector<PwMDataItem>::iterator entrBegin, entrEnd, entrI; 2895 vector<PwMDataItem>::iterator entrBegin, entrEnd, entrI;
2896 int lvpTop, tmpLvp; 2896 int lvpTop, tmpLvp;
2897 2897
2898 //qDebug("collect:"); 2898 //qDebug("collect:");
2899 2899
2900 while (catI != catEnd) { 2900 while (catI != catEnd) {
2901 lvpTop = -1; 2901 lvpTop = -1;
2902 sorted.clear(); 2902 sorted.clear();
2903 2903
2904 entrBegin = catI->d.begin(); 2904 entrBegin = catI->d.begin();
2905 entrEnd = catI->d.end(); 2905 entrEnd = catI->d.end();
2906 entrI = entrBegin; 2906 entrI = entrBegin;
2907 2907
2908 //US: we use the stl sort algorythm to sort all elements in the order 2908 //US: we use the stl sort algorythm to sort all elements in the order
2909 //of its listViewPos (in the order 1,2,2,3,5,...,x,-1, -1, -1 2909 //of its listViewPos (in the order 1,2,2,3,5,...,x,-1, -1, -1
2910 while (entrI != entrEnd) { 2910 while (entrI != entrEnd) {
2911 //qDebug("found: %s, pos=%i", (*entrI).desc.c_str(), (*entrI).listViewPos); 2911 //qDebug("found: %s, pos=%i", (*entrI).desc.c_str(), (*entrI).listViewPos);
2912 sorted.push_back((PwMDataItem*)&(*entrI)); 2912 sorted.push_back((PwMDataItem*)&(*entrI));
2913 ++entrI; 2913 ++entrI;
2914 } 2914 }
2915 2915
2916 sortedBegin = sorted.begin(); 2916 sortedBegin = sorted.begin();
2917 sortedEnd = sorted.end(); 2917 sortedEnd = sorted.end();
2918 2918
2919 sort(sortedBegin, sortedEnd, PwMDataItemListViewPosSort()); 2919 sort(sortedBegin, sortedEnd, PwMDataItemListViewPosSort());
2920 2920
2921 // qDebug("resort:"); 2921 // qDebug("resort:");
2922 //now we have all sorted in a collection 2922 //now we have all sorted in a collection
2923 //Now start with the sorted and reset listviewpos. 2923 //Now start with the sorted and reset listviewpos.
2924 sortedBegin = sorted.begin(); 2924 sortedBegin = sorted.begin();
2925 sortedEnd = sorted.end(); 2925 sortedEnd = sorted.end();
2926 sortedI = sortedBegin; 2926 sortedI = sortedBegin;
2927 2927
2928 while (sortedI != sortedEnd) { 2928 while (sortedI != sortedEnd) {
2929 // qDebug("reset defined: %s, from pos=%i to pos=%i", (*sortedI)->desc.c_str(), (*sortedI)->listViewPos, lvpTop+1); 2929 // qDebug("reset defined: %s, from pos=%i to pos=%i", (*sortedI)->desc.c_str(), (*sortedI)->listViewPos, lvpTop+1);
2930 (*sortedI)->listViewPos = ++lvpTop; 2930 (*sortedI)->listViewPos = ++lvpTop;
2931 ++sortedI; 2931 ++sortedI;
2932 } 2932 }
2933 2933
2934 /*/debug 2934 /*/debug
2935 entrBegin = catI->d.begin(); 2935 entrBegin = catI->d.begin();
2936 entrEnd = catI->d.end(); 2936 entrEnd = catI->d.end();
2937 entrI = entrBegin; 2937 entrI = entrBegin;
2938 2938
2939 while (entrI != entrEnd) { 2939 while (entrI != entrEnd) {
2940 qDebug("check: %s, pos=%i", (*entrI).desc.c_str(), (*entrI).listViewPos); 2940 qDebug("check: %s, pos=%i", (*entrI).desc.c_str(), (*entrI).listViewPos);
2941 ++entrI; 2941 ++entrI;
2942 } 2942 }
2943 */ 2943 */
2944 2944
2945 ++catI; 2945 ++catI;
2946 } 2946 }
2947} 2947}
2948 2948
2949QString PwMDoc::getTitle() 2949QString PwMDoc::getTitle()
2950{ 2950{
2951 /* NOTE: We have to ensure, that the returned title 2951 /* NOTE: We have to ensure, that the returned title
2952 * is unique and not reused somewhere else while 2952 * is unique and not reused somewhere else while
2953 * this document is valid (open). 2953 * this document is valid (open).
2954 */ 2954 */
2955 QString title(getFilename()); 2955 QString title(getFilename());
2956 2956
2957 //US ENH: The whole filename on PDAs is too long. So use only the last characters 2957 //US ENH: The whole filename on PDAs is too long. So use only the last characters
2958 if (QApplication::desktop()->width() < 640) 2958 if (QApplication::desktop()->width() < 640)
2959 { 2959 {
2960 if (title.length() > 30) 2960 if (title.length() > 30)
2961 title = "..." + title.right(30); 2961 title = "..." + title.right(30);
2962 2962
2963 } 2963 }
2964 2964
2965 2965
2966 if (title.isEmpty()) { 2966 if (title.isEmpty()) {
2967 if (unnamedNum == 0) { 2967 if (unnamedNum == 0) {
2968 unnamedNum = PwMDocList::getNewUnnamedNumber(); 2968 unnamedNum = PwMDocList::getNewUnnamedNumber();
2969 PWM_ASSERT(unnamedNum != 0); 2969 PWM_ASSERT(unnamedNum != 0);
2970 } 2970 }
2971 title = DEFAULT_TITLE; 2971 title = DEFAULT_TITLE;
2972 title += " "; 2972 title += " ";
2973 title += tostr(unnamedNum).c_str(); 2973 title += tostr(unnamedNum).c_str();
2974 } 2974 }
2975 return title; 2975 return title;
2976} 2976}
2977 2977
2978bool PwMDoc::tryDelete() 2978bool PwMDoc::tryDelete()
2979{ 2979{
2980
2980 if (deleted) 2981 if (deleted)
2981 return true; 2982 return true;
2982 int ret; 2983 int ret;
2983 if (isDirty()) { 2984 if (isDirty()) {
2984 ret = dirtyAskSave(getTitle()); 2985 ret = dirtyAskSave(getTitle());
2985 if (ret == 0) { // save to disk 2986 if (ret == 0) { // save to disk
2986 if (!saveDocUi(this)) 2987 if (!saveDocUi(this))
2987 goto out_ignore; 2988 goto out_ignore;
2988 } else if (ret == 1) { // don't save and delete 2989 } else if (ret == 1) { // don't save and delete
2989 goto out_accept; 2990 goto out_accept;
2990 } else { // cancel operation 2991 } else { // cancel operation
2991 goto out_ignore; 2992 goto out_ignore;
2992 } 2993 }
2993 } 2994 }
2994out_accept: 2995out_accept:
2995 deleted = true; 2996 deleted = true;
2996 delete this; 2997 delete this;
2997 return true; 2998 return true;
2998out_ignore: 2999out_ignore:
2999 return false; 3000 return false;
3000} 3001}
3001 3002
3002 3003
3003 3004
3004#ifdef PWM_EMBEDDED 3005#ifdef PWM_EMBEDDED
3005//US ENH: this is the magic function that syncronizes the this doc with the remote doc 3006//US ENH: this is the magic function that syncronizes the this doc with the remote doc
3006//US it could have been defined as static, but I did not want to. 3007//US it could have been defined as static, but I did not want to.
3007PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* syncRemote, int mode ) 3008PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* syncRemote, int mode )
3008{ 3009{
3009 int addedPasswordsLocal = 0; 3010 int addedPasswordsLocal = 0;
3010 int addedPasswordsRemote = 0; 3011 int addedPasswordsRemote = 0;
3011 int deletedPasswordsRemote = 0; 3012 int deletedPasswordsRemote = 0;
3012 int deletedPasswordsLocal = 0; 3013 int deletedPasswordsLocal = 0;
3013 int changedLocal = 0; 3014 int changedLocal = 0;
3014 int changedRemote = 0; 3015 int changedRemote = 0;
3015 3016
3016 PwMSyncItem* syncItemLocal; 3017 PwMSyncItem* syncItemLocal;
3017 PwMSyncItem* syncItemRemote; 3018 PwMSyncItem* syncItemRemote;
3018 3019
3019 QString mCurrentSyncName = manager->getCurrentSyncName(); 3020 QString mCurrentSyncName = manager->getCurrentSyncName();
3020 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 3021 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
3021 3022
3022 bool fullDateRange = false; 3023 bool fullDateRange = false;
3023 int take; 3024 int take;
3024 // local->resetTempSyncStat(); 3025 // local->resetTempSyncStat();
3025 QDateTime mLastSync = QDateTime::currentDateTime(); 3026 QDateTime mLastSync = QDateTime::currentDateTime();
3026 QDateTime modifiedSync = mLastSync; 3027 QDateTime modifiedSync = mLastSync;
3027 3028
3028 unsigned int index; 3029 unsigned int index;
3029 //Step 1. Find syncinfo in Local file and create if not existent. 3030 //Step 1. Find syncinfo in Local file and create if not existent.
3030 bool found = syncLocal->findSyncData(mCurrentSyncDevice, &index); 3031 bool found = syncLocal->findSyncData(mCurrentSyncDevice, &index);
3031 if (found == false) 3032 if (found == false)
3032 { 3033 {
3033 PwMSyncItem newSyncItemLocal; 3034 PwMSyncItem newSyncItemLocal;
3034 newSyncItemLocal.syncName = mCurrentSyncDevice.latin1(); 3035 newSyncItemLocal.syncName = mCurrentSyncDevice.latin1();
3035 newSyncItemLocal.lastSyncDate = mLastSync; 3036 newSyncItemLocal.lastSyncDate = mLastSync;
3036 syncLocal->addSyncDataEntry(&newSyncItemLocal, true); 3037 syncLocal->addSyncDataEntry(&newSyncItemLocal, true);
3037 found = syncLocal->findSyncData(mCurrentSyncDevice, &index); 3038 found = syncLocal->findSyncData(mCurrentSyncDevice, &index);
3038 if (found == false) { 3039 if (found == false) {
3039 qDebug("PwMDoc::syncronize : newly created local sync data could not be found"); 3040 qDebug("PwMDoc::syncronize : newly created local sync data could not be found");
3040 return e_syncError; 3041 return e_syncError;
3041 } 3042 }
3042 } 3043 }
3043 3044
3044 syncItemLocal = syncLocal->getSyncDataEntry(index); 3045 syncItemLocal = syncLocal->getSyncDataEntry(index);
3045 qDebug("Last Sync Local %s ", syncItemLocal->lastSyncDate.toString().latin1()); 3046 qDebug("Last Sync Local %s ", syncItemLocal->lastSyncDate.toString().latin1());
3046 3047
3047 //Step 2. Find syncinfo in remote file and create if not existent. 3048 //Step 2. Find syncinfo in remote file and create if not existent.
3048 found = syncRemote->findSyncData(mCurrentSyncName, &index); 3049 found = syncRemote->findSyncData(mCurrentSyncName, &index);
3049 if (found == false) 3050 if (found == false)
3050 { 3051 {
3051 qDebug("FULLDATE 1"); 3052 qDebug("FULLDATE 1");
3052 fullDateRange = true; 3053 fullDateRange = true;
3053 PwMSyncItem newSyncItemRemote; 3054 PwMSyncItem newSyncItemRemote;
3054 newSyncItemRemote.syncName = mCurrentSyncName.latin1(); 3055 newSyncItemRemote.syncName = mCurrentSyncName.latin1();
3055 newSyncItemRemote.lastSyncDate = mLastSync; 3056 newSyncItemRemote.lastSyncDate = mLastSync;
3056 syncRemote->addSyncDataEntry(&newSyncItemRemote, true); 3057 syncRemote->addSyncDataEntry(&newSyncItemRemote, true);
3057 found = syncRemote->findSyncData(mCurrentSyncName, &index); 3058 found = syncRemote->findSyncData(mCurrentSyncName, &index);
3058 if (found == false) { 3059 if (found == false) {
3059 qDebug("PwMDoc::syncronize : newly created remote sync data could not be found"); 3060 qDebug("PwMDoc::syncronize : newly created remote sync data could not be found");
3060 return e_syncError; 3061 return e_syncError;
3061 } 3062 }
3062 } 3063 }
3063 3064
3064 syncItemRemote = syncRemote->getSyncDataEntry(index); 3065 syncItemRemote = syncRemote->getSyncDataEntry(index);
3065 qDebug("Last Sync Remote %s ", syncItemRemote->lastSyncDate.toString().latin1()); 3066 qDebug("Last Sync Remote %s ", syncItemRemote->lastSyncDate.toString().latin1());
3066 //and remove the found entry here. We will reenter it later again. 3067 //and remove the found entry here. We will reenter it later again.
3067 //US syncRemote->delSyncDataEntry(index, true); 3068 //US syncRemote->delSyncDataEntry(index, true);
3068 3069
3069 3070
3070 if ( syncItemLocal->lastSyncDate == mLastSync ) { 3071 if ( syncItemLocal->lastSyncDate == mLastSync ) {
3071 qDebug("FULLDATE 2"); 3072 qDebug("FULLDATE 2");
3072 fullDateRange = true; 3073 fullDateRange = true;
3073 } 3074 }
3074 3075
3075 if ( ! fullDateRange ) { 3076 if ( ! fullDateRange ) {
diff --git a/pwmanager/pwmanager/pwmdocui.cpp b/pwmanager/pwmanager/pwmdocui.cpp
index 71b4a8d..a9916c2 100644
--- a/pwmanager/pwmanager/pwmdocui.cpp
+++ b/pwmanager/pwmanager/pwmdocui.cpp
@@ -111,219 +111,222 @@ QString PwMDocUi::requestNewMpw(bool *chipcard)
111 pw = pwWnd.getPw(chipcard).c_str(); 111 pw = pwWnd.getPw(chipcard).c_str();
112 112
113 return pw; 113 return pw;
114} 114}
115 115
116QString PwMDocUi::requestMpwChange(const QString *currentPw, bool *chipcard) 116QString PwMDocUi::requestMpwChange(const QString *currentPw, bool *chipcard)
117{ 117{
118 QString pw(requestMpw(*chipcard)); 118 QString pw(requestMpw(*chipcard));
119 if (pw == "") 119 if (pw == "")
120 return ""; 120 return "";
121 if (pw != *currentPw) { 121 if (pw != *currentPw) {
122 wrongMpwMsgBox(*chipcard); 122 wrongMpwMsgBox(*chipcard);
123 return ""; 123 return "";
124 } 124 }
125 125
126 pw = requestNewMpw(chipcard); 126 pw = requestNewMpw(chipcard);
127 if (pw == "") 127 if (pw == "")
128 return ""; 128 return "";
129 return pw; 129 return pw;
130} 130}
131 131
132void PwMDocUi::wrongMpwMsgBox(bool chipcard, QString prefix, QString postfix) 132void PwMDocUi::wrongMpwMsgBox(bool chipcard, QString prefix, QString postfix)
133{ 133{
134 QString msg; 134 QString msg;
135 if (prefix != "") { 135 if (prefix != "") {
136 msg += prefix; 136 msg += prefix;
137 msg += "\n"; 137 msg += "\n";
138 } 138 }
139 139
140 if (chipcard) { 140 if (chipcard) {
141 msg += i18n("Wrong key-card!\n" 141 msg += i18n("Wrong key-card!\n"
142 "Please try again with the\n" 142 "Please try again with the\n"
143 "correct key-card."); 143 "correct key-card.");
144 } else { 144 } else {
145 msg += i18n("Wrong master-password!\n" 145 msg += i18n("Wrong master-password!\n"
146 "Please try again."); 146 "Please try again.");
147 } 147 }
148 148
149 if (postfix != "") { 149 if (postfix != "") {
150 msg += "\n"; 150 msg += "\n";
151 msg += postfix; 151 msg += postfix;
152 } 152 }
153 KMessageBox::error(currentView, msg, 153 KMessageBox::error(currentView, msg,
154 (chipcard) ? (i18n("wrong chipcard")) 154 (chipcard) ? (i18n("wrong chipcard"))
155 : (i18n("password error"))); 155 : (i18n("password error")));
156} 156}
157 157
158void PwMDocUi::noMpwMsgBox(bool chipcard, QString prefix, QString postfix) 158void PwMDocUi::noMpwMsgBox(bool chipcard, QString prefix, QString postfix)
159{ 159{
160 QString msg; 160 QString msg;
161 if (prefix != "") { 161 if (prefix != "") {
162 msg += prefix; 162 msg += prefix;
163 msg += "\n"; 163 msg += "\n";
164 } 164 }
165 165
166 if (chipcard) { 166 if (chipcard) {
167 msg += i18n("No key-card found!\n" 167 msg += i18n("No key-card found!\n"
168 "Please insert the\n" 168 "Please insert the\n"
169 "correct key-card."); 169 "correct key-card.");
170 } else { 170 } else {
171 msg += i18n("No master-password given!"); 171 msg += i18n("No master-password given!");
172 } 172 }
173 173
174 if (postfix != "") { 174 if (postfix != "") {
175 msg += "\n"; 175 msg += "\n";
176 msg += postfix; 176 msg += postfix;
177 } 177 }
178 KMessageBox::error(currentView, msg, 178 KMessageBox::error(currentView, msg,
179 (chipcard) ? (i18n("no chipcard")) 179 (chipcard) ? (i18n("no chipcard"))
180 : (i18n("password error"))); 180 : (i18n("password error")));
181} 181}
182 182
183void PwMDocUi::rootAlertMsgBox() 183void PwMDocUi::rootAlertMsgBox()
184{ 184{
185 KMessageBox::error(currentView, 185 KMessageBox::error(currentView,
186 i18n("This feature is not available,n" 186 i18n("This feature is not available,n"
187 "if you execute PwM with \"root\" \n" 187 "if you execute PwM with \"root\" \n"
188 "UID 0 privileges, for security reasons!"), 188 "UID 0 privileges, for security reasons!"),
189 i18n("not allowed as root!")); 189 i18n("not allowed as root!"));
190} 190}
191 191
192void PwMDocUi::cantDeeplock_notSavedMsgBox() 192void PwMDocUi::cantDeeplock_notSavedMsgBox()
193{ 193{
194 KMessageBox::error(currentView, 194 KMessageBox::error(currentView,
195 i18n("Can't deep-lock, because the document\n" 195 i18n("Can't deep-lock, because the document\n"
196 "hasn't been saved, yet. Please save\n" 196 "hasn't been saved, yet. Please save\n"
197 "to a file and try again."), 197 "to a file and try again."),
198 i18n("not saved, yet")); 198 i18n("not saved, yet"));
199} 199}
200 200
201void PwMDocUi::gpmPwLenErrMsgBox() 201void PwMDocUi::gpmPwLenErrMsgBox()
202{ 202{
203 KMessageBox::error(currentView, 203 KMessageBox::error(currentView,
204 i18n("GPasman does not support passwords\n" 204 i18n("GPasman does not support passwords\n"
205 "shorter than 4 characters! Please try\n" 205 "shorter than 4 characters! Please try\n"
206 "again with a longer password."), 206 "again with a longer password."),
207 i18n("password too short")); 207 i18n("Password too short"));
208} 208}
209 209
210int PwMDocUi::dirtyAskSave(const QString &docTitle) 210int PwMDocUi::dirtyAskSave(const QString &docTitle)
211{ 211{
212 int ret; 212 int ret;
213#ifndef PWM_EMBEDDED 213#ifndef PWM_EMBEDDED
214 ret = KMessageBox::questionYesNoCancel(currentView, 214 ret = KMessageBox::questionYesNoCancel(currentView,
215 i18n("The list \"") + 215 i18n("The list\n\"") +
216 docTitle + 216 docTitle +
217 i18n 217 i18n
218 ("\" has been modified.\n" 218 ("\" has been modified.\n"
219 "Do you want to save it?"), 219 "Do you want to save it?"),
220 i18n("save?")); 220 i18n("Save?"));
221 if (ret == KMessageBox::Yes) { 221 if (ret == KMessageBox::Yes) {
222 return 0; 222 return 0;
223 } else if (ret == KMessageBox::No) { 223 } else if (ret == KMessageBox::No) {
224 return 1; 224 return 1;
225 } 225 }
226#else 226#else
227 QString doc = docTitle;
228 if ( doc.length() > 33 )
229 doc = "..." + doc.right(30);
227 ret = KMessageBox::warningYesNoCancel(currentView, 230 ret = KMessageBox::warningYesNoCancel(currentView,
228 i18n("The list \"") + 231 i18n("The list\n \"") +
229 docTitle + 232 doc +
230 i18n 233 i18n
231 ("\"\nhas been modified.\n" 234 ("\"\nhas been modified.\n"
232 "Do you want to save it?"), 235 "Do you want to save it?"),
233 i18n("save?")); 236 i18n("Save?"));
234 if (ret == KMessageBox::Yes) { 237 if (ret == KMessageBox::Yes) {
235 return 0; 238 return 0;
236 } else if (ret == KMessageBox::No) { 239 } else if (ret == KMessageBox::No) {
237 return 1; 240 return 1;
238 } 241 }
239 242
240#endif 243#endif
241 244
242 // cancel 245 // cancel
243 return -1; 246 return -1;
244} 247}
245 248
246bool PwMDocUi::saveDocUi(PwMDoc *doc) 249bool PwMDocUi::saveDocUi(PwMDoc *doc)
247{ 250{
248 PWM_ASSERT(doc); 251 PWM_ASSERT(doc);
249 doc->timer()->getLock(DocTimer::id_autoLockTimer); 252 doc->timer()->getLock(DocTimer::id_autoLockTimer);
250 if (doc->isDocEmpty()) { 253 if (doc->isDocEmpty()) {
251 KMessageBox::information(currentView, 254 KMessageBox::information(currentView,
252 i18n 255 i18n
253 ("Sorry, there's nothing to save.\n" 256 ("Sorry, there's nothing to save.\n"
254 "Please first add some passwords."), 257 "Please first add some passwords."),
255 i18n("nothing to do")); 258 i18n("nothing to do"));
256 doc->timer()->putLock(DocTimer::id_autoLockTimer); 259 doc->timer()->putLock(DocTimer::id_autoLockTimer);
257 return true; 260 return true;
258 } 261 }
259 PwMerror ret = doc->saveDoc(conf()->confGlobCompression()); 262 PwMerror ret = doc->saveDoc(conf()->confGlobCompression());
260 if (ret == e_filename) { 263 if (ret == e_filename) {
261 doc->timer()->putLock(DocTimer::id_autoLockTimer); 264 doc->timer()->putLock(DocTimer::id_autoLockTimer);
262 return saveAsDocUi(doc); 265 return saveAsDocUi(doc);
263 } else if (ret == e_weakPw) { 266 } else if (ret == e_weakPw) {
264 KMessageBox::error(currentView, 267 KMessageBox::error(currentView,
265 i18n("Error: This is a weak password.\n" 268 i18n("Error: This is a weak password.\n"
266 "Please select another password."), 269 "Please select another password."),
267 i18n("weak password")); 270 i18n("weak password"));
268 doc->timer()->putLock(DocTimer::id_autoLockTimer); 271 doc->timer()->putLock(DocTimer::id_autoLockTimer);
269 return false; 272 return false;
270 } else if (ret == e_fileBackup) { 273 } else if (ret == e_fileBackup) {
271 KMessageBox::error(currentView, 274 KMessageBox::error(currentView,
272 i18n("Error: Couldn't make backup-file!"), 275 i18n("Error: Couldn't make backup-file!"),
273 i18n("backup failed")); 276 i18n("backup failed"));
274 doc->timer()->putLock(DocTimer::id_autoLockTimer); 277 doc->timer()->putLock(DocTimer::id_autoLockTimer);
275 return false; 278 return false;
276 } else if (ret == e_noPw || 279 } else if (ret == e_noPw ||
277 ret == e_wrongPw || 280 ret == e_wrongPw ||
278 ret == e_openFile) { 281 ret == e_openFile) {
279 doc->timer()->putLock(DocTimer::id_autoLockTimer); 282 doc->timer()->putLock(DocTimer::id_autoLockTimer);
280 return false; 283 return false;
281 } else if (ret != e_success) { 284 } else if (ret != e_success) {
282 KMessageBox::error(currentView, 285 KMessageBox::error(currentView,
283 i18n("Error: Couldn't write to file.\n" 286 i18n("Error: Couldn't write to file.\n"
284 "Please check if you have permission to\n" 287 "Please check if you have permission to\n"
285 "write to the file in that directory."), 288 "write to the file in that directory."),
286 i18n("error while writing")); 289 i18n("error while writing"));
287 doc->timer()->putLock(DocTimer::id_autoLockTimer); 290 doc->timer()->putLock(DocTimer::id_autoLockTimer);
288 return false; 291 return false;
289 } 292 }
290 doc->timer()->putLock(DocTimer::id_autoLockTimer); 293 doc->timer()->putLock(DocTimer::id_autoLockTimer);
291 return true; 294 return true;
292} 295}
293 296
294bool PwMDocUi::saveAsDocUi(PwMDoc *doc) 297bool PwMDocUi::saveAsDocUi(PwMDoc *doc)
295{ 298{
296 PWM_ASSERT(doc); 299 PWM_ASSERT(doc);
297 doc->timer()->getLock(DocTimer::id_autoLockTimer); 300 doc->timer()->getLock(DocTimer::id_autoLockTimer);
298 if (doc->isDocEmpty()) { 301 if (doc->isDocEmpty()) {
299 KMessageBox::information(currentView, 302 KMessageBox::information(currentView,
300 i18n 303 i18n
301 ("Sorry, there's nothing to save.\n" 304 ("Sorry, there's nothing to save.\n"
302 "Please first add some passwords."), 305 "Please first add some passwords."),
303 i18n("nothing to do")); 306 i18n("nothing to do"));
304 doc->timer()->putLock(DocTimer::id_autoLockTimer); 307 doc->timer()->putLock(DocTimer::id_autoLockTimer);
305 return true; 308 return true;
306 } 309 }
307#ifndef PWM_EMBEDDED 310#ifndef PWM_EMBEDDED
308 QString fn(KFileDialog::getSaveFileName(QString::null, 311 QString fn(KFileDialog::getSaveFileName(QString::null,
309 i18n("*.pwm|PwManager Password file"), 312 i18n("*.pwm|PwManager Password file"),
310 currentView)); 313 currentView));
311#else 314#else
312 QString fn = locateLocal( "data", KGlobal::getAppName() + "/*.pwm" ); 315 QString fn = locateLocal( "data", KGlobal::getAppName() + "/*.pwm" );
313 fn = KFileDialog::getSaveFileName(fn, 316 fn = KFileDialog::getSaveFileName(fn,
314 i18n("password filename(*.pwm)"), 317 i18n("password filename(*.pwm)"),
315 currentView); 318 currentView);
316 319
317#endif 320#endif
318 if (fn == "") { 321 if (fn == "") {
319 doc->timer()->putLock(DocTimer::id_autoLockTimer); 322 doc->timer()->putLock(DocTimer::id_autoLockTimer);
320 return false; 323 return false;
321 } 324 }
322 if (fn.right(4) != ".pwm") 325 if (fn.right(4) != ".pwm")
323 fn += ".pwm"; 326 fn += ".pwm";
324 327
325 PwMerror ret = doc->saveDoc(conf()->confGlobCompression(), &fn); 328 PwMerror ret = doc->saveDoc(conf()->confGlobCompression(), &fn);
326 if (ret == e_noPw || 329 if (ret == e_noPw ||
327 ret == e_wrongPw || 330 ret == e_wrongPw ||
328 ret == e_openFile) { 331 ret == e_openFile) {
329 doc->timer()->putLock(DocTimer::id_autoLockTimer); 332 doc->timer()->putLock(DocTimer::id_autoLockTimer);
diff --git a/pwmanager/pwmanager/pwminit.cpp b/pwmanager/pwmanager/pwminit.cpp
index d775aa9..fbd17a7 100644
--- a/pwmanager/pwmanager/pwminit.cpp
+++ b/pwmanager/pwmanager/pwminit.cpp
@@ -1,529 +1,538 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * copyright (C) 2004 by Michael Buesch * 3 * copyright (C) 2004 by Michael Buesch *
4 * email: mbuesch@freenet.de * 4 * email: mbuesch@freenet.de *
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License version 2 * 7 * it under the terms of the GNU General Public License version 2 *
8 * as published by the Free Software Foundation. * 8 * as published by the Free Software Foundation. *
9 * * 9 * *
10 ***************************************************************************/ 10 ***************************************************************************/
11 11
12/*************************************************************************** 12/***************************************************************************
13 * copyright (C) 2004 by Ulf Schenk 13 * copyright (C) 2004 by Ulf Schenk
14 * This file is originaly based on version 1.0.1 of pwmanager 14 * This file is originaly based on version 1.0.1 of pwmanager
15 * and was modified to run on embedded devices that run microkde 15 * and was modified to run on embedded devices that run microkde
16 * 16 *
17 * $Id$ 17 * $Id$
18 **************************************************************************/ 18 **************************************************************************/
19 19
20#include "pwminit.h" 20#include "pwminit.h"
21#include "randomizer.h" 21#include "randomizer.h"
22#include <qdir.h> 22#include <qdir.h>
23 23
24#ifndef PWM_EMBEDDED 24#ifndef PWM_EMBEDDED
25#include "selftest.h" 25#include "selftest.h"
26#include "configuration.h" 26#include "configuration.h"
27#else 27#else
28#include "pwmprefs.h" 28#include "pwmprefs.h"
29#endif 29#endif
30 30
31#include "pwm.h" 31#include "pwm.h"
32#include "pwmexception.h" 32#include "pwmexception.h"
33#include "pwmtray.h" 33#include "pwmtray.h"
34#include "pwmdoc.h" 34#include "pwmdoc.h"
35 35
36#ifdef CONFIG_KWALLETIF 36#ifdef CONFIG_KWALLETIF
37# include "kwalletemu.h" 37# include "kwalletemu.h"
38#endif // CONFIG_KWALLETIF 38#endif // CONFIG_KWALLETIF
39#ifdef CONFIG_KEYCARD 39#ifdef CONFIG_KEYCARD
40# include "pwmkeycard.h" 40# include "pwmkeycard.h"
41#endif // CONFIG_KEYCARD 41#endif // CONFIG_KEYCARD
42 42
43#include <qmessagebox.h> 43#include <qmessagebox.h>
44 44
45#include <kmessagebox.h> 45#include <kmessagebox.h>
46#ifndef PWM_EMBEDDED 46#ifndef PWM_EMBEDDED
47#include <kcmdlineargs.h> 47#include <kcmdlineargs.h>
48#include <kwin.h> 48#include <kwin.h>
49#include <dcopclient.h> 49#include <dcopclient.h>
50#endif 50#endif
51 51
52#include <kapplication.h> 52#include <kapplication.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54 54
55#include <signal.h> 55#include <signal.h>
56 56
57static PwMInit *sig_init_pointer; 57static PwMInit *sig_init_pointer;
58#ifdef _WIN32_ 58#ifdef _WIN32_
59static void sig_handler(int signum) 59static void sig_handler(int signum)
60#else 60#else
61static NOREGPARM void sig_handler(int signum) 61static NOREGPARM void sig_handler(int signum)
62#endif 62#endif
63{ 63{
64 switch (signum) { 64 switch (signum) {
65 case SIGINT: 65 case SIGINT:
66 case SIGTERM: 66 case SIGTERM:
67 sig_init_pointer->shutdownApp(20 + signum); 67 sig_init_pointer->shutdownApp(20 + signum);
68 break; 68 break;
69 default: 69 default:
70 printDebug(string("unhandled signal ") 70 printDebug(string("unhandled signal ")
71 + tostr(signum)); 71 + tostr(signum));
72 } 72 }
73} 73}
74 74
75 75
76 76
77PwMInit::PwMInit(PwMApplication *_app) 77PwMInit::PwMInit(PwMApplication *_app)
78 : runStatus (unknown) 78 : runStatus (unknown)
79 , _curWidget (0) 79 , _curWidget (0)
80 , _dcopClient (0) 80 , _dcopClient (0)
81 , _kwalletEmu (0) 81 , _kwalletEmu (0)
82 , _keycard (0) 82 , _keycard (0)
83 , _tray (0) 83 , _tray (0)
84{ 84{
85 sig_init_pointer = this; 85 sig_init_pointer = this;
86 app = _app; 86 app = _app;
87} 87}
88 88
89PwMInit::~PwMInit() 89PwMInit::~PwMInit()
90{ 90{
91 qDebug("PwMInit::~PwMInit() ");
91#ifndef PWM_EMBEDDED 92#ifndef PWM_EMBEDDED
92 SelfTest::cancel(); 93 SelfTest::cancel();
93 // close all open mainwnds 94 // close all open mainwnds
94 QValueList<PwM *>::iterator i = _mainWndList.begin(), 95 QValueList<PwM *>::iterator i = _mainWndList.begin(),
95 end = _mainWndList.end(); 96 end = _mainWndList.end();
96 97
97#else 98#else
98 // close all open mainwnds 99 // close all open mainwnds
99 QValueList<PwM *>::Iterator i = _mainWndList.begin(), 100 QValueList<PwM *>::Iterator i = _mainWndList.begin(),
100 end = _mainWndList.end(); 101 end = _mainWndList.end();
101#endif 102#endif
102 while (i != end) { 103 while (i != end) {
103 disconnect(*i, SIGNAL(closed(PwM *)), 104 disconnect(*i, SIGNAL(closed(PwM *)),
104 this, SLOT(mainWndClosed(PwM *))); 105 this, SLOT(mainWndClosed(PwM *)));
105 delete *i; 106 delete *i;
106 ++i; 107 ++i;
107 } 108 }
108 _mainWndList.clear(); 109 _mainWndList.clear();
109 // close all remaining open documents 110 // close all remaining open documents
110 PwMDocList *_dl = PwMDoc::getOpenDocList(); 111 PwMDocList *_dl = PwMDoc::getOpenDocList();
111 vector<PwMDocList::listItem> dl = *(_dl->getList()); 112 vector<PwMDocList::listItem> dl = *(_dl->getList());
112 vector<PwMDocList::listItem>::iterator i2 = dl.begin(), 113 vector<PwMDocList::listItem>::iterator i2 = dl.begin(),
113 end2 = dl.end(); 114 end2 = dl.end();
114 while (i2 != end2) { 115 while (i2 != end2) {
115 delete (*i2).doc; 116 delete (*i2).doc;
116 ++i2; 117 ++i2;
117 } 118 }
118 119
119#ifdef CONFIG_KWALLETIF 120#ifdef CONFIG_KWALLETIF
120 delete_ifnot_null(_kwalletEmu); 121 delete_ifnot_null(_kwalletEmu);
121#endif // CONFIG_KWALLETIF 122#endif // CONFIG_KWALLETIF
122#ifdef CONFIG_KEYCARD 123#ifdef CONFIG_KEYCARD
123 delete_ifnot_null(_keycard); 124 delete_ifnot_null(_keycard);
124#endif // CONFIG_KEYCARD 125#endif // CONFIG_KEYCARD
125 delete_ifnot_null(_tray); 126 delete_ifnot_null(_tray);
126 127
127 Randomizer::cleanup(); 128 Randomizer::cleanup();
128#ifndef PWM_EMBEDDED 129#ifndef PWM_EMBEDDED
129 Configuration::cleanup(); 130 Configuration::cleanup();
130#endif 131#endif
131} 132}
132 133
133void PwMInit::initializeApp() 134void PwMInit::initializeApp()
134{ 135{
135 //qDebug("PwMInit::initializeApp() "); 136 //qDebug("PwMInit::initializeApp() ");
136 PWM_ASSERT(runStatus == unknown); 137 PWM_ASSERT(runStatus == unknown);
137 runStatus = init; 138 runStatus = init;
138 initPosixSignalHandler(); 139 initPosixSignalHandler();
139 Randomizer::init(); 140 Randomizer::init();
140#ifndef PWM_EMBEDDED 141#ifndef PWM_EMBEDDED
141 Configuration::init(); 142 Configuration::init();
142#endif 143#endif
143 initDCOP(); 144 initDCOP();
144 initKWalletEmu(); 145 initKWalletEmu();
145 initKeycard(); 146 initKeycard();
146 initTray(); 147 initTray();
147 handleCmdLineArgs(); 148 handleCmdLineArgs();
148 bool openDeeplocked = false; 149 bool openDeeplocked = false;
149 if (conf()->confGlobAutostartDeepLocked() || 150 if (conf()->confGlobAutostartDeepLocked() ||
150 savedCmd.open_deeplocked) 151 savedCmd.open_deeplocked)
151 openDeeplocked = true; 152 openDeeplocked = true;
152 if ( false ){ 153 if ( false ){
153 // LR is not working 154 // LR is not working
154 //if (conf()->confWndAutoMinimizeOnStart() || 155 //if (conf()->confWndAutoMinimizeOnStart() ||
155 // savedCmd.minToTray) { 156 // savedCmd.minToTray) {
156 PwMDoc *newDoc = createDoc(); 157 PwMDoc *newDoc = createDoc();
157 qDebug(" createDoc()"); 158 qDebug(" createDoc()");
158 if (!newDoc->openDocUi(newDoc, 159 if (!newDoc->openDocUi(newDoc,
159 conf()->confGlobAutoStart(), 160 conf()->confGlobAutoStart(),
160 openDeeplocked)) { 161 openDeeplocked)) {
161 delete newDoc; 162 delete newDoc;
162 } 163 }
163 164
164 //US ENH for embedded devices: in the case of failure, open a document the default way 165 //US ENH for embedded devices: in the case of failure, open a document the default way
165 createMainWnd(conf()->confGlobAutoStart(), 166 createMainWnd(conf()->confGlobAutoStart(),
166 openDeeplocked, 167 openDeeplocked,
167 true, 168 true,
168 0, 169 0,
169 savedCmd.minimized); 170 savedCmd.minimized);
170 171
171 172
172 173
173 174
174 //} 175 //}
175 } else { 176 } else {
176 createMainWnd(conf()->confGlobAutoStart(), 177 createMainWnd(conf()->confGlobAutoStart(),
177 openDeeplocked, 178 openDeeplocked,
178 true, 179 true,
179 0, 180 0,
180 savedCmd.minimized); 181 savedCmd.minimized);
181 } 182 }
182
183 runStatus = running; 183 runStatus = running;
184} 184}
185 185
186void PwMInit::shutdownApp(int exitStatus) 186void PwMInit::shutdownApp(int exitStatus)
187{ 187{
188 printDebug(string("PwMInit::shutdownApp(") 188 printDebug(string("PwMInit::shutdownApp(")
189 + tostr(exitStatus) + ") called."); 189 + tostr(exitStatus) + ") called.");
190 PWM_ASSERT((runStatus == running) || (runStatus == init)); 190 PWM_ASSERT((runStatus == running) || (runStatus == init));
191 runStatus = shutdown; 191 runStatus = shutdown;
192 QApplication::exit(exitStatus); 192 QApplication::exit(exitStatus);
193 /* The destructor of PwMInit is called when control 193 /* The destructor of PwMInit is called when control
194 * leaves main() 194 * leaves main()
195 */ 195 */
196} 196}
197 197
198void PwMInit::initPosixSignalHandler() 198void PwMInit::initPosixSignalHandler()
199{ 199{
200 signal(SIGINT, sig_handler); 200 signal(SIGINT, sig_handler);
201 signal(SIGTERM, sig_handler); 201 signal(SIGTERM, sig_handler);
202} 202}
203 203
204void PwMInit::initDCOP() 204void PwMInit::initDCOP()
205{ 205{
206#ifndef PWM_EMBEDDED 206#ifndef PWM_EMBEDDED
207 _dcopClient = app->dcopClient(); 207 _dcopClient = app->dcopClient();
208 _dcopClient->setNotifications(true); 208 _dcopClient->setNotifications(true);
209#endif 209#endif
210 210
211} 211}
212 212
213void PwMInit::initKWalletEmu(bool forceDisable, bool forceReload) 213void PwMInit::initKWalletEmu(bool forceDisable, bool forceReload)
214{ 214{
215#ifdef CONFIG_KWALLETIF 215#ifdef CONFIG_KWALLETIF
216 if (!conf()->confGlobKwalletEmu() || 216 if (!conf()->confGlobKwalletEmu() ||
217 forceDisable) { 217 forceDisable) {
218 delete_ifnot_null(_kwalletEmu); 218 delete_ifnot_null(_kwalletEmu);
219 return; 219 return;
220 } 220 }
221 try { 221 try {
222 if (_kwalletEmu && forceReload) 222 if (_kwalletEmu && forceReload)
223 delete_and_null(_kwalletEmu); 223 delete_and_null(_kwalletEmu);
224 if (!_kwalletEmu) 224 if (!_kwalletEmu)
225 _kwalletEmu = new KWalletEmu(this); 225 _kwalletEmu = new KWalletEmu(this);
226 } catch (PwMException e) { 226 } catch (PwMException e) {
227 string errMsg("initializing KWallet emulation failed. ID: "); 227 string errMsg("initializing KWallet emulation failed. ID: ");
228 errMsg += tostr(static_cast<int>(e.getId())); 228 errMsg += tostr(static_cast<int>(e.getId()));
229 errMsg += " err-message: "; 229 errMsg += " err-message: ";
230 errMsg += e.getMessage(); 230 errMsg += e.getMessage();
231 printWarn(errMsg); 231 printWarn(errMsg);
232 return; 232 return;
233 } 233 }
234#else // CONFIG_KWALLETIF 234#else // CONFIG_KWALLETIF
235 PARAM_UNUSED(forceDisable); 235 PARAM_UNUSED(forceDisable);
236 PARAM_UNUSED(forceReload); 236 PARAM_UNUSED(forceReload);
237#endif // CONFIG_KWALLETIF 237#endif // CONFIG_KWALLETIF
238} 238}
239 239
240void PwMInit::initKeycard() 240void PwMInit::initKeycard()
241{ 241{
242#ifdef CONFIG_KEYCARD 242#ifdef CONFIG_KEYCARD
243 PWM_ASSERT(!_keycard); 243 PWM_ASSERT(!_keycard);
244 _keycard = new PwMKeyCard(this); 244 _keycard = new PwMKeyCard(this);
245#endif // CONFIG_KEYCARD 245#endif // CONFIG_KEYCARD
246} 246}
247 247
248void PwMInit::initTray() 248void PwMInit::initTray()
249{ 249{
250#ifdef PWM_EMBEDDED 250#ifdef PWM_EMBEDDED
251 //US ENH : embedded version does not support a tray 251 //US ENH : embedded version does not support a tray
252 return; 252 return;
253#endif 253#endif
254 254
255 if (!conf()->confGlobTray()) { 255 if (!conf()->confGlobTray()) {
256 if (!_tray) 256 if (!_tray)
257 return; 257 return;
258 _tray->hide(); 258 _tray->hide();
259 delete_and_null(_tray); 259 delete_and_null(_tray);
260 return; 260 return;
261 } 261 }
262 if (_tray) 262 if (_tray)
263 return; 263 return;
264 _tray = new PwMTray(this); 264 _tray = new PwMTray(this);
265 connect(_tray, SIGNAL(quitSelected()), 265 connect(_tray, SIGNAL(quitSelected()),
266 this, SLOT(removeTrayAndQuit())); 266 this, SLOT(removeTrayAndQuit()));
267 connect(_tray, SIGNAL(closed(PwMTray *)), 267 connect(_tray, SIGNAL(closed(PwMTray *)),
268 this, SLOT(trayIconClosed(PwMTray *))); 268 this, SLOT(trayIconClosed(PwMTray *)));
269 KIconLoader icons; 269 KIconLoader icons;
270#ifndef PWM_EMBEDDED 270#ifndef PWM_EMBEDDED
271 _tray->setPixmap(icons.loadIcon(PACKAGE_NAME, KIcon::Small)); 271 _tray->setPixmap(icons.loadIcon(PACKAGE_NAME, KIcon::Small));
272#endif 272#endif
273 _tray->show(); 273 _tray->show();
274 // connect the signals of all open documents. 274 // connect the signals of all open documents.
275 const vector<PwMDocList::listItem> *dl = PwMDoc::getOpenDocList()->getList(); 275 const vector<PwMDocList::listItem> *dl = PwMDoc::getOpenDocList()->getList();
276 vector<PwMDocList::listItem>::const_iterator i = dl->begin(), 276 vector<PwMDocList::listItem>::const_iterator i = dl->begin(),
277 end = dl->end(); 277 end = dl->end();
278 while (i != end) { 278 while (i != end) {
279 _tray->connectDocToTray((*i).doc); 279 _tray->connectDocToTray((*i).doc);
280 ++i; 280 ++i;
281 } 281 }
282} 282}
283 283
284void PwMInit::removeTrayAndQuit() 284void PwMInit::removeTrayAndQuit()
285{ 285{
286 PWM_ASSERT(_tray); 286 PWM_ASSERT(_tray);
287 // _tray is deleted in ~PwMInit 287 // _tray is deleted in ~PwMInit
288 shutdownApp(0); 288 shutdownApp(0);
289} 289}
290 290
291PwM * PwMInit::createMainWnd(const QString &loadFile, 291PwM * PwMInit::createMainWnd(const QString &loadFile,
292 bool loadFileDeepLocked, 292 bool loadFileDeepLocked,
293 bool virginity, 293 bool virginity,
294 PwMDoc *doc, 294 PwMDoc *doc,
295 bool minimized) 295 bool minimized)
296{ 296{
297 PwM *newWnd; 297 PwM *newWnd;
298 if (!doc) 298 if (!doc)
299 doc = createDoc(); 299 doc = createDoc();
300 newWnd = new PwM(this, doc, virginity); 300 newWnd = new PwM(this, doc, virginity);
301#ifndef PWM_EMBEDDED 301#ifndef PWM_EMBEDDED
302 _mainWndList.push_back(newWnd); 302 _mainWndList.push_back(newWnd);
303#else 303#else
304 _mainWndList.append(newWnd); 304 _mainWndList.append(newWnd);
305#endif 305#endif
306 connect(newWnd, SIGNAL(closed(PwM *)), 306 connect(newWnd, SIGNAL(closed(PwM *)),
307 this, SLOT(mainWndClosed(PwM *))); 307 this, SLOT(mainWndClosed(PwM *)));
308 connect(newWnd, SIGNAL(gotFocus(PwM *)), 308 connect(newWnd, SIGNAL(gotFocus(PwM *)),
309 this, SLOT(setCurWidget(PwM *))); 309 this, SLOT(setCurWidget(PwM *)));
310 connect(newWnd, SIGNAL(lostFocus(PwM *)), 310 connect(newWnd, SIGNAL(lostFocus(PwM *)),
311 this, SLOT(resetCurWidget())); 311 this, SLOT(resetCurWidget()));
312 312
313 //US ENH 313 //US ENH
314#ifndef PWM_EMBEDDED 314#ifndef PWM_EMBEDDED
315 if (minimized) 315 if (minimized)
316 newWnd->showMinimized(); 316 newWnd->showMinimized();
317 else 317 else
318 newWnd->show(); 318 newWnd->show();
319 319
320#else //PWM_EMBEDDED 320#else //PWM_EMBEDDED
321 321
322#ifndef DESKTOP_VERSION 322#ifndef DESKTOP_VERSION
323 app->showMainWidget( newWnd ); 323 app->showMainWidget( newWnd );
324#else //DESKTOP_VERSION 324#else //DESKTOP_VERSION
325 app->setMainWidget( newWnd );
326 newWnd->resize (640, 480 ); 325 newWnd->resize (640, 480 );
327 newWnd->show(); 326 newWnd->show();
328 qDebug("show ");
329#endif //DESKTOP_VERSION 327#endif //DESKTOP_VERSION
330 328
331#endif //PWM_EMBEDDED 329#endif //PWM_EMBEDDED
332 330
333 if (loadFile != QString::null && 331 if (loadFile != QString::null &&
334 loadFile != "") { 332 loadFile != "") {
335 newWnd->openDoc(loadFile, loadFileDeepLocked); 333 newWnd->openDoc(loadFile, loadFileDeepLocked);
336 } 334 }
337 return newWnd; 335 return newWnd;
338} 336}
339 337
340PwMDoc * PwMInit::createDoc() 338PwMDoc * PwMInit::createDoc()
341{ 339{
342 PwMDoc *doc = new PwMDoc(this); 340 PwMDoc *doc = new PwMDoc(this);
343#ifdef CONFIG_KEYCARD 341#ifdef CONFIG_KEYCARD
344 doc->setPwMKeyCard(keycard()); 342 doc->setPwMKeyCard(keycard());
345#endif 343#endif
346#ifdef CONFIG_KWALLETIF 344#ifdef CONFIG_KWALLETIF
347 if (kwalletEmu()) 345 if (kwalletEmu())
348 kwalletEmu()->connectDocSignals(doc); 346 kwalletEmu()->connectDocSignals(doc);
349#endif 347#endif
350 348
351 if (_tray) 349 if (_tray)
352 _tray->connectDocToTray(doc); 350 _tray->connectDocToTray(doc);
353 351
354 return doc; 352 return doc;
355 353
356} 354}
357 355
358void PwMInit::mainWndClosed(PwM *wnd) 356void PwMInit::mainWndClosed(PwM *wnd)
359{ 357{
360 bool doMinimizeToTray = false; 358 bool doMinimizeToTray = false;
361 bool doDeleteDoc = false; 359 bool doDeleteDoc = false;
362#ifndef PWM_EMBEDDED 360#ifndef PWM_EMBEDDED
363 dcopClient()->suspend(); 361 dcopClient()->suspend();
364 dcopClient()->setAcceptCalls(false); 362 dcopClient()->setAcceptCalls(false);
365#endif 363#endif
366again: 364again:
367 365
368 if (wnd->isForceMinimizeToTray()) { 366 if (wnd->isForceMinimizeToTray()) {
369 if (unlikely(!_tray)) { 367 if (unlikely(!_tray)) {
370 /* This should not happen! If we set forceMinimizeToTray , 368 /* This should not happen! If we set forceMinimizeToTray ,
371 * we must be sure that _tray exists. 369 * we must be sure that _tray exists.
372 */ 370 */
373 BUG(); 371 BUG();
374 wnd->setForceMinimizeToTray(false); 372 wnd->setForceMinimizeToTray(false);
375 goto again; 373 goto again;
376 } 374 }
377 doMinimizeToTray = true; 375 doMinimizeToTray = true;
378 } else { 376 } else {
379 // Ask to minimize to tray. If not, delete doc. 377 // Ask to minimize to tray. If not, delete doc.
380 if (_tray && 378 if (_tray &&
381 runStatus != shutdown && 379 runStatus != shutdown &&
382 !wnd->isForceQuit() && 380 !wnd->isForceQuit() &&
383 !wnd->curDoc()->isDeleted()) { 381 !wnd->curDoc()->isDeleted()) {
384 if (conf()->confWndClose()) 382 if (conf()->confWndClose())
385 doDeleteDoc = true; 383 doDeleteDoc = true;
386 else 384 else
387 doMinimizeToTray = true; 385 doMinimizeToTray = true;
388 } else { 386 } else {
389 doDeleteDoc = true; 387 doDeleteDoc = true;
390 } 388 }
391 } 389 }
392 390
393 if (doMinimizeToTray) { 391 if (doMinimizeToTray) {
394 392 qDebug("doMinimizeToTray ");
395 PWM_ASSERT(_tray); 393 PWM_ASSERT(_tray);
396 int mmlock = conf()->confGlobMinimizeLock(); 394 int mmlock = conf()->confGlobMinimizeLock();
397 switch (mmlock) { 395 switch (mmlock) {
398 case 0: // don't lock anything 396 case 0: // don't lock anything
399 break; 397 break;
400 case 1: // normal lock 398 case 1: // normal lock
401 wnd->curDoc()->lockAll(true); 399 wnd->curDoc()->lockAll(true);
402 break; 400 break;
403 case 2: // deep-lock 401 case 2: // deep-lock
404 wnd->curDoc()->deepLock(); 402 wnd->curDoc()->deepLock();
405 break; 403 break;
406 default: 404 default:
407 WARN(); 405 WARN();
408 } 406 }
409 } else if (doDeleteDoc) { 407 } else if (doDeleteDoc) {
408 qDebug("doDeleteDoc ");
410 if (!wnd->curDoc()->tryDelete()) { 409 if (!wnd->curDoc()->tryDelete()) {
411 /* We failed deleting the doc, 410 /* We failed deleting the doc,
412 * so open a new window with it, again. 411 * so open a new window with it, again.
413 */ 412 */
414 createMainWnd(QString::null, false, 413 createMainWnd(QString::null, false,
415 false, wnd->curDoc()); 414 false, wnd->curDoc());
416 } 415 }
417 } 416 }
418#ifndef PWM_EMBEDDED 417#ifndef PWM_EMBEDDED
419 // find the closed window in the "mainWndList" and delete it. 418 // find the closed window in the "mainWndList" and delete it.
420 QValueList<PwM *>::iterator i = _mainWndList.begin(), 419 QValueList<PwM *>::iterator i = _mainWndList.begin(),
421 end = _mainWndList.end(); 420 end = _mainWndList.end();
422#else 421#else
423 // find the closed window in the "mainWndList" and delete it. 422 // find the closed window in the "mainWndList" and delete it.
424 QValueList<PwM *>::Iterator i = _mainWndList.begin(), 423 QValueList<PwM *>::Iterator i = _mainWndList.begin(),
425 end = _mainWndList.end(); 424 end = _mainWndList.end();
426#endif 425#endif
427 while (i != end) { 426 while (i != end) {
428 if (*i == wnd) { 427 if (*i == wnd) {
429#ifndef PWM_EMBEDDED 428#ifndef PWM_EMBEDDED
430 _mainWndList.erase(i); 429 _mainWndList.erase(i);
431#else 430#else
432 _mainWndList.remove(i); 431 _mainWndList.remove(i);
433#endif 432#endif
433
434 if ( app->mainWidget() == wnd ) {
435 if ( _mainWndList.count() ) {
436#ifndef DESKTOP_VERSION
437 app->showMainWidget(_mainWndList.first() );
438#endif //DESKTOP_VERSION
439
440 }
441 }
442 delete wnd;
434 goto out_success; 443 goto out_success;
435 } 444 }
436 ++i; 445 ++i;
437 } 446 }
438 BUG(); 447 BUG();
439out_success: 448out_success:
440#ifndef PWM_EMBEDDED 449#ifndef PWM_EMBEDDED
441 if (!_mainWndList.size()) 450 if (!_mainWndList.size())
442#else 451#else
443 if (!_mainWndList.count()) 452 if (!_mainWndList.count())
444#endif 453#endif
445 454
446 { 455 {
447 /* If there's no main window and no tray icon 456 /* If there's no main window and no tray icon
448 * left, we have no user interface, so we can 457 * left, we have no user interface, so we can
449 * shut down the application. 458 * shut down the application.
450 */ 459 */
451 if (!_tray) { 460 if (!_tray) {
452#ifndef PWM_EMBEDDED 461#ifndef PWM_EMBEDDED
453 dcopClient()->setAcceptCalls(true); 462 dcopClient()->setAcceptCalls(true);
454 dcopClient()->resume(); 463 dcopClient()->resume();
455#endif 464#endif
456 shutdownApp(0); 465 shutdownApp(0);
457 return; 466 return;
458 } 467 }
459 /* There is no widget left, so set 468 /* There is no widget left, so set
460 * _curWidget to 0 469 * _curWidget to 0
461 */ 470 */
462 resetCurWidget(); 471 resetCurWidget();
463 } 472 }
464#ifndef PWM_EMBEDDED 473#ifndef PWM_EMBEDDED
465 dcopClient()->setAcceptCalls(true); 474 dcopClient()->setAcceptCalls(true);
466 dcopClient()->resume(); 475 dcopClient()->resume();
467#endif 476#endif
468} 477}
469 478
470void PwMInit::trayIconClosed(PwMTray *tray) 479void PwMInit::trayIconClosed(PwMTray *tray)
471{ 480{
472 if (runStatus != running) 481 if (runStatus != running)
473 return; 482 return;
474 PARAM_UNUSED(tray); 483 PARAM_UNUSED(tray);
475 PWM_ASSERT(tray == _tray); 484 PWM_ASSERT(tray == _tray);
476 /* If there's no main wnd left we have to 485 /* If there's no main wnd left we have to
477 * shutdown the app (same as in mainWndClosed()) 486 * shutdown the app (same as in mainWndClosed())
478 */ 487 */
479#ifndef PWM_EMBEDDED 488#ifndef PWM_EMBEDDED
480 if (!_mainWndList.size()) 489 if (!_mainWndList.size())
481 shutdownApp(0); 490 shutdownApp(0);
482#else 491#else
483 if (!_mainWndList.count()) 492 if (!_mainWndList.count())
484 shutdownApp(0); 493 shutdownApp(0);
485#endif 494#endif
486} 495}
487 496
488void PwMInit::handleCmdLineArgs(bool initial) 497void PwMInit::handleCmdLineArgs(bool initial)
489{ 498{
490#ifndef PWM_EMBEDDED 499#ifndef PWM_EMBEDDED
491 KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); 500 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
492 PWM_ASSERT(args); 501 PWM_ASSERT(args);
493 int i, numArgs = args->count(); 502 int i, numArgs = args->count();
494 const char *curArg; 503 const char *curArg;
495 504
496 // read all cmdline options 505 // read all cmdline options
497 savedCmd.open_deeplocked = args->isSet("open-deeplocked"); 506 savedCmd.open_deeplocked = args->isSet("open-deeplocked");
498 savedCmd.minimized = args->isSet("minimized"); 507 savedCmd.minimized = args->isSet("minimized");
499 savedCmd.minToTray = args->isSet("mintray"); 508 savedCmd.minToTray = args->isSet("mintray");
500 savedCmd.skipSelfTest = args->isSet("skip-self-test"); 509 savedCmd.skipSelfTest = args->isSet("skip-self-test");
501 if (savedCmd.minimized && 510 if (savedCmd.minimized &&
502 savedCmd.minToTray) { 511 savedCmd.minToTray) {
503 printInfo(i18n("Commandline option \"--minimized\" and " 512 printInfo(i18n("Commandline option \"--minimized\" and "
504 "\"--mintray\" selected. These are incompatible. " 513 "\"--mintray\" selected. These are incompatible. "
505 "\"--mintray\" will be selected.").latin1()); 514 "\"--mintray\" will be selected.").latin1());
506 } 515 }
507 /* Iterate through all non-option arguments. 516 /* Iterate through all non-option arguments.
508 * Every non-option arg is a filename to open. 517 * Every non-option arg is a filename to open.
509 */ 518 */
510 for (i = 0; i < numArgs; ++i) { 519 for (i = 0; i < numArgs; ++i) {
511 curArg = args->arg(i); 520 curArg = args->arg(i);
512 PWM_ASSERT(curArg); 521 PWM_ASSERT(curArg);
513 if (savedCmd.minToTray) { 522 if (savedCmd.minToTray) {
514 PwMDoc *newDoc = createDoc(); 523 PwMDoc *newDoc = createDoc();
515 if (!newDoc->openDocUi(newDoc, 524 if (!newDoc->openDocUi(newDoc,
516 curArg, 525 curArg,
517 savedCmd.open_deeplocked)) { 526 savedCmd.open_deeplocked)) {
518 delete newDoc; 527 delete newDoc;
519 } 528 }
520 } else { 529 } else {
521 PwM *newInstance = createMainWnd(QString::null, 530 PwM *newInstance = createMainWnd(QString::null,
522 false, 531 false,
523 true, 532 true,
524 0, 533 0,
525 savedCmd.minimized); 534 savedCmd.minimized);
526 PwMDoc *newDoc = newInstance->openDoc(curArg, 535 PwMDoc *newDoc = newInstance->openDoc(curArg,
527 savedCmd.open_deeplocked); 536 savedCmd.open_deeplocked);
528 if (!newDoc) { 537 if (!newDoc) {
529 newInstance->setForceQuit(true); 538 newInstance->setForceQuit(true);