diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2010-07-20 18:53:07 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2010-07-20 18:53:07 +0400 |
commit | 8595638cb47764abca9dd37e35a5f3dd071edcf5 (patch) | |
tree | 7b25075ddfdf5c91d3ded775ee91f4e17cc08c72 /src/remote_control.py | |
parent | 01d486ec601259abcc96d632677419eb11b43800 (diff) |
use nec / ged to handle time, version and last received event
Diffstat (limited to 'src/remote_control.py')
-rw-r--r-- | src/remote_control.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/remote_control.py b/src/remote_control.py index 95411a653..1df760713 100644 --- a/src/remote_control.py +++ b/src/remote_control.py @@ -36,6 +36,7 @@ from common import gajim from common import helpers from time import time from dialogs import AddNewContactWindow, NewChatDialog, JoinGroupchatWindow +from common import ged from common import dbus_support if dbus_support.supported: @@ -103,6 +104,25 @@ class Remote: bus_name = dbus.service.BusName(SERVICE, bus=session_bus) self.signal_object = SignalObject(bus_name) + + gajim.ged.register_event_handler('last-result-received', ged.POSTGUI, + self.on_last_status_time) + gajim.ged.register_event_handler('version-result-received', ged.POSTGUI, + self.on_os_info) + gajim.ged.register_event_handler('time-result-received', ged.POSTGUI, + self.on_time) + + def on_last_status_time(self, obj): + self.raise_signal('LastStatusTime', (obj.conn.name, [ + obj.jid, obj.resource, obj.seconds, obj.status])) + + def on_os_info(self, obj): + self.raise_signal('OsInfo', (obj.conn.name, [obj.jid, obj.resource, + obj.client_info, obj.os_info])) + + def on_time(self, obj): + self.raise_signal('EntityTime', (obj.conn.name, [obj.jid, obj.resource, + obj.time_info])) def raise_signal(self, signal, arg): if self.signal_object: |