flxzt / rnote

Sketch and take handwritten notes.
https://rnote.flxzt.net
GNU General Public License v3.0
6.42k stars 215 forks source link

feat: Open files/folder in the file explorer #1117

Open Doublonmousse opened 2 weeks ago

Doublonmousse commented 2 weeks ago

Reopening #1089 after a github mess...

To fix #1053

I switched to opener and added the action to open the workspace folder in the folder submenu. This is a PR that's very similar to https://github.com/flxzt/rnote/pull/868, using a slightly different crate (opener) that has a reveal call and a MIT OR Apache-2.0 license.

The implementation detail for this is here https://docs.rs/opener/latest/opener/fn.reveal.html The open crate doesn't have this option afaik but having two crates doing very similar things is slightly redundant

Tested only on linux aarch64 for now (but should be supported on all platforms)

image

One thing to verify is that opener does not have the same open::that_detached option, only opener::open and I don't know if that makes a difference or not

flxzt commented 2 weeks ago

One thing to verify is that opener does not have the same open::that_detached option, only opener::open and I don't know if that makes a difference or not

Interesting - the docs and the implementation suggest that it doesn't take care of being non-blocking nor being detached from the rnote process. I think on my Gnome installation it ends up being okay because it launches through dbus but for other systems/file-managers this might be an issue. Need to test it more with different distributions.

Otherwise going with opener seems to be the right choice, looks like it handles many edge-cases and a variety of different systems