Skip to content

Speech Dictionary dialog: Add a "Remove all" button (#11802)#12385

Closed
JulienCochuyt wants to merge 9 commits into
nvaccess:masterfrom
accessolutions:i11802-resetSpeechDictionaries
Closed

Speech Dictionary dialog: Add a "Remove all" button (#11802)#12385
JulienCochuyt wants to merge 9 commits into
nvaccess:masterfrom
accessolutions:i11802-resetSpeechDictionaries

Conversation

@JulienCochuyt

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #11802

Summary of the issue:

The Speech Dictionary dialog lacks a "Remove all" button to ease clearing a whole dictionary.

Description of how this pull request fixes the issue:

  • Split both the DictionaryDialog and DictionaryEntryDialog from gui.settingsDialogs to a new dedicated gui.speechDict
  • Redeem copyright holders' names by blaming the history of source/gui/settingsDialogs.py
  • Linted the result in a separate commit for easier review and history tracking
  • Added a "Remove all" coherent with the "Restore to factory default" as found on the Input Gestures dialog

Testing strategy:

On a source copy, filled and emptied various default/voice/temp dictionaries.

Known issues with pull request:

Interestingly, the "Remove" button (removing a single entry) was historically designed to handle the removal of all the selected entries in a multi-selection list control. This idea seems to have been abandoned as the list control is explicitly set to support only a single selection - presumably for easier user interaction.

Change log entries:

New features
The Speech Dictionary dialog now features a "Remove all" button to help clear a whole dictionary.

Code Review Checklist:

  • Pull Request description is up to date.
  • Unit tests.
  • System (end to end) tests.
  • Manual tests.
  • User Documentation.
  • Change log entry.
  • Context sensitive help for GUI changes.

@JulienCochuyt JulienCochuyt requested a review from a team as a code owner May 9, 2021 23:30
@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 7481ce6eb1

Redeem copyright holders' names by blaming the history of `source/gui/settingsDialogs.py`
Remove "Dictionary Entry Error" from the expected `checkPot` failures
@JulienCochuyt JulienCochuyt force-pushed the i11802-resetSpeechDictionaries branch from f0291dd to 5d1b14a Compare May 9, 2021 23:52
@XLTechie

XLTechie commented May 10, 2021 via email

Copy link
Copy Markdown
Collaborator

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

@XLTechie wrote:

Can you talk some about why you have named the button as you have, instead of "Restore to factory defaults" like the Input Gestures dialog?

Sure. The two possible alternative labels were actually proposed by @Qchristensen in #11802.
In the Input Gestures dialog, the action is not to remove all bindings, but really to remove all additions/changes/deletions made by the user to the standard bindings as they are listed in the user guide. After restoring to factory defaults, there still are bindings in the list, but only the standard ones. Furthermore, due to how things are implemented under the hood, this action cannot be reverted and the user is warned about it in the confirmation prompt.
On the other hand, in speech dictionaries, you really just empty the list. The list does not come pre-filled with default entries when you first install NVDA. The actual speech still gets affected by the internal dictionaries of each synthesizer/voice, but these never appear in the list and can only be superseded, not edited nor removed. Furthermore, this action can here be undone by simply dismissing the dialog by pressing Cancel afterwards.
By stating I've made them coherent with each other, I was more referring to visual layout: Both buttons appear right aligned under the list they act upon, separated from the other single-entry-action buttons which are left aligned.

Do you agree?

@XLTechie

XLTechie commented May 10, 2021 via email

Copy link
Copy Markdown
Collaborator

self.typeRadioBox.SetSelection(DictionaryEntryDialog.TYPE_LABELS_ORDERING.index(type))


class DictionaryDialog(SettingsDialog):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I agree DictionaryDialog should be eventually moved out of gui\settingsDialogs it would break backwards compatibility - various add-ons expect it either in the gui as it is star imported there or in the gui\settingsDialogs. Unles you expect this to be merged before 2021.1 is finalized this part should be reverted IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the other hand, 2021.1 already brings API changes.
Still, I restored as of 579cbf6 module-level import in gui of DictionaryDialog, as late-importing did not bring much benefit towards the wider API change.
@feerrenrut, may we please have your view here?

@seanbudd seanbudd May 20, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this will be in 2021.1, unless another dev sees reason to target this to beta instead. I think the a change like in 579cbf6 is good, and should be done to maintain backwards compatibility. A comment should be added though to note this is a deprecation and should only be removed with a .1 release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can import both of these removed classes into this module for now to maintain compatibility until 2022.1. Linting warnings can be ignored with a noqa comment to remove this in 2022.1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as of 143bcde and fec7595.

@seanbudd

seanbudd commented May 24, 2021

Copy link
Copy Markdown
Member

Hi Julien, Reverting this to a draft as it breaks API compatibility

@seanbudd seanbudd marked this pull request as draft May 24, 2021 04:52
@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

@seanbudd wrote:

Hi Julien, Reverting this to a draft as it breaks API compatibility

API compatibility issues addressed.
Shall I re-set as ready for review?

@AppVeyorBot

Copy link
Copy Markdown

See test results for failed build of commit 02c99d6a11

@seanbudd seanbudd marked this pull request as ready for review May 25, 2021 00:29
@seanbudd seanbudd self-requested a review June 11, 2021 01:44
Comment thread source/gui/speechDict.py
Comment on lines +3 to +4
# Copyright (C) 2006-2021 NV Access Limited, Michael Curran, Peter Vágner, Mesar Hameed, Joseph Lee,
# Aaron Cannon, Reef Turner, Ethan Holliger, Julien Cochuyt, Thomas Stivers, Cyrille Bougot

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated, referencing the discussions here: #12386

@seanbudd

seanbudd commented Feb 1, 2022

Copy link
Copy Markdown
Member

Thanks @JulienCochuyt for your work on this. I am closing this PR as it has been followed up in #13294

@seanbudd seanbudd closed this Feb 1, 2022
seanbudd pushed a commit to lukaszgo1/nvda that referenced this pull request Feb 3, 2022
nvaccess#13294

Link to issue number:
Fixes nvaccess#11802
Supersedes nvaccess#12385

Summary of the issue:
The Speech Dictionary dialog lacks a "Remove all" button to ease clearing a whole dictionary.

Description of how this pull request fixes the issue:
Split both the DictionaryDialog and DictionaryEntryDialog from gui.settingsDialogs to a new dedicated gui.speechDict
Redeem copyright holders' names by blaming the history of source/gui/settingsDialogs.py
Linted the result in a separate commit for easier review and history tracking
Added a "Remove all" coherent with the "Restore to factory default" as found on the Input Gestures dialog
seanbudd added a commit that referenced this pull request Feb 3, 2022
…er after abandoned #12385

Fixes #11802
Supersedes #12385

Summary of the issue:
The Speech Dictionary dialog lacks a "Remove all" button to ease clearing a whole dictionary.

Description of how this pull request fixes the issue:
Split both the DictionaryDialog and DictionaryEntryDialog from gui.settingsDialogs to a new dedicated gui.speechDict
Redeem copyright holders' names by blaming the history of source/gui/settingsDialogs.py
Linted the result in a separate commit for easier review and history tracking
Added a "Remove all" coherent with the "Restore to factory default" as found on the Input Gestures dialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to reset speech dictionaries to factory default

5 participants