Merge branch 'master' into AISv3-WIP

Conflicts:
	indra/newview/llinventorybridge.cpp
This commit is contained in:
Shyotl
2015-06-27 01:30:28 -05:00
108 changed files with 1129 additions and 675 deletions

View File

@@ -61,6 +61,7 @@
#include "llmarketplacefunctions.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "llpanelmaininventory.h"
#include "llpreviewanim.h"
#include "llpreviewgesture.h"
#include "llpreviewlandmark.h"
@@ -122,6 +123,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_
bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*);
bool confirm_attachment_rez(const LLSD& notification, const LLSD& response);
static BOOL can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit);
void build_context_menu_folder_options(LLInventoryModel* mModel, const LLUUID& mUUID, menuentry_vec_t& mItems, menuentry_vec_t& mDisabledItems);
// Helper functions
@@ -3357,7 +3359,7 @@ void LLFolderBridge::staticFolderOptionsMenu()
}
}
BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type)
BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type, const LLUUID& mUUID)
{
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
@@ -3369,6 +3371,10 @@ BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInv
true);
return ((item_array.size() > 0) ? TRUE : FALSE );
}
BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type)
{
return ::checkFolderForContentsOfType(model, is_type, mUUID);
}
void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items, menuentry_vec_t& disabled_items)
{
@@ -3411,7 +3417,8 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
LLViewerInventoryCategory *cat = getCategory();
// BAP removed protected check to re-enable standard ops in untyped folders.
// Not sure what the right thing is to do here.
if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT))
const bool is_cof(isCOFFolder());
if (!is_cof && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT))
{
LLInventoryPanel* panel = mInventoryPanel.get();
if(panel && !panel->getFilterWorn())
@@ -3442,6 +3449,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
}
}
}
if (!is_cof) getClipboardEntries(false, items, disabled_items, flags);
//Added by aura to force inventory pull on right-click to display folder options correctly. 07-17-06
mCallingCards = mWearables = FALSE;
@@ -3515,6 +3523,27 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t&
{
// Build folder specific options back up
LLInventoryModel* model = getInventoryModel();
if (isOutboxFolder()) return;
if (!isAgentInventory()) return;
build_context_menu_folder_options(model, mUUID, items, disabled_items);
if (!isItemRemovable())
{
disabled_items.push_back(std::string("Delete"));
}
#ifdef DELETE_SYSTEM_FOLDERS
if (LLFolderType::lookupIsProtectedType(type))
{
mItems.push_back(std::string("Delete System Folder"));
}
#endif
}
void build_context_menu_folder_options(LLInventoryModel* model, const LLUUID& mUUID, menuentry_vec_t& items, menuentry_vec_t& disabled_items)
{
if(!model) return;
const LLInventoryCategory* category = model->getCategory(mUUID);
@@ -3522,9 +3551,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t&
const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
if (trash_id == mUUID) return;
if (isItemInTrash()) return;
if (!isAgentInventory()) return;
if (isOutboxFolder()) return;
if (model->isObjectDescendentOf(mUUID, trash_id)) return;
items.push_back(std::string("Open Folder In New Window"));
@@ -3539,7 +3566,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t&
if (!is_system_folder)
{
LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD);
if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard))
if (/*mCallingCards ||*/ checkFolderForContentsOfType(model, is_callingcard, mUUID))
{
items.push_back(std::string("Calling Card Separator"));
items.push_back(std::string("Conference Chat Folder"));
@@ -3547,41 +3574,30 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t&
}
}
if (!isItemRemovable())
{
disabled_items.push_back(std::string("Delete"));
}
#ifdef DELETE_SYSTEM_FOLDERS
if (LLFolderType::lookupIsProtectedType(type))
{
items.push_back(std::string("Delete System Folder"));
}
#endif
// wearables related functionality for folders.
//is_wearable
LLFindWearables is_wearable;
LLIsType is_object( LLAssetType::AT_OBJECT );
LLIsType is_gesture( LLAssetType::AT_GESTURE );
if (mWearables ||
checkFolderForContentsOfType(model, is_wearable) ||
checkFolderForContentsOfType(model, is_object) ||
checkFolderForContentsOfType(model, is_gesture) )
if (/*mWearables ||*/
checkFolderForContentsOfType(model, is_wearable, mUUID) ||
checkFolderForContentsOfType(model, is_object, mUUID) ||
checkFolderForContentsOfType(model, is_gesture, mUUID) )
{
items.push_back(std::string("Folder Wearables Separator"));
// Only enable add/replace outfit for non-system folders.
if (!is_system_folder)
{
if (InventoryLinksEnabled() &&
if (InventoryLinksEnabled() /*&&
// Adding an outfit onto another (versus replacing) doesn't make sense.
!is_outfit)
// <singu/> Actually, it does make a bit of sense, in some cases.
!is_outfit*/)
{
items.push_back(std::string("Add To Outfit"));
}
else if(!InventoryLinksEnabled())
else //if(!InventoryLinksEnabled())
items.push_back(std::string("Wearable And Object Wear"));
items.push_back(std::string("Replace Outfit"));
@@ -6297,7 +6313,9 @@ void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
}
else
{
items.push_back(std::string("Find Original"));
getClipboardEntries(false, items, disabled_items, flags);
if (LLInventoryView::getActiveInventory() && !isOutboxFolder() && isAgentInventory())
build_context_menu_folder_options(getInventoryModel(), getFolderID(), items, disabled_items);
addDeleteContextMenuOptions(items, disabled_items);
}
hide_context_entries(menu, items, disabled_items);
@@ -6309,6 +6327,35 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti
gotoItem();
return;
}
if ("purge" == action)
{
purgeItem(model, mUUID);
return;
}
if ("restore" == action)
{
restoreItem();
return;
}
if ("cut" == action)
{
cutToClipboard();
LLFolderView::removeCutItems();
return;
}
if ("copy" == action)
{
copyToClipboard();
return;
}
if (LLInventoryView* iv = LLInventoryView::getActiveInventory())
{
if (LLFolderViewItem* folder_item = iv->getActivePanel()->getRootFolder()->getItemByID(getFolderID()))
{
folder_item->getListener()->performAction(model, action);
return;
}
}
LLItemBridge::performAction(model,action);
}
void LLLinkFolderBridge::gotoItem()