diff options
author | Steve Bennetts <steve@lindenlab.com> | 2009-12-07 15:57:31 -0800 |
---|---|---|
committer | Steve Bennetts <steve@lindenlab.com> | 2009-12-07 15:57:31 -0800 |
commit | 0b4b03fe3e92f0991b8145a2ba8267a20ce53581 (patch) | |
tree | adef5f205fd2ba632c1e6db79d575b1c3ceb081d /indra/newview/llpanelpeople.cpp | |
parent | 374aa101ab0296d9bed3e7c592e4820930042f6e (diff) | |
parent | c3a82913deb9b23ef1f22b6d002893b36146553a (diff) |
Merge from product-engine
Diffstat (limited to 'indra/newview/llpanelpeople.cpp')
-rw-r--r-- | indra/newview/llpanelpeople.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 1743df52fc..1e4682701e 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -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) |