diff options
author | Rider Linden <rider@lindenlab.com> | 2015-08-27 16:16:22 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2015-08-27 16:16:22 -0700 |
commit | ac3af19539e0f3a4d8557cc68f19781893de2fc3 (patch) | |
tree | ed10bf16494e59c7155f2ac0f485478267cb9a9b /indra | |
parent | a455759e643ef3b285f8fa38d2a7c9db74605c44 (diff) |
Convert LSL script preview compilation exp request
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llpreviewscript.cpp | 34 | ||||
-rwxr-xr-x | indra/newview/llpreviewscript.h | 1 |
2 files changed, 14 insertions, 21 deletions
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index b6210bdc6b..a548d7b705 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -118,26 +118,6 @@ static bool have_script_upload_cap(LLUUID& object_id) return object && (! object->getRegion()->getCapability("UpdateScriptTask").empty()); } - -class ExperienceResponder : public LLHTTPClient::Responder -{ -public: - ExperienceResponder(const LLHandle<LLLiveLSLEditor>& parent):mParent(parent) - { - } - - LLHandle<LLLiveLSLEditor> mParent; - - /*virtual*/ void httpSuccess() - { - LLLiveLSLEditor* parent = mParent.get(); - if(!parent) - return; - - parent->setExperienceIds(getContent()["experience_ids"]); - } -}; - /// --------------------------------------------------------------------------- /// LLLiveLSLFile /// --------------------------------------------------------------------------- @@ -1416,11 +1396,23 @@ void LLLiveLSLEditor::requestExperiences() std::string lookup_url=region->getCapability("GetCreatorExperiences"); if(!lookup_url.empty()) { - LLHTTPClient::get(lookup_url, new ExperienceResponder(getDerivedHandle<LLLiveLSLEditor>())); + LLCoreHttpUtil::HttpCoroutineAdapter::completionCallback_t success = + boost::bind(&LLLiveLSLEditor::receiveExperienceIds, _1, getDerivedHandle<LLLiveLSLEditor>()); + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(lookup_url, success); } } } +/*static*/ +void LLLiveLSLEditor::receiveExperienceIds(LLSD result, LLHandle<LLLiveLSLEditor> hparent) +{ + LLLiveLSLEditor* parent = hparent.get(); + if (!parent) + return; + + parent->setExperienceIds(result["experience_ids"]); +} /// --------------------------------------------------------------------------- diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 55ac64677a..02f236a089 100755 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -296,6 +296,7 @@ private: static void onMonoCheckboxClicked(LLUICtrl*, void* userdata); static void finishLSLUpload(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response, bool isRunning); + static void receiveExperienceIds(LLSD result, LLHandle<LLLiveLSLEditor> parent); private: bool mIsNew; |