Fixed help string in torrent detail and event views

This commit is contained in:
Asmageddon 2012-05-28 20:29:58 +02:00
parent a47b2bc715
commit 2e647c6b41
3 changed files with 28 additions and 6 deletions

View File

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

View File

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

View File

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