Browse Source

devicemanager: handlers to use the device when paired is complete

bboozzoo/device-cache
Maciek Borzecki 10 years ago
parent
commit
658914b509
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      src/devicemanager.vala

+ 10
- 0
src/devicemanager.vala View File

@ -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);
}
}
}

Loading…
Cancel
Save