1
# -*- coding: utf-8 -*-
3
# This file is in the public domain
10
from godownloader.godownloaderconfig import getdatapath
12
class AboutGodownloaderDialog(gtk.AboutDialog):
13
__gtype_name__ = "AboutGodownloaderDialog"
16
"""__init__ - This function is typically not called directly.
17
Creation of a AboutGodownloaderDialog requires redeading the associated ui
18
file and parsing the ui definition extrenally,
19
and then calling AboutGodownloaderDialog.finish_initializing().
21
Use the convenience function NewAboutGodownloaderDialog to create
22
NewAboutGodownloaderDialog objects.
27
def finish_initializing(self, builder):
28
"""finish_initalizing should be called after parsing the ui definition
29
and creating a AboutGodownloaderDialog object with it in order to finish
30
initializing the start of the new AboutGodownloaderDialog 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 NewAboutGodownloaderDialog():
40
"""NewAboutGodownloaderDialog - returns a fully instantiated
41
AboutGodownloaderDialog object. Use this function rather than
42
creating a AboutGodownloaderDialog instance directly.
46
#look for the ui file that describes the ui
47
ui_filename = os.path.join(getdatapath(), 'ui', 'AboutGodownloaderDialog.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_godownloader_dialog")
54
dialog.finish_initializing(builder)
57
if __name__ == "__main__":
58
dialog = NewAboutGodownloaderDialog()