File tree Expand file tree Collapse file tree
qubes_config/global_config Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -200,14 +200,21 @@ def save(self):
200200 if not self .repos :
201201 return
202202 for repo_dict in self .repo_to_widget_mapping :
203- found = False
203+ # the logic here goes: we have two kinds of widgets,
204+ # radio buttons for dom0 update (where we want to enable everything up to
205+ # the selected option)
206+ # checkbuttons for everything else (where we just want to enable/disable
207+ # based on state)
208+ dom0_found = False
204209 for repo , widget in repo_dict .items ():
205- try :
206- if widget . get_active () :
207- found = True
208- self . _set_repository ( repo , True )
210+ state = widget . get_active ()
211+ if "dom0" in repo :
212+ if state :
213+ dom0_found = True
209214 else :
210- self ._set_repository (repo , not found )
215+ state = not dom0_found
216+ try :
217+ self ._set_repository (repo , state )
211218 except RuntimeError as ex :
212219 raise qubesadmin .exc .QubesException (
213220 "Failed to set repository data: " f"{ escape (str (ex ))} "
You can’t perform that action at this time.
0 commit comments