def on_information_button_clicked(self, widget):
     (model, iter_) = self.result_treeview.get_selection().get_selected()
     if not iter_:
         return
     jid = model[iter_][self.jid_column]
     if jid in app.interface.instances[self.account]['infos']:
         app.interface.instances[
             self.account]['infos'][jid].window.present()
     else:
         contact = app.contacts.create_contact(jid=jid,
                                               account=self.account)
         app.interface.instances[self.account]['infos'][jid] = \
                 vcard.VcardWindow(contact, self.account)
 def _on_contact_info_clicked(self, _widget):
     """
     Ask for vCard
     """
     open_windows = app.interface.instances[self.account]['infos']
     if self.jid in open_windows:
         open_windows[self.jid].window.present()
     else:
         contact = app.contacts.create_contact(jid=self.jid,
                                               account=self.account)
         app.interface.instances[self.account]['infos'][self.jid] = \
                  vcard.VcardWindow(contact, self.account)
         # Remove xmpp page
         app.interface.instances[self.account]['infos'][self.jid].xml.\
                  get_object('information_notebook').remove_page(0)
Exemple #3
0
    def on_show_contact_info_button_clicked(self, widget):
        """
        Ask for vCard
        """
        jid = self.uid_entry.get_text().strip()

        if jid in app.interface.instances[self.account]['infos']:
            app.interface.instances[
                self.account]['infos'][jid].window.present()
        else:
            contact = app.contacts.create_contact(jid=jid,
                                                  account=self.account)
            app.interface.instances[self.account]['infos'][jid] = \
                     vcard.VcardWindow(contact, self.account)
            # Remove xmpp page
            app.interface.instances[self.account]['infos'][jid].xml.\
                     get_object('information_notebook').remove_page(0)
Exemple #4
0
    def on_show_contact_info_button_clicked(self, widget):
        """
        Ask for vCard
        """
        entry = self._ui.to_entry.get_text().strip()

        keys = sorted(self.completion_dict.keys())
        for key in keys:
            contact = self.completion_dict[key]
            if entry in key:
                entry = contact.jid
                break

        if entry in app.interface.instances[self.account]['infos']:
            app.interface.instances[
                self.account]['infos'][entry].window.present()
        else:
            contact = app.contacts.create_contact(jid=entry,
                                                  account=self.account)
            app.interface.instances[self.account]['infos'][entry] = \
                     vcard.VcardWindow(contact, self.account)
            # Remove xmpp page
            app.interface.instances[self.account]['infos'][entry].xml.\
                     get_object('information_notebook').remove_page(0)