mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 22:57:11 +02:00
Delegated display of DeleteLinkBox to caller.
This commit is contained in:
parent
5ddb9f9097
commit
b18d665fbe
3 changed files with 9 additions and 10 deletions
|
@ -357,7 +357,9 @@ void Controller::addHeaderBlock(not_null<Ui::VerticalLayout*> container) {
|
|||
EditLink(_peer, _data.current());
|
||||
});
|
||||
const auto deleteLink = crl::guard(weak, [=] {
|
||||
DeleteLink(_peer, admin, link);
|
||||
delegate()->peerListShowBox(
|
||||
DeleteLinkBox(_peer, admin, link),
|
||||
Ui::LayerOption::KeepOther);
|
||||
});
|
||||
|
||||
const auto createMenu = [=] {
|
||||
|
@ -1276,7 +1278,7 @@ void RevokeLink(
|
|||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
void DeleteLink(
|
||||
object_ptr<Ui::BoxContent> DeleteLinkBox(
|
||||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> admin,
|
||||
const QString &link) {
|
||||
|
@ -1287,12 +1289,7 @@ void DeleteLink(
|
|||
link,
|
||||
std::move(close));
|
||||
};
|
||||
Ui::show(
|
||||
Ui::MakeConfirmBox({
|
||||
tr::lng_group_invite_delete_sure(),
|
||||
sure
|
||||
}),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return Ui::MakeConfirmBox({ tr::lng_group_invite_delete_sure(), sure });
|
||||
}
|
||||
|
||||
object_ptr<Ui::BoxContent> ShowInviteLinkBox(
|
||||
|
|
|
@ -44,7 +44,7 @@ void RevokeLink(
|
|||
void EditLink(
|
||||
not_null<PeerData*> peer,
|
||||
const Api::InviteLink &data);
|
||||
void DeleteLink(
|
||||
[[nodiscard]] object_ptr<Ui::BoxContent> DeleteLinkBox(
|
||||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> admin,
|
||||
const QString &link);
|
||||
|
|
|
@ -579,7 +579,9 @@ base::unique_qptr<Ui::PopupMenu> LinksController::createRowContextMenu(
|
|||
st::popupMenuWithIcons);
|
||||
if (data.revoked) {
|
||||
result->addAction(tr::lng_group_invite_context_delete(tr::now), [=] {
|
||||
DeleteLink(_peer, _admin, link);
|
||||
delegate()->peerListShowBox(
|
||||
DeleteLinkBox(_peer, _admin, link),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}, &st::menuIconDelete);
|
||||
} else {
|
||||
result->addAction(tr::lng_group_invite_context_copy(tr::now), [=] {
|
||||
|
|
Loading…
Add table
Reference in a new issue