summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2017-08-04 18:44:38 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2017-08-04 18:44:38 +0300
commitea152d0d0b795e062142ef824717639468c39af4 (patch)
tree68bcc4b8bf4f06628eb9d5f2060b2c5bda1f3f76 /indra/newview
parent8c369771b560dc8e6e5a2a8bc466170e484964c5 (diff)
SL-717 Additional search options for inventory window
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llconversationmodel.h3
-rw-r--r--indra/newview/llinventorybridge.cpp80
-rw-r--r--indra/newview/llinventorybridge.h4
-rw-r--r--indra/newview/llinventoryfilter.cpp86
-rw-r--r--indra/newview/llinventoryfilter.h28
-rw-r--r--indra/newview/llinventorypanel.cpp24
-rw-r--r--indra/newview/llinventorypanel.h5
-rw-r--r--indra/newview/llpanelmaininventory.cpp140
-rw-r--r--indra/newview/llpanelmaininventory.h7
-rw-r--r--indra/newview/llpanelobjectinventory.cpp5
-rw-r--r--indra/newview/llsidepanelinventory.cpp13
-rw-r--r--indra/newview/llsidepanelinventory.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml37
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory.xml8
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml42
15 files changed, 464 insertions, 19 deletions
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index af7b50802c..3868bafae4 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -70,6 +70,9 @@ 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 const LLUUID& getUUID() const { return mUUID; }
virtual time_t getCreationDate() const { return 0; }
virtual LLPointer<LLUIImage> getIcon() const { return NULL; }
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 2751631a59..a85a471272 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -204,6 +204,58 @@ 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;
+}
+
// Folders have full perms
PermissionMask LLInvFVBridge::getPermissionMask() const
{
@@ -828,6 +880,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)
@@ -1593,6 +1651,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();
@@ -1813,13 +1876,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();
}
@@ -3087,6 +3156,11 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action)
modifyOutfit(TRUE);
return;
}
+ else if ("show_in_main_panel" == action)
+ {
+ LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE);
+ return;
+ }
else if ("cut" == action)
{
cutToClipboard();
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index e6fcb6be96..fd532c609c 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -94,6 +94,10 @@ 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;
+
virtual PermissionMask getPermissionMask() const;
virtual LLFolderType::EType getPreferredType() const;
virtual time_t getCreationDate() const;
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 1433ea36bf..9193613e9f 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"
@@ -76,10 +77,14 @@ LLInventoryFilter::LLInventoryFilter(const Params& p)
mFilterSubString(p.substring),
mCurrentGeneration(0),
mFirstRequiredGeneration(0),
- mFirstSuccessGeneration(0)
+ mFirstSuccessGeneration(0),
+ mSearchType(SEARCHTYPE_NAME),
+ mFilterCreatorType(FILTERCREATOR_ALL)
{
// copy mFilterOps into mDefaultFilterOps
markDefault();
+ mUsername = gAgentUsername;
+ LLStringUtil::toUpper(mUsername);
}
bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
@@ -93,10 +98,29 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
return true;
}
- 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);
passed = passed && checkAgainstFilterType(listener);
passed = passed && checkAgainstPermissions(listener);
passed = passed && checkAgainstFilterLinks(listener);
+ passed = passed && checkAgainstCreator(listener);
return passed;
}
@@ -245,6 +269,14 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLFolderViewModelItemInvent
}
}
+ if(filterTypes & FILTERTYPE_WORN)
+ {
+ if (!get_is_item_worn(object_id))
+ {
+ return FALSE;
+ }
+ }
+
////////////////////////////////////////////////////////////////////////////////
// FILTERTYPE_UUID
// Pass if this item is the target UUID or if it links to the target UUID
@@ -453,6 +485,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;
@@ -460,7 +510,14 @@ 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;
+ if (mSearchType == SEARCHTYPE_NAME)
+ {
+ return mFilterSubString.size() ? item->getSearchableName().find(mFilterSubString) : std::string::npos;
+ }
+ else
+ {
+ return std::string::npos;
+ }
}
bool LLInventoryFilter::isDefault() const
@@ -533,6 +590,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);
@@ -556,6 +631,11 @@ void LLInventoryFilter::setFilterEmptySystemFolders()
mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS;
}
+void LLInventoryFilter::setFilterWorn()
+{
+ mFilterOps.mFilterTypes |= FILTERTYPE_WORN;
+}
+
void LLInventoryFilter::setFilterMarketplaceActiveFolders()
{
mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_ACTIVE;
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index eee36b7e40..01754ed023 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -57,7 +57,8 @@ public:
FILTERTYPE_MARKETPLACE_INACTIVE = 0x1 << 7, // pass if folder is a marketplace inactive folder
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_NO_MARKETPLACE_ITEMS = 0x1 << 10, // pass iff folder is not under the marketplace
+ FILTERTYPE_WORN = 0x1 << 11, // pass if item is worn
};
enum EFilterDateDirection
@@ -82,6 +83,21 @@ public:
SO_FOLDERS_BY_WEIGHT = 0x1 << 3, // Force folder sort by weight, usually, amount of some elements in their descendents
};
+ enum ESearchType
+ {
+ SEARCHTYPE_NAME,
+ SEARCHTYPE_DESCRIPTION,
+ SEARCHTYPE_CREATOR,
+ SEARCHTYPE_UUID
+ };
+
+ enum EFilterCreatorType
+ {
+ FILTERCREATOR_ALL,
+ FILTERCREATOR_SELF,
+ FILTERCREATOR_OTHERS
+ };
+
struct FilterOps
{
struct DateRange : public LLInitParam::Block<DateRange>
@@ -176,12 +192,17 @@ public:
void setFilterUUID(const LLUUID &object_id);
void setFilterWearableTypes(U64 types);
void setFilterEmptySystemFolders();
+ void setFilterWorn();
void setFilterMarketplaceActiveFolders();
void setFilterMarketplaceInactiveFolders();
void setFilterMarketplaceUnassociatedFolders();
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;
@@ -277,6 +298,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;
@@ -285,6 +307,7 @@ private:
std::string mFilterSubString;
std::string mFilterSubStringOrig;
+ std::string mUsername;
const std::string mName;
S32 mCurrentGeneration;
@@ -299,6 +322,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 f9c91312ee..8f93796ec7 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -351,6 +351,11 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType
getFilter().setFilterCategoryTypes(types);
}
+void LLInventoryPanel::setFilterWorn()
+{
+ getFilter().setFilterWorn();
+}
+
U32 LLInventoryPanel::getFilterObjectTypes() const
{
return getFilter().getFilterObjectTypes();
@@ -420,6 +425,16 @@ void LLInventoryPanel::setFilterLinks(U64 filter_links)
getFilter().setFilterLinks(filter_links);
}
+void LLInventoryPanel::setSearchType(LLInventoryFilter::ESearchType type)
+{
+ getFilter().setSearchType(type);
+}
+
+LLInventoryFilter::ESearchType LLInventoryPanel::getSearchType()
+{
+ return getFilter().getSearchType();
+}
+
void LLInventoryPanel::setShowFolderState(LLInventoryFilter::EFolderShow show)
{
getFilter().setShowFolderState(show);
@@ -1344,9 +1359,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<LLSidepanelInventory>("inventory")->selectAllItemsPanel();
+ }
+ active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open);
if (active_panel)
{
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 5ee58707b0..d849647bb6 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -172,6 +172,7 @@ 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;
@@ -183,6 +184,8 @@ public:
void setDateSearchDirection(U32 direction);
BOOL getSinceLogoff();
void setFilterLinks(U64 filter_links);
+ void setSearchType(LLInventoryFilter::ESearchType type);
+ LLInventoryFilter::ESearchType getSearchType();
void setShowFolderState(LLInventoryFilter::EFolderShow show);
LLInventoryFilter::EFolderShow getShowFolderState();
@@ -218,7 +221,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 c34dd64cba..f771a027e0 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -30,6 +30,8 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llavataractions.h"
+#include "llcheckboxctrl.h"
+#include "llcombobox.h"
#include "lldndbutton.h"
#include "lleconomy.h"
#include "llfilepicker.h"
@@ -84,6 +86,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);
@@ -92,6 +97,8 @@ private:
LLPanelMainInventory* mPanelMainInventory;
LLSpinCtrl* mSpinSinceDays;
LLSpinCtrl* mSpinSinceHours;
+ LLCheckBoxCtrl* mCreatorSelf;
+ LLCheckBoxCtrl* mCreatorOthers;
LLInventoryFilter* mFilter;
};
@@ -102,6 +109,7 @@ private:
LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
: LLPanel(p),
mActivePanel(NULL),
+ mWornItemsPanel(NULL),
mSavedFolderState(NULL),
mFilterText(""),
mMenuGearDefault(NULL),
@@ -158,6 +166,25 @@ BOOL LLPanelMainInventory::postBuild()
recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2));
}
+ mWornItemsPanel = getChild<LLInventoryPanel>("Worn Items");
+ if (mWornItemsPanel)
+ {
+ 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));
+ }
+ mSearchTypeCombo = getChild<LLComboBox>("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;
@@ -262,6 +289,16 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
delete mSavedFolderState;
}
+LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel()
+{
+ return getChild<LLInventoryPanel>("All Items");
+}
+
+void LLPanelMainInventory::selectAllItemsPanel()
+{
+ mFilterTabs->selectFirstTab();
+}
+
void LLPanelMainInventory::startSearch()
{
// this forces focus to line editor portion of search editor
@@ -387,6 +424,48 @@ void LLPanelMainInventory::setSortBy(const LLSD& userdata)
}
}
+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()
+{
+ 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;
+ }
+}
+
// static
BOOL LLPanelMainInventory::filtersVisible(void* user_data)
{
@@ -400,7 +479,7 @@ void LLPanelMainInventory::onClearSearch()
{
BOOL initially_active = FALSE;
LLFloater *finder = getFinder();
- if (mActivePanel)
+ if (mActivePanel && (getActivePanel() != mWornItemsPanel))
{
initially_active = mActivePanel->getFilter().isNotDefault();
mActivePanel->setFilterSubString(LLStringUtil::null);
@@ -507,6 +586,11 @@ void LLPanelMainInventory::onFilterSelected()
return;
}
+ if (getActivePanel() == mWornItemsPanel)
+ {
+ mActivePanel->openAllFolders();
+ }
+ updateSearchTypeCombo();
setFilterSubString(mFilterSubString);
LLInventoryFilter& filter = mActivePanel->getFilter();
LLFloaterInventoryFinder *finder = getFinder();
@@ -705,6 +789,11 @@ BOOL LLFloaterInventoryFinder::postBuild()
mSpinSinceDays = getChild<LLSpinCtrl>("spin_days_ago");
childSetCommitCallback("spin_days_ago", onTimeAgo, this);
+ mCreatorSelf = getChild<LLCheckBoxCtrl>("check_created_by_me");
+ mCreatorOthers = getChild<LLCheckBoxCtrl>("check_created_by_others");
+ mCreatorSelf->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorSelfFilterCommit, this));
+ mCreatorOthers->setCommitCallback(boost::bind(&LLFloaterInventoryFinder::onCreatorOtherFilterCommit, this));
+
childSetAction("Close", onCloseBtn, this);
updateElementsFromFilter();
@@ -763,6 +852,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
setTitle(mFilter->getName());
@@ -780,6 +873,10 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
getChild<LLUICtrl>("check_texture")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE));
getChild<LLUICtrl>("check_snapshot")->setValue((S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT));
getChild<LLUICtrl>("check_show_empty")->setValue(show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS);
+
+ getChild<LLUICtrl>("check_created_by_me")->setValue(show_created_by_me);
+ getChild<LLUICtrl>("check_created_by_others")->setValue(show_created_by_others);
+
getChild<LLUICtrl>("check_since_logoff")->setValue(mFilter->isSinceLogoff());
mSpinSinceHours->set((F32)(hours % 24));
mSpinSinceDays->set((F32)(hours / 24));
@@ -877,6 +974,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);
@@ -905,6 +1003,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<LLUICtrl>("check_show_empty")->getValue();
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index 38936804ac..530f4e618c 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -34,6 +34,7 @@
#include "llfolderview.h"
+class LLComboBox;
class LLFolderViewItem;
class LLInventoryPanel;
class LLSaveFolderState;
@@ -76,6 +77,8 @@ public:
LLInventoryPanel* getPanel() { return mActivePanel; }
LLInventoryPanel* getActivePanel() { return mActivePanel; }
+ LLInventoryPanel* getAllItemsPanel();
+ void selectAllItemsPanel();
const LLInventoryPanel* getActivePanel() const { return mActivePanel; }
const std::string& getFilterText() const { return mFilterText; }
@@ -120,6 +123,8 @@ protected:
void updateItemcountText();
void onFocusReceived();
+ void onSelectSearchType();
+ void updateSearchTypeCombo();
private:
LLFloaterInventoryFinder* getFinder();
@@ -129,12 +134,14 @@ private:
LLUICtrl* mCounterCtrl;
LLHandle<LLFloater> mFinderHandle;
LLInventoryPanel* mActivePanel;
+ LLInventoryPanel* mWornItemsPanel;
bool mResortActivePanel;
LLSaveFolderState* mSavedFolderState;
std::string mFilterText;
std::string mFilterSubString;
S32 mItemCount;
std::string mItemCountString;
+ LLComboBox* mSearchTypeCombo;
//////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index dbfebf901a..b5ee68ba25 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -110,6 +110,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 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 c6a0198afd..e25cac8c17 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -696,6 +696,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 5060f7025f..3b8cdb98ab 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/default/xui/en/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml
index 519d3e043c..1b4992b4ca 100644
--- a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml
+++ b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml
@@ -2,7 +2,7 @@
<floater
legacy_header_height="18"
can_minimize="false"
- height="440"
+ height="468"
layout="topleft"
name="Inventory Finder"
help_topic="inventory_finder"
@@ -245,11 +245,36 @@
layout="topleft"
left="10"
name="horiz_separator"
- top_pad="8"
+ top_pad="10"
width="260"/>
<check_box
height="16"
- top="324"
+ label="Created by me"
+ layout="topleft"
+ left="8"
+ name="check_created_by_me"
+ top_delta="8"
+ width="130" />
+ <check_box
+ height="16"
+ label="Created by others"
+ layout="topleft"
+ left_pad="0"
+ name="check_created_by_others"
+ top_delta="0"
+ width="70" />
+ <view_border
+ bevel_style="none"
+ follows="top|left"
+ height="0"
+ layout="topleft"
+ left="10"
+ name="horiz_separator2"
+ top_pad="10"
+ width="260"/>
+ <check_box
+ height="16"
+ top="352"
label="Since Logoff"
layout="topleft"
left_delta="0"
@@ -265,7 +290,7 @@
layout="topleft"
left_delta="0"
name="- OR -"
- top="342"
+ top="370"
width="144">
- OR -
</text>
@@ -273,7 +298,7 @@
height="16"
layout="topleft"
name="date_search_direction"
- top="360"
+ top="388"
left="8"
width="270">
<radio_item
@@ -343,6 +368,6 @@
layout="topleft"
name="Close"
right="-6"
- top="406"
+ top="434"
width="76" />
</floater>
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index ec9f947338..5b45364127 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -569,6 +569,14 @@
function="Inventory.DoToSelected"
parameter="copy_uuid" />
</menu_item_call>
+ <menu_item_call
+ label="Show in Main Panel"
+ layout="topleft"
+ name="Show in Main Panel">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="show_in_main_panel" />
+ </menu_item_call>
<menu_item_separator
layout="topleft"
name="Copy Separator" />
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index 0a85477bf4..df70398599 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -41,13 +41,37 @@
text_pad_left="10"
follows="left|top|right"
height="23"
- label="Filter Inventory"
+ label="Enter search text"
layout="topleft"
left="10"
max_length_chars="300"
name="inventory search editor"
top="18"
- width="303" />
+ width="208" />
+ <combo_box
+ height="23"
+ layout="topleft"
+ left_pad="4"
+ name="search_type"
+ follows="top|right"
+ width="90">
+ <item
+ label="Name"
+ name="Name"
+ value="search_by_name"/>
+ <item
+ label="Creator"
+ name="Creator"
+ value="search_by_creator"/>
+ <item
+ label="Description"
+ name="Description"
+ value="search_by_description"/>
+ <item
+ label="UUID"
+ name="UUID"
+ value="search_by_UUID"/>
+ </combo_box>
<tab_container
follows="all"
halign="center"
@@ -92,6 +116,20 @@
name="Recent Items"
show_item_link_overlays="true"
width="290" />
+ <inventory_panel
+ name="Worn Items"
+ label="WORN"
+ show_empty_message="false"
+ follows="all"
+ layout="topleft"
+ width="290"
+ bg_opaque_color="DkGray2"
+ bg_alpha_color="DkGray2"
+ background_visible="true"
+ border="false"
+ bevel_style="none"
+ scroll.reserve_scroll_corner="false">
+ </inventory_panel>
</tab_container>
<layout_stack
animate="false"