[Sugar-devel] [PATCH Browse] Allow 'Up' key in the drop-down list of suggested pages SL #3473

Manuel Kaufmann humitos at gmail.com
Fri Apr 27 11:57:56 EDT 2012


This patch fixes #3473 but it's necessary to have the git version of python-gi
because it needs this commit[1] to work

[1] http://git.gnome.org/browse/pygobject/commit/?id=d37680bb9390426f7f58ea3d352c3e5e2106e978

Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
---
 webtoolbar.py |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/webtoolbar.py b/webtoolbar.py
index 654f720..e666e1f 100644
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -178,10 +178,10 @@ class WebEntry(iconentry.IconEntry):
                 selection.select_iter(model[-1].iter)
                 self._set_text(model[-1][0])
             else:
-                index = model.get_path(selected)[0]
-                if index > 0:
-                    selection.select_path(index - 1)
-                    self._set_text(model[index - 1][0])
+                up_iter = model.iter_previous(selected)
+                if up_iter:
+                    selection.select_iter(up_iter)
+                    self._set_text(model.get(up_iter, 0)[0])
             return True
         elif keyname == 'Down':
             if selected is None:
-- 
1.7.10



More information about the Sugar-devel mailing list