#include "mh_popup.h"
#include "mh_view_wifi_setup.h"
+#include "mh_view_main.h"
#include "mh_string.h"
static void __gl_realized(void *data, Evas_Object *obj, void *event_info);
static void __cancel_btn_cb(void *data, Evas_Object *object, void *event_info);
static void __save_btn_cb(void *data, Evas_Object *object, void *event_info);
+static void __create_password_item(Evas_Object *genlist, mh_appdata_t *ad);
+static void __destroy_password_item(mh_appdata_t *ad);
+
+static guint tethering_param_timer = 0;
+
static void __hide_btn_changed_cb(void *data, Evas_Object *obj, void *event_info)
{
__MOBILE_AP_FUNC_ENTER__;
mh_appdata_t *ad = (mh_appdata_t *)data;
mh_wifi_setting_view_t *st = &ad->setup;
- if (st->security_type_new == TETHERING_WIFI_SECURITY_TYPE_NONE)
+ if (st->security_type_new == TETHERING_WIFI_SECURITY_TYPE_NONE) {
st->security_type_new = TETHERING_WIFI_SECURITY_TYPE_WPA2_PSK;
- else
+ if (st->pw_item == NULL)
+ __create_password_item(st->genlist, ad);
+ } else {
st->security_type_new = TETHERING_WIFI_SECURITY_TYPE_NONE;
+ /* Disable password entry */
+ __destroy_password_item(ad);
+ }
/* update wifi passphrase item */
if (st->security_type_new == TETHERING_WIFI_SECURITY_TYPE_NONE) {
elm_object_disabled_set(st->save_button, EINA_FALSE);
} else {
elm_object_item_disabled_set(st->pw_item, EINA_FALSE);
- if (st->pw_entry == NULL || elm_entry_entry_get(st->pw_entry) == NULL ||
- strlen(elm_entry_entry_get(st->pw_entry)) == 0)
- elm_object_disabled_set(st->save_button, EINA_TRUE);
}
if (st->pw_item)
__MOBILE_AP_FUNC_EXIT__;
}
+static void __check_box_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ __MOBILE_AP_FUNC_ENTER__;
+
+ if (data == NULL || obj == NULL) {
+ ERR("Invalid param\n");
+ return;
+ }
+
+ Eina_Bool state = elm_check_state_get(obj);
+ mh_appdata_t *ad = (mh_appdata_t *)data;
+ mh_wifi_setting_view_t *st = &ad->setup;
+
+ if (state)
+ elm_entry_password_set(st->pw_entry, EINA_FALSE);
+ else
+ elm_entry_password_set(st->pw_entry, EINA_TRUE);
+
+ __MOBILE_AP_FUNC_EXIT__;
+ return;
+}
+
static bool __save_security_btn_change(mh_appdata_t *ad)
{
__MOBILE_AP_FUNC_ENTER__;
if (!strcmp("elm.text.multiline", part)) {
device_name_utf = vconf_get_str(VCONFKEY_SETAPPL_DEVICE_NAME_STR);
- if (device_name_utf == NULL) {
+ if (device_name_utf == NULL)
ERR("vconf_get_str failed \n");
- }
ptr = elm_entry_utf8_to_markup(device_name_utf);
if (ptr == NULL) {
return NULL;
}
- if (!strcmp("elm.text", part)) {
+ if (!strcmp("elm.text", part))
return strdup(STR_HIDE_MY_DEV);
- }
__MOBILE_AP_FUNC_EXIT__;
return NULL;
return NULL;
}
- if (!strcmp("elm.text", part)) {
+ if (!strcmp("elm.text", part))
return strdup(STR_SECURITY_TYPE);
- }
__MOBILE_AP_FUNC_EXIT__;
return NULL;
WIFI_PASSPHRASE_LENGTH_MIN, WIFI_PASSPHRASE_LENGTH_MAX);
ret = notification_status_message_post(buf);
- if (ret != NOTIFICATION_ERROR_NONE) {
+ if (ret != NOTIFICATION_ERROR_NONE)
ERR("notification_status_message_post() is failed : %d\n", ret);
- }
__MOBILE_AP_FUNC_EXIT__;
}
static void __pw_entry_focused_cb(void *data, Evas_Object *obj, void *event_info)
{
__MOBILE_AP_FUNC_ENTER__;
- evas_object_event_callback_del(obj, EVAS_CALLBACK_SHOW, __pw_entry_focused_cb);
+ evas_object_smart_callback_del(obj, "focused", __pw_entry_focused_cb);
elm_object_focus_set(obj, EINA_TRUE);
elm_entry_cursor_end_set(obj);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_scrollable_set(entry, EINA_TRUE);
- elm_entry_password_set(entry, EINA_FALSE);
+ elm_entry_password_set(entry, EINA_TRUE);
- st->pw_entry = entry;
evas_object_smart_callback_add(entry, "language,changed",
__pw_entry_language_changed_cb, ad);
}
}
- elm_entry_input_panel_return_key_type_set(st->pw_entry,
+ elm_entry_input_panel_return_key_type_set(entry,
ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
clr_btn = elm_button_add(entry);
evas_object_event_callback_add(entry, EVAS_CALLBACK_SHOW,
__pw_entry_show_cb, NULL);
-// elm_entry_editable_set(entry, EINA_TRUE);
elm_object_focus_set(entry, EINA_TRUE);
elm_entry_input_panel_show(entry);
elm_object_part_content_set(parent, "elm.swallow.content", entry);
- __MOBILE_AP_FUNC_EXIT__;
- return st->pw_entry;
-}
-
-static char *__gl_pw_text_get(void *data, Evas_Object *obj, const char *part)
-{
- __MOBILE_AP_FUNC_ENTER__;
- char buf[MH_LABEL_LENGTH_MAX] = {0, };
-
- if (data == NULL || obj == NULL || part == NULL) {
- ERR("Invalid param\n");
- return NULL;
- }
-
- if (!strcmp("elm.text.main", part)) {
- snprintf(buf, MH_LABEL_LENGTH_MAX, "<font_size=30>%s</font_size>", STR_PASSWORD);
- return strdup(buf);
- }
+ st->pw_entry = entry;
__MOBILE_AP_FUNC_EXIT__;
- return NULL;
+ return st->pw_entry;
}
static Evas_Object *__gl_pw_content_get(void *data, Evas_Object *obj, const char *part)
Evas_Object *layout = elm_layout_add(box);
char buf[MH_LABEL_LENGTH_MAX] = {0, };
- elm_box_align_set(box, 0.5, 0.5);
+ elm_box_align_set(box, 0.0, 0.0);
/* Set label for name field */
snprintf(buf, MH_LABEL_LENGTH_MAX, "<text align=left><font_size=30>%s</font_size></text>", STR_PASSWORD);
elm_object_text_set(label, buf);
evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(label, 0.9, EVAS_HINT_EXPAND);
- evas_object_size_hint_padding_set(label, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10));
+ evas_object_size_hint_padding_set(label, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10), 0, 0);
elm_box_pack_end(box, label);
evas_object_show(label);
evas_object_size_hint_min_set(box, ELM_SCALE_SIZE(w), ELM_SCALE_SIZE(h));
evas_object_show(box);
- return box;
+ return box;
}
__MOBILE_AP_FUNC_EXIT__;
return NULL;
}
+static char *_gl_pswd_check_box_text_get(void *data,
+ Evas_Object *obj, const char *part)
+{
+ if (!strcmp("elm.text", part))
+ return strdup(STR_SHOW_PASSWORD);
+
+ return NULL;
+
+}
+
+static Evas_Object *_gl_pswd_check_box_content_get(void *data,
+ Evas_Object *obj, const char *part)
+{
+ mh_appdata_t *ad = (mh_appdata_t *)data;
+ Evas_Object *check = NULL;
+
+ if (data == NULL || obj == NULL || part == NULL) {
+ ERR("Invalid param\n");
+ return NULL;
+ }
+
+ if (!strcmp("elm.swallow.icon", part)) {
+ check = elm_check_add(obj);
+ evas_object_propagate_events_set(check, EINA_FALSE);
+
+ evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_smart_callback_add(check, "changed", __check_box_changed_cb, (void *)ad);
+
+ elm_object_focus_allow_set(check, EINA_FALSE);
+
+ return check;
+ }
+ return NULL;
+}
+
+
static void __gl_hide_item_sel(void *data, Evas_Object *obj, void *event_info)
{
__MOBILE_AP_FUNC_ENTER__;
{
__MOBILE_AP_FUNC_ENTER__;
-#if 0 /* not used */
- ad->setup.sp_itc = elm_genlist_item_class_new();
- if (ad->setup.sp_itc == NULL) {
- ERR("elm_genlist_item_class_new failed\n");
- __MOBILE_AP_FUNC_EXIT__;
- return;
- }
- ad->setup.sp_itc->item_style = "dialogue/separator";
- ad->setup.sp_itc->func.text_get = NULL;
- ad->setup.sp_itc->func.content_get = NULL;
- ad->setup.sp_itc->func.state_get = NULL;
- ad->setup.sp_itc->func.del = NULL;
-#endif
ad->setup.name_itc = elm_genlist_item_class_new();
if (ad->setup.name_itc == NULL) {
ERR("elm_genlist_item_class_new failed\n");
ad->setup.pw_itc->func.state_get = NULL;
ad->setup.pw_itc->func.del = NULL;
-#if 0 /* not used */
- ad->setup.sp2_itc = elm_genlist_item_class_new();
- if (ad->setup.sp2_itc == NULL) {
+ ad->setup.check_box_itc = elm_genlist_item_class_new();
+ if (ad->setup.check_box_itc == NULL) {
ERR("elm_genlist_item_class_new failed\n");
__MOBILE_AP_FUNC_EXIT__;
return;
}
- ad->setup.sp2_itc->item_style = "dialogue/separator.2";
- ad->setup.sp2_itc->func.text_get = NULL;
- ad->setup.sp2_itc->func.content_get = NULL;
- ad->setup.sp2_itc->func.state_get = NULL;
- ad->setup.sp2_itc->func.del = NULL;
-#endif
+ ad->setup.check_box_itc->item_style = MH_GENLIST_1LINE_TEXT_ICON_STYLE;
+ ad->setup.check_box_itc->func.text_get = _gl_pswd_check_box_text_get;
+ ad->setup.check_box_itc->func.content_get = _gl_pswd_check_box_content_get;
+ ad->setup.check_box_itc->func.state_get = NULL;
+ ad->setup.check_box_itc->func.del = NULL;
+
__MOBILE_AP_FUNC_EXIT__;
return;
}
__MOBILE_AP_FUNC_ENTER__;
+ g_source_remove(tethering_param_timer);
+
mh_appdata_t *ad = (mh_appdata_t *)user_data;
if (result != TETHERING_ERROR_NONE)
return;
}
+static gboolean _update_tethering_param(gpointer data)
+{
+ __MOBILE_AP_FUNC_ENTER__;
+ mh_appdata_t *ad = (mh_appdata_t *)data;
+ int ret;
+
+ if (ad == NULL) {
+ ERR("Invalid parameter\n");
+ return FALSE;
+ }
+
+ /* reload wifi settings */
+ ret = tethering_wifi_reload_settings(ad->handle, __settings_reloaded_cb,
+ (void *)ad);
+ if (ret != TETHERING_ERROR_NONE)
+ ERR("reload_configuration is failed : %d\n", ret);
+
+ __MOBILE_AP_FUNC_EXIT__;
+ return FALSE;
+}
+
static void __save_btn_cb(void *data, Evas_Object *object, void *event_info)
{
DBG("+\n");
if (ret == false) {
g_strlcpy(st->wifi_passphrase_new, st->wifi_passphrase,
sizeof(st->wifi_passphrase_new));
- if(st->pw_item)
+ if (st->pw_item)
elm_genlist_item_update(st->pw_item);
} else {
g_strlcpy(st->wifi_passphrase, st->wifi_passphrase_new,
if (ad->main.help_item)
elm_genlist_item_update(ad->main.help_item);
- /* reload wifi settings */
- ret = tethering_wifi_reload_settings(ad->handle, __settings_reloaded_cb,
- (void *)ad);
- if (ret != TETHERING_ERROR_NONE)
- ERR("reload_configuration is failed : %d\n", ret);
+ /* Here, The Dbus takes some amount of time
+ to set the tethering parameters, due to
+ which UI shows incorrect display, to avoid
+ this issue, CAPI will be called after 0.1sec for smooth
+ transition of UI frames */
+ tethering_param_timer = g_timeout_add(100,
+ _update_tethering_param, ad);
}
elm_naviframe_item_pop(ad->naviframe);
mh_appdata_t *ad = (mh_appdata_t *)data;
mh_wifi_setting_view_t *st = &ad->setup;
- if (st->visibility != st->visibility_new) {
+ if (st->visibility != st->visibility_new)
st->visibility_new = st->visibility;
- }
- if (st->security_type != st->security_type_new) {
+ if (st->security_type != st->security_type_new)
st->security_type_new = st->security_type;
- }
if (strcmp(st->wifi_passphrase_new, st->wifi_passphrase)) {
g_strlcpy(st->wifi_passphrase_new, st->wifi_passphrase,
ad->rename_popup = NULL;
}
ad->setup.navi_it = NULL;
+ _ctxpopup_more_button_callback_add(ad);
DBG("-\n");
return EINA_TRUE;
int no_of_sp;
int i;
- if (item == st->hide_item) {
+ if (item == st->hide_item)
elm_object_item_signal_emit(item, "elm,state,top", "");
- } else if (item == st->security_item) {
+ else if (item == st->security_item)
elm_object_item_signal_emit(item, "elm,state,center", "");
- } else if (item == st->pw_item) {
+ else if (item == st->pw_item)
elm_object_item_signal_emit(item, "elm,state,bottom", "");
- } else if (item == st->name_item) {
- }
no_of_sp = sizeof(st->sp_item) / sizeof(st->sp_item[0]);
for (i = 0; i < no_of_sp; i++) {
return;
}
- Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- Evas_Object *layout = NULL;
mh_appdata_t *ad = (mh_appdata_t *)data;
+ mh_wifi_setting_view_t *st = &ad->setup;
- elm_genlist_item_selected_set(item, EINA_FALSE);
-
- layout = elm_layout_add(obj);
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- __get_pw_entry(ad, layout);
+ elm_object_focus_set(st->pw_entry, EINA_TRUE);
- evas_object_show(layout);
__MOBILE_AP_FUNC_EXIT__;
return;
}
+static void __create_password_item(Evas_Object *genlist, mh_appdata_t *ad)
+{
+ void *data = (void *)ad;
+ mh_wifi_setting_view_t *st = &ad->setup;
+
+ st->pw_item = elm_genlist_item_append(genlist, st->pw_itc, data, NULL,
+ ELM_GENLIST_ITEM_NONE, __select_passphrase_item, ad);
+ if (st->security_type == TETHERING_WIFI_SECURITY_TYPE_NONE)
+ elm_object_item_disabled_set(st->pw_item, EINA_TRUE);
+ else
+ elm_object_item_disabled_set(st->pw_item, EINA_FALSE);
+
+ st->check_box_item = elm_genlist_item_append(genlist, st->check_box_itc, data, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
+}
+
+static void __destroy_password_item(mh_appdata_t *ad)
+{
+ void *data = (void *)ad;
+ mh_wifi_setting_view_t *st = &ad->setup;
+
+ elm_object_item_del(st->check_box_item);
+ st->check_box_item = NULL;
+
+ elm_object_item_del(st->pw_item);
+ st->pw_item = NULL;
+}
+
Evas_Object *__create_genlist(mh_appdata_t *ad)
{
__MOBILE_AP_FUNC_ENTER__;
elm_object_style_set(genlist, "dialogue");
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
evas_object_smart_callback_add(genlist, "realized", __gl_realized, ad);
- //elm_genlist_realization_mode_set(genlist, EINA_TRUE);
__set_genlist_itc(ad);
st->security_item = elm_genlist_item_append(genlist, st->security_itc, data, NULL,
ELM_GENLIST_ITEM_NONE, __gl_security_item_sel, data);
- st->pw_item = elm_genlist_item_append(genlist, st->pw_itc, data, NULL,
- ELM_GENLIST_ITEM_NONE, __select_passphrase_item, ad);
- if (st->security_type == TETHERING_WIFI_SECURITY_TYPE_NONE)
- elm_object_item_disabled_set(st->pw_item, EINA_TRUE);
- else
- elm_object_item_disabled_set(st->pw_item, EINA_FALSE);
-
-/* End separator is removed because of P131104-03336. It is confirmed by UX team for this case.
- item = elm_genlist_item_append(genlist, st->sp_itc, NULL, NULL,
- ELM_GENLIST_ITEM_NONE, NULL, NULL);
- elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- st->sp_item[i++] = item;
-*/
+ if (st->security_type != TETHERING_WIFI_SECURITY_TYPE_NONE)
+ __create_password_item(genlist, ad);
__MOBILE_AP_FUNC_EXIT__;
return;
}
- st->navi_it = elm_naviframe_item_push(ad->naviframe, "IDS_MOBILEAP_MBODY_WI_FI_TETHERING",
+ st->navi_it = elm_naviframe_item_push(ad->naviframe, "IDS_MOBILEAP_BODY_CONFIGURE_MOBILE_HOTSPOT_ABB_US_TMO",
NULL, NULL, st->genlist, NULL);
elm_object_item_domain_text_translatable_set(st->navi_it, PKGNAME, EINA_TRUE);