# HG changeset patch # User zas_ # Date 1207212692 0 # Node ID 73efc1ba150fa594a5b525e8e075b2a9c0be07c4 # Parent 77f1bcc6c16104cbfc9242396f278fe761409c68 Setting no limit size to trash directory is now possible using zero as value. A tooltip was added to the spinner to inform the user of this possibility. When 0 is set, no remaining/free space check occurs. Default size of the trash was set to a 128M and maximum size is now 2048MB, which is more conform to today's standards. The delete dialog now displays more information: - if external command will be used - if safe delete is on, max size and path to the trash - if safe delete is off diff -r 77f1bcc6c161 -r 73efc1ba150f src/globals.c --- a/src/globals.c Wed Apr 02 20:44:40 2008 +0000 +++ b/src/globals.c Thu Apr 03 08:51:32 2008 +0000 @@ -43,7 +43,7 @@ gint enable_delete_key = TRUE; gint safe_delete_enable = FALSE; gchar *safe_delete_path = NULL; -gint safe_delete_size = 20; +gint safe_delete_size = 128; gint restore_tool = FALSE; gint zoom_mode = ZOOM_RESET_ORIGINAL; gint two_pass_zoom = TRUE; diff -r 77f1bcc6c161 -r 73efc1ba150f src/preferences.c --- a/src/preferences.c Wed Apr 02 20:44:40 2008 +0000 +++ b/src/preferences.c Thu Apr 03 08:51:32 2008 +0000 @@ -1383,8 +1383,9 @@ pref_checkbox_link_sensitivity(ct_button, hbox); pref_spacer(hbox, PREF_PAD_INDENT - PREF_PAD_GAP); - pref_spin_new_int(hbox, _("Maximum size:"), _("MB"), - 1, 500, 1, safe_delete_size, &safe_delete_size_c); + spin = pref_spin_new_int(hbox, _("Maximum size:"), _("MB"), + 0, 2048, 1, safe_delete_size, &safe_delete_size_c); + gtk_widget_set_tooltip_markup(spin, _("Set to 0 for unlimited size")); button = pref_button_new(NULL, NULL, _("View"), FALSE, G_CALLBACK(safe_delete_view_cb), NULL); diff -r 77f1bcc6c161 -r 73efc1ba150f src/utilops.c --- a/src/utilops.c Wed Apr 02 20:44:40 2008 +0000 +++ b/src/utilops.c Thu Apr 03 08:51:32 2008 +0000 @@ -1320,7 +1320,7 @@ total += fd->size; } - while (list && + while (safe_delete_size > 0 && list && (free_space < 0 || total + free_space > (gint64)safe_delete_size * 1048576) ) { FileData *fd; @@ -1449,7 +1449,29 @@ GtkWidget *label; gchar *buf; - buf = g_strdup_printf(_("Safe delete: %s"), (safe_delete_enable) ? _("on") : _("off")); + if (editor_command[CMD_DELETE]) + { + buf = g_strdup(_("Deletion by external command")); + } + else + { + if (safe_delete_enable) + { + gchar *buf2; + if (safe_delete_size > 0) + buf2 = g_strdup_printf(_(" (max. %d MB)"), safe_delete_size); + else + buf2 = g_strdup(""); + + buf = g_strdup_printf(_("Safe delete: %s%s\nTrash: %s"), _("on"), buf2, safe_delete_path); + g_free(buf2); + } + else + { + buf = g_strdup_printf(_("Safe delete: %s"), _("off")); + } + } + label = pref_label_new(gd->vbox, buf); g_free(buf);