disco window should sort alphabetically its data
sample code:
TreeViewColumn tv = new TreeViewColumn ("Column 1", new CellRendererText
(), "text", (int)Column.One);
treeview1.AppendColumn (tv);
tv.SortColumnId = (int)Column.One; // This do the trick!
tv = new TreeViewColumn ("Column 2", new CellRendererText (), "text",
(int)Column.Two);
treeview1.AppendColumn (tv);
tv.SortColumnId = (int)Column.Two; // This do the trick!
pygtk has that. I don't understand why in disco you (Yann) use
#columns
renderer = gtk.CellRendererText()
renderer.set_data('column', 0)
self.services_treeview.insert_column_with_attributes(-1, 'Name', \
renderer, text=0)
renderer = gtk.CellRendererText()
renderer.set_data('column', 1)
self.services_treeview.insert_column_with_attributes(-1, 'Service', \
renderer, text=1)
and you don't go as you went with Edit_groups_dialog:
column = gtk.TreeViewColumn(_('Group'))
self.list.append_column(column)
renderer = gtk.CellRendererText()
column.pack_start(renderer)
column.set_attributes(renderer, text=0)
column = gtk.TreeViewColumn(_('In the group'))
self.list.append_column(column)
renderer = gtk.CellRendererToggle()
column.pack_start(renderer)
renderer.set_property('activatable', True)
renderer.connect('toggled', self.group_toggled_cb)
column.set_attributes(renderer, active=1)
I really think the second one is cleaner
afterall you use the 1st one only in the roster to avoid gtk padding coz you use / image. In Disco that's not the case (nor in Edit groups)
it is important to sort them cause public chatrooms can be many (jabber.org) and gtk type ahead doesn't catch them all:
eg. if you type python it will catch python-br. there's also a python 'room' but it's not under python-br (or above) coz the data there are not sorted alphabetically