diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 38e88ae29eba621639e35551c7daf359bfa79501..6f3878d93ec3044c07a4a1d6005c42f23fe44793 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -376,6 +376,7 @@ set(viewer_SOURCE_FILES
     llfloatertestinspectors.cpp
     llfloatertestlistview.cpp
     llfloatertexturefetchdebugger.cpp
+    llfloatertexturepicker.cpp
     llfloatertools.cpp
     llfloatertopobjects.cpp
     llfloatertos.cpp
@@ -386,6 +387,7 @@ set(viewer_SOURCE_FILES
     llfloatervoiceeffect.cpp
     llfloatervoicevolume.cpp
     llfloaterwebcontent.cpp
+    llfloaterwebprofile.cpp
     llfloaterwhitelistentry.cpp
     llfloaterwindowsize.cpp
     llfloaterworldmap.cpp
@@ -444,6 +446,7 @@ set(viewer_SOURCE_FILES
     lllandmarkactions.cpp
     lllandmarklist.cpp
     lllegacyatmospherics.cpp
+    lllegacynotificationwellwindow.cpp
     lllistbrowser.cpp
     lllistcontextmenu.cpp
     lllistview.cpp
@@ -1086,6 +1089,7 @@ set(viewer_HEADER_FILES
     llfloatertestinspectors.h
     llfloatertestlistview.h
     llfloatertexturefetchdebugger.h
+    llfloatertexturepicker.h
     llfloatertools.h
     llfloatertopobjects.h
     llfloatertos.h
@@ -1096,6 +1100,7 @@ set(viewer_HEADER_FILES
     llfloatervoiceeffect.h
     llfloatervoicevolume.h
     llfloaterwebcontent.h
+    llfloaterwebprofile.h
     llfloaterwhitelistentry.h
     llfloaterwindowsize.h
     llfloaterworldmap.h
@@ -1151,6 +1156,7 @@ set(viewer_HEADER_FILES
     llkeyconflict.h
     lllandmarkactions.h
     lllandmarklist.h
+    lllegacynotificationwellwindow.h
     lllightconstants.h
     lllistbrowser.h
     lllistcontextmenu.h
diff --git a/indra/newview/alavataractions.cpp b/indra/newview/alavataractions.cpp
index 06d2943706baebe3080bb83cf6ef7910d1af110c..0d7e330f95509200c38a257531770676caa3eef7 100644
--- a/indra/newview/alavataractions.cpp
+++ b/indra/newview/alavataractions.cpp
@@ -36,8 +36,11 @@
 #include "roles_constants.h"
 
 #include "llagent.h"
+#include "llavataractions.h"
+#include "llfloaterreg.h"
 #include "llfloaterregioninfo.h"
 #include "llfloaterreporter.h"
+#include "llfloaterwebcontent.h"
 #include "llslurl.h"
 #include "llviewercontrol.h"
 #include "llviewermenu.h"
@@ -841,4 +844,22 @@ bool ALAvatarActions::handleGodKick(const LLSD& notification, const LLSD& respon
 		gAgent.sendReliableMessage();
 	}
 	return false;
+}
+
+// Webprofile junk... for posterity!
+
+static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
+{
+    LLFloaterWebContent::Params p;
+    p.url(getProfileURL(av_name.getAccountName())).id(agent_id.asString());
+    LLFloaterReg::showInstance("webprofile", p);
+}
+
+// static
+void ALAvatarActions::showWebProfile(const LLUUID& id)
+{
+    if (id.notNull())
+    {
+        LLAvatarNameCache::get(id, boost::bind(&on_avatar_name_show_profile, _1, _2));
+    }
 }
\ No newline at end of file
diff --git a/indra/newview/alavataractions.h b/indra/newview/alavataractions.h
index a600e13eda722493374e2656e1c70ec0c3bc5a5e..6334c626756d17921cbb16e4fcbb960042bb6f9c 100644
--- a/indra/newview/alavataractions.h
+++ b/indra/newview/alavataractions.h
@@ -93,6 +93,9 @@ class ALAvatarActions
 	static void godFreeze(const LLUUID& id);
 	static void godUnfreeze(const LLUUID& id);
 
+	// Webprofile
+    static void showWebProfile(const LLUUID& id);
+
 private:
 	static bool handleParcelFreeze(const LLSD& notification, const LLSD& response);
 	static bool handleParcelEject(const LLSD& notification, const LLSD& response);
diff --git a/indra/newview/llfloaterprofilelegacy.cpp b/indra/newview/llfloaterprofilelegacy.cpp
index e2dde1b597cf2c3b03c2b5d58d4d7ea9fc557896..13fc840164a9c7f1a92fa82afe0f419704059f0b 100644
--- a/indra/newview/llfloaterprofilelegacy.cpp
+++ b/indra/newview/llfloaterprofilelegacy.cpp
@@ -70,7 +70,12 @@ void LLFloaterProfileLegacy::onAvatarNameCache(const LLUUID& agent_id, const LLA
 	mAvatarNameCacheConnection.disconnect();
 }
 
-void LLFloaterProfileLegacy::openTab(std::string_view tab_name) const
+void LLFloaterProfileLegacy::showTab(std::string_view tab_name) const
 {
-    if (mPanel) { mPanel->showAccordion(tab_name, true); }
+    if (mPanel) { mPanel->showTab(tab_name, true); }
+}
+
+std::string_view LLFloaterProfileLegacy::getShownTab() const
+{
+    return mPanel != nullptr ? mPanel->getShownTab() : LLStringUtil::null;
 }
diff --git a/indra/newview/llfloaterprofilelegacy.h b/indra/newview/llfloaterprofilelegacy.h
index 545447422f13062065f05de47e361846baf85d47..9729009a146ce495d37a0c61605e1ac61a5e5af7 100644
--- a/indra/newview/llfloaterprofilelegacy.h
+++ b/indra/newview/llfloaterprofilelegacy.h
@@ -42,7 +42,8 @@ class LLFloaterProfileLegacy final : public LLFloater
 	LLFloaterProfileLegacy(LLSD const& key);
 	BOOL postBuild() override;
 	void onOpen(const LLSD& key) override;
-    void openTab(std::string_view tab_name) const;
+    void showTab(std::string_view tab_name) const;
+    std::string_view getShownTab() const;
 
 private:
 	~LLFloaterProfileLegacy() override;
diff --git a/indra/newview/llfloatertexturepicker.cpp b/indra/newview/llfloatertexturepicker.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..09991c1df1e3ecb42f6ff96a6cbe5ba1cd977d18
--- /dev/null
+++ b/indra/newview/llfloatertexturepicker.cpp
@@ -0,0 +1,1114 @@
+/**
+* @file llfloatertexturepicker.cpp
+* @author Richard Nelson, James Cook
+* @brief LLTextureCtrl class implementation including related functions
+*
+* $LicenseInfo:firstyear=2002&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2010, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llagent.h"
+#include "llcheckboxctrl.h"
+#include "llcombobox.h"
+#include "lldraghandle.h"
+#include "llfiltereditor.h"
+#include "llfloaterreg.h"
+#include "llfloatertexturepicker.h"
+#include "llinventoryfunctions.h"
+#include "llinventorypanel.h"
+#include "llselectmgr.h"
+#include "llscrolllistctrl.h"
+#include "lltabcontainer.h"
+#include "lltoolmgr.h"
+#include "lltoolpipette.h"
+#include "lltrans.h"
+#include "llviewercontrol.h"
+
+#include "llavatarappearancedefines.h"
+
+static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f;
+static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
+static const F32 CONTEXT_FADE_TIME = 0.08f;
+
+static const S32 LOCAL_TRACKING_ID_COLUMN = 1;
+
+LLFloaterTexturePicker::LLFloaterTexturePicker(LLView*            owner,
+                                               LLUUID             image_asset_id,
+                                               LLUUID             default_image_asset_id,
+                                               LLUUID             transparent_image_asset_id,
+                                               LLUUID             blank_image_asset_id,
+                                               BOOL               tentative,
+                                               BOOL               allow_no_texture,
+                                               const std::string& label,
+                                               PermissionMask     immediate_filter_perm_mask,
+                                               PermissionMask     dnd_filter_perm_mask,
+                                               PermissionMask     non_immediate_filter_perm_mask,
+                                               BOOL               can_apply_immediately,
+                                               LLUIImagePtr       fallback_image) :
+    LLFloater(LLSD()),
+    mOwner(owner),
+    mImageAssetID(image_asset_id),
+    mOriginalImageAssetID(image_asset_id),
+    mFallbackImage(fallback_image),
+    mDefaultImageAssetID(default_image_asset_id),
+    mTransparentImageAssetID(transparent_image_asset_id),
+    mBlankImageAssetID(blank_image_asset_id),
+    mTentative(tentative),
+    mAllowNoTexture(allow_no_texture),
+    mLabel(label),
+    mTentativeLabel(NULL),
+    mResolutionLabel(NULL),
+    mActive(TRUE),
+    mFilterEdit(NULL),
+    mImmediateFilterPermMask(immediate_filter_perm_mask),
+    mDnDFilterPermMask(dnd_filter_perm_mask),
+    mNonImmediateFilterPermMask(non_immediate_filter_perm_mask),
+    mContextConeOpacity(0.f),
+    mSelectedItemPinned(FALSE),
+    mCanApply(true),
+    mCanPreview(true),
+    mPreviewSettingChanged(false),
+    mOnFloaterCommitCallback(NULL),
+    mOnFloaterCloseCallback(NULL),
+    mSetImageAssetIDCallback(NULL),
+    mOnUpdateImageStatsCallback(NULL),
+    mBakeTextureEnabled(FALSE)
+{
+    buildFromFile("floater_texture_ctrl.xml");
+    mCanApplyImmediately = can_apply_immediately;
+    setCanMinimize(FALSE);
+}
+
+LLFloaterTexturePicker::~LLFloaterTexturePicker() {}
+
+void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selection /*=true*/)
+{
+    if (((mImageAssetID != image_id) || mTentative) && mActive)
+    {
+        mNoCopyTextureSelected = FALSE;
+        mViewModel->setDirty();  // *TODO: shouldn't we be using setValue() here?
+        mImageAssetID = image_id;
+
+        if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID))
+        {
+            if (mBakeTextureEnabled && mModeSelector->getValue().asInteger() != 2)
+            {
+                mModeSelector->selectByValue(2);
+                onModeSelect(0, this);
+            }
+        }
+        else
+        {
+            if (mModeSelector->getValue().asInteger() == 2)
+            {
+                mModeSelector->selectByValue(0);
+                onModeSelect(0, this);
+            }
+
+            LLUUID item_id = findItemID(mImageAssetID, FALSE);
+            if (item_id.isNull())
+            {
+                mInventoryPanel->getRootFolder()->clearSelection();
+            }
+            else
+            {
+                LLInventoryItem* itemp = gInventory.getItem(image_id);
+                if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
+                {
+                    // no copy texture
+                    getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
+                    mNoCopyTextureSelected = TRUE;
+                }
+            }
+
+            if (set_selection)
+            {
+                mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
+            }
+        }
+    }
+}
+
+void LLFloaterTexturePicker::setActive(BOOL active)
+{
+    if (!active && getChild<LLUICtrl>("Pipette")->getValue().asBoolean())
+    {
+        stopUsingPipette();
+    }
+    mActive = active;
+}
+
+void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b)
+{
+    mCanApplyImmediately = b;
+    if (!mCanApplyImmediately)
+    {
+        getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
+    }
+    updateFilterPermMask();
+}
+
+void LLFloaterTexturePicker::stopUsingPipette()
+{
+    if (LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance())
+    {
+        LLToolMgr::getInstance()->clearTransientTool();
+    }
+}
+
+void LLFloaterTexturePicker::updateImageStats()
+{
+    if (mTexturep.notNull())
+    {
+        // RN: have we received header data for this image?
+        if (mTexturep->getFullWidth() > 0 && mTexturep->getFullHeight() > 0)
+        {
+            std::string formatted_dims = llformat("%d x %d", mTexturep->getFullWidth(), mTexturep->getFullHeight());
+            mResolutionLabel->setTextArg("[DIMENSIONS]", formatted_dims);
+            if (mOnUpdateImageStatsCallback)
+            {
+                mOnUpdateImageStatsCallback(mTexturep);
+            }
+        }
+        else
+        {
+            mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("[? x ?]"));
+        }
+    }
+    else
+    {
+        mResolutionLabel->setTextArg("[DIMENSIONS]", std::string(""));
+    }
+}
+
+// virtual
+BOOL LLFloaterTexturePicker::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data,
+                                               EAcceptance* accept, std::string& tooltip_msg)
+{
+    BOOL handled = FALSE;
+
+    bool is_mesh = cargo_type == DAD_MESH;
+
+    if ((cargo_type == DAD_TEXTURE) || is_mesh)
+    {
+        LLInventoryItem* item = (LLInventoryItem*) cargo_data;
+
+        BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID());
+        BOOL mod  = item->getPermissions().allowModifyBy(gAgent.getID());
+        BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID());
+
+        PermissionMask item_perm_mask = 0;
+        if (copy)
+            item_perm_mask |= PERM_COPY;
+        if (mod)
+            item_perm_mask |= PERM_MODIFY;
+        if (xfer)
+            item_perm_mask |= PERM_TRANSFER;
+
+        // PermissionMask filter_perm_mask = getFilterPermMask();  Commented out due to no-copy texture loss.
+        PermissionMask filter_perm_mask = mDnDFilterPermMask;
+        if ((item_perm_mask & filter_perm_mask) == filter_perm_mask)
+        {
+            if (drop)
+            {
+                setImageID(item->getAssetUUID());
+                commitIfImmediateSet();
+            }
+
+            *accept = ACCEPT_YES_SINGLE;
+        }
+        else
+        {
+            *accept = ACCEPT_NO;
+        }
+    }
+    else
+    {
+        *accept = ACCEPT_NO;
+    }
+
+    handled = TRUE;
+    LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << LL_ENDL;
+
+    return handled;
+}
+
+BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask)
+{
+    LLFolderView* root_folder = mInventoryPanel->getRootFolder();
+
+    if (root_folder && mFilterEdit)
+    {
+        if (mFilterEdit->hasFocus() && (key == KEY_RETURN || key == KEY_DOWN) && mask == MASK_NONE)
+        {
+            if (!root_folder->getCurSelectedItem())
+            {
+                LLFolderViewItem* itemp = mInventoryPanel->getItemByID(gInventory.getRootFolderID());
+                if (itemp)
+                {
+                    root_folder->setSelection(itemp, FALSE, FALSE);
+                }
+            }
+            root_folder->scrollToShowSelection();
+
+            // move focus to inventory proper
+            mInventoryPanel->setFocus(TRUE);
+
+            // treat this as a user selection of the first filtered result
+            commitIfImmediateSet();
+
+            return TRUE;
+        }
+
+        if (mInventoryPanel->hasFocus() && key == KEY_UP)
+        {
+            mFilterEdit->focusFirstItem(TRUE);
+        }
+    }
+
+    return LLFloater::handleKeyHere(key, mask);
+}
+
+void LLFloaterTexturePicker::onClose(bool app_quitting)
+{
+    if (mOwner && mOnFloaterCloseCallback)
+    {
+        mOnFloaterCloseCallback();
+    }
+    stopUsingPipette();
+}
+
+// virtual
+BOOL LLFloaterTexturePicker::postBuild()
+{
+    LLFloater::postBuild();
+
+    if (!mLabel.empty())
+    {
+        std::string pick = getString("pick title");
+
+        setTitle(pick + mLabel);
+    }
+    mTentativeLabel = getChild<LLTextBox>("Multiple");
+
+    mResolutionLabel = getChild<LLTextBox>("size_lbl");
+
+    childSetAction("Default", LLFloaterTexturePicker::onBtnSetToDefault, this);
+    childSetAction("None", LLFloaterTexturePicker::onBtnNone, this);
+    childSetAction("Blank", LLFloaterTexturePicker::onBtnBlank, this);
+    childSetAction("Transparent", LLFloaterTexturePicker::onBtnTransparent, this);
+
+    childSetCommitCallback("show_folders_check", onShowFolders, this);
+    getChildView("show_folders_check")->setVisible(FALSE);
+
+    mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
+    mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
+
+    mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
+
+    mModeSelector = getChild<LLComboBox>("mode_selection");
+    mModeSelector->setCommitCallback(onModeSelect, this);
+    mModeSelector->selectByValue(0);
+
+    if (mInventoryPanel)
+    {
+        U32 filter_types = 0x0;
+        filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
+        filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
+
+        mInventoryPanel->setFilterTypes(filter_types);
+        // mInventoryPanel->setFilterPermMask(getFilterPermMask());  //Commented out due to no-copy texture loss.
+        mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask);
+        mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2));
+        mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
+
+        // Disable auto selecting first filtered item because it takes away
+        // selection from the item set by LLTextureCtrl owning this floater.
+        mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE);
+
+        // Commented out to scroll to currently selected texture. See EXT-5403.
+        // // store this filter as the default one
+        // mInventoryPanel->getRootFolder()->getFilter().markDefault();
+
+        // Commented out to stop opening all folders with textures
+        // mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE);
+
+        // don't put keyboard focus on selected item, because the selection callback
+        // will assume that this was user input
+
+        if (!mImageAssetID.isNull())
+        {
+            mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
+        }
+    }
+
+    childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this);
+    childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this);
+    childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this);
+
+    mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list");
+    mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this);
+    LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl);
+
+    getChild<LLLineEditor>("uuid_editor")->setCommitCallback(boost::bind(&onApplyUUID, this));
+    getChild<LLButton>("apply_uuid_btn")->setClickedCallback(boost::bind(&onApplyUUID, this));
+
+    mNoCopyTextureSelected = FALSE;
+
+    getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("TextureLivePreview"));
+    childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
+
+    if (!mCanApplyImmediately)
+    {
+        getChildView("show_folders_check")->setEnabled(FALSE);
+    }
+
+    getChild<LLUICtrl>("Pipette")->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
+    childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel, this);
+    childSetAction("Select", LLFloaterTexturePicker::onBtnSelect, this);
+
+    // update permission filter once UI is fully initialized
+    updateFilterPermMask();
+    mSavedFolderState.setApply(FALSE);
+
+    LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1));
+
+    getChild<LLComboBox>("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this);
+    getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setCommitCallback(onHideBaseMeshRegionCheck, this);
+
+    setBakeTextureEnabled(TRUE);
+    return TRUE;
+}
+
+// virtual
+void LLFloaterTexturePicker::draw()
+{
+    static LLCachedControl<F32> max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f);
+    drawConeToOwner(mContextConeOpacity, max_opacity, mOwner);
+
+    updateImageStats();
+
+    // if we're inactive, gray out "apply immediate" checkbox
+    getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected);
+    getChildView("Select")->setEnabled(mActive && mCanApply);
+    getChildView("Pipette")->setEnabled(mActive);
+    getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance());
+
+    // BOOL allow_copy = FALSE;
+    if (mOwner)
+    {
+        mTexturep = NULL;
+        if (mImageAssetID.notNull())
+        {
+            LLPointer<LLViewerFetchedTexture> texture = NULL;
+
+            if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID))
+            {
+                LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
+                if (obj)
+                {
+                    LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID);
+                    texture                        = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : NULL;
+                }
+            }
+
+            if (texture.isNull())
+            {
+                texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID);
+            }
+
+            mTexturep = texture;
+            mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
+        }
+
+        if (mTentativeLabel)
+        {
+            mTentativeLabel->setVisible(FALSE);
+        }
+
+        getChildView("Default")->setEnabled(mImageAssetID != mDefaultImageAssetID || mTentative);
+        getChildView("Transparent")->setEnabled(mImageAssetID != mTransparentImageAssetID || mTentative);
+        getChildView("Blank")->setEnabled(mImageAssetID != mBlankImageAssetID || mTentative);
+        getChildView("None")->setEnabled(mAllowNoTexture && (!mImageAssetID.isNull() || mTentative));
+
+        LLFloater::draw();
+
+        if (isMinimized())
+        {
+            return;
+        }
+
+        // Border
+        LLRect border = getChildView("preview_widget")->getRect();
+        gl_rect_2d(border, LLColor4::black, FALSE);
+
+        // Interior
+        LLRect interior = border;
+        interior.stretch(-1);
+
+        // If the floater is focused, don't apply its alpha to the texture (STORM-677).
+        const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
+        if (mTexturep)
+        {
+            if (mTexturep->getComponents() == 4)
+            {
+                gl_rect_2d_checkerboard(interior, alpha);
+            }
+
+            gl_draw_scaled_image(interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep,
+                                 UI_VERTEX_COLOR % alpha);
+
+            // Pump the priority
+            mTexturep->addTextureStats((F32) (interior.getWidth() * interior.getHeight()));
+        }
+        else if (!mFallbackImage.isNull())
+        {
+            mFallbackImage->draw(interior, UI_VERTEX_COLOR % alpha);
+        }
+        else
+        {
+            gl_rect_2d(interior, LLColor4::grey % alpha, TRUE);
+
+            // Draw X
+            gl_draw_x(interior, LLColor4::black);
+        }
+
+        // Draw Tentative Label over the image
+        if (mTentative && !mViewModel->isDirty())
+        {
+            mTentativeLabel->setVisible(TRUE);
+            drawChild(mTentativeLabel);
+        }
+
+        if (mSelectedItemPinned)
+            return;
+
+        LLFolderView* folder_view = mInventoryPanel->getRootFolder();
+        if (!folder_view)
+            return;
+
+        LLFolderViewFilter& filter = static_cast<LLFolderViewModelInventory*>(folder_view->getFolderViewModel())->getFilter();
+
+        bool is_filter_active =
+            folder_view->getViewModelItem()->getLastFilterGeneration() < filter.getCurrentGeneration() && filter.isNotDefault();
+
+        // After inventory panel filter is applied we have to update
+        // constraint rect for the selected item because of folder view
+        // AutoSelectOverride set to TRUE. We force PinningSelectedItem
+        // flag to FALSE state and setting filter "dirty" to update
+        // scroll container to show selected item (see LLFolderView::doIdle()).
+        if (!is_filter_active && !mSelectedItemPinned)
+        {
+            folder_view->setPinningSelectedItem(mSelectedItemPinned);
+            folder_view->getViewModelItem()->dirtyFilter();
+            mSelectedItemPinned = TRUE;
+        }
+    }
+}
+
+const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library)
+{
+    LLViewerInventoryCategory::cat_array_t cats;
+    LLViewerInventoryItem::item_array_t    items;
+    LLAssetIDMatches                       asset_id_matches(asset_id);
+    gInventory.collectDescendentsIf(LLUUID::null, cats, items, LLInventoryModel::INCLUDE_TRASH, asset_id_matches);
+
+    if (items.size())
+    {
+        // search for copyable version first
+        for (S32 i = 0; i < items.size(); i++)
+        {
+            LLInventoryItem* itemp            = items[i];
+            LLPermissions    item_permissions = itemp->getPermissions();
+            if (item_permissions.allowCopyBy(gAgent.getID(), gAgent.getGroupID()))
+            {
+                if (!ignore_library || !gInventory.isObjectDescendentOf(itemp->getUUID(), gInventory.getLibraryRootFolderID()))
+                {
+                    return itemp->getUUID();
+                }
+            }
+        }
+        // otherwise just return first instance, unless copyable requested
+        if (copyable_only)
+        {
+            return LLUUID::null;
+        }
+        else
+        {
+            if (!ignore_library || !gInventory.isObjectDescendentOf(items[0]->getUUID(), gInventory.getLibraryRootFolderID()))
+            {
+                return items[0]->getUUID();
+            }
+        }
+    }
+
+    return LLUUID::null;
+}
+
+PermissionMask LLFloaterTexturePicker::getFilterPermMask()
+{
+    bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean();
+    return apply_immediate ? mImmediateFilterPermMask : mNonImmediateFilterPermMask;
+}
+
+void LLFloaterTexturePicker::commitIfImmediateSet()
+{
+    if (!mNoCopyTextureSelected && mOnFloaterCommitCallback && mCanApply)
+    {
+        mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CHANGE, LLUUID::null);
+    }
+}
+
+void LLFloaterTexturePicker::commitCancel()
+{
+    if (!mNoCopyTextureSelected && mOnFloaterCommitCallback && mCanApply)
+    {
+        mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CANCEL, LLUUID::null);
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onBtnSetToDefault(void* userdata)
+{
+    LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+    self->setCanApply(true, true);
+    if (self->mOwner)
+    {
+        self->setImageID(self->getDefaultImageAssetID());
+    }
+    self->commitIfImmediateSet();
+}
+
+// static
+void LLFloaterTexturePicker::onBtnTransparent(void* userdata)
+{
+    LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+    self->setCanApply(true, true);
+    self->setImageID(self->getTransparentImageAssetID());
+    self->commitIfImmediateSet();
+}
+
+// static
+void LLFloaterTexturePicker::onBtnBlank(void* userdata)
+{
+    LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+    self->setCanApply(true, true);
+    self->setImageID(self->getBlankImageAssetID());
+    self->commitIfImmediateSet();
+}
+
+// static
+void LLFloaterTexturePicker::onBtnNone(void* userdata)
+{
+    LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+    self->setImageID(LLUUID::null);
+    self->commitCancel();
+}
+
+/*
+// static
+void LLFloaterTexturePicker::onBtnRevert(void* userdata)
+{
+    LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+    self->setImageID( self->mOriginalImageAssetID );
+    // TODO: Change this to tell the owner to cancel.  It needs to be
+    // smart enough to restore multi-texture selections.
+    self->mOwner->onFloaterCommit();
+    self->mViewModel->resetDirty();
+}*/
+
+// static
+void LLFloaterTexturePicker::onBtnCancel(void* userdata)
+{
+    LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+    self->setImageID(self->mOriginalImageAssetID);
+    if (self->mOnFloaterCommitCallback)
+    {
+        self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CANCEL, LLUUID::null);
+    }
+    self->mViewModel->resetDirty();
+    self->closeFloater();
+}
+
+// static
+void LLFloaterTexturePicker::onBtnSelect(void* userdata)
+{
+    LLFloaterTexturePicker* self     = (LLFloaterTexturePicker*) userdata;
+    LLUUID                  local_id = LLUUID::null;
+    if (self->mOwner)
+    {
+        if (self->mLocalScrollCtrl->getVisible() && !self->mLocalScrollCtrl->getAllSelected().empty())
+        {
+            LLUUID temp_id = self->mLocalScrollCtrl->getFirstSelected()->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID();
+            local_id       = LLLocalBitmapMgr::getInstance()->getWorldID(temp_id);
+        }
+    }
+
+    if (self->mOnFloaterCommitCallback)
+    {
+        self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_SELECT, local_id);
+    }
+    self->closeFloater();
+}
+
+void LLFloaterTexturePicker::onBtnPipette()
+{
+    BOOL pipette_active = getChild<LLUICtrl>("Pipette")->getValue().asBoolean();
+    pipette_active      = !pipette_active;
+    if (pipette_active)
+    {
+        LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance());
+    }
+    else
+    {
+        LLToolMgr::getInstance()->clearTransientTool();
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onApplyUUID(void* userdata)
+{
+    LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+    LLUUID                  id(self->getChild<LLLineEditor>("uuid_editor")->getText());
+    if (id.notNull())
+    {
+        self->setImageID(id);
+        self->commitIfImmediateSet();
+    }
+}
+
+void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*>& items, BOOL user_action)
+{
+    if (items.size())
+    {
+        LLFolderViewItem* first_item = items.front();
+        LLInventoryItem*  itemp =
+            gInventory.getItem(static_cast<LLFolderViewModelItemInventory*>(first_item->getViewModelItem())->getUUID());
+        mNoCopyTextureSelected = FALSE;
+        if (itemp)
+        {
+            if (!mTextureSelectedCallback.empty())
+            {
+                mTextureSelectedCallback(itemp);
+            }
+            if (!itemp->getPermissions().allowCopyBy(gAgent.getID()))
+            {
+                mNoCopyTextureSelected = TRUE;
+            }
+            setImageID(itemp->getAssetUUID(), false);
+            mViewModel->setDirty();  // *TODO: shouldn't we be using setValue() here?
+
+            if (!mPreviewSettingChanged)
+            {
+                mCanPreview = gSavedSettings.getBOOL("TextureLivePreview");
+            }
+            else
+            {
+                mPreviewSettingChanged = false;
+            }
+
+            if (user_action && mCanPreview)
+            {
+                // only commit intentional selections, not implicit ones
+                commitIfImmediateSet();
+            }
+        }
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void* userdata)
+{
+    LLFloaterTexturePicker* self  = (LLFloaterTexturePicker*) userdata;
+    int                     index = self->mModeSelector->getValue().asInteger();
+
+    self->getChild<LLButton>("Default")->setVisible(index == 0 ? TRUE : FALSE);
+    self->getChild<LLButton>("Transparent")->setVisible(index == 0 ? TRUE : FALSE);
+    self->getChild<LLButton>("Blank")->setVisible(index == 0 ? TRUE : FALSE);
+    self->getChild<LLButton>("None")->setVisible(index == 0 ? TRUE : FALSE);
+    self->getChild<LLButton>("Pipette")->setVisible(index == 0 ? TRUE : FALSE);
+    self->getChild<LLFilterEditor>("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE);
+    self->getChild<LLInventoryPanel>("inventory panel")->setVisible(index == 0 ? TRUE : FALSE);
+    self->getChild<LLLineEditor>("uuid_editor")->setVisible(index == 0 ? TRUE : FALSE);
+    self->getChild<LLButton>("apply_uuid_btn")->setVisible(index == 0 ? TRUE : FALSE);
+
+    /*self->getChild<LLCheckBox>("show_folders_check")->setVisible(mode);
+      no idea under which conditions the above is even shown, needs testing. */
+
+    self->getChild<LLButton>("l_add_btn")->setVisible(index == 1 ? TRUE : FALSE);
+    self->getChild<LLButton>("l_rem_btn")->setVisible(index == 1 ? TRUE : FALSE);
+    self->getChild<LLButton>("l_upl_btn")->setVisible(index == 1 ? TRUE : FALSE);
+    self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == 1 ? TRUE : FALSE);
+
+    self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == 2 ? TRUE : FALSE);
+    self->getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(FALSE);  // index == 2 ? TRUE : FALSE);
+
+    if (index == 2)
+    {
+        self->stopUsingPipette();
+
+        S8 val = -1;
+
+        LLUUID imageID = self->mImageAssetID;
+        if (imageID == IMG_USE_BAKED_HEAD)
+        {
+            val = 0;
+        }
+        else if (imageID == IMG_USE_BAKED_UPPER)
+        {
+            val = 1;
+        }
+        else if (imageID == IMG_USE_BAKED_LOWER)
+        {
+            val = 2;
+        }
+        else if (imageID == IMG_USE_BAKED_EYES)
+        {
+            val = 3;
+        }
+        else if (imageID == IMG_USE_BAKED_SKIRT)
+        {
+            val = 4;
+        }
+        else if (imageID == IMG_USE_BAKED_HAIR)
+        {
+            val = 5;
+        }
+        else if (imageID == IMG_USE_BAKED_LEFTARM)
+        {
+            val = 6;
+        }
+        else if (imageID == IMG_USE_BAKED_LEFTLEG)
+        {
+            val = 7;
+        }
+        else if (imageID == IMG_USE_BAKED_AUX1)
+        {
+            val = 8;
+        }
+        else if (imageID == IMG_USE_BAKED_AUX2)
+        {
+            val = 9;
+        }
+        else if (imageID == IMG_USE_BAKED_AUX3)
+        {
+            val = 10;
+        }
+
+        self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE);
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onBtnAdd(void* userdata)
+{
+    if (LLLocalBitmapMgr::getInstance()->addUnit() == true)
+    {
+        LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
+        LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl);
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onBtnRemove(void* userdata)
+{
+    LLFloaterTexturePicker*        self           = (LLFloaterTexturePicker*) userdata;
+    std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
+
+    if (!selected_items.empty())
+    {
+        for (std::vector<LLScrollListItem*>::iterator iter = selected_items.begin(); iter != selected_items.end(); iter++)
+        {
+            LLScrollListItem* list_item = *iter;
+            if (list_item)
+            {
+                LLUUID tracking_id = list_item->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID();
+                LLLocalBitmapMgr::getInstance()->delUnit(tracking_id);
+            }
+        }
+
+        self->getChild<LLButton>("l_rem_btn")->setEnabled(false);
+        self->getChild<LLButton>("l_upl_btn")->setEnabled(false);
+        LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl);
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onBtnUpload(void* userdata)
+{
+    LLFloaterTexturePicker*        self           = (LLFloaterTexturePicker*) userdata;
+    std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
+
+    if (selected_items.empty())
+    {
+        return;
+    }
+
+    /* currently only allows uploading one by one, picks the first item from the selection list.  (not the vector!)
+       in the future, it might be a good idea to check the vector size and if more than one units is selected - opt for multi-image upload.
+     */
+
+    LLUUID      tracking_id = (LLUUID) self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN);
+    std::string filename    = LLLocalBitmapMgr::getInstance()->getFilename(tracking_id);
+
+    if (!filename.empty())
+    {
+        LLFloaterReg::showInstance("upload_image", LLSD(filename));
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl, void* userdata)
+{
+    LLFloaterTexturePicker*        self           = (LLFloaterTexturePicker*) userdata;
+    std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
+    bool                           has_selection  = !selected_items.empty();
+
+    self->getChild<LLButton>("l_rem_btn")->setEnabled(has_selection);
+    self->getChild<LLButton>("l_upl_btn")->setEnabled(has_selection && (selected_items.size() < 2));
+    /* since multiple-localbitmap upload is not implemented, upl button gets disabled if more than one is selected. */
+
+    if (has_selection)
+    {
+        LLUUID tracking_id = (LLUUID) self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN);
+        LLUUID inworld_id  = LLLocalBitmapMgr::getInstance()->getWorldID(tracking_id);
+        if (self->mSetImageAssetIDCallback)
+        {
+            self->mSetImageAssetIDCallback(inworld_id);
+        }
+
+        if (self->childGetValue("apply_immediate_check").asBoolean())
+        {
+            if (self->mOnFloaterCommitCallback)
+            {
+                self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CHANGE, inworld_id);
+            }
+        }
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onShowFolders(LLUICtrl* ctrl, void* user_data)
+{
+    LLCheckBoxCtrl*         check_box = (LLCheckBoxCtrl*) ctrl;
+    LLFloaterTexturePicker* picker    = (LLFloaterTexturePicker*) user_data;
+
+    if (check_box->get())
+    {
+        picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
+    }
+    else
+    {
+        picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NO_FOLDERS);
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onApplyImmediateCheck(LLUICtrl* ctrl, void* user_data)
+{
+    LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*) user_data;
+
+    LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*) ctrl;
+    gSavedSettings.setBOOL("TextureLivePreview", check_box->get());
+
+    picker->updateFilterPermMask();
+    picker->commitIfImmediateSet();
+}
+
+// static
+void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void* user_data)
+{
+    LLFloaterTexturePicker* self      = (LLFloaterTexturePicker*) user_data;
+    LLComboBox*             combo_box = (LLComboBox*) ctrl;
+
+    S8 type = combo_box->getValue().asInteger();
+
+    LLUUID imageID = self->mDefaultImageAssetID;
+    if (type == 0)
+    {
+        imageID = IMG_USE_BAKED_HEAD;
+    }
+    else if (type == 1)
+    {
+        imageID = IMG_USE_BAKED_UPPER;
+    }
+    else if (type == 2)
+    {
+        imageID = IMG_USE_BAKED_LOWER;
+    }
+    else if (type == 3)
+    {
+        imageID = IMG_USE_BAKED_EYES;
+    }
+    else if (type == 4)
+    {
+        imageID = IMG_USE_BAKED_SKIRT;
+    }
+    else if (type == 5)
+    {
+        imageID = IMG_USE_BAKED_HAIR;
+    }
+    else if (type == 6)
+    {
+        imageID = IMG_USE_BAKED_LEFTARM;
+    }
+    else if (type == 7)
+    {
+        imageID = IMG_USE_BAKED_LEFTLEG;
+    }
+    else if (type == 8)
+    {
+        imageID = IMG_USE_BAKED_AUX1;
+    }
+    else if (type == 9)
+    {
+        imageID = IMG_USE_BAKED_AUX2;
+    }
+    else if (type == 10)
+    {
+        imageID = IMG_USE_BAKED_AUX3;
+    }
+
+    self->setImageID(imageID);
+    self->mViewModel->setDirty();  // *TODO: shouldn't we be using setValue() here?
+
+    if (!self->mPreviewSettingChanged)
+    {
+        self->mCanPreview = gSavedSettings.getBOOL("TextureLivePreview");
+    }
+    else
+    {
+        self->mPreviewSettingChanged = false;
+    }
+
+    if (self->mCanPreview)
+    {
+        // only commit intentional selections, not implicit ones
+        self->commitIfImmediateSet();
+    }
+}
+
+// static
+void LLFloaterTexturePicker::onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void* user_data)
+{
+    // LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data;
+    // LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl;
+}
+
+void LLFloaterTexturePicker::updateFilterPermMask()
+{
+    // mInventoryPanel->setFilterPermMask( getFilterPermMask() );  Commented out due to no-copy texture loss.
+}
+
+void LLFloaterTexturePicker::setCanApply(bool can_preview, bool can_apply)
+{
+    getChildRef<LLUICtrl>("Select").setEnabled(can_apply);
+    getChildRef<LLUICtrl>("preview_disabled").setVisible(!can_preview);
+    getChildRef<LLUICtrl>("apply_immediate_check").setVisible(can_preview);
+
+    mCanApply              = can_apply;
+    mCanPreview            = can_preview ? gSavedSettings.getBOOL("TextureLivePreview") : false;
+    mPreviewSettingChanged = true;
+}
+
+void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string)
+{
+    std::string upper_case_search_string = search_string;
+    LLStringUtil::toUpper(upper_case_search_string);
+
+    if (upper_case_search_string.empty())
+    {
+        if (mInventoryPanel->getFilterSubString().empty())
+        {
+            // current filter and new filter empty, do nothing
+            return;
+        }
+
+        mSavedFolderState.setApply(TRUE);
+        mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
+        // add folder with current item to list of previously opened folders
+        LLOpenFoldersWithSelection opener;
+        mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
+        mInventoryPanel->getRootFolder()->scrollToShowSelection();
+    }
+    else if (mInventoryPanel->getFilterSubString().empty())
+    {
+        // first letter in search term, save existing folder open state
+        if (!mInventoryPanel->getFilter().isNotDefault())
+        {
+            mSavedFolderState.setApply(FALSE);
+            mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
+        }
+    }
+
+    mInventoryPanel->setFilterSubString(search_string);
+}
+
+void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled) { mModeSelector->setEnabledByValue(1, enabled); }
+
+void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled)
+{
+    BOOL changed = (enabled != mBakeTextureEnabled);
+
+    mBakeTextureEnabled = enabled;
+    mModeSelector->setEnabledByValue(2, enabled);
+
+    if (!mBakeTextureEnabled && (mModeSelector->getValue().asInteger() == 2))
+    {
+        mModeSelector->selectByValue(0);
+    }
+
+    if (changed && mBakeTextureEnabled && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID))
+    {
+        if (mModeSelector->getValue().asInteger() != 2)
+        {
+            mModeSelector->selectByValue(2);
+        }
+    }
+    onModeSelect(0, this);
+}
+
+void LLFloaterTexturePicker::onTextureSelect(const LLTextureEntry& te)
+{
+    LLUUID inventory_item_id = findItemID(te.getID(), TRUE);
+    if (inventory_item_id.notNull())
+    {
+        LLToolPipette::getInstance()->setResult(TRUE, "");
+        setImageID(te.getID());
+
+        mNoCopyTextureSelected = FALSE;
+        LLInventoryItem* itemp = gInventory.getItem(inventory_item_id);
+
+        if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
+        {
+            // no copy texture
+            mNoCopyTextureSelected = TRUE;
+        }
+
+        commitIfImmediateSet();
+    }
+    else
+    {
+        LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture"));
+    }
+}
diff --git a/indra/newview/llfloatertexturepicker.h b/indra/newview/llfloatertexturepicker.h
new file mode 100644
index 0000000000000000000000000000000000000000..1d555690233f7e1f25d7c306b62cd13c74cb50bd
--- /dev/null
+++ b/indra/newview/llfloatertexturepicker.h
@@ -0,0 +1,179 @@
+/**
+* @file llfloatertexturepicker.h
+* @author Richard Nelson, James Cook
+* @brief LLTextureCtrl class header file including related functions
+*
+* $LicenseInfo:firstyear=2002&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2010, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+* $/LicenseInfo$
+*/
+
+#ifndef LL_FLOATERTEXTUREPICKER_H
+#define LL_FLOATERTEXTUREPICKER_H
+
+#include "llviewertexture.h"
+#include "lltexturectrl.h"
+#include "llfloater.h"
+
+class LLFilterEditor;
+class LLTabContainer;
+
+typedef std::function<void(LLTextureCtrl::ETexturePickOp op, LLUUID id)> floater_commit_callback;
+typedef std::function<void()> floater_close_callback;
+typedef std::function<void(const LLUUID& asset_id)> set_image_asset_id_callback;
+typedef std::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback;
+
+class LLFloaterTexturePicker final : public LLFloater
+{
+  public:
+    LLFloaterTexturePicker(LLView*            owner,
+                           LLUUID             image_asset_id,
+                           LLUUID             default_image_asset_id,
+                           LLUUID             transparent_image_asset_id,
+                           LLUUID             blank_image_asset_id,
+                           BOOL               tentative,
+                           BOOL               allow_no_texture,
+                           const std::string& label,
+                           PermissionMask     immediate_filter_perm_mask,
+                           PermissionMask     dnd_filter_perm_mask,
+                           PermissionMask     non_immediate_filter_perm_mask,
+                           BOOL               can_apply_immediately,
+                           LLUIImagePtr       fallback_image_name);
+
+    virtual ~LLFloaterTexturePicker();
+
+    // LLView overrides
+    /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data,
+                                       EAcceptance* accept, std::string& tooltip_msg);
+    /*virtual*/ void draw();
+    /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
+
+    // LLFloater overrides
+    /*virtual*/ BOOL postBuild();
+    /*virtual*/ void onClose(bool app_settings);
+
+    // New functions
+    void          setImageID(const LLUUID& image_asset_id, bool set_selection = true);
+    void          updateImageStats();
+    const LLUUID& getAssetID() { return mImageAssetID; }
+    const LLUUID& findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library = FALSE);
+    void          setCanApplyImmediately(BOOL b);
+
+    void setActive(BOOL active);
+
+    LLView*        getOwner() const { return mOwner; }
+    void           setOwner(LLView* owner) { mOwner = owner; }
+    void           stopUsingPipette();
+    PermissionMask getFilterPermMask();
+
+    void updateFilterPermMask();
+    void commitIfImmediateSet();
+    void commitCancel();
+
+    void onFilterEdit(const std::string& search_string);
+
+    void          setCanApply(bool can_preview, bool can_apply);
+    void          setTextureSelectedCallback(const texture_selected_callback& cb) { mTextureSelectedCallback = cb; }
+    void          setOnFloaterCloseCallback(const floater_close_callback& cb) { mOnFloaterCloseCallback = cb; }
+    void          setOnFloaterCommitCallback(const floater_commit_callback& cb) { mOnFloaterCommitCallback = cb; }
+    void          setSetImageAssetIDCallback(const set_image_asset_id_callback& cb) { mSetImageAssetIDCallback = cb; }
+    void          setOnUpdateImageStatsCallback(const set_on_update_image_stats_callback& cb) { mOnUpdateImageStatsCallback = cb; }
+    const LLUUID& getDefaultImageAssetID() { return mDefaultImageAssetID; }
+    const LLUUID& getTransparentImageAssetID() { return mTransparentImageAssetID; }
+    const LLUUID& getBlankImageAssetID() { return mBlankImageAssetID; }
+
+    static void onBtnSetToDefault(void* userdata);
+    static void onBtnSelect(void* userdata);
+    static void onBtnCancel(void* userdata);
+    void        onBtnPipette();
+    // static void		onBtnRevert( void* userdata );
+    static void onBtnTransparent(void* userdata);
+    static void onBtnBlank(void* userdata);
+    static void onBtnNone(void* userdata);
+    static void onBtnClear(void* userdata);
+    static void onApplyUUID(void* userdata);
+    void        onSelectionChange(const std::deque<LLFolderViewItem*>& items, BOOL user_action);
+    static void onShowFolders(LLUICtrl* ctrl, void* userdata);
+    static void onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata);
+    void        onTextureSelect(const LLTextureEntry& te);
+
+    static void onModeSelect(LLUICtrl* ctrl, void* userdata);
+    static void onBtnAdd(void* userdata);
+    static void onBtnRemove(void* userdata);
+    static void onBtnUpload(void* userdata);
+    static void onLocalScrollCommit(LLUICtrl* ctrl, void* userdata);
+
+    static void onBakeTextureSelect(LLUICtrl* ctrl, void* userdata);
+    static void onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void* userdata);
+
+    void setLocalTextureEnabled(BOOL enabled);
+    void setBakeTextureEnabled(BOOL enabled);
+
+  protected:
+    LLPointer<LLViewerTexture> mTexturep;
+    LLView*                    mOwner;
+
+    LLUUID       mImageAssetID;   // Currently selected texture
+    LLUIImagePtr mFallbackImage;  // What to show if currently selected texture is null.
+    LLUUID       mDefaultImageAssetID;
+    LLUUID       mTransparentImageAssetID;
+    LLUUID       mBlankImageAssetID;
+    BOOL         mTentative;
+    BOOL         mAllowNoTexture;
+    LLUUID       mSpecialCurrentImageAssetID;  // Used when the asset id has no corresponding texture in the user's inventory.
+    LLUUID       mOriginalImageAssetID;
+
+    std::string mLabel;
+
+    LLTextBox* mTentativeLabel;
+    LLTextBox* mResolutionLabel;
+
+    std::string mPendingName;
+    BOOL        mActive;
+
+    LLFilterEditor*   mFilterEdit;
+    LLInventoryPanel* mInventoryPanel;
+    PermissionMask    mImmediateFilterPermMask;
+    PermissionMask    mDnDFilterPermMask;
+    PermissionMask    mNonImmediateFilterPermMask;
+    BOOL              mCanApplyImmediately;
+    BOOL              mNoCopyTextureSelected;
+    F32               mContextConeOpacity;
+    LLSaveFolderState mSavedFolderState;
+    BOOL              mSelectedItemPinned;
+
+    LLComboBox*       mModeSelector;
+    LLScrollListCtrl* mLocalScrollCtrl;
+
+  private:
+    bool mCanApply;
+    bool mCanPreview;
+    bool mPreviewSettingChanged;
+
+    texture_selected_callback          mTextureSelectedCallback;
+    floater_close_callback             mOnFloaterCloseCallback;
+    floater_commit_callback            mOnFloaterCommitCallback;
+    set_image_asset_id_callback        mSetImageAssetIDCallback;
+    set_on_update_image_stats_callback mOnUpdateImageStatsCallback;
+
+    BOOL mBakeTextureEnabled;
+};
+
+#endif // LL_FLOATERTEXTUREPICKER_H
diff --git a/indra/newview/llfloaterwebprofile.cpp b/indra/newview/llfloaterwebprofile.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6175151de1e567ff8a593084293f051eb22c947d
--- /dev/null
+++ b/indra/newview/llfloaterwebprofile.cpp
@@ -0,0 +1,81 @@
+/** 
+ * @file llfloaterwebprofile.cpp
+ * @brief Web profile floater.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llfloaterwebprofile.h"
+
+#include "llviewercontrol.h"
+
+LLFloaterWebProfile::LLFloaterWebProfile(const Params& key) :
+	LLFloaterWebContent(key)
+{
+}
+
+void LLFloaterWebProfile::onOpen(const LLSD& key)
+{
+	Params p(key);
+	p.show_chrome(true);
+    p.window_class("web_content");
+	p.allow_address_entry(false);
+	p.trusted_content(true);
+	LLFloaterWebContent::onOpen(p);
+	applyPreferredRect();
+}
+
+// virtual
+void LLFloaterWebProfile::handleReshape(const LLRect& new_rect, bool by_user)
+{
+	LL_DEBUGS() << "handleReshape: " << new_rect << LL_ENDL;
+
+	if (by_user && !isMinimized())
+	{
+		LL_DEBUGS() << "Storing new rect" << LL_ENDL;
+		gSavedSettings.setRect("WebProfileFloaterRect", new_rect);
+	}
+
+	LLFloaterWebContent::handleReshape(new_rect, by_user);
+}
+
+LLFloater* LLFloaterWebProfile::create(const LLSD& key)
+{
+	LLFloaterWebContent::Params p(key);
+	preCreate(p);
+	return new LLFloaterWebProfile(p);
+}
+
+void LLFloaterWebProfile::applyPreferredRect()
+{
+	const LLRect preferred_rect = gSavedSettings.getRect("WebProfileFloaterRect");
+	LL_DEBUGS() << "Applying preferred rect: " << preferred_rect << LL_ENDL;
+
+	// Don't override position that may have been set by floater stacking code.
+	LLRect new_rect = getRect();
+	new_rect.setLeftTopAndSize(
+		new_rect.mLeft, new_rect.mTop,
+		preferred_rect.getWidth(), preferred_rect.getHeight());
+	setShape(new_rect);
+}
diff --git a/indra/newview/llfloaterwebprofile.h b/indra/newview/llfloaterwebprofile.h
new file mode 100644
index 0000000000000000000000000000000000000000..027079f6b8797047570309d0ee53bd5ee83ccc76
--- /dev/null
+++ b/indra/newview/llfloaterwebprofile.h
@@ -0,0 +1,56 @@
+/** 
+ * @file llfloaterwebprofile.h
+ * @brief Web profile floater.
+ *
+ * $LicenseInfo:firstyear=2009&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ * 
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATERWEBPROFILE_H
+#define LL_LLFLOATERWEBPROFILE_H
+
+#include "llfloaterwebcontent.h"
+#include "llviewermediaobserver.h"
+
+class LLMediaCtrl;
+
+/**
+ * Displays avatar profile web page.
+ */
+class LLFloaterWebProfile final
+:	public LLFloaterWebContent
+{
+	LOG_CLASS(LLFloaterWebProfile);
+public:
+	typedef LLFloaterWebContent::Params Params;
+
+	LLFloaterWebProfile(const Params& key);
+
+	/*virtual*/ void onOpen(const LLSD& key) override;
+	/*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false) override;
+
+	static LLFloater* create(const LLSD& key);
+
+private:
+	void applyPreferredRect();
+};
+
+#endif  // LL_LLFLOATERWEBPROFILE_H
diff --git a/indra/newview/lllegacynotificationwellwindow.cpp b/indra/newview/lllegacynotificationwellwindow.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ea3cf13fbf5fab6ec311fe94c8e9e0b50635c4bb
--- /dev/null
+++ b/indra/newview/lllegacynotificationwellwindow.cpp
@@ -0,0 +1,177 @@
+/**
+ * @file lllegacynotificationwellwindow.cpp
+ * @brief Notification well intended for managing notifications
+ *
+ * $LicenseInfo:firstyear=2003&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "lllegacynotificationwellwindow.h"
+
+#include "llchiclet.h"
+#include "llflatlistview.h"
+#include "llfloaterreg.h"
+#include "llnotificationhandler.h"
+#include "lltoastpanel.h"
+
+LLNotificationWellWindow::WellNotificationChannel::WellNotificationChannel(LLNotificationWellWindow* well_window)
+:	LLNotificationChannel(LLNotificationChannel::Params().name(well_window->getPathname()))
+,	mWellWindow(well_window)
+{
+	connectToChannel("Notifications");
+	connectToChannel("Group Notifications");
+	connectToChannel("Offer");
+}
+
+LLNotificationWellWindow::LLNotificationWellWindow(const LLSD& key)
+:	LLSysWellWindow(key)
+{
+	mNotificationUpdates.reset(new WellNotificationChannel(this));
+}
+
+// static
+LLNotificationWellWindow* LLNotificationWellWindow::getInstance(const LLSD& key /*= LLSD()*/)
+{
+	return LLFloaterReg::getTypedInstance<LLNotificationWellWindow>("legacy_notification_well_window", key);
+}
+
+// virtual
+BOOL LLNotificationWellWindow::postBuild()
+{
+	BOOL rv = LLSysWellWindow::postBuild();
+	setTitle(getString("title_notification_well_window"));
+	return rv;
+}
+
+// virtual
+void LLNotificationWellWindow::setVisible(BOOL visible)
+{
+	if (visible)
+	{
+		// when Notification channel is cleared, storable toasts will be added into the list.
+		clearScreenChannels();
+	}
+	
+	LLSysWellWindow::setVisible(visible);
+}
+
+void LLNotificationWellWindow::addItem(const LLSysWellItem::Params& p)
+{
+	LLSD value = p.notification_id;
+	// do not add clones
+	if( mMessageList->getItemByValue(value))
+		return;
+	
+	LLSysWellItem* new_item = new LLSysWellItem(p);
+	if (mMessageList->addItem(new_item, value, ADD_TOP))
+	{
+		mSysWellChiclet->updateWidget(isWindowEmpty());
+		reshapeWindow();
+		new_item->setOnItemCloseCallback(boost::bind(&LLNotificationWellWindow::onItemClose, this, _1));
+		new_item->setOnItemClickCallback(boost::bind(&LLNotificationWellWindow::onItemClick, this, _1));
+	}
+	else
+	{
+		LL_WARNS() << "Unable to add Notification into the list, notification ID: " << p.notification_id
+		<< ", title: " << p.title
+		<< LL_ENDL;
+		
+		new_item->die();
+	}
+}
+
+void LLNotificationWellWindow::closeAll()
+{
+	// Need to clear notification channel, to add storable toasts into the list.
+	clearScreenChannels();
+	std::vector<LLPanel*> items;
+	mMessageList->getItems(items);
+	for (std::vector<LLPanel*>::iterator
+		 iter = items.begin(),
+		 iter_end = items.end();
+		 iter != iter_end; ++iter)
+	{
+		LLSysWellItem* sys_well_item = dynamic_cast<LLSysWellItem*>(*iter);
+		if (sys_well_item)
+			onItemClose(sys_well_item);
+	}
+}
+
+void LLNotificationWellWindow::initChannel()
+{
+	LLSysWellWindow::initChannel();
+	if(mChannel)
+	{
+		mChannel->addOnStoreToastCallback(boost::bind(&LLNotificationWellWindow::onStoreToast, this, _1, _2));
+	}
+}
+
+void LLNotificationWellWindow::clearScreenChannels()
+{
+	// 1 - remove StartUp toast and channel if present
+	if(!LLNotificationsUI::LLScreenChannel::getStartUpToastShown())
+	{
+		LLNotificationsUI::LLChannelManager::getInstance()->onStartUpToastClose();
+	}
+	
+	// 2 - remove toasts in Notification channel
+	if(mChannel)
+	{
+		mChannel->removeAndStoreAllStorableToasts();
+	}
+}
+
+void LLNotificationWellWindow::onStoreToast(LLPanel* info_panel, LLUUID id)
+{
+	LLSysWellItem::Params p;
+	p.notification_id = id;
+	p.title = static_cast<LLToastPanel*>(info_panel)->getTitle();
+	addItem(p);
+}
+
+void LLNotificationWellWindow::onItemClick(LLSysWellItem* item)
+{
+	LLUUID id = item->getID();
+	LLFloaterReg::showInstance("inspect_toast", id);
+}
+
+void LLNotificationWellWindow::onItemClose(LLSysWellItem* item)
+{
+	LLUUID id = item->getID();
+	
+	if(mChannel)
+	{
+		// removeItemByID() is invoked from killToastByNotificationID() and item will removed;
+		mChannel->killToastByNotificationID(id);
+	}
+	else
+	{
+		// removeItemByID() should be called one time for each item to remove it from notification well
+		removeItemByID(id);
+	}
+	
+}
+
+void LLNotificationWellWindow::onAdd( LLNotificationPtr notify )
+{
+	removeItemByID(notify->getID());
+}
diff --git a/indra/newview/lllegacynotificationwellwindow.h b/indra/newview/lllegacynotificationwellwindow.h
new file mode 100644
index 0000000000000000000000000000000000000000..32f2597a0b59de6b92c00d3569a1ddae0bcd22e1
--- /dev/null
+++ b/indra/newview/lllegacynotificationwellwindow.h
@@ -0,0 +1,81 @@
+/**
+ * @file lllegacynotificationwellwindow.h
+ * @brief Notification well intended for managing notifications
+ *
+ * $LicenseInfo:firstyear=2003&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2010, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_NOTIFICATIONWELLWINDOW_H
+#define LL_NOTIFICATIONWELLWINDOW_H
+
+#include "llnotificationptr.h"
+#include "llnotifications.h"
+#include "llsyswellwindow.h"
+
+class LLPanel;
+
+class LLNotificationWellWindow : public LLSysWellWindow
+{
+public:
+	LLNotificationWellWindow(const LLSD& key);
+	static LLNotificationWellWindow* getInstance(const LLSD& key = LLSD());
+	
+	BOOL postBuild() override;
+	void setVisible(BOOL visible) override;
+	void onAdd(LLNotificationPtr notify);
+	// Operating with items
+	void addItem(const LLSysWellItem::Params& p);
+	
+	// Closes all notifications and removes them from the Notification Well
+	void closeAll();
+	
+protected:
+	struct WellNotificationChannel : public LLNotificationChannel
+	{
+		WellNotificationChannel(LLNotificationWellWindow*);
+		void onDelete(LLNotificationPtr notify)
+		{
+			mWellWindow->removeItemByID(notify->getID());
+		}
+		
+		LLNotificationWellWindow* mWellWindow;
+	};
+	
+	LLNotificationChannelPtr mNotificationUpdates;
+	const std::string& getAnchorViewName() override { return NOTIFICATION_WELL_ANCHOR_NAME; }
+	
+private:
+	// init Window's channel
+	void initChannel() override;
+	void clearScreenChannels();
+	
+	void onStoreToast(LLPanel* info_panel, LLUUID id);
+	
+	// Handlers
+	void onItemClick(LLSysWellItem* item);
+	void onItemClose(LLSysWellItem* item);
+	
+	// ID of a toast loaded by user (by clicking notification well item)
+	LLUUID mLoadedToastId;
+};
+
+#endif // LL_NOTIFICATIONWELLWINDOW_H
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 6de87e951bf0559f0d91a2d02f7718c23b8155c3..41de59c1c16b93ce51c8579d88141fea4b0746a9 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -39,10 +39,10 @@
 #include "llfloaterperms.h"
 #include "llfloaterreg.h"
 #include "llfloatersimpleoutfitsnapshot.h"
+#include "llfloatertexturepicker.h"
 #include "llimagedimensionsinfo.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodel.h"
-#include "lllocalbitmaps.h"
 #include "llnotificationsutil.h"
 #include "llpaneloutfitsinventory.h"
 #include "lltabcontainer.h"
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 17fc66a3f586cf8a98b20d8b52d19aec4378c58b..017aeb52db9f9bd8ebc04e4e1484abdceed56986 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -62,7 +62,7 @@
 #include "llcommandhandler.h"
 #include "llfloaterprofiletexture.h"
 #include "llfloaterreg.h"
-#include "llfloaterreporter.h"
+#include "llfloatertexturepicker.h"
 #include "llfilepicker.h"
 #include "llfirstuse.h"
 #include "llgroupactions.h"
diff --git a/indra/newview/llpanelprofilelegacy.cpp b/indra/newview/llpanelprofilelegacy.cpp
index 828c68b3f2041f086523a67fd62c86b01549873d..c326b33acbe6e61b52885bdf887d5a3c86fed7ad 100644
--- a/indra/newview/llpanelprofilelegacy.cpp
+++ b/indra/newview/llpanelprofilelegacy.cpp
@@ -47,6 +47,7 @@
 #include "lltrans.h"
 
 // newview
+#include "alavataractions.h"
 #include "llagent.h"
 #include "llagentdata.h"
 #include "llagentpicksinfo.h"
@@ -496,7 +497,7 @@ void LLPanelProfileLegacy::processProperties(void* data, EAvatarProcessorType ty
 			const LLAvatarGroups* pData = static_cast<LLAvatarGroups*>(data);
 			if(!pData || getAvatarId() != pData->avatar_id) return;
 			
-			showAccordion("avatar_groups_tab", !pData->group_list.empty());
+			showTab("avatar_groups_tab", !pData->group_list.empty());
 			break;
 		}
 		// These are handled by their respective panels
@@ -522,45 +523,61 @@ void LLPanelProfileLegacy::setProgress(bool started)
 		indicator->stop();
 }
 
-void LLPanelProfileLegacy::showAccordion(std::string_view name, bool show)
+void LLPanelProfileLegacy::showTab(std::string_view name, bool show) const
 {
 	LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name);
 	tab->setVisible(show);
 	getChild<LLAccordionCtrl>("avatar_accordion")->arrange();
 }
 
+std::string_view LLPanelProfileLegacy::getShownTab() const
+{
+    const LLAccordionCtrlTab* tab = getChild<LLAccordionCtrl>("avatar_accordion")->getExpandedTab();
+    return tab != nullptr ? tab->getTitle() : LLStringUtil::null;
+}
+
 void LLPanelProfileLegacy::onCommitAction(const LLSD& userdata)
 {
 	const std::string action = userdata.asString();
-	if (action == "friend")
-	{
-		if (LLAvatarTracker::instance().getBuddyInfo(getAvatarId()) == nullptr)
-			LLAvatarActions::requestFriendshipDialog(getAvatarId());
-		else
-			LLAvatarActions::removeFriendDialog(getAvatarId());
-		resetControls();
-	}
-	else if (action == "block")
-	{
-		LLAvatarActions::toggleBlock(getAvatarId());
-		resetControls();
-	}
-	else if (action == "chat")
-		LLAvatarActions::startIM(getAvatarId());
-	else if (action == "call")
-		LLAvatarActions::startCall(getAvatarId());
-	else if (action == "share")
-		LLAvatarActions::share(getAvatarId());
-	else if (action == "teleport")
-		LLAvatarActions::offerTeleport(getAvatarId());
-	else if (action == "req_teleport")
-		LLAvatarActions::teleportRequest(getAvatarId());
-	else if (action == "map")
-		LLAvatarActions::showOnMap(getAvatarId());
-	else if (action == "pay")
-		LLAvatarActions::pay(getAvatarId());
-	else if (action == "report_abuse")
-		LLFloaterReporter::showFromObject(getAvatarId());
+    if (action == "friend")
+    {
+        if (LLAvatarTracker::instance().getBuddyInfo(getAvatarId()) == nullptr)
+            LLAvatarActions::requestFriendshipDialog(getAvatarId());
+        else
+            LLAvatarActions::removeFriendDialog(getAvatarId());
+        resetControls();
+    }
+    else if (action == "block")
+    {
+        LLAvatarActions::toggleBlock(getAvatarId());
+        resetControls();
+    }
+    else if (action == "chat")
+        LLAvatarActions::startIM(getAvatarId());
+    else if (action == "call")
+        LLAvatarActions::startCall(getAvatarId());
+    else if (action == "share")
+        LLAvatarActions::share(getAvatarId());
+    else if (action == "teleport")
+        LLAvatarActions::offerTeleport(getAvatarId());
+    else if (action == "req_teleport")
+        LLAvatarActions::teleportRequest(getAvatarId());
+    else if (action == "map")
+        LLAvatarActions::showOnMap(getAvatarId());
+    else if (action == "pay")
+        LLAvatarActions::pay(getAvatarId());
+    else if (action == "report_abuse")
+        LLFloaterReporter::showFromObject(getAvatarId());
+    else if (action == "upload_sl")
+    {
+        // *TODO:
+    }
+    else if (action == "upload_fl")
+    {
+        // *TODO:
+    }
+    else if (action == "webprofile")
+        ALAvatarActions::showWebProfile(getAvatarId());
 	else
 		LL_WARNS("LegacyProfiles") << "Unhandled action: " << action << LL_ENDL;
 }
@@ -585,6 +602,11 @@ bool LLPanelProfileLegacy::isActionEnabled(const LLSD& userdata)
 		action_enabled = (getAvatarId() != gAgentID);
 	else if (check == "can_drama")
 		action_enabled = (getAvatarId() != gAgentID);
+    else if (check == "can_upload_pic")
+    {
+        action_enabled = getAvatarId() == gAgentID
+            && !gAgent.getRegionCapability("UploadAgentProfileImage").empty();
+    }
 	else
 		LL_INFOS("LegacyProfiles") << "Unhandled check " << check << LL_ENDL;
 	return action_enabled;
@@ -1189,9 +1211,9 @@ void LLPanelProfileLegacy::LLPanelProfilePicks::onPanelClassifiedSave(LLPanelCla
 		c_item->setMouseUpCallback(boost::bind(&LLPanelProfilePicks::updateButtons, this));
 		c_item->childSetAction("info_chevron", boost::bind(&LLPanelProfilePicks::onClickInfo, this));
 
-		// order does matter, showAccordion will invoke arrange for accordions.
+		// order does matter, showTab will invoke arrange for accordions.
 		//mClassifiedsAccTab->changeOpenClose(false);
-		//showAccordion("tab_classifieds", true);
+		//showTab("tab_classifieds", true);
 	}
 	else if (panel->isNewWithErrors())
 	{
diff --git a/indra/newview/llpanelprofilelegacy.h b/indra/newview/llpanelprofilelegacy.h
index dd3e77df3a9fcc0d14dd5581d8f84896dfdbb259..a56f9f1c3a0b61ce98bd18a288dcac466fa820d7 100644
--- a/indra/newview/llpanelprofilelegacy.h
+++ b/indra/newview/llpanelprofilelegacy.h
@@ -54,7 +54,8 @@ class LLPanelProfileLegacy final : public LLPanelProfileLegacyTab
 	BOOL postBuild() override;
 	void onOpen(const LLSD& key) override;
 	void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE) override;
-    void showAccordion(std::string_view name, bool show);
+    void showTab(std::string_view name, bool show) const;
+    std::string_view getShownTab() const;
 
 protected:
 	void openPanel(LLPanel* panel, const LLSD& params);
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 6f9f4012bcf52e0414282a915ea4024ac38e4ded..aa63f60dda22a3e9dc0ecb5e4e6299c0813eca47 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -29,7 +29,6 @@
 
 #include "lltexturectrl.h"
 
-#include "llrender.h"
 #include "llagent.h"
 #include "llviewertexturelist.h"
 #include "llselectmgr.h"
@@ -37,39 +36,28 @@
 #include "llcombobox.h"
 #include "llbutton.h"
 #include "lldraghandle.h"
-#include "llfocusmgr.h"
 #include "llfolderviewmodel.h"
 #include "llinventory.h"
 #include "llinventoryfunctions.h"
 #include "llinventorymodelbackgroundfetch.h"
 #include "llinventoryobserver.h"
 #include "llinventorypanel.h"
-#include "lllineeditor.h"
 #include "llui.h"
 #include "llviewerinventory.h"
 #include "llpermissions.h"
 #include "llpreviewtexture.h"
-#include "llsaleinfo.h"
 #include "llassetstorage.h"
 #include "lltextbox.h"
-#include "llresizehandle.h"
-#include "llscrollcontainer.h"
-#include "lltoolmgr.h"
-#include "lltoolpipette.h"
-#include "llfiltereditor.h"
-#include "llwindow.h"
-
-#include "lltool.h"
+#include "llfloatertexturepicker.h"
+
 #include "llviewerwindow.h"
 #include "llviewerobject.h"
 #include "llviewercontrol.h"
-#include "llglheaders.h"
 #include "lluictrlfactory.h"
 #include "lltrans.h"
 
 #include "llradiogroup.h"
 #include "llfloaterreg.h"
-#include "lllocalbitmaps.h"
 #include "llerror.h"
 
 #include "llavatarappearancedefines.h"
@@ -142,1090 +130,6 @@ bool get_can_copy_texture(LLUUID asset_id)
     return get_is_predefined_texture(asset_id) || get_copy_free_item_by_asset_id(asset_id).notNull();
 }
 
-LLFloaterTexturePicker::LLFloaterTexturePicker(	
-	LLView* owner,
-	LLUUID image_asset_id,
-	LLUUID default_image_asset_id,
-	LLUUID transparent_image_asset_id,
-	LLUUID blank_image_asset_id,
-	BOOL tentative,
-	BOOL allow_no_texture,
-	const std::string& label,
-	PermissionMask immediate_filter_perm_mask,
-	PermissionMask dnd_filter_perm_mask,
-	PermissionMask non_immediate_filter_perm_mask,
-	BOOL can_apply_immediately,
-	LLUIImagePtr fallback_image)
-:	LLFloater(LLSD()),
-	mOwner( owner ),
-	mImageAssetID( image_asset_id ),
-	mOriginalImageAssetID(image_asset_id),
-	mFallbackImage(fallback_image),
-	mDefaultImageAssetID(default_image_asset_id),
-	mTransparentImageAssetID(transparent_image_asset_id),
-	mBlankImageAssetID(blank_image_asset_id),
-	mTentative(tentative),
-	mAllowNoTexture(allow_no_texture),
-	mLabel(label),
-	mTentativeLabel(NULL),
-	mResolutionLabel(NULL),
-	mActive( TRUE ),
-	mFilterEdit(NULL),
-	mImmediateFilterPermMask(immediate_filter_perm_mask),
-	mDnDFilterPermMask(dnd_filter_perm_mask),
-	mNonImmediateFilterPermMask(non_immediate_filter_perm_mask),
-	mContextConeOpacity(0.f),
-	mSelectedItemPinned( FALSE ),
-	mCanApply(true),
-	mCanPreview(true),
-	mPreviewSettingChanged(false),
-	mOnFloaterCommitCallback(NULL),
-	mOnFloaterCloseCallback(NULL),
-	mSetImageAssetIDCallback(NULL),
-	mOnUpdateImageStatsCallback(NULL),
-	mBakeTextureEnabled(FALSE)
-{
-	buildFromFile("floater_texture_ctrl.xml");
-	mCanApplyImmediately = can_apply_immediately;
-	setCanMinimize(FALSE);
-}
-
-LLFloaterTexturePicker::~LLFloaterTexturePicker()
-{
-}
-
-void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selection /*=true*/)
-{
-	if( ((mImageAssetID != image_id) || mTentative) && mActive)
-	{
-		mNoCopyTextureSelected = FALSE;
-		mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
-		mImageAssetID = image_id; 
-
-		if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID))
-		{
-			if ( mBakeTextureEnabled && mModeSelector->getValue().asInteger() != 2)
-			{
-				mModeSelector->selectByValue(2);
-				onModeSelect(0,this);
-			}
-		}
-		else
-		{
-			if (mModeSelector->getValue().asInteger() == 2)
-			{
-				mModeSelector->selectByValue(0);
-				onModeSelect(0,this);
-			}
-			
-			LLUUID item_id = findItemID(mImageAssetID, FALSE);
-			if (item_id.isNull())
-			{
-				mInventoryPanel->getRootFolder()->clearSelection();
-			}
-			else
-			{
-				LLInventoryItem* itemp = gInventory.getItem(image_id);
-				if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
-				{
-					// no copy texture
-					getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
-					mNoCopyTextureSelected = TRUE;
-				}
-			}
-
-			if (set_selection)
-			{
-				mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
-			}
-		}
-		
-
-		
-	}
-}
-
-void LLFloaterTexturePicker::setActive( BOOL active )					
-{
-	if (!active && getChild<LLUICtrl>("Pipette")->getValue().asBoolean())
-	{
-		stopUsingPipette();
-	}
-	mActive = active; 
-}
-
-void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b)
-{
-	mCanApplyImmediately = b;
-	if (!mCanApplyImmediately)
-	{
-		getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
-	}
-	updateFilterPermMask();
-}
-
-void LLFloaterTexturePicker::stopUsingPipette()
-{
-	if (LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance())
-	{
-		LLToolMgr::getInstance()->clearTransientTool();
-	}
-}
-
-void LLFloaterTexturePicker::updateImageStats()
-{
-	if (mTexturep.notNull())
-	{
-		//RN: have we received header data for this image?
-		if (mTexturep->getFullWidth() > 0 && mTexturep->getFullHeight() > 0)
-		{
-			std::string formatted_dims = llformat("%d x %d", mTexturep->getFullWidth(),mTexturep->getFullHeight());
-			mResolutionLabel->setTextArg("[DIMENSIONS]", formatted_dims);
-			if (mOnUpdateImageStatsCallback)
-			{
-				mOnUpdateImageStatsCallback(mTexturep);
-			}
-		}
-		else
-		{
-			mResolutionLabel->setTextArg("[DIMENSIONS]", std::string("[? x ?]"));
-		}
-	}
-	else
-	{
-		mResolutionLabel->setTextArg("[DIMENSIONS]", std::string(""));
-	}
-}
-
-// virtual
-BOOL LLFloaterTexturePicker::handleDragAndDrop( 
-		S32 x, S32 y, MASK mask,
-		BOOL drop,
-		EDragAndDropType cargo_type, void *cargo_data, 
-		EAcceptance *accept,
-		std::string& tooltip_msg)
-{
-	BOOL handled = FALSE;
-
-	bool is_mesh = cargo_type == DAD_MESH;
-
-	if ((cargo_type == DAD_TEXTURE) || is_mesh)
-	{
-		LLInventoryItem *item = (LLInventoryItem *)cargo_data;
-
-		BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID());
-		BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID());
-		BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER,
-															gAgent.getID());
-
-		PermissionMask item_perm_mask = 0;
-		if (copy) item_perm_mask |= PERM_COPY;
-		if (mod)  item_perm_mask |= PERM_MODIFY;
-		if (xfer) item_perm_mask |= PERM_TRANSFER;
-		
-		//PermissionMask filter_perm_mask = getFilterPermMask();  Commented out due to no-copy texture loss.
-		PermissionMask filter_perm_mask = mDnDFilterPermMask;
-		if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask )
-		{
-			if (drop)
-			{
-				setImageID( item->getAssetUUID() );
-				commitIfImmediateSet();
-			}
-
-			*accept = ACCEPT_YES_SINGLE;
-		}
-		else
-		{
-			*accept = ACCEPT_NO;
-		}
-	}
-	else
-	{
-		*accept = ACCEPT_NO;
-	}
-
-	handled = TRUE;
-	LL_DEBUGS("UserInput") << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << LL_ENDL;
-
-	return handled;
-}
-
-BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask)
-{
-	LLFolderView* root_folder = mInventoryPanel->getRootFolder();
-
-	if (root_folder && mFilterEdit)
-	{
-		if (mFilterEdit->hasFocus() 
-			&& (key == KEY_RETURN || key == KEY_DOWN) 
-			&& mask == MASK_NONE)
-		{
-			if (!root_folder->getCurSelectedItem())
-			{
-				LLFolderViewItem* itemp =    mInventoryPanel->getItemByID(gInventory.getRootFolderID());
-				if (itemp)
-				{
-					root_folder->setSelection(itemp, FALSE, FALSE);
-				}
-			}
-			root_folder->scrollToShowSelection();
-			
-			// move focus to inventory proper
-			mInventoryPanel->setFocus(TRUE);
-			
-			// treat this as a user selection of the first filtered result
-			commitIfImmediateSet();
-			
-			return TRUE;
-		}
-		
-		if (mInventoryPanel->hasFocus() && key == KEY_UP)
-		{
-			mFilterEdit->focusFirstItem(TRUE);
-		}
-	}
-
-	return LLFloater::handleKeyHere(key, mask);
-}
-
-void LLFloaterTexturePicker::onClose(bool app_quitting)
-{
-	if (mOwner && mOnFloaterCloseCallback)
-	{
-		mOnFloaterCloseCallback();
-	}
-	stopUsingPipette();
-}
-
-// virtual
-BOOL LLFloaterTexturePicker::postBuild()
-{
-	LLFloater::postBuild();
-
-	if (!mLabel.empty())
-	{
-		std::string pick = getString("pick title");
-	
-		setTitle(pick + mLabel);
-	}
-	mTentativeLabel = getChild<LLTextBox>("Multiple");
-
-	mResolutionLabel = getChild<LLTextBox>("size_lbl");
-
-
-	childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this);
-	childSetAction("None", LLFloaterTexturePicker::onBtnNone,this);
-	childSetAction("Blank", LLFloaterTexturePicker::onBtnBlank,this);
-	childSetAction("Transparent", LLFloaterTexturePicker::onBtnTransparent,this);
-
-
-	childSetCommitCallback("show_folders_check", onShowFolders, this);
-	getChildView("show_folders_check")->setVisible( FALSE);
-
-	mFilterEdit = getChild<LLFilterEditor>("inventory search editor");
-	mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2));
-
-	mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
-
-	mModeSelector = getChild<LLComboBox>("mode_selection");
-	mModeSelector->setCommitCallback(onModeSelect, this);
-	mModeSelector->selectByValue(0);
-
-	if(mInventoryPanel)
-	{
-		U32 filter_types = 0x0;
-		filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
-		filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
-
-		mInventoryPanel->setFilterTypes(filter_types);
-		//mInventoryPanel->setFilterPermMask(getFilterPermMask());  //Commented out due to no-copy texture loss.
-		mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask);
-		mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2));
-		mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
-
-		// Disable auto selecting first filtered item because it takes away
-		// selection from the item set by LLTextureCtrl owning this floater.
-		mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE);
-
-		// Commented out to scroll to currently selected texture. See EXT-5403.
-		// // store this filter as the default one
-		// mInventoryPanel->getRootFolder()->getFilter().markDefault();
-
-		// Commented out to stop opening all folders with textures
-		// mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE);
-
-		// don't put keyboard focus on selected item, because the selection callback
-		// will assume that this was user input
-
-		
-
-		if(!mImageAssetID.isNull())
-		{
-			mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
-		}
-	}
-
-	childSetAction("l_add_btn", LLFloaterTexturePicker::onBtnAdd, this);
-	childSetAction("l_rem_btn", LLFloaterTexturePicker::onBtnRemove, this);
-	childSetAction("l_upl_btn", LLFloaterTexturePicker::onBtnUpload, this);
-
-	mLocalScrollCtrl = getChild<LLScrollListCtrl>("l_name_list");
-	mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit, this);
-	LLLocalBitmapMgr::getInstance()->feedScrollList(mLocalScrollCtrl);
-
-	getChild<LLLineEditor>("uuid_editor")->setCommitCallback(boost::bind(&onApplyUUID, this));
-	getChild<LLButton>("apply_uuid_btn")->setClickedCallback(boost::bind(&onApplyUUID, this));
-
-	mNoCopyTextureSelected = FALSE;
-
-	getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("TextureLivePreview"));
-	childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
-
-	if (!mCanApplyImmediately)
-	{
-		getChildView("show_folders_check")->setEnabled(FALSE);
-	}
-
-	getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this));
-	childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this);
-	childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this);
-
-	// update permission filter once UI is fully initialized
-	updateFilterPermMask();
-	mSavedFolderState.setApply(FALSE);
-
-	LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1));
-	
-	getChild<LLComboBox>("l_bake_use_texture_combo_box")->setCommitCallback(onBakeTextureSelect, this);
-	getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setCommitCallback(onHideBaseMeshRegionCheck, this);
-
-	setBakeTextureEnabled(TRUE);
-	return TRUE;
-}
-
-// virtual
-void LLFloaterTexturePicker::draw()
-{
-    static LLCachedControl<F32> max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f);
-    drawConeToOwner(mContextConeOpacity, max_opacity, mOwner);
-
-	updateImageStats();
-
-	// if we're inactive, gray out "apply immediate" checkbox
-	getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected);
-	getChildView("Select")->setEnabled(mActive && mCanApply);
-	getChildView("Pipette")->setEnabled(mActive);
-	getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance());
-
-	//BOOL allow_copy = FALSE;
-	if( mOwner ) 
-	{
-		mTexturep = NULL;
-		if(mImageAssetID.notNull())
-		{
-			LLPointer<LLViewerFetchedTexture> texture = NULL;
-
-			if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID))
-			{
-				LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
-				if (obj)
-				{
-					LLViewerTexture* viewerTexture = obj->getBakedTextureForMagicId(mImageAssetID);
-					texture = viewerTexture ? dynamic_cast<LLViewerFetchedTexture*>(viewerTexture) : NULL;
-				}
-			}
-
-			if (texture.isNull())
-			{
-				texture = LLViewerTextureManager::getFetchedTexture(mImageAssetID);
-			}
-
-			mTexturep = texture;
-			mTexturep->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
-		}
-
-		if (mTentativeLabel)
-		{
-			mTentativeLabel->setVisible( FALSE  );
-		}
-
-		getChildView("Default")->setEnabled(mImageAssetID != mDefaultImageAssetID || mTentative);
-		getChildView("Transparent")->setEnabled(mImageAssetID != mTransparentImageAssetID || mTentative);
-		getChildView("Blank")->setEnabled(mImageAssetID != mBlankImageAssetID || mTentative);
-		getChildView("None")->setEnabled(mAllowNoTexture && (!mImageAssetID.isNull() || mTentative));
-
-		LLFloater::draw();
-
-		if( isMinimized() )
-		{
-			return;
-		}
-
-		// Border
-		LLRect border = getChildView("preview_widget")->getRect();
-		gl_rect_2d( border, LLColor4::black, FALSE );
-
-
-		// Interior
-		LLRect interior = border;
-		interior.stretch( -1 ); 
-
-		// If the floater is focused, don't apply its alpha to the texture (STORM-677).
-		const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
-		if( mTexturep )
-		{
-			if( mTexturep->getComponents() == 4 )
-			{
-				gl_rect_2d_checkerboard( interior, alpha );
-			}
-
-			gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha );
-
-			// Pump the priority
-			mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) );
-		}
-		else if (!mFallbackImage.isNull())
-		{
-			mFallbackImage->draw(interior, UI_VERTEX_COLOR % alpha);
-		}
-		else
-		{
-			gl_rect_2d( interior, LLColor4::grey % alpha, TRUE );
-
-			// Draw X
-			gl_draw_x(interior, LLColor4::black );
-		}
-
-		// Draw Tentative Label over the image
-		if( mTentative && !mViewModel->isDirty() )
-		{
-			mTentativeLabel->setVisible( TRUE );
-			drawChild(mTentativeLabel);
-		}
-
-		if (mSelectedItemPinned) return;
-
-		LLFolderView* folder_view = mInventoryPanel->getRootFolder();
-		if (!folder_view) return;
-
-		LLFolderViewFilter& filter = static_cast<LLFolderViewModelInventory*>(folder_view->getFolderViewModel())->getFilter();
-
-		bool is_filter_active = folder_view->getViewModelItem()->getLastFilterGeneration() < filter.getCurrentGeneration() &&
-				filter.isNotDefault();
-
-		// After inventory panel filter is applied we have to update
-		// constraint rect for the selected item because of folder view
-		// AutoSelectOverride set to TRUE. We force PinningSelectedItem
-		// flag to FALSE state and setting filter "dirty" to update
-		// scroll container to show selected item (see LLFolderView::doIdle()).
-		if (!is_filter_active && !mSelectedItemPinned)
-		{
-			folder_view->setPinningSelectedItem(mSelectedItemPinned);
-			folder_view->getViewModelItem()->dirtyFilter();
-			mSelectedItemPinned = TRUE;
-		}
-	}
-}
-
-const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library)
-{
-	LLViewerInventoryCategory::cat_array_t cats;
-	LLViewerInventoryItem::item_array_t items;
-	LLAssetIDMatches asset_id_matches(asset_id);
-	gInventory.collectDescendentsIf(LLUUID::null,
-							cats,
-							items,
-							LLInventoryModel::INCLUDE_TRASH,
-							asset_id_matches);
-
-	if (items.size())
-	{
-		// search for copyable version first
-		for (S32 i = 0; i < items.size(); i++)
-		{
-			LLInventoryItem* itemp = items[i];
-			LLPermissions item_permissions = itemp->getPermissions();
-			if (item_permissions.allowCopyBy(gAgent.getID(), gAgent.getGroupID()))
-			{
-				if(!ignore_library || !gInventory.isObjectDescendentOf(itemp->getUUID(),gInventory.getLibraryRootFolderID()))
-				{
-					return itemp->getUUID();
-				}
-			}
-		}
-		// otherwise just return first instance, unless copyable requested
-		if (copyable_only)
-		{
-			return LLUUID::null;
-		}
-		else
-		{
-			if(!ignore_library || !gInventory.isObjectDescendentOf(items[0]->getUUID(),gInventory.getLibraryRootFolderID()))
-			{
-				return items[0]->getUUID();
-			}
-		}
-	}
-
-	return LLUUID::null;
-}
-
-PermissionMask LLFloaterTexturePicker::getFilterPermMask()
-{
-	bool apply_immediate = getChild<LLUICtrl>("apply_immediate_check")->getValue().asBoolean();
-	return apply_immediate ? mImmediateFilterPermMask : mNonImmediateFilterPermMask;
-}
-
-void LLFloaterTexturePicker::commitIfImmediateSet()
-{
-	if (!mNoCopyTextureSelected && mOnFloaterCommitCallback && mCanApply)
-	{
-		mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CHANGE, LLUUID::null);
-	}
-}
-
-void LLFloaterTexturePicker::commitCancel()
-{
-	if (!mNoCopyTextureSelected && mOnFloaterCommitCallback && mCanApply)
-	{
-		mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CANCEL, LLUUID::null);
-	}
-}
-
-// static
-void LLFloaterTexturePicker::onBtnSetToDefault(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	self->setCanApply(true, true);
-	if (self->mOwner)
-	{
-		self->setImageID( self->getDefaultImageAssetID() );
-	}
-	self->commitIfImmediateSet();
-}
-
-// static
-void LLFloaterTexturePicker::onBtnTransparent(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	self->setCanApply(true, true);
-	self->setImageID( self->getTransparentImageAssetID() );
-	self->commitIfImmediateSet();
-}
-
-// static
-void LLFloaterTexturePicker::onBtnBlank(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	self->setCanApply(true, true);
-	self->setImageID( self->getBlankImageAssetID() );
-	self->commitIfImmediateSet();
-}
-
-
-// static
-void LLFloaterTexturePicker::onBtnNone(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	self->setImageID( LLUUID::null );
-	self->commitCancel();
-}
-
-/*
-// static
-void LLFloaterTexturePicker::onBtnRevert(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	self->setImageID( self->mOriginalImageAssetID );
-	// TODO: Change this to tell the owner to cancel.  It needs to be
-	// smart enough to restore multi-texture selections.
-	self->mOwner->onFloaterCommit();
-	self->mViewModel->resetDirty();
-}*/
-
-// static
-void LLFloaterTexturePicker::onBtnCancel(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	self->setImageID( self->mOriginalImageAssetID );
-	if (self->mOnFloaterCommitCallback)
-	{
-		self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CANCEL, LLUUID::null);
-	}
-	self->mViewModel->resetDirty();
-	self->closeFloater();
-}
-
-// static
-void LLFloaterTexturePicker::onBtnSelect(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	LLUUID local_id = LLUUID::null;
-	if (self->mOwner)
-	{
-		if (self->mLocalScrollCtrl->getVisible() && !self->mLocalScrollCtrl->getAllSelected().empty())
-		{
-			LLUUID temp_id = self->mLocalScrollCtrl->getFirstSelected()->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID();
-			local_id = LLLocalBitmapMgr::getInstance()->getWorldID(temp_id);
-		}
-	}
-	
-	if (self->mOnFloaterCommitCallback)
-	{
-		self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_SELECT, local_id);
-	}
-	self->closeFloater();
-}
-
-void LLFloaterTexturePicker::onBtnPipette()
-{
-	BOOL pipette_active = getChild<LLUICtrl>("Pipette")->getValue().asBoolean();
-	pipette_active = !pipette_active;
-	if (pipette_active)
-	{
-		LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance());
-	}
-	else
-	{
-		LLToolMgr::getInstance()->clearTransientTool();
-	}
-}
-
-// static
-void LLFloaterTexturePicker::onApplyUUID(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	LLUUID id(self->getChild<LLLineEditor>("uuid_editor")->getText());
-	if (id.notNull())
-	{
-		self->setImageID(id);
-		self->commitIfImmediateSet();
-	}
-}
-
-void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
-{
-	if (items.size())
-	{
-		LLFolderViewItem* first_item = items.front();
-		LLInventoryItem* itemp = gInventory.getItem(static_cast<LLFolderViewModelItemInventory*>(first_item->getViewModelItem())->getUUID());
-		mNoCopyTextureSelected = FALSE;
-		if (itemp)
-		{
-			if (!mTextureSelectedCallback.empty())
-			{
-				mTextureSelectedCallback(itemp);
-			}
-			if (!itemp->getPermissions().allowCopyBy(gAgent.getID()))
-			{
-				mNoCopyTextureSelected = TRUE;
-			}
-			setImageID(itemp->getAssetUUID(),false);
-			mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
-
-			if(!mPreviewSettingChanged)
-			{
-				mCanPreview = gSavedSettings.getBOOL("TextureLivePreview");
-			}
-			else
-			{
-				mPreviewSettingChanged = false;
-			}
-
-			if (user_action && mCanPreview)
-			{
-				// only commit intentional selections, not implicit ones
-				commitIfImmediateSet();
-			}
-		}
-	}
-}
-
-// static
-void LLFloaterTexturePicker::onModeSelect(LLUICtrl* ctrl, void *userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-    int index = self->mModeSelector->getValue().asInteger();
-
-	self->getChild<LLButton>("Default")->setVisible(index == 0 ? TRUE : FALSE);
-	self->getChild<LLButton>("Transparent")->setVisible(index == 0 ? TRUE : FALSE);
-	self->getChild<LLButton>("Blank")->setVisible(index == 0 ? TRUE : FALSE);
-	self->getChild<LLButton>("None")->setVisible(index == 0 ? TRUE : FALSE);
-	self->getChild<LLButton>("Pipette")->setVisible(index == 0 ? TRUE : FALSE);
-	self->getChild<LLFilterEditor>("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE);
-	self->getChild<LLInventoryPanel>("inventory panel")->setVisible(index == 0 ? TRUE : FALSE);
-	self->getChild<LLLineEditor>("uuid_editor")->setVisible(index == 0 ? TRUE : FALSE);
-	self->getChild<LLButton>("apply_uuid_btn")->setVisible(index == 0 ? TRUE : FALSE);
-
-	/*self->getChild<LLCheckBox>("show_folders_check")->setVisible(mode);
-	  no idea under which conditions the above is even shown, needs testing. */
-
-	self->getChild<LLButton>("l_add_btn")->setVisible(index == 1 ? TRUE : FALSE);
-	self->getChild<LLButton>("l_rem_btn")->setVisible(index == 1 ? TRUE : FALSE);
-	self->getChild<LLButton>("l_upl_btn")->setVisible(index == 1 ? TRUE : FALSE);
-	self->getChild<LLScrollListCtrl>("l_name_list")->setVisible(index == 1 ? TRUE : FALSE);
-
-	self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setVisible(index == 2 ? TRUE : FALSE);
-	self->getChild<LLCheckBoxCtrl>("hide_base_mesh_region")->setVisible(FALSE);// index == 2 ? TRUE : FALSE);
-
-	if (index == 2)
-	{
-		self->stopUsingPipette();
-
-		S8 val = -1;
-
-		LLUUID imageID = self->mImageAssetID;
-		if (imageID == IMG_USE_BAKED_HEAD)
-		{
-			val = 0;
-		}
-		else if (imageID == IMG_USE_BAKED_UPPER)
-		{
-			val = 1;
-		}
-		else if (imageID == IMG_USE_BAKED_LOWER)
-		{
-			val = 2;
-		}
-		else if (imageID == IMG_USE_BAKED_EYES)
-		{
-			val = 3;
-		}
-		else if (imageID == IMG_USE_BAKED_SKIRT)
-		{
-			val = 4;
-		}
-		else if (imageID == IMG_USE_BAKED_HAIR)
-		{
-			val = 5;
-		}
-		else if (imageID == IMG_USE_BAKED_LEFTARM)
-		{
-			val = 6;
-		}
-		else if (imageID == IMG_USE_BAKED_LEFTLEG)
-		{
-			val = 7;
-		}
-		else if (imageID == IMG_USE_BAKED_AUX1)
-		{
-			val = 8;
-		}
-		else if (imageID == IMG_USE_BAKED_AUX2)
-		{
-			val = 9;
-		}
-		else if (imageID == IMG_USE_BAKED_AUX3)
-		{
-			val = 10;
-		}
-
-
-		self->getChild<LLComboBox>("l_bake_use_texture_combo_box")->setSelectedByValue(val, TRUE);
-	}
-}
-
-// static
-void LLFloaterTexturePicker::onBtnAdd(void* userdata)
-{
-	if (LLLocalBitmapMgr::getInstance()->addUnit() == true)
-	{
-		LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-		LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl);
-	}
-}
-
-// static
-void LLFloaterTexturePicker::onBtnRemove(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
-
-	if (!selected_items.empty())
-	{
-		for(std::vector<LLScrollListItem*>::iterator iter = selected_items.begin();
-			iter != selected_items.end(); iter++)
-		{
-			LLScrollListItem* list_item = *iter;
-			if (list_item)
-			{
-				LLUUID tracking_id = list_item->getColumn(LOCAL_TRACKING_ID_COLUMN)->getValue().asUUID();
-				LLLocalBitmapMgr::getInstance()->delUnit(tracking_id);
-			}
-		}
-
-		self->getChild<LLButton>("l_rem_btn")->setEnabled(false);
-		self->getChild<LLButton>("l_upl_btn")->setEnabled(false);
-		LLLocalBitmapMgr::getInstance()->feedScrollList(self->mLocalScrollCtrl);
-	}
-
-}
-
-// static
-void LLFloaterTexturePicker::onBtnUpload(void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
-
-	if (selected_items.empty())
-	{
-		return;
-	}
-
-	/* currently only allows uploading one by one, picks the first item from the selection list.  (not the vector!)
-	   in the future, it might be a good idea to check the vector size and if more than one units is selected - opt for multi-image upload. */
-	
-	LLUUID tracking_id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN);
-	std::string filename = LLLocalBitmapMgr::getInstance()->getFilename(tracking_id);
-
-	if (!filename.empty())
-	{
-		LLFloaterReg::showInstance("upload_image", LLSD(filename));
-	}
-
-}
-
-//static
-void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl* ctrl, void* userdata)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata;
-	std::vector<LLScrollListItem*> selected_items = self->mLocalScrollCtrl->getAllSelected();
-	bool has_selection = !selected_items.empty();
-
-	self->getChild<LLButton>("l_rem_btn")->setEnabled(has_selection);
-	self->getChild<LLButton>("l_upl_btn")->setEnabled(has_selection && (selected_items.size() < 2));
-	/* since multiple-localbitmap upload is not implemented, upl button gets disabled if more than one is selected. */
-
-	if (has_selection)
-	{
-		LLUUID tracking_id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel(LOCAL_TRACKING_ID_COLUMN); 
-		LLUUID inworld_id = LLLocalBitmapMgr::getInstance()->getWorldID(tracking_id);
-		if (self->mSetImageAssetIDCallback)
-		{
-			self->mSetImageAssetIDCallback(inworld_id);
-		}
-
-		if (self->childGetValue("apply_immediate_check").asBoolean())
-		{
-			if (self->mOnFloaterCommitCallback)
-			{
-				self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_CHANGE, inworld_id);
-			}
-		}
-	}
-}
-
-// static
-void LLFloaterTexturePicker::onShowFolders(LLUICtrl* ctrl, void *user_data)
-{
-	LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl;
-	LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data;
-
-	if (check_box->get())
-	{
-		picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
-	}
-	else
-	{
-		picker->mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NO_FOLDERS);
-	}
-}
-
-// static
-void LLFloaterTexturePicker::onApplyImmediateCheck(LLUICtrl* ctrl, void *user_data)
-{
-	LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data;
-
-	LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl;
-	gSavedSettings.setBOOL("TextureLivePreview", check_box->get());
-
-	picker->updateFilterPermMask();
-	picker->commitIfImmediateSet();
-}
-
-//static
-void LLFloaterTexturePicker::onBakeTextureSelect(LLUICtrl* ctrl, void *user_data)
-{
-	LLFloaterTexturePicker* self = (LLFloaterTexturePicker*)user_data;
-	LLComboBox* combo_box = (LLComboBox*)ctrl;
-
-	S8 type = combo_box->getValue().asInteger();
-	
-	LLUUID imageID = self->mDefaultImageAssetID;
-	if (type == 0)
-	{
-		imageID = IMG_USE_BAKED_HEAD;
-	}
-	else if (type == 1)
-	{
-		imageID = IMG_USE_BAKED_UPPER;
-	}
-	else if (type == 2)
-	{
-		imageID = IMG_USE_BAKED_LOWER;
-	}
-	else if (type == 3)
-	{
-		imageID = IMG_USE_BAKED_EYES;
-	}
-	else if (type == 4)
-	{
-		imageID = IMG_USE_BAKED_SKIRT;
-	}
-	else if (type == 5)
-	{
-		imageID = IMG_USE_BAKED_HAIR;
-	}
-	else if (type == 6)
-	{
-		imageID = IMG_USE_BAKED_LEFTARM;
-	}
-	else if (type == 7)
-	{
-		imageID = IMG_USE_BAKED_LEFTLEG;
-	}
-	else if (type == 8)
-	{
-		imageID = IMG_USE_BAKED_AUX1;
-	}
-	else if (type == 9)
-	{
-		imageID = IMG_USE_BAKED_AUX2;
-	}
-	else if (type == 10)
-	{
-		imageID = IMG_USE_BAKED_AUX3;
-	}
-
-	self->setImageID(imageID);
-	self->mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
-
-	if (!self->mPreviewSettingChanged)
-	{
-		self->mCanPreview = gSavedSettings.getBOOL("TextureLivePreview");
-	}
-	else
-	{
-		self->mPreviewSettingChanged = false;
-	}
-
-	if (self->mCanPreview)
-	{
-		// only commit intentional selections, not implicit ones
-		self->commitIfImmediateSet();
-	}
-}
-
-//static
-void LLFloaterTexturePicker::onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *user_data)
-{
-	//LLFloaterTexturePicker* picker = (LLFloaterTexturePicker*)user_data;
-	//LLCheckBoxCtrl* check_box = (LLCheckBoxCtrl*)ctrl;
-}
-
-void LLFloaterTexturePicker::updateFilterPermMask()
-{
-	//mInventoryPanel->setFilterPermMask( getFilterPermMask() );  Commented out due to no-copy texture loss.
-}
-
-void LLFloaterTexturePicker::setCanApply(bool can_preview, bool can_apply)
-{
-	getChildRef<LLUICtrl>("Select").setEnabled(can_apply);
-	getChildRef<LLUICtrl>("preview_disabled").setVisible(!can_preview);
-	getChildRef<LLUICtrl>("apply_immediate_check").setVisible(can_preview);
-
-	mCanApply = can_apply;
-	mCanPreview = can_preview ? gSavedSettings.getBOOL("TextureLivePreview") : false;
-	mPreviewSettingChanged = true;
-}
-
-void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string )
-{
-	std::string upper_case_search_string = search_string;
-	LLStringUtil::toUpper(upper_case_search_string);
-
-	if (upper_case_search_string.empty())
-	{
-		if (mInventoryPanel->getFilterSubString().empty())
-		{
-			// current filter and new filter empty, do nothing
-			return;
-		}
-
-		mSavedFolderState.setApply(TRUE);
-		mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
-		// add folder with current item to list of previously opened folders
-		LLOpenFoldersWithSelection opener;
-		mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener);
-		mInventoryPanel->getRootFolder()->scrollToShowSelection();
-
-	}
-	else if (mInventoryPanel->getFilterSubString().empty())
-	{
-		// first letter in search term, save existing folder open state
-		if (!mInventoryPanel->getFilter().isNotDefault())
-		{
-			mSavedFolderState.setApply(FALSE);
-			mInventoryPanel->getRootFolder()->applyFunctorRecursively(mSavedFolderState);
-		}
-	}
-
-	mInventoryPanel->setFilterSubString(search_string);
-}
-
-void LLFloaterTexturePicker::setLocalTextureEnabled(BOOL enabled)
-{
-    mModeSelector->setEnabledByValue(1, enabled);
-}
-
-void LLFloaterTexturePicker::setBakeTextureEnabled(BOOL enabled)
-{
-	BOOL changed = (enabled != mBakeTextureEnabled);
-
-	mBakeTextureEnabled = enabled;
-	mModeSelector->setEnabledByValue(2, enabled);
-
-	if (!mBakeTextureEnabled && (mModeSelector->getValue().asInteger() == 2))
-	{
-		mModeSelector->selectByValue(0);
-	}
-	
-	if (changed && mBakeTextureEnabled && LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(mImageAssetID))
-	{
-		if (mModeSelector->getValue().asInteger() != 2)
-		{
-			mModeSelector->selectByValue(2);
-		}
-	}
-	onModeSelect(0, this);
-}
-
-void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te )
-{
-	LLUUID inventory_item_id = findItemID(te.getID(), TRUE);
-	if (inventory_item_id.notNull())
-	{
-		LLToolPipette::getInstance()->setResult(TRUE, "");
-		setImageID(te.getID());
-
-		mNoCopyTextureSelected = FALSE;
-		LLInventoryItem* itemp = gInventory.getItem(inventory_item_id);
-
-		if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID()))
-		{
-			// no copy texture
-			mNoCopyTextureSelected = TRUE;
-		}
-		
-		commitIfImmediateSet();
-	}
-	else
-	{
-		LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture"));
-	}
-}
-
 ///////////////////////////////////////////////////////////////////////
 // LLTextureCtrl
 
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index 719fb953aa46be7c94911a681592b6544d3f4b80..6c063991d1550678e660ef2c61f791e6e0f0b876 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -28,12 +28,9 @@
 #ifndef LL_LLTEXTURECTRL_H
 #define LL_LLTEXTURECTRL_H
 
-#include "llcoord.h"
-#include "llfiltereditor.h"
 #include "llfloater.h"
 #include "llfolderview.h"
 #include "lllocalbitmaps.h"
-#include "llstring.h"
 #include "lluictrl.h"
 #include "llpermissionsflags.h"
 #include "lltextbox.h" // for params
@@ -66,7 +63,6 @@ bool get_can_copy_texture(LLUUID image_id);
 //////////////////////////////////////////////////////////////////////////////////////////
 // LLTextureCtrl
 
-
 class LLTextureCtrl
 : public LLUICtrl
 {
@@ -257,152 +253,4 @@ class LLTextureCtrl
 	bool						mOpenTexPreview;
 };
 
-//////////////////////////////////////////////////////////////////////////////////////////
-// LLFloaterTexturePicker
-typedef boost::function<void(LLTextureCtrl::ETexturePickOp op, LLUUID id)> floater_commit_callback;
-typedef boost::function<void()> floater_close_callback;
-typedef boost::function<void(const LLUUID& asset_id)> set_image_asset_id_callback;
-typedef boost::function<void(LLPointer<LLViewerTexture> texture)> set_on_update_image_stats_callback;
-
-class LLFloaterTexturePicker final : public LLFloater
-{
-public:
-	LLFloaterTexturePicker(
-		LLView* owner,
-		LLUUID image_asset_id,
-		LLUUID default_image_asset_id,
-		LLUUID transparent_image_asset_id,
-		LLUUID blank_image_asset_id,
-		BOOL tentative,
-		BOOL allow_no_texture,
-		const std::string& label,
-		PermissionMask immediate_filter_perm_mask,
-		PermissionMask dnd_filter_perm_mask,
-		PermissionMask non_immediate_filter_perm_mask,
-		BOOL can_apply_immediately,
-		LLUIImagePtr fallback_image_name
-		);
-
-	virtual ~LLFloaterTexturePicker();
-
-	// LLView overrides
-	/*virtual*/ BOOL	handleDragAndDrop(S32 x, S32 y, MASK mask,
-		BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
-		EAcceptance *accept,
-		std::string& tooltip_msg);
-	/*virtual*/ void	draw();
-	/*virtual*/ BOOL	handleKeyHere(KEY key, MASK mask);
-
-	// LLFloater overrides
-	/*virtual*/ BOOL    postBuild();
-	/*virtual*/ void	onClose(bool app_settings);
-
-	// New functions
-	void setImageID(const LLUUID& image_asset_id, bool set_selection = true);
-	void updateImageStats();
-	const LLUUID&	getAssetID() { return mImageAssetID; }
-	const LLUUID&	findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library = FALSE);
-	void			setCanApplyImmediately(BOOL b);
-
-	void			setActive(BOOL active);
-
-	LLView*			getOwner() const { return mOwner; }
-	void			setOwner(LLView* owner) { mOwner = owner; }
-	void			stopUsingPipette();
-	PermissionMask 	getFilterPermMask();
-
-	void updateFilterPermMask();
-	void commitIfImmediateSet();
-	void commitCancel();
-
-	void onFilterEdit(const std::string& search_string);
-
-	void setCanApply(bool can_preview, bool can_apply);
-	void setTextureSelectedCallback(const texture_selected_callback& cb) { mTextureSelectedCallback = cb; }
-	void setOnFloaterCloseCallback(const floater_close_callback& cb) { mOnFloaterCloseCallback = cb; }
-	void setOnFloaterCommitCallback(const floater_commit_callback& cb) { mOnFloaterCommitCallback = cb; }
-	void setSetImageAssetIDCallback(const set_image_asset_id_callback& cb) { mSetImageAssetIDCallback = cb; }
-	void setOnUpdateImageStatsCallback(const set_on_update_image_stats_callback& cb) { mOnUpdateImageStatsCallback = cb; }
-	const LLUUID& getDefaultImageAssetID() { return mDefaultImageAssetID; }
-	const LLUUID& getTransparentImageAssetID() { return mTransparentImageAssetID; }
-	const LLUUID& getBlankImageAssetID() { return mBlankImageAssetID; }
-
-	static void		onBtnSetToDefault(void* userdata);
-	static void		onBtnSelect(void* userdata);
-	static void		onBtnCancel(void* userdata);
-	void			onBtnPipette();
-	//static void		onBtnRevert( void* userdata );
-	static void		onBtnTransparent(void* userdata);
-	static void		onBtnBlank(void* userdata);
-	static void		onBtnNone(void* userdata);
-	static void		onBtnClear(void* userdata);
-	static void		onApplyUUID(void* userdata);
-	void			onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
-	static void		onShowFolders(LLUICtrl* ctrl, void* userdata);
-	static void		onApplyImmediateCheck(LLUICtrl* ctrl, void* userdata);
-	void			onTextureSelect(const LLTextureEntry& te);
-
-	static void		onModeSelect(LLUICtrl* ctrl, void *userdata);
-	static void		onBtnAdd(void* userdata);
-	static void		onBtnRemove(void* userdata);
-	static void		onBtnUpload(void* userdata);
-	static void		onLocalScrollCommit(LLUICtrl* ctrl, void* userdata);
-
-	static void		onBakeTextureSelect(LLUICtrl* ctrl, void *userdata);
-	static void		onHideBaseMeshRegionCheck(LLUICtrl* ctrl, void *userdata);
-
-	void 			setLocalTextureEnabled(BOOL enabled);
-	void 			setBakeTextureEnabled(BOOL enabled);
-
-protected:
-	LLPointer<LLViewerTexture> mTexturep;
-	LLView*				mOwner;
-
-	LLUUID				mImageAssetID; // Currently selected texture
-	LLUIImagePtr		mFallbackImage; // What to show if currently selected texture is null.
-	LLUUID				mDefaultImageAssetID;
-	LLUUID				mTransparentImageAssetID;
-	LLUUID				mBlankImageAssetID;
-	BOOL				mTentative;
-	BOOL				mAllowNoTexture;
-	LLUUID				mSpecialCurrentImageAssetID;  // Used when the asset id has no corresponding texture in the user's inventory.
-	LLUUID				mOriginalImageAssetID;
-
-	std::string			mLabel;
-
-	LLTextBox*			mTentativeLabel;
-	LLTextBox*			mResolutionLabel;
-
-	std::string			mPendingName;
-	BOOL				mActive;
-
-	LLFilterEditor*		mFilterEdit;
-	LLInventoryPanel*	mInventoryPanel;
-	PermissionMask		mImmediateFilterPermMask;
-	PermissionMask		mDnDFilterPermMask;
-	PermissionMask		mNonImmediateFilterPermMask;
-	BOOL				mCanApplyImmediately;
-	BOOL				mNoCopyTextureSelected;
-	F32					mContextConeOpacity;
-	LLSaveFolderState	mSavedFolderState;
-	BOOL				mSelectedItemPinned;
-
-	LLComboBox*			mModeSelector;
-	LLScrollListCtrl*	mLocalScrollCtrl;
-
-private:
-	bool mCanApply;
-	bool mCanPreview;
-	bool mPreviewSettingChanged;
-
-
-	texture_selected_callback mTextureSelectedCallback;
-	floater_close_callback mOnFloaterCloseCallback;
-	floater_commit_callback mOnFloaterCommitCallback;
-	set_image_asset_id_callback mSetImageAssetIDCallback;
-	set_on_update_image_stats_callback mOnUpdateImageStatsCallback;
-
-	BOOL mBakeTextureEnabled;
-};
-
 #endif  // LL_LLTEXTURECTRL_H
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 7829c90cfc3300d0a7627abfc3a0a93802761733..ae91fc4c93fb799afd08908c346afe235d87e7b1 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -178,6 +178,7 @@
 #include "llinspectobject.h"
 #include "llinspectremoteobject.h"
 #include "llinspecttoast.h"
+#include "lllegacynotificationwellwindow.h"
 #include "llmoveview.h"
 #include "llfloaterimnearbychat.h"
 #include "llpanelblockedlist.h"
@@ -192,6 +193,7 @@
 
 // *NOTE: Please add files in alphabetical order to keep merges easy.
 // [RLVa:KB] - Checked: 2010-03-11
+#include "llfloaterwebprofile.h"
 #include "rlvfloaters.h"
 // [/RLVa:KB]
 // handle secondlife:///app/openfloater/{NAME} URLs
@@ -441,6 +443,7 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("delete_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDeleteQueue>);
 	LLFloaterReg::add("generic_text", "floater_generic_text.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGenericText>);
     LLFloaterReg::add("legacy_profile", "floater_profile_legacy.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<LLFloaterProfileLegacy>);
+	LLFloaterReg::add("legacy_notification_well_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNotificationWellWindow>);
 	LLFloaterReg::add("lightbox", "floater_lightbox_settings.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<ALFloaterLightBox>);
 	LLFloaterReg::add("message_builder", "floater_message_builder.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMessageBuilder>);
 	LLFloaterReg::add("message_log", "floater_message_log.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMessageLog>);
@@ -452,8 +455,9 @@ void LLViewerFloaterReg::registerFloaters()
 	LLFloaterReg::add("quick_settings", "floater_quick_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>);
 	LLFloaterReg::add("region_tracker", "floater_region_tracker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterRegionTracker>);
 	LLFloaterReg::add("search", "floater_directory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterDirectory>);
-
 	LLFloaterReg::add("sound_explorer", "floater_explore_sounds.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterExploreSounds>);
+    LLFloaterReg::add("webprofile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create);
+
 	
 	LLFloaterReg::registerControlVariables(); // Make sure visibility and rect controls get preserved when saving
 }
diff --git a/indra/newview/skins/default/xui/en/floater_sys_well.xml b/indra/newview/skins/default/xui/en/floater_sys_well.xml
index 2c5176cf01367f6b967455e608f3334d3451b7fa..4a71166304d42e000c26f7985a596a6888a8fd2c 100644
--- a/indra/newview/skins/default/xui/en/floater_sys_well.xml
+++ b/indra/newview/skins/default/xui/en/floater_sys_well.xml
@@ -23,6 +23,10 @@
      name="title_im_well_window">
         CONVERSATIONS
     </string>
+	<string
+     name="title_notification_well_window">
+		NOTIFICATIONS
+	</string>
 
     <flat_list_view
 	    color="FloaterDefaultBackgroundColor"
diff --git a/indra/newview/skins/default/xui/en/menu_profile_legacy.xml b/indra/newview/skins/default/xui/en/menu_profile_legacy.xml
index 8f01e7c7baa908ff04292d6a111a359e2336c356..eb84af1aee03e927a3b8007dd0baecc2af8cc67c 100644
--- a/indra/newview/skins/default/xui/en/menu_profile_legacy.xml
+++ b/indra/newview/skins/default/xui/en/menu_profile_legacy.xml
@@ -3,14 +3,39 @@
      name="menu_profile_legacy"
      left="0" bottom="0" visible="false"
      mouse_opaque="false">
-  <!--<menu_item_call
+  <menu_item_call
    label="Open Webprofile..."
    name="webprofile">
      <menu_item_call.on_click
       function="Profile.Action"
       parameter="webprofile"/>
   </menu_item_call>
-  <menu_item_separator/>-->
+  <menu_item_separator/>
+  <!--<menu
+	label="Upload profile image"
+	layout="topleft"
+	name="upload_image_menu">
+	  <menu_item_call
+       label="Second Life..."
+       name="upload_second_life">
+		<menu_item_call.on_click
+		 function="Profile.Action"
+		 parameter="upload_sl"/>
+		<menu_item_call.on_enable
+		 function="Profile.Enable"
+		 parameter="can_upload_pic" />
+	  </menu_item_call>
+	  <menu_item_call
+       label="First Life..."
+       name="upload_first_life">
+        <menu_item_call.on_click
+	     function="Profile.Action"
+	     parameter="upload_fl"/>
+        <menu_item_call.on_enable
+		 function="Profile.Enable"
+		 parameter="can_upload_pic" />
+	  </menu_item_call>
+  </menu>-->
   <menu_item_call
    label="Share..."
    name="share">
diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml
index 4c0cdd321e16f2879d8d90c2ad3919b288813e77..5dbca3d75a3c96597858f38fae43511bc474d251 100644
--- a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml
@@ -55,8 +55,7 @@
      text_color="white"
      top="9"
      use_ellipses="true"
-     width="193"
-     word_wrap="false" />
+     width="193" />
     <expandable_text
      follows="top|left|right"
      font="SansSerifSmall"