From dc62859ffaf862ab4dc5621594434233178ee33d Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Tue, 15 Jan 2013 07:16:06 +1100 Subject: [PATCH] contacts: improve selection handling. Allow a selection of '-' to mean 'just raise without selecting anything. Also improve selection code a bit --- contacts/contacts.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/contacts/contacts.py b/contacts/contacts.py index 5549848..18f61bb 100644 --- a/contacts/contacts.py +++ b/contacts/contacts.py @@ -346,20 +346,19 @@ class Contacts(gtk.Window): def got_clip(self, clipb, data): s = clipb.wait_for_text() if not s: - print 'not s' return - print 'got', s - self.clist.set_str(s) - self.lst.show() - self.sel.grab_focus() - self.ed.hide() - self.sel.list_changed() - self.sel.select(None) + if s != '-': + self.clist.set_str(s) + self.lst.show() + self.sel.grab_focus() + self.ed.hide() + self.sel.list_changed() + self.sel.select(None) self.cb.set_with_data(self.targets, self.get_clip, self.got_clip, None) self.present() def get_clip(self, sel, seldata, info, data): - sel.set_text("Contact Please") + seldata.set_text("Contact Please") def open(self, ev): self.lst.hide() -- 2.39.5