[Pkg-bazaar-commits] ./bzr-gtk/unstable r221: Add simple about dialog.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:49:39 UTC 2009


------------------------------------------------------------
revno: 221
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sun 2007-07-15 18:02:33 +0300
message:
  Add simple about dialog.
added:
  about.py
modified:
  NEWS
  notify.py
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2007-07-15 13:09:17 +0000
+++ b/NEWS	2007-07-15 15:02:33 +0000
@@ -8,6 +8,8 @@
 
   * New tango icons. (Pascal Klein)
 
+  * Add simple About dialog. (Jelmer)
+
  BUG FIXES
 
   * Fix option help strings to comply with the style guide. (Vincent)

=== added file 'about.py'
--- a/about.py	1970-01-01 00:00:00 +0000
+++ b/about.py	2007-07-15 15:02:33 +0000
@@ -0,0 +1,35 @@
+# Copyright (C) 2007 by 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
+
+try:
+    import pygtk
+    pygtk.require("2.0")
+except:
+    pass
+
+import gtk
+import bzrlib
+
+class AboutDialog(gtk.AboutDialog):
+    def __init__(self):
+        super(AboutDialog, self).__init__()
+        self.set_name("Bazaar")
+        self.set_version(bzrlib.version_string)
+        self.set_website("http://bazaar-vcs.org/")
+        self.set_license("GNU GPLv2")
+        self.set_icon(gtk.gdk.pixbuf_new_from_file("bzr-icon-64.png"))
+        self.connect ("response", lambda d, r: d.destroy())
+

=== modified file 'notify.py'
--- a/notify.py	2007-07-13 21:48:23 +0000
+++ b/notify.py	2007-07-15 15:02:33 +0000
@@ -48,6 +48,9 @@
         item = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES, None)
         item.connect('activate', self.show_preferences)
         self.append(item)
+        item = gtk.ImageMenuItem(gtk.STOCK_ABOUT, None)
+        item.connect('activate', self.show_about)
+        self.append(item)
         self.append(gtk.SeparatorMenuItem())
         item = gtk.MenuItem('_Close')
         item.connect('activate', gtk.main_quit)
@@ -70,6 +73,11 @@
         else:
             self.zeroconfserver.close()
 
+    def show_about(self, item):
+        from about import AboutDialog
+        dialog = AboutDialog()
+        dialog.run()
+
     def show_preferences(self, item):
         from preferences import PreferencesWindow
         prefs = PreferencesWindow()



More information about the Pkg-bazaar-commits mailing list