From: NeilBrown Date: Mon, 14 Jan 2013 20:16:06 +0000 (+1100) Subject: contacts: improve selection handling. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=dc62859ffaf862ab4dc5621594434233178ee33d;p=plato.git contacts: improve selection handling. Allow a selection of '-' to mean 'just raise without selecting anything. Also improve selection code a bit --- 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()