How do I access the preferences from my main dialog window? Also how do I add a new preference?
- by Captain_Glen
class PreferencesCalorieBurnerDialog(PreferencesDialog):
__gtype_name__ = "PreferencesCalorieBurnerDialog"
def finish_initializing(self, builder): # pylint: disable=E1002
"""Set up the preferences dialog"""
super(PreferencesCalorieBurnerDialog, self).finish_initializing(builder)
# Bind each preference widget to gsettings
settings = Gio.Settings("net.launchpad.calorie-burner")
widget = self.builder.get_object('example_entry')
settings.bind("example", widget, "text", Gio.SettingsBindFlags.DEFAULT)
#Custom preference
widget = self.builder.get_object('weight')
settings.bind("weight", widget, "float", Gio.SettingsBindFlags.DEFAULT)
Main Dialog
self.PreferencesDialog.get_weight()???