Merge lp:~franciscoda/docky/nm-1.0.7-docky-fix into lp:docky
- nm-1.0.7-docky-fix
- Merge into trunk
Proposed by
Francisco
Status: | Needs review |
---|---|
Proposed branch: | lp:~franciscoda/docky/nm-1.0.7-docky-fix |
Merge into: | lp:docky |
Diff against target: |
631 lines (+104/-95) 23 files modified
Docky.Services/Docky.Services/SystemService.cs (+7/-4) StandardPlugins/NetworkManager/src/ConnectionManager.cs (+4/-32) StandardPlugins/NetworkManager/src/DBusObject.cs (+18/-2) StandardPlugins/NetworkManager/src/DeviceManager.cs (+1/-1) StandardPlugins/NetworkManager/src/Enums.cs (+12/-9) StandardPlugins/NetworkManager/src/Interfaces/IAccessPoint.cs (+1/-1) StandardPlugins/NetworkManager/src/Interfaces/IActiveConnection.cs (+1/-1) StandardPlugins/NetworkManager/src/Interfaces/IConnectionManager.cs (+1/-1) StandardPlugins/NetworkManager/src/Interfaces/IDHCP4Config.cs (+1/-1) StandardPlugins/NetworkManager/src/Interfaces/IIP4Config.cs (+1/-1) StandardPlugins/NetworkManager/src/Interfaces/INetManager.cs (+3/-2) StandardPlugins/NetworkManager/src/Interfaces/INetworkConnection.cs (+2/-2) StandardPlugins/NetworkManager/src/Interfaces/INetworkDevice.cs (+1/-1) StandardPlugins/NetworkManager/src/Interfaces/IWiredDevice.cs (+1/-1) StandardPlugins/NetworkManager/src/Interfaces/IWirelessDevice.cs (+1/-1) StandardPlugins/NetworkManager/src/NetworkConnection.cs (+2/-2) StandardPlugins/NetworkManager/src/NetworkDevice.cs (+7/-7) StandardPlugins/NetworkManager/src/NetworkManager.cs (+20/-11) StandardPlugins/NetworkManager/src/NetworkManagerDocklet.cs (+10/-5) StandardPlugins/NetworkManager/src/WiredDevice.cs (+2/-2) StandardPlugins/NetworkManager/src/WirelessAccessPoint.cs (+5/-5) StandardPlugins/NetworkManager/src/WirelessConnection.cs (+1/-1) StandardPlugins/NetworkManager/src/WirelessDevice.cs (+2/-2) |
To merge this branch: | bzr merge lp:~franciscoda/docky/nm-1.0.7-docky-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Docky Core | Pending | ||
Review via email:
|
Commit message
Description of the change
Fixed Network Manager plugin. Tested on NetworkManager 1.0.7
Added disconnect option for active connections by clicking on them
Most files in StandardPlugins
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Docky.Services/Docky.Services/SystemService.cs' | |||
2 | --- Docky.Services/Docky.Services/SystemService.cs 2014-05-06 18:12:14 +0000 | |||
3 | +++ Docky.Services/Docky.Services/SystemService.cs 2015-10-27 09:11:09 +0000 | |||
4 | @@ -117,7 +117,9 @@ | |||
5 | 117 | 117 | ||
6 | 118 | if (Bus.System.NameHasOwner (NetworkManagerName)) { | 118 | if (Bus.System.NameHasOwner (NetworkManagerName)) { |
7 | 119 | try { | 119 | try { |
9 | 120 | network = Bus.System.GetObject<INetworkManager> (NetworkManagerName, new ObjectPath (NetworkManagerPath)); | 120 | ObjectPath op = new ObjectPath (NetworkManagerPath); |
10 | 121 | network = Bus.System.GetObject<INetworkManager> (NetworkManagerName, op); | ||
11 | 122 | networkProperties = Bus.System.GetObject<org.freedesktop.DBus.Properties> (NetworkManagerName, op); | ||
12 | 121 | var state = State; | 123 | var state = State; |
13 | 122 | NetworkConnected = (state == NetworkState.ConnectedGlobal || state == NetworkState.ConnectedLocal | 124 | NetworkConnected = (state == NetworkState.ConnectedGlobal || state == NetworkState.ConnectedLocal |
14 | 123 | || state == NetworkState.ConnectedSite); | 125 | || state == NetworkState.ConnectedSite); |
15 | @@ -142,15 +144,16 @@ | |||
16 | 142 | 144 | ||
17 | 143 | const string NetworkManagerName = "org.freedesktop.NetworkManager"; | 145 | const string NetworkManagerName = "org.freedesktop.NetworkManager"; |
18 | 144 | const string NetworkManagerPath = "/org/freedesktop/NetworkManager"; | 146 | const string NetworkManagerPath = "/org/freedesktop/NetworkManager"; |
19 | 147 | org.freedesktop.DBus.Properties networkProperties; | ||
20 | 145 | INetworkManager network; | 148 | INetworkManager network; |
21 | 146 | 149 | ||
22 | 147 | [Interface(NetworkManagerName)] | 150 | [Interface(NetworkManagerName)] |
24 | 148 | interface INetworkManager : org.freedesktop.DBus.Properties | 151 | public interface INetworkManager |
25 | 149 | { | 152 | { |
26 | 150 | event StateChangedHandler StateChanged; | 153 | event StateChangedHandler StateChanged; |
27 | 151 | } | 154 | } |
28 | 152 | 155 | ||
30 | 153 | delegate void StateChangedHandler (uint state); | 156 | public delegate void StateChangedHandler (uint state); |
31 | 154 | 157 | ||
32 | 155 | public bool NetworkConnected { get; private set; } | 158 | public bool NetworkConnected { get; private set; } |
33 | 156 | 159 | ||
34 | @@ -175,7 +178,7 @@ | |||
35 | 175 | NetworkState State { | 178 | NetworkState State { |
36 | 176 | get { | 179 | get { |
37 | 177 | try { | 180 | try { |
39 | 178 | return (NetworkState) Enum.ToObject (typeof(NetworkState), network.Get (NetworkManagerName, "State")); | 181 | return (NetworkState) Enum.ToObject (typeof(NetworkState), networkProperties.Get (NetworkManagerName, "State")); |
40 | 179 | } catch (Exception) { | 182 | } catch (Exception) { |
41 | 180 | return NetworkState.Unknown; | 183 | return NetworkState.Unknown; |
42 | 181 | } | 184 | } |
43 | 182 | 185 | ||
44 | === modified file 'StandardPlugins/NetworkManager/src/ConnectionManager.cs' | |||
45 | --- StandardPlugins/NetworkManager/src/ConnectionManager.cs 2010-10-09 12:54:14 +0000 | |||
46 | +++ StandardPlugins/NetworkManager/src/ConnectionManager.cs 2015-10-27 09:11:09 +0000 | |||
47 | @@ -29,18 +29,13 @@ | |||
48 | 29 | { | 29 | { |
49 | 30 | public class ConnectionManager | 30 | public class ConnectionManager |
50 | 31 | { | 31 | { |
54 | 32 | const string SettingsObjectPath = "/org/freedesktop/NetworkManagerSettings"; | 32 | const string SettingsObjectPath = "/org/freedesktop/NetworkManager/Settings"; |
55 | 33 | const string SystemBus = "org.freedesktop.NetworkManagerSystemSettings"; | 33 | const string SystemBus = "org.freedesktop.NetworkManager"; |
53 | 34 | const string UserBus = "org.freedesktop.NetworkManagerUserSettings"; | ||
56 | 35 | 34 | ||
57 | 36 | public ConnectionManager() | 35 | public ConnectionManager() |
58 | 37 | { | 36 | { |
59 | 38 | SystemConnectionManager = new DBusObject<IConnectionManager> (SystemBus, SettingsObjectPath); | 37 | SystemConnectionManager = new DBusObject<IConnectionManager> (SystemBus, SettingsObjectPath); |
60 | 39 | //SystemConnectionManager.BusObject.NewConnection += OnConnectionAdded; | ||
61 | 40 | UserConnectionManager = new DBusObject<IConnectionManager> (UserBus, SettingsObjectPath); | ||
62 | 41 | //UserConnectionManager.BusObject.NewConnection += OnConnectionAdded; | ||
63 | 42 | 38 | ||
64 | 43 | UserConnections = new List<NetworkConnection> (); | ||
65 | 44 | SystemConnections = new List<NetworkConnection> (); | 39 | SystemConnections = new List<NetworkConnection> (); |
66 | 45 | 40 | ||
67 | 46 | UpdateConnections (); | 41 | UpdateConnections (); |
68 | @@ -49,11 +44,9 @@ | |||
69 | 49 | } | 44 | } |
70 | 50 | 45 | ||
71 | 51 | DBusObject<IConnectionManager> SystemConnectionManager { get; set; } | 46 | DBusObject<IConnectionManager> SystemConnectionManager { get; set; } |
72 | 52 | DBusObject<IConnectionManager> UserConnectionManager { get; set; } | ||
73 | 53 | public List<NetworkConnection> UserConnections { get; private set; } | ||
74 | 54 | public List<NetworkConnection> SystemConnections { get; private set; } | 47 | public List<NetworkConnection> SystemConnections { get; private set; } |
75 | 55 | public IEnumerable<NetworkConnection> AllConnections { | 48 | public IEnumerable<NetworkConnection> AllConnections { |
77 | 56 | get { return UserConnections.Union (SystemConnections); } | 49 | get { return SystemConnections; } |
78 | 57 | } | 50 | } |
79 | 58 | 51 | ||
80 | 59 | 52 | ||
81 | @@ -92,28 +85,7 @@ | |||
82 | 92 | Log<ConnectionManager>.Debug (e.StackTrace); | 85 | Log<ConnectionManager>.Debug (e.StackTrace); |
83 | 93 | } | 86 | } |
84 | 94 | } | 87 | } |
107 | 95 | 88 | ||
86 | 96 | lock (UserConnections) { | ||
87 | 97 | UserConnections.Clear (); | ||
88 | 98 | try { | ||
89 | 99 | foreach (string con in UserConnectionManager.BusObject.ListConnections ()) | ||
90 | 100 | { | ||
91 | 101 | NetworkConnection connection = new NetworkConnection (UserBus, con, ConnectionOwner.User); | ||
92 | 102 | if (connection.Settings.ContainsKey ("802-11-wireless")) | ||
93 | 103 | connection = new WirelessConnection (UserBus, con, ConnectionOwner.User); | ||
94 | 104 | else if (connection.Settings.ContainsKey ("802-3-ethernet")) | ||
95 | 105 | connection = new WiredConnection (UserBus, con, ConnectionOwner.User); | ||
96 | 106 | else | ||
97 | 107 | continue; | ||
98 | 108 | |||
99 | 109 | //connection.ConnectionRemoved += OnNetworkConnectionRemoved; | ||
100 | 110 | UserConnections.Add (connection); | ||
101 | 111 | } | ||
102 | 112 | } catch (Exception e) { | ||
103 | 113 | Log<ConnectionManager>.Error (e.Message); | ||
104 | 114 | Log<ConnectionManager>.Debug (e.StackTrace); | ||
105 | 115 | } | ||
106 | 116 | } | ||
108 | 117 | } | 89 | } |
109 | 118 | } | 90 | } |
110 | 119 | } | 91 | } |
111 | 120 | 92 | ||
112 | === modified file 'StandardPlugins/NetworkManager/src/DBusObject.cs' | |||
113 | --- StandardPlugins/NetworkManager/src/DBusObject.cs 2010-10-09 12:54:14 +0000 | |||
114 | +++ StandardPlugins/NetworkManager/src/DBusObject.cs 2015-10-27 09:11:09 +0000 | |||
115 | @@ -17,6 +17,7 @@ | |||
116 | 17 | 17 | ||
117 | 18 | using System; | 18 | using System; |
118 | 19 | using System.Collections.Generic; | 19 | using System.Collections.Generic; |
119 | 20 | using System.Linq; | ||
120 | 20 | 21 | ||
121 | 21 | using DBus; | 22 | using DBus; |
122 | 22 | using org.freedesktop.DBus; | 23 | using org.freedesktop.DBus; |
123 | @@ -27,6 +28,7 @@ | |||
124 | 27 | { | 28 | { |
125 | 28 | public class DBusObject<T> | 29 | public class DBusObject<T> |
126 | 29 | { | 30 | { |
127 | 31 | private org.freedesktop.DBus.Properties PropGetter; | ||
128 | 30 | public string BusName { get; private set; } | 32 | public string BusName { get; private set; } |
129 | 31 | public string ObjectPath { get; private set; } | 33 | public string ObjectPath { get; private set; } |
130 | 32 | public T BusObject { get; private set; } | 34 | public T BusObject { get; private set; } |
131 | @@ -35,13 +37,27 @@ | |||
132 | 35 | { | 37 | { |
133 | 36 | this.ObjectPath = objectPath; | 38 | this.ObjectPath = objectPath; |
134 | 37 | this.BusName = busName; | 39 | this.BusName = busName; |
136 | 38 | 40 | ||
137 | 41 | ObjectPath op = new ObjectPath(this.ObjectPath); | ||
138 | 39 | try { | 42 | try { |
140 | 40 | this.BusObject = Bus.System.GetObject<T> (BusName, new ObjectPath (ObjectPath)); | 43 | this.BusObject = Bus.System.GetObject<T> (BusName, op); |
141 | 44 | if (this.BusObject == null) | ||
142 | 45 | throw new Exception ("Bus.System.GetObject returned null for arguments: " + busName + "," + objectPath); | ||
143 | 41 | } catch (Exception e) { | 46 | } catch (Exception e) { |
144 | 42 | Log<DBusObject<T>>.Error (e.Message); | 47 | Log<DBusObject<T>>.Error (e.Message); |
145 | 43 | Log<DBusObject<T>>.Debug (e.StackTrace); | 48 | Log<DBusObject<T>>.Debug (e.StackTrace); |
146 | 44 | } | 49 | } |
147 | 50 | this.PropGetter = Bus.System.GetObject<org.freedesktop.DBus.Properties>(this.BusName, op); | ||
148 | 51 | } | ||
149 | 52 | public object Get (string propertyName) | ||
150 | 53 | { | ||
151 | 54 | return this.PropGetter.Get ( | ||
152 | 55 | typeof (T).GetCustomAttributes(typeof (InterfaceAttribute), true) | ||
153 | 56 | .Cast<InterfaceAttribute> () | ||
154 | 57 | .Select (i => i.Name) | ||
155 | 58 | .FirstOrDefault(), | ||
156 | 59 | propertyName | ||
157 | 60 | ); | ||
158 | 45 | } | 61 | } |
159 | 46 | } | 62 | } |
160 | 47 | } | 63 | } |
161 | 48 | 64 | ||
162 | === modified file 'StandardPlugins/NetworkManager/src/DeviceManager.cs' | |||
163 | --- StandardPlugins/NetworkManager/src/DeviceManager.cs 2010-10-09 12:54:14 +0000 | |||
164 | +++ StandardPlugins/NetworkManager/src/DeviceManager.cs 2015-10-27 09:11:09 +0000 | |||
165 | @@ -27,7 +27,7 @@ | |||
166 | 27 | { | 27 | { |
167 | 28 | public IEnumerable<string> ActiveConnections { | 28 | public IEnumerable<string> ActiveConnections { |
168 | 29 | get { | 29 | get { |
170 | 30 | foreach (ObjectPath conPath in (ObjectPath[]) BusObject.Get (BusName, "ActiveConnections")) | 30 | foreach (ObjectPath conPath in (ObjectPath[]) this.Get ("ActiveConnections")) |
171 | 31 | yield return conPath.ToString (); | 31 | yield return conPath.ToString (); |
172 | 32 | } | 32 | } |
173 | 33 | } | 33 | } |
174 | 34 | 34 | ||
175 | === modified file 'StandardPlugins/NetworkManager/src/Enums.cs' | |||
176 | --- StandardPlugins/NetworkManager/src/Enums.cs 2009-11-25 15:37:53 +0000 | |||
177 | +++ StandardPlugins/NetworkManager/src/Enums.cs 2015-10-27 09:11:09 +0000 | |||
178 | @@ -27,15 +27,18 @@ | |||
179 | 27 | 27 | ||
180 | 28 | public enum DeviceState { | 28 | public enum DeviceState { |
181 | 29 | Unknown = 0, | 29 | Unknown = 0, |
191 | 30 | Unmanaged, | 30 | Unmanaged = 10, |
192 | 31 | Unavailable, | 31 | Unavailable = 20, |
193 | 32 | Disconnected, | 32 | Disconnected = 30, |
194 | 33 | Preparing, | 33 | Preparing = 40, |
195 | 34 | Configuring, | 34 | Configuring = 50, |
196 | 35 | NeedsAuth, | 35 | NeedsAuth = 60, |
197 | 36 | IPConfiguring, | 36 | IPConfiguring = 70, |
198 | 37 | Active, | 37 | IPChecking = 80, |
199 | 38 | Failed | 38 | Secondaries = 90, |
200 | 39 | Active = 100, | ||
201 | 40 | Deactivating = 110, | ||
202 | 41 | Failed = 120 | ||
203 | 39 | } | 42 | } |
204 | 40 | 43 | ||
205 | 41 | public enum ConnectionOwner { | 44 | public enum ConnectionOwner { |
206 | 42 | 45 | ||
207 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/IAccessPoint.cs' | |||
208 | --- StandardPlugins/NetworkManager/src/Interfaces/IAccessPoint.cs 2010-10-09 12:54:14 +0000 | |||
209 | +++ StandardPlugins/NetworkManager/src/Interfaces/IAccessPoint.cs 2015-10-27 09:11:09 +0000 | |||
210 | @@ -23,7 +23,7 @@ | |||
211 | 23 | namespace NetworkManagerDocklet | 23 | namespace NetworkManagerDocklet |
212 | 24 | { | 24 | { |
213 | 25 | [Interface ("org.freedesktop.NetworkManager.AccessPoint")] | 25 | [Interface ("org.freedesktop.NetworkManager.AccessPoint")] |
215 | 26 | public interface IAccessPoint : org.freedesktop.DBus.Properties | 26 | public interface IAccessPoint |
216 | 27 | { | 27 | { |
217 | 28 | } | 28 | } |
218 | 29 | } | 29 | } |
219 | 30 | 30 | ||
220 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/IActiveConnection.cs' | |||
221 | --- StandardPlugins/NetworkManager/src/Interfaces/IActiveConnection.cs 2010-10-09 12:54:14 +0000 | |||
222 | +++ StandardPlugins/NetworkManager/src/Interfaces/IActiveConnection.cs 2015-10-27 09:11:09 +0000 | |||
223 | @@ -23,7 +23,7 @@ | |||
224 | 23 | namespace NetworkManagerDocklet | 23 | namespace NetworkManagerDocklet |
225 | 24 | { | 24 | { |
226 | 25 | [Interface ("org.freedesktop.NetworkManager.Connection.Active")] | 25 | [Interface ("org.freedesktop.NetworkManager.Connection.Active")] |
228 | 26 | public interface IActiveConnection : org.freedesktop.DBus.Properties | 26 | public interface IActiveConnection |
229 | 27 | { | 27 | { |
230 | 28 | } | 28 | } |
231 | 29 | } | 29 | } |
232 | 30 | 30 | ||
233 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/IConnectionManager.cs' | |||
234 | --- StandardPlugins/NetworkManager/src/Interfaces/IConnectionManager.cs 2010-10-09 12:54:14 +0000 | |||
235 | +++ StandardPlugins/NetworkManager/src/Interfaces/IConnectionManager.cs 2015-10-27 09:11:09 +0000 | |||
236 | @@ -24,7 +24,7 @@ | |||
237 | 24 | { | 24 | { |
238 | 25 | public delegate void ConnectionAddedHandler (string objectPath); | 25 | public delegate void ConnectionAddedHandler (string objectPath); |
239 | 26 | 26 | ||
241 | 27 | [Interface ("org.freedesktop.NetworkManagerSettings")] | 27 | [Interface ("org.freedesktop.NetworkManager.Settings")] |
242 | 28 | public interface IConnectionManager | 28 | public interface IConnectionManager |
243 | 29 | { | 29 | { |
244 | 30 | string[] ListConnections (); | 30 | string[] ListConnections (); |
245 | 31 | 31 | ||
246 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/IDHCP4Config.cs' | |||
247 | --- StandardPlugins/NetworkManager/src/Interfaces/IDHCP4Config.cs 2010-10-09 12:54:14 +0000 | |||
248 | +++ StandardPlugins/NetworkManager/src/Interfaces/IDHCP4Config.cs 2015-10-27 09:11:09 +0000 | |||
249 | @@ -23,7 +23,7 @@ | |||
250 | 23 | namespace NetworkManagerDocklet | 23 | namespace NetworkManagerDocklet |
251 | 24 | { | 24 | { |
252 | 25 | [Interface ("org.freedesktop.NetworkManager.DHCP4Config")] | 25 | [Interface ("org.freedesktop.NetworkManager.DHCP4Config")] |
254 | 26 | public interface IDHCP4Config : org.freedesktop.DBus.Properties | 26 | public interface IDHCP4Config |
255 | 27 | { | 27 | { |
256 | 28 | } | 28 | } |
257 | 29 | } | 29 | } |
258 | 30 | 30 | ||
259 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/IIP4Config.cs' | |||
260 | --- StandardPlugins/NetworkManager/src/Interfaces/IIP4Config.cs 2010-10-09 12:54:14 +0000 | |||
261 | +++ StandardPlugins/NetworkManager/src/Interfaces/IIP4Config.cs 2015-10-27 09:11:09 +0000 | |||
262 | @@ -23,7 +23,7 @@ | |||
263 | 23 | namespace NetworkManagerDocklet | 23 | namespace NetworkManagerDocklet |
264 | 24 | { | 24 | { |
265 | 25 | [Interface ("org.freedesktop.NetworkManager.IP4Config")] | 25 | [Interface ("org.freedesktop.NetworkManager.IP4Config")] |
267 | 26 | public interface IIP4Config : org.freedesktop.DBus.Properties | 26 | public interface IIP4Config |
268 | 27 | { | 27 | { |
269 | 28 | } | 28 | } |
270 | 29 | } | 29 | } |
271 | 30 | 30 | ||
272 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/INetManager.cs' | |||
273 | --- StandardPlugins/NetworkManager/src/Interfaces/INetManager.cs 2010-10-09 12:54:14 +0000 | |||
274 | +++ StandardPlugins/NetworkManager/src/Interfaces/INetManager.cs 2015-10-27 09:11:09 +0000 | |||
275 | @@ -23,10 +23,11 @@ | |||
276 | 23 | namespace NetworkManagerDocklet | 23 | namespace NetworkManagerDocklet |
277 | 24 | { | 24 | { |
278 | 25 | [Interface ("org.freedesktop.NetworkManager")] | 25 | [Interface ("org.freedesktop.NetworkManager")] |
280 | 26 | public interface INetManager : org.freedesktop.DBus.Properties | 26 | public interface INetManager |
281 | 27 | { | 27 | { |
282 | 28 | ObjectPath[] GetDevices (); | 28 | ObjectPath[] GetDevices (); |
284 | 29 | ObjectPath ActivateConnection (string serviceName, ObjectPath connection, ObjectPath device, ObjectPath specificObject); | 29 | ObjectPath ActivateConnection (ObjectPath connection, ObjectPath device, ObjectPath specificObject); |
285 | 30 | void DeactivateConnection (ObjectPath active_connection); | ||
286 | 30 | uint state (); | 31 | uint state (); |
287 | 31 | } | 32 | } |
288 | 32 | } | 33 | } |
289 | 33 | 34 | ||
290 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/INetworkConnection.cs' | |||
291 | --- StandardPlugins/NetworkManager/src/Interfaces/INetworkConnection.cs 2010-10-09 12:54:14 +0000 | |||
292 | +++ StandardPlugins/NetworkManager/src/Interfaces/INetworkConnection.cs 2015-10-27 09:11:09 +0000 | |||
293 | @@ -23,10 +23,10 @@ | |||
294 | 23 | 23 | ||
295 | 24 | namespace NetworkManagerDocklet | 24 | namespace NetworkManagerDocklet |
296 | 25 | { | 25 | { |
298 | 26 | [Interface("org.freedesktop.NetworkManagerSettings.Connection")] | 26 | [Interface("org.freedesktop.NetworkManager.Settings.Connection")] |
299 | 27 | public interface INetworkConnection | 27 | public interface INetworkConnection |
300 | 28 | { | 28 | { |
302 | 29 | IDictionary<string, IDictionary<string, object>> GetSettings(); | 29 | Dictionary<string, Dictionary<string, object>> GetSettings(); |
303 | 30 | event ConnectionRemovedHandler Removed; | 30 | event ConnectionRemovedHandler Removed; |
304 | 31 | } | 31 | } |
305 | 32 | 32 | ||
306 | 33 | 33 | ||
307 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/INetworkDevice.cs' | |||
308 | --- StandardPlugins/NetworkManager/src/Interfaces/INetworkDevice.cs 2010-10-09 12:54:14 +0000 | |||
309 | +++ StandardPlugins/NetworkManager/src/Interfaces/INetworkDevice.cs 2015-10-27 09:11:09 +0000 | |||
310 | @@ -23,7 +23,7 @@ | |||
311 | 23 | namespace NetworkManagerDocklet | 23 | namespace NetworkManagerDocklet |
312 | 24 | { | 24 | { |
313 | 25 | [Interface ("org.freedesktop.NetworkManager.Device")] | 25 | [Interface ("org.freedesktop.NetworkManager.Device")] |
315 | 26 | public interface INetworkDevice : org.freedesktop.DBus.Properties | 26 | public interface INetworkDevice |
316 | 27 | { | 27 | { |
317 | 28 | event StateChangedHandler StateChanged; | 28 | event StateChangedHandler StateChanged; |
318 | 29 | } | 29 | } |
319 | 30 | 30 | ||
320 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/IWiredDevice.cs' | |||
321 | --- StandardPlugins/NetworkManager/src/Interfaces/IWiredDevice.cs 2010-10-09 12:54:14 +0000 | |||
322 | +++ StandardPlugins/NetworkManager/src/Interfaces/IWiredDevice.cs 2015-10-27 09:11:09 +0000 | |||
323 | @@ -23,7 +23,7 @@ | |||
324 | 23 | namespace NetworkManagerDocklet | 23 | namespace NetworkManagerDocklet |
325 | 24 | { | 24 | { |
326 | 25 | [Interface ("org.freedesktop.NetworkManager.Device.Wired")] | 25 | [Interface ("org.freedesktop.NetworkManager.Device.Wired")] |
328 | 26 | public interface IWiredDevice : org.freedesktop.DBus.Properties | 26 | public interface IWiredDevice |
329 | 27 | { | 27 | { |
330 | 28 | } | 28 | } |
331 | 29 | } | 29 | } |
332 | 30 | 30 | ||
333 | === modified file 'StandardPlugins/NetworkManager/src/Interfaces/IWirelessDevice.cs' | |||
334 | --- StandardPlugins/NetworkManager/src/Interfaces/IWirelessDevice.cs 2010-10-09 12:54:14 +0000 | |||
335 | +++ StandardPlugins/NetworkManager/src/Interfaces/IWirelessDevice.cs 2015-10-27 09:11:09 +0000 | |||
336 | @@ -23,7 +23,7 @@ | |||
337 | 23 | namespace NetworkManagerDocklet | 23 | namespace NetworkManagerDocklet |
338 | 24 | { | 24 | { |
339 | 25 | [Interface ("org.freedesktop.NetworkManager.Device.Wireless")] | 25 | [Interface ("org.freedesktop.NetworkManager.Device.Wireless")] |
341 | 26 | public interface IWirelessDevice : org.freedesktop.DBus.Properties | 26 | public interface IWirelessDevice |
342 | 27 | { | 27 | { |
343 | 28 | ObjectPath[] GetAccessPoints (); | 28 | ObjectPath[] GetAccessPoints (); |
344 | 29 | event AccessPointAddRemoveHandler AccessPointAdded; | 29 | event AccessPointAddRemoveHandler AccessPointAdded; |
345 | 30 | 30 | ||
346 | === modified file 'StandardPlugins/NetworkManager/src/NetworkConnection.cs' | |||
347 | --- StandardPlugins/NetworkManager/src/NetworkConnection.cs 2010-10-09 12:54:14 +0000 | |||
348 | +++ StandardPlugins/NetworkManager/src/NetworkConnection.cs 2015-10-27 09:11:09 +0000 | |||
349 | @@ -41,11 +41,11 @@ | |||
350 | 41 | 41 | ||
351 | 42 | public ConnectionOwner Owner { get; private set; } | 42 | public ConnectionOwner Owner { get; private set; } |
352 | 43 | 43 | ||
354 | 44 | public IDictionary<string, IDictionary<string, object>> Settings { | 44 | public Dictionary<string, Dictionary<string, object>> Settings { |
355 | 45 | get { return BusObject.GetSettings (); } | 45 | get { return BusObject.GetSettings (); } |
356 | 46 | } | 46 | } |
357 | 47 | 47 | ||
359 | 48 | private IDictionary<string, object> Connection { | 48 | private Dictionary<string, object> Connection { |
360 | 49 | get { return this.Settings["connection"]; } | 49 | get { return this.Settings["connection"]; } |
361 | 50 | } | 50 | } |
362 | 51 | 51 | ||
363 | 52 | 52 | ||
364 | === modified file 'StandardPlugins/NetworkManager/src/NetworkDevice.cs' | |||
365 | --- StandardPlugins/NetworkManager/src/NetworkDevice.cs 2011-01-09 18:02:06 +0000 | |||
366 | +++ StandardPlugins/NetworkManager/src/NetworkDevice.cs 2015-10-27 09:11:09 +0000 | |||
367 | @@ -63,7 +63,7 @@ | |||
368 | 63 | public DeviceType DType { | 63 | public DeviceType DType { |
369 | 64 | get { | 64 | get { |
370 | 65 | try { | 65 | try { |
372 | 66 | return (DeviceType) Enum.ToObject (typeof (DeviceType), BusObject.Get (BusName, "DeviceType")); | 66 | return (DeviceType) Enum.ToObject (typeof (DeviceType), this.Get ("DeviceType")); |
373 | 67 | } catch (Exception e) { | 67 | } catch (Exception e) { |
374 | 68 | Log<NetworkDevice>.Error (e.Message); | 68 | Log<NetworkDevice>.Error (e.Message); |
375 | 69 | Log<NetworkDevice>.Debug (e.StackTrace); | 69 | Log<NetworkDevice>.Debug (e.StackTrace); |
376 | @@ -75,7 +75,7 @@ | |||
377 | 75 | public DeviceState State { | 75 | public DeviceState State { |
378 | 76 | get { | 76 | get { |
379 | 77 | try { | 77 | try { |
381 | 78 | return (DeviceState) Enum.ToObject (typeof (DeviceState), BusObject.Get (BusName, "State")); | 78 | return (DeviceState) Enum.ToObject (typeof (DeviceState), this.Get ("State")); |
382 | 79 | } catch (Exception e) { | 79 | } catch (Exception e) { |
383 | 80 | Log<NetworkDevice>.Error (e.Message); | 80 | Log<NetworkDevice>.Error (e.Message); |
384 | 81 | Log<NetworkDevice>.Debug (e.StackTrace); | 81 | Log<NetworkDevice>.Debug (e.StackTrace); |
385 | @@ -93,16 +93,16 @@ | |||
386 | 93 | void SetIPs () | 93 | void SetIPs () |
387 | 94 | { | 94 | { |
388 | 95 | if (State == DeviceState.Active) { | 95 | if (State == DeviceState.Active) { |
390 | 96 | if (BusObject.Get (BusName, "Dhcp4Config").ToString () != "/") | 96 | if (this.Get ("Dhcp4Config").ToString () != "/") |
391 | 97 | ConType = ConnectionType.Manaul; | 97 | ConType = ConnectionType.Manaul; |
392 | 98 | else | 98 | else |
393 | 99 | ConType = ConnectionType.DHCP; | 99 | ConType = ConnectionType.DHCP; |
397 | 100 | IP4Config = new DBusObject<IIP4Config> (NMBusName, BusObject.Get (BusName, "Ip4Config").ToString ()); | 100 | IP4Config = new DBusObject<IIP4Config> (NMBusName, this.Get ("Ip4Config").ToString ()); |
398 | 101 | IP4Address = new IPAddress (long.Parse (BusObject.Get (BusName, "Ip4Address").ToString ())); | 101 | IP4Address = new IPAddress (long.Parse (this.Get ("Ip4Address").ToString ())); |
399 | 102 | uint[][] Addresses = (uint[][]) IP4Config.BusObject.Get (IP4Config.BusName, "Addresses"); | 102 | uint[][] Addresses = (uint[][]) IP4Config.Get ("Addresses"); |
400 | 103 | Gateway = new IPAddress (Addresses[0][2]); | 103 | Gateway = new IPAddress (Addresses[0][2]); |
401 | 104 | SubnetMask = ConvertPrefixToIp ((int) Addresses[0][1]); | 104 | SubnetMask = ConvertPrefixToIp ((int) Addresses[0][1]); |
403 | 105 | uint[] NameServers = (uint[]) IP4Config.BusObject.Get (IP4Config.BusName, "Nameservers"); | 105 | uint[] NameServers = (uint[]) IP4Config.Get ("Nameservers"); |
404 | 106 | if (NameServers.Length > 0) | 106 | if (NameServers.Length > 0) |
405 | 107 | PrimaryDNS = new IPAddress (NameServers[0]); | 107 | PrimaryDNS = new IPAddress (NameServers[0]); |
406 | 108 | else | 108 | else |
407 | 109 | 109 | ||
408 | === modified file 'StandardPlugins/NetworkManager/src/NetworkManager.cs' | |||
409 | --- StandardPlugins/NetworkManager/src/NetworkManager.cs 2010-10-09 12:54:14 +0000 | |||
410 | +++ StandardPlugins/NetworkManager/src/NetworkManager.cs 2015-10-27 09:11:09 +0000 | |||
411 | @@ -21,6 +21,7 @@ | |||
412 | 21 | using System.Collections.Generic; | 21 | using System.Collections.Generic; |
413 | 22 | 22 | ||
414 | 23 | using DBus; | 23 | using DBus; |
415 | 24 | using Docky.Services; | ||
416 | 24 | using org.freedesktop.DBus; | 25 | using org.freedesktop.DBus; |
417 | 25 | 26 | ||
418 | 26 | namespace NetworkManagerDocklet | 27 | namespace NetworkManagerDocklet |
419 | @@ -38,10 +39,7 @@ | |||
420 | 38 | get { | 39 | get { |
421 | 39 | foreach (string active in DevManager.ActiveConnections) { | 40 | foreach (string active in DevManager.ActiveConnections) { |
422 | 40 | DBusObject<IActiveConnection> ActiveConnection = new DBusObject<IActiveConnection> ("org.freedesktop.NetworkManager", active); | 41 | DBusObject<IActiveConnection> ActiveConnection = new DBusObject<IActiveConnection> ("org.freedesktop.NetworkManager", active); |
427 | 41 | if (ActiveConnection.BusObject.Get (ActiveConnection.BusName, "ServiceName").ToString ().Contains ("System")) | 42 | yield return ConManager.SystemConnections.Where (con => con.ObjectPath == ActiveConnection.Get ("Connection").ToString ()).First (); |
424 | 42 | yield return ConManager.SystemConnections.Where (con => con.ObjectPath == ActiveConnection.BusObject.Get (ActiveConnection.BusName, "Connection").ToString ()).First (); | ||
425 | 43 | else | ||
426 | 44 | yield return ConManager.UserConnections.Where (con => con.ObjectPath == ActiveConnection.BusObject.Get (ActiveConnection.BusName, "Connection").ToString ()).First (); | ||
428 | 45 | } | 43 | } |
429 | 46 | } | 44 | } |
430 | 47 | } | 45 | } |
431 | @@ -61,9 +59,12 @@ | |||
432 | 61 | try { | 59 | try { |
433 | 62 | connection = ConManager.AllConnections.OfType<WirelessConnection> ().Where (con => (con as WirelessConnection).SSID == ap.SSID).First (); | 60 | connection = ConManager.AllConnections.OfType<WirelessConnection> ().Where (con => (con as WirelessConnection).SSID == ap.SSID).First (); |
434 | 63 | ConnectTo (connection); | 61 | ConnectTo (connection); |
436 | 64 | } catch { | 62 | } catch (Exception e) { |
437 | 65 | // FIXME We're trying to connect to an AP but no connection entry exists. | 63 | // FIXME We're trying to connect to an AP but no connection entry exists. |
438 | 66 | // If we can figure out how to manually create a connection behind the scenes, we can remove this. | 64 | // If we can figure out how to manually create a connection behind the scenes, we can remove this. |
439 | 65 | // FIXME 2: What to do if an exception is thrown because of another reason? | ||
440 | 66 | Log<NetworkManager>.Error(e.Message); | ||
441 | 67 | Log<NetworkManager>.Debug(e.StackTrace); | ||
442 | 67 | Docky.Services.DockServices.System.RunOnThread ( () => { | 68 | Docky.Services.DockServices.System.RunOnThread ( () => { |
443 | 68 | Process.Start ("nm-connection-editor --type=802-11-wireless"); | 69 | Process.Start ("nm-connection-editor --type=802-11-wireless"); |
444 | 69 | }); | 70 | }); |
445 | @@ -86,14 +87,22 @@ | |||
446 | 86 | return; | 87 | return; |
447 | 87 | } | 88 | } |
448 | 88 | 89 | ||
454 | 89 | string serviceName; | 90 | string serviceName = "org.freedesktop.NetworkManager.Settings"; |
450 | 90 | if (con.Owner == ConnectionOwner.System) | ||
451 | 91 | serviceName = "org.freedesktop.NetworkManagerSystemSettings"; | ||
452 | 92 | else | ||
453 | 93 | serviceName = "org.freedesktop.NetworkManagerUserSettings"; | ||
455 | 94 | string conStr = con.ObjectPath; | 91 | string conStr = con.ObjectPath; |
456 | 95 | 92 | ||
458 | 96 | DevManager.BusObject.ActivateConnection(serviceName, new ObjectPath (conStr), new ObjectPath (dev.ObjectPath), new ObjectPath (specObj)); | 93 | DevManager.BusObject.ActivateConnection(new ObjectPath (conStr), new ObjectPath (dev.ObjectPath), new ObjectPath (specObj)); |
459 | 94 | } | ||
460 | 95 | public void DisconnectFrom (WirelessAccessPoint ap) | ||
461 | 96 | { | ||
462 | 97 | ObjectPath apObjectPath = new ObjectPath(ap.ObjectPath); | ||
463 | 98 | foreach (string active in DevManager.ActiveConnections) { | ||
464 | 99 | DBusObject<IActiveConnection> activeConnection = new DBusObject<IActiveConnection> ("org.freedesktop.NetworkManager", active); | ||
465 | 100 | string specificObject = activeConnection.Get("SpecificObject").ToString(); | ||
466 | 101 | if (specificObject == ap.ObjectPath) { | ||
467 | 102 | DevManager.BusObject.DeactivateConnection(new ObjectPath(activeConnection.ObjectPath)); | ||
468 | 103 | return; | ||
469 | 104 | } | ||
470 | 105 | } | ||
471 | 97 | } | 106 | } |
472 | 98 | 107 | ||
473 | 99 | void OnDevStateChanged(object o, DeviceStateChangedArgs args) | 108 | void OnDevStateChanged(object o, DeviceStateChangedArgs args) |
474 | 100 | 109 | ||
475 | === modified file 'StandardPlugins/NetworkManager/src/NetworkManagerDocklet.cs' | |||
476 | --- StandardPlugins/NetworkManager/src/NetworkManagerDocklet.cs 2014-04-22 15:12:30 +0000 | |||
477 | +++ StandardPlugins/NetworkManager/src/NetworkManagerDocklet.cs 2015-10-27 09:11:09 +0000 | |||
478 | @@ -83,7 +83,7 @@ | |||
479 | 83 | string SetDockletIcon () | 83 | string SetDockletIcon () |
480 | 84 | { | 84 | { |
481 | 85 | try { | 85 | try { |
483 | 86 | // currently connecting (animated) | 86 | // currently connecting/disconnecting (animated) |
484 | 87 | NetworkDevice dev = NM.DevManager.NetworkDevices | 87 | NetworkDevice dev = NM.DevManager.NetworkDevices |
485 | 88 | .Where (d => d.State == DeviceState.Configuring || d.State == DeviceState.IPConfiguring || d.State == DeviceState.Preparing) | 88 | .Where (d => d.State == DeviceState.Configuring || d.State == DeviceState.IPConfiguring || d.State == DeviceState.Preparing) |
486 | 89 | .FirstOrDefault (); | 89 | .FirstOrDefault (); |
487 | @@ -142,7 +142,7 @@ | |||
488 | 142 | List<MenuItem> active = list[MenuListContainer.Header]; | 142 | List<MenuItem> active = list[MenuListContainer.Header]; |
489 | 143 | 143 | ||
490 | 144 | foreach (WirelessAccessPoint wap in ActiveAccessPoints) { | 144 | foreach (WirelessAccessPoint wap in ActiveAccessPoints) { |
492 | 145 | active.Add (MakeConEntry (wap)); | 145 | active.Add (MakeConEntry (wap, true)); |
493 | 146 | } | 146 | } |
494 | 147 | 147 | ||
495 | 148 | int count = 0; | 148 | int count = 0; |
496 | @@ -156,7 +156,7 @@ | |||
497 | 156 | if (val.Any (wap => ActiveAccessPoints.Contains (wap))) | 156 | if (val.Any (wap => ActiveAccessPoints.Contains (wap))) |
498 | 157 | continue; | 157 | continue; |
499 | 158 | 158 | ||
501 | 159 | wifi.Add (MakeConEntry (val.OrderByDescending (wap => wap.Strength).First ())); | 159 | wifi.Add (MakeConEntry (val.OrderByDescending (wap => wap.Strength).First (), false)); |
502 | 160 | count++; | 160 | count++; |
503 | 161 | } | 161 | } |
504 | 162 | } | 162 | } |
505 | @@ -200,7 +200,7 @@ | |||
506 | 200 | // //yield return new SimpleMenuButtonArgs (() => Console.WriteLine ("asdf"),"Click me!", "network-manager"); | 200 | // //yield return new SimpleMenuButtonArgs (() => Console.WriteLine ("asdf"),"Click me!", "network-manager"); |
507 | 201 | // } | 201 | // } |
508 | 202 | 202 | ||
510 | 203 | MenuItem MakeConEntry (WirelessAccessPoint ap) | 203 | MenuItem MakeConEntry (WirelessAccessPoint ap, bool isactive) |
511 | 204 | { | 204 | { |
512 | 205 | string apName = ap.SSID; | 205 | string apName = ap.SSID; |
513 | 206 | string icon = APIconFromStrength (ap.Strength); | 206 | string icon = APIconFromStrength (ap.Strength); |
514 | @@ -208,7 +208,12 @@ | |||
515 | 208 | 208 | ||
516 | 209 | bool secure = ap.Flags == APFlags.Privacy || ap.RsnFlags != AccessPointSecurity.None || ap.WpaFlags != AccessPointSecurity.None; | 209 | bool secure = ap.Flags == APFlags.Privacy || ap.RsnFlags != AccessPointSecurity.None || ap.WpaFlags != AccessPointSecurity.None; |
517 | 210 | 210 | ||
519 | 211 | Docky.Menus.MenuItem item = new Docky.Menus.MenuItem (apName, icon, (o, a) => NM.ConnectTo (ap)); | 211 | Docky.Menus.MenuItem item; |
520 | 212 | if (isactive) { | ||
521 | 213 | item = new Docky.Menus.MenuItem (apName, icon, (o, a) => NM.DisconnectFrom(ap)); | ||
522 | 214 | } else { | ||
523 | 215 | item = new Docky.Menus.MenuItem (apName, icon, (o, a) => NM.ConnectTo (ap)); | ||
524 | 216 | } | ||
525 | 212 | item.Bold = bold; | 217 | item.Bold = bold; |
526 | 213 | 218 | ||
527 | 214 | if (secure) | 219 | if (secure) |
528 | 215 | 220 | ||
529 | === modified file 'StandardPlugins/NetworkManager/src/WiredDevice.cs' | |||
530 | --- StandardPlugins/NetworkManager/src/WiredDevice.cs 2010-10-09 12:54:14 +0000 | |||
531 | +++ StandardPlugins/NetworkManager/src/WiredDevice.cs 2015-10-27 09:11:09 +0000 | |||
532 | @@ -35,13 +35,13 @@ | |||
533 | 35 | 35 | ||
534 | 36 | public bool Carrier { | 36 | public bool Carrier { |
535 | 37 | get { | 37 | get { |
537 | 38 | return Boolean.Parse (WiredProperties.BusObject.Get (WiredProperties.BusName, "Carrier").ToString ()); | 38 | return Boolean.Parse (WiredProperties.Get ("Carrier").ToString ()); |
538 | 39 | } | 39 | } |
539 | 40 | } | 40 | } |
540 | 41 | 41 | ||
541 | 42 | public string HWAddresss { | 42 | public string HWAddresss { |
542 | 43 | get { | 43 | get { |
544 | 44 | return WiredProperties.BusObject.Get (WiredProperties.BusName, "HwAddress").ToString (); | 44 | return WiredProperties.Get ("HwAddress").ToString (); |
545 | 45 | } | 45 | } |
546 | 46 | } | 46 | } |
547 | 47 | } | 47 | } |
548 | 48 | 48 | ||
549 | === modified file 'StandardPlugins/NetworkManager/src/WirelessAccessPoint.cs' | |||
550 | --- StandardPlugins/NetworkManager/src/WirelessAccessPoint.cs 2009-11-28 23:36:17 +0000 | |||
551 | +++ StandardPlugins/NetworkManager/src/WirelessAccessPoint.cs 2015-10-27 09:11:09 +0000 | |||
552 | @@ -51,7 +51,7 @@ | |||
553 | 51 | public string SSID { | 51 | public string SSID { |
554 | 52 | get { | 52 | get { |
555 | 53 | try { | 53 | try { |
557 | 54 | return System.Text.ASCIIEncoding.ASCII.GetString ((byte[]) BusObject.Get (BusName, "Ssid")); | 54 | return System.Text.ASCIIEncoding.ASCII.GetString ((byte[]) this.Get ("Ssid")); |
558 | 55 | } catch (Exception e) { | 55 | } catch (Exception e) { |
559 | 56 | Log<WirelessAccessPoint>.Error (ObjectPath); | 56 | Log<WirelessAccessPoint>.Error (ObjectPath); |
560 | 57 | Log<WirelessAccessPoint>.Error (e.Message); | 57 | Log<WirelessAccessPoint>.Error (e.Message); |
561 | @@ -64,7 +64,7 @@ | |||
562 | 64 | public byte Strength { | 64 | public byte Strength { |
563 | 65 | get { | 65 | get { |
564 | 66 | try { | 66 | try { |
566 | 67 | return (byte) BusObject.Get (BusName, "Strength"); | 67 | return (byte) this.Get ("Strength"); |
567 | 68 | } catch (Exception e) { | 68 | } catch (Exception e) { |
568 | 69 | Log<WirelessAccessPoint>.Error (ObjectPath); | 69 | Log<WirelessAccessPoint>.Error (ObjectPath); |
569 | 70 | Log<WirelessAccessPoint>.Error (e.Message); | 70 | Log<WirelessAccessPoint>.Error (e.Message); |
570 | @@ -77,7 +77,7 @@ | |||
571 | 77 | public APFlags Flags { | 77 | public APFlags Flags { |
572 | 78 | get { | 78 | get { |
573 | 79 | try { | 79 | try { |
575 | 80 | return (APFlags) Convert.ToInt32 (BusObject.Get (BusName, "Flags")); | 80 | return (APFlags) Convert.ToInt32 (this.Get ("Flags")); |
576 | 81 | } catch (Exception e) { | 81 | } catch (Exception e) { |
577 | 82 | Log<WirelessAccessPoint>.Error (ObjectPath); | 82 | Log<WirelessAccessPoint>.Error (ObjectPath); |
578 | 83 | Log<WirelessAccessPoint>.Error (e.Message); | 83 | Log<WirelessAccessPoint>.Error (e.Message); |
579 | @@ -90,7 +90,7 @@ | |||
580 | 90 | public AccessPointSecurity RsnFlags { | 90 | public AccessPointSecurity RsnFlags { |
581 | 91 | get { | 91 | get { |
582 | 92 | try { | 92 | try { |
584 | 93 | return (AccessPointSecurity) Convert.ToInt32 (BusObject.Get (BusName, "RsnFlags")); | 93 | return (AccessPointSecurity) Convert.ToInt32 (this.Get ("RsnFlags")); |
585 | 94 | } catch (Exception e) { | 94 | } catch (Exception e) { |
586 | 95 | Log<WirelessAccessPoint>.Error (ObjectPath); | 95 | Log<WirelessAccessPoint>.Error (ObjectPath); |
587 | 96 | Log<WirelessAccessPoint>.Error (e.Message); | 96 | Log<WirelessAccessPoint>.Error (e.Message); |
588 | @@ -103,7 +103,7 @@ | |||
589 | 103 | public AccessPointSecurity WpaFlags { | 103 | public AccessPointSecurity WpaFlags { |
590 | 104 | get { | 104 | get { |
591 | 105 | try { | 105 | try { |
593 | 106 | return (AccessPointSecurity) Convert.ToInt32 (BusObject.Get (BusName, "WpaFlags")); | 106 | return (AccessPointSecurity) Convert.ToInt32 (this.Get ("WpaFlags")); |
594 | 107 | } catch (Exception e) { | 107 | } catch (Exception e) { |
595 | 108 | Log<WirelessAccessPoint>.Error (ObjectPath); | 108 | Log<WirelessAccessPoint>.Error (ObjectPath); |
596 | 109 | Log<WirelessAccessPoint>.Error (e.Message); | 109 | Log<WirelessAccessPoint>.Error (e.Message); |
597 | 110 | 110 | ||
598 | === modified file 'StandardPlugins/NetworkManager/src/WirelessConnection.cs' | |||
599 | --- StandardPlugins/NetworkManager/src/WirelessConnection.cs 2009-11-25 15:37:53 +0000 | |||
600 | +++ StandardPlugins/NetworkManager/src/WirelessConnection.cs 2015-10-27 09:11:09 +0000 | |||
601 | @@ -27,7 +27,7 @@ | |||
602 | 27 | { | 27 | { |
603 | 28 | } | 28 | } |
604 | 29 | 29 | ||
606 | 30 | public IDictionary<string, object> WirelessProperties { | 30 | public Dictionary<string, object> WirelessProperties { |
607 | 31 | get { return Settings["802-11-wireless"]; } | 31 | get { return Settings["802-11-wireless"]; } |
608 | 32 | } | 32 | } |
609 | 33 | 33 | ||
610 | 34 | 34 | ||
611 | === modified file 'StandardPlugins/NetworkManager/src/WirelessDevice.cs' | |||
612 | --- StandardPlugins/NetworkManager/src/WirelessDevice.cs 2010-10-09 12:54:14 +0000 | |||
613 | +++ StandardPlugins/NetworkManager/src/WirelessDevice.cs 2015-10-27 09:11:09 +0000 | |||
614 | @@ -76,7 +76,7 @@ | |||
615 | 76 | 76 | ||
616 | 77 | public WirelessAccessPoint ActiveAccessPoint { | 77 | public WirelessAccessPoint ActiveAccessPoint { |
617 | 78 | get { | 78 | get { |
619 | 79 | string access = WirelessProperties.BusObject.Get (WirelessProperties.BusName, "ActiveAccessPoint").ToString (); | 79 | string access = WirelessProperties.Get ("ActiveAccessPoint").ToString (); |
620 | 80 | return AccessPoints | 80 | return AccessPoints |
621 | 81 | .Where (ap => ap.ObjectPath == access) | 81 | .Where (ap => ap.ObjectPath == access) |
622 | 82 | .DefaultIfEmpty (null) | 82 | .DefaultIfEmpty (null) |
623 | @@ -85,7 +85,7 @@ | |||
624 | 85 | } | 85 | } |
625 | 86 | 86 | ||
626 | 87 | public string HWAddress { | 87 | public string HWAddress { |
628 | 88 | get { return WirelessProperties.BusObject.Get (WirelessProperties.BusName, "HwAddress").ToString (); } | 88 | get { return WirelessProperties.Get ("HwAddress").ToString (); } |
629 | 89 | } | 89 | } |
630 | 90 | } | 90 | } |
631 | 91 | } | 91 | } |