From badbfcca3acf1d7c0dd9f88ebe49f9645a29cf65 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Fri, 9 Feb 2024 11:16:48 +1100 Subject: [PATCH 1/2] fix minor bug in synth settings ring --- source/synthSettingsRing.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/source/synthSettingsRing.py b/source/synthSettingsRing.py index 70c7a730236..52d1302b3b8 100644 --- a/source/synthSettingsRing.py +++ b/source/synthSettingsRing.py @@ -1,8 +1,15 @@ +# A part of NonVisual Desktop Access (NVDA) +# This file is covered by the GNU General Public License. +# See the file COPYING for more details. +# Copyright (C) 2006-2024 NV Access Limited + +from typing import Any + +from autoSettingsUtils.driverSetting import BooleanDriverSetting, NumericDriverSetting import baseObject import config -import synthDriverHandler import queueHandler -from autoSettingsUtils.driverSetting import BooleanDriverSetting, NumericDriverSetting +import synthDriverHandler class SynthSetting(baseObject.AutoPropertyObject): @@ -85,12 +92,15 @@ def _set_value(self, val): def _getReportValue(self, val): return _("on") if val else _("off") + class SynthSettingsRing(baseObject.AutoPropertyObject): """ - A synth settings ring which enables the user to change to the next and previous settings and ajust the selected one + A synth settings ring which enables the user to change to the next and previous settings and adjust the selected one. It was written to facilitate the implementation of a way to change the settings resembling the window-eyes way. """ + settings: list[SynthSetting] | None + def __init__(self,synth): try: self._current = synth.initialSettingsRingSetting @@ -107,9 +117,9 @@ def _get_currentSettingName(self): def _get_currentSettingValue(self): return self.settings[self._current].reportValue - def _set_currentSettingValue(self,value): + def _set_currentSettingValue(self, value: Any): if self._current is not None: - self.settings[_current].value = val + self.settings[self._current].value = value def next(self): """ changes to the next setting and returns its name """ @@ -145,7 +155,7 @@ def updateSupportedSettings(self,synth): if self._current is not None and hasattr(self,'settings') else None ) - list = [] + list: list[SynthSetting] = [] for s in synth.supportedSettings: if not s.availableInSettingsRing: continue if prevID == s.id: #restore the last setting From 8cd835f910ab69fb1431e5958e62491402406760 Mon Sep 17 00:00:00 2001 From: Sean Budd Date: Fri, 9 Feb 2024 12:35:33 +1100 Subject: [PATCH 2/2] fix lint --- source/synthSettingsRing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/synthSettingsRing.py b/source/synthSettingsRing.py index 52d1302b3b8..71b0f1f5dc1 100644 --- a/source/synthSettingsRing.py +++ b/source/synthSettingsRing.py @@ -95,8 +95,8 @@ def _getReportValue(self, val): class SynthSettingsRing(baseObject.AutoPropertyObject): """ - A synth settings ring which enables the user to change to the next and previous settings and adjust the selected one. - It was written to facilitate the implementation of a way to change the settings resembling the window-eyes way. + A synth settings ring which enables the user to change to the next and previous settings, + as well as adjust the selected one. """ settings: list[SynthSetting] | None