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

uploads.c File Reference


Detailed Description

Needs short description here.

Author:
Richard Eckart
Date:
2001-2003

#include "gtk/gui.h"
#include "interface-glade.h"
#include "pbarcellrenderer.h"
#include "gtk/uploads.h"
#include "gtk/uploads_common.h"
#include "gtk/columns.h"
#include "gtk/gtk-missing.h"
#include "gtk/misc.h"
#include "gtk/notebooks.h"
#include "if/gui_property.h"
#include "if/bridge/ui2c.h"
#include "lib/atoms.h"
#include "lib/host_addr.h"
#include "lib/glib-missing.h"
#include "lib/iso3166.h"
#include "lib/misc.h"
#include "lib/tm.h"
#include "lib/walloc.h"
#include "lib/override.h"

Data Structures

struct  remove_row_ctx

Defines

#define UPDATE_MIN   300 /**< Update screen every 5 minutes at least */
 Update screen every 5 minutes at least.

#define COMPARE_FUNC(field)
#define COMPARE_FUNC_END   } }
#define SET(c, x)   case (c): columns[i] = (x); break

Typedefs

typedef remove_row_ctx remove_row_ctx_t

Functions

 RCSID ("$Id:uploads.c, v 1.32 2005/12/11 13:52:52 rmanfredi Exp $")
void uploads_gui_update_upload_info (const gnet_upload_info_t *u)
void uploads_gui_add_upload (gnet_upload_info_t *u)
 Adds the given upload to the gui.

upload_row_data_tfind_upload (gnet_upload_t u)
 Tries to fetch upload_row_data associated with the given upload handle.

gboolean on_button_press_event (GtkWidget *unused_widget, GdkEventButton *event, gpointer unused_udata)
void upload_removed (gnet_upload_t uh, const gchar *reason, guint32 running, guint32 registered)
 Callback: called when an upload is removed from the backend.

void upload_added (gnet_upload_t n, guint32 running, guint32 registered)
 Callback: called when an upload is added from the backend.

upload_row_data_tuploads_gui_get_row_data (gnet_upload_t uhandle)
 Fetch the GUI row data associated with upload handle.

void upload_info_changed (gnet_upload_t u, guint32 running, guint32 registered)
 Callback: called when upload information was changed by the backend.

return host_addr_cmp (rd_a->addr, rd_b->addr)
COMPARE_FUNC_END return CMP (rd_b->size, rd_a->size)
void add_column (gint column_id, GtkTreeIterCompareFunc sortfunc, GtkType column_type)
GtkListStore * create_uploads_model (void)
void uploads_gui_early_init (void)
void uploads_gui_init (void)
void free_row_data (upload_row_data_t *rd, gpointer user_data)
void free_handle (gpointer key, gpointer value, gpointer user_data)
void remove_row (upload_row_data_t *rd, remove_row_ctx_t *ctx)
void update_row (gpointer key, gpointer data, gpointer user_data)
void uploads_gui_update_display (time_t now)
 Update all the uploads at the same time.

gboolean uploads_clear_helper (gpointer user_data)
void uploads_gui_clear_completed (void)
void uploads_gui_shutdown (void)
 Unregister callbacks in the backend and clean up.


Variables

gboolean uploads_remove_lock = FALSE
gboolean uploads_shutting_down = FALSE
GtkTreeView * treeview_uploads = NULL
GtkListStore * store_uploads = NULL
GtkWidget * button_uploads_clear_completed = NULL
GHashTable * upload_handles = NULL
 hash table for fast handle -> GtkTreeIter mapping

GSList * sl_removed_uploads = NULL
 list of all *removed* uploads; contains the handles

const char *const  column_titles [UPLOADS_GUI_VISIBLE_COLUMNS]
COMPARE_FUNC_END filesize_t u = rd_a->range_end - rd_a->range_start
filesize_t v = rd_b->range_end - rd_b->range_start
gint s = CMP(v, u)
 return = s ? s : CMP(rd_a->range_start, rd_b->range_start)


Define Documentation

#define COMPARE_FUNC field   ) 
 

Value:

static gint CAT2(compare_,field)( \
    GtkTreeModel *model, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data) \
{ \
    const upload_row_data_t *rd_a = NULL; \
    const upload_row_data_t *rd_b = NULL; \
    (void) user_data; \
    gtk_tree_model_get(model, a, c_ul_data, &rd_a, (-1)); \
    gtk_tree_model_get(model, b, c_ul_data, &rd_b, (-1)); \
    {

#define COMPARE_FUNC_END   } }
 

#define SET c,
 )     case (c): columns[i] = (x); break
 

#define UPDATE_MIN   300 /**< Update screen every 5 minutes at least */
 

Update screen every 5 minutes at least.


Typedef Documentation

typedef struct remove_row_ctx remove_row_ctx_t
 


Function Documentation

void add_column gint  column_id,
GtkTreeIterCompareFunc  sortfunc,
GtkType  column_type
[static]
 

COMPARE_FUNC_END return CMP rd_b->  size,
rd_a->  size
 

GtkListStore* create_uploads_model void   )  [static]
 

upload_row_data_t* find_upload gnet_upload_t  u  )  [inline, static]
 

Tries to fetch upload_row_data associated with the given upload handle.

Returns:
a pointer the upload_row_data.

void free_handle gpointer  key,
gpointer  value,
gpointer  user_data
[inline, static]
 

void free_row_data upload_row_data_t rd,
gpointer  user_data
[inline, static]
 

return host_addr_cmp rd_a->  addr,
rd_b->  addr
 

gboolean on_button_press_event GtkWidget *  unused_widget,
GdkEventButton *  event,
gpointer  unused_udata
[static]
 

RCSID "$Id:uploads.  c,
v 1.32 2005/12/11 13:52:52 rmanfredi Exp $" 
 

void remove_row upload_row_data_t rd,
remove_row_ctx_t ctx
[inline, static]
 

void update_row gpointer  key,
gpointer  data,
gpointer  user_data
[inline, static]
 

void upload_added gnet_upload_t  n,
guint32  running,
guint32  registered
[static]
 

Callback: called when an upload is added from the backend.

Adds the upload to the gui.

void upload_info_changed gnet_upload_t  u,
guint32  running,
guint32  registered
[static]
 

Callback: called when upload information was changed by the backend.

This updates the upload information in the gui.

void upload_removed gnet_upload_t  uh,
const gchar *  reason,
guint32  running,
guint32  registered
[static]
 

Callback: called when an upload is removed from the backend.

Either immediately clears the upload from the frontend or just set the upload_row_info->valid to FALSE, so we don't accidentally try to use the handle to communicate with the backend.

gboolean uploads_clear_helper gpointer  user_data  )  [static]
 

void uploads_gui_add_upload gnet_upload_info_t u  )  [static]
 

Adds the given upload to the gui.

void uploads_gui_clear_completed void   ) 
 

void uploads_gui_early_init void   ) 
 

upload_row_data_t* uploads_gui_get_row_data gnet_upload_t  uhandle  ) 
 

Fetch the GUI row data associated with upload handle.

void uploads_gui_init void   ) 
 

void uploads_gui_shutdown void   ) 
 

Unregister callbacks in the backend and clean up.

void uploads_gui_update_display time_t  now  ) 
 

Update all the uploads at the same time.

COMPARE_FUNC_END void uploads_gui_update_upload_info const gnet_upload_info_t u  )  [static]
 


Variable Documentation

GtkWidget* button_uploads_clear_completed = NULL [static]
 

const char* const column_titles[UPLOADS_GUI_VISIBLE_COLUMNS] [static]
 

Initial value:

 {
    N_("Filename"),
    N_("Host"),
    N_("Loc"),
    N_("Size"),
    N_("Range"),
    N_("User-Agent"),
    N_("Progress"),

}

return = s ? s : CMP(rd_a->range_start, rd_b->range_start)
 

gint s = CMP(v, u)
 

GSList* sl_removed_uploads = NULL [static]
 

list of all *removed* uploads; contains the handles

GtkListStore* store_uploads = NULL [static]
 

GtkTreeView* treeview_uploads = NULL [static]
 

COMPARE_FUNC_END filesize_t u = rd_a->range_end - rd_a->range_start
 

GHashTable* upload_handles = NULL [static]
 

hash table for fast handle -> GtkTreeIter mapping

gboolean uploads_remove_lock = FALSE [static]
 

gboolean uploads_shutting_down = FALSE [static]
 

filesize_t v = rd_b->range_end - rd_b->range_start
 


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