No Description

PreferencesDialog.py 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
  2. ### BEGIN LICENSE
  3. # This file is in the public domain
  4. ### END LICENSE
  5. ### DO NOT EDIT THIS FILE ###
  6. """this dialog adjusts values in gsettings
  7. """
  8. import logging
  9. from gi.repository import Gtk # pylint: disable=E0611
  10. from . helpers import get_builder, show_uri, get_help_uri
  11. logger = logging.getLogger('organiccode_lib')
  12. class PreferencesDialog(Gtk.Dialog):
  13. __gtype_name__ = "PreferencesDialog"
  14. def __new__(cls):
  15. """Special static method that's automatically called by Python when
  16. constructing a new instance of this class.
  17. Returns a fully instantiated PreferencesDialog object.
  18. """
  19. builder = get_builder('PreferencesOrganiccodeDialog')
  20. new_object = builder.get_object("preferences_organiccode_dialog")
  21. new_object.finish_initializing(builder)
  22. return new_object
  23. def finish_initializing(self, builder):
  24. """Called while initializing this instance in __new__
  25. finish_initalizing should be called after parsing the ui definition
  26. and creating a PreferencesDialog object with it in order to
  27. finish initializing the start of the new PerferencesOrganiccodeDialog
  28. instance.
  29. Put your initialization code in here and leave __init__ undefined.
  30. """
  31. # Get a reference to the builder and set up the signals.
  32. self.builder = builder
  33. self.ui = builder.get_ui(self, True)
  34. # code for other initialization actions should be added here
  35. def on_btn_close_clicked(self, widget, data=None):
  36. self.destroy()
  37. def on_btn_help_clicked(self, widget, data=None):
  38. show_uri(self, "ghelp:%s" % get_help_uri('preferences'))