summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloatercontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimfloatercontainer.cpp')
-rw-r--r--indra/newview/llimfloatercontainer.cpp56
1 files changed, 37 insertions, 19 deletions
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index 9c6cee6cb5..9084c07cc7 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -85,7 +85,6 @@ BOOL LLIMFloaterContainer::postBuild()
void LLIMFloaterContainer::onOpen(const LLSD& key)
{
- llinfos << "Merov debug : onOpen, key = " << key.asUUID() << llendl;
LLMultiFloater::onOpen(key);
/*
if (key.isDefined())
@@ -120,10 +119,10 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
// CHUI-137
// Create a conversation item
LLConversationItem* item = new LLConversationItem(floaterp->getTitle(),session_id, floaterp, this);
- mConversationsItems.push_back(item);
+ mConversationsItems[session_id] = item;
// Create a widget from it
LLFolderViewItem* widget = createConversationItemWidget(item);
- mConversationsWidgets.push_back(widget);
+ mConversationsWidgets[session_id] = widget;
// Add it to the UI
widget->setVisible(TRUE);
mConversationsListPanel->addChild(widget);
@@ -165,8 +164,6 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
}
mTabContainer->setTabImage(floaterp, icon);
-
- llinfos << "Merov debug : addFloater, title = " << floaterp->getTitle() << ", uuid = " << session_id << llendl;
}
// virtual
@@ -174,8 +171,34 @@ void LLIMFloaterContainer::removeFloater(LLFloater* floaterp)
{
LLMultiFloater::removeFloater(floaterp);
- llinfos << "Merov debug : removeFloater, title = " << floaterp->getTitle() << ", uuid = " << floaterp->getKey() << llendl;
-
+ // CHUI-137 : Clean up the conversations list
+ LLUUID session_id = floaterp->getKey();
+ // Delete the widget and the associated conversation item
+ // Note : since the mConversationsItems is a listener to the widget, deleting the widget also
+ // delete its listener
+ conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(session_id);
+ if (widget_it != mConversationsWidgets.end())
+ {
+ LLFolderViewItem* widget = widget_it->second;
+ delete widget;
+ }
+ // Suppress the conversation items and widgets from their respective maps
+ mConversationsItems.erase(session_id);
+ mConversationsWidgets.erase(session_id);
+ // Reposition the leftover conversation items
+ LLRect panel_rect = mConversationsListPanel->getRect();
+ S32 item_height = 16;
+ int index = 0;
+ for (widget_it = mConversationsWidgets.begin(); widget_it != mConversationsWidgets.end(); ++widget_it, ++index)
+ {
+ LLFolderViewItem* widget = widget_it->second;
+ widget->setRect(LLRect(0,
+ panel_rect.getHeight() - item_height*index,
+ panel_rect.getWidth(),
+ panel_rect.getHeight() - item_height*(index+1)));
+ }
+ // CHUI-137
+
LLRect contents_rect = floaterp->getRect();
// reduce the floater contents height by header height
@@ -364,41 +387,36 @@ LLConversationItem::LLConversationItem(std::string name, const LLUUID& uuid, LLF
mFloater(floaterp),
mContainer(containerp)
{
+ // Hack: the nearby chat has no name so we catch that and impose one
if (name == "")
mName = "Nearby Chat";
}
// Virtual action callbacks
+void LLConversationItem::selectItem(void)
+{
+ // Select the conversation floater that is being selected
+ mContainer->selectFloater(mFloater);
+}
+
void LLConversationItem::performAction(LLInventoryModel* model, std::string action)
{
- llinfos << "Merov debug : performAction, title = " << mName << ", action = " << action << llendl;
}
void LLConversationItem::openItem( void )
{
- llinfos << "Merov debug : openItem, title = " << mName << llendl;
}
void LLConversationItem::closeItem( void )
{
- llinfos << "Merov debug : closeItem, title = " << mName << llendl;
}
void LLConversationItem::previewItem( void )
{
- llinfos << "Merov debug : previewItem, title = " << mName << llendl;
-}
-
-void LLConversationItem::selectItem(void)
-{
- llinfos << "Merov debug : selectItem, title = " << mName << ", uuid = " << mUUID << llendl;
- mContainer->selectFloater(mFloater);
}
void LLConversationItem::showProperties(void)
{
- llinfos << "Merov debug : showProperties, title = " << mName << llendl;
}
-
// EOF