fix for only drawing one effected line and only draw effected lines on marking

This commit is contained in:
Nick 2011-02-02 12:50:40 +01:00
parent eba7c2bf17
commit 5dcc935852
2 changed files with 6 additions and 3 deletions

View File

@ -503,6 +503,7 @@ class AllTorrents(BaseMode):
attr = None
if lines:
tidx = lines.pop()+1
currow = tidx-self.curoff+2
if tidx in self.marked:
bg = "blue"
@ -532,9 +533,6 @@ class AllTorrents(BaseMode):
else:
colorstr = "{!%s,%s!}"%(fg,bg)
if lines:
currow = tidx-self.curoff+2
self.add_string(currow,"%s%s"%(colorstr,row[0]))
tidx += 1
currow += 1
@ -636,11 +634,14 @@ class AllTorrents(BaseMode):
self.updater.set_torrent_to_update(cid,self._status_keys)
elif chr(c) == 'm':
self._mark_unmark(self.cursel)
effected_lines = [self.cursel-1]
elif chr(c) == 'M':
if self.last_mark >= 0:
self.marked.extend(range(self.last_mark,self.cursel+1))
effected_lines = range(self.last_mark,self.cursel)
else:
self._mark_unmark(self.cursel)
effected_lines = [self.cursel-1]
elif chr(c) == 'c':
self.marked = []
self.last_mark = -1

View File

@ -96,6 +96,8 @@ class TorrentDetail(BaseMode, component.Component):
self.column_string = ""
self.marked = {}
BaseMode.__init__(self, stdscr, encoding)
component.Component.__init__(self, "TorrentDetail", 1, depend=["SessionProxy"])