Mercurial > geeqie
changeset 223:73efc1ba150f
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
author | zas_ |
---|---|
date | Thu, 03 Apr 2008 08:51:32 +0000 |
parents | 77f1bcc6c161 |
children | 83f92073e74c |
files | src/globals.c src/preferences.c src/utilops.c |
diffstat | 3 files changed, 28 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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);
--- 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);