Skip to content

Commit

Permalink
UI refine for variable menu and delete variables
Browse files Browse the repository at this point in the history
1. show variable menu only in admin mode
2. show error log in status box if var is not del successfully
  • Loading branch information
kanechen66 committed Nov 5, 2024
1 parent 8500345 commit e6f697b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions SetupDataPkg/Tools/ConfigEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,11 @@ def del_all_variable_runtime(self):
schema = Schema.load(self.config_xml_path)
for knob in schema.knobs:
self.output_current_status(f"Delete variable {knob.name} with namespace {knob.namespace}")
uefi_var_write.delete_var_by_guid_name(knob.name, knob.namespace)
self.output_current_status(f"{knob.name} variable is deleted from system")
rc = uefi_var_write.delete_var_by_guid_name(knob.name, knob.namespace)
if rc == 0:
self.output_current_status(f"{knob.name} variable was not deleted from system {rc}")
else:
self.output_current_status(f"{knob.name} variable is deleted from system")

def load_delta_file(self, path):
# assumption is there may be multiple xml files
Expand Down Expand Up @@ -959,8 +962,9 @@ def load_cfg_file(self, path, file_id, clear_config):
for menu in self.menu_string:
self.file_menu.entryconfig(menu, state="normal")

for menu in self.variable_menu_string:
self.variable_menu.entryconfig(menu, state="normal")
if self.admin_mode:
for menu in self.variable_menu_string:
self.variable_menu.entryconfig(menu, state="normal")

self.config_xml_path = path
self.output_current_status(f"{path} file is loaded")
Expand Down

0 comments on commit e6f697b

Please sign in to comment.