~jonobacon/ubuntu-accomplishments-daemon/ubuntu-accomplishments-daemon

« back to all changes in this revision

Viewing changes to accomplishments/gui/base/AboutDialog.py

  • Committer: Jono Bacon
  • Date: 2012-04-08 22:11:10 UTC
  • Revision ID: jono@ubuntu.com-20120408221110-3ihxpctu5kryp460
Creating ubuntu package

Show diffs side-by-side

added added

removed removed

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