aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@gnome-db.org>2011-10-14 19:46:33 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-10-14 19:46:33 +0800
commit5efdc804e452ab547cc2a1d04c8d7173a2c9b6d5 (patch)
tree795126f95e29364c5ce3e9c98aa7638d59fa19b3 /mail
parent46b0d7f51334b6a7c6716b157fbf1b6f55fe5ff0 (diff)
downloadgsoc2013-evolution-5efdc804e452ab547cc2a1d04c8d7173a2c9b6d5.tar.gz
gsoc2013-evolution-5efdc804e452ab547cc2a1d04c8d7173a2c9b6d5.tar.zst
gsoc2013-evolution-5efdc804e452ab547cc2a1d04c8d7173a2c9b6d5.zip
Make e_utils_prompt_user and callers use GSettings keys
Diffstat (limited to 'mail')
-rw-r--r--mail/em-composer-utils.c8
-rw-r--r--mail/em-subscription-editor.h2
-rw-r--r--mail/em-utils.c34
3 files changed, 20 insertions, 24 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 837cc31f62..19f2950d4b 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -159,7 +159,7 @@ ask_confirm_for_unwanted_html_mail (EMsgComposer *composer,
if (str->len)
res = em_utils_prompt_user (
GTK_WINDOW (composer),
- "/apps/evolution/mail/prompts/unwanted_html",
+ "prompt-on-unwanted-html",
"mail:ask-send-html", str->str, NULL);
else
res = TRUE;
@@ -174,7 +174,7 @@ ask_confirm_for_empty_subject (EMsgComposer *composer)
{
return em_utils_prompt_user (
GTK_WINDOW (composer),
- "/apps/evolution/mail/prompts/empty_subject",
+ "prompt-on-empty-subject",
"mail:ask-send-no-subject", NULL);
}
@@ -190,7 +190,7 @@ ask_confirm_for_only_bcc (EMsgComposer *composer,
return em_utils_prompt_user (
GTK_WINDOW (composer),
- "/apps/evolution/mail/prompts/only_bcc",
+ "prompt-on-only-bcc",
hidden_list_case ?
"mail:ask-send-only-bcc-contact" :
"mail:ask-send-only-bcc", NULL);
@@ -333,7 +333,7 @@ composer_presend_check_recipients (EMsgComposer *composer)
if (invalid_addrs) {
if (!em_utils_prompt_user (
GTK_WINDOW (composer),
- "/apps/evolution/mail/prompts/send_invalid_recip",
+ "prompt-on-invalid-recip",
strstr (invalid_addrs->str, ", ") ?
"mail:ask-send-invalid-recip-multi" :
"mail:ask-send-invalid-recip-one",
diff --git a/mail/em-subscription-editor.h b/mail/em-subscription-editor.h
index 1b297f44ed..80b371f744 100644
--- a/mail/em-subscription-editor.h
+++ b/mail/em-subscription-editor.h
@@ -65,8 +65,6 @@ EMailBackend * em_subscription_editor_get_backend
(EMSubscriptionEditor *editor);
CamelStore * em_subscription_editor_get_store
(EMSubscriptionEditor *editor);
-CamelStore * em_subscription_editor_get_store
- (EMSubscriptionEditor *editor);
G_END_DECLS
diff --git a/mail/em-utils.c b/mail/em-utils.c
index 67978884d0..ed57335f17 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -105,7 +105,7 @@ em_utils_ask_open_many (GtkWindow *parent,
"Are you sure you want to open %d messages at once?",
how_many), how_many);
proceed = em_utils_prompt_user (
- parent, "/apps/evolution/mail/prompts/open_many",
+ parent, "prompt-on-open-many",
"mail:ask-open-many", string, NULL);
g_free (string);
@@ -115,7 +115,7 @@ em_utils_ask_open_many (GtkWindow *parent,
/**
* em_utils_prompt_user:
* @parent: parent window
- * @promptkey: gconf key to check if we should prompt the user or not.
+ * @promptkey: settings key to check if we should prompt the user or not.
* @tag: e_alert tag.
*
* Convenience function to query the user with a Yes/No dialog and a
@@ -136,13 +136,13 @@ em_utils_prompt_user (GtkWindow *parent,
GtkWidget *container;
va_list ap;
gint button;
- GConfClient *client;
+ GSettings *settings;
EAlert *alert = NULL;
- client = gconf_client_get_default ();
+ settings = g_settings_new ("org.gnome.evolution.mail");
- if (promptkey && !gconf_client_get_bool (client, promptkey, NULL)) {
- g_object_unref (client);
+ if (promptkey && !g_settings_get_boolean (settings, promptkey)) {
+ g_object_unref (settings);
return TRUE;
}
@@ -165,14 +165,13 @@ em_utils_prompt_user (GtkWindow *parent,
button = gtk_dialog_run (GTK_DIALOG (dialog));
if (promptkey)
- gconf_client_set_bool (
- client, promptkey,
- !gtk_toggle_button_get_active (
- GTK_TOGGLE_BUTTON (check)), NULL);
+ g_settings_set_boolean (settings, promptkey,
+ !gtk_toggle_button_get_active (
+ GTK_TOGGLE_BUTTON (check)));
gtk_widget_destroy (dialog);
- g_object_unref (client);
+ g_object_unref (settings);
return button == GTK_RESPONSE_YES;
}
@@ -1256,16 +1255,15 @@ em_utils_message_to_html (CamelMimeMessage *message,
((EMFormat *) emfq)->composer = TRUE;
if (!source) {
- GConfClient *gconf;
+ GSettings *settings;
gchar *charset;
/* FIXME We should be getting this from the
* current view, not the global setting. */
- gconf = gconf_client_get_default ();
- charset = gconf_client_get_string (
- gconf, "/apps/evolution/mail/display/charset", NULL);
+ settings = g_settings_new ("org.gnome.evolution.mail");
+ charset = g_settings_get_string (settings, "charset");
em_format_set_default_charset ((EMFormat *) emfq, charset);
- g_object_unref (gconf);
+ g_object_unref (settings);
g_free (charset);
}
@@ -1306,7 +1304,7 @@ em_utils_expunge_folder (GtkWidget *parent,
if (!em_utils_prompt_user (
GTK_WINDOW (parent),
- "/apps/evolution/mail/prompts/expunge",
+ "prompt-on-expunge",
"mail:ask-expunge", description, NULL))
return;
@@ -1330,7 +1328,7 @@ em_utils_empty_trash (GtkWidget *parent,
g_return_if_fail (E_IS_MAIL_BACKEND (backend));
if (!em_utils_prompt_user ((GtkWindow *) parent,
- "/apps/evolution/mail/prompts/empty_trash",
+ "prompt-on-empty-trash",
"mail:ask-empty-trash", NULL))
return;