summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpeople.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r--indra/newview/llpanelpeople.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 1743df52fc..5fb7dab7be 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -775,7 +775,7 @@ void LLPanelPeople::updateButtons()
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);
+ buttonSetEnabled("call_btn", multiple_selected && LLVoiceClient::voiceEnabled());
buttonSetEnabled("share_btn", item_selected); // not implemented yet
bool none_group_selected = item_selected && selected_id.isNull();
@@ -1003,10 +1003,28 @@ void LLPanelPeople::onAddFriendButtonClicked()
}
}
+bool LLPanelPeople::isItemsFreeOfFriends(const std::vector<LLUUID>& uuids)
+{
+ const LLAvatarTracker& av_tracker = LLAvatarTracker::instance();
+ for ( std::vector<LLUUID>::const_iterator
+ id = uuids.begin(),
+ id_end = uuids.end();
+ id != id_end; ++id )
+ {
+ if (av_tracker.isBuddy (*id))
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
void LLPanelPeople::onAddFriendWizButtonClicked()
{
// Show add friend wizard.
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(onAvatarPicked, NULL, FALSE, TRUE);
+ // Need to disable 'ok' button when friend occurs in selection
+ if (picker) picker->setOkBtnEnableCb(boost::bind(&LLPanelPeople::isItemsFreeOfFriends, this, _1));
LLFloater* root_floater = gFloaterView->getParentFloater(this);
if (root_floater)
{
@@ -1284,7 +1302,7 @@ void LLPanelPeople::onOpen(const LLSD& key)
reSelectedCurrentTab();
}
-void LLPanelPeople::notifyChildren(const LLSD& info)
+bool LLPanelPeople::notifyChildren(const LLSD& info)
{
if (info.has("task-panel-action") && info["task-panel-action"].asString() == "handle-tri-state")
{
@@ -1292,7 +1310,7 @@ void LLPanelPeople::notifyChildren(const LLSD& info)
if (!container)
{
llwarns << "Cannot find People panel container" << llendl;
- return;
+ return true;
}
if (container->getCurrentPanelIndex() > 0)
@@ -1303,10 +1321,10 @@ void LLPanelPeople::notifyChildren(const LLSD& info)
else
LLSideTray::getInstance()->collapseSideBar();
- return; // this notification is only supposed to be handled by task panels
+ return true; // this notification is only supposed to be handled by task panels
}
- LLPanel::notifyChildren(info);
+ return LLPanel::notifyChildren(info);
}
void LLPanelPeople::showAccordion(const std::string name, bool show)