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

Open Containing Folder opens the actual file instead of the folder #6449

Closed
1 task done
discip opened this issue Aug 13, 2024 · 7 comments · Fixed by #6469
Closed
1 task done

Open Containing Folder opens the actual file instead of the folder #6449

discip opened this issue Aug 13, 2024 · 7 comments · Fixed by #6469
Labels
bug Something isn't working

Comments

@discip
Copy link
Contributor

discip commented Aug 13, 2024

Is there an existing issue for this problem?

  • I have searched the existing issues

OrcaSlicer Version

7082e94

System Details Report


  • Date generated: 2024-08-13 15:47:20

Hardware Information:

  • Hardware Model: ASUS ROG STRIX X670E-E GAMING WIFI
  • Memory: 32,0 GiB
  • Processor: AMD Ryzen™ 9 7950X3D × 32
  • Graphics: AMD Radeon™ RX 7900 XTX
  • Disk Capacity: 2,0 TB

Software Information:

  • Firmware Version: 2007
  • OS Name: Manjaro Linux
  • OS Build: rolling
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: Wayland
  • Kernel Version: Linux 6.8.12-3-MANJARO

How to reproduce

  1. Launch Orca and navigate to the Home screen,
  2. right click on any project file and
  3. click Open Containing Folder

Actual results

Instead of the containing folder, the actual file is opened in another instance of Orca.

Expected results

The folder containing the project file should open.

@discip discip added the bug Something isn't working label Aug 13, 2024
@discip discip changed the title **Open Containing Folder** opens the actual file instead of the folder Open Containing Folder opens the actual file instead of the folder Aug 13, 2024
@discip
Copy link
Contributor Author

discip commented Aug 13, 2024

@Noisyfox
There seem to be even more Linux specific quirks.
Any idea on that one?

@Noisyfox
Copy link
Collaborator

Noisyfox commented Aug 14, 2024

Yeah, linux does not have a common "open containing folder" command. I think the best option is to open the folder without the file been seleceted automaically, instead of using a disto-specific command.

@discip
Copy link
Contributor Author

discip commented Aug 14, 2024

So, ... is there anything that could be done to solve this?

@Noisyfox
Copy link
Collaborator

I think the best option is to open the folder without the file been seleceted automaically, instead of using a disto-specific command.

This.

@discip
Copy link
Contributor Author

discip commented Aug 14, 2024

Sorry, I'm not able to follow.😅
What exactly do you mean?

@Noisyfox
Copy link
Collaborator

A proper "Open containing folder" command does two things:

  1. Open the file browser and navigate to the folder that contains the target file
  2. Automatically select the target file in the opening file browser window

To achieve this on Linux, a proper implementation will look something like this: https://github.com/chromium/chromium/blob/81e87b5df4454f9e3d73306171b9840c1c09d1a7/chrome/browser/platform_util_linux.cc#L62-L293

It's just too much effort for such a simple thing, especially when you can achieve this with (almost) a single command on Windows and macOS:

const wxString widepath = from_u8(path);
::wxExecute(L"explorer /select," + widepath, wxEXEC_ASYNC, nullptr);
#elif __APPLE__
openFolderForFile(from_u8(path));

So, instead, for Linux I think it's much easier to just do step 1 without step 2, which should be achieved by a std::filesystem::path::parent_path then an xdg-open command.

@discip
Copy link
Contributor Author

discip commented Aug 14, 2024

Thank you for the thorough explanation. 👍

So, instead, for Linux I think it's much easier to just do step 1 without step 2,

I totally agree, but I don't know how to achieve the following:

which should be achieved by a std::filesystem::path::parent_path then an xdg-open command.

Noisyfox added a commit to Noisyfox/OrcaSlicer that referenced this issue Aug 15, 2024
Noisyfox added a commit to Noisyfox/OrcaSlicer that referenced this issue Aug 15, 2024
SoftFever pushed a commit that referenced this issue Aug 18, 2024
Fix "Open Containing Folder" on Linux (#6449)
henrivdr pushed a commit to henrivdr/OrcaSlicer that referenced this issue Aug 27, 2024
Azio-Pantheon pushed a commit to Pantheon-Design/PantheonSlicer-3 that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants