From 11a148415e810706f2a1835b6b717a0a062d458f Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 28 Sep 2012 18:22:05 -0700 Subject: CHUI-102: Now the participants and one-on-one conversations have right-click-menus. These menus are functional as well, but 'chat history' does not yet work. --- indra/newview/llconversationmodel.cpp | 44 +++++ indra/newview/llconversationmodel.h | 18 +- indra/newview/llimfloater.h | 1 + indra/newview/llimfloatercontainer.cpp | 192 ++++++++++++++++++++- indra/newview/llimfloatercontainer.h | 5 + indra/newview/llinventorypanel.cpp | 1 + .../skins/default/xui/en/menu_conversation.xml | 109 ++++++++++++ 7 files changed, 367 insertions(+), 3 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/menu_conversation.xml (limited to 'indra/newview') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 7d0ffa0788..1c4c7aefae 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -28,6 +28,7 @@ #include "llviewerprecompiledheaders.h" #include "llconversationmodel.h" +#include "llmenugl.h" // // Conversation items : common behaviors @@ -84,6 +85,24 @@ void LLConversationItem::showProperties(void) { } +void LLConversationItem::buildParticipantMenuOptions(menuentry_vec_t& items) +{ + items.push_back(std::string("view_profile")); + items.push_back(std::string("im")); + items.push_back(std::string("offer_teleport")); + items.push_back(std::string("voice_call")); + items.push_back(std::string("chat_history")); + items.push_back(std::string("separator_chat_history")); + items.push_back(std::string("add_friend")); + items.push_back(std::string("remove_friend")); + items.push_back(std::string("invite_to_group")); + items.push_back(std::string("separator_invite_to_group")); + items.push_back(std::string("map")); + items.push_back(std::string("share")); + items.push_back(std::string("pay")); + items.push_back(std::string("block_unblock")); +} + // // LLConversationItemSession // @@ -191,6 +210,22 @@ void LLConversationItemSession::setDistance(const LLUUID& participant_id, F64 di } } +void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + lldebugs << "LLConversationItemParticipant::buildContextMenu()" << llendl; + menuentry_vec_t items; + menuentry_vec_t disabled_items; + + if(this->getType() == CONV_SESSION_1_ON_1) + { + items.push_back(std::string("close_conversation")); + items.push_back(std::string("separator_disconnect_from_voice")); + buildParticipantMenuOptions(items); + } + + hide_context_entries(menu, items, disabled_items); +} + // The time of activity of a session is the time of the most recent activity, session and participants included const bool LLConversationItemSession::getTime(F64& time) const { @@ -249,6 +284,15 @@ LLConversationItemParticipant::LLConversationItemParticipant(const LLUUID& uuid, mConvType = CONV_PARTICIPANT; } +void LLConversationItemParticipant::buildContextMenu(LLMenuGL& menu, U32 flags) +{ + menuentry_vec_t items; + menuentry_vec_t disabled_items; + + buildParticipantMenuOptions(items); + hide_context_entries(menu, items, disabled_items); +} + void LLConversationItemParticipant::onAvatarNameCache(const LLAvatarName& av_name) { mName = av_name.mUsername; diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 30f94d51ae..43fa66e8e2 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -41,6 +41,8 @@ class LLConversationItemParticipant; typedef std::map conversations_items_map; typedef std::map conversations_widgets_map; +typedef std::vector menuentry_vec_t; + // Conversation items: we hold a list of those and create an LLFolderViewItem widget for each // that we tuck into the mConversationsListPanel. class LLConversationItem : public LLFolderViewModelItemCommon @@ -124,6 +126,8 @@ public: void resetRefresh() { mNeedsRefresh = false; } bool needsRefresh() { return mNeedsRefresh; } + void buildParticipantMenuOptions(menuentry_vec_t& items); + protected: std::string mName; // Name of the session or the participant LLUUID mUUID; // UUID of the session or the participant @@ -155,6 +159,7 @@ public: bool isLoaded() { return mIsLoaded; } + void buildContextMenu(LLMenuGL& menu, U32 flags); virtual const bool getTime(F64& time) const; void dumpDebugData(); @@ -178,7 +183,8 @@ public: void setIsModerator(bool is_moderator) { mIsModerator = is_moderator; mNeedsRefresh = true; } void setTimeNow() { mLastActiveTime = LLFrameTimer::getElapsedSeconds(); mNeedsRefresh = true; } void setDistance(F64 dist) { mDistToAgent = dist; mNeedsRefresh = true; } - + + void buildContextMenu(LLMenuGL& menu, U32 flags); void onAvatarNameCache(const LLAvatarName& av_name); virtual const bool getDistanceToAgent(F64& dist) const { dist = mDistToAgent; return (dist >= 0.0); } @@ -273,4 +279,14 @@ public: private: }; +// Utility function to hide all entries except those in the list +// Can be called multiple times on the same menu (e.g. if multiple items +// are selected). If "append" is false, then only common enabled items +// are set as enabled. + +//(defined in inventorybridge.cpp) +void hide_context_entries(LLMenuGL& menu, + const menuentry_vec_t &entries_to_show, + const menuentry_vec_t &disabled_entries); + #endif // LL_LLCONVERSATIONMODEL_H diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index e4a67a3d56..fbaf009939 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -128,6 +128,7 @@ public: static void onIMChicletCreated(const LLUUID& session_id); bool getStartConferenceInSameFloater() const { return mStartConferenceInSameFloater; } + LLUUID getOtherParticipantUUID() {return mOtherParticipantUUID;} static boost::signals2::connection setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb); static floater_showed_signal_t sIMFloaterShowedSignal; diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 14d40d4685..b4802c71f9 100755 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -58,8 +58,12 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) mConversationsRoot(NULL), mInitialized(false) { + mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLIMFloaterContainer::isActionChecked, this, _2)); mCommitCallbackRegistrar.add("IMFloaterContainer.Action", boost::bind(&LLIMFloaterContainer::onCustomAction, this, _2)); - mEnableCallbackRegistrar.add("IMFloaterContainer.Check", boost::bind(&LLIMFloaterContainer::isActionChecked, this, _2)); + + mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLIMFloaterContainer::checkContextMenuItem, this, _2)); + mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLIMFloaterContainer::enableContextMenuItem, this, _2)); + mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLIMFloaterContainer::doToSelected, this, _2)); // Firstly add our self to IMSession observers, so we catch session events LLIMMgr::getInstance()->addSessionObserver(this); @@ -133,7 +137,9 @@ BOOL LLIMFloaterContainer::postBuild() p.listener = base_item; p.view_model = &mConversationViewModel; p.root = NULL; + p.options_menu = "menu_conversation.xml"; mConversationsRoot = LLUICtrlFactory::create(p); + mConversationsRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); // a scroller for folder view LLRect scroller_view_rect = mConversationsListPanel->getRect(); @@ -341,7 +347,7 @@ void LLIMFloaterContainer::idle(void* user_data) { self->setNearbyDistances(); } - + self->mConversationsRoot->update(); } @@ -661,6 +667,188 @@ void LLIMFloaterContainer::setSortOrder(const LLConversationSort& order) gSavedSettings.setU32("ConversationSortOrder", (U32)order); } +void LLIMFloaterContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids) +{ + const std::set selectedItems = mConversationsRoot->getSelectionList(); + + std::set::const_iterator it = selectedItems.begin(); + const std::set::const_iterator it_end = selectedItems.end(); + LLConversationItem * conversationItem; + + for (; it != it_end; ++it) + { + conversationItem = static_cast((*it)->getViewModelItem()); + selected_uuids.push_back(conversationItem->getUUID()); + } +} +void LLIMFloaterContainer::doToSelected(const LLSD& userdata) +{ + std::string command = userdata.asString(); + uuid_vec_t selected_uuids; + LLUUID currentSelectedUUID; + LLIMFloater * conversation; + + getSelectedUUIDs(selected_uuids); + conversation = LLIMFloater::findInstance(selected_uuids.front()); + + if(conversation && + static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem())->getType() == LLConversationItem::CONV_SESSION_1_ON_1) + { + currentSelectedUUID = conversation->getOtherParticipantUUID(); + } + else + { + currentSelectedUUID = selected_uuids.front(); + } + + //Close the selected conversation + if(conversation && "close_conversation" == command) + { + LLFloater::onClickClose(conversation); + } + else if ("view_profile" == command) + { + LLAvatarActions::showProfile(currentSelectedUUID); + } + else if("im" == command) + { + LLAvatarActions::startIM(currentSelectedUUID); + } + else if("offer_teleport" == command) + { + LLAvatarActions::offerTeleport(selected_uuids); + } + else if("voice_call" == command) + { + LLAvatarActions::startCall(currentSelectedUUID); + } + else if("add_friend" == command) + { + LLAvatarActions::requestFriendshipDialog(currentSelectedUUID); + } + else if("remove_friend" == command) + { + LLAvatarActions::removeFriendDialog(currentSelectedUUID); + } + else if("invite_to_group" == command) + { + LLAvatarActions::inviteToGroup(currentSelectedUUID); + } + else if("map" == command) + { + LLAvatarActions::showOnMap(currentSelectedUUID); + } + else if("share" == command) + { + LLAvatarActions::share(currentSelectedUUID); + } + else if("pay" == command) + { + LLAvatarActions::pay(currentSelectedUUID); + } + else if("block_unblock" == command) + { + LLAvatarActions::toggleBlock(currentSelectedUUID); + } +} + +bool LLIMFloaterContainer::enableContextMenuItem(const LLSD& userdata) +{ + std::string item = userdata.asString(); + uuid_vec_t mUUIDs; + getSelectedUUIDs(mUUIDs); + + // Note: can_block and can_delete is used only for one person selected menu + // so we don't need to go over all uuids. + + if (item == std::string("can_block")) + { + const LLUUID& id = mUUIDs.front(); + return LLAvatarActions::canBlock(id); + } + else if (item == std::string("can_add")) + { + // We can add friends if: + // - there are selected people + // - and there are no friends among selection yet. + + //EXT-7389 - disable for more than 1 + if(mUUIDs.size() > 1) + { + return false; + } + + bool result = (mUUIDs.size() > 0); + + uuid_vec_t::const_iterator + id = mUUIDs.begin(), + uuids_end = mUUIDs.end(); + + for (;id != uuids_end; ++id) + { + if ( LLAvatarActions::isFriend(*id) ) + { + result = false; + break; + } + } + + return result; + } + else if (item == std::string("can_delete")) + { + // We can remove friends if: + // - there are selected people + // - and there are only friends among selection. + + bool result = (mUUIDs.size() > 0); + + uuid_vec_t::const_iterator + id = mUUIDs.begin(), + uuids_end = mUUIDs.end(); + + for (;id != uuids_end; ++id) + { + if ( !LLAvatarActions::isFriend(*id) ) + { + result = false; + break; + } + } + + return result; + } + else if (item == std::string("can_call")) + { + return LLAvatarActions::canCall(); + } + else if (item == std::string("can_show_on_map")) + { + const LLUUID& id = mUUIDs.front(); + + return (LLAvatarTracker::instance().isBuddyOnline(id) && is_agent_mappable(id)) + || gAgent.isGodlike(); + } + else if(item == std::string("can_offer_teleport")) + { + return LLAvatarActions::canOfferTeleport(mUUIDs); + } + return false; +} + +bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata) +{ + std::string item = userdata.asString(); + const LLUUID& id = static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem())->getUUID(); + + if (item == std::string("is_blocked")) + { + return LLAvatarActions::isBlocked(id); + } + + return false; +} + void LLIMFloaterContainer::repositioningWidgets() { if (!mInitialized) diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index e8d185297c..cc2d0ce6ab 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -111,6 +111,11 @@ private: void setSortOrderParticipants(const LLConversationFilter::ESortOrderType order); void setSortOrder(const LLConversationSort& order); + void getSelectedUUIDs(uuid_vec_t& selected_uuids); + void doToSelected(const LLSD& userdata); + bool checkContextMenuItem(const LLSD& userdata); + bool enableContextMenuItem(const LLSD& userdata); + LLButton* mExpandCollapseBtn; LLLayoutPanel* mMessagesPane; LLLayoutPanel* mConversationsPane; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 2a84616ddf..6e692adf2a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -172,6 +172,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) p.show_empty_message = mShowEmptyMessage; p.show_item_link_overlays = mShowItemLinkOverlays; p.root = NULL; + p.options_menu = "menu_inventory.xml"; return LLUICtrlFactory::create(p); } diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml new file mode 100644 index 0000000000..94399be61c --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 8e1a9e2813da6b9d5c17795b375098fb6a386ee1 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 1 Oct 2012 13:54:53 -0700 Subject: CHUI-102: Cleaned up code after code review. --- indra/newview/llconversationmodel.cpp | 1 - indra/newview/llconversationmodel.h | 1 + indra/newview/llimfloater.h | 2 +- indra/newview/llimfloatercontainer.cpp | 9 ++++++++- 4 files changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 1c4c7aefae..f587ef8428 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -28,7 +28,6 @@ #include "llviewerprecompiledheaders.h" #include "llconversationmodel.h" -#include "llmenugl.h" // // Conversation items : common behaviors diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 43fa66e8e2..f84fbe39f1 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -285,6 +285,7 @@ private: // are set as enabled. //(defined in inventorybridge.cpp) +//TODO: Gilbert Linden - Refactor to make this function non-global void hide_context_entries(LLMenuGL& menu, const menuentry_vec_t &entries_to_show, const menuentry_vec_t &disabled_entries); diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index fbaf009939..489e430b26 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -128,7 +128,7 @@ public: static void onIMChicletCreated(const LLUUID& session_id); bool getStartConferenceInSameFloater() const { return mStartConferenceInSameFloater; } - LLUUID getOtherParticipantUUID() {return mOtherParticipantUUID;} + const LLUUID& getOtherParticipantUUID() {return mOtherParticipantUUID;} static boost::signals2::connection setIMFloaterShowedCallback(const floater_showed_signal_t::slot_type& cb); static floater_showed_signal_t sIMFloaterShowedSignal; diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index b4802c71f9..58d2020801 100755 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -689,13 +689,20 @@ void LLIMFloaterContainer::doToSelected(const LLSD& userdata) LLIMFloater * conversation; getSelectedUUIDs(selected_uuids); + //Find the conversation floater associated with the selected id conversation = LLIMFloater::findInstance(selected_uuids.front()); - + + //When a one-on-one conversation exists, retrieve the participant id from the conversation floater b/c + //selected_uuids.front() does not pertain to the UUID of the person you are having the conversation with. if(conversation && + mConversationsRoot && + mConversationsRoot->getCurSelectedItem() && + mConversationsRoot->getCurSelectedItem()->getViewModelItem() && static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem())->getType() == LLConversationItem::CONV_SESSION_1_ON_1) { currentSelectedUUID = conversation->getOtherParticipantUUID(); } + //Otherwise can get the UUID directly from selected_uuids else { currentSelectedUUID = selected_uuids.front(); -- cgit v1.2.3 From 598f5345866c58abdd971935d80f9b53756042c9 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Mon, 1 Oct 2012 17:04:13 -0700 Subject: CHUI-102: Right clicking on a group conversation brings up the correct menu. The user can now view the group profile, activate the group and leave the group. --- indra/newview/llconversationmodel.cpp | 8 ++++ indra/newview/llimfloatercontainer.cpp | 48 ++++++++++++++++++---- indra/newview/llimfloatercontainer.h | 4 +- .../skins/default/xui/en/menu_conversation.xml | 18 ++++++++ 4 files changed, 69 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 265f77365f..3d1523c874 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -221,6 +221,14 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("separator_disconnect_from_voice")); buildParticipantMenuOptions(items); } + else if(this->getType() == CONV_SESSION_GROUP) + { + items.push_back(std::string("close_conversation")); + items.push_back(std::string("separator_disconnect_from_voice")); + items.push_back(std::string("group_profile")); + items.push_back(std::string("activate_group")); + items.push_back(std::string("leave_group")); + } hide_context_entries(menu, items, disabled_items); } diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index d25a195f33..b7f83e3c23 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -39,6 +39,7 @@ #include "llavatariconctrl.h" #include "llavatarnamecache.h" #include "llcallbacklist.h" +#include "llgroupactions.h" #include "llgroupiconctrl.h" #include "llfloateravatarpicker.h" #include "llfloaterpreference.h" @@ -63,7 +64,9 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLIMFloaterContainer::checkContextMenuItem, this, _2)); mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLIMFloaterContainer::enableContextMenuItem, this, _2)); - mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLIMFloaterContainer::doToSelected, this, _2)); + mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLIMFloaterContainer::doToSelectedAvatar, this, _2)); + + mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&LLIMFloaterContainer::doToSelectedGroup, this, _2)); // Firstly add our self to IMSession observers, so we catch session events LLIMMgr::getInstance()->addSessionObserver(this); @@ -731,7 +734,20 @@ void LLIMFloaterContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids) selected_uuids.push_back(conversationItem->getUUID()); } } -void LLIMFloaterContainer::doToSelected(const LLSD& userdata) + +const LLConversationItem * LLIMFloaterContainer::getCurSelectedViewModelItem() +{ + if(mConversationsRoot && + mConversationsRoot->getCurSelectedItem() && + mConversationsRoot->getCurSelectedItem()->getViewModelItem()) + { + return static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem()); + } + + return NULL; +} + +void LLIMFloaterContainer::doToSelectedAvatar(const LLSD& userdata) { std::string command = userdata.asString(); uuid_vec_t selected_uuids; @@ -741,14 +757,11 @@ void LLIMFloaterContainer::doToSelected(const LLSD& userdata) getSelectedUUIDs(selected_uuids); //Find the conversation floater associated with the selected id conversation = LLIMFloater::findInstance(selected_uuids.front()); + const LLConversationItem * conversationItem = getCurSelectedViewModelItem(); //When a one-on-one conversation exists, retrieve the participant id from the conversation floater b/c //selected_uuids.front() does not pertain to the UUID of the person you are having the conversation with. - if(conversation && - mConversationsRoot && - mConversationsRoot->getCurSelectedItem() && - mConversationsRoot->getCurSelectedItem()->getViewModelItem() && - static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem())->getType() == LLConversationItem::CONV_SESSION_1_ON_1) + if(conversation && conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1) { currentSelectedUUID = conversation->getOtherParticipantUUID(); } @@ -809,6 +822,25 @@ void LLIMFloaterContainer::doToSelected(const LLSD& userdata) } } +void LLIMFloaterContainer::doToSelectedGroup(const LLSD& userdata) +{ + std::string action = userdata.asString(); + LLUUID selected_group = getCurSelectedViewModelItem()->getUUID(); + + if (action == "group_profile") + { + LLGroupActions::show(selected_group); + } + else if (action == "activate_group") + { + LLGroupActions::activate(selected_group); + } + else if (action == "leave_group") + { + LLGroupActions::leave(selected_group); + } +} + bool LLIMFloaterContainer::enableContextMenuItem(const LLSD& userdata) { std::string item = userdata.asString(); @@ -896,7 +928,7 @@ bool LLIMFloaterContainer::enableContextMenuItem(const LLSD& userdata) bool LLIMFloaterContainer::checkContextMenuItem(const LLSD& userdata) { std::string item = userdata.asString(); - const LLUUID& id = static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem())->getUUID(); + const LLUUID& id = getCurSelectedViewModelItem()->getUUID(); if (item == std::string("is_blocked")) { diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 49a41e5cdd..9754f04fbe 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -112,7 +112,9 @@ private: void setSortOrder(const LLConversationSort& order); void getSelectedUUIDs(uuid_vec_t& selected_uuids); - void doToSelected(const LLSD& userdata); + const LLConversationItem * getCurSelectedViewModelItem(); + void doToSelectedAvatar(const LLSD& userdata); + void doToSelectedGroup(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata); bool enableContextMenuItem(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 94399be61c..bf834ee9ff 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -25,6 +25,24 @@ + + + + + + + + + Date: Tue, 2 Oct 2012 11:09:58 -0700 Subject: CHUI-102: Code cleanup, decoupling code and made specific methods for handling menu events for conversations or participants. --- indra/newview/llimfloatercontainer.cpp | 113 +++++++++++++++++++++------------ indra/newview/llimfloatercontainer.h | 5 +- 2 files changed, 76 insertions(+), 42 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index b7f83e3c23..ad77a7510c 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -64,7 +64,7 @@ LLIMFloaterContainer::LLIMFloaterContainer(const LLSD& seed) mEnableCallbackRegistrar.add("Avatar.CheckItem", boost::bind(&LLIMFloaterContainer::checkContextMenuItem, this, _2)); mEnableCallbackRegistrar.add("Avatar.EnableItem", boost::bind(&LLIMFloaterContainer::enableContextMenuItem, this, _2)); - mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLIMFloaterContainer::doToSelectedAvatar, this, _2)); + mCommitCallbackRegistrar.add("Avatar.DoToSelected", boost::bind(&LLIMFloaterContainer::doToSelected, this, _2)); mCommitCallbackRegistrar.add("Group.DoToSelected", boost::bind(&LLIMFloaterContainer::doToSelectedGroup, this, _2)); @@ -747,78 +747,109 @@ const LLConversationItem * LLIMFloaterContainer::getCurSelectedViewModelItem() return NULL; } -void LLIMFloaterContainer::doToSelectedAvatar(const LLSD& userdata) -{ - std::string command = userdata.asString(); - uuid_vec_t selected_uuids; - LLUUID currentSelectedUUID; - LLIMFloater * conversation; - - getSelectedUUIDs(selected_uuids); - //Find the conversation floater associated with the selected id - conversation = LLIMFloater::findInstance(selected_uuids.front()); - const LLConversationItem * conversationItem = getCurSelectedViewModelItem(); - - //When a one-on-one conversation exists, retrieve the participant id from the conversation floater b/c - //selected_uuids.front() does not pertain to the UUID of the person you are having the conversation with. - if(conversation && conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1) - { - currentSelectedUUID = conversation->getOtherParticipantUUID(); - } - //Otherwise can get the UUID directly from selected_uuids - else - { - currentSelectedUUID = selected_uuids.front(); - } +void LLIMFloaterContainer::doToUsers(const std::string& command, uuid_vec_t selectedIDS) +{dd + LLUUID userID; + userID = selectedIDS.front(); - //Close the selected conversation - if(conversation && "close_conversation" == command) - { - LLFloater::onClickClose(conversation); - } - else if ("view_profile" == command) + if ("view_profile" == command) { - LLAvatarActions::showProfile(currentSelectedUUID); + LLAvatarActions::showProfile(userID); } else if("im" == command) { - LLAvatarActions::startIM(currentSelectedUUID); + LLAvatarActions::startIM(userID); } else if("offer_teleport" == command) { - LLAvatarActions::offerTeleport(selected_uuids); + LLAvatarActions::offerTeleport(selectedIDS); } else if("voice_call" == command) { - LLAvatarActions::startCall(currentSelectedUUID); + LLAvatarActions::startCall(userID); } else if("add_friend" == command) { - LLAvatarActions::requestFriendshipDialog(currentSelectedUUID); + LLAvatarActions::requestFriendshipDialog(userID); } else if("remove_friend" == command) { - LLAvatarActions::removeFriendDialog(currentSelectedUUID); + LLAvatarActions::removeFriendDialog(userID); } else if("invite_to_group" == command) { - LLAvatarActions::inviteToGroup(currentSelectedUUID); + LLAvatarActions::inviteToGroup(userID); } else if("map" == command) { - LLAvatarActions::showOnMap(currentSelectedUUID); + LLAvatarActions::showOnMap(userID); } else if("share" == command) { - LLAvatarActions::share(currentSelectedUUID); + LLAvatarActions::share(userID); } else if("pay" == command) { - LLAvatarActions::pay(currentSelectedUUID); + LLAvatarActions::pay(userID); } else if("block_unblock" == command) { - LLAvatarActions::toggleBlock(currentSelectedUUID); + LLAvatarActions::toggleBlock(userID); + } +} + +void LLIMFloaterContainer::doToSelectedParticipant(const std::string& command) +{ + uuid_vec_t selected_uuids; + getSelectedUUIDs(selected_uuids); + + doToUsers(command, selected_uuids); +} + +void LLIMFloaterContainer::doToSelectedConversation(const std::string& command) +{ + LLUUID participantID; + + //Find the conversation floater associated with the selected id + const LLConversationItem * conversationItem = getCurSelectedViewModelItem(); + LLIMFloater *conversationFloater = LLIMFloater::findInstance(conversationItem->getUUID()); + + if(conversationFloater) + { + //When a one-on-one conversation exists, retrieve the participant id from the conversation floater b/c + //selected_uuids.front() does not pertain to the UUID of the person you are having the conversation with. + if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1) + { + participantID = conversationFloater->getOtherParticipantUUID(); + } + + //Close the selected conversation + if("close_conversation" == command) + { + LLFloater::onClickClose(conversationFloater); + } + else + { + uuid_vec_t selected_uuids; + selected_uuids.push_back(participantID); + doToUsers(command, selected_uuids); + } + } +} + +void LLIMFloaterContainer::doToSelected(const LLSD& userdata) +{ + std::string command = userdata.asString(); + const LLConversationItem * conversationItem = getCurSelectedViewModelItem(); + + if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1 || + conversationItem->getType() == LLConversationItem::CONV_SESSION_GROUP) + { + doToSelectedConversation(command); + } + else + { + doToSelectedParticipant(command); } } diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 9754f04fbe..a622ddfc8c 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -113,7 +113,10 @@ private: void getSelectedUUIDs(uuid_vec_t& selected_uuids); const LLConversationItem * getCurSelectedViewModelItem(); - void doToSelectedAvatar(const LLSD& userdata); + void doToSelected(const LLSD& userdata); + void doToSelectedConversation(const std::string& command); + void doToSelectedParticipant(const std::string& command); + void doToUsers(const std::string& command, uuid_vec_t selectedIDS); void doToSelectedGroup(const LLSD& userdata); bool checkContextMenuItem(const LLSD& userdata); bool enableContextMenuItem(const LLSD& userdata); -- cgit v1.2.3 From 7ba6111d9149baea48869c2f30506581d2c6babf Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Tue, 2 Oct 2012 21:32:23 +0300 Subject: CHUI-190 (Remove the Voice Settings floater): removed the menu item "Communicate > Voice settings" and the FUI button (headphones) from the Toybox (Toolbox). I left a floater in the project to be able to reconnect it to a different location. --- indra/newview/app_settings/commands.xml | 10 ---------- indra/newview/skins/default/xui/en/menu_viewer.xml | 10 ---------- 2 files changed, 20 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index 51211a8ce5..d4bbd84d0f 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -239,14 +239,4 @@ is_running_function="Floater.IsOpen" is_running_parameters="camera" /> - diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index aa131035ed..4bbf253e4a 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -243,16 +243,6 @@ function="Agent.ToggleMicrophone" parameter="speak" /> - - - - Date: Tue, 2 Oct 2012 15:10:12 -0700 Subject: CHUI-102: Now the user can select a conversation and use the right-click-menu to enable/disable voice. --- indra/newview/llconversationmodel.cpp | 21 +++++++++++++++++++++ indra/newview/llconversationmodel.h | 1 + indra/newview/llimfloatercontainer.cpp | 13 +++++++++++-- 3 files changed, 33 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 3d1523c874..a3ec154ac6 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -28,6 +28,7 @@ #include "llviewerprecompiledheaders.h" #include "llconversationmodel.h" +#include "llimview.h" //For LLIMModel // // Conversation items : common behaviors @@ -224,15 +225,35 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) else if(this->getType() == CONV_SESSION_GROUP) { items.push_back(std::string("close_conversation")); + addVoiceOptions(items); items.push_back(std::string("separator_disconnect_from_voice")); items.push_back(std::string("group_profile")); items.push_back(std::string("activate_group")); items.push_back(std::string("leave_group")); } + else if(this->getType() == CONV_SESSION_AD_HOC) + { + items.push_back(std::string("close_conversation")); + addVoiceOptions(items); + } hide_context_entries(menu, items, disabled_items); } +void LLConversationItemSession::addVoiceOptions(menuentry_vec_t& items) +{ + LLVoiceChannel* voice_channel = LLIMModel::getInstance() ? LLIMModel::getInstance()->getVoiceChannel(this->getUUID()) : NULL; + + if(voice_channel != LLVoiceChannel::getCurrentVoiceChannel()) + { + items.push_back(std::string("open_voice_conversation")); + } + else + { + items.push_back(std::string("disconnect_from_voice")); + } +} + // The time of activity of a session is the time of the most recent activity, session and participants included const bool LLConversationItemSession::getTime(F64& time) const { diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index f84fbe39f1..bc72cd96ea 100755 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -160,6 +160,7 @@ public: bool isLoaded() { return mIsLoaded; } void buildContextMenu(LLMenuGL& menu, U32 flags); + void addVoiceOptions(menuentry_vec_t& items); virtual const bool getTime(F64& time) const; void dumpDebugData(); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index ad77a7510c..7130926212 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -748,7 +748,7 @@ const LLConversationItem * LLIMFloaterContainer::getCurSelectedViewModelItem() } void LLIMFloaterContainer::doToUsers(const std::string& command, uuid_vec_t selectedIDS) -{dd +{ LLUUID userID; userID = selectedIDS.front(); @@ -828,6 +828,14 @@ void LLIMFloaterContainer::doToSelectedConversation(const std::string& command) { LLFloater::onClickClose(conversationFloater); } + else if("open_voice_conversation" == command) + { + gIMMgr->startCall(conversationItem->getUUID()); + } + else if("disconnect_from_voice" == command) + { + gIMMgr->endCall(conversationItem->getUUID()); + } else { uuid_vec_t selected_uuids; @@ -843,7 +851,8 @@ void LLIMFloaterContainer::doToSelected(const LLSD& userdata) const LLConversationItem * conversationItem = getCurSelectedViewModelItem(); if(conversationItem->getType() == LLConversationItem::CONV_SESSION_1_ON_1 || - conversationItem->getType() == LLConversationItem::CONV_SESSION_GROUP) + conversationItem->getType() == LLConversationItem::CONV_SESSION_GROUP || + conversationItem->getType() == LLConversationItem::CONV_SESSION_AD_HOC) { doToSelectedConversation(command); } -- cgit v1.2.3 From ed9ade7d50b699ac60eb69a979ea32a60eefa630 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 2 Oct 2012 17:03:46 -0700 Subject: CHUI-102: Now the options menu (right-click menu) for a participant/conversation will open the 'Chat history' dialog when selected. --- indra/newview/llconversationmodel.cpp | 4 ++- indra/newview/llimfloatercontainer.cpp | 8 +++++ .../skins/default/xui/en/menu_conversation.xml | 36 +++++++++++----------- 3 files changed, 29 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index a3ec154ac6..5fc305da81 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -226,7 +226,8 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("close_conversation")); addVoiceOptions(items); - items.push_back(std::string("separator_disconnect_from_voice")); + items.push_back(std::string("chat_history")); + items.push_back(std::string("separator_chat_history")); items.push_back(std::string("group_profile")); items.push_back(std::string("activate_group")); items.push_back(std::string("leave_group")); @@ -235,6 +236,7 @@ void LLConversationItemSession::buildContextMenu(LLMenuGL& menu, U32 flags) { items.push_back(std::string("close_conversation")); addVoiceOptions(items); + items.push_back(std::string("chat_history")); } hide_context_entries(menu, items, disabled_items); diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 7130926212..11aecde6e2 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -768,6 +768,10 @@ void LLIMFloaterContainer::doToUsers(const std::string& command, uuid_vec_t sele { LLAvatarActions::startCall(userID); } + else if("chat_history" == command) + { + LLAvatarActions::viewChatHistory(userID); + } else if("add_friend" == command) { LLAvatarActions::requestFriendshipDialog(userID); @@ -836,6 +840,10 @@ void LLIMFloaterContainer::doToSelectedConversation(const std::string& command) { gIMMgr->endCall(conversationItem->getUUID()); } + else if("chat_history" == command) + { + LLAvatarActions::viewChatHistory(conversationItem->getUUID()); + } else { uuid_vec_t selected_uuids; diff --git a/indra/newview/skins/default/xui/en/menu_conversation.xml b/indra/newview/skins/default/xui/en/menu_conversation.xml index bf834ee9ff..912ff811d9 100644 --- a/indra/newview/skins/default/xui/en/menu_conversation.xml +++ b/indra/newview/skins/default/xui/en/menu_conversation.xml @@ -25,24 +25,6 @@ - - - - - - - - - + + + + + + + + + -- cgit v1.2.3 From 7e1fbd1a897e3238a101f1db2d155f0493beaac5 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 2 Oct 2012 17:56:01 -0700 Subject: CHUI-102: Code review, just changed function getCurSelectedViewModelItem() to have a single return statement. --- indra/newview/llimfloatercontainer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index 11aecde6e2..a33fc2c57e 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -737,14 +737,16 @@ void LLIMFloaterContainer::getSelectedUUIDs(uuid_vec_t& selected_uuids) const LLConversationItem * LLIMFloaterContainer::getCurSelectedViewModelItem() { + LLConversationItem * conversationItem = NULL; + if(mConversationsRoot && mConversationsRoot->getCurSelectedItem() && mConversationsRoot->getCurSelectedItem()->getViewModelItem()) { - return static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem()); + conversationItem = static_cast(mConversationsRoot->getCurSelectedItem()->getViewModelItem()); } - return NULL; + return conversationItem; } void LLIMFloaterContainer::doToUsers(const std::string& command, uuid_vec_t selectedIDS) -- cgit v1.2.3 From a8159facdeb478abf094d8ba8ad229c0e282f9f6 Mon Sep 17 00:00:00 2001 From: AlexanderP ProductEngine Date: Tue, 2 Oct 2012 19:36:46 +0300 Subject: CHUI-374 FIXED (Nearby chat is torn off and cannot be docked if nearby chat is received while conversation floater is closed) Nearby_chat is created only after the creation of the im_container --- indra/newview/llimfloater.cpp | 28 +++++++++++++++------------- indra/newview/llimfloatercontainer.cpp | 11 ++++++++--- indra/newview/llnearbychat.cpp | 16 +++++++++++++++- indra/newview/llnearbychat.h | 5 +++++ indra/newview/llnearbychathandler.cpp | 1 + indra/newview/llviewerfloaterreg.cpp | 2 +- 6 files changed, 45 insertions(+), 18 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index d11504d312..99337bd5f3 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -111,23 +111,25 @@ void LLIMFloater::onClickCloseBtn() { LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(mSessionID); - if (session == NULL) + if (session != NULL) { - llwarns << "Empty session with id: " << (mSessionID.asString()) << llendl; - return; - } + bool is_call_with_chat = session->isGroupSessionType() + || session->isAdHocSessionType() || session->isP2PSessionType(); - bool is_call_with_chat = session->isGroupSessionType() - || session->isAdHocSessionType() || session->isP2PSessionType(); + LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); - LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); - - if (is_call_with_chat && voice_channel != NULL - && voice_channel->isActive()) + if (is_call_with_chat && voice_channel != NULL + && voice_channel->isActive()) + { + LLSD payload; + payload["session_id"] = mSessionID; + LLNotificationsUtil::add("ConfirmLeaveCall", LLSD(), payload, confirmLeaveCallCallback); + return; + } + } + else { - LLSD payload; - payload["session_id"] = mSessionID; - LLNotificationsUtil::add("ConfirmLeaveCall", LLSD(), payload, confirmLeaveCallCallback); + llwarns << "Empty session with id: " << (mSessionID.asString()) << llendl; return; } diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index a33fc2c57e..237748179c 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -463,21 +463,26 @@ void LLIMFloaterContainer::tabClose() } void LLIMFloaterContainer::setVisible(BOOL visible) -{ +{ LLNearbyChat* nearby_chat; if (visible) { // Make sure we have the Nearby Chat present when showing the conversation container - LLIMConversation* nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); + nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); if (nearby_chat == NULL) { // If not found, force the creation of the nearby chat conversation panel // *TODO: find a way to move this to XML as a default panel or something like that LLSD name("nearby_chat"); LLFloaterReg::toggleInstanceOrBringToFront(name); - LLFloaterReg::getTypedInstance("nearby_chat")->addToHost(); } } + nearby_chat = LLFloaterReg::findTypedInstance("nearby_chat"); + if (nearby_chat && !nearby_chat->isHostSet()) + { + nearby_chat->addToHost(); + } + // We need to show/hide all the associated conversations that have been torn off // (and therefore, are not longer managed by the multifloater), // so that they show/hide with the conversations manager. diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 4b35092f2d..b96b486868 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -91,7 +91,8 @@ LLNearbyChat::LLNearbyChat(const LLSD& llsd) : LLIMConversation(llsd), //mOutputMonitor(NULL), mSpeakerMgr(NULL), - mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT) + mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT), + mIsHostSet(false) { mIsP2PChat = false; mIsNearbyChat = true; @@ -100,6 +101,12 @@ LLNearbyChat::LLNearbyChat(const LLSD& llsd) mSessionID = LLUUID(); } +//static +LLNearbyChat* LLNearbyChat::buildFloater(const LLSD& key) +{ + LLFloaterReg::getInstance("im_container"); + return new LLNearbyChat(key); +} //virtual BOOL LLNearbyChat::postBuild() @@ -304,9 +311,16 @@ void LLNearbyChat::addToHost() setHost(NULL); } } + + mIsHostSet = true; } } +bool LLNearbyChat::isHostSet() +{ + return mIsHostSet; +} + // virtual void LLNearbyChat::onOpen(const LLSD& key) { diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 3987212e4c..93168ba96a 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -48,6 +48,8 @@ public: LLNearbyChat(const LLSD& key = LLSD(LLUUID())); ~LLNearbyChat() {} + static LLNearbyChat* buildFloater(const LLSD& key); + /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); @@ -76,6 +78,8 @@ public: static void startChat(const char* line); static void stopChat(); + bool isHostSet(); + static void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate); static void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate); @@ -117,6 +121,7 @@ private: LLHandle mPopupMenuHandle; std::vector mMessageArchive; + bool mIsHostSet; }; #endif diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index f3e17ea61b..7834f6d320 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -487,6 +487,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, if(chat_msg.mText.empty()) return;//don't process empty messages + LLFloaterReg::getInstance("im_container"); LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance("nearby_chat"); // Build notification data diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 4cd5ecc754..c751550523 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -194,7 +194,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("chat_voice", "floater_voice_chat_volume.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("nearby_chat", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("nearby_chat", "floater_im_session.xml", (LLFloaterBuildFunc)&LLNearbyChat::buildFloater); LLFloaterReg::add("compile_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("conversation", "floater_conversation_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); -- cgit v1.2.3 From 2c15f6eca629e65c9c87dc87e4da59718aada039 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 3 Oct 2012 13:30:17 +0300 Subject: CHUI-354 FIXED getIconOverlay() is added for LLItemBridge --- indra/newview/llinventorybridge.cpp | 9 +++++++++ indra/newview/llinventorybridge.h | 1 + 2 files changed, 10 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 72c54e5ce2..139713b96e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1531,6 +1531,15 @@ LLUIImagePtr LLItemBridge::getIcon() const return LLInventoryIcon::getIcon(LLInventoryIcon::ICONNAME_OBJECT); } +LLUIImagePtr LLItemBridge::getIconOverlay() const +{ + if (getItem() && getItem()->getIsLinkType()) + { + return LLUI::getUIImage("Inv_Link"); + } + return NULL; +} + PermissionMask LLItemBridge::getPermissionMask() const { LLViewerInventoryItem* item = getItem(); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 6beccf19ae..b33972167c 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -228,6 +228,7 @@ public: virtual BOOL isItemCopyable() const; virtual bool hasChildren() const { return FALSE; } virtual BOOL isUpToDate() const { return TRUE; } + virtual LLUIImagePtr getIconOverlay() const; LLViewerInventoryItem* getItem() const; -- cgit v1.2.3 From bb2f48cb93a142deed863287d009017177e6a0be Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 3 Oct 2012 13:55:09 +0300 Subject: CHUI-301 FIXED Tooltips for buttons are added --- indra/newview/skins/default/xui/en/floater_conversation_log.xml | 2 ++ .../newview/skins/default/xui/en/panel_conversation_log_list_item.xml | 3 +++ 2 files changed, 5 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/floater_conversation_log.xml b/indra/newview/skins/default/xui/en/floater_conversation_log.xml index 12d17e6b37..c9c52e5ce5 100644 --- a/indra/newview/skins/default/xui/en/floater_conversation_log.xml +++ b/indra/newview/skins/default/xui/en/floater_conversation_log.xml @@ -49,6 +49,7 @@ menu_filename="menu_conversation_log_view.xml" menu_position="bottomleft" name="conversation_view_btn" + tool_tip="View/sort options" top="3" width="31" /> diff --git a/indra/newview/skins/default/xui/en/panel_conversation_log_list_item.xml b/indra/newview/skins/default/xui/en/panel_conversation_log_list_item.xml index 8a58eb1ca6..78d4c174d2 100644 --- a/indra/newview/skins/default/xui/en/panel_conversation_log_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_conversation_log_list_item.xml @@ -35,6 +35,7 @@ image_name="Conv_toolbar_open_call" mouse_opaque="true" name="voice_session_icon" + tool_tip="Included a voice conversation" top="2" visible="false" width="20" /> @@ -46,6 +47,7 @@ image_name="Conv_log_inbox" mouse_opaque="false" name="unread_ims_icon" + tool_tip="Messages arrived while you were logged out" top="2" visible="false" width="20" /> @@ -92,6 +94,7 @@ width="110"/>