details: Improve UI labeling of keyboard devices
This commit is contained in:
parent
22b9932c47
commit
92c42bc5a0
|
@ -292,6 +292,7 @@
|
|||
<!-- input devices -->
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='tablet' bus='usb'/>
|
||||
<input type='keyboard' bus='usb'/>
|
||||
|
||||
|
||||
<!-- Graphics devices -->
|
||||
|
|
|
@ -4532,7 +4532,7 @@ if you know what you are doing.</small></property>
|
|||
<object class="GtkLabel" id="label407">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>Virtual Pointer</b></property>
|
||||
<property name="label" translatable="yes"><b>Virtual Input Device</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
</child>
|
||||
|
|
|
@ -801,6 +801,16 @@ class vmmAddHardware(vmmGObjectUI):
|
|||
model.append([None, _("Hypervisor default")])
|
||||
uiutil.set_grid_row_visible(combo, False)
|
||||
|
||||
@staticmethod
|
||||
def label_for_input_device(typ, bus):
|
||||
if typ == "tablet" and bus == "usb":
|
||||
return _("EvTouch USB Graphics Tablet")
|
||||
|
||||
if bus in ["usb", "ps2"]:
|
||||
return _("Generic") + (" %s %s" %
|
||||
(bus.upper(), str(typ).capitalize()))
|
||||
return "%s %s" % (str(bus).capitalize(), str(typ).capitalize())
|
||||
|
||||
|
||||
#########################
|
||||
# UI population methods #
|
||||
|
@ -825,9 +835,12 @@ class vmmAddHardware(vmmGObjectUI):
|
|||
|
||||
def populate_input_model(self, model):
|
||||
model.clear()
|
||||
model.append([_("EvTouch USB Graphics Tablet"), "tablet", "usb"])
|
||||
model.append([_("Generic USB Mouse"), "mouse", "usb"])
|
||||
model.append([_("Generic USB Keyboard"), "keyboard", "usb"])
|
||||
def _add_row(typ, bus):
|
||||
model.append([self.label_for_input_device(typ, bus), typ, bus])
|
||||
|
||||
_add_row("tablet", "usb")
|
||||
_add_row("mouse", "usb")
|
||||
_add_row("keyboard", "usb")
|
||||
|
||||
def populate_host_device_model(self, devtype, devcap, subtype, subcap):
|
||||
devlist = self.widget("host-device")
|
||||
|
|
|
@ -265,6 +265,8 @@ def _icon_for_device(dev):
|
|||
return "drive-harddisk"
|
||||
|
||||
if devtype == "input":
|
||||
if dev.type == "keyboard":
|
||||
return "input-keyboard"
|
||||
if dev.type == "tablet":
|
||||
return "input-tablet"
|
||||
return "input-mouse"
|
||||
|
@ -2785,19 +2787,7 @@ class vmmDetails(vmmGObjectUI):
|
|||
if not inp:
|
||||
return
|
||||
|
||||
ident = "%s:%s" % (inp.type, inp.bus)
|
||||
if ident == "tablet:usb":
|
||||
dev = _("EvTouch USB Graphics Tablet")
|
||||
elif ident == "mouse:usb":
|
||||
dev = _("Generic USB Mouse")
|
||||
elif ident == "mouse:xen":
|
||||
dev = _("Xen Mouse")
|
||||
elif ident == "mouse:ps2":
|
||||
dev = _("PS/2 Mouse")
|
||||
elif ident == "keyboard:ps2":
|
||||
dev = _("PS/2 Keyboard")
|
||||
else:
|
||||
dev = inp.bus + " " + inp.type
|
||||
dev = vmmAddHardware.label_for_input_device(inp.type, inp.bus)
|
||||
|
||||
mode = None
|
||||
if inp.type == "tablet":
|
||||
|
|
Loading…
Reference in New Issue