Subject: details: Better handling for From: Cole Robinson crobinso@redhat.com Sun May 4 13:23:54 2014 -0400 Date: Sun May 4 13:23:54 2014 -0400: Git: 9fd0ef5c8876ded12d9356cb38db29dace261084 Index: virt-manager-1.0.1/ui/details.ui =================================================================== --- virt-manager-1.0.1.orig/ui/details.ui +++ virt-manager-1.0.1/ui/details.ui @@ -4208,14 +4208,12 @@ 3 12 - + True False 3 - 2 - 2 - 8 4 + 8 True @@ -4225,8 +4223,10 @@ True - GTK_FILL - + 0 + 0 + 1 + 1 @@ -4237,10 +4237,10 @@ Mode: + 0 1 - 2 - GTK_FILL - + 1 + 1 @@ -4253,11 +4253,9 @@ 1 - 2 1 - 2 - GTK_FILL - + 1 + 1 @@ -4270,8 +4268,9 @@ 1 - 2 - + 0 + 1 + 1 Index: virt-manager-1.0.1/virtManager/details.py =================================================================== --- virt-manager-1.0.1.orig/virtManager/details.py +++ virt-manager-1.0.1/virtManager/details.py @@ -349,6 +349,8 @@ def _label_for_device(dev): return _("Tablet") elif dev.type == "mouse": return _("Mouse") + elif dev.type == "keyboard": + return _("Keyboard") return _("Input") if devtype in ["serial", "parallel", "console"]: @@ -2746,19 +2748,24 @@ class vmmDetails(vmmGObjectUI): 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 + mode = None if inp.type == "tablet": mode = _("Absolute Movement") - else: + elif inp.type == "mouse": mode = _("Relative Movement") self.widget("input-dev-type").set_text(dev) - self.widget("input-dev-mode").set_text(mode) + self.widget("input-dev-mode").set_text(mode or "") + uiutil.set_grid_row_visible(self.widget("input-dev-mode"), bool(mode)) # Can't remove primary Xen or PS/2 mice - if inp.type == "mouse" and inp.bus in ("xen", "ps2"): + if ((inp.type == "mouse" and inp.bus in ("xen", "ps2")) or + (inp.type == "keyboard" and inp.bus == "ps2")): self.widget("config-remove").set_sensitive(False) else: self.widget("config-remove").set_sensitive(True)