summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-03-05 20:14:21 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-03-05 20:14:21 +0200
commit3b3e4833ad41993785ea2fcae651b588df8e492d (patch)
tree67185c32edf04d1fab14ceeb5a2d387d067fc76c /indra/newview
parentf76812b29a424e9d9c609b49c10a8c6a332a5b04 (diff)
SL-10686 Refresh indicators on session change, fix visibility
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llconversationview.cpp55
-rw-r--r--indra/newview/llconversationview.h3
-rw-r--r--indra/newview/lloutputmonitorctrl.cpp14
-rw-r--r--indra/newview/lloutputmonitorctrl.h5
4 files changed, 50 insertions, 27 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 59bb9af744..0075b62100 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -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
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index 06ffb517bb..420c250dfe 100644
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -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;
diff --git a/indra/newview/lloutputmonitorctrl.cpp b/indra/newview/lloutputmonitorctrl.cpp
index c5e4593b79..a873ccf98b 100644
--- a/indra/newview/lloutputmonitorctrl.cpp
+++ b/indra/newview/lloutputmonitorctrl.cpp
@@ -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);
diff --git a/indra/newview/lloutputmonitorctrl.h b/indra/newview/lloutputmonitorctrl.h
index af52a81b04..307cd30ab3 100644
--- a/indra/newview/lloutputmonitorctrl.h
+++ b/indra/newview/lloutputmonitorctrl.h
@@ -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;