FIRE-15755: Add options to area search to filter by owner permission and current agent parcel

meow-7.2.2
Ansariel 2016-01-26 12:34:37 +01:00
parent cb6814086e
commit 14f4e4bdba
4 changed files with 95 additions and 3 deletions

View File

@ -112,6 +112,10 @@ FSAreaSearch::FSAreaSearch(const LLSD& key) :
mFilterDistance(false),
mFilterDistanceMin(0),
mFilterDistanceMax(999999),
mFilterPermCopy(false),
mFilterPermModify(false),
mFilterPermTransfer(false),
mFilterAgentParcelOnly(false),
mBeaconColor(),
mBeaconTextColor(),
mBeacons(false),
@ -836,6 +840,26 @@ void FSAreaSearch::matchObject(FSObjectProperties& details, LLViewerObject* obje
}
}
if (mFilterAgentParcelOnly && !LLViewerParcelMgr::instance().inAgentParcel(objectp->getPositionGlobal()))
{
return;
}
if (mFilterPermCopy && !(details.owner_mask & PERM_COPY))
{
return;
}
if (mFilterPermModify && !(details.owner_mask & PERM_MODIFY))
{
return;
}
if (mFilterPermTransfer && !(details.owner_mask & PERM_TRANSFER))
{
return;
}
//-----------------------------------------------------------------------
// Find text
//-----------------------------------------------------------------------
@ -2064,6 +2088,18 @@ BOOL FSPanelAreaSearchFilter::postBuild()
mCheckboxMoaP = getChild<LLCheckBoxCtrl>("filter_moap");
mCheckboxMoaP->setCommitCallback(boost::bind(&FSPanelAreaSearchFilter::onCommitCheckbox, this));
mCheckboxPermCopy = getChild<LLCheckBoxCtrl>("filter_perm_copy");
mCheckboxPermCopy->setCommitCallback(boost::bind(&FSPanelAreaSearchFilter::onCommitCheckbox, this));
mCheckboxPermModify = getChild<LLCheckBoxCtrl>("filter_perm_modify");
mCheckboxPermModify->setCommitCallback(boost::bind(&FSPanelAreaSearchFilter::onCommitCheckbox, this));
mCheckboxPermTransfer = getChild<LLCheckBoxCtrl>("filter_perm_transfer");
mCheckboxPermTransfer->setCommitCallback(boost::bind(&FSPanelAreaSearchFilter::onCommitCheckbox, this));
mCheckboxAgentParcelOnly = getChild<LLCheckBoxCtrl>("filter_agent_parcel_only");
mCheckboxAgentParcelOnly->setCommitCallback(boost::bind(&FSPanelAreaSearchFilter::onCommitCheckbox, this));
return LLPanel::postBuild();
}
@ -2124,6 +2160,12 @@ void FSPanelAreaSearchFilter::onCommitCheckbox()
mFSAreaSearch->setExcludeChildPrims(mCheckboxExcludeChildPrim->get());
mFSAreaSearch->setExcludeNeighborRegions(mCheckboxExcludeNeighborRegions->get());
mFSAreaSearch->setFilterPermCopy(mCheckboxPermCopy->get());
mFSAreaSearch->setFilterPermModify(mCheckboxPermModify->get());
mFSAreaSearch->setFilterPermTransfer(mCheckboxPermTransfer->get());
mFSAreaSearch->setFilterAgentParcelOnly(mCheckboxAgentParcelOnly->get());
}
void FSPanelAreaSearchFilter::onCommitSpin()

View File

@ -158,6 +158,12 @@ public:
void setFilterDistanceMin(S32 s) { mFilterDistanceMin = s; }
void setFilterDistanceMax(S32 s) { mFilterDistanceMax = s; }
void setFilterPermCopy(bool b) { mFilterPermCopy = b; }
void setFilterPermModify(bool b) { mFilterPermModify = b; }
void setFilterPermTransfer(bool b) { mFilterPermTransfer = b; }
void setFilterAgentParcelOnly(bool b) { mFilterAgentParcelOnly = b; }
bool isActive() { return mActive; }
private:
@ -243,6 +249,12 @@ private:
bool mFilterClickAction;
U8 mFilterClickActionType;
bool mFilterPermCopy;
bool mFilterPermModify;
bool mFilterPermTransfer;
bool mFilterAgentParcelOnly;
protected:
static void* createPanelList(void* data);
static void* createPanelFind(void* data);
@ -380,6 +392,10 @@ private:
LLCheckBoxCtrl* mCheckboxExcludetemporary;
LLCheckBoxCtrl* mCheckboxExcludeChildPrim;
LLCheckBoxCtrl* mCheckboxExcludeNeighborRegions;
LLCheckBoxCtrl* mCheckboxPermCopy;
LLCheckBoxCtrl* mCheckboxPermModify;
LLCheckBoxCtrl* mCheckboxPermTransfer;
LLCheckBoxCtrl* mCheckboxAgentParcelOnly;
};

View File

@ -59,6 +59,9 @@
<check_box name="filter_temporary" label="Temporär"/>
<check_box name="filter_attachment" label="Anhang"/>
<check_box name="filter_moap" label="Shared Media"/>
<check_box name="filter_perm_copy" label="Kopieren"/>
<check_box name="filter_perm_modify" label="Bearbeiten"/>
<check_box name="filter_perm_transfer" label="Transferieren"/>
<check_box name="filter_for_sale" label="Zum Verkauf zwischen" width="150"/>
<text name="and">
und
@ -82,6 +85,7 @@
<text name="and2">
und
</text>
<check_box name="filter_agent_parcel_only" label="Nur aktuelle Parzelle" width="140"/>
<text name="only_list">
Objekte mit diesen Eigenschaften ausschließen:
</text>

View File

@ -4,7 +4,7 @@
help_topic="fs_area_search"
title="Area Search for Objects"
min_width="430"
min_height="355"
min_height="395"
width="610"
height="435"
save_rect="true"
@ -353,6 +353,28 @@
label="Shared Media"
left_pad="0"
width="100"/>
<check_box
follows="top|left"
top_pad="10"
layout="topleft"
left="10"
name="filter_perm_copy"
label="Copy"
width="100"/>
<check_box
follows="top|left"
layout="topleft"
left_pad="0"
name="filter_perm_modify"
label="Modify"
width="100"/>
<check_box
follows="top|left"
layout="topleft"
left_pad="0"
name="filter_perm_transfer"
label="Transfer"
width="100"/>
<check_box
follows="top|left"
height="20"
@ -504,10 +526,18 @@
name="max_distance"
top_delta="-4"
width="80"/>
<check_box
follows="top|left"
top_pad="22"
layout="topleft"
left="10"
name="filter_agent_parcel_only"
label="Current Parcel only"
width="80"/>
<text
name="only_list"
height="15"
top_pad="20"
top_pad="5"
follows="top|left"
left="5">
Exclude objects that are:
@ -552,7 +582,7 @@
name="exclude_neighbor_region"
label="Neighboring Regions"
width="80"/>
<button
<button
name="apply"
label="Apply"
mouse_opaque="true"