SL-10686 Refresh indicators on session change, fix visibility
parent
f76812b29a
commit
3b3e4833ad
|
|
@ -440,28 +440,23 @@ void LLConversationViewSession::refresh()
|
|||
LLSpeakingIndicatorManager::updateSpeakingIndicators();
|
||||
|
||||
// we should show indicator for specified voice session only if this is current channel. EXT-5562.
|
||||
if (!mIsInActiveVoiceChannel)
|
||||
if (mSpeakingIndicator)
|
||||
{
|
||||
if (mSpeakingIndicator)
|
||||
mSpeakingIndicator->setIsActiveChannel(mIsInActiveVoiceChannel);
|
||||
mSpeakingIndicator->setShowParticipantsSpeaking(mIsInActiveVoiceChannel);
|
||||
}
|
||||
|
||||
LLConversationViewParticipant* participant = NULL;
|
||||
items_t::const_iterator iter;
|
||||
for (iter = getItemsBegin(); iter != getItemsEnd(); iter++)
|
||||
{
|
||||
participant = dynamic_cast<LLConversationViewParticipant*>(*iter);
|
||||
if (participant)
|
||||
{
|
||||
mSpeakingIndicator->setVisible(false);
|
||||
}
|
||||
LLConversationViewParticipant* participant = NULL;
|
||||
items_t::const_iterator iter;
|
||||
for (iter = getItemsBegin(); iter != getItemsEnd(); iter++)
|
||||
{
|
||||
participant = dynamic_cast<LLConversationViewParticipant*>(*iter);
|
||||
if (participant)
|
||||
{
|
||||
participant->hideSpeakingIndicator();
|
||||
}
|
||||
participant->allowSpeakingIndicator(mIsInActiveVoiceChannel);
|
||||
}
|
||||
}
|
||||
|
||||
if (mSpeakingIndicator)
|
||||
{
|
||||
mSpeakingIndicator->setShowParticipantsSpeaking(mIsInActiveVoiceChannel);
|
||||
}
|
||||
|
||||
requestArrange();
|
||||
// Do the regular upstream refresh
|
||||
LLFolderViewFolder::refresh();
|
||||
|
|
@ -473,8 +468,13 @@ void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& sessi
|
|||
|
||||
if (vmi)
|
||||
{
|
||||
bool old_value = mIsInActiveVoiceChannel;
|
||||
mIsInActiveVoiceChannel = vmi->getUUID() == session_id;
|
||||
mCallIconLayoutPanel->setVisible(mIsInActiveVoiceChannel);
|
||||
if (old_value != mIsInActiveVoiceChannel)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -630,10 +630,19 @@ void LLConversationViewParticipant::addToFolder(LLFolderViewFolder* folder)
|
|||
LLFolderViewItem::addToFolder(folder);
|
||||
|
||||
// Retrieve the folder (conversation) UUID, which is also the speaker session UUID
|
||||
LLConversationItem* vmi = getParentFolder() ? dynamic_cast<LLConversationItem*>(getParentFolder()->getViewModelItem()) : NULL;
|
||||
if (vmi)
|
||||
LLFolderViewFolder *prnt = getParentFolder();
|
||||
if (prnt)
|
||||
{
|
||||
addToSession(vmi->getUUID());
|
||||
LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(prnt->getViewModelItem());
|
||||
if (vmi)
|
||||
{
|
||||
addToSession(vmi->getUUID());
|
||||
}
|
||||
LLConversationViewSession* session = dynamic_cast<LLConversationViewSession*>(prnt);
|
||||
if (session)
|
||||
{
|
||||
allowSpeakingIndicator(session->isInActiveVoiceChannel());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -763,9 +772,9 @@ LLView* LLConversationViewParticipant::getItemChildView(EAvatarListItemChildInde
|
|||
return child_view;
|
||||
}
|
||||
|
||||
void LLConversationViewParticipant::hideSpeakingIndicator()
|
||||
void LLConversationViewParticipant::allowSpeakingIndicator(bool val)
|
||||
{
|
||||
mSpeakingIndicator->setVisible(false);
|
||||
mSpeakingIndicator->setIsActiveChannel(val);
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ public:
|
|||
void setHighlightState(bool hihglight_state);
|
||||
|
||||
LLFloater* getSessionFloater();
|
||||
bool isInActiveVoiceChannel() { return mIsInActiveVoiceChannel; }
|
||||
|
||||
private:
|
||||
|
||||
|
|
@ -145,7 +146,7 @@ public:
|
|||
|
||||
/*virtual*/ S32 getLabelXPos();
|
||||
/*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
|
||||
void hideSpeakingIndicator();
|
||||
void allowSpeakingIndicator(bool val);
|
||||
|
||||
protected:
|
||||
friend class LLUICtrlFactory;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p)
|
|||
mSpeakerId(p.speaker_id),
|
||||
mIsModeratorMuted(false),
|
||||
mIsAgentControl(false),
|
||||
mIsActiveChannel(false),
|
||||
mIndicatorToggled(false),
|
||||
mShowParticipantsSpeaking(false)
|
||||
{
|
||||
|
|
@ -256,6 +257,16 @@ BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void LLOutputMonitorCtrl::setIsActiveChannel(bool val)
|
||||
{
|
||||
mIsActiveChannel = val;
|
||||
if (!val)
|
||||
{
|
||||
// switchIndicator will set it to TRUE when channel becomes active
|
||||
setVisible(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id/* = LLUUID::null*/, bool show_other_participants_speaking /* = false */)
|
||||
{
|
||||
if (speaker_id.isNull() && mSpeakerId.notNull())
|
||||
|
|
@ -305,8 +316,7 @@ void LLOutputMonitorCtrl::onChange()
|
|||
// virtual
|
||||
void LLOutputMonitorCtrl::switchIndicator(bool switch_on)
|
||||
{
|
||||
|
||||
if(getVisible() != (BOOL)switch_on)
|
||||
if (mIsActiveChannel && getVisible() != (BOOL)switch_on)
|
||||
{
|
||||
setVisible(switch_on);
|
||||
|
||||
|
|
|
|||
|
|
@ -79,9 +79,11 @@ public:
|
|||
// For the current user, need to know the PTT state to show
|
||||
// correct button image.
|
||||
void setIsAgentControl(bool val) { mIsAgentControl = val; }
|
||||
|
||||
void setIsTalking(bool val) { mIsTalking = val; }
|
||||
|
||||
// switchIndicator controls visibility, 'active channel' governs if we are allowed to show indicator
|
||||
void setIsActiveChannel(bool val);
|
||||
|
||||
void setShowParticipantsSpeaking(bool show) { mShowParticipantsSpeaking = show; }
|
||||
|
||||
/**
|
||||
|
|
@ -137,6 +139,7 @@ private:
|
|||
bool mIsModeratorMuted;
|
||||
bool mIsMuted;
|
||||
bool mIsTalking;
|
||||
bool mIsActiveChannel;
|
||||
bool mShowParticipantsSpeaking;
|
||||
LLPointer<LLUIImage> mImageMute;
|
||||
LLPointer<LLUIImage> mImageOff;
|
||||
|
|
|
|||
Loading…
Reference in New Issue