From 2c19692c76306d794384d1e9a5c50eead3df0c0b Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 5 Jan 2016 12:47:46 +0200 Subject: MAINT-2753 Don't spam notification constantly, when plugin initialization failed. Just show it once after each teleport. --- indra/newview/llviewermedia.cpp | 17 +++++++++++++---- indra/newview/llviewermedia.h | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index ffae3c0e1f..0b70af44bc 100755 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1660,6 +1660,8 @@ void LLViewerMedia::onTeleportFinished() { // On teleport, clear this setting (i.e. set it to true) gSavedSettings.setBOOL("MediaTentativeAutoPlay", true); + + LLViewerMediaImpl::sMimeTypesFailed.clear(); } @@ -1671,6 +1673,7 @@ void LLViewerMedia::setOnlyAudibleMediaTextureID(const LLUUID& texture_id) sForceUpdate = true; } +std::vector LLViewerMediaImpl::sMimeTypesFailed; ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMediaImpl ////////////////////////////////////////////////////////////////////////////////////////// @@ -1943,10 +1946,16 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ } LL_WARNS_ONCE("Plugin") << "plugin initialization failed for mime type: " << media_type << LL_ENDL; - LLSD args; - args["MIME_TYPE"] = media_type; - LLNotificationsUtil::add("NoPlugin", args); - + if(gAgent.isInitialized()) + { + if (std::find(sMimeTypesFailed.begin(), sMimeTypesFailed.end(), media_type) == sMimeTypesFailed.end()) + { + LLSD args; + args["MIME_TYPE"] = media_type; + LLNotificationsUtil::add("NoPlugin", args); + sMimeTypesFailed.push_back(media_type); + } + } return NULL; } diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ede408dd0c..268dcae20e 100755 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -469,6 +469,7 @@ private: std::string mTarget; LLNotificationPtr mNotification; bool mCleanBrowser; // force the creation of a clean browsing target with full options enabled + static std::vector sMimeTypesFailed; private: BOOL mIsUpdated ; -- cgit v1.2.3