Пример #1
0
    def __init__(self):
        super(AboutDialog, self).__init__()

        lib_versions = ', '.join([
                "Mercurial-%s" % mercurial.version.get_version(),
                "Python-%s" % make_version(sys.version_info[0:3]),
                "PyGTK-%s" % make_version(gtk.pygtk_version),
                "GTK-%s" % make_version(gtk.gtk_version),
            ])
        
        comment = "Several icons are courtesy of the TortoiseSVN project"

        self.set_website("http://tortoisehg.sourceforge.net/")
        self.set_name("TortoiseHg")
        self.set_version("(version %s)" % tortoise.version.get_version())
        if hasattr(self, 'set_wrap_license'):
            self.set_wrap_license(True)
        self.set_copyright("Copyright 2008 TK Soh and others")

        thg_logo = os.path.normpath(shlib.get_tortoise_icon('thg_logo_92x50.png'))
        thg_icon = os.path.normpath(shlib.get_tortoise_icon('thg_logo.ico'))
        prog_root = os.path.dirname(os.path.dirname(os.path.dirname(thg_icon)))
        license_file = os.path.join(prog_root, "COPYING.txt")

        self.set_license(file(license_file).read())
        self.set_comments("with " + lib_versions + "\n\n" + comment)
        self.set_logo(gtk.gdk.pixbuf_new_from_file(thg_logo))
        self.set_icon_from_file(thg_icon)
        
        # somehow clicking on the Close button doesn't automatically
        # close the About dialog...
        self.connect('response', gtk.main_quit)
Пример #2
0
import pygtk
pygtk.require('2.0')
import gtk

# Default icon for apps which do not set one
from shlib import get_tortoise_icon
icon = get_tortoise_icon("hg.ico")
if icon:
    gtk.window_set_default_icon_from_file(icon)