Add config option to change amount of torrents to list per tab press

This commit is contained in:
Asmageddon 2012-03-13 20:58:46 +01:00
commit b1ce567819
3 changed files with 4 additions and 4 deletions

View file

@ -172,7 +172,8 @@ DEFAULT_PREFS = {
"owner_width":10, "owner_width":10,
"ignore_duplicate_lines": False, "ignore_duplicate_lines": False,
"move_selection": True, "move_selection": True,
"third_tab_lists_all": False "third_tab_lists_all": False,
"torrents_per_tab_press": 15
} }
column_pref_names = ["queue","name","size","state", column_pref_names = ["queue","name","size","state",

View file

@ -57,8 +57,6 @@ import re
LINES_BUFFER_SIZE = 5000 LINES_BUFFER_SIZE = 5000
INPUT_HISTORY_SIZE = 500 INPUT_HISTORY_SIZE = 500
AUTOCOMPLETE_MAX_TORRENTS = 15
class Legacy(BaseMode): class Legacy(BaseMode):
def __init__(self, stdscr, console_config, encoding=None): def __init__(self, stdscr, console_config, encoding=None):
@ -556,7 +554,7 @@ class Legacy(BaseMode):
line = new_line line = new_line
cursor = len(line) cursor = len(line)
elif hits >= 2: elif hits >= 2:
max_list = AUTOCOMPLETE_MAX_TORRENTS max_list = self.console_config["torrents_per_tab_press"]
match_count = len(possible_matches) match_count = len(possible_matches)
listed = (hits-2) * max_list listed = (hits-2) * max_list
pages = (match_count-1) // max_list + 1 pages = (match_count-1) // max_list + 1

View file

@ -314,6 +314,7 @@ class InterfacePane(BasePane):
self.add_checked_input("ignore_duplicate_lines","Do not store duplicate input in history",parent.console_config["ignore_duplicate_lines"]) self.add_checked_input("ignore_duplicate_lines","Do not store duplicate input in history",parent.console_config["ignore_duplicate_lines"])
self.add_checked_input("move_selection","Move selection when moving torrents in the queue",parent.console_config["move_selection"]) self.add_checked_input("move_selection","Move selection when moving torrents in the queue",parent.console_config["move_selection"])
self.add_checked_input("third_tab_lists_all","Third tab lists all remaining torrents in legacy mode",parent.console_config["third_tab_lists_all"]) self.add_checked_input("third_tab_lists_all","Third tab lists all remaining torrents in legacy mode",parent.console_config["third_tab_lists_all"])
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) self.add_header("Columns To Display", True)
for cpn in deluge.ui.console.modes.alltorrents.column_pref_names: for cpn in deluge.ui.console.modes.alltorrents.column_pref_names: