Merge pull request #4928 from ryanbrown535/develop

GH-4901 Confirm screenshot upload
This commit is contained in:
Petr Mrázek 2022-11-19 23:48:46 +01:00 committed by GitHub
commit 90b16fb903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,6 +314,20 @@ void ScreenshotsPage::on_actionUpload_triggered()
if (selection.isEmpty()) if (selection.isEmpty())
return; return;
auto uploadText = tr("Upload screenshot to imgur.com?");
if (selection.size() > 1)
uploadText = tr("Upload %1 screenshots to imgur.com?").arg(selection.size());
auto response = CustomMessageBox::selectable(
this,
tr("Upload?"),
uploadText,
QMessageBox::Question,
QMessageBox::Yes | QMessageBox::No
)->exec();
if (response == QMessageBox::No)
return;
QList<ScreenShot::Ptr> uploaded; QList<ScreenShot::Ptr> uploaded;
auto job = NetJob::Ptr(new NetJob("Screenshot Upload", APPLICATION->network())); auto job = NetJob::Ptr(new NetJob("Screenshot Upload", APPLICATION->network()));
if(selection.size() < 2) if(selection.size() < 2)