summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llconversationview.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llconversationview.cpp58
1 files changed, 56 insertions, 2 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 9f3df93aba..9fb4b4f0dc 100644..100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -31,11 +31,17 @@
#include "llconversationmodel.h"
#include "llimconversation.h"
#include "llimfloatercontainer.h"
+#include "llfloaterreg.h"
+
+#include "lluictrlfactory.h"
+#include "llavatariconctrl.h"
//
// Implementation of conversations list session widgets
//
+
+
LLConversationViewSession::Params::Params() :
container()
{}
@@ -113,14 +119,42 @@ void LLConversationViewSession::refresh()
// Implementation of conversations list participant (avatar) widgets
//
+static LLDefaultChildRegistry::Register<LLConversationViewParticipant> r("conversation_view_participant");
+
LLConversationViewParticipant::Params::Params() :
- participant_id()
+container(),
+participant_id(),
+info_button("info_button"),
+output_monitor("output_monitor")
{}
LLConversationViewParticipant::LLConversationViewParticipant( const LLConversationViewParticipant::Params& p ):
LLFolderViewItem(p),
- mUUID(p.participant_id)
+ mUUID(p.participant_id)
+{
+
+}
+
+void LLConversationViewParticipant::initFromParams(const LLConversationViewParticipant::Params& params)
+{
+ LLButton::Params info_button_params(params.info_button());
+ LLButton * button = LLUICtrlFactory::create<LLButton>(info_button_params);
+ addChild(button);
+
+ LLOutputMonitorCtrl::Params output_monitor_params(params.output_monitor());
+ LLOutputMonitorCtrl * outputMonitor = LLUICtrlFactory::create<LLOutputMonitorCtrl>(output_monitor_params);
+ addChild(outputMonitor);
+}
+
+BOOL LLConversationViewParticipant::postBuild()
{
+ mInfoBtn = getChild<LLButton>("info_btn");
+ mInfoBtn->setClickedCallback(boost::bind(&LLConversationViewParticipant::onInfoBtnClick, this));
+
+ mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator");
+
+ LLFolderViewItem::postBuild();
+ return TRUE;
}
void LLConversationViewParticipant::refresh()
@@ -135,4 +169,24 @@ void LLConversationViewParticipant::refresh()
LLFolderViewItem::refresh();
}
+void LLConversationViewParticipant::addToFolder(LLFolderViewFolder* folder)
+{
+ //Add the item to the folder (conversation)
+ LLFolderViewItem::addToFolder(folder);
+
+ //Now retrieve the folder (conversation) UUID, which is the speaker session
+ LLConversationItem* vmi = this->getParentFolder() ? dynamic_cast<LLConversationItem*>(this->getParentFolder()->getViewModelItem()) : NULL;
+ if(vmi)
+ {
+ mSpeakingIndicator->setSpeakerId(mUUID,
+ vmi->getUUID()); //set the session id
+}
+}
+
+void LLConversationViewParticipant::onInfoBtnClick()
+{
+ LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mUUID));
+}
+
// EOF
+