Rename Window::Controller to Window::SessionController.

This commit is contained in:
John Preston 2019-06-06 13:21:40 +03:00
parent 263bbf1788
commit a547f80ae9
123 changed files with 445 additions and 415 deletions

View file

@ -40,7 +40,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/sticker_set_box.h" #include "boxes/sticker_set_box.h"
#include "window/notifications_manager.h" #include "window/notifications_manager.h"
#include "window/window_lock_widgets.h" #include "window/window_lock_widgets.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/themes/window_theme.h" #include "window/themes/window_theme.h"
#include "inline_bots/inline_bot_result.h" #include "inline_bots/inline_bot_result.h"
#include "chat_helpers/message_field.h" #include "chat_helpers/message_field.h"
@ -442,7 +442,7 @@ void ApiWrap::importChatInvite(const QString &hash) {
return PeerId(0); return PeerId(0);
}); });
if (const auto peer = _session->data().peerLoaded(peerId)) { if (const auto peer = _session->data().peerLoaded(peerId)) {
App::wnd()->controller()->showPeerHistory( App::wnd()->sessionController()->showPeerHistory(
peer, peer,
Window::SectionShow::Way::Forward); Window::SectionShow::Way::Forward);
} }
@ -3903,7 +3903,7 @@ void ApiWrap::jumpToHistoryDate(not_null<PeerData*> peer, const QDate &date) {
//void ApiWrap::jumpToFeedDate(not_null<Data::Feed*> feed, const QDate &date) { //void ApiWrap::jumpToFeedDate(not_null<Data::Feed*> feed, const QDate &date) {
// requestMessageAfterDate(feed, date, [=](Data::MessagePosition result) { // requestMessageAfterDate(feed, date, [=](Data::MessagePosition result) {
// Ui::hideLayer(); // Ui::hideLayer();
// App::wnd()->controller()->showSection( // App::wnd()->sessionController()->showSection(
// HistoryFeed::Memento(feed, result)); // HistoryFeed::Memento(feed, result));
// }); // });
//} //}

View file

@ -22,7 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/image/image.h" #include "ui/image/image.h"
#include "ui/empty_userpic.h" #include "ui/empty_userpic.h"
#include "core/click_handler_types.h" #include "core/click_handler_types.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "storage/localstorage.h" #include "storage/localstorage.h"
#include "data/data_session.h" #include "data/data_session.h"
#include "data/data_photo.h" #include "data/data_photo.h"
@ -712,7 +712,7 @@ void DeleteMessagesBox::deleteAndClear() {
if (justClear) { if (justClear) {
peer->session().api().clearHistory(peer, revoke); peer->session().api().clearHistory(peer, revoke);
} else { } else {
const auto controller = App::wnd()->controller(); const auto controller = App::wnd()->sessionController();
if (controller->activeChatCurrent().peer() == peer) { if (controller->activeChatCurrent().peer() == peer) {
Ui::showChatsList(); Ui::showChatsList();
} }

View file

@ -34,13 +34,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/special_buttons.h" #include "ui/special_buttons.h"
#include "ui/text_options.h" #include "ui/text_options.h"
#include "ui/widgets/input_fields.h" #include "ui/widgets/input_fields.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "ui/widgets/checkbox.h" #include "ui/widgets/checkbox.h"
#include "confirm_box.h" #include "confirm_box.h"
EditCaptionBox::EditCaptionBox( EditCaptionBox::EditCaptionBox(
QWidget*, QWidget*,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<HistoryItem*> item) not_null<HistoryItem*> item)
: _controller(controller) : _controller(controller)
, _msgId(item->fullId()) { , _msgId(item->fullId()) {

View file

@ -17,7 +17,7 @@ class TabbedPanel;
} // namespace ChatHelpers } // namespace ChatHelpers
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Data { namespace Data {
@ -32,14 +32,14 @@ class Checkbox;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
class EditCaptionBox : public BoxContent, public RPCSender { class EditCaptionBox : public BoxContent, public RPCSender {
public: public:
EditCaptionBox( EditCaptionBox(
QWidget*, QWidget*,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<HistoryItem*> item); not_null<HistoryItem*> item);
protected: protected:
@ -80,7 +80,7 @@ private:
: _preparedList.files.front().path; : _preparedList.files.front().path;
} }
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
FullMsgId _msgId; FullMsgId _msgId;
Image *_thumbnailImage = nullptr; Image *_thumbnailImage = nullptr;
bool _thumbnailImageLoaded = false; bool _thumbnailImageLoaded = false;

View file

@ -20,7 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "auth_session.h" #include "auth_session.h"
#include "mainwidget.h" #include "mainwidget.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "apiwrap.h" #include "apiwrap.h"
#include "observer_peer.h" #include "observer_peer.h"
@ -222,7 +222,7 @@ void AddParticipantsBoxController::Start(
box->boxClosing() | rpl::start_with_next([=] { box->boxClosing() | rpl::start_with_next([=] {
auto params = Window::SectionShow(); auto params = Window::SectionShow();
params.activation = anim::activation::background; params.activation = anim::activation::background;
App::wnd()->controller()->showPeerHistory( App::wnd()->sessionController()->showPeerHistory(
channel, channel,
params, params,
ShowAtTheEndMsgId); ShowAtTheEndMsgId);

View file

@ -24,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_chat.h" #include "data/data_chat.h"
#include "data/data_user.h" #include "data/data_user.h"
#include "ui/widgets/popup_menu.h" #include "ui/widgets/popup_menu.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "history/history.h" #include "history/history.h"
namespace { namespace {
@ -706,7 +706,7 @@ ParticipantsBoxController::SavedState::SavedState(
} }
ParticipantsBoxController::ParticipantsBoxController( ParticipantsBoxController::ParticipantsBoxController(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
Role role) Role role)
: PeerListController(CreateSearchController(peer, role, &_additional)) : PeerListController(CreateSearchController(peer, role, &_additional))
@ -775,7 +775,7 @@ auto ParticipantsBoxController::CreateSearchController(
} }
void ParticipantsBoxController::Start( void ParticipantsBoxController::Start(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
Role role) { Role role) {
auto controller = std::make_unique<ParticipantsBoxController>( auto controller = std::make_unique<ParticipantsBoxController>(

View file

@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/profile/info_profile_members_controllers.h" #include "info/profile/info_profile_members_controllers.h"
namespace Window { namespace Window {
class Navigation; class SessionNavigation;
} // namespace Window } // namespace Window
Fn<void( Fn<void(
@ -135,12 +135,12 @@ public:
using Role = ParticipantsRole; using Role = ParticipantsRole;
static void Start( static void Start(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
Role role); Role role);
ParticipantsBoxController( ParticipantsBoxController(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
Role role); Role role);
@ -227,7 +227,7 @@ private:
void subscribeToMigration(); void subscribeToMigration();
void migrate(not_null<ChannelData*> channel); void migrate(not_null<ChannelData*> channel);
not_null<Window::Navigation*> _navigation; not_null<Window::SessionNavigation*> _navigation;
not_null<PeerData*> _peer; not_null<PeerData*> _peer;
Role _role = Role::Admins; Role _role = Role::Admins;
int _offset = 0; int _offset = 0;

View file

@ -42,7 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/padding_wrap.h" #include "ui/wrap/padding_wrap.h"
#include "ui/wrap/slide_wrap.h" #include "ui/wrap/slide_wrap.h"
#include "ui/wrap/vertical_layout.h" #include "ui/wrap/vertical_layout.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include <rpl/flatten_latest.h> #include <rpl/flatten_latest.h>
#include <rpl/range.h> #include <rpl/range.h>
#include "info/profile/info_profile_icon.h" #include "info/profile/info_profile_icon.h"
@ -718,7 +718,7 @@ void Controller::fillHistoryVisibilityButton() {
void Controller::fillManageSection() { void Controller::fillManageSection() {
Expects(_controls.buttonsLayout != nullptr); Expects(_controls.buttonsLayout != nullptr);
const auto navigation = App::wnd()->controller(); const auto navigation = App::wnd()->sessionController();
const auto chat = _peer->asChat(); const auto chat = _peer->asChat();
const auto channel = _peer->asChannel(); const auto channel = _peer->asChannel();

View file

@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/profile/info_profile_values.h" #include "info/profile/info_profile_values.h"
#include "boxes/peers/edit_participants_box.h" #include "boxes/peers/edit_participants_box.h"
#include "boxes/peers/edit_peer_info_box.h" #include "boxes/peers/edit_peer_info_box.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
#include "styles/style_info.h" #include "styles/style_info.h"
@ -356,7 +356,7 @@ void EditPeerPermissionsBox::addBannedButtons(
object_ptr<BoxContentDivider>(container), object_ptr<BoxContentDivider>(container),
{ 0, st::infoProfileSkip, 0, st::infoProfileSkip }); { 0, st::infoProfileSkip, 0, st::infoProfileSkip });
const auto navigation = App::wnd()->controller(); const auto navigation = App::wnd()->sessionController();
container->add(EditPeerInfoBox::CreateButton( container->add(EditPeerInfoBox::CreateButton(
container, container,
Lang::Viewer(lng_manage_peer_exceptions), Lang::Viewer(lng_manage_peer_exceptions),

View file

@ -36,7 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/wrap/padding_wrap.h" #include "ui/wrap/padding_wrap.h"
#include "ui/wrap/slide_wrap.h" #include "ui/wrap/slide_wrap.h"
#include "ui/wrap/vertical_layout.h" #include "ui/wrap/vertical_layout.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include <rpl/flatten_latest.h> #include <rpl/flatten_latest.h>
namespace { namespace {

View file

@ -29,7 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/special_buttons.h" #include "ui/special_buttons.h"
#include "data/data_document.h" #include "data/data_document.h"
#include "media/clip/media_clip_reader.h" #include "media/clip/media_clip_reader.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "layout.h" #include "layout.h"
#include "styles/style_history.h" #include "styles/style_history.h"
#include "styles/style_boxes.h" #include "styles/style_boxes.h"
@ -46,12 +46,12 @@ class SingleMediaPreview : public Ui::RpWidget {
public: public:
static SingleMediaPreview *Create( static SingleMediaPreview *Create(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
const Storage::PreparedFile &file); const Storage::PreparedFile &file);
SingleMediaPreview( SingleMediaPreview(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
QImage preview, QImage preview,
bool animated, bool animated,
bool sticker, bool sticker,
@ -73,7 +73,7 @@ private:
void prepareAnimatedPreview(const QString &animatedPreviewPath); void prepareAnimatedPreview(const QString &animatedPreviewPath);
void clipCallback(Media::Clip::Notification notification); void clipCallback(Media::Clip::Notification notification);
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
bool _animated = false; bool _animated = false;
bool _sticker = false; bool _sticker = false;
bool _canSendAsPhoto = false; bool _canSendAsPhoto = false;
@ -568,7 +568,7 @@ void AlbumThumb::finishAnimations() {
SingleMediaPreview *SingleMediaPreview::Create( SingleMediaPreview *SingleMediaPreview::Create(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
const Storage::PreparedFile &file) { const Storage::PreparedFile &file) {
auto preview = QImage(); auto preview = QImage();
bool animated = false; bool animated = false;
@ -602,7 +602,7 @@ SingleMediaPreview *SingleMediaPreview::Create(
SingleMediaPreview::SingleMediaPreview( SingleMediaPreview::SingleMediaPreview(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
QImage preview, QImage preview,
bool animated, bool animated,
bool sticker, bool sticker,
@ -1337,7 +1337,7 @@ void SendFilesBox::AlbumPreview::mouseReleaseEvent(QMouseEvent *e) {
SendFilesBox::SendFilesBox( SendFilesBox::SendFilesBox(
QWidget*, QWidget*,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Storage::PreparedList &&list, Storage::PreparedList &&list,
const TextWithTags &caption, const TextWithTags &caption,
CompressConfirm compressed) CompressConfirm compressed)

View file

@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/storage_media_prepare.h" #include "storage/storage_media_prepare.h"
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace ChatHelpers { namespace ChatHelpers {
@ -32,7 +32,7 @@ class EmojiButton;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
enum class SendFilesWay { enum class SendFilesWay {
@ -45,7 +45,7 @@ class SendFilesBox : public BoxContent {
public: public:
SendFilesBox( SendFilesBox(
QWidget*, QWidget*,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Storage::PreparedList &&list, Storage::PreparedList &&list,
const TextWithTags &caption, const TextWithTags &caption,
CompressConfirm compressed); CompressConfirm compressed);
@ -107,7 +107,7 @@ private:
bool canAddUrls(const QList<QUrl> &urls) const; bool canAddUrls(const QList<QUrl> &urls) const;
bool addFiles(not_null<const QMimeData*> data); bool addFiles(not_null<const QMimeData*> data);
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
QString _titleText; QString _titleText;
int _titleHeight = 0; int _titleHeight = 0;

View file

@ -379,7 +379,7 @@ void EmojiColorPicker::drawVariant(Painter &p, int variant) {
EmojiListWidget::EmojiListWidget( EmojiListWidget::EmojiListWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: Inner(parent, controller) : Inner(parent, controller)
, _picker(this) , _picker(this)
, _showPickerTimer([=] { showPicker(); }) { , _showPickerTimer([=] { showPicker(); }) {

View file

@ -18,7 +18,7 @@ enum class Section;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace ChatHelpers { namespace ChatHelpers {
@ -33,7 +33,7 @@ class EmojiListWidget
public: public:
EmojiListWidget( EmojiListWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller); not_null<Window::SessionController*> controller);
using Section = Ui::Emoji::Section; using Section = Ui::Emoji::Section;

View file

@ -22,7 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "storage/localstorage.h" #include "storage/localstorage.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "history/view/history_view_cursor_state.h" #include "history/view/history_view_cursor_state.h"
namespace ChatHelpers { namespace ChatHelpers {
@ -124,7 +124,7 @@ void GifsListWidget::Footer::processPanelHideFinished() {
GifsListWidget::GifsListWidget( GifsListWidget::GifsListWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: Inner(parent, controller) : Inner(parent, controller)
, _section(Section::Gifs) , _section(Section::Gifs)
, _updateInlineItems([=] { updateInlineItems(); }) , _updateInlineItems([=] { updateInlineItems(); })
@ -133,7 +133,11 @@ GifsListWidget::GifsListWidget(
setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_OpaquePaintEvent);
_inlineRequestTimer.setSingleShot(true); _inlineRequestTimer.setSingleShot(true);
connect(&_inlineRequestTimer, &QTimer::timeout, this, [this] { sendInlineRequest(); }); connect(
&_inlineRequestTimer,
&QTimer::timeout,
this,
[=] { sendInlineRequest(); });
Auth().data().savedGifsUpdated( Auth().data().savedGifsUpdated(
) | rpl::start_with_next([this] { ) | rpl::start_with_next([this] {
@ -142,8 +146,9 @@ GifsListWidget::GifsListWidget(
subscribe(Auth().downloaderTaskFinished(), [this] { subscribe(Auth().downloaderTaskFinished(), [this] {
update(); update();
}); });
subscribe(controller->gifPauseLevelChanged(), [this] { subscribe(controller->gifPauseLevelChanged(), [=] {
if (!this->controller()->isGifPausedAtLeastFor(Window::GifPauseReason::SavedGifs)) { if (!controller->isGifPausedAtLeastFor(
Window::GifPauseReason::SavedGifs)) {
update(); update();
} }
}); });

View file

@ -23,7 +23,7 @@ class RoundButton;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace ChatHelpers { namespace ChatHelpers {
@ -36,7 +36,7 @@ class GifsListWidget
public: public:
using InlineChosen = TabbedSelector::InlineChosen; using InlineChosen = TabbedSelector::InlineChosen;
GifsListWidget(QWidget *parent, not_null<Window::Controller*> controller); GifsListWidget(QWidget *parent, not_null<Window::SessionController*> controller);
rpl::producer<not_null<DocumentData*>> fileChosen() const; rpl::producer<not_null<DocumentData*>> fileChosen() const;
rpl::producer<not_null<PhotoData*>> photoChosen() const; rpl::producer<not_null<PhotoData*>> photoChosen() const;

View file

@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h" #include "data/data_session.h"
#include "data/data_user.h" #include "data/data_user.h"
#include "chat_helpers/emoji_suggestions_widget.h" #include "chat_helpers/emoji_suggestions_widget.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "auth_session.h" #include "auth_session.h"
@ -353,9 +353,8 @@ Fn<bool(
}; };
} }
void InitMessageField( void InitMessageField(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<Ui::InputField*> field) { not_null<Ui::InputField*> field) {
field->setMinHeight(st::historySendSize.height() - 2 * st::historySendPadding); field->setMinHeight(st::historySendSize.height() - 2 * st::historySendPadding);
field->setMaxHeight(st::historyComposeFieldMaxHeight); field->setMaxHeight(st::historyComposeFieldMaxHeight);

View file

@ -11,8 +11,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/timer.h" #include "base/timer.h"
class HistoryWidget; class HistoryWidget;
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
QString ConvertTagToMimeTag(const QString &tagId); QString ConvertTagToMimeTag(const QString &tagId);
@ -34,7 +35,7 @@ Fn<bool(
Ui::InputField::EditLinkAction action)> DefaultEditLinkCallback( Ui::InputField::EditLinkAction action)> DefaultEditLinkCallback(
not_null<Ui::InputField*> field); not_null<Ui::InputField*> field);
void InitMessageField( void InitMessageField(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<Ui::InputField*> field); not_null<Ui::InputField*> field);
bool HasSendText(not_null<const Ui::InputField*> field); bool HasSendText(not_null<const Ui::InputField*> field);

View file

@ -697,7 +697,10 @@ bool StickersListWidget::Footer::iconsAnimationCallback(crl::time now) {
return (_iconsStartAnim != 0); return (_iconsStartAnim != 0);
} }
StickersListWidget::StickersListWidget(QWidget *parent, not_null<Window::Controller*> controller) : Inner(parent, controller) StickersListWidget::StickersListWidget(
QWidget *parent,
not_null<Window::SessionController*> controller)
: Inner(parent, controller)
, _section(Section::Stickers) , _section(Section::Stickers)
, _megagroupSetAbout(st::columnMinimalWidthThird - st::emojiScroll.width - st::emojiPanHeaderLeft) , _megagroupSetAbout(st::columnMinimalWidthThird - st::emojiScroll.width - st::emojiPanHeaderLeft)
, _addText(lang(lng_stickers_featured_add).toUpper()) , _addText(lang(lng_stickers_featured_add).toUpper())

View file

@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/timer.h" #include "base/timer.h"
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Ui { namespace Ui {
@ -32,7 +32,7 @@ class StickersListWidget
public: public:
StickersListWidget( StickersListWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller); not_null<Window::SessionController*> controller);
rpl::producer<not_null<DocumentData*>> chosen() const; rpl::producer<not_null<DocumentData*>> chosen() const;
rpl::producer<> scrollUpdated() const; rpl::producer<> scrollUpdated() const;

View file

@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/shadow.h" #include "ui/widgets/shadow.h"
#include "ui/image/image_prepare.h" #include "ui/image/image_prepare.h"
#include "chat_helpers/tabbed_selector.h" #include "chat_helpers/tabbed_selector.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "core/application.h" #include "core/application.h"
#include "core/qt_signal_producer.h" #include "core/qt_signal_producer.h"
@ -26,7 +26,7 @@ constexpr auto kDelayedHideTimeoutMs = 3000;
TabbedPanel::TabbedPanel( TabbedPanel::TabbedPanel(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: TabbedPanel( : TabbedPanel(
parent, parent,
controller, controller,
@ -35,7 +35,7 @@ TabbedPanel::TabbedPanel(
TabbedPanel::TabbedPanel( TabbedPanel::TabbedPanel(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
object_ptr<TabbedSelector> selector) object_ptr<TabbedSelector> selector)
: RpWidget(parent) : RpWidget(parent)
, _controller(controller) , _controller(controller)

View file

@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/timer.h" #include "base/timer.h"
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Ui { namespace Ui {
@ -25,10 +25,10 @@ class TabbedSelector;
class TabbedPanel : public Ui::RpWidget { class TabbedPanel : public Ui::RpWidget {
public: public:
TabbedPanel(QWidget *parent, not_null<Window::Controller*> controller); TabbedPanel(QWidget *parent, not_null<Window::SessionController*> controller);
TabbedPanel( TabbedPanel(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
object_ptr<TabbedSelector> selector); object_ptr<TabbedSelector> selector);
object_ptr<TabbedSelector> takeSelector(); object_ptr<TabbedSelector> takeSelector();
@ -87,7 +87,7 @@ private:
bool preventAutoHide() const; bool preventAutoHide() const;
void updateContentHeight(); void updateContentHeight();
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
object_ptr<TabbedSelector> _selector; object_ptr<TabbedSelector> _selector;
int _contentMaxHeight = 0; int _contentMaxHeight = 0;

View file

@ -21,7 +21,7 @@ TabbedMemento::TabbedMemento(
object_ptr<Window::SectionWidget> TabbedMemento::createWidget( object_ptr<Window::SectionWidget> TabbedMemento::createWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Window::Column column, Window::Column column,
const QRect &geometry) { const QRect &geometry) {
auto result = object_ptr<TabbedSection>( auto result = object_ptr<TabbedSection>(
@ -41,7 +41,7 @@ TabbedMemento::~TabbedMemento() {
TabbedSection::TabbedSection( TabbedSection::TabbedSection(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: TabbedSection( : TabbedSection(
parent, parent,
controller, controller,
@ -51,7 +51,7 @@ TabbedSection::TabbedSection(
TabbedSection::TabbedSection( TabbedSection::TabbedSection(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
object_ptr<TabbedSelector> selector, object_ptr<TabbedSelector> selector,
Fn<void(object_ptr<TabbedSelector>)> returnMethod) Fn<void(object_ptr<TabbedSelector>)> returnMethod)
: Window::SectionWidget(parent, controller) : Window::SectionWidget(parent, controller)

View file

@ -24,7 +24,7 @@ public:
object_ptr<Window::SectionWidget> createWidget( object_ptr<Window::SectionWidget> createWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Window::Column column, Window::Column column,
const QRect &geometry) override; const QRect &geometry) override;
@ -40,10 +40,10 @@ class TabbedSection : public Window::SectionWidget {
public: public:
TabbedSection( TabbedSection(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller); not_null<Window::SessionController*> controller);
TabbedSection( TabbedSection(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
object_ptr<TabbedSelector> selector, object_ptr<TabbedSelector> selector,
Fn<void(object_ptr<TabbedSelector>)> returnMethod); Fn<void(object_ptr<TabbedSelector>)> returnMethod);

View file

@ -276,7 +276,7 @@ void TabbedSelector::Tab::saveScrollTop() {
TabbedSelector::TabbedSelector( TabbedSelector::TabbedSelector(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Mode mode) Mode mode)
: RpWidget(parent) : RpWidget(parent)
, _mode(mode) , _mode(mode)
@ -368,7 +368,7 @@ TabbedSelector::TabbedSelector(
showAll(); showAll();
} }
TabbedSelector::Tab TabbedSelector::createTab(SelectorTab type, not_null<Window::Controller*> controller) { TabbedSelector::Tab TabbedSelector::createTab(SelectorTab type, not_null<Window::SessionController*> controller) {
auto createWidget = [&]() -> object_ptr<Inner> { auto createWidget = [&]() -> object_ptr<Inner> {
if (!full() && type != SelectorTab::Emoji) { if (!full() && type != SelectorTab::Emoji) {
return { nullptr }; return { nullptr };
@ -872,7 +872,7 @@ void TabbedSelector::scrollToY(int y) {
TabbedSelector::Inner::Inner( TabbedSelector::Inner::Inner(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: RpWidget(parent) : RpWidget(parent)
, _controller(controller) { , _controller(controller) {
} }

View file

@ -25,7 +25,7 @@ class FlatLabel;
} // namesapce Ui } // namesapce Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace ChatHelpers { namespace ChatHelpers {
@ -53,7 +53,7 @@ public:
TabbedSelector( TabbedSelector(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Mode mode = Mode::Full); Mode mode = Mode::Full);
rpl::producer<EmojiPtr> emojiChosen() const; rpl::producer<EmojiPtr> emojiChosen() const;
@ -148,7 +148,7 @@ private:
bool full() const; bool full() const;
Tab createTab( Tab createTab(
SelectorTab type, SelectorTab type,
not_null<Window::Controller*> controller); not_null<Window::SessionController*> controller);
void paintSlideFrame(Painter &p); void paintSlideFrame(Painter &p);
void paintContent(Painter &p); void paintContent(Painter &p);
@ -212,7 +212,7 @@ private:
class TabbedSelector::Inner : public Ui::RpWidget { class TabbedSelector::Inner : public Ui::RpWidget {
public: public:
Inner(QWidget *parent, not_null<Window::Controller*> controller); Inner(QWidget *parent, not_null<Window::SessionController*> controller);
int getVisibleTop() const { int getVisibleTop() const {
return _visibleTop; return _visibleTop;
@ -246,7 +246,7 @@ protected:
int minimalHeight() const; int minimalHeight() const;
int resizeGetHeight(int newWidth) override final; int resizeGetHeight(int newWidth) override final;
not_null<Window::Controller*> controller() const { not_null<Window::SessionController*> controller() const {
return _controller; return _controller;
} }
@ -261,7 +261,7 @@ protected:
void disableScroll(bool disabled); void disableScroll(bool disabled);
private: private:
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
int _visibleTop = 0; int _visibleTop = 0;
int _visibleBottom = 0; int _visibleBottom = 0;

View file

@ -52,7 +52,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/emoji_config.h" #include "ui/emoji_config.h"
#include "ui/effects/animations.h" #include "ui/effects/animations.h"
#include "storage/serialize_common.h" #include "storage/serialize_common.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "base/qthelp_regex.h" #include "base/qthelp_regex.h"
#include "base/qthelp_url.h" #include "base/qthelp_url.h"
#include "boxes/connection_box.h" #include "boxes/connection_box.h"

View file

@ -20,7 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/connection_box.h" #include "boxes/connection_box.h"
#include "boxes/sticker_set_box.h" #include "boxes/sticker_set_box.h"
#include "passport/passport_form_controller.h" #include "passport/passport_form_controller.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "data/data_session.h" #include "data/data_session.h"
#include "data/data_channel.h" #include "data/data_channel.h"
#include "mainwindow.h" #include "mainwindow.h"
@ -46,7 +46,7 @@ bool JoinGroupByHash(const Match &match, const QVariant &context) {
})); }));
}, [=](const MTPDchatInviteAlready &data) { }, [=](const MTPDchatInviteAlready &data) {
if (const auto chat = Auth().data().processChat(data.vchat)) { if (const auto chat = Auth().data().processChat(data.vchat)) {
App::wnd()->controller()->showPeerHistory( App::wnd()->sessionController()->showPeerHistory(
chat, chat,
Window::SectionShow::Way::Forward); Window::SectionShow::Way::Forward);
} }
@ -145,7 +145,7 @@ bool ShowPassportForm(const QMap<QString, QString> &params) {
QString()); QString());
const auto errors = params.value("errors", QString()); const auto errors = params.value("errors", QString());
if (const auto window = App::wnd()) { if (const auto window = App::wnd()) {
if (const auto controller = window->controller()) { if (const auto controller = window->sessionController()) {
controller->showPassportForm(Passport::FormRequest( controller->showPassportForm(Passport::FormRequest(
botId, botId,
scope, scope,
@ -240,7 +240,7 @@ bool ResolvePrivatePost(const Match &match, const QVariant &context) {
return false; return false;
} }
const auto done = [=](not_null<PeerData*> peer) { const auto done = [=](not_null<PeerData*> peer) {
App::wnd()->controller()->showPeerHistory( App::wnd()->sessionController()->showPeerHistory(
peer->id, peer->id,
Window::SectionShow::Way::Forward, Window::SectionShow::Way::Forward,
msgId); msgId);

View file

@ -16,7 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/click_handler_types.h" #include "core/click_handler_types.h"
#include "info/info_memento.h" #include "info/info_memento.h"
#include "info/settings/info_settings_widget.h" #include "info/settings/info_settings_widget.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "settings/settings_intro.h" #include "settings/settings_intro.h"
extern "C" { extern "C" {
@ -1577,7 +1577,7 @@ void UpdateApplication() {
} else { } else {
cSetAutoUpdate(true); cSetAutoUpdate(true);
if (const auto window = App::wnd()) { if (const auto window = App::wnd()) {
if (const auto controller = window->controller()) { if (const auto controller = window->sessionController()) {
controller->showSection( controller->showSection(
Info::Memento( Info::Memento(
Info::Settings::Tag{ Auth().user() }, Info::Settings::Tag{ Auth().user() },

View file

@ -24,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "platform/platform_specific.h" #include "platform/platform_specific.h"
#include "history/history.h" #include "history/history.h"
#include "history/history_item.h" #include "history/history_item.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "storage/cache/storage_cache_database.h" #include "storage/cache/storage_cache_database.h"
#include "boxes/confirm_box.h" #include "boxes/confirm_box.h"
#include "ui/image/image.h" #include "ui/image/image.h"

View file

@ -20,7 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "auth_session.h" #include "auth_session.h"
#include "core/application.h" #include "core/application.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "ui/image/image.h" #include "ui/image/image.h"
#include "ui/empty_userpic.h" #include "ui/empty_userpic.h"
#include "ui/text_options.h" #include "ui/text_options.h"
@ -77,7 +77,7 @@ PeerClickHandler::PeerClickHandler(not_null<PeerData*> peer)
void PeerClickHandler::onClick(ClickContext context) const { void PeerClickHandler::onClick(ClickContext context) const {
if (context.button == Qt::LeftButton && App::wnd()) { if (context.button == Qt::LeftButton && App::wnd()) {
auto controller = App::wnd()->controller(); const auto controller = App::wnd()->sessionController();
if (_peer if (_peer
&& _peer->isChannel() && _peer->isChannel()
&& controller->activeChatCurrent().peer() != _peer) { && controller->activeChatCurrent().peer() != _peer) {

View file

@ -20,7 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h" #include "data/data_session.h"
#include "info/info_memento.h" #include "info/info_memento.h"
#include "info/info_controller.h" #include "info/info_controller.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "core/crash_reports.h" #include "core/crash_reports.h"
@ -47,7 +47,7 @@ void SharedMediaShowOverview(
Storage::SharedMediaType type, Storage::SharedMediaType type,
not_null<History*> history) { not_null<History*> history) {
if (SharedMediaOverviewType(type)) { if (SharedMediaOverviewType(type)) {
App::wnd()->controller()->showSection(Info::Memento( App::wnd()->sessionController()->showSection(Info::Memento(
history->peer->id, history->peer->id,
Info::Section(type))); Info::Section(type)));
} }

View file

@ -34,7 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "chat_helpers/stickers.h" #include "chat_helpers/stickers.h"
#include "auth_session.h" #include "auth_session.h"
#include "window/notifications_manager.h" #include "window/notifications_manager.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_peer_menu.h" #include "window/window_peer_menu.h"
#include "ui/widgets/multi_select.h" #include "ui/widgets/multi_select.h"
#include "ui/empty_userpic.h" #include "ui/empty_userpic.h"
@ -98,7 +98,7 @@ struct InnerWidget::PeerSearchResult {
InnerWidget::InnerWidget( InnerWidget::InnerWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: RpWidget(parent) : RpWidget(parent)
, _controller(controller) , _controller(controller)
, _pinnedShiftAnimation([=](crl::time now) { , _pinnedShiftAnimation([=](crl::time now) {

View file

@ -22,7 +22,7 @@ class LinkButton;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Dialogs { namespace Dialogs {
@ -58,7 +58,9 @@ class InnerWidget
Q_OBJECT Q_OBJECT
public: public:
InnerWidget(QWidget *parent, not_null<Window::Controller*> controller); InnerWidget(
QWidget *parent,
not_null<Window::SessionController*> controller);
bool searchReceived( bool searchReceived(
const QVector<MTPMessage> &result, const QVector<MTPMessage> &result,
@ -291,7 +293,7 @@ private:
bool pinnedShiftAnimationCallback(crl::time now); bool pinnedShiftAnimationCallback(crl::time now);
void handleChatMigration(not_null<ChatData*> chat); void handleChatMigration(not_null<ChatData*> chat);
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
Mode _mode = Mode(); Mode _mode = Mode();
bool _mouseSelection = false; bool _mouseSelection = false;

View file

@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Dialogs { namespace Dialogs {
void ShowSearchFromBox( void ShowSearchFromBox(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
Fn<void(not_null<UserData*>)> callback, Fn<void(not_null<UserData*>)> callback,
Fn<void()> closedCallback) { Fn<void()> closedCallback) {
@ -50,7 +50,7 @@ void ShowSearchFromBox(
} }
SearchFromController::SearchFromController( SearchFromController::SearchFromController(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
Fn<void(not_null<UserData*>)> callback) Fn<void(not_null<UserData*>)> callback)
: ParticipantsBoxController( : ParticipantsBoxController(

View file

@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Dialogs { namespace Dialogs {
void ShowSearchFromBox( void ShowSearchFromBox(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
Fn<void(not_null<UserData*>)> callback, Fn<void(not_null<UserData*>)> callback,
Fn<void()> closedCallback); Fn<void()> closedCallback);
@ -21,7 +21,7 @@ void ShowSearchFromBox(
class SearchFromController : public ParticipantsBoxController { class SearchFromController : public ParticipantsBoxController {
public: public:
SearchFromController( SearchFromController(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
Fn<void(not_null<UserData*>)> callback); Fn<void(not_null<UserData*>)> callback);

View file

@ -28,7 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/update_checker.h" #include "core/update_checker.h"
#include "boxes/peer_list_box.h" #include "boxes/peer_list_box.h"
#include "boxes/peers/edit_participants_box.h" #include "boxes/peers/edit_participants_box.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_slide_animation.h" #include "window/window_slide_animation.h"
#include "window/window_connecting_widget.h" #include "window/window_connecting_widget.h"
#include "storage/storage_media_prepare.h" #include "storage/storage_media_prepare.h"
@ -150,7 +150,9 @@ void Widget::BottomButton::paintEvent(QPaintEvent *e) {
} }
} }
Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller) Widget::Widget(
QWidget *parent,
not_null<Window::SessionController*> controller)
: Window::AbstractSectionWidget(parent, controller) : Window::AbstractSectionWidget(parent, controller)
, _searchControls(this) , _searchControls(this)
, _mainMenuToggle(_searchControls, st::dialogsMenuToggle) , _mainMenuToggle(_searchControls, st::dialogsMenuToggle)
@ -1276,7 +1278,7 @@ void Widget::clearSearchCache() {
void Widget::showJumpToDate() { void Widget::showJumpToDate() {
if (_searchInChat) { if (_searchInChat) {
this->controller()->showJumpToDate(_searchInChat, QDate()); controller()->showJumpToDate(_searchInChat, QDate());
} }
} }

View file

@ -31,7 +31,7 @@ class FadeWrapScaled;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
class ConnectionState; class ConnectionState;
} // namespace Window } // namespace Window
@ -49,7 +49,7 @@ class Widget : public Window::AbstractSectionWidget, public RPCSender {
Q_OBJECT Q_OBJECT
public: public:
Widget(QWidget *parent, not_null<Window::Controller*> controller); Widget(QWidget *parent, not_null<Window::SessionController*> controller);
void updateDragInScroll(bool inScroll); void updateDragInScroll(bool inScroll);

View file

@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/click_handler_types.h" #include "core/click_handler_types.h"
#include "core/application.h" #include "core/application.h"
#include "media/clip/media_clip_reader.h" #include "media/clip/media_clip_reader.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "history/history_item_components.h" #include "history/history_item_components.h"
#include "platform/platform_info.h" #include "platform/platform_info.h"
#include "data/data_peer.h" #include "data/data_peer.h"
@ -227,8 +227,8 @@ bool isLayerShown() {
} }
void showPeerProfile(const PeerId &peer) { void showPeerProfile(const PeerId &peer) {
if (auto window = App::wnd()) { if (const auto window = App::wnd()) {
if (auto controller = window->controller()) { if (const auto controller = window->sessionController()) {
controller->showPeerInfo(peer); controller->showPeerInfo(peer);
} }
} }

View file

@ -27,7 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/application.h" #include "core/application.h"
#include "apiwrap.h" #include "apiwrap.h"
#include "layout.h" #include "layout.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "auth_session.h" #include "auth_session.h"
#include "ui/widgets/popup_menu.h" #include "ui/widgets/popup_menu.h"
#include "ui/image/image.h" #include "ui/image/image.h"
@ -212,7 +212,7 @@ void InnerWidget::enumerateDates(Method method) {
InnerWidget::InnerWidget( InnerWidget::InnerWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<ChannelData*> channel) not_null<ChannelData*> channel)
: RpWidget(parent) : RpWidget(parent)
, _controller(controller) , _controller(controller)

View file

@ -29,7 +29,7 @@ class PopupMenu;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace AdminLog { namespace AdminLog {
@ -45,7 +45,7 @@ class InnerWidget final
public: public:
InnerWidget( InnerWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<ChannelData*> channel); not_null<ChannelData*> channel);
base::Observable<void> showSearchSignal; base::Observable<void> showSearchSignal;
@ -207,7 +207,7 @@ private:
template <typename Method> template <typename Method>
void enumerateDates(Method method); void enumerateDates(Method method);
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
not_null<ChannelData*> _channel; not_null<ChannelData*> _channel;
not_null<History*> _history; not_null<History*> _history;
std::vector<OwnedItem> _items; std::vector<OwnedItem> _items;

View file

@ -20,7 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwindow.h" #include "mainwindow.h"
#include "apiwrap.h" #include "apiwrap.h"
#include "window/themes/window_theme.h" #include "window/themes/window_theme.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "boxes/confirm_box.h" #include "boxes/confirm_box.h"
#include "base/timer.h" #include "base/timer.h"
#include "data/data_channel.h" #include "data/data_channel.h"
@ -36,7 +36,7 @@ class FixedBar final : public TWidget, private base::Subscriber {
public: public:
FixedBar( FixedBar(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<ChannelData*> channel); not_null<ChannelData*> channel);
base::Observable<void> showFilterSignal; base::Observable<void> showFilterSignal;
@ -70,7 +70,7 @@ private:
void applySearch(); void applySearch();
void searchAnimationCallback(); void searchAnimationCallback();
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
not_null<ChannelData*> _channel; not_null<ChannelData*> _channel;
object_ptr<Ui::FlatInput> _field; object_ptr<Ui::FlatInput> _field;
object_ptr<Profile::BackButton> _backButton; object_ptr<Profile::BackButton> _backButton;
@ -87,7 +87,7 @@ private:
object_ptr<Window::SectionWidget> SectionMemento::createWidget( object_ptr<Window::SectionWidget> SectionMemento::createWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Window::Column column, Window::Column column,
const QRect &geometry) { const QRect &geometry) {
if (column == Window::Column::Third) { if (column == Window::Column::Third) {
@ -100,7 +100,7 @@ object_ptr<Window::SectionWidget> SectionMemento::createWidget(
FixedBar::FixedBar( FixedBar::FixedBar(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<ChannelData*> channel) : TWidget(parent) not_null<ChannelData*> channel) : TWidget(parent)
, _controller(controller) , _controller(controller)
, _channel(channel) , _channel(channel)
@ -125,7 +125,9 @@ FixedBar::FixedBar(
void FixedBar::applyFilter(const FilterValue &value) { void FixedBar::applyFilter(const FilterValue &value) {
auto hasFilter = (value.flags != 0) || !value.allUsers; auto hasFilter = (value.flags != 0) || !value.allUsers;
_backButton->setText(lang(hasFilter ? lng_admin_log_title_selected : lng_admin_log_title_all)); _backButton->setText(lang(hasFilter
? lng_admin_log_title_selected
: lng_admin_log_title_all));
} }
void FixedBar::goBack() { void FixedBar::goBack() {
@ -141,7 +143,11 @@ void FixedBar::showSearch() {
void FixedBar::toggleSearch() { void FixedBar::toggleSearch() {
_searchShown = !_searchShown; _searchShown = !_searchShown;
_cancel->toggle(_searchShown, anim::type::normal); _cancel->toggle(_searchShown, anim::type::normal);
_searchShownAnimation.start([this] { searchAnimationCallback(); }, _searchShown ? 0. : 1., _searchShown ? 1. : 0., st::historyAdminLogSearchSlideDuration); _searchShownAnimation.start(
[=] { searchAnimationCallback(); },
_searchShown ? 0. : 1.,
_searchShown ? 1. : 0.,
st::historyAdminLogSearchSlideDuration);
_search->setDisabled(_searchShown); _search->setDisabled(_searchShown);
if (_searchShown) { if (_searchShown) {
_field->show(); _field->show();
@ -154,9 +160,13 @@ void FixedBar::toggleSearch() {
void FixedBar::searchAnimationCallback() { void FixedBar::searchAnimationCallback() {
if (!_searchShownAnimation.animating()) { if (!_searchShownAnimation.animating()) {
_field->setVisible(_searchShown); _field->setVisible(_searchShown);
_search->setIconOverride(_searchShown ? &st::topBarSearch.icon : nullptr, _searchShown ? &st::topBarSearch.icon : nullptr); _search->setIconOverride(
_search->setRippleColorOverride(_searchShown ? &st::topBarBg : nullptr); _searchShown ? &st::topBarSearch.icon : nullptr,
_search->setCursor(_searchShown ? style::cur_default : style::cur_pointer); _searchShown ? &st::topBarSearch.icon : nullptr);
_search->setRippleColorOverride(
_searchShown ? &st::topBarBg : nullptr);
_search->setCursor(
_searchShown ? style::cur_default : style::cur_pointer);
} }
resizeToWidth(width()); resizeToWidth(width());
} }
@ -240,7 +250,7 @@ void FixedBar::mousePressEvent(QMouseEvent *e) {
} }
} }
Widget::Widget(QWidget *parent, not_null<Window::Controller*> controller, not_null<ChannelData*> channel) : Window::SectionWidget(parent, controller) Widget::Widget(QWidget *parent, not_null<Window::SessionController*> controller, not_null<ChannelData*> channel) : Window::SectionWidget(parent, controller)
, _scroll(this, st::historyScroll, false) , _scroll(this, st::historyScroll, false)
, _fixedBar(this, controller, channel) , _fixedBar(this, controller, channel)
, _fixedBarShadow(this) , _fixedBarShadow(this)

View file

@ -63,7 +63,7 @@ private:
class Widget final : public Window::SectionWidget { class Widget final : public Window::SectionWidget {
public: public:
Widget(QWidget *parent, not_null<Window::Controller*> controller, not_null<ChannelData*> channel); Widget(QWidget *parent, not_null<Window::SessionController*> controller, not_null<ChannelData*> channel);
not_null<ChannelData*> channel() const; not_null<ChannelData*> channel() const;
Dialogs::RowDescriptor activeChat() const override; Dialogs::RowDescriptor activeChat() const override;
@ -121,7 +121,7 @@ public:
object_ptr<Window::SectionWidget> createWidget( object_ptr<Window::SectionWidget> createWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Window::Column column, Window::Column column,
const QRect &geometry) override; const QRect &geometry) override;

View file

@ -26,7 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/image/image.h" #include "ui/image/image.h"
#include "ui/toast/toast.h" #include "ui/toast/toast.h"
#include "ui/text_options.h" #include "ui/text_options.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_peer_menu.h" #include "window/window_peer_menu.h"
#include "boxes/confirm_box.h" #include "boxes/confirm_box.h"
#include "boxes/report_box.h" #include "boxes/report_box.h"
@ -119,7 +119,7 @@ void HistoryInner::BotAbout::clickHandlerPressedChanged(
HistoryInner::HistoryInner( HistoryInner::HistoryInner(
not_null<HistoryWidget*> historyWidget, not_null<HistoryWidget*> historyWidget,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Ui::ScrollArea *scroll, Ui::ScrollArea *scroll,
not_null<History*> history) not_null<History*> history)
: RpWidget(nullptr) : RpWidget(nullptr)

View file

@ -28,7 +28,7 @@ class EmptyPainter;
} // namespace HistoryView } // namespace HistoryView
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Ui { namespace Ui {
@ -48,7 +48,7 @@ public:
HistoryInner( HistoryInner(
not_null<HistoryWidget*> historyWidget, not_null<HistoryWidget*> historyWidget,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Ui::ScrollArea *scroll, Ui::ScrollArea *scroll,
not_null<History*> history); not_null<History*> history);
@ -302,7 +302,7 @@ private:
static HistoryInner *Instance; static HistoryInner *Instance;
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
const not_null<PeerData*> _peer; const not_null<PeerData*> _peer;
const not_null<History*> _history; const not_null<History*> _history;

View file

@ -29,7 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "media/audio/media_audio.h" #include "media/audio/media_audio.h"
#include "core/application.h" #include "core/application.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "core/crash_reports.h" #include "core/crash_reports.h"
#include "data/data_session.h" #include "data/data_session.h"
#include "data/data_messages.h" #include "data/data_messages.h"
@ -802,7 +802,7 @@ ClickHandlerPtr goToMessageClickHandler(
main->pushReplyReturn(returnTo); main->pushReplyReturn(returnTo);
} }
} }
App::wnd()->controller()->showPeerHistory( App::wnd()->sessionController()->showPeerHistory(
peer, peer,
Window::SectionShow::Way::Forward, Window::SectionShow::Way::Forward,
msgId); msgId);

View file

@ -43,7 +43,7 @@ class Media;
} // namespace Data } // namespace Data
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace HistoryView { namespace HistoryView {

View file

@ -25,7 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/application.h" #include "core/application.h"
#include "layout.h" #include "layout.h"
#include "window/notifications_manager.h" #include "window/notifications_manager.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "observer_peer.h" #include "observer_peer.h"
#include "storage/storage_shared_media.h" #include "storage/storage_shared_media.h"
#include "data/data_session.h" #include "data/data_session.h"

View file

@ -24,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_channel.h" #include "data/data_channel.h"
#include "data/data_user.h" #include "data/data_user.h"
#include "window/notifications_manager.h" #include "window/notifications_manager.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "storage/storage_shared_media.h" #include "storage/storage_shared_media.h"
#include "ui/text_options.h" #include "ui/text_options.h"

View file

@ -73,7 +73,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "auth_session.h" #include "auth_session.h"
#include "window/themes/window_theme.h" #include "window/themes/window_theme.h"
#include "window/notifications_manager.h" #include "window/notifications_manager.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_slide_animation.h" #include "window/window_slide_animation.h"
#include "window/window_peer_menu.h" #include "window/window_peer_menu.h"
#include "inline_bots/inline_results_widget.h" #include "inline_bots/inline_results_widget.h"
@ -117,7 +117,7 @@ ApiWrap::RequestMessageDataCallback replyEditMessageDataCallback() {
}; };
} }
void ActivateWindow(not_null<Window::Controller*> controller) { void ActivateWindow(not_null<Window::SessionController*> controller) {
const auto window = controller->window(); const auto window = controller->window();
window->activateWindow(); window->activateWindow();
Core::App().activateWindowDelayed(window); Core::App().activateWindowDelayed(window);
@ -147,7 +147,7 @@ bool ShowHistoryEndInsteadOfUnread(
object_ptr<Ui::FlatButton> SetupDiscussButton( object_ptr<Ui::FlatButton> SetupDiscussButton(
not_null<QWidget*> parent, not_null<QWidget*> parent,
not_null<Window::Controller*> controller) { not_null<Window::SessionController*> controller) {
auto result = object_ptr<Ui::FlatButton>( auto result = object_ptr<Ui::FlatButton>(
parent, parent,
QString(), QString(),
@ -283,7 +283,7 @@ void ReportSpamPanel::setReported(bool reported, PeerData *onPeer) {
HistoryWidget::HistoryWidget( HistoryWidget::HistoryWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: Window::AbstractSectionWidget(parent, controller) : Window::AbstractSectionWidget(parent, controller)
, _updateEditTimeLeftDisplay([=] { updateField(); }) , _updateEditTimeLeftDisplay([=] { updateField(); })
, _fieldBarCancel(this, st::historyReplyCancel) , _fieldBarCancel(this, st::historyReplyCancel)
@ -475,13 +475,13 @@ HistoryWidget::HistoryWidget(
_topShadow->hide(); _topShadow->hide();
_attachDragDocument->setDroppedCallback([this](const QMimeData *data) { _attachDragDocument->setDroppedCallback([=](const QMimeData *data) {
confirmSendingFiles(data, CompressConfirm::No); confirmSendingFiles(data, CompressConfirm::No);
ActivateWindow(this->controller()); ActivateWindow(controller);
}); });
_attachDragPhoto->setDroppedCallback([=](const QMimeData *data) { _attachDragPhoto->setDroppedCallback([=](const QMimeData *data) {
confirmSendingFiles(data, CompressConfirm::Yes); confirmSendingFiles(data, CompressConfirm::Yes);
ActivateWindow(this->controller()); ActivateWindow(controller);
}); });
subscribe(Adaptive::Changed(), [=] { update(); }); subscribe(Adaptive::Changed(), [=] { update(); });
@ -548,7 +548,7 @@ HistoryWidget::HistoryWidget(
| UpdateFlag::ChannelAmIn | UpdateFlag::ChannelAmIn
| UpdateFlag::ChannelPromotedChanged | UpdateFlag::ChannelPromotedChanged
| UpdateFlag::ChannelLinkedChat; | UpdateFlag::ChannelLinkedChat;
subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(changes, [this](const Notify::PeerUpdate &update) { subscribe(Notify::PeerUpdated(), Notify::PeerUpdatedHandler(changes, [=](const Notify::PeerUpdate &update) {
if (update.peer == _peer) { if (update.peer == _peer) {
if (update.flags & UpdateFlag::RightsChanged) { if (update.flags & UpdateFlag::RightsChanged) {
checkPreview(); checkPreview();
@ -568,7 +568,7 @@ HistoryWidget::HistoryWidget(
if (update.flags & UpdateFlag::UnavailableReasonChanged) { if (update.flags & UpdateFlag::UnavailableReasonChanged) {
const auto unavailable = _peer->unavailableReason(); const auto unavailable = _peer->unavailableReason();
if (!unavailable.isEmpty()) { if (!unavailable.isEmpty()) {
this->controller()->showBackFromStack(); controller->showBackFromStack();
Ui::show(Box<InformBox>(unavailable)); Ui::show(Box<InformBox>(unavailable));
return; return;
} }

View file

@ -59,7 +59,7 @@ class RoundButton;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace ChatHelpers { namespace ChatHelpers {
@ -117,7 +117,7 @@ class HistoryWidget final : public Window::AbstractSectionWidget, public RPCSend
public: public:
using FieldHistoryAction = Ui::InputField::HistoryAction; using FieldHistoryAction = Ui::InputField::HistoryAction;
HistoryWidget(QWidget *parent, not_null<Window::Controller*> controller); HistoryWidget(QWidget *parent, not_null<Window::SessionController*> controller);
void start(); void start();

View file

@ -16,7 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history.h" #include "history/history.h"
#include "history/view/history_view_element.h" #include "history/view/history_view_element.h"
#include "history/view/history_view_cursor_state.h" #include "history/view/history_view_cursor_state.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "ui/empty_userpic.h" #include "ui/empty_userpic.h"
#include "ui/text_options.h" #include "ui/text_options.h"
#include "data/data_session.h" #include "data/data_session.h"
@ -35,7 +35,7 @@ namespace {
ClickHandlerPtr sendMessageClickHandler(PeerData *peer) { ClickHandlerPtr sendMessageClickHandler(PeerData *peer) {
return std::make_shared<LambdaClickHandler>([peer] { return std::make_shared<LambdaClickHandler>([peer] {
App::wnd()->controller()->showPeerHistory( App::wnd()->sessionController()->showPeerHistory(
peer->id, peer->id,
Window::SectionShow::Way::Forward); Window::SectionShow::Way::Forward);
}); });

View file

@ -21,8 +21,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history.h" #include "history/history.h"
#include "history/view/history_view_element.h" #include "history/view/history_view_element.h"
#include "history/view/history_view_cursor_state.h" #include "history/view/history_view_cursor_state.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "core/application.h" // for Application::showDocument. #include "core/application.h" // Application::showDocument.
#include "ui/image/image.h" #include "ui/image/image.h"
#include "data/data_session.h" #include "data/data_session.h"
#include "data/data_document.h" #include "data/data_document.h"
@ -297,7 +297,7 @@ void HistoryGif::draw(Painter &p, const QRect &r, TextSelection selection, crl::
auto roundCorners = (isRound || inWebPage) ? RectPart::AllCorners : ((isBubbleTop() ? (RectPart::TopLeft | RectPart::TopRight) : RectPart::None) auto roundCorners = (isRound || inWebPage) ? RectPart::AllCorners : ((isBubbleTop() ? (RectPart::TopLeft | RectPart::TopRight) : RectPart::None)
| ((isBubbleBottom() && _caption.isEmpty()) ? (RectPart::BottomLeft | RectPart::BottomRight) : RectPart::None)); | ((isBubbleBottom() && _caption.isEmpty()) ? (RectPart::BottomLeft | RectPart::BottomRight) : RectPart::None));
if (animating) { if (animating) {
auto paused = App::wnd()->controller()->isGifPausedAtLeastFor(Window::GifPauseReason::Any); auto paused = App::wnd()->sessionController()->isGifPausedAtLeastFor(Window::GifPauseReason::Any);
if (isRound) { if (isRound) {
if (player) { if (player) {
paused = false; paused = false;

View file

@ -16,8 +16,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/view/history_view_cursor_state.h" #include "history/view/history_view_cursor_state.h"
#include "ui/image/image.h" #include "ui/image/image.h"
#include "ui/emoji_config.h" #include "ui/emoji_config.h"
#include "mainwindow.h" // App::wnd()->controller() #include "mainwindow.h" // App::wnd()->sessionController.
#include "window/window_controller.h" // isGifPausedAtLeastFor(..) #include "window/window_session_controller.h" // isGifPausedAtLeastFor.
#include "data/data_session.h" #include "data/data_session.h"
#include "data/data_document.h" #include "data/data_document.h"
#include "lottie/lottie_animation.h" #include "lottie/lottie_animation.h"
@ -191,7 +191,7 @@ void HistorySticker::draw(Painter &p, const QRect &r, TextSelection selection, c
if (selected) { if (selected) {
request.colored = st::msgStickerOverlay->c; request.colored = st::msgStickerOverlay->c;
} }
const auto paused = App::wnd()->controller()->isGifPausedAtLeastFor(Window::GifPauseReason::Any); const auto paused = App::wnd()->sessionController()->isGifPausedAtLeastFor(Window::GifPauseReason::Any);
if (!paused) { if (!paused) {
_lottie->markFrameShown(); _lottie->markFrameShown();
} }

View file

@ -23,7 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/application.h" #include "core/application.h"
#include "apiwrap.h" #include "apiwrap.h"
#include "layout.h" #include "layout.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_peer_menu.h" #include "window/window_peer_menu.h"
#include "auth_session.h" #include "auth_session.h"
#include "ui/widgets/popup_menu.h" #include "ui/widgets/popup_menu.h"
@ -232,7 +232,7 @@ void ListWidget::enumerateDates(Method method) {
ListWidget::ListWidget( ListWidget::ListWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<ListDelegate*> delegate) not_null<ListDelegate*> delegate)
: RpWidget(parent) : RpWidget(parent)
, _delegate(delegate) , _delegate(delegate)

View file

@ -20,7 +20,7 @@ class PopupMenu;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Data { namespace Data {
@ -125,7 +125,7 @@ class ListWidget final
public: public:
ListWidget( ListWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<ListDelegate*> delegate); not_null<ListDelegate*> delegate);
not_null<ListDelegate*> delegate() const; not_null<ListDelegate*> delegate() const;
@ -419,7 +419,7 @@ private:
static constexpr auto kMinimalIdsLimit = 24; static constexpr auto kMinimalIdsLimit = 24;
not_null<ListDelegate*> _delegate; not_null<ListDelegate*> _delegate;
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
Data::MessagePosition _aroundPosition; Data::MessagePosition _aroundPosition;
Data::MessagePosition _shownAtPosition; Data::MessagePosition _shownAtPosition;
Context _context; Context _context;

View file

@ -21,7 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwidget.h" #include "mainwidget.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "auth_session.h" #include "auth_session.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "layout.h" #include "layout.h"
#include "styles/style_widgets.h" #include "styles/style_widgets.h"
#include "styles/style_history.h" #include "styles/style_history.h"
@ -1466,7 +1466,7 @@ ClickHandlerPtr Message::rightActionLink() const {
_rightActionLink = std::make_shared<LambdaClickHandler>([=] { _rightActionLink = std::make_shared<LambdaClickHandler>([=] {
if (const auto item = Auth().data().message(itemId)) { if (const auto item = Auth().data().message(itemId)) {
if (savedFromPeer && savedFromMsgId) { if (savedFromPeer && savedFromMsgId) {
App::wnd()->controller()->showPeerHistory( App::wnd()->sessionController()->showPeerHistory(
savedFromPeer, savedFromPeer,
Window::SectionShow::Way::Forward, Window::SectionShow::Way::Forward,
savedFromMsgId); savedFromMsgId);

View file

@ -25,7 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/buttons.h" #include "ui/widgets/buttons.h"
#include "ui/widgets/dropdown_menu.h" #include "ui/widgets/dropdown_menu.h"
#include "ui/effects/radial_animation.h" #include "ui/effects/radial_animation.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_peer_menu.h" #include "window/window_peer_menu.h"
#include "calls/calls_instance.h" #include "calls/calls_instance.h"
#include "data/data_peer_values.h" #include "data/data_peer_values.h"
@ -46,7 +46,7 @@ namespace HistoryView {
TopBarWidget::TopBarWidget( TopBarWidget::TopBarWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: RpWidget(parent) : RpWidget(parent)
, _controller(controller) , _controller(controller)
, _clear(this, langFactory(lng_selected_clear), st::topBarClearButton) , _clear(this, langFactory(lng_selected_clear), st::topBarClearButton)

View file

@ -22,7 +22,7 @@ class InfiniteRadialAnimation;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace HistoryView { namespace HistoryView {
@ -31,7 +31,7 @@ class TopBarWidget : public Ui::RpWidget, private base::Subscriber {
public: public:
TopBarWidget( TopBarWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller); not_null<Window::SessionController*> controller);
struct SelectedState { struct SelectedState {
bool textSelected = false; bool textSelected = false;
@ -107,7 +107,7 @@ private:
void refreshUnreadBadge(); void refreshUnreadBadge();
void updateUnreadBadge(); void updateUnreadBadge();
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
Dialogs::Key _activeChat; Dialogs::Key _activeChat;
int _selectedCount = 0; int _selectedCount = 0;

View file

@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/info_controller.h" #include "info/info_controller.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "mtproto/sender.h" #include "mtproto/sender.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "ui/widgets/scroll_area.h" #include "ui/widgets/scroll_area.h"
#include "ui/search_field_controller.h" #include "ui/search_field_controller.h"
#include "data/data_user.h" #include "data/data_user.h"

View file

@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <rpl/never.h> #include <rpl/never.h>
#include <rpl/combine.h> #include <rpl/combine.h>
#include <rpl/range.h> #include <rpl/range.h>
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "ui/widgets/scroll_area.h" #include "ui/widgets/scroll_area.h"
#include "ui/widgets/input_fields.h" #include "ui/widgets/input_fields.h"
#include "ui/wrap/padding_wrap.h" #include "ui/wrap/padding_wrap.h"

View file

@ -20,7 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_chat.h" #include "data/data_chat.h"
#include "data/data_session.h" #include "data/data_session.h"
#include "auth_session.h" #include "auth_session.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
namespace Info { namespace Info {
namespace { namespace {
@ -86,8 +86,9 @@ rpl::producer<QString> AbstractController::mediaSourceQueryValue() const {
return rpl::single(QString()); return rpl::single(QString());
} }
AbstractController::AbstractController(not_null<Window::Controller*> parent) AbstractController::AbstractController(
: Navigation(&parent->session()) not_null<Window::SessionController*> parent)
: SessionNavigation(&parent->session())
, _parent(parent) { , _parent(parent) {
} }
@ -118,7 +119,7 @@ void AbstractController::showBackFromStack(
Controller::Controller( Controller::Controller(
not_null<WrapWidget*> widget, not_null<WrapWidget*> widget,
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
not_null<ContentMemento*> memento) not_null<ContentMemento*> memento)
: AbstractController(window) : AbstractController(window)
, _widget(widget) , _widget(widget)

View file

@ -9,7 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <rpl/variable.h> #include <rpl/variable.h>
#include "data/data_search_controller.h" #include "data/data_search_controller.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "settings/settings_common.h" #include "settings/settings_common.h"
namespace Ui { namespace Ui {
@ -97,9 +97,9 @@ private:
}; };
class AbstractController : public Window::Navigation { class AbstractController : public Window::SessionNavigation {
public: public:
AbstractController(not_null<Window::Controller*> parent); AbstractController(not_null<Window::SessionController*> parent);
virtual Key key() const = 0; virtual Key key() const = 0;
virtual PeerData *migrated() const = 0; virtual PeerData *migrated() const = 0;
@ -127,12 +127,12 @@ public:
const Window::SectionShow &params = Window::SectionShow()) override; const Window::SectionShow &params = Window::SectionShow()) override;
void showBackFromStack( void showBackFromStack(
const Window::SectionShow &params = Window::SectionShow()) override; const Window::SectionShow &params = Window::SectionShow()) override;
not_null<Window::Controller*> parentController() override { not_null<Window::SessionController*> parentController() override {
return _parent; return _parent;
} }
private: private:
not_null<Window::Controller*> _parent; not_null<Window::SessionController*> _parent;
}; };
@ -140,7 +140,7 @@ class Controller : public AbstractController {
public: public:
Controller( Controller(
not_null<WrapWidget*> widget, not_null<WrapWidget*> widget,
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
not_null<ContentMemento*> memento); not_null<ContentMemento*> memento);
Key key() const override { Key key() const override {

View file

@ -14,7 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/focus_persister.h" #include "ui/focus_persister.h"
#include "ui/widgets/buttons.h" #include "ui/widgets/buttons.h"
#include "window/section_widget.h" #include "window/section_widget.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/main_window.h" #include "window/main_window.h"
#include "auth_session.h" #include "auth_session.h"
#include "styles/style_info.h" #include "styles/style_info.h"
@ -24,7 +24,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Info { namespace Info {
LayerWidget::LayerWidget( LayerWidget::LayerWidget(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<Memento*> memento) not_null<Memento*> memento)
: _controller(controller) : _controller(controller)
, _content(this, controller, Wrap::Layer, memento) { , _content(this, controller, Wrap::Layer, memento) {
@ -33,7 +33,7 @@ LayerWidget::LayerWidget(
} }
LayerWidget::LayerWidget( LayerWidget::LayerWidget(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<MoveMemento*> memento) not_null<MoveMemento*> memento)
: _controller(controller) : _controller(controller)
, _content(memento->takeContent(this, Wrap::Layer)) { , _content(memento->takeContent(this, Wrap::Layer)) {
@ -50,7 +50,7 @@ not_null<Ui::RpWidget*> LayerWidget::floatPlayerWidget() {
return this; return this;
} }
not_null<Window::Controller*> LayerWidget::floatPlayerController() { not_null<Window::SessionController*> LayerWidget::floatPlayerController() {
return _controller; return _controller;
} }

View file

@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "media/player/media_player_float.h" #include "media/player/media_player_float.h"
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Info { namespace Info {
@ -26,10 +26,10 @@ class LayerWidget
, private ::Media::Player::FloatDelegate { , private ::Media::Player::FloatDelegate {
public: public:
LayerWidget( LayerWidget(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<Memento*> memento); not_null<Memento*> memento);
LayerWidget( LayerWidget(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<MoveMemento*> memento); not_null<MoveMemento*> memento);
void showFinished() override; void showFinished() override;
@ -58,7 +58,7 @@ private:
void restoreFloatPlayerDelegate(); void restoreFloatPlayerDelegate();
not_null<::Media::Player::FloatDelegate*> floatPlayerDelegate(); not_null<::Media::Player::FloatDelegate*> floatPlayerDelegate();
not_null<Ui::RpWidget*> floatPlayerWidget() override; not_null<Ui::RpWidget*> floatPlayerWidget() override;
not_null<Window::Controller*> floatPlayerController() override; not_null<Window::SessionController*> floatPlayerController() override;
not_null<Window::AbstractSectionWidget*> floatPlayerGetSection( not_null<Window::AbstractSectionWidget*> floatPlayerGetSection(
Window::Column column) override; Window::Column column) override;
void floatPlayerEnumerateSections(Fn<void( void floatPlayerEnumerateSections(Fn<void(
@ -68,7 +68,7 @@ private:
void setupHeightConsumers(); void setupHeightConsumers();
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
object_ptr<WrapWidget> _content; object_ptr<WrapWidget> _content;
int _desiredHeight = 0; int _desiredHeight = 0;

View file

@ -147,7 +147,7 @@ std::unique_ptr<ContentMemento> Memento::DefaultContent(
object_ptr<Window::SectionWidget> Memento::createWidget( object_ptr<Window::SectionWidget> Memento::createWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Window::Column column, Window::Column column,
const QRect &geometry) { const QRect &geometry) {
auto wrap = (column == Window::Column::Third) auto wrap = (column == Window::Column::Third)
@ -163,7 +163,7 @@ object_ptr<Window::SectionWidget> Memento::createWidget(
} }
object_ptr<Window::LayerWidget> Memento::createLayer( object_ptr<Window::LayerWidget> Memento::createLayer(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
const QRect &geometry) { const QRect &geometry) {
if (geometry.width() >= LayerWidget::MinimalSupportedWidth()) { if (geometry.width() >= LayerWidget::MinimalSupportedWidth()) {
return object_ptr<LayerWidget>(controller, this); return object_ptr<LayerWidget>(controller, this);
@ -185,7 +185,7 @@ MoveMemento::MoveMemento(object_ptr<WrapWidget> content)
object_ptr<Window::SectionWidget> MoveMemento::createWidget( object_ptr<Window::SectionWidget> MoveMemento::createWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Window::Column column, Window::Column column,
const QRect &geometry) { const QRect &geometry) {
auto wrap = (column == Window::Column::Third) auto wrap = (column == Window::Column::Third)
@ -201,7 +201,7 @@ object_ptr<Window::SectionWidget> MoveMemento::createWidget(
} }
object_ptr<Window::LayerWidget> MoveMemento::createLayer( object_ptr<Window::LayerWidget> MoveMemento::createLayer(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
const QRect &geometry) { const QRect &geometry) {
if (geometry.width() < LayerWidget::MinimalSupportedWidth()) { if (geometry.width() < LayerWidget::MinimalSupportedWidth()) {
return nullptr; return nullptr;

View file

@ -39,12 +39,12 @@ public:
object_ptr<Window::SectionWidget> createWidget( object_ptr<Window::SectionWidget> createWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Window::Column column, Window::Column column,
const QRect &geometry) override; const QRect &geometry) override;
object_ptr<Window::LayerWidget> createLayer( object_ptr<Window::LayerWidget> createLayer(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
const QRect &geometry) override; const QRect &geometry) override;
int stackSize() const { int stackSize() const {
@ -93,12 +93,12 @@ public:
object_ptr<Window::SectionWidget> createWidget( object_ptr<Window::SectionWidget> createWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
Window::Column column, Window::Column column,
const QRect &geometry) override; const QRect &geometry) override;
object_ptr<Window::LayerWidget> createLayer( object_ptr<Window::LayerWidget> createLayer(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
const QRect &geometry) override; const QRect &geometry) override;
bool instant() const override { bool instant() const override {

View file

@ -18,7 +18,7 @@ namespace Info {
SectionWidget::SectionWidget( SectionWidget::SectionWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
Wrap wrap, Wrap wrap,
not_null<Memento*> memento) not_null<Memento*> memento)
: Window::SectionWidget(parent, window) : Window::SectionWidget(parent, window)
@ -28,7 +28,7 @@ SectionWidget::SectionWidget(
SectionWidget::SectionWidget( SectionWidget::SectionWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
Wrap wrap, Wrap wrap,
not_null<MoveMemento*> memento) not_null<MoveMemento*> memento)
: Window::SectionWidget(parent, window) : Window::SectionWidget(parent, window)

View file

@ -30,12 +30,12 @@ class SectionWidget final : public Window::SectionWidget {
public: public:
SectionWidget( SectionWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
Wrap wrap, Wrap wrap,
not_null<Memento*> memento); not_null<Memento*> memento);
SectionWidget( SectionWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
Wrap wrap, Wrap wrap,
not_null<MoveMemento*> memento); not_null<MoveMemento*> memento);

View file

@ -22,7 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/search_field_controller.h" #include "ui/search_field_controller.h"
#include "calls/calls_instance.h" #include "calls/calls_instance.h"
#include "core/shortcuts.h" #include "core/shortcuts.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_slide_animation.h" #include "window/window_slide_animation.h"
#include "window/window_peer_menu.h" #include "window/window_peer_menu.h"
#include "boxes/peer_list_box.h" #include "boxes/peer_list_box.h"
@ -53,7 +53,7 @@ struct WrapWidget::StackItem {
WrapWidget::WrapWidget( WrapWidget::WrapWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
Wrap wrap, Wrap wrap,
not_null<Memento*> memento) not_null<Memento*> memento)
: SectionWidget(parent, window) : SectionWidget(parent, window)
@ -198,7 +198,7 @@ void WrapWidget::injectActiveProfileMemento(
} }
std::unique_ptr<Controller> WrapWidget::createController( std::unique_ptr<Controller> WrapWidget::createController(
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
not_null<ContentMemento*> memento) { not_null<ContentMemento*> memento) {
auto result = std::make_unique<Controller>( auto result = std::make_unique<Controller>(
this, this,

View file

@ -73,7 +73,7 @@ class WrapWidget final : public Window::SectionWidget {
public: public:
WrapWidget( WrapWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
Wrap wrap, Wrap wrap,
not_null<Memento*> memento); not_null<Memento*> memento);
@ -183,7 +183,7 @@ private:
not_null<ContentMemento*> memento, not_null<ContentMemento*> memento,
not_null<Controller*> controller); not_null<Controller*> controller);
std::unique_ptr<Controller> createController( std::unique_ptr<Controller> createController(
not_null<Window::Controller*> window, not_null<Window::SessionController*> window,
not_null<ContentMemento*> memento); not_null<ContentMemento*> memento);
//void convertProfileFromStackToTab(); //void convertProfileFromStackToTab();

View file

@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/profile/info_profile_values.h" #include "info/profile/info_profile_values.h"
#include "ui/wrap/slide_wrap.h" #include "ui/wrap/slide_wrap.h"
#include "ui/wrap/vertical_layout.h" #include "ui/wrap/vertical_layout.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "data/data_channel.h" #include "data/data_channel.h"
#include "data/data_user.h" #include "data/data_user.h"
#include "styles/style_info.h" #include "styles/style_info.h"
@ -80,7 +80,7 @@ inline auto AddCountedButton(
inline auto AddButton( inline auto AddButton(
Ui::VerticalLayout *parent, Ui::VerticalLayout *parent,
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer, not_null<PeerData*> peer,
PeerData *migrated, PeerData *migrated,
Type type, Type type,
@ -99,7 +99,7 @@ inline auto AddButton(
inline auto AddCommonGroupsButton( inline auto AddCommonGroupsButton(
Ui::VerticalLayout *parent, Ui::VerticalLayout *parent,
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<UserData*> user, not_null<UserData*> user,
Ui::MultiSlideTracker &tracker) { Ui::MultiSlideTracker &tracker) {
auto result = AddCountedButton( auto result = AddCountedButton(

View file

@ -17,7 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history.h" #include "history/history.h"
#include "history/view/history_view_cursor_state.h" #include "history/view/history_view_cursor_state.h"
#include "window/themes/window_theme.h" #include "window/themes/window_theme.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_peer_menu.h" #include "window/window_peer_menu.h"
#include "storage/file_download.h" #include "storage/file_download.h"
#include "ui/widgets/popup_menu.h" #include "ui/widgets/popup_menu.h"

View file

@ -31,7 +31,7 @@ class ItemBase;
} // namespace Overview } // namespace Overview
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Info { namespace Info {

View file

@ -32,7 +32,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/profile/info_profile_button.h" #include "info/profile/info_profile_button.h"
#include "info/profile/info_profile_text.h" #include "info/profile/info_profile_text.h"
#include "support/support_helper.h" #include "support/support_helper.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/window_peer_menu.h" #include "window/window_peer_menu.h"
#include "mainwidget.h" #include "mainwidget.h"
#include "auth_session.h" #include "auth_session.h"

View file

@ -21,7 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/labels.h" #include "ui/widgets/labels.h"
#include "ui/effects/ripple_animation.h" #include "ui/effects/ripple_animation.h"
#include "ui/special_buttons.h" #include "ui/special_buttons.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "observer_peer.h" #include "observer_peer.h"
#include "core/application.h" #include "core/application.h"
#include "auth_session.h" #include "auth_session.h"
@ -211,7 +211,7 @@ int SectionWithToggle::toggleSkip() const {
Cover::Cover( Cover::Cover(
QWidget *parent, QWidget *parent,
not_null<PeerData*> peer, not_null<PeerData*> peer,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: SectionWithToggle( : SectionWithToggle(
parent, parent,
st::infoProfilePhotoTop st::infoProfilePhotoTop

View file

@ -12,7 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "base/timer.h" #include "base/timer.h"
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace style { namespace style {
@ -58,7 +58,7 @@ public:
Cover( Cover(
QWidget *parent, QWidget *parent,
not_null<PeerData*> peer, not_null<PeerData*> peer,
not_null<Window::Controller*> controller); not_null<Window::SessionController*> controller);
Cover *setOnlineCount(rpl::producer<int> &&count); Cover *setOnlineCount(rpl::producer<int> &&count);

View file

@ -29,7 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "auth_session.h" #include "auth_session.h"
#include "apiwrap.h" #include "apiwrap.h"
#include "window/main_window.h" #include "window/main_window.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "storage/storage_shared_media.h" #include "storage/storage_shared_media.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "styles/style_info.h" #include "styles/style_info.h"

View file

@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/rp_widget.h" #include "ui/rp_widget.h"
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Ui { namespace Ui {

View file

@ -27,7 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "boxes/confirm_box.h" #include "boxes/confirm_box.h"
#include "boxes/peers/add_participants_box.h" #include "boxes/peers/add_participants_box.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "data/data_channel.h" #include "data/data_channel.h"
#include "data/data_chat.h" #include "data/data_chat.h"
#include "data/data_user.h" #include "data/data_user.h"

View file

@ -20,7 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_chat.h" #include "data/data_chat.h"
#include "data/data_user.h" #include "data/data_user.h"
#include "boxes/confirm_box.h" #include "boxes/confirm_box.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "styles/style_info.h" #include "styles/style_info.h"
#include "data/data_peer_values.h" #include "data/data_peer_values.h"
@ -94,7 +94,7 @@ void MemberListRow::paintNameIcon(
} }
std::unique_ptr<PeerListController> CreateMembersController( std::unique_ptr<PeerListController> CreateMembersController(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer) { not_null<PeerData*> peer) {
return std::make_unique<ParticipantsBoxController>( return std::make_unique<ParticipantsBoxController>(
navigation, navigation,

View file

@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "boxes/peer_list_box.h" #include "boxes/peer_list_box.h"
namespace Window { namespace Window {
class Navigation; class SessionNavigation;
} // namespace Window } // namespace Window
namespace Info { namespace Info {
@ -58,7 +58,7 @@ private:
}; };
std::unique_ptr<PeerListController> CreateMembersController( std::unique_ptr<PeerListController> CreateMembersController(
not_null<Window::Navigation*> navigation, not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer); not_null<PeerData*> peer);
} // namespace Profile } // namespace Profile

View file

@ -49,7 +49,7 @@ Widget::Widget(
_self))) { _self))) {
_inner->sectionShowOther( _inner->sectionShowOther(
) | rpl::start_with_next([=](Type type) { ) | rpl::start_with_next([=](Type type) {
this->controller()->showSettings(type); controller->showSettings(type);
}, _inner->lifetime()); }, _inner->lifetime());
controller->setCanSaveChanges(_inner->sectionCanSaveChanges()); controller->setCanSaveChanges(_inner->sectionCanSaveChanges());

View file

@ -27,7 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "apiwrap.h" #include "apiwrap.h"
#include "mainwidget.h" #include "mainwidget.h"
#include "auth_session.h" #include "auth_session.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "ui/widgets/scroll_area.h" #include "ui/widgets/scroll_area.h"
#include "ui/widgets/labels.h" #include "ui/widgets/labels.h"
#include "observer_peer.h" #include "observer_peer.h"
@ -42,7 +42,10 @@ constexpr auto kInlineBotRequestDelay = 400;
} // namespace } // namespace
Inner::Inner(QWidget *parent, not_null<Window::Controller*> controller) : TWidget(parent) Inner::Inner(
QWidget *parent,
not_null<Window::SessionController*> controller)
: TWidget(parent)
, _controller(controller) , _controller(controller)
, _updateInlineItems([=] { updateInlineItems(); }) , _updateInlineItems([=] { updateInlineItems(); })
, _previewTimer([=] { showPreview(); }) { , _previewTimer([=] { showPreview(); }) {
@ -720,7 +723,7 @@ void Inner::onSwitchPm() {
Widget::Widget( Widget::Widget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: RpWidget(parent) : RpWidget(parent)
, _controller(controller) , _controller(controller)
, _contentMaxHeight(st::emojiPanMaxHeight) , _contentMaxHeight(st::emojiPanMaxHeight)

View file

@ -25,7 +25,7 @@ class RippleAnimation;
} // namesapce Ui } // namesapce Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace InlineBots { namespace InlineBots {
@ -52,7 +52,7 @@ class Inner : public TWidget, public Context, private base::Subscriber {
Q_OBJECT Q_OBJECT
public: public:
Inner(QWidget *parent, not_null<Window::Controller*> controller); Inner(QWidget *parent, not_null<Window::SessionController*> controller);
void hideFinish(bool completely); void hideFinish(bool completely);
@ -128,7 +128,7 @@ private:
int validateExistingInlineRows(const Results &results); int validateExistingInlineRows(const Results &results);
void selectInlineResult(int row, int column); void selectInlineResult(int row, int column);
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
int _visibleTop = 0; int _visibleTop = 0;
int _visibleBottom = 0; int _visibleBottom = 0;
@ -165,7 +165,7 @@ class Widget : public Ui::RpWidget, private MTP::Sender {
Q_OBJECT Q_OBJECT
public: public:
Widget(QWidget *parent, not_null<Window::Controller*> controller); Widget(QWidget *parent, not_null<Window::SessionController*> controller);
void moveBottom(int bottom); void moveBottom(int bottom);
@ -233,7 +233,7 @@ private:
bool refreshInlineRows(int *added = nullptr); bool refreshInlineRows(int *added = nullptr);
void inlineResultsDone(const MTPmessages_BotResults &result); void inlineResultsDone(const MTPmessages_BotResults &result);
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
int _contentMaxHeight = 0; int _contentMaxHeight = 0;
int _contentHeight = 0; int _contentHeight = 0;

View file

@ -75,7 +75,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_top_bar_wrap.h" #include "window/window_top_bar_wrap.h"
#include "window/notifications_manager.h" #include "window/notifications_manager.h"
#include "window/window_slide_animation.h" #include "window/window_slide_animation.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/themes/window_theme.h" #include "window/themes/window_theme.h"
#include "window/window_history_hider.h" #include "window/window_history_hider.h"
#include "mtproto/dc_options.h" #include "mtproto/dc_options.h"
@ -355,7 +355,7 @@ MainWidget::SettingBackground::SettingBackground(
MainWidget::MainWidget( MainWidget::MainWidget(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller) not_null<Window::SessionController*> controller)
: RpWidget(parent) : RpWidget(parent)
, _controller(controller) , _controller(controller)
, _dialogsWidth(st::columnMinimalWidthLeft) , _dialogsWidth(st::columnMinimalWidthLeft)
@ -499,7 +499,7 @@ not_null<Ui::RpWidget*> MainWidget::floatPlayerWidget() {
return this; return this;
} }
not_null<Window::Controller*> MainWidget::floatPlayerController() { not_null<Window::SessionController*> MainWidget::floatPlayerController() {
return _controller; return _controller;
} }

View file

@ -63,7 +63,7 @@ class SlideWrap;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
template <typename Inner> template <typename Inner>
class TopBarWrapWidget; class TopBarWrapWidget;
class SectionMemento; class SectionMemento;
@ -97,7 +97,7 @@ class MainWidget
public: public:
using SectionShow = Window::SectionShow; using SectionShow = Window::SectionShow;
MainWidget(QWidget *parent, not_null<Window::Controller*> controller); MainWidget(QWidget *parent, not_null<Window::SessionController*> controller);
AuthSession &session() const; AuthSession &session() const;
@ -410,7 +410,7 @@ private:
not_null<Media::Player::FloatDelegate*> floatPlayerDelegate(); not_null<Media::Player::FloatDelegate*> floatPlayerDelegate();
not_null<Ui::RpWidget*> floatPlayerWidget() override; not_null<Ui::RpWidget*> floatPlayerWidget() override;
not_null<Window::Controller*> floatPlayerController() override; not_null<Window::SessionController*> floatPlayerController() override;
not_null<Window::AbstractSectionWidget*> floatPlayerGetSection( not_null<Window::AbstractSectionWidget*> floatPlayerGetSection(
Window::Column column) override; Window::Column column) override;
void floatPlayerEnumerateSections(Fn<void( void floatPlayerEnumerateSections(Fn<void(
@ -445,7 +445,7 @@ private:
void handleHistoryBack(); void handleHistoryBack();
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
bool _started = false; bool _started = false;
Ui::Animations::Simple _a_show; Ui::Animations::Simple _a_show;

View file

@ -43,7 +43,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/themes/window_theme_warning.h" #include "window/themes/window_theme_warning.h"
#include "window/window_lock_widgets.h" #include "window/window_lock_widgets.h"
#include "window/window_main_menu.h" #include "window/window_main_menu.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
namespace { namespace {
@ -235,7 +235,7 @@ void MainWindow::setupMain() {
clearWidgets(); clearWidgets();
_main.create(bodyWidget(), controller()); _main.create(bodyWidget(), sessionController());
_main->show(); _main->show();
updateControlsGeometry(); updateControlsGeometry();
@ -257,7 +257,7 @@ void MainWindow::showSettings() {
return; return;
} }
if (const auto controller = this->controller()) { if (const auto controller = sessionController()) {
controller->showSettings(); controller->showSettings();
} else { } else {
showSpecialLayer(Box<Settings::LayerWidget>(), anim::type::normal); showSpecialLayer(Box<Settings::LayerWidget>(), anim::type::normal);
@ -294,7 +294,7 @@ void MainWindow::showMainMenu() {
if (isHidden()) showFromTray(); if (isHidden()) showFromTray();
ensureLayerCreated(); ensureLayerCreated();
_layer->showMainMenu(controller(), anim::type::normal); _layer->showMainMenu(sessionController(), anim::type::normal);
} }
void MainWindow::ensureLayerCreated() { void MainWindow::ensureLayerCreated() {
@ -309,8 +309,8 @@ void MainWindow::ensureLayerCreated() {
destroyLayer(); destroyLayer();
}, _layer->lifetime()); }, _layer->lifetime());
if (controller()) { if (const auto controller = sessionController()) {
controller()->enableGifPauseReason(Window::GifPauseReason::Layer); controller->enableGifPauseReason(Window::GifPauseReason::Layer);
} }
} }
@ -324,8 +324,8 @@ void MainWindow::destroyLayer() {
setFocus(); setFocus();
} }
layer = nullptr; layer = nullptr;
if (controller()) { if (const auto controller = sessionController()) {
controller()->disableGifPauseReason(Window::GifPauseReason::Layer); controller->disableGifPauseReason(Window::GifPauseReason::Layer);
} }
if (resetFocus) { if (resetFocus) {
setInnerFocus(); setInnerFocus();
@ -385,7 +385,7 @@ void MainWindow::ui_showMediaPreview(
return; return;
} }
if (!_mediaPreview) { if (!_mediaPreview) {
_mediaPreview.create(bodyWidget(), controller()); _mediaPreview.create(bodyWidget(), sessionController());
updateControlsGeometry(); updateControlsGeometry();
} }
if (_mediaPreview->isHidden()) { if (_mediaPreview->isHidden()) {
@ -401,7 +401,7 @@ void MainWindow::ui_showMediaPreview(
return; return;
} }
if (!_mediaPreview) { if (!_mediaPreview) {
_mediaPreview.create(bodyWidget(), controller()); _mediaPreview.create(bodyWidget(), sessionController());
updateControlsGeometry(); updateControlsGeometry();
} }
if (_mediaPreview->isHidden()) { if (_mediaPreview->isHidden()) {

View file

@ -18,7 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "media/streaming/media_streaming_player.h" #include "media/streaming/media_streaming_player.h"
#include "media/view/media_view_playback_progress.h" #include "media/view/media_view_playback_progress.h"
#include "media/player/media_player_instance.h" #include "media/player/media_player_instance.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "window/section_widget.h" #include "window/section_widget.h"
#include "auth_session.h" #include "auth_session.h"
#include "styles/style_media_player.h" #include "styles/style_media_player.h"
@ -29,7 +29,7 @@ namespace Player {
Float::Float( Float::Float(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<HistoryItem*> item, not_null<HistoryItem*> item,
Fn<void(bool visible)> toggleCallback, Fn<void(bool visible)> toggleCallback,
Fn<void(bool closed)> draggedCallback) Fn<void(bool closed)> draggedCallback)
@ -261,7 +261,7 @@ void Float::repaintItem() {
template <typename ToggleCallback, typename DraggedCallback> template <typename ToggleCallback, typename DraggedCallback>
FloatController::Item::Item( FloatController::Item::Item(
not_null<QWidget*> parent, not_null<QWidget*> parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<HistoryItem*> item, not_null<HistoryItem*> item,
ToggleCallback toggle, ToggleCallback toggle,
DraggedCallback dragged) DraggedCallback dragged)

View file

@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/effects/animations.h" #include "ui/effects/animations.h"
namespace Window { namespace Window {
class Controller; class SessionController;
class AbstractSectionWidget; class AbstractSectionWidget;
enum class Column; enum class Column;
} // namespace Window } // namespace Window
@ -35,7 +35,7 @@ class Float : public Ui::RpWidget, private base::Subscriber {
public: public:
Float( Float(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<HistoryItem*> item, not_null<HistoryItem*> item,
Fn<void(bool visible)> toggleCallback, Fn<void(bool visible)> toggleCallback,
Fn<void(bool closed)> draggedCallback); Fn<void(bool closed)> draggedCallback);
@ -88,7 +88,7 @@ private:
void finishDrag(bool closed); void finishDrag(bool closed);
void pauseResume(); void pauseResume();
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
HistoryItem *_item = nullptr; HistoryItem *_item = nullptr;
Fn<void(bool visible)> _toggleCallback; Fn<void(bool visible)> _toggleCallback;
@ -108,7 +108,7 @@ private:
class FloatDelegate { class FloatDelegate {
public: public:
virtual not_null<Ui::RpWidget*> floatPlayerWidget() = 0; virtual not_null<Ui::RpWidget*> floatPlayerWidget() = 0;
virtual not_null<Window::Controller*> floatPlayerController() = 0; virtual not_null<Window::SessionController*> floatPlayerController() = 0;
virtual not_null<Window::AbstractSectionWidget*> floatPlayerGetSection( virtual not_null<Window::AbstractSectionWidget*> floatPlayerGetSection(
Window::Column column) = 0; Window::Column column) = 0;
virtual void floatPlayerEnumerateSections(Fn<void( virtual void floatPlayerEnumerateSections(Fn<void(
@ -192,7 +192,7 @@ private:
template <typename ToggleCallback, typename DraggedCallback> template <typename ToggleCallback, typename DraggedCallback>
Item( Item(
not_null<QWidget*> parent, not_null<QWidget*> parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<HistoryItem*> item, not_null<HistoryItem*> item,
ToggleCallback toggle, ToggleCallback toggle,
DraggedCallback dragged); DraggedCallback dragged);
@ -241,7 +241,7 @@ private:
not_null<FloatDelegate*> _delegate; not_null<FloatDelegate*> _delegate;
not_null<Ui::RpWidget*> _parent; not_null<Ui::RpWidget*> _parent;
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
std::vector<std::unique_ptr<Item>> _items; std::vector<std::unique_ptr<Item>> _items;
rpl::event_stream<FullMsgId> _closeEvents; rpl::event_stream<FullMsgId> _closeEvents;

View file

@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_item.h" #include "history/history_item.h"
#include "data/data_media_types.h" #include "data/data_media_types.h"
#include "data/data_file_origin.h" #include "data/data_file_origin.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "core/shortcuts.h" #include "core/shortcuts.h"
#include "core/application.h" #include "core/application.h"
#include "main/main_account.h" // Account::sessionValue. #include "main/main_account.h" // Account::sessionValue.
@ -179,7 +179,7 @@ void Instance::clearStreamed(not_null<Data*> data) {
requestRoundVideoResize(); requestRoundVideoResize();
emitUpdate(data->type); emitUpdate(data->type);
data->streamed = nullptr; data->streamed = nullptr;
App::wnd()->controller()->disableGifPauseReason( App::wnd()->sessionController()->disableGifPauseReason(
Window::GifPauseReason::RoundPlaying); Window::GifPauseReason::RoundPlaying);
} }
@ -685,7 +685,7 @@ void Instance::handleStreamingUpdate(
float64) { float64) {
requestRoundVideoRepaint(); requestRoundVideoRepaint();
}); });
App::wnd()->controller()->enableGifPauseReason( App::wnd()->sessionController()->enableGifPauseReason(
Window::GifPauseReason::RoundPlaying); Window::GifPauseReason::RoundPlaying);
requestRoundVideoResize(); requestRoundVideoResize();
} }

View file

@ -38,7 +38,7 @@ constexpr auto kDelayedHideTimeout = crl::time(3000);
Panel::Panel( Panel::Panel(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> window) not_null<Window::SessionController*> window)
: RpWidget(parent) : RpWidget(parent)
, AbstractController(window) , AbstractController(window)
, _showTimer([this] { startShow(); }) , _showTimer([this] { startShow(); })

View file

@ -13,7 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "info/info_controller.h" #include "info/info_controller.h"
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Ui { namespace Ui {
@ -30,7 +30,7 @@ class Panel : public Ui::RpWidget, private Info::AbstractController {
public: public:
Panel( Panel(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller); not_null<Window::SessionController*> controller);
bool overlaps(const QRect &globalRect); bool overlaps(const QRect &globalRect);

View file

@ -19,7 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h" #include "data/data_session.h"
#include "data/data_user.h" #include "data/data_user.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "core/click_handler_types.h" #include "core/click_handler_types.h"
#include "ui/toast/toast.h" #include "ui/toast/toast.h"
#include "auth_session.h" #include "auth_session.h"
@ -610,7 +610,7 @@ std::vector<EditFile> Value::takeAllFilesInEdit() {
} }
FormController::FormController( FormController::FormController(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
const FormRequest &request) const FormRequest &request)
: _controller(controller) : _controller(controller)
, _request(PreprocessRequest(request)) , _request(PreprocessRequest(request))

View file

@ -21,7 +21,7 @@ struct UploadSecureProgress;
} // namespace Storage } // namespace Storage
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Passport { namespace Passport {
@ -322,7 +322,7 @@ struct FileKey {
class FormController : private MTP::Sender, public base::has_weak_ptr { class FormController : private MTP::Sender, public base::has_weak_ptr {
public: public:
FormController( FormController(
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
const FormRequest &request); const FormRequest &request);
void show(); void show();
@ -508,7 +508,7 @@ private:
void cancelAbort(); void cancelAbort();
void shortPollEmailConfirmation(); void shortPollEmailConfirmation();
not_null<Window::Controller*> _controller; not_null<Window::SessionController*> _controller;
FormRequest _request; FormRequest _request;
UserData *_bot = nullptr; UserData *_bot = nullptr;

View file

@ -21,7 +21,7 @@
#include "observer_peer.h" #include "observer_peer.h"
#include "styles/style_media_player.h" #include "styles/style_media_player.h"
#include "window/themes/window_theme.h" #include "window/themes/window_theme.h"
#include "window/window_controller.h" #include "window/window_session_controller.h"
#include "ui/empty_userpic.h" #include "ui/empty_userpic.h"
#include "styles/style_dialogs.h" #include "styles/style_dialogs.h"
@ -241,7 +241,7 @@ void PaintUnreadBadge(Painter &p, PeerData *peer) {
return; return;
} }
if (const auto folder = Auth().data().folderLoaded(Data::Folder::kId)) { if (const auto folder = Auth().data().folderLoaded(Data::Folder::kId)) {
App::wnd()->controller()->openFolder(folder); App::wnd()->sessionController()->openFolder(folder);
} }
}; };
Core::Sandbox::Instance().customEnterFromEventLoop([=] { Core::Sandbox::Instance().customEnterFromEventLoop([=] {

View file

@ -30,7 +30,7 @@ namespace Settings {
object_ptr<Section> CreateSection( object_ptr<Section> CreateSection(
Type type, Type type,
not_null<QWidget*> parent, not_null<QWidget*> parent,
Window::Controller *controller, Window::SessionController *controller,
UserData *self) { UserData *self) {
switch (type) { switch (type) {
case Type::Main: case Type::Main:

View file

@ -16,7 +16,7 @@ class VerticalLayout;
} // namespace Ui } // namespace Ui
namespace Window { namespace Window {
class Controller; class SessionController;
} // namespace Window } // namespace Window
namespace Info { namespace Info {
@ -62,7 +62,7 @@ public:
object_ptr<Section> CreateSection( object_ptr<Section> CreateSection(
Type type, Type type,
not_null<QWidget*> parent, not_null<QWidget*> parent,
Window::Controller *controller = nullptr, Window::SessionController *controller = nullptr,
UserData *self = nullptr); UserData *self = nullptr);
void AddSkip(not_null<Ui::VerticalLayout*> container); void AddSkip(not_null<Ui::VerticalLayout*> container);

View file

@ -38,7 +38,7 @@ constexpr auto kSaveBioTimeout = 1000;
void SetupPhoto( void SetupPhoto(
not_null<Ui::VerticalLayout*> container, not_null<Ui::VerticalLayout*> container,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<UserData*> self) { not_null<UserData*> self) {
const auto wrap = container->add(object_ptr<BoxContentDivider>( const auto wrap = container->add(object_ptr<BoxContentDivider>(
container, container,
@ -409,7 +409,7 @@ BioManager SetupBio(
Information::Information( Information::Information(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<UserData*> self) not_null<UserData*> self)
: Section(parent) : Section(parent)
, _self(self) { , _self(self) {
@ -424,7 +424,7 @@ Information::Information(
// _save(std::move(done)); // _save(std::move(done));
//} //}
void Information::setupContent(not_null<Window::Controller*> controller) { void Information::setupContent(not_null<Window::SessionController*> controller) {
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this); const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
SetupPhoto(content, controller, _self); SetupPhoto(content, controller, _self);

View file

@ -15,11 +15,11 @@ class Information : public Section {
public: public:
Information( Information(
QWidget *parent, QWidget *parent,
not_null<Window::Controller*> controller, not_null<Window::SessionController*> controller,
not_null<UserData*> self); not_null<UserData*> self);
private: private:
void setupContent(not_null<Window::Controller*> controller); void setupContent(not_null<Window::SessionController*> controller);
not_null<UserData*> _self; not_null<UserData*> _self;
//rpl::variable<bool> _canSaveChanges; //rpl::variable<bool> _canSaveChanges;

Some files were not shown because too many files have changed in this diff Show more