Skip to content

Commit

Permalink
Add Growl 1.2.3 for Snow Leopard
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahhodne committed May 18, 2012
1 parent d18726f commit 140c0db
Show file tree
Hide file tree
Showing 21 changed files with 5,334 additions and 19 deletions.
60 changes: 55 additions & 5 deletions Travis Toolbar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
2EDA045D156450750043A3A6 /* TravisEventData.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EDA045C156450750043A3A6 /* TravisEventData.m */; };
2EDA0460156464FF0043A3A6 /* tray-alt.png in Resources */ = {isa = PBXBuildFile; fileRef = 2EDA045E156464FF0043A3A6 /* tray-alt.png */; };
2EDA0461156464FF0043A3A6 /* tray.png in Resources */ = {isa = PBXBuildFile; fileRef = 2EDA045F156464FF0043A3A6 /* tray.png */; };
2EE31A5F15642182004F33FE /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EE31A5E15642182004F33FE /* Growl.framework */; };
2EE31A601564218D004F33FE /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2EE31A5E15642182004F33FE /* Growl.framework */; };
2EDA046C1565B86F0043A3A6 /* Growl.framework in Copy Growl 1.3 */ = {isa = PBXBuildFile; fileRef = 2EE31A5E15642182004F33FE /* Growl.framework */; };
2EDA046E1565B8850043A3A6 /* Growl.framework in Copy Growl 1.2.3 */ = {isa = PBXBuildFile; fileRef = 2EDA04691565B82C0043A3A6 /* Growl.framework */; };
2EE31A6B156422CF004F33FE /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2EE31A6A156422CF004F33FE /* AppDelegate.m */; };
2EE31A7115642547004F33FE /* Pusher.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2EE31A7015642547004F33FE /* Pusher.framework */; };
2EE31A721564254C004F33FE /* Pusher.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2EE31A7015642547004F33FE /* Pusher.framework */; };
Expand All @@ -33,11 +33,32 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
2EE31A601564218D004F33FE /* Growl.framework in CopyFiles */,
2EE31A721564254C004F33FE /* Pusher.framework in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
2EDA046B1565B8450043A3A6 /* Copy Growl 1.3 */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = Contents/Frameworks/Growl/1.3;
dstSubfolderSpec = 1;
files = (
2EDA046C1565B86F0043A3A6 /* Growl.framework in Copy Growl 1.3 */,
);
name = "Copy Growl 1.3";
runOnlyForDeploymentPostprocessing = 0;
};
2EDA046D1565B8760043A3A6 /* Copy Growl 1.2.3 */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = Contents/Frameworks/Growl/1.2.3;
dstSubfolderSpec = 1;
files = (
2EDA046E1565B8850043A3A6 /* Growl.framework in Copy Growl 1.2.3 */,
);
name = "Copy Growl 1.2.3";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
Expand All @@ -54,6 +75,7 @@
2EDA045C156450750043A3A6 /* TravisEventData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TravisEventData.m; path = src/TravisEventData.m; sourceTree = "<group>"; };
2EDA045E156464FF0043A3A6 /* tray-alt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "tray-alt.png"; path = "resources/tray-alt.png"; sourceTree = "<group>"; };
2EDA045F156464FF0043A3A6 /* tray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = tray.png; path = resources/tray.png; sourceTree = "<group>"; };
2EDA04691565B82C0043A3A6 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = vendor/legacy/Growl.framework; sourceTree = "<group>"; };
2EE31A5E15642182004F33FE /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = vendor/Growl.framework; sourceTree = "<group>"; };
2EE31A69156422CF004F33FE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = src/AppDelegate.h; sourceTree = "<group>"; };
2EE31A6A156422CF004F33FE /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = src/AppDelegate.m; sourceTree = "<group>"; };
Expand All @@ -75,7 +97,6 @@
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
DD06BD7413170793007673AA /* CoreLocation.framework in Frameworks */,
2EE31A5F15642182004F33FE /* Growl.framework in Frameworks */,
2EE31A7115642547004F33FE /* Pusher.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -87,7 +108,6 @@
isa = PBXGroup;
children = (
2EE31A7015642547004F33FE /* Pusher.framework */,
2EE31A5E15642182004F33FE /* Growl.framework */,
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
DD06BD7313170793007673AA /* CoreLocation.framework */,
);
Expand Down Expand Up @@ -142,12 +162,38 @@
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
2EDA04661565B7F90043A3A6 /* Growl */,
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
2EDA04661565B7F90043A3A6 /* Growl */ = {
isa = PBXGroup;
children = (
2EDA04681565B8190043A3A6 /* 1.2.3 */,
2EDA04671565B80B0043A3A6 /* 1.3 */,
);
name = Growl;
sourceTree = "<group>";
};
2EDA04671565B80B0043A3A6 /* 1.3 */ = {
isa = PBXGroup;
children = (
2EE31A5E15642182004F33FE /* Growl.framework */,
);
name = 1.3;
sourceTree = "<group>";
};
2EDA04681565B8190043A3A6 /* 1.2.3 */ = {
isa = PBXGroup;
children = (
2EDA04691565B82C0043A3A6 /* Growl.framework */,
);
name = 1.2.3;
sourceTree = "<group>";
};
2EE31A611564226E004F33FE /* Travis Toolbar */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -182,6 +228,8 @@
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
172754B4107597CF00D0347B /* CopyFiles */,
2EDA046B1565B8450043A3A6 /* Copy Growl 1.3 */,
2EDA046D1565B8760043A3A6 /* Copy Growl 1.2.3 */,
);
buildRules = (
);
Expand Down Expand Up @@ -283,6 +331,7 @@
"$(inherited)",
"\"$(SRCROOT)/vendor\"",
"\"$(SRCROOT)\"",
"\"$(SRCROOT)/vendor/legacy\"",
);
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_GC = unsupported;
Expand Down Expand Up @@ -311,6 +360,7 @@
"$(inherited)",
"\"$(SRCROOT)/vendor\"",
"\"$(SRCROOT)\"",
"\"$(SRCROOT)/vendor/legacy\"",
);
GCC_ENABLE_OBJC_GC = unsupported;
GCC_MODEL_TUNING = G5;
Expand Down
12 changes: 12 additions & 0 deletions src/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,23 @@ @implementation AppDelegate
@synthesize window = _window;
@synthesize pusher = _pusher;
@synthesize statusMenu = _statusMenu;
@synthesize preferencesPanel = _preferencesPanel;
@synthesize statusItem = _statusItem;
@synthesize statusImage = _statusImage;
@synthesize statusHighlightImage = _statusHighlightImage;

- (void)applicationDidFinishLaunching:(NSNotification *)notification {
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *path = [[mainBundle privateFrameworksPath] stringByAppendingPathComponent:@"Growl"];
if (NSAppKitVersionNumber >= 1038)
path = [path stringByAppendingPathComponent:@"1.3"];
else
path = [path stringByAppendingPathComponent:@"1.2.3"];

path = [path stringByAppendingPathComponent:@"Growl.framework"];
NSBundle *growlFramework = [NSBundle bundleWithPath:path];
[growlFramework load];

self.pusher = [[PusherConnection alloc] init];

self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
Expand Down
34 changes: 20 additions & 14 deletions src/PusherConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,30 @@ - (id)init {

- (void)handleStarted:(PTPusherEvent *)event {
TravisEventData *eventData = [[TravisEventData alloc] initWithEventData:event.data];
[GrowlApplicationBridge notifyWithTitle:eventData.name
description:@"Starting build!"
notificationName:@"Build Information"
iconData:[[NSImage imageNamed:@"travis_logo.png"] TIFFRepresentation]
priority:0
isSticky:NO
clickContext:nil];
Class GAB = NSClassFromString(@"GrowlApplicationBridge");
if ([GAB respondsToSelector:@selector(notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier:)])
[GAB notifyWithTitle:eventData.name
description:@"Starting build!"
notificationName:@"Build Information"
iconData:[[NSImage imageNamed:@"travis_logo.png"] TIFFRepresentation]
priority:0
isSticky:NO
clickContext:nil
identifier:eventData.name];
}

- (void)handleFinished:(PTPusherEvent *)event {
TravisEventData *eventData = [[TravisEventData alloc] initWithEventData:event.data];
[GrowlApplicationBridge notifyWithTitle:eventData.name
description:[NSString stringWithFormat:@"Finished build with status: %@", eventData.status]
notificationName:@"Build Information"
iconData:[[NSImage imageNamed:@"travis_logo.png"] TIFFRepresentation]
priority:0
isSticky:NO
clickContext:nil];
Class GAB = NSClassFromString(@"GrowlApplicationBridge");
if ([GAB respondsToSelector:@selector(notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier:)])
[GAB notifyWithTitle:eventData.name
description:[NSString stringWithFormat:@"Finished build with status: %@", eventData.status]
notificationName:@"Build Information"
iconData:[[NSImage imageNamed:@"travis_logo.png"] TIFFRepresentation]
priority:0
isSticky:NO
clickContext:nil
identifier:eventData.name];
}

@end
Binary file added vendor/legacy/Growl.framework/Growl
Binary file not shown.
6 changes: 6 additions & 0 deletions vendor/legacy/Growl.framework/Headers/Growl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "GrowlDefines.h"

#ifdef __OBJC__
# include "GrowlApplicationBridge.h"
#endif
#include "GrowlApplicationBridge-Carbon.h"
Loading

0 comments on commit 140c0db

Please sign in to comment.