Fix bug 2458 “Option to force header type to pre-defined-only”
authorRicardo Mones <ricardo@mones.org>
Sat, 8 Aug 2015 23:19:32 +0000 (01:19 +0200)
committerRicardo Mones <ricardo@mones.org>
Sun, 9 Aug 2015 09:33:42 +0000 (11:33 +0200)
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.

manual/advanced.xml
src/compose.c
src/prefs_common.c
src/prefs_common.h

index 8a17cdc..4b882e6 100644 (file)
          </para>
        </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>
index 13a7def..4306e8e 100644 (file)
@@ -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);
 
index 25ac2be..eb28b96 100644 (file)
@@ -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,
index 465a490..e9686ae 100644 (file)
@@ -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;