No Description

AboutDialog.py 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. from gi.repository import Gtk # pylint: disable=E0611
  18. from . helpers import get_builder
  19. class AboutDialog(Gtk.AboutDialog):
  20. __gtype_name__ = "AboutDialog"
  21. def __new__(cls):
  22. """Special static method that's automatically called by Python when
  23. constructing a new instance of this class.
  24. Returns a fully instantiated AboutDialog object.
  25. """
  26. builder = get_builder('AboutOrganiccodeDialog')
  27. new_object = builder.get_object("about_organiccode_dialog")
  28. new_object.finish_initializing(builder)
  29. return new_object
  30. def finish_initializing(self, builder):
  31. """Called while initializing this instance in __new__
  32. finish_initalizing should be called after parsing the ui definition
  33. and creating a AboutDialog object with it in order
  34. to finish initializing the start of the new AboutOrganiccodeDialog
  35. instance.
  36. Put your initialization code in here and leave __init__ undefined.
  37. """
  38. # Get a reference to the builder and set up the signals.
  39. self.builder = builder
  40. self.ui = builder.get_ui(self)