diff options
author | dolphin <dolphin@lindenlab.com> | 2013-10-15 16:42:55 -0700 |
---|---|---|
committer | dolphin <dolphin@lindenlab.com> | 2013-10-15 16:42:55 -0700 |
commit | 1aed2f848c4f2a86d6c2ea6385ebb920e7658aa8 (patch) | |
tree | 7a7bfbb99f161894b453bf5af19478c17b1f7d8b /indra/newview/llfloaterexperiences.cpp | |
parent | 8add9a00f81b84f5268fc264f5871b04ae8547b8 (diff) |
Added LLTabContainer::getTotalTabWidth
Cleaned up experience profile floater
Diffstat (limited to 'indra/newview/llfloaterexperiences.cpp')
-rw-r--r-- | indra/newview/llfloaterexperiences.cpp | 79 |
1 files changed, 49 insertions, 30 deletions
diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 9ec94f457b..57f08742be 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -27,7 +27,6 @@ public: return; LLFloaterExperiences* parent=mParent.get(); - LLTabContainer* tabs = parent->getChild<LLTabContainer>("xp_tabs"); NameMap::iterator it = mNameMap.begin(); @@ -40,7 +39,7 @@ public: { const LLSD& ids = content[it->first]; tab->setExperienceList(ids); - parent->clearFromRecent(ids); + //parent->clearFromRecent(ids); } } ++it; @@ -70,36 +69,10 @@ BOOL LLFloaterExperiences::postBuild() addTab("Admin_Experiences_Tab", false); addTab("Contrib_Experiences_Tab", false); addTab("Recent_Experiences_Tab", false); + resizeToTabs(); - setupRecentTabs(); - - LLViewerRegion* region = gAgent.getRegion(); - - if (region) - { - LLExperienceListResponder::NameMap nameMap; - std::string lookup_url=region->getCapability("GetExperiences"); - if(!lookup_url.empty()) - { - nameMap["experiences"]="Allowed_Experiences_Tab"; - nameMap["blocked"]="Blocked_Experiences_Tab"; - LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle<LLFloaterExperiences>(), nameMap)); - } + refreshContents(); - 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)); - } - } return TRUE; } @@ -138,3 +111,49 @@ void LLFloaterExperiences::setupRecentTabs() tab->setExperienceList(recent); } + +void LLFloaterExperiences::resizeToTabs() +{ + const S32 TAB_WIDTH_PADDING = 16; + + LLTabContainer* tabs = getChild<LLTabContainer>("xp_tabs"); + LLRect rect = getRect(); + if(rect.getWidth() < tabs->getTotalTabWidth() + TAB_WIDTH_PADDING) + { + rect.mRight = rect.mLeft + tabs->getTotalTabWidth() + TAB_WIDTH_PADDING; + } + reshape(rect.getWidth(), rect.getHeight(), FALSE); +} + +void LLFloaterExperiences::refreshContents() +{ + setupRecentTabs(); + + LLViewerRegion* region = gAgent.getRegion(); + + if (region) + { + LLExperienceListResponder::NameMap nameMap; + std::string lookup_url=region->getCapability("GetExperiences"); + if(!lookup_url.empty()) + { + nameMap["experiences"]="Allowed_Experiences_Tab"; + nameMap["blocked"]="Blocked_Experiences_Tab"; + 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)); + } + } +} |