1
# -*- coding: utf-8 -*-
3
# Copyright (C) 2009 Jono Bacon <jono@ubuntu.com>
4
# Copyright (C) 2010 Michael Budde <mbudde@gmail.com>
6
#This program is free software: you can redistribute it and/or modify it
7
#under the terms of the GNU General Public License version 3, as published
8
#by the Free Software Foundation.
10
#This program is distributed in the hope that it will be useful, but
11
#WITHOUT ANY WARRANTY; without even the implied warranties of
12
#MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
13
#PURPOSE. See the GNU General Public License for more details.
15
#You should have received a copy of the GNU General Public License along
16
#with this program. If not, see <http://www.gnu.org/licenses/>.
22
from lernid.lernidconfig import *
25
class AboutLernidDialog(gtk.AboutDialog):
26
__gtype_name__ = "AboutLernidDialog"
29
"""__init__ - This function is typically not called directly.
30
Creation of a AboutLernidDialog requires redeading the associated ui
31
file and parsing the ui definition extrenally,
32
and then calling AboutLernidDialog.finish_initializing().
34
Use the convenience function NewAboutLernidDialog to create
35
NewAboutLernidDialog objects.
38
gtk.AboutDialog.__init__(self)
40
def finish_initializing(self, builder):
41
"""finish_initalizing should be called after parsing the ui definition
42
and creating a AboutLernidDialog object with it in order to finish
43
initializing the start of the new AboutLernidDialog instance.
46
#get a reference to the builder and set up the signals
47
self.builder = builder
48
self.builder.connect_signals(self)
50
self.set_comments(DESCRIPTION)
51
self.set_version(VERSION)
52
self.set_website(WEBSITE)
53
self.set_authors(CONTRIBUTORS)
54
self.set_artists(ARTISTS)
55
self.set_license(LICENSE)
57
#code for other initialization actions should be added here
59
def NewAboutLernidDialog():
60
"""NewAboutLernidDialog - returns a fully instantiated
61
AboutLernidDialog object. Use this function rather than
62
creating a AboutLernidDialog instance directly.
66
#look for the ui file that describes the ui
67
ui_filename = get_data_path('ui', 'AboutLernidDialog.ui')
68
builder = gtk.Builder()
69
builder.add_from_file(ui_filename)
70
dialog = builder.get_object("about_lernid_dialog")
71
dialog.finish_initializing(builder)
74
if __name__ == "__main__":
75
dialog = NewAboutLernidDialog()