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 | |
parent | 4eee501517e756b6bbb942585290b806fc46d278 (diff) |
SL-19105 Update menu items; show items count on selection in single-folder mode
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 38 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory.xml | 326 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml | 2 |
4 files changed, 76 insertions, 300 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 986ab88cda..db88ca0b9b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -4141,12 +4141,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } disabled_items.push_back(std::string("New Folder")); - disabled_items.push_back(std::string("New Script")); - disabled_items.push_back(std::string("New Note")); - disabled_items.push_back(std::string("New Settings")); - disabled_items.push_back(std::string("New Gesture")); - disabled_items.push_back(std::string("New Clothes")); - disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); } if (favorites == mUUID) @@ -4169,11 +4163,6 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) { disabled_items.push_back(std::string("New Folder")); - disabled_items.push_back(std::string("New Script")); - disabled_items.push_back(std::string("New Note")); - disabled_items.push_back(std::string("New Gesture")); - disabled_items.push_back(std::string("New Clothes")); - disabled_items.push_back(std::string("New Body Parts")); disabled_items.push_back(std::string("upload_def")); } if (marketplace_listings_id == mUUID) @@ -4233,19 +4222,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items } if (!isMarketplaceListingsFolder()) { - items.push_back(std::string("New Script")); - items.push_back(std::string("New Note")); - items.push_back(std::string("New Gesture")); - items.push_back(std::string("New Clothes")); - items.push_back(std::string("New Body Parts")); - items.push_back(std::string("New Settings")); items.push_back(std::string("upload_def")); - - if (!LLEnvironment::instance().isInventoryEnabled()) - { - disabled_items.push_back("New Settings"); - } - } } getClipboardEntries(false, items, disabled_items, flags); @@ -4411,17 +4388,14 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags, menuentry_vec_t& disabled_items.push_back(std::string("New folder from selected")); } - items.push_back(std::string("open_in_new_window")); - if ((flags & FIRST_SELECTED_ITEM) == 0) - { - disabled_items.push_back(std::string("open_in_new_window")); - } - if(isPanelActive("single_folder_inv")) + + if ((flags & ITEM_IN_MULTI_SELECTION) == 0) { - items.push_back(std::string("open_in_current_window")); - if ((flags & FIRST_SELECTED_ITEM) == 0) + items.push_back(std::string("open_in_new_window")); + items.push_back(std::string("Open Folder Separator")); + if(isPanelActive("single_folder_inv")) { - disabled_items.push_back(std::string("open_in_current_window")); + items.push_back(std::string("open_in_current_window")); } } 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); } diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index 97a93245ff..8374e63219 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -159,262 +159,6 @@ function="Inventory.DoCreate" parameter="outfit" /> </menu_item_call> - <menu_item_call - label="New Script" - layout="topleft" - name="New Script"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="lsl" /> - </menu_item_call> - <menu_item_call - label="New Notecard" - layout="topleft" - name="New Note"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="notecard" /> - </menu_item_call> - <menu_item_call - label="New Gesture" - layout="topleft" - name="New Gesture"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="gesture" /> - </menu_item_call> - <menu - label="New Clothes" - layout="topleft" - name="New Clothes"> - <menu_item_call - label="New Shirt" - layout="topleft" - name="New Shirt"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="shirt" /> - </menu_item_call> - <menu_item_call - label="New Pants" - layout="topleft" - name="New Pants"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="pants" /> - </menu_item_call> - <menu_item_call - label="New Shoes" - layout="topleft" - name="New Shoes"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="shoes" /> - </menu_item_call> - <menu_item_call - label="New Socks" - layout="topleft" - name="New Socks"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="socks" /> - </menu_item_call> - <menu_item_call - label="New Jacket" - layout="topleft" - name="New Jacket"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="jacket" /> - </menu_item_call> - <menu_item_call - label="New Skirt" - layout="topleft" - name="New Skirt"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="skirt" /> - </menu_item_call> - <menu_item_call - label="New Gloves" - layout="topleft" - name="New Gloves"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="gloves" /> - </menu_item_call> - <menu_item_call - label="New Undershirt" - layout="topleft" - name="New Undershirt"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="undershirt" /> - </menu_item_call> - <menu_item_call - label="New Underpants" - layout="topleft" - name="New Underpants"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="underpants" /> - </menu_item_call> - <menu_item_call - label="New Alpha Mask" - layout="topleft" - name="New Alpha Mask"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="alpha" /> - </menu_item_call> - <menu_item_call - label="New Tattoo" - layout="topleft" - name="New Tattoo"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="tattoo" /> - </menu_item_call> - <menu_item_call - label="New Universal" - layout="topleft" - name="New Universal"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="universal" /> - </menu_item_call> - <menu_item_call - label="New Physics" - layout="topleft" - name="New Physics"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="physics" /> - </menu_item_call> - </menu> - <menu - label="New Body Parts" - layout="topleft" - name="New Body Parts"> - <menu_item_call - label="New Shape" - layout="topleft" - name="New Shape"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="shape" /> - </menu_item_call> - <menu_item_call - label="New Skin" - layout="topleft" - name="New Skin"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="skin" /> - </menu_item_call> - <menu_item_call - label="New Hair" - layout="topleft" - name="New Hair"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="hair" /> - </menu_item_call> - <menu_item_call - label="New Eyes" - layout="topleft" - name="New Eyes"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="eyes" /> - </menu_item_call> - </menu> - <menu - label="New Settings" - layout="topleft" - name="New Settings"> - <menu_item_call - label="New Sky" - layout="topleft" - name="New Sky"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="sky"/> - <menu_item_call.on_enable - function="Inventory.EnvironmentEnabled" /> - </menu_item_call> - <menu_item_call - label="New Water" - layout="topleft" - name="New Water"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="water"/> - <menu_item_call.on_enable - function="Inventory.EnvironmentEnabled" /> - </menu_item_call> - <menu_item_call - label="New Day Cycle" - layout="topleft" - name="New Day Cycle"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="daycycle"/> - <menu_item_call.on_enable - function="Inventory.EnvironmentEnabled" /> - </menu_item_call> - </menu> - <menu - label="Use as default for" - layout="topleft" - name="upload_def"> - <menu_item_call - label="Image uploads" - layout="topleft" - name="Image uploads"> - <menu_item_call.on_click - function="Inventory.FileUploadLocation" - parameter="texture" /> - </menu_item_call> - <menu_item_call - label="Sound uploads" - layout="topleft" - name="Sound uploads"> - <menu_item_call.on_click - function="Inventory.FileUploadLocation" - parameter="sound" /> - </menu_item_call> - <menu_item_call - label="Animation uploads" - layout="topleft" - name="Animation uploads"> - <menu_item_call.on_click - function="Inventory.FileUploadLocation" - parameter="animation" /> - </menu_item_call> - <menu_item_call - label="Model uploads" - layout="topleft" - name="Model uploads"> - <menu_item_call.on_click - function="Inventory.FileUploadLocation" - parameter="model" /> - </menu_item_call> - </menu> - <menu_item_call - label="Open" - layout="topleft" - name="open_in_current_window"> - <menu_item_call.on_click - function="Inventory.OpenSelectedFolder"/> - </menu_item_call> - <menu_item_call - label="Open in new window" - layout="topleft" - name="open_in_new_window"> - <menu_item_call.on_click - function="Inventory.OpenNewFolderWindow"/> - </menu_item_call> <menu label="Change Type" layout="topleft" @@ -611,14 +355,6 @@ parameter="properties" /> </menu_item_call> <menu_item_call - label="Rename" - layout="topleft" - name="Rename"> - <menu_item_call.on_click - function="Inventory.DoToSelected" - parameter="rename" /> - </menu_item_call> - <menu_item_call label="Image..." layout="topleft" name="thumbnail"> @@ -646,6 +382,31 @@ layout="topleft" name="Copy Separator" /> <menu_item_call + label="Open" + layout="topleft" + name="open_in_current_window"> + <menu_item_call.on_click + function="Inventory.OpenSelectedFolder"/> + </menu_item_call> + <menu_item_call + label="Open in new window" + layout="topleft" + name="open_in_new_window"> + <menu_item_call.on_click + function="Inventory.OpenNewFolderWindow"/> + </menu_item_call> + <menu_item_separator + layout="topleft" + name="Open Folder Separator" /> + <menu_item_call + label="Rename" + layout="topleft" + name="Rename"> + <menu_item_call.on_click + function="Inventory.DoToSelected" + parameter="rename" /> + </menu_item_call> + <menu_item_call label="Cut" layout="topleft" name="Cut"> @@ -953,6 +714,43 @@ function="Inventory.DoToSelected" parameter="ungroup_folder_items" /> </menu_item_call> + <menu + label="Use as default for" + layout="topleft" + name="upload_def"> + <menu_item_call + label="Image uploads" + layout="topleft" + name="Image uploads"> + <menu_item_call.on_click + function="Inventory.FileUploadLocation" + parameter="texture" /> + </menu_item_call> + <menu_item_call + label="Sound uploads" + layout="topleft" + name="Sound uploads"> + <menu_item_call.on_click + function="Inventory.FileUploadLocation" + parameter="sound" /> + </menu_item_call> + <menu_item_call + label="Animation uploads" + layout="topleft" + name="Animation uploads"> + <menu_item_call.on_click + function="Inventory.FileUploadLocation" + parameter="animation" /> + </menu_item_call> + <menu_item_call + label="Model uploads" + layout="topleft" + name="Model uploads"> + <menu_item_call.on_click + function="Inventory.FileUploadLocation" + parameter="model" /> + </menu_item_call> + </menu> <menu_item_separator layout="topleft" name="Marketplace Separator" /> diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml index e58eaf79a3..f778742ed9 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml @@ -26,7 +26,7 @@ parameter="open_in_new_window" /> <on_visible function="Inventory.GearDefault.Visible" - parameter="open_folder" /> + parameter="open_new_folder" /> </menu_item_call> <menu_item_call label="New Folder Window" |