diff --git a/assignments/06/ThinkPink/mainwindow.cpp b/assignments/06/ThinkPink/mainwindow.cpp index f049974..eb09467 100644 --- a/assignments/06/ThinkPink/mainwindow.cpp +++ b/assignments/06/ThinkPink/mainwindow.cpp @@ -10,7 +10,12 @@ void MainWindow::buttonPressed(QPushButton *button) { } void MainWindow::newGame() { - initialiseGame(); + QMessageBox newGameDialog; + newGameDialog.setText("Do you really want to start a new game?"); + newGameDialog.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel); + if (newGameDialog.exec() == QMessageBox::Yes) { + initialiseGame(); + } } // initialisation functions diff --git a/assignments/06/ThinkPink/mainwindow.h b/assignments/06/ThinkPink/mainwindow.h index db9e488..10ab5b8 100644 --- a/assignments/06/ThinkPink/mainwindow.h +++ b/assignments/06/ThinkPink/mainwindow.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include