Commit 29d7bce6 authored by Clinton Rogers's avatar Clinton Rogers

Fix for #3023; we now check whether a failed external edit file creation is...

Fix for #3023; we now check whether a failed external edit file creation is due to insufficient permissions, and if so, display a friendlier error message.
parent 8ba6f59f
......@@ -650,7 +650,7 @@ public abstract class CollectionPage : MediaPage {
AppWindow.get_instance().set_normal_cursor();
} catch (Error err) {
AppWindow.get_instance().set_normal_cursor();
AppWindow.error_message(Resources.launch_editor_failed(err));
open_external_editor_error_dialog(err, photo);
}
}
......
......@@ -58,6 +58,23 @@ public File? choose_dir(string? user_title = null) {
}
}
// Ticket #3023
// Attempt to replace the system error with something friendlier
// if we can't copy an image over for editing in an external tool.
public void open_external_editor_error_dialog(Error err, Photo photo) {
// Did we fail because we can't write to this directory?
if (err is IOError.PERMISSION_DENIED || err is FileError.PERM) {
// Yes - display an alternate error message here.
AppWindow.error_message(
_("Shotwell couldn't create a file for editing this photo because you do not have " +
"permission to write to %s.").printf(photo.get_master_file().get_parent().get_path()));
} else {
// No - something else is wrong, display the error message
// the system gave us.
AppWindow.error_message(Resources.launch_editor_failed(err));
}
}
public Gtk.ResponseType export_error_dialog(File dest, bool photos_remaining) {
string message = _("Unable to export the following photo due to a file error.\n\n") +
dest.get_path();
......
......@@ -2885,8 +2885,9 @@ public class LibraryPhotoPage : EditingHostPage {
AppWindow.get_instance().set_normal_cursor();
} catch (Error err) {
AppWindow.get_instance().set_normal_cursor();
AppWindow.error_message(Resources.launch_editor_failed(err));
open_external_editor_error_dialog(err, get_photo());
}
}
private void on_external_edit_raw() {
......
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