From b3f612793ce09fc2b6a6950b65c47b97036a7ff8 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Sat, 21 Apr 2007 14:43:17 +0000 Subject: [PATCH] 2007-04-21 [colin] 2.9.1cvs13 * src/gtk/quicksearch.c Fix changing quicksearch type (after Esc, after changing Recursive, ...) --- ChangeLog | 6 ++++++ PATCHSETS | 1 + configure.ac | 2 +- src/gtk/quicksearch.c | 29 +++++++++++++++-------------- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4376d7232..ef6887465 100644 --- 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 diff --git a/PATCHSETS b/PATCHSETS index 08c04e693..4bda214f8 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2540,3 +2540,4 @@ ( 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 diff --git a/configure.ac b/configure.ac index abf8b77fb..81fe4e5d5 100644 --- a/configure.ac +++ b/configure.ac @@ -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= diff --git a/src/gtk/quicksearch.c b/src/gtk/quicksearch.c index fdf754019..8d1ff6623 100644 --- a/src/gtk/quicksearch.c +++ b/src/gtk/quicksearch.c @@ -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; -- 2.25.1