I think a little addition to setting could be welcome. Right now it supports "0" or "1" of course, but also "r" to restore to previous state. There should also be an option "u" for restore to user setting.
Here's an example where it might be required : Imagine a script that needs to hide folders during its execution, then needs to restore that setting to user value before it makes a selection of items and ends the whole stack execution (end 1;) It's important to restore the user setting because otherwise the possible hiding or showing of folders would have the selection lost !
But, if this script was called by another script, which may have changed this setting as well before, then doing a setting "r" might not restore to the user value, and so our script has no way to ensure selection isn't lost, because it can't restore to user value, only previous in stack.
setting : add restore to user state
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
setting : add restore to user state
Proud XYplorer Fanatic
-
admin
- Site Admin
- Posts: 66308
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: setting : add restore to user state
Even with end 1; the settings are correctly auto-restored on each stack level. Please give an example where it does not work as it should.
FAQ | XY News RSS | XY X
-
jacky
- XYwiki Master
- Posts: 3106
- Joined: 23 Aug 2005 22:25
- Location: France
- Contact:
Re: setting : add restore to user state
I'm not saying it doesn't work as it should, but imagine smthg like thisadmin wrote:Even with end 1; the settings are correctly auto-restored on each stack level. Please give an example where it does not work as it should.
Code: Select all
setting "HideFoldersInList", 1;
sel 3,1;
end 1;Another case would be when the script calls a command to save settings, as the settings saved aren't the user settings but whatever is currently in use. So again in such case it's good to restore before hand, only if that can't be done because settings were previously changed in a script higher on stack, well, we're screwed!
Proud XYplorer Fanatic
XYplorer Beta Club