diff --git a/autobuild.xml b/autobuild.xml index 297f2d9c5f..7390bb517d 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -20,9 +20,9 @@ archive hash - f075e96d8e1bfdd1f518829f0d7b74af + 4ece2c0c7376aa004e2d54b1b28cc22a url - http://downloads.phoenixviewer.com/growl-1.2.1-darwin.tar.gz + http://phoenixviewer.com/app/packages/growl-1.3-darwin-20120525.tar.bz2 windows diff --git a/indra/cmake/Growl.cmake b/indra/cmake/Growl.cmake index a37592016f..a5bf01af44 100644 --- a/indra/cmake/Growl.cmake +++ b/indra/cmake/Growl.cmake @@ -12,11 +12,11 @@ if (STANDALONE) #set(GROWL_INCLUDE_DIRS ${LIBNOTIFY_INCLUDE_DIR}) #set(GROWL_LIBRARY ${LIBNOTIFY_LIBRARIES}) else (STANDALONE) - #include(Prebuilt) - #use_prebuilt_binary(Growl) if (DARWIN) - #set(GROWL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/Growl) - #set(GROWL_LIBRARY growl) + include(Prebuilt) + use_prebuilt_binary(Growl) + set(GROWL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/Growl) + add_definitions( -DHAS_GROWL) elseif (WINDOWS) include(Prebuilt) use_prebuilt_binary(Growl) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 2145086846..7a9a5f8e45 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1308,11 +1308,18 @@ list(APPEND viewer_HEADER_FILES ${CMAKE_CURRENT_BINARY_DIR}/kvflickrkeys.h) source_group("CMake Rules" FILES ViewerInstall.cmake) if (DARWIN) - LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp) - #LIST(APPEND viewer_HEADER_FILES growlnotifiermacosx-objc.h) - #LIST(APPEND viewer_SOURCE_FILES growlnotifiermacosx-objc.mm) - #LIST(APPEND viewer_SOURCE_FILES growlnotifiermacosx.h) - #LIST(APPEND viewer_SOURCE_FILES growlnotifiermacosx.cpp) + LIST(APPEND viewer_SOURCE_FILES + llappviewermacosx.cpp + growlmanager.cpp + growlnotifiermacosx.cpp + growlnotifiermacosx-objc.mm + ) + + LIST(APPEND viewer_HEADER_FILES + growlmanager.h + growlnotifiermacosx.h + growlnotifiermacosx-objc.h + ) find_library(AGL_LIBRARY AGL) diff --git a/indra/newview/growlmanager.cpp b/indra/newview/growlmanager.cpp index 1269edcdea..88aa614fc0 100644 --- a/indra/newview/growlmanager.cpp +++ b/indra/newview/growlmanager.cpp @@ -49,7 +49,7 @@ // Platform-specific includes #ifdef LL_DARWIN -//#include "growlnotifiermacosx.h" +#include "growlnotifiermacosx.h" #elif LL_WINDOWS #include "growlnotifierwin.h" #elif LL_LINUX @@ -63,8 +63,8 @@ GrowlManager::GrowlManager() : LLEventTimer(GROWL_THROTTLE_CLEANUP_PERIOD) { // Create a notifier appropriate to the platform. #ifdef LL_DARWIN - //this->mNotifier = new GrowlNotifierMacOSX(); - //LL_INFOS("GrowlManagerInit") << "Created GrowlNotifierMacOSX." << LL_ENDL; + this->mNotifier = new GrowlNotifierMacOSX(); + LL_INFOS("GrowlManagerInit") << "Created GrowlNotifierMacOSX." << LL_ENDL; #elif LL_WINDOWS this->mNotifier = new GrowlNotifierWin(); LL_INFOS("GrowlManagerInit") << "Created GrowlNotifierWin." << LL_ENDL; diff --git a/indra/newview/growlnotifiermacosx-objc.mm b/indra/newview/growlnotifiermacosx-objc.mm index d16f878309..799a8d26cf 100644 --- a/indra/newview/growlnotifiermacosx-objc.mm +++ b/indra/newview/growlnotifiermacosx-objc.mm @@ -31,52 +31,88 @@ #import #import "Growl/Growl.h" -// Make a happy delegate (that does nothing) +// Make a happy delegate (that does nothing other than the required response to a registration dictionary) @interface FirestormBridge : NSObject @end @implementation FirestormBridge + +- (NSDictionary *) registrationDictionaryForGrowl { + + NSDictionary *regDict = [NSDictionary dictionaryWithObjectsAndKeys: + @"Firestorm Viewer", GROWL_APP_NAME, + nil]; + + return regDict; +} + @end +bool isInstalled = false; + void growlApplicationBridgeNotify(const std::string& withTitle, const std::string& description, const std::string& notificationName, void *iconData, unsigned int iconDataSize, int priority, bool isSticky) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - [GrowlApplicationBridge notifyWithTitle:[NSString stringWithCString:withTitle.c_str() encoding:NSUTF8StringEncoding] + Class GAB = NSClassFromString(@"GrowlApplicationBridge"); + if([GAB respondsToSelector:@selector(notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier:)]) { + [GAB notifyWithTitle:[NSString stringWithCString:withTitle.c_str() encoding:NSUTF8StringEncoding] description:[NSString stringWithCString:description.c_str() encoding:NSUTF8StringEncoding] notificationName:[NSString stringWithCString:notificationName.c_str() encoding:NSUTF8StringEncoding] iconData:(iconData == NULL ? nil : [NSData dataWithBytes:iconData length:iconDataSize]) priority:priority isSticky:isSticky - clickContext:nil - ]; + clickContext:nil]; + //NSLog(@"Growl msg: %@:%@", [NSString stringWithCString:withTitle.c_str() encoding:NSUTF8StringEncoding], [NSString stringWithCString:description.c_str() encoding:NSUTF8StringEncoding]); + } [pool release]; } void growlApplicationBridgeInit() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - FirestormBridge *delegate = [[[FirestormBridge alloc] init] autorelease]; - [GrowlApplicationBridge setGrowlDelegate:delegate]; + 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"]; + //NSLog(@"path: %@", path); + NSBundle *growlFramework = [NSBundle bundleWithPath:path]; + if([growlFramework load]) + { + NSDictionary *infoDictionary = [growlFramework infoDictionary]; + NSLog(@"Using Growl.framework %@ (%@)", + [infoDictionary objectForKey:@"CFBundleShortVersionString"], + [infoDictionary objectForKey:(NSString *)kCFBundleVersionKey]); + + FirestormBridge *delegate = [[[FirestormBridge alloc] init] autorelease]; + + Class GAB = NSClassFromString(@"GrowlApplicationBridge"); + if([GAB respondsToSelector:@selector(setGrowlDelegate:)]) + [GAB performSelector:@selector(setGrowlDelegate:) withObject:delegate]; + isInstalled = true; + } + [pool release]; } bool growlApplicationBridgeIsGrowlInstalled() { - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - bool installed = [GrowlApplicationBridge isGrowlInstalled]; - [pool release]; - return installed; + return isInstalled; } void growlApplicationBridgeRegister(const std::string& appname, const std::set& notifications) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + Class GAB = NSClassFromString(@"GrowlApplicationBridge"); NSMutableArray *notificationArray = [[[NSMutableArray alloc] init] autorelease]; for(std::set::iterator itr = notifications.begin(); itr != notifications.end(); ++itr) { [notificationArray addObject:[NSString stringWithCString:itr->c_str() encoding:NSUTF8StringEncoding]]; } - [GrowlApplicationBridge registerWithDictionary:[NSDictionary dictionaryWithObjectsAndKeys: + [GAB registerWithDictionary:[NSDictionary dictionaryWithObjectsAndKeys: [NSString stringWithCString:appname.c_str() encoding:NSUTF8StringEncoding], GROWL_APP_NAME, notificationArray, GROWL_NOTIFICATIONS_ALL, notificationArray, GROWL_NOTIFICATIONS_DEFAULT, nil]]; [pool release]; -} \ No newline at end of file +} diff --git a/indra/newview/growlnotifiermacosx.cpp b/indra/newview/growlnotifiermacosx.cpp index 32da34aaba..3f59f0b879 100644 --- a/indra/newview/growlnotifiermacosx.cpp +++ b/indra/newview/growlnotifiermacosx.cpp @@ -33,7 +33,6 @@ GrowlNotifierMacOSX::GrowlNotifierMacOSX() { - // Work around a Growl 1.1 bug whereby the app bridge *requires* a delegate. growlApplicationBridgeInit(); LL_INFOS("GrowlNotifierOSX") << "OS X growl notifications initialised." << LL_ENDL; } diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index b963012b10..7b09f681f4 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -260,7 +260,7 @@ Additional code generously contributed to Firestorm by: top_pad="10" width="435" word_wrap="true"> -Satomi Ahn, Katharine Berry, Alexie Birman, nhede Core, Lance Corrimal, Fractured Crystal, NiranV Dean, Sunset Faulkes, Whirly Fizzle, Holy Gavenkrantz, Dawa Gurbux, Albatroz Hird, Vaalith Jinn, Zwagoth Klaar, Kool Koolhoven, Shyotl Kuhr, Nogardrevlis Lectar, Melancholy Lemon, Miguael Liamano, Sione Lomu, Peyton Menges, Kittin Ninetails, Mimika Oh, Andromeda Rage, f0rbidden, programmtest, Mysty Saunders, Thickbrick Sleaford, Hitomi Tiponi, Qwerty Venom, Shin Wasp, Armin Weatherwax, Chalice Yao, Damian Zhaoying and others. +Satomi Ahn, Katharine Berry, Alexie Birman, nhede Core, Lance Corrimal, Fractured Crystal, NiranV Dean, Sunset Faulkes, Whirly Fizzle, Holy Gavenkrantz, Dawa Gurbux, Albatroz Hird, Vaalith Jinn, Zwagoth Klaar, Kool Koolhoven, Shyotl Kuhr, Nogardrevlis Lectar, Melancholy Lemon, Miguael Liamano, Sione Lomu, Peyton Menges, Nagi Michinaga, Kittin Ninetails, Mimika Oh, Andromeda Rage, f0rbidden, programmtest, Mysty Saunders, Thickbrick Sleaford, Hitomi Tiponi, Qwerty Venom, Shin Wasp, Armin Weatherwax, Chalice Yao, Damian Zhaoying and others.