Remove option to hide name column as something to identify the torrent is needed anyway

This commit is contained in:
Asmageddon 2012-05-27 12:13:46 +02:00
parent 4983110d50
commit d2dc62f0b3
2 changed files with 15 additions and 2 deletions

View File

@ -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 = []

View File

@ -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)