[Improvement] Shortcut to save draft
This commit is contained in:
parent
2cc9386993
commit
a12e6e56bf
3 changed files with 11 additions and 0 deletions
|
|
@ -97,6 +97,8 @@ const auto CommandByName = base::flat_map<QString, Command>{
|
||||||
{ qsl("message_silently") , Command::SendSilentMessage },
|
{ qsl("message_silently") , Command::SendSilentMessage },
|
||||||
{ qsl("message_scheduled") , Command::ScheduleMessage },
|
{ qsl("message_scheduled") , Command::ScheduleMessage },
|
||||||
//
|
//
|
||||||
|
|
||||||
|
{ qsl("save_draft") , Command::SaveDraft },
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto CommandNames = base::flat_map<Command, QString>{
|
const auto CommandNames = base::flat_map<Command, QString>{
|
||||||
|
|
@ -136,6 +138,8 @@ const auto CommandNames = base::flat_map<Command, QString>{
|
||||||
{ Command::ShowContacts , qsl("show_contacts") },
|
{ Command::ShowContacts , qsl("show_contacts") },
|
||||||
|
|
||||||
{ Command::ReadChat , qsl("read_chat") },
|
{ Command::ReadChat , qsl("read_chat") },
|
||||||
|
|
||||||
|
{ Command::SaveDraft , qsl("save_draft") },
|
||||||
};
|
};
|
||||||
|
|
||||||
class Manager {
|
class Manager {
|
||||||
|
|
@ -388,6 +392,7 @@ void Manager::fillDefaults() {
|
||||||
set(qsl("ctrl+j"), Command::ShowContacts);
|
set(qsl("ctrl+j"), Command::ShowContacts);
|
||||||
|
|
||||||
set(qsl("ctrl+r"), Command::ReadChat);
|
set(qsl("ctrl+r"), Command::ReadChat);
|
||||||
|
set(qsl("ctrl+s"), Command::SaveDraft);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Manager::writeDefaultFile() {
|
void Manager::writeDefaultFile() {
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ enum class Command {
|
||||||
SupportScrollToCurrent,
|
SupportScrollToCurrent,
|
||||||
SupportHistoryBack,
|
SupportHistoryBack,
|
||||||
SupportHistoryForward,
|
SupportHistoryForward,
|
||||||
|
|
||||||
|
SaveDraft,
|
||||||
};
|
};
|
||||||
|
|
||||||
[[maybe_unused]] constexpr auto kShowFolder = {
|
[[maybe_unused]] constexpr auto kShowFolder = {
|
||||||
|
|
|
||||||
|
|
@ -1958,6 +1958,10 @@ void HistoryWidget::setupShortcuts() {
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
request->check(Command::SaveDraft, 1) && request->handle([=] {
|
||||||
|
saveCloudDraft();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue