remove some user in favor of contact and fix a CB name
This commit is contained in:
parent
e06c4551c3
commit
2bf0f3e625
|
@ -5806,7 +5806,7 @@ Custom</property>
|
||||||
<property name="skip_pager_hint">False</property>
|
<property name="skip_pager_hint">False</property>
|
||||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
|
||||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||||
<signal name="destroy" handler="on_user_information_window_destroy" last_modification_time="Tue, 01 Mar 2005 15:40:50 GMT"/>
|
<signal name="destroy" handler="on_vcard_information_window_destroy" last_modification_time="Sun, 24 Jul 2005 19:35:15 GMT"/>
|
||||||
<signal name="key_press_event" handler="on_vcard_information_window_key_press_event" last_modification_time="Thu, 07 Apr 2005 10:06:13 GMT"/>
|
<signal name="key_press_event" handler="on_vcard_information_window_key_press_event" last_modification_time="Thu, 07 Apr 2005 10:06:13 GMT"/>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
|
|
16
src/vcard.py
16
src/vcard.py
|
@ -36,8 +36,8 @@ GTKGUI_GLADE = 'gtkgui.glade'
|
||||||
class VcardWindow:
|
class VcardWindow:
|
||||||
'''Class for contact's information window'''
|
'''Class for contact's information window'''
|
||||||
|
|
||||||
def __init__(self, user, plugin, account, vcard = False):
|
def __init__(self, contact, plugin, account, vcard = False):
|
||||||
#the user variable is the jid if vcard is true
|
#the contact variable is the jid if vcard is true
|
||||||
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'vcard_information_window', APP)
|
self.xml = gtk.glade.XML(GTKGUI_GLADE, 'vcard_information_window', APP)
|
||||||
self.window = self.xml.get_widget('vcard_information_window')
|
self.window = self.xml.get_widget('vcard_information_window')
|
||||||
self.xml.get_widget('photo_vbuttonbox').set_no_show_all(True)
|
self.xml.get_widget('photo_vbuttonbox').set_no_show_all(True)
|
||||||
|
@ -48,18 +48,18 @@ class VcardWindow:
|
||||||
self.retrieve_button.set_no_show_all(True)
|
self.retrieve_button.set_no_show_all(True)
|
||||||
|
|
||||||
self.plugin = plugin
|
self.plugin = plugin
|
||||||
self.contact = user #don't use it if vcard is true
|
self.contact = contact #don't use it if vcard is true
|
||||||
self.account = account
|
self.account = account
|
||||||
self.vcard = vcard
|
self.vcard = vcard
|
||||||
self.avatar_mime_type = None
|
self.avatar_mime_type = None
|
||||||
self.avatar_encoded = None
|
self.avatar_encoded = None
|
||||||
|
|
||||||
if vcard:
|
if vcard:
|
||||||
self.jid = user
|
self.jid = contact
|
||||||
# remove Jabber tab & show publish/retrieve/set_avatar buttons
|
# remove Jabber tab & show publish/retrieve/set_avatar buttons
|
||||||
self.change_to_vcard()
|
self.change_to_vcard()
|
||||||
else:
|
else:
|
||||||
self.jid = user.jid
|
self.jid = contact.jid
|
||||||
self.publish_button.hide()
|
self.publish_button.hide()
|
||||||
self.retrieve_button.hide()
|
self.retrieve_button.hide()
|
||||||
self.fill_jabber_page()
|
self.fill_jabber_page()
|
||||||
|
@ -67,7 +67,7 @@ class VcardWindow:
|
||||||
self.xml.signal_autoconnect(self)
|
self.xml.signal_autoconnect(self)
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
def on_user_information_window_destroy(self, widget = None):
|
def on_vcard_information_window_destroy(self, widget = None):
|
||||||
del self.plugin.windows[self.account]['infos'][self.jid]
|
del self.plugin.windows[self.account]['infos'][self.jid]
|
||||||
|
|
||||||
def on_vcard_information_window_key_press_event(self, widget, event):
|
def on_vcard_information_window_key_press_event(self, widget, event):
|
||||||
|
@ -75,11 +75,11 @@ class VcardWindow:
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
|
||||||
def on_close_button_clicked(self, widget):
|
def on_close_button_clicked(self, widget):
|
||||||
'''Save user's informations and update the roster on the Jabber server'''
|
'''Save contact information and update the roster on the Jabber server'''
|
||||||
if self.vcard:
|
if self.vcard:
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
return
|
return
|
||||||
#update user.name if it's not ''
|
#update contact.name if it's not ''
|
||||||
name_entry = self.xml.get_widget('nickname_entry')
|
name_entry = self.xml.get_widget('nickname_entry')
|
||||||
new_name = name_entry.get_text()
|
new_name = name_entry.get_text()
|
||||||
if new_name != self.contact.name and new_name != '':
|
if new_name != self.contact.name and new_name != '':
|
||||||
|
|
Loading…
Reference in New Issue