switch from gtk.Tooltips to gtk.Tooltip. Fixes #3471
This commit is contained in:
parent
3fcfedec58
commit
f550144530
|
@ -1235,7 +1235,6 @@ class ChatControl(ChatControlBase):
|
||||||
|
|
||||||
# Add lock image to show chat encryption
|
# Add lock image to show chat encryption
|
||||||
self.lock_image = self.xml.get_widget('lock_image')
|
self.lock_image = self.xml.get_widget('lock_image')
|
||||||
self.lock_tooltip = gtk.Tooltips()
|
|
||||||
|
|
||||||
# Convert to GC icon
|
# Convert to GC icon
|
||||||
img = self.xml.get_widget('convert_to_gc_button_image')
|
img = self.xml.get_widget('convert_to_gc_button_image')
|
||||||
|
@ -1325,8 +1324,6 @@ class ChatControl(ChatControlBase):
|
||||||
self._show_lock_image(self.gpg_is_active, 'GPG', self.gpg_is_active,
|
self._show_lock_image(self.gpg_is_active, 'GPG', self.gpg_is_active,
|
||||||
self.session and self.session.is_loggable(), True)
|
self.session and self.session.is_loggable(), True)
|
||||||
|
|
||||||
self.status_tooltip = gtk.Tooltips()
|
|
||||||
|
|
||||||
self.update_ui()
|
self.update_ui()
|
||||||
# restore previous conversation
|
# restore previous conversation
|
||||||
self.restore_conversation()
|
self.restore_conversation()
|
||||||
|
@ -1604,7 +1601,6 @@ class ChatControl(ChatControlBase):
|
||||||
jid = contact.jid
|
jid = contact.jid
|
||||||
|
|
||||||
banner_name_label = self.xml.get_widget('banner_name_label')
|
banner_name_label = self.xml.get_widget('banner_name_label')
|
||||||
banner_name_tooltip = gtk.Tooltips()
|
|
||||||
|
|
||||||
name = contact.get_shown_name()
|
name = contact.get_shown_name()
|
||||||
if self.resource:
|
if self.resource:
|
||||||
|
@ -1679,8 +1675,7 @@ class ChatControl(ChatControlBase):
|
||||||
status_text = '<span %s>%s</span>' % (font_attrs_small, status_text)
|
status_text = '<span %s>%s</span>' % (font_attrs_small, status_text)
|
||||||
else:
|
else:
|
||||||
status_text = '<span %s>%s</span>' % (font_attrs_small, status_escaped)
|
status_text = '<span %s>%s</span>' % (font_attrs_small, status_escaped)
|
||||||
self.status_tooltip.set_tip(self.banner_status_label,
|
self.banner_status_label.set_tooltip_text(status)
|
||||||
status)
|
|
||||||
self.banner_status_label.show()
|
self.banner_status_label.show()
|
||||||
self.banner_status_label.set_no_show_all(False)
|
self.banner_status_label.set_no_show_all(False)
|
||||||
else:
|
else:
|
||||||
|
@ -1691,7 +1686,7 @@ class ChatControl(ChatControlBase):
|
||||||
self.banner_status_label.set_markup(status_text)
|
self.banner_status_label.set_markup(status_text)
|
||||||
# setup the label that holds name and jid
|
# setup the label that holds name and jid
|
||||||
banner_name_label.set_markup(label_text)
|
banner_name_label.set_markup(label_text)
|
||||||
banner_name_tooltip.set_tip(banner_name_label, label_tooltip)
|
banner_name_label.set_tooltip_text(label_tooltip)
|
||||||
|
|
||||||
def _toggle_gpg(self):
|
def _toggle_gpg(self):
|
||||||
if not self.gpg_is_active and not self.contact.keyID:
|
if not self.gpg_is_active and not self.contact.keyID:
|
||||||
|
@ -1768,7 +1763,7 @@ class ChatControl(ChatControlBase):
|
||||||
'status': status_string, 'authenticated': authenticated_string,
|
'status': status_string, 'authenticated': authenticated_string,
|
||||||
'logged': logged_string}
|
'logged': logged_string}
|
||||||
|
|
||||||
self.lock_tooltip.set_tip(self.authentication_button, tooltip)
|
self.authentication_button.set_tooltip_text(tooltip)
|
||||||
self.widget_set_visible(self.authentication_button, not visible)
|
self.widget_set_visible(self.authentication_button, not visible)
|
||||||
self.lock_image.set_sensitive(enc_enabled)
|
self.lock_image.set_sensitive(enc_enabled)
|
||||||
|
|
||||||
|
@ -2171,9 +2166,6 @@ class ChatControl(ChatControlBase):
|
||||||
self.reset_kbd_mouse_timeout_vars()
|
self.reset_kbd_mouse_timeout_vars()
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
# destroy banner tooltip - bug #pygtk for that!
|
|
||||||
self.status_tooltip.destroy()
|
|
||||||
|
|
||||||
# Send 'gone' chatstate
|
# Send 'gone' chatstate
|
||||||
self.send_chatstate('gone', self.contact)
|
self.send_chatstate('gone', self.contact)
|
||||||
self.contact.chatstate = None
|
self.contact.chatstate = None
|
||||||
|
|
|
@ -283,8 +283,6 @@ class SingleForm(gtk.Table, object):
|
||||||
self.set_col_spacings(12)
|
self.set_col_spacings(12)
|
||||||
self.set_row_spacings(6)
|
self.set_row_spacings(6)
|
||||||
|
|
||||||
self.tooltips = gtk.Tooltips()
|
|
||||||
|
|
||||||
def decorate_with_tooltip(widget, field):
|
def decorate_with_tooltip(widget, field):
|
||||||
''' Adds a tooltip containing field's description to a widget.
|
''' Adds a tooltip containing field's description to a widget.
|
||||||
Creates EventBox if widget doesn't have its own gdk window.
|
Creates EventBox if widget doesn't have its own gdk window.
|
||||||
|
@ -294,7 +292,7 @@ class SingleForm(gtk.Table, object):
|
||||||
evbox = gtk.EventBox()
|
evbox = gtk.EventBox()
|
||||||
evbox.add(widget)
|
evbox.add(widget)
|
||||||
widget = evbox
|
widget = evbox
|
||||||
self.tooltips.set_tip(widget, field.description)
|
widget.set_tooltip_text(field.description)
|
||||||
return widget
|
return widget
|
||||||
|
|
||||||
self._data_form = dataform
|
self._data_form = dataform
|
||||||
|
|
|
@ -344,7 +344,7 @@ class ChangeActivityDialog:
|
||||||
item = self.xml.get_widget(category + '_image')
|
item = self.xml.get_widget(category + '_image')
|
||||||
item.set_from_pixbuf(
|
item.set_from_pixbuf(
|
||||||
gtkgui_helpers.load_activity_icon(category).get_pixbuf())
|
gtkgui_helpers.load_activity_icon(category).get_pixbuf())
|
||||||
gtk.Tooltips().set_tip(item, pep.ACTIVITIES[category]['category'])
|
item.set_tooltip_text(pep.ACTIVITIES[category]['category'])
|
||||||
|
|
||||||
vbox = self.xml.get_widget(category + '_vbox')
|
vbox = self.xml.get_widget(category + '_vbox')
|
||||||
vbox.set_border_width(5)
|
vbox.set_border_width(5)
|
||||||
|
@ -477,7 +477,7 @@ class ChangeMoodDialog:
|
||||||
self.mood_buttons[mood].set_mode(False)
|
self.mood_buttons[mood].set_mode(False)
|
||||||
self.mood_buttons[mood].add(gtkgui_helpers.load_mood_icon(mood))
|
self.mood_buttons[mood].add(gtkgui_helpers.load_mood_icon(mood))
|
||||||
self.mood_buttons[mood].set_relief(gtk.RELIEF_NONE)
|
self.mood_buttons[mood].set_relief(gtk.RELIEF_NONE)
|
||||||
gtk.Tooltips().set_tip(self.mood_buttons[mood], pep.MOODS[mood])
|
self.mood_buttons[mood].set_tooltip_text(pep.MOODS[mood])
|
||||||
self.mood_buttons[mood].connect('clicked',
|
self.mood_buttons[mood].connect('clicked',
|
||||||
self.on_mood_button_clicked, mood)
|
self.on_mood_button_clicked, mood)
|
||||||
table.attach(self.mood_buttons[mood], x, x + 1, y, y + 1)
|
table.attach(self.mood_buttons[mood], x, x + 1, y, y + 1)
|
||||||
|
@ -650,7 +650,7 @@ class ChangeStatusMessageDialog(TimeoutDialog):
|
||||||
else:
|
else:
|
||||||
img.set_from_pixbuf(gtkgui_helpers.load_activity_icon(
|
img.set_from_pixbuf(gtkgui_helpers.load_activity_icon(
|
||||||
self.pep_dict['activity']).get_pixbuf())
|
self.pep_dict['activity']).get_pixbuf())
|
||||||
# gtk.Tooltips().set_tip(item, pep.ACTIVITIES[category]['category'])
|
# item.set_tooltip_text(pep.ACTIVITIES[category]['category'])
|
||||||
if self.pep_dict['activity_text']:
|
if self.pep_dict['activity_text']:
|
||||||
label.set_text(self.pep_dict['activity_text'])
|
label.set_text(self.pep_dict['activity_text'])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -292,7 +292,6 @@ class GroupchatControl(ChatControlBase):
|
||||||
self.last_key_tabs = False
|
self.last_key_tabs = False
|
||||||
|
|
||||||
self.subject = ''
|
self.subject = ''
|
||||||
self.subject_tooltip = gtk.Tooltips()
|
|
||||||
|
|
||||||
self.tooltip = tooltips.GCTooltip()
|
self.tooltip = tooltips.GCTooltip()
|
||||||
|
|
||||||
|
@ -622,12 +621,12 @@ class GroupchatControl(ChatControlBase):
|
||||||
subject_text = '<span %s>%s</span>' % (font_attrs_small, subject)
|
subject_text = '<span %s>%s</span>' % (font_attrs_small, subject)
|
||||||
|
|
||||||
# tooltip must always hold ALL the subject
|
# tooltip must always hold ALL the subject
|
||||||
self.subject_tooltip.set_tip(self.event_box, self.subject)
|
self.event_box.set_tooltip_text(self.subject)
|
||||||
self.banner_status_label.show()
|
self.banner_status_label.show()
|
||||||
self.banner_status_label.set_no_show_all(False)
|
self.banner_status_label.set_no_show_all(False)
|
||||||
else:
|
else:
|
||||||
subject_text = ''
|
subject_text = ''
|
||||||
self.subject_tooltip.disable()
|
self.event_box.set_has_tooltip(False)
|
||||||
self.banner_status_label.hide()
|
self.banner_status_label.hide()
|
||||||
self.banner_status_label.set_no_show_all(True)
|
self.banner_status_label.set_no_show_all(True)
|
||||||
|
|
||||||
|
@ -1576,9 +1575,6 @@ class GroupchatControl(ChatControlBase):
|
||||||
del win._controls[self.account][self.contact.jid]
|
del win._controls[self.account][self.contact.jid]
|
||||||
|
|
||||||
def shutdown(self, status='offline'):
|
def shutdown(self, status='offline'):
|
||||||
# destroy banner tooltip - bug #pygtk for that!
|
|
||||||
self.subject_tooltip.destroy()
|
|
||||||
|
|
||||||
# Preventing autorejoin from being activated
|
# Preventing autorejoin from being activated
|
||||||
self.autorejoin = False
|
self.autorejoin = False
|
||||||
|
|
||||||
|
|
16
src/vcard.py
16
src/vcard.py
|
@ -309,12 +309,10 @@ class VcardWindow:
|
||||||
status_label.set_max_width_chars(15)
|
status_label.set_max_width_chars(15)
|
||||||
status_label.set_text(stats)
|
status_label.set_text(stats)
|
||||||
|
|
||||||
tip = gtk.Tooltips()
|
|
||||||
status_label_eventbox = self.xml.get_widget('status_label_eventbox')
|
status_label_eventbox = self.xml.get_widget('status_label_eventbox')
|
||||||
tip.set_tip(status_label_eventbox, stats)
|
status_label_eventbox.set_tooltip_text(stats)
|
||||||
|
|
||||||
def fill_jabber_page(self):
|
def fill_jabber_page(self):
|
||||||
tooltips = gtk.Tooltips()
|
|
||||||
self.xml.get_widget('nickname_label').set_markup(
|
self.xml.get_widget('nickname_label').set_markup(
|
||||||
'<b><span size="x-large">' +
|
'<b><span size="x-large">' +
|
||||||
self.contact.get_shown_name() +
|
self.contact.get_shown_name() +
|
||||||
|
@ -343,7 +341,7 @@ class VcardWindow:
|
||||||
tt_text = _("You and the contact are interested in each other's presence information")
|
tt_text = _("You and the contact are interested in each other's presence information")
|
||||||
else: # None
|
else: # None
|
||||||
tt_text = _("You are not interested in the contact's presence, and neither he/she is interested in yours")
|
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)
|
eb.set_tooltip_text(tt_text)
|
||||||
|
|
||||||
uf_ask = helpers.get_uf_ask(self.contact.ask)
|
uf_ask = helpers.get_uf_ask(self.contact.ask)
|
||||||
ask_label.set_text(uf_ask)
|
ask_label.set_text(uf_ask)
|
||||||
|
@ -352,7 +350,7 @@ class VcardWindow:
|
||||||
tt_text = _("You are waiting contact's answer about your subscription request")
|
tt_text = _("You are waiting contact's answer about your subscription request")
|
||||||
else:
|
else:
|
||||||
tt_text = _("There is no pending subscription request.")
|
tt_text = _("There is no pending subscription request.")
|
||||||
tooltips.set_tip(eb, tt_text)
|
eb.set_tooltip_text(tt_text)
|
||||||
|
|
||||||
resources = '%s (%s)' % (self.contact.resource, unicode(
|
resources = '%s (%s)' % (self.contact.resource, unicode(
|
||||||
self.contact.priority))
|
self.contact.priority))
|
||||||
|
@ -425,7 +423,7 @@ class VcardWindow:
|
||||||
self.xml.get_widget('resource_prio_label').set_text(resources)
|
self.xml.get_widget('resource_prio_label').set_text(resources)
|
||||||
resource_prio_label_eventbox = self.xml.get_widget(
|
resource_prio_label_eventbox = self.xml.get_widget(
|
||||||
'resource_prio_label_eventbox')
|
'resource_prio_label_eventbox')
|
||||||
tooltips.set_tip(resource_prio_label_eventbox, uf_resources)
|
resource_prio_label_eventbox.set_tooltip_text(uf_resources)
|
||||||
|
|
||||||
self.fill_status_label()
|
self.fill_status_label()
|
||||||
|
|
||||||
|
@ -519,12 +517,10 @@ class ZeroconfVcardWindow:
|
||||||
status_label.set_max_width_chars(15)
|
status_label.set_max_width_chars(15)
|
||||||
status_label.set_text(stats)
|
status_label.set_text(stats)
|
||||||
|
|
||||||
tip = gtk.Tooltips()
|
|
||||||
status_label_eventbox = self.xml.get_widget('status_label_eventbox')
|
status_label_eventbox = self.xml.get_widget('status_label_eventbox')
|
||||||
tip.set_tip(status_label_eventbox, stats)
|
status_label_eventbox.set_tooltip_text(stats)
|
||||||
|
|
||||||
def fill_contact_page(self):
|
def fill_contact_page(self):
|
||||||
tooltips = gtk.Tooltips()
|
|
||||||
self.xml.get_widget('nickname_label').set_markup(
|
self.xml.get_widget('nickname_label').set_markup(
|
||||||
'<b><span size="x-large">' +
|
'<b><span size="x-large">' +
|
||||||
self.contact.get_shown_name() +
|
self.contact.get_shown_name() +
|
||||||
|
@ -545,7 +541,7 @@ class ZeroconfVcardWindow:
|
||||||
self.xml.get_widget('resource_prio_label').set_text(resources)
|
self.xml.get_widget('resource_prio_label').set_text(resources)
|
||||||
resource_prio_label_eventbox = self.xml.get_widget(
|
resource_prio_label_eventbox = self.xml.get_widget(
|
||||||
'resource_prio_label_eventbox')
|
'resource_prio_label_eventbox')
|
||||||
tooltips.set_tip(resource_prio_label_eventbox, uf_resources)
|
resource_prio_label_eventbox.set_tooltip_text(uf_resources)
|
||||||
|
|
||||||
self.fill_status_label()
|
self.fill_status_label()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue