From b466cdbee3d57692b24890313f60de5ef86d6cf8 Mon Sep 17 00:00:00 2001 From: ziree Date: Tue, 24 May 2011 21:14:50 +0200 Subject: [PATCH] Proposed fix for FIRE-1091 - There was an error with IM windows getting torn off instead of the contacts floater due to a naming mix-up. --- indra/newview/fscontactsfloater.cpp | 15 +++++++++++++++ indra/newview/llimfloater.cpp | 13 +------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/indra/newview/fscontactsfloater.cpp b/indra/newview/fscontactsfloater.cpp index c5533d85bd..203de49493 100644 --- a/indra/newview/fscontactsfloater.cpp +++ b/indra/newview/fscontactsfloater.cpp @@ -44,8 +44,10 @@ #include "llfriendcard.h" #include "llgroupactions.h" #include "llgrouplist.h" +#include "llimfloatercontainer.h" #include "llsidetray.h" #include "llstartup.h" +#include "llviewercontrol.h" static const std::string FRIENDS_TAB_NAME = "friends_panel"; static const std::string GROUP_TAB_NAME = "groups_panel"; @@ -153,6 +155,19 @@ void FSFloaterContacts::updateButtons() void FSFloaterContacts::onOpen(const LLSD& key) { + if (gSavedSettings.getBOOL("ContactsTornOff")) + { + LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); + // first set the tear-off host to the conversations container + setHost(floater_container); + // clear the tear-off host right after, the "last host used" will still stick + setHost(NULL); + // reparent to floater view + gFloaterView->addChild(this); + // and remember we are torn off + setTornOff(TRUE); + } + if (key.asString() == "friends") { childShowTab("friends_and_groups", "friends_panel"); diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index b05b204017..d1b9773245 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -899,19 +899,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) { LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); - if (gSavedSettings.getBOOL("ContactsTornOff")) - { - // first set the tear-off host to the conversations container - floater->setHost(floater_container); - // clear the tear-off host right after, the "last host used" will still stick - floater->setHost(NULL); - // reparent to floater view - gFloaterView->addChild(floater); - // and remember we are torn off - floater->setTornOff(TRUE); - } // do not add existed floaters to avoid adding torn off instances - else if (!exist) + if (!exist) { // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists