2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +00:00

Implemented ability to add more than 1 file to albums via SendFilesBox.

This commit is contained in:
23rd
2020-01-21 23:31:34 +03:00
committed by John Preston
parent a482b744d2
commit e266dc153b
5 changed files with 68 additions and 66 deletions

View File

@@ -488,26 +488,14 @@ void EditCaptionBox::updateEditMediaButton() {
void EditCaptionBox::createEditMediaButton() {
const auto callback = [=](FileDialog::OpenResult &&result) {
auto isValidFile = [](QString mimeType) {
if (Core::IsMimeSticker(mimeType)) {
Ui::show(
Box<InformBox>(tr::lng_edit_media_invalid_file(tr::now)),
Ui::LayerOption::KeepOther);
return false;
}
return true;
auto showBoxErrorCallback = [](tr::phrase<> t) {
Ui::show(Box<InformBox>(t(tr::now)), Ui::LayerOption::KeepOther);
};
auto list = Storage::PreparedList::PreparedFileFromFileDialog(
auto list = Storage::PreparedList::PreparedFileFromFilesDialog(
std::move(result),
_isAlbum,
[] {
Ui::show(
Box<InformBox>(tr::lng_edit_media_album_error(tr::now)),
Ui::LayerOption::KeepOther);
},
std::move(isValidFile),
std::move(showBoxErrorCallback),
st::sendMediaPreviewSize);
if (list) {