[nautilus] Replace eel_show_warning_dialog()



commit 50082ee2a3d93ac822a19fa0303ee3d13ccc716e
Author: George Mocanu <mocanu geo98 gmail com>
Date:   Wed Apr 18 15:00:24 2018 +0300

    Replace eel_show_warning_dialog()
    
    We need to move away from using eel and port most functionalities
    inside nautilus.
    
    Replaced the usage of eel_show_warning_dialog() with the show_dialog()
    alternative.
    
    https://gitlab.gnome.org/GNOME/nautilus/issues/331

 src/nautilus-file-utilities.c   |  9 +++++----
 src/nautilus-files-view-dnd.c   | 23 +++++++++++++----------
 src/nautilus-program-choosing.c | 10 +++++-----
 3 files changed, 23 insertions(+), 19 deletions(-)
---
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index e27fef428..a322d4d92 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -30,8 +30,8 @@
 #include "nautilus-file-operations.h"
 #include "nautilus-search-directory.h"
 #include "nautilus-starred-directory.h"
+#include "nautilus-ui-utilities.h"
 #include <eel/eel-glib-extensions.h>
-#include <eel/eel-stock-dialogs.h>
 #include <eel/eel-string.h>
 #include <eel/eel-debug.h>
 #include <eel/eel-vfs-extensions.h>
@@ -926,9 +926,10 @@ nautilus_restore_files_from_trash (GList     *files,
         message = g_strdup_printf (_("Could not determine original location of ā€œ%sā€ "), file_name);
         g_free (file_name);
 
-        eel_show_warning_dialog (message,
-                                 _("The item cannot be restored from trash"),
-                                 parent_window);
+        show_dialog (message,
+                     _("The item cannot be restored from trash"),
+                     parent_window,
+                     GTK_MESSAGE_WARNING);
         g_free (message);
     }
 
diff --git a/src/nautilus-files-view-dnd.c b/src/nautilus-files-view-dnd.c
index ca4714ee6..dd26582d5 100644
--- a/src/nautilus-files-view-dnd.c
+++ b/src/nautilus-files-view-dnd.c
@@ -30,7 +30,6 @@
 #include "nautilus-files-view.h"
 #include "nautilus-application.h"
 
-#include <eel/eel-stock-dialogs.h>
 #include <eel/eel-string.h>
 #include <eel/eel-vfs-extensions.h>
 
@@ -39,6 +38,7 @@
 #include "nautilus-clipboard.h"
 #include "nautilus-dnd.h"
 #include "nautilus-global-preferences.h"
+#include "nautilus-ui-utilities.h"
 
 #define GET_ANCESTOR(obj) \
     GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (obj), GTK_TYPE_WINDOW))
@@ -145,9 +145,10 @@ nautilus_files_view_handle_netscape_url_drop (NautilusFilesView *view,
 
     if (!g_file_is_native (f))
     {
-        eel_show_warning_dialog (_("Drag and drop is not supported."),
-                                 _("Drag and drop is only supported on local file systems."),
-                                 GET_ANCESTOR (view));
+        show_dialog (_("Drag and drop is not supported."),
+                     _("Drag and drop is only supported on local file systems."),
+                     GET_ANCESTOR (view),
+                     GTK_MESSAGE_WARNING);
         g_object_unref (f);
         return;
     }
@@ -185,9 +186,10 @@ nautilus_files_view_handle_netscape_url_drop (NautilusFilesView *view,
         (action != GDK_ACTION_MOVE) &&
         (action != GDK_ACTION_LINK))
     {
-        eel_show_warning_dialog (_("Drag and drop is not supported."),
-                                 _("An invalid drag type was used."),
-                                 GET_ANCESTOR (view));
+        show_dialog (_("Drag and drop is not supported."),
+                     _("An invalid drag type was used."),
+                     GET_ANCESTOR (view),
+                     GTK_MESSAGE_WARNING);
         return;
     }
 
@@ -277,9 +279,10 @@ nautilus_files_view_handle_uri_list_drop (NautilusFilesView *view,
         (action != GDK_ACTION_MOVE) &&
         (action != GDK_ACTION_LINK))
     {
-        eel_show_warning_dialog (_("Drag and drop is not supported."),
-                                 _("An invalid drag type was used."),
-                                 GET_ANCESTOR (view));
+        show_dialog (_("Drag and drop is not supported."),
+                     _("An invalid drag type was used."),
+                     GET_ANCESTOR (view),
+                     GTK_MESSAGE_WARNING);
         g_free (container_uri);
         return;
     }
diff --git a/src/nautilus-program-choosing.c b/src/nautilus-program-choosing.c
index e283b947a..81a9dee58 100644
--- a/src/nautilus-program-choosing.c
+++ b/src/nautilus-program-choosing.c
@@ -27,7 +27,6 @@
 #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>
 #include <gio/gio.h>
@@ -390,10 +389,11 @@ 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);
+            show_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,
+                         GTK_MESSAGE_WARNING);
         }
     }
 


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