Commit 7f71e0d8 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to store window size

parent b8ac0855
Pipeline #58727 passed with stage
in 6 minutes and 39 seconds
......@@ -11,6 +11,8 @@
#include "texteditor/plaintexteditor/plaintexteditorwidget.h"
#include <KConfigGroup>
#include <KSharedConfig>
#include <QDialogButtonBox>
#include <QLabel>
#include <QPushButton>
......@@ -51,7 +53,6 @@ public:
_k_slotTextChanged();
});
okButton->setEnabled(false);
q->resize(640, 480);
}
void _k_slotTextChanged();
......@@ -69,10 +70,12 @@ InsertHtmlDialog::InsertHtmlDialog(QWidget *parent)
: QDialog(parent)
, d(new InsertHtmlDialogPrivate(this))
{
readConfig();
}
InsertHtmlDialog::~InsertHtmlDialog()
{
writeConfig();
delete d;
}
......@@ -85,6 +88,21 @@ QString InsertHtmlDialog::html() const
{
return d->editor->toPlainText();
}
void InsertHtmlDialog::readConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "InsertHtmlDialog");
const QSize sizeDialog = group.readEntry("Size", QSize(640, 480));
if (sizeDialog.isValid()) {
resize(sizeDialog);
}
}
void InsertHtmlDialog::writeConfig()
{
KConfigGroup group(KSharedConfig::openStateConfig(), "InsertHtmlDialog");
group.writeEntry("Size", size());
}
}
#include "moc_inserthtmldialog.cpp"
......@@ -27,6 +27,8 @@ public:
private:
friend class InsertHtmlDialogPrivate;
InsertHtmlDialogPrivate *const d;
void readConfig();
void writeConfig();
};
}
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