From b77e2f17aa9755120032ee977d34e9e923cba0be Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Wed, 24 Oct 2012 16:02:58 -0700 Subject: CHUI-449: Problem: When a toast was clicked, the conversation floater was displayed without selecting the conversation line item. Resolution: Added a function that will show the conversation floater container and then trigger selecting the conversation line item. When the conversation line item is selecting this implicitly will cause the correct conversation floater to be displayed. --- indra/newview/llconversationview.cpp | 27 ++++++++++----------------- indra/newview/llimfloatercontainer.cpp | 6 ++++++ indra/newview/llimfloatercontainer.h | 2 ++ indra/newview/llimview.cpp | 3 ++- 4 files changed, 20 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 9144f402b4..92493194b8 100755 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -437,29 +437,22 @@ void LLConversationViewParticipant::selectItem() LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance(); LLFloater* session_floater; - //Only execute when switching floaters (conversations) - if(vmi && vmi->getUUID() != container->getSelectedSession()) + if(vmi) { - //When null, show the nearby chat conversation floater - if(vmi->getUUID().isNull()) + session_floater = LLIMConversation::getConversation(vmi->getUUID()); + + //Only execute when switching floaters (conversations) + if(vmi->getUUID() != container->getSelectedSession()) { - LLNearbyChat* nearbyChat = LLFloaterReg::findTypedInstance("nearby_chat"); - nearbyChat->show(); + container->selectFloater(session_floater); + // Store the active session + container->setSelectedSession(vmi->getUUID()); } - //Otherwise, show the IM conversation floater + //Focus the current conversation floater (it is already visible so just focus it) else { - LLIMFloater::show(vmi->getUUID()); + session_floater->setFocus(TRUE); } - - // Store the active session - container->setSelectedSession(vmi->getUUID()); - } - //Focus the current conversation floater (it is already visible so just focus it) - else - { - session_floater = LLIMConversation::getConversation(vmi->getUUID()); - session_floater->setFocus(TRUE); } LLFolderViewItem::selectItem(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 7821f2ee0d..0538a286ce 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -1089,6 +1089,12 @@ bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata) return false; } +void LLIMFloaterContainer::showConversation(const LLUUID& session_id) +{ + setVisibleAndFrontmost(false); + setConvItemSelect(session_id); +} + //Will select only the conversation item void LLIMFloaterContainer::setConvItemSelect(const LLUUID& session_id) { diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 75fed18502..b884ad5d4b 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -65,6 +65,8 @@ public: /*virtual*/ void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END); + + void showConversation(const LLUUID& session_id); void setConvItemSelect(const LLUUID& session_id); void setItemSelect(const LLUUID& session_id); /*virtual*/ void tabClose(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 4c5631d5e1..d5f1e81933 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -49,6 +49,7 @@ #include "llcallingcard.h" #include "llchat.h" #include "llimfloater.h" +#include "llimfloatercontainer.h" #include "llgroupiconctrl.h" #include "llmd5.h" #include "llmutelist.h" @@ -108,7 +109,7 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id, args["FROM"] = av_name.getCompleteName(); args["FROM_ID"] = msg["from_id"]; args["SESSION_ID"] = msg["session_id"]; - LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloater::show, msg["session_id"].asUUID())); + LLNotificationsUtil::add("IMToast", args, LLSD(), boost::bind(&LLIMFloaterContainer::showConversation, LLIMFloaterContainer::getInstance(), msg["session_id"].asUUID())); } void toast_callback(const LLSD& msg){ -- cgit v1.2.3