diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfolderviewitem.cpp | 13 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.h | 10 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 5 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.h | 5 |
4 files changed, 16 insertions, 17 deletions
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index b9b6ea7444..1d8dfbbafa 100644 --- a/indra/llui/llfolderviewitem.cpp +++ b/indra/llui/llfolderviewitem.cpp @@ -89,7 +89,8 @@ LLFolderViewItem::Params::Params() selection_image("selection_image"), item_height("item_height"), item_top_pad("item_top_pad"), - creation_date() + creation_date(), + allow_open("allow_open", true) {} // Default constructor @@ -112,7 +113,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mLabel(p.name), mRoot(p.root), mViewModelItem(p.listener), - mIsMouseOverTitle(false) + mIsMouseOverTitle(false), + mAllowOpen(p.allow_open) { if (mViewModelItem) { @@ -404,7 +406,10 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags) void LLFolderViewItem::openItem( void ) { - getViewModelItem()->openItem(); + if (mAllowOpen) + { + getViewModelItem()->openItem(); + } } void LLFolderViewItem::rename(const std::string& new_name) @@ -517,7 +522,7 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) BOOL LLFolderViewItem::handleDoubleClick( S32 x, S32 y, MASK mask ) { - getViewModelItem()->openItem(); + openItem(); return TRUE; } diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index 50d3e0580e..df007dd15d 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -61,6 +61,7 @@ public: item_top_pad; Optional<time_t> creation_date; + Optional<bool> allow_open; Params(); }; @@ -92,14 +93,11 @@ protected: bool mLabelWidthDirty; LLFolderViewFolder* mParentFolder; LLFolderViewModelItem* mViewModelItem; - BOOL mIsCurSelection; - BOOL mSelectPending; LLFontGL::StyleFlags mLabelStyle; std::string mLabelSuffix; LLUIImagePtr mIcon; LLUIImagePtr mIconOpen; LLUIImagePtr mIconOverlay; - BOOL mHasVisibleChildren; S32 mIndentation; S32 mItemHeight; S32 mDragStartX, @@ -109,8 +107,12 @@ protected: //std::string::size_type mStringMatchOffset; F32 mControlLabelRotation; LLFolderView* mRoot; - BOOL mDragAndDropTarget; + bool mHasVisibleChildren; + bool mIsCurSelection; + bool mDragAndDropTarget; bool mIsMouseOverTitle; + bool mAllowOpen; + bool mSelectPending; // this is an internal method used for adding items to folders. A // no-op at this level, but reimplemented in derived classes. diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index f64f33bc5e..91a6b3259c 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -304,9 +304,4 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st //LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &get_empty_param_block<T>); } -//static -const std::string* LLUICtrlFactory::getWidgetName(const std::type_info* widget_type) -{ - return LLWidgetNameRegistry::instance().getValue(widget_type); -} diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index b441cb0c9d..9f18be2371 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -105,7 +105,7 @@ private: ParamDefaults() { // look up template file for this param block... - const std::string* param_block_tag = getWidgetName(&typeid(PARAM_BLOCK)); + const std::string* param_block_tag = LLWidgetNameRegistry::instance().getValue(&typeid(PARAM_BLOCK)); if (param_block_tag) { // ...and if it exists, back fill values using the most specific template first PARAM_BLOCK params; @@ -139,7 +139,6 @@ public: template<typename T> static const typename T::Params& getDefaultParams() { - //#pragma message("Generating ParamDefaults") return ParamDefaults<typename T::Params, 0>::instance().get(); } @@ -303,8 +302,6 @@ private: } - static const std::string* getWidgetName(const std::type_info* widget_type); - // this exists to get around dependency on llview static void setCtrlParent(LLView* view, LLView* parent, S32 tab_group); |