aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-06-28 22:48:58 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-06-28 22:48:58 +0000
commite4fcab7ccf26894114d02710c36a056e83514f07 (patch)
treee2cd6fdd4557c639d124a6db0e764afa8710ee08
parentset default keyserver to newly added keyserver in settingsdialog (diff)
downloadgpg4usb-e4fcab7ccf26894114d02710c36a056e83514f07.tar.gz
gpg4usb-e4fcab7ccf26894114d02710c36a056e83514f07.zip
add posibility to remove keyserver in settingsdialog
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@919 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--TODO2
-rwxr-xr-xsettingsdialog.cpp31
-rwxr-xr-xsettingsdialog.h1
3 files changed, 31 insertions, 3 deletions
diff --git a/TODO b/TODO
index 3c8db65..5f2c5e3 100644
--- a/TODO
+++ b/TODO
@@ -16,7 +16,7 @@ Release 0.3.3
- add possibility for creation of RSA keys [DONE]
- set DSA subkey to user specified size, not only 1024 bit [DONE]
- add posibility to add keyserver in settings [DONE]
-- add posibility to remove keyserver in settings
+- add posibility to remove keyserver in settings [DONE]
BUGS:
- key generation doesn't work sometimes
diff --git a/settingsdialog.cpp b/settingsdialog.cpp
index 7e8125d..60e58a8 100755
--- a/settingsdialog.cpp
+++ b/settingsdialog.cpp
@@ -405,11 +405,13 @@ KeyserverTab::KeyserverTab(QWidget *parent)
{
QVBoxLayout *mainLayout = new QVBoxLayout(this);
- QLabel *label = new QLabel(tr("Default Keyserver for import:"));
comboBox = new QComboBox;
comboBox->setEditable(false);
comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+ /*
+ * box for adding a new keyserver
+ */
QWidget *addKeyServerBox = new QWidget(this);
QHBoxLayout *addKeyServerLayout = new QHBoxLayout(addKeyServerBox);
QLabel *http = new QLabel("http://");
@@ -420,9 +422,25 @@ KeyserverTab::KeyserverTab(QWidget *parent)
addKeyServerLayout->addWidget(newKeyServerEdit);
addKeyServerLayout->addWidget(newKeyServerButton);
- mainLayout->addWidget(label);
+ /*
+ * box for removing currently chosen keyserver
+ */
+ QWidget *removeKeyServerBox = new QWidget(this);
+ QPushButton *removeKeyServerButton = new QPushButton(tr("Remove currently chosen from keyserverlist"), this);
+ connect(removeKeyServerButton,SIGNAL(clicked()), this, SLOT(removeKeyServer()));
+ QHBoxLayout *removeKeyServerBoxLayout = new QHBoxLayout(removeKeyServerBox);
+ removeKeyServerBoxLayout->addStretch(1);
+ removeKeyServerBoxLayout->addWidget(removeKeyServerButton);
+
+ /*
+ * add everything to the mainlayout
+ */
+ mainLayout->addWidget(new QLabel(tr("Default Keyserver for import:")));
mainLayout->addWidget(comboBox);
+ mainLayout->addWidget(new QLabel(tr("The currently chosen server is set as default keyserver for all keyserver related operations.")));
+ mainLayout->addWidget(removeKeyServerBox);
mainLayout->addWidget(addKeyServerBox);
+
mainLayout->addStretch(1);
// Read keylist from ini-file and fill it into combobox
@@ -458,6 +476,10 @@ void KeyserverTab::applySettings()
settings.setValue("keyserver/keyServerList", *keyServerList);
}
+/***********************************
+ * add the keyserver from the
+ * qlineedit to the keyserverlist
+ *************************************/
void KeyserverTab::addKeyServer()
{
if (newKeyServerEdit->text().startsWith("http://")) {
@@ -468,6 +490,11 @@ void KeyserverTab::addKeyServer()
comboBox->setCurrentIndex(comboBox->count()-1);
}
+void KeyserverTab::removeKeyServer()
+{
+ comboBox->removeItem(comboBox->currentIndex());
+}
+
AdvancedTab::AdvancedTab(QWidget *parent)
: QWidget(parent)
{
diff --git a/settingsdialog.h b/settingsdialog.h
index ec4a3d0..af6e2b5 100755
--- a/settingsdialog.h
+++ b/settingsdialog.h
@@ -118,6 +118,7 @@ private slots:
private slots:
void addKeyServer();
+ void removeKeyServer();
};
class AdvancedTab : public QWidget