From fac74c660822eeed0f951297ac9c1349858760c7 Mon Sep 17 00:00:00 2001 From: Denis Fomin Date: Sun, 8 Jan 2012 15:09:30 +0400 Subject: [PATCH] clients_icons. Added option to disable icons for vk.com and facebook.com --- clients_icons/clients_icons.py | 15 +++++++++++---- clients_icons/config_dialog.ui | 17 ++++++++++++++++- clients_icons/manifest.ini | 2 +- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/clients_icons/clients_icons.py b/clients_icons/clients_icons.py index 6947ef9..f4d58a2 100644 --- a/clients_icons/clients_icons.py +++ b/clients_icons/clients_icons.py @@ -160,7 +160,8 @@ class ClientsIconsPlugin(GajimPlugin): 'show_in_roster': (True, ''), 'show_in_groupchats': (True, ''), 'show_unknown_icon': (True, ''), - 'pos_in_list': (0, ''), } + 'pos_in_list': (0, ''), + 'show_facebook': (True, '') } self.config_dialog = ClientsIconsPluginConfigDialog(self) icon_path = os.path.join(self.local_file_path('icons'), 'unknown.png') @@ -179,12 +180,12 @@ class ClientsIconsPlugin(GajimPlugin): return if roster.model[child_iters[0]][self.renderer_num] is None: caps = contact.client_caps._node - if 'facebook.com' in jid: + if 'facebook.com' in jid and self.config['show_facebook']: caps = 'facebook.com' + elif '@vk.com' in jid and self.config['show_facebook']: + caps = 'vk.com' elif jid == 'juick@juick.com': caps = 'http://juick.com/caps' - elif '@vk.com' in jid: - caps = 'vk.com' elif jid == 'psto@psto.net': caps = 'psto@psto.net' elif jid == 'rss@isida-bot.com': @@ -429,6 +430,8 @@ class ClientsIconsPluginConfigDialog(GajimPluginConfigDialog): self.plugin.config['show_in_groupchats']) self.xml.get_object('show_unknown_icon').set_active( self.plugin.config['show_unknown_icon']) + self.xml.get_object('show_facebook').set_active( + self.plugin.config['show_facebook']) self.xml.connect_signals(self) @@ -456,6 +459,10 @@ class ClientsIconsPluginConfigDialog(GajimPluginConfigDialog): self.plugin.config['show_unknown_icon'] = widget.get_active() 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): self.plugin.config['pos_in_list'] = widget.get_active() self.redraw_all() diff --git a/clients_icons/config_dialog.ui b/clients_icons/config_dialog.ui index a010a27..aac0c8c 100644 --- a/clients_icons/config_dialog.ui +++ b/clients_icons/config_dialog.ui @@ -52,6 +52,21 @@ 2 + + + Show icon for facebook.com and vk.com + True + True + False + True + + + + False + False + 3 + + True @@ -80,7 +95,7 @@ False False - 3 + 4 diff --git a/clients_icons/manifest.ini b/clients_icons/manifest.ini index 922df46..68046e8 100644 --- a/clients_icons/manifest.ini +++ b/clients_icons/manifest.ini @@ -1,7 +1,7 @@ [info] name: Clients icons short_name: clients_icons -version: 1.6 +version: 1.7 description: Shows the client icons in the roster and in groupchats. Depends: Gajim > r12506