diff options
| author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-11-25 00:21:52 +0100 |
|---|---|---|
| committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-11-25 00:21:52 +0100 |
| commit | c062b683f43a7963bf1524ad68047b9082be7b8e (patch) | |
| tree | 8fa6b04bc12366ca92332fed5df95a5504fa5d9c /importdetaildialog.cpp | |
| parent | added import status in import detail dialog (diff) | |
| download | gpg4usb-c062b683f43a7963bf1524ad68047b9082be7b8e.tar.gz gpg4usb-c062b683f43a7963bf1524ad68047b9082be7b8e.zip | |
show dialog if no key is found for import
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@649 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'importdetaildialog.cpp')
| -rw-r--r-- | importdetaildialog.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
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; |
