Skip to content

Commit

Permalink
Speech on demand feature implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
Javi Domínguez committed Jan 7, 2024
1 parent 48c5a0e commit 06c2484
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion addon/globalPlugins/FENCodeReader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
import config
import ui
import textInfos
import speech
import versionInfo
if versionInfo.version_year < 2019:
import win32clipboard
from time import sleep
from threading import Thread
from scriptHandler import script
from . import fen
from ._gui import *

Expand All @@ -35,6 +37,8 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin):

scriptCategory = "FEN reader"

speechOnDemand = {"speakOnDemand": True} if hasattr(speech.speech.SpeechMode, "onDemand") else {}

def __init__(self, *args, **kwargs):
super(GlobalPlugin, self).__init__(*args, **kwargs)
if hasattr(settingsDialogs, 'SettingsPanel'):
Expand Down Expand Up @@ -120,7 +124,8 @@ def describeBoard(self):
ui.message(_("Selected text doesn't contains a valid FEN code"))
else:
ui.message(_("There is not selected text"))


@script(**speechOnDemand)
def script_describeBoard(self, gesture):
self.describeBoard()
# Translators: Message presented in input help mode.
Expand Down
4 changes: 2 additions & 2 deletions buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
"addon_description" : _("This addon translates a chess game position from FEN code to human friendly description"),
# version
"addon_version" : "2024.0.1",
"addon_version" : "2024.0.2",
# Author(s)
"addon_author" : u"Javi Dominguez <[email protected]>",
# URL for the add-on documentation support
Expand All @@ -31,7 +31,7 @@
# Last NVDA version supported/tested (e.g. "2018.4", ideally more recent than minimum version)
"addon_lastTestedNVDAVersion" : "2024.1.0",
# Add-on update channel (default is stable or None)
"addon_updateChannel" : "dev"
"addon_updateChannel" : None
}


Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* Updated manifest: last tested NVDA version 2023.1
* Speech on demand feature implemented.

0 comments on commit 06c2484

Please sign in to comment.