Browse Source

Merge pull request #13 from andyholmes/bboozzoo/dbus-support

add 'disallow_device()' function
bboozzoo/dbus-support
Maciej Borzecki 7 years ago
committed by GitHub
parent
commit
ca1a017aa2
2 changed files with 34 additions and 2 deletions
  1. +20
    -1
      src/mconnect/devicemanager-proxy.vala
  2. +14
    -1
      src/mconnect/devicemanager.vala

+ 20
- 1
src/mconnect/devicemanager-proxy.vala View File

@ -68,6 +68,25 @@ class DeviceManagerDBusProxy : Object
this.manager.allow_device(dev_proxy.device);
}
/**
* disallow_device:
* @path: device object path
*
* Disallow given device
*/
public void disallow_device(string path) {
debug("disallow device %s", path);
var dev_proxy = this.devices.@get(path);
if (dev_proxy == null) {
warning("no device under path %s", path);
return;
}
this.manager.disallow_device(dev_proxy.device);
}
/**
* list_devices:
*
@ -143,4 +162,4 @@ class DeviceManagerDBusProxy : Object
return path;
}
}
}

+ 14
- 1
src/mconnect/devicemanager.vala View File

@ -252,4 +252,17 @@ class DeviceManager : GLib.Object
// maybe activate if needed
activate_device(dev);
}
}
/**
* disallow_device:
* @path: device object path
*
* Disallow given device
*/
public void disallow_device(Device dev) {
dev.allowed = false;
// update device cache
update_cache();
}
}

Loading…
Cancel
Save