handle requests for the font manager control.
2002-04-29 Larry Ewing <lewing@ximian.com> * 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. svn path=/trunk/; revision=16627
This commit is contained in:
@ -1,5 +1,32 @@
|
||||
2002-04-29 Larry Ewing <lewing@ximian.com>
|
||||
|
||||
* 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.
|
||||
|
||||
|
||||
@ -251,6 +251,31 @@
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<!-- Font Preferences -->
|
||||
<oaf_server iid="OAFIID:GNOME_Evolution_Mail_FontPrefs_ConfigControl"
|
||||
type="factory"
|
||||
location="OAFIID:GNOME_Evolution_Mail_ConfigControlFactory">
|
||||
|
||||
<oaf_attribute name="repo_ids" type="stringv">
|
||||
<item value="IDL:GNOME/Evolution/ConfigControl:1.0"/>
|
||||
</oaf_attribute>
|
||||
|
||||
<oaf_attribute name="evolution:config_item:title" type="string"
|
||||
_value="Font Preferences"/>
|
||||
|
||||
<oaf_attribute name="evolution:config_item:description" type="string"
|
||||
_value="This Page can be used to configure the Fonts"/>
|
||||
|
||||
<oaf_attribute name="evolution:config_item:icon_name" type="string"
|
||||
value="font.png"/>
|
||||
|
||||
<oaf_attribute name="evolution:config_item:priority" type="string" value="-6"/>
|
||||
|
||||
<oaf_attribute name="description" type="string"
|
||||
_value="Configuration control for the Evolution Display Fonts."/>
|
||||
|
||||
</oaf_server>
|
||||
|
||||
<!-- Composer Preferences -->
|
||||
<oaf_server iid="OAFIID:GNOME_Evolution_Mail_ComposerPrefs_ConfigControl"
|
||||
type="factory"
|
||||
|
||||
@ -69,6 +69,8 @@ evolution_mail_SOURCES = \
|
||||
mail-callbacks.h \
|
||||
mail-composer-prefs.c \
|
||||
mail-composer-prefs.h \
|
||||
mail-font-prefs.c \
|
||||
mail-font-prefs.h \
|
||||
mail-config.c \
|
||||
mail-config.h \
|
||||
mail-config-druid.c \
|
||||
|
||||
@ -94,7 +94,8 @@ mail_composer_prefs_finalise (GtkObject *obj)
|
||||
MailComposerPrefs *prefs = (MailComposerPrefs *) obj;
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (prefs->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);
|
||||
|
||||
@ -35,6 +35,7 @@ extern "C" {
|
||||
#include <libgnomeui/gnome-dialog.h>
|
||||
#include <libgnomeui/gnome-file-entry.h>
|
||||
#include <gtkhtml/gtkhtml.h>
|
||||
#include <gtkhtml/gtkhtml-propmanager.h>
|
||||
|
||||
#include "mail-signature-editor.h"
|
||||
|
||||
@ -67,6 +68,7 @@ struct _MailComposerPrefs {
|
||||
GtkOptionMenu *charset;
|
||||
|
||||
/* Spell Checking */
|
||||
GtkHTMLPropmanager *pman;
|
||||
GtkToggleButton *spell_check;
|
||||
GnomeColorPicker *colour;
|
||||
GtkCombo *language;
|
||||
|
||||
@ -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 ();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ extern "C" {
|
||||
#include <libgnomeui/gnome-dialog.h>
|
||||
#include <libgnomeui/gnome-file-entry.h>
|
||||
#include <glade/glade.h>
|
||||
|
||||
#include <gtkhtml/gtkhtml-propmanager.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
|
||||
#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;
|
||||
|
||||
Reference in New Issue
Block a user