23
from gi.repository import Gtk
26
from bzrlib.plugins.gtk import icon_path
28
from bzrlib.plugins.gtk import (
29
34
def read_license():
30
license_file = os.path.join(os.path.dirname(__file__), "COPYING")
31
if os.path.exists(license_file):
32
return file(license_file).read()
35
license_paths = [data_path("COPYING"), "/usr/share/common-licenses/GPL-2"]
36
for license_file in license_paths:
37
if license_file is not None and os.path.exists(license_file):
38
return file(license_file).read()
33
39
# Fall back to just license name if we can't find the file
34
40
return "GPLv2 or later"
37
class AboutDialog(gtk.AboutDialog):
46
credits = pickle.load(file(data_path("credits.pickle")))
52
class AboutDialog(Gtk.AboutDialog):
38
53
def __init__(self):
39
54
super(AboutDialog, self).__init__()
40
55
self.set_name("Bazaar GTK")
41
56
self.set_version(bzrlib.plugins.gtk.version_string)
42
57
self.set_website("http://bazaar-vcs.org/BzrGtk")
43
58
self.set_license(read_license())
44
self.set_logo(gtk.gdk.pixbuf_new_from_file(icon_path("bzr-icon-64.png")))
59
self.set_logo(GdkPixbuf.Pixbuf.new_from_file(icon_path("bzr-icon-64.png")))
60
credits = load_credits()
61
if credits is not None:
62
(authors, documenters, artists, translators) = credits
63
self.set_authors(authors)
64
self.set_documenters(documenters)
65
self.set_artists(artists)
66
self.set_translator_credits("\n".join(translators))
45
67
self.connect ("response", lambda d, r: d.destroy())