mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Removed Window::SessionNavigation from ShareBox.
This commit is contained in:
parent
309d4ea702
commit
fa50a5962c
4 changed files with 11 additions and 11 deletions
|
@ -1204,7 +1204,7 @@ object_ptr<Ui::BoxContent> ShareInviteLinkBox(
|
||||||
.copyCallback = std::move(copyCallback),
|
.copyCallback = std::move(copyCallback),
|
||||||
.submitCallback = std::move(submitCallback),
|
.submitCallback = std::move(submitCallback),
|
||||||
.filterCallback = [](auto peer) { return peer->canWrite(); },
|
.filterCallback = [](auto peer) { return peer->canWrite(); },
|
||||||
.navigation = App::wnd()->sessionController() });
|
});
|
||||||
*box = Ui::MakeWeak(object.data());
|
*box = Ui::MakeWeak(object.data());
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,6 +197,7 @@ private:
|
||||||
ShareBox::ShareBox(QWidget*, Descriptor &&descriptor)
|
ShareBox::ShareBox(QWidget*, Descriptor &&descriptor)
|
||||||
: _descriptor(std::move(descriptor))
|
: _descriptor(std::move(descriptor))
|
||||||
, _api(&_descriptor.session->mtp())
|
, _api(&_descriptor.session->mtp())
|
||||||
|
, _show(std::make_shared<Ui::BoxShow>(this))
|
||||||
, _select(
|
, _select(
|
||||||
this,
|
this,
|
||||||
(_descriptor.stMultiSelect
|
(_descriptor.stMultiSelect
|
||||||
|
@ -255,19 +256,20 @@ void ShareBox::prepareCommentField() {
|
||||||
field->setMarkdownReplacesEnabled(rpl::single(true));
|
field->setMarkdownReplacesEnabled(rpl::single(true));
|
||||||
if (_descriptor.initEditLink) {
|
if (_descriptor.initEditLink) {
|
||||||
_descriptor.initEditLink(field);
|
_descriptor.initEditLink(field);
|
||||||
} else if (_descriptor.navigation) {
|
} else if (_show->valid()) {
|
||||||
field->setEditLinkCallback(
|
field->setEditLinkCallback(
|
||||||
DefaultEditLinkCallback(
|
DefaultEditLinkCallback(
|
||||||
std::make_shared<Window::Show>(_descriptor.navigation),
|
_show,
|
||||||
_descriptor.session,
|
_descriptor.session,
|
||||||
field));
|
field,
|
||||||
|
_descriptor.stComment));
|
||||||
}
|
}
|
||||||
field->setSubmitSettings(Core::App().settings().sendSubmitWay());
|
field->setSubmitSettings(Core::App().settings().sendSubmitWay());
|
||||||
|
|
||||||
if (_descriptor.initSpellchecker) {
|
if (_descriptor.initSpellchecker) {
|
||||||
_descriptor.initSpellchecker(field);
|
_descriptor.initSpellchecker(field);
|
||||||
} else if (_descriptor.navigation) {
|
} else if (_show->valid()) {
|
||||||
InitSpellchecker(_descriptor.navigation->parentController(), field);
|
InitSpellchecker(_show, _descriptor.session, field, true);
|
||||||
}
|
}
|
||||||
Ui::SendPendingMoveResizeEvents(_comment);
|
Ui::SendPendingMoveResizeEvents(_comment);
|
||||||
if (_bottomWidget) {
|
if (_bottomWidget) {
|
||||||
|
@ -602,7 +604,7 @@ void ShareBox::submitSilent() {
|
||||||
|
|
||||||
void ShareBox::submitScheduled() {
|
void ShareBox::submitScheduled() {
|
||||||
const auto callback = [=](Api::SendOptions options) { submit(options); };
|
const auto callback = [=](Api::SendOptions options) { submit(options); };
|
||||||
Ui::show(
|
_show->showBox(
|
||||||
HistoryView::PrepareScheduleBox(
|
HistoryView::PrepareScheduleBox(
|
||||||
this,
|
this,
|
||||||
sendMenuType(),
|
sendMenuType(),
|
||||||
|
|
|
@ -8,7 +8,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "boxes/abstract_box.h"
|
#include "boxes/abstract_box.h"
|
||||||
#include "base/observer.h"
|
|
||||||
#include "base/timer.h"
|
#include "base/timer.h"
|
||||||
#include "history/view/history_view_schedule_box.h"
|
#include "history/view/history_view_schedule_box.h"
|
||||||
#include "ui/chat/forward_options_box.h"
|
#include "ui/chat/forward_options_box.h"
|
||||||
|
@ -28,7 +27,6 @@ enum class Type;
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
class SessionController;
|
class SessionController;
|
||||||
class SessionNavigation;
|
|
||||||
} // namespace Window
|
} // namespace Window
|
||||||
|
|
||||||
namespace Api {
|
namespace Api {
|
||||||
|
@ -80,7 +78,6 @@ public:
|
||||||
CopyCallback copyCallback;
|
CopyCallback copyCallback;
|
||||||
SubmitCallback submitCallback;
|
SubmitCallback submitCallback;
|
||||||
FilterCallback filterCallback;
|
FilterCallback filterCallback;
|
||||||
Window::SessionNavigation *navigation = nullptr;
|
|
||||||
Fn<void(not_null<Ui::InputField*>)> initSpellchecker;
|
Fn<void(not_null<Ui::InputField*>)> initSpellchecker;
|
||||||
Fn<void(not_null<Ui::InputField*>)> initEditLink;
|
Fn<void(not_null<Ui::InputField*>)> initEditLink;
|
||||||
object_ptr<Ui::RpWidget> bottomWidget = { nullptr };
|
object_ptr<Ui::RpWidget> bottomWidget = { nullptr };
|
||||||
|
@ -139,6 +136,8 @@ private:
|
||||||
Descriptor _descriptor;
|
Descriptor _descriptor;
|
||||||
MTP::Sender _api;
|
MTP::Sender _api;
|
||||||
|
|
||||||
|
std::shared_ptr<Ui::BoxShow> _show;
|
||||||
|
|
||||||
object_ptr<Ui::MultiSelect> _select;
|
object_ptr<Ui::MultiSelect> _select;
|
||||||
object_ptr<Ui::SlideWrap<Ui::InputField>> _comment;
|
object_ptr<Ui::SlideWrap<Ui::InputField>> _comment;
|
||||||
object_ptr<Ui::RpWidget> _bottomWidget;
|
object_ptr<Ui::RpWidget> _bottomWidget;
|
||||||
|
|
|
@ -365,7 +365,6 @@ void FastShareMessage(not_null<HistoryItem*> item) {
|
||||||
.copyCallback = std::move(copyLinkCallback),
|
.copyCallback = std::move(copyLinkCallback),
|
||||||
.submitCallback = std::move(submitCallback),
|
.submitCallback = std::move(submitCallback),
|
||||||
.filterCallback = std::move(filterCallback),
|
.filterCallback = std::move(filterCallback),
|
||||||
.navigation = App::wnd()->sessionController(),
|
|
||||||
.forwardOptions = {
|
.forwardOptions = {
|
||||||
.messagesCount = int(data->msgIds.size()),
|
.messagesCount = int(data->msgIds.size()),
|
||||||
.show = !hasOnlyForcedForwardedInfo,
|
.show = !hasOnlyForcedForwardedInfo,
|
||||||
|
|
Loading…
Add table
Reference in a new issue