static void gimp_data_editor_dispose (GObject *object) { GimpDataEditor *editor = GIMP_DATA_EDITOR (object); if (editor->data) { /* Save dirty data before we clear out */ gimp_data_editor_save_dirty (editor); gimp_data_editor_set_data (editor, NULL); } if (editor->context) gimp_docked_set_context (GIMP_DOCKED (editor), NULL); G_OBJECT_CLASS (parent_class)->dispose (object); }
static void gimp_data_editor_real_set_data (GimpDataEditor *editor, GimpData *data) { gboolean editable; if (editor->data) { gimp_data_editor_save_dirty (editor); g_signal_handlers_disconnect_by_func (editor->data, gimp_data_editor_data_name_changed, editor); g_object_unref (editor->data); } editor->data = data; if (editor->data) { g_object_ref (editor->data); g_signal_connect (editor->data, "name-changed", G_CALLBACK (gimp_data_editor_data_name_changed), editor); gtk_entry_set_text (GTK_ENTRY (editor->name_entry), gimp_object_get_name (editor->data)); } else { gtk_entry_set_text (GTK_ENTRY (editor->name_entry), ""); } editable = (editor->data && gimp_data_is_writable (editor->data)); if (editor->data_editable != editable) { editor->data_editable = editable; gtk_editable_set_editable (GTK_EDITABLE (editor->name_entry), editable); gimp_docked_title_changed (GIMP_DOCKED (editor)); } }
static void gimp_data_editor_save_clicked (GtkWidget *widget, GimpDataEditor *editor) { gimp_data_editor_save_dirty (editor); }