GH-1339 do not destroy console window while screenshot upload is active

This commit is contained in:
Petr Mrázek 2015-12-03 23:00:51 +01:00
parent b5902b739e
commit a5b8f22eab
3 changed files with 8 additions and 1 deletions

View File

@ -219,7 +219,7 @@ void ConsoleWindow::onSucceeded()
{ {
m_killButton->setEnabled(false); m_killButton->setEnabled(false);
setMayClose(true); setMayClose(true);
if (m_proc->instance()->settings()->get("AutoCloseConsole").toBool()) if (m_proc->instance()->settings()->get("AutoCloseConsole").toBool() && m_container->requestClose(nullptr))
{ {
this->close(); this->close();
return; return;

View File

@ -300,6 +300,7 @@ void ScreenshotsPage::on_uploadBtn_clicked()
albumTask->addNetAction(imgurAlbum); albumTask->addNetAction(imgurAlbum);
task.addTask(job.unwrap()); task.addTask(job.unwrap());
task.addTask(albumTask.unwrap()); task.addTask(albumTask.unwrap());
m_uploadActive = true;
ProgressDialog prog(this); ProgressDialog prog(this);
if (prog.execWithTask(&task) != QDialog::Accepted) if (prog.execWithTask(&task) != QDialog::Accepted)
{ {
@ -320,6 +321,7 @@ void ScreenshotsPage::on_uploadBtn_clicked()
.arg(link, imgurAlbum->deleteHash()), .arg(link, imgurAlbum->deleteHash()),
QMessageBox::Information)->exec(); QMessageBox::Information)->exec();
} }
m_uploadActive = false;
} }
void ScreenshotsPage::on_deleteBtn_clicked() void ScreenshotsPage::on_deleteBtn_clicked()

View File

@ -63,6 +63,10 @@ public:
{ {
return "Screenshots-management"; return "Screenshots-management";
} }
virtual bool apply() override
{
return !m_uploadActive;
}
private slots: private slots:
void on_uploadBtn_clicked(); void on_uploadBtn_clicked();
void on_deleteBtn_clicked(); void on_deleteBtn_clicked();
@ -76,4 +80,5 @@ private:
std::shared_ptr<QIdentityProxyModel> m_filterModel; std::shared_ptr<QIdentityProxyModel> m_filterModel;
QString m_folder; QString m_folder;
bool m_valid = false; bool m_valid = false;
bool m_uploadActive = false;
}; };