Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement - Address and type columns regarding network #540

Open
ccfs opened this issue Jan 18, 2022 · 8 comments
Open

Enhancement - Address and type columns regarding network #540

ccfs opened this issue Jan 18, 2022 · 8 comments

Comments

@ccfs
Copy link

ccfs commented Jan 18, 2022

If a network path is entered for navigation, some address and type columns will be empty for

  • network computer
  • network share
  • FTP site
  • FTP folder

Please enhance TE so that these columns are available for sorting and column filtering (blue text below), especially in result lists. Thanks.
history

Please note that if the same path is navigated through a "Network Shortcut", the columns will be available and can be retained.
computer

@tablacus
Copy link
Owner

I have created an add-on "Path column".
Please give it try.

  1. Check Link target / Network location
    image

Regards,

@ccfs
Copy link
Author

ccfs commented Jan 19, 2022

I have tried the add-on but it is far from enough.
"Type", "Folder path", "Folder name" and "File name" are still missing.
history
Sorting and column filtering do not work.
filter

@ccfs
Copy link
Author

ccfs commented Jan 20, 2022

I have tried TE 22.1.19 with "Path column" 1.01. They are better but still not good enough.

  • "Type", "Folder path" and "Folder name" are still missing.
  • Column filtering is OK, but sorting does not work correctly.

report

@tablacus
Copy link
Owner

Script for Type

Add-on: Run at Setup

Type
JScript

Options

ColumnsReplace(te, "{B725F130-47EF-101A-A5F1-02608C9EEBAC} 4", HDF_LEFT, function (FV, pid, s) {
	if (!s) {
		const path = pid.Path;
		if (/^ftp:/i.test(path)) {
			return GetTextR("@msieftp.dll,-287");
		}
		if (/^\\\\\w/i.test(path)) {
			return GetTextR("@utildll.dll,-201");
		}
	}
});

image

Regards,

@ccfs
Copy link
Author

ccfs commented Jan 21, 2022

I tried your script and filtered for "Network" and "FTP". It was very interesting that network share, network folders and FTP folders were also found, although their types appeared original.
script org

So I tried the following modified script and succeeded to correct the types:

ColumnsReplace(te, "{B725F130-47EF-101A-A5F1-02608C9EEBAC} 4", HDF_LEFT, function (FV, pid, s) {
//	if (!s) {
		const path = pid.Path;
		if (/^ftp:/i.test(path)) {
			return GetTextR("@msieftp.dll,-287");
		}
		if (/^\\\\\w/i.test(path)) {
			return GetTextR("@utildll.dll,-201");
		}
//	}
});

script mod

Nevertheless sorting by type is also not working correctly.

Besides, I right-clicked a "FTP server" item or a "Windows Search" item but TE incorrectly showed the context menu of file list background, not that of the item.
context

@tablacus
Copy link
Owner

I have added the ability to sort into scripts.

$ExtendedTypeProperty = function (FV, pid, s) {
  const path = pid.Path;
  if (/^ftp:/i.test(path)) {
    return GetTextR("@msieftp.dll,-287");
  }
  if (/^\\\\[^\\]+$|^\\\\[^\\]+\\[^\\]+$/i.test(path)) {
    return GetTextR("@utildll.dll,-201");
  }
}

ColumnsReplace(te, "{B725F130-47EF-101A-A5F1-02608C9EEBAC} 4", HDF_LEFT, $ExtendedTypeProperty);

AddEvent("ColumnClick", function (Ctrl, iItem) {
  const cColumns = api.CommandLineToArgv(Ctrl.Columns(2));
  if (cColumns[iItem * 2] == "{B725F130-47EF-101A-A5F1-02608C9EEBAC} 4") {
    Ctrl.SortColumn = Ctrl.GetSortColumn(1) == "System.ItemTypeText" ? "-System.ItemTypeText" : "System.ItemTypeText";
    return S_OK;
  }
});

AddEvent("Sorting", function (Ctrl, Name) {
  if (/^\-?System\.ItemTypeText$/i.test(Name) && api.ILIsEqual(FV.FolderItem.Alt, ssfRESULTSFOLDER)) {
    CustomSort(Ctrl, 'System.ItemTypeText', /^\-/.test(Name),
      function (pid, FV) {
        return pid.ExtendedProperty("{B725F130-47EF-101A-A5F1-02608C9EEBAC} 4") || $ExtendedTypeProperty(FV, pid) || "";
      },
      function (a, b) {
        return api.StrCmpLogical(b[1], a[1]);
      }
    );
    return true;
  }
});

Regards,

@ccfs
Copy link
Author

ccfs commented Jan 23, 2022

I have tried TE 22.1.21, the context menu problem is solved.

I tried the above script but sorting did not work correctly, due to the type override. I amended the function to make it work:

$ExtendedTypeProperty = function (FV, pid, s) {
	if (!s) {
		const path = pid.Path;
		if (/^ftp:\/\/[^\/]+\/$/i.test(path)) {
			return GetTextR("@msieftp.dll,-287");
		}
		if (/^\\\\[^\\]+$/i.test(path)) {
			return GetTextR("@shell32.dll,-9216");
		}
	}
}

@ccfs
Copy link
Author

ccfs commented Jan 30, 2022

I have tried "Path column" add-on focusing on 5 useful columns. This is a summary of the test results:
table

"Path column" 1.02 has some problems in "Type" column. Besides, "Folder path" column should be "System.ItemFolderPathDisplay", NOT "System.ItemFolderPathDisplayNarrow".
102

This is the result of my patched version of "Path column" 1.02. "Type" column is now correct.
patch

Please help to update "Path column" add-on based on my patch.

  • "Folder path" column should always be blank for query items. It should be corrected for FTP items.
  • "Location" column is my suggested enhancement for sorting and filtering network items.
  • Sorting "Name" column is incorrect for query items. I think the add-on can include a fix.
  • "File name" column is disregarded.

Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants