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

Is it possible to implement context menu for the same type of files? #26

Open
Ahernz opened this issue Apr 17, 2024 · 13 comments
Open

Is it possible to implement context menu for the same type of files? #26

Ahernz opened this issue Apr 17, 2024 · 13 comments
Labels
bug Something isn't working Done enhancement New feature or request user-question

Comments

@Ahernz
Copy link

Ahernz commented Apr 17, 2024

For example, if you configure an [Image] folder, you can use the context menu as long as it is an image format file.

Or can a folder support multiple suffixes at the same time? For example, if you configure the "jpg/tif/png" folder, files in *.jpg *.tif *.png format can use the context menu.

@oleg-shilo
Copy link
Owner

Yes, it is possible already.

You just need to name the folder containing the handler for your image files with a special name that indicates all the extensions the image file can have. In your case, the folder name should be [jpg,tif,png].

Apologies for not reflecting it in the documentation. I just overlooked it when was preparing the documentation.
Addressed now: https://github.com/oleg-shilo/shell-x/tree/master?tab=readme-ov-file#how-it-works

@Ahernz
Copy link
Author

Ahernz commented Apr 18, 2024

I tried setting the folder name to [jpg,tif,png] but this resulted in the context menu being available for all files.

@oleg-shilo
Copy link
Owner

Let me check.
No, it's not what I observe if I use a standard config folder (just initialized during the install). A
I assume when you say "all files", you mean "any file" not "all image files". Am I right

You can share your config folder content here and I can repeat a local test.

@Ahernz
Copy link
Author

Ahernz commented Apr 18, 2024

Your understanding is correct, but I didn't express it clearly.
I have now configured a folder named [jpg, tif, png], but this folder has the same effect as the [file] folder, allowing any file to use the context menu.

@Ahernz
Copy link
Author

Ahernz commented Apr 18, 2024

I found the problem, I reinstalled shell-x and restarted the explorer, and now it works normally. Thanks for your reply.

@Ahernz
Copy link
Author

Ahernz commented Apr 18, 2024

At the same time, I discovered a bug, that is, when setting the folder name to [png], the context menu does not take effect for files with the suffix ".PNG". You need to configure a name in uppercase format at the same time, such as [png, PNG] for normal use.

@oleg-shilo
Copy link
Owner

Thank you. I will lcheck.

@oleg-shilo
Copy link
Owner

Ah, I see the problem.

For a single file extension, you need to use the file extension as is:

txt file extension => txt folder name
txt and md file extensions => [txt,md] folder name

The only allowed content between square brackets is: any, folder and comma-delimited list of multiple files.

Thus in your case you need to name your folder png not [png]. And adding extra extension as you did solve the problem for you. [png,png] would also do the trick.

Nevertheless, I will consider allowing a single extension in square brackets option in the next release.

@oleg-shilo oleg-shilo added the enhancement New feature or request label Apr 18, 2024
oleg-shilo added a commit that referenced this issue Apr 18, 2024
…les?

  - Added support for single item multipart extension list as config folder name (e.g. `[png]` will be treated the same way as `png`)
  - Added 'Naming convention' section in the CLI help content.
@oleg-shilo
Copy link
Owner

To make it easier I have added the corresponding section to the CLI help and this site readme (https://github.com/oleg-shilo/shell-x/blob/master/README.md#naming-convention)

@Ahernz
Copy link
Author

Ahernz commented Apr 18, 2024

Sorry, I couldn't express myself clearly, So I made two images. My computer seems to be case sensitive about file extension.

Picture 1: When I configure the [txt,jpg] folder, the context menu cannot be used for files with the suffix ".TXT".
Snipaste_2024-04-19_01-50-05

Picture 2: I have to configure the [txt, jpg, TXT] folder so that files with the ".TXT" suffix can use the context menu normally.
Snipaste_2024-04-19_01-50-21

oleg-shilo added a commit that referenced this issue Apr 19, 2024
* #26: Is it possible to implement context menu for the same type of files?
  - Added support for single item multipart extension list as config folder name (e.g. `[png]` will be treated the same way as `png`)
  - Added 'Naming convention' section in the CLI help content.
@Ahernz
Copy link
Author

Ahernz commented Apr 30, 2024

I tested it in Windows 11 and it works, but not in Windows 10.

@oleg-shilo
Copy link
Owner

You are right. Indeed somehow it is case-sensitive. It's not your computer problem but the problem with the way [txt,jpg] is handled. It works correctly for both upper and lower case extensions if the config folder is for one extension only - txt. But becomes case sensitive for config folders for multiple extensions like yours [txt,jpg]. There is a mistake somewhere in my code.

I will start working on it right away.

Thank you for reporting it.

@oleg-shilo oleg-shilo added the bug Something isn't working label Apr 30, 2024
oleg-shilo added a commit that referenced this issue May 1, 2024
- Issue #26: Is it possible to implement context menu for the same type of files?
@oleg-shilo oleg-shilo added the Done label May 1, 2024
@oleg-shilo
Copy link
Owner

oleg-shilo commented May 1, 2024

Done.
Release can be found here: https://github.com/oleg-shilo/shell-x/releases/tag/v1.5.6.0

It will take a little time before it hits Chocolatey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Done enhancement New feature or request user-question
Projects
None yet
Development

No branches or pull requests

2 participants