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 ++++++++++++++++++++++++++++++++++++++++++++ indra/llui/llurlentry.h | 14 +++++++++++++ indra/llui/llurlregistry.cpp | 1 + 3 files changed, 63 insertions(+) (limited to 'indra/llui') 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); +} + + diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 8c6c32178a..48b4a1d531 100755 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -257,6 +257,20 @@ private: /*virtual*/ std::string getName(const LLAvatarName& avatar_name); }; +/// +/// LLUrlEntryExperienceProfile Describes a Second Life experience profile Url, e.g., +/// secondlife:///app/experience/0e346d8b-4433-4d66-a6b0-fd37083abc4c/profile +/// that displays the experience name +class LLUrlEntryExperienceProfile : public LLUrlEntryBase +{ +public: + LLUrlEntryExperienceProfile(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); +private: + void onExperienceDetails(const LLSD& experience_details); +}; + + /// /// LLUrlEntryGroup Describes a Second Life group Url, e.g., /// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 523ee5d78c..480f05bd72 100755 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -60,6 +60,7 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryPlace()); registerUrl(new LLUrlEntryInventory()); registerUrl(new LLUrlEntryObjectIM()); + registerUrl(new LLUrlEntryExperienceProfile()); //LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern, //so it should be registered in the end of list registerUrl(new LLUrlEntrySL()); -- cgit v1.2.3 From 977ee4cd6d20d6c3018c7d005ca40c523178678a Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 24 Sep 2013 23:25:29 -0700 Subject: Added stubs for llurlentry_test.cpp --- indra/llui/tests/llurlentry_test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/llui') diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index c3f0e92cb0..e8b9dde753 100755 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -32,9 +32,22 @@ #include "lltut.h" #include "../lluicolortable.h" #include "../llrender/lluiimage.h" +#include "../llmessage/llexperiencecache.h" #include + +namespace LLExperienceCache +{ + bool get( const LLUUID& key, LLSD& experience_data ) + { + return false; + } + + void get( const LLUUID& key, callback_slot_t slot ){} + +} + typedef std::map settings_map_t; settings_map_t LLUI::sSettingGroups; -- 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/llui/lltabcontainer.cpp | 5 +++++ indra/llui/lltabcontainer.h | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index fd98155704..148dc6b232 100755 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -2060,3 +2060,8 @@ void LLTabContainer::commitHoveredButton(S32 x, S32 y) } } } + +S32 LLTabContainer::getTotalTabWidth() const +{ + return mTotalTabWidth; +} diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 57862fc626..057809dc42 100755 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -182,7 +182,8 @@ public: LLPanel* getPanelByIndex(S32 index); S32 getIndexForPanel(LLPanel* panel); S32 getPanelIndexByTitle(const std::string& title); - LLPanel* getPanelByName(const std::string& name); + LLPanel* getPanelByName(const std::string& name); + S32 getTotalTabWidth() const; void setCurrentTabName(const std::string& name); void selectFirstTab(); @@ -287,7 +288,7 @@ private: S32 mMaxTabWidth; S32 mTotalTabWidth; - S32 mTabHeight; + S32 mTabHeight; // Padding under the text labels of tab buttons S32 mLabelPadBottom; -- 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') 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 d15a709cd730616e415eb65f3598274886f25ed6 Mon Sep 17 00:00:00 2001 From: dolphin Date: Fri, 21 Mar 2014 10:22:50 -0700 Subject: Fixed unit test --- indra/llui/tests/llurlentry_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index e8b9dde753..15f2354552 100755 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -39,9 +39,10 @@ namespace LLExperienceCache { - bool get( const LLUUID& key, LLSD& experience_data ) + const LLSD& get( const LLUUID& key) { - return false; + static LLSD boo; + return boo; } void get( const LLUUID& key, callback_slot_t slot ){} -- cgit v1.2.3 From 43d12faffebe327b32724abbb5612e0351a18976 Mon Sep 17 00:00:00 2001 From: Cho Date: Sat, 17 May 2014 04:21:56 +0100 Subject: Added COMBINE_WITH_NEW for notifications for ACME-1471 --- indra/llui/llnotifications.cpp | 32 +++++++++++++++++++++++++++++++- indra/llui/llnotifications.h | 4 ++++ indra/llui/llnotificationtemplate.h | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 025cd81d92..f4ad4a12db 100755 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -678,7 +678,7 @@ void LLNotification::respond(const LLSD& response) // and then call it functor(asLLSD(), response); } - else + else if (mCombinedNotifications.empty()) { // no registered responder return; @@ -700,6 +700,14 @@ void LLNotification::respond(const LLSD& response) } } + for (std::vector::const_iterator it = mCombinedNotifications.begin(); it != mCombinedNotifications.end(); ++it) + { + if ((*it)) + { + (*it)->respond(response); + } + } + update(); } @@ -1321,6 +1329,28 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload) } } break; + case LLNotification::COMBINE_WITH_NEW: + // Add to the existing unique notification with the data from this particular instance... + // This guarantees that duplicate notifications will be collapsed to the one + // most recently triggered + for (LLNotificationMap::iterator existing_it = mUniqueNotifications.find(pNotif->getName()); + existing_it != mUniqueNotifications.end(); + ++existing_it) + { + LLNotificationPtr existing_notification = existing_it->second; + if (pNotif != existing_notification + && pNotif->isEquivalentTo(existing_notification)) + { + // copy the notifications from the newest instance into the oldest + existing_notification->mCombinedNotifications.push_back(pNotif); + existing_notification->mCombinedNotifications.insert(existing_notification->mCombinedNotifications.end(), + pNotif->mCombinedNotifications.begin(), pNotif->mCombinedNotifications.end()); + + // pop up again + existing_notification->update(); + } + } + break; case LLNotification::KEEP_OLD: break; case LLNotification::CANCEL_OLD: diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index b0e8553a49..0bd7e934ea 100755 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -413,6 +413,9 @@ private: using the same mechanism. */ bool mTemporaryResponder; + + // keep track of other notifications combined with COMBINE_WITH_NEW + std::vector mCombinedNotifications; void init(const std::string& template_name, const LLSD& form_elements); @@ -559,6 +562,7 @@ public: typedef enum e_combine_behavior { REPLACE_WITH_NEW, + COMBINE_WITH_NEW, KEEP_OLD, CANCEL_OLD diff --git a/indra/llui/llnotificationtemplate.h b/indra/llui/llnotificationtemplate.h index 0315ddbea8..c23fc53763 100755 --- a/indra/llui/llnotificationtemplate.h +++ b/indra/llui/llnotificationtemplate.h @@ -43,6 +43,7 @@ struct LLNotificationTemplate static void declareValues() { declare("replace_with_new", LLNotification::REPLACE_WITH_NEW); + declare("combine_with_new", LLNotification::COMBINE_WITH_NEW); declare("keep_old", LLNotification::KEEP_OLD); declare("cancel_old", LLNotification::CANCEL_OLD); } -- 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') 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') 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') 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