Hide FactoryReset in Normal 82/237682/3
authorKiseok Chang <kiso.chang@samsung.com>
Thu, 2 Jul 2020 10:48:54 +0000 (19:48 +0900)
committerKiseok Chang <kiso.chang@samsung.com>
Mon, 6 Jul 2020 07:55:10 +0000 (16:55 +0900)
 - Show FactoryReset menu only when Dev. mode is on

Change-Id: Ib4f8d976ba8a5c2cb38496262782a4e48db4832d
Signed-off-by: Kiseok Chang <kiso.chang@samsung.com>
setting-reset/CMakeLists.txt
setting-reset/src/setting-reset-main.c

index 36e98d134b6697109366a73e2541066400b52e35..3e60fc23c8a22a837cf41a1f6c5c93d06cea3036 100644 (file)
@@ -11,6 +11,7 @@ pkg_check_modules(pkgs_profile REQUIRED
        elementary
        dlog
        dbus-1
+       vconf
 )
 
 FOREACH(flag ${pkgs_profile_CFLAGS})
index 4bcd1961d3a579452ac3cf10f4ce919cf26a4d96..647236a6b97afdee5f71fe519ade296dec368615 100644 (file)
@@ -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);