diff options
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 125 |
1 files changed, 8 insertions, 117 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index edefb5d109..25025038d2 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -829,8 +829,6 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, { const LLInventoryObject *obj = getInventoryObject(); bool single_folder_root = (mRoot == NULL); - bool is_cof = isCOFFolder(); - bool is_inbox = isInboxFolder(); if (obj) { @@ -845,8 +843,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, disabled_items.push_back(std::string("Copy")); } - bool is_agent_inventory = isAgentInventory(); - if (is_agent_inventory && !single_folder_root && !is_cof && !is_inbox) + if (isAgentInventory() && !single_folder_root && !isMarketplaceListingsFolder()) { items.push_back(std::string("New folder from selected")); items.push_back(std::string("Subfolder Separator")); @@ -859,19 +856,6 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } } - if (isFavorite()) - { - items.push_back(std::string("Remove from Favorites")); - } - else if (is_agent_inventory && !gInventory.isObjectDescendentOf(mUUID, gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH))) - { - items.push_back(std::string("Add to Favorites")); - if (gInventory.getRootFolderID() == mUUID) - { - disabled_items.push_back(std::string("Add to Favorites")); - } - } - if (obj->getIsLinkType()) { items.push_back(std::string("Find Original")); @@ -884,7 +868,6 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (!isItemMovable() || !canMenuCut()) { disabled_items.push_back(std::string("Cut")); - disabled_items.push_back(std::string("New folder from selected")); } } else @@ -894,7 +877,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, items.push_back(std::string("Find Links")); } - if (!is_inbox && !single_folder_root) + if (!isInboxFolder() && !single_folder_root) { items.push_back(std::string("Rename")); if (!isItemRenameable() || ((flags & FIRST_SELECTED_ITEM) == 0)) @@ -934,7 +917,6 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (!isItemMovable() || !canMenuCut()) { disabled_items.push_back(std::string("Cut")); - disabled_items.push_back(std::string("New folder from selected")); } if (canListOnMarketplace() && !isMarketplaceListingsFolder() && !isInboxFolder()) @@ -957,7 +939,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } // Don't allow items to be pasted directly into the COF or the inbox - if (!is_cof && !is_inbox) + if (!isCOFFolder() && !isInboxFolder()) { items.push_back(std::string("Paste")); } @@ -1351,13 +1333,6 @@ bool LLInvFVBridge::isAgentInventory() const return model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID()); } -bool LLInvFVBridge::isAgentInventoryRoot() const -{ - const LLInventoryModel* model = getInventoryModel(); - if(!model) return false; - return gInventory.getRootFolderID() == mUUID; -} - bool LLInvFVBridge::isCOFFolder() const { return LLAppearanceMgr::instance().getIsInCOF(mUUID); @@ -2305,21 +2280,7 @@ const LLUUID& LLItemBridge::getThumbnailUUID() const return LLUUID::null; } -bool LLItemBridge::isFavorite() const -{ - LLViewerInventoryItem* item = NULL; - LLInventoryModel* model = getInventoryModel(); - if (model) - { - item = model->getItem(mUUID); - } - if (item) - { - return get_is_favorite(item); - } - return false; -} - +// virtual bool LLItemBridge::isItemPermissive() const { if (LLViewerInventoryItem* item = getItem()) @@ -2464,16 +2425,6 @@ const LLUUID& LLFolderBridge::getThumbnailUUID() const return LLUUID::null; } -bool LLFolderBridge::isFavorite() const -{ - LLViewerInventoryCategory* cat = getCategory(); - if (cat) - { - return cat->getIsFavorite(); - } - return false; -} - void LLFolderBridge::update() { // we know we have children but haven't fetched them (doesn't obey filter) @@ -4469,7 +4420,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } disabled_items.push_back(std::string("New Folder")); - disabled_items.push_back(std::string("upload_options")); disabled_items.push_back(std::string("upload_def")); disabled_items.push_back(std::string("create_new")); } @@ -4495,7 +4445,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items { disabled_items.push_back(std::string("New Folder")); disabled_items.push_back(std::string("New Listing Folder")); - disabled_items.push_back(std::string("upload_options")); disabled_items.push_back(std::string("upload_def")); disabled_items.push_back(std::string("create_new")); } @@ -4597,7 +4546,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } if (!isMarketplaceListingsFolder()) { - items.push_back(std::string("upload_options")); items.push_back(std::string("upload_def")); items.push_back(std::string("create_new")); items.push_back(std::string("New Script")); @@ -4629,15 +4577,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items if (model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT) == mUUID) { items.push_back(std::string("Copy outfit list to clipboard")); - if (isFavorite()) - { - items.push_back(std::string("Remove from Favorites")); - } - else - { - items.push_back(std::string("Add to Favorites")); - } - addOpenFolderMenuOptions(flags, items); } @@ -7152,13 +7091,12 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action) item = (LLViewerInventoryItem*)gInventory.getItem(object_id); if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID())) { - static LLCachedControl<bool> replace_item(gSavedSettings, "InventoryAddAttachmentBehavior", false); - rez_attachment(item, NULL, ("attach" == action) ? replace_item() : true); // Replace if "Wear"ing. + rez_attachment(item, NULL, true); // Replace if "Wear"ing. } else if(item && item->isFinished()) { // must be in library. copy it to our inventory and put it on. - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, true)); + LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0)); copy_inventory_item( gAgent.getID(), item->getPermissions().getOwner(), @@ -8283,8 +8221,7 @@ void LLObjectBridgeAction::attachOrDetach() } else { - static LLCachedControl<bool> inventory_linking(gSavedSettings, "InventoryAddAttachmentBehavior", false); - LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, inventory_linking()); // Don't replace if adding. + LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding. } } @@ -8475,7 +8412,6 @@ void LLRecentItemsFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) buildContextMenuOptions(flags, items, disabled_items); items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end()); - items.erase(std::remove(items.begin(), items.end(), std::string("New folder from selected")), items.end()); hide_context_entries(menu, items, disabled_items); } @@ -8510,51 +8446,6 @@ LLInvFVBridge* LLRecentInventoryBridgeBuilder::createBridge( return new_listener; } -/************************************************************************/ -/* Favorites Inventory Panel related classes */ -/************************************************************************/ -void LLFavoritesFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) -{ - // todo: consider things that should be disabled - menuentry_vec_t disabled_items, items; - buildContextMenuOptions(flags, items, disabled_items); - - items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end()); - items.erase(std::remove(items.begin(), items.end(), std::string("New folder from selected")), items.end()); - - hide_context_entries(menu, items, disabled_items); -} - -LLInvFVBridge* LLFavoritesInventoryBridgeBuilder::createBridge( - LLAssetType::EType asset_type, - LLAssetType::EType actual_asset_type, - LLInventoryType::EType inv_type, - LLInventoryPanel* inventory, - LLFolderViewModelInventory* view_model, - LLFolderView* root, - const LLUUID& uuid, - U32 flags /*= 0x00*/) const -{ - LLInvFVBridge* new_listener = NULL; - if (asset_type == LLAssetType::AT_CATEGORY - && actual_asset_type != LLAssetType::AT_LINK_FOLDER) - { - new_listener = new LLFavoritesFolderBridge(inv_type, inventory, root, uuid); - } - else - { - new_listener = LLInventoryFolderViewModelBuilder::createBridge(asset_type, - actual_asset_type, - inv_type, - inventory, - view_model, - root, - uuid, - flags); - } - return new_listener; -} - LLFolderViewGroupedItemBridge::LLFolderViewGroupedItemBridge() { } @@ -8565,7 +8456,7 @@ void LLFolderViewGroupedItemBridge::groupFilterContextMenu(folder_view_item_dequ menuentry_vec_t disabled_items; if (get_selection_item_uuids(selected_items, ids)) { - if (!LLAppearanceMgr::instance().canAddWearables(ids, false) && canWearSelected(ids)) + if (!LLAppearanceMgr::instance().canAddWearables(ids) && canWearSelected(ids)) { disabled_items.push_back(std::string("Wearable And Object Wear")); disabled_items.push_back(std::string("Wearable Add")); |