From 6a0cf31d10e4f378fba40a8f3b0aca2fcfa5b53d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 5 Aug 2017 14:04:10 +0200 Subject: [PATCH] Manual merge of SL-717 with Zi's extended inventory search so we can simply discard LL's upcoming commit without screwing things up --- indra/llui/llfolderviewmodel.h | 23 +- indra/newview/llconversationmodel.h | 4 + indra/newview/llinventorybridge.cpp | 182 +++++++------ indra/newview/llinventorybridge.h | 13 +- indra/newview/llinventoryfilter.cpp | 185 ++++++++------ indra/newview/llinventoryfilter.h | 41 +-- indra/newview/llinventorypanel.cpp | 37 +-- indra/newview/llinventorypanel.h | 10 +- indra/newview/llpanelmaininventory.cpp | 241 ++++++++++++++---- indra/newview/llpanelmaininventory.h | 12 +- indra/newview/llpanelobjectinventory.cpp | 5 + indra/newview/llsidepanelinventory.cpp | 13 + indra/newview/llsidepanelinventory.h | 1 + .../ansastorm/xui/en/panel_main_inventory.xml | 54 ++-- .../xui/de/floater_inventory_view_finder.xml | 2 + .../skins/default/xui/de/menu_inventory.xml | 2 +- .../xui/en/floater_inventory_view_finder.xml | 20 +- .../skins/default/xui/en/menu_inventory.xml | 6 +- .../xui/en/menu_inventory_gear_default.xml | 57 ++--- .../skins/default/xui/fr/menu_inventory.xml | 2 +- .../skins/default/xui/ja/menu_inventory.xml | 2 +- .../skins/default/xui/pl/menu_inventory.xml | 2 +- .../skins/default/xui/ru/menu_inventory.xml | 2 +- .../vintage/xui/en/panel_main_inventory.xml | 53 ++-- 24 files changed, 579 insertions(+), 390 deletions(-) diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index f838d2f736..4a41c3a53d 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -28,22 +28,6 @@ #include "llfontgl.h" // just for StyleFlags enum #include "llfolderview.h" -// Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -// Interface to query extended object attributes, -class FSFolderViewModelItem -{ -public: - virtual std::string getSearchableCreator( void ) const - { return ""; } - virtual std::string getSearchableDescription( void ) const - { return ""; } - virtual std::string getSearchableUUID( void ) const - { return ""; } - virtual std::string getSearchableAll( void ) const - { return ""; } -}; -// - // These are grouping of inventory types. // Order matters when sorting system folders to the top. enum EInventorySortGroup @@ -149,7 +133,7 @@ public: // This is an abstract base class that users of the folderview classes // would use to bridge the folder view with the underlying data -class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable, public FSFolderViewModelItem +class LLFolderViewModelItem : public LLRefCount, public LLTrace::MemTrackable { public: LLFolderViewModelItem() @@ -163,6 +147,11 @@ public: virtual const std::string& getDisplayName() const = 0; virtual const std::string& getSearchableName() const = 0; + virtual std::string getSearchableDescription() const = 0; + virtual std::string getSearchableCreatorName()const = 0; + virtual std::string getSearchableUUIDString() const = 0; + virtual std::string getSearchableAll() const = 0; // Zi's extended inventory search + virtual LLPointer getIcon() const = 0; virtual LLPointer getIconOpen() const { return getIcon(); } virtual LLPointer getIconOverlay() const { return NULL; } diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 640f1a4144..0cd9e624b2 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -72,6 +72,10 @@ public: virtual const std::string& getName() const { return mName; } virtual const std::string& getDisplayName() const { return mName; } virtual const std::string& getSearchableName() const { return mName; } + virtual std::string getSearchableDescription() const { return LLStringUtil::null; } + virtual std::string getSearchableCreatorName() const { return LLStringUtil::null; } + virtual std::string getSearchableUUIDString() const {return LLStringUtil::null;} + virtual std::string getSearchableAll() const { return LLStringUtil::null; } // Zi's extended inventory search virtual const LLUUID& getUUID() const { return mUUID; } virtual time_t getCreationDate() const { return 0; } virtual LLPointer getIcon() const { return NULL; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e3d66205f7..79e9f5504e 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -228,6 +228,68 @@ const std::string& LLInvFVBridge::getDisplayName() const return mDisplayName; } +std::string LLInvFVBridge::getSearchableDescription() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLInventoryItem *item = model->getItem(mUUID); + if(item) + { + std::string desc = item->getDescription(); + LLStringUtil::toUpper(desc); + return desc; + } + } + return LLStringUtil::null; +} + +std::string LLInvFVBridge::getSearchableCreatorName() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLInventoryItem *item = model->getItem(mUUID); + if(item) + { + LLAvatarName av_name; + if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name)) + { + std::string username = av_name.getUserName(); + LLStringUtil::toUpper(username); + return username; + } + } + } + return LLStringUtil::null; +} + +std::string LLInvFVBridge::getSearchableUUIDString() const +{ + const LLInventoryModel* model = getInventoryModel(); + if (model) + { + const LLInventoryItem *item = model->getItem(mUUID); + if(item) + { + std::string uuid = item->getAssetUUID().asString(); + LLStringUtil::toUpper(uuid); + return uuid; + } + } + return LLStringUtil::null; +} + +// Zi's extended inventory search +std::string LLInvFVBridge::getSearchableAll() const +{ + return getSearchableName() + "+" + + getSearchableCreatorName() + "+" + + getSearchableDescription() + "+" + + getSearchableUUIDString(); +} +// + // Folders have full perms PermissionMask LLInvFVBridge::getPermissionMask() const { @@ -889,6 +951,12 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, // disabled_items.push_back(std::string("Properties")); //} // + + LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); + if (active_panel && (active_panel->getName() != "All Items")) + { + items.push_back(std::string("Show in Main Panel")); + } } void LLInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) @@ -1695,25 +1763,6 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) { gotoItem(); } - - // Find item in main inventory tab - if ("find_in_main" == action) - { - // Go to the item. Similar to gotoItem() but with normal items, not links. - LLInventoryObject *obj = getInventoryObject(); - - mInventoryPanel.get()->getParentByType()->selectFirstTab(); - if (obj) - { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); - if (active_panel) - { - active_panel->setSelection(obj->getUUID(), TAKE_FOCUS_YES); - } - } - } - // - if ("open" == action || "open_original" == action) { openItem(); @@ -1751,6 +1800,11 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(buffer)); return; } + else if ("show_in_main_panel" == action) + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE); + return; + } else if ("cut" == action) { cutToClipboard(); @@ -2017,13 +2071,19 @@ void LLItemBridge::buildDisplayName() const { mDisplayName.assign(LLStringUtil::null); } - + S32 old_length = mSearchableName.length(); + S32 new_length = mDisplayName.length() + getLabelSuffix().length(); + mSearchableName.assign(mDisplayName); mSearchableName.append(getLabelSuffix()); LLStringUtil::toUpper(mSearchableName); - //Name set, so trigger a sort - if(mParent) + if ((old_length > new_length) && getInventoryFilter()) + { + getInventoryFilter()->setModified(LLFolderViewFilter::FILTER_MORE_RESTRICTIVE); + } + //Name set, so trigger a sort + if(mParent) { mParent->requestSort(); } @@ -3361,6 +3421,11 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) return; } // + else if ("show_in_main_panel" == action) + { + LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE); + return; + } else if ("cut" == action) { cutToClipboard(); @@ -6872,10 +6937,6 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ( (rlv_handler_t::isEnabled()) && (!gRlvAttachmentLocks.canDetach(item)) ) disabled_items.push_back(std::string("Detach From Yourself")); // [/RLVa:KB] - // Add "Find in Main" option to Worn Items - if (mInventoryPanel.get()->getName() == "Worn Items") - items.push_back(std::string("Find in Main")); // This should appear only in Worn Items tab - // } else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder()) { @@ -7174,10 +7235,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ( (rlv_handler_t::isEnabled()) && (!gRlvWearableLocks.canRemove(item)) ) disabled_items.push_back(std::string("Take Off")); // [/RLVa:KB] - // Add "Find in Main" option to Worn Items - if (mInventoryPanel.get()->getName() == "Worn Items") - items.push_back(std::string("Find in Main")); - // } else { @@ -7980,69 +8037,4 @@ LLInvFVBridge* LLWornInventoryBridgeBuilder::createBridge( return new_listener; } - -// Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -std::string LLInvFVBridge::getSearchableCreator( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strCreator; - if(pItem) - { - LLAvatarName av_name; - if (LLAvatarNameCache::get(pItem->getCreatorUUID(), &av_name)) - { - strCreator = av_name.getUserName(); - LLStringUtil::toUpper( strCreator ); - } - } - - return strCreator; -} - -std::string LLInvFVBridge::getSearchableDescription( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strDescr; - - if(pItem) - { - if(!pItem->getDescription().empty() ) - { - strDescr = pItem->getDescription(); - LLStringUtil::toUpper( strDescr ); - } - } - - return strDescr; -} - -std::string LLInvFVBridge::getSearchableUUID( void ) const -{ - LLInventoryItem *pItem( dynamic_cast< LLInventoryItem* >( getInventoryObject() ) ); - - std::string strUUID; - if(pItem) - { - if(!pItem->getAssetUUID().isNull()) - { - strUUID = pItem->getAssetUUID().asString(); - LLStringUtil::toUpper( strUUID ); - } - - } - return strUUID; - -} - -std::string LLInvFVBridge::getSearchableAll( void ) const -{ - return getSearchableName() + "+" + - getSearchableCreator() + "+" + - getSearchableDescription() + "+" + - getSearchableUUID(); -} -// - // EOF diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index cb5064ac4c..a95969952e 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -94,6 +94,11 @@ public: virtual const std::string& getDisplayName() const; const std::string& getSearchableName() const { return mSearchableName; } + std::string getSearchableDescription() const; + std::string getSearchableCreatorName() const; + std::string getSearchableUUIDString() const; + std::string getSearchableAll() const; // Zi's extended inventory search + virtual PermissionMask getPermissionMask() const; virtual LLFolderType::EType getPreferredType() const; virtual time_t getCreationDate() const; @@ -206,14 +211,6 @@ protected: void purgeItem(LLInventoryModel *model, const LLUUID &uuid); void removeObject(LLInventoryModel *model, const LLUUID &uuid); virtual void buildDisplayName() const {} - - // Reintegrate search by uuid/creator/descripting from Zi Ree after CHUI Merge -public: - virtual std::string getSearchableCreator( void ) const; - virtual std::string getSearchableDescription( void ) const; - virtual std::string getSearchableUUID( void ) const; - virtual std::string getSearchableAll( void ) const; - // }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index ad49c5f9d3..154a3ef598 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -29,6 +29,7 @@ #include "llinventoryfilter.h" // viewer includes +#include "llagent.h" #include "llfolderviewmodel.h" #include "llfolderviewitem.h" #include "llinventorymodel.h" @@ -74,13 +75,14 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) : mName(p.name), mFilterModified(FILTER_NONE), mEmptyLookupMessage("InventoryNoMatchingItems"), - mFilterSubStringTarget(SUBST_TARGET_NAME), // Extended Inventory Search mFilterOps(p.filter_ops), mBackupFilterOps(mFilterOps), mFilterSubString(p.substring), mCurrentGeneration(0), mFirstRequiredGeneration(0), - mFirstSuccessGeneration(0) + mFirstSuccessGeneration(0), + mSearchType(SEARCHTYPE_NAME), + mFilterCreatorType(FILTERCREATOR_ALL) { // Begin Multi-substring inventory search mSubStringMatchOffsets.clear(); @@ -89,31 +91,10 @@ LLInventoryFilter::LLInventoryFilter(const Params& p) // copy mFilterOps into mDefaultFilterOps markDefault(); + mUsername = gAgentUsername; + LLStringUtil::toUpper(mUsername); } -// Extended Inventory Search -void LLInventoryFilter::setFilterSubStringTarget(const std::string& targetName) -{ - if (targetName == "name") - mFilterSubStringTarget = SUBST_TARGET_NAME; - else if (targetName == "creator") - mFilterSubStringTarget = SUBST_TARGET_CREATOR; - else if (targetName == "description") - mFilterSubStringTarget = SUBST_TARGET_DESCRIPTION; - else if (targetName == "uuid") - mFilterSubStringTarget = SUBST_TARGET_UUID; - else if (targetName == "all") - mFilterSubStringTarget = SUBST_TARGET_ALL; - else - LL_WARNS("LLInventoryFilter") << "Unknown sub string target: " << targetName << LL_ENDL; -} - -LLInventoryFilter::EFilterSubstringTarget LLInventoryFilter::getFilterSubStringTarget() const -{ - return mFilterSubStringTarget; -} -// Extended Inventory Search - bool LLInventoryFilter::check(const LLFolderViewModelItem* item) { const LLFolderViewModelItemInventory* listener = dynamic_cast(item); @@ -126,30 +107,48 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) } // Multi-substring inventory search - //bool passed = (mFilterSubString.size() ? listener->getSearchableName().find(mFilterSubString) != std::string::npos : true); + //std::string desc = listener->getSearchableCreatorName(); + //switch(mSearchType) + //{ + // case SEARCHTYPE_CREATOR: + // desc = listener->getSearchableCreatorName(); + // break; + // case SEARCHTYPE_DESCRIPTION: + // desc = listener->getSearchableDescription(); + // break; + // case SEARCHTYPE_UUID: + // desc = listener->getSearchableUUIDString(); + // break; + // case SEARCHTYPE_NAME: + // default: + // desc = listener->getSearchableName(); + // break; + //} + + //bool passed = (mFilterSubString.size() ? desc.find(mFilterSubString) != std::string::npos : true); std::string::size_type string_offset = std::string::npos; if (mFilterSubStrings.size()) { std::string searchLabel; - switch (mFilterSubStringTarget) + switch (mSearchType) { - case SUBST_TARGET_NAME: + case SEARCHTYPE_NAME: searchLabel = listener->getSearchableName(); break; - case SUBST_TARGET_CREATOR: - searchLabel = listener->getSearchableCreator(); - break; - case SUBST_TARGET_DESCRIPTION: + case SEARCHTYPE_DESCRIPTION: searchLabel = listener->getSearchableDescription(); break; - case SUBST_TARGET_UUID: - searchLabel = listener->getSearchableUUID(); + case SEARCHTYPE_CREATOR: + searchLabel = listener->getSearchableCreatorName(); break; - case SUBST_TARGET_ALL: + case SEARCHTYPE_UUID: + searchLabel = listener->getSearchableUUIDString(); + break; + case SEARCHTYPE_ALL: searchLabel = listener->getSearchableAll(); break; default: - LL_WARNS("LLInventoryFilter") << "Unknown search substring target: " << mFilterSubStringTarget << LL_ENDL; + LL_WARNS("LLInventoryFilter") << "Unknown search substring target: " << mSearchType << LL_ENDL; searchLabel = listener->getSearchableName(); break; } @@ -184,6 +183,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item) passed = passed && checkAgainstFilterType(listener); passed = passed && checkAgainstPermissions(listener); passed = passed && checkAgainstFilterLinks(listener); + passed = passed && checkAgainstCreator(listener); return passed; } @@ -332,6 +332,32 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent } } + // + //if(filterTypes & FILTERTYPE_WORN) + //{ + // if (!get_is_item_worn(object_id)) + // { + // return FALSE; + // } + //} + //////////////////////////////////////////////////////////////////////////////// + // FILTERTYPE_WORN + // Pass if this item is worn (hiding COF and Outfits folders) + if (filterTypes & FILTERTYPE_WORN) + { + if (!object) + { + return FALSE; + } + const LLUUID& cat_id = object->getParentUUID(); + const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); + return !LLAppearanceMgr::instance().getIsInCOF(object_id) // Not a link in COF + && (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT) // Not a link in an outfit folder + && get_is_item_worn(object_id); + } + // + + //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_UUID // Pass if this item is the target UUID or if it links to the target UUID @@ -399,24 +425,6 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent } // - // - //////////////////////////////////////////////////////////////////////////////// - // FILTERTYPE_WORN - // Pass if this item is worn (hiding COF and Outfits folders) - if (filterTypes & FILTERTYPE_WORN) - { - if (!object) - { - return FALSE; - } - const LLUUID& cat_id = object->getParentUUID(); - const LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); - return !LLAppearanceMgr::instance().getIsInCOF(object_id) // Not a link in COF - && (!cat || cat->getPreferredType() != LLFolderType::FT_OUTFIT) // Not a link in an outfit folder - && get_is_item_worn(object_id); - } - // - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_EMPTYFOLDERS // Pass if this item is a folder and is not a system folder that should be hidden @@ -571,6 +579,24 @@ bool LLInventoryFilter::checkAgainstFilterLinks(const LLFolderViewModelItemInven return TRUE; } +bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory* listener) const +{ + if (!listener) return TRUE; + const BOOL is_folder = listener->getInventoryType() == LLInventoryType::IT_CATEGORY; + switch(mFilterCreatorType) + { + case FILTERCREATOR_SELF: + if(is_folder) return FALSE; + return (listener->getSearchableCreatorName() == mUsername); + case FILTERCREATOR_OTHERS: + if(is_folder) return FALSE; + return (listener->getSearchableCreatorName() != mUsername); + case FILTERCREATOR_ALL: + default: + return TRUE; + } +} + const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const { return mFilterSubString; @@ -578,7 +604,17 @@ const std::string& LLInventoryFilter::getFilterSubString(BOOL trim) const std::string::size_type LLInventoryFilter::getStringMatchOffset(LLFolderViewModelItem* item) const { - return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + // Zi's extended inventory search + //if (mSearchType == SEARCHTYPE_NAME) + if (mSearchType == SEARCHTYPE_NAME || mSearchType == SEARCHTYPE_ALL) + // + { + return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos; + } + else + { + return std::string::npos; + } } bool LLInventoryFilter::isDefault() const @@ -651,6 +687,24 @@ void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) } } +void LLInventoryFilter::setSearchType(ESearchType type) +{ + if(mSearchType != type) + { + mSearchType = type; + setModified(); + } +} + +void LLInventoryFilter::setFilterCreator(EFilterCreatorType type) +{ + if(mFilterCreatorType != type) + { + mFilterCreatorType = type; + setModified(); + } +} + void LLInventoryFilter::setFilterObjectTypes(U64 types) { updateFilterTypes(types, mFilterOps.mFilterObjectTypes); @@ -674,6 +728,11 @@ void LLInventoryFilter::setFilterEmptySystemFolders() mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS; } +void LLInventoryFilter::setFilterWorn() +{ + mFilterOps.mFilterTypes |= FILTERTYPE_WORN; +} + void LLInventoryFilter::setFilterMarketplaceActiveFolders() { mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_ACTIVE; @@ -1041,21 +1100,6 @@ void LLInventoryFilter::setFindAllLinksMode(const std::string &search_name, cons setFilterLinks(FILTERLINK_ONLY_LINKS); } -// -void LLInventoryFilter::setFilterWorn(BOOL worn) -{ - setModified(); - if (worn) - { - mFilterOps.mFilterTypes |= FILTERTYPE_WORN; - } - else - { - mFilterOps.mFilterTypes &= ~FILTERTYPE_WORN; - } -} -// - // FIRE-19340: search inventory by transferable permission void LLInventoryFilter::setFilterTransferable(BOOL transferable) { @@ -1317,7 +1361,6 @@ LLInventoryFilter& LLInventoryFilter::operator=( const LLInventoryFilter& othe setFilterPermissions(other.getFilterPermissions()); setFilterSubString(other.getFilterSubString()); setDateRangeLastLogoff(other.isSinceLogoff()); - setFilterWorn(other.getFilterWorn()); // FIRE-19340: search inventory by transferable permission setFilterTransferable(other.getFilterTransferable()); return *this; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index f7c17a64ab..9313aa06d0 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -58,7 +58,7 @@ public: FILTERTYPE_MARKETPLACE_UNASSOCIATED = 0x1 << 8, // pass if folder is a marketplace non associated (no market ID) folder FILTERTYPE_MARKETPLACE_LISTING_FOLDER = 0x1 << 9, // pass iff folder is a listing folder FILTERTYPE_NO_MARKETPLACE_ITEMS = 0x1 << 10, // pass iff folder is not under the marketplace - FILTERTYPE_WORN = 0x1 << 11, // search by wearable type + FILTERTYPE_WORN = 0x1 << 11, // pass if item is worn FILTERTYPE_TRANSFERABLE = 0x1 << 12 // FIRE-19340: search inventory by transferable permission }; @@ -84,16 +84,21 @@ public: SO_FOLDERS_BY_WEIGHT = 0x1 << 3, // Force folder sort by weight, usually, amount of some elements in their descendents }; - // Extended Inventory Search - enum EFilterSubstringTarget + enum ESearchType { - SUBST_TARGET_NAME = 0, // Classic search for item name - SUBST_TARGET_CREATOR, // Search for creator name - SUBST_TARGET_DESCRIPTION, // Search for item description - SUBST_TARGET_UUID, // Search for asset UUID - SUBST_TARGET_ALL // Search in all fields at the same time + SEARCHTYPE_NAME, + SEARCHTYPE_DESCRIPTION, + SEARCHTYPE_CREATOR, + SEARCHTYPE_UUID, + SEARCHTYPE_ALL // Zi's extended inventory search + }; + + enum EFilterCreatorType + { + FILTERCREATOR_ALL, + FILTERCREATOR_SELF, + FILTERCREATOR_OTHERS }; - // Extended Inventory Search struct FilterOps { @@ -191,6 +196,7 @@ public: void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); void setFilterEmptySystemFolders(); + void setFilterWorn(); void removeFilterEmptySystemFolders(); // Optional hiding of empty system folders void setFilterMarketplaceActiveFolders(); void setFilterMarketplaceInactiveFolders(); @@ -198,6 +204,10 @@ public: void setFilterMarketplaceListingFolders(bool select_only_listing_folders); void setFilterNoMarketplaceFolder(); void updateFilterTypes(U64 types, U64& current_types); + void setSearchType(ESearchType type); + ESearchType getSearchType() { return mSearchType; } + void setFilterCreator(EFilterCreatorType type); + EFilterCreatorType getFilterCreator() { return mFilterCreatorType; } void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; @@ -231,9 +241,7 @@ public: void setFindAllLinksMode(const std::string &search_name, const LLUUID& search_id); // - void setFilterWorn(BOOL worn); BOOL getFilterWorn() const { return mFilterOps.mFilterTypes & FILTERTYPE_WORN; } - // // FIRE-19340: search inventory by transferable permission void setFilterTransferable(BOOL transferable); @@ -252,11 +260,6 @@ public: std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const; std::string::size_type getFilterStringSize() const; - // Extended Inventory Search - void setFilterSubStringTarget(const std::string& targetName); - EFilterSubstringTarget getFilterSubStringTarget() const; - std::string getSearchableTarget(const LLFolderViewItem* item) const; - // Extended Inventory Search // +-------------------------------------------------------------------+ // + Presentation @@ -316,6 +319,7 @@ private: bool checkAgainstPermissions(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstPermissions(const LLInventoryItem* item) const; bool checkAgainstFilterLinks(const class LLFolderViewModelItemInventory* listener) const; + bool checkAgainstCreator(const class LLFolderViewModelItemInventory* listener) const; bool checkAgainstClipboard(const LLUUID& object_id) const; FilterOps mFilterOps; @@ -327,10 +331,10 @@ private: // Multi-substring inventory search std::vector mSubStringMatchOffsets; std::vector mFilterSubStrings; - EFilterSubstringTarget mFilterSubStringTarget; // Multi-substring inventory search std::string mFilterSubStringOrig; + std::string mUsername; const std::string mName; S32 mCurrentGeneration; @@ -345,6 +349,9 @@ private: std::string mFilterText; std::string mEmptyLookupMessage; + + ESearchType mSearchType; + EFilterCreatorType mFilterCreatorType; }; #endif diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 78ac28c99d..cd730e2ca5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -382,6 +382,11 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType getFilter().setFilterCategoryTypes(types); } +void LLInventoryPanel::setFilterWorn() +{ + getFilter().setFilterWorn(); +} + U32 LLInventoryPanel::getFilterObjectTypes() const { return getFilter().getFilterObjectTypes(); @@ -408,18 +413,6 @@ void LLInventoryPanel::setFilterSubString(const std::string& string) getFilter().setFilterSubString(string); } -// Extended Inventory Search -void LLInventoryPanel::setFilterSubStringTarget(const std::string& target) -{ - getFilter().setFilterSubStringTarget(target); -} - -LLInventoryFilter::EFilterSubstringTarget LLInventoryPanel::getFilterSubStringTarget() const -{ - return getFilter().getFilterSubStringTarget(); -} -// Extended Inventory Search - const std::string LLInventoryPanel::getFilterSubString() { return getFilter().getFilterSubString(); @@ -470,12 +463,15 @@ U64 LLInventoryPanel::getFilterLinks() } // Filter Links Menu -// -void LLInventoryPanel::setWorn(BOOL worn) +void LLInventoryPanel::setSearchType(LLInventoryFilter::ESearchType type) { - getFilter().setFilterWorn(worn); + getFilter().setSearchType(type); +} + +LLInventoryFilter::ESearchType LLInventoryPanel::getSearchType() +{ + return getFilter().getSearchType(); } -// // FIRE-19340: search inventory by transferable permission void LLInventoryPanel::setTransferable(BOOL transferable) @@ -1520,9 +1516,14 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) } //static -void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id) +void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel) { - LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); + LLInventoryPanel *active_panel; + if (main_panel) + { + LLFloaterSidePanelContainer::getPanel("inventory")->selectAllItemsPanel(); + } + active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); if (active_panel) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index cfe96864d7..522a387eea 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -173,23 +173,21 @@ public: LLInventoryFilter& getFilter(); const LLInventoryFilter& getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); + void setFilterWorn(); U32 getFilterObjectTypes() const; void setFilterPermMask(PermissionMask filter_perm_mask); U32 getFilterPermMask() const; void setFilterWearableTypes(U64 filter); void setFilterSubString(const std::string& string); const std::string getFilterSubString(); - // Extended Inventory Search - void setFilterSubStringTarget(const std::string& target); - LLInventoryFilter::EFilterSubstringTarget getFilterSubStringTarget() const; - // Extended Inventory Search void setSinceLogoff(BOOL sl); void setHoursAgo(U32 hours); void setDateSearchDirection(U32 direction); BOOL getSinceLogoff(); void setFilterLinks(U64 filter_links); U64 getFilterLinks(); // Filter Links Menu - void setWorn(BOOL worn); // + void setSearchType(LLInventoryFilter::ESearchType type); + LLInventoryFilter::ESearchType getSearchType(); void setTransferable(BOOL transferable); // FIRE-19340: search inventory by transferable permission void setShowFolderState(LLInventoryFilter::EFolderShow show); @@ -232,7 +230,7 @@ public: // "Auto_open" determines if we open an inventory panel if none are open. static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); - static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id); + static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel = FALSE); void addItemID(const LLUUID& id, LLFolderViewItem* itemp); void removeItemID(const LLUUID& id); diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 33766504a4..e95affb78f 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -30,6 +30,7 @@ #include "llagent.h" #include "llagentcamera.h" #include "llavataractions.h" +#include "llcheckboxctrl.h" #include "llcombobox.h" #include "lldndbutton.h" #include "lleconomy.h" @@ -94,6 +95,9 @@ public: BOOL getCheckSinceLogoff(); U32 getDateSearchDirection(); + void onCreatorSelfFilterCommit(); + void onCreatorOtherFilterCommit(); + static void onTimeAgo(LLUICtrl*, void *); static void onCloseBtn(void* user_data); static void selectAllTypes(void* user_data); @@ -105,6 +109,8 @@ private: LLPanelMainInventory* mPanelMainInventory; LLSpinCtrl* mSpinSinceDays; LLSpinCtrl* mSpinSinceHours; + LLCheckBoxCtrl* mCreatorSelf; + LLCheckBoxCtrl* mCreatorOthers; LLInventoryFilter* mFilter; }; @@ -115,11 +121,13 @@ private: LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) : LLPanel(p), mActivePanel(NULL), + mWornItemsPanel(NULL), mSavedFolderState(NULL), mFilterText(""), mMenuGearDefault(NULL), mMenuAddHandle(), - mNeedUploadCost(true) + mNeedUploadCost(true), + mSearchTypeCombo(NULL) // Properly initialize this { // Menu Callbacks (non contex menus) mCommitCallbackRegistrar.add("Inventory.DoToSelected", boost::bind(&LLPanelMainInventory::doToSelected, this, _2)); @@ -138,8 +146,8 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) // Filter Links Menu // Extended Inventory Search - mCommitCallbackRegistrar.add("Inventory.SearchTarget.Set", boost::bind(&LLPanelMainInventory::onSearchTargetChecked, this, _2)); - mEnableCallbackRegistrar.add("Inventory.SearchTarget.Check", boost::bind(&LLPanelMainInventory::isSearchTargetChecked, this, _2)); + mCommitCallbackRegistrar.add("Inventory.SearchType.Set", boost::bind(&LLPanelMainInventory::onSearchTypeChecked, this, _2)); + mEnableCallbackRegistrar.add("Inventory.SearchType.Check", boost::bind(&LLPanelMainInventory::isSearchTypeChecked, this, _2)); // Extended Inventory Search // Sort By menu handlers @@ -226,30 +234,38 @@ BOOL LLPanelMainInventory::postBuild() recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2)); } - // Bring back worn items panel. - LLInventoryPanel* worn_items_panel = getChild("Worn Items"); - if (worn_items_panel) + LLInventoryPanel* mWornItemsPanel = getChild("Worn Items"); + if (mWornItemsPanel) { - worn_items_panel->setWorn(TRUE); - worn_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); - worn_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - LLInventoryFilter& worn_filter = worn_items_panel->getFilter(); - worn_filter.setFilterObjectTypes(0xffffffffffffffffULL & ~(0x1 << LLInventoryType::IT_GESTURE | 0x1 << LLInventoryType::IT_CATEGORY)); - worn_filter.markDefault(); + U32 filter_types = 0x0; + filter_types |= 0x1 << LLInventoryType::IT_WEARABLE; + filter_types |= 0x1 << LLInventoryType::IT_ATTACHMENT; + filter_types |= 0x1 << LLInventoryType::IT_OBJECT; + mWornItemsPanel->setFilterTypes(filter_types); + mWornItemsPanel->setFilterWorn(); + mWornItemsPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mWornItemsPanel->setFilterLinks(LLInventoryFilter::FILTERLINK_EXCLUDE_LINKS); + mWornItemsPanel->getFilter().markDefault(); + mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2)); - // Do not go all crazy and recurse through the whole inventory - // worn_items_panel->openAllFolders(); - if( worn_items_panel->getRootFolder() ) + // Firestorm additions + mWornItemsPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER)); + + if (mWornItemsPanel->getRootFolder()) { - worn_items_panel->getRootFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_NO); - worn_items_panel->getRootFolder()->arrangeAll(); + mWornItemsPanel->getRootFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_NO); + mWornItemsPanel->getRootFolder()->arrangeAll(); } - // - - worn_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, worn_items_panel, _1, _2)); + // + } + // Only if we actually have it! + //mSearchTypeCombo = getChild("search_type"); + mSearchTypeCombo = findChild("search_type"); + // + if(mSearchTypeCombo) + { + mSearchTypeCombo->setCommitCallback(boost::bind(&LLPanelMainInventory::onSelectSearchType, this)); } - // - // Now load the stored settings from disk, if available. std::string filterSaveName(gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME)); LL_INFOS() << "LLPanelMainInventory::init: reading from " << filterSaveName << LL_ENDL; @@ -391,6 +407,16 @@ LLPanelMainInventory::~LLPanelMainInventory( void ) delete mSavedFolderState; } +LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel() +{ + return getChild("All Items"); +} + +void LLPanelMainInventory::selectAllItemsPanel() +{ + mFilterTabs->selectFirstTab(); +} + void LLPanelMainInventory::startSearch() { // this forces focus to line editor portion of search editor @@ -481,6 +507,55 @@ void LLPanelMainInventory::resetFilters() setFilterTextFromFilter(); } +void LLPanelMainInventory::onSelectSearchType() +{ + std::string new_type = mSearchTypeCombo->getValue(); + if (new_type == "search_by_name") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_NAME); + } + if (new_type == "search_by_creator") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_CREATOR); + } + if (new_type == "search_by_description") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_DESCRIPTION); + } + if (new_type == "search_by_UUID") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_UUID); + } +} + +void LLPanelMainInventory::updateSearchTypeCombo() +{ + // Check if combo box is actually there + if (!mSearchTypeCombo) + { + return; + } + // + + LLInventoryFilter::ESearchType search_type = getActivePanel()->getSearchType(); + switch(search_type) + { + case LLInventoryFilter::SEARCHTYPE_CREATOR: + mSearchTypeCombo->setValue("search_by_creator"); + break; + case LLInventoryFilter::SEARCHTYPE_DESCRIPTION: + mSearchTypeCombo->setValue("search_by_description"); + break; + case LLInventoryFilter::SEARCHTYPE_UUID: + mSearchTypeCombo->setValue("search_by_UUID"); + break; + case LLInventoryFilter::SEARCHTYPE_NAME: + default: + mSearchTypeCombo->setValue("search_by_name"); + break; + } +} + // Sort By menu handlers void LLPanelMainInventory::setSortBy(const LLSD& userdata) { @@ -572,7 +647,10 @@ void LLPanelMainInventory::onClearSearch() { BOOL initially_active = FALSE; LLFloater *finder = getFinder(); + // Worn inventory panel + //if (mActivePanel && (getActivePanel() != mWornItemsPanel)) if (mActivePanel) + // { // FIRE-5160: Don't reset inventory filter when clearing search term //initially_active = mActivePanel->getFilter().isNotDefault(); @@ -803,6 +881,13 @@ void LLPanelMainInventory::onFilterSelected() return; } + // Worn inventory panel; We do this at init and only once for performance reasons! + //if (getActivePanel() == mWornItemsPanel) + //{ + // mActivePanel->openAllFolders(); + //} + // + updateSearchTypeCombo(); // Separate search for inventory tabs from Satomi Ahn (FIRE-913 & FIRE-6862) //setFilterSubString(mFilterSubString); if (!gSavedSettings.getBOOL("FSSplitInventorySearchOverTabs")) @@ -1036,6 +1121,11 @@ BOOL LLFloaterInventoryFinder::postBuild() mSpinSinceDays = getChild("spin_days_ago"); childSetCommitCallback("spin_days_ago", onTimeAgo, this); + mCreatorSelf = getChild("check_created_by_me"); + mCreatorOthers = getChild("check_created_by_others"); + mCreatorSelf->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorSelfFilterCommit, this)); + mCreatorOthers->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorOtherFilterCommit, this)); + childSetAction("Close", onCloseBtn, this); // FIRE-5160: Don't reset inventory filter when clearing search term @@ -1082,15 +1172,15 @@ void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) // FIRE-5160: Don't reset inventory filter when clearing search term void LLFloaterInventoryFinder::onResetBtn() { + mFilter->resetDefault(); LLInventoryPanel* panel = mPanelMainInventory->getPanel(); - panel->getFilter().resetDefault(); if (panel->getName() == "All Items") { panel->setFilterTypes(0xffffffffffffffffULL); } - LLInventoryFilter &filter = panel->getFilter(); - mPanelMainInventory->updateFilterDropdown(&filter); + mPanelMainInventory->updateFilterDropdown(mFilter); + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); updateElementsFromFilter(); } @@ -1114,6 +1204,10 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() U32 hours = mFilter->getHoursAgo(); U32 date_search_direction = mFilter->getDateSearchDirection(); + LLInventoryFilter::EFilterCreatorType filter_creator = mFilter->getFilterCreator(); + bool show_created_by_me = ((filter_creator == LLInventoryFilter::FILTERCREATOR_ALL) || (filter_creator == LLInventoryFilter::FILTERCREATOR_SELF)); + bool show_created_by_others = ((filter_creator == LLInventoryFilter::FILTERCREATOR_ALL) || (filter_creator == LLInventoryFilter::FILTERCREATOR_OTHERS)); + // update the ui elements // Make floater title translatable // setTitle(mFilter->getName()); @@ -1135,6 +1229,10 @@ void LLFloaterInventoryFinder::updateElementsFromFilter() getChild("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); getChild("check_transferable")->setValue(mFilter->getFilterTransferable()); // FIRE-19340: search inventory by transferable permission getChild("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); + + getChild("check_created_by_me")->setValue(show_created_by_me); + getChild("check_created_by_others")->setValue(show_created_by_others); + getChild("check_since_logoff")->setValue(mFilter->isSinceLogoff()); mSpinSinceHours->set((F32)(hours % 24)); mSpinSinceDays->set((F32)(hours / 24)); @@ -1232,6 +1330,7 @@ void LLFloaterInventoryFinder::draw() mPanelMainInventory->getPanel()->setShowFolderState(getCheckShowEmpty() ? LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mPanelMainInventory->getPanel()->setFilterTypes(filter); + if (getCheckSinceLogoff()) { mSpinSinceDays->set(0); @@ -1262,6 +1361,46 @@ void LLFloaterInventoryFinder::draw() LLPanel::draw(); } +void LLFloaterInventoryFinder::onCreatorSelfFilterCommit() +{ + bool show_creator_self = mCreatorSelf->getValue(); + bool show_creator_other = mCreatorOthers->getValue(); + + if(show_creator_self && show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); + } + else if(show_creator_self) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); + } + else if(!show_creator_self || !show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); + mCreatorOthers->set(TRUE); + } +} + +void LLFloaterInventoryFinder::onCreatorOtherFilterCommit() +{ + bool show_creator_self = mCreatorSelf->getValue(); + bool show_creator_other = mCreatorOthers->getValue(); + + if(show_creator_self && show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_ALL); + } + else if(show_creator_other) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS); + } + else if(!show_creator_other || !show_creator_self) + { + mFilter->setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF); + mCreatorSelf->set(TRUE); + } +} + BOOL LLFloaterInventoryFinder::getCheckShowEmpty() { return getChild("check_show_empty")->getValue(); @@ -1797,43 +1936,59 @@ BOOL LLPanelMainInventory::isFilterLinksChecked(const LLSD& userdata) // Filter Links Menu // Extended Inventory Search -void LLPanelMainInventory::onSearchTargetChecked(const LLSD& userdata) +void LLPanelMainInventory::onSearchTypeChecked(const LLSD& userdata) { - getActivePanel()->setFilterSubStringTarget(userdata.asString()); + std::string new_type = userdata.asString(); + if (new_type == "search_by_name") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_NAME); + } + if (new_type == "search_by_creator") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_CREATOR); + } + if (new_type == "search_by_description") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_DESCRIPTION); + } + if (new_type == "search_by_UUID") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_UUID); + } + if (new_type == "search_by_all") + { + getActivePanel()->setSearchType(LLInventoryFilter::SEARCHTYPE_ALL); + } resetFilters(); } -LLInventoryFilter::EFilterSubstringTarget LLPanelMainInventory::getSearchTarget() const -{ - return getActivePanel()->getFilterSubStringTarget(); -} - -BOOL LLPanelMainInventory::isSearchTargetChecked(const LLSD& userdata) +BOOL LLPanelMainInventory::isSearchTypeChecked(const LLSD& userdata) { + LLInventoryFilter::ESearchType search_type = getActivePanel()->getSearchType(); const std::string command_name = userdata.asString(); - if (command_name == "name") + if (command_name == "search_by_name") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_NAME); + return (search_type == LLInventoryFilter::SEARCHTYPE_NAME); } - if (command_name == "creator") + if (command_name == "search_by_creator") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_CREATOR); + return (search_type == LLInventoryFilter::SEARCHTYPE_CREATOR); } - if (command_name == "description") + if (command_name == "search_by_description") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_DESCRIPTION); + return (search_type == LLInventoryFilter::SEARCHTYPE_DESCRIPTION); } - if (command_name == "uuid") + if (command_name == "search_by_UUID") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_UUID); + return (search_type == LLInventoryFilter::SEARCHTYPE_UUID); } - if (command_name == "all") + if (command_name == "search_by_all") { - return (getSearchTarget() == LLInventoryFilter::SUBST_TARGET_ALL); + return (search_type == LLInventoryFilter::SEARCHTYPE_ALL); } return FALSE; } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 716aa9f0d6..c9df2840ee 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -35,6 +35,7 @@ #include "llfolderview.h" +class LLComboBox; class LLFolderViewItem; class LLInventoryPanel; class LLSaveFolderState; @@ -81,6 +82,8 @@ public: LLInventoryPanel* getPanel() { return mActivePanel; } LLInventoryPanel* getActivePanel() { return mActivePanel; } const LLInventoryPanel* getActivePanel() const { return mActivePanel; } + LLInventoryPanel* getAllItemsPanel(); + void selectAllItemsPanel(); // FIRE-19493: "Show Original" should open main inventory panel void showAllItemsPanel(); void resetFilters(); @@ -148,6 +151,8 @@ protected: void onExpandButtonClicked(); // Inventory Collapse and Expand Buttons void onFocusReceived(); + void onSelectSearchType(); + void updateSearchTypeCombo(); private: LLFloaterInventoryFinder* getFinder(); @@ -157,12 +162,14 @@ private: LLUICtrl* mCounterCtrl; LLHandle mFinderHandle; LLInventoryPanel* mActivePanel; + LLInventoryPanel* mWornItemsPanel; bool mResortActivePanel; LLSaveFolderState* mSavedFolderState; std::string mFilterText; std::string mFilterSubString; S32 mItemCount; std::string mItemCountString; + LLComboBox* mSearchTypeCombo; // Filter dropdown LLComboBox* mFilterComboBox; @@ -189,9 +196,8 @@ protected: // Filter Links Menu // Extended Inventory Search - BOOL isSearchTargetChecked(const LLSD& userdata); - void onSearchTargetChecked(const LLSD& userdata); - LLInventoryFilter::EFilterSubstringTarget getSearchTarget() const; + BOOL isSearchTypeChecked(const LLSD& userdata); + void onSearchTypeChecked(const LLSD& userdata); // Extended Inventory Search bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 8669dce9bf..9b729a2e3c 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -115,6 +115,11 @@ public: virtual const std::string& getDisplayName() const; virtual const std::string& getSearchableName() const; + virtual std::string getSearchableDescription() const {return LLStringUtil::null;} + virtual std::string getSearchableCreatorName() const {return LLStringUtil::null;} + virtual std::string getSearchableUUIDString() const {return LLStringUtil::null;} + virtual std::string getSearchableAll() const { return LLStringUtil::null; } // Zi's extended inventory search + virtual PermissionMask getPermissionMask() const { return PERM_NONE; } /*virtual*/ LLFolderType::EType getPreferredType() const { return LLFolderType::FT_NONE; } virtual const LLUUID& getUUID() const { return mUUID; } diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 60ebc9dddf..5f683bcd8c 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -746,6 +746,19 @@ LLInventoryPanel *LLSidepanelInventory::getActivePanel() return NULL; } +void LLSidepanelInventory::selectAllItemsPanel() +{ + if (!getVisible()) + { + return; + } + if (mInventoryPanel->getVisible()) + { + mPanelMainInventory->selectAllItemsPanel(); + } + +} + BOOL LLSidepanelInventory::isMainInventoryPanelActive() const { return mInventoryPanel->getVisible(); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 363c1b1ebf..13362d2b2f 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -57,6 +57,7 @@ public: /*virtual*/ void onOpen(const LLSD& key); LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. + void selectAllItemsPanel(); LLInventoryPanel* getInboxPanel() const { return mInventoryPanelInbox.get(); } LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; } diff --git a/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml b/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml index 753e0aeed0..c2ce27c058 100644 --- a/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/ansastorm/xui/en/panel_main_inventory.xml @@ -327,52 +327,52 @@ name="inventory_search_by_name" label="By Name"> + function="Inventory.SearchType.Set" + parameter="search_by_name" /> + function="Inventory.SearchType.Check" + parameter="search_by_name" /> + function="Inventory.SearchType.Set" + parameter="search_by_creator" /> + function="Inventory.SearchType.Check" + parameter="search_by_creator" /> + function="Inventory.SearchType.Set" + parameter="search_by_description" /> + function="Inventory.SearchType.Check" + parameter="search_by_description" /> + function="Inventory.SearchType.Set" + parameter="search_by_UUID" /> + function="Inventory.SearchType.Check" + parameter="search_by_UUID" /> + function="Inventory.SearchType.Set" + parameter="search_by_all" /> + function="Inventory.SearchType.Check" + parameter="search_by_all" /> - - diff --git a/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml index eb2ad51f25..271164a255 100644 --- a/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml +++ b/indra/newview/skins/default/xui/de/floater_inventory_view_finder.xml @@ -16,6 +16,8 @@