Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
This commit is contained in:
@@ -691,7 +691,7 @@ public:
|
|||||||
|
|
||||||
if (lt != 0x7)
|
if (lt != 0x7)
|
||||||
{
|
{
|
||||||
OCT_ERRS << "!!! ELEMENT EXCEEDS RANGE OF SPATIAL PARTITION !!!" << llendl;
|
//OCT_ERRS << "!!! ELEMENT EXCEEDS RANGE OF SPATIAL PARTITION !!!" << llendl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1446,6 +1446,8 @@ void LLRender::loadIdentity()
|
|||||||
flush();
|
flush();
|
||||||
|
|
||||||
{
|
{
|
||||||
|
llassert_always(mMatrixMode < NUM_MATRIX_MODES) ;
|
||||||
|
|
||||||
mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
|
mMatrix[mMatrixMode][mMatIdx[mMatrixMode]].make_identity();
|
||||||
mMatHash[mMatrixMode]++;
|
mMatHash[mMatrixMode]++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -543,22 +543,32 @@ LLView* LLMultiSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFa
|
|||||||
S32 max_sliders = 1;
|
S32 max_sliders = 1;
|
||||||
node->getAttributeS32("max_sliders", max_sliders);
|
node->getAttributeS32("max_sliders", max_sliders);
|
||||||
|
|
||||||
|
S32 value_width = 0;
|
||||||
|
node->getAttributeS32("val_width", value_width);
|
||||||
|
|
||||||
S32 text_left = 0;
|
S32 text_left = 0;
|
||||||
if (show_text)
|
if (show_text)
|
||||||
{
|
{
|
||||||
// calculate the size of the text box (log max_value is number of digits - 1 so plus 1)
|
if(value_width > 0)
|
||||||
if ( max_value )
|
{
|
||||||
text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 );
|
//Fixed width. Be wary of precision and sign causing text to take more space than expected!
|
||||||
|
text_left = value_width;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// calculate the size of the text box (log max_value is number of digits - 1 so plus 1)
|
||||||
|
if ( max_value )
|
||||||
|
text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 );
|
||||||
|
|
||||||
if ( increment < 1.0f )
|
if ( increment < 1.0f )
|
||||||
text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value
|
text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value
|
||||||
|
|
||||||
if ( min_value < 0.0f || max_value < 0.0f )
|
if ( min_value < 0.0f || max_value < 0.0f )
|
||||||
text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign
|
text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign
|
||||||
|
|
||||||
// padding to make things look nicer
|
// padding to make things look nicer
|
||||||
text_left += 8;
|
text_left += 8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLUICtrlCallback callback = NULL;
|
LLUICtrlCallback callback = NULL;
|
||||||
|
|||||||
@@ -455,21 +455,32 @@ LLView* LLSliderCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory
|
|||||||
U32 precision = 3;
|
U32 precision = 3;
|
||||||
node->getAttributeU32("decimal_digits", precision);
|
node->getAttributeU32("decimal_digits", precision);
|
||||||
|
|
||||||
|
S32 value_width = 0;
|
||||||
|
node->getAttributeS32("val_width", value_width);
|
||||||
|
|
||||||
S32 text_left = 0;
|
S32 text_left = 0;
|
||||||
if (show_text)
|
if (show_text)
|
||||||
{
|
{
|
||||||
// calculate the size of the text box (log max_value is number of digits - 1 so plus 1)
|
if(value_width > 0)
|
||||||
if ( max_value )
|
{
|
||||||
text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 );
|
//Fixed width. Be wary of precision and sign causing text to take more space than expected!
|
||||||
|
text_left = value_width;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// calculate the size of the text box (log max_value is number of digits - 1 so plus 1)
|
||||||
|
if ( max_value )
|
||||||
|
text_left = font->getWidth(std::string("0")) * ( static_cast < S32 > ( log10 ( max_value ) ) + precision + 1 );
|
||||||
|
|
||||||
if ( increment < 1.0f )
|
if ( increment < 1.0f )
|
||||||
text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value
|
text_left += font->getWidth(std::string(".")); // (mostly) take account of decimal point in value
|
||||||
|
|
||||||
if ( min_value < 0.0f || max_value < 0.0f )
|
if ( min_value < 0.0f || max_value < 0.0f )
|
||||||
text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign
|
text_left += font->getWidth(std::string("-")); // (mostly) take account of minus sign
|
||||||
|
|
||||||
// padding to make things look nicer
|
// padding to make things look nicer
|
||||||
text_left += 8;
|
text_left += 8;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLUICtrlCallback callback = NULL;
|
LLUICtrlCallback callback = NULL;
|
||||||
|
|||||||
@@ -290,8 +290,10 @@ set(viewer_SOURCE_FILES
|
|||||||
llinventorybackup.cpp
|
llinventorybackup.cpp
|
||||||
llinventorybridge.cpp
|
llinventorybridge.cpp
|
||||||
llinventoryclipboard.cpp
|
llinventoryclipboard.cpp
|
||||||
|
llinventoryfunctions.cpp
|
||||||
llinventoryicon.cpp
|
llinventoryicon.cpp
|
||||||
llinventorymodel.cpp
|
llinventorymodel.cpp
|
||||||
|
llinventoryobserver.cpp
|
||||||
llinventoryview.cpp
|
llinventoryview.cpp
|
||||||
lljoystickbutton.cpp
|
lljoystickbutton.cpp
|
||||||
lllandmarklist.cpp
|
lllandmarklist.cpp
|
||||||
@@ -759,8 +761,10 @@ set(viewer_HEADER_FILES
|
|||||||
llinventorybackup.h
|
llinventorybackup.h
|
||||||
llinventorybridge.h
|
llinventorybridge.h
|
||||||
llinventoryclipboard.h
|
llinventoryclipboard.h
|
||||||
|
llinventoryfunctions.h
|
||||||
llinventoryicon.h
|
llinventoryicon.h
|
||||||
llinventorymodel.h
|
llinventorymodel.h
|
||||||
|
llinventoryobserver.h
|
||||||
llinventoryview.h
|
llinventoryview.h
|
||||||
lljoystickbutton.h
|
lljoystickbutton.h
|
||||||
lllandmarklist.h
|
lllandmarklist.h
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
#include "llagentwearables.h"
|
#include "llagentwearables.h"
|
||||||
#include "llcommonutils.h"
|
#include "llcommonutils.h"
|
||||||
#include "llerror.h"
|
#include "llerror.h"
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
|
#include "llinventoryobserver.h"
|
||||||
#include "llvoavatarself.h"
|
#include "llvoavatarself.h"
|
||||||
#include "rlvviewer2.h"
|
#include "rlvviewer2.h"
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "llfirstuse.h"
|
#include "llfirstuse.h"
|
||||||
|
|
||||||
#include "llinventory.h"
|
#include "llinventory.h"
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
#include "roles_constants.h"
|
#include "roles_constants.h"
|
||||||
#include "llviewerregion.h"
|
#include "llviewerregion.h"
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
#include "llbutton.h"
|
#include "llbutton.h"
|
||||||
//#include "llinventory.h"
|
//#include "llinventory.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventorymodel.h"
|
||||||
|
#include "llinventoryobserver.h"
|
||||||
#include "llnotifications.h"
|
#include "llnotifications.h"
|
||||||
#include "llnotificationsutil.h"
|
#include "llnotificationsutil.h"
|
||||||
#include "llresmgr.h"
|
#include "llresmgr.h"
|
||||||
|
|||||||
@@ -52,7 +52,8 @@
|
|||||||
#include "llsliderctrl.h"
|
#include "llsliderctrl.h"
|
||||||
#include "lltabcontainervertical.h"
|
#include "lltabcontainervertical.h"
|
||||||
#include "llviewerwindow.h"
|
#include "llviewerwindow.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
|
#include "llinventoryobserver.h"
|
||||||
#include "llinventoryicon.h"
|
#include "llinventoryicon.h"
|
||||||
#include "lltextbox.h"
|
#include "lltextbox.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
@@ -1041,7 +1042,7 @@ void LLPanelEditWearable::draw()
|
|||||||
|
|
||||||
std::string path;
|
std::string path;
|
||||||
const LLUUID& item_id = gAgentWearables.getWearableItemID( wearable->getType() );
|
const LLUUID& item_id = gAgentWearables.getWearableItemID( wearable->getType() );
|
||||||
gInventory.appendPath(item_id, path);
|
append_path(item_id, path);
|
||||||
childSetVisible("path", TRUE);
|
childSetVisible("path", TRUE);
|
||||||
childSetTextArg("path", "[PATH]", path);
|
childSetTextArg("path", "[PATH]", path);
|
||||||
|
|
||||||
@@ -1054,7 +1055,7 @@ void LLPanelEditWearable::draw()
|
|||||||
|
|
||||||
std::string path;
|
std::string path;
|
||||||
const LLUUID& item_id = gAgentWearables.getWearableItemID( wearable->getType() );
|
const LLUUID& item_id = gAgentWearables.getWearableItemID( wearable->getType() );
|
||||||
gInventory.appendPath(item_id, path);
|
append_path(item_id, path);
|
||||||
childSetVisible("path", TRUE);
|
childSetVisible("path", TRUE);
|
||||||
childSetTextArg("path", "[PATH]", path);
|
childSetTextArg("path", "[PATH]", path);
|
||||||
|
|
||||||
@@ -2785,7 +2786,7 @@ public:
|
|||||||
void LLFloaterCustomize::fetchInventory()
|
void LLFloaterCustomize::fetchInventory()
|
||||||
{
|
{
|
||||||
// Fetch currently worn items
|
// Fetch currently worn items
|
||||||
LLInventoryFetchObserver::item_ref_t ids;
|
uuid_vec_t ids;
|
||||||
LLUUID item_id;
|
LLUUID item_id;
|
||||||
for(S32 type = (S32)LLWearableType::WT_SHAPE; type < (S32)LLWearableType::WT_COUNT; ++type)
|
for(S32 type = (S32)LLWearableType::WT_SHAPE; type < (S32)LLWearableType::WT_COUNT; ++type)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
#include "llviewerparcelmgr.h"
|
#include "llviewerparcelmgr.h"
|
||||||
#include "llfolderview.h"
|
#include "llfolderview.h"
|
||||||
#include "llinventory.h"
|
#include "llinventory.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
#include "llviewerinventory.h"
|
#include "llviewerinventory.h"
|
||||||
#include "llpermissions.h"
|
#include "llpermissions.h"
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
#include "llappviewer.h"
|
#include "llappviewer.h"
|
||||||
#include "llmapimagetype.h"
|
#include "llmapimagetype.h"
|
||||||
#include "llweb.h"
|
#include "llweb.h"
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
|
|
||||||
#include "llglheaders.h"
|
#include "llglheaders.h"
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
#include "llchatbar.h"
|
#include "llchatbar.h"
|
||||||
#include "lldelayedgestureerror.h"
|
#include "lldelayedgestureerror.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryobserver.h"
|
||||||
#include "llviewermessage.h"
|
#include "llviewermessage.h"
|
||||||
#include "llvoavatarself.h"
|
#include "llvoavatarself.h"
|
||||||
#include "llviewerstats.h"
|
#include "llviewerstats.h"
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#include "llfloatergroupinfo.h"
|
#include "llfloatergroupinfo.h"
|
||||||
#include "llimview.h"
|
#include "llimview.h"
|
||||||
#include "llinventory.h"
|
#include "llinventory.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
#include "llfloateractivespeakers.h"
|
#include "llfloateractivespeakers.h"
|
||||||
#include "llfloateravatarinfo.h"
|
#include "llfloateravatarinfo.h"
|
||||||
@@ -1776,7 +1776,7 @@ BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return LLFloater::handleKeyHere(key, mask);
|
return handled || LLFloater::handleKeyHere(key, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLFloaterIMPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
BOOL LLFloaterIMPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
#include "llfolderview.h"
|
#include "llfolderview.h"
|
||||||
#include "llgesturemgr.h"
|
#include "llgesturemgr.h"
|
||||||
#include "lliconctrl.h"
|
#include "lliconctrl.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryclipboard.h"
|
#include "llinventoryclipboard.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
#include "llmenugl.h"
|
#include "llmenugl.h"
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
#include "llinventorybridge.h"
|
#include "llinventorybridge.h"
|
||||||
#include "llinventorydefines.h"
|
#include "llinventorydefines.h"
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryicon.h"
|
#include "llinventoryicon.h"
|
||||||
|
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
@@ -182,39 +183,6 @@ struct LLWearInfo
|
|||||||
BOOL mReplace;
|
BOOL mReplace;
|
||||||
};
|
};
|
||||||
|
|
||||||
BOOL get_is_item_worn(const LLInventoryItem *item)
|
|
||||||
{
|
|
||||||
if (!item)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
switch(item->getType())
|
|
||||||
{
|
|
||||||
case LLAssetType::AT_OBJECT:
|
|
||||||
{
|
|
||||||
if (isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(item->getLinkedUUID()))
|
|
||||||
return TRUE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LLAssetType::AT_BODYPART:
|
|
||||||
case LLAssetType::AT_CLOTHING:
|
|
||||||
if(gAgentWearables.isWearingItem(item->getLinkedUUID()))
|
|
||||||
return TRUE;
|
|
||||||
break;
|
|
||||||
case LLAssetType::AT_GESTURE:
|
|
||||||
if (LLGestureMgr::instance().isGestureActive(item->getLinkedUUID()))
|
|
||||||
return TRUE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL get_is_item_worn(const LLUUID& id)
|
|
||||||
{
|
|
||||||
return get_is_item_worn(gInventory.getItem(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
// [RLVa:KB] - Made this part of LLWearableHoldingPattern
|
// [RLVa:KB] - Made this part of LLWearableHoldingPattern
|
||||||
//BOOL gAddToOutfit = FALSE;
|
//BOOL gAddToOutfit = FALSE;
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
@@ -4664,7 +4632,7 @@ void LLOutfitFetch::done()
|
|||||||
|
|
||||||
LLOutfitObserver* outfit;
|
LLOutfitObserver* outfit;
|
||||||
outfit = new LLOutfitObserver(mCompleteFolders.front(), mCopyItems, mAppend);
|
outfit = new LLOutfitObserver(mCompleteFolders.front(), mCopyItems, mAppend);
|
||||||
LLInventoryFetchObserver::item_ref_t ids;
|
uuid_vec_t ids;
|
||||||
for(S32 i = 0; i < count; ++i)
|
for(S32 i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
ids.push_back(item_array.get(i)->getUUID());
|
ids.push_back(item_array.get(i)->getUUID());
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
#include "llfloaterproperties.h"
|
#include "llfloaterproperties.h"
|
||||||
#include "llfolderview.h"
|
#include "llfolderview.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventorymodel.h"
|
||||||
|
#include "llinventoryobserver.h"
|
||||||
//#include "llinventoryview.h"
|
//#include "llinventoryview.h"
|
||||||
#include "llviewercontrol.h"
|
#include "llviewercontrol.h"
|
||||||
#include "llwearable.h"
|
#include "llwearable.h"
|
||||||
|
|||||||
477
indra/newview/llinventoryfunctions.cpp
Normal file
477
indra/newview/llinventoryfunctions.cpp
Normal file
@@ -0,0 +1,477 @@
|
|||||||
|
/**
|
||||||
|
* @file llinventoryfunctions.cpp
|
||||||
|
* @brief Implementation of the inventory view and associated stuff.
|
||||||
|
*
|
||||||
|
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||||
|
* Second Life Viewer Source Code
|
||||||
|
* Copyright (C) 2010, Linden Research, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation;
|
||||||
|
* version 2.1 of the License only.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
* $/LicenseInfo$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "llviewerprecompiledheaders.h"
|
||||||
|
|
||||||
|
#include <utility> // for std::pair<>
|
||||||
|
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
|
|
||||||
|
// library includes
|
||||||
|
#include "llagent.h"
|
||||||
|
#include "llagentwearables.h"
|
||||||
|
#include "llcallingcard.h"
|
||||||
|
#include "llinventorydefines.h"
|
||||||
|
#include "llsdserialize.h"
|
||||||
|
#include "llspinctrl.h"
|
||||||
|
#include "llui.h"
|
||||||
|
#include "message.h"
|
||||||
|
|
||||||
|
// newview includes
|
||||||
|
#include "llappviewer.h"
|
||||||
|
//#include "llfirstuse.h"
|
||||||
|
#include "llfocusmgr.h"
|
||||||
|
#include "llfolderview.h"
|
||||||
|
#include "llgesturemgr.h"
|
||||||
|
#include "lliconctrl.h"
|
||||||
|
#include "llimview.h"
|
||||||
|
#include "llinventorybridge.h"
|
||||||
|
#include "llinventoryclipboard.h"
|
||||||
|
#include "llinventorymodel.h"
|
||||||
|
#include "llinventoryview.h"
|
||||||
|
#include "lllineeditor.h"
|
||||||
|
#include "llmenugl.h"
|
||||||
|
#include "llnotificationsutil.h"
|
||||||
|
#include "llpreviewanim.h"
|
||||||
|
#include "llpreviewgesture.h"
|
||||||
|
#include "llpreviewnotecard.h"
|
||||||
|
#include "llpreviewscript.h"
|
||||||
|
#include "llpreviewsound.h"
|
||||||
|
#include "llpreviewtexture.h"
|
||||||
|
#include "llresmgr.h"
|
||||||
|
#include "llscrollbar.h"
|
||||||
|
#include "llscrollcontainer.h"
|
||||||
|
#include "llselectmgr.h"
|
||||||
|
#include "lltabcontainer.h"
|
||||||
|
#include "lltooldraganddrop.h"
|
||||||
|
#include "lluictrlfactory.h"
|
||||||
|
#include "llviewermessage.h"
|
||||||
|
#include "llviewerobjectlist.h"
|
||||||
|
#include "llviewerregion.h"
|
||||||
|
#include "llviewerwindow.h"
|
||||||
|
#include "llvoavatarself.h"
|
||||||
|
#include "llwearablelist.h"
|
||||||
|
|
||||||
|
#include "cofmgr.h"
|
||||||
|
|
||||||
|
BOOL LLInventoryState::sWearNewClothing = FALSE;
|
||||||
|
LLUUID LLInventoryState::sWearNewClothingTransactionID;
|
||||||
|
|
||||||
|
// Generates a string containing the path to the item specified by
|
||||||
|
// item_id.
|
||||||
|
void append_path(const LLUUID& id, std::string& path)
|
||||||
|
{
|
||||||
|
std::string temp;
|
||||||
|
LLInventoryObject* obj = gInventory.getObject(id);
|
||||||
|
LLUUID parent_id;
|
||||||
|
if(obj) parent_id = obj->getParentUUID();
|
||||||
|
std::string forward_slash("/");
|
||||||
|
while(obj)
|
||||||
|
{
|
||||||
|
obj = gInventory.getCategory(parent_id);
|
||||||
|
if(obj)
|
||||||
|
{
|
||||||
|
temp.assign(forward_slash + obj->getName() + temp);
|
||||||
|
parent_id = obj->getParentUUID();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
path.append(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void change_item_parent(LLInventoryModel* model,
|
||||||
|
LLViewerInventoryItem* item,
|
||||||
|
const LLUUID& new_parent_id,
|
||||||
|
BOOL restamp)
|
||||||
|
{
|
||||||
|
if (item->getParentUUID() != new_parent_id)
|
||||||
|
{
|
||||||
|
LLInventoryModel::update_list_t update;
|
||||||
|
LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
|
||||||
|
update.push_back(old_folder);
|
||||||
|
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
|
||||||
|
update.push_back(new_folder);
|
||||||
|
gInventory.accountForUpdate(update);
|
||||||
|
|
||||||
|
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
|
||||||
|
new_item->setParent(new_parent_id);
|
||||||
|
new_item->updateParentOnServer(restamp);
|
||||||
|
model->updateItem(new_item);
|
||||||
|
model->notifyObservers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void change_category_parent(LLInventoryModel* model,
|
||||||
|
LLViewerInventoryCategory* cat,
|
||||||
|
const LLUUID& new_parent_id,
|
||||||
|
BOOL restamp)
|
||||||
|
{
|
||||||
|
if (!model || !cat)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Can't move a folder into a child of itself.
|
||||||
|
if (model->isObjectDescendentOf(new_parent_id, cat->getUUID()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLInventoryModel::update_list_t update;
|
||||||
|
LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1);
|
||||||
|
update.push_back(old_folder);
|
||||||
|
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
|
||||||
|
update.push_back(new_folder);
|
||||||
|
model->accountForUpdate(update);
|
||||||
|
|
||||||
|
LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat);
|
||||||
|
new_cat->setParent(new_parent_id);
|
||||||
|
new_cat->updateParentOnServer(restamp);
|
||||||
|
model->updateCategory(new_cat);
|
||||||
|
model->notifyObservers();
|
||||||
|
}
|
||||||
|
|
||||||
|
class LLInventoryCollectAllItems : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
BOOL get_is_parent_to_worn_item(const LLUUID& id)
|
||||||
|
{
|
||||||
|
const LLViewerInventoryCategory* cat = gInventory.getCategory(id);
|
||||||
|
if (!cat)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLInventoryModel::cat_array_t cats;
|
||||||
|
LLInventoryModel::item_array_t items;
|
||||||
|
LLInventoryCollectAllItems collect_all;
|
||||||
|
gInventory.collectDescendentsIf(LLCOFMgr::instance().getCOF(), cats, items, LLInventoryModel::EXCLUDE_TRASH, collect_all);
|
||||||
|
|
||||||
|
for (LLInventoryModel::item_array_t::const_iterator it = items.begin(); it != items.end(); ++it)
|
||||||
|
{
|
||||||
|
const LLViewerInventoryItem * const item = *it;
|
||||||
|
|
||||||
|
llassert(item->getIsLinkType());
|
||||||
|
|
||||||
|
LLUUID linked_id = item->getLinkedUUID();
|
||||||
|
const LLViewerInventoryItem * const linked_item = gInventory.getItem(linked_id);
|
||||||
|
|
||||||
|
if (linked_item)
|
||||||
|
{
|
||||||
|
LLUUID parent_id = linked_item->getParentUUID();
|
||||||
|
|
||||||
|
while (!parent_id.isNull())
|
||||||
|
{
|
||||||
|
LLInventoryCategory * parent_cat = gInventory.getCategory(parent_id);
|
||||||
|
|
||||||
|
if (cat == parent_cat)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
parent_id = parent_cat->getParentUUID();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
BOOL get_is_item_worn(const LLInventoryItem *item)
|
||||||
|
{
|
||||||
|
if (!item)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
// Consider the item as worn if it has links in COF.
|
||||||
|
if (LLCOFMgr::instance().isLinkInCOF(item->getUUID()))
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(item->getType())
|
||||||
|
{
|
||||||
|
case LLAssetType::AT_OBJECT:
|
||||||
|
{
|
||||||
|
if (isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(item->getLinkedUUID()))
|
||||||
|
return TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LLAssetType::AT_BODYPART:
|
||||||
|
case LLAssetType::AT_CLOTHING:
|
||||||
|
if(gAgentWearables.isWearingItem(item->getLinkedUUID()))
|
||||||
|
return TRUE;
|
||||||
|
break;
|
||||||
|
case LLAssetType::AT_GESTURE:
|
||||||
|
if (LLGestureMgr::instance().isGestureActive(item->getLinkedUUID()))
|
||||||
|
return TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL get_is_item_worn(const LLUUID& id)
|
||||||
|
{
|
||||||
|
return get_is_item_worn(gInventory.getItem(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL get_can_item_be_worn(const LLUUID& id)
|
||||||
|
{
|
||||||
|
const LLViewerInventoryItem* item = gInventory.getItem(id);
|
||||||
|
if (!item)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (LLCOFMgr::instance().isLinkInCOF(item->getLinkedUUID()))
|
||||||
|
{
|
||||||
|
// an item having links in COF (i.e. a worn item)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gInventory.isObjectDescendentOf(id, LLCOFMgr::instance().getCOF()))
|
||||||
|
{
|
||||||
|
// a non-link object in COF (should not normally happen)
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LLUUID trash_id = gInventory.findCategoryUUIDForType(
|
||||||
|
LLFolderType::FT_TRASH);
|
||||||
|
|
||||||
|
// item can't be worn if base obj in trash, see EXT-7015
|
||||||
|
if (gInventory.isObjectDescendentOf(item->getLinkedUUID(),
|
||||||
|
trash_id))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(item->getType())
|
||||||
|
{
|
||||||
|
case LLAssetType::AT_OBJECT:
|
||||||
|
{
|
||||||
|
if (isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(item->getLinkedUUID()))
|
||||||
|
{
|
||||||
|
// Already being worn
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Not being worn yet.
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LLAssetType::AT_BODYPART:
|
||||||
|
case LLAssetType::AT_CLOTHING:
|
||||||
|
if(gAgentWearables.isWearingItem(item->getLinkedUUID()))
|
||||||
|
{
|
||||||
|
// Already being worn
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Not being worn yet.
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///----------------------------------------------------------------------------
|
||||||
|
/// LLInventoryCollectFunctor implementations
|
||||||
|
///----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
// static
|
||||||
|
bool LLInventoryCollectFunctor::itemTransferCommonlyAllowed(const LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if (!item)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
switch(item->getType())
|
||||||
|
{
|
||||||
|
case LLAssetType::AT_OBJECT:
|
||||||
|
case LLAssetType::AT_BODYPART:
|
||||||
|
case LLAssetType::AT_CLOTHING:
|
||||||
|
if (!get_is_item_worn(item->getUUID()))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LLIsType::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(mType == LLAssetType::AT_CATEGORY)
|
||||||
|
{
|
||||||
|
if(cat) return TRUE;
|
||||||
|
}
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if(item->getType() == mType) return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LLIsNotType::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(mType == LLAssetType::AT_CATEGORY)
|
||||||
|
{
|
||||||
|
if(cat) return FALSE;
|
||||||
|
}
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if(item->getType() == mType) return FALSE;
|
||||||
|
else return TRUE;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LLIsOfAssetType::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(mType == LLAssetType::AT_CATEGORY)
|
||||||
|
{
|
||||||
|
if(cat) return TRUE;
|
||||||
|
}
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if(item->getActualType() == mType) return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(mType == LLAssetType::AT_CATEGORY)
|
||||||
|
{
|
||||||
|
if(cat)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if(item->getType() == mType)
|
||||||
|
{
|
||||||
|
LLPermissions perm = item->getPermissions();
|
||||||
|
if ((perm.getMaskBase() & mPerm) == mPerm)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LLBuddyCollector::operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if((LLAssetType::AT_CALLINGCARD == item->getType())
|
||||||
|
&& (!item->getCreatorUUID().isNull())
|
||||||
|
&& (item->getCreatorUUID() != gAgent.getID()))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool LLUniqueBuddyCollector::operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if((LLAssetType::AT_CALLINGCARD == item->getType())
|
||||||
|
&& (item->getCreatorUUID().notNull())
|
||||||
|
&& (item->getCreatorUUID() != gAgent.getID()))
|
||||||
|
{
|
||||||
|
mSeen.insert(item->getCreatorUUID());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool LLParticularBuddyCollector::operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if((LLAssetType::AT_CALLINGCARD == item->getType())
|
||||||
|
&& (item->getCreatorUUID() == mBuddyID))
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool LLNameCategoryCollector::operator()(
|
||||||
|
LLInventoryCategory* cat, LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(cat)
|
||||||
|
{
|
||||||
|
if (!LLStringUtil::compareInsensitive(mName, cat->getName()))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
///----------------------------------------------------------------------------
|
||||||
|
/// LLAssetIDMatches
|
||||||
|
///----------------------------------------------------------------------------
|
||||||
|
bool LLAssetIDMatches ::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
return (item && item->getAssetUUID() == mAssetID);
|
||||||
|
}
|
||||||
|
|
||||||
|
///----------------------------------------------------------------------------
|
||||||
|
/// LLLinkedItemIDMatches
|
||||||
|
///----------------------------------------------------------------------------
|
||||||
|
bool LLLinkedItemIDMatches::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
return (item &&
|
||||||
|
(item->getIsLinkType()) &&
|
||||||
|
(item->getLinkedUUID() == mBaseItemID)); // A linked item's assetID will be the compared-to item's itemID.
|
||||||
|
}
|
||||||
267
indra/newview/llinventoryfunctions.h
Normal file
267
indra/newview/llinventoryfunctions.h
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
/**
|
||||||
|
* @file llinventoryfunctions.h
|
||||||
|
* @brief Miscellaneous inventory-related functions and classes
|
||||||
|
* class definition
|
||||||
|
*
|
||||||
|
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||||
|
* Second Life Viewer Source Code
|
||||||
|
* Copyright (C) 2010, Linden Research, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation;
|
||||||
|
* version 2.1 of the License only.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
* $/LicenseInfo$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LL_LLINVENTORYFUNCTIONS_H
|
||||||
|
#define LL_LLINVENTORYFUNCTIONS_H
|
||||||
|
|
||||||
|
#include "llinventorymodel.h"
|
||||||
|
#include "llinventory.h"
|
||||||
|
#include "llwearabletype.h"
|
||||||
|
|
||||||
|
/********************************************************************************
|
||||||
|
** **
|
||||||
|
** MISCELLANEOUS GLOBAL FUNCTIONS
|
||||||
|
**/
|
||||||
|
|
||||||
|
// Is this a parent folder to a worn item
|
||||||
|
BOOL get_is_parent_to_worn_item(const LLUUID& id);
|
||||||
|
|
||||||
|
// Is this item or its baseitem is worn, attached, etc...
|
||||||
|
BOOL get_is_item_worn(const LLInventoryItem *item);
|
||||||
|
BOOL get_is_item_worn(const LLUUID& id);
|
||||||
|
|
||||||
|
// Could this item be worn (correct type + not already being worn)
|
||||||
|
BOOL get_can_item_be_worn(const LLUUID& id);
|
||||||
|
|
||||||
|
|
||||||
|
void change_item_parent(LLInventoryModel* model,
|
||||||
|
LLViewerInventoryItem* item,
|
||||||
|
const LLUUID& new_parent_id,
|
||||||
|
BOOL restamp);
|
||||||
|
|
||||||
|
void change_category_parent(LLInventoryModel* model,
|
||||||
|
LLViewerInventoryCategory* cat,
|
||||||
|
const LLUUID& new_parent_id,
|
||||||
|
BOOL restamp);
|
||||||
|
// Generates a string containing the path to the item specified by item_id.
|
||||||
|
void append_path(const LLUUID& id, std::string& path);
|
||||||
|
|
||||||
|
/********************************************************************************
|
||||||
|
** **
|
||||||
|
** INVENTORY COLLECTOR FUNCTIONS
|
||||||
|
**/
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryCollectFunctor
|
||||||
|
//
|
||||||
|
// Base class for LLInventoryModel::collectDescendentsIf() method
|
||||||
|
// which accepts an instance of one of these objects to use as the
|
||||||
|
// function to determine if it should be added. Derive from this class
|
||||||
|
// and override the () operator to return TRUE if you want to collect
|
||||||
|
// the category or item passed in.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~LLInventoryCollectFunctor(){};
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) = 0;
|
||||||
|
|
||||||
|
static bool itemTransferCommonlyAllowed(const LLInventoryItem* item);
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLAssetIDMatches
|
||||||
|
//
|
||||||
|
// This functor finds inventory items pointing to the specified asset
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLViewerInventoryItem;
|
||||||
|
|
||||||
|
class LLAssetIDMatches : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLAssetIDMatches(const LLUUID& asset_id) : mAssetID(asset_id) {}
|
||||||
|
virtual ~LLAssetIDMatches() {}
|
||||||
|
bool operator()(LLInventoryCategory* cat, LLInventoryItem* item);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
LLUUID mAssetID;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLLinkedItemIDMatches
|
||||||
|
//
|
||||||
|
// This functor finds inventory items linked to the specific inventory id.
|
||||||
|
// Assumes the inventory id is itself not a linked item.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLLinkedItemIDMatches : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLLinkedItemIDMatches(const LLUUID& item_id) : mBaseItemID(item_id) {}
|
||||||
|
virtual ~LLLinkedItemIDMatches() {}
|
||||||
|
bool operator()(LLInventoryCategory* cat, LLInventoryItem* item);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
LLUUID mBaseItemID;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLIsType
|
||||||
|
//
|
||||||
|
// Implementation of a LLInventoryCollectFunctor which returns TRUE if
|
||||||
|
// the type is the type passed in during construction.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
class LLIsType : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLIsType(LLAssetType::EType type) : mType(type) {}
|
||||||
|
virtual ~LLIsType() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
protected:
|
||||||
|
LLAssetType::EType mType;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLIsNotType
|
||||||
|
//
|
||||||
|
// Implementation of a LLInventoryCollectFunctor which returns FALSE if the
|
||||||
|
// type is the type passed in during construction, otherwise false.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLIsNotType : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLIsNotType(LLAssetType::EType type) : mType(type) {}
|
||||||
|
virtual ~LLIsNotType() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
protected:
|
||||||
|
LLAssetType::EType mType;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLIsOfAssetType
|
||||||
|
//
|
||||||
|
// Implementation of a LLInventoryCollectFunctor which returns TRUE if
|
||||||
|
// the item or category is of asset type passed in during construction.
|
||||||
|
// Link types are treated as links, not as the types they point to.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
class LLIsOfAssetType : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLIsOfAssetType(LLAssetType::EType type) : mType(type) {}
|
||||||
|
virtual ~LLIsOfAssetType() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
protected:
|
||||||
|
LLAssetType::EType mType;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LLIsTypeWithPermissions : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLIsTypeWithPermissions(LLAssetType::EType type, const PermissionBit perms, const LLUUID &agent_id, const LLUUID &group_id)
|
||||||
|
: mType(type), mPerm(perms), mAgentID(agent_id), mGroupID(group_id) {}
|
||||||
|
virtual ~LLIsTypeWithPermissions() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
protected:
|
||||||
|
LLAssetType::EType mType;
|
||||||
|
PermissionBit mPerm;
|
||||||
|
LLUUID mAgentID;
|
||||||
|
LLUUID mGroupID;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLBuddyCollector
|
||||||
|
//
|
||||||
|
// Simple class that collects calling cards that are not null, and not
|
||||||
|
// the agent. Duplicates are possible.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLBuddyCollector : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLBuddyCollector() {}
|
||||||
|
virtual ~LLBuddyCollector() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLUniqueBuddyCollector
|
||||||
|
//
|
||||||
|
// Simple class that collects calling cards that are not null, and not
|
||||||
|
// the agent. Duplicates are discarded.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLUniqueBuddyCollector : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLUniqueBuddyCollector() {}
|
||||||
|
virtual ~LLUniqueBuddyCollector() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::set<LLUUID> mSeen;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLParticularBuddyCollector
|
||||||
|
//
|
||||||
|
// Simple class that collects calling cards that match a particular uuid
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
class LLParticularBuddyCollector : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLParticularBuddyCollector(const LLUUID& id) : mBuddyID(id) {}
|
||||||
|
virtual ~LLParticularBuddyCollector() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
protected:
|
||||||
|
LLUUID mBuddyID;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLNameCategoryCollector
|
||||||
|
//
|
||||||
|
// Collects categories based on case-insensitive match of prefix
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLNameCategoryCollector : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLNameCategoryCollector(const std::string& name) : mName(name) {}
|
||||||
|
virtual ~LLNameCategoryCollector() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
protected:
|
||||||
|
std::string mName;
|
||||||
|
};
|
||||||
|
class LLInventoryState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// HACK: Until we can route this info through the instant message hierarchy
|
||||||
|
static BOOL sWearNewClothing;
|
||||||
|
static LLUUID sWearNewClothingTransactionID; // wear all clothing in this transaction
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // LL_LLINVENTORYFUNCTIONS_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -36,44 +36,20 @@
|
|||||||
#include "llassettype.h"
|
#include "llassettype.h"
|
||||||
#include "llfoldertype.h"
|
#include "llfoldertype.h"
|
||||||
#include "lldarray.h"
|
#include "lldarray.h"
|
||||||
|
#include "llhttpclient.h"
|
||||||
#include "lluuid.h"
|
#include "lluuid.h"
|
||||||
#include "llpermissionsflags.h"
|
#include "llpermissionsflags.h"
|
||||||
#include "llstring.h"
|
#include "llstring.h"
|
||||||
#include "llhttpclient.h"
|
|
||||||
|
#include "llmd5.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
class LLInventoryObserver;
|
||||||
// Class LLInventoryObserver
|
|
||||||
//
|
|
||||||
// This class is designed to be a simple abstract base class which can
|
|
||||||
// relay messages when the inventory changes.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
// This enumeration is a way to refer to what changed in a more
|
|
||||||
// human readable format. You can mask the value provided by
|
|
||||||
// chaged() to see if the observer is interested in the change.
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
NONE = 0,
|
|
||||||
LABEL = 1, // name changed
|
|
||||||
INTERNAL = 2, // internal change, eg, asset uuid different
|
|
||||||
ADD = 4, // something added
|
|
||||||
REMOVE = 8, // something deleted
|
|
||||||
STRUCTURE = 16, // structural change, eg, item or folder moved
|
|
||||||
CALLING_CARD = 32, // online, grant status, cancel, etc change
|
|
||||||
ALL = 0xffffffff
|
|
||||||
};
|
|
||||||
virtual ~LLInventoryObserver() {};
|
|
||||||
virtual void changed(U32 mask) = 0;
|
|
||||||
std::string mMessageName; // used by Agent Inventory Service only. [DEV-20328]
|
|
||||||
};
|
|
||||||
class LLInventoryObject;
|
class LLInventoryObject;
|
||||||
class LLInventoryItem;
|
class LLInventoryItem;
|
||||||
class LLInventoryCategory;
|
class LLInventoryCategory;
|
||||||
@@ -223,6 +199,9 @@ public:
|
|||||||
void getDirectDescendentsOf(const LLUUID& cat_id,
|
void getDirectDescendentsOf(const LLUUID& cat_id,
|
||||||
cat_array_t*& categories) const;
|
cat_array_t*& categories) const;
|
||||||
|
|
||||||
|
// Compute a hash of direct descendent names (for detecting child name changes)
|
||||||
|
LLMD5 hashDirectDescendentNames(const LLUUID& cat_id) const;
|
||||||
|
|
||||||
// Starting with the object specified, add its descendents to the
|
// Starting with the object specified, add its descendents to the
|
||||||
// array provided, but do not add the inventory object specified
|
// array provided, but do not add the inventory object specified
|
||||||
// by id. There is no guaranteed order.
|
// by id. There is no guaranteed order.
|
||||||
@@ -381,10 +360,6 @@ public:
|
|||||||
//void requestFromServer(const LLUUID& agent_id);
|
//void requestFromServer(const LLUUID& agent_id);
|
||||||
|
|
||||||
|
|
||||||
// Generates a string containing the path to the item specified by
|
|
||||||
// item_id.
|
|
||||||
void appendPath(const LLUUID& id, std::string& path);
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
// Creation
|
// Creation
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
@@ -524,6 +499,9 @@ public:
|
|||||||
// Callbacks
|
// Callbacks
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
|
// Trigger a notification and empty the folder type (FT_TRASH or FT_LOST_AND_FOUND) if confirmed
|
||||||
|
void emptyFolderType(const std::string notification, LLFolderType::EType folder_type);
|
||||||
|
bool callbackEmptyFolderType(const LLSD& notification, const LLSD& response, LLFolderType::EType preferred_type);
|
||||||
static void registerCallbacks(LLMessageSystem* msg);
|
static void registerCallbacks(LLMessageSystem* msg);
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
@@ -544,9 +522,12 @@ protected:
|
|||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
public:
|
public:
|
||||||
static void processUpdateCreateInventoryItem(LLMessageSystem* msg, void**);
|
static void processUpdateCreateInventoryItem(LLMessageSystem* msg, void**);
|
||||||
|
static void removeInventoryItem(LLUUID agent_id, LLMessageSystem* msg, const char* msg_label);
|
||||||
static void processRemoveInventoryItem(LLMessageSystem* msg, void**);
|
static void processRemoveInventoryItem(LLMessageSystem* msg, void**);
|
||||||
static void processUpdateInventoryFolder(LLMessageSystem* msg, void**);
|
static void processUpdateInventoryFolder(LLMessageSystem* msg, void**);
|
||||||
|
static void removeInventoryFolder(LLUUID agent_id, LLMessageSystem* msg);
|
||||||
static void processRemoveInventoryFolder(LLMessageSystem* msg, void**);
|
static void processRemoveInventoryFolder(LLMessageSystem* msg, void**);
|
||||||
|
static void processRemoveInventoryObjects(LLMessageSystem* msg, void**);
|
||||||
static void processSaveAssetIntoInventory(LLMessageSystem* msg, void**);
|
static void processSaveAssetIntoInventory(LLMessageSystem* msg, void**);
|
||||||
static void processBulkUpdateInventory(LLMessageSystem* msg, void**);
|
static void processBulkUpdateInventory(LLMessageSystem* msg, void**);
|
||||||
static void processInventoryDescendents(LLMessageSystem* msg, void**);
|
static void processInventoryDescendents(LLMessageSystem* msg, void**);
|
||||||
@@ -597,384 +578,5 @@ public:
|
|||||||
// a special inventory model for the agent
|
// a special inventory model for the agent
|
||||||
extern LLInventoryModel gInventory;
|
extern LLInventoryModel gInventory;
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLInventoryCollectFunctor
|
|
||||||
//
|
|
||||||
// Base class for LLInventoryModel::collectDescendentsIf() method
|
|
||||||
// which accepts an instance of one of these objects to use as the
|
|
||||||
// function to determine if it should be added. Derive from this class
|
|
||||||
// and override the () operator to return TRUE if you want to collect
|
|
||||||
// the category or item passed in.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~LLInventoryCollectFunctor(){};
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) = 0;
|
|
||||||
|
|
||||||
static bool itemTransferCommonlyAllowed(LLInventoryItem* item);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLAssetIDMatches
|
|
||||||
//
|
|
||||||
// This functor finds inventory items pointing to the specified asset
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
class LLViewerInventoryItem;
|
|
||||||
|
|
||||||
class LLAssetIDMatches : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLAssetIDMatches(const LLUUID& asset_id) : mAssetID(asset_id) {}
|
|
||||||
virtual ~LLAssetIDMatches() {}
|
|
||||||
bool operator()(LLInventoryCategory* cat, LLInventoryItem* item);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
LLUUID mAssetID;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLLinkedItemIDMatches
|
|
||||||
//
|
|
||||||
// This functor finds inventory items linked to the specific inventory id.
|
|
||||||
// Assumes the inventory id is itself not a linked item.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
class LLLinkedItemIDMatches : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLLinkedItemIDMatches(const LLUUID& item_id) : mBaseItemID(item_id) {}
|
|
||||||
virtual ~LLLinkedItemIDMatches() {}
|
|
||||||
bool operator()(LLInventoryCategory* cat, LLInventoryItem* item);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
LLUUID mBaseItemID;
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLIsType
|
|
||||||
//
|
|
||||||
// Implementation of a LLInventoryCollectFunctor which returns TRUE if
|
|
||||||
// the type is the type passed in during construction.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLIsType : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLIsType(LLAssetType::EType type) : mType(type) {}
|
|
||||||
virtual ~LLIsType() {}
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item);
|
|
||||||
protected:
|
|
||||||
LLAssetType::EType mType;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLIsNotType
|
|
||||||
//
|
|
||||||
// Implementation of a LLInventoryCollectFunctor which returns FALSE if the
|
|
||||||
// type is the type passed in during construction, otherwise false.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLIsNotType : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLIsNotType(LLAssetType::EType type) : mType(type) {}
|
|
||||||
virtual ~LLIsNotType() {}
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item);
|
|
||||||
protected:
|
|
||||||
LLAssetType::EType mType;
|
|
||||||
};
|
|
||||||
|
|
||||||
class LLIsTypeWithPermissions : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLIsTypeWithPermissions(LLAssetType::EType type, const PermissionBit perms, const LLUUID &agent_id, const LLUUID &group_id)
|
|
||||||
: mType(type), mPerm(perms), mAgentID(agent_id), mGroupID(group_id) {}
|
|
||||||
virtual ~LLIsTypeWithPermissions() {}
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item);
|
|
||||||
protected:
|
|
||||||
LLAssetType::EType mType;
|
|
||||||
PermissionBit mPerm;
|
|
||||||
LLUUID mAgentID;
|
|
||||||
LLUUID mGroupID;
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLIsClone
|
|
||||||
//
|
|
||||||
// Implementation of a LLInventoryCollectFunctor which returns TRUE if
|
|
||||||
// the object is a clone of the item passed in during
|
|
||||||
// construction.
|
|
||||||
//
|
|
||||||
// *NOTE: Since clone information is determined based off of asset id
|
|
||||||
// (or creator with calling cards), if the id is NULL, it has no
|
|
||||||
// clones - even itself.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
//class LLIsClone : public LLInventoryCollectFunctor
|
|
||||||
//{
|
|
||||||
//public:
|
|
||||||
// LLIsClone(LLViewerInventoryItem* item) : mItem(item) {}
|
|
||||||
// virtual ~LLIsClone() {}
|
|
||||||
// virtual bool operator()(LLViewerInventoryCategory* cat,
|
|
||||||
// LLViewerInventoryItem* item);
|
|
||||||
//protected:
|
|
||||||
// LLPointer<LLViewerInventoryItem> mItem;
|
|
||||||
//};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLBuddyCollector
|
|
||||||
//
|
|
||||||
// Simple class that collects calling cards that are not null, and not
|
|
||||||
// the agent. Duplicates are possible.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLBuddyCollector : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLBuddyCollector() {}
|
|
||||||
virtual ~LLBuddyCollector() {}
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item);
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLUniqueBuddyCollector
|
|
||||||
//
|
|
||||||
// Simple class that collects calling cards that are not null, and not
|
|
||||||
// the agent. Duplicates are discarded.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLUniqueBuddyCollector : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLUniqueBuddyCollector() {}
|
|
||||||
virtual ~LLUniqueBuddyCollector() {}
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
std::set<LLUUID> mSeen;
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLParticularBuddyCollector
|
|
||||||
//
|
|
||||||
// Simple class that collects calling cards that match a particular uuid
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLParticularBuddyCollector : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLParticularBuddyCollector(const LLUUID& id) : mBuddyID(id) {}
|
|
||||||
virtual ~LLParticularBuddyCollector() {}
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item);
|
|
||||||
protected:
|
|
||||||
LLUUID mBuddyID;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLNameCategoryCollector
|
|
||||||
//
|
|
||||||
// Collects categories based on case-insensitive match of prefix
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLNameCategoryCollector : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLNameCategoryCollector(const std::string& name) : mName(name) {}
|
|
||||||
virtual ~LLNameCategoryCollector() {}
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item);
|
|
||||||
protected:
|
|
||||||
std::string mName;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLInventoryCompletionObserver
|
|
||||||
//
|
|
||||||
// Class which can be used as a base class for doing something when
|
|
||||||
// when all observed items are locally complete. This class implements
|
|
||||||
// the changed() method of LLInventoryObserver and declares a new
|
|
||||||
// method named done() which is called when all watched items have
|
|
||||||
// complete information in the inventory model.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLInventoryCompletionObserver : public LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLInventoryCompletionObserver() {}
|
|
||||||
virtual void changed(U32 mask);
|
|
||||||
|
|
||||||
void watchItem(const LLUUID& id);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void done() = 0;
|
|
||||||
|
|
||||||
typedef std::vector<LLUUID> item_ref_t;
|
|
||||||
item_ref_t mComplete;
|
|
||||||
item_ref_t mIncomplete;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLInventoryFetchObserver
|
|
||||||
//
|
|
||||||
// This class is much like the LLInventoryCompletionObserver, except
|
|
||||||
// that it handles all the the fetching necessary. Override the done()
|
|
||||||
// method to do the thing you want.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLInventoryFetchObserver : public LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLInventoryFetchObserver() {}
|
|
||||||
virtual void changed(U32 mask);
|
|
||||||
|
|
||||||
typedef std::vector<LLUUID> item_ref_t;
|
|
||||||
|
|
||||||
bool isEverythingComplete() const;
|
|
||||||
void fetchItems(const item_ref_t& ids);
|
|
||||||
virtual void done() = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
item_ref_t mComplete;
|
|
||||||
item_ref_t mIncomplete;
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLInventoryFetchDescendentsObserver
|
|
||||||
//
|
|
||||||
// This class is much like the LLInventoryCompletionObserver, except
|
|
||||||
// that it handles fetching based on category. Override the done()
|
|
||||||
// method to do the thing you want.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
class LLInventoryFetchDescendentsObserver : public LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLInventoryFetchDescendentsObserver() {}
|
|
||||||
virtual void changed(U32 mask);
|
|
||||||
|
|
||||||
typedef std::vector<LLUUID> folder_ref_t;
|
|
||||||
void fetchDescendents(const folder_ref_t& ids);
|
|
||||||
bool isEverythingComplete() const;
|
|
||||||
virtual void done() = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool isComplete(LLViewerInventoryCategory* cat);
|
|
||||||
folder_ref_t mIncompleteFolders;
|
|
||||||
folder_ref_t mCompleteFolders;
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLInventoryFetchComboObserver
|
|
||||||
//
|
|
||||||
// This class does an appropriate combination of fetch descendents and
|
|
||||||
// item fetches based on completion of categories and items. Much like
|
|
||||||
// the fetch and fetch descendents, this will call done() when everything
|
|
||||||
// has arrived.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
class LLInventoryFetchComboObserver : public LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLInventoryFetchComboObserver() : mDone(false) {}
|
|
||||||
virtual void changed(U32 mask);
|
|
||||||
|
|
||||||
typedef std::vector<LLUUID> folder_ref_t;
|
|
||||||
typedef std::vector<LLUUID> item_ref_t;
|
|
||||||
void fetch(const folder_ref_t& folder_ids, const item_ref_t& item_ids);
|
|
||||||
|
|
||||||
virtual void done() = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
bool mDone;
|
|
||||||
folder_ref_t mCompleteFolders;
|
|
||||||
folder_ref_t mIncompleteFolders;
|
|
||||||
item_ref_t mCompleteItems;
|
|
||||||
item_ref_t mIncompleteItems;
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLInventoryExistenceObserver
|
|
||||||
//
|
|
||||||
// This class is used as a base class for doing somethign when all the
|
|
||||||
// observed item ids exist in the inventory somewhere. You can derive
|
|
||||||
// a class from this class and implement the done() method to do
|
|
||||||
// something useful.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLInventoryExistenceObserver : public LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLInventoryExistenceObserver() {}
|
|
||||||
virtual void changed(U32 mask);
|
|
||||||
|
|
||||||
void watchItem(const LLUUID& id);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void done() = 0;
|
|
||||||
|
|
||||||
typedef std::vector<LLUUID> item_ref_t;
|
|
||||||
item_ref_t mExist;
|
|
||||||
item_ref_t mMIA;
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLInventoryAddedObserver
|
|
||||||
//
|
|
||||||
// This class is used as a base class for doing something when
|
|
||||||
// a new item arrives in inventory.
|
|
||||||
// It does not watch for a certain UUID, rather it acts when anything is added
|
|
||||||
// Derive a class from this class and implement the done() method to do
|
|
||||||
// something useful.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLInventoryAddedObserver : public LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLInventoryAddedObserver() : mAdded() {}
|
|
||||||
virtual void changed(U32 mask);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void done() = 0;
|
|
||||||
|
|
||||||
typedef std::vector<LLUUID> item_ref_t;
|
|
||||||
item_ref_t mAdded;
|
|
||||||
};
|
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
// Class LLInventoryTransactionObserver
|
|
||||||
//
|
|
||||||
// Class which can be used as a base class for doing something when an
|
|
||||||
// inventory transaction completes.
|
|
||||||
//
|
|
||||||
// *NOTE: This class is not quite complete. Avoid using unless you fix up it's
|
|
||||||
// functionality gaps.
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
class LLInventoryTransactionObserver : public LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLInventoryTransactionObserver(const LLTransactionID& transaction_id);
|
|
||||||
virtual void changed(U32 mask);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
typedef std::vector<LLUUID> folder_ref_t;
|
|
||||||
typedef std::vector<LLUUID> item_ref_t;
|
|
||||||
virtual void done(const folder_ref_t& folders, const item_ref_t& items) = 0;
|
|
||||||
|
|
||||||
LLTransactionID mTransactionID;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif // LL_LLINVENTORYMODEL_H
|
#endif // LL_LLINVENTORYMODEL_H
|
||||||
|
|
||||||
|
|||||||
679
indra/newview/llinventoryobserver.cpp
Normal file
679
indra/newview/llinventoryobserver.cpp
Normal file
@@ -0,0 +1,679 @@
|
|||||||
|
/**
|
||||||
|
* @file llinventoryobserver.cpp
|
||||||
|
* @brief Implementation of the inventory observers used to track agent inventory.
|
||||||
|
*
|
||||||
|
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||||
|
* Second Life Viewer Source Code
|
||||||
|
* Copyright (C) 2010, Linden Research, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation;
|
||||||
|
* version 2.1 of the License only.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
* $/LicenseInfo$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "llviewerprecompiledheaders.h"
|
||||||
|
|
||||||
|
#include "llinventoryobserver.h"
|
||||||
|
|
||||||
|
#include "llassetstorage.h"
|
||||||
|
#include "llcrc.h"
|
||||||
|
#include "lldir.h"
|
||||||
|
#include "llsys.h"
|
||||||
|
#include "llxfermanager.h"
|
||||||
|
#include "message.h"
|
||||||
|
|
||||||
|
#include "llagent.h"
|
||||||
|
#include "llagentwearables.h"
|
||||||
|
#include "llfloater.h"
|
||||||
|
#include "llfocusmgr.h"
|
||||||
|
#include "llinventorybridge.h"
|
||||||
|
//#include "llinventoryfunctions.h"
|
||||||
|
#include "llinventorymodel.h"
|
||||||
|
#include "llviewermessage.h"
|
||||||
|
#include "llviewerwindow.h"
|
||||||
|
#include "llviewerregion.h"
|
||||||
|
#include "llappviewer.h"
|
||||||
|
#include "lldbstrings.h"
|
||||||
|
#include "llviewerstats.h"
|
||||||
|
#include "llnotificationsutil.h"
|
||||||
|
#include "llcallbacklist.h"
|
||||||
|
#include "llpreview.h"
|
||||||
|
#include "llviewercontrol.h"
|
||||||
|
#include "llvoavatarself.h"
|
||||||
|
#include "llsdutil.h"
|
||||||
|
#include <deque>
|
||||||
|
|
||||||
|
const F32 LLInventoryFetchItemsObserver::FETCH_TIMER_EXPIRY = 60.0f;
|
||||||
|
|
||||||
|
void fetch_items_from_llsd(const LLSD& items_llsd);
|
||||||
|
|
||||||
|
void LLInventoryCompletionObserver::changed(U32 mask)
|
||||||
|
{
|
||||||
|
// scan through the incomplete items and move or erase them as
|
||||||
|
// appropriate.
|
||||||
|
if(!mIncomplete.empty())
|
||||||
|
{
|
||||||
|
for(uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); )
|
||||||
|
{
|
||||||
|
LLViewerInventoryItem* item = gInventory.getItem(*it);
|
||||||
|
if(!item)
|
||||||
|
{
|
||||||
|
it = mIncomplete.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(item->isComplete())
|
||||||
|
{
|
||||||
|
mComplete.push_back(*it);
|
||||||
|
it = mIncomplete.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
if(mIncomplete.empty())
|
||||||
|
{
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryCompletionObserver::watchItem(const LLUUID& id)
|
||||||
|
{
|
||||||
|
if(id.notNull())
|
||||||
|
{
|
||||||
|
mIncomplete.push_back(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const LLUUID& item_id)
|
||||||
|
{
|
||||||
|
mIDs.clear();
|
||||||
|
if (item_id != LLUUID::null)
|
||||||
|
{
|
||||||
|
mIDs.push_back(item_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids)
|
||||||
|
: mIDs(item_ids)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL LLInventoryFetchItemsObserver::isFinished() const
|
||||||
|
{
|
||||||
|
return mIncomplete.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryFetchItemsObserver::changed(U32 mask)
|
||||||
|
{
|
||||||
|
lldebugs << this << " remaining incomplete " << mIncomplete.size()
|
||||||
|
<< " complete " << mComplete.size()
|
||||||
|
<< " wait period " << mFetchingPeriod.getRemainingTimeF32()
|
||||||
|
<< llendl;
|
||||||
|
|
||||||
|
// scan through the incomplete items and move or erase them as
|
||||||
|
// appropriate.
|
||||||
|
if (!mIncomplete.empty())
|
||||||
|
{
|
||||||
|
// Have we exceeded max wait time?
|
||||||
|
bool timeout_expired = mFetchingPeriod.hasExpired();
|
||||||
|
|
||||||
|
for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); )
|
||||||
|
{
|
||||||
|
const LLUUID& item_id = (*it);
|
||||||
|
LLViewerInventoryItem* item = gInventory.getItem(item_id);
|
||||||
|
if (item && item->isComplete())
|
||||||
|
{
|
||||||
|
mComplete.push_back(item_id);
|
||||||
|
it = mIncomplete.erase(it);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (timeout_expired)
|
||||||
|
{
|
||||||
|
// Just concede that this item hasn't arrived in reasonable time and continue on.
|
||||||
|
llwarns << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL;
|
||||||
|
it = mIncomplete.erase(it);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Keep trying.
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mIncomplete.empty())
|
||||||
|
{
|
||||||
|
lldebugs << this << " done at remaining incomplete "
|
||||||
|
<< mIncomplete.size() << " complete " << mComplete.size() << llendl;
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
//llinfos << "LLInventoryFetchItemsObserver::changed() mComplete size " << mComplete.size() << llendl;
|
||||||
|
//llinfos << "LLInventoryFetchItemsObserver::changed() mIncomplete size " << mIncomplete.size() << llendl;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryFetchItemsObserver::startFetch()
|
||||||
|
{
|
||||||
|
LLUUID owner_id;
|
||||||
|
LLSD items_llsd;
|
||||||
|
for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it)
|
||||||
|
{
|
||||||
|
LLViewerInventoryItem* item = gInventory.getItem(*it);
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
if (item->isComplete())
|
||||||
|
{
|
||||||
|
// It's complete, so put it on the complete container.
|
||||||
|
mComplete.push_back(*it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
owner_id = item->getPermissions().getOwner();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// assume it's agent inventory.
|
||||||
|
owner_id = gAgent.getID();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ignore categories since they're not items. We
|
||||||
|
// could also just add this to mComplete but not sure what the
|
||||||
|
// side-effects would be, so ignoring to be safe.
|
||||||
|
LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
|
||||||
|
if (cat)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// It's incomplete, so put it on the incomplete container, and
|
||||||
|
// pack this on the message.
|
||||||
|
mIncomplete.push_back(*it);
|
||||||
|
|
||||||
|
// Prepare the data to fetch
|
||||||
|
LLSD item_entry;
|
||||||
|
item_entry["owner_id"] = owner_id;
|
||||||
|
item_entry["item_id"] = (*it);
|
||||||
|
items_llsd.append(item_entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
mFetchingPeriod.reset();
|
||||||
|
mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY);
|
||||||
|
|
||||||
|
fetch_items_from_llsd(items_llsd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryFetchObserver::changed(U32 mask)
|
||||||
|
{
|
||||||
|
// scan through the incomplete items and move or erase them as
|
||||||
|
// appropriate.
|
||||||
|
if(!mIncomplete.empty())
|
||||||
|
{
|
||||||
|
for(uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); )
|
||||||
|
{
|
||||||
|
LLViewerInventoryItem* item = gInventory.getItem(*it);
|
||||||
|
if(!item)
|
||||||
|
{
|
||||||
|
// BUG: This can cause done() to get called prematurely below.
|
||||||
|
// This happens with the LLGestureInventoryFetchObserver that
|
||||||
|
// loads gestures at startup. JC
|
||||||
|
it = mIncomplete.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(item->isComplete())
|
||||||
|
{
|
||||||
|
mComplete.push_back(*it);
|
||||||
|
it = mIncomplete.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
if(mIncomplete.empty())
|
||||||
|
{
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//llinfos << "LLInventoryFetchObserver::changed() mComplete size " << mComplete.size() << llendl;
|
||||||
|
//llinfos << "LLInventoryFetchObserver::changed() mIncomplete size " << mIncomplete.size() << llendl;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LLInventoryFetchObserver::isEverythingComplete() const
|
||||||
|
{
|
||||||
|
return mIncomplete.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void fetch_items_from_llsd(const LLSD& items_llsd)
|
||||||
|
{
|
||||||
|
if (!items_llsd.size() || gDisconnected) return;
|
||||||
|
LLSD body;
|
||||||
|
body[0]["cap_name"] = "FetchInventory";
|
||||||
|
body[1]["cap_name"] = "FetchLib";
|
||||||
|
for (S32 i=0; i<items_llsd.size();i++)
|
||||||
|
{
|
||||||
|
if (items_llsd[i]["owner_id"].asString() == gAgent.getID().asString())
|
||||||
|
{
|
||||||
|
body[0]["items"].append(items_llsd[i]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (items_llsd[i]["owner_id"].asString() == ALEXANDRIA_LINDEN_ID.asString())
|
||||||
|
{
|
||||||
|
body[1]["items"].append(items_llsd[i]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (S32 i=0; i<body.size(); i++)
|
||||||
|
{
|
||||||
|
if (!gAgent.getRegion())
|
||||||
|
{
|
||||||
|
llwarns << "Agent's region is null" << llendl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 == body[i]["items"].size()) {
|
||||||
|
lldebugs << "Skipping body with no items to fetch" << llendl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string url = gAgent.getRegion()->getCapability(body[i]["cap_name"].asString());
|
||||||
|
if (!url.empty())
|
||||||
|
{
|
||||||
|
body[i]["agent_id"] = gAgent.getID();
|
||||||
|
LLHTTPClient::post(url, body[i], new LLInventoryModel::fetchInventoryResponder(body[i]));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLMessageSystem* msg = gMessageSystem;
|
||||||
|
BOOL start_new_message = TRUE;
|
||||||
|
for (S32 j=0; j<body[i]["items"].size(); j++)
|
||||||
|
{
|
||||||
|
LLSD item_entry = body[i]["items"][j];
|
||||||
|
if(start_new_message)
|
||||||
|
{
|
||||||
|
start_new_message = FALSE;
|
||||||
|
msg->newMessageFast(_PREHASH_FetchInventory);
|
||||||
|
msg->nextBlockFast(_PREHASH_AgentData);
|
||||||
|
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||||
|
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||||
|
}
|
||||||
|
msg->nextBlockFast(_PREHASH_InventoryData);
|
||||||
|
msg->addUUIDFast(_PREHASH_OwnerID, item_entry["owner_id"].asUUID());
|
||||||
|
msg->addUUIDFast(_PREHASH_ItemID, item_entry["item_id"].asUUID());
|
||||||
|
if(msg->isSendFull(NULL))
|
||||||
|
{
|
||||||
|
start_new_message = TRUE;
|
||||||
|
gAgent.sendReliableMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!start_new_message)
|
||||||
|
{
|
||||||
|
gAgent.sendReliableMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryFetchObserver::fetchItems(
|
||||||
|
const uuid_vec_t& ids)
|
||||||
|
{
|
||||||
|
LLUUID owner_id;
|
||||||
|
LLSD items_llsd;
|
||||||
|
for(uuid_vec_t::const_iterator it = ids.begin(); it < ids.end(); ++it)
|
||||||
|
{
|
||||||
|
LLViewerInventoryItem* item = gInventory.getItem(*it);
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if(item->isComplete())
|
||||||
|
{
|
||||||
|
// It's complete, so put it on the complete container.
|
||||||
|
mComplete.push_back(*it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
owner_id = item->getPermissions().getOwner();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// assume it's agent inventory.
|
||||||
|
owner_id = gAgent.getID();
|
||||||
|
}
|
||||||
|
|
||||||
|
// It's incomplete, so put it on the incomplete container, and
|
||||||
|
// pack this on the message.
|
||||||
|
mIncomplete.push_back(*it);
|
||||||
|
|
||||||
|
// Prepare the data to fetch
|
||||||
|
LLSD item_entry;
|
||||||
|
item_entry["owner_id"] = owner_id;
|
||||||
|
item_entry["item_id"] = (*it);
|
||||||
|
items_llsd.append(item_entry);
|
||||||
|
}
|
||||||
|
fetch_items_from_llsd(items_llsd);
|
||||||
|
}
|
||||||
|
// virtual
|
||||||
|
void LLInventoryFetchDescendentsObserver::changed(U32 mask)
|
||||||
|
{
|
||||||
|
for(folder_ref_t::iterator it = mIncompleteFolders.begin(); it < mIncompleteFolders.end();)
|
||||||
|
{
|
||||||
|
LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
|
||||||
|
if(!cat)
|
||||||
|
{
|
||||||
|
it = mIncompleteFolders.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(isComplete(cat))
|
||||||
|
{
|
||||||
|
mCompleteFolders.push_back(*it);
|
||||||
|
it = mIncompleteFolders.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
if(mIncompleteFolders.empty())
|
||||||
|
{
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryFetchDescendentsObserver::fetchDescendents(
|
||||||
|
const folder_ref_t& ids)
|
||||||
|
{
|
||||||
|
for(folder_ref_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
|
||||||
|
{
|
||||||
|
LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
|
||||||
|
if(!cat) continue;
|
||||||
|
if(!isComplete(cat))
|
||||||
|
{
|
||||||
|
cat->fetchDescendents(); //blindly fetch it without seeing if anything else is fetching it.
|
||||||
|
mIncompleteFolders.push_back(*it); //Add to list of things being downloaded for this observer.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mCompleteFolders.push_back(*it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LLInventoryFetchDescendentsObserver::isEverythingComplete() const
|
||||||
|
{
|
||||||
|
return mIncompleteFolders.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* cat)
|
||||||
|
{
|
||||||
|
S32 version = cat->getVersion();
|
||||||
|
S32 descendents = cat->getDescendentCount();
|
||||||
|
if((LLViewerInventoryCategory::VERSION_UNKNOWN == version)
|
||||||
|
|| (LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN == descendents))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// it might be complete - check known descendents against
|
||||||
|
// currently available.
|
||||||
|
LLInventoryModel::cat_array_t* cats;
|
||||||
|
LLInventoryModel::item_array_t* items;
|
||||||
|
gInventory.getDirectDescendentsOf(cat->getUUID(), cats, items);
|
||||||
|
if(!cats || !items)
|
||||||
|
{
|
||||||
|
// bit of a hack - pretend we're done if they are gone or
|
||||||
|
// incomplete. should never know, but it would suck if this
|
||||||
|
// kept tight looping because of a corrupt memory state.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
S32 known = cats->count() + items->count();
|
||||||
|
if(descendents == known)
|
||||||
|
{
|
||||||
|
// hey - we're done.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryFetchComboObserver::changed(U32 mask)
|
||||||
|
{
|
||||||
|
if(!mIncompleteItems.empty())
|
||||||
|
{
|
||||||
|
for(item_ref_t::iterator it = mIncompleteItems.begin(); it < mIncompleteItems.end(); )
|
||||||
|
{
|
||||||
|
LLViewerInventoryItem* item = gInventory.getItem(*it);
|
||||||
|
if(!item)
|
||||||
|
{
|
||||||
|
it = mIncompleteItems.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(item->isComplete())
|
||||||
|
{
|
||||||
|
mCompleteItems.push_back(*it);
|
||||||
|
it = mIncompleteItems.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!mIncompleteFolders.empty())
|
||||||
|
{
|
||||||
|
for(folder_ref_t::iterator it = mIncompleteFolders.begin(); it < mIncompleteFolders.end();)
|
||||||
|
{
|
||||||
|
LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
|
||||||
|
if(!cat)
|
||||||
|
{
|
||||||
|
it = mIncompleteFolders.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(gInventory.isCategoryComplete(*it))
|
||||||
|
{
|
||||||
|
mCompleteFolders.push_back(*it);
|
||||||
|
it = mIncompleteFolders.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!mDone && mIncompleteItems.empty() && mIncompleteFolders.empty())
|
||||||
|
{
|
||||||
|
mDone = true;
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryFetchComboObserver::fetch(
|
||||||
|
const folder_ref_t& folder_ids,
|
||||||
|
const item_ref_t& item_ids)
|
||||||
|
{
|
||||||
|
lldebugs << "LLInventoryFetchComboObserver::fetch()" << llendl;
|
||||||
|
for(folder_ref_t::const_iterator fit = folder_ids.begin(); fit != folder_ids.end(); ++fit)
|
||||||
|
{
|
||||||
|
LLViewerInventoryCategory* cat = gInventory.getCategory(*fit);
|
||||||
|
if(!cat) continue;
|
||||||
|
if(!gInventory.isCategoryComplete(*fit))
|
||||||
|
{
|
||||||
|
cat->fetchDescendents();
|
||||||
|
lldebugs << "fetching folder " << *fit <<llendl;
|
||||||
|
mIncompleteFolders.push_back(*fit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mCompleteFolders.push_back(*fit);
|
||||||
|
lldebugs << "completing folder " << *fit <<llendl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now for the items - we fetch everything which is not a direct
|
||||||
|
// descendent of an incomplete folder because the item will show
|
||||||
|
// up in an inventory descendents message soon enough so we do not
|
||||||
|
// have to fetch it individually.
|
||||||
|
LLSD items_llsd;
|
||||||
|
LLUUID owner_id;
|
||||||
|
for(item_ref_t::const_iterator iit = item_ids.begin(); iit != item_ids.end(); ++iit)
|
||||||
|
{
|
||||||
|
LLViewerInventoryItem* item = gInventory.getItem(*iit);
|
||||||
|
if(!item)
|
||||||
|
{
|
||||||
|
lldebugs << "uanble to find item " << *iit << llendl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(item->isComplete())
|
||||||
|
{
|
||||||
|
// It's complete, so put it on the complete container.
|
||||||
|
mCompleteItems.push_back(*iit);
|
||||||
|
lldebugs << "completing item " << *iit << llendl;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mIncompleteItems.push_back(*iit);
|
||||||
|
owner_id = item->getPermissions().getOwner();
|
||||||
|
}
|
||||||
|
if(std::find(mIncompleteFolders.begin(), mIncompleteFolders.end(), item->getParentUUID()) == mIncompleteFolders.end())
|
||||||
|
{
|
||||||
|
LLSD item_entry;
|
||||||
|
item_entry["owner_id"] = owner_id;
|
||||||
|
item_entry["item_id"] = (*iit);
|
||||||
|
items_llsd.append(item_entry);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lldebugs << "not worrying about " << *iit << llendl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fetch_items_from_llsd(items_llsd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryExistenceObserver::watchItem(const LLUUID& id)
|
||||||
|
{
|
||||||
|
if(id.notNull())
|
||||||
|
{
|
||||||
|
mMIA.push_back(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryExistenceObserver::changed(U32 mask)
|
||||||
|
{
|
||||||
|
// scan through the incomplete items and move or erase them as
|
||||||
|
// appropriate.
|
||||||
|
if(!mMIA.empty())
|
||||||
|
{
|
||||||
|
for(uuid_vec_t::iterator it = mMIA.begin(); it < mMIA.end(); )
|
||||||
|
{
|
||||||
|
LLViewerInventoryItem* item = gInventory.getItem(*it);
|
||||||
|
if(!item)
|
||||||
|
{
|
||||||
|
++it;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
mExist.push_back(*it);
|
||||||
|
it = mMIA.erase(it);
|
||||||
|
}
|
||||||
|
if(mMIA.empty())
|
||||||
|
{
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void LLInventoryAddedObserver::changed(U32 mask)
|
||||||
|
{
|
||||||
|
if(!(mask & LLInventoryObserver::ADD))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// *HACK: If this was in response to a packet off
|
||||||
|
// the network, figure out which item was updated.
|
||||||
|
LLMessageSystem* msg = gMessageSystem;
|
||||||
|
|
||||||
|
std::string msg_name = msg->getMessageName();
|
||||||
|
if (msg_name.empty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We only want newly created inventory items. JC
|
||||||
|
if ( msg_name != "UpdateCreateInventoryItem")
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
|
||||||
|
S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_InventoryData);
|
||||||
|
for(S32 i = 0; i < num_blocks; ++i)
|
||||||
|
{
|
||||||
|
titem->unpackMessage(msg, _PREHASH_InventoryData, i);
|
||||||
|
if (!(titem->getUUID().isNull()))
|
||||||
|
{
|
||||||
|
//we don't do anything with null keys
|
||||||
|
mAdded.push_back(titem->getUUID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!mAdded.empty())
|
||||||
|
{
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LLInventoryTransactionObserver::LLInventoryTransactionObserver(const LLTransactionID& transaction_id) :
|
||||||
|
mTransactionID(transaction_id)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLInventoryTransactionObserver::changed(U32 mask)
|
||||||
|
{
|
||||||
|
if(mask & LLInventoryObserver::ADD)
|
||||||
|
{
|
||||||
|
// This could be it - see if we are processing a bulk update
|
||||||
|
LLMessageSystem* msg = gMessageSystem;
|
||||||
|
if(msg->getMessageName()
|
||||||
|
&& (0 == strcmp(msg->getMessageName(), "BulkUpdateInventory")))
|
||||||
|
{
|
||||||
|
// we have a match for the message - now check the
|
||||||
|
// transaction id.
|
||||||
|
LLUUID id;
|
||||||
|
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_TransactionID, id);
|
||||||
|
if(id == mTransactionID)
|
||||||
|
{
|
||||||
|
// woo hoo, we found it
|
||||||
|
uuid_vec_t folders;
|
||||||
|
uuid_vec_t items;
|
||||||
|
S32 count;
|
||||||
|
count = msg->getNumberOfBlocksFast(_PREHASH_FolderData);
|
||||||
|
S32 i;
|
||||||
|
for(i = 0; i < count; ++i)
|
||||||
|
{
|
||||||
|
msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_FolderID, id, i);
|
||||||
|
if(id.notNull())
|
||||||
|
{
|
||||||
|
folders.push_back(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
count = msg->getNumberOfBlocksFast(_PREHASH_ItemData);
|
||||||
|
for(i = 0; i < count; ++i)
|
||||||
|
{
|
||||||
|
msg->getUUIDFast(_PREHASH_ItemData, _PREHASH_ItemID, id, i);
|
||||||
|
if(id.notNull())
|
||||||
|
{
|
||||||
|
items.push_back(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// call the derived class the implements this method.
|
||||||
|
done(folders, items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
257
indra/newview/llinventoryobserver.h
Normal file
257
indra/newview/llinventoryobserver.h
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
/**
|
||||||
|
* @file llinventoryobserver.h
|
||||||
|
* @brief LLInventoryObserver class header file
|
||||||
|
*
|
||||||
|
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||||
|
* Second Life Viewer Source Code
|
||||||
|
* Copyright (C) 2010, Linden Research, Inc.
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation;
|
||||||
|
* version 2.1 of the License only.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
*
|
||||||
|
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||||
|
* $/LicenseInfo$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LL_LLINVENTORYOBSERVERS_H
|
||||||
|
#define LL_LLINVENTORYOBSERVERS_H
|
||||||
|
|
||||||
|
#include "lluuid.h"
|
||||||
|
#include "llmd5.h"
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
class LLViewerInventoryCategory;
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryObserver
|
||||||
|
//
|
||||||
|
// A simple abstract base class that can relay messages when the inventory
|
||||||
|
// changes.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
// This enumeration is a way to refer to what changed in a more
|
||||||
|
// human readable format. You can mask the value provided by
|
||||||
|
// chaged() to see if the observer is interested in the change.
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
NONE = 0,
|
||||||
|
LABEL = 1, // name changed
|
||||||
|
INTERNAL = 2, // internal change, eg, asset uuid different
|
||||||
|
ADD = 4, // something added
|
||||||
|
REMOVE = 8, // something deleted
|
||||||
|
STRUCTURE = 16, // structural change, eg, item or folder moved
|
||||||
|
CALLING_CARD = 32, // online, grant status, cancel, etc change
|
||||||
|
ALL = 0xffffffff
|
||||||
|
};
|
||||||
|
virtual ~LLInventoryObserver() {};
|
||||||
|
virtual void changed(U32 mask) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryFetchObserver
|
||||||
|
//
|
||||||
|
// This class is much like the LLInventoryCompletionObserver, except
|
||||||
|
// that it handles all the the fetching necessary. Override the done()
|
||||||
|
// method to do the thing you want.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
class LLInventoryFetchObserver : public LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLInventoryFetchObserver() {}
|
||||||
|
virtual void changed(U32 mask);
|
||||||
|
|
||||||
|
bool isEverythingComplete() const;
|
||||||
|
void fetchItems(const uuid_vec_t& ids);
|
||||||
|
virtual void done() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
uuid_vec_t mComplete;
|
||||||
|
uuid_vec_t mIncomplete;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LLInventoryFetchItemsObserver : public LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null);
|
||||||
|
LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids);
|
||||||
|
|
||||||
|
BOOL isFinished() const;
|
||||||
|
|
||||||
|
virtual void startFetch();
|
||||||
|
virtual void changed(U32 mask);
|
||||||
|
virtual void done() {};
|
||||||
|
protected:
|
||||||
|
uuid_vec_t mComplete;
|
||||||
|
uuid_vec_t mIncomplete;
|
||||||
|
uuid_vec_t mIDs;
|
||||||
|
private:
|
||||||
|
LLTimer mFetchingPeriod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Period of waiting a notification when requested items get added into inventory.
|
||||||
|
*/
|
||||||
|
static const F32 FETCH_TIMER_EXPIRY;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryFetchDescendentsObserver
|
||||||
|
//
|
||||||
|
// This class is much like the LLInventoryCompletionObserver, except
|
||||||
|
// that it handles fetching based on category. Override the done()
|
||||||
|
// method to do the thing you want.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLInventoryFetchDescendentsObserver : public LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLInventoryFetchDescendentsObserver() {}
|
||||||
|
virtual void changed(U32 mask);
|
||||||
|
|
||||||
|
typedef std::vector<LLUUID> folder_ref_t;
|
||||||
|
void fetchDescendents(const folder_ref_t& ids);
|
||||||
|
bool isEverythingComplete() const;
|
||||||
|
virtual void done() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool isComplete(LLViewerInventoryCategory* cat);
|
||||||
|
folder_ref_t mIncompleteFolders;
|
||||||
|
folder_ref_t mCompleteFolders;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryFetchComboObserver
|
||||||
|
//
|
||||||
|
// This class does an appropriate combination of fetch descendents and
|
||||||
|
// item fetches based on completion of categories and items. Much like
|
||||||
|
// the fetch and fetch descendents, this will call done() when everything
|
||||||
|
// has arrived.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLInventoryFetchComboObserver : public LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLInventoryFetchComboObserver() : mDone(false) {}
|
||||||
|
virtual void changed(U32 mask);
|
||||||
|
|
||||||
|
typedef std::vector<LLUUID> folder_ref_t;
|
||||||
|
typedef std::vector<LLUUID> item_ref_t;
|
||||||
|
void fetch(const folder_ref_t& folder_ids, const item_ref_t& item_ids);
|
||||||
|
|
||||||
|
virtual void done() = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool mDone;
|
||||||
|
folder_ref_t mCompleteFolders;
|
||||||
|
folder_ref_t mIncompleteFolders;
|
||||||
|
item_ref_t mCompleteItems;
|
||||||
|
item_ref_t mIncompleteItems;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryExistenceObserver
|
||||||
|
//
|
||||||
|
// This class is used as a base class for doing somethign when all the
|
||||||
|
// observed item ids exist in the inventory somewhere. You can derive
|
||||||
|
// a class from this class and implement the done() method to do
|
||||||
|
// something useful.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
class LLInventoryExistenceObserver : public LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLInventoryExistenceObserver() {}
|
||||||
|
virtual void changed(U32 mask);
|
||||||
|
|
||||||
|
void watchItem(const LLUUID& id);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void done() = 0;
|
||||||
|
|
||||||
|
uuid_vec_t mExist;
|
||||||
|
uuid_vec_t mMIA;
|
||||||
|
};
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryAddedObserver
|
||||||
|
//
|
||||||
|
// This class is used as a base class for doing something when
|
||||||
|
// a new item arrives in inventory.
|
||||||
|
// It does not watch for a certain UUID, rather it acts when anything is added
|
||||||
|
// Derive a class from this class and implement the done() method to do
|
||||||
|
// something useful.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLInventoryAddedObserver : public LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLInventoryAddedObserver() : mAdded() {}
|
||||||
|
virtual void changed(U32 mask);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void done() = 0;
|
||||||
|
|
||||||
|
typedef std::vector<LLUUID> item_ref_t;
|
||||||
|
item_ref_t mAdded;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryTransactionObserver
|
||||||
|
//
|
||||||
|
// Class which can be used as a base class for doing something when an
|
||||||
|
// inventory transaction completes.
|
||||||
|
//
|
||||||
|
// *NOTE: This class is not quite complete. Avoid using unless you fix up it's
|
||||||
|
// functionality gaps.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
class LLInventoryTransactionObserver : public LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLInventoryTransactionObserver(const LLTransactionID& transaction_id);
|
||||||
|
virtual void changed(U32 mask);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
typedef std::vector<LLUUID> folder_ref_t;
|
||||||
|
typedef std::vector<LLUUID> item_ref_t;
|
||||||
|
virtual void done(const folder_ref_t& folders, const item_ref_t& items) = 0;
|
||||||
|
|
||||||
|
LLTransactionID mTransactionID;
|
||||||
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLInventoryCompletionObserver
|
||||||
|
//
|
||||||
|
// Class which can be used as a base class for doing something when
|
||||||
|
// when all observed items are locally complete. This class implements
|
||||||
|
// the changed() method of LLInventoryObserver and declares a new
|
||||||
|
// method named done() which is called when all watched items have
|
||||||
|
// complete information in the inventory model.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLInventoryCompletionObserver : public LLInventoryObserver
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLInventoryCompletionObserver() {}
|
||||||
|
virtual void changed(U32 mask);
|
||||||
|
|
||||||
|
void watchItem(const LLUUID& id);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void done() = 0;
|
||||||
|
|
||||||
|
uuid_vec_t mComplete;
|
||||||
|
uuid_vec_t mIncomplete;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // LL_LLINVENTORYOBSERVERS_H
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
#include "llfolderview.h"
|
#include "llfolderview.h"
|
||||||
#include "llgesturemgr.h"
|
#include "llgesturemgr.h"
|
||||||
#include "lliconctrl.h"
|
#include "lliconctrl.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryclipboard.h"
|
#include "llinventoryclipboard.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
#include "llmenugl.h"
|
#include "llmenugl.h"
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "llinventory.h"
|
#include "llinventory.h"
|
||||||
#include "llfolderview.h"
|
#include "llfolderview.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventorymodel.h"
|
||||||
|
#include "llinventoryobserver.h"
|
||||||
#include "llmemberlistener.h"
|
#include "llmemberlistener.h"
|
||||||
#include "llcombobox.h"
|
#include "llcombobox.h"
|
||||||
#include "lluictrlfactory.h"
|
#include "lluictrlfactory.h"
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#include "llcolorswatch.h"
|
#include "llcolorswatch.h"
|
||||||
#include "llcombobox.h"
|
#include "llcombobox.h"
|
||||||
#include "llfocusmgr.h"
|
#include "llfocusmgr.h"
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
#include "llmanipscale.h"
|
#include "llmanipscale.h"
|
||||||
#include "llnotificationsutil.h"
|
#include "llnotificationsutil.h"
|
||||||
#include "llpanelinventory.h"
|
#include "llpanelinventory.h"
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
#include "llviewerinventory.h"
|
#include "llviewerinventory.h"
|
||||||
#include "lltabcontainer.h"
|
#include "lltabcontainer.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventorymodel.h"
|
||||||
|
#include "llinventoryobserver.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
class LLLineEditor;
|
class LLLineEditor;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
#include "lldelayedgestureerror.h"
|
#include "lldelayedgestureerror.h"
|
||||||
#include "llfloatergesture.h" // for some label constants
|
#include "llfloatergesture.h" // for some label constants
|
||||||
#include "llgesturemgr.h"
|
#include "llgesturemgr.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llkeyboard.h"
|
#include "llkeyboard.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
#include "llnotificationsutil.h"
|
#include "llnotificationsutil.h"
|
||||||
@@ -95,8 +95,8 @@ protected:
|
|||||||
void LLInventoryGestureAvailable::done()
|
void LLInventoryGestureAvailable::done()
|
||||||
{
|
{
|
||||||
LLPreview* preview = NULL;
|
LLPreview* preview = NULL;
|
||||||
item_ref_t::iterator it = mComplete.begin();
|
uuid_vec_t::iterator it = mComplete.begin();
|
||||||
item_ref_t::iterator end = mComplete.end();
|
uuid_vec_t::iterator end = mComplete.end();
|
||||||
for(; it < end; ++it)
|
for(; it < end; ++it)
|
||||||
{
|
{
|
||||||
preview = LLPreview::find((*it));
|
preview = LLPreview::find((*it));
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
#include "llhttpclient.h"
|
#include "llhttpclient.h"
|
||||||
#include "llimagebmp.h"
|
#include "llimagebmp.h"
|
||||||
#include "llimview.h" // for gIMMgr
|
#include "llimview.h" // for gIMMgr
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
#include "llkeyboard.h"
|
#include "llkeyboard.h"
|
||||||
#include "llloginhandler.h" // gLoginHandler, SLURL support
|
#include "llloginhandler.h" // gLoginHandler, SLURL support
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
#include "llfocusmgr.h"
|
#include "llfocusmgr.h"
|
||||||
#include "llfolderview.h"
|
#include "llfolderview.h"
|
||||||
#include "llinventory.h"
|
#include "llinventory.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
#include "llui.h"
|
#include "llui.h"
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
#include "llhudmanager.h"
|
#include "llhudmanager.h"
|
||||||
#include "llinventorybridge.h"
|
#include "llinventorybridge.h"
|
||||||
#include "llinventorydefines.h"
|
#include "llinventorydefines.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
#include "llmutelist.h"
|
#include "llmutelist.h"
|
||||||
#include "llnotify.h"
|
#include "llnotify.h"
|
||||||
@@ -287,8 +287,8 @@ void LLCategoryDropObserver::done()
|
|||||||
{
|
{
|
||||||
// *FIX: coalesce these...
|
// *FIX: coalesce these...
|
||||||
LLInventoryItem* item = NULL;
|
LLInventoryItem* item = NULL;
|
||||||
item_ref_t::iterator it = mComplete.begin();
|
uuid_vec_t::iterator it = mComplete.begin();
|
||||||
item_ref_t::iterator end = mComplete.end();
|
uuid_vec_t::iterator end = mComplete.end();
|
||||||
for(; it < end; ++it)
|
for(; it < end; ++it)
|
||||||
{
|
{
|
||||||
item = gInventory.getItem(*it);
|
item = gInventory.getItem(*it);
|
||||||
@@ -346,8 +346,8 @@ void LLCategoryDropDescendentsObserver::done()
|
|||||||
{
|
{
|
||||||
unique_ids.insert(items.get(i)->getUUID());
|
unique_ids.insert(items.get(i)->getUUID());
|
||||||
}
|
}
|
||||||
LLInventoryFetchObserver::item_ref_t ids;
|
uuid_vec_t ids;
|
||||||
std::back_insert_iterator<LLInventoryFetchObserver::item_ref_t> copier(ids);
|
std::back_insert_iterator<uuid_vec_t> copier(ids);
|
||||||
std::copy(unique_ids.begin(), unique_ids.end(), copier);
|
std::copy(unique_ids.begin(), unique_ids.end(), copier);
|
||||||
LLCategoryDropObserver* dropper;
|
LLCategoryDropObserver* dropper;
|
||||||
dropper = new LLCategoryDropObserver(mObjectID, mSource);
|
dropper = new LLCategoryDropObserver(mObjectID, mSource);
|
||||||
@@ -2812,7 +2812,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory(
|
|||||||
if(drop && (ACCEPT_YES_COPY_SINGLE <= rv))
|
if(drop && (ACCEPT_YES_COPY_SINGLE <= rv))
|
||||||
{
|
{
|
||||||
S32 count = items.count();
|
S32 count = items.count();
|
||||||
LLInventoryFetchObserver::item_ref_t ids;
|
uuid_vec_t ids;
|
||||||
for(i = 0; i < count; ++i)
|
for(i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
//dropInventory(root_object, items.get(i), mSource, mSourceID);
|
//dropInventory(root_object, items.get(i), mSource, mSourceID);
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
#include "llhudtext.h"
|
#include "llhudtext.h"
|
||||||
#include "llhudview.h"
|
#include "llhudview.h"
|
||||||
#include "llinventorydefines.h"
|
#include "llinventorydefines.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryobserver.h"
|
||||||
#include "lllandmarklist.h"
|
#include "lllandmarklist.h"
|
||||||
#include "llprogressview.h"
|
#include "llprogressview.h"
|
||||||
#include "llsky.h"
|
#include "llsky.h"
|
||||||
|
|||||||
@@ -170,7 +170,7 @@
|
|||||||
#include "llimagej2c.h"
|
#include "llimagej2c.h"
|
||||||
#include "llimagetga.h"
|
#include "llimagetga.h"
|
||||||
#include "llinventorydefines.h"
|
#include "llinventorydefines.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryfunctions.h"
|
||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
#include "llkeyboard.h"
|
#include "llkeyboard.h"
|
||||||
#include "llpanellogin.h"
|
#include "llpanellogin.h"
|
||||||
@@ -7179,7 +7179,7 @@ class LLAttachmentEnableDrop : public view_listener_t
|
|||||||
// if a fetch is already out there (being sent from a slow sim)
|
// if a fetch is already out there (being sent from a slow sim)
|
||||||
// we refetch and there are 2 fetches
|
// we refetch and there are 2 fetches
|
||||||
LLWornItemFetchedObserver* wornItemFetched = new LLWornItemFetchedObserver();
|
LLWornItemFetchedObserver* wornItemFetched = new LLWornItemFetchedObserver();
|
||||||
LLInventoryFetchObserver::item_ref_t items; //add item to the inventory item to be fetched
|
uuid_vec_t items; //add item to the inventory item to be fetched
|
||||||
|
|
||||||
items.push_back((*attachment_iter)->getAttachmentItemID());
|
items.push_back((*attachment_iter)->getAttachmentItemID());
|
||||||
|
|
||||||
|
|||||||
@@ -1309,7 +1309,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
|
|||||||
#endif // RLV_EXTENSION_GIVETORLV_A2A
|
#endif // RLV_EXTENSION_GIVETORLV_A2A
|
||||||
// [/RLVa:KB]
|
// [/RLVa:KB]
|
||||||
|
|
||||||
LLInventoryFetchObserver::item_ref_t items;
|
uuid_vec_t items;
|
||||||
items.push_back(mObjectID);
|
items.push_back(mObjectID);
|
||||||
LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string);
|
LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string);
|
||||||
open_agent_offer->fetchItems(items);
|
open_agent_offer->fetchItems(items);
|
||||||
|
|||||||
@@ -62,6 +62,7 @@
|
|||||||
#include "llfloaternamedesc.h"
|
#include "llfloaternamedesc.h"
|
||||||
#include "llfloatersnapshot.h"
|
#include "llfloatersnapshot.h"
|
||||||
#include "llinventorymodel.h" // gInventory
|
#include "llinventorymodel.h" // gInventory
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
#include "llnotificationsutil.h"
|
#include "llnotificationsutil.h"
|
||||||
#include "llresourcedata.h"
|
#include "llresourcedata.h"
|
||||||
#include "llselectmgr.h"
|
#include "llselectmgr.h"
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
#include "llhudmanager.h"
|
#include "llhudmanager.h"
|
||||||
#include "llinventorybridge.h"
|
#include "llinventorybridge.h"
|
||||||
#include "llinventoryview.h"
|
#include "llinventoryview.h"
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
#include "llhudnametag.h"
|
#include "llhudnametag.h"
|
||||||
#include "llhudtext.h" // for mText/mDebugText
|
#include "llhudtext.h" // for mText/mDebugText
|
||||||
#include "llkeyframefallmotion.h"
|
#include "llkeyframefallmotion.h"
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
#include "llassetuploadresponders.h"
|
#include "llassetuploadresponders.h"
|
||||||
#include "llviewerwindow.h"
|
#include "llviewerwindow.h"
|
||||||
#include "llfloatercustomize.h"
|
#include "llfloatercustomize.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryobserver.h"
|
||||||
#include "llviewertexturelist.h"
|
#include "llviewertexturelist.h"
|
||||||
#include "llviewerinventory.h"
|
#include "llviewerinventory.h"
|
||||||
#include "llviewerregion.h"
|
#include "llviewerregion.h"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
#include "llboost.h"
|
#include "llboost.h"
|
||||||
#include "llgesturemgr.h"
|
#include "llgesturemgr.h"
|
||||||
#include "llinventorymodel.h"
|
#include "llinventoryobserver.h"
|
||||||
#include "llviewerinventory.h"
|
#include "llviewerinventory.h"
|
||||||
#include "llvoavatar.h"
|
#include "llvoavatar.h"
|
||||||
#include "llwlparamset.h"
|
#include "llwlparamset.h"
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ void RlvInventory::fetchWornItem(const LLUUID& idItem)
|
|||||||
{
|
{
|
||||||
if (idItem.notNull())
|
if (idItem.notNull())
|
||||||
{
|
{
|
||||||
LLInventoryFetchObserver::item_ref_t idItems;
|
uuid_vec_t idItems;
|
||||||
idItems.push_back(idItem);
|
idItems.push_back(idItem);
|
||||||
RlvItemFetcher itemFetcher;
|
RlvItemFetcher itemFetcher;
|
||||||
itemFetcher.fetchItems(idItems);
|
itemFetcher.fetchItems(idItems);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "llmemory.h"
|
#include "llmemory.h"
|
||||||
#include "llviewerinventory.h"
|
#include "llviewerinventory.h"
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
|
|
||||||
#include "rlvhelper.h"
|
#include "rlvhelper.h"
|
||||||
#include "rlvlocks.h"
|
#include "rlvlocks.h"
|
||||||
|
|||||||
@@ -27,181 +27,3 @@
|
|||||||
#include "rlvviewer2.h"
|
#include "rlvviewer2.h"
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// From llinventoryobserver.cpp
|
|
||||||
|
|
||||||
void fetch_items_from_llsd(const LLSD& items_llsd);
|
|
||||||
|
|
||||||
const F32 LLInventoryFetchItemsObserver::FETCH_TIMER_EXPIRY = 60.0f;
|
|
||||||
|
|
||||||
LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const LLUUID& item_id)
|
|
||||||
{
|
|
||||||
mIDs.clear();
|
|
||||||
if (item_id != LLUUID::null)
|
|
||||||
{
|
|
||||||
mIDs.push_back(item_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids)
|
|
||||||
: mIDs(item_ids)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOL LLInventoryFetchItemsObserver::isFinished() const
|
|
||||||
{
|
|
||||||
return mIncomplete.empty();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLInventoryFetchItemsObserver::changed(U32 mask)
|
|
||||||
{
|
|
||||||
lldebugs << this << " remaining incomplete " << mIncomplete.size()
|
|
||||||
<< " complete " << mComplete.size()
|
|
||||||
<< " wait period " << mFetchingPeriod.getRemainingTimeF32()
|
|
||||||
<< llendl;
|
|
||||||
|
|
||||||
// scan through the incomplete items and move or erase them as
|
|
||||||
// appropriate.
|
|
||||||
if (!mIncomplete.empty())
|
|
||||||
{
|
|
||||||
// Have we exceeded max wait time?
|
|
||||||
bool timeout_expired = mFetchingPeriod.hasExpired();
|
|
||||||
|
|
||||||
for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); )
|
|
||||||
{
|
|
||||||
const LLUUID& item_id = (*it);
|
|
||||||
LLViewerInventoryItem* item = gInventory.getItem(item_id);
|
|
||||||
if (item && item->isComplete())
|
|
||||||
{
|
|
||||||
mComplete.push_back(item_id);
|
|
||||||
it = mIncomplete.erase(it);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (timeout_expired)
|
|
||||||
{
|
|
||||||
// Just concede that this item hasn't arrived in reasonable time and continue on.
|
|
||||||
llwarns << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL;
|
|
||||||
it = mIncomplete.erase(it);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Keep trying.
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mIncomplete.empty())
|
|
||||||
{
|
|
||||||
lldebugs << this << " done at remaining incomplete "
|
|
||||||
<< mIncomplete.size() << " complete " << mComplete.size() << llendl;
|
|
||||||
done();
|
|
||||||
}
|
|
||||||
//llinfos << "LLInventoryFetchItemsObserver::changed() mComplete size " << mComplete.size() << llendl;
|
|
||||||
//llinfos << "LLInventoryFetchItemsObserver::changed() mIncomplete size " << mIncomplete.size() << llendl;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLInventoryFetchItemsObserver::startFetch()
|
|
||||||
{
|
|
||||||
LLUUID owner_id;
|
|
||||||
LLSD items_llsd;
|
|
||||||
for (uuid_vec_t::const_iterator it = mIDs.begin(); it < mIDs.end(); ++it)
|
|
||||||
{
|
|
||||||
LLViewerInventoryItem* item = gInventory.getItem(*it);
|
|
||||||
if (item)
|
|
||||||
{
|
|
||||||
if (item->isComplete())
|
|
||||||
{
|
|
||||||
// It's complete, so put it on the complete container.
|
|
||||||
mComplete.push_back(*it);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
owner_id = item->getPermissions().getOwner();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// assume it's agent inventory.
|
|
||||||
owner_id = gAgent.getID();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ignore categories since they're not items. We
|
|
||||||
// could also just add this to mComplete but not sure what the
|
|
||||||
// side-effects would be, so ignoring to be safe.
|
|
||||||
LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
|
|
||||||
if (cat)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// It's incomplete, so put it on the incomplete container, and
|
|
||||||
// pack this on the message.
|
|
||||||
mIncomplete.push_back(*it);
|
|
||||||
|
|
||||||
// Prepare the data to fetch
|
|
||||||
LLSD item_entry;
|
|
||||||
item_entry["owner_id"] = owner_id;
|
|
||||||
item_entry["item_id"] = (*it);
|
|
||||||
items_llsd.append(item_entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
mFetchingPeriod.reset();
|
|
||||||
mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY);
|
|
||||||
|
|
||||||
fetch_items_from_llsd(items_llsd);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// From llinventoryfunctions.cpp
|
|
||||||
|
|
||||||
void change_item_parent(LLInventoryModel* model, LLViewerInventoryItem* item, const LLUUID& new_parent_id, BOOL restamp)
|
|
||||||
{
|
|
||||||
if (item->getParentUUID() != new_parent_id)
|
|
||||||
{
|
|
||||||
LLInventoryModel::update_list_t update;
|
|
||||||
LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
|
|
||||||
update.push_back(old_folder);
|
|
||||||
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
|
|
||||||
update.push_back(new_folder);
|
|
||||||
gInventory.accountForUpdate(update);
|
|
||||||
|
|
||||||
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
|
|
||||||
new_item->setParent(new_parent_id);
|
|
||||||
new_item->updateParentOnServer(restamp);
|
|
||||||
model->updateItem(new_item);
|
|
||||||
model->notifyObservers();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void change_category_parent(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& new_parent_id, BOOL restamp)
|
|
||||||
{
|
|
||||||
if (!model || !cat)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can't move a folder into a child of itself.
|
|
||||||
if (model->isObjectDescendentOf(new_parent_id, cat->getUUID()))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LLInventoryModel::update_list_t update;
|
|
||||||
LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1);
|
|
||||||
update.push_back(old_folder);
|
|
||||||
LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
|
|
||||||
update.push_back(new_folder);
|
|
||||||
model->accountForUpdate(update);
|
|
||||||
|
|
||||||
LLPointer<LLViewerInventoryCategory> new_cat = new LLViewerInventoryCategory(cat);
|
|
||||||
new_cat->setParent(new_parent_id);
|
|
||||||
new_cat->updateParentOnServer(restamp);
|
|
||||||
model->updateCategory(new_cat);
|
|
||||||
model->notifyObservers();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
|
|||||||
@@ -25,43 +25,9 @@
|
|||||||
#define RLV_VIEWER2_H
|
#define RLV_VIEWER2_H
|
||||||
|
|
||||||
#include "llcallbacklist.h"
|
#include "llcallbacklist.h"
|
||||||
#include "llinventorymodel.h"
|
|
||||||
|
|
||||||
#include "boost/function.hpp"
|
#include "boost/function.hpp"
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// From llinventoryobserver.h
|
|
||||||
|
|
||||||
class LLInventoryFetchItemsObserver : public LLInventoryObserver
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null);
|
|
||||||
LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids);
|
|
||||||
|
|
||||||
BOOL isFinished() const;
|
|
||||||
|
|
||||||
virtual void startFetch();
|
|
||||||
virtual void changed(U32 mask);
|
|
||||||
virtual void done() {};
|
|
||||||
protected:
|
|
||||||
uuid_vec_t mComplete;
|
|
||||||
uuid_vec_t mIncomplete;
|
|
||||||
uuid_vec_t mIDs;
|
|
||||||
private:
|
|
||||||
LLTimer mFetchingPeriod;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Period of waiting a notification when requested items get added into inventory.
|
|
||||||
*/
|
|
||||||
static const F32 FETCH_TIMER_EXPIRY;
|
|
||||||
};
|
|
||||||
|
|
||||||
// ============================================================================
|
|
||||||
// From llinventoryfunctions.cpp
|
|
||||||
|
|
||||||
void change_item_parent(LLInventoryModel* model, LLViewerInventoryItem* item, const LLUUID& new_parent_id, BOOL restamp);
|
|
||||||
void change_category_parent(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& new_parent_id, BOOL restamp);
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
|
||||||
#endif // RLV_VIEWER2_H
|
#endif // RLV_VIEWER2_H
|
||||||
|
|||||||
@@ -881,10 +881,15 @@
|
|||||||
<on_click function="PromptShowURL" name="PublicIssueTrackerHelp_url"
|
<on_click function="PromptShowURL" name="PublicIssueTrackerHelp_url"
|
||||||
userdata="WebLaunchPublicIssueHelp,http://wiki.secondlife.com/wiki/Issue_tracker" />
|
userdata="WebLaunchPublicIssueHelp,http://wiki.secondlife.com/wiki/Issue_tracker" />
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
|
<menu_item_call bottom="-94" enabled="true" height="19" label="Singularity Issue Tracker..."
|
||||||
|
left="0" mouse_opaque="true" name="Singularity Issue Tracker..." width="166">
|
||||||
|
<on_click function="PromptShowURL" name="SinguIssueTracker_url"
|
||||||
|
userdata="WebLaunchSinguIssue,http://code.google.com/p/singularity-viewer/issues/list" />
|
||||||
|
</menu_item_call>
|
||||||
<menu_item_separator bottom="-411" enabled="true" height="8" label="-----------" left="0"
|
<menu_item_separator bottom="-411" enabled="true" height="8" label="-----------" left="0"
|
||||||
mouse_opaque="true" name="separator7" width="250" />
|
mouse_opaque="true" name="separator7" width="250" />
|
||||||
<menu_item_call bottom="-94" enabled="true" height="19" label="Bug Reporting 101..." left="0"
|
<menu_item_call bottom="-94" enabled="true" height="19" label="Bug Reporting 101..." left="0"
|
||||||
mouse_opaque="true" name="Bug Reporing 101..." width="166">
|
mouse_opaque="true" name="Bug Reporting 101..." width="166">
|
||||||
<on_click function="PromptShowURL" name="BugReporting101_url"
|
<on_click function="PromptShowURL" name="BugReporting101_url"
|
||||||
userdata="WebLaunchBugReport101,http://wiki.secondlife.com/wiki/Bug_Reporting_101" />
|
userdata="WebLaunchBugReport101,http://wiki.secondlife.com/wiki/Bug_Reporting_101" />
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
@@ -905,6 +910,11 @@
|
|||||||
<on_click function="PromptShowURL" name="ReportBug_url"
|
<on_click function="PromptShowURL" name="ReportBug_url"
|
||||||
userdata="WebLaunchPublicIssue,http://jira.secondlife.com" />
|
userdata="WebLaunchPublicIssue,http://jira.secondlife.com" />
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
|
<menu_item_call bottom="-240" enabled="true" height="19" label="Report Singularity Bug..." left="0"
|
||||||
|
mouse_opaque="true" name="Report Singularity Bug..." width="166">
|
||||||
|
<on_click function="PromptShowURL" name="ReportSinguBug_url"
|
||||||
|
userdata="WebLaunchSinguIssue,http://code.google.com/p/singularity-viewer/issues/entry" />
|
||||||
|
</menu_item_call>
|
||||||
</menu>
|
</menu>
|
||||||
<menu_item_call bottom="-313" enabled="true" height="19" label="About Singularity..." left="0"
|
<menu_item_call bottom="-313" enabled="true" height="19" label="About Singularity..." left="0"
|
||||||
mouse_opaque="true" name="About Second Life..." width="166">
|
mouse_opaque="true" name="About Second Life..." width="166">
|
||||||
|
|||||||
@@ -1885,7 +1885,7 @@ No Group selected.
|
|||||||
type="alertmodal">
|
type="alertmodal">
|
||||||
Unable to deed land:
|
Unable to deed land:
|
||||||
Cannot find the region this land is in.
|
Cannot find the region this land is in.
|
||||||
Please use Tools -> Report Bug to report this.
|
Please use Help -> Bug Reporting -> Report Bug to report this.
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
<notification
|
<notification
|
||||||
@@ -1976,7 +1976,7 @@ Parcels you own appear in green.
|
|||||||
Unable to abandon land:
|
Unable to abandon land:
|
||||||
Cannot find the region this land is in.
|
Cannot find the region this land is in.
|
||||||
|
|
||||||
Please use Tools -> Report Bug to report this.
|
Please use Help -> Bug Reporting -> Report Bug to report this.
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
<notification
|
<notification
|
||||||
@@ -2050,7 +2050,7 @@ Divide land?
|
|||||||
Unable to divide land:
|
Unable to divide land:
|
||||||
Cannot find the region this land is in.
|
Cannot find the region this land is in.
|
||||||
|
|
||||||
Please use Tools -> Report Bug to report this.
|
Please use Help -> Bug Reporting -> Report Bug to report this.
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
<notification
|
<notification
|
||||||
@@ -2060,7 +2060,7 @@ Please use Tools -> Report Bug to report this.
|
|||||||
Unable to join land:
|
Unable to join land:
|
||||||
Cannot find the region this land is in.
|
Cannot find the region this land is in.
|
||||||
|
|
||||||
Please use Tools -> Report Bug to report this.
|
Please use Help -> Bug Reporting -> Report Bug to report this.
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
<notification
|
<notification
|
||||||
@@ -2177,7 +2177,7 @@ Unable to save '[NAME]' to wearable file. You will need to free up so
|
|||||||
Unable to save [NAME] to central asset store.
|
Unable to save [NAME] to central asset store.
|
||||||
This is usually a temporary failure. Please customize and save the wearable again in a few minutes.
|
This is usually a temporary failure. Please customize and save the wearable again in a few minutes.
|
||||||
|
|
||||||
If this problem persists, please click on the 'Tools > Report Bug' pull down menu
|
If this problem persists, please click on the 'Help -> Bug Reporting > Report Bug' pull down menu
|
||||||
and provide details about your network setup.
|
and provide details about your network setup.
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
@@ -2948,6 +2948,18 @@ Visit the [SECOND_LIFE] Public Issue Tracker, where you can report bugs and othe
|
|||||||
yestext="Go to page"/>
|
yestext="Go to page"/>
|
||||||
</notification>
|
</notification>
|
||||||
|
|
||||||
|
<notification
|
||||||
|
icon="alertmodal.tga"
|
||||||
|
name="WebLaunchSinguIssue"
|
||||||
|
type="alertmodal">
|
||||||
|
Visit the Singularity Issue Tracker, to report bugs and issues with Singularity Viewer.
|
||||||
|
<usetemplate
|
||||||
|
ignoretext="When launching web browser to view Singularity Issue Tracker"
|
||||||
|
name="okcancelignore"
|
||||||
|
notext="Cancel"
|
||||||
|
yestext="Go to page"/>
|
||||||
|
</notification>
|
||||||
|
|
||||||
<notification
|
<notification
|
||||||
icon="alertmodal.tga"
|
icon="alertmodal.tga"
|
||||||
name="WebLaunchPublicIssueHelp"
|
name="WebLaunchPublicIssueHelp"
|
||||||
|
|||||||
@@ -1,45 +1,45 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||||
<panel bg_visible="false" border="false" border_visible="false" bottom="1"
|
<panel bg_visible="false" border="false" border_visible="false" bottom="0"
|
||||||
follows="left|bottom" height="220" left="0" name="Adv_Settings"
|
follows="left|bottom" height="220" left="0" name="Adv_Settings"
|
||||||
use_bounding_rect="true" width="220" >
|
use_bounding_rect="true" width="220" >
|
||||||
<panel bottom="0" filename="panel_bg_tab.xml" height="185" left="0" width="205" />
|
<panel bottom="1" filename="panel_bg_tab.xml" height="185" left="0" width="197" />
|
||||||
<slider bottom="160" left="10" control_name="RenderFarClip"
|
<slider bottom="160" left="5" control_name="RenderFarClip"
|
||||||
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
||||||
increment="8" label="Draw Dist.:" can_edit_text="true"
|
increment="8" label="Draw Dist.:" can_edit_text="true"
|
||||||
label_width="55" max_val="1024" min_val="24" mouse_opaque="true"
|
label_width="53" max_val="1024" min_val="24" val_width="36" mouse_opaque="true"
|
||||||
name="DrawDistance" show_text="true" width="195" tool_tip="Change your Draw Distance"/>
|
name="DrawDistance" show_text="true" width="189" tool_tip="Change your Draw Distance"/>
|
||||||
<slider bottom_delta="-20" left_delta="-0" control_name="ThrottleBandwidthKBPS"
|
<slider bottom_delta="-20" left="5" control_name="ThrottleBandwidthKBPS"
|
||||||
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
||||||
increment="50" label="Bandwidth:" can_edit_text="true"
|
increment="50" label="Bandwidth:" can_edit_text="true"
|
||||||
label_width="60" max_val="5000" min_val="50" mouse_opaque="true"
|
label_width="53" max_val="5000" min_val="50" val_width="36" mouse_opaque="true"
|
||||||
name="max_bandwidth" show_text="true" width="195" tool_tip="Set your Network bandwidth in kbps (kilobits per second)"/>
|
name="max_bandwidth" show_text="true" width="189" tool_tip="Set your Network bandwidth in kbps (kilobits per second)"/>
|
||||||
<slider bottom_delta="-20" left_delta="-0" control_name="RenderMaxPartCount"
|
<slider bottom_delta="-20" left="5" control_name="RenderMaxPartCount"
|
||||||
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
||||||
increment="256" label="Particles:" can_edit_text="true"
|
increment="256" label="Particles:" can_edit_text="true"
|
||||||
label_width="55" max_val="8192" min_val="0" mouse_opaque="true"
|
label_width="53" max_val="8192" min_val="0" val_width="36" mouse_opaque="true"
|
||||||
name="MaxParticleCount" show_text="true" width="195" tool_tip="Amount of particles to render"/>
|
name="MaxParticleCount" show_text="true" width="189" tool_tip="Amount of particles to render"/>
|
||||||
<slider bottom_delta="-20" left_delta="0" control_name="RenderAvatarMaxVisible"
|
<slider bottom_delta="-20" left="5" control_name="RenderAvatarMaxVisible"
|
||||||
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
||||||
increment="1" label="Max Avatars:" can_edit_text="true"
|
increment="1" label="Max Avs:" can_edit_text="true"
|
||||||
label_width="65" max_val="50" min_val="1" mouse_opaque="true"
|
label_width="53" max_val="50" min_val="1" val_width="36" mouse_opaque="true"
|
||||||
name="RenderAvatarMaxVisible" show_text="true" width="195" tool_tip="How many avatars to fully render on screen. Lowering this greatly improves FPS in crowded situations. Requires Avatar Impostors to be on. [Default 35]"/>
|
name="RenderAvatarMaxVisible" show_text="true" width="189" tool_tip="How many avatars to fully render on screen. Lowering this greatly improves FPS in crowded situations. Requires Avatar Impostors to be on. [Default 35]"/>
|
||||||
<slider bottom_delta="-20" left_delta="-0" control_name="RenderMaxNodeSize"
|
<slider bottom_delta="-20" left="5" control_name="RenderMaxNodeSize"
|
||||||
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
decimal_digits="0" enabled="true" follows="left|bottom" height="20"
|
||||||
increment="64" label="Max Node:" can_edit_text="true"
|
increment="64" label="Max Node:" can_edit_text="true"
|
||||||
label_width="55" max_val="16382" min_val="64" mouse_opaque="true"
|
label_width="53" max_val="16382" min_val="64" val_width="36" mouse_opaque="true"
|
||||||
name="RenderMaxNodeSize" show_text="true" width="195" tool_tip="Maximum memory size limit for rendering NEW objects, in Kb. Anything over the limit will not be rendered. [Default 4096]"/>
|
name="RenderMaxNodeSize" show_text="true" width="189" tool_tip="Maximum memory size limit for rendering NEW objects, in Kb. Anything over the limit will not be rendered. [Default 4096]"/>
|
||||||
<text bottom_delta="-18" follows="left|top" font="SansSerifSmall" height="16" left_delta="0"
|
<text bottom_delta="-17" follows="left|top" font="SansSerifSmall" height="16" left="5"
|
||||||
name="cmd_line_text_7" width="512">
|
name="cmd_line_text_7" width="189">
|
||||||
Windlight Sky Preset:
|
Windlight Sky Preset:
|
||||||
</text>
|
</text>
|
||||||
<combo_box name="WLSkyPresetsCombo" bottom_delta="-20" left="40" follows="left|top" height="18" width="150" max_chars="20"
|
<combo_box name="WLSkyPresetsCombo" bottom_delta="-20" left="5" follows="left|top" height="18" width="189" max_chars="20"
|
||||||
mouse_opaque="true" allow_text_entry="false" tool_tip="WindLight Presets for your Sky." />
|
mouse_opaque="true" allow_text_entry="false" tool_tip="WindLight Presets for your Sky." />
|
||||||
<text bottom_delta="-18" follows="left|bottom" font="SansSerifSmall" height="16" left="10"
|
<text bottom_delta="-17" follows="left|bottom" font="SansSerifSmall" height="16" left="5"
|
||||||
name="cmd_line_text_7" width="512">
|
name="cmd_line_text_7" width="189">
|
||||||
Windlight Water Preset:
|
Windlight Water Preset:
|
||||||
</text>
|
</text>
|
||||||
<combo_box name="WLWaterPresetsCombo" bottom_delta="-20" left="40" follows="left|top" height="18" width="150" max_chars="20"
|
<combo_box name="WLWaterPresetsCombo" bottom_delta="-20" left="5" follows="left|bottom" height="18" width="166" max_chars="20"
|
||||||
mouse_opaque="true" allow_text_entry="false" tool_tip="WindLight Presets for your Sky." />
|
mouse_opaque="true" allow_text_entry="false" tool_tip="WindLight Presets for your Water." />
|
||||||
<button bottom="1" height="22" label="" left="5" name="expand" scale_image="true" toggle="true"
|
<button bottom="0" height="22" label="" left="172" name="expand" scale_image="true" toggle="true"
|
||||||
tool_tip="Hide the Settings Panel" width="22" />
|
tool_tip="Hide the Settings Panel" width="22" />
|
||||||
</panel>
|
</panel>
|
||||||
|
|||||||
@@ -248,7 +248,7 @@
|
|||||||
<on_click name="PublicIssueTrackerHelp_url" userdata="WebLaunchPublicIssueHelp,http://wiki.secondlife.com/wiki/Issue_tracker/fr" />
|
<on_click name="PublicIssueTrackerHelp_url" userdata="WebLaunchPublicIssueHelp,http://wiki.secondlife.com/wiki/Issue_tracker/fr" />
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
<menu_item_separator label="-----------" name="separator7"/>
|
<menu_item_separator label="-----------" name="separator7"/>
|
||||||
<menu_item_call label="Comment signaler des bugs ?" name="Bug Reporing 101...">
|
<menu_item_call label="Comment signaler des bugs ?" name="Bug Reporting 101...">
|
||||||
<on_click name="BugReporting101_url" userdata="WebLaunchBugReport101,http://wiki.secondlife.com/wiki/Bug_Reporting_101/fr"/>
|
<on_click name="BugReporting101_url" userdata="WebLaunchBugReport101,http://wiki.secondlife.com/wiki/Bug_Reporting_101/fr"/>
|
||||||
</menu_item_call>
|
</menu_item_call>
|
||||||
<menu_item_call label="Comment signaler un problème de sécurité ?" name="Security Issues...">
|
<menu_item_call label="Comment signaler un problème de sécurité ?" name="Security Issues...">
|
||||||
|
|||||||
@@ -1291,6 +1291,10 @@ Télécharger vers le dossier Applications ?
|
|||||||
Pour apprendre à utiliser JIRA, consultez le Wiki de [SECOND_LIFE].
|
Pour apprendre à utiliser JIRA, consultez le Wiki de [SECOND_LIFE].
|
||||||
<usetemplate ignoretext="Lors de l'ouverture du navigateur web pour consulter la page Wiki sur le JIRA" name="okcancelignore" notext="Annuler" yestext="Aller sur cette page"/>
|
<usetemplate ignoretext="Lors de l'ouverture du navigateur web pour consulter la page Wiki sur le JIRA" name="okcancelignore" notext="Annuler" yestext="Aller sur cette page"/>
|
||||||
</notification>
|
</notification>
|
||||||
|
<notification name="WebLaunchSinguIssue">
|
||||||
|
Pour signaler des bugs et autres problèmes avec Singularity, utilisez le Google Issue Tracker.
|
||||||
|
<usetemplate ignoretext="Lors de l'ouverture du navigateur web pour consulter le Google Issue Tracker" name="okcancelignore" notext="Annuler" yestext="Aller sur cette page"/>
|
||||||
|
</notification>
|
||||||
<notification name="WebLaunchSupportWiki">
|
<notification name="WebLaunchSupportWiki">
|
||||||
Visitez le blog officiel des Lindens pour les dernières nouvelles et informations.
|
Visitez le blog officiel des Lindens pour les dernières nouvelles et informations.
|
||||||
<usetemplate ignoretext="Lors de l'ouverture du navigateur web pour consulter le blog" name="okcancelignore" notext="Annuler" yestext="Aller à la page"/>
|
<usetemplate ignoretext="Lors de l'ouverture du navigateur web pour consulter le blog" name="okcancelignore" notext="Annuler" yestext="Aller à la page"/>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include "aifetchinventoryfolder.h"
|
#include "aifetchinventoryfolder.h"
|
||||||
#include "aievent.h"
|
#include "aievent.h"
|
||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
|
#include "llinventoryobserver.h"
|
||||||
|
|
||||||
enum fetchinventoryfolder_state_type {
|
enum fetchinventoryfolder_state_type {
|
||||||
AIFetchInventoryFolder_checkFolderExists = AIStateMachine::max_state,
|
AIFetchInventoryFolder_checkFolderExists = AIStateMachine::max_state,
|
||||||
|
|||||||
Reference in New Issue
Block a user