diff options
author | dolphin <dolphin@lindenlab.com> | 2014-12-05 13:46:28 -0800 |
---|---|---|
committer | dolphin <dolphin@lindenlab.com> | 2014-12-05 13:46:28 -0800 |
commit | d70125cc34681f77a31830601b5fcf3356c3da77 (patch) | |
tree | f4a4e5b226da4238871ce1f4f9ff5d114e22d1d8 /indra/newview/llfloaterexperiences.cpp | |
parent | 62db156552c29f44e060b12c51c429db1a7f5788 (diff) | |
parent | 0c959fd99216c48378b8e8259d1adb358d0201b1 (diff) |
merge
Diffstat (limited to 'indra/newview/llfloaterexperiences.cpp')
-rw-r--r-- | indra/newview/llfloaterexperiences.cpp | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index d973fe5b33..777dc382cd 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -26,6 +26,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterexperiences.h" +#include "llfloaterreg.h" #include "llagent.h" #include "llevents.h" @@ -206,19 +207,8 @@ void LLFloaterExperiences::refreshContents() LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle<LLFloaterExperiences>(), nameMap)); } - lookup_url = region->getCapability("GetAdminExperiences"); - if(!lookup_url.empty()) - { - nameMap["experience_ids"]="Admin_Experiences_Tab"; - LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle<LLFloaterExperiences>(), nameMap)); - } - - lookup_url = region->getCapability("GetCreatorExperiences"); - if(!lookup_url.empty()) - { - nameMap["experience_ids"]="Contrib_Experiences_Tab"; - LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle<LLFloaterExperiences>(), nameMap)); - } + updateInfo("GetAdminExperiences","Admin_Experiences_Tab"); + updateInfo("GetCreatorExperiences","Contrib_Experiences_Tab"); lookup_url = region->getCapability("AgentExperiences"); if(!lookup_url.empty()) @@ -308,6 +298,24 @@ void LLFloaterExperiences::onClose( bool app_quitting ) void LLFloaterExperiences::checkPurchaseInfo(LLPanelExperiences* panel, const LLSD& content) const { panel->enableButton(content.has("purchase")); + + LLFloaterExperiences::findInstance()->updateInfo("GetAdminExperiences","Admin_Experiences_Tab"); + LLFloaterExperiences::findInstance()->updateInfo("GetCreatorExperiences","Contrib_Experiences_Tab"); +} + +void LLFloaterExperiences::updateInfo(std::string experiences, std::string tab) +{ + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + LLExperienceListResponder::NameMap nameMap; + std::string lookup_url = region->getCapability(experiences); + if(!lookup_url.empty()) + { + nameMap["experience_ids"]=tab; + LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle<LLFloaterExperiences>(), nameMap)); + } + } } void LLFloaterExperiences::sendPurchaseRequest() const @@ -325,3 +333,8 @@ void LLFloaterExperiences::sendPurchaseRequest() const LLHTTPClient::post(url, content, responder); } } + +LLFloaterExperiences* LLFloaterExperiences::findInstance() +{ + return LLFloaterReg::findTypedInstance<LLFloaterExperiences>("experiences"); +} |