Browse Source

Revert "Sorting seems to work"

This reverts commit 9aa415d1d4.
master
Julio Biason 16 years ago
parent
commit
9d7180483c
  1. 41
      mitterlib/ui/ui_pygtk.py

41
mitterlib/ui/ui_pygtk.py

@ -280,10 +280,11 @@ class Interface(object):
def _create_grid(self):
"""Add the displaying grid."""
# Store NetworkData objects only
grid_store = gtk.ListStore(object)
grid_store.set_sort_column_id(0, gtk.SORT_DESCENDING)
grid_store.set_default_sort_func(self._order_datetime)
# 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(grid_store)
self._grid.set_property('headers-visible', False)
@ -588,23 +589,6 @@ class Interface(object):
return
def _order_datetime(self, model, iter1, iter2, user_data=None):
"""Used by the ListStore to sort the columns (in our case, "column")
by date."""
message1 = model.get_value(iter1, 0)
message2 = model.get_value(iter2, 0)
if (not message1) or \
(not message1.message_time) or \
(message1.message_time > message2.message_time):
return 1
if (not message2) or \
(not message2.message_time) or \
(message2.message_time > message1.message_time):
return -1
return 0
# ------------------------------------------------------------
# Network related functions
# ------------------------------------------------------------
@ -618,7 +602,6 @@ class Interface(object):
for message in results:
_log.debug('Data: %s', str(message))
store.prepend([message])
store.sort_column_changed()
return
def _exception_get_messages(self, widget, exception):
@ -688,6 +671,22 @@ class Interface(object):
self._default_pixmap = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB,
has_alpha=False, bits_per_sample=8, width=48, height=48)
#self._systray_setup()
# self.create_settings_dialog()
# self.username_field.set_text(default_username)
# self.password_field.set_text(default_password)
# self.https_field.set_active(self.https)
# notification helper
# self.notify_broadcast = Notify('mitter').notify
# start auto refresh activity
# self._refresh_id = None
# self.set_auto_refresh()
# self.window.set_focus(self.update_text)
return
def __call__(self):

Loading…
Cancel
Save