hal: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Wed Jan 31 13:52:39 PST 2007
tools/device-manager/DeviceManager.py | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
New commits:
diff-tree a187c85d06e672432e5363e353f21cdfdbbfa1c0 (from f0266b7c5972f747d0730af7ccaea8e95c1c5816)
Author: Martin Pitt <martin.pitt at ubuntu.com>
Date: Wed Jan 31 16:52:04 2007 -0500
fix 'bus type' display in h-d-m
h-d-m does not correctly update the 'bus type' field, see Ubuntu bug
[1] for details. I just cooked up a small patch.
[1] https://launchpad.net/ubuntu/+source/hal/+bug/26362
diff --git a/tools/device-manager/DeviceManager.py b/tools/device-manager/DeviceManager.py
index d35e950..7a3977b 100644
--- a/tools/device-manager/DeviceManager.py
+++ b/tools/device-manager/DeviceManager.py
@@ -292,13 +292,19 @@ class DeviceManager(LibGladeApplication)
category = self.xml.get_widget("ns_device_category")
capabilities = self.xml.get_widget("ns_device_capabilities")
- if not device.properties.has_key("info.bus"):
- product.set_label("Unknown")
- vendor.set_label("Unknown")
- else:
- bus.set_label(Const.BUS_NAMES[device.properties["info.bus"]])
+ product.set_label("Unknown")
+ vendor.set_label("Unknown")
#state.set_label(Const.STATE_NAMES[device.properties["State"]])
+ # walk up the device tree to find the bus type
+ bus.set_label("Unknown")
+ d = device
+ while d:
+ if d.properties.has_key("info.bus"):
+ bus.set_label(Const.BUS_NAMES[d.properties["info.bus"]])
+ break
+ d = self.udi_to_device(d.properties["info.parent"])
+
# guestimate product and vendor if we have no device information file
if device.properties.has_key("info.bus") and device.properties["info.bus"]=="usb":
if device.properties.has_key("info.product"):
More information about the hal-commit
mailing list