Ïntroduced LLFolderType and LLViewerAssetType (by Shyotl)
This commit is contained in:
@@ -39,6 +39,7 @@ set(llcommon_SOURCE_FILES
|
||||
llfile.cpp
|
||||
llfindlocale.cpp
|
||||
llfixedbuffer.cpp
|
||||
llfoldertype.cpp
|
||||
llformat.cpp
|
||||
llframetimer.cpp
|
||||
llheartbeat.cpp
|
||||
@@ -133,6 +134,7 @@ set(llcommon_HEADER_FILES
|
||||
llfile.h
|
||||
llfindlocale.h
|
||||
llfixedbuffer.h
|
||||
llfoldertype.h
|
||||
llformat.h
|
||||
llframetimer.h
|
||||
llhash.h
|
||||
|
||||
@@ -85,26 +85,26 @@ LLAssetDictionary::LLAssetDictionary()
|
||||
addEntry(LLAssetType::AT_OBJECT, new AssetEntry("OBJECT", "object", "object", true, false, false));
|
||||
addEntry(LLAssetType::AT_NOTECARD, new AssetEntry("NOTECARD", "notecard", "note card", true, false, true));
|
||||
addEntry(LLAssetType::AT_CATEGORY, new AssetEntry("CATEGORY", "category", "folder", true, false, false));
|
||||
addEntry(LLAssetType::AT_ROOT_CATEGORY, new AssetEntry("ROOT_CATEGORY", "root", "root", false, false, false));
|
||||
//addEntry(LLAssetType::AT_ROOT_CATEGORY, new AssetEntry("ROOT_CATEGORY", "root", "root", false, false, false));
|
||||
addEntry(LLAssetType::AT_LSL_TEXT, new AssetEntry("LSL_TEXT", "lsltext", "lsl2 script", true, false, false));
|
||||
addEntry(LLAssetType::AT_LSL_BYTECODE, new AssetEntry("LSL_BYTECODE", "lslbyte", "lsl bytecode", true, false, false));
|
||||
addEntry(LLAssetType::AT_TEXTURE_TGA, new AssetEntry("TEXTURE_TGA", "txtr_tga", "tga texture", true, false, false));
|
||||
addEntry(LLAssetType::AT_BODYPART, new AssetEntry("BODYPART", "bodypart", "body part", true, true, true));
|
||||
addEntry(LLAssetType::AT_TRASH, new AssetEntry("TRASH", "trash", "trash", false, false, false));
|
||||
addEntry(LLAssetType::AT_SNAPSHOT_CATEGORY, new AssetEntry("SNAPSHOT_CATEGORY", "snapshot", "snapshot", false, false, false));
|
||||
addEntry(LLAssetType::AT_LOST_AND_FOUND, new AssetEntry("LOST_AND_FOUND", "lstndfnd", "lost and found", false, false, false));
|
||||
//addEntry(LLAssetType::AT_TRASH, new AssetEntry("TRASH", "trash", "trash", false, false, false));
|
||||
//addEntry(LLAssetType::AT_SNAPSHOT_CATEGORY, new AssetEntry("SNAPSHOT_CATEGORY", "snapshot", "snapshot", false, false, false));
|
||||
//addEntry(LLAssetType::AT_LOST_AND_FOUND, new AssetEntry("LOST_AND_FOUND", "lstndfnd", "lost and found", false, false, false));
|
||||
addEntry(LLAssetType::AT_SOUND_WAV, new AssetEntry("SOUND_WAV", "snd_wav", "sound", true, false, false));
|
||||
addEntry(LLAssetType::AT_IMAGE_TGA, new AssetEntry("IMAGE_TGA", "img_tga", "targa image", true, false, false));
|
||||
addEntry(LLAssetType::AT_IMAGE_JPEG, new AssetEntry("IMAGE_JPEG", "jpeg", "jpeg image", true, false, false));
|
||||
addEntry(LLAssetType::AT_ANIMATION, new AssetEntry("ANIMATION", "animatn", "animation", true, true, true));
|
||||
addEntry(LLAssetType::AT_GESTURE, new AssetEntry("GESTURE", "gesture", "gesture", true, true, true));
|
||||
addEntry(LLAssetType::AT_SIMSTATE, new AssetEntry("SIMSTATE", "simstate", "simstate", false, false, false));
|
||||
addEntry(LLAssetType::AT_FAVORITE, new AssetEntry("FAVORITE", "favorite", "", false, false, false));
|
||||
//addEntry(LLAssetType::AT_FAVORITE, new AssetEntry("FAVORITE", "favorite", "", false, false, false));
|
||||
addEntry(LLAssetType::AT_LINK, new AssetEntry("LINK", "link", "sym link", false, false, true));
|
||||
addEntry(LLAssetType::AT_LINK_FOLDER, new AssetEntry("FOLDER_LINK", "link_f", "sym folder link", false, false, true));
|
||||
addEntry(LLAssetType::AT_CURRENT_OUTFIT, new AssetEntry("FOLDER_LINK", "current", "current outfit", false, false, false));
|
||||
addEntry(LLAssetType::AT_OUTFIT, new AssetEntry("OUTFIT", "outfit", "outfit", false, false, false));
|
||||
addEntry(LLAssetType::AT_MY_OUTFITS, new AssetEntry("MY_OUTFITS", "my_otfts", "my outfits", false, false, false));
|
||||
//addEntry(LLAssetType::AT_CURRENT_OUTFIT, new AssetEntry("FOLDER_LINK", "current", "current outfit", false, false, false));
|
||||
//addEntry(LLAssetType::AT_OUTFIT, new AssetEntry("OUTFIT", "outfit", "outfit", false, false, false));
|
||||
//addEntry(LLAssetType::AT_MY_OUTFITS, new AssetEntry("MY_OUTFITS", "my_otfts", "my outfits", false, false, false));
|
||||
addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, false, false, false));
|
||||
};
|
||||
|
||||
@@ -206,47 +206,7 @@ LLAssetType::EType LLAssetType::lookupHumanReadable(const std::string& readable_
|
||||
return AT_NONE;
|
||||
}
|
||||
|
||||
EDragAndDropType LLAssetType::lookupDragAndDropType( EType asset )
|
||||
{
|
||||
switch( asset )
|
||||
{
|
||||
case AT_TEXTURE: return DAD_TEXTURE;
|
||||
case AT_SOUND: return DAD_SOUND;
|
||||
case AT_CALLINGCARD: return DAD_CALLINGCARD;
|
||||
case AT_LANDMARK: return DAD_LANDMARK;
|
||||
case AT_SCRIPT: return DAD_NONE;
|
||||
case AT_CLOTHING: return DAD_CLOTHING;
|
||||
case AT_OBJECT: return DAD_OBJECT;
|
||||
case AT_NOTECARD: return DAD_NOTECARD;
|
||||
case AT_CATEGORY: return DAD_CATEGORY;
|
||||
case AT_ROOT_CATEGORY: return DAD_ROOT_CATEGORY;
|
||||
case AT_LSL_TEXT: return DAD_SCRIPT;
|
||||
case AT_BODYPART: return DAD_BODYPART;
|
||||
case AT_ANIMATION: return DAD_ANIMATION;
|
||||
case AT_GESTURE: return DAD_GESTURE;
|
||||
case AT_FAVORITE: return DAD_CATEGORY;
|
||||
case AT_LINK: return DAD_LINK;
|
||||
case AT_LINK_FOLDER: return DAD_LINK;
|
||||
case AT_CURRENT_OUTFIT: return DAD_LINK;
|
||||
case AT_OUTFIT: return DAD_LINK;
|
||||
case AT_MY_OUTFITS: return DAD_CATEGORY;
|
||||
default: return DAD_NONE;
|
||||
};
|
||||
}
|
||||
|
||||
// static. Generate a good default description
|
||||
void LLAssetType::generateDescriptionFor(LLAssetType::EType type,
|
||||
std::string& desc)
|
||||
{
|
||||
const S32 BUF_SIZE = 30;
|
||||
char time_str[BUF_SIZE]; /* Flawfinder: ignore */
|
||||
time_t now;
|
||||
time(&now);
|
||||
memset(time_str, '\0', BUF_SIZE);
|
||||
strftime(time_str, BUF_SIZE - 1, "%Y-%m-%d %H:%M:%S ", localtime(&now));
|
||||
desc.assign(time_str);
|
||||
desc.append(LLAssetType::lookupHumanReadable(type));
|
||||
}
|
||||
//NOTE: LLAssetType::lookupDragAndDropType & LLAssetType::generateDescriptionFor moved to newview/llviewerassettype.h
|
||||
|
||||
// static
|
||||
bool LLAssetType::lookupCanLink(EType asset_type)
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
// A root category is a user's root inventory category. We
|
||||
// decided to expose it visually, so it seems logical to fold
|
||||
// it into the asset types.
|
||||
AT_ROOT_CATEGORY = 9,
|
||||
//AT_ROOT_CATEGORY = 9,
|
||||
|
||||
// The LSL is the brand spanking new scripting language. We've
|
||||
// split it into a text and bytecode representation.
|
||||
@@ -101,15 +101,15 @@ public:
|
||||
// This asset type is meant to only be used as a marker for a
|
||||
// category preferred type. Using this, we can throw things in
|
||||
// the trash before completely deleting.
|
||||
AT_TRASH = 14,
|
||||
//AT_TRASH = 14,
|
||||
|
||||
// This is a marker for a folder meant for snapshots. No
|
||||
// actual assets will be snapshots, though if there were, you
|
||||
// could interpret them as textures.
|
||||
AT_SNAPSHOT_CATEGORY = 15,
|
||||
//AT_SNAPSHOT_CATEGORY = 15,
|
||||
|
||||
// This is used to stuff lost&found items into
|
||||
AT_LOST_AND_FOUND = 16,
|
||||
//AT_LOST_AND_FOUND = 16,
|
||||
|
||||
// uncompressed sound
|
||||
AT_SOUND_WAV = 17,
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
// simstate file
|
||||
AT_SIMSTATE = 22,
|
||||
|
||||
AT_FAVORITE = 23,
|
||||
//AT_FAVORITE = 23,
|
||||
|
||||
// Inventory symbolic link
|
||||
AT_LINK = 24,
|
||||
@@ -139,11 +139,11 @@ public:
|
||||
// Inventory folder link
|
||||
AT_LINK_FOLDER = 25,
|
||||
|
||||
AT_CURRENT_OUTFIT = 46,
|
||||
//AT_CURRENT_OUTFIT = 46,
|
||||
|
||||
AT_OUTFIT = 47,
|
||||
//AT_OUTFIT = 47,
|
||||
|
||||
AT_MY_OUTFITS = 48,
|
||||
//AT_MY_OUTFITS = 48,
|
||||
|
||||
// +*********************************************+
|
||||
// | TO ADD AN ELEMENT TO THIS ENUM: |
|
||||
@@ -154,8 +154,9 @@ public:
|
||||
// | 4. ADD TO LLAssetType::mAssetTypeHumanNames |
|
||||
// +*********************************************+
|
||||
|
||||
AT_COUNT = 49,
|
||||
//AT_COUNT = 49,
|
||||
|
||||
AT_COUNT = 26,
|
||||
AT_NONE = -1
|
||||
};
|
||||
|
||||
@@ -169,12 +170,7 @@ public:
|
||||
static EType lookupHumanReadable(const std::string& readable_name);
|
||||
static const char* lookupHumanReadable(EType asset_type);
|
||||
|
||||
static EDragAndDropType lookupDragAndDropType( EType );
|
||||
|
||||
// Generate a good default description. You may want to add a verb
|
||||
// or agent name after this depending on your application.
|
||||
static void generateDescriptionFor(LLAssetType::EType type,
|
||||
std::string& desc);
|
||||
//NOTE: LLAssetType::lookupDragAndDropType & LLAssetType::generateDescriptionFor moved to newview/llviewerassettype.h
|
||||
|
||||
static EType getType(const std::string& desc_name);
|
||||
static const std::string& getDesc(EType asset_type);
|
||||
|
||||
169
indra/llcommon/llfoldertype.cpp
Normal file
169
indra/llcommon/llfoldertype.cpp
Normal file
@@ -0,0 +1,169 @@
|
||||
/**
|
||||
* @file llfoldertype.cpp
|
||||
* @brief Implementatino of LLFolderType functionality.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2010, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llfoldertype.h"
|
||||
#include "lldictionary.h"
|
||||
#include "llmemory.h"
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// Class LLFolderType
|
||||
///----------------------------------------------------------------------------
|
||||
struct FolderEntry : public LLDictionaryEntry
|
||||
{
|
||||
FolderEntry(const std::string &type_name, // 8 character limit!
|
||||
bool is_protected) // can the viewer change categories of this type?
|
||||
:
|
||||
LLDictionaryEntry(type_name),
|
||||
mIsProtected(is_protected)
|
||||
{
|
||||
llassert(type_name.length() <= 8);
|
||||
}
|
||||
|
||||
const bool mIsProtected;
|
||||
};
|
||||
|
||||
class LLFolderDictionary : public LLSingleton<LLFolderDictionary>,
|
||||
public LLDictionary<LLFolderType::EType, FolderEntry>
|
||||
{
|
||||
public:
|
||||
LLFolderDictionary();
|
||||
protected:
|
||||
virtual LLFolderType::EType notFound() const
|
||||
{
|
||||
return LLFolderType::FT_NONE;
|
||||
}
|
||||
};
|
||||
|
||||
LLFolderDictionary::LLFolderDictionary()
|
||||
{
|
||||
// TYPE NAME PROTECTED
|
||||
// |-----------|---------|
|
||||
addEntry(LLFolderType::FT_TEXTURE, new FolderEntry("texture", TRUE));
|
||||
addEntry(LLFolderType::FT_SOUND, new FolderEntry("sound", TRUE));
|
||||
addEntry(LLFolderType::FT_CALLINGCARD, new FolderEntry("callcard", TRUE));
|
||||
addEntry(LLFolderType::FT_LANDMARK, new FolderEntry("landmark", TRUE));
|
||||
addEntry(LLFolderType::FT_CLOTHING, new FolderEntry("clothing", TRUE));
|
||||
addEntry(LLFolderType::FT_OBJECT, new FolderEntry("object", TRUE));
|
||||
addEntry(LLFolderType::FT_NOTECARD, new FolderEntry("notecard", TRUE));
|
||||
addEntry(LLFolderType::FT_ROOT_INVENTORY, new FolderEntry("root_inv", TRUE));
|
||||
addEntry(LLFolderType::FT_LSL_TEXT, new FolderEntry("lsltext", TRUE));
|
||||
addEntry(LLFolderType::FT_BODYPART, new FolderEntry("bodypart", TRUE));
|
||||
addEntry(LLFolderType::FT_TRASH, new FolderEntry("trash", TRUE));
|
||||
addEntry(LLFolderType::FT_SNAPSHOT_CATEGORY, new FolderEntry("snapshot", TRUE));
|
||||
addEntry(LLFolderType::FT_LOST_AND_FOUND, new FolderEntry("lstndfnd", TRUE));
|
||||
addEntry(LLFolderType::FT_ANIMATION, new FolderEntry("animatn", TRUE));
|
||||
addEntry(LLFolderType::FT_GESTURE, new FolderEntry("gesture", TRUE));
|
||||
addEntry(LLFolderType::FT_FAVORITE, new FolderEntry("favorite", TRUE));
|
||||
|
||||
for (S32 ensemble_num = S32(LLFolderType::FT_ENSEMBLE_START); ensemble_num <= S32(LLFolderType::FT_ENSEMBLE_END); ensemble_num++)
|
||||
{
|
||||
addEntry(LLFolderType::EType(ensemble_num), new FolderEntry("ensemble", FALSE));
|
||||
}
|
||||
|
||||
addEntry(LLFolderType::FT_CURRENT_OUTFIT, new FolderEntry("current", TRUE));
|
||||
addEntry(LLFolderType::FT_OUTFIT, new FolderEntry("outfit", FALSE));
|
||||
addEntry(LLFolderType::FT_MY_OUTFITS, new FolderEntry("my_otfts", TRUE));
|
||||
addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", TRUE));
|
||||
|
||||
addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE));
|
||||
};
|
||||
|
||||
// static
|
||||
LLFolderType::EType LLFolderType::lookup(const std::string& name)
|
||||
{
|
||||
return LLFolderDictionary::getInstance()->lookup(name);
|
||||
}
|
||||
|
||||
// static
|
||||
const std::string &LLFolderType::lookup(LLFolderType::EType folder_type)
|
||||
{
|
||||
const FolderEntry *entry = LLFolderDictionary::getInstance()->lookup(folder_type);
|
||||
if (entry)
|
||||
{
|
||||
return entry->mName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return badLookup();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
// Only ensembles and plain folders aren't protected. "Protected" means
|
||||
// you can't change certain properties such as their type.
|
||||
bool LLFolderType::lookupIsProtectedType(EType folder_type)
|
||||
{
|
||||
const LLFolderDictionary *dict = LLFolderDictionary::getInstance();
|
||||
const FolderEntry *entry = dict->lookup(folder_type);
|
||||
if (entry)
|
||||
{
|
||||
return entry->mIsProtected;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLFolderType::lookupIsEnsembleType(EType folder_type)
|
||||
{
|
||||
return (folder_type >= FT_ENSEMBLE_START &&
|
||||
folder_type <= FT_ENSEMBLE_END);
|
||||
}
|
||||
|
||||
// static
|
||||
LLAssetType::EType LLFolderType::folderTypeToAssetType(LLFolderType::EType folder_type)
|
||||
{
|
||||
if (LLAssetType::lookup(LLAssetType::EType(folder_type)) == LLAssetType::badLookup())
|
||||
{
|
||||
llwarns << "Converting to unknown asset type " << folder_type << llendl;
|
||||
}
|
||||
return (LLAssetType::EType)folder_type;
|
||||
}
|
||||
|
||||
// static
|
||||
LLFolderType::EType LLFolderType::assetTypeToFolderType(LLAssetType::EType asset_type)
|
||||
{
|
||||
if (LLFolderType::lookup(LLFolderType::EType(asset_type)) == LLFolderType::badLookup())
|
||||
{
|
||||
llwarns << "Converting to unknown folder type " << asset_type << llendl;
|
||||
}
|
||||
return (LLFolderType::EType)asset_type;
|
||||
}
|
||||
|
||||
// static
|
||||
const std::string &LLFolderType::badLookup()
|
||||
{
|
||||
static const std::string sBadLookup = "llfoldertype_bad_lookup";
|
||||
return sBadLookup;
|
||||
}
|
||||
113
indra/llcommon/llfoldertype.h
Normal file
113
indra/llcommon/llfoldertype.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* @file llfoldertype.h
|
||||
* @brief Declaration of LLFolderType.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2010, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFOLDERTYPE_H
|
||||
#define LL_LLFOLDERTYPE_H
|
||||
|
||||
#include <string>
|
||||
#include "llassettype.h"
|
||||
|
||||
// This class handles folder types (similar to assettype, except for folders)
|
||||
// and operations on those.
|
||||
class LL_COMMON_API LLFolderType
|
||||
{
|
||||
public:
|
||||
// ! BACKWARDS COMPATIBILITY ! Folder type enums must match asset type enums.
|
||||
enum EType
|
||||
{
|
||||
FT_TEXTURE = 0,
|
||||
|
||||
FT_SOUND = 1,
|
||||
|
||||
FT_CALLINGCARD = 2,
|
||||
|
||||
FT_LANDMARK = 3,
|
||||
|
||||
FT_CLOTHING = 5,
|
||||
|
||||
FT_OBJECT = 6,
|
||||
|
||||
FT_NOTECARD = 7,
|
||||
|
||||
FT_ROOT_INVENTORY = 8,
|
||||
// We'd really like to change this to 9 since AT_CATEGORY is 8,
|
||||
// but "My Inventory" has been type 8 for a long time.
|
||||
|
||||
FT_LSL_TEXT = 10,
|
||||
|
||||
FT_BODYPART = 13,
|
||||
|
||||
FT_TRASH = 14,
|
||||
|
||||
FT_SNAPSHOT_CATEGORY = 15,
|
||||
|
||||
FT_LOST_AND_FOUND = 16,
|
||||
|
||||
FT_ANIMATION = 20,
|
||||
|
||||
FT_GESTURE = 21,
|
||||
|
||||
FT_FAVORITE = 23,
|
||||
|
||||
FT_ENSEMBLE_START = 26,
|
||||
FT_ENSEMBLE_END = 45,
|
||||
// This range is reserved for special clothing folder types.
|
||||
|
||||
FT_CURRENT_OUTFIT = 46,
|
||||
FT_OUTFIT = 47,
|
||||
FT_MY_OUTFITS = 48,
|
||||
|
||||
FT_INBOX = 49,
|
||||
|
||||
FT_COUNT = 50,
|
||||
|
||||
FT_NONE = -1
|
||||
};
|
||||
|
||||
static EType lookup(const std::string& type_name);
|
||||
static const std::string& lookup(EType folder_type);
|
||||
|
||||
static bool lookupIsProtectedType(EType folder_type);
|
||||
static bool lookupIsEnsembleType(EType folder_type);
|
||||
|
||||
static LLAssetType::EType folderTypeToAssetType(LLFolderType::EType folder_type);
|
||||
static LLFolderType::EType assetTypeToFolderType(LLAssetType::EType asset_type);
|
||||
|
||||
static const std::string& badLookup(); // error string when a lookup fails
|
||||
|
||||
protected:
|
||||
LLFolderType() {}
|
||||
~LLFolderType() {}
|
||||
};
|
||||
|
||||
#endif // LL_LLFOLDERTYPE_H
|
||||
@@ -31,10 +31,10 @@
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
|
||||
#include "llinventory.h"
|
||||
|
||||
#include "lldbstrings.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llxorcipher.h"
|
||||
#include "llsd.h"
|
||||
#include "message.h"
|
||||
@@ -1120,7 +1120,7 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd)
|
||||
{
|
||||
if (sd[w].isString())
|
||||
{
|
||||
mType = LLAssetType::lookup(sd[w].asString().c_str());
|
||||
mType = LLAssetType::lookup(sd[w].asString());
|
||||
}
|
||||
else if (sd[w].isInteger())
|
||||
{
|
||||
@@ -1425,26 +1425,13 @@ void LLInventoryItem::unpackBinaryBucket(U8* bin_bucket, S32 bin_bucket_size)
|
||||
setCreationDate(now);
|
||||
}
|
||||
|
||||
// returns TRUE if a should appear before b
|
||||
BOOL item_dictionary_sort( LLInventoryItem* a, LLInventoryItem* b )
|
||||
{
|
||||
return (LLStringUtil::compareDict( a->getName().c_str(), b->getName().c_str() ) < 0);
|
||||
}
|
||||
|
||||
// returns TRUE if a should appear before b
|
||||
BOOL item_date_sort( LLInventoryItem* a, LLInventoryItem* b )
|
||||
{
|
||||
return a->getCreationDate() < b->getCreationDate();
|
||||
}
|
||||
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// Class LLInventoryCategory
|
||||
///----------------------------------------------------------------------------
|
||||
|
||||
LLInventoryCategory::LLInventoryCategory(const LLUUID& uuid,
|
||||
const LLUUID& parent_uuid,
|
||||
LLAssetType::EType preferred_type,
|
||||
LLFolderType::EType preferred_type,
|
||||
const std::string& name) :
|
||||
LLInventoryObject(uuid, parent_uuid, LLAssetType::AT_CATEGORY, name),
|
||||
mPreferredType(preferred_type)
|
||||
@@ -1452,7 +1439,7 @@ LLInventoryCategory::LLInventoryCategory(const LLUUID& uuid,
|
||||
}
|
||||
|
||||
LLInventoryCategory::LLInventoryCategory() :
|
||||
mPreferredType(LLAssetType::AT_NONE)
|
||||
mPreferredType(LLFolderType::FT_NONE)
|
||||
{
|
||||
mType = LLAssetType::AT_CATEGORY;
|
||||
}
|
||||
@@ -1474,12 +1461,12 @@ void LLInventoryCategory::copyCategory(const LLInventoryCategory* other)
|
||||
mPreferredType = other->mPreferredType;
|
||||
}
|
||||
|
||||
LLAssetType::EType LLInventoryCategory::getPreferredType() const
|
||||
LLFolderType::EType LLInventoryCategory::getPreferredType() const
|
||||
{
|
||||
return mPreferredType;
|
||||
}
|
||||
|
||||
void LLInventoryCategory::setPreferredType(LLAssetType::EType type)
|
||||
void LLInventoryCategory::setPreferredType(LLFolderType::EType type)
|
||||
{
|
||||
mPreferredType = type;
|
||||
}
|
||||
@@ -1525,13 +1512,13 @@ bool LLInventoryCategory::fromLLSD(const LLSD& sd)
|
||||
if (sd.has(w))
|
||||
{
|
||||
S8 type = (U8)sd[w].asInteger();
|
||||
mPreferredType = static_cast<LLAssetType::EType>(type);
|
||||
mPreferredType = static_cast<LLFolderType::EType>(type);
|
||||
}
|
||||
w = INV_ASSET_TYPE_LABEL_WS;
|
||||
if (sd.has(w))
|
||||
{
|
||||
S8 type = (U8)sd[w].asInteger();
|
||||
mPreferredType = static_cast<LLAssetType::EType>(type);
|
||||
mPreferredType = static_cast<LLFolderType::EType>(type);
|
||||
}
|
||||
|
||||
w = INV_NAME_LABEL;
|
||||
@@ -1553,7 +1540,7 @@ void LLInventoryCategory::unpackMessage(LLMessageSystem* msg,
|
||||
msg->getUUIDFast(block, _PREHASH_ParentID, mParentUUID, block_num);
|
||||
S8 type;
|
||||
msg->getS8Fast(block, _PREHASH_Type, type, block_num);
|
||||
mPreferredType = static_cast<LLAssetType::EType>(type);
|
||||
mPreferredType = static_cast<LLFolderType::EType>(type);
|
||||
msg->getStringFast(block, _PREHASH_Name, mName, block_num);
|
||||
LLStringUtil::replaceNonstandardASCII(mName, ' ');
|
||||
}
|
||||
@@ -1602,7 +1589,7 @@ BOOL LLInventoryCategory::importFile(LLFILE* fp)
|
||||
}
|
||||
else if(0 == strcmp("pref_type", keyword))
|
||||
{
|
||||
mPreferredType = LLAssetType::lookup(valuestr);
|
||||
mPreferredType = LLFolderType::lookup(valuestr);
|
||||
}
|
||||
else if(0 == strcmp("name", keyword))
|
||||
{
|
||||
@@ -1634,7 +1621,7 @@ BOOL LLInventoryCategory::exportFile(LLFILE* fp, BOOL) const
|
||||
mParentUUID.toString(uuid_str);
|
||||
fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str());
|
||||
fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
|
||||
fprintf(fp, "\t\tpref_type\t%s\n", LLAssetType::lookup(mPreferredType));
|
||||
fprintf(fp, "\t\tpref_type\t%s\n", LLFolderType::lookup(mPreferredType).c_str());
|
||||
fprintf(fp, "\t\tname\t%s|\n", mName.c_str());
|
||||
fprintf(fp,"\t}\n");
|
||||
return TRUE;
|
||||
@@ -1681,7 +1668,7 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)
|
||||
}
|
||||
else if(0 == strcmp("pref_type", keyword))
|
||||
{
|
||||
mPreferredType = LLAssetType::lookup(valuestr);
|
||||
mPreferredType = LLFolderType::lookup(valuestr);
|
||||
}
|
||||
else if(0 == strcmp("name", keyword))
|
||||
{
|
||||
@@ -1713,7 +1700,7 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL)
|
||||
mParentUUID.toString(uuid_str);
|
||||
output_stream << "\t\tparent_id\t" << uuid_str << "\n";
|
||||
output_stream << "\t\ttype\t" << LLAssetType::lookup(mType) << "\n";
|
||||
output_stream << "\t\tpref_type\t" << LLAssetType::lookup(mPreferredType) << "\n";
|
||||
output_stream << "\t\tpref_type\t" << LLFolderType::lookup(mPreferredType) << "\n";
|
||||
output_stream << "\t\tname\t" << mName.c_str() << "|\n";
|
||||
output_stream << "\t}\n";
|
||||
return TRUE;
|
||||
@@ -1793,10 +1780,10 @@ LLSD ll_create_sd_from_inventory_category(LLPointer<LLInventoryCategory> cat)
|
||||
rv[INV_PARENT_ID_LABEL] = cat->getParentUUID();
|
||||
rv[INV_NAME_LABEL] = cat->getName();
|
||||
rv[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(cat->getType());
|
||||
if(LLAssetType::AT_NONE != cat->getPreferredType())
|
||||
if(LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
|
||||
{
|
||||
rv[INV_PREFERRED_TYPE_LABEL] =
|
||||
LLAssetType::lookup(cat->getPreferredType());
|
||||
LLFolderType::lookup(cat->getPreferredType()).c_str();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
@@ -1810,7 +1797,7 @@ LLPointer<LLInventoryCategory> ll_create_category_from_sd(const LLSD& sd_cat)
|
||||
rv->setType(
|
||||
LLAssetType::lookup(sd_cat[INV_ASSET_TYPE_LABEL].asString()));
|
||||
rv->setPreferredType(
|
||||
LLAssetType::lookup(
|
||||
LLFolderType::lookup(
|
||||
sd_cat[INV_PREFERRED_TYPE_LABEL].asString()));
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -33,12 +33,13 @@
|
||||
#ifndef LL_LLINVENTORY_H
|
||||
#define LL_LLINVENTORY_H
|
||||
|
||||
#include "llassetstorage.h"
|
||||
#include "lldarray.h"
|
||||
#include "llfoldertype.h"
|
||||
#include "llinventorytype.h"
|
||||
#include "llinventorydefines.h"
|
||||
#include "llmemtype.h"
|
||||
#include "llpermissions.h"
|
||||
#include "llmemory.h"
|
||||
#include "llsaleinfo.h"
|
||||
#include "llsd.h"
|
||||
#include "lluuid.h"
|
||||
@@ -242,10 +243,6 @@ protected:
|
||||
time_t mCreationDate; // seconds from 1/1/1970, UTC
|
||||
};
|
||||
|
||||
BOOL item_dictionary_sort(LLInventoryItem* a,LLInventoryItem* b);
|
||||
BOOL item_date_sort(LLInventoryItem* a, LLInventoryItem* b);
|
||||
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Class LLInventoryCategory
|
||||
//
|
||||
@@ -265,7 +262,7 @@ public:
|
||||
public:
|
||||
MEM_TYPE_NEW(LLMemType::MTYPE_INVENTORY);
|
||||
LLInventoryCategory(const LLUUID& uuid, const LLUUID& parent_uuid,
|
||||
LLAssetType::EType preferred_type,
|
||||
LLFolderType::EType preferred_type,
|
||||
const std::string& name);
|
||||
LLInventoryCategory();
|
||||
LLInventoryCategory(const LLInventoryCategory* other);
|
||||
@@ -277,8 +274,8 @@ protected:
|
||||
// Accessors And Mutators
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
LLAssetType::EType getPreferredType() const;
|
||||
void setPreferredType(LLAssetType::EType type);
|
||||
LLFolderType::EType getPreferredType() const;
|
||||
void setPreferredType(LLFolderType::EType type);
|
||||
LLSD asLLSD() const;
|
||||
bool fromLLSD(const LLSD& sd);
|
||||
|
||||
@@ -302,7 +299,7 @@ public:
|
||||
// Member Variables
|
||||
//--------------------------------------------------------------------
|
||||
protected:
|
||||
LLAssetType::EType mPreferredType; // Type that this category was "meant" to hold (although it may hold any type).
|
||||
LLFolderType::EType mPreferredType; // Type that this category was "meant" to hold (although it may hold any type).
|
||||
};
|
||||
|
||||
|
||||
@@ -383,8 +380,6 @@ struct SetNotForSale
|
||||
}
|
||||
};
|
||||
|
||||
typedef std::list<LLPointer<LLInventoryObject> > InventoryObjectList;
|
||||
|
||||
// These functions convert between structured data and an inventroy
|
||||
// item, appropriate for serialization.
|
||||
LLSD ll_create_sd_from_inventory_item(LLPointer<LLInventoryItem> item);
|
||||
|
||||
@@ -122,7 +122,7 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
|
||||
LLInventoryType::IT_NONE, // AT_FAVORITE
|
||||
LLInventoryType::IT_NONE, // AT_LINK
|
||||
LLInventoryType::IT_NONE, // AT_LINK_FOLDER
|
||||
LLInventoryType::IT_NONE, // FT_ENSEMBLE_START
|
||||
/*LLInventoryType::IT_NONE, // FT_ENSEMBLE_START
|
||||
LLInventoryType::IT_NONE, //
|
||||
LLInventoryType::IT_NONE, //
|
||||
LLInventoryType::IT_NONE, //
|
||||
@@ -144,7 +144,7 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
|
||||
LLInventoryType::IT_NONE, // FT_ENSEMBLE_END
|
||||
LLInventoryType::IT_NONE, // AT_CURRENT_OUTFIT
|
||||
LLInventoryType::IT_NONE, // AT_OUTFIT
|
||||
LLInventoryType::IT_NONE // AT_MY_OUTFITS
|
||||
LLInventoryType::IT_NONE // AT_MY_OUTFITS*/
|
||||
};
|
||||
|
||||
// static
|
||||
|
||||
@@ -425,6 +425,7 @@ set(viewer_SOURCE_FILES
|
||||
llvelocitybar.cpp
|
||||
llviewchildren.cpp
|
||||
llviewerassetstorage.cpp
|
||||
llviewerassettype.cpp
|
||||
llvieweraudio.cpp
|
||||
llviewercamera.cpp
|
||||
llviewercontrol.cpp
|
||||
@@ -906,6 +907,7 @@ set(viewer_HEADER_FILES
|
||||
llvelocitybar.h
|
||||
llviewchildren.h
|
||||
llviewerassetstorage.h
|
||||
llviewerassettype.h
|
||||
llvieweraudio.h
|
||||
llviewerbuild.h
|
||||
llviewercamera.h
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
void LLCOFMgr::checkCOF()
|
||||
{
|
||||
const LLUUID idCOF = getCOF();
|
||||
const LLUUID idLAF = gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
|
||||
const LLUUID idLAF = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
|
||||
// Check COF for non-links and move them to Lost&Found
|
||||
LLInventoryModel::cat_array_t* pFolders; LLInventoryModel::item_array_t* pItems;
|
||||
@@ -486,7 +486,7 @@ void LLCOFMgr::addBOFLink(const LLUUID &idFolder, LLPointer<LLInventoryCallback>
|
||||
purgeBOFLink();
|
||||
|
||||
const LLViewerInventoryCategory* pFolder = gInventory.getCategory(idFolder);
|
||||
if ( (pFolder) && (LLAssetType::AT_OUTFIT == pFolder->getPreferredType()) )
|
||||
if ( (pFolder) && (LLFolderType::FT_OUTFIT == pFolder->getPreferredType()) )
|
||||
link_inventory_item(gAgent.getID(), idFolder, getCOF(), pFolder->getName(), "", LLAssetType::AT_LINK_FOLDER, cb);
|
||||
}
|
||||
|
||||
@@ -501,7 +501,7 @@ void LLCOFMgr::purgeBOFLink()
|
||||
continue;
|
||||
|
||||
const LLViewerInventoryCategory* pLinkFolder = pItem->getLinkedCategory();
|
||||
if ( (pLinkFolder) && (LLAssetType::AT_OUTFIT == pLinkFolder->getPreferredType()) )
|
||||
if ( (pLinkFolder) && (LLFolderType::FT_OUTFIT == pLinkFolder->getPreferredType()) )
|
||||
gInventory.purgeObject(pItem->getUUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ class LLCOFMgr : public LLSingleton<LLCOFMgr>
|
||||
public:
|
||||
void checkCOF();
|
||||
void fetchCOF();
|
||||
static const LLUUID getCOF() { return gInventory.findCategoryUUIDForType(LLAssetType::AT_CURRENT_OUTFIT); }
|
||||
static const LLUUID getCOF() { return gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); }
|
||||
static void getDescendentsOfAssetType(const LLUUID& idCat, LLInventoryModel::item_array_t& items,
|
||||
LLAssetType::EType typeAsset, bool fFollowFolderLinks);
|
||||
bool isLinkInCOF(const LLUUID& idItem);
|
||||
|
||||
@@ -307,7 +307,7 @@ void DOFloaterHex::onClickUpload(void* user_data)
|
||||
item->getName(),
|
||||
item->getDescription(),
|
||||
0,
|
||||
item->getType(),
|
||||
LLFolderType::assetTypeToFolderType(item->getType()),
|
||||
item->getInventoryType(),
|
||||
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
|
||||
item->getName(),
|
||||
|
||||
@@ -270,7 +270,7 @@ void HGFloaterTextEditor::onClickUpload(void* user_data)
|
||||
item->getName(),
|
||||
item->getDescription(),
|
||||
0,
|
||||
item->getType(),
|
||||
LLFolderType::assetTypeToFolderType(item->getType()),
|
||||
item->getInventoryType(),
|
||||
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
|
||||
item->getName(),
|
||||
|
||||
@@ -376,10 +376,10 @@ public:
|
||||
{
|
||||
LLPointer<LLInventoryCallback> cb = new JCImportTransferCallback(data);
|
||||
LLPermissions perm;
|
||||
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
|
||||
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
|
||||
gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH), data->tid, data->name,
|
||||
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
|
||||
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
|
||||
LLFloaterPerms::getNextOwnerPerms(),
|
||||
cb);
|
||||
@@ -517,10 +517,10 @@ void JCImportInventorycallback(const LLUUID& uuid, void* user_data, S32 result,
|
||||
|
||||
LLPointer<LLInventoryCallback> cb = new JCImportTransferCallback(data);
|
||||
LLPermissions perm;
|
||||
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
|
||||
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
|
||||
gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH), data->tid, data->name,
|
||||
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
|
||||
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
|
||||
LLFloaterPerms::getNextOwnerPerms(),
|
||||
cb);
|
||||
@@ -605,7 +605,7 @@ void ImportTracker::send_inventory(LLSD& prim)
|
||||
file.write(copy_buf, file_size);
|
||||
}
|
||||
LLSD body;
|
||||
body["folder_id"] = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
body["folder_id"] = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
body["asset_type"] = LLAssetType::lookup(data->type);
|
||||
body["inventory_type"] = LLInventoryType::lookup(data->inv_type);
|
||||
body["name"] = data->name;
|
||||
@@ -666,9 +666,9 @@ void ImportTracker::send_inventory(LLSD& prim)
|
||||
//std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory");
|
||||
LLPointer<LLInventoryCallback> cb = new JCPostInvCallback(data);
|
||||
LLPermissions perm;
|
||||
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
|
||||
gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH), data->tid, data->name,
|
||||
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
|
||||
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
|
||||
LLFloaterPerms::getNextOwnerPerms(),
|
||||
cb);
|
||||
@@ -678,9 +678,9 @@ void ImportTracker::send_inventory(LLSD& prim)
|
||||
{
|
||||
LLPointer<LLInventoryCallback> cb = new JCPostInvCallback(data);
|
||||
LLPermissions perm;
|
||||
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID parent_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
|
||||
gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH), data->tid, data->name,
|
||||
gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH), data->tid, data->name,
|
||||
data->description, data->type, LLInventoryType::defaultForAssetType(data->type), data->wear_type,
|
||||
LLFloaterPerms::getNextOwnerPerms(),
|
||||
cb);
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "llfolderview.h"
|
||||
#include "llgesturemgr.h"
|
||||
#include "llinventorybridge.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llmd5.h"
|
||||
#include "llnotifications.h"
|
||||
#include "lltexlayer.h"
|
||||
@@ -333,7 +334,7 @@ void LLAgentWearables::saveWearableAs(
|
||||
if (save_in_lost_and_found)
|
||||
{
|
||||
category_id = gInventory.findCategoryUUIDForType(
|
||||
LLAssetType::AT_LOST_AND_FOUND);
|
||||
LLFolderType::FT_LOST_AND_FOUND);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -735,7 +736,7 @@ void LLAgentWearables::recoverMissingWearable( EWearableType type )
|
||||
// (We used to overwrite the "not found" one, but that could potentially
|
||||
// destory content.) JC
|
||||
LLUUID lost_and_found_id =
|
||||
gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
|
||||
gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
LLPointer<LLInventoryCallback> cb =
|
||||
new addWearableToAgentInventoryCallback(
|
||||
LLPointer<LLRefCount>(NULL),
|
||||
@@ -862,8 +863,8 @@ void LLAgentWearables::makeNewOutfit(
|
||||
BOOL fUseOutfits = gSavedSettings.getBOOL("UseOutfitFolders") &&
|
||||
gHippoGridManager->getConnectedGrid()->supportsInvLinks();
|
||||
|
||||
LLAssetType::EType typeDest = (fUseOutfits) ? LLAssetType::AT_MY_OUTFITS : LLAssetType::AT_CLOTHING;
|
||||
LLAssetType::EType typeFolder = (fUseOutfits) ? LLAssetType::AT_OUTFIT : LLAssetType::AT_NONE;
|
||||
LLFolderType::EType typeDest = (fUseOutfits) ? LLFolderType::FT_MY_OUTFITS : LLFolderType::FT_CLOTHING;
|
||||
LLFolderType::EType typeFolder = (fUseOutfits) ? LLFolderType::FT_OUTFIT : LLFolderType::FT_NONE;
|
||||
|
||||
// First, make a folder for the outfit.
|
||||
LLUUID folder_id = gInventory.createNewCategory(gInventory.findCategoryUUIDForType(typeDest), typeFolder, new_folder_name);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "llassetconverter.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llvorbisencode.h"
|
||||
#include "llwearable.h"
|
||||
#include "llbvhloader.h"
|
||||
// static
|
||||
extern std::string STATUS[];
|
||||
@@ -144,9 +145,12 @@ LLAssetType::EType LLAssetConverter::convert(std::string src_filename, std::stri
|
||||
return LLAssetType::AT_NONE;
|
||||
}
|
||||
}
|
||||
else if(exten == "eyes" || exten == "gloves" || exten == "hair" || exten == "jacket" || exten == "pants" || exten == "shape" || exten == "shirt" || exten == "shoes" || exten == "skin" || exten == "skirt" || exten == "socks" || exten == "underpants" || exten == "undershirt" || exten == "bodypart" || exten == "clothing" || exten == "physics")
|
||||
else
|
||||
{
|
||||
asset_type = LLAssetType::AT_CLOTHING;
|
||||
EWearableType wear_type = LLWearable::typeNameToType(exten);
|
||||
if(wear_type != WT_NONE)
|
||||
{
|
||||
asset_type = LLWearable::typeToAssetType(wear_type);
|
||||
if(!copyFile(src_filename, filename))
|
||||
{
|
||||
return LLAssetType::AT_NONE;
|
||||
@@ -157,6 +161,7 @@ LLAssetType::EType LLAssetConverter::convert(std::string src_filename, std::stri
|
||||
llwarns << "Unhandled extension" << llendl;
|
||||
return LLAssetType::AT_NONE;
|
||||
}
|
||||
}
|
||||
return asset_type;
|
||||
}
|
||||
BOOL LLAssetConverter::copyFile(std::string src_filename, std::string dst_filename)
|
||||
|
||||
@@ -334,7 +334,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
|
||||
LLAssetStorage::LLStoreAssetCallback callback = NULL;
|
||||
void *userdata = NULL;
|
||||
upload_new_resource(next_file, asset_name, asset_name,
|
||||
0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
|
||||
0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
|
||||
next_owner_perms, group_perms,
|
||||
everyone_perms, display_name,
|
||||
callback, expected_upload_cost, userdata);
|
||||
|
||||
@@ -1435,7 +1435,7 @@ void LLFloaterAnimPreview::onBtnOK(void* userdata)
|
||||
name,
|
||||
desc,
|
||||
0,
|
||||
LLAssetType::AT_NONE,
|
||||
LLFolderType::FT_ANIMATION,
|
||||
LLInventoryType::IT_ANIMATION,
|
||||
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
|
||||
name,
|
||||
|
||||
@@ -234,10 +234,6 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj,
|
||||
if (obj->getType() == LLAssetType::AT_CATEGORY)
|
||||
continue;
|
||||
|
||||
// Skip root folders, so we know we have inventory items only
|
||||
if (obj->getType() == LLAssetType::AT_ROOT_CATEGORY)
|
||||
continue;
|
||||
|
||||
// Skip the mysterious blank InventoryObject
|
||||
if (obj->getType() == LLAssetType::AT_NONE)
|
||||
continue;
|
||||
@@ -254,7 +250,8 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj,
|
||||
|
||||
// Compute icon for this item
|
||||
BOOL item_is_multi = FALSE;
|
||||
if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED )
|
||||
if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED
|
||||
|| inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
|
||||
{
|
||||
item_is_multi = TRUE;
|
||||
}
|
||||
@@ -305,7 +302,7 @@ void LLFloaterBuy::onClickBuy(void*)
|
||||
|
||||
// Put the items where we put new folders.
|
||||
LLUUID category_id;
|
||||
category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
|
||||
category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
|
||||
|
||||
// *NOTE: doesn't work for multiple object buy, which UI does not
|
||||
// currently support sale info is used for verification only, if
|
||||
|
||||
@@ -190,10 +190,6 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj,
|
||||
if (asset_type == LLAssetType::AT_CATEGORY)
|
||||
continue;
|
||||
|
||||
// Skip root folders, so we know we have inventory items only
|
||||
if (asset_type == LLAssetType::AT_ROOT_CATEGORY)
|
||||
continue;
|
||||
|
||||
LLInventoryItem* inv_item = (LLInventoryItem*)((LLInventoryObject*)(*it));
|
||||
inv_type = inv_item->getInventoryType();
|
||||
|
||||
@@ -290,7 +286,7 @@ void LLFloaterBuyContents::onClickBuy(void*)
|
||||
|
||||
// Put the items where we put new folders.
|
||||
LLUUID category_id;
|
||||
category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CATEGORY);
|
||||
category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_ROOT_INVENTORY);
|
||||
|
||||
// *NOTE: doesn't work for multiple object buy, which UI does not
|
||||
// currently support sale info is used for verification only, if
|
||||
|
||||
@@ -723,7 +723,7 @@ bool LLPanelEditWearable::onSelectAutoWearOption(const LLSD& notification, const
|
||||
|
||||
LLUUID folder_id;
|
||||
// regular UI, items get created in normal folder
|
||||
folder_id = gInventory.findCategoryUUIDForType(asset_type);
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type));
|
||||
|
||||
// Only auto wear the new item if the AutoWearNewClothing checkbox is selected.
|
||||
LLPointer<LLInventoryCallback> cb = option == 0 ?
|
||||
|
||||
@@ -930,7 +930,7 @@ void LLPanelFriends::onClickIM(void* user_data)
|
||||
// static
|
||||
void LLPanelFriends::requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message)
|
||||
{
|
||||
LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
|
||||
LLUUID calling_card_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
|
||||
send_improved_im(target_id,
|
||||
target_name,
|
||||
message,
|
||||
@@ -960,7 +960,7 @@ bool LLPanelFriends::callbackAddFriend(const LLSD& notification, const LLSD& res
|
||||
// Servers older than 1.25 require the text of the message to be the
|
||||
// calling card folder ID for the offering user. JC
|
||||
LLUUID calling_card_folder_id =
|
||||
gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
|
||||
gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
|
||||
std::string message = calling_card_folder_id.asString();
|
||||
requestFriendship(notification["payload"]["id"].asUUID(),
|
||||
notification["payload"]["name"].asString(),
|
||||
|
||||
@@ -300,7 +300,7 @@ void LLFloaterLandmark::onBtnNew(void* userdata)
|
||||
}
|
||||
|
||||
LLUUID folder_id;
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
|
||||
std::string pos_string;
|
||||
gAgent.buildLocationString(pos_string);
|
||||
|
||||
@@ -326,7 +326,7 @@ void LLFloaterLandmark::onBtnDelete(void* userdata)
|
||||
if(item)
|
||||
{
|
||||
// Move the item to the trash
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if (item->getParentUUID() != trash_id)
|
||||
{
|
||||
LLInventoryModel::update_list_t update;
|
||||
|
||||
@@ -206,7 +206,7 @@ void LLFloaterNameDesc::onBtnOK( void* userdata )
|
||||
upload_new_resource(fp->mFilenameAndPath, // file
|
||||
fp->childGetValue("name_form").asString(),
|
||||
fp->childGetValue("description_form").asString(),
|
||||
0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
|
||||
0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
|
||||
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
|
||||
display_name, callback, expected_upload_cost, nruserdata);
|
||||
fp->close(false);
|
||||
|
||||
@@ -149,14 +149,14 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
|
||||
if (wear)
|
||||
{
|
||||
parent_category_id = gInventory.findCategoryUUIDForType(
|
||||
LLAssetType::AT_CLOTHING);
|
||||
LLFolderType::FT_CLOTHING);
|
||||
}
|
||||
else
|
||||
{
|
||||
parent_category_id = gAgent.getInventoryRootID();
|
||||
}
|
||||
LLUUID category_id = gInventory.createNewCategory(parent_category_id,
|
||||
LLAssetType::AT_NONE,
|
||||
LLFolderType::FT_NONE,
|
||||
name);
|
||||
|
||||
LLCatAndWear* data = new LLCatAndWear;
|
||||
|
||||
@@ -937,12 +937,12 @@ void LLFloaterReporter::takeScreenshot()
|
||||
if (BUG_REPORT == mReportType)
|
||||
{
|
||||
mResourceDatap->mAssetInfo.mType = LLAssetType::AT_TEXTURE;
|
||||
mResourceDatap->mPreferredLocation = LLAssetType::EType(-1);
|
||||
mResourceDatap->mPreferredLocation = LLFolderType::EType(-1);
|
||||
}
|
||||
else if (COMPLAINT_REPORT == mReportType)
|
||||
{
|
||||
mResourceDatap->mAssetInfo.mType = LLAssetType::AT_TEXTURE;
|
||||
mResourceDatap->mPreferredLocation = LLAssetType::EType(-2);
|
||||
mResourceDatap->mPreferredLocation = LLFolderType::EType(-2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -986,7 +986,7 @@ void LLSnapshotLivePreview::saveTexture()
|
||||
"Snapshot : " + pos_string,
|
||||
"Taken by " + who_took_it + " at " + pos_string,
|
||||
0,
|
||||
LLAssetType::AT_SNAPSHOT_CATEGORY,
|
||||
LLFolderType::FT_SNAPSHOT_CATEGORY,
|
||||
LLInventoryType::IT_SNAPSHOT,
|
||||
PERM_ALL, // Note: Snapshots to inventory is a special case of content upload
|
||||
LLFloaterPerms::getGroupPerms(), // that is more permissive than other uploads
|
||||
|
||||
@@ -310,7 +310,7 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
|
||||
LLFirstUse::useMap();
|
||||
|
||||
// Start speculative download of landmarks
|
||||
LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
|
||||
LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
|
||||
gInventory.startBackgroundFetch(landmark_folder_id);
|
||||
|
||||
gFloaterWorldMap->childSetFocus("location", TRUE);
|
||||
|
||||
@@ -1796,7 +1796,7 @@ bool LLFolderViewFolder::isTrash() const
|
||||
{
|
||||
if (mAmTrash == LLFolderViewFolder::UNKNOWN)
|
||||
{
|
||||
mAmTrash = mListener->getUUID() == gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH, false) ? LLFolderViewFolder::TRASH : LLFolderViewFolder::NOT_TRASH;
|
||||
mAmTrash = mListener->getUUID() == gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH, false) ? LLFolderViewFolder::TRASH : LLFolderViewFolder::NOT_TRASH;
|
||||
}
|
||||
return mAmTrash == LLFolderViewFolder::TRASH;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ class LLEmptyTrash : public inventory_panel_listener_t
|
||||
if (option == 0) // YES
|
||||
{
|
||||
LLInventoryModel* model = mPtr->getModel();
|
||||
LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
model->purgeDescendentsOf(trash_id);
|
||||
model->notifyObservers();
|
||||
}
|
||||
@@ -323,7 +323,7 @@ class LLEmptyLostAndFound : public inventory_panel_listener_t
|
||||
if (option == 0) // YES
|
||||
{
|
||||
LLInventoryModel* model = mPtr->getModel();
|
||||
LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
|
||||
LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
model->purgeDescendentsOf(lost_and_found_id);
|
||||
model->notifyObservers();
|
||||
}
|
||||
@@ -337,7 +337,7 @@ class LLEmptyTrashFloater : public inventory_listener_t
|
||||
{
|
||||
LLInventoryModel* model = mPtr->getPanel()->getModel();
|
||||
if(!model) return false;
|
||||
LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
model->purgeDescendentsOf(trash_id);
|
||||
model->notifyObservers();
|
||||
return true;
|
||||
@@ -351,19 +351,19 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
|
||||
LLUUID category;
|
||||
if (self)
|
||||
{
|
||||
category = model->createNewCategory(self->getUUID(), LLAssetType::AT_NONE, LLStringUtil::null);
|
||||
category = model->createNewCategory(self->getUUID(), LLFolderType::FT_NONE, LLStringUtil::null);
|
||||
}
|
||||
else
|
||||
{
|
||||
category = model->createNewCategory(gAgent.getInventoryRootID(),
|
||||
LLAssetType::AT_NONE, LLStringUtil::null);
|
||||
LLFolderType::FT_NONE, LLStringUtil::null);
|
||||
}
|
||||
model->notifyObservers();
|
||||
ptr->setSelection(category, TRUE);
|
||||
}
|
||||
else if ("lsl" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLAssetType::AT_LSL_TEXT);
|
||||
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_LSL_TEXT);
|
||||
ptr->createNewItem(NEW_LSL_NAME,
|
||||
parent_id,
|
||||
LLAssetType::AT_LSL_TEXT,
|
||||
@@ -372,7 +372,7 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
|
||||
}
|
||||
else if ("notecard" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLAssetType::AT_NOTECARD);
|
||||
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_NOTECARD);
|
||||
ptr->createNewItem(NEW_NOTECARD_NAME,
|
||||
parent_id,
|
||||
LLAssetType::AT_NOTECARD,
|
||||
@@ -381,92 +381,22 @@ void do_create(LLInventoryModel *model, LLInventoryPanel *ptr, std::string type,
|
||||
}
|
||||
else if ("gesture" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLAssetType::AT_GESTURE);
|
||||
LLUUID parent_id = self ? self->getUUID() : model->findCategoryUUIDForType(LLFolderType::FT_GESTURE);
|
||||
ptr->createNewItem(NEW_GESTURE_NAME,
|
||||
parent_id,
|
||||
LLAssetType::AT_GESTURE,
|
||||
LLInventoryType::IT_GESTURE,
|
||||
PERM_ALL);
|
||||
}
|
||||
else if ("shirt" == type)
|
||||
else
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_SHIRT);
|
||||
EWearableType wear_type = LLWearable::typeNameToType(type);
|
||||
if(wear_type != WT_INVALID)
|
||||
{
|
||||
LLFolderType::EType folder_type = LLFolderType::assetTypeToFolderType(LLWearable::typeToAssetType(LLWearable::typeNameToType(type)));
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(folder_type);
|
||||
LLFolderBridge::createWearable(parent_id, wear_type);
|
||||
}
|
||||
else if ("pants" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_PANTS);
|
||||
}
|
||||
else if ("shoes" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_SHOES);
|
||||
}
|
||||
else if ("socks" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_SOCKS);
|
||||
}
|
||||
else if ("jacket" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_JACKET);
|
||||
}
|
||||
else if ("skirt" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_SKIRT);
|
||||
}
|
||||
else if ("gloves" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_GLOVES);
|
||||
}
|
||||
else if ("undershirt" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_UNDERSHIRT);
|
||||
}
|
||||
else if ("underpants" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_UNDERPANTS);
|
||||
}
|
||||
else if ("alpha" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_ALPHA);
|
||||
}
|
||||
else if ("tattoo" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_TATTOO);
|
||||
}
|
||||
else if ("shape" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART);
|
||||
LLFolderBridge::createWearable(parent_id, WT_SHAPE);
|
||||
}
|
||||
else if ("skin" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART);
|
||||
LLFolderBridge::createWearable(parent_id, WT_SKIN);
|
||||
}
|
||||
else if ("hair" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART);
|
||||
LLFolderBridge::createWearable(parent_id, WT_HAIR);
|
||||
}
|
||||
else if ("eyes" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_BODYPART);
|
||||
LLFolderBridge::createWearable(parent_id, WT_EYES);
|
||||
}
|
||||
else if ("physics" == type)
|
||||
{
|
||||
LLUUID parent_id = self ? self->getUUID() : gInventory.findCategoryUUIDForType(LLAssetType::AT_CLOTHING);
|
||||
LLFolderBridge::createWearable(parent_id, WT_PHYSICS);
|
||||
}
|
||||
ptr->getRootFolder()->setNeedsAutoRename(TRUE);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,13 +33,19 @@
|
||||
#ifndef LL_LLINVENTORYBRIDGE_H
|
||||
#define LL_LLINVENTORYBRIDGE_H
|
||||
|
||||
#include "llcallingcard.h"
|
||||
#include "llfloaterproperties.h"
|
||||
#include "llfolderview.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llwearable.h"
|
||||
//#include "llinventoryview.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "llwearable.h"
|
||||
|
||||
class LLInventoryPanel;
|
||||
class LLInventoryModel;
|
||||
class LLMenuGL;
|
||||
class LLCallingCardObserver;
|
||||
class LLViewerJointAttachment;
|
||||
|
||||
enum EInventoryIcon
|
||||
{
|
||||
@@ -88,6 +94,7 @@ extern std::string ICON_NAME[ICON_NAME_COUNT];
|
||||
typedef std::pair<LLUUID, LLUUID> two_uuids_t;
|
||||
typedef std::list<two_uuids_t> two_uuids_list_t;
|
||||
typedef std::pair<LLUUID, two_uuids_list_t> uuid_move_list_t;
|
||||
typedef std::vector<std::string> menuentry_vec_t;
|
||||
|
||||
struct LLMoveInv
|
||||
{
|
||||
@@ -175,7 +182,7 @@ class LLInventoryPanelObserver : public LLInventoryObserver
|
||||
public:
|
||||
LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {}
|
||||
virtual ~LLInventoryPanelObserver() {}
|
||||
virtual void changed(U32 mask) { mIP->modelChanged(mask); }
|
||||
virtual void changed(U32 mask);
|
||||
protected:
|
||||
LLInventoryPanel* mIP;
|
||||
};
|
||||
@@ -204,21 +211,25 @@ public:
|
||||
U32 flags = 0x00);
|
||||
virtual ~LLInvFVBridge() {}
|
||||
|
||||
virtual const LLUUID& getUUID() const { return mUUID; }
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// LLInvFVBridge functionality
|
||||
//--------------------------------------------------------------------
|
||||
virtual const LLUUID& getUUID() const { return mUUID; }
|
||||
virtual void clearDisplayName() {}
|
||||
virtual const std::string& getPrefix() { return LLStringUtil::null; }
|
||||
virtual void restoreItem() {}
|
||||
virtual void restoreToWorld() {}
|
||||
|
||||
// LLFolderViewEventListener functions
|
||||
//--------------------------------------------------------------------
|
||||
// Inherited LLFolderViewEventListener functions
|
||||
//--------------------------------------------------------------------
|
||||
virtual const std::string& getName() const;
|
||||
virtual const std::string& getDisplayName() const;
|
||||
virtual PermissionMask getPermissionMask() const;
|
||||
virtual LLFolderType::EType getPreferredType() const;
|
||||
virtual time_t getCreationDate() const;
|
||||
virtual LLFontGL::StyleFlags getLabelStyle() const
|
||||
{
|
||||
return LLFontGL::NORMAL;
|
||||
}
|
||||
virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; }
|
||||
virtual std::string getLabelSuffix() const { return LLStringUtil::null; }
|
||||
virtual void openItem() {}
|
||||
virtual void previewItem() {openItem();}
|
||||
@@ -227,6 +238,8 @@ public:
|
||||
//virtual BOOL renameItem(const std::string& new_name) {}
|
||||
virtual BOOL isItemRemovable();
|
||||
virtual BOOL isItemMovable();
|
||||
virtual BOOL isItemInTrash() const;
|
||||
virtual BOOL isLink() const;
|
||||
//virtual BOOL removeItem() = 0;
|
||||
virtual void removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch);
|
||||
virtual void move(LLFolderViewEventListener* new_parent_bridge) {}
|
||||
@@ -237,29 +250,34 @@ public:
|
||||
virtual BOOL isClipboardPasteableAsLink() const;
|
||||
virtual void pasteFromClipboard() {}
|
||||
virtual void pasteLinkFromClipboard() {}
|
||||
void getClipboardEntries(bool show_asset_id, std::vector<std::string> &items,
|
||||
std::vector<std::string> &disabled_items, U32 flags);
|
||||
void getClipboardEntries(bool show_asset_id, menuentry_vec_t &items,
|
||||
menuentry_vec_t &disabled_items, U32 flags);
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual BOOL startDrag(EDragAndDropType* type, LLUUID* id) const;
|
||||
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data) { return FALSE; }
|
||||
virtual LLInventoryType::EType getInventoryType() const { return mInvType; }
|
||||
|
||||
// LLInvFVBridge functionality
|
||||
virtual void clearDisplayName() {}
|
||||
virtual EWearableType getWearableType() const { return WT_NONE; }
|
||||
|
||||
protected:
|
||||
LLInvFVBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
|
||||
mInventoryPanel(inventory), mUUID(uuid), mInvType(LLInventoryType::IT_NONE) {}
|
||||
virtual void addTrashContextMenuOptions(menuentry_vec_t &items,
|
||||
menuentry_vec_t &disabled_items);
|
||||
virtual void addDeleteContextMenuOptions(menuentry_vec_t &items,
|
||||
menuentry_vec_t &disabled_items);
|
||||
virtual void addOpenRightClickMenuOption(menuentry_vec_t &items);
|
||||
protected:
|
||||
LLInvFVBridge(LLInventoryPanel* inventory, /*LLFolderView* root,*/ const LLUUID& uuid);
|
||||
|
||||
LLInventoryObject* getInventoryObject() const;
|
||||
BOOL isInTrash() const;
|
||||
LLInventoryModel* getInventoryModel() const;
|
||||
|
||||
BOOL isLinkedObjectInTrash() const; // Is this obj or its baseobj in the trash?
|
||||
BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory?
|
||||
// return true if the item is in agent inventory. if false, it
|
||||
// must be lost or in the inventory library.
|
||||
BOOL isAgentInventory() const;
|
||||
BOOL isAgentInventory() const; // false if lost or in the inventory library
|
||||
BOOL isCOFFolder() const; // true if COF or descendent of
|
||||
virtual BOOL isItemPermissive() const;
|
||||
static void changeItemParent(LLInventoryModel* model,
|
||||
LLViewerInventoryItem* item,
|
||||
@@ -275,6 +293,7 @@ protected:
|
||||
LLInventoryPanel* mInventoryPanel;
|
||||
LLUUID mUUID; // item id
|
||||
LLInventoryType::EType mInvType;
|
||||
BOOL mIsLink;
|
||||
};
|
||||
|
||||
class AIFilePicker;
|
||||
@@ -294,6 +313,7 @@ public:
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual const std::string& getDisplayName() const;
|
||||
virtual std::string getLabelSuffix() const;
|
||||
virtual LLFontGL::StyleFlags getLabelStyle() const;
|
||||
virtual PermissionMask getPermissionMask() const;
|
||||
virtual time_t getCreationDate() const;
|
||||
virtual BOOL isItemRenameable() const;
|
||||
@@ -306,8 +326,7 @@ public:
|
||||
|
||||
static void showFloaterImagePreview(LLInventoryItem* item, AIFilePicker* filepicker);
|
||||
|
||||
// override for LLInvFVBridge
|
||||
virtual void clearDisplayName() { mDisplayName.clear(); }
|
||||
/*virtual*/ void clearDisplayName() { mDisplayName.clear(); }
|
||||
|
||||
LLViewerInventoryItem* getItem() const;
|
||||
|
||||
@@ -320,23 +339,26 @@ protected:
|
||||
|
||||
class LLFolderBridge : public LLInvFVBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
BOOL dragItemIntoFolder(LLInventoryItem* inv_item,
|
||||
BOOL drop);
|
||||
BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category,
|
||||
BOOL drop);
|
||||
LLFolderBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid) :
|
||||
LLInvFVBridge(inventory, /*root,*/ uuid),
|
||||
mCallingCards(FALSE),
|
||||
mWearables(FALSE)
|
||||
{}
|
||||
BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop);
|
||||
BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, BOOL drop);
|
||||
virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
|
||||
virtual void openItem();
|
||||
virtual BOOL isItemRenameable() const;
|
||||
virtual void selectItem();
|
||||
virtual void restoreItem();
|
||||
|
||||
virtual LLFolderType::EType getPreferredType() const;
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual BOOL renameItem(const std::string& new_name);
|
||||
virtual BOOL removeItem();
|
||||
virtual BOOL isClipboardPasteable() const;
|
||||
virtual BOOL isClipboardPasteableAsLink() const;
|
||||
virtual void pasteFromClipboard();
|
||||
virtual void pasteLinkFromClipboard();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
@@ -348,6 +370,8 @@ public:
|
||||
virtual BOOL isItemRemovable();
|
||||
virtual BOOL isItemMovable();
|
||||
virtual BOOL isUpToDate() const;
|
||||
virtual BOOL isClipboardPasteable() const;
|
||||
virtual BOOL isClipboardPasteableAsLink() const;
|
||||
|
||||
static void createWearable(LLFolderBridge* bridge, EWearableType type);
|
||||
static void createWearable(LLUUID parent_folder_id, EWearableType type);
|
||||
@@ -355,9 +379,6 @@ public:
|
||||
LLViewerInventoryCategory* getCategory() const;
|
||||
|
||||
protected:
|
||||
LLFolderBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
|
||||
LLInvFVBridge(inventory, uuid), mCallingCards(FALSE), mWearables(FALSE) {}
|
||||
|
||||
// menu callbacks
|
||||
static void pasteClipboard(void* user_data);
|
||||
static void createNewCategory(void* user_data);
|
||||
@@ -382,6 +403,7 @@ protected:
|
||||
BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& typeToCheck);
|
||||
|
||||
void modifyOutfit(BOOL append, BOOL replace = FALSE);
|
||||
menuentry_vec_t getMenuItems() { return mItems; } // returns a copy of current menu items
|
||||
public:
|
||||
static LLFolderBridge* sSelf;
|
||||
static void staticFolderOptionsMenu();
|
||||
@@ -390,8 +412,8 @@ private:
|
||||
BOOL mCallingCards;
|
||||
BOOL mWearables;
|
||||
LLMenuGL* mMenu;
|
||||
std::vector<std::string> mItems;
|
||||
std::vector<std::string> mDisabledItems;
|
||||
menuentry_vec_t mItems;
|
||||
menuentry_vec_t mDisabledItems;
|
||||
};
|
||||
|
||||
// DEPRECATED
|
||||
@@ -409,84 +431,59 @@ protected:
|
||||
|
||||
class LLTextureBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual const std::string& getPrefix() { static std::string ret("Texture: ");return ret; }
|
||||
LLTextureBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid,
|
||||
LLInventoryType::EType type) :
|
||||
LLItemBridge(inventory, /*root,*/ uuid)
|
||||
{
|
||||
mInvType = type;
|
||||
}
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
|
||||
protected:
|
||||
LLTextureBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLInventoryType::EType type) :
|
||||
LLItemBridge(inventory, uuid), mInvType(type) {}
|
||||
static std::string sPrefix;
|
||||
LLInventoryType::EType mInvType;
|
||||
};
|
||||
|
||||
class LLSoundBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
LLSoundBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, /*root,*/ uuid) {}
|
||||
virtual void openItem();
|
||||
virtual void previewItem();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
static void openSoundPreview(void*);
|
||||
|
||||
protected:
|
||||
LLSoundBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
static std::string sPrefix;
|
||||
};
|
||||
|
||||
class LLLandmarkBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
static const std::string& prefix() { return sPrefix; }
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
//Need access to prefix statically for LLViewerTextEditor::openEmbeddedLandmark
|
||||
static const std::string& prefix() { static std::string ret("Landmark: ");return ret; }
|
||||
virtual const std::string& getPrefix() { return prefix(); }
|
||||
LLLandmarkBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid,
|
||||
U32 flags = 0x00);
|
||||
virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
|
||||
protected:
|
||||
LLLandmarkBridge(LLInventoryPanel* inventory, const LLUUID& uuid, U32 flags = 0x00) :
|
||||
LLItemBridge(inventory, uuid)
|
||||
{
|
||||
mVisited = FALSE;
|
||||
if (flags & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED)
|
||||
{
|
||||
mVisited = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
BOOL mVisited;
|
||||
};
|
||||
|
||||
class LLCallingCardBridge;
|
||||
|
||||
class LLCallingCardObserver : public LLFriendObserver
|
||||
{
|
||||
public:
|
||||
LLCallingCardObserver(LLCallingCardBridge* bridge) : mBridgep(bridge) {}
|
||||
virtual ~LLCallingCardObserver() { mBridgep = NULL; }
|
||||
virtual void changed(U32 mask);
|
||||
|
||||
protected:
|
||||
LLCallingCardBridge* mBridgep;
|
||||
};
|
||||
|
||||
class LLCallingCardBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual const std::string& getPrefix() { static std::string ret("Calling Card: ");return ret; }
|
||||
LLCallingCardBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid );
|
||||
~LLCallingCardBridge();
|
||||
virtual std::string getLabelSuffix() const;
|
||||
//virtual const std::string& getDisplayName() const;
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
@@ -499,146 +496,107 @@ public:
|
||||
EDragAndDropType cargo_type,
|
||||
void* cargo_data);
|
||||
void refreshFolderViewItem();
|
||||
|
||||
protected:
|
||||
LLCallingCardBridge( LLInventoryPanel* inventory, const LLUUID& uuid );
|
||||
~LLCallingCardBridge();
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
LLCallingCardObserver* mObserver;
|
||||
};
|
||||
|
||||
|
||||
class LLNotecardBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual const std::string& getPrefix() { static std::string ret("Notecard: ");return ret; }
|
||||
LLNotecardBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, /*root,*/ uuid) {}
|
||||
virtual void openItem();
|
||||
|
||||
protected:
|
||||
LLNotecardBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
};
|
||||
|
||||
class LLGestureBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
|
||||
virtual const std::string& getPrefix() { static std::string ret("Gesture: ");return ret; }
|
||||
LLGestureBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, /*root,*/ uuid) {}
|
||||
// Only suffix for gesture items, not task items, because only
|
||||
// gestures in your inventory can be active.
|
||||
virtual LLFontGL::StyleFlags getLabelStyle() const;
|
||||
virtual std::string getLabelSuffix() const;
|
||||
|
||||
virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
|
||||
virtual void openItem();
|
||||
virtual BOOL removeItem();
|
||||
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
||||
protected:
|
||||
LLGestureBridge(LLInventoryPanel* inventory, const LLUUID& uuid)
|
||||
: LLItemBridge(inventory, uuid) {}
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
};
|
||||
|
||||
|
||||
class LLAnimationBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
virtual const std::string& getPrefix() { static std::string ret("Animation: ");return ret; }
|
||||
LLAnimationBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, /*root,*/ uuid) {}
|
||||
virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void openItem();
|
||||
|
||||
protected:
|
||||
LLAnimationBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
};
|
||||
|
||||
|
||||
class LLObjectBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual const std::string& getPrefix() { static std::string ret("Object: ");return ret; }
|
||||
LLObjectBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid,
|
||||
LLInventoryType::EType type,
|
||||
U32 flags);
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
|
||||
virtual void openItem();
|
||||
virtual LLFontGL::StyleFlags getLabelStyle() const;
|
||||
virtual std::string getLabelSuffix() const;
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual BOOL isItemRemovable();
|
||||
virtual BOOL renameItem(const std::string& new_name);
|
||||
|
||||
LLInventoryObject* getObject() const;
|
||||
protected:
|
||||
LLObjectBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLInventoryType::EType type, U32 flags) :
|
||||
LLItemBridge(inventory, uuid), mInvType(type)
|
||||
{
|
||||
mAttachPt = (flags & 0xff); // low bye of inventory flags
|
||||
|
||||
mIsMultiObject = ( flags & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS ) ? TRUE: FALSE;
|
||||
}
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
static LLUUID sContextMenuItemID; // Only valid while the context menu is open.
|
||||
LLInventoryType::EType mInvType;
|
||||
U32 mAttachPt;
|
||||
BOOL mIsMultiObject;
|
||||
};
|
||||
|
||||
|
||||
class LLLSLTextBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
|
||||
virtual const std::string& getPrefix() { static std::string ret("Script: ");return ret; }
|
||||
LLLSLTextBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid ) :
|
||||
LLItemBridge(inventory, /*root,*/ uuid) {}
|
||||
virtual void openItem();
|
||||
|
||||
protected:
|
||||
LLLSLTextBridge( LLInventoryPanel* inventory, const LLUUID& uuid ) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
};
|
||||
|
||||
|
||||
class LLWearableBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
LLWearableBridge(LLInventoryPanel* inventory,
|
||||
/*LLFolderView* root,*/
|
||||
const LLUUID& uuid,
|
||||
LLAssetType::EType asset_type,
|
||||
LLInventoryType::EType inv_type,
|
||||
EWearableType wearable_type);
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
|
||||
virtual void openItem();
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual LLFontGL::StyleFlags getLabelStyle() const;
|
||||
virtual std::string getLabelSuffix() const;
|
||||
virtual BOOL isItemRemovable();
|
||||
virtual BOOL renameItem(const std::string& new_name);
|
||||
virtual EWearableType getWearableType() const { return mWearableType; }
|
||||
|
||||
static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu
|
||||
static BOOL canWearOnAvatar( void* userdata );
|
||||
@@ -652,56 +610,39 @@ public:
|
||||
static BOOL canRemoveFromAvatar( void* userdata );
|
||||
static void onRemoveFromAvatar( void* userdata );
|
||||
static void onRemoveFromAvatarArrived( LLWearable* wearable, void* userdata );
|
||||
|
||||
protected:
|
||||
LLWearableBridge(LLInventoryPanel* inventory, const LLUUID& uuid, LLAssetType::EType asset_type, LLInventoryType::EType inv_type, EWearableType wearable_type) :
|
||||
LLItemBridge(inventory, uuid),
|
||||
mAssetType( asset_type ),
|
||||
mInvType(inv_type),
|
||||
mWearableType(wearable_type)
|
||||
{}
|
||||
|
||||
protected:
|
||||
LLAssetType::EType mAssetType;
|
||||
LLInventoryType::EType mInvType;
|
||||
EWearableType mWearableType;
|
||||
};
|
||||
|
||||
class LLLinkItemBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
LLLinkItemBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, /*root,*/ uuid) {}
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
|
||||
protected:
|
||||
LLLinkItemBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
};
|
||||
|
||||
|
||||
class LLLinkFolderBridge : public LLItemBridge
|
||||
{
|
||||
friend class LLInvFVBridge;
|
||||
public:
|
||||
LLLinkFolderBridge(LLInventoryPanel* inventory,
|
||||
//LLFolderView* root,
|
||||
const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, /*root,*/ uuid) {}
|
||||
virtual const std::string& getPrefix() { return sPrefix; }
|
||||
|
||||
virtual LLUIImagePtr getIcon() const;
|
||||
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
|
||||
virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
|
||||
virtual void gotoItem(LLFolderView *folder);
|
||||
|
||||
protected:
|
||||
LLLinkFolderBridge(LLInventoryPanel* inventory, const LLUUID& uuid) :
|
||||
LLItemBridge(inventory, uuid) {}
|
||||
const LLUUID &getFolderID() const;
|
||||
|
||||
protected:
|
||||
static std::string sPrefix;
|
||||
};
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "llinventoryview.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "llviewermessage.h"
|
||||
#include "llfoldertype.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llappviewer.h"
|
||||
@@ -100,34 +101,36 @@ const F32 MAX_TIME_FOR_SINGLE_FETCH = 10.f;
|
||||
const S32 MAX_FETCH_RETRIES = 10;
|
||||
const char CACHE_FORMAT_STRING[] = "%s.inv";
|
||||
const char* NEW_CATEGORY_NAME = "New Folder";
|
||||
const char* NEW_CATEGORY_NAMES[LLAssetType::AT_COUNT] =
|
||||
|
||||
const char* NEW_CATEGORY_NAMES[LLFolderType::FT_COUNT] =
|
||||
{
|
||||
"Textures", // AT_TEXTURE
|
||||
"Sounds", // AT_SOUND
|
||||
"Calling Cards", // AT_CALLINGCARD
|
||||
"Landmarks", // AT_LANDMARK
|
||||
"Textures", // FT_TEXTURE = 0,
|
||||
"Sounds", // FT_SOUND = 1,
|
||||
"Calling Cards", // FT_CALLINGCARD = 2,
|
||||
"Landmarks", // FT_LANDMARK = 3,
|
||||
"Scripts", // AT_SCRIPT (deprecated?)
|
||||
"Clothing", // AT_CLOTHING
|
||||
"Objects", // AT_OBJECT
|
||||
"Notecards", // AT_NOTECARD
|
||||
"New Folder", // AT_CATEGORY
|
||||
"Clothing", // FT_CLOTHING = 5,
|
||||
"Objects", // FT_OBJECT = 6,
|
||||
"Notecards", // FT_NOTECARD = 7,
|
||||
"New Folder", // FT_ROOT_INVENTORY = 8,
|
||||
"Inventory", // AT_ROOT_CATEGORY
|
||||
"Scripts", // AT_LSL_TEXT
|
||||
"Scripts", // FT_LSL_TEXT = 10,
|
||||
"Scripts", // AT_LSL_BYTECODE
|
||||
"Uncompressed Images", // AT_TEXTURE_TGA
|
||||
"Body Parts", // AT_BODYPART
|
||||
"Trash", // AT_TRASH
|
||||
"Photo Album", // AT_SNAPSHOT_CATEGORY
|
||||
"Lost And Found", // AT_LOST_AND_FOUND
|
||||
"Body Parts", // FT_BODYPART = 13,
|
||||
"Trash", // FT_TRASH = 14,
|
||||
"Photo Album", // FT_SNAPSHOT_CATEGORY = 15,
|
||||
"Lost And Found", // FT_LOST_AND_FOUND = 16,
|
||||
"Uncompressed Sounds", // AT_SOUND_WAV
|
||||
"Uncompressed Images", // AT_IMAGE_TGA
|
||||
"Uncompressed Images", // AT_IMAGE_JPEG
|
||||
"Animations", // AT_ANIMATION
|
||||
"Gestures", // AT_GESTURE
|
||||
"Animations", // FT_ANIMATION = 20,
|
||||
"Gestures", // FT_GESTURE = 21,
|
||||
"New Folder", // AT_SIMSTATE
|
||||
"Favorites",
|
||||
"Favorites", // FT_FAVORITE = 23,
|
||||
"New Folder",
|
||||
"New Folder",
|
||||
"New Ensemble", // FT_ENSEMBLE_START = 26,
|
||||
"New Ensemble",
|
||||
"New Ensemble",
|
||||
"New Ensemble",
|
||||
@@ -146,11 +149,11 @@ const char* NEW_CATEGORY_NAMES[LLAssetType::AT_COUNT] =
|
||||
"New Ensemble",
|
||||
"New Ensemble",
|
||||
"New Ensemble",
|
||||
"New Ensemble",
|
||||
"New Ensemble",
|
||||
"Current Outfit",
|
||||
"New Outfit",
|
||||
"My Outfits"
|
||||
"New Ensemble", // FT_ENSEMBLE_END = 45,
|
||||
"Current Outfit", // FT_CURRENT_OUTFIT = 46,
|
||||
"New Outfit", // FT_OUTFIT = 47,
|
||||
"My Outfits", // FT_MY_OUTFITS = 48,
|
||||
"Inbox" // FT_INBOX = 49,
|
||||
};
|
||||
|
||||
struct InventoryIDPtrLess
|
||||
@@ -279,6 +282,29 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const
|
||||
{
|
||||
const LLInventoryObject* obj = getObject(obj_id);
|
||||
|
||||
// Search up the parent chain until we get to root or an acceptable folder.
|
||||
// This assumes there are no cycles in the tree else we'll get a hang.
|
||||
LLUUID parent_id = obj->getParentUUID();
|
||||
while (!parent_id.isNull())
|
||||
{
|
||||
const LLViewerInventoryCategory *cat = getCategory(parent_id);
|
||||
if (!cat) break;
|
||||
const LLFolderType::EType folder_type = cat->getPreferredType();
|
||||
if (folder_type != LLFolderType::FT_NONE &&
|
||||
folder_type != LLFolderType::FT_ROOT_INVENTORY &&
|
||||
!LLFolderType::lookupIsEnsembleType(folder_type))
|
||||
{
|
||||
return cat;
|
||||
}
|
||||
parent_id = cat->getParentUUID();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Get the object by id. Returns NULL if not found.
|
||||
LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const
|
||||
{
|
||||
@@ -383,51 +409,32 @@ void LLInventoryModel::unlockDirectDescendentArrays(const LLUUID& cat_id)
|
||||
// specifies 'type' as what it defaults to containing. The category is
|
||||
// not necessarily only for that type. *NOTE: This will create a new
|
||||
// inventory category on the fly if one does not exist.
|
||||
const LLUUID LLInventoryModel::findCategoryUUIDForType(LLAssetType::EType t, bool create_folder)
|
||||
const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType preferred_type,
|
||||
bool create_folder//,
|
||||
/*bool find_in_library*/)
|
||||
{
|
||||
LLUUID rv = findCatUUID(t);
|
||||
LLUUID rv = findCatUUID(preferred_type);
|
||||
if(rv.isNull() && isInventoryUsable() && create_folder)
|
||||
{
|
||||
LLUUID root_id = gAgent.getInventoryRootID();
|
||||
if(root_id.notNull())
|
||||
{
|
||||
rv = createNewCategory(root_id, t, LLStringUtil::null);
|
||||
rv = createNewCategory(root_id, preferred_type, LLStringUtil::null);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const
|
||||
{
|
||||
const LLInventoryObject* obj = getObject(obj_id);
|
||||
|
||||
// Search up the parent chain until we get to root or an acceptable folder.
|
||||
// This assumes there are no cycles in the tree else we'll get a hang.
|
||||
LLUUID parent_id = obj->getParentUUID();
|
||||
while (!parent_id.isNull())
|
||||
{
|
||||
const LLViewerInventoryCategory *cat = getCategory(parent_id);
|
||||
if (!cat) break;
|
||||
const LLAssetType::EType folder_type = cat->getPreferredType();
|
||||
if (folder_type != LLAssetType::AT_NONE && folder_type != LLAssetType::AT_ROOT_CATEGORY)
|
||||
{
|
||||
return cat;
|
||||
}
|
||||
parent_id = cat->getParentUUID();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Internal method which looks for a category with the specified
|
||||
// preferred type. Returns LLUUID::null if not found.
|
||||
LLUUID LLInventoryModel::findCatUUID(LLAssetType::EType preferred_type)
|
||||
LLUUID LLInventoryModel::findCatUUID(LLFolderType::EType preferred_type)
|
||||
{
|
||||
LLUUID root_id = gAgent.getInventoryRootID();
|
||||
if(LLAssetType::AT_CATEGORY == preferred_type)
|
||||
const LLUUID &root_id = gAgent.getInventoryRootID();
|
||||
if(LLFolderType::FT_ROOT_INVENTORY == preferred_type)
|
||||
{
|
||||
return root_id;
|
||||
}
|
||||
if(root_id.notNull())
|
||||
else if (root_id.notNull())
|
||||
{
|
||||
cat_array_t* cats = NULL;
|
||||
cats = get_ptr_in_map(mParentChildCategoryTree, root_id);
|
||||
@@ -473,7 +480,7 @@ LLUUID LLInventoryModel::findCategoryByName(std::string name)
|
||||
// version will take care of details like what the name should be
|
||||
// based on preferred type. Returns the UUID of the new category.
|
||||
LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
|
||||
LLAssetType::EType preferred_type,
|
||||
LLFolderType::EType preferred_type,
|
||||
const std::string& pname)
|
||||
{
|
||||
LLUUID id;
|
||||
@@ -483,38 +490,9 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
|
||||
return id;
|
||||
}
|
||||
|
||||
if(preferred_type == LLAssetType::AT_SIMSTATE)
|
||||
if(LLFolderType::lookup(preferred_type) == LLFolderType::badLookup())
|
||||
{
|
||||
lldebugs << "Attempt to create simstate category." << llendl;
|
||||
return id;
|
||||
}
|
||||
else if(preferred_type == LLAssetType::AT_SOUND_WAV)
|
||||
{
|
||||
lldebugs << "Attempt to create (wave) uncompressed sound category." << llendl;
|
||||
return id;
|
||||
}
|
||||
else if(preferred_type == LLAssetType::AT_IMAGE_TGA)
|
||||
{
|
||||
lldebugs << "Attempt to create a AT_IMAGE_TGA uncompresssed images category." << llendl;
|
||||
return id;
|
||||
}
|
||||
else if(preferred_type == LLAssetType::AT_TEXTURE_TGA)
|
||||
{
|
||||
lldebugs << "Attempt to create a AT_TEXTURE_TGA uncompresssed images category." << llendl;
|
||||
return id;
|
||||
}
|
||||
|
||||
else if(preferred_type == LLAssetType::AT_IMAGE_JPEG)
|
||||
{
|
||||
lldebugs << "Attempt to create a AT_IMAGE_JPEG uncompresssed images category." << llendl;
|
||||
return id;
|
||||
}else if(preferred_type == LLAssetType::AT_SCRIPT)
|
||||
{
|
||||
lldebugs << "Attempt to create a AT_Script scripts category." << llendl;
|
||||
return id;
|
||||
}else if(preferred_type == LLAssetType::AT_LSL_BYTECODE)
|
||||
{
|
||||
lldebugs << "Attempt to create a AT_LSL_BYTECODE scripts category." << llendl;
|
||||
lldebugs << "Attempt to create undefined category. (" << preferred_type << ")" << llendl;
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -524,15 +502,10 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id,
|
||||
{
|
||||
name.assign(pname);
|
||||
}
|
||||
else if((preferred_type >= LLAssetType::AT_TEXTURE) &&
|
||||
(preferred_type <= LLAssetType::AT_MY_OUTFITS))
|
||||
{
|
||||
name.assign(NEW_CATEGORY_NAMES[preferred_type]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(preferred_type < LLFolderType::FT_TEXTURE || preferred_type > LLFolderType::FT_INBOX)
|
||||
name.assign(NEW_CATEGORY_NAME);
|
||||
}
|
||||
else
|
||||
name.assign(NEW_CATEGORY_NAMES[preferred_type]);
|
||||
|
||||
// Add the category to the internal representation
|
||||
LLPointer<LLViewerInventoryCategory> cat =
|
||||
@@ -595,7 +568,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
|
||||
// Start with categories
|
||||
if(!include_trash)
|
||||
{
|
||||
const LLUUID trash_id = findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
const LLUUID trash_id = findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if(trash_id.notNull() && (trash_id == id))
|
||||
return;
|
||||
}
|
||||
@@ -651,7 +624,7 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
|
||||
if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER)
|
||||
{
|
||||
LLViewerInventoryCategory *linked_cat = item->getLinkedCategory();
|
||||
if (linked_cat && linked_cat->getPreferredType() != LLAssetType::AT_OUTFIT)
|
||||
if (linked_cat && linked_cat->getPreferredType() != LLFolderType::FT_OUTFIT)
|
||||
// BAP - was
|
||||
// LLAssetType::lookupIsEnsembleCategoryType(linked_cat->getPreferredType()))
|
||||
// Change back once ensemble typing is in place.
|
||||
@@ -822,7 +795,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
|
||||
|
||||
if(item->getParentUUID().isNull())
|
||||
{
|
||||
LLUUID category_id = findCategoryUUIDForType(new_item->getType());
|
||||
const LLUUID category_id = findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(new_item->getType()));
|
||||
new_item->setParent(category_id);
|
||||
item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, category_id);
|
||||
if( item_array )
|
||||
@@ -846,7 +819,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
|
||||
LLUUID parent_id = item->getParentUUID();
|
||||
if(parent_id == CATEGORIZE_LOST_AND_FOUND_ID)
|
||||
{
|
||||
parent_id = findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
|
||||
parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
new_item->setParent(parent_id);
|
||||
}
|
||||
item_array_t* item_array = get_ptr_in_map(mParentChildItemTree, parent_id);
|
||||
@@ -859,7 +832,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item)
|
||||
// Whoops! No such parent, make one.
|
||||
llinfos << "Lost item: " << new_item->getUUID() << " - "
|
||||
<< new_item->getName() << llendl;
|
||||
parent_id = findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
|
||||
parent_id = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
new_item->setParent(parent_id);
|
||||
item_array = get_ptr_in_map(mParentChildItemTree, parent_id);
|
||||
if(item_array)
|
||||
@@ -1022,8 +995,12 @@ void LLInventoryModel::deleteObject(const LLUUID& id)
|
||||
{
|
||||
lldebugs << "LLInventoryModel::deleteObject()" << llendl;
|
||||
LLPointer<LLInventoryObject> obj = getObject(id);
|
||||
if(obj)
|
||||
if (!obj)
|
||||
{
|
||||
llwarns << "Deleting non-existent object [ id: " << id << " ] " << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
lldebugs << "Deleting inventory object " << id << llendl;
|
||||
mLastItem = NULL;
|
||||
LLUUID parent_id = obj->getParentUUID();
|
||||
@@ -1057,7 +1034,6 @@ void LLInventoryModel::deleteObject(const LLUUID& id)
|
||||
addChangedMask(LLInventoryObserver::REMOVE, id);
|
||||
obj = NULL; // delete obj
|
||||
}
|
||||
}
|
||||
|
||||
// Delete a particular inventory item by ID, and remove it from the server.
|
||||
void LLInventoryModel::purgeObject(const LLUUID &id)
|
||||
@@ -1305,7 +1281,7 @@ void LLInventoryModel::mock(const LLUUID& root_id)
|
||||
root_id,
|
||||
LLUUID::null,
|
||||
LLAssetType::AT_CATEGORY,
|
||||
NEW_CATEGORY_NAMES[LLAssetType::AT_ROOT_CATEGORY],
|
||||
NEW_CATEGORY_NAMES[LLFolderType::FT_ROOT_CATEGORY],
|
||||
gAgent.getID());
|
||||
addCategory(cat);
|
||||
gInventory.buildParentChildMap();
|
||||
@@ -1467,7 +1443,7 @@ void fetchDescendentsResponder::result(const LLSD& content)
|
||||
item_it != folder_sd["items"].endArray();
|
||||
++item_it)
|
||||
{
|
||||
LLUUID lost_uuid = gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
|
||||
LLUUID lost_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
if (lost_uuid.notNull())
|
||||
{
|
||||
LLSD item = *item_it;
|
||||
@@ -2056,14 +2032,16 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) const
|
||||
}
|
||||
if(!accounted)
|
||||
{
|
||||
lldebugs << "No accounting for: '" << cat->getName() << "' "
|
||||
// Error condition, this means that the category did not register that
|
||||
// it got new descendents (perhaps because it is still being loaded)
|
||||
// which means its descendent count will be wrong.
|
||||
llwarns << "Accounting failed for '" << cat->getName() << "' version:"
|
||||
<< version << llendl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "No category found for update " << update.mCategoryID
|
||||
<< llendl;
|
||||
llwarns << "No category found for update " << update.mCategoryID << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2194,12 +2172,6 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const
|
||||
return false;
|
||||
}
|
||||
|
||||
// OGPX : This loadSkeleton() takes LLSD formated data, other loadSkeleton is for XML-RPC data.
|
||||
// There are major differences in what is returned from the XML-RPC authenticate call versus
|
||||
// the style and sequence of OGP/llsd style authentication.
|
||||
// In OGP, authentication returns a cap to the skeleton on agent domain. An HTTP GET then occurs on
|
||||
// this "agent/inventory-skeleton" cap. This loadSkeleton()
|
||||
// routine is called after that HTTP GET of "agent/inventory-skeleton" cap occurs.
|
||||
bool LLInventoryModel::loadSkeleton(
|
||||
const LLSD& options,
|
||||
const LLUUID& owner_id)
|
||||
@@ -2229,11 +2201,11 @@ bool LLInventoryModel::loadSkeleton(
|
||||
cat->setUUID(folder_id.asUUID());
|
||||
cat->setParent(parent_id.asUUID());
|
||||
|
||||
LLAssetType::EType preferred_type = LLAssetType::AT_NONE;
|
||||
LLFolderType::EType preferred_type = LLFolderType::FT_NONE;
|
||||
LLSD type_default = (*it)["type_default"];
|
||||
if(type_default.isDefined())
|
||||
{
|
||||
preferred_type = (LLAssetType::EType)type_default.asInteger();
|
||||
preferred_type = (LLFolderType::EType)type_default.asInteger();
|
||||
}
|
||||
cat->setPreferredType(preferred_type);
|
||||
cat->setVersion(version.asInteger());
|
||||
@@ -2534,12 +2506,12 @@ void LLInventoryModel::buildParentChildMap()
|
||||
<< cat->getName() << " with parent:" << cat->getParentUUID() << llendl;
|
||||
++lost;
|
||||
// plop it into the lost & found.
|
||||
LLAssetType::EType pref = cat->getPreferredType();
|
||||
if(LLAssetType::AT_NONE == pref)
|
||||
LLFolderType::EType pref = cat->getPreferredType();
|
||||
if(LLFolderType::FT_NONE == pref)
|
||||
{
|
||||
cat->setParent(findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND));
|
||||
cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND));
|
||||
}
|
||||
else if(LLAssetType::AT_CATEGORY == pref)
|
||||
else if(LLFolderType::FT_ROOT_INVENTORY == pref)
|
||||
{
|
||||
// it's the root
|
||||
cat->setParent(LLUUID::null);
|
||||
@@ -2581,7 +2553,7 @@ void LLInventoryModel::buildParentChildMap()
|
||||
}
|
||||
count = items.count();
|
||||
lost = 0;
|
||||
std::vector<LLUUID> lost_item_ids;
|
||||
uuid_vec_t lost_item_ids;
|
||||
for(i = 0; i < count; ++i)
|
||||
{
|
||||
LLPointer<LLViewerInventoryItem> item;
|
||||
@@ -2598,7 +2570,7 @@ void LLInventoryModel::buildParentChildMap()
|
||||
++lost;
|
||||
// plop it into the lost & found.
|
||||
//
|
||||
item->setParent(findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND));
|
||||
item->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND));
|
||||
// move it later using a special message to move items. If
|
||||
// we update server here, the client might crash.
|
||||
//item->updateServer();
|
||||
@@ -2619,8 +2591,8 @@ void LLInventoryModel::buildParentChildMap()
|
||||
llwarns << "Found " << lost << " lost items." << llendl;
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
BOOL start_new_message = TRUE;
|
||||
LLUUID lnf = findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
|
||||
for(std::vector<LLUUID>::iterator it = lost_item_ids.begin() ; it < lost_item_ids.end(); ++it)
|
||||
const LLUUID lnf = findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
for(uuid_vec_t::iterator it = lost_item_ids.begin() ; it < lost_item_ids.end(); ++it)
|
||||
{
|
||||
if(start_new_message)
|
||||
{
|
||||
@@ -3052,7 +3024,7 @@ void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**)
|
||||
return;
|
||||
}
|
||||
S32 count = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
|
||||
std::vector<LLUUID> item_ids;
|
||||
uuid_vec_t item_ids;
|
||||
update_map_t update;
|
||||
for(S32 i = 0; i < count; ++i)
|
||||
{
|
||||
@@ -3068,7 +3040,7 @@ void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**)
|
||||
}
|
||||
}
|
||||
gInventory.accountForUpdate(update);
|
||||
for(std::vector<LLUUID>::iterator it = item_ids.begin(); it != item_ids.end(); ++it)
|
||||
for(uuid_vec_t::iterator it = item_ids.begin(); it != item_ids.end(); ++it)
|
||||
{
|
||||
gInventory.deleteObject(*it);
|
||||
}
|
||||
@@ -3099,7 +3071,7 @@ void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg,
|
||||
lastfolder = tfolder;
|
||||
tfolder->unpackMessage(msg, _PREHASH_FolderData, i);
|
||||
// make sure it's not a protected folder
|
||||
tfolder->setPreferredType(LLAssetType::AT_NONE);
|
||||
tfolder->setPreferredType(LLFolderType::FT_NONE);
|
||||
folders.push_back(tfolder);
|
||||
// examine update for changes.
|
||||
LLViewerInventoryCategory* folderp = gInventory.getCategory(tfolder->getUUID());
|
||||
@@ -3148,7 +3120,7 @@ void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg,
|
||||
<< llendl;
|
||||
return;
|
||||
}
|
||||
std::vector<LLUUID> folder_ids;
|
||||
uuid_vec_t folder_ids;
|
||||
update_map_t update;
|
||||
S32 count = msg->getNumberOfBlocksFast(_PREHASH_FolderData);
|
||||
for(S32 i = 0; i < count; ++i)
|
||||
@@ -3162,7 +3134,7 @@ void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg,
|
||||
}
|
||||
}
|
||||
gInventory.accountForUpdate(update);
|
||||
for(std::vector<LLUUID>::iterator it = folder_ids.begin(); it != folder_ids.end(); ++it)
|
||||
for(uuid_vec_t::iterator it = folder_ids.begin(); it != folder_ids.end(); ++it)
|
||||
{
|
||||
gInventory.deleteObject(*it);
|
||||
}
|
||||
@@ -3297,7 +3269,7 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**)
|
||||
|
||||
|
||||
count = msg->getNumberOfBlocksFast(_PREHASH_ItemData);
|
||||
std::vector<LLUUID> wearable_ids;
|
||||
uuid_vec_t wearable_ids;
|
||||
item_array_t items;
|
||||
std::list<InventoryCallbackInfo> cblist;
|
||||
for(i = 0; i < count; ++i)
|
||||
@@ -3411,8 +3383,7 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**)
|
||||
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id);
|
||||
if(agent_id != gAgent.getID())
|
||||
{
|
||||
llwarns << "Got a UpdateInventoryItem for the wrong agent."
|
||||
<< llendl;
|
||||
llwarns << "Got a UpdateInventoryItem for the wrong agent." << llendl;
|
||||
return;
|
||||
}
|
||||
LLUUID parent_id;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#define LL_LLINVENTORYMODEL_H
|
||||
|
||||
#include "llassettype.h"
|
||||
#include "llfoldertype.h"
|
||||
#include "lldarray.h"
|
||||
#include "lluuid.h"
|
||||
#include "llpermissionsflags.h"
|
||||
@@ -243,7 +244,7 @@ public:
|
||||
// NOTE: If create_folder is true, this will create a new inventory category
|
||||
// on the fly if one does not exist. *NOTE: if find_in_library is true it
|
||||
// will search in the user's library folder instead of "My Inventory"
|
||||
const LLUUID findCategoryUUIDForType(LLAssetType::EType preferred_type,
|
||||
const LLUUID findCategoryUUIDForType(LLFolderType::EType preferred_type,
|
||||
bool create_folder = true
|
||||
/*,bool find_in_library = false*/);
|
||||
|
||||
@@ -372,7 +373,7 @@ public:
|
||||
// Returns the UUID of the new category. If you want to use the default
|
||||
// name based on type, pass in a NULL to the 'name' parameter.
|
||||
LLUUID createNewCategory(const LLUUID& parent_id,
|
||||
LLAssetType::EType preferred_type,
|
||||
LLFolderType::EType preferred_type,
|
||||
const std::string& name);
|
||||
|
||||
// Internal methods that add inventory and make sure that all of
|
||||
@@ -492,7 +493,7 @@ protected:
|
||||
|
||||
// Internal method which looks for a category with the specified
|
||||
// preferred type. Returns LLUUID::null if not found
|
||||
LLUUID findCatUUID(LLAssetType::EType preferred_type);
|
||||
LLUUID findCatUUID(LLFolderType::EType preferred_type);
|
||||
|
||||
// Empty the entire contents
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#include "lltooldraganddrop.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "llviewerassettype.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llwearablelist.h"
|
||||
@@ -2065,7 +2066,7 @@ void LLInventoryPanel::closeAllFolders()
|
||||
|
||||
void LLInventoryPanel::openDefaultFolderForType(LLAssetType::EType type)
|
||||
{
|
||||
LLUUID category_id = mInventory->findCategoryUUIDForType(type);
|
||||
LLUUID category_id = mInventory->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(type));
|
||||
LLOpenFolderByID opener(category_id);
|
||||
mFolders->applyFunctorRecursively(opener);
|
||||
}
|
||||
@@ -2099,7 +2100,7 @@ void LLInventoryPanel::createNewItem(const std::string& name,
|
||||
U32 next_owner_perm)
|
||||
{
|
||||
std::string desc;
|
||||
LLAssetType::generateDescriptionFor(asset_type, desc);
|
||||
LLViewerAssetType::generateDescriptionFor(asset_type, desc);
|
||||
next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER;
|
||||
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ void LLLocalInventory::loadInvCache(std::string filename)
|
||||
container_id.generate();
|
||||
container->setUUID(container_id);
|
||||
container->setParent(gSystemFolderRoot);
|
||||
container->setPreferredType(LLAssetType::AT_NONE);
|
||||
container->setPreferredType(LLFolderType::FT_NONE);
|
||||
LLInventoryModel::update_map_t container_update;
|
||||
++container_update[container->getParentUUID()];
|
||||
gInventory.accountForUpdate(container_update);
|
||||
@@ -199,7 +199,7 @@ void LLLocalInventory::loadInvCache(std::string filename)
|
||||
orphaned_items_id.generate();
|
||||
orphaned_items->setUUID(orphaned_items_id);
|
||||
orphaned_items->setParent(container_id);
|
||||
orphaned_items->setPreferredType(LLAssetType::AT_NONE);
|
||||
orphaned_items->setPreferredType(LLFolderType::FT_NONE);
|
||||
|
||||
LLInventoryModel::update_map_t orphaned_items_update;
|
||||
++orphaned_items_update[orphaned_items->getParentUUID()];
|
||||
@@ -470,7 +470,7 @@ void LLFloaterNewLocalInventory::onClickOK(void* user_data)
|
||||
LLUUID owner_id = LLUUID(floater->getChild<LLLineEditor>("owner_id_line")->getText());
|
||||
|
||||
LLAssetType::EType type = LLAssetType::lookup(floater->getChild<LLComboBox>("type_combo")->getValue().asString());
|
||||
LLInventoryType::EType inv_type = LLInventoryType::IT_CALLINGCARD;
|
||||
LLInventoryType::EType inv_type = LLInventoryType::IT_NONE;
|
||||
switch(type)
|
||||
{
|
||||
case LLAssetType::AT_TEXTURE:
|
||||
@@ -504,12 +504,13 @@ void LLFloaterNewLocalInventory::onClickOK(void* user_data)
|
||||
case LLAssetType::AT_CATEGORY:
|
||||
inv_type = LLInventoryType::IT_CATEGORY;
|
||||
break;
|
||||
case LLAssetType::AT_ROOT_CATEGORY:
|
||||
case LLAssetType::AT_TRASH:
|
||||
case LLAssetType::AT_SNAPSHOT_CATEGORY:
|
||||
case LLAssetType::AT_LOST_AND_FOUND:
|
||||
//No longer asset types.
|
||||
/*case LLFolderType::FT_ROOT_CATEGORY:
|
||||
case LLFolderType::FT_TRASH:
|
||||
case LLFolderType::FT_SNAPSHOT_CATEGORY:
|
||||
case LLFolderType::FT_LOST_AND_FOUND:
|
||||
inv_type = LLInventoryType::IT_ROOT_CATEGORY;
|
||||
break;
|
||||
break;*/
|
||||
case LLAssetType::AT_LSL_TEXT:
|
||||
case LLAssetType::AT_LSL_BYTECODE:
|
||||
inv_type = LLInventoryType::IT_LSL;
|
||||
@@ -523,12 +524,14 @@ void LLFloaterNewLocalInventory::onClickOK(void* user_data)
|
||||
case LLAssetType::AT_GESTURE:
|
||||
inv_type = LLInventoryType::IT_GESTURE;
|
||||
break;
|
||||
case LLAssetType::AT_SIMSTATE:
|
||||
//case LLAssetType::AT_SIMSTATE:
|
||||
default:
|
||||
inv_type = LLInventoryType::IT_CALLINGCARD;
|
||||
//inv_type = LLInventoryType::IT_CALLINGCARD;
|
||||
break;
|
||||
}
|
||||
|
||||
if(inv_type == LLInventoryType::IT_NONE)
|
||||
return;
|
||||
|
||||
LLPermissions* perms = new LLPermissions();
|
||||
perms->init(creator_id, owner_id, LLUUID::null, LLUUID::null);
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llviewerassettype.h"
|
||||
#include "llworld.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llviewerregion.h"
|
||||
@@ -200,7 +201,7 @@ void LLPanelContents::onClickNewScript(void *userdata)
|
||||
PERM_NONE,
|
||||
PERM_MOVE | PERM_TRANSFER);
|
||||
std::string desc;
|
||||
LLAssetType::generateDescriptionFor(LLAssetType::AT_LSL_TEXT, desc);
|
||||
LLViewerAssetType::generateDescriptionFor(LLAssetType::AT_LSL_TEXT, desc);
|
||||
LLPointer<LLViewerInventoryItem> new_item =
|
||||
new LLViewerInventoryItem(
|
||||
LLUUID::null,
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llwearable.h"
|
||||
#include "llviewerassettype.h"
|
||||
// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b)
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
@@ -304,7 +305,7 @@ bool LLTaskInvFVBridge::commitBuyItem(const LLSD& notification, const LLSD& resp
|
||||
msg->addUUIDFast(_PREHASH_ObjectID, notification["payload"]["task_id"].asUUID());
|
||||
msg->addUUIDFast(_PREHASH_ItemID, notification["payload"]["item_id"].asUUID());
|
||||
msg->addUUIDFast(_PREHASH_FolderID,
|
||||
gInventory.findCategoryUUIDForType((LLAssetType::EType)notification["payload"]["type"].asInteger()));
|
||||
gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType((LLAssetType::EType)notification["payload"]["type"].asInteger())));
|
||||
msg->sendReliable(object->getRegion()->getHost());
|
||||
}
|
||||
return false;
|
||||
@@ -648,7 +649,7 @@ BOOL LLTaskInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
|
||||
// || gAgent.isGodlike())
|
||||
|
||||
{
|
||||
*type = LLAssetType::lookupDragAndDropType(inv->getType());
|
||||
*type = LLViewerAssetType::lookupDragAndDropType(inv->getType());
|
||||
|
||||
*id = inv->getUUID();
|
||||
return TRUE;
|
||||
@@ -713,7 +714,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
|
||||
if (!item)
|
||||
{
|
||||
hideContextEntries(menu, items, disabled_items);
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -793,7 +794,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
|
||||
hideContextEntries(menu, items, disabled_items);
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
}
|
||||
|
||||
|
||||
@@ -855,7 +856,7 @@ void LLTaskCategoryBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
std::vector<std::string> items;
|
||||
std::vector<std::string> disabled_items;
|
||||
items.push_back(std::string("Task Open")); // *TODO: Translate
|
||||
hideContextEntries(menu, items, disabled_items);
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
}
|
||||
|
||||
BOOL LLTaskCategoryBridge::hasChildren() const
|
||||
@@ -876,7 +877,7 @@ BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const
|
||||
const LLInventoryObject* cat = object->getInventoryObject(mUUID);
|
||||
if ( (cat) && (move_inv_category_world_to_agent(mUUID, LLUUID::null, FALSE)) )
|
||||
{
|
||||
*type = LLAssetType::lookupDragAndDropType(cat->getType());
|
||||
*type = LLViewerAssetType::lookupDragAndDropType(cat->getType());
|
||||
*id = mUUID;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -1165,7 +1166,7 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
|
||||
NULL,
|
||||
(void*)this));*/
|
||||
|
||||
hideContextEntries(menu, items, disabled_items);
|
||||
hide_context_entries(menu, items, disabled_items);
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
@@ -1850,7 +1851,7 @@ void LLPanelInventory::updateInventory()
|
||||
if (objectp)
|
||||
{
|
||||
LLInventoryObject* inventory_root = objectp->getInventoryRoot();
|
||||
InventoryObjectList contents;
|
||||
LLInventoryObject::object_list_t contents;
|
||||
objectp->getInventoryContents(contents);
|
||||
if (inventory_root)
|
||||
{
|
||||
@@ -1903,7 +1904,7 @@ void LLPanelInventory::updateInventory()
|
||||
// leads to an N^2 based on the category count. This could be greatly
|
||||
// speeded with an efficient multimap implementation, but we don't
|
||||
// have that in our current arsenal.
|
||||
void LLPanelInventory::createFolderViews(LLInventoryObject* inventory_root, InventoryObjectList& contents)
|
||||
void LLPanelInventory::createFolderViews(LLInventoryObject* inventory_root, LLInventoryObject::object_list_t& contents)
|
||||
{
|
||||
if (!inventory_root)
|
||||
{
|
||||
@@ -1937,8 +1938,8 @@ void LLPanelInventory::createViewsForCategory(LLInventoryObject::object_list_t*
|
||||
LLTaskInvFVBridge* bridge;
|
||||
LLFolderViewItem* view;
|
||||
|
||||
InventoryObjectList::iterator it = inventory->begin();
|
||||
InventoryObjectList::iterator end = inventory->end();
|
||||
LLInventoryObject::object_list_t::iterator it = inventory->begin();
|
||||
LLInventoryObject::object_list_t::iterator end = inventory->end();
|
||||
for( ; it != end; ++it)
|
||||
{
|
||||
LLInventoryObject* obj = *it;
|
||||
|
||||
@@ -60,7 +60,7 @@ class LLFolderViewEventListener;
|
||||
|
||||
// Utility function to hide all entries except those in the list
|
||||
class LLMenuGL;
|
||||
void hideContextEntries(LLMenuGL& menu,
|
||||
void hide_context_entries(LLMenuGL& menu,
|
||||
const std::vector<std::string> &entries_to_show,
|
||||
const std::vector<std::string> &disabled_entries);
|
||||
|
||||
@@ -82,7 +82,7 @@ protected:
|
||||
S32 serial_num,
|
||||
void* user_data);
|
||||
void updateInventory();
|
||||
void createFolderViews(LLInventoryObject* inventory_root, InventoryObjectList& contents);
|
||||
void createFolderViews(LLInventoryObject* inventory_root, LLInventoryObject::object_list_t& contents);
|
||||
void createViewsForCategory(LLInventoryObject::object_list_t* inventory,
|
||||
LLInventoryObject* parent,
|
||||
LLFolderViewFolder* folder);
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include "llselectmgr.h"
|
||||
#include "llinventoryview.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "llviewerassettype.h"
|
||||
|
||||
// Constants
|
||||
|
||||
@@ -406,7 +407,7 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask)
|
||||
&& LLToolDragAndDrop::getInstance()->isOverThreshold(screen_x, screen_y))
|
||||
{
|
||||
EDragAndDropType type;
|
||||
type = LLAssetType::lookupDragAndDropType(item->getType());
|
||||
type = LLViewerAssetType::lookupDragAndDropType(item->getType());
|
||||
LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_LIBRARY;
|
||||
if(!mObjectUUID.isNull())
|
||||
{
|
||||
@@ -497,7 +498,7 @@ void LLPreview::onDiscardBtn(void* data)
|
||||
*/
|
||||
|
||||
// Move the item to the trash
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if (item->getParentUUID() != trash_id)
|
||||
{
|
||||
LLInventoryModel::update_list_t update;
|
||||
|
||||
@@ -156,10 +156,10 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID&
|
||||
}
|
||||
|
||||
// Start speculative download of sounds and animations
|
||||
LLUUID animation_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_ANIMATION);
|
||||
LLUUID animation_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_ANIMATION);
|
||||
gInventory.startBackgroundFetch(animation_folder_id);
|
||||
|
||||
LLUUID sound_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_SOUND);
|
||||
LLUUID sound_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SOUND);
|
||||
gInventory.startBackgroundFetch(sound_folder_id);
|
||||
|
||||
// this will call refresh when we have everything.
|
||||
|
||||
@@ -488,7 +488,7 @@ void LLPreviewNotecard::onClickGetItems(void* user_data)
|
||||
gMessageSystem->addUUIDFast(_PREHASH_ObjectID, preview->getObjectID());
|
||||
gMessageSystem->nextBlockFast(_PREHASH_InventoryData);
|
||||
gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getUUID());
|
||||
gMessageSystem->addUUIDFast(_PREHASH_FolderID, gInventory.findCategoryUUIDForType(item->getType()));
|
||||
gMessageSystem->addUUIDFast(_PREHASH_FolderID, gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType())));
|
||||
gAgent.sendReliableMessage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
struct LLResourceData
|
||||
{
|
||||
LLAssetInfo mAssetInfo;
|
||||
LLAssetType::EType mPreferredLocation;
|
||||
LLFolderType::EType mPreferredLocation;
|
||||
LLInventoryType::EType mInventoryType;
|
||||
U32 mNextOwnerPerm;
|
||||
S32 mExpectedUploadCost;
|
||||
|
||||
@@ -2952,7 +2952,7 @@ bool LLSelectMgr::confirmDelete(const LLSD& notification, const LLSD& response,
|
||||
case 0:
|
||||
{
|
||||
// TODO: Make sure you have delete permissions on all of them.
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
// attempt to derez into the trash.
|
||||
LLDeRezInfo* info = new LLDeRezInfo(DRD_TRASH, trash_id);
|
||||
LLSelectMgr::getInstance()->sendListToRegions("DeRezObject",
|
||||
|
||||
@@ -2363,7 +2363,7 @@ bool idle_startup()
|
||||
system_folder->setUUID(system_folder_id);
|
||||
gSystemFolderRoot = system_folder_id;
|
||||
system_folder->setParent(LLUUID::null);
|
||||
system_folder->setPreferredType(LLAssetType::AT_NONE);
|
||||
system_folder->setPreferredType(LLFolderType::FT_NONE);
|
||||
gInventory.addCategory(system_folder);
|
||||
|
||||
LLViewerInventoryCategory* settings_folder = new LLViewerInventoryCategory(gAgent.getID());
|
||||
@@ -2373,7 +2373,7 @@ bool idle_startup()
|
||||
settings_folder->setUUID(settings_folder_id);
|
||||
gSystemFolderSettings = settings_folder_id;
|
||||
settings_folder->setParent(gSystemFolderRoot);
|
||||
settings_folder->setPreferredType(LLAssetType::AT_NONE);
|
||||
settings_folder->setPreferredType(LLFolderType::FT_NONE);
|
||||
gInventory.addCategory(settings_folder);
|
||||
|
||||
LLViewerInventoryCategory* assets_folder = new LLViewerInventoryCategory(gAgent.getID());
|
||||
@@ -2383,7 +2383,7 @@ bool idle_startup()
|
||||
assets_folder->setUUID(assets_folder_id);
|
||||
gSystemFolderAssets = assets_folder_id;
|
||||
assets_folder->setParent(gSystemFolderRoot);
|
||||
assets_folder->setPreferredType(LLAssetType::AT_NONE);
|
||||
assets_folder->setPreferredType(LLFolderType::FT_NONE);
|
||||
gInventory.addCategory(assets_folder);
|
||||
}
|
||||
// </edit>
|
||||
|
||||
@@ -1367,7 +1367,7 @@ BOOL LLTextureCtrl::handleMouseDown(S32 x, S32 y, MASK mask)
|
||||
showPicker(FALSE);
|
||||
|
||||
//grab textures first...
|
||||
gInventory.startBackgroundFetch(gInventory.findCategoryUUIDForType(LLAssetType::AT_TEXTURE));
|
||||
gInventory.startBackgroundFetch(gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE));
|
||||
//...then start full inventory fetch.
|
||||
gInventory.startBackgroundFetch();
|
||||
}
|
||||
|
||||
@@ -1348,7 +1348,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target,
|
||||
// Check if it's in the trash.
|
||||
bool is_in_trash = false;
|
||||
LLUUID trash_id;
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id))
|
||||
{
|
||||
is_in_trash = true;
|
||||
@@ -2193,7 +2193,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
|
||||
if(!item || !item->isComplete()) return ACCEPT_NO;
|
||||
|
||||
// must not be in the trash
|
||||
LLUUID trash_id(gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH));
|
||||
LLUUID trash_id(gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH));
|
||||
if( gInventory.isObjectDescendentOf( item->getUUID(), trash_id ) )
|
||||
{
|
||||
return ACCEPT_NO;
|
||||
@@ -2304,7 +2304,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand(
|
||||
|
||||
// Check if it's in the trash.
|
||||
LLUUID trash_id;
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id))
|
||||
{
|
||||
accept = ACCEPT_YES_SINGLE;
|
||||
@@ -2397,7 +2397,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject(
|
||||
|
||||
// Check if it's in the trash.
|
||||
LLUUID trash_id;
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id))
|
||||
{
|
||||
accept = ACCEPT_YES_SINGLE;
|
||||
@@ -2542,7 +2542,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem(
|
||||
if(mSource == SOURCE_AGENT || mSource == SOURCE_LIBRARY)
|
||||
{
|
||||
// it's in the agent inventory
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if( gInventory.isObjectDescendentOf( item->getUUID(), trash_id ) )
|
||||
{
|
||||
return ACCEPT_NO;
|
||||
@@ -2604,7 +2604,7 @@ EAcceptance LLToolDragAndDrop::dad3dActivateGesture(
|
||||
if(mSource == SOURCE_AGENT || mSource == SOURCE_LIBRARY)
|
||||
{
|
||||
// it's in the agent inventory
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if( gInventory.isObjectDescendentOf( item->getUUID(), trash_id ) )
|
||||
{
|
||||
return ACCEPT_NO;
|
||||
@@ -2663,7 +2663,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
|
||||
|
||||
if(mSource == SOURCE_AGENT)
|
||||
{
|
||||
LLUUID trash_id(gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH));
|
||||
LLUUID trash_id(gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH));
|
||||
if( gInventory.isObjectDescendentOf( category->getUUID(), trash_id ) )
|
||||
{
|
||||
return ACCEPT_NO;
|
||||
|
||||
113
indra/newview/llviewerassettype.cpp
Normal file
113
indra/newview/llviewerassettype.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
/**
|
||||
* @file llassettype.cpp
|
||||
* @brief Implementatino of LLViewerAssetType functionality.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2010, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llviewerassettype.h"
|
||||
#include "lldictionary.h"
|
||||
#include "llmemory.h"
|
||||
|
||||
static const std::string empty_string;
|
||||
|
||||
struct ViewerAssetEntry : public LLDictionaryEntry
|
||||
{
|
||||
ViewerAssetEntry(EDragAndDropType dad_type // drag and drop type
|
||||
)
|
||||
:
|
||||
LLDictionaryEntry(empty_string), // no reverse lookup needed for now, so just leave this blank
|
||||
mDadType(dad_type)
|
||||
{
|
||||
}
|
||||
EDragAndDropType mDadType;
|
||||
};
|
||||
|
||||
class LLViewerAssetDictionary : public LLSingleton<LLViewerAssetDictionary>,
|
||||
public LLDictionary<LLViewerAssetType::EType, ViewerAssetEntry>
|
||||
{
|
||||
public:
|
||||
LLViewerAssetDictionary();
|
||||
};
|
||||
|
||||
LLViewerAssetDictionary::LLViewerAssetDictionary()
|
||||
{
|
||||
// DRAG&DROP TYPE
|
||||
// |--------------------|
|
||||
addEntry(LLViewerAssetType::AT_TEXTURE, new ViewerAssetEntry(DAD_TEXTURE));
|
||||
addEntry(LLViewerAssetType::AT_SOUND, new ViewerAssetEntry(DAD_SOUND));
|
||||
addEntry(LLViewerAssetType::AT_CALLINGCARD, new ViewerAssetEntry(DAD_CALLINGCARD));
|
||||
addEntry(LLViewerAssetType::AT_LANDMARK, new ViewerAssetEntry(DAD_LANDMARK));
|
||||
addEntry(LLViewerAssetType::AT_SCRIPT, new ViewerAssetEntry(DAD_NONE));
|
||||
addEntry(LLViewerAssetType::AT_CLOTHING, new ViewerAssetEntry(DAD_CLOTHING));
|
||||
addEntry(LLViewerAssetType::AT_OBJECT, new ViewerAssetEntry(DAD_OBJECT));
|
||||
addEntry(LLViewerAssetType::AT_NOTECARD, new ViewerAssetEntry(DAD_NOTECARD));
|
||||
addEntry(LLViewerAssetType::AT_CATEGORY, new ViewerAssetEntry(DAD_CATEGORY));
|
||||
addEntry(LLViewerAssetType::AT_LSL_TEXT, new ViewerAssetEntry(DAD_SCRIPT));
|
||||
addEntry(LLViewerAssetType::AT_LSL_BYTECODE, new ViewerAssetEntry(DAD_NONE));
|
||||
addEntry(LLViewerAssetType::AT_TEXTURE_TGA, new ViewerAssetEntry(DAD_NONE));
|
||||
addEntry(LLViewerAssetType::AT_BODYPART, new ViewerAssetEntry(DAD_BODYPART));
|
||||
addEntry(LLViewerAssetType::AT_SOUND_WAV, new ViewerAssetEntry(DAD_NONE));
|
||||
addEntry(LLViewerAssetType::AT_IMAGE_TGA, new ViewerAssetEntry(DAD_NONE));
|
||||
addEntry(LLViewerAssetType::AT_IMAGE_JPEG, new ViewerAssetEntry(DAD_NONE));
|
||||
addEntry(LLViewerAssetType::AT_ANIMATION, new ViewerAssetEntry(DAD_ANIMATION));
|
||||
addEntry(LLViewerAssetType::AT_GESTURE, new ViewerAssetEntry(DAD_GESTURE));
|
||||
addEntry(LLViewerAssetType::AT_SIMSTATE, new ViewerAssetEntry(DAD_NONE));
|
||||
|
||||
addEntry(LLViewerAssetType::AT_LINK, new ViewerAssetEntry(DAD_LINK));
|
||||
addEntry(LLViewerAssetType::AT_LINK_FOLDER, new ViewerAssetEntry(DAD_LINK));
|
||||
|
||||
addEntry(LLViewerAssetType::AT_NONE, new ViewerAssetEntry(DAD_NONE));
|
||||
};
|
||||
|
||||
EDragAndDropType LLViewerAssetType::lookupDragAndDropType(EType asset_type)
|
||||
{
|
||||
const LLViewerAssetDictionary *dict = LLViewerAssetDictionary::getInstance();
|
||||
const ViewerAssetEntry *entry = dict->lookup(asset_type);
|
||||
if (entry)
|
||||
return entry->mDadType;
|
||||
else
|
||||
return DAD_NONE;
|
||||
}
|
||||
|
||||
// Generate a good default description
|
||||
void LLViewerAssetType::generateDescriptionFor(LLViewerAssetType::EType asset_type,
|
||||
std::string& description)
|
||||
{
|
||||
const S32 BUF_SIZE = 30;
|
||||
char time_str[BUF_SIZE]; /* Flawfinder: ignore */
|
||||
time_t now;
|
||||
time(&now);
|
||||
memset(time_str, '\0', BUF_SIZE);
|
||||
strftime(time_str, BUF_SIZE - 1, "%Y-%m-%d %H:%M:%S ", localtime(&now));
|
||||
description.assign(time_str);
|
||||
description.append(LLAssetType::lookupHumanReadable(asset_type));
|
||||
}
|
||||
55
indra/newview/llviewerassettype.h
Normal file
55
indra/newview/llviewerassettype.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @file llviewerassettype.h
|
||||
* @brief Declaration of LLViewerViewerAssetType.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2010, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* The source code in this file ("Source Code") is provided by Linden Lab
|
||||
* to you under the terms of the GNU General Public License, version 2.0
|
||||
* ("GPL"), unless you have obtained a separate licensing agreement
|
||||
* ("Other License"), formally executed by you and Linden Lab. Terms of
|
||||
* the GPL can be found in doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlife.com/developers/opensource/gplv2
|
||||
*
|
||||
* There are special exceptions to the terms and conditions of the GPL as
|
||||
* it is applied to this Source Code. View the full text of the exception
|
||||
* in the file doc/FLOSS-exception.txt in this software distribution, or
|
||||
* online at
|
||||
* http://secondlife.com/developers/opensource/flossexception
|
||||
*
|
||||
* By copying, modifying or distributing this software, you acknowledge
|
||||
* that you have read and understood your obligations described above,
|
||||
* and agree to abide by those obligations.
|
||||
*
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LL_LLVIEWERASSETTYPE_H
|
||||
#define LL_LLVIEWERASSETTYPE_H
|
||||
|
||||
#include <string>
|
||||
#include "llassettype.h"
|
||||
|
||||
// This class is similar to llassettype, but contains methods
|
||||
// only used by the viewer.
|
||||
class LLViewerAssetType : public LLAssetType
|
||||
{
|
||||
public:
|
||||
// Generate a good default description. You may want to add a verb
|
||||
// or agent name after this depending on your application.
|
||||
static void generateDescriptionFor(LLViewerAssetType::EType asset_type,
|
||||
std::string& description);
|
||||
static EDragAndDropType lookupDragAndDropType(EType asset_type);
|
||||
protected:
|
||||
LLViewerAssetType() {}
|
||||
~LLViewerAssetType() {}
|
||||
};
|
||||
|
||||
#endif // LL_LLVIEWERASSETTYPE_H
|
||||
@@ -382,7 +382,7 @@ EWearableType LLViewerInventoryItem::getWearableType() const
|
||||
|
||||
LLViewerInventoryCategory::LLViewerInventoryCategory(const LLUUID& uuid,
|
||||
const LLUUID& parent_uuid,
|
||||
LLAssetType::EType pref,
|
||||
LLFolderType::EType pref,
|
||||
const std::string& name,
|
||||
const LLUUID& owner_id) :
|
||||
LLInventoryCategory(uuid, parent_uuid, pref, name),
|
||||
@@ -441,7 +441,7 @@ void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const
|
||||
void LLViewerInventoryCategory::updateServer(BOOL is_new) const
|
||||
{
|
||||
// communicate that change with the server.
|
||||
if ( (LLAssetType::AT_NONE != mPreferredType) && (LLAssetType::AT_OUTFIT != mPreferredType) )
|
||||
if ( (LLAssetType::AT_NONE != mPreferredType) && (LLFolderType::FT_OUTFIT != mPreferredType) )
|
||||
{
|
||||
LLNotifications::instance().add("CannotModifyProtectedCategories");
|
||||
return;
|
||||
@@ -465,7 +465,7 @@ void LLViewerInventoryCategory::removeFromServer( void )
|
||||
llinfos << "Removing inventory category " << mUUID << " from server."
|
||||
<< llendl;
|
||||
// communicate that change with the server.
|
||||
if ( (LLAssetType::AT_NONE != mPreferredType) && (LLAssetType::AT_OUTFIT != mPreferredType) )
|
||||
if ( (LLAssetType::AT_NONE != mPreferredType) && (LLFolderType::FT_OUTFIT != mPreferredType) )
|
||||
{
|
||||
LLNotifications::instance().add("CannotRemoveProtectedCategories");
|
||||
return;
|
||||
@@ -584,7 +584,7 @@ bool LLViewerInventoryCategory::importFileLocal(LLFILE* fp)
|
||||
}
|
||||
else if(0 == strcmp("pref_type", keyword))
|
||||
{
|
||||
mPreferredType = LLAssetType::lookup(valuestr);
|
||||
mPreferredType = LLFolderType::assetTypeToFolderType(LLAssetType::lookup(valuestr));
|
||||
}
|
||||
else if(0 == strcmp("name", keyword))
|
||||
{
|
||||
@@ -622,7 +622,7 @@ bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const
|
||||
mParentUUID.toString(uuid_str);
|
||||
fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str());
|
||||
fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
|
||||
fprintf(fp, "\t\tpref_type\t%s\n", LLAssetType::lookup(mPreferredType));
|
||||
fprintf(fp, "\t\tpref_type\t%s\n", LLFolderType::lookup(mPreferredType).c_str());
|
||||
fprintf(fp, "\t\tname\t%s|\n", mName.c_str());
|
||||
mOwnerID.toString(uuid_str);
|
||||
fprintf(fp, "\t\towner_id\t%s\n", uuid_str.c_str());
|
||||
@@ -932,7 +932,7 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar
|
||||
body["notecard-id"] = notecard_inv_id;
|
||||
body["object-id"] = object_id;
|
||||
body["item-id"] = src->getUUID();
|
||||
body["folder-id"] = gInventory.findCategoryUUIDForType(src->getType());
|
||||
body["folder-id"] = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(src->getType()));
|
||||
body["callback-id"] = (LLSD::Integer)callback_id;
|
||||
|
||||
LLHTTPClient::post(url, body, new LLCopyInventoryFromNotecardResponder());
|
||||
|
||||
@@ -169,7 +169,7 @@ protected:
|
||||
|
||||
public:
|
||||
LLViewerInventoryCategory(const LLUUID& uuid, const LLUUID& parent_uuid,
|
||||
LLAssetType::EType preferred_type,
|
||||
LLFolderType::EType preferred_type,
|
||||
const std::string& name,
|
||||
const LLUUID& owner_id);
|
||||
LLViewerInventoryCategory(const LLUUID& owner_id);
|
||||
|
||||
@@ -4345,19 +4345,19 @@ BOOL enable_deed_object_to_group(void*)
|
||||
* No longer able to support viewer side manipulations in this way
|
||||
*
|
||||
void god_force_inv_owner_permissive(LLViewerObject* object,
|
||||
InventoryObjectList* inventory,
|
||||
LLInventoryObject::object_list_t* inventory,
|
||||
S32 serial_num,
|
||||
void*)
|
||||
{
|
||||
typedef std::vector<LLPointer<LLViewerInventoryItem> > item_array_t;
|
||||
item_array_t items;
|
||||
|
||||
InventoryObjectList::const_iterator inv_it = inventory->begin();
|
||||
InventoryObjectList::const_iterator inv_end = inventory->end();
|
||||
LLInventoryObject::object_list_t::const_iterator inv_it = inventory->begin();
|
||||
LLInventoryObject::object_list_t::const_iterator inv_end = inventory->end();
|
||||
for ( ; inv_it != inv_end; ++inv_it)
|
||||
{
|
||||
if(((*inv_it)->getType() != LLAssetType::AT_CATEGORY)
|
||||
&& ((*inv_it)->getType() != LLAssetType::AT_ROOT_CATEGORY))
|
||||
&& ((*inv_it)->getType() != LLFolderType::FT_ROOT_CATEGORY))
|
||||
{
|
||||
LLInventoryObject* obj = *inv_it;
|
||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem((LLViewerInventoryItem*)obj);
|
||||
@@ -4686,7 +4686,7 @@ class LLToolsTakeCopy : public view_listener_t
|
||||
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (!rlvCanDeleteOrReturn()) ) return true;
|
||||
// [/RLVa:KB]
|
||||
|
||||
const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
|
||||
const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
|
||||
derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id);
|
||||
|
||||
return true;
|
||||
@@ -4781,7 +4781,7 @@ class LLObjectEnableReturn : public view_listener_t
|
||||
void force_take_copy(void*)
|
||||
{
|
||||
if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return;
|
||||
const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
|
||||
const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
|
||||
derez_objects(DRD_FORCE_TO_GOD_INVENTORY, category_id);
|
||||
}
|
||||
|
||||
@@ -4846,7 +4846,7 @@ void handle_take()
|
||||
{
|
||||
// check trash
|
||||
LLUUID trash;
|
||||
trash = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
trash = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if(category_id == trash || gInventory.isObjectDescendentOf(category_id, trash))
|
||||
{
|
||||
category_id.setNull();
|
||||
@@ -4862,7 +4862,7 @@ void handle_take()
|
||||
}
|
||||
if(category_id.isNull())
|
||||
{
|
||||
category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
|
||||
category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);
|
||||
}
|
||||
LLSD payload;
|
||||
payload["folder_id"] = category_id;
|
||||
@@ -6032,7 +6032,7 @@ class LLWorldCreateLandmark : public view_listener_t
|
||||
}
|
||||
|
||||
LLUUID folder_id;
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
|
||||
std::string pos_string;
|
||||
gAgent.buildLocationString(pos_string);
|
||||
|
||||
@@ -8733,7 +8733,7 @@ void handle_grab_texture(void* data)
|
||||
LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl;
|
||||
LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;
|
||||
LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;
|
||||
LLUUID folder_id(gInventory.findCategoryUUIDForType(asset_type));
|
||||
LLUUID folder_id(gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE));
|
||||
if(folder_id.notNull())
|
||||
{
|
||||
std::string name = "Baked ";
|
||||
|
||||
@@ -400,7 +400,7 @@ class LLFileUploadBulk : public view_listener_t
|
||||
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
|
||||
void *userdata = NULL;
|
||||
gSavedSettings.setBOOL("TemporaryUpload", enabled);
|
||||
upload_new_resource(filename, asset_name, asset_name, 0, LLAssetType::AT_NONE, LLInventoryType::IT_NONE,
|
||||
upload_new_resource(filename, asset_name, asset_name, 0, LLFolderType::FT_NONE, LLInventoryType::IT_NONE,
|
||||
LLFloaterPerms::getNextOwnerPerms(), LLFloaterPerms::getGroupPerms(), LLFloaterPerms::getEveryonePerms(),
|
||||
display_name, callback, expected_upload_cost, userdata);
|
||||
|
||||
@@ -623,7 +623,7 @@ static void handle_compress_image_continued(AIFilePicker* filepicker)
|
||||
|
||||
void upload_new_resource(const std::string& src_filename, std::string name,
|
||||
std::string desc, S32 compression_info,
|
||||
LLAssetType::EType destination_folder_type,
|
||||
LLFolderType::EType destination_folder_type,
|
||||
LLInventoryType::EType inv_type,
|
||||
U32 next_owner_perms,
|
||||
U32 group_perms,
|
||||
@@ -760,7 +760,7 @@ void upload_new_resource(const std::string& src_filename, std::string name,
|
||||
{
|
||||
// read in the file header
|
||||
char buf[16384]; /* Flawfinder: ignore */
|
||||
S32 read; /* Flawfinder: ignore */
|
||||
size_t readbytes;
|
||||
S32 version;
|
||||
if (fscanf(in, "LindenResource\nversion %d\n", &version))
|
||||
{
|
||||
@@ -843,9 +843,9 @@ void upload_new_resource(const std::string& src_filename, std::string name,
|
||||
LLFILE* out = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
|
||||
if (out)
|
||||
{
|
||||
while((read = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */
|
||||
while((readbytes = fread(buf, 1, 16384, in))) /* Flawfinder: ignore */
|
||||
{
|
||||
if (fwrite(buf, 1, read, out) != read)
|
||||
if (fwrite(buf, 1, readbytes, out) != readbytes)
|
||||
{
|
||||
llwarns << "Short write" << llendl;
|
||||
}
|
||||
@@ -940,7 +940,7 @@ void upload_new_resource(const std::string& src_filename, std::string name,
|
||||
else if(exten == "notecard") inv_type = LLInventoryType::IT_NOTECARD;
|
||||
create_inventory_item( gAgent.getID(),
|
||||
gAgent.getSessionID(),
|
||||
gInventory.findCategoryUUIDForType(asset_type),
|
||||
gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type)),
|
||||
LLTransactionID::tnull,
|
||||
name,
|
||||
uuid.asString(), // fake asset id, but in vfs
|
||||
@@ -989,7 +989,7 @@ void temp_upload_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
|
||||
perms->setMaskGroup(PERM_ALL);
|
||||
perms->setMaskNext(PERM_ALL);
|
||||
|
||||
LLUUID destination = gInventory.findCategoryUUIDForType(LLAssetType::AT_TEXTURE);
|
||||
LLUUID destination = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE);
|
||||
BOOL bUseSystemInventory = (gSavedSettings.getBOOL("AscentUseSystemFolder") && gSavedSettings.getBOOL("AscentSystemTemporary"));
|
||||
if (bUseSystemInventory)
|
||||
{
|
||||
@@ -1037,9 +1037,15 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
|
||||
//LLAssetType::EType pref_loc = data->mPreferredLocation;
|
||||
BOOL is_balance_sufficient = TRUE;
|
||||
|
||||
if(!data)
|
||||
{
|
||||
LLUploadDialog::modalUploadFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
if(result >= 0)
|
||||
{
|
||||
LLAssetType::EType dest_loc = (data->mPreferredLocation == LLAssetType::AT_NONE) ? data->mAssetInfo.mType : data->mPreferredLocation;
|
||||
LLFolderType::EType dest_loc = (data->mPreferredLocation == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(data->mAssetInfo.mType) : data->mPreferredLocation;
|
||||
|
||||
if (LLAssetType::AT_SOUND == data->mAssetInfo.mType ||
|
||||
LLAssetType::AT_TEXTURE == data->mAssetInfo.mType ||
|
||||
@@ -1085,7 +1091,7 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
|
||||
{
|
||||
// Actually add the upload to inventory
|
||||
llinfos << "Adding " << uuid << " to inventory." << llendl;
|
||||
LLUUID folder_id(gInventory.findCategoryUUIDForType(dest_loc));
|
||||
const LLUUID folder_id = gInventory.findCategoryUUIDForType(dest_loc);
|
||||
if(folder_id.notNull())
|
||||
{
|
||||
U32 next_owner_perms = data->mNextOwnerPerm;
|
||||
@@ -1115,12 +1121,13 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
|
||||
|
||||
LLUploadDialog::modalUploadFinished();
|
||||
delete data;
|
||||
data = NULL;
|
||||
}
|
||||
|
||||
void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type,
|
||||
std::string name,
|
||||
std::string desc, S32 compression_info,
|
||||
LLAssetType::EType destination_folder_type,
|
||||
LLFolderType::EType destination_folder_type,
|
||||
LLInventoryType::EType inv_type,
|
||||
U32 next_owner_perms,
|
||||
U32 group_perms,
|
||||
@@ -1178,7 +1185,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
|
||||
llinfos << "Name: " << name << llendl;
|
||||
llinfos << "Desc: " << desc << llendl;
|
||||
llinfos << "Expected Upload Cost: " << expected_upload_cost << llendl;
|
||||
lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type) << llendl;
|
||||
lldebugs << "Folder: " << gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type) << llendl;
|
||||
lldebugs << "Asset Type: " << LLAssetType::lookup(asset_type) << llendl;
|
||||
std::string url = gAgent.getRegion()->getCapability("NewFileAgentInventory");
|
||||
// <edit>
|
||||
@@ -1189,7 +1196,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty
|
||||
{
|
||||
llinfos << "New Agent Inventory via capability" << llendl;
|
||||
LLSD body;
|
||||
body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type);
|
||||
body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type);
|
||||
body["asset_type"] = LLAssetType::lookup(asset_type);
|
||||
body["inventory_type"] = LLInventoryType::lookup(inv_type);
|
||||
body["name"] = name;
|
||||
|
||||
@@ -53,7 +53,7 @@ void upload_new_resource(const std::string& src_filename,
|
||||
std::string name,
|
||||
std::string desc,
|
||||
S32 compression_info,
|
||||
LLAssetType::EType destination_folder_type,
|
||||
LLFolderType::EType destination_folder_type,
|
||||
LLInventoryType::EType inv_type,
|
||||
U32 next_owner_perms,
|
||||
U32 group_perms,
|
||||
@@ -68,7 +68,7 @@ void upload_new_resource(const LLTransactionID &tid,
|
||||
std::string name,
|
||||
std::string desc,
|
||||
S32 compression_info,
|
||||
LLAssetType::EType destination_folder_type,
|
||||
LLFolderType::EType destination_folder_type,
|
||||
LLInventoryType::EType inv_type,
|
||||
U32 next_owner_perms,
|
||||
U32 group_perms,
|
||||
|
||||
@@ -113,6 +113,7 @@
|
||||
#include "lltoolbar.h"
|
||||
#include "lltoolmgr.h"
|
||||
#include "lltrans.h"
|
||||
#include "llfoldertype.h"
|
||||
#include "llui.h" // for make_ui_sound
|
||||
#include "lluploaddialog.h"
|
||||
#include "llviewercamera.h"
|
||||
@@ -304,16 +305,16 @@ template<> bool SH_SpamHandler<std::string>::isAgent(const std::string &owner)
|
||||
bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotification::getSelectedOption(notification, response);
|
||||
LLUUID fid;
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
const LLSD& payload = notification["payload"];
|
||||
switch(option)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
// accept
|
||||
LLAvatarTracker::formFriendship(payload["from_id"]);
|
||||
|
||||
fid = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
|
||||
const LLUUID fid = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
|
||||
|
||||
// This will also trigger an onlinenotification if the user is online
|
||||
msg->newMessageFast(_PREHASH_AcceptFriendship);
|
||||
@@ -326,6 +327,7 @@ bool friendship_offer_callback(const LLSD& notification, const LLSD& response)
|
||||
msg->addUUIDFast(_PREHASH_FolderID, fid);
|
||||
msg->sendReliable(LLHost(payload["sender"].asString()));
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
// decline
|
||||
// We no longer notify other viewers, but we DO still send
|
||||
@@ -862,8 +864,7 @@ public:
|
||||
virtual void done()
|
||||
{
|
||||
LL_DEBUGS("Messaging") << "LLDiscardAgentOffer::done()" << LL_ENDL;
|
||||
LLUUID trash_id;
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
bool notify = false;
|
||||
if(trash_id.notNull() && mObjectID.notNull())
|
||||
{
|
||||
@@ -1024,12 +1025,12 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name)
|
||||
}
|
||||
//Trash Check
|
||||
LLUUID trash_id;
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH);
|
||||
trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id))
|
||||
{
|
||||
return;
|
||||
}
|
||||
LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND);
|
||||
LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
|
||||
//BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view);
|
||||
BOOL user_is_away = gAwayTimer.getStarted();
|
||||
|
||||
@@ -1070,14 +1071,14 @@ bool highlight_offered_object(const LLUUID& obj_id)
|
||||
const LLViewerInventoryCategory *parent = gInventory.getFirstNondefaultParent(obj_id);
|
||||
if (parent)
|
||||
{
|
||||
const LLAssetType::EType parent_type = parent->getPreferredType();
|
||||
const LLFolderType::EType parent_type = parent->getPreferredType();
|
||||
switch (parent_type)
|
||||
{
|
||||
case LLAssetType::AT_TRASH:
|
||||
case LLAssetType::AT_LOST_AND_FOUND:
|
||||
case LLAssetType::AT_CURRENT_OUTFIT:
|
||||
case LLAssetType::AT_OUTFIT:
|
||||
case LLAssetType::AT_MY_OUTFITS:
|
||||
case LLFolderType::FT_TRASH:
|
||||
case LLFolderType::FT_LOST_AND_FOUND:
|
||||
case LLFolderType::FT_CURRENT_OUTFIT:
|
||||
case LLFolderType::FT_OUTFIT:
|
||||
case LLFolderType::FT_MY_OUTFITS:
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
@@ -2190,7 +2191,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
||||
info->mFromGroup = from_group;
|
||||
info->mTransactionID = session_id;
|
||||
info->mType = (LLAssetType::EType) asset_type;
|
||||
info->mFolderID = gInventory.findCategoryUUIDForType(info->mType);
|
||||
info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType));
|
||||
std::string from_name;
|
||||
|
||||
from_name += "A group member named ";
|
||||
@@ -2331,7 +2332,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
||||
info->mFromID = from_id;
|
||||
info->mFromGroup = from_group;
|
||||
info->mTransactionID = session_id;
|
||||
info->mFolderID = gInventory.findCategoryUUIDForType(info->mType);
|
||||
info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType));
|
||||
|
||||
if (dialog == IM_TASK_INVENTORY_OFFERED)
|
||||
{
|
||||
@@ -2831,7 +2832,7 @@ bool callingcard_offer_callback(const LLSD& notification, const LLSD& response)
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
msg->nextBlockFast(_PREHASH_TransactionBlock);
|
||||
msg->addUUIDFast(_PREHASH_TransactionID, notification["payload"]["transaction_id"].asUUID());
|
||||
fid = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
|
||||
fid = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
|
||||
msg->nextBlockFast(_PREHASH_FolderData);
|
||||
msg->addUUIDFast(_PREHASH_FolderID, fid);
|
||||
msg->sendReliable(LLHost(notification["payload"]["sender"].asString()));
|
||||
@@ -3653,10 +3654,10 @@ BOOL LLPostTeleportNotifiers::tick()
|
||||
// get callingcards and landmarks available to the user arriving.
|
||||
LLInventoryFetchDescendentsObserver::folder_ref_t folders;
|
||||
LLUUID folder_id;
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CALLINGCARD);
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD);
|
||||
if(folder_id.notNull())
|
||||
folders.push_back(folder_id);
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
|
||||
folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
|
||||
if(folder_id.notNull())
|
||||
folders.push_back(folder_id);
|
||||
if(!folders.empty())
|
||||
@@ -5943,15 +5944,14 @@ void container_inventory_arrived(LLViewerObject* object,
|
||||
// create a new inventory category to put this in
|
||||
LLUUID cat_id;
|
||||
cat_id = gInventory.createNewCategory(gAgent.getInventoryRootID(),
|
||||
LLAssetType::AT_NONE,
|
||||
LLFolderType::FT_NONE,
|
||||
std::string("Acquired Items")); //TODO: Translate
|
||||
|
||||
LLInventoryObject::object_list_t::const_iterator it = inventory->begin();
|
||||
LLInventoryObject::object_list_t::const_iterator end = inventory->end();
|
||||
for ( ; it != end; ++it)
|
||||
{
|
||||
if ((*it)->getType() != LLAssetType::AT_CATEGORY &&
|
||||
(*it)->getType() != LLAssetType::AT_ROOT_CATEGORY)
|
||||
if ((*it)->getType() != LLAssetType::AT_CATEGORY)
|
||||
{
|
||||
LLInventoryObject* obj = (LLInventoryObject*)(*it);
|
||||
LLInventoryItem* item = (LLInventoryItem*)(obj);
|
||||
@@ -5984,16 +5984,15 @@ void container_inventory_arrived(LLViewerObject* object,
|
||||
{
|
||||
// we're going to get one fake root category as well as the
|
||||
// one actual object
|
||||
InventoryObjectList::iterator it = inventory->begin();
|
||||
LLInventoryObject::object_list_t::iterator it = inventory->begin();
|
||||
|
||||
if ((*it)->getType() == LLAssetType::AT_CATEGORY ||
|
||||
(*it)->getType() == LLAssetType::AT_ROOT_CATEGORY)
|
||||
if ((*it)->getType() == LLAssetType::AT_CATEGORY)
|
||||
{
|
||||
++it;
|
||||
}
|
||||
|
||||
LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
|
||||
LLUUID category = gInventory.findCategoryUUIDForType(item->getType());
|
||||
const LLUUID category = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType()));
|
||||
|
||||
LLUUID item_id;
|
||||
item_id.generate();
|
||||
@@ -6295,7 +6294,7 @@ void handle_lure(const LLUUID& invitee)
|
||||
}
|
||||
|
||||
// Prompt for a message to the invited user.
|
||||
void handle_lure(LLDynamicArray<LLUUID>& ids)
|
||||
void handle_lure(const uuid_vec_t& ids)
|
||||
{
|
||||
if (ids.empty()) return;
|
||||
|
||||
@@ -6308,7 +6307,7 @@ void handle_lure(LLDynamicArray<LLUUID>& ids)
|
||||
//edit_args["REGION"] = gAgent.getRegion()->getName();
|
||||
|
||||
LLSD payload;
|
||||
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
|
||||
for (uuid_vec_t::const_iterator it = ids.begin();
|
||||
it != ids.end();
|
||||
++it)
|
||||
{
|
||||
|
||||
@@ -127,7 +127,7 @@ void process_frozen_message(LLMessageSystem* msg, void**);
|
||||
|
||||
void process_derez_container(LLMessageSystem *msg, void**);
|
||||
void container_inventory_arrived(LLViewerObject* object,
|
||||
std::list<LLPointer<LLInventoryObject> >* inventory, //InventoryObjectList
|
||||
std::list<LLPointer<LLInventoryObject> >* inventory, //LLInventoryObject::object_list_t
|
||||
S32 serial_num,
|
||||
void* data);
|
||||
|
||||
@@ -155,7 +155,7 @@ void send_group_notice(const LLUUID& group_id,
|
||||
const LLInventoryItem* item);
|
||||
|
||||
void handle_lure(const LLUUID& invitee);
|
||||
void handle_lure(LLDynamicArray<LLUUID>& ids);
|
||||
void handle_lure(const uuid_vec_t& ids);
|
||||
|
||||
// always from gAgent and
|
||||
// routes through the gAgent's current simulator
|
||||
|
||||
@@ -405,7 +405,7 @@ public:
|
||||
void updateInventory(LLViewerInventoryItem* item, U8 key, bool is_new);
|
||||
void updateInventoryLocal(LLInventoryItem* item, U8 key); // Update without messaging.
|
||||
LLInventoryObject* getInventoryObject(const LLUUID& item_id);
|
||||
void getInventoryContents(InventoryObjectList& objects);
|
||||
void getInventoryContents(LLInventoryObject::object_list_t& objects);
|
||||
LLInventoryObject* getInventoryRoot();
|
||||
LLViewerInventoryItem* getInventoryItemByAsset(const LLUUID& asset_id);
|
||||
S16 getInventorySerial() const { return mInventorySerialNum; }
|
||||
|
||||
@@ -1110,7 +1110,7 @@ void LLObjectBackup::updateMap(LLUUID uploaded_asset)
|
||||
|
||||
void myupload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type,
|
||||
std::string name, std::string desc, S32 compression_info,
|
||||
LLAssetType::EType destination_folder_type,
|
||||
LLFolderType::EType destination_folder_type,
|
||||
LLInventoryType::EType inv_type, U32 next_owner_perm,
|
||||
const std::string& display_name,
|
||||
LLAssetStorage::LLStoreAssetCallback callback,
|
||||
@@ -1132,7 +1132,7 @@ void myupload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_
|
||||
if (!url.empty())
|
||||
{
|
||||
LLSD body;
|
||||
body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLAssetType::AT_NONE) ? asset_type : destination_folder_type);
|
||||
body["folder_id"] = gInventory.findCategoryUUIDForType((destination_folder_type == LLFolderType::FT_NONE) ? LLFolderType::assetTypeToFolderType(asset_type) : destination_folder_type);
|
||||
body["asset_type"] = LLAssetType::lookup(asset_type);
|
||||
body["inventory_type"] = LLInventoryType::lookup(inv_type);
|
||||
body["name"] = name;
|
||||
@@ -1203,6 +1203,6 @@ void LLObjectBackup::uploadNextAsset()
|
||||
}
|
||||
|
||||
myupload_new_resource(tid, LLAssetType::AT_TEXTURE, struid, struid, 0,
|
||||
LLAssetType::AT_TEXTURE, LLInventoryType::defaultForAssetType(LLAssetType::AT_TEXTURE),
|
||||
LLFolderType::FT_TEXTURE, LLInventoryType::defaultForAssetType(LLAssetType::AT_TEXTURE),
|
||||
0x0, "Uploaded texture", NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#include "llnotecard.h"
|
||||
#include "llmemorystream.h"
|
||||
#include "llmenugl.h"
|
||||
#include "llviewerassettype.h"
|
||||
|
||||
#include "llappviewer.h" // for gPacificDaylightTime
|
||||
|
||||
@@ -835,7 +836,7 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask)
|
||||
if( LLToolDragAndDrop::getInstance()->isOverThreshold( screen_x, screen_y ) )
|
||||
{
|
||||
LLToolDragAndDrop::getInstance()->beginDrag(
|
||||
LLAssetType::lookupDragAndDropType( mDragItem->getType() ),
|
||||
LLViewerAssetType::lookupDragAndDropType( mDragItem->getType() ),
|
||||
mDragItem->getUUID(),
|
||||
LLToolDragAndDrop::SOURCE_NOTECARD,
|
||||
getSourceID(), mObjectID);
|
||||
|
||||
@@ -60,7 +60,8 @@ enum EWearableType // If you change this, update LLWearable::getTypeName(), get
|
||||
WT_TATTOO = 14,
|
||||
WT_PHYSICS = 15,
|
||||
WT_COUNT = 16,
|
||||
WT_INVALID = 255
|
||||
WT_INVALID = 255,
|
||||
WT_NONE = -1,
|
||||
};
|
||||
|
||||
class LLWearable
|
||||
|
||||
@@ -438,7 +438,7 @@ void RlvRenameOnWearObserver::doneIdle()
|
||||
else
|
||||
{
|
||||
// "No modify" item with a non-renameable parent: create a new folder named and move the item into it
|
||||
LLUUID idAttachFolder = gInventory.createNewCategory(pFolder->getUUID(), LLAssetType::AT_NONE, strFolderName);
|
||||
LLUUID idAttachFolder = gInventory.createNewCategory(pFolder->getUUID(), LLFolderType::FT_NONE, strFolderName);
|
||||
move_inventory_item(gAgent.getID(), gAgent.getSessionID(), pItem->getUUID(), idAttachFolder, std::string(), NULL);
|
||||
}
|
||||
}
|
||||
@@ -712,7 +712,7 @@ bool RlvWearableItemCollector::onCollectItem(const LLInventoryItem* pItem)
|
||||
const LLUUID& idLinkedFolder = pItem->getLinkedUUID();
|
||||
LLViewerInventoryCategory* pLinkedFolder = gInventory.getCategory(idLinkedFolder);
|
||||
// Link can't point to an outfit folder, or start a second level of indirection, or have the base folder as an ancestor
|
||||
if ( (pLinkedFolder) && (LLAssetType::AT_OUTFIT != pLinkedFolder->getPreferredType()) &&
|
||||
if ( (pLinkedFolder) && (LLFolderType::FT_OUTFIT != pLinkedFolder->getPreferredType()) &&
|
||||
(gInventory.isObjectDescendentOf(pItem->getUUID(), m_idFolder)) &&
|
||||
(!gInventory.isObjectDescendentOf(idLinkedFolder, m_idFolder)) )
|
||||
{
|
||||
|
||||
@@ -140,7 +140,7 @@ void AIFetchInventoryFolder::multiplex_impl(void)
|
||||
break;
|
||||
}
|
||||
// Create the folder.
|
||||
mFolderUUID = gInventory.createNewCategory(mParentFolder, LLAssetType::AT_NONE, mFolderName);
|
||||
mFolderUUID = gInventory.createNewCategory(mParentFolder, LLFolderType::FT_NONE, mFolderName);
|
||||
llassert_always(!mFolderUUID.isNull());
|
||||
Dout(dc::statemachine, "Created folder \"" << mFolderName << "\".");
|
||||
mNeedNotifyObservers = true;
|
||||
|
||||
Reference in New Issue
Block a user