diff options
author | callum <none@none> | 2011-08-29 17:13:29 -0700 |
---|---|---|
committer | callum <none@none> | 2011-08-29 17:13:29 -0700 |
commit | d341c400fc2e1991416bd6857a34b5a306a9144f (patch) | |
tree | 5da8bbe3273b2baadb96de9c26fa59ac85a9cefd /indra/newview | |
parent | b31a29303adcb66b64b1f3519f7535796b48f8b0 (diff) |
EXP-1122 FIX (Viewer) LLQtWebKit should support a JavaScript/content debugger to help content creators
Viewer side changes to enable Web debugger.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llmediactrl.cpp | 23 | ||||
-rw-r--r-- | indra/newview/llmediactrl.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_media_ctrl.xml | 12 |
3 files changed, 34 insertions, 4 deletions
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 90267c173c..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 ) @@ -1066,10 +1081,10 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) }; break; - case MEDIA_EVENT_DEBUG_MESSAGE:
- {
- LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL;
- };
+ case MEDIA_EVENT_DEBUG_MESSAGE: + { + LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL; + }; break; }; diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 0e4a5b1d65..3c0436e27a 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -166,6 +166,9 @@ public: // Incoming media event dispatcher virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + // right click debugging item + void onOpenWebInspector(); + LLUUID getTextureID() {return mMediaTextureID;} protected: diff --git a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml index c39c26f25f..960da4bd7a 100644 --- a/indra/newview/skins/default/xui/en/menu_media_ctrl.xml +++ b/indra/newview/skins/default/xui/en/menu_media_ctrl.xml @@ -28,4 +28,16 @@ <menu_item_call.on_enable function="Edit.EnablePaste" /> </menu_item_call> + <menu_item_separator + layout="topleft" + name="debug_separator" + visible="false" /> + <menu_item_call + label="Open Web Inspector" + layout="topleft" + name="open_webinspector" + visible="false"> + <menu_item_call.on_click + function="Open.WebInspector" /> + </menu_item_call> </context_menu> |