summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-11-21 18:01:34 +0200
committerandreykproductengine <akleshchev@productengine.com>2016-11-21 18:01:34 +0200
commitfc72e2d95f1b8dc36246823afe09cceee5f352c3 (patch)
treebcafe5559023724af9ec5a3bc7e8258d35bb9d1e
parentc74d1acbfc3e734f789c7f916e37ceb9fcc26b16 (diff)
MAINT-6938 Fixed Inventory gear menu, 'empty' entries are always enabled.
-rw-r--r--indra/newview/llpanelmaininventory.cpp12
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml6
2 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 211cb32c01..cb28d88466 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -1251,6 +1251,18 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
LLSidepanelInventory* parent = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
return parent ? parent->canShare() : FALSE;
}
+ if (command_name == "empty_trash")
+ {
+ const LLUUID &trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
+ LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(trash_id);
+ return children != LLInventoryModel::CHILDREN_NO;
+ }
+ if (command_name == "empty_lostnfound")
+ {
+ const LLUUID &trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
+ LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(trash_id);
+ return children != LLInventoryModel::CHILDREN_NO;
+ }
return TRUE;
}
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 06d0b849a3..61cc9dfe77 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
@@ -95,6 +95,9 @@
<on_click
function="Inventory.GearDefault.Custom.Action"
parameter="empty_lostnfound" />
+ <on_enable
+ function="Inventory.GearDefault.Enable"
+ parameter="empty_lostnfound" />
</menu_item_call>
<menu_item_separator
layout="topleft" />
@@ -152,5 +155,8 @@
<on_click
function="Inventory.GearDefault.Custom.Action"
parameter="empty_trash" />
+ <on_enable
+ function="Inventory.GearDefault.Enable"
+ parameter="empty_trash" />
</menu_item_call>
</toggleable_menu>