Page 1 of 1

Relocating tab is not using the FVS for destination

Posted: 02 Jul 2020 21:57
by klownboy
Hi Don, I hope all is well. I noticed today while expanding upon highend's script here viewtopic.php?f=3&t=21902 which simply sends all tabs home using tab("relocate", $home, $i); where home is the path determined by $home = tab("get", "home", $i); that when the tab is relocated from a sub folder with a saved FVS (e.g thumbnail #2) to home which has a different saved FVS (e.g., thumbnail #3) instead of using thumbnail #3 it uses the view of the subfolder it came from (in this example thumbnail #2(). Using "go home" (#348) will always get you to the correct view for home, but of course that's only used for a current tab. tab("relocate", $home, $i); however, seems to inherent the view of the subfolder your coming from instead of using the FVS of the home folder.

For further explanation in my case, I'm using thumbnail view #2 for all my wallpaper folders beneath G:\Wallpaper\1020x1080\ (e.g.,G:\Wallpaper\1020x1080\Italy) defined in FVS as G:\Wallpaper\1020x1080\* where Including subs is checked. Whereas the main folder of G:\Wallpaper\1020x1080\ is thumbnail #3 defined in FVS as G:\Wallpaper\1020x1080\ (including subs is not checked). In both FVS's, the view mode is checked. Going home and normal movement between folders as I mentioned always works fine; the problem only seems to be with using tab("relocate", path, tab index). Any chance you could have that tab relocated act like the normal go home and use the correct FVS? I tested on some additional test folders with the same result. Thanks. :masked:

Re: Relocating tab home not using the FVS for HOME

Posted: 03 Jul 2020 11:47
by admin
I guess "relocate" to home destination is not the same as "go home".

Re: Relocating tab home not using the FVS for HOME

Posted: 03 Jul 2020 12:08
by klownboy
admin wrote: 03 Jul 2020 11:47 I guess "relocate" to home destination is not the same as "go home".
Well that may be, but either way you are going home. Relocate does indeed take you "home". It just doesn't observe the FVS for home (folder). Wouldn't it be more logical to use the existing FVS for the home folder vs the sub from which you came?

Re: Relocating tab home not using the FVS for HOME

Posted: 03 Jul 2020 12:14
by admin
I don't see what this has to do with home. I would say relocate should always apply the FVS of the destination. You say this does not work?

Re: Relocating tab home not using the FVS for HOME

Posted: 03 Jul 2020 16:46
by klownboy
admin wrote: 03 Jul 2020 12:14 I don't see what this has to do with home. I would say relocate should always apply the FVS of the destination. You say this does not work?
Yes sorry, you are absolutely correct about the relocate function (i.e., it's generic and the destination could be anywhere), but yes, relocate is not using the FVS of the destination folder. I had "home" on the brain because that's what I was doing. My example above where all my sub folders under a Wallpaper folder (G:\Wallpaper\1020x1080\) are defined in FVS as G:\Wallpaper\1020x1080\* with view mode and subfolders checked. The Wallpaper folder itself is defined in FVS as G:\Wallpaper\1020x1080\ with view mode checked but sub folders not checked situation.

I can't say that it happens in every situation, but I also set up some test folders where I assigned an FVS to a folder "F:\5\7\" and a different FVS to another folder "F:\5\8" (not a sub). When I used tab("relocate", "F:\5\8", "18"); from "F:\5\7\" it did relocate the tab, but it inherited the view of the original tab "F:\5\7\" not the view of "F:\5\8".

Re: Relocating tab is not using the FVS for destination

Posted: 03 Jul 2020 17:56
by admin
Okay, checked it. The reason is: FVS are never applied to background tabs (a backgrounded tab keeps its settings until it's selected again). So, to make your script work as desired you should foreground each tab before relocating it.

Re: Relocating tab is not using the FVS for destination

Posted: 03 Jul 2020 20:21
by klownboy
Okay I see what you mean, but that's kind of unfortunate for scripting purposes. So now for any conditions where the destination folder (where I'm relocating the tab to) is a different FVS than the FVS of tab current location, I would have to (in scripting) use SC seltab to make it a foreground tab and since that's the case, I might as well use "go home" CID #348 since it will be the current foreground tab rather than using tab("relocate). More importantly, whenever you have to make the tab current (foreground) for numerous tabs you lose some quick seamless speed.

Re: Relocating tab is not using the FVS for destination

Posted: 03 Jul 2020 20:43
by admin
True.

Note that it's nothing that would not be possible to implement, but I'd rather do this in the new 64-bit version because it's not that easy to do, and everything I do now I have to do again later in the new code.

Re: Relocating tab is not using the FVS for destination

Posted: 04 Jul 2020 00:59
by klownboy
Thanks Don. Stay healthy and safe. :masked:

Re: Relocating tab is not using the FVS for destination

Posted: 04 Jul 2020 10:06
by admin
klownboy wrote: 04 Jul 2020 00:59 Thanks Don. Stay healthy and safe. :masked:
:masked: I'm in a safe place. Whereas reports from the US are a bit disturbing these days...

Re: Relocating tab is not using the FVS for destination

Posted: 04 Jul 2020 15:50
by klownboy
Fortunately my area was relatively low on original COVID-19 cases and there hasn't been a resurgence like so many other areas have seen here.

By the way, I was able to use your undocumented get("fvs",folder, "view") for this situation. I only wanted to use SC seltab on tabs which had a different folder view for the current path than the tab's home path. So I was able to use that command to check the view modes of the tab current path to the tab's home path. If they are the same I use tab("relocate") if they are not, I use SC seltab. Works well and it at least minimizes having the screen flashing while it selects tabs for only those few that I have folder views that differ and only if the tab is not already home.

Code: Select all

		$home = tab("get", "home", $i);
		$path = tab("get", "path", $i);
		  if(get("fvs",$path, "view") UnLikeI get("fvs",$home, "view")) {
			seltab $i; #348;}
		  else {
			tab("relocate", $home, $i);}

Re: Relocating tab is not using the FVS for destination

Posted: 04 Jul 2020 16:50
by admin
:tup: