2008-08-16 22:30:37 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
##
|
|
|
|
## This file is part of Gajim.
|
|
|
|
##
|
|
|
|
## Gajim is free software; you can redistribute it and/or modify
|
|
|
|
## it under the terms of the GNU General Public License as published
|
|
|
|
## by the Free Software Foundation; version 3 only.
|
|
|
|
##
|
|
|
|
## Gajim is distributed in the hope that it will be useful,
|
|
|
|
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
## GNU General Public License for more details.
|
|
|
|
##
|
|
|
|
## You should have received a copy of the GNU General Public License
|
|
|
|
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
##
|
|
|
|
'''
|
|
|
|
Events notifications using Snarl
|
|
|
|
|
|
|
|
Fancy events notifications under Windows using Snarl infrastructure.
|
|
|
|
|
|
|
|
:note: plugin is at proof-of-concept state.
|
|
|
|
|
|
|
|
:author: Mateusz Biliński <mateusz@bilinski.it>
|
|
|
|
:since: 15th August 2008
|
|
|
|
:copyright: Copyright (2008) Mateusz Biliński <mateusz@bilinski.it>
|
|
|
|
:license: GPL
|
|
|
|
'''
|
|
|
|
|
|
|
|
import new
|
|
|
|
from pprint import pformat
|
|
|
|
|
2008-08-18 18:35:14 +02:00
|
|
|
#import PySnarl
|
2008-08-16 22:30:37 +02:00
|
|
|
|
|
|
|
from common import gajim
|
|
|
|
from plugins import GajimPlugin
|
|
|
|
from plugins.helpers import log_calls, log
|
|
|
|
from common import ged
|
|
|
|
|
|
|
|
class SnarlNotificationsPlugin(GajimPlugin):
|
|
|
|
|
2010-04-08 01:20:17 +02:00
|
|
|
@log_calls('SnarlNotificationsPlugin')
|
|
|
|
def init(self):
|
|
|
|
self.config_dialog = None
|
|
|
|
#self.gui_extension_points = {}
|
|
|
|
#self.config_default_values = {}
|
|
|
|
|
2011-05-01 22:09:50 +02:00
|
|
|
self.events_handlers = {'notification' : (ged.POSTCORE, self.notif)}
|
2010-04-08 01:20:17 +02:00
|
|
|
|
|
|
|
@log_calls('SnarlNotificationsPlugin')
|
|
|
|
def activate(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
@log_calls('SnarlNotificationsPlugin')
|
|
|
|
def deactivate(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
@log_calls('SnarlNotificationsPlugin')
|
2011-05-01 22:09:50 +02:00
|
|
|
def notif(self, obj):
|
|
|
|
print "Event '%s' occured.\n\n===\n" % obj.popup_event_type
|
2010-04-08 01:20:17 +02:00
|
|
|
|
|
|
|
#if PySnarl.snGetVersion() != False:
|
|
|
|
#(major, minor) = PySnarl.snGetVersion()
|
|
|
|
#print "Found Snarl version",str(major)+"."+str(minor),"running."
|
2011-05-01 22:09:50 +02:00
|
|
|
#PySnarl.snShowMessage(obj.popup_title, obj.popup_text)
|
2010-04-08 01:20:17 +02:00
|
|
|
#else:
|
|
|
|
#print "Sorry Snarl does not appear to be running"
|