mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
shell/configuration: track unsaved changes signal
plasma-desktop added support for a unsavedChanges property in applet configuration pages to inform the dialog that the present state is modifed from the saved state in cases where the automatic tracking of cfg_ properties does not work. This is intended to replace most uses of the configurationChanged signal, which does not allow communicating that the previous state has been restored and saving is no longer necessary. plasma-mobile automatically saves changes, so does not need to do special handling here, but it does need to track changes in this property to work correctly with applets that have switched to this method. This change adds a handler for changes to this property similar to the existing handler for the configurationChanged signal.
This commit is contained in:
parent
9e35eb6e86
commit
970dc01ca1
1 changed files with 9 additions and 0 deletions
|
|
@ -75,6 +75,15 @@ Kirigami.ScrollablePage {
|
|||
if (configurationChangedSignal) {
|
||||
configurationChangedSignal.connect(root.settingValueChanged)
|
||||
}
|
||||
|
||||
var unsavedChangesChangedSignal = item.unsavedChangesChanged
|
||||
if (unsavedChangesChangedSignal) {
|
||||
unsavedChangesChangedSignal.connect( () => {
|
||||
if (item.unsavedChanges) {
|
||||
root.settingValueChanged()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue