summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2016-11-15 17:39:01 -0500
committerOlivier CrĂȘte <olivier.crete@collabora.com>2016-11-15 17:39:01 -0500
commit20e71ec67ebb35fd180f083806fd6fe9ca94ea99 (patch)
tree2e3b78927cb0ef0f894d3e0d59311fc0904e43d8
parentfd046ba80f47bf1e568b5fa41ba903c8002deba8 (diff)
downloadtelepathy-farstream-20e71ec67ebb35fd180f083806fd6fe9ca94ea99.tar.gz
python example:`Add signal to call handler
-rw-r--r--examples/python/callhandler.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/python/callhandler.py b/examples/python/callhandler.py
index 2d20e33..f4053b2 100644
--- a/examples/python/callhandler.py
+++ b/examples/python/callhandler.py
@@ -23,8 +23,13 @@ from constants import *
from callchannel import CallChannel
-class CallHandler:
+class CallHandler(GObject.Object):
+ __gsignals__ = {
+ 'new-channel' : (GObject.SIGNAL_RUN_LAST, None, (object,))
+ }
+
def __init__(self, bus_name = 'CallDemo'):
+ GObject.Object.__init__(self)
TelepathyGLib.debug_set_flags("all")
am = TelepathyGLib.AccountManager.dup()
self.handler = handler = TelepathyGLib.SimpleHandler.new_with_am(
@@ -43,6 +48,7 @@ class CallHandler:
requests_satisfied, user_action_time, context):
assert len(channels) == 1
cchannel = CallChannel(conn, channels[0])
+ self.emit("new-channel", channels[0])
context.accept()
channels[0].accept_async(None)