diff options
-rw-r--r-- | context.cpp | 6 | ||||
-rw-r--r-- | context.h | 4 | ||||
-rw-r--r-- | gpgwin.cpp | 6 | ||||
-rwxr-xr-x | quitdialog.h | 1 | ||||
-rw-r--r-- | verifykeydetailbox.cpp | 19 | ||||
-rw-r--r-- | verifykeydetailbox.h | 2 | ||||
-rw-r--r-- | verifynotification.cpp | 42 | ||||
-rw-r--r-- | verifynotification.h | 10 |
8 files changed, 15 insertions, 75 deletions
diff --git a/context.cpp b/context.cpp index efa99e7..b55467a 100644 --- a/context.cpp +++ b/context.cpp @@ -529,7 +529,7 @@ gpgme_signature_t Context::verify(QByteArray inBuffer) { * -> valid * -> decrypted message */ -void Context::decryptVerify(QByteArray in) { +//void Context::decryptVerify(QByteArray in) { /* gpgme_error_t err; gpgme_data_t in, out; @@ -542,12 +542,12 @@ void Context::decryptVerify(QByteArray in) { verify_result = gpgme_op_verify_result (mCtx); */ -} +//} void Context::sign(const QByteArray &inBuffer, QByteArray *outBuffer) { gpgme_error_t err; - gpgme_data_t in, out; + gpgme_data_t in=NULL, out=NULL; gpgme_sign_result_t result; /* @@ -59,7 +59,7 @@ class Context : public QObject Q_OBJECT public: - Context(); // Consttructor + Context(); // Constructor ~Context(); // Destructor void importKey(QByteArray inBuffer); @@ -74,7 +74,7 @@ public: void exportSecretKey(QString uid, QByteArray *outBuffer); gpgme_key_t getKeyDetails(QString uid); gpgme_signature_t verify(QByteArray in); - void decryptVerify(QByteArray in); +// void decryptVerify(QByteArray in); void sign(const QByteArray &inBuffer, QByteArray *outBuffer); bool sign(QStringList *uidList, const QByteArray &inBuffer, QByteArray *outBuffer ); @@ -758,10 +758,6 @@ void GpgWin::verify() } } verifyLabelText.append("\n"); - qDebug() << "sig fingerprint: " << sign->fpr; - qDebug() << "sig status: " << sign->status << " - " << gpg_err_code(sign->status) << " - " << gpg_strerror(sign->status); - qDebug() << "sig validity: " << sign->validity; - qDebug() << "sig validity reason: " << sign->validity_reason << " - " << gpg_err_code(sign->validity_reason) << " - " << gpgme_strerror(sign->validity_reason); sign = sign->next; } @@ -770,13 +766,11 @@ void GpgWin::verify() case 2: { verifyLabelText.prepend(tr("Text is completly signed by: ")); - vn->addVerifyDetailLabel(tr("Text was completly signed on %1 by:\n").arg(timestamp.toString(Qt::SystemLocaleShortDate)),VERIFY_ERROR_NEUTRAL, true); break; } case 1: { verifyLabelText.prepend(tr("Text is partially signed by: ")); - vn->addVerifyDetailLabel(tr("Text was partially signed on %1 by:\n").arg(timestamp.toString(Qt::SystemLocaleShortDate)),VERIFY_ERROR_NEUTRAL, true); break; } } diff --git a/quitdialog.h b/quitdialog.h index 8087702..fbcfdce 100755 --- a/quitdialog.h +++ b/quitdialog.h @@ -22,7 +22,6 @@ #ifndef __QUITDIALOG_H__ #define __QUITDIALOG_H__ -#include "context.h" #include <QtGui> QT_BEGIN_NAMESPACE diff --git a/verifykeydetailbox.cpp b/verifykeydetailbox.cpp index 3a758ed..1b640d0 100644 --- a/verifykeydetailbox.cpp +++ b/verifykeydetailbox.cpp @@ -5,19 +5,21 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::Context* ctx, Key { this->mCtx = ctx; this->mKeyList = keyList; + this->fpr=signature->fpr; + this->setTitle(signature->fpr); + + grid = new QGridLayout(); - QGridLayout *grid = new QGridLayout(); - fpr=signature->fpr; switch (gpg_err_code(signature->status)) { case GPG_ERR_NO_PUBKEY: { - QPushButton *importButton = new QPushButton("Import from keyserver"); + QPushButton *importButton = new QPushButton(tr("Import from keyserver")); connect(importButton, SIGNAL(clicked()), this, SLOT(importFormKeyserver())); grid->addWidget(new QLabel(tr("Status:")), 0, 0); grid->addWidget(new QLabel(tr("Fingerprint:")), 1, 0); - grid->addWidget(new QLabel("Key not present in keylist"), 0, 1); + grid->addWidget(new QLabel(tr("Key not present in keylist")), 0, 1); grid->addWidget(new QLabel(signature->fpr), 1, 1); grid->addWidget(importButton, 2,0,2,1); break; @@ -32,7 +34,7 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::Context* ctx, Key grid->addWidget(new QLabel(mKeyList->getKeyNameByFpr(signature->fpr)), 0, 1); grid->addWidget(new QLabel(mKeyList->getKeyEmailByFpr(signature->fpr)), 1, 1); grid->addWidget(new QLabel(beautifyFingerprint(signature->fpr)), 2, 1); - grid->addWidget(new QLabel("OK"), 3, 1); + grid->addWidget(new QLabel(tr("OK")), 3, 1); break; } @@ -47,12 +49,11 @@ VerifyKeyDetailBox::VerifyKeyDetailBox(QWidget *parent, GpgME::Context* ctx, Key break; } } - this->setLayout(grid); } -void VerifyKeyDetailBox::importFormKeyserver() { - qDebug() << "clicked"; +void VerifyKeyDetailBox::importFormKeyserver() +{ KeyServerImportDialog *importDialog =new KeyServerImportDialog(mCtx,this); importDialog->import(fpr); } @@ -65,5 +66,3 @@ QString VerifyKeyDetailBox::beautifyFingerprint(QString fingerprint) fingerprint.insert(5 * n + 4, ' '); return fingerprint; } - - diff --git a/verifykeydetailbox.h b/verifykeydetailbox.h index 5e44019..456289f 100644 --- a/verifykeydetailbox.h +++ b/verifykeydetailbox.h @@ -19,8 +19,8 @@ private: GpgME::Context* mCtx; KeyList* mKeyList; QString beautifyFingerprint(QString fingerprint); - QVBoxLayout* mVbox; QString fpr; + QGridLayout *grid; }; #endif // __VERIFYKEYDETAILBOX_H__ diff --git a/verifynotification.cpp b/verifynotification.cpp index 6564a81..36cb9e8 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -48,18 +48,6 @@ VerifyNotification::VerifyNotification(QWidget *parent, GpgME::Context *ctx, Key notificationWidgetLayout->addWidget(verifyLabel,2); notificationWidgetLayout->addWidget(detailsButton); this->setLayout(notificationWidgetLayout); - verifyDetailListLayout = new QVBoxLayout(); -} - -void VerifyNotification::addVerifyDetailLabel(QString text,verify_label_status status,bool prepend) -{ - if (prepend) { - verifyDetailStringVector.prepend(text); - verifyDetailStatusVector.prepend(status); - } else { - verifyDetailStringVector.append(text); - verifyDetailStatusVector.append(status); - } } void VerifyNotification::importFromKeyserver() @@ -94,35 +82,5 @@ void VerifyNotification::showImportAction(bool visible) void VerifyNotification::showVerifyDetails() { - /*QDialog *verifyDetailsDialog = new QDialog(this); - // QLabel *label = new QLabel(*verifyDetailText); - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); - connect(buttonBox, SIGNAL(rejected()), verifyDetailsDialog, SLOT(close())); - for (int i=0;i<verifyDetailStringVector.size();i++) { - QLabel *label = new QLabel(verifyDetailStringVector[i]); - verifyDetailListLayout->addWidget(label); - switch (verifyDetailStatusVector[i]) { - case VERIFY_ERROR_OK: label->setObjectName("ok"); - break; - case VERIFY_ERROR_WARN: label->setObjectName("warning"); - break; - case VERIFY_ERROR_CRITICAL: label->setObjectName("critical"); - break; - default: - break; - } - } - -// verifyDetailStatusVector.append(status); - -// verifyDetailListLayout->addWidget(label); - - verifyDetailListLayout->addWidget(buttonBox); - - verifyDetailsDialog->setLayout(verifyDetailListLayout); - verifyDetailsDialog->show(); - - //QMessageBox::information(this,tr("Details"),QString(*verifyDetailText), QMessageBox::Ok); - return;*/ new VerifyDetailsDialog(this, mCtx, mKeyList, mSignature); } diff --git a/verifynotification.h b/verifynotification.h index 530fe58..178169d 100644 --- a/verifynotification.h +++ b/verifynotification.h @@ -74,15 +74,6 @@ public: QStringList *keysNotInList; /** List with keys, which are in signature but not in keylist */ - /** - * @details add text to the verifyDetailStringVector and associated status to the - * verifyDetailStatusVector - * @param text The text to be added - * @param status The status to be set - * @param prepend If prepend is true, prepend to the vectors, - * otherwise append to the vectors - */ - void addVerifyDetailLabel(QString text, verify_label_status status, bool prepend); public slots: /** @@ -106,7 +97,6 @@ private: KeyList *mKeyList; /** Table holding the keys */ gpgme_signature_t mSignature; /** List holding the signatures of text */ QHBoxLayout *notificationWidgetLayout; /** Layout for verify-notification */ - QVBoxLayout *verifyDetailListLayout; /** Layout for verify-detail-dialog */ QVector<QString> verifyDetailStringVector; /** Vector containing the text for labels in verifydetaildialog */ QVector<verify_label_status> verifyDetailStatusVector; /** Vector containing the status for labels in verifydetaildialog */ }; |