summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloatercontainer.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-10-15 13:58:21 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-10-15 13:58:21 -0700
commit5a5df259ffc23a6289d25deac906047a7356fb42 (patch)
tree37534a7be9108e0865d17f85cb677120f26b771b /indra/newview/llimfloatercontainer.cpp
parentd7d0416547958792517a9b739b370e51c717fb23 (diff)
CHUI-380: Final commit for this issue. After code review changed some method names to be more accurate. Also using dynamic_cast instead of static_cast for safety.
Diffstat (limited to 'indra/newview/llimfloatercontainer.cpp')
-rw-r--r--indra/newview/llimfloatercontainer.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 0250854f36..c8897c1f92 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -101,9 +101,9 @@ void LLIMFloaterContainer::sessionAdded(const LLUUID& session_id, const std::str
addConversationListItem(session_id);
}
-void LLIMFloaterContainer::sessionAlreadyAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
+void LLIMFloaterContainer::sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id)
{
- doSomething(session_id);
+ setItemSelect(session_id);
}
void LLIMFloaterContainer::sessionVoiceOrIMStarted(const LLUUID& session_id)
@@ -1064,6 +1064,7 @@ bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata)
return false;
}
+//Will select only the conversation item
void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id)
{
LLFolderViewItem* widget = mConversationsWidgets[session_id];
@@ -1074,15 +1075,22 @@ void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id)
}
}
-void LLIMFloaterContainer::doSomething(const LLUUID& session_id)
+//Will select the conversation/participant item
+void LLIMFloaterContainer::setItemSelect(const LLUUID& session_id)
{
- LLConversationItem* vmi = static_cast<LLConversationItem*>(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem());
- if(session_id != vmi->getUUID())
+ if(mConversationsRoot->getCurSelectedItem() && mConversationsRoot->getCurSelectedItem()->getParentFolder())
{
- mSelectedSession = session_id;
- LLFolderViewItem* widget = mConversationsWidgets[session_id];
- (widget->getRoot())->setSelection(widget, FALSE, FALSE);
+ //Retreive the conversation id. When a participant is selected, then have to to get the converation id from the parent.
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(mConversationsRoot->getCurSelectedItem()->getParentFolder()->getViewModelItem());
+
+ //Will allow selection/highlighting of the conversation/participant
+ if(session_id != vmi->getUUID())
+ {
+ mSelectedSession = session_id;
+ LLFolderViewItem* widget = mConversationsWidgets[session_id];
+ (widget->getRoot())->setSelection(widget, FALSE, FALSE);
+ }
}
}