Skip to content

Commit

Permalink
Compatibility with NVDA 2019.3. Replaced win32clipboard by api.copyTo…
Browse files Browse the repository at this point in the history
…Clip.
  • Loading branch information
javidominguez committed Jan 12, 2020
1 parent 49e7687 commit a770ba3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions addon/globalPlugins/fenCodeReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
import api
import ui
import textInfos
import win32clipboard
import versionInfo
if versionInfo.version_year < 2019:
import win32clipboard
from time import sleep
from threading import Thread
import fen
from . import fen

addonHandler.initTranslation()

Expand Down Expand Up @@ -51,11 +53,14 @@ def describeBoard(self, copyToClipboard=False):
c = c+1
if description:
if copyToClipboard:
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(description)
win32clipboard.CloseClipboard()
ui.message(_("Copied to clipboard"))
if not api.copyToClip(description) and versionInfo.version_year < 2019:
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardText(description)
win32clipboard.CloseClipboard()
ui.message(_("Copied to clipboard"))
else:
ui.message(_("Copied to clipboard"))
ui.message(description)
else:
ui.message(_("Selected text doesn't contains a valid FEN code"))
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" : "1.0.1",
"addon_version" : "1.0.2",
# Author(s)
"addon_author" : u"Javi Dominguez <[email protected]>",
# URL for the add-on documentation support
Expand All @@ -29,7 +29,7 @@
# Minimum NVDA version supported (e.g. "2018.3")
"addon_minimumNVDAVersion" : "2018.1.0",
# Last NVDA version supported/tested (e.g. "2018.4", ideally more recent than minimum version)
"addon_lastTestedNVDAVersion" : "2019.2.1",
"addon_lastTestedNVDAVersion" : "2019.3.0",
# Add-on update channel (default is stable or None)
"addon_updateChannel" : None
}
Expand Down

0 comments on commit a770ba3

Please sign in to comment.