mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
[Improvement] Shortcut to restart application
This commit is contained in:
committed by
Eric Kotato
parent
d4a1c1537f
commit
850bfeae35
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -110,6 +110,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>{
|
||||
@@ -160,6 +161,7 @@ const auto CommandNames = base::flat_map<Command, QString>{
|
||||
{ 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 {
|
||||
|
@@ -77,6 +77,7 @@ enum class Command {
|
||||
SaveDraft,
|
||||
JumpToDate,
|
||||
ReloadLang,
|
||||
Restart,
|
||||
};
|
||||
|
||||
[[maybe_unused]] constexpr auto kShowFolder = {
|
||||
|
Reference in New Issue
Block a user