mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Removed Ui::show from classes that have pointer to Controller.
This commit is contained in:
parent
c8535acad8
commit
b422ec025e
46 changed files with 296 additions and 193 deletions
|
@ -36,10 +36,12 @@ void AttachedStickers::request(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (result.v.isEmpty()) {
|
if (result.v.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
strongController->show(
|
||||||
|
Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
return;
|
return;
|
||||||
} else if (result.v.size() > 1) {
|
} else if (result.v.size() > 1) {
|
||||||
Ui::show(Box<StickersBox>(strongController, result));
|
strongController->show(
|
||||||
|
Box<StickersBox>(strongController, result));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Single attached sticker pack.
|
// Single attached sticker pack.
|
||||||
|
@ -52,12 +54,15 @@ void AttachedStickers::request(
|
||||||
const auto setId = (setData->vid().v && setData->vaccess_hash().v)
|
const auto setId = (setData->vid().v && setData->vaccess_hash().v)
|
||||||
? MTP_inputStickerSetID(setData->vid(), setData->vaccess_hash())
|
? MTP_inputStickerSetID(setData->vid(), setData->vaccess_hash())
|
||||||
: MTP_inputStickerSetShortName(setData->vshort_name());
|
: MTP_inputStickerSetShortName(setData->vshort_name());
|
||||||
Ui::show(
|
strongController->show(
|
||||||
Box<StickerSetBox>(strongController, setId),
|
Box<StickerSetBox>(strongController, setId),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
_requestId = 0;
|
_requestId = 0;
|
||||||
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
if (const auto strongController = weak.get()) {
|
||||||
|
strongController->show(
|
||||||
|
Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
|
}
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,11 @@ void CheckChatInvite(
|
||||||
session->api().checkChatInvite(hash, [=](const MTPChatInvite &result) {
|
session->api().checkChatInvite(hash, [=](const MTPChatInvite &result) {
|
||||||
Core::App().hideMediaView();
|
Core::App().hideMediaView();
|
||||||
result.match([=](const MTPDchatInvite &data) {
|
result.match([=](const MTPDchatInvite &data) {
|
||||||
const auto box = Ui::show(Box<ConfirmInviteBox>(
|
const auto strongController = weak.get();
|
||||||
|
if (!strongController) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const auto box = strongController->show(Box<ConfirmInviteBox>(
|
||||||
session,
|
session,
|
||||||
data,
|
data,
|
||||||
invitePeekChannel,
|
invitePeekChannel,
|
||||||
|
@ -80,7 +84,10 @@ void CheckChatInvite(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Core::App().hideMediaView();
|
Core::App().hideMediaView();
|
||||||
Ui::show(Box<InformBox>(tr::lng_group_invite_bad_link(tr::now)));
|
if (const auto strong = weak.get()) {
|
||||||
|
strong->show(
|
||||||
|
Box<InformBox>(tr::lng_group_invite_bad_link(tr::now)));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ void BackgroundBox::prepare() {
|
||||||
|
|
||||||
_inner->chooseEvents(
|
_inner->chooseEvents(
|
||||||
) | rpl::start_with_next([=](const Data::WallPaper &paper) {
|
) | rpl::start_with_next([=](const Data::WallPaper &paper) {
|
||||||
Ui::show(
|
_controller->show(
|
||||||
Box<BackgroundPreviewBox>(_controller, paper),
|
Box<BackgroundPreviewBox>(_controller, paper),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}, _inner->lifetime());
|
}, _inner->lifetime());
|
||||||
|
@ -176,7 +176,7 @@ void BackgroundBox::removePaper(const Data::WallPaper &paper) {
|
||||||
paper.mtpSettings()
|
paper.mtpSettings()
|
||||||
)).send();
|
)).send();
|
||||||
};
|
};
|
||||||
Ui::show(
|
_controller->show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
tr::lng_background_sure_delete(tr::now),
|
tr::lng_background_sure_delete(tr::now),
|
||||||
tr::lng_selected_delete(tr::now),
|
tr::lng_selected_delete(tr::now),
|
||||||
|
|
|
@ -769,23 +769,25 @@ bool BackgroundPreviewBox::Start(
|
||||||
const QString &slug,
|
const QString &slug,
|
||||||
const QMap<QString, QString> ¶ms) {
|
const QMap<QString, QString> ¶ms) {
|
||||||
if (const auto paper = Data::WallPaper::FromColorSlug(slug)) {
|
if (const auto paper = Data::WallPaper::FromColorSlug(slug)) {
|
||||||
Ui::show(Box<BackgroundPreviewBox>(
|
controller->show(Box<BackgroundPreviewBox>(
|
||||||
controller,
|
controller,
|
||||||
paper->withUrlParams(params)));
|
paper->withUrlParams(params)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!IsValidWallPaperSlug(slug)) {
|
if (!IsValidWallPaperSlug(slug)) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_background_bad_link(tr::now)));
|
controller->show(
|
||||||
|
Box<InformBox>(tr::lng_background_bad_link(tr::now)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
controller->session().api().requestWallPaper(slug, crl::guard(controller, [=](
|
controller->session().api().requestWallPaper(slug, crl::guard(controller, [=](
|
||||||
const Data::WallPaper &result) {
|
const Data::WallPaper &result) {
|
||||||
Ui::show(Box<BackgroundPreviewBox>(
|
controller->show(Box<BackgroundPreviewBox>(
|
||||||
controller,
|
controller,
|
||||||
result.withUrlParams(params)));
|
result.withUrlParams(params)));
|
||||||
}), [](const MTP::Error &error) {
|
}), crl::guard(controller, [=](const MTP::Error &error) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_background_bad_link(tr::now)));
|
controller->show(
|
||||||
});
|
Box<InformBox>(tr::lng_background_bad_link(tr::now)));
|
||||||
|
}));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
|
||||||
send({ .silent = true });
|
send({ .silent = true });
|
||||||
};
|
};
|
||||||
const auto sendScheduled = [=] {
|
const auto sendScheduled = [=] {
|
||||||
Ui::show(
|
_controller->show(
|
||||||
HistoryView::PrepareScheduleBox(
|
HistoryView::PrepareScheduleBox(
|
||||||
this,
|
this,
|
||||||
SendMenu::Type::Scheduled,
|
SendMenu::Type::Scheduled,
|
||||||
|
|
|
@ -165,7 +165,7 @@ void EditPrivacyBox::editExceptions(
|
||||||
}));
|
}));
|
||||||
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
|
box->addButton(tr::lng_cancel(), [=] { box->closeBox(); });
|
||||||
};
|
};
|
||||||
Ui::show(
|
_window->show(
|
||||||
Box<PeerListBox>(std::move(controller), std::move(initBox)),
|
Box<PeerListBox>(std::move(controller), std::move(initBox)),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,8 +201,10 @@ void SaveSlowmodeSeconds(
|
||||||
void ShowEditPermissions(
|
void ShowEditPermissions(
|
||||||
not_null<Window::SessionNavigation*> navigation,
|
not_null<Window::SessionNavigation*> navigation,
|
||||||
not_null<PeerData*> peer) {
|
not_null<PeerData*> peer) {
|
||||||
const auto box = Ui::show(
|
auto content = Box<EditPeerPermissionsBox>(navigation, peer);
|
||||||
Box<EditPeerPermissionsBox>(navigation, peer),
|
const auto box = QPointer<EditPeerPermissionsBox>(content.data());
|
||||||
|
navigation->parentController()->show(
|
||||||
|
std::move(content),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
const auto saving = box->lifetime().make_state<int>(0);
|
const auto saving = box->lifetime().make_state<int>(0);
|
||||||
const auto save = [=](
|
const auto save = [=](
|
||||||
|
@ -244,8 +246,10 @@ void ShowEditPermissions(
|
||||||
void ShowEditInviteLinks(
|
void ShowEditInviteLinks(
|
||||||
not_null<Window::SessionNavigation*> navigation,
|
not_null<Window::SessionNavigation*> navigation,
|
||||||
not_null<PeerData*> peer) {
|
not_null<PeerData*> peer) {
|
||||||
const auto box = Ui::show(
|
auto content = Box<EditPeerPermissionsBox>(navigation, peer);
|
||||||
Box<EditPeerPermissionsBox>(navigation, peer),
|
const auto box = QPointer<EditPeerPermissionsBox>(content.data());
|
||||||
|
navigation->parentController()->show(
|
||||||
|
std::move(content),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
const auto saving = box->lifetime().make_state<int>(0);
|
const auto saving = box->lifetime().make_state<int>(0);
|
||||||
const auto save = [=](
|
const auto save = [=](
|
||||||
|
@ -612,7 +616,7 @@ object_ptr<Ui::RpWidget> Controller::createStickersEdit() {
|
||||||
tr::lng_group_stickers_add(tr::now),
|
tr::lng_group_stickers_add(tr::now),
|
||||||
st::editPeerInviteLinkButton)
|
st::editPeerInviteLinkButton)
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(
|
_navigation->parentController()->show(
|
||||||
Box<StickersBox>(_navigation->parentController(), channel),
|
Box<StickersBox>(_navigation->parentController(), channel),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
});
|
});
|
||||||
|
@ -649,7 +653,7 @@ void Controller::showEditPeerTypeBox(
|
||||||
_usernameSavedValue = publicLink;
|
_usernameSavedValue = publicLink;
|
||||||
refreshHistoryVisibility();
|
refreshHistoryVisibility();
|
||||||
});
|
});
|
||||||
Ui::show(
|
_navigation->parentController()->show(
|
||||||
Box<EditPeerTypeBox>(
|
Box<EditPeerTypeBox>(
|
||||||
_peer,
|
_peer,
|
||||||
_channelHasLocationOriginalValue,
|
_channelHasLocationOriginalValue,
|
||||||
|
@ -681,7 +685,7 @@ void Controller::showEditLinkedChatBox() {
|
||||||
|| channel->canEditPreHistoryHidden()));
|
|| channel->canEditPreHistoryHidden()));
|
||||||
|
|
||||||
if (const auto chat = *_linkedChatSavedValue) {
|
if (const auto chat = *_linkedChatSavedValue) {
|
||||||
*box = Ui::show(
|
*box = _navigation->parentController()->show(
|
||||||
EditLinkedChatBox(
|
EditLinkedChatBox(
|
||||||
_navigation,
|
_navigation,
|
||||||
channel,
|
channel,
|
||||||
|
@ -709,7 +713,7 @@ void Controller::showEditLinkedChatBox() {
|
||||||
for (const auto &item : list) {
|
for (const auto &item : list) {
|
||||||
chats.emplace_back(_peer->owner().processChat(item));
|
chats.emplace_back(_peer->owner().processChat(item));
|
||||||
}
|
}
|
||||||
*box = Ui::show(
|
*box = _navigation->parentController()->show(
|
||||||
EditLinkedChatBox(
|
EditLinkedChatBox(
|
||||||
_navigation,
|
_navigation,
|
||||||
channel,
|
channel,
|
||||||
|
@ -858,7 +862,7 @@ void Controller::fillHistoryVisibilityButton() {
|
||||||
_historyVisibilitySavedValue = checked;
|
_historyVisibilitySavedValue = checked;
|
||||||
});
|
});
|
||||||
const auto buttonCallback = [=] {
|
const auto buttonCallback = [=] {
|
||||||
Ui::show(
|
_navigation->parentController()->show(
|
||||||
Box<EditPeerHistoryVisibilityBox>(
|
Box<EditPeerHistoryVisibilityBox>(
|
||||||
_peer,
|
_peer,
|
||||||
boxCallback,
|
boxCallback,
|
||||||
|
@ -1023,9 +1027,15 @@ void Controller::fillManageSection() {
|
||||||
wrap->entity(),
|
wrap->entity(),
|
||||||
tr::lng_manage_peer_invite_links(),
|
tr::lng_manage_peer_invite_links(),
|
||||||
rpl::duplicate(count) | ToPositiveNumberString(),
|
rpl::duplicate(count) | ToPositiveNumberString(),
|
||||||
[=] { Ui::show(
|
[=] {
|
||||||
Box(ManageInviteLinksBox, _peer, _peer->session().user(), 0, 0),
|
_navigation->parentController()->show(
|
||||||
Ui::LayerOption::KeepOther);
|
Box(
|
||||||
|
ManageInviteLinksBox,
|
||||||
|
_peer,
|
||||||
|
_peer->session().user(),
|
||||||
|
0,
|
||||||
|
0),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
},
|
},
|
||||||
st::infoIconInviteLinks);
|
st::infoIconInviteLinks);
|
||||||
|
|
||||||
|
@ -1520,7 +1530,7 @@ void Controller::deleteWithConfirmation() {
|
||||||
const auto deleteCallback = crl::guard(this, [=] {
|
const auto deleteCallback = crl::guard(this, [=] {
|
||||||
deleteChannel();
|
deleteChannel();
|
||||||
});
|
});
|
||||||
Ui::show(
|
_navigation->parentController()->show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
tr::lng_box_delete(tr::now),
|
tr::lng_box_delete(tr::now),
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ void SendFilesBox::sendScheduled() {
|
||||||
? SendMenu::Type::ScheduledToUser
|
? SendMenu::Type::ScheduledToUser
|
||||||
: _sendMenuType;
|
: _sendMenuType;
|
||||||
const auto callback = [=](Api::SendOptions options) { send(options); };
|
const auto callback = [=](Api::SendOptions options) { send(options); };
|
||||||
Ui::show(
|
_controller->show(
|
||||||
HistoryView::PrepareScheduleBox(this, type, callback),
|
HistoryView::PrepareScheduleBox(this, type, callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ QPointer<Ui::BoxContent> StickerSetBox::Show(
|
||||||
not_null<DocumentData*> document) {
|
not_null<DocumentData*> document) {
|
||||||
if (const auto sticker = document->sticker()) {
|
if (const auto sticker = document->sticker()) {
|
||||||
if (sticker->set.type() != mtpc_inputStickerSetEmpty) {
|
if (sticker->set.type() != mtpc_inputStickerSetEmpty) {
|
||||||
return Ui::show(
|
return controller->show(
|
||||||
Box<StickerSetBox>(controller, sticker->set),
|
Box<StickerSetBox>(controller, sticker->set),
|
||||||
Ui::LayerOption::KeepOther).data();
|
Ui::LayerOption::KeepOther).data();
|
||||||
}
|
}
|
||||||
|
@ -324,7 +324,7 @@ StickerSetBox::Inner::Inner(
|
||||||
gotSet(result);
|
gotSet(result);
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
_loaded = true;
|
_loaded = true;
|
||||||
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
controller->show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
}).send();
|
}).send();
|
||||||
|
|
||||||
_controller->session().api().updateStickers();
|
_controller->session().api().updateStickers();
|
||||||
|
@ -419,7 +419,8 @@ void StickerSetBox::Inner::gotSet(const MTPmessages_StickerSet &set) {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (_pack.isEmpty()) {
|
if (_pack.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
_controller->show(
|
||||||
|
Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
int32 rows = _pack.size() / kStickersPanelPerRow + ((_pack.size() % kStickersPanelPerRow) ? 1 : 0);
|
int32 rows = _pack.size() / kStickersPanelPerRow + ((_pack.size() % kStickersPanelPerRow) ? 1 : 0);
|
||||||
|
@ -795,7 +796,7 @@ QString StickerSetBox::Inner::shortName() const {
|
||||||
|
|
||||||
void StickerSetBox::Inner::install() {
|
void StickerSetBox::Inner::install() {
|
||||||
if (isMasksSet()) {
|
if (isMasksSet()) {
|
||||||
Ui::show(
|
_controller->show(
|
||||||
Box<InformBox>(tr::lng_stickers_masks_pack(tr::now)),
|
Box<InformBox>(tr::lng_stickers_masks_pack(tr::now)),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
return;
|
return;
|
||||||
|
@ -808,7 +809,8 @@ void StickerSetBox::Inner::install() {
|
||||||
)).done([=](const MTPmessages_StickerSetInstallResult &result) {
|
)).done([=](const MTPmessages_StickerSetInstallResult &result) {
|
||||||
installDone(result);
|
installDone(result);
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
_controller->show(
|
||||||
|
Box<InformBox>(tr::lng_stickers_not_found(tr::now)));
|
||||||
}).send();
|
}).send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1592,7 +1592,7 @@ void StickersBox::Inner::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
}();
|
}();
|
||||||
const auto showSetByRow = [&](const Row &row) {
|
const auto showSetByRow = [&](const Row &row) {
|
||||||
setSelected(SelectedRow());
|
setSelected(SelectedRow());
|
||||||
Ui::show(
|
_controller->show(
|
||||||
Box<StickerSetBox>(_controller, row.set->mtpInput()),
|
Box<StickerSetBox>(_controller, row.set->mtpInput()),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
};
|
};
|
||||||
|
|
|
@ -357,7 +357,7 @@ base::unique_qptr<Ui::PopupMenu> BoxController::rowContextMenu(
|
||||||
|
|
||||||
auto result = base::make_unique_q<Ui::PopupMenu>(parent);
|
auto result = base::make_unique_q<Ui::PopupMenu>(parent);
|
||||||
result->addAction(tr::lng_context_delete_selected(tr::now), [=] {
|
result->addAction(tr::lng_context_delete_selected(tr::now), [=] {
|
||||||
Ui::show(
|
_window->show(
|
||||||
Box<DeleteMessagesBox>(session, base::duplicate(ids)),
|
Box<DeleteMessagesBox>(session, base::duplicate(ids)),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
});
|
});
|
||||||
|
|
|
@ -281,7 +281,7 @@ Fn<bool(
|
||||||
return Ui::InputField::IsValidMarkdownLink(link)
|
return Ui::InputField::IsValidMarkdownLink(link)
|
||||||
&& !TextUtilities::IsMentionLink(link);
|
&& !TextUtilities::IsMentionLink(link);
|
||||||
}
|
}
|
||||||
Ui::show(Box<EditLinkBox>(controller, text, link, [=](
|
controller->show(Box<EditLinkBox>(controller, text, link, [=](
|
||||||
const QString &text,
|
const QString &text,
|
||||||
const QString &link) {
|
const QString &link) {
|
||||||
if (const auto strong = weak.data()) {
|
if (const auto strong = weak.data()) {
|
||||||
|
@ -321,7 +321,9 @@ void InitSpellchecker(
|
||||||
Core::App().settings().spellcheckerEnabledValue(),
|
Core::App().settings().spellcheckerEnabledValue(),
|
||||||
Spellchecker::SpellingHighlighter::CustomContextMenuItem{
|
Spellchecker::SpellingHighlighter::CustomContextMenuItem{
|
||||||
tr::lng_settings_manage_dictionaries(tr::now),
|
tr::lng_settings_manage_dictionaries(tr::now),
|
||||||
[=] { Ui::show(Box<Ui::ManageDictionariesBox>(controller)); }
|
[=] {
|
||||||
|
controller->show(Box<Ui::ManageDictionariesBox>(controller));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
field->setExtendedContextMenu(s->contextMenuCreated());
|
field->setExtendedContextMenu(s->contextMenuCreated());
|
||||||
#endif // TDESKTOP_DISABLE_SPELLCHECK
|
#endif // TDESKTOP_DISABLE_SPELLCHECK
|
||||||
|
|
|
@ -534,7 +534,7 @@ void StickersListWidget::Footer::mousePressEvent(QMouseEvent *e) {
|
||||||
updateSelected();
|
updateSelected();
|
||||||
|
|
||||||
if (_iconOver == SpecialOver::Settings) {
|
if (_iconOver == SpecialOver::Settings) {
|
||||||
Ui::show(Box<StickersBox>(
|
_pan->controller()->show(Box<StickersBox>(
|
||||||
_pan->controller(),
|
_pan->controller(),
|
||||||
(hasOnlyFeaturedSets()
|
(hasOnlyFeaturedSets()
|
||||||
? StickersBox::Section::Featured
|
? StickersBox::Section::Featured
|
||||||
|
@ -909,7 +909,7 @@ StickersListWidget::StickersListWidget(
|
||||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||||
|
|
||||||
_settings->addClickHandler([=] {
|
_settings->addClickHandler([=] {
|
||||||
Ui::show(
|
controller->show(
|
||||||
Box<StickersBox>(controller, StickersBox::Section::Installed));
|
Box<StickersBox>(controller, StickersBox::Section::Installed));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2185,7 +2185,7 @@ void StickersListWidget::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
removeSet(sets[button->section].id);
|
removeSet(sets[button->section].id);
|
||||||
}
|
}
|
||||||
} else if (std::get_if<OverGroupAdd>(&pressed)) {
|
} else if (std::get_if<OverGroupAdd>(&pressed)) {
|
||||||
Ui::show(Box<StickersBox>(controller(), _megagroupSet));
|
controller()->show(Box<StickersBox>(controller(), _megagroupSet));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3005,7 +3005,7 @@ void StickersListWidget::displaySet(uint64 setId) {
|
||||||
if (setId == Data::Stickers::MegagroupSetId) {
|
if (setId == Data::Stickers::MegagroupSetId) {
|
||||||
if (_megagroupSet->canEditStickers()) {
|
if (_megagroupSet->canEditStickers()) {
|
||||||
_displayingSet = true;
|
_displayingSet = true;
|
||||||
checkHideWithBox(Ui::show(
|
checkHideWithBox(controller()->show(
|
||||||
Box<StickersBox>(controller(), _megagroupSet),
|
Box<StickersBox>(controller(), _megagroupSet),
|
||||||
Ui::LayerOption::KeepOther).data());
|
Ui::LayerOption::KeepOther).data());
|
||||||
return;
|
return;
|
||||||
|
@ -3019,7 +3019,7 @@ void StickersListWidget::displaySet(uint64 setId) {
|
||||||
auto it = sets.find(setId);
|
auto it = sets.find(setId);
|
||||||
if (it != sets.cend()) {
|
if (it != sets.cend()) {
|
||||||
_displayingSet = true;
|
_displayingSet = true;
|
||||||
checkHideWithBox(Ui::show(
|
checkHideWithBox(controller()->show(
|
||||||
Box<StickerSetBox>(controller(), it->second->mtpInput()),
|
Box<StickerSetBox>(controller(), it->second->mtpInput()),
|
||||||
Ui::LayerOption::KeepOther).data());
|
Ui::LayerOption::KeepOther).data());
|
||||||
}
|
}
|
||||||
|
@ -3083,7 +3083,7 @@ void StickersListWidget::removeMegagroupSet(bool locally) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_removingSetId = Data::Stickers::MegagroupSetId;
|
_removingSetId = Data::Stickers::MegagroupSetId;
|
||||||
Ui::show(Box<ConfirmBox>(tr::lng_stickers_remove_group_set(tr::now), crl::guard(this, [this, group = _megagroupSet] {
|
controller()->show(Box<ConfirmBox>(tr::lng_stickers_remove_group_set(tr::now), crl::guard(this, [this, group = _megagroupSet] {
|
||||||
Expects(group->mgInfo != nullptr);
|
Expects(group->mgInfo != nullptr);
|
||||||
|
|
||||||
if (group->mgInfo->stickerSet.type() != mtpc_inputStickerSetEmpty) {
|
if (group->mgInfo->stickerSet.type() != mtpc_inputStickerSetEmpty) {
|
||||||
|
@ -3105,7 +3105,7 @@ void StickersListWidget::removeSet(uint64 setId) {
|
||||||
const auto set = it->second.get();
|
const auto set = it->second.get();
|
||||||
_removingSetId = set->id;
|
_removingSetId = set->id;
|
||||||
auto text = tr::lng_stickers_remove_pack(tr::now, lt_sticker_pack, set->title);
|
auto text = tr::lng_stickers_remove_pack(tr::now, lt_sticker_pack, set->title);
|
||||||
Ui::show(Box<ConfirmBox>(text, tr::lng_stickers_remove_pack_confirm(tr::now), crl::guard(this, [=] {
|
controller()->show(Box<ConfirmBox>(text, tr::lng_stickers_remove_pack_confirm(tr::now), crl::guard(this, [=] {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
const auto &sets = session().data().stickers().sets();
|
const auto &sets = session().data().stickers().sets();
|
||||||
const auto it = sets.find(_removingSetId);
|
const auto it = sets.find(_removingSetId);
|
||||||
|
|
|
@ -68,7 +68,7 @@ bool ShowStickerSet(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Core::App().hideMediaView();
|
Core::App().hideMediaView();
|
||||||
Ui::show(Box<StickerSetBox>(
|
controller->show(Box<StickerSetBox>(
|
||||||
controller,
|
controller,
|
||||||
MTP_inputStickerSetShortName(MTP_string(match->captured(1)))));
|
MTP_inputStickerSetShortName(MTP_string(match->captured(1)))));
|
||||||
return true;
|
return true;
|
||||||
|
@ -368,7 +368,7 @@ bool ResolveSettings(
|
||||||
}
|
}
|
||||||
if (section == qstr("devices")) {
|
if (section == qstr("devices")) {
|
||||||
controller->session().api().authorizations().reload();
|
controller->session().api().authorizations().reload();
|
||||||
Ui::show(Box<SessionsBox>(&controller->session()));
|
controller->show(Box<SessionsBox>(&controller->session()));
|
||||||
return true;
|
return true;
|
||||||
} else if (section == qstr("language")) {
|
} else if (section == qstr("language")) {
|
||||||
ShowLanguagesBox();
|
ShowLanguagesBox();
|
||||||
|
@ -401,12 +401,12 @@ bool HandleUnknown(
|
||||||
Core::UpdateApplication();
|
Core::UpdateApplication();
|
||||||
close();
|
close();
|
||||||
};
|
};
|
||||||
Ui::show(Box<ConfirmBox>(
|
controller->show(Box<ConfirmBox>(
|
||||||
text,
|
text,
|
||||||
tr::lng_menu_update(tr::now),
|
tr::lng_menu_update(tr::now),
|
||||||
callback));
|
callback));
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(text));
|
controller->show(Box<InformBox>(text));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
controller->session().api().requestDeepLinkInfo(request, callback);
|
controller->session().api().requestDeepLinkInfo(request, callback);
|
||||||
|
|
|
@ -3192,7 +3192,7 @@ void InnerWidget::setupShortcuts() {
|
||||||
});
|
});
|
||||||
|
|
||||||
request->check(Command::ShowContacts) && request->handle([=] {
|
request->check(Command::ShowContacts) && request->handle([=] {
|
||||||
Ui::show(PrepareContactsBox(_controller));
|
_controller->show(PrepareContactsBox(_controller));
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -478,7 +478,8 @@ void InnerWidget::showFilter(Fn<void(FilterValue &&filter)> callback) {
|
||||||
if (_admins.empty()) {
|
if (_admins.empty()) {
|
||||||
_showFilterCallback = std::move(callback);
|
_showFilterCallback = std::move(callback);
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<FilterBox>(_channel, _admins, _filter, std::move(callback)));
|
_controller->show(
|
||||||
|
Box<FilterBox>(_channel, _admins, _filter, std::move(callback)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1317,7 +1318,8 @@ void InnerWidget::suggestRestrictUser(not_null<UserData*> user) {
|
||||||
(*weakBox)->closeBox();
|
(*weakBox)->closeBox();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
*weakBox = Ui::show(
|
*weakBox = QPointer<EditRestrictedBox>(box.data());
|
||||||
|
_controller->show(
|
||||||
std::move(box),
|
std::move(box),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
};
|
};
|
||||||
|
|
|
@ -326,7 +326,7 @@ Widget::Widget(
|
||||||
connect(_scroll, &Ui::ScrollArea::scrolled, this, [this] { onScroll(); });
|
connect(_scroll, &Ui::ScrollArea::scrolled, this, [this] { onScroll(); });
|
||||||
|
|
||||||
_whatIsThis->setClickedCallback([=] {
|
_whatIsThis->setClickedCallback([=] {
|
||||||
Ui::show(Box<InformBox>(channel->isMegagroup()
|
controller->show(Box<InformBox>(channel->isMegagroup()
|
||||||
? tr::lng_admin_log_about_text(tr::now)
|
? tr::lng_admin_log_about_text(tr::now)
|
||||||
: tr::lng_admin_log_about_text_channel(tr::now)));
|
: tr::lng_admin_log_about_text_channel(tr::now)));
|
||||||
});
|
});
|
||||||
|
|
|
@ -3226,7 +3226,7 @@ void HistoryInner::deleteItem(not_null<HistoryItem*> item) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto suggestModerateActions = true;
|
const auto suggestModerateActions = true;
|
||||||
Ui::show(Box<DeleteMessagesBox>(item, suggestModerateActions));
|
_controller->show(Box<DeleteMessagesBox>(item, suggestModerateActions));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HistoryInner::hasPendingResizedItems() const {
|
bool HistoryInner::hasPendingResizedItems() const {
|
||||||
|
@ -3240,7 +3240,7 @@ void HistoryInner::deleteAsGroup(FullMsgId itemId) {
|
||||||
if (!group) {
|
if (!group) {
|
||||||
return deleteItem(item);
|
return deleteItem(item);
|
||||||
}
|
}
|
||||||
Ui::show(Box<DeleteMessagesBox>(
|
_controller->show(Box<DeleteMessagesBox>(
|
||||||
&session(),
|
&session(),
|
||||||
session().data().itemsToIds(group->items)));
|
session().data().itemsToIds(group->items)));
|
||||||
}
|
}
|
||||||
|
@ -3263,7 +3263,7 @@ void HistoryInner::reportAsGroup(FullMsgId itemId) {
|
||||||
|
|
||||||
void HistoryInner::blockSenderItem(FullMsgId itemId) {
|
void HistoryInner::blockSenderItem(FullMsgId itemId) {
|
||||||
if (const auto item = session().data().message(itemId)) {
|
if (const auto item = session().data().message(itemId)) {
|
||||||
Ui::show(Box(
|
_controller->show(Box(
|
||||||
Window::BlockSenderFromRepliesBox,
|
Window::BlockSenderFromRepliesBox,
|
||||||
_controller,
|
_controller,
|
||||||
itemId));
|
itemId));
|
||||||
|
|
|
@ -627,7 +627,7 @@ HistoryWidget::HistoryWidget(
|
||||||
const auto unavailable = _peer->computeUnavailableReason();
|
const auto unavailable = _peer->computeUnavailableReason();
|
||||||
if (!unavailable.isEmpty()) {
|
if (!unavailable.isEmpty()) {
|
||||||
controller->showBackFromStack();
|
controller->showBackFromStack();
|
||||||
Ui::show(Box<InformBox>(unavailable));
|
controller->show(Box<InformBox>(unavailable));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -791,7 +791,7 @@ void HistoryWidget::initVoiceRecordBar() {
|
||||||
? Data::RestrictionError(_peer, ChatRestriction::f_send_media)
|
? Data::RestrictionError(_peer, ChatRestriction::f_send_media)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error));
|
controller()->show(Box<InformBox>(*error));
|
||||||
return true;
|
return true;
|
||||||
} else if (showSlowmodeError()) {
|
} else if (showSlowmodeError()) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -948,7 +948,7 @@ void HistoryWidget::supportShareContact(Support::Contact contact) {
|
||||||
contact.lastName,
|
contact.lastName,
|
||||||
action);
|
action);
|
||||||
};
|
};
|
||||||
const auto box = Ui::show(Box<Support::ConfirmContactBox>(
|
const auto box = controller()->show(Box<Support::ConfirmContactBox>(
|
||||||
controller(),
|
controller(),
|
||||||
_history,
|
_history,
|
||||||
contact,
|
contact,
|
||||||
|
@ -3089,10 +3089,11 @@ void HistoryWidget::saveEditMsg() {
|
||||||
|
|
||||||
if (!TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
if (!TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
||||||
const auto suggestModerateActions = false;
|
const auto suggestModerateActions = false;
|
||||||
Ui::show(Box<DeleteMessagesBox>(item, suggestModerateActions));
|
controller()->show(
|
||||||
|
Box<DeleteMessagesBox>(item, suggestModerateActions));
|
||||||
return;
|
return;
|
||||||
} else if (!left.text.isEmpty()) {
|
} else if (!left.text.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
controller()->show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3126,14 +3127,16 @@ void HistoryWidget::saveEditMsg() {
|
||||||
}
|
}
|
||||||
const auto &err = error.type();
|
const auto &err = error.type();
|
||||||
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
controller()->show(
|
||||||
|
Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||||
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
||||||
cancelEdit();
|
cancelEdit();
|
||||||
} else if (err == u"MESSAGE_EMPTY"_q) {
|
} else if (err == u"MESSAGE_EMPTY"_q) {
|
||||||
_field->selectAll();
|
_field->selectAll();
|
||||||
_field->setFocus();
|
_field->setFocus();
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
controller()->show(
|
||||||
|
Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
})();
|
})();
|
||||||
|
@ -3256,7 +3259,7 @@ void HistoryWidget::sendScheduled() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto callback = [=](Api::SendOptions options) { send(options); };
|
const auto callback = [=](Api::SendOptions options) { send(options); };
|
||||||
Ui::show(
|
controller()->show(
|
||||||
HistoryView::PrepareScheduleBox(_list, sendMenuType(), callback),
|
HistoryView::PrepareScheduleBox(_list, sendMenuType(), callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -3470,7 +3473,7 @@ void HistoryWidget::checkSuggestToGigagroup() {
|
||||||
group->input,
|
group->input,
|
||||||
MTP_string("convert_to_gigagroup")
|
MTP_string("convert_to_gigagroup")
|
||||||
)).send();
|
)).send();
|
||||||
Ui::show(Box([=](not_null<Ui::GenericBox*> box) {
|
controller()->show(Box([=](not_null<Ui::GenericBox*> box) {
|
||||||
box->setTitle(tr::lng_gigagroup_suggest_title());
|
box->setTitle(tr::lng_gigagroup_suggest_title());
|
||||||
box->addRow(
|
box->addRow(
|
||||||
object_ptr<Ui::FlatLabel>(
|
object_ptr<Ui::FlatLabel>(
|
||||||
|
@ -3508,7 +3511,8 @@ void HistoryWidget::unreadMentionsAnimationFinish() {
|
||||||
|
|
||||||
void HistoryWidget::chooseAttach() {
|
void HistoryWidget::chooseAttach() {
|
||||||
if (_editMsgId) {
|
if (_editMsgId) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
controller()->show(
|
||||||
|
Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4335,7 +4339,8 @@ bool HistoryWidget::confirmSendingFiles(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (_editMsgId) {
|
if (_editMsgId) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
controller()->show(
|
||||||
|
Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4379,7 +4384,7 @@ bool HistoryWidget::confirmSendingFiles(
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Window::ActivateWindow(controller());
|
Window::ActivateWindow(controller());
|
||||||
const auto shown = Ui::show(std::move(box));
|
const auto shown = controller()->show(std::move(box));
|
||||||
shown->setCloseByOutsideClick(false);
|
shown->setCloseByOutsideClick(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -5330,7 +5335,7 @@ void HistoryWidget::sendInlineResult(InlineBots::ResultSelected result) {
|
||||||
|
|
||||||
auto errorText = result.result->getErrorOnSend(_history);
|
auto errorText = result.result->getErrorOnSend(_history);
|
||||||
if (!errorText.isEmpty()) {
|
if (!errorText.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(errorText));
|
controller()->show(Box<InformBox>(errorText));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5664,7 +5669,9 @@ bool HistoryWidget::sendExistingDocument(
|
||||||
? Data::RestrictionError(_peer, ChatRestriction::f_send_stickers)
|
? Data::RestrictionError(_peer, ChatRestriction::f_send_stickers)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error), Ui::LayerOption::KeepOther);
|
controller()->show(
|
||||||
|
Box<InformBox>(*error),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
} else if (!_peer || !_peer->canWrite()) {
|
} else if (!_peer || !_peer->canWrite()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -5698,7 +5705,9 @@ bool HistoryWidget::sendExistingPhoto(
|
||||||
? Data::RestrictionError(_peer, ChatRestriction::f_send_media)
|
? Data::RestrictionError(_peer, ChatRestriction::f_send_media)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error), Ui::LayerOption::KeepOther);
|
controller()->show(
|
||||||
|
Box<InformBox>(*error),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
} else if (!_peer || !_peer->canWrite()) {
|
} else if (!_peer || !_peer->canWrite()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -5782,14 +5791,18 @@ void HistoryWidget::replyToMessage(not_null<HistoryItem*> item) {
|
||||||
}
|
}
|
||||||
if (item->history() == _migrated) {
|
if (item->history() == _migrated) {
|
||||||
if (item->serviceMsg()) {
|
if (item->serviceMsg()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_reply_cant(tr::now)));
|
controller()->show(Box<InformBox>(tr::lng_reply_cant(tr::now)));
|
||||||
} else {
|
} else {
|
||||||
const auto itemId = item->fullId();
|
const auto itemId = item->fullId();
|
||||||
Ui::show(Box<ConfirmBox>(tr::lng_reply_cant_forward(tr::now), tr::lng_selected_forward(tr::now), crl::guard(this, [=] {
|
controller()->show(
|
||||||
controller()->content()->setForwardDraft(
|
Box<ConfirmBox>(
|
||||||
_peer->id,
|
tr::lng_reply_cant_forward(tr::now),
|
||||||
{ 1, itemId });
|
tr::lng_selected_forward(tr::now),
|
||||||
})));
|
crl::guard(this, [=] {
|
||||||
|
controller()->content()->setForwardDraft(
|
||||||
|
_peer->id,
|
||||||
|
{ 1, itemId });
|
||||||
|
})));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -5832,12 +5845,13 @@ void HistoryWidget::editMessage(FullMsgId itemId) {
|
||||||
|
|
||||||
void HistoryWidget::editMessage(not_null<HistoryItem*> item) {
|
void HistoryWidget::editMessage(not_null<HistoryItem*> item) {
|
||||||
if (_voiceRecordBar->isActive()) {
|
if (_voiceRecordBar->isActive()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
controller()->show(
|
||||||
|
Box<InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (const auto media = item->media()) {
|
if (const auto media = item->media()) {
|
||||||
if (media->allowsEditCaption()) {
|
if (media->allowsEditCaption()) {
|
||||||
Ui::show(Box<EditCaptionBox>(controller(), item));
|
controller()->show(Box<EditCaptionBox>(controller(), item));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6283,14 +6297,13 @@ void HistoryWidget::confirmDeleteSelected() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto weak = Ui::MakeWeak(this);
|
const auto weak = Ui::MakeWeak(this);
|
||||||
const auto box = Ui::show(Box<DeleteMessagesBox>(
|
auto box = Box<DeleteMessagesBox>(&session(), std::move(items));
|
||||||
&session(),
|
|
||||||
std::move(items)));
|
|
||||||
box->setDeleteConfirmedCallback([=] {
|
box->setDeleteConfirmedCallback([=] {
|
||||||
if (const auto strong = weak.data()) {
|
if (const auto strong = weak.data()) {
|
||||||
strong->clearSelected();
|
strong->clearSelected();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
controller()->show(std::move(box));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::escape() {
|
void HistoryWidget::escape() {
|
||||||
|
@ -6303,7 +6316,7 @@ void HistoryWidget::escape() {
|
||||||
} else if (_editMsgId) {
|
} else if (_editMsgId) {
|
||||||
if (_replyEditMsg
|
if (_replyEditMsg
|
||||||
&& PrepareEditText(_replyEditMsg) != _field->getTextWithTags()) {
|
&& PrepareEditText(_replyEditMsg) != _field->getTextWithTags()) {
|
||||||
Ui::show(Box<ConfirmBox>(
|
controller()->show(Box<ConfirmBox>(
|
||||||
tr::lng_cancel_edit_post_sure(tr::now),
|
tr::lng_cancel_edit_post_sure(tr::now),
|
||||||
tr::lng_cancel_edit_post_yes(tr::now),
|
tr::lng_cancel_edit_post_yes(tr::now),
|
||||||
tr::lng_cancel_edit_post_no(tr::now),
|
tr::lng_cancel_edit_post_no(tr::now),
|
||||||
|
|
|
@ -795,7 +795,8 @@ rpl::producer<> ComposeControls::attachRequests() const {
|
||||||
_attachRequests.events()
|
_attachRequests.events()
|
||||||
) | rpl::filter([=] {
|
) | rpl::filter([=] {
|
||||||
if (isEditingMessage()) {
|
if (isEditingMessage()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
_window->show(
|
||||||
|
Box<InformBox>(tr::lng_edit_caption_attach(tr::now)));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1655,7 +1656,7 @@ void ComposeControls::initVoiceRecordBar() {
|
||||||
ChatRestriction::f_send_media)
|
ChatRestriction::f_send_media)
|
||||||
: std::nullopt;
|
: std::nullopt;
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error));
|
_window->show(Box<InformBox>(*error));
|
||||||
return true;
|
return true;
|
||||||
} else if (_showSlowmodeError && _showSlowmodeError()) {
|
} else if (_showSlowmodeError && _showSlowmodeError()) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1954,7 +1955,7 @@ void ComposeControls::editMessage(not_null<HistoryItem*> item) {
|
||||||
Expects(draftKeyCurrent() != Data::DraftKey::None());
|
Expects(draftKeyCurrent() != Data::DraftKey::None());
|
||||||
|
|
||||||
if (_voiceRecordBar->isActive()) {
|
if (_voiceRecordBar->isActive()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
_window->show(Box<InformBox>(tr::lng_edit_caption_voice(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1638,7 +1638,7 @@ void VoiceRecordBar::showDiscardBox(
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Ui::show(Box<ConfirmBox>(
|
_controller->show(Box<ConfirmBox>(
|
||||||
(isListenState()
|
(isListenState()
|
||||||
? tr::lng_record_listen_cancel_sure
|
? tr::lng_record_listen_cancel_sure
|
||||||
: tr::lng_record_lock_cancel_sure)(tr::now),
|
: tr::lng_record_lock_cancel_sure)(tr::now),
|
||||||
|
|
|
@ -508,7 +508,7 @@ bool AddRescheduleAction(
|
||||||
? HistoryView::DefaultScheduleTime()
|
? HistoryView::DefaultScheduleTime()
|
||||||
: itemDate + 600;
|
: itemDate + 600;
|
||||||
|
|
||||||
const auto box = Ui::show(
|
const auto box = request.navigation->parentController()->show(
|
||||||
HistoryView::PrepareScheduleBox(
|
HistoryView::PrepareScheduleBox(
|
||||||
&request.navigation->session(),
|
&request.navigation->session(),
|
||||||
sendMenuType,
|
sendMenuType,
|
||||||
|
@ -676,14 +676,15 @@ bool AddDeleteSelectedAction(
|
||||||
menu->addAction(tr::lng_context_delete_selected(tr::now), [=] {
|
menu->addAction(tr::lng_context_delete_selected(tr::now), [=] {
|
||||||
const auto weak = Ui::MakeWeak(list);
|
const auto weak = Ui::MakeWeak(list);
|
||||||
auto items = ExtractIdsList(request.selectedItems);
|
auto items = ExtractIdsList(request.selectedItems);
|
||||||
const auto box = Ui::show(Box<DeleteMessagesBox>(
|
auto box = Box<DeleteMessagesBox>(
|
||||||
&request.navigation->session(),
|
&request.navigation->session(),
|
||||||
std::move(items)));
|
std::move(items));
|
||||||
box->setDeleteConfirmedCallback([=] {
|
box->setDeleteConfirmedCallback([=] {
|
||||||
if (const auto strong = weak.data()) {
|
if (const auto strong = weak.data()) {
|
||||||
strong->cancelSelection();
|
strong->cancelSelection();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
request.navigation->parentController()->show(std::move(box));
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -716,7 +717,7 @@ bool AddDeleteMessageAction(
|
||||||
if (const auto item = owner->message(itemId)) {
|
if (const auto item = owner->message(itemId)) {
|
||||||
if (asGroup) {
|
if (asGroup) {
|
||||||
if (const auto group = owner->groups().find(item)) {
|
if (const auto group = owner->groups().find(item)) {
|
||||||
Ui::show(Box<DeleteMessagesBox>(
|
controller->show(Box<DeleteMessagesBox>(
|
||||||
&owner->session(),
|
&owner->session(),
|
||||||
owner->itemsToIds(group->items)));
|
owner->itemsToIds(group->items)));
|
||||||
return;
|
return;
|
||||||
|
@ -729,7 +730,8 @@ bool AddDeleteMessageAction(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto suggestModerateActions = true;
|
const auto suggestModerateActions = true;
|
||||||
Ui::show(Box<DeleteMessagesBox>(item, suggestModerateActions));
|
controller->show(
|
||||||
|
Box<DeleteMessagesBox>(item, suggestModerateActions));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (const auto message = item->toHistoryMessage()) {
|
if (const auto message = item->toHistoryMessage()) {
|
||||||
|
|
|
@ -2826,14 +2826,15 @@ void ConfirmDeleteSelectedItems(not_null<ListWidget*> widget) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto weak = Ui::MakeWeak(widget);
|
const auto weak = Ui::MakeWeak(widget);
|
||||||
const auto box = Ui::show(Box<DeleteMessagesBox>(
|
auto box = Box<DeleteMessagesBox>(
|
||||||
&widget->controller()->session(),
|
&widget->controller()->session(),
|
||||||
widget->getSelectedIds()));
|
widget->getSelectedIds());
|
||||||
box->setDeleteConfirmedCallback([=] {
|
box->setDeleteConfirmedCallback([=] {
|
||||||
if (const auto strong = weak.data()) {
|
if (const auto strong = weak.data()) {
|
||||||
strong->cancelSelection();
|
strong->cancelSelection();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
widget->controller()->show(std::move(box));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfirmForwardSelectedItems(not_null<ListWidget*> widget) {
|
void ConfirmForwardSelectedItems(not_null<ListWidget*> widget) {
|
||||||
|
|
|
@ -215,7 +215,7 @@ RepliesWidget::RepliesWidget(
|
||||||
const auto media = item->media();
|
const auto media = item->media();
|
||||||
if (media && !media->webpage()) {
|
if (media && !media->webpage()) {
|
||||||
if (media->allowsEditCaption()) {
|
if (media->allowsEditCaption()) {
|
||||||
Ui::show(Box<EditCaptionBox>(controller, item));
|
controller->show(Box<EditCaptionBox>(controller, item));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_composeControls->editMessage(fullId);
|
_composeControls->editMessage(fullId);
|
||||||
|
@ -655,7 +655,7 @@ bool RepliesWidget::confirmSendingFiles(
|
||||||
insertTextOnCancel));
|
insertTextOnCancel));
|
||||||
|
|
||||||
//ActivateWindow(controller());
|
//ActivateWindow(controller());
|
||||||
const auto shown = Ui::show(std::move(box));
|
const auto shown = controller()->show(std::move(box));
|
||||||
shown->setCloseByOutsideClick(false);
|
shown->setCloseByOutsideClick(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -945,13 +945,13 @@ void RepliesWidget::edit(
|
||||||
|
|
||||||
if (!TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
if (!TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
||||||
if (item) {
|
if (item) {
|
||||||
Ui::show(Box<DeleteMessagesBox>(item, false));
|
controller()->show(Box<DeleteMessagesBox>(item, false));
|
||||||
} else {
|
} else {
|
||||||
doSetInnerFocus();
|
doSetInnerFocus();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (!left.text.isEmpty()) {
|
} else if (!left.text.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
controller()->show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -976,13 +976,13 @@ void RepliesWidget::edit(
|
||||||
|
|
||||||
const auto &err = error.type();
|
const auto &err = error.type();
|
||||||
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
controller()->show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||||
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
||||||
_composeControls->cancelEditMessage();
|
_composeControls->cancelEditMessage();
|
||||||
} else if (err == u"MESSAGE_EMPTY"_q) {
|
} else if (err == u"MESSAGE_EMPTY"_q) {
|
||||||
doSetInnerFocus();
|
doSetInnerFocus();
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
controller()->show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
|
@ -1018,7 +1018,9 @@ bool RepliesWidget::sendExistingDocument(
|
||||||
_history->peer,
|
_history->peer,
|
||||||
ChatRestriction::f_send_stickers);
|
ChatRestriction::f_send_stickers);
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error), Ui::LayerOption::KeepOther);
|
controller()->show(
|
||||||
|
Box<InformBox>(*error),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
} else if (showSlowmodeError()) {
|
} else if (showSlowmodeError()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1052,7 +1054,9 @@ bool RepliesWidget::sendExistingPhoto(
|
||||||
_history->peer,
|
_history->peer,
|
||||||
ChatRestriction::f_send_media);
|
ChatRestriction::f_send_media);
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error), Ui::LayerOption::KeepOther);
|
controller()->show(
|
||||||
|
Box<InformBox>(*error),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
} else if (showSlowmodeError()) {
|
} else if (showSlowmodeError()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1073,7 +1077,7 @@ void RepliesWidget::sendInlineResult(
|
||||||
not_null<UserData*> bot) {
|
not_null<UserData*> bot) {
|
||||||
const auto errorText = result->getErrorOnSend(_history);
|
const auto errorText = result->getErrorOnSend(_history);
|
||||||
if (!errorText.isEmpty()) {
|
if (!errorText.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(errorText));
|
controller()->show(Box<InformBox>(errorText));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sendInlineResult(result, bot, Api::SendOptions());
|
sendInlineResult(result, bot, Api::SendOptions());
|
||||||
|
|
|
@ -148,7 +148,7 @@ ScheduledWidget::ScheduledWidget(
|
||||||
const auto media = item->media();
|
const auto media = item->media();
|
||||||
if (media && !media->webpage()) {
|
if (media && !media->webpage()) {
|
||||||
if (media->allowsEditCaption()) {
|
if (media->allowsEditCaption()) {
|
||||||
Ui::show(Box<EditCaptionBox>(controller, item));
|
controller->show(Box<EditCaptionBox>(controller, item));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_composeControls->editMessage(fullId);
|
_composeControls->editMessage(fullId);
|
||||||
|
@ -384,7 +384,7 @@ bool ScheduledWidget::confirmSendingFiles(
|
||||||
insertTextOnCancel));
|
insertTextOnCancel));
|
||||||
|
|
||||||
//ActivateWindow(controller());
|
//ActivateWindow(controller());
|
||||||
const auto shown = Ui::show(std::move(box));
|
const auto shown = controller()->show(std::move(box));
|
||||||
shown->setCloseByOutsideClick(false);
|
shown->setCloseByOutsideClick(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -454,7 +454,7 @@ void ScheduledWidget::uploadFile(
|
||||||
action.options = options;
|
action.options = options;
|
||||||
session().api().sendFile(fileContent, type, action);
|
session().api().sendFile(fileContent, type, action);
|
||||||
};
|
};
|
||||||
Ui::show(
|
controller()->show(
|
||||||
PrepareScheduleBox(this, sendMenuType(), callback),
|
PrepareScheduleBox(this, sendMenuType(), callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -499,7 +499,7 @@ void ScheduledWidget::send() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto callback = [=](Api::SendOptions options) { send(options); };
|
const auto callback = [=](Api::SendOptions options) { send(options); };
|
||||||
Ui::show(
|
controller()->show(
|
||||||
PrepareScheduleBox(this, sendMenuType(), callback),
|
PrepareScheduleBox(this, sendMenuType(), callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ void ScheduledWidget::sendVoice(
|
||||||
const auto callback = [=](Api::SendOptions options) {
|
const auto callback = [=](Api::SendOptions options) {
|
||||||
sendVoice(bytes, waveform, duration, options);
|
sendVoice(bytes, waveform, duration, options);
|
||||||
};
|
};
|
||||||
Ui::show(
|
controller()->show(
|
||||||
PrepareScheduleBox(this, sendMenuType(), callback),
|
PrepareScheduleBox(this, sendMenuType(), callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -579,13 +579,13 @@ void ScheduledWidget::edit(
|
||||||
|
|
||||||
if (!TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
if (!TextUtilities::CutPart(sending, left, MaxMessageSize)) {
|
||||||
if (item) {
|
if (item) {
|
||||||
Ui::show(Box<DeleteMessagesBox>(item, false));
|
controller()->show(Box<DeleteMessagesBox>(item, false));
|
||||||
} else {
|
} else {
|
||||||
_composeControls->focus();
|
_composeControls->focus();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if (!left.text.isEmpty()) {
|
} else if (!left.text.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
controller()->show(Box<InformBox>(tr::lng_edit_too_long(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,13 +610,13 @@ void ScheduledWidget::edit(
|
||||||
|
|
||||||
const auto &err = error.type();
|
const auto &err = error.type();
|
||||||
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
if (ranges::contains(Api::kDefaultEditMessagesErrors, err)) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
controller()->show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||||
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
} else if (err == u"MESSAGE_NOT_MODIFIED"_q) {
|
||||||
_composeControls->cancelEditMessage();
|
_composeControls->cancelEditMessage();
|
||||||
} else if (err == u"MESSAGE_EMPTY"_q) {
|
} else if (err == u"MESSAGE_EMPTY"_q) {
|
||||||
_composeControls->focus();
|
_composeControls->focus();
|
||||||
} else {
|
} else {
|
||||||
Ui::show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
controller()->show(Box<InformBox>(tr::lng_edit_error(tr::now)));
|
||||||
}
|
}
|
||||||
update();
|
update();
|
||||||
return true;
|
return true;
|
||||||
|
@ -638,7 +638,7 @@ void ScheduledWidget::sendExistingDocument(
|
||||||
const auto callback = [=](Api::SendOptions options) {
|
const auto callback = [=](Api::SendOptions options) {
|
||||||
sendExistingDocument(document, options);
|
sendExistingDocument(document, options);
|
||||||
};
|
};
|
||||||
Ui::show(
|
controller()->show(
|
||||||
PrepareScheduleBox(this, sendMenuType(), callback),
|
PrepareScheduleBox(this, sendMenuType(), callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -650,7 +650,9 @@ bool ScheduledWidget::sendExistingDocument(
|
||||||
_history->peer,
|
_history->peer,
|
||||||
ChatRestriction::f_send_stickers);
|
ChatRestriction::f_send_stickers);
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error), Ui::LayerOption::KeepOther);
|
controller()->show(
|
||||||
|
Box<InformBox>(*error),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,7 +670,7 @@ void ScheduledWidget::sendExistingPhoto(not_null<PhotoData*> photo) {
|
||||||
const auto callback = [=](Api::SendOptions options) {
|
const auto callback = [=](Api::SendOptions options) {
|
||||||
sendExistingPhoto(photo, options);
|
sendExistingPhoto(photo, options);
|
||||||
};
|
};
|
||||||
Ui::show(
|
controller()->show(
|
||||||
PrepareScheduleBox(this, sendMenuType(), callback),
|
PrepareScheduleBox(this, sendMenuType(), callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -680,7 +682,9 @@ bool ScheduledWidget::sendExistingPhoto(
|
||||||
_history->peer,
|
_history->peer,
|
||||||
ChatRestriction::f_send_media);
|
ChatRestriction::f_send_media);
|
||||||
if (error) {
|
if (error) {
|
||||||
Ui::show(Box<InformBox>(*error), Ui::LayerOption::KeepOther);
|
controller()->show(
|
||||||
|
Box<InformBox>(*error),
|
||||||
|
Ui::LayerOption::KeepOther);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -699,13 +703,13 @@ void ScheduledWidget::sendInlineResult(
|
||||||
not_null<UserData*> bot) {
|
not_null<UserData*> bot) {
|
||||||
const auto errorText = result->getErrorOnSend(_history);
|
const auto errorText = result->getErrorOnSend(_history);
|
||||||
if (!errorText.isEmpty()) {
|
if (!errorText.isEmpty()) {
|
||||||
Ui::show(Box<InformBox>(errorText));
|
controller()->show(Box<InformBox>(errorText));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const auto callback = [=](Api::SendOptions options) {
|
const auto callback = [=](Api::SendOptions options) {
|
||||||
sendInlineResult(result, bot, options);
|
sendInlineResult(result, bot, options);
|
||||||
};
|
};
|
||||||
Ui::show(
|
controller()->show(
|
||||||
PrepareScheduleBox(this, sendMenuType(), callback),
|
PrepareScheduleBox(this, sendMenuType(), callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
@ -1174,7 +1178,7 @@ void ScheduledWidget::listSendBotCommand(
|
||||||
message.action.options = options;
|
message.action.options = options;
|
||||||
session().api().sendMessage(std::move(message));
|
session().api().sendMessage(std::move(message));
|
||||||
};
|
};
|
||||||
Ui::show(
|
controller()->show(
|
||||||
PrepareScheduleBox(this, sendMenuType(), callback),
|
PrepareScheduleBox(this, sendMenuType(), callback),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
|
|
@ -540,14 +540,15 @@ void TopBar::performDelete() {
|
||||||
if (items.empty()) {
|
if (items.empty()) {
|
||||||
_cancelSelectionClicks.fire({});
|
_cancelSelectionClicks.fire({});
|
||||||
} else {
|
} else {
|
||||||
const auto box = Ui::show(Box<DeleteMessagesBox>(
|
auto box = Box<DeleteMessagesBox>(
|
||||||
&_navigation->session(),
|
&_navigation->session(),
|
||||||
std::move(items)));
|
std::move(items));
|
||||||
box->setDeleteConfirmedCallback([weak = Ui::MakeWeak(this)] {
|
box->setDeleteConfirmedCallback([weak = Ui::MakeWeak(this)] {
|
||||||
if (weak) {
|
if (weak) {
|
||||||
weak->_cancelSelectionClicks.fire({});
|
weak->_cancelSelectionClicks.fire({});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
_navigation->parentController()->show(std::move(box));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1154,7 +1154,8 @@ void MainWindow::createGlobalMenu() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ui::show(PrepareContactsBox(sessionController()));
|
sessionController()->show(
|
||||||
|
PrepareContactsBox(sessionController()));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
psAddContact = tools->addAction(
|
psAddContact = tools->addAction(
|
||||||
|
|
|
@ -723,7 +723,7 @@ void MainWindow::createGlobalMenu() {
|
||||||
if (!sessionController()) {
|
if (!sessionController()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Ui::show(PrepareContactsBox(sessionController()));
|
sessionController()->show(PrepareContactsBox(sessionController()));
|
||||||
}));
|
}));
|
||||||
{
|
{
|
||||||
auto callback = [=] {
|
auto callback = [=] {
|
||||||
|
|
|
@ -464,7 +464,7 @@ void AppendEmojiPacks(
|
||||||
auto callback = [=] {
|
auto callback = [=] {
|
||||||
if (document) {
|
if (document) {
|
||||||
if (const auto error = RestrictionToSendStickers(_controller)) {
|
if (const auto error = RestrictionToSendStickers(_controller)) {
|
||||||
Ui::show(Box<InformBox>(*error));
|
_controller->show(Box<InformBox>(*error));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
Api::SendExistingDocument(
|
Api::SendExistingDocument(
|
||||||
|
|
|
@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "platform/platform_specific.h"
|
#include "platform/platform_specific.h"
|
||||||
#include "platform/platform_window_title.h"
|
#include "platform/platform_window_title.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
|
#include "window/window_controller.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "core/update_checker.h"
|
#include "core/update_checker.h"
|
||||||
|
@ -45,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
void SetupConnectionType(
|
void SetupConnectionType(
|
||||||
|
not_null<Window::Controller*> controller,
|
||||||
not_null<Main::Account*> account,
|
not_null<Main::Account*> account,
|
||||||
not_null<Ui::VerticalLayout*> container) {
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
const auto connectionType = [=] {
|
const auto connectionType = [=] {
|
||||||
|
@ -69,7 +71,7 @@ void SetupConnectionType(
|
||||||
) | rpl::map(connectionType),
|
) | rpl::map(connectionType),
|
||||||
st::settingsButton);
|
st::settingsButton);
|
||||||
button->addClickHandler([=] {
|
button->addClickHandler([=] {
|
||||||
Ui::show(ProxiesBoxController::CreateOwningBox(account));
|
controller->show(ProxiesBoxController::CreateOwningBox(account));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +306,7 @@ void SetupSpellchecker(
|
||||||
Spellchecker::ButtonManageDictsState(session),
|
Spellchecker::ButtonManageDictsState(session),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(Box<Ui::ManageDictionariesBox>(controller));
|
controller->show(Box<Ui::ManageDictionariesBox>(controller));
|
||||||
});
|
});
|
||||||
|
|
||||||
button->toggledValue(
|
button->toggledValue(
|
||||||
|
@ -450,7 +452,7 @@ void SetupSystemIntegrationContent(
|
||||||
}) | rpl::start_with_next([=](bool checked) {
|
}) | rpl::start_with_next([=](bool checked) {
|
||||||
if (controller->session().domain().local().hasLocalPasscode()) {
|
if (controller->session().domain().local().hasLocalPasscode()) {
|
||||||
minimized->entity()->setChecked(false);
|
minimized->entity()->setChecked(false);
|
||||||
Ui::show(Box<InformBox>(
|
controller->show(Box<InformBox>(
|
||||||
tr::lng_error_start_minimized_passcoded(tr::now)));
|
tr::lng_error_start_minimized_passcoded(tr::now)));
|
||||||
} else {
|
} else {
|
||||||
cSetStartMinimized(checked);
|
cSetStartMinimized(checked);
|
||||||
|
@ -510,7 +512,9 @@ void SetupAnimations(not_null<Ui::VerticalLayout*> container) {
|
||||||
}, container->lifetime());
|
}, container->lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupOpenGL(not_null<Ui::VerticalLayout*> container) {
|
void SetupOpenGL(
|
||||||
|
not_null<Window::SessionController*> controller,
|
||||||
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
const auto toggles = container->lifetime().make_state<
|
const auto toggles = container->lifetime().make_state<
|
||||||
rpl::event_stream<bool>
|
rpl::event_stream<bool>
|
||||||
>();
|
>();
|
||||||
|
@ -534,7 +538,7 @@ void SetupOpenGL(not_null<Ui::VerticalLayout*> container) {
|
||||||
const auto cancelled = crl::guard(button, [=] {
|
const auto cancelled = crl::guard(button, [=] {
|
||||||
toggles->fire(!enabled);
|
toggles->fire(!enabled);
|
||||||
});
|
});
|
||||||
Ui::show(Box<ConfirmBox>(
|
controller->show(Box<ConfirmBox>(
|
||||||
tr::lng_settings_need_restart(tr::now),
|
tr::lng_settings_need_restart(tr::now),
|
||||||
tr::lng_settings_restart_now(tr::now),
|
tr::lng_settings_restart_now(tr::now),
|
||||||
confirmed,
|
confirmed,
|
||||||
|
@ -547,7 +551,7 @@ void SetupPerformance(
|
||||||
not_null<Ui::VerticalLayout*> container) {
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
SetupAnimations(container);
|
SetupAnimations(container);
|
||||||
if (!Platform::IsMac()) {
|
if (!Platform::IsMac()) {
|
||||||
SetupOpenGL(container);
|
SetupOpenGL(controller, container);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -606,7 +610,10 @@ void Advanced::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
addDivider();
|
addDivider();
|
||||||
AddSkip(content);
|
AddSkip(content);
|
||||||
AddSubsectionTitle(content, tr::lng_settings_network_proxy());
|
AddSubsectionTitle(content, tr::lng_settings_network_proxy());
|
||||||
SetupConnectionType(&controller->session().account(), content);
|
SetupConnectionType(
|
||||||
|
&controller->window(),
|
||||||
|
&controller->session().account(),
|
||||||
|
content);
|
||||||
AddSkip(content);
|
AddSkip(content);
|
||||||
SetupDataStorage(controller, content);
|
SetupDataStorage(controller, content);
|
||||||
SetupAutoDownload(controller, content);
|
SetupAutoDownload(controller, content);
|
||||||
|
|
|
@ -13,9 +13,14 @@ namespace Main {
|
||||||
class Account;
|
class Account;
|
||||||
} // namespace Main
|
} // namespace Main
|
||||||
|
|
||||||
|
namespace Window {
|
||||||
|
class Controller;
|
||||||
|
} // namespace Window
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
void SetupConnectionType(
|
void SetupConnectionType(
|
||||||
|
not_null<Window::Controller*> controller,
|
||||||
not_null<Main::Account*> account,
|
not_null<Main::Account*> account,
|
||||||
not_null<Ui::VerticalLayout*> container);
|
not_null<Ui::VerticalLayout*> container);
|
||||||
bool HasUpdate();
|
bool HasUpdate();
|
||||||
|
|
|
@ -125,7 +125,7 @@ void Calls::setupContent() {
|
||||||
call->setCurrentVideoDevice(deviceId);
|
call->setCurrentVideoDevice(deviceId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Ui::show(Box([=](not_null<Ui::GenericBox*> box) {
|
_controller->show(Box([=](not_null<Ui::GenericBox*> box) {
|
||||||
SingleChoiceBox(box, {
|
SingleChoiceBox(box, {
|
||||||
.title = tr::lng_settings_call_camera(),
|
.title = tr::lng_settings_call_camera(),
|
||||||
.options = options,
|
.options = options,
|
||||||
|
@ -200,7 +200,7 @@ void Calls::setupContent() {
|
||||||
),
|
),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(ChooseAudioOutputBox(crl::guard(this, [=](
|
_controller->show(ChooseAudioOutputBox(crl::guard(this, [=](
|
||||||
const QString &id,
|
const QString &id,
|
||||||
const QString &name) {
|
const QString &name) {
|
||||||
_outputNameStream.fire_copy(name);
|
_outputNameStream.fire_copy(name);
|
||||||
|
@ -221,7 +221,7 @@ void Calls::setupContent() {
|
||||||
),
|
),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(ChooseAudioInputBox(crl::guard(this, [=](
|
_controller->show(ChooseAudioInputBox(crl::guard(this, [=](
|
||||||
const QString &id,
|
const QString &id,
|
||||||
const QString &name) {
|
const QString &name) {
|
||||||
_inputNameStream.fire_copy(name);
|
_inputNameStream.fire_copy(name);
|
||||||
|
@ -268,11 +268,12 @@ void Calls::setupContent() {
|
||||||
content,
|
content,
|
||||||
tr::lng_settings_call_open_system_prefs(),
|
tr::lng_settings_call_open_system_prefs(),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([] {
|
)->addClickHandler([=] {
|
||||||
const auto opened = Platform::OpenSystemSettings(
|
const auto opened = Platform::OpenSystemSettings(
|
||||||
Platform::SystemSettingsType::Audio);
|
Platform::SystemSettingsType::Audio);
|
||||||
if (!opened) {
|
if (!opened) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_linux_no_audio_prefs(tr::now)));
|
_controller->show(
|
||||||
|
Box<InformBox>(tr::lng_linux_no_audio_prefs(tr::now)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -304,7 +305,7 @@ void Calls::requestPermissionAndStartTestingMicrophone() {
|
||||||
Platform::PermissionType::Microphone);
|
Platform::PermissionType::Microphone);
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
};
|
};
|
||||||
Ui::show(Box<ConfirmBox>(
|
_controller->show(Box<ConfirmBox>(
|
||||||
tr::lng_no_mic_permission(tr::now),
|
tr::lng_no_mic_permission(tr::now),
|
||||||
tr::lng_menu_settings(tr::now),
|
tr::lng_menu_settings(tr::now),
|
||||||
showSystemSettings));
|
showSystemSettings));
|
||||||
|
|
|
@ -416,7 +416,7 @@ BackgroundRow::BackgroundRow(
|
||||||
updateImage();
|
updateImage();
|
||||||
|
|
||||||
_chooseFromGallery->addClickHandler([=] {
|
_chooseFromGallery->addClickHandler([=] {
|
||||||
Ui::show(Box<BackgroundBox>(controller));
|
controller->show(Box<BackgroundBox>(controller));
|
||||||
});
|
});
|
||||||
_chooseFromFile->addClickHandler([=] {
|
_chooseFromFile->addClickHandler([=] {
|
||||||
ChooseFromFile(controller, this);
|
ChooseFromFile(controller, this);
|
||||||
|
@ -635,7 +635,7 @@ void ChooseFromFile(
|
||||||
auto local = Data::CustomWallPaper();
|
auto local = Data::CustomWallPaper();
|
||||||
local.setLocalImageAsThumbnail(std::make_shared<Image>(
|
local.setLocalImageAsThumbnail(std::make_shared<Image>(
|
||||||
std::move(image)));
|
std::move(image)));
|
||||||
Ui::show(Box<BackgroundPreviewBox>(controller, local));
|
controller->show(Box<BackgroundPreviewBox>(controller, local));
|
||||||
});
|
});
|
||||||
FileDialog::GetOpenPath(
|
FileDialog::GetOpenPath(
|
||||||
parent.get(),
|
parent.get(),
|
||||||
|
@ -725,7 +725,7 @@ void SetupStickersEmoji(
|
||||||
&st::settingsIconStickers,
|
&st::settingsIconStickers,
|
||||||
st::settingsChatIconLeft
|
st::settingsChatIconLeft
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(
|
controller->show(
|
||||||
Box<StickersBox>(controller, StickersBox::Section::Installed));
|
Box<StickersBox>(controller, StickersBox::Section::Installed));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -736,7 +736,7 @@ void SetupStickersEmoji(
|
||||||
&st::settingsIconEmoji,
|
&st::settingsIconEmoji,
|
||||||
st::settingsChatIconLeft
|
st::settingsChatIconLeft
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(Box<Ui::Emoji::ManageSetsBox>(session));
|
controller->show(Box<Ui::Emoji::ManageSetsBox>(session));
|
||||||
});
|
});
|
||||||
|
|
||||||
AddSkip(container, st::settingsCheckboxesSkip);
|
AddSkip(container, st::settingsCheckboxesSkip);
|
||||||
|
@ -862,7 +862,7 @@ void SetupDataStorage(
|
||||||
st::settingsButton,
|
st::settingsButton,
|
||||||
tr::lng_download_path());
|
tr::lng_download_path());
|
||||||
path->entity()->addClickHandler([=] {
|
path->entity()->addClickHandler([=] {
|
||||||
Ui::show(Box<DownloadPathBox>(controller));
|
controller->show(Box<DownloadPathBox>(controller));
|
||||||
});
|
});
|
||||||
path->toggleOn(ask->toggledValue() | rpl::map(!_1));
|
path->toggleOn(ask->toggledValue() | rpl::map(!_1));
|
||||||
#endif // OS_WIN_STORE
|
#endif // OS_WIN_STORE
|
||||||
|
@ -901,7 +901,8 @@ void SetupAutoDownload(
|
||||||
std::move(label),
|
std::move(label),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(Box<AutoDownloadBox>(&controller->session(), source));
|
controller->show(
|
||||||
|
Box<AutoDownloadBox>(&controller->session(), source));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
add(tr::lng_media_auto_in_private(), Source::User);
|
add(tr::lng_media_auto_in_private(), Source::User);
|
||||||
|
@ -1142,7 +1143,7 @@ void SetupDefaultThemes(
|
||||||
// in Window::Theme::Revert which is called by Editor.
|
// in Window::Theme::Revert which is called by Editor.
|
||||||
//
|
//
|
||||||
// So we check here, before we change the saved accent color.
|
// So we check here, before we change the saved accent color.
|
||||||
Ui::show(Box<InformBox>(
|
window->show(Box<InformBox>(
|
||||||
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1269,7 +1270,9 @@ void SetupCloudThemes(
|
||||||
wrap->setDuration(0)->toggleOn(list->empty() | rpl::map(!_1));
|
wrap->setDuration(0)->toggleOn(list->empty() | rpl::map(!_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupAutoNightMode(not_null<Ui::VerticalLayout*> container) {
|
void SetupAutoNightMode(
|
||||||
|
not_null<Window::SessionController*> controller,
|
||||||
|
not_null<Ui::VerticalLayout*> container) {
|
||||||
if (!Platform::IsDarkModeSupported()) {
|
if (!Platform::IsDarkModeSupported()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1294,7 +1297,7 @@ void SetupAutoNightMode(not_null<Ui::VerticalLayout*> container) {
|
||||||
}) | rpl::start_with_next([=](bool checked) {
|
}) | rpl::start_with_next([=](bool checked) {
|
||||||
if (checked && Window::Theme::Background()->editingTheme()) {
|
if (checked && Window::Theme::Background()->editingTheme()) {
|
||||||
autoNight->setChecked(false);
|
autoNight->setChecked(false);
|
||||||
Ui::show(Box<InformBox>(
|
controller->show(Box<InformBox>(
|
||||||
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
||||||
} else {
|
} else {
|
||||||
Core::App().settings().setSystemDarkModeEnabled(checked);
|
Core::App().settings().setSystemDarkModeEnabled(checked);
|
||||||
|
@ -1451,7 +1454,7 @@ void Chat::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||||
|
|
||||||
SetupThemeOptions(controller, content);
|
SetupThemeOptions(controller, content);
|
||||||
SetupAutoNightMode(content);
|
SetupAutoNightMode(controller, content);
|
||||||
SetupCloudThemes(controller, content);
|
SetupCloudThemes(controller, content);
|
||||||
SetupChatBackground(controller, content);
|
SetupChatBackground(controller, content);
|
||||||
SetupStickersEmoji(controller, content);
|
SetupStickersEmoji(controller, content);
|
||||||
|
|
|
@ -75,18 +75,20 @@ void SetupPhoto(
|
||||||
if (image.isNull()
|
if (image.isNull()
|
||||||
|| image.width() > 10 * image.height()
|
|| image.width() > 10 * image.height()
|
||||||
|| image.height() > 10 * image.width()) {
|
|| image.height() > 10 * image.width()) {
|
||||||
Ui::show(Box<InformBox>(tr::lng_bad_photo(tr::now)));
|
controller->show(Box<InformBox>(tr::lng_bad_photo(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto box = Ui::show(
|
auto box = Box<PhotoCropBox>(
|
||||||
Box<PhotoCropBox>(image, tr::lng_settings_crop_profile(tr::now)));
|
image,
|
||||||
|
tr::lng_settings_crop_profile(tr::now));
|
||||||
box->ready(
|
box->ready(
|
||||||
) | rpl::start_with_next([=](QImage &&image) {
|
) | rpl::start_with_next([=](QImage &&image) {
|
||||||
self->session().api().uploadPeerPhoto(
|
self->session().api().uploadPeerPhoto(
|
||||||
self,
|
self,
|
||||||
std::move(image));
|
std::move(image));
|
||||||
}, box->lifetime());
|
}, box->lifetime());
|
||||||
|
controller->show(std::move(box));
|
||||||
};
|
};
|
||||||
FileDialog::GetOpenPath(
|
FileDialog::GetOpenPath(
|
||||||
upload,
|
upload,
|
||||||
|
@ -219,6 +221,7 @@ void AddRow(
|
||||||
|
|
||||||
void SetupRows(
|
void SetupRows(
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
|
not_null<Window::SessionController*> controller,
|
||||||
not_null<UserData*> self) {
|
not_null<UserData*> self) {
|
||||||
const auto session = &self->session();
|
const auto session = &self->session();
|
||||||
|
|
||||||
|
@ -229,7 +232,7 @@ void SetupRows(
|
||||||
tr::lng_settings_name_label(),
|
tr::lng_settings_name_label(),
|
||||||
Info::Profile::NameValue(self),
|
Info::Profile::NameValue(self),
|
||||||
tr::lng_profile_copy_fullname(tr::now),
|
tr::lng_profile_copy_fullname(tr::now),
|
||||||
[=] { Ui::show(Box<EditNameBox>(self)); },
|
[=] { controller->show(Box<EditNameBox>(self)); },
|
||||||
st::settingsInfoName);
|
st::settingsInfoName);
|
||||||
|
|
||||||
AddRow(
|
AddRow(
|
||||||
|
@ -237,7 +240,7 @@ void SetupRows(
|
||||||
tr::lng_settings_phone_label(),
|
tr::lng_settings_phone_label(),
|
||||||
Info::Profile::PhoneValue(self),
|
Info::Profile::PhoneValue(self),
|
||||||
tr::lng_profile_copy_phone(tr::now),
|
tr::lng_profile_copy_phone(tr::now),
|
||||||
[=] { Ui::show(Box<ChangePhoneBox>(session)); },
|
[=] { controller->show(Box<ChangePhoneBox>(session)); },
|
||||||
st::settingsInfoPhone);
|
st::settingsInfoPhone);
|
||||||
|
|
||||||
auto username = Info::Profile::UsernameValue(self);
|
auto username = Info::Profile::UsernameValue(self);
|
||||||
|
@ -272,7 +275,7 @@ void SetupRows(
|
||||||
std::move(label),
|
std::move(label),
|
||||||
std::move(value),
|
std::move(value),
|
||||||
tr::lng_context_copy_mention(tr::now),
|
tr::lng_context_copy_mention(tr::now),
|
||||||
[=] { Ui::show(Box<UsernameBox>(session)); },
|
[=] { controller->show(Box<UsernameBox>(session)); },
|
||||||
st::settingsInfoUsername);
|
st::settingsInfoUsername);
|
||||||
|
|
||||||
AddSkip(container, st::settingsInfoAfterSkip);
|
AddSkip(container, st::settingsInfoAfterSkip);
|
||||||
|
@ -439,7 +442,7 @@ void Information::setupContent(
|
||||||
|
|
||||||
const auto self = controller->session().user();
|
const auto self = controller->session().user();
|
||||||
SetupPhoto(content, controller, self);
|
SetupPhoto(content, controller, self);
|
||||||
SetupRows(content, self);
|
SetupRows(content, controller, self);
|
||||||
SetupBio(content, self);
|
SetupBio(content, self);
|
||||||
//auto manager = SetupBio(content, self);
|
//auto manager = SetupBio(content, self);
|
||||||
//_canSaveChanges = std::move(manager.canSave);
|
//_canSaveChanges = std::move(manager.canSave);
|
||||||
|
|
|
@ -65,7 +65,7 @@ object_ptr<Ui::RpWidget> CreateIntroSettings(
|
||||||
AddDivider(result);
|
AddDivider(result);
|
||||||
AddSkip(result);
|
AddSkip(result);
|
||||||
SetupLanguageButton(result, false);
|
SetupLanguageButton(result, false);
|
||||||
SetupConnectionType(&window->account(), result);
|
SetupConnectionType(window, &window->account(), result);
|
||||||
AddSkip(result);
|
AddSkip(result);
|
||||||
if (HasUpdate()) {
|
if (HasUpdate()) {
|
||||||
AddDivider(result);
|
AddDivider(result);
|
||||||
|
@ -89,7 +89,7 @@ object_ptr<Ui::RpWidget> CreateIntroSettings(
|
||||||
}
|
}
|
||||||
AddDivider(result);
|
AddDivider(result);
|
||||||
AddSkip(result);
|
AddSkip(result);
|
||||||
SetupInterfaceScale(result, false);
|
SetupInterfaceScale(window, result, false);
|
||||||
SetupDefaultThemes(window, result);
|
SetupDefaultThemes(window, result);
|
||||||
AddSkip(result);
|
AddSkip(result);
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "apiwrap.h"
|
#include "apiwrap.h"
|
||||||
#include "api/api_sensitive_content.h"
|
#include "api/api_sensitive_content.h"
|
||||||
#include "api/api_global_privacy.h"
|
#include "api/api_global_privacy.h"
|
||||||
|
#include "window/window_controller.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "core/click_handler_types.h"
|
#include "core/click_handler_types.h"
|
||||||
#include "base/call_delayed.h"
|
#include "base/call_delayed.h"
|
||||||
|
@ -167,6 +168,7 @@ bool HasInterfaceScale() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupInterfaceScale(
|
void SetupInterfaceScale(
|
||||||
|
not_null<Window::Controller*> window,
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
bool icon) {
|
bool icon) {
|
||||||
if (!HasInterfaceScale()) {
|
if (!HasInterfaceScale()) {
|
||||||
|
@ -234,7 +236,7 @@ void SetupInterfaceScale(
|
||||||
button,
|
button,
|
||||||
[=] { repeatSetScale(cConfigScale(), repeatSetScale); });
|
[=] { repeatSetScale(cConfigScale(), repeatSetScale); });
|
||||||
});
|
});
|
||||||
Ui::show(Box<ConfirmBox>(
|
window->show(Box<ConfirmBox>(
|
||||||
tr::lng_settings_need_restart(tr::now),
|
tr::lng_settings_need_restart(tr::now),
|
||||||
tr::lng_settings_restart_now(tr::now),
|
tr::lng_settings_restart_now(tr::now),
|
||||||
confirmed,
|
confirmed,
|
||||||
|
@ -332,7 +334,7 @@ void SetupHelp(
|
||||||
sure,
|
sure,
|
||||||
OpenFaq);
|
OpenFaq);
|
||||||
box->setStrictCancel(true);
|
box->setStrictCancel(true);
|
||||||
Ui::show(std::move(box));
|
controller->show(std::move(box));
|
||||||
});
|
});
|
||||||
|
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
|
@ -368,7 +370,7 @@ void Main::setupContent(not_null<Window::SessionController*> controller) {
|
||||||
if (HasInterfaceScale()) {
|
if (HasInterfaceScale()) {
|
||||||
AddDivider(content);
|
AddDivider(content);
|
||||||
AddSkip(content);
|
AddSkip(content);
|
||||||
SetupInterfaceScale(content);
|
SetupInterfaceScale(&controller->window(), content);
|
||||||
AddSkip(content);
|
AddSkip(content);
|
||||||
}
|
}
|
||||||
SetupHelp(controller, content);
|
SetupHelp(controller, content);
|
||||||
|
|
|
@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "settings/settings_common.h"
|
#include "settings/settings_common.h"
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
|
class Controller;
|
||||||
class SessionController;
|
class SessionController;
|
||||||
} // namespace Window
|
} // namespace Window
|
||||||
|
|
||||||
|
@ -24,6 +25,7 @@ void SetupLanguageButton(
|
||||||
bool icon = true);
|
bool icon = true);
|
||||||
bool HasInterfaceScale();
|
bool HasInterfaceScale();
|
||||||
void SetupInterfaceScale(
|
void SetupInterfaceScale(
|
||||||
|
not_null<Window::Controller*> window,
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
bool icon = true);
|
bool icon = true);
|
||||||
void SetupFaq(
|
void SetupFaq(
|
||||||
|
|
|
@ -304,7 +304,7 @@ void BlockedBoxController::BlockNewPeer(
|
||||||
});
|
});
|
||||||
box->addButton(tr::lng_cancel(), [box] { box->closeBox(); });
|
box->addButton(tr::lng_cancel(), [box] { box->closeBox(); });
|
||||||
};
|
};
|
||||||
Ui::show(
|
window->show(
|
||||||
Box<PeerListBox>(std::move(controller), std::move(initBox)),
|
Box<PeerListBox>(std::move(controller), std::move(initBox)),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,7 +140,7 @@ void SetupPrivacy(
|
||||||
BlockedBoxController::BlockNewPeer(controller);
|
BlockedBoxController::BlockNewPeer(controller);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Ui::show(Box<PeerListBox>(
|
controller->show(Box<PeerListBox>(
|
||||||
std::make_unique<BlockedBoxController>(controller),
|
std::make_unique<BlockedBoxController>(controller),
|
||||||
initBox));
|
initBox));
|
||||||
});
|
});
|
||||||
|
@ -271,7 +271,7 @@ void SetupLocalPasscode(
|
||||||
std::move(text),
|
std::move(text),
|
||||||
st::settingsButton)
|
st::settingsButton)
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(Box<PasscodeBox>(&controller->session(), false));
|
controller->show(Box<PasscodeBox>(&controller->session(), false));
|
||||||
});
|
});
|
||||||
|
|
||||||
const auto wrap = container->add(
|
const auto wrap = container->add(
|
||||||
|
@ -285,7 +285,7 @@ void SetupLocalPasscode(
|
||||||
tr::lng_settings_passcode_disable(),
|
tr::lng_settings_passcode_disable(),
|
||||||
st::settingsButton)
|
st::settingsButton)
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(Box<PasscodeBox>(&controller->session(), true));
|
controller->show(Box<PasscodeBox>(&controller->session(), true));
|
||||||
});
|
});
|
||||||
|
|
||||||
const auto autoLockBoxClosing =
|
const auto autoLockBoxClosing =
|
||||||
|
@ -314,7 +314,8 @@ void SetupLocalPasscode(
|
||||||
std::move(value),
|
std::move(value),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
const auto box = Ui::show(Box<AutoLockBox>(&controller->session()));
|
const auto box = controller->show(
|
||||||
|
Box<AutoLockBox>(&controller->session()));
|
||||||
box->boxClosing(
|
box->boxClosing(
|
||||||
) | rpl::start_to_stream(*autoLockBoxClosing, box->lifetime());
|
) | rpl::start_to_stream(*autoLockBoxClosing, box->lifetime());
|
||||||
});
|
});
|
||||||
|
@ -409,9 +410,9 @@ void SetupCloudPassword(
|
||||||
))->setDuration(0);
|
))->setDuration(0);
|
||||||
change->entity()->addClickHandler([=] {
|
change->entity()->addClickHandler([=] {
|
||||||
if (CheckEditCloudPassword(session)) {
|
if (CheckEditCloudPassword(session)) {
|
||||||
Ui::show(EditCloudPasswordBox(session));
|
controller->show(EditCloudPasswordBox(session));
|
||||||
} else {
|
} else {
|
||||||
Ui::show(CloudPasswordAppOutdatedBox());
|
controller->show(CloudPasswordAppOutdatedBox());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -448,14 +449,14 @@ void SetupCloudPassword(
|
||||||
session->api().clearUnconfirmedPassword();
|
session->api().clearUnconfirmedPassword();
|
||||||
}, validation.box->lifetime());
|
}, validation.box->lifetime());
|
||||||
|
|
||||||
Ui::show(std::move(validation.box));
|
controller->show(std::move(validation.box));
|
||||||
});
|
});
|
||||||
|
|
||||||
const auto remove = [=] {
|
const auto remove = [=] {
|
||||||
if (CheckEditCloudPassword(session)) {
|
if (CheckEditCloudPassword(session)) {
|
||||||
RemoveCloudPassword(session);
|
RemoveCloudPassword(controller);
|
||||||
} else {
|
} else {
|
||||||
Ui::show(CloudPasswordAppOutdatedBox());
|
controller->show(CloudPasswordAppOutdatedBox());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const auto disable = container->add(
|
const auto disable = container->add(
|
||||||
|
@ -569,7 +570,7 @@ void SetupSelfDestruction(
|
||||||
label(),
|
label(),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(Box<SelfDestructionBox>(
|
controller->show(Box<SelfDestructionBox>(
|
||||||
session,
|
session,
|
||||||
session->api().selfDestruct().days()));
|
session->api().selfDestruct().days()));
|
||||||
});
|
});
|
||||||
|
@ -648,7 +649,7 @@ void SetupBotsAndWebsites(
|
||||||
tr::lng_settings_clear_payment_info(),
|
tr::lng_settings_clear_payment_info(),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(ClearPaymentInfoBox(session));
|
controller->show(ClearPaymentInfoBox(session));
|
||||||
});
|
});
|
||||||
|
|
||||||
AddSkip(container);
|
AddSkip(container);
|
||||||
|
@ -678,7 +679,7 @@ void SetupSessionsList(
|
||||||
std::move(count),
|
std::move(count),
|
||||||
st::settingsButton
|
st::settingsButton
|
||||||
)->addClickHandler([=] {
|
)->addClickHandler([=] {
|
||||||
Ui::show(Box<SessionsBox>(&controller->session()));
|
controller->show(Box<SessionsBox>(&controller->session()));
|
||||||
});
|
});
|
||||||
AddSkip(container, st::settingsPrivacySecurityPadding);
|
AddSkip(container, st::settingsPrivacySecurityPadding);
|
||||||
AddDividerText(container, tr::lng_settings_sessions_about());
|
AddDividerText(container, tr::lng_settings_sessions_about());
|
||||||
|
@ -734,7 +735,8 @@ object_ptr<Ui::BoxContent> EditCloudPasswordBox(not_null<Main::Session*> session
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveCloudPassword(not_null<::Main::Session*> session) {
|
void RemoveCloudPassword(not_null<Window::SessionController*> controller) {
|
||||||
|
const auto session = &controller->session();
|
||||||
const auto current = session->api().passwordStateCurrent();
|
const auto current = session->api().passwordStateCurrent();
|
||||||
Assert(current.has_value());
|
Assert(current.has_value());
|
||||||
|
|
||||||
|
@ -744,7 +746,7 @@ void RemoveCloudPassword(not_null<::Main::Session*> session) {
|
||||||
}
|
}
|
||||||
auto fields = PasscodeBox::CloudFields::From(*current);
|
auto fields = PasscodeBox::CloudFields::From(*current);
|
||||||
fields.turningOff = true;
|
fields.turningOff = true;
|
||||||
const auto box = Ui::show(Box<PasscodeBox>(session, fields));
|
auto box = Box<PasscodeBox>(session, fields);
|
||||||
|
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
box->newPasswordSet() | rpl::to_empty,
|
box->newPasswordSet() | rpl::to_empty,
|
||||||
|
@ -757,6 +759,8 @@ void RemoveCloudPassword(not_null<::Main::Session*> session) {
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
session->api().clearUnconfirmedPassword();
|
session->api().clearUnconfirmedPassword();
|
||||||
}, box->lifetime());
|
}, box->lifetime());
|
||||||
|
|
||||||
|
controller->show(std::move(box));
|
||||||
}
|
}
|
||||||
|
|
||||||
object_ptr<Ui::BoxContent> CloudPasswordAppOutdatedBox() {
|
object_ptr<Ui::BoxContent> CloudPasswordAppOutdatedBox() {
|
||||||
|
@ -789,7 +793,7 @@ void AddPrivacyButton(
|
||||||
) | rpl::take(
|
) | rpl::take(
|
||||||
1
|
1
|
||||||
) | rpl::start_with_next([=](const Privacy &value) {
|
) | rpl::start_with_next([=](const Privacy &value) {
|
||||||
Ui::show(
|
controller->show(
|
||||||
Box<EditPrivacyBox>(controller, controllerFactory(), value),
|
Box<EditPrivacyBox>(controller, controllerFactory(), value),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,7 +23,7 @@ int ExceptionUsersCount(const std::vector<not_null<PeerData*>> &exceptions);
|
||||||
bool CheckEditCloudPassword(not_null<::Main::Session*> session);
|
bool CheckEditCloudPassword(not_null<::Main::Session*> session);
|
||||||
object_ptr<Ui::BoxContent> EditCloudPasswordBox(
|
object_ptr<Ui::BoxContent> EditCloudPasswordBox(
|
||||||
not_null<::Main::Session*> session);
|
not_null<::Main::Session*> session);
|
||||||
void RemoveCloudPassword(not_null<::Main::Session*> session);
|
void RemoveCloudPassword(not_null<Window::SessionController*> session);
|
||||||
object_ptr<Ui::BoxContent> CloudPasswordAppOutdatedBox();
|
object_ptr<Ui::BoxContent> CloudPasswordAppOutdatedBox();
|
||||||
|
|
||||||
void AddPrivacyButton(
|
void AddPrivacyButton(
|
||||||
|
|
|
@ -507,7 +507,7 @@ void Helper::showEditInfoBox(
|
||||||
TextUtilities::ConvertTextTagsToEntities(result.tags)
|
TextUtilities::ConvertTextTagsToEntities(result.tags)
|
||||||
}, done);
|
}, done);
|
||||||
};
|
};
|
||||||
Ui::show(
|
controller->show(
|
||||||
Box<EditInfoBox>(controller, editData, save),
|
Box<EditInfoBox>(controller, editData, save),
|
||||||
Ui::LayerOption::KeepOther);
|
Ui::LayerOption::KeepOther);
|
||||||
}
|
}
|
||||||
|
|
|
@ -665,8 +665,8 @@ Editor::Editor(
|
||||||
this,
|
this,
|
||||||
[=] { save(); }));
|
[=] { save(); }));
|
||||||
|
|
||||||
_inner->setErrorCallback([this] {
|
_inner->setErrorCallback([=] {
|
||||||
Ui::show(Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
window->show(Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||||
|
|
||||||
// This could be from inner->_context observable notification.
|
// This could be from inner->_context observable notification.
|
||||||
// We should not destroy it while iterating in subscribers.
|
// We should not destroy it while iterating in subscribers.
|
||||||
|
@ -748,12 +748,14 @@ void Editor::exportTheme() {
|
||||||
QFile f(path);
|
QFile f(path);
|
||||||
if (!f.open(QIODevice::WriteOnly)) {
|
if (!f.open(QIODevice::WriteOnly)) {
|
||||||
LOG(("Theme Error: could not open zip-ed theme file '%1' for writing").arg(path));
|
LOG(("Theme Error: could not open zip-ed theme file '%1' for writing").arg(path));
|
||||||
Ui::show(Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
_window->show(
|
||||||
|
Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (f.write(result) != result.size()) {
|
if (f.write(result) != result.size()) {
|
||||||
LOG(("Theme Error: could not write zip-ed theme to file '%1'").arg(path));
|
LOG(("Theme Error: could not write zip-ed theme to file '%1'").arg(path));
|
||||||
Ui::show(Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
_window->show(
|
||||||
|
Box<InformBox>(tr::lng_theme_editor_error(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Ui::Toast::Show(tr::lng_theme_editor_done(tr::now));
|
Ui::Toast::Show(tr::lng_theme_editor_done(tr::now));
|
||||||
|
|
|
@ -126,7 +126,7 @@ void Controller::checkLockByTerms() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Ui::hideSettingsAndLayer(anim::type::instant);
|
Ui::hideSettingsAndLayer(anim::type::instant);
|
||||||
const auto box = Ui::show(Box<TermsBox>(
|
const auto box = show(Box<TermsBox>(
|
||||||
*data,
|
*data,
|
||||||
tr::lng_terms_agree(),
|
tr::lng_terms_agree(),
|
||||||
tr::lng_terms_decline()));
|
tr::lng_terms_decline()));
|
||||||
|
@ -161,7 +161,7 @@ void Controller::checkLockByTerms() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::showTermsDecline() {
|
void Controller::showTermsDecline() {
|
||||||
const auto box = Ui::show(
|
const auto box = show(
|
||||||
Box<Window::TermsBox>(
|
Box<Window::TermsBox>(
|
||||||
TextWithEntities{ tr::lng_terms_update_sorry(tr::now) },
|
TextWithEntities{ tr::lng_terms_update_sorry(tr::now) },
|
||||||
tr::lng_terms_decline_and_delete(),
|
tr::lng_terms_decline_and_delete(),
|
||||||
|
@ -193,7 +193,7 @@ void Controller::showTermsDelete() {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Ui::show(
|
show(
|
||||||
Box<ConfirmBox>(
|
Box<ConfirmBox>(
|
||||||
tr::lng_terms_delete_warning(tr::now),
|
tr::lng_terms_delete_warning(tr::now),
|
||||||
tr::lng_terms_delete_now(tr::now),
|
tr::lng_terms_delete_now(tr::now),
|
||||||
|
|
|
@ -131,7 +131,7 @@ void ShowCallsBox(not_null<Window::SessionController*> window) {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
Ui::show(Box<PeerListBox>(std::move(controller), initBox));
|
window->show(Box<PeerListBox>(std::move(controller), initBox));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -617,7 +617,11 @@ MainMenu::MainMenu(
|
||||||
_telegram->setLinksTrusted();
|
_telegram->setLinksTrusted();
|
||||||
_version->setRichText(textcmdLink(1, tr::lng_settings_current_version(tr::now, lt_version, currentVersionText())) + QChar(' ') + QChar(8211) + QChar(' ') + textcmdLink(2, tr::lng_menu_about(tr::now)));
|
_version->setRichText(textcmdLink(1, tr::lng_settings_current_version(tr::now, lt_version, currentVersionText())) + QChar(' ') + QChar(8211) + QChar(' ') + textcmdLink(2, tr::lng_menu_about(tr::now)));
|
||||||
_version->setLink(1, std::make_shared<UrlClickHandler>(Core::App().changelogLink()));
|
_version->setLink(1, std::make_shared<UrlClickHandler>(Core::App().changelogLink()));
|
||||||
_version->setLink(2, std::make_shared<LambdaClickHandler>([] { Ui::show(Box<AboutBox>()); }));
|
_version->setLink(
|
||||||
|
2,
|
||||||
|
std::make_shared<LambdaClickHandler>([=] {
|
||||||
|
controller->show(Box<AboutBox>());
|
||||||
|
}));
|
||||||
|
|
||||||
_controller->session().downloaderTaskFinished(
|
_controller->session().downloaderTaskFinished(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
|
@ -903,7 +907,7 @@ void MainMenu::refreshMenu() {
|
||||||
controller->showNewChannel();
|
controller->showNewChannel();
|
||||||
}, &st::mainMenuNewChannel, &st::mainMenuNewChannelOver);
|
}, &st::mainMenuNewChannel, &st::mainMenuNewChannelOver);
|
||||||
_menu->addAction(tr::lng_menu_contacts(tr::now), [=] {
|
_menu->addAction(tr::lng_menu_contacts(tr::now), [=] {
|
||||||
Ui::show(PrepareContactsBox(controller));
|
controller->show(PrepareContactsBox(controller));
|
||||||
}, &st::mainMenuContacts, &st::mainMenuContactsOver);
|
}, &st::mainMenuContacts, &st::mainMenuContactsOver);
|
||||||
if (_controller->session().serverConfig().phoneCallsEnabled.current()) {
|
if (_controller->session().serverConfig().phoneCallsEnabled.current()) {
|
||||||
_menu->addAction(tr::lng_menu_calls(tr::now), [=] {
|
_menu->addAction(tr::lng_menu_calls(tr::now), [=] {
|
||||||
|
@ -938,7 +942,7 @@ void MainMenu::refreshMenu() {
|
||||||
|
|
||||||
auto nightCallback = [=] {
|
auto nightCallback = [=] {
|
||||||
if (Window::Theme::Background()->editingTheme()) {
|
if (Window::Theme::Background()->editingTheme()) {
|
||||||
Ui::show(Box<InformBox>(
|
controller->show(Box<InformBox>(
|
||||||
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
tr::lng_theme_editor_cant_change_theme(tr::now)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ void SessionNavigation::resolveUsername(
|
||||||
}).fail([=](const MTP::Error &error) {
|
}).fail([=](const MTP::Error &error) {
|
||||||
_resolveRequestId = 0;
|
_resolveRequestId = 0;
|
||||||
if (error.code() == 400) {
|
if (error.code() == 400) {
|
||||||
Ui::show(Box<InformBox>(
|
show(Box<InformBox>(
|
||||||
tr::lng_username_not_found(tr::now, lt_user, username)));
|
tr::lng_username_not_found(tr::now, lt_user, username)));
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
|
@ -471,7 +471,7 @@ SessionController::SessionController(
|
||||||
) | rpl::start_with_next([=](PeerData *peer) {
|
) | rpl::start_with_next([=](PeerData *peer) {
|
||||||
if (peer == _showEditPeer) {
|
if (peer == _showEditPeer) {
|
||||||
_showEditPeer = nullptr;
|
_showEditPeer = nullptr;
|
||||||
Ui::show(Box<EditPeerInfoBox>(this, peer));
|
show(Box<EditPeerInfoBox>(this, peer));
|
||||||
}
|
}
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
@ -993,7 +993,7 @@ void SessionController::startOrJoinGroupCall(
|
||||||
GroupCallJoinConfirm confirm) {
|
GroupCallJoinConfirm confirm) {
|
||||||
auto &calls = Core::App().calls();
|
auto &calls = Core::App().calls();
|
||||||
const auto askConfirmation = [&](QString text, QString button) {
|
const auto askConfirmation = [&](QString text, QString button) {
|
||||||
Ui::show(Box<ConfirmBox>(text, button, crl::guard(this, [=] {
|
show(Box<ConfirmBox>(text, button, crl::guard(this, [=] {
|
||||||
Ui::hideLayer();
|
Ui::hideLayer();
|
||||||
startOrJoinGroupCall(peer, joinHash, GroupCallJoinConfirm::None);
|
startOrJoinGroupCall(peer, joinHash, GroupCallJoinConfirm::None);
|
||||||
})));
|
})));
|
||||||
|
@ -1095,7 +1095,7 @@ void SessionController::showJumpToDate(Dialogs::Key chat, QDate requestedDate) {
|
||||||
box->setMinDate(minPeerDate(chat));
|
box->setMinDate(minPeerDate(chat));
|
||||||
box->setMaxDate(maxPeerDate(chat));
|
box->setMaxDate(maxPeerDate(chat));
|
||||||
box->setBeginningButton(true);
|
box->setBeginningButton(true);
|
||||||
Ui::show(std::move(box));
|
show(std::move(box));
|
||||||
}
|
}
|
||||||
|
|
||||||
void SessionController::showPassportForm(const Passport::FormRequest &request) {
|
void SessionController::showPassportForm(const Passport::FormRequest &request) {
|
||||||
|
@ -1210,6 +1210,13 @@ Window::Adaptive &SessionController::adaptive() const {
|
||||||
return _window->adaptive();
|
return _window->adaptive();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPointer<Ui::BoxContent> SessionController::show(
|
||||||
|
object_ptr<Ui::BoxContent> content,
|
||||||
|
Ui::LayerOptions options,
|
||||||
|
anim::type animated) {
|
||||||
|
return _window->show(std::move(content), options, animated);
|
||||||
|
}
|
||||||
|
|
||||||
SessionController::~SessionController() = default;
|
SessionController::~SessionController() = default;
|
||||||
|
|
||||||
} // namespace Window
|
} // namespace Window
|
||||||
|
|
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "base/timer.h"
|
#include "base/timer.h"
|
||||||
#include "dialogs/dialogs_key.h"
|
#include "dialogs/dialogs_key.h"
|
||||||
#include "ui/effects/animation_value.h"
|
#include "ui/effects/animation_value.h"
|
||||||
|
#include "ui/layers/layer_widget.h"
|
||||||
#include "window/window_adaptive.h"
|
#include "window/window_adaptive.h"
|
||||||
|
|
||||||
class PhotoData;
|
class PhotoData;
|
||||||
|
@ -250,6 +251,11 @@ public:
|
||||||
return _selectingPeer;
|
return _selectingPeer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPointer<Ui::BoxContent> show(
|
||||||
|
object_ptr<Ui::BoxContent> content,
|
||||||
|
Ui::LayerOptions options = Ui::LayerOption::KeepOther,
|
||||||
|
anim::type animated = anim::type::normal);
|
||||||
|
|
||||||
[[nodiscard]] auto tabbedSelector() const
|
[[nodiscard]] auto tabbedSelector() const
|
||||||
-> not_null<ChatHelpers::TabbedSelector*>;
|
-> not_null<ChatHelpers::TabbedSelector*>;
|
||||||
void takeTabbedSelectorOwnershipFrom(not_null<QWidget*> parent);
|
void takeTabbedSelectorOwnershipFrom(not_null<QWidget*> parent);
|
||||||
|
|
Loading…
Add table
Reference in a new issue