summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationview.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-09-26 17:17:31 -0700
committerMerov Linden <merov@lindenlab.com>2012-09-26 17:17:31 -0700
commitc92a83fe01f2201361f2f3b9770308aac00093e8 (patch)
treeec199de8c835f8b1c7d5f61659b9707fa7d252c7 /indra/newview/llconversationview.cpp
parent9e1ea5a1652528dead811dee8904ae8a6833d163 (diff)
parent976a2f5a442150ef89cff6b39450eabbca956d0f (diff)
Pull merge from richard/viewer-chui
Diffstat (limited to 'indra/newview/llconversationview.cpp')
-rwxr-xr-xindra/newview/llconversationview.cpp84
1 files changed, 82 insertions, 2 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index a4733bb693..ab15e20d89 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -30,10 +30,12 @@
#include "llconversationview.h"
#include <boost/bind.hpp>
+#include "llagentdata.h"
#include "llconversationmodel.h"
#include "llimconversation.h"
#include "llimfloatercontainer.h"
#include "llfloaterreg.h"
+#include "llgroupiconctrl.h"
#include "lluictrlfactory.h"
//
@@ -51,20 +53,79 @@ LLConversationViewSession::LLConversationViewSession(const LLConversationViewSes
LLFolderViewFolder(p),
mContainer(p.container),
mItemPanel(NULL),
- mSessionTitle(NULL)
+ mCallIconLayoutPanel(NULL),
+ mSessionTitle(NULL),
+ mSpeakingIndicator(NULL)
{
}
+LLConversationViewSession::~LLConversationViewSession()
+{
+ mActiveVoiceChannelConnection.disconnect();
+}
+
BOOL LLConversationViewSession::postBuild()
{
LLFolderViewItem::postBuild();
mItemPanel = LLUICtrlFactory::getInstance()->createFromFile<LLPanel>("panel_conversation_list_item.xml", NULL, LLPanel::child_registry_t::instance());
-
addChild(mItemPanel);
+ mCallIconLayoutPanel = mItemPanel->getChild<LLPanel>("call_icon_panel");
mSessionTitle = mItemPanel->getChild<LLTextBox>("conversation_title");
+ mActiveVoiceChannelConnection = LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLConversationViewSession::onCurrentVoiceSessionChanged, this, _1));
+ mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicatorn");
+
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(getViewModelItem());
+ if (vmi)
+ {
+ switch(vmi->getType())
+ {
+ case LLConversationItem::CONV_PARTICIPANT:
+ case LLConversationItem::CONV_SESSION_1_ON_1:
+ {
+ LLIMModel::LLIMSession* session= LLIMModel::instance().findIMSession(vmi->getUUID());
+ if (session)
+ {
+ LLAvatarIconCtrl* icon = mItemPanel->getChild<LLAvatarIconCtrl>("avatar_icon");
+ icon->setVisible(true);
+ icon->setValue(session->mOtherParticipantID);
+ mSpeakingIndicator->setSpeakerId(gAgentID, session->mSessionID);
+ mSpeakingIndicator->setShowParticipantsTalking(true);
+ }
+ break;
+ }
+ case LLConversationItem::CONV_SESSION_AD_HOC:
+ {
+ LLGroupIconCtrl* icon = mItemPanel->getChild<LLGroupIconCtrl>("group_icon");
+ icon->setVisible(true);
+ mSpeakingIndicator->setSpeakerId(gAgentID, vmi->getUUID());
+ mSpeakingIndicator->setShowParticipantsTalking(true);
+ }
+ case LLConversationItem::CONV_SESSION_GROUP:
+ {
+ LLGroupIconCtrl* icon = mItemPanel->getChild<LLGroupIconCtrl>("group_icon");
+ icon->setVisible(true);
+ icon->setValue(vmi->getUUID());
+ mSpeakingIndicator->setSpeakerId(gAgentID, vmi->getUUID());
+ mSpeakingIndicator->setShowParticipantsTalking(true);
+ break;
+ }
+ case LLConversationItem::CONV_SESSION_NEARBY:
+ {
+ LLIconCtrl* icon = mItemPanel->getChild<LLIconCtrl>("nearby_chat_icon");
+ icon->setVisible(true);
+ mSpeakingIndicator->setSpeakerId(gAgentID);
+ mSpeakingIndicator->setShowParticipantsTalking(true);
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
refresh();
return TRUE;
@@ -188,6 +249,25 @@ void LLConversationViewSession::refresh()
LLFolderViewFolder::refresh();
}
+void LLConversationViewSession::onCurrentVoiceSessionChanged(const LLUUID& session_id)
+{
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(getViewModelItem());
+
+ if (vmi)
+ {
+ bool is_active = vmi->getUUID() == session_id;
+ bool is_nearby = vmi->getType() == LLConversationItem::CONV_SESSION_NEARBY;
+
+ if (is_nearby)
+ {
+ mSpeakingIndicator->setSpeakerId(is_active ? gAgentID : LLUUID::null);
+ }
+
+ mSpeakingIndicator->switchIndicator(is_active);
+ mCallIconLayoutPanel->setVisible(is_active);
+ }
+}
+
//
// Implementation of conversations list participant (avatar) widgets
//