add tooltips in vcard window about subscription and as

This commit is contained in:
Yann Leboulanger 2005-12-01 14:42:25 +00:00
parent 68de2b3346
commit 751ec180a0
2 changed files with 63 additions and 32 deletions

View File

@ -6647,6 +6647,12 @@ Custom</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkEventBox" id="subscription_label_eventbox">
<property name="visible">True</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkLabel" id="subscription_label">
<property name="width_request">100</property>
@ -6666,6 +6672,8 @@ Custom</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
@ -6698,6 +6706,12 @@ Custom</property>
</packing>
</child>
<child>
<widget class="GtkEventBox" id="ask_label_eventbox">
<property name="visible">True</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
<child>
<widget class="GtkLabel" id="ask_label">
<property name="visible">True</property>
@ -6716,6 +6730,8 @@ Custom</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>

View File

@ -274,14 +274,29 @@ class VcardWindow:
self.xml.get_widget('os_label').set_text(os)
def fill_jabber_page(self):
tooltips = gtk.Tooltips()
self.xml.get_widget('nickname_label').set_text(self.contact.name)
self.xml.get_widget('jid_label').set_text(self.contact.jid)
uf_sub = helpers.get_uf_sub(self.contact.sub)
self.xml.get_widget('subscription_label').set_text(uf_sub)
label = self.xml.get_widget('ask_label')
eb = self.xml.get_widget('subscription_label_eventbox')
if self.contact.sub == 'from':
tt_text = _("This contact is interested in your presence information, but he/she is not interested in yours")
elif self.contact.sub == 'to':
tt_text = _("You are interested in the contact's presence information, but he/she is not interested in yours")
elif self.contact.sub == 'both':
tt_text = _("You and the contact are interested in each other's presence information")
else: # None
tt_text = _("You are not interested in the contact's presence, and neither he/she is interested in yours")
tooltips.set_tip(eb, tt_text)
label = self.xml.get_widget('ask_label')
uf_ask = helpers.get_uf_ask(self.contact.ask)
label.set_text(uf_ask)
eb = self.xml.get_widget('ask_label_eventbox')
if self.contact.ask == 'subscribe':
tooltips.set_tip(eb,
_("You are waiting contact's answer about your subscription request"))
self.xml.get_widget('nickname_entry').set_text(self.contact.name)
log = 1
if self.contact.jid in gajim.config.get_per('accounts', self.account,