Commit ded8c6af authored by Laurent Montel's avatar Laurent Montel 😁

Allow to save/load size

parent bac7baa4
......@@ -365,7 +365,7 @@ void SecurityPage::WarningTab::slotReenableAllWarningsClicked()
void SecurityPage::WarningTab::slotConfigureGnupg()
{
QPointer<KCMultiDialog> dlg(new KCMultiDialog(this));
QPointer<GpgSettingsDialog> dlg(new GpgSettingsDialog(this));
KPageWidgetItem *page = dlg->addModule(QStringLiteral("kleopatra_config_gnupgsystem"));
if (!page) {
QLabel *info = new QLabel(i18n("The module is missing. Please verify your installation. This module is provided by Kleopatra."), this);
......@@ -683,3 +683,30 @@ Kleo::CryptoConfigEntry *SMIMECryptoConfigEntries::configEntry(const QString &co
}
return entry;
}
GpgSettingsDialog::GpgSettingsDialog(QWidget *parent)
: KCMultiDialog(parent)
{
readConfig();
}
GpgSettingsDialog::~GpgSettingsDialog()
{
saveConfig();
}
void GpgSettingsDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), "GpgSettingsDialog");
const QSize size = group.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
}
}
void GpgSettingsDialog::saveConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), "GpgSettingsDialog");
group.writeEntry("Size", size());
group.sync();
}
......@@ -26,6 +26,8 @@
#include "ui_warningconfiguration.h"
#include "ui_smimeconfiguration.h"
#include <KCMultiDialog>
class QButtonGroup;
namespace MessageViewer
{
......@@ -137,6 +139,18 @@ private:
Kleo::CryptoConfig *mConfig;
};
class GpgSettingsDialog : public KCMultiDialog
{
Q_OBJECT
public:
explicit GpgSettingsDialog(QWidget *parent = Q_NULLPTR);
~GpgSettingsDialog();
private:
void readConfig();
void saveConfig();
};
class KMAIL_EXPORT SecurityPage : public ConfigModuleWithTabs
{
Q_OBJECT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment