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 596918 - Add Wicd support for detecting network connection
Add Wicd support for detecting network connection
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: general
git master
Other Linux
: Normal enhancement
: 1.6
Assigned To: Aaron Bockover
Banshee Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-09-30 20:57 UTC by Jérémie Laval
Modified: 2009-10-20 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Wicd support patch (8.08 KB, patch)
2009-09-30 20:57 UTC, Jérémie Laval
needs-work Details | Review
Wicd support patch v2 (10.69 KB, patch)
2009-09-30 22:05 UTC, Jérémie Laval
none Details | Review
Wicd support patch v2.1 (10.63 KB, patch)
2009-09-30 22:12 UTC, Jérémie Laval
needs-work Details | Review
Wicd support patch v2.2 (10.34 KB, patch)
2009-10-01 07:24 UTC, Jérémie Laval
none Details | Review
Wicd support patch v2.2b (10.40 KB, patch)
2009-10-01 07:27 UTC, Jérémie Laval
none Details | Review
Patch committed to master (14.92 KB, patch)
2009-10-20 14:53 UTC, Aaron Bockover
committed Details | Review

Description Jérémie Laval 2009-09-30 20:57:45 UTC
Created attachment 144441 [details] [review]
Wicd support patch

The attached patch redefine the network check code to use an interface and add
a class (largely based on NetworkManager one) which add support for Wicd
connection manager.
Comment 1 Aaron Bockover 2009-09-30 21:30:14 UTC
Comment on attachment 144441 [details] [review]
Wicd support patch

Functionally, this patch looks pretty sane after a quick review, however, it needs to following the HACKING style guidelines. This file is available at the top of the project.

Three things that stand out at a quick glance: not using spaces (4) and instead using hard tabs; always use { } around conditionals; and finally, interface definitions should be pulled out into their own files. EventArgs classes and delegates can be grouped into the main class or interface file.

Thanks!
Comment 2 Jérémie Laval 2009-09-30 22:05:24 UTC
Created attachment 144443 [details] [review]
Wicd support patch v2
Comment 3 Jérémie Laval 2009-09-30 22:06:24 UTC
Here you go with the problems you mentioned hopefully fixed. Thanks for the quick reply!
Comment 4 Jérémie Laval 2009-09-30 22:12:38 UTC
Created attachment 144446 [details] [review]
Wicd support patch v2.1

Fix for namespace and Makefile.am
Comment 5 Aaron Bockover 2009-09-30 22:31:06 UTC
Getting better. Now that it's easier to read, a few more things stand out. Hopefully I'm not coming off as too annoying or nit-picky, but it's always good to call these things out sooner than later :)

a) please explicitly mark private members as such (e.g. private IWicd manager;)

b) there are some lines that have unnecessary changes (e.g. whitespace only changes) and particularly one change where two Catalog.GetString lines are indented causing a pointless diff section

c) the ManagerPresent method should be a property (IsManagerPresent) instead

d) In GetTranslatedCode on the Wcid class, you should indent the case labels:

switch (wicdCode) {
    case NOT_CONNECTED:
        return State.Disconnected;
    ...
}

e) I'd prefer an enum for the Wcid codes instead of consts, but since it's private, I'd let it slide - just a bit cleaner. You can pass this to DBus as well, so overall the APIs are cleaner.

enum WcidCodes : uint {
    NotConnected = 0,
    Connecting,
    Wireless,
    Wired,
    Suspended
}

f) In new code, please put a space before parenthesis (on method calls and conditinals, etc.), but don't change any old code that doesn't need changing :)

Thanks!
Comment 6 Jérémie Laval 2009-10-01 07:24:49 UTC
Created attachment 144467 [details] [review]
Wicd support patch v2.2

Hopefully last and good patch ;-) .
Comment 7 Jérémie Laval 2009-10-01 07:27:58 UTC
Created attachment 144468 [details] [review]
Wicd support patch v2.2b

Grr, some tabs slipped through. This is the good patch.
Comment 8 Jérémie Laval 2009-10-05 20:29:11 UTC
Ping ? :-)
Comment 9 Aaron Bockover 2009-10-20 14:53:53 UTC
Created attachment 145869 [details] [review]
Patch committed to master

Hi Jérémie, I've committed this to master, with a few small variations:

 a) StatusStruct, IWicd, and StateChangeInternalHandler are now private inner types of the Wicd class instead of internal types global to the Banshee.Networking namespace

 b) Similarly I did the same for the INetworkManager interface

 c) I moved State and StateChangedHandler from NetworkManager.cs to State.cs

 d) Fixed a few outstanding syntax/style/whitespace issues

Thanks!