diff options
-rw-r--r-- | addressbook/ChangeLog | 15 | ||||
-rw-r--r-- | addressbook/gui/contact-editor/eab-editor.c | 9 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 10 |
3 files changed, 24 insertions, 10 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 80d96b4418..84087339e0 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,5 +1,20 @@ 2005-02-19 Sivaiah Nallagatla <snallagatla@novell.com> + * gui/contact-editor/eab-editor.c + (eab_editor_prompt_to_save_changes) : close + the editor here in case of save and discard + so that callers need not worry about closing + + * gui/contact-list-editor/e-contact-list-editor.c + (closed_cb) (app_delete_event_cb) : don't close + the editor here as that is handled by _save_changes + call. Also no need to check for return value of that + function as it does not matter here. + + Fixes #70371 + +2005-02-19 Sivaiah Nallagatla <snallagatla@novell.com> + * gui/component/addressbook-component.c (ensure_sources) : update the base uri of the "On This Computer" group when user home dir diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c index 4f535e47c8..278f8a4c3f 100644 --- a/addressbook/gui/contact-editor/eab-editor.c +++ b/addressbook/gui/contact-editor/eab-editor.c @@ -250,7 +250,11 @@ eab_editor_get_window (EABEditor *editor) else return NULL; } - +/* This function prompts for saving if editor conents are in changed state and + save or discards or cancels(just returns with out doing anything) according to user input. + Editor gets destoryed in case of save and discard case. + */ + gboolean eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window) { @@ -262,9 +266,10 @@ eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window) if (!eab_editor_is_valid (editor)) { return FALSE; } - eab_editor_save_contact (editor, FALSE); + eab_editor_save_contact (editor, TRUE); return TRUE; case GTK_RESPONSE_NO: + eab_editor_close (EAB_EDITOR (editor)); return TRUE; case GTK_RESPONSE_CANCEL: default: diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 7cbf1d8dff..c4a5acd170 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -470,10 +470,7 @@ e_contact_list_editor_get_window (EABEditor *editor) static void close_cb (GtkWidget *widget, EContactListEditor *cle) { - if (!eab_editor_prompt_to_save_changes (EAB_EDITOR (cle), GTK_WINDOW (cle->app))) - return; - - eab_editor_close (EAB_EDITOR (cle)); + eab_editor_prompt_to_save_changes (EAB_EDITOR (cle), GTK_WINDOW (cle->app)); } static void @@ -864,10 +861,7 @@ app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) if (ce->in_async_call) return TRUE; - if (!eab_editor_prompt_to_save_changes (EAB_EDITOR (ce), GTK_WINDOW (ce->app))) - return TRUE; - - eab_editor_close (EAB_EDITOR (ce)); + eab_editor_prompt_to_save_changes (EAB_EDITOR (ce), GTK_WINDOW (ce->app)); return TRUE; } |