From 48dd049cbd268fd05209ce46b2ee65338af5567e Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Sun, 27 May 2012 19:17:46 +0200 Subject: [PATCH] Log events to legacy mode even when in AllTorrents view --- deluge/ui/console/main.py | 1 + deluge/ui/console/modes/alltorrents.py | 4 ++-- deluge/ui/console/modes/legacy.py | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py index 070e03047..72e7e2537 100644 --- a/deluge/ui/console/main.py +++ b/deluge/ui/console/main.py @@ -352,6 +352,7 @@ Please use commands from the command line, eg:\n if isinstance(self.screen,deluge.ui.console.modes.legacy.Legacy): self.screen.write(s) else: + component.get("LegacyUI").add_line(s, False) self.events.append(s) else: print colors.strip_colors(s.encode(self.encoding)) diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 3bf485a6c..b5d80c8ef 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -304,6 +304,8 @@ class AllTorrents(BaseMode, component.Component): "seeding_time","time_added","distributed_copies", "num_pieces", "piece_length","save_path"] + self.legacy_mode = Legacy(self.stdscr,self.config,self.encoding) + # component start/update def start(self): component.get("SessionProxy").get_torrents_status(self.__status_dict, self.__status_fields).addCallback(self.set_state,False) @@ -552,8 +554,6 @@ class AllTorrents(BaseMode, component.Component): def dolegacy(arg): if arg and True in arg[0]: self.stdscr.clear() - if not self.legacy_mode: - self.legacy_mode = Legacy(self.stdscr,self.config,self.encoding) component.get("ConsoleUI").set_mode(self.legacy_mode) self.legacy_mode.refresh() curses.curs_set(2) diff --git a/deluge/ui/console/modes/legacy.py b/deluge/ui/console/modes/legacy.py index 9f2f34d58..0c607b328 100644 --- a/deluge/ui/console/modes/legacy.py +++ b/deluge/ui/console/modes/legacy.py @@ -107,9 +107,11 @@ def commonprefix(m): return s -class Legacy(BaseMode): +class Legacy(BaseMode, component.Component): def __init__(self, stdscr, console_config, encoding=None): + component.Component.__init__(self, "LegacyUI") + self.batch_write = False self.lines = []