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 4376d72..ef68874 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 08c04e6..4bda214 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 abf8b77..81fe4e5 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 fdf7540..8d1ff66 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;