Commit 44fa2677 authored by Timo Witte's avatar Timo Witte Committed by Lucas Beeler

Nautilus now highlights the backing file itself (as opposed to merely showing...

Nautilus now highlights the backing file itself (as opposed to merely showing the enclosing directory) when the "Show in File Manager" option is chosen from the "File" menu. Adds Timo Witte, the author of this changeset, to the THANKS file.
parent e8a13a4f
......@@ -46,6 +46,7 @@ Wolfgang Steitz <wolfer7@web.de>
Marcel Stimberg <stimberg@users.sourceforge.net>
Vincent Untz <vuntz@gnome.org>
Timo Westkämper <timo.westkamper@gmail.com>
Timo Witte <timo.witte@googlemail.com>
Shan Xiong <shan.xiong@gmail.com>
Translations courtesy of:
......
......@@ -714,7 +714,7 @@ public abstract class AppWindow : PageWindow {
return;
try {
AppWindow.get_instance().show_file_uri(media.get_master_file().get_parent());
AppWindow.get_instance().show_file_uri(media.get_master_file());
} catch (Error err) {
AppWindow.error_message(Resources.jump_to_file_failed(err));
}
......@@ -725,7 +725,12 @@ public abstract class AppWindow : PageWindow {
}
public void show_file_uri(File file) throws Error {
show_uri(file.get_uri());
// if file manager is nautilus then pass the full path to file; otherwise pass
// the enclosing directory
if(get_nautilus_install_location() != null)
show_file_in_nautilus(file.get_uri());
else
show_uri(file.get_parent().get_uri());
}
public void show_uri(string url) throws Error {
......
......@@ -15,10 +15,18 @@ File? get_sys_install_dir(File exec_dir) {
return exec_dir.has_prefix(prefix_dir) ? prefix_dir : null;
}
string get_nautilus_install_location() {
return Environment.find_program_in_path("nautilus");
}
void sys_show_uri(Gdk.Screen screen, string uri) throws Error {
Gtk.show_uri(screen, uri, Gdk.CURRENT_TIME);
}
void show_file_in_nautilus(string filename) throws Error {
GLib.Process.spawn_command_line_async(get_nautilus_install_location() + " " + filename);
}
int posix_wexitstatus(int status) {
return (((status) & 0xff00) >> 8);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment