From bb33802440d9f5bb8d74ed222f190a28eeeaf1ec Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 22 Aug 2016 12:00:26 +0200 Subject: [PATCH 01/37] Use user-default locale setting from operating system in cases it makes sense --- indra/newview/llfloaterpreference.cpp | 2 +- indra/newview/llfloatersnapshot.cpp | 5 ++++- indra/newview/lloutfitslist.cpp | 4 ++-- indra/newview/llpanelmaininventory.cpp | 5 ++++- indra/newview/llpaneloutfitedit.cpp | 2 +- indra/newview/llpanelwearing.cpp | 2 +- indra/newview/llvoavatar.cpp | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e7c88ed684..881927a7ed 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -3165,7 +3165,7 @@ void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box) // Proper number formatting with delimiter //text_box->setText(llformat("%d", value)); std::string output_string; - LLLocale locale(LLLocale::USER_LOCALE); + LLLocale locale(""); LLResMgr::getInstance()->getIntegerString(output_string, value); text_box->setText(output_string); } diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 3a963827e0..38495cbbca 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -501,7 +501,10 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) // *TODO: Separate maximum size for Web images from postcards LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL; - LLLocale locale(LLLocale::USER_LOCALE); + // Use user-default locale from operating system + //LLLocale locale(LLLocale::USER_LOCALE); + LLLocale locale(""); + // std::string bytes_string; if (got_snap) { diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 02e689be3f..6aac51cb34 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -499,7 +499,7 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) // FIRE-12939: Add outfit count to outfits list { std::string count_string; - LLLocale locale(LLLocale::USER_LOCALE); + LLLocale locale(""); LLResMgr::getInstance()->getIntegerString(count_string, (S32)cat_array.size()); getChild("OutfitcountText")->setTextArg("COUNT", count_string); } @@ -1243,7 +1243,7 @@ bool is_tab_header_clicked(LLAccordionCtrlTab* tab, S32 y) void LLOutfitsList::updateAvatarComplexity(U32 complexity) { std::string complexity_string; - LLLocale locale(LLLocale::USER_LOCALE); + LLLocale locale(""); LLResMgr::getInstance()->getIntegerString(complexity_string, complexity); mAvatarComplexityLabel->setTextArg("[WEIGHT]", complexity_string); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 2febe44317..f014202b43 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -904,7 +904,10 @@ void LLPanelMainInventory::updateItemcountText() { mItemCount = gInventory.getItemCount(); mItemCountString = ""; - LLLocale locale(LLLocale::USER_LOCALE); + // Use user-default locale from operating system + //LLLocale locale(LLLocale::USER_LOCALE); + LLLocale locale(""); + // LLResMgr::getInstance()->getIntegerString(mItemCountString, mItemCount); } diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 740aabbc5c..c90a5076aa 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -1441,7 +1441,7 @@ void LLPanelOutfitEdit::saveListSelection() void LLPanelOutfitEdit::updateAvatarComplexity(U32 complexity) { std::string complexity_string; - LLLocale locale(LLLocale::USER_LOCALE); + LLLocale locale(""); LLResMgr::getInstance()->getIntegerString(complexity_string, complexity); mAvatarComplexityLabel->setTextArg("[WEIGHT]", complexity_string); diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 1b085ad82e..d220948eda 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -369,7 +369,7 @@ void LLPanelWearing::copyToClipboard() void LLPanelWearing::updateAvatarComplexity(U32 complexity) { std::string complexity_string; - LLLocale locale(LLLocale::USER_LOCALE); + LLLocale locale(""); LLResMgr::getInstance()->getIntegerString(complexity_string, complexity); mAvatarComplexityLabel->setTextArg("[WEIGHT]", complexity_string); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a8aabdab45..82fe2e6e70 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3280,7 +3280,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) (!isSelf() && (!show_too_complex_only_arw_tag || isTooComplex())))) { std::string complexity_string; - LLLocale locale(LLLocale::USER_LOCALE); + LLLocale locale(""); LLResMgr::getInstance()->getIntegerString(complexity_string, complexity); LLStringUtil::format_map_t label_args; From bbef48a45131c1e433b1b572f90c914702a47219 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 22 Aug 2016 12:08:11 +0200 Subject: [PATCH 02/37] FIRE-19958: Add digit group separators to avatar complexity notification --- indra/newview/llavatarrendernotifier.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 414c641f80..f08d41ff13 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -45,6 +45,7 @@ #include "llagentcamera.h" // associated header #include "llavatarrendernotifier.h" +#include "llresmgr.h" // when change exceeds this ration, notification is shown static const F32 RENDER_ALLOWED_CHANGE_PCT = 0.1f; @@ -111,7 +112,15 @@ void LLAvatarRenderNotifier::displayNotification(bool show_over_limit) LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay); LLSD args; - args["AGENT_COMPLEXITY"] = LLSD::Integer(mLatestAgentComplexity); + // FIRE-19958: Add digit group separators to avatar complexity notification + //args["AGENT_COMPLEXITY"] = LLSD::Integer(mLatestAgentComplexity); + { + LLLocale locale(""); + std::string complexity_string; + LLResMgr::getInstance()->getIntegerString(complexity_string, mLatestAgentComplexity); + args["AGENT_COMPLEXITY"] = complexity_string; + } + // std::string notification_name; if (mShowOverLimitAgents) { From 19f7fb2247a904f4ac5b35b857108148ace0bd64 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 22 Aug 2016 13:00:28 +0200 Subject: [PATCH 03/37] Remove log spam --- indra/newview/llvoicevivox.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index c5360bfd5e..18771adfc8 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -6691,7 +6691,6 @@ LLIOPipe::EStatus LLVivoxProtocolParser::process_impl( XML_SetUserData(parser, this); XML_Parse(parser, mInput.data() + start, delim - start, false); - LL_INFOS("Voice") << "parsing: " << mInput.substr(start, delim - start) << LL_ENDL; // If this message isn't set to be squelched, output the raw XML received. if(!squelchDebugOutput) { From 556f09dfc43b8bab037fc50517d497f916e4d52e Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 23 Aug 2016 01:10:08 +0200 Subject: [PATCH 04/37] Fixed bug in LLTexLayerSet::asLLSD() found by Henri Beauchamp (Cool VL Viewer) --- indra/llappearance/lltexlayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index f3626fea62..c5218e1e60 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -482,7 +482,7 @@ void LLTexLayerSet::asLLSD(LLSD& sd) const LLSD layer_list_sd; layer_list_t::const_iterator layer_iter = mLayerList.begin(); layer_list_t::const_iterator layer_end = mLayerList.end(); - for(; layer_iter != layer_end; ++layer_iter); + for(; layer_iter != layer_end; ++layer_iter) { LLSD layer_sd; //LLTexLayerInterface* layer = (*layer_iter); From da4de9be1cc2aa6ba77cf99a4ce34f5d7a6fd460 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 23 Aug 2016 10:39:51 +0200 Subject: [PATCH 05/37] Clean up KCWindlightInterface --- indra/newview/kcwlinterface.cpp | 101 ++++++++++++++------------------ indra/newview/kcwlinterface.h | 35 ++++++----- 2 files changed, 61 insertions(+), 75 deletions(-) diff --git a/indra/newview/kcwlinterface.cpp b/indra/newview/kcwlinterface.cpp index 6f318f544b..b00ed142eb 100644 --- a/indra/newview/kcwlinterface.cpp +++ b/indra/newview/kcwlinterface.cpp @@ -46,22 +46,6 @@ const F32 PARCEL_WL_CHECK_TIME = 5.f; const S32 PARCEL_WL_MIN_ALT_CHANGE = 3; const std::string PARCEL_WL_DEFAULT = "Default"; -class KCWindlightInterface::LLParcelChangeObserver : public LLParcelObserver -{ -public: - LLParcelChangeObserver(KCWindlightInterface* windlightInterface) : mKCWindlightInterface(windlightInterface) {} - -private: - /*virtual*/ void changed() - { - if (mKCWindlightInterface) - { - mKCWindlightInterface->ParcelChange(); - } - } - - KCWindlightInterface* mKCWindlightInterface; -}; KCWindlightInterface::KCWindlightInterface() : LLEventTimer(PARCEL_WL_CHECK_TIME), @@ -71,17 +55,16 @@ KCWindlightInterface::KCWindlightInterface() : mLastParcelID(-1), mLastRegion(NULL), mRegionOverride(false), - mHaveRegionSettings(false) + mHaveRegionSettings(false), + mDisabled(false) { - if (!gSavedSettings.getBOOL("FSWLParcelEnabled") || - !gSavedSettings.getBOOL("UseEnvironmentFromRegionAlways")) + if (!gSavedSettings.getBOOL("FSWLParcelEnabled") || !gSavedSettings.getBOOL("UseEnvironmentFromRegionAlways")) { mEventTimer.stop(); mDisabled = true; } - mParcelMgrConnection = gAgent.addParcelChangedCallback( - boost::bind(&KCWindlightInterface::onAgentParcelChange, this)); + mParcelMgrConnection = gAgent.addParcelChangedCallback(boost::bind(&KCWindlightInterface::parcelChange, this)); } KCWindlightInterface::~KCWindlightInterface() @@ -92,17 +75,19 @@ KCWindlightInterface::~KCWindlightInterface() } } -void KCWindlightInterface::ParcelChange() +void KCWindlightInterface::parcelChange() { if (checkSettings()) + { return; - + } + mDisabled = false; S32 this_parcel_id = 0; std::string desc; - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); // Since we cannot depend on the order in which the EnvironmentSettings cap and parcel info // will come in, we must check if the other has set something before this one for the current region. @@ -151,16 +136,13 @@ void KCWindlightInterface::ParcelChange() } } -void KCWindlightInterface::onAgentParcelChange() -{ - ParcelChange(); -} - BOOL KCWindlightInterface::tick() { if ((LLStartUp::getStartupState() < STATE_STARTED) || checkSettings()) + { return FALSE; + } //TODO: there has to be a better way of doing this... if (mCurrentSettings.has("sky")) @@ -170,7 +152,7 @@ BOOL KCWindlightInterface::tick() if (llabs(z - mLastZ) >= PARCEL_WL_MIN_ALT_CHANGE) { mLastZ = z; - ApplySkySettings(mCurrentSettings); + applySkySettings(mCurrentSettings); } return FALSE; } @@ -179,7 +161,7 @@ BOOL KCWindlightInterface::tick() if (parcel) { - if (!LoadFromParcel(parcel) || !mCurrentSettings.has("sky")) + if (!loadFromParcel(parcel) || !mCurrentSettings.has("sky")) { mEventTimer.stop(); } @@ -189,16 +171,16 @@ BOOL KCWindlightInterface::tick() } -void KCWindlightInterface::ApplySettings(const LLSD& settings) +void KCWindlightInterface::applySettings(const LLSD& settings) { - LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!settings.has("local_id") || (settings["local_id"].asInteger() == parcel->getLocalID()) ) { mCurrentSettings = settings; mRegionOverride = settings.has("region_override"); - bool non_region_default_applied = ApplySkySettings(settings); + bool non_region_default_applied = applySkySettings(settings); // We can only apply a water preset if we didn't set region WL default previously // or there will be unpredictable behavior where the region WL defaults will be @@ -220,7 +202,7 @@ void KCWindlightInterface::ApplySettings(const LLSD& settings) } } -bool KCWindlightInterface::ApplySkySettings(const LLSD& settings) +bool KCWindlightInterface::applySkySettings(const LLSD& settings) { if (settings.has("sky")) { @@ -241,7 +223,7 @@ bool KCWindlightInterface::ApplySkySettings(const LLSD& settings) { mCurrentSpace = lower; //use lower as an id LL_DEBUGS() << "Applying WL sky set: " << (*space_it)["preset"].asString() << LL_ENDL; - ApplyWindLightPreset((*space_it)["preset"].asString()); + applyWindlightPreset((*space_it)["preset"].asString()); } return true; } @@ -255,12 +237,12 @@ bool KCWindlightInterface::ApplySkySettings(const LLSD& settings) if (settings.has("sky_default") && (!mHaveRegionSettings || mRegionOverride)) { LL_DEBUGS() << "Applying WL sky set: " << settings["sky_default"] << " (Parcel WL Default)" << LL_ENDL; - ApplyWindLightPreset(settings["sky_default"].asString()); + applyWindlightPreset(settings["sky_default"].asString()); } else //reset to default { LL_DEBUGS() << "Applying WL sky set: Region Default" << LL_ENDL; - ApplyWindLightPreset(PARCEL_WL_DEFAULT); + applyWindlightPreset(PARCEL_WL_DEFAULT); return false; } } @@ -268,10 +250,12 @@ bool KCWindlightInterface::ApplySkySettings(const LLSD& settings) return true; } -void KCWindlightInterface::ApplyWindLightPreset(const std::string& preset) +void KCWindlightInterface::applyWindlightPreset(const std::string& preset) { if (rlv_handler_t::isEnabled() && gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { return; + } LLWLParamManager* wlprammgr = LLWLParamManager::getInstance(); LLWLParamKey key(preset, LLEnvKey::SCOPE_LOCAL); @@ -292,21 +276,23 @@ void KCWindlightInterface::ApplyWindLightPreset(const std::string& preset) } } -void KCWindlightInterface::ResetToRegion(bool force) +void KCWindlightInterface::resetToRegion(bool force) { if (rlv_handler_t::isEnabled() && gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) + { return; + } //TODO: clear per parcel if (mWeChangedIt || force) //dont reset anything if we didnt do it { - ApplyWindLightPreset(PARCEL_WL_DEFAULT); + applyWindlightPreset(PARCEL_WL_DEFAULT); } } //KC: Disabling this for now #if 0 -bool KCWindlightInterface::ChatCommand(std::string message, std::string from_name, LLUUID source_id, LLUUID owner_id) +bool KCWindlightInterface::chatCommand(std::string message, std::string from_name, LLUUID source_id, LLUUID owner_id) { boost::cmatch match; const boost::regex prefix_exp("^\\)\\*\\((.*)"); @@ -373,19 +359,21 @@ bool KCWindlightInterface::ChatCommand(std::string message, std::string from_nam } #endif -bool KCWindlightInterface::LoadFromParcel(LLParcel *parcel) +bool KCWindlightInterface::loadFromParcel(LLParcel *parcel) { if (!parcel) + { return false; + } LLSD payload; - if (ParseParcelForWLSettings(parcel->getDesc(), payload)) + if (parseParcelForWLSettings(parcel->getDesc(), payload)) { const LLUUID owner_id = getOwnerID(parcel); //basic auth for now - if (AllowedLandOwners(owner_id)) + if (allowedLandOwners(owner_id)) { - ApplySettings(payload); + applySettings(payload); } else { @@ -402,12 +390,12 @@ bool KCWindlightInterface::LoadFromParcel(LLParcel *parcel) } //if nothing defined, reset to region settings - ResetToRegion(); + resetToRegion(); return false; } -bool KCWindlightInterface::ParseParcelForWLSettings(const std::string& desc, LLSD& settings) +bool KCWindlightInterface::parseParcelForWLSettings(const std::string& desc, LLSD& settings) { bool found_settings = false; try @@ -415,7 +403,7 @@ bool KCWindlightInterface::ParseParcelForWLSettings(const std::string& desc, LLS boost::smatch mat_block; //parcel desc /*[data goes here]*/ const boost::regex Parcel_exp("(?i)\\/\\*(?:Windlight)?([\\s\\S]*?)\\*\\/"); - if(boost::regex_search(desc, mat_block, Parcel_exp)) + if (boost::regex_search(desc, mat_block, Parcel_exp)) { //std::string data1(mat_block[1].first, mat_block[1].second); //LL_INFOS() << "found parcel flags block: " << mat_block[1] << LL_ENDL; @@ -532,11 +520,11 @@ bool KCWindlightInterface::callbackParcelWL(const LLSD& notification, const LLSD { mAllowedLand.insert(notification["payload"]["land_owner"].asUUID()); - ApplySettings(notification["payload"]); + applySettings(notification["payload"]); } else { - ResetToRegion(); + resetToRegion(); } return false; } @@ -544,18 +532,17 @@ bool KCWindlightInterface::callbackParcelWL(const LLSD& notification, const LLSD bool KCWindlightInterface::callbackParcelWLClear(const LLSD& notification, const LLSD& response) { S32 option = LLNotification::getSelectedOption(notification, response); - if (option == 0) { LLUUID owner_id = notification["payload"]["land_owner"].asUUID(); mAllowedLand.erase(owner_id); - ResetToRegion(); + resetToRegion(); } return false; } -bool KCWindlightInterface::AllowedLandOwners(const LLUUID& owner_id) +bool KCWindlightInterface::allowedLandOwners(const LLUUID& owner_id) { if ( gSavedSettings.getBOOL("FSWLWhitelistAll") || // auto all (owner_id == gAgent.getID()) || // land is owned by agent @@ -568,7 +555,7 @@ bool KCWindlightInterface::AllowedLandOwners(const LLUUID& owner_id) return false; } -LLUUID KCWindlightInterface::getOwnerID(LLParcel *parcel) +LLUUID KCWindlightInterface::getOwnerID(LLParcel* parcel) { if (parcel->getIsGroupOwned()) { @@ -577,7 +564,7 @@ LLUUID KCWindlightInterface::getOwnerID(LLParcel *parcel) return parcel->getOwnerID(); } -std::string KCWindlightInterface::getOwnerName(LLParcel *parcel) +std::string KCWindlightInterface::getOwnerName(LLParcel* parcel) { std::string owner = ""; if (parcel->getIsGroupOwned()) @@ -624,7 +611,7 @@ bool KCWindlightInterface::haveParcelOverride(const LLEnvironmentSettings& new_s mCurrentSettings.clear(); mLastRegion = gAgent.getRegion(); } - + //*ASSUMPTION: if region day cycle is empty, its set to default mHaveRegionSettings = new_settings.getWLDayCycle().size() > 0; diff --git a/indra/newview/kcwlinterface.h b/indra/newview/kcwlinterface.h index d77fb798b4..21e04cbad1 100644 --- a/indra/newview/kcwlinterface.h +++ b/indra/newview/kcwlinterface.h @@ -33,7 +33,6 @@ class LLParcel; class LLViewerRegion; class LLEnvironmentSettings; -class LLParcelChangeObserver; class KCWindlightInterface : public LLSingleton, LLEventTimer { @@ -42,15 +41,18 @@ class KCWindlightInterface : public LLSingleton, LLEventTi public: KCWindlightInterface(); ~KCWindlightInterface(); - void ParcelChange(); - virtual BOOL tick(); - void ApplySettings(const LLSD& settings); - bool ApplySkySettings(const LLSD& settings); - void ApplyWindLightPreset(const std::string& preset); - void ResetToRegion(bool force = false); - //bool ChatCommand(std::string message, std::string from_name, LLUUID source_id, LLUUID owner_id); - bool LoadFromParcel(LLParcel *parcel); - bool ParseParcelForWLSettings(const std::string& desc, LLSD& settings); + + void parcelChange(); + /*virtual*/ BOOL tick(); // From LLEventTime + + void applySettings(const LLSD& settings); + bool applySkySettings(const LLSD& settings); + void applyWindlightPreset(const std::string& preset); + void resetToRegion(bool force = false); + + //bool chatCommand(std::string message, std::string from_name, LLUUID source_id, LLUUID owner_id); + bool loadFromParcel(LLParcel *parcel); + bool parseParcelForWLSettings(const std::string& desc, LLSD& settings); void onClickWLStatusButton(); void setTPing(bool value) { mTPing = value; } bool haveParcelOverride(const LLEnvironmentSettings& new_settings); @@ -58,22 +60,19 @@ public: bool getWLset() { return mWLset; } private: - class LLParcelChangeObserver; - friend class LLParcelChangeObserver; - boost::signals2::connection mParcelMgrConnection; - void onAgentParcelChange(); + boost::signals2::connection mParcelMgrConnection; bool callbackParcelWL(const LLSD& notification, const LLSD& response); bool callbackParcelWLClear(const LLSD& notification, const LLSD& response); - bool AllowedLandOwners(const LLUUID& agent_id); - LLUUID getOwnerID(LLParcel *parcel); - std::string getOwnerName(LLParcel *parcel); + bool allowedLandOwners(const LLUUID& agent_id); + LLUUID getOwnerID(LLParcel* parcel); + std::string getOwnerName(LLParcel* parcel); void setWL_Status(bool pwl_status); bool checkSettings(); protected: bool mWLset; //display the status bar icon? - std::set mAllowedLand; + uuid_set_t mAllowedLand; LLNotificationPtr mSetWLNotification; LLNotificationPtr mClearWLNotification; S32 mLastParcelID; From 676a178e18f48efea8e87c8ecb1dc1a4b12c89b1 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 25 Aug 2016 15:42:01 +0200 Subject: [PATCH 06/37] FIRE-19956: Show temporarily blocked objects in blacklist floater so they can be removed; Based on a patch by Xenhat Liamano --- indra/newview/NACLfloaterexploresounds.cpp | 2 +- indra/newview/fsdata.cpp | 1 + indra/newview/fsfloaterwsassetblacklist.cpp | 5 +- indra/newview/fswsassetblacklist.cpp | 34 ++++----- indra/newview/fswsassetblacklist.h | 2 +- indra/newview/llavataractions.cpp | 5 +- indra/newview/llviewermenu.cpp | 59 ++++++++------- .../xui/de/floater_asset_blacklist.xml | 1 + .../skins/default/xui/en/floater_about.xml | 2 +- .../xui/en/floater_asset_blacklist.xml | 71 +++++++++---------- 10 files changed, 89 insertions(+), 93 deletions(-) diff --git a/indra/newview/NACLfloaterexploresounds.cpp b/indra/newview/NACLfloaterexploresounds.cpp index 239ecb7967..b27b11715a 100644 --- a/indra/newview/NACLfloaterexploresounds.cpp +++ b/indra/newview/NACLfloaterexploresounds.cpp @@ -431,6 +431,6 @@ void NACLFloaterExploreSounds::onBlacklistAvatarNameCacheCallback(const LLUUID& } mBlacklistAvatarNameCacheConnections.erase(it); } - FSWSAssetBlacklist::getInstance()->addNewItemToBlacklist(asset_id, av_name.getCompleteName(), region_name, LLAssetType::AT_SOUND, true); + FSWSAssetBlacklist::getInstance()->addNewItemToBlacklist(asset_id, av_name.getCompleteName(), region_name, LLAssetType::AT_SOUND); } diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp index 27f4031256..caf2b7b540 100644 --- a/indra/newview/fsdata.cpp +++ b/indra/newview/fsdata.cpp @@ -471,6 +471,7 @@ void FSData::processAssets(const LLSD& assets) LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); cipher.decrypt(uid.mData, UUID_BYTES); LLSD data = itr->second; + data["asset_permanent"] = false; // Don't save these locally! if (uid.isNull()) { continue; diff --git a/indra/newview/fsfloaterwsassetblacklist.cpp b/indra/newview/fsfloaterwsassetblacklist.cpp index fce09c2663..faba81d7d5 100644 --- a/indra/newview/fsfloaterwsassetblacklist.cpp +++ b/indra/newview/fsfloaterwsassetblacklist.cpp @@ -91,6 +91,10 @@ void FSFloaterWSAssetBlacklist::addElementToList(const LLUUID& id, const LLSD& d element["columns"][3]["column"] = "date"; element["columns"][3]["type"] = "text"; element["columns"][3]["value"] = data["asset_date"].asString(); + element["columns"][4]["column"] = "permanent"; + element["columns"][4]["type"] = "text"; + element["columns"][4]["halign"] = "center"; + element["columns"][4]["value"] = data["asset_permanent"].asBoolean() ? getString("asset_permanent") : LLStringUtil::null; mResultList->addElement(element, ADD_BOTTOM); } @@ -100,7 +104,6 @@ void FSFloaterWSAssetBlacklist::removeElementFromList(const LLUUID& id) mResultList->deleteSingleItem(mResultList->getItemIndex(id)); } - void FSFloaterWSAssetBlacklist::onOpen(const LLSD& key) { mResultList->clearRows(); diff --git a/indra/newview/fswsassetblacklist.cpp b/indra/newview/fswsassetblacklist.cpp index 13df41ee4d..9260004019 100644 --- a/indra/newview/fswsassetblacklist.cpp +++ b/indra/newview/fswsassetblacklist.cpp @@ -76,7 +76,7 @@ bool FSWSAssetBlacklist::isBlacklisted(const LLUUID& id, LLAssetType::EType type } blacklist_type_map_t::iterator it; - it = mBlacklistTypeContainer.find(type); + it = mBlacklistTypeContainer.find(type); if (it == mBlacklistTypeContainer.end()) { @@ -87,7 +87,7 @@ bool FSWSAssetBlacklist::isBlacklisted(const LLUUID& id, LLAssetType::EType type return (uuids.find(id) != uuids.end()); } -void FSWSAssetBlacklist::addNewItemToBlacklist(const LLUUID& id, const std::string& name, const std::string& region, LLAssetType::EType type, bool save) +void FSWSAssetBlacklist::addNewItemToBlacklist(const LLUUID& id, const std::string& name, const std::string& region, LLAssetType::EType type, bool permanent /*= true*/, bool save /*= true*/) { if (isBlacklisted(id, type)) { @@ -104,13 +104,14 @@ void FSWSAssetBlacklist::addNewItemToBlacklist(const LLUUID& id, const std::stri data["asset_region"] = region; data["asset_type"] = type; data["asset_date"] = input_date; + data["asset_permanent"] = permanent; addNewItemToBlacklistData(id, data, save); } void FSWSAssetBlacklist::removeItemFromBlacklist(const LLUUID& id) { - gObjectList.removeDerenderedItem( id ); + gObjectList.removeDerenderedItem(id); blacklist_data_t::iterator it; it = mBlacklistData.find(id); @@ -126,7 +127,7 @@ void FSWSAssetBlacklist::removeItemFromBlacklist(const LLUUID& id) mBlacklistTypeContainer[type].erase(id); mBlacklistData.erase(it); - saveBlacklist(); + saveBlacklist(); } void FSWSAssetBlacklist::addNewItemToBlacklistData(const LLUUID& id, const LLSD& data, bool save) @@ -135,7 +136,7 @@ void FSWSAssetBlacklist::addNewItemToBlacklistData(const LLUUID& id, const LLSD& addEntryToBlacklistMap(id, type); mBlacklistData[id] = data; - gObjectList.addDerenderedItem( id, true ); + gObjectList.addDerenderedItem(id, true); if (type == LLAssetType::AT_SOUND) { @@ -156,7 +157,7 @@ void FSWSAssetBlacklist::addNewItemToBlacklistData(const LLUUID& id, const LLSD& saveBlacklist(); } - FSFloaterWSAssetBlacklist* floater = LLFloaterReg::getTypedInstance("ws_asset_blacklist"); + FSFloaterWSAssetBlacklist* floater = LLFloaterReg::findTypedInstance("ws_asset_blacklist"); if (floater) { floater->addElementToList(id, data); @@ -202,6 +203,7 @@ void FSWSAssetBlacklist::loadBlacklist() LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); cipher.decrypt(uid.mData, UUID_BYTES); LLSD entry_data = itr->second; + entry_data["asset_permanent"] = true; // For conversion of old data if (uid.isNull()) { continue; @@ -245,12 +247,8 @@ void FSWSAssetBlacklist::loadBlacklist() newdata["asset_name"] = "[PHOENIX] " + data["entry_name"].asString(); newdata["asset_type"] = type; newdata["asset_date"] = data["entry_date"].asString(); + newdata["asset_permanent"] = true; // For conversion of old data - //if (!data["ID_hashed"].asBoolean()) - //{ - // uid = LLUUID::generateNewID(uid.asString() + "hash"); - //} - addNewItemToBlacklistData(uid, newdata, false); } } @@ -272,13 +270,15 @@ void FSWSAssetBlacklist::saveBlacklist() for (blacklist_data_t::const_iterator itr = mBlacklistData.begin(); itr != mBlacklistData.end(); ++itr) { - // Apply "cheesy encryption" to obfuscate these to the user. - LLUUID shadow_id(itr->first); - LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); - cipher.encrypt(shadow_id.mData, UUID_BYTES); - savedata[shadow_id.asString()] = itr->second; + if (itr->second["asset_permanent"].asBoolean()) + { + LLUUID shadow_id(itr->first); + LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES); + cipher.encrypt(shadow_id.mData, UUID_BYTES); + savedata[shadow_id.asString()] = itr->second; + } } - LLSDSerialize::toPrettyXML(savedata, save_file); + LLSDSerialize::toPrettyXML(savedata, save_file); save_file.close(); } diff --git a/indra/newview/fswsassetblacklist.h b/indra/newview/fswsassetblacklist.h index fd6a93b98d..96c0b7d23a 100644 --- a/indra/newview/fswsassetblacklist.h +++ b/indra/newview/fswsassetblacklist.h @@ -43,7 +43,7 @@ class FSWSAssetBlacklist : public LLSingleton public: void init(); bool isBlacklisted(const LLUUID& id, LLAssetType::EType type); - void addNewItemToBlacklist(const LLUUID& id, const std::string& name, const std::string& region, LLAssetType::EType type, bool save = true); + void addNewItemToBlacklist(const LLUUID& id, const std::string& name, const std::string& region, LLAssetType::EType type, bool permanent = true, bool save = true); void addNewItemToBlacklistData(const LLUUID& id, const LLSD& data, bool save = true); void removeItemFromBlacklist(const LLUUID& id); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 5037e4ac5f..3986796f1a 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -2324,10 +2324,7 @@ void LLAvatarActions::derenderMultiple(const uuid_vec_t& agent_ids, bool permane //static void LLAvatarActions::onDerenderAvatarNameLookup(const LLUUID& agent_id, const LLAvatarName& av_name, bool permanent) { - if (permanent) - { - FSWSAssetBlacklist::getInstance()->addNewItemToBlacklist(agent_id, av_name.getUserName(), "", LLAssetType::AT_PERSON); - } + FSWSAssetBlacklist::getInstance()->addNewItemToBlacklist(agent_id, av_name.getUserName(), "", LLAssetType::AT_PERSON, permanent, permanent); LLViewerObject* av_obj = gObjectList.findObject(agent_id); if (av_obj) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ea497f2bf8..7692456e08 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2870,39 +2870,36 @@ void derenderObject(bool permanent) if ( (objp) && (gAgentID != objp->getID()) && ((!rlv_handler_t::isEnabled()) || (!objp->isAttachment()) || (!objp->permYouOwner())) ) // [/RLVa:KB] { - if (permanent) - { - std::string entry_name = ""; - std::string region_name; - LLAssetType::EType asset_type; + std::string entry_name = ""; + std::string region_name; + LLAssetType::EType asset_type; - if (objp->isAvatar()) - { - LLNameValue* firstname = objp->getNVPair("FirstName"); - LLNameValue* lastname = objp->getNVPair("LastName"); - entry_name = llformat("%s %s", firstname->getString(), lastname->getString()); - asset_type = LLAssetType::AT_PERSON; - } - else - { - LLSelectNode* nodep = select_mgr->getSelection()->getFirstRootNode(); - if (nodep) - { - if (!nodep->mName.empty()) - { - entry_name = nodep->mName; - } - } - LLViewerRegion* region = objp->getRegion(); - if (region) - { - region_name = region->getName(); - } - asset_type = LLAssetType::AT_OBJECT; - } - - FSWSAssetBlacklist::getInstance()->addNewItemToBlacklist(objp->getID(), entry_name, region_name, asset_type); + if (objp->isAvatar()) + { + LLNameValue* firstname = objp->getNVPair("FirstName"); + LLNameValue* lastname = objp->getNVPair("LastName"); + entry_name = llformat("%s %s", firstname->getString(), lastname->getString()); + asset_type = LLAssetType::AT_PERSON; } + else + { + LLSelectNode* nodep = select_mgr->getSelection()->getFirstRootNode(); + if (nodep) + { + if (!nodep->mName.empty()) + { + entry_name = nodep->mName; + } + } + LLViewerRegion* region = objp->getRegion(); + if (region) + { + region_name = region->getName(); + } + asset_type = LLAssetType::AT_OBJECT; + } + + FSWSAssetBlacklist::getInstance()->addNewItemToBlacklist(objp->getID(), entry_name, region_name, asset_type, permanent, permanent); select_mgr->deselectObjectOnly(objp); diff --git a/indra/newview/skins/default/xui/de/floater_asset_blacklist.xml b/indra/newview/skins/default/xui/de/floater_asset_blacklist.xml index 28a1d6f53d..3425d60db2 100644 --- a/indra/newview/skins/default/xui/de/floater_asset_blacklist.xml +++ b/indra/newview/skins/default/xui/de/floater_asset_blacklist.xml @@ -26,6 +26,7 @@ +