diff --git a/doc/contributions.txt b/doc/contributions.txt index 6e7d734bd4..656ac899b2 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -351,6 +351,7 @@ Cinder Roxley STORM-2113 STORM-2124 STORM-2127 + STORM-2136 Clara Young Coaldust Numbers VWR-1095 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); diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 2b1d097a2d..4f4d8e89f3 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -364,12 +364,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if (right_x) { - F32 cr_x = (cur_x - origin.mV[VX]) / sScaleX; - if (*right_x < cr_x) - { - // rightmost edge of previously drawn text, don't draw over previous text - *right_x = cr_x; - } + *right_x = (cur_x - origin.mV[VX]) / sScaleX; } //FIXME: add underline as glyph? diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index beb0256080..0d90f0138a 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2479,7 +2479,17 @@ void LLFloaterView::restoreAll() // make sure all subwindows aren't minimized for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { - LLFloater* floaterp = dynamic_cast(*child_it); + LLFloater* floaterp = NULL; + try + { + floaterp = dynamic_cast(*child_it); + } + catch (std::exception e) // See MAINT-6511 + { + LL_WARNS() << "Caught exception: " << e.what() << LL_ENDL; + continue; + } + if (floaterp) { floaterp->setMinimized(FALSE); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 566cae0e7b..8f9a2be345 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2633,7 +2633,10 @@ void LLTextEditor::updateLinkSegments() // if the link's label (what the user can edit) is a valid Url, // then update the link's HREF to be the same as the label text. // This lets users edit Urls in-place. - if (LLUrlRegistry::instance().hasUrl(url_label)) + // FIRE-20054: Only update link's HREF to label text if the user can edit the text + //if (LLUrlRegistry::instance().hasUrl(url_label)) + if (LLUrlRegistry::instance().hasUrl(url_label) && !getReadOnly()) + // { std::string new_url = wstring_to_utf8str(url_label); LLStringUtil::trim(new_url); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 949d0dd4cd..ca0266882b 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -127,6 +127,7 @@ set(viewer_SOURCE_FILES floatermedialists.cpp fsareasearch.cpp fsareasearchmenu.cpp + fsassetblacklist.cpp fsavatarrenderpersistence.cpp fsavatarsearchmenu.cpp fsblocklistmenu.cpp @@ -139,6 +140,7 @@ set(viewer_SOURCE_FILES fsdroptarget.cpp fsexportperms.cpp fsfloateraddtocontactset.cpp + fsfloaterassetblacklist.cpp fsfloateravatarrendersettings.cpp fsfloaterblocklist.cpp fsfloatercontacts.cpp @@ -160,12 +162,12 @@ set(viewer_SOURCE_FILES fsfloatervoicecontrols.cpp fsfloatervolumecontrols.cpp fsfloatervramusage.cpp - fsfloaterwsassetblacklist.cpp fskeywords.cpp fslightshare.cpp fslslbridge.cpp fslslbridgerequest.cpp fslslpreproc.cpp + fslslpreprocviewer.cpp fsmoneytracker.cpp fsnamelistavatarmenu.cpp fsnearbychatbarlistener.cpp @@ -191,7 +193,6 @@ set(viewer_SOURCE_FILES fsscrolllistctrl.cpp fssearchableui.cpp fsslurlcommand.cpp - fswsassetblacklist.cpp groupchatlistener.cpp kcwlinterface.cpp lggbeamcolormapfloater.cpp @@ -867,6 +868,7 @@ set(viewer_HEADER_FILES floatermedialists.h fsareasearch.h fsareasearchmenu.h + fsassetblacklist.h fsavatarrenderpersistence.h fsavatarsearchmenu.h fsblocklistmenu.h @@ -880,6 +882,7 @@ set(viewer_HEADER_FILES fsdroptarget.h fsexportperms.h fsfloateraddtocontactset.h + fsfloaterassetblacklist.h fsfloateravatarrendersettings.h fsfloaterblocklist.h fsfloatercontacts.h @@ -901,13 +904,13 @@ set(viewer_HEADER_FILES fsfloatervoicecontrols.h fsfloatervolumecontrols.h fsfloatervramusage.h - fsfloaterwsassetblacklist.h fsgridhandler.h fskeywords.h fslightshare.h fslslbridge.h fslslbridgerequest.h fslslpreproc.h + fslslpreprocviewer.h fsmoneytracker.h fsnamelistavatarmenu.h fsnearbychatbarlistener.h @@ -934,7 +937,6 @@ set(viewer_HEADER_FILES fssearchableui.h fsslurl.h fsslurlcommand.h - fswsassetblacklist.h groupchatlistener.h llaccountingcost.h kcwlinterface.h diff --git a/indra/newview/NACLfloaterexploresounds.cpp b/indra/newview/NACLfloaterexploresounds.cpp index 239ecb7967..c9e27c5fd4 100644 --- a/indra/newview/NACLfloaterexploresounds.cpp +++ b/indra/newview/NACLfloaterexploresounds.cpp @@ -12,7 +12,7 @@ #include "llavatarnamecache.h" #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "fswsassetblacklist.h" +#include "fsassetblacklist.h" #include "fscommon.h" static const size_t num_collision_sounds = 28; @@ -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); + FSAssetBlacklist::getInstance()->addNewItemToBlacklist(asset_id, av_name.getCompleteName(), region_name, LLAssetType::AT_SOUND); } diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index bd84d34b70..d745b3c380 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -420,9 +420,9 @@ label_ref="Command_Asset_Blacklist_Label" tooltip_ref="Command_Asset_Blacklist_Tooltip" execute_function="Floater.Toggle" - execute_parameters="ws_asset_blacklist" + execute_parameters="fs_asset_blacklist" is_running_function="Floater.IsOpen" - is_running_parameters="ws_asset_blacklist" + is_running_parameters="fs_asset_blacklist" /> - FSFloaterBlacklistSortColumn - - Comment - SortColumn for the Blacklist. - Persist - 1 - Type - String - Value - date - - FSFloaterBlacklistSortAscending - - Comment - SortOrder for the Blacklist. - Persist - 1 - Type - Boolean - Value - 0 - FSLandmarkCreatedNotification Comment @@ -24185,6 +24163,17 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + FSTempDerenderUntilTeleport + + Comment + If enabled, temporary derendered objects will stay derendered until teleport. If disabled, they stay derendered until the end of the session or get manually re-rendered via asset blacklist floater. + Persist + 1 + Type + Boolean + Value + 1 + diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index 26e2938e21..c7547e9809 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -52,7 +52,7 @@ #include "fslslbridge.h" #include "llcombobox.h" #include "llnotificationsutil.h" -#include "fswsassetblacklist.h" +#include "fsassetblacklist.h" #include "llworld.h" #include "lltrans.h" // getString() #include "llagentcamera.h" // gAgentCamera @@ -1623,7 +1623,7 @@ bool FSPanelAreaSearchList::onContextMenuItemClick(const LLSD& userdata) { region_name = objectp->getRegion()->getName(); } - FSWSAssetBlacklist::getInstance()->addNewItemToBlacklist(object_id, mFSAreaSearch->mObjectDetails[object_id].name, region_name, LLAssetType::AT_OBJECT); + FSAssetBlacklist::getInstance()->addNewItemToBlacklist(object_id, mFSAreaSearch->mObjectDetails[object_id].name, region_name, LLAssetType::AT_OBJECT); gObjectList.killObject(objectp); } } diff --git a/indra/newview/fswsassetblacklist.cpp b/indra/newview/fsassetblacklist.cpp similarity index 72% rename from indra/newview/fswsassetblacklist.cpp rename to indra/newview/fsassetblacklist.cpp index 13df41ee4d..b024a0589b 100644 --- a/indra/newview/fswsassetblacklist.cpp +++ b/indra/newview/fsassetblacklist.cpp @@ -1,10 +1,11 @@ /** - * @file fswsassetblacklist.cpp + * @file fsassetblacklist.cpp * @brief Asset Blacklist and Derender * * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ * Phoenix Firestorm Viewer Source Code * Copyright (C) 2012, Wolfspirit Magic + * Copyright (C) 2016, Ansariel Hiller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,9 +28,9 @@ #include "llviewerprecompiledheaders.h" -#include "fswsassetblacklist.h" +#include "fsassetblacklist.h" -#include "fsfloaterwsassetblacklist.h" +#include "fsfloaterassetblacklist.h" #include "llaudioengine.h" #include "llfloaterreg.h" #include "llsdserialize.h" @@ -62,13 +63,13 @@ LLAssetType::EType S32toAssetType(S32 assetindex) return type; } -void FSWSAssetBlacklist::init() +void FSAssetBlacklist::init() { mBlacklistFileName = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "asset_blacklist.xml"); loadBlacklist(); } -bool FSWSAssetBlacklist::isBlacklisted(const LLUUID& id, LLAssetType::EType type) +bool FSAssetBlacklist::isBlacklisted(const LLUUID& id, LLAssetType::EType type) { if (mBlacklistData.empty()) { @@ -76,7 +77,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 +88,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 FSAssetBlacklist::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,20 +105,21 @@ 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) +bool FSAssetBlacklist::removeItem(const LLUUID& id) { - gObjectList.removeDerenderedItem( id ); + gObjectList.removeDerenderedItem(id); blacklist_data_t::iterator it; it = mBlacklistData.find(id); if (it == mBlacklistData.end()) { - return; + return false; } LLSD data = it->second; @@ -126,16 +128,50 @@ void FSWSAssetBlacklist::removeItemFromBlacklist(const LLUUID& id) mBlacklistTypeContainer[type].erase(id); mBlacklistData.erase(it); - saveBlacklist(); + return data["asset_permanent"].asBoolean(); } -void FSWSAssetBlacklist::addNewItemToBlacklistData(const LLUUID& id, const LLSD& data, bool save) +void FSAssetBlacklist::removeItemFromBlacklist(const LLUUID& id) +{ + uuid_vec_t ids; + ids.push_back(id); + removeItemsFromBlacklist(ids); +} + +void FSAssetBlacklist::removeItemsFromBlacklist(const uuid_vec_t& ids) +{ + if (!ids.empty()) + { + bool need_save = false; + LLSD data; + + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + if (removeItem(*it)) + { + need_save = true; + } + data.append((*it).asString()); + } + + if (need_save) + { + saveBlacklist(); + } + + if (!mBlacklistChangedCallback.empty()) + { + mBlacklistChangedCallback(data, BLACKLIST_REMOVE); + } + } +} + +void FSAssetBlacklist::addNewItemToBlacklistData(const LLUUID& id, const LLSD& data, bool save) { LLAssetType::EType type = S32toAssetType(data["asset_type"].asInteger()); addEntryToBlacklistMap(id, type); mBlacklistData[id] = data; - gObjectList.addDerenderedItem( id, true ); if (type == LLAssetType::AT_SOUND) { @@ -156,14 +192,13 @@ void FSWSAssetBlacklist::addNewItemToBlacklistData(const LLUUID& id, const LLSD& saveBlacklist(); } - FSFloaterWSAssetBlacklist* floater = LLFloaterReg::getTypedInstance("ws_asset_blacklist"); - if (floater) + if (!mBlacklistChangedCallback.empty()) { - floater->addElementToList(id, data); + mBlacklistChangedCallback(LLSD().with(id.asString(), data), BLACKLIST_ADD); } } -bool FSWSAssetBlacklist::addEntryToBlacklistMap(const LLUUID& id, LLAssetType::EType type) +bool FSAssetBlacklist::addEntryToBlacklistMap(const LLUUID& id, LLAssetType::EType type) { if (id.isNull()) { @@ -186,7 +221,7 @@ bool FSWSAssetBlacklist::addEntryToBlacklistMap(const LLUUID& id, LLAssetType::E return true; } -void FSWSAssetBlacklist::loadBlacklist() +void FSAssetBlacklist::loadBlacklist() { if (gDirUtilp->fileExists(mBlacklistFileName)) { @@ -202,6 +237,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; @@ -212,6 +248,10 @@ void FSWSAssetBlacklist::loadBlacklist() { continue; } + else if (type == LLAssetType::AT_OBJECT) + { + gObjectList.addDerenderedItem(uid, true); + } addNewItemToBlacklistData(uid, entry_data, false); } @@ -240,17 +280,17 @@ void FSWSAssetBlacklist::loadBlacklist() continue; } LLAssetType::EType type = S32toAssetType(data["entry_type"].asInteger()); - + if (type == LLAssetType::AT_OBJECT) + { + gObjectList.addDerenderedItem(uid, true); + } + LLSD newdata; 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); } } @@ -265,20 +305,22 @@ void FSWSAssetBlacklist::loadBlacklist() } } -void FSWSAssetBlacklist::saveBlacklist() +void FSAssetBlacklist::saveBlacklist() { llofstream save_file(mBlacklistFileName.c_str()); LLSD savedata; 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/fsassetblacklist.h similarity index 73% rename from indra/newview/fswsassetblacklist.h rename to indra/newview/fsassetblacklist.h index fd6a93b98d..a6b4cf87b1 100644 --- a/indra/newview/fswsassetblacklist.h +++ b/indra/newview/fsassetblacklist.h @@ -1,10 +1,11 @@ /** - * @file fswsassetblacklist.h + * @file fsassetblacklist.h * @brief Asset Blacklist and Derender * * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ * Phoenix Firestorm Viewer Source Code * Copyright (C) 2012, Wolfspirit Magic + * Copyright (C) 2016, Ansariel Hiller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,8 +26,8 @@ * $/LicenseInfo$ */ -#ifndef FS_WSASSETBLACKLIST_H -#define FS_WSASSETBLACKLIST_H +#ifndef FS_ASSETBLACKLIST_H +#define FS_ASSETBLACKLIST_H #include #include @@ -38,25 +39,41 @@ typedef boost::unordered_set blacklisted_uuid_container_t; typedef std::map blacklist_type_map_t; typedef boost::unordered_map blacklist_data_t; -class FSWSAssetBlacklist : public LLSingleton +class FSAssetBlacklist : 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); + void removeItemsFromBlacklist(const uuid_vec_t& ids); + void saveBlacklist(); blacklist_data_t getBlacklistData() const { return mBlacklistData; }; + enum eBlacklistOperation + { + BLACKLIST_ADD, + BLACKLIST_REMOVE + }; + + typedef boost::signals2::signal blacklist_changed_callback_t; + boost::signals2::connection setBlacklistChangedCallback(const blacklist_changed_callback_t::slot_type& cb) + { + return mBlacklistChangedCallback.connect(cb); + } + private: void loadBlacklist(); - void saveBlacklist(); + bool removeItem(const LLUUID& id); bool addEntryToBlacklistMap(const LLUUID& id, LLAssetType::EType type); std::string mBlacklistFileName; blacklist_type_map_t mBlacklistTypeContainer; blacklist_data_t mBlacklistData; + + blacklist_changed_callback_t mBlacklistChangedCallback; }; -#endif // FS_WSASSETBLACKLIST_H +#endif // FS_ASSETBLACKLIST_H diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp index 27f4031256..96d9e84233 100644 --- a/indra/newview/fsdata.cpp +++ b/indra/newview/fsdata.cpp @@ -33,7 +33,7 @@ #include "fsdata.h" #include "fscommon.h" #include "fscorehttputil.h" -#include "fswsassetblacklist.h" +#include "fsassetblacklist.h" /* boost: will not compile unless equivalent is undef'd, beware. */ #include "fix_macros.h" @@ -471,11 +471,12 @@ 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; } - FSWSAssetBlacklist::instance().addNewItemToBlacklistData(uid, data, false); + FSAssetBlacklist::instance().addNewItemToBlacklistData(uid, data, false); LL_DEBUGS("fsdata") << "Added " << uid << " to assets list." << LL_ENDL; } } diff --git a/indra/newview/fsfloaterassetblacklist.cpp b/indra/newview/fsfloaterassetblacklist.cpp new file mode 100644 index 0000000000..d46e8254d7 --- /dev/null +++ b/indra/newview/fsfloaterassetblacklist.cpp @@ -0,0 +1,255 @@ +/** + * @file fsfloaterassetblacklist.cpp + * @brief Floater for Asset Blacklist and Derender + * + * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ + * Phoenix Firestorm Viewer Source Code + * Copyright (C) 2012, Wolfspirit Magic + * Copyright (C) 2016, Ansariel Hiller + * + * 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 + * + * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA + * http://www.firestormviewer.org + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "fsfloaterassetblacklist.h" + +#include "fsscrolllistctrl.h" +#include "llfiltereditor.h" +#include "llfloaterreg.h" +#include "llviewercontrol.h" +#include "llviewerobjectlist.h" + + +FSFloaterAssetBlacklist::FSFloaterAssetBlacklist(const LLSD& key) + : LLFloater(key), + mResultList(NULL), + mFilterSubString(LLStringUtil::null), + mFilterSubStringOrig(LLStringUtil::null), + mBlacklistCallbackConnection() +{ +} + +FSFloaterAssetBlacklist::~FSFloaterAssetBlacklist() +{ + if (mBlacklistCallbackConnection.connected()) + { + mBlacklistCallbackConnection.disconnect(); + } +} + +BOOL FSFloaterAssetBlacklist::postBuild() +{ + mResultList = getChild("result_list"); + mResultList->setContextMenu(&FSFloaterAssetBlacklistMenu::gFSAssetBlacklistMenu); + mResultList->setFilterColumn(0); + + childSetAction("remove_btn", boost::bind(&FSFloaterAssetBlacklist::onRemoveBtn, this)); + childSetAction("remove_temp_btn", boost::bind(&FSFloaterAssetBlacklist::onRemoveAllTemporaryBtn, this)); + childSetAction("close_btn", boost::bind(&FSFloaterAssetBlacklist::onCloseBtn, this)); + + getChild("filter_input")->setCommitCallback(boost::bind(&FSFloaterAssetBlacklist::onFilterEdit, this, _2)); + + mBlacklistCallbackConnection = FSAssetBlacklist::getInstance()->setBlacklistChangedCallback(boost::bind(&FSFloaterAssetBlacklist::onBlacklistChanged, this, _1, _2)); + + return TRUE; +} + +void FSFloaterAssetBlacklist::onOpen(const LLSD& key) +{ + mResultList->clearRows(); + buildBlacklist(); +} + +std::string FSFloaterAssetBlacklist::getTypeString(S32 type) +{ + switch (type) + { + case 0: + return getString("asset_texture"); + case 1: + return getString("asset_sound"); + case 6: + return getString("asset_object"); + case 45: + return getString("asset_resident"); + default: + return getString("asset_unknown"); + } +} + +void FSFloaterAssetBlacklist::buildBlacklist() +{ + bool needs_sort = mResultList->isSorted(); + mResultList->setNeedsSort(false); + + blacklist_data_t data = FSAssetBlacklist::instance().getBlacklistData(); + + for (blacklist_data_t::const_iterator iterator = data.begin(); iterator != data.end(); ++iterator) + { + addElementToList(iterator->first, iterator->second); + } + + mResultList->setNeedsSort(needs_sort); + mResultList->updateSort(); +} + +void FSFloaterAssetBlacklist::addElementToList(const LLUUID& id, const LLSD& data) +{ + // Undo the persisted date in legacy format... + std::string asset_date = data["asset_date"].asString() + "Z"; + asset_date.replace(asset_date.find(" "), 1, "T"); + LLDate date(asset_date); + + std::string date_str = getString("DateFormatString"); + LLSD substitution; + substitution["datetime"] = date.secondsSinceEpoch(); + LLStringUtil::format(date_str, substitution); + + LLSD element; + element["id"] = id; + element["columns"][0]["column"] = "name"; + element["columns"][0]["type"] = "text"; + element["columns"][0]["value"] = !data["asset_name"].asString().empty() ? data["asset_name"].asString() : getString("unknown_object"); + element["columns"][1]["column"] = "region"; + element["columns"][1]["type"] = "text"; + element["columns"][1]["value"] = !data["asset_region"].asString().empty() ? data["asset_region"].asString() : getString("unknown_region"); + element["columns"][2]["column"] = "type"; + element["columns"][2]["type"] = "text"; + element["columns"][2]["value"] = getTypeString(data["asset_type"].asInteger()); + element["columns"][3]["column"] = "date"; + element["columns"][3]["type"] = "text"; + element["columns"][3]["value"] = date_str; + 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; + element["columns"][5]["column"] = "date_sort"; + element["columns"][5]["type"] = "text"; + element["columns"][5]["value"] = llformat("%u", (U64)date.secondsSinceEpoch()); + + mResultList->addElement(element, ADD_BOTTOM); +} + +void FSFloaterAssetBlacklist::removeElements() +{ + uuid_vec_t items; + std::vector list = mResultList->getAllSelected(); + + for (std::vector::const_iterator it = list.begin(); it != list.end(); ++it) + { + items.push_back((*it)->getUUID()); + } + + FSAssetBlacklist::instance().removeItemsFromBlacklist(items); +} + +void FSFloaterAssetBlacklist::onBlacklistChanged(const LLSD& data, FSAssetBlacklist::eBlacklistOperation op) +{ + if (op == FSAssetBlacklist::BLACKLIST_ADD) + { + bool need_sort = mResultList->isSorted(); + mResultList->setNeedsSort(false); + + for (LLSD::map_const_iterator it = data.beginMap(); it != data.endMap(); ++it) + { + LLUUID id = LLUUID(it->first); + LLSD insert_data = it->second; + addElementToList(id, insert_data); + } + + mResultList->setNeedsSort(need_sort); + mResultList->updateSort(); + } + else + { + for (LLSD::array_const_iterator it = data.beginArray(); it != data.endArray(); ++it) + { + mResultList->deleteItems(*it); + } + mResultList->updateLayout(); + } +} + +void FSFloaterAssetBlacklist::onRemoveBtn() +{ + removeElements(); +} + +void FSFloaterAssetBlacklist::onRemoveAllTemporaryBtn() +{ + gObjectList.resetDerenderList(true); +} + +void FSFloaterAssetBlacklist::onCloseBtn() +{ + closeFloater(); +} + +void FSFloaterAssetBlacklist::onFilterEdit(const std::string& search_string) +{ + mFilterSubStringOrig = search_string; + LLStringUtil::trimHead(mFilterSubStringOrig); + // Searches are case-insensitive + std::string search_upper = mFilterSubStringOrig; + LLStringUtil::toUpper(search_upper); + + if (mFilterSubString == search_upper) + { + return; + } + + mFilterSubString = search_upper; + + // Apply new filter. + mResultList->setFilterString(mFilterSubStringOrig); +} + +//--------------------------------------------------------------------------- +// Context menu +//--------------------------------------------------------------------------- +namespace FSFloaterAssetBlacklistMenu +{ + LLContextMenu* FSAssetBlacklistMenu::createMenu() + { + // set up the callbacks for all of the avatar menu items + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + + registrar.add("Blacklist.Remove", boost::bind(&FSAssetBlacklistMenu::onContextMenuItemClick, this, _2)); + + // create the context menu from the XUI + return createFromFile("menu_fs_asset_blacklist.xml"); + } + + void FSAssetBlacklistMenu::onContextMenuItemClick(const LLSD& param) + { + std::string command = param.asString(); + + if (command == "remove") + { + FSFloaterAssetBlacklist* floater = LLFloaterReg::findTypedInstance("fs_asset_blacklist"); + if (floater) + { + floater->removeElements(); + } + } + } + + FSAssetBlacklistMenu gFSAssetBlacklistMenu; +} diff --git a/indra/newview/fsfloaterwsassetblacklist.h b/indra/newview/fsfloaterassetblacklist.h similarity index 55% rename from indra/newview/fsfloaterwsassetblacklist.h rename to indra/newview/fsfloaterassetblacklist.h index 171e4f96b1..02160daf1a 100644 --- a/indra/newview/fsfloaterwsassetblacklist.h +++ b/indra/newview/fsfloaterassetblacklist.h @@ -1,10 +1,11 @@ /** - * @file fsfloaterwsassetblacklist.h + * @file fsfloaterassetblacklist.h * @brief Floater for Asset Blacklist and Derender * * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ * Phoenix Firestorm Viewer Source Code * Copyright (C) 2012, Wolfspirit Magic + * Copyright (C) 2016, Ansariel Hiller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,34 +26,61 @@ * $/LicenseInfo$ */ -#ifndef FS_FLOATERWSASSETBLACKLIST_H -#define FS_FLOATERWSASSETBLACKLIST_H +#ifndef FS_FLOATERASSETBLACKLIST_H +#define FS_FLOATERASSETBLACKLIST_H +#include "fsassetblacklist.h" #include "llfloater.h" +#include "lllistcontextmenu.h" -class LLScrollListCtrl; +class FSScrollListCtrl; -class FSFloaterWSAssetBlacklist : public LLFloater +class FSFloaterAssetBlacklist : public LLFloater { - LOG_CLASS(FSFloaterWSAssetBlacklist); + LOG_CLASS(FSFloaterAssetBlacklist); + public: - FSFloaterWSAssetBlacklist(const LLSD& key); - virtual ~FSFloaterWSAssetBlacklist(); + FSFloaterAssetBlacklist(const LLSD& key); + virtual ~FSFloaterAssetBlacklist(); /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ BOOL postBuild(); - std::string getTypeString(S32 type); - void buildBlacklist(); void addElementToList(const LLUUID& id, const LLSD& data); - void removeElementFromList(const LLUUID& id); + void removeElements(); protected: void onRemoveBtn(); - void onCancelBtn(); + void onRemoveAllTemporaryBtn(); + void onCloseBtn(); + void onFilterEdit(const std::string& search_string); + void onBlacklistChanged(const LLSD& data, FSAssetBlacklist::eBlacklistOperation op); + + void buildBlacklist(); + std::string getTypeString(S32 type); private: - LLScrollListCtrl* mResultList; + FSScrollListCtrl* mResultList; + + std::string mFilterSubString; + std::string mFilterSubStringOrig; + + boost::signals2::connection mBlacklistCallbackConnection; }; +namespace FSFloaterAssetBlacklistMenu +{ + + class FSAssetBlacklistMenu : public LLListContextMenu + { + public: + /*virtual*/ LLContextMenu* createMenu(); + private: + void onContextMenuItemClick(const LLSD& param); + }; + + extern FSAssetBlacklistMenu gFSAssetBlacklistMenu; + +} // namespace FSFloaterAssetBlacklistMenu + #endif // FS_FLOATERWSASSETBLACKLIST_H diff --git a/indra/newview/fsfloateravatarrendersettings.cpp b/indra/newview/fsfloateravatarrendersettings.cpp index 85aeaef0fb..88f380bcff 100644 --- a/indra/newview/fsfloateravatarrendersettings.cpp +++ b/indra/newview/fsfloateravatarrendersettings.cpp @@ -29,6 +29,7 @@ #include "fsfloateravatarrendersettings.h" +#include "llfiltereditor.h" #include "llnamelistctrl.h" #include "lltrans.h" #include "llviewercontrol.h" @@ -39,7 +40,9 @@ FSFloaterAvatarRenderSettings::FSFloaterAvatarRenderSettings(const LLSD& key) : LLFloater(key), mAvatarList(NULL), - mRenderSettingChangedCallbackConnection() + mRenderSettingChangedCallbackConnection(), + mFilterSubString(LLStringUtil::null), + mFilterSubStringOrig(LLStringUtil::null) { } @@ -75,9 +78,12 @@ BOOL FSFloaterAvatarRenderSettings::postBuild() { mAvatarList = getChild("avatar_list"); mAvatarList->setContextMenu(&FSFloaterAvatarRenderPersistenceMenu::gFSAvatarRenderPersistenceMenu); + mAvatarList->setFilterColumn(0); childSetAction("close_btn", boost::bind(&FSFloaterAvatarRenderSettings::onCloseBtn, this)); + getChild("filter_input")->setCommitCallback(boost::bind(&FSFloaterAvatarRenderSettings::onFilterEdit, this, _2)); + mRenderSettingChangedCallbackConnection = FSAvatarRenderPersistence::instance().setAvatarRenderSettingChangedCallback(boost::bind(&FSFloaterAvatarRenderSettings::onAvatarRenderSettingChanged, this, _1, _2)); loadInitialList(); @@ -108,7 +114,28 @@ void FSFloaterAvatarRenderSettings::onAvatarRenderSettingChanged(const LLUUID& a } } +void FSFloaterAvatarRenderSettings::onFilterEdit(const std::string& search_string) +{ + mFilterSubStringOrig = search_string; + LLStringUtil::trimHead(mFilterSubStringOrig); + // Searches are case-insensitive + std::string search_upper = mFilterSubStringOrig; + LLStringUtil::toUpper(search_upper); + if (mFilterSubString == search_upper) + { + return; + } + + mFilterSubString = search_upper; + + // Apply new filter. + mAvatarList->setFilterString(mFilterSubStringOrig); +} + +//--------------------------------------------------------------------------- +// Context menu +//--------------------------------------------------------------------------- namespace FSFloaterAvatarRenderPersistenceMenu { diff --git a/indra/newview/fsfloateravatarrendersettings.h b/indra/newview/fsfloateravatarrendersettings.h index ec5f302f0c..75d70308e2 100644 --- a/indra/newview/fsfloateravatarrendersettings.h +++ b/indra/newview/fsfloateravatarrendersettings.h @@ -46,6 +46,7 @@ public: private: void onCloseBtn(); + void onFilterEdit(const std::string& search_string); void onAvatarRenderSettingChanged(const LLUUID& avatar_id, LLVOAvatar::VisualMuteSettings render_setting); void loadInitialList(); @@ -54,6 +55,9 @@ private: LLNameListCtrl* mAvatarList; boost::signals2::connection mRenderSettingChangedCallbackConnection; + + std::string mFilterSubString; + std::string mFilterSubStringOrig; }; diff --git a/indra/newview/fsfloaterwsassetblacklist.cpp b/indra/newview/fsfloaterwsassetblacklist.cpp deleted file mode 100644 index fce09c2663..0000000000 --- a/indra/newview/fsfloaterwsassetblacklist.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/** - * @file fsfloaterwsassetblacklist.cpp - * @brief Floater for Asset Blacklist and Derender - * - * $LicenseInfo:firstyear=2012&license=fsviewerlgpl$ - * Phoenix Firestorm Viewer Source Code - * Copyright (C) 2012, Wolfspirit Magic - * - * 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 - * - * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA - * http://www.firestormviewer.org - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "fsfloaterwsassetblacklist.h" - -#include "fswsassetblacklist.h" -#include "llscrolllistctrl.h" -#include "llviewercontrol.h" - - -FSFloaterWSAssetBlacklist::FSFloaterWSAssetBlacklist(const LLSD& key) - : LLFloater(key) -{ -} - -FSFloaterWSAssetBlacklist::~FSFloaterWSAssetBlacklist() -{ - if (mResultList) - { - gSavedSettings.setString("FSFloaterBlacklistSortColumn", mResultList->getSortColumnName()); - gSavedSettings.setBOOL("FSFloaterBlacklistSortAscending", mResultList->getSortAscending()); - } -} - -std::string FSFloaterWSAssetBlacklist::getTypeString(S32 type) -{ - switch (type) - { - case 0: - return getString("asset_texture"); - case 1: - return getString("asset_sound"); - case 6: - return getString("asset_object"); - case 45: - return getString("asset_resident"); - default: - return getString("asset_unknown"); - } -} - -void FSFloaterWSAssetBlacklist::buildBlacklist() -{ - blacklist_data_t data = FSWSAssetBlacklist::instance().getBlacklistData(); - - for (blacklist_data_t::const_iterator iterator = data.begin(); iterator != data.end(); ++iterator) - { - addElementToList(iterator->first, iterator->second); - } -} - -void FSFloaterWSAssetBlacklist::addElementToList(const LLUUID& id, const LLSD& data) -{ - LLSD element; - element["id"] = id; - element["columns"][0]["column"] = "name"; - element["columns"][0]["type"] = "text"; - element["columns"][0]["value"] = !data["asset_name"].asString().empty() ? data["asset_name"].asString() : getString("unknown_object"); - element["columns"][1]["column"] = "region"; - element["columns"][1]["type"] = "text"; - element["columns"][1]["value"] = !data["asset_region"].asString().empty() ? data["asset_region"].asString() : getString("unknown_region"); - element["columns"][2]["column"] = "type"; - element["columns"][2]["type"] = "text"; - element["columns"][2]["value"] = getTypeString(data["asset_type"].asInteger()); - element["columns"][3]["column"] = "date"; - element["columns"][3]["type"] = "text"; - element["columns"][3]["value"] = data["asset_date"].asString(); - - mResultList->addElement(element, ADD_BOTTOM); -} - -void FSFloaterWSAssetBlacklist::removeElementFromList(const LLUUID& id) -{ - mResultList->deleteSingleItem(mResultList->getItemIndex(id)); -} - - -void FSFloaterWSAssetBlacklist::onOpen(const LLSD& key) -{ - mResultList->clearRows(); - buildBlacklist(); -} - -BOOL FSFloaterWSAssetBlacklist::postBuild() -{ - mResultList = getChild("result_list"); - childSetAction("remove_btn", boost::bind(&FSFloaterWSAssetBlacklist::onRemoveBtn, this)); - std::string order_by = gSavedSettings.getString("FSFloaterBlacklistSortColumn"); - BOOL ascending = gSavedSettings.getBOOL("FSFloaterBlacklistSortAscending"); - - if (!order_by.empty()) - { - mResultList->sortByColumn(order_by, ascending); - } - - return TRUE; -} - -void FSFloaterWSAssetBlacklist::onRemoveBtn() -{ - std::vector list = mResultList->getAllSelected(); - - for (std::vector::const_iterator it = list.begin(); it != list.end(); ++it) - { - FSWSAssetBlacklist::instance().removeItemFromBlacklist((*it)->getUUID()); - } - - mResultList->deleteSelectedItems(); -} - -void FSFloaterWSAssetBlacklist::onCancelBtn() -{ - closeFloater(); -} diff --git a/indra/newview/fslslpreproc.cpp b/indra/newview/fslslpreproc.cpp index abeac9f2f3..147f7bc5b4 100644 --- a/indra/newview/fslslpreproc.cpp +++ b/indra/newview/fslslpreproc.cpp @@ -35,10 +35,10 @@ #include "fslslpreproc.h" +#include "fslslpreprocviewer.h" #include "llagent.h" #include "llappviewer.h" #include "llinventoryfunctions.h" -#include "llscripteditor.h" #include "lltrans.h" #include "llvfile.h" #include "llviewercontrol.h" @@ -1558,7 +1558,7 @@ void FSLSLPreprocessor::start_process() } else { - LLTextEditor* outfield = mCore->mPostEditor; + FSLSLPreProcViewer* outfield = mCore->mPostEditor; if (outfield) { outfield->setText(LLStringExplicit(output)); @@ -1603,7 +1603,7 @@ void FSLSLPreprocessor::FSProcCacheCallback(LLVFS *vfs, const LLUUID& uuid, LLAs void FSLSLPreprocessor::preprocess_script(BOOL close, bool sync, bool defcache) { - LLTextEditor* outfield = mCore->mPostEditor; + FSLSLPreProcViewer* outfield = mCore->mPostEditor; if (outfield) { outfield->setText(LLStringExplicit(mCore->mEditor->getText())); diff --git a/indra/newview/fslslpreprocviewer.cpp b/indra/newview/fslslpreprocviewer.cpp new file mode 100644 index 0000000000..03f2b24f8c --- /dev/null +++ b/indra/newview/fslslpreprocviewer.cpp @@ -0,0 +1,57 @@ +/** + * @file fslslpreprocviewer.cpp + * @brief Specialized LLScriptEditor class for displaying LSL preprocessor output + * + * $LicenseInfo:firstyear=2016&license=viewerlgpl$ + * Phoenix Firestorm Viewer Source Code + * Copyright (c) 2016 Ansariel Hiller @ Second Life + * + * 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 + * + * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA + * http://www.firestormviewer.org + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "fslslpreprocviewer.h" + +static LLDefaultChildRegistry::Register r("fs_lsl_preproc_viewer"); + +FSLSLPreProcViewer::FSLSLPreProcViewer(const Params& p) +: LLScriptEditor(p) +{ +} + +BOOL FSLSLPreProcViewer::handleKeyHere(KEY key, MASK mask ) +{ + // Normal key handling + BOOL handled = handleNavigationKey( key, mask ) + || handleSelectionKey(key, mask) + || handleControlKey(key, mask); + + if (handled) + { + resetCursorBlink(); + needsScroll(); + } + + return handled; +} + +BOOL FSLSLPreProcViewer::handleUnicodeCharHere(llwchar uni_char) +{ + return FALSE; +} diff --git a/indra/newview/fslslpreprocviewer.h b/indra/newview/fslslpreprocviewer.h new file mode 100644 index 0000000000..7c5c09dec3 --- /dev/null +++ b/indra/newview/fslslpreprocviewer.h @@ -0,0 +1,60 @@ +/** + * @file fslslpreprocviewer.h + * @brief Specialized LLScriptEditor class for displaying LSL preprocessor output + * + * $LicenseInfo:firstyear=2016&license=viewerlgpl$ + * Phoenix Firestorm Viewer Source Code + * Copyright (c) 2016 Ansariel Hiller @ Second Life + * + * 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 + * + * The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA + * http://www.firestormviewer.org + * $/LicenseInfo$ + */ + +#ifndef FS_LSLPREPROCVIEWER_H +#define FS_LSLPREPROCVIEWER_H + +#include "llscripteditor.h" + +class FSLSLPreProcViewer : public LLScriptEditor +{ +public: + + struct Params : public LLInitParam::Block + { + Params() + {} + }; + + virtual ~FSLSLPreProcViewer() {}; + + virtual BOOL handleKeyHere(KEY key, MASK mask ); + virtual BOOL handleUnicodeCharHere(llwchar uni_char); + + virtual BOOL canCut() const { return false; } + virtual BOOL canPaste() const { return false; } + virtual BOOL canUndo() const { return false; } + virtual BOOL canRedo() const { return false; } + virtual BOOL canPastePrimary() const { return false; } + virtual BOOL canDoDelete() const { return false; } + +protected: + friend class LLUICtrlFactory; + FSLSLPreProcViewer(const Params& p); +}; + +#endif // FS_LSLPREPROCVIEWER_H diff --git a/indra/newview/fsradar.cpp b/indra/newview/fsradar.cpp index 80dc23d22b..abe0700c0b 100644 --- a/indra/newview/fsradar.cpp +++ b/indra/newview/fsradar.cpp @@ -36,11 +36,11 @@ #include "lleventtimer.h" // newview +#include "fsassetblacklist.h" #include "fscommon.h" #include "fskeywords.h" #include "fslslbridge.h" #include "fslslbridgerequest.h" -#include "fswsassetblacklist.h" #include "lggcontactsets.h" #include "lfsimfeaturehandler.h" #include "llagent.h" @@ -176,7 +176,7 @@ void FSRadar::updateRadarList() //Configuration LLWorld* world = LLWorld::getInstance(); LLMuteList* mutelist = LLMuteList::getInstance(); - FSWSAssetBlacklist* blacklist = FSWSAssetBlacklist::getInstance(); + FSAssetBlacklist* blacklist = FSAssetBlacklist::getInstance(); const F32 chat_range_say = LFSimFeatureHandler::getInstance()->sayRange(); const F32 chat_range_shout = LFSimFeatureHandler::getInstance()->shoutRange(); 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; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 71dae1cd54..8dc21e9579 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3762,7 +3762,7 @@ void LLAgent::initOriginGlobal(const LLVector3d &origin_global) } BOOL LLAgent::leftButtonGrabbed() const -{ +{ const BOOL camera_mouse_look = gAgentCamera.cameraMouselook(); return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) || (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0) @@ -3770,13 +3770,6 @@ BOOL LLAgent::leftButtonGrabbed() const || (camera_mouse_look && mControlsTakenPassedOnCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0); } -BOOL LLAgent::leftButtonBlocked() const -{ - const BOOL camera_mouse_look = gAgentCamera.cameraMouselook(); - return (!camera_mouse_look && mControlsTakenCount[CONTROL_LBUTTON_DOWN_INDEX] > 0) - || (camera_mouse_look && mControlsTakenCount[CONTROL_ML_LBUTTON_DOWN_INDEX] > 0); -} - BOOL LLAgent::rotateGrabbed() const { return (mControlsTakenCount[CONTROL_YAW_POS_INDEX] > 0) @@ -4327,14 +4320,7 @@ BOOL LLAgent::anyControlGrabbed() const BOOL LLAgent::isControlGrabbed(S32 control_index) const { - if (gAgent.mControlsTakenCount[control_index] > 0) - return TRUE; - return gAgent.mControlsTakenPassedOnCount[control_index] > 0; -} - -BOOL LLAgent::isControlBlocked(S32 control_index) const -{ - return mControlsTakenCount[control_index] > 0; + return mControlsTakenCount[control_index] > 0; } void LLAgent::forceReleaseControls() diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 0cf1c2933a..2848177b9f 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -527,8 +527,7 @@ private: // Grab //-------------------------------------------------------------------- public: - BOOL leftButtonGrabbed() const; - BOOL leftButtonBlocked() const; + BOOL leftButtonGrabbed() const; BOOL rotateGrabbed() const; BOOL forwardGrabbed() const; BOOL backwardGrabbed() const; @@ -545,9 +544,8 @@ public: BOOL controlFlagsDirty() const; void enableControlFlagReset(); void resetControlFlags(); - BOOL anyControlGrabbed() const; // True if a script has taken over any control - BOOL isControlGrabbed(S32 control_index) const; // True if a script has taken over a control - BOOL isControlBlocked(S32 control_index) const; // Control should be ignored or won't be passed + BOOL anyControlGrabbed() const; // True iff a script has taken over a control + BOOL isControlGrabbed(S32 control_index) const; // Send message to simulator to force grabbed controls to be // released, in case of a poorly written script. void forceReleaseControls(); diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 71860effe2..42139919a8 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1502,19 +1502,21 @@ void LLAgentCamera::updateCamera() LLVector3 chest_scale = chest_joint->getScale(); // shorten avatar skeleton to avoid foot interpenetration - if (!gAgentAvatarp->mInAir) - { - LLVector3 chest_offset = LLVector3(0.f, 0.f, chest_joint->getPosition().mV[VZ]) * torso_joint->getWorldRotation(); - F32 z_compensate = llclamp(-diff.mV[VZ], -0.2f, 1.f); - F32 scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / chest_offset.mV[VZ]), 0.5f, 1.2f); - torso_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); + // FIRE-10574: Attachments in mouselook glitching up + //if (!gAgentAvatarp->mInAir) + //{ + // LLVector3 chest_offset = LLVector3(0.f, 0.f, chest_joint->getPosition().mV[VZ]) * torso_joint->getWorldRotation(); + // F32 z_compensate = llclamp(-diff.mV[VZ], -0.2f, 1.f); + // F32 scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / chest_offset.mV[VZ]), 0.5f, 1.2f); + // torso_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); - LLJoint* neck_joint = gAgentAvatarp->mNeckp; - LLVector3 neck_offset = LLVector3(0.f, 0.f, neck_joint->getPosition().mV[VZ]) * chest_joint->getWorldRotation(); - scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / neck_offset.mV[VZ]), 0.5f, 1.2f); - chest_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); - diff.mV[VZ] = 0.f; - } + // LLJoint* neck_joint = gAgentAvatarp->mNeckp; + // LLVector3 neck_offset = LLVector3(0.f, 0.f, neck_joint->getPosition().mV[VZ]) * chest_joint->getWorldRotation(); + // scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / neck_offset.mV[VZ]), 0.5f, 1.2f); + // chest_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); + // diff.mV[VZ] = 0.f; + //} + // gAgentAvatarp->mPelvisp->setPosition(gAgentAvatarp->mPelvisp->getPosition() + diff); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 5037e4ac5f..1c4f7e4aad 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -86,7 +86,7 @@ #include "fsfloaterprofile.h" #include "fslslbridge.h" #include "fsradar.h" -#include "fswsassetblacklist.h" +#include "fsassetblacklist.h" #include "llfloaterregioninfo.h" #include "llfloaterreporter.h" #include "llparcel.h" @@ -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); - } + FSAssetBlacklist::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/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index 7fe5859399..492e050e6c 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; @@ -116,7 +117,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) { diff --git a/indra/newview/llfloatergotoline.cpp b/indra/newview/llfloatergotoline.cpp index 3b34f03532..07552266e0 100644 --- a/indra/newview/llfloatergotoline.cpp +++ b/indra/newview/llfloatergotoline.cpp @@ -107,13 +107,21 @@ void LLFloaterGotoLine::handleBtnGoto() row = getChild("goto_line")->getValue().asInteger(); if (row >= 0) { - if (mEditorCore && mEditorCore->mEditor) - { - mEditorCore->mEditor->deselect(); - mEditorCore->mEditor->setCursor(row, column); - mEditorCore->mEditor->setFocus(TRUE); - } - } + // LSL Preprocessor + // if (mEditorCore && mEditorCore->mEditor) + // { + //mEditorCore->mEditor->deselect(); + //mEditorCore->mEditor->setCursor(row, column); + //mEditorCore->mEditor->setFocus(TRUE); + // } + if (mEditorCore && mEditorCore->mCurrentEditor) + { + mEditorCore->mCurrentEditor->deselect(); + mEditorCore->mCurrentEditor->setCursor(row, column); + mEditorCore->mCurrentEditor->setFocus(TRUE); + } + // + } } bool LLFloaterGotoLine::hasAccelerators() const @@ -142,19 +150,35 @@ void LLFloaterGotoLine::onGotoBoxCommit() row = getChild("goto_line")->getValue().asInteger(); if (row >= 0) { - if (mEditorCore && mEditorCore->mEditor) - { - mEditorCore->mEditor->setCursor(row, column); + // LSL Preprocessor + // if (mEditorCore && mEditorCore->mEditor) + // { + //mEditorCore->mEditor->setCursor(row, column); - S32 rownew = 0; - S32 columnnew = 0; - mEditorCore->mEditor->getCurrentLineAndColumn( &rownew, &columnnew, FALSE ); // don't include wordwrap - if (rownew == row && columnnew == column) + //S32 rownew = 0; + //S32 columnnew = 0; + //mEditorCore->mEditor->getCurrentLineAndColumn( &rownew, &columnnew, FALSE ); // don't include wordwrap + //if (rownew == row && columnnew == column) + //{ + // mEditorCore->mEditor->deselect(); + // mEditorCore->mEditor->setFocus(TRUE); + // sInstance->closeFloater(); + //} //else do nothing (if the cursor-position didn't change) + // } + if (mEditorCore && mEditorCore->mCurrentEditor) { - mEditorCore->mEditor->deselect(); - mEditorCore->mEditor->setFocus(TRUE); - sInstance->closeFloater(); - } //else do nothing (if the cursor-position didn't change) - } + mEditorCore->mCurrentEditor->setCursor(row, column); + + S32 rownew = 0; + S32 columnnew = 0; + mEditorCore->mCurrentEditor->getCurrentLineAndColumn( &rownew, &columnnew, FALSE ); // don't include wordwrap + if (rownew == row && columnnew == column) + { + mEditorCore->mCurrentEditor->deselect(); + mEditorCore->mCurrentEditor->setFocus(TRUE); + sInstance->closeFloater(); + } //else do nothing (if the cursor-position didn't change) + } + // } } diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp index 89813cbb16..2f6307a506 100644 --- a/indra/newview/llfloaterpay.cpp +++ b/indra/newview/llfloaterpay.cpp @@ -74,6 +74,8 @@ struct LLGiveMoneyInfo mFloater(floater), mAmount(amount){} }; +typedef boost::shared_ptr give_money_ptr; + ///---------------------------------------------------------------------------- /// Class LLFloaterPay ///---------------------------------------------------------------------------- @@ -96,18 +98,18 @@ public: bool is_group); static bool payConfirmationCallback(const LLSD& notification, const LLSD& response, - LLGiveMoneyInfo* info); + give_money_ptr info); private: static void onCancel(void* data); static void onKeystroke(LLLineEditor* editor, void* data); - static void onGive(void* data); + static void onGive(give_money_ptr info); void give(S32 amount); static void processPayPriceReply(LLMessageSystem* msg, void **userdata); void finishPayUI(const LLUUID& target_id, BOOL is_group); protected: - std::vector mCallbackData; + std::vector mCallbackData; money_callback mCallback; LLTextBox* mObjectNameText; LLUUID mTargetUUID; @@ -115,7 +117,7 @@ protected: BOOL mHaveName; LLButton* mQuickPayButton[MAX_PAY_BUTTONS]; - LLGiveMoneyInfo* mQuickPayInfo[MAX_PAY_BUTTONS]; + give_money_ptr mQuickPayInfo[MAX_PAY_BUTTONS]; LLSafeHandle mObjectSelection; @@ -143,7 +145,11 @@ LLFloaterPay::LLFloaterPay(const LLSD& key) // Destroys the object LLFloaterPay::~LLFloaterPay() { - std::for_each(mCallbackData.begin(), mCallbackData.end(), DeletePointer()); + std::vector::iterator iter; + for (iter = mCallbackData.begin(); iter != mCallbackData.end(); ++iter) + { + (*iter)->mFloater = NULL; + } mCallbackData.clear(); // Name callbacks will be automatically disconnected since LLFloater is trackable @@ -155,40 +161,40 @@ BOOL LLFloaterPay::postBuild() { S32 i = 0; - LLGiveMoneyInfo* info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_0); + give_money_ptr info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_0)); mCallbackData.push_back(info); - childSetAction("fastpay 1",&LLFloaterPay::onGive,info); + childSetAction("fastpay 1", boost::bind(LLFloaterPay::onGive, info)); getChildView("fastpay 1")->setVisible(FALSE); mQuickPayButton[i] = getChild("fastpay 1"); mQuickPayInfo[i] = info; ++i; - info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_1); + info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_1)); mCallbackData.push_back(info); - childSetAction("fastpay 5",&LLFloaterPay::onGive,info); + childSetAction("fastpay 5", boost::bind(LLFloaterPay::onGive, info)); getChildView("fastpay 5")->setVisible(FALSE); mQuickPayButton[i] = getChild("fastpay 5"); mQuickPayInfo[i] = info; ++i; - info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_2); + info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_2)); mCallbackData.push_back(info); - childSetAction("fastpay 10",&LLFloaterPay::onGive,info); + childSetAction("fastpay 10", boost::bind(LLFloaterPay::onGive, info)); getChildView("fastpay 10")->setVisible(FALSE); mQuickPayButton[i] = getChild("fastpay 10"); mQuickPayInfo[i] = info; ++i; - info = new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_3); + info = give_money_ptr(new LLGiveMoneyInfo(this, PAY_BUTTON_DEFAULT_3)); mCallbackData.push_back(info); - childSetAction("fastpay 20",&LLFloaterPay::onGive,info); + childSetAction("fastpay 20", boost::bind(LLFloaterPay::onGive, info)); getChildView("fastpay 20")->setVisible(FALSE); mQuickPayButton[i] = getChild("fastpay 20"); @@ -210,10 +216,10 @@ BOOL LLFloaterPay::postBuild() getChild("amount")->setValue(last_amount); // - info = new LLGiveMoneyInfo(this, 0); + info = give_money_ptr(new LLGiveMoneyInfo(this, 0)); mCallbackData.push_back(info); - childSetAction("pay btn",&LLFloaterPay::onGive,info); + childSetAction("pay btn", boost::bind(LLFloaterPay::onGive, info)); setDefaultBtn("pay btn"); getChildView("pay btn")->setVisible(FALSE); // FIRE-16812: Remember last amount paid @@ -437,9 +443,9 @@ void LLFloaterPay::payDirectly(money_callback callback, floater->finishPayUI(target_id, is_group); } -bool LLFloaterPay::payConfirmationCallback(const LLSD& notification, const LLSD& response, LLGiveMoneyInfo* info) +bool LLFloaterPay::payConfirmationCallback(const LLSD& notification, const LLSD& response, give_money_ptr info) { - if (!info || !info->mFloater) + if (!info.get() || !info->mFloater) { return false; } @@ -501,57 +507,64 @@ void LLFloaterPay::onKeystroke(LLLineEditor*, void* data) } // static -void LLFloaterPay::onGive(void* data) +void LLFloaterPay::onGive(give_money_ptr info) { - LLGiveMoneyInfo* info = reinterpret_cast(data); - LLFloaterPay* floater = info->mFloater; - if(info && floater) - { - S32 amount = info->mAmount; - if(amount == 0) - { - amount = atoi(floater->getChild("amount")->getValue().asString().c_str()); - } - // FIRE-16092: Make payment confirmation customizable - //if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount) - if (gSavedSettings.getBOOL("FSConfirmPayments") && amount > gSavedSettings.getS32("FSPaymentConfirmationThreshold") && gStatusBar && gStatusBar->getBalance() > amount) - // - { - LLUUID payee_id = LLUUID::null; - BOOL is_group = false; - if (floater->mObjectSelection.notNull()) - { - LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); - if (node) - { - node->mPermissions->getOwnership(payee_id, is_group); - } - else - { - // object no longer exists - LLNotificationsUtil::add("PayObjectFailed"); - floater->closeFloater(); - return; - } - } - else - { - is_group = floater->mTargetIsGroup; - payee_id = floater->mTargetUUID; - } + if (!info.get() || !info->mFloater) + { + return; + } - LLSD args; - args["TARGET"] = LLSLURL( is_group ? "group" : "agent", payee_id, "completename").getSLURLString(); - args["AMOUNT"] = amount; + LLFloaterPay* floater = info->mFloater; + S32 amount = info->mAmount; + if (amount == 0) + { + LLUICtrl* text_field = floater->getChild("amount"); + if (!text_field) + { + return; + } + amount = atoi(text_field->getValue().asString().c_str()); + } - LLNotificationsUtil::add("PayConfirmation", args, LLSD(), boost::bind(&LLFloaterPay::payConfirmationCallback, _1, _2, info)); - } - else - { - floater->give(amount); - floater->closeFloater(); - } - } + // FIRE-16092: Make payment confirmation customizable + //if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount) + if (gSavedSettings.getBOOL("FSConfirmPayments") && amount > gSavedSettings.getS32("FSPaymentConfirmationThreshold") && gStatusBar && gStatusBar->getBalance() > amount) + // + { + LLUUID payee_id = LLUUID::null; + BOOL is_group = false; + if (floater->mObjectSelection.notNull()) + { + LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); + if (node) + { + node->mPermissions->getOwnership(payee_id, is_group); + } + else + { + // object no longer exists + LLNotificationsUtil::add("PayObjectFailed"); + floater->closeFloater(); + return; + } + } + else + { + is_group = floater->mTargetIsGroup; + payee_id = floater->mTargetUUID; + } + + LLSD args; + args["TARGET"] = LLSLURL(is_group ? "group" : "agent", payee_id, "completename").getSLURLString(); + args["AMOUNT"] = amount; + + LLNotificationsUtil::add("PayConfirmation", args, LLSD(), boost::bind(&LLFloaterPay::payConfirmationCallback, _1, _2, info)); + } + else + { + floater->give(amount); + floater->closeFloater(); + } } void LLFloaterPay::give(S32 amount) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6a7ca7d033..acea8ce71e 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -3159,7 +3159,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/llfloatersearchreplace.cpp b/indra/newview/llfloatersearchreplace.cpp index b0d014a1f6..0d7bab1266 100644 --- a/indra/newview/llfloatersearchreplace.cpp +++ b/indra/newview/llfloatersearchreplace.cpp @@ -136,11 +136,11 @@ BOOL LLFloaterSearchReplace::handleKeyHere(KEY key, MASK mask) } //static -void LLFloaterSearchReplace::show(LLTextEditor* pEditor) +LLFloaterSearchReplace* LLFloaterSearchReplace::show(LLTextEditor* pEditor) { LLFloaterSearchReplace* pSelf = LLFloaterReg::getTypedInstance("search_replace"); if ( (!pSelf) || (!pEditor) ) - return; + return NULL; LLFloater *pDependeeNew = NULL, *pDependeeOld = pSelf->getDependee(); LLView* pView = pEditor->getParent(); @@ -170,6 +170,14 @@ void LLFloaterSearchReplace::show(LLTextEditor* pEditor) pSelf->m_EditorHandle = pEditor->getHandle(); pSelf->openFloater(); + + return pSelf; +} + +//static +LLFloaterSearchReplace* LLFloaterSearchReplace::findInstance() +{ + return LLFloaterReg::findTypedInstance("search_replace"); } LLTextEditor* LLFloaterSearchReplace::getEditor() const @@ -213,4 +221,10 @@ void LLFloaterSearchReplace::onReplaceAllClick() } } +void LLFloaterSearchReplace::setCanReplace(bool can_replace) +{ + m_pReplaceEditor->setEnabled(can_replace); + getChild("replace_btn")->setEnabled(can_replace); + getChild("replace_all_btn")->setEnabled(can_replace); +} // ============================================================================ diff --git a/indra/newview/llfloatersearchreplace.h b/indra/newview/llfloatersearchreplace.h index 4a53047b26..2f887a5d56 100644 --- a/indra/newview/llfloatersearchreplace.h +++ b/indra/newview/llfloatersearchreplace.h @@ -46,14 +46,17 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& sdKey); /*virtual*/ void onClose(bool fQuiting); + void setCanReplace(bool can_replace); /* * Member functions */ public: - static void show(LLTextEditor* pEditor); -protected: + static LLFloaterSearchReplace* show(LLTextEditor* pEditor); + static LLFloaterSearchReplace* findInstance(); LLTextEditor* getEditor() const; + +protected: void refreshHighlight(); void onSearchClick(); void onSearchKeystroke(); 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/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 9ce83cf58a..fd91689d17 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -451,9 +451,16 @@ void LLGroupActions::show(const LLUUID& group_id) } } - if (floater && floater->isMinimized()) + if (floater) { - floater->setMinimized(FALSE); + if (floater->isMinimized()) + { + floater->setMinimized(FALSE); + } + if (!floater->hasFocus()) + { + floater->setFocus(TRUE); + } } // } diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 6f89217474..924ed377c2 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1048,7 +1048,11 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) std::string uuid = self->getClickUUID(); LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << target << "\", uri is " << url << LL_ENDL; - LLWeb::loadURL(url, target, std::string()); + // try as slurl first + if (!LLURLDispatcher::dispatch(url, "clicked", NULL, mTrusted)) + { + LLWeb::loadURL(url, target, std::string()); + } // CP: removing this code because we no longer support popups so this breaks the flow. // replaced with a bare call to LLWeb::LoadURL(...) diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 80dada39cb..c3ae9c4c39 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -100,17 +100,21 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification) LLUUID from_id = notification->getPayload()["from_id"]; //Will not play a notification sound for inventory and teleport offer based upon chat preference + // Notification sounds + //bool playSound = (!notification->isDND() + // && ((notification->getName() == "UserGiveItem" + // && gSavedSettings.getBOOL("PlaySoundInventoryOffer")) + // || (notification->getName() == "TeleportOffered" + // && gSavedSettings.getBOOL("PlaySoundTeleportOffer")))); + const std::string notif_name = notification->getName(); bool playSound = (!notification->isDND() - && ((notification->getName() == "UserGiveItem" - // UI Sounds support - // && gSavedSettings.getBOOL("PlaySoundInventoryOffer")) - && gSavedSettings.getBOOL("PlayModeUISndInventoryOffer")) - // - || (notification->getName() == "TeleportOffered" - // UI Sounds support - // && gSavedSettings.getBOOL("PlaySoundTeleportOffer")))); - && gSavedSettings.getBOOL("PlayModeUISndTeleportOffer")))); - // + && ((notif_name == "UserGiveItem" + && gSavedSettings.getBOOL("PlayModeUISndInventoryOffer")) + || ((notif_name == "TeleportOffered" || notif_name == "TeleportOffered_SLUrl" || + notif_name == "TeleportOffered_MaturityExceeded" || notif_name == "TeleportOffered_MaturityExceeded_SLUrl" || + notif_name == "TeleportOffered_MaturityBlocked" || notif_name == "TeleportOffered_MaturityBlocked_SLUrl") + && gSavedSettings.getBOOL("PlayModeUISndTeleportOffer")))); + // if(playSound) { 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 acb9a52364..d02067fd4d 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -1436,7 +1436,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 2aac3b31f9..4bd6680dc1 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -623,7 +623,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/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 2aa51c2e2f..812282565b 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -98,6 +98,7 @@ // NaCl - LSL Preprocessor #include "fslslpreproc.h" +#include "fslslpreprocviewer.h" // NaCl End #ifdef OPENSIM #include "llviewernetwork.h" // for Grid manager @@ -423,6 +424,8 @@ LLScriptEdCore::LLScriptEdCore( // FIRE-10606, patch by Sei Lisa mLSLProc(NULL), mPostEditor(NULL), + mCurrentEditor(NULL), + mPreprocTab(NULL), // mCompiling(false), // Compile indicators, recompile button mHasScriptData(FALSE), @@ -548,18 +551,18 @@ BOOL LLScriptEdCore::postBuild() mEditor = getChild("Script Editor"); // NaCl - LSL Preprocessor + mCurrentEditor = mEditor; if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor")) { - mPostEditor = getChild("Post Editor"); - if (mPostEditor) - { - mPostEditor->setFollowsAll(); - mPostEditor->setEnabled(TRUE); - } + mPostEditor = getChild("Post Editor"); + mPostEditor->setFollowsAll(); + mPostEditor->setEnabled(TRUE); + + mPreprocTab = getChild("Tabset"); + mPreprocTab->setCommitCallback(boost::bind(&LLScriptEdCore::onPreprocTabChanged, this, _2)); } // FIRE-16042: Warn when preproc is toggled. - mTogglePreprocConnection = gSavedSettings.getControl("_NACL_LSLPreprocessor")->getSignal() - ->connect(boost::bind(&LLScriptEdCore::onToggleProc, this)); + mTogglePreprocConnection = gSavedSettings.getControl("_NACL_LSLPreprocessor")->getSignal()->connect(boost::bind(&LLScriptEdCore::onToggleProc, this)); // NaCl End childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this); @@ -694,41 +697,73 @@ void LLScriptEdCore::initMenu() menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::hasChanged, this)); menuItem = getChild("Revert All Changes"); - menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnUndoChanges, this)); - menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::hasChanged, this)); + // LSL Preprocessor + //menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnUndoChanges, this)); + //menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::hasChanged, this)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Revert All Changes")); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableAction, this, "Revert All Changes")); + // menuItem = getChild("Undo"); - menuItem->setClickCallback(boost::bind(&LLTextEditor::undo, mEditor)); - menuItem->setEnableCallback(boost::bind(&LLTextEditor::canUndo, mEditor)); + // LSL Preprocessor + //menuItem->setClickCallback(boost::bind(&LLTextEditor::undo, mEditor)); + //menuItem->setEnableCallback(boost::bind(&LLTextEditor::canUndo, mEditor)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Undo")); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableAction, this, "Undo")); + // menuItem = getChild("Redo"); - menuItem->setClickCallback(boost::bind(&LLTextEditor::redo, mEditor)); - menuItem->setEnableCallback(boost::bind(&LLTextEditor::canRedo, mEditor)); + // LSL Preprocessor + //menuItem->setClickCallback(boost::bind(&LLTextEditor::redo, mEditor)); + //menuItem->setEnableCallback(boost::bind(&LLTextEditor::canRedo, mEditor)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Redo")); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableAction, this, "Redo")); + // menuItem = getChild("Cut"); - menuItem->setClickCallback(boost::bind(&LLTextEditor::cut, mEditor)); - menuItem->setEnableCallback(boost::bind(&LLTextEditor::canCut, mEditor)); + // LSL Preprocessor + //menuItem->setClickCallback(boost::bind(&LLTextEditor::cut, mEditor)); + //menuItem->setEnableCallback(boost::bind(&LLTextEditor::canCut, mEditor)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Cut")); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableAction, this, "Cut")); + // menuItem = getChild("Copy"); - menuItem->setClickCallback(boost::bind(&LLTextEditor::copy, mEditor)); - menuItem->setEnableCallback(boost::bind(&LLTextEditor::canCopy, mEditor)); + // LSL Preprocessor + //menuItem->setClickCallback(boost::bind(&LLTextEditor::copy, mEditor)); + //menuItem->setEnableCallback(boost::bind(&LLTextEditor::canCopy, mEditor)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Copy")); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableAction, this, "Copy")); + // menuItem = getChild("Paste"); - menuItem->setClickCallback(boost::bind(&LLTextEditor::paste, mEditor)); - menuItem->setEnableCallback(boost::bind(&LLTextEditor::canPaste, mEditor)); + // LSL Preprocessor + //menuItem->setClickCallback(boost::bind(&LLTextEditor::paste, mEditor)); + //menuItem->setEnableCallback(boost::bind(&LLTextEditor::canPaste, mEditor)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Paste")); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableAction, this, "Paste")); + // menuItem = getChild("Select All"); - menuItem->setClickCallback(boost::bind(&LLTextEditor::selectAll, mEditor)); - menuItem->setEnableCallback(boost::bind(&LLTextEditor::canSelectAll, mEditor)); + // LSL Preprocessor + //menuItem->setClickCallback(boost::bind(&LLTextEditor::selectAll, mEditor)); + //menuItem->setEnableCallback(boost::bind(&LLTextEditor::canSelectAll, mEditor)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Select All")); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableAction, this, "Select All")); + // menuItem = getChild("Deselect"); - menuItem->setClickCallback(boost::bind(&LLTextEditor::deselect, mEditor)); - menuItem->setEnableCallback(boost::bind(&LLTextEditor::canDeselect, mEditor)); + // LSL Preprocessor + //menuItem->setClickCallback(boost::bind(&LLTextEditor::deselect, mEditor)); + //menuItem->setEnableCallback(boost::bind(&LLTextEditor::canDeselect, mEditor)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Deselect")); + menuItem->setEnableCallback(boost::bind(&LLScriptEdCore::enableAction, this, "Deselect")); + // menuItem = getChild("Search / Replace..."); // menuItem->setClickCallback(boost::bind(&LLFloaterScriptSearch::show, this)); // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-10-26 (Catznip-2.3.0a) | Added: Catznip-2.3.0a - menuItem->setClickCallback(boost::bind(&LLFloaterSearchReplace::show, mEditor)); + menuItem->setClickCallback(boost::bind(&LLScriptEdCore::performAction, this, "Search")); // [/SL:KB] menuItem = getChild("Go to line..."); @@ -757,24 +792,24 @@ void LLScriptEdCore::initButtonBar() { mSaveBtn->setClickedCallback(boost::bind(&LLScriptEdCore::doSave, this, FALSE, true)); mSaveBtn2->setClickedCallback(boost::bind(&LLScriptEdCore::doSave, this, FALSE, true)); // support extra save button - mCutBtn->setClickedCallback(boost::bind(&LLTextEditor::cut, mEditor)); - mCopyBtn->setClickedCallback(boost::bind(&LLTextEditor::copy, mEditor)); - mPasteBtn->setClickedCallback(boost::bind(&LLTextEditor::paste, mEditor)); - mUndoBtn->setClickedCallback(boost::bind(&LLTextEditor::undo, mEditor)); - mRedoBtn->setClickedCallback(boost::bind(&LLTextEditor::redo, mEditor)); + mCutBtn->setClickedCallback(boost::bind(&LLScriptEdCore::performAction, this, "Cut")); + mCopyBtn->setClickedCallback(boost::bind(&LLScriptEdCore::performAction, this, "Copy")); + mPasteBtn->setClickedCallback(boost::bind(&LLScriptEdCore::performAction, this, "Paste")); + mUndoBtn->setClickedCallback(boost::bind(&LLScriptEdCore::performAction, this, "Undo")); + mRedoBtn->setClickedCallback(boost::bind(&LLScriptEdCore::performAction, this, "Redo")); mSaveToDiskBtn->setClickedCallback(boost::bind(&LLScriptEdCore::onBtnSaveToFile, this)); mLoadFromDiskBtn->setClickedCallback(boost::bind(&LLScriptEdCore::onBtnLoadFromFile, this)); - mSearchBtn->setClickedCallback(boost::bind(&LLFloaterSearchReplace::show, mEditor)); + mSearchBtn->setClickedCallback(boost::bind(&LLScriptEdCore::performAction, this, "Search")); } void LLScriptEdCore::updateButtonBar() { mSaveBtn->setEnabled(hasChanged() && !mScriptRemoved); - mCutBtn->setEnabled(mEditor->canCut()); - mCopyBtn->setEnabled(mEditor->canCopy()); - mPasteBtn->setEnabled(mEditor->canPaste()); - mUndoBtn->setEnabled(mEditor->canUndo()); - mRedoBtn->setEnabled(mEditor->canRedo()); + mCutBtn->setEnabled(mCurrentEditor->canCut()); + mCopyBtn->setEnabled(mCurrentEditor->canCopy()); + mPasteBtn->setEnabled(mCurrentEditor->canPaste()); + mUndoBtn->setEnabled(mCurrentEditor->canUndo()); + mRedoBtn->setEnabled(mCurrentEditor->canRedo()); mSaveToDiskBtn->setEnabled(mEditor->canLoadOrSaveToFile()); mLoadFromDiskBtn->setEnabled(mEditor->canLoadOrSaveToFile()); // Recompile button @@ -819,6 +854,96 @@ void LLScriptEdCore::onToggleProc() mErrorList->deleteAllItems(); // Make it visible updateButtonBar(); // Update the save button in particular (FIRE-10173) } + +void LLScriptEdCore::onPreprocTabChanged(const std::string& tab_name) +{ + mCurrentEditor = (tab_name == "Preprocessed" ? mPostEditor : mEditor); + LLFloaterSearchReplace* search_floater = LLFloaterSearchReplace::findInstance(); + if (search_floater && (search_floater->getEditor() == mEditor || search_floater->getEditor() == mPostEditor)) + { + search_floater->setCanReplace(mCurrentEditor == mEditor); + } + childSetEnabled("Insert...", mCurrentEditor == mEditor); +} + +void LLScriptEdCore::performAction(const std::string& action) +{ + if (action == "Revert All Changes") + { + onBtnUndoChanges(); + } + else if (action == "Undo") + { + mCurrentEditor->undo(); + } + else if (action == "Redo") + { + mCurrentEditor->redo(); + } + else if (action == "Cut") + { + mCurrentEditor->cut(); + } + else if (action == "Copy") + { + mCurrentEditor->copy(); + } + else if (action == "Paste") + { + mCurrentEditor->paste(); + } + else if (action == "Select All") + { + mCurrentEditor->selectAll(); + } + else if (action == "Deselect") + { + mCurrentEditor->deselect(); + } + else if (action == "Search") + { + LLFloaterSearchReplace* floater = LLFloaterSearchReplace::show(mCurrentEditor); + floater->setCanReplace(mCurrentEditor == mEditor); + } +} + +bool LLScriptEdCore::enableAction(const std::string& action) +{ + if (action == "Revert All Changes") + { + return (mCurrentEditor == mEditor && hasChanged()); + } + else if (action == "Undo") + { + return mCurrentEditor->canUndo(); + } + else if (action == "Redo") + { + return mCurrentEditor->canRedo(); + } + else if (action == "Cut") + { + return mCurrentEditor->canCut(); + } + else if (action == "Copy") + { + return mCurrentEditor->canCopy(); + } + else if (action == "Paste") + { + return mCurrentEditor->canPaste(); + } + else if (action == "Select All") + { + return mCurrentEditor->canSelectAll(); + } + else if (action == "Deselect") + { + return mCurrentEditor->canDeselect(); + } + + return false; +} // NaCl End void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid) @@ -973,6 +1098,20 @@ void LLScriptEdCore::draw() cursor_pos = LLTrans::getString("CursorPos", args); mLineCol->setValue(cursor_pos); } + // LSL Preprocessor + else if (mPostEditor && mPostEditor->hasFocus()) + { + S32 line = 0; + S32 column = 0; + mPostEditor->getCurrentLineAndColumn( &line, &column, FALSE ); // don't include wordwrap + LLStringUtil::format_map_t args; + std::string cursor_pos; + args["[LINE]"] = llformat ("%d", line); + args["[COLUMN]"] = llformat ("%d", column); + cursor_pos = LLTrans::getString("CursorPos", args); + mLineCol->setValue(cursor_pos); + } + // else { mLineCol->setValue(LLStringUtil::null); @@ -1429,27 +1568,17 @@ void LLScriptEdCore::onErrorList(LLUICtrl*, void* user_data) //LL_INFOS() << "LLScriptEdCore::onErrorList() - " << row << ", " //<< column << LL_ENDL; // NaCl - LSL Preprocessor - if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor") && self->mPostEditor) + if (gSavedSettings.getBOOL("_NACL_LSLPreprocessor") && self->mPostEditor && self->mPreprocTab) { - LLPanel* tab = self->getChild("Preprocessed"); - LLTabContainer* tabset = self->getChild("Tabset"); - - if(tabset) - tabset->selectTabByName("Preprocessed"); - - if(tab) - tab->setFocus(TRUE); - - if( self->mPostEditor ) - { - self->mPostEditor->setFocus(TRUE); - self->mPostEditor->setCursor(row, column); - } + self->mPreprocTab->selectTabByName("Preprocessed"); + self->getChild("Preprocessed")->setFocus(TRUE); + self->mPostEditor->setFocus(TRUE); + self->mPostEditor->setCursor(row, column); } else { - self->mEditor->setCursor(row, column); - self->mEditor->setFocus(TRUE); + self->mEditor->setCursor(row, column); + self->mEditor->setFocus(TRUE); } // NaCl End } @@ -2101,7 +2230,8 @@ void LLPreviewLSL::onSearchReplace(void* userdata) LLScriptEdCore* sec = self->mScriptEd; // LLFloaterScriptSearch::show(sec); // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-10-26 (Catznip-2.3.0a) | Added: Catznip-2.3.0a - LLFloaterSearchReplace::show(sec->mEditor); + LLFloaterSearchReplace* floater = LLFloaterSearchReplace::show(sec->mCurrentEditor); + floater->setCanReplace(sec->mCurrentEditor == sec->mEditor); // [/SL:KB] } @@ -2714,7 +2844,8 @@ void LLLiveLSLEditor::onSearchReplace(void* userdata) LLScriptEdCore* sec = self->mScriptEd; // LLFloaterScriptSearch::show(sec); // [SL:KB] - Patch: UI-FloaterSearchReplace | Checked: 2010-10-26 (Catznip-2.3.0a) | Added: Catznip-2.3.0a - LLFloaterSearchReplace::show(sec->mEditor); + LLFloaterSearchReplace* floater = LLFloaterSearchReplace::show(sec->mCurrentEditor); + floater->setCanReplace(sec->mCurrentEditor == sec->mEditor); // [/SL:KB] } diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 4885db9a5a..d4fea5444b 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -58,6 +58,7 @@ class LLEventTimer; // [/SL:KB] // NaCl - LSL Preprocessor class FSLSLPreprocessor; +class FSLSLPreProcViewer; // NaCl End // Inner, implementation class. LLPreviewScript and LLLiveLSLEditor each own one of these. @@ -146,6 +147,10 @@ private: // NaCl - LSL Preprocessor void onToggleProc(); boost::signals2::connection mTogglePreprocConnection; + + void onPreprocTabChanged(const std::string& tab_name); + void performAction(const std::string& action); + bool enableAction(const std::string& action); // NaCl End void onBtnHelp(); void onBtnDynamicHelp(); @@ -217,9 +222,11 @@ private: LLButton* mSearchBtn; // // NaCl - LSL Preprocessor - FSLSLPreprocessor* mLSLProc; - LLScriptEditor* mPostEditor; - std::string mPostScript; + FSLSLPreprocessor* mLSLProc; + FSLSLPreProcViewer* mPostEditor; + LLScriptEditor* mCurrentEditor; + LLTabContainer* mPreprocTab; + std::string mPostScript; // NaCl End LLScriptEdContainer* mContainer; // parent view diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index bc63beeb6c..d0855157b6 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -215,6 +215,7 @@ #include "growlmanager.h" #endif +#include "fsassetblacklist.h" #include "fsavatarrenderpersistence.h" #include "fscommon.h" #include "fscorehttputil.h" @@ -227,7 +228,6 @@ #include "fsradar.h" #include "fsregistrarutils.h" #include "fsscriptlibrary.h" -#include "fswsassetblacklist.h" #include "lfsimfeaturehandler.h" #include "lggcontactsets.h" #include "llfloatersearch.h" @@ -1345,7 +1345,7 @@ bool idle_startup() LLFile::mkdir(user_windlight_days_path_name.c_str()); // Initalize Account based asset_blacklist - FSWSAssetBlacklist::getInstance()->init(); + FSAssetBlacklist::getInstance()->init(); // load per grid data FSData::instance().downloadAgents(); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 5da4fd3fe8..3dd46d0060 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -64,7 +64,7 @@ #include "llcorehttputil.h" #include "llhttpretrypolicy.h" -#include "fswsassetblacklist.h" //For Asset blacklist +#include "fsassetblacklist.h" //For Asset blacklist #include "llviewermenu.h" bool LLTextureFetchDebugger::sDebuggerEnabled = false ; @@ -1177,14 +1177,14 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == INIT) { - //asset blacklist - if(FSWSAssetBlacklist::getInstance()->isBlacklisted(mID,LLAssetType::AT_TEXTURE)) + // Asset Blacklist + if (FSAssetBlacklist::getInstance()->isBlacklisted(mID, LLAssetType::AT_TEXTURE)) { - LL_INFOS() << "Blacklisted texture asset blocked." << LL_ENDL; + LL_INFOS() << "Blacklisted texture asset blocked." << LL_ENDL; mState = DONE; return true; } - //end asset blacklist + // Asset Blacklist mRawImage = NULL ; mRequestedDiscard = -1; diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 42ef7510e7..da64fc844d 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -38,7 +38,6 @@ #include "lltoolfocus.h" #include "llfocusmgr.h" #include "llagent.h" -#include "llagentcamera.h" #include "llviewerjoystick.h" extern BOOL gDebugClicks; @@ -85,14 +84,7 @@ BOOL LLTool::handleMouseDown(S32 x, S32 y, MASK mask) } // by default, didn't handle it // LL_INFOS() << "LLTool::handleMouseDown" << LL_ENDL; - if (gAgentCamera.cameraMouselook()) - { - gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); - } - else - { - gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN); - } + gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_DOWN); return TRUE; } @@ -103,15 +95,8 @@ BOOL LLTool::handleMouseUp(S32 x, S32 y, MASK mask) LL_INFOS() << "LLTool left mouse up" << LL_ENDL; } // by default, didn't handle it - // LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL; - if (gAgentCamera.cameraMouselook()) - { - gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_UP); - } - else - { - gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP); - } + // LL_INFOS() << "LLTool::handleMouseUp" << LL_ENDL; + gAgent.setControlFlags(AGENT_CONTROL_LBUTTON_UP); return TRUE; } diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index c82e57183a..b9a4095ade 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -760,13 +760,12 @@ BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask) BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask) { - // if the left button is blocked, don't put up the pie menu - if (gAgent.leftButtonBlocked()) - { - // in case of "grabbed" control flag will be set later - gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); - return FALSE; - } + // if the left button is grabbed, don't put up the pie menu + if (gAgent.leftButtonGrabbed()) + { + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); + return FALSE; + } // On mousedown, start grabbing gGrabTransientTool = this; @@ -778,13 +777,12 @@ BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask) { - // if the left button is blocked, don't put up the pie menu - if (gAgent.leftButtonBlocked()) - { - // in case of "grabbed" control flag will be set later - gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); - return FALSE; - } + // if the left button is grabbed, don't put up the pie menu + if (gAgent.leftButtonGrabbed()) + { + gAgent.setControlFlags(AGENT_CONTROL_ML_LBUTTON_DOWN); + return FALSE; + } // On mousedown, start grabbing gGrabTransientTool = this; diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index ab46967160..e25d068ac6 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -146,10 +146,7 @@ BOOL LLToolGrab::handleMouseDown(S32 x, S32 y, MASK mask) // call the base class to propogate info to sim LLTool::handleMouseDown(x, y, mask); - // FIRE-19357: Hotfixing mouse capture in mouselook issue with minimal impact workaround for now - //if (!gAgent.leftButtonBlocked()) - if ((gAgentCamera.cameraMouselook() && !gAgent.leftButtonGrabbed()) || (!gAgentCamera.cameraMouselook() && !gAgent.leftButtonBlocked())) - // + if (!gAgent.leftButtonGrabbed()) { // can grab transparent objects (how touch event propagates, scripters rely on this) gViewerWindow->pickAsync(x, y, mask, pickCallback, /*BOOL pick_transparent*/ TRUE); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index f2f3b640f3..c6d7e30afa 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -951,13 +951,11 @@ static bool needs_tooltip(LLSelectNode* nodep) BOOL LLToolPie::handleTooltipLand(std::string line, std::string tooltip_msg) { - LLViewerParcelMgr::getInstance()->setHoverParcel( mHoverPick.mPosGlobal ); - // - // Do not show hover for land unless prefs are set to allow it. - // - + // Do not show hover for land unless prefs are set to allow it. if (!gSavedSettings.getBOOL("ShowLandHoverTip")) return TRUE; - + + LLViewerParcelMgr::getInstance()->setHoverParcel( mHoverPick.mPosGlobal ); + // Didn't hit an object, but since we have a land point we // must be hovering over land. diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 6c5afb8b3b..84842f6158 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -169,6 +169,7 @@ #include "floatermedialists.h" #include "fsareasearch.h" #include "fsfloateraddtocontactset.h" +#include "fsfloaterassetblacklist.h" #include "fsfloateravatarrendersettings.h" #include "fsfloatercontacts.h" #include "fsfloatercontactsetconfiguration.h" @@ -189,7 +190,6 @@ #include "fsfloatervoicecontrols.h" #include "fsfloatervolumecontrols.h" #include "fsfloatervramusage.h" -#include "fsfloaterwsassetblacklist.h" #include "fsmoneytracker.h" #include "fspanelclassified.h" #include "lggbeamcolormapfloater.h" @@ -440,6 +440,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("export_collada", "floater_export_collada.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("delete_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("floater_profile", "floater_profile_view.xml",&LLFloaterReg::build); + LLFloaterReg::add("fs_asset_blacklist", "floater_fs_asset_blacklist.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_avatar_render_settings", "floater_fs_avatar_render_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_blocklist", "floater_fs_blocklist.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("fs_add_contact", "floater_fs_contact_add.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); @@ -471,7 +472,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("script_recover", "floater_script_recover.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("sound_explorer", "floater_NACL_explore_sounds.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("vram_usage", "floater_fs_vram_usage.xml", static_cast( &LLFloaterReg::build< FSFloaterVRAMUsage >) ); - LLFloaterReg::add("ws_asset_blacklist", "floater_asset_blacklist.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::registerControlVariables(); // Make sure visibility and rect controls get preserved when saving } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 28f374c17b..6357e98840 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -141,13 +141,13 @@ // [/RLVa:KB] // Firestorm includes +#include "fsassetblacklist.h" #include "fsdata.h" #include "fslslbridge.h" #include "fscommon.h" #include "fsfloaterexport.h" #include "fsfloatercontacts.h" // Display group list in contacts floater #include "fspose.h" // FIRE-4345: Undeform -#include "fswsassetblacklist.h" #include "lfsimfeaturehandler.h" #include "llavatarpropertiesprocessor.h" // ## Zi: Texture Refresh #include "llsdserialize.h" @@ -2861,6 +2861,7 @@ void cleanup_menus() // FIRE-6970/FIRE-6998: Optional permanent derendering of multiple objects void derenderObject(bool permanent) { + bool need_save = false; LLViewerObject* objp; LLSelectMgr* select_mgr = LLSelectMgr::getInstance(); @@ -2872,47 +2873,84 @@ void derenderObject(bool permanent) if ( (objp) && (gAgentID != objp->getID()) && ((!rlv_handler_t::isEnabled()) || (!objp->isAttachment()) || (!objp->permYouOwner())) ) // [/RLVa:KB] { + LLUUID id = objp->getID(); + 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 + { + bool next_object = false; + LLViewerObject::child_list_t object_children = objp->getChildren(); + for (LLViewerObject::child_list_t::const_iterator it = object_children.begin(); it != object_children.end(); it++) + { + LLViewerObject* child = *it; + if (child->isAvatar() && child->asAvatar()->isSelf()) + { + if (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) + { + // RLVa: Prevent cheating out of sitting by derendering the object + select_mgr->deselectObjectOnly(objp); + next_object = true; + } + else + { + gAgent.standUp(); + } + break; + } + } + + if (next_object) + { + continue; + } + + 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; + } + + FSAssetBlacklist::getInstance()->addNewItemToBlacklist(id, entry_name, region_name, asset_type, permanent, false); + if (permanent) { - 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); + need_save = true; } select_mgr->deselectObjectOnly(objp); - - // Pass true to make sure this object stays dead. - // gObjectList.killObject(objp); - gObjectList.addDerenderedItem( objp->getID(), permanent ); + gObjectList.addDerenderedItem(id, permanent); gObjectList.killObject(objp); - // + if (LLViewerRegion::sVOCacheCullingEnabled && objp->getRegion()) + { + objp->getRegion()->killCacheEntry(objp->getLocalID()); + } + + LLTool* tool = LLToolMgr::getInstance()->getCurrentTool(); + LLViewerObject* tool_editing_object = tool->getEditingObject(); + if (tool_editing_object && tool_editing_object->mID == id) + { + tool->stopEditing(); + } + } else if( (objp) && (gAgentID != objp->getID()) && ((rlv_handler_t::isEnabled()) || (objp->isAttachment()) || (objp->permYouOwner())) ) { @@ -2920,6 +2958,11 @@ void derenderObject(bool permanent) return; } } + + if (need_save) + { + FSAssetBlacklist::getInstance()->saveBlacklist(); + } } class LLObjectDerenderPermanent : public view_listener_t @@ -7511,7 +7554,12 @@ void handle_viewer_disable_message_log(void*) void handle_customize_avatar() { // FIRE-19614: Make CTRL-O toggle the appearance floater - if (LLFloaterReg::instanceVisible("appearance")) + LLFloater* floater = LLFloaterReg::findInstance("appearance"); + if (floater && floater->isMinimized()) + { + floater->setMinimized(FALSE); + } + else if (LLFloater::isShown(floater)) { LLFloaterReg::hideInstance("appearance"); } @@ -10641,7 +10689,12 @@ void toggleTeleportHistory() } else { - if (LLFloaterReg::instanceVisible("places")) + LLFloater* floater = LLFloaterReg::findInstance("places"); + if (floater && floater->isMinimized()) + { + floater->setMinimized(FALSE); + } + else if (LLFloater::isShown(floater)) { LLFloaterReg::hideInstance("places"); } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 04acc6bc84..a62e8e78dc 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -138,6 +138,7 @@ // Firestorm inclues #include "animationexplorer.h" // Animation Explorer #include "fsareasearch.h" +#include "fsassetblacklist.h" #include "fscommon.h" #include "fsdata.h" #include "fsfloaterplacedetails.h" @@ -146,7 +147,6 @@ #include "fslightshare.h" // FIRE-5118 - Lightshare support #include "fslslbridge.h" #include "fsmoneytracker.h" -#include "fswsassetblacklist.h" #include "llfloaterbump.h" #include "llfloaterreg.h" #include "llfriendcard.h" @@ -6090,7 +6090,7 @@ void process_sound_trigger(LLMessageSystem *msg, void **) // // Asset blacklist - if (FSWSAssetBlacklist::getInstance()->isBlacklisted(sound_id, LLAssetType::AT_SOUND)) + if (FSAssetBlacklist::getInstance()->isBlacklisted(sound_id, LLAssetType::AT_SOUND)) { return; } @@ -6192,7 +6192,7 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data) msg->getUUIDFast(_PREHASH_DataBlock, _PREHASH_OwnerID, owner_id); // Asset blacklist - if (FSWSAssetBlacklist::getInstance()->isBlacklisted(sound_id, LLAssetType::AT_SOUND)) + if (FSAssetBlacklist::getInstance()->isBlacklisted(sound_id, LLAssetType::AT_SOUND)) { return; } @@ -6249,7 +6249,7 @@ void process_attached_sound(LLMessageSystem *msg, void **user_data) msg->getUUIDFast(_PREHASH_DataBlock, _PREHASH_OwnerID, owner_id); // Asset blacklist - if (FSWSAssetBlacklist::getInstance()->isBlacklisted(sound_id, LLAssetType::AT_SOUND)) + if (FSAssetBlacklist::getInstance()->isBlacklisted(sound_id, LLAssetType::AT_SOUND)) { return; } diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 7a48230f75..7796e87956 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -107,7 +107,7 @@ #include "rlvhandler.h" #include "rlvlocks.h" // [/RLVa:KB] -#include "fswsassetblacklist.h" +#include "fsassetblacklist.h" // [Legacy Bake] #ifdef OPENSIM @@ -5421,7 +5421,7 @@ void LLViewerObject::setAttachedSound(const LLUUID &audio_uuid, const LLUUID& ow } // Asset blacklist - if (FSWSAssetBlacklist::getInstance()->isBlacklisted(audio_uuid, LLAssetType::AT_SOUND)) + if (FSAssetBlacklist::getInstance()->isBlacklisted(audio_uuid, LLAssetType::AT_SOUND)) { return; } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 590198ce9e..a7f57816a8 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -82,7 +82,7 @@ #include #include -#include "fswsassetblacklist.h" +#include "fsassetblacklist.h" #include "fsfloaterimport.h" #include "fscommon.h" #include "llfloaterreg.h" @@ -350,6 +350,13 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry* cached_dpp->unpackU32(local_id, "LocalID"); cached_dpp->unpackU8(pcode, "PCode"); + // Don't process derendered objects + if (mDerendered.end() != mDerendered.find(fullid)) + { + return NULL; + } + // + objectp = findObject(fullid); if (objectp) @@ -636,11 +643,9 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, } #endif - - - if(FSWSAssetBlacklist::getInstance()->isBlacklisted(fullid,LLAssetType::AT_OBJECT)) + if (FSAssetBlacklist::getInstance()->isBlacklisted(fullid, LLAssetType::AT_OBJECT)) { - LL_INFOS() << "Blacklisted object blocked." << LL_ENDL; + LL_INFOS() << "Blacklisted object blocked." << LL_ENDL; continue; } @@ -2143,17 +2148,18 @@ LLViewerObject *LLViewerObjectList::createObjectFromCache(const LLPCode pcode, L updateActive(objectp); - // We might have killed this object earlier, but it might get resurrected from fastcache. Kill it again to make sure it stays dead. - if( mDerendered.end() != mDerendered.find( uuid ) ) - killObject( objectp ); - // - return objectp; } LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRegion *regionp, const LLUUID &uuid, const U32 local_id, const LLHost &sender) { + // Don't create derendered objects + if (mDerendered.end() != mDerendered.find(uuid)) + { + return NULL; + } + // LLUUID fullid; if (uuid == LLUUID::null) @@ -2186,11 +2192,6 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe updateActive(objectp); - // We might have killed this object earlier, but it might get resurrected from fastcache. Kill it again to make sure it stays dead. - if( mDerendered.end() != mDerendered.find( uuid ) ) - killObject( objectp ); - // - return objectp; } @@ -2421,16 +2422,31 @@ LLDebugBeacon::~LLDebugBeacon() } // Helper function to purge the internal list of derendered objects on teleport. - -void LLViewerObjectList::resetDerenderList() +void LLViewerObjectList::resetDerenderList(bool force /*= false*/) { - std::map< LLUUID, bool > oDerendered; + static LLCachedControl fsTempDerenderUntilTeleport(gSavedSettings, "FSTempDerenderUntilTeleport"); + if (!fsTempDerenderUntilTeleport && !force) + { + return; + } - for( std::map< LLUUID, bool >::iterator itr = mDerendered.begin(); itr != mDerendered.end(); ++itr ) - if( itr->second ) - oDerendered[ itr->first ] = itr->second; + std::map< LLUUID, bool > oDerendered; + uuid_vec_t removed_ids; + + for (std::map< LLUUID, bool >::iterator itr = mDerendered.begin(); itr != mDerendered.end(); ++itr) + { + if (itr->second) + { + oDerendered[itr->first] = itr->second; + } + else + { + removed_ids.push_back(itr->first); + } + } mDerendered.swap( oDerendered ); + FSAssetBlacklist::instance().removeItemsFromBlacklist(removed_ids); } // Helper function to add items from global blacklist after teleport. diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 96bbf4a4b1..51753f55f8 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -252,7 +252,7 @@ private: private: std::map< LLUUID, bool > mDerendered; public: - void resetDerenderList(); + void resetDerenderList(bool force = false); void addDerenderedItem( LLUUID const &, bool ); void removeDerenderedItem( LLUUID const & ); // diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a8a30bc598..c6e51a2f94 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3281,7 +3281,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; 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) { diff --git a/indra/newview/skins/default/xui/de/floater_asset_blacklist.xml b/indra/newview/skins/default/xui/de/floater_asset_blacklist.xml deleted file mode 100644 index 28a1d6f53d..0000000000 --- a/indra/newview/skins/default/xui/de/floater_asset_blacklist.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - Objekt - - - Textur - - - Sound - - - Einwohner - - - Unbekannt - - - Unbekanntes Objekt - - - Unbekannte Region - - - - - - - -