diff --git a/source/synthSettingsRing.py b/source/synthSettingsRing.py index 70c7a730236..71b0f1f5dc1 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 - 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 + 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