diff options
author | Jonathan Yap <none@none> | 2013-11-19 16:32:41 -0500 |
---|---|---|
committer | Jonathan Yap <none@none> | 2013-11-19 16:32:41 -0500 |
commit | b7edc965bc77ab21e9a1e3f6b424299a50053529 (patch) | |
tree | da4ffe124f994e5c96a03e88bc0a6083b9430e07 /indra | |
parent | 56b1b35a18c21f6dad4147df35ba4594f31b67e3 (diff) |
STORM-68 Place initial call to send cap in new, better location.
Make processing of debug setting names a little more elegant.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llagent.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llfloaterperms.cpp | 50 | ||||
-rw-r--r-- | indra/newview/llfloaterperms.h | 5 | ||||
-rw-r--r-- | indra/newview/llviewerregion.cpp | 1 |
4 files changed, 34 insertions, 25 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3870a3be2e..f9301b61a1 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -737,6 +737,9 @@ void LLAgent::setRegion(LLViewerRegion *regionp) // Update all of the regions. LLWorld::getInstance()->updateAgentOffset(mAgentOriginGlobal); + + // Send default object permissions to simulator + LLFloaterPermsDefault::updateCap(false); } // Pass new region along to metrics components that care about this level of detail. diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index f5a9bc7bb5..dc4969f5e6 100644 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -1,7 +1,7 @@ /** * @file llfloaterperms.cpp * @brief Asset creation permission preferences. - * @author Coco + * @author Jonathan Yap * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -43,7 +43,7 @@ LLFloaterPerms::LLFloaterPerms(const LLSD& seed) BOOL LLFloaterPerms::postBuild() { - return true; + return TRUE; } //static @@ -107,17 +107,23 @@ LLFloaterPermsDefault::LLFloaterPermsDefault(const LLSD& seed) mCommitCallbackRegistrar.add("PermsDefault.Cancel", boost::bind(&LLFloaterPermsDefault::onClickCancel, this)); } + +// String equivalents of enum Categories - initialization order must match enum order! +const std::string LLFloaterPermsDefault::sCategoryNames[CAT_LAST] = +{ + "Objects", + "Uploads", + "Scripts", + "Notecards", + "Gestures", + "Wearables" +}; + + BOOL LLFloaterPermsDefault::postBuild() { mCloseSignal.connect(boost::bind(&LLFloaterPermsDefault::cancel, this)); - category_names[CAT_OBJECTS] = "Objects"; - category_names[CAT_UPLOADS] = "Uploads"; - category_names[CAT_SCRIPTS] = "Scripts"; - category_names[CAT_NOTECARDS] = "Notecards"; - category_names[CAT_GESTURES] = "Gestures"; - category_names[CAT_WEARABLES] = "Wearables"; - refresh(); return true; @@ -179,9 +185,9 @@ void LLFloaterPermsDefault::updateCap(bool alwaysUpdate) if(!object_url.empty()) { LLSD report = LLSD::emptyMap(); - report["Group"] = (LLSD::Integer)LLFloaterPerms::getGroupPerms("Objects"); - report["Everyone"] = (LLSD::Integer)LLFloaterPerms::getEveryonePerms("Objects"); - report["NextOwner"] = (LLSD::Integer)LLFloaterPerms::getNextOwnerPerms("Objects"); + report["Group"] = (LLSD::Integer)LLFloaterPerms::getGroupPerms(sCategoryNames[CAT_OBJECTS]); + report["Everyone"] = (LLSD::Integer)LLFloaterPerms::getEveryonePerms(sCategoryNames[CAT_OBJECTS]); + report["NextOwner"] = (LLSD::Integer)LLFloaterPerms::getNextOwnerPerms(sCategoryNames[CAT_OBJECTS]); LLHTTPClient::post(object_url, report, new LLFloaterPermsResponder()); } } @@ -206,11 +212,11 @@ void LLFloaterPermsDefault::cancel() { for (U32 iter = CAT_OBJECTS; iter < CAT_LAST; iter++) { - gSavedSettings.setBOOL(category_names[iter]+"NextOwnerCopy", mNextOwnerCopy[iter]); - gSavedSettings.setBOOL(category_names[iter]+"NextOwnerModify", mNextOwnerModify[iter]); - gSavedSettings.setBOOL(category_names[iter]+"NextOwnerTransfer", mNextOwnerTransfer[iter]); - gSavedSettings.setBOOL(category_names[iter]+"ShareWithGroup", mShareWithGroup[iter]); - gSavedSettings.setBOOL(category_names[iter]+"EveryoneCopy", mEveryoneCopy[iter]); + gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerCopy", mNextOwnerCopy[iter]); + gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerModify", mNextOwnerModify[iter]); + gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerTransfer", mNextOwnerTransfer[iter]); + gSavedSettings.setBOOL(sCategoryNames[iter]+"ShareWithGroup", mShareWithGroup[iter]); + gSavedSettings.setBOOL(sCategoryNames[iter]+"EveryoneCopy", mEveryoneCopy[iter]); } } @@ -218,10 +224,10 @@ void LLFloaterPermsDefault::refresh() { for (U32 iter = CAT_OBJECTS; iter < CAT_LAST; iter++) { - mShareWithGroup[iter] = gSavedSettings.getBOOL(category_names[iter]+"ShareWithGroup"); - mEveryoneCopy[iter] = gSavedSettings.getBOOL(category_names[iter]+"EveryoneCopy"); - mNextOwnerCopy[iter] = gSavedSettings.getBOOL(category_names[iter]+"NextOwnerCopy"); - mNextOwnerModify[iter] = gSavedSettings.getBOOL(category_names[iter]+"NextOwnerModify"); - mNextOwnerTransfer[iter] = gSavedSettings.getBOOL(category_names[iter]+"NextOwnerTransfer"); + mShareWithGroup[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"ShareWithGroup"); + mEveryoneCopy[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"EveryoneCopy"); + mNextOwnerCopy[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"NextOwnerCopy"); + mNextOwnerModify[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"NextOwnerModify"); + mNextOwnerTransfer[iter] = gSavedSettings.getBOOL(sCategoryNames[iter]+"NextOwnerTransfer"); } } diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h index a31d034ec8..b4b5d58aa5 100644 --- a/indra/newview/llfloaterperms.h +++ b/indra/newview/llfloaterperms.h @@ -1,7 +1,7 @@ /** * @file llfloaterperms.h * @brief Asset creation permission preferences. - * @author Coco + * @author Jonathan Yap * * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code @@ -62,6 +62,7 @@ public: static void updateCap(bool alwaysUpdate); static void setCapSent(bool cap_sent); +// Update instantiation of sCategoryNames in the .cpp file to match if you change this! enum Categories { CAT_OBJECTS, @@ -77,7 +78,7 @@ private: LLFloaterPermsDefault(const LLSD& seed); void refresh(); - std::string category_names[CAT_LAST]; + static const std::string sCategoryNames[CAT_LAST]; // cached values only for implementing cancel. bool mShareWithGroup[CAT_LAST]; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 68db98580f..21e0db46c9 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1490,7 +1490,6 @@ void LLViewerRegion::unpackRegionHandshake() // Supplying false in this call means only send the default permissions to the simulator if // it has never been sent. Once this data is sent the simulator will pass this data to new // simulators as the agent moves around. - LLFloaterPermsDefault::updateCap(false); } void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) |