summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsegfault <segfault@riseup.net>2020-06-18 10:55:03 +0200
committersegfault <segfault@riseup.net>2020-06-18 10:59:23 +0200
commit6bd43b5f9b156c891353bed690af112111fa7e93 (patch)
treeab2fb6db27a3d2c394d45aa22681555c0d1bf8de
parent9060cb0314f0f625e521996af96bbf0c419a5381 (diff)
Fix popover broken if setting set before loading from persistence (refs: #17136)feature/17136-persist-greeter-settings
-rw-r--r--config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py b/config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py
index 720779d..3d3d69f 100644
--- a/config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py
+++ b/config/chroot_local-includes/usr/lib/python3/dist-packages/tailsgreeter/ui/main_window.py
@@ -217,9 +217,17 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
# We only add the setting to the list of additional settings
# if it was actually changed. Else it is either already added or
# it has the default value.
- if changed:
+ if not changed:
+ continue
+ settings_loaded = True
+ # Add the setting to the listbox of added settings, if it was
+ # not added before (by the user, before unlocking perrsistence).
+ if self.setting_added(setting.id):
+ # The setting was already added, we only have to call apply()
+ # to update the label
+ setting.apply()
+ else:
self.add_setting(setting.id)
- settings_loaded = True
except SettingNotFoundError as e:
logging.debug(e)
# The settings file does not exist, so we create it by
@@ -266,6 +274,10 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
else:
self.run_add_setting_dialog(id_)
+ def setting_added(self, id_):
+ setting = self.settings.additional_settings[id_]
+ return setting.listboxrow in self.listbox_settings.get_children()
+
def show(self):
super().show()
self.button_start.grab_focus()