summaryrefslogtreecommitdiff
path: root/indra/newview/llmediactrl.cpp
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2011-08-31 11:51:38 -0700
committerRichard Nelson <richard@lindenlab.com>2011-08-31 11:51:38 -0700
commit2154bccdc4ef79bc2d593daad85d1344e9177bcf (patch)
treedf202d7f19616648be5680ff145fd281c5d21f69 /indra/newview/llmediactrl.cpp
parente62a4d4ec151e81f4dc68b29a009596d3d154d57 (diff)
parent09394d3a9d72c701fe28c54d7c76d71ddf3ef765 (diff)
Automated merge with http://hg.secondlife.com/viewer-development
Diffstat (limited to 'indra/newview/llmediactrl.cpp')
-rw-r--r--indra/newview/llmediactrl.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 1eb786f433..5bbef78dd4 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -319,6 +319,11 @@ BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask )
if (mContextMenu)
{
+ // hide/show debugging options
+ bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging");
+ mContextMenu->setItemVisible("open_webinspector", media_plugin_debugging_enabled );
+ mContextMenu->setItemVisible("debug_separator", media_plugin_debugging_enabled );
+
mContextMenu->show(x, y);
LLMenuGL::showPopup(this, mContextMenu, x, y);
}
@@ -385,12 +390,22 @@ void LLMediaCtrl::onFocusLost()
//
BOOL LLMediaCtrl::postBuild ()
{
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar;
+ registar.add("Open.WebInspector", boost::bind(&LLMediaCtrl::onOpenWebInspector, this));
+
mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>(
"menu_media_ctrl.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance());
setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
+
return TRUE;
}
+void LLMediaCtrl::onOpenWebInspector()
+{
+ if (mMediaSource && mMediaSource->hasMedia())
+ mMediaSource->getMediaPlugin()->showWebInspector( true );
+}
+
////////////////////////////////////////////////////////////////////////////////
//
BOOL LLMediaCtrl::handleKeyHere( KEY key, MASK mask )
@@ -1065,6 +1080,12 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
mHoverTextChanged = true;
};
break;
+
+ case MEDIA_EVENT_DEBUG_MESSAGE:
+ {
+ LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL;
+ };
+ break;
};
// chain all events to any potential observers of this object.