aboutsummaryrefslogtreecommitdiffstats
path: root/verifynotification.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--verifynotification.cpp28
1 files changed, 18 insertions, 10 deletions
diff --git a/verifynotification.cpp b/verifynotification.cpp
index 2de1a2a..2c5cd56 100644
--- a/verifynotification.cpp
+++ b/verifynotification.cpp
@@ -1,32 +1,40 @@
+
#include "verifynotification.h"
-VerifyNotification::VerifyNotification(QWidget *parent) :
+VerifyNotification::VerifyNotification(GpgME::Context *ctx, QWidget *parent ) :
QWidget(parent)
{
+ mCtx = ctx;
verifyLabel = new QLabel("Verified");
QHBoxLayout *notificationWidgetLayout = new QHBoxLayout();
notificationWidgetLayout->setContentsMargins(0,0,0,0);
- notificationWidgetLayout->addWidget(verifyLabel);
+ notificationWidgetLayout->addWidget(verifyLabel,2);
// notificationWidget = new QWidget(this);
this->setStyleSheet("background-color: #CBFDCB;");
this->setLayout(notificationWidgetLayout);
- QAction *openAct = new QAction(tr("&Open..."), this);
- openAct->setShortcut(QKeySequence::Open);
- openAct->setToolTip(tr("Open an existing file"));
-
- QMenu *verifyMenu = new QMenu();
- verifyMenu->addAction(openAct);
+ QAction *importFromKeyserverAct = new QAction(tr("Import missing key from Keyserver"), this);
+ connect(importFromKeyserverAct, SIGNAL(triggered()), this, SLOT(importFromKeyserver()));
+ QMenu *detailMenu = new QMenu();
+ detailMenu->addAction(importFromKeyserverAct);
+ keysNotInList = new QStringList();
QPushButton *verifyButton = new QPushButton("Details");
- verifyButton->setMenu(verifyMenu);
- notificationWidgetLayout->addStretch(1);
+ verifyButton->setMenu(detailMenu);
+ // notificationWidgetLayout->addStretch(1);
notificationWidgetLayout->addWidget(verifyButton);
}
+void VerifyNotification::importFromKeyserver(){
+ KeyServerImportDialog *importDialog =new KeyServerImportDialog(mCtx,this);
+ foreach (QString keyid, *keysNotInList) {
+ importDialog->import(keyid);
+ }
+}
+
void VerifyNotification::setVerifyLabel(QString text)
{
verifyLabel->setText(text);