123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- """this dialog adjusts values in gsettings
- """
- import logging
- from gi.repository import Gtk
- from . helpers import get_builder, show_uri, get_help_uri
- logger = logging.getLogger('organiccode_lib')
- class PreferencesDialog(Gtk.Dialog):
- __gtype_name__ = "PreferencesDialog"
- def __new__(cls):
- """Special static method that's automatically called by Python when
- constructing a new instance of this class.
- Returns a fully instantiated PreferencesDialog object.
- """
- builder = get_builder('PreferencesOrganiccodeDialog')
- new_object = builder.get_object("preferences_organiccode_dialog")
- new_object.finish_initializing(builder)
- return new_object
- def finish_initializing(self, builder):
- """Called while initializing this instance in __new__
- finish_initalizing should be called after parsing the ui definition
- and creating a PreferencesDialog object with it in order to
- finish initializing the start of the new PerferencesOrganiccodeDialog
- instance.
- Put your initialization code in here and leave __init__ undefined.
- """
-
- self.builder = builder
- self.ui = builder.get_ui(self, True)
-
- def on_btn_close_clicked(self, widget, data=None):
- self.destroy()
- def on_btn_help_clicked(self, widget, data=None):
- show_uri(self, "ghelp:%s" % get_help_uri('preferences'))
|