From 575fa174257b9d19cad8d03b1b4e62ffd674cb0c Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Fri, 28 Dec 2018 15:44:14 -0700 Subject: [PATCH] Only use Unicode checkmark if in X --- .bin/Scripts/functions/ddrescue.py | 7 +++++-- .bin/Scripts/functions/hw_diags.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.bin/Scripts/functions/ddrescue.py b/.bin/Scripts/functions/ddrescue.py index a2b27e5e..f6c30e0a 100644 --- a/.bin/Scripts/functions/ddrescue.py +++ b/.bin/Scripts/functions/ddrescue.py @@ -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( diff --git a/.bin/Scripts/functions/hw_diags.py b/.bin/Scripts/functions/hw_diags.py index 155031ec..fae78b21 100644 --- a/.bin/Scripts/functions/hw_diags.py +++ b/.bin/Scripts/functions/hw_diags.py @@ -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 '')