#define MAX_WIRELESS_LEN 64
#define MIN_WIRELESS_LEN 8
+Evas_Object *wifi_list_popup;
+
enum object_type {
EO_BTN_OK = 0,
EO_BTN_CANCEL,
static void _destroy_list_type_popup(struct _priv *priv)
{
- evas_object_hide(priv->base);
- evas_object_del(priv->base);
+ evas_object_hide(wifi_list_popup);
+ evas_object_del(wifi_list_popup);
viewmgr_remove_view(VIEW_WIRELESS_LIST);
viewmgr_remove_view(VIEW_WIRELESS_SCANNING);
- priv->base = NULL;
-
}
static void _popup_list_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
priv = data;
-
- priv->base = utils_add_popup(win, STYLE_POPUP, STR_WIRELESS, NULL);
- if (!priv->base) {
+ wifi_list_popup = utils_add_popup(priv->base, STYLE_POPUP, STR_WIRELESS, NULL);
+ if (!wifi_list_popup) {
_ERR("Add popup failed");
- free(priv);
+ evas_object_del(wifi_list_popup);
return NULL;
}
- ly = utils_add_layout(priv->base, GRP_CONTENT_NETWORK_POPUP_LIST, EINA_FALSE);
+ ly = utils_add_layout(wifi_list_popup, GRP_CONTENT_NETWORK_POPUP_LIST, EINA_FALSE);
if (!ly) {
_ERR("Add layout failed.");
- evas_object_del(priv->base);
- free(priv);
+ evas_object_del(wifi_list_popup);
return NULL;
}
- evas_object_event_callback_add(priv->base, EVAS_CALLBACK_KEY_DOWN,
+ evas_object_event_callback_add(wifi_list_popup, EVAS_CALLBACK_KEY_DOWN,
_popup_list_key_down_cb, priv);
list = datamgr_get_data(priv->wirelessmgr);
if (!list) {
- //_draw_no_contents_message(priv);
return NULL;
}
+ _wireless_data_found_done(ly, list);
- table = elm_table_add(priv->base);
+ table = elm_table_add(wifi_list_popup);
-// elm_table_homogeneous_set(table, EINA_TRUE);
-// elm_table_padding_set(table, 0, 0);
evas_object_size_hint_weight_set(table, 0,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(table, EVAS_HINT_FILL,
EVAS_HINT_FILL);
-
elm_object_part_content_set(ly, PART_WIRELESS_LIST, table);
if (!table) {
_ERR("Add layout failed.");
- evas_object_del(priv->base);
- free(priv);
+ evas_object_del(wifi_list_popup);
return NULL;
}
priv->listmgr = listmgr_create(table);
_ERR("Listmgr update list failed.");
-// Elm_Object_Item *gg = elm_gengrid_last_item_get(grid);
-// if (!gg) return NULL;
-// elm_gengrid_item_bring_in(gg, ELM_GENGRID_ITEM_SCROLLTO_IN);
-
- elm_object_focus_allow_set(priv->base, EINA_TRUE);
- //elm_object_focus_set(btn2, EINA_TRUE);
-
- elm_object_content_set(priv->base, table);
+ elm_object_focus_allow_set(wifi_list_popup, EINA_TRUE);
+ elm_object_content_set(wifi_list_popup, ly);
+ evas_object_show(wifi_list_popup);
if (!viewmgr_set_view_data(VIEW_WIRELESS_LIST, priv)) {
_ERR("Set view data failed.");
- evas_object_del(priv->base);
+ evas_object_del(wifi_list_popup);
free(priv);
return NULL;
}
return;
}
- evas_object_del(priv->base);
+ evas_object_del(wifi_list_popup);
}
EO_ENTRY_PASSCODE,
};
+Evas_Object *wifi_scan_popup;
+
static void widget_min_set(Evas_Object *table, Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{
Evas_Object *rect;
}
priv = data;
-
+ if (!priv) {
+ _ERR("Calloc failed.");
+ return NULL;
+ }
struct wifi_manager_ap_info *ap_info;
ap_info = malloc(sizeof(struct wifi_manager_ap_info));
memset(ap_info, '\0', sizeof(struct wifi_manager_ap_info));
list = eina_list_append(list, ap_info);
- //_wireless_data_found_done(priv, list);
-
- priv->base = utils_add_popup(win, STYLE_POPUP, STR_WIRELESS, NULL);
- if (!priv->base) {
+ wifi_scan_popup = utils_add_popup(priv->base, STYLE_POPUP, STR_WIRELESS, NULL);
+ if (!wifi_scan_popup) {
_ERR("Add popup failed");
+ evas_object_del(wifi_scan_popup);
return NULL;
}
- ly = utils_add_layout(priv->base, GRP_CONTENT_NETWORK_POPUP_LIST, EINA_FALSE);
+ ly = utils_add_layout(wifi_scan_popup, GRP_CONTENT_NETWORK_POPUP_LIST, EINA_FALSE);
if (!ly) {
_ERR("Add layout failed.");
- evas_object_del(priv->base);
+ evas_object_del(wifi_scan_popup);
return NULL;
}
- table = elm_table_add(priv->base);
+ table = elm_table_add(wifi_scan_popup);
// elm_table_homogeneous_set(table, EINA_TRUE);
// elm_table_padding_set(table, 0, 0);
if (!table) {
_ERR("Add layout failed.");
- evas_object_del(priv->base);
+ evas_object_del(wifi_scan_popup);
return NULL;
}
priv->listmgr = listmgr_create(table);
_wireless_scanning_data_found_done(priv, list);
-// Elm_Object_Item *gg = elm_gengrid_last_item_get(grid);
-// if (!gg) return NULL;
-// elm_gengrid_item_bring_in(gg, ELM_GENGRID_ITEM_SCROLLTO_IN);
-
- elm_object_focus_allow_set(priv->base, EINA_TRUE);
- //elm_object_focus_set(btn2, EINA_TRUE);
-
- elm_object_content_set(priv->base, table);
-
+ elm_object_focus_allow_set(wifi_scan_popup, EINA_TRUE);
+ elm_object_content_set(wifi_scan_popup, ly);
+ evas_object_show(wifi_scan_popup);
if (!viewmgr_set_view_data(VIEW_WIRELESS_SCANNING, priv)) {
_ERR("Set view data failed.");
- evas_object_del(priv->base);
+ evas_object_del(wifi_scan_popup);
return NULL;
}
- return priv->base;
+ return wifi_scan_popup;
}
static void _show(void *data)
return;
}
- evas_object_show(priv->base);
+ evas_object_show(wifi_scan_popup);
}
return;
}
- evas_object_hide(priv->base);
+ evas_object_hide(wifi_scan_popup);
}
static void _destroy(void *data)
return;
}
- evas_object_del(priv->base);
+ evas_object_del(wifi_scan_popup);
}