summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Pandelea <alexandru.pandelea@gmail.com>2016-09-07 23:41:22 +0300
committerAlexandru Pandelea <alexandru.pandelea@gmail.com>2016-09-08 22:23:30 +0300
commit7823e5efdfd8a6d8656feb46e44b19f6f81c42ff (patch)
treee6896abd0c830e2c36adb96b6978c7013505f1f0
parentd3d7cce134a7147861c999d45549a48b1420a8fb (diff)
downloadnautilus-7823e5efdfd8a6d8656feb46e44b19f6f81c42ff.tar.gz
batch-rename-dialog: differentiate "files" and "folders" in the title
If all renamed files are folders, then the title will be: "Rename %d Folders" https://bugzilla.gnome.org/show_bug.cgi?id=770974
-rw-r--r--src/nautilus-batch-rename-dialog.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/nautilus-batch-rename-dialog.c b/src/nautilus-batch-rename-dialog.c
index b5eb422b8..9357d2555 100644
--- a/src/nautilus-batch-rename-dialog.c
+++ b/src/nautilus-batch-rename-dialog.c
@@ -3165,6 +3165,8 @@ nautilus_batch_rename_dialog_new (GList *selection,
{
NautilusBatchRenameDialog *dialog;
GString *dialog_title;
+ GList *l;
+ gboolean all_targets_are_folders;
dialog = g_object_new (NAUTILUS_TYPE_BATCH_RENAME_DIALOG, "use-header-bar", TRUE, NULL);
@@ -3175,10 +3177,29 @@ nautilus_batch_rename_dialog_new (GList *selection,
gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (window));
+ all_targets_are_folders = TRUE;
+ for (l = selection; l != NULL; l = l->next)
+ {
+ if (!nautilus_file_is_directory (NAUTILUS_FILE (l->data)))
+ {
+ all_targets_are_folders = FALSE;
+ break;
+ }
+ }
+
dialog_title = g_string_new ("");
- g_string_append_printf (dialog_title,
- ngettext ("Rename %d File", "Rename %d Files", g_list_length (selection)),
- g_list_length (selection));
+ if (all_targets_are_folders)
+ {
+ g_string_append_printf (dialog_title,
+ ngettext ("Rename %d Folder", "Rename %d Folders", g_list_length (selection)),
+ g_list_length (selection));
+ }
+ else
+ {
+ g_string_append_printf (dialog_title,
+ ngettext ("Rename %d File", "Rename %d Files", g_list_length (selection)),
+ g_list_length (selection));
+ }
gtk_window_set_title (GTK_WINDOW (dialog), dialog_title->str);
nautilus_batch_rename_dialog_initialize_actions (dialog);