diff options
author | Todd Stinson <stinson@lindenlab.com> | 2012-07-30 19:11:03 -0700 |
---|---|---|
committer | Todd Stinson <stinson@lindenlab.com> | 2012-07-30 19:11:03 -0700 |
commit | 61fe64d31e8f4d519ecc1428720e30dbbd5d8900 (patch) | |
tree | 6ee64a5a003f5a7b9bef300ed6c17e2a7b618db5 /indra/llui | |
parent | b57d8e9c06e01cc6aa2eca17fa80da0a36a52b91 (diff) | |
parent | de4b362839adbac123010b294e5c52fad90965b3 (diff) |
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-release.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfolderview.h | 1 | ||||
-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 |
5 files changed, 17 insertions, 17 deletions
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index ba37a11bbe..5ebd8f73ac 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -217,6 +217,7 @@ public: BOOL getShowSingleSelection() { return mShowSingleSelection; } F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); } bool getUseEllipses() { return mUseEllipses; } + S32 getSelectedCount() { return (S32)mSelectedItems.size(); } void update(); // needs to be called periodically (e.g. once per frame) diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp index b9b6ea7444..0f486d06c9 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,8 +406,11 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags) void LLFolderViewItem::openItem( void ) { + 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; } @@ -1552,7 +1557,7 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) requestSort(); getViewModelItem()->addChild(folder->getViewModelItem()); - + //After addChild since addChild assigns parent to bubble up to when calling dirtyFilter folder->getViewModelItem()->dirtyFilter(); 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); |