2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Moved ConfirmBox to Ui namespace.

This commit is contained in:
23rd
2021-10-19 01:28:08 +03:00
parent 6148edbc7d
commit 80461bd9fe
88 changed files with 352 additions and 285 deletions

View File

@@ -504,7 +504,7 @@ bool MainWidget::setForwardDraft(PeerId peerId, Data::ForwardDraft &&draft) {
session().data().idsToItems(draft.ids),
true);
if (!error.isEmpty()) {
Ui::show(Box<InformBox>(error), Ui::LayerOption::KeepOther);
Ui::show(Box<Ui::InformBox>(error), Ui::LayerOption::KeepOther);
return false;
}
@@ -525,7 +525,7 @@ bool MainWidget::shareUrl(
const auto peer = session().data().peer(peerId);
if (!peer->canWrite()) {
Ui::show(Box<InformBox>(tr::lng_share_cant(tr::now)));
Ui::show(Box<Ui::InformBox>(tr::lng_share_cant(tr::now)));
return false;
}
TextWithTags textWithTags = {
@@ -555,7 +555,7 @@ bool MainWidget::inlineSwitchChosen(PeerId peerId, const QString &botAndQuery) {
const auto peer = session().data().peer(peerId);
if (!peer->canWrite()) {
Ui::show(Box<InformBox>(tr::lng_inline_switch_cant(tr::now)));
Ui::show(Box<Ui::InformBox>(tr::lng_inline_switch_cant(tr::now)));
return false;
}
const auto h = peer->owner().history(peer);
@@ -578,12 +578,13 @@ bool MainWidget::sendPaths(PeerId peerId) {
auto peer = session().data().peer(peerId);
if (!peer->canWrite()) {
Ui::show(Box<InformBox>(tr::lng_forward_send_files_cant(tr::now)));
Ui::show(Box<Ui::InformBox>(
tr::lng_forward_send_files_cant(tr::now)));
return false;
} else if (const auto error = Data::RestrictionError(
peer,
ChatRestriction::SendMedia)) {
Ui::show(Box<InformBox>(*error));
Ui::show(Box<Ui::InformBox>(*error));
return false;
}
Ui::showPeerHistory(peer, ShowAtTheEndMsgId);
@@ -609,7 +610,8 @@ void MainWidget::onFilesOrForwardDrop(
} else {
auto peer = session().data().peer(peerId);
if (!peer->canWrite()) {
Ui::show(Box<InformBox>(tr::lng_forward_send_files_cant(tr::now)));
Ui::show(Box<Ui::InformBox>(
tr::lng_forward_send_files_cant(tr::now)));
return;
}
Ui::showPeerHistory(peer, ShowAtTheEndMsgId);
@@ -726,10 +728,13 @@ void MainWidget::showSendPathsLayer() {
void MainWidget::deletePhotoLayer(PhotoData *photo) {
if (!photo) return;
Ui::show(Box<ConfirmBox>(tr::lng_delete_photo_sure(tr::now), tr::lng_box_delete(tr::now), crl::guard(this, [=] {
session().api().clearPeerPhoto(photo);
Ui::hideLayer();
})));
Ui::show(Box<Ui::ConfirmBox>(
tr::lng_delete_photo_sure(tr::now),
tr::lng_box_delete(tr::now),
crl::guard(this, [=] {
session().api().clearPeerPhoto(photo);
Ui::hideLayer();
})));
}
void MainWidget::shareUrlLayer(const QString &url, const QString &text) {
@@ -1266,7 +1271,7 @@ void MainWidget::ui_showPeerHistory(
const auto unavailable = peer->computeUnavailableReason();
if (!unavailable.isEmpty()) {
if (params.activation != anim::activation::background) {
Ui::show(Box<InformBox>(unavailable));
Ui::show(Box<Ui::InformBox>(unavailable));
}
return;
}
@@ -1989,7 +1994,7 @@ void MainWidget::hideAll() {
void MainWidget::showAll() {
if (cPasswordRecovered()) {
cSetPasswordRecovered(false);
Ui::show(Box<InformBox>(tr::lng_cloud_password_updated(tr::now)));
Ui::show(Box<Ui::InformBox>(tr::lng_cloud_password_updated(tr::now)));
}
if (isOneColumn()) {
_sideShadow->hide();
@@ -2542,7 +2547,7 @@ void MainWidget::activate() {
_controller,
path.mid(interpret.size()));
if (!error.isEmpty()) {
Ui::show(Box<InformBox>(error));
Ui::show(Box<Ui::InformBox>(error));
}
} else {
showSendPathsLayer();