summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/ScreenshotDialog.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-24 10:34:51 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-24 10:34:51 +0100
commita8811a27f78698f1ab2acad47e90f3b16274e221 (patch)
tree4986fed4712433484597e4a63a022ee5c989c337 /gui/dialogs/ScreenshotDialog.cpp
parent226c1bdae5ec615381965b6731f6496dffa3299e (diff)
downloadMultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.gz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.lz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.tar.xz
MultiMC-a8811a27f78698f1ab2acad47e90f3b16274e221.zip
Working screenshot upload
Diffstat (limited to 'gui/dialogs/ScreenshotDialog.cpp')
-rw-r--r--gui/dialogs/ScreenshotDialog.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/gui/dialogs/ScreenshotDialog.cpp b/gui/dialogs/ScreenshotDialog.cpp
index 02764fa3..33e93162 100644
--- a/gui/dialogs/ScreenshotDialog.cpp
+++ b/gui/dialogs/ScreenshotDialog.cpp
@@ -39,7 +39,7 @@ QList<ScreenShot*> ScreenshotDialog::selected() const
return list;
}
-void ScreenshotDialog::on_buttonBox_accepted()
+void ScreenshotDialog::on_uploadBtn_clicked()
{
QList<ScreenShot *> screenshots = selected();
if (screenshots.isEmpty())
@@ -50,17 +50,18 @@ void ScreenshotDialog::on_buttonBox_accepted()
NetJob *job = new NetJob("Screenshot Upload");
for (ScreenShot *shot : screenshots)
{
- qDebug() << shot->file;
job->addNetAction(ScreenShotUpload::make(shot));
}
+ m_uploaded = screenshots;
ProgressDialog prog(this);
- prog.exec(job);
- connect(job, &NetJob::failed, [this]
+ if (prog.exec(job) == QDialog::Accepted)
+ {
+ accept();
+ }
+ else
{
CustomMessageBox::selectable(this, tr("Failed to upload screenshots!"),
tr("Unknown error"), QMessageBox::Warning)->exec();
reject();
- });
- m_uploaded = screenshots;
- connect(job, &NetJob::succeeded, this, &ScreenshotDialog::accept);
+ }
}