From fbf736b1f6a294bb6cfec0f12217297252b289db Mon Sep 17 00:00:00 2001 From: nils Date: Tue, 15 Oct 2013 21:49:28 +0000 Subject: removed key management and old key details dialog git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@1062 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- wizard.cpp | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'wizard.cpp') diff --git a/wizard.cpp b/wizard.cpp index bd8a82f..4873801 100644 --- a/wizard.cpp +++ b/wizard.cpp @@ -26,16 +26,13 @@ #include "windows.h" #endif -Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) - : QWizard(parent) +Wizard::Wizard(GpgME::GpgContext *ctx, QWidget *parent) + : QWizard(parent), mCtx(ctx) { - mCtx=ctx; - mKeyMgmt=keyMgmt; - setPage(Page_Intro,new IntroPage(this)); setPage(Page_Choose, new ChoosePage(this)); - setPage(Page_ImportFromGpg4usb,new ImportFromGpg4usbPage(mCtx, mKeyMgmt, this)); - setPage(Page_ImportFromGnupg,new ImportFromGnupgPage(mCtx, mKeyMgmt, this)); + setPage(Page_ImportFromGpg4usb,new ImportFromGpg4usbPage(mCtx, this)); + setPage(Page_ImportFromGnupg,new ImportFromGnupgPage(mCtx, this)); setPage(Page_GenKey,new KeyGenPage(mCtx, this)); setPage(Page_Conclusion,new ConclusionPage(this)); @@ -66,7 +63,7 @@ void Wizard::wizardAccepted() { } } -bool Wizard::importPubAndSecKeysFromDir(const QString dir, KeyMgmt *keyMgmt) +bool Wizard::importPubAndSecKeysFromDir(const QString dir, GpgME::GpgContext *ctx) { QFile secRingFile(dir+"/secring.gpg"); QFile pubRingFile(dir+"/pubring.gpg"); @@ -97,7 +94,7 @@ bool Wizard::importPubAndSecKeysFromDir(const QString dir, KeyMgmt *keyMgmt) inBuffer.append(pubRingFile.readAll()); pubRingFile.close(); } - keyMgmt->slotImportKeys(inBuffer); + ctx->slotImportKeys(inBuffer); inBuffer.clear(); return true; @@ -203,11 +200,9 @@ void ChoosePage::jumpPage(const QString& page) wizard()->next(); } -ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) - : QWizardPage(parent) +ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, QWidget *parent) + : QWizardPage(parent), mCtx(ctx) { - mCtx=ctx; - mKeyMgmt=keyMgmt; setTitle(tr("Import from...")); setSubTitle(tr("...existing gpg4usb")); @@ -249,7 +244,7 @@ void ImportFromGpg4usbPage::slotImportFromOlderGpg4usb() // try to import keys, if appropriate box is checked, return, if import was unsuccessful if (gpg4usbKeyCheckBox->isChecked()) { - if (!Wizard::importPubAndSecKeysFromDir(dir+"/keydb",mKeyMgmt)) { + if (!Wizard::importPubAndSecKeysFromDir(dir+"/keydb",mCtx)) { return; } } @@ -283,11 +278,9 @@ int ImportFromGpg4usbPage::nextId() const return Wizard::Page_Conclusion; } -ImportFromGnupgPage::ImportFromGnupgPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) - : QWizardPage(parent) +ImportFromGnupgPage::ImportFromGnupgPage(GpgME::GpgContext *ctx, QWidget *parent) + : QWizardPage(parent), mCtx(ctx) { - mCtx=ctx; - mKeyMgmt=keyMgmt; setTitle(tr("Import keys...")); setSubTitle(tr("...from existing GnuPG installation")); @@ -315,7 +308,7 @@ void ImportFromGnupgPage::slotImportKeysFromGnupg() } // Try to import the keyring files and return the return value of the method - Wizard::importPubAndSecKeysFromDir(gnuPGHome,mKeyMgmt); + Wizard::importPubAndSecKeysFromDir(gnuPGHome,mCtx); wizard()->next(); } -- cgit v1.2.3