Give local speakers lists a more radar-like menu

This commit is contained in:
Lirusaito
2018-07-15 11:56:35 -04:00
parent 14fd78a5af
commit 172eee49e5
5 changed files with 137 additions and 3 deletions

View File

@@ -315,7 +315,8 @@ namespace
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLFloaterAvatarList::instance().onClickFocus();
const LLUUID get_focused_list_id_selected();
LLFloaterAvatarList::instance().setFocusAvatar(get_focused_list_id_selected());
return true;
}
};

View File

@@ -33,8 +33,10 @@
#include "llscrolllistctrl.h"
#include "llscrolllistitem.h"
#include "llspeakers.h"
#include "lluictrlfactory.h" // Edit: For menu duality
#include "llviewermenu.h" // Edit: For menu duality
#include "llviewerwindow.h"
#include "llvoiceclient.h"
#include "llvoicechannel.h" // Edit: For menu duality
#include "llworld.h" // Edit: For ghost detection
// [RLVa:KB]
#include "rlvhandler.h"
@@ -70,6 +72,16 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source,
//mSpeakerMgr->addListener(mSpeakerModeratorListener, "update_moderator");
}
void LLParticipantList::setupContextMenu()
{
if (mSpeakerMgr->getVoiceChannel() == LLVoiceChannelProximal::getInstance())
{
static LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_local_avs.xml", gMenuHolder);
mAvatarList->setContextMenu(menu);
}
else mAvatarList->setContextMenu(0);
}
BOOL LLParticipantList::postBuild()
{
mAvatarList = getChild<LLScrollListCtrl>("speakers_list");
@@ -97,6 +109,7 @@ BOOL LLParticipantList::postBuild()
// update speaker UI
handleSpeakerSelect();
setupContextMenu();
return true;
}
@@ -387,6 +400,7 @@ bool LLParticipantList::onRemoveItemEvent(LLPointer<LLOldEvents::LLEvent> event,
bool LLParticipantList::onClearListEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{
mAvatarList->clearRows();
setupContextMenu();
return true;
}

View File

@@ -203,6 +203,7 @@ protected:
private:
void onAvatarListDoubleClicked();
void setupContextMenu();
/**
* Adjusts passed participant to work properly.

View File

@@ -1021,10 +1021,11 @@ LLActiveSpeakerMgr::LLActiveSpeakerMgr() : LLSpeakerMgr(NULL)
void LLActiveSpeakerMgr::updateSpeakerList()
{
// point to whatever the current voice channel is
const auto old_channel = mVoiceChannel;
mVoiceChannel = LLVoiceChannel::getCurrentVoiceChannel();
// always populate from active voice channel
if (LLVoiceChannel::getCurrentVoiceChannel() != mVoiceChannel) //MA: seems this is always false
if (mVoiceChannel != old_channel) //Singu Note: Don't let this always be false.
{
LL_DEBUGS("Speakers") << "Removed all speakers" << LL_ENDL;
fireEvent(new LLSpeakerListChangeEvent(this, LLUUID::null), "clear");

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<menu name="Local Avs Menu" create_jump_keys="true">
<menu label="Avatar" name="Avatar" create_jump_keys="true">
<menu_item_call label="Profile" name="Profile">
<on_click function="List.ShowProfile"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Web Profile" name="Web Profile">
<on_click function="List.ShowWebProfile"/>
<on_visible function="List.VisibleWebProfile"/>
</menu_item_call>
<menu_item_call label="Pay" name="Pay">
<on_click function="List.Pay"/>
<on_enable function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Instant Message" name="Instant Message">
<on_click function="List.StartIM"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Conference Chat" name="Conference Chat">
<on_click function="List.StartConference"/>
<on_visible function="List.EnableMultipleSelected"/>
</menu_item_call>
<menu_item_call label="Call" name="Call">
<on_click function="List.StartCall"/>
<on_enable function="List.EnableCall"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Conference Call" name="Conference Call">
<on_click function="List.StartAdhocCall"/>
<on_enable function="List.EnableCall"/>
<on_visible function="List.EnableMultipleSelected"/>
</menu_item_call>
<menu_item_call label="Add Friend" name="Add Friend">
<on_click function="List.RequestFriendship"/>
<on_enable function="List.EnableSingleSelected"/>
<on_visible function="List.EnableIsNotFriend"/>
</menu_item_call>
<menu_item_call label="Remove Friend" name="Remove Friend">
<on_click function="List.RemoveFriend"/>
<on_enable function="List.EnableSingleSelected"/>
<on_visible function="List.EnableIsFriend"/>
</menu_item_call>
<menu_item_call label="Invite To Group" name="Invite To Group">
<on_click function="List.InviteToGroup"/>
<on_visible function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Offer Teleport" name="Offer Teleport">
<on_click function="List.OfferTeleport"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Teleport To" name="Teleport To" shortcut="control|Enter">
<on_click function="Radar.TeleportTo"/>
<on_enable function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Request Teleport" name="Request Teleport">
<on_click function="List.RequestTeleport"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Share" name="Share">
<on_click function="List.Share"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Chat History" name="Chat History">
<on_click function="List.ShowLog"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Track/Untrack" name="Track/Untrack">
<on_click function="Radar.Track"/>
<on_enable function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Copy Key" name="Copy Key">
<on_click function="List.CopyUUIDs"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Copy SLURL" name="Copy SLURL">
<on_click function="List.CopySLURL"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
</menu>
<menu_item_call label="Focus" name="Focus">
<on_click function="Radar.Focus"/>
<on_enable function="List.EnableSingleSelected"/>
</menu_item_call>
<menu label="Moderation" name="Moderation" create_jump_keys="true">
<menu_item_call label="Mute/Unmute" name="Mute/Unmute">
<on_click function="List.ToggleMute"/>
<on_enable function="List.EnableMute"/>
<on_visible function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Ban From Group" name="Ban From Group">
<on_click function="List.BanFromGroup"/>
<on_visible function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Report Abuse" name="Report Abuse">
<on_click function="List.AbuseReport"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_separator/>
<menu_item_call label="Freeze" name="Freeze">
<on_click function="List.Freeze"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Eject/Ban from Parcel" name="Eject/Ban from Parcel">
<on_click function="List.ParcelEject"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Eject from estate" name="Eject from estate">
<on_click function="List.EstateEject"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
<menu_item_call label="Eject and ban from estate" name="Eject and ban from estate">
<on_click function="List.EstateBan"/>
<on_enable function="List.EnableAnySelected"/>
</menu_item_call>
</menu>
</menu>