From d2dc62f0b341df19ab25f0a0c5189768a74cee1a Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sun, 27 May 2012 12:13:46 +0200 Subject: [PATCH] Remove option to hide name column as something to identify the torrent is needed anyway --- deluge/ui/console/modes/alltorrents.py | 8 ++++++-- deluge/ui/console/modes/preference_panes.py | 9 +++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 00bff1c60..452b88f60 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -135,7 +135,6 @@ class FILTER: DEFAULT_PREFS = { "show_queue":True, - "show_name":True, "show_size":True, "show_state":True, "show_progress":True, @@ -314,7 +313,11 @@ class AllTorrents(BaseMode, component.Component): def update_config(self): self.config = ConfigManager("console.conf",DEFAULT_PREFS) - self.__cols_to_show = [pref for pref in column_pref_names if self.config["show_%s"%pref]] + self.__cols_to_show = [ + pref for pref in column_pref_names + if ("show_%s" % pref) not in self.config + or self.config["show_%s"%pref] + ] self.__columns = [prefs_to_names[col] for col in self.__cols_to_show] self.__status_fields = column.get_required_fields(self.__columns) for rf in ["state","name","queue"]: # we always need these, even if we're not displaying them @@ -348,6 +351,7 @@ class AllTorrents(BaseMode, component.Component): def set_state(self, state, refresh): + #TODO - Sorting and secondary sorting self.curstate = state # cache in case we change sort order newnames = [] newrows = [] diff --git a/deluge/ui/console/modes/preference_panes.py b/deluge/ui/console/modes/preference_panes.py index 5df5602b3..f205ff344 100644 --- a/deluge/ui/console/modes/preference_panes.py +++ b/deluge/ui/console/modes/preference_panes.py @@ -317,14 +317,23 @@ class InterfacePane(BasePane): self.add_int_spin_input("torrents_per_tab_press","Torrents per tab press",parent.console_config["torrents_per_tab_press"], 5, 100) self.add_header("Columns To Display", True) + + default_prefs = deluge.ui.console.modes.alltorrents.DEFAULT_PREFS + for cpn in deluge.ui.console.modes.alltorrents.column_pref_names: pn = "show_%s"%cpn + #If there is no option for it, it's not togglable + # We check in default_prefs because it might still exist in config files + if pn not in default_prefs: + continue self.add_checked_input(pn, deluge.ui.console.modes.alltorrents.prefs_to_names[cpn], parent.console_config[pn]) self.add_header("Column Widths (-1 = expand)",True) for cpn in deluge.ui.console.modes.alltorrents.column_pref_names: pn = "%s_width"%cpn + if pn not in default_prefs: + continue self.add_int_spin_input(pn, deluge.ui.console.modes.alltorrents.prefs_to_names[cpn], parent.console_config[pn],-1,100)