changeset 219:71638dcc5a0f

Remove self.focused usage self.focus did track the current list item number of the focused node. Instead use urwids methods to get and set the item in the focus.
author Björn Ricks <bjoern.ricks@intevation.de>
date Fri, 05 Apr 2013 20:03:37 +0200
parents 29e1a68589a0
children 54e8b355164c
files getan/view.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/getan/view.py	Fri Apr 05 20:01:03 2013 +0200
+++ b/getan/view.py	Fri Apr 05 20:03:37 2013 +0200
@@ -85,8 +85,8 @@
     def select(self):
         if not self.rows:
             return None
-        node = self.rows[self.focused]
-        logger.debug("ListWidget: select row '%s'" % self.focused)
+        node = self.node_in_focus()
+        logger.info("ListWidget: select row '%s'" % node)
         node.select()
         if node.selected:
             self.selection.append(node)
@@ -101,8 +101,7 @@
         for node in self.selection:
             if node.selected:
                 node.select()
-        self.update_focus(-1, self.focused)
-        self.focused = False
+        self.set_focus(0)
 
 
 class ProjectNode(urwid.WidgetWrap):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)