Bug 496047 - There appears to be no way of adding, deleting or editing items in the "Open with" context menu.
Summary: There appears to be no way of adding, deleting or editing items in the "Open ...
Status: RESOLVED NOT A BUG
Alias: None
Product: digikam
Classification: Applications
Component: Usability-OpenWith (show other bugs)
Version: 8.4.0
Platform: Mint (Ubuntu based) Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-10 12:18 UTC by Staffan
Modified: 2024-11-10 18:24 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.5.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Staffan 2024-11-10 12:18:04 UTC
How can one edit the "Open with" context menu?

SUMMARY
There appears to be no way of adding, deleting or editing items in the "Open with" context menu.

STEPS TO REPRODUCE
1. Right-click on an image (in the thumbnail view).
2. In the context menu, look for the image editor you want to open the image with. For example 'Topaz Photo AI' which happens to be a Windows application running under Wine. It is present in the MATE menu, but not in the digiKam context menu (which shows 57 other alternatives, including some Wine apps).
3. Open the Settings in the digiKam top menu and search, in vain, for a way to add entries to the 'Open with' context menu.

OBSERVED RESULT
I can't find a way to open the image using the chosen app from within digiKam, and there seems to be no way to add it to the context menu. Drag and drop from digiKam to the Topaz app does, however, work. Also, the context menu is seriously over populated; if I right-click on a cr3 RAW file, I see 57 suggested applications most of which are completely unsuitable for opening RAW files. Fewer than 5 of the items seem appropriate and I'd like to hide/delete the rest of them from the context menu (while keeping them in the system menu, of course).

EXPECTED RESULT
Expected to discover a method to edit and add entries to the 'Open with' context menu, most likely under 'Settings'. At the very least I expected to find some information on how to edit the context menu from outside the app, i.e. in some config file or similar.

SOFTWARE/OS VERSIONS
Linux Mint 21.3 (x86_64) MATE Edition
Qt Version:  6.7.2
digiKam 8.4.0

ADDITIONAL INFORMATION
I have searched both on this website and on the internet at large without finding a solution. I have, however, seen that others are experiencing similar problems (particularly on Windows but also on Linux) so if there is a way to edit the context menu, it needs to be easier to discover.
Comment 1 Maik Qualmann 2024-11-10 12:28:41 UTC
On a Plasma desktop with native digiKam or macOS we use the "Open with..." menu on the desktop. There shouldn't be any problems here.
On Windows Gnome/AppImage or Windows we use our own solution. On Linux we look for *.desktop files, if the programs found are compatible with the MIME type we are looking for, it is displayed.
On Windows we have predefined *.desktop files from well-known programs, if they are present in the system, the entry is displayed.
You can create your own *.desktop files in the user context for new programs.

Maik
Comment 2 caulier.gilles 2024-11-10 12:30:39 UTC
Hi,

The OpenWith context menu do not come from digiKam but from the Desktop settings, aka Gnome or Plasma under Linux.

Gilles Caulier
Comment 3 Staffan 2024-11-10 16:15:19 UTC
(In reply to Maik Qualmann from comment #1)
> On a Plasma desktop with native digiKam or macOS we use the "Open with..."
> menu on the desktop. There shouldn't be any problems here.
> On Windows Gnome/AppImage or Windows we use our own solution. On Linux we
> look for *.desktop files, if the programs found are compatible with the MIME
> type we are looking for, it is displayed.
> On Windows we have predefined *.desktop files from well-known programs, if
> they are present in the system, the entry is displayed.
> You can create your own *.desktop files in the user context for new programs.
> 
> Maik

OK, thanks for the clarification. Adding "MimeType=application/x-extension-CR3;" to one of the *.desktop files did indeed make the program show up in the OpenWith menu. It still doesn't open the image in the selected program, but I guess that's a different problem. Do you happen to know if there are any other lines that need to be present in the *.desktop file in order for digiKam to be able to pass the image file to the selected program? (The *.desktop file is functional in that it starts the right program from the desktop, but selecting it from within digiKam does nothing and nothing shows up in syslog.)
Comment 4 Maik Qualmann 2024-11-10 16:30:57 UTC
To pass a path(s) or URL(s) add %f or %u to the program parameter if you want to start multiple instances of the program with each file individually. Add %F or %U if you want to pass a list of paths to the program.

Maik
Comment 5 Staffan 2024-11-10 16:47:18 UTC
(In reply to Maik Qualmann from comment #4)
> To pass a path(s) or URL(s) add %f or %u to the program parameter if you
> want to start multiple instances of the program with each file individually.
> Add %F or %U if you want to pass a list of paths to the program.
> 
> Maik

Yes, that's what I thought too, but it doesn't seem to work in this case. Also, 'Open with RawTherapee' works perfectly without %F or %U in the RawTherapee.AppImage.desktop file.

Anyway, I guess this isn't really about a possible bug in digiKam anymore, but thank you very much for your suggestions anyway!
Comment 6 Maik Qualmann 2024-11-10 17:03:42 UTC
If no parameter is passed, %f is always assumed.
Does your program start from the terminal with a file path? Or does it require a parameter? You can also pass that as an option. Even if your program only runs in a terminal, the *.desktop syntax knows a terminal option.

Maik
Comment 7 Staffan 2024-11-10 18:24:49 UTC
Actually, the program can be started from the command line BUT it complains that it "Could not open one or more images due to unsupported file types" (even though it can handle the image file if I load it using drag and drop once started). So the problem seems to be in how the program is called and the proper way to supply a file argument. I guess I'll experiment some more and perhaps even contact Topaz support if I can't figure it out. Thanks again.