flxzt / rnote

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

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

Closed Doublonmousse closed 2 weeks ago

Doublonmousse commented 1 month ago

To fix #1053.

This is a PR that's very similar to #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)

Doublonmousse commented 1 month ago

Tested on mac os (apple silicon) and windows as well. I haven't tested remote folders though.

flxzt commented 1 month ago

We should probably only use one of open or opener, reads like opener is a bit more capable without adding many dependencies, so we could switch to it entirely.

You implemented it a bit differently than expected - the alternative would be that the feature is an additional action in the folder menu at the top that opens the current workspace folder, not an action on every list item. But I guess we could have even both?

The advantage of your implementation is that when opening a file/folder, it it already selected.

Doublonmousse commented 3 weeks ago

I switched to opener and added the action to open the workspace folder in the folder submenu.

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