From: NeilBrown Date: Tue, 24 Mar 2015 03:56:17 +0000 (+1100) Subject: petrol: fix bug with auto-update of 'other' fields. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=f89d7af59fcd9a2fe0c456fbdd2d9ff77541b649;p=plato.git petrol: fix bug with auto-update of 'other' fields. 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 --- diff --git a/petrol/petrol.py b/petrol/petrol.py index ea0bcf4..9fac289 100644 --- a/petrol/petrol.py +++ b/petrol/petrol.py @@ -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