94 lines
5.1 KiB
Diff
94 lines
5.1 KiB
Diff
|
diff -up system-config-printer-1.1.12/jobviewer.py.icon-load-traceback system-config-printer-1.1.12/jobviewer.py
|
||
|
--- system-config-printer-1.1.12/jobviewer.py.icon-load-traceback 2009-08-25 17:01:27.000000000 +0100
|
||
|
+++ system-config-printer-1.1.12/jobviewer.py 2009-08-26 17:46:06.744314174 +0100
|
||
|
@@ -1033,18 +1033,20 @@ class JobViewer (GtkGUI, monitor.Watcher
|
||
|
# Add an emblem to the icon.
|
||
|
icon = StateReason.LEVEL_ICON[level]
|
||
|
pixbuf = pixbuf.copy ()
|
||
|
- theme = gtk.icon_theme_get_default ()
|
||
|
-
|
||
|
- emblem = theme.load_icon (icon, 22, 0)
|
||
|
- emblem.composite (pixbuf,
|
||
|
- pixbuf.get_width () / 2,
|
||
|
- pixbuf.get_height () / 2,
|
||
|
- emblem.get_width () / 2,
|
||
|
- emblem.get_height () / 2,
|
||
|
- pixbuf.get_width () / 2,
|
||
|
- pixbuf.get_height () / 2,
|
||
|
- 0.5, 0.5,
|
||
|
- gtk.gdk.INTERP_BILINEAR, 255)
|
||
|
+ try:
|
||
|
+ theme = gtk.icon_theme_get_default ()
|
||
|
+ emblem = theme.load_icon (icon, 22, 0)
|
||
|
+ emblem.composite (pixbuf,
|
||
|
+ pixbuf.get_width () / 2,
|
||
|
+ pixbuf.get_height () / 2,
|
||
|
+ emblem.get_width () / 2,
|
||
|
+ emblem.get_height () / 2,
|
||
|
+ pixbuf.get_width () / 2,
|
||
|
+ pixbuf.get_height () / 2,
|
||
|
+ 0.5, 0.5,
|
||
|
+ gtk.gdk.INTERP_BILINEAR, 255)
|
||
|
+ except gobject.GError:
|
||
|
+ debugprint ("No %s icon available" % icon)
|
||
|
|
||
|
return pixbuf
|
||
|
|
||
|
diff -up system-config-printer-1.1.12/system-config-printer.py.icon-load-traceback system-config-printer-1.1.12/system-config-printer.py
|
||
|
--- system-config-printer-1.1.12/system-config-printer.py.icon-load-traceback 2009-08-26 17:45:45.471190754 +0100
|
||
|
+++ system-config-printer-1.1.12/system-config-printer.py 2009-08-26 17:46:06.753314108 +0100
|
||
|
@@ -1469,28 +1469,34 @@ class GUI(GtkGUI, monitor.Watcher):
|
||
|
|
||
|
if def_emblem:
|
||
|
(w, h) = gtk.icon_size_lookup (gtk.ICON_SIZE_DIALOG)
|
||
|
- default_emblem = theme.load_icon (def_emblem, w/2, 0)
|
||
|
- copy = pixbuf.copy ()
|
||
|
- default_emblem.composite (copy, 0, 0,
|
||
|
- copy.get_width (),
|
||
|
- copy.get_height (),
|
||
|
- 0, 0,
|
||
|
- 1.0, 1.0,
|
||
|
- gtk.gdk.INTERP_NEAREST, 255)
|
||
|
- pixbuf = copy
|
||
|
+ try:
|
||
|
+ default_emblem = theme.load_icon (def_emblem, w/2, 0)
|
||
|
+ copy = pixbuf.copy ()
|
||
|
+ default_emblem.composite (copy, 0, 0,
|
||
|
+ copy.get_width (),
|
||
|
+ copy.get_height (),
|
||
|
+ 0, 0,
|
||
|
+ 1.0, 1.0,
|
||
|
+ gtk.gdk.INTERP_NEAREST, 255)
|
||
|
+ pixbuf = copy
|
||
|
+ except gobject.GError:
|
||
|
+ debugprint ("No %s icon available" % def_emblem)
|
||
|
|
||
|
if emblem:
|
||
|
(w, h) = gtk.icon_size_lookup (gtk.ICON_SIZE_DIALOG)
|
||
|
- other_emblem = theme.load_icon (emblem, w/2, 0)
|
||
|
- copy = pixbuf.copy ()
|
||
|
- other_emblem.composite (copy, 0, 0,
|
||
|
- copy.get_width (),
|
||
|
- copy.get_height (),
|
||
|
- copy.get_width () / 2,
|
||
|
- copy.get_height () / 2,
|
||
|
- 1.0, 1.0,
|
||
|
- gtk.gdk.INTERP_NEAREST, 255)
|
||
|
- pixbuf = copy
|
||
|
+ try:
|
||
|
+ other_emblem = theme.load_icon (emblem, w/2, 0)
|
||
|
+ copy = pixbuf.copy ()
|
||
|
+ other_emblem.composite (copy, 0, 0,
|
||
|
+ copy.get_width (),
|
||
|
+ copy.get_height (),
|
||
|
+ copy.get_width () / 2,
|
||
|
+ copy.get_height () / 2,
|
||
|
+ 1.0, 1.0,
|
||
|
+ gtk.gdk.INTERP_NEAREST, 255)
|
||
|
+ pixbuf = copy
|
||
|
+ except gobject.GError:
|
||
|
+ debugprint ("No %s icon available" % emblem)
|
||
|
|
||
|
self.mainlist.append (row=[object, pixbuf, name, tip])
|
||
|
|