Advertisement
segadude

Untitled

Jun 23rd, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.88 KB | None | 0 0
  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.  
  6. from gi.repository import Gtk # pylint: disable=E0611
  7.  
  8. from brandsonicweb_lib.helpers import get_builder
  9.  
  10. import locale
  11. from locale import gettext as _
  12. locale.textdomain('brandsonicweb')
  13.  
  14. class QuicksitesDialog(Gtk.Dialog):
  15.     __gtype_name__ = "QuicksitesDialog"
  16.  
  17.     def __new__(cls):
  18.         """Special static method that's automatically called by Python when
  19.        constructing a new instance of this class.
  20.        
  21.        Returns a fully instantiated QuicksitesDialog object.
  22.        """
  23.         builder = get_builder('QuicksitesDialog')
  24.         new_object = builder.get_object('quicksites_dialog')
  25.         new_object.finish_initializing(builder)
  26.         return new_object
  27.  
  28.     def finish_initializing(self, builder):
  29.         """Called when we're finished initializing.
  30.  
  31.        finish_initalizing should be called after parsing the ui definition
  32.        and creating a QuicksitesDialog object with it in order to
  33.        finish initializing the start of the new QuicksitesDialog
  34.        instance.
  35.        """
  36.         # Get a reference to the builder and set up the signals.
  37.         self.builder = builder
  38.         self.ui = builder.get_ui(self)
  39.  
  40.         self.google = self.builder.get_object("google")
  41.  
  42.     def on_btn_ok_clicked(self, widget, data=None):
  43.         """The user has elected to save the changes.
  44.  
  45.        Called before the dialog returns Gtk.ResponseType.OK from run().
  46.        """
  47.         pass
  48.  
  49.     def on_btn_cancel_clicked(self, widget, data=None):
  50.         """The user has elected cancel changes.
  51.  
  52.        Called before the dialog returns Gtk.ResponseType.CANCEL for run()
  53.        """
  54.         pass
  55.  
  56.  
  57.  
  58. if __name__ == "__main__":
  59.     dialog = QuicksitesDialog()
  60.     dialog.show()
  61.     Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement