diff options
author | Larry Ewing <lewing@ximian.com> | 2003-05-20 22:54:00 +0800 |
---|---|---|
committer | Larry Ewing <lewing@src.gnome.org> | 2003-05-20 22:54:00 +0800 |
commit | 42333eed038c2a464c243c0852501b4529f74ec4 (patch) | |
tree | 3b69e2f3b9c13b80fb4f341966b11d9858586506 | |
parent | b8bb619fc3d505a18e6e635cc7bdba3d955d73ab (diff) | |
download | gsoc2013-evolution-42333eed038c2a464c243c0852501b4529f74ec4.tar.gz gsoc2013-evolution-42333eed038c2a464c243c0852501b4529f74ec4.tar.zst gsoc2013-evolution-42333eed038c2a464c243c0852501b4529f74ec4.zip |
remove references to font prefs.
2003-05-20 Larry Ewing <lewing@ximian.com>
* mail-config-factory.c: remove references to font prefs.
* component-factory.c: Remove stale refernces the the font prefs.
(make_factory): remove unused variables.
* mail-config.c (mail_config_init): add a notify callback to the
spelling color.
(config_write_style): rename and write out the spell color as
well.
svn path=/trunk/; revision=21279
-rw-r--r-- | mail/ChangeLog | 12 | ||||
-rw-r--r-- | mail/component-factory.c | 8 | ||||
-rw-r--r-- | mail/mail-config-factory.c | 16 | ||||
-rw-r--r-- | mail/mail-config.c | 38 |
4 files changed, 39 insertions, 35 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index f6e67d6808..a9e6d938e0 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,15 @@ +2003-05-20 Larry Ewing <lewing@ximian.com> + + * mail-config-factory.c: remove references to font prefs. + + * component-factory.c: Remove stale refernces the the font prefs. + (make_factory): remove unused variables. + + * mail-config.c (mail_config_init): add a notify callback to the + spelling color. + (config_write_style): rename and write out the spell color as + well. + 2003-05-20 Not Zed <notzed@lostzed.mmc.com.au> ** See bug #43234 diff --git a/mail/component-factory.c b/mail/component-factory.c index 35ee185bb0..20f618e660 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -1597,14 +1597,9 @@ factory (BonoboGenericFactory *factory, return evolution_folder_info_new(); else if (strcmp(component_id, WIZARD_IID) == 0) return evolution_mail_config_wizard_new(); - -#warning "font prefs" -#define MAIL_FONT_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_FontPrefs_ConfigControl" - else if (strcmp (component_id, MAIL_ACCOUNTS_CONTROL_ID) == 0 || strcmp (component_id, MAIL_PREFERENCES_CONTROL_ID) == 0 - || strcmp (component_id, MAIL_COMPOSER_PREFS_CONTROL_ID) == 0 - /* || strcmp (component_id, MAIL_FONT_PREFS_CONTROL_ID) == 0 */) + || strcmp (component_id, MAIL_COMPOSER_PREFS_CONTROL_ID) == 0) return mail_config_control_factory_cb (factory, component_id, evolution_shell_client_corba_objref (global_shell_client)); else if (strcmp(component_id, COMPOSER_IID) == 0) return (BonoboObject *)evolution_composer_new(composer_send_cb, composer_save_draft_cb); @@ -1616,7 +1611,6 @@ factory (BonoboGenericFactory *factory, static Bonobo_Unknown make_factory (PortableServer_POA poa, const char *iid, gpointer impl_ptr, CORBA_Environment *ev) { - struct sigaction sa, osa; static int init = 0; if (!init) { diff --git a/mail/mail-config-factory.c b/mail/mail-config-factory.c index 2748a1473f..5a6db2cb47 100644 --- a/mail/mail-config-factory.c +++ b/mail/mail-config-factory.c @@ -30,9 +30,6 @@ #include "mail-accounts.h" #include "mail-preferences.h" #include "mail-composer-prefs.h" -#warning "mail-font-prefs" -/*#include "mail-font-prefs.h"*/ - #include "mail-config-factory.h" #define CONFIG_CONTROL_FACTORY_ID "OAFIID:GNOME_Evolution_Mail_ConfigControlFactory" @@ -82,15 +79,6 @@ mail_config_control_factory_cb (BonoboGenericFactory *factory, const char *compo } else if (!strcmp (component_id, MAIL_COMPOSER_PREFS_CONTROL_ID)) { prefs = mail_composer_prefs_new (); data->apply = (ApplyFunc) mail_composer_prefs_apply; -#warning "font prefs" -/* & see below */ -#define MAIL_FONT_PREFS_CONTROL_ID "OAFIID:GNOME_Evolution_Mail_FontPrefs_ConfigControl" - } else if (!strcmp (component_id, MAIL_FONT_PREFS_CONTROL_ID)) { -#if 0 - prefs = mail_font_prefs_new (); - data->apply = (ApplyFunc) mail_font_prefs_apply; -#endif - return NULL; } else { g_assert_not_reached (); } @@ -108,10 +96,6 @@ mail_config_control_factory_cb (BonoboGenericFactory *factory, const char *compo 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)) { -#if 0 - MAIL_FONT_PREFS (prefs)->control = control; -#endif } else { g_assert_not_reached (); } diff --git a/mail/mail-config.c b/mail/mail-config.c index 48ca76ccfc..8f4cd41fe9 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -87,7 +87,8 @@ typedef struct { guint label_notify_id; guint font_notify_id; - + guint spell_notify_id; + GPtrArray *mime_types; guint mime_types_notify_id; } MailConfig; @@ -429,20 +430,24 @@ config_cache_mime_types (void) } static void -config_write_fonts (void) +config_write_style (void) { char *filename; FILE *rc; gboolean custom; char *fix_font; char *var_font; + gint red, green, blue; - if (!evolution_dir) { - g_warning ("evolution_dir empty"); - return; - } + /* + * This is the wrong way to get the path but it needs to + * always be the same as the gtk_rc_parse call and evolution_dir + * may not have been set yet + * + * filename = g_build_filename (evolution_dir, MAIL_CONFIG_RC, NULL); + */ + filename = g_build_filename (g_get_home_dir (), "evolution", MAIL_CONFIG_RC, NULL); - filename = g_build_filename (evolution_dir, MAIL_CONFIG_RC, NULL); rc = fopen (filename, "w"); if (!rc) { @@ -456,8 +461,14 @@ config_write_fonts (void) var_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/variable", NULL); fix_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/monospace", NULL); + red = gconf_client_get_int (config->gconf, "/GNOME/Spell/spell_error_color_red", NULL); + green = gconf_client_get_int (config->gconf, "/GNOME/Spell/spell_error_color_green", NULL); + blue = gconf_client_get_int (config->gconf, "/GNOME/Spell/spell_error_color_blue", NULL); fprintf (rc, "style \"evolution-mail-custom-fonts\" {\n"); + fprintf (rc, " GtkHTML::spell_error_color = \"#%2x%2x%2x\"\n", + red >> 8, green >> 8, blue >> 8); + if (custom && var_font && fix_font) { fprintf (rc, " GtkHTML::fixed_font_name = \"%s\"\n" @@ -484,10 +495,10 @@ gconf_labels_changed (GConfClient *client, guint cnxn_id, } static void -gconf_fonts_changed (GConfClient *client, guint cnxn_id, +gconf_style_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) { - config_write_fonts (); + config_write_style (); } static void @@ -514,17 +525,20 @@ mail_config_init (void) mail_config_clear (); /* - config_write_fonts (); filename = g_build_filename (evolution_dir, MAIL_CONFIG_RC, NULL); */ - filename = g_build_filename (g_get_home_dir (), "/evolution", MAIL_CONFIG_RC, NULL); + filename = g_build_filename (g_get_home_dir (), "evolution", MAIL_CONFIG_RC, NULL); gtk_rc_parse (filename); g_free (filename); gconf_client_add_dir (config->gconf, "/apps/evolution/mail/display/fonts", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); + gconf_client_add_dir (config->gconf, "/GNOME/Spell", + GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/fonts", - gconf_fonts_changed, NULL, NULL, NULL); + gconf_style_changed, NULL, NULL, NULL); + config->spell_notify_id = gconf_client_notify_add (config->gconf, "/GNOME/Spell", + gconf_style_changed, NULL, NULL, NULL); gconf_client_add_dir (config->gconf, "/apps/evolution/mail/labels", GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); |