Only use Unicode checkmark if in X
This commit is contained in:
parent
91649f5ee7
commit
575fa17425
2 changed files with 10 additions and 4 deletions
|
|
@ -781,6 +781,9 @@ def menu_ddrescue(source_path, dest_path, run_mode):
|
|||
|
||||
def menu_main(state):
|
||||
"""Main menu is used to set ddrescue settings."""
|
||||
checkmark = '*'
|
||||
if 'DISPLAY' in global_vars['Env']:
|
||||
checkmark = '✓'
|
||||
title = '{GREEN}ddrescue TUI: Main Menu{CLEAR}\n\n'.format(**COLORS)
|
||||
title += '{BLUE}Current pass: {CLEAR}'.format(**COLORS)
|
||||
|
||||
|
|
@ -804,8 +807,8 @@ def menu_main(state):
|
|||
while True:
|
||||
# Update entries
|
||||
for opt in main_options:
|
||||
opt['Name'] = '{} {}'.format(
|
||||
'[✓]' if opt['Enabled'] else '[ ]',
|
||||
opt['Name'] = '[{}] {}'.format(
|
||||
checkmark if opt['Enabled'] else ' ',
|
||||
opt['Base Name'])
|
||||
|
||||
selection = menu_select(
|
||||
|
|
|
|||
|
|
@ -751,6 +751,9 @@ def get_read_rate(s):
|
|||
def menu_diags(state, args):
|
||||
"""Main menu to select and run HW tests."""
|
||||
args = [a.lower() for a in args]
|
||||
checkmark = '*'
|
||||
if 'DISPLAY' in global_vars['Env']:
|
||||
checkmark = '✓'
|
||||
title = '{}\nMain Menu'.format(TOP_PANE_TEXT)
|
||||
# NOTE: Changing the order of main_options will break everything
|
||||
main_options = [
|
||||
|
|
@ -819,8 +822,8 @@ def menu_diags(state, args):
|
|||
# Update checkboxes
|
||||
for opt in main_options:
|
||||
_nvme_smart = opt['Base Name'] == 'NVMe / SMART'
|
||||
opt['Name'] = '{} {} {}'.format(
|
||||
'[✓]' if opt['Enabled'] else '[ ]',
|
||||
opt['Name'] = '[{}] {} {}'.format(
|
||||
checkmark if opt['Enabled'] else ' ',
|
||||
opt['Base Name'],
|
||||
QUICK_LABEL if state.quick_mode and _nvme_smart else '')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue