diff options
| author | Jonathan Yap <none@none> | 2012-02-19 14:06:32 -0500 |
|---|---|---|
| committer | Jonathan Yap <none@none> | 2012-02-19 14:06:32 -0500 |
| commit | 566bbe7e09bf9cd9939cfae40773d86993803d1b (patch) | |
| tree | 6527575edfbe6a24e3623fe7318b673f7d493c70 /indra/newview/lltoolmgr.cpp | |
| parent | 1f5c2c056ff2b660b053cf3a7344fdf1c5c15b0e (diff) | |
STORM-1808 Recode so build button is not clickable when grayed out
Diffstat (limited to 'indra/newview/lltoolmgr.cpp')
| -rw-r--r-- | indra/newview/lltoolmgr.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 6bc7c6de11..ac01316462 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -81,7 +81,7 @@ LLToolMgr::LLToolMgr() // Not a panel, register these callbacks globally. LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); - LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this)); + LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2)); gToolNull = new LLTool(LLStringUtil::null); // Does nothing setCurrentTool(gToolNull); @@ -245,8 +245,15 @@ bool LLToolMgr::canEdit() return LLViewerParcelMgr::getInstance()->allowAgentBuild(); } -void LLToolMgr::toggleBuildMode() +void LLToolMgr::toggleBuildMode(const LLSD& sdname) { + const std::string& param = sdname.asString(); + + if (param == "build" && !canEdit()) + { + return; + } + LLFloaterReg::toggleInstanceOrBringToFront("build"); bool build_visible = LLFloaterReg::instanceVisible("build"); |
