summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpicks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelpicks.cpp')
-rw-r--r--indra/newview/llpanelpicks.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 751705dd57..ada65c98a4 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -411,6 +411,7 @@ BOOL LLPanelPicks::postBuild()
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar plus_registar;
plus_registar.add("Picks.Plus.Action", boost::bind(&LLPanelPicks::onPlusMenuItemClicked, this, _2));
+ mEnableCallbackRegistrar.add("Picks.Plus.Enable", boost::bind(&LLPanelPicks::isActionEnabled, this, _2));
mPlusMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_picks_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
return TRUE;
@@ -430,6 +431,18 @@ void LLPanelPicks::onPlusMenuItemClicked(const LLSD& param)
}
}
+bool LLPanelPicks::isActionEnabled(const LLSD& userdata) const
+{
+ std::string command_name = userdata.asString();
+
+ if (command_name == "new_pick" && LLAgentPicksInfo::getInstance()->isPickLimitReached())
+ {
+ return false;
+ }
+
+ return true;
+}
+
void LLPanelPicks::onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab)
{
if(!mPicksAccTab->getDisplayChildren())
@@ -652,7 +665,6 @@ void LLPanelPicks::updateButtons()
if (getAvatarId() == gAgentID)
{
- childSetEnabled(XML_BTN_NEW, !LLAgentPicksInfo::getInstance()->isPickLimitReached());
childSetEnabled(XML_BTN_DELETE, has_selected);
}