diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-09-11 19:59:44 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-09-11 19:59:44 +0000 |
commit | 68f49002ee2b89bbbb78240b0e6f66147e00866c (patch) | |
tree | eb0be73d7db72a56b46da11207c2bb29096e4836 /verifynotification.cpp | |
parent | more docu in gpgwin.cpp and set slots in gpgwin from public to private (diff) | |
download | gpg4usb-68f49002ee2b89bbbb78240b0e6f66147e00866c.tar.gz gpg4usb-68f49002ee2b89bbbb78240b0e6f66147e00866c.zip |
show details in different colours in verfiy detail dialog, further commenting and added fillTextEditWithText to textedit
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@530 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'verifynotification.cpp')
-rw-r--r-- | verifynotification.cpp | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/verifynotification.cpp b/verifynotification.cpp index c177497..a13bcc8 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -26,7 +26,6 @@ VerifyNotification::VerifyNotification(GpgME::Context *ctx, QWidget *parent ) : { mCtx = ctx; verifyLabel = new QLabel(this); - verifyDetailText = new QString(); importFromKeyserverAct = new QAction(tr("Import missing key from Keyserver"), this); connect(importFromKeyserverAct, SIGNAL(triggered()), this, SLOT(importFromKeyserver())); @@ -47,15 +46,19 @@ VerifyNotification::VerifyNotification(GpgME::Context *ctx, QWidget *parent ) : notificationWidgetLayout->setContentsMargins(0,0,0,0); notificationWidgetLayout->addWidget(verifyLabel,2); notificationWidgetLayout->addWidget(detailsButton); - this->setLayout(notificationWidgetLayout); + verifyDetailListLayout = new QVBoxLayout(); } -void VerifyNotification::setVerifyDetailText (QString text) +void VerifyNotification::addVerifyDetailLabel(QString text,verify_label_status status,bool prepend) { - verifyDetailText->clear(); - verifyDetailText->append(text); - return; + if (prepend) { + verifyDetailStringVector.prepend(text); + verifyDetailStatusVector.prepend(status); + } else { + verifyDetailStringVector.append(text); + verifyDetailStatusVector.append(status); + } } void VerifyNotification::importFromKeyserver() @@ -90,6 +93,34 @@ void VerifyNotification::showImportAction(bool visible) void VerifyNotification::showVerifyDetails() { - QMessageBox::information(this,tr("Details"),QString(*verifyDetailText), QMessageBox::Ok); + 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; } |