[evolution] EHTMLEditorView - Add a checkbox to remember the choice when asking if lose formatting
- From: Tomas Popela <tpopela src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] EHTMLEditorView - Add a checkbox to remember the choice when asking if lose formatting
- Date: Mon, 23 Mar 2015 09:48:02 +0000 (UTC)
commit 96a4ac56526bf6b0bdb9bb5765acfb7e9280384a
Author: Tomas Popela <tpopela redhat com>
Date: Mon Mar 23 10:18:37 2015 +0100
EHTMLEditorView - Add a checkbox to remember the choice when asking if lose formatting
composer/mail-composer.error.xml | 7 +++++++
data/org.gnome.evolution.mail.gschema.xml.in | 5 +++++
e-util/e-html-editor-view.c | 26 ++++++--------------------
3 files changed, 18 insertions(+), 20 deletions(-)
---
diff --git a/composer/mail-composer.error.xml b/composer/mail-composer.error.xml
index 06d4d42..8b9db2d 100644
--- a/composer/mail-composer.error.xml
+++ b/composer/mail-composer.error.xml
@@ -102,4 +102,11 @@
<button _label="_Send" response="GTK_RESPONSE_YES"/>
</error>
+ <error id="prompt-composer-mode-switch" type="question" default="GTK_RESPONSE_YES">
+ <_primary>Are you sure you want to change the composer mode?</_primary>
+ <_secondary xml:space="preserve">Turning HTML mode off will cause the text to lose all formatting. Do you
want to continue?</_secondary>
+ <button _label="_Don't lose formatting" response="GTK_RESPONSE_NO"/>
+ <button _label="Lose _formatting" response="GTK_RESPONSE_YES"/>
+ </error>
+
</error-list>
diff --git a/data/org.gnome.evolution.mail.gschema.xml.in b/data/org.gnome.evolution.mail.gschema.xml.in
index 89373bb..9cc4c3a 100644
--- a/data/org.gnome.evolution.mail.gschema.xml.in
+++ b/data/org.gnome.evolution.mail.gschema.xml.in
@@ -456,6 +456,11 @@
<_summary>Prompt when replying to many recipients</_summary>
<_description>It disables/enables the repeated prompts to warn that you are sending a reply to many
people.</_description>
</key>
+ <key name="prompt-on-composer-mode-switch" type="b">
+ <default>true</default>
+ <_summary>Prompt when switching composer mode and the content needs to lose its formatting</_summary>
+ <_description>It disables/enables the repeated prompts to warn that you are switching composer mode
and the content needs to lose its formatting.</_description>
+ </key>
<key name="browser-close-on-reply-policy" enum="org.gnome.evolution.mail.AutomaticActionPolicy">
<default>'ask'</default>
<_summary>Policy for automatically closing the message browser window when forwarding or replying to
the displayed message.</_summary>
diff --git a/e-util/e-html-editor-view.c b/e-util/e-html-editor-view.c
index a9e3310..a84dc78 100644
--- a/e-util/e-html-editor-view.c
+++ b/e-util/e-html-editor-view.c
@@ -8686,8 +8686,8 @@ process_content_for_html (EHTMLEditorView *view)
static gboolean
show_lose_formatting_dialog (EHTMLEditorView *view)
{
- gint result;
- GtkWidget *toplevel, *dialog;
+ gboolean lose;
+ GtkWidget *toplevel;
GtkWindow *parent = NULL;
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (view));
@@ -8695,30 +8695,16 @@ show_lose_formatting_dialog (EHTMLEditorView *view)
if (GTK_IS_WINDOW (toplevel))
parent = GTK_WINDOW (toplevel);
- dialog = gtk_message_dialog_new (
- parent,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Turning HTML mode off will cause the text "
- "to lose all formatting. Do you want to continue?"));
- gtk_dialog_add_buttons (
- GTK_DIALOG (dialog),
- _("_Don't lose formatting"), GTK_RESPONSE_CANCEL,
- _("_Lose formatting"), GTK_RESPONSE_OK,
- NULL);
-
- result = gtk_dialog_run (GTK_DIALOG (dialog));
+ lose = e_util_prompt_user (
+ parent, "org.gnome.evolution.mail", "prompt-on-composer-mode-switch",
+ "mail-composer:prompt-composer-mode-switch", NULL);
- if (result != GTK_RESPONSE_OK) {
- gtk_widget_destroy (dialog);
+ if (!lose) {
/* Nothing has changed, but notify anyway */
g_object_notify (G_OBJECT (view), "html-mode");
return FALSE;
}
- gtk_widget_destroy (dialog);
-
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]