diff -up evolution-2.12.0/widgets/misc/e-pilot-settings.c.e-source-combo-box evolution-2.12.0/widgets/misc/e-pilot-settings.c --- evolution-2.12.0/widgets/misc/e-pilot-settings.c.e-source-combo-box 2007-09-16 15:33:23.000000000 -0400 +++ evolution-2.12.0/widgets/misc/e-pilot-settings.c 2007-09-17 14:31:05.000000000 -0400 @@ -27,7 +27,7 @@ #include #include -#include +#include #include "e-pilot-settings.h" struct _EPilotSettingsPrivate @@ -102,7 +102,7 @@ build_ui (EPilotSettings *ps, ESourceLis lbl = gtk_label_new (_("Sync with:")); gtk_misc_set_alignment (GTK_MISC (lbl), 0.0, 0.5); - priv->source = e_source_option_menu_new (source_list); + priv->source = e_source_combo_box_new (source_list); gtk_table_attach_defaults (GTK_TABLE (ps), lbl, 0, 1, 0, 1); gtk_table_attach_defaults (GTK_TABLE (ps), priv->source, 1, 2, 0, 1); gtk_widget_show (lbl); @@ -152,8 +152,9 @@ e_pilot_settings_get_source (EPilotSetti g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), FALSE); priv = ps->priv; - - return e_source_option_menu_peek_selected (E_SOURCE_OPTION_MENU (priv->source)); + + return e_source_combo_box_get_active ( + E_SOURCE_COMBO_BOX (priv->source)); } void @@ -166,7 +167,8 @@ e_pilot_settings_set_source (EPilotSetti priv = ps->priv; - e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source), source); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (priv->source), source); } gboolean diff -up evolution-2.12.0/plugins/itip-formatter/itip-formatter.c.e-source-combo-box evolution-2.12.0/plugins/itip-formatter/itip-formatter.c --- evolution-2.12.0/plugins/itip-formatter/itip-formatter.c.e-source-combo-box 2007-09-16 15:16:41.000000000 -0400 +++ evolution-2.12.0/plugins/itip-formatter/itip-formatter.c 2007-09-17 14:31:05.000000000 -0400 @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff -up evolution-2.12.0/plugins/itip-formatter/itip-view.c.e-source-combo-box evolution-2.12.0/plugins/itip-formatter/itip-view.c --- evolution-2.12.0/plugins/itip-formatter/itip-view.c.e-source-combo-box 2007-09-16 15:16:41.000000000 -0400 +++ evolution-2.12.0/plugins/itip-formatter/itip-view.c 2007-09-17 14:31:05.000000000 -0400 @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -105,8 +105,8 @@ struct _ItipViewPrivate { char *description; GtkWidget *selector_box; - GtkWidget *esom; - GtkWidget *esom_header; + GtkWidget *escb; + GtkWidget *escb_header; ESourceList *source_list; GtkWidget *rsvp_box; @@ -1788,10 +1788,12 @@ itip_view_clear_lower_info_items (ItipVi } static void -source_selected_cb (ESourceOptionMenu *esom, ESource *source, gpointer data) +source_changed_cb (ESourceComboBox *escb, ItipView *view) { - ItipView *view = data; - + ESource *source; + + source = e_source_combo_box_get_active (escb); + g_signal_emit (view, signals[SOURCE_SELECTED], 0, source); } @@ -1808,40 +1810,42 @@ itip_view_set_source_list (ItipView *vie if (priv->source_list) g_object_unref (priv->source_list); - if (priv->esom) - gtk_widget_destroy (priv->esom); + if (priv->escb) + gtk_widget_destroy (priv->escb); if (!source_list) { - if (priv->esom_header) - gtk_widget_destroy (priv->esom_header); + if (priv->escb_header) + gtk_widget_destroy (priv->escb_header); priv->source_list = NULL; - priv->esom = NULL; - priv->esom_header = NULL; + priv->escb = NULL; + priv->escb_header = NULL; return; } priv->source_list = g_object_ref (source_list); - priv->esom = e_source_option_menu_new (source_list); - gtk_widget_show (priv->esom); - g_signal_connect (priv->esom, "source_selected", G_CALLBACK (source_selected_cb), view); + priv->escb = e_source_combo_box_new (source_list); + gtk_widget_show (priv->escb); + g_signal_connect ( + priv->escb, "changed", + G_CALLBACK (source_changed_cb), view); - if (!priv->esom_header) { + if (!priv->escb_header) { if (priv->type == E_CAL_SOURCE_TYPE_EVENT) - priv->esom_header = gtk_label_new_with_mnemonic (_("_Calendar:")); + priv->escb_header = gtk_label_new_with_mnemonic (_("_Calendar:")); else if (priv->type == E_CAL_SOURCE_TYPE_TODO) - priv->esom_header = gtk_label_new_with_mnemonic (_("_Tasks :")); + priv->escb_header = gtk_label_new_with_mnemonic (_("_Tasks :")); else if (priv->type == E_CAL_SOURCE_TYPE_JOURNAL) - priv->esom_header = gtk_label_new_with_mnemonic (_("Memos :")); + priv->escb_header = gtk_label_new_with_mnemonic (_("Memos :")); - gtk_label_set_mnemonic_widget (GTK_LABEL (priv->esom_header), priv->esom); - gtk_widget_show (priv->esom_header); + gtk_label_set_mnemonic_widget (GTK_LABEL (priv->escb_header), priv->escb); + gtk_widget_show (priv->escb_header); } - gtk_box_pack_start (GTK_BOX (priv->selector_box), priv->esom_header, FALSE, TRUE, 6); - gtk_box_pack_start (GTK_BOX (priv->selector_box), priv->esom, FALSE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (priv->selector_box), priv->escb_header, FALSE, TRUE, 6); + gtk_box_pack_start (GTK_BOX (priv->selector_box), priv->escb, FALSE, TRUE, 0); } ESourceList * @@ -1867,10 +1871,11 @@ itip_view_set_source (ItipView *view, ES priv = view->priv; - if (!priv->esom) + if (!priv->escb) return; - e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->esom), source); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (priv->escb), source); } ESource * @@ -1883,10 +1888,11 @@ itip_view_get_source (ItipView *view) priv = view->priv; - if (!priv->esom) + if (!priv->escb) return NULL; - return e_source_option_menu_peek_selected (E_SOURCE_OPTION_MENU (priv->esom)); + return e_source_combo_box_get_active ( + E_SOURCE_COMBO_BOX (priv->escb)); } void diff -up evolution-2.12.0/plugins/bbdb/gaimbuddies.c.e-source-combo-box evolution-2.12.0/plugins/bbdb/gaimbuddies.c --- evolution-2.12.0/plugins/bbdb/gaimbuddies.c.e-source-combo-box 2007-09-16 15:16:13.000000000 -0400 +++ evolution-2.12.0/plugins/bbdb/gaimbuddies.c 2007-09-17 14:31:05.000000000 -0400 @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include diff -up evolution-2.12.0/plugins/bbdb/bbdb.c.e-source-combo-box evolution-2.12.0/plugins/bbdb/bbdb.c --- evolution-2.12.0/plugins/bbdb/bbdb.c.e-source-combo-box 2007-09-16 15:16:13.000000000 -0400 +++ evolution-2.12.0/plugins/bbdb/bbdb.c 2007-09-17 14:31:05.000000000 -0400 @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include @@ -71,10 +71,49 @@ static gboolean bbdb_timeout (gpointer d static void bbdb_do_it (EBook *book, const char *name, const char *email); static void add_email_to_contact (EContact *contact, const char *email); static void enable_toggled_cb (GtkWidget *widget, gpointer data); -static void source_changed_cb (GtkWidget *widget, ESource *source, gpointer data); +static void source_changed_cb (ESourceComboBox *source_combo_box, struct bbdb_stuff *stuff); static GtkWidget *create_addressbook_option_menu (struct bbdb_stuff *stuff, int type); static void cleanup_cb (GObject *o, gpointer data); +static ESource * +find_esource_by_uri (ESourceList *source_list, const gchar *target_uri) +{ + GSList *groups; + + /* XXX This would be unnecessary if the plugin had stored + * the addressbook's UID instead of the URI in GConf. + * Too late to change it now, I suppose. */ + + if (source_list == NULL || target_uri == NULL) + return NULL; + + groups = e_source_list_peek_groups (source_list); + + while (groups != NULL) { + GSList *sources; + + sources = e_source_group_peek_sources (groups->data); + + while (sources != NULL) { + gchar *uri; + gboolean match; + + uri = e_source_get_uri (sources->data); + match = (strcmp (uri, target_uri) == 0); + g_free (uri); + + if (match) + return sources->data; + + sources = g_slist_next (sources); + } + + groups = g_slist_next (groups); + } + + return NULL; +} + int e_plugin_lib_enable (EPluginLib *ep, int enable) { @@ -266,8 +305,6 @@ bbdb_open_addressbook (int type) char *uri; EBook *book = NULL; - gboolean enable; - gboolean status; GError *error = NULL; @@ -345,8 +382,23 @@ enable_toggled_cb (GtkWidget *widget, gp gtk_widget_set_sensitive (stuff->option_menu, active); if (active && !gconf_client_get_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK, NULL)) { - selected_source = e_source_option_menu_peek_selected (E_SOURCE_OPTION_MENU (stuff->option_menu)); - gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK, e_source_get_uri (selected_source), NULL); + const gchar *uri = NULL; + GError *error = NULL; + + selected_source = e_source_combo_box_get_active ( + E_SOURCE_COMBO_BOX (stuff->option_menu)); + if (selected_source != NULL) + uri = e_source_get_uri (selected_source); + + gconf_client_set_string ( + stuff->target->gconf, + GCONF_KEY_WHICH_ADDRESSBOOK, + uri, &error); + + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + } } } @@ -364,7 +416,8 @@ enable_gaim_toggled_cb (GtkWidget *widge gtk_widget_set_sensitive (stuff->gaim_option_menu, active); if (active && !gconf_client_get_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, NULL)) { - selected_source = e_source_option_menu_peek_selected (E_SOURCE_OPTION_MENU (stuff->gaim_option_menu)); + selected_source = e_source_combo_box_get_active ( + E_SOURCE_COMBO_BOX (stuff->gaim_option_menu)); gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, e_source_get_uri (selected_source), NULL); } } @@ -376,48 +429,77 @@ synchronize_button_clicked_cb (GtkWidget } static void -source_changed_cb (GtkWidget *widget, ESource *source, gpointer data) +source_changed_cb (ESourceComboBox *source_combo_box, + struct bbdb_stuff *stuff) { - struct bbdb_stuff *stuff = (struct bbdb_stuff *) data; - - gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK, e_source_get_uri (source), NULL); + ESource *source; + GError *error = NULL; + + source = e_source_combo_box_get_active (source_combo_box); + g_return_if_fail (source != NULL); + + gconf_client_set_string ( + stuff->target->gconf, + GCONF_KEY_WHICH_ADDRESSBOOK, + e_source_get_uri (source), &error); + + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + } } static void -gaim_source_changed_cb (GtkWidget *widget, ESource *source, gpointer data) +gaim_source_changed_cb (ESourceComboBox *source_combo_box, + struct bbdb_stuff *stuff) { - struct bbdb_stuff *stuff = (struct bbdb_stuff *) data; - gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, e_source_get_uri (source), NULL); + ESource *source; + GError *error = NULL; + + source = e_source_combo_box_get_active (source_combo_box); + g_return_if_fail (source != NULL); + + gconf_client_set_string ( + stuff->target->gconf, + GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, + e_source_get_uri (source), &error); + + if (error != NULL) { + g_warning ("%s", error->message); + g_error_free (error); + } } static GtkWidget * create_addressbook_option_menu (struct bbdb_stuff *stuff, int type) { - GtkWidget *menu; + GtkWidget *combo_box; ESourceList *source_list; - char *selected_source_uri; ESource *selected_source; + char *selected_source_uri; GConfClient *gconf = stuff->target->gconf; source_list = e_source_list_new_for_gconf (gconf, "/apps/evolution/addressbook/sources"); - menu = e_source_option_menu_new (source_list); + combo_box = e_source_combo_box_new (source_list); if (type == GAIM_ADDRESSBOOK) selected_source_uri = gconf_client_get_string (gconf, GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, NULL); else selected_source_uri = gconf_client_get_string (gconf, GCONF_KEY_WHICH_ADDRESSBOOK, NULL); - if (selected_source_uri != NULL) { - selected_source = e_source_new_with_absolute_uri ("", selected_source_uri); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (menu), selected_source); - g_free (selected_source_uri); - } + selected_source = find_esource_by_uri ( + source_list, selected_source_uri); + g_free (selected_source_uri); + + if (selected_source != NULL) + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (combo_box), selected_source); - gtk_widget_show (menu); + gtk_widget_show (combo_box); stuff->source_list = source_list; - return menu; + return combo_box; } GtkWidget * @@ -483,7 +565,7 @@ bbdb_page_factory (EPlugin *ep, EConfigH /* Source selection option menu */ option = create_addressbook_option_menu (stuff, AUTOMATIC_CONTACTS_ADDRESSBOOK); - g_signal_connect (option, "source_selected", G_CALLBACK (source_changed_cb), stuff); + g_signal_connect (option, "changed", G_CALLBACK (source_changed_cb), stuff); gtk_widget_set_sensitive (option, gconf_client_get_bool (target->gconf, GCONF_KEY_ENABLE, NULL)); gtk_box_pack_start (GTK_BOX (inner_vbox), option, FALSE, FALSE, 0); stuff->option_menu = option; @@ -519,7 +601,7 @@ bbdb_page_factory (EPlugin *ep, EConfigH /* Gaim Source Selection Option Menu */ gaim_option = create_addressbook_option_menu (stuff, GAIM_ADDRESSBOOK); - g_signal_connect (gaim_option, "source_selected", G_CALLBACK (gaim_source_changed_cb), stuff); + g_signal_connect (gaim_option, "changed", G_CALLBACK (gaim_source_changed_cb), stuff); gtk_widget_set_sensitive (gaim_option, gconf_client_get_bool (target->gconf, GCONF_KEY_ENABLE_GAIM, NULL)); gtk_box_pack_start (GTK_BOX (inner_vbox), gaim_option, FALSE, FALSE, 0); stuff->gaim_option_menu = gaim_option; diff -up evolution-2.12.0/addressbook/gui/contact-list-editor/contact-list-editor.glade.e-source-combo-box evolution-2.12.0/addressbook/gui/contact-list-editor/contact-list-editor.glade --- evolution-2.12.0/addressbook/gui/contact-list-editor/contact-list-editor.glade.e-source-combo-box 2007-09-16 14:53:41.000000000 -0400 +++ evolution-2.12.0/addressbook/gui/contact-list-editor/contact-list-editor.glade 2007-09-17 14:31:05.000000000 -0400 @@ -158,9 +158,9 @@ - + True - e_contact_list_editor_create_source_option_menu + e_contact_list_editor_create_source_combo_box 0 0 Tue, 01 Jun 2004 18:22:38 GMT diff -up evolution-2.12.0/addressbook/gui/contact-list-editor/e-contact-list-editor.c.e-source-combo-box evolution-2.12.0/addressbook/gui/contact-list-editor/e-contact-list-editor.c --- evolution-2.12.0/addressbook/gui/contact-list-editor/e-contact-list-editor.c.e-source-combo-box 2007-09-16 14:53:41.000000000 -0400 +++ evolution-2.12.0/addressbook/gui/contact-list-editor/e-contact-list-editor.c 2007-09-17 14:31:05.000000000 -0400 @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include @@ -78,7 +78,7 @@ static void select_cb (GtkWidget *w, ECo static void list_name_changed_cb (GtkWidget *w, EContactListEditor *editor); static void list_image_changed_cb (GtkWidget *w, EContactListEditor *editor); static void visible_addrs_toggled_cb (GtkWidget *w, EContactListEditor *editor); -static void source_selected (GtkWidget *source_option_menu, ESource *source, EContactListEditor *editor); +static void source_changed_cb (ESourceComboBox *source_combo_box, EContactListEditor *editor); static gboolean email_key_pressed (GtkWidget *w, GdkEventKey *event, EContactListEditor *editor); static void email_match_selected (GtkWidget *w, EDestination *destination, EContactListEditor *editor); @@ -233,7 +233,7 @@ e_contact_list_editor_init (EContactList editor->list_name_entry = glade_xml_get_widget (gui, "list-name-entry"); editor->list_image = glade_xml_get_widget (gui, "list-image"); editor->visible_addrs_checkbutton = glade_xml_get_widget (gui, "visible-addrs-checkbutton"); - editor->source_menu = glade_xml_get_widget (gui, "source-option-menu-source"); + editor->source_menu = glade_xml_get_widget (gui, "source-combo-box-source"); editor->ok_button = glade_xml_get_widget (gui, "ok-button"); editor->cancel_button = glade_xml_get_widget (gui, "cancel-button"); @@ -276,7 +276,7 @@ e_contact_list_editor_init (EContactList "changed", G_CALLBACK(list_image_changed_cb), editor); g_signal_connect (editor->source_menu, - "source_selected", G_CALLBACK (source_selected), editor); + "changed", G_CALLBACK (source_changed_cb), editor); command_state_changed (editor); @@ -306,8 +306,9 @@ new_target_cb (EBook *new_book, EBookSta if (status != E_BOOK_ERROR_OK || new_book == NULL) { eab_load_error_dialog (NULL, e_book_get_source (new_book), status); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (editor->source_menu), - e_book_get_source (editor->book)); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (editor->source_menu), + e_book_get_source (editor->book)); if (new_book) g_object_unref (new_book); @@ -332,8 +333,12 @@ cancel_load (EContactListEditor *editor) } static void -source_selected (GtkWidget *source_option_menu, ESource *source, EContactListEditor *editor) +source_changed_cb (ESourceComboBox *source_combo_box, EContactListEditor *editor) { + ESource *source; + + source = e_source_combo_box_get_active (source_combo_box); + cancel_load (editor); if (e_source_equal (e_book_get_source (editor->book), source)) @@ -795,28 +800,28 @@ select_cb (GtkWidget *w, EContactListEdi } GtkWidget * -e_contact_list_editor_create_source_option_menu (gchar *name, - gchar *string1, gchar *string2, - gint int1, gint int2); +e_contact_list_editor_create_source_combo_box (gchar *name, + gchar *string1, gchar *string2, + gint int1, gint int2); GtkWidget * -e_contact_list_editor_create_source_option_menu (gchar *name, - gchar *string1, gchar *string2, - gint int1, gint int2) +e_contact_list_editor_create_source_combo_box (gchar *name, + gchar *string1, gchar *string2, + gint int1, gint int2) { - GtkWidget *menu; + GtkWidget *combo_box; GConfClient *gconf_client; ESourceList *source_list; gconf_client = gconf_client_get_default (); source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/addressbook/sources"); - menu = e_source_option_menu_new (source_list); + combo_box = e_source_combo_box_new (source_list); g_object_unref (source_list); - gtk_widget_show (menu); - return menu; + gtk_widget_show (combo_box); + return combo_box; } GtkWidget * @@ -1262,10 +1267,9 @@ fill_in_info(EContactListEditor *editor) } if (editor->book) { - ESource *source; - - source = e_book_get_source (editor->book); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (editor->source_menu), source); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (editor->source_menu), + e_book_get_source (editor->book)); gtk_widget_set_sensitive (editor->source_menu, editor->is_new_list); gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "source-label"), editor->is_new_list); } diff -up evolution-2.12.0/addressbook/gui/contact-editor/contact-editor.glade.e-source-combo-box evolution-2.12.0/addressbook/gui/contact-editor/contact-editor.glade --- evolution-2.12.0/addressbook/gui/contact-editor/contact-editor.glade.e-source-combo-box 2007-09-16 14:52:39.000000000 -0400 +++ evolution-2.12.0/addressbook/gui/contact-editor/contact-editor.glade 2007-09-17 14:31:05.000000000 -0400 @@ -356,9 +356,9 @@ - + True - e_contact_editor_create_source_option_menu + e_contact_editor_create_source_combo_box 0 0 Tue, 13 Apr 2004 20:47:50 GMT diff -up evolution-2.12.0/addressbook/gui/contact-editor/e-contact-editor.c.e-source-combo-box evolution-2.12.0/addressbook/gui/contact-editor/e-contact-editor.c --- evolution-2.12.0/addressbook/gui/contact-editor/e-contact-editor.c.e-source-combo-box 2007-09-16 14:52:39.000000000 -0400 +++ evolution-2.12.0/addressbook/gui/contact-editor/e-contact-editor.c 2007-09-17 14:31:05.000000000 -0400 @@ -46,7 +46,7 @@ #include #include -#include +#include #include @@ -589,15 +589,16 @@ static void fill_in_source_field (EContactEditor *editor) { GtkWidget *source_menu; - ESource *source; if (!editor->target_book) return; - source_menu = glade_xml_get_widget (editor->gui, "source-option-menu-source"); - source = e_book_get_source (editor->target_book); + source_menu = glade_xml_get_widget ( + editor->gui, "source-combo-box-source"); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (source_menu), source); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (source_menu), + e_book_get_source (editor->target_book)); } static void @@ -2527,13 +2528,15 @@ new_target_cb (EBook *new_book, EBookSta editor->load_book = NULL; if (status != E_BOOK_ERROR_OK || new_book == NULL) { - GtkWidget *source_option_menu; + GtkWidget *source_combo_box; eab_load_error_dialog (NULL, e_book_get_source (new_book), status); - source_option_menu = glade_xml_get_widget (editor->gui, "source-option-menu-source"); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (source_option_menu), - e_book_get_source (editor->target_book)); + source_combo_box = glade_xml_get_widget ( + editor->gui, "source-combo-box-source"); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (source_combo_box), + e_book_get_source (editor->target_book)); if (new_book) g_object_unref (new_book); @@ -2557,8 +2560,12 @@ cancel_load (EContactEditor *editor) } static void -source_selected (GtkWidget *source_option_menu, ESource *source, EContactEditor *editor) +source_changed (ESourceComboBox *source_combo_box, EContactEditor *editor) { + ESource *source; + + source = e_source_combo_box_get_active (source_combo_box); + cancel_load (editor); if (e_source_equal (e_book_get_source (editor->target_book), source)) @@ -3383,8 +3390,8 @@ e_contact_editor_init (EContactEditor *e g_signal_connect (widget, "clicked", G_CALLBACK (full_name_clicked), e_contact_editor); widget = glade_xml_get_widget(e_contact_editor->gui, "button-categories"); g_signal_connect (widget, "clicked", G_CALLBACK (categories_clicked), e_contact_editor); - widget = glade_xml_get_widget (e_contact_editor->gui, "source-option-menu-source"); - g_signal_connect (widget, "source_selected", G_CALLBACK (source_selected), e_contact_editor); + widget = glade_xml_get_widget (e_contact_editor->gui, "source-combo-box-source"); + g_signal_connect (widget, "changed", G_CALLBACK (source_changed), e_contact_editor); label = glade_xml_get_widget (e_contact_editor->gui, "where-label"); gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget); widget = glade_xml_get_widget (e_contact_editor->gui, "button-ok"); @@ -3835,26 +3842,26 @@ e_contact_editor_create_web(gchar *name, } GtkWidget * -e_contact_editor_create_source_option_menu (gchar *name, - gchar *string1, gchar *string2, - gint int1, gint int2); +e_contact_editor_create_source_combo_box (gchar *name, + gchar *string1, gchar *string2, + gint int1, gint int2); GtkWidget * -e_contact_editor_create_source_option_menu (gchar *name, - gchar *string1, gchar *string2, - gint int1, gint int2) +e_contact_editor_create_source_combo_box (gchar *name, + gchar *string1, gchar *string2, + gint int1, gint int2) { - GtkWidget *menu; + GtkWidget *combo_box; GConfClient *gconf_client; ESourceList *source_list; gconf_client = gconf_client_get_default (); source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/addressbook/sources"); - menu = e_source_option_menu_new (source_list); + combo_box = e_source_combo_box_new (source_list); g_object_unref (source_list); g_object_unref (gconf_client); - gtk_widget_show (menu); - return menu; + gtk_widget_show (combo_box); + return combo_box; } diff -up evolution-2.12.0/addressbook/gui/contact-editor/e-contact-quick-add.c.e-source-combo-box evolution-2.12.0/addressbook/gui/contact-editor/e-contact-quick-add.c --- evolution-2.12.0/addressbook/gui/contact-editor/e-contact-quick-add.c.e-source-combo-box 2007-09-16 14:52:39.000000000 -0400 +++ evolution-2.12.0/addressbook/gui/contact-editor/e-contact-quick-add.c 2007-09-17 14:31:05.000000000 -0400 @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include "e-contact-editor.h" @@ -269,8 +269,12 @@ clicked_cb (GtkWidget *w, gint button, g } static void -source_selected (GtkWidget *source_option_menu, ESource *source, QuickAdd *qa) +source_changed (ESourceComboBox *source_combo_box, QuickAdd *qa) { + ESource *source; + + source = e_source_combo_box_get_active (source_combo_box); + if (qa->book) { g_object_unref (qa->book); qa->book = NULL; @@ -319,16 +323,20 @@ build_quick_add_dialog (QuickAdd *qa) gconf_client = gconf_client_get_default (); source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/addressbook/sources"); g_object_unref (gconf_client); - qa->option_menu = e_source_option_menu_new (source_list); + qa->option_menu = e_source_combo_box_new (source_list); book = e_book_new_default_addressbook (NULL); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (qa->option_menu), e_book_get_source(book)); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (qa->option_menu), + e_book_get_source (book)); if (qa->book) { g_object_unref (qa->book); qa->book = NULL; } qa->book = book ; - source_selected(qa->option_menu, e_source_option_menu_peek_selected ((ESourceOptionMenu *)qa->option_menu), qa); - g_signal_connect (qa->option_menu, "source_selected", G_CALLBACK (source_selected), qa); + source_changed (E_SOURCE_COMBO_BOX (qa->option_menu), qa); + g_signal_connect ( + qa->option_menu, "changed", + G_CALLBACK (source_changed), qa); g_object_unref (source_list); diff -up evolution-2.12.0/calendar/gui/dialogs/memo-page.glade.e-source-combo-box evolution-2.12.0/calendar/gui/dialogs/memo-page.glade --- evolution-2.12.0/calendar/gui/dialogs/memo-page.glade.e-source-combo-box 2007-09-16 15:33:57.000000000 -0400 +++ evolution-2.12.0/calendar/gui/dialogs/memo-page.glade 2007-09-17 14:31:05.000000000 -0400 @@ -194,7 +194,7 @@ True - memo_page_create_source_option_menu + memo_page_create_source_combo_box 0 0 Tue, 13 Jan 2004 22:00:00 GMT diff -up evolution-2.12.0/calendar/gui/dialogs/event-page.glade.e-source-combo-box evolution-2.12.0/calendar/gui/dialogs/event-page.glade --- evolution-2.12.0/calendar/gui/dialogs/event-page.glade.e-source-combo-box 2007-09-16 15:33:57.000000000 -0400 +++ evolution-2.12.0/calendar/gui/dialogs/event-page.glade 2007-09-17 14:31:05.000000000 -0400 @@ -827,7 +827,7 @@ True - event_page_create_source_option_menu + event_page_create_source_combo_box 0 0 Wed, 17 Dec 2003 18:20:26 GMT diff -up evolution-2.12.0/calendar/gui/dialogs/task-page.glade.e-source-combo-box evolution-2.12.0/calendar/gui/dialogs/task-page.glade --- evolution-2.12.0/calendar/gui/dialogs/task-page.glade.e-source-combo-box 2007-09-16 15:33:57.000000000 -0400 +++ evolution-2.12.0/calendar/gui/dialogs/task-page.glade 2007-09-17 14:31:05.000000000 -0400 @@ -671,7 +671,7 @@ 24 True - task_page_create_source_option_menu + task_page_create_source_combo_box 0 0 Thu, 18 Dec 2003 01:58:48 GMT diff -up evolution-2.12.0/calendar/gui/dialogs/memo-page.c.e-source-combo-box evolution-2.12.0/calendar/gui/dialogs/memo-page.c --- evolution-2.12.0/calendar/gui/dialogs/memo-page.c.e-source-combo-box 2007-09-16 15:33:57.000000000 -0400 +++ evolution-2.12.0/calendar/gui/dialogs/memo-page.c 2007-09-17 14:31:44.000000000 -0400 @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -352,7 +352,6 @@ memo_page_fill_widgets (CompEditorPage * GSList *l; const char *categories; gchar *backend_addr = NULL; - ESource *source; mpage = MEMO_PAGE (page); priv = mpage->priv; @@ -451,8 +450,9 @@ memo_page_fill_widgets (CompEditorPage * g_free (backend_addr); /* Source */ - source = e_cal_get_source (page->client); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source_selector), source); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (priv->source_selector), + e_cal_get_source (page->client)); priv->updating = FALSE; @@ -893,13 +893,12 @@ field_changed_cb (GtkWidget *widget, gpo } static void -source_changed_cb (GtkWidget *widget, ESource *source, gpointer data) +source_changed_cb (ESourceComboBox *source_combo_box, MemoPage *mpage) { - MemoPage *mpage; - MemoPagePrivate *priv; + MemoPagePrivate *priv = mpage->priv; + ESource *source; - mpage = MEMO_PAGE (data); - priv = mpage->priv; + source = e_source_combo_box_get_active (source_combo_box); if (!priv->updating) { ECal *client; @@ -911,8 +910,9 @@ source_changed_cb (GtkWidget *widget, ES if (client) g_object_unref (client); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source_selector), - e_cal_get_source (COMP_EDITOR_PAGE (mpage)->client)); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (priv->source_selector), + e_cal_get_source (COMP_EDITOR_PAGE (mpage)->client)); dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, @@ -1055,7 +1055,7 @@ init_widgets (MemoPage *mpage) G_CALLBACK (categories_clicked_cb), mpage); /* Source selector */ - g_signal_connect((priv->source_selector), "source_selected", + g_signal_connect((priv->source_selector), "changed", G_CALLBACK (source_changed_cb), mpage); /* Connect the default signal handler to use to make sure the "changed" @@ -1271,22 +1271,23 @@ memo_page_create_date_edit (void) return dedit; } -GtkWidget *memo_page_create_source_option_menu (void); +GtkWidget *memo_page_create_source_combo_box (void); GtkWidget * -memo_page_create_source_option_menu (void) +memo_page_create_source_combo_box (void) { - GtkWidget *menu; + GtkWidget *combo_box; GConfClient *gconf_client; ESourceList *source_list; gconf_client = gconf_client_get_default (); - source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/memos/sources"); + source_list = e_source_list_new_for_gconf ( + gconf_client, "/apps/evolution/memos/sources"); - menu = e_source_option_menu_new (source_list); + combo_box = e_source_combo_box_new (source_list); g_object_unref (source_list); g_object_unref (gconf_client); - gtk_widget_show (menu); - return menu; + gtk_widget_show (combo_box); + return combo_box; } diff -up evolution-2.12.0/calendar/gui/dialogs/event-page.c.e-source-combo-box evolution-2.12.0/calendar/gui/dialogs/event-page.c --- evolution-2.12.0/calendar/gui/dialogs/event-page.c.e-source-combo-box 2007-09-16 15:33:57.000000000 -0400 +++ evolution-2.12.0/calendar/gui/dialogs/event-page.c 2007-09-17 14:31:05.000000000 -0400 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "common/authentication.h" #include "e-util/e-categories-config.h" #include "e-util/e-dialog-widgets.h" @@ -1000,7 +1000,6 @@ event_page_fill_widgets (CompEditorPage const char *location, *uid = NULL; const char *categories; gchar *backend_addr = NULL; - ESource *source; GSList *l; gboolean validated = TRUE; @@ -1215,8 +1214,9 @@ event_page_fill_widgets (CompEditorPage e_dialog_editable_set (priv->categories, categories); /* Source */ - source = e_cal_get_source (page->client); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source_selector), source); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (priv->source_selector), + e_cal_get_source (page->client)); e_cal_component_get_uid (comp, &uid); if (!(COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE) @@ -2662,7 +2662,8 @@ event_page_sendoptions_clicked_cb (Event if (!priv->sod) { priv->sod = e_sendoptions_dialog_new (); - source = e_source_option_menu_peek_selected (E_SOURCE_OPTION_MENU (priv->source_selector)); + source = e_source_combo_box_get_active ( + E_SOURCE_COMBO_BOX (priv->source_selector)); e_sendoptions_utils_set_default_data (priv->sod, source, "calendar"); priv->sod->data->initialized = TRUE; } @@ -2691,13 +2692,12 @@ field_changed_cb (GtkWidget *widget, gpo } static void -source_changed_cb (GtkWidget *widget, ESource *source, gpointer data) +source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage) { - EventPage *epage; - EventPagePrivate *priv; + EventPagePrivate *priv = epage->priv; + ESource *source; - epage = EVENT_PAGE (data); - priv = epage->priv; + source = e_source_combo_box_get_active (source_combo_box); if (!priv->updating) { ECal *client; @@ -2716,8 +2716,9 @@ source_changed_cb (GtkWidget *widget, ES if (client) g_object_unref (client); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source_selector), - e_cal_get_source (COMP_EDITOR_PAGE (epage)->client)); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (priv->source_selector), + e_cal_get_source (COMP_EDITOR_PAGE (epage)->client)); dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, @@ -2980,7 +2981,7 @@ init_widgets (EventPage *epage) G_CALLBACK (categories_clicked_cb), epage); /* Source selector */ - g_signal_connect((priv->source_selector), "source_selected", + g_signal_connect((priv->source_selector), "changed", G_CALLBACK (source_changed_cb), epage); /* Alarms */ priv->alarm_list_store = e_alarm_list_new (); @@ -3306,24 +3307,25 @@ make_timezone_entry (void) return w; } -GtkWidget *event_page_create_source_option_menu (void); +GtkWidget *event_page_create_source_combo_box (void); GtkWidget * -event_page_create_source_option_menu (void) +event_page_create_source_combo_box (void) { - GtkWidget *menu; + GtkWidget *combo_box; GConfClient *gconf_client; ESourceList *source_list; gconf_client = gconf_client_get_default (); - source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/calendar/sources"); + source_list = e_source_list_new_for_gconf ( + gconf_client, "/apps/evolution/calendar/sources"); - menu = e_source_option_menu_new (source_list); + combo_box = e_source_combo_box_new (source_list); g_object_unref (source_list); g_object_unref (gconf_client); - gtk_widget_show (menu); - return menu; + gtk_widget_show (combo_box); + return combo_box; } GtkWidget *make_status_icons (void); diff -up evolution-2.12.0/calendar/gui/dialogs/task-page.c.e-source-combo-box evolution-2.12.0/calendar/gui/dialogs/task-page.c --- evolution-2.12.0/calendar/gui/dialogs/task-page.c.e-source-combo-box 2007-09-16 15:33:57.000000000 -0400 +++ evolution-2.12.0/calendar/gui/dialogs/task-page.c 2007-09-17 14:31:58.000000000 -0400 @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include "common/authentication.h" @@ -533,7 +533,6 @@ task_page_fill_widgets (CompEditorPage * const char *categories, *uid; icaltimezone *zone, *default_zone; gchar *backend_addr = NULL; - ESource *source; tpage = TASK_PAGE (page); priv = tpage->priv; @@ -677,8 +676,9 @@ task_page_fill_widgets (CompEditorPage * e_dialog_editable_set (priv->categories, categories); /* Source */ - source = e_cal_get_source (page->client); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source_selector), source); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (priv->source_selector), + e_cal_get_source (page->client)); e_cal_get_cal_address (COMP_EDITOR_PAGE (tpage)->client, &backend_addr, NULL); set_subscriber_info_string (tpage, backend_addr); @@ -1688,13 +1688,12 @@ field_changed_cb (GtkWidget *widget, gpo } static void -source_changed_cb (GtkWidget *widget, ESource *source, gpointer data) +source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage) { - TaskPage *tpage; - TaskPagePrivate *priv; + TaskPagePrivate *priv = tpage->priv; + ESource *source; - tpage = TASK_PAGE (data); - priv = tpage->priv; + source = e_source_combo_box_get_active (source_combo_box); if (!priv->updating) { ECal *client; @@ -1713,8 +1712,9 @@ source_changed_cb (GtkWidget *widget, ES if (client) g_object_unref (client); - e_source_option_menu_select (E_SOURCE_OPTION_MENU (priv->source_selector), - e_cal_get_source (COMP_EDITOR_PAGE (tpage)->client)); + e_source_combo_box_set_active ( + E_SOURCE_COMBO_BOX (priv->source_selector), + e_cal_get_source (COMP_EDITOR_PAGE (tpage)->client)); dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, @@ -1726,7 +1726,7 @@ source_changed_cb (GtkWidget *widget, ES comp_editor_notify_client_changed ( COMP_EDITOR (gtk_widget_get_toplevel (priv->main)), client); - field_changed_cb (widget, data); + field_changed_cb (GTK_WIDGET (source_combo_box), tpage); if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS) && priv->is_assignment) task_page_show_options (tpage); else @@ -1778,7 +1778,8 @@ task_page_sendoptions_clicked_cb (TaskPa if (!priv->sod) { priv->sod = e_sendoptions_dialog_new (); priv->sod->data->initialized = TRUE; - source = e_source_option_menu_peek_selected (E_SOURCE_OPTION_MENU (priv->source_selector)); + source = e_source_combo_box_get_active ( + E_SOURCE_COMBO_BOX (priv->source_selector)); e_sendoptions_utils_set_default_data (priv->sod, source, "task"); } @@ -1836,7 +1837,7 @@ init_widgets (TaskPage *tpage) G_CALLBACK (categories_clicked_cb), tpage); /* Source selector */ - g_signal_connect((priv->source_selector), "source_selected", + g_signal_connect((priv->source_selector), "source_changed", G_CALLBACK (source_changed_cb), tpage); /* Connect the default signal handler to use to make sure the "changed" @@ -2081,22 +2082,23 @@ task_page_create_date_edit (void) return dedit; } -GtkWidget *task_page_create_source_option_menu (void); +GtkWidget *task_page_create_source_combo_box (void); GtkWidget * -task_page_create_source_option_menu (void) +task_page_create_source_combo_box (void) { - GtkWidget *menu; + GtkWidget *combo_box; GConfClient *gconf_client; ESourceList *source_list; gconf_client = gconf_client_get_default (); - source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/tasks/sources"); + source_list = e_source_list_new_for_gconf ( + gconf_client, "/apps/evolution/tasks/sources"); - menu = e_source_option_menu_new (source_list); + combo_box = e_source_combo_box_new (source_list); g_object_unref (source_list); g_object_unref (gconf_client); - gtk_widget_show (menu); - return menu; + gtk_widget_show (combo_box); + return combo_box; } diff -up evolution-2.12.0/calendar/gui/e-itip-control.c.e-source-combo-box evolution-2.12.0/calendar/gui/e-itip-control.c --- evolution-2.12.0/calendar/gui/e-itip-control.c.e-source-combo-box 2007-09-16 15:34:45.000000000 -0400 +++ evolution-2.12.0/calendar/gui/e-itip-control.c 2007-09-17 14:31:05.000000000 -0400 @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include @@ -226,13 +226,13 @@ typedef struct { } EItipControlFindData; static void -source_selected_cb (ESourceOptionMenu *esom, ESource *source, gpointer data) +source_changed_cb (ESourceComboBox *escb, EItipControl *itip) { - EItipControl *itip = data; - EItipControlPrivate *priv; - - priv = itip->priv; + EItipControlPrivate *priv = itip->priv; + ESource *source; + source = e_source_combo_box_get_active (escb); + if (priv->ok) gtk_widget_set_sensitive (priv->ok, FALSE); @@ -273,7 +273,7 @@ find_cal_opened_cb (ECal *ecal, ECalenda cleanup: if (fd->count == 0) { if (fd->show_selector && !priv->current_ecal && priv->vbox) { - GtkWidget *esom; + GtkWidget *escb; char *uid; switch (priv->type) { @@ -297,17 +297,17 @@ find_cal_opened_cb (ECal *ecal, ECalenda if (!source) source = e_source_list_peek_source_any (priv->source_lists[priv->type]); - esom = e_source_option_menu_new (priv->source_lists[priv->type]); - g_signal_connect_object (esom, "source_selected", - G_CALLBACK (source_selected_cb), - fd->itip, 0); + escb = e_source_combo_box_new (priv->source_lists[priv->type]); + g_signal_connect_object ( + escb, "changed", + G_CALLBACK (source_changed_cb), fd->itip, 0); - gtk_box_pack_start (GTK_BOX (priv->vbox), esom, FALSE, TRUE, 0); - gtk_widget_show (esom); + gtk_box_pack_start (GTK_BOX (priv->vbox), escb, FALSE, TRUE, 0); + gtk_widget_show (escb); /* FIXME What if there is no source? */ if (source) - e_source_option_menu_select (E_SOURCE_OPTION_MENU (esom), source); + e_source_combo_box_set_active (E_SOURCE_COMBO_BOX (escb), source); } else { /* FIXME Display error message to user */ }