Prevented add-ons from being enabled if NVDA has been started with --disable-addons flag#9474
Conversation
…disable-addons flag
|
@DataTriny: Is it still possible to uninstall an add-on when starting NVDA with the --disable-addons flag? I guess it should be still possible due to very broken add-ons, which maybe can't be uninstalled while they are enabled. |
|
One more question, because I haven't tested this: What about the install button? Should we disable it too? Then we would have to disable the installation method via the Windows Explorer (by opening an .nvda-addon file) too. That would be another PR. |
|
@DrSooom: yes you can still uninstall add-ons with this PR. Currently the button to get add-ons and install them is enabled, but I guess it shouldn't, nor the installation process via Windows Explorer. I also think it deserves another PR. |
feerrenrut
left a comment
There was a problem hiding this comment.
This is a good opportunity to consider if "globally disabled" addons is clearly presented.
Ideally we want to communicate:
- during this run of NVDA, all add-ons are disabled
- what the status of the add-ons will be after a restart, since we expect that to change.
There is a use-case to disable addons, even though --disable-addons is present:
When trying to diagnose a broken addon, a user can disable all addons with the command line, then selectively choose a likely stable set / broken candidate to restart to test with.
I think it would be better to explain that all add-ons are disabled, set the status message to "enabled after restart", "disabled after restart", and continue to allow disabling or enabling the addons.
|
OK surely nothing to stop you loading new add ons but they would not be
enabled orenableable , if that is a word. Also if an add on is stuck
enabled are we totally sure that this code actually does stop that add on
from even being accessed at all? For the debugging of core vs add ons its
important this actually works flawlessly I would imagine.
Brian
bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal E-mail to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field.
-----
|
|
@feerrenrut I think I implemented the behavior you want. Note that I intentionally display Disabled state for all add-ons, let me know if you find it confusing with the second state. We could just display this one when |
LeonarddeR
left a comment
There was a problem hiding this comment.
Thanks for your contribution here!
|
Hi, I'll do a formal review (as the original architect behind disabling add-ons feature). For reference, for a brief history on how we got here I the first place, please read #3090 discussion and the subsequent pull request I wrote to bring this to life. Thanks. |
|
Hi, It turns out this is a major oversight from #6275 - a regression, in fact. Just because an add-on is deemed incompatible by consulting compatibility flags (or lack thereof) should not be a reason to ignore --disable-addons command line switch. Regression confirmed with NVDA 2018.4 - in 2018.4, with --disable-addons switch on, all add-ons are listed as "disabled". To @DataTriny: when filing an issue, please try testing the issue with earlier NVDA releases. Doing so will change your outlook on pull requests like this and might help all of us understand the big picture better. Thanks. |
|
Hi, To @LeonarddeR: after looking at the code and comments closely, I can see why Reef suggested modifying isRunning property, although I do agree that isDisabled would have been a better place to do so (in the interest of reducing code duplication). Here's what the "add-ons disabler" algorithm used to do (2018.4), current situation (2019.1.1), and what this pull request proposes: 2018.4:
2019.1.1:
Pull request:
I think there is a slightly simpler short-term solution, and a long-term solution that requires a fundamental change as to how we view add-ons that are actually running: Short-term: just modify the status text retriever. This can be done as follows:
This is perhaps the easiest (and a naive) solution that resolves this regression, with the obvious downside being deceiving add-on developers with confusing add-on active flags (a potential ethical problem down the road). Long-term solution: split addon.isRunning property into two parts:
This solution is clearer at the cost of introducing incompatible changes. NVDA Core routines and add-ons that rely on current behavior of addon.isRunning must be changed to obtain addon.isReady (this affects not only this pull request, but also #3208). Thanks. |
|
Hi everyone, @josephsl sorry not to have taken the time to test with an older version of NVDA. I'll try to always test with the previous version. I confirm this is a regression, however you can't neither disable an add-on nor see its state after restart. I agree that modifying |
Lets not overreact here. Testing this locally shows that the addons are not running. The confusion is caused by trying to use one word to communicate two concepts:
They cant run because of the guard in This regression is just a change in what is deemed more important to show and was intentionally done, though not well documented or highlighted for community discussion. After-all there was a lot of other parts to focus on. I would prefer that you make only the minimal changes required to clarify the difference between globally disabled and user state: When
I believe this will clear up the confusion. |
|
I just realised, we already have the "all add-ons disabled message". It currently says: "All add-ons are currently disabled. To enable add-ons you must restart NVDA." This is pretty clear to me. Do we want to add the other bit about changing state: " You may modify the enabled / disabled state, install or uninstall add-ons, which will take effect after NVDA is restarted."? |
|
Hi, yep, apologies for possible bad reaction. How about clarifying this in the window title (say, “Add-ons Manager – all add-ons disabled”)? Although a bit verbose, this might communicate the fact that the command line switch is in effect. This is sort of akin to desktop watermark shown when Windows starts in safe mode. Thanks.
|
|
Hi, if this makes things clearer for a beginner, yes, along with documenting this fact in the user guide. Thanks,
… I just realised, we already have the "all add-ons disabled message". It currently says: "All add-ons are currently disabled. To enable add-ons you must restart NVDA." This is pretty clear to me.
Do we want to add the other bit about changing state: " You may modify the enabled / disabled state, install or uninstall add-ons, which will take effect after NVDA is restarted."?
|
Yes, I like that idea as well. |
|
With the latest commit #5785 is also fixed isn't it? |
|
@feerrenrut I removed the "Disabled" state when add-ons are globally disabled, I modified the static text that appears on top of the list view (the one you suggested), and I conditionally changed the title of the window. I am not 100% confident however with the text you suggested because it feels a bit weird to me, with "NVDA" and "restart" repeated multiple times, but I am not a native English speaker, so I will let you decide. Since I modified two translatable strings, should I do something to warn translators or whatever? |
|
Hi, just add a translator comment for new ones, and if needed, change the translator comment associated with changed messages. Thanks.
|
|
Hi, Yes, this resolves #5785, but then it broke Appveyor build for some reason (investigating). Thanks. |
|
Hi, Broken build caused by lack of translator comment in new add-ons manager title. Thanks. |
|
The only time I didn't run tests, it fails. Should pass now! |
|
If you like I could make these changes for you? There are a handful of comments I would like to add to this code as well. |
|
I made all the changes you requested, but if you still want to add something... |
|
Hi, I can also assist in editing the user guide and user interface messages if you want. Thanks.
|
|
@josephsl UI messages should be fine now. Looking through the user guide, I don't see what I could add as the |
feerrenrut
left a comment
There was a problem hiding this comment.
I think that's everything now. I expect this has been a slightly frustrating review for you, sorry for that. But thank you again for your contributions!
|
I really appreciate your menthoring, don't worry. I spend a lot of time observing before doing, but your suggestions point me in the right direction! Thank you! The longest text on the top makes me see that we now have room on the right, and that columns on the list view are too small to display even the version. We might consider expanding the width of the list view. |
|
I pushed a change to wrap that text. I think there are a few other modifications to the gui that could be made. Though I think they should be in another PR:
|
|
Let me know if you are happy with this and I will do a final review before merge. |
|
Yes I'm OK with the changes. I didn't mean to make any UI design on this PR, but I share your ideas on it. |
All feedback seems to be resolved.
Clarification to the text in the add-on manager when NVDA is launched with the --disable-addons flag. (Issue #9473)
Link to issue number:
Fixes #9473.
Summary of the issue:
When NVDA is launched with the
--disable-addonsflag, add-ons that were previously enabled will still appear as such in the add-ons dialog. Furthermore, it is possible to disable and enable them.Description of how this pull request fixes the issue:
disableAddonsglobal flag is on, or the add-on is in the disabled add-ons list.disableAddonsglobal flag is on.Testing performed:
--disable-addonsand ensured that all add-ons appeared disabled and that it was not possible anymore to trigger the enable button.Known issues with pull request:
None
Change log entry:
Section: Bug fixes
--disable-addonsflag, all add-ons now appears disabled.