From a959b0b945d8a01f62544bfb73f03ad6f900a38d Mon Sep 17 00:00:00 2001 From: ubbo Date: Sun, 15 Jan 2012 18:04:37 +0000 Subject: mainwindow reloadable, e.g. when translation changes git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@741 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- wizard.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'wizard.cpp') diff --git a/wizard.cpp b/wizard.cpp index 4b64a7d..cf1a47b 100644 --- a/wizard.cpp +++ b/wizard.cpp @@ -27,6 +27,7 @@ Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) { mCtx=ctx; mKeyMgmt=keyMgmt; + mParent=parent; IntroPage *introPage = new IntroPage(); KeyGenPage *keyGenPage = new KeyGenPage(mCtx); ImportPage *importPage = new ImportPage(mCtx,mKeyMgmt); @@ -186,6 +187,8 @@ bool ImportPage::importKeysFromGpg4usb() return false; } + importConfFromGpg4usb(dir); + QFile secRing(dir+"/keydb/secring.gpg"); QFile pubRing(dir+"/keydb/pubring.gpg"); @@ -213,9 +216,23 @@ bool ImportPage::importKeysFromGpg4usb() QByteArray inBuffer = secRing.readAll(); mKeyMgmt->importKeys(inBuffer); } + + qApp->exit(); return true; } +bool ImportPage::importConfFromGpg4usb(QString dir) { + QString path = dir+"/conf/gpg4usb.ini"; + qDebug() << "import old conf from: " << path; + QSettings oldconf(path, QSettings::IniFormat, this); + QSettings actualConf; + foreach(QString key, oldconf.allKeys()) { + qDebug() << key << ": " << oldconf.value(key); + actualConf.setValue(key, oldconf.value(key)); + } + +} + bool ImportPage::importKeysFromGnupg() { // first get gnupghomedir and check, if it exists -- cgit v1.2.3