mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-13 02:08:50 +01:00
add RemoveDevice bluetooth
This commit is contained in:
parent
efb6cb8164
commit
a7227fbadf
@ -200,8 +200,21 @@ class BleInfoPage(Page):
|
|||||||
self._MyList[i]._PosY -= self._MyList[i]._Height
|
self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||||
|
|
||||||
def TryToForget(self):
|
def TryToForget(self):
|
||||||
print("try to forget this")
|
global adapter
|
||||||
pass
|
proxy_obj = bus.get_object("org.bluez", self._Path)
|
||||||
|
dev = dbus.Interface(proxy_obj, "org.bluez.Device1")
|
||||||
|
|
||||||
|
self._Screen._MsgBox.SetText("Forgeting...")
|
||||||
|
self._Screen._MsgBox.Draw()
|
||||||
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
|
try:
|
||||||
|
adapter.RemoveDevice(dev)
|
||||||
|
except Exception,e:
|
||||||
|
print(str(e))
|
||||||
|
|
||||||
|
self._Screen.Draw()
|
||||||
|
self._Screen.SwapAndShow()
|
||||||
|
|
||||||
def TryToDisconnect(self):
|
def TryToDisconnect(self):
|
||||||
global bus
|
global bus
|
||||||
@ -524,6 +537,7 @@ class BluetoothPage(Page):
|
|||||||
|
|
||||||
def RefreshDevices(self):
|
def RefreshDevices(self):
|
||||||
global devices
|
global devices
|
||||||
|
devices = {}
|
||||||
proxy_obj = bus.get_object("org.bluez", "/")
|
proxy_obj = bus.get_object("org.bluez", "/")
|
||||||
manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager")
|
manager = dbus.Interface(proxy_obj,"org.freedesktop.DBus.ObjectManager")
|
||||||
objects = manager.GetManagedObjects()
|
objects = manager.GetManagedObjects()
|
||||||
@ -578,6 +592,10 @@ class BluetoothPage(Page):
|
|||||||
except Exception,e:
|
except Exception,e:
|
||||||
print(str(e))
|
print(str(e))
|
||||||
|
|
||||||
|
def OnReturnBackCb(self):
|
||||||
|
self.RefreshDevices()
|
||||||
|
self.GenNetworkList()
|
||||||
|
|
||||||
def OnLoadCb(self):
|
def OnLoadCb(self):
|
||||||
self.RefreshDevices()
|
self.RefreshDevices()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user