diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-25 10:12:54 -0800 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-25 10:12:54 -0800 |
commit | 6ff6ed4d1148a66b188472c94b58bd573389942d (patch) | |
tree | a4a6e2a4711c3d9a3dd019e98507a568cac4ba60 /indra/newview/llpanelpeople.cpp | |
parent | f11f8b34478f0d408689fe7959f233567001374d (diff) | |
parent | 254b7d72d17c279aa906ee235f08ff1fa9e2b9cf (diff) |
PE merge.
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index c14b282488..b01cdcc832 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -462,6 +462,9 @@ LLPanelPeople::~LLPanelPeople() delete mFriendListUpdater; delete mRecentListUpdater; + if(LLVoiceClient::getInstance()) + LLVoiceClient::getInstance()->removeObserver(this); + LLView::deleteViewByHandle(mGroupPlusMenuHandle); LLView::deleteViewByHandle(mNearbyViewSortMenuHandle); LLView::deleteViewByHandle(mFriendsViewSortMenuHandle); @@ -612,6 +615,8 @@ BOOL LLPanelPeople::postBuild() if(recent_view_sort) mRecentViewSortMenuHandle = recent_view_sort->getHandle(); + gVoiceClient->addObserver(this); + // call this method in case some list is empty and buttons can be in inconsistent state updateButtons(); @@ -621,6 +626,17 @@ BOOL LLPanelPeople::postBuild() return TRUE; } +// virtual +void LLPanelPeople::onChange(EStatusType status, const std::string &channelURI, bool proximal) +{ + if(status == STATUS_JOINING || status == STATUS_LEFT_CHANNEL) + { + return; + } + + updateButtons(); +} + void LLPanelPeople::updateFriendList() { if (!mOnlineFriendList || !mAllFriendList) @@ -775,41 +791,20 @@ void LLPanelPeople::updateButtons() } } + bool enable_calls = gVoiceClient->voiceWorking() && gVoiceClient->voiceEnabled(); + buttonSetEnabled("teleport_btn", friends_tab_active && item_selected && isFriendOnline(selected_uuids.front())); buttonSetEnabled("view_profile_btn", item_selected); buttonSetEnabled("im_btn", multiple_selected); // allow starting the friends conference for multiple selection - buttonSetEnabled("call_btn", multiple_selected && canCall()); + buttonSetEnabled("call_btn", multiple_selected && enable_calls); buttonSetEnabled("share_btn", item_selected); // not implemented yet bool none_group_selected = item_selected && selected_id.isNull(); buttonSetEnabled("group_info_btn", !none_group_selected); - buttonSetEnabled("group_call_btn", !none_group_selected); + buttonSetEnabled("group_call_btn", !none_group_selected && enable_calls); buttonSetEnabled("chat_btn", !none_group_selected); } -bool LLPanelPeople::canCall() -{ - std::vector<LLUUID> selected_uuids; - getCurrentItemIDs(selected_uuids); - - bool result = false; - - std::vector<LLUUID>::const_iterator - id = selected_uuids.begin(), - uuids_end = selected_uuids.end(); - - for (;id != uuids_end; ++id) - { - if (LLAvatarActions::canCall(*id)) - { - result = true; - break; - } - } - - return result; -} - std::string LLPanelPeople::getActiveTabName() const { return mTabContainer->getCurrentPanel()->getName(); |