conf.h File Reference

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

Go to the source code of this file.

Defines

#define KEYS_EREADER   "/apps/er"
#define KEYS_NM   "/system/networking/connections"
#define INI_FILE   MOUNTPOINT_CARD "/System/dr.ini"
#define ERCONFTOOL_EXPORT   "erconftool -c " INI_FILE " -e " KEYS_NM " -e " KEYS_EREADER
#define ERCONFTOOL_IMPORT   "erconftool -c " INI_FILE " -i " KEYS_NM " -i " KEYS_EREADER
#define ERCONFTOOL_DELETE

Functions

void conf_set_services (void)
 Initialize configuration.
gboolean conf_get_first_boot (void)
 Run specials when this is the first boot of the device.
gboolean conf_set_flightmode (gboolean is_enabled)
 Run specials when this is the first boot of the device.
void conf_disabled_sensor_lock (void)
 Read sensor lock settings from registry and set statusbar icon accordingly.
void conf_set_first_boot (gboolean first_boot)
gboolean conf_is_multi_language (void)

Define Documentation

#define ERCONFTOOL_DELETE
Value:
"erconftool -d " KEYS_NM                    \
                                     " -d " KEYS_EREADER "/private"    \
                                     " -d " KEYS_EREADER "/conn_wifi " \
                                     " -d " KEYS_EREADER "/conn_blue"

Definition at line 51 of file conf.h.

Referenced by sys_set_card().

#define ERCONFTOOL_EXPORT   "erconftool -c " INI_FILE " -e " KEYS_NM " -e " KEYS_EREADER

Definition at line 49 of file conf.h.

Referenced by do_unmount().

#define ERCONFTOOL_IMPORT   "erconftool -c " INI_FILE " -i " KEYS_NM " -i " KEYS_EREADER

Definition at line 50 of file conf.h.

Referenced by sys_set_card().

#define INI_FILE   MOUNTPOINT_CARD "/System/dr.ini"

Definition at line 48 of file conf.h.

#define KEYS_EREADER   "/apps/er"

File Name : config.h

Description: GConf handling functions Copyright (C) 2008 iRex Technologies B.V. All rights reserved.

Definition at line 45 of file conf.h.

#define KEYS_NM   "/system/networking/connections"

Definition at line 46 of file conf.h.


Function Documentation

void conf_disabled_sensor_lock ( void   ) 

Read sensor lock settings from registry and set statusbar icon accordingly.

---------------------------------------------------------------------------

Name : conf_disabled_sensor_lock

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 178 of file conf.c.

References g_gconfclient, ipc_menu_set_item_state(), KEY_SENSOR_USE_LOCK_LEFT, KEY_SENSOR_USE_LOCK_MIDDLE, KEY_SENSOR_USE_LOCK_RIGHT, and LOGPRINTF.

Referenced by event_gconf_value_changed(), and on_phase_1_complete().

00179 {
00180     LOGPRINTF("entry");
00181     
00182     gboolean locked;
00183     GError   *error = NULL;
00184 
00185     locked = gconf_client_get_bool(g_gconfclient, KEY_SENSOR_USE_LOCK_LEFT, &error);
00186     if (!error && !locked)
00187     {
00188         locked = gconf_client_get_bool(g_gconfclient, KEY_SENSOR_USE_LOCK_RIGHT, &error);
00189         if (!error && !locked)
00190         {
00191             locked = gconf_client_get_bool(g_gconfclient, KEY_SENSOR_USE_LOCK_MIDDLE, &error);
00192         }
00193     }
00194     
00195     if (error) 
00196     {
00197         g_error_free(error);
00198     }
00199     else if (locked)
00200     {
00201         ipc_menu_set_item_state("lock", "general", "normal");
00202     }
00203     else
00204     {
00205         ipc_menu_set_item_state("lock", "general", "disabled");
00206     }
00207 }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean conf_get_first_boot ( void   ) 

Run specials when this is the first boot of the device.

---------------------------------------------------------------------------

Name : conf_get_first_boot

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 144 of file conf.c.

References g_gconfclient, KEY_GLOBAL_FIRST_BOOT, LOGPRINTF, and WARNPRINTF.

Referenced by start_phase_2(), and sys_standby().

00145 {
00146     LOGPRINTF("entry");
00147 
00148     gboolean     first_boot = FALSE;
00149     GError       *error     = NULL;
00150     
00151     first_boot = gconf_client_get_bool(g_gconfclient, KEY_GLOBAL_FIRST_BOOT, &error);
00152     if (error)
00153     {
00154         WARNPRINTF("error fetching GConf key %s: %s", KEY_GLOBAL_FIRST_BOOT, error->message);
00155         g_error_free(error);
00156     }   
00157     LOGPRINTF("return: %d", first_boot);
00158     
00159     return first_boot;
00160 }

Here is the caller graph for this function:

gboolean conf_is_multi_language ( void   ) 

Definition at line 228 of file conf.c.

References g_number_of_langages.

Referenced by start_phase_2().

00229 {
00230     return (g_number_of_langages > 1);
00231 }

Here is the caller graph for this function:

void conf_set_first_boot ( gboolean  first_boot  ) 

Definition at line 163 of file conf.c.

References g_gconfclient, KEY_GLOBAL_FIRST_BOOT, LOGPRINTF, and WARNPRINTF.

Referenced by sys_starting_finished().

00164 {
00165     LOGPRINTF("entry");
00166 
00167     GError       *error     = NULL;
00168     
00169     gconf_client_set_bool(g_gconfclient, KEY_GLOBAL_FIRST_BOOT, first_boot, &error);
00170     if (error)
00171     {
00172         WARNPRINTF("error writing GConf key %s: %s", KEY_GLOBAL_FIRST_BOOT, error->message);
00173         g_error_free(error);
00174     }   
00175 }

Here is the caller graph for this function:

gboolean conf_set_flightmode ( gboolean  is_enabled  ) 

Run specials when this is the first boot of the device.

---------------------------------------------------------------------------

Name : conf_set_flightmode

Parameters:
[in] is_enabled - TRUE flightmode enabled, no connectivity allowed FALSE flightmode disabled, connectivity allowed
Returns:
TRUE =ok, FALSE = error

--------------------------------------------------------------------------

Definition at line 210 of file conf.c.

References g_gconfclient, KEY_FLIGHTMODE_MODE, LOGPRINTF, and WARNPRINTF.

Referenced by conn_on_statusitem_activated().

00211 {
00212     gboolean ret = TRUE;  // return value, TRUE = ok
00213     GError   *error = NULL;
00214 
00215     LOGPRINTF("entry");
00216 
00217     ret = gconf_client_set_bool(g_gconfclient, KEY_FLIGHTMODE_MODE, is_enabled, &error);
00218     if (error)
00219     {
00220         WARNPRINTF("error saving GConf key %s: %s", KEY_FLIGHTMODE_MODE, error->message);
00221         g_error_free(error);
00222     }
00223 
00224     return ret;
00225 }

Here is the caller graph for this function:

void conf_set_services ( void   ) 

Initialize configuration.

---------------------------------------------------------------------------

Name : conf_set_services

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 112 of file conf.c.

References ERRORPRINTF, event_gconf_value_changed(), g_gconfclient, KEYS_SYSTEM, LOGPRINTF, set_startup_defaults(), and update_installed_locales().

Referenced by main().

00113 {
00114     LOGPRINTF("entry");
00115 
00116     g_type_init();
00117     g_gconfclient = gconf_client_get_default();
00118     if (g_gconfclient==NULL) 
00119     {
00120         ERRORPRINTF("Failed to connect to GConf");
00121         exit(1);
00122     }   
00123     
00124     gconf_client_add_dir(g_gconfclient,
00125                          KEYS_SYSTEM,
00126                          GCONF_CLIENT_PRELOAD_NONE,
00127                          NULL);
00128 
00129     gconf_client_notify_add(g_gconfclient,
00130                             KEYS_SYSTEM,
00131                             event_gconf_value_changed,
00132                             NULL,
00133                             NULL,
00134                             NULL);
00135     
00136     // check locales/languages available on system
00137     update_installed_locales();
00138     
00139     // initialize system settings from startup configuration
00140     set_startup_defaults();
00141 }

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  doxygen 1.6.2-20100208