EXP-922 FIX Purchased Direct Delivery items do not appear in Recent Inventory tab

switched to using filters to hide inbox and show it for recent items only
meow-7.2.2
Richard Linden 2011-06-28 14:45:09 -07:00
parent 200073c97a
commit c998f21c52
5 changed files with 20 additions and 25 deletions

View File

@ -1203,10 +1203,10 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation)
}
else
{
bool is_hidden = folderp->getListener() && LLViewerFolderType::lookupIsHiddenType(folderp->getListener()->getPreferredType());
folderp->setVisible( !is_hidden
&& (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter
folderp->setVisible( folderp->getListener()
&& ((folderp->getFilteredFolder(filter_generation)
&& folderp->getFiltered(filter_generation))
|| folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter
}
if (folderp->getVisible())

View File

@ -125,7 +125,8 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder)
const LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id);
if (!cat)
return false;
if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0))
LLFolderType::EType cat_type = cat->getPreferredType();
if (cat_type != LLFolderType::FT_NONE && (1LL << cat_type & mFilterOps.mFilterCategoryTypes) == U64(0))
return false;
}
@ -298,8 +299,8 @@ void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types)
if (current_types != types)
{
// keep current items only if no type bits getting turned off
BOOL fewer_bits_set = (current_types & ~types);
BOOL more_bits_set = (~current_types & types);
bool fewer_bits_set = (current_types & ~types) != 0;
bool more_bits_set = (~current_types & types) != 0;
current_types = types;
if (more_bits_set && fewer_bits_set)

View File

@ -245,6 +245,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
}
mFolderRoot->setSortOrder(getFilter()->getSortOrder());
// hide inbox
getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX));
// Initialize base class params.
LLPanel::initFromParams(params);
}
@ -1090,6 +1093,13 @@ public:
struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
{};
void initFromParams(const Params& p)
{
LLInventoryPanel::initFromParams(p);
// turn on inbox for recent items
getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX));
}
protected:
LLInventoryRecentItemsPanel (const Params&);
friend class LLUICtrlFactory;

View File

@ -40,7 +40,6 @@ struct ViewerFolderEntry : public LLDictionaryEntry
const std::string &icon_name_open, // name of the folder icon
const std::string &icon_name_closed,
BOOL is_quiet, // folder doesn't need a UI update when changed
bool is_hidden = false,
const std::string &dictionary_name = empty_string // no reverse lookup needed on non-ensembles, so in most cases just leave this blank
)
:
@ -48,8 +47,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry
mNewCategoryName(new_category_name),
mIconNameOpen(icon_name_open),
mIconNameClosed(icon_name_closed),
mIsQuiet(is_quiet),
mIsHidden(is_hidden)
mIsQuiet(is_quiet)
{
mAllowedNames.clear();
}
@ -68,8 +66,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry
*/
mIconNameOpen("Inv_FolderOpen"), mIconNameClosed("Inv_FolderClosed"),
mNewCategoryName(new_category_name),
mIsQuiet(FALSE),
mIsHidden(false)
mIsQuiet(FALSE)
{
const std::string delims (",");
LLStringUtilBase<char>::getTokens(allowed_names, mAllowedNames, delims);
@ -94,7 +91,6 @@ struct ViewerFolderEntry : public LLDictionaryEntry
typedef std::vector<std::string> name_vec_t;
name_vec_t mAllowedNames;
BOOL mIsQuiet;
bool mIsHidden;
};
class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>,
@ -264,17 +260,6 @@ BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type)
}
BOOL LLViewerFolderType::lookupIsHiddenType(LLFolderType::EType folder_type)
{
const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type);
if (entry)
{
return entry->mIsHidden;
}
return FALSE;
}
const std::string &LLViewerFolderType::lookupNewCategoryName(LLFolderType::EType folder_type)
{
const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type);

View File

@ -40,7 +40,6 @@ public:
static const std::string& lookupIconName(EType folder_type, BOOL is_open = FALSE); // folder icon name
static BOOL lookupIsQuietType(EType folder_type); // folder doesn't require UI update when changes have occured
static BOOL lookupIsHiddenType(EType folder_type); // folder doesn't require UI update when changes have occured
static const std::string& lookupNewCategoryName(EType folder_type); // default name when creating new category
static LLFolderType::EType lookupTypeFromNewCategoryName(const std::string& name); // default name when creating new category