]> git.neil.brown.name Git - plato.git/commitdiff
petrol: fix bug with auto-update of 'other' fields.
authorNeilBrown <neil@brown.name>
Tue, 24 Mar 2015 03:56:17 +0000 (14:56 +1100)
committerNeilBrown <neil@brown.name>
Tue, 24 Mar 2015 03:56:17 +0000 (14:56 +1100)
If a field is empty, so put it on the list of 'recent'
fields.  Otherwise the calculation of when to update
the "3rd" field gets confused.

Signed-off-by: NeilBrown <neil@brown.name>
petrol/petrol.py

index ea0bcf45205652127c52d897b7b062f4e5c2f7e6..9fac289108ae87c0e2f0cba7e3dbc356fc1cfc89 100644 (file)
@@ -214,8 +214,14 @@ class Petrol(gtk.Window):
         e.connect('focus-in-event', self.focus)
         e.connect('changed', func)
         return e
+
     def focus(self, ent, ev):
         self.active_entry = ent
+        if (len(self.entry_priority) > 0 and
+            self.check_entry(self.entry_priority[0]) == None):
+            # nothing here - drop it
+            self.entry_priority = self.entry_priority[1:]
+
         if (len(self.entry_priority) == 0 or
             self.entry_priority[0] != ent):
             # Make this entry the most recent