diff options
author | Chris Toshok <toshok@ximian.com> | 2001-11-04 12:39:08 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-11-04 12:39:08 +0800 |
commit | 9a49145291a39e4e2baca6acd0dba70572aa9bb2 (patch) | |
tree | b5df8b25cd977666d9993b474ecb310e07dd5f09 /addressbook/gui/contact-list-editor | |
parent | 404df6b3a1f9c0b4610910d232fd9b06af80d845 (diff) | |
download | gsoc2013-evolution-9a49145291a39e4e2baca6acd0dba70572aa9bb2.tar gsoc2013-evolution-9a49145291a39e4e2baca6acd0dba70572aa9bb2.tar.gz gsoc2013-evolution-9a49145291a39e4e2baca6acd0dba70572aa9bb2.tar.bz2 gsoc2013-evolution-9a49145291a39e4e2baca6acd0dba70572aa9bb2.tar.lz gsoc2013-evolution-9a49145291a39e4e2baca6acd0dba70572aa9bb2.tar.xz gsoc2013-evolution-9a49145291a39e4e2baca6acd0dba70572aa9bb2.tar.zst gsoc2013-evolution-9a49145291a39e4e2baca6acd0dba70572aa9bb2.zip |
[ Fixes Ximian bug #14410 ] init in_async_call to FALSE. (card_added_cb):
2001-11-03 Chris Toshok <toshok@ximian.com>
[ Fixes Ximian bug #14410 ]
* gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
init in_async_call to FALSE.
(card_added_cb): turn the UI back on and set in_async_call to
FALSE.
(card_modified_cb): same.
(card_deleted_cb): same.
(save_card): turn off the UI by setting the dialog insensitive,
and set in_async_call to TRUE.
(delete_cb): same.
(app_delete_event_cb): if we're in an async call don't let the
window get deleted.
* gui/contact-editor/e-contact-editor.h (struct _EContactEditor):
add in_async_call flag for when we make a wombat call and need to
disable the UI.
* gui/contact-list-editor/e-contact-list-editor.c
(e_contact_list_editor_init): init in_async_call to FALSE.
(list_added_cb): turn the UI back on and set in_async_call to
FALSE.
(list_modified_cb): same.
(list_deleted_cb): same.
(save_card): turn off the UI by setting the dialog insensitive,
and set in_async_call to TRUE.
(delete_cb): same.
(app_delete_event_cb): if we're in an async call don't let the
window get deleted.
* gui/contact-list-editor/e-contact-list-editor.h (struct
_EContactListEditor): add in_async_call flag for when we make a
wombat call and need to disable the UI.
svn path=/trunk/; revision=14582
Diffstat (limited to 'addressbook/gui/contact-list-editor')
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 23 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.h | 3 |
2 files changed, 25 insertions, 1 deletions
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 b1bd3e351c..bb223f2f18 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -208,6 +208,7 @@ e_contact_list_editor_init (EContactListEditor *editor) editor->card = NULL; editor->changed = FALSE; editor->editable = TRUE; + editor->in_async_call = FALSE; editor->is_new_list = FALSE; gui = glade_xml_new (EVOLUTION_GLADEDIR "/contact-list-editor.glade", NULL); @@ -310,6 +311,9 @@ list_added_cb (EBook *book, EBookStatus status, const char *id, EditorCloseStruc g_free (ecs); + gtk_widget_set_sensitive (cle->app, TRUE); + cle->in_async_call = FALSE; + e_card_set_id (cle->card, id); gtk_signal_emit (GTK_OBJECT (cle), contact_list_editor_signals[LIST_ADDED], @@ -333,6 +337,9 @@ list_modified_cb (EBook *book, EBookStatus status, EditorCloseStruct *ecs) g_free (ecs); + gtk_widget_set_sensitive (cle->app, TRUE); + cle->in_async_call = FALSE; + gtk_signal_emit (GTK_OBJECT (cle), contact_list_editor_signals[LIST_MODIFIED], status, cle->card); @@ -353,6 +360,9 @@ save_card (EContactListEditor *cle, gboolean should_close) ecs->cle = cle; ecs->should_close = should_close; + gtk_widget_set_sensitive (cle->app, FALSE); + cle->in_async_call = TRUE; + if (cle->is_new_list) e_book_add_card (cle->book, cle->card, GTK_SIGNAL_FUNC(list_added_cb), ecs); else @@ -407,6 +417,9 @@ tb_save_and_close_cb (GtkWidget *widget, gpointer data) static void list_deleted_cb (EBook *book, EBookStatus status, EContactListEditor *cle) { + gtk_widget_set_sensitive (cle->app, TRUE); + cle->in_async_call = FALSE; + gtk_signal_emit (GTK_OBJECT (cle), contact_list_editor_signals[LIST_DELETED], status, cle->card); @@ -427,8 +440,12 @@ delete_cb (GtkWidget *widget, gpointer data) extract_info (cle); - if (!cle->is_new_list) + if (!cle->is_new_list) { + gtk_widget_set_sensitive (cle->app, FALSE); + cle->in_async_call = TRUE; + e_book_remove_card (cle->book, card, GTK_SIGNAL_FUNC(list_deleted_cb), cle); + } } gtk_object_unref(GTK_OBJECT(card)); @@ -699,6 +716,10 @@ app_delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) ce = E_CONTACT_LIST_EDITOR (data); + /* if we're in an async call, don't allow the dialog to close */ + if (ce->in_async_call) + return TRUE; + if (!prompt_to_save_changes (ce)) return TRUE; diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.h b/addressbook/gui/contact-list-editor/e-contact-list-editor.h index d83f15d6f7..37f54df170 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.h +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.h @@ -75,6 +75,9 @@ struct _EContactListEditor /* Whether the contact editor will accept modifications */ guint editable : 1; + + /* Whether an async wombat call is in progress */ + guint in_async_call : 1; }; struct _EContactListEditorClass |