After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630296 - Add 'network status' support for Windows.
Add 'network status' support for Windows.
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Windows
: Normal normal
: 1.x
Assigned To: Banshee Maintainers
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-21 21:53 UTC by Peter Johanson
Modified: 2010-09-22 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Implement network status support for windows. (7.19 KB, patch)
2010-09-21 21:53 UTC, Peter Johanson
needs-work Details | Review
Updated patch with fixes (7.21 KB, patch)
2010-09-22 18:12 UTC, Peter Johanson
committed Details | Review

Description Peter Johanson 2010-09-21 21:53:18 UTC
Created attachment 170791 [details] [review]
Implement network status support for windows.

The following patch adds support for detecting the network status (connected or not) on Windows, using the classes from the System.Net.NetworkInformation namespace.
Comment 1 Gabriel Burt 2010-09-22 16:59:39 UTC
Review of attachment 170791 [details] [review]:

Looks pretty good - I have a few nitpicks.

::: src/Core/Banshee.Services/Banshee.Networking/DotNetNetworking.cs
@@ +35,3 @@
+    public class DotNetNetworking : INetworkAvailabilityService
+    {
+        public static bool Available { get { try { return Type.GetType ("Mono.Runtime") == null; } catch { return true; } } }

Might as well call this ManagerPresent like the others do, no?

@@ +40,3 @@
+
+        public State State
+        {

put this { up on the previous line (for properties)

@@ +59,3 @@
+        void OnNetworkAvailabilityChanged (object o, NetworkAvailabilityEventArgs args)
+        {
+            StateChangeHandler sc = StateChange;

rewrite this as
var handler = StateChanged;
if (handler != null) {
...
}
Comment 2 Peter Johanson 2010-09-22 18:12:30 UTC
Created attachment 170850 [details] [review]
Updated patch with fixes

Updated based on feedback.
Comment 3 Gabriel Burt 2010-09-22 18:19:20 UTC
Review of attachment 170850 [details] [review]:

Committed, thanks!