[Improvement] Shortcut to restart application
This commit is contained in:
parent
ced2a74e3f
commit
01b0009396
3 changed files with 7 additions and 0 deletions
|
|
@ -1458,6 +1458,10 @@ void Application::startShortcuts() {
|
|||
Ui::Toast::Show(ktr("ktg_language_reloaded"));
|
||||
return true;
|
||||
});
|
||||
request->check(Command::Restart) && request->handle([=] {
|
||||
Restart();
|
||||
return true;
|
||||
});
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
};
|
||||
|
||||
const auto CommandNames = base::flat_map<Command, QString>{
|
||||
|
|
@ -144,6 +145,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") },
|
||||
};
|
||||
|
||||
class Manager {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ enum class Command {
|
|||
SaveDraft,
|
||||
JumpToDate,
|
||||
ReloadLang,
|
||||
Restart,
|
||||
};
|
||||
|
||||
[[maybe_unused]] constexpr auto kShowFolder = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue