diff --git a/indra/newview/growlmanager.cpp b/indra/newview/growlmanager.cpp index 78729975b0..6da4f620dc 100644 --- a/indra/newview/growlmanager.cpp +++ b/indra/newview/growlmanager.cpp @@ -80,6 +80,24 @@ GrowlManager::GrowlManager() : LLEventTimer(GROWL_THROTTLE_CLEANUP_PERIOD) LL_INFOS("GrowlManagerInit") << "Created generic GrowlNotifier." << LL_ENDL; #endif +#ifdef LL_WINDOWS + if (mNotifier) + { + // Need to call loadConfig for Windows first before we know if + // Growl is usable -Ansariel + loadConfig(); + if (!mNotifier->isUsable()) + { + LL_WARNS("GrowlManagerInit") << "Growl is unusable; bailing out." << LL_ENDL; + return; + } + } + else + { + LL_WARNS("GrowlManagerInit") << "Growl is unusable; bailing out." << LL_ENDL; + return; + } +#else // Don't do anything more if Growl isn't usable. if( !mNotifier || !mNotifier->isUsable()) { @@ -87,6 +105,9 @@ GrowlManager::GrowlManager() : LLEventTimer(GROWL_THROTTLE_CLEANUP_PERIOD) return; } + loadConfig(); +#endif + // Hook into LLNotifications... // We hook into all of them, even though (at the time of writing) nothing uses "alert", so more notifications can be added easily. LLNotificationChannel::buildChannel("GrowlNotifications", "Visible", &filterOldNotifications); @@ -97,8 +118,6 @@ GrowlManager::GrowlManager() : LLEventTimer(GROWL_THROTTLE_CLEANUP_PERIOD) // Hook into script dialogs LLScriptFloaterManager::instance().addNewObjectCallback(&GrowlManager::onScriptDialog); - - this->loadConfig(); } void GrowlManager::loadConfig() diff --git a/indra/newview/growlnotifierwin.cpp b/indra/newview/growlnotifierwin.cpp index 0434774879..c1a9105e1f 100644 --- a/indra/newview/growlnotifierwin.cpp +++ b/indra/newview/growlnotifierwin.cpp @@ -37,7 +37,9 @@ #include "growlnotifierwin.h" #include "llviewercontrol.h" -GrowlNotifierWin::GrowlNotifierWin():applicationName("") +GrowlNotifierWin::GrowlNotifierWin() : + applicationName(""), + growl(NULL) { LL_INFOS("GrowlNotifierWin") << "Windows growl notifications initialised." << LL_ENDL; @@ -67,10 +69,13 @@ void GrowlNotifierWin::showNotification(const std::string& notification_title, c const std::string& notification_type) { //LL_INFOS("GrowlNotifierWin") << std::string(gDirUtilp->getDefaultSkinDir()+gDirUtilp->getDirDelimiter()+"textures"+gDirUtilp->getDirDelimiter()+"phoenixicon.ico").c_str() << LL_ENDL; - growl->Notify(notification_type.c_str(),notification_title.c_str(),notification_message.c_str()); + if (growl) + { + growl->Notify(notification_type.c_str(),notification_title.c_str(),notification_message.c_str()); + } } bool GrowlNotifierWin::isUsable() { - return true; + return (growl && growl->isConnected()); }