/** * gva_main_search_entry_activate_cb: * @entry: the search entry * * Handler for #GtkEntry::activate signals to the search entry. * * Saves the contents of the search entry and switches the main window to * the "Search Results" view. **/ void gva_main_search_entry_activate_cb (GtkEntry *entry) { gva_main_set_last_selected_match (NULL, NULL); gva_main_execute_search (); gtk_widget_grab_focus (GVA_WIDGET_MAIN_TREE_VIEW); }
/** * gva_main_clear_search: * * Clears the search entry and, if the Search Results view is active, * any results from the previous search. **/ void gva_main_clear_search (void) { GtkWidget *widget; widget = GVA_WIDGET_MAIN_SEARCH_ENTRY; gtk_entry_set_text (GTK_ENTRY (widget), ""); gva_main_set_last_selected_match (NULL, NULL); if (gva_tree_view_get_selected_view () == 2) gva_main_execute_search (); }
static gboolean main_entry_completion_match_selected_cb (GtkEntryCompletion *completion, GtkTreeModel *model, GtkTreeIter *iter) { gchar *column_name; gchar *search_text; gtk_tree_model_get ( model, iter, COLUMN_NAME, &column_name, COLUMN_TEXT, &search_text, -1); gva_main_set_last_selected_match (column_name, search_text); gva_main_execute_search (); g_free (column_name); g_free (search_text); return TRUE; }
/** * gva_main_search_entry_activate_cb: * @entry: the search entry * * Handler for #GtkEntry::activate signals to the search entry. * * Saves the contents of the search entry and switches the main window to * the "Search Results" view. **/ void gva_main_search_entry_activate_cb (GtkEntry *entry) { gva_main_set_last_selected_match (NULL, NULL); gva_main_execute_search (); }