[nautilus: 1/2] properties-window: Don't use eel_show_error_dialog



commit 0793592df14c5938ed05ea24d7c2eb1025c1ee17
Author: George Mocanu <mocanu geo98 gmail com>
Date:   Wed Mar 28 02:11:03 2018 +0300

    properties-window: Don't use eel_show_error_dialog
    
    Instead of using eel_show_error_dialog, use the show_error_dialog
    function from nautilus-ui-utilities.h header.
    
    https://gitlab.gnome.org/GNOME/nautilus/issues/331

 src/nautilus-application.c              |  2 +-
 src/nautilus-error-reporting.c          | 12 ++++++----
 src/nautilus-mime-actions.c             | 16 +++++++------
 src/nautilus-mime-application-chooser.c | 20 ++++++++--------
 src/nautilus-program-choosing.c         | 41 +++++++++++++++------------------
 src/nautilus-properties-window.c        | 29 +++++++++++------------
 6 files changed, 59 insertions(+), 61 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 8d8204384..21c3ac697 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -192,7 +192,7 @@ check_required_directories (NautilusApplication *self)
                                              directories_as_string->str);
         }
 
-        dialog = eel_show_error_dialog (error_string, detail_string, NULL);
+        dialog = show_error_dialog (error_string, detail_string, NULL);
         /* We need the main event loop so the user has a chance to see the dialog. */
         gtk_application_add_window (GTK_APPLICATION (self),
                                     GTK_WINDOW (dialog));
diff --git a/src/nautilus-error-reporting.c b/src/nautilus-error-reporting.c
index 50a979d93..547edb904 100644
--- a/src/nautilus-error-reporting.c
+++ b/src/nautilus-error-reporting.c
@@ -30,6 +30,8 @@
 #include <eel/eel-string.h>
 #include <eel/eel-stock-dialogs.h>
 
+#include "nautilus-ui-utilities.h"
+
 #define DEBUG_FLAG NAUTILUS_DEBUG_DIRECTORY_VIEW
 #include "nautilus-debug.h"
 
@@ -110,7 +112,7 @@ nautilus_report_error_loading_directory (NautilusFile *file,
         message = g_strdup (error->message);
     }
 
-    eel_show_error_dialog (_("This location could not be displayed."), message, parent_window);
+    show_error_dialog (_("This location could not be displayed."), message, parent_window);
 }
 
 void
@@ -162,7 +164,7 @@ nautilus_report_error_setting_group (NautilusFile *file,
     }
 
 
-    eel_show_error_dialog (_("The group could not be changed."), message, parent_window);
+    show_error_dialog (_("The group could not be changed."), message, parent_window);
 }
 
 void
@@ -186,7 +188,7 @@ nautilus_report_error_setting_owner (NautilusFile *file,
     message = g_strdup_printf (_("Sorry, could not change the owner of “%s”: %s"),
                                truncated_name, truncated_error_message);
 
-    eel_show_error_dialog (_("The owner could not be changed."), message, parent_window);
+    show_error_dialog (_("The owner could not be changed."), message, parent_window);
 }
 
 void
@@ -210,7 +212,7 @@ nautilus_report_error_setting_permissions (NautilusFile *file,
     message = g_strdup_printf (_("Sorry, could not change the permissions of “%s”: %s"),
                                truncated_name, truncated_error_message);
 
-    eel_show_error_dialog (_("The permissions could not be changed."), message, parent_window);
+    show_error_dialog (_("The permissions could not be changed."), message, parent_window);
 }
 
 typedef struct _NautilusRenameData
@@ -311,7 +313,7 @@ nautilus_report_error_renaming_file (NautilusFile *file,
                                    truncated_error_message);
     }
 
-    eel_show_error_dialog (_("The item could not be renamed."), message, parent_window);
+    show_error_dialog (_("The item could not be renamed."), message, parent_window);
 }
 
 static void
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 043cb2ae6..c59a4f7af 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -44,6 +44,8 @@
 #include "nautilus-global-preferences.h"
 #include "nautilus-signaller.h"
 #include "nautilus-metadata.h"
+#include "nautilus-ui-utilities.h"
+
 
 #define DEBUG_FLAG NAUTILUS_DEBUG_MIME
 #include "nautilus-debug.h"
@@ -1182,8 +1184,8 @@ search_for_application_dbus_call_notify_cb (GDBusProxy   *proxy,
             message = g_strdup_printf ("%s\n%s",
                                        _("There was an internal error trying to search for applications:"),
                                        error->message);
-            eel_show_error_dialog (_("Unable to search for application"), message,
-                                   parameters_install->parent_window);
+            show_error_dialog (_("Unable to search for application"), message,
+                               parameters_install->parent_window);
             g_free (message);
         }
         else
@@ -1899,7 +1901,7 @@ activation_mount_not_mounted_callback (GObject      *source_object,
              error->code != G_IO_ERROR_FAILED_HANDLED &&
              error->code != G_IO_ERROR_ALREADY_MOUNTED))
         {
-            eel_show_error_dialog (_("Unable to access location"), error->message, 
parameters->parent_window);
+            show_error_dialog (_("Unable to access location"), error->message, parameters->parent_window);
         }
 
         if (error->domain != G_IO_ERROR ||
@@ -2194,8 +2196,8 @@ activation_mountable_mounted (NautilusFile *file,
              error->code != G_IO_ERROR_FAILED_HANDLED &&
              error->code != G_IO_ERROR_ALREADY_MOUNTED))
         {
-            eel_show_error_dialog (_("Unable to access location"),
-                                   error->message, parameters->parent_window);
+            show_error_dialog (_("Unable to access location"),
+                               error->message, parameters->parent_window);
         }
 
         if (error->code == G_IO_ERROR_CANCELLED)
@@ -2283,8 +2285,8 @@ activation_mountable_started (NautilusFile *file,
             (error->code != G_IO_ERROR_CANCELLED &&
              error->code != G_IO_ERROR_FAILED_HANDLED))
         {
-            eel_show_error_dialog (_("Unable to start location"),
-                                   error->message, NULL);
+            show_error_dialog (_("Unable to start location"),
+                               error->message, NULL);
         }
 
         if (error->code == G_IO_ERROR_CANCELLED)
diff --git a/src/nautilus-mime-application-chooser.c b/src/nautilus-mime-application-chooser.c
index 146edaa80..43399e0c3 100644
--- a/src/nautilus-mime-application-chooser.c
+++ b/src/nautilus-mime-application-chooser.c
@@ -28,7 +28,7 @@
 
 #include "nautilus-file.h"
 #include "nautilus-signaller.h"
-#include <eel/eel-stock-dialogs.h>
+#include "nautilus-ui-utilities.h"
 
 #include <string.h>
 #include <glib/gi18n-lib.h>
@@ -84,9 +84,9 @@ add_clicked_cb (GtkButton *button,
     {
         message = g_strdup_printf (_("Error while adding “%s”: %s"),
                                    g_app_info_get_display_name (info), error->message);
-        eel_show_error_dialog (_("Could not add application"),
-                               message,
-                               GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (chooser))));
+        show_error_dialog (_("Could not add application"),
+                           message,
+                           GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (chooser))));
         g_error_free (error);
         g_free (message);
     }
@@ -116,9 +116,9 @@ remove_clicked_cb (GtkMenuItem *item,
                                               chooser->content_type,
                                               &error))
         {
-            eel_show_error_dialog (_("Could not forget association"),
-                                   error->message,
-                                   GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (chooser))));
+            show_error_dialog (_("Could not forget association"),
+                               error->message,
+                               GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (chooser))));
             g_error_free (error);
         }
 
@@ -181,9 +181,9 @@ set_as_default_clicked_cb (GtkButton *button,
     {
         message = g_strdup_printf (_("Error while setting “%s” as default application: %s"),
                                    g_app_info_get_display_name (info), error->message);
-        eel_show_error_dialog (_("Could not set as default"),
-                               message,
-                               GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (chooser))));
+        show_error_dialog (_("Could not set as default"),
+                           message,
+                           GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (chooser))));
     }
 
     g_object_unref (info);
diff --git a/src/nautilus-program-choosing.c b/src/nautilus-program-choosing.c
index 4cbff429f..9954ec65e 100644
--- a/src/nautilus-program-choosing.c
+++ b/src/nautilus-program-choosing.c
@@ -26,6 +26,7 @@
 #include "nautilus-global-preferences.h"
 #include "nautilus-icon-info.h"
 #include "nautilus-recent.h"
+#include "nautilus-ui-utilities.h"
 #include <eel/eel-stock-dialogs.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
@@ -335,11 +336,9 @@ nautilus_launch_desktop_file (GdkScreen   *screen,
     {
         g_free (desktop_file_path);
         g_object_unref (desktop_file);
-        eel_show_error_dialog
-            (_("Sorry, but you cannot execute commands from "
-               "a remote site."),
-            _("This is disabled due to security considerations."),
-            parent_window);
+        show_error_dialog(_("Sorry, but you cannot execute commands from a remote site."),
+                          _("This is disabled due to security considerations."),
+                          parent_window);
 
         return;
     }
@@ -349,10 +348,9 @@ nautilus_launch_desktop_file (GdkScreen   *screen,
     g_free (desktop_file_path);
     if (app_info == NULL)
     {
-        eel_show_error_dialog
-            (_("There was an error launching the application."),
-            NULL,
-            parent_window);
+        show_error_dialog(_("There was an error launching the application."),
+                          NULL,
+                          parent_window);
         return;
     }
 
@@ -378,11 +376,10 @@ nautilus_launch_desktop_file (GdkScreen   *screen,
         if (count == 0)
         {
             /* all files are non-local */
-            eel_show_error_dialog
-                (_("This drop target only supports local files."),
-                _("To open non-local files copy them to a local folder and then"
-                  " drop them again."),
-                parent_window);
+            show_error_dialog(_("This drop target only supports local files."),
+                              _("To open non-local files copy them to a local folder and then"
+                              " drop them again."),
+                              parent_window);
 
             g_list_free_full (files, g_object_unref);
             g_object_unref (app_info);
@@ -391,11 +388,10 @@ nautilus_launch_desktop_file (GdkScreen   *screen,
         else if (count != total)
         {
             /* some files are non-local */
-            eel_show_warning_dialog
-                (_("This drop target only supports local files."),
-                _("To open non-local files copy them to a local folder and then"
-                  " drop them again. The local files you dropped have already been opened."),
-                parent_window);
+            eel_show_warning_dialog(_("This drop target only supports local files."),
+                                    _("To open non-local files copy them to a local folder and then"
+                                    " drop them again. The local files you dropped have already been 
opened."),
+                                    parent_window);
         }
     }
 
@@ -427,10 +423,9 @@ nautilus_launch_desktop_file (GdkScreen   *screen,
     if (error != NULL)
     {
         message = g_strconcat (_("Details: "), error->message, NULL);
-        eel_show_error_dialog
-            (_("There was an error launching the application."),
-            message,
-            parent_window);
+        show_error_dialog(_("There was an error launching the application."),
+                          message,
+                          parent_window);
 
         g_error_free (error);
         g_free (message);
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 66828e9ba..10b315c37 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -23,6 +23,7 @@
 
 #include "nautilus-properties-window.h"
 
+#include "nautilus-ui-utilities.h"
 #include "nautilus-desktop-item-properties.h"
 #include "nautilus-error-reporting.h"
 #include "nautilus-mime-actions.h"
@@ -53,6 +54,7 @@
 #include "nautilus-metadata.h"
 #include "nautilus-mime-application-chooser.h"
 #include "nautilus-module.h"
+#include "nautilus-ui-utilities.h"
 
 #define PREVIEW_IMAGE_WIDTH 96
 
@@ -485,10 +487,9 @@ nautilus_properties_window_drag_data_received (GtkWidget        *widget,
 
     if (!exactly_one)
     {
-        eel_show_error_dialog
-            (_("You cannot assign more than one custom icon at a time!"),
-            _("Please drop just one image to set a custom icon."),
-            window);
+        show_error_dialog(_("You cannot assign more than one custom icon at a time!"),
+                          _("Please drop just one image to set a custom icon."),
+                          window);
     }
     else
     {
@@ -503,17 +504,15 @@ nautilus_properties_window_drag_data_received (GtkWidget        *widget,
             f = g_file_new_for_uri (uris[0]);
             if (!g_file_is_native (f))
             {
-                eel_show_error_dialog
-                    (_("The file that you dropped is not local."),
-                    _("You can only use local images as custom icons."),
-                    window);
+                show_error_dialog(_("The file that you dropped is not local."),
+                                  _("You can only use local images as custom icons."),
+                                  window);
             }
             else
             {
-                eel_show_error_dialog
-                    (_("The file that you dropped is not an image."),
-                    _("You can only use local images as custom icons."),
-                    window);
+                show_error_dialog(_("The file that you dropped is not an image."),
+                                  _("You can only use local images as custom icons."),
+                                  window);
             }
             g_object_unref (f);
         }
@@ -3113,9 +3112,9 @@ open_in_disks (GtkButton                *button,
     if (error != NULL)
     {
         message = g_strdup_printf (_("Details: %s"), error->message);
-        eel_show_error_dialog (_("There was an error launching the application."),
-                               message,
-                               GTK_WINDOW (self));
+        show_error_dialog (_("There was an error launching the application."),
+                           message,
+                           GTK_WINDOW (self));
     }
 }
 


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