From ced61840947ed8ff46e9f5523c960d487e13aec5 Mon Sep 17 00:00:00 2001 From: alekssamos Date: Sun, 29 Aug 2021 20:52:40 +0300 Subject: [PATCH] =?UTF-8?q?Fixed=20bugs=20/=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BE=D1=88=D0=B8=D0=B1?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Настройки теперь должны сохраняться корректно / The settings should now be saved correctly 2. После перезагрузки плагинов теперь пункт меню в разделе Сервис больше не дублируется / After reload the plugins, the menu item in the tools menu is no longer duplicated --- README.md | 2 +- addon/doc/en/readme.md | 2 +- .../globalPlugins/yandexTranslate/__init__.py | 20 +++++++++++++------ addon/manifest.ini | 2 +- buildVars.py | 2 +- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f3638c2..3e43083 100644 --- a/README.md +++ b/README.md @@ -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. Или используйте уже предустановленные (ниже). diff --git a/addon/doc/en/readme.md b/addon/doc/en/readme.md index f3638c2..3e43083 100644 --- a/addon/doc/en/readme.md +++ b/addon/doc/en/readme.md @@ -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. Или используйте уже предустановленные (ниже). diff --git a/addon/globalPlugins/yandexTranslate/__init__.py b/addon/globalPlugins/yandexTranslate/__init__.py index 64a64d8..9a9e35e 100644 --- a/addon/globalPlugins/yandexTranslate/__init__.py +++ b/addon/globalPlugins/yandexTranslate/__init__.py @@ -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() @@ -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): diff --git a/addon/manifest.ini b/addon/manifest.ini index f29299a..ce70239 100644 --- a/addon/manifest.ini +++ b/addon/manifest.ini @@ -3,7 +3,7 @@ summary = "Yandex translator for NVDA" description = """Translates text using service Yandex Translate.""" author = "alekssamos " url = https://github.com/alekssamos/YandexTranslate/ -version = 2021.08.14 +version = 2021.08.29 docFileName = readme.html minimumNVDAVersion = 2019.3 lastTestedNVDAVersion = 2021.1 diff --git a/buildVars.py b/buildVars.py index e615060..a086fa4 100644 --- a/buildVars.py +++ b/buildVars.py @@ -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 ", # URL for the add-on documentation support