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

ui/gtk/gtk2/fileinfo.c File Reference


Detailed Description

Displaying of file information in the GUI.

Author:
Richard Eckart
Date:
2003

#include "gtk/gui.h"
#include "downloads_cb.h"
#include "gtk/columns.h"
#include "gtk/drag.h"
#include "gtk/filter.h"
#include "gtk/gtk-missing.h"
#include "gtk/misc.h"
#include "gtk/settings.h"
#include "gtk/statusbar.h"
#include "gtk/visual_progress.h"
#include "if/gui_property.h"
#include "if/gui_property_priv.h"
#include "if/bridge/ui2c.h"
#include "lib/atoms.h"
#include "lib/utf8.h"
#include "lib/url.h"
#include "lib/walloc.h"
#include "lib/glib-missing.h"
#include "lib/override.h"

Data Structures

struct  fileinfo_data
struct  select_by_regex
struct  download_selection

Functions

void fi_gui_clear_data (struct fileinfo_data *data)
void fi_gui_add_file (gnet_fi_t handle)
void fi_gui_free_data (struct fileinfo_data *data)
void fi_gui_remove_data (struct fileinfo_data *data)
fileinfo_dataget_fileinfo_data (GtkTreeModel *model, GtkTreeIter *iter)
gnet_fi_t fi_gui_get_handle (GtkTreeModel *model, GtkTreeIter *iter)
void set_fileinfo_data (struct fileinfo_data *data)
void cell_renderer (GtkTreeViewColumn *column, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer udata)
GtkCellRenderer * create_cell_renderer (gfloat xalign)
void fi_gui_fi_removed (gnet_fi_t handle)
void fi_gui_set_details (gnet_fi_t handle)
void fi_gui_clear_details (void)
void on_treeview_downloads_cursor_changed (GtkTreeView *tv, gpointer unused_udata)
void fi_gui_fill_info (struct fileinfo_data *data)
 Fill in the cell data.
void fi_gui_fill_status (struct fileinfo_data *data)
void fi_gui_update (gnet_fi_t handle, gboolean full)
void fi_gui_update_download (struct download *d)
void fi_gui_fi_added (gnet_fi_t handle)
void fi_gui_fi_status_changed (gnet_fi_t handle)
void fi_gui_fi_status_changed_transient (gnet_fi_t handle)
gboolean fi_gui_update_queued (gpointer key, gpointer unused_value, gpointer unused_udata)
guint fi_gui_relative_done (const struct fileinfo_data *s, gboolean percent)
guint fileinfo_numeric_status (const struct fileinfo_data *data)
gint fileinfo_data_cmp (GtkTreeModel *model, GtkTreeIter *i, GtkTreeIter *j, gpointer user_data)
gboolean fi_gui_update_rank (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer udata)
 Callback handler used with gtk_tree_model_foreach() to record the current rank/position in tree enabling stable sorting.
gboolean on_treeview_downloads_column_clicked (GtkTreeViewColumn *column, gpointer unused_data)
GtkTreeViewColumn * add_column (GtkTreeView *tv, GtkTreeCellDataFunc cell_data_func, gint column_id, const gchar *title, gfloat xalign)
gchar * fi_gui_get_file_url (GtkWidget *widget)
gchar * fi_gui_get_alias (GtkWidget *widget)
void fi_gui_update_display (time_t unused_now)
void fi_gui_init (void)
void fi_handles_shutdown (gpointer key, gpointer value, gpointer unused_data)
void fi_downloads_shutdown (gpointer key, gpointer value, gpointer unused_data)
void fi_gui_shutdown (void)
void fi_gui_add_download (struct download *d)
void fi_gui_remove_download (struct download *d)
void fi_gui_download_set_status (struct download *d, const gchar *s)
gboolean fi_gui_select_by_regex_helper (GtkTreeModel *model, GtkTreePath *unused_path, GtkTreeIter *iter, gpointer user_data)
void fi_gui_select_by_regex (const gchar *regex)
void fi_purge_helper (GtkTreeModel *model, GtkTreePath *unused_path, GtkTreeIter *iter, gpointer user_data)
void fi_gui_purge_select_helper (gpointer key, gpointer unused_value, gpointer data)
void on_button_fi_purge_clicked (GtkButton *unused_button, gpointer unused_udata)
 Handle the clicking of the purge button.
void fi_gui_download_helper (GtkTreeModel *model, GtkTreePath *unused_path, GtkTreeIter *iter, gpointer user_data)
void fi_gui_download_select_helper (gpointer key, gpointer unused_value, gpointer data)
GSList * fi_gui_download_select (gboolean unselect)
void gui_update_download_server (download_t *d)
 Update the server/vendor column of the active downloads treeview.
void gui_update_download_range (download_t *d)
 Update the range column of the active downloads treeview.
void gui_update_download_size (download_t *d)
 Update the size column of the active downloads treeview.
void gui_update_download_host (download_t *d)
 Update the host column of the active downloads treeview.
void on_popup_downloads_copy_magnet_activate (GtkMenuItem *unused_menuitem, gpointer unused_udata)

Variables

gnet_fi_t last_shown = 0
gboolean last_shown_valid = FALSE
GtkTreeView * treeview_downloads
GtkTreeView * treeview_fi_aliases
GtkEntry * entry_fi_filename
GtkLabel * label_fi_sha1
GtkLabel * label_fi_size
GtkTreeStore * store_fileinfo
GtkListStore * store_aliases
GHashTable * fi_handles
GHashTable * fi_updates
GHashTable * fi_downloads


Function Documentation

GtkTreeViewColumn* add_column GtkTreeView *  tv,
GtkTreeCellDataFunc  cell_data_func,
gint  column_id,
const gchar *  title,
gfloat  xalign
[static]
 

void cell_renderer GtkTreeViewColumn *  column,
GtkCellRenderer *  cell,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  udata
[static]
 

GtkCellRenderer* create_cell_renderer gfloat  xalign  )  [static]
 

void fi_downloads_shutdown gpointer  key,
gpointer  value,
gpointer  unused_data
[static]
 

void fi_gui_add_download struct download d  ) 
 

void fi_gui_add_file gnet_fi_t  handle  )  [static]
 

void fi_gui_clear_data struct fileinfo_data data  )  [static]
 

void fi_gui_clear_details void   )  [static]
 

void fi_gui_download_helper GtkTreeModel *  model,
GtkTreePath *  unused_path,
GtkTreeIter *  iter,
gpointer  user_data
[static]
 

GSList* fi_gui_download_select gboolean  unselect  ) 
 

void fi_gui_download_select_helper gpointer  key,
gpointer  unused_value,
gpointer  data
[static]
 

void fi_gui_download_set_status struct download d,
const gchar *  s
 

void fi_gui_fi_added gnet_fi_t  handle  )  [static]
 

void fi_gui_fi_removed gnet_fi_t  handle  )  [static]
 

void fi_gui_fi_status_changed gnet_fi_t  handle  )  [static]
 

void fi_gui_fi_status_changed_transient gnet_fi_t  handle  )  [static]
 

void fi_gui_fill_info struct fileinfo_data data  )  [static]
 

Fill in the cell data.

Calling this will always break the data it filled in last time!

void fi_gui_fill_status struct fileinfo_data data  )  [static]
 

void fi_gui_free_data struct fileinfo_data data  )  [static]
 

gchar* fi_gui_get_alias GtkWidget *  widget  )  [static]
 

gchar* fi_gui_get_file_url GtkWidget *  widget  )  [static]
 

gnet_fi_t fi_gui_get_handle GtkTreeModel *  model,
GtkTreeIter *  iter
[inline, static]
 

void fi_gui_init void   ) 
 

void fi_gui_purge_select_helper gpointer  key,
gpointer  unused_value,
gpointer  data
[static]
 

guint fi_gui_relative_done const struct fileinfo_data s,
gboolean  percent
[inline, static]
 

void fi_gui_remove_data struct fileinfo_data data  )  [static]
 

void fi_gui_remove_download struct download d  ) 
 

void fi_gui_select_by_regex const gchar *  regex  ) 
 

gboolean fi_gui_select_by_regex_helper GtkTreeModel *  model,
GtkTreePath *  unused_path,
GtkTreeIter *  iter,
gpointer  user_data
 

void fi_gui_set_details gnet_fi_t  handle  )  [static]
 

void fi_gui_shutdown void   ) 
 

void fi_gui_update gnet_fi_t  handle,
gboolean  full
[static]
 

void fi_gui_update_display time_t  unused_now  ) 
 

Bug:
FIXME: We should remember for every node when it was last updated and only refresh every node at most once every second. This information should be kept in a struct pointed to by the row user_data and should be automatically freed when removing the row (see upload stats code).

void fi_gui_update_download struct download d  )  [static]
 

gboolean fi_gui_update_queued gpointer  key,
gpointer  unused_value,
gpointer  unused_udata
[static]
 

gboolean fi_gui_update_rank GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  udata
[static]
 

Callback handler used with gtk_tree_model_foreach() to record the current rank/position in tree enabling stable sorting.

void fi_handles_shutdown gpointer  key,
gpointer  value,
gpointer  unused_data
[static]
 

void fi_purge_helper GtkTreeModel *  model,
GtkTreePath *  unused_path,
GtkTreeIter *  iter,
gpointer  user_data
[static]
 

gint fileinfo_data_cmp GtkTreeModel *  model,
GtkTreeIter *  i,
GtkTreeIter *  j,
gpointer  user_data
[static]
 

guint fileinfo_numeric_status const struct fileinfo_data data  )  [inline, static]
 

struct fileinfo_data* get_fileinfo_data GtkTreeModel *  model,
GtkTreeIter *  iter
[inline, static]
 

void gui_update_download_host download_t d  ) 
 

Update the host column of the active downloads treeview.

void gui_update_download_range download_t d  ) 
 

Update the range column of the active downloads treeview.

void gui_update_download_server download_t d  ) 
 

Update the server/vendor column of the active downloads treeview.

void gui_update_download_size download_t d  ) 
 

Update the size column of the active downloads treeview.

void on_button_fi_purge_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

Handle the clicking of the purge button.

Purge the selected file.

void on_popup_downloads_copy_magnet_activate GtkMenuItem *  unused_menuitem,
gpointer  unused_udata
 

gboolean on_treeview_downloads_column_clicked GtkTreeViewColumn *  column,
gpointer  unused_data
[static]
 

void on_treeview_downloads_cursor_changed GtkTreeView *  tv,
gpointer  unused_udata
 

void set_fileinfo_data struct fileinfo_data data  )  [static]
 


Variable Documentation

GtkEntry* entry_fi_filename [static]
 

GHashTable* fi_downloads [static]
 

GHashTable* fi_handles [static]
 

GHashTable* fi_updates [static]
 

GtkLabel* label_fi_sha1 [static]
 

GtkLabel* label_fi_size [static]
 

gnet_fi_t last_shown = 0 [static]
 

gboolean last_shown_valid = FALSE [static]
 

GtkListStore* store_aliases [static]
 

GtkTreeStore* store_fileinfo [static]
 

GtkTreeView* treeview_downloads [static]
 

GtkTreeView* treeview_fi_aliases [static]
 


Generated on Sat Jun 30 17:53:26 2007 for gtk-gnutella by  doxygen 1.3.9.1