Saving settings in the default profile


Cyrille
 

Hello

I know that it has already been discussed before but I think that I have not found all the information.

What is the recommended way to save settings in the default profile, no matter the active profile.

For Windows Magnifier, I have just used the following strategy inspired from the disable/enable profile script:
* Disable profiles
* Save the required config parameter
* Re-enable profiles.
This works well when called from a script; in my case it's a script used to save and restore Magnifier's parameters.
But if you have a settings dialog box, it does not work because the box will have the name of the profile in its title.

There was also another strategy, used in Update channel selector, I think. The trick was to access the profile with index [0] which is always the default one. However, I seem to remember that this approach had corner case issues. I cannot find any message with such limitation however. Any hint?

Last, one could use a separate .ini file. I think there is no problem with this approach except the fact that you cannot have your parameters anymore in the global nvda.ini file.

Any feedback on all these approaches? Any other idea? Are there recommended approaches made by NVAccess?
Many thanks.

Cheers,

Cyrille


*


Luke Davis
 

Cyrille via groups.io wrote:

What is the recommended way to save settings in the default profile, no matter the active profile.
You can see one way of doing it in Speech Logger.

I don't allow settings to be changed when not in the normal profile, and I do some checks to make sure that the normal profile is being used.

There was also another strategy, used in Update channel selector, I think. The trick was to access the profile with index [0] which is always the default
one. However, I seem to remember that this approach had corner case issues. I cannot find any message with such limitation however. Any hint?
I do not remember many specifics right now, but I had done extensive testing of that procedure, and found situations where the profile was incorrectly identified as normal when it wasn't after changes were made, and some other strange side effects.
I had originally used that method in an early or pre-release version of Speech Logger, but dropped it because of those problems.

I use a similar, but partial method in Numpad Nav Mode.

There, I disable one checkbox if the dialog detects a profile is active.

There may be better methods, but the most reliable one I know of is to keep the settings dialog from changing anything, or changing some things, for other than the normal profile; and then to check on the configuration save mechanism, if the profile is normal.
There are probably ways a user could get around it, but if there is a way to get around it accidentally, I haven't found it yet.

NVDA itself needs a better way of handling all this.

In particular, there are config dialogs of NVDA that only interact with the normal profile, even if another profile is active. Sadly, this is hard coded in the gui module, and from my various attempts, difficult to extend or generalize.

However, if you want to try what they do, attempt to mimic what is done for the general settings dialog.

Luke