Module: deluge
Branch: master
Commit: 5dcc93585224a8b0b5b8733112cdabadf4590c9f

Author: Nick <[email protected]>
Date:   Wed Feb  2 12:50:40 2011 +0100

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

---

 deluge/ui/console/modes/alltorrents.py   |    7 ++++---
 deluge/ui/console/modes/torrentdetail.py |    2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/deluge/ui/console/modes/alltorrents.py 
b/deluge/ui/console/modes/alltorrents.py
index 98ac48e..1ce09e6 100644
--- a/deluge/ui/console/modes/alltorrents.py
+++ b/deluge/ui/console/modes/alltorrents.py
@@ -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
diff --git a/deluge/ui/console/modes/torrentdetail.py 
b/deluge/ui/console/modes/torrentdetail.py
index a39c4ea..d6d93ac 100644
--- a/deluge/ui/console/modes/torrentdetail.py
+++ b/deluge/ui/console/modes/torrentdetail.py
@@ -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"])
 

-- 
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.

Reply via email to