Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KPimTextEdit
Commits
7f71e0d8
Commit
7f71e0d8
authored
Apr 19, 2021
by
Laurent Montel
😁
Browse files
Allow to store window size
parent
b8ac0855
Pipeline
#58727
passed with stage
in 6 minutes and 39 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/inserthtmldialog.cpp
View file @
7f71e0d8
...
...
@@ -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"
src/inserthtmldialog.h
View file @
7f71e0d8
...
...
@@ -27,6 +27,8 @@ public:
private:
friend
class
InsertHtmlDialogPrivate
;
InsertHtmlDialogPrivate
*
const
d
;
void
readConfig
();
void
writeConfig
();
};
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment