Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

search_cb.c File Reference


Detailed Description

GUI filtering functions.

Author:
Raphael Manfredi

Richard Eckart

Date:
2001-2003
Author:
Raphael Manfredi
Date:
2005

#include "gtk/gui.h"
#include <gdk/gdkkeysyms.h>
#include "gtk/gtkcolumnchooser.h"
#include "gtk/search.h"
#include "gtk/statusbar.h"
#include "gtk/gtk-missing.h"
#include "gtk/bitzi.h"
#include "gtk/columns.h"
#include "gtk/misc.h"
#include "search_cb.h"
#include "if/gui_property.h"
#include "if/gui_property_priv.h"
#include "if/gnet_property.h"
#include "if/bridge/ui2c.h"
#include "if/core/search.h"
#include "lib/atoms.h"
#include "lib/glib-missing.h"
#include "lib/iso3166.h"
#include "lib/vendors.h"
#include "lib/utf8.h"
#include "lib/override.h"

Defines

#define D(x)   STRINGIFY(CAT2(entry_result_,x))

Functions

 RCSID ("$Id:search_cb.c, v 1.46 2006/01/21 18:17:51 rmanfredi Exp $")
void refresh_popup (void)
 Activates/deactivates buttons and popups based on what is selected.

void search_gui_set_details (const record_t *rc)
 Set or clear (when rc == NULL) the information about the record.

gint search_cb_autoselect (GtkCTree *ctree, GtkCTreeNode *node)
 Autoselects all searches matching given node in given tree, if the unexpanded root of the tree is selected.

void on_search_popdown_switch (GtkWidget *unused_w, gpointer unused_data)
void on_search_notebook_switch (GtkNotebook *notebook, GtkNotebookPage *unused_page, gint page_num, gpointer unused_udata)
 When the user switches notebook tabs, update the rest of GUI.

void on_clist_search_select_row (GtkCList *clist, gint row, gint unused_column, GdkEvent *unused_event, gpointer unused_udata)
 Changes current search and updates GUI.

void on_search_selected (GtkItem *unused_item, gpointer data)
void on_button_search_clicked (GtkButton *unused_button, gpointer unused_udata)
 Create a search based on query entered.

void on_entry_search_activate (GtkEditable *unused_editable, gpointer unused_udata)
void on_entry_search_changed (GtkEditable *editable, gpointer unused_udata)
 When a search string is entered, activate the search button.

void on_button_search_clear_clicked (GtkButton *unused_button, gpointer unused_udata)
 Clear search results, de-activate clear search button.

void on_button_search_close_clicked (GtkButton *unused_button, gpointer unused_udata)
void on_button_search_download_clicked (GtkButton *unused_button, gpointer unused_udata)
void on_button_search_collapse_all_clicked (GtkButton *unused_button, gpointer unused_udata)
void on_button_search_expand_all_clicked (GtkButton *unused_button, gpointer unused_udata)
gboolean on_clist_search_results_key_press_event (GtkWidget *unused_widget, GdkEventKey *event, gpointer unused_udata)
gboolean on_clist_search_results_button_press_event (GtkWidget *widget, GdkEventButton *event, gpointer unused_udata)
 Handles showing the popup in the event of right-clicks and downloading for double-clicks.

void on_button_search_filter_clicked (GtkButton *unused_button, gpointer unused_udata)
void on_clist_search_results_click_column (GtkCList *clist, gint column, gpointer unused_udata)
 Sort search according to selected column.

void on_ctree_search_results_select_row (GtkCTree *ctree, GList *node, gint unused_column, gpointer unused_udata)
 This function is called when the user selects a row in the search results pane.

void on_ctree_search_results_unselect_row (GtkCTree *unused_ctree, GList *unused_node, gint unused_column, gpointer unused_udata)
void on_ctree_search_results_resize_column (GtkCList *unused_clist, gint column, gint width, gpointer unused_udata)
void on_button_search_passive_clicked (GtkButton *unused_button, gpointer unused_udata)
 Please add comment.

void search_gui_browse_selected (void)
 Request host browsing for the selected entries.

GSList * search_cb_collect_ctree_data (GtkCTree *ctree, GList *node_list, GCompareFunc cfn)
 Given a GList of GtkCTreeNodes, return a new list pointing to the shared record contained by the row data.

void add_filter (filter_t *filter, GFunc filter_add_func, GCompareFunc cfn)
void search_add_filter (GFunc filter_add_func, GCompareFunc cfn)
void global_add_filter (GFunc filter_add_func, GCompareFunc cfn)
void on_popup_search_drop_name_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 For all selected results, create a filter based on name.

void on_popup_search_drop_sha1_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 For all selected results, create a filter based on sha1.

void on_popup_search_drop_host_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 For all selected results, create a filter based on host.

void on_popup_search_drop_name_global_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 For all selected results, create a global filter based on name.

void on_popup_search_drop_sha1_global_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 For all selected results, create a global filter based on sha1.

void on_popup_search_drop_host_global_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 For all selected results, create a global filter based on host.

void on_popup_search_autodownload_name_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_autodownload_sha1_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_new_from_selected_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_edit_filter_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_duplicate_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Create a new search identical to the current search.

void on_popup_search_restart_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_resume_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_stop_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Stop current search.

void on_popup_search_config_cols_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_expand_all_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_collapse_all_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Please add comment.

void on_popup_search_metadata_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)
 Queue a bitzi queries from the search context menu.


Variables

search_t * search_selected


Define Documentation

#define D  )     STRINGIFY(CAT2(entry_result_,x))
 


Function Documentation

void add_filter filter_t filter,
GFunc  filter_add_func,
GCompareFunc  cfn
[static]
 

void global_add_filter GFunc  filter_add_func,
GCompareFunc  cfn
[static]
 

void on_button_search_clear_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

Clear search results, de-activate clear search button.

void on_button_search_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

Create a search based on query entered.

void on_button_search_close_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

void on_button_search_collapse_all_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

void on_button_search_download_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

void on_button_search_expand_all_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

void on_button_search_filter_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

void on_button_search_passive_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

Please add comment.

gboolean on_clist_search_results_button_press_event GtkWidget *  widget,
GdkEventButton *  event,
gpointer  unused_udata
 

Handles showing the popup in the event of right-clicks and downloading for double-clicks.

void on_clist_search_results_click_column GtkCList *  clist,
gint  column,
gpointer  unused_udata
 

Sort search according to selected column.

gboolean on_clist_search_results_key_press_event GtkWidget *  unused_widget,
GdkEventKey *  event,
gpointer  unused_udata
 

void on_clist_search_select_row GtkCList *  clist,
gint  row,
gint  unused_column,
GdkEvent *  unused_event,
gpointer  unused_udata
 

Changes current search and updates GUI.

void on_ctree_search_results_resize_column GtkCList *  unused_clist,
gint  column,
gint  width,
gpointer  unused_udata
 

void on_ctree_search_results_select_row GtkCTree *  ctree,
GList *  node,
gint  unused_column,
gpointer  unused_udata
 

This function is called when the user selects a row in the search results pane.

Autoselection takes place here.

void on_ctree_search_results_unselect_row GtkCTree *  unused_ctree,
GList *  unused_node,
gint  unused_column,
gpointer  unused_udata
 

void on_entry_search_activate GtkEditable *  unused_editable,
gpointer  unused_udata
 

void on_entry_search_changed GtkEditable *  editable,
gpointer  unused_udata
 

When a search string is entered, activate the search button.

void on_popup_search_autodownload_name_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_autodownload_sha1_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_collapse_all_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_config_cols_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_drop_host_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

For all selected results, create a filter based on host.

void on_popup_search_drop_host_global_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

For all selected results, create a global filter based on host.

void on_popup_search_drop_name_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

For all selected results, create a filter based on name.

void on_popup_search_drop_name_global_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

For all selected results, create a global filter based on name.

void on_popup_search_drop_sha1_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

For all selected results, create a filter based on sha1.

void on_popup_search_drop_sha1_global_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

For all selected results, create a global filter based on sha1.

void on_popup_search_duplicate_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Create a new search identical to the current search.

Note:
Doesn't duplicate filters or passive searches yet.

void on_popup_search_edit_filter_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_expand_all_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_metadata_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Queue a bitzi queries from the search context menu.

void on_popup_search_new_from_selected_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_restart_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_resume_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Please add comment.

void on_popup_search_stop_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

Stop current search.

void on_search_notebook_switch GtkNotebook *  notebook,
GtkNotebookPage *  unused_page,
gint  page_num,
gpointer  unused_udata
 

When the user switches notebook tabs, update the rest of GUI.

This may be obsolete as we removed the tabbed interface --Emile 27/12/03

void on_search_popdown_switch GtkWidget *  unused_w,
gpointer  unused_data
 

void on_search_selected GtkItem *  unused_item,
gpointer  data
 

RCSID "$Id:search_cb.  c,
v 1.46 2006/01/21 18:17:51 rmanfredi Exp $" 
 

void refresh_popup void   )  [static]
 

Activates/deactivates buttons and popups based on what is selected.

void search_add_filter GFunc  filter_add_func,
GCompareFunc  cfn
[static]
 

gint search_cb_autoselect GtkCTree *  ctree,
GtkCTreeNode *  node
 

Autoselects all searches matching given node in given tree, if the unexpanded root of the tree is selected.

Otherwise, select only the node on which they clicked.

Returns:
the amount of entries selected.

GSList* search_cb_collect_ctree_data GtkCTree *  ctree,
GList *  node_list,
GCompareFunc  cfn
 

Given a GList of GtkCTreeNodes, return a new list pointing to the shared record contained by the row data.

List will have to be freed later on.

void search_gui_browse_selected void   ) 
 

Request host browsing for the selected entries.

void search_gui_set_details const record_t rc  )  [static]
 

Set or clear (when rc == NULL) the information about the record.


Variable Documentation

search_t* search_selected
 


Generated on Sun Feb 12 10:50:07 2006 for Gtk-Gnutella by doxygen 1.3.6