return true;
}
+bool listmgr_update_list(struct listmgr *listmgr, const char *list_id)
+{
+ struct list_info *linfo;
+ Eina_List *list, *l;
+ Elm_Object_Item *it;
+
+ if (!listmgr || !list_id) {
+ _ERR("Invalid argument.");
+ return false;
+ }
+
+ linfo = _get_list_info(listmgr, list_id);
+ if (!linfo) {
+ _ERR("List %s does not exist.", list_id);
+ return false;
+ }
+
+ list = elm_gengrid_realized_items_get(linfo->grid);
+ if (!list) {
+ _ERR("List is NULL.");
+ return false;
+ }
+
+ EINA_LIST_FOREACH(list, l, it) {
+ if (!it)
+ continue;
+
+ elm_gengrid_item_update(it);
+ elm_object_item_signal_callback_add(it, SIG_ITEM_SELECTED,
+ SRC_EDC, _grid_item_selected_cb, linfo);
+ }
+
+ return true;
+}
+
bool listmgr_hide_list(struct listmgr *listmgr, const char *list_id,
const char *part)
{
return false;
}
+ if (priv->new_passcode)
+ free(priv->new_passcode);
+
free(priv);
return true;
}
+static void _wifi_connection_state_changed_cb(wifi_connection_state_e state,
+ wifi_ap_h ap, void *data)
+{
+ wifi_connection_state_e connection_state;
+ struct wifi_ap_info *ap_info;
+ Eina_List *l;
+ struct _priv *priv;
+ char *essid;
+ int r;
+
+ if (!data) {
+ _ERR("Invalid argument.");
+ return;
+ }
+
+ priv = data;
+
+ r = wifi_ap_get_essid(ap, &essid);
+ if (r != WIFI_ERROR_NONE) {
+ _ERR("wifi_ap_get_essid failed.");
+ return;
+ }
+
+ r = wifi_ap_get_connection_state(ap, &connection_state);
+ if (r != WIFI_ERROR_NONE) {
+ _ERR("wifi_ap_get_connection_state failed.");
+ return;
+ }
+
+ EINA_LIST_FOREACH(priv->list, l, ap_info) {
+ if (!ap_info->ap || !ap_info->essid)
+ continue;
+
+ if (!strcmp(ap_info->essid, essid)) {
+ ap_info->connection_state = connection_state;
+ break;
+ }
+ }
+
+ if (ap_info->connection_state == WIFI_CONNECTION_STATE_CONNECTED
+ && priv->event_cb)
+ priv->event_cb(EVENT_DATA_SELECT_DONE, priv->cb_data);
+}
+
static bool _wifi_found_ap_cb(wifi_ap_h ap, void *data)
{
+ struct _priv *priv;
struct wifi_ap_info *ap_info;
- Eina_List **list;
wifi_connection_state_e connection_state;
wifi_security_type_e secure_type;
char *essid;
return EINA_FALSE;
}
- list = data;
+ priv = data;
r = wifi_ap_get_essid(ap, &essid);
if (r != WIFI_ERROR_NONE) {
return EINA_TRUE;
}
+ wifi_set_connection_state_changed_cb(_wifi_connection_state_changed_cb,
+ priv);
+
ap_info->essid = essid;
ap_info->connection_state = connection_state;
ap_info->secure_type = secure_type;
- *list = eina_list_append(*list, ap_info);
+ priv->list = eina_list_append(priv->list, ap_info);
return EINA_TRUE;
}
_free_wifi_list(priv->list);
priv->list = NULL;
- r = wifi_foreach_found_aps(_wifi_found_ap_cb, &priv->list);
+ r = wifi_foreach_found_aps(_wifi_found_ap_cb, priv);
if (r != WIFI_ERROR_NONE) {
_ERR("wifi_foreach_found_aps failed.");
return;
return;
}
-
- if (priv->event_cb)
- priv->event_cb(EVENT_DATA_SELECT_DONE, priv->cb_data);
}
static void _wifi_connect_new_ap(struct _priv *priv)
break;
case EVENT_DATA_SELECT_DONE:
- /* FIXME: Currently, layout is refreshed when AP connected. */
- if (!datamgr_update(priv->wirelessmgr)) {
- _ERR("Unavailable status for updating list.");
- return;
- }
-
elm_object_item_signal_emit(priv->selected_wireless_item,
SIG_LOADING_STOP, SRC_ELM);
+
+ if (!listmgr_update_list(priv->listmgr, LIST_WIRELESS))
+ _ERR("Listmgr update list failed.");
+
break;
case EVENT_DATA_SELECT_FAIL: