mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-10-26 17:25:22 +03:00
virtManager: Remove spice tlsport UI
This was discussed here: https://www.redhat.com/archives/virt-tools-list/2019-June/msg00117.html tlsPort is an advanced config feature. With the XML editing support, it's less important to have this as a first class UI element. Users that know they need this setting can set it directly in the XML Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
ee9f93074b
commit
bd82ef6529
@ -377,8 +377,6 @@ class AddHardware(uiutils.UITestCase):
|
||||
tab = self._select_hw(addhw, "Graphics", "graphics-tab")
|
||||
tab.find("Type:", "combo box").click_combo_entry()
|
||||
tab.find_fuzzy("Spice", "menu item").click()
|
||||
tab.find("graphics-tlsport-auto", "check").click()
|
||||
tab.find("graphics-tlsport", "spin button").text = "5999"
|
||||
finish.click()
|
||||
uiutils.check_in_loop(lambda: details.active)
|
||||
|
||||
|
@ -155,86 +155,6 @@
|
||||
<property name="top_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkAlignment" id="alignment2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">False</property>
|
||||
<property name="vexpand">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label29">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="label" translatable="yes">T_LS port:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">graphics-tlsport</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="graphics-tlsport-box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="graphics-tlsport-auto">
|
||||
<property name="label" translatable="yes">Aut_o</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
<signal name="toggled" handler="on_graphics_tlsport_auto_toggled" swapped="no"/>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="graphics-tlsport-auto-atkobject">
|
||||
<property name="AtkObject::accessible-name">graphics-tlsport-auto</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="graphics-tlsport">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="invisible_char">●</property>
|
||||
<property name="text" translatable="yes">5901</property>
|
||||
<property name="adjustment">adjustment4</property>
|
||||
<property name="climb_rate">1</property>
|
||||
<property name="snap_to_ticks">True</property>
|
||||
<property name="numeric">True</property>
|
||||
<property name="update_policy">if-valid</property>
|
||||
<property name="value">5901</property>
|
||||
<signal name="changed" handler="on_graphics_tlsport_changed" swapped="no"/>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="graphics-tlsport-atkobject">
|
||||
<property name="AtkObject::accessible-name">graphics-tlsport</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="graphics-port-box">
|
||||
<property name="visible">True</property>
|
||||
|
@ -1614,7 +1614,7 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
return dev
|
||||
|
||||
def _build_graphics(self):
|
||||
(gtype, port, tlsport, listen,
|
||||
(gtype, port, listen,
|
||||
addr, passwd, gl, rendernode) = self._gfxdetails.get_values()
|
||||
dev = DeviceGraphics(self.conn.get_backend())
|
||||
dev.type = gtype
|
||||
@ -1627,7 +1627,6 @@ class vmmAddHardware(vmmGObjectUI):
|
||||
elif listen == "address":
|
||||
dev.listen = addr
|
||||
dev.port = port
|
||||
dev.tlsPort = tlsport
|
||||
else:
|
||||
raise ValueError(_("invalid listen type"))
|
||||
|
||||
|
@ -82,7 +82,6 @@ from ..xmleditor import vmmXMLEditor
|
||||
EDIT_GFX_TYPE,
|
||||
EDIT_GFX_LISTEN,
|
||||
EDIT_GFX_ADDRESS,
|
||||
EDIT_GFX_TLSPORT,
|
||||
EDIT_GFX_PORT,
|
||||
EDIT_GFX_OPENGL,
|
||||
EDIT_GFX_RENDERNODE,
|
||||
@ -103,7 +102,7 @@ from ..xmleditor import vmmXMLEditor
|
||||
|
||||
EDIT_FS,
|
||||
|
||||
EDIT_HOSTDEV_ROMBAR) = range(1, 58)
|
||||
EDIT_HOSTDEV_ROMBAR) = range(1, 57)
|
||||
|
||||
|
||||
# Columns in hw list model
|
||||
@ -401,8 +400,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
lambda *x: self.enable_apply(x, EDIT_GFX_OPENGL))
|
||||
self.gfxdetails.connect("changed-rendernode",
|
||||
lambda *x: self.enable_apply(x, EDIT_GFX_RENDERNODE))
|
||||
self.gfxdetails.connect("changed-tlsport",
|
||||
lambda *x: self.enable_apply(x, EDIT_GFX_TLSPORT))
|
||||
self.gfxdetails.connect("changed-listen",
|
||||
lambda *x: self.enable_apply(x, EDIT_GFX_LISTEN))
|
||||
self.gfxdetails.connect("changed-address",
|
||||
@ -1816,7 +1813,7 @@ class vmmDetails(vmmGObjectUI):
|
||||
devobj=devobj)
|
||||
|
||||
def config_graphics_apply(self, devobj):
|
||||
(gtype, port, tlsport, listen,
|
||||
(gtype, port, listen,
|
||||
addr, passwd, gl, rendernode) = self.gfxdetails.get_values()
|
||||
|
||||
kwargs = {}
|
||||
@ -1831,8 +1828,6 @@ class vmmDetails(vmmGObjectUI):
|
||||
kwargs["port"] = port
|
||||
if self.edited(EDIT_GFX_OPENGL):
|
||||
kwargs["gl"] = gl
|
||||
if self.edited(EDIT_GFX_TLSPORT) or self.edited(EDIT_GFX_LISTEN):
|
||||
kwargs["tlsport"] = tlsport
|
||||
if self.edited(EDIT_GFX_RENDERNODE):
|
||||
kwargs["rendernode"] = rendernode
|
||||
if self.edited(EDIT_GFX_TYPE):
|
||||
|
@ -17,7 +17,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
|
||||
__gsignals__ = {
|
||||
"changed-password": (vmmGObjectUI.RUN_FIRST, None, []),
|
||||
"changed-port": (vmmGObjectUI.RUN_FIRST, None, []),
|
||||
"changed-tlsport": (vmmGObjectUI.RUN_FIRST, None, []),
|
||||
"changed-type": (vmmGObjectUI.RUN_FIRST, None, []),
|
||||
"changed-listen": (vmmGObjectUI.RUN_FIRST, None, []),
|
||||
"changed-address": (vmmGObjectUI.RUN_FIRST, None, []),
|
||||
@ -34,14 +33,12 @@ class vmmGraphicsDetails(vmmGObjectUI):
|
||||
self.builder.connect_signals({
|
||||
"on_graphics_type_changed": self._change_graphics_type,
|
||||
"on_graphics_port_auto_toggled": self._change_port_auto,
|
||||
"on_graphics_tlsport_auto_toggled": self._change_tlsport_auto,
|
||||
"on_graphics_use_password": self._change_password_chk,
|
||||
"on_graphics_show_password": self._show_password_chk,
|
||||
|
||||
"on_graphics_listen_type_changed": self._change_graphics_listen,
|
||||
"on_graphics_password_changed": lambda ignore: self.emit("changed-password"),
|
||||
"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_opengl_toggled": self._change_opengl,
|
||||
"on_graphics_rendernode_changed": lambda ignore: self.emit("changed-rendernode")
|
||||
@ -114,17 +111,9 @@ class vmmGraphicsDetails(vmmGObjectUI):
|
||||
|
||||
def _get_config_graphics_ports(self):
|
||||
port = uiutil.spin_get_helper(self.widget("graphics-port"))
|
||||
tlsport = uiutil.spin_get_helper(self.widget("graphics-tlsport"))
|
||||
gtype = uiutil.get_list_selection(self.widget("graphics-type"))
|
||||
|
||||
if self.widget("graphics-port-auto").get_active():
|
||||
port = -1
|
||||
if self.widget("graphics-tlsport-auto").get_active():
|
||||
tlsport = -1
|
||||
|
||||
if gtype != "spice":
|
||||
tlsport = None
|
||||
return port, tlsport
|
||||
return port
|
||||
|
||||
|
||||
##############
|
||||
@ -145,14 +134,13 @@ class vmmGraphicsDetails(vmmGObjectUI):
|
||||
|
||||
self._change_ports()
|
||||
self.widget("graphics-port-auto").set_active(True)
|
||||
self.widget("graphics-tlsport-auto").set_active(True)
|
||||
self.widget("graphics-password").set_text("")
|
||||
self.widget("graphics-password").set_sensitive(False)
|
||||
self.widget("graphics-password-chk").set_active(False)
|
||||
|
||||
def get_values(self):
|
||||
gtype = uiutil.get_list_selection(self.widget("graphics-type"))
|
||||
port, tlsport = self._get_config_graphics_ports()
|
||||
port = self._get_config_graphics_ports()
|
||||
listen = uiutil.get_list_selection(self.widget("graphics-listen-type"))
|
||||
addr = uiutil.get_list_selection(self.widget("graphics-address"))
|
||||
|
||||
@ -163,7 +151,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, gl, rendernode
|
||||
return gtype, port, listen, addr, passwd, gl, rendernode
|
||||
|
||||
def set_dev(self, gfx):
|
||||
self.reset_state()
|
||||
@ -210,8 +198,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
|
||||
self.widget("graphics-password").set_sensitive(use_passwd)
|
||||
|
||||
if is_spice:
|
||||
set_port("graphics-tlsport", gfx.tlsPort)
|
||||
|
||||
opengl_warning = ""
|
||||
rendernode_warning = ""
|
||||
opengl_supported = self.conn.support.conn_spice_gl()
|
||||
@ -292,8 +278,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
|
||||
|
||||
def _show_rows_from_type(self):
|
||||
hide_all = ["graphics-xauth", "graphics-display", "graphics-address",
|
||||
"graphics-password-box", "graphics-port-box",
|
||||
"graphics-tlsport-box", "graphics-opengl-box"]
|
||||
"graphics-password-box", "graphics-port-box", "graphics-opengl-box"]
|
||||
|
||||
gtype = uiutil.get_list_selection(self.widget("graphics-type"))
|
||||
listen = uiutil.get_list_selection(self.widget("graphics-listen-type"))
|
||||
@ -303,8 +288,6 @@ class vmmGraphicsDetails(vmmGObjectUI):
|
||||
if listen == 'address':
|
||||
vnc_rows.extend(["graphics-port-box", "graphics-address"])
|
||||
spice_rows = vnc_rows[:]
|
||||
if listen == 'address':
|
||||
spice_rows.extend(["graphics-tlsport-box"])
|
||||
spice_rows.extend(["graphics-opengl-box"])
|
||||
|
||||
rows = []
|
||||
@ -337,19 +320,11 @@ class vmmGraphicsDetails(vmmGObjectUI):
|
||||
self._change_ports()
|
||||
self.emit("changed-port")
|
||||
|
||||
def _change_tlsport_auto(self, ignore):
|
||||
self.widget("graphics-tlsport-auto").set_inconsistent(False)
|
||||
self._change_ports()
|
||||
self.emit("changed-tlsport")
|
||||
|
||||
def _change_ports(self):
|
||||
is_auto = (self.widget("graphics-port-auto").get_active() or
|
||||
self.widget("graphics-port-auto").get_inconsistent())
|
||||
is_tlsauto = (self.widget("graphics-tlsport-auto").get_active() or
|
||||
self.widget("graphics-tlsport-auto").get_inconsistent())
|
||||
|
||||
self.widget("graphics-port").set_visible(not is_auto)
|
||||
self.widget("graphics-tlsport").set_visible(not is_tlsauto)
|
||||
|
||||
def _change_password_chk(self, ignore=None):
|
||||
if self.widget("graphics-password-chk").get_active():
|
||||
|
@ -774,7 +774,7 @@ class vmmDomain(vmmLibvirtObject):
|
||||
self._redefine_xmlobj(xmlobj)
|
||||
|
||||
def define_graphics(self, devobj, do_hotplug,
|
||||
listen=_SENTINEL, addr=_SENTINEL, port=_SENTINEL, tlsport=_SENTINEL,
|
||||
listen=_SENTINEL, addr=_SENTINEL, port=_SENTINEL,
|
||||
passwd=_SENTINEL, gtype=_SENTINEL,
|
||||
gl=_SENTINEL, rendernode=_SENTINEL):
|
||||
xmlobj = self._make_xmlobj_to_define()
|
||||
@ -789,8 +789,6 @@ class vmmDomain(vmmLibvirtObject):
|
||||
editdev.listen = addr
|
||||
if port != _SENTINEL:
|
||||
editdev.port = port
|
||||
if tlsport != _SENTINEL:
|
||||
editdev.tlsPort = tlsport
|
||||
if passwd != _SENTINEL:
|
||||
editdev.passwd = passwd
|
||||
if gtype != _SENTINEL:
|
||||
|
Loading…
Reference in New Issue
Block a user