From 25c222e31770cb2c10e262b02ae9065521986349 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Tue, 23 Apr 2013 15:09:41 +0300 Subject: CHUI-943 FIXED "Chat history" menu item is added to context menu for Nearby chat. --- indra/newview/llconversationmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llconversationmodel.cpp') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index c74ce24872..6e95df8383 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -386,6 +386,10 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) addVoiceOptions(items); items.push_back(std::string("chat_history")); } + else if(this->getType() == CONV_SESSION_NEARBY) + { + items.push_back(std::string("chat_history")); + } hide_context_entries(menu, items, disabled_items); } -- cgit v1.3 From ef69d31b993fe849526799f225dd0eda12c82dab Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Wed, 29 May 2013 15:53:36 +0300 Subject: CHUI-918 FIXED "Close all conversations" menu item is added to context menu. --- indra/newview/llconversationmodel.cpp | 3 +++ indra/newview/llfloaterimcontainer.cpp | 27 +++++++++++++--------- .../skins/default/xui/en/menu_conversation.xml | 6 +++++ 3 files changed, 25 insertions(+), 11 deletions(-) (limited to 'indra/newview/llconversationmodel.cpp') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 6e95df8383..ee55b8fe80 100755 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -367,12 +367,14 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) 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")); @@ -383,6 +385,7 @@ 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 700bc94105..4bfb19ce36 100755 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -977,7 +977,7 @@ void LLFloaterIMContainer::setSortOrder(const LLConversationSort& order) conversation_floater->setSortOrder(order); } } - + gSavedSettings.setU32("ConversationSortOrder", (U32)order); } @@ -1149,6 +1149,10 @@ void LLFloaterIMContainer::doToSelectedConversation(const std::string& command, { LLFloater::onClickClose(conversationFloater); } + else if("close_all_conversations" == command) + { + closeAllConversations(); + } else if("open_voice_conversation" == command) { gIMMgr->startCall(conversationItem->getUUID()); @@ -2097,20 +2101,21 @@ void LLFloaterIMContainer::closeHostedFloater() void LLFloaterIMContainer::closeAllConversations() { - conversations_widgets_map::iterator widget_it = mConversationsWidgets.begin(); - for (;widget_it != mConversationsWidgets.end(); ++widget_it) + LLDynamicArray ids; + for (conversations_items_map::iterator it_session = mConversationsItems.begin(); it_session != mConversationsItems.end(); it_session++) { - if (widget_it->first != LLUUID()) + LLUUID session_id = it_session->first; + if (session_id != LLUUID()) { - LLConversationViewSession* widget = dynamic_cast(widget_it->second); - if (widget) - { - widget->destroyView(); - mConversationsItems.erase(widget_it->first); - mConversationsWidgets.erase(widget_it->first); - } + ids.push_back(session_id); } } + + for (LLDynamicArray::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + LLFloaterIMSession *conversationFloater = LLFloaterIMSession::findInstance(*it); + LLFloater::onClickClose(conversationFloater); + } } void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/) { diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index 5a13ef0a59..7494309315 100755 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -12,6 +12,12 @@ name="close_conversation"> + + + 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/newview/llconversationmodel.cpp') 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"> - - - - + + + + Date: Wed, 5 Jun 2013 19:27:48 +0300 Subject: CHUI-918 Don't show "Close Selected" item if Nearby chat is selected --- indra/newview/llconversationmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llconversationmodel.cpp') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 27caedf472..192a594c9d 100755 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -363,7 +363,7 @@ 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) + if((flags & ITEM_IN_MULTI_SELECTION) && (this->getType() != CONV_SESSION_NEARBY)) { items.push_back(std::string("close_selected_conversations")); } -- cgit v1.3