clients_icons. Added option to disable icons for vk.com and facebook.com
This commit is contained in:
@@ -160,7 +160,8 @@ class ClientsIconsPlugin(GajimPlugin):
|
|||||||
'show_in_roster': (True, ''),
|
'show_in_roster': (True, ''),
|
||||||
'show_in_groupchats': (True, ''),
|
'show_in_groupchats': (True, ''),
|
||||||
'show_unknown_icon': (True, ''),
|
'show_unknown_icon': (True, ''),
|
||||||
'pos_in_list': (0, ''), }
|
'pos_in_list': (0, ''),
|
||||||
|
'show_facebook': (True, '') }
|
||||||
|
|
||||||
self.config_dialog = ClientsIconsPluginConfigDialog(self)
|
self.config_dialog = ClientsIconsPluginConfigDialog(self)
|
||||||
icon_path = os.path.join(self.local_file_path('icons'), 'unknown.png')
|
icon_path = os.path.join(self.local_file_path('icons'), 'unknown.png')
|
||||||
@@ -179,12 +180,12 @@ class ClientsIconsPlugin(GajimPlugin):
|
|||||||
return
|
return
|
||||||
if roster.model[child_iters[0]][self.renderer_num] is None:
|
if roster.model[child_iters[0]][self.renderer_num] is None:
|
||||||
caps = contact.client_caps._node
|
caps = contact.client_caps._node
|
||||||
if 'facebook.com' in jid:
|
if 'facebook.com' in jid and self.config['show_facebook']:
|
||||||
caps = 'facebook.com'
|
caps = 'facebook.com'
|
||||||
|
elif '@vk.com' in jid and self.config['show_facebook']:
|
||||||
|
caps = 'vk.com'
|
||||||
elif jid == 'juick@juick.com':
|
elif jid == 'juick@juick.com':
|
||||||
caps = 'http://juick.com/caps'
|
caps = 'http://juick.com/caps'
|
||||||
elif '@vk.com' in jid:
|
|
||||||
caps = 'vk.com'
|
|
||||||
elif jid == 'psto@psto.net':
|
elif jid == 'psto@psto.net':
|
||||||
caps = 'psto@psto.net'
|
caps = 'psto@psto.net'
|
||||||
elif jid == 'rss@isida-bot.com':
|
elif jid == 'rss@isida-bot.com':
|
||||||
@@ -429,6 +430,8 @@ class ClientsIconsPluginConfigDialog(GajimPluginConfigDialog):
|
|||||||
self.plugin.config['show_in_groupchats'])
|
self.plugin.config['show_in_groupchats'])
|
||||||
self.xml.get_object('show_unknown_icon').set_active(
|
self.xml.get_object('show_unknown_icon').set_active(
|
||||||
self.plugin.config['show_unknown_icon'])
|
self.plugin.config['show_unknown_icon'])
|
||||||
|
self.xml.get_object('show_facebook').set_active(
|
||||||
|
self.plugin.config['show_facebook'])
|
||||||
|
|
||||||
self.xml.connect_signals(self)
|
self.xml.connect_signals(self)
|
||||||
|
|
||||||
@@ -456,6 +459,10 @@ class ClientsIconsPluginConfigDialog(GajimPluginConfigDialog):
|
|||||||
self.plugin.config['show_unknown_icon'] = widget.get_active()
|
self.plugin.config['show_unknown_icon'] = widget.get_active()
|
||||||
self.redraw_all()
|
self.redraw_all()
|
||||||
|
|
||||||
|
def on_show_facebook_toggled(self, widget):
|
||||||
|
self.plugin.config['show_facebook'] = widget.get_active()
|
||||||
|
self.redraw_all()
|
||||||
|
|
||||||
def on_combobox1_changed(self, widget):
|
def on_combobox1_changed(self, widget):
|
||||||
self.plugin.config['pos_in_list'] = widget.get_active()
|
self.plugin.config['pos_in_list'] = widget.get_active()
|
||||||
self.redraw_all()
|
self.redraw_all()
|
||||||
|
|||||||
@@ -52,6 +52,21 @@
|
|||||||
<property name="position">2</property>
|
<property name="position">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCheckButton" id="show_facebook">
|
||||||
|
<property name="label" translatable="yes">Show icon for facebook.com and vk.com</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="receives_default">False</property>
|
||||||
|
<property name="draw_indicator">True</property>
|
||||||
|
<signal name="toggled" handler="on_show_facebook_toggled"/>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkHBox" id="hbox1">
|
<object class="GtkHBox" id="hbox1">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
@@ -80,7 +95,7 @@
|
|||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
<property name="fill">False</property>
|
<property name="fill">False</property>
|
||||||
<property name="position">3</property>
|
<property name="position">4</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[info]
|
[info]
|
||||||
name: Clients icons
|
name: Clients icons
|
||||||
short_name: clients_icons
|
short_name: clients_icons
|
||||||
version: 1.6
|
version: 1.7
|
||||||
description: Shows the client icons in the roster
|
description: Shows the client icons in the roster
|
||||||
and in groupchats.
|
and in groupchats.
|
||||||
Depends: Gajim > r12506
|
Depends: Gajim > r12506
|
||||||
|
|||||||
Reference in New Issue
Block a user