Conflicts:
	indra/newview/llviewerregion.cpp
This commit is contained in:
Shyotl
2015-06-26 20:38:43 -05:00
108 changed files with 1129 additions and 676 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"
@@ -120,6 +121,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
@@ -3279,7 +3281,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;
@@ -3291,6 +3293,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::buildContextMenuBaseOptions(U32 flags)
{
@@ -3338,7 +3344,8 @@ void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)
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())
@@ -3361,7 +3368,6 @@ void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)
mDisabledItems.push_back(std::string("Change Type"));
}
#endif
getClipboardEntries(false, mItems, mDisabledItems, flags);
}
else
{
@@ -3379,6 +3385,7 @@ void LLFolderBridge::buildContextMenuBaseOptions(U32 flags)
}
}
}
if (!is_cof) getClipboardEntries(false, mItems, mDisabledItems, flags);
//Added by aura to force inventory pull on right-click to display folder options correctly. 07-17-06
mCallingCards = mWearables = FALSE;
@@ -3429,6 +3436,27 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags)
{
// Build folder specific options back up
LLInventoryModel* model = getInventoryModel();
if (isOutboxFolder()) return;
if (!isAgentInventory()) return;
build_context_menu_folder_options(model, mUUID, mItems, mDisabledItems);
if (!isItemRemovable())
{
mDisabledItems.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& mItems, menuentry_vec_t& mDisabledItems)
{
if(!model) return;
const LLInventoryCategory* category = model->getCategory(mUUID);
@@ -3436,9 +3464,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags)
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;
mItems.push_back(std::string("Open Folder In New Window"));
@@ -3453,7 +3479,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags)
if (!is_system_folder)
{
LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD);
if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard))
if (/*mCallingCards ||*/ checkFolderForContentsOfType(model, is_callingcard, mUUID))
{
mItems.push_back(std::string("Calling Card Separator"));
mItems.push_back(std::string("Conference Chat Folder"));
@@ -3461,41 +3487,30 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags)
}
}
if (!isItemRemovable())
{
mDisabledItems.push_back(std::string("Delete"));
}
#ifdef DELETE_SYSTEM_FOLDERS
if (LLFolderType::lookupIsProtectedType(type))
{
mItems.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) )
{
mItems.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.
type != LLFolderType::FT_OUTFIT)
// <singu/> Actually, it does make a bit of sense, in some cases.
type != LLFolderType::FT_OUTFIT*/)
{
mItems.push_back(std::string("Add To Outfit"));
}
else if(!InventoryLinksEnabled())
else //if(!InventoryLinksEnabled())
mItems.push_back(std::string("Wearable And Object Wear"));
mItems.push_back(std::string("Replace Outfit"));
@@ -6314,7 +6329,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);
@@ -6326,6 +6343,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()