summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2015-05-06 23:47:44 -0700
committerMerov Linden <merov@lindenlab.com>2015-05-06 23:47:44 -0700
commit36ce6fbda5ffe8474129c28ab77090c25967b51b (patch)
treeeb6c12ee5f46bbd612f38422b9d15c8e79334183 /indra
parent3748d2f6dcde6f26c591c544c674aa76a81544c1 (diff)
DD-403 : Add sort by name and by most recent
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.cpp32
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.h2
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_marketplace_view.xml38
3 files changed, 59 insertions, 13 deletions
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp
index 5d3eb50240..eb7601f67e 100755
--- a/indra/newview/llfloatermarketplacelistings.cpp
+++ b/indra/newview/llfloatermarketplacelistings.cpp
@@ -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")
{
diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h
index 594451ede4..9fad31c456 100755
--- a/indra/newview/llfloatermarketplacelistings.h
+++ b/indra/newview/llfloatermarketplacelistings.h
@@ -80,7 +80,7 @@ private:
LLFilterEditor* mFilterEditor;
std::string mFilterSubString;
bool mFilterListingFoldersOnly;
- LLInventoryFilter::ESortOrderType mSortOrder;
+ U32 mSortOrder;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/indra/newview/skins/default/xui/en/menu_marketplace_view.xml b/indra/newview/skins/default/xui/en/menu_marketplace_view.xml
index a9e9b5a28f..4b3bb8ee1c 100755
--- a/indra/newview/skins/default/xui/en/menu_marketplace_view.xml
+++ b/indra/newview/skins/default/xui/en/menu_marketplace_view.xml
@@ -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">