Fixed bug with handling adding/removing columns in GTKUI.

Also reinserted two lines that were lost when porting patch to master
This commit is contained in:
bendikro 2013-01-17 15:39:42 +01:00
parent 7492d48029
commit 5e19fd0122
2 changed files with 8 additions and 4 deletions

View File

@ -74,11 +74,8 @@ class GtkUI(GtkPluginBase):
self.sidebar_menu.unload()
del self.sidebar_menu
component.get("TorrentView").remove_column(_("Label"))
log.debug(1.1)
component.get("TorrentView").create_model_filter() #todo:improve.
except Exception, e:
log.debug(e)

View File

@ -238,6 +238,8 @@ class ListView:
model_filter.set_visible_column(
self.columns["filter"].column_indices[0])
self.model_filter = gtk.TreeModelSort(model_filter)
self.model_filter.connect("sort-column-changed", self.on_model_sort_changed)
self.model_filter.connect("row-inserted", self.on_model_row_inserted)
self.treeview.set_model(self.model_filter)
self.set_sort_functions()
self.set_model_sort()
@ -488,10 +490,11 @@ class ListView:
# Create a new liststore
self.create_new_liststore()
# Create new model for the treeview
self.create_model_filter()
# Re-create the menu
self.create_checklist_menu()
return
def add_column(self, header, render, col_types, hidden, position,
@ -530,6 +533,10 @@ class ListView:
# Create a new list with the added column
self.create_new_liststore()
# Happens only on columns added after the torrent list has been loaded
if self.model_filter:
self.create_model_filter()
column = self.TreeviewColumn(header)
if column_type == "text":