virtManager: Remove graphics keymap UI

Removing this was discussed here:
https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html

For a decade, qemu and xen and virt-manager work together to
make setting a manual keymap redundant. Advertising it in the UI does
more harm than good, because users may think they need to specify
one when in the vast majority of cases it will give worse behavior.

With the XML editing UI, users still have a way to do this by hand
if they really know what they are doing.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-01-24 16:00:20 -05:00
parent 188fd4adb1
commit 7251ea25c2
7 changed files with 7 additions and 77 deletions

View File

@ -362,10 +362,6 @@ class AddHardware(uiutils.UITestCase):
passwd.typeText(newpass)
tab.find("Show password", "check").click()
self.assertEqual(passwd.text, newpass)
tab.find("Keymap:", "combo box").click()
self.pressKey("Down")
self.pressKey("Down")
self.pressKey("Down")
finish.click()
# Catch a port error

View File

@ -235,41 +235,6 @@
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Ke_ymap:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">graphics-keymap</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="graphics-keymap">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
<property name="has_entry">True</property>
<signal name="changed" handler="on_graphics_keymap_changed" swapped="no"/>
<child internal-child="entry">
<object class="GtkEntry" id="combobox-entry">
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
<object class="GtkBox" id="graphics-port-box">
<property name="visible">True</property>

View File

@ -1615,7 +1615,7 @@ class vmmAddHardware(vmmGObjectUI):
def _build_graphics(self):
(gtype, port, tlsport, listen,
addr, passwd, keymap, gl, rendernode) = self._gfxdetails.get_values()
addr, passwd, gl, rendernode) = self._gfxdetails.get_values()
dev = DeviceGraphics(self.conn.get_backend())
dev.type = gtype
dev.passwd = passwd
@ -1630,8 +1630,6 @@ class vmmAddHardware(vmmGObjectUI):
dev.tlsPort = tlsport
else:
raise ValueError(_("invalid listen type"))
if keymap:
dev.keymap = keymap
return dev

View File

@ -80,7 +80,6 @@ from ..xmleditor import vmmXMLEditor
EDIT_GFX_PASSWD,
EDIT_GFX_TYPE,
EDIT_GFX_KEYMAP,
EDIT_GFX_LISTEN,
EDIT_GFX_ADDRESS,
EDIT_GFX_TLSPORT,
@ -104,7 +103,7 @@ from ..xmleditor import vmmXMLEditor
EDIT_FS,
EDIT_HOSTDEV_ROMBAR) = range(1, 59)
EDIT_HOSTDEV_ROMBAR) = range(1, 58)
# Columns in hw list model
@ -408,8 +407,6 @@ class vmmDetails(vmmGObjectUI):
lambda *x: self.enable_apply(x, EDIT_GFX_LISTEN))
self.gfxdetails.connect("changed-address",
lambda *x: self.enable_apply(x, EDIT_GFX_ADDRESS))
self.gfxdetails.connect("changed-keymap",
lambda *x: self.enable_apply(x, EDIT_GFX_KEYMAP))
self.gfxdetails.connect("changed-password",
lambda *x: self.enable_apply(x, EDIT_GFX_PASSWD))
@ -1820,7 +1817,7 @@ class vmmDetails(vmmGObjectUI):
def config_graphics_apply(self, devobj):
(gtype, port, tlsport, listen,
addr, passwd, keymap, gl, rendernode) = self.gfxdetails.get_values()
addr, passwd, gl, rendernode) = self.gfxdetails.get_values()
kwargs = {}
@ -1830,8 +1827,6 @@ class vmmDetails(vmmGObjectUI):
kwargs["listen"] = listen
if self.edited(EDIT_GFX_ADDRESS) or self.edited(EDIT_GFX_LISTEN):
kwargs["addr"] = addr
if self.edited(EDIT_GFX_KEYMAP):
kwargs["keymap"] = keymap
if self.edited(EDIT_GFX_PORT) or self.edited(EDIT_GFX_LISTEN):
kwargs["port"] = port
if self.edited(EDIT_GFX_OPENGL):

View File

@ -21,7 +21,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
"changed-type": (vmmGObjectUI.RUN_FIRST, None, []),
"changed-listen": (vmmGObjectUI.RUN_FIRST, None, []),
"changed-address": (vmmGObjectUI.RUN_FIRST, None, []),
"changed-keymap": (vmmGObjectUI.RUN_FIRST, None, []),
"changed-opengl": (vmmGObjectUI.RUN_FIRST, None, []),
"changed-rendernode": (vmmGObjectUI.RUN_FIRST, None, []),
}
@ -44,7 +43,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
"on_graphics_address_changed": lambda ignore: self.emit("changed-address"),
"on_graphics_tlsport_changed": lambda ignore: self.emit("changed-tlsport"),
"on_graphics_port_changed": lambda ignore: self.emit("changed-port"),
"on_graphics_keymap_changed": lambda ignore: self.emit("changed-keymap"),
"on_graphics_opengl_toggled": self._change_opengl,
"on_graphics_rendernode_changed": lambda ignore: self.emit("changed-rendernode")
})
@ -100,18 +98,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
model.append(["127.0.0.1", _("Localhost only")])
model.append(["0.0.0.0", _("All interfaces")])
# Keymap
combo = self.widget("graphics-keymap")
model = Gtk.ListStore(str, str)
combo.set_model(model)
uiutil.init_combo_text_column(combo, 1)
model.append(["auto", _("Auto")])
model.append([virtinst.DeviceGraphics.KEYMAP_LOCAL,
_("Copy local keymap")])
for k in virtinst.DeviceGraphics.valid_keymaps():
model.append([k, k])
# Host GPU rendernode
combo = self.widget("graphics-rendernode")
model = Gtk.ListStore(str, str)
@ -152,7 +138,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
self.widget("graphics-type").set_active(0)
self.widget("graphics-listen-type").set_active(0)
self.widget("graphics-address").set_active(0)
self.widget("graphics-keymap").set_active(0)
# Select last entry in the list, which should be a rendernode path
rendermodel = self.widget("graphics-rendernode").get_model()
@ -170,9 +155,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
port, tlsport = self._get_config_graphics_ports()
listen = uiutil.get_list_selection(self.widget("graphics-listen-type"))
addr = uiutil.get_list_selection(self.widget("graphics-address"))
keymap = uiutil.get_list_selection(self.widget("graphics-keymap"))
if keymap == "auto":
keymap = None
passwd = self.widget("graphics-password").get_text()
if not self.widget("graphics-password-chk").get_active():
@ -181,7 +163,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
gl = self.widget("graphics-opengl").get_active()
rendernode = uiutil.get_list_selection(self.widget("graphics-rendernode"))
return gtype, port, tlsport, listen, addr, passwd, keymap, gl, rendernode
return gtype, port, tlsport, listen, addr, passwd, gl, rendernode
def set_dev(self, gfx):
self.reset_state()
@ -222,8 +204,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
uiutil.set_list_selection(self.widget("graphics-listen-type"), 'address')
uiutil.set_list_selection(
self.widget("graphics-address"), gfx.listen)
uiutil.set_list_selection(
self.widget("graphics-keymap"), gfx.keymap or None)
self.widget("graphics-password").set_text(gfx.passwd or "")
self.widget("graphics-password-chk").set_active(use_passwd)
@ -312,14 +292,14 @@ class vmmGraphicsDetails(vmmGObjectUI):
def _show_rows_from_type(self):
hide_all = ["graphics-xauth", "graphics-display", "graphics-address",
"graphics-password-box", "graphics-keymap", "graphics-port-box",
"graphics-password-box", "graphics-port-box",
"graphics-tlsport-box", "graphics-opengl-box"]
gtype = uiutil.get_list_selection(self.widget("graphics-type"))
listen = uiutil.get_list_selection(self.widget("graphics-listen-type"))
sdl_rows = ["graphics-xauth", "graphics-display"]
vnc_rows = ["graphics-password-box", "graphics-keymap"]
vnc_rows = ["graphics-password-box"]
if listen == 'address':
vnc_rows.extend(["graphics-port-box", "graphics-address"])
spice_rows = vnc_rows[:]

View File

@ -775,7 +775,7 @@ class vmmDomain(vmmLibvirtObject):
def define_graphics(self, devobj, do_hotplug,
listen=_SENTINEL, addr=_SENTINEL, port=_SENTINEL, tlsport=_SENTINEL,
passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL,
passwd=_SENTINEL, gtype=_SENTINEL,
gl=_SENTINEL, rendernode=_SENTINEL):
xmlobj = self._make_xmlobj_to_define()
editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
@ -793,8 +793,6 @@ class vmmDomain(vmmLibvirtObject):
editdev.tlsPort = tlsport
if passwd != _SENTINEL:
editdev.passwd = passwd
if keymap != _SENTINEL:
editdev.keymap = keymap
if gtype != _SENTINEL:
editdev.type = gtype
if gl != _SENTINEL:

View File

@ -51,8 +51,6 @@ class DeviceGraphics(Device):
CHANNEL_TYPE_PLAYBACK = "playback"
CHANNEL_TYPE_RECORD = "record"
KEYMAP_LOCAL = "local"
@staticmethod
def valid_keymaps():
"""