summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llconversationview.cpp')
-rw-r--r--indra/newview/llconversationview.cpp59
1 files changed, 28 insertions, 31 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index 1abebc996b..a1f627c8cc 100644
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -57,7 +57,7 @@ public:
: conversation(conv)
{}
- virtual void onChange(EStatusType status, const std::string &channelURI, bool proximal)
+ virtual void onChange(EStatusType status, const LLSD& channelInfo, bool proximal)
{
conversation->showVoiceIndicator(conversation
&& status != STATUS_JOINING
@@ -98,10 +98,7 @@ LLConversationViewSession::~LLConversationViewSession()
if (mVoiceClientObserver)
{
- if (LLVoiceClient::instanceExists())
- {
- LLVoiceClient::getInstance()->removeObserver(mVoiceClientObserver);
- }
+ LLVoiceClient::removeObserver(mVoiceClientObserver);
delete mVoiceClientObserver;
}
@@ -206,7 +203,7 @@ bool LLConversationViewSession::isHighlightActive()
return (mFlashStateOn ? (mFlashTimer->isFlashingInProgress() ? mFlashTimer->isCurrentlyHighlighted() : true) : mIsCurSelection);
}
-BOOL LLConversationViewSession::postBuild()
+bool LLConversationViewSession::postBuild()
{
LLFolderViewItem::postBuild();
@@ -259,16 +256,15 @@ BOOL LLConversationViewSession::postBuild()
icon->setVisible(true);
mSpeakingIndicator->setSpeakerId(gAgentID, LLUUID::null, true);
mIsInActiveVoiceChannel = true;
- if(LLVoiceClient::instanceExists())
- {
+
if (mVoiceClientObserver)
{
- LLVoiceClient::getInstance()->removeObserver(mVoiceClientObserver);
+ LLVoiceClient::removeObserver(mVoiceClientObserver);
delete mVoiceClientObserver;
}
mVoiceClientObserver = new LLNearbyVoiceClientStatusObserver(this);
- LLVoiceClient::getInstance()->addObserver(mVoiceClientObserver);
- }
+ LLVoiceClient::addObserver(mVoiceClientObserver);
+
break;
}
default:
@@ -278,7 +274,7 @@ BOOL LLConversationViewSession::postBuild()
refresh(); // requires vmi
}
- return TRUE;
+ return true;
}
void LLConversationViewSession::draw()
@@ -286,7 +282,7 @@ void LLConversationViewSession::draw()
getViewModelItem()->update();
const LLFolderViewItem::Params& default_params = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
- const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE);
+ const bool show_context = (getRoot() ? getRoot()->getShowSelectionContext() : false);
// Indicate that flash can start (moot operation if already started, done or not flashing)
startFlashing();
@@ -317,15 +313,15 @@ void LLConversationViewSession::draw()
{
// update the rotation angle of open folder arrow
updateLabelRotation();
- drawOpenFolderArrow(default_params, sFgColor);
+ drawOpenFolderArrow();
}
LLView::draw();
}
-BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask )
+bool LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask )
{
//Will try to select a child node and then itself (if a child was not selected)
- BOOL result = LLFolderViewFolder::handleMouseDown(x, y, mask);
+ bool result = LLFolderViewFolder::handleMouseDown(x, y, mask);
//This node (conversation) was selected and a child (participant) was not
if(result && getRoot())
@@ -351,9 +347,9 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask )
return result;
}
-BOOL LLConversationViewSession::handleMouseUp( S32 x, S32 y, MASK mask )
+bool LLConversationViewSession::handleMouseUp( S32 x, S32 y, MASK mask )
{
- BOOL result = LLFolderViewFolder::handleMouseUp(x, y, mask);
+ bool result = LLFolderViewFolder::handleMouseUp(x, y, mask);
LLFloater* volume_floater = LLFloaterReg::findInstance("floater_voice_volume");
LLFloater* chat_volume_floater = LLFloaterReg::findInstance("chat_voice");
@@ -374,9 +370,9 @@ BOOL LLConversationViewSession::handleMouseUp( S32 x, S32 y, MASK mask )
return result;
}
-BOOL LLConversationViewSession::handleRightMouseDown( S32 x, S32 y, MASK mask )
+bool LLConversationViewSession::handleRightMouseDown( S32 x, S32 y, MASK mask )
{
- BOOL result = LLFolderViewFolder::handleRightMouseDown(x, y, mask);
+ bool result = LLFolderViewFolder::handleRightMouseDown(x, y, mask);
if(result)
{
@@ -446,7 +442,7 @@ void LLConversationViewSession::toggleCollapsedMode(bool is_collapsed)
mItemPanel->translate(mCollapsedMode ? -h_pad : h_pad, 0);
}
-void LLConversationViewSession::setVisibleIfDetached(BOOL visible)
+void LLConversationViewSession::setVisibleIfDetached(bool visible)
{
// Do this only if the conversation floater has been torn off (i.e. no multi floater host) and is not minimized
// Note: minimized dockable floaters are brought to front hence unminimized when made visible and we don't want that here
@@ -616,7 +612,7 @@ void LLConversationViewParticipant::initFromParams(const LLConversationViewParti
addChild(outputMonitor);
}
-BOOL LLConversationViewParticipant::postBuild()
+bool LLConversationViewParticipant::postBuild()
{
mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
@@ -640,7 +636,7 @@ BOOL LLConversationViewParticipant::postBuild()
LLFolderViewItem::postBuild();
refresh();
}
- return TRUE;
+ return true;
}
void LLConversationViewParticipant::draw()
@@ -652,8 +648,9 @@ void LLConversationViewParticipant::draw()
static LLUIColor sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
static LLUIColor sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
+ static LLUIColor sFriendColor = LLUIColorTable::instance().getColor("ConversationFriendColor");
- const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE);
+ const bool show_context = (getRoot() ? getRoot()->getShowSelectionContext() : false);
const LLFontGL* font = getLabelFontForStyle(mLabelStyle);
F32 right_x = 0;
@@ -661,23 +658,23 @@ void LLConversationViewParticipant::draw()
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
F32 text_left = (F32)getLabelXPos();
- LLColor4 color;
+ LLUIColor* color;
LLLocalSpeakerMgr *speakerMgr = LLLocalSpeakerMgr::getInstance();
if (speakerMgr && speakerMgr->isSpeakerToBeRemoved(mUUID))
{
- color = sFgDisabledColor;
+ color = &sFgDisabledColor;
}
else
{
if (LLAvatarActions::isFriend(mUUID))
{
- color = LLUIColorTable::instance().getColor("ConversationFriendColor");
+ color = &sFriendColor;
}
else
{
- color = mIsSelected ? sHighlightFgColor : sFgColor;
+ color = mIsSelected ? &sHighlightFgColor : &sFgColor;
}
}
@@ -688,7 +685,7 @@ void LLConversationViewParticipant::draw()
}
drawHighlight(show_context, mIsSelected, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
- drawLabel(font, text_left, y, color, right_x);
+ drawLabel(font, text_left, y, color->get(), right_x);
LLView::draw();
}
@@ -765,9 +762,9 @@ void LLConversationViewParticipant::onInfoBtnClick()
LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mUUID));
}
-BOOL LLConversationViewParticipant::handleMouseDown( S32 x, S32 y, MASK mask )
+bool LLConversationViewParticipant::handleMouseDown( S32 x, S32 y, MASK mask )
{
- BOOL result = LLFolderViewItem::handleMouseDown(x, y, mask);
+ bool result = LLFolderViewItem::handleMouseDown(x, y, mask);
if(result && getRoot())
{