[nautilus/gnome-3-20] bug_758806_1



commit 3fcd11e8c963a8082e838a8c7519d8d10c866452
Author: Rishabh Makhija <rishabh makhija07 gmail com>
Date:   Sat Dec 12 20:37:17 2015 +0530

    bug_758806_1
    
    patch_2

 .../nautilus-file-conflict-dialog.c                |   54 ++++++++++++++++----
 1 files changed, 44 insertions(+), 10 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file-conflict-dialog.c 
b/libnautilus-private/nautilus-file-conflict-dialog.c
index d0d6c55..b81b849 100644
--- a/libnautilus-private/nautilus-file-conflict-dialog.c
+++ b/libnautilus-private/nautilus-file-conflict-dialog.c
@@ -251,8 +251,14 @@ file_list_ready_cb (GList *files,
        }
 
        str = g_string_new (NULL);
-       g_string_append_printf (str, "<b>%s</b>\n", _("Original file"));
-       g_string_append_printf (str, "%s %s\n", _("Size:"), size);
+       if (dest_is_dir) {
+               g_string_append_printf (str, "<b>%s</b>\n", _("Original folder"));
+               g_string_append_printf (str, "%s %s\n", _("Items:"), size);
+       }
+       else {
+               g_string_append_printf (str, "<b>%s</b>\n", _("Original file"));
+               g_string_append_printf (str, "%s %s\n", _("Size:"), size);
+       }
 
        if (should_show_type) {
                g_string_append_printf (str, "%s %s\n", _("Type:"), type);
@@ -282,8 +288,14 @@ file_list_ready_cb (GList *files,
                type = nautilus_file_get_string_attribute (src, "type");
        }
 
-       g_string_append_printf (str, "<b>%s</b>\n", _("Replace with"));
-       g_string_append_printf (str, "%s %s\n", _("Size:"), size);
+       if (source_is_dir) {
+               g_string_append_printf (str, "<b>%s</b>\n", dest_is_dir ? _("Merge with") : _("Replace 
with"));
+               g_string_append_printf (str, "%s %s\n", _("Items:"), size);
+       }
+       else {
+               g_string_append_printf (str, "<b>%s</b>\n", _("Replace with"));
+               g_string_append_printf (str, "%s %s\n", _("Size:"), size);
+       }
 
        if (should_show_type) {
                g_string_append_printf (str, "%s %s\n", _("Type:"), type);
@@ -463,10 +475,13 @@ nautilus_file_conflict_dialog_init (NautilusFileConflictDialog *fcd)
        GtkWidget *widget, *dialog_area;
        NautilusFileConflictDialogDetails *details;
        GtkDialog *dialog;
+       gboolean source_is_dir;
 
        details = fcd->details = NAUTILUS_FILE_CONFLICT_DIALOG_GET_PRIVATE (fcd);
        dialog = GTK_DIALOG (fcd);
 
+       source_is_dir = nautilus_file_is_directory (details->source);
+
        /* Setup the main hbox */
        hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
        dialog_area = gtk_dialog_get_content_area (dialog);
@@ -530,7 +545,8 @@ nautilus_file_conflict_dialog_init (NautilusFileConflictDialog *fcd)
 
 
        /* Setup the checkbox to apply the action to all files */
-       widget = gtk_check_button_new_with_mnemonic (_("Apply this action to all files"));
+       widget = gtk_check_button_new_with_mnemonic (_("Apply this action to all files and folders"));
+
        gtk_box_pack_start (GTK_BOX (vbox),
                            widget, FALSE, FALSE, 0);
        details->checkbox = widget;
@@ -622,12 +638,30 @@ nautilus_file_conflict_dialog_new (GtkWindow *parent,
                                   GFile *dest_dir)
 {
        GtkWidget *dialog;
+       NautilusFile *src, *dest;
+       gboolean source_is_dir, dest_is_dir;
+
+       src = nautilus_file_get (source);
+       dest = nautilus_file_get (destination);
+
+       source_is_dir = nautilus_file_is_directory (src);
+       dest_is_dir = nautilus_file_is_directory (dest);
+
+       if (source_is_dir) {
+               dialog = GTK_WIDGET (g_object_new (NAUTILUS_TYPE_FILE_CONFLICT_DIALOG,
+                                                  "use-header-bar", TRUE,
+                                                  "modal", TRUE,
+                                                  "title", dest_is_dir ? _("Merge Folder") : _("File and 
Folder conflict"),
+                                                  NULL));
+       }
+       else {
+               dialog = GTK_WIDGET (g_object_new (NAUTILUS_TYPE_FILE_CONFLICT_DIALOG,
+                                                  "use-header-bar", TRUE,
+                                                  "modal", TRUE,
+                                                  "title", dest_is_dir ? _("File and Folder conflict") : 
_("File conflict"),
+                                                  NULL));
+       }
        
-       dialog = GTK_WIDGET (g_object_new (NAUTILUS_TYPE_FILE_CONFLICT_DIALOG,
-                                          "use-header-bar", TRUE,
-                                          "modal", TRUE,
-                                          "title", _("File conflict"),
-                                          NULL));
        set_source_and_destination (dialog,
                                    source,
                                    destination,


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