From 48e1e10fd69aaea6ef22feb2518e80a120e9f999 Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 23 Sep 2013 11:44:21 -0700 Subject: Added LLUrlEntryExperienceProfile to link to experience profiles Added LLExperienceHandler to handle experience links Updated LLSidepanelItemInfo to use profile links --- indra/llui/llurlentry.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'indra/llui/llurlentry.cpp') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index b1cc502c4b..6f7d072d00 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -37,6 +37,7 @@ #include "lltrans.h" #include "lluicolortable.h" #include "message.h" +#include "llexperiencecache.h" #define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))" @@ -1200,3 +1201,50 @@ std::string LLUrlEntryIcon::getIcon(const std::string &url) LLStringUtil::trim(mIcon); return mIcon; } + +LLUrlEntryExperienceProfile::LLUrlEntryExperienceProfile() +{ + mPattern = boost::regex(APP_HEADER_REGEX "/experience/[\\da-f-]+/\\w+\\S*", + boost::regex::perl|boost::regex::icase); + mIcon = "Generic_Experience"; +} + +std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const LLUrlLabelCallback &cb ) +{ + if (!gCacheName) + { + // probably at the login screen, use short string for layout + return LLTrans::getString("LoadingData"); + } + + std::string experience_id_string = getIDStringFromUrl(url); + if (experience_id_string.empty()) + { + // something went wrong, just give raw url + return unescapeUrl(url); + } + + LLUUID experience_id(experience_id_string); + if (experience_id.isNull()) + { + return LLTrans::getString("ExperienceNameNull"); + } + + LLSD experience_details; + if(LLExperienceCache::get(experience_id, experience_details)) + { + return experience_details[LLExperienceCache::NAME].asString(); + } + + addObserver(experience_id_string, url, cb); + LLExperienceCache::get(experience_id, boost::bind(&LLUrlEntryExperienceProfile::onExperienceDetails, this, _1)); + return LLTrans::getString("LoadingData"); + +} + +void LLUrlEntryExperienceProfile::onExperienceDetails( const LLSD& experience_details ) +{ + callObservers(experience_details[LLExperienceCache::EXPERIENCE_ID].asString(), experience_details[LLExperienceCache::NAME].asString(), LLStringUtil::null); +} + + -- cgit v1.2.3 From 74dcc04e69b845e62d25e83b615399f8a5d26d21 Mon Sep 17 00:00:00 2001 From: dolphin Date: Mon, 17 Mar 2014 15:57:15 -0700 Subject: Updated experience cache to get a const reference to xp data --- indra/llui/llurlentry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/llurlentry.cpp') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index f5baf17d8f..0af2cd42aa 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1231,8 +1231,8 @@ std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const return LLTrans::getString("ExperienceNameNull"); } - LLSD experience_details; - if(LLExperienceCache::get(experience_id, experience_details)) + const LLSD& experience_details = LLExperienceCache::get(experience_id); + if(!experience_details.isUndefined()) { return experience_details[LLExperienceCache::NAME].asString(); } -- cgit v1.2.3 From f10f3d2fdec90b0ca4d34e6b90642e7c45896d9e Mon Sep 17 00:00:00 2001 From: Cho Date: Mon, 2 Jun 2014 21:16:28 +0100 Subject: Added URL menu for experience profile links for ACME-1469 --- indra/llui/llurlentry.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/llurlentry.cpp') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index eba715f58d..67da98b95a 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1208,6 +1208,7 @@ LLUrlEntryExperienceProfile::LLUrlEntryExperienceProfile() mPattern = boost::regex(APP_HEADER_REGEX "/experience/[\\da-f-]+/\\w+\\S*", boost::regex::perl|boost::regex::icase); mIcon = "Generic_Experience"; + mMenuName = "menu_url_experience.xml"; } std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const LLUrlLabelCallback &cb ) -- cgit v1.2.3 From 89eac2548a9b66d8bab27a7e8d7d1ed2159e9515 Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 20 Aug 2014 01:11:27 +0100 Subject: Made it possible to search for experiences with an empty search string, and show experiences with blank names as (untitled experience) for ACME-1585 --- indra/llui/llurlentry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui/llurlentry.cpp') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 67da98b95a..be08d92c78 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1235,7 +1235,8 @@ std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const const LLSD& experience_details = LLExperienceCache::get(experience_id); if(!experience_details.isUndefined()) { - return experience_details[LLExperienceCache::NAME].asString(); + std::string experience_name_string = experience_details[LLExperienceCache::NAME].asString(); + return experience_name_string.empty() ? LLTrans::getString("ExperienceNameUntitled") : experience_name_string; } addObserver(experience_id_string, url, cb); -- cgit v1.2.3 From c2a516aee1f8c1e26124a77f62962944137ef960 Mon Sep 17 00:00:00 2001 From: dolphin Date: Thu, 6 Nov 2014 16:25:17 -0800 Subject: ACME-1635: Trusted Experiences now referred to as Key Experiences. --- indra/llui/llurlentry.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llui/llurlentry.cpp') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index be08d92c78..1389ec4bb2 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1247,7 +1247,12 @@ std::string LLUrlEntryExperienceProfile::getLabel( const std::string &url, const void LLUrlEntryExperienceProfile::onExperienceDetails( const LLSD& experience_details ) { - callObservers(experience_details[LLExperienceCache::EXPERIENCE_ID].asString(), experience_details[LLExperienceCache::NAME].asString(), LLStringUtil::null); + std::string name = experience_details[LLExperienceCache::NAME].asString(); + if(name.empty()) + { + name = LLTrans::getString("ExperienceNameUntitled"); + } + callObservers(experience_details[LLExperienceCache::EXPERIENCE_ID].asString(), name, LLStringUtil::null); } -- cgit v1.2.3