Hi,
I hacked up a patch to address the spurious Link Status Notifications
that have been bugging HardwareGrowler users with 2010 MacBookPro
computers. Patch is attached. Otherwise, also welcome to pull from my
bitbucket repo: 
http://bitbucket.org/andreas_wundsam/growl_hardwaregrowler_patch.

Comments welcome.

 -- Andi

diff -r 6145412d4d9e Extras/HardwareGrowler/HardwareGrowler.xcodeproj/
project.pbxproj
--- a/Extras/HardwareGrowler/HardwareGrowler.xcodeproj/project.pbxproj
Sat Jul 10 06:58:54 2010 -0700
+++ b/Extras/HardwareGrowler/HardwareGrowler.xcodeproj/project.pbxproj
Wed Jul 21 17:09:31 2010 +0200
@@ -79,7 +79,7 @@
                        isa = PBXContainerItemProxy;
                        containerPortal = 9533C287085C3ED6009F8046 /* 
Growl.xcodeproj */;
                        proxyType = 2;
-                       remoteGlobalIDString = 933818151052AA160014C550 /*
GrowlSparkleHelper.app */;
+                       remoteGlobalIDString = 933818151052AA160014C550;
                        remoteInfo = GrowlSparkleHelper;
                };
                9504458F09B57BB5000EAB59 /* PBXContainerItemProxy */ = {
diff -r 6145412d4d9e Extras/HardwareGrowler/NetworkNotifier.m
--- a/Extras/HardwareGrowler/NetworkNotifier.m  Sat Jul 10 06:58:54
2010 -0700
+++ b/Extras/HardwareGrowler/NetworkNotifier.m  Wed Jul 21 17:09:31
2010 +0200
@@ -34,6 +34,9 @@
 /** Our run loop source for notification. */
 static CFRunLoopSourceRef rlSrc;

+/*** remember the lastStatus of En0, to avoid spurious notifications
on 2010 MacBookPros */
+static int lastEn0Status = -9999;
+
 static struct ifmedia_description ifm_subtype_ethernet_descriptions[]
= IFM_SUBTYPE_ETHERNET_DESCRIPTIONS;
 static struct ifmedia_description ifm_shared_option_descriptions[] =
IFM_SHARED_OPTION_DESCRIPTIONS;

@@ -108,14 +111,19 @@
 - (void)linkStatusChange:(NSDictionary *)newValue {
        int active = [[newValue objectForKey:@"Active"] intValue];

-       if (active) {
-               NSString *media = [self getMediaForInterface:"en0"];
-               NSString *desc = [NSString stringWithFormat:
-                                                 
NSLocalizedString(@"Interface:\ten0\nMedia:\t%@", "The %@
will be replaced by a description of the Ethernet media such as '100BT/
full-duplex'"),
-                                                 media];
-               AppController_linkUp((CFStringRef)desc);
-       } else
-               
AppController_linkDown((CFStringRef)NSLocalizedString(@"Interface:
\ten0", nil));
+       if(active != lastEn0Status) {
+               if (active) {
+                       NSString *media = [self getMediaForInterface:"en0"];
+                       NSString *desc = [NSString stringWithFormat:
+                                                         
NSLocalizedString(@"Interface:\ten0\nMedia:\t%@", "The %@
will be replaced by a description of the Ethernet media such as '100BT/
full-duplex'"),
+                                                         media];
+                       AppController_linkUp((CFStringRef)desc);
+               } else {
+                       
AppController_linkDown((CFStringRef)NSLocalizedString(@"Interface:
\ten0", nil));
+               }
+               lastEn0Status = active;
+       }
+
 }

 /*

-- 
You received this message because you are subscribed to the Google Groups 
"Growl Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/growldiscuss?hl=en.

Reply via email to