2007-04-21 [colin] 2.9.1cvs13
authorColin Leroy <colin@colino.net>
Sat, 21 Apr 2007 14:43:17 +0000 (14:43 +0000)
committerColin Leroy <colin@colino.net>
Sat, 21 Apr 2007 14:43:17 +0000 (14:43 +0000)
* src/gtk/quicksearch.c
Fix changing quicksearch type (after Esc,
after changing Recursive, ...)

ChangeLog
PATCHSETS
configure.ac
src/gtk/quicksearch.c

index 4376d7232af4d0a845f240077bbc23dcdd3ee236..ef68874657a988c3d7b5f3600768ddc96f9913f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-21 [colin]     2.9.1cvs13
+
+       * src/gtk/quicksearch.c
+               Fix changing quicksearch type (after Esc,
+               after changing Recursive, ...)
+
 2007-04-20 [wwp]       2.9.1cvs12
 
        * src/gtk/Makefile.am
index 08c04e693bc0cb8a36693f307682e89b8d0ca6ab..4bda214f8a3ab2208db66fd3773e619e494b149c 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.83.2.105 -r 1.83.2.106 src/mimeview.c;  cvs diff -u -r 1.395.2.297 -r 1.395.2.298 src/summaryview.c;  cvs diff -u -r 1.96.2.168 -r 1.96.2.169 src/textview.c;  ) > 2.9.1cvs10.patchset
 ( cvs diff -u -r 1.60.2.87 -r 1.60.2.88 src/addressbook.c;  ) > 2.9.1cvs11.patchset
 ( cvs diff -u -r 1.20.2.13 -r 1.20.2.14 src/gtk/Makefile.am;  ) > 2.9.1cvs12.patchset
+( cvs diff -u -r 1.1.2.68 -r 1.1.2.69 src/gtk/quicksearch.c;  ) > 2.9.1cvs13.patchset
index abf8b77fb264d9df1603450dbfc52ba10447cdfb..81fe4e5d598aa267013e79a494b017a14ad55c27 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=12
+EXTRA_VERSION=13
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index fdf754019a3e90dab90afa3cc9aac4ab1e4c8339..8d1ff662361e2dd5ef5de03247ffea821448200f 100644 (file)
@@ -78,6 +78,15 @@ gboolean quicksearch_is_fast(QuickSearch *quicksearch)
        return quicksearch->is_fast;
 }
 
+static void quicksearch_set_type(QuickSearch *quicksearch, gint type)
+{
+       gint index;
+       index = menu_find_option_menu_index(GTK_OPTION_MENU(quicksearch->search_type_opt), 
+                                       GINT_TO_POINTER(prefs_common.summary_quicksearch_type),
+                                       NULL);
+       gtk_option_menu_set_history(GTK_OPTION_MENU(quicksearch->search_type_opt), index);      
+}
+
 static void prepare_matcher(QuickSearch *quicksearch)
 {
        const gchar *search_string = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(quicksearch->search_string_entry)->entry));
@@ -284,8 +293,7 @@ static gboolean searchtype_recursive_changed(GtkMenuItem *widget, gpointer data)
        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);
+       quicksearch_set_type(quicksearch, prefs_common.summary_quicksearch_type);
 
        if (!search_string || strlen(search_string) == 0) {
                return TRUE;
@@ -308,8 +316,7 @@ static gboolean searchtype_sticky_changed(GtkMenuItem *widget, gpointer data)
        prefs_common.summary_quicksearch_sticky = checked;
 
        /* reselect the search type */
-       gtk_option_menu_set_history(GTK_OPTION_MENU(quicksearch->search_type_opt),
-                                   prefs_common.summary_quicksearch_type);
+       quicksearch_set_type(quicksearch, prefs_common.summary_quicksearch_type);
 
        return TRUE;
 }
@@ -322,8 +329,7 @@ static gboolean searchtype_dynamic_changed(GtkMenuItem *widget, gpointer data)
        prefs_common.summary_quicksearch_dynamic = checked;
 
        /* reselect the search type */
-       gtk_option_menu_set_history(GTK_OPTION_MENU(quicksearch->search_type_opt),
-                                   prefs_common.summary_quicksearch_type);
+       quicksearch_set_type(quicksearch, prefs_common.summary_quicksearch_type);
 
        return TRUE;
 }
@@ -470,7 +476,6 @@ QuickSearch *quicksearch_new()
        GtkWidget *search_condition_expression;
        GtkWidget *menuitem;
        GtkTooltips *tips = gtk_tooltips_new();
-       gint index;
 
        quicksearch = g_new0(QuickSearch, 1);
 
@@ -541,10 +546,8 @@ QuickSearch *quicksearch_new()
 
        gtk_option_menu_set_menu(GTK_OPTION_MENU(search_type_opt), search_type);
 
-       index = menu_find_option_menu_index(GTK_OPTION_MENU(search_type_opt), 
-                                       GINT_TO_POINTER(prefs_common.summary_quicksearch_type),
-                                       NULL);
-       gtk_option_menu_set_history(GTK_OPTION_MENU(search_type_opt), index);
+       quicksearch->search_type_opt = search_type_opt;
+       quicksearch_set_type(quicksearch, prefs_common.summary_quicksearch_type);
 
        gtk_widget_show(search_type);
 
@@ -627,7 +630,6 @@ QuickSearch *quicksearch_new()
 
        quicksearch->hbox_search = hbox_search;
        quicksearch->search_type = search_type;
-       quicksearch->search_type_opt = search_type_opt;
        quicksearch->search_string_entry = search_string_entry;
        quicksearch->search_condition_expression = search_condition_expression;
        quicksearch->search_description = search_description;
@@ -721,8 +723,7 @@ void quicksearch_hide(QuickSearch *quicksearch)
 void quicksearch_set(QuickSearch *quicksearch, QuickSearchType type,
                     const gchar *matchstring)
 {
-       gtk_option_menu_set_history(GTK_OPTION_MENU(quicksearch->search_type_opt),
-                                   type);
+       quicksearch_set_type(quicksearch, type);
 
        if (!matchstring || !(*matchstring))
                quicksearch->in_typing = FALSE;