[Evolution-hackers] Preformat by default



Hello,

I'd like to change Evolution composer in plain text to use Preformat
block format by default. Below you can see what I did but the default
block format is still set to Normal/Paragraph in new messages. Where
else should I look please?

I'd like to dig deeper into Evolution code base but I'd really
appreciate a little help because the code base is huge. What I'm trying
to do now is only my personal exercise and not a RFC for the upstream.

I'm not that used to mailing list etiquette. Is the way I attached the patch proper?

Thank you for your help.

diff --git a/src/e-util/e-html-editor-actions.c b/src/e-util/e-html-editor-actions.c
index e32249eb17..0d3af6121c 100644
--- a/src/e-util/e-html-editor-actions.c
+++ b/src/e-util/e-html-editor-actions.c
@@ -1797,7 +1797,7 @@ editor_actions_init (EHTMLEditor *editor)
        gtk_action_group_add_radio_actions (
                action_group, core_style_entries,
                G_N_ELEMENTS (core_style_entries),
-               E_CONTENT_EDITOR_BLOCK_FORMAT_PARAGRAPH,
+               E_CONTENT_EDITOR_BLOCK_FORMAT_PRE,
                NULL, NULL);
        gtk_ui_manager_insert_action_group (manager, action_group, 0);
 
@@ -1953,7 +1953,7 @@ editor_actions_bind (EHTMLEditor *editor)
                G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
        e_binding_bind_property (
                cnt_editor, "block-format",
-               ACTION (STYLE_NORMAL), "current-value",
+               ACTION (STYLE_PRE), "current-value",
                G_BINDING_SYNC_CREATE | G_BINDING_BIDIRECTIONAL);
        e_binding_bind_property (
                cnt_editor, "indented",
diff --git a/src/e-util/e-html-editor-actions.h b/src/e-util/e-html-editor-actions.h
index f724db0be2..f07bbd3c70 100644
--- a/src/e-util/e-html-editor-actions.h
+++ b/src/e-util/e-html-editor-actions.h
@@ -149,6 +149,8 @@
        E_HTML_EDITOR_ACTION ((editor), "style-h6")
 #define E_HTML_EDITOR_ACTION_STYLE_NORMAL(editor) \
        E_HTML_EDITOR_ACTION ((editor), "style-normal")
+#define E_HTML_EDITOR_ACTION_STYLE_PRE(editor) \
+       E_HTML_EDITOR_ACTION ((editor), "style-preformat")
 #define E_HTML_EDITOR_ACTION_TEST_URL(editor) \
        E_HTML_EDITOR_ACTION ((editor), "test-url")
 #define E_HTML_EDITOR_ACTION_UNDERLINE(editor) \
diff --git a/src/modules/webkit-editor/e-webkit-editor.c b/src/modules/webkit-editor/e-webkit-editor.c
index cd0d5f2cbe..2891f77c1c 100644
--- a/src/modules/webkit-editor/e-webkit-editor.c
+++ b/src/modules/webkit-editor/e-webkit-editor.c
@@ -6569,7 +6569,7 @@ e_webkit_editor_init (EWebKitEditor *wk_editor)
        wk_editor->priv->background_color = gdk_rgba_copy (&white);
        wk_editor->priv->font_name = NULL;
        wk_editor->priv->font_size = E_CONTENT_EDITOR_FONT_SIZE_NORMAL;
-       wk_editor->priv->block_format = E_CONTENT_EDITOR_BLOCK_FORMAT_PARAGRAPH;
+       wk_editor->priv->block_format = E_CONTENT_EDITOR_BLOCK_FORMAT_PRE;
        wk_editor->priv->alignment = E_CONTENT_EDITOR_ALIGNMENT_LEFT;
 
        wk_editor->priv->start_bottom = E_THREE_STATE_INCONSISTENT;
diff --git a/src/modules/webkit-editor/web-extension/e-editor-page.c 
b/src/modules/webkit-editor/web-extension/e-editor-page.c
index 09b02359bc..cfbd9bf088 100644
--- a/src/modules/webkit-editor/web-extension/e-editor-page.c
+++ b/src/modules/webkit-editor/web-extension/e-editor-page.c
@@ -244,7 +244,7 @@ e_editor_page_init (EEditorPage *editor_page)
        editor_page->priv->font_name = g_strdup ("");
        editor_page->priv->font_size = E_CONTENT_EDITOR_FONT_SIZE_NORMAL;
        editor_page->priv->alignment = E_CONTENT_EDITOR_ALIGNMENT_LEFT;
-       editor_page->priv->block_format = E_CONTENT_EDITOR_BLOCK_FORMAT_PARAGRAPH;
+       editor_page->priv->block_format = E_CONTENT_EDITOR_BLOCK_FORMAT_PRE;
        editor_page->priv->force_image_load = FALSE;
        editor_page->priv->html_mode = TRUE;
        editor_page->priv->processing_keypress_event = FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]