author | zautrix <zautrix> | 2004-10-25 22:23:56 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-25 22:23:56 (UTC) |
commit | dbfa4de9416c28c5424eeee0f36f50de4cfae0ec (patch) (side-by-side diff) | |
tree | 31fa0522ff7821f5b7e98123e16f12455eeb01c9 | |
parent | 03ca6830a9e6742b8873aee04d77b3e094b65d30 (diff) | |
download | kdepimpi-dbfa4de9416c28c5424eeee0f36f50de4cfae0ec.zip kdepimpi-dbfa4de9416c28c5424eeee0f36f50de4cfae0ec.tar.gz kdepimpi-dbfa4de9416c28c5424eeee0f36f50de4cfae0ec.tar.bz2 |
pwmpi windows management fixes
-rw-r--r-- | Makefile | 613 | ||||
-rw-r--r-- | microkde/kdeui/kmainwindow.cpp | 1 | ||||
-rw-r--r-- | microkde/kdeui/kmainwindow.h | 5 | ||||
-rw-r--r-- | pwmanager/pwmanager/getmasterpwwnd_emb.cpp | 2 | ||||
-rw-r--r-- | pwmanager/pwmanager/kcmconfigs/pwmconfigwidget.cpp | 4 | ||||
-rw-r--r-- | pwmanager/pwmanager/libgcryptif.cpp | 5 | ||||
-rw-r--r-- | pwmanager/pwmanager/main.cpp | 1 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwm.cpp | 10 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdoc.cpp | 1 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwmdocui.cpp | 15 | ||||
-rw-r--r-- | pwmanager/pwmanager/pwminit.cpp | 17 |
11 files changed, 296 insertions, 378 deletions
@@ -1,362 +1,253 @@ -export KDEPIMDIR = $(shell pwd) - -export KDEPIM_VERSION=$(shell sed -e 's/.*\"\([0-9]*\.[0-9]*\.[0-9]*\).*/\1/' < version) - -ifeq ($(PLATFORM) , zaurus) - BUILD_NO_LDAP_PLUGIN=1 -endif - -ifneq ($(PLATFORM) , zaurus) - BUILD_NO_SHARP_PLUGIN=1 -endif - -SUBDIRS_MICROKDE = \ - libical/src/libical \ - libical/src/libicalss \ - qtcompat \ - microkde \ - libkcal \ - libkdepim \ - kabc \ - kabc/formats/binary \ - kabc/plugins/file \ - kabc/plugins/dir \ - korganizer \ - kalarmd \ - kaddressbook - -SUBDIRS_QTOPIA_PLUGIN = \ - kabc/plugins/qtopia - -SUBDIRS_OPIE_PLUGIN = \ - kabc/plugins/opie - -SUBDIRS_SHARP_PLUGIN = \ - kabc/plugins/sharpdtm - -SUBDIRS_LDAP_PLUGIN = \ - kabc/plugins/ldap - -SUBDIRS_MICROMAIL = \ - kmicromail/libetpan \ - kmicromail/libmailwrapper \ - kmicromail - -SUBDIRS_GAMMU = \ - gammu/emb/common \ - gammu/emb/gammu - -SUBDIRS_PWMANAGER = \ - pwmanager/libcrypt/mpi \ - pwmanager/libcrypt/error \ - pwmanager/libcrypt/cipher \ - pwmanager/libcrypt/zlib \ - pwmanager/pwmanager - -SUBDIRS = \ - $(SUBDIRS_MICROKDE) \ - $(SUBDIRS_QTOPIA_PLUGIN) \ - $(SUBDIRS_OPIE_PLUGIN) \ - $(SUBDIRS_SHARP_PLUGIN) \ - $(SUBDIRS_LDAP_PLUGIN) \ - $(SUBDIRS_MICROMAIL) \ - $(SUBDIRS_GAMMU) \ - $(SUBDIRS_PWMANAGER) - - -all: build_microkde \ - build_qtopia_plugin \ - build_opie_plugin \ - build_sharp_plugin \ - build_ldap_plugin \ - build_micromail \ - build_gammu \ - build_pwmanager - - -build_microkde: variable_test tmake - for i in $(SUBDIRS_MICROKDE); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - -build_qtopia_plugin: build_microkde - ifdef BUILD_NO_QTOPIA_PLUGIN - @echo == qtopia plugin not build. - else - for i in $(SUBDIRS_QTOPIA_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_opie_plugin: build_microkde - ifdef BUILD_NO_OPIE_PLUGIN - @echo == opie plugin not build. - else - for i in $(SUBDIRS_OPIE_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_sharp_plugin: build_microkde - ifdef BUILD_NO_SHARP_PLUGIN - @echo == ldap plugin not build. - else - for i in $(SUBDIRS_SHARP_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_ldap_plugin: build_microkde - ifdef BUILD_NO_LDAP_PLUGIN - @echo == ldap plugin not build. - else - for i in $(SUBDIRS_LDAP_PLUGIN); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - - -build_micromail: build_microkde - ifdef BUILD_NO_MICROMAIL - @echo == kmicromail not build. - else - for i in $(SUBDIRS_MICROMAIL); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_gammu: variable_test tmake - ifdef BUILD_NO_GAMMU - @echo == gammu not build. - else - for i in $(SUBDIRS_GAMMU); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - -build_pwmanager: build_microkde - ifdef BUILD_NO_PWMANAGER - @echo == pwmanager not build. - else - for i in $(SUBDIRS_PWMANAGER); do pushd $$i; \ - make -f Makefile$(PLATFORM) || exit 1; popd; \ - done - endif - - -variable_info: - @echo -------------------------------------- - @echo KDEPIM buildsystem, variableinfo... - @echo KDEPIMDIR=$(KDEPIMDIR) - @echo QTDIR=$(QTDIR) - @echo QPEDIR=$(QPEDIR) - @echo OPIEDIR=$(OPIEDIR) - @echo PLATFORM=$(PLATFORM) - @echo RELEASE_DEBUG=$(RELEASE_DEBUG) - @echo BUILD_NO_MICROMAIL=$(BUILD_NO_MICROMAIL) - @echo BUILD_NO_LDAP_PLUGIN=$(BUILD_NO_LDAP_PLUGIN) - @echo BUILD_NO_OPIE_PLUGIN=$(BUILD_NO_OPIE_PLUGIN) - @echo BUILD_NO_QTOPIA_PLUGIN=$(BUILD_NO_QTOPIA_PLUGIN) - @echo BUILD_NO_SHARP_PLUGIN=$(BUILD_NO_SHARP_PLUGIN) - ifndef BUILD_NO_SHARP_PLUGIN - @echo SHARPDTMSDK=$(SHARPDTMSDK) - endif - @echo BUILD_NO_GAMMU=$(BUILD_NO_GAMMU) - @echo BUILD_NO_PWMANAGER=$(BUILD_NO_PWMANAGER) - @echo -------------------------------------- - -variable_test: variable_info - @echo KDEPIM buildsystem, variablecheck... - ifndef KDEPIMDIR - @echo KDEPIMDIR is not defined. - $(error KDEPIMDIR is not defined) - endif - ifndef PLATFORM - @echo PLATFORM is not defined. - $(error PLATFORM is not defined) - endif - ifdef BUILD_NO_LDAP_PLUGIN - @echo LDAP PLUGIN will not be build, because BUILD_NO_LDAP_PLUGIN is set to $(BUILD_NO_LDAP_PLUGIN) - endif - ifdef BUILD_NO_OPIE_PLUGIN - @echo OPIE PLUGIN will not be build, because BUILD_NO_OPIE_PLUGIN is set to $(BUILD_NO_OPIE_PLUGIN) - endif - ifdef BUILD_NO_QTOPIA_PLUGIN - @echo QTOPIA PLUGIN will not be build, because BUILD_NO__QTOPIA_PLUGIN is set to $(BUILD_NO__QTOPIA_PLUGIN) - endif - ifdef BUILD_NO_MICROMAIL - @echo MICROMAIL will not be build, because BUILD_NO_MICROMAIL is set to $(BUILD_NO_MICROMAIL) - endif - ifdef BUILD_NO_SHARP_PLUGIN - @echo SHARP PLUGIN will not be build, because BUILD_NO_SHARP_PLUGIN is set to $(BUILD_NO_SHARP_PLUGIN) - else - ifndef SHARPDTMSDK - @echo SHARP PLUGIN can not be build, because SHARPDTMSDK is set to $(SHARPDTMSDK) - $(error SHARPDTMSDK is not defined) - endif - endif - ifdef BUILD_NO_GAMMU - @echo GAMMU will not be build, because BUILD_NO_GAMMU is set to $(BUILD_NO_GAMMU) - endif - ifdef BUILD_NO_PWMANAGER - @echo PWMANAGER will not be build, because BUILD_NO_PWMANAGER is set to $(BUILD_NO_PWMANAGER) - endif - @echo -------------------------------------- - - -objects: - for i in $(SUBDIRS); do mkdir -p $$i/obj/$(PLATFORM); done - for i in $(SUBDIRS); do mkdir -p $$i/moc/$(PLATFORM); done - mkdir -p libical/lib/$(PLATFORM) - mkdir -p pwmanager/libcrypt/$(PLATFORM) - -clean: - rm -rf libical/lib/$(PLATFORM)/*; - rm -rf pwmanager/libcrypt/$(PLATFORM)/*; - for i in $(SUBDIRS); do pushd $$i; make clean; rm -f *~;\ - rm -f obj/$(PLATFORM)/*; rm -f moc/$(PLATFORM)/*; rm Makefile$(PLATFORM); popd; \ - done - -install: - - cd bin/kdepim; make install - cp -r Pim $(QPEDIR)/apps - cp db2file/db2file $(QPEDIR)/bin/db2file - cp korganizer/korganizer.desktop $(QPEDIR)/apps/Pim/korganizer.desktop - cp kaddressbook/kaddressbook.desktop $(QPEDIR)/apps/Pim/kaddressbook.desktop - cp kmicromail/kmicromail.desktop $(QPEDIR)/apps/Pim/kopiemail.desktop - cp pwmanager/pwmanager/pwmanager.desktop $(QPEDIR)/apps/Pim/pwmanager.desktop - -dist: - @echo Dont forget to do "make install" before "make dist" - rm -f *arm.ipk - rm -f *~ - cd ..; tar czf kdepimpi-$(KDEPIM_VERSION).tar.gz --exclude=obj --exclude=moc --exclude=CVS --exclude=Makefilezaurus --exclude=Makefileqtopia kdepim - mkipks kmicrokdelibs.control - mkipks korganizer.control - mkipks kaddressbook.control - ifndef BUILD_NO_MICROMAIL - mkipks kopiemail.control - endif - mkipks korganizer-alarm.control - ifndef BUILD_NO_GAMMU - mkipks phoneaccess.control - endif - ifndef BUILD_NO_PWMANAGER - mkipks pwmanager.control - endif - mkipks pim_TAB_icon.control - -tmake: objects \ - qtcompat/Makefile$(PLATFORM) \ - microkde/Makefile$(PLATFORM) \ - libkcal/Makefile$(PLATFORM) \ - libkdepim/Makefile$(PLATFORM) \ - korganizer/Makefile$(PLATFORM) \ - kalarmd/Makefile$(PLATFORM) \ - libical/src/libical/Makefile$(PLATFORM) \ - libical/src/libicalss/Makefile$(PLATFORM) \ - kabc/Makefile$(PLATFORM) \ - kabc/formats/binary/Makefile$(PLATFORM) \ - kabc/plugins/file/Makefile$(PLATFORM) \ - kabc/plugins/dir/Makefile$(PLATFORM) \ - kabc/plugins/ldap/Makefile$(PLATFORM) \ - kabc/plugins/opie/Makefile$(PLATFORM) \ - kabc/plugins/qtopia/Makefile$(PLATFORM) \ - kabc/plugins/sharpdtm/Makefile$(PLATFORM) \ - kaddressbook/Makefile$(PLATFORM) \ - kmicromail/Makefile$(PLATFORM) \ - kmicromail/libetpan/Makefile$(PLATFORM) \ - kmicromail/libmailwrapper/Makefile$(PLATFORM) \ - gammu/emb/common/Makefile$(PLATFORM) \ - gammu/emb/gammu/Makefile$(PLATFORM) \ - pwmanager/pwmanager/Makefile$(PLATFORM) \ - pwmanager/libcrypt/mpi/Makefile$(PLATFORM) \ - pwmanager/libcrypt/error/Makefile$(PLATFORM) \ - pwmanager/libcrypt/cipher/Makefile$(PLATFORM) \ - pwmanager/libcrypt/zlib/Makefile$(PLATFORM) - -qtcompat/Makefile$(PLATFORM): qtcompat/qtcompat.pro - cd qtcompat; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtcompat.pro -o Makefile$(PLATFORM) - -microkde/Makefile$(PLATFORM): microkde/microkdeE.pro - cd microkde; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" microkdeE.pro -o Makefile$(PLATFORM) - -libkcal/Makefile$(PLATFORM): libkcal/libkcalE.pro - cd libkcal; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkcalE.pro -o Makefile$(PLATFORM) - - -libkdepim/Makefile$(PLATFORM): libkdepim/libkdepimE.pro - cd libkdepim; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libkdepimE.pro -o Makefile$(PLATFORM) - -kalarmd/Makefile$(PLATFORM): kalarmd/kalarmdE.pro - cd kalarmd; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kalarmdE.pro -o Makefile$(PLATFORM) - -korganizer/Makefile$(PLATFORM): korganizer/korganizerE.pro - cd korganizer; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" korganizerE.pro -o Makefile$(PLATFORM) - -libical/src/libical/Makefile$(PLATFORM): libical/src/libical/libicalE.pro - cd libical/src/libical; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalE.pro -o Makefile$(PLATFORM) - -libical/src/libicalss/Makefile$(PLATFORM): libical/src/libicalss/libicalssE.pro - cd libical/src/libicalss; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libicalssE.pro -o Makefile$(PLATFORM) - -kabc/Makefile$(PLATFORM): kabc/kabcE.pro - cd kabc; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcE.pro -o Makefile$(PLATFORM) - -kabc/formats/binary/Makefile$(PLATFORM): kabc/formats/binary/kabcformat_binaryE.pro - cd kabc/formats/binary; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kabcformat_binaryE.pro -o Makefile$(PLATFORM) - -kabc/plugins/file/Makefile$(PLATFORM): kabc/plugins/file/fileE.pro - cd kabc/plugins/file; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" fileE.pro -o Makefile$(PLATFORM) - -kabc/plugins/dir/Makefile$(PLATFORM): kabc/plugins/dir/dirE.pro - cd kabc/plugins/dir; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" dirE.pro -o Makefile$(PLATFORM) - -kabc/plugins/ldap/Makefile$(PLATFORM): kabc/plugins/ldap/ldapE.pro - cd kabc/plugins/ldap; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" ldapE.pro -o Makefile$(PLATFORM) - -kabc/plugins/opie/Makefile$(PLATFORM): kabc/plugins/opie/opieE.pro - cd kabc/plugins/opie; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" opieE.pro -o Makefile$(PLATFORM) - -kabc/plugins/qtopia/Makefile$(PLATFORM): kabc/plugins/qtopia/qtopiaE.pro - cd kabc/plugins/qtopia; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" qtopiaE.pro -o Makefile$(PLATFORM) - -kabc/plugins/sharpdtm/Makefile$(PLATFORM): kabc/plugins/sharpdtm/sharpdtmE.pro - cd kabc/plugins/sharpdtm; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" sharpdtmE.pro -o Makefile$(PLATFORM) - -kaddressbook/Makefile$(PLATFORM): kaddressbook/kaddressbookE.pro - cd kaddressbook; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kaddressbookE.pro -o Makefile$(PLATFORM) - -kmicromail/Makefile$(PLATFORM): kmicromail/kmicromailE.pro - cd kmicromail; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" kmicromailE.pro -o Makefile$(PLATFORM) - -kmicromail/libetpan/Makefile$(PLATFORM): kmicromail/libetpan/libetpanE.pro - cd kmicromail/libetpan; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libetpanE.pro -o Makefile$(PLATFORM) - -kmicromail/libmailwrapper/Makefile$(PLATFORM): kmicromail/libmailwrapper/libmailwrapperE.pro - cd kmicromail/libmailwrapper; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" libmailwrapperE.pro -o Makefile$(PLATFORM) - -gammu/emb/common/Makefile$(PLATFORM): gammu/emb/common/commonE.pro - cd gammu/emb/common; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" commonE.pro -o Makefile$(PLATFORM) - -gammu/emb/gammu/Makefile$(PLATFORM): gammu/emb/gammu/gammuE.pro - cd gammu/emb/gammu; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" gammuE.pro -o Makefile$(PLATFORM) - -pwmanager/pwmanager/Makefile$(PLATFORM): pwmanager/pwmanager/pwmanagerE.pro - cd pwmanager/pwmanager; tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" pwmanagerE.pro -o Makefile$(PLATFORM) - - -pwmanager/libcrypt/mpi/Makefile$(PLATFORM): pwmanager/libcrypt/mpi/mpi.pro - cd pwmanager/libcrypt/mpi;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" mpi.pro -o Makefile$(PLATFORM) - -pwmanager/libcrypt/error/Makefile$(PLATFORM): pwmanager/libcrypt/error/error.pro - cd pwmanager/libcrypt/error;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" error.pro -o Makefile$(PLATFORM) - -pwmanager/libcrypt/cipher/Makefile$(PLATFORM): pwmanager/libcrypt/cipher/cipher.pro - cd pwmanager/libcrypt/cipher;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" cipher.pro -o Makefile$(PLATFORM) - -pwmanager/libcrypt/zlib/Makefile$(PLATFORM): pwmanager/libcrypt/zlib/zlib.pro - cd pwmanager/libcrypt/zlib;tmake "CONFIG+=$(RELEASE_DEBUG)" "VERSION=$(KDEPIM_VERSION)" zlib.pro -o Makefile$(PLATFORM) - +############################################################################# +# Makefile for building: kdepim-desktop +# Generated by qmake (1.07a) (Qt 3.3.1) on: Mon Oct 25 11:25:22 2004 +# Project: kdepim-desktop.pro +# Template: subdirs +# Command: $(QMAKE) -o Makefile kdepim-desktop.pro +############################################################################# + +MAKEFILE = Makefile +QMAKE = qmake +DEL_FILE = rm -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p +SUBTARGETS = \ + sub-gammu-emb-common \ + sub-gammu-emb-gammu \ + sub-libical \ + sub-libkcal \ + sub-microkde \ + sub-libkdepim \ + sub-kabc \ + sub-korganizer \ + sub-kaddressbook \ + sub-kabc-plugins-file \ + sub-kabc-plugins-dir \ + sub-kabc-plugins-file \ + sub-kabc-plugins-qtopia \ + sub-pwmanager-libcrypt-cipher \ + sub-pwmanager-libcrypt-error \ + sub-pwmanager-libcrypt-mpi \ + sub-pwmanager-libcrypt-zlib \ + sub-pwmanager-pwmanager + +first: all + +all: Makefile $(SUBTARGETS) + +gammu/emb/common/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "gammu/emb/common" || $(MKDIR) "gammu/emb/common" + cd gammu/emb/common && $(QMAKE) common.pro -o $(MAKEFILE) +sub-gammu-emb-common: gammu/emb/common/$(MAKEFILE) FORCE + cd gammu/emb/common && $(MAKE) -f $(MAKEFILE) + +gammu/emb/gammu/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "gammu/emb/gammu" || $(MKDIR) "gammu/emb/gammu" + cd gammu/emb/gammu && $(QMAKE) gammu.pro -o $(MAKEFILE) +sub-gammu-emb-gammu: gammu/emb/gammu/$(MAKEFILE) FORCE + cd gammu/emb/gammu && $(MAKE) -f $(MAKEFILE) + +libical/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "libical" || $(MKDIR) "libical" + cd libical && $(QMAKE) libical.pro -o $(MAKEFILE) +sub-libical: libical/$(MAKEFILE) FORCE + cd libical && $(MAKE) -f $(MAKEFILE) + +libkcal/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "libkcal" || $(MKDIR) "libkcal" + cd libkcal && $(QMAKE) libkcal.pro -o $(MAKEFILE) +sub-libkcal: libkcal/$(MAKEFILE) FORCE + cd libkcal && $(MAKE) -f $(MAKEFILE) + +microkde/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "microkde" || $(MKDIR) "microkde" + cd microkde && $(QMAKE) microkde.pro -o $(MAKEFILE) +sub-microkde: microkde/$(MAKEFILE) FORCE + cd microkde && $(MAKE) -f $(MAKEFILE) + +libkdepim/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "libkdepim" || $(MKDIR) "libkdepim" + cd libkdepim && $(QMAKE) libkdepim.pro -o $(MAKEFILE) +sub-libkdepim: libkdepim/$(MAKEFILE) FORCE + cd libkdepim && $(MAKE) -f $(MAKEFILE) + +kabc/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kabc" || $(MKDIR) "kabc" + cd kabc && $(QMAKE) kabc.pro -o $(MAKEFILE) +sub-kabc: kabc/$(MAKEFILE) FORCE + cd kabc && $(MAKE) -f $(MAKEFILE) + +korganizer/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "korganizer" || $(MKDIR) "korganizer" + cd korganizer && $(QMAKE) korganizer.pro -o $(MAKEFILE) +sub-korganizer: korganizer/$(MAKEFILE) FORCE + cd korganizer && $(MAKE) -f $(MAKEFILE) + +kaddressbook/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kaddressbook" || $(MKDIR) "kaddressbook" + cd kaddressbook && $(QMAKE) kaddressbook.pro -o $(MAKEFILE) +sub-kaddressbook: kaddressbook/$(MAKEFILE) FORCE + cd kaddressbook && $(MAKE) -f $(MAKEFILE) + +kabc/plugins/file/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file" + cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE) +sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE + cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE) + +kabc/plugins/dir/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kabc/plugins/dir" || $(MKDIR) "kabc/plugins/dir" + cd kabc/plugins/dir && $(QMAKE) dir.pro -o $(MAKEFILE) +sub-kabc-plugins-dir: kabc/plugins/dir/$(MAKEFILE) FORCE + cd kabc/plugins/dir && $(MAKE) -f $(MAKEFILE) + +kabc/plugins/file/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kabc/plugins/file" || $(MKDIR) "kabc/plugins/file" + cd kabc/plugins/file && $(QMAKE) file.pro -o $(MAKEFILE) +sub-kabc-plugins-file: kabc/plugins/file/$(MAKEFILE) FORCE + cd kabc/plugins/file && $(MAKE) -f $(MAKEFILE) + +kabc/plugins/qtopia/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "kabc/plugins/qtopia" || $(MKDIR) "kabc/plugins/qtopia" + cd kabc/plugins/qtopia && $(QMAKE) qtopia.pro -o $(MAKEFILE) +sub-kabc-plugins-qtopia: kabc/plugins/qtopia/$(MAKEFILE) FORCE + cd kabc/plugins/qtopia && $(MAKE) -f $(MAKEFILE) + +pwmanager/libcrypt/cipher/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/cipher" || $(MKDIR) "pwmanager/libcrypt/cipher" + cd pwmanager/libcrypt/cipher && $(QMAKE) cipher.pro -o $(MAKEFILE) +sub-pwmanager-libcrypt-cipher: pwmanager/libcrypt/cipher/$(MAKEFILE) FORCE + cd pwmanager/libcrypt/cipher && $(MAKE) -f $(MAKEFILE) + +pwmanager/libcrypt/error/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/error" || $(MKDIR) "pwmanager/libcrypt/error" + cd pwmanager/libcrypt/error && $(QMAKE) error.pro -o $(MAKEFILE) +sub-pwmanager-libcrypt-error: pwmanager/libcrypt/error/$(MAKEFILE) FORCE + cd pwmanager/libcrypt/error && $(MAKE) -f $(MAKEFILE) + +pwmanager/libcrypt/mpi/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/mpi" || $(MKDIR) "pwmanager/libcrypt/mpi" + cd pwmanager/libcrypt/mpi && $(QMAKE) mpi.pro -o $(MAKEFILE) +sub-pwmanager-libcrypt-mpi: pwmanager/libcrypt/mpi/$(MAKEFILE) FORCE + cd pwmanager/libcrypt/mpi && $(MAKE) -f $(MAKEFILE) + +pwmanager/libcrypt/zlib/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "pwmanager/libcrypt/zlib" || $(MKDIR) "pwmanager/libcrypt/zlib" + cd pwmanager/libcrypt/zlib && $(QMAKE) zlib.pro -o $(MAKEFILE) +sub-pwmanager-libcrypt-zlib: pwmanager/libcrypt/zlib/$(MAKEFILE) FORCE + cd pwmanager/libcrypt/zlib && $(MAKE) -f $(MAKEFILE) + +pwmanager/pwmanager/$(MAKEFILE): + @$(CHK_DIR_EXISTS) "pwmanager/pwmanager" || $(MKDIR) "pwmanager/pwmanager" + cd pwmanager/pwmanager && $(QMAKE) pwmanager.pro -o $(MAKEFILE) +sub-pwmanager-pwmanager: pwmanager/pwmanager/$(MAKEFILE) FORCE + cd pwmanager/pwmanager && $(MAKE) -f $(MAKEFILE) + +Makefile: kdepim-desktop.pro /usr/lib/qt3/mkspecs/default/qmake.conf + $(QMAKE) -o Makefile kdepim-desktop.pro +qmake: qmake_all + @$(QMAKE) -o Makefile kdepim-desktop.pro + +all: $(SUBTARGETS) +qmake_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) + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d libical ] && cd libical ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d libkcal ] && cd libkcal ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d microkde ] && cd microkde ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d libkdepim ] && cd libkdepim ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kabc ] && cd kabc ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d korganizer ] && cd korganizer ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true + ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; grep "^qmake_all:" $(MAKEFILE) && $(MAKE) -f $(MAKEFILE) qmake_all; ) || true +clean uicables mocables uiclean mocclean lexclean yaccclean : qmake_all FORCE + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; ) || true + ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; ) || true +uninstall_subdirs: qmake_all FORCE + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true + ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) uninstall; ) || true +install_subdirs: qmake_all FORCE + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) install; ) || true + ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) install; ) || true +distclean: qmake_all FORCE + ( [ -d gammu/emb/common ] && cd gammu/emb/common ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d gammu/emb/gammu ] && cd gammu/emb/gammu ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d libical ] && cd libical ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d libkcal ] && cd libkcal ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d microkde ] && cd microkde ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d libkdepim ] && cd libkdepim ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kabc ] && cd kabc ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d korganizer ] && cd korganizer ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kaddressbook ] && cd kaddressbook ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kabc/plugins/dir ] && cd kabc/plugins/dir ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kabc/plugins/file ] && cd kabc/plugins/file ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d kabc/plugins/qtopia ] && cd kabc/plugins/qtopia ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d pwmanager/libcrypt/cipher ] && cd pwmanager/libcrypt/cipher ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d pwmanager/libcrypt/error ] && cd pwmanager/libcrypt/error ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d pwmanager/libcrypt/mpi ] && cd pwmanager/libcrypt/mpi ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d pwmanager/libcrypt/zlib ] && cd pwmanager/libcrypt/zlib ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + ( [ -d pwmanager/pwmanager ] && cd pwmanager/pwmanager ; $(MAKE) -f $(MAKEFILE) $@; $(DEL_FILE) $(MAKEFILE); ) || true + +install: install_subdirs + +uninstall: uninstall_subdirs + +FORCE: 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() bool KMainWindow::canBeRestored( int number ) { /*US we do not have and want to save sessioninformation. Use info from the default application config. */ //US if ( !kapp->isRestored() ) //US return FALSE; //US KConfig *config = kapp->sessionConfig(); KConfig *config = KGlobal::config(); if ( !config ) return FALSE; config->setGroup( QString::fromLatin1("Number") ); int n = config->readNumEntry( QString::fromLatin1("NumberOfWindows") , 1 ); return number >= 1 && number <= n; } const QString KMainWindow::classNameOfToplevel( int number ) { /*US we do not have and want to save sessioninformation. Use info from the default application config. */ //US if ( !kapp->isRestored() ) //US return QString::null; //US KConfig *config = kapp->sessionConfig(); KConfig *config = KGlobal::config(); if ( !config ) return QString::null; QString s; s.setNum( number ); s.prepend( QString::fromLatin1("WindowProperties") ); config->setGroup( s ); if ( !config->hasKey( QString::fromLatin1("ClassName") ) ) return QString::null; else return config->readEntry( QString::fromLatin1("ClassName") ); } bool KMainWindow::restore( int number, bool show ) { /*US we do not have and want to save sessioninformation. Use info from the default application config. */ if ( !canBeRestored( number ) ) return FALSE; //US KConfig *config = kapp->sessionConfig(); KConfig *config = KGlobal::config(); if ( readPropertiesInternal( config, number ) ){ if ( show ) KMainWindow::show(); return FALSE; } return FALSE; } void KMainWindow::setCaption( const QString &caption ) { //US setPlainCaption( kapp->makeStdCaption(caption) ); setPlainCaption( caption ); } void KMainWindow::setCaption( const QString &caption, bool modified ) { //US setPlainCaption( kapp->makeStdCaption(caption, true, modified) ); setPlainCaption( caption + "modified:" ); } void KMainWindow::setPlainCaption( const QString &caption ) { QMainWindow::setCaption( caption ); #ifndef Q_WS_QWS //US the following is disabled for the embedded version //US NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 ); //US info.setName( caption.utf8().data() ); #endif } void KMainWindow::slotStateChanged(const QString &newstate) { stateChanged(newstate, KXMLGUIClient::StateNoReverse); } /* * Get rid of this for KDE 4.0 */ void KMainWindow::slotStateChanged(const QString &newstate, KXMLGUIClient::ReverseStateChange reverse) { stateChanged(newstate, reverse); } void KMainWindow::closeEvent ( QCloseEvent *e ) { + //qDebug("MainWindow::closeEvent "); // Save settings if auto-save is enabled, and settings have changed if (d->settingsDirty && d->autoSaveSettings) saveAutoSaveSettings(); if (queryClose()) { e->accept(); int not_withdrawn = 0; /*US QPtrListIterator<KMainWindow> it(*KMainWindow::memberList); for (it.toFirst(); it.current(); ++it){ if ( !it.current()->isHidden() && it.current()->isTopLevel() && it.current() != this ) not_withdrawn++; } */ if ( !no_query_exit && not_withdrawn <= 0 ) { // last window close accepted? /*US if ( queryExit() && !kapp->sessionSaving()) { // Yes, Quit app? // don't call queryExit() twice disconnect(kapp, SIGNAL(shutDown()), this, SLOT(shuttingDown())); kapp->deref(); // ...and quit aplication. } else { // cancel closing, it's stupid to end up with no windows at all.... e->ignore(); } */ //US we have no sessionmanagement. Simply close app. if ( queryExit() ) { // Yes, Quit app? qDebug("KMainWindow::closeEvent: Exit application ???"); // don't call queryExit() twice //US disconnect(kapp, SIGNAL(shutDown()), this, SLOT(shuttingDown())); } } } } bool KMainWindow::queryExit() { return TRUE; } bool KMainWindow::queryClose() { return TRUE; } void KMainWindow::saveGlobalProperties( KConfig* ) { } void KMainWindow::readGlobalProperties( KConfig* ) { } void KMainWindow::savePropertiesInternal( KConfig *config, int number ) { bool oldASWS = d->autoSaveWindowSize; d->autoSaveWindowSize = true; // make saveMainWindowSettings save the window size QString s; s.setNum(number); s.prepend(QString::fromLatin1("WindowProperties")); config->setGroup(s); // store objectName, className, Width and Height for later restoring // (Only useful for session management) config->writeEntry(QString::fromLatin1("ObjectName"), name()); config->writeEntry(QString::fromLatin1("ClassName"), className()); saveMainWindowSettings(config); // Menubar, statusbar and Toolbar settings. s.setNum(number); config->setGroup(s); saveProperties(config); d->autoSaveWindowSize = oldASWS; } void KMainWindow::setStandardToolBarMenuEnabled( bool enable ) { if ( enable ) { if ( d->toolBarHandler ) return; d->toolBarHandler = new KDEPrivate::ToolBarHandler( this ); /*US if ( factory() ) factory()->addClient( d->toolBarHandler ); */ } else { if ( !d->toolBarHandler ) 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 @@ /* This file is part of the KDE libraries This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. $Id$ */ #ifndef KMAINWINDOW_H #define KMAINWINDOW_H /*US #include "kxmlguifactory.h" #include "kxmlguiclient.h" #include "kxmlguibuilder.h" #include <qmetaobject.h> class KPopupMenu; class KXMLGUIFactory; class KConfig; class KHelpMenu; class KStatusBar; class QStatusBar; class KMenuBar; class KMWSessionManaged; class KAccel; class KToolBarMenuAction; */ class QMenuBar; class QStatusBar; class KMainWindowPrivate; class KAction; #include <ktoolbar.h> #include <ktoolbarhandler.h> #include <kxmlguiclient.h> #include <qmainwindow.h> #include <qptrlist.h> class KActionCollection; class KMainWindow : public QMainWindow, virtual public KXMLGUIClient { Q_OBJECT private: //US create private defaultconstructor KMainWindow() {;}; -public: + public: /** * Construct a main window. * * @param parent The widget parent. This is usually 0 but it may also be the window * group leader. In that case, the KMainWindow becomes sort of a * secondary window. * * @param name The object name. For session management and window management to work * properly, all main windows in the application should have a * different name. When passing 0 (the default), KMainWindow will create * a unique name, but it's recommended to explicitly pass a window name that will * also describe the type of the window. If there can be several windows of the same * type, append '#' (hash) to the name, and KMainWindow will append numbers to make * the names unique. For example, for a mail client which has one main window showing * the mails and folders, and which can also have one or more windows for composing * mails, the name for the folders window should be e.g. "mainwindow" and * for the composer windows "composer#". * * @param f Specify the widget flags. The default is * WType_TopLevel and WDestructiveClose. TopLevel indicates that a * main window is a toplevel window, regardless of whether it has a * parent or not. DestructiveClose indicates that a main window is * automatically destroyed when its window is closed. Pass 0 if * you do not want this behavior. * * KMainWindows must be created on the heap with 'new', like: * <pre> KMainWindow *kmw = new KMainWindow (...</pre> **/ - KMainWindow( QWidget* parent = 0, const char *name = 0, WFlags f = WType_TopLevel | WDestructiveClose ); + //LR remove WDestructiveClose + KMainWindow( QWidget* parent = 0, const char *name = 0, WFlags f = WType_TopLevel /*| WDestructiveClose*/ ); /** * Destructor. * * Will also destroy the toolbars, and menubar if * needed. */ virtual ~KMainWindow(); /** * Retrieve the standard help menu. * * It contains entires for the * help system (activated by F1), an optional "What's This?" entry * (activated by Shift F1), an application specific dialog box, * and an "About KDE" dialog box. * * Example (adding a standard help menu to your application): * <pre> * KPopupMenu *help = helpMenu( <myTextString> ); * menuBar()->insertItem( i18n("&Help"), help ); * </pre> * * @param aboutAppText The string that is used in the application * specific dialog box. If you leave this string empty the * information in the global @ref KAboutData of the * application will be used to make a standard dialog box. * * @param showWhatsThis Set this to false if you do not want to include * the "What's This" menu entry. * * @return A standard help menu. */ //US KPopupMenu* helpMenu( const QString &aboutAppText = QString::null, //US bool showWhatsThis = TRUE ); /** * Returns the help menu. Creates a standard help menu if none exists yet. * * It contains entries for the * help system (activated by F1), an optional "What's This?" entry * (activated by Shift F1), an application specific dialog box, * and an "About KDE" dialog box. You must create the application * specific dialog box yourself. When the "About application" * menu entry is activated, a signal will trigger the * @ref showAboutApplication slot. See @ref showAboutApplication for more * information. * * Example (adding a help menu to your application): * <pre> * menuBar()->insertItem( i18n("&Help"), customHelpMenu() ); * </pre> * * @param showWhatsThis Set this to @p false if you do not want to include * the "What's This" menu entry. * * @return A standard help menu. */ //US KPopupMenu* customHelpMenu( bool showWhatsThis = TRUE ); /** * @sect Session Management * * Try to restore the toplevel widget as defined by the number (1..X). * * If the session did not contain so high a number, the configuration * is not changed and @p false returned. * * That means clients could simply do the following: * <pre> * if (kapp->isRestored()){ * int n = 1; * while (KMainWindow::canBeRestored(n)){ * (new childMW)->restore(n); * n++; * } * } else { * // create default application as usual * } * </pre> * Note that @ref QWidget::show() is called implicitly in restore. * * With this you can easily restore all toplevel windows of your * application. * * If your application uses different kinds of toplevel * windows, then you can use @ref KMainWindow::classNameOfToplevel(n) * to determine the exact type before calling the childMW * constructor in the example from above. * * If your client has only one kind of toplevel widgets (which * should be pretty usual) then you should use the RESTORE-macro * for backwards compatibility with 3.1 and 3.0 branches: * * <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$ #include <qlabel.h> #include <qlineedit.h> #include <qlayout.h> #include <qtooltip.h> #include <qwhatsthis.h> */ #include <qwidget.h> #include <qlayout.h> #include <qlabel.h> #include <qlineedit.h> #include <qpushbutton.h> #include <qapplication.h> /* * Constructs a getMasterPwWnd as a child of 'parent', with the * name 'name' */ getMasterPwWnd::getMasterPwWnd( QWidget* parent, const char* name) : KDialogBase( KDialogBase::Plain, i18n( "Master-password" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, parent, name, true ) { QWidget *page = plainPage(); QVBoxLayout *pageLayout = new QVBoxLayout( page ); pwLineEdit = new QLineEdit( page, "pwLineEdit" ); pwLineEdit->setEchoMode( QLineEdit::Password ); QLabel* textLabel1 = new QLabel( pwLineEdit, i18n("Please enter the master-password:"), page, "textLabel1" ); textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignCenter ) ); pageLayout->addWidget(textLabel1); pageLayout->addWidget(pwLineEdit); QWidget* numberBox = new QWidget( page ); #ifndef DESKTOP_VERSION if ( QApplication::desktop()->width() > 320 ) { numberBox->setFixedHeight(250); numberBox->setFixedWidth(200); } else{ numberBox->setFixedHeight(150); numberBox->setFixedWidth(150); } #endif QGridLayout* numberLayout = new QGridLayout( numberBox, 4, 3 ); numberLayout->setMargin( 0 ); numberLayout->setSpacing( 0 ); QPushButton* p1 = new QPushButton( i18n("1"), numberBox ); numberLayout->addWidget( p1, 0, 0 ); QPushButton* p2 = new QPushButton( i18n("2"), numberBox ); numberLayout->addWidget( p2, 0, 1 ); QPushButton* p3 = new QPushButton( i18n("3"), numberBox ); numberLayout->addWidget( p3, 0, 2 ); QPushButton* p4 = new QPushButton( i18n("4"), numberBox ); numberLayout->addWidget( p4, 1, 0 ); QPushButton* p5 = new QPushButton( i18n("5"), numberBox ); numberLayout->addWidget( p5, 1, 1 ); QPushButton* p6 = new QPushButton( i18n("6"), numberBox ); numberLayout->addWidget( p6, 1, 2 ); QPushButton* p7 = new QPushButton( i18n("7"), numberBox ); numberLayout->addWidget( p7, 2, 0 ); QPushButton* p8 = new QPushButton( i18n("8"), numberBox ); numberLayout->addWidget( p8, 2, 1 ); QPushButton* p9 = new QPushButton( i18n("9"), numberBox ); numberLayout->addWidget( p9, 2, 2 ); QPushButton* clear = new QPushButton( i18n("x"), numberBox ); numberLayout->addWidget( clear, 3, 0 ); QPushButton* p0 = new QPushButton( i18n("0"), numberBox ); numberLayout->addWidget( p0, 3, 1 ); QPushButton* backspace = new QPushButton( i18n("-"), numberBox ); numberLayout->addWidget( backspace, 3, 2 ); pageLayout->addWidget(numberBox); #ifdef DESKTOP_VERSION resize( sizeHint() ); #else resize( 200,sizeHint().height() ); #endif connect( p0, SIGNAL( clicked() ), this, SLOT( add0() ) ); connect( p1, SIGNAL( clicked() ), this, SLOT( add1() ) ); connect( p2, SIGNAL( clicked() ), this, SLOT( add2() ) ); connect( p3, SIGNAL( clicked() ), this, SLOT( add3() ) ); connect( p4, SIGNAL( clicked() ), this, SLOT( add4() ) ); connect( p5, SIGNAL( clicked() ), this, SLOT( add5() ) ); connect( p6, SIGNAL( clicked() ), this, SLOT( add6() ) ); connect( p7, SIGNAL( clicked() ), this, SLOT( add7() ) ); connect( p8, SIGNAL( clicked() ), this, SLOT( add8() ) ); connect( p9, SIGNAL( clicked() ), this, SLOT( add9() ) ); connect( backspace, SIGNAL( clicked() ), this, SLOT( backspace() ) ); connect( clear, SIGNAL( clicked() ), this, SLOT( clear() ) ); - + pwLineEdit->setFocus(); } /* * Destroys the object and frees any allocated resources */ getMasterPwWnd::~getMasterPwWnd() { // no need to delete child widgets, Qt does it all for us } void getMasterPwWnd::okButton_slot() { qWarning( "getMasterPwWnd::okButton_slot(): Not implemented yet" ); } void getMasterPwWnd::cancelButton_slot() { qWarning( "getMasterPwWnd::cancelButton_slot(): Not implemented yet" ); } void getMasterPwWnd::add0() { addCharacter("0"); } void getMasterPwWnd::add1() { addCharacter("1"); } void getMasterPwWnd::add2() { addCharacter("2"); } void getMasterPwWnd::add3() { addCharacter("3"); } void getMasterPwWnd::add4() { addCharacter("4"); } void getMasterPwWnd::add5() { addCharacter("5"); } void getMasterPwWnd::add6() { addCharacter("6"); } void getMasterPwWnd::add7() { addCharacter("7"); } void getMasterPwWnd::add8() { addCharacter("8"); } void getMasterPwWnd::add9() { addCharacter("9"); } void getMasterPwWnd::backspace() { QString old = pwLineEdit->text(); old.truncate(old.length()-1); pwLineEdit->setText(old); } void getMasterPwWnd::clear() { pwLineEdit->setText(""); } void getMasterPwWnd::addCharacter(const QString& s) { QString old = pwLineEdit->text(); pwLineEdit->setText(old + s); } 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 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, KDialog::spacingHint() ); QTabWidget *tabWidget = new QTabWidget( this ); topLayout->addWidget( tabWidget ); // windowsStyle page ////////////////////////////////////////////////////// QWidget *windowStylePage = new QWidget( this ); QGridLayout *windowStyleLayout = new QGridLayout( windowStylePage, 3, 3); int i = 0; KPrefsWidRadios * windowStyle = addWidRadios(i18n("Window-style:") ,&(prefs->mMainViewStyle), windowStylePage); windowStyle->addRadio(i18n("Category on top")); windowStyle->addRadio(i18n("Category-list left/top")); windowStyleLayout->addMultiCellWidget( (QWidget*)windowStyle->groupBox(),i,i,0,2); ++i; QLabel* lab = new QLabel(i18n("<b>Font for Password entries:</b>"), windowStylePage); windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); ++i; KPrefsWidFont *selEntrFont = addWidFont(i18n("Password"),i18n("Font:"), &(prefs->mEntryFont),windowStylePage); windowStyleLayout->addWidget(selEntrFont->label(),i,0); windowStyleLayout->addWidget(selEntrFont->preview(),i,1); windowStyleLayout->addWidget(selEntrFont->button(),i,2); ++i; lab = new QLabel(i18n(""), windowStylePage); windowStyleLayout->addMultiCellWidget( lab,i,i,0,2); // File page ////////////////////////////////////////////////////// QWidget *filePage = new QWidget( this ); QGridLayout *fileLayout = new QGridLayout( filePage, 3, 2); i = 0; QLabel* kcfg_compression_label = new QLabel(i18n("Compression:"), filePage); fileLayout->addWidget(kcfg_compression_label,i,0); kcfg_compression = new QComboBox(filePage, "kcfg_compression"); kcfg_compression->insertItem(i18n("None")); kcfg_compression->insertItem(i18n("gzip")); //US not yet supported: kcfg_compression->insertItem(i18n("bzip2")); fileLayout->addWidget( kcfg_compression,i,1); ++i; QLabel* kcfg_crypt_label = new QLabel(i18n("Encryption:"), filePage); fileLayout->addWidget(kcfg_crypt_label,i,0); kcfg_cryptAlgo = new QComboBox(filePage, "kcfg_cryptAlgo"); kcfg_cryptAlgo->insertItem(i18n("Blowfish (128 bit)")); #ifdef CONFIG_PWMANAGER_GCRY kcfg_cryptAlgo->insertItem(i18n("AES-128, Rijndael (128 bit)")); kcfg_cryptAlgo->insertItem(i18n("AES-192, Rijndael (192 bit)")); kcfg_cryptAlgo->insertItem(i18n("AES-256, Rijndael (256 bit)")); kcfg_cryptAlgo->insertItem(i18n("Triple-DES (168 bit)")); kcfg_cryptAlgo->insertItem(i18n("Twofish (256 bit)")); kcfg_cryptAlgo->insertItem(i18n("Twofish-128 (128 bit)")); #endif // CONFIG_PWMANAGER_GCRY fileLayout->addWidget( kcfg_cryptAlgo,i,1); ++i; QLabel* kcfg_hash_label = new QLabel(i18n("Hashing:"), filePage); fileLayout->addWidget(kcfg_hash_label,i,0); kcfg_hashAlgo = new QComboBox(filePage, "kcfg_hashAlgo"); kcfg_hashAlgo->insertItem(i18n("SHA-160, SHA1 (160 bit)")); #ifdef CONFIG_PWMANAGER_GCRY kcfg_hashAlgo->insertItem(i18n("SHA-256 (256 bit)")); kcfg_hashAlgo->insertItem(i18n("SHA-384 (384 bit)")); kcfg_hashAlgo->insertItem(i18n("SHA-512 (512 bit)")); kcfg_hashAlgo->insertItem(i18n("MD5 (128 bit)")); kcfg_hashAlgo->insertItem(i18n("RIPE-MD-160 (160 bit)")); kcfg_hashAlgo->insertItem(i18n("Tiger (192 bit)")); #endif // CONFIG_PWMANAGER_GCRY fileLayout->addWidget( kcfg_hashAlgo,i,1); ++i; permissionLineEdit = new QLineEdit(filePage); QLabel* permissionLineLabel = new QLabel(permissionLineEdit, i18n("Permissions:"), filePage); fileLayout->addWidget(permissionLineLabel,i,0); fileLayout->addWidget(permissionLineEdit,i,1); ++i; KPrefsWidBool *sb = addWidBool(i18n("Make backup before saving"), &(prefs->mMakeFileBackup),filePage); fileLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); ++i; // Timeout page ////////////////////////////////////////////////////// QWidget *timeoutPage = new QWidget( this ); QGridLayout *timeoutLayout = new QGridLayout( timeoutPage, 3, 2); i = 0; - pwTimeoutSpinBox = new QSpinBox( timeoutPage, "pwTimeoutSpinBox" ); + pwTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "pwTimeoutSpinBox" ); 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); timeoutLayout->addMultiCellWidget(timeoutLabel,i, i, 0 ,0); timeoutLayout->addWidget(pwTimeoutSpinBox,i,1); ++i; - lockTimeoutSpinBox = new QSpinBox( timeoutPage, "lockTimeoutSpinBox" ); + lockTimeoutSpinBox = new QSpinBox( 0,600,10,timeoutPage, "lockTimeoutSpinBox" ); 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); timeoutLayout->addMultiCellWidget(lockTimeoutLabel,i, i, 0 ,0); timeoutLayout->addWidget(lockTimeoutSpinBox,i,1); ++i; sb = addWidBool(i18n("deep-lock on autolock"), &(prefs->mAutoDeeplock),timeoutPage); timeoutLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); ++i; // Autostart page ////////////////////////////////////////////////////// QWidget *autostartPage = new QWidget( this ); QGridLayout *autostartLayout = new QGridLayout( autostartPage, 3, 2); i = 0; autostartLineEdit = new KURLRequester(autostartPage, "autoStartLineEdit"); QLabel* autostartLineLabel = new QLabel(autostartLineEdit, "Open this file automatically on startup:",autostartPage); autostartLayout->addMultiCellWidget(autostartLineLabel,i,i,0,1); ++i; autostartLayout->addMultiCellWidget(autostartLineEdit,i,i,0,1); ++i; sb = addWidBool(i18n("open deeplocked"), &(prefs->mAutostartDeeplocked),autostartPage); autostartLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); ++i; // external app page ////////////////////////////////////////////////////// QWidget *externalappPage = new QWidget( this ); QGridLayout *externalappLayout = new QGridLayout( externalappPage, 3, 2); i = 0; browserLineEdit = new QLineEdit(externalappPage); QLabel* browserLineLabel = new QLabel(browserLineEdit, i18n("Favourite browser:"), externalappPage); externalappLayout->addWidget(browserLineLabel,i,0); externalappLayout->addWidget(browserLineEdit,i,1); ++i; xtermLineEdit = new QLineEdit(externalappPage); QLabel* xtermLineLabel = new QLabel(xtermLineEdit, i18n("Favourite x-terminal:"), externalappPage); externalappLayout->addWidget(xtermLineLabel,i,0); externalappLayout->addWidget(xtermLineEdit,i,1); ++i; // miscelaneous page ////////////////////////////////////////////////////// QWidget *miscPage = new QWidget( this ); QGridLayout *miscLayout = new QGridLayout( miscPage, 3, 2); i = 0; /*US ENH: PWM/Pi has no tray and con be minimized sb = addWidBool(i18n("Show icon in system-tray"),&(prefs->mTray),miscPage); miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); ++i; */ sb = addWidBool(i18n("Open document with passwords unlocked"),&(prefs->mUnlockOnOpen),miscPage); miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); ++i; /*US ENH: PWM/Pi has no tray and con be minimized sb = addWidBool(i18n("auto-minimize to tray on startup"),&(prefs->mAutoMinimizeOnStart),miscPage); miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); ++i; KPrefsWidRadios * minimizeRadio = addWidRadios(i18n("auto-lock on minimize:") ,&(prefs->mMinimizeLock), miscPage); minimizeRadio->addRadio(i18n("don't lock")); minimizeRadio->addRadio(i18n("normal lock")); minimizeRadio->addRadio(i18n("deep-lock")); miscLayout->addMultiCellWidget( (QWidget*)minimizeRadio->groupBox(),i,i,0,2); ++i; sb = addWidBool(i18n("KWallet emulation"),&(prefs->mKWalletEmu),miscPage); miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); ++i; sb = addWidBool(i18n("Close instead Minimize into tray"),&(prefs->mClose),miscPage); miscLayout->addMultiCellWidget(sb->checkBox(), i,i,0,1); ++i; */ tabWidget->addTab( windowStylePage, i18n( "Look && feel" ) ); tabWidget->addTab( filePage, i18n( "File" ) ); tabWidget->addTab( timeoutPage, i18n( "Timeout" ) ); tabWidget->addTab( autostartPage, i18n( "Autostart" ) ); tabWidget->addTab( externalappPage, i18n( "External apps" ) ); 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, size_t pwlen, STRING2KEY *s2k, bool create) { // This function is derived from GnuPG-1.2.5-rc2 gcry_md_hd_t md; gcry_error_t err; bool ret = true; size_t pass, i; size_t used = 0; PWM_ASSERT(s2k->hash_algo); BUG_ON(!(dek->keylen > 0 && dek->keylen <= array_size(dek->key))); err = gcry_md_open(&md, s2k->hash_algo, 0); if (err != GPG_ERR_NO_ERROR) { ret = false; goto out; } for (pass = 0; used < dek->keylen; pass++) { if (pass) { gcry_md_reset(md); for (i = 0; i < pass; i++) // preset the hash context gcry_md_putc(md, 0); } if (s2k->mode == 1 || s2k->mode == 3) { size_t len2 = pwlen + 8; size_t count = len2; if (create && !pass) { Randomizer *rnd = Randomizer::obj(); const unsigned int salt_len = 8; string rndBuf(rnd->genRndBuf(salt_len)); memcpy(s2k->salt, rndBuf.c_str(), salt_len); if (s2k->mode == 3) s2k->count = 96; // 65536 iterations } if (s2k->mode == 3) { count = (16ul + (s2k->count & 15)) << ((s2k->count >> 4) + 6); if (count < len2) count = len2; } // a little bit complicated because we need a ulong for count while (count > len2) { // maybe iterated+salted gcry_md_write(md, s2k->salt, 8); gcry_md_write(md, pw, pwlen); count -= len2; } if (count < 8) { gcry_md_write(md, s2k->salt, count); } else { gcry_md_write(md, s2k->salt, 8); count -= 8; gcry_md_write(md, pw, count); } } else gcry_md_write(md, pw, pwlen); gcry_md_final(md); i = gcry_md_get_algo_dlen(s2k->hash_algo); if (i > dek->keylen - used) i = dek->keylen - used; memcpy(dek->key+used, gcry_md_read(md, s2k->hash_algo), i); used += i; } gcry_md_close(md); out: return ret; } void LibGCryptIf::padData(unsigned char *buf, size_t bufLen, size_t boundary) { size_t numPadBytes = boundary - ((bufLen + 1) % boundary); buf[bufLen] = static_cast<char>(0x01); size_t i = 0; Randomizer *rnd = Randomizer::obj(); char c; unsigned char *b; while (i < numPadBytes) { c = rnd->genRndChar(); if (c == static_cast<char>(0x01)) continue; b = buf + bufLen + 1 + i; *b = c; ++i; } } void LibGCryptIf::unpadData(const unsigned char *buf, size_t *bufLen) { size_t pos; BUG_ON(*bufLen % 8); pos = *bufLen - 1; while (buf[pos] != static_cast<char>(0x01)) { + qDebug("pos %d %d %d", pos, buf[pos], static_cast<char>(0x01) ); BUG_ON(!pos); + //LR BUG we should terminte the loop if p == 0 + if ( pos == 0 ) + break; --pos; } *bufLen = pos; + qDebug("ente "); } #endif // CONFIG_PWMANAGER_GCRY 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) "Gentoo ebuild maintainer."), "elias.probst@gmx.de"); aboutData->addCredit("George Staikos", I18N_NOOP("KWallet"), "staikos@kde.org"); aboutData->addCredit("Matthew Palmer", I18N_NOOP("rc2 code"), "mjp16@uow.edu.au"); aboutData->addCredit("Olivier Sessink", I18N_NOOP("gpasman"), "gpasman@nl.linux.org"); aboutData->addCredit("The libgcrypt developers", I18N_NOOP("Blowfish and SHA1 algorithms"), 0, "ftp://ftp.gnupg.org/gcrypt/alpha/libgcrypt/"); aboutData->addCredit("Troy Engel", I18N_NOOP("kpasman"), "tengel@sonic.net"); aboutData->addCredit("Wickey", I18N_NOOP("graphics-design in older versions."), "wickey@gmx.at"); aboutData->addCredit("Ian MacGregor", I18N_NOOP( "original documentation author.")); } #endif int main(int argc, char *argv[]) { printDebugConfigureInfo(); #ifndef PWM_EMBEDDED KAboutData aboutData(PACKAGE_NAME, PROG_NAME, PACKAGE_VER, description, KAboutData::License_File, "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0, "http://passwordmanager.sourceforge.net/", "mbuesch@freenet.de"); addAuthors(&aboutData); KCmdLineArgs::init(argc, argv, &aboutData); KCmdLineArgs::addCmdLineOptions(options); KUniqueApplication::addCmdLineOptions(); if (!KUniqueApplication::start()) { printInfo("already running."); return EXIT_SUCCESS; } PwMApplication a; aboutData.setLicenseTextFile(LICENSE_FILE); return a.exec(); #else bool exitHelp = false; if ( argc > 1 ) { QString command = argv[1]; if ( command == "-help" ){ printf("PWM/PI command line commands:\n"); printf(" no command: Start PWM/PI in usual way\n"); printf(" -help: This output\n"); printf(" PWM/PI is exiting now. Bye!\n"); exitHelp = true; } } if ( ! exitHelp ) { PwMApplication a(argc, argv); KGlobal::setAppName( "pwmanager" ); #ifndef DESKTOP_VERSION //qDebug("width %d ",QApplication::desktop()->width() ); if ( QApplication::desktop()->width() > 320 ) KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/"); else KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/"); #else QString fileName ; fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); QApplication::addLibraryPath ( qApp->applicationDirPath () ); #endif KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); KPimGlobalPrefs::instance()->setGlobalConfig(); a.newInstance(); //US KAddressBookMain m ; //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); /*US #ifndef DESKTOP_VERSION a.showMainWidget( &m ); #else a.setMainWidget( &m ); m.resize (640, 480 ); m.show(); #endif */ + QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit())); a.exec(); KPimGlobalPrefs::instance()->writeConfig(); } qDebug("PWMPI: Bye! "); #endif } 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 { #ifdef CONFIG_KEYCARD BUTTON_POPUP_CHIPCARD_GENNEW = 0, BUTTON_POPUP_CHIPCARD_DEL, BUTTON_POPUP_CHIPCARD_READID, BUTTON_POPUP_CHIPCARD_SAVEBACKUP, BUTTON_POPUP_CHIPCARD_REPLAYBACKUP #else // CONFIG_KEYCARD BUTTON_POPUP_CHIPCARD_NO = 0 #endif // CONFIG_KEYCARD }; // Button IDs for "view" popup menu enum { BUTTON_POPUP_VIEW_FIND = 0, BUTTON_POPUP_VIEW_LOCK, BUTTON_POPUP_VIEW_DEEPLOCK, BUTTON_POPUP_VIEW_UNLOCK }; // Button IDs for "options" popup menu enum { BUTTON_POPUP_OPTIONS_CONFIG = 0 }; // Button IDs for "export" popup menu (in "file" popup menu) enum { BUTTON_POPUP_EXPORT_TEXT = 0, BUTTON_POPUP_EXPORT_GPASMAN, BUTTON_POPUP_EXPORT_CSV #ifdef CONFIG_KWALLETIF ,BUTTON_POPUP_EXPORT_KWALLET #endif }; // Button IDs for "import" popup menu (in "file" popup menu) enum { BUTTON_POPUP_IMPORT_TEXT = 0, BUTTON_POPUP_IMPORT_GPASMAN, BUTTON_POPUP_IMPORT_CSV #ifdef CONFIG_KWALLETIF ,BUTTON_POPUP_IMPORT_KWALLET #endif }; #ifdef PWM_EMBEDDED // Button IDs for "help" popup menu enum { BUTTON_POPUP_HELP_LICENSE = 0, BUTTON_POPUP_HELP_FAQ, BUTTON_POPUP_HELP_ABOUT, BUTTON_POPUP_HELP_SYNC, BUTTON_POPUP_HELP_WHATSNEW }; #endif // Button IDs for toolbar enum { BUTTON_TOOL_NEW = 0, BUTTON_TOOL_OPEN, BUTTON_TOOL_SAVE, BUTTON_TOOL_SAVEAS, BUTTON_TOOL_PRINT, BUTTON_TOOL_ADD, BUTTON_TOOL_EDIT, BUTTON_TOOL_DEL, BUTTON_TOOL_FIND, BUTTON_TOOL_LOCK, BUTTON_TOOL_DEEPLOCK, BUTTON_TOOL_UNLOCK }; PwM::PwM(PwMInit *_init, PwMDoc *doc, bool virginity, QWidget *parent, const char *name) : KMainWindow(parent, "HALLO") , forceQuit (false) , forceMinimizeToTray (false) { syncManager = 0; virgin = !virginity; init = _init; connect(doc, SIGNAL(docClosed(PwMDoc *)), this, SLOT(docClosed(PwMDoc *))); initMenubar(); initToolbar(); initMetrics(); setVirgin(virginity); setFocusPolicy(QWidget::WheelFocus); #ifndef PWM_EMBEDDED statusBar()->show(); #endif view = makeNewListView(doc); setCentralWidget(view); updateCaption(); showStatMsg(i18n("Ready.")); } PwM::~PwM() { - //qDebug("PwM::~PwM()"); + qDebug("PwM::~PwM() %x", this); disconnect(curDoc(), SIGNAL(docClosed(PwMDoc *)), this, SLOT(docClosed(PwMDoc *))); conf()->confWndMainWndSize(size()); - emit closed(this); + //LR closing of windows changed + //needed for fastload option on PDA + //emit closed(this); //qDebug("PwM::~PwM() emited closed(this)"); delete view; delete syncManager; } void PwM::initMenubar() { KIconLoader* picons; #ifndef PWM_EMBEDDED KIconLoader icons; picons = &icons; #else picons = KGlobal::iconLoader(); syncPopup = new KPopupMenu(this); syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::PWMPI, PWMPrefs::instance(), syncPopup); syncManager->setBlockSave(false); connect ( syncPopup, SIGNAL( activated ( int ) ), syncManager, SLOT (slotSyncMenu( int ) ) ); syncManager->fillSyncMenu(); #endif filePopup = new KPopupMenu(this); importPopup = new KPopupMenu(filePopup); exportPopup = new KPopupMenu(filePopup); managePopup = new KPopupMenu(this); #ifdef CONFIG_KEYCARD chipcardPopup = new KPopupMenu(this); #endif // CONFIG_KEYCARD viewPopup = new KPopupMenu(this); optionsPopup = new KPopupMenu(this); // "file" popup menu filePopup->insertItem(QIconSet(picons->loadIcon("filenew", KIcon::Small)), i18n("&New"), this, SLOT(new_slot()), 0, BUTTON_POPUP_FILE_NEW); filePopup->insertItem(QIconSet(picons->loadIcon("fileopen", KIcon::Small)), i18n("&Open"), this, SLOT(open_slot()), 0, BUTTON_POPUP_FILE_OPEN); filePopup->insertItem(QIconSet(picons->loadIcon("fileclose", KIcon::Small)), i18n("&Close"), this, SLOT(close_slot()), 0, BUTTON_POPUP_FILE_CLOSE); filePopup->insertSeparator(); filePopup->insertItem(QIconSet(picons->loadIcon("filesave", KIcon::Small)), i18n("&Save"), this, SLOT(save_slot()), 0, BUTTON_POPUP_FILE_SAVE); filePopup->insertItem(QIconSet(picons->loadIcon("filesaveas", KIcon::Small)), i18n("Save &as..."), this, SLOT(saveAs_slot()), 0, BUTTON_POPUP_FILE_SAVEAS); filePopup->insertSeparator(); // "file/export" popup menu exportPopup->insertItem(i18n("&Text-file..."), this, SLOT(exportToText()), 0, BUTTON_POPUP_EXPORT_TEXT); exportPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, SLOT(exportToGpasman()), 0, BUTTON_POPUP_EXPORT_GPASMAN); exportPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, SLOT(exportToCsv()), 0, BUTTON_POPUP_EXPORT_CSV); #ifdef CONFIG_KWALLETIF exportPopup->insertItem(i18n("&KWallet..."), this, SLOT(exportToKWallet()), 0, BUTTON_POPUP_EXPORT_KWALLET); #endif filePopup->insertItem(QIconSet(picons->loadIcon("fileexport", KIcon::Small)), i18n("E&xport"), exportPopup, BUTTON_POPUP_FILE_EXPORT); // "file/import" popup menu importPopup->insertItem(i18n("&Text-file..."), this, SLOT(importFromText()), 0, BUTTON_POPUP_IMPORT_TEXT); importPopup->insertItem(i18n("&Gpasman / Kpasman ..."), this, SLOT(importFromGpasman()), 0, BUTTON_POPUP_IMPORT_GPASMAN); importPopup->insertItem(i18n("&CSV (Comma Separated Value) ..."), this, SLOT(importCsv()), 0, BUTTON_POPUP_IMPORT_CSV); #ifdef CONFIG_KWALLETIF importPopup->insertItem(i18n("&KWallet..."), this, SLOT(importKWallet()), 0, BUTTON_POPUP_IMPORT_KWALLET); #endif filePopup->insertItem(QIconSet(picons->loadIcon("fileimport", KIcon::Small)), i18n("I&mport"), importPopup, BUTTON_POPUP_FILE_IMPORT); filePopup->insertSeparator(); filePopup->insertItem(QIconSet(picons->loadIcon("fileprint", KIcon::Small)), i18n("&Print..."), this, SLOT(print_slot()), 0, BUTTON_POPUP_FILE_PRINT); filePopup->insertSeparator(); filePopup->insertItem(QIconSet(picons->loadIcon("exit", KIcon::Small)), i18n("&Quit"), this, SLOT(quitButton_slot()), 0, BUTTON_POPUP_FILE_QUIT); menuBar()->insertItem(i18n("&File"), filePopup); // "manage" popup menu managePopup->insertItem(QIconSet(picons->loadIcon("pencil", KIcon::Small)), i18n("&Add password"), this, SLOT(addPwd_slot()), 0, BUTTON_POPUP_MANAGE_ADD); managePopup->insertItem(QIconSet(picons->loadIcon("edit", KIcon::Small)), @@ -794,197 +796,201 @@ void PwM::deletePwd_slot() void PwM::changeMasterPwd_slot() { PWM_ASSERT(curDoc()); curDoc()->changeCurrentPw(); } void PwM::lockWnd_slot() { PWM_ASSERT(curDoc()); curDoc()->lockAll(true); } void PwM::deepLockWnd_slot() { PWM_ASSERT(curDoc()); curDoc()->deepLock(); } void PwM::unlockWnd_slot() { PWM_ASSERT(curDoc()); curDoc()->lockAll(false); } void PwM::config_slot() { int oldStyle = conf()->confWndMainViewStyle(); #ifdef PWM_EMBEDDED KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"pwmconfigdialog", true ); KCMPwmConfig* pwmcfg = new KCMPwmConfig( ConfigureDialog->getNewVBoxPage(i18n( "PwManager")) , "KCMPwmConfig" ); ConfigureDialog->addModule(pwmcfg ); KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); ConfigureDialog->addModule(kdelibcfg ); #ifndef DESKTOP_VERSION ConfigureDialog->showMaximized(); #endif if ( ConfigureDialog->exec() ) KMessageBox::information( this, i18n("Some changes are only\neffective after a restart!\n") ); delete ConfigureDialog; #else //PWM_EMBEDDED // display the configuration window (modal mode) if (!conf()->showConfWnd(this)) return; #endif int newStyle = conf()->confWndMainViewStyle(); // reinitialize tray init->initTray(); // reinitialize KWallet emulation init->initKWalletEmu(); PwMDocList *_dl = PwMDoc::getOpenDocList(); const vector<PwMDocList::listItem> *dl = _dl->getList(); vector<PwMDocList::listItem>::const_iterator i = dl->begin(), end = dl->end(); PwMDoc *doc; while (i != end) { doc = (*i).doc; // unlock-without-mpw timeout doc->timer()->start(DocTimer::id_mpwTimer); // auto-lock timeout doc->timer()->start(DocTimer::id_autoLockTimer); ++i; } const QValueList<PwM *> *ml = init->mainWndList(); #ifndef PWM_EMBEDDED QValueList<PwM *>::const_iterator i2 = ml->begin(), end2 = ml->end(); #else QValueList<PwM *>::ConstIterator i2 = ml->begin(), end2 = ml->end(); #endif PwM *pwm; while (i2 != end2) { pwm = *i2; // reinitialize the window style. if (oldStyle != newStyle) pwm->curView()->initStyle(newStyle); // set the new font pwm->curView()->setFont(conf()->confGlobEntryFont()); ++i2; } } void PwM::activateMpButton(bool activate) { managePopup->setItemEnabled(BUTTON_POPUP_MANAGE_CHANGEMP, activate); } void PwM::closeEvent(QCloseEvent *e) { + qDebug("PwM::closeEvent "); + emit closed( this ); + return; e->accept(); } void PwM::docClosed(PwMDoc *doc) { + qDebug("PwM::docClosed "); PARAM_UNUSED(doc); PWM_ASSERT(doc == curDoc()); close(); } void PwM::find_slot() { PWM_ASSERT(curDoc()); if (curDoc()->isDocEmpty()) return; if (curDoc()->isDeepLocked()) return; curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); FindWndImpl findWnd(view); findWnd.exec(); curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); } void PwM::exportToText() { PWM_ASSERT(curDoc()); if (curDoc()->isDocEmpty()) { KMessageBox::information(this, i18n ("Sorry, there's nothing to export.\n" "Please first add some passwords."), i18n("nothing to do")); return; } curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); QString fn(KFileDialog::getSaveFileName(QString::null, i18n("*|plain-text file"), this)); if (fn == "") { curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); return; } PwMerror ret = curDoc()->exportToText(&fn); if (ret != e_success) { KMessageBox::error(this, i18n("Error: Couldn't write to file.\n" "Please check if you have permission to write\n" "to the file in that directory."), i18n("error while writing")); } else showStatMsg(i18n("Successfully exported data.")); curDoc()->timer()->putLock(DocTimer::id_autoLockTimer); } bool PwM::importFromText() { if (!isVirgin()) { if (KMessageBox::questionYesNo(this, i18n("Do you want to import the data\n" "into the current document? (If you\n" "select \"no\", a new document will be\n" "opened.)"), i18n("import into this document?")) == KMessageBox::No) { // import the data to a new window. PwM *newInstance = init->createMainWnd(); bool ok = newInstance->importFromText(); if (!ok) { newInstance->setForceQuit(true); delete_and_null(newInstance); } return ok; } } curDoc()->timer()->getLock(DocTimer::id_autoLockTimer); PwMerror ret; QString path(KFileDialog::getOpenFileName(QString::null, i18n("*|PWM-exported text file"), this)); if (path == "") goto cancelImport; ret = curDoc()->importFromText(&path, 0); if (ret == e_fileFormat) { KMessageBox::error(this, i18n("Could not read file-format.\n" "This seems to be _not_ a valid file\n" "exported by PwM."), i18n("invalid file-format")); goto cancelImport; } else if (ret == e_invalidArg) { BUG(); goto cancelImport; } else if (ret != e_success) { KMessageBox::error(this, i18n("Could not import file!\n" "Do you have permission to read this file?\n" "Do you have enough free memory?"), 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() //is not sufficient, because there might be empty spaces // at the beginning. But the old algorythm only can add elements //to the end.The result are crashes because of list overflows //we need something to fill all gaps. vector<PwMDataItem*> sorted; vector< PwMDataItem*>::iterator sortedBegin, sortedEnd, sortedI; vector<PwMCategoryItem>::iterator catBegin = dti.dta.begin(), catEnd = dti.dta.end(), catI = catBegin; vector<PwMDataItem>::iterator entrBegin, entrEnd, entrI; int lvpTop, tmpLvp; //qDebug("collect:"); while (catI != catEnd) { lvpTop = -1; sorted.clear(); entrBegin = catI->d.begin(); entrEnd = catI->d.end(); entrI = entrBegin; //US: we use the stl sort algorythm to sort all elements in the order //of its listViewPos (in the order 1,2,2,3,5,...,x,-1, -1, -1 while (entrI != entrEnd) { //qDebug("found: %s, pos=%i", (*entrI).desc.c_str(), (*entrI).listViewPos); sorted.push_back((PwMDataItem*)&(*entrI)); ++entrI; } sortedBegin = sorted.begin(); sortedEnd = sorted.end(); sort(sortedBegin, sortedEnd, PwMDataItemListViewPosSort()); // qDebug("resort:"); //now we have all sorted in a collection //Now start with the sorted and reset listviewpos. sortedBegin = sorted.begin(); sortedEnd = sorted.end(); sortedI = sortedBegin; while (sortedI != sortedEnd) { // qDebug("reset defined: %s, from pos=%i to pos=%i", (*sortedI)->desc.c_str(), (*sortedI)->listViewPos, lvpTop+1); (*sortedI)->listViewPos = ++lvpTop; ++sortedI; } /*/debug entrBegin = catI->d.begin(); entrEnd = catI->d.end(); entrI = entrBegin; while (entrI != entrEnd) { qDebug("check: %s, pos=%i", (*entrI).desc.c_str(), (*entrI).listViewPos); ++entrI; } */ ++catI; } } QString PwMDoc::getTitle() { /* NOTE: We have to ensure, that the returned title * is unique and not reused somewhere else while * this document is valid (open). */ QString title(getFilename()); //US ENH: The whole filename on PDAs is too long. So use only the last characters if (QApplication::desktop()->width() < 640) { if (title.length() > 30) title = "..." + title.right(30); } if (title.isEmpty()) { if (unnamedNum == 0) { unnamedNum = PwMDocList::getNewUnnamedNumber(); PWM_ASSERT(unnamedNum != 0); } title = DEFAULT_TITLE; title += " "; title += tostr(unnamedNum).c_str(); } return title; } bool PwMDoc::tryDelete() { + if (deleted) return true; int ret; if (isDirty()) { ret = dirtyAskSave(getTitle()); if (ret == 0) { // save to disk if (!saveDocUi(this)) goto out_ignore; } else if (ret == 1) { // don't save and delete goto out_accept; } else { // cancel operation goto out_ignore; } } out_accept: deleted = true; delete this; return true; out_ignore: return false; } #ifdef PWM_EMBEDDED //US ENH: this is the magic function that syncronizes the this doc with the remote doc //US it could have been defined as static, but I did not want to. PwMerror PwMDoc::syncronize(KSyncManager* manager, PwMDoc* syncLocal , PwMDoc* syncRemote, int mode ) { int addedPasswordsLocal = 0; int addedPasswordsRemote = 0; int deletedPasswordsRemote = 0; int deletedPasswordsLocal = 0; int changedLocal = 0; int changedRemote = 0; PwMSyncItem* syncItemLocal; PwMSyncItem* syncItemRemote; QString mCurrentSyncName = manager->getCurrentSyncName(); QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); bool fullDateRange = false; int take; // local->resetTempSyncStat(); QDateTime mLastSync = QDateTime::currentDateTime(); QDateTime modifiedSync = mLastSync; unsigned int index; //Step 1. Find syncinfo in Local file and create if not existent. bool found = syncLocal->findSyncData(mCurrentSyncDevice, &index); if (found == false) { PwMSyncItem newSyncItemLocal; newSyncItemLocal.syncName = mCurrentSyncDevice.latin1(); newSyncItemLocal.lastSyncDate = mLastSync; syncLocal->addSyncDataEntry(&newSyncItemLocal, true); found = syncLocal->findSyncData(mCurrentSyncDevice, &index); if (found == false) { qDebug("PwMDoc::syncronize : newly created local sync data could not be found"); return e_syncError; } } syncItemLocal = syncLocal->getSyncDataEntry(index); qDebug("Last Sync Local %s ", syncItemLocal->lastSyncDate.toString().latin1()); //Step 2. Find syncinfo in remote file and create if not existent. found = syncRemote->findSyncData(mCurrentSyncName, &index); if (found == false) { qDebug("FULLDATE 1"); fullDateRange = true; PwMSyncItem newSyncItemRemote; newSyncItemRemote.syncName = mCurrentSyncName.latin1(); newSyncItemRemote.lastSyncDate = mLastSync; syncRemote->addSyncDataEntry(&newSyncItemRemote, true); found = syncRemote->findSyncData(mCurrentSyncName, &index); if (found == false) { qDebug("PwMDoc::syncronize : newly created remote sync data could not be found"); return e_syncError; } } syncItemRemote = syncRemote->getSyncDataEntry(index); qDebug("Last Sync Remote %s ", syncItemRemote->lastSyncDate.toString().latin1()); //and remove the found entry here. We will reenter it later again. //US syncRemote->delSyncDataEntry(index, true); if ( syncItemLocal->lastSyncDate == mLastSync ) { qDebug("FULLDATE 2"); fullDateRange = true; } 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) pw = pwWnd.getPw(chipcard).c_str(); return pw; } QString PwMDocUi::requestMpwChange(const QString *currentPw, bool *chipcard) { QString pw(requestMpw(*chipcard)); if (pw == "") return ""; if (pw != *currentPw) { wrongMpwMsgBox(*chipcard); return ""; } pw = requestNewMpw(chipcard); if (pw == "") return ""; return pw; } void PwMDocUi::wrongMpwMsgBox(bool chipcard, QString prefix, QString postfix) { QString msg; if (prefix != "") { msg += prefix; msg += "\n"; } if (chipcard) { msg += i18n("Wrong key-card!\n" "Please try again with the\n" "correct key-card."); } else { msg += i18n("Wrong master-password!\n" "Please try again."); } if (postfix != "") { msg += "\n"; msg += postfix; } KMessageBox::error(currentView, msg, (chipcard) ? (i18n("wrong chipcard")) : (i18n("password error"))); } void PwMDocUi::noMpwMsgBox(bool chipcard, QString prefix, QString postfix) { QString msg; if (prefix != "") { msg += prefix; msg += "\n"; } if (chipcard) { msg += i18n("No key-card found!\n" "Please insert the\n" "correct key-card."); } else { msg += i18n("No master-password given!"); } if (postfix != "") { msg += "\n"; msg += postfix; } KMessageBox::error(currentView, msg, (chipcard) ? (i18n("no chipcard")) : (i18n("password error"))); } void PwMDocUi::rootAlertMsgBox() { KMessageBox::error(currentView, i18n("This feature is not available,n" "if you execute PwM with \"root\" \n" "UID 0 privileges, for security reasons!"), i18n("not allowed as root!")); } void PwMDocUi::cantDeeplock_notSavedMsgBox() { KMessageBox::error(currentView, i18n("Can't deep-lock, because the document\n" "hasn't been saved, yet. Please save\n" "to a file and try again."), i18n("not saved, yet")); } void PwMDocUi::gpmPwLenErrMsgBox() { KMessageBox::error(currentView, i18n("GPasman does not support passwords\n" "shorter than 4 characters! Please try\n" "again with a longer password."), - i18n("password too short")); + i18n("Password too short")); } int PwMDocUi::dirtyAskSave(const QString &docTitle) { int ret; #ifndef PWM_EMBEDDED ret = KMessageBox::questionYesNoCancel(currentView, - i18n("The list \"") + + i18n("The list\n\"") + docTitle + i18n ("\" has been modified.\n" "Do you want to save it?"), - i18n("save?")); + i18n("Save?")); if (ret == KMessageBox::Yes) { return 0; } else if (ret == KMessageBox::No) { return 1; } #else + QString doc = docTitle; + if ( doc.length() > 33 ) + doc = "..." + doc.right(30); ret = KMessageBox::warningYesNoCancel(currentView, - i18n("The list \"") + - docTitle + + i18n("The list\n \"") + + doc + i18n ("\"\nhas been modified.\n" "Do you want to save it?"), - i18n("save?")); + i18n("Save?")); if (ret == KMessageBox::Yes) { return 0; } else if (ret == KMessageBox::No) { return 1; } #endif // cancel return -1; } bool PwMDocUi::saveDocUi(PwMDoc *doc) { PWM_ASSERT(doc); doc->timer()->getLock(DocTimer::id_autoLockTimer); if (doc->isDocEmpty()) { KMessageBox::information(currentView, i18n ("Sorry, there's nothing to save.\n" "Please first add some passwords."), i18n("nothing to do")); doc->timer()->putLock(DocTimer::id_autoLockTimer); return true; } PwMerror ret = doc->saveDoc(conf()->confGlobCompression()); if (ret == e_filename) { doc->timer()->putLock(DocTimer::id_autoLockTimer); return saveAsDocUi(doc); } else if (ret == e_weakPw) { KMessageBox::error(currentView, i18n("Error: This is a weak password.\n" "Please select another password."), i18n("weak password")); doc->timer()->putLock(DocTimer::id_autoLockTimer); return false; } else if (ret == e_fileBackup) { KMessageBox::error(currentView, i18n("Error: Couldn't make backup-file!"), i18n("backup failed")); doc->timer()->putLock(DocTimer::id_autoLockTimer); return false; } else if (ret == e_noPw || ret == e_wrongPw || ret == e_openFile) { doc->timer()->putLock(DocTimer::id_autoLockTimer); return false; } else if (ret != e_success) { KMessageBox::error(currentView, i18n("Error: Couldn't write to file.\n" "Please check if you have permission to\n" "write to the file in that directory."), i18n("error while writing")); doc->timer()->putLock(DocTimer::id_autoLockTimer); return false; } doc->timer()->putLock(DocTimer::id_autoLockTimer); return true; } bool PwMDocUi::saveAsDocUi(PwMDoc *doc) { PWM_ASSERT(doc); doc->timer()->getLock(DocTimer::id_autoLockTimer); if (doc->isDocEmpty()) { KMessageBox::information(currentView, i18n ("Sorry, there's nothing to save.\n" "Please first add some passwords."), i18n("nothing to do")); doc->timer()->putLock(DocTimer::id_autoLockTimer); return true; } #ifndef PWM_EMBEDDED QString fn(KFileDialog::getSaveFileName(QString::null, i18n("*.pwm|PwManager Password file"), currentView)); #else QString fn = locateLocal( "data", KGlobal::getAppName() + "/*.pwm" ); fn = KFileDialog::getSaveFileName(fn, i18n("password filename(*.pwm)"), currentView); #endif if (fn == "") { doc->timer()->putLock(DocTimer::id_autoLockTimer); return false; } if (fn.right(4) != ".pwm") fn += ".pwm"; PwMerror ret = doc->saveDoc(conf()->confGlobCompression(), &fn); if (ret == e_noPw || ret == e_wrongPw || ret == e_openFile) { 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 @@ /*************************************************************************** * * * copyright (C) 2004 by Michael Buesch * * email: mbuesch@freenet.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License version 2 * * as published by the Free Software Foundation. * * * ***************************************************************************/ /*************************************************************************** * copyright (C) 2004 by Ulf Schenk * This file is originaly based on version 1.0.1 of pwmanager * and was modified to run on embedded devices that run microkde * * $Id$ **************************************************************************/ #include "pwminit.h" #include "randomizer.h" #include <qdir.h> #ifndef PWM_EMBEDDED #include "selftest.h" #include "configuration.h" #else #include "pwmprefs.h" #endif #include "pwm.h" #include "pwmexception.h" #include "pwmtray.h" #include "pwmdoc.h" #ifdef CONFIG_KWALLETIF # include "kwalletemu.h" #endif // CONFIG_KWALLETIF #ifdef CONFIG_KEYCARD # include "pwmkeycard.h" #endif // CONFIG_KEYCARD #include <qmessagebox.h> #include <kmessagebox.h> #ifndef PWM_EMBEDDED #include <kcmdlineargs.h> #include <kwin.h> #include <dcopclient.h> #endif #include <kapplication.h> #include <kiconloader.h> #include <signal.h> static PwMInit *sig_init_pointer; #ifdef _WIN32_ static void sig_handler(int signum) #else static NOREGPARM void sig_handler(int signum) #endif { switch (signum) { case SIGINT: case SIGTERM: sig_init_pointer->shutdownApp(20 + signum); break; default: printDebug(string("unhandled signal ") + tostr(signum)); } } PwMInit::PwMInit(PwMApplication *_app) : runStatus (unknown) , _curWidget (0) , _dcopClient (0) , _kwalletEmu (0) , _keycard (0) , _tray (0) { sig_init_pointer = this; app = _app; } PwMInit::~PwMInit() { + qDebug("PwMInit::~PwMInit() "); #ifndef PWM_EMBEDDED SelfTest::cancel(); // close all open mainwnds QValueList<PwM *>::iterator i = _mainWndList.begin(), end = _mainWndList.end(); #else // close all open mainwnds QValueList<PwM *>::Iterator i = _mainWndList.begin(), end = _mainWndList.end(); #endif while (i != end) { disconnect(*i, SIGNAL(closed(PwM *)), this, SLOT(mainWndClosed(PwM *))); delete *i; ++i; } _mainWndList.clear(); // close all remaining open documents PwMDocList *_dl = PwMDoc::getOpenDocList(); vector<PwMDocList::listItem> dl = *(_dl->getList()); vector<PwMDocList::listItem>::iterator i2 = dl.begin(), end2 = dl.end(); while (i2 != end2) { delete (*i2).doc; ++i2; } #ifdef CONFIG_KWALLETIF delete_ifnot_null(_kwalletEmu); #endif // CONFIG_KWALLETIF #ifdef CONFIG_KEYCARD delete_ifnot_null(_keycard); #endif // CONFIG_KEYCARD delete_ifnot_null(_tray); Randomizer::cleanup(); #ifndef PWM_EMBEDDED Configuration::cleanup(); #endif } void PwMInit::initializeApp() { //qDebug("PwMInit::initializeApp() "); PWM_ASSERT(runStatus == unknown); runStatus = init; initPosixSignalHandler(); Randomizer::init(); #ifndef PWM_EMBEDDED Configuration::init(); #endif initDCOP(); initKWalletEmu(); initKeycard(); initTray(); handleCmdLineArgs(); bool openDeeplocked = false; if (conf()->confGlobAutostartDeepLocked() || savedCmd.open_deeplocked) openDeeplocked = true; if ( false ){ // LR is not working //if (conf()->confWndAutoMinimizeOnStart() || // savedCmd.minToTray) { PwMDoc *newDoc = createDoc(); qDebug(" createDoc()"); if (!newDoc->openDocUi(newDoc, conf()->confGlobAutoStart(), openDeeplocked)) { delete newDoc; } //US ENH for embedded devices: in the case of failure, open a document the default way createMainWnd(conf()->confGlobAutoStart(), openDeeplocked, true, 0, savedCmd.minimized); // } } else { createMainWnd(conf()->confGlobAutoStart(), openDeeplocked, true, 0, savedCmd.minimized); } - runStatus = running; } void PwMInit::shutdownApp(int exitStatus) { printDebug(string("PwMInit::shutdownApp(") + tostr(exitStatus) + ") called."); PWM_ASSERT((runStatus == running) || (runStatus == init)); runStatus = shutdown; QApplication::exit(exitStatus); /* The destructor of PwMInit is called when control * leaves main() */ } void PwMInit::initPosixSignalHandler() { signal(SIGINT, sig_handler); signal(SIGTERM, sig_handler); } void PwMInit::initDCOP() { #ifndef PWM_EMBEDDED _dcopClient = app->dcopClient(); _dcopClient->setNotifications(true); #endif } void PwMInit::initKWalletEmu(bool forceDisable, bool forceReload) { #ifdef CONFIG_KWALLETIF if (!conf()->confGlobKwalletEmu() || forceDisable) { delete_ifnot_null(_kwalletEmu); return; } try { if (_kwalletEmu && forceReload) delete_and_null(_kwalletEmu); if (!_kwalletEmu) _kwalletEmu = new KWalletEmu(this); } catch (PwMException e) { string errMsg("initializing KWallet emulation failed. ID: "); errMsg += tostr(static_cast<int>(e.getId())); errMsg += " err-message: "; errMsg += e.getMessage(); printWarn(errMsg); return; } #else // CONFIG_KWALLETIF PARAM_UNUSED(forceDisable); PARAM_UNUSED(forceReload); #endif // CONFIG_KWALLETIF } void PwMInit::initKeycard() { #ifdef CONFIG_KEYCARD PWM_ASSERT(!_keycard); _keycard = new PwMKeyCard(this); #endif // CONFIG_KEYCARD } void PwMInit::initTray() { #ifdef PWM_EMBEDDED //US ENH : embedded version does not support a tray return; #endif if (!conf()->confGlobTray()) { if (!_tray) return; _tray->hide(); delete_and_null(_tray); return; } if (_tray) return; _tray = new PwMTray(this); connect(_tray, SIGNAL(quitSelected()), this, SLOT(removeTrayAndQuit())); connect(_tray, SIGNAL(closed(PwMTray *)), this, SLOT(trayIconClosed(PwMTray *))); KIconLoader icons; #ifndef PWM_EMBEDDED _tray->setPixmap(icons.loadIcon(PACKAGE_NAME, KIcon::Small)); #endif _tray->show(); // connect the signals of all open documents. const vector<PwMDocList::listItem> *dl = PwMDoc::getOpenDocList()->getList(); vector<PwMDocList::listItem>::const_iterator i = dl->begin(), end = dl->end(); while (i != end) { _tray->connectDocToTray((*i).doc); ++i; } } void PwMInit::removeTrayAndQuit() { PWM_ASSERT(_tray); // _tray is deleted in ~PwMInit shutdownApp(0); } PwM * PwMInit::createMainWnd(const QString &loadFile, bool loadFileDeepLocked, bool virginity, PwMDoc *doc, bool minimized) { PwM *newWnd; if (!doc) doc = createDoc(); newWnd = new PwM(this, doc, virginity); #ifndef PWM_EMBEDDED _mainWndList.push_back(newWnd); #else _mainWndList.append(newWnd); #endif connect(newWnd, SIGNAL(closed(PwM *)), this, SLOT(mainWndClosed(PwM *))); connect(newWnd, SIGNAL(gotFocus(PwM *)), this, SLOT(setCurWidget(PwM *))); connect(newWnd, SIGNAL(lostFocus(PwM *)), this, SLOT(resetCurWidget())); //US ENH #ifndef PWM_EMBEDDED if (minimized) newWnd->showMinimized(); else newWnd->show(); #else //PWM_EMBEDDED #ifndef DESKTOP_VERSION app->showMainWidget( newWnd ); #else //DESKTOP_VERSION - app->setMainWidget( newWnd ); newWnd->resize (640, 480 ); newWnd->show(); - qDebug("show "); #endif //DESKTOP_VERSION #endif //PWM_EMBEDDED if (loadFile != QString::null && loadFile != "") { newWnd->openDoc(loadFile, loadFileDeepLocked); } return newWnd; } PwMDoc * PwMInit::createDoc() { PwMDoc *doc = new PwMDoc(this); #ifdef CONFIG_KEYCARD doc->setPwMKeyCard(keycard()); #endif #ifdef CONFIG_KWALLETIF if (kwalletEmu()) kwalletEmu()->connectDocSignals(doc); #endif if (_tray) _tray->connectDocToTray(doc); return doc; } void PwMInit::mainWndClosed(PwM *wnd) { bool doMinimizeToTray = false; bool doDeleteDoc = false; #ifndef PWM_EMBEDDED dcopClient()->suspend(); dcopClient()->setAcceptCalls(false); #endif again: if (wnd->isForceMinimizeToTray()) { if (unlikely(!_tray)) { /* This should not happen! If we set forceMinimizeToTray , * we must be sure that _tray exists. */ BUG(); wnd->setForceMinimizeToTray(false); goto again; } doMinimizeToTray = true; } else { // Ask to minimize to tray. If not, delete doc. if (_tray && runStatus != shutdown && !wnd->isForceQuit() && !wnd->curDoc()->isDeleted()) { if (conf()->confWndClose()) doDeleteDoc = true; else doMinimizeToTray = true; } else { doDeleteDoc = true; } } if (doMinimizeToTray) { - + qDebug("doMinimizeToTray "); PWM_ASSERT(_tray); int mmlock = conf()->confGlobMinimizeLock(); switch (mmlock) { case 0: // don't lock anything break; case 1: // normal lock wnd->curDoc()->lockAll(true); break; case 2: // deep-lock wnd->curDoc()->deepLock(); break; default: WARN(); } } else if (doDeleteDoc) { + qDebug("doDeleteDoc "); if (!wnd->curDoc()->tryDelete()) { /* We failed deleting the doc, * so open a new window with it, again. */ createMainWnd(QString::null, false, false, wnd->curDoc()); } } #ifndef PWM_EMBEDDED // find the closed window in the "mainWndList" and delete it. QValueList<PwM *>::iterator i = _mainWndList.begin(), end = _mainWndList.end(); #else // find the closed window in the "mainWndList" and delete it. QValueList<PwM *>::Iterator i = _mainWndList.begin(), end = _mainWndList.end(); #endif while (i != end) { if (*i == wnd) { #ifndef PWM_EMBEDDED _mainWndList.erase(i); #else _mainWndList.remove(i); #endif + + if ( app->mainWidget() == wnd ) { + if ( _mainWndList.count() ) { +#ifndef DESKTOP_VERSION + app->showMainWidget(_mainWndList.first() ); +#endif //DESKTOP_VERSION + + } + } + delete wnd; goto out_success; } ++i; } BUG(); out_success: #ifndef PWM_EMBEDDED if (!_mainWndList.size()) #else if (!_mainWndList.count()) #endif { /* If there's no main window and no tray icon * left, we have no user interface, so we can * shut down the application. */ if (!_tray) { #ifndef PWM_EMBEDDED dcopClient()->setAcceptCalls(true); dcopClient()->resume(); #endif shutdownApp(0); return; } /* There is no widget left, so set * _curWidget to 0 */ resetCurWidget(); } #ifndef PWM_EMBEDDED dcopClient()->setAcceptCalls(true); dcopClient()->resume(); #endif } void PwMInit::trayIconClosed(PwMTray *tray) { if (runStatus != running) return; PARAM_UNUSED(tray); PWM_ASSERT(tray == _tray); /* If there's no main wnd left we have to * shutdown the app (same as in mainWndClosed()) */ #ifndef PWM_EMBEDDED if (!_mainWndList.size()) shutdownApp(0); #else if (!_mainWndList.count()) shutdownApp(0); #endif } void PwMInit::handleCmdLineArgs(bool initial) { #ifndef PWM_EMBEDDED KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); PWM_ASSERT(args); int i, numArgs = args->count(); const char *curArg; // read all cmdline options savedCmd.open_deeplocked = args->isSet("open-deeplocked"); savedCmd.minimized = args->isSet("minimized"); savedCmd.minToTray = args->isSet("mintray"); savedCmd.skipSelfTest = args->isSet("skip-self-test"); if (savedCmd.minimized && savedCmd.minToTray) { printInfo(i18n("Commandline option \"--minimized\" and " "\"--mintray\" selected. These are incompatible. " "\"--mintray\" will be selected.").latin1()); } /* Iterate through all non-option arguments. * Every non-option arg is a filename to open. */ for (i = 0; i < numArgs; ++i) { curArg = args->arg(i); PWM_ASSERT(curArg); if (savedCmd.minToTray) { PwMDoc *newDoc = createDoc(); if (!newDoc->openDocUi(newDoc, curArg, savedCmd.open_deeplocked)) { delete newDoc; } } else { PwM *newInstance = createMainWnd(QString::null, false, true, 0, savedCmd.minimized); PwMDoc *newDoc = newInstance->openDoc(curArg, savedCmd.open_deeplocked); if (!newDoc) { newInstance->setForceQuit(true); |