Repository: nvaccess/nvda

Issue:
Removal of VoiceSettingsSlider breaks AudioThemes3d add-on
<!--
Please thoroughly read NVDA's wiki article on how to fill in this template, including how to provide the required files.
Issues may be closed if the required information is not present.
https://github.com/nvaccess/nvda/wiki/Github-issue-template-explanation-and-examples
-->

### Steps to reproduce:
Running NVDA 2019.2beta2:
* Install the audioThemes3d add-on from https://addons.nvda-project.org/addons/AudioThemes3D.en.html
* Restart NVDA

### Actual behavior:
The audioThemes add-on fails to load due to the following traceback:
```
Traceback (most recent call last): 
 File "globalPluginHandler.pyo", line 22, in listPlugins 
 File "C:\nvdaclean\userConfig\addons\AudioThemes3D\globalPlugins\audioThemes\__init__.py", line 23, in <module> 
 File "C:\nvdaclean\userConfig\addons\AudioThemes3D\globalPlugins\audioThemes\dialogs\manage_dg.py", line 17, in <module> 
ImportError: cannot import name VoiceSettingsSlider 
```

### Expected behavior:
The add-on should load. and work the same as in NVDA 2019.1.1
 
### System configuration
#### NVDA installed/portable/running from source:
Installed

#### NVDA version:
2019.2beta2

### Further info
This broke with the merging of pr #8214, where synth and braille GUI settings were abstracted.

It should be easy enough to replace VoiceSettingsSlider back in gui/settingsDialogs.py, but perhaps add a deprication warning when it is constructed.

This seems to be the only thing from gui/settingsDialogs.py that audioThemes3d relied upon. However other add-ons could have been using other things.

The easiest thing to do here would be to just up the aadd-on api version for 2019.2 so that all add-ons need to be checked and re-versioned. However, if it is as simple as putting back one or more of these classes and marking them as deprecated then we should consider this option.
Thoughts @leonardder?






Discussion:
For whatever it's worth, I vote against an add-on version bump for 2019.2 (add-ons will already break once this year for threshold and more than that could pose a challenge for users, especially those less technically inclined). Could you add in deprecation warnings and then just remove the fallback classes in threshold?
The other option is to also revert #8214 and instead merge that pr into 
Threshold.



This is interesting. I recall writing a patch for this, but it seems that never got through. I can dig it up and file a pr against beta. In any case, I'd vote for the deprecation warning option.
Having said that, audio themes seems pretty unmaintained, I've seen that add-on use more deprecated code.

Hi, last time I brought this up on add-ons list, someone pointed out another person was working on making this add-on compatible. I think it would be best to go with deprecation warning or leave it up to the new add-on maintainer to invest in updating this add-on. Thanks.

 

From: Leonard de Ruijter <notifications@github.com> 
Sent: Wednesday, June 26, 2019 8:53 PM
To: nvaccess/nvda <nvda@noreply.github.com>
Cc: Subscribed <subscribed@noreply.github.com>
Subject: Re: [nvaccess/nvda] Removal of VoiceSettingsSlider breaks AudioThemes3d add-on (#9824)

 

This is interesting. I recall writing a patch for this, but it seems that never got through. I can dig it up and file a pr against beta. In any case, I'd vote for the deprecation warning option.
Having said that, audio themes seems pretty unmaintained, I've seen that add-on use more deprecated code.



—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/9824?email_source=notifications&email_token=AB4AXEGJJSSRHQFW2DPYR4DP4Q2RJA5CNFSM4H3XBHV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYVS2PI#issuecomment-506146109> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AB4AXEEXBAYKNNU2AVPUSPTP4Q2RJANCNFSM4H3XBHVQ> .



Resolving patch:
diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -48,6 +48,7 @@
 import time
 import keyLabels
 from dpiScalingHelper import DpiScalingHelperMixin
+import warnings
 
 class SettingsDialog(with_metaclass(guiHelper.SIPABCMeta, wx.Dialog, DpiScalingHelperMixin)):
 	"""A settings dialog.
@@ -3337,3 +3338,11 @@ def onOk(self, evt):
 					_("Error"), wx.OK | wx.ICON_ERROR)
 
 		super(InputGesturesDialog, self).onOk(evt)
+
+class VoiceSettingsSlider(nvdaControls.EnhancedInputSlider):
+	"""@Deprecated: use L{gui.NVDAControls.EnhancedInputSlider} instead."""
+
+	def __init__(self,*args, **kwargs):
+		warnings.warn("gui.settingsDialogs.VoiceSettingsSlider is deprecated. Use gui.NVDAControls.EnhancedInputSlider instead",
+			DeprecationWarning, stacklevel=2)
+		super(VoiceSettingsSlider,self).__init__(*args,**kwargs)


Test patch: