viewer#2576 Crash when banning a resident

Co-authored-by: Andrey Kleshchev <andreykproductengine@lindenlab.com>
master
Maxim Nikolenko 2025-01-29 20:00:47 +02:00 committed by GitHub
parent 43a966eea4
commit cff2c66f25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 43 deletions

View File

@ -56,6 +56,7 @@ LLPanelGroupBulkImpl::LLPanelGroupBulkImpl(const LLUUID& group_id) :
mGroupID(group_id),
mBulkAgentList(NULL),
mOKButton(NULL),
mAddButton(nullptr),
mRemoveButton(NULL),
mGroupName(NULL),
mLoadingText(),
@ -79,29 +80,18 @@ LLPanelGroupBulkImpl::~LLPanelGroupBulkImpl()
}
}
// static
void LLPanelGroupBulkImpl::callbackClickAdd(void* userdata)
void LLPanelGroupBulkImpl::callbackClickAdd(LLPanelGroupBulk* panelp)
{
if (LLPanelGroupBulk* panelp = (LLPanelGroupBulk*)userdata)
{
// Right now this is hard coded with some knowledge that it is part
// of a floater since the avatar picker needs to be added as a dependent
// floater to the parent floater.
// Soon the avatar picker will be embedded into this panel
// instead of being it's own separate floater. But that is next week.
// This will do for now. -jwolk May 10, 2006
LLView* button = panelp->findChild<LLButton>("add_button");
LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
[&](const uuid_vec_t& agent_ids, const std::vector<LLAvatarName>&)
{
panelp->mImplementation->addUsers(agent_ids);
}, true, false, false, root_floater->getName(), button);
if (picker)
LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(
[this](const uuid_vec_t& agent_ids, const std::vector<LLAvatarName>&)
{
root_floater->addDependentFloater(picker);
LLGroupMgr::getInstance()->sendCapGroupMembersRequest(panelp->mImplementation->mGroupID);
}
addUsers(agent_ids);
}, true, false, false, root_floater->getName(), mAddButton);
if (picker)
{
root_floater->addDependentFloater(picker);
LLGroupMgr::getInstance()->sendCapGroupMembersRequest(mGroupID);
}
}

View File

@ -68,35 +68,26 @@ bool LLPanelGroupBulkBan::postBuild()
mImplementation->mBulkAgentList->setCommitCallback(LLPanelGroupBulkImpl::callbackSelect, mImplementation);
}
LLButton* button = getChild<LLButton>("add_button", recurse);
if ( button )
mImplementation->mAddButton = getChild<LLButton>("add_button", recurse);
// default to opening avatarpicker automatically
mImplementation->mAddButton->setClickedCallback(
[this](LLUICtrl* ctrl, const LLSD& param)
{
// default to opening avatarpicker automatically
// (*impl::callbackClickAdd)((void*)this);
button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickAdd, this);
}
mImplementation->callbackClickAdd(this);
});
mImplementation->mRemoveButton =
getChild<LLButton>("remove_button", recurse);
if ( mImplementation->mRemoveButton )
{
mImplementation->mRemoveButton->setClickedCallback(LLPanelGroupBulkImpl::callbackClickRemove, mImplementation);
mImplementation->mRemoveButton->setEnabled(false);
}
mImplementation->mRemoveButton->setClickedCallback(LLPanelGroupBulkImpl::callbackClickRemove, mImplementation);
mImplementation->mRemoveButton->setEnabled(false);
mImplementation->mOKButton =
getChild<LLButton>("ban_button", recurse);
if ( mImplementation->mOKButton )
{
mImplementation->mOKButton->setClickedCallback(LLPanelGroupBulkBan::callbackClickSubmit, this);
mImplementation->mOKButton->setEnabled(false);
}
mImplementation->mOKButton->setClickedCallback(LLPanelGroupBulkBan::callbackClickSubmit, this);
mImplementation->mOKButton->setEnabled(false);
button = getChild<LLButton>("cancel_button", recurse);
if ( button )
{
button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickCancel, mImplementation);
}
LLButton* button = getChild<LLButton>("cancel_button", recurse);
button->setClickedCallback(LLPanelGroupBulkImpl::callbackClickCancel, mImplementation);
mImplementation->mTooManySelected = getString("ban_selection_too_large");
mImplementation->mBanNotPermitted = getString("ban_not_permitted");

View File

@ -44,7 +44,7 @@ public:
LLPanelGroupBulkImpl(const LLUUID& group_id);
~LLPanelGroupBulkImpl();
static void callbackClickAdd(void* userdata);
void callbackClickAdd(LLPanelGroupBulk* panelp);
static void callbackClickRemove(void* userdata);
static void callbackClickCancel(void* userdata);
@ -70,6 +70,7 @@ public:
LLNameListCtrl* mBulkAgentList;
LLButton* mOKButton;
LLButton* mAddButton;
LLButton* mRemoveButton;
LLTextBox* mGroupName;