Changeset 6300
- Timestamp:
- 05/08/06 23:59:09 (3 years ago)
- Location:
- trunk/src
- Files:
-
- 2 modified
-
dialogs.py (modified) (2 diffs)
-
gtkgui_helpers.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dialogs.py
r6299 r6300 998 998 prompt_text = _('Fill in the jid, or nick of the contact you would like\nto send a chat message to:') 999 999 InputDialog.__init__(self, title, prompt_text, is_modal = False) 1000 # create the completion model for input_entry 1001 completion = gtk.EntryCompletion() 1002 liststore = gtk.ListStore(gtk.gdk.Pixbuf, str) 1003 1004 render_pixbuf = gtk.CellRendererPixbuf() 1005 completion.pack_start(render_pixbuf, expand = False) 1006 completion.add_attribute(render_pixbuf, 'pixbuf', 0) 1007 1008 render_text = gtk.CellRendererText() 1009 completion.pack_start(render_text, expand = True) 1010 completion.add_attribute(render_text, 'text', 1) 1011 completion.set_property('text_column', 1) 1000 1001 self.completion_dict = {} 1002 liststore = gtkgui_helpers.get_completion_liststore(self.input_entry) 1012 1003 # add all contacts to the model 1013 self.completion_dict = {}1014 1004 for jid in gajim.contacts.get_jid_list(account): 1015 1005 contact = gajim.contacts.get_contact_with_highest_priority(account, jid) … … 1027 1017 img = gajim.interface.roster.jabber_state_images['16'][contact.show] 1028 1018 liststore.append((img.get_pixbuf(), jid)) 1029 1030 completion.set_model(liststore)1031 self.input_entry.set_completion(completion)1032 1019 1033 1020 self.ok_handler = self.new_chat_response -
trunk/src/gtkgui_helpers.py
r6265 r6300 51 51 return gtk.glade.XML(file_path, root=root, domain=i18n.APP) 52 52 53 def get_completion_liststore(entry): 54 ''' create a completion model for entry widget 55 completion list consists of (Pixbuf, Text) rows''' 56 completion = gtk.EntryCompletion() 57 liststore = gtk.ListStore(gtk.gdk.Pixbuf, str) 58 59 render_pixbuf = gtk.CellRendererPixbuf() 60 completion.pack_start(render_pixbuf, expand = False) 61 completion.add_attribute(render_pixbuf, 'pixbuf', 0) 62 63 render_text = gtk.CellRendererText() 64 completion.pack_start(render_text, expand = True) 65 completion.add_attribute(render_text, 'text', 1) 66 completion.set_property('text_column', 1) 67 completion.set_model(liststore) 68 entry.set_completion(completion) 69 return liststore 70 71 53 72 def popup_emoticons_under_button(menu, button, parent_win): 54 73 ''' pops emoticons menu under button, which is in parent_win'''
