diff options
-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) |