00001 /* 00002 * This file is part of settings. 00003 * 00004 * settings is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * settings is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00031 #include <gtk/gtk.h> 00032 00033 #include <liberregxml/erregapi.h> 00034 #include <libergtk/ergtk.h> 00035 00036 #include "setupLog.h" 00037 #include "settings.h" 00038 #include "iLiadUserData.h" 00039 #include "iLiadConfigData.h" 00040 #include "iLiadBgConnectData.h" 00041 #include "system.h" 00042 #include "iLiadPincodeData.h" 00043 #include "iLiadPCConnectData.h" 00044 #include "iLiadArcLocData.h" 00045 #include "iLiadStartUpData.h" 00046 #include "iLiadTimediDSData.h" 00047 00048 void settings_data_init(void) 00049 { 00050 ST_LOGPRINTF("entry"); 00051 00052 // get settings from registry 00053 iLiad_user_data_init(); 00054 iLiad_config_data_init(); 00055 iLiad_autoconnect_data_init(); 00056 iLiad_pincode_data_init(); 00057 iLiad_pc_connect_data_init(); 00058 iLiad_archive_location_data_init(); 00059 iLiad_startup_data_init(); 00060 iLiad_timedids_data_init(); 00061 } 00062 00063 void settings_data_destroy(void) 00064 { 00065 ST_LOGPRINTF("entry"); 00066 iLiad_config_data_destroy(); 00067 iLiad_pincode_data_destroy(); 00068 iLiad_pc_connect_data_destroy(); 00069 iLiad_archive_location_data_destroy(); 00070 iLiad_startup_data_destroy(); 00071 iLiad_timedids_data_destroy(); 00072 } 00073 00074 00075 void settings_data_store_page(gint page) 00076 { 00077 switch ( page ) 00078 { 00079 case iLiad_user_screen_t: 00080 ST_STOREPRINTF("store iLiad_user_profile values"); 00081 iLiad_user_data_store(); 00082 break; 00083 case iLiad_config_screen_t: 00084 ST_STOREPRINTF("store iLiad_config values"); 00085 iLiad_config_data_store(); 00086 break; 00087 case iLiad_pc_connect_screen_t: 00088 ST_STOREPRINTF("store iLiad_pc_connect values"); 00089 iLiad_pc_connect_data_store(); 00090 break; 00091 case iLiad_autoconnect_screen_t: 00092 ST_STOREPRINTF("store iLiad_autoconnect values"); 00093 iLiad_autoconnect_data_store(); 00094 break; 00095 case iLiad_pincode_screen_t: 00096 ST_STOREPRINTF("store iLiad_pincode values"); 00097 iLiad_pincode_data_store(); 00098 break; 00099 case iLiad_archive_location_screen_t: 00100 ST_STOREPRINTF("store iLiad_archive_location values"); 00101 iLiad_archive_location_data_store(); 00102 break; 00103 case iLiad_startup_screen_t: 00104 ST_STOREPRINTF("store iLiad_startup values"); 00105 iLiad_startup_data_store(); 00106 break; 00107 case iLiad_timedids_screen_t: 00108 ST_STOREPRINTF("store timed-iDS connection settings values"); 00109 iLiad_timedids_data_store(); 00110 break; 00111 case iLiad_datetime_screen_t: 00112 ST_STOREPRINTF("store timezone settings -- do nothing"); 00113 break; 00114 case iLiad_device_overview_screen_t: 00115 ST_STOREPRINTF("store iLiad_device_overview values -- do nothing"); 00116 break; 00117 default: 00118 ST_ERRORPRINTF("page [%d] is UNKNOWN", page); 00119 //terminate application if this point is reached 00120 g_assert_not_reached(); 00121 } 00122 } 00123 00124 void settings_data_store_currentpage() 00125 { 00126 gint current_page = settings_get_current_page(NULL); 00127 00128 settings_data_store_page(current_page); 00129 } 00130
1.5.6