diff options
Diffstat (limited to 'indra')
37 files changed, 181 insertions, 225 deletions
diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h index ec2290d30e..c7bbc2e74a 100644 --- a/indra/llcommon/llassettype.h +++ b/indra/llcommon/llassettype.h @@ -78,11 +78,6 @@ public: // Holds a collection of inventory items. // It's treated as an item in the inventory and therefore needs a type. - AT_ROOT_CATEGORY = 9, - // A user's root inventory category. - // We decided to expose it visually, so it seems logical to fold - // it into the asset types. - AT_LSL_TEXT = 10, AT_LSL_BYTECODE = 11, // The LSL is the scripting language. diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index 9107b11597..079e670b1a 100644 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -72,8 +72,7 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_CLOTHING, new FolderEntry("clothing", TRUE)); addEntry(LLFolderType::FT_OBJECT, new FolderEntry("object", TRUE)); addEntry(LLFolderType::FT_NOTECARD, new FolderEntry("notecard", TRUE)); - addEntry(LLFolderType::FT_CATEGORY, new FolderEntry("category", TRUE)); - addEntry(LLFolderType::FT_ROOT_CATEGORY, new FolderEntry("root", TRUE)); + addEntry(LLFolderType::FT_ROOT_INVENTORY, new FolderEntry("root_inv", TRUE)); addEntry(LLFolderType::FT_LSL_TEXT, new FolderEntry("lsltext", TRUE)); addEntry(LLFolderType::FT_BODYPART, new FolderEntry("bodypart", TRUE)); addEntry(LLFolderType::FT_TRASH, new FolderEntry("trash", TRUE)); diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index 5374ffd829..7aa77f7f7e 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -52,23 +52,18 @@ public: FT_LANDMARK = 3, - // FT_SCRIPT = 4, - FT_CLOTHING = 5, FT_OBJECT = 6, FT_NOTECARD = 7, - FT_CATEGORY = 8, - - FT_ROOT_CATEGORY = 9, + FT_ROOT_INVENTORY = 8, + // We'd really like to change this to 9 since AT_CATEGORY is 8, + // but "My Inventory" has been type 8 for a long time. FT_LSL_TEXT = 10, - // FT_LSL_BYTECODE = 11, - // FT_TEXTURE_TGA = 12, - FT_BODYPART = 13, FT_TRASH = 14, @@ -77,16 +72,10 @@ public: FT_LOST_AND_FOUND = 16, - // FT_SOUND_WAV = 17, - // FT_IMAGE_TGA = 18, - // FT_IMAGE_JPEG = 19, - FT_ANIMATION = 20, FT_GESTURE = 21, - // FT_SIMSTATE = 22, - FT_FAVORITE = 23, FT_ENSEMBLE_START = 26, diff --git a/indra/llinventory/llinventorytype.cpp b/indra/llinventory/llinventorytype.cpp index 0e71c0d12d..4ef5df0b28 100644 --- a/indra/llinventory/llinventorytype.cpp +++ b/indra/llinventory/llinventorytype.cpp @@ -106,7 +106,7 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] = LLInventoryType::IT_OBJECT, // AT_OBJECT LLInventoryType::IT_NOTECARD, // AT_NOTECARD LLInventoryType::IT_CATEGORY, // AT_CATEGORY - LLInventoryType::IT_ROOT_CATEGORY, // AT_ROOT_CATEGORY + LLInventoryType::IT_NONE, // (null entry) LLInventoryType::IT_LSL, // AT_LSL_TEXT LLInventoryType::IT_LSL, // AT_LSL_BYTECODE LLInventoryType::IT_TEXTURE, // AT_TEXTURE_TGA diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 94bf54de7e..17e7eea2f1 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -35,10 +35,11 @@ #include "llagent.h" #include "llagentwearables.h" +#include "llcallbacklist.h" #include "llfloatercustomize.h" #include "llfloaterinventory.h" #include "llinventorybridge.h" -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llnotify.h" #include "llviewerregion.h" @@ -82,6 +83,8 @@ public: protected: void processWearablesMessage(); + void processContents(); + static void onIdle(void *userdata); }; LLAgentWearables gAgentWearables; @@ -2002,11 +2005,34 @@ void LLAgentWearables::updateServer() gAgent.sendAgentSetAppearance(); } +//-------------------------------------------------------------------- +// InitialWearablesFetch +// +// This grabs contents from the COF and processes them. +// The processing is handled in idle(), i.e. outside of done(), +// to avoid gInventory.notifyObservers recursion. +//-------------------------------------------------------------------- + +// virtual void LLInitialWearablesFetch::done() { - // No longer need this observer hanging around. + // Delay processing the actual results of this so it's not handled within + // gInventory.notifyObservers. The results will be handled in the next + // idle tick instead. gInventory.removeObserver(this); + gIdleCallbacks.addFunction(onIdle, this); +} +// static +void LLInitialWearablesFetch::onIdle(void *data) +{ + gIdleCallbacks.deleteFunction(onIdle, data); + LLInitialWearablesFetch *self = reinterpret_cast<LLInitialWearablesFetch*>(data); + self->processContents(); +} + +void LLInitialWearablesFetch::processContents() +{ // Fetch the wearable items from the Current Outfit Folder LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 8d66cefa4f..80ac9e4085 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -32,18 +32,20 @@ #include "llviewerprecompiledheaders.h" +#include "llagent.h" +#include "llagentwearables.h" #include "llappearancemgr.h" -#include "llinventorymodel.h" -#include "llnotifications.h" +#include "llfloatercustomize.h" #include "llgesturemgr.h" #include "llinventorybridge.h" -#include "llwearablelist.h" -#include "llagentwearables.h" -#include "llagent.h" +#include "llinventoryobserver.h" +#include "llnotifications.h" +#include "llpanelappearance.h" +#include "llsidetray.h" #include "llvoavatar.h" #include "llvoavatarself.h" #include "llviewerregion.h" -#include "llfloatercustomize.h" +#include "llwearablelist.h" class LLWearInventoryCategoryCallback : public LLInventoryCallback { @@ -526,6 +528,13 @@ void LLAppearanceManager::updateCOF(const LLUUID& category, bool append) { link_inventory_item(gAgent.getID(), category, cof, catp->getName(), LLAssetType::AT_LINK_FOLDER, link_waiter); + + // Update the current outfit name of the appearance sidepanel. + LLPanelAppearance* panel_appearance = dynamic_cast<LLPanelAppearance *>(LLSideTray::getInstance()->getPanel("panel_appearance")); + if (panel_appearance) + { + panel_appearance->refreshCurrentLookName(catp->getName()); + } } } @@ -802,7 +811,7 @@ bool areMatchingWearables(const LLViewerInventoryItem *a, const LLViewerInventor (a->getWearableType() == b->getWearableType())); } -void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update ) +void LLAppearanceManager::addItemLink( LLInventoryItem* item, bool do_update ) { LLViewerInventoryItem *vitem = dynamic_cast<LLViewerInventoryItem*>(item); if (!vitem) @@ -855,7 +864,7 @@ void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update ) return; } -void LLAppearanceManager::wearEnsemble( LLInventoryCategory* cat, bool do_update ) +void LLAppearanceManager::addEnsembleLink( LLInventoryCategory* cat, bool do_update ) { #if SUPPORT_ENSEMBLES // BAP add check for already in COF. @@ -969,7 +978,7 @@ void LLAppearanceManager::registerAttachment(const LLUUID& item_id) if (item) { //LLAppearanceManager::dumpCat(LLAppearanceManager::getCOF(),"Adding attachment link:"); - LLAppearanceManager::wearItem(item,false); // Add COF link for item. + LLAppearanceManager::addItemLink(item,false); // Add COF link for item. gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); gInventory.notifyObservers(); } @@ -1009,7 +1018,7 @@ void LLAppearanceManager::linkRegisteredAttachments() LLViewerInventoryItem *item = gInventory.getItem(item_id); if (item) { - wearItem(item, false); + addItemLink(item, false); gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); gInventory.notifyObservers(); } diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 736dabea31..88d3320d1f 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -54,10 +54,10 @@ public: void changeOutfit(bool proceed, const LLUUID& category, bool append); // Add COF link to individual item. - void wearItem(LLInventoryItem* item, bool do_update = true); + void addItemLink(LLInventoryItem* item, bool do_update = true); // Add COF link to ensemble folder. - void wearEnsemble(LLInventoryCategory* item, bool do_update = true); + void addEnsembleLink(LLInventoryCategory* item, bool do_update = true); // Copy all items in a category. void shallowCopyCategory(const LLUUID& src_id, const LLUUID& dst_id, diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 4d85ecb97c..38843c7221 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -40,7 +40,7 @@ #include "llfloaterbuycurrency.h" #include "llfilepicker.h" #include "llnotify.h" -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llfloaterinventory.h" #include "llpermissionsflags.h" diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index e8812d87ee..0b10255c2f 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -51,7 +51,7 @@ #include "llagent.h" #include "llbutton.h" -//#include "llinventory.h" +#include "llinventoryobserver.h" #include "llinventorymodel.h" #include "llnotify.h" #include "llresmgr.h" diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index e90d13f9d5..20a324c67c 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -35,6 +35,7 @@ #include "lluictrl.h" +#include "llinventoryobserver.h" #include "llinventorymodel.h" class LLFavoritesBarCtrl : public LLUICtrl, public LLInventoryObserver diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index cefd7a3808..c8df6c6135 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -230,10 +230,6 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, if (obj->getType() == LLAssetType::AT_CATEGORY) continue; - // Skip root folders, so we know we have inventory items only - if (obj->getType() == LLAssetType::AT_ROOT_CATEGORY) - continue; - // Skip the mysterious blank InventoryObject if (obj->getType() == LLAssetType::AT_NONE) continue; diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 32802f6a20..a99d0c918d 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -187,10 +187,6 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, if (asset_type == LLAssetType::AT_CATEGORY) continue; - // Skip root folders, so we know we have inventory items only - if (asset_type == LLAssetType::AT_ROOT_CATEGORY) - continue; - LLInventoryItem* inv_item = (LLInventoryItem*)((LLInventoryObject*)(*it)); inv_type = inv_item->getInventoryType(); @@ -286,7 +282,7 @@ void LLFloaterBuyContents::onClickBuy() // Put the items where we put new folders. LLUUID category_id; - category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CATEGORY); + category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_ROOT_INVENTORY); // *NOTE: doesn't work for multiple object buy, which UI does not // currently support sale info is used for verification only, if diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 928126bff9..e0d4a59d9d 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -44,6 +44,7 @@ #include "llbutton.h" #include "llcheckboxctrl.h" #include "llavataractions.h" +#include "llinventoryobserver.h" #include "llinventorymodel.h" #include "lllineeditor.h" //#include "llspinctrl.h" diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 7d2eb98111..85847e5fce 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -51,6 +51,7 @@ #include "llfloaterreg.h" // getTypedInstance() #include "llfocusmgr.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "lllandmarklist.h" #include "lllineeditor.h" #include "llregionhandle.h" diff --git a/indra/newview/llfoldervieweventlistener.h b/indra/newview/llfoldervieweventlistener.h index 60ece75cea..473d0be912 100644 --- a/indra/newview/llfoldervieweventlistener.h +++ b/indra/newview/llfoldervieweventlistener.h @@ -34,6 +34,8 @@ #include "lldarray.h" // JAMESDEBUG convert to std::vector #include "llfoldertype.h" #include "llfontgl.h" // just for StyleFlags enum +#include "llinventorytype.h" +#include "llpermissionsflags.h" #include "llpointer.h" diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 6fdaefd21a..102651f432 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -38,7 +38,6 @@ #include "llfoldervieweventlistener.h" #include "llinventorybridge.h" // for LLItemBridge in LLInventorySort::operator() #include "llinventoryfilter.h" -#include "llinventorymodel.h" // *TODO: make it take a pointer to an inventory-model interface #include "llviewercontrol.h" // gSavedSettings #include "llviewerwindow.h" // Argh, only for setCursor() diff --git a/indra/newview/llgesturemgr.h b/indra/newview/llgesturemgr.h index 947773d66d..c8b26f7309 100644 --- a/indra/newview/llgesturemgr.h +++ b/indra/newview/llgesturemgr.h @@ -38,7 +38,7 @@ #include <vector> #include "llassetstorage.h" // LLAssetType -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llsingleton.h" #include "llviewerinventory.h" diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 4aef7b51a5..d7be09efa9 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -892,7 +892,6 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, new_listener = new LLWearableBridge(inventory, uuid, asset_type, inv_type, (EWearableType)flags);
break;
case LLAssetType::AT_CATEGORY:
- case LLAssetType::AT_ROOT_CATEGORY:
if (actual_asset_type == LLAssetType::AT_LINK_FOLDER)
{
// Create a link folder handler instead.
@@ -1687,7 +1686,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // BAP - should skip if dup.
if (move_is_into_current_outfit)
{
- LLAppearanceManager::instance().wearEnsemble(inv_cat);
+ LLAppearanceManager::instance().addEnsembleLink(inv_cat);
}
else
{
@@ -2089,7 +2088,7 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model if(!model) return;
LLViewerInventoryCategory* cat = getCategory();
if(!cat) return;
- LLAppearanceManager::instance().wearEnsemble(cat,true);
+ LLAppearanceManager::instance().addEnsembleLink(cat,true);
return;
}
#endif
@@ -2337,7 +2336,7 @@ void LLFolderBridge::pasteLinkFromClipboard() {
link_inventory_item(
gAgent.getID(),
- item->getUUID(),
+ item->getLinkedUUID(),
parent_id,
item->getName(),
LLAssetType::AT_LINK,
@@ -2847,10 +2846,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, BOOL is_movable = TRUE;
switch( inv_item->getActualType() )
{
- case LLAssetType::AT_ROOT_CATEGORY:
- is_movable = FALSE;
- break;
-
case LLAssetType::AT_CATEGORY:
is_movable = !LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)inv_item)->getPreferredType());
break;
@@ -2953,16 +2948,16 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // BAP - should skip if dup.
if (move_is_into_current_outfit)
{
- LLAppearanceManager::instance().wearItem(inv_item);
+ LLAppearanceManager::instance().addItemLink(inv_item);
}
else
{
LLPointer<LLInventoryCallback> cb = NULL;
link_inventory_item(
gAgent.getID(),
- inv_item->getUUID(),
+ inv_item->getLinkedUUID(),
mUUID,
- std::string(),
+ inv_item->getName(),
LLAssetType::AT_LINK,
cb);
}
@@ -3889,16 +3884,11 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model gMessageSystem->sendReliable( gAgent.getRegion()->getHost());
}
// this object might have been selected, so let the selection manager know it's gone now
- LLViewerObject *found_obj =
- gObjectList.findObject(item->getUUID());
+ LLViewerObject *found_obj = gObjectList.findObject(item->getLinkedUUID());
if (found_obj)
{
LLSelectMgr::getInstance()->remove(found_obj);
}
- else
- {
- llwarns << "object not found - ignoring" << llendl;
- }
}
else LLItemBridge::performAction(folder, model, action);
}
@@ -4053,7 +4043,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLInventoryItem* item = getItem();
if (item && item->getIsLinkType())
{
- items.push_back(std::string("Goto Link"));
+ items.push_back(std::string("Find Original"));
}
items.push_back(std::string("Properties"));
@@ -4206,7 +4196,7 @@ void wear_inventory_item_on_avatar( LLInventoryItem* item ) lldebugs << "wear_inventory_item_on_avatar( " << item->getName()
<< " )" << llendl;
- LLAppearanceManager::instance().wearItem(item);
+ LLAppearanceManager::instance().addItemLink(item);
}
}
@@ -4325,10 +4315,6 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ {
LLSelectMgr::getInstance()->remove(found_obj);
}
- else
- {
- llwarns << "object not found, ignoring" << llendl;
- }
}
}
@@ -4493,7 +4479,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if (item && item->getIsLinkType())
{
- items.push_back(std::string("Goto Link"));
+ items.push_back(std::string("Find Original"));
}
items.push_back(std::string("Properties"));
@@ -5157,7 +5143,7 @@ void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) }
else
{
- items.push_back(std::string("Goto Link"));
+ items.push_back(std::string("Find Original"));
items.push_back(std::string("Delete"));
if (!isItemRemovable())
{
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 3ffeb55d6c..4c7b0a0517 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -33,14 +33,16 @@ #ifndef LL_LLINVENTORYBRIDGE_H #define LL_LLINVENTORYBRIDGE_H -#include "llfloaterproperties.h" -#include "llwearable.h" -#include "llviewercontrol.h" #include "llcallingcard.h" -#include "llinventorymodel.h" +#include "llfloaterproperties.h" #include "llfoldervieweventlistener.h" +#include "llinventorymodel.h" +#include "llinventoryobserver.h" +#include "llviewercontrol.h" +#include "llwearable.h" class LLInventoryPanel; +class LLInventoryModel; class LLMenuGL; enum EInventoryIcon diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 4b0d524906..a8e5c4c216 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -31,40 +31,25 @@ */ #include "llviewerprecompiledheaders.h" - #include "llinventorymodel.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 "llinventorypanel.h" #include "llfloaterinventory.h" -#include "llviewerfoldertype.h" -#include "llviewerinventory.h" +#include "llinventorybridge.h" +#include "llinventoryfunctions.h" +#include "llinventoryobserver.h" +#include "llwindow.h" +#include "llviewercontrol.h" +#include "llpreview.h" #include "llviewermessage.h" +#include "llviewerfoldertype.h" #include "llviewerwindow.h" -#include "llviewerregion.h" #include "llappviewer.h" -#include "lldbstrings.h" -#include "llviewerstats.h" -#include "llmutelist.h" -#include "llnotifications.h" +#include "llviewerregion.h" #include "llcallbacklist.h" -#include "llpreview.h" -#include "llviewercontrol.h" #include "llvoavatarself.h" -#include "llsdutil.h" -#include <deque> //#define DIFF_INVENTORY_FILES #ifdef DIFF_INVENTORY_FILES @@ -341,7 +326,7 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType t, bo const LLUUID &LLInventoryModel::findCatUUID(LLFolderType::EType preferred_type) const { const LLUUID &root_id = gInventory.getRootFolderID(); - if(LLFolderType::FT_CATEGORY == preferred_type) + if(LLFolderType::FT_ROOT_INVENTORY == preferred_type) { return root_id; } @@ -886,7 +871,8 @@ void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) // Delete a particular inventory object by ID. void LLInventoryModel::deleteObject(const LLUUID& id) { - purgeLinkedObjects(id); + // Disabling this; let users manually purge linked objects. + // purgeLinkedObjects(id); lldebugs << "LLInventoryModel::deleteObject()" << llendl; LLPointer<LLInventoryObject> obj = getObject(id); if(obj) @@ -923,13 +909,14 @@ void LLInventoryModel::deleteObject(const LLUUID& id) } addChangedMask(LLInventoryObserver::REMOVE, id); obj = NULL; // delete obj + gInventory.notifyObservers(); } } // Delete a particular inventory item by ID, and remove it from the server. void LLInventoryModel::purgeObject(const LLUUID &id) { - lldebugs << "LLInventoryModel::purgeObject()" << llendl; + lldebugs << "LLInventoryModel::purgeObject() [ id: " << id << " ] " << llendl; LLPointer<LLInventoryObject> obj = getObject(id); if(obj) { @@ -2463,7 +2450,7 @@ void LLInventoryModel::buildParentChildMap() { cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); } - else if(LLFolderType::FT_CATEGORY == pref) + else if(LLFolderType::FT_ROOT_INVENTORY == pref) { // it's the root cat->setParent(LLUUID::null); @@ -3343,7 +3330,7 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) // If the item has already been added (e.g. from link prefetch), then it doesn't need to be re-added. if (gInventory.getItem(titem->getUUID())) { - llinfos << "Skipping prefetched item [ Name: " << titem->getName() << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << llendl; + lldebugs << "Skipping prefetched item [ Name: " << titem->getName() << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << llendl; continue; } gInventory.updateItem(titem); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index bd64591194..3c1f606d5c 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -46,11 +46,6 @@ #include <string> #include <vector> -// ! REFACTOR ! Remove llinventoryobservers.h and have other files that need it explicitly -// include llinventoryobservers.h instead of llinventorymodel.h . This will reduce dependency on -// llinventorymodel.h. -#include "llinventoryobserver.h" - class LLInventoryObserver; class LLInventoryObject; class LLInventoryItem; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 9ee2defc01..6b1f7313dd 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -38,55 +38,16 @@ // Seraph TODO: Remove unnecessary headers
-// library includes
#include "llagent.h"
#include "llagentwearables.h"
-#include "llcallingcard.h"
-#include "llfloaterreg.h"
-#include "llsdserialize.h"
-#include "llfiltereditor.h"
-#include "llspinctrl.h"
-#include "llui.h"
-#include "message.h"
-
-// newview includes
#include "llappearancemgr.h"
-#include "llappviewer.h"
-#include "llfirstuse.h"
-#include "llfloaterchat.h"
-#include "llfloatercustomize.h"
-#include "llfocusmgr.h"
-#include "llfolderview.h"
-#include "llgesturemgr.h"
-#include "lliconctrl.h"
+#include "llfloaterreg.h"
#include "llimview.h"
#include "llinventorybridge.h"
-#include "llinventoryclipboard.h"
-#include "llinventorymodel.h"
-#include "lllineeditor.h"
-#include "llmenugl.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 "llviewerfoldertype.h"
-#include "llviewerinventory.h"
-#include "llviewermessage.h"
-#include "llviewerobjectlist.h"
-#include "llviewerregion.h"
-#include "llviewerwindow.h"
-#include "llvoavatarself.h"
-#include "llwearablelist.h"
#include "llimfloater.h"
+#include "llvoavatarself.h"
static LLDefaultChildRegistry::Register<LLInventoryPanel> r("inventory_panel");
@@ -302,7 +263,7 @@ void LLInventoryPanel::modelChanged(U32 mask) return;
}
- if(mask & LLInventoryObserver::LABEL)
+ if (mask & LLInventoryObserver::LABEL)
{
handled = true;
// label change - empty out the display name for each object
@@ -327,9 +288,15 @@ void LLInventoryPanel::modelChanged(U32 mask) }
}
}
- if((mask & (LLInventoryObserver::STRUCTURE
- | LLInventoryObserver::ADD
- | LLInventoryObserver::REMOVE)) != 0)
+
+ // We don't really care which of these masks the item is actually flagged with, since the masks
+ // may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into
+ // Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks
+ // panel). What's relevant is that the item and UI are probably out of sync and thus need to be
+ // resynchronized.
+ if (mask & (LLInventoryObserver::STRUCTURE |
+ LLInventoryObserver::ADD |
+ LLInventoryObserver::REMOVE))
{
handled = true;
// Record which folders are open by uuid.
@@ -346,74 +313,56 @@ void LLInventoryPanel::modelChanged(U32 mask) LLInventoryObject* model_item = model->getObject(*id_it);
LLFolderViewItem* view_item = mFolders->getItemByID(*id_it);
- if (model_item)
+ // Item exists in memory but a UI element hasn't been created for it.
+ if (model_item && !view_item)
{
- if (!view_item)
+ // Add the UI element for this item.
+ buildNewViews(*id_it);
+ // Select any newly created object that has the auto rename at top of folder root set.
+ if(mFolders->getRoot()->needsAutoRename())
{
- // this object was just created, need to build a view for it
- if ((mask & LLInventoryObserver::ADD) != LLInventoryObserver::ADD)
- {
- llwarns << *id_it << " is in model but not in view, but ADD flag not set" << llendl;
- }
- buildNewViews(*id_it);
-
- // select any newly created object
- // that has the auto rename at top of folder
- // root set
- if(mFolders->getRoot()->needsAutoRename())
- {
- setSelection(*id_it, FALSE);
- }
+ setSelection(*id_it, FALSE);
}
- else
- {
- // this object was probably moved, check its parent
- if ((mask & LLInventoryObserver::STRUCTURE) != LLInventoryObserver::STRUCTURE)
- {
- llwarns << *id_it << " is in model and in view, but STRUCTURE flag not set" << " for model (Name :" << model_item->getName() << " )" << llendl;
- }
+ }
- LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID());
+ // This item already exists in both memory and UI. It was probably moved
+ // around in the panel's directory structure (i.e. reparented).
+ if (model_item && view_item)
+ {
+ LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID());
- // added check against NULL for cases when Inventory panel contains startFolder.
- // in this case parent is LLFolderView (LLInventoryPanel::mFolders) itself.
- // this check is a fix for bug EXT-1859.
- if (NULL != new_parent && view_item->getParentFolder() != new_parent)
+ // Item has been moved.
+ if (view_item->getParentFolder() != new_parent)
+ {
+ if (new_parent != NULL)
{
+ // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI.
view_item->getParentFolder()->extractItem(view_item);
view_item->addToFolder(new_parent, mFolders);
}
-/*
- on the other side in case Inventory Panel has content of the any folder
- it is possible that item moved to some folder which is absent in current
- Panel. For ex. removing item (via moving to trash).
- In this case we need to check if new parent is other then inventory start folder
- and simply remove its View from the hierarchy.
- See details in EXT-2098.
-*/
- // So, let check if item was moved into folder out of this Inventory Panel.
- else if (mStartFolderID.notNull() && NULL == new_parent && model_item->getParentUUID() != mStartFolderID)
- {
- view_item->getParentFolder()->extractItem(view_item);
- }
- }
- }
- else
- {
- if (view_item)
- {
- if ((mask & LLInventoryObserver::REMOVE) != LLInventoryObserver::REMOVE)
+ else
{
- llwarns << *id_it << " is not in model but in view, but REMOVE flag not set" << llendl;
+ // Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that
+ // doesn't include trash). Just remove the item's UI.
+ view_item->destroyView();
}
- // item in view but not model, need to delete view
- view_item->destroyView();
}
else
{
- llwarns << *id_it << "Item does not exist in either view or model, but notification triggered" << llendl;
+ // Hmm, we got an ADD/REMOVE/STRUCTURE notification for this item but there's nothing to be done to it.
+ llwarns << "Notification triggered for item that isn't changing. "
+ << "Operation: ( mask: " << mask << " panel name: " << mStartFolderString << " ) "
+ << "Item: [ Name:" << model_item->getName() << " UUID: " << *id_it << " ]" << llendl;
+
}
}
+
+ // This item has been removed from memory, but its associated UI element still exists.
+ if (!model_item && view_item)
+ {
+ // Remove the item's UI.
+ view_item->destroyView();
+ }
}
}
}
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 8fe317a292..7e35cfa04c 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -45,7 +45,7 @@ #include "lltooltip.h" // newview includes -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "lllandmarkactions.h" #include "lllandmarklist.h" #include "lllocationhistory.h" diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 29e9baa6cf..fbc0f09c50 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -35,7 +35,8 @@ #define LL_LLPANELMAININVENTORY_H
#include "llpanel.h"
-#include "llinventorymodel.h"
+#include "llinventoryobserver.h"
+
#include "llfolderview.h"
class LLFolderViewItem;
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 2bbb2b7153..69edccf09f 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -54,6 +54,7 @@ #include "llfriendcard.h" #include "llgroupactions.h" #include "llgrouplist.h" +#include "llinventoryobserver.h" #include "llpanelpeoplemenus.h" #include "llrecentpeople.h" #include "llviewercontrol.h" // for gSavedSettings diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index 506c135ca6..3b9f7f9882 100644 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -37,7 +37,7 @@ #include "llresizehandle.h" #include "llpointer.h" #include "lluuid.h" -#include "llinventorymodel.h" // LLInventoryObserver +#include "llinventoryobserver.h" #include <map> class LLInventoryItem; diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index a00f580e32..28a409d3ee 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -41,7 +41,6 @@ #include "lliconctrl.h" #include "llframetimer.h" - class LLMessageSystem; class LLTextEditor; class LLButton; @@ -52,6 +51,7 @@ struct LLEntryAndEdCore; class LLMenuBarGL; class LLFloaterScriptSearch; class LLKeywordToken; +class LLViewerInventoryItem; // Inner, implementation class. LLPreviewScript and LLLiveLSLEditor each own one of these. class LLScriptEdCore : public LLPanel diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 9d2960fbed..a3efea7b7e 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -41,6 +41,7 @@ #include "llfloaterreg.h"
#include "llgroupactions.h"
#include "llinventorymodel.h"
+#include "llinventoryobserver.h"
#include "lllineeditor.h"
#include "llradiogroup.h"
#include "llviewercontrol.h"
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 70dc04f575..7711f3c733 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -673,6 +673,24 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para return NULL; } +LLPanel* LLSideTray::getPanel (const std::string& panel_name) +{ + child_vector_const_iter_t child_it; + for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it) + { + LLView* view = (*child_it)->findChildView(panel_name,true); + if(view) + { + LLPanel* panel = dynamic_cast<LLPanel*>(view); + if(panel) + { + return panel; + } + } + } + return NULL; +} + // *TODO: Eliminate magic constants. static const S32 fake_offset = 132; static const S32 fake_top_offset = 18; diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 8b30199c45..54652c1108 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -36,8 +36,8 @@ #include "llpanel.h" #include "string" -class LLSideTrayTab; class LLAccordionCtrl; +class LLSideTrayTab; // added inheritance from LLDestroyClass<LLSideTray> to enable Side Tray perform necessary actions // while disconnecting viewer in LLAppViewer::disconnectViewer(). @@ -97,6 +97,11 @@ public: LLPanel* showPanel (const std::string& panel_name, const LLSD& params); /* + * get the panel (don't show it or do anything else with it) + */ + LLPanel* getPanel (const std::string& panel_name); + + /* * collapse SideBar, hiding visible tab and moving tab buttons * to the right corner of the screen */ diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index de00ca8420..5f7c2f5080 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -48,7 +48,7 @@ #include "llfoldervieweventlistener.h" #include "llinventory.h" #include "llinventoryfunctions.h" -#include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llfloaterinventory.h" #include "lllineeditor.h" diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 1a61717658..407cc23d0d 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -55,6 +55,7 @@ #include "llhudtext.h" #include "llhudview.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "lllandmarklist.h" #include "llsky.h" #include "llui.h" diff --git a/indra/newview/llviewerassettype.cpp b/indra/newview/llviewerassettype.cpp index c974171c2c..b382ff6306 100644 --- a/indra/newview/llviewerassettype.cpp +++ b/indra/newview/llviewerassettype.cpp @@ -71,7 +71,6 @@ LLViewerAssetDictionary::LLViewerAssetDictionary() addEntry(LLViewerAssetType::AT_OBJECT, new ViewerAssetEntry(DAD_OBJECT)); addEntry(LLViewerAssetType::AT_NOTECARD, new ViewerAssetEntry(DAD_NOTECARD)); addEntry(LLViewerAssetType::AT_CATEGORY, new ViewerAssetEntry(DAD_CATEGORY)); - addEntry(LLViewerAssetType::AT_ROOT_CATEGORY, new ViewerAssetEntry(DAD_ROOT_CATEGORY)); addEntry(LLViewerAssetType::AT_LSL_TEXT, new ViewerAssetEntry(DAD_SCRIPT)); addEntry(LLViewerAssetType::AT_LSL_BYTECODE, new ViewerAssetEntry(DAD_NONE)); addEntry(LLViewerAssetType::AT_TEXTURE_TGA, new ViewerAssetEntry(DAD_NONE)); diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 384538364f..6aabcb11b8 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -109,8 +109,7 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_CLOTHING, new ViewerFolderEntry("Clothing", "inv_folder_clothing.tga")); addEntry(LLFolderType::FT_OBJECT, new ViewerFolderEntry("Objects", "inv_folder_object.tga")); addEntry(LLFolderType::FT_NOTECARD, new ViewerFolderEntry("Notecards", "inv_folder_notecard.tga")); - addEntry(LLFolderType::FT_CATEGORY, new ViewerFolderEntry("New Folder", "inv_folder_plain_closed.tga")); - addEntry(LLFolderType::FT_ROOT_CATEGORY, new ViewerFolderEntry("Inventory", "")); + addEntry(LLFolderType::FT_ROOT_INVENTORY, new ViewerFolderEntry("My Inventory", "")); addEntry(LLFolderType::FT_LSL_TEXT, new ViewerFolderEntry("Scripts", "inv_folder_script.tga")); addEntry(LLFolderType::FT_BODYPART, new ViewerFolderEntry("Body Parts", "inv_folder_bodypart.tga")); addEntry(LLFolderType::FT_TRASH, new ViewerFolderEntry("Trash", "inv_folder_trash.tga")); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4cc1d986bb..68a9aaef75 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3879,8 +3879,7 @@ void god_force_inv_owner_permissive(LLViewerObject* object, InventoryObjectList::const_iterator inv_end = inventory->end(); for ( ; inv_it != inv_end; ++inv_it) { - if(((*inv_it)->getType() != LLAssetType::AT_CATEGORY) - && ((*inv_it)->getType() != LLAssetType::AT_ROOT_CATEGORY)) + if(((*inv_it)->getType() != LLAssetType::AT_CATEGORY)) { LLInventoryObject* obj = *inv_it; LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem((LLViewerInventoryItem*)obj); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4088eafe16..7f25e567d0 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -89,6 +89,7 @@ #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llinventorymodel.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llfloaterinventory.h" #include "llmenugl.h" @@ -4833,8 +4834,7 @@ void container_inventory_arrived(LLViewerObject* object, InventoryObjectList::const_iterator end = inventory->end(); for ( ; it != end; ++it) { - if ((*it)->getType() != LLAssetType::AT_CATEGORY && - (*it)->getType() != LLAssetType::AT_ROOT_CATEGORY) + if ((*it)->getType() != LLAssetType::AT_CATEGORY) { LLInventoryObject* obj = (LLInventoryObject*)(*it); LLInventoryItem* item = (LLInventoryItem*)(obj); @@ -4869,8 +4869,7 @@ void container_inventory_arrived(LLViewerObject* object, // one actual object InventoryObjectList::iterator it = inventory->begin(); - if ((*it)->getType() == LLAssetType::AT_CATEGORY || - (*it)->getType() == LLAssetType::AT_ROOT_CATEGORY) + if ((*it)->getType() == LLAssetType::AT_CATEGORY) { ++it; } diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index c86d32c8c4..b65a49eaed 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -356,9 +356,9 @@ parameter="restore" /> </menu_item_call> <menu_item_call - label="Goto Link" + label="Find Original" layout="topleft" - name="Goto Link"> + name="Find Original"> <menu_item_call.on_click function="Inventory.DoToSelected" parameter="goto" /> |