From 9da25577274580f07411c38cd5fc0b256aebf8a5 Mon Sep 17 00:00:00 2001 From: kadah Date: Sat, 12 Feb 2011 20:40:24 -0800 Subject: [PATCH] Disable close button on nearby chat. Fixed tab locking/unlocking. --- indra/newview/llimfloatercontainer.cpp | 22 ++++++++++++++++++++-- indra/newview/llimfloatercontainer.h | 3 ++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index fdb8ea7f80..e0b6f20eba 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -92,6 +92,21 @@ void LLIMFloaterContainer::onOpen(const LLSD& key) */ } +void LLIMFloaterContainer::removeFloater(LLFloater* floaterp) +{ + if (floaterp->getName() == "nearby_chat") + { + // only my friends floater now locked + mTabContainer->lockTabs(mTabContainer->getNumLockedTabs() - 1); + } + else if (floaterp->getName() == "imcontacts") + { + // only chat floater now locked + mTabContainer->lockTabs(mTabContainer->getNumLockedTabs() - 1); + } + LLMultiFloater::removeFloater(floaterp); +} + void LLIMFloaterContainer::addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point) @@ -105,12 +120,15 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp, return; } - if (floaterp->getName() == "imcontacts") + if (floaterp->getName() == "imcontacts" || floaterp->getName() == "nearby_chat") { S32 num_locked_tabs = mTabContainer->getNumLockedTabs(); mTabContainer->unlockTabs(); // add contacts window as first tab - LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::START); + if (floaterp->getName() == "imcontacts") + LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::START); + else + LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::RIGHT_OF_CURRENT); // make sure first two tabs are now locked mTabContainer->lockTabs(num_locked_tabs + 1); //gSavedSettings.setBOOL("ContactsTornOff", FALSE); diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index ed1de3c142..32535dc0b9 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -46,7 +46,8 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); void onCloseFloater(LLUUID& id); - + + /*virtual*/ void removeFloater(LLFloater* floaterp); /*virtual*/ void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);