DD-403 : Add sort by name and by most recent
parent
3748d2f6dc
commit
36ce6fbda5
|
|
@ -229,9 +229,22 @@ void LLPanelMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata)
|
|||
std::string chosen_item = userdata.asString();
|
||||
|
||||
// Sort options
|
||||
if (chosen_item == "sort_by_stock_amount")
|
||||
if ((chosen_item == "sort_by_stock_amount") || (chosen_item == "sort_by_name") || (chosen_item == "sort_by_recent"))
|
||||
{
|
||||
mSortOrder = (mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_NAME ? LLInventoryFilter::SO_FOLDERS_BY_WEIGHT : LLInventoryFilter::SO_FOLDERS_BY_NAME);
|
||||
// We're making sort options exclusive, default is SO_FOLDERS_BY_NAME
|
||||
if (chosen_item == "sort_by_stock_amount")
|
||||
{
|
||||
mSortOrder = LLInventoryFilter::SO_FOLDERS_BY_WEIGHT;
|
||||
}
|
||||
else if (chosen_item == "sort_by_name")
|
||||
{
|
||||
mSortOrder = LLInventoryFilter::SO_FOLDERS_BY_NAME;
|
||||
}
|
||||
else if (chosen_item == "sort_by_recent")
|
||||
{
|
||||
mSortOrder = LLInventoryFilter::SO_DATE;
|
||||
}
|
||||
//mSortOrder = (mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_NAME ? LLInventoryFilter::SO_FOLDERS_BY_WEIGHT : LLInventoryFilter::SO_FOLDERS_BY_NAME);
|
||||
// Set each panel with that sort order
|
||||
LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs");
|
||||
LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items");
|
||||
|
|
@ -264,9 +277,20 @@ bool LLPanelMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata)
|
|||
{
|
||||
std::string chosen_item = userdata.asString();
|
||||
|
||||
if (chosen_item == "sort_by_stock_amount")
|
||||
if ((chosen_item == "sort_by_stock_amount") || (chosen_item == "sort_by_name") || (chosen_item == "sort_by_recent"))
|
||||
{
|
||||
return mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_WEIGHT;
|
||||
if (chosen_item == "sort_by_stock_amount")
|
||||
{
|
||||
return (mSortOrder & LLInventoryFilter::SO_FOLDERS_BY_WEIGHT);
|
||||
}
|
||||
else if (chosen_item == "sort_by_name")
|
||||
{
|
||||
return (mSortOrder & LLInventoryFilter::SO_FOLDERS_BY_NAME);
|
||||
}
|
||||
else if (chosen_item == "sort_by_recent")
|
||||
{
|
||||
return (mSortOrder & LLInventoryFilter::SO_DATE);
|
||||
}
|
||||
}
|
||||
else if (chosen_item == "show_only_listing_folders")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ private:
|
|||
LLFilterEditor* mFilterEditor;
|
||||
std::string mFilterSubString;
|
||||
bool mFilterListingFoldersOnly;
|
||||
LLInventoryFilter::ESortOrderType mSortOrder;
|
||||
U32 mSortOrder;
|
||||
};
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -4,15 +4,37 @@
|
|||
left="0" bottom="0" visible="false"
|
||||
mouse_opaque="false">
|
||||
<menu_item_check
|
||||
label="Sort by stock amount (low to high)"
|
||||
name="sort_by_stock_amount">
|
||||
<menu_item_check.on_click
|
||||
function="Marketplace.ViewSort.Action"
|
||||
parameter="sort_by_stock_amount"/>
|
||||
<menu_item_check.on_check
|
||||
function="Marketplace.ViewSort.CheckItem"
|
||||
parameter="sort_by_stock_amount"/>
|
||||
label="Sort by name"
|
||||
name="sort_by_name">
|
||||
<menu_item_check.on_click
|
||||
function="Marketplace.ViewSort.Action"
|
||||
parameter="sort_by_name" />
|
||||
<menu_item_check.on_check
|
||||
function="Marketplace.ViewSort.CheckItem"
|
||||
parameter="sort_by_name" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Sort by most recent"
|
||||
name="sort_by_recent">
|
||||
<menu_item_check.on_click
|
||||
function="Marketplace.ViewSort.Action"
|
||||
parameter="sort_by_recent" />
|
||||
<menu_item_check.on_check
|
||||
function="Marketplace.ViewSort.CheckItem"
|
||||
parameter="sort_by_recent" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Sort by stock amount (low to high)"
|
||||
name="sort_by_stock_amount">
|
||||
<menu_item_check.on_click
|
||||
function="Marketplace.ViewSort.Action"
|
||||
parameter="sort_by_stock_amount"/>
|
||||
<menu_item_check.on_check
|
||||
function="Marketplace.ViewSort.CheckItem"
|
||||
parameter="sort_by_stock_amount"/>
|
||||
</menu_item_check>
|
||||
<menu_item_separator
|
||||
layout="topleft" />
|
||||
<menu_item_check
|
||||
label="Show only listing folders"
|
||||
name="show_only_listing_folders">
|
||||
|
|
|
|||
Loading…
Reference in New Issue