Browse Source

device-proxy: add is_connected (bool IsConnected) property

Hook to connected()/disconnected() Device signals.
bboozzoo/dbus-support-wip
Maciek Borzecki 8 years ago
parent
commit
8894650a9f
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      src/mconnect/device-proxy.vala

+ 11
- 0
src/mconnect/device-proxy.vala View File

@ -63,6 +63,7 @@ class DeviceDBusProxy : Object {
private set {}
default = false;
}
public bool is_connected { get; private set; default = false; }
public string[] incoming_capabilities {
get;
@ -93,6 +94,12 @@ class DeviceDBusProxy : Object {
this.update_address();
this.update_capabilities();
this.device.notify.connect(this.param_changed);
this.device.connected.connect(() => {
this.is_connected = true;
});
this.device.disconnected.connect(() => {
this.is_connected = false;
});
this.notify.connect(this.update_properties);
}
@ -151,6 +158,10 @@ class DeviceDBusProxy : Object {
name = "IsActive";
v = this.is_active;
break;
case "is-connected":
name = "IsConnected";
v = this.is_connected;
break;
}
if (v == null)


Loading…
Cancel
Save