2 * Copyright (c) 2010 Samsung Electronics, Inc.
5 * This software is a confidential and proprietary information
6 * of Samsung Electronics, Inc. ("Confidential Information"). You
7 * shall not disclose such Confidential Information and shall use
8 * it only in accordance with the terms of the license agreement
9 * you entered into with Samsung Electronics.
14 * Created on: Oct 10, 2013
19 #include "setting-reset.h"
23 static void _remove_reset_popup(appdata * ad)
28 evas_object_del(ad->popup);
33 static void _response_cancel_cb(void *data, Evas_Object *obj, void *event_info)
35 appdata * ad = (appdata * )data;
37 _remove_reset_popup(ad);
40 static void _response_ok_cb(void *data, Evas_Object *obj, void *event_info)
44 _remove_reset_popup(ad);
46 /* call Factory-reset */
47 deviced_call_predef_action(PREDEF_FACTORY_RESET, 0, NULL);
50 void _reset_lange_changed(void *data, Evas_Object *obj, void *event_info)
52 DBG("Setting - _reset_lange_changed() is called!");
55 snprintf(buf, sizeof(buf), "<font_size=34>%s</font_size>",
56 elm_entry_utf8_to_markup(_("IDS_ST_POP_ALL_DATA_WILL_BE_ERASED_FROM_GEAR_MEMORY_YOU_CAN_THEN_CONNECT_YOUR_GEAR_TO_ANOTHER_DEVICE")));
57 elm_object_text_set(obj, strdup(buf));
60 void _reset_popup_cb(void *data, Evas_Object *obj, void *event_info)
62 Evas_Object *popup = NULL;
63 Evas_Object *btn = NULL;
64 Evas_Object *scroller = NULL;
65 Evas_Object *label = NULL;
67 appdata *ad = (appdata *) data;
71 popup = elm_popup_add(ad->nf);
72 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
73 elm_object_translatable_part_text_set(popup, "title,text", "IDS_ST_BODY_RESET_GEAR_ABB");
77 scroller = elm_scroller_add(popup);
78 evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
79 elm_object_content_set(popup, scroller);
80 elm_scroller_bounce_set(scroller, EINA_TRUE, EINA_TRUE);
81 elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
82 elm_object_style_set(scroller, "effect");
83 evas_object_show(scroller);
85 label = elm_label_add(scroller);
86 elm_object_style_set(label, "popup/default");
87 elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
91 char * font_size_frame = "<font_size=34>%s</font_size>";
92 snprintf(buf, sizeof(buf)-1, font_size_frame, _("IDS_ST_POP_ALL_DATA_WILL_BE_ERASED_FROM_GEAR_MEMORY_YOU_CAN_THEN_CONNECT_YOUR_GEAR_TO_ANOTHER_DEVICE"));
94 char *txt = strdup(buf);
95 elm_object_text_set(label, txt);
97 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
98 evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
99 evas_object_smart_callback_add(label, "language,changed", _reset_lange_changed, NULL);
100 elm_object_content_set(scroller, label);
101 evas_object_show(label);
104 ea_object_event_callback_add(popup, EA_CALLBACK_BACK, setting_popup_back_cb, ad);
106 btn = elm_button_add(popup);
107 elm_object_style_set(btn, "popup");
108 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
109 elm_object_translatable_text_set(btn, "IDS_COM_SK_CANCEL_A");
110 elm_object_part_content_set(popup, "button1", btn);
111 evas_object_smart_callback_add(btn, "clicked", _response_cancel_cb, ad);
113 btn = elm_button_add(popup);
114 elm_object_style_set(btn, "popup");
115 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
116 elm_object_translatable_text_set(btn, "IDS_WNOTI_BUTTON_OK_ABB2");
117 elm_object_part_content_set(popup, "button2", btn);
118 evas_object_smart_callback_add(btn, "clicked", _response_ok_cb, ad);
120 evas_object_show(popup);