diff --git a/addon/globalPlugins/emoticons/__init__.py b/addon/globalPlugins/emoticons/__init__.py index c845e4d..4103558 100644 --- a/addon/globalPlugins/emoticons/__init__.py +++ b/addon/globalPlugins/emoticons/__init__.py @@ -35,7 +35,6 @@ confspec = { "announcement": "integer(default=0)", "cleanDicts": "boolean(default=False)", - "onlyNormalConfiguration": "boolean(default=False)", } config.conf.spec["emoticons"] = confspec @@ -46,7 +45,6 @@ def activateAnnouncement(): speechDictHandler.dictionaries["temp"].extend(sD) - def deactivateAnnouncement(): for entry in sD: if entry in speechDictHandler.dictionaries["temp"]: @@ -57,7 +55,7 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin): scriptCategory = SCRCAT_SPEECH def loadDic(self): - if (config.conf["emoticons"]["onlyNormalConfiguration"] or self.profileName is None): + if self.profileName is None: self.dicFile = ADDON_DIC_DEFAULT_FILE else: self.dicFile = os.path.join(ADDON_DICTS_PATH, "profiles", "%s.dic" % self.profileName) @@ -69,19 +67,10 @@ def handleConfigProfileSwitch(self): self.profileName = config.conf.profiles[-1].name if self.profileName == self.oldProfileName: return - if not config.conf["emoticons"]["onlyNormalConfiguration"]: - deactivateAnnouncement() - self.loadDic() - if config.conf["emoticons"]["announcement"]: - activateAnnouncement() - else: - if AddonSettingsPanel not in NVDASettingsDialog.categoryClasses and self.profileName is None: - NVDASettingsDialog.categoryClasses.append(AddonSettingsPanel) - else: - try: - NVDASettingsDialog.categoryClasses.remove(AddonSettingsPanel) - except: - pass + deactivateAnnouncement() + self.loadDic() + if config.conf["emoticons"]["announcement"]: + activateAnnouncement() self.oldProfileName = self.profileName def __init__(self): @@ -115,14 +104,10 @@ def __init__(self): # Translators: the tooltip text for a menu item. _("Shows a dictionary dialog to customize emoticons")) gui.mainFrame.sysTrayIcon.Bind(wx.EVT_MENU, self.onEmDicDialog, self.dicItem) - if not config.conf["emoticons"]["onlyNormalConfiguration"] or self.profileName is None: - NVDASettingsDialog.categoryClasses.append(AddonSettingsPanel) + NVDASettingsDialog.categoryClasses.append(AddonSettingsPanel) # Config - if not config.conf["emoticons"]["onlyNormalConfiguration"]: - announcement = config.conf["emoticons"]["announcement"] - else: - announcement = config.conf.profiles[0]["emoticons"]["announcement"] + announcement = config.conf["emoticons"]["announcement"] if announcement: activateAnnouncement() config.post_configProfileSwitch.register(self.handleConfigProfileSwitch) @@ -166,8 +151,7 @@ def onSettingsPanel(self, evt): gesture="kb:NVDA+e" ) def script_toggleSpeakingEmoticons(self, gesture): - if (not globalVars.speechDictionaryProcessing - or (config.conf["emoticons"]["onlyNormalConfiguration"] and self.profileName is not None)): + if not globalVars.speechDictionaryProcessing: return if config.conf["emoticons"]["announcement"]: config.conf["emoticons"]["announcement"] = 0 @@ -180,7 +164,6 @@ def script_toggleSpeakingEmoticons(self, gesture): # Translators: message presented when the dictionary for emoticons is loaded. ui.message(_("Emoticons on.")) - @script( # Translators: Message presented in input help mode. description=_("Shows a dialog to select a smiley you want to paste."), @@ -204,8 +187,6 @@ def script_emDicDialog(self, gesture): category=SCRCAT_CONFIG ) def script_settings(self, gesture): - if config.conf["emoticons"]["onlyNormalConfiguration"] and self.profileName is not None: - return wx.CallAfter(self.onSettingsPanel, None) @@ -405,19 +386,13 @@ def OnResetClick(self, evt): def onOk(self,evt): super(EmDicDialog, self).onOk(evt) - if not config.conf["emoticons"]["onlyNormalConfiguration"]: - announcement = config.conf["emoticons"]["announcement"] - else: - announcement = config.conf.profiles[0]["emoticons"]["announcement"] + announcement = config.conf["emoticons"]["announcement"] if announcement: activateAnnouncement() def onCancel(self,evt): super(EmDicDialog, self).onCancel(evt) - if not config.conf["emoticons"]["onlyNormalConfiguration"]: - announcement = config.conf["emoticons"]["announcement"] - else: - announcement = config.conf.profiles[0]["emoticons"]["announcement"] + announcement = config.conf["emoticons"]["announcement"] if announcement: activateAnnouncement() @@ -445,20 +420,12 @@ def makeSettings(self, settingsSizer): # Translators: The label for a setting in Emoticons panel. self.removeCheckBox = sHelper.addItem(wx.CheckBox(self, label=_("&Remove not used dictionaries"))) self.removeCheckBox.Value = config.conf["emoticons"]["cleanDicts"] - # Translators: The label for a setting in Emoticons panel. - self.onlyNormalCheckBox = sHelper.addItem(wx.CheckBox(self, label=_("&Settings only in normal configuration (not recommended)"))) - self.onlyNormalCheckBox.Value = config.conf["emoticons"]["onlyNormalConfiguration"] - profileName = config.conf.profiles[-1].name - self.onlyNormalCheckBox.Enabled = profileName is None - - def postInit(self): - self.activateList.SetFocus() def onSave(self): + announcement = config.conf["emoticons"]["announcement"] config.conf["emoticons"]["announcement"] = self.activateList.GetSelection() - if config.conf["emoticons"]["announcement"]: + if config.conf["emoticons"]["announcement"] and not announcement: activateAnnouncement() - else: + elif not config.conf["emoticons"]["announcement"] and announcement: deactivateAnnouncement() config.conf["emoticons"]["cleanDicts"] = self.removeCheckBox.Value - config.conf["emoticons"]["onlyNormalConfiguration"] = self.onlyNormalCheckBox.Value diff --git a/buildVars.py b/buildVars.py index 810846a..63a417c 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" : _("Enables the announcement of emoticon names instead of the character Representation."), # version - "addon_version" : "8.0-dev", + "addon_version" : "8.1-dev", # Author(s) "addon_author" : u"Chris Leo , Noelia Ruiz Martínez , Mesar Hameed , Francisco Javier Estrada Martínez ", # URL for the add-on documentation support diff --git a/readme.md b/readme.md index 4897e73..81d7d2e 100644 --- a/readme.md +++ b/readme.md @@ -63,8 +63,7 @@ These are the key commands available by default, you can edit those or add new k ## Changes for 8.0 ## -* Added the possibility of enabling settings changes just for normal configuration. -* Requires NVDA 2018.3. +* Compatible with NVDA 2018.3 (required). ## Changes for 7.0 ##