diff options
-rwxr-xr-x | indra/newview/llfloateroutbox.cpp | 63 | ||||
-rwxr-xr-x | indra/newview/llfloateroutbox.h | 3 | ||||
-rwxr-xr-x | indra/newview/llinventoryfilter.h | 3 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/menu_marketplace_view.xml | 28 |
4 files changed, 67 insertions, 30 deletions
diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 0b02cb8f64..0d87cf63e8 100755 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -666,6 +666,8 @@ LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key) , mInventoryPlaceholder(NULL) , mInventoryText(NULL) , mInventoryTitle(NULL) +, mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME) +, mFilterType(LLInventoryFilter::FILTERTYPE_NONE) { mCommitCallbackRegistrar.add("Marketplace.ViewSort.Action", boost::bind(&LLFloaterMarketplaceListings::onViewSortMenuItemClicked, this, _2)); mEnableCallbackRegistrar.add("Marketplace.ViewSort.CheckItem", boost::bind(&LLFloaterMarketplaceListings::onViewSortMenuItemCheck, this, _2)); @@ -777,33 +779,64 @@ void LLFloaterMarketplaceListings::onFocusReceived() void LLFloaterMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata) { - /* std::string chosen_item = userdata.asString(); + LLInventoryPanel* panel = mInventoryPanel.get(); + + llinfos << "Merov : MenuItemClicked, item = " << chosen_item << ", panel on = " << panel->hasFocus() << llendl; + + // Sort options if (chosen_item == "sort_by_stock_amount") { - setSortOrder(mNearbyList, E_SORT_BY_RECENT_SPEAKERS); + mSortOrder = (mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_NAME ? LLInventoryFilter::SO_FOLDERS_BY_WEIGHT : LLInventoryFilter::SO_FOLDERS_BY_NAME); + panel->getFolderViewModel()->setSorter(mSortOrder); + } + // View/filter options + else if (chosen_item == "show_all") + { + mFilterType = LLInventoryFilter::FILTERTYPE_NONE; + panel->getFilter().resetDefault(); + } + else if (chosen_item == "show_non_associated_listings") + { + mFilterType = LLInventoryFilter::FILTERTYPE_MARKETPLACE_UNASSOCIATED; + panel->getFilter().setFilterMarketplaceUnassociatedFolders(); + } + else if (chosen_item == "show_active") + { + mFilterType = LLInventoryFilter::FILTERTYPE_MARKETPLACE_ACTIVE; + panel->getFilter().setFilterMarketplaceActiveFolders(); } - else if (chosen_item == "show_low_stock") + else if (chosen_item == "show_inactive_listings") { - mNearbyList->toggleIcons(); + mFilterType = LLInventoryFilter::FILTERTYPE_MARKETPLACE_INACTIVE; + panel->getFilter().setFilterMarketplaceInactiveFolders(); } - */ } bool LLFloaterMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata) { - /* - std::string item = userdata.asString(); - U32 sort_order = gSavedSettings.getU32("NearbyPeopleSortOrder"); + std::string chosen_item = userdata.asString(); + + LLInventoryPanel* panel = mInventoryPanel.get(); + + llinfos << "Merov : MenuItemCheck, item = " << chosen_item << ", panel on = " << panel->hasFocus() << llendl; + + if (!panel->hasFocus()) + { + return false; + } - if (item == "sort_by_recent_speakers") - return sort_order == E_SORT_BY_RECENT_SPEAKERS; - if (item == "sort_name") - return sort_order == E_SORT_BY_NAME; - if (item == "sort_distance") - return sort_order == E_SORT_BY_DISTANCE; - */ + if (chosen_item == "sort_by_stock_amount") + return mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_WEIGHT; + if (chosen_item == "show_all") + return mFilterType == LLInventoryFilter::FILTERTYPE_NONE; + if (chosen_item == "show_non_associated_listings") + return mFilterType == LLInventoryFilter::FILTERTYPE_MARKETPLACE_UNASSOCIATED; + if (chosen_item == "show_active") + return mFilterType == LLInventoryFilter::FILTERTYPE_MARKETPLACE_ACTIVE; + if (chosen_item == "show_inactive_listings") + return mFilterType == LLInventoryFilter::FILTERTYPE_MARKETPLACE_INACTIVE; return false; } diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h index 3da7c6c985..4908e4342b 100755 --- a/indra/newview/llfloateroutbox.h +++ b/indra/newview/llfloateroutbox.h @@ -31,6 +31,7 @@ #include "llfloater.h" #include "llfoldertype.h" +#include "llinventoryfilter.h" #include "llnotificationptr.h" @@ -175,6 +176,8 @@ private: LLUUID mRootFolderId; LLHandle<LLInventoryPanel> mInventoryPanel; + LLInventoryFilter::ESortOrderType mSortOrder; + LLInventoryFilter::EFilterType mFilterType; }; #endif // LL_LLFLOATEROUTBOX_H diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index e553355036..113596b0eb 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -70,7 +70,8 @@ public: SO_NAME = 0, // Sort inventory by name SO_DATE = 0x1, // Sort inventory by date SO_FOLDERS_BY_NAME = 0x1 << 1, // Force folder sort by name - SO_SYSTEM_FOLDERS_TO_TOP = 0x1 << 2 // Force system folders to be on top + SO_SYSTEM_FOLDERS_TO_TOP = 0x1 << 2,// Force system folders to be on top + SO_FOLDERS_BY_WEIGHT = 0x1 << 3, // Force folder sort by weight, usually, amount of some elements in their descendents }; struct FilterOps 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 6d31ff4960..36c73b9f4b 100755 --- a/indra/newview/skins/default/xui/en/menu_marketplace_view.xml +++ b/indra/newview/skins/default/xui/en/menu_marketplace_view.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <toggleable_menu - name="menu_group_plus" + name="menu_marketplace_sort" left="0" bottom="0" visible="false" mouse_opaque="false"> <menu_item_check @@ -14,13 +14,13 @@ parameter="sort_by_stock_amount"/> </menu_item_check> <menu_item_separator layout="topleft" /> - <menu_item_check name="show_low_stock" label="Show Low Stock Listings Only"> + <menu_item_check name="show_all" label="Show All"> <menu_item_check.on_click - function="Marketplace.ViewSort.Action" - parameter="show_low_stock" /> + function="Marketplace.ViewSort.Action" + parameter="show_all" /> <menu_item_check.on_check - function="Marketplace.ViewSort.CheckItem" - parameter="show_low_stock" /> + function="Marketplace.ViewSort.CheckItem" + parameter="show_all" /> </menu_item_check> <menu_item_check name="show_associated_listings" label="Show Associated Listings Only"> <menu_item_check.on_click @@ -30,20 +30,20 @@ function="Marketplace.ViewSort.CheckItem" parameter="show_associated_listings" /> </menu_item_check> - <menu_item_check name="show_non_associated_listings" label="Show Non Associated Listings Only"> + <menu_item_check name="show_active" label="Show Active Listings and Folders Only"> <menu_item_check.on_click - function="Marketplace.ViewSort.Action" - parameter="show_non_associated_listings" /> + function="People.Nearby.ViewSort.Action" + parameter="show_active" /> <menu_item_check.on_check - function="Marketplace.ViewSort.CheckItem" - parameter="show_non_associated_listings" /> + function="People.Nearby.ViewSort.CheckItem" + parameter="show_active" /> </menu_item_check> - <menu_item_check name="show_active" label="Show Active Listings and Folders Only"> + <menu_item_check name="show_inactive_listings" label="Show Inactive Listings Only"> <menu_item_check.on_click function="Marketplace.ViewSort.Action" - parameter="show_active" /> + parameter="show_inactive_listings" /> <menu_item_check.on_check function="Marketplace.ViewSort.CheckItem" - parameter="show_active" /> + parameter="show_inactive_listings" /> </menu_item_check> </toggleable_menu> |