Show only relavant items in context menu #3

Closed
satya164 opened this Issue Feb 26, 2013 · 5 comments

Projects

None yet

2 participants

@satya164

Photo shows the following options in the context menu,

  • Open with Dolphin
  • Edit with GIMP
  • Open with Gwenview

I don't have Dolphin or Gwenview installed. So they should not be shown. You can detect which applications are installed and show only the relevant options in the menu.

A better approach will be to determine the apps that register the mime-type and show an "Open with" option instead.

You can add "Move to Trash" and "Copy" options in the context menu too.

Also, the heading "Context menu options" is totally unnecessary I think.

@luspi
Owner

Detecting which app is installed is unfortunately not as easy as it sounds, since there isn't "one way" to do it (there are distros out there that do it quite different to the more common ones).
However, I like the idea of checking the default app, maybe have something like "Open With"... I'll have a look!
Adding internal functions (like copy/move to trash/etc.) is already on my todo-list...

@satya164

Detecting which app is installed is unfortunately not as easy as it sounds, since there isn't "one way" to do it (there are distros out there that do it quite different to the more common ones).

May be checking if the program is in the PATH variable will do? You won't be able to execute the command if it's not in the PATH anyways.

e.g.- in my case,

which gimp returns exit status 0
which dolphin returns exit status 1

I think it's the most accurate way :)

@luspi
Owner

Hey, good idea... I'll keep that in mind, thanks!

@satya164
@luspi
Owner

Well, it took rather long, but now, finally: c821529
On very first start-up of PhotoQt, it now checks for a few different image viewers/editors and only adds those as default that are found via 'which'...

@luspi luspi closed this Nov 15, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment