diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-03-25 20:15:51 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-03-25 20:15:51 -0400 |
commit | 0a56031bd3e3645a9e5124a722cece0706469944 (patch) | |
tree | 39e2244564d2b71d8277231f691160807f8c10b9 /indra/newview/llassetuploadresponders.cpp | |
parent | 885fc3f9b54cca33e134bcfb65c1d2a9c0aeec7a (diff) | |
parent | fad31dc087cb670bd4479195cac2c31da9a55e57 (diff) |
automated merge
Diffstat (limited to 'indra/newview/llassetuploadresponders.cpp')
-rw-r--r-- | indra/newview/llassetuploadresponders.cpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 80cf8f1d61..2bd3728ab7 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -182,7 +182,10 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) // deal with L$ errors if (reason == "insufficient funds") { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs"), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); + S32 price = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs", args), price); } else { @@ -199,13 +202,19 @@ void LLAssetUploadResponder::uploadComplete(const LLSD& content) LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, const LLUUID& vfile_id, - LLAssetType::EType asset_type) -: LLAssetUploadResponder(post_data, vfile_id, asset_type) + LLAssetType::EType asset_type, + boost::function<void(const LLUUID& uuid)> callback) +: LLAssetUploadResponder(post_data, vfile_id, asset_type), + mCallback(callback) { } -LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, const std::string& file_name, LLAssetType::EType asset_type) -: LLAssetUploadResponder(post_data, file_name, asset_type) +LLNewAgentInventoryResponder::LLNewAgentInventoryResponder(const LLSD& post_data, + const std::string& file_name, + LLAssetType::EType asset_type, + boost::function<void(const LLUUID& uuid)> callback) +: LLAssetUploadResponder(post_data, file_name, asset_type), + mCallback(callback) { } @@ -283,6 +292,12 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) creation_date_now); gInventory.updateItem(item); gInventory.notifyObservers(); + + if (mCallback) + { + // call the callback with the new Asset UUID + mCallback(item->getAssetUUID()); + } // Show the preview panel for textures and sounds to let // user know that the image (or snapshot) arrived intact. @@ -330,13 +345,11 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) U32 group_perms = mPostData.has("group_mask") ? mPostData.get("group_mask" ).asInteger() : PERM_NONE; U32 next_owner_perms = mPostData.has("next_owner_mask") ? mPostData.get("next_owner_mask").asInteger() : PERM_NONE; std::string display_name = LLStringUtil::null; - LLAssetStorage::LLStoreAssetCallback callback = NULL; - void *userdata = NULL; upload_new_resource(next_file, asset_name, asset_name, - 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE, + LLFolderType::FT_NONE, LLInventoryType::IT_NONE, next_owner_perms, group_perms, everyone_perms, display_name, - callback, expected_upload_cost, userdata); + NULL, expected_upload_cost); } } |