* - Device Info
* - Name
* - My number
+ * - Get info from SIM card and display it.
+ * - if there's no phone number, it shows 'unavailable'.
* - Model
* - Version
* - Bluetooth
* - Wi-Fi
* - Battery
* - CPU usage
- * - Diagnostics and Usage
* - Software update
* - Certificates
*/
setting_retvm_if(aboutUG->win_main_layout == NULL, NULL,
"cannot get main window ");
+ setting_set_i18n(SETTING_PACKAGE, SETTING_LOCALEDIR);
+
/* register view node table */
setting_view_node_table_intialize();
setting_view_node_table_register(&setting_view_about_main, NULL);
/* creating a view. */
setting_create_Gendial_itc("dialogue/1text", &(aboutUG->itc_1text));
- setting_create_Gendial_itc("dialogue/2text.3", &(aboutUG->itc_2text_2));
- setting_create_Gendial_itc("dialogue/title",
- &(aboutUG->itc_group_item));
- setting_create_Gendial_itc("dialogue/1icon", &(aboutUG->itc_1icon));
- setting_create_Gendial_itc("dialogue/2text.3/expandable",
- &(aboutUG->itc_2text_3_parent));
- setting_create_Gendial_itc("dialogue/1text.1icon/expandable2",
- &(aboutUG->itc_1icon_1text_sub));
- setting_create_Gendial_itc("multiline/1text",
- &(aboutUG->itc_help_style));
-
- aboutUG->itc_seperator.item_style = "dialogue/separator/21/with_line";
+ setting_create_Gendial_itc("dialogue/multiline/2text", &(aboutUG->itc_2text_2));
+ setting_create_Gendial_itc("dialogue/title", &(aboutUG->itc_group_item));
+ setting_create_Gendial_itc("dialogue/2text.3/expandable", &(aboutUG->itc_2text_3_parent));
+ setting_create_Gendial_itc("dialogue/1text.1icon/expandable2", &(aboutUG->itc_1icon_1text_sub));
+ setting_create_Gendial_itc("multiline/1text", &(aboutUG->itc_help_style));
+
+ aboutUG->itc_seperator.item_style = "dialogue/separator";
aboutUG->itc_seperator.func.text_get = NULL;
aboutUG->itc_seperator.func.content_get = NULL;
aboutUG->itc_seperator.func.state_get = NULL;
aboutUG->itc_seperator.func.del = NULL;
+
setting_view_node_set_cur_view(&setting_view_about_main);
setting_view_create(&setting_view_about_main, (void *)aboutUG);
- evas_object_event_callback_add(aboutUG->win_main_layout,
- EVAS_CALLBACK_RESIZE,
- setting_about_ug_cb_resize, aboutUG);
+ evas_object_event_callback_add(aboutUG->win_main_layout, EVAS_CALLBACK_RESIZE, setting_about_ug_cb_resize, aboutUG);
aboutUG->popup_showed_flag = FALSE;
return aboutUG->ly_main;
static void setting_about_ug_on_pause(ui_gadget_h ug, service_h service,
void *priv)
{
+ SETTING_TRACE_BEGIN;
+ SettingAboutUG *SettingAboutUG = priv;
+ SettingAboutUG->pause_flag = TRUE;
}
static void setting_about_ug_on_resume(ui_gadget_h ug, service_h service,
SETTING_TRACE_BEGIN;
setting_retm_if((!priv), "!priv");
SettingAboutUG *aboutUG = priv;
+ aboutUG->pause_flag = FALSE;
char str[MAX_DISPLAY_STR_LEN_ON_PHONE_INFO] = { 0, };
}
}
+static void __about_gl_sel_expand(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ /* SETTING_TRACE_BEGIN; */
+ retm_if(event_info == NULL, "Invalid argument: event info is NULL");
+ Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+ elm_genlist_item_selected_set(item, 0);
+ bool status = !elm_genlist_item_expanded_get(item);
+ elm_genlist_item_expanded_set(item, status);
+}
+
+/**
+ * @see __on_sim_get_msisdn (caller)
+ */
+Eina_Bool __insert_item_idler(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ retv_if(!data, FALSE);
+ SettingAboutUG *ad = data;
+ if (ad->item_dev_name) //the genlist exists already.
+ {
+ SETTING_TRACE("Beging to insert items...");
+ // [UI] My number
+ int err;
+ char sel_num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1] = { 0, };
+ setting_get_string_slp_key(STR_SLP_SETTING_SELECT_NUM, sel_num, &err);
+
+ Setting_GenGroupItem_Data *item_data = NULL;
+ if (ad->my_numbers.count == 1) {
+ item_data = calloc(1, sizeof(Setting_GenGroupItem_Data));
+ setting_retvm_if(!item_data, FALSE, "calloc item_data failed");
+ item_data->keyStr = (char *)g_strdup("IDS_ST_BODY_MY_NUMBER");
+ item_data->sub_desc = (char *)g_strdup(sel_num);
+ item_data->swallow_type = SWALLOW_Type_INVALID;
+
+ item_data->item = elm_genlist_item_insert_after(ad->genlsit, &(ad->itc_2text_2),
+ item_data, NULL,
+ ad->item_dev_name->item,
+ ELM_GENLIST_ITEM_NONE,
+ NULL, NULL);
+ elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ } else if (ad->my_numbers.count > 1) {
+ setting_enable_expandable_genlist(ad->genlsit, ad,
+ setting_about_main_exp_cb, NULL);
+ item_data = calloc(1, sizeof(Setting_GenGroupItem_Data));
+ setting_retvm_if(!item_data, FALSE, "calloc item_data failed");
+ item_data->keyStr = (char *)g_strdup("IDS_ST_BODY_MY_NUMBER");
+ item_data->sub_desc = (char *)g_strdup(sel_num);
+ item_data->swallow_type = SWALLOW_Type_INVALID;
+
+ item_data->int_slp_setting_binded = STR_SLP_SETTING_SELECT_NUM;
+ item_data->item = elm_genlist_item_insert_after(ad->genlsit, &(ad->itc_2text_3_parent),
+ item_data, NULL,
+ ad->item_dev_name->item,
+ ELM_GENLIST_ITEM_TREE,
+ __about_gl_sel_expand, NULL);
+ }
+ }
+
+ return FALSE;
+}
+
+/**
+ * called at initialization of About UG
+ * @see tel_get_sim_msisdn
+ */
static void __on_sim_get_msisdn(TapiHandle *handle, int result, void *data, void *user_data)
{
SETTING_TRACE_BEGIN;
int i =0;
SETTING_TRACE("access_rt[%d]", access_rt);
+
+ //#define TEST
+ #ifndef TEST
memcpy(&(ad->my_numbers), data, sizeof(TelSimMsisdnList_t));
+ #else
+ TelSimMsisdnList_t r_numbers;
+ r_numbers.count = 3;
+ safeCopyStr(r_numbers.list[0].name, "n1", 30);
+ safeCopyStr(r_numbers.list[1].name, "n2", 30);
+ safeCopyStr(r_numbers.list[2].name, "n3", 30);
+ safeCopyStr(r_numbers.list[0].num, "1111111111", 30);
+ safeCopyStr(r_numbers.list[1].num, "2222222222", 30);
+ safeCopyStr(r_numbers.list[2].num, "3333333333", 30);
+ memcpy(&(ad->my_numbers), &r_numbers, sizeof(TelSimMsisdnList_t));
+ #endif
+
+ int err;
+ char sel_num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1] = { 0, };
+ setting_get_string_slp_key(STR_SLP_SETTING_SELECT_NUM, sel_num, &err);
+
+ bool isFound = FALSE;
SETTING_TRACE("ad->my_numbers.count[%d]", ad->my_numbers.count);
- for (i = 0; i < ad->my_numbers.count && i < SETTING_ABOUT_MY_NUMBERS_LEN; i++)
- {
+
+ for (i = 0; i < ad->my_numbers.count && i < SETTING_ABOUT_MY_NUMBERS_LEN; i++) {
SETTING_TRACE("index[%d] - name[%s], num[%s]", i, ad->my_numbers.list[i].name, ad->my_numbers.list[i].num);
+ if (0 == safeStrCmp(sel_num, ad->my_numbers.list[i].num)) {
+ isFound = TRUE;
+ }
+ }
+ if (!isFound && ad->my_numbers.count > 0) {//if not found, set as the first num of returned-list
+ SETTING_TRACE("Selected-num hasn't been found, to let the first one as defalut one");
+ setting_set_string_slp_key(STR_SLP_SETTING_SELECT_NUM, ad->my_numbers.list[0].num, &err);
}
- ad->my_number_sel_idx = 0;//default is 0, need improving
ad->tapi_responsed = TRUE;
if (ad->popup) {
evas_object_del(ad->popup);
ops->priv = aboutUG;
ops->opt = UG_OPT_INDICATOR_ENABLE;
+ // init aboutUG
+
int err = 0;
int value;
setting_get_int_slp_key(INT_SLP_SETTING_SIM_SLOT, &value, &err);
if (VCONFKEY_TELEPHONY_SIM_INSERTED == value)//There is a sim card, so do display to user
{
aboutUG->handle = tel_init(NULL);
+
+
+ SETTING_TRACE("aboutUG->handle:%p", aboutUG->handle);
if (aboutUG->handle) {
SETTING_TRACE("tel_init sucessed, and there is at least one sim card, now trying to get misidns");
if (tel_get_sim_msisdn(aboutUG->handle, __on_sim_get_msisdn, aboutUG) == TAPI_API_SUCCESS) {
SETTING_TRACE("tel_get_sim_msisdn sent");
}
-
}
}
else
SETTING_TRACE_END;
}
+static void __setting_about_sub_list_sel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ SETTING_TRACE_BEGIN;
+ /* error check */
+ retm_if(event_info == NULL, "Invalid argument: event info is NULL");
+ Elm_Object_Item *subitem = (Elm_Object_Item *) event_info;
+ Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subitem);
+ elm_genlist_item_selected_set(subitem, 0);
+ Setting_GenGroupItem_Data *data_subItem = elm_object_item_data_get(subitem);
+ Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem); /* parent data */
+ ret_if(NULL == data_subItem || NULL == data_parentItem);
+
+
+ int err;
+ setting_set_string_slp_key(data_parentItem->int_slp_setting_binded, data_subItem->keyStr, &err);
+ setting_retm_if(0 != err, "Set vconf error[%d]",data_parentItem->int_slp_setting_binded);
+
+ data_parentItem->sub_desc = (char *)g_strdup(_(data_subItem->keyStr));
+ elm_object_item_data_set(data_parentItem->item, data_parentItem);
+ elm_genlist_item_update(data_parentItem->item);
+ elm_radio_value_set(data_subItem->rgd, data_subItem->chk_status);
+}
+
+static void __setting_about_sub_list_rd_change(void *data, Evas_Object *obj, void *event_info)
+
+{
+ SETTING_TRACE_BEGIN;
+ retm_if(data == NULL, "Data parameter is NULL");
+ Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
+
+ Elm_Object_Item *subItem = list_item->item;
+ Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subItem);
+
+ Setting_GenGroupItem_Data *data_subItem = elm_object_item_data_get(subItem); /* subItem data */
+ Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem); /* parent data */
+ ret_if(NULL == data_subItem || NULL == data_parentItem);
+
+ int err;
+ setting_set_string_slp_key(data_parentItem->int_slp_setting_binded, data_subItem->keyStr, &err);
+
+ ret_if(0 != err);
+ data_parentItem->sub_desc = (char *)g_strdup(_(data_subItem->keyStr));
+ elm_object_item_data_set(data_parentItem->item, data_parentItem);
+ elm_genlist_item_update(data_parentItem->item);
+ elm_radio_value_set(obj, data_subItem->chk_status);
+}
+
+void setting_about_main_exp_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ SETTING_TRACE_BEGIN;
+ setting_retm_if(data == NULL, "Data parameter is NULL");
+ setting_retm_if(event_info == NULL, "event_info parameter is NULL");
+
+ SettingAboutUG *ad = (SettingAboutUG *) data;
+ Elm_Object_Item *parentItem = event_info; /* parent item */
+ Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem);
+ Evas_Object *scroller = elm_object_item_widget_get(parentItem);
+
+ Evas_Object *rgd = elm_radio_add(scroller);
+ elm_radio_value_set(rgd, -1);
+
+ int err;
+ char sel_num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1] = { 0, };
+ setting_get_string_slp_key(data_parentItem->int_slp_setting_binded, sel_num, &err);
+ SETTING_TRACE("binded: %d, checked: %s, err: %d", data_parentItem->int_slp_setting_binded, sel_num, err);
+
+ int i = 0;
+ int sel_idx = -1;
+ Setting_GenGroupItem_Data *item_data = NULL;
+
+ for(; i < ad->my_numbers.count; i++) {
+ if (ad->my_numbers.list[i].num == NULL) {
+ break;
+ }
+
+ if (sel_idx == -1 && 0 == safeStrCmp(sel_num, ad->my_numbers.list[i].num)) {
+ sel_idx = i;
+ }
+ item_data = setting_create_Gendial_exp_sub_field(scroller,
+ &(ad->itc_1icon_1text_sub),
+ __setting_about_sub_list_sel_cb, ad, parentItem,
+ SWALLOW_Type_1RADIO, rgd,
+ i,
+ ad->my_numbers.list[i].num, __setting_about_sub_list_rd_change);
+ if (item_data) {
+ item_data->userdata = ad;
+ } else {
+ SETTING_TRACE_ERROR("item_data is NULL");
+ }
+ }
+
+ elm_radio_value_set(rgd, sel_idx);
+}
+
+
/**
* Reset function to 'reset' the settings of the UG, it will be invoked by 'Reset' UG
*