Merge in Dullahan support from future branch!

This commit is contained in:
Lirusaito
2019-04-01 01:26:16 -04:00
parent 30f26f462b
commit c848af3960
16 changed files with 830 additions and 492 deletions

View File

@@ -9342,6 +9342,31 @@ class ListToggleMute : public view_listener_t
}
};
LLMediaCtrl* get_focused_media_ctrl()
{
auto media_ctrl = dynamic_cast<LLMediaCtrl*>(gFocusMgr.getKeyboardFocus());
llassert(media_ctrl); // This listener only applies to media_ctrls
return media_ctrl;
}
class MediaCtrlWebInspector : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
get_focused_media_ctrl()->onOpenWebInspector();
return true;
}
};
class MediaCtrlViewSource : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
get_focused_media_ctrl()->onShowSource();
return true;
}
};
struct MarketplaceViewSortAction : view_listener_t
{
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
@@ -9693,6 +9718,10 @@ void initialize_menus()
LLTextEditor::setIsFriendCallback(LLAvatarActions::isFriend);
LLTextEditor::addMenuListeners();
// Media Ctrl menus
addMenu(new MediaCtrlWebInspector(), "Open.WebInspector");
addMenu(new MediaCtrlViewSource(), "Open.ViewSource");
addMenu(new MarketplaceViewSortAction, "Marketplace.ViewSort.Action");
addMenu(new MarketplaceViewSortCheckItem, "Marketplace.ViewSort.CheckItem");