summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Resch <andrewresch@gmail.com>2009-01-27 21:45:44 +0000
committerAndrew Resch <andrewresch@gmail.com>2009-01-27 21:45:44 +0000
commit933228a82aae8da0b82b61606a9c2b00f6bac3d4 (patch)
tree2c200366ac9ca1c7bce0441b567cfa84fc8fb5da
parenta777233a7a137cf911d1cbb685c6546356620451 (diff)
downloaddeluge-933228a82aae8da0b82b61606a9c2b00f6bac3d4.tar.gz
deluge-933228a82aae8da0b82b61606a9c2b00f6bac3d4.tar.bz2
deluge-933228a82aae8da0b82b61606a9c2b00f6bac3d4.zip
Fix saving files/peers tab state when no column is sorted
-rw-r--r--ChangeLog1
-rw-r--r--deluge/ui/gtkui/files_tab.py6
-rw-r--r--deluge/ui/gtkui/peers_tab.py6
3 files changed, 7 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index ad69125f3..86a6c912e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ Deluge 1.1.2 - (In Development)
GtkUI:
* 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)
Core:
diff --git a/deluge/ui/gtkui/files_tab.py b/deluge/ui/gtkui/files_tab.py
index e0ba54cee..2778bdecc 100644
--- a/deluge/ui/gtkui/files_tab.py
+++ b/deluge/ui/gtkui/files_tab.py
@@ -212,7 +212,7 @@ class FilesTab(Tab):
state = {
"columns": {},
"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()):
@@ -249,7 +249,7 @@ class FilesTab(Tab):
if state == None:
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"])
for (index, column) in enumerate(self.listview.get_columns()):
@@ -258,7 +258,7 @@ class FilesTab(Tab):
cstate = state["columns"][cname]
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
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_order(state["sort_order"])
if cstate["position"] != index:
diff --git a/deluge/ui/gtkui/peers_tab.py b/deluge/ui/gtkui/peers_tab.py
index d37c0b68c..f0e1ef02d 100644
--- a/deluge/ui/gtkui/peers_tab.py
+++ b/deluge/ui/gtkui/peers_tab.py
@@ -166,7 +166,7 @@ class PeersTab(Tab):
state = {
"columns": {},
"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()):
@@ -207,7 +207,7 @@ class PeersTab(Tab):
log.warning("peers_tab.state is not compatible! rejecting..")
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"])
for (index, column) in enumerate(self.listview.get_columns()):
@@ -216,7 +216,7 @@ class PeersTab(Tab):
cstate = state["columns"][cname]
column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
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_order(state["sort_order"])
if cstate["position"] != index: