CHUI-102: Now the user can select a conversation and use the right-click-menu to enable/disable voice.
parent
1ed2915796
commit
9d989feede
|
|
@ -28,6 +28,7 @@
|
|||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llconversationmodel.h"
|
||||
#include "llimview.h" //For LLIMModel
|
||||
|
||||
//
|
||||
// Conversation items : common behaviors
|
||||
|
|
@ -224,15 +225,35 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags)
|
|||
else if(this->getType() == CONV_SESSION_GROUP)
|
||||
{
|
||||
items.push_back(std::string("close_conversation"));
|
||||
addVoiceOptions(items);
|
||||
items.push_back(std::string("separator_disconnect_from_voice"));
|
||||
items.push_back(std::string("group_profile"));
|
||||
items.push_back(std::string("activate_group"));
|
||||
items.push_back(std::string("leave_group"));
|
||||
}
|
||||
else if(this->getType() == CONV_SESSION_AD_HOC)
|
||||
{
|
||||
items.push_back(std::string("close_conversation"));
|
||||
addVoiceOptions(items);
|
||||
}
|
||||
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
}
|
||||
|
||||
void LLConversationItemSession::addVoiceOptions(menuentry_vec_t& items)
|
||||
{
|
||||
LLVoiceChannel* voice_channel = LLIMModel::getInstance() ? LLIMModel::getInstance()->getVoiceChannel(this->getUUID()) : NULL;
|
||||
|
||||
if(voice_channel != LLVoiceChannel::getCurrentVoiceChannel())
|
||||
{
|
||||
items.push_back(std::string("open_voice_conversation"));
|
||||
}
|
||||
else
|
||||
{
|
||||
items.push_back(std::string("disconnect_from_voice"));
|
||||
}
|
||||
}
|
||||
|
||||
// The time of activity of a session is the time of the most recent activity, session and participants included
|
||||
const bool LLConversationItemSession::getTime(F64& time) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ public:
|
|||
bool isLoaded() { return mIsLoaded; }
|
||||
|
||||
void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
void addVoiceOptions(menuentry_vec_t& items);
|
||||
virtual const bool getTime(F64& time) const;
|
||||
|
||||
void dumpDebugData();
|
||||
|
|
|
|||
|
|
@ -748,7 +748,7 @@ const LLConversationItem * LLIMFloaterContainer::getCurSelectedViewModelItem()
|
|||
}
|
||||
|
||||
void LLIMFloaterContainer::doToUsers(const std::string& command, uuid_vec_t selectedIDS)
|
||||
{dd
|
||||
{
|
||||
LLUUID userID;
|
||||
userID = selectedIDS.front();
|
||||
|
||||
|
|
@ -828,6 +828,14 @@ void LLIMFloaterContainer::doToSelectedConversation(const std::string& command)
|
|||
{
|
||||
LLFloater::onClickClose(conversationFloater);
|
||||
}
|
||||
else if("open_voice_conversation" == command)
|
||||
{
|
||||
gIMMgr->startCall(conversationItem->getUUID());
|
||||
}
|
||||
else if("disconnect_from_voice" == command)
|
||||
{
|
||||
gIMMgr->endCall(conversationItem->getUUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
uuid_vec_t selected_uuids;
|
||||
|
|
@ -843,7 +851,8 @@ void LLIMFloaterContainer::doToSelected(const LLSD& userdata)
|
|||
const LLConversationItem * conversationItem = getCurSelectedViewModelItem();
|
||||
|
||||
if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1 ||
|
||||
conversationItem->getType() == LLConversationItem::CONV_SESSION_GROUP)
|
||||
conversationItem->getType() == LLConversationItem::CONV_SESSION_GROUP ||
|
||||
conversationItem->getType() == LLConversationItem::CONV_SESSION_AD_HOC)
|
||||
{
|
||||
doToSelectedConversation(command);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue