From: Kiseok Chang Date: Thu, 2 Jul 2020 10:48:54 +0000 (+0900) Subject: Hide FactoryReset in Normal X-Git-Tag: submit/tizen/20200706.081230~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c6fe9671412297981baeaa6cdbec91b31c43482;p=profile%2Fcommon%2Fapps%2Fnative%2Fsettings.git Hide FactoryReset in Normal - Show FactoryReset menu only when Dev. mode is on Change-Id: Ib4f8d976ba8a5c2cb38496262782a4e48db4832d Signed-off-by: Kiseok Chang --- diff --git a/setting-reset/CMakeLists.txt b/setting-reset/CMakeLists.txt index 36e98d1..3e60fc2 100644 --- a/setting-reset/CMakeLists.txt +++ b/setting-reset/CMakeLists.txt @@ -11,6 +11,7 @@ pkg_check_modules(pkgs_profile REQUIRED elementary dlog dbus-1 + vconf ) FOREACH(flag ${pkgs_profile_CFLAGS}) diff --git a/setting-reset/src/setting-reset-main.c b/setting-reset/src/setting-reset-main.c index 4bcd196..647236a 100644 --- a/setting-reset/src/setting-reset-main.c +++ b/setting-reset/src/setting-reset-main.c @@ -38,6 +38,11 @@ setting_view setting_view_reset = { static Elm_Genlist_Item_Class itc; + +#define __DEV_OPT + +#ifndef __DEV_OPT + const static struct item items[] = { //TODO add i18n to display_title fields #if 0 @@ -48,6 +53,17 @@ const static struct item items[] = { { "Factory data reset", setting_reset_factory_reset_clicked, NULL}, }; +#else + +#if 0 +const static struct item Item_AllReset; +const static struct item Item_NetworkReset; +#endif +const static struct item Item_ConfigReset = { "Reset initial configuration", setting_reset_initial_config_clicked, NULL}; +const static struct item Item_FactoryReset = { "Factory data reset", setting_reset_factory_reset_clicked, NULL}; + +#endif + static void _dismiss_popup(void *data, Evas_Object *obj, void *event_info) { evas_object_del(obj); @@ -156,6 +172,7 @@ static int setting_reset_create(void *ad) setting_create_Gendial_itc(SETTING_GENLIST_ICON_1LINE_STYLE, &itc); setting_add_back_button(md, _cancel_cb, NULL); +#ifndef __DEV_OPT for (int i = 0; i < ARRAY_SIZE(items); ++i) { const struct item *it = &items[i]; @@ -172,6 +189,41 @@ static int setting_reset_create(void *ad) NULL, NULL); } +#else + const struct item *it = &Item_ConfigReset; + setting_create_Gendial_field_def( + md->genlist, + &itc, + it->select, + md, + SWALLOW_Type_INVALID, + (char*)it->icon, + NULL, + 0, + it->display_title, + NULL, + NULL); + + int stateDeveloperOption; + int err = vconf_get_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE, &stateDeveloperOption); + if (err != 0) { + if(stateDeveloperOption){ + it = &Item_FactoryReset; + setting_create_Gendial_field_def( + md->genlist, + &itc, + it->select, + md, + SWALLOW_Type_INVALID, + (char*)it->icon, + NULL, + 0, + it->display_title, + NULL, + NULL); + } + } +#endif setting_view_reset.is_create = 1; evas_object_show(md->window);