mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-13 11:48:40 +00:00
Fix saving files/peers tab state when no column is sorted
This commit is contained in:
parent
a777233a7a
commit
933228a82a
3 changed files with 7 additions and 6 deletions
|
@ -4,6 +4,7 @@ Deluge 1.1.2 - (In Development)
|
||||||
|
|
||||||
GtkUI:
|
GtkUI:
|
||||||
* Fix #761 use proper theme colours in sidebar
|
* Fix #761 use proper theme colours in sidebar
|
||||||
|
* Fix saving files/peers tab state when no column is sorted
|
||||||
|
|
||||||
Deluge 1.1.1 - (24 January 2009)
|
Deluge 1.1.1 - (24 January 2009)
|
||||||
Core:
|
Core:
|
||||||
|
|
|
@ -212,7 +212,7 @@ class FilesTab(Tab):
|
||||||
state = {
|
state = {
|
||||||
"columns": {},
|
"columns": {},
|
||||||
"sort_id": column_id,
|
"sort_id": column_id,
|
||||||
"sort_order": int(sort_order)
|
"sort_order": int(sort_order) if sort_order else None
|
||||||
}
|
}
|
||||||
|
|
||||||
for index, column in enumerate(self.listview.get_columns()):
|
for index, column in enumerate(self.listview.get_columns()):
|
||||||
|
@ -249,7 +249,7 @@ class FilesTab(Tab):
|
||||||
if state == None:
|
if state == None:
|
||||||
return
|
return
|
||||||
|
|
||||||
if state["sort_id"] and state["sort_order"]:
|
if state["sort_id"] and state["sort_order"] is not None:
|
||||||
self.treestore.set_sort_column_id(state["sort_id"], state["sort_order"])
|
self.treestore.set_sort_column_id(state["sort_id"], state["sort_order"])
|
||||||
|
|
||||||
for (index, column) in enumerate(self.listview.get_columns()):
|
for (index, column) in enumerate(self.listview.get_columns()):
|
||||||
|
@ -258,7 +258,7 @@ class FilesTab(Tab):
|
||||||
cstate = state["columns"][cname]
|
cstate = state["columns"][cname]
|
||||||
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
||||||
column.set_fixed_width(cstate["width"] if cstate["width"] > 0 else 10)
|
column.set_fixed_width(cstate["width"] if cstate["width"] > 0 else 10)
|
||||||
if state["sort_id"] == index:
|
if state["sort_id"] == index and state["sort_order"] is not None:
|
||||||
column.set_sort_indicator(True)
|
column.set_sort_indicator(True)
|
||||||
column.set_sort_order(state["sort_order"])
|
column.set_sort_order(state["sort_order"])
|
||||||
if cstate["position"] != index:
|
if cstate["position"] != index:
|
||||||
|
|
|
@ -166,7 +166,7 @@ class PeersTab(Tab):
|
||||||
state = {
|
state = {
|
||||||
"columns": {},
|
"columns": {},
|
||||||
"sort_id": column_id,
|
"sort_id": column_id,
|
||||||
"sort_order": int(sort_order)
|
"sort_order": int(sort_order) if sort_order else None
|
||||||
}
|
}
|
||||||
|
|
||||||
for index, column in enumerate(self.listview.get_columns()):
|
for index, column in enumerate(self.listview.get_columns()):
|
||||||
|
@ -207,7 +207,7 @@ class PeersTab(Tab):
|
||||||
log.warning("peers_tab.state is not compatible! rejecting..")
|
log.warning("peers_tab.state is not compatible! rejecting..")
|
||||||
return
|
return
|
||||||
|
|
||||||
if state["sort_id"] and state["sort_order"]:
|
if state["sort_id"] and state["sort_order"] is not None:
|
||||||
self.liststore.set_sort_column_id(state["sort_id"], state["sort_order"])
|
self.liststore.set_sort_column_id(state["sort_id"], state["sort_order"])
|
||||||
|
|
||||||
for (index, column) in enumerate(self.listview.get_columns()):
|
for (index, column) in enumerate(self.listview.get_columns()):
|
||||||
|
@ -216,7 +216,7 @@ class PeersTab(Tab):
|
||||||
cstate = state["columns"][cname]
|
cstate = state["columns"][cname]
|
||||||
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
|
||||||
column.set_fixed_width(cstate["width"] if cstate["width"] > 0 else 10)
|
column.set_fixed_width(cstate["width"] if cstate["width"] > 0 else 10)
|
||||||
if state["sort_id"] == index:
|
if state["sort_id"] == index and state["sort_order"] is not None:
|
||||||
column.set_sort_indicator(True)
|
column.set_sort_indicator(True)
|
||||||
column.set_sort_order(state["sort_order"])
|
column.set_sort_order(state["sort_order"])
|
||||||
if cstate["position"] != index:
|
if cstate["position"] != index:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue