* @return The pointer to data_class
*/
struct data_class *get_wireless_data_class(void);
-int wireless_get_connected_ap(wifi_manager_h wifi, char *essid);
+int wireless_get_connected_ap(void *dclass_data, char **essid);
+
#endif /* __AIR_SETTINGS_DATA_WIRELESS_H__ */
#include "app_debug.h"
#include "common/datamgr.h"
-struct datamgr {
- struct data_class *dclass;
- void *dclass_data;
-};
struct datamgr *datamgr_create(struct data_class *dclass,
void (*event_cb)(enum event_type type, void *data),
return &_dclass;
}
+int wireless_get_connected_ap(void *dclass_data, char **essid)
+{ struct _priv *priv;
+ wifi_manager_ap_h ap;
+ int r;
+
+ if (!dclass_data) {
+ _ERR("Invalid argument.");
+ return 0;
+ }
+
+ priv = dclass_data;
+ r = wifi_manager_get_connected_ap(priv->wifi, &ap);
+ if (r != WIFI_MANAGER_ERROR_NONE) {
+ _ERR("wifi_manager_get_connected_ap failed.");
+ return 0;
+ }
+ r = wifi_manager_ap_get_essid(ap, essid);
+ if (r != WIFI_MANAGER_ERROR_NONE) {
+ _ERR("wifi_manager_ap_get_essid failed.");
+ wifi_manager_ap_destroy(ap);
+ return 0;
+ }
+
+ wifi_manager_ap_destroy(ap);
+ return 1;
+
+}
#include "common/layoutmgr.h"
#include "common/menumgr.h"
#include "common/listmgr.h"
+#include "common/datamgr.h"
#include "common/utils.h"
#include "common/viewmgr.h"
#include "data/system/data_wired.h"
bool isReconnect);
static void _focused1(void *data, int id);
static void _selected(void *data, int id);
+static char *_get_connected_ap(void *data, int id);
struct _priv * current_priv = NULL;
{
.id = TYPE_WIRELESS,
.title = STR_WIRELESS,
- .style = STYLE_NORMAL_BTN,
+ .style = STYLE_STATUS_BTN,
.disabled = EINA_FALSE,
- //.status = _get_connected_ap,
- .status = NULL,
+ .status = _get_connected_ap,
.progress_value = NULL,
.progress_evas = NULL,
.selected = _selected,
}
};
+static char *_get_connected_ap(void *data, int id)
+{
+ struct _priv *priv;
+ char *essid, *temp;
+ int r;
+ priv = data;
+ r = wireless_get_connected_ap(priv->wirelessmgr->dclass_data, &essid);
+ if (r) {
+ temp = strdup(essid);
+ free(essid);
+ return temp;
+ }
+ return strdup("");
+}
static void _destroy_status_popup()
{
// if (priv->cur_type == TYPE_WIRELESS)
// _retry_wireless_network(priv);
}
+ menumgr_update(priv->menu);
}
static void _hide(void *layout_data)
priv->wired = NULL;
}
+ menumgr_destroy(priv->menu);
evas_object_del(priv->ly);
free(priv);
case UPDATE_ENABLE:
elm_object_disabled_set(priv->ly, EINA_FALSE);
break;
+ case UPDATE_CONTENT:
+ menumgr_update(priv->menu);
+ break;
default:
break;
}