From 8d75f1b9bc33edd7dab1f6299b415d5717ba76c6 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Tue, 20 May 2003 18:33:33 +0000 Subject: remove references to gtkhtml property manager. Connect to missing 2003-05-20 Larry Ewing * mail-composer-prefs.c: remove references to gtkhtml property manager. Connect to missing settings. * mail-preferences.c: remove references to gtkhtml property manager. Connect to missing settings. * mail-config.glade: remove keybinding setting. * mail-display.c (mail_display_destroy): remove notification. (display_notify): set animate and redisplay. We have to redisplay because the citation color may have changed. * evolution-mail.schemas: add composer and display gconf entries. svn path=/trunk/; revision=21288 --- mail/ChangeLog | 16 ++++++++++ mail/evolution-mail.schemas | 56 ++++++++++++++++++++++++++++++++ mail/mail-composer-prefs.c | 42 ++++++++++-------------- mail/mail-composer-prefs.h | 5 --- mail/mail-config.glade | 78 --------------------------------------------- mail/mail-display.c | 35 ++++++++++++++++++-- mail/mail-preferences.c | 14 +++++--- mail/mail-preferences.h | 6 ---- 8 files changed, 129 insertions(+), 123 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index ec22310e8b..b99183261b 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,19 @@ +2003-05-20 Larry Ewing + + * mail-composer-prefs.c: remove references to gtkhtml property + manager. Connect to missing settings. + + * mail-preferences.c: remove references to gtkhtml property + manager. Connect to missing settings. + + * mail-config.glade: remove keybinding setting. + + * mail-display.c (mail_display_destroy): remove notification. + (display_notify): set animate and redisplay. We have to redisplay + because the citation color may have changed. + + * evolution-mail.schemas: add composer and display gconf entries. + 2003-05-19 Jeffrey Stedfast * mail-account-gui.c (mail_account_gui_save): Only re-add the diff --git a/mail/evolution-mail.schemas b/mail/evolution-mail.schemas index 2a3113a289..9dcec79ee9 100644 --- a/mail/evolution-mail.schemas +++ b/mail/evolution-mail.schemas @@ -31,6 +31,48 @@ + + /schemas/apps/evolution/mail/composer/magic_links + /apps/evolution/mail/composer/magic_links + evolution-mail + bool + true + + Automatic link recognition + + Recognize links in text and replace them. + + + + + + /schemas/apps/evolution/mail/composer/magic_smileys + /apps/evolution/mail/composer/send_smileys + evolution-mail + bool + false + + Automatic smiley recognition + + Recognize smileys in text and replace them with images. + + + + + + /schemas/apps/evolution/mail/composer/inline_spelling + /apps/evolution/mail/composer/inline_spelling + evolution-mail + bool + true + + Spell check inline + + Draw spelling error indicators on words as you type. + + + + /schemas/apps/evolution/mail/composer/view/From /apps/evolution/mail/composer/view/From @@ -148,6 +190,20 @@ + + /schemas/apps/evolution/mail/display/animate_images + /apps/evolution/mail/display/animate_images + evolution-mail + bool + true + + Show Animations + + Show animated images as animations. + + + + /schemas/apps/evolution/mail/display/mime_types /apps/evolution/mail/display/mime_types diff --git a/mail/mail-composer-prefs.c b/mail/mail-composer-prefs.c index c875b25a1a..30873a3357 100644 --- a/mail/mail-composer-prefs.c +++ b/mail/mail-composer-prefs.c @@ -107,7 +107,6 @@ mail_composer_prefs_finalise (GObject *obj) MailComposerPrefs *prefs = (MailComposerPrefs *) obj; g_object_unref (prefs->gui); - g_object_unref (prefs->pman); g_object_unref (prefs->enabled_pixbuf); gdk_pixmap_unref (prefs->mark_pixmap); g_object_unref (prefs->mark_bitmap); @@ -796,12 +795,6 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs) gboolean bool; int style; char *buf; - char *names[][2] = { - { "live_spell_check", "chkEnableSpellChecking" }, - { "magic_smileys_check", "chkAutoSmileys" }, - { "gtk_html_prop_keymap_option", "omenuShortcutsType" }, - { NULL, NULL } - }; prefs->gconf = gconf_client_get_default (); @@ -826,10 +819,6 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs) gtk_toggle_button_set_active (prefs->send_html, bool); g_signal_connect (prefs->send_html, "toggled", G_CALLBACK (toggle_button_toggled), prefs); - prefs->auto_smileys = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkAutoSmileys")); - /* FIXME: set active? */ - g_signal_connect (prefs->auto_smileys, "toggled", G_CALLBACK (toggle_button_toggled), prefs); - prefs->prompt_empty_subject = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptEmptySubject")); bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/empty_subject", NULL); gtk_toggle_button_set_active (prefs->prompt_empty_subject, bool); @@ -840,6 +829,16 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs) gtk_toggle_button_set_active (prefs->prompt_bcc_only, bool); g_signal_connect (prefs->prompt_bcc_only, "toggled", G_CALLBACK (toggle_button_toggled), prefs); + prefs->auto_smileys = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkAutoSmileys")); + bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/composer/magic_smileys", NULL); + gtk_toggle_button_set_active (prefs->auto_smileys, bool); + g_signal_connect (prefs->auto_smileys, "toggled", G_CALLBACK (toggle_button_toggled), prefs); + + prefs->spell_check = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkEnableSpellChecking")); + bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/composer/inline_spelling", NULL); + gtk_toggle_button_set_active (prefs->spell_check, bool); + g_signal_connect (prefs->spell_check, "toggled", G_CALLBACK (toggle_button_toggled), prefs); + prefs->charset = GTK_OPTION_MENU (glade_xml_get_widget (gui, "omenuCharset")); buf = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/composer/charset", NULL); menu = e_charset_picker_new (buf ? buf : e_iconv_locale_charset ()); @@ -847,17 +846,6 @@ mail_composer_prefs_construct (MailComposerPrefs *prefs) option_menu_connect (prefs->charset, prefs); g_free (buf); -#warning "gtkhtml prop manager" -#if 0 - /* Spell Checking: GtkHTML part */ - prefs->pman = GTK_HTML_PROPMANAGER (gtk_html_propmanager_new (NULL)); - g_signal_connect (prefs->pman, "changed", G_CALLBACK(toggle_button_toggled), prefs); - g_object_ref (prefs->pman); - - gtk_html_propmanager_set_names (prefs->pman, names); - gtk_html_propmanager_set_gui (prefs->pman, gui, NULL); -#endif - /* Spell Checking: GNOME Spell part */ prefs->colour = GNOME_COLOR_PICKER (glade_xml_get_widget (gui, "colorpickerSpellCheckColor")); prefs->language = GTK_TREE_VIEW (glade_xml_get_widget (gui, "clistSpellCheckLanguage")); @@ -985,6 +973,12 @@ mail_composer_prefs_apply (MailComposerPrefs *prefs) gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/only_bcc", gtk_toggle_button_get_active (prefs->prompt_bcc_only), NULL); + gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/composer/inline_spelling", + gtk_toggle_button_get_active (prefs->spell_check), NULL); + + gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/composer/magic_smileys", + gtk_toggle_button_get_active (prefs->auto_smileys), NULL); + menu = gtk_option_menu_get_menu (prefs->charset); if (!(string = e_charset_picker_get_charset (menu))) string = g_strdup (e_iconv_locale_charset ()); @@ -993,10 +987,6 @@ mail_composer_prefs_apply (MailComposerPrefs *prefs) g_free (string); /* Spell Checking */ -#warning "gtkhtml propmanager" -#if 0 - gtk_html_propmanager_apply (prefs->pman); -#endif spell_apply (prefs); /* Forwards and Replies */ diff --git a/mail/mail-composer-prefs.h b/mail/mail-composer-prefs.h index 666c1bb646..6c181c3d8a 100644 --- a/mail/mail-composer-prefs.h +++ b/mail/mail-composer-prefs.h @@ -32,9 +32,6 @@ extern "C" { #include #include #include -#warning "re-add gtkhtml prop manager" -/* this isn't ported in gtkhtml yet */ -/*#include */ #include #include @@ -74,8 +71,6 @@ struct _MailComposerPrefs { GtkToggleButton *prompt_bcc_only; GtkOptionMenu *charset; - /* Spell Checking */ - struct _GtkHTMLPropmanager *pman; GtkToggleButton *spell_check; GnomeColorPicker *colour; GtkTreeView *language; diff --git a/mail/mail-config.glade b/mail/mail-config.glade index 06499178f8..384c817a11 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -4301,84 +4301,6 @@ For example: "Work" or "Personal" False 3 - - - True - False - 6 - - - - True - Shortcuts _type: - True - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - omenuShortcutsType - - - 0 - False - False - - - - - - True - True - 0 - - - - True - - - - True - Emacs - True - - - - - - True - XEmacs - True - - - - - - True - Microsoft - True - - - - - - - 0 - False - False - - - - - 0 - False - False - - - True diff --git a/mail/mail-display.c b/mail/mail-display.c index c85d2c952c..fe35dec71c 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -100,6 +100,8 @@ struct _MailDisplayPrivate { struct _mail_msg *fetch_msg ; GIOChannel *fetch_cancel_channel; guint fetch_cancel_watch; + + guint display_notify_id; }; /* max number of connections to download images */ @@ -1812,7 +1814,7 @@ mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll) const char *flag, *completed; GtkHTMLStream *html_stream; MailDisplayStream *stream; - + g_return_if_fail (IS_MAIL_DISPLAY (md)); g_return_if_fail (GTK_IS_HTML (html)); @@ -1826,7 +1828,7 @@ mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll) /* This is a hack until there's a clean way to do this. */ GTK_HTML (md->html)->engine->newPage = FALSE; } - + gtk_html_stream_write (html_stream, HTML_HEADER, sizeof (HTML_HEADER) - 1); if (md->current_message && md->display_style == MAIL_CONFIG_DISPLAY_SOURCE) @@ -2112,6 +2114,13 @@ mail_display_destroy (GtkObject *object) mail_display->invisible = NULL; } + if (mail_display->priv && mail_display->priv->display_notify_id) { + GConfClient *gconf = gconf_client_get_default (); + gconf_client_notify_remove (gconf, mail_display->priv->display_notify_id); + mail_display->priv->display_notify_id = 0; + g_object_unref (gconf); + } + g_free (mail_display->priv); mail_display->priv = NULL; @@ -2639,6 +2648,17 @@ html_on_url (GtkHTML *html, const char *url, MailDisplay *mail_display) } } +/* If if a gconf setting for the mail display has changed redisplay to pick up the changes */ +static void +display_notify (GConfClient *gconf, guint cnxn_id, GConfEntry *entry, gpointer data) +{ + MailDisplay *md = data; + + /* this should really check which setting has changed but it is late */ + gtk_html_set_animate (md->html, gconf_client_get_bool (gconf, "/apps/evolution/mail/display/animate_images", NULL)); + mail_display_queue_redisplay ((MailDisplay *)data); +} + GtkWidget * mail_display_new (void) { @@ -2646,7 +2666,8 @@ mail_display_new (void) GtkWidget *scroll, *html; GdkAtom clipboard_atom; HTMLTokenizer *tok; - + GConfClient *gconf; + gtk_box_set_homogeneous (GTK_BOX (mail_display), FALSE); gtk_widget_show (GTK_WIDGET (mail_display)); @@ -2679,6 +2700,14 @@ mail_display_new (void) gtk_selection_add_target (mail_display->invisible, clipboard_atom, GDK_SELECTION_TYPE_STRING, 1); + gconf = gconf_client_get_default (); + gtk_html_set_animate (GTK_HTML (html), gconf_client_get_bool (gconf, "/apps/evolution/mail/display/animate_images", NULL)); + + gconf_client_add_dir (gconf, "/apps/evolution/mail/display",GCONF_CLIENT_PRELOAD_NONE, NULL); + mail_display->priv->display_notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/display", + display_notify, mail_display, NULL, NULL); + g_object_unref (gconf); + mail_display->scroll = GTK_SCROLLED_WINDOW (scroll); mail_display->html = GTK_HTML (html); g_object_ref (mail_display->html); diff --git a/mail/mail-preferences.c b/mail/mail-preferences.c index dad50e251a..f2b6685a7f 100644 --- a/mail/mail-preferences.c +++ b/mail/mail-preferences.c @@ -90,7 +90,6 @@ mail_preferences_finalise (GObject *obj) MailPreferences *prefs = (MailPreferences *) obj; g_object_unref (prefs->gui); - g_object_unref (prefs->pman); g_object_unref (prefs->gconf); ((GObjectClass *)(parent_class))->finalize (obj); @@ -311,6 +310,7 @@ mail_preferences_construct (MailPreferences *prefs) /* HTML Mail tab */ /* Loading Images */ + val = gconf_client_get_int (prefs->gconf, "/apps/evolution/mail/display/load_http_images", NULL); prefs->images_never = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "radImagesNever")); gtk_toggle_button_set_active (prefs->images_never, val == MAIL_CONFIG_HTTP_NEVER); @@ -324,6 +324,11 @@ mail_preferences_construct (MailPreferences *prefs) gtk_toggle_button_set_active (prefs->images_always, val == MAIL_CONFIG_HTTP_ALWAYS); g_signal_connect (prefs->images_always, "toggled", G_CALLBACK (settings_changed), prefs); + prefs->show_animated = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkShowAnimatedImages")); + bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/display/animate_images", NULL); + gtk_toggle_button_set_active (prefs->show_animated, bool); + g_signal_connect (prefs->show_animated, "toggled", G_CALLBACK (settings_changed), prefs); + prefs->prompt_unwanted_html = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "chkPromptWantHTML")); bool = gconf_client_get_bool (prefs->gconf, "/apps/evolution/mail/prompts/unwanted_html", NULL); gtk_toggle_button_set_active (prefs->prompt_unwanted_html, bool); @@ -436,20 +441,19 @@ mail_preferences_apply (MailPreferences *prefs) gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/display/load_http_images", val, NULL); -#warning "gtkhtml propmanager" -#if 0 - gtk_html_propmanager_apply (prefs->pman); -#endif gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/display/fonts/variable", gnome_font_picker_get_font_name (prefs->font_variable), NULL); gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/display/fonts/monospace", gnome_font_picker_get_font_name (prefs->font_fixed), NULL); gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/display/fonts/use_custom", !gtk_toggle_button_get_active (prefs->font_share), NULL); + gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/display/animate_images", + gtk_toggle_button_get_active (prefs->show_animated), NULL); gconf_client_set_bool (prefs->gconf, "/apps/evolution/mail/prompts/unwanted_html", gtk_toggle_button_get_active (prefs->prompt_unwanted_html), NULL); + /* Labels and Colours */ list = NULL; for (i = 4; i >= 0; i--) { diff --git a/mail/mail-preferences.h b/mail/mail-preferences.h index 210f1e3e15..bca18a316b 100644 --- a/mail/mail-preferences.h +++ b/mail/mail-preferences.h @@ -36,9 +36,6 @@ extern "C" { #include #include -#warning "gtkhtml-propmanger" -/*#include */ - #include "evolution-config-control.h" #include @@ -95,9 +92,6 @@ struct _MailPreferences { GtkToggleButton *autodetect_links; GtkToggleButton *prompt_unwanted_html; - /* GtkHTML Properties */ - struct _GtkHTMLPropmanager *pman; - /* Labels and Colours tab */ struct { GtkEntry *name; -- cgit