mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Moved ConfirmBox to Ui namespace.
This commit is contained in:
@@ -237,7 +237,7 @@ void Widget::handleUpdate(const MTPUpdate &update) {
|
||||
qs(data.vmessage()),
|
||||
Api::EntitiesFromMTP(nullptr, data.ventities().v)
|
||||
};
|
||||
Ui::show(Box<InformBox>(text));
|
||||
Ui::show(Box<Ui::InformBox>(text));
|
||||
}, [](const auto &) {});
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ void Widget::resetAccount() {
|
||||
return;
|
||||
}
|
||||
|
||||
Ui::show(Box<ConfirmBox>(tr::lng_signin_sure_reset(tr::now), tr::lng_signin_reset(tr::now), st::attentionBoxButton, crl::guard(this, [this] {
|
||||
const auto callback = crl::guard(this, [this] {
|
||||
if (_resetRequest) {
|
||||
return;
|
||||
}
|
||||
@@ -512,7 +512,8 @@ void Widget::resetAccount() {
|
||||
|
||||
const auto &type = error.type();
|
||||
if (type.startsWith(qstr("2FA_CONFIRM_WAIT_"))) {
|
||||
const auto seconds = type.midRef(qstr("2FA_CONFIRM_WAIT_").size()).toInt();
|
||||
const auto seconds = type.midRef(
|
||||
qstr("2FA_CONFIRM_WAIT_").size()).toInt();
|
||||
const auto days = (seconds + 59) / 86400;
|
||||
const auto hours = ((seconds + 59) % 86400) / 3600;
|
||||
const auto minutes = ((seconds + 59) % 3600) / 60;
|
||||
@@ -549,21 +550,27 @@ void Widget::resetAccount() {
|
||||
lt_minutes_count,
|
||||
when);
|
||||
}
|
||||
Ui::show(Box<InformBox>(tr::lng_signin_reset_wait(
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_signin_reset_wait(
|
||||
tr::now,
|
||||
lt_phone_number,
|
||||
Ui::FormatPhone(getData()->phone),
|
||||
lt_when,
|
||||
when)));
|
||||
} else if (type == qstr("2FA_RECENT_CONFIRM")) {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_signin_reset_cancelled(tr::now)));
|
||||
} else {
|
||||
Ui::hideLayer();
|
||||
getStep()->showError(rpl::single(Lang::Hard::ServerError()));
|
||||
}
|
||||
}).send();
|
||||
})));
|
||||
});
|
||||
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_signin_sure_reset(tr::now),
|
||||
tr::lng_signin_reset(tr::now),
|
||||
st::attentionBoxButton,
|
||||
callback));
|
||||
}
|
||||
|
||||
void Widget::getNearestDC() {
|
||||
|
Reference in New Issue
Block a user