Skip to content

Commit

Permalink
Fixed Apply behavior for VM Settings
Browse files Browse the repository at this point in the history
VM Setting will now update (current) markers correctly after Apply.

fixes QubesOS/qubes-issues#5531

(cherry picked from commit f4f7611)
  • Loading branch information
marmarta committed Jan 30, 2020
1 parent 3e15b29 commit ed218af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qubesmanager/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,15 @@ def save_changes(self):
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)
Expand Down
5 changes: 5 additions & 0 deletions qubesmanager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ def prepare_choice(widget, holder, propname, choice, default,

# 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}, '
Expand Down

0 comments on commit ed218af

Please sign in to comment.