aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--TODO2
-rw-r--r--importdetaildialog.cpp39
-rw-r--r--importdetaildialog.h2
3 files changed, 27 insertions, 16 deletions
diff --git a/TODO b/TODO
index ed46ef1..57104e5 100644
--- a/TODO
+++ b/TODO
@@ -17,7 +17,7 @@ Release 0.3.2
- update gpgme-library
- understandable message if no matching private key found for decryption (no data error)
- investigate in adding a offline help system
-- strike out revoked keys in keylist and add warning to keydetails
+- strike out revoked keys in keylist and add warning to keydetails [DONE]
- keyimport dialog should show reason for strike out
- key import should be more verbose: [DONE]
- show message, which keys are imported [DONE]
diff --git a/importdetaildialog.cpp b/importdetaildialog.cpp
index b07d14a..61b5972 100644
--- a/importdetaildialog.cpp
+++ b/importdetaildialog.cpp
@@ -28,24 +28,15 @@ ImportDetailDialog::ImportDetailDialog(GpgME::GpgContext* ctx, KeyList* keyList,
mKeyList = keyList;
mResult = result;
+ if (mResult->considered == 0) {
+ QMessageBox::information(0, tr("Key import details"), tr("No keys found to import"));
+ return;
+ }
+
mvbox = new QVBoxLayout();
this->createGeneralInfoBox();
-
- QWidget *detailButtonBox = new QWidget(this);
- QHBoxLayout *detailButtonBoxLayout = new QHBoxLayout(detailButtonBox);
-
- detailButton = new QPushButton(tr("Show Details"),detailButtonBox);
- detailButtonBoxLayout->addWidget(detailButton,Qt::AlignLeft);
- connect(detailButton, SIGNAL(clicked()), this, SLOT(showHideDetails()));
-
- QPushButton *closeButton = new QPushButton(tr("Close"),detailButtonBox);
- detailButtonBoxLayout->addWidget(closeButton,Qt::AlignRight);
- connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
-
- detailButtonBox->setLayout(detailButtonBoxLayout);
-
- mvbox->addWidget(detailButtonBox);
+ this->createButtonBox();
this->createKeyInfoBox();
// Create ButtonBox for OK-Button
@@ -118,6 +109,24 @@ void ImportDetailDialog::createGeneralInfoBox()
mvbox->addWidget(generalInfoBox);
}
+void ImportDetailDialog::createButtonBox()
+{
+ detailButtonBox = new QWidget(this);
+ QHBoxLayout *detailButtonBoxLayout = new QHBoxLayout(detailButtonBox);
+
+ detailButton = new QPushButton(tr("Show Details"),detailButtonBox);
+ detailButtonBoxLayout->addWidget(detailButton,Qt::AlignLeft);
+ connect(detailButton, SIGNAL(clicked()), this, SLOT(showHideDetails()));
+
+ QPushButton *closeButton = new QPushButton(tr("Close"),detailButtonBox);
+ detailButtonBoxLayout->addWidget(closeButton,Qt::AlignRight);
+ connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+
+ detailButtonBox->setLayout(detailButtonBoxLayout);
+
+ mvbox->addWidget(detailButtonBox);
+}
+
void ImportDetailDialog::createKeyInfoBox()
{
// get details for the imported keys;
diff --git a/importdetaildialog.h b/importdetaildialog.h
index 06b8040..9396af6 100644
--- a/importdetaildialog.h
+++ b/importdetaildialog.h
@@ -43,6 +43,7 @@ private slots:
private:
void createGeneralInfoBox();
void createKeyInfoBox();
+ void createButtonBox();
GpgME::GpgContext *mCtx;
KeyList *mKeyList;
@@ -50,6 +51,7 @@ private:
QGroupBox *keyInfoBox;
QVBoxLayout *mvbox;
QPushButton *detailButton;
+ QWidget *detailButtonBox;
QGridLayout *generalInfoBoxLayout;
QGridLayout *keyInfoBoxLayout;
gpgme_import_result_t mResult;