Keine Beschreibung

PreferencesDialog.py 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
  2. ### BEGIN LICENSE
  3. # Copyright (C) 2013 Bryan M. Allred <bryan.allred@gmail.com>
  4. # This program is free software: you can redistribute it and/or modify it
  5. # under the terms of the GNU General Public License version 3, as published
  6. # by the Free Software Foundation.
  7. #
  8. # This program is distributed in the hope that it will be useful, but
  9. # WITHOUT ANY WARRANTY; without even the implied warranties of
  10. # MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
  11. # PURPOSE. See the GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License along
  14. # with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ### END LICENSE
  16. ### DO NOT EDIT THIS FILE ###
  17. """this dialog adjusts values in gsettings
  18. """
  19. import logging
  20. from gi.repository import Gtk # pylint: disable=E0611
  21. from . helpers import get_builder, show_uri, get_help_uri
  22. logger = logging.getLogger('organiccode_lib')
  23. class PreferencesDialog(Gtk.Dialog):
  24. __gtype_name__ = "PreferencesDialog"
  25. def __new__(cls):
  26. """Special static method that's automatically called by Python when
  27. constructing a new instance of this class.
  28. Returns a fully instantiated PreferencesDialog object.
  29. """
  30. builder = get_builder('PreferencesOrganiccodeDialog')
  31. new_object = builder.get_object("preferences_organiccode_dialog")
  32. new_object.finish_initializing(builder)
  33. return new_object
  34. def finish_initializing(self, builder):
  35. """Called while initializing this instance in __new__
  36. finish_initalizing should be called after parsing the ui definition
  37. and creating a PreferencesDialog object with it in order to
  38. finish initializing the start of the new PerferencesOrganiccodeDialog
  39. instance.
  40. Put your initialization code in here and leave __init__ undefined.
  41. """
  42. # Get a reference to the builder and set up the signals.
  43. self.builder = builder
  44. self.ui = builder.get_ui(self, True)
  45. # code for other initialization actions should be added here
  46. def on_btn_close_clicked(self, widget, data=None):
  47. self.destroy()
  48. def on_btn_help_clicked(self, widget, data=None):
  49. show_uri(self, "ghelp:%s" % get_help_uri('preferences'))