settings/src/iLiadStartUpData.h File Reference

settings - user customized start-up behaviour data More...

#include <liberregxml/erregapi.h>

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define QUICK_START_GUIDE_PATH   "/mnt/free/documents/Reference/10_Quick_Reference"

Functions

void iLiad_startup_data_init (void)
void iLiad_startup_data_destroy (void)
void iLiad_startup_data_store (void)
startup_behaviour_t iLiad_startup_data_get_behaviour (void)
void iLiad_startup_data_set_behaviour (startup_behaviour_t behaviour, const gchar *document_path)


Detailed Description

settings - user customized start-up behaviour data

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

Handling user customized start-up behaviour data.

Definition in file iLiadStartUpData.h.


Define Documentation

#define QUICK_START_GUIDE_PATH   "/mnt/free/documents/Reference/10_Quick_Reference"

Definition at line 41 of file iLiadStartUpData.h.


Function Documentation

void iLiad_startup_data_destroy ( void   ) 

Definition at line 72 of file iLiadStartUpData.c.

00073 {
00074     ST_LOGPRINTF("entry");
00075 
00076     if (g_current_startup)
00077     {
00078         g_free(g_current_startup);
00079         g_current_startup = NULL;
00080     }
00081 
00082     if (g_stored_startup)
00083     {
00084         g_free(g_stored_startup);
00085         g_stored_startup = NULL;
00086     }
00087 }

startup_behaviour_t iLiad_startup_data_get_behaviour ( void   ) 

Definition at line 123 of file iLiadStartUpData.c.

00124 {
00125     ST_LOGPRINTF("entry");
00126 
00127     if (g_current_startup)
00128     {
00129         return g_current_startup->behaviour;
00130     }
00131     else
00132     {
00133         ST_WARNPRINTF("g_current_startup == NULL");
00134         return 0;
00135     }
00136 }

void iLiad_startup_data_init ( void   ) 

Definition at line 51 of file iLiadStartUpData.c.

00052 {
00053     ST_LOGPRINTF("entry");
00054 
00055     iLiad_startup_data_destroy();
00056 
00057     g_current_startup = erRegGetStartUp();
00058     if (g_current_startup == NULL)
00059     {
00060         ST_WARNPRINTF("use default values");
00061 
00062         g_current_startup = g_new0(regStartUp_t, 1);
00063         g_assert(NULL != g_current_startup);
00064         g_current_startup->behaviour = 0;
00065     }
00066     else
00067     {
00068         g_stored_startup = erRegDupStartUp(g_current_startup);
00069     }
00070 }

Here is the call graph for this function:

void iLiad_startup_data_set_behaviour ( startup_behaviour_t  behaviour,
const gchar *  document_path 
)

Definition at line 138 of file iLiadStartUpData.c.

00139 {
00140     ST_LOGPRINTF("entry: behaviour [%d] document_path [%s]", behaviour, document_path);
00141 
00142     g_return_if_fail(g_current_startup != NULL);
00143 
00144     if ((behaviour < 0) || (behaviour >= behaviourUndefined_t))
00145     {
00146         ST_WARNPRINTF("invalid value(%d), return immediately", behaviour);
00147         return;
00148     }
00149     
00150     g_current_startup->behaviour = behaviour;
00151     g_free(g_current_startup->documentPath);
00152     if (document_path)
00153     {
00154         g_current_startup->documentPath = g_strdup(document_path);
00155     }
00156     else
00157     {
00158         g_current_startup->documentPath = NULL;
00159     }
00160 }

void iLiad_startup_data_store ( void   ) 

Definition at line 89 of file iLiadStartUpData.c.

00090 {
00091     gboolean bNeedSave = FALSE;
00092 
00093     ST_LOGPRINTF("entry");
00094     
00095     g_return_if_fail(NULL != g_current_startup);
00096    
00097     // need to save changes or not? 
00098     if (   NULL == g_stored_startup
00099         || g_stored_startup->behaviour != g_current_startup->behaviour
00100         || (g_stored_startup->documentPath  == NULL  &&  g_current_startup->documentPath != NULL)
00101         || (g_stored_startup->documentPath  != NULL  &&  g_current_startup->documentPath == NULL)
00102         || (g_stored_startup->documentPath  != NULL  &&  g_current_startup->documentPath != NULL
00103             && strcmp(g_stored_startup->documentPath, g_current_startup->documentPath) != 0     ) )
00104     {
00105         bNeedSave = TRUE;
00106     }
00107     ST_LOGPRINTF("Need save? %s.", bNeedSave ? "Yes":"No");
00108     
00109     if (bNeedSave)
00110     {
00111         prepare_registry_write();
00112 
00113         ST_STOREPRINTF("calling erRegSetStartUp");
00114         erRegSetStartUp(g_current_startup);
00115 
00116         erRegFreeStartUp(g_stored_startup);
00117         g_stored_startup = erRegDupStartUp(g_current_startup);
00118 
00119         do_registry_write();
00120     }
00121 }

Here is the call graph for this function:


Generated on Sun Dec 14 17:17:20 2008 by  doxygen 1.5.6