virtManager: Remove network portgroup UI

portgroups are a way to group logical chunks of settings inside
a <network> object. They are a quite advanced feature that I expect
many few users are using, and the ones that are using it are certainly
advanced enough to edit the XML directly.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-01-25 17:57:28 -05:00
parent 8263d5c705
commit 4c3c53f773
6 changed files with 4 additions and 86 deletions

View File

@ -313,10 +313,6 @@ class AddHardware(uiutils.UITestCase):
self.sleep(1)
self.pressKey("Home")
tab.find_fuzzy("plainbridge-portgroups", "menu item").click()
c = tab.find_fuzzy("Portgroup:", "combo box")
c.click_combo_entry()
self.assertTrue(c.find("engineering", "menu item").selected)
self.pressKey("Escape")
finish.click()
uiutils.check_in_loop(lambda: details.active)

View File

@ -264,10 +264,6 @@ class Details(uiutils.UITestCase):
self.pressKey("Home")
tab.find_fuzzy("plainbridge-portgroups",
"menu item").bring_on_screen().click()
c = tab.find_fuzzy("Portgroup:", "combo box")
c.click_combo_entry()
self.assertTrue(c.find("engineering", "menu item").selected)
self.pressKey("Escape")
appl.click()
uiutils.check_in_loop(lambda: not appl.sensitive)

View File

@ -149,40 +149,6 @@
<property name="width">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">False</property>
<property name="label" translatable="yes">_Portgroup:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">net-portgroup</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkComboBox" id="net-portgroup">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="hexpand">True</property>
<property name="has_entry">True</property>
<signal name="changed" handler="on_net_portgroup_changed" swapped="no"/>
<child internal-child="entry">
<object class="GtkEntry" id="combobox-entry2">
<property name="can_focus">True</property>
</object>
</child>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
</packing>
</child>
</object>
<object class="GtkLabel" id="net-source-label">
<property name="visible">True</property>

View File

@ -1664,8 +1664,7 @@ class vmmDetails(vmmGObjectUI):
kwargs["model"] = model
if self.edited(EDIT_NET_SOURCE):
(kwargs["ntype"], kwargs["source"],
kwargs["mode"], kwargs["portgroup"]) = (
(kwargs["ntype"], kwargs["source"], kwargs["mode"]) = (
self.netlist.get_network_selection())
if self.edited(EDIT_NET_MAC):

View File

@ -79,7 +79,6 @@ class vmmNetworkList(vmmGObjectUI):
self.builder.connect_signals({
"on_net_source_changed": self._on_net_source_changed,
"on_net_source_mode_changed": self._emit_changed,
"on_net_portgroup_changed": self._emit_changed,
"on_net_bridge_name_changed": self._emit_changed,
})
@ -129,12 +128,6 @@ class vmmNetworkList(vmmGObjectUI):
model.append(["passthrough", _("Passthrough")])
combo.set_active(0)
combo = self.widget("net-portgroup")
# [xml value, label]
model = Gtk.ListStore(str, str)
combo.set_model(model)
uiutil.init_combo_text_column(combo, 1)
self.conn.connect("net-added", self._repopulate_network_list)
self.conn.connect("net-removed", self._repopulate_network_list)
self.conn.connect("interface-added", self._repopulate_network_list)
@ -350,14 +343,10 @@ class vmmNetworkList(vmmGObjectUI):
if self.widget("net-source-mode").is_visible():
mode = uiutil.get_list_selection(self.widget("net-source-mode"))
portgroup = None
if self.widget("net-portgroup").is_visible():
portgroup = uiutil.get_list_selection(self.widget("net-portgroup"))
return net_type, net_src, mode, portgroup or None
return net_type, net_src, mode
def build_device(self, macaddr, model=None):
nettype, devname, mode, portgroup = self.get_network_selection()
nettype, devname, mode = self.get_network_selection()
net = virtinst.DeviceInterface(self.conn.get_backend())
net.type = nettype
@ -365,7 +354,6 @@ class vmmNetworkList(vmmGObjectUI):
net.macaddr = macaddr
net.model = model
net.source_mode = mode
net.portgroup = portgroup
return net
@ -388,7 +376,6 @@ class vmmNetworkList(vmmGObjectUI):
self.widget("net-bridge-name").set_text("")
self.widget("net-source-mode").set_active(0)
self.widget("net-portgroup").get_child().set_text("")
def set_dev(self, net):
self.reset_state()
@ -426,9 +413,6 @@ class vmmNetworkList(vmmGObjectUI):
combo.set_active_iter(rowiter)
combo.emit("changed")
if net.portgroup:
uiutil.set_list_selection(self.widget("net-portgroup"), net.portgroup)
#############
# Listeners #
@ -467,19 +451,6 @@ class vmmNetworkList(vmmGObjectUI):
netlist.set_active(default_idx)
def _populate_portgroups(self, portgroups):
combo = self.widget("net-portgroup")
model = combo.get_model()
model.clear()
default = None
for p in portgroups:
model.append([p.name, p.name])
if p.default:
default = p.name
uiutil.set_list_selection(combo, default)
def _on_net_source_changed(self, src):
ignore = src
self._emit_changed()
@ -498,12 +469,3 @@ class vmmNetworkList(vmmGObjectUI):
show_bridge = row[NET_ROW_MANUAL]
uiutil.set_grid_row_visible(
self.widget("net-bridge-name"), show_bridge)
portgroups = []
connkey = row[NET_ROW_CONNKEY]
if connkey and nettype == virtinst.DeviceInterface.TYPE_VIRTUAL:
portgroups = self.conn.get_net(connkey).get_xmlobj().portgroups
uiutil.set_grid_row_visible(
self.widget("net-portgroup"), bool(portgroups))
self._populate_portgroups(portgroups)

View File

@ -703,7 +703,7 @@ class vmmDomain(vmmLibvirtObject):
def define_network(self, devobj, do_hotplug,
ntype=_SENTINEL, source=_SENTINEL,
mode=_SENTINEL, model=_SENTINEL,
portgroup=_SENTINEL, macaddr=_SENTINEL, linkstate=_SENTINEL):
macaddr=_SENTINEL, linkstate=_SENTINEL):
xmlobj = self._make_xmlobj_to_define()
editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
if not editdev:
@ -715,7 +715,6 @@ class vmmDomain(vmmLibvirtObject):
editdev.type = ntype
editdev.source = source
editdev.source_mode = mode or None
editdev.portgroup = portgroup or None
if model != _SENTINEL:
if editdev.model != model: