add a gconf key corresponding to newly introduced caret mode of gtkhtml

2003-07-10  Yuedong Du  <yuedong.du@sun.com>

        * evolution-mail.schemas: add a gconf key corresponding to newly
        introduced caret mode of gtkhtml widget.

        * folder-browser-ui.c: new verb handling, corresponding the new menu
        entry for the caret mode flag.

        * folder-browser.h: declaration of new verb handler to the menu entry
        that turn caret mode on/off. The function just set the new introduced
        gconf key.

        * folder-browser.c: ditto

        * mail-config.c: lstione to the new gconf key, and when caret mode
        flag is set/unset,change the style of gtkhtml widget. see bug
        #44607.

svn path=/trunk/; revision=21776
This commit is contained in:
Yuedong Du
2003-07-09 18:04:54 +00:00
committed by Yuedong Du
parent fb32aa52b6
commit 16ce509ec0
6 changed files with 83 additions and 0 deletions

View File

@ -1,3 +1,21 @@
2003-07-10 Yuedong Du <yuedong.du@sun.com>
* evolution-mail.schemas: add a gconf key corresponding to newly
introduced caret mode of gtkhtml widget.
* folder-browser-ui.c: new verb handling, corresponding the new menu
entry for the caret mode flag.
* folder-browser.h: declaration of new verb handler to the menu entry
that turn caret mode on/off. The function just set the new introduced
gconf key.
* folder-browser.c: ditto
* mail-config.c: lstione to the new gconf key, and when caret mode
flag is set/unset,change the style of gtkhtml widget. see bug
#44607.
2003-07-09 Jeffrey Stedfast <fejj@ximian.com>
* mail-crypto.h: Removed camel-pgp-mime.h, it no longer exists.

View File

@ -173,6 +173,34 @@
</locale>
</schema>
<schema>
<key>/schemas/apps/evolution/mail/display/caret_mode</key>
<applyto>/apps/evolution/mail/display/caret_mode</applyto>
<owner>evolution-mail</owner>
<type>boolean</type>
<default>false</default>
<locale name="C">
<short>Enable/disable caret mode</short>
<long>
Enable caret mode, so that you can see a cursor when reading mail.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/evolution/mail/display/caret_mode</key>
<applyto>/apps/evolution/mail/display/caret_mode</applyto>
<owner>evolution-mail</owner>
<type>boolean</type>
<default>false</default>
<locale name="C">
<short>Enable/disable caret mode</short>
<long>
Enable caret mode, so that you can see a cursor when reading mail.
</long>
</locale>
</schema>
<schema>
<key>/schemas/apps/evolution/mail/display/load_http_images</key>
<applyto>/apps/evolution/mail/display/load_http_images</applyto>

View File

@ -104,6 +104,7 @@ static BonoboUIVerb message_verbs [] = {
BONOBO_UI_UNSAFE_VERB ("ToolsVFolderSubject", vfolder_subject),
BONOBO_UI_UNSAFE_VERB ("ViewLoadImages", load_images),
/* ViewHeaders stuff is a radio */
/* CaretMode is a toggle */
BONOBO_UI_VERB_END
};
@ -238,6 +239,7 @@ struct _UINode default_ui_nodes[] = {
{ "ViewFullHeaders", IS_0MESSAGE },
{ "ViewNormal", IS_0MESSAGE },
{ "ViewSource", IS_0MESSAGE },
{ "CaretMode", IS_0MESSAGE },
{ "AddSenderToAddressbook", IS_INCOMING_FOLDER | SELECTION_SINGLE | ANY_THREADED | HAS_FLAGS },
@ -517,6 +519,7 @@ folder_browser_ui_add_message (FolderBrowser *fb)
FolderBrowserSelectionState prev_state;
GConfClient *gconf;
int style;
gboolean caret_mode;
gconf = mail_config_get_gconf_client ();
@ -527,6 +530,10 @@ folder_browser_ui_add_message (FolderBrowser *fb)
ui_add (fb, "message", message_verbs, message_pixcache);
caret_mode = gconf_client_get_bool (gconf, "/apps/evolution/mail/display/caret_mode", NULL);
bonobo_ui_component_set_prop(uic, "/commands/CaretMode", "state", caret_mode?"1":"0", NULL);
bonobo_ui_component_add_listener (uic, "CaretMode", folder_browser_toggle_caret_mode, fb);
/* Display Style */
style = gconf_client_get_int (gconf, "/apps/evolution/mail/display/message_style", NULL);
style = style >= 0 && style < MAIL_CONFIG_DISPLAY_MAX ? style : 0;

View File

@ -1378,6 +1378,24 @@ folder_browser_toggle_hide_deleted (BonoboUIComponent *component,
message_list_set_hidedeleted (fb->message_list, atoi (state));
}
void
folder_browser_toggle_caret_mode(BonoboUIComponent *component,
const char * path,
Bonobo_UIComponent_EventType type,
const char * state,
gpointer user_data)
{
FolderBrowser *fb = user_data;
GConfClient *gconf;
if (type != Bonobo_UIComponent_STATE_CHANGED)
return;
gconf = mail_config_get_gconf_client ();
gconf_client_set_bool (gconf, "/apps/evolution/mail/display/caret_mode",
atoi(state), NULL);
}
void
folder_browser_set_message_display_style (BonoboUIComponent *component,
const char *path,

View File

@ -169,6 +169,12 @@ void folder_browser_toggle_hide_deleted (BonoboUIComponent *component,
const char *state,
gpointer user_data);
void folder_browser_toggle_caret_mode (BonoboUIComponent *component,
const char *path,
Bonobo_UIComponent_EventType type,
const char *state,
gpointer user_data);
void folder_browser_set_message_display_style (BonoboUIComponent *component,
const char *path,
Bonobo_UIComponent_EventType type,

View File

@ -85,6 +85,7 @@ typedef struct {
guint font_notify_id;
guint spell_notify_id;
guint caret_mode_notify_id;
GPtrArray *mime_types;
guint mime_types_notify_id;
@ -441,6 +442,7 @@ config_write_style (void)
char *fix_font;
char *var_font;
gint red = 0xffff, green = 0, blue = 0;
gboolean caret_mode;
/*
* This is the wrong way to get the path but it needs to
@ -463,12 +465,14 @@ config_write_style (void)
custom = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/fonts/use_custom", 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);
caret_mode = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/caret_mode", NULL);
CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_red", red, (void)0, (int));
CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_green", green, (void)0, (int));
CONFIG_GET_SPELL_VALUE (int, "/spell_error_color_blue", blue, (void)0, (int));
fprintf (rc, "style \"evolution-mail-custom-fonts\" {\n");
fprintf (rc, " GtkHTML::caret_mode = %d\n", caret_mode ? 1 :0);
fprintf (rc, " GtkHTML::spell_error_color = \"#%02x%02x%02x\"\n",
0xff & (red >> 8), 0xff & (green >> 8), 0xff & (blue >> 8));
@ -542,6 +546,8 @@ mail_config_init (void)
gconf_style_changed, NULL, NULL, NULL);
config->spell_notify_id = gconf_client_notify_add (config->gconf, "/GNOME/Spell",
gconf_style_changed, NULL, NULL, NULL);
config->caret_mode_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/caret_mode",
gconf_style_changed, NULL, NULL, NULL);
gconf_client_add_dir (config->gconf, "/apps/evolution/mail/labels",
GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);