From 0b2dadebf403c64e8795fa50dbc358ef47ef9097 Mon Sep 17 00:00:00 2001 From: Amir Date: Wed, 1 Jul 2026 11:07:18 +0330 Subject: [PATCH 1/4] Added context menu to Speech dictionaries dialog --- source/gui/speechDict.py | 13 +++++++++++++ user_docs/en/changes.md | 1 + user_docs/en/userGuide.md | 1 + 3 files changed, 15 insertions(+) diff --git a/source/gui/speechDict.py b/source/gui/speechDict.py index 37992cb9fa5..e8716339ca1 100644 --- a/source/gui/speechDict.py +++ b/source/gui/speechDict.py @@ -181,6 +181,8 @@ def makeSettings(self, settingsSizer): wx.ListCtrl, style=wx.LC_REPORT | wx.LC_SINGLE_SEL, ) + self.dictList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onContextMenu) + self.dictList.Bind(wx.EVT_CONTEXT_MENU, self.onContextMenu) # Translators: The label for a column in dictionary entries list used to identify comments for the entry. self.dictList.AppendColumn(_("Comment"), width=150) # Translators: The label for a column in dictionary entries list used to identify pattern @@ -237,6 +239,17 @@ def makeSettings(self, settingsSizer): sHelper.addItem(bHelper, flag=wx.EXPAND) + def onContextMenu(self, evt): + menu = wx.Menu() + # Translators: Context menu item label to edit an entry + editItem = menu.Append(wx.ID_ANY, _("&Edit")) + # Translators: Context menu item label to remove an entry + removeItem = menu.Append(wx.ID_ANY, _("&Remove")) + self.Bind(wx.EVT_MENU, self.onEditClick, editItem) + self.Bind(wx.EVT_MENU, self.onRemoveClick, removeItem) + self.PopupMenu(menu) + menu.Destroy() + def postInit(self): self.dictList.SetFocus() diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index c0bd765719d..253b26a96e4 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -18,6 +18,7 @@ * In modes that show a continuation mark, when a word is cut across rows, the last cell of the row now shows a continuation mark (braille dots 7-8) so it is clear that the word continues on the next row. * The "At word or syllable boundaries" option uses hyphenation dictionaries to split long words at syllable boundaries when they do not fit on the display. * Magnifier: A new unassigned command has been added to move the mouse cursor to the center of the magnified view. (#20127, @CyrilleB79) +* Added context menu to the list entries of the Speech Dictionaries dialog, Maximizing eas of access to the list entries actions. (#20420, @amirmahdifard) ### Changes diff --git a/user_docs/en/userGuide.md b/user_docs/en/userGuide.md index 6b52fbcd165..3c3579424e9 100644 --- a/user_docs/en/userGuide.md +++ b/user_docs/en/userGuide.md @@ -4283,6 +4283,7 @@ The dialog also contains Add, Edit, Remove and Remove all buttons. To add a new rule to the dictionary, press the Add button, and fill in the fields in the dialog box that appears and then press Ok. You will then see your new rule in the list of rules. +As well as the edit and remove buttons, you can also manage individual rules by opening a context menu on an entry in the list (press the Applications key on your keyboard, shift+f10, space bar, or right/left-click), which provides options to Edit or Remove the selected rule. However, to make sure your rule is actually saved, make sure to press Ok to exit the dictionary dialog completely once you have finished adding/editing rules. The rules for NVDA's speech dictionaries allow you to change one string of characters into another. From 7397e312506024dbcd9f504eca9308522dfc508b Mon Sep 17 00:00:00 2001 From: Amir <69115921+amirmahdifard@users.noreply.github.com> Date: Thu, 2 Jul 2026 15:28:24 +0330 Subject: [PATCH 2/4] aply addressed review for user gide Co-authored-by: Cyrille Bougot --- user_docs/en/userGuide.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/user_docs/en/userGuide.md b/user_docs/en/userGuide.md index 3c3579424e9..aa50dc5961b 100644 --- a/user_docs/en/userGuide.md +++ b/user_docs/en/userGuide.md @@ -4283,7 +4283,12 @@ The dialog also contains Add, Edit, Remove and Remove all buttons. To add a new rule to the dictionary, press the Add button, and fill in the fields in the dialog box that appears and then press Ok. You will then see your new rule in the list of rules. -As well as the edit and remove buttons, you can also manage individual rules by opening a context menu on an entry in the list (press the Applications key on your keyboard, shift+f10, space bar, or right/left-click), which provides options to Edit or Remove the selected rule. +All dictionary dialogs contain a list of rules which will be used for processing the speech. +The dialog also contains Add, Edit, Remove and Remove all buttons. +Alternatively, a context menu to perform actions on single rules (Edit and Remove) is also available. + +To add a new rule to the dictionary, press the Add button, and fill in the fields in the dialog box that appears and then press Ok. +You will then see your new rule in the list of rules. However, to make sure your rule is actually saved, make sure to press Ok to exit the dictionary dialog completely once you have finished adding/editing rules. The rules for NVDA's speech dictionaries allow you to change one string of characters into another. From 99c81d2ee526bad0ee01c8367eb4cf78ad2522a5 Mon Sep 17 00:00:00 2001 From: Amir Date: Thu, 2 Jul 2026 16:00:15 +0330 Subject: [PATCH 3/4] edit rule dialog by activating it, delete key shortcut to remove a rule, And updated the correct spelling changelog entri --- source/gui/speechDict.py | 10 +++++++++- user_docs/en/changes.md | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/gui/speechDict.py b/source/gui/speechDict.py index e8716339ca1..9f07e67cc44 100644 --- a/source/gui/speechDict.py +++ b/source/gui/speechDict.py @@ -181,8 +181,9 @@ def makeSettings(self, settingsSizer): wx.ListCtrl, style=wx.LC_REPORT | wx.LC_SINGLE_SEL, ) - self.dictList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onContextMenu) + self.dictList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onEditClick) self.dictList.Bind(wx.EVT_CONTEXT_MENU, self.onContextMenu) + self.dictList.Bind(wx.EVT_CHAR_HOOK, self.onCharHook) # Translators: The label for a column in dictionary entries list used to identify comments for the entry. self.dictList.AppendColumn(_("Comment"), width=150) # Translators: The label for a column in dictionary entries list used to identify pattern @@ -239,6 +240,13 @@ def makeSettings(self, settingsSizer): sHelper.addItem(bHelper, flag=wx.EXPAND) + def onCharHook(self, evt): + key = evt.GetKeyCode() + if key == wx.WXK_DELETE: + self.onRemoveClick(None) + else: + evt.Skip() + def onContextMenu(self, evt): menu = wx.Menu() # Translators: Context menu item label to edit an entry diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index 253b26a96e4..13b51f0ce3a 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -18,7 +18,7 @@ * In modes that show a continuation mark, when a word is cut across rows, the last cell of the row now shows a continuation mark (braille dots 7-8) so it is clear that the word continues on the next row. * The "At word or syllable boundaries" option uses hyphenation dictionaries to split long words at syllable boundaries when they do not fit on the display. * Magnifier: A new unassigned command has been added to move the mouse cursor to the center of the magnified view. (#20127, @CyrilleB79) -* Added context menu to the list entries of the Speech Dictionaries dialog, Maximizing eas of access to the list entries actions. (#20420, @amirmahdifard) +* Added a context menu to the list entries of the Speech Dictionaries dialog, providing an alternative way to edit or remove a rule. (#20420, @amirmahdifard) ### Changes From 4702f1493f549f232e302bd18fea0b43a835a6cd Mon Sep 17 00:00:00 2001 From: Amir Date: Sat, 4 Jul 2026 23:41:35 +0330 Subject: [PATCH 4/4] last consistencys with the other dialogs --- source/gui/speechDict.py | 10 ++++++++-- user_docs/en/changes.md | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/source/gui/speechDict.py b/source/gui/speechDict.py index 9f07e67cc44..e7a26d9bef0 100644 --- a/source/gui/speechDict.py +++ b/source/gui/speechDict.py @@ -249,12 +249,18 @@ def onCharHook(self, evt): def onContextMenu(self, evt): menu = wx.Menu() - # Translators: Context menu item label to edit an entry + # Translators: Context menu item label to add a new entri + addItem = menu.Append(wx.ID_ANY, _("&Add")) + # Translators: Context menu item label to edit an entri editItem = menu.Append(wx.ID_ANY, _("&Edit")) - # Translators: Context menu item label to remove an entry + # Translators: Context menu item label to remove an entri removeItem = menu.Append(wx.ID_ANY, _("&Remove")) + # Translators: Context menu item label to remove all entries + removeallItem = menu.Append(wx.ID_ANY, _("Remove all")) + self.Bind(wx.EVT_MENU, self.onAddClick, addItem) self.Bind(wx.EVT_MENU, self.onEditClick, editItem) self.Bind(wx.EVT_MENU, self.onRemoveClick, removeItem) + self.Bind(wx.EVT_MENU, self.onRemoveAll, removeallItem) self.PopupMenu(menu) menu.Destroy() diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index 13b51f0ce3a..704f1853726 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -18,7 +18,7 @@ * In modes that show a continuation mark, when a word is cut across rows, the last cell of the row now shows a continuation mark (braille dots 7-8) so it is clear that the word continues on the next row. * The "At word or syllable boundaries" option uses hyphenation dictionaries to split long words at syllable boundaries when they do not fit on the display. * Magnifier: A new unassigned command has been added to move the mouse cursor to the center of the magnified view. (#20127, @CyrilleB79) -* Added a context menu to the list entries of the Speech Dictionaries dialog, providing an alternative way to edit or remove a rule. (#20420, @amirmahdifard) +* Added context menu and shortcuts support to the Speech Dictionaries dialog. (#20420, @amirmahdifard) ### Changes