diff --git a/mail/ChangeLog b/mail/ChangeLog index 6f8565b8fc..6407eee8c0 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,32 @@ 2002-04-29 Larry Ewing + * mail-config-factory.c (config_control_factory_cb): handle + requests for the font manager control. + + * mail-config.glade: add fonts tabs and reorder composer options + to match the new dialogs from anna. + + * GNOME_Evolution_Mail.oaf.in: add font manager control definition. + + * mail-composer-prefs.c (mail_composer_prefs_construct): hook to + the gtkhtml propmanager. + (mail_composer_prefs_apply): apply propmanager changes. + (mail_composer_prefs_finalise): unref the propmanager. + + * mail-composer-prefs.h: add propmanager member. + + * mail-font-prefs.c: initialize gui properly. + + * mail-preferences.c (mail_preferences_construct): hook to + gtkhtml's propmanager. + (mail_preferences_apply): apply propmanager changes. + (mail_preferences_finalise): unref the propmanager. + + * mail-preferences.h: add propmanager member. + + * Makefile.am (evolution_mail_SOURCES): add mail-font-prefs.[ch] + to the build. + * mail-tools.c (mail_tool_quote_message): use the html reply logic even for plain parts so that we can test out the new gtkhtml cite logic. diff --git a/mail/GNOME_Evolution_Mail.oaf.in b/mail/GNOME_Evolution_Mail.oaf.in index a643c22a64..8b3921d085 100644 --- a/mail/GNOME_Evolution_Mail.oaf.in +++ b/mail/GNOME_Evolution_Mail.oaf.in @@ -251,6 +251,31 @@ + + + + + + + + + + + + + + + + + + + gui)); - + gtk_object_unref (GTK_OBJECT (prefs->pman)); + ((GtkObjectClass *)(parent_class))->finalize (obj); } @@ -104,13 +105,18 @@ mail_composer_prefs_destroy (GtkObject *obj) MailComposerPrefs *prefs = (MailComposerPrefs *) obj; mail_config_signature_unregister_client ((MailConfigSignatureClient) sig_event_client, prefs); + + if (GTK_OBJECT_CLASS (parent_class)) + (* GTK_OBJECT_CLASS (parent_class)->destroy) (obj); } +#if 0 static void colorpicker_set_color (GnomeColorPicker *color, guint32 rgb) { gnome_color_picker_set_i8 (color, (rgb & 0xff0000) >> 16, (rgb & 0xff00) >> 8, rgb & 0xff, 0xff); } +#endif static guint32 colorpicker_get_color (GnomeColorPicker *color) @@ -549,10 +555,24 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs) /* Spell Checking */ /* FIXME: do stuff with these */ - prefs->spell_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEnableSpellChecking")); + { + char *names[][2] = {{"live_spell_check", "chkEnableSpellChecking"}, + {"gtk_html_prop_keymap_option", "omenuShortcutsType"}, + {NULL, NULL}}; + + prefs->pman = GTK_HTML_PROPMANAGER (gtk_html_propmanager_new (NULL)); + gtk_object_ref (GTK_OBJECT (prefs->pman)); + gtk_object_sink (GTK_OBJECT (prefs->pman)); + + gtk_html_propmanager_set_names (prefs->pman, names); + gtk_html_propmanager_set_gui (prefs->pman, gui, NULL); + gtk_signal_connect (GTK_OBJECT (prefs->pman), "changed", toggle_button_toggled, prefs); + } + /* prefs->colour = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, "colorpickerSpellCheckColor")); prefs->language = GTK_COMBO (glade_xml_get_widget (gui, "cmboSpellCheckLanguage")); - + */ + /* Forwards and Replies */ prefs->forward_style = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuForwardStyle")); gtk_option_menu_set_history (prefs->forward_style, mail_config_get_default_forward_style ()); @@ -667,6 +687,7 @@ mail_composer_prefs_apply (MailComposerPrefs *prefs) /* Spell Checking */ /* FIXME: implement me */ + gtk_html_propmanager_apply (prefs->pman); /* Forwards and Replies */ menu = gtk_option_menu_get_menu (prefs->forward_style); diff --git a/mail/mail-composer-prefs.h b/mail/mail-composer-prefs.h index 41867dd61c..89ccd0552a 100644 --- a/mail/mail-composer-prefs.h +++ b/mail/mail-composer-prefs.h @@ -35,6 +35,7 @@ extern "C" { #include #include #include +#include #include "mail-signature-editor.h" @@ -67,6 +68,7 @@ struct _MailComposerPrefs { GtkOptionMenu *charset; /* Spell Checking */ + GtkHTMLPropmanager *pman; GtkToggleButton *spell_check; GnomeColorPicker *colour; GtkCombo *language; diff --git a/mail/mail-config-factory.c b/mail/mail-config-factory.c index 2e825b8b5a..f7ce73fd38 100644 --- a/mail/mail-config-factory.c +++ b/mail/mail-config-factory.c @@ -28,6 +28,7 @@ #include "mail-accounts.h" #include "mail-preferences.h" #include "mail-composer-prefs.h" +#include "mail-font-prefs.h" #include "mail-config-factory.h" @@ -51,6 +52,7 @@ config_control_destroy_callback (EvolutionConfigControl *config_control, void *u struct _config_data *data = user_data; gtk_widget_unref (data->prefs); + g_free (data); } @@ -62,7 +64,6 @@ config_control_apply_callback (EvolutionConfigControl *config_control, void *use data->apply (data->prefs); } - static BonoboObject * config_control_factory_cb (BonoboGenericFactory *factory, const char *component_id, void *user_data) { @@ -82,6 +83,9 @@ config_control_factory_cb (BonoboGenericFactory *factory, const char *component_ } else if (!strcmp (component_id, MAIL_COMPOSER_PREFS_CONTROL_ID)) { prefs = mail_composer_prefs_new (); data->apply = (ApplyFunc) mail_composer_prefs_apply; + } else if (!strcmp (component_id, MAIL_FONT_PREFS_CONTROL_ID)) { + prefs = mail_font_prefs_new (); + data->apply = (ApplyFunc) mail_font_prefs_apply; } else { g_assert_not_reached (); } @@ -99,6 +103,8 @@ config_control_factory_cb (BonoboGenericFactory *factory, const char *component_ MAIL_PREFERENCES (prefs)->control = control; } else if (!strcmp (component_id, MAIL_COMPOSER_PREFS_CONTROL_ID)) { MAIL_COMPOSER_PREFS (prefs)->control = control; + } else if (!strcmp (component_id, MAIL_FONT_PREFS_CONTROL_ID)) { + MAIL_FONT_PREFS (prefs)->control = control; } else { g_assert_not_reached (); } diff --git a/mail/mail-config.glade b/mail/mail-config.glade index 1dbf9dc8e7..db72ae28b9 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -3840,6 +3840,53 @@ Baltic (ISO-8859-4) False 3 + + GtkHBox + hboxShortcutsType + 3 + False + 3 + + 0 + False + False + + + + GtkLabel + lblShortcutsType + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + omenuShortcutsType + + 0 + False + False + + + + + GtkOptionMenu + omenuShortcutsType + True + Emacs +XEmacs +Microsoft + + 0 + + 0 + False + False + + + + GtkFrame frameBehavior @@ -3859,11 +3906,213 @@ Baltic (ISO-8859-4) False 3 + + GtkTable + tableForwardsReplies + 3 + 3 + 2 + False + 3 + 3 + + 0 + False + False + + + + GtkLabel + lblForwardStyle + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + lblReplyStyle + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkAlignment + alignment25 + 7.45058e-09 + 0.5 + 0 + 1 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + GtkHBox + hboxReplyStyle + False + 0 + + + GtkOptionMenu + omenuReplyStyle + True + Quote original message +Do not quote original message +Attach original message + + 0 + + 0 + False + False + + + + + + + GtkHBox + hboxForwardStyle + False + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + + GtkOptionMenu + omenuForwardStyle + True + Attachment +Inline +Quoted + + 0 + + 0 + False + False + + + + + + GtkLabel + lblCharset + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + omenuCharset + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkOptionMenu + omenuCharset + True + Baltic (ISO-8859-13) +Baltic (ISO-8859-4) + + 0 + + 1 + 2 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + GtkCheckButton chkSendHTML True - + False True @@ -3872,6 +4121,26 @@ Baltic (ISO-8859-4) False + + + + + GtkFrame + frameAlerts + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + True + + + + GtkVBox + vbox156 + False + 0 GtkCheckButton @@ -3891,7 +4160,7 @@ Baltic (ISO-8859-4) GtkCheckButton chkPromptBccOnly True - + False True @@ -3900,51 +4169,6 @@ Baltic (ISO-8859-4) False - - - GtkHBox - hboxCharset - False - 3 - - 0 - False - False - - - - GtkLabel - lblCharset - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - omenuCharset - - 0 - False - False - - - - - GtkOptionMenu - omenuCharset - True - Baltic (ISO-8859-13) -Baltic (ISO-8859-4) - - 0 - - 0 - False - False - - - @@ -3956,8 +4180,8 @@ Baltic (ISO-8859-4) GTK_SHADOW_ETCHED_IN 0 - False - False + True + True @@ -3971,7 +4195,7 @@ Baltic (ISO-8859-4) chkEnableSpellChecking True - True + False True 0 @@ -3995,7 +4219,7 @@ Baltic (ISO-8859-4) GtkLabel lblSpellCheckColor - + GTK_JUSTIFY_CENTER False 0.5 @@ -4088,165 +4312,6 @@ Arabic - - - GtkFrame - frameForwardsReplies - - 0 - GTK_SHADOW_ETCHED_IN - - 0 - False - True - - - - GtkTable - tableForwardsReplies - 3 - 2 - 2 - False - 3 - 3 - - - GtkLabel - lblForwardStyle - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - lblReplyStyle - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - GtkAlignment - alignment25 - 7.45058e-09 - 0.5 - 0 - 1 - - 1 - 2 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - GtkHBox - hboxReplyStyle - False - 0 - - - GtkOptionMenu - omenuReplyStyle - True - Quote original message -Do not quote original message -Attach original message - - 0 - - 0 - False - False - - - - - - - GtkHBox - hboxForwardStyle - False - 0 - - 1 - 2 - 0 - 1 - 0 - 0 - False - False - False - False - True - True - - - - GtkOptionMenu - omenuForwardStyle - True - Attachment -Inline -Quoted - - 0 - - 0 - False - False - - - - - @@ -4262,200 +4327,6 @@ Quoted 0 - - GtkVBox - vboxShortcuts - False - 0 - - - GtkHBox - hbox159 - 3 - False - 3 - - 0 - False - False - - - - GtkLabel - label438 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - optionmenu36 - - 0 - False - False - - - - - GtkOptionMenu - optionmenu36 - True - Emacs -XEmacs -Microsoft - - 0 - - 0 - False - False - - - - - - GtkHBox - hbox160 - False - 0 - - 0 - True - True - - - - GtkScrolledWindow - scrolledwindow45 - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_UPDATE_CONTINUOUS - GTK_UPDATE_CONTINUOUS - - 0 - True - True - - - - GtkCList - clistKeybindings - True - 2 - 80,80 - GTK_SELECTION_SINGLE - True - GTK_SHADOW_IN - - - GtkLabel - CList:title - label439 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkLabel - CList:title - label440 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - - - GtkVBox - vbox155 - False - 0 - - 0 - False - False - - - - GtkLabel - label441 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - 0 - False - False - - - - - GtkVButtonBox - vbuttonbox24 - GTK_BUTTONBOX_START - 0 - 85 - 27 - 7 - 0 - - 0 - True - True - - - - GtkButton - button222 - True - True - - GTK_RELIEF_NORMAL - - - - GtkButton - button223 - True - True - - GTK_RELIEF_NORMAL - - - - - - - - GtkLabel - Notebook:tab - lblKeyboardShortcuts - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - GtkVBox vboxSignatures @@ -4853,4 +4724,305 @@ Microsoft + + GtkWindow + font_tab + False + Font Properties + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + toplevel + 4 + False + 4 + + + GtkFrame + frame3 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + False + + + + GtkTable + tblScreen + 4 + 2 + 2 + False + 4 + 6 + + + GtkLabel + lblScreenVariable + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + screen_variable + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label444 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + screen_fixed + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GnomeFontPicker + screen_fixed + True + + font_set + changed + Mon, 11 Dec 2000 13:55:17 GMT + + Select HTML fixed width font + AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz + GNOME_FONT_PICKER_MODE_FONT_INFO + True + True + 14 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GnomeFontPicker + screen_variable + True + + font_set + changed + Mon, 11 Dec 2000 13:52:30 GMT + + Select HTML variable width font + AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz + GNOME_FONT_PICKER_MODE_FONT_INFO + True + True + 14 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + + + GtkFrame + frame4 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + False + + + + GtkTable + tblPrint + 4 + 2 + 2 + False + 4 + 6 + + + GtkLabel + lblPrintVariable + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + print_variable + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + lblPrintFixed + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + print_fixed + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GnomeFontPicker + print_fixed + True + + font_set + changed + Mon, 11 Dec 2000 13:56:31 GMT + + Select HTML fixed width font for printing + AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz + GNOME_FONT_PICKER_MODE_FONT_INFO + True + True + 14 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GnomeFontPicker + print_variable + True + + font_set + changed + Mon, 15 Oct 2001 18:13:14 GMT + + Select HTML variable width font for printing + AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz + GNOME_FONT_PICKER_MODE_FONT_INFO + True + True + 14 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + + + diff --git a/mail/mail-font-prefs.c b/mail/mail-font-prefs.c index be54049c4f..985e0c5c32 100644 --- a/mail/mail-font-prefs.c +++ b/mail/mail-font-prefs.c @@ -71,8 +71,8 @@ mail_font_prefs_init (MailFontPrefs *prefs) GtkWidget *toplevel; GladeXML *gui; - prefs->gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "font_tab"); - + gui = glade_xml_new (EVOLUTION_GLADEDIR "/mail-config.glade", "font_tab"); + prefs->gui = gui; prefs->pman = GTK_HTML_PROPMANAGER (gtk_html_propmanager_new (NULL)); gtk_html_propmanager_set_gui (prefs->pman, gui, NULL); diff --git a/mail/mail-preferences.c b/mail/mail-preferences.c index e0bae7e439..90e7d331bb 100644 --- a/mail/mail-preferences.c +++ b/mail/mail-preferences.c @@ -93,6 +93,7 @@ mail_preferences_finalise (GtkObject *obj) MailPreferences *prefs = (MailPreferences *) obj; gtk_object_unref (GTK_OBJECT (prefs->gui)); + gtk_object_unref (GTK_OBJECT (prefs->pman)); gtk_object_unref (GTK_OBJECT (prefs->gconf)); ((GtkObjectClass *)(parent_class))->finalize (obj); @@ -289,20 +290,22 @@ mail_preferences_construct (MailPreferences *prefs) toggle_button_toggled, prefs); /* Some GtkHTML settings */ - /* FIXME: use the gtkhtml interfaces for these settings when lewing gets around to adding them */ - prefs->show_animated = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkShowAnimatedImages")); - gtk_toggle_button_set_active (prefs->show_animated, - gconf_client_get_bool (prefs->gconf, GTK_HTML_GCONF_DIR "/animations", NULL)); - gtk_signal_connect (GTK_OBJECT (prefs->show_animated), "toggled", - toggle_button_toggled, prefs); - - prefs->autodetect_links = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkAutoDetectLinks")); - gtk_toggle_button_set_active (prefs->autodetect_links, - gconf_client_get_bool (prefs->gconf, GTK_HTML_GCONF_DIR "/magic_links", NULL)); - gtk_signal_connect (GTK_OBJECT (prefs->autodetect_links), "toggled", - toggle_button_toggled, prefs); - - + { + char *names[][2] = {{"anim_check", "chkShowAnimatedImages"}, + {"magic_check", "chkAutoDetectLinks"}, + {"gtk_html_prop_keymap_option", "omenuShortcutsType"}, + {NULL, NULL}}; + + prefs->pman = GTK_HTML_PROPMANAGER (gtk_html_propmanager_new (prefs->gconf)); + gtk_object_ref (GTK_OBJECT (prefs->pman)); + gtk_object_sink (GTK_OBJECT (prefs->pman)); + + gtk_html_propmanager_set_names (prefs->pman, names); + gtk_html_propmanager_set_gui (prefs->pman, gui, NULL); + gtk_signal_connect (GTK_OBJECT (prefs->pman), "changed", toggle_button_toggled, prefs); + + } + prefs->prompt_unwanted_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptWantHTML")); gtk_toggle_button_set_active (prefs->prompt_unwanted_html, mail_config_get_confirm_unwanted_html ()); gtk_signal_connect (GTK_OBJECT (prefs->prompt_unwanted_html), "toggled", @@ -409,11 +412,7 @@ mail_preferences_apply (MailPreferences *prefs) else mail_config_set_http_mode (MAIL_CONFIG_HTTP_NEVER); - gconf_client_set_bool (prefs->gconf, GTK_HTML_GCONF_DIR "/animations", - gtk_toggle_button_get_active (prefs->show_animated), NULL); - - gconf_client_set_bool (prefs->gconf, GTK_HTML_GCONF_DIR "/magic_links", - gtk_toggle_button_get_active (prefs->autodetect_links), NULL); + gtk_html_propmanager_apply (prefs->pman); mail_config_set_confirm_unwanted_html (gtk_toggle_button_get_active (prefs->prompt_unwanted_html)); @@ -437,3 +436,4 @@ mail_preferences_apply (MailPreferences *prefs) mail_config_set_label_color (i, rgb); } } + diff --git a/mail/mail-preferences.h b/mail/mail-preferences.h index 8403bdb719..86317a5239 100644 --- a/mail/mail-preferences.h +++ b/mail/mail-preferences.h @@ -34,7 +34,7 @@ extern "C" { #include #include #include - +#include #include #include "evolution-config-control.h" @@ -89,6 +89,9 @@ struct _MailPreferences { GtkToggleButton *show_animated; GtkToggleButton *autodetect_links; GtkToggleButton *prompt_unwanted_html; + + /* GtkHTML Properties */ + GtkHTMLPropmanager *pman; /* Security tab */ GnomeFileEntry *pgp_path;