Preferences

Preferences — Functions to manage preferences

Synopsis


#include <ogmrip-preferences.h>


GConfValue*         (*OGMRipPrefGetFunc)                (GtkWidget *widget);
gboolean            (*OGMRipPrefSetFunc)                (GtkWidget *widget,
                                                         GConfValue *value);
void                ogmrip_preferences_init             (const gchar *dir);
void                ogmrip_preferences_uninit           (void);
GConfValue*         ogmrip_preferences_get              (const gchar *key);
gboolean            ogmrip_preferences_get_bool         (const gchar *key,
                                                         gboolean def);
void                ogmrip_preferences_set_bool         (const gchar *key,
                                                         gboolean value);
gint                ogmrip_preferences_get_int          (const gchar *key,
                                                         gint def);
void                ogmrip_preferences_set_int          (const gchar *key,
                                                         gint value);
gchar*              ogmrip_preferences_get_string       (const gchar *key,
                                                         const gchar *def);
void                ogmrip_preferences_set_string       (const gchar *key,
                                                         const gchar *value);
gchar*              ogmrip_preferences_get_filename     (const gchar *key,
                                                         const gchar *def);
void                ogmrip_preferences_set_filename     (const gchar *key,
                                                         const gchar *value);
guint               ogmrip_preferences_add_notify       (const gchar *key,
                                                         GFunc func,
                                                         gpointer data);
guint               ogmrip_preferences_add_notify_while_alive
                                                        (const gchar *key,
                                                         GFunc func,
                                                         gpointer data,
                                                         gpointer widget);
void                ogmrip_preferences_connect_toggle   (GtkWidget *toggle,
                                                         const gchar *key);
void                ogmrip_preferences_connect_toggle_custom
                                                        (GtkWidget *toggle,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);
void                ogmrip_preferences_connect_combo    (GtkWidget *combo,
                                                         const gchar *key);
void                ogmrip_preferences_connect_combo_custom
                                                        (GtkWidget *combo,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);
void                ogmrip_preferences_connect_chooser  (GtkWidget *chooser,
                                                         const gchar *key);
void                ogmrip_preferences_connect_chooser_custom
                                                        (GtkWidget *chooser,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);
void                ogmrip_preferences_connect_spin     (GtkWidget *spin,
                                                         const gchar *key);
void                ogmrip_preferences_connect_spin_custom
                                                        (GtkWidget *spin,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);
void                ogmrip_preferences_connect_radio    (GtkWidget *radio,
                                                         const gchar *key);
void                ogmrip_preferences_connect_radio_custom
                                                        (GtkWidget *radio,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);

Description

Details

OGMRipPrefGetFunc ()

GConfValue*         (*OGMRipPrefGetFunc)                (GtkWidget *widget);

widget :
Returns :

OGMRipPrefSetFunc ()

gboolean            (*OGMRipPrefSetFunc)                (GtkWidget *widget,
                                                         GConfValue *value);

widget :
value :
Returns :

ogmrip_preferences_init ()

void                ogmrip_preferences_init             (const gchar *dir);

Initialize the preferences system and add add a directory to the list of directories to watch.

dir : directory to add to the list

ogmrip_preferences_uninit ()

void                ogmrip_preferences_uninit           (void);

Uninitialize the preferences system.


ogmrip_preferences_get ()

GConfValue*         ogmrip_preferences_get              (const gchar *key);

Gets the value of a configuration key.

key : key to get
Returns : newly-allocated GConfValue, or NULL if unset and no default exists

ogmrip_preferences_get_bool ()

gboolean            ogmrip_preferences_get_bool         (const gchar *key,
                                                         gboolean def);

Requests the boolean value stored at key.

key : key to get
def : default value
Returns : the value of key, or def if no value was stored

ogmrip_preferences_set_bool ()

void                ogmrip_preferences_set_bool         (const gchar *key,
                                                         gboolean value);

Change the value of key to val. Automatically creates the key if it didn't exist before.

key : key you want to set the value of
value : new value of key

ogmrip_preferences_get_int ()

gint                ogmrip_preferences_get_int          (const gchar *key,
                                                         gint def);

Requests the integer value stored at key.

key : key to get
def : default value
Returns : the value of key, or def if no value was stored

ogmrip_preferences_set_int ()

void                ogmrip_preferences_set_int          (const gchar *key,
                                                         gint value);

Change the value of key to val. Automatically creates the key if it didn't exist before.

key : key you want to set the value of
value : new value of key

ogmrip_preferences_get_string ()

gchar*              ogmrip_preferences_get_string       (const gchar *key,
                                                         const gchar *def);

Requests the string value stored at key.

key : key to get
def : default value
Returns : the value of key, or def if no value was stored

ogmrip_preferences_set_string ()

void                ogmrip_preferences_set_string       (const gchar *key,
                                                         const gchar *value);

Change the value of key to val. Automatically creates the key if it didn't exist before.

key : key you want to set the value of
value : new value of key

ogmrip_preferences_get_filename ()

gchar*              ogmrip_preferences_get_filename     (const gchar *key,
                                                         const gchar *def);

Requests the filename value stored at key.

key : key to get
def : default value
Returns : the value of key, or def if no value was stored

ogmrip_preferences_set_filename ()

void                ogmrip_preferences_set_filename     (const gchar *key,
                                                         const gchar *value);

Change the value of key to val. Automatically creates the key if it didn't exist before.

key : key you want to set the value of
value : new value of key

ogmrip_preferences_add_notify ()

guint               ogmrip_preferences_add_notify       (const gchar *key,
                                                         GFunc func,
                                                         gpointer data);

Request notification of changes to namespace_section. This includes the key namespace_section itself, and any keys below it.

key : where to listen for changes
func : function to call when changes occur
data : user data to pass to func
Returns : a connection ID for removing the notification

ogmrip_preferences_add_notify_while_alive ()

guint               ogmrip_preferences_add_notify_while_alive
                                                        (const gchar *key,
                                                         GFunc func,
                                                         gpointer data,
                                                         gpointer widget);

Request notification of changes to namespace_section. This includes the key namespace_section itself, and any keys below it. The notification is removed when widget is destroyed.

key : where to listen for changes
func : function to call when changes occur
data : user data to pass to func
widget : the widget whose destruction signals the removal of this notification
Returns : a connection ID for removing the notification

ogmrip_preferences_connect_toggle ()

void                ogmrip_preferences_connect_toggle   (GtkWidget *toggle,
                                                         const gchar *key);

Connects toggle to key. key must be associated to a boolean value. See ogmrip_preferences_connect_toggle_custom().

toggle : A GtkToggleButton
key : The associated key

ogmrip_preferences_connect_toggle_custom ()

void                ogmrip_preferences_connect_toggle_custom
                                                        (GtkWidget *toggle,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);

Connects toggle to key. When the state of toggle changes, get_func is called and returns the new value for key. Accordingly, when key changes, set_func is called and sets the new state of toggle.

toggle : A GtkToggleButton
key : The associated key
get_func : The function to get the state of toggle
set_func : The function to set the state of toggle

ogmrip_preferences_connect_combo ()

void                ogmrip_preferences_connect_combo    (GtkWidget *combo,
                                                         const gchar *key);

Connects combo to key. key must be associated to an integer value. See ogmrip_preferences_connect_combo_custom().

combo : A GtkComboBox
key : The associated key

ogmrip_preferences_connect_combo_custom ()

void                ogmrip_preferences_connect_combo_custom
                                                        (GtkWidget *combo,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);

Connects combo to key. When a new item in combo is selected, get_func is called and returns the new value for key. Accordingly, when key changes, set_func is called and sets the new selected item of combo.

combo : A GtkComboBox
key : The associated key
get_func : The function to get the selected item of combo
set_func : The function to set the selected item of combo

ogmrip_preferences_connect_chooser ()

void                ogmrip_preferences_connect_chooser  (GtkWidget *chooser,
                                                         const gchar *key);

Connects chooser to key. key must be associated to an integer value. See ogmrip_preferences_connect_chooser_custom().

chooser : A GtkFileChooser
key : The associated key

ogmrip_preferences_connect_chooser_custom ()

void                ogmrip_preferences_connect_chooser_custom
                                                        (GtkWidget *chooser,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);

Connects chooser to key. When a new file is selected, get_func is called and returns the new value for key. Accordingly, when key changes, set_func is called and selects the file.

chooser : A GtkChooserFile
key : The associated key
get_func : The function to get the selected file of chooser
set_func : The function to set the selected file of chooser

ogmrip_preferences_connect_spin ()

void                ogmrip_preferences_connect_spin     (GtkWidget *spin,
                                                         const gchar *key);

Connects spin to key. key must be associated to an integer value. See ogmrip_preferences_connect_spin_custom().

spin : A GtkSpinButton
key : The associated key

ogmrip_preferences_connect_spin_custom ()

void                ogmrip_preferences_connect_spin_custom
                                                        (GtkWidget *spin,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);

Connects spin to key. When a new value in spin is selected, get_func is called and returns the new value for key. Accordingly, when key changes, set_func is called and sets the new value of spin.

spin : A GtkSpinButton
key : The associated key
get_func : The function to get the value of spin
set_func : The function to set the value of spin

ogmrip_preferences_connect_radio ()

void                ogmrip_preferences_connect_radio    (GtkWidget *radio,
                                                         const gchar *key);

Connects radio to key. key must be associated to an integer value. See ogmrip_preferences_connect_radio_custom().

radio : A GtkRadioButton
key : The associated key

ogmrip_preferences_connect_radio_custom ()

void                ogmrip_preferences_connect_radio_custom
                                                        (GtkWidget *radio,
                                                         const gchar *key,
                                                         OGMRipPrefGetFunc get_func,
                                                         OGMRipPrefSetFunc set_func);

Connects radio to key. When radio is selected, get_func is called and returns the new value for key. Accordingly, when key changes, set_func is called and selects radio if necessary.

radio : A GtkRadioButton
key : The associated key
get_func : The function to get the selected radio
set_func : The function to set the selected radio