3
#Copyright 2009 Canonical Ltd.
6
# Eitan Isaacson <eitan@ascender.com>
8
#This program is free software: you can redistribute it and/or modify it
9
#under the terms of either or both of the following licenses:
11
#1) the GNU Lesser General Public License version 3, as published by the
12
#Free Software Foundation; and/or
13
#2) the GNU Lesser General Public License version 2.1, as published by
14
#the Free Software Foundation.
16
#This program is distributed in the hope that it will be useful, but
17
#WITHOUT ANY WARRANTY; without even the implied warranties of
18
#MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
19
#PURPOSE. See the applicable version of the GNU Lesser General Public
20
#License for more details.
22
#You should have received a copy of both the GNU Lesser General Public
23
#License version 3 and version 2.1 along with this program. If not, see
24
#<http://www.gnu.org/licenses/>
32
PATHA = "/usr/share/icons/hicolor/16x16/apps/empathy.png"
33
PATHB = "/usr/share/icons/hicolor/22x22/apps/empathy.png"
36
def timeout_cb(indicator):
37
print "Modifying properties"
39
indicator.set_property_time("time", time())
45
pixbuf = gtk.gdk.pixbuf_new_from_file(lastpath)
47
indicator.set_property_icon("icon", pixbuf)
51
def display(indicator, timestamp):
52
print "Ah, my indicator has been displayed"
54
def server_display(server, timestamp):
55
print "Ah, my server has been displayed"
58
if __name__ == "__main__":
59
server = indicate.indicate_server_ref_default()
60
server.set_type("message.im")
61
server.set_desktop_file("/usr/share/applications/empathy.desktop")
62
server.connect("server-display", server_display)
64
indicator = indicate.Indicator()
65
indicator.set_property("name", "IM Client Test")
66
indicator.set_property_time("time", time())
69
indicator.connect("user-display", display)
71
gobject.timeout_add_seconds(5, timeout_cb, indicator)