Skip to content

Commit 9a13a25

Browse files
authored
nemo-view.c: Show detailed actions for some selection types (#3307)
1 parent db5cf6f commit 9a13a25

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

src/nemo-view.c

+26-6
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ struct NemoViewDetails
305305
GVolumeMonitor *volume_monitor;
306306

307307
GTimer *load_timer;
308+
309+
char *detail_string;
308310
};
309311

310312
typedef struct {
@@ -3022,6 +3024,8 @@ nemo_view_finalize (GObject *object)
30223024

30233025
g_clear_pointer (&view->details->load_timer, g_timer_destroy);
30243026

3027+
g_clear_pointer (&view->details->detail_string, g_free);
3028+
30253029
g_hash_table_destroy (view->details->non_ready_files);
30263030

30273031
G_OBJECT_CLASS (nemo_view_parent_class)->finalize (object);
@@ -3133,6 +3137,10 @@ nemo_view_display_selection_info (NemoView *view)
31333137
}
31343138

31353139
}
3140+
if (view->details->detail_string != NULL) {
3141+
g_free (view->details->detail_string);
3142+
}
3143+
view->details->detail_string = g_strdup (folder_item_count_str);
31363144
}
31373145

31383146
if (non_folder_count != 0) {
@@ -3171,11 +3179,17 @@ nemo_view_display_selection_info (NemoView *view)
31713179
items_string,
31723180
size_string);
31733181

3182+
3183+
if (view->details->detail_string != NULL) {
3184+
g_free (view->details->detail_string);
3185+
}
3186+
view->details->detail_string = g_strdup_printf (_(" (%s)"), size_string);
31743187
g_free (size_string);
3175-
g_free (items_string);
31763188
} else {
3177-
non_folder_str = items_string;
3189+
non_folder_str = g_strdup (items_string);
31783190
}
3191+
3192+
g_free (items_string);
31793193
}
31803194

31813195
free_space_str = nemo_file_get_volume_free_space (view->details->directory_as_file);
@@ -3258,6 +3272,10 @@ nemo_view_display_selection_info (NemoView *view)
32583272
non_folder_str,
32593273
obj_selected_free_space_str);
32603274
}
3275+
if (view->details->detail_string != NULL) {
3276+
g_free (view->details->detail_string);
3277+
}
3278+
view->details->detail_string = g_strdup ("");
32613279
}
32623280

32633281
g_free (free_space_str);
@@ -6818,19 +6836,21 @@ copy_or_cut_files (NemoView *view,
68186836
g_free (name);
68196837
} else {
68206838
if (cut) {
6839+
/* translators: this is preceded with a string of form 'N selected items' (N more than 1) */
68216840
status_string = g_strdup_printf (ngettext("The %'d selected item will be moved "
68226841
"if you select the Paste command",
6823-
"The %'d selected items will be moved "
6842+
"The %'d selected items%s will be moved "
68246843
"if you select the Paste command",
68256844
count),
6826-
count);
6845+
count, view->details->detail_string);
68276846
} else {
6847+
/* translators: this is preceded with a string of form 'N selected items' (N more than 1) */
68286848
status_string = g_strdup_printf (ngettext("The %'d selected item will be copied "
68296849
"if you select the Paste command",
6830-
"The %'d selected items will be copied "
6850+
"The %'d selected items%s will be copied "
68316851
"if you select the Paste command",
68326852
count),
6833-
count);
6853+
count, view->details->detail_string);
68346854
}
68356855
}
68366856

0 commit comments

Comments
 (0)