summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermarketplacelistings.cpp
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/newview/llfloatermarketplacelistings.cpp
parent3748d2f6dcde6f26c591c544c674aa76a81544c1 (diff)
DD-403 : Add sort by name and by most recent
Diffstat (limited to 'indra/newview/llfloatermarketplacelistings.cpp')
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.cpp32
1 files changed, 28 insertions, 4 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")
{