From 83603fc939e60c602773cc87e0b6fa316359d467 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 24 Jul 2014 17:42:44 -0700 Subject: DD-128 : Fixed! Recycled allow_open into allow_wear and use an extra virtual methods on bridge items to know if items are wearable or not. --- indra/llui/llfolderviewitem.cpp | 6 +++--- indra/llui/llfolderviewitem.h | 4 ++-- indra/llui/llfolderviewmodel.h | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index cef40351e1..42116251fb 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -104,7 +104,7 @@ LLFolderViewItem::Params::Params() item_height("item_height"), item_top_pad("item_top_pad"), creation_date(), - allow_open("allow_open", true), + allow_wear("allow_wear", true), font_color("font_color"), font_highlight_color("font_highlight_color"), left_pad("left_pad", 0), @@ -137,7 +137,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mRoot(p.root), mViewModelItem(p.listener), mIsMouseOverTitle(false), - mAllowOpen(p.allow_open), + mAllowWear(p.allow_wear), mFontColor(p.font_color), mFontHighlightColor(p.font_highlight_color), mLeftPad(p.left_pad), @@ -454,7 +454,7 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags) void LLFolderViewItem::openItem( void ) { - if (mAllowOpen) + if (mAllowWear || !getViewModelItem()->isItemWearable()) { getViewModelItem()->openItem(); } diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index a9b0201236..12fba4f9b1 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -59,7 +59,7 @@ public: item_top_pad; Optional creation_date; - Optional allow_open; + Optional allow_wear; Optional font_color; Optional font_highlight_color; @@ -117,7 +117,7 @@ protected: mIsCurSelection, mDragAndDropTarget, mIsMouseOverTitle, - mAllowOpen, + mAllowWear, mSelectPending; LLUIColor mFontColor; diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index 0b968ecee9..99c7c4013c 100755 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -156,6 +156,8 @@ public: virtual void openItem( void ) = 0; virtual void closeItem( void ) = 0; virtual void selectItem(void) = 0; + + virtual BOOL isItemWearable() const { return FALSE; } virtual BOOL isItemRenameable() const = 0; virtual BOOL renameItem(const std::string& new_name) = 0; -- cgit v1.2.3