Commit dea7c482 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Fix bug #145492:

2005-10-29  Michael Natterer  <mitch@gimp.org>

	 Fix bug #145492:

	* app/actions/file-commands.c (file_save_cmd_callback)
	* app/dialogs/file-save-dialog.c (file_save_dialog_save_image):
	set the "file-quit" action insensitive while the image is being
	saved to prevent data loss.

	* app/widgets/gimptoolbox.c (gimp_toolbox_delete_event): activate
	the "file-quit" action instead of calling gimp_exit() directly so
	trying to close the toolbox while saving is impossible too.
parent 77697d70
2005-10-29 Michael Natterer <mitch@gimp.org>
Fix bug #145492:
* app/actions/file-commands.c (file_save_cmd_callback)
* app/dialogs/file-save-dialog.c (file_save_dialog_save_image):
set the "file-quit" action insensitive while the image is being
saved to prevent data loss.
* app/widgets/gimptoolbox.c (gimp_toolbox_delete_event): activate
the "file-quit" action instead of calling gimp_exit() directly so
trying to close the toolbox while saving is impossible too.
2005-10-29 Michael Natterer <mitch@gimp.org>
* app/paint/gimpconvolve.c (gimp_convolve_motion): allocate both
......
......@@ -38,6 +38,7 @@
#include "file/file-save.h"
#include "file/file-utils.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpfiledialog.h"
#include "widgets/gimphelp-ids.h"
......@@ -213,6 +214,15 @@ file_save_cmd_callback (GtkAction *action,
{
GimpPDBStatusType status;
GError *error = NULL;
GList *list;
for (list = gimp_action_groups_from_name ("file");
list;
list = g_list_next (list))
{
gimp_action_group_set_action_sensitive (list->data, "file-quit",
FALSE);
}
status = file_save (gimage, action_data_get_context (data),
GIMP_PROGRESS (gdisp),
......@@ -230,6 +240,14 @@ file_save_cmd_callback (GtkAction *action,
g_free (filename);
}
for (list = gimp_action_groups_from_name ("file");
list;
list = g_list_next (list))
{
gimp_action_group_set_action_sensitive (list->data, "file-quit",
TRUE);
}
}
}
}
......
......@@ -36,6 +36,7 @@
#include "file/file-save.h"
#include "file/file-utils.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpfiledialog.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpmessagebox.h"
......@@ -441,7 +442,16 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
gboolean save_a_copy)
{
GimpPDBStatusType status;
GError *error = NULL;
GError *error = NULL;
GList *list;
gboolean success = TRUE;
for (list = gimp_action_groups_from_name ("file");
list;
list = g_list_next (list))
{
gimp_action_group_set_action_sensitive (list->data, "file-quit", FALSE);
}
g_object_ref (gimage);
......@@ -467,8 +477,15 @@ file_save_dialog_save_image (GtkWidget *save_dialog,
g_free (filename);
return FALSE;
success = FALSE;
}
return TRUE;
for (list = gimp_action_groups_from_name ("file");
list;
list = g_list_next (list))
{
gimp_action_group_set_action_sensitive (list->data, "file-quit", TRUE);
}
return success;
}
......@@ -335,7 +335,12 @@ static gboolean
gimp_toolbox_delete_event (GtkWidget *widget,
GdkEventAny *event)
{
gimp_exit (GIMP_DOCK (widget)->context->gimp, FALSE);
GtkAction *action;
action = gimp_ui_manager_find_action (GIMP_IMAGE_DOCK (widget)->ui_manager,
"file", "file-quit");
if (action)
gtk_action_activate (action);
return TRUE;
}
......
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