Add new plugin. Server Status Icons.
1
server_status_icons/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from server_status_icons import ServerStatusIconsPlugin
|
||||
BIN
server_status_icons/facebook/16x16/away.png
Normal file
|
After Width: | Height: | Size: 721 B |
BIN
server_status_icons/facebook/16x16/chat.png
Normal file
|
After Width: | Height: | Size: 773 B |
BIN
server_status_icons/facebook/16x16/dnd.png
Normal file
|
After Width: | Height: | Size: 699 B |
53
server_status_icons/facebook/16x16/icon.def.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<icondef>
|
||||
<version>1.0</version>
|
||||
<name>Facebook</name>
|
||||
<description>Facebook Iconset for Vacuum-IM</description>
|
||||
<creation>2010-05-24</creation>
|
||||
<author>Artem Rogudeev / [AKI]`Rodent</author>
|
||||
|
||||
<icon>
|
||||
<key>online</key>
|
||||
<object mime='image/png'>online.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>offline</key>
|
||||
<object mime='image/png'>offline.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>away</key>
|
||||
<object mime='image/png'>away.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>xa</key>
|
||||
<object mime='image/png'>xa.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>dnd</key>
|
||||
<object mime='image/png'>dnd.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>invisible</key>
|
||||
<object mime='image/png'>invisible.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>chat</key>
|
||||
<object mime='image/png'>chatty.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>ask</key>
|
||||
<object mime='image/png'>ask.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>noauth</key>
|
||||
<object mime='image/png'>noauth.png</object>
|
||||
</icon>
|
||||
</icondef>
|
||||
BIN
server_status_icons/facebook/16x16/invisible.png
Normal file
|
After Width: | Height: | Size: 789 B |
BIN
server_status_icons/facebook/16x16/offline.png
Normal file
|
After Width: | Height: | Size: 420 B |
BIN
server_status_icons/facebook/16x16/online.png
Normal file
|
After Width: | Height: | Size: 502 B |
BIN
server_status_icons/facebook/16x16/xa.png
Normal file
|
After Width: | Height: | Size: 749 B |
BIN
server_status_icons/gtalk/16x16/away.png
Normal file
|
After Width: | Height: | Size: 850 B |
BIN
server_status_icons/gtalk/16x16/chat.png
Normal file
|
After Width: | Height: | Size: 854 B |
BIN
server_status_icons/gtalk/16x16/dnd.png
Normal file
|
After Width: | Height: | Size: 809 B |
53
server_status_icons/gtalk/16x16/icon.def.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<icondef>
|
||||
<version>1.0</version>
|
||||
<name>Google Talk</name>
|
||||
<description>Google Talk Iconset for Vacuum-IM</description>
|
||||
<creation>2010-06-12</creation>
|
||||
<author>Artem Rogudeev / [AKI]`Rodent</author>
|
||||
|
||||
<icon>
|
||||
<key>online</key>
|
||||
<object mime='image/png'>online.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>offline</key>
|
||||
<object mime='image/png'>offline.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>away</key>
|
||||
<object mime='image/png'>away.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>xa</key>
|
||||
<object mime='image/png'>xa.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>dnd</key>
|
||||
<object mime='image/png'>dnd.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>invisible</key>
|
||||
<object mime='image/png'>invisible.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>chat</key>
|
||||
<object mime='image/png'>chatty.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>ask</key>
|
||||
<object mime='image/png'>ask.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>noauth</key>
|
||||
<object mime='image/png'>noauth.png</object>
|
||||
</icon>
|
||||
</icondef>
|
||||
BIN
server_status_icons/gtalk/16x16/invisible.png
Normal file
|
After Width: | Height: | Size: 823 B |
BIN
server_status_icons/gtalk/16x16/offline.png
Normal file
|
After Width: | Height: | Size: 747 B |
BIN
server_status_icons/gtalk/16x16/online.png
Normal file
|
After Width: | Height: | Size: 794 B |
BIN
server_status_icons/gtalk/16x16/xa.png
Normal file
|
After Width: | Height: | Size: 865 B |
BIN
server_status_icons/livejournal/16x16/away.png
Normal file
|
After Width: | Height: | Size: 769 B |
BIN
server_status_icons/livejournal/16x16/chat.png
Normal file
|
After Width: | Height: | Size: 762 B |
BIN
server_status_icons/livejournal/16x16/dnd.png
Normal file
|
After Width: | Height: | Size: 712 B |
53
server_status_icons/livejournal/16x16/icon.def.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<icondef>
|
||||
<version>1.0</version>
|
||||
<name>LiveJournal</name>
|
||||
<description>LiveJournal Iconset for Vacuum-IM</description>
|
||||
<creation>2010-08-15</creation>
|
||||
<author>Artem Rogudeev / [AKI]`Rodent</author>
|
||||
|
||||
<icon>
|
||||
<key>online</key>
|
||||
<object mime='image/png'>online.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>offline</key>
|
||||
<object mime='image/png'>offline.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>away</key>
|
||||
<object mime='image/png'>away.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>xa</key>
|
||||
<object mime='image/png'>xa.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>dnd</key>
|
||||
<object mime='image/png'>dnd.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>invisible</key>
|
||||
<object mime='image/png'>invisible.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>chat</key>
|
||||
<object mime='image/png'>chatty.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>ask</key>
|
||||
<object mime='image/png'>ask.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>noauth</key>
|
||||
<object mime='image/png'>noauth.png</object>
|
||||
</icon>
|
||||
</icondef>
|
||||
BIN
server_status_icons/livejournal/16x16/invisible.png
Normal file
|
After Width: | Height: | Size: 732 B |
BIN
server_status_icons/livejournal/16x16/offline.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
server_status_icons/livejournal/16x16/online.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
server_status_icons/livejournal/16x16/xa.png
Normal file
|
After Width: | Height: | Size: 766 B |
9
server_status_icons/manifest.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
[info]
|
||||
name: Server Status Icons
|
||||
short_name: server_status_icons
|
||||
version: 0.1
|
||||
description: Replace standard Gajim status icons with server
|
||||
specific for known XMPP server accounts (vk.com, ...)
|
||||
authors = Denis Fomin <fominde@gmail.com>
|
||||
Pavel Suslov
|
||||
homepage = http://trac-plugins.gajim.org/wiki/
|
||||
BIN
server_status_icons/odnoklassniki/16x16/away.png
Normal file
|
After Width: | Height: | Size: 830 B |
BIN
server_status_icons/odnoklassniki/16x16/chat.png
Normal file
|
After Width: | Height: | Size: 843 B |
BIN
server_status_icons/odnoklassniki/16x16/dnd.png
Normal file
|
After Width: | Height: | Size: 832 B |
BIN
server_status_icons/odnoklassniki/16x16/invisible.png
Normal file
|
After Width: | Height: | Size: 728 B |
BIN
server_status_icons/odnoklassniki/16x16/offline.png
Normal file
|
After Width: | Height: | Size: 730 B |
BIN
server_status_icons/odnoklassniki/16x16/online.png
Normal file
|
After Width: | Height: | Size: 696 B |
BIN
server_status_icons/odnoklassniki/16x16/xa.png
Normal file
|
After Width: | Height: | Size: 870 B |
BIN
server_status_icons/odnoklassniki/32x32/away.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
server_status_icons/odnoklassniki/32x32/chat.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
server_status_icons/odnoklassniki/32x32/dnd.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
server_status_icons/odnoklassniki/32x32/invisible.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
server_status_icons/odnoklassniki/32x32/offline.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
server_status_icons/odnoklassniki/32x32/online.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
server_status_icons/odnoklassniki/32x32/xa.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
127
server_status_icons/server_status_icons.py
Normal file
@@ -0,0 +1,127 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##
|
||||
|
||||
import gtk
|
||||
import os
|
||||
|
||||
from plugins.gui import GajimPluginConfigDialog
|
||||
from plugins import GajimPlugin
|
||||
from plugins.helpers import log_calls
|
||||
import gtkgui_helpers
|
||||
from common import gajim
|
||||
from common import helpers
|
||||
from common import ged
|
||||
|
||||
|
||||
class ServerStatusIconsPlugin(GajimPlugin):
|
||||
|
||||
@log_calls('ServerStatusIconsPlugin')
|
||||
def init(self):
|
||||
self.description = _('Replace standard Gajim status icons with server'
|
||||
' specific for known XMPP server accounts (vk.com, ...)')
|
||||
self.pos_list = [_('after statusicon'), _('before avatar')]
|
||||
self.gui_extension_points = {
|
||||
'roster_draw_contact': (self.connect_with_roster_draw_contact,
|
||||
self.disconnect_from_roster_draw_contact)}
|
||||
self.known_servers = {'chat.facebook.com': 'facebook',
|
||||
'gmail.com': 'gtalk',
|
||||
'livejournal.com': 'livejournal',
|
||||
'odnoklassniki.ru': 'odnoklassniki',
|
||||
'vk.com': 'vkontakte',
|
||||
'ya.ru': 'yaonline'}
|
||||
|
||||
@log_calls('ServerStatusIconsPlugin')
|
||||
def connect_with_roster_draw_contact(self, roster, jid, account, contact):
|
||||
if not self.active:
|
||||
return
|
||||
if gajim.jid_is_transport(jid):
|
||||
return
|
||||
|
||||
child_iters = roster._get_contact_iter(jid, account, contact,
|
||||
roster.model)
|
||||
if not child_iters:
|
||||
return
|
||||
|
||||
icon_name = helpers.get_icon_name_to_show(contact, account)
|
||||
if gajim.events.get_events(account, jid) or icon_name == 'requested':
|
||||
return
|
||||
|
||||
host = jid.split('@')[1]
|
||||
server = self.known_servers.get(host, False)
|
||||
if not server:
|
||||
return
|
||||
|
||||
if server not in roster.transports_state_images['16']:
|
||||
# we don't have iconset for this transport loaded yet. Let's do it
|
||||
self.make_transport_state_images(roster, server)
|
||||
if server in roster.transports_state_images['16'] and \
|
||||
icon_name in roster.transports_state_images['16'][server]:
|
||||
state_images = roster.transports_state_images['16'][server]
|
||||
img = state_images[icon_name]
|
||||
for child_iter in child_iters:
|
||||
roster.model[child_iter][0] = img
|
||||
|
||||
def make_transport_state_images(self, roster, transport):
|
||||
"""
|
||||
Initialize opened and closed 'transport' iconset dict
|
||||
"""
|
||||
|
||||
folder = os.path.join(self.local_file_path(transport), '16x16')
|
||||
pixo, pixc = gtkgui_helpers.load_icons_meta()
|
||||
roster.transports_state_images['opened'][transport] = \
|
||||
gtkgui_helpers.load_iconset(folder, pixo, transport=True)
|
||||
roster.transports_state_images['closed'][transport] = \
|
||||
gtkgui_helpers.load_iconset(folder, pixc, transport=True)
|
||||
roster.transports_state_images['16'][transport] = \
|
||||
gtkgui_helpers.load_iconset(folder, transport=True)
|
||||
folder = os.path.join(self.local_file_path(transport), '32x32')
|
||||
roster.transports_state_images['32'][transport] = \
|
||||
gtkgui_helpers.load_iconset(folder, transport=True)
|
||||
|
||||
def _nec_our_show(self, obj):
|
||||
account = obj.conn.name
|
||||
roster = gajim.interface.roster
|
||||
status = gajim.connections[account].connected
|
||||
|
||||
if account not in gajim.contacts.get_accounts():
|
||||
return
|
||||
child_iterA = roster._get_account_iter(account, roster.model)
|
||||
if not child_iterA:
|
||||
return
|
||||
|
||||
hostname = gajim.config.get_per('accounts', account, 'hostname')
|
||||
server = self.known_servers.get(hostname, False)
|
||||
if not server:
|
||||
return
|
||||
|
||||
if not roster.regroup:
|
||||
show = gajim.SHOW_LIST[status]
|
||||
else: # accounts merged
|
||||
show = helpers.get_global_show()
|
||||
|
||||
if server not in roster.transports_state_images['16']:
|
||||
# we don't have iconset for this transport loaded yet. Let's do it
|
||||
self.make_transport_state_images(roster, server)
|
||||
if server in roster.transports_state_images['16'] and \
|
||||
show in roster.transports_state_images['16'][server]:
|
||||
roster.model[child_iterA][0] = roster.transports_state_images[
|
||||
'16'][server][show]
|
||||
|
||||
@log_calls('ServerStatusIconsPlugin')
|
||||
def disconnect_from_roster_draw_contact(self, roster, jid, account,
|
||||
contact):
|
||||
pass
|
||||
|
||||
@log_calls('ServerStatusIconsPlugin')
|
||||
def activate(self):
|
||||
self.active = True
|
||||
gajim.interface.roster.setup_and_draw_roster()
|
||||
gajim.ged.register_event_handler('our-show', ged.GUI2,
|
||||
self._nec_our_show)
|
||||
|
||||
@log_calls('ServerStatusIconsPlugin')
|
||||
def deactivate(self):
|
||||
self.active = None
|
||||
gajim.ged.remove_event_handler('our-show', ged.GUI2,
|
||||
self._nec_our_show)
|
||||
gajim.interface.roster.setup_and_draw_roster()
|
||||
BIN
server_status_icons/vkontakte/16x16/away.png
Normal file
|
After Width: | Height: | Size: 726 B |
BIN
server_status_icons/vkontakte/16x16/chat.png
Normal file
|
After Width: | Height: | Size: 750 B |
BIN
server_status_icons/vkontakte/16x16/dnd.png
Normal file
|
After Width: | Height: | Size: 702 B |
53
server_status_icons/vkontakte/16x16/icon.def.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<icondef>
|
||||
<version>1.0</version>
|
||||
<name>Vkontakte</name>
|
||||
<description>Vkontakte Iconset for Vacuum-IM</description>
|
||||
<creation>2010-05-24</creation>
|
||||
<author>Artem Rogudeev / [AKI]`Rodent</author>
|
||||
|
||||
<icon>
|
||||
<key>online</key>
|
||||
<object mime='image/png'>online.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>offline</key>
|
||||
<object mime='image/png'>offline.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>away</key>
|
||||
<object mime='image/png'>away.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>xa</key>
|
||||
<object mime='image/png'>xa.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>dnd</key>
|
||||
<object mime='image/png'>dnd.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>invisible</key>
|
||||
<object mime='image/png'>invisible.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>chat</key>
|
||||
<object mime='image/png'>chatty.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>ask</key>
|
||||
<object mime='image/png'>ask.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>noauth</key>
|
||||
<object mime='image/png'>noauth.png</object>
|
||||
</icon>
|
||||
</icondef>
|
||||
BIN
server_status_icons/vkontakte/16x16/invisible.png
Normal file
|
After Width: | Height: | Size: 798 B |
BIN
server_status_icons/vkontakte/16x16/offline.png
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
server_status_icons/vkontakte/16x16/online.png
Normal file
|
After Width: | Height: | Size: 446 B |
BIN
server_status_icons/vkontakte/16x16/xa.png
Normal file
|
After Width: | Height: | Size: 764 B |
BIN
server_status_icons/yaonline/16x16/away.png
Normal file
|
After Width: | Height: | Size: 933 B |
BIN
server_status_icons/yaonline/16x16/chat.png
Normal file
|
After Width: | Height: | Size: 920 B |
BIN
server_status_icons/yaonline/16x16/dnd.png
Normal file
|
After Width: | Height: | Size: 863 B |
53
server_status_icons/yaonline/16x16/icon.def.xml
Normal file
@@ -0,0 +1,53 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<icondef>
|
||||
<version>1.0</version>
|
||||
<name>Ya.Online</name>
|
||||
<description>Ya.Online Iconset for Vacuum-IM</description>
|
||||
<creation>2010-09-04</creation>
|
||||
<author>Artem Rogudeev / [AKI]`Rodent</author>
|
||||
|
||||
<icon>
|
||||
<key>online</key>
|
||||
<object mime='image/png'>online.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>offline</key>
|
||||
<object mime='image/png'>offline.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>away</key>
|
||||
<object mime='image/png'>away.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>xa</key>
|
||||
<object mime='image/png'>xa.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>dnd</key>
|
||||
<object mime='image/png'>dnd.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>invisible</key>
|
||||
<object mime='image/png'>invisible.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>chat</key>
|
||||
<object mime='image/png'>chatty.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>ask</key>
|
||||
<object mime='image/png'>ask.png</object>
|
||||
</icon>
|
||||
|
||||
<icon>
|
||||
<key>noauth</key>
|
||||
<object mime='image/png'>noauth.png</object>
|
||||
</icon>
|
||||
</icondef>
|
||||
BIN
server_status_icons/yaonline/16x16/invisible.png
Normal file
|
After Width: | Height: | Size: 902 B |
BIN
server_status_icons/yaonline/16x16/offline.png
Normal file
|
After Width: | Height: | Size: 714 B |
BIN
server_status_icons/yaonline/16x16/online.png
Normal file
|
After Width: | Height: | Size: 865 B |
BIN
server_status_icons/yaonline/16x16/xa.png
Normal file
|
After Width: | Height: | Size: 921 B |