diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-02-22 20:29:01 +0200 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-02-22 20:29:01 +0200 |
commit | 7904649923eddb1291c336ac59b51b78e90c9137 (patch) | |
tree | 301757621ca211634036206ddfeae4e18cb8c427 /indra/newview/llpanelmaininventory.cpp | |
parent | 4eee501517e756b6bbb942585290b806fc46d278 (diff) |
SL-19105 Update menu items; show items count on selection in single-folder mode
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5b7678987e..2b32bd649e 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -243,6 +243,7 @@ BOOL LLPanelMainInventory::postBuild() mSingleFolderPanelInventory = getChild<LLInventorySingleFolderPanel>("single_folder_inv"); mFolderRootChangedConnection = mSingleFolderPanelInventory->setRootChangedCallback(boost::bind(&LLPanelMainInventory::updateTitle, this)); + mSingleFolderPanelInventory->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mSingleFolderPanelInventory, _1, _2)); initListCommandsHandlers(); @@ -1652,13 +1653,16 @@ bool LLPanelMainInventory::isActionVisible(const LLSD& userdata) { return !mSingleFolderMode; } - if (param_str == "open_folder") + if (param_str == "open_folder" || param_str == "open_new_folder") { + if (!mSingleFolderMode && (param_str == "open_folder")) return false; + LLFolderView* root = getActivePanel()->getRootFolder(); std::set<LLFolderViewItem*> selection_set = root->getSelectionList(); - if (selection_set.size() != 1) return FALSE; + if (selection_set.size() != 1) return false; + LLFolderViewItem* current_item = *selection_set.begin(); - if (!current_item) return FALSE; + if (!current_item) return false; const LLUUID& folder_id = static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->getUUID(); return (gInventory.getCategory(folder_id) != NULL); } |