From a1d69a1b83b4a1de9f54fef9a4e0da7703de9a55 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Sun, 26 May 2002 16:46:49 +0000 Subject: if there are remaining items, return false (foreach_close_cb): don't 2002-05-26 JP Rosevear * gui/e-comp-editor-registry.c (e_comp_editor_registry_close_all): if there are remaining items, return false (foreach_close_cb): don't remove the item if it couldn't be closed * gui/e-comp-editor-registry.h: update proto * gui/component-factory.c (request_quit): return a boolean indicating if everything was closed * gui/dialogs/comp-editor.h: update proto * gui/dialogs/comp-editor.c (comp_editor_close): return true if the editor was closed, false otherwise svn path=/trunk/; revision=17019 --- calendar/gui/dialogs/comp-editor.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'calendar/gui/dialogs/comp-editor.c') diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 21f5e1c9f3..18ca46af27 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -978,16 +978,21 @@ comp_editor_send_comp (CompEditor *editor, CalComponentItipMethod method) klass->send_comp (editor, method); } -void +gboolean comp_editor_close (CompEditor *editor) { - g_return_if_fail (editor != NULL); - g_return_if_fail (IS_COMP_EDITOR (editor)); + gboolean close; + + g_return_val_if_fail (editor != NULL, FALSE); + g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE); commit_all_fields (editor); - if (prompt_to_save_changes (editor, TRUE)) + close = prompt_to_save_changes (editor, TRUE); + if (close) close_dialog (editor); + + return close; } /** -- cgit v1.2.3