static gboolean setup_select_names (Dialog *dialog) { ENameSelectorModel *name_selector_model; ENameSelectorDialog *name_selector_dialog; dialog->name_selector = e_name_selector_new (); e_name_selector_load_books (dialog->name_selector); name_selector_model = e_name_selector_peek_model (dialog->name_selector); e_name_selector_model_add_section (name_selector_model, section_name, section_name, NULL); dialog->malarm_addresses = GTK_WIDGET (e_name_selector_peek_section_entry (dialog->name_selector, section_name)); gtk_widget_show (dialog->malarm_addresses); gtk_box_pack_end (GTK_BOX (dialog->malarm_address_group), dialog->malarm_addresses, TRUE, TRUE, 0); g_signal_connect ( dialog->malarm_addressbook, "clicked", G_CALLBACK (addressbook_clicked_cb), dialog); name_selector_dialog = e_name_selector_peek_dialog (dialog->name_selector); g_signal_connect (name_selector_dialog, "response", G_CALLBACK (addressbook_response_cb), dialog); return TRUE; }
static GtkWidget * setup_name_selector (GtkWidget *placeholder, GtkWidget *button_user, ENameSelector **name_selector_ret) { ENameSelector *name_selector; ENameSelectorModel *name_selector_model; ENameSelectorDialog *name_selector_dialog; GtkWidget *widget; g_return_val_if_fail (GTK_IS_CONTAINER (placeholder), NULL); name_selector = e_name_selector_new (); name_selector_model = e_name_selector_peek_model (name_selector); /* FIXME Limit to one user */ e_name_selector_model_add_section (name_selector_model, "User", _("User"), NULL); /* Listen for responses whenever the dialog is shown */ name_selector_dialog = e_name_selector_peek_dialog (name_selector); g_signal_connect (name_selector_dialog, "response", G_CALLBACK (user_response), name_selector); widget = GTK_WIDGET (e_name_selector_peek_section_entry (name_selector, "User")); gtk_widget_show (widget); g_signal_connect (button_user, "clicked", G_CALLBACK (user_clicked), name_selector); gtk_box_pack_start (GTK_BOX (placeholder), widget, TRUE, TRUE, 6); *name_selector_ret = name_selector; return widget; }
GtkWidget * contact_list_editor_create_name_selector (gchar *name, gchar *string1, gchar *string2, gint int1, gint int2) { ENameSelectorEntry *name_selector_entry; ENameSelector *name_selector; name_selector = e_name_selector_new (); e_name_selector_model_add_section ( e_name_selector_peek_model (name_selector), "Members", _("_Members"), NULL); name_selector_entry = e_name_selector_peek_section_entry ( name_selector, "Members"); e_name_selector_entry_set_contact_editor_func ( name_selector_entry, e_contact_editor_new); e_name_selector_entry_set_contact_list_editor_func ( name_selector_entry, e_contact_list_editor_new); gtk_widget_show (GTK_WIDGET (name_selector_entry)); g_signal_connect ( name_selector_entry, "activate", G_CALLBACK ( contact_list_editor_email_entry_activate_cb), NULL); g_signal_connect ( name_selector_entry, "changed", G_CALLBACK ( contact_list_editor_email_entry_changed_cb), NULL); g_signal_connect ( name_selector_entry, "key-press-event", G_CALLBACK ( contact_list_editor_email_entry_key_press_event_cb), NULL); g_signal_connect ( name_selector_entry, "updated", G_CALLBACK ( contact_list_editor_email_entry_updated_cb), NULL); return GTK_WIDGET (name_selector_entry); }