2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Add new phrases for reminders.

This commit is contained in:
John Preston
2019-08-28 19:46:47 +03:00
parent 0a4f91a53d
commit 87addd41b1
15 changed files with 113 additions and 36 deletions

View File

@@ -409,6 +409,13 @@ void ShareBox::keyPressEvent(QKeyEvent *e) {
}
}
SendMenuType ShareBox::sendMenuType() const {
const auto selected = _inner->selected();
return (selected.size() == 1 && selected.front()->isSelf())
? SendMenuType::Reminder
: SendMenuType::Scheduled;
}
void ShareBox::createButtons() {
clearButtons();
if (_hasSelected) {
@@ -417,7 +424,7 @@ void ShareBox::createButtons() {
});
SetupSendMenu(
send,
[=] { return true; },
[=] { return sendMenuType(); },
[=] { submitSilent(); },
[=] { submitScheduled(); });
} else if (_copyCallback) {
@@ -471,7 +478,7 @@ void ShareBox::submitSilent() {
void ShareBox::submitScheduled() {
const auto callback = [=](Api::SendOptions options) { submit(options); };
Ui::show(
HistoryView::PrepareScheduleBox(this, callback),
HistoryView::PrepareScheduleBox(this, sendMenuType(), callback),
LayerOption::KeepOther);
}