Set LISTERTITLE to Include File Display View Mode

Request including %V in LISTERTITLE argument of Set command to identify view mode for current (source) folder in titlebar.

Could you give some details on when/why that would be useful?

There are times when I inadvertently select a certain view (ie Power or Flat) and don't actually realize I've done it until I attempt some folder/file-related action.

In addition, although the default menu toolbar displays buttons for Details, Details + Thumbnails, and Thumbnails views respectively that show as "active" when that particular view is selected, I neither use the default toolbars nor use view buttons in my set up. Instead, I prefer to leverage the ListerTitle for key DOpus indicators as follows:

Given the loose DOpus hierarchy of Lister, Layout, Style, Folder, and View, it makes sense to me, and would help me, to include View as a ListerTitle option. For me, the ListerTitle would look something like:

Finally, if this is not possible or not worth the effort right now, perhaps there is a way via scripting to identify the active tab's view and feed that into the Titlebar script. If so, I would certainly appreciate your help here.

I hope this clarifies. And thanks for considering!

1 Like

Thanks!

FWIW, Flat View is not one of the display/view modes so you'd want to be able to indicate that as well somehow. (It has "View" in the name, but it's independent of the display/view modes and can be applied on top of any of them.)

This seems a little esoteric, so a script may be the best solution.

Since you have the version number in the title, does that mean you're already using a script for this? If so, you just need to add a bit to it.

The OnDisplayModeChange and OnFlatViewChange events can be used to update the lister title when the mode changes.

Here's a quick example (I've kept the code simple, rather than fully-featured, on the assumption you'll want to add this to an existing script).

function OnInit(initData)
{
	initData.name = "Lister title view mode";
	initData.version = "1.0";
	initData.copyright = "(c) 2019 Leo Davidson";
	initData.url = "https://resource.dopus.com/t/set-listertitle-to-include-file-display-view-mode/31991";
	initData.desc = "";
	initData.default_enable = true;
	initData.min_version = "12.0";
}

function UpdateTitle(lister)
{
	var tab = lister.activetab;
	var cmd = DOpus.Create.Command;
	cmd.SetSourceTab(tab);

	var viewMode = tab.format.view;
	viewMode = viewMode.substring(0,1).toUpperCase() + viewMode.substring(1);

	var title = "notoggle:Directory Opus | Layout: %L | Style: %S | Folder: %P | View: " + viewMode;

	if (cmd.IsSet("FLATVIEW=on"))
	{
		title += " (Flat)"
	}

	DOpus.Output(title);

	cmd.RunCommand('Set LISTERTITLE="' + title + '"');
}

function OnActivateTab(activateTabData)
{
	UpdateTitle(activateTabData.newtab.lister);
}

function OnSourceDestChange(sourceDestChangeData)
{
	UpdateTitle(sourceDestChangeData.tab.lister);
}

function OnAfterFolderChange(afterFolderChangeData)
{
	UpdateTitle(afterFolderChangeData.tab.lister);
}

function OnDisplayModeChange(displayModeChangeData)
{
	UpdateTitle(displayModeChangeData.tab.lister);
}

function OnFlatViewChange(flatViewChangeData)
{
	UpdateTitle(flatViewChangeData.tab.lister);
}

As an aside, the status bar has a {vm} code for showing the current view mode, if anyone wants it there instead of the titlebar.

Another thing to note is that Details+Thumbnails mode is not a real display mode; it's just Details mode with the thumbnails column included. So it won't show up as a special mode. The script could be modified to check for it though, if you care about that.

I am using a script to set the ListerTitle, so this will definitely help.

Thanks Leo!

What does this look like in vbscript?

option explicit
Function OnInit(initData)
	initData.name = "Lister title view mode"
	initData.version = "1.0"
	initData.copyright = "(c) 2019 Leo Davidson"
	initData.url = "https://resource.dopus.com/t/set-listertitle-to-include-file-display-view-mode/31991"
	initData.desc = ""
	initData.default_enable = True
	initData.min_version = "12.0"
End Function

Function UpdateTitle(lister)
	Dim tab, cmd, viewmode, title

	Set tab = lister.activetab
	Set cmd = DOpus.Create.Command
	cmd.SetSourceTab tab

	viewMode = tab.format.view
	viewMode = UCase(Mid(viewMode,1,1)) & Mid(viewMode,2)

	title = "notoggle:Directory Opus | Layout: %L | Style: %S | Folder: %P | View: " & viewMode

	If (cmd.IsSet("FLATVIEW=on")) Then
		title = title & " (Flat)"
	End If

	cmd.RunCommand "Set LISTERTITLE=""" + title + """"
End Function

Function OnActivateTab(activateTabData)
	UpdateTitle activateTabData.newtab.lister
End Function

Function OnSourceDestChange(sourceDestChangeData)
	UpdateTitle sourceDestChangeData.tab.lister
End Function

Function OnAfterFolderChange(afterFolderChangeData)
	UpdateTitle afterFolderChangeData.tab.lister
End Function

Function OnDisplayModeChange(displayModeChangeData)
	UpdateTitle displayModeChangeData.tab.lister
End Function

Function OnFlatViewChange(flatViewChangeData)
	UpdateTitle flatViewChangeData.tab.lister
End Function

Thanks Leo!

Got the following working as I like, with the exception of recognizing Details+Thumbnails. Not sure what I'm missing or misinterpreting...

function OnInit(initData)
{
	initData.name = "Lister title view mode";
	initData.version = "1.0";
	initData.copyright = "(c) 2019 Leo Davidson";
	initData.url = "https://resource.dopus.com/t/set-listertitle-to-include-file-display-view-mode/31991";
	initData.desc = "";
	initData.default_enable = true;
	initData.min_version = "12.0";
}

function OnOpenLister(OpenListerData)
{
	var tab = lister.activetab;
	var cmd = DOpus.Create.Command;
	var version = DOpus.version.product;
	cmd.SetSourceTab(tab);

	var viewMode = tab.format.view;
	viewMode = viewMode.substring(0,1).toUpperCase() + viewMode.substring(1);

		var title = "notoggle:Directory Opus " + version + " Pro (64-bit)      |      LAYOUT:  %L      |      STYLE:  %S      |      VIEW:  " + viewMode + "      |      FOLDER:  %P";

	DOpus.Output(title);

	cmd.RunCommand('Set LISTERTITLE="' + title + '"');
}

function UpdateTitle(lister)
{
	var tab = lister.activetab;
	var cmd = DOpus.Create.Command;
	var version = DOpus.version.product;
	cmd.SetSourceTab(tab);

	var viewMode = tab.format.view;
	viewMode = viewMode.substring(0,1).toUpperCase() + viewMode.substring(1);

	if (cmd.IsSet("VIEW=LargeIcons"))
	{
		viewMode = "Large Icons"
	} else if (cmd.IsSet("VIEW=SmallIcons"))
	{
		viewMode = "Small Icons"
	} else
	{
		viewMode = viewMode
	}
	
	if (cmd.IsSet("FLATVIEW=on,Grouped"))
	{
		viewMode += " (Flat-Grouped)"
	} else if (cmd.IsSet("FLATVIEW=on,Mixed"))
	{
		viewMode += " (Flat-Mixed)"
	} else if (cmd.IsSet("FLATVIEW=on,MixedNoFolders"))
	{
		viewMode += " (Flat-Mixed, No Folders)"
	} else if (cmd.IsSet("VIEW=Tiles"))
	{
		viewMode += "s"
	} else if ((cmd.IsSet("VIEW=Details")) && (cmd.IsSet("COLUMNSADD=thumbnail")))
	{
		viewMode += " + Thumbnails"
	} else
	{
		viewMode = viewMode
	}
	
	var title = "notoggle:Directory Opus " + version + " Pro (64-bit)      |      LAYOUT:  %L      |      STYLE:  %S      |      VIEW:  " + viewMode + "      |      FOLDER:  %P";
	
	DOpus.Output(title);

	cmd.RunCommand('Set LISTERTITLE="' + title + '"');
}

function OnActivateTab(activateTabData)
{
	UpdateTitle(activateTabData.newtab.lister);
}

function OnSourceDestChange(sourceDestChangeData)
{
	UpdateTitle(sourceDestChangeData.tab.lister);
}

function OnAfterFolderChange(afterFolderChangeData)
{
	UpdateTitle(afterFolderChangeData.tab.lister);
}

function OnDisplayModeChange(displayModeChangeData)
{
	UpdateTitle(displayModeChangeData.tab.lister);
}

function OnFlatViewChange(flatViewChangeData)
{
	UpdateTitle(flatViewChangeData.tab.lister);
}

Try COLUMNSTOGGLE instead of COLUMNSADD for the details+thumbnails test.

That said, it won't update the titlebar for a column being added or removed, so that will only take effect when one of the other changes triggers an update. It may just be that.

COLUMNSTOGGLE worked as you indicated. Not sure of value, but interested in method to make script react to column change. Not sure one exists, though.

@Leo

can we revisit this script for a moment??

i thought there'd be option show a label in the status bar IF flatview was turn on thou i dont think there is.

finding this post i like it in the title bar.

i tried loading this scripting, which as working thou with chucks title bar layout.

i attemebed editing it down to only show this part [see below] ... after my own layout, which is simple, thou theres more here i know how to change and broke the script. title bar just went blank after i changing.

under prefs > Title Bar, i have...

%P - Directory Opus v13 - {show if flatvew is ON}

and would like to somehow at this to show up when flaview is turn on. im not concerned with the view mode i only use details 90% of the time (plus i think view mode has label option for the status bar already)

if (cmd.IsSet("FLATVIEW=on"))
{
title += " (Flat)"
}

DOpus.Output(title);

cmd.RunCommand('Set LISTERTITLE="' + title + '"');
}

thanks.
x

You can put it in the status bar if that's where you actually want it:

{h!{if:Set FLATVIEW=on}}Flat View is on{h!}

Only issue is it doesn't always clear as soon as you turn off flat view, if there are no child items in the folder. (That could probably be solved with a script, or just by adding a line to the button(s) used to turn off Flat View. Please start a new thread if you want to go into either in detail.)

1 Like

is works nicely!! thank you!

added a splash of color so it stands out next to the hidden & Everything labels

{h!{if:Set FLATVIEW=on}} <#1D88DF>FlatView</#> {h!}

1 Like

hiya @Leo is there way to have the status bar display FAYT in that status bar when you're in fayt mode?

keep getting myself stuck here, ill hit tab to jump to destination but get stuck on source [forgetting im in fayt] until i hit esc.

thanks
x