Commit 3f2f1e7b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Continue to implement dialog

parent b48de570
Pipeline #62317 passed with stage
in 40 minutes and 32 seconds
...@@ -5,16 +5,41 @@ ...@@ -5,16 +5,41 @@
*/ */
#include "configurefiltersdialog.h" #include "configurefiltersdialog.h"
#include "configurefilterswidget.h" #include "configurefilterswidget.h"
#include <KConfigGroup>
#include <KSharedConfig>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QVBoxLayout> #include <QVBoxLayout>
using namespace MessageList::Core; using namespace MessageList::Core;
namespace
{
static const char myConfigureFiltersDialogConfigGroupName[] = "ConfigureFiltersDialog";
}
ConfigureFiltersDialog::ConfigureFiltersDialog(QWidget *parent) ConfigureFiltersDialog::ConfigureFiltersDialog(QWidget *parent)
: QDialog(parent) : QDialog(parent)
, mConfigureFiltersWidget(new ConfigureFiltersWidget(this)) , mConfigureFiltersWidget(new ConfigureFiltersWidget(this))
{ {
readConfig();
} }
ConfigureFiltersDialog::~ConfigureFiltersDialog() ConfigureFiltersDialog::~ConfigureFiltersDialog()
{ {
writeConfig();
}
void ConfigureFiltersDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigureFiltersDialogConfigGroupName);
const QSize size = group.readEntry("Size", QSize(600, 400));
if (size.isValid()) {
resize(size);
}
}
void ConfigureFiltersDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), myConfigureFiltersDialogConfigGroupName);
group.writeEntry("Size", size());
group.sync();
} }
...@@ -21,6 +21,8 @@ public: ...@@ -21,6 +21,8 @@ public:
~ConfigureFiltersDialog() override; ~ConfigureFiltersDialog() override;
private: private:
void readConfig();
void writeConfig();
ConfigureFiltersWidget *const mConfigureFiltersWidget; ConfigureFiltersWidget *const mConfigureFiltersWidget;
}; };
......
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