/*
* setting
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
*
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Contact: MyoungJune Park <mj2004.park@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed under the Flora License, Version 1.1 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://floralicense.org/license/
*
* Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
*/
#include <setting-cfg.h>
#include <setting-reset-settings.h>
-#include <heynoti.h>
#include <Ecore_X.h>
#include <utilX.h>
static void setting_reset_settings_click_softkey_cancel_cb(void *data,
Evas_Object *obj,
void *event_info);
-#if SUPPORT_SECURITY
+
static bool setting_reset_settings_create_password_sg(void *data);
+static void setting_reset_settings_check_state(Setting_Done_List_Data *list_data);
static void setting_reset_settings_result_password_ug_cb(ui_gadget_h ug,
service_h result,
void *priv);
-#endif
-static void setting_reset_settings_check_state(Setting_Done_List_Data *list_data);
/* ***************************************************
*
(Setting_GenGroupItem_Data *) data;
//SETTING_TRACE("part:%s", part);
- if (!safeStrCmp(part, "elm.text.1")) { /* title */
+ if (!safeStrCmp(part, "elm.text") || !safeStrCmp(part, "elm.text.1")) { /* title */
char label[HELP_MSG_BUFF_SIZE + 1] = { 0, };
if (item_data->keyStr)
{
}
if (item_data->sub_desc)
{
- safeStrNCat(label, ": ",HELP_MSG_BUFF_SIZE);
- const char *sub_desc = setting_customize_text(_(item_data->sub_desc), RESULT_FONT_SIZE, NULL, NULL);
+ char desc[SETTING_STR_SLP_LEN + 1] = { 0, };
+ snprintf(desc, SETTING_STR_SLP_LEN, ": %s", _(item_data->sub_desc));
+ const char *sub_desc = setting_customize_text(desc, RESULT_FONT_SIZE, NULL, NULL);
safeStrNCat(label, sub_desc,HELP_MSG_BUFF_SIZE);
FREE(sub_desc);
}
SETTING_TRACE_ERROR("KEY_HOME ungrab error ret[%d]", ret);
}
}
-#endif
-#if SIMPLY_SUPPORT_ALL_RESET
bool __reset_all_idler(void *data)
{
SETTING_TRACE_BEGIN;
}
return FALSE;
}
-#endif
-#if SIMPLY_SUPPORT_ALL_RESET
-static void __reset_all_button_cb(void *data, Evas_Object *obj, void *event_info)
+
+void __reset_all_button_cb(void *data, Evas_Object *obj, void *event_info)
{
SETTING_TRACE_BEGIN;
ret_if(!data);
SettingResetUG *ad = (SettingResetUG *) cb;
Evas_Object *scroller = NULL;
- Evas_Object *controllbar = NULL;
Evas_Object *view_layout = elm_layout_add(ad->win_main_layout);
elm_layout_file_set(view_layout, SETTING_THEME_EDJ_NAME,
evas_object_size_hint_weight_set(view_layout, EVAS_HINT_EXPAND, 0.0);
/* Evas_Object * win_layout, Evas_Object * win_obj */
- setting_push_layout_navi_bar(_(RESET_SETTINGS_STR),
+ Elm_Object_Item *navi_it = setting_push_layout_navi_bar(_(RESET_SETTINGS_STR),
_("IDS_COM_BODY_RESET"),
_("IDS_COM_SK_CANCEL"), NULL,
setting_reset_settings_click_softkey_reset_cb,
setting_reset_settings_click_softkey_cancel_cb,
NULL, ad, view_layout, ad->navi_bar,
- &controllbar);
+ NULL);
/* ******************************************create frame */
Setting_Done_List_Data *list_data = &(ad->list_data); /* define a handle */
list_data->win_main = ad->win_main_layout;
list_data->UG_data = ad;
list_data->ly_parent = view_layout;
- list_data->controllbar = controllbar;
list_data->select_all_checked = EINA_FALSE;
- bool is_emulator = isEmulBin();
+ list_data->navi_it = navi_it;
char *ug_args;
char *item_name;
}
item_name = setting_cfg_get_keyname_idx(i, j);
- if (is_emulator)
+ if (isEmulBin())
{
if (!safeStrCmp(KeyStr_FlightMode, item_name)) {
continue; /* hide Flight Mode in Emulator*/
} else if (!safeStrCmp(KeyStr_WiFi, item_name)) {
continue; /* hide WIFI in Emulator*/
+ } else if (!safeStrCmp(KeyStr_MobileAP, item_name)) {
+ continue; /* hide Tethering in Emulator*/
} else if (!safeStrCmp(KeyStr_WiFiDirect, item_name)) {
continue; /* hide WiFiDirect in Emulator*/
} else if (!safeStrCmp(KeyStr_Network, item_name)) {
continue; /* hide Network in Emulator*/
} else if (!safeStrCmp(KeyStr_Bluetooth, item_name)) {
continue; /* hide Bluetooth in Emulator*/
+ } else if (!safeStrCmp(KeyStr_DateTime, item_name)) {
+ continue; /* hide Date&Time in Emulator*/
} else if (!safeStrCmp(KeyStr_Security, item_name)) {
continue; /* hide Security in Emulator*/
- } else if (!safeStrCmp(KeyStr_Motions, item_name)) {
- continue; /* hide Motion in Emulator*/
- } else if (!safeStrCmp(KeyStr_Accessibility, item_name)) {
- continue; /* hide Accessibility in Emulator*/
} else if (!safeStrCmp(KeyStr_Memory, item_name)) {
continue; /* hide Memory in Emulator*/
} else if (!safeStrCmp(KeyStr_Powersaving, item_name)) {
continue; /* hide Powersaving in Emulator*/
- } else if (safeStrCmp(KeyStr_Email, item_name)) {
+ } else if (!safeStrCmp(KeyStr_Email, item_name)) {
continue;
}
}
list_data->chk_items[idx].ug_args = ug_args;
- list_data->chk_items[idx].item_name = item_name;
+ list_data->chk_items[idx].item_name = item_name =
+ setting_cfg_get_keyname_idx(i, j);
SETTING_TRACE("process %s:\t%s",_(item_name), ug_args);
idx++;
scroller = setting_create_done_list(list_data);
elm_object_part_content_set(view_layout, "elm.swallow.contents", scroller);
+ if(idx == 0 || !setting_done_list_is_some_item_selected(list_data)) {
+ Evas_Object *reset_btn = elm_object_item_part_content_get(navi_it, "toolbar_button1");
+ elm_object_disabled_set(reset_btn, EINA_TRUE);
+ }
+
ad->view_layout = view_layout;
- ad->controllbar = controllbar;
+ ad->reset_list = elm_object_part_content_get(scroller, "search_list");
/* *******************************************update info */
setting_view_reset_settings.is_create = 1;
ad->reset_all_idler = NULL;
}
+ ad->pop_btn = NULL;
+
elm_naviframe_item_pop(ad->navi_bar);
setting_view_reset_settings.is_create = 0;
*general func
*
***************************************************/
+bool __delay_reset_location(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ retv_if(!data, FALSE);
+ Setting_GenGroupItem_Data *item_data = data;
+ int plugin_ret = setting_invoke_reset_function("setting-location-efl", NULL, NULL);
+ SETTING_TRACE("load libug-%s.so[plugin_ret:%d]", "setting-location-efl", plugin_ret);
+ const char *result_str = NULL;
+ if (LOAD_LIB_FAILED == plugin_ret) // -1
+ {
+ result_str = LOAD_LIB_FAILED_STR;
+
+ } else if (UNDEFINED_LIB_SYMBOL == plugin_ret) // -2
+ {
+ result_str = UNDEFINE_STR;
+ } else if (OPERATE_LIB_SUCESS > plugin_ret){ // 0
+ result_str = RESET_FAILED_STR;
+
+ } else {
+ return FALSE;
+ }
+
+ item_data->sub_desc = (char *) g_strdup(_(result_str));
+ elm_object_item_data_set(item_data->item, item_data);
+ elm_genlist_item_update(item_data->item);
+ return FALSE;
+}
static void __reset_an_item(Setting_Done_List_Data *list_data,
const char *item_name,
NULL, NULL, 0,
(char *)item_name,
(char *)result_str, NULL);
- elm_genlist_item_select_mode_set(elm_genlist_item_append(genlist, &(itc_seperator), NULL, NULL,ELM_GENLIST_ITEM_NONE, NULL, NULL),
- ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
} else
{
char *path = get_ug_path_from_ug_args((void *)ug_args);
service_h svc = get_bundle_from_ug_args((void *)ug_args);
-
- int plugin_ret = setting_invoke_reset_function(path, svc, NULL);
- SETTING_TRACE("load libug-%s.so[plugin_ret:%d]", path, plugin_ret);
+ int plugin_ret = OPERATE_LIB_SUCESS;
+ if (!isEmulBin() || 0 != safeStrCmp(KeyStr_Location, item_name)) //KeyStr_Location is too slow to display in emulator
+ {
+ plugin_ret = setting_invoke_reset_function(path, svc, NULL);
+ SETTING_TRACE("load libug-%s.so[plugin_ret:%d]", path, plugin_ret);
+ }
+ else
+ {
+ item_data = setting_create_Gendial_field_def(genlist, &(ad->itc_1text),
+ NULL, ad,
+ SWALLOW_Type_LAYOUT_SPECIALIZTION_X,
+ NULL, NULL, 0,
+ (char *)item_name,
+ (char *)result_str, NULL);
+ ecore_idler_add((Ecore_Task_Cb) __delay_reset_location, item_data);
+
+ service_destroy(svc);
+ FREE(path);
+ return;
+ }
if (LOAD_LIB_FAILED == plugin_ret) // -1
{
NULL, NULL, 0,
(char *)item_name,
(char *)result_str, NULL);
- elm_genlist_item_select_mode_set(elm_genlist_item_append(genlist, &(itc_seperator), NULL, NULL,ELM_GENLIST_ITEM_NONE, NULL, NULL),
- ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
if (item_data)
evas_object_del(ad->pop_progress);
ad->pop_progress = NULL;
}
+ //Evas_Object *btn = elm_object_part_content_get(ad->notify, "button1");
+ if (ad->pop_btn)
+ {
+ setting_enable_evas_object(ad->pop_btn);
+ setting_undo_dim_evas_object(ad->pop_btn, TRUE);
+ }
+
+ Evas_Object *genlist = elm_object_content_get(ad->notify);
+ if(genlist)
+ elm_genlist_item_show(elm_genlist_first_item_get(genlist), ELM_GENLIST_ITEM_SCROLLTO_TOP);
+ if(ad->reset_list)
+ elm_genlist_item_show(elm_genlist_first_item_get(ad->reset_list), ELM_GENLIST_ITEM_SCROLLTO_TOP);
+ if(!setting_done_list_is_some_item_selected(&ad->list_data)) {
+ if (ad->list_data.navi_it) {
+ Evas_Object *button = elm_object_item_part_content_get(ad->list_data.navi_it, "toolbar_button1");
+ elm_object_disabled_set(button, EINA_TRUE);
+ }
+ }
return ECORE_CALLBACK_CANCEL;
}
if (ad->list_data.chk_items[ad->gl_index].data_GenItem->chk_status) {
+ elm_genlist_item_show(ad->list_data.chk_items[ad->gl_index].data_GenItem->item, ELM_GENLIST_ITEM_SCROLLTO_IN);//show the last item
__reset_an_item(&(ad->list_data),
ad->list_data.chk_items[ad->gl_index].item_name,
ad->list_data.chk_items[ad->gl_index].ug_args);
-
/*unselect item*/
elm_check_state_set(ad->list_data.chk_items[ad->gl_index].data_GenItem->eo_check, 0);
ad->list_data.chk_items[ad->gl_index].data_GenItem->chk_status = 0;
SETTING_TRACE_DEBUG("********resetting*******");
SettingResetUG *ad = (SettingResetUG *) list_data->UG_data;
-
- //some item must have been selected, or else cannot go into setting_reset_check_state()
ad->notify = elm_popup_add(ad->win_get);
elm_object_style_set(ad->notify,"menustyle");
elm_object_part_text_set(ad->notify, "title,text", _(RESET_RESULT_STR));
EVAS_HINT_EXPAND);
Evas_Object *btn = setting_create_button(ad->notify, _("IDS_COM_SK_OK"), NULL, setting_reset_result_popup_resp_cb, ad);
elm_object_part_content_set(ad->notify, "button1", btn);
+ elm_object_style_set(btn, "popup_button/default");
+ setting_disable_evas_object(btn);
+ setting_dim_evas_object(btn, TRUE);
+ ad->pop_btn = btn;
Evas_Object *genlist = elm_genlist_add(ad->notify);
elm_object_style_set(genlist, "dialogue");
evas_object_size_hint_align_set(genlist,
EVAS_HINT_FILL,
EVAS_HINT_FILL);
-
- elm_object_content_set(ad->notify, genlist);
- evas_object_show(ad->notify);
-
- ad->pop_progress = setting_create_popup_with_progressbar(ad, ad->win_get,
- "list_process",
- NULL, NULL, NULL, 0, 1, 1);
-
+ /* add separator */
+ setting_create_Gendial_field_titleItem(genlist,
+ &itc_group_item,
+ RESET_RESULT_STR,
+ NULL);
//ad->gl_index = 0;
//ad->animator = ecore_animator_add(__reset_animator_cb, ad);
//Don't append any item until the popup is fully showed up
ecore_idler_add((Ecore_Task_Cb) __reset_delay_idler, ad);
+ elm_object_content_set(ad->notify, genlist);
+ elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
+ evas_object_show(ad->notify);
/* reset sel_all item */
elm_check_state_set(list_data->select_all_checkbox, 0);
}
-#if SUPPORT_SECURITY
static void
setting_reset_settings_result_password_ug_cb(ui_gadget_h ug, service_h result,
void *priv)
case UG_MODE_FULLVIEW:
evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
- elm_win_resize_object_add(ad->win_get, base);
+ //elm_win_resize_object_add(ad->win_get, base);
evas_object_show(base);
break;
default:
return TRUE;
}
-#endif
+
/* ***************************************************
*
*call back func
//int screen_lock_type = 0;
//every time clicking 'Reset' button, restore following VCONFs
- vconf_set_bool(VCONFKEY_SETAPPL_FONT_CHANGED, FALSE);
+ //vconf_set_bool(VCONFKEY_SETAPPL_FONT_CHANGED, FALSE);
if (ad->list_data.selInfoPop) {
evas_object_del(ad->list_data.selInfoPop);
if (!setting_done_list_is_some_item_selected(&(ad->list_data))) {
setting_create_simple_popup(NULL, ad->win_get, NULL, "No item selected");
} else {
-#if SUPPORT_SECURITY
- vconf_get_int(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, &screen_lock_type);
- if(screen_lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD
- || screen_lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD)
- {
- setting_reset_settings_create_password_sg(ad);
- }
- else
- {
-#endif
- setting_reset_settings_check_state(&(ad->list_data));
-#if SUPPORT_SECURITY
- }
-#endif
+
+ setting_reset_settings_check_state(&(ad->list_data));
+
}
}