#include "setting-common-general-func.h"
#include "setting-common-data-type.h"
#include "setting-common-data-slp-setting.h"
+#include <system_info.h>
#include <vconf.h>
int wifi_toggle_get_state(Cfg_Item_State *stat, void *data);
int drivingmode_toggle_get_state(Cfg_Item_State *stat, void *data);
int network_restriction_mode_toggle_get_state(Cfg_Item_State *stat, void *data);
int nfc_toggle_get_state(Cfg_Item_State *stat, void *data);
-
/*////////////////////////////////////////////////////////////////////////// */
/* wifi - DONE */
EXPORT_PUBLIC
.set_item_state = NULL,
.set_item_update_ui = NULL, };
+/*////////////////////////////////////////////////////////////////////////// */
+
+bool isSupportNFC()
+{
+ bool value;
+ int ret = system_info_get_platform_bool("http://tizen.org/feature/network.nfc", &value);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ return false;
+ return value;
+}
+
+bool isSupportMobileNetwork()
+{
+ bool value;
+ int ret = system_info_get_platform_bool("http://tizen.org/feature/network.telephony", &value);
+ if (ret != SYSTEM_INFO_ERROR_NONE)
+ return false;
+ return value;
+}
+
+bool isSupportStorage()
+{
+#if SUPPORT_STORAGE
+ return true;
+#else
+ return false;
+#endif
+}
+
+/*////////////////////////////////////////////////////////////////////////// */
+
/* create config file from scratch */
static Setting_Cfg_Node_T s_cfg_node_array[] = {
{ KeyStr_Connections, NULL, "move://Tab2.top",
- Cfg_Item_Pos_Level0, Cfg_Item_Title_Node, NULL
+ Cfg_Item_Pos_Level0, Cfg_Item_Title_Node, NULL,
+ NULL
},
{ KeyStr_WiFi,
IMG_WiFi,
"wifi-efl-ug",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
- &wifi_tfunc
+ &wifi_tfunc,
+ NULL
},
{ KeyStr_Bluetooth,
IMG_Bluetooth,
"ug-bluetooth-efl",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
- &bluetooth_tfunc
+ &bluetooth_tfunc,
+ NULL
},
-/*
- { "IDS_SM_HEADER_DATA_USAGE_ABB",
- SETTING_LIST_ICON_PATH_CFG"settings_data_usage.png",
- "org.tizen.setting-data",
- Cfg_Item_Pos_Level0,
- Cfg_Item_Resetable,
- 0,
- Cfg_Item_AppLauncher_Node,
- NULL,
- KeyStr_Device,
- NULL,
- "",
- 0},
-*/
{ KeyStr_FlightMode,
IMG_FlightMode,
"org.tizen.setting-flightmode",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
- &flightmode_tfunc
+ &flightmode_tfunc,
+ NULL
},
{ KeyStr_NFC,
IMG_NFC,
"ug-nfc-efl|type:nfc",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
- &nfc_tfunc
+ &nfc_tfunc,
+ isSupportNFC
},
{ KeyStr_MobileAP,
IMG_MobileAP,
"ug-setting-mobileap-efl",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ KeyStr_MobileNetworks,
"org.tizen.setting-network",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
- NULL
+ NULL,
+ isSupportMobileNetwork
},
{ KeyStr_WebAppAddon,
IMG_Applications,
"NVPDzvckj9.WebAppAddonSetting",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
#ifdef USE_TIZEN_CONNECT
"org.tizen.d2d-conv-setting",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
#endif
/* Group:Device */
{ KeyStr_Device, NULL, "move://Tab3.top", Cfg_Item_Pos_Level0,
- Cfg_Item_Title_Node, NULL
+ Cfg_Item_Title_Node, NULL,
+ NULL
},
{ KeyStr_Sounds,
IMG_Sounds,
"org.tizen.setting-profile",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ KeyStr_Display,
"org.tizen.setting-display|viewtype:main",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ KeyStr_ApplicationsItem,
"org.tizen.setting-applications",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
/* Group: Personal */
{ KeyStr_Personal, NULL, "move://Tab3.top", Cfg_Item_Pos_Level0,
- Cfg_Item_Title_Node, NULL
+ Cfg_Item_Title_Node, NULL,
+ NULL
},
{ KeyStr_Wallpaper,
IMG_Wallpaper,
"org.tizen.wallpaper-ui-service",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ KeyStr_LockScreen,
"org.tizen.ug-lockscreen-options",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ KeyStr_Accessibility,
"org.tizen.accessibility-setting",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
/*Privacy and security */
"org.tizen.setting-privacy",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ KeyStr_Accounts,
"setting-myaccount-efl|mode:account_list",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
/* Group: System */
{ KeyStr_System, NULL, "move://Tab4.top", Cfg_Item_Pos_Level0,
- Cfg_Item_Title_Node, NULL
+ Cfg_Item_Title_Node, NULL,
+ NULL
},
{ KeyStr_LanguageInput,
IMG_LanguageInput,
"org.tizen.setting-language-and-input",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ KeyStr_Battery,
"org.tizen.setting-battery",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ "IDS_ST_BODY_DATA",
"org.tizen.setting-data",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
-#if SUPPORT_STORAGE
{ KeyStr_Storage,
IMG_Storage,
"org.tizen.setting-storage",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
- NULL
+ NULL,
+ isSupportStorage
},
-#endif
{ KeyStr_DateTime,
IMG_DateTime,
"org.tizen.setting-time",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
},
{ KeyStr_AboutDevice,
"org.tizen.setting-about",
Cfg_Item_Pos_Level0,
Cfg_Item_AppLauncher_Node,
+ NULL,
NULL
}
};
retm_if(ad == NULL, "Invalid argument: data is NULL");
do {
- /* Group: */
- if (cfg_node->item_type == Cfg_Item_Title_Node) {
- item = elm_genlist_item_append(ad->md.genlist,
- &(ad->itc_table[GENDIAL_Type_expandable_proc]),
- _(cfg_node->key_name),
- NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_NONE);
- } else { /* Clickable item: */
- icon_path = get_resource_path(cfg_node->icon_path);
- SETTING_TRACE_DEBUG("ICON_PATH: %s", icon_path);
-
- setting_create_Gendial_field_def(
- ad->md.genlist,
- &(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
- setting_main_click_list_cb,
- cfg_node->app_ctl_args,
- SWALLOW_Type_1ICON_1IMAGE,
- icon_path,
- NULL,
- 0,
- cfg_node->key_name,
- NULL,
- NULL);
-
- free(icon_path);
+ if (cfg_node->isvalid == NULL || (*cfg_node->isvalid)()) {
+ /* Group: */
+ if (cfg_node->item_type == Cfg_Item_Title_Node) {
+ item = elm_genlist_item_append(ad->md.genlist,
+ &(ad->itc_table[GENDIAL_Type_expandable_proc]),
+ _(cfg_node->key_name),
+ NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_NONE);
+ } else { /* Clickable item: */
+ icon_path = get_resource_path(cfg_node->icon_path);
+ SETTING_TRACE_DEBUG("ICON_PATH: %s", icon_path);
+
+ setting_create_Gendial_field_def(
+ ad->md.genlist,
+ &(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
+ setting_main_click_list_cb,
+ cfg_node->app_ctl_args,
+ SWALLOW_Type_1ICON_1IMAGE,
+ icon_path,
+ NULL,
+ 0,
+ cfg_node->key_name,
+ NULL,
+ NULL);
+
+ free(icon_path);
+ }
}
cfg_node++;
} while (++i < get_cfg_array_size());