From 2cde962d5db94baf860eb94fecaf9671548b2c53 Mon Sep 17 00:00:00 2001 From: "dolphin@dolphin-THINK.lindenlab.com" Date: Mon, 19 Nov 2012 08:06:42 -0800 Subject: Test populating the experience keys UI with avatar name data. --- indra/newview/llstartup.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 42648b82c2..7b12d5509e 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -47,6 +47,7 @@ #include "llares.h" #include "llavatarnamecache.h" +#include "llexperiencecache.h" #include "lllandmark.h" #include "llcachename.h" #include "lldir.h" @@ -1398,6 +1399,9 @@ bool idle_startup() LLStartUp::initNameCache(); display_startup(); + LLStartUp::initExperienceCache(); + display_startup(); + // update the voice settings *after* gCacheName initialization // so that we can construct voice UI that relies on the name cache LLVoiceClient::getInstance()->updateSettings(); @@ -2809,6 +2813,13 @@ void LLStartUp::initNameCache() LLAvatarNameCache::setUseDisplayNames(gSavedSettings.getBOOL("UseDisplayNames")); } + +void LLStartUp::initExperienceCache() +{ + LLAppViewer::instance()->loadExperienceCache(); + LLExperienceCache::initClass(false); +} + void LLStartUp::cleanupNameCache() { LLAvatarNameCache::cleanupClass(); @@ -3507,3 +3518,4 @@ void transition_back_to_login_panel(const std::string& emsg) reset_login(); // calls LLStartUp::setStartupState( STATE_LOGIN_SHOW ); gSavedSettings.setBOOL("AutoLogin", FALSE); } + -- cgit v1.3 From 2566e0d08fd7e8a47fc690a8163c1273d91141c2 Mon Sep 17 00:00:00 2001 From: "dolphin@dolphin-THINK.lindenlab.com" Date: Mon, 26 Nov 2012 08:42:23 -0800 Subject: Added code for simulator integration. Added signals for cache update callbacks. Added expiration timers for cached experiences. --- indra/llmessage/llexperiencecache.cpp | 290 ++++++++++++++++++++++++++++++---- indra/llmessage/llexperiencecache.h | 18 ++- indra/newview/llstartup.cpp | 2 +- 3 files changed, 280 insertions(+), 30 deletions(-) (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp index 0d8f76c7e2..562c4c40df 100644 --- a/indra/llmessage/llexperiencecache.cpp +++ b/indra/llmessage/llexperiencecache.cpp @@ -31,6 +31,7 @@ #include "llsdserialize.h" #include #include +#include "boost\tokenizer.hpp" #include "llexperiencecache.h" @@ -38,7 +39,6 @@ namespace LLExperienceCache { - bool sRunning = false; std::string sLookupURL; typedef std::set ask_queue_t; @@ -47,29 +47,45 @@ namespace LLExperienceCache typedef std::map pending_queue_t; pending_queue_t sPendingQueue; - cache_t sCache; + int sMaximumLookups = 10; LLFrameTimer sRequestTimer; + // Periodically clean out expired entries from the cache + LLFrameTimer sEraseExpiredTimer; + + // May have multiple callbacks for a single ID, which are + // represented as multiple slots bound to the signal. + // Avoid copying signals via pointers. + typedef std::map signal_map_t; + signal_map_t sSignalMap; + + bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age); + void eraseExpired(); - void processExperience( const LLUUID& agent_id, const LLExperienceData& experience, bool add_to_cache ) + void processExperience( const LLUUID& agent_id, const LLExperienceData& experience ) { - if(add_to_cache) - { - sCache[agent_id]=experience; + sCache[agent_id]=experience; - sPendingQueue.erase(agent_id); + sPendingQueue.erase(agent_id); + + //signal + signal_map_t::iterator sig_it = sSignalMap.find(agent_id); + if (sig_it != sSignalMap.end()) + { + callback_signal_t* signal = sig_it->second; + (*signal)(agent_id, experience); + sSignalMap.erase(agent_id); - //signal + delete signal; } } - void initClass( bool running ) + void initClass( ) { - sRunning = false; } const cache_t& getCached() @@ -77,6 +93,91 @@ namespace LLExperienceCache return sCache; } + void setMaximumLookups( int maximumLookups) + { + sMaximumLookups = maximumLookups; + } + + + bool expirationFromCacheControl(LLSD headers, F64 *expires) + { + // Allow the header to override the default + LLSD cache_control_header = headers["cache-control"]; + if (cache_control_header.isDefined()) + { + S32 max_age = 0; + std::string cache_control = cache_control_header.asString(); + if (max_age_from_cache_control(cache_control, &max_age)) + { + LL_DEBUGS("ExperienceCache") + << "got expiration from headers, max_age " << max_age + << LL_ENDL; + F64 now = LLFrameTimer::getTotalSeconds(); + *expires = now + (F64)max_age; + return true; + } + } + return false; + } + + + static const std::string MAX_AGE("max-age"); + static const boost::char_separator EQUALS_SEPARATOR("="); + static const boost::char_separator COMMA_SEPARATOR(","); + + bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age) + { + // Split the string on "," to get a list of directives + typedef boost::tokenizer > tokenizer; + tokenizer directives(cache_control, COMMA_SEPARATOR); + + tokenizer::iterator token_it = directives.begin(); + for ( ; token_it != directives.end(); ++token_it) + { + // Tokens may have leading or trailing whitespace + std::string token = *token_it; + LLStringUtil::trim(token); + + if (token.compare(0, MAX_AGE.size(), MAX_AGE) == 0) + { + // ...this token starts with max-age, so let's chop it up by "=" + tokenizer subtokens(token, EQUALS_SEPARATOR); + tokenizer::iterator subtoken_it = subtokens.begin(); + + // Must have a token + if (subtoken_it == subtokens.end()) return false; + std::string subtoken = *subtoken_it; + + // Must exactly equal "max-age" + LLStringUtil::trim(subtoken); + if (subtoken != MAX_AGE) return false; + + // Must have another token + ++subtoken_it; + if (subtoken_it == subtokens.end()) return false; + subtoken = *subtoken_it; + + // Must be a valid integer + // *NOTE: atoi() returns 0 for invalid values, so we have to + // check the string first. + // *TODO: Do servers ever send "0000" for zero? We don't handle it + LLStringUtil::trim(subtoken); + if (subtoken == "0") + { + *max_age = 0; + return true; + } + S32 val = atoi( subtoken.c_str() ); + if (val > 0 && val < S32_MAX) + { + *max_age = val; + return true; + } + return false; + } + } + return false; + } void importFile(std::istream& istr) @@ -146,7 +247,7 @@ namespace LLExperienceCache LL_DEBUGS("ExperienceCache") << __FUNCTION__ << "Received result for " << agent_id << "display '" << experience.mDisplayName << "'" << LL_ENDL ; - processExperience(agent_id, experience, true); + processExperience(agent_id, experience); } } @@ -154,13 +255,74 @@ namespace LLExperienceCache S32 num_unresolved = unresolved_agents.size(); if(num_unresolved > 0) { - LL_DEBUGS("ExperienceCache") << __FUNCTION__ << "Ignoreing " << num_unresolved + LL_DEBUGS("ExperienceCache") << __FUNCTION__ << "Ignoring " << num_unresolved << " bad ids" << LL_ENDL ; } LL_DEBUGS("ExperienceCache") << __FUNCTION__ << sCache.size() << " cached experiences" << LL_ENDL; } + void error(U32 status, const std::string& reason) + { + // We're going to construct a dummy record and cache it for a while, + // either briefly for a 503 Service Unavailable, or longer for other + // errors. + F64 retry_timestamp = errorRetryTimestamp(status); + + LLExperienceData experience; + experience.mDisplayName = LLExperienceCache::DUMMY_NAME; + experience.mDescription = LLExperienceCache::DUMMY_NAME; + experience.mExpires = retry_timestamp; + + // Add dummy records for all agent IDs in this request + std::vector::const_iterator it = mAgentIds.begin(); + for ( ; it != mAgentIds.end(); ++it) + { + LLExperienceCache::processExperience((*it), experience); + } + } + + // Return time to retry a request that generated an error, based on + // error type and headers. Return value is seconds-since-epoch. + F64 errorRetryTimestamp(S32 status) + { + F64 now = LLFrameTimer::getTotalSeconds(); + + // Retry-After takes priority + LLSD retry_after = mHeaders["retry-after"]; + if (retry_after.isDefined()) + { + // We only support the delta-seconds type + S32 delta_seconds = retry_after.asInteger(); + if (delta_seconds > 0) + { + // ...valid delta-seconds + return now + F64(delta_seconds); + } + } + + // If no Retry-After, look for Cache-Control max-age + F64 expires = 0.0; + if (LLExperienceCache::expirationFromCacheControl(mHeaders, &expires)) + { + return expires; + } + + // No information in header, make a guess + if (status == 503) + { + // ...service unavailable, retry soon + const F64 SERVICE_UNAVAILABLE_DELAY = 600.0; // 10 min + return now + SERVICE_UNAVAILABLE_DELAY; + } + else + { + // ...other unexpected error + const F64 DEFAULT_DELAY = 3600.0; // 1 hour + return now + DEFAULT_DELAY; + } + } + private: std::vector mAgentIds; LLSD mHeaders; @@ -186,13 +348,15 @@ namespace LLExperienceCache std::string arg="?ids="; - for(ask_queue_t::const_iterator it = sAskQueue.begin(); it != sAskQueue.end() ; ++it) + int request_count = 0; + for(ask_queue_t::const_iterator it = sAskQueue.begin() ; it != sAskQueue.end() && request_count < sMaximumLookups; ++it) { const LLUUID& agent_id = *it; url += arg; url += agent_id.asString(); agent_ids.push_back(agent_id); + request_count++; sPendingQueue[agent_id] = now; @@ -244,7 +408,20 @@ namespace LLExperienceCache void idle() { - sRunning = true; + + const F32 SECS_BETWEEN_REQUESTS = 0.1f; + if (!sRequestTimer.checkExpirationAndReset(SECS_BETWEEN_REQUESTS)) + { + return; + } + + // Must be large relative to above + const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds + if (sEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT)) + { + eraseExpired(); + } + if(!sAskQueue.empty()) { @@ -257,6 +434,25 @@ namespace LLExperienceCache sCache.erase(agent_id); } + void eraseExpired() + { + S32 expired_count = 0; + F64 now = LLFrameTimer::getTotalSeconds(); + cache_t::iterator it = sCache.begin(); + while (it != sCache.end()) + { + cache_t::iterator cur = it; + ++it; + const LLExperienceData& experience = cur->second; + if (experience.mExpires < now) + { + sCache.erase(cur); + expired_count++; + } + } + } + + void fetch( const LLUUID& agent_id ) { LL_DEBUGS("ExperienceCache") << __FUNCTION__ << "queue request for agent" << agent_id << LL_ENDL ; @@ -270,16 +466,12 @@ namespace LLExperienceCache bool get( const LLUUID& agent_id, LLExperienceData* experience_data ) { - if(sRunning) + cache_t::const_iterator it = sCache.find(agent_id); + if (it != sCache.end()) { - - cache_t::const_iterator it = sCache.find(agent_id); - if (it != sCache.end()) - { - llassert(experience_data); - *experience_data = it->second; - return true; - } + llassert(experience_data); + *experience_data = it->second; + return true; } if(!isRequestPending(agent_id)) @@ -291,12 +483,54 @@ namespace LLExperienceCache } + + void get( const LLUUID& agent_id, callback_slot_t slot ) + { + cache_t::const_iterator it = sCache.find(agent_id); + if (it != sCache.end()) + { + // ...name already exists in cache, fire callback now + callback_signal_t signal; + signal.connect(slot); + signal(agent_id, it->second); + return; + } + + // schedule a request + if (!isRequestPending(agent_id)) + { + sAskQueue.insert(agent_id); + } + + // always store additional callback, even if request is pending + signal_map_t::iterator sig_it = sSignalMap.find(agent_id); + if (sig_it == sSignalMap.end()) + { + // ...new callback for this id + callback_signal_t* signal = new callback_signal_t(); + signal->connect(slot); + sSignalMap[agent_id] = signal; + } + else + { + // ...existing callback, bind additional slot + callback_signal_t* signal = sig_it->second; + signal->connect(slot); + } + } + } +static const std::string EXPERIENCE_NAME("username"); +static const std::string EXPERIENCE_DESCRIPTION("display_name"); +static const std::string EXPERIENCE_EXPIRATION("display_name_expires"); + bool LLExperienceData::fromLLSD( const LLSD& sd ) { - mDisplayName = sd["display_name"].asString(); - mDescription = sd["username"].asString(); + mDisplayName = sd[EXPERIENCE_NAME].asString(); + mDescription = sd[EXPERIENCE_DESCRIPTION].asString(); + LLDate expiration = sd[EXPERIENCE_EXPIRATION]; + mExpires = expiration.secondsSinceEpoch(); if(mDisplayName.empty() || mDescription.empty()) return false; @@ -307,7 +541,9 @@ bool LLExperienceData::fromLLSD( const LLSD& sd ) LLSD LLExperienceData::asLLSD() const { LLSD sd; - sd["display_name"] = mDisplayName; - sd["username"] = mDescription.substr(0, llmin(mDescription.size(),mDescription.find(" %"))); + sd[EXPERIENCE_NAME] = mDisplayName; + sd[EXPERIENCE_DESCRIPTION] = mDescription.substr(0, llmin(mDescription.size(),mDescription.find(" %"))); + sd[EXPERIENCE_EXPIRATION] = LLDate(mExpires); + return sd; } diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 799cdea13a..2f2647d5a3 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -30,6 +30,7 @@ #define LL_LLEXPERIENCECACHE_H #include +#include class LLUUID; @@ -43,27 +44,40 @@ public: std::string mDisplayName; std::string mDescription; + F64 mExpires; }; namespace LLExperienceCache { + // dummy name used when we have nothing else + const std::string DUMMY_NAME = "\?\?\?"; + // Callback types for get() below + typedef boost::signals2::signal< + void (const LLUUID& agent_id, const LLExperienceData& experience)> + callback_signal_t; + typedef callback_signal_t::slot_type callback_slot_t; + typedef std::map cache_t; + + void setLookupURL(const std::string& lookup_url); bool hasLookupURL(); + void setMaximumLookups(int maximumLookups); void idle(); void exportFile(std::ostream& ostr); void importFile(std::istream& istr); - void initClass(bool running); + void initClass(); void erase(const LLUUID& agent_id); void fetch(const LLUUID& agent_id); void insert(const LLUUID& agent_id, const LLExperienceData& experience_data); bool get(const LLUUID& agent_id, LLExperienceData* experience_data); - typedef std::map cache_t; + // If name information is in cache, callback will be called immediately. + void get(const LLUUID& agent_id, callback_slot_t slot); const cache_t& getCached(); }; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index ec8415b28e..a58a26b6fe 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2817,7 +2817,7 @@ void LLStartUp::initNameCache() void LLStartUp::initExperienceCache() { LLAppViewer::instance()->loadExperienceCache(); - LLExperienceCache::initClass(false); + LLExperienceCache::initClass(); } void LLStartUp::cleanupNameCache() -- cgit v1.3 From b2591ca63c498ab606bf595e0b2e729e76caea24 Mon Sep 17 00:00:00 2001 From: dolphin Date: Tue, 18 Mar 2014 14:12:22 -0700 Subject: Added a default message handler for experience logs. Currently just forwards the notification. --- indra/newview/CMakeLists.txt | 4 + indra/newview/llexperiencelog.cpp | 28 +++++ indra/newview/llexperiencelog.h | 33 ++++++ indra/newview/llpanelexperiencelog.cpp | 118 +++++++++++++++++++++ indra/newview/llpanelexperiencelog.h | 48 +++++++++ indra/newview/llstartup.cpp | 6 +- indra/newview/llstartup.h | 2 +- .../newview/skins/default/xui/en/notifications.xml | 20 ++++ indra/newview/skins/default/xui/en/strings.xml | 10 +- 9 files changed, 265 insertions(+), 4 deletions(-) create mode 100644 indra/newview/llexperiencelog.cpp create mode 100644 indra/newview/llexperiencelog.h create mode 100644 indra/newview/llpanelexperiencelog.cpp create mode 100644 indra/newview/llpanelexperiencelog.h (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 868a26f47d..3a18133193 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -190,6 +190,7 @@ set(viewer_SOURCE_FILES lleventpoll.cpp llexpandabletextbox.cpp llexperienceassociationresponder.cpp + llexperiencelog.cpp llexternaleditor.cpp llface.cpp llfacebookconnect.cpp @@ -405,6 +406,7 @@ set(viewer_SOURCE_FILES llpanelcontents.cpp llpaneleditwearable.cpp llpanelexperiencelisteditor.cpp + llpanelexperiencelog.cpp llpanelexperiences.cpp llpanelface.cpp llpanelgenerictip.cpp @@ -785,6 +787,7 @@ set(viewer_HEADER_FILES lleventpoll.h llexpandabletextbox.h llexperienceassociationresponder.h + llexperiencelog.h llexternaleditor.h llface.h llfacebookconnect.h @@ -993,6 +996,7 @@ set(viewer_HEADER_FILES llpanelcontents.h llpaneleditwearable.h llpanelexperiencelisteditor.h + llpanelexperiencelog.h llpanelexperiences.h llpanelface.h llpanelgenerictip.h diff --git a/indra/newview/llexperiencelog.cpp b/indra/newview/llexperiencelog.cpp new file mode 100644 index 0000000000..9842bdc31c --- /dev/null +++ b/indra/newview/llexperiencelog.cpp @@ -0,0 +1,28 @@ +/** + * @file llexperiencelog.cpp + * @brief llexperiencelog implementation + * + * $LicenseInfo:firstyear=2014&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2014, 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 "llexperiencelog.h" diff --git a/indra/newview/llexperiencelog.h b/indra/newview/llexperiencelog.h new file mode 100644 index 0000000000..73d82f4fad --- /dev/null +++ b/indra/newview/llexperiencelog.h @@ -0,0 +1,33 @@ +/** + * @file llexperiencelog.h + * @brief llexperiencelog and related class definitions + * + * $LicenseInfo:firstyear=2014&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2014, 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$ + */ + + + +#ifndef LL_LLEXPERIENCELOG_H +#define LL_LLEXPERIENCELOG_H + + +#endif // LL_LLEXPERIENCELOG_H diff --git a/indra/newview/llpanelexperiencelog.cpp b/indra/newview/llpanelexperiencelog.cpp new file mode 100644 index 0000000000..009889a59f --- /dev/null +++ b/indra/newview/llpanelexperiencelog.cpp @@ -0,0 +1,118 @@ +/** + * @file llpanelexperiencelog.cpp + * @brief llpanelexperiencelog + * + * $LicenseInfo:firstyear=2014&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2014, 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 "llpanelexperiencelog.h" +#include "lldispatcher.h" +#include "llsdserialize.h" +#include "llviewergenericmessage.h" +#include "llnotificationsutil.h" +#include "lltrans.h" + + +class LLExperienceLogDispatchHandler : public LLDispatchHandler +{ +public: + virtual bool operator()( + const LLDispatcher* dispatcher, + const std::string& key, + const LLUUID& invoice, + const sparam_t& strings) + { + LLSD message; + + sparam_t::const_iterator it = strings.begin(); + if(it != strings.end()){ + const std::string& llsdRaw = *it++; + std::istringstream llsdData(llsdRaw); + if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length())) + { + llwarns << "LLExperienceLogDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << llendl; + } + } + message["public_id"] = invoice; + + // Object Name + if(it != strings.end()) + { + message["ObjectName"] = *it++; + } + + // parcel Name + if(it != strings.end()) + { + message["ParcelName"] = *it++; + } + + LLExperienceLog::instance().handleExperienceMessage(message); + return true; + } +}; + +static LLExperienceLogDispatchHandler experience_log_dispatch_handler; + +void LLExperienceLog::handleExperienceMessage(LLSD& message) +{ + std::ostringstream str; + if(message.has("Permission")) + { + str << "ExperiencePermission" << message["Permission"].asInteger(); + std::string entry; + if(LLTrans::findString(entry, str.str())) + { + str.str(entry); + } + else + { + str.str(); + } + } + + if(str.str().empty()) + { + str.str(LLTrans::getString("ExperiencePermissionUnknown", message)); + } + + message["EventType"] = str.str(); + if(message.has("IsAttachment") && message["IsAttachment"].asBoolean()) + { + LLNotificationsUtil::add("ExperienceEventAttachment", message); + } + else + { + LLNotificationsUtil::add("ExperienceEvent", message); + } +} + +LLExperienceLog::LLExperienceLog() +{ +} + +void LLExperienceLog::initialize() +{ + gGenericDispatcher.addHandler("ExperienceEvent", &experience_log_dispatch_handler); +} diff --git a/indra/newview/llpanelexperiencelog.h b/indra/newview/llpanelexperiencelog.h new file mode 100644 index 0000000000..7d2a24872a --- /dev/null +++ b/indra/newview/llpanelexperiencelog.h @@ -0,0 +1,48 @@ +/** + * @file llpanelexperiencelog.h + * @brief llpanelexperiencelog and related class definitions + * + * $LicenseInfo:firstyear=2014&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2014, 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$ + */ + + + +#ifndef LL_LLPANELEXPERIENCELOG_H +#define LL_LLPANELEXPERIENCELOG_H + +#include "llsingleton.h" + + + +class LLExperienceLog : public LLSingleton +{ + friend class LLSingleton; +protected: + LLExperienceLog(); + +public: + void initialize(); + void handleExperienceMessage(LLSD& message); +}; + + +#endif // LL_LLPANELEXPERIENCELOG_H diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index a9ac8d6ea7..b5f976080a 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -198,6 +198,7 @@ #include "llevents.h" #include "llstartuplistener.h" #include "lltoolbarview.h" +#include "llpanelexperiencelog.h" #if LL_WINDOWS #include "lldxhardware.h" @@ -1412,7 +1413,7 @@ bool idle_startup() LLStartUp::initNameCache(); display_startup(); - LLStartUp::initExperienceCache(); + LLStartUp::initExperiences(); display_startup(); // update the voice settings *after* gCacheName initialization @@ -2829,10 +2830,11 @@ void LLStartUp::initNameCache() } -void LLStartUp::initExperienceCache() +void LLStartUp::initExperiences() { LLAppViewer::instance()->loadExperienceCache(); LLExperienceCache::initClass(); + LLExperienceLog::instance().initialize(); } void LLStartUp::cleanupNameCache() diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 00e03bcda6..94ecbcd333 100755 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -91,7 +91,7 @@ public: static void fontInit(); static void initNameCache(); - static void initExperienceCache(); + static void initExperiences(); static void cleanupNameCache(); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e0cc2229d5..b230e36cc7 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7069,6 +7069,26 @@ Unable to acquire a new experience: text="Allowed into a region by an experience"/> + + + An object was allowed to [EventType] by the secondlife:///app/experience/[public_id]/profile experience. + Owner: secondlife:///app/agent/[OwnerID]/inspect + Object Name: [ObjectName] + Parcel Name: [ParcelName] + + + + An attachment was allowed to [EventType] by the secondlife:///app/experience/[public_id]/profile experience. + Owner: secondlife:///app/agent/[OwnerID]/inspect + ADMIN RECENT OWNED - + take over your controls + override animations on your avatar + attach to your avatar + track your camera + control your camera + teleport you + automatically accept experience permissions + perform an unknown operation: [Permission] + Conversations are not being logged. To begin keeping a log, choose "Save: Log only" or "Save: Log and transcripts" under Preferences > Chat. -- cgit v1.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/llexperiencelog.cpp | 209 +++++++++++++++++ indra/newview/llexperiencelog.h | 44 ++++ indra/newview/llfloaterexperiences.cpp | 2 + indra/newview/llfloaterreporter.cpp | 12 +- indra/newview/llfloaterreporter.h | 4 +- indra/newview/llpanelexperiencelog.cpp | 246 ++++++++++++++++----- indra/newview/llpanelexperiencelog.h | 36 ++- indra/newview/llstartup.cpp | 8 +- .../default/xui/en/floater_experienceprofile.xml | 4 +- .../newview/skins/default/xui/en/notifications.xml | 4 +- .../skins/default/xui/en/panel_experience_log.xml | 152 +++++++++++++ indra/newview/skins/default/xui/en/strings.xml | 10 +- 12 files changed, 648 insertions(+), 83 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/panel_experience_log.xml (limited to 'indra/newview/llstartup.cpp') diff --git a/indra/newview/llexperiencelog.cpp b/indra/newview/llexperiencelog.cpp index 9842bdc31c..110ce46835 100644 --- a/indra/newview/llexperiencelog.cpp +++ b/indra/newview/llexperiencelog.cpp @@ -26,3 +26,212 @@ #include "llviewerprecompiledheaders.h" #include "llexperiencelog.h" + +#include "lldispatcher.h" +#include "llsdserialize.h" +#include "llviewergenericmessage.h" +#include "llnotificationsutil.h" +#include "lltrans.h" +#include "llerror.h" +#include "lldate.h" + + +class LLExperienceLogDispatchHandler : public LLDispatchHandler +{ +public: + virtual bool operator()( + const LLDispatcher* dispatcher, + const std::string& key, + const LLUUID& invoice, + const sparam_t& strings) + { + LLSD message; + + sparam_t::const_iterator it = strings.begin(); + if(it != strings.end()){ + const std::string& llsdRaw = *it++; + std::istringstream llsdData(llsdRaw); + if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length())) + { + llwarns << "LLExperienceLogDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << llendl; + } + } + message["public_id"] = invoice; + + // Object Name + if(it != strings.end()) + { + message["ObjectName"] = *it++; + } + + // parcel Name + if(it != strings.end()) + { + message["ParcelName"] = *it++; + } + + LLExperienceLog::instance().handleExperienceMessage(message); + return true; + } +}; + +static LLExperienceLogDispatchHandler experience_log_dispatch_handler; + +void LLExperienceLog::handleExperienceMessage(LLSD& message) +{ + time_t now; + time(&now); + char day[16];/* Flawfinder: ignore */ + char time_of_day[16];/* Flawfinder: ignore */ + strftime(day, 16, "%Y-%m-%d", localtime(&now)); + strftime(time_of_day, 16, " %H:%M:%S", localtime(&now)); + message["Time"] = time_of_day; + + if(mNotifyNewEvent) + { + notify(message); + } + if(!mEvents.has(day)){ + mEvents[day] = LLSD::emptyArray(); + } + mEvents[day].append(message); +} + +LLExperienceLog::LLExperienceLog() + : mMaxDays(7) + , mPageSize(25) + , mNotifyNewEvent(false) +{ +} + +void LLExperienceLog::initialize() +{ + loadEvents(); + if(!gGenericDispatcher.isHandlerPresent("ExperienceEvent")) + { + gGenericDispatcher.addHandler("ExperienceEvent", &experience_log_dispatch_handler); + } +} + +std::string LLExperienceLog::getFilename() +{ + return gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "experience_events.xml"); +} + + +std::string LLExperienceLog::getPermissionString( const LLSD& message, const std::string& base ) +{ + std::ostringstream buf; + if(message.has("Permission")) + { + buf << base << message["Permission"].asInteger(); + std::string entry; + if(LLTrans::findString(entry, buf.str())) + { + buf.str(entry); + } + else + { + buf.str(); + } + } + + if(buf.str().empty()) + { + buf << base << "Unknown"; + + buf.str(LLTrans::getString(buf.str(), message)); + } + + return buf.str(); +} + +void LLExperienceLog::notify( LLSD& message ) +{ + message["EventType"] = getPermissionString(message, "ExperiencePermission"); + if(message.has("IsAttachment") && message["IsAttachment"].asBoolean()) + { + LLNotificationsUtil::add("ExperienceEventAttachment", message); + } + else + { + LLNotificationsUtil::add("ExperienceEvent", message); + } + message.erase("EventType"); +} + +void LLExperienceLog::saveEvents() +{ + eraseExpired(); + std::string filename = getFilename(); + LLSD settings = LLSD::emptyMap().with("Events", mEvents); + + settings["MaxDays"] = (int)mMaxDays; + settings["Notify"] = mNotifyNewEvent; + settings["PageSize"] = (int)mPageSize; + + llofstream stream(filename); + LLSDSerialize::toPrettyXML(settings, stream); +} + + +void LLExperienceLog::loadEvents() +{ + LLSD settings = LLSD::emptyMap(); + + std::string filename = getFilename(); + llifstream stream(filename); + LLSDSerialize::fromXMLDocument(settings, stream); + + if(settings.has("MaxDays")) + { + mMaxDays = (U32)settings["MaxDays"].asInteger(); + } + if(settings.has("Notify")) + { + mNotifyNewEvent = settings["Notify"].asBoolean(); + } + if(settings.has("PageSize")) + { + mPageSize = (U32)settings["PageSize"].asInteger(); + } + mEvents.clear(); + if(mMaxDays > 0 && settings.has("Events")) + { + mEvents = settings["Events"]; + } + + eraseExpired(); +} + +LLExperienceLog::~LLExperienceLog() +{ + saveEvents(); +} + +void LLExperienceLog::eraseExpired() +{ + while(mEvents.size() > mMaxDays && mMaxDays > 0) + { + mEvents.erase(mEvents.beginMap()->first); + } +} + +const LLSD& LLExperienceLog::getEvents() const +{ + return mEvents; +} + +void LLExperienceLog::clear() +{ + mEvents.clear(); +} + +void LLExperienceLog::setMaxDays( U32 val ) +{ + mMaxDays = val; + if(mMaxDays > 0) + { + eraseExpired(); + } +} diff --git a/indra/newview/llexperiencelog.h b/indra/newview/llexperiencelog.h index 73d82f4fad..26ffab49f9 100644 --- a/indra/newview/llexperiencelog.h +++ b/indra/newview/llexperiencelog.h @@ -29,5 +29,49 @@ #ifndef LL_LLEXPERIENCELOG_H #define LL_LLEXPERIENCELOG_H +#include "llsingleton.h" + +class LLExperienceLog : public LLSingleton +{ +public: + void initialize(); + + U32 getMaxDays() const { return mMaxDays; } + void setMaxDays(U32 val); + + bool getNotifyNewEvent() const { return mNotifyNewEvent; } + void setNotifyNewEvent(bool val) { mNotifyNewEvent = val; } + + U32 getPageSize() const { return mPageSize; } + void setPageSize(U32 val) { mPageSize = val; } + + const LLSD& getEvents()const; + void clear(); + + virtual ~LLExperienceLog(); + + static void notify(LLSD& message); + static std::string getFilename(); + static std::string getPermissionString(const LLSD& message, const std::string& base); +protected: + LLExperienceLog(); + void handleExperienceMessage(LLSD& message); + + + void loadEvents(); + void saveEvents(); + void eraseExpired(); + + LLSD mEvents; + U32 mMaxDays; + U32 mPageSize; + bool mNotifyNewEvent; + + friend class LLExperienceLogDispatchHandler; + friend class LLSingleton; +}; + + + #endif // LL_LLEXPERIENCELOG_H 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(); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index a58e2a4791..27e26d4fda 100755 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -248,7 +248,7 @@ void LLFloaterReporter::getExperienceInfo(const LLUUID& experience_id) } LLUICtrl* details = getChild("details_edit"); - details->setValue(desc.str()); + details->setValue(details->getValue().asString()+desc.str()); } } @@ -497,7 +497,7 @@ void LLFloaterReporter::showFromMenu(EReportType report_type) } // static -void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name) +void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_name, const LLUUID& experience_id) { LLFloaterReporter* f = LLFloaterReg::showTypedInstance("reporter"); @@ -510,6 +510,10 @@ void LLFloaterReporter::show(const LLUUID& object_id, const std::string& avatar_ { f->setFromAvatarID(object_id); } + if(experience_id.notNull()) + { + f->getExperienceInfo(experience_id); + } // Need to deselect on close f->mDeselectOnClose = TRUE; @@ -532,9 +536,9 @@ void LLFloaterReporter::showFromExperience( const LLUUID& experience_id ) // static -void LLFloaterReporter::showFromObject(const LLUUID& object_id) +void LLFloaterReporter::showFromObject(const LLUUID& object_id, const LLUUID& experience_id) { - show(object_id); + show(object_id, LLStringUtil::null, experience_id); } // static diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index de3aa9ca5e..5eb5c20665 100755 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -88,7 +88,7 @@ public: // Enables all buttons static void showFromMenu(EReportType report_type); - static void showFromObject(const LLUUID& object_id); + static void showFromObject(const LLUUID& object_id, const LLUUID& experience_id = LLUUID::null); static void showFromAvatar(const LLUUID& avatar_id, const std::string avatar_name); static void showFromExperience(const LLUUID& experience_id); @@ -107,7 +107,7 @@ public: void setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id); private: - static void show(const LLUUID& object_id, const std::string& avatar_name = LLStringUtil::null); + static void show(const LLUUID& object_id, const std::string& avatar_name = LLStringUtil::null, const LLUUID& experience_id = LLUUID::null); void takeScreenshot(); void sendReportViaCaps(std::string url); diff --git a/indra/newview/llpanelexperiencelog.cpp b/indra/newview/llpanelexperiencelog.cpp index 009889a59f..e0e522e276 100644 --- a/indra/newview/llpanelexperiencelog.cpp +++ b/indra/newview/llpanelexperiencelog.cpp @@ -27,92 +27,224 @@ #include "llviewerprecompiledheaders.h" #include "llpanelexperiencelog.h" -#include "lldispatcher.h" -#include "llsdserialize.h" -#include "llviewergenericmessage.h" -#include "llnotificationsutil.h" -#include "lltrans.h" +#include "llexperiencelog.h" +#include "llexperiencecache.h" +#include "llbutton.h" +#include "llscrolllistctrl.h" +#include "llcombobox.h" +#include "llspinctrl.h" +#include "llcheckboxctrl.h" +#include "llfloaterreg.h" +#include "llfloaterreporter.h" +#include "llinventoryfunctions.h" -class LLExperienceLogDispatchHandler : public LLDispatchHandler + +#define BTN_PROFILE_XP "btn_profile_xp" +#define BTN_REPORT_XP "btn_report_xp" + +static LLPanelInjector register_experiences_panel("experience_log"); + + +LLPanelExperienceLog::LLPanelExperienceLog( ) + : mEventList(NULL) + , mPageSize(25) + , mCurrentPage(0) { -public: - virtual bool operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const LLUUID& invoice, - const sparam_t& strings) + buildFromFile("panel_experience_log.xml"); +} + +BOOL LLPanelExperienceLog::postBuild( void ) +{ + LLExperienceLog* log = LLExperienceLog::getInstance(); + mEventList = getChild("experience_log_list"); + mEventList->setCommitCallback(boost::bind(&LLPanelExperienceLog::onSelectionChanged, this)); + + getChild("btn_clear")->setCommitCallback(boost::bind(&LLExperienceLog::clear, log)); + getChild("btn_clear")->setCommitCallback(boost::bind(&LLPanelExperienceLog::refresh, this)); + + getChild(BTN_PROFILE_XP)->setCommitCallback(boost::bind(&LLPanelExperienceLog::onProfileExperience, this)); + getChild(BTN_REPORT_XP)->setCommitCallback(boost::bind(&LLPanelExperienceLog::onReportExperience, this)); + getChild("btn_notify")->setCommitCallback(boost::bind(&LLPanelExperienceLog::onNotify, this)); + getChild("btn_next")->setCommitCallback(boost::bind(&LLPanelExperienceLog::onNext, this)); + getChild("btn_prev")->setCommitCallback(boost::bind(&LLPanelExperienceLog::onPrev, this)); + + LLCheckBoxCtrl* check = getChild("notify_all"); + check->set(log->getNotifyNewEvent()); + check->setCommitCallback(boost::bind(&LLPanelExperienceLog::notifyChanged, this)); + + + LLSpinCtrl* spin = getChild("logsizespinner"); + spin->set(log->getMaxDays()); + spin->setCommitCallback(boost::bind(&LLPanelExperienceLog::logSizeChanged, this)); + + mPageSize = log->getPageSize(); + refresh(); + return TRUE; +} + +LLPanelExperienceLog* LLPanelExperienceLog::create() +{ + return new LLPanelExperienceLog(); +} + +void LLPanelExperienceLog::refresh() +{ + mEventList->deleteAllItems(); + const LLSD& events = LLExperienceLog::instance().getEvents(); + + if(events.size() == 0) { - LLSD message; + mEventList->setCommentText(getString("no_events")); + return; + } - sparam_t::const_iterator it = strings.begin(); - if(it != strings.end()){ - const std::string& llsdRaw = *it++; - std::istringstream llsdData(llsdRaw); - if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length())) - { - llwarns << "LLExperienceLogDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << llendl; - } - } - message["public_id"] = invoice; + setAllChildrenEnabled(FALSE); + + LLSD item; + bool waiting = false; + LLUUID waiting_id; - // Object Name - if(it != strings.end()) + int itemsToSkip = mPageSize*mCurrentPage; + int items = 0; + bool moreItems = false; + + for(LLSD::map_const_iterator day = events.beginMap(); day != events.endMap() ; ++day) + { + const LLSD& dayArray = day->second; + int size = dayArray.size(); + if(itemsToSkip > size) { - message["ObjectName"] = *it++; + itemsToSkip -= size; + continue; } - - // parcel Name - if(it != strings.end()) + if(items >= mPageSize && size > 0) + { + moreItems = true; + break; + } + for(int i = itemsToSkip ; i < dayArray.size(); i++) { - message["ParcelName"] = *it++; + if(items >= mPageSize) + { + moreItems = true; + break; + } + const LLSD& event = dayArray[i]; + LLUUID id = event[LLExperienceCache::EXPERIENCE_ID].asUUID(); + const LLSD& experience = LLExperienceCache::get(id); + if(experience.isUndefined()){ + waiting = true; + waiting_id = id; + } + if(!waiting) + { + item["id"] = event; + + LLSD& columns = item["columns"]; + columns[0]["column"] = "time"; + columns[0]["value"] = day->first+event["Time"].asString(); + columns[1]["column"] = "event"; + columns[1]["value"] = LLExperienceLog::getPermissionString(event, "ExperiencePermissionShort"); + columns[2]["column"] = "experience_name"; + columns[2]["value"] = experience[LLExperienceCache::NAME].asString(); + columns[3]["column"] = "object_name"; + columns[3]["value"] = event["ObjectName"].asString(); + mEventList->addElement(item); + } + ++items; } + } + if(waiting) + { + mEventList->deleteAllItems(); + mEventList->setCommentText(getString("loading")); + LLExperienceCache::get(waiting_id, boost::bind(&LLPanelExperienceLog::refresh, this)); + } + else + { + setAllChildrenEnabled(TRUE); - LLExperienceLog::instance().handleExperienceMessage(message); - return true; + mEventList->setEnabled(TRUE); + getChild("btn_next")->setEnabled(moreItems); + getChild("btn_prev")->setEnabled(mCurrentPage>0); + getChild("btn_clear")->setEnabled(mEventList->getItemCount()>0); + onSelectionChanged(); } -}; +} -static LLExperienceLogDispatchHandler experience_log_dispatch_handler; +void LLPanelExperienceLog::onProfileExperience() +{ + LLSD& event = getSelectedEvent(); + if(event.isDefined()) + { + LLFloaterReg::showInstance("experience_profile", event[LLExperienceCache::EXPERIENCE_ID].asUUID(), true); + } +} -void LLExperienceLog::handleExperienceMessage(LLSD& message) +void LLPanelExperienceLog::onReportExperience() { - std::ostringstream str; - if(message.has("Permission")) + LLSD& event = getSelectedEvent(); + if(event.isDefined()) { - str << "ExperiencePermission" << message["Permission"].asInteger(); - std::string entry; - if(LLTrans::findString(entry, str.str())) - { - str.str(entry); - } - else - { - str.str(); - } + LLFloaterReporter::showFromExperience(event[LLExperienceCache::EXPERIENCE_ID].asUUID()); } +} - if(str.str().empty()) +void LLPanelExperienceLog::onNotify() +{ + LLSD& event = getSelectedEvent(); + if(event.isDefined()) { - str.str(LLTrans::getString("ExperiencePermissionUnknown", message)); + LLExperienceLog::instance().notify(event); } +} + +void LLPanelExperienceLog::onNext() +{ + mCurrentPage++; + refresh(); +} - message["EventType"] = str.str(); - if(message.has("IsAttachment") && message["IsAttachment"].asBoolean()) +void LLPanelExperienceLog::onPrev() +{ + if(mCurrentPage>0) { - LLNotificationsUtil::add("ExperienceEventAttachment", message); + mCurrentPage--; + refresh(); } - else +} + +void LLPanelExperienceLog::notifyChanged() +{ + LLExperienceLog::instance().setNotifyNewEvent(getChild("notify_all")->get()); +} + +void LLPanelExperienceLog::logSizeChanged() +{ + int value = (int)(getChild("logsizespinner")->get()); + bool dirty = value > 0 && value < LLExperienceLog::instance().getMaxDays(); + LLExperienceLog::instance().setMaxDays(value); + if(dirty) { - LLNotificationsUtil::add("ExperienceEvent", message); + refresh(); } } -LLExperienceLog::LLExperienceLog() +void LLPanelExperienceLog::onSelectionChanged() { + bool enabled = (1 == mEventList->getNumSelected()); + getChild(BTN_REPORT_XP)->setEnabled(enabled); + getChild(BTN_PROFILE_XP)->setEnabled(enabled); + getChild("btn_notify")->setEnabled(enabled); } -void LLExperienceLog::initialize() +LLSD LLPanelExperienceLog::getSelectedEvent() { - gGenericDispatcher.addHandler("ExperienceEvent", &experience_log_dispatch_handler); + LLScrollListItem* item = mEventList->getFirstSelected(); + if(item) + { + return item->getValue(); + } + return LLSD(); } diff --git a/indra/newview/llpanelexperiencelog.h b/indra/newview/llpanelexperiencelog.h index 7d2a24872a..e4edd216d5 100644 --- a/indra/newview/llpanelexperiencelog.h +++ b/indra/newview/llpanelexperiencelog.h @@ -25,24 +25,38 @@ */ - #ifndef LL_LLPANELEXPERIENCELOG_H #define LL_LLPANELEXPERIENCELOG_H -#include "llsingleton.h" +#include "llpanel.h" +class LLScrollListCtrl; +class LLPanelExperienceLog + : public LLPanel +{ +public: + LLPanelExperienceLog(); + static LLPanelExperienceLog* create(); -class LLExperienceLog : public LLSingleton -{ - friend class LLSingleton; + /*virtual*/ BOOL postBuild(void); + + void refresh(); protected: - LLExperienceLog(); - -public: - void initialize(); - void handleExperienceMessage(LLSD& message); + void logSizeChanged(); + void notifyChanged(); + void onNext(); + void onNotify(); + void onPrev(); + void onProfileExperience(); + void onReportExperience(); + void onSelectionChanged(); + + LLSD getSelectedEvent(); +private: + LLScrollListCtrl* mEventList; + U32 mPageSize; + U32 mCurrentPage; }; - #endif // LL_LLPANELEXPERIENCELOG_H diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b5f976080a..b3633740ca 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -198,7 +198,7 @@ #include "llevents.h" #include "llstartuplistener.h" #include "lltoolbarview.h" -#include "llpanelexperiencelog.h" +#include "llexperiencelog.h" #if LL_WINDOWS #include "lldxhardware.h" @@ -1303,6 +1303,9 @@ bool idle_startup() // object is created. I think this must be done after setting the region. JC gAgent.setPositionAgent(agent_start_position_region); + display_startup(); + LLStartUp::initExperiences(); + display_startup(); LLStartUp::setStartupState( STATE_MULTIMEDIA_INIT ); @@ -1413,9 +1416,6 @@ bool idle_startup() LLStartUp::initNameCache(); display_startup(); - LLStartUp::initExperiences(); - display_startup(); - // update the voice settings *after* gCacheName initialization // so that we can construct voice UI that relies on the name cache LLVoiceClient::getInstance()->updateSettings(); diff --git a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml index 67a7d5dad0..c6a749b45f 100644 --- a/indra/newview/skins/default/xui/en/floater_experienceprofile.xml +++ b/indra/newview/skins/default/xui/en/floater_experienceprofile.xml @@ -410,9 +410,9 @@ label="Report Abuse" layout="topleft" name="report_btn" - width="288" + width="94" top_pad="3" - left="10" + left="107" enabled="true"/> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b230e36cc7..edcc401b9a 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7074,7 +7074,7 @@ Unable to acquire a new experience: icon="notify.tga" name="ExperienceEvent" persist="false" - type="notify"> + type="notifytip"> An object was allowed to [EventType] by the secondlife:///app/experience/[public_id]/profile experience. Owner: secondlife:///app/agent/[OwnerID]/inspect Object Name: [ObjectName] @@ -7085,7 +7085,7 @@ Unable to acquire a new experience: icon="notify.tga" name="ExperienceEventAttachment" persist="false" - type="notify"> + type="notifytip"> An attachment was allowed to [EventType] by the secondlife:///app/experience/[public_id]/profile experience. Owner: secondlife:///app/agent/[OwnerID]/inspect diff --git a/indra/newview/skins/default/xui/en/panel_experience_log.xml b/indra/newview/skins/default/xui/en/panel_experience_log.xml new file mode 100644 index 0000000000..6869a135d8 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_experience_log.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + +