2005-01-21 [colin] 1.0.0cvs5.1
authorColin Leroy <colin@colino.net>
Fri, 21 Jan 2005 13:36:24 +0000 (13:36 +0000)
committerColin Leroy <colin@colino.net>
Fri, 21 Jan 2005 13:36:24 +0000 (13:36 +0000)
* src/gtk/quicksearch.c
* src/prefs_common.c
* src/prefs_common.h
Sync with HEAD (recurse option)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/gtk/quicksearch.c
src/prefs_common.c
src/prefs_common.h

index 5ff0437..0965a7c 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-21 [colin]     1.0.0cvs5.1
+
+       * src/gtk/quicksearch.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+               Sync with HEAD (recurse option)
+
 2005-01-21 [colin]     1.0.0cvs4.1
 
        * src/folder.h
index 9baa82b..49bce74 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.3.2.5 -r 1.3.2.6 src/ssl_manager.c; ) > 1.0.0cvs3.3.patchset
 ( cvs diff -u -r 1.3.2.6 -r 1.3.2.7 src/ssl_manager.c; ) > 1.0.0cvs3.4.patchset
 ( cvs diff -u -r 1.87.2.9 -r 1.87.2.10 src/folder.h; cvs diff -u -r 1.207.2.24 -r 1.207.2.25 src/folderview.c; cvs diff -u -r 1.20.2.3 -r 1.20.2.4 src/folderview.h; cvs diff -u -r 1.395.2.42 -r 1.395.2.43 src/summaryview.c; cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/gtk/quicksearch.c; cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/gtk/quicksearch.h; ) > 1.0.0cvs4.1.patchset
+( cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/gtk/quicksearch.c; cvs diff -u -r 1.204.2.27 -r 1.204.2.28 src/prefs_common.c; cvs diff -u -r 1.103.2.10 -r 1.103.2.11 src/prefs_common.h; ) > 1.0.0cvs5.1.patchset
index 3375b81..61471d1 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=4
+EXTRA_VERSION=5
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=.1
 
index f903ca5..75cb912 100644 (file)
@@ -175,6 +175,27 @@ static gboolean searchtype_changed(GtkMenuItem *widget, gpointer data)
        if (quicksearch->callback != NULL)
                quicksearch->callback(quicksearch, quicksearch->callback_data);
        quicksearch_set_running(quicksearch, FALSE);
+       return TRUE;
+}
+
+static gboolean searchtype_recursive_changed(GtkMenuItem *widget, gpointer data)
+{
+       QuickSearch *quicksearch = (QuickSearch *)data;
+       gboolean checked = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget));
+       
+       prefs_common.summary_quicksearch_recurse = checked; 
+
+       /* reselect the search type */
+       gtk_option_menu_set_history(GTK_OPTION_MENU(quicksearch->search_type_opt), 
+                                   prefs_common.summary_quicksearch_type);
+
+       prepare_matcher(quicksearch);
+
+       quicksearch_set_running(quicksearch, TRUE);
+       if (quicksearch->callback != NULL)
+               quicksearch->callback(quicksearch, quicksearch->callback_data);
+       quicksearch_set_running(quicksearch, FALSE);
+       return TRUE;
 }
 
 /*
@@ -289,6 +310,18 @@ QuickSearch *quicksearch_new()
                         G_CALLBACK(searchtype_changed),
                         quicksearch);
 
+       gtk_menu_shell_append(GTK_MENU_SHELL(search_type), gtk_separator_menu_item_new());
+       
+       menuitem = gtk_check_menu_item_new_with_label(_("Recursive"));
+       gtk_menu_shell_append(GTK_MENU_SHELL(search_type), menuitem);
+       
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem),
+                                       prefs_common.summary_quicksearch_recurse);
+       
+       g_signal_connect(G_OBJECT(menuitem), "activate",
+                        G_CALLBACK(searchtype_recursive_changed),
+                        quicksearch);
+
        gtk_option_menu_set_menu(GTK_OPTION_MENU(search_type_opt), search_type);
        
        gtk_option_menu_set_history(GTK_OPTION_MENU(search_type_opt), prefs_common.summary_quicksearch_type);
@@ -702,6 +735,9 @@ void quicksearch_search_subfolders(QuickSearch *quicksearch,
        FolderItem *cur = NULL;
        GNode *node = folder_item->node->children;
        
+       if (!prefs_common.summary_quicksearch_recurse)
+               return;
+
        for (; node != NULL; node = node->next) {
                cur = FOLDER_ITEM(node->data);
                if (quicksearch_match_subfolder(quicksearch, cur)) {
index 0653ebb..c879370 100644 (file)
@@ -708,6 +708,8 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
        {"summary_quicksearch_sticky", "1", &prefs_common.summary_quicksearch_sticky, P_INT,
         NULL, NULL, NULL},
+       {"summary_quicksearch_recurse", "1", &prefs_common.summary_quicksearch_recurse, P_INT,
+        NULL, NULL, NULL},
 
        {"io_timeout_secs", "60", &prefs_common.io_timeout_secs,
         P_INT, &other.spinbtn_iotimeout,
index 070e4f3..fb9bc54 100644 (file)
@@ -300,6 +300,7 @@ struct _PrefsCommon
        
        gint summary_quicksearch_type;
        gint summary_quicksearch_sticky;
+       gint summary_quicksearch_recurse;
        gulong color_new;
        
        GList *summary_quicksearch_history;