diff options
Diffstat (limited to 'indra/newview/llimfloater.cpp')
-rw-r--r-- | indra/newview/llimfloater.cpp | 103 |
1 files changed, 49 insertions, 54 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 0f0048b0d0..6f26f1daff 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -131,7 +131,7 @@ void LLIMFloater::onClickCloseBtn() if (session == NULL) { - llwarns << "Empty session." << llendl; + llwarns << "Empty session with id: " << (mSessionID.asString()) << llendl; return; } @@ -354,10 +354,6 @@ BOOL LLIMFloater::postBuild() initIMFloater(); - // Add a conversation list item in the left pane - LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance(); - im_box->addConversationListItem(getTitle(), getKey(), this); - return result; } @@ -600,13 +596,13 @@ void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl) avatar_list->getValues(participants_uuids); // Check whether we have all participants names in LLAvatarNameCache - for (std::vector<LLSD>::const_iterator it = participants_uuids.begin(); it != participants_uuids.end(); ++it) + for (std::vector<LLSD>::const_iterator it = participants_uuids.begin(); it != participants_uuids.end(); ++it) { const LLUUID& id = it->asUUID(); temp_uuids.push_back(id); LLAvatarName av_name; - if (!LLAvatarNameCache::get(id, &av_name)) - { + if (!LLAvatarNameCache::get(id, &av_name)) + { all_names_resolved = false; // If a name is not found in cache, request it and continue the process recursively @@ -614,7 +610,7 @@ void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl) LLAvatarNameCache::get(id, boost::bind(&LLIMFloater::onParticipantsListChanged, this, avatar_list)); break; - } + } } if (all_names_resolved) @@ -623,41 +619,22 @@ void LLIMFloater::onParticipantsListChanged(LLUICtrl* ctrl) build_names_string(temp_uuids, ui_title); updateSessionName(ui_title, ui_title); } -} + } //static -LLIMFloater* LLIMFloater::show(const LLUUID& session_id) +LLIMFloater* LLIMFloater::addToIMContainer(const LLUUID& session_id) { - closeHiddenIMToasts(); - if (!gIMMgr->hasSession(session_id)) return NULL; - if(!isChatMultiTab()) - { - //hide all - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel"); - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); - iter != inst_list.end(); ++iter) - { - LLIMFloater* floater = dynamic_cast<LLIMFloater*>(*iter); - if (floater && floater->isDocked()) - { - floater->setVisible(false); - } - } - } - // Test the existence of the floater before we try to create it bool exist = findInstance(session_id); // Get the floater: this will create the instance if it didn't exist LLIMFloater* floater = getInstance(session_id); - if (!floater) - return NULL; - - if(isChatMultiTab()) + if (floater) { + LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); // Do not add again existing floaters @@ -672,33 +649,51 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) } } - floater->openFloater(floater->getKey()); + if (floater_container && floater_container->getVisible()) + { + floater->openFloater(floater->getKey()); + floater->setVisible(TRUE); + } + else + { + floater->setVisible(FALSE); + } } - else - { - // Docking may move chat window, hide it before moving, or user will see how window "jumps" - floater->setVisible(false); + return floater; +} - if (floater->getDockControl() == NULL) - { - LLChiclet* chiclet = - LLChicletBar::getInstance()->getChicletPanel()->findChiclet<LLChiclet>( - session_id); - if (chiclet == NULL) - { - llerror("Dock chiclet for LLIMFloater doesn't exists", 0); - } - else - { - LLChicletBar::getInstance()->getChicletPanel()->scrollToChiclet(chiclet); - } +//static +LLIMFloater* LLIMFloater::show(const LLUUID& session_id) +{ + closeHiddenIMToasts(); - floater->setDockControl(new LLDockControl(chiclet, floater, floater->getDockTongue(), - LLDockControl::BOTTOM)); - } + if (!gIMMgr->hasSession(session_id)) + return NULL; - // window is positioned, now we can show it. + // Test the existence of the floater before we try to create it + bool exist = findInstance(session_id); + + // Get the floater: this will create the instance if it didn't exist + LLIMFloater* floater = getInstance(session_id); + if (!floater) + return NULL; + + LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance(); + + // Do not add again existing floaters + if (!exist) + { + // LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; + // TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists + LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END; + if (floater_container) + { + floater_container->addFloater(floater, TRUE, i_pt); + } } + + floater->openFloater(floater->getKey()); + floater->setVisible(TRUE); return floater; |