Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
96da1081
Commit
96da1081
authored
Nov 16, 2021
by
Ingo Klöcker
Browse files
Track changes in GroupsConfigPage instead of GroupsConfigDialog
GnuPG-bug-id: 5638
parent
2eda5760
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/conf/groupsconfigdialog.cpp
View file @
96da1081
...
...
@@ -29,7 +29,6 @@ class GroupsConfigDialog::Private
GroupsConfigDialog
*
const
q
;
GroupsConfigPage
*
configPage
=
nullptr
;
bool
changed
=
false
;
public:
Private
(
GroupsConfigDialog
*
qq
)
...
...
@@ -82,10 +81,9 @@ GroupsConfigDialog::GroupsConfigDialog(QWidget *parent)
this
,
&
GroupsConfigDialog
::
updateWidgets
);
connect
(
d
->
configPage
,
&
GroupsConfigPage
::
changed
,
this
,
[
this
]
(
bool
state
)
{
d
->
changed
=
state
;
updateButtons
();
if
(
QPushButton
*
button
=
buttonBox
()
->
button
(
QDialogButtonBox
::
Reset
))
{
button
->
setEnabled
(
d
->
changed
);
button
->
setEnabled
(
d
->
c
onfigPage
->
hasC
hanged
()
);
}
});
}
...
...
@@ -109,5 +107,5 @@ void GroupsConfigDialog::updateWidgets()
bool
GroupsConfigDialog
::
hasChanged
()
{
return
d
->
changed
;
return
d
->
c
onfigPage
->
hasC
hanged
()
;
}
src/conf/groupsconfigpage.cpp
View file @
96da1081
...
...
@@ -33,8 +33,11 @@ class GroupsConfigPage::Private
public:
~
Private
()
=
default
;
void
setChanged
(
bool
changed
);
private:
GroupsConfigWidget
*
widget
=
nullptr
;
bool
changed
=
false
;
};
GroupsConfigPage
::
Private
::
Private
(
GroupsConfigPage
*
qq
)
...
...
@@ -42,6 +45,12 @@ GroupsConfigPage::Private::Private(GroupsConfigPage *qq)
{
}
void
GroupsConfigPage
::
Private
::
setChanged
(
bool
state
)
{
changed
=
state
;
Q_EMIT
q
->
changed
(
changed
);
}
GroupsConfigPage
::
GroupsConfigPage
(
QWidget
*
parent
)
:
QWidget
(
parent
)
,
d
(
new
Private
(
this
))
...
...
@@ -56,15 +65,20 @@ GroupsConfigPage::GroupsConfigPage(QWidget *parent)
layout
->
addWidget
(
d
->
widget
);
connect
(
d
->
widget
,
&
GroupsConfigWidget
::
changed
,
this
,
[
this
]
()
{
Q_EMIT
c
hanged
(
true
);
});
connect
(
d
->
widget
,
&
GroupsConfigWidget
::
changed
,
this
,
[
this
]
()
{
d
->
setC
hanged
(
true
);
});
}
GroupsConfigPage
::~
GroupsConfigPage
()
=
default
;
bool
GroupsConfigPage
::
hasChanged
()
const
{
return
d
->
changed
;
}
void
GroupsConfigPage
::
load
()
{
d
->
widget
->
setGroups
(
KeyCache
::
instance
()
->
configurableGroups
());
Q_EMIT
c
hanged
(
false
);
d
->
setC
hanged
(
false
);
}
void
GroupsConfigPage
::
save
()
...
...
src/conf/groupsconfigpage.h
View file @
96da1081
...
...
@@ -21,6 +21,8 @@ public:
explicit
GroupsConfigPage
(
QWidget
*
parent
=
nullptr
);
~
GroupsConfigPage
()
override
;
bool
hasChanged
()
const
;
public
Q_SLOTS
:
void
load
();
void
save
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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