mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 355498 - When there is only one result from a 'Find', select it.
This commit is contained in:
parent
ae39df07eb
commit
026856122c
@ -367,6 +367,15 @@ gnc_search_dialog_display_results (GNCSearchWindow *sw)
|
||||
max_count = gnc_prefs_get_float(GNC_PREFS_GROUP_SEARCH_GENERAL, GNC_PREF_NEW_SEARCH_LIMIT);
|
||||
if (gnc_query_view_get_num_entries(GNC_QUERY_VIEW(sw->result_view)) < max_count)
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (sw->new_rb), TRUE);
|
||||
|
||||
/* If there is only one item then select it */
|
||||
if (gnc_query_view_get_num_entries (GNC_QUERY_VIEW(sw->result_view)) == 1)
|
||||
{
|
||||
GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(sw->result_view));
|
||||
GtkTreePath *path = gtk_tree_path_new_first ();
|
||||
gtk_tree_selection_select_path (selection, path);
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user