Page 1 of 1

A Wiser Restart Without Saving, please

Posted: 09 Oct 2025 20:34
by Slideshow BoB
I'm experimenting more with .ini file. I'm really astonished by finding out how flexible things are here.
But I'm really finding it a pain to restart without saving many unwanted changes other than my current set of tabs on 2 pane mode, which I'd like to preserve with no hassles thus streamlining my workflow. Can this be improved by any means, please?

Re: A Wiser Restart Without Saving, please

Posted: 10 Oct 2025 01:29
by RalphM
Ever looked into tabsets?
These allow you to preserve whatever tab combinations you want (per pane though).
If you want it for both panes in one go, you might want to check out the session manager script in the scripts forum.

Re: A Wiser Restart Without Saving, please

Posted: 10 Oct 2025 11:41
by Slideshow BoB
RalphM wrote: 10 Oct 2025 01:29 Ever looked into tabsets?
These allow you to preserve whatever tab combinations you want (per pane though).
If you want it for both panes in one go, you might want to check out the session manager script in the scripts forum.
"Wiser, snappier, clever, smarter" should be on title.
Tabsets require too much maintenance for my taste for the case in mind. Script? Almost sure it would add an extra layer of intervention.
I just think sets of tabs are a too important piece of file management experience for it to be this hard to keep under a mundane need. Thanks for the input, though.

Re: A Wiser Restart Without Saving, please

Posted: 10 Oct 2025 17:01
by bossi
this stores tabset into a separate storage so you can always restore exactly as you stored it

Code: Select all

	function TABSET_($sel){

		if $sel == "change"{ // loads tabset from \Panes\
			$list = listfolder("<xydata>\Panes", "*", 2);
			$listn = replace($list, "<xydata>\Panes\");
			$s = popupmenu($listn);			
			if $s{
				tabset("load", $s);
			}			
		}
		if $sel == "store"{ // stores tabset into \Panes_Storage\
			$pane = tabset("save");
			if ($pane) {
				$pane_storage = replace($pane , "\Panes\" ,"\Panes_Storage\");
				delete ,, $pane_storage;
				copyitem $pane, $pane_storage;
			}
		}
		if $sel == "store_as"{  // stores tabset into \Panes_Storage\ under new name
			$input = input();			
			$pane = tabset("save");  
			if ($input) {
				$destination = "<xydata>\Panes\" . $input;
				$destination_storage = "<xydata>\Panes_Storage\" . $input;
				copyitem $pane, $destination;
				copyitem $pane, $destination_storage;
				tabset("load", $destination);
			}
		}
		if $sel == "restore"{ // restores tabset from \Panes_Storage\  
			// \Panes\ <--overwrite-- \Panes_Storage\
			$pane = tabset("save"); 
			if ($pane) {
				tabset("load", "z_switch");
				$pane_storage = replace($pane , "\Panes\" ,"\Panes_Storage\");
				delete ,, $pane;
				copyitem $pane_storage, $pane;
				tabset("load", $pane);
			}
		}
	}

Re: A Wiser Restart Without Saving, please

Posted: 10 Oct 2025 17:24
by admin
Slideshow BoB wrote: 09 Oct 2025 20:34 But I'm really finding it a pain to restart without saving many unwanted changes other than my current set of tabs on 2 pane mode...
Is that set of tabs constantly changing? Otherwise just save settings once with the tabs you like, then restart without saving later.

Re: A Wiser Restart Without Saving, please

Posted: 10 Oct 2025 18:07
by Slideshow BoB
admin wrote: 10 Oct 2025 17:24
Slideshow BoB wrote: 09 Oct 2025 20:34 But I'm really finding it a pain to restart without saving many unwanted changes other than my current set of tabs on 2 pane mode...
Is that set of tabs constantly changing?
Exactly.
The more I test stuff in XYplorer the more I'd like to have this always ready 'restore last active tabs and sorting while not saving anything else' feature. Tabsets may be an answer for a more or less constant set of tabs, but having the hands dirt on many active tasks which may or may not be file-management related completely break those sets for me whilst demanding a need for such a warm, welcoming snapshot of current 'tabsets', whatever the state they're currently in.

Re: A Wiser Restart Without Saving, please

Posted: 10 Oct 2025 18:08
by Slideshow BoB
bossi wrote: 10 Oct 2025 17:01 this stores tabset into a separate storage so you can always restore exactly as you stored it

Code: Select all

	function TABSET_($sel){

		if $sel == "change"{ // loads tabset from \Panes\
			$list = listfolder("<xydata>\Panes", "*", 2);
			$listn = replace($list, "<xydata>\Panes\");
			$s = popupmenu($listn);			
			if $s{
				tabset("load", $s);
			}			
		}
		if $sel == "store"{ // stores tabset into \Panes_Storage\
			$pane = tabset("save");
			if ($pane) {
				$pane_storage = replace($pane , "\Panes\" ,"\Panes_Storage\");
				delete ,, $pane_storage;
				copyitem $pane, $pane_storage;
			}
		}
		if $sel == "store_as"{  // stores tabset into \Panes_Storage\ under new name
			$input = input();			
			$pane = tabset("save");  
			if ($input) {
				$destination = "<xydata>\Panes\" . $input;
				$destination_storage = "<xydata>\Panes_Storage\" . $input;
				copyitem $pane, $destination;
				copyitem $pane, $destination_storage;
				tabset("load", $destination);
			}
		}
		if $sel == "restore"{ // restores tabset from \Panes_Storage\  
			// \Panes\ <--overwrite-- \Panes_Storage\
			$pane = tabset("save"); 
			if ($pane) {
				tabset("load", "z_switch");
				$pane_storage = replace($pane , "\Panes\" ,"\Panes_Storage\");
				delete ,, $pane;
				copyitem $pane_storage, $pane;
				tabset("load", $pane);
			}
		}
	}
I'll take a closer inspection on what you've shared as soon as time permits, thank you very much.

Re: A Wiser Restart Without Saving, please

Posted: 11 Oct 2025 16:48
by Slideshow BoB
Slideshow BoB wrote: 10 Oct 2025 18:08
bossi wrote: 10 Oct 2025 17:01 this stores tabset into a separate storage so you can always restore exactly as you stored it

Code: Select all

	function TABSET_($sel){

		if $sel == "change"{ // loads tabset from \Panes\
			$list = listfolder("<xydata>\Panes", "*", 2);
			$listn = replace($list, "<xydata>\Panes\");
			$s = popupmenu($listn);			
			if $s{
				tabset("load", $s);
			}			
		}
		if $sel == "store"{ // stores tabset into \Panes_Storage\
			$pane = tabset("save");
			if ($pane) {
				$pane_storage = replace($pane , "\Panes\" ,"\Panes_Storage\");
				delete ,, $pane_storage;
				copyitem $pane, $pane_storage;
			}
		}
		if $sel == "store_as"{  // stores tabset into \Panes_Storage\ under new name
			$input = input();			
			$pane = tabset("save");  
			if ($input) {
				$destination = "<xydata>\Panes\" . $input;
				$destination_storage = "<xydata>\Panes_Storage\" . $input;
				copyitem $pane, $destination;
				copyitem $pane, $destination_storage;
				tabset("load", $destination);
			}
		}
		if $sel == "restore"{ // restores tabset from \Panes_Storage\  
			// \Panes\ <--overwrite-- \Panes_Storage\
			$pane = tabset("save"); 
			if ($pane) {
				tabset("load", "z_switch");
				$pane_storage = replace($pane , "\Panes\" ,"\Panes_Storage\");
				delete ,, $pane;
				copyitem $pane_storage, $pane;
				tabset("load", $pane);
			}
		}
	}
I'll take a closer inspection on what you've shared as soon as time permits, thank you very much.
I'm back.
Written the code into a SingleScript.xys file placed under xy folder/Scripts, which is hooked to a generic load SingleScript command, ready under 'Run Script Again...". When asked, it throws me a "does not contain any valid lines" output. What am I doing wrong here?

Re: A Wiser Restart Without Saving, please

Posted: 11 Oct 2025 19:28
by bossi
henlo , i just gave you a function , for it to work you must include sth like :

Code: Select all

$sel = popupmenu("change|store|store_as|restore");
if $sel{
    TABSET_($sel)
}
so you see a menu , select what to do , the function gets executed with that argument ...

also for "restore" to work you must manually create "z_switch" as a dummy tabset in the \Panes\ folder .

Re: A Wiser Restart Without Saving, please

Posted: 11 Oct 2025 19:30
by bossi

Code: Select all


	function TABSET_($sel){

		if $sel == "change"{ // loads tabset from \Panes\
			$list = listfolder("<xydata>\Panes", "*", 2);
			$listn = replace($list, "<xydata>\Panes\");
			$s = popupmenu($listn);			
			if $s{
				tabset("load", $s);
			}			
		}
		if $sel == "store"{ // stores tabset into \Panes_Storage\
			$pane = tabset("save");
			if ($pane) {
				$pane_storage = replace($pane , "\Panes\" ,"\Panes_Storage\");
				delete ,, $pane_storage;
				copyitem $pane, $pane_storage;
			}
		}
		if $sel == "store_as"{  // stores tabset into \Panes_Storage\ under new name
			$input = input();			
			$pane = tabset("save");  
			if ($input) {
				$destination = "<xydata>\Panes\" . $input;
				$destination_storage = "<xydata>\Panes_Storage\" . $input;
				copyitem $pane, $destination;
				copyitem $pane, $destination_storage;
				tabset("load", $destination);
			}
		}
		if $sel == "restore"{ // restores tabset from \Panes_Storage\  
			// \Panes\ <--overwrite-- \Panes_Storage\
			$pane = tabset("save"); 
			if ($pane) {
				tabset("load", "z_switch");
				$pane_storage = replace($pane , "\Panes\" ,"\Panes_Storage\");
				delete ,, $pane;
				copyitem $pane_storage, $pane;
				tabset("load", $pane);
			}
		}
	}

$sel = popupmenu("change|store|store_as|restore");
if $sel{
    TABSET_($sel)
}

just indenrt it properly

Re: A Wiser Restart Without Saving, please

Posted: 12 Oct 2025 19:41
by admin
In the next beta you can do savesettings 4096; to save just the tabs of both panes and nothing else.

Re: A Wiser Restart Without Saving, please

Posted: 12 Oct 2025 19:44
by Slideshow BoB
Now I see how you designed it, bossi.
Only thing is: this is too much demanding when I ask for is just a simple way for XYplorer to either keep or restore current session when a quick reload is needed. I GUESS I can rewrite/recombine it in that fashion.

-saving current set under a predefined name (will I be able to detect single or dual pane? Not sure);
-invoking 'restart without saving';
-(MAJOR POTENTIAL ISSUE) is there a way the previous routine predefine a 'load' set of commands thus restoring saved session...? I'm also trying to avoid any permanent changes to the default launch set of tabs, which is also making me quit on my own devices.

EDIT:
admin wrote: 12 Oct 2025 19:41 Re: A Wiser Restart Without Saving, please
by admin » 12 Oct 2025 14:41

In the next beta you can do savesettings 4096; to save just the tabs of both panes and nothing else.
:warnred20:
...this may be of help! Thanks, admin!!!