MAINT-8566 Access lists search implementation

master
AndreyL ProductEngine 2018-07-12 20:35:01 +03:00
parent 599cd81b8c
commit 28cdee4e08
3 changed files with 123 additions and 7 deletions

View File

@ -3267,6 +3267,7 @@ BOOL LLPanelEstateAccess::postBuild()
avatar_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS);
}
getChild<LLUICtrl>("allowed_search_input")->setCommitCallback(boost::bind(&LLPanelEstateAccess::onAllowedSearchEdit, this, _2));
childSetAction("add_allowed_avatar_btn", boost::bind(&LLPanelEstateAccess::onClickAddAllowedAgent, this));
childSetAction("remove_allowed_avatar_btn", boost::bind(&LLPanelEstateAccess::onClickRemoveAllowedAgent, this));
@ -3278,6 +3279,7 @@ BOOL LLPanelEstateAccess::postBuild()
group_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS);
}
getChild<LLUICtrl>("allowed_group_search_input")->setCommitCallback(boost::bind(&LLPanelEstateAccess::onAllowedGroupsSearchEdit, this, _2));
getChild<LLUICtrl>("add_allowed_group_btn")->setCommitCallback(boost::bind(&LLPanelEstateAccess::onClickAddAllowedGroup, this));
childSetAction("remove_allowed_group_btn", boost::bind(&LLPanelEstateAccess::onClickRemoveAllowedGroup, this));
@ -3289,6 +3291,7 @@ BOOL LLPanelEstateAccess::postBuild()
banned_name_list->setMaxItemCount(ESTATE_MAX_ACCESS_IDS);
}
getChild<LLUICtrl>("banned_search_input")->setCommitCallback(boost::bind(&LLPanelEstateAccess::onBannedSearchEdit, this, _2));
childSetAction("add_banned_avatar_btn", boost::bind(&LLPanelEstateAccess::onClickAddBannedAgent, this));
childSetAction("remove_banned_avatar_btn", boost::bind(&LLPanelEstateAccess::onClickRemoveBannedAgent, this));
@ -4064,3 +4067,45 @@ void LLPanelEstateAccess::requestEstateGetAccessCoro(std::string url)
panel->updateControls(gAgent.getRegion());
}
//---------------------------------------------------------------------------
// Access lists search
//---------------------------------------------------------------------------
void LLPanelEstateAccess::onAllowedSearchEdit(const std::string& search_string)
{
LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess();
if (!panel) return;
LLNameListCtrl* allowed_agent_name_list = panel->getChild<LLNameListCtrl>("allowed_avatar_name_list");
searchAgent(allowed_agent_name_list, search_string);
}
void LLPanelEstateAccess::onAllowedGroupsSearchEdit(const std::string& search_string)
{
LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess();
if (!panel) return;
LLNameListCtrl* allowed_group_name_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list");
searchAgent(allowed_group_name_list, search_string);
}
void LLPanelEstateAccess::onBannedSearchEdit(const std::string& search_string)
{
LLPanelEstateAccess* panel = LLFloaterRegionInfo::getPanelAccess();
if (!panel) return;
LLNameListCtrl* banned_agent_name_list = panel->getChild<LLNameListCtrl>("banned_avatar_name_list");
searchAgent(banned_agent_name_list, search_string);
}
void LLPanelEstateAccess::searchAgent(LLNameListCtrl* listCtrl, const std::string& search_string)
{
if (!listCtrl) return;
if (!search_string.empty())
{
listCtrl->setSearchColumn(0); // name column
listCtrl->selectItemByPrefix(search_string, FALSE);
}
else
{
listCtrl->deselectAllItems(TRUE);
}
}

View File

@ -508,6 +508,9 @@ private:
void onClickRemoveBannedAgent();
void onClickAddEstateManager();
void onClickRemoveEstateManager();
void onAllowedSearchEdit(const std::string& search_string);
void onAllowedGroupsSearchEdit(const std::string& search_string);
void onBannedSearchEdit(const std::string& search_string);
// Group picker callback is different, can't use core methods below
bool addAllowedGroup(const LLSD& notification, const LLSD& response);
@ -529,6 +532,8 @@ private:
static void requestEstateGetAccessCoro(std::string url);
void searchAgent(LLNameListCtrl* listCtrl, const std::string& search_string);
bool mPendingUpdate;
};

View File

@ -113,6 +113,28 @@
name="allowed_panel"
right="-1"
top="0">
<panel
follows="left|top|right"
height="27"
label="top_panel"
layout="topleft"
left="0"
name="allowed_search_panel"
right="-1"
top="0">
<filter_editor
follows="left|top|right"
height="23"
layout="topleft"
left="6"
label="Search allowed agents"
max_length_chars="300"
name="allowed_search_input"
text_color="Black"
text_pad_left="10"
top="4"
width="498" />
</panel>
<text
type="string"
length="1"
@ -130,14 +152,14 @@
<view_border
bevel_style="none"
follows="top|left"
height="400"
height="370"
layout="topleft"
left="10"
top_pad="-5"
width="498" />
<name_list
follows="left|top"
height="400"
height="370"
layout="topleft"
left_delta="0"
multi_select="true"
@ -184,7 +206,29 @@
help_topic="allowed_groups_tab"
name="allowed_groups_panel"
right="-1"
top="0">
top="0">
<panel
follows="left|top|right"
height="27"
label="top_panel"
layout="topleft"
left="0"
name="allowed_group_search_panel"
right="-1"
top="0">
<filter_editor
follows="left|top|right"
height="23"
layout="topleft"
left="6"
label="Search allowed groups"
max_length_chars="300"
name="allowed_group_search_input"
text_color="Black"
text_pad_left="10"
top="4"
width="498" />
</panel>
<text
type="string"
length="1"
@ -201,14 +245,14 @@
<view_border
bevel_style="none"
follows="top|left"
height="400"
height="370"
layout="topleft"
left="10"
top_pad="-5"
width="498" />
<name_list
follows="left|top"
height="400"
height="370"
layout="topleft"
left_delta="0"
multi_select="true"
@ -257,6 +301,28 @@
name="banned_panel"
right="-1"
top="0">
<panel
follows="left|top|right"
height="27"
label="top_panel"
layout="topleft"
left="0"
name="banned_search_panel"
right="-1"
top="0">
<filter_editor
follows="left|top|right"
height="23"
layout="topleft"
left="6"
label="Search banned agents"
max_length_chars="300"
name="banned_search_input"
text_color="Black"
text_pad_left="10"
top="4"
width="498" />
</panel>
<text
type="string"
length="1"
@ -273,14 +339,14 @@
<view_border
bevel_style="none"
follows="top|left"
height="400"
height="370"
layout="topleft"
left="10"
top_pad="-5"
width="498" />
<name_list
follows="left|top"
height="400"
height="370"
layout="topleft"
left_delta="0"
multi_select="true"