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 8a17cdc754fcf0365f8679e9254bf4e38c2b92e4..4b882e61bbc46ed8ad8de27c7186258d8f7ef53e 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 13a7def3a5484b21e025cbf7fa2684fb4a0c2385..4306e8ec2f94b40df513af8bff36561303f3cc4e 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 25ac2bea24c4eca0ad5cdd2a183ef9b4dabe1d82..eb28b9670be6c59bd21abe360881e9acf6b49e77 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 465a4907ee2e2399112ca796cda8939ccb218b64..e9686ae12fdf50d331589f4089f5b0a3246e9e7d 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;