Commit e5207f2a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement dkimauthenticationverifiedserver

parent 40e27c4c
......@@ -18,14 +18,62 @@
*/
#include "dkimauthenticationverifiedserverdialog.h"
#include "dkimauthenticationverifiedserverwidget.h"
#include <QVBoxLayout>
#include <QDialogButtonBox>
#include <KLocalizedString>
#include <KConfigGroup>
#include <KSharedConfig>
namespace {
static const char myConfigGroupName[] = "DKIMAuthenticationVerifiedServerDialog";
}
DKIMAuthenticationVerifiedServerDialog::DKIMAuthenticationVerifiedServerDialog(QWidget *parent)
: QDialog(parent)
{
setWindowTitle(i18n("Configure DKIM"));
QVBoxLayout *mainLayout = new QVBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainlayout"));
mAuthenticationVerifiedWidget = new DKIMAuthenticationVerifiedServerWidget(this);
mAuthenticationVerifiedWidget->setObjectName(QStringLiteral("mConfigureWidget"));
mainLayout->addWidget(mAuthenticationVerifiedWidget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonBox"));
mainLayout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, this, &DKIMAuthenticationVerifiedServerDialog::slotAccepted);
connect(buttonBox, &QDialogButtonBox::rejected, this, &DKIMAuthenticationVerifiedServerDialog::reject);
mAuthenticationVerifiedWidget->loadSettings();
readConfig();
}
DKIMAuthenticationVerifiedServerDialog::~DKIMAuthenticationVerifiedServerDialog()
{
writeConfig();
}
void DKIMAuthenticationVerifiedServerDialog::slotAccepted()
{
mAuthenticationVerifiedWidget->saveSettings();
accept();
}
void DKIMAuthenticationVerifiedServerDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), myConfigGroupName);
const QSize size = group.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
}
}
void DKIMAuthenticationVerifiedServerDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), myConfigGroupName);
group.writeEntry("Size", size());
group.sync();
}
......@@ -22,13 +22,19 @@
#include <QDialog>
#include "dkimconfigure_private_export.h"
class DKIMAuthenticationVerifiedServerWidget;
class LIBDKIMVERIFYCONFIGURE_TESTS_EXPORT DKIMAuthenticationVerifiedServerDialog : public QDialog
{
Q_OBJECT
public:
explicit DKIMAuthenticationVerifiedServerDialog(QWidget *parent = nullptr);
~DKIMAuthenticationVerifiedServerDialog();
private:
void slotAccepted();
void readConfig();
void writeConfig();
DKIMAuthenticationVerifiedServerWidget *mAuthenticationVerifiedWidget = nullptr;
};
#endif // DKIMAUTHENTICATIONVERIFIEDSERVERDIALOG_H
......@@ -31,3 +31,13 @@ DKIMAuthenticationVerifiedServerWidget::~DKIMAuthenticationVerifiedServerWidget(
{
}
void DKIMAuthenticationVerifiedServerWidget::loadSettings()
{
//TODO
}
void DKIMAuthenticationVerifiedServerWidget::saveSettings()
{
//TODO
}
......@@ -29,6 +29,8 @@ class LIBDKIMVERIFYCONFIGURE_TESTS_EXPORT DKIMAuthenticationVerifiedServerWidget
public:
explicit DKIMAuthenticationVerifiedServerWidget(QWidget *parent = nullptr);
~DKIMAuthenticationVerifiedServerWidget();
void loadSettings();
void saveSettings();
};
#endif // DKIMAUTHENTICATIONVERIFIEDSERVERWIDGET_H
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