summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-08-31 10:53:21 +0200
committerraveit65 <[email protected]>2022-07-21 19:33:49 +0200
commitd1d5876c576a041823149d50694f114be232130f (patch)
tree00630fa75a0532073d0ca5dc6ce7509e7e7740f7 /src
parenta77e17fa5506b54ea21a1244e86c98148239ad91 (diff)
downloadcaja-d1d5876c576a041823149d50694f114be232130f.tar.bz2
caja-d1d5876c576a041823149d50694f114be232130f.tar.xz
fm-directory-view: Error message when a link could not be created
Diffstat (limited to 'src')
-rw-r--r--src/file-manager/fm-directory-view.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/file-manager/fm-directory-view.c b/src/file-manager/fm-directory-view.c
index 0d3c7a51..70db80d8 100644
--- a/src/file-manager/fm-directory-view.c
+++ b/src/file-manager/fm-directory-view.c
@@ -10732,6 +10732,8 @@ fm_directory_view_handle_netscape_url_drop (FMDirectoryView *view,
GdkScreen *screen;
int screen_num;
char *link_display_name;
+ GError *error = NULL;
+ gboolean success;
link_display_name = g_strdup_printf (_("Link to %s"), link_name);
@@ -10745,14 +10747,27 @@ fm_directory_view_handle_netscape_url_drop (FMDirectoryView *view,
screen = gtk_widget_get_screen (GTK_WIDGET (view));
screen_num = gdk_x11_screen_get_screen_number (screen);
- caja_link_local_create (target_uri != NULL ? target_uri : container_uri,
- link_name,
- link_display_name,
- "mate-fs-bookmark",
- url,
- &point,
- screen_num,
- TRUE);
+ success = caja_link_local_create (target_uri != NULL ? target_uri : container_uri,
+ link_name,
+ link_display_name,
+ "mate-fs-bookmark",
+ url,
+ &point,
+ screen_num,
+ TRUE,
+ &error);
+ if (!success) {
+ if (error) {
+ eel_show_error_dialog (_("Link Creation Failed"),
+ error->message, NULL);
+ g_error_free (error);
+ } else {
+ gchar *error_message = g_strdup_printf (_("Cannot create the link to %s"), url);
+ eel_show_error_dialog (_("Link Creation Failed"),
+ error_message, NULL);
+ g_free (error_message);
+ }
+ }
g_free (link_display_name);
}