Commit 4cddd2a2 authored by segfault's avatar segfault

Greeter: Show an infobar if persistent settings were loaded

parent e81787f2
......@@ -107,6 +107,7 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
self.entry_storage_passphrase = builder.get_object('entry_storage_passphrase')
self.frame_language = builder.get_object('frame_language')
self.infobar_network = builder.get_object('infobar_network')
self.infobar_settings_loaded = builder.get_object('infobar_settings_loaded')
self.label_settings_default = builder.get_object('label_settings_default')
self.listbox_add_setting = builder.get_object('listbox_add_setting')
self.listbox_settings = builder.get_object('listbox_settings')
......@@ -181,11 +182,16 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
# changing the language also changes the other two, which causes
# the settings files to be overwritten. So we load the region
# settings in reversed order.
settings_loaded = False
for setting in reversed(list(self.settings.region_settings)):
setting.load()
if setting.load():
settings_loaded = True
for setting in self.settings.additional_settings:
if setting.load():
self.add_setting(setting.id)
settings_loaded = True
if settings_loaded:
self.infobar_settings_loaded.set_visible(True)
def run_add_setting_dialog(self, id_=None):
response = self.dialog_add_setting.run(id_)
......
......@@ -61,6 +61,74 @@
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkInfoBar" id="infobar_settings_loaded">
<property name="app_paintable">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<signal name="close" handler="cb_infobar_close" swapped="no"/>
<signal name="response" handler="cb_infobar_response" swapped="no"/>
<child internal-child="action_area">
<object class="GtkButtonBox" id="infobar_settings_loaded-action_area">
<property name="can_focus">False</property>
<property name="spacing">6</property>
<property name="layout_style">end</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child internal-child="content_area">
<object class="GtkBox" id="infobar_settings_loaded-content_area">
<property name="can_focus">False</property>
<property name="spacing">16</property>
<child>
<object class="GtkLabel" id="label_infobar_settings_loaded">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Settings were loaded from the persistent storage.</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkInfoBar" id="infobar_network">
<property name="app_paintable">True</property>
......@@ -126,7 +194,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
......@@ -583,7 +651,7 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="position">3</property>
</packing>
</child>
</object>
......
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