diff options
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/mail-composer-prefs.c | 26 | ||||
-rw-r--r-- | mail/mail-preferences.c | 20 |
3 files changed, 46 insertions, 8 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 293462a83d..25359767b9 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2002-03-29 Jeffrey Stedfast <fejj@ximian.com> + + * mail-composer-prefs.c (mail_composer_prefs_construct): Same + here. + + * mail-preferences.c (mail_preferences_construct): Do some gtk + hackery action so we can detect if a option menu has changed. + 2002-03-29 Ettore Perazzoli <ettore@ximian.com> * GNOME_Evolution_Mail.oaf.in: Cleaned up a bunch [removing diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c index 6b1f4e09dc..9b20e2fe77 100644 --- a/mail/mail-composer-prefs.c +++ b/mail/mail-composer-prefs.c @@ -144,6 +144,23 @@ menu_changed (GtkWidget *widget, gpointer user_data) } static void +option_menu_connect (GtkOptionMenu *omenu, gpointer user_data) +{ + GtkWidget *menu, *item; + GList *items; + + menu = gtk_option_menu_get_menu (omenu); + + items = GTK_MENU_SHELL (menu)->children; + while (items) { + item = items->data; + gtk_signal_connect (GTK_OBJECT (item), "activate", + menu_changed, user_data); + items = items->next; + } +} + +static void mail_composer_prefs_construct (MailComposerPrefs *prefs) { GtkWidget *toplevel, *menu; @@ -183,8 +200,7 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs) prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset")); menu = e_charset_picker_new (mail_config_get_default_charset ()); gtk_option_menu_set_menu (prefs->charset, GTK_WIDGET (menu)); - gtk_signal_connect (GTK_OBJECT (prefs->charset), "clicked", - menu_changed, prefs); + option_menu_connect (prefs->charset, prefs); /* Spell Checking */ prefs->spell_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEnableSpellChecking")); @@ -197,16 +213,14 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs) style = 0; gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (prefs->forward_style)), attach_style_info, &style); - gtk_signal_connect (GTK_OBJECT (prefs->forward_style), "clicked", - menu_changed, prefs); + option_menu_connect (prefs->forward_style, prefs); prefs->reply_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuReplyStyle")); gtk_option_menu_set_history (prefs->reply_style, mail_config_get_default_reply_style ()); style = 0; gtk_container_foreach (GTK_CONTAINER (gtk_option_menu_get_menu (prefs->reply_style)), attach_style_info, &style); - gtk_signal_connect (GTK_OBJECT (prefs->reply_style), "clicked", - menu_changed, prefs); + option_menu_connect (prefs->reply_style, prefs); /* FIXME: do the other tabs... */ } diff --git a/mail/mail-preferences.c b/mail/mail-preferences.c index 02096798a4..6a964c57ef 100644 --- a/mail/mail-preferences.c +++ b/mail/mail-preferences.c @@ -157,6 +157,23 @@ menu_changed (GtkWidget *widget, gpointer user_data) } static void +option_menu_connect (GtkOptionMenu *omenu, gpointer user_data) +{ + GtkWidget *menu, *item; + GList *items; + + menu = gtk_option_menu_get_menu (omenu); + + items = GTK_MENU_SHELL (menu)->children; + while (items) { + item = items->data; + gtk_signal_connect (GTK_OBJECT (item), "activate", + menu_changed, user_data); + items = items->next; + } +} + +static void mail_preferences_construct (MailPreferences *prefs) { GtkWidget *toplevel, *menu; @@ -191,8 +208,7 @@ mail_preferences_construct (MailPreferences *prefs) prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset")); menu = e_charset_picker_new (mail_config_get_default_charset ()); gtk_option_menu_set_menu (prefs->charset, GTK_WIDGET (menu)); - gtk_signal_connect (GTK_OBJECT (prefs->charset), "clicked", - menu_changed, prefs); + option_menu_connect (prefs->charset, prefs); prefs->citation_highlight = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkHighlightCitations")); gtk_toggle_button_set_active (prefs->citation_highlight, mail_config_get_citation_highlight ()); |