Save data before disposing of it when closing the dialog. Closes bug

2003-11-11  Dave Neary  <bolsh@gimp.org>

        * app/widgets/gimpdataeditor.c: Save data before disposing of
        it when closing the dialog. Closes bug #116606.
This commit is contained in:
Dave Neary 2003-11-11 19:00:42 +00:00 committed by David Neary
parent f72b8b1e39
commit 8b2fba9e42
2 changed files with 25 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2003-11-11 Dave Neary <bolsh@gimp.org>
* app/widgets/gimpdataeditor.c: Save data before disposing of
it when closing the dialog. Closes bug #116606.
2003-11-11 Michael Natterer <mitch@gimp.org>
* libgimpwidgets/gimpdialog.[ch] (gimp_dialog_run): new function

View File

@ -72,6 +72,7 @@ static void gimp_data_editor_save_clicked (GtkWidget *widget,
GimpDataEditor *editor);
static void gimp_data_editor_revert_clicked (GtkWidget *widget,
GimpDataEditor *editor);
static void gimp_data_editor_save_dirty (GimpDataEditor *editor);
static GimpEditorClass *parent_class = NULL;
@ -226,7 +227,11 @@ gimp_data_editor_dispose (GObject *object)
editor = GIMP_DATA_EDITOR (object);
if (editor->data)
gimp_data_editor_set_data (editor, NULL);
{
/* Save dirty data before we clear out */
gimp_data_editor_save_dirty (editor);
gimp_data_editor_set_data (editor, NULL);
}
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@ -359,10 +364,23 @@ gimp_data_editor_data_name_changed (GimpObject *object,
static void
gimp_data_editor_save_clicked (GtkWidget *widget,
GimpDataEditor *editor)
{
gimp_data_editor_save_dirty (editor);
}
static void
gimp_data_editor_revert_clicked (GtkWidget *widget,
GimpDataEditor *editor)
{
g_print ("TODO: implement revert\n");
}
static void
gimp_data_editor_save_dirty (GimpDataEditor *editor)
{
gchar *path = NULL;
GimpData *data;
g_object_get (editor->data_factory->gimp->config,
editor->data_factory->path_property_name, &path,
NULL);
@ -401,9 +419,3 @@ gimp_data_editor_save_clicked (GtkWidget *widget,
g_free (path);
}
static void
gimp_data_editor_revert_clicked (GtkWidget *widget,
GimpDataEditor *editor)
{
g_print ("TODO: implement revert\n");
}