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

ui/gtk/gtk1/fileinfo.c File Reference


Detailed Description

Displaying of file information in the GUI.

Author:
Richard Eckart
Date:
2003

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

Defines

#define CASE(x)

Functions

gchar * fi_gui_get_file_url (GtkWidget *unused_widget)
void on_clist_fileinfo_resize_column (GtkCList *unused_clist, gint column, gint width, gpointer unused_udata)
gnet_fi_info_tfi_gui_fill_info (gnet_fi_t fih, const gchar *titles[c_fi_num])
 Fill in the cell data.
void fi_gui_fill_status (gnet_fi_t fih, const gchar *titles[c_fi_num])
void fi_gui_set_details (gnet_fi_t fih)
 Display details for the given fileinfo entry in the details pane.
void fi_gui_clear_details (void)
 Clear the details pane.
gboolean fi_gui_match_filter (const gchar *s)
void fi_gui_add_row (gnet_fi_t fih)
 Add a fileinfo entry to the list if it matches the currently set row filter.
void fi_gui_remove_row (gnet_fi_t fih, gboolean hide)
 Remove a fileinfo entry from the list.
void fi_gui_set_filter_regex (gchar *s)
 Takes a string containing a regular expression updates the list to only show files matching that expression.
void fi_gui_update (gnet_fi_t fih, gboolean full)
void fi_gui_fi_added (gnet_fi_t fih)
void fi_gui_fi_removed (gnet_fi_t fih)
void fi_gui_fi_status_changed (gnet_fi_t fih)
void fi_gui_fi_status_changed_transient (gnet_fi_t fih)
gboolean fi_gui_update_queued (gpointer key, gpointer unused_value, gpointer unused_udata)
 Hash table iterator to update the display for each queued entry.
void on_clist_fileinfo_select_row (GtkCList *clist, gint row, gint unused_column, GdkEvent *unused_event, gpointer unused_udata)
void on_clist_fileinfo_unselect_row (GtkCList *clist, gint unused_row, gint unused_column, GdkEvent *unused_event, gpointer unused_udata)
void on_button_fi_purge_clicked (GtkButton *unused_button, gpointer unused_udata)
void on_entry_fi_regex_activate (GtkEditable *editable, gpointer unused_udata)
void fi_gui_init (void)
void fi_gui_shutdown (void)
void fi_gui_update_display (time_t now)
guint fi_gui_relative_done (const gnet_fi_status_t *s, gboolean percent)
guint fi_gui_numeric_status (const gnet_fi_status_t *s)
gint fi_gui_cmp_filename (GtkCList *unused_clist, gconstpointer ptr1, gconstpointer ptr2)
gint fi_gui_cmp_size (GtkCList *unused_clist, gconstpointer ptr1, gconstpointer ptr2)
gint fi_gui_cmp_done (GtkCList *unused_clist, gconstpointer ptr1, gconstpointer ptr2)
gint fi_gui_cmp_uploaded (GtkCList *unused_clist, gconstpointer ptr1, gconstpointer ptr2)
gint fi_gui_cmp_sources (GtkCList *unused_clist, gconstpointer ptr1, gconstpointer ptr2)
gint fi_gui_cmp_status (GtkCList *unused_clist, gconstpointer ptr1, gconstpointer ptr2)
void on_clist_fileinfo_click_column (GtkCList *clist, gint column, gpointer unused_udata)

Variables

gnet_fi_t last_shown = 0
gboolean last_shown_valid = FALSE
GHashTable * fi_updates
GSList * visible_fi
GSList * hidden_fi
regex_t filter_re
GtkCList * clist_fileinfo
gnet_fi_info_tlast_fi = NULL


Define Documentation

#define CASE  ) 
 

Value:

case c_fi_ ## x : \
        gtk_clist_set_compare_func(clist, fi_gui_cmp_ ## x ); break;


Function Documentation

void fi_gui_add_row gnet_fi_t  fih  )  [static]
 

Add a fileinfo entry to the list if it matches the currently set row filter.

visible_fi and hidden_fi are properly updated wether the entry is displayed or not and no matter if the line was already shown/hidden or is newly added.

void fi_gui_clear_details void   )  [static]
 

Clear the details pane.

gint fi_gui_cmp_done GtkCList *  unused_clist,
gconstpointer  ptr1,
gconstpointer  ptr2
[static]
 

gint fi_gui_cmp_filename GtkCList *  unused_clist,
gconstpointer  ptr1,
gconstpointer  ptr2
[static]
 

gint fi_gui_cmp_size GtkCList *  unused_clist,
gconstpointer  ptr1,
gconstpointer  ptr2
[static]
 

gint fi_gui_cmp_sources GtkCList *  unused_clist,
gconstpointer  ptr1,
gconstpointer  ptr2
[static]
 

gint fi_gui_cmp_status GtkCList *  unused_clist,
gconstpointer  ptr1,
gconstpointer  ptr2
[static]
 

gint fi_gui_cmp_uploaded GtkCList *  unused_clist,
gconstpointer  ptr1,
gconstpointer  ptr2
[static]
 

void fi_gui_fi_added gnet_fi_t  fih  )  [static]
 

void fi_gui_fi_removed gnet_fi_t  fih  )  [static]
 

void fi_gui_fi_status_changed gnet_fi_t  fih  )  [static]
 

void fi_gui_fi_status_changed_transient gnet_fi_t  fih  )  [static]
 

gnet_fi_info_t* fi_gui_fill_info gnet_fi_t  fih,
const gchar *  titles[c_fi_num]
[static]
 

Fill in the cell data.

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

Warning:
Returns pointer to global data: the gnet_fi_info_t structure filled from the given `fih'.

void fi_gui_fill_status gnet_fi_t  fih,
const gchar *  titles[c_fi_num]
[static]
 

gchar* fi_gui_get_file_url GtkWidget *  unused_widget  )  [static]
 

void fi_gui_init void   ) 
 

gboolean fi_gui_match_filter const gchar *  s  )  [inline, static]
 

Returns:
TRUE if the given string matches with the currntly set row filter. Returns FALSE otherwise.

guint fi_gui_numeric_status const gnet_fi_status_t s  )  [inline, static]
 

guint fi_gui_relative_done const gnet_fi_status_t s,
gboolean  percent
[inline, static]
 

void fi_gui_remove_row gnet_fi_t  fih,
gboolean  hide
[static]
 

Remove a fileinfo entry from the list.

If it is not displayed, then nothing happens. If hide is TRUE, then the row is not unregistered and only moved to the hidden_fi list.

void fi_gui_set_details gnet_fi_t  fih  )  [static]
 

Display details for the given fileinfo entry in the details pane.

It is expected, that the given handle is really used. If not, an assertion will be triggered.

void fi_gui_set_filter_regex gchar *  s  )  [static]
 

Takes a string containing a regular expression updates the list to only show files matching that expression.

void fi_gui_shutdown void   ) 
 

void fi_gui_update gnet_fi_t  fih,
gboolean  full
[static]
 

void fi_gui_update_display time_t  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).

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

Hash table iterator to update the display for each queued entry.

void on_button_fi_purge_clicked GtkButton *  unused_button,
gpointer  unused_udata
 

void on_clist_fileinfo_click_column GtkCList *  clist,
gint  column,
gpointer  unused_udata
 

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

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

void on_clist_fileinfo_unselect_row GtkCList *  clist,
gint  unused_row,
gint  unused_column,
GdkEvent *  unused_event,
gpointer  unused_udata
 

void on_entry_fi_regex_activate GtkEditable *  editable,
gpointer  unused_udata
 


Variable Documentation

GtkCList* clist_fileinfo [static]
 

GHashTable* fi_updates [static]
 

regex_t filter_re [static]
 

GSList* hidden_fi [static]
 

gnet_fi_info_t* last_fi = NULL [static]
 

gnet_fi_t last_shown = 0 [static]
 

gboolean last_shown_valid = FALSE [static]
 

GSList* visible_fi [static]
 


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