From 188282cd21fccce9f67a180d499e2cb875a5f938 Mon Sep 17 00:00:00 2001 From: nils Date: Mon, 8 Aug 2011 20:01:02 +0000 Subject: only show import key action in verificynotification-menu when theres missing key on verify git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@510 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- verifynotification.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'verifynotification.cpp') diff --git a/verifynotification.cpp b/verifynotification.cpp index b9db071..b96615a 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -13,11 +13,16 @@ VerifyNotification::VerifyNotification(GpgME::Context *ctx, QWidget *parent ) : this->setLayout(notificationWidgetLayout); - QAction *importFromKeyserverAct = new QAction(tr("Import missing key from Keyserver"), this); + importFromKeyserverAct = new QAction(tr("Import missing key from Keyserver"), this); connect(importFromKeyserverAct, SIGNAL(triggered()), this, SLOT(importFromKeyserver())); - QMenu *detailMenu = new QMenu(this); + showVerifyDetailsAct = new QAction(tr("Show detailed verify information"), this); + connect(showVerifyDetailsAct, SIGNAL(triggered()), this, SLOT(showVerifyDetails())); + + detailMenu = new QMenu(this); + detailMenu->addAction(showVerifyDetailsAct); detailMenu->addAction(importFromKeyserverAct); + importFromKeyserverAct->setVisible(false); keysNotInList = new QStringList(); QPushButton *verifyButton = new QPushButton("Details",this); verifyButton->setMenu(detailMenu); @@ -36,3 +41,20 @@ void VerifyNotification::setVerifyLabel(QString text) verifyLabel->setText(text); return; } + +void VerifyNotification::addImportAction() +{ + importFromKeyserverAct->setVisible(true); + return; +} +void VerifyNotification::removeImportAction() +{ + importFromKeyserverAct->setVisible(false); + return; +} + +void VerifyNotification::showVerifyDetails() +{ + QMessageBox::information(this,tr("Details"),tr("key verified"),QMessageBox::Cancel | QMessageBox::Ok); + return; +} -- cgit