[nautilus] window-slot: Add file name to file not found dialog



commit 3b226230fdd760eabe2f752eccf0e8daa6655feb
Author: Abanoub Ghadban <abanoub gdb gmail com>
Date:   Sat Jun 5 13:11:36 2021 +0200

    window-slot: Add file name to file not found dialog
    
    Nautilus can show "Unable to find the requested file. Please check the
    spelling and try again." error when starting. The message doesn't indicate
    what file was not found. Let's add the file name to that dialog to make it
    obvious.
    
    Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1793

 src/nautilus-window-slot.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 0310a3be0..0ae084795 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -1583,6 +1583,7 @@ nautilus_window_slot_display_view_selection_failure (NautilusWindow *window,
     char *error_message;
     char *detail_message;
     char *scheme_string;
+    char *file_path;
 
     /* Some sort of failure occurred. How 'bout we tell the user? */
 
@@ -1605,7 +1606,17 @@ nautilus_window_slot_display_view_selection_failure (NautilusWindow *window,
         {
             case G_IO_ERROR_NOT_FOUND:
             {
-                detail_message = g_strdup (_("Unable to find the requested file. Please check the spelling 
and try again."));
+                file_path = g_file_get_path (location);
+                if (file_path != NULL)
+                {
+                    detail_message = g_strdup_printf (_("Unable to find ā€œ%sā€. Please check the spelling and 
try again."),
+                                                      file_path);
+                }
+                else
+                {
+                    detail_message = g_strdup (_("Unable to find the requested file. Please check the 
spelling and try again."));
+                }
+                g_free (file_path);
             }
             break;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]