From ac3af19539e0f3a4d8557cc68f19781893de2fc3 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 27 Aug 2015 16:16:22 -0700 Subject: Convert LSL script preview compilation exp request --- indra/newview/llpreviewscript.cpp | 34 +++++++++++++--------------------- indra/newview/llpreviewscript.h | 1 + 2 files changed, 14 insertions(+), 21 deletions(-) (limited to 'indra') 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& parent):mParent(parent) - { - } - - LLHandle 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())); + LLCoreHttpUtil::HttpCoroutineAdapter::completionCallback_t success = + boost::bind(&LLLiveLSLEditor::receiveExperienceIds, _1, getDerivedHandle()); + + LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet(lookup_url, success); } } } +/*static*/ +void LLLiveLSLEditor::receiveExperienceIds(LLSD result, LLHandle 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 parent); private: bool mIsNew; -- cgit v1.2.3