summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterregioninfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloaterregioninfo.cpp')
-rw-r--r--indra/newview/llfloaterregioninfo.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 4f1c26d793..4babff69c2 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -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);
+ }
+}
+