Changeset 6302

Show
Ignore:
Timestamp:
05/09/06 00:06:42 (3 years ago)
Author:
dkirov
Message:

add completion for single message dialog

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/dialogs.py

    r6300 r6302  
    12531253                self.subject_entry.set_text(self.subject) 
    12541254 
     1255                self.completion_dict = {} 
     1256                if to == '': 
     1257                        liststore = gtkgui_helpers.get_completion_liststore(self.to_entry) 
     1258                        # add all contacts to the model 
     1259                        for jid in gajim.contacts.get_jid_list(account): 
     1260                                contact = gajim.contacts.get_contact_with_highest_priority( 
     1261                                                        account, jid) 
     1262                                self.completion_dict[jid] = contact 
     1263                                name = contact.name 
     1264                                if self.completion_dict.has_key(name): 
     1265                                        contact1 = self.completion_dict[name] 
     1266                                        del self.completion_dict[name] 
     1267                                        self.completion_dict['%s (%s)' % (name, contact1.jid)] = \ 
     1268                                                contact1 
     1269                                        self.completion_dict['%s (%s)' % (name, jid)] = contact 
     1270                                else: 
     1271                                        self.completion_dict[name] = contact 
     1272                        for jid in self.completion_dict.keys(): 
     1273                                contact = self.completion_dict[jid] 
     1274                                img = gajim.interface.roster.jabber_state_images['16'][ 
     1275                                                contact.show] 
     1276                                liststore.append((img.get_pixbuf(), jid)) 
     1277 
    12551278                self.xml.signal_autoconnect(self) 
    12561279 
     
    13581381                        return 
    13591382                to_whom_jid = self.to_entry.get_text().decode('utf-8') 
     1383                if self.completion_dict.has_key(to_whom_jid): 
     1384                        to_whom_jid = self.completion_dict[to_whom_jid].jid 
    13601385                subject = self.subject_entry.get_text().decode('utf-8') 
    13611386                begin, end = self.message_tv_buffer.get_bounds()