~thomas-deruyter-3/qreator/qreator

« back to all changes in this revision

Viewing changes to qreator_lib/AboutDialog.py

  • Committer: David Planella
  • Date: 2012-05-17 08:12:32 UTC
  • Revision ID: david.planella@ubuntu.com-20120517081232-uq92gvxfji2v68gi
First working version ready for release

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