Force DictionaryDialog to be subclassed to use it#13268
Conversation
See test results for failed build of commit 8fdce76274 |
|
Note: I've unchecked "API is compatible with existing add-ons", please leave this unmarked as this is a documented breaking change |
|
Thanks for review @seanbudd . Discussing on process details, you wrote:
Sorry, that's not the way I was told to use these checkboxes (by Reef in another PR). Moreover if I read
Since I have considered the API-breaking change topic, I think I should check the checkbox to indicate that it has been considered. And in the section API is compatible with existing add-ons:
Just to clarify how I have used these checkbox and to highlight that there may be a misunderstanding about their use. |
|
@CyrilleB79 - apologies, my mistake. Perhaps we should improve the wording of the checklist item, it is somewhat misleading for it to be checked in this instance. |
|
In the This seem quite clear to me, as a PR author/submitter. But of course, this paragraph is not visible for the reviewer who reads the PR. Do you have an idea on how this can be made clearer for reviewer? What would you expect as a reviewer? Maybe a sentence out of the comment telling "Author should check each checkbox to indicate that the relevance of the item has been considered; reviewer should ensure that all checkbox are checked." I fear however that this wording makes the template to heavy. |
|
I was misled after coming back from break and forgetting the context we added to the template. What I find misleading is "API is compatible with existing add-ons." is not a true statement if there is API breaking changes. Perhaps it could be "API is compatible with existing add-ons or breaking changes have been documented" or the shorter "API compatibility has been considered" |
Link to issue number:
Follow-up of #12967
Summary of the issue:
Since the merge of #12800, trying to re-open an already opened dialog allows to focus it rather than issuing an error message box. The dialog is refocused according to its class, i.e. trying to open a dialog of the same class rather refocus the first already opened dialog of the same class.
But with #12800, it was not possible to open 2 dictionaries of different type (e.g. speech and default). This was fixed with #12967 by subclassing DictionaryDialog.
In #12967, however, the following known issue was mentionned:
Indeed, if DictionaryDialog's have been subclassed in NVDA's core, add-on may still instance directly a DictionaryDialog. That should be forbidden as explained in #12967.
However, it could not be done before 2022.1 due to add-ons that may break if they instance directly DictionaryDialog. That's the case of applicationDictionary.
Note: emoticons and EnhancedDictionaries add-ons use DictionaryDialog's but they already subclass it.
Description of how this pull request fixes the issue:
Option 1 (withdrawn after review):
Raise an error in the
__init__method of DictionaryDialog if it is instancied from the same class (not a subclass).Option 2 (implemented after review):
I have abstracted DictionaryDialog as advised in #12967 (comment) and thanks to @lukaszgo1's review.
Testing strategy:
Manual testing:
Created aglobal plugin (dictTest.py.txt) allowing to open two dictionaries:
And tested that:
Tested that NVDA's default, voice and temp dictionaries dialogs still open (from menu).
Known issues with pull request:
Should be merged in 2022.1 or any API-breaking release.
Change log entries:
For Developers
It is now mandatory to subclass DictionaryDialog to use it. (#13268)Code Review Checklist: