summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-12-03 23:00:51 +0100
committerPetr Mrázek <peterix@gmail.com>2015-12-03 23:00:51 +0100
commita5b8f22eab508b606bed26923b020c8de02bfcff (patch)
tree9492aadf6459a4396bf863a0869fea0993d31a00 /application
parentb5902b739ebd5291898a2fbbacea4327f46433bf (diff)
downloadMultiMC-a5b8f22eab508b606bed26923b020c8de02bfcff.tar
MultiMC-a5b8f22eab508b606bed26923b020c8de02bfcff.tar.gz
MultiMC-a5b8f22eab508b606bed26923b020c8de02bfcff.tar.lz
MultiMC-a5b8f22eab508b606bed26923b020c8de02bfcff.tar.xz
MultiMC-a5b8f22eab508b606bed26923b020c8de02bfcff.zip
GH-1339 do not destroy console window while screenshot upload is active
Diffstat (limited to 'application')
-rw-r--r--application/ConsoleWindow.cpp2
-rw-r--r--application/pages/ScreenshotsPage.cpp2
-rw-r--r--application/pages/ScreenshotsPage.h5
3 files changed, 8 insertions, 1 deletions
diff --git a/application/ConsoleWindow.cpp b/application/ConsoleWindow.cpp
index 239f538e..a843536b 100644
--- a/application/ConsoleWindow.cpp
+++ b/application/ConsoleWindow.cpp
@@ -219,7 +219,7 @@ void ConsoleWindow::onSucceeded()
{
m_killButton->setEnabled(false);
setMayClose(true);
- if (m_proc->instance()->settings()->get("AutoCloseConsole").toBool())
+ if (m_proc->instance()->settings()->get("AutoCloseConsole").toBool() && m_container->requestClose(nullptr))
{
this->close();
return;
diff --git a/application/pages/ScreenshotsPage.cpp b/application/pages/ScreenshotsPage.cpp
index 5f5d11f7..2b2fe31f 100644
--- a/application/pages/ScreenshotsPage.cpp
+++ b/application/pages/ScreenshotsPage.cpp
@@ -300,6 +300,7 @@ void ScreenshotsPage::on_uploadBtn_clicked()
albumTask->addNetAction(imgurAlbum);
task.addTask(job.unwrap());
task.addTask(albumTask.unwrap());
+ m_uploadActive = true;
ProgressDialog prog(this);
if (prog.execWithTask(&task) != QDialog::Accepted)
{
@@ -320,6 +321,7 @@ void ScreenshotsPage::on_uploadBtn_clicked()
.arg(link, imgurAlbum->deleteHash()),
QMessageBox::Information)->exec();
}
+ m_uploadActive = false;
}
void ScreenshotsPage::on_deleteBtn_clicked()
diff --git a/application/pages/ScreenshotsPage.h b/application/pages/ScreenshotsPage.h
index f19ff35f..f4bbf913 100644
--- a/application/pages/ScreenshotsPage.h
+++ b/application/pages/ScreenshotsPage.h
@@ -63,6 +63,10 @@ public:
{
return "Screenshots-management";
}
+ virtual bool apply() override
+ {
+ return !m_uploadActive;
+ }
private slots:
void on_uploadBtn_clicked();
void on_deleteBtn_clicked();
@@ -76,4 +80,5 @@ private:
std::shared_ptr<QIdentityProxyModel> m_filterModel;
QString m_folder;
bool m_valid = false;
+ bool m_uploadActive = false;
};