summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpeople.cpp
diff options
context:
space:
mode:
authorLynx Linden <lynx@lindenlab.com>2009-11-10 00:10:44 +0000
committerLynx Linden <lynx@lindenlab.com>2009-11-10 00:10:44 +0000
commit17ab5928c2416b4787e03c54307add77217d831e (patch)
tree9c0822b483c55830993991b104106f02892e0077 /indra/newview/llpanelpeople.cpp
parent02062e099bca77ac3bc24b097c5d6f104022665d (diff)
DEV-41317 DEV-42311: Enabled the "Call" button in more side panels.
The various People panels now have Call buttons that work. Currently we only support single selection of users in lists for P2P voice chat. Multiple selection for ad-hoc chat is next...
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r--indra/newview/llpanelpeople.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index bb6cdd2f78..0c66e7155c 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -588,14 +588,9 @@ void LLPanelPeople::updateRecentList()
void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible)
{
- // Currently all bottom buttons are wrapped with layout panels.
- // Hiding a button has no effect: the panel still occupies its space.
- // So we have to hide the whole panel (along with its button)
- // to free some space up.
- LLButton* btn = getChild<LLView>("button_bar")->getChild<LLButton>(btn_name);
- LLPanel* btn_parent = dynamic_cast<LLPanel*>(btn->getParent());
- if (btn_parent)
- btn_parent->setVisible(visible);
+ // To make sure we're referencing the right widget (a child of the button bar).
+ LLButton* button = getChild<LLView>("button_bar")->getChild<LLButton>(btn_name);
+ button->setVisible(visible);
}
void LLPanelPeople::buttonSetEnabled(const std::string& btn_name, bool enabled)
@@ -624,14 +619,16 @@ void LLPanelPeople::updateButtons()
std::vector<LLUUID> selected_uuids;
getCurrentItemIDs(selected_uuids);
bool item_selected = (selected_uuids.size() == 1);
+ bool multiple_selected = (selected_uuids.size() >= 1);
buttonSetVisible("group_info_btn", group_tab_active);
buttonSetVisible("chat_btn", group_tab_active);
buttonSetVisible("add_friend_btn", nearby_tab_active || recent_tab_active);
buttonSetVisible("view_profile_btn", !group_tab_active);
buttonSetVisible("im_btn", !group_tab_active);
+ buttonSetVisible("call_btn", !group_tab_active);
buttonSetVisible("teleport_btn", friends_tab_active);
- buttonSetVisible("share_btn", !recent_tab_active && false); // not implemented yet
+ buttonSetVisible("share_btn", nearby_tab_active || friends_tab_active);
if (group_tab_active)
{
@@ -664,8 +661,8 @@ void LLPanelPeople::updateButtons()
buttonSetEnabled("teleport_btn", friends_tab_active && item_selected);
buttonSetEnabled("view_profile_btn", item_selected);
- buttonSetEnabled("im_btn", (selected_uuids.size() >= 1)); // allow starting the friends conference for multiple selection
- buttonSetEnabled("call_btn", item_selected && false); // not implemented yet
+ buttonSetEnabled("im_btn", multiple_selected); // allow starting the friends conference for multiple selection
+ buttonSetEnabled("call_btn", item_selected);
buttonSetEnabled("share_btn", item_selected && false); // not implemented yet
bool none_group_selected = item_selected && selected_id.isNull();
@@ -1071,7 +1068,18 @@ bool LLPanelPeople::onRecentViewSortMenuItemCheck(const LLSD& userdata)
void LLPanelPeople::onCallButtonClicked()
{
- // *TODO: not implemented yet
+ std::vector<LLUUID> selected_uuids;
+ getCurrentItemIDs(selected_uuids);
+
+ if (selected_uuids.size() == 1)
+ {
+ // initiate a P2P voice chat with the selected user
+ LLAvatarActions::startCall(getCurrentItemID());
+ }
+ else if (selected_uuids.size() > 1)
+ {
+ // *NOTE: ad-hoc voice chat not implemented yet
+ }
}
void LLPanelPeople::onTeleportButtonClicked()