From 658914b5092f866729b566a967d96db4d4fe7e3b Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Sun, 18 Jan 2015 15:26:17 +0100 Subject: [PATCH] devicemanager: handlers to use the device when paired is complete --- src/devicemanager.vala | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/devicemanager.vala b/src/devicemanager.vala index 10d132b..0f1c683 100644 --- a/src/devicemanager.vala +++ b/src/devicemanager.vala @@ -37,12 +37,22 @@ class DeviceManager : GLib.Object debug("adding new device with key: %s", unique); this.devices.@set(unique, dev); + dev.paired.connect((d, p) => { + device_paired(d, p); + }); dev.activate(); } else { var known_dev = this.devices.@get(unique); known_dev.activate_from_device(dev); } + } + private void device_paired(Device dev, bool status) { + if (status == true) { + var core = Core.instance(); + // register message handlers + core.handlers.use_device(dev); + } } } \ No newline at end of file