mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Show sessions list in a Settings Section.
This commit is contained in:
@@ -780,7 +780,8 @@ void SetupBotsAndWebsites(
|
||||
void SetupSessionsList(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<Ui::VerticalLayout*> container,
|
||||
rpl::producer<> updateTrigger) {
|
||||
rpl::producer<> updateTrigger,
|
||||
Fn<void(Type)> showOther) {
|
||||
AddSkip(container);
|
||||
AddSubsectionTitle(container, tr::lng_settings_sessions_title());
|
||||
|
||||
@@ -801,7 +802,7 @@ void SetupSessionsList(
|
||||
std::move(count),
|
||||
st::settingsButton
|
||||
)->addClickHandler([=] {
|
||||
controller->show(Box<SessionsBox>(controller));
|
||||
showOther(Type::Sessions);
|
||||
});
|
||||
AddSkip(container, st::settingsPrivacySecurityPadding);
|
||||
AddDividerText(container, tr::lng_settings_sessions_about());
|
||||
@@ -929,6 +930,10 @@ PrivacySecurity::PrivacySecurity(
|
||||
setupContent(controller);
|
||||
}
|
||||
|
||||
rpl::producer<Type> PrivacySecurity::sectionShowOther() {
|
||||
return _showOther.events();
|
||||
}
|
||||
|
||||
void PrivacySecurity::setupContent(
|
||||
not_null<Window::SessionController*> controller) {
|
||||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||
@@ -941,7 +946,9 @@ void PrivacySecurity::setupContent(
|
||||
|
||||
SetupPrivacy(controller, content, trigger());
|
||||
SetupArchiveAndMute(controller, content);
|
||||
SetupSessionsList(controller, content, trigger());
|
||||
SetupSessionsList(controller, content, trigger(), [=](Type type) {
|
||||
_showOther.fire_copy(type);
|
||||
});
|
||||
SetupLocalPasscode(controller, content);
|
||||
SetupCloudPassword(controller, content);
|
||||
#if !defined OS_MAC_STORE && !defined OS_WIN_STORE
|
||||
|
Reference in New Issue
Block a user