summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
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">