diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-03-02 03:30:14 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-03-02 07:16:07 +0800 |
commit | 4ff90f2bfd95337040616cae4b3bdddff033b5d6 (patch) | |
tree | 37d3acd7835e4366cc367dc904e43915c7c11f9b /addressbook/gui/contact-editor/e-contact-editor.c | |
parent | 977be20ced747224c0e08d565f961f0fa8d0baf8 (diff) | |
download | gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.gz gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.bz2 gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.lz gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.xz gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.tar.zst gsoc2013-evolution-4ff90f2bfd95337040616cae4b3bdddff033b5d6.zip |
Use EClientComboBox where appropriate.
Basically any place where we use both EClient and ESourceComboBox.
Diffstat (limited to 'addressbook/gui/contact-editor/e-contact-editor.c')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 0f3aef0739..0d994f8c49 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -686,7 +686,7 @@ fill_in_source_field (EContactEditor *editor) return; source_menu = e_builder_get_widget ( - editor->builder, "source-combo-box-source"); + editor->builder, "client-combo-box"); e_source_combo_box_set_active ( E_SOURCE_COMBO_BOX (source_menu), @@ -3101,15 +3101,19 @@ init_all (EContactEditor *editor) } static void -contact_editor_client_connect_cb (GObject *source_object, - GAsyncResult *result, - gpointer user_data) +contact_editor_get_client_cb (GObject *source_object, + GAsyncResult *result, + gpointer user_data) { + EClientComboBox *combo_box; ConnectClosure *closure = user_data; EClient *client; GError *error = NULL; - client = e_book_client_connect_finish (result, &error); + combo_box = E_CLIENT_COMBO_BOX (source_object); + + client = e_client_combo_box_get_client_finish ( + combo_box, result, &error); /* Sanity check. */ g_return_if_fail ( @@ -3123,7 +3127,6 @@ contact_editor_client_connect_cb (GObject *source_object, goto exit; } else if (error != NULL) { - GtkWidget *source_combo_box; GtkWindow *parent; parent = eab_editor_get_window (EAB_EDITOR (closure->editor)); @@ -3132,11 +3135,8 @@ contact_editor_client_connect_cb (GObject *source_object, GTK_WIDGET (parent), NULL, closure->source, error); - source_combo_box = e_builder_get_widget ( - closure->editor->builder, - "source-combo-box-source"); e_source_combo_box_set_active ( - E_SOURCE_COMBO_BOX (source_combo_box), + E_SOURCE_COMBO_BOX (combo_box), closure->source); g_error_free (error); @@ -3153,7 +3153,7 @@ exit: } static void -source_changed (ESourceComboBox *source_combo_box, +source_changed (EClientComboBox *combo_box, EContactEditor *editor) { ConnectClosure *closure; @@ -3161,7 +3161,8 @@ source_changed (ESourceComboBox *source_combo_box, ESource *source_source; ESource *source; - source = e_source_combo_box_ref_active (source_combo_box); + source = e_source_combo_box_ref_active ( + E_SOURCE_COMBO_BOX (combo_box)); g_return_if_fail (source != NULL); if (editor->cancellable != NULL) { @@ -3189,9 +3190,10 @@ source_changed (ESourceComboBox *source_combo_box, closure->editor = g_object_ref (editor); closure->source = g_object_ref (source); - e_book_client_connect ( - source, editor->cancellable, - contact_editor_client_connect_cb, + e_client_combo_box_get_client ( + combo_box, source, + editor->cancellable, + contact_editor_get_client_cb, closure); exit: @@ -4062,7 +4064,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) { GtkBuilder *builder; EShell *shell; - ESourceRegistry *registry; + EClientCache *client_cache; GtkWidget *container; GtkWidget *widget, *label; GtkEntryCompletion *completion; @@ -4070,7 +4072,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor) /* FIXME The shell should be obtained * through a constructor property. */ shell = e_shell_get_default (); - registry = e_shell_get_registry (shell); + client_cache = e_shell_get_client_cache (shell); e_contact_editor->name = e_contact_name_new (); @@ -4122,9 +4124,9 @@ e_contact_editor_init (EContactEditor *e_contact_editor) widget, "clicked", G_CALLBACK (categories_clicked), e_contact_editor); widget = e_builder_get_widget ( - e_contact_editor->builder, "source-combo-box-source"); - e_source_combo_box_set_registry ( - E_SOURCE_COMBO_BOX (widget), registry); + e_contact_editor->builder, "client-combo-box"); + e_client_combo_box_set_client_cache ( + E_CLIENT_COMBO_BOX (widget), client_cache); g_signal_connect ( widget, "changed", G_CALLBACK (source_changed), e_contact_editor); |