diff options
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 269 |
1 files changed, 136 insertions, 133 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 028505456b..dcd1339ad0 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1,11 +1,11 @@ -/** +/** * @file llinventorybridge.cpp * @brief Implementation of the Inventory-Folder-View-Bridge classes. * * $LicenseInfo:firstyear=2001&license=viewergpl$ - * + * * Copyright (c) 2001-2009, Linden Research, Inc. - * + * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 @@ -13,17 +13,17 @@ * ("Other License"), formally executed by you and Linden Lab. Terms of * the GPL can be found in doc/GPL-license.txt in this distribution, or * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * + * * There are special exceptions to the terms and conditions of the GPL as * it is applied to this Source Code. View the full text of the exception * in the file doc/FLOSS-exception.txt in this software distribution, or * online at * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * + * * By copying, modifying or distributing this software, you acknowledge * that you have read and understood your obligations described above, * and agree to abide by those obligations. - * + * * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * COMPLETENESS OR PERFORMANCE. @@ -83,7 +83,7 @@ #include "llvoavatar.h" #include "llwearable.h" #include "llwearablelist.h" -#include "llviewermessage.h" +#include "llviewermessage.h" #include "llviewerregion.h" #include "llvoavatarself.h" #include "lltabcontainer.h" @@ -147,8 +147,8 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Undershirt", "Inv_Underpants", "Inv_Skirt", - "inv_item_alpha.tga", - "inv_item_tattoo.tga", + "Inv_Alpha", + "Inv_Tattoo", "Inv_Animation", "Inv_Gesture", @@ -239,7 +239,7 @@ void LLInvFVBridge::renameLinkedItems(const LLUUID &item_id, const std::string& { return; } - + LLInventoryModel::item_array_t item_array = model->collectLinkedItems(item_id); for (LLInventoryModel::item_array_t::iterator iter = item_array.begin(); iter != item_array.end(); @@ -247,7 +247,7 @@ void LLInvFVBridge::renameLinkedItems(const LLUUID &item_id, const std::string& { LLViewerInventoryItem *linked_item = (*iter); if (linked_item->getUUID() == item_id) continue; - + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(linked_item); new_item->rename(new_name); new_item->updateServer(FALSE); @@ -292,7 +292,7 @@ void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batc S32 count = batch.count(); S32 i,j; for(i = 0; i < count; ++i) - { + { bridge = (LLInvFVBridge*)(batch.get(i)); if(!bridge || !bridge->isItemRemovable()) continue; item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); @@ -305,7 +305,7 @@ void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batc } } for(i = 0; i < count; ++i) - { + { bridge = (LLInvFVBridge*)(batch.get(i)); if(!bridge || !bridge->isItemRemovable()) continue; cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); @@ -508,7 +508,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const return TRUE; } -void hideContextEntries(LLMenuGL& menu, +void hideContextEntries(LLMenuGL& menu, const std::vector<std::string> &entries_to_show, const std::vector<std::string> &disabled_entries) { @@ -525,8 +525,8 @@ void hideContextEntries(LLMenuGL& menu, { hideContextEntries(*branchp->getBranch(), entries_to_show, disabled_entries); } - - + + bool found = false; std::vector<std::string>::const_iterator itor2; for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2) @@ -554,8 +554,8 @@ void hideContextEntries(LLMenuGL& menu, } // Helper for commonly-used entries -void LLInvFVBridge::getClipboardEntries(bool show_asset_id, - std::vector<std::string> &items, +void LLInvFVBridge::getClipboardEntries(bool show_asset_id, + std::vector<std::string> &items, std::vector<std::string> &disabled_items, U32 flags) { items.push_back(std::string("Rename")); @@ -567,7 +567,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (show_asset_id) { items.push_back(std::string("Copy Asset UUID")); - if ( (! ( isItemPermissive() || gAgent.isGodlike() ) ) + if ( (! ( isItemPermissive() || gAgent.isGodlike() ) ) || (flags & FIRST_SELECTED_ITEM) == 0) { disabled_items.push_back(std::string("Copy Asset UUID")); @@ -640,7 +640,7 @@ BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { return FALSE; } - + *id = obj->getUUID(); //object_ids.put(obj->getUUID()); @@ -810,7 +810,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, } new_listener = new LLLandmarkBridge(inventory, uuid, flags); break; - + case LLAssetType::AT_CALLINGCARD: if(!(inv_type == LLInventoryType::IT_CALLINGCARD)) { @@ -1110,7 +1110,7 @@ PermissionMask LLItemBridge::getPermissionMask() const { LLViewerInventoryItem* item = getItem(); PermissionMask perm_mask = 0; - if(item) + if(item) { BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); @@ -1136,9 +1136,9 @@ const std::string& LLItemBridge::getDisplayName() const void LLItemBridge::buildDisplayName(LLInventoryItem* item, std::string& name) { - if(item) + if(item) { - name.assign(item->getName()); + name.assign(item->getName()); } else { @@ -1147,9 +1147,9 @@ void LLItemBridge::buildDisplayName(LLInventoryItem* item, std::string& name) } LLFontGL::StyleFlags LLItemBridge::getLabelStyle() const -{ +{ U8 font = LLFontGL::NORMAL; - + if( gAgentWearables.isWearingItem( mUUID ) ) { // llinfos << "BOLD" << llendl; @@ -1175,7 +1175,7 @@ std::string LLItemBridge::getLabelSuffix() const static std::string BROKEN_LINK = LLTrans::getString("broken_link"); std::string suffix; LLInventoryItem* item = getItem(); - if(item) + if(item) { // it's a bit confusing to put nocopy/nomod/etc on calling cards. if(LLAssetType::AT_CALLINGCARD != item->getType() @@ -1304,9 +1304,9 @@ BOOL LLItemBridge::isItemCopyable() const { return FALSE; } - + // All items can be copied, not all can be pasted. - // The only time an item can't be copied is if it's a link + // The only time an item can't be copied is if it's a link // return (item->getPermissions().allowCopyBy(gAgent.getID())); if (item->getIsLinkType()) { @@ -1358,7 +1358,7 @@ BOOL LLItemBridge::isItemPermissive() const LLFolderBridge* LLFolderBridge::sSelf=NULL; // Can be moved to another folder -BOOL LLFolderBridge::isItemMovable() const +BOOL LLFolderBridge::isItemMovable() const { LLInventoryObject* obj = getInventoryObject(); if(obj) @@ -1377,7 +1377,7 @@ void LLFolderBridge::selectItem() BOOL LLFolderBridge::isItemRemovable() { LLInventoryModel* model = getInventoryModel(); - if(!model) + if(!model) { return FALSE; } @@ -1488,7 +1488,7 @@ BOOL LLFolderBridge::isClipboardPasteable() const LLInventoryClipboard::instance().retrieve(objects); const LLViewerInventoryCategory *current_cat = getCategory(); - // Search for the direct descendent of current Friends subfolder among all pasted items, + // Search for the direct descendent of current Friends subfolder among all pasted items, // and return false if is found. for(S32 i = objects.count() - 1; i >= 0; --i) { @@ -1510,7 +1510,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const { return FALSE; } - + const LLInventoryModel* model = getInventoryModel(); if (!model) { @@ -1533,7 +1533,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const { const LLUUID &cat_id = cat->getUUID(); // Don't allow recursive pasting - if ((cat_id == current_cat_id) || + if ((cat_id == current_cat_id) || model->isObjectDescendentOf(current_cat_id, cat_id)) { return FALSE; @@ -1559,7 +1559,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL drop) { - // This should never happen, but if an inventory item is incorrectly parented, + // This should never happen, but if an inventory item is incorrectly parented, // the UI will get confused and pass in a NULL. if(!inv_cat) return FALSE; @@ -1621,7 +1621,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, break; } } - + if( is_movable ) { if( move_is_into_trash ) @@ -1652,7 +1652,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } - + accept = is_movable && (mUUID != cat_id) // Can't move a folder into itself && (mUUID != inv_cat->getParentUUID()) // Avoid moves that would change nothing @@ -1673,7 +1673,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } // if target is an outfit or current outfit folder we use link - if (move_is_into_current_outfit || move_is_into_outfit) + if (move_is_into_current_outfit || move_is_into_outfit) { #if SUPPORT_ENSEMBLES // BAP - should skip if dup. @@ -1696,7 +1696,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { - + // Reparent the folder and restamp children if it's moving // into trash. LLInvFVBridge::changeCategoryParent( @@ -1733,7 +1733,7 @@ void warn_move_inventory(LLViewerObject* object, LLMoveInv* move_inv) // Move/copy all inventory items from the Contents folder of an in-world // object to the agent's inventory, inside a given category. -BOOL move_inv_category_world_to_agent(const LLUUID& object_id, +BOOL move_inv_category_world_to_agent(const LLUUID& object_id, const LLUUID& category_id, BOOL drop, void (*callback)(S32, void*), @@ -1760,7 +1760,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, llinfos << "Object contents not found for drop." << llendl; return FALSE; } - + BOOL accept = TRUE; BOOL is_move = FALSE; @@ -1846,7 +1846,7 @@ bool LLFindCOFValidItems::operator()(LLInventoryCategory* cat, { LLViewerInventoryCategory *linked_category = ((LLViewerInventoryItem*)item)->getLinkedCategory(); // BAP - safe? // BAP remove AT_NONE support after ensembles are fully working? - return (linked_category && + return (linked_category && ((linked_category->getPreferredType() == LLAssetType::AT_NONE) || (LLAssetType::lookupIsEnsembleCategoryType(linked_category->getPreferredType())))); } @@ -1888,7 +1888,7 @@ public: gInventory.removeObserver(this); delete this; } - + protected: LLUUID mCatID; @@ -1983,7 +1983,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryWearObserver // -// Observer for "copy and wear" operation to support knowing +// Observer for "copy and wear" operation to support knowing // when the all of the contents have been added to inventory. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLInventoryCopyAndWearObserver : public LLInventoryObserver @@ -2005,7 +2005,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) { if((mask & (LLInventoryObserver::ADD)) != 0) { - if (!mFolderAdded) + if (!mFolderAdded) { const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); @@ -2013,7 +2013,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) std::set<LLUUID>::const_iterator id_end = changed_items.end(); for (;id_it != id_end; ++id_it) { - if ((*id_it) == mCatID) + if ((*id_it) == mCatID) { mFolderAdded = TRUE; break; @@ -2021,7 +2021,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) } } - if (mFolderAdded) + if (mFolderAdded) { LLViewerInventoryCategory* category = gInventory.getCategory(mCatID); @@ -2039,7 +2039,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) LLAppearanceManager::wearInventoryCategory(category, FALSE, TRUE); delete this; } - } + } } } @@ -2101,12 +2101,12 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model if(!model) return; LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; - + remove_inventory_category_from_avatar ( cat ); return; - } + } else if ("purge" == action) - { + { purgeItem(model, mUUID); return; } @@ -2283,7 +2283,7 @@ void LLFolderBridge::pasteFromClipboard() { if(LLInventoryClipboard::instance().isCutMode()) { - // move_inventory_item() is not enough, + // move_inventory_item() is not enough, //we have to update inventory locally too changeItemParent(model, dynamic_cast<LLViewerInventoryItem*>(item), parent_id, FALSE); } @@ -2360,7 +2360,7 @@ void LLFolderBridge::folderOptionsMenu() // BAP change once we're no longer treating regular categories as ensembles. const bool is_ensemble = category && (type == LLAssetType::AT_NONE || LLAssetType::lookupIsEnsembleCategoryType(type)); - + // calling card related functionality for folders. // Only enable calling-card related options for non-default folders. @@ -2374,7 +2374,7 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("IM All Contacts In Folder")); } } - + // wearables related functionality for folders. //is_wearable LLFindWearables is_wearable; @@ -2429,7 +2429,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); mItems.clear(); //adding code to clear out member Items (which means Items should not have other data here at this point) - mDisabledItems.clear(); //adding code to clear out disabled members from previous + mDisabledItems.clear(); //adding code to clear out disabled members from previous if (lost_and_found_id == mUUID) { // This is the lost+found folder. @@ -2471,13 +2471,13 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mItems.push_back(std::string("New Clothes")); mItems.push_back(std::string("New Body Parts")); mItems.push_back(std::string("Change Type")); - + LLViewerInventoryCategory *cat = getCategory(); if (cat && LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType())) { mDisabledItems.push_back(std::string("Change Type")); } - + getClipboardEntries(false, mItems, mDisabledItems, flags); } else @@ -2492,24 +2492,24 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) //Added by spatters to force inventory pull on right-click to display folder options correctly. 07-17-06 mCallingCards = mWearables = FALSE; - + LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); if (checkFolderForContentsOfType(model, is_callingcard)) { mCallingCards=TRUE; } - + LLFindWearables is_wearable; LLIsType is_object( LLAssetType::AT_OBJECT ); LLIsType is_gesture( LLAssetType::AT_GESTURE ); - + if (checkFolderForContentsOfType(model, is_wearable) || checkFolderForContentsOfType(model, is_object) || checkFolderForContentsOfType(model, is_gesture) ) { mWearables=TRUE; } - + mMenu = &menu; sSelf = this; LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(FALSE); @@ -2723,7 +2723,7 @@ void LLFolderBridge::modifyOutfit(BOOL append) if(!model) return; LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; - + // BAP - was: // wear_inventory_category_on_avatar( cat, append ); LLAppearanceManager::wearInventoryCategory( cat, FALSE, append ); @@ -2749,8 +2749,8 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response } two_uuids_list_t::iterator move_it; - for (move_it = move_inv->mMoveList.begin(); - move_it != move_inv->mMoveList.end(); + for (move_it = move_inv->mMoveList.begin(); + move_it != move_inv->mMoveList.end(); ++move_it) { object->moveInventory(move_it->first, move_it->second); @@ -2859,7 +2859,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLUUID current_outfit_id = model->findCategoryUUIDForType(LLAssetType::AT_CURRENT_OUTFIT); BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLAssetType::AT_OUTFIT); - + if(is_movable && move_is_into_trash) { switch(inv_item->getType()) @@ -2887,7 +2887,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, is_movable = ! LLFriendCardsManager::instance() .isObjDirectDescendentOfCategory (inv_item, getCategory()); } - + LLUUID favorites_id = model->findCategoryUUIDForType(LLAssetType::AT_FAVORITE); // we can move item inside a folder only if this folder is Favorites. See EXT-719 @@ -2993,7 +2993,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) && perm.allowTransferTo(gAgent.getID()))) // || gAgent.isGodlike()) - + { accept = TRUE; } @@ -3024,7 +3024,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLNotifications::instance().forceResponse(params, 0); } } - + } else if(LLToolDragAndDrop::SOURCE_NOTECARD == source) { @@ -3077,11 +3077,11 @@ LLUIImagePtr LLTextureBridge::getIcon() const { return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE); } - + void LLTextureBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3100,7 +3100,7 @@ LLUIImagePtr LLSoundBridge::getIcon() const void LLSoundBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3169,7 +3169,7 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // +=================================================+ LLLandmarkBridge::LLLandmarkBridge(LLInventoryPanel* inventory, const LLUUID& uuid, U32 flags/* = 0x00*/) : -LLItemBridge(inventory, uuid) +LLItemBridge(inventory, uuid) { mVisited = FALSE; if (flags & LLInventoryItem::II_FLAGS_LANDMARK_VISITED) @@ -3258,7 +3258,7 @@ void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* mod LLSideTray::getInstance()->showPanel("panel_places", key); } } - else + else { LLItemBridge::performAction(folder, model, action); } @@ -3282,7 +3282,7 @@ static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportFro void LLLandmarkBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3390,7 +3390,7 @@ std::string LLCallingCardBridge::getLabelSuffix() const void LLCallingCardBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3530,7 +3530,7 @@ BOOL LLCallingCardBridge::removeItem() LLAvatarActions::removeFriendDialog(getItem()->getCreatorUUID()); return FALSE; } - else + else { return LLItemBridge::removeItem(); } @@ -3547,7 +3547,7 @@ LLUIImagePtr LLNotecardBridge::getIcon() const void LLNotecardBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3629,7 +3629,7 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode void LLGestureBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3731,7 +3731,7 @@ void LLAnimationBridge::performAction(LLFolderView* folder, LLInventoryModel* mo LLPreviewAnim::e_activation_type activate = LLPreviewAnim::NONE; if ("playworld" == action) activate = LLPreviewAnim::PLAY; if ("playlocal" == action) activate = LLPreviewAnim::AUDITION; - + LLPreviewAnim* preview = LLFloaterReg::showTypedInstance<LLPreviewAnim>("preview_anim", LLSD(mUUID)); if (preview) { @@ -3748,7 +3748,7 @@ void LLAnimationBridge::performAction(LLFolderView* folder, LLInventoryModel* mo void LLAnimationBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3856,7 +3856,7 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model void LLObjectBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3868,7 +3868,7 @@ void LLObjectBridge::openItem() } LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const -{ +{ U8 font = LLFontGL::NORMAL; LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); @@ -3882,7 +3882,7 @@ LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const { font |= LLFontGL::ITALIC; } - + return (LLFontGL::StyleFlags)font; } @@ -3893,7 +3893,10 @@ std::string LLObjectBridge::getLabelSuffix() const { std::string attachment_point_name = avatar->getAttachedPointName(mUUID); LLStringUtil::toLower(attachment_point_name); - return LLItemBridge::getLabelSuffix() + std::string(" (worn on ") + attachment_point_name + std::string(")"); + + LLStringUtil::format_map_t args; + args["[ATTACHMENT_POINT]"] = attachment_point_name.c_str(); + return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); } else { @@ -3937,7 +3940,7 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response) { LLVOAvatar *avatarp = gAgent.getAvatarObject(); - + if (!avatarp->canAttachMoreObjects()) { LLSD args; @@ -3950,7 +3953,7 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon if (option == 0/*YES*/) { LLViewerInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID()); - + if (itemp) { LLMessageSystem* msg = gMessageSystem; @@ -4011,7 +4014,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { return; } - + if( avatarp->isWearingAttachment( mUUID ) ) { items.push_back(std::string("Detach From Yourself")); @@ -4035,13 +4038,13 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLMenuGL* attach_menu = menu.findChildMenuByName("Attach To", TRUE); LLMenuGL* attach_hud_menu = menu.findChildMenuByName("Attach To HUD", TRUE); LLVOAvatar *avatarp = gAgent.getAvatarObject(); - if (attach_menu - && (attach_menu->getChildCount() == 0) - && attach_hud_menu - && (attach_hud_menu->getChildCount() == 0) + if (attach_menu + && (attach_menu->getChildCount() == 0) + && attach_hud_menu + && (attach_hud_menu->getChildCount() == 0) && avatarp) { - for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); + for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); iter != avatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; @@ -4122,7 +4125,7 @@ LLUIImagePtr LLLSLTextBridge::getIcon() const void LLLSLTextBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -4158,7 +4161,7 @@ void wear_add_inventory_item_on_avatar( LLInventoryItem* item ) { lldebugs << "wear_add_inventory_item_on_avatar( " << item->getName() << " )" << llendl; - + LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), @@ -4172,8 +4175,8 @@ void remove_inventory_category_from_avatar( LLInventoryCategory* category ) if(!category) return; lldebugs << "remove_inventory_category_from_avatar( " << category->getName() << " )" << llendl; - - + + if( gFloaterCustomize ) { gFloaterCustomize->askToSaveIfDirty( @@ -4248,8 +4251,8 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ } } } - - + + if (obj_count > 0) { for(i = 0; i < obj_count; ++i) @@ -4309,7 +4312,7 @@ std::string LLWearableBridge::getLabelSuffix() const { if( gAgentWearables.isWearingItem( mUUID ) ) { - return LLItemBridge::getLabelSuffix() + " (worn)"; + return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn"); } else { @@ -4344,7 +4347,7 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod { LLViewerInventoryItem* item = getItem(); if (item) - { + { LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), @@ -4359,7 +4362,7 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod void LLWearableBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -4443,7 +4446,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) getClipboardEntries(true, items, disabled_items, flags); items.push_back(std::string("Wearable Separator")); - + items.push_back(std::string("Wearable Wear")); items.push_back(std::string("Wearable Add")); items.push_back(std::string("Wearable Edit")); @@ -4474,7 +4477,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) disabled_items.push_back(std::string("Wearable Add")); } else - { + { disabled_items.push_back(std::string("Take Off")); } break; @@ -4513,7 +4516,7 @@ void LLWearableBridge::wearOnAvatar() { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return; @@ -4544,7 +4547,7 @@ void LLWearableBridge::wearAddOnAvatar() { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return; @@ -4632,7 +4635,7 @@ BOOL LLWearableBridge::canEditOnAvatar(void* user_data) return (gAgentWearables.isWearingItem(self->mUUID)); } -// static +// static void LLWearableBridge::onEditOnAvatar(void* user_data) { LLWearableBridge* self = (LLWearableBridge*)user_data; @@ -4670,7 +4673,7 @@ BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data) return FALSE; } -// static +// static void LLWearableBridge::onRemoveFromAvatar(void* user_data) { LLWearableBridge* self = (LLWearableBridge*)user_data; @@ -4701,7 +4704,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, if( gAgentWearables.isWearingItem( item_id ) ) { EWearableType type = wearable->getType(); - + if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES ) ) //&& //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) { @@ -4804,7 +4807,7 @@ LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_ case LLAssetType::AT_LANDMARK: action = new LLLandmarkBridgeAction(uuid,model); break; - + case LLAssetType::AT_CALLINGCARD: action = new LLCallingCardBridgeAction(uuid,model); break; @@ -4847,7 +4850,7 @@ LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_ return action; } -//static +//static void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type, const LLUUID& uuid,LLInventoryModel* model) { @@ -4859,7 +4862,7 @@ void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type, } } -//static +//static void LLInvFVBridgeAction::doAction(const LLUUID& uuid, LLInventoryModel* model) { LLAssetType::EType asset_type = model->getItem(uuid)->getType(); @@ -4878,8 +4881,8 @@ LLViewerInventoryItem* LLInvFVBridgeAction::getItem() const return NULL; } -//virtual -void LLTextureBridgeAction::doIt() +//virtual +void LLTextureBridgeAction::doIt() { if (getItem()) { @@ -4890,20 +4893,20 @@ void LLTextureBridgeAction::doIt() } //virtual -void LLSoundBridgeAction::doIt() +void LLSoundBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if(item) { LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES); } - + LLInvFVBridgeAction::doIt(); } -//virtual -void LLLandmarkBridgeAction::doIt() +//virtual +void LLLandmarkBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if( item ) @@ -4919,8 +4922,8 @@ void LLLandmarkBridgeAction::doIt() } -//virtual -void LLCallingCardBridgeAction::doIt() +//virtual +void LLCallingCardBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if(item && item->getCreatorUUID().notNull()) @@ -4931,9 +4934,9 @@ void LLCallingCardBridgeAction::doIt() LLInvFVBridgeAction::doIt(); } -//virtual -void -LLNotecardBridgeAction::doIt() +//virtual +void +LLNotecardBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if (item) @@ -4944,8 +4947,8 @@ LLNotecardBridgeAction::doIt() LLInvFVBridgeAction::doIt(); } -//virtual -void LLGestureBridgeAction::doIt() +//virtual +void LLGestureBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if (item) @@ -4957,8 +4960,8 @@ void LLGestureBridgeAction::doIt() LLInvFVBridgeAction::doIt(); } -//virtual -void LLAnimationBridgeAction::doIt() +//virtual +void LLAnimationBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if (item) @@ -4970,7 +4973,7 @@ void LLAnimationBridgeAction::doIt() } -//virtual +//virtual void LLObjectBridgeAction::doIt() { LLFloaterReg::showInstance("properties", mUUID); @@ -4979,8 +4982,8 @@ void LLObjectBridgeAction::doIt() } -//virtual -void LLLSLTextBridgeAction::doIt() +//virtual +void LLLSLTextBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if (item) @@ -5010,7 +5013,7 @@ void LLWearableBridgeAction::wearOnAvatar() { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return; @@ -5037,7 +5040,7 @@ void LLWearableBridgeAction::wearOnAvatar() } } -//virtual +//virtual void LLWearableBridgeAction::doIt() { if(isInTrash()) @@ -5125,7 +5128,7 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Restore Item")); } else - { + { items.push_back(std::string("Delete")); if (!isItemRemovable()) { @@ -5175,7 +5178,7 @@ void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Restore Item")); } else - { + { items.push_back(std::string("Goto Link")); items.push_back(std::string("Delete")); if (!isItemRemovable()) |