aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-11-23 22:19:11 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-11-23 22:19:11 +0000
commit18c470623ff39a7cb4cb8b4a785ecfed815a6e2f (patch)
tree313d13e800d263b5a9d5aa59d5518dc11a335b93
parentadded files for import information (diff)
downloadgpg4usb-18c470623ff39a7cb4cb8b4a785ecfed815a6e2f.tar.gz
gpg4usb-18c470623ff39a7cb4cb8b4a785ecfed815a6e2f.zip
added button to importdetails to show/hide details for individual keys
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@647 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--importdetaildialog.cpp38
-rw-r--r--importdetaildialog.h6
2 files changed, 40 insertions, 4 deletions
diff --git a/importdetaildialog.cpp b/importdetaildialog.cpp
index 4b30887..758a89d 100644
--- a/importdetaildialog.cpp
+++ b/importdetaildialog.cpp
@@ -31,19 +31,51 @@ ImportDetailDialog::ImportDetailDialog(GpgME::GpgContext* ctx, KeyList* keyList,
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->createKeyInfoBox();
// Create ButtonBox for OK-Button
- okButtonBox = new QDialogButtonBox(QDialogButtonBox::Close);
- connect(okButtonBox, SIGNAL(rejected()), this, SLOT(close()));
- mvbox->addWidget(okButtonBox);
+ //okButtonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ //connect(okButtonBox, SIGNAL(rejected()), this, SLOT(close()));
+ //mvbox->addWidget(okButtonBox);
+
+ detailsShown=true;
this->setLayout(mvbox);
this->setWindowTitle(tr("Key import details"));
this->setModal(true);
+ showHideDetails();
this->exec();
}
+void ImportDetailDialog::showHideDetails()
+{
+ if (detailsShown) {
+ detailButton->setText(tr("Show Details"));
+ keyInfoBox->hide();
+ detailsShown=false;
+ } else {
+ detailButton->setText(tr("Hide Details"));
+ keyInfoBox->show();
+ detailsShown=true;
+ }
+
+}
+
void ImportDetailDialog::createGeneralInfoBox()
{
// GridBox for general import information
diff --git a/importdetaildialog.h b/importdetaildialog.h
index f4d05de..06b8040 100644
--- a/importdetaildialog.h
+++ b/importdetaildialog.h
@@ -37,6 +37,9 @@ class ImportDetailDialog : public QDialog
public:
ImportDetailDialog(GpgME::GpgContext* ctx, KeyList* keyList, gpgme_import_result_t result, QWidget *parent = 0);
+private slots:
+ void showHideDetails();
+
private:
void createGeneralInfoBox();
void createKeyInfoBox();
@@ -45,11 +48,12 @@ private:
KeyList *mKeyList;
QGroupBox *generalInfoBox;
QGroupBox *keyInfoBox;
- QDialogButtonBox *okButtonBox;
QVBoxLayout *mvbox;
+ QPushButton *detailButton;
QGridLayout *generalInfoBoxLayout;
QGridLayout *keyInfoBoxLayout;
gpgme_import_result_t mResult;
+ bool detailsShown;
};
#endif // __IMPORTDETAILSDIALOG_H__