[nautilus: 2/3] file-operations: Port error details inline



commit 490a6cbeb8684b7293d426ef0b139502c288fed0
Author: Alexandru Fazakas <alex fazakas97 yahoo com>
Date:   Thu Dec 21 00:11:39 2017 +0200

    file-operations: Port error details inline
    
    As the eel_gtk_message_dialog_set_details_label function is only used once,
    we can safely remove it and do everything inside of nautilus-file-operations.c.
    
    Thus, we deleted the eel function and we do everything inside the
    do_run_simple_dialog function and remove the function header from the header
    file. We add the label straight into the content_area of the dialog box.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=598671

 eel/eel-gtk-extensions.c       | 18 ------------------
 eel/eel-gtk-extensions.h       |  4 ----
 src/nautilus-file-operations.c | 14 ++++++++++++--
 3 files changed, 12 insertions(+), 24 deletions(-)
---
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index eb45cbf6d..8e7a35753 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -289,21 +289,3 @@ eel_gtk_menu_insert_separator (GtkMenu *menu,
     return GTK_MENU_ITEM (menu_item);
 }
 
-void
-eel_gtk_message_dialog_set_details_label (GtkMessageDialog *dialog,
-                                          const gchar      *details_text)
-{
-    GtkWidget *content_area, *details_container, *label;
-    content_area = gtk_message_dialog_get_message_area (dialog);
-    details_container = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
-
-    label = gtk_label_new (details_text);
-    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-    gtk_label_set_selectable (GTK_LABEL (label), TRUE);
-    gtk_label_set_xalign (GTK_LABEL (label), 0);
-
-    gtk_container_add (GTK_CONTAINER (details_container), label);
-    gtk_box_pack_start (GTK_BOX (content_area), details_container, FALSE, FALSE, 0);
-
-    gtk_widget_show (label);
-}
diff --git a/eel/eel-gtk-extensions.h b/eel/eel-gtk-extensions.h
index 03e467955..868728820 100644
--- a/eel/eel-gtk-extensions.h
+++ b/eel/eel-gtk-extensions.h
@@ -44,8 +44,4 @@ GtkMenuItem *         eel_gtk_menu_append_separator                   (GtkMenu
 GtkMenuItem *         eel_gtk_menu_insert_separator                   (GtkMenu              *menu,
                                                                       int                   index);
 
-/* GtkMessageDialog */
-void                  eel_gtk_message_dialog_set_details_label        (GtkMessageDialog          *dialog,
-                                                                      const gchar               
*details_text);
-
 #endif /* EEL_GTK_EXTENSIONS_H */
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 546acf835..457196c7c 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -1227,8 +1227,18 @@ do_run_simple_dialog (gpointer _data)
 
     if (data->details_text)
     {
-        eel_gtk_message_dialog_set_details_label (GTK_MESSAGE_DIALOG (dialog),
-                                                  data->details_text);
+       GtkWidget *content_area, *label;
+       content_area = gtk_message_dialog_get_message_area (dialog);
+
+        label = gtk_label_new (data->details_text);
+        gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+        gtk_label_set_selectable (GTK_LABEL (label), TRUE);
+        gtk_label_set_xalign (GTK_LABEL (label), 0);
+
+        gtk_container_add (GTK_CONTAINER (content_area), label);
+        gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 0);
+
+        gtk_widget_show (label);
     }
 
     /* Run it. */


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