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));
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;
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;
}
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;
}
GtkWidget *search_condition_expression;
GtkWidget *menuitem;
GtkTooltips *tips = gtk_tooltips_new();
- gint index;
quicksearch = g_new0(QuickSearch, 1);
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);
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;
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;