void (*ND_PrefsApplyCallback) (GtkWidget *container,
ND_PrefsEntry *entries,
int num_entries);
container :
entries :
num_entries :
ND_UNUSED
#define ND_UNUSED 0
nd_prefs_init ()
void nd_prefs_init (void);
nd_prefs_load ()
void nd_prefs_load (void);
This initializes the preferences as they're found in the
user's config file, which is created if it doesn't yet
exist. Called during Netdude startup. You don't need this.
nd_prefs_get_netdude_dir ()
const char* nd_prefs_get_netdude_dir (void);
The function returns a pointer to static memory containing
the directory to the user's Netdude directory, where
preferences and locally-installed plugins are stored.
Returns :
user's Netdude directory.
nd_prefs_get_config_file ()
const char* nd_prefs_get_config_file (void);
The function returns a pointer to static memory containing
the name of the user's Netdude config file.
The function registers a new preferences domain. Each domain gets
displayed in its own tab in the preferences dialog and is stored
with its own prefix in the config file. container is a widget from
which all other preference widgets can be retrieved via
gtk_object_get_data(), such as a toplevel window when using Glade.
gui is the widget containing the actual preferences widgets, usually
something like a GtkVBox. entries is an array of statically initialized
ND_PrefsEntry items. apply_cb is called when the user applies new
preferences settings and is supposed to contain actions that need
to be carried out when preferences for this domain change. As an
example of all this, see the TCP plugin in nd_tcp_prefs.c.
domain :
name of the domain.
container :
a widget from which the other widgets can be retrieved.
gui :
the GUI widget that contains the preferences widgets.
entries :
array of ND_PrefsEntry structures describing preference settings.
num_entries :
length of entries.
apply_cb :
callback called when new preferences are applied by user.
nd_prefs_save ()
int nd_prefs_save (void);
Returns :
TRUE on success, FALSE otherwise.
nd_prefs_save_general ()
void nd_prefs_save_general (void);
The function saves to disk general settings that are not
directly manipulated by the user through the preferences
dialog, such as load/save directories, recently used files
etc.