From d51bd95a1f9cdeae22f330389c5213a1093eb971 Mon Sep 17 00:00:00 2001 From: "dolphin@dolphin-THINK.home" Date: Tue, 13 Nov 2012 08:24:18 -0800 Subject: Added a simple ui for displaying experiences keys with hardcoded contents. --- indra/newview/llfloaterexperiences.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 indra/newview/llfloaterexperiences.cpp (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp new file mode 100644 index 0000000000..b862b41bba --- /dev/null +++ b/indra/newview/llfloaterexperiences.cpp @@ -0,0 +1,14 @@ +#include "llviewerprecompiledheaders.h" + +#include "llpanelexperiences.h" +#include "llfloaterexperiences.h" + +LLFloaterExperiences::LLFloaterExperiences(const LLSD& data) + :LLFloater(data) +{ +} + +BOOL LLFloaterExperiences::postBuild() +{ + return TRUE; +} -- cgit v1.2.3 From e510fa3ee064ce03a48852fdea26be781e8fa8b6 Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 3 Oct 2013 12:59:44 -0700 Subject: First pass at functional experience list floater --- indra/newview/llfloaterexperiences.cpp | 126 +++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index b862b41bba..398ced2632 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -2,13 +2,139 @@ #include "llpanelexperiences.h" #include "llfloaterexperiences.h" +#include "llagent.h" +#include "llfloaterregioninfo.h" +#include "lltabcontainer.h" +#include "lltrans.h" +#include "llexperiencecache.h" + + +class LLExperienceListResponder : public LLHTTPClient::Responder +{ +public: + typedef std::map NameMap; + LLExperienceListResponder(const LLHandle& parent, NameMap& nameMap):mParent(parent) + { + mNameMap.swap(nameMap); + } + + LLHandle mParent; + NameMap mNameMap; + + virtual void result(const LLSD& content) + { + if(mParent.isDead()) + return; + + LLFloaterExperiences* parent=mParent.get(); + + LLTabContainer* tabs = parent->getChild("xp_tabs"); + + NameMap::iterator it = mNameMap.begin(); + while(it != mNameMap.end()) + { + if(content.has(it->first)) + { + LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName(it->second); + if(tab) + { + const LLSD& ids = content[it->first]; + tab->setExperienceList(ids); + parent->clearFromRecent(ids); + } + } + ++it; + } + } +}; + + LLFloaterExperiences::LLFloaterExperiences(const LLSD& data) :LLFloater(data) { } +void LLFloaterExperiences::addTab(const std::string& name, bool select) +{ + getChild("xp_tabs")->addTabPanel(LLTabContainer::TabPanelParams(). + panel(LLPanelExperiences::create(name)). + label(LLTrans::getString(name)). + select_tab(select)); +} + BOOL LLFloaterExperiences::postBuild() { + addTab("Allowed_Experiences_Tab", true); + addTab("Blocked_Experiences_Tab", false); + addTab("Admin_Experiences_Tab", false); + addTab("Contrib_Experiences_Tab", false); + addTab("Recent_Experiences_Tab", false); + + 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(), nameMap)); + } + + lookup_url = region->getCapability("GetAdminExperiences"); + if(!lookup_url.empty()) + { + nameMap["experience_ids"]="Admin_Experiences_Tab"; + LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); + } + + lookup_url = region->getCapability("GetAdminExperiences"); + if(!lookup_url.empty()) + { + nameMap["experience_ids"]="Contrib_Experiences_Tab"; + LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); + } + } return TRUE; } + +void LLFloaterExperiences::clearFromRecent(const LLSD& ids) +{ + LLTabContainer* tabs = getChild("xp_tabs"); + + LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName("Recent_Experiences_Tab"); + if(!tab) + return; + + tab->removeExperiences(ids); +} + +void LLFloaterExperiences::setupRecentTabs() +{ + LLTabContainer* tabs = getChild("xp_tabs"); + + LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName("Recent_Experiences_Tab"); + if(!tab) + return; + + LLSD recent; + + const LLExperienceCache::cache_t& experiences = LLExperienceCache::getCached(); + + LLExperienceCache::cache_t::const_iterator it = experiences.begin(); + while( it != experiences.end() ) + { + if(!it->second.has(LLExperienceCache::MISSING)) + { + recent.append(it->first); + } + ++it; + } + + tab->setExperienceList(recent); +} -- cgit v1.2.3 From c08e8205269dcc835a5f22eafce8c0930919814e Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 7 Oct 2013 09:36:01 -0700 Subject: Fixed typo in experience list floater --- indra/newview/llfloaterexperiences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 398ced2632..9ec94f457b 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -93,7 +93,7 @@ BOOL LLFloaterExperiences::postBuild() LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); } - lookup_url = region->getCapability("GetAdminExperiences"); + lookup_url = region->getCapability("GetCreatorExperiences"); if(!lookup_url.empty()) { nameMap["experience_ids"]="Contrib_Experiences_Tab"; -- cgit v1.2.3 From 1aed2f848c4f2a86d6c2ea6385ebb920e7658aa8 Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 15 Oct 2013 16:42:55 -0700 Subject: Added LLTabContainer::getTotalTabWidth Cleaned up experience profile floater --- indra/newview/llfloaterexperiences.cpp | 79 +++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 30 deletions(-) (limited to 'indra/newview/llfloaterexperiences.cpp') 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("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(), nameMap)); - } + refreshContents(); - lookup_url = region->getCapability("GetAdminExperiences"); - if(!lookup_url.empty()) - { - nameMap["experience_ids"]="Admin_Experiences_Tab"; - LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); - } - - lookup_url = region->getCapability("GetCreatorExperiences"); - if(!lookup_url.empty()) - { - nameMap["experience_ids"]="Contrib_Experiences_Tab"; - LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), 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("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(), nameMap)); + } + + lookup_url = region->getCapability("GetAdminExperiences"); + if(!lookup_url.empty()) + { + nameMap["experience_ids"]="Admin_Experiences_Tab"; + LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); + } + + lookup_url = region->getCapability("GetCreatorExperiences"); + if(!lookup_url.empty()) + { + nameMap["experience_ids"]="Contrib_Experiences_Tab"; + LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); + } + } +} -- cgit v1.2.3 From 309ffd57fade231c3d14eedfe1171788e250f088 Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 22 Oct 2013 10:51:53 -0700 Subject: Post events on experience permission changes to refresh uis --- indra/newview/llfloaterexperiences.cpp | 83 ++++++++++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 3 deletions(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 57f08742be..58ec4afd7c 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -7,6 +7,7 @@ #include "lltabcontainer.h" #include "lltrans.h" #include "llexperiencecache.h" +#include "llevents.h" class LLExperienceListResponder : public LLHTTPClient::Responder @@ -71,9 +72,11 @@ BOOL LLFloaterExperiences::postBuild() addTab("Recent_Experiences_Tab", false); resizeToTabs(); - refreshContents(); - - return TRUE; + + LLEventPumps::instance().obtain("experience_permission").listen("LLFloaterExperiences", + boost::bind(&LLFloaterExperiences::updatePermissions, this, _1)); + + return FALSE; } void LLFloaterExperiences::clearFromRecent(const LLSD& ids) @@ -157,3 +160,77 @@ void LLFloaterExperiences::refreshContents() } } } + +void LLFloaterExperiences::onOpen( const LLSD& key ) +{ + LLViewerRegion* region = gAgent.getRegion(); + if(region) + { + if(region->capabilitiesReceived()) + { + refreshContents(); + return; + } + region->setCapabilitiesReceivedCallback(boost::bind(&LLFloaterExperiences::refreshContents, this)); + return; + } +} + +bool LLFloaterExperiences::updatePermissions( const LLSD& permission ) +{ + LLTabContainer* tabs = getChild("xp_tabs"); + LLUUID experience; + std::string permission_string; + if(permission.has("experience")) + { + experience = permission["experience"].asUUID(); + permission_string = permission[experience.asString()]["permission"].asString(); + + } + LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName("Allowed_Experiences_Tab"); + if(tab) + { + if(permission.has("experiences")) + { + tab->setExperienceList(permission["experiences"]); + } + else if(experience.notNull()) + { + if(permission_string != "Allow") + { + tab->removeExperience(experience); + } + else + { + tab->addExperience(experience); + } + } + } + + tab = (LLPanelExperiences*)tabs->getPanelByName("Blocked_Experiences_Tab"); + if(tab) + { + if(permission.has("blocked")) + { + tab->setExperienceList(permission["blocked"]); + } + else if(experience.notNull()) + { + if(permission_string != "Block") + { + tab->removeExperience(experience); + } + else + { + tab->addExperience(experience); + } + } + } + return false; +} + +void LLFloaterExperiences::onClose( bool app_quitting ) +{ + LLEventPumps::instance().obtain("experience_permission").stopListening("LLFloaterExperiences"); + LLFloater::onClose(app_quitting); +} -- cgit v1.2.3 From 1385a53e3388ed5ed94887d9ad65c134c65b56ec Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 24 Oct 2013 09:53:27 -0700 Subject: Fixed typo in LLFloaterExperiences::postBuild --- indra/newview/llfloaterexperiences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 58ec4afd7c..f80f6d9813 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -76,7 +76,7 @@ BOOL LLFloaterExperiences::postBuild() LLEventPumps::instance().obtain("experience_permission").listen("LLFloaterExperiences", boost::bind(&LLFloaterExperiences::updatePermissions, this, _1)); - return FALSE; + return TRUE; } void LLFloaterExperiences::clearFromRecent(const LLSD& ids) -- cgit v1.2.3 From 1319a6258a1ec110150624ce10d951439158ee90 Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 11 Nov 2013 13:58:46 -0800 Subject: Fixing coding policy errors --- indra/newview/llfloaterexperiences.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index f80f6d9813..3b15cc62a7 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -1,3 +1,29 @@ +/** + * @file llfloaterexperiences.cpp + * @brief LLFloaterExperiences class implementation + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + #include "llviewerprecompiledheaders.h" #include "llpanelexperiences.h" -- cgit v1.2.3 From c1f730ed46c14c12d5856109b622bf085c39abb0 Mon Sep 17 00:00:00 2001 From: dolphin Date: Wed, 26 Feb 2014 17:32:21 -0800 Subject: Moved the experience acquire code to the experiences panel --- indra/newview/llfloaterexperiences.cpp | 44 ++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 3b15cc62a7..8e860a9ee0 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -34,20 +34,21 @@ #include "lltrans.h" #include "llexperiencecache.h" #include "llevents.h" +#include "llnotificationsutil.h" class LLExperienceListResponder : public LLHTTPClient::Responder { public: typedef std::map NameMap; - LLExperienceListResponder(const LLHandle& parent, NameMap& nameMap):mParent(parent) + LLExperienceListResponder(const LLHandle& parent, NameMap& nameMap, const std::string& errorMessage="ErrorMessage"):mParent(parent),mErrorMessage(errorMessage) { mNameMap.swap(nameMap); } LLHandle mParent; NameMap mNameMap; - + const std::string mErrorMessage; virtual void result(const LLSD& content) { if(mParent.isDead()) @@ -66,12 +67,19 @@ public: { const LLSD& ids = content[it->first]; tab->setExperienceList(ids); - //parent->clearFromRecent(ids); + tab->enableButton(ids.beginArray() == ids.endArray()); } } ++it; } } + + virtual void error(U32 status, const std::string& reason) + { + LLSD subs; + subs["ERROR_MESSAGE"] = reason; + LLNotificationsUtil::add(mErrorMessage, subs); + } }; @@ -81,12 +89,15 @@ LLFloaterExperiences::LLFloaterExperiences(const LLSD& data) { } -void LLFloaterExperiences::addTab(const std::string& name, bool select) +LLPanelExperiences* LLFloaterExperiences::addTab(const std::string& name, bool select) { + LLPanelExperiences* newPanel = LLPanelExperiences::create(name); getChild("xp_tabs")->addTabPanel(LLTabContainer::TabPanelParams(). - panel(LLPanelExperiences::create(name)). + panel(newPanel). label(LLTrans::getString(name)). select_tab(select)); + + return newPanel; } BOOL LLFloaterExperiences::postBuild() @@ -96,6 +107,8 @@ BOOL LLFloaterExperiences::postBuild() addTab("Admin_Experiences_Tab", false); addTab("Contrib_Experiences_Tab", false); addTab("Recent_Experiences_Tab", false); + LLPanelExperiences* owned = addTab("Owned_Experiences_Tab", false); + owned->setButtonAction("acquire", boost::bind(&LLFloaterExperiences::sendPurchaseRequest, this)); resizeToTabs(); @@ -184,6 +197,13 @@ void LLFloaterExperiences::refreshContents() nameMap["experience_ids"]="Contrib_Experiences_Tab"; LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); } + + lookup_url = region->getCapability("AgentExperiences"); + if(!lookup_url.empty()) + { + nameMap["experience_ids"]="Owned_Experiences_Tab"; + LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); + } } } @@ -260,3 +280,17 @@ void LLFloaterExperiences::onClose( bool app_quitting ) LLEventPumps::instance().obtain("experience_permission").stopListening("LLFloaterExperiences"); LLFloater::onClose(app_quitting); } + +void LLFloaterExperiences::sendPurchaseRequest() const +{ + LLViewerRegion* region = gAgent.getRegion(); + std::string url = region->getCapability("AgentExperiences"); + if(!url.empty()) + { + LLSD content; + + LLExperienceListResponder::NameMap nameMap; + nameMap["experience_ids"]="Owned_Experiences_Tab"; + LLHTTPClient::post(url, content, new LLExperienceListResponder(getDerivedHandle(), nameMap, "ExperienceAcquireFailed")); + } +} -- cgit v1.2.3 From 49f08d775d3644bb47d342f8e37dd15051aeaa62 Mon Sep 17 00:00:00 2001 From: dolphin Date: Fri, 28 Feb 2014 16:21:42 -0800 Subject: Add group editing for experiences --- indra/newview/llfloaterexperiences.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 8e860a9ee0..956afe15c3 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -37,6 +37,9 @@ #include "llnotificationsutil.h" + +#define SHOW_RECENT_TAB (0) + class LLExperienceListResponder : public LLHTTPClient::Responder { public: @@ -106,9 +109,11 @@ BOOL LLFloaterExperiences::postBuild() addTab("Blocked_Experiences_Tab", false); addTab("Admin_Experiences_Tab", false); addTab("Contrib_Experiences_Tab", false); - addTab("Recent_Experiences_Tab", false); LLPanelExperiences* owned = addTab("Owned_Experiences_Tab", false); owned->setButtonAction("acquire", boost::bind(&LLFloaterExperiences::sendPurchaseRequest, this)); +#if SHOW_RECENT_TAB + addTab("Recent_Experiences_Tab", false); +#endif //SHOW_RECENT_TAB resizeToTabs(); @@ -118,8 +123,10 @@ BOOL LLFloaterExperiences::postBuild() return TRUE; } + void LLFloaterExperiences::clearFromRecent(const LLSD& ids) { +#if SHOW_RECENT_TAB LLTabContainer* tabs = getChild("xp_tabs"); LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName("Recent_Experiences_Tab"); @@ -127,10 +134,12 @@ void LLFloaterExperiences::clearFromRecent(const LLSD& ids) return; tab->removeExperiences(ids); +#endif // SHOW_RECENT_TAB } void LLFloaterExperiences::setupRecentTabs() { +#if SHOW_RECENT_TAB LLTabContainer* tabs = getChild("xp_tabs"); LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName("Recent_Experiences_Tab"); @@ -152,8 +161,10 @@ void LLFloaterExperiences::setupRecentTabs() } tab->setExperienceList(recent); +#endif // SHOW_RECENT_TAB } + void LLFloaterExperiences::resizeToTabs() { const S32 TAB_WIDTH_PADDING = 16; -- cgit v1.2.3 From 96457e1affe33d75208cabf7529b53eee8e8105b Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 3 Mar 2014 11:28:34 -0800 Subject: Disable the acquire xp button by default. Mark the xp profile dirty when changing the group --- indra/newview/llfloaterexperiences.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 956afe15c3..f958a988dc 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -111,6 +111,7 @@ BOOL LLFloaterExperiences::postBuild() addTab("Contrib_Experiences_Tab", false); LLPanelExperiences* owned = addTab("Owned_Experiences_Tab", false); owned->setButtonAction("acquire", boost::bind(&LLFloaterExperiences::sendPurchaseRequest, this)); + owned->enableButton(false); #if SHOW_RECENT_TAB addTab("Recent_Experiences_Tab", false); #endif //SHOW_RECENT_TAB -- cgit v1.2.3 From dba034ee100dae4b62ddf12523835a413a25f189 Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 20 Mar 2014 16:32:31 -0700 Subject: Experience log panel --- indra/newview/llfloaterexperiences.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index f958a988dc..1654419826 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -35,6 +35,7 @@ #include "llexperiencecache.h" #include "llevents.h" #include "llnotificationsutil.h" +#include "llpanelexperiencelog.h" @@ -115,6 +116,7 @@ BOOL LLFloaterExperiences::postBuild() #if SHOW_RECENT_TAB addTab("Recent_Experiences_Tab", false); #endif //SHOW_RECENT_TAB + getChild("xp_tabs")->addTabPanel(new LLPanelExperienceLog()); resizeToTabs(); -- cgit v1.2.3 From 2206f97d8efb2683e6c0d759a8549de9de67a054 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 23 Apr 2014 22:19:20 +0100 Subject: Added SEARCH tab to Experience floater for ACME-1420 --- indra/newview/llfloaterexperiences.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 1654419826..51e3996f3f 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -36,7 +36,7 @@ #include "llevents.h" #include "llnotificationsutil.h" #include "llpanelexperiencelog.h" - +#include "llpanelexperiencepicker.h" #define SHOW_RECENT_TAB (0) @@ -106,6 +106,7 @@ LLPanelExperiences* LLFloaterExperiences::addTab(const std::string& name, bool s BOOL LLFloaterExperiences::postBuild() { + getChild("xp_tabs")->addTabPanel(new LLPanelExperiencePicker()); addTab("Allowed_Experiences_Tab", true); addTab("Blocked_Experiences_Tab", false); addTab("Admin_Experiences_Tab", false); -- cgit v1.2.3 From d14673988d0d26e5029f8f921bf00cce63e4f767 Mon Sep 17 00:00:00 2001 From: dolphin Date: Wed, 7 May 2014 13:40:34 -0700 Subject: removed deprecated logging macros --- indra/newview/llfloaterexperiences.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 51e3996f3f..2153079fa4 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -25,18 +25,20 @@ */ #include "llviewerprecompiledheaders.h" - -#include "llpanelexperiences.h" #include "llfloaterexperiences.h" + #include "llagent.h" -#include "llfloaterregioninfo.h" -#include "lltabcontainer.h" -#include "lltrans.h" -#include "llexperiencecache.h" #include "llevents.h" +#include "llexperiencecache.h" +#include "llfloaterregioninfo.h" +#include "llhttpclient.h" #include "llnotificationsutil.h" #include "llpanelexperiencelog.h" #include "llpanelexperiencepicker.h" +#include "llpanelexperiences.h" +#include "lltabcontainer.h" +#include "lltrans.h" +#include "llviewerregion.h" #define SHOW_RECENT_TAB (0) -- cgit v1.2.3 From bb5e0f7877d06f10cd9ba82bc596a072427306b2 Mon Sep 17 00:00:00 2001 From: dolphin Date: Fri, 9 May 2014 10:26:06 -0700 Subject: Enable the experience purchase button based on the sim providing purchase info. --- indra/newview/llfloaterexperiences.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 2153079fa4..5ed77d3680 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -47,11 +47,13 @@ class LLExperienceListResponder : public LLHTTPClient::Responder { public: typedef std::map NameMap; - LLExperienceListResponder(const LLHandle& parent, NameMap& nameMap, const std::string& errorMessage="ErrorMessage"):mParent(parent),mErrorMessage(errorMessage) - { - mNameMap.swap(nameMap); - } + typedef boost::function Callback; + LLExperienceListResponder(const LLHandle& parent, NameMap& nameMap, const std::string& errorMessage="ErrorMessage"):mParent(parent),mErrorMessage(errorMessage) + { + mNameMap.swap(nameMap); + } + Callback mCallback; LLHandle mParent; NameMap mNameMap; const std::string mErrorMessage; @@ -73,7 +75,10 @@ public: { const LLSD& ids = content[it->first]; tab->setExperienceList(ids); - tab->enableButton(ids.beginArray() == ids.endArray()); + if(!mCallback.empty()) + { + mCallback(tab, content); + } } } ++it; @@ -298,6 +303,11 @@ void LLFloaterExperiences::onClose( bool app_quitting ) LLFloater::onClose(app_quitting); } +void LLFloaterExperiences::checkPurchaseInfo(LLPanelExperiences* panel, const LLSD& content) const +{ + panel->enableButton(content.has("purchase")); +} + void LLFloaterExperiences::sendPurchaseRequest() const { LLViewerRegion* region = gAgent.getRegion(); @@ -308,6 +318,8 @@ void LLFloaterExperiences::sendPurchaseRequest() const LLExperienceListResponder::NameMap nameMap; nameMap["experience_ids"]="Owned_Experiences_Tab"; - LLHTTPClient::post(url, content, new LLExperienceListResponder(getDerivedHandle(), nameMap, "ExperienceAcquireFailed")); + LLExperienceListResponder* responder = new LLExperienceListResponder(getDerivedHandle(), nameMap, "ExperienceAcquireFailed"); + responder->mCallback = boost::bind(&LLFloaterExperiences::checkPurchaseInfo, this, _1, _2); + LLHTTPClient::post(url, content, responder); } } -- cgit v1.2.3 From 7a15be83bf0692a927d2d2876190e63a99eccad2 Mon Sep 17 00:00:00 2001 From: Cho Date: Fri, 20 Jun 2014 22:15:49 +0100 Subject: Updated LLExperienceListResponder to use new LLCurl::Responder interface to fix ACME-1533 --- indra/newview/llfloaterexperiences.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 5ed77d3680..98b26f5ac9 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -43,7 +43,7 @@ #define SHOW_RECENT_TAB (0) -class LLExperienceListResponder : public LLHTTPClient::Responder +class LLExperienceListResponder : public LLCurl::Responder { public: typedef std::map NameMap; @@ -57,7 +57,7 @@ public: LLHandle mParent; NameMap mNameMap; const std::string mErrorMessage; - virtual void result(const LLSD& content) + /*virtual*/ void httpSuccess() { if(mParent.isDead()) return; @@ -68,16 +68,16 @@ public: NameMap::iterator it = mNameMap.begin(); while(it != mNameMap.end()) { - if(content.has(it->first)) + if(getContent().has(it->first)) { LLPanelExperiences* tab = (LLPanelExperiences*)tabs->getPanelByName(it->second); if(tab) { - const LLSD& ids = content[it->first]; + const LLSD& ids = getContent()[it->first]; tab->setExperienceList(ids); if(!mCallback.empty()) { - mCallback(tab, content); + mCallback(tab, getContent()); } } } @@ -85,10 +85,10 @@ public: } } - virtual void error(U32 status, const std::string& reason) + /*virtual*/ void httpFailure() { LLSD subs; - subs["ERROR_MESSAGE"] = reason; + subs["ERROR_MESSAGE"] = getReason(); LLNotificationsUtil::add(mErrorMessage, subs); } }; -- cgit v1.2.3 From 200788c344f5449f99eacc9167ac15c7e6262b69 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 24 Jun 2014 22:43:23 +0100 Subject: Updated all experience responders for LLCurl::Responder interface changes for ACME-1535 and ACME-1536 --- indra/newview/llfloaterexperiences.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index 98b26f5ac9..ac79c9ab43 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -43,7 +43,7 @@ #define SHOW_RECENT_TAB (0) -class LLExperienceListResponder : public LLCurl::Responder +class LLExperienceListResponder : public LLHTTPClient::Responder { public: typedef std::map NameMap; -- cgit v1.2.3 From ab146c0a3fa5e3f594a14659f96f7d679b528bc9 Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 21 Oct 2014 10:39:02 -0700 Subject: Check purchase info after receiving experience ownership list. --- indra/newview/llfloaterexperiences.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloaterexperiences.cpp') diff --git a/indra/newview/llfloaterexperiences.cpp b/indra/newview/llfloaterexperiences.cpp index ac79c9ab43..d973fe5b33 100644 --- a/indra/newview/llfloaterexperiences.cpp +++ b/indra/newview/llfloaterexperiences.cpp @@ -224,7 +224,9 @@ void LLFloaterExperiences::refreshContents() if(!lookup_url.empty()) { nameMap["experience_ids"]="Owned_Experiences_Tab"; - LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); + LLExperienceListResponder* responder = new LLExperienceListResponder(getDerivedHandle(), nameMap, "ExperienceAcquireFailed"); + responder->mCallback = boost::bind(&LLFloaterExperiences::checkPurchaseInfo, this, _1, _2); + LLHTTPClient::get(lookup_url, responder); } } } -- cgit v1.2.3 From f3288e268529d897f1a65443042c7d828b9e1090 Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 21 Nov 2014 12:40:30 +0200 Subject: ACME-1620 FIXED Newly acquired experience does not always show in Experience floater after being created --- indra/newview/llfloaterexperiences.cpp | 39 ++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'indra/newview/llfloaterexperiences.cpp') 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(), nameMap)); } - lookup_url = region->getCapability("GetAdminExperiences"); - if(!lookup_url.empty()) - { - nameMap["experience_ids"]="Admin_Experiences_Tab"; - LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), nameMap)); - } - - lookup_url = region->getCapability("GetCreatorExperiences"); - if(!lookup_url.empty()) - { - nameMap["experience_ids"]="Contrib_Experiences_Tab"; - LLHTTPClient::get(lookup_url, new LLExperienceListResponder(getDerivedHandle(), 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(), nameMap)); + } + } } void LLFloaterExperiences::sendPurchaseRequest() const @@ -325,3 +333,8 @@ void LLFloaterExperiences::sendPurchaseRequest() const LLHTTPClient::post(url, content, responder); } } + +LLFloaterExperiences* LLFloaterExperiences::findInstance() +{ + return LLFloaterReg::findTypedInstance("experiences"); +} -- cgit v1.2.3