mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 15:15:13 +00:00
[Improvement] Shortcut to restart application
This commit is contained in:
committed by
Eric Kotato
parent
017b2cfe1e
commit
a4cc02fda7
@@ -1810,6 +1810,10 @@ void Application::startShortcuts() {
|
|||||||
Ui::Toast::Show(ktr("ktg_language_reloaded"));
|
Ui::Toast::Show(ktr("ktg_language_reloaded"));
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
request->check(Command::Restart) && request->handle([=] {
|
||||||
|
Restart();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}, _lifetime);
|
}, _lifetime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -112,6 +112,7 @@ const auto CommandByName = base::flat_map<QString, Command>{
|
|||||||
{ qsl("save_draft") , Command::SaveDraft },
|
{ qsl("save_draft") , Command::SaveDraft },
|
||||||
{ qsl("jump_to_date") , Command::JumpToDate },
|
{ qsl("jump_to_date") , Command::JumpToDate },
|
||||||
{ qsl("reload_lang") , Command::ReloadLang },
|
{ qsl("reload_lang") , Command::ReloadLang },
|
||||||
|
{ qsl("restart_app") , Command::Restart },
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto CommandNames = base::flat_map<Command, QString>{
|
const auto CommandNames = base::flat_map<Command, QString>{
|
||||||
@@ -155,6 +156,7 @@ const auto CommandNames = base::flat_map<Command, QString>{
|
|||||||
{ Command::SaveDraft , u"save_draft"_q },
|
{ Command::SaveDraft , u"save_draft"_q },
|
||||||
{ Command::JumpToDate , u"jump_to_date"_q },
|
{ Command::JumpToDate , u"jump_to_date"_q },
|
||||||
{ Command::ReloadLang , u"reload_lang"_q },
|
{ Command::ReloadLang , u"reload_lang"_q },
|
||||||
|
{ Command::Restart , u"restart_app"_q },
|
||||||
};
|
};
|
||||||
|
|
||||||
[[maybe_unused]] constexpr auto kNoValue = {
|
[[maybe_unused]] constexpr auto kNoValue = {
|
||||||
|
@@ -80,6 +80,7 @@ enum class Command {
|
|||||||
SaveDraft,
|
SaveDraft,
|
||||||
JumpToDate,
|
JumpToDate,
|
||||||
ReloadLang,
|
ReloadLang,
|
||||||
|
Restart,
|
||||||
};
|
};
|
||||||
|
|
||||||
[[maybe_unused]] constexpr auto kShowFolder = {
|
[[maybe_unused]] constexpr auto kShowFolder = {
|
||||||
|
Reference in New Issue
Block a user