From b6bbf3a560785ff6f480e24aa576e8a6ee42d0a0 Mon Sep 17 00:00:00 2001 From: ZavaruKitsu Date: Wed, 3 Jan 2024 21:06:36 +0300 Subject: [PATCH] feat: add restart button to preferences --- Telegram/SourceFiles/info/info_wrap_widget.cpp | 7 ++++++- .../SourceFiles/settings/settings_common_session.cpp | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/info/info_wrap_widget.cpp b/Telegram/SourceFiles/info/info_wrap_widget.cpp index 32bd69c7a..7018d52fe 100644 --- a/Telegram/SourceFiles/info/info_wrap_widget.cpp +++ b/Telegram/SourceFiles/info/info_wrap_widget.cpp @@ -49,6 +49,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_menu_icons.h" #include "styles/style_layers.h" +// AyuGram includes +#include "ayu/ui/settings/settings_ayu.h" + + namespace Info { namespace { @@ -348,7 +352,8 @@ void WrapWidget::createTopBar() { && (section.settingsType() == ::Settings::CloudPasswordEmailConfirmId() || section.settingsType() == ::Settings::Main::Id() - || section.settingsType() == ::Settings::Chat::Id())) { + || section.settingsType() == ::Settings::Chat::Id() + || section.settingsType() == ::Settings::Ayu::Id())) { addTopBarMenuButton(); } else if (section.type() == Section::Type::Downloads) { auto &manager = Core::App().downloadManager(); diff --git a/Telegram/SourceFiles/settings/settings_common_session.cpp b/Telegram/SourceFiles/settings/settings_common_session.cpp index 047c2c622..ed487b659 100644 --- a/Telegram/SourceFiles/settings/settings_common_session.cpp +++ b/Telegram/SourceFiles/settings/settings_common_session.cpp @@ -32,6 +32,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include +// AyuGram includes +#include "ayu/ui/settings/settings_ayu.h" + + namespace Settings { void FillMenu( @@ -56,6 +60,11 @@ void FillMenu( tr::lng_settings_password_abort(tr::now), [=] { api->cloudPassword().clearUnconfirmedPassword(); }, &st::menuIconCancel); + } else if (type == Ayu::Id()) { + addAction( + tr::lng_restart_button(tr::now), + [=] { Core::Restart(); }, + &st::menuIconRestore); } else { const auto &list = Core::App().domain().accounts(); if (list.size() < Core::App().domain().maxAccounts()) {