summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authormaxim_productengine <mnikolenko@productengine.com>2012-11-01 16:58:55 +0200
committermaxim_productengine <mnikolenko@productengine.com>2012-11-01 16:58:55 +0200
commit424a80155ac755bc0191ddd44ef125bdbda39fa5 (patch)
tree3a4af3824ece33609b1598fa24825cdaa61d5a87 /indra/newview
parentd886d89f53267d9a9a02c775fcb16e667278b904 (diff)
CHUI-445 FIXED Select the next conversation in the list when current conversation is deleted
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llimfloatercontainer.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 65dc024aea..f85aa9a353 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -1206,6 +1206,7 @@ bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c
// Note : since the mConversationsItems is also the listener to the widget, deleting
// the widget will also delete its listener
bool isWidgetSelected = false;
+ LLFolderViewItem* new_selection = NULL;
conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(uuid);
if (widget_it != mConversationsWidgets.end())
{
@@ -1213,6 +1214,11 @@ bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c
if (widget)
{
isWidgetSelected = widget->isSelected();
+ new_selection = mConversationsRoot->getNextFromChild(widget);
+ if(new_selection == NULL)
+ {
+ new_selection = mConversationsRoot->getPreviousFromChild(widget);
+ }
widget->destroyView();
}
}
@@ -1225,12 +1231,13 @@ bool LLIMFloaterContainer::removeConversationListItem(const LLUUID& uuid, bool c
if (change_focus)
{
setFocus(TRUE);
- conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin();
- if (widget_it != mConversationsWidgets.end())
+ if(new_selection != NULL)
{
- mSelectedSession = widget_it->first;
- LLFolderViewItem* widget = widget_it->second;
- widget->selectItem();
+ LLConversationItem* vmi = dynamic_cast<LLConversationItem*>(new_selection->getViewModelItem());
+ if(vmi != NULL)
+ {
+ selectConversation(vmi->getUUID());
+ }
}
}
return isWidgetSelected;