Module: deluge
Branch: master
Commit: 62da60a0e40c3eb8fae120885fab60bad31cbcb6

Author: Nick Lanham <[email protected]>
Date:   Mon Mar  7 12:37:23 2011 +0100

break out each column preference

---

 deluge/ui/console/modes/alltorrents.py |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/deluge/ui/console/modes/alltorrents.py 
b/deluge/ui/console/modes/alltorrents.py
index db4c312..aae90b0 100644
--- a/deluge/ui/console/modes/alltorrents.py
+++ b/deluge/ui/console/modes/alltorrents.py
@@ -132,7 +132,15 @@ class FILTER:
     QUEUED=7
 
 DEFAULT_PREFS = {
-    "columns":["#", "Name","Size","State","Progress","Seeders","Peers","Down 
Speed","Up Speed"],
+    "show_queue":True,
+    "show_name":True,
+    "show_size":True,
+    "show_state":True,
+    "show_progress":True,
+    "show_seeders":True,
+    "show_peers":True,
+    "show_downspeed":True,
+    "show_upspeed":True,
     "column_widths":{
         "#":5,
         "Name":-1,
@@ -145,6 +153,22 @@ DEFAULT_PREFS = {
         "Up Speed":15}
 }
 
+column_prefs = ["show_queue","show_name","show_size","show_state",
+                "show_progress","show_seeders","show_peers",
+                "show_downspeed","show_upspeed"]
+
+prefs_to_names = {
+    "show_queue":"#", 
+    "show_name":"Name",
+    "show_size":"Size",
+    "show_state":"State",
+    "show_progress":"Progress",
+    "show_seeders":"Seeders",
+    "show_peers":"Peers",
+    "show_downspeed":"Down Speed",
+    "show_upspeed":"Up Speed"
+}
+
 class StateUpdater(component.Component):
     def __init__(self, alltorrent, cb, sf,tcb):
         component.Component.__init__(self, "AllTorrentsStateUpdater", 1, 
depend=["SessionProxy"])
@@ -236,7 +260,7 @@ class AllTorrents(BaseMode):
 
     def __update_config(self):
         self.config = ConfigManager("console.conf",DEFAULT_PREFS)
-        self.__columns = self.config["columns"]
+        self.__columns = [prefs_to_names[pref] for pref in column_prefs if 
self.config[pref]]
         self.__config_widths = self.config["column_widths"]
 
     def __split_help(self):

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to