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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user