Re-add input string during refresh

Do not fsize config values
This commit is contained in:
Andrew Resch 2009-04-18 18:46:01 +00:00
parent 3ac0cace6b
commit e1c5c0b3ff
2 changed files with 8 additions and 4 deletions

View File

@ -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()

View File

@ -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