diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py index 7578051b1..929c511d1 100644 --- a/deluge/ui/console/modes/alltorrents.py +++ b/deluge/ui/console/modes/alltorrents.py @@ -736,8 +736,7 @@ class AllTorrents(BaseMode, component.Component): self.add_string(self.rows - 1, string) else: - #This will quite likely fail when switching modes because - # of an arcane problem with twisted + #This will quite likely fail when switching modes try: rf = format_utils.remove_formatting string = self.statusbars.bottombar diff --git a/deluge/ui/console/modes/eventview.py b/deluge/ui/console/modes/eventview.py index 31fb606a0..31a765703 100644 --- a/deluge/ui/console/modes/eventview.py +++ b/deluge/ui/console/modes/eventview.py @@ -36,6 +36,7 @@ import deluge.component as component from basemode import BaseMode + try: import curses except ImportError: @@ -44,6 +45,8 @@ except ImportError: import logging log = logging.getLogger(__name__) +import format_utils + class EventView(BaseMode): def __init__(self, parent_mode, stdscr, encoding=None): self.parent_mode = parent_mode @@ -55,7 +58,17 @@ class EventView(BaseMode): self.add_string(0,self.statusbars.topbar) hstr = "%sPress [h] for help"%(" "*(self.cols - len(self.statusbars.bottombar) - 10)) - self.add_string(self.rows - 1, "%s%s"%(self.statusbars.bottombar,hstr)) + #This will quite likely fail when switching modes + try: + rf = format_utils.remove_formatting + string = self.statusbars.bottombar + hstr = "Press {!magenta,blue,bold!}[h]{!status!} for help" + + string += " " * ( self.cols - len(rf(string)) - len(rf(hstr))) + hstr + + self.add_string(self.rows - 1, string) + except: + pass if events: for i,event in enumerate(events): @@ -82,7 +95,7 @@ class EventView(BaseMode): reactor.stop() client.disconnect().addCallback(on_disconnect) else: - reactor.stop() + reactor.stop() return elif chr(c) == 'q': self.back_to_overview() diff --git a/deluge/ui/console/modes/torrentdetail.py b/deluge/ui/console/modes/torrentdetail.py index 3298fa958..ca65e922c 100644 --- a/deluge/ui/console/modes/torrentdetail.py +++ b/deluge/ui/console/modes/torrentdetail.py @@ -398,8 +398,18 @@ class TorrentDetail(BaseMode, component.Component): # Update the status bars self.stdscr.erase() self.add_string(0,self.statusbars.topbar) - hstr = "%sPress [h] for help"%(" "*(self.cols - len(self.statusbars.bottombar) - 10)) - self.add_string(self.rows - 1, "%s%s"%(self.statusbars.bottombar,hstr)) + + #This will quite likely fail when switching modes + try: + rf = format_utils.remove_formatting + string = self.statusbars.bottombar + hstr = "Press {!magenta,blue,bold!}[h]{!status!} for help" + + string += " " * ( self.cols - len(rf(string)) - len(rf(hstr))) + hstr + + self.add_string(self.rows - 1, string) + except: + pass if self.files_sep: self.add_string((self.rows/2)-1,self.files_sep)