Browse Source

The only thing in the store is the NetworkData object

master
Julio Biason 16 years ago
parent
commit
da645f40a3
  1. 32
      mitterlib/ui/ui_pygtk.py

32
mitterlib/ui/ui_pygtk.py

@ -1029,18 +1029,11 @@ class Interface(object):
def _create_grid(self):
"""Add the displaying grid."""
self.grid_store = gtk.ListStore(
str,
str,
str,
str,
str,
object,
object)
self.grid_store.set_sort_func(Columns.DATETIME, self._sort_by_time)
self.grid_store.set_sort_column_id(Columns.DATETIME,
gtk.SORT_DESCENDING)
self.grid_store = gtk.ListStore(object)
# Trying to store the NetworkData object only
self.grid_store.set_sort_func(0, self._sort_by_time)
self.grid_store.set_sort_column_id(0, gtk.SORT_DESCENDING)
self.grid = gtk.TreeView(self.grid_store)
self.grid.set_property('headers-visible', False)
@ -1220,7 +1213,8 @@ class Interface(object):
"""Callback for the user column. Used to created the pixbuf of the
userpic."""
pic = store.get_value(position, Columns.PIC)
data = store.get_value(position, 0)
pic = data.avatar
if not pic in self._user_pics:
cell.set_property('pixbuf', self._default_pixmap)
@ -1236,12 +1230,12 @@ class Interface(object):
property of the cell, as setting it as text won't do any markup
processing."""
user = store.get_value(position, Columns.NAME)
message = store.get_value(position, Columns.MESSAGE)
time = store.get_value(position, Columns.DATETIME)
username = store.get_value(position, Columns.USERNAME)
data = store.get_value(position, 0)
message = data.message
username = data.username
time = timesince.timesince(time)
time = timesince.timesince(data.message_time)
# unescape escaped entities that pango is okay with
message = re.sub(r'&(?!(amp;|gt;|lt;|quot;|apos;))', r'&', message)
@ -1256,7 +1250,7 @@ class Interface(object):
message)
markup = '<b>%s</b> <small>(%s)</small>:\n%s\n<small>%s</small>' % \
(user, username, message, time)
(data.name, username, message, time)
cell.set_property('markup', markup)
return

Loading…
Cancel
Save