summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorAnkur Ahlawat <anchor@lindenlab.com>2017-11-16 01:59:00 -0800
committerAnkur Ahlawat <anchor@lindenlab.com>2017-11-16 01:59:00 -0800
commit93100236ae34eaa9cd3fa314e7e770339c13eba7 (patch)
treee384d0f81f46900a95a33d0b6b92cbf285e624bf /indra/newview/llinventorybridge.cpp
parenta416dee2cc8c802bba24803c43805fd7fa0f484c (diff)
parentb6d22de58850fc9a5b34eeb5b7930e5845bfc42d (diff)
Merged lindenlab/viewer-release into default
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp126
1 files changed, 100 insertions, 26 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 1b32fc9dfe..3f18039376 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 LLViewerInventoryItem *item = model->getItem(mUUID);
+ if(item && (item->getIsFullPerm() || gAgent.isGodlikeWithoutAdminMenuFakery()))
+ {
+ 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();
@@ -3884,8 +3958,14 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
LLInventoryModel::cat_array_t* cat_array;
LLInventoryModel::item_array_t* item_array;
gInventory.getDirectDescendentsOf(mUUID, cat_array, item_array);
+ LLViewerInventoryCategory *trash = getCategory();
// Enable Empty menu item only when there is something to act upon.
- if ((0 == cat_array->size() && 0 == item_array->size()) || is_recent_panel)
+ // Also don't enable menu if folder isn't fully fetched
+ if ((0 == cat_array->size() && 0 == item_array->size())
+ || is_recent_panel
+ || !trash
+ || trash->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN
+ || trash->getDescendentCount() == LLViewerInventoryCategory::VERSION_UNKNOWN)
{
disabled_items.push_back(std::string("Empty Trash"));
}
@@ -4060,8 +4140,6 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t&
LLFolderType::EType type = category->getPreferredType();
const bool is_system_folder = LLFolderType::lookupIsProtectedType(type);
// BAP change once we're no longer treating regular categories as ensembles.
- const bool is_ensemble = (type == LLFolderType::FT_NONE ||
- LLFolderType::lookupIsEnsembleType(type));
const bool is_agent_inventory = isAgentInventory();
// Only enable calling-card related options for non-system folders.
@@ -4104,30 +4182,26 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t&
}
items.push_back(std::string("Replace Outfit"));
-
- if (is_agent_inventory)
+ }
+ if (is_agent_inventory)
+ {
+ items.push_back(std::string("Folder Wearables Separator"));
+ items.push_back(std::string("Remove From Outfit"));
+ if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID))
{
- items.push_back(std::string("Folder Wearables Separator"));
- if (is_ensemble)
- {
- items.push_back(std::string("Wear As Ensemble"));
- }
- items.push_back(std::string("Remove From Outfit"));
- if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID))
- {
disabled_items.push_back(std::string("Remove From Outfit"));
- }
- }
- if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID))
- {
- disabled_items.push_back(std::string("Replace Outfit"));
- }
- if (!LLAppearanceMgr::instance().getCanAddToCOF(mUUID))
- {
- disabled_items.push_back(std::string("Add To Outfit"));
}
- items.push_back(std::string("Outfit Separator"));
}
+ if (!LLAppearanceMgr::instance().getCanReplaceCOF(mUUID))
+ {
+ disabled_items.push_back(std::string("Replace Outfit"));
+ }
+ if (!LLAppearanceMgr::instance().getCanAddToCOF(mUUID))
+ {
+ disabled_items.push_back(std::string("Add To Outfit"));
+ }
+ items.push_back(std::string("Outfit Separator"));
+
}
}