From 430af6f731b2b822dd91d3163d7e206e3559a211 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 4 Jun 2013 14:49:07 +0300 Subject: CHUI-918 FIXED Close only selected conversations instead of closing all conversations. --- indra/newview/llconversationmodel.cpp | 8 +++---- indra/newview/llfloaterimcontainer.cpp | 25 ++++++++++++++++++---- indra/newview/llfloaterimcontainer.h | 3 ++- .../skins/default/xui/en/menu_conversation.xml | 14 ++++++------ 4 files changed, 34 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index ee55b8fe80..27caedf472 100755 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -363,18 +363,19 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) lldebugs << "LLConversationItemParticipant::buildContextMenu()" << llendl; menuentry_vec_t items; menuentry_vec_t disabled_items; - + if(flags & ITEM_IN_MULTI_SELECTION) + { + items.push_back(std::string("close_selected_conversations")); + } if(this->getType() == CONV_SESSION_1_ON_1) { items.push_back(std::string("close_conversation")); - items.push_back(std::string("close_all_conversations")); items.push_back(std::string("separator_disconnect_from_voice")); buildParticipantMenuOptions(items, flags); } else if(this->getType() == CONV_SESSION_GROUP) { items.push_back(std::string("close_conversation")); - items.push_back(std::string("close_all_conversations")); addVoiceOptions(items); items.push_back(std::string("chat_history")); items.push_back(std::string("separator_chat_history")); @@ -385,7 +386,6 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) else if(this->getType() == CONV_SESSION_AD_HOC) { items.push_back(std::string("close_conversation")); - items.push_back(std::string("close_all_conversations")); addVoiceOptions(items); items.push_back(std::string("chat_history")); } diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 3783ae60e7..60ece0aab1 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -981,7 +981,7 @@ void LLFloaterIMContainer::setSortOrder(const LLConversationSort& order) gSavedSettings.setU32("ConversationSortOrder", (U32)order); } -void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids) +void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids, bool participant_uuids/* = true*/) { const std::set selectedItems = mConversationsRoot->getSelectionList(); @@ -994,7 +994,7 @@ void LLFloaterIMContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids) conversationItem = static_cast((*it)->getViewModelItem()); //When a one-on-one conversation exists, retrieve the participant id from the conversation floater - if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1) + if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1 && participant_uuids) { LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(conversationItem->getUUID()); LLUUID participant_id = conversation_floaterp->getOtherParticipantUUID(); @@ -1149,9 +1149,10 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, { LLFloater::onClickClose(conversationFloater); } - else if("close_all_conversations" == command) + else if("close_selected_conversations" == command) { - closeAllConversations(); + getSelectedUUIDs(selectedIDS,false); + closeSelectedConversations(selectedIDS); } else if("open_voice_conversation" == command) { @@ -2117,6 +2118,22 @@ void LLFloaterIMContainer::closeAllConversations() LLFloater::onClickClose(conversationFloater); } } + +void LLFloaterIMContainer::closeSelectedConversations(const uuid_vec_t& ids) +{ + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + //We don't need to close Nearby chat, so skip it + if (*it != LLUUID()) + { + LLFloaterIMSession *conversationFloater = LLFloaterIMSession::findInstance(*it); + if(conversationFloater) + { + LLFloater::onClickClose(conversationFloater); + } + } + } +} void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) { if(app_quitting) diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h index 5121e902cb..5cd92beed1 100755 --- a/indra/newview/llfloaterimcontainer.h +++ b/indra/newview/llfloaterimcontainer.h @@ -119,6 +119,7 @@ public: virtual BOOL handleKeyHere(KEY key, MASK mask ); /*virtual*/ void closeFloater(bool app_quitting = false); void closeAllConversations(); + void closeSelectedConversations(const uuid_vec_t& ids); /*virtual*/ BOOL isFrontmost(); @@ -151,7 +152,7 @@ private: void setSortOrderParticipants(const LLConversationFilter::ESortOrderType order); void setSortOrder(const LLConversationSort& order); - void getSelectedUUIDs(uuid_vec_t& selected_uuids); + void getSelectedUUIDs(uuid_vec_t& selected_uuids, bool participant_uuids = true); const LLConversationItem * getCurSelectedViewModelItem(); void getParticipantUUIDs(uuid_vec_t& selected_uuids); void doToSelected(const LLSD& userdata); diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index 7494309315..b3d28788da 100755 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -11,13 +11,7 @@ layout="topleft" name="close_conversation"> - - - - + + + +