commit 5ef1df1e1b1b977407504f664eb6029ef045f429
parent 2780845b62dfebf852b88848c83e302c350287c0
Author: Ricardo Mones <ricardo@mones.org>
Date: Sun, 9 Aug 2015 01:19:32 +0200
Fix bug 2458 “Option to force header type to pre-defined-only”
As suggested by the comments in the report this adds a new
hidden preference namely 'type_any_header', which controls
the editable status of the compose header entries.
For RELEASE_NOTES: the option is set to FALSE by default, so it
changes current default behaviour.
Diffstat:
4 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/manual/advanced.xml b/manual/advanced.xml
@@ -841,6 +841,16 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><literal>type_any_header</literal></term>
+ <listitem>
+ <para>
+ Allows to type any header on the compose window header entries.
+ By default only the entries available from the combobox can be
+ selected.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><literal>two_line_vertical</literal></term>
<listitem>
<para>
diff --git a/src/compose.c b/src/compose.c
@@ -6963,6 +6963,10 @@ static void compose_create_header_entry(Compose *compose)
if (header)
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((combo)))), header);
+ gtk_editable_set_editable(
+ GTK_EDITABLE(gtk_bin_get_child(GTK_BIN((combo)))),
+ prefs_common.type_any_header);
+
g_signal_connect_after(G_OBJECT(gtk_bin_get_child(GTK_BIN((combo)))), "grab_focus",
G_CALLBACK(compose_grab_focus_cb), compose);
diff --git a/src/prefs_common.c b/src/prefs_common.c
@@ -221,6 +221,8 @@ static PrefParam param[] = {
&prefs_common.compose_body_format, P_STRING, NULL, NULL, NULL},
{"show_compose_margin", "FALSE", &prefs_common.show_compose_margin, P_BOOL,
NULL, NULL, NULL},
+ {"type_any_header", "FALSE", &prefs_common.type_any_header, P_BOOL,
+ NULL, NULL, NULL},
{"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
diff --git a/src/prefs_common.h b/src/prefs_common.h
@@ -167,6 +167,7 @@ struct _PrefsCommon
gchar *compose_subject_format;
gchar *compose_body_format;
gboolean show_compose_margin;
+ gboolean type_any_header;
/* Quote */
gboolean reply_with_quote;