CHUI-137 : Implemented switch conversation in the conversation list

meow-7.2.2
Merov Linden 2012-06-11 17:25:17 -07:00
parent e286330365
commit db67c21f90
3 changed files with 21 additions and 8 deletions

View File

@ -387,6 +387,10 @@ void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection,
{
getRoot()->setSelection(selection, openitem, take_keyboard_focus);
}
else if (mListener)
{
mListener->selectItem();
}
}
// helper function to change the selection from the root.

View File

@ -85,6 +85,7 @@ BOOL LLIMFloaterContainer::postBuild()
void LLIMFloaterContainer::onOpen(const LLSD& key)
{
llinfos << "Merov debug : onOpen, key = " << key.asUUID() << llendl;
LLMultiFloater::onOpen(key);
/*
if (key.isDefined())
@ -114,9 +115,11 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
LLUUID session_id = floaterp->getKey();
// CHUI-137
// Create a conversation item
LLConversationItem* item = new LLConversationItem(floaterp->getTitle());
LLConversationItem* item = new LLConversationItem(floaterp->getTitle(),session_id, floaterp, this);
mConversationsItems.push_back(item);
// Create a widget from it
LLFolderViewItem* widget = createConversationItemWidget(item);
@ -139,8 +142,6 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
// so reshape floater contents to occupy the header space
floater_contents->setShape(floaterp->getRect());
LLUUID session_id = floaterp->getKey();
LLIconCtrl* icon = 0;
if(gAgent.isInGroup(session_id, TRUE))
@ -164,6 +165,8 @@ 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
@ -171,7 +174,7 @@ void LLIMFloaterContainer::removeFloater(LLFloater* floaterp)
{
LLMultiFloater::removeFloater(floaterp);
llinfos << "Merov debug : removeFloater, title = " << floaterp->getTitle() << llendl;
llinfos << "Merov debug : removeFloater, title = " << floaterp->getTitle() << ", uuid = " << floaterp->getKey() << llendl;
LLRect contents_rect = floaterp->getRect();
@ -355,9 +358,11 @@ LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversat
}
// Conversation items
LLConversationItem::LLConversationItem(std::string name) :
LLConversationItem::LLConversationItem(std::string name, const LLUUID& uuid, LLFloater* floaterp, LLIMFloaterContainer* containerp) :
mName(name),
mUUID(LLUUID::null)
mUUID(uuid),
mFloater(floaterp),
mContainer(containerp)
{
if (name == "")
mName = "Nearby Chat";
@ -386,7 +391,8 @@ void LLConversationItem::previewItem( void )
void LLConversationItem::selectItem(void)
{
llinfos << "Merov debug : selectItem, title = " << mName << llendl;
llinfos << "Merov debug : selectItem, title = " << mName << ", uuid = " << mUUID << llendl;
mContainer->selectFloater(mFloater);
}
void LLConversationItem::showProperties(void)

View File

@ -45,6 +45,7 @@ class LLTabContainer;
// CHUI-137 : Temporary implementation of conversations list
class LLConversationItem;
class LLIMFloaterContainer;
typedef std::list<LLConversationItem*> conversations_items_list_t;
typedef std::list<LLFolderViewItem*> conversations_widgets_list_t;
@ -54,7 +55,7 @@ typedef std::list<LLFolderViewItem*> conversations_widgets_list_t;
class LLConversationItem : public LLFolderViewEventListener
{
public:
LLConversationItem(std::string name);
LLConversationItem(std::string name, const LLUUID& uuid, LLFloater* floaterp, LLIMFloaterContainer* containerp);
virtual ~LLConversationItem() {}
// Stub those things we won't really be using in this conversation context
@ -111,6 +112,8 @@ public:
private:
std::string mName;
const LLUUID mUUID;
LLFloater* mFloater;
LLIMFloaterContainer* mContainer;
};
// CHUI-137 : End