mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
confirmation dialog when closing main window with open games
This commit is contained in:
parent
e7c4f75921
commit
7afb866961
4 changed files with 63 additions and 35 deletions
|
|
@ -207,8 +207,15 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
resize(900, 700);
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent */*event*/)
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (tabSupervisor->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) {
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
}
|
||||
event->accept();
|
||||
delete tabSupervisor;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue