From 14362f5a1341c22e1e8d91add49b99abfc2dabb1 Mon Sep 17 00:00:00 2001 From: Techwolf Lupindo Date: Wed, 31 Oct 2012 19:11:27 -0400 Subject: [PATCH] Area Search: Add MOTP filter. --- indra/newview/fsareasearch.cpp | 24 +++++++++++++++++++ indra/newview/fsareasearch.h | 3 +++ .../default/xui/en/floater_fs_area_search.xml | 7 ++++++ 3 files changed, 34 insertions(+) diff --git a/indra/newview/fsareasearch.cpp b/indra/newview/fsareasearch.cpp index 0d0a95499e..af45b32567 100644 --- a/indra/newview/fsareasearch.cpp +++ b/indra/newview/fsareasearch.cpp @@ -98,6 +98,7 @@ FSAreaSearch::FSAreaSearch(const LLSD& key) : mFilterLocked(false), mFilterPhantom(false), mFilterAttachment(false), + mFilterMOTP(false), mFilterDistance(false), mFilterDistanceMin(0), mFilterDistanceMax(999999), @@ -652,6 +653,25 @@ void FSAreaSearch::matchObject(FSObjectProperties& details, LLViewerObject* obje { return; } + + if (mFilterMOTP) + { + bool motp = false; + U8 texture_count = objectp->getNumTEs(); + for(U8 i = 0; i < texture_count; i++) + { + if(objectp->getTE(i)->hasMedia()) + { + motp = true; + break; + } + } + + if(!motp) + { + return; + } + } //----------------------------------------------------------------------- // Find text @@ -1537,6 +1557,9 @@ BOOL FSPanelAreaSearchFilter::postBuild() mSpinDistanceMaxValue= getChild("max_distance"); mSpinDistanceMaxValue->setCommitCallback(boost::bind(&FSPanelAreaSearchFilter::onCommitSpin, this)); + mCheckboxMOTP = getChild("filter_motp"); + mCheckboxMOTP->setCommitCallback(boost::bind(&FSPanelAreaSearchFilter::onCommitCheckbox, this)); + return LLPanel::postBuild(); } @@ -1550,6 +1573,7 @@ void FSPanelAreaSearchFilter::onCommitCheckbox() mFSAreaSearch->setFilterPhantom(mCheckboxPhantom->get()); mFSAreaSearch->setFilterForSale(mCheckboxForSale->get()); mFSAreaSearch->setFilterDistance(mCheckboxDistance->get()); + mFSAreaSearch->setFilterMOTP(mCheckboxMOTP->get()); if (mCheckboxExcludePhysics->get()) { diff --git a/indra/newview/fsareasearch.h b/indra/newview/fsareasearch.h index 01b0d9def4..f96b78975c 100644 --- a/indra/newview/fsareasearch.h +++ b/indra/newview/fsareasearch.h @@ -123,6 +123,7 @@ public: void setFilterTemporary(bool b) { mFilterTemporary = b; } void setFilterPhantom(bool b) { mFilterPhantom = b; } void setFilterAttachment(bool b) { mFilterAttachment = b; } + void setFilterMOTP(bool b) { mFilterMOTP = b; } void setRegexSearch(bool b) { mRegexSearch = b; } void setBeacons(bool b) { mBeacons = b; } @@ -205,6 +206,7 @@ private: bool mFilterTemporary; bool mFilterPhantom; bool mFilterAttachment; + bool mFilterMOTP; bool mFilterForSale; S32 mFilterForSaleMin; @@ -330,6 +332,7 @@ private: LLCheckBoxCtrl* mCheckboxTemporary; LLCheckBoxCtrl* mCheckboxLocked; LLCheckBoxCtrl* mCheckboxPhantom; + LLCheckBoxCtrl* mCheckboxMOTP; LLCheckBoxCtrl* mCheckboxDistance; LLSpinCtrl* mSpinDistanceMinValue; LLSpinCtrl* mSpinDistanceMaxValue; diff --git a/indra/newview/skins/default/xui/en/floater_fs_area_search.xml b/indra/newview/skins/default/xui/en/floater_fs_area_search.xml index f296a029e3..6b3f6240dd 100644 --- a/indra/newview/skins/default/xui/en/floater_fs_area_search.xml +++ b/indra/newview/skins/default/xui/en/floater_fs_area_search.xml @@ -329,6 +329,13 @@ label="Attachment" left_pad="0" width="80"/> +