summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Houston <stephen@localhost.localdomain>2017-11-30 10:21:24 -0600
committerStephen Houston <stephen@localhost.localdomain>2017-11-30 10:21:24 -0600
commite4f8c89899d3287e4639566bffb2e248bd82d0e1 (patch)
treede9325af7ab87d02f03c36bb52ac88254ca2858d
parent5736bd5aae339ef5c0f79b441c85abc8a40f459f (diff)
Update when access points are added/removed.
-rw-r--r--TODO12
-rw-r--r--src/networkmanager.c47
2 files changed, 55 insertions, 4 deletions
diff --git a/TODO b/TODO
index d7072ce..8c98b9e 100644
--- a/TODO
+++ b/TODO
@@ -1,10 +1,14 @@
1NetworkManager Support: 1NetworkManager Support:
2
2--Untested-- 3--Untested--
3Dns config editing - DNS domain and name servers are likely not stored correctly. 4DNS config editing - DNS domain and name servers are likely not stored correctly.
4Proxy config editing 5Proxy config editing
6
5--Issues-- 7--Issues--
6Doesn't update the icon correctly when activing connections on separate devices 8Doesn't always update the icon correctly - Forgetting a wifi network goes back to ethernet mode... why?
7Random crashes 9Random crashes -- Are they sandbox related or wireless related?
10
11When forgetting a network the connection setting is removed and thus doesn't show up in the network list anymore -- however the access point is still available so this should somehow update that the connection setting is removed but not the access point.
12
8--Needed-- 13--Needed--
9Update when connections and access points are added/removed
10Add WEP support to agent. Currently only WPA will work. 14Add WEP support to agent. Currently only WPA will work.
diff --git a/src/networkmanager.c b/src/networkmanager.c
index 55f627a..d3e74c8 100644
--- a/src/networkmanager.c
+++ b/src/networkmanager.c
@@ -2077,6 +2077,47 @@ _networkmanager_manager_technology_event_property(void *data, const Eldbus_Messa
2077} 2077}
2078 2078
2079static void 2079static void
2080_networkmanager_manager_ap_add(void *data, const Eldbus_Message *msg)
2081{
2082 const char *path;
2083 Eldbus_Object *obj;
2084 Eldbus_Proxy *proxy;
2085 Eldbus_Pending *pend;
2086 NetworkManager_Technology *nt = data;
2087
2088 if (!eldbus_message_arguments_get(msg, "o", &path))
2089 {
2090 ERR("Could not parse connection update %p", msg);
2091 return;
2092 }
2093 obj = eldbus_object_get(dbus_conn, NETWORKMANAGER_BUS_NAME, path);
2094 proxy = eldbus_proxy_get(obj,
2095 NETWORKMANAGER_BUS_INTERFACE ".AccessPoint");
2096 pend = eldbus_proxy_property_get_all(proxy,
2097 _networkmanager_manager_getaps, nt);
2098 pending_technologies = eina_list_append(pending_technologies, pend);
2099}
2100
2101static void
2102_networkmanager_manager_ap_remove(void *data EINA_UNUSED, const Eldbus_Message *msg)
2103{
2104 const char *path;
2105 NetworkManager_Service *ns;
2106 int i;
2107
2108 if (!eldbus_message_arguments_get(msg, "o", &path))
2109 {
2110 ERR("Could not parse property update %p", msg);
2111 return;
2112 }
2113 ns = _networkmanager_service_find_path(path);
2114 EINA_SAFETY_ON_NULL_RETURN(ns);
2115 i = ns->type;
2116 _networkmanager_service_free(ns);
2117 _networkmanager_update_networks(i);
2118}
2119
2120static void
2080_networkmanager_manager_gettechnologies(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending) 2121_networkmanager_manager_gettechnologies(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending)
2081{ 2122{
2082 const char *name, *text; 2123 const char *name, *text;
@@ -2150,6 +2191,12 @@ _networkmanager_manager_gettechnologies(void *data, const Eldbus_Message *msg, E
2150 pend = eldbus_proxy_call(proxy, "GetAllAccessPoints", 2191 pend = eldbus_proxy_call(proxy, "GetAllAccessPoints",
2151 _networkmanager_manager_gettechnologies_prop_aps, nt, -1, ""); 2192 _networkmanager_manager_gettechnologies_prop_aps, nt, -1, "");
2152 pending_technologies = eina_list_append(pending_technologies, pend); 2193 pending_technologies = eina_list_append(pending_technologies, pend);
2194 sig_handlers = eina_list_append(sig_handlers,
2195 eldbus_proxy_signal_handler_add(proxy, "AccessPointAdded",
2196 _networkmanager_manager_ap_add, nt));
2197 sig_handlers = eina_list_append(sig_handlers,
2198 eldbus_proxy_signal_handler_add(proxy, "AccessPointRemoved",
2199 _networkmanager_manager_ap_remove, NULL));
2153 } 2200 }
2154} 2201}
2155 2202