~nmu-sscheel/gtg/rework-task-editor

« back to all changes in this revision

Viewing changes to GTG/gtk/browser/CellRendererTags.py

  • Committer: Bertrand Rousseau
  • Date: 2012-05-09 22:33:25 UTC
  • mfrom: (1178 trunk)
  • mto: This revision was merged to the branch mainline in revision 1179.
  • Revision ID: bertrand.rousseau@gmail.com-20120509223325-a53d8nwo0x9g93bc
Merge nimit branch and trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import pygtk
24
24
pygtk.require('2.0')
25
25
import gobject
 
26
import glib
26
27
import gtk
27
28
import cairo
 
29
from GTG.tools.logger import Log
28
30
 
29
31
#=== MAIN CLASS ===============================================================
30
32
 
131
133
            rect_y  = orig_y
132
134
 
133
135
            if my_tag_icon:
134
 
                pixbuf = gtk.icon_theme_get_default().load_icon(\
135
 
                    my_tag_icon, 16, 0)
136
 
                gdkcontext.set_source_pixbuf(pixbuf, rect_x, rect_y)
137
 
                gdkcontext.paint()
138
 
                count = count + 1
 
136
                try:
 
137
                    pixbuf = gtk.icon_theme_get_default().load_icon(
 
138
                                    my_tag_icon, 16, 0)
 
139
                    gdkcontext.set_source_pixbuf(pixbuf, rect_x, rect_y)
 
140
                    gdkcontext.paint()
 
141
                    count = count + 1
 
142
                except glib.GError:
 
143
                    # In some rare cases an icon could not be found
 
144
                    # (e.g. wrong set icon path, missing icon)
 
145
                    # Raising an exception breaks UI and signal catcher badly
 
146
                    Log.error("Can't load icon '%s'" % my_tag_icon)
139
147
 
140
148
            elif my_tag_color:
141
149