[Pkg-bazaar-commits] ./bzr-gtk/unstable r517: Merge mention of credits in the about dialog.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:50:37 UTC 2009


------------------------------------------------------------
revno: 517
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Mon 2008-06-30 00:32:59 +0200
message:
  Merge mention of credits in the about dialog.
added:
  create-credits.py
modified:
  .bzrignore
  NEWS
  about.py
    ------------------------------------------------------------
    revno: 511.3.1
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: trunk
    timestamp: Sat 2008-06-28 19:13:46 +0200
    message:
      Show full license details in about dialog.
    modified:
      about.py
    ------------------------------------------------------------
    revno: 511.3.2
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: credits
    timestamp: Sat 2008-06-28 22:24:16 +0200
    message:
      Show the credits of those who contributed in the About dialog.
      
      The credits are loaded from a pickle file that is generated by 
      a new script, which uses the stats plugin to do the heavy lifting.
    added:
      create-credits.py
    modified:
      .bzrignore
      about.py
-------------- next part --------------
=== modified file '.bzrignore'
--- a/.bzrignore	2007-09-02 15:42:18 +0000
+++ b/.bzrignore	2008-06-28 20:24:16 +0000
@@ -10,3 +10,4 @@
 bzr-gtk.trunk-matkor.e3p
 bzr-gtk.trunk-matkor.e3s
 bzr-gtk.trunk-matkor.e3t
+credits.pickle

=== modified file 'NEWS'
--- a/NEWS	2008-06-29 22:29:39 +0000
+++ b/NEWS	2008-06-29 22:32:59 +0000
@@ -23,6 +23,8 @@
   * Verify testaments when showing signatures on revisions and
     re-enable signature display. (Jelmer Vernooij)
 
+  * Show credits for bzr-gtk in the about dialog. (Jelmer Vernooij)
+
  INTERNALS
 
   * All i18n calls should now go through _i18n which must be imported from

=== modified file 'about.py'
--- a/about.py	2008-04-01 09:59:41 +0000
+++ b/about.py	2008-06-28 20:24:16 +0000
@@ -23,15 +23,45 @@
 import bzrlib
 import gtk
 import os
+from bzrlib.branch import Branch
+from bzrlib.errors import NotBranchError, NoRepositoryPresent
+from bzrlib.trace import mutter
+
 from bzrlib.plugins.gtk import icon_path
 
+
+def read_license():
+    license_file = os.path.join(os.path.dirname(__file__), "COPYING")
+    if os.path.exists(license_file):
+        return file(license_file).read()
+    # Fall back to just license name if we can't find the file
+    return "GPLv2 or later"
+
+
+def load_credits():
+    import pickle
+    try:
+        credits = pickle.load(file("credits.pickle"))
+    except IOError:
+        credits = None
+    return credits
+
+
 class AboutDialog(gtk.AboutDialog):
     def __init__(self):
         super(AboutDialog, self).__init__()
         self.set_name("Bazaar GTK")
         self.set_version(bzrlib.plugins.gtk.version_string)
         self.set_website("http://bazaar-vcs.org/BzrGtk")
-        self.set_license("GNU GPL v2 or later")
-        self.set_icon(gtk.gdk.pixbuf_new_from_file(icon_path("bzr-icon-64.png")))
+        self.set_license(read_license())
+        self.set_logo(gtk.gdk.pixbuf_new_from_file(icon_path("bzr-icon-64.png")))
+        credits = load_credits()
+        if credits is not None:
+            (authors, documenters, artists, translators) = credits
+            self.set_authors(authors)
+            self.set_documenters(documenters)
+            self.set_artists(artists)
+            self.set_translator_credits("\n".join(translators))
         self.connect ("response", lambda d, r: d.destroy())
 
+

=== added file 'create-credits.py'
--- a/create-credits.py	1970-01-01 00:00:00 +0000
+++ b/create-credits.py	2008-06-28 20:24:16 +0000
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+# Copyright (C) 2008 Jelmer Vernooij <jelmer at samba.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+from bzrlib.branch import Branch
+from bzrlib.plugins.stats import find_credits
+
+import pickle
+
+branch = Branch.open(".")
+credits = find_credits(branch.repository, branch.last_revision())
+
+pickle.dump(credits, file("credits.pickle", 'w'))



More information about the Pkg-bazaar-commits mailing list