Skip to content

Commit

Permalink
Fixed bugs / исправлены ошибки
Browse files Browse the repository at this point in the history
1. Настройки теперь должны сохраняться корректно /  The settings should now be saved correctly
2. После перезагрузки плагинов теперь пункт меню в разделе Сервис больше не дублируется / After reload the plugins, the menu item in the tools menu is no longer duplicated
  • Loading branch information
alekssamos committed Aug 29, 2021
1 parent d92c935 commit ced6184
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Дополнение Яндекс.Переводчик для NVDA

[Скачать версию 2021.08.14](https://github.com/alekssamos/YandexTranslate/releases/latest/download/YandexTranslate-2021.08.14.nvda-addon)
[Скачать версию 2021.08.29](https://github.com/alekssamos/YandexTranslate/releases/latest/download/YandexTranslate-2021.08.29.nvda-addon)

После установки зайдите в **NVDA меню**, **Параметры**, **Жесты ввода**,
назначте удобные вам сочетания клавиш для YandexTranslate. Или используйте уже предустановленные (ниже).
Expand Down
2 changes: 1 addition & 1 deletion addon/doc/en/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Дополнение Яндекс.Переводчик для NVDA

[Скачать версию 2021.08.14](https://github.com/alekssamos/YandexTranslate/releases/latest/download/YandexTranslate-2021.08.14.nvda-addon)
[Скачать версию 2021.08.29](https://github.com/alekssamos/YandexTranslate/releases/latest/download/YandexTranslate-2021.08.29.nvda-addon)

После установки зайдите в **NVDA меню**, **Параметры**, **Жесты ввода**,
назначте удобные вам сочетания клавиш для YandexTranslate. Или используйте уже предустановленные (ниже).
Expand Down
20 changes: 14 additions & 6 deletions addon/globalPlugins/yandexTranslate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,15 @@ def onReset(self, event):

def onOk(self, event):
config.conf["YandexTranslate"]["api"] = self.apiSel.GetStringSelection().lower()
config.conf["YandexTranslate"]["sourceLang"] = self.sourceLang.GetStringSelection().split()[-1]
config.conf["YandexTranslate"]["primaryTargetLang"] = self.primaryTargetLang.GetStringSelection().split()[-1]
config.conf["YandexTranslate"]["secondaryTargetLang"] = self.secondaryTargetLang.GetStringSelection().split()[-1]
config.conf["YandexTranslate"]["switchLang"] = self.switchLang.GetStringSelection().split()[-1]
config.conf["YandexTranslate"]["sourceLang"] = self.sourceLang.GetStringSelection().split(", ")[-1]
config.conf["YandexTranslate"]["primaryTargetLang"] = self.primaryTargetLang.GetStringSelection().split(", ")[-1]
config.conf["YandexTranslate"]["secondaryTargetLang"] = self.secondaryTargetLang.GetStringSelection().split(", ")[-1]
config.conf["YandexTranslate"]["switchLang"] = self.switchLang.GetStringSelection().split(", ")[-1]
config.conf["YandexTranslate"]["copyToClipBoard"] = self.copyToClipBoard.Value
config.conf["YandexTranslate"]["signals"] = self.signals.Value
config.conf["YandexTranslate"]["useProxy"] = self.useProxy.Value
if self.useProxy.Value:
config.conf["YandexTranslate"]["proxy_protocol"] = self.proxy_protocol.GetStringSelection().split()[-1]
config.conf["YandexTranslate"]["proxy_protocol"] = self.proxy_protocol.GetStringSelection().split(", ")[-1]
config.conf["YandexTranslate"]["proxy_host"] = self.proxy_host.Value.strip()
config.conf["YandexTranslate"]["proxy_port"] = self.proxy_port.Value
config.conf["YandexTranslate"]["proxy_username"] = self.proxy_username.Value.strip()
Expand Down Expand Up @@ -325,9 +325,17 @@ def __init__(self):
pass

# Creates submenu of addon
self.YandexTranslateSettingsItem = gui.mainFrame.sysTrayIcon.toolsMenu.Append(wx.ID_ANY, _("Yandex Translate Settings..."))
gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU,
lambda e: gui.mainFrame._popupSettingsDialog(YandexTranslateSettingsDialog),
gui.mainFrame.sysTrayIcon.toolsMenu.Append(wx.ID_ANY, _("Yandex Translate Settings...")))
self.YandexTranslateSettingsItem)

def terminate(self):
try:
gui.mainFrame.sysTrayIcon.toolsMenu.RemoveItem(
self.YandexTranslateSettingsItem)
except:
pass

def speakDecorator(self, speak):
def my_speak(speechSequence, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion addon/manifest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ summary = "Yandex translator for NVDA"
description = """Translates text using service Yandex Translate."""
author = "alekssamos <aleks-samos@yandex.ru>"
url = https://github.com/alekssamos/YandexTranslate/
version = 2021.08.14
version = 2021.08.29
docFileName = readme.html
minimumNVDAVersion = 2019.3
lastTestedNVDAVersion = 2021.1
Expand Down
2 changes: 1 addition & 1 deletion 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": _("""Translates text using service Yandex Translate."""),
# version
"addon_version": "2021.08.14",
"addon_version": "2021.08.29",
# Author(s)
"addon_author": u"alekssamos <aleks-samos@yandex.ru>",
# URL for the add-on documentation support
Expand Down

0 comments on commit ced6184

Please sign in to comment.