From 33decd1780e055ea9819bba95891b992a3da796b Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Mon, 28 May 2012 22:38:07 +0200 Subject: [PATCH] Finally and definitely fixed all flickering bugs --- deluge/ui/console/main.py | 1 + deluge/ui/console/modes/alltorrents.py | 3 +++ deluge/ui/console/modes/eventview.py | 3 +++ deluge/ui/console/modes/legacy.py | 3 +++ deluge/ui/console/modes/preferences.py | 3 +++ deluge/ui/console/modes/torrentdetail.py | 3 +++ 6 files changed, 16 insertions(+) diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py index 5b83135f7..5e5a8e3bc 100644 --- a/deluge/ui/console/main.py +++ b/deluge/ui/console/main.py @@ -345,6 +345,7 @@ Please use commands from the command line, eg:\n self.screen = mode self.statusbars.screen = self.screen reactor.addReader(self.screen) + mode.refresh() def on_client_disconnect(self): component.stop() diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 4e54dabcd..5d78366c0 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -837,6 +837,9 @@ class AllTorrents(BaseMode, component.Component): else: curses.curs_set(0) + if component.get("ConsoleUI").screen != self: + return + self.stdscr.noutrefresh() if self.popup: diff --git a/deluge/ui/console/modes/eventview.py b/deluge/ui/console/modes/eventview.py index 9379e0478..a6846ccee 100644 --- a/deluge/ui/console/modes/eventview.py +++ b/deluge/ui/console/modes/eventview.py @@ -89,6 +89,9 @@ class EventView(BaseMode): else: self.add_string(1,"{!white,black,bold!}No events to show yet") + if component.get("ConsoleUI").screen != self: + return + self.stdscr.noutrefresh() curses.doupdate() diff --git a/deluge/ui/console/modes/legacy.py b/deluge/ui/console/modes/legacy.py index 600b0e618..bd2123d3c 100644 --- a/deluge/ui/console/modes/legacy.py +++ b/deluge/ui/console/modes/legacy.py @@ -351,6 +351,9 @@ class Legacy(BaseMode, component.Component): # Add the input string self.add_string(self.rows - 1, self.input) + if component.get("ConsoleUI").screen != self: + return + # Move the cursor try: self.stdscr.move(self.rows - 1, self.input_cursor) diff --git a/deluge/ui/console/modes/preferences.py b/deluge/ui/console/modes/preferences.py index f73b8f114..6553a068d 100644 --- a/deluge/ui/console/modes/preferences.py +++ b/deluge/ui/console/modes/preferences.py @@ -179,6 +179,9 @@ class Preferences(BaseMode): # do this last since it moves the cursor self.__draw_preferences() + if component.get("ConsoleUI").screen != self: + return + self.stdscr.noutrefresh() if self.popup: diff --git a/deluge/ui/console/modes/torrentdetail.py b/deluge/ui/console/modes/torrentdetail.py index 72206ef87..f25705fed 100644 --- a/deluge/ui/console/modes/torrentdetail.py +++ b/deluge/ui/console/modes/torrentdetail.py @@ -442,6 +442,9 @@ class TorrentDetail(BaseMode, component.Component): self.more_to_draw = False self.draw_files(self.file_list,0,off,0) + if component.get("ConsoleUI").screen != self: + return + self.stdscr.noutrefresh() if self.popup: