Confirm screenshot upload

Adds a message box on upload asking if the user is sure they want to upload to imgur
This commit is contained in:
ryanbrown535 2022-10-02 20:45:06 -04:00
parent 518568b803
commit c37b7f771e

View File

@ -314,6 +314,20 @@ void ScreenshotsPage::on_actionUpload_triggered()
if (selection.isEmpty())
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;
auto job = NetJob::Ptr(new NetJob("Screenshot Upload", APPLICATION->network()));
if(selection.size() < 2)