Merge pull request #1267 from Cockatrice/revert-1261-fix_982

Revert "Confirmation dialog on close"
This commit is contained in:
ctrlaltca 2015-07-16 12:30:37 +02:00
commit 61b2b46b79
2 changed files with 8 additions and 11 deletions

View file

@ -136,20 +136,17 @@ void TabSupervisor::retranslateUi()
bool TabSupervisor::closeRequest()
{
if (getGameCount())
{
if (QMessageBox::question(this, tr("Are you sure?"), tr("There are still open games. Are you sure you want to quit?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
if (getGameCount()) {
if (QMessageBox::question(this, tr("Are you sure?"), tr("There are still open games. Are you sure you want to quit?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) {
return false;
}
else
{
if (QMessageBox::question(this, tr("Close Cockatrice"), tr("Are you sure you want to close Cockatrice?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)
return false;
}
foreach(TabDeckEditor *tab, deckEditorTabs)
if (!tab->confirmClose())
{
if(!tab->confirmClose())
return false;
}
return true;
}

View file

@ -632,7 +632,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
{
// workaround Qt bug where closeEvent gets called twice
static bool bClosingDown=false;
if (bClosingDown)
if(bClosingDown)
return;
bClosingDown=true;