More stuff migrated to llinventoryfunctions.cpp
This commit is contained in:
@@ -446,6 +446,7 @@ set(viewer_SOURCE_FILES
|
|||||||
llviewercamera.cpp
|
llviewercamera.cpp
|
||||||
llviewercontrol.cpp
|
llviewercontrol.cpp
|
||||||
llviewerdisplay.cpp
|
llviewerdisplay.cpp
|
||||||
|
llviewerfoldertype.cpp
|
||||||
llviewergenericmessage.cpp
|
llviewergenericmessage.cpp
|
||||||
llviewergesture.cpp
|
llviewergesture.cpp
|
||||||
#llviewerimage.cpp
|
#llviewerimage.cpp
|
||||||
@@ -735,6 +736,7 @@ set(viewer_HEADER_FILES
|
|||||||
llfloaterwindlight.h
|
llfloaterwindlight.h
|
||||||
llfloaterworldmap.h
|
llfloaterworldmap.h
|
||||||
llfolderview.h
|
llfolderview.h
|
||||||
|
llfoldervieweventlistener.h
|
||||||
llfollowcam.h
|
llfollowcam.h
|
||||||
llframestats.h
|
llframestats.h
|
||||||
llframestatview.h
|
llframestatview.h
|
||||||
@@ -923,6 +925,7 @@ set(viewer_HEADER_FILES
|
|||||||
llviewercamera.h
|
llviewercamera.h
|
||||||
llviewercontrol.h
|
llviewercontrol.h
|
||||||
llviewerdisplay.h
|
llviewerdisplay.h
|
||||||
|
llviewerfoldertype.h
|
||||||
llviewergenericmessage.h
|
llviewergenericmessage.h
|
||||||
llviewergesture.h
|
llviewergesture.h
|
||||||
#llviewerimage.h
|
#llviewerimage.h
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
#include "llfoldervieweventlistener.h"
|
#include "llfoldervieweventlistener.h"
|
||||||
#include "llinventoryclipboard.h" // *TODO: remove this once hack below gone.
|
#include "llinventoryclipboard.h" // *TODO: remove this once hack below gone.
|
||||||
#include "llinventoryview.h"// hacked in for the bonus context menu items.
|
#include "llinventoryview.h"// hacked in for the bonus context menu items.
|
||||||
|
#include "llinventoryfunctions.h"
|
||||||
#include "llkeyboard.h"
|
#include "llkeyboard.h"
|
||||||
#include "lllineeditor.h"
|
#include "lllineeditor.h"
|
||||||
#include "llmenugl.h"
|
#include "llmenugl.h"
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ class LLMenuGL;
|
|||||||
class LLFolderViewItem;
|
class LLFolderViewItem;
|
||||||
class LLFolderView;
|
class LLFolderView;
|
||||||
class LLInventoryModel;
|
class LLInventoryModel;
|
||||||
|
class LLFolderViewFunctor;
|
||||||
class LLScrollableContainerView;
|
class LLScrollableContainerView;
|
||||||
class LLFolderViewEventListener;
|
class LLFolderViewEventListener;
|
||||||
|
|
||||||
@@ -100,13 +101,6 @@ public:
|
|||||||
class LLFolderViewItem;
|
class LLFolderViewItem;
|
||||||
class LLFolderViewFolder;
|
class LLFolderViewFolder;
|
||||||
|
|
||||||
class LLFolderViewFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~LLFolderViewFunctor() {}
|
|
||||||
virtual void doFolder(LLFolderViewFolder* folder) = 0;
|
|
||||||
virtual void doItem(LLFolderViewItem* item) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class LLInventoryFilter
|
class LLInventoryFilter
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1883,29 +1883,6 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
|
|||||||
return accept;
|
return accept;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LLFindWearables : public LLInventoryCollectFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLFindWearables() {}
|
|
||||||
virtual ~LLFindWearables() {}
|
|
||||||
virtual bool operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item);
|
|
||||||
};
|
|
||||||
|
|
||||||
bool LLFindWearables::operator()(LLInventoryCategory* cat,
|
|
||||||
LLInventoryItem* item)
|
|
||||||
{
|
|
||||||
if(item)
|
|
||||||
{
|
|
||||||
if((item->getType() == LLAssetType::AT_CLOTHING)
|
|
||||||
|| (item->getType() == LLAssetType::AT_BODYPART))
|
|
||||||
{
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Used by LLFolderBridge as callback for directory recursion.
|
//Used by LLFolderBridge as callback for directory recursion.
|
||||||
class LLRightClickInventoryFetchObserver : public LLInventoryFetchObserver
|
class LLRightClickInventoryFetchObserver : public LLInventoryFetchObserver
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -159,6 +159,38 @@ void change_category_parent(LLInventoryModel* model,
|
|||||||
model->notifyObservers();
|
model->notifyObservers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*void remove_category(LLInventoryModel* model, const LLUUID& cat_id)
|
||||||
|
{
|
||||||
|
if (!model || !get_is_category_removable(model, cat_id))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Look for any gestures and deactivate them
|
||||||
|
LLInventoryModel::cat_array_t descendent_categories;
|
||||||
|
LLInventoryModel::item_array_t descendent_items;
|
||||||
|
gInventory.collectDescendents(cat_id, descendent_categories, descendent_items, FALSE);
|
||||||
|
|
||||||
|
for (LLInventoryModel::item_array_t::const_iterator iter = descendent_items.begin();
|
||||||
|
iter != descendent_items.end();
|
||||||
|
++iter)
|
||||||
|
{
|
||||||
|
const LLViewerInventoryItem* item = (*iter);
|
||||||
|
const LLUUID& item_id = item->getUUID();
|
||||||
|
if (item->getType() == LLAssetType::AT_GESTURE
|
||||||
|
&& LLGestureMgr::instance().isGestureActive(item_id))
|
||||||
|
{
|
||||||
|
LLGestureMgr::instance().deactivateGesture(item_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
|
||||||
|
if (cat)
|
||||||
|
{
|
||||||
|
const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||||
|
change_category_parent(model, cat, trash_id, TRUE);
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name)
|
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name)
|
||||||
{
|
{
|
||||||
@@ -370,6 +402,50 @@ BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
|
||||||
|
{
|
||||||
|
// NOTE: This function doesn't check the folder's children.
|
||||||
|
// See LLFolderBridge::isItemRemovable for a function that does
|
||||||
|
// consider the children.
|
||||||
|
|
||||||
|
if (!model)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!model->isObjectDescendentOf(id, gInventory.getRootFolderID()))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isAgentAvatarValid()) return FALSE;
|
||||||
|
|
||||||
|
const LLInventoryCategory* category = model->getCategory(id);
|
||||||
|
if (!category)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const LLFolderType::EType folder_type = category->getPreferredType();
|
||||||
|
|
||||||
|
if (LLFolderType::lookupIsProtectedType(folder_type))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Can't delete the outfit that is currently being worn.
|
||||||
|
if (folder_type == LLFolderType::FT_OUTFIT)
|
||||||
|
{
|
||||||
|
const LLViewerInventoryItem *base_outfit_link = LLAppearanceMgr::instance().getBaseOutfitLink();
|
||||||
|
if (base_outfit_link && (category == base_outfit_link->getLinkedCategory()))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}*/
|
||||||
|
|
||||||
BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id)
|
BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id)
|
||||||
{
|
{
|
||||||
if (!model)
|
if (!model)
|
||||||
@@ -536,6 +612,21 @@ bool LLNameCategoryCollector::operator()(
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LLFindWearables::operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item)
|
||||||
|
{
|
||||||
|
if(item)
|
||||||
|
{
|
||||||
|
if((item->getType() == LLAssetType::AT_CLOTHING)
|
||||||
|
|| (item->getType() == LLAssetType::AT_BODYPART))
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
/// LLAssetIDMatches
|
/// LLAssetIDMatches
|
||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
@@ -552,4 +643,112 @@ bool LLLinkedItemIDMatches::operator()(LLInventoryCategory* cat, LLInventoryItem
|
|||||||
return (item &&
|
return (item &&
|
||||||
(item->getIsLinkType()) &&
|
(item->getIsLinkType()) &&
|
||||||
(item->getLinkedUUID() == mBaseItemID)); // A linked item's assetID will be the compared-to item's itemID.
|
(item->getLinkedUUID() == mBaseItemID)); // A linked item's assetID will be the compared-to item's itemID.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLSaveFolderState::setApply(BOOL apply)
|
||||||
|
{
|
||||||
|
mApply = apply;
|
||||||
|
// before generating new list of open folders, clear the old one
|
||||||
|
if(!apply)
|
||||||
|
{
|
||||||
|
clearOpenFolders();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
|
||||||
|
{
|
||||||
|
if(mApply)
|
||||||
|
{
|
||||||
|
// we're applying the open state
|
||||||
|
LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
|
||||||
|
if(!bridge) return;
|
||||||
|
LLUUID id(bridge->getUUID());
|
||||||
|
if(mOpenFolders.find(id) != mOpenFolders.end())
|
||||||
|
{
|
||||||
|
folder->setOpen(TRUE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// keep selected filter in its current state, this is less jarring to user
|
||||||
|
if (!folder->isSelected())
|
||||||
|
{
|
||||||
|
folder->setOpen(FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// we're recording state at this point
|
||||||
|
if(folder->isOpen())
|
||||||
|
{
|
||||||
|
LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
|
||||||
|
if(!bridge) return;
|
||||||
|
mOpenFolders.insert(bridge->getUUID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLOpenFilteredFolders::doItem(LLFolderViewItem *item)
|
||||||
|
{
|
||||||
|
if (item->getFiltered())
|
||||||
|
{
|
||||||
|
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLOpenFilteredFolders::doFolder(LLFolderViewFolder* folder)
|
||||||
|
{
|
||||||
|
if (folder->getFiltered() && folder->getParentFolder())
|
||||||
|
{
|
||||||
|
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||||
|
}
|
||||||
|
// if this folder didn't pass the filter, and none of its descendants did
|
||||||
|
else if (!folder->getFiltered() && !folder->hasFilteredDescendants())
|
||||||
|
{
|
||||||
|
folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_NO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLSelectFirstFilteredItem::doItem(LLFolderViewItem *item)
|
||||||
|
{
|
||||||
|
if (item->getFiltered() && !mItemSelected)
|
||||||
|
{
|
||||||
|
item->getRoot()->setSelection(item, FALSE, FALSE);
|
||||||
|
if (item->getParentFolder())
|
||||||
|
{
|
||||||
|
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||||
|
}
|
||||||
|
item->getRoot()->scrollToShowSelection();
|
||||||
|
mItemSelected = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLSelectFirstFilteredItem::doFolder(LLFolderViewFolder* folder)
|
||||||
|
{
|
||||||
|
if (folder->getFiltered() && !mItemSelected)
|
||||||
|
{
|
||||||
|
folder->getRoot()->setSelection(folder, FALSE, FALSE);
|
||||||
|
if (folder->getParentFolder())
|
||||||
|
{
|
||||||
|
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||||
|
}
|
||||||
|
folder->getRoot()->scrollToShowSelection();
|
||||||
|
mItemSelected = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item)
|
||||||
|
{
|
||||||
|
if (item->getParentFolder() && item->isSelected())
|
||||||
|
{
|
||||||
|
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder)
|
||||||
|
{
|
||||||
|
if (folder->getParentFolder() && folder->isSelected())
|
||||||
|
{
|
||||||
|
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ void change_category_parent(LLInventoryModel* model,
|
|||||||
LLViewerInventoryCategory* cat,
|
LLViewerInventoryCategory* cat,
|
||||||
const LLUUID& new_parent_id,
|
const LLUUID& new_parent_id,
|
||||||
BOOL restamp);
|
BOOL restamp);
|
||||||
|
|
||||||
|
void remove_category(LLInventoryModel* model, const LLUUID& cat_id);
|
||||||
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
|
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
|
||||||
|
|
||||||
// Generates a string containing the path to the item specified by item_id.
|
// Generates a string containing the path to the item specified by item_id.
|
||||||
@@ -259,6 +261,42 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
std::string mName;
|
std::string mName;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLFindWearables
|
||||||
|
//
|
||||||
|
// Collects wearables based on item type.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLFindWearables : public LLInventoryCollectFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLFindWearables() {}
|
||||||
|
virtual ~LLFindWearables() {}
|
||||||
|
virtual bool operator()(LLInventoryCategory* cat,
|
||||||
|
LLInventoryItem* item);
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Inventory Collector Functions
|
||||||
|
** **
|
||||||
|
*******************************************************************************/
|
||||||
|
class LLFolderViewItem;
|
||||||
|
class LLFolderViewFolder;
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
// Class LLFolderViewFunctor
|
||||||
|
//
|
||||||
|
// Simple abstract base class for applying a functor to folders and
|
||||||
|
// items in a folder view hierarchy. This is suboptimal for algorithms
|
||||||
|
// that only work folders or only work on items, but I'll worry about
|
||||||
|
// that later when it's determined to be too slow.
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
class LLFolderViewFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~LLFolderViewFunctor() {}
|
||||||
|
virtual void doFolder(LLFolderViewFolder* folder) = 0;
|
||||||
|
virtual void doItem(LLFolderViewItem* item) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
class LLInventoryState
|
class LLInventoryState
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -267,6 +305,49 @@ public:
|
|||||||
static LLUUID sWearNewClothingTransactionID; // wear all clothing in this transaction
|
static LLUUID sWearNewClothingTransactionID; // wear all clothing in this transaction
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class LLSelectFirstFilteredItem : public LLFolderViewFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLSelectFirstFilteredItem() : mItemSelected(FALSE) {}
|
||||||
|
virtual ~LLSelectFirstFilteredItem() {}
|
||||||
|
virtual void doFolder(LLFolderViewFolder* folder);
|
||||||
|
virtual void doItem(LLFolderViewItem* item);
|
||||||
|
BOOL wasItemSelected() { return mItemSelected; }
|
||||||
|
protected:
|
||||||
|
BOOL mItemSelected;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LLOpenFilteredFolders : public LLFolderViewFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLOpenFilteredFolders() {}
|
||||||
|
virtual ~LLOpenFilteredFolders() {}
|
||||||
|
virtual void doFolder(LLFolderViewFolder* folder);
|
||||||
|
virtual void doItem(LLFolderViewItem* item);
|
||||||
|
};
|
||||||
|
|
||||||
|
class LLSaveFolderState : public LLFolderViewFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLSaveFolderState() : mApply(FALSE) {}
|
||||||
|
virtual ~LLSaveFolderState() {}
|
||||||
|
virtual void doFolder(LLFolderViewFolder* folder);
|
||||||
|
virtual void doItem(LLFolderViewItem* item) {}
|
||||||
|
void setApply(BOOL apply);
|
||||||
|
void clearOpenFolders() { mOpenFolders.clear(); }
|
||||||
|
protected:
|
||||||
|
std::set<LLUUID> mOpenFolders;
|
||||||
|
BOOL mApply;
|
||||||
|
};
|
||||||
|
|
||||||
|
class LLOpenFoldersWithSelection : public LLFolderViewFunctor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LLOpenFoldersWithSelection() {}
|
||||||
|
virtual ~LLOpenFoldersWithSelection() {}
|
||||||
|
virtual void doFolder(LLFolderViewFolder* folder);
|
||||||
|
virtual void doItem(LLFolderViewItem* item);
|
||||||
|
};
|
||||||
|
|
||||||
#endif // LL_LLINVENTORYFUNCTIONS_H
|
#endif // LL_LLINVENTORYFUNCTIONS_H
|
||||||
|
|
||||||
|
|||||||
@@ -413,49 +413,6 @@ void LLInventoryViewFinder::selectNoTypes(void* user_data)
|
|||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
/// LLInventoryView
|
/// LLInventoryView
|
||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
void LLSaveFolderState::setApply(BOOL apply)
|
|
||||||
{
|
|
||||||
mApply = apply;
|
|
||||||
// before generating new list of open folders, clear the old one
|
|
||||||
if(!apply)
|
|
||||||
{
|
|
||||||
clearOpenFolders();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
|
|
||||||
{
|
|
||||||
if(mApply)
|
|
||||||
{
|
|
||||||
// we're applying the open state
|
|
||||||
LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
|
|
||||||
if(!bridge) return;
|
|
||||||
LLUUID id(bridge->getUUID());
|
|
||||||
if(mOpenFolders.find(id) != mOpenFolders.end())
|
|
||||||
{
|
|
||||||
folder->setOpen(TRUE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// keep selected filter in its current state, this is less jarring to user
|
|
||||||
if (!folder->isSelected())
|
|
||||||
{
|
|
||||||
folder->setOpen(FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// we're recording state at this point
|
|
||||||
if(folder->isOpen())
|
|
||||||
{
|
|
||||||
LLInvFVBridge* bridge = (LLInvFVBridge*)folder->getListener();
|
|
||||||
if(!bridge) return;
|
|
||||||
mOpenFolders.insert(bridge->getUUID());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Default constructor
|
// Default constructor
|
||||||
LLInventoryView::LLInventoryView(const std::string& name,
|
LLInventoryView::LLInventoryView(const std::string& name,
|
||||||
const std::string& rect,
|
const std::string& rect,
|
||||||
@@ -667,71 +624,6 @@ void LLInventoryView::draw()
|
|||||||
LLFloater::draw();
|
LLFloater::draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLOpenFilteredFolders::doItem(LLFolderViewItem *item)
|
|
||||||
{
|
|
||||||
if (item->getFiltered())
|
|
||||||
{
|
|
||||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLOpenFilteredFolders::doFolder(LLFolderViewFolder* folder)
|
|
||||||
{
|
|
||||||
if (folder->getFiltered() && folder->getParentFolder())
|
|
||||||
{
|
|
||||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
|
||||||
}
|
|
||||||
// if this folder didn't pass the filter, and none of its descendants did
|
|
||||||
else if (!folder->getFiltered() && !folder->hasFilteredDescendants())
|
|
||||||
{
|
|
||||||
folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_NO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLSelectFirstFilteredItem::doItem(LLFolderViewItem *item)
|
|
||||||
{
|
|
||||||
if (item->getFiltered() && !mItemSelected)
|
|
||||||
{
|
|
||||||
item->getRoot()->setSelection(item, FALSE, FALSE);
|
|
||||||
if (item->getParentFolder())
|
|
||||||
{
|
|
||||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
|
||||||
}
|
|
||||||
item->getRoot()->scrollToShowSelection();
|
|
||||||
mItemSelected = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLSelectFirstFilteredItem::doFolder(LLFolderViewFolder* folder)
|
|
||||||
{
|
|
||||||
if (folder->getFiltered() && !mItemSelected)
|
|
||||||
{
|
|
||||||
folder->getRoot()->setSelection(folder, FALSE, FALSE);
|
|
||||||
if (folder->getParentFolder())
|
|
||||||
{
|
|
||||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
|
||||||
}
|
|
||||||
folder->getRoot()->scrollToShowSelection();
|
|
||||||
mItemSelected = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item)
|
|
||||||
{
|
|
||||||
if (item->getParentFolder() && item->isSelected())
|
|
||||||
{
|
|
||||||
item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder)
|
|
||||||
{
|
|
||||||
if (folder->getParentFolder() && folder->isSelected())
|
|
||||||
{
|
|
||||||
folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void LLInventoryView::startSearch()
|
void LLInventoryView::startSearch()
|
||||||
{
|
{
|
||||||
// this forces focus to line editor portion of search editor
|
// this forces focus to line editor portion of search editor
|
||||||
|
|||||||
@@ -318,50 +318,6 @@ protected:
|
|||||||
static LLDynamicArray<LLInventoryView*> sActiveViews;
|
static LLDynamicArray<LLInventoryView*> sActiveViews;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLSelectFirstFilteredItem : public LLFolderViewFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLSelectFirstFilteredItem() : mItemSelected(FALSE) {}
|
|
||||||
virtual ~LLSelectFirstFilteredItem() {}
|
|
||||||
virtual void doFolder(LLFolderViewFolder* folder);
|
|
||||||
virtual void doItem(LLFolderViewItem* item);
|
|
||||||
BOOL wasItemSelected() { return mItemSelected; }
|
|
||||||
protected:
|
|
||||||
BOOL mItemSelected;
|
|
||||||
};
|
|
||||||
|
|
||||||
class LLOpenFilteredFolders : public LLFolderViewFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLOpenFilteredFolders() {}
|
|
||||||
virtual ~LLOpenFilteredFolders() {}
|
|
||||||
virtual void doFolder(LLFolderViewFolder* folder);
|
|
||||||
virtual void doItem(LLFolderViewItem* item);
|
|
||||||
};
|
|
||||||
|
|
||||||
class LLSaveFolderState : public LLFolderViewFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLSaveFolderState() : mApply(FALSE) {}
|
|
||||||
virtual ~LLSaveFolderState() {}
|
|
||||||
virtual void doFolder(LLFolderViewFolder* folder);
|
|
||||||
virtual void doItem(LLFolderViewItem* item) {}
|
|
||||||
void setApply(BOOL apply);
|
|
||||||
void clearOpenFolders() { mOpenFolders.clear(); }
|
|
||||||
protected:
|
|
||||||
std::set<LLUUID> mOpenFolders;
|
|
||||||
BOOL mApply;
|
|
||||||
};
|
|
||||||
|
|
||||||
class LLOpenFoldersWithSelection : public LLFolderViewFunctor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLOpenFoldersWithSelection() {}
|
|
||||||
virtual ~LLOpenFoldersWithSelection() {}
|
|
||||||
virtual void doFolder(LLFolderViewFolder* folder);
|
|
||||||
virtual void doItem(LLFolderViewItem* item);
|
|
||||||
};
|
|
||||||
|
|
||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
/// Function declarations, constants, enums, and typedefs
|
/// Function declarations, constants, enums, and typedefs
|
||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "llagent.h"
|
#include "llagent.h"
|
||||||
#include "llcallbacklist.h"
|
#include "llcallbacklist.h"
|
||||||
#include "llstartup.h"
|
#include "llstartup.h"
|
||||||
|
#include "llviewerfoldertype.h"
|
||||||
#include "llviewerobject.h"
|
#include "llviewerobject.h"
|
||||||
#include "llvoavatar.h"
|
#include "llvoavatar.h"
|
||||||
|
|
||||||
@@ -29,9 +30,6 @@
|
|||||||
|
|
||||||
#include "boost/algorithm/string.hpp"
|
#include "boost/algorithm/string.hpp"
|
||||||
|
|
||||||
// Only defined in llinventorymodel.cpp
|
|
||||||
extern const char* NEW_CATEGORY_NAME;
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Static variable initialization
|
// Static variable initialization
|
||||||
//
|
//
|
||||||
@@ -394,6 +392,7 @@ void RlvRenameOnWearObserver::doneIdle()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const std::string &new_category_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_NONE);
|
||||||
for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++)
|
for (S32 idxItem = 0, cntItem = items.count(); idxItem < cntItem; idxItem++)
|
||||||
{
|
{
|
||||||
LLViewerInventoryItem* pItem = items.get(idxItem);
|
LLViewerInventoryItem* pItem = items.get(idxItem);
|
||||||
@@ -428,7 +427,7 @@ void RlvRenameOnWearObserver::doneIdle()
|
|||||||
std::string strFolderName = ".(" + strAttachPt + ")";
|
std::string strFolderName = ".(" + strAttachPt + ")";
|
||||||
|
|
||||||
// Rename the item's parent folder if it's called "New Folder", isn't directly under #RLV and contains exactly 1 object
|
// Rename the item's parent folder if it's called "New Folder", isn't directly under #RLV and contains exactly 1 object
|
||||||
if ( (NEW_CATEGORY_NAME == pFolder->getName()) &&
|
if ( (new_category_name == pFolder->getName()) &&
|
||||||
(pFolder->getParentUUID() != pRlvRoot->getUUID()) &&
|
(pFolder->getParentUUID() != pRlvRoot->getUUID()) &&
|
||||||
(1 == RlvInventory::getDirectDescendentsCount(pFolder, LLAssetType::AT_OBJECT)) )
|
(1 == RlvInventory::getDirectDescendentsCount(pFolder, LLAssetType::AT_OBJECT)) )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user