1
# -*- coding: utf-8 -*-
3
# This file is in the public domain
10
from acire.acireconfig import getdatapath
12
class AboutAcireDialog(gtk.AboutDialog):
13
__gtype_name__ = "AboutAcireDialog"
16
"""__init__ - This function is typically not called directly.
17
Creation of a AboutAcireDialog requires redeading the associated ui
18
file and parsing the ui definition extrenally,
19
and then calling AboutAcireDialog.finish_initializing().
21
Use the convenience function NewAboutAcireDialog to create
22
NewAboutAcireDialog objects.
27
def finish_initializing(self, builder):
28
"""finish_initalizing should be called after parsing the ui definition
29
and creating a AboutAcireDialog object with it in order to finish
30
initializing the start of the new AboutAcireDialog instance.
33
#get a reference to the builder and set up the signals
34
self.builder = builder
35
self.builder.connect_signals(self)
37
#code for other initialization actions should be added here
39
def NewAboutAcireDialog():
40
"""NewAboutAcireDialog - returns a fully instantiated
41
AboutAcireDialog object. Use this function rather than
42
creating a AboutAcireDialog instance directly.
46
#look for the ui file that describes the ui
47
ui_filename = os.path.join(getdatapath(), 'ui', 'AboutAcireDialog.ui')
48
if not os.path.exists(ui_filename):
51
builder = gtk.Builder()
52
builder.add_from_file(ui_filename)
53
dialog = builder.get_object("about_acire_dialog")
54
dialog.finish_initializing(builder)
57
if __name__ == "__main__":
58
dialog = NewAboutAcireDialog()