Hotkey to restart the app (without default)

This commit is contained in:
Eric Kotato 2021-08-25 00:16:38 +03:00
parent d30aeea8fd
commit 36d8b28da1
3 changed files with 7 additions and 0 deletions

View file

@ -1162,6 +1162,10 @@ void Application::startShortcuts() {
Ui::Toast::Show(ktr("ktg_language_reloaded"));
return true;
});
request->check(Command::Restart) && request->handle([=] {
App::restart();
return true;
});
}, _lifetime);
}

View file

@ -101,6 +101,7 @@ const auto CommandByName = base::flat_map<QString, Command>{
{ qsl("save_draft") , Command::SaveDraft },
{ qsl("jump_to_date") , Command::JumpToDate },
{ qsl("reload_lang") , Command::ReloadLang },
{ qsl("restart_app") , Command::Restart },
{ qsl("pinned_1") , Command::ChatPinned1 },
{ qsl("pinned_2") , Command::ChatPinned2 },
@ -163,6 +164,7 @@ const auto CommandNames = base::flat_map<Command, QString>{
{ Command::SaveDraft , qsl("save_draft") },
{ Command::JumpToDate , qsl("jump_to_date") },
{ Command::ReloadLang , qsl("reload_lang") },
{ Command::Restart , qsl("restart_app") },
{ Command::ChatPinned1 , qsl("pinned_1") },
{ Command::ChatPinned2 , qsl("pinned_2") },

View file

@ -65,6 +65,7 @@ enum class Command {
SaveDraft,
JumpToDate,
ReloadLang,
Restart,
};
[[maybe_unused]] constexpr auto kShowFolder = {