1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- 2### BEGIN LICENSE 3# Copyright (c) 2012, Peter Levi <peterlevi@peterlevi.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 17from gi.repository import Gtk # pylint: disable=E0611 18 19from variety_lib.helpers import get_builder 20 21 22class PrivacyNoticeDialog(Gtk.Dialog): 23 __gtype_name__ = "PrivacyNoticeDialog" 24 25 def __new__(cls): 26 """Special static method that's automatically called by Python when 27 constructing a new instance of this class. 28 29 Returns a fully instantiated PrivacyNoticeDialog object. 30 """ 31 builder = get_builder('PrivacyNoticeDialog') 32 new_object = builder.get_object('PrivacyNoticeDialog') 33 new_object.finish_initializing(builder) 34 return new_object 35 36 def finish_initializing(self, builder): 37 """Called when we're finished initializing. 38 39 finish_initalizing should be called after parsing the ui definition 40 and creating a PrivacyNoticeDialog object with it in order to 41 finish initializing the start of the new PrivacyNoticeDialog 42 instance. 43 """ 44 # Get a reference to the builder and set up the signals. 45 self.builder = builder 46 self.ui = builder.get_ui(self) 47 48if __name__ == "__main__": 49 dialog = PrivacyNoticeDialog() 50 dialog.show() 51 Gtk.main() 52