createvm: Only check network selection on final page

Otherwise early 'change' signals can give inconsistent
behavior WRT default 'advanced' expander state

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson
2020-09-01 13:32:47 -04:00
parent b3fb88e345
commit e4c0191f83
2 changed files with 5 additions and 9 deletions

View File

@@ -664,7 +664,6 @@ class vmmCreateVM(vmmGObjectUI):
self._netlist = vmmNetworkList(self.conn, self.builder, self.topwin)
self.widget("netdev-ui-align").add(self._netlist.top_box)
self._netlist.connect("changed", self._netdev_changed)
self._netlist.reset_state()
def _conn_state_changed(self, conn):
@@ -980,7 +979,10 @@ class vmmCreateVM(vmmGObjectUI):
self.widget("summary-cpu").set_text(cpu)
self._populate_summary_storage()
self._netdev_changed(None)
ignore, nsource, ignore = self._netlist.get_network_selection()
expand = not nsource
if expand:
self.widget("advanced-expander").set_expanded(True)
################################
@@ -1247,13 +1249,6 @@ class vmmCreateVM(vmmGObjectUI):
"for name=%s", newname, exc_info=True)
def _netdev_changed(self, ignore):
ignore, nsource, ignore = self._netlist.get_network_selection()
expand = not nsource
if expand:
self.widget("advanced-expander").set_expanded(True)
# Enable/Disable container source URL entry on checkbox click
def _container_source_toggle(self, ignore):
enable_src = self.widget("install-oscontainer-bootstrap").get_active()

View File

@@ -352,6 +352,7 @@ class vmmNetworkList(vmmGObjectUI):
netlist.set_active_iter(row.iter)
return
print(default_idx)
netlist.set_active(default_idx)