[hamster-applet] try to go to next row only if there is one. fixes a warning.



commit bbe8d1aea77f09906c83f63f56cbf02cf618f307
Author: Toms Bauģis <toms baugis gmail com>
Date:   Fri Jun 19 10:12:03 2009 +0100

    try to go to next row only if there is one. fixes a warning.

 hamster/applet.py |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/hamster/applet.py b/hamster/applet.py
index 0162af3..a50fc9e 100755
--- a/hamster/applet.py
+++ b/hamster/applet.py
@@ -590,12 +590,11 @@ class HamsterApplet(object):
         (model, iter) = selection.get_selected()
 
         next_row = model.iter_next(iter)
-
         (cur, col) = self.treeview.get_cursor()
-
         runtime.storage.remove_fact(model[iter][0])
-        
-        self.treeview.set_cursor(cur)
+
+        if next_row:        
+            self.treeview.set_cursor(cur)
 
 
     def __update_fact(self):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]