reverted spell error color fix
svn path=/trunk/; revision=21542
This commit is contained in:
@ -25,15 +25,6 @@
|
|||||||
|
|
||||||
* mail-callbacks.c (do_mail_print): set printing widget name
|
* mail-callbacks.c (do_mail_print): set printing widget name
|
||||||
|
|
||||||
2003-06-24 Radek Doulik <rodo@ximian.com>
|
|
||||||
|
|
||||||
* mail-composer-prefs.c: use spell preferences at new location
|
|
||||||
|
|
||||||
* mail-config.c: copy old spell settings from /GNOME/Spell
|
|
||||||
|
|
||||||
* evolution-mail.schemas: added spell color default + migration
|
|
||||||
flag
|
|
||||||
|
|
||||||
2003-06-23 Dan Winship <danw@ximian.com>
|
2003-06-23 Dan Winship <danw@ximian.com>
|
||||||
|
|
||||||
* message-list.c (on_selection_changed_cmd): Save the idle_id
|
* message-list.c (on_selection_changed_cmd): Save the idle_id
|
||||||
|
@ -143,34 +143,6 @@
|
|||||||
</locale>
|
</locale>
|
||||||
</schema>
|
</schema>
|
||||||
|
|
||||||
<schema>
|
|
||||||
<key>/schemas/apps/evolution/mail/composer/spell_copied_from_old_location</key>
|
|
||||||
<applyto>/apps/evolution/mail/composer/spell_copied_from_old_location</applyto>
|
|
||||||
<owner>evolution-mail</owner>
|
|
||||||
<type>bool</type>
|
|
||||||
<default>false</default>
|
|
||||||
<locale name="C">
|
|
||||||
<short>spell preferences are copied from an old location</short>
|
|
||||||
<long>
|
|
||||||
spell preferences are copied from an old location (/GNOME/Spell)
|
|
||||||
</long>
|
|
||||||
</locale>
|
|
||||||
</schema>
|
|
||||||
|
|
||||||
<schema>
|
|
||||||
<key>/schemas/apps/evolution/mail/composer/spell_error_color</key>
|
|
||||||
<applyto>/apps/evolution/mail/composer/spell_error_color</applyto>
|
|
||||||
<owner>evolution-mail</owner>
|
|
||||||
<type>string</type>
|
|
||||||
<default>#ff0000</default>
|
|
||||||
<locale name="C">
|
|
||||||
<short>spell error color</short>
|
|
||||||
<long>
|
|
||||||
color for marking misspelled words.
|
|
||||||
</long>
|
|
||||||
</locale>
|
|
||||||
</schema>
|
|
||||||
|
|
||||||
<!-- Display Settings -->
|
<!-- Display Settings -->
|
||||||
|
|
||||||
<schema>
|
<schema>
|
||||||
|
@ -565,6 +565,11 @@ spell_get_ui (MailComposerPrefs *prefs)
|
|||||||
prefs->language_str = spell_get_language_str (prefs);
|
prefs->language_str = spell_get_language_str (prefs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define GET(t,x,prop,f,c) \
|
||||||
|
val = gconf_client_get_without_default (prefs->gconf, GNOME_SPELL_GCONF_DIR x, NULL); \
|
||||||
|
if (val) { f; prop = c (gconf_value_get_ ## t (val)); \
|
||||||
|
gconf_value_free (val); }
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spell_save_orig (MailComposerPrefs *prefs)
|
spell_save_orig (MailComposerPrefs *prefs)
|
||||||
{
|
{
|
||||||
@ -585,7 +590,6 @@ static void
|
|||||||
spell_load_values (MailComposerPrefs *prefs)
|
spell_load_values (MailComposerPrefs *prefs)
|
||||||
{
|
{
|
||||||
GConfValue *val;
|
GConfValue *val;
|
||||||
gchar *str_color;
|
|
||||||
char *def_lang;
|
char *def_lang;
|
||||||
|
|
||||||
def_lang = g_strdup (e_iconv_locale_language ());
|
def_lang = g_strdup (e_iconv_locale_language ());
|
||||||
@ -594,15 +598,13 @@ spell_load_values (MailComposerPrefs *prefs)
|
|||||||
prefs->spell_error_color.red = 0xffff;
|
prefs->spell_error_color.red = 0xffff;
|
||||||
prefs->spell_error_color.green = 0;
|
prefs->spell_error_color.green = 0;
|
||||||
prefs->spell_error_color.blue = 0;
|
prefs->spell_error_color.blue = 0;
|
||||||
|
|
||||||
str_color = gconf_client_get_string (prefs->gconf, "/apps/evolution/mail/composer/spell_error_color", NULL);
|
GET (int, "/spell_error_color_red", prefs->spell_error_color.red, (void)0, (int));
|
||||||
gdk_color_parse (str_color, &prefs->spell_error_color);
|
GET (int, "/spell_error_color_green", prefs->spell_error_color.green, (void)0, (int));
|
||||||
|
GET (int, "/spell_error_color_blue", prefs->spell_error_color.blue, (void)0, (int));
|
||||||
val = gconf_client_get_without_default (prefs->gconf, "/apps/evolution/mail/composer/spell_language", NULL);
|
GET (string, "/language", prefs->language_str, g_free (prefs->language_str), g_strdup);
|
||||||
if (val) {
|
|
||||||
prefs->language_str = g_strdup (gconf_value_get_string (val));
|
if (prefs->language_str == NULL)
|
||||||
gconf_value_free (val);
|
|
||||||
} else
|
|
||||||
prefs->language_str = g_strdup (def_lang);
|
prefs->language_str = g_strdup (def_lang);
|
||||||
|
|
||||||
spell_save_orig (prefs);
|
spell_save_orig (prefs);
|
||||||
@ -610,22 +612,23 @@ spell_load_values (MailComposerPrefs *prefs)
|
|||||||
g_free (def_lang);
|
g_free (def_lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define SET(t,x,prop) \
|
||||||
|
gconf_client_set_ ## t (prefs->gconf, GNOME_SPELL_GCONF_DIR x, prop, NULL);
|
||||||
|
|
||||||
#define STR_EQUAL(str1, str2) ((str1 == NULL && str2 == NULL) || (str1 && str2 && !strcmp (str1, str2)))
|
#define STR_EQUAL(str1, str2) ((str1 == NULL && str2 == NULL) || (str1 && str2 && !strcmp (str1, str2)))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
spell_save_values (MailComposerPrefs *prefs, gboolean force)
|
spell_save_values (MailComposerPrefs *prefs, gboolean force)
|
||||||
{
|
{
|
||||||
if (force || !gdk_color_equal (&prefs->spell_error_color, &prefs->spell_error_color_orig)) {
|
if (force || !gdk_color_equal (&prefs->spell_error_color, &prefs->spell_error_color_orig)) {
|
||||||
gchar *str_color = g_strdup_printf ("#%02x%02x%02x",
|
SET (int, "/spell_error_color_red", prefs->spell_error_color.red);
|
||||||
prefs->spell_error_color.red >> 8,
|
SET (int, "/spell_error_color_green", prefs->spell_error_color.green);
|
||||||
prefs->spell_error_color.green >> 8,
|
SET (int, "/spell_error_color_blue", prefs->spell_error_color.blue);
|
||||||
prefs->spell_error_color.blue >> 8);
|
|
||||||
gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/composer/spell_error_color", str_color, NULL);
|
|
||||||
g_free (str_color);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force || !STR_EQUAL (prefs->language_str, prefs->language_str_orig))
|
if (force || !STR_EQUAL (prefs->language_str, prefs->language_str_orig)) {
|
||||||
gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/composer/spell_language", prefs->language_str ? prefs->language_str : "", NULL);
|
SET (string, "/language", prefs->language_str ? prefs->language_str : "");
|
||||||
|
}
|
||||||
|
|
||||||
gconf_client_suggest_sync (prefs->gconf, NULL);
|
gconf_client_suggest_sync (prefs->gconf, NULL);
|
||||||
}
|
}
|
||||||
|
@ -426,63 +426,16 @@ config_cache_mime_types (void)
|
|||||||
g_ptr_array_add (config->mime_types, NULL);
|
g_ptr_array_add (config->mime_types, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
config_spell_ensure_copy ()
|
|
||||||
{
|
|
||||||
gboolean copied = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/composer/spell_copied_from_old_location", NULL);
|
|
||||||
|
|
||||||
if (!copied) {
|
|
||||||
GConfValue *val;
|
|
||||||
GdkColor color;
|
|
||||||
gchar *language;
|
|
||||||
#define GET(t,x,prop,c) \
|
|
||||||
val = gconf_client_get_without_default (config->gconf, "/GNOME/Spell/" x, NULL); \
|
|
||||||
if (val) { prop = c (gconf_value_get_ ## t (val)); \
|
|
||||||
gconf_value_free (val); }
|
|
||||||
|
|
||||||
GET (int, "spell_error_color_red", color.red, (int));
|
|
||||||
if (val) {
|
|
||||||
gchar *str_color;
|
|
||||||
|
|
||||||
GET (int, "spell_error_color_green", color.green, (int));
|
|
||||||
GET (int, "spell_error_color_blue", color.blue, (int));
|
|
||||||
str_color = g_strdup_printf ("#%02x%02x%02x", 0xff & (color.red >> 8), 0xff & (color.green >> 8), 0xff & (color.blue >> 8));
|
|
||||||
gconf_client_set_string (config->gconf, "/apps/evolution/mail/composer/spell_error_color", str_color, NULL);
|
|
||||||
g_free (str_color);
|
|
||||||
}
|
|
||||||
|
|
||||||
GET (string, "language", language, g_strdup);
|
|
||||||
if (val) {
|
|
||||||
gconf_client_set_string (config->gconf, "/apps/evolution/mail/composer/spell_language", language, NULL);
|
|
||||||
g_free (language);
|
|
||||||
}
|
|
||||||
|
|
||||||
gconf_client_set_bool (config->gconf, "/apps/evolution/mail/composer/spell_copied_from_old_location", TRUE, NULL);
|
|
||||||
gconf_client_suggest_sync (config->gconf, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
config_spell_get_error_color (GdkColor *color)
|
|
||||||
{
|
|
||||||
gchar *str_color;
|
|
||||||
|
|
||||||
config_spell_ensure_copy ();
|
|
||||||
|
|
||||||
str_color = gconf_client_get_string (config->gconf, "/apps/evolution/mail/composer/spell_error_color", NULL);
|
|
||||||
gdk_color_parse (str_color, color);
|
|
||||||
g_free (str_color);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
config_write_style (void)
|
config_write_style (void)
|
||||||
{
|
{
|
||||||
GdkColor spell_error_color;
|
|
||||||
char *filename;
|
char *filename;
|
||||||
FILE *rc;
|
FILE *rc;
|
||||||
gboolean custom;
|
gboolean custom;
|
||||||
char *fix_font;
|
char *fix_font;
|
||||||
char *var_font;
|
char *var_font;
|
||||||
|
gint red, green, blue;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the wrong way to get the path but it needs to
|
* This is the wrong way to get the path but it needs to
|
||||||
@ -506,11 +459,13 @@ config_write_style (void)
|
|||||||
var_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/variable", NULL);
|
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);
|
fix_font = gconf_client_get_string (config->gconf, "/apps/evolution/mail/display/fonts/monospace", NULL);
|
||||||
|
|
||||||
config_spell_get_error_color (&spell_error_color);
|
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, "style \"evolution-mail-custom-fonts\" {\n");
|
||||||
fprintf (rc, " GtkHTML::spell_error_color = \"#%02x%02x%02x\"\n",
|
fprintf (rc, " GtkHTML::spell_error_color = \"#%02x%02x%02x\"\n",
|
||||||
0xff & (spell_error_color.red >> 8), 0xff & (spell_error_color.green >> 8), 0xff & (spell_error_color.blue >> 8));
|
0xff & (red >> 8), 0xff & (green >> 8), 0xff & (blue >> 8));
|
||||||
|
|
||||||
if (custom && var_font && fix_font) {
|
if (custom && var_font && fix_font) {
|
||||||
fprintf (rc,
|
fprintf (rc,
|
||||||
@ -574,14 +529,13 @@ mail_config_init (void)
|
|||||||
gtk_rc_parse (filename);
|
gtk_rc_parse (filename);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
|
|
||||||
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/display/fonts",
|
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/display/fonts",
|
||||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||||
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/composer/",
|
gconf_client_add_dir (config->gconf, "/GNOME/Spell",
|
||||||
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
|
||||||
config_spell_ensure_copy ();
|
|
||||||
config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/fonts",
|
config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/fonts",
|
||||||
gconf_style_changed, NULL, NULL, NULL);
|
gconf_style_changed, NULL, NULL, NULL);
|
||||||
config->spell_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/composer/",
|
config->spell_notify_id = gconf_client_notify_add (config->gconf, "/GNOME/Spell",
|
||||||
gconf_style_changed, NULL, NULL, NULL);
|
gconf_style_changed, NULL, NULL, NULL);
|
||||||
|
|
||||||
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/labels",
|
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/labels",
|
||||||
|
Reference in New Issue
Block a user