#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__;
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);
evas_object_smart_callback_add(entry, "language,changed",
__pw_entry_language_changed_cb, ad);
if (!strcmp(part, "elm.swallow.content")) {
Evas_Object *box = elm_box_add(obj);
- Evas_Object *ibox = elm_box_add(box);
- Evas_Object *tpadding = evas_object_rectangle_add(box);
- Evas_Object *lpadding = evas_object_rectangle_add(ibox);
- Evas_Object *label = elm_label_add(ibox);
+ Evas_Object *label = elm_label_add(box);
Evas_Object *layout = elm_layout_add(box);
char buf[MH_LABEL_LENGTH_MAX] = {0, };
elm_box_align_set(box, 0.0, 0.0);
- /* Set rectangle for top padding */
- evas_object_size_hint_min_set(tpadding, 0, ELM_SCALE_SIZE(10));
- evas_object_size_hint_padding_set(tpadding, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10));
- evas_object_color_set(tpadding, 255, 255, 255, 0);
- evas_object_show(tpadding);
- elm_box_pack_end(box, tpadding);
-
- /* Set internal box */
- evas_object_size_hint_align_set(ibox, 0.0, 0.0);
- evas_object_size_hint_padding_set(ibox, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(20), 0);
- elm_box_horizontal_set(ibox, EINA_TRUE);
- elm_box_pack_end(box, ibox);
-
- /* Set rectangle for left padding */
- evas_object_size_hint_min_set(lpadding, ELM_SCALE_SIZE(15), ELM_SCALE_SIZE(10));
- evas_object_size_hint_padding_set(lpadding, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10));
- evas_object_color_set(lpadding, 255, 255, 255, 0);
- evas_object_show(lpadding);
- elm_box_pack_end(ibox, lpadding);
- evas_object_show(ibox);
-
/* 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), 0, 0);
- elm_box_pack_end(ibox, label);
+ elm_box_pack_end(box, label);
evas_object_show(label);
/* Set layout for entry field */
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 (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);
ad->rename_popup = NULL;
}
ad->setup.navi_it = NULL;
+ _ctxpopup_more_button_callback_add(ad);
DBG("-\n");
return EINA_TRUE;
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__;
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);