diff options
author | Leyla Farazha <leyla@lindenlab.com> | 2010-01-06 16:38:19 -0800 |
---|---|---|
committer | Leyla Farazha <leyla@lindenlab.com> | 2010-01-06 16:38:19 -0800 |
commit | 35bb14951f686da538264db349f4bfbe045b8c82 (patch) | |
tree | 31d37e3e67863aba03b2c6aef5abc5629a784e65 /indra/newview/llpanelpicks.cpp | |
parent | 95f14d73138a4f0eb9163fdc560a0dcad9564c4c (diff) | |
parent | e28eac929b8d26d133be5c1953cfdd0b7d0eb9e5 (diff) |
Merge
Diffstat (limited to 'indra/newview/llpanelpicks.cpp')
-rw-r--r-- | indra/newview/llpanelpicks.cpp | 14 |
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); } |