GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Lister closes why last tab closes


#1

Hi,

Two questions:

1,Preferences / Folder Tabs / Options / Lister closes when last tab closes is on or off,Why did Directory Opus close the lister after I closed the last tab? In fact, I just want to go back to the next level of the directory.

2,In enhanced mode, the mouse clicks on the file to select the file. Where can I cancel it?

Thanks.


#2
  1. How are you closing the tab? You usually can't close the last tab if that option is off.

  2. If you mean in Power Mode, what the mouse buttons do can be configured under Preferences / Display Modes / Power Mode. Or use Details Mode if you want things to behave like standard on Windows.


#3
  1. I closed the tab by double-clicking. When I closed the last tab, Directory Opus closed the lister and the double column became a single column.
    It seems that the option did not work.

  2. I found it, thanks.


#4

Terminology issue. That's not the Lister closing, that's the second file display. The Lister is the whole window.


#5

Thanks, I understand, can Directory Opus not close the file display, just return to the previous directory?


#6

Not currently, no.


#7

Could a script do this?

Using the OnCloseTab event, if its the last tab, you could cancel and change folder to parent?


#8

Yes, I think a script could do it. We could write that if @i5151 links his account.


#9

Thanks, I think the script is a bit complicated, and Directory Opus natively supports this operation is the most convenient. Because, after my search is completed, the file display shows the search results, I naturally double-click the tab to return to the previous directory.

The question about Directory Opus has been basically understood, and the purchase of Directory Opus in these two days.


#10

The script would be very simple. Just a few lines. We can write it for you.


#11

this maybe

function OnInit(initData)
{
	initData.name = "DontCloseLastTab";
	initData.version = "1.0";
	initData.copyright = "(c) 2019 wowbagger";
	initData.desc = "";
	initData.default_enable = true;
	initData.min_version = "12.0";
}

// Called when a tab is closed
function OnCloseTab(closeTabData)
{
	if(closeTabData.tab.backlist.count > 0)
	{
		var doCmd = DOpus.NewCommand;
	    doCmd.RunCommand("Go back");
		return true;
	}
	else
	{
		return false;
	}
}

#12

Won't that stop you closing any tabs at all?


#13

Indeed, it replaces close with go back, until there is no more history, then it closes.
I was not actually sure under what scenario it was needed.
Prob need to check if is the right display, or tab count is 1.

Ok only go back if its the last tab on a file display

function OnInit(initData)
{
	initData.name = "DontCloseLastTab";
	initData.version = "1.0";
	initData.copyright = "(c) 2019 wowbagger";
	initData.desc = "";
	initData.default_enable = true;
	initData.min_version = "12.0";
}

// Called when a tab is closed
function OnCloseTab(closeTabData)
{
	if((closeTabData.tab.right && closeTabData.tab.lister.tabsright.count == 1) || 
	   (!closeTabData.tab.right && closeTabData.tab.lister.tabsleft.count == 1))
	{
		if(closeTabData.tab.backlist.count > 0)
		{
			var doCmd = DOpus.NewCommand;
			doCmd.RunCommand("Go back");
			return true;
		}
	}
	return false;
}

#14

I just want to return the folder of the search results to parent , and other tabs can be closed.


#15

Thanks, I just want to return the folder of the search results to parent, only for the folder of the search results, the other tabs are still the same as usual.

Can I copy this script directly?


#16

You need to save it as a js file in folder %Appdata%\GPSoftware\Directory Opus\Script AddIns
So call it DontCloseLastTab.js.
Then you should see it in the script settings.


#17

Thank you so much, I learned a high level trick.


#18

As @Leo said, you should link you account. It lets the people on the site know they are helping someone who has supported the app. If you don't people might start thing you have a pirated copy and wont share their lunch with you.


#19

I just tried it for a few days, just figured out most of the questions and I will link the account soon.

Your help to me has been great, I am very grateful.


#20

@wowbagger
This script is very useful, it can return folder to parent one by one, but the file display window is closed when it reaches the root folder.