Fixed broken menus
This commit is contained in:
parent
c78172ede0
commit
0416f83448
4 changed files with 12 additions and 7 deletions
|
|
@ -37,11 +37,10 @@ if __name__ == '__main__':
|
||||||
{'Name': 'Quit', 'Letter': 'Q'},
|
{'Name': 'Quit', 'Letter': 'Q'},
|
||||||
]
|
]
|
||||||
|
|
||||||
# Main loop
|
|
||||||
while True:
|
while True:
|
||||||
selection = menu_select(
|
selection = menu_select(
|
||||||
'{}: Windows Activation Menu'.format(KIT_NAME_FULL),
|
'{}: Windows Activation Menu'.format(KIT_NAME_FULL),
|
||||||
activation_methods, actions)
|
main_entries=activation_methods, action_entries=actions)
|
||||||
|
|
||||||
if (selection.isnumeric()):
|
if (selection.isnumeric()):
|
||||||
activation_methods[int(selection)-1]['Function']()
|
activation_methods[int(selection)-1]['Function']()
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,9 @@ if __name__ == '__main__':
|
||||||
{'Name': 'Schedule CHKDSK scan (offline repair)', 'Repair': True}]
|
{'Name': 'Schedule CHKDSK scan (offline repair)', 'Repair': True}]
|
||||||
actions = [{'Name': 'Quit', 'Letter': 'Q'}]
|
actions = [{'Name': 'Quit', 'Letter': 'Q'}]
|
||||||
selection = menu_select(
|
selection = menu_select(
|
||||||
'{}: Check Disk Menu\n'.format(KIT_NAME_FULL), options, actions)
|
'{}: Check Disk Menu\n'.format(KIT_NAME_FULL),
|
||||||
|
main_entries=options,
|
||||||
|
action_entries=actions)
|
||||||
print_info('{}: Check Disk Menu\n'.format(KIT_NAME_FULL))
|
print_info('{}: Check Disk Menu\n'.format(KIT_NAME_FULL))
|
||||||
if selection == 'Q':
|
if selection == 'Q':
|
||||||
abort()
|
abort()
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,15 @@ if __name__ == '__main__':
|
||||||
'GenericRepair': 'Repaired',
|
'GenericRepair': 'Repaired',
|
||||||
'UnsupportedOSError': 'Unsupported OS',
|
'UnsupportedOSError': 'Unsupported OS',
|
||||||
}}
|
}}
|
||||||
|
disabled = bool(global_vars['OS']['Version'] not in ['8', '10'])
|
||||||
options = [
|
options = [
|
||||||
{'Name': 'Check Health', 'Repair': False},
|
{'Name': 'Check Health', 'Repair': False, 'Disabled': disabled},
|
||||||
{'Name': 'Restore Health', 'Repair': True}]
|
{'Name': 'Restore Health', 'Repair': True, 'Disabled': disabled}]
|
||||||
actions = [{'Name': 'Quit', 'Letter': 'Q'}]
|
actions = [{'Name': 'Quit', 'Letter': 'Q'}]
|
||||||
selection = menu_select(
|
selection = menu_select(
|
||||||
'{}: DISM Menu\n'.format(KIT_NAME_FULL), options, actions)
|
'{}: DISM Menu\n'.format(KIT_NAME_FULL),
|
||||||
|
main_entries=options,
|
||||||
|
action_entries=actions)
|
||||||
print_info('{}: DISM Menu\n'.format(KIT_NAME_FULL))
|
print_info('{}: DISM Menu\n'.format(KIT_NAME_FULL))
|
||||||
if selection == 'Q':
|
if selection == 'Q':
|
||||||
abort()
|
abort()
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ class UnsupportedOSError(Exception):
|
||||||
def abort():
|
def abort():
|
||||||
"""Abort script."""
|
"""Abort script."""
|
||||||
print_warning('Aborted.')
|
print_warning('Aborted.')
|
||||||
|
sleep(5)
|
||||||
exit_script()
|
exit_script()
|
||||||
|
|
||||||
def ask(prompt='Kotaero!'):
|
def ask(prompt='Kotaero!'):
|
||||||
|
|
@ -234,7 +235,7 @@ def menu_select(title='~ Untitled Menu ~',
|
||||||
width = width,
|
width = width,
|
||||||
name = entry.get('Display Name', entry['Name']))
|
name = entry.get('Display Name', entry['Name']))
|
||||||
if entry.get('Disabled', False):
|
if entry.get('Disabled', False):
|
||||||
entry_str = '{YELLOW}{entry_str} ({disabled}){CLEAR}\n'.format(
|
entry_str = '{YELLOW}{entry_str} ({disabled}){CLEAR}'.format(
|
||||||
entry_str = entry_str,
|
entry_str = entry_str,
|
||||||
disabled = disabled_label,
|
disabled = disabled_label,
|
||||||
**COLORS)
|
**COLORS)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue