self._recentmodel = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
self._recentviewselection = None
+ self._gcContactText = "GC"
+ try:
+ self._gcContactIcon = gtk.gdk.pixbuf_new_from_file_at_size('gc_contact.png', 16, 16)
+ except gobject.GError:
+ self._gcContactIcon = None
self._contactstime = 0.0
- self._contactsmodel = gtk.ListStore(
- gtk.gdk.Pixbuf,
- gobject.TYPE_STRING,
- gobject.TYPE_STRING,
- gobject.TYPE_STRING,
- gobject.TYPE_STRING
- )
+ if self._gcContactIcon is not None:
+ self._contactsmodel = gtk.ListStore(
+ gtk.gdk.Pixbuf,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING
+ )
+ else:
+ self._contactsmodel = gtk.ListStore(
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING,
+ gobject.TYPE_STRING
+ )
self._contactsviewselection = None
for path in Dialpad._glade_files:
# Add the column to the treeview
column = gtk.TreeViewColumn("Contact")
- iconrenderer = gtk.CellRendererPixbuf()
- column.pack_start(iconrenderer, expand=False)
- column.add_attribute(iconrenderer, 'pixbuf', 0)
+ if self._gcContactIcon is not None:
+ iconrenderer = gtk.CellRendererPixbuf()
+ column.pack_start(iconrenderer, expand=False)
+ column.add_attribute(iconrenderer, 'pixbuf', 0)
+ else:
+ warnings.warn("Contact icon unavailable", UserWarning, 1)
+ textrenderer = gtk.CellRendererText()
+ column.pack_start(textrenderer, expand=False)
+ column.add_attribute(textrenderer, 'text', 0)
textrenderer = gtk.CellRendererText()
column.pack_start(textrenderer, expand=True)
contactsview.set_model(None)
# get gc icon
- gc_icon = gtk.gdk.pixbuf_new_from_file_at_size('gc_contact.png', 16, 16)
+ if self._gcContactIcon is not None:
+ contactType = (self._gcContactIcon,)
+ else:
+ contactType = (self._gcContactText,)
for contactId, contactName in self._gcBackend.get_contacts():
- self._contactsmodel.append((gc_icon,) + (contactName, "", contactId) + ("",))
+ self._contactsmodel.append(contactType + (contactName, "", contactId) + ("",))
yield
# restart the treeview data rendering