SettingAboutUG *ad = (SettingAboutUG*)data;
Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
SETTING_TRACE_DEBUG("ev->key : %s", ev->key);
-
- SETTING_TRACE("ad->item_dev_name->eo_check:%p", ad->item_dev_name->eo_check);
- SETTING_TRACE("obj:%p, %s", obj, elm_entry_entry_get(obj));
if(safeStrCmp(ev->key, "Return") == 0)
{
// if entry has 1 char at list, hide ime.
- if(safeStrLen(elm_entry_entry_get(obj)) > 0)
- {
- ecore_imf_context_input_panel_hide((Ecore_IMF_Context*)elm_entry_imf_context_get(obj));
- }
- else
+ if(safeStrLen(elm_entry_entry_get(obj)) == 0)
{
if (ad->popup) {
evas_object_del(ad->popup);
ad->popup = setting_create_popup_without_btn(ad, ad->win_get, NULL, _(EMPTY_LIMITATION_STR),
__about_popup_rsp_cb, POPUP_INTERVAL, FALSE, FALSE);
}
- } else {
- Evas_Object *entry_container = elm_object_parent_widget_get(obj);
- if(safeStrLen(elm_entry_entry_get(obj)) > 0) {
- elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
- } else {
- //elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
- elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
- }
}
}
-
int setting_about_generate_genlist(void *data)
{
SETTING_TRACE_BEGIN;
__setting_about_device_name_changed_cb);
if (ad->item_dev_name) {
ad->item_dev_name->userdata = ad;
- ad->item_dev_name->isSinglelineFlag = 1;
+ ad->item_dev_name->isSinglelineFlag = 0;
ad->item_dev_name->start_change_cb = (setting_call_back_func)__entry_key_down_cb;
ad->item_dev_name->stop_change_cb = __entry_unfocus_cb;
ad->item_dev_name->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
extern char *safeStrNCat(char *dst, const char *src, int maxlen);
extern char *safeCopyStr(char *dst, const char *src, int maxlen);
extern bool isEmptyStr(const char *str);
+extern char *remove_first_substring(const char *parent, const char *pat);
extern int safeStrLen(const char *str);
extern bool get_substring_int(const char **ipStr, int *ipValue, char delim);
extern bool is_ip_string(const char *ipstr);
char* ug_args = data;
char *ug_name = get_ug_path_from_ug_args(ug_args);
- char ug_file_opt[PATH_MAX];
- if (snprintf(ug_file_opt, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH, ug_name) < 0)
- return false;
-
+ //1.first do exist-checking in /opt/ug/lib
+ char ug_file[PATH_MAX + 1];
+ snprintf(ug_file, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH, ug_name);
struct stat st;
- bool result_opt = false;
-
- if(stat(ug_file_opt, &st) == 0) {
- result_opt = true;
- } else {
- SETTING_TRACE_ERROR(" %s is *NOT* present\n", ug_file_opt);
- result_opt = false;
- }
-
- //-------------------------------------------------------------------------------------
- char ug_file_usr[PATH_MAX];
- bool result_usr = false;
- if (snprintf(ug_file_usr, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH_USR, ug_name) < 0)
- return false;
-
- if(stat(ug_file_usr, &st) == 0) {
- result_usr = true;
- } else {
- SETTING_TRACE_ERROR(" %s is *NOT* present\n", ug_file_usr);
- result_usr = false;
+ if(stat(ug_file, &st) != 0) {
+
+ //2.if it does not exit in /opt/ug/lib, then do exist-checking in /usr/ug/lib
+ memset(ug_file, 0x00, PATH_MAX + 1);
+ snprintf(ug_file, PATH_MAX, "%s/libug-%s.so", SETTING_UG_PATH_USR, ug_name);
+ if(stat(ug_file, &st) != 0) {
+ //both not exist,skip it
+ SETTING_TRACE_ERROR(" libug-%s.so is *NOT* present, so skip it..\n", ug_name);
+ return FALSE;
+ }
}
- // false & false --> false
- // true & false --> true
- // false & true --> true
- // true & true --> true
-
- return (result_usr || result_opt);
+ return TRUE;
}
/*other relative function*/
int setting_set_bool_slp_key(setting_bool_slp_list key, int value, int *err)
{
- SETTING_TRACE_BEGIN;
+ //SETTING_TRACE_BEGIN;
int ret = SETTING_RETURN_FAIL;
/* error check */
ret = set_vconf(g_btable[key],&result);
SETTING_TRACE("setting_set_bool ::: KEY:%d VCONF_KEY=%s TYPE=%d VALUE=%d ", result.key, result.vconf_key, result.type, result.value.b);
- SETTING_TRACE_END;
return ret;
}
int setting_get_bool_slp_key(setting_bool_slp_list key, int *value, int *err)
{
- SETTING_TRACE_BEGIN;
+ //SETTING_TRACE_BEGIN;
int ret = SETTING_RETURN_FAIL;
/* error check */
ret = get_vconf(g_btable[key], &result);
//*value = g_btable[key].value.b;
*value = result.value.b;
- SETTING_TRACE_END;
return ret;
}
int setting_set_int_slp_key(setting_int_slp_list key, int value, int *err)
{
- SETTING_TRACE_BEGIN;
+ //SETTING_TRACE_BEGIN;
int ret = SETTING_RETURN_FAIL;
/* error check */
ret = set_vconf(g_itable[key],&result);
*err = ret;
SETTING_TRACE("setting_set_int ::: KEY:%d VCONF_KEY=%s TYPE=%d VALUE=%d ", result.key, result.vconf_key, result.type, result.value.i);
- SETTING_TRACE_END;
return ret;
}
/* return -1: fail cannot use err to check the result, return value instead*/
int setting_get_int_slp_key(setting_int_slp_list key, int *value, int *err)
{
- SETTING_TRACE_BEGIN;
+ //SETTING_TRACE_BEGIN;
int ret = SETTING_RETURN_FAIL;
/* error check */
*value = result.value.i;
*err = ret;
- SETTING_TRACE_END;
return ret;
}
int setting_get_string_slp_key(setting_str_slp_list key, char *value, int *err)
{
- SETTING_TRACE_BEGIN;
+ //SETTING_TRACE_BEGIN;
int ret = SETTING_RETURN_FAIL;
/* error check */
SETTING_TRACE("get_vconf is failed");
}
*err = ret;
- SETTING_TRACE_END;
return ret;
}
node = (Vconf_Change_Node *) eina_list_data_get(li);
if (node)
{
- SETTING_TRACE("Deregister callback[%p] of %s", node->cb, node->in_key);
+ //SETTING_TRACE("Deregister callback[%p] of %s", node->cb, node->in_key);
if (node->in_key && node->cb) {
(void)vconf_ignore_key_changed(node->in_key, node->cb);
FREE(node);
if(0 == vconf_notify_key_changed(vconf, cb, data))
{
- SETTING_TRACE("Register callback[%p] of %s", node->cb, node->in_key);
+ //SETTING_TRACE("Register callback[%p] of %s", node->cb, node->in_key);
*listened_list = eina_list_append(*listened_list, node);
}
else
static void __entry_changed(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
+ SETTING_TRACE_BEGIN;
Setting_GenGroupItem_Data *list_item =
(Setting_GenGroupItem_Data *) data;
list_item->sub_desc = (char *)g_strdup(elm_entry_entry_get(obj));
}
else
{
- elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
- elm_object_signal_emit(entry_container, "elm,state,eraser,show", "elm");
+ if (elm_object_focus_get(obj)) //only do when entry is focused
+ {
+ elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
+ elm_object_signal_emit(entry_container, "elm,state,eraser,show", "elm");
+ }
}
}
}
static void __entry_unfocused(void *data, Evas_Object *obj, void *event_info) // Unfocused callback will show guidetext and hide X marked button.
{
ret_if(!data);
+ SETTING_TRACE_BEGIN;
Evas_Object *entry_container = data;
//whe entry unfocused, its guidetext will becomes "Input here"
elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
static void __entry_focused(void *data, Evas_Object *obj, void *event_info) // Focused callback will show X marked button and hide guidetext.
{
ret_if(!data);
+ SETTING_TRACE_BEGIN;
Evas_Object *entry_container = data;
//whe entry focused, its guidetext will becomes "Input here"
elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
static void __entry_keydown(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
ret_if(event_info == NULL);
- Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
- SETTING_TRACE_DEBUG("ev->key : %s", ev->key);
- SETTING_TRACE("obj:%p, %s", obj, elm_entry_entry_get(obj));
-
- Evas_Object *entry_container = elm_object_parent_widget_get(obj);
- if(safeStrLen(elm_entry_entry_get(obj)) > 0) {
- elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
+ Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
+ if(safeStrCmp(ev->key, "Return") == 0) //to disable the 'Enter' orginal function
+ {
+ SETTING_TRACE("ENTER %s ev->key:%s", __FUNCTION__, ev->key);
+ //hide the eraser button
+ //format like:xx<br/>
+ const char *entry_str = remove_first_substring(elm_entry_entry_get(obj), "<br/>");
+ elm_entry_entry_set(obj, entry_str);
+ FREE(entry_str);
+ elm_entry_cursor_end_set(obj);
+ setting_hide_input_pannel_cb(obj);
} else {
- //elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
- elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
+ Evas_Object *entry_container = elm_object_parent_widget_get(obj);
+ if(safeStrLen(elm_entry_entry_get(obj)) > 0) {
+ elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
+ } else {
+ elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
+ }
}
+
}
/**
evas_object_smart_callback_add(entry, "focused", __entry_focused, ed_name);
elm_object_signal_callback_add(ed_name, "elm,eraser,clicked", "elm", __eraser_clicked, entry);
- Evas_Object_Event_Cb key_down_cb = __entry_keydown;
if (item_data->start_change_cb) {
- key_down_cb = (Evas_Object_Event_Cb)(item_data->start_change_cb);
+ evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, (Evas_Object_Event_Cb)(item_data->start_change_cb), item_data->userdata);
}
- evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, key_down_cb, item_data->userdata);
-
+ evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, __entry_keydown, item_data);
+
if (item_data->input_panel_disable_flag) {
elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
}
return FALSE;
}
+//remove sub string from a parent string
+char *remove_first_substring(const char *parent, const char *pat)
+{
+ setting_retvm_if(!parent, NULL, "NULL == parent, Exit %s with return NULL", __FUNCTION__);
+ char *str = strdup(parent); //to process the case parent pointing to const string
+ setting_retvm_if(!pat, str, "NULL == pat, Exit %s with return [%s]", __FUNCTION__, str);
+
+ int idx = 0;
+ int str_len = safeStrLen(str);
+ int pat_len = safeStrLen(pat);
+ setting_retvm_if(pat_len > str_len, str,
+ "patlen[%d] > strlen[%d], Exit %s with return [%s]",
+ pat_len, str_len, __FUNCTION__, str);
+ char *p = NULL;
+ char *q = NULL;
+ for (; idx < str_len; idx++) {
+ if (0 == safeStrNCmp(pat, str + idx, pat_len)) {
+ p = str + idx;
+ q = str + idx + pat_len;
+ while('\0' != *q)
+ {
+ *p = *q;
+ p++;
+ q++;
+ }
+ *p = '\0';
+ break;
+ }
+ }
+
+ //now str keeps the result string
+ SETTING_TRACE("Exit %s with return str:%s", __FUNCTION__, str);
+ return str;
+}
+
+
//NULL, "", " ", " " etc.. are all empty strings
bool isEmptyStr(const char *str)
{
int
setting_view_node_table_register(setting_view *view, setting_view *topview)
{
- SETTING_TRACE_BEGIN;
+ //SETTING_TRACE_BEGIN;
if (g_view_node_table_cur_size >= MAX_VIEWNODE_NUM) {
return SETTING_RETURN_FAIL;
}
void *event)
{
ret_if(!data);
+ SETTING_TRACE_BEGIN;
SettingNetworkUG *ad = (SettingNetworkUG *) data;
if (ad->data_acs_name) {
setting_network_connection_entry_changed_cb);
if (ad->data_acs_name) {
ad->data_acs_name->userdata = ad;
- } else {
- SETTING_TRACE_ERROR("ad->data_acs_name is NULL");
- }
-
-#if !SUPPORT_EXPANDABLE_AUTHTYPE
- (void)setting_create_Gendial_field_titleItem(scroller,
- &itc_group_item,
- "IDS_ST_BODY_AUTH_TYPE",
- NULL);
- ad->chk_type = elm_radio_add(scroller);
- elm_radio_state_value_set(ad->chk_type, -1);
-
- ad->data_type_nor =
- setting_create_Gendial_field_1radio(scroller,
- &itc_1text_1icon_2,
- setting_network_connection_mouse_up_Gendial_list_radio_cb,
- ad->chk_type,
- SWALLOW_Type_1RADIO,
- ad->chk_type, NET_PDP_AUTH_PAP,
- "IDS_ST_MBODY_PAP",
- setting_network_edit_connection_chk_changed);
- if (ad->data_type_nor) {
- ad->data_type_nor->userdata = ad;
- } else {
- SETTING_TRACE_ERROR("ad->data_type_nor is NULL");
- }
-
- ad->data_type_sec =
- setting_create_Gendial_field_1radio(scroller,
- &itc_1text_1icon_2,
- setting_network_connection_mouse_up_Gendial_list_radio_cb,
- ad->chk_type,
- SWALLOW_Type_1RADIO,
- ad->chk_type, NET_PDP_AUTH_CHAP,
- "IDS_ST_POP_CHAP",
- setting_network_edit_connection_chk_changed);
- if (ad->data_type_sec) {
- ad->data_type_sec->userdata = ad;
- } else {
- SETTING_TRACE_ERROR("ad->data_type_sec is NULL");
- }
+ ad->data_acs_name->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
+ if (ad->data_acs_name->limit_filter_data) {
+ ad->data_acs_name->limit_filter_data->max_byte_count = NET_PDP_APN_LEN_MAX;
+ ad->data_acs_name->win_main = ad->win_get;
+ }
- ad->data_type_none =
- setting_create_Gendial_field_1radio(scroller,
- &itc_1text_1icon_2,
- setting_network_connection_mouse_up_Gendial_list_radio_cb,
- ad->chk_type,
- SWALLOW_Type_1RADIO,
- ad->chk_type, NET_PDP_AUTH_NONE,
- "IDS_COM_BODY_NONE",
- setting_network_edit_connection_chk_changed);
- if (ad->data_type_none) {
- ad->data_type_none->userdata = ad;
} else {
- SETTING_TRACE_ERROR("ad->data_type_none is NULL");
+ SETTING_TRACE_ERROR("ad->data_acs_name is NULL");
}
- elm_radio_value_set(ad->chk_type, ad->chkType);
-
- ad->item_above_user_name = item =
- elm_genlist_item_append(scroller, &itc_seperator, NULL, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-#else
item =
elm_genlist_item_append(scroller, &itc_seperator, NULL, NULL,
ELM_GENLIST_ITEM_GROUP, NULL, NULL);
elm_genlist_item_append(scroller, &itc_seperator, NULL, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-#endif
+
ad->is_show_user = 0;
if (NET_PDP_AUTH_NONE != ad->chkType) {
ad->data_user_name =
setting_network_connection_entry_changed_cb);
if (ad->data_user_name) {
ad->data_user_name->userdata = ad;
+ ad->data_user_name->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
+ if (ad->data_user_name->limit_filter_data) {
+ ad->data_user_name->limit_filter_data->max_byte_count = NET_PDP_AUTH_USERNAME_LEN_MAX;
+ ad->data_user_name->win_main = ad->win_get;
+ }
} else {
SETTING_TRACE_ERROR("ad->data_user_name is NULL");
}
ad->data_pwd->userdata = ad;
ad->is_show_user = 1;
ad->data_pwd->isPasswordFlag = TRUE;
+ ad->data_pwd->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
+ if (ad->data_pwd->limit_filter_data) {
+ ad->data_pwd->limit_filter_data->max_byte_count = NET_PDP_AUTH_PASSWORD_LEN_MAX;
+ ad->data_pwd->win_main = ad->win_get;
+ }
} else {
SETTING_TRACE_ERROR("ad->data_pwd is NULL");
}
if (ad->data_hm_url) {
ad->data_hm_url->userdata = ad;
ad->data_hm_url->input_type = ELM_INPUT_PANEL_LAYOUT_URL;
+ ad->data_hm_url->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
+ if (ad->data_hm_url->limit_filter_data) {
+ ad->data_hm_url->limit_filter_data->max_byte_count = NET_HOME_URL_LEN_MAX;
+ ad->data_hm_url->win_main = ad->win_get;
+ }
} else {
SETTING_TRACE_ERROR("ad->data_hm_url is NULL");
}
ad->data_user_name->userdata = ad;
ad->data_user_name->chk_change_cb =
setting_network_connection_entry_changed_cb;
+ ad->data_user_name->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
+ if (ad->data_user_name->limit_filter_data) {
+ ad->data_user_name->limit_filter_data->max_byte_count = NET_PDP_AUTH_USERNAME_LEN_MAX;
+ ad->data_user_name->win_main = ad->win_get;
+ }
ad->data_user_name->item =
elm_genlist_item_insert_after(ad->scl_edit,
&itc_1icon,
setting_network_connection_entry_changed_cb;
ad->data_pwd->isPasswordFlag = TRUE;
/* ad->data_pwd->chk_change_cb = chk_change_cb; */
+ ad->data_pwd->limit_filter_data = calloc(1, sizeof(Elm_Entry_Filter_Accept_Set));
+ if (ad->data_pwd->limit_filter_data) {
+ ad->data_pwd->limit_filter_data->max_byte_count = NET_PDP_AUTH_PASSWORD_LEN_MAX;
+ ad->data_pwd->win_main = ad->win_get;
+ }
ad->data_pwd->item =
elm_genlist_item_insert_after(ad->scl_edit,
&itc_1icon,
*/
static ail_cb_ret_e __download_apps_cb(ail_appinfo_h ai, void* data)
{
- SETTING_TRACE_BEGIN;
-
DrawAppInfo* pinfo = (DrawAppInfo*)data;
char *id;
}
}
- SETTING_TRACE_END;
return AIL_CB_RET_CONTINUE;
}
node = (Object_Drawer *) eina_list_data_get(li);
if (node)
{
- SETTING_TRACE("Deregister %s", node->type);
+ //SETTING_TRACE("Deregister %s", node->type);
FREE(node);
}
li = eina_list_next(li);
/* The code 'return ;' will be deleted after the defect of elm_genlist_item_top_show() is fixed */
setting_retm_if(NULL == data, "NULL == data");
- SETTING_TRACE_BEGIN;
setting_main_appdata *ad = (setting_main_appdata *) data;
SETTING_TRACE(">>>>>>>Double tap event detected");
//SETTING_TRACE("content:%p", content);
const char *type = elm_object_widget_type_get(content);
- SETTING_TRACE("content type:%s", type);
+ //SETTING_TRACE("content type:%s", type);
if (0 == safeStrCmp(type, "genlist")) {
genlist = content;
//} else if (0 == safeStrCmp(type, "layout") || 0 == safeStrCmp(type, "conformant")) {
type = elm_object_widget_type_get(subobj);
if (0 == safeStrCmp(type, "genlist")) {
genlist = subobj;
- SETTING_TRACE("Get the genlist:%p", genlist);
+ //SETTING_TRACE("Get the genlist:%p", genlist);
Elm_Object_Item *first_item = elm_genlist_first_item_get(genlist);
if (first_item) {
elm_genlist_item_show(first_item, ELM_GENLIST_ITEM_SCROLLTO_TOP);
} else {
//keep genlist to be NULL.
}
- SETTING_TRACE("genlist(:%p) type:%s", genlist, elm_object_widget_type_get(genlist));
+ //SETTING_TRACE("genlist(:%p) type:%s", genlist, elm_object_widget_type_get(genlist));
if (genlist && 0 == safeStrCmp(elm_object_widget_type_get(genlist), "genlist")) {
SETTING_TRACE("Get the genlist:%p", genlist);
Elm_Object_Item *first_item = elm_genlist_first_item_get(genlist);