diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 9d4cea300..93148a25c 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -1780,6 +1780,10 @@ void Application::startShortcuts() { Ui::Toast::Show(ktr("ktg_language_reloaded")); return true; }); + request->check(Command::Restart) && request->handle([=] { + Restart(); + return true; + }); }, _lifetime); } diff --git a/Telegram/SourceFiles/core/shortcuts.cpp b/Telegram/SourceFiles/core/shortcuts.cpp index 398914ffd..f2a7f18bc 100644 --- a/Telegram/SourceFiles/core/shortcuts.cpp +++ b/Telegram/SourceFiles/core/shortcuts.cpp @@ -110,6 +110,7 @@ const auto CommandByName = base::flat_map{ { qsl("save_draft") , Command::SaveDraft }, { qsl("jump_to_date") , Command::JumpToDate }, { qsl("reload_lang") , Command::ReloadLang }, + { qsl("restart_app") , Command::Restart }, }; const auto CommandNames = base::flat_map{ @@ -160,6 +161,7 @@ const auto CommandNames = base::flat_map{ { Command::SaveDraft , u"save_draft"_q }, { Command::JumpToDate , u"jump_to_date"_q }, { Command::ReloadLang , u"reload_lang"_q }, + { Command::Restart , u"restart_app"_q }, }; class Manager { diff --git a/Telegram/SourceFiles/core/shortcuts.h b/Telegram/SourceFiles/core/shortcuts.h index 4787d16fd..d816b80b0 100644 --- a/Telegram/SourceFiles/core/shortcuts.h +++ b/Telegram/SourceFiles/core/shortcuts.h @@ -77,6 +77,7 @@ enum class Command { SaveDraft, JumpToDate, ReloadLang, + Restart, }; [[maybe_unused]] constexpr auto kShowFolder = {