From df9a5b7b190109553040868be03b5f8833c45087 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Sat, 10 Feb 2024 08:02:08 -0500 Subject: [PATCH 1/4] cli: catch assertion errors when reading setting values from devices --- lib/solaar/cli/show.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/solaar/cli/show.py b/lib/solaar/cli/show.py index 8ba74f8fcc..9b204d0ab1 100644 --- a/lib/solaar/cli/show.py +++ b/lib/solaar/cli/show.py @@ -243,6 +243,8 @@ def _print_device(dev, num=None): v = setting.val_to_string(setting.read(False)) except _hidpp20.FeatureCallError as e: v = 'HID++ error ' + str(e) + except AssertionError as e: + v = 'AssertionError ' + str(e) print(' %s : %s' % (setting.label, v)) if dev.online and dev.keys: From 8811374ed90fa8b3e650dd9e358d570e0af8571e Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Sat, 10 Feb 2024 08:40:17 -0500 Subject: [PATCH 2/4] ui: don't lock setting when an error occurs --- lib/solaar/ui/config_panel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/solaar/ui/config_panel.py b/lib/solaar/ui/config_panel.py index ac9e399911..e95ac610fa 100644 --- a/lib/solaar/ui/config_panel.py +++ b/lib/solaar/ui/config_panel.py @@ -711,15 +711,15 @@ def _create_sbox(s, device): def _update_setting_item(sbox, value, is_online=True, sensitive=True, nullOK=False): # sbox._spinner.set_visible(False) # don't repack item box sbox._spinner.stop() + sensitive = sbox._change_icon._allowed if sensitive is None else sensitive if value is None and not nullOK: - sbox._control.set_sensitive(False) - _change_icon(False, sbox._change_icon) + sbox._control.set_sensitive(sensitive is True) + _change_icon(sensitive, sbox._change_icon) sbox._failed.set_visible(is_online) return sbox._failed.set_visible(False) sbox._control.set_sensitive(False) sbox._control.set_value(value) - sensitive = sbox._change_icon._allowed if sensitive is None else sensitive sbox._control.set_sensitive(sensitive is True) _change_icon(sensitive, sbox._change_icon) From 26e0153fceef8d793218d4ce19b23a9518e7b642 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Sat, 10 Feb 2024 09:08:51 -0500 Subject: [PATCH 3/4] ui: update label and tooltip for divert-gkeys setting --- lib/logitech_receiver/settings_templates.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/logitech_receiver/settings_templates.py b/lib/logitech_receiver/settings_templates.py index 39b76c1d42..f38ebb43b7 100644 --- a/lib/logitech_receiver/settings_templates.py +++ b/lib/logitech_receiver/settings_templates.py @@ -596,11 +596,8 @@ class CrownSmooth(_Setting): class DivertGkeys(_Setting): name = 'divert-gkeys' - label = _('Divert G Keys') - description = ( - _('Make G keys send GKEY HID++ notifications (which trigger Solaar rules but are otherwise ignored).') + '\n' + - _('May also make M keys and MR key send HID++ notifications') - ) + label = _('Divert G and M Keys') + description = (_('Make G and M keys send HID++ notifications (which can trigger Solaar rules but are otherwise ignored).')) feature = _F.GKEY validator_options = {'true_value': 0x01, 'false_value': 0x00, 'mask': 0xff} From 8b1463c8f41f48788d532f199cd8b2b1d4a7b0c3 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Sat, 10 Feb 2024 09:09:28 -0500 Subject: [PATCH 4/4] ui: update label and tooltip for divert-gkeys setting --- lib/logitech_receiver/settings_templates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logitech_receiver/settings_templates.py b/lib/logitech_receiver/settings_templates.py index f38ebb43b7..e63e7fe2db 100644 --- a/lib/logitech_receiver/settings_templates.py +++ b/lib/logitech_receiver/settings_templates.py @@ -597,7 +597,7 @@ class CrownSmooth(_Setting): class DivertGkeys(_Setting): name = 'divert-gkeys' label = _('Divert G and M Keys') - description = (_('Make G and M keys send HID++ notifications (which can trigger Solaar rules but are otherwise ignored).')) + description = (_('Make G and M keys send HID++ notifications (which trigger Solaar rules but are otherwise ignored).')) feature = _F.GKEY validator_options = {'true_value': 0x01, 'false_value': 0x00, 'mask': 0xff}