aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-09-29 21:28:55 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-09-29 21:28:55 +0000
commit4af3d276580a73270a813502c9615e4c6de5caf7 (patch)
tree2b9caa3ecf0f8c5066bdf9d351679a3bafda63b6
parentadded delete keys actions to mainwindows menubar and keylists contextmenu (diff)
downloadgpg4usb-4af3d276580a73270a813502c9615e4c6de5caf7.tar.gz
gpg4usb-4af3d276580a73270a813502c9615e4c6de5caf7.zip
some work on verify
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@973 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rwxr-xr-xfileencryptiondialog.cpp3
-rw-r--r--verifydetailsdialog.cpp16
-rw-r--r--verifydetailsdialog.h5
-rw-r--r--verifynotification.cpp6
4 files changed, 23 insertions, 7 deletions
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp
index 2eb25ca..54a2b2b 100755
--- a/fileencryptiondialog.cpp
+++ b/fileencryptiondialog.cpp
@@ -209,7 +209,8 @@ void FileEncryptionDialog::executeAction()
return;
}
QByteArray signBuffer = signfile.readAll();
- new VerifyDetailsDialog(this, mCtx, mKeyList, &inBuffer, &signBuffer);
+ // TODO
+ //new VerifyDetailsDialog(this, mCtx, mKeyList, &inBuffer, &signBuffer);
return;
}
diff --git a/verifydetailsdialog.cpp b/verifydetailsdialog.cpp
index dfe301d..f34d27b 100644
--- a/verifydetailsdialog.cpp
+++ b/verifydetailsdialog.cpp
@@ -21,7 +21,7 @@
#include "verifydetailsdialog.h"
-VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* keyList, QByteArray* inputData, QByteArray* inputSignature) :
+VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* keyList, const QString &inputData, QByteArray* inputSignature) :
QDialog(parent)
{
mCtx = ctx;
@@ -64,6 +64,9 @@ void VerifyDetailsDialog::refresh()
} else {
//TODO kgpg
//sign = mCtx->verify(mInputData);
+ KGpgVerify *verify = new KGpgVerify(this, mInputData);
+ connect(verify, SIGNAL(done(int)), SLOT(slotVerifyDone(int)));
+ verify->start();
}
/*if(sign==0) {
@@ -105,3 +108,14 @@ void VerifyDetailsDialog::refresh()
mVboxLayout->addWidget(buttonBox);
}
+
+void VerifyDetailsDialog::slotVerifyDone(int result) {
+ const KGpgVerify * const verify = qobject_cast<KGpgVerify *>(sender());
+ sender()->deleteLater();
+ Q_ASSERT(verify != NULL);
+
+ const QStringList messages = verify->getMessages();
+ foreach(QString mess, messages) {
+ qDebug() << "vm: " << mess;
+ }
+}
diff --git a/verifydetailsdialog.h b/verifydetailsdialog.h
index 5ce7ff7..3bc0b40 100644
--- a/verifydetailsdialog.h
+++ b/verifydetailsdialog.h
@@ -30,17 +30,18 @@ class VerifyDetailsDialog : public QDialog
{
Q_OBJECT
public:
- explicit VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* mKeyList, QByteArray* inputData, QByteArray* inputSignature = 0);
+ explicit VerifyDetailsDialog(QWidget *parent, GpgME::GpgContext* ctx, KeyList* mKeyList, const QString &inputData, QByteArray* inputSignature = 0);
private slots:
void refresh();
+ void slotVerifyDone(int result);
private:
GpgME::GpgContext *mCtx;
KeyList *mKeyList;
QHBoxLayout *mainLayout;
QWidget *mVbox;
- QByteArray* mInputData; /** Data to be verified */
+ QString mInputData; /** Data to be verified */
QByteArray* mInputSignature; /** Data to be verified */
QDialogButtonBox* buttonBox;
};
diff --git a/verifynotification.cpp b/verifynotification.cpp
index 9aa061f..e2df2ba 100644
--- a/verifynotification.cpp
+++ b/verifynotification.cpp
@@ -87,9 +87,9 @@ void VerifyNotification::showImportAction(bool visible)
void VerifyNotification::showVerifyDetails()
{
- QByteArray text = mTextpage->toPlainText().toUtf8();
- mCtx->preventNoDataErr(&text);
- new VerifyDetailsDialog(this, mCtx, mKeyList, &text);
+ //QByteArray text = mTextpage->toPlainText().toUtf8();
+ //mCtx->preventNoDataErr(&text);
+ new VerifyDetailsDialog(this, mCtx, mKeyList, mTextpage->toPlainText());
}
bool VerifyNotification::refresh()