2005-01-21 [colin] 1.0.0cvs5
authorColin Leroy <colin@colino.net>
Fri, 21 Jan 2005 13:32:53 +0000 (13:32 +0000)
committerColin Leroy <colin@colino.net>
Fri, 21 Jan 2005 13:32:53 +0000 (13:32 +0000)
* src/gtk/quicksearch.c
* src/prefs_common.c
* src/prefs_common.h
Add option to recurse or not

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

index fbb6678..2848738 100644 (file)
@@ -1,3 +1,10 @@
+2005-01-21 [colin]     1.0.0cvs5
+
+       * src/gtk/quicksearch.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+               Add option to recurse or not
+
 2005-01-21 [colin]     1.0.0cvs4
 
        * src/folder.h
index 69fae31..3dc2237 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.315 -r 1.316 src/mainwindow.c; cvs diff -u -r 1.30 -r 1.31 src/mbox.c; cvs diff -u -r 1.4 -r 1.5 src/mbox.h; cvs diff -u -r 1.451 -r 1.452 src/summaryview.c; cvs diff -u -r 1.74 -r 1.75 src/summaryview.h; ) > 1.0.0cvs2.patchset
 ( cvs diff -u -r 1.35 -r 1.36 src/addrindex.c; cvs diff -u -r 1.14 -r 1.15 src/addrindex.h; ) > 1.0.0cvs3.patchset
 ( cvs diff -u -r 1.107 -r 1.108 src/folder.h; cvs diff -u -r 1.254 -r 1.255 src/folderview.c; cvs diff -u -r 1.27 -r 1.28 src/folderview.h; cvs diff -u -r 1.452 -r 1.453 src/summaryview.c; cvs diff -u -r 1.9 -r 1.10 src/gtk/quicksearch.c; cvs diff -u -r 1.3 -r 1.4 src/gtk/quicksearch.h; ) > 1.0.0cvs4.patchset
+( cvs diff -u -r 1.10 -r 1.11 src/gtk/quicksearch.c; cvs diff -u -r 1.232 -r 1.233 src/prefs_common.c; cvs diff -u -r 1.117 -r 1.118 src/prefs_common.h; ) > 1.0.0cvs5.patchset
index 1a5561b..76f7268 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=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index d77a994..eed521c 100644 (file)
@@ -52,7 +52,7 @@ struct _QuickSearch
        QuickSearchExecuteCallback       callback;
        gpointer                         callback_data;
        gboolean                         running;
-       FolderItem                      *root_folder_item
+       FolderItem                      *root_folder_item;
 };
 
 void quicksearch_set_running(QuickSearch *quicksearch, gboolean run);
@@ -128,7 +128,7 @@ static gint searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
        return TRUE;            
 }
 
-static void searchtype_changed(GtkMenuItem *widget, gpointer data)
+static gboolean searchtype_changed(GtkMenuItem *widget, gpointer data)
 {
        QuickSearch *quicksearch = (QuickSearch *)data;
 
@@ -150,6 +150,27 @@ static void 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(widget)->active;
+       
+       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;
 }
 
 /*
@@ -277,6 +298,19 @@ QuickSearch *quicksearch_new()
                           GTK_SIGNAL_FUNC(searchtype_changed),
                           quicksearch);
 
+       MENUITEM_ADD (search_type, menuitem, NULL, NULL);
+       
+       menuitem = gtk_check_menu_item_new_with_label(_("Recursive"));
+       gtk_widget_show(menuitem);
+       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);
+       
+       gtk_signal_connect(GTK_OBJECT(menuitem), "activate",
+                        GTK_SIGNAL_FUNC(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);
@@ -660,6 +694,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 7cfa44a..7e295cf 100644 (file)
@@ -694,6 +694,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 dda2118..6beb6e9 100644 (file)
@@ -281,6 +281,7 @@ struct _PrefsCommon
        
        gint summary_quicksearch_type;
        gint summary_quicksearch_sticky;
+       gint summary_quicksearch_recurse;
        gulong color_new;
        
        GList *summary_quicksearch_history;