Fixed Apply behavior for VM Settings

VM Setting will now update (current) markers correctly after Apply.

fixes QubesOS/qubes-issues#5531
This commit is contained in:
Marta Marczykowska-Górecka 2020-01-08 21:20:27 +01:00
parent cca5d7d785
commit f4f76110f0
No known key found for this signature in database
GPG Key ID: 9A752C30B26FD04B
2 changed files with 14 additions and 0 deletions

View File

@ -272,6 +272,15 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtWidgets.QDialog):
def apply(self):
self.save_changes()
# these signals must be disconnected to avoid unintended behavior
# on refreshing the drop-downs
self.netVM.currentIndexChanged.disconnect()
self.kernel.currentIndexChanged.disconnect()
self.default_dispvm.currentIndexChanged.disconnect()
self.__init_basic_tab__()
self.__init_advanced_tab__()
def save_and_apply(self):
self.save_changes()
self.done(0)

View File

@ -45,6 +45,11 @@ def prepare_choice(widget, holder, propname, choice, default,
allow_none=False, transform=None):
# for newly created vms, set propname to None
# clear the widget, so that prepare_choice functions can be used
# to refresh widget values
while widget.count() > 0:
widget.removeItem(0)
debug(
'prepare_choice(widget={widget!r}, '
'holder={holder!r}, '