summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Houston <stephen@localhost.localdomain>2017-11-21 12:23:51 -0600
committerStephen Houston <stephen@localhost.localdomain>2017-11-21 12:23:51 -0600
commit11626df018dcec6c8cc7f0ae48c04aaad849eee4 (patch)
treef4f973116ef4e261193cb296ad4ffcf990656fdd
parent62f2b9b9d940b3595e0c2409af3eafe6d9049ced (diff)
Update networkmanager detection and add window mode to tooltips.
-rw-r--r--src/networkmanager.c7
-rw-r--r--src/wireless.c16
2 files changed, 15 insertions, 8 deletions
diff --git a/src/networkmanager.c b/src/networkmanager.c
index ce2252e..62748d1 100644
--- a/src/networkmanager.c
+++ b/src/networkmanager.c
@@ -966,10 +966,7 @@ _networkmanager_service_state(void *data, int state)
966 ns->state = NETWORKMANAGER_STATE_IDLE; 966 ns->state = NETWORKMANAGER_STATE_IDLE;
967 967
968 NETWORKMANAGER_SERVICE_TYPE_ITER(i) 968 NETWORKMANAGER_SERVICE_TYPE_ITER(i)
969 { 969 _networkmanager_update_networks(i);
970 if (i != ns->type)
971 _networkmanager_update_networks(i);
972 }
973 if (_networkmanager_service_is_connected(ns)) 970 if (_networkmanager_service_is_connected(ns))
974 _networkmanager_update_current_network(ns, ns->type); 971 _networkmanager_update_current_network(ns, ns->type);
975} 972}
@@ -1462,7 +1459,6 @@ _networkmanager_manager_getactive(void *data EINA_UNUSED, const Eldbus_Message *
1462 eina_stringshare_replace(&active_connection, conn_path); 1459 eina_stringshare_replace(&active_connection, conn_path);
1463 NETWORKMANAGER_SERVICE_TYPE_ITER(i) 1460 NETWORKMANAGER_SERVICE_TYPE_ITER(i)
1464 { 1461 {
1465 _networkmanager_update_networks(i);
1466 EINA_INLIST_FOREACH(networkmanager_services_list[i], ns) 1462 EINA_INLIST_FOREACH(networkmanager_services_list[i], ns)
1467 { 1463 {
1468 if (ns->access_point) continue; 1464 if (ns->access_point) continue;
@@ -1470,7 +1466,6 @@ _networkmanager_manager_getactive(void *data EINA_UNUSED, const Eldbus_Message *
1470 { 1466 {
1471 ns->is_active_connection = EINA_FALSE; 1467 ns->is_active_connection = EINA_FALSE;
1472 ns->state = NETWORKMANAGER_STATE_IDLE; 1468 ns->state = NETWORKMANAGER_STATE_IDLE;
1473 _networkmanager_update_current_network(ns, ns->type);
1474 } 1469 }
1475 } 1470 }
1476 _networkmanager_update_networks(i); 1471 _networkmanager_update_networks(i);
diff --git a/src/wireless.c b/src/wireless.c
index 740d187..19d92f3 100644
--- a/src/wireless.c
+++ b/src/wireless.c
@@ -1341,7 +1341,7 @@ _wireless_gadget_icon_add(int type)
1341 elm_layout_file_set(g, elm_theme_group_path_find(NULL, wireless_theme_groups[type]), 1341 elm_layout_file_set(g, elm_theme_group_path_find(NULL, wireless_theme_groups[type]),
1342 wireless_theme_groups[type]); 1342 wireless_theme_groups[type]);
1343 elm_object_tooltip_content_cb_set(g, _wireless_tooltip, inst, NULL); 1343 elm_object_tooltip_content_cb_set(g, _wireless_tooltip, inst, NULL);
1344 //elm_object_tooltip_window_mode_set(g, EINA_TRUE); 1344 elm_object_tooltip_window_mode_set(g, EINA_TRUE);
1345 evas_object_event_callback_add(g, EVAS_CALLBACK_MOUSE_DOWN, _wireless_gadget_mouse_down, inst); 1345 evas_object_event_callback_add(g, EVAS_CALLBACK_MOUSE_DOWN, _wireless_gadget_mouse_down, inst);
1346 } 1346 }
1347 DBG("Updating icon for %d", type); 1347 DBG("Updating icon for %d", type);
@@ -1424,6 +1424,16 @@ _orient_change(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
1424 _wireless_gadget_refresh(); 1424 _wireless_gadget_refresh();
1425} 1425}
1426 1426
1427static void
1428_name_owner_changed(void *data EINA_UNUSED, const char *bus EINA_UNUSED, const char *from EINA_UNUSED, const char *to)
1429{
1430 if (!to[0])
1431 {
1432 inst->connection = WIRELESS_CONNECTION_TYPE_NETWORKMANAGER;
1433 _connection_init();
1434 }
1435}
1436
1427int 1437int
1428main(int argc, char *argv[]) 1438main(int argc, char *argv[])
1429{ 1439{
@@ -1440,11 +1450,13 @@ main(int argc, char *argv[])
1440 inst = calloc(1, sizeof(Instance)); 1450 inst = calloc(1, sizeof(Instance));
1441 snprintf(id, sizeof(id), "%s", getenv("E_GADGET_ID")); 1451 snprintf(id, sizeof(id), "%s", getenv("E_GADGET_ID"));
1442 inst->id = atoi(id); 1452 inst->id = atoi(id);
1443// inst->connection = WIRELESS_CONNECTION_TYPE_NETWORKMANAGER;
1444 inst->connection = WIRELESS_CONNECTION_TYPE_CONNMAN; 1453 inst->connection = WIRELESS_CONNECTION_TYPE_CONNMAN;
1445 inst->orient = E_GADGET_SITE_ORIENT_NONE; 1454 inst->orient = E_GADGET_SITE_ORIENT_NONE;
1446 wireless_popup.type = inst->tooltip.type = -1; 1455 wireless_popup.type = inst->tooltip.type = -1;
1447 1456
1457 eldbus_name_owner_changed_callback_add(dbus_conn, "net.connman",
1458 _name_owner_changed,
1459 NULL, EINA_TRUE);
1448 _connection_init(); 1460 _connection_init();
1449 1461
1450 inst->win = elm_win_add(NULL, "wireless", ELM_WIN_BASIC); 1462 inst->win = elm_win_add(NULL, "wireless", ELM_WIN_BASIC);