Commit 1cbcb0d0 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

tell the user how much memory will be freed by clearing the undo history.

2005-05-07  Sven Neumann  <sven@gimp.org>

	* app/actions/edit-commands.c (edit_undo_clear_cmd_callback): tell
	the user how much memory will be freed by clearing the undo history.
parent 349f852c
2005-05-07 Sven Neumann <sven@gimp.org>
* app/actions/edit-commands.c (edit_undo_clear_cmd_callback): tell
the user how much memory will be freed by clearing the undo history.
2005-05-07 Sven Neumann <sven@gimp.org> 2005-05-07 Sven Neumann <sven@gimp.org>
* app/tools/gimppainttool.[ch] * app/tools/gimppainttool.[ch]
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h" #include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h" #include "actions-types.h"
...@@ -98,6 +99,9 @@ edit_undo_clear_cmd_callback (GtkAction *action, ...@@ -98,6 +99,9 @@ edit_undo_clear_cmd_callback (GtkAction *action,
GimpImage *gimage; GimpImage *gimage;
GtkWidget *widget; GtkWidget *widget;
GtkWidget *dialog; GtkWidget *dialog;
gchar *size;
guint64 memsize;
guint64 guisize;
return_if_no_image (gimage, data); return_if_no_image (gimage, data);
return_if_no_widget (widget, data); return_if_no_widget (widget, data);
...@@ -126,6 +130,20 @@ edit_undo_clear_cmd_callback (GtkAction *action, ...@@ -126,6 +130,20 @@ edit_undo_clear_cmd_callback (GtkAction *action,
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box, gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Really clear image's undo history?")); _("Really clear image's undo history?"));
memsize = gimp_object_get_memsize (GIMP_OBJECT (gimage->undo_stack),
&guisize);
memsize += guisize;
memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->redo_stack),
&guisize);
memsize += guisize;
size = gimp_memsize_to_string (memsize);
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
_("Clearing the undo history of this "
"image will gain %s of memory."), size);
g_free (size);
gtk_widget_show (dialog); gtk_widget_show (dialog);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment