Made status bars update correctly in Legacy

This commit is contained in:
Asmageddon 2012-08-20 16:27:15 +02:00
parent 8cdf914f5d
commit d3f6616d5d
1 changed files with 9 additions and 6 deletions

View File

@ -114,7 +114,7 @@ def commonprefix(m):
class Legacy(BaseMode, component.Component): class Legacy(BaseMode, component.Component):
def __init__(self, stdscr, encoding=None): def __init__(self, stdscr, encoding=None):
component.Component.__init__(self, "LegacyUI") component.Component.__init__(self, "LegacyUI", 1, depend=["SessionProxy"])
self.batch_write = False self.batch_write = False
@ -197,10 +197,7 @@ class Legacy(BaseMode, component.Component):
self.input_history_index = len(self.input_history) self.input_history_index = len(self.input_history)
#if len(self.lines) >= 5: component.start("LegacyUI")
#if any(self.lines[-5:]):
#for i in range(5):
#self.add_line(" ", False)
# show the cursor # show the cursor
@ -227,7 +224,13 @@ class Legacy(BaseMode, component.Component):
client.register_event_handler("TorrentRemovedEvent", self.on_torrent_removed_event) client.register_event_handler("TorrentRemovedEvent", self.on_torrent_removed_event)
def update(self): def update(self):
pass if component.get("ConsoleUI").screen != self:
return
# Update just the status bars
self.add_string(0, self.statusbars.topbar)
self.add_string(self.rows - 2, self.statusbars.bottombar)
self.stdscr.refresh()
def _doRead(self): def _doRead(self):
# Read the character # Read the character