we now explain Resource (5) in a tooltip
This commit is contained in:
parent
d4f0994f77
commit
e06c4551c3
2 changed files with 85 additions and 63 deletions
|
@ -6177,30 +6177,6 @@ Custom</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="resource_label">
|
|
||||||
<property name="visible">True</property>
|
|
||||||
<property name="label" translatable="yes"></property>
|
|
||||||
<property name="use_underline">False</property>
|
|
||||||
<property name="use_markup">False</property>
|
|
||||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
|
||||||
<property name="wrap">False</property>
|
|
||||||
<property name="selectable">False</property>
|
|
||||||
<property name="xalign">0</property>
|
|
||||||
<property name="yalign">0.5</property>
|
|
||||||
<property name="xpad">5</property>
|
|
||||||
<property name="ypad">5</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="left_attach">1</property>
|
|
||||||
<property name="right_attach">2</property>
|
|
||||||
<property name="top_attach">1</property>
|
|
||||||
<property name="bottom_attach">2</property>
|
|
||||||
<property name="x_options">fill</property>
|
|
||||||
<property name="y_options"></property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkLabel" id="client_name_version_label">
|
<widget class="GtkLabel" id="client_name_version_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
@ -6281,6 +6257,38 @@ Custom</property>
|
||||||
<property name="y_options"></property>
|
<property name="y_options"></property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkEventBox" id="resource_prio_label_eventbox">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="visible_window">True</property>
|
||||||
|
<property name="above_child">False</property>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="resource_prio_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes"></property>
|
||||||
|
<property name="use_underline">False</property>
|
||||||
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">5</property>
|
||||||
|
<property name="ypad">5</property>
|
||||||
|
</widget>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">1</property>
|
||||||
|
<property name="bottom_attach">2</property>
|
||||||
|
<property name="x_options">fill</property>
|
||||||
|
<property name="y_options"></property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="tab_expand">False</property>
|
<property name="tab_expand">False</property>
|
||||||
|
@ -12621,6 +12629,7 @@ the Jabber network.</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="yalign">0.5</property>
|
||||||
<property name="xpad">0</property>
|
<property name="xpad">0</property>
|
||||||
<property name="ypad">0</property>
|
<property name="ypad">0</property>
|
||||||
|
<property name="mnemonic_widget">pass_entry</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
@ -12690,6 +12699,7 @@ the Jabber network.</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="yalign">0.5</property>
|
||||||
<property name="xpad">0</property>
|
<property name="xpad">0</property>
|
||||||
<property name="ypad">0</property>
|
<property name="ypad">0</property>
|
||||||
|
<property name="mnemonic_widget">nick_entry</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
@ -13145,6 +13155,7 @@ the Jabber network.</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="yalign">0.5</property>
|
||||||
<property name="xpad">0</property>
|
<property name="xpad">0</property>
|
||||||
<property name="ypad">0</property>
|
<property name="ypad">0</property>
|
||||||
|
<property name="mnemonic_widget">register_pass_entry</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
@ -13214,6 +13225,7 @@ the Jabber network.</property>
|
||||||
<property name="yalign">0.5</property>
|
<property name="yalign">0.5</property>
|
||||||
<property name="xpad">0</property>
|
<property name="xpad">0</property>
|
||||||
<property name="ypad">0</property>
|
<property name="ypad">0</property>
|
||||||
|
<property name="mnemonic_widget">register_nick_entry</property>
|
||||||
</widget>
|
</widget>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
|
|
88
src/vcard.py
88
src/vcard.py
|
@ -48,7 +48,7 @@ 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.user = user #don't use it if vcard is true
|
self.contact = user #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
|
||||||
|
@ -82,23 +82,23 @@ class VcardWindow:
|
||||||
#update user.name if it's not ''
|
#update user.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.user.name and new_name != '':
|
if new_name != self.contact.name and new_name != '':
|
||||||
self.user.name = new_name
|
self.contact.name = new_name
|
||||||
for i in self.plugin.roster.get_contact_iter(self.user.jid, self.account):
|
for i in self.plugin.roster.get_contact_iter(self.contact.jid, self.account):
|
||||||
self.plugin.roster.tree.get_model().set_value(i, 1, new_name)
|
self.plugin.roster.tree.get_model().set_value(i, 1, new_name)
|
||||||
gajim.connections[self.account].update_contact(self.user.jid,
|
gajim.connections[self.account].update_contact(self.contact.jid,
|
||||||
self.user.name, self.user.groups)
|
self.contact.name, self.contact.groups)
|
||||||
#log history ?
|
#log history ?
|
||||||
oldlog = True
|
oldlog = True
|
||||||
no_log_for = gajim.config.get_per('accounts', self.account,
|
no_log_for = gajim.config.get_per('accounts', self.account,
|
||||||
'no_log_for').split()
|
'no_log_for').split()
|
||||||
if self.user.jid in no_log_for:
|
if self.contact.jid in no_log_for:
|
||||||
oldlog = False
|
oldlog = False
|
||||||
log = self.xml.get_widget('log_checkbutton').get_active()
|
log = self.xml.get_widget('log_checkbutton').get_active()
|
||||||
if not log and not self.user.jid in no_log_for:
|
if not log and not self.contact.jid in no_log_for:
|
||||||
no_log_for.append(self.user.jid)
|
no_log_for.append(self.contact.jid)
|
||||||
if log and self.user.jid in no_log_for:
|
if log and self.contact.jid in no_log_for:
|
||||||
no_log_for.remove(self.user.jid)
|
no_log_for.remove(self.contact.jid)
|
||||||
if oldlog != log:
|
if oldlog != log:
|
||||||
gajim.config.set_per('accounts', self.account, 'no_log_for',
|
gajim.config.set_per('accounts', self.account, 'no_log_for',
|
||||||
' '.join(no_log_for))
|
' '.join(no_log_for))
|
||||||
|
@ -251,44 +251,52 @@ class VcardWindow:
|
||||||
self.xml.get_widget('os_label').set_text(os)
|
self.xml.get_widget('os_label').set_text(os)
|
||||||
|
|
||||||
def fill_jabber_page(self):
|
def fill_jabber_page(self):
|
||||||
self.xml.get_widget('nickname_label').set_text(self.user.name)
|
self.xml.get_widget('nickname_label').set_text(self.contact.name)
|
||||||
self.xml.get_widget('jid_label').set_text(self.user.jid)
|
self.xml.get_widget('jid_label').set_text(self.contact.jid)
|
||||||
self.xml.get_widget('subscription_label').set_text(self.user.sub)
|
self.xml.get_widget('subscription_label').set_text(self.contact.sub)
|
||||||
label = self.xml.get_widget('ask_label')
|
label = self.xml.get_widget('ask_label')
|
||||||
if self.user.ask:
|
if self.contact.ask:
|
||||||
label.set_text(self.user.ask)
|
label.set_text(self.contact.ask)
|
||||||
else:
|
else:
|
||||||
label.set_text('None')
|
label.set_text('None')
|
||||||
self.xml.get_widget('nickname_entry').set_text(self.user.name)
|
self.xml.get_widget('nickname_entry').set_text(self.contact.name)
|
||||||
log = 1
|
log = 1
|
||||||
if self.user.jid in gajim.config.get_per('accounts', self.account,
|
if self.contact.jid in gajim.config.get_per('accounts', self.account,
|
||||||
'no_log_for').split(' '):
|
'no_log_for').split(' '):
|
||||||
log = 0
|
log = 0
|
||||||
self.xml.get_widget('log_checkbutton').set_active(log)
|
self.xml.get_widget('log_checkbutton').set_active(log)
|
||||||
resources = self.user.resource + ' (' + str(self.user.priority) + ')'
|
resources = '%s (%s)' % (self.contact.resource, str(self.contact.priority))
|
||||||
if not self.user.status:
|
uf_resources = self.contact.resource + _(' resource with priority ')\
|
||||||
self.user.status = ''
|
+ str(self.contact.priority)
|
||||||
stats = self.user.show
|
if not self.contact.status:
|
||||||
if self.user.status:
|
self.contact.status = ''
|
||||||
stats += ': ' + self.user.status
|
stats = self.contact.show # holds show and status message
|
||||||
gajim.connections[self.account].request_os_info(self.user.jid,
|
if self.contact.status:
|
||||||
self.user.resource)
|
stats += ': ' + self.contact.status
|
||||||
self.os_info = {0: {'resource': self.user.resource, 'client': '',
|
gajim.connections[self.account].request_os_info(self.contact.jid,
|
||||||
|
self.contact.resource)
|
||||||
|
self.os_info = {0: {'resource': self.contact.resource, 'client': '',
|
||||||
'os': ''}}
|
'os': ''}}
|
||||||
i = 1
|
i = 1
|
||||||
if gajim.contacts[self.account].has_key(self.user.jid):
|
if gajim.contacts[self.account].has_key(self.contact.jid):
|
||||||
for u in gajim.contacts[self.account][self.user.jid]:
|
for c in gajim.contacts[self.account][self.contact.jid]:
|
||||||
if u.resource != self.user.resource:
|
if c.resource != self.contact.resource:
|
||||||
resources += '\n' + u.resource + ' (' + str(u.priority) + ')'
|
resources = '\n%s (%s)' % (c.resource, str(c.priority))
|
||||||
if not u.status:
|
uf_resources += '\n' + c.resource + _(' resource with priority ')\
|
||||||
u.status = ''
|
+ str(c.priority)
|
||||||
stats += '\n' + u.show + ': ' + u.status
|
if not c.status:
|
||||||
gajim.connections[self.account].request_os_info(self.user.jid,
|
c.status = ''
|
||||||
u.resource)
|
stats += '\n' + c.show + ': ' + c.status
|
||||||
self.os_info[i] = {'resource': u.resource, 'client': '',
|
gajim.connections[self.account].request_os_info(self.contact.jid,
|
||||||
|
c.resource)
|
||||||
|
self.os_info[i] = {'resource': c.resource, 'client': '',
|
||||||
'os': ''}
|
'os': ''}
|
||||||
i += 1
|
i += 1
|
||||||
self.xml.get_widget('resource_label').set_text(resources)
|
self.xml.get_widget('resource_prio_label').set_text(resources)
|
||||||
|
tip = gtk.Tooltips()
|
||||||
|
resource_prio_label_eventbox = self.xml.get_widget(
|
||||||
|
'resource_prio_label_eventbox')
|
||||||
|
tip.set_tip(resource_prio_label_eventbox, uf_resources)
|
||||||
|
|
||||||
status_label = self.xml.get_widget('status_label')
|
status_label = self.xml.get_widget('status_label')
|
||||||
#FIXME: when gtk2.4 is OOOOLD do it via glade2.10+
|
#FIXME: when gtk2.4 is OOOOLD do it via glade2.10+
|
||||||
|
@ -297,9 +305,11 @@ class VcardWindow:
|
||||||
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)
|
tip.set_tip(status_label_eventbox, stats)
|
||||||
status_label.set_max_width_chars(15)
|
status_label.set_max_width_chars(15)
|
||||||
|
|
||||||
status_label.set_text(stats)
|
status_label.set_text(stats)
|
||||||
|
|
||||||
gajim.connections[self.account].request_vcard(self.user.jid)
|
|
||||||
|
gajim.connections[self.account].request_vcard(self.contact.jid)
|
||||||
|
|
||||||
def add_to_vcard(self, vcard, entry, txt):
|
def add_to_vcard(self, vcard, entry, txt):
|
||||||
'''Add an information to the vCard dictionary'''
|
'''Add an information to the vCard dictionary'''
|
||||||
|
|
Loading…
Add table
Reference in a new issue