Going to folders and files using the Catalog

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
clarkedesign
Posts: 69
Joined: 14 Feb 2013 09:29

Going to folders and files using the Catalog

Post by clarkedesign »

Reading the help text - it says

Going to folders and files using the Catalog: simply click an item to browse to it. The Tree will stay in synch. If the item is a file, it will be selected in the file list. If a tab pointing to the clicked location exists already, this tab is selected instead of opening the location in the current tab.

If I have two tabs open, one pointing to F: and one to G:

clicking on F: in the catalog open F: in the current tab - sounds fine.
But if I already have F: open in another tab, the help says it should switch to it, rather than opening F: in the current tab.

This doesn't seem to work

If I'm in the G: tab and click F: in the catalog, I end up with two F: tabs

Can someone help me to work this out please?
Thanks,
Sean Clarke

clarkedesign
Posts: 69
Joined: 14 Feb 2013 09:29

Re: Going to folders and files using the Catalog

Post by clarkedesign »

Hi,

Still having problems with this "If a tab pointing to the clicked location exists already, this tab is selected instead of opening the location in the current tab."

If I have a tab open pointing to "W:" and I'm pointing at any other tab in any pane.
No matter what I do to goto W: (click the tree / click the catalog / click to toolbar / keyboard shortcut)

I get a NEW TAB pointing to W:

Nothing will take me to the W: tab that already exists, despite the fact that the help text says "If a tab pointing to the clicked location exists already, this tab is selected instead of opening the location in the current tab."
Thanks,
Sean Clarke

sergiomis
Posts: 4
Joined: 14 Jun 2018 11:24

Re: Going to folders and files using the Catalog

Post by sergiomis »

Hello.

This post has never been answered.
The fact that XYplorer always open a new tab even if it is already open, is rather annoying.
Since XYplorer is so powerful and configurable i suppose there is some setting than can make XYplorer work as stated in the help text.

Please, let us know.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Going to folders and files using the Catalog

Post by highend »

No matter what I do to goto W: (click the tree / click the catalog / click to toolbar / keyboard shortcut)
The text from the help file you've quoted is for the catalog, not for any other way

There is a tweak in the .ini file named "TabReuseTabs" but it doesn't work when a location is opened from the catalog...

If the whole thing isn't a bug (but maybe a leftover in the docs), this would be a way to do what you're expecting...

Use this in a catalog item, toolbar button, udc, etc.
Ofc for each of your items adapt the path! Btw, file work as well (they are selected in the tab)

Code: Select all

    perm $P_GoTo = "R:\";
    load "Switch to existing tab";
Create a new script file in your scripts folder named "Switch to existing tab.xys" and use this content:

Code: Select all

    perm $P_GoTo;

    if (!$P_GoTo) { status "No item passed, aborted!", "8B4513", "stop"; end true; }

    $type = exists($P_GoTo);
    $file = "";
    $path = "";
    if     ($type == 1) { $path = gpc($P_GoTo, "path"); $file = gpc($P_GoTo, "file"); }
    elseif ($type == 2) { $path = $P_GoTo; }
    elseif ($type == 0) {
        $temp = gpc($P_GoTo, "path");
        if (exists($temp) == 2) { $path = $temp; }
    }

    // Check if we have an already existing tab
    if ($path) {
        $tabID = GetTabID(trim($path, "\", "R"));
        if ($tabID) { seltab $tabID; }
        else { tab("new", $path); }
    }
    if ($file) { selectitems $file; }


function GetTabID($path) {
    while ($i++ < tab("get", "count")) {
      $tabPath = trim(tab("get", "path", $i), "\", "R");
      if ($path == $tabPath) { return $i; }
    }
    return 0;
}

One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Going to folders and files using the Catalog

Post by admin »

Strange in many ways.

1) Why was the original post never answered? :eh: :oops:

2) Why is the help text wrong?

3) Why doesn't the TabReuseTabs tweak work for you, highend? Because it works fine here! From Catalog, and from anywhere else.

Code: Select all

TabReuseTabs=1
4) Why isn't that tweak the default setting? I think it should be...

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Going to folders and files using the Catalog

Post by highend »

3.) Don't know. It works in a fresh instance though...
4.) Unsure. I can image a few scenarios where you wouldn't want to switch to an existing tab / select a file in there...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Going to folders and files using the Catalog

Post by admin »

highend wrote:4.) Unsure. I can image a few scenarios where you wouldn't want to switch to an existing tab / select a file in there...
Hmm, yes, me too. So, should I make it a setting? For example like this:

[ ] Reuse existing tabs when changing the location

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Going to folders and files using the Catalog

Post by highend »

Would be better than the tweak...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Going to folders and files using the Catalog

Post by admin »

I will also fix that Catalog bug. Easier than fixing the Help file. :)

sergiomis
Posts: 4
Joined: 14 Jun 2018 11:24

Re: Going to folders and files using the Catalog

Post by sergiomis »

@admin:
My fault! I searched in the forum and wasn't able to find an answer but this old thread which was on a dead end until this morning.
As stated before, this tool is so powerful and complex that may be hard to make it work as desired !
Of course TabReuseTabs=1 is the solution and works like a charm.
Thank you!

@highend
I tried your solution and it works too, but TabReuseTabs=1 is preferred because it doesn't need any customisation (and it works for locations opened from the Catalog !).

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Going to folders and files using the Catalog

Post by admin »

I added an option in Configuration dialog: "Reuse existing tabs when changing the location", raising the tweak to UI.

And I fixed it for the Catalog: Now it always reuses tabs, just like it's claimed in the Help file.
BUT: Actually I wonder why Catalog has to play this extra role??? :eh: Ideas anybody?

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Going to folders and files using the Catalog

Post by highend »

Nope, doesn't make much sense. All should behave equally when the setting is set / unset...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Going to folders and files using the Catalog

Post by admin »

highend wrote:Nope, doesn't make much sense. All should behave equally when the setting is set / unset...
Yep.

So I will remove that wrong bit on Catalogs from the Help file.

sergiomis
Posts: 4
Joined: 14 Jun 2018 11:24

Re: Going to folders and files using the Catalog

Post by sergiomis »

BUT: Actually I wonder why Catalog has to play this extra role??? :eh: Ideas anybody?
I work on many projects an use the Catolog to switch between them.
And since the Tabs don't show the full path, switching by Catalog is better than switching by Tabs:
Cattura.PNG
Cattura.PNG (105.77 KiB) Viewed 1727 times
That's why I need that Catalog reuses tabs instead of open new ones.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Going to folders and files using the Catalog

Post by admin »

OK. But is the new setting (Configuration | Tabs and Panes | Tabs | Reuse existing tabs when changing the location) okay for you as well? It means that not only Catalog, but also Favorite Folders, Favorite Files, Special System Folders, Hotlist, and Recent Locations will reuse existing tabs.

Post Reply