[Inteproxy-commits] r68 - in trunk: . inteproxy

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Apr 30 14:40:39 CEST 2007


Author: bh
Date: 2007-04-30 14:40:39 +0200 (Mon, 30 Apr 2007)
New Revision: 68

Modified:
   trunk/ChangeLog
   trunk/inteproxy/gtkapp.py
Log:
* inteproxy/gtkapp.py (load_image): New.  Loads an image as a pixbuf
(InteProxyMainWindow.__init__): Use load_image to load the logo


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-04-30 11:14:25 UTC (rev 67)
+++ trunk/ChangeLog	2007-04-30 12:40:39 UTC (rev 68)
@@ -1,5 +1,10 @@
 2007-04-30  Bernhard Herzog  <bh at intevation.de>
 
+	* inteproxy/gtkapp.py (load_image): New.  Loads an image as a pixbuf
+	(InteProxyMainWindow.__init__): Use load_image to load the logo
+
+2007-04-30  Bernhard Herzog  <bh at intevation.de>
+
 	* inteproxy/InteProxy-logo.png: New.  InteProxy logo.
 
 	* inteproxy/proxycore.py (MasterWorkerServer.get_inteproxy_url):

Modified: trunk/inteproxy/gtkapp.py
===================================================================
--- trunk/inteproxy/gtkapp.py	2007-04-30 11:14:25 UTC (rev 67)
+++ trunk/inteproxy/gtkapp.py	2007-04-30 12:40:39 UTC (rev 68)
@@ -51,7 +51,14 @@
     """
     return os.path.join(os.path.dirname(__file__), basename)
 
+def load_image(basename):
+    """Loads the image from a file given by basename and returns it as a pixbuf.
+    The filename of the image is determined with the image_filename
+    function.
+    """
+    return gtk.gdk.pixbuf_new_from_file(image_filename(basename))
 
+
 class StatusIcon(object):
 
     """Icon for the system tray.
@@ -137,9 +144,7 @@
 
         bi = buf.get_iter_at_offset(0)
 
-        filename = image_filename("InteProxy-logo.png")
-        pixbuf = gtk.gdk.pixbuf_new_from_file(filename)
-        buf.insert_pixbuf(bi, pixbuf)
+        buf.insert_pixbuf(bi, load_image("InteProxy-logo.png"))
         buf.insert(bi, "\n")
         buf.apply_tag_by_name("centered", buf.get_iter_at_offset(0), bi)
 



More information about the Inteproxy-commits mailing list