Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Proper fix for "Show in OS" for Linux. #477

Merged
merged 4 commits into from
Oct 24, 2014

Conversation

radorodopski
Copy link
Contributor

Proper fix for "Show in OS" for Linux.

Now using an IPC method call (FileManager1.ShowItems) to show the file (highlighted) in its directory.
Also updated the appshell.gyp file.
Using the new DBus bindings which are provided by the GLib library (requires libglib-2.0 version 2.26 and up), so this no longer requires the old binding library (libdbus-glib-1).

If for some reason the above solution fails, the fallback behavior is to just open the directory containing the file (without the file being highlighted). This is done by calling gtk_show_uri() on the file's parent directory.

This is for https://trello.com/c/RF1ddQGK/898-linux-show-in-os-for-selected-file

…r Linux. The target file is being highlighted, and "Show Extension Folder" (still) works.

For the highlighting to work, I had to detect the default file manager on the system, then run it with the target file as a parameter. If we failed to automatically determine the default file manager, the fallback behavior is to just open the directory containing the file (without the file being highlighted).
This is for https://trello.com/c/RF1ddQGK/898-linux-show-in-os-for-selected-file
Now using a IPC call to FileManager1, similar to what Firefox does.
The fallback remains the same. That is - call gtk_show_uri() on the file's parent directory (probably not needed, but just in case). Also, fixed the URI generation.

Also, updated the appshell.gyp file to include the new compilation/linking flags needed for the new function to compile properly.
The library "libdbus-glib-1-dev" is now a dependency, so it should be added to the wiki page.
@radorodopski radorodopski changed the title Added proper implementation of the "ShowFolderInOSWindow" function for Linux Proper fix for "Show in OS" for Linux. Oct 21, 2014
@radorodopski
Copy link
Contributor Author

Please note that this is (IMO) a more robust solution than PR #473

@ingorichter ingorichter self-assigned this Oct 21, 2014
The GLib library now includes its own DBus bindings, and so they recommend switching to the new bindings for new applications.
This requires glib-2.0 version at least 2.26 (at the moment of writing the latest version is 2.40).
Removed the dependency of the binding library (libdbus-glib-1), updated appshell.gyp accordingly.
@ingorichter
Copy link
Contributor

Looks good to me. Would you mind signing the CLA http://dev.brackets.io/brackets-contributor-license-agreement.html? This is required for us to accept contributions. Thanks

@radorodopski
Copy link
Contributor Author

Sure, I thought I signed that more than a year ago but maybe I'm mistaken.
I just signed the CLA. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants