wip
This commit is contained in:
parent
33f735be17
commit
40616fb203
|
@ -171,6 +171,18 @@ group { name: "e/modules/wireless/wifi"; nomouse;
|
||||||
public message(Msg_Type:type, id, ...) {
|
public message(Msg_Type:type, id, ...) {
|
||||||
if ((type == MSG_INT_SET) && (id == 1)) {
|
if ((type == MSG_INT_SET) && (id == 1)) {
|
||||||
new state = getarg(2), signl = getarg(3);
|
new state = getarg(2), signl = getarg(3);
|
||||||
|
if (state <= 1) {
|
||||||
|
set_state(PART:"wifi_1", "default", 0.0);
|
||||||
|
set_state(PART:"wifi_2", "default", 0.0);
|
||||||
|
set_state(PART:"wifi_3", "default", 0.0);
|
||||||
|
set_state(PART:"led", "default", 0.0);
|
||||||
|
}
|
||||||
|
if (state == 1) {
|
||||||
|
run_program(PROGRAM:"connecting");
|
||||||
|
run_program(PROGRAM:"connecting_wifi");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
stop_programs_on(PART:"led");
|
||||||
if (signl <= 14) {
|
if (signl <= 14) {
|
||||||
set_state(PART:"wifi_1", "default", 0.0);
|
set_state(PART:"wifi_1", "default", 0.0);
|
||||||
set_state(PART:"wifi_2", "default", 0.0);
|
set_state(PART:"wifi_2", "default", 0.0);
|
||||||
|
@ -206,12 +218,7 @@ group { name: "e/modules/wireless/wifi"; nomouse;
|
||||||
set_state(PART:"wifi_2", "visible", 0.0);
|
set_state(PART:"wifi_2", "visible", 0.0);
|
||||||
set_state(PART:"wifi_3", "visible", 0.0);
|
set_state(PART:"wifi_3", "visible", 0.0);
|
||||||
}
|
}
|
||||||
if ((state == 1)) {
|
if ((state == 2)) { set_state(PART:"led", "connected", 0.0); }
|
||||||
set_state(PART:"led", "default", 0.0);
|
|
||||||
run_program(PROGRAM:"connecting");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if ((state == 2)) { set_state(PART:"led", "connected", 0.0); }
|
|
||||||
else if ((state == 3)) { set_state(PART:"led", "online", 0.0); }
|
else if ((state == 3)) { set_state(PART:"led", "online", 0.0); }
|
||||||
else { set_state(PART:"led", "default", 0.0); }
|
else { set_state(PART:"led", "default", 0.0); }
|
||||||
}
|
}
|
||||||
|
@ -400,20 +407,43 @@ group { name: "e/modules/wireless/wifi"; nomouse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
programs {
|
programs {
|
||||||
program { name: "connecting";
|
program { "connecting_wifi";
|
||||||
action: STATE_SET "connected" 0.0;
|
action: STATE_SET "default";
|
||||||
|
targets: "wifi_1" "wifi_2" "wifi_3";
|
||||||
|
sequence {
|
||||||
|
action: STATE_SET "partly";
|
||||||
|
target: "wifi_1";
|
||||||
|
transition: LINEAR 0.085;
|
||||||
|
action: STATE_SET "visible";
|
||||||
|
target: "wifi_1";
|
||||||
|
transition: LINEAR 0.085;
|
||||||
|
action: STATE_SET "partly";
|
||||||
|
target: "wifi_2";
|
||||||
|
transition: LINEAR 0.085;
|
||||||
|
action: STATE_SET "visible";
|
||||||
|
target: "wifi_2";
|
||||||
|
transition: LINEAR 0.085;
|
||||||
|
action: STATE_SET "partly";
|
||||||
|
target: "wifi_3";
|
||||||
|
transition: LINEAR 0.085;
|
||||||
|
action: STATE_SET "visible";
|
||||||
|
target: "wifi_3";
|
||||||
|
transition: LINEAR 0.085;
|
||||||
|
after: "connecting_wifi";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program { "connecting";
|
||||||
|
action: STATE_SET "connected";
|
||||||
target: "led";
|
target: "led";
|
||||||
in: 0.3 0.0;
|
in: 0.3 0.0;
|
||||||
after: "connecting2";
|
sequence {
|
||||||
}
|
action: STATE_SET "default";
|
||||||
program { name: "connecting2";
|
|
||||||
action: STATE_SET "default" 0.0;
|
|
||||||
target: "led";
|
target: "led";
|
||||||
in: 0.3 0.0;
|
in: 0.3 0.0;
|
||||||
after: "connecting";
|
after: "connecting";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
target_group: "clips" "clip_exclam" "clip_wifi";
|
target_group: "clips" "clip_exclam" "clip_wifi";
|
||||||
program {
|
program {
|
||||||
signal: "e,state,error"; source: "e";
|
signal: "e,state,error"; source: "e";
|
||||||
|
|
|
@ -40,11 +40,11 @@ typedef enum
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
CONNMAN_SERVICE_TYPE_NONE = -1, /* All non-supported types */
|
CONNMAN_SERVICE_TYPE_NONE = -1, /* All non-supported types */
|
||||||
CONNMAN_SERVICE_TYPE_ETHERNET,
|
CONNMAN_SERVICE_TYPE_ETHERNET = 0,
|
||||||
CONNMAN_SERVICE_TYPE_WIFI,
|
CONNMAN_SERVICE_TYPE_WIFI = 1,
|
||||||
CONNMAN_SERVICE_TYPE_BLUETOOTH,
|
CONNMAN_SERVICE_TYPE_BLUETOOTH = 2,
|
||||||
CONNMAN_SERVICE_TYPE_CELLULAR,
|
CONNMAN_SERVICE_TYPE_CELLULAR = 3,
|
||||||
CONNMAN_SERVICE_TYPE_LAST,
|
CONNMAN_SERVICE_TYPE_LAST = 4,
|
||||||
} Connman_Service_Type;
|
} Connman_Service_Type;
|
||||||
|
|
||||||
typedef struct Connman_Technology
|
typedef struct Connman_Technology
|
||||||
|
@ -139,6 +139,22 @@ static Connman_Technology connman_technology[CONNMAN_SERVICE_TYPE_LAST];
|
||||||
/* connman -> wireless */
|
/* connman -> wireless */
|
||||||
static Eina_Hash *connman_services_map[CONNMAN_SERVICE_TYPE_LAST];
|
static Eina_Hash *connman_services_map[CONNMAN_SERVICE_TYPE_LAST];
|
||||||
|
|
||||||
|
static inline Eina_Bool
|
||||||
|
_connman_service_is_connected(const Connman_Service *cs)
|
||||||
|
{
|
||||||
|
return (cs->state >= CONNMAN_STATE_ASSOCIATION) && (cs->state <= CONNMAN_STATE_ONLINE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_eldbus_proxy_del(Eldbus_Proxy *proxy)
|
||||||
|
{
|
||||||
|
Eldbus_Object *obj;
|
||||||
|
|
||||||
|
obj = eldbus_proxy_object_get(proxy);
|
||||||
|
eldbus_proxy_unref(proxy);
|
||||||
|
eldbus_object_unref(obj);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_connman_service_connect_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
|
_connman_service_connect_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -227,21 +243,23 @@ _connman_service_convert(Connman_Service *cs)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_connman_update_current_network(Connman_Service *cs)
|
_connman_update_current_network(Connman_Service *cs, Connman_Service_Type type)
|
||||||
{
|
{
|
||||||
if (connman_current_service[cs->type] != cs)
|
if (connman_current_service[type] != cs)
|
||||||
{
|
{
|
||||||
E_FREE(connman_current_connection[cs->type]);
|
E_FREE(connman_current_connection[type]);
|
||||||
if (cs)
|
if (cs)
|
||||||
connman_current_connection[cs->type] = E_NEW(Wireless_Connection, 1);
|
connman_current_connection[type] = E_NEW(Wireless_Connection, 1);
|
||||||
}
|
}
|
||||||
connman_current_service[cs->type] = cs;
|
connman_current_service[type] = cs;
|
||||||
if (cs)
|
if (cs)
|
||||||
{
|
{
|
||||||
connman_current_connection[cs->type]->wn = eina_hash_find(connman_services_map[cs->type], &cs);
|
connman_current_connection[type]->wn = eina_hash_find(connman_services_map[type], &cs);
|
||||||
memcpy(&connman_current_connection[cs->type]->method,
|
memcpy(&connman_current_connection[type]->method,
|
||||||
&cs->method, sizeof(Wireless_Connection) - sizeof(void*));
|
&cs->method, sizeof(Wireless_Connection) - sizeof(void*));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
connman_current_connection[type] = NULL;
|
||||||
wireless_wifi_current_networks_set(connman_current_connection);
|
wireless_wifi_current_networks_set(connman_current_connection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,6 +270,7 @@ _connman_update_networks(Connman_Service_Type type)
|
||||||
Connman_Service *cs;
|
Connman_Service *cs;
|
||||||
Wireless_Network *wn;
|
Wireless_Network *wn;
|
||||||
Eina_Hash *map;
|
Eina_Hash *map;
|
||||||
|
Connman_Service *services[CONNMAN_SERVICE_TYPE_LAST] = {NULL};
|
||||||
|
|
||||||
map = connman_services_map[type];
|
map = connman_services_map[type];
|
||||||
connman_services_map[type] = eina_hash_pointer_new(free);
|
connman_services_map[type] = eina_hash_pointer_new(free);
|
||||||
|
@ -261,12 +280,12 @@ _connman_update_networks(Connman_Service_Type type)
|
||||||
wn = _connman_service_convert(cs);
|
wn = _connman_service_convert(cs);
|
||||||
eina_hash_add(connman_services_map[type], &cs, wn);
|
eina_hash_add(connman_services_map[type], &cs, wn);
|
||||||
eina_array_push(arr, wn);
|
eina_array_push(arr, wn);
|
||||||
if (connman_current_service[type] && (cs->state == CONNMAN_STATE_ONLINE))
|
if (connman_current_service[type] && _connman_service_is_connected(cs))
|
||||||
connman_current_service[type] = cs;
|
services[type] = cs;
|
||||||
}
|
}
|
||||||
|
memcpy(&connman_current_service, services, CONNMAN_SERVICE_TYPE_LAST * sizeof(void*));
|
||||||
arr = wireless_wifi_networks_set(arr);
|
arr = wireless_wifi_networks_set(arr);
|
||||||
if (connman_current_service[type])
|
_connman_update_current_network(connman_current_service[type], type);
|
||||||
_connman_update_current_network(connman_current_service[type]);
|
|
||||||
eina_hash_free(map);
|
eina_hash_free(map);
|
||||||
eina_array_free(arr);
|
eina_array_free(arr);
|
||||||
}
|
}
|
||||||
|
@ -332,8 +351,6 @@ str_to_security(const char *s)
|
||||||
static void
|
static void
|
||||||
_connman_service_free(Connman_Service *cs)
|
_connman_service_free(Connman_Service *cs)
|
||||||
{
|
{
|
||||||
Eldbus_Object *obj;
|
|
||||||
|
|
||||||
if (!cs) return;
|
if (!cs) return;
|
||||||
|
|
||||||
if (cs->pending.connect)
|
if (cs->pending.connect)
|
||||||
|
@ -361,10 +378,8 @@ _connman_service_free(Connman_Service *cs)
|
||||||
eina_stringshare_del(cs->name);
|
eina_stringshare_del(cs->name);
|
||||||
eina_stringshare_del(cs->path);
|
eina_stringshare_del(cs->path);
|
||||||
eldbus_signal_handler_del(cs->handler);
|
eldbus_signal_handler_del(cs->handler);
|
||||||
obj = eldbus_proxy_object_get(cs->proxy);
|
|
||||||
DBG("service free %p || proxy %p", cs, cs->proxy);
|
DBG("service free %p || proxy %p", cs, cs->proxy);
|
||||||
eldbus_proxy_unref(cs->proxy);
|
_eldbus_proxy_del(cs->proxy);
|
||||||
eldbus_object_unref(obj);
|
|
||||||
connman_services_list[cs->type] = eina_inlist_remove(connman_services_list[cs->type], EINA_INLIST_GET(cs));
|
connman_services_list[cs->type] = eina_inlist_remove(connman_services_list[cs->type], EINA_INLIST_GET(cs));
|
||||||
|
|
||||||
free(cs);
|
free(cs);
|
||||||
|
@ -479,8 +494,8 @@ _connman_service_prop_dict_changed(Connman_Service *cs, Eldbus_Message_Iter *pro
|
||||||
if (eldbus_message_iter_arguments_get(dict, "sv", &name, &var))
|
if (eldbus_message_iter_arguments_get(dict, "sv", &name, &var))
|
||||||
_connman_service_parse_prop_changed(cs, name, var);
|
_connman_service_parse_prop_changed(cs, name, var);
|
||||||
}
|
}
|
||||||
if (cs->state == CONNMAN_STATE_ONLINE)
|
if (_connman_service_is_connected(cs))
|
||||||
_connman_update_current_network(cs);
|
_connman_update_current_network(cs, cs->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -492,8 +507,8 @@ _connman_service_property(void *data, const Eldbus_Message *msg)
|
||||||
|
|
||||||
if (eldbus_message_arguments_get(msg, "sv", &name, &var))
|
if (eldbus_message_arguments_get(msg, "sv", &name, &var))
|
||||||
_connman_service_parse_prop_changed(cs, name, var);
|
_connman_service_parse_prop_changed(cs, name, var);
|
||||||
if (cs->state == CONNMAN_STATE_ONLINE)
|
if (_connman_service_is_connected(cs))
|
||||||
_connman_update_current_network(cs);
|
_connman_update_current_network(cs, cs->type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Connman_Service *
|
static Connman_Service *
|
||||||
|
@ -557,7 +572,7 @@ _connman_technology_parse_prop_changed(Connman_Technology *ct, const char *name,
|
||||||
eldbus_message_iter_arguments_get(value, "b", &str);
|
eldbus_message_iter_arguments_get(value, "b", &str);
|
||||||
ct->tethering_passwd = eina_stringshare_add(str);
|
ct->tethering_passwd = eina_stringshare_add(str);
|
||||||
}
|
}
|
||||||
return EINA_FALSE;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -645,6 +660,8 @@ _connman_manager_getservices(void *data EINA_UNUSED, const Eldbus_Message *msg,
|
||||||
Eina_Bool update[CONNMAN_SERVICE_TYPE_LAST] = {0};
|
Eina_Bool update[CONNMAN_SERVICE_TYPE_LAST] = {0};
|
||||||
|
|
||||||
pending_getservices = NULL;
|
pending_getservices = NULL;
|
||||||
|
for (i = 0; i < CONNMAN_SERVICE_TYPE_LAST; i++)
|
||||||
|
eina_hash_free_buckets(connman_services[i]);
|
||||||
if (eldbus_message_error_get(msg, &name, &text))
|
if (eldbus_message_error_get(msg, &name, &text))
|
||||||
{
|
{
|
||||||
ERR("Could not get services. %s: %s", name, text);
|
ERR("Could not get services. %s: %s", name, text);
|
||||||
|
@ -785,7 +802,7 @@ _connman_manager_event_services(void *data EINA_UNUSED, const Eldbus_Message *ms
|
||||||
cs = eina_hash_find(connman_services[i], path);
|
cs = eina_hash_find(connman_services[i], path);
|
||||||
if (!cs) continue;
|
if (!cs) continue;
|
||||||
_connman_service_prop_dict_changed(cs, array);
|
_connman_service_prop_dict_changed(cs, array);
|
||||||
update[cs->type] = 1;
|
found = update[cs->type] = 1;
|
||||||
DBG("Changed service: %p %s", cs, path);
|
DBG("Changed service: %p %s", cs, path);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1093,7 +1110,6 @@ _connman_start(void)
|
||||||
static void
|
static void
|
||||||
_connman_end(Eina_Bool killed)
|
_connman_end(Eina_Bool killed)
|
||||||
{
|
{
|
||||||
Eldbus_Object *obj;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!proxy_manager) return;
|
if (!proxy_manager) return;
|
||||||
|
@ -1103,9 +1119,7 @@ _connman_end(Eina_Bool killed)
|
||||||
{
|
{
|
||||||
E_FREE_FUNC(connman_services[i], eina_hash_free);
|
E_FREE_FUNC(connman_services[i], eina_hash_free);
|
||||||
if (!connman_technology[i].proxy) continue;
|
if (!connman_technology[i].proxy) continue;
|
||||||
obj = eldbus_proxy_object_get(connman_technology[i].proxy);
|
E_FREE_FUNC(connman_technology[i].proxy, _eldbus_proxy_del);
|
||||||
E_FREE_FUNC(connman_technology[i].proxy, eldbus_proxy_unref);
|
|
||||||
eldbus_object_unref(obj);
|
|
||||||
}
|
}
|
||||||
E_FREE_FUNC(pending_getservices, eldbus_pending_cancel);
|
E_FREE_FUNC(pending_getservices, eldbus_pending_cancel);
|
||||||
E_FREE_FUNC(pending_getproperties_manager, eldbus_pending_cancel);
|
E_FREE_FUNC(pending_getproperties_manager, eldbus_pending_cancel);
|
||||||
|
@ -1114,8 +1128,7 @@ _connman_end(Eina_Bool killed)
|
||||||
else
|
else
|
||||||
E_FREE_LIST(signal_handlers, eldbus_signal_handler_del);
|
E_FREE_LIST(signal_handlers, eldbus_signal_handler_del);
|
||||||
|
|
||||||
obj = eldbus_proxy_object_get(proxy_manager);
|
E_FREE_FUNC(proxy_manager, _eldbus_proxy_del);
|
||||||
E_FREE_FUNC(proxy_manager, eldbus_proxy_unref);
|
|
||||||
E_FREE_FUNC(agent_iface, eldbus_service_object_unregister);
|
E_FREE_FUNC(agent_iface, eldbus_service_object_unregister);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,24 @@ static Eina_List *instances;
|
||||||
static Eina_List *wireless_auth_pending;
|
static Eina_List *wireless_auth_pending;
|
||||||
static Wireless_Auth_Popup *wireless_auth_popup;
|
static Wireless_Auth_Popup *wireless_auth_popup;
|
||||||
|
|
||||||
|
|
||||||
|
#undef DBG
|
||||||
|
#undef INF
|
||||||
|
#undef WRN
|
||||||
|
#undef ERR
|
||||||
|
|
||||||
|
#define DBG(...) EINA_LOG_DOM_DBG(_wireless_gadget_log_dom, __VA_ARGS__)
|
||||||
|
#define INF(...) EINA_LOG_DOM_INFO(_wireless_gadget_log_dom, __VA_ARGS__)
|
||||||
|
#define WRN(...) EINA_LOG_DOM_WARN(_wireless_gadget_log_dom, __VA_ARGS__)
|
||||||
|
#define ERR(...) EINA_LOG_DOM_ERR(_wireless_gadget_log_dom, __VA_ARGS__)
|
||||||
|
static int _wireless_gadget_log_dom = -1;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_wifi_icon_signal(Evas_Object *icon, int state, int strength)
|
_wifi_icon_signal(Evas_Object *icon, int state, int strength)
|
||||||
{
|
{
|
||||||
Edje_Message_Int_Set *msg;
|
Edje_Message_Int_Set *msg;
|
||||||
|
|
||||||
|
DBG("icon msg: %d %d%%", state, strength);
|
||||||
msg = alloca(sizeof(Edje_Message_Int_Set) + sizeof(int));
|
msg = alloca(sizeof(Edje_Message_Int_Set) + sizeof(int));
|
||||||
msg->count = 2;
|
msg->count = 2;
|
||||||
msg->val[0] = state;
|
msg->val[0] = state;
|
||||||
|
@ -74,6 +87,7 @@ _wifi_icon_init(Evas_Object *icon, Wireless_Network *wn)
|
||||||
if (!wn)
|
if (!wn)
|
||||||
{
|
{
|
||||||
elm_object_signal_emit(icon, "e,state,default", "e");
|
elm_object_signal_emit(icon, "e,state,default", "e");
|
||||||
|
elm_object_signal_emit(icon, "e,state,unsecured", "e");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (wn->state == WIRELESS_NETWORK_STATE_FAILURE)
|
if (wn->state == WIRELESS_NETWORK_STATE_FAILURE)
|
||||||
|
@ -228,7 +242,7 @@ _wireless_gadget_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, v
|
||||||
e_comp_object_util_autoclose(inst->popup.popup, NULL, _wireless_popup_key, NULL);
|
e_comp_object_util_autoclose(inst->popup.popup, NULL, _wireless_popup_key, NULL);
|
||||||
|
|
||||||
zone = e_zone_current_get();
|
zone = e_zone_current_get();
|
||||||
evas_object_resize(inst->popup.popup, zone->w / 5, zone->h / 4);
|
evas_object_resize(inst->popup.popup, zone->w / 5, zone->h / 3);
|
||||||
evas_object_show(inst->popup.popup);
|
evas_object_show(inst->popup.popup);
|
||||||
evas_object_event_callback_add(inst->popup.popup, EVAS_CALLBACK_DEL, _wireless_popup_del, inst);
|
evas_object_event_callback_add(inst->popup.popup, EVAS_CALLBACK_DEL, _wireless_popup_del, inst);
|
||||||
}
|
}
|
||||||
|
@ -317,6 +331,10 @@ wireless_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
|
||||||
evas_object_hide(inst->popup.popup);
|
evas_object_hide(inst->popup.popup);
|
||||||
evas_object_del(inst->popup.popup);
|
evas_object_del(inst->popup.popup);
|
||||||
free(inst);
|
free(inst);
|
||||||
|
|
||||||
|
if (instances) return;
|
||||||
|
eina_log_domain_unregister(_wireless_gadget_log_dom);
|
||||||
|
_wireless_gadget_log_dom = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -348,6 +366,7 @@ _wireless_gadget_refresh(Instance *inst)
|
||||||
elm_object_tooltip_content_cb_set(g, tooltip_cb[type], inst, NULL);
|
elm_object_tooltip_content_cb_set(g, tooltip_cb[type], inst, NULL);
|
||||||
evas_object_event_callback_add(g, EVAS_CALLBACK_MOUSE_DOWN, _wireless_gadget_mouse_down, inst);
|
evas_object_event_callback_add(g, EVAS_CALLBACK_MOUSE_DOWN, _wireless_gadget_mouse_down, inst);
|
||||||
}
|
}
|
||||||
|
DBG("Updating icon for %d", type);
|
||||||
_wifi_icon_init(inst->icon[type], wireless_current[type] ? wireless_current[type]->wn : NULL);
|
_wifi_icon_init(inst->icon[type], wireless_current[type] ? wireless_current[type]->wn : NULL);
|
||||||
evas_object_hide(inst->icon[type]);
|
evas_object_hide(inst->icon[type]);
|
||||||
avail++;
|
avail++;
|
||||||
|
@ -362,6 +381,7 @@ _wireless_gadget_refresh(Instance *inst)
|
||||||
/* only show ethernet if it's connected or there's no wifi available */
|
/* only show ethernet if it's connected or there's no wifi available */
|
||||||
if ((!inst->icon[WIRELESS_SERVICE_TYPE_WIFI]) ||
|
if ((!inst->icon[WIRELESS_SERVICE_TYPE_WIFI]) ||
|
||||||
(wireless_current[type] &&
|
(wireless_current[type] &&
|
||||||
|
wireless_current[type]->wn &&
|
||||||
(wireless_current[type]->wn->state == WIRELESS_NETWORK_STATE_ONLINE)))
|
(wireless_current[type]->wn->state == WIRELESS_NETWORK_STATE_ONLINE)))
|
||||||
{
|
{
|
||||||
elm_box_pack_end(inst->box, inst->icon[type]);
|
elm_box_pack_end(inst->box, inst->icon[type]);
|
||||||
|
@ -387,6 +407,8 @@ wireless_create(Evas_Object *parent, int *id, Z_Gadget_Site_Orient orient)
|
||||||
Evas_Object *g;
|
Evas_Object *g;
|
||||||
Instance *inst;
|
Instance *inst;
|
||||||
|
|
||||||
|
if (!instances)
|
||||||
|
_wireless_gadget_log_dom = eina_log_domain_register("wireless", EINA_COLOR_CYAN);
|
||||||
inst = E_NEW(Instance, 1);
|
inst = E_NEW(Instance, 1);
|
||||||
inst->orient = orient;
|
inst->orient = orient;
|
||||||
inst->popup.type = inst->tooltip.type = -1;
|
inst->popup.type = inst->tooltip.type = -1;
|
||||||
|
@ -418,6 +440,7 @@ EINTERN void
|
||||||
wireless_gadget_init(void)
|
wireless_gadget_init(void)
|
||||||
{
|
{
|
||||||
z_gadget_type_add("Wireless", wireless_create);
|
z_gadget_type_add("Wireless", wireless_create);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EINTERN void
|
EINTERN void
|
||||||
|
@ -477,11 +500,7 @@ wireless_wifi_current_networks_set(Wireless_Connection **current)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (type = 0; type < WIRELESS_SERVICE_TYPE_LAST; type++)
|
_wireless_gadget_refresh(inst);
|
||||||
{
|
|
||||||
if (inst->icon[type] && wireless_current[type])
|
|
||||||
_wifi_icon_init(inst->icon[type], wireless_current[type]->wn);
|
|
||||||
}
|
|
||||||
type = inst->tooltip.type;
|
type = inst->tooltip.type;
|
||||||
if (type < 0) continue;
|
if (type < 0) continue;
|
||||||
if (prev[type] &&
|
if (prev[type] &&
|
||||||
|
|
Loading…
Reference in New Issue