diff options
-rw-r--r-- | keyserverimportdialog.cpp | 1 | ||||
-rw-r--r-- | release/css/default.css | 2 | ||||
-rw-r--r-- | verifydetailsdialog.cpp | 24 | ||||
-rw-r--r-- | verifydetailsdialog.h | 8 | ||||
-rw-r--r-- | verifynotification.cpp | 17 |
5 files changed, 29 insertions, 23 deletions
diff --git a/keyserverimportdialog.cpp b/keyserverimportdialog.cpp index fc44458..c5c4e09 100644 --- a/keyserverimportdialog.cpp +++ b/keyserverimportdialog.cpp @@ -221,7 +221,6 @@ void KeyServerImportDialog::import() void KeyServerImportDialog::import(QStringList keyIds) { - foreach(QString keyId, keyIds) { QUrl url = "http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x"+keyId+"&options=mr"; QNetworkReply *reply = qnam.get(QNetworkRequest(url)); diff --git a/release/css/default.css b/release/css/default.css index 31533f4..8165d2a 100644 --- a/release/css/default.css +++ b/release/css/default.css @@ -2,7 +2,7 @@ /*#verifyBox { background-color: #CBFDCB }*/ -#cryptToolBar { background-color: #CBFDCB } +/*#cryptToolBar { background-color: #CBFDCB }*/ /* QLabel, QAbstractButton { font: bold; diff --git a/verifydetailsdialog.cpp b/verifydetailsdialog.cpp index aec1f73..e9150bd 100644 --- a/verifydetailsdialog.cpp +++ b/verifydetailsdialog.cpp @@ -30,22 +30,22 @@ VerifyDetailsDialog::VerifyDetailsDialog(QWidget *parent, GpgME::Context* ctx, K this->setWindowTitle(tr("Signaturedetails")); connect(mCtx, SIGNAL(keyDBChanged()), this, SLOT(refresh())); - - mVbox = new QVBoxLayout(); - this->setLayout(mVbox); + mainLayout = new QHBoxLayout(); + this->setLayout(mainLayout); refresh(); - this->exec(); } void VerifyDetailsDialog::refresh() { - // At first claer all children widgets - QList<QLabel *> allChildren = mVbox->findChildren<QLabel *>(); - foreach (QLabel *label,allChildren) { - label->close(); + if (mVbox) { + mVbox->close(); } + mVbox = new QWidget(); + mVboxLayout = new QVBoxLayout(mVbox); + mainLayout->addWidget(mVbox); + // Get signature information of current text QByteArray text = mTextpage->toPlainText().toAscii(); // TODO: toUtf8() here? mCtx->preventNoDataErr(&text); @@ -60,12 +60,12 @@ void VerifyDetailsDialog::refresh() { case 2: { - mVbox->addWidget(new QLabel(tr("Text was completly signed on %1 by:\n").arg(timestamp.toString(Qt::SystemLocaleShortDate)))); + mVboxLayout->addWidget(new QLabel(tr("Text was completly signed on %1 by:\n").arg(timestamp.toString(Qt::SystemLocaleShortDate)))); break; } case 1: { - mVbox->addWidget(new QLabel(tr("Text was partially signed on %1 by:\n").arg(timestamp.toString(Qt::SystemLocaleShortDate)))); + mVboxLayout->addWidget(new QLabel(tr("Text was partially signed on %1 by:\n").arg(timestamp.toString(Qt::SystemLocaleShortDate)))); break; } } @@ -74,11 +74,11 @@ void VerifyDetailsDialog::refresh() while (sign) { VerifyKeyDetailBox *sbox = new VerifyKeyDetailBox(this,mCtx,mKeyList,sign); sign = sign->next; - mVbox->addWidget(sbox); + mVboxLayout->addWidget(sbox); } // Button Box for close button buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); - mVbox->addWidget(buttonBox); + mVboxLayout->addWidget(buttonBox); } diff --git a/verifydetailsdialog.h b/verifydetailsdialog.h index afcdfe0..317735b 100644 --- a/verifydetailsdialog.h +++ b/verifydetailsdialog.h @@ -36,9 +36,11 @@ private slots: void refresh(); private: - GpgME::Context* mCtx; - KeyList* mKeyList; - QVBoxLayout* mVbox; + GpgME::Context *mCtx; + KeyList *mKeyList; + QHBoxLayout *mainLayout; + QVBoxLayout *mVboxLayout; + QWidget *mVbox; QPlainTextEdit *mTextpage; /** Textedit associated to the notification */ QDialogButtonBox* buttonBox; }; diff --git a/verifynotification.cpp b/verifynotification.cpp index 1c4b55d..40d5604 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -63,19 +63,24 @@ void VerifyNotification::importFromKeyserver() void VerifyNotification::setVerifyLabel(QString text, verify_label_status verifyLabelStatus) { + QString color; verifyLabel->setText(text); switch (verifyLabelStatus) { - case VERIFY_ERROR_OK: verifyLabel->setObjectName("ok"); + case VERIFY_ERROR_OK: color="#ccffcc"; break; - case VERIFY_ERROR_WARN: verifyLabel->setObjectName("warning"); + case VERIFY_ERROR_WARN: color="#ececba"; break; - case VERIFY_ERROR_CRITICAL: verifyLabel->setObjectName("critical"); + case VERIFY_ERROR_CRITICAL: color="#ff8080"; break; default: break; } - return; -} + + verifyLabel->setAutoFillBackground(true); + QPalette status = verifyLabel->palette(); + status.setColor(QPalette::Background, color); + verifyLabel->setPalette(status); +} void VerifyNotification::showImportAction(bool visible) { @@ -158,6 +163,6 @@ bool VerifyNotification::refresh() verifyLabelText.remove(verifyLabelText.length()-1,1); this->setVerifyLabel(verifyLabelText,verifyStatus); - + qDebug() << verifyStatus; return true; } |