add hidden prefs to choose old or new style addr and folder matching
authorPaul <paul@claws-mail.org>
Wed, 5 Feb 2014 08:28:28 +0000 (08:28 +0000)
committerPaul <paul@claws-mail.org>
Wed, 5 Feb 2014 08:28:28 +0000 (08:28 +0000)
manual/advanced.xml
src/addr_compl.c
src/foldersel.c
src/prefs_common.c
src/prefs_common.h

index 53e9270..dfcd319 100644 (file)
        url="http://www.claws-mail.org/clawsker.php">Clawsker page</ulink>.
     </para>
     <variablelist>
+      <varlistentry>
+       <term><literal>address_search_wildcard</literal></term>
+       <listitem>
+         <para>
+       TAB-address completion in the Compose window will match any part of the
+       string (1) or just the start of the string (0).
+         </para>
+       </listitem>
+      </varlistentry>
       <varlistentry>
        <term><literal>addressbook_use_editaddress_dialog</literal></term>
        <listitem>
          </para>
        </listitem>
       </varlistentry>
+      <varlistentry>
+       <term><literal>folder_search_wildcard</literal></term>
+       <listitem>
+         <para>
+       The type-ahead function in the Select Folder window will match any
+       part of the folder name (1) or just the start of the folder name (0).
+         </para>
+       </listitem>
+      </varlistentry>
       <varlistentry>
        <term><literal>folderview_vscrollbar_policy</literal></term>
        <listitem>
index 7472fc1..407e626 100644 (file)
@@ -179,7 +179,8 @@ static gint addr_completion_func(const gchar *needle, const gchar *haystack,
 static void init_all(void)
 {
        g_completion = g_completion_new(completion_func);
-       g_completion_set_compare(g_completion, addr_completion_func);
+       if (prefs_common.address_search_wildcard)
+               g_completion_set_compare(g_completion, addr_completion_func);
        cm_return_if_fail(g_completion != NULL);
 }
 
index a34d513..02a0982 100644 (file)
@@ -288,8 +288,9 @@ static void foldersel_create(void)
        gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(treeview), FALSE);
        gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview),
                                        FOLDERSEL_FOLDERNAME);
-       gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(treeview),
-                       foldersel_search_name_func, NULL, NULL);
+       if (prefs_common.folder_search_wildcard)
+               gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(treeview),
+                               foldersel_search_name_func, NULL, NULL);
 
        selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
        gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
index 09680b3..e2c676b 100644 (file)
@@ -1173,6 +1173,11 @@ static PrefParam param[] = {
        {"diff_hunk_color", "#a52a2a", &prefs_common.diff_hunk_color, P_COLOR,
         NULL, NULL, NULL},
 
+       {"folder_search_wildcard", "TRUE", &prefs_common.folder_search_wildcard, P_BOOL,
+        NULL, NULL, NULL},
+       {"address_search_wildcard", "TRUE", &prefs_common.address_search_wildcard, P_BOOL,
+        NULL, NULL, NULL},
+
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
index 11b3e55..a0ce721 100644 (file)
@@ -520,6 +520,9 @@ struct _PrefsCommon
        gulong diff_added_color;
        gulong diff_deleted_color;
        gulong diff_hunk_color;
+       
+       gboolean folder_search_wildcard;
+       gboolean address_search_wildcard;
 };
 
 extern PrefsCommon prefs_common;