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 WelcomeDialog(Gtk.Dialog):
23    __gtype_name__ = "WelcomeDialog"
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 WelcomeDialog object.
30        """
31        builder = get_builder("WelcomeDialog")
32        new_object = builder.get_object("welcome_dialog")
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 WelcomeDialog object with it in order to
41        finish initializing the start of the new WelcomeDialog
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
48
49if __name__ == "__main__":
50    dialog = WelcomeDialog()
51    dialog.show()
52    Gtk.main()
53