From 16c2bf04415fe301dd7c01dd8167f1ab432ba343 Mon Sep 17 00:00:00 2001 From: nils Date: Wed, 28 Dec 2011 23:21:31 +0000 Subject: also show importdetaildialog when dropping key on keylist git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@714 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- keylist.cpp | 13 ++++++++++--- keylist.h | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/keylist.cpp b/keylist.cpp index 49dcab6..8dc5281 100644 --- a/keylist.cpp +++ b/keylist.cpp @@ -235,11 +235,11 @@ void KeyList::dropEvent(QDropEvent* event) qDebug() << tr("Couldn't Open File: ") + tmp.toString(); } QByteArray inBuffer = file.readAll(); - mCtx->importKey(inBuffer); + this->importKeys(inBuffer); } } else { QByteArray inBuffer(event->mimeData()->text().toUtf8()); - mCtx->importKey(inBuffer); + this->importKeys(inBuffer); } } @@ -251,8 +251,15 @@ void KeyList::dragEnterEvent(QDragEnterEvent *event) /** set background color for Keys and put them to top * */ -void KeyList::markKeys(QStringList *keyIds) { +void KeyList::markKeys(QStringList *keyIds) +{ foreach(QString id, *keyIds) { qDebug() << "marked: " << id; } } + +void KeyList::importKeys(QByteArray inBuffer) +{ + GpgImportInformation result = mCtx->importKey(inBuffer); + new KeyImportDetailDialog(mCtx, result, this); +} diff --git a/keylist.h b/keylist.h index 6bac7d3..1c59ec5 100644 --- a/keylist.h +++ b/keylist.h @@ -23,6 +23,7 @@ #define __KEYLIST_H__ #include "gpgcontext.h" +#include "keyimportdetaildialog.h" QT_BEGIN_NAMESPACE class QWidget; @@ -54,6 +55,7 @@ public slots: void refresh(); private: + void importKeys(QByteArray inBuffer); GpgME::GpgContext *mCtx; QTableWidget *mKeyList; QString iconPath; -- cgit v1.2.3