diff options
author | maxim_productengine <mnikolenko@productengine.com> | 2018-09-24 16:36:01 +0300 |
---|---|---|
committer | maxim_productengine <mnikolenko@productengine.com> | 2018-09-24 16:36:01 +0300 |
commit | 92dc9ceb834dd31aa6fe1c67b9ea896a62cd7c7c (patch) | |
tree | 65779ba0573552b479c45e08df3c504ad8fea79e | |
parent | d0b214fec699cac8b0851e69a87bedb36c895a85 (diff) |
SL-9676 EEP Pick:SELECT SETTINGS limit folder operations options
-rw-r--r-- | indra/llui/llfolderview.cpp | 25 | ||||
-rw-r--r-- | indra/llui/llfolderview.h | 8 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 3 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_settings_picker.xml | 1 |
5 files changed, 34 insertions, 5 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 895753aeae..9d0f4b6db1 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -149,6 +149,7 @@ LLFolderView::Params::Params() use_label_suffix("use_label_suffix"), allow_multiselect("allow_multiselect", true), show_empty_message("show_empty_message", true), + suppress_folder_menu("suppress_folder_menu", false), use_ellipses("use_ellipses", false), options_menu("options_menu", "") { @@ -167,6 +168,7 @@ LLFolderView::LLFolderView(const Params& p) mRenameItem( NULL ), mNeedsScroll( FALSE ), mUseLabelSuffix(p.use_label_suffix), + mSuppressFolderMenu(p.suppress_folder_menu), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), mAutoSelectOverride(FALSE), @@ -1432,10 +1434,13 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL; S32 count = mSelectedItems.size(); + LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); - if ( handled + bool hide_folder_menu = mSuppressFolderMenu && isFolderSelected(); + if ((handled && ( count > 0 && (hasVisibleChildren()) ) // show menu only if selected items are visible - && menu ) + && menu ) && + !hide_folder_menu) { if (mCallbackRegistrar) { @@ -1449,7 +1454,7 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask ) if (mCallbackRegistrar) { mCallbackRegistrar->popScope(); - } + } } else { @@ -1862,6 +1867,20 @@ void LLFolderView::updateMenu() } } +bool LLFolderView::isFolderSelected() +{ + selected_items_t::iterator item_iter; + for (item_iter = mSelectedItems.begin(); item_iter != mSelectedItems.end(); ++item_iter) + { + LLFolderViewFolder* folder = dynamic_cast<LLFolderViewFolder*>(*item_iter); + if (folder != NULL) + { + return true; + } + } + return false; +} + bool LLFolderView::selectFirstItem() { for (folders_t::iterator iter = mFolders.begin(); diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 2926e160d0..69824992c1 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -92,7 +92,8 @@ public: allow_multiselect, show_empty_message, use_ellipses, - show_item_link_overlays; + show_item_link_overlays, + suppress_folder_menu; Mandatory<LLFolderViewModelInterface*> view_model; Optional<LLFolderViewGroupedItemModel*> grouped_item_model; Mandatory<std::string> options_menu; @@ -259,6 +260,8 @@ protected: void closeRenamer( void ); + bool isFolderSelected(); + bool selectFirstItem(); bool selectLastItem(); @@ -282,7 +285,8 @@ protected: mDragAndDropThisFrame, mShowItemLinkOverlays, mShowSelectionContext, - mShowSingleSelection; + mShowSingleSelection, + mSuppressFolderMenu; // Renaming variables and methods LLFolderViewItem* mRenameItem; // The item currently being renamed diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d84ce16792..36fb98efe1 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -144,6 +144,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mAllowMultiSelect(p.allow_multi_select), mShowItemLinkOverlays(p.show_item_link_overlays), mShowEmptyMessage(p.show_empty_message), + mSuppressFolderMenu(p.suppress_folder_menu), mViewsInitialized(false), mInvFVBridgeBuilder(NULL), mInventoryViewModel(p.name), @@ -191,6 +192,7 @@ LLFolderView * LLInventoryPanel::createFolderRoot(LLUUID root_id ) p.use_label_suffix = mParams.use_label_suffix; p.allow_multiselect = mAllowMultiSelect; p.show_empty_message = mShowEmptyMessage; + p.suppress_folder_menu = mSuppressFolderMenu; p.show_item_link_overlays = mShowItemLinkOverlays; p.root = NULL; p.allow_drop = mParams.allow_drop_on_root; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index e2da06b8d8..90fd659522 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -97,6 +97,7 @@ public: Optional<StartFolder> start_folder; Optional<bool> use_label_suffix; Optional<bool> show_empty_message; + Optional<bool> suppress_folder_menu; Optional<bool> show_root_folder; Optional<bool> allow_drop_on_root; Optional<bool> use_marketplace_folders; @@ -111,6 +112,7 @@ public: inventory("", &gInventory), allow_multi_select("allow_multi_select", true), show_item_link_overlays("show_item_link_overlays", false), + suppress_folder_menu("suppress_folder_menu", false), filter("filter"), start_folder("start_folder"), use_label_suffix("use_label_suffix", true), @@ -261,6 +263,7 @@ protected: bool mAllowMultiSelect; bool mShowItemLinkOverlays; // Shows link graphic over inventory item icons bool mShowEmptyMessage; + bool mSuppressFolderMenu; LLHandle<LLFolderView> mFolderRoot; LLScrollContainer* mScroller; diff --git a/indra/newview/skins/default/xui/en/floater_settings_picker.xml b/indra/newview/skins/default/xui/en/floater_settings_picker.xml index 2df52ec6d5..2258a1dc24 100644 --- a/indra/newview/skins/default/xui/en/floater_settings_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_settings_picker.xml @@ -51,6 +51,7 @@ right="-2" /> <inventory_panel allow_multi_select="false" + suppress_folder_menu="true" bg_visible="true" bg_alpha_color="DkGray2" border="false" |