From 64da5083d0b99d58140d84f9a44191b5c3d321b1 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 11 May 2010 13:01:27 -0400 Subject: EXT-7306 : FIXED : Add shortcut-style icons for inventory links EXT-7295 : FIXED : INFRASTRUCTURE : Cleaned up Inventory Icon code Inventory link icons were designed from scratch. Added LLInventoryIcon class and did some major refactoring for how it determines inventory icons from item bridges. --- indra/newview/llinventorybridge.h | 68 ++------------------------------------- 1 file changed, 3 insertions(+), 65 deletions(-) (limited to 'indra/newview/llinventorybridge.h') diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index aa3b36e7e2..d1094b66d4 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -99,6 +99,7 @@ public: virtual BOOL isItemRemovable() const; virtual BOOL isItemMovable() const; virtual BOOL isItemInTrash() const; + virtual BOOL isLink() const; //virtual BOOL removeItem() = 0; virtual void removeBatch(LLDynamicArray& batch); @@ -162,6 +163,7 @@ protected: LLFolderView* mRoot; const LLUUID mUUID; // item id LLInventoryType::EType mInvType; + BOOL mIsLink; void purgeItem(LLInventoryModel *model, const LLUUID &uuid); }; @@ -184,49 +186,6 @@ public: U32 flags = 0x00) const; }; -// Used by LLItemBridge::getIcon -enum EInventoryIcon -{ - TEXTURE_ICON_NAME, - SOUND_ICON_NAME, - CALLINGCARD_ONLINE_ICON_NAME, - CALLINGCARD_OFFLINE_ICON_NAME, - LANDMARK_ICON_NAME, - LANDMARK_VISITED_ICON_NAME, - SCRIPT_ICON_NAME, - CLOTHING_ICON_NAME, - OBJECT_ICON_NAME, - OBJECT_MULTI_ICON_NAME, - NOTECARD_ICON_NAME, - BODYPART_ICON_NAME, - SNAPSHOT_ICON_NAME, - - BODYPART_SHAPE_ICON_NAME, - BODYPART_SKIN_ICON_NAME, - BODYPART_HAIR_ICON_NAME, - BODYPART_EYES_ICON_NAME, - CLOTHING_SHIRT_ICON_NAME, - CLOTHING_PANTS_ICON_NAME, - CLOTHING_SHOES_ICON_NAME, - CLOTHING_SOCKS_ICON_NAME, - CLOTHING_JACKET_ICON_NAME, - CLOTHING_GLOVES_ICON_NAME, - CLOTHING_UNDERSHIRT_ICON_NAME, - CLOTHING_UNDERPANTS_ICON_NAME, - CLOTHING_SKIRT_ICON_NAME, - CLOTHING_ALPHA_ICON_NAME, - CLOTHING_TATTOO_ICON_NAME, - - ANIMATION_ICON_NAME, - GESTURE_ICON_NAME, - - LINKITEM_ICON_NAME, - LINKFOLDER_ICON_NAME, - - ICON_NAME_COUNT -}; -extern std::string ICON_NAME[ICON_NAME_COUNT]; - class LLItemBridge : public LLInvFVBridge { public: @@ -289,7 +248,7 @@ public: virtual LLFolderType::EType getPreferredType() const; virtual LLUIImagePtr getIcon() const; virtual LLUIImagePtr getOpenIcon() const; - static LLUIImagePtr getIcon(LLFolderType::EType preferred_type); + static LLUIImagePtr getIcon(LLFolderType::EType preferred_type, BOOL is_link = FALSE); virtual BOOL renameItem(const std::string& new_name); @@ -368,20 +327,6 @@ private: menuentry_vec_t mDisabledItems; }; -// DEPRECATED -class LLScriptBridge : public LLItemBridge -{ - friend class LLInvFVBridge; -public: - LLUIImagePtr getIcon() const; - -protected: - LLScriptBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid ) : - LLItemBridge(inventory, root, uuid) {} -}; - class LLTextureBridge : public LLItemBridge { friend class LLInvFVBridge; @@ -407,7 +352,6 @@ class LLSoundBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual LLUIImagePtr getIcon() const; virtual void openItem(); virtual void previewItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); @@ -466,7 +410,6 @@ class LLNotecardBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: LLNotecardBridge(LLInventoryPanel* inventory, @@ -479,8 +422,6 @@ class LLGestureBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual LLUIImagePtr getIcon() const; - // Only suffix for gesture items, not task items, because only // gestures in your inventory can be active. virtual LLFontGL::StyleFlags getLabelStyle() const; @@ -508,7 +449,6 @@ public: virtual void performAction(LLInventoryModel* model, std::string action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: @@ -548,7 +488,6 @@ class LLLSLTextBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: LLLSLTextBridge(LLInventoryPanel* inventory, @@ -605,7 +544,6 @@ class LLLinkItemBridge : public LLItemBridge friend class LLInvFVBridge; public: virtual const std::string& getPrefix() { return sPrefix; } - virtual LLUIImagePtr getIcon() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); protected: LLLinkItemBridge(LLInventoryPanel* inventory, -- cgit v1.2.3 From adc0aba2dd206e76a41298727794ab80754d439b Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 11 May 2010 15:08:29 -0400 Subject: EXT-7305 : FIXED : Changed LLWearableDictionary to LLWearableType Refactored LLWearableDictionary to look more like LLAssetType/LLFolderType/etc. in terms of code design. This required a lot of superficial changes across many files. Overall functionality has not changed. --- indra/newview/llinventorybridge.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventorybridge.h') diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index d1094b66d4..d77062ba84 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -272,8 +272,8 @@ public: virtual BOOL isClipboardPasteableAsLink() const; virtual BOOL copyToClipboard() const; - static void createWearable(LLFolderBridge* bridge, EWearableType type); - static void createWearable(const LLUUID &parent_folder_id, EWearableType type); + static void createWearable(LLFolderBridge* bridge, LLWearableType::EType type); + static void createWearable(const LLUUID &parent_folder_id, LLWearableType::EType type); LLViewerInventoryCategory* getCategory() const; @@ -532,11 +532,11 @@ protected: const LLUUID& uuid, LLAssetType::EType asset_type, LLInventoryType::EType inv_type, - EWearableType wearable_type); + LLWearableType::EType wearable_type); protected: LLAssetType::EType mAssetType; LLInventoryType::EType mInvType; - EWearableType mWearableType; + LLWearableType::EType mWearableType; }; class LLLinkItemBridge : public LLItemBridge -- cgit v1.2.3 From f1c775b7be55731475796b6b3b63eef1b2e290ef Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 12 May 2010 11:40:38 -0400 Subject: EXT-7319 : FIXED : INFRASTRUCTURE : LLInventoryBridge cleanup Superficial header file cleanup --- indra/newview/llinventorybridge.h | 168 +++++++++++++++----------------------- 1 file changed, 64 insertions(+), 104 deletions(-) (limited to 'indra/newview/llinventorybridge.h') diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index d77062ba84..1c85dc8d7e 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -79,16 +79,15 @@ public: virtual void restoreItem() {} virtual void restoreToWorld() {} + //-------------------------------------------------------------------- // LLFolderViewEventListener functions + //-------------------------------------------------------------------- virtual const std::string& getName() const; virtual const std::string& getDisplayName() const; virtual PermissionMask getPermissionMask() const; virtual LLFolderType::EType getPreferredType() const; virtual time_t getCreationDate() const; - virtual LLFontGL::StyleFlags getLabelStyle() const - { - return LLFontGL::NORMAL; - } + virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; } virtual std::string getLabelSuffix() const { return LLStringUtil::null; } virtual void openItem() {} virtual void closeItem() {} @@ -120,11 +119,12 @@ public: void* cargo_data) { return FALSE; } virtual LLInventoryType::EType getInventoryType() const { return mInvType; } + //-------------------------------------------------------------------- // LLInvFVBridge functionality + //-------------------------------------------------------------------- virtual void clearDisplayName() {} - // Allow context menus to be customized for side panel. - bool isInOutfitsSidePanel() const; + bool isInOutfitsSidePanel() const; // allow context menus to be customized for side panel bool canShare(); @@ -147,7 +147,7 @@ protected: BOOL isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory? BOOL isAgentInventory() const; // false if lost or in the inventory library - BOOL isCOFFolder() const; // true if COF or descendent of. + BOOL isCOFFolder() const; // true if COF or descendent of virtual BOOL isItemPermissive() const; static void changeItemParent(LLInventoryModel* model, LLViewerInventoryItem* item, @@ -168,7 +168,7 @@ protected: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInvFVBridge +// Class LLInvFVBridgeBuilder // // This class intended to build Folder View Bridge via LLInvFVBridge::createBridge. // It can be overridden with another way of creation necessary Inventory-Folder-View-Bridge. @@ -214,7 +214,7 @@ public: virtual BOOL hasChildren() const { return FALSE; } virtual BOOL isUpToDate() const { return TRUE; } - // override for LLInvFVBridge + // Override for LLInvFVBridge virtual void clearDisplayName() { mDisplayName.clear(); } LLViewerInventoryItem* getItem() const; @@ -232,8 +232,14 @@ protected: class LLFolderBridge : public LLInvFVBridge { - friend class LLInvFVBridge; public: + LLFolderBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : + LLInvFVBridge(inventory, root, uuid), + mCallingCards(FALSE), + mWearables(FALSE), + mMenu(NULL) {} BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop); BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, @@ -278,18 +284,11 @@ public: LLViewerInventoryCategory* getCategory() const; protected: - LLFolderBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid) : - LLInvFVBridge(inventory, root, uuid), - mCallingCards(FALSE), - mWearables(FALSE), - mMenu(NULL) {} - - // menu callbacks + //-------------------------------------------------------------------- + // Menu callbacks + //-------------------------------------------------------------------- static void pasteClipboard(void* user_data); static void createNewCategory(void* user_data); - static void createNewShirt(void* user_data); static void createNewPants(void* user_data); static void createNewShoes(void* user_data); @@ -310,10 +309,7 @@ protected: void modifyOutfit(BOOL append); void determineFolderType(); - /** - * Returns a copy of current menu items. - */ - menuentry_vec_t getMenuItems() { return mItems; } + menuentry_vec_t getMenuItems() { return mItems; } // returns a copy of current menu items public: static LLFolderBridge* sSelf; @@ -329,63 +325,57 @@ private: class LLTextureBridge : public LLItemBridge { - friend class LLInvFVBridge; public: - virtual LLUIImagePtr getIcon() const; - virtual void openItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual void performAction(LLInventoryModel* model, std::string action); - -protected: LLTextureBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid, LLInventoryType::EType type) : LLItemBridge(inventory, root, uuid), - mInvType(type) - {} + mInvType(type) {} + virtual LLUIImagePtr getIcon() const; + virtual void openItem(); + virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + virtual void performAction(LLInventoryModel* model, std::string action); + bool canSaveTexture(void); LLInventoryType::EType mInvType; }; class LLSoundBridge : public LLItemBridge { - friend class LLInvFVBridge; public: + LLSoundBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : + LLItemBridge(inventory, root, uuid) {} virtual void openItem(); virtual void previewItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); static void openSoundPreview(void*); - -protected: - LLSoundBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid) : - LLItemBridge(inventory, root, uuid) {} }; class LLLandmarkBridge : public LLItemBridge { - friend class LLInvFVBridge; public: + LLLandmarkBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid, + U32 flags = 0x00); virtual void performAction(LLInventoryModel* model, std::string action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual LLUIImagePtr getIcon() const; virtual void openItem(); - -protected: - LLLandmarkBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid, - U32 flags = 0x00); protected: BOOL mVisited; }; class LLCallingCardBridge : public LLItemBridge { - friend class LLInvFVBridge; public: + LLCallingCardBridge(LLInventoryPanel* inventory, + LLFolderView* folder, + const LLUUID& uuid ); + ~LLCallingCardBridge(); virtual std::string getLabelSuffix() const; //virtual const std::string& getDisplayName() const; virtual LLUIImagePtr getIcon() const; @@ -396,72 +386,58 @@ public: EDragAndDropType cargo_type, void* cargo_data); void refreshFolderViewItem(); -protected: - LLCallingCardBridge(LLInventoryPanel* inventory, - LLFolderView* folder, - const LLUUID& uuid ); - ~LLCallingCardBridge(); protected: LLCallingCardObserver* mObserver; }; - class LLNotecardBridge : public LLItemBridge { - friend class LLInvFVBridge; public: - virtual void openItem(); -protected: LLNotecardBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} + virtual void openItem(); }; class LLGestureBridge : public LLItemBridge { - friend class LLInvFVBridge; public: + LLGestureBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : + LLItemBridge(inventory, root, uuid) {} // Only suffix for gesture items, not task items, because only // gestures in your inventory can be active. virtual LLFontGL::StyleFlags getLabelStyle() const; virtual std::string getLabelSuffix() const; - virtual void performAction(LLInventoryModel* model, std::string action); virtual void openItem(); virtual BOOL removeItem(); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - static void playGesture(const LLUUID& item_id); - -protected: - LLGestureBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid) - : LLItemBridge(inventory, root, uuid) {} }; class LLAnimationBridge : public LLItemBridge { - friend class LLInvFVBridge; public: - virtual void performAction(LLInventoryModel* model, std::string action); - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - - virtual void openItem(); - -protected: LLAnimationBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} + virtual void performAction(LLInventoryModel* model, std::string action); + virtual void buildContextMenu(LLMenuGL& menu, U32 flags); + virtual void openItem(); }; class LLObjectBridge : public LLItemBridge { - friend class LLInvFVBridge; public: + LLObjectBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid, + LLInventoryType::EType type, + U32 flags); virtual LLUIImagePtr getIcon() const; virtual void performAction(LLInventoryModel* model, std::string action); virtual void openItem(); @@ -469,14 +445,7 @@ public: virtual std::string getLabelSuffix() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual BOOL renameItem(const std::string& new_name); - LLInventoryObject* getObject() const; -protected: - LLObjectBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid, - LLInventoryType::EType type, - U32 flags); protected: static LLUUID sContextMenuItemID; // Only valid while the context menu is open. LLInventoryType::EType mInvType; @@ -486,20 +455,23 @@ protected: class LLLSLTextBridge : public LLItemBridge { - friend class LLInvFVBridge; public: - virtual void openItem(); -protected: LLLSLTextBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid ) : LLItemBridge(inventory, root, uuid) {} + virtual void openItem(); }; class LLWearableBridge : public LLItemBridge { - friend class LLInvFVBridge; public: + LLWearableBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid, + LLAssetType::EType asset_type, + LLInventoryType::EType inv_type, + LLWearableType::EType wearable_type); virtual LLUIImagePtr getIcon() const; virtual void performAction(LLInventoryModel* model, std::string action); virtual void openItem(); @@ -525,14 +497,6 @@ public: static void removeItemFromAvatar(LLViewerInventoryItem *item); static void removeAllClothesFromAvatar(); void removeFromAvatar(); - -protected: - LLWearableBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid, - LLAssetType::EType asset_type, - LLInventoryType::EType inv_type, - LLWearableType::EType wearable_type); protected: LLAssetType::EType mAssetType; LLInventoryType::EType mInvType; @@ -541,35 +505,31 @@ protected: class LLLinkItemBridge : public LLItemBridge { - friend class LLInvFVBridge; public: - virtual const std::string& getPrefix() { return sPrefix; } - virtual void buildContextMenu(LLMenuGL& menu, U32 flags); -protected: LLLinkItemBridge(LLInventoryPanel* inventory, LLFolderView* root, const LLUUID& uuid) : LLItemBridge(inventory, root, uuid) {} + virtual const std::string& getPrefix() { return sPrefix; } + virtual void buildContextMenu(LLMenuGL& menu, U32 flags); protected: static std::string sPrefix; }; class LLLinkFolderBridge : public LLItemBridge { - friend class LLInvFVBridge; public: + LLLinkFolderBridge(LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : + LLItemBridge(inventory, root, uuid) {} virtual const std::string& getPrefix() { return sPrefix; } virtual LLUIImagePtr getIcon() const; virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual void performAction(LLInventoryModel* model, std::string action); virtual void gotoItem(); protected: - LLLinkFolderBridge(LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid) : - LLItemBridge(inventory, root, uuid) {} const LLUUID &getFolderID() const; -protected: static std::string sPrefix; }; -- cgit v1.2.3 From dbaaebfe5b2847a258019cd82a2abe044e3d3140 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 12 May 2010 13:46:21 -0400 Subject: EXT-7319 : FIXED : INFRASTRUCTURE : LLInventoryBridge cleanup Const correctness, logic cleanup, took out subclasses redefining same variable as base class (!!!). --- indra/newview/llinventorybridge.h | 99 +++++++++++++++------------------------ 1 file changed, 38 insertions(+), 61 deletions(-) (limited to 'indra/newview/llinventorybridge.h') diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 1c85dc8d7e..c5efefac7e 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -74,13 +74,19 @@ public: U32 flags = 0x00); virtual ~LLInvFVBridge() {} - virtual const LLUUID& getUUID() const { return mUUID; } + BOOL isInOutfitsSidePanel() const; // allow context menus to be customized for side panel + BOOL canShare() const; + //-------------------------------------------------------------------- + // LLInvFVBridge functionality + //-------------------------------------------------------------------- + virtual const LLUUID& getUUID() const { return mUUID; } + virtual void clearDisplayName() {} virtual void restoreItem() {} virtual void restoreToWorld() {} //-------------------------------------------------------------------- - // LLFolderViewEventListener functions + // Inherited LLFolderViewEventListener functions //-------------------------------------------------------------------- virtual const std::string& getName() const; virtual const std::string& getDisplayName() const; @@ -99,7 +105,6 @@ public: virtual BOOL isItemMovable() const; virtual BOOL isItemInTrash() const; virtual BOOL isLink() const; - //virtual BOOL removeItem() = 0; virtual void removeBatch(LLDynamicArray& batch); virtual void move(LLFolderViewEventListener* new_parent_bridge) {} @@ -119,15 +124,6 @@ public: void* cargo_data) { return FALSE; } virtual LLInventoryType::EType getInventoryType() const { return mInvType; } - //-------------------------------------------------------------------- - // LLInvFVBridge functionality - //-------------------------------------------------------------------- - virtual void clearDisplayName() {} - - bool isInOutfitsSidePanel() const; // allow context menus to be customized for side panel - - bool canShare(); - //-------------------------------------------------------------------- // Convenience functions for adding various common menu options. //-------------------------------------------------------------------- @@ -195,7 +191,6 @@ public: LLInvFVBridge(inventory, root, uuid) {} virtual void performAction(LLInventoryModel* model, std::string action); - virtual void selectItem(); virtual void restoreItem(); virtual void restoreToWorld(); @@ -214,20 +209,17 @@ public: virtual BOOL hasChildren() const { return FALSE; } virtual BOOL isUpToDate() const { return TRUE; } - // Override for LLInvFVBridge - virtual void clearDisplayName() { mDisplayName.clear(); } + /*virtual*/ void clearDisplayName() { mDisplayName.clear(); } LLViewerInventoryItem* getItem() const; - bool isAddAction(std::string action) const; bool isRemoveAction(std::string action) const; - protected: + BOOL confirmRemoveItem(const LLSD& notification, const LLSD& response); virtual BOOL isItemPermissive() const; static void buildDisplayName(LLInventoryItem* item, std::string& name); - mutable std::string mDisplayName; - BOOL confirmRemoveItem(const LLSD& notification, const LLSD& response); + mutable std::string mDisplayName; }; class LLFolderBridge : public LLInvFVBridge @@ -240,10 +232,9 @@ public: mCallingCards(FALSE), mWearables(FALSE), mMenu(NULL) {} - BOOL dragItemIntoFolder(LLInventoryItem* inv_item, - BOOL drop); - BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, - BOOL drop); + BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop); + BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, BOOL drop); + virtual void performAction(LLInventoryModel* model, std::string action); virtual void openItem(); virtual void closeItem(); @@ -311,10 +302,15 @@ protected: menuentry_vec_t getMenuItems() { return mItems; } // returns a copy of current menu items + + //-------------------------------------------------------------------- + // Messy hacks for handling folder options + //-------------------------------------------------------------------- public: static LLFolderBridge* sSelf; static void staticFolderOptionsMenu(); void folderOptionsMenu(); + private: BOOL mCallingCards; BOOL mWearables; @@ -330,15 +326,15 @@ public: LLFolderView* root, const LLUUID& uuid, LLInventoryType::EType type) : - LLItemBridge(inventory, root, uuid), - mInvType(type) {} + LLItemBridge(inventory, root, uuid) + { + mInvType = type; + } virtual LLUIImagePtr getIcon() const; virtual void openItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual void performAction(LLInventoryModel* model, std::string action); - bool canSaveTexture(void); - LLInventoryType::EType mInvType; }; class LLSoundBridge : public LLItemBridge @@ -447,8 +443,7 @@ public: virtual BOOL renameItem(const std::string& new_name); LLInventoryObject* getObject() const; protected: - static LLUUID sContextMenuItemID; // Only valid while the context menu is open. - LLInventoryType::EType mInvType; + static LLUUID sContextMenuItemID; // Only valid while the context menu is open. U32 mAttachPt; BOOL mIsMultiObject; }; @@ -499,7 +494,6 @@ public: void removeFromAvatar(); protected: LLAssetType::EType mAssetType; - LLInventoryType::EType mInvType; LLWearableType::EType mWearableType; }; @@ -563,47 +557,33 @@ protected: LLInventoryModel* mModel; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Recent Inventory Panel related classes +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/************************************************************************/ -/* Recent Inventory Panel related classes */ -/************************************************************************/ -class LLRecentInventoryBridgeBuilder; -/** - * Overridden version of the Inventory-Folder-View-Bridge for Folders - */ +// Overridden version of the Inventory-Folder-View-Bridge for Folders class LLRecentItemsFolderBridge : public LLFolderBridge { - friend class LLRecentInventoryBridgeBuilder; - public: - /** - * Creates context menu for Folders related to Recent Inventory Panel. - * - * It uses base logic and than removes from visible items "New..." menu items. - */ - /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags); - -protected: + // Creates context menu for Folders related to Recent Inventory Panel. + // Uses base logic and than removes from visible items "New..." menu items. LLRecentItemsFolderBridge(LLInventoryType::EType type, - LLInventoryPanel* inventory, - LLFolderView* root, - const LLUUID& uuid) : + LLInventoryPanel* inventory, + LLFolderView* root, + const LLUUID& uuid) : LLFolderBridge(inventory, root, uuid) { mInvType = type; } + /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags); }; -/** - * Bridge builder to create Inventory-Folder-View-Bridge for Recent Inventory Panel - */ +// Bridge builder to create Inventory-Folder-View-Bridge for Recent Inventory Panel class LLRecentInventoryBridgeBuilder : public LLInventoryFVBridgeBuilder { - /** - * Overrides FolderBridge for Recent Inventory Panel. - * - * It use base functionality for bridges other than FolderBridge. - */ +public: + // Overrides FolderBridge for Recent Inventory Panel. + // It use base functionality for bridges other than FolderBridge. virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type, LLAssetType::EType actual_asset_type, LLInventoryType::EType inv_type, @@ -611,11 +591,8 @@ class LLRecentInventoryBridgeBuilder : public LLInventoryFVBridgeBuilder LLFolderView* root, const LLUUID& uuid, U32 flags = 0x00) const; - }; - - void wear_inventory_item_on_avatar(LLInventoryItem* item); void rez_attachment(LLViewerInventoryItem* item, -- cgit v1.2.3