diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | gpgwin.cpp | 7 | ||||
-rw-r--r-- | release/css/default.css | 4 | ||||
-rw-r--r-- | verifynotification.cpp | 45 | ||||
-rw-r--r-- | verifynotification.h | 33 |
5 files changed, 66 insertions, 25 deletions
@@ -34,7 +34,7 @@ attachments: - show keys which verified message in different colour - css - save the last used directory in open file dialog - +- move attachmentswidget to editorpage BUGS: - Sometimes two or more stars are shown at modified documents - enter "satann keyserverimport and it crashes @@ -784,7 +784,7 @@ void GpgWin::verify() qDebug() << "sig validity reason: " << sign->validity_reason << " - " << gpg_err_code(sign->validity_reason) << " - " << gpgme_strerror(sign->validity_reason); sign = sign->next; } - vn->setVerifyDetailText(*verifyDetailText); + //vn->setVerifyDetailText(*verifyDetailText); // If an unknown key is found, enable the importfromkeyserveraction if (unknownKeyFound) { @@ -795,8 +795,11 @@ void GpgWin::verify() // Remove the last linebreak verifyLabelText.remove(verifyLabelText.length()-1,1); + vn->addVerifyLabel(verifyLabelText,"ok"); + vn->addVerifyLabel(verifyLabelText,"warning"); + vn->addVerifyLabel(verifyLabelText,"critical"); - vn->setVerifyLabel(verifyLabelText); +// vn->setVerifyLabel(verifyLabelText); edit->curPage()->showNotificationWidget(vn, "verifyNotification"); } diff --git a/release/css/default.css b/release/css/default.css index 1e74d57..2709ac2 100644 --- a/release/css/default.css +++ b/release/css/default.css @@ -8,6 +8,8 @@ font: bold; } */ - +QLabel#warning { background-color: #ececba } +QLabel#ok { background-color: #ccffcc } +QLabel#critical { background-color: #ff8080 } *[keyNotFound="true"] { background-color: yellow } *[keyFound="true"] { background-color: green } diff --git a/verifynotification.cpp b/verifynotification.cpp index 1569542..25cbc4e 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -5,37 +5,64 @@ VerifyNotification::VerifyNotification(GpgME::Context *ctx, QWidget *parent ) : QWidget(parent) { mCtx = ctx; + + //text shown in verify notification verifyLabel = new QLabel(this); + // QLabel *verifyLabel2 = new QLabel(this); + // verifyLabel2->setText("hallo"); + + // Text contained in detilsdialog verifyDetailText = new QString(); + // List kontaining the signature keys not contained in keylist + keysNotInList = new QStringList(); + importFromKeyserverAct = new QAction(tr("Import missing key from Keyserver"), this); connect(importFromKeyserverAct, SIGNAL(triggered()), this, SLOT(importFromKeyserver())); showVerifyDetailsAct = new QAction(tr("Show detailed verify information"), this); connect(showVerifyDetailsAct, SIGNAL(triggered()), this, SLOT(showVerifyDetails())); + // Menu for the details button detailMenu = new QMenu(this); detailMenu->addAction(showVerifyDetailsAct); detailMenu->addAction(importFromKeyserverAct); importFromKeyserverAct->setVisible(false); - keysNotInList = new QStringList(); - + // the details button detailsButton = new QPushButton("Details",this); detailsButton->setMenu(detailMenu); + verifyLabelList = new QWidget(this); + verifyLabelListLayout = new QVBoxLayout(this); + verifyLabelList->setLayout(verifyLabelListLayout); + //addVerifyLabel(verifyLabel->text(),QString("ok")); + verifyLabel->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); +// verifyLabelListLayout->addWidget(verifyLabel2); + //verifyLabel2->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); notificationWidgetLayout = new QHBoxLayout(this); + verifyLabelListLayout->setContentsMargins(0,0,0,0); notificationWidgetLayout->setContentsMargins(0,0,0,0); - notificationWidgetLayout->addWidget(verifyLabel,2); + notificationWidgetLayout->addWidget(verifyLabelList); notificationWidgetLayout->addWidget(detailsButton); + detailsButton->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); this->setLayout(notificationWidgetLayout); +} + +void VerifyNotification::addVerifyLabel(QString text, QString status) +{ + QLabel *label = new QLabel(text); + label->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); +// label->setContentsMargins(0,0,0,0); + verifyLabelListLayout->addWidget(label); + + label->setObjectName(status); } -void VerifyNotification::setVerifyDetailText (QString text) +void VerifyNotification::setVerifyLabel(QString text) { - verifyDetailText->clear(); - verifyDetailText->append(text); + verifyLabel->setText(text); return; } @@ -47,12 +74,6 @@ void VerifyNotification::importFromKeyserver() } } -void VerifyNotification::setVerifyLabel(QString text) -{ - verifyLabel->setText(text); - return; -} - void VerifyNotification::showImportAction() { importFromKeyserverAct->setVisible(true); diff --git a/verifynotification.h b/verifynotification.h index 1e7a604..2da80bd 100644 --- a/verifynotification.h +++ b/verifynotification.h @@ -35,6 +35,7 @@ public: * Change on members: none */ void showImportAction(); + /**************************************************************************************** * Name: hideImportAction * Description: hide the action in detailsmenu @@ -45,27 +46,41 @@ public: void hideImportAction(); /**************************************************************************************** - * Name: setVerifyDetailText - * Description: set the text of verify-detail dialog - * Parameters: QString containing the text + * Name: addVerifyLabel + * Description: add the Label labeled "text" to verifylabellist + * Parameters: QString containing the text and + * status string (should be "ok","warning", or "critical") * Return Values: none - * Change on members: verifyDetailText changes to text + * Change on members: Label is added to verifyList */ - void setVerifyDetailText(QString text); + void addVerifyLabel(QString text, QString status); /**************************************************************************************** * Name: keysNotInList * Description: List holding the keys in signature, which are not in the keylist */ QStringList *keysNotInList; - // set text shown in verifydetails dialog - + QWidget *verifyLabelList; + QVBoxLayout *verifyLabelListLayout; signals: public slots: - // import missing key from keyserver + /**************************************************************************************** + * Name: importFromKeyserver + * Description: import signaturekey missing in keylist from keyserver + * Parameters: none + * Return Values: none + * Change on members: none + */ void importFromKeyserver(); - // show verify details + + /**************************************************************************************** + * Name: showVerifyDetails + * Description: show verify details dialog + * Parameters: none + * Return Values: none + * Change on members: none + */ void showVerifyDetails(); private: |