diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-10-16 00:28:55 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2011-10-16 00:28:55 +0000 |
commit | a6c1843ed6e8ec767d49e5206c91d2dcc0ba296f (patch) | |
tree | ff2e45ecd92ab12e616a08998ff9c76cc893b2da | |
parent | overload import function to provide keyserverUrl (diff) | |
download | gpg4usb-a6c1843ed6e8ec767d49e5206c91d2dcc0ba296f.tar.gz gpg4usb-a6c1843ed6e8ec767d49e5206c91d2dcc0ba296f.zip |
added keyservertab to settings
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@553 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r-- | TODO | 29 | ||||
-rw-r--r-- | context.h | 13 | ||||
-rwxr-xr-x | settingsdialog.cpp | 479 | ||||
-rwxr-xr-x | settingsdialog.h | 13 | ||||
-rw-r--r-- | verifynotification.cpp | 3 |
5 files changed, 288 insertions, 249 deletions
@@ -4,37 +4,36 @@ Release 0.3.1 - export key: default filename to <keyowner-name>.asc [DONE] - make email adress from keylist copyable [DONE] - show keydetails-dialog in keylist on mainwindow [DONE] -- key should blink short in keylist after import -- show keys which verified message in different colour -- css -- set gpgme error language to chosen language (context.cpp:49) -- in verifycation dialog import multiple keys -- inform user about verification errors +- in verifycation dialog import multiple keys [DONE] +- inform user about verification errors [DONE] - enum for verify status [DONE] - put sign/verify to toolbar and add shortcuts [DONE] - umlaute are not handled correctly in signing [DONE] -- beautify icons for verify and sign - check class / includes [DONE] - keydetailsdialog should have a parent [DONE] - Verifynotification margin left [DONE] -- remove doubled functions (e.g. beautifyfingerprint and keymgmt functions like import) +- remove doubled functions (e.g. beautifyfingerprint and keymgmt functions like import) [DONE] - take care of warnings in compiling [DONE] -- export public key on export of private key too -- put keydetails to keylist -- dont hide verifynotification {DONE] -- import from keyserver doesn't end, if network-connection is available, but no connection to keyserver -- refresh verify after import of keys +- put keydetails to keylist [DONE] +- dont hide verifynotification [DONE] +- refresh verify after import of keys [DONE] +- show, if message is partially verified(how)? [DONE] - replace hardcoded urls in keyserverimport +- export public key on export of private key too +- beautify icons for verify and sign +- key should blink short in keylist after import +- set gpgme error language to chosen language (context.cpp:49) +- import from keyserver doesn't end, if network-connection is available, but no connection to keyserver +- keyid should be searchable in import from keyserver BUGS: - Sometimes two or more stars are shown at modified documents -- what should be shown in verify message? -- show, if message is partially verified(how)? Release 0.3.2 - Change private key password (catch bad passphrase message) - Wizard on first start (Create Key, Import from older gpg4usb, import from gnupg) - GPLv3 +- css - check and add missing statusbar messages - set mainwindow-statusbar text via signal - more doku on building gpg4usb (especially on windows) @@ -51,19 +51,6 @@ public: typedef QLinkedList< GpgKey > GpgKeyList; -class GpgSignature -{ -public: - QString fpr; - QString name; - QString email; - gpgme_error_t signStatusCode; - QString signStatusString; - bool presentInKeyList; -}; - -typedef QLinkedList< GpgSignature > GpgSignatureList; - namespace GpgME { diff --git a/settingsdialog.cpp b/settingsdialog.cpp index cdd63ad..1f16f4a 100755 --- a/settingsdialog.cpp +++ b/settingsdialog.cpp @@ -21,46 +21,48 @@ #include "settingsdialog.h" - SettingsDialog::SettingsDialog(QWidget *parent) - : QDialog(parent) +SettingsDialog::SettingsDialog(QWidget *parent) + : QDialog(parent) { - tabWidget = new QTabWidget; - generalTab = new GeneralTab; - appearanceTab = new AppearanceTab; - mimeTab = new MimeTab; + tabWidget = new QTabWidget; + generalTab = new GeneralTab; + appearanceTab = new AppearanceTab; + mimeTab = new MimeTab; + keyserverTab = new KeyserverTab; + + tabWidget->addTab(generalTab, tr("General")); + tabWidget->addTab(appearanceTab, tr("Appearance")); + tabWidget->addTab(mimeTab, tr("PGP/Mime")); + tabWidget->addTab(keyserverTab, tr("Keyserver")); + buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok + | QDialogButtonBox::Cancel); + + connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); + connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - tabWidget->addTab(generalTab, tr("General")); - tabWidget->addTab(appearanceTab, tr("Appearance")); - tabWidget->addTab(mimeTab, tr("PGP/Mime")); - - buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok - | QDialogButtonBox::Cancel); - - connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(tabWidget); - mainLayout->addWidget(buttonBox); - setLayout(mainLayout); + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(tabWidget); + mainLayout->addWidget(buttonBox); + setLayout(mainLayout); - setWindowTitle(tr("Settings")); + setWindowTitle(tr("Settings")); exec(); } - void SettingsDialog::accept() - { - generalTab->applySettings(); - mimeTab->applySettings(); - appearanceTab->applySettings(); - close(); - } +void SettingsDialog::accept() +{ + generalTab->applySettings(); + mimeTab->applySettings(); + appearanceTab->applySettings(); + keyserverTab->applySettings(); + close(); +} - GeneralTab::GeneralTab(QWidget *parent) - : QWidget(parent) - { +GeneralTab::GeneralTab(QWidget *parent) + : QWidget(parent) +{ /***************************************** * remember Password-Box @@ -95,7 +97,7 @@ QGroupBox *langBox = new QGroupBox(tr("Language")); QVBoxLayout *langBoxLayout = new QVBoxLayout(); langSelectBox = new QComboBox; - lang = listLanguages(); + lang = listLanguages(); foreach(QString l , lang) { langSelectBox->addItem(l); @@ -114,47 +116,47 @@ setSettings(); mainLayout->addStretch(1); setLayout(mainLayout); - } +} - /********************************** +/********************************** * Read the settings from config * and set the buttons and checkboxes * appropriately **********************************/ - void GeneralTab::setSettings() - { - QSettings settings; - // Keysaving - if (settings.value("keys/keySave").toBool()) saveCheckedKeysCheckBox->setCheckState(Qt::Checked); - - // Remember Password - if (settings.value("general/rememberPassword").toBool()) rememberPasswordCheckBox->setCheckState(Qt::Checked); - - // Language setting - QString langKey = settings.value("int/lang").toString(); - QString langValue = lang.value(langKey); - if (langKey != "") { +void GeneralTab::setSettings() +{ + QSettings settings; + // Keysaving + if (settings.value("keys/keySave").toBool()) saveCheckedKeysCheckBox->setCheckState(Qt::Checked); + + // Remember Password + if (settings.value("general/rememberPassword").toBool()) rememberPasswordCheckBox->setCheckState(Qt::Checked); + + // Language setting + QString langKey = settings.value("int/lang").toString(); + QString langValue = lang.value(langKey); + if (langKey != "") { langSelectBox->setCurrentIndex(langSelectBox->findText(langValue)); } // Ask for confirmation to import, if keyfiles are dropped on keylist - if (settings.value("general/confirmImportKeys",Qt::Checked).toBool()){ + if (settings.value("general/confirmImportKeys",Qt::Checked).toBool()){ importConfirmationCheckBox->setCheckState(Qt::Checked); } - } +} - /*********************************** +/*********************************** * get the values of the buttons and * write them to settings-file *************************************/ - void GeneralTab::applySettings() - { - QSettings settings; - settings.setValue("keys/keySave", saveCheckedKeysCheckBox->isChecked()); - // TODO: clear passwordCache instantly on unset rememberPassword - settings.setValue("general/rememberPassword", rememberPasswordCheckBox->isChecked()); - settings.setValue("int/lang", lang.key(langSelectBox->currentText())); - settings.setValue("general/confirmImportKeys", importConfirmationCheckBox->isChecked()); - } +void GeneralTab::applySettings() +{ + QSettings settings; + settings.setValue("keys/keySave", saveCheckedKeysCheckBox->isChecked()); + // TODO: clear passwordCache instantly on unset rememberPassword + settings.setValue("general/rememberPassword", rememberPasswordCheckBox->isChecked()); + settings.setValue("int/lang", lang.key(langSelectBox->currentText())); + settings.setValue("general/confirmImportKeys", importConfirmationCheckBox->isChecked()); +} // http://www.informit.com/articles/article.aspx?p=1405555&seqNum=3 QHash<QString, QString> GeneralTab::listLanguages() @@ -166,7 +168,7 @@ QHash<QString, QString> GeneralTab::listLanguages() QString appPath = qApp->applicationDirPath(); QDir qmDir = QDir(appPath + "/ts/"); QStringList fileNames = - qmDir.entryList(QStringList("gpg4usb_*.qm")); + qmDir.entryList(QStringList("gpg4usb_*.qm")); for (int i = 0; i < fileNames.size(); ++i) { QString locale = fileNames[i]; @@ -183,208 +185,247 @@ QHash<QString, QString> GeneralTab::listLanguages() } - MimeTab::MimeTab(QWidget *parent) - : QWidget(parent) - { - /***************************************** +MimeTab::MimeTab(QWidget *parent) + : QWidget(parent) +{ + /***************************************** * MIME-Parsing-Box *****************************************/ - QGroupBox *mimeQPBox = new QGroupBox(tr("Decode quoted printable")); - QVBoxLayout *mimeQPBoxLayout = new QVBoxLayout(); - mimeQPCheckBox = new QCheckBox(tr("Try to recognize quoted printable."), this); - mimeQPBoxLayout->addWidget(mimeQPCheckBox); - mimeQPBox->setLayout(mimeQPBoxLayout); - - - QGroupBox *mimeParseBox = new QGroupBox(tr("Parse PGP/MIME (Experimental)")); - QVBoxLayout *mimeParseBoxLayout = new QVBoxLayout(); - mimeParseCheckBox = new QCheckBox(tr("Try to split attachments from PGP-MIME ecrypted messages."), this); - mimeParseBoxLayout->addWidget(mimeParseCheckBox); - mimeParseBox->setLayout(mimeParseBoxLayout); - - QGroupBox *mimeOpenAttachmentBox = new QGroupBox(tr("Open with external application (Experimental)")); - QVBoxLayout *mimeOpenAttachmentBoxLayout = new QVBoxLayout(); - QLabel *mimeOpenAttachmentText = new QLabel(tr("Open attachments with default application for the filetype.<br> " - "There are at least two possible problems with this behaviour:" - "<ol><li>File needs to be saved unencrypted to attachments folder.<br> " - "Its your job to clean this folder.</li>" - "<li>The external application may have its own temp files.</li></ol>")); + QGroupBox *mimeQPBox = new QGroupBox(tr("Decode quoted printable")); + QVBoxLayout *mimeQPBoxLayout = new QVBoxLayout(); + mimeQPCheckBox = new QCheckBox(tr("Try to recognize quoted printable."), this); + mimeQPBoxLayout->addWidget(mimeQPCheckBox); + mimeQPBox->setLayout(mimeQPBoxLayout); + + + QGroupBox *mimeParseBox = new QGroupBox(tr("Parse PGP/MIME (Experimental)")); + QVBoxLayout *mimeParseBoxLayout = new QVBoxLayout(); + mimeParseCheckBox = new QCheckBox(tr("Try to split attachments from PGP-MIME ecrypted messages."), this); + mimeParseBoxLayout->addWidget(mimeParseCheckBox); + mimeParseBox->setLayout(mimeParseBoxLayout); + + QGroupBox *mimeOpenAttachmentBox = new QGroupBox(tr("Open with external application (Experimental)")); + QVBoxLayout *mimeOpenAttachmentBoxLayout = new QVBoxLayout(); + QLabel *mimeOpenAttachmentText = new QLabel(tr("Open attachments with default application for the filetype.<br> " + "There are at least two possible problems with this behaviour:" + "<ol><li>File needs to be saved unencrypted to attachments folder.<br> " + "Its your job to clean this folder.</li>" + "<li>The external application may have its own temp files.</li></ol>")); //mimeOpenAttachmentBox->setDisabled(true); - mimeOpenAttachmentCheckBox = new QCheckBox(tr("Enable opening with external applications."), this); - - mimeOpenAttachmentBoxLayout->addWidget(mimeOpenAttachmentText); - mimeOpenAttachmentBoxLayout->addWidget(mimeOpenAttachmentCheckBox); - mimeOpenAttachmentBox->setLayout(mimeOpenAttachmentBoxLayout); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(mimeParseBox); - mainLayout->addWidget(mimeOpenAttachmentBox); - mainLayout->addWidget(mimeQPBox); - mainLayout->addStretch(1); - setLayout(mainLayout); - setSettings(); - } - - /********************************** + mimeOpenAttachmentCheckBox = new QCheckBox(tr("Enable opening with external applications."), this); + + mimeOpenAttachmentBoxLayout->addWidget(mimeOpenAttachmentText); + mimeOpenAttachmentBoxLayout->addWidget(mimeOpenAttachmentCheckBox); + mimeOpenAttachmentBox->setLayout(mimeOpenAttachmentBoxLayout); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(mimeParseBox); + mainLayout->addWidget(mimeOpenAttachmentBox); + mainLayout->addWidget(mimeQPBox); + mainLayout->addStretch(1); + setLayout(mainLayout); + setSettings(); +} + +/********************************** * Read the settings from config * and set the buttons and checkboxes * appropriately **********************************/ - void MimeTab::setSettings() - { - QSettings settings; +void MimeTab::setSettings() +{ + QSettings settings; - // MIME-Parsing - if (settings.value("mime/parsemime").toBool()) mimeParseCheckBox->setCheckState(Qt::Checked); + // MIME-Parsing + if (settings.value("mime/parsemime").toBool()) mimeParseCheckBox->setCheckState(Qt::Checked); - // Qouted Printable - if (settings.value("mime/parseQP",true).toBool()) mimeQPCheckBox->setCheckState(Qt::Checked); + // Qouted Printable + if (settings.value("mime/parseQP",true).toBool()) mimeQPCheckBox->setCheckState(Qt::Checked); - // Open Attachments with external app - if (settings.value("mime/openAttachment").toBool()) mimeOpenAttachmentCheckBox->setCheckState(Qt::Checked); - } + // Open Attachments with external app + if (settings.value("mime/openAttachment").toBool()) mimeOpenAttachmentCheckBox->setCheckState(Qt::Checked); +} - /*********************************** +/*********************************** * get the values of the buttons and * write them to settings-file *************************************/ - void MimeTab::applySettings() - { - QSettings settings; - settings.setValue("mime/parsemime" , mimeParseCheckBox->isChecked()); - settings.setValue("mime/parseQP" , mimeQPCheckBox->isChecked()); - settings.setValue("mime/openAttachment" , mimeOpenAttachmentCheckBox->isChecked()); - - } - - AppearanceTab::AppearanceTab(QWidget *parent) - : QWidget(parent) - { - /***************************************** +void MimeTab::applySettings() +{ + QSettings settings; + settings.setValue("mime/parsemime" , mimeParseCheckBox->isChecked()); + settings.setValue("mime/parseQP" , mimeQPCheckBox->isChecked()); + settings.setValue("mime/openAttachment" , mimeOpenAttachmentCheckBox->isChecked()); + +} + +AppearanceTab::AppearanceTab(QWidget *parent) + : QWidget(parent) +{ + /***************************************** * Icon-Size-Box *****************************************/ - QGroupBox *iconSizeBox = new QGroupBox(tr("Iconsize")); - iconSizeGroup = new QButtonGroup(); - iconSizeSmall = new QRadioButton(tr("small")); - iconSizeMedium = new QRadioButton(tr("medium")); - iconSizeLarge = new QRadioButton(tr("large")); + QGroupBox *iconSizeBox = new QGroupBox(tr("Iconsize")); + iconSizeGroup = new QButtonGroup(); + iconSizeSmall = new QRadioButton(tr("small")); + iconSizeMedium = new QRadioButton(tr("medium")); + iconSizeLarge = new QRadioButton(tr("large")); - iconSizeGroup->addButton(iconSizeSmall, 1); - iconSizeGroup->addButton(iconSizeMedium, 2); - iconSizeGroup->addButton(iconSizeLarge, 3); + iconSizeGroup->addButton(iconSizeSmall, 1); + iconSizeGroup->addButton(iconSizeMedium, 2); + iconSizeGroup->addButton(iconSizeLarge, 3); - QHBoxLayout *iconSizeBoxLayout = new QHBoxLayout(); - iconSizeBoxLayout->addWidget(iconSizeSmall); - iconSizeBoxLayout->addWidget(iconSizeMedium); - iconSizeBoxLayout->addWidget(iconSizeLarge); + QHBoxLayout *iconSizeBoxLayout = new QHBoxLayout(); + iconSizeBoxLayout->addWidget(iconSizeSmall); + iconSizeBoxLayout->addWidget(iconSizeMedium); + iconSizeBoxLayout->addWidget(iconSizeLarge); - iconSizeBox->setLayout(iconSizeBoxLayout); + iconSizeBox->setLayout(iconSizeBoxLayout); - /***************************************** + /***************************************** * Icon-Style-Box *****************************************/ - QGroupBox *iconStyleBox = new QGroupBox(tr("Iconstyle")); - iconStyleGroup = new QButtonGroup(); - iconTextButton = new QRadioButton(tr("just text")); - iconIconsButton = new QRadioButton(tr("just icons")); - iconAllButton = new QRadioButton(tr("text and icons")); + QGroupBox *iconStyleBox = new QGroupBox(tr("Iconstyle")); + iconStyleGroup = new QButtonGroup(); + iconTextButton = new QRadioButton(tr("just text")); + iconIconsButton = new QRadioButton(tr("just icons")); + iconAllButton = new QRadioButton(tr("text and icons")); - iconStyleGroup->addButton(iconTextButton, 1); - iconStyleGroup->addButton(iconIconsButton, 2); - iconStyleGroup->addButton(iconAllButton, 3); + iconStyleGroup->addButton(iconTextButton, 1); + iconStyleGroup->addButton(iconIconsButton, 2); + iconStyleGroup->addButton(iconAllButton, 3); - QHBoxLayout *iconStyleBoxLayout = new QHBoxLayout(); - iconStyleBoxLayout->addWidget(iconTextButton); - iconStyleBoxLayout->addWidget(iconIconsButton); - iconStyleBoxLayout->addWidget(iconAllButton); + QHBoxLayout *iconStyleBoxLayout = new QHBoxLayout(); + iconStyleBoxLayout->addWidget(iconTextButton); + iconStyleBoxLayout->addWidget(iconIconsButton); + iconStyleBoxLayout->addWidget(iconAllButton); - iconStyleBox->setLayout(iconStyleBoxLayout); + iconStyleBox->setLayout(iconStyleBoxLayout); - /***************************************** + /***************************************** * Window-Size-Box *****************************************/ - QGroupBox *windowSizeBox = new QGroupBox(tr("Windowstate")); - QHBoxLayout *windowSizeBoxLayout = new QHBoxLayout(); - windowSizeCheckBox = new QCheckBox(tr("Save window size and position on exit."), this); - windowSizeBoxLayout->addWidget(windowSizeCheckBox); - windowSizeBox->setLayout(windowSizeBoxLayout); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(iconSizeBox); - mainLayout->addWidget(iconStyleBox); - mainLayout->addWidget(windowSizeBox); + QGroupBox *windowSizeBox = new QGroupBox(tr("Windowstate")); + QHBoxLayout *windowSizeBoxLayout = new QHBoxLayout(); + windowSizeCheckBox = new QCheckBox(tr("Save window size and position on exit."), this); + windowSizeBoxLayout->addWidget(windowSizeCheckBox); + windowSizeBox->setLayout(windowSizeBoxLayout); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(iconSizeBox); + mainLayout->addWidget(iconStyleBox); + mainLayout->addWidget(windowSizeBox); + mainLayout->addStretch(1); setSettings(); - setLayout(mainLayout); - } + setLayout(mainLayout); +} - /********************************** +/********************************** * Read the settings from config * and set the buttons and checkboxes * appropriately **********************************/ - void AppearanceTab::setSettings() - { - QSettings settings; - - //Iconsize - QSize iconSize = settings.value("toolbar/iconsize", QSize(32, 32)).toSize(); - switch (iconSize.height()) { - case 12: iconSizeSmall->setChecked(true); - break; - case 24:iconSizeMedium->setChecked(true); - break; - case 32:iconSizeLarge->setChecked(true); - break; - } - // Iconstyle - Qt::ToolButtonStyle iconStyle = static_cast<Qt::ToolButtonStyle>(settings.value("toolbar/iconstyle", Qt::ToolButtonTextUnderIcon).toUInt()); - switch (iconStyle) { - case Qt::ToolButtonTextOnly: iconTextButton->setChecked(true); - break; - case Qt::ToolButtonIconOnly:iconIconsButton->setChecked(true); - break; - case Qt::ToolButtonTextUnderIcon:iconAllButton->setChecked(true); - break; - default: - break; - } - - // Window Save and Position - if (settings.value("window/windowSave").toBool()) windowSizeCheckBox->setCheckState(Qt::Checked); - - } - - /*********************************** +void AppearanceTab::setSettings() +{ + QSettings settings; + + //Iconsize + QSize iconSize = settings.value("toolbar/iconsize", QSize(32, 32)).toSize(); + switch (iconSize.height()) { + case 12: iconSizeSmall->setChecked(true); + break; + case 24:iconSizeMedium->setChecked(true); + break; + case 32:iconSizeLarge->setChecked(true); + break; + } + // Iconstyle + Qt::ToolButtonStyle iconStyle = static_cast<Qt::ToolButtonStyle>(settings.value("toolbar/iconstyle", Qt::ToolButtonTextUnderIcon).toUInt()); + switch (iconStyle) { + case Qt::ToolButtonTextOnly: iconTextButton->setChecked(true); + break; + case Qt::ToolButtonIconOnly:iconIconsButton->setChecked(true); + break; + case Qt::ToolButtonTextUnderIcon:iconAllButton->setChecked(true); + break; + default: + break; + } + + // Window Save and Position + if (settings.value("window/windowSave").toBool()) windowSizeCheckBox->setCheckState(Qt::Checked); + +} + +/*********************************** * get the values of the buttons and * write them to settings-file *************************************/ - void AppearanceTab::applySettings() - { - QSettings settings; - switch (iconSizeGroup->checkedId()) { - case 1: settings.setValue("toolbar/iconsize", QSize(12, 12)); - break; - case 2:settings.setValue("toolbar/iconsize", QSize(24, 24)); - break; - case 3:settings.setValue("toolbar/iconsize", QSize(32, 32)); - break; - } - - switch (iconStyleGroup->checkedId()) { - case 1: settings.setValue("toolbar/iconstyle", Qt::ToolButtonTextOnly); - break; - case 2:settings.setValue("toolbar/iconstyle", Qt::ToolButtonIconOnly); - break; - case 3:settings.setValue("toolbar/iconstyle", Qt::ToolButtonTextUnderIcon); - break; - } +void AppearanceTab::applySettings() +{ + QSettings settings; + switch (iconSizeGroup->checkedId()) { + case 1: settings.setValue("toolbar/iconsize", QSize(12, 12)); + break; + case 2:settings.setValue("toolbar/iconsize", QSize(24, 24)); + break; + case 3:settings.setValue("toolbar/iconsize", QSize(32, 32)); + break; + } + + switch (iconStyleGroup->checkedId()) { + case 1: settings.setValue("toolbar/iconstyle", Qt::ToolButtonTextOnly); + break; + case 2:settings.setValue("toolbar/iconstyle", Qt::ToolButtonIconOnly); + break; + case 3:settings.setValue("toolbar/iconstyle", Qt::ToolButtonTextUnderIcon); + break; + } settings.setValue("window/windowSave", windowSizeCheckBox->isChecked()); - } +} +KeyserverTab::KeyserverTab(QWidget *parent) + : QWidget(parent) +{ + QVBoxLayout *mainLayout = new QVBoxLayout(this); + + label = new QLabel(tr("Deafult Keyserver for import:")); + comboBox = new QComboBox; + comboBox->setEditable(true); + comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + mainLayout->addWidget(label); + mainLayout->addWidget(comboBox); + mainLayout->addStretch(1); + // Read keylist from ini-file and fill it into combobox + QSettings settings; + comboBox->addItems(settings.value("keyserver/keyServerList").toStringList()); + setSettings(); +} +/********************************** + * Read the settings from config + * and set the buttons and checkboxes + * appropriately + **********************************/ +void KeyserverTab::setSettings() +{ + QSettings settings; + QString keyserver = settings.value("keyserver/defaultKeyServer").toString(); + comboBox->setCurrentIndex(comboBox->findText(keyserver)); +} + +/*********************************** + * get the values of the buttons and + * write them to settings-file + *************************************/ +void KeyserverTab::applySettings() +{ + QSettings settings; + settings.setValue("keyserver/defaultKeyServer",comboBox->currentText()); +} diff --git a/settingsdialog.h b/settingsdialog.h index f7a5d8c..bf98cc1 100755 --- a/settingsdialog.h +++ b/settingsdialog.h @@ -106,6 +106,18 @@ private slots: QCheckBox *windowSizeCheckBox; }; + class KeyserverTab : public QWidget + { + Q_OBJECT + public: + KeyserverTab(QWidget *parent = 0); + void setSettings(); + void applySettings(); + + private: + QComboBox *comboBox; + QLabel *label; +}; class SettingsDialog : public QDialog { @@ -116,6 +128,7 @@ public: GeneralTab *generalTab; MimeTab *mimeTab; AppearanceTab *appearanceTab; + KeyserverTab *keyserverTab; public slots: void accept(); diff --git a/verifynotification.cpp b/verifynotification.cpp index 40d5604..3cff1e4 100644 --- a/verifynotification.cpp +++ b/verifynotification.cpp @@ -85,7 +85,6 @@ void VerifyNotification::setVerifyLabel(QString text, verify_label_status verify void VerifyNotification::showImportAction(bool visible) { importFromKeyserverAct->setVisible(visible); - return; } void VerifyNotification::showVerifyDetails() @@ -163,6 +162,6 @@ bool VerifyNotification::refresh() verifyLabelText.remove(verifyLabelText.length()-1,1); this->setVerifyLabel(verifyLabelText,verifyStatus); - qDebug() << verifyStatus; + return true; } |