diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-11-23 09:48:44 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-11-23 09:48:44 +0800 |
commit | 9918361aef9ad1360a0ed3a240cc58d6cd9e30f8 (patch) | |
tree | 50bf24934b5ab3fefcc27913d1855a27c75e6d40 /plugins/itip-formatter | |
parent | fa1bb9a17e11cf12ce02d9b49bba2753f6020ea0 (diff) | |
parent | e64d6fe05c30c2cc1d7625a202afba3ba2da07cd (diff) | |
download | gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.gz gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.bz2 gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.lz gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.xz gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.tar.zst gsoc2013-evolution-9918361aef9ad1360a0ed3a240cc58d6cd9e30f8.zip |
Merge branch 'wip/gsettings'
Diffstat (limited to 'plugins/itip-formatter')
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 72535a3a99..e4f32010bd 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -27,7 +27,6 @@ #include <string.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#include <gconf/gconf-client.h> #include <libecal/e-cal-client.h> #include <libecal/e-cal-time-util.h> #include <libedataserverui/e-source-selector.h> @@ -51,7 +50,7 @@ #include <misc/e-attachment.h> #define CLASSID "itip://" -#define GCONF_KEY_DELETE "/apps/evolution/itip/delete_processed" +#define CONF_KEY_DELETE "delete-processed" #define d(x) @@ -2888,7 +2887,7 @@ void format_itip (EPlugin *ep, EMFormatHookTarget *target) { - GConfClient *gconf; + GSettings *settings; gchar *classid; struct _itip_puri *puri; CamelDataWrapper *content; @@ -2907,8 +2906,8 @@ format_itip (EPlugin *ep, em_format_html_add_pobject ((EMFormatHTML *) target->format, sizeof (EMFormatHTMLPObject), classid, target->part, format_itip_object); - gconf = gconf_client_get_default (); - puri->delete_message = gconf_client_get_bool (gconf, GCONF_KEY_DELETE, NULL); + settings = g_settings_new ("org.gnome.evolution.plugin.itip"); + puri->delete_message = g_settings_get_boolean (settings, CONF_KEY_DELETE); puri->has_organizer = FALSE; puri->no_reply_wanted = FALSE; puri->folder = ((EMFormat *) target->format)->folder; @@ -2918,7 +2917,7 @@ format_itip (EPlugin *ep, puri->cancellable = g_cancellable_new (); puri->puri.free = puri_free; - g_object_unref (gconf); + g_object_unref (settings); /* This is non-gui thread. Download the part for using in the main thread */ content = camel_medium_get_content ((CamelMedium *) target->part); @@ -2950,9 +2949,13 @@ static void delete_toggled_cb (GtkWidget *widget, gpointer data) { - EMConfigTargetPrefs *target = data; + GSettings *settings; + gboolean active; - gconf_client_set_bool (target->gconf, GCONF_KEY_DELETE, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)), NULL); + settings = g_settings_new ("org.gnome.evolution.plugin.itip"); + active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); + g_settings_set_boolean (settings, CONF_KEY_DELETE, active); + g_object_unref (settings); } static void @@ -3023,6 +3026,7 @@ itip_formatter_page_factory (EPlugin *ep, GtkWidget *scrolledwin; ESourceList *source_list; gchar *str; + GSettings *settings; /* Create a new notebook page */ page = gtk_vbox_new (FALSE, 0); @@ -3051,12 +3055,15 @@ itip_formatter_page_factory (EPlugin *ep, gtk_box_pack_start (GTK_BOX (hbox), inner_vbox, FALSE, FALSE, 0); /* Delete message after acting */ - /* FIXME Need a schema for this */ + settings = g_settings_new ("org.gnome.evolution.plugin.itip"); + check = gtk_check_button_new_with_mnemonic (_("_Delete message after acting")); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gconf_client_get_bool (target->gconf, GCONF_KEY_DELETE, NULL)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), g_settings_get_boolean (settings, CONF_KEY_DELETE)); g_signal_connect (GTK_TOGGLE_BUTTON (check), "toggled", G_CALLBACK (delete_toggled_cb), target); gtk_box_pack_start (GTK_BOX (inner_vbox), check, FALSE, FALSE, 0); + g_object_unref (settings); + /* "Conflict searching" */ frame = gtk_vbox_new (FALSE, 6); gtk_box_pack_start (GTK_BOX (page), frame, TRUE, TRUE, 24); |