SL-19282 Removed LLInspectTexture floater

LLInspectTexture floater appears to be incomplete and doesn't have a function
master
Andrey Kleshchev 2023-03-01 23:37:05 +02:00
parent b142219667
commit 4d2bdbb05a
4 changed files with 0 additions and 169 deletions

View File

@ -25,7 +25,6 @@
#include "llviewerprecompiledheaders.h"
#include "llfloaterreg.h"
#include "llinspect.h"
#include "llinspecttexture.h"
#include "llinventoryfunctions.h"
@ -34,101 +33,6 @@
#include "lltrans.h"
#include "llviewertexturelist.h"
// ============================================================================
// LLInspectTexture class
//
class LLInspectTexture : public LLInspect
{
friend class LLFloaterReg;
public:
LLInspectTexture(const LLSD& sdKey);
~LLInspectTexture();
public:
void onOpen(const LLSD& sdData) override;
BOOL postBuild() override;
public:
const LLUUID& getAssetId() const { return mAssetId; }
const LLUUID& getItemId() const { return mItemId; }
protected:
LLUUID mAssetId;
LLUUID mItemId; // Item UUID relative to gInventoryModel (or null if not displaying an inventory texture)
LLUUID mNotecardId;
LLTextureCtrl* mTextureCtrl = nullptr;
LLTextBox* mTextureName = nullptr;
};
LLInspectTexture::LLInspectTexture(const LLSD& sdKey)
: LLInspect(LLSD())
{
}
LLInspectTexture::~LLInspectTexture()
{
}
void LLInspectTexture::onOpen(const LLSD& sdData)
{
// Start fade animation
LLInspect::onOpen(sdData);
bool fIsAsset = sdData.has("thumbnail_id");
bool fIsInventory = sdData.has("item_id");
// Skip if we're being asked to display the same thing
const LLUUID idAsset = (fIsAsset) ? sdData["thumbnail_id"].asUUID() : LLUUID::null;
const LLUUID idItem = (fIsInventory) ? sdData["item_id"].asUUID() : LLUUID::null;
if ( (getVisible()) && ( ((fIsAsset) && (idAsset == mAssetId)) || ((fIsInventory) && (idItem == mItemId)) ) )
{
return;
}
// Position the inspector relative to the mouse cursor
// Similar to how tooltips are positioned [see LLToolTipMgr::createToolTip()]
if (sdData.has("pos"))
LLUI::instance().positionViewNearMouse(this, sdData["pos"]["x"].asInteger(), sdData["pos"]["y"].asInteger());
else
LLUI::instance().positionViewNearMouse(this);
std::string strName = sdData["name"].asString();
if (fIsAsset)
{
mAssetId = idAsset;
mItemId = idItem; // Will be non-null in the case of a notecard
mNotecardId = sdData["notecard_id"].asUUID();
}
else if (fIsInventory)
{
const LLViewerInventoryItem* pItem = gInventory.getItem(idItem);
if ( (pItem) && (LLAssetType::AT_TEXTURE == pItem->getType()) )
{
if (strName.empty())
strName = pItem->getName();
mAssetId = pItem->getAssetUUID();
mItemId = idItem;
}
else
{
mAssetId.setNull();
mItemId.setNull();
}
mNotecardId = LLUUID::null;
}
mTextureCtrl->setImageAssetID(mAssetId);
mTextureName->setText(strName);
}
BOOL LLInspectTexture::postBuild()
{
mTextureCtrl = getChild<LLTextureCtrl>("texture_ctrl");
mTextureName = getChild<LLTextBox>("texture_name");
return TRUE;
}
// ============================================================================
// Helper functions
@ -202,11 +106,6 @@ LLToolTip* LLInspectTextureUtil::createInventoryToolTip(LLToolTip::Params p)
}
}
void LLInspectTextureUtil::registerFloater()
{
LLFloaterReg::add("inspect_texture", "inspect_texture.xml", &LLFloaterReg::build<LLInspectTexture>);
}
// ============================================================================
// LLTexturePreviewView helper class
//

View File

@ -32,9 +32,6 @@ class LLTexturePreviewView;
namespace LLInspectTextureUtil
{
LLToolTip* createInventoryToolTip(LLToolTip::Params p);
// Register with LLFloaterReg
void registerFloater();
}
class LLTextureToolTip : public LLToolTip

View File

@ -154,7 +154,6 @@
#include "llinspectgroup.h"
#include "llinspectobject.h"
#include "llinspectremoteobject.h"
#include "llinspecttexture.h"
#include "llinspecttoast.h"
#include "llmoveview.h"
#include "llfloaterimnearbychat.h"
@ -378,7 +377,6 @@ void LLViewerFloaterReg::registerFloaters()
LLInspectAvatarUtil::registerFloater();
LLInspectGroupUtil::registerFloater();
LLInspectObjectUtil::registerFloater();
LLInspectTextureUtil::registerFloater();
LLInspectRemoteObjectUtil::registerFloater();
LLFloaterVoiceVolumeUtil::registerFloater();
LLNotificationsUI::registerFloater();

View File

@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!--
Not can_close / no title to avoid window chrome
Single instance - only have one at a time, recycle it each spawn
-->
<floater
legacy_header_height="25"
bevel_style="in"
bg_opaque_image="Inspector_Background"
can_close="false"
can_minimize="false"
height="295"
layout="topleft"
name="inspect_texture"
single_instance="true"
sound_flags="0"
visible="true"
width="250">
<texture_picker
enabled="false"
fallback_image="default_land_picture.j2c"
follows="all"
height="262"
layout="topleft"
left="5"
name="texture_ctrl"
top_pad="5"
width="240" />
<text
follows="top|left"
font="SansSerifSmall"
height="16"
left="7"
name="texture_name"
parse_urls="false"
right="-7"
top_delta="244"
text_color="White"
translate="false"
use_ellipses="true"
word_wrap="true"
value="Name of the texture goes here" />
<button
bottom="-5"
follows="bottom|left"
height="23"
label="Open"
left="7"
name="open_btn"
width="115"
commit_callback.function="InspectTexture.Open"
enable_callback.function="InspectTexture.CanOpen" />
<button
bottom="-5"
follows="bottom|left"
height="23"
label="Copy to Inventory"
left_pad="5"
name="copy_btn"
width="115"
commit_callback.function="InspectTexture.CopyToInv"
enable_callback.function="InspectTexture.CanCopyToInv" />
</floater>