Added a few items to the area search context menu.

In the area search context menu, I've added items to select all object
entries, clear all selections, or filter all objects owned by the user.
master
Testy 2020-02-16 17:50:55 -04:00
parent f7b56e6f7c
commit 6eb700cac6
3 changed files with 71 additions and 0 deletions

View File

@ -1323,6 +1323,11 @@ void FSAreaSearch::onCommitCheckboxRegex()
}
}
void FSAreaSearch::setFindOwnerText(std::string value)
{
mPanelFind->mOwnerLineEditor->setText(value);
}
//---------------------------------------------------------------------------
// List panel
@ -1632,6 +1637,43 @@ bool FSPanelAreaSearchList::onContextMenuItemClick(const LLSD& userdata)
std::string action = userdata.asString();
LL_DEBUGS("FSAreaSearch") << "Right click menu " << action << " was selected." << LL_ENDL;
if (action == "select_all")
{
std::vector<LLScrollListItem*> result_items = mResultList->getAllData();
std::vector<LLScrollListItem*>::iterator iter = result_items.begin();
std::vector<LLScrollListItem*>::iterator end = result_items.end();
for (; iter != end; ++iter)
{
(*iter)->setSelected(TRUE);
}
return true;
}
if (action == "clear_selection")
{
std::vector<LLScrollListItem*> selected_items = mResultList->getAllSelected();
std::vector<LLScrollListItem*>::iterator iter = selected_items.begin();
std::vector<LLScrollListItem*>::iterator end = selected_items.end();
for (; iter != end; ++iter)
{
(*iter)->setSelected(FALSE);
}
return true;
}
if (action == "filter_my_objects")
{
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(gAgent.getID(), &avatar_name))
{
mFSAreaSearch->setFindOwnerText(avatar_name.getLegacyName());
mFSAreaSearch->onButtonClickedSearch();
}
else
{
LL_DEBUGS() << "Avatar name could not be retrieved from cache." << LL_ENDL;
}
return true;
}
// NOTE that each action command MUST begin with a different letter.
char c = action.at(0);
switch(c)

View File

@ -126,6 +126,7 @@ public:
void onButtonClickedSearch();
void onCommitCheckboxRegex();
bool isSearchableObject (LLViewerObject* objectp, LLViewerRegion* our_region);
void setFindOwnerText(std::string value);
std::map<LLUUID, FSObjectProperties> mObjectDetails;

View File

@ -107,4 +107,32 @@
function="AreaSearch.Enable"
parameter="one"/>
</menu_item_call>
<menu_item_separator
layout="topleft"/>
<menu_item_call
label="Filter My Objects"
layout="topleft"
name="filter_my_objects">
<menu_item_call.on_click
function="AreaSearch.Action"
parameter="filter_my_objects"/>
</menu_item_call>
<menu_item_separator
layout="topleft"/>
<menu_item_call
label="Select All"
layout="topleft"
name="select_all">
<menu_item_call.on_click
function="AreaSearch.Action"
parameter="select_all"/>
</menu_item_call>
<menu_item_call
label="Clear Selection"
layout="topleft"
name="clear_selection">
<menu_item_call.on_click
function="AreaSearch.Action"
parameter="clear_selection"/>
</menu_item_call>
</context_menu>