From e1c5c0b3ffbf516473a7310d18541afe36c19812 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Sat, 18 Apr 2009 18:46:01 +0000 Subject: [PATCH] Re-add input string during refresh Do not fsize config values --- deluge/ui/console/screen.py | 4 +++- deluge/ui/console/statusbars.py | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/deluge/ui/console/screen.py b/deluge/ui/console/screen.py index 5f429543c..50e47017d 100644 --- a/deluge/ui/console/screen.py +++ b/deluge/ui/console/screen.py @@ -167,6 +167,9 @@ class Screen(CursesStdIO): for index, line in enumerate(lines): self.add_string(index + 1, line) + # Add the input string + self.add_string(self.rows - 1, self.input) + # Move the cursor self.stdscr.move(self.rows - 1, self.input_cursor) self.stdscr.refresh() @@ -252,7 +255,6 @@ class Screen(CursesStdIO): self.input_cursor += 1 # Update the input string on the screen - #self.stdscr.addstr(self.rows - 1, 0, self.input + " " * (self.cols - len(self.input) - 2), curses.color_pair(1)) self.add_string(self.rows - 1, self.input) self.stdscr.move(self.rows - 1, self.input_cursor) self.stdscr.refresh() diff --git a/deluge/ui/console/statusbars.py b/deluge/ui/console/statusbars.py index 33228ccd1..bb08388a4 100644 --- a/deluge/ui/console/statusbars.py +++ b/deluge/ui/console/statusbars.py @@ -39,12 +39,14 @@ class StatusBars(component.Component): self.upload = "" self.dht = 0 + # This lets us know when the CoreConfig component is ready + self.__core_config_ready = False + def start(self): def on_coreconfig_ready(result): self.__core_config_ready = True self.update() - self.__core_config_ready = False # We need to add a callback to wait for the CoreConfig to be ready self.config.start_defer.addCallback(on_coreconfig_ready) @@ -89,12 +91,12 @@ class StatusBars(component.Component): self.screen.bottombar += " D: %s/s" % self.download if self.config["max_download_speed"] > -1: - self.screen.bottombar += " (%s/s)" % deluge.common.fsize(self.config["max_download_speed"]) + self.screen.bottombar += " (%s/s)" % self.config["max_download_speed"] self.screen.bottombar += " U: %s/s" % self.upload if self.config["max_upload_speed"] > -1: - self.screen.bottombar += " (%s/s)" % deluge.common.fsize(self.config["max_upload_speed"]) + self.screen.bottombar += " (%s/s)" % self.config["max_upload_speed"] if self.config["dht"]: self.screen.bottombar += " DHT: %s" % self.dht