From d11a15b6dd0a6bb74b4f8f3f6ce23a05123c7e99 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 20 Mar 2014 16:39:30 -0700 Subject: DD-16 : WIP : Update sort / show menu, not actionable yet though --- indra/newview/llfloateroutbox.cpp | 36 ++++++++++++++++ indra/newview/llfloateroutbox.h | 3 ++ .../skins/default/xui/en/menu_marketplace_view.xml | 49 ++++++++++++++++++++++ .../en/panel_marketplace_listings_inventory.xml | 2 +- 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100755 indra/newview/skins/default/xui/en/menu_marketplace_view.xml (limited to 'indra') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index d6da0ad971..0b02cb8f64 100755 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -667,6 +667,8 @@ LLFloaterMarketplaceListings::LLFloaterMarketplaceListings(const LLSD& key) , mInventoryText(NULL) , mInventoryTitle(NULL) { + mCommitCallbackRegistrar.add("Marketplace.ViewSort.Action", boost::bind(&LLFloaterMarketplaceListings::onViewSortMenuItemClicked, this, _2)); + mEnableCallbackRegistrar.add("Marketplace.ViewSort.CheckItem", boost::bind(&LLFloaterMarketplaceListings::onViewSortMenuItemCheck, this, _2)); } LLFloaterMarketplaceListings::~LLFloaterMarketplaceListings() @@ -772,6 +774,40 @@ void LLFloaterMarketplaceListings::onFocusReceived() fetchContents(); } + +void LLFloaterMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata) +{ + /* + std::string chosen_item = userdata.asString(); + + if (chosen_item == "sort_by_stock_amount") + { + setSortOrder(mNearbyList, E_SORT_BY_RECENT_SPEAKERS); + } + else if (chosen_item == "show_low_stock") + { + mNearbyList->toggleIcons(); + } + */ +} + +bool LLFloaterMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata) +{ + /* + std::string item = userdata.asString(); + U32 sort_order = gSavedSettings.getU32("NearbyPeopleSortOrder"); + + 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; + */ + return false; +} + + void LLFloaterMarketplaceListings::fetchContents() { if (mRootFolderId.notNull()) diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h index eba3e4217b..3da7c6c985 100755 --- a/indra/newview/llfloateroutbox.h +++ b/indra/newview/llfloateroutbox.h @@ -160,6 +160,9 @@ protected: private: S32 getFolderCount(); + // UI callbacks + void onViewSortMenuItemClicked(const LLSD& userdata); + bool onViewSortMenuItemCheck(const LLSD& userdata); LLInventoryCategoriesObserver * mCategoriesObserver; LLInventoryCategoryAddedObserver * mCategoryAddedObserver; diff --git a/indra/newview/skins/default/xui/en/menu_marketplace_view.xml b/indra/newview/skins/default/xui/en/menu_marketplace_view.xml new file mode 100755 index 0000000000..6d31ff4960 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_marketplace_view.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml index 3c184ba54b..54fc3a0c0f 100755 --- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml @@ -23,7 +23,7 @@ width="31" height="25" left="2" - menu_filename="menu_people_nearby_view.xml" + menu_filename="menu_marketplace_view.xml" image_hover_unselected="Toolbar_Middle_Over" image_overlay="Conv_toolbar_sort" image_selected="Toolbar_Middle_Selected" -- cgit v1.2.3