diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-12-08 13:16:45 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-06-03 11:00:39 +0800 |
commit | 7e8696ec5bb2721a769234fc4527b98e6a0c8a36 (patch) | |
tree | d57a5c654f27b146a070dac2f45f26089dcdaef9 /addressbook | |
parent | 1642c226cd3dd7391892d5b86567a7f8c2cee81c (diff) | |
download | gsoc2013-evolution-7e8696ec5bb2721a769234fc4527b98e6a0c8a36.tar.gz gsoc2013-evolution-7e8696ec5bb2721a769234fc4527b98e6a0c8a36.tar.zst gsoc2013-evolution-7e8696ec5bb2721a769234fc4527b98e6a0c8a36.zip |
Adapt EContactListEditor to the new ESource API.
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/contact-list-editor/contact-list-editor.ui | 2 | ||||
-rw-r--r-- | addressbook/gui/contact-list-editor/e-contact-list-editor.c | 43 |
2 files changed, 24 insertions, 21 deletions
diff --git a/addressbook/gui/contact-list-editor/contact-list-editor.ui b/addressbook/gui/contact-list-editor/contact-list-editor.ui index 6d262aa87e..24005eba14 100644 --- a/addressbook/gui/contact-list-editor/contact-list-editor.ui +++ b/addressbook/gui/contact-list-editor/contact-list-editor.ui @@ -83,6 +83,8 @@ </child> <child> <object class="ESourceComboBox" type-func="e_source_combo_box_get_type" id="source-combo-box"> + <property name="extension-name">Address Book</property> + <property name="show-colors">False</property> <property name="visible">True</property> </object> <packing> 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 385ce096eb..f67eecb979 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -953,10 +953,7 @@ contact_list_editor_source_menu_changed_cb (GtkWidget *widget) if (!e_source_equal (client_source, active_source)) e_client_utils_open_new ( client_source, E_CLIENT_SOURCE_TYPE_CONTACTS, - FALSE, NULL, - e_client_utils_authenticate_handler, - eab_editor_get_window (EAB_EDITOR (editor)), - contact_list_editor_book_loaded_cb, + FALSE, NULL, contact_list_editor_book_loaded_cb, g_object_ref (editor)); g_object_unref (active_source); @@ -1180,31 +1177,25 @@ contact_list_editor_fudge_new (EBookClient *book_client, static void setup_custom_widgets (EContactListEditor *editor) { + EShell *shell; + ESourceRegistry *registry; GtkWidget *combo_box; - ESourceList *source_list; ENameSelectorEntry *name_selector_entry; GtkWidget *old, *parent; EContactListEditorPrivate *priv; - GError *error = NULL; guint ba = 0, la = 0, ra = 0, ta = 0, xo = 0, xp = 0, yo = 0, yp = 0; g_return_if_fail (editor != NULL); priv = E_CONTACT_LIST_EDITOR_GET_PRIVATE (editor); + shell = eab_editor_get_shell (EAB_EDITOR (editor)); + registry = e_shell_get_registry (shell); + combo_box = WIDGET (SOURCE_MENU); - if (!e_book_client_get_sources (&source_list, &error)) - source_list = NULL; - g_object_set (combo_box, "source-list", source_list, NULL); - if (source_list) - g_object_unref (source_list); - - if (error) { - g_warning ( - "%s: Failed to get sources: %s", - G_STRFUNC, error->message); - g_error_free (error); - } + + e_source_combo_box_set_registry ( + E_SOURCE_COMBO_BOX (combo_box), registry); g_signal_connect ( combo_box, "changed", G_CALLBACK ( @@ -1369,12 +1360,17 @@ contact_list_editor_constructed (GObject *object) GtkCellRenderer *renderer; GtkTreeView *view; GtkTreeSelection *selection; + ESourceRegistry *registry; + EShell *shell; editor = E_CONTACT_LIST_EDITOR (object); /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); + shell = eab_editor_get_shell (EAB_EDITOR (editor)); + registry = e_shell_get_registry (shell); + editor->priv->editable = TRUE; editor->priv->allows_contact_lists = TRUE; @@ -1412,7 +1408,7 @@ contact_list_editor_constructed (GObject *object) column, renderer, (GtkTreeCellDataFunc) contact_list_editor_render_destination, NULL, NULL); - editor->priv->name_selector = e_name_selector_new (); + editor->priv->name_selector = e_name_selector_new (registry); e_name_selector_model_add_section ( e_name_selector_peek_model (editor->priv->name_selector), @@ -1464,8 +1460,13 @@ contact_list_editor_save_contact (EABEditor *eab_editor, { EContactListEditor *editor = E_CONTACT_LIST_EDITOR (eab_editor); EContactListEditorPrivate *priv = editor->priv; + ESourceRegistry *registry; EditorCloseStruct *ecs; EContact *contact; + EShell *shell; + + shell = eab_editor_get_shell (eab_editor); + registry = e_shell_get_registry (shell); contact = e_contact_list_editor_get_contact (editor); @@ -1481,11 +1482,11 @@ contact_list_editor_save_contact (EABEditor *eab_editor, if (priv->is_new_list) eab_merging_book_add_contact ( - priv->book_client, contact, + registry, priv->book_client, contact, contact_list_editor_list_added_cb, ecs); else eab_merging_book_modify_contact ( - priv->book_client, contact, + registry, priv->book_client, contact, contact_list_editor_list_modified_cb, ecs); priv->changed = FALSE; |