aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c93
1 files changed, 40 insertions, 53 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 8b7c80349a..2fbd04c5c6 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -36,7 +36,6 @@
#include "e-util/e-charset.h"
#include "e-util/e-util.h"
#include "e-util/e-alert-dialog.h"
-#include "e-util/gconf-bridge.h"
#include "shell/e-shell-utils.h"
#include "widgets/misc/e-popup-action.h"
#include "widgets/misc/e-menu-tool-action.h"
@@ -483,7 +482,7 @@ action_mail_flag_for_followup_cb (GtkAction *action,
static gboolean
get_close_browser_reader (EMailReader *reader)
{
- GConfClient *client;
+ GSettings *settings;
const gchar *key;
gchar *value;
gboolean close_it = FALSE;
@@ -492,10 +491,10 @@ get_close_browser_reader (EMailReader *reader)
if (!E_IS_MAIL_BROWSER (reader))
return FALSE;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
- key = "/apps/evolution/mail/prompts/reply_close_browser";
- value = gconf_client_get_string (client, key, NULL);
+ key = "prompt-on-reply-close-browser";
+ value = g_settings_get_string (settings, key);
if (value && g_str_equal (value, "always")) {
close_it = TRUE;
@@ -524,13 +523,13 @@ get_close_browser_reader (EMailReader *reader)
close_it = response == GTK_RESPONSE_YES || response == GTK_RESPONSE_OK;
if (response == GTK_RESPONSE_OK)
- gconf_client_set_string (client, key, "always", NULL);
+ g_settings_set_string (settings, key, "always");
else if (response == GTK_RESPONSE_CANCEL)
- gconf_client_set_string (client, key, "never", NULL);
+ g_settings_set_string (settings, key, "never");
}
g_free (value);
- g_object_unref (client);
+ g_object_unref (settings);
return close_it;
}
@@ -1190,13 +1189,11 @@ action_mail_reply_all_check (CamelFolder *folder,
response = gtk_dialog_run (GTK_DIALOG (dialog));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) {
- GConfClient *client;
- const gchar *key;
+ GSettings *settings;
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/prompts/reply_many_recips";
- gconf_client_set_bool (client, key, FALSE, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ g_settings_set_boolean (settings, "prompt-on-reply-many-recips");
+ g_object_unref (settings);
}
gtk_widget_destroy (dialog);
@@ -1226,17 +1223,17 @@ static void
action_mail_reply_all_cb (GtkAction *action,
EMailReader *reader)
{
- GConfClient *client;
+ GSettings *settings;
const gchar *key;
guint32 state;
gboolean ask;
state = e_mail_reader_check_state (reader);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/prompts/reply_many_recips";
- ask = gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ key = "prompt-on-reply-many-recips";
+ ask = g_settings_get_boolean (settings, key);
+ g_object_unref (settings);
if (ask && !(state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
EActivity *activity;
@@ -1276,17 +1273,15 @@ static void
action_mail_reply_group_cb (GtkAction *action,
EMailReader *reader)
{
- GConfClient *client;
+ GSettings *settings;
gboolean reply_list;
- const gchar *key;
guint32 state;
state = e_mail_reader_check_state (reader);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/composer/group_reply_to_list";
- reply_list = gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ reply_list = g_settings_get_boolean (settings, "composer-group-reply-to-list");
+ g_object_unref (settings);
if (reply_list && (state & E_MAIL_READER_SELECTION_IS_MAILING_LIST)) {
e_mail_reader_reply_to_message (
@@ -1312,7 +1307,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
EAlertSink *alert_sink;
CamelMimeMessage *message;
EMailReplyType type = E_MAIL_REPLY_TO_SENDER;
- GConfClient *client;
+ GSettings *settings;
const gchar *key;
gboolean ask_ignore_list_reply_to;
gboolean ask_list_reply_to;
@@ -1342,13 +1337,10 @@ action_mail_reply_sender_check (CamelFolder *folder,
g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
- key = "/apps/evolution/mail/composer/ignore_list_reply_to";
- ask_ignore_list_reply_to = gconf_client_get_bool (client, key, NULL);
-
- key = "/apps/evolution/mail/prompts/list_reply_to";
- ask_list_reply_to = gconf_client_get_bool (client, key, NULL);
+ ask_ignore_list_reply_to = g_settings_get_boolean (settings, "composer-ignore-list-reply-to");
+ ask_list_reply_to = g_settings_get_boolean (settings, "prompt-on-list-reply-to");
munged_list_message = em_utils_is_munged_list_message (message);
@@ -1380,8 +1372,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check));
if (active) {
- key = "/apps/evolution/mail/prompts/private_list_reply";
- gconf_client_set_bool (client, key, FALSE, NULL);
+ g_settings_set_boolean (settings, "prompt-on-private-list-reply", FALSE);
}
gtk_widget_destroy (dialog);
@@ -1427,14 +1418,12 @@ action_mail_reply_sender_check (CamelFolder *folder,
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check_again));
if (active) {
- key = "/apps/evolution/mail/prompts/list_reply_to";
- gconf_client_set_bool (client, key, FALSE, NULL);
+ g_settings_set_boolean (settings, "prompt-on-list-reply-to");
}
- key = "/apps/evolution/mail/composer/ignore_list_reply_to";
active = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (check_always_ignore));
- gconf_client_set_bool (client, key, active, NULL);
+ g_settings_set_boolean (settings, "composer-ignore-list-reply-to", active);
gtk_widget_destroy (dialog);
@@ -1457,7 +1446,7 @@ action_mail_reply_sender_check (CamelFolder *folder,
check_close_browser_reader (closure->reader);
exit:
- g_object_unref (client);
+ g_object_unref (settings);
g_object_unref (message);
mail_reader_closure_free (closure);
@@ -1467,7 +1456,7 @@ static void
action_mail_reply_sender_cb (GtkAction *action,
EMailReader *reader)
{
- GConfClient *client;
+ GSettings *settings;
gboolean ask_list_reply_to;
gboolean ask_private_list_reply;
gboolean ask;
@@ -1476,12 +1465,10 @@ action_mail_reply_sender_cb (GtkAction *action,
state = e_mail_reader_check_state (reader);
- client = gconf_client_get_default ();
- key = "/apps/evolution/mail/prompts/list_reply_to";
- ask_list_reply_to = gconf_client_get_bool (client, key, NULL);
- key = "/apps/evolution/mail/prompts/private_list_reply";
- ask_private_list_reply = gconf_client_get_bool (client, key, NULL);
- g_object_unref (client);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ ask_list_reply_to = g_settings_get_boolean (settings, "prompt-on-list-reply-to");
+ ask_private_list_reply = g_settings_get_boolean (settings, "prompt-on-private-list-reply");
+ g_object_unref (settings);
ask = (ask_private_list_reply || ask_list_reply_to);
@@ -3439,7 +3426,7 @@ e_mail_reader_init (EMailReader *reader,
EWebView *web_view;
GtkActionGroup *action_group;
GtkWidget *message_list;
- GConfBridge *bridge;
+ GSettings *settings;
GtkAction *action;
gboolean sensitive;
const gchar *action_name;
@@ -3524,19 +3511,19 @@ e_mail_reader_init (EMailReader *reader,
action_group, mail_reader_search_folder_entries,
G_N_ELEMENTS (mail_reader_search_folder_entries), reader);
- /* Bind GObject properties to GConf keys. */
+ /* Bind GObject properties to GSettings keys. */
- bridge = gconf_bridge_get ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
action_name = "mail-caret-mode";
- key = "/apps/evolution/mail/display/caret_mode";
action = e_mail_reader_get_action (reader, action_name);
- gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ g_settings_bind (settings, "caret-mode", G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT);
action_name = "mail-show-all-headers";
- key = "/apps/evolution/mail/display/show_all_headers";
action = e_mail_reader_get_action (reader, action_name);
- gconf_bridge_bind_property (bridge, key, G_OBJECT (action), "active");
+ g_settings_bind (settings, "show-all-headers", G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT);
+
+ g_object_unref (settings);
/* Fine tuning. */