Split console options into two panes - interface and columns

This commit is contained in:
Asmageddon 2012-05-30 20:59:16 +02:00
parent 31dd1be090
commit 4a58e339cb
2 changed files with 24 additions and 9 deletions

View File

@ -310,16 +310,29 @@ class BandwidthPane(BasePane):
class InterfacePane(BasePane): class InterfacePane(BasePane):
def __init__(self, offset, parent, width): def __init__(self, offset, parent, width):
BasePane.__init__(self,offset,parent,width) BasePane.__init__(self,offset,parent,width)
self.add_header("General") self.add_header("General options", False)
self.add_checked_input("ring_bell","Ring system bell when a download finishes",parent.console_config["ring_bell"])
self.add_header("New Console UI", True)
self.add_checked_input("separate_complete","List complete torrents after incomplete regardless of sorting order",parent.console_config["separate_complete"]) self.add_checked_input("separate_complete","List complete torrents after incomplete regardless of sorting order",parent.console_config["separate_complete"])
self.add_checked_input("move_selection","Move selection when moving torrents in the queue",parent.console_config["move_selection"])
self.add_header("Legacy Mode", True)
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("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_checked_input("ring_bell","Ring system bell when a download finishes",parent.console_config["ring_bell"])
self.add_checked_input("save_legacy_history","Store and load command line history in Legacy mode",parent.console_config["save_legacy_history"]) self.add_checked_input("save_legacy_history","Store and load command line history in Legacy mode",parent.console_config["save_legacy_history"])
self.add_header("", False)
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)
class ColumnsPane(BasePane):
def __init__(self, offset, parent, width):
BasePane.__init__(self,offset,parent,width)
self.add_header("Columns To Display", True) self.add_header("Columns To Display", True)
default_prefs = deluge.ui.console.modes.alltorrents.DEFAULT_PREFS default_prefs = deluge.ui.console.modes.alltorrents.DEFAULT_PREFS

View File

@ -39,7 +39,8 @@ from deluge.ui.client import client
from basemode import BaseMode from basemode import BaseMode
from input_popup import Popup,SelectInput from input_popup import Popup,SelectInput
from preference_panes import DownloadsPane,NetworkPane,BandwidthPane,InterfacePane from preference_panes import DownloadsPane,NetworkPane,BandwidthPane
from preference_panes import InterfacePane, ColumnsPane
from preference_panes import OtherPane,DaemonPane,QueuePane,ProxyPane,CachePane from preference_panes import OtherPane,DaemonPane,QueuePane,ProxyPane,CachePane
from collections import deque from collections import deque
@ -108,7 +109,7 @@ class Preferences(BaseMode):
def __init__(self, parent_mode, core_config, console_config, active_port, status, stdscr, encoding=None): def __init__(self, parent_mode, core_config, console_config, active_port, status, stdscr, encoding=None):
self.parent_mode = parent_mode self.parent_mode = parent_mode
self.categories = [_("Downloads"), _("Network"), _("Bandwidth"), self.categories = [_("Downloads"), _("Network"), _("Bandwidth"),
_("Interface"), _("Other"), _("Daemon"), _("Queue"), _("Proxy"), _("Interface"), _("Columns"), _("Other"), _("Daemon"), _("Queue"), _("Proxy"),
_("Cache")] # , _("Plugins")] _("Cache")] # , _("Plugins")]
self.cur_cat = 0 self.cur_cat = 0
self.popup = None self.popup = None
@ -135,6 +136,7 @@ class Preferences(BaseMode):
NetworkPane(self.div_off+2, self, self.prefs_width), NetworkPane(self.div_off+2, self, self.prefs_width),
BandwidthPane(self.div_off+2, self, self.prefs_width), BandwidthPane(self.div_off+2, self, self.prefs_width),
InterfacePane(self.div_off+2, self, self.prefs_width), InterfacePane(self.div_off+2, self, self.prefs_width),
ColumnsPane(self.div_off+2, self, self.prefs_width),
OtherPane(self.div_off+2, self, self.prefs_width), OtherPane(self.div_off+2, self, self.prefs_width),
DaemonPane(self.div_off+2, self, self.prefs_width), DaemonPane(self.div_off+2, self, self.prefs_width),
QueuePane(self.div_off+2, self, self.prefs_width), QueuePane(self.div_off+2, self, self.prefs_width),
@ -202,7 +204,7 @@ class Preferences(BaseMode):
def __apply_prefs(self): def __apply_prefs(self):
new_core_config = {} new_core_config = {}
for pane in self.panes: for pane in self.panes:
if not isinstance(pane,InterfacePane): if not isinstance(pane,InterfacePane) and not isinstance(pane, ColumnsPane):
pane.add_config_values(new_core_config) pane.add_config_values(new_core_config)
# Apply Core Prefs # Apply Core Prefs
if client.connected(): if client.connected():
@ -226,7 +228,7 @@ class Preferences(BaseMode):
for pane in self.panes: for pane in self.panes:
# could just access panes by index, but that would break if panes # could just access panes by index, but that would break if panes
# are ever reordered, so do it the slightly slower but safer way # are ever reordered, so do it the slightly slower but safer way
if isinstance(pane,InterfacePane): if isinstance(pane,InterfacePane) or isinstance(pane, ColumnsPane):
pane.add_config_values(new_console_config) pane.add_config_values(new_console_config)
for key in new_console_config.keys(): for key in new_console_config.keys():
# The values do not match so this needs to be updated # The values do not match so this needs to be updated