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

settings.c File Reference


Detailed Description

Reflection of changes in backend or gui properties in the GUI.

Author:
Richard Eckart
Date:
2001-2003

#include "gui.h"
#include "settings.h"
#include "monitor.h"
#include "statusbar.h"
#include "search.h"
#include "filter.h"
#include "search_stats.h"
#include "nodes_common.h"
#include "settings_cb.h"
#include "columns.h"
#include "misc.h"
#include "gtk-missing.h"
#include "if/gnet_property.h"
#include "if/gui_property_priv.h"
#include "if/bridge/ui2c.h"
#include "lib/prop.h"
#include "lib/glib-missing.h"
#include "lib/utf8.h"
#include "lib/override.h"

Data Structures

struct  prop_map
 The property maps contain informaiton about which widget should reflect which property. More...


Defines

#define NOT_IN_MAP   (-1)
#define IGNORE   NULL
#define PROP_ENTRY(widget, prop, handler, init, name, freq, interval)

Typedefs

typedef GtkWidget *(* fn_toplevel_t )(void)
typedef prop_map prop_map_t
 The property maps contain informaiton about which widget should reflect which property.


Functions

 RCSID ("$Id:settings.c, v 1.83 2006/01/21 19:04:18 rmanfredi Exp $")
prop_map_tsettings_gui_get_map_entry (property_t prop)
 Fetches a pointer to the map entry which handles the given property.

gboolean gnet_connections_changed (property_t prop)
gboolean downloads_count_changed (property_t prop)
gboolean dl_running_count_changed (property_t prop)
void update_output_bw_display (void)
void update_input_bw_display (void)
GtkWidget * get_main_window (void)
 These functions can fetch the toplevel widget necessary for the stock-callbacks to work.

GtkWidget * get_prefs_dialog (void)
GtkWidget * get_filter_dialog (void)
GtkWidget * get_search_popup (void)
gboolean update_entry (property_t prop)
 Helper function for update_label() and update_entry().

gboolean update_label (property_t prop)
gboolean update_spinbutton (property_t prop)
gboolean update_togglebutton (property_t prop)
gboolean update_multichoice (property_t prop)
gboolean update_entry_duration (property_t prop)
gboolean update_size_entry (property_t prop)
gboolean update_window_geometry (property_t prop)
gboolean update_bandwidth_spinbutton (property_t prop)
 This is not really a generic updater.

gboolean bw_gnet_lin_enabled_changed (property_t prop)
gboolean bw_gnet_lout_enabled_changed (property_t prop)
gboolean bw_http_in_enabled_changed (property_t prop)
gboolean bw_gnet_in_enabled_changed (property_t prop)
gboolean bw_gnet_out_enabled_changed (property_t prop)
gboolean bw_ul_usage_enabled_changed (property_t prop)
gboolean bw_http_out_enabled_changed (property_t prop)
void shrink_frame_status (void)
 Hide the "frame_status_images" frame and show it again, to be able to shrink it back to its minimal size when an icon is removed.

gboolean is_firewalled_changed (property_t unused_prop)
gboolean enable_udp_changed (property_t prop)
gboolean plug_icon_changed (property_t unused_prop)
gboolean update_byte_size_entry (property_t prop)
gboolean update_toggle_remove_on_mismatch (property_t prop)
gboolean update_toggle_node_show_detailed_info (property_t prop)
gboolean update_label_date (property_t prop)
gboolean update_label_duration (property_t prop)
gboolean update_label_yes_or_no (property_t prop)
gboolean update_toggle_node_watch_similar_queries (property_t prop)
gboolean configured_peermode_changed (property_t prop)
gboolean current_peermode_changed (property_t prop)
gboolean monitor_enabled_changed (property_t prop)
void set_host_progress (const gchar *w, guint32 cur, guint32 max)
gboolean hosts_in_catcher_changed (property_t unused_prop)
gboolean hosts_in_ultra_catcher_changed (property_t unused_prop)
gboolean hosts_in_bad_catcher_changed (property_t unused_prop)
gboolean reading_hostfile_changed (property_t prop)
gboolean reading_ultrafile_changed (property_t prop)
gboolean hostcache_size_changed (property_t prop)
gboolean ancient_version_changed (property_t prop)
gboolean overloaded_cpu_changed (property_t prop)
gboolean uploads_stalling_changed (property_t prop)
gboolean file_descriptor_warn_changed (property_t prop)
gboolean ancient_version_left_days_changed (property_t prop)
gboolean new_version_str_changed (property_t prop)
gboolean send_pushes_changed (property_t prop)
gboolean sidebar_visible_changed (property_t prop)
gboolean navtree_visible_changed (property_t prop)
gboolean statusbar_visible_changed (property_t prop)
void update_stats_visibility (GtkCheckMenuItem *cm, GtkWidget *w, gboolean val)
 Change the menu item cm and show/hide the widget w to reflect the value of val.

gboolean progressbar_bws_in_visible_changed (property_t prop)
gboolean progressbar_bws_out_visible_changed (property_t prop)
gboolean progressbar_bws_gin_visible_changed (property_t prop)
gboolean progressbar_bws_gout_visible_changed (property_t prop)
gboolean progressbar_bws_glin_visible_changed (property_t prop)
gboolean progressbar_bws_glout_visible_changed (property_t prop)
gboolean autohide_bws_gleaf_changed (property_t prop)
gboolean progressbar_downloads_visible_changed (property_t prop)
gboolean progressbar_uploads_visible_changed (property_t prop)
gboolean progressbar_connections_visible_changed (property_t prop)
gboolean search_results_show_tabs_changed (property_t prop)
gboolean autoclear_completed_downloads_changed (property_t prop)
gboolean autoclear_failed_downloads_changed (property_t prop)
gboolean autoclear_unavailable_downloads_changed (property_t prop)
gboolean traffic_stats_mode_changed (property_t unused_prop)
gboolean compute_connection_speed_changed (property_t prop)
gboolean min_dup_ratio_changed (property_t prop)
gboolean show_search_results_settings_changed (property_t prop)
gboolean show_dl_settings_changed (property_t prop)
gboolean update_address_information (void)
gboolean spinbutton_input_bw_changed (property_t prop)
gboolean spinbutton_output_bw_changed (property_t prop)
gboolean force_local_addr_changed (property_t prop)
gboolean listen_port_changed (property_t prop)
gboolean local_address_changed (property_t prop)
gboolean use_netmasks_changed (property_t prop)
gboolean guid_changed (property_t prop)
gboolean update_monitor_unstable_ip (property_t prop)
gboolean show_tooltips_changed (property_t prop)
gboolean expert_mode_changed (property_t prop)
gboolean search_stats_mode_changed (property_t prop)
gboolean widget_set_sensitive (const gchar *name, property_t prop)
gboolean sha1_rebuilding_changed (property_t prop)
gboolean sha1_verifying_changed (property_t prop)
gboolean library_rebuilding_changed (property_t prop)
gboolean file_moving_changed (property_t prop)
gboolean dl_active_count_changed (property_t prop)
gboolean dl_http_latency_changed (property_t prop)
gboolean dl_aqueued_count_changed (property_t prop)
gboolean update_spinbutton_ultranode (property_t prop)
gboolean uploads_count_changed (property_t unused_prop)
gboolean clock_skew_changed (property_t prop)
void spinbutton_adjustment_value_changed (GtkAdjustment *adj, gpointer user_data)
 This callbacks is called when a GtkSpinbutton which is referenced in the property_map changed.

void togglebutton_state_changed (GtkToggleButton *tb, gpointer user_data)
 This function is called when the state of a GtkToggleButton that is managed by the property_map.

void multichoice_item_selected (GtkItem *i, gpointer data)
void settings_gui_config_widget (prop_map_t *map, prop_def_t *def)
 Set up tooltip and constraints where applicable.

void settings_gui_save_if_dirty (void)
 Save GUI settings if dirty.

const gchar * settings_gui_config_dir (void)
void settings_gui_init_prop_map (void)
 Use information from property_map to connect callbacks to signals from the backend.

void settings_gui_save_panes (void)
void settings_gui_restore_panes (void)
void settings_gui_init (void)
void settings_gui_shutdown (void)
GtkTooltips * settings_gui_tooltips (void)

Variables

prop_set_stub_tgui_prop_set_stub = NULL
prop_set_stub_tgnet_prop_set_stub = NULL
gint gui_init_list [GUI_PROPERTY_NUM]
gint gnet_init_list [GNET_PROPERTY_NUM]
GtkTooltips * tooltips = NULL
gchar * home_dir = NULL
const gchar property_file [] = "config_gui"
gchar set_tmp [4096]
prop_set_tproperties = NULL
struct {
   const gchar *   name
   const property_t   prop
panes []
prop_map_t property_map []


Define Documentation

#define IGNORE   NULL
 

#define NOT_IN_MAP   (-1)
 

#define PROP_ENTRY widget,
prop,
handler,
init,
name,
freq,
interval   ) 
 

Value:

{                                                                       \
        (widget), (prop), (handler) , (init) , (name), (freq), (interval),  \
        0, NULL , NULL                                                      \
    }                                                                       \


Typedef Documentation

typedef GtkWidget*(* fn_toplevel_t)(void)
 

typedef struct prop_map prop_map_t
 

The property maps contain informaiton about which widget should reflect which property.


Function Documentation

gboolean ancient_version_changed property_t  prop  )  [static]
 

gboolean ancient_version_left_days_changed property_t  prop  )  [static]
 

gboolean autoclear_completed_downloads_changed property_t  prop  )  [static]
 

gboolean autoclear_failed_downloads_changed property_t  prop  )  [static]
 

gboolean autoclear_unavailable_downloads_changed property_t  prop  )  [static]
 

gboolean autohide_bws_gleaf_changed property_t  prop  )  [static]
 

gboolean bw_gnet_in_enabled_changed property_t  prop  )  [static]
 

gboolean bw_gnet_lin_enabled_changed property_t  prop  )  [static]
 

gboolean bw_gnet_lout_enabled_changed property_t  prop  )  [static]
 

gboolean bw_gnet_out_enabled_changed property_t  prop  )  [static]
 

gboolean bw_http_in_enabled_changed property_t  prop  )  [static]
 

gboolean bw_http_out_enabled_changed property_t  prop  )  [static]
 

gboolean bw_ul_usage_enabled_changed property_t  prop  )  [static]
 

gboolean clock_skew_changed property_t  prop  )  [static]
 

gboolean compute_connection_speed_changed property_t  prop  )  [static]
 

gboolean configured_peermode_changed property_t  prop  )  [static]
 

gboolean current_peermode_changed property_t  prop  )  [static]
 

gboolean dl_active_count_changed property_t  prop  )  [static]
 

gboolean dl_aqueued_count_changed property_t  prop  )  [static]
 

gboolean dl_http_latency_changed property_t  prop  )  [static]
 

gboolean dl_running_count_changed property_t  prop  )  [static]
 

gboolean downloads_count_changed property_t  prop  )  [static]
 

gboolean enable_udp_changed property_t  prop  )  [static]
 

gboolean expert_mode_changed property_t  prop  )  [static]
 

gboolean file_descriptor_warn_changed property_t  prop  )  [static]
 

gboolean file_moving_changed property_t  prop  )  [static]
 

gboolean force_local_addr_changed property_t  prop  )  [static]
 

GtkWidget* get_filter_dialog void   )  [static]
 

GtkWidget* get_main_window void   )  [static]
 

These functions can fetch the toplevel widget necessary for the stock-callbacks to work.

Even if you use no stock callback, they are needed for setting the tooltip.

GtkWidget* get_prefs_dialog void   )  [static]
 

GtkWidget* get_search_popup void   )  [static]
 

gboolean gnet_connections_changed property_t  prop  )  [static]
 

gboolean guid_changed property_t  prop  )  [static]
 

gboolean hostcache_size_changed property_t  prop  )  [static]
 

gboolean hosts_in_bad_catcher_changed property_t  unused_prop  )  [static]
 

gboolean hosts_in_catcher_changed property_t  unused_prop  )  [static]
 

gboolean hosts_in_ultra_catcher_changed property_t  unused_prop  )  [static]
 

gboolean is_firewalled_changed property_t  unused_prop  )  [static]
 

gboolean library_rebuilding_changed property_t  prop  )  [static]
 

gboolean listen_port_changed property_t  prop  )  [static]
 

gboolean local_address_changed property_t  prop  )  [static]
 

gboolean min_dup_ratio_changed property_t  prop  )  [static]
 

gboolean monitor_enabled_changed property_t  prop  )  [static]
 

void multichoice_item_selected GtkItem *  i,
gpointer  data
[static]
 

gboolean navtree_visible_changed property_t  prop  )  [static]
 

gboolean new_version_str_changed property_t  prop  )  [static]
 

gboolean overloaded_cpu_changed property_t  prop  )  [static]
 

gboolean plug_icon_changed property_t  unused_prop  )  [static]
 

gboolean progressbar_bws_gin_visible_changed property_t  prop  )  [static]
 

gboolean progressbar_bws_glin_visible_changed property_t  prop  )  [static]
 

gboolean progressbar_bws_glout_visible_changed property_t  prop  )  [static]
 

gboolean progressbar_bws_gout_visible_changed property_t  prop  )  [static]
 

gboolean progressbar_bws_in_visible_changed property_t  prop  )  [static]
 

gboolean progressbar_bws_out_visible_changed property_t  prop  )  [static]
 

gboolean progressbar_connections_visible_changed property_t  prop  )  [static]
 

gboolean progressbar_downloads_visible_changed property_t  prop  )  [static]
 

gboolean progressbar_uploads_visible_changed property_t  prop  )  [static]
 

RCSID "$Id:settings.  c,
v 1.83 2006/01/21 19:04:18 rmanfredi Exp $" 
 

gboolean reading_hostfile_changed property_t  prop  )  [static]
 

gboolean reading_ultrafile_changed property_t  prop  )  [static]
 

gboolean search_results_show_tabs_changed property_t  prop  )  [static]
 

gboolean search_stats_mode_changed property_t  prop  )  [static]
 

gboolean send_pushes_changed property_t  prop  )  [static]
 

void set_host_progress const gchar *  w,
guint32  cur,
guint32  max
[static]
 

const gchar* settings_gui_config_dir void   ) 
 

void settings_gui_config_widget prop_map_t map,
prop_def_t def
[static]
 

Set up tooltip and constraints where applicable.

prop_map_t * settings_gui_get_map_entry property_t  prop  )  [static]
 

Fetches a pointer to the map entry which handles the given property.

This can be use only when settings_gui_init_prop_map has successfully been called before.

void settings_gui_init void   ) 
 

void settings_gui_init_prop_map void   )  [static]
 

Use information from property_map to connect callbacks to signals from the backend.

You can't connect more then one callback to a single property change. You can however IGNORE a property change to suppress a warning in debugging mode. This is done by settings the cb field (callback) in property_map to IGNORE.

The tooltips for the widgets are set from to the description from the property definition.

void settings_gui_restore_panes void   ) 
 

void settings_gui_save_if_dirty void   ) 
 

Save GUI settings if dirty.

void settings_gui_save_panes void   )  [static]
 

void settings_gui_shutdown void   ) 
 

GtkTooltips* settings_gui_tooltips void   ) 
 

gboolean sha1_rebuilding_changed property_t  prop  )  [static]
 

gboolean sha1_verifying_changed property_t  prop  )  [static]
 

gboolean show_dl_settings_changed property_t  prop  )  [static]
 

gboolean show_search_results_settings_changed property_t  prop  )  [static]
 

gboolean show_tooltips_changed property_t  prop  )  [static]
 

void shrink_frame_status void   )  [static]
 

Hide the "frame_status_images" frame and show it again, to be able to shrink it back to its minimal size when an icon is removed.

gboolean sidebar_visible_changed property_t  prop  )  [static]
 

void spinbutton_adjustment_value_changed GtkAdjustment *  adj,
gpointer  user_data
[static]
 

This callbacks is called when a GtkSpinbutton which is referenced in the property_map changed.

It reacts to the "value_changed" signal of the GtkAdjustement associated with the GtkSpinbutton.

gboolean spinbutton_input_bw_changed property_t  prop  )  [static]
 

gboolean spinbutton_output_bw_changed property_t  prop  )  [static]
 

gboolean statusbar_visible_changed property_t  prop  )  [static]
 

void togglebutton_state_changed GtkToggleButton *  tb,
gpointer  user_data
[static]
 

This function is called when the state of a GtkToggleButton that is managed by the property_map.

It is bound during initialization when the property_map is processed. GtkToggleButtons are normally bound directly to thier associated properties. Special cases are handled here.

gboolean traffic_stats_mode_changed property_t  unused_prop  )  [static]
 

gboolean update_address_information void   )  [static]
 

gboolean update_bandwidth_spinbutton property_t  prop  )  [static]
 

This is not really a generic updater.

It's just here because it's used by all bandwidths spinbuttons. It divides the property value by 1024 before setting the value to the widget, just like the callbacks of those widget multiply the widget value by 1024 before setting the property.

gboolean update_byte_size_entry property_t  prop  )  [static]
 

gboolean update_entry property_t  prop  )  [static]
 

Helper function for update_label() and update_entry().

gboolean update_entry_duration property_t  prop  )  [static]
 

void update_input_bw_display void   )  [static]
 

gboolean update_label property_t  prop  )  [static]
 

gboolean update_label_date property_t  prop  )  [static]
 

gboolean update_label_duration property_t  prop  )  [static]
 

gboolean update_label_yes_or_no property_t  prop  )  [static]
 

gboolean update_monitor_unstable_ip property_t  prop  )  [static]
 

gboolean update_multichoice property_t  prop  )  [static]
 

void update_output_bw_display void   )  [static]
 

gboolean update_size_entry property_t  prop  )  [static]
 

gboolean update_spinbutton property_t  prop  )  [static]
 

gboolean update_spinbutton_ultranode property_t  prop  )  [static]
 

void update_stats_visibility GtkCheckMenuItem *  cm,
GtkWidget *  w,
gboolean  val
[static]
 

Change the menu item cm and show/hide the widget w to reflect the value of val.

val = TRUE means w should be visible.

gboolean update_toggle_node_show_detailed_info property_t  prop  )  [static]
 

gboolean update_toggle_node_watch_similar_queries property_t  prop  )  [static]
 

gboolean update_toggle_remove_on_mismatch property_t  prop  )  [static]
 

gboolean update_togglebutton property_t  prop  )  [static]
 

gboolean update_window_geometry property_t  prop  )  [static]
 

gboolean uploads_count_changed property_t  unused_prop  )  [static]
 

gboolean uploads_stalling_changed property_t  prop  )  [static]
 

gboolean use_netmasks_changed property_t  prop  )  [static]
 

gboolean widget_set_sensitive const gchar *  name,
property_t  prop
[inline, static]
 


Variable Documentation

gint gnet_init_list[GNET_PROPERTY_NUM] [static]
 

prop_set_stub_t* gnet_prop_set_stub = NULL [static]
 

gint gui_init_list[GUI_PROPERTY_NUM] [static]
 

prop_set_stub_t* gui_prop_set_stub = NULL [static]
 

gchar* home_dir = NULL [static]
 

const gchar* name
 

const { ... } panes[] [static]
 

const property_t prop
 

prop_set_t* properties = NULL [static]
 

const gchar property_file[] = "config_gui" [static]
 

prop_map_t property_map[] [static]
 

gchar set_tmp[4096] [static]
 

GtkTooltips* tooltips = NULL [static]
 


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