settings_utils.h File Reference

#include <gtk/gtk.h>
Include dependency graph for settings_utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define SETTINGS_GCONF_PATH   "/apps/er/sys/"
#define GCONF_CURRENT_LOCALE   SETTINGS_GCONF_PATH "global/locale"
#define GCONF_LOCALE_LIST   SETTINGS_GCONF_PATH "global/list_locales"
#define GCONF_LANGUAGE_LIST   SETTINGS_GCONF_PATH "global/list_languages"
#define GCONF_ROTATION_DIRECTION   SETTINGS_GCONF_PATH "display/rotation"
#define GCONF_USE_LIGHT   SETTINGS_GCONF_PATH "sensor/use_light"
#define GCONF_USE_SOUND   SETTINGS_GCONF_PATH "sensor/use_sound"
#define GCONF_LOCK_LEFT_SENSOR   SETTINGS_GCONF_PATH "sensor/use_lock_left"
#define GCONF_LOCK_MIDDLE_SENSOR   SETTINGS_GCONF_PATH "sensor/use_lock_middle"
#define GCONF_LOCK_RIGHT_SENSOR   SETTINGS_GCONF_PATH "sensor/use_lock_right"
#define GCONF_FLIGHTMODE_MODE   SETTINGS_GCONF_PATH "flightmode/flightmode_mode"
#define GCONF_PAGETURN_INVERTED   SETTINGS_GCONF_PATH "flipbar/pageturn_inverted"
#define GCONF_IDLE_MODE   SETTINGS_GCONF_PATH "power/idle_mode"
#define GCONF_MIN_STANDBY   SETTINGS_GCONF_PATH "power/min_standby"
#define GCONF_STANDBY_IF_PLUGGED   SETTINGS_GCONF_PATH "power/standby_if_plugged"
#define GCONF_ENABLE_SD_CARD   SETTINGS_GCONF_PATH "ctb/show_sdcard"
#define GCONF_INDEX_WITH_THUMBNAILS   SETTINGS_GCONF_PATH "index/add_with_metadata"
#define UDS_GCONF_PATH   "/apps/er/uds/"
#define GCONF_PAGE_MARGINS   UDS_GCONF_PATH "page_margins"
#define GCONF_ENABLE_ZOOMING   UDS_GCONF_PATH "enable_zooming"
#define GCONF_ENABLE_SCRIBBLE   UDS_GCONF_PATH "enable_scribble"
#define GCONF_DOWNLOAD_ACCOUNT_EMAIL   "/apps/er/private/ids/account/email"
#define GCONF_DOWNLOAD_ACCOUNT_PASSWD   "/apps/er/private/ids/account/password"

Enumerations

enum  DeviceType { IREX_DR800SG, IREX_DR1000, IREX_DR1000S, IREX_DR1000SW }

Functions

GtkWidget * create_separator_widgets ()
void set_popup_window_style (GtkWindow *window)
gboolean set_date_time (time_t t)
void gconf_initialize ()
void gconf_finalize ()
int get_value_int (const char *key)
gboolean set_value_int (const char *key, int new_value)
gboolean get_value_bool (const char *key)
gboolean set_value_bool (const char *key, gboolean new_value)
const char * get_value_string (const char *key)
gboolean set_value_string (const char *key, const char *new_value)
GSList * get_value_string_list (const char *key)
GArray * get_int_array (const gchar *key)
int set_int_array (const gchar *key, const GArray *new_value)

Define Documentation

#define GCONF_CURRENT_LOCALE   SETTINGS_GCONF_PATH "global/locale"

Definition at line 34 of file settings_utils.h.

Referenced by load_language_settings(), and save_language_settings().

#define GCONF_DOWNLOAD_ACCOUNT_EMAIL   "/apps/er/private/ids/account/email"

Definition at line 60 of file settings_utils.h.

Referenced by load_account_settings(), and save_account_settings().

#define GCONF_DOWNLOAD_ACCOUNT_PASSWD   "/apps/er/private/ids/account/password"

Definition at line 61 of file settings_utils.h.

Referenced by load_account_settings(), and save_account_settings().

#define GCONF_ENABLE_SCRIBBLE   UDS_GCONF_PATH "enable_scribble"

Definition at line 58 of file settings_utils.h.

Referenced by load_advanced_settings(), and save_advanced_settings().

#define GCONF_ENABLE_SD_CARD   SETTINGS_GCONF_PATH "ctb/show_sdcard"

Definition at line 52 of file settings_utils.h.

Referenced by load_advanced_settings(), and save_advanced_settings().

#define GCONF_ENABLE_ZOOMING   UDS_GCONF_PATH "enable_zooming"

Definition at line 57 of file settings_utils.h.

Referenced by load_advanced_settings(), and save_advanced_settings().

#define GCONF_FLIGHTMODE_MODE   SETTINGS_GCONF_PATH "flightmode/flightmode_mode"

Definition at line 45 of file settings_utils.h.

Referenced by load_flightmode_settings(), and save_flightmode_settings().

#define GCONF_IDLE_MODE   SETTINGS_GCONF_PATH "power/idle_mode"

Definition at line 48 of file settings_utils.h.

#define GCONF_INDEX_WITH_THUMBNAILS   SETTINGS_GCONF_PATH "index/add_with_metadata"

Definition at line 53 of file settings_utils.h.

Referenced by load_advanced_settings(), and save_advanced_settings().

#define GCONF_LANGUAGE_LIST   SETTINGS_GCONF_PATH "global/list_languages"

Definition at line 36 of file settings_utils.h.

Referenced by get_available_languages().

#define GCONF_LOCALE_LIST   SETTINGS_GCONF_PATH "global/list_locales"

Definition at line 35 of file settings_utils.h.

Referenced by get_available_locales().

#define GCONF_LOCK_LEFT_SENSOR   SETTINGS_GCONF_PATH "sensor/use_lock_left"

Definition at line 41 of file settings_utils.h.

Referenced by load_sensor_settings(), and save_sensor_settings().

#define GCONF_LOCK_MIDDLE_SENSOR   SETTINGS_GCONF_PATH "sensor/use_lock_middle"

Definition at line 42 of file settings_utils.h.

Referenced by load_sensor_settings(), and save_sensor_settings().

#define GCONF_LOCK_RIGHT_SENSOR   SETTINGS_GCONF_PATH "sensor/use_lock_right"

Definition at line 43 of file settings_utils.h.

Referenced by load_sensor_settings(), and save_sensor_settings().

#define GCONF_MIN_STANDBY   SETTINGS_GCONF_PATH "power/min_standby"

Definition at line 49 of file settings_utils.h.

Referenced by load_power_settings(), and save_power_settings().

#define GCONF_PAGE_MARGINS   UDS_GCONF_PATH "page_margins"

Definition at line 56 of file settings_utils.h.

Referenced by load_margins_settings(), and save_margins_settings().

#define GCONF_PAGETURN_INVERTED   SETTINGS_GCONF_PATH "flipbar/pageturn_inverted"

Definition at line 46 of file settings_utils.h.

Referenced by load_flipbar_settings(), and save_flipbar_settings().

#define GCONF_ROTATION_DIRECTION   SETTINGS_GCONF_PATH "display/rotation"

Definition at line 38 of file settings_utils.h.

Referenced by load_rotation_settings(), and save_rotation_settings().

#define GCONF_STANDBY_IF_PLUGGED   SETTINGS_GCONF_PATH "power/standby_if_plugged"

Definition at line 50 of file settings_utils.h.

Referenced by load_power_settings(), and save_power_settings().

#define GCONF_USE_LIGHT   SETTINGS_GCONF_PATH "sensor/use_light"

Definition at line 39 of file settings_utils.h.

Referenced by load_sensor_settings(), and save_sensor_settings().

#define GCONF_USE_SOUND   SETTINGS_GCONF_PATH "sensor/use_sound"

Definition at line 40 of file settings_utils.h.

Referenced by load_sensor_settings(), and save_sensor_settings().

#define SETTINGS_GCONF_PATH   "/apps/er/sys/"

Copyright (C) 2008 iRex Technologies B.V. All rights reserved.

Definition at line 32 of file settings_utils.h.

#define UDS_GCONF_PATH   "/apps/er/uds/"

Definition at line 55 of file settings_utils.h.


Enumeration Type Documentation

enum DeviceType
Enumerator:
IREX_DR800SG 
IREX_DR1000 
IREX_DR1000S 
IREX_DR1000SW 

Definition at line 63 of file settings_utils.h.

00064 {
00065     IREX_DR800SG,
00066     IREX_DR1000,
00067     IREX_DR1000S,
00068     IREX_DR1000SW,
00069 } DeviceType;


Function Documentation

GtkWidget* create_separator_widgets (  ) 

Definition at line 75 of file settings_utils.c.

References SETTINGS_SEPARATOR_HEIGHT.

Referenced by create_account_window(), create_continue_widgets(), create_descriptive_text_widgets(), and create_timezone_widget().

00076 {
00077     GtkWidget* separator = gtk_event_box_new();
00078     gtk_widget_set_name(separator, "irex-settings-separator");
00079     gtk_widget_set_size_request(separator, -1, SETTINGS_SEPARATOR_HEIGHT);
00080     return separator;
00081 }

Here is the caller graph for this function:

void gconf_finalize (  ) 

Definition at line 123 of file settings_utils.c.

References client.

Referenced by main_quit().

00124 {
00125     if (client)
00126     {
00127         g_object_unref(client);
00128         client = NULL;
00129     }
00130 }

Here is the caller graph for this function:

void gconf_initialize (  ) 

Definition at line 115 of file settings_utils.c.

References client.

Referenced by main().

00116 {
00117     if (client == NULL)
00118     {
00119         client = gconf_client_get_default();
00120     }
00121 }

Here is the caller graph for this function:

GArray* get_int_array ( const gchar *  key  ) 

Definition at line 174 of file settings_utils.c.

References client.

Referenced by load_margins_settings().

00175 {
00176     GConfValue *gc_value = NULL;
00177     GArray *ret = NULL;
00178 
00179     g_assert(client);
00180     g_assert(key && *key);
00181 
00182     gc_value = gconf_client_get (client, key, NULL);
00183     if (gc_value == NULL)
00184     {
00185         return NULL;
00186     }
00187 
00188     if (gc_value->type == GCONF_VALUE_LIST
00189         && gconf_value_get_list_type (gc_value) == GCONF_VALUE_INT)
00190     {
00191         GSList *elt;
00192 
00193         ret = g_array_new (FALSE, FALSE, sizeof (gint));
00194         for (elt = gconf_value_get_list (gc_value); 
00195              elt != NULL; 
00196              elt = g_slist_next (elt))
00197         {
00198             int i = gconf_value_get_int ((GConfValue *) elt->data);
00199             g_array_append_val (ret, i);
00200         }
00201     }
00202 
00203     if (gc_value != NULL)
00204     {
00205         gconf_value_free (gc_value);
00206     }
00207     return ret;
00208 }

Here is the caller graph for this function:

gboolean get_value_bool ( const char *  key  ) 

Definition at line 145 of file settings_utils.c.

References client.

Referenced by load_advanced_settings(), load_flightmode_settings(), load_flipbar_settings(), load_power_settings(), and load_sensor_settings().

00146 {
00147     return gconf_client_get_bool(client, key, NULL);
00148 }

Here is the caller graph for this function:

int get_value_int ( const char *  key  ) 

Definition at line 133 of file settings_utils.c.

References client.

Referenced by load_power_settings().

00134 {
00135     return gconf_client_get_int(client, key, NULL);
00136 }

Here is the caller graph for this function:

const char* get_value_string ( const char *  key  ) 

Definition at line 157 of file settings_utils.c.

References client.

Referenced by load_account_settings(), load_language_settings(), and load_rotation_settings().

00158 {
00159     return gconf_client_get_string(client, key, NULL);
00160 }

Here is the caller graph for this function:

GSList* get_value_string_list ( const char *  key  ) 

Definition at line 169 of file settings_utils.c.

References client.

Referenced by get_available_languages(), and get_available_locales().

00170 {
00171     return gconf_client_get_list(client, key, GCONF_VALUE_STRING, NULL);
00172 }

Here is the caller graph for this function:

gboolean set_date_time ( time_t  t  ) 

Definition at line 96 of file settings_utils.c.

References LOGPRINTF.

Referenced by datetime_base_save_datetime().

00097 {
00098     LOGPRINTF("entry");
00099     gboolean ret = TRUE;
00100 #ifndef WIN32
00101     // set system clock 
00102     struct timeval tv;
00103     memset(&tv, 0, sizeof(struct timeval));
00104     tv.tv_sec = t;
00105     ret = (0 == settimeofday(&tv, NULL));
00106     LOGPRINTF("returned %d", ret);
00107 
00108     // synchronise hardware clock
00109     system("/sbin/hwclock -w -u");
00110 #endif
00111     return ret;
00112 }

Here is the caller graph for this function:

int set_int_array ( const gchar *  key,
const GArray *  new_value 
)

Definition at line 210 of file settings_utils.c.

References client.

Referenced by save_margins_settings().

00211 {
00212     gboolean ret = FALSE;
00213     GSList *list = NULL;
00214 
00215     g_assert(client);
00216     g_assert(key && *key);
00217     g_return_val_if_fail(new_value != NULL, FALSE);
00218 
00219     unsigned int i;
00220     for (i = 0; i < new_value->len; i++)
00221     {
00222         gint val = g_array_index (new_value, gint, i);
00223         list = g_slist_append (list, GINT_TO_POINTER(val));
00224     }
00225 
00226     ret = gconf_client_set_list (client, key, GCONF_VALUE_INT, list, NULL);
00227 
00228     g_slist_free (list);
00229 
00230     return ret;
00231 }

Here is the caller graph for this function:

void set_popup_window_style ( GtkWindow *  window  ) 

Definition at line 84 of file settings_utils.c.

00085 {
00086     gtk_window_set_type_hint(window, GDK_WINDOW_TYPE_HINT_DIALOG);
00087     gtk_window_set_decorated(window, FALSE);
00088     gtk_widget_realize(GTK_WIDGET(window));
00089     gdk_window_set_decorations(GTK_WIDGET(window)->window, GDK_DECOR_BORDER);
00090 
00091     // Put the window in the center of its parent.
00092     gtk_window_set_position(window, GTK_WIN_POS_CENTER_ON_PARENT);
00093 }

gboolean set_value_bool ( const char *  key,
gboolean  new_value 
)

Definition at line 151 of file settings_utils.c.

References client.

Referenced by save_advanced_settings(), save_flightmode_settings(), save_flipbar_settings(), save_power_settings(), and save_sensor_settings().

00152 {
00153     return gconf_client_set_bool(client, key, new_value, NULL);
00154 }

Here is the caller graph for this function:

gboolean set_value_int ( const char *  key,
int  new_value 
)

Definition at line 139 of file settings_utils.c.

References client.

Referenced by save_power_settings().

00140 {
00141     return gconf_client_set_int(client, key, new_value, NULL);
00142 }

Here is the caller graph for this function:

gboolean set_value_string ( const char *  key,
const char *  new_value 
)

Definition at line 163 of file settings_utils.c.

References client.

Referenced by save_account_settings(), save_language_settings(), and save_rotation_settings().

00164 {
00165     return gconf_client_set_string(client, key, new_value, NULL);
00166 }

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208