diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2016-01-05 12:47:46 +0200 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2016-01-05 12:47:46 +0200 |
commit | 2c19692c76306d794384d1e9a5c50eead3df0c0b (patch) | |
tree | 717258f9f26dc9a46be12c5a704673df0fd618ae /indra | |
parent | 591e96ba435f780f4901e7219b62459c8047789a (diff) |
MAINT-2753 Don't spam notification constantly, when plugin initialization failed. Just show it once after each teleport.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llviewermedia.cpp | 17 | ||||
-rwxr-xr-x | indra/newview/llviewermedia.h | 1 |
2 files changed, 14 insertions, 4 deletions
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<std::string> 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<std::string> sMimeTypesFailed; private: BOOL mIsUpdated ; |