mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-17 22:57:11 +02:00
Moved ConfirmBox to Ui namespace.
This commit is contained in:
parent
6148edbc7d
commit
80461bd9fe
88 changed files with 352 additions and 285 deletions
|
@ -37,7 +37,7 @@ void AttachedStickers::request(
|
|||
}
|
||||
if (result.v.isEmpty()) {
|
||||
strongController->show(
|
||||
Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||
return;
|
||||
} else if (result.v.size() > 1) {
|
||||
strongController->show(
|
||||
|
@ -63,7 +63,7 @@ void AttachedStickers::request(
|
|||
_requestId = 0;
|
||||
if (const auto strongController = weak.get()) {
|
||||
strongController->show(
|
||||
Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ void SendBotCallbackData(
|
|||
result.match([&](const MTPDmessages_botCallbackAnswer &data) {
|
||||
if (const auto message = data.vmessage()) {
|
||||
if (data.is_alert()) {
|
||||
Ui::show(Box<InformBox>(qs(*message)));
|
||||
Ui::show(Box<Ui::InformBox>(qs(*message)));
|
||||
} else {
|
||||
if (withPassword) {
|
||||
Ui::hideLayer();
|
||||
|
|
|
@ -86,7 +86,7 @@ void CheckChatInvite(
|
|||
Core::App().hideMediaView();
|
||||
if (const auto strong = weak.get()) {
|
||||
strong->show(
|
||||
Box<InformBox>(tr::lng_group_invite_bad_link(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_group_invite_bad_link(tr::now)));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ void ConfirmPhone::resolve(
|
|||
)).done([=](const MTPBool &result) {
|
||||
_checkRequestId = 0;
|
||||
controller->show(
|
||||
Box<InformBox>(
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_confirm_phone_success(
|
||||
tr::now,
|
||||
lt_phone,
|
||||
|
@ -117,7 +117,7 @@ void ConfirmPhone::resolve(
|
|||
? tr::lng_confirm_phone_link_invalid(tr::now)
|
||||
: Lang::Hard::ServerError();
|
||||
controller->show(
|
||||
Box<InformBox>(errorText),
|
||||
Box<Ui::InformBox>(errorText),
|
||||
Ui::LayerOption::CloseOther);
|
||||
}).handleFloodErrors().send();
|
||||
}
|
||||
|
|
|
@ -149,7 +149,8 @@ void EditMessageWithUploadedMedia(
|
|||
session->data().sendHistoryChangeNotifications();
|
||||
if (mediaInvalid) {
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_edit_media_invalid_file(tr::now)),
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_edit_media_invalid_file(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1976,7 +1976,7 @@ void Updates::feedUpdate(const MTPUpdate &update) {
|
|||
} else if (d.is_popup()) {
|
||||
const auto &windows = session().windows();
|
||||
if (!windows.empty()) {
|
||||
windows.front()->window().show(Box<InformBox>(text));
|
||||
windows.front()->window().show(Box<Ui::InformBox>(text));
|
||||
}
|
||||
} else {
|
||||
session().data().serviceNotification(text, d.vmedia());
|
||||
|
|
|
@ -394,9 +394,9 @@ void ApiWrap::importChatInvite(const QString &hash) {
|
|||
}).fail([=](const MTP::Error &error) {
|
||||
const auto &type = error.type();
|
||||
if (type == qstr("CHANNELS_TOO_MUCH")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_join_channel_error(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_join_channel_error(tr::now)));
|
||||
} else if (error.code() == 400) {
|
||||
Ui::show(Box<InformBox>((type == qstr("USERS_TOO_MUCH"))
|
||||
Ui::show(Box<Ui::InformBox>((type == qstr("USERS_TOO_MUCH"))
|
||||
? tr::lng_group_invite_no_room(tr::now)
|
||||
: tr::lng_group_invite_bad_link(tr::now)));
|
||||
}
|
||||
|
@ -468,13 +468,13 @@ void ApiWrap::sendMessageFail(
|
|||
uint64 randomId,
|
||||
FullMsgId itemId) {
|
||||
if (error.type() == qstr("PEER_FLOOD")) {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
PeerFloodErrorText(&session(), PeerFloodType::Send)));
|
||||
} else if (error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
|
||||
const auto link = textcmdLink(
|
||||
session().createInternalLinkFull(qsl("spambot")),
|
||||
tr::lng_cant_more_info(tr::now));
|
||||
Ui::show(Box<InformBox>(tr::lng_error_public_groups_denied(
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_error_public_groups_denied(
|
||||
tr::now,
|
||||
lt_more_info,
|
||||
link)));
|
||||
|
@ -495,7 +495,7 @@ void ApiWrap::sendMessageFail(
|
|||
Assert(peer->isUser());
|
||||
if (const auto item = scheduled.lookupItem(peer->id, itemId.msg)) {
|
||||
scheduled.removeSending(item);
|
||||
Ui::show(Box<InformBox>(tr::lng_cant_do_this(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_cant_do_this(tr::now)));
|
||||
}
|
||||
}
|
||||
if (const auto item = _session->data().message(itemId)) {
|
||||
|
@ -1253,7 +1253,7 @@ void ApiWrap::migrateDone(
|
|||
void ApiWrap::migrateFail(not_null<PeerData*> peer, const MTP::Error &error) {
|
||||
const auto &type = error.type();
|
||||
if (type == qstr("CHANNELS_TOO_MUCH")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_migrate_error(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_migrate_error(tr::now)));
|
||||
}
|
||||
if (auto handlers = _migrateCallbacks.take(peer)) {
|
||||
for (auto &handler : *handlers) {
|
||||
|
@ -2086,13 +2086,14 @@ void ApiWrap::joinChannel(not_null<ChannelData*> channel) {
|
|||
} else if (error.type() == qstr("CHANNEL_PRIVATE")
|
||||
|| error.type() == qstr("CHANNEL_PUBLIC_GROUP_NA")
|
||||
|| error.type() == qstr("USER_BANNED_IN_CHANNEL")) {
|
||||
Ui::show(Box<InformBox>(channel->isMegagroup()
|
||||
Ui::show(Box<Ui::InformBox>(channel->isMegagroup()
|
||||
? tr::lng_group_not_accessible(tr::now)
|
||||
: tr::lng_channel_not_accessible(tr::now)));
|
||||
} else if (error.type() == qstr("CHANNELS_TOO_MUCH")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_join_channel_error(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_join_channel_error(tr::now)));
|
||||
} else if (error.type() == qstr("USERS_TOO_MUCH")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_group_full(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_group_full(tr::now)));
|
||||
}
|
||||
_channelAmInRequests.remove(channel);
|
||||
}).send();
|
||||
|
|
|
@ -104,7 +104,8 @@ void AboutBox::showVersionHistory() {
|
|||
|
||||
QGuiApplication::clipboard()->setText(url);
|
||||
|
||||
Ui::show(Box<InformBox>("The link to the current private alpha version of Telegram Desktop was copied to the clipboard."));
|
||||
Ui::show(Box<Ui::InformBox>("The link to the current private alpha "
|
||||
"version of Telegram Desktop was copied to the clipboard."));
|
||||
} else {
|
||||
UrlClickHandler::Open(Core::App().changelogLink());
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ void ShowAddParticipantsError(
|
|||
*weak = Ui::show(std::move(box));
|
||||
};
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_cant_invite_offer_admin(tr::now),
|
||||
tr::lng_cant_invite_make_admin(tr::now),
|
||||
tr::lng_cancel(tr::now),
|
||||
|
@ -195,7 +195,7 @@ void ShowAddParticipantsError(
|
|||
}
|
||||
return tr::lng_failed_add_participant(tr::now);
|
||||
}();
|
||||
Ui::show(Box<InformBox>(text), Ui::LayerOption::KeepOther);
|
||||
Ui::show(Box<Ui::InformBox>(text), Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
class RevokePublicLinkBox::Inner : public TWidget {
|
||||
|
@ -641,18 +641,18 @@ void GroupInfoBox::createGroup(
|
|||
}
|
||||
} else if (error.type() == qstr("USERS_TOO_FEW")) {
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_cant_invite_privacy(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_cant_invite_privacy(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
} else if (error.type() == qstr("PEER_FLOOD")) {
|
||||
Ui::show(
|
||||
Box<InformBox>(
|
||||
Box<Ui::InformBox>(
|
||||
PeerFloodErrorText(
|
||||
&_navigation->session(),
|
||||
PeerFloodType::InviteGroup)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
} else if (error.type() == qstr("USER_RESTRICTED")) {
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_cant_do_this(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_cant_do_this(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
}).send();
|
||||
|
@ -759,9 +759,9 @@ void GroupInfoBox::createChannel(
|
|||
_title->setFocus();
|
||||
_title->showError();
|
||||
} else if (error.type() == qstr("USER_RESTRICTED")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_cant_do_this(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_cant_do_this(tr::now)));
|
||||
} else if (error.type() == qstr("CHANNELS_TOO_MUCH")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_cant_do_this(tr::now))); // TODO
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_cant_do_this(tr::now))); // TODO
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
@ -1598,7 +1598,7 @@ void RevokePublicLinkBox::Inner::mouseReleaseEvent(QMouseEvent *e) {
|
|||
}).send();
|
||||
});
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(text, confirmText, std::move(callback)),
|
||||
Box<Ui::ConfirmBox>(text, confirmText, std::move(callback)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "base/timer.h"
|
||||
#include "mtproto/sender.h"
|
||||
|
||||
class ConfirmBox;
|
||||
class PeerListBox;
|
||||
|
||||
namespace Window {
|
||||
|
@ -23,6 +22,7 @@ class Session;
|
|||
} // namespace Main
|
||||
|
||||
namespace Ui {
|
||||
class ConfirmBox;
|
||||
class FlatLabel;
|
||||
class InputField;
|
||||
class PhoneInput;
|
||||
|
|
|
@ -176,7 +176,7 @@ void BackgroundBox::removePaper(const Data::WallPaper &paper) {
|
|||
)).send();
|
||||
};
|
||||
_controller->show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_background_sure_delete(tr::now),
|
||||
tr::lng_selected_delete(tr::now),
|
||||
tr::lng_cancel(tr::now),
|
||||
|
|
|
@ -784,7 +784,7 @@ bool BackgroundPreviewBox::Start(
|
|||
}
|
||||
if (!IsValidWallPaperSlug(slug)) {
|
||||
controller->show(
|
||||
Box<InformBox>(tr::lng_background_bad_link(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_background_bad_link(tr::now)));
|
||||
return false;
|
||||
}
|
||||
controller->session().api().requestWallPaper(slug, crl::guard(controller, [=](
|
||||
|
@ -794,7 +794,7 @@ bool BackgroundPreviewBox::Start(
|
|||
result.withUrlParams(params)));
|
||||
}), crl::guard(controller, [=](const MTP::Error &error) {
|
||||
controller->show(
|
||||
Box<InformBox>(tr::lng_background_bad_link(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_background_bad_link(tr::now)));
|
||||
}));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ void ChangePhoneBox::EnterPhone::sendPhoneFail(const MTP::Error &error, const QS
|
|||
Ui::ShowPhoneBannedError(&_controller->window(), phoneNumber);
|
||||
} else if (error.type() == qstr("PHONE_NUMBER_OCCUPIED")) {
|
||||
_controller->show(
|
||||
Box<InformBox>(
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_change_phone_occupied(
|
||||
tr::now,
|
||||
lt_phone,
|
||||
|
@ -389,7 +389,7 @@ void ChangePhoneBox::prepare() {
|
|||
Ui::LayerOption::CloseOther);
|
||||
};
|
||||
controller->show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_change_phone_warning(tr::now),
|
||||
std::move(callback)),
|
||||
Ui::LayerOption::CloseOther);
|
||||
|
|
|
@ -1131,13 +1131,13 @@ void ProxiesBoxController::ShowApplyConfirmation(
|
|||
close();
|
||||
};
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_sure_enable(tr::now),
|
||||
std::move(callback)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
} else {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
(proxy.status() == ProxyData::Status::Unsupported
|
||||
? tr::lng_proxy_unsupported(tr::now)
|
||||
: tr::lng_proxy_invalid(tr::now))));
|
||||
|
|
|
@ -107,7 +107,7 @@ void StartPendingReset(
|
|||
auto finish = [=](const QString &message) mutable {
|
||||
if (const auto strong = weak.data()) {
|
||||
if (!message.isEmpty()) {
|
||||
strong->getDelegate()->show(Box<InformBox>(message));
|
||||
strong->getDelegate()->show(Box<Ui::InformBox>(message));
|
||||
}
|
||||
strong->closeBox();
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ void StartPendingReset(
|
|||
lt_count,
|
||||
minutes);
|
||||
if (const auto strong = weak.data()) {
|
||||
strong->getDelegate()->show(Box<InformBox>(
|
||||
strong->getDelegate()->show(Box<Ui::InformBox>(
|
||||
tr::lng_cloud_password_reset_later(
|
||||
tr::now,
|
||||
lt_duration,
|
||||
|
@ -440,7 +440,7 @@ void PasscodeBox::recoverPasswordDone(
|
|||
if (weak) {
|
||||
_newPasswordSet.fire_copy(newPasswordBytes);
|
||||
if (weak) {
|
||||
getDelegate()->show(Box<InformBox>(
|
||||
getDelegate()->show(Box<Ui::InformBox>(
|
||||
tr::lng_cloud_password_updated(tr::now)));
|
||||
if (weak) {
|
||||
closeBox();
|
||||
|
@ -462,7 +462,7 @@ void PasscodeBox::setPasswordDone(const QByteArray &newPasswordBytes) {
|
|||
: _oldPasscode->isHidden()
|
||||
? tr::lng_cloud_password_was_set(tr::now)
|
||||
: tr::lng_cloud_password_updated(tr::now);
|
||||
getDelegate()->show(Box<InformBox>(text));
|
||||
getDelegate()->show(Box<Ui::InformBox>(text));
|
||||
if (weak) {
|
||||
closeBox();
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ void PasscodeBox::validateEmail(
|
|||
const auto weak = Ui::MakeWeak(this);
|
||||
_clearUnconfirmedPassword.fire({});
|
||||
if (weak) {
|
||||
auto box = Box<InformBox>(
|
||||
auto box = Box<Ui::InformBox>(
|
||||
Lang::Hard::EmailConfirmationExpired());
|
||||
weak->getDelegate()->show(
|
||||
std::move(box),
|
||||
|
@ -689,7 +689,7 @@ void PasscodeBox::save(bool force) {
|
|||
if (!onlyCheck && !_recoverEmail->isHidden() && email.isEmpty() && !force) {
|
||||
_skipEmailWarning = true;
|
||||
_replacedBy = getDelegate()->show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_about_recover(tr::now),
|
||||
tr::lng_cloud_password_skip_email(tr::now),
|
||||
st::attentionBoxButton,
|
||||
|
@ -726,7 +726,7 @@ void PasscodeBox::submitOnlyCheckCloudPassword(const QString &oldPassword) {
|
|||
send();
|
||||
close();
|
||||
};
|
||||
getDelegate()->show(Box<ConfirmBox>(
|
||||
getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_passport_losing(tr::now),
|
||||
tr::lng_continue(tr::now),
|
||||
confirmed));
|
||||
|
@ -797,7 +797,7 @@ void PasscodeBox::requestPasswordData() {
|
|||
}
|
||||
|
||||
void PasscodeBox::serverError() {
|
||||
getDelegate()->show(Box<InformBox>(Lang::Hard::ServerError()));
|
||||
getDelegate()->show(Box<Ui::InformBox>(Lang::Hard::ServerError()));
|
||||
closeBox();
|
||||
}
|
||||
|
||||
|
@ -952,7 +952,7 @@ void PasscodeBox::suggestSecretReset(const QString &newPassword) {
|
|||
resetSecret(check, newPassword, std::move(close));
|
||||
});
|
||||
};
|
||||
getDelegate()->show(Box<ConfirmBox>(
|
||||
getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
Lang::Hard::PassportCorruptedChange(),
|
||||
Lang::Hard::PassportCorruptedReset(),
|
||||
std::move(resetSecretAndSave)));
|
||||
|
@ -1085,7 +1085,7 @@ void PasscodeBox::recoverByEmail() {
|
|||
}
|
||||
});
|
||||
});
|
||||
*confirmBox = getDelegate()->show(Box<ConfirmBox>(
|
||||
*confirmBox = getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_reset_no_email(tr::now),
|
||||
tr::lng_cloud_password_reset_ok(tr::now),
|
||||
reset));
|
||||
|
@ -1170,7 +1170,7 @@ RecoverBox::RecoverBox(
|
|||
}
|
||||
});
|
||||
});
|
||||
*confirmBox = getDelegate()->show(Box<ConfirmBox>(
|
||||
*confirmBox = getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_reset_with_email(tr::now),
|
||||
tr::lng_cloud_password_reset_ok(tr::now),
|
||||
reset));
|
||||
|
@ -1272,7 +1272,7 @@ void RecoverBox::submit() {
|
|||
send();
|
||||
close();
|
||||
};
|
||||
getDelegate()->show(Box<ConfirmBox>(
|
||||
getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_passport_losing(tr::now),
|
||||
tr::lng_continue(tr::now),
|
||||
confirmed));
|
||||
|
@ -1297,7 +1297,7 @@ void RecoverBox::proceedToClear() {
|
|||
_submitRequest = 0;
|
||||
_newPasswordSet.fire({});
|
||||
getDelegate()->show(
|
||||
Box<InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||
Ui::LayerOption::CloseOther);
|
||||
}
|
||||
|
||||
|
@ -1345,7 +1345,7 @@ void RecoverBox::checkSubmitFail(const MTP::Error &error) {
|
|||
if (err == qstr("PASSWORD_EMPTY")) {
|
||||
_newPasswordSet.fire(QByteArray());
|
||||
getDelegate()->show(
|
||||
Box<InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_cloud_password_removed(tr::now)),
|
||||
Ui::LayerOption::CloseOther);
|
||||
} else if (err == qstr("PASSWORD_RECOVERY_NA")) {
|
||||
closeBox();
|
||||
|
@ -1386,7 +1386,8 @@ RecoveryEmailValidation ConfirmRecoveryEmail(
|
|||
reloads->fire({});
|
||||
if (*weak) {
|
||||
(*weak)->getDelegate()->show(
|
||||
Box<InformBox>(tr::lng_cloud_password_was_set(tr::now)),
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_cloud_password_was_set(tr::now)),
|
||||
Ui::LayerOption::CloseOther);
|
||||
}
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
|
@ -1398,7 +1399,7 @@ RecoveryEmailValidation ConfirmRecoveryEmail(
|
|||
} else if (error.type() == qstr("EMAIL_HASH_EXPIRED")) {
|
||||
cancels->fire({});
|
||||
if (*weak) {
|
||||
auto box = Box<InformBox>(
|
||||
auto box = Box<Ui::InformBox>(
|
||||
Lang::Hard::EmailConfirmationExpired());
|
||||
(*weak)->getDelegate()->show(
|
||||
std::move(box),
|
||||
|
|
|
@ -482,7 +482,7 @@ void AddBotToGroupBoxController::shareBotGame(not_null<PeerData*> chat) {
|
|||
return tr::lng_bot_sure_share_game_group(tr::now, lt_group, chat->name);
|
||||
}();
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(confirmText, std::move(send)),
|
||||
Box<Ui::ConfirmBox>(confirmText, std::move(send)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
|
@ -490,7 +490,7 @@ void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
|
|||
if (const auto megagroup = chat->asMegagroup()) {
|
||||
if (!megagroup->canAddMembers()) {
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_error_cant_add_member(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_error_cant_add_member(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
|
@ -500,7 +500,7 @@ void AddBotToGroupBoxController::addBotToGroup(not_null<PeerData*> chat) {
|
|||
});
|
||||
auto confirmText = tr::lng_bot_sure_invite(tr::now, lt_group, chat->name);
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(confirmText, send),
|
||||
Box<Ui::ConfirmBox>(confirmText, send),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,8 @@ void AddParticipantsBoxController::rowClicked(not_null<PeerListRow*> row) {
|
|||
} else if (count >= serverConfig.chatSizeMax
|
||||
&& count < serverConfig.megagroupSizeMax) {
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_profile_add_more_after_create(tr::now)),
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_profile_add_more_after_create(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
}
|
||||
|
@ -566,20 +567,20 @@ void AddSpecialBoxController::showAdmin(
|
|||
if (canBanMembers) {
|
||||
if (!sure) {
|
||||
_editBox = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_sure_add_admin_unremove(tr::now),
|
||||
showAdminSure),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_error_cant_add_admin_unban(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_error_cant_add_admin_invite(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
|
@ -589,14 +590,14 @@ void AddSpecialBoxController::showAdmin(
|
|||
if (canBanMembers) {
|
||||
if (!sure) {
|
||||
_editBox = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_sure_add_admin_unremove(tr::now),
|
||||
showAdminSure),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_error_cant_add_admin_unban(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
|
@ -609,7 +610,7 @@ void AddSpecialBoxController::showAdmin(
|
|||
? tr::lng_sure_add_admin_invite
|
||||
: tr::lng_sure_add_admin_invite_channel)(tr::now);
|
||||
_editBox = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
showAdminSure),
|
||||
Ui::LayerOption::KeepOther);
|
||||
|
@ -617,7 +618,8 @@ void AddSpecialBoxController::showAdmin(
|
|||
}
|
||||
} else {
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_error_cant_add_admin_invite(tr::now)),
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_error_cant_add_admin_invite(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
|
@ -717,7 +719,7 @@ void AddSpecialBoxController::showRestricted(
|
|||
if (!_additional.isCreator(user) && _additional.canEditAdmin(user)) {
|
||||
if (!sure) {
|
||||
_editBox = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_sure_ban_admin(tr::now),
|
||||
showRestrictedSure),
|
||||
Ui::LayerOption::KeepOther);
|
||||
|
@ -725,7 +727,7 @@ void AddSpecialBoxController::showRestricted(
|
|||
}
|
||||
} else {
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_error_cant_ban_admin(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_error_cant_ban_admin(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
|
@ -814,7 +816,7 @@ void AddSpecialBoxController::kickUser(
|
|||
if (!_additional.isCreator(user) && _additional.canEditAdmin(user)) {
|
||||
if (!sure) {
|
||||
_editBox = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_sure_ban_admin(tr::now),
|
||||
kickUserSure),
|
||||
Ui::LayerOption::KeepOther);
|
||||
|
@ -822,7 +824,7 @@ void AddSpecialBoxController::kickUser(
|
|||
}
|
||||
} else {
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_error_cant_ban_admin(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_error_cant_ban_admin(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
|
@ -837,7 +839,7 @@ void AddSpecialBoxController::kickUser(
|
|||
lt_user,
|
||||
participant->name);
|
||||
_editBox = Ui::show(
|
||||
Box<ConfirmBox>(text, kickUserSure),
|
||||
Box<Ui::ConfirmBox>(text, kickUserSure),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ void Controller::choose(not_null<ChannelData*> chat) {
|
|||
onstack(chat);
|
||||
};
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_manage_discussion_group_link(tr::now),
|
||||
sure),
|
||||
|
@ -184,7 +184,7 @@ void Controller::choose(not_null<ChatData*> chat) {
|
|||
chat->session().api().migrateChat(chat, crl::guard(this, done));
|
||||
};
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_manage_discussion_group_link(tr::now),
|
||||
sure),
|
||||
|
|
|
@ -453,14 +453,14 @@ void EditAdminBox::transferOwnership() {
|
|||
)).fail([=](const MTP::Error &error) {
|
||||
_checkTransferRequestId = 0;
|
||||
if (!handleTransferPasswordError(error)) {
|
||||
const auto box = std::make_shared<QPointer<ConfirmBox>>();
|
||||
const auto box = std::make_shared<QPointer<Ui::ConfirmBox>>();
|
||||
const auto callback = crl::guard(this, [=] {
|
||||
transferOwnershipChecked();
|
||||
if (*box) {
|
||||
(*box)->closeBox();
|
||||
}
|
||||
});
|
||||
*box = getDelegate()->show(Box<ConfirmBox>(
|
||||
*box = getDelegate()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_rights_transfer_about(
|
||||
tr::now,
|
||||
lt_group,
|
||||
|
@ -577,7 +577,7 @@ void EditAdminBox::sendTransferRequestFrom(
|
|||
|| (type == qstr("SESSION_TOO_FRESH_XXX"));
|
||||
}();
|
||||
const auto weak = Ui::MakeWeak(this);
|
||||
getDelegate()->show(Box<InformBox>(problem));
|
||||
getDelegate()->show(Box<Ui::InformBox>(problem));
|
||||
if (box) {
|
||||
box->closeBox();
|
||||
}
|
||||
|
|
|
@ -1691,7 +1691,7 @@ void ParticipantsBoxController::kickParticipant(not_null<PeerData*> participant)
|
|||
lt_user,
|
||||
user ? user->firstName : participant->name);
|
||||
_editBox = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_box_remove(tr::now),
|
||||
crl::guard(this, [=] { kickParticipantSure(participant); })),
|
||||
|
@ -1730,7 +1730,7 @@ void ParticipantsBoxController::kickParticipantSure(
|
|||
|
||||
void ParticipantsBoxController::removeAdmin(not_null<UserData*> user) {
|
||||
_editBox = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_profile_sure_remove_admin(
|
||||
tr::now,
|
||||
lt_user,
|
||||
|
|
|
@ -1485,7 +1485,7 @@ void Controller::deleteWithConfirmation() {
|
|||
deleteChannel();
|
||||
});
|
||||
_navigation->parentController()->show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_box_delete(tr::now),
|
||||
st::attentionBoxButton,
|
||||
|
@ -1512,7 +1512,7 @@ void Controller::deleteChannel() {
|
|||
session->api().applyUpdates(result);
|
||||
//}).fail([=](const MTP::Error &error) {
|
||||
// if (error.type() == qstr("CHANNEL_TOO_LARGE")) {
|
||||
// Ui::show(Box<InformBox>(tr::lng_cant_delete_channel(tr::now)));
|
||||
// Ui::show(Box<Ui::InformBox>(tr::lng_cant_delete_channel(tr::now)));
|
||||
// }
|
||||
}).send();
|
||||
}
|
||||
|
|
|
@ -680,7 +680,7 @@ void AddPermanentLinkBlock(
|
|||
}
|
||||
});
|
||||
const auto revokeLink = crl::guard(weak, [=] {
|
||||
const auto box = std::make_shared<QPointer<ConfirmBox>>();
|
||||
const auto box = std::make_shared<QPointer<Ui::ConfirmBox>>();
|
||||
const auto done = crl::guard(weak, [=] {
|
||||
const auto close = [=] {
|
||||
if (*box) {
|
||||
|
@ -694,7 +694,9 @@ void AddPermanentLinkBlock(
|
|||
close);
|
||||
});
|
||||
*box = Ui::show(
|
||||
Box<ConfirmBox>(tr::lng_group_invite_about_new(tr::now), done),
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_group_invite_about_new(tr::now),
|
||||
done),
|
||||
Ui::LayerOption::KeepOther);
|
||||
});
|
||||
|
||||
|
@ -868,7 +870,7 @@ void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
|
|||
}
|
||||
text.append(error.first);
|
||||
Ui::show(
|
||||
Box<InformBox>(text),
|
||||
Box<Ui::InformBox>(text),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
|
@ -968,7 +970,7 @@ void RevokeLink(
|
|||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> admin,
|
||||
const QString &link) {
|
||||
const auto box = std::make_shared<QPointer<ConfirmBox>>();
|
||||
const auto box = std::make_shared<QPointer<Ui::ConfirmBox>>();
|
||||
const auto revoke = [=] {
|
||||
const auto done = [=](const LinkData &data) {
|
||||
if (*box) {
|
||||
|
@ -978,7 +980,7 @@ void RevokeLink(
|
|||
peer->session().api().inviteLinks().revoke(peer, admin, link, done);
|
||||
};
|
||||
*box = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_group_invite_revoke_about(tr::now),
|
||||
revoke),
|
||||
Ui::LayerOption::KeepOther);
|
||||
|
@ -988,7 +990,7 @@ void DeleteLink(
|
|||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> admin,
|
||||
const QString &link) {
|
||||
const auto box = std::make_shared<QPointer<ConfirmBox>>();
|
||||
const auto box = std::make_shared<QPointer<Ui::ConfirmBox>>();
|
||||
const auto sure = [=] {
|
||||
const auto finish = [=] {
|
||||
if (*box) {
|
||||
|
@ -1002,7 +1004,7 @@ void DeleteLink(
|
|||
finish);
|
||||
};
|
||||
*box = Ui::show(
|
||||
Box<ConfirmBox>(tr::lng_group_invite_delete_sure(tr::now), sure),
|
||||
Box<Ui::ConfirmBox>(tr::lng_group_invite_delete_sure(tr::now), sure),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ private:
|
|||
void DeleteAllRevoked(
|
||||
not_null<PeerData*> peer,
|
||||
not_null<UserData*> admin) {
|
||||
const auto box = std::make_shared<QPointer<ConfirmBox>>();
|
||||
const auto box = std::make_shared<QPointer<Ui::ConfirmBox>>();
|
||||
const auto sure = [=] {
|
||||
const auto finish = [=] {
|
||||
if (*box) {
|
||||
|
@ -210,7 +210,9 @@ void DeleteAllRevoked(
|
|||
finish);
|
||||
};
|
||||
*box = Ui::show(
|
||||
Box<ConfirmBox>(tr::lng_group_invite_delete_all_sure(tr::now), sure),
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_group_invite_delete_all_sure(tr::now),
|
||||
sure),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ void ShowPhoneBannedError(
|
|||
}
|
||||
};
|
||||
*box = controller->show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_signin_banned_text(tr::now),
|
||||
tr::lng_box_ok(tr::now),
|
||||
tr::lng_signin_banned_help(tr::now),
|
||||
|
|
|
@ -81,7 +81,7 @@ private:
|
|||
Full _data;
|
||||
|
||||
object_ptr<Inner> _inner;
|
||||
QPointer<ConfirmBox> _terminateBox;
|
||||
QPointer<Ui::ConfirmBox> _terminateBox;
|
||||
|
||||
base::Timer _shortPollTimer;
|
||||
|
||||
|
@ -250,7 +250,7 @@ void SessionsContent::terminate(Fn<void()> terminateRequest, QString message) {
|
|||
terminateRequest();
|
||||
});
|
||||
_terminateBox = Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
message,
|
||||
tr::lng_settings_reset_button(tr::now),
|
||||
st::attentionBoxButton,
|
||||
|
|
|
@ -1155,7 +1155,8 @@ void ShareGameScoreByHash(
|
|||
|
||||
auto hashEncrypted = QByteArray::fromBase64(hash.toLatin1(), QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
||||
if (hashEncrypted.size() <= key128Size || (hashEncrypted.size() != key128Size + 0x20)) {
|
||||
Ui::show(Box<InformBox>(tr::lng_confirm_phone_link_invalid(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_confirm_phone_link_invalid(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1175,19 +1176,19 @@ void ShareGameScoreByHash(
|
|||
//// Check next 64 bits of SHA1() of data.
|
||||
//auto skipSha1Part = sizeof(channelAccessHash);
|
||||
//if (memcmp(dataSha1 + skipSha1Part, hashEncrypted.constData() + skipSha1Part, key128Size - skipSha1Part) != 0) {
|
||||
// Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
// Ui::show(Box<Ui::InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
// return;
|
||||
//}
|
||||
|
||||
// Check 128 bits of SHA1() of data.
|
||||
if (memcmp(dataSha1, hashEncrypted.constData(), key128Size) != 0) {
|
||||
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
auto hashDataInts = reinterpret_cast<uint64*>(hashData.data());
|
||||
if (hashDataInts[0] != session->userId().bare) {
|
||||
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1195,14 +1196,14 @@ void ShareGameScoreByHash(
|
|||
auto channelAccessHash = hashDataInts[3];
|
||||
//auto channelAccessHashInts = reinterpret_cast<int32*>(&channelAccessHash);
|
||||
//if (channelAccessHashInts[0] != hashDataInts[3]) {
|
||||
// Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
// Ui::show(Box<Ui::InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (((hashDataInts[1] >> 40) != 0)
|
||||
|| (!hashDataInts[1] && channelAccessHash)) {
|
||||
// If there is no channel id, there should be no channel access_hash.
|
||||
Ui::show(Box<InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_share_wrong_user(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1218,7 +1219,8 @@ void ShareGameScoreByHash(
|
|||
if (const auto item = session->data().message(channel, msgId)) {
|
||||
FastShareMessage(item);
|
||||
} else {
|
||||
Ui::show(Box<InformBox>(tr::lng_edit_deleted(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_deleted(tr::now)));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -257,7 +257,7 @@ void StickerSetBox::handleError(Error error) {
|
|||
switch (error) {
|
||||
case Error::NotFound:
|
||||
_controller->show(
|
||||
Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||
break;
|
||||
default: Unexpected("Error in StickerSetBox::handleError.");
|
||||
}
|
||||
|
|
|
@ -11,13 +11,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "base/timer.h"
|
||||
#include "data/stickers/data_stickers.h"
|
||||
|
||||
class ConfirmBox;
|
||||
|
||||
namespace Window {
|
||||
class SessionController;
|
||||
} // namespace Window
|
||||
|
||||
namespace Ui {
|
||||
class ConfirmBox;
|
||||
class PlainShadow;
|
||||
} // namespace Ui
|
||||
|
||||
|
|
|
@ -14,13 +14,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/effects/animations.h"
|
||||
#include "ui/special_fields.h"
|
||||
|
||||
class ConfirmBox;
|
||||
|
||||
namespace style {
|
||||
struct RippleAnimation;
|
||||
} // namespace style
|
||||
|
||||
namespace Ui {
|
||||
class ConfirmBox;
|
||||
class PlainShadow;
|
||||
class RippleAnimation;
|
||||
class SettingsSlider;
|
||||
|
|
|
@ -1152,23 +1152,28 @@ void Call::setFailedQueued(const QString &error) {
|
|||
|
||||
void Call::handleRequestError(const MTP::Error &error) {
|
||||
if (error.type() == qstr("USER_PRIVACY_RESTRICTED")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_call_error_not_available(tr::now, lt_user, _user->name)));
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_call_error_not_available(tr::now, lt_user, _user->name)));
|
||||
} else if (error.type() == qstr("PARTICIPANT_VERSION_OUTDATED")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_call_error_outdated(tr::now, lt_user, _user->name)));
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_call_error_outdated(tr::now, lt_user, _user->name)));
|
||||
} else if (error.type() == qstr("CALL_PROTOCOL_LAYER_INVALID")) {
|
||||
Ui::show(Box<InformBox>(Lang::Hard::CallErrorIncompatible().replace("{user}", _user->name)));
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
Lang::Hard::CallErrorIncompatible().replace(
|
||||
"{user}",
|
||||
_user->name)));
|
||||
}
|
||||
finish(FinishType::Failed);
|
||||
}
|
||||
|
||||
void Call::handleControllerError(const QString &error) {
|
||||
if (error == u"ERROR_INCOMPATIBLE"_q) {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
Lang::Hard::CallErrorIncompatible().replace(
|
||||
"{user}",
|
||||
_user->name)));
|
||||
} else if (error == u"ERROR_AUDIO_IO"_q) {
|
||||
Ui::show(Box<InformBox>(tr::lng_call_error_audio_io(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_call_error_audio_io(tr::now)));
|
||||
}
|
||||
finish(FinishType::Failed);
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ void Instance::startOutgoingCall(not_null<UserData*> user, bool video) {
|
|||
if (user->callsStatus() == UserData::CallsStatus::Private) {
|
||||
// Request full user once more to refresh the setting in case it was changed.
|
||||
user->session().api().requestFullPeer(user);
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_call_error_not_available(tr::now, lt_user, user->name)));
|
||||
return;
|
||||
}
|
||||
|
@ -695,10 +695,13 @@ void Instance::requestPermissionOrFail(Platform::PermissionType type, Fn<void()>
|
|||
if (inGroupCall()) {
|
||||
_currentGroupCall->hangup();
|
||||
}
|
||||
Ui::show(Box<ConfirmBox>(tr::lng_no_mic_permission(tr::now), tr::lng_menu_settings(tr::now), crl::guard(this, [=] {
|
||||
Platform::OpenSystemSettingsForPermission(type);
|
||||
Ui::hideLayer();
|
||||
})));
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_no_mic_permission(tr::now),
|
||||
tr::lng_menu_settings(tr::now),
|
||||
crl::guard(this, [=] {
|
||||
Platform::OpenSystemSettingsForPermission(type);
|
||||
Ui::hideLayer();
|
||||
})));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3156,19 +3156,21 @@ void StickersListWidget::removeMegagroupSet(bool locally) {
|
|||
return;
|
||||
}
|
||||
_removingSetId = Data::Stickers::MegagroupSetId;
|
||||
controller()->show(Box<ConfirmBox>(tr::lng_stickers_remove_group_set(tr::now), crl::guard(this, [this, group = _megagroupSet] {
|
||||
Expects(group->mgInfo != nullptr);
|
||||
controller()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_stickers_remove_group_set(tr::now),
|
||||
crl::guard(this, [this, group = _megagroupSet] {
|
||||
Expects(group->mgInfo != nullptr);
|
||||
|
||||
if (group->mgInfo->stickerSet) {
|
||||
session().api().setGroupStickerSet(group, {});
|
||||
}
|
||||
Ui::hideLayer();
|
||||
_removingSetId = 0;
|
||||
_checkForHide.fire({});
|
||||
}), crl::guard(this, [this] {
|
||||
_removingSetId = 0;
|
||||
_checkForHide.fire({});
|
||||
})));
|
||||
if (group->mgInfo->stickerSet) {
|
||||
session().api().setGroupStickerSet(group, {});
|
||||
}
|
||||
Ui::hideLayer();
|
||||
_removingSetId = 0;
|
||||
_checkForHide.fire({});
|
||||
}), crl::guard(this, [this] {
|
||||
_removingSetId = 0;
|
||||
_checkForHide.fire({});
|
||||
})));
|
||||
}
|
||||
|
||||
void StickersListWidget::removeSet(uint64 setId) {
|
||||
|
@ -3184,7 +3186,7 @@ void StickersListWidget::removeSet(uint64 setId) {
|
|||
lt_sticker_pack,
|
||||
set->title);
|
||||
const auto confirm = tr::lng_stickers_remove_pack_confirm(tr::now);
|
||||
controller()->show(Box<ConfirmBox>(text, confirm, crl::guard(this, [=](
|
||||
controller()->show(Box<Ui::ConfirmBox>(text, confirm, crl::guard(this, [=](
|
||||
Fn<void()> &&close) {
|
||||
close();
|
||||
const auto &sets = session().data().stickers().sets();
|
||||
|
|
|
@ -345,7 +345,7 @@ void Application::showOpenGLCrashNotification() {
|
|||
Core::App().settings().setDisableOpenGL(true);
|
||||
Local::writeSettings();
|
||||
};
|
||||
_window->show(Box<ConfirmBox>(
|
||||
_window->show(Box<Ui::ConfirmBox>(
|
||||
"There may be a problem with your graphics drivers and OpenGL. "
|
||||
"Try updating your drivers.\n\n"
|
||||
"OpenGL has been disabled. You can try to enable it again "
|
||||
|
@ -537,7 +537,7 @@ void Application::badMtprotoConfigurationError() {
|
|||
_settings.proxy().selected(),
|
||||
MTP::ProxyData::Settings::System);
|
||||
};
|
||||
_badProxyDisableBox = Ui::show(Box<InformBox>(
|
||||
_badProxyDisableBox = Ui::show(Box<Ui::InformBox>(
|
||||
Lang::Hard::ProxyConfigError(),
|
||||
disableCallback));
|
||||
}
|
||||
|
@ -636,7 +636,7 @@ void Application::logout(Main::Account *account) {
|
|||
void Application::forceLogOut(
|
||||
not_null<Main::Account*> account,
|
||||
const TextWithEntities &explanation) {
|
||||
const auto box = Ui::show(Box<InformBox>(
|
||||
const auto box = Ui::show(Box<Ui::InformBox>(
|
||||
explanation,
|
||||
tr::lng_passcode_logout(tr::now)));
|
||||
box->setCloseByEscape(false);
|
||||
|
|
|
@ -91,7 +91,7 @@ void HiddenUrlClickHandler::Open(QString url, QVariant context) {
|
|||
? QString::fromUtf8(parsedUrl.toEncoded())
|
||||
: ShowEncoded(displayed);
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
(tr::lng_open_this_link(tr::now)
|
||||
+ qsl("\n\n")
|
||||
+ displayUrl),
|
||||
|
@ -125,7 +125,7 @@ void BotGameUrlClickHandler::onClick(ClickContext context) const {
|
|||
bot->session().local().markBotTrustedOpenGame(bot->id);
|
||||
open();
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_allow_bot_pass(tr::now, lt_bot_name, _bot->name),
|
||||
tr::lng_allow_bot(tr::now),
|
||||
callback));
|
||||
|
|
|
@ -412,12 +412,12 @@ bool HandleUnknown(
|
|||
Core::UpdateApplication();
|
||||
close();
|
||||
};
|
||||
controller->show(Box<ConfirmBox>(
|
||||
controller->show(Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_menu_update(tr::now),
|
||||
callback));
|
||||
} else {
|
||||
controller->show(Box<InformBox>(text));
|
||||
controller->show(Box<Ui::InformBox>(text));
|
||||
}
|
||||
});
|
||||
controller->session().api().requestDeepLinkInfo(request, callback);
|
||||
|
|
|
@ -224,7 +224,7 @@ void CloudThemes::resolve(
|
|||
showPreview(controller, result);
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
if (error.type() == qstr("THEME_FORMAT_INVALID")) {
|
||||
controller->show(Box<InformBox>(
|
||||
controller->show(Box<Ui::InformBox>(
|
||||
tr::lng_theme_no_desktop(tr::now)));
|
||||
}
|
||||
}).send();
|
||||
|
@ -249,7 +249,7 @@ void CloudThemes::showPreview(
|
|||
controller,
|
||||
cloud));
|
||||
} else {
|
||||
controller->show(Box<InformBox>(
|
||||
controller->show(Box<Ui::InformBox>(
|
||||
tr::lng_theme_no_desktop(tr::now)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -905,7 +905,7 @@ void DocumentData::handleLoaderUpdates() {
|
|||
Ui::hideLayer();
|
||||
save(origin, failedFileName);
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_download_finish_failed(tr::now),
|
||||
crl::guard(&session(), retry)));
|
||||
} else {
|
||||
|
@ -917,7 +917,7 @@ void DocumentData::handleLoaderUpdates() {
|
|||
// Core::App().settings().setDownloadPath(QString());
|
||||
// Ui::show(Box<DownloadPathBox>());
|
||||
//};
|
||||
//Ui::show(Box<ConfirmBox>(
|
||||
//Ui::show(Box<Ui::ConfirmBox>(
|
||||
// tr::lng_download_path_failed(tr::now),
|
||||
// tr::lng_download_path_settings(tr::now),
|
||||
// crl::guard(&session(), openSettings)));
|
||||
|
|
|
@ -80,7 +80,7 @@ void LaunchWithWarning(
|
|||
rpl::single(Ui::Text::Bold(extension)),
|
||||
Ui::Text::WithEntities)
|
||||
: tr::lng_launch_svg_warning(Ui::Text::WithEntities);
|
||||
Ui::show(Box<ConfirmDontWarnBox>(
|
||||
Ui::show(Box<Ui::ConfirmDontWarnBox>(
|
||||
std::move(text),
|
||||
tr::lng_launch_exe_dont_ask(tr::now),
|
||||
(isExecutable ? tr::lng_launch_exe_sure : tr::lng_continue)(),
|
||||
|
|
|
@ -646,7 +646,7 @@ void Histories::deleteAllMessages(
|
|||
session().api().applyUpdates(result);
|
||||
//}).fail([=](const MTP::Error &error) {
|
||||
// if (error.type() == qstr("CHANNEL_TOO_LARGE")) {
|
||||
// Ui::show(Box<InformBox>(tr::lng_cant_delete_channel(tr::now)));
|
||||
// Ui::show(Box<Ui::InformBox>(tr::lng_cant_delete_channel(tr::now)));
|
||||
// }
|
||||
}).send();
|
||||
} else if (channel) {
|
||||
|
|
|
@ -402,7 +402,7 @@ void Stickers::undoInstallLocally(uint64 setId) {
|
|||
notifyUpdated();
|
||||
|
||||
Ui::show(
|
||||
Box<InformBox>(tr::lng_stickers_not_found(tr::now)),
|
||||
Box<Ui::InformBox>(tr::lng_stickers_not_found(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ void Paint::handleMimeData(const QMimeData *data) {
|
|||
}
|
||||
if (!Ui::ValidateThumbDimensions(image.width(), image.height())) {
|
||||
_controllers->showBox(
|
||||
Box<InformBox>(tr::lng_edit_media_invalid_file(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_edit_media_invalid_file(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ void PrepareProfilePhoto(
|
|||
if (image.isNull()
|
||||
|| (image.width() > (10 * image.height()))
|
||||
|| (image.height() > (10 * image.width()))) {
|
||||
controller->show(Box<InformBox>(tr::lng_bad_photo(tr::now)));
|
||||
controller->show(Box<Ui::InformBox>(tr::lng_bad_photo(tr::now)));
|
||||
return;
|
||||
}
|
||||
image = resizeToMinSize(
|
||||
|
|
|
@ -271,7 +271,7 @@ void PanelController::showCriticalError(const QString &text) {
|
|||
}
|
||||
|
||||
void PanelController::showError(const QString &text) {
|
||||
auto box = Box<InformBox>(text);
|
||||
auto box = Box<Ui::InformBox>(text);
|
||||
const auto weak = Ui::MakeWeak(box.data());
|
||||
const auto hidden = _panel->isHidden();
|
||||
_panel->showBox(
|
||||
|
@ -347,7 +347,7 @@ void PanelController::stopWithConfirmation(FnMut<void()> callback) {
|
|||
};
|
||||
const auto hidden = _panel->isHidden();
|
||||
const auto old = _confirmStopBox;
|
||||
auto box = Box<ConfirmBox>(
|
||||
auto box = Box<Ui::ConfirmBox>(
|
||||
tr::lng_export_sure_stop(tr::now),
|
||||
tr::lng_export_stop(tr::now),
|
||||
st::attentionBoxButton,
|
||||
|
|
|
@ -140,7 +140,7 @@ void activateBotCommand(
|
|||
|
||||
case ButtonType::RequestLocation: {
|
||||
hideSingleUseKeyboard(msg);
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_bot_share_location_unavailable(tr::now)));
|
||||
} break;
|
||||
|
||||
|
@ -148,15 +148,18 @@ void activateBotCommand(
|
|||
hideSingleUseKeyboard(msg);
|
||||
const auto msgId = msg->id;
|
||||
const auto history = msg->history();
|
||||
Ui::show(Box<ConfirmBox>(tr::lng_bot_share_phone(tr::now), tr::lng_bot_share_phone_confirm(tr::now), [=] {
|
||||
Ui::showPeerHistory(history, ShowAtTheEndMsgId);
|
||||
auto action = Api::SendAction(history);
|
||||
action.clearDraft = false;
|
||||
action.replyTo = msgId;
|
||||
history->session().api().shareContact(
|
||||
history->session().user(),
|
||||
action);
|
||||
}));
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_bot_share_phone(tr::now),
|
||||
tr::lng_bot_share_phone_confirm(tr::now),
|
||||
[=] {
|
||||
Ui::showPeerHistory(history, ShowAtTheEndMsgId);
|
||||
auto action = Api::SendAction(history);
|
||||
action.clearDraft = false;
|
||||
action.replyTo = msgId;
|
||||
history->session().api().shareContact(
|
||||
history->session().user(),
|
||||
action);
|
||||
}));
|
||||
} break;
|
||||
|
||||
case ButtonType::RequestPoll: {
|
||||
|
|
|
@ -328,7 +328,7 @@ Widget::Widget(
|
|||
}, lifetime());
|
||||
|
||||
_whatIsThis->setClickedCallback([=] {
|
||||
controller->show(Box<InformBox>(channel->isMegagroup()
|
||||
controller->show(Box<Ui::InformBox>(channel->isMegagroup()
|
||||
? tr::lng_admin_log_about_text(tr::now)
|
||||
: tr::lng_admin_log_about_text_channel(tr::now)));
|
||||
});
|
||||
|
|
|
@ -264,7 +264,7 @@ void FastShareMessage(not_null<HistoryItem*> item) {
|
|||
}
|
||||
text.append(error.first);
|
||||
Ui::show(
|
||||
Box<InformBox>(text),
|
||||
Box<Ui::InformBox>(text),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -671,7 +671,7 @@ HistoryWidget::HistoryWidget(
|
|||
const auto unavailable = _peer->computeUnavailableReason();
|
||||
if (!unavailable.isEmpty()) {
|
||||
controller->showBackFromStack();
|
||||
controller->show(Box<InformBox>(unavailable));
|
||||
controller->show(Box<Ui::InformBox>(unavailable));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -858,7 +858,7 @@ void HistoryWidget::initVoiceRecordBar() {
|
|||
? Data::RestrictionError(_peer, ChatRestriction::SendMedia)
|
||||
: std::nullopt;
|
||||
if (error) {
|
||||
controller()->show(Box<InformBox>(*error));
|
||||
controller()->show(Box<Ui::InformBox>(*error));
|
||||
return true;
|
||||
} else if (showSlowmodeError()) {
|
||||
return true;
|
||||
|
@ -3308,7 +3308,8 @@ void HistoryWidget::saveEditMsg() {
|
|||
Box<DeleteMessagesBox>(item, suggestModerateActions));
|
||||
return;
|
||||
} else if (!left.text.isEmpty()) {
|
||||
controller()->show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
||||
controller()->show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_too_long(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3343,7 +3344,7 @@ void HistoryWidget::saveEditMsg() {
|
|||
const auto &err = error.type();
|
||||
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
||||
controller()->show(
|
||||
Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_edit_error(tr::now)));
|
||||
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
||||
cancelEdit();
|
||||
} else if (err == u"MESSAGE_EMPTY"_q) {
|
||||
|
@ -3351,7 +3352,7 @@ void HistoryWidget::saveEditMsg() {
|
|||
_field->setFocus();
|
||||
} else {
|
||||
controller()->show(
|
||||
Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_edit_error(tr::now)));
|
||||
}
|
||||
update();
|
||||
})();
|
||||
|
@ -3729,7 +3730,7 @@ void HistoryWidget::unreadMentionsAnimationFinish() {
|
|||
void HistoryWidget::chooseAttach() {
|
||||
if (_editMsgId) {
|
||||
controller()->show(
|
||||
Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4544,7 +4545,7 @@ bool HistoryWidget::confirmSendingFiles(
|
|||
}
|
||||
if (_editMsgId) {
|
||||
controller()->show(
|
||||
Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -5714,7 +5715,7 @@ void HistoryWidget::sendInlineResult(InlineBots::ResultSelected result) {
|
|||
|
||||
auto errorText = result.result->getErrorOnSend(_history);
|
||||
if (!errorText.isEmpty()) {
|
||||
controller()->show(Box<InformBox>(errorText));
|
||||
controller()->show(Box<Ui::InformBox>(errorText));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -6048,7 +6049,7 @@ bool HistoryWidget::sendExistingDocument(
|
|||
: std::nullopt;
|
||||
if (error) {
|
||||
controller()->show(
|
||||
Box<InformBox>(*error),
|
||||
Box<Ui::InformBox>(*error),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return false;
|
||||
} else if (!_peer || !_peer->canWrite()) {
|
||||
|
@ -6084,7 +6085,7 @@ bool HistoryWidget::sendExistingPhoto(
|
|||
: std::nullopt;
|
||||
if (error) {
|
||||
controller()->show(
|
||||
Box<InformBox>(*error),
|
||||
Box<Ui::InformBox>(*error),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return false;
|
||||
} else if (!_peer || !_peer->canWrite()) {
|
||||
|
@ -6169,11 +6170,12 @@ void HistoryWidget::replyToMessage(not_null<HistoryItem*> item) {
|
|||
}
|
||||
if (item->history() == _migrated) {
|
||||
if (item->serviceMsg()) {
|
||||
controller()->show(Box<InformBox>(tr::lng_reply_cant(tr::now)));
|
||||
controller()->show(Box<Ui::InformBox>(
|
||||
tr::lng_reply_cant(tr::now)));
|
||||
} else {
|
||||
const auto itemId = item->fullId();
|
||||
controller()->show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_reply_cant_forward(tr::now),
|
||||
tr::lng_selected_forward(tr::now),
|
||||
crl::guard(this, [=] {
|
||||
|
@ -6231,7 +6233,7 @@ void HistoryWidget::editMessage(not_null<HistoryItem*> item) {
|
|||
toggleChooseChatTheme(_peer);
|
||||
} else if (_voiceRecordBar->isActive()) {
|
||||
controller()->show(
|
||||
Box<InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -6691,7 +6693,7 @@ void HistoryWidget::escape() {
|
|||
} else if (_editMsgId) {
|
||||
if (_replyEditMsg
|
||||
&& PrepareEditText(_replyEditMsg) != _field->getTextWithTags()) {
|
||||
controller()->show(Box<ConfirmBox>(
|
||||
controller()->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cancel_edit_post_sure(tr::now),
|
||||
tr::lng_cancel_edit_post_yes(tr::now),
|
||||
tr::lng_cancel_edit_post_no(tr::now),
|
||||
|
|
|
@ -798,7 +798,7 @@ rpl::producer<> ComposeControls::attachRequests() const {
|
|||
) | rpl::filter([=] {
|
||||
if (isEditingMessage()) {
|
||||
_window->show(
|
||||
Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -1715,7 +1715,7 @@ void ComposeControls::initVoiceRecordBar() {
|
|||
ChatRestriction::SendMedia)
|
||||
: std::nullopt;
|
||||
if (error) {
|
||||
_window->show(Box<InformBox>(*error));
|
||||
_window->show(Box<Ui::InformBox>(*error));
|
||||
return true;
|
||||
} else if (_showSlowmodeError && _showSlowmodeError()) {
|
||||
return true;
|
||||
|
@ -2014,7 +2014,8 @@ void ComposeControls::editMessage(not_null<HistoryItem*> item) {
|
|||
Expects(draftKeyCurrent() != Data::DraftKey::None());
|
||||
|
||||
if (_voiceRecordBar->isActive()) {
|
||||
_window->show(Box<InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
||||
_window->show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_caption_voice(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1636,7 +1636,7 @@ void VoiceRecordBar::showDiscardBox(
|
|||
callback();
|
||||
}
|
||||
};
|
||||
_controller->show(Box<ConfirmBox>(
|
||||
_controller->show(Box<Ui::ConfirmBox>(
|
||||
(isListenState()
|
||||
? tr::lng_record_listen_cancel_sure
|
||||
: tr::lng_record_lock_cancel_sure)(tr::now),
|
||||
|
|
|
@ -341,7 +341,7 @@ void ContactStatus::setupShareHandler(not_null<UserData*> user) {
|
|||
}).send();
|
||||
close();
|
||||
};
|
||||
_controller->window().show(Box<ConfirmBox>(
|
||||
_controller->window().show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_new_contact_share_sure(
|
||||
tr::now,
|
||||
lt_phone,
|
||||
|
@ -399,7 +399,7 @@ void ContactStatus::setupReportHandler(not_null<PeerData*> peer) {
|
|||
const auto text = ((peer->isChat() || peer->isMegagroup())
|
||||
? tr::lng_report_spam_sure_group
|
||||
: tr::lng_report_spam_sure_channel)(tr::now);
|
||||
_controller->window().show(Box<ConfirmBox>(
|
||||
_controller->window().show(Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_report_spam_ok(tr::now),
|
||||
st::attentionBoxButton,
|
||||
|
|
|
@ -1010,7 +1010,7 @@ void StopPoll(not_null<Main::Session*> session, FullMsgId itemId) {
|
|||
session->api().closePoll(item);
|
||||
}
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_polls_stop_warning(tr::now),
|
||||
tr::lng_polls_stop_sure(tr::now),
|
||||
tr::lng_cancel(tr::now),
|
||||
|
|
|
@ -1010,7 +1010,8 @@ void RepliesWidget::edit(
|
|||
}
|
||||
return;
|
||||
} else if (!left.text.isEmpty()) {
|
||||
controller()->show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
||||
controller()->show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_too_long(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1035,13 +1036,15 @@ void RepliesWidget::edit(
|
|||
|
||||
const auto &err = error.type();
|
||||
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
||||
controller()->show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||
controller()->show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_error(tr::now)));
|
||||
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
||||
_composeControls->cancelEditMessage();
|
||||
} else if (err == u"MESSAGE_EMPTY"_q) {
|
||||
doSetInnerFocus();
|
||||
} else {
|
||||
controller()->show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||
controller()->show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_error(tr::now)));
|
||||
}
|
||||
update();
|
||||
return true;
|
||||
|
@ -1078,7 +1081,7 @@ bool RepliesWidget::sendExistingDocument(
|
|||
ChatRestriction::SendStickers);
|
||||
if (error) {
|
||||
controller()->show(
|
||||
Box<InformBox>(*error),
|
||||
Box<Ui::InformBox>(*error),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return false;
|
||||
} else if (showSlowmodeError()) {
|
||||
|
@ -1114,7 +1117,7 @@ bool RepliesWidget::sendExistingPhoto(
|
|||
ChatRestriction::SendMedia);
|
||||
if (error) {
|
||||
controller()->show(
|
||||
Box<InformBox>(*error),
|
||||
Box<Ui::InformBox>(*error),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return false;
|
||||
} else if (showSlowmodeError()) {
|
||||
|
@ -1136,7 +1139,7 @@ void RepliesWidget::sendInlineResult(
|
|||
not_null<UserData*> bot) {
|
||||
const auto errorText = result->getErrorOnSend(_history);
|
||||
if (!errorText.isEmpty()) {
|
||||
controller()->show(Box<InformBox>(errorText));
|
||||
controller()->show(Box<Ui::InformBox>(errorText));
|
||||
return;
|
||||
}
|
||||
sendInlineResult(result, bot, Api::SendOptions());
|
||||
|
|
|
@ -609,7 +609,8 @@ void ScheduledWidget::edit(
|
|||
}
|
||||
return;
|
||||
} else if (!left.text.isEmpty()) {
|
||||
controller()->show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
||||
controller()->show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_too_long(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -634,13 +635,15 @@ void ScheduledWidget::edit(
|
|||
|
||||
const auto &err = error.type();
|
||||
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
||||
controller()->show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||
controller()->show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_error(tr::now)));
|
||||
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
||||
_composeControls->cancelEditMessage();
|
||||
} else if (err == u"MESSAGE_EMPTY"_q) {
|
||||
_composeControls->focus();
|
||||
} else {
|
||||
controller()->show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||
controller()->show(Box<Ui::InformBox>(
|
||||
tr::lng_edit_error(tr::now)));
|
||||
}
|
||||
update();
|
||||
return true;
|
||||
|
@ -675,7 +678,7 @@ bool ScheduledWidget::sendExistingDocument(
|
|||
ChatRestriction::SendStickers);
|
||||
if (error) {
|
||||
controller()->show(
|
||||
Box<InformBox>(*error),
|
||||
Box<Ui::InformBox>(*error),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return false;
|
||||
}
|
||||
|
@ -707,7 +710,7 @@ bool ScheduledWidget::sendExistingPhoto(
|
|||
ChatRestriction::SendMedia);
|
||||
if (error) {
|
||||
controller()->show(
|
||||
Box<InformBox>(*error),
|
||||
Box<Ui::InformBox>(*error),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return false;
|
||||
}
|
||||
|
@ -727,7 +730,7 @@ void ScheduledWidget::sendInlineResult(
|
|||
not_null<UserData*> bot) {
|
||||
const auto errorText = result->getErrorOnSend(_history);
|
||||
if (!errorText.isEmpty()) {
|
||||
controller()->show(Box<InformBox>(errorText));
|
||||
controller()->show(Box<Ui::InformBox>(errorText));
|
||||
return;
|
||||
}
|
||||
const auto callback = [=](Api::SendOptions options) {
|
||||
|
|
|
@ -411,7 +411,7 @@ void WrapWidget::checkBeforeClose(Fn<void()> close) {
|
|||
close();
|
||||
};
|
||||
if (_controller->canSaveChangesNow()) {
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_settings_close_sure(tr::now),
|
||||
tr::lng_close(tr::now),
|
||||
confirmed));
|
||||
|
|
|
@ -351,7 +351,7 @@ void CodeWidget::gotPassword(const MTPaccount_Password &result) {
|
|||
Core::UpdateApplication();
|
||||
close();
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_passport_app_out_of_date(tr::now),
|
||||
tr::lng_menu_update(tr::now),
|
||||
callback));
|
||||
|
|
|
@ -311,14 +311,14 @@ void PasswordCheckWidget::toRecover() {
|
|||
}).send();
|
||||
}
|
||||
} else {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_signin_no_email_forgot(tr::now),
|
||||
[=] { showReset(); }));
|
||||
}
|
||||
}
|
||||
|
||||
void PasswordCheckWidget::toPassword() {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_signin_cant_email_forgot(tr::now),
|
||||
[=] { showReset(); }));
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ void PasswordCheckWidget::submit() {
|
|||
send();
|
||||
close();
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_passport_losing(tr::now),
|
||||
tr::lng_continue(tr::now),
|
||||
confirmed));
|
||||
|
|
|
@ -236,7 +236,7 @@ void PhoneWidget::phoneSubmitFail(const MTP::Error &error) {
|
|||
_sentRequest = 0;
|
||||
auto &err = error.type();
|
||||
if (err == qstr("PHONE_NUMBER_FLOOD")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_error_phone_flood(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_error_phone_flood(tr::now)));
|
||||
} else if (err == qstr("PHONE_NUMBER_INVALID")) { // show error
|
||||
showPhoneError(tr::lng_bad_phone());
|
||||
} else if (err == qstr("PHONE_NUMBER_BANNED")) {
|
||||
|
|
|
@ -401,7 +401,7 @@ void QrWidget::sendCheckPasswordRequest() {
|
|||
Core::UpdateApplication();
|
||||
close();
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_passport_app_out_of_date(tr::now),
|
||||
tr::lng_menu_update(tr::now),
|
||||
callback));
|
||||
|
|
|
@ -130,7 +130,7 @@ void SignupWidget::nameSubmitFail(const MTP::Error &error) {
|
|||
|
||||
auto &err = error.type();
|
||||
if (err == qstr("PHONE_NUMBER_FLOOD")) {
|
||||
Ui::show(Box<InformBox>(tr::lng_error_phone_flood(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_error_phone_flood(tr::now)));
|
||||
} else if (err == qstr("PHONE_NUMBER_INVALID")
|
||||
|| err == qstr("PHONE_NUMBER_BANNED")
|
||||
|| err == qstr("PHONE_CODE_EXPIRED")
|
||||
|
|
|
@ -141,7 +141,8 @@ void Step::finish(const MTPUser &user, QImage &&photo) {
|
|||
|| !user.c_user().vid().v) {
|
||||
// No idea what to do here.
|
||||
// We could've reset intro and MTP, but this really should not happen.
|
||||
Ui::show(Box<InformBox>("Internal error: bad user.is_self() after sign in."));
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
"Internal error: bad user.is_self() after sign in."));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -368,7 +368,7 @@ bool CloudManager::showOfferSwitchBox() {
|
|||
Local::writeLangPack();
|
||||
};
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
"Do you want to switch your language to "
|
||||
+ language.nativeName
|
||||
+ "? You can always change your language in Settings.",
|
||||
|
@ -420,7 +420,7 @@ void CloudManager::requestLanguageAndSwitch(
|
|||
Expects(!id.isEmpty());
|
||||
|
||||
if (LanguageIdOrDefault(_langpack.id()) == id) {
|
||||
Ui::show(Box<InformBox>(tr::lng_language_already(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_language_already(tr::now)));
|
||||
return;
|
||||
} else if (id == qstr("#custom")) {
|
||||
performSwitchToCustom();
|
||||
|
@ -465,7 +465,7 @@ void CloudManager::sendSwitchingToLanguageRequest() {
|
|||
}).fail([=](const MTP::Error &error) {
|
||||
_switchingToLanguageRequest = 0;
|
||||
if (error.type() == "LANG_CODE_NOT_SUPPORTED") {
|
||||
Ui::show(Box<InformBox>(tr::lng_language_not_found(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_language_not_found(tr::now)));
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
@ -503,7 +503,7 @@ void CloudManager::switchToLanguage(const Language &data) {
|
|||
+ "\n\n"
|
||||
+ getValue(tr::lng_sure_save_language.base);
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_box_ok(tr::now),
|
||||
tr::lng_cancel(tr::now),
|
||||
|
@ -551,7 +551,7 @@ void CloudManager::performSwitchToCustom() {
|
|||
App::restart();
|
||||
};
|
||||
Ui::show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_box_ok(tr::now),
|
||||
tr::lng_cancel(tr::now),
|
||||
|
@ -560,7 +560,8 @@ void CloudManager::performSwitchToCustom() {
|
|||
}
|
||||
} else {
|
||||
Ui::show(
|
||||
Box<InformBox>("Custom lang failed :(\n\nError: " + loader.errors()),
|
||||
Box<Ui::InformBox>(
|
||||
"Custom lang failed :(\n\nError: " + loader.errors()),
|
||||
Ui::LayerOption::KeepOther);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -17,7 +17,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
struct HistoryMessageMarkupButton;
|
||||
class MainWindow;
|
||||
class ConfirmBox;
|
||||
class HistoryWidget;
|
||||
class StackItem;
|
||||
struct FileLoadResult;
|
||||
|
@ -66,6 +65,7 @@ struct Content;
|
|||
} // namespace Export
|
||||
|
||||
namespace Ui {
|
||||
class ConfirmBox;
|
||||
class ResizeArea;
|
||||
class PlainShadow;
|
||||
class DropdownMenu;
|
||||
|
|
|
@ -739,7 +739,7 @@ bool MainWindow::skipTrayClick() const {
|
|||
void MainWindow::toggleDisplayNotifyFromTray() {
|
||||
if (controller().locked()) {
|
||||
if (!isActive()) showFromTray();
|
||||
Ui::show(Box<InformBox>(tr::lng_passcode_need_unblock(tr::now)));
|
||||
Ui::show(Box<Ui::InformBox>(tr::lng_passcode_need_unblock(tr::now)));
|
||||
return;
|
||||
}
|
||||
if (!sessionController()) {
|
||||
|
|
|
@ -765,7 +765,7 @@ std::vector<not_null<const Value*>> FormController::submitGetErrors() {
|
|||
} else if (AcceptErrorRequiresRestart(error.type())) {
|
||||
suggestRestart();
|
||||
} else {
|
||||
_view->show(Box<InformBox>(
|
||||
_view->show(Box<Ui::InformBox>(
|
||||
Lang::Hard::SecureAcceptError() + "\n" + error.type()));
|
||||
}
|
||||
}).send();
|
||||
|
@ -974,7 +974,8 @@ void FormController::checkSavedPasswordSettings(
|
|||
|
||||
void FormController::recoverPassword() {
|
||||
if (!_password.hasRecovery) {
|
||||
_view->show(Box<InformBox>(tr::lng_signin_no_email_forgot(tr::now)));
|
||||
_view->show(Box<Ui::InformBox>(
|
||||
tr::lng_signin_no_email_forgot(tr::now)));
|
||||
return;
|
||||
} else if (_recoverRequestId) {
|
||||
return;
|
||||
|
@ -1014,7 +1015,7 @@ void FormController::recoverPassword() {
|
|||
}, box->lifetime());
|
||||
}).fail([=](const MTP::Error &error) {
|
||||
_recoverRequestId = 0;
|
||||
_view->show(Box<InformBox>(Lang::Hard::ServerError()
|
||||
_view->show(Box<Ui::InformBox>(Lang::Hard::ServerError()
|
||||
+ '\n'
|
||||
+ error.type()));
|
||||
}).send();
|
||||
|
@ -2248,7 +2249,7 @@ void FormController::requestPhoneCall(not_null<Value*> value) {
|
|||
void FormController::valueSaveShowError(
|
||||
not_null<Value*> value,
|
||||
const MTP::Error &error) {
|
||||
_view->show(Box<InformBox>(
|
||||
_view->show(Box<Ui::InformBox>(
|
||||
Lang::Hard::SecureSaveError() + "\n" + error.type()));
|
||||
valueSaveFailed(value);
|
||||
}
|
||||
|
@ -2323,7 +2324,7 @@ void FormController::saveSecret(
|
|||
|
||||
void FormController::suggestRestart() {
|
||||
_suggestingRestart = true;
|
||||
_view->show(Box<ConfirmBox>(
|
||||
_view->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_passport_restart_sure(tr::now),
|
||||
tr::lng_passport_restart(tr::now),
|
||||
[=] { _controller->showPassportForm(_request); },
|
||||
|
@ -2687,7 +2688,7 @@ bool FormController::applyPassword(PasswordSettings &&settings) {
|
|||
|
||||
void FormController::cancel() {
|
||||
if (!_submitSuccess && _serviceErrorText.isEmpty()) {
|
||||
_view->show(Box<ConfirmBox>(
|
||||
_view->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_passport_stop_sure(tr::now),
|
||||
tr::lng_passport_stop(tr::now),
|
||||
[=] { cancelSure(); },
|
||||
|
|
|
@ -710,7 +710,7 @@ void PanelController::setupPassword() {
|
|||
}
|
||||
|
||||
void PanelController::cancelPasswordSubmit() {
|
||||
show(Box<ConfirmBox>(
|
||||
show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_passport_stop_password_sure(tr::now),
|
||||
tr::lng_passport_stop(tr::now),
|
||||
[=](Fn<void()> &&close) { close(); _form->cancelPassword(); }));
|
||||
|
@ -887,7 +887,7 @@ void PanelController::deleteValueSure(bool withDetails) {
|
|||
}
|
||||
|
||||
void PanelController::suggestReset(Fn<void()> callback) {
|
||||
_resetBox = Ui::BoxPointer(show(Box<ConfirmBox>(
|
||||
_resetBox = Ui::BoxPointer(show(Box<Ui::ConfirmBox>(
|
||||
Lang::Hard::PassportCorrupted(),
|
||||
Lang::Hard::PassportCorruptedReset(),
|
||||
[=] { resetPassport(callback); },
|
||||
|
@ -895,7 +895,7 @@ void PanelController::suggestReset(Fn<void()> callback) {
|
|||
}
|
||||
|
||||
void PanelController::resetPassport(Fn<void()> callback) {
|
||||
const auto box = show(Box<ConfirmBox>(
|
||||
const auto box = show(Box<Ui::ConfirmBox>(
|
||||
Lang::Hard::PassportCorruptedResetSure(),
|
||||
Lang::Hard::PassportCorruptedReset(),
|
||||
st::attentionBoxButton,
|
||||
|
@ -942,7 +942,7 @@ void PanelController::showUpdateAppBox() {
|
|||
Core::UpdateApplication();
|
||||
};
|
||||
show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_passport_app_out_of_date(tr::now),
|
||||
tr::lng_menu_update(tr::now),
|
||||
callback,
|
||||
|
@ -1076,7 +1076,7 @@ void PanelController::editWithUpload(int index, int documentIndex) {
|
|||
}
|
||||
|
||||
void PanelController::readScanError(ReadScanError error) {
|
||||
show(Box<InformBox>([&] {
|
||||
show(Box<Ui::InformBox>([&] {
|
||||
switch (error) {
|
||||
case ReadScanError::FileTooLarge:
|
||||
return tr::lng_passport_error_too_large(tr::now);
|
||||
|
@ -1402,7 +1402,7 @@ void PanelController::cancelEditScope() {
|
|||
|
||||
if (_panelHasUnsavedChanges && _panelHasUnsavedChanges()) {
|
||||
if (!_confirmForgetChangesBox) {
|
||||
_confirmForgetChangesBox = show(Box<ConfirmBox>(
|
||||
_confirmForgetChangesBox = show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_passport_sure_cancel(tr::now),
|
||||
tr::lng_continue(tr::now),
|
||||
[=] { _panel->showForm(); }));
|
||||
|
|
|
@ -462,7 +462,7 @@ void AppendEmojiPacks(
|
|||
auto callback = [=] {
|
||||
if (document) {
|
||||
if (const auto error = RestrictionToSendStickers(_controller)) {
|
||||
_controller->show(Box<InformBox>(*error));
|
||||
_controller->show(Box<Ui::InformBox>(*error));
|
||||
return true;
|
||||
}
|
||||
Api::SendExistingDocument(
|
||||
|
|
|
@ -98,7 +98,7 @@ void GroupMembersWidget::removePeer(PeerData *selectedPeer) {
|
|||
currentRestrictedRights);
|
||||
}
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_box_remove(tr::now),
|
||||
crl::guard(&peer->session(), callback)));
|
||||
|
|
|
@ -479,7 +479,7 @@ void SetupSystemIntegrationContent(
|
|||
}) | rpl::start_with_next([=](bool checked) {
|
||||
if (controller->session().domain().local().hasLocalPasscode()) {
|
||||
minimized->entity()->setChecked(false);
|
||||
controller->show(Box<InformBox>(
|
||||
controller->show(Box<Ui::InformBox>(
|
||||
tr::lng_error_start_minimized_passcoded(tr::now)));
|
||||
} else {
|
||||
cSetStartMinimized(checked);
|
||||
|
@ -596,7 +596,7 @@ void SetupANGLE(
|
|||
}
|
||||
App::restart();
|
||||
});
|
||||
controller->show(Box<ConfirmBox>(
|
||||
controller->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_settings_need_restart(tr::now),
|
||||
tr::lng_settings_restart_now(tr::now),
|
||||
confirmed));
|
||||
|
@ -638,7 +638,7 @@ void SetupOpenGL(
|
|||
const auto cancelled = crl::guard(button, [=] {
|
||||
toggles->fire(!enabled);
|
||||
});
|
||||
controller->show(Box<ConfirmBox>(
|
||||
controller->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_settings_need_restart(tr::now),
|
||||
tr::lng_settings_restart_now(tr::now),
|
||||
confirmed,
|
||||
|
|
|
@ -290,7 +290,7 @@ void Calls::setupContent() {
|
|||
Platform::SystemSettingsType::Audio);
|
||||
if (!opened) {
|
||||
_controller->show(
|
||||
Box<InformBox>(tr::lng_linux_no_audio_prefs(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_linux_no_audio_prefs(tr::now)));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -322,7 +322,7 @@ void Calls::requestPermissionAndStartTestingMicrophone() {
|
|||
Platform::PermissionType::Microphone);
|
||||
Ui::hideLayer();
|
||||
};
|
||||
_controller->show(Box<ConfirmBox>(
|
||||
_controller->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_no_mic_permission(tr::now),
|
||||
tr::lng_menu_settings(tr::now),
|
||||
showSystemSettings));
|
||||
|
|
|
@ -1172,7 +1172,7 @@ void SetupDefaultThemes(
|
|||
// in Window::Theme::Revert which is called by Editor.
|
||||
//
|
||||
// So we check here, before we change the saved accent color.
|
||||
window->show(Box<InformBox>(
|
||||
window->show(Box<Ui::InformBox>(
|
||||
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
@ -1326,7 +1326,7 @@ void SetupAutoNightMode(
|
|||
}) | rpl::start_with_next([=](bool checked) {
|
||||
if (checked && Window::Theme::Background()->editingTheme()) {
|
||||
autoNight->setChecked(false);
|
||||
controller->show(Box<InformBox>(
|
||||
controller->show(Box<Ui::InformBox>(
|
||||
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
||||
} else {
|
||||
Core::App().settings().setSystemDarkModeEnabled(checked);
|
||||
|
|
|
@ -76,7 +76,7 @@ auto GenerateCodes() {
|
|||
? qsl("Do you want to disable DEBUG logs?")
|
||||
: qsl("Do you want to enable DEBUG logs?\n\n"
|
||||
"All network events will be logged.");
|
||||
Ui::show(Box<ConfirmBox>(text, [] {
|
||||
Ui::show(Box<Ui::ConfirmBox>(text, [] {
|
||||
Core::App().switchDebugMode();
|
||||
}));
|
||||
});
|
||||
|
@ -96,7 +96,7 @@ auto GenerateCodes() {
|
|||
});
|
||||
codes.emplace(qsl("moderate"), [](SessionController *window) {
|
||||
auto text = Core::App().settings().moderateModeEnabled() ? qsl("Disable moderate mode?") : qsl("Enable moderate mode?");
|
||||
Ui::show(Box<ConfirmBox>(text, [=] {
|
||||
Ui::show(Box<Ui::ConfirmBox>(text, [=] {
|
||||
Core::App().settings().setModerateModeEnabled(!Core::App().settings().moderateModeEnabled());
|
||||
Core::App().saveSettingsDelayed();
|
||||
Ui::hideLayer();
|
||||
|
@ -119,7 +119,7 @@ auto GenerateCodes() {
|
|||
return;
|
||||
}
|
||||
auto text = cUseExternalVideoPlayer() ? qsl("Use internal video player?") : qsl("Use external video player?");
|
||||
Ui::show(Box<ConfirmBox>(text, [=] {
|
||||
Ui::show(Box<Ui::ConfirmBox>(text, [=] {
|
||||
cSetUseExternalVideoPlayer(!cUseExternalVideoPlayer());
|
||||
window->session().saveSettingsDelayed();
|
||||
Ui::hideLayer();
|
||||
|
@ -136,7 +136,8 @@ auto GenerateCodes() {
|
|||
if (!result.paths.isEmpty()) {
|
||||
const auto loadFor = [&](not_null<Main::Account*> account) {
|
||||
if (!account->mtp().dcOptions().loadFromFile(result.paths.front())) {
|
||||
Ui::show(Box<InformBox>("Could not load endpoints :( Errors in 'log.txt'."));
|
||||
Ui::show(Box<Ui::InformBox>("Could not load endpoints"
|
||||
" :( Errors in 'log.txt'."));
|
||||
}
|
||||
};
|
||||
if (const auto strong = weak.get()) {
|
||||
|
@ -185,7 +186,7 @@ auto GenerateCodes() {
|
|||
#endif // !Q_OS_WIN
|
||||
: qsl("Switch font engine to FreeType?");
|
||||
|
||||
Ui::show(Box<ConfirmBox>(text, [] {
|
||||
Ui::show(Box<Ui::ConfirmBox>(text, [] {
|
||||
Core::App().switchFreeType();
|
||||
}));
|
||||
});
|
||||
|
@ -214,7 +215,7 @@ auto GenerateCodes() {
|
|||
auto track = Media::Audio::Current().createTrack();
|
||||
track->fillFromFile(result.paths.front());
|
||||
if (track->failed()) {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
"Could not audio :( Errors in 'log.txt'."));
|
||||
} else {
|
||||
Core::App().settings().setSoundOverride(
|
||||
|
@ -229,7 +230,7 @@ auto GenerateCodes() {
|
|||
codes.emplace(qsl("sounds_reset"), [](SessionController *window) {
|
||||
Core::App().settings().clearSoundOverrides();
|
||||
Core::App().saveSettingsDelayed();
|
||||
Ui::show(Box<InformBox>("All sound overrides were reset."));
|
||||
Ui::show(Box<Ui::InformBox>("All sound overrides were reset."));
|
||||
});
|
||||
codes.emplace(qsl("unpacklog"), [](SessionController *window) {
|
||||
FileDialog::GetOpenPath(Core::App().getFileDialogParent(), "Open crash log file", "Crash dump (*.txt)", [=](const FileDialog::OpenResult &result) {
|
||||
|
|
|
@ -237,7 +237,7 @@ void SetupInterfaceScale(
|
|||
button,
|
||||
[=] { repeatSetScale(cConfigScale(), repeatSetScale); });
|
||||
});
|
||||
window->show(Box<ConfirmBox>(
|
||||
window->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_settings_need_restart(tr::now),
|
||||
tr::lng_settings_restart_now(tr::now),
|
||||
confirmed,
|
||||
|
@ -328,7 +328,7 @@ void SetupHelp(
|
|||
*requestId = 0;
|
||||
}).send();
|
||||
});
|
||||
auto box = Box<ConfirmBox>(
|
||||
auto box = Box<Ui::ConfirmBox>(
|
||||
tr::lng_settings_ask_sure(tr::now),
|
||||
tr::lng_settings_ask_ok(tr::now),
|
||||
tr::lng_settings_faq_button(tr::now),
|
||||
|
|
|
@ -480,7 +480,7 @@ void LastSeenPrivacyController::confirmSave(
|
|||
Core::App().settings().setLastSeenWarningSeen(true);
|
||||
Core::App().saveSettingsDelayed();
|
||||
};
|
||||
auto box = Box<ConfirmBox>(
|
||||
auto box = Box<Ui::ConfirmBox>(
|
||||
tr::lng_edit_privacy_lastseen_warning(tr::now),
|
||||
tr::lng_continue(tr::now),
|
||||
tr::lng_cancel(tr::now),
|
||||
|
|
|
@ -585,7 +585,7 @@ void SetupCloudPassword(
|
|||
*sent = false;
|
||||
}, container->lifetime());
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_cloud_password_reset_cancel_sure(tr::now),
|
||||
tr::lng_box_yes(tr::now),
|
||||
tr::lng_box_no(tr::now),
|
||||
|
@ -889,7 +889,7 @@ object_ptr<Ui::BoxContent> CloudPasswordAppOutdatedBox() {
|
|||
Core::UpdateApplication();
|
||||
close();
|
||||
};
|
||||
return Box<ConfirmBox>(
|
||||
return Box<Ui::ConfirmBox>(
|
||||
tr::lng_passport_app_out_of_date(tr::now),
|
||||
tr::lng_menu_update(tr::now),
|
||||
callback);
|
||||
|
|
|
@ -1040,13 +1040,13 @@ void FileLoadTask::process(Args &&args) {
|
|||
void FileLoadTask::finish() {
|
||||
if (!_result || !_result->filesize || _result->filesize < 0) {
|
||||
Ui::show(
|
||||
Box<InformBox>(
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_send_image_empty(tr::now, lt_name, _filepath)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
removeFromAlbum();
|
||||
} else if (_result->filesize > kFileSizeLimit) {
|
||||
Ui::show(
|
||||
Box<InformBox>(
|
||||
Box<Ui::InformBox>(
|
||||
tr::lng_send_image_too_large(tr::now, lt_name, _filepath)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
removeFromAlbum();
|
||||
|
|
|
@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "styles/style_layers.h"
|
||||
#include "styles/style_boxes.h"
|
||||
|
||||
namespace Ui {
|
||||
namespace {
|
||||
|
||||
TextParseOptions kInformBoxTextOptions = {
|
||||
|
@ -444,3 +445,5 @@ not_null<Ui::RpWidget*> ConfirmDontWarnBox::setupContent(
|
|||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace Ui
|
||||
|
|
|
@ -9,6 +9,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include "boxes/abstract_box.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
class InformBox;
|
||||
class ConfirmBox : public Ui::BoxContent, public ClickHandlerHost {
|
||||
public:
|
||||
|
@ -174,3 +176,5 @@ private:
|
|||
not_null<Ui::RpWidget*> _content;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Ui
|
||||
|
|
|
@ -1404,7 +1404,7 @@ void ToggleNightModeWithConfirmation(
|
|||
toggle();
|
||||
close();
|
||||
};
|
||||
window->show(Box<ConfirmBox>(
|
||||
window->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_settings_auto_night_warning(tr::now),
|
||||
tr::lng_settings_auto_night_disable(tr::now),
|
||||
disableAndToggle));
|
||||
|
|
|
@ -422,7 +422,7 @@ Editor::Inner::Inner(QWidget *parent, const QString &path)
|
|||
if (update.type == BackgroundUpdate::Type::TestingTheme) {
|
||||
Revert();
|
||||
base::call_delayed(st::slideDuration, this, [] {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
||||
});
|
||||
}
|
||||
|
@ -667,7 +667,7 @@ Editor::Editor(
|
|||
[=] { save(); }));
|
||||
|
||||
_inner->setErrorCallback([=] {
|
||||
window->show(Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||
window->show(Box<Ui::InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||
|
||||
// This could be from inner->_context observable notification.
|
||||
// We should not destroy it while iterating in subscribers.
|
||||
|
@ -750,13 +750,13 @@ void Editor::exportTheme() {
|
|||
if (!f.open(QIODevice::WriteOnly)) {
|
||||
LOG(("Theme Error: could not open zip-ed theme file '%1' for writing").arg(path));
|
||||
_window->show(
|
||||
Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||
return;
|
||||
}
|
||||
if (f.write(result) != result.size()) {
|
||||
LOG(("Theme Error: could not write zip-ed theme to file '%1'").arg(path));
|
||||
_window->show(
|
||||
Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||
Box<Ui::InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||
return;
|
||||
}
|
||||
Ui::Toast::Show(tr::lng_theme_editor_done(tr::now));
|
||||
|
@ -903,7 +903,7 @@ void Editor::closeWithConfirmation() {
|
|||
closeEditor();
|
||||
close();
|
||||
});
|
||||
_window->show(Box<ConfirmBox>(
|
||||
_window->show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_theme_editor_sure_close(tr::now),
|
||||
tr::lng_close(tr::now),
|
||||
close));
|
||||
|
|
|
@ -655,7 +655,7 @@ void StartEditor(
|
|||
? GenerateDefaultPalette()
|
||||
: ParseTheme(object, true).palette;
|
||||
if (palette.isEmpty() || !CopyColorsToPalette(path, palette, cloud)) {
|
||||
window->show(Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||
window->show(Box<Ui::InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||
return;
|
||||
}
|
||||
if (Core::App().settings().systemDarkModeEnabled()) {
|
||||
|
|
|
@ -617,7 +617,7 @@ void CloudList::showMenu(Element &element) {
|
|||
_window->session().data().cloudThemes().remove(id);
|
||||
}
|
||||
};
|
||||
_window->window().show(Box<ConfirmBox>(
|
||||
_window->window().show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_theme_delete_sure(tr::now),
|
||||
tr::lng_theme_delete(tr::now),
|
||||
remove));
|
||||
|
|
|
@ -195,7 +195,7 @@ void Controller::showTermsDelete() {
|
|||
}
|
||||
};
|
||||
show(
|
||||
Box<ConfirmBox>(
|
||||
Box<Ui::ConfirmBox>(
|
||||
tr::lng_terms_delete_warning(tr::now),
|
||||
tr::lng_terms_delete_now(tr::now),
|
||||
st::attentionBoxButton,
|
||||
|
@ -371,7 +371,7 @@ void Controller::showLogoutConfirmation() {
|
|||
Core::App().logout(account);
|
||||
}
|
||||
};
|
||||
show(Box<ConfirmBox>(
|
||||
show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_sure_logout(tr::now),
|
||||
tr::lng_settings_logout(tr::now),
|
||||
st::attentionBoxButton,
|
||||
|
|
|
@ -336,7 +336,7 @@ void FiltersMenu::showEditBox(FilterId id) {
|
|||
}
|
||||
|
||||
void FiltersMenu::showRemoveBox(FilterId id) {
|
||||
_session->window().show(Box<ConfirmBox>(
|
||||
_session->window().show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_filters_remove_sure(tr::now),
|
||||
tr::lng_filters_remove_yes(tr::now),
|
||||
[=](Fn<void()> &&close) { close(); remove(id); }));
|
||||
|
|
|
@ -339,7 +339,7 @@ void MainMenu::AccountButton::contextMenuEvent(QContextMenuEvent *e) {
|
|||
close();
|
||||
Core::App().logout(&session->account());
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_sure_logout(tr::now),
|
||||
tr::lng_settings_logout(tr::now),
|
||||
st::attentionBoxButton,
|
||||
|
@ -941,7 +941,7 @@ void MainMenu::refreshMenu() {
|
|||
|
||||
auto nightCallback = [=] {
|
||||
if (Window::Theme::Background()->editingTheme()) {
|
||||
controller->show(Box<InformBox>(
|
||||
controller->show(Box<Ui::InformBox>(
|
||||
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -188,7 +188,7 @@ bool PinnedLimitReached(Dialogs::Key key, FilterId filterId) {
|
|||
tr::now,
|
||||
lt_count,
|
||||
pinnedMax);
|
||||
Ui::show(Box<InformBox>(errorText));
|
||||
Ui::show(Box<Ui::InformBox>(errorText));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -742,7 +742,7 @@ void PeerMenuDeleteContact(not_null<UserData*> user) {
|
|||
user->session().api().applyUpdates(result);
|
||||
}).send();
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
text,
|
||||
tr::lng_box_delete(tr::now),
|
||||
deleteSure));
|
||||
|
@ -754,7 +754,7 @@ void PeerMenuShareContactBox(
|
|||
const auto weak = std::make_shared<QPointer<PeerListBox>>();
|
||||
auto callback = [=](not_null<PeerData*> peer) {
|
||||
if (!peer->canWrite()) {
|
||||
Ui::show(Box<InformBox>(
|
||||
Ui::show(Box<Ui::InformBox>(
|
||||
tr::lng_forward_share_cant(tr::now)),
|
||||
Ui::LayerOption::KeepOther);
|
||||
return;
|
||||
|
@ -771,7 +771,7 @@ void PeerMenuShareContactBox(
|
|||
auto recipient = peer->isUser()
|
||||
? peer->name
|
||||
: '\xAB' + peer->name + '\xBB';
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_forward_share_contact(tr::now, lt_recipient, recipient),
|
||||
tr::lng_forward_send(tr::now),
|
||||
[peer, user, navigation] {
|
||||
|
@ -1072,7 +1072,7 @@ QPointer<Ui::RpWidget> ShowSendNowMessagesBox(
|
|||
}
|
||||
};
|
||||
return Ui::show(
|
||||
Box<ConfirmBox>(text, tr::lng_send_button(tr::now), std::move(done)),
|
||||
Box<Ui::ConfirmBox>(text, tr::lng_send_button(tr::now), std::move(done)),
|
||||
Ui::LayerOption::KeepOther).data();
|
||||
}
|
||||
|
||||
|
@ -1133,7 +1133,7 @@ void ToggleMessagePinned(
|
|||
} else {
|
||||
const auto peer = item->history()->peer;
|
||||
const auto session = &peer->session();
|
||||
Ui::show(Box<ConfirmBox>(tr::lng_pinned_unpin_sure(tr::now), tr::lng_pinned_unpin(tr::now), crl::guard(session, [=] {
|
||||
const auto callback = crl::guard(session, [=] {
|
||||
Ui::hideLayer();
|
||||
session->api().request(MTPmessages_UpdatePinnedMessage(
|
||||
MTP_flags(MTPmessages_UpdatePinnedMessage::Flag::f_unpin),
|
||||
|
@ -1142,7 +1142,11 @@ void ToggleMessagePinned(
|
|||
)).done([=](const MTPUpdates &result) {
|
||||
session->api().applyUpdates(result);
|
||||
}).send();
|
||||
})));
|
||||
});
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_pinned_unpin_sure(tr::now),
|
||||
tr::lng_pinned_unpin(tr::now),
|
||||
callback));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1150,7 +1154,7 @@ void HidePinnedBar(
|
|||
not_null<Window::SessionNavigation*> navigation,
|
||||
not_null<PeerData*> peer,
|
||||
Fn<void()> onHidden) {
|
||||
Ui::show(Box<ConfirmBox>(tr::lng_pinned_hide_all_sure(tr::now), tr::lng_pinned_hide_all_hide(tr::now), crl::guard(navigation, [=] {
|
||||
const auto callback = crl::guard(navigation, [=] {
|
||||
Ui::hideLayer();
|
||||
auto &session = peer->session();
|
||||
const auto migrated = peer->migrateFrom();
|
||||
|
@ -1169,13 +1173,17 @@ void HidePinnedBar(
|
|||
} else {
|
||||
session.api().requestFullPeer(peer);
|
||||
}
|
||||
})));
|
||||
});
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_pinned_hide_all_sure(tr::now),
|
||||
tr::lng_pinned_hide_all_hide(tr::now),
|
||||
callback));
|
||||
}
|
||||
|
||||
void UnpinAllMessages(
|
||||
not_null<Window::SessionNavigation*> navigation,
|
||||
not_null<History*> history) {
|
||||
Ui::show(Box<ConfirmBox>(tr::lng_pinned_unpin_all_sure(tr::now), tr::lng_pinned_unpin(tr::now), crl::guard(navigation, [=] {
|
||||
const auto callback = crl::guard(navigation, [=] {
|
||||
Ui::hideLayer();
|
||||
const auto api = &history->session().api();
|
||||
const auto sendRequest = [=](auto self) -> void {
|
||||
|
@ -1192,7 +1200,11 @@ void UnpinAllMessages(
|
|||
}).send();
|
||||
};
|
||||
sendRequest(sendRequest);
|
||||
})));
|
||||
});
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_pinned_unpin_all_sure(tr::now),
|
||||
tr::lng_pinned_unpin(tr::now),
|
||||
callback));
|
||||
}
|
||||
|
||||
void PeerMenuAddMuteAction(
|
||||
|
@ -1230,7 +1242,7 @@ void MenuAddMarkAsReadAllChatsAction(
|
|||
MarkAsReadChatList(folder->chatsList());
|
||||
}
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_context_mark_read_all_sure(tr::now),
|
||||
std::move(boxCallback)));
|
||||
};
|
||||
|
@ -1253,7 +1265,7 @@ void MenuAddMarkAsReadChatListAction(
|
|||
MarkAsReadChatList(list());
|
||||
close();
|
||||
};
|
||||
Ui::show(Box<ConfirmBox>(
|
||||
Ui::show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_context_mark_read_sure(tr::now),
|
||||
std::move(boxCallback)));
|
||||
} else {
|
||||
|
|
|
@ -201,7 +201,7 @@ void SessionNavigation::resolveUsername(
|
|||
}).fail([=](const MTP::Error &error) {
|
||||
_resolveRequestId = 0;
|
||||
if (error.code() == 400) {
|
||||
show(Box<InformBox>(
|
||||
show(Box<Ui::InformBox>(
|
||||
tr::lng_username_not_found(tr::now, lt_user, username)));
|
||||
}
|
||||
}).send();
|
||||
|
@ -1104,7 +1104,7 @@ void SessionController::startOrJoinGroupCall(
|
|||
GroupCallJoinConfirm confirm) {
|
||||
auto &calls = Core::App().calls();
|
||||
const auto askConfirmation = [&](QString text, QString button) {
|
||||
show(Box<ConfirmBox>(text, button, crl::guard(this, [=] {
|
||||
show(Box<Ui::ConfirmBox>(text, button, crl::guard(this, [=] {
|
||||
Ui::hideLayer();
|
||||
startOrJoinGroupCall(peer, joinHash, GroupCallJoinConfirm::None);
|
||||
})));
|
||||
|
@ -1293,7 +1293,7 @@ void SessionController::cancelUploadLayer(not_null<HistoryItem*> item) {
|
|||
session().uploader().unpause();
|
||||
};
|
||||
|
||||
show(Box<ConfirmBox>(
|
||||
show(Box<Ui::ConfirmBox>(
|
||||
tr::lng_selected_cancel_sure_this(tr::now),
|
||||
tr::lng_selected_upload_stop(tr::now),
|
||||
tr::lng_continue(tr::now),
|
||||
|
|
Loading…
Add table
Reference in a new issue