From f89d7af59fcd9a2fe0c456fbdd2d9ff77541b649 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 24 Mar 2015 14:56:17 +1100 Subject: [PATCH] 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 --- petrol/petrol.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.39.5