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.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/llmessage/llexperiencecache.cpp | 21 +++++++++------------ indra/llmessage/llexperiencecache.h | 2 +- indra/llui/llurlentry.cpp | 4 ++-- indra/newview/llpreviewscript.cpp | 20 +++++++++++--------- 4 files changed, 23 insertions(+), 24 deletions(-) (limited to 'indra/llui/llurlentry.cpp') diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 648e2039a6..c8deaac1ef 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -320,9 +320,9 @@ namespace LLExperienceCache for ( ; it != mKeys.end(); ++it) { - LLSD exp; + LLSD exp = get(it->first); //leave the properties alone if we already have a cache entry for this xp - if(!get(it->first, exp)) + if(exp.isUndefined()) { exp[PROPERTIES]=PROPERTY_INVALID; } @@ -563,24 +563,21 @@ namespace LLExperienceCache LL_WARNS("ExperienceCache") << ": Ignoring cache insert of experience which is missing " << EXPERIENCE_ID << LL_ENDL; } } - - bool get( const LLUUID& key, LLSD& experience_data ) + static LLSD empty; + const LLSD& get(const LLUUID& key) { - if(key.isNull()) return false; + if(key.isNull()) return empty; cache_t::const_iterator it = sCache.find(key); - + if (it != sCache.end()) { - experience_data = it->second; - return true; + return it->second; } - + fetch(key); - return false; + return empty; } - - void get( const LLUUID& key, callback_slot_t slot ) { if(key.isNull()) return; diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index e6129796b7..e669ee888e 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -89,7 +89,7 @@ namespace LLExperienceCache void erase(const LLUUID& key); bool fetch(const LLUUID& key, bool refresh=false); void insert(const LLSD& experience_data); - bool get(const LLUUID& key, LLSD& experience_data); + const LLSD& get(const LLUUID& key); // If name information is in cache, callback will be called immediately. void get(const LLUUID& key, callback_slot_t slot); 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(); } diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index e59c1c21f6..a4798f3911 100755 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1319,6 +1319,7 @@ void LLLiveLSLEditor::updateExperiencePanel() mExperienceEnabled->setToolTip(getString("experience_enabled")); mExperienceEnabled->setEnabled(getIsModifiable()); mExperiences->setVisible(TRUE); + mExperienceEnabled->set(TRUE); buildExperienceList(); } } @@ -1328,7 +1329,6 @@ void LLLiveLSLEditor::buildExperienceList() mExperiences->clearRows(); bool foundAssociated=false; const LLUUID& associated = mScriptEd->getAssociatedExperience(); - LLSD experience; LLUUID last; LLScrollListItem* item; for(LLSD::array_const_iterator it = mExperienceIds.beginArray(); it != mExperienceIds.endArray(); ++it) @@ -1340,21 +1340,23 @@ void LLLiveLSLEditor::buildExperienceList() foundAssociated = true; position = ADD_TOP; } - if(LLExperienceCache::get(id, experience)) - { - mExperiences->add(experience[LLExperienceCache::NAME].asString(), id, position); - } - else + + const LLSD& experience = LLExperienceCache::get(id); + if(experience.isUndefined()) { mExperiences->add(getString("loading"), id, position); last = id; } - + else + { + mExperiences->add(experience[LLExperienceCache::NAME].asString(), id, position); + } } if(!foundAssociated ) - { - if(LLExperienceCache::get(associated, experience)) + { + const LLSD& experience = LLExperienceCache::get(associated); + if(experience.isDefined()) { item=mExperiences->add(experience[LLExperienceCache::NAME].asString(), associated, ADD_TOP); } -- cgit v1.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 + indra/newview/llfloaterexperienceprofile.cpp | 3 ++- indra/newview/skins/default/xui/en/menu_url_experience.xml | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 indra/newview/skins/default/xui/en/menu_url_experience.xml (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 ) diff --git a/indra/newview/llfloaterexperienceprofile.cpp b/indra/newview/llfloaterexperienceprofile.cpp index c14d77a944..f80fdd9cfe 100644 --- a/indra/newview/llfloaterexperienceprofile.cpp +++ b/indra/newview/llfloaterexperienceprofile.cpp @@ -463,7 +463,8 @@ void LLFloaterExperienceProfile::refreshExperience( const LLSD& experience ) LLTextBox* child = getChild(TF_NAME); - child->setText(experience[LLExperienceCache::NAME].asString()); + //child->setText(experience[LLExperienceCache::NAME].asString()); + child->setText(LLSLURL("experience", experience[LLExperienceCache::EXPERIENCE_ID], "profile").getSLURLString()); LLLineEditor* linechild = getChild(EDIT TF_NAME); linechild->setText(experience[LLExperienceCache::NAME].asString()); diff --git a/indra/newview/skins/default/xui/en/menu_url_experience.xml b/indra/newview/skins/default/xui/en/menu_url_experience.xml new file mode 100644 index 0000000000..f4d50e1603 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_url_experience.xml @@ -0,0 +1,12 @@ + + + + + + -- cgit v1.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 ++- indra/newview/llpanelexperiencepicker.cpp | 4 ++-- indra/newview/skins/default/xui/en/strings.xml | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) (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); diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp index 0a572a8a5c..7592aaa9d0 100644 --- a/indra/newview/llpanelexperiencepicker.cpp +++ b/indra/newview/llpanelexperiencepicker.cpp @@ -108,7 +108,7 @@ BOOL LLPanelExperiencePicker::postBuild() getChild(TEXT_EDIT)->setKeystrokeCallback( boost::bind(&LLPanelExperiencePicker::editKeystroke, this, _1, _2),NULL); childSetAction(BTN_FIND, boost::bind(&LLPanelExperiencePicker::onBtnFind, this)); - getChildView(BTN_FIND)->setEnabled(FALSE); + getChildView(BTN_FIND)->setEnabled(TRUE); LLScrollListCtrl* searchresults = getChild(LIST_RESULTS); searchresults->setDoubleClickCallback( boost::bind(&LLPanelExperiencePicker::onBtnSelect, this)); @@ -140,7 +140,7 @@ BOOL LLPanelExperiencePicker::postBuild() void LLPanelExperiencePicker::editKeystroke( class LLLineEditor* caller, void* user_data ) { - getChildView(BTN_FIND)->setEnabled(caller->getText().size() > 0); + getChildView(BTN_FIND)->setEnabled(caller->getText().size() >= 0); } void LLPanelExperiencePicker::onBtnFind() diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 72cebb1060..1bf1ee930c 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4028,6 +4028,7 @@ Try enclosing path to the editor with double quotes. Experience (no experience) + (untitled experience) Grid-wide ALLOWED BLOCKED -- cgit v1.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 ++++++- indra/newview/skins/default/xui/en/notifications.xml | 2 ++ .../newview/skins/default/xui/en/panel_experience_list_editor.xml | 2 +- indra/newview/skins/default/xui/en/panel_region_experiences.xml | 6 +++--- 4 files changed, 12 insertions(+), 5 deletions(-) (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); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 8960fad02b..fa5c1cda4a 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7298,6 +7298,8 @@ Unable to acquire a new experience: You do not have access to this destination. You may be allowed into the region by Accepting an experience below: [EXPERIENCE_LIST] + +Other Key Experiences may be available. diff --git a/indra/newview/skins/default/xui/en/panel_experience_list_editor.xml b/indra/newview/skins/default/xui/en/panel_experience_list_editor.xml index 128c721992..e6b88ae534 100644 --- a/indra/newview/skins/default/xui/en/panel_experience_list_editor.xml +++ b/indra/newview/skins/default/xui/en/panel_experience_list_editor.xml @@ -23,7 +23,7 @@ - Trusted Experiences: + Key Experiences: diff --git a/indra/newview/skins/default/xui/en/panel_region_experiences.xml b/indra/newview/skins/default/xui/en/panel_region_experiences.xml index 9d06ce6b0c..d909731809 100644 --- a/indra/newview/skins/default/xui/en/panel_region_experiences.xml +++ b/indra/newview/skins/default/xui/en/panel_region_experiences.xml @@ -12,11 +12,11 @@ width="480"> -Any Experience may be Trusted. +Any Experience may be Key. -Trusted Experiences have permission to run on this estate. +Key Experiences have permission to run on this estate. -Additionally, if the estate does not allow public access, Residents participating in any Trusted Experience may enter the estate and can remain as long as they are in the Experience. +Additionally, if the estate does not allow public access, Residents participating in any Key Experience may enter the estate and can remain as long as they are in a Key Experience. -- cgit v1.3