From 2d701456a07d37a520f436f9e83b1008e492f232 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 12 Dec 2013 08:51:15 -0500 Subject: STORM-68 Fix bug for new gestures, notecards, and scripts where a copied item did not preserve its default permissions. Add apply button. --- indra/newview/llfloaterperms.cpp | 11 ++++-- indra/newview/llfloaterperms.h | 3 +- indra/newview/llviewerinventory.cpp | 3 ++ .../skins/default/xui/en/floater_perms_default.xml | 40 ++++++++++++++-------- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/indra/newview/llfloaterperms.cpp b/indra/newview/llfloaterperms.cpp index b4ea34d5f1..0178c0b4f1 100755 --- a/indra/newview/llfloaterperms.cpp +++ b/indra/newview/llfloaterperms.cpp @@ -103,6 +103,7 @@ LLFloaterPermsDefault::LLFloaterPermsDefault(const LLSD& seed) : LLFloater(seed) { mCommitCallbackRegistrar.add("PermsDefault.Copy", boost::bind(&LLFloaterPermsDefault::onCommitCopy, this, _2)); + mCommitCallbackRegistrar.add("PermsDefault.Apply", boost::bind(&LLFloaterPermsDefault::onClickApply, this)); mCommitCallbackRegistrar.add("PermsDefault.OK", boost::bind(&LLFloaterPermsDefault::onClickOK, this)); mCommitCallbackRegistrar.add("PermsDefault.Cancel", boost::bind(&LLFloaterPermsDefault::onClickCancel, this)); } @@ -129,9 +130,14 @@ BOOL LLFloaterPermsDefault::postBuild() return true; } +void LLFloaterPermsDefault::onClickApply() +{ + apply(); +} + void LLFloaterPermsDefault::onClickOK() { - ok(); + apply(); closeFloater(); } @@ -164,7 +170,6 @@ private: void error(U32 status, const std::string& reason) { -llwarns << "DBG !" << sPreviousReason << "!" << llendl; // Do not display the same error more than once in a row if (reason != sPreviousReason) { @@ -217,7 +222,7 @@ void LLFloaterPermsDefault::setCapSent(bool cap_sent) mCapSent = cap_sent; } -void LLFloaterPermsDefault::ok() +void LLFloaterPermsDefault::apply() { // Changes were already applied automatically to saved settings. // Refreshing internal values makes it official. diff --git a/indra/newview/llfloaterperms.h b/indra/newview/llfloaterperms.h index 2bb0a19dc1..12f297960a 100755 --- a/indra/newview/llfloaterperms.h +++ b/indra/newview/llfloaterperms.h @@ -54,8 +54,9 @@ class LLFloaterPermsDefault : public LLFloater public: /*virtual*/ BOOL postBuild(); - void ok(); + void apply(); void cancel(); + void onClickApply(); void onClickOK(); void onClickCancel(); void onCommitCopy(const LLSD& user_data); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index c52505e4b3..5c41ef52b6 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1004,6 +1004,7 @@ void create_script_cb(const LLUUID& inv_item) item->setPermissions(perm); + item->updateServer(FALSE); gInventory.updateItem(item); gInventory.notifyObservers(); } @@ -1024,6 +1025,7 @@ void create_gesture_cb(const LLUUID& inv_item) item->setPermissions(perm); + item->updateServer(FALSE); gInventory.updateItem(item); gInventory.notifyObservers(); @@ -1047,6 +1049,7 @@ void create_notecard_cb(const LLUUID& inv_item) item->setPermissions(perm); + item->updateServer(FALSE); gInventory.updateItem(item); gInventory.notifyObservers(); } diff --git a/indra/newview/skins/default/xui/en/floater_perms_default.xml b/indra/newview/skins/default/xui/en/floater_perms_default.xml index 9c3b92bc83..4e44c9ebb3 100644 --- a/indra/newview/skins/default/xui/en/floater_perms_default.xml +++ b/indra/newview/skins/default/xui/en/floater_perms_default.xml @@ -17,24 +17,22 @@ name="default permissions" top="20" width="690"> - - - + Next owner: +