[evolution-patches] composer settings
- From: Larry Ewing <lewing ximian com>
- To: patches <evolution-patches ximian com>, Jeff Stedfast <fejj ximian com>, Not Zed <notzed ximian com>, Radek Doulik <rodo ximian com>
- Subject: [evolution-patches] composer settings
- Date: 20 May 2003 12:11:39 -0500
This patch depends on the properties patch to gtkhtml going in, it
simply mirrors the gconf keys into bonobo properties.
--Larry
? e-msg-composer.c.activate.c
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.536
diff -u -p -r1.536 ChangeLog
--- ChangeLog 16 May 2003 16:55:07 -0000 1.536
+++ ChangeLog 20 May 2003 17:09:19 -0000
@@ -1,3 +1,12 @@
+2003-05-20 Larry Ewing <lewing ximian com>
+
+ * e-msg-composer.c (composer_settings_update): set the various
+ bonobo properties that are composer preferences.
+ (create_composer): add notification of gconf changes.
+ (destroy): disconnect notification.
+
+ * e-msg-composer.h: keep the gcond notify handler id.
+
2003-05-15 Jeffrey Stedfast <fejj ximian com>
* e-msg-composer-attachment.c (e_msg_composer_attachment_edit):
Index: e-msg-composer.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
retrieving revision 1.391
diff -u -p -r1.391 e-msg-composer.c
--- e-msg-composer.c 29 Apr 2003 16:55:52 -0000 1.391
+++ e-msg-composer.c 20 May 2003 17:09:20 -0000
@@ -2441,7 +2441,6 @@ destroy (GtkObject *object)
/* FIXME? I assume the Bonobo widget will get destroyed
normally? */
-
if (composer->address_dialog != NULL) {
gtk_widget_destroy (composer->address_dialog);
composer->address_dialog = NULL;
@@ -2451,6 +2450,13 @@ destroy (GtkObject *object)
composer->hdrs = NULL;
}
+ if (composer->notify_id) {
+ GConfClient *gconf = gconf_client_get_default ();
+ gconf_client_notify_remove (gconf, composer->notify_id);
+ composer->notify_id = 0;
+ g_object_unref (gconf);
+ }
+
if (composer->persist_stream_interface != CORBA_OBJECT_NIL) {
Bonobo_Unknown_unref (composer->persist_stream_interface, &ev);
CORBA_Object_release (composer->persist_stream_interface, &ev);
@@ -2859,6 +2865,28 @@ setup_cut_copy_paste (EMsgComposer *comp
g_signal_connect (entry, "focus-out-event", G_CALLBACK (composer_entry_focus_out_event_cb), composer);
}
+static void
+composer_settings_update (GConfClient *gconf, guint cnxn_id, GConfEntry *entry, gpointer data)
+{
+ gboolean bool;
+ EMsgComposer *composer = data;
+
+ bool = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/magic_smileys", NULL);
+ bonobo_widget_set_property (BONOBO_WIDGET (composer->editor),
+ "MagicSmileys", TC_CORBA_boolean, bool,
+ NULL);
+
+ bool = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/magic_links", NULL);
+ bonobo_widget_set_property (BONOBO_WIDGET (composer->editor),
+ "MagicLinks", TC_CORBA_boolean, bool,
+ NULL);
+
+ bool = gconf_client_get_bool (gconf, "/apps/evolution/mail/composer/inline_spelling", NULL);
+ bonobo_widget_set_property (BONOBO_WIDGET (composer->editor),
+ "InlineSpelling", TC_CORBA_boolean, bool,
+ NULL);
+}
+
static EMsgComposer *
create_composer (int visible_mask)
{
@@ -2866,6 +2894,7 @@ create_composer (int visible_mask)
GtkWidget *vbox;
Bonobo_Unknown editor_server;
CORBA_Environment ev;
+ GConfClient *gconf;
int vis;
composer = g_object_new (E_TYPE_MSG_COMPOSER, "win_name", _("Compose a message"), NULL);
@@ -2941,6 +2970,13 @@ create_composer (int visible_mask)
"FormatHTML", TC_CORBA_boolean, composer->send_html,
NULL);
+
+ gconf = gconf_client_get_default ();
+ composer_settings_update (gconf, 0, NULL, composer);
+ composer->notify_id = gconf_client_notify_add (gconf, "/apps/evolution/mail/composer",
+ composer_settings_update, composer, NULL, NULL);
+ g_object_unref (gconf);
+
editor_server = bonobo_widget_get_objref (BONOBO_WIDGET (composer->editor));
/* FIXME: handle exceptions */
Index: e-msg-composer.h
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer.h,v
retrieving revision 1.82
diff -u -p -r1.82 e-msg-composer.h
--- e-msg-composer.h 1 Apr 2003 23:41:14 -0000 1.82
+++ e-msg-composer.h 20 May 2003 17:09:20 -0000
@@ -104,6 +104,8 @@ struct _EMsgComposer {
GtkWidget *sig_omenu;
CamelMimeMessage *redirect;
+
+ guint notify_id;
};
struct _EMsgComposerClass {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]