From 54f9d1f4d3ab003f4d658aeb64b482b212ab7041 Mon Sep 17 00:00:00 2001 From: nils Date: Tue, 2 Aug 2011 00:43:21 +0000 Subject: added information to verifylabel and functionalitiy to import missing keys. Dont show a delete dialog, if no key is checked git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@506 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- verifynotification.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'verifynotification.cpp') 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); -- cgit v1.2.3