diff options
| author | Merov Linden <merov@lindenlab.com> | 2015-01-24 20:56:24 -0800 | 
|---|---|---|
| committer | Merov Linden <merov@lindenlab.com> | 2015-01-24 20:56:24 -0800 | 
| commit | a62b1a26f5fcc88fa00c90075fa3c02b1f611e4c (patch) | |
| tree | 592eaf489dde00402c935582248c3e689bab3597 /indra | |
| parent | 855696c36980ded4aa93c315e1cd3d7e2b278446 (diff) | |
DD-301 : Add show only listing folders as an optional filter
Diffstat (limited to 'indra')
| -rwxr-xr-x | indra/newview/llfloatermarketplacelistings.cpp | 23 | ||||
| -rwxr-xr-x | indra/newview/llfloatermarketplacelistings.h | 2 | ||||
| -rwxr-xr-x | indra/newview/llinventoryfilter.cpp | 26 | ||||
| -rwxr-xr-x | indra/newview/llinventoryfilter.h | 4 | ||||
| -rwxr-xr-x | indra/newview/skins/default/xui/en/menu_marketplace_view.xml | 10 | 
5 files changed, 61 insertions, 4 deletions
| diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 229bf0b0b1..f4c138b890 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -53,7 +53,7 @@ static LLPanelInjector<LLPanelMarketplaceListings> t_panel_status("llpanelmarket  LLPanelMarketplaceListings::LLPanelMarketplaceListings()  : mRootFolder(NULL)  , mSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME) -, mFilterType(LLInventoryFilter::FILTERTYPE_NONE) +, mFilterListingFoldersOnly(false)  {  	mCommitCallbackRegistrar.add("Marketplace.ViewSort.Action",  boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemClicked,  this, _2));  	mEnableCallbackRegistrar.add("Marketplace.ViewSort.CheckItem",	boost::bind(&LLPanelMarketplaceListings::onViewSortMenuItemCheck,	this, _2)); @@ -226,6 +226,21 @@ void LLPanelMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata)          panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Unassociated Items");          panel->setSortOrder(mSortOrder);  	} +    // Filter option +    else if (chosen_item == "show_only_listing_folders") +    { +        mFilterListingFoldersOnly = !mFilterListingFoldersOnly; +        // Set each panel with that filter flag +        LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs"); +        LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items"); +        panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); +        panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Active Items"); +        panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); +        panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Inactive Items"); +        panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); +        panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Unassociated Items"); +        panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); +    }  }  bool LLPanelMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata) @@ -233,7 +248,13 @@ bool LLPanelMarketplaceListings::onViewSortMenuItemCheck(const LLSD& userdata)  	std::string chosen_item = userdata.asString();  	if (chosen_item == "sort_by_stock_amount") +    {  		return mSortOrder == LLInventoryFilter::SO_FOLDERS_BY_WEIGHT; +    } +    else if (chosen_item == "show_only_listing_folders") +    { +        return mFilterListingFoldersOnly; +    }  	return false;  } diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index 9249347877..f6aa0ef0a6 100755 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -74,8 +74,8 @@ private:      LLButton*         mAuditBtn;  	LLFilterEditor*	  mFilterEditor;  	std::string		  mFilterSubString; +    bool              mFilterListingFoldersOnly;      LLInventoryFilter::ESortOrderType mSortOrder; -    LLInventoryFilter::EFilterType mFilterType;  };  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 8fcfbd646f..d0fb994043 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -146,10 +146,20 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const  	// Marketplace folder filtering      const U32 filterTypes = mFilterOps.mFilterTypes; -    const U32 marketplace_filter = FILTERTYPE_MARKETPLACE_ACTIVE | FILTERTYPE_MARKETPLACE_INACTIVE | FILTERTYPE_MARKETPLACE_UNASSOCIATED; +    const U32 marketplace_filter = FILTERTYPE_MARKETPLACE_ACTIVE | FILTERTYPE_MARKETPLACE_INACTIVE | +                                   FILTERTYPE_MARKETPLACE_UNASSOCIATED | FILTERTYPE_MARKETPLACE_LISTING_FOLDER;      if (filterTypes & marketplace_filter)      {          S32 depth = depth_nesting_in_marketplace(folder_id); + +        if (filterTypes & FILTERTYPE_MARKETPLACE_LISTING_FOLDER) +        { +            if (depth > 1) +            { +                return false; +            } +        } +                  if (depth > 0)          {              LLUUID listing_uuid = nested_parent_id(folder_id, depth); @@ -551,6 +561,20 @@ void LLInventoryFilter::setFilterMarketplaceUnassociatedFolders()  	mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_UNASSOCIATED;  } +void LLInventoryFilter::setFilterMarketplaceListingFolders(bool select_only_listing_folders) +{ +    if (select_only_listing_folders) +    { +        mFilterOps.mFilterTypes |= FILTERTYPE_MARKETPLACE_LISTING_FOLDER; +        setModified(FILTER_MORE_RESTRICTIVE); +    } +    else +    { +        mFilterOps.mFilterTypes &= ~FILTERTYPE_MARKETPLACE_LISTING_FOLDER; +        setModified(FILTER_LESS_RESTRICTIVE); +    } +} +  void LLInventoryFilter::setFilterUUID(const LLUUID& object_id)  {  	if (mFilterOps.mFilterUUID == LLUUID::null) diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index c270b90b09..90fa444cf2 100755 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -55,7 +55,8 @@ public:  		FILTERTYPE_EMPTYFOLDERS = 0x1 << 5,		// pass if folder is not a system folder to be hidden if empty          FILTERTYPE_MARKETPLACE_ACTIVE = 0x1 << 6,		// pass if folder is a marketplace active folder          FILTERTYPE_MARKETPLACE_INACTIVE = 0x1 << 7,		// pass if folder is a marketplace inactive folder -        FILTERTYPE_MARKETPLACE_UNASSOCIATED = 0x1 << 8	// pass if folder is a marketplace non associated (no market ID) folder +        FILTERTYPE_MARKETPLACE_UNASSOCIATED = 0x1 << 8,	// pass if folder is a marketplace non associated (no market ID) folder +        FILTERTYPE_MARKETPLACE_LISTING_FOLDER = 0x1 << 9	// pass iff folder is a listing folder  	};  	enum EFilterDateDirection @@ -177,6 +178,7 @@ public:  	void				setFilterMarketplaceActiveFolders();  	void				setFilterMarketplaceInactiveFolders();  	void				setFilterMarketplaceUnassociatedFolders(); +    void                setFilterMarketplaceListingFolders(bool select_only_listing_folders);  	void				updateFilterTypes(U64 types, U64& current_types);  	void 				setFilterSubString(const std::string& string); 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 cff5ec1040..a9e9b5a28f 100755 --- a/indra/newview/skins/default/xui/en/menu_marketplace_view.xml +++ b/indra/newview/skins/default/xui/en/menu_marketplace_view.xml @@ -13,4 +13,14 @@           function="Marketplace.ViewSort.CheckItem"           parameter="sort_by_stock_amount"/>      </menu_item_check> +    <menu_item_check +        label="Show only listing folders" +        name="show_only_listing_folders"> +        <menu_item_check.on_click +        function="Marketplace.ViewSort.Action" +        parameter="show_only_listing_folders"/> +        <menu_item_check.on_check +        function="Marketplace.ViewSort.CheckItem" +        parameter="show_only_listing_folders"/> +    </menu_item_check>  </toggleable_menu> | 
