mirror of
git://git.savannah.nongnu.org/eliot.git
synced 2025-01-18 10:26:15 +01:00
Warn on game creation before showing the new game dialog, not after
This commit is contained in:
parent
4b4b715a41
commit
6c16f203a5
1 changed files with 6 additions and 9 deletions
|
@ -727,12 +727,6 @@ void MainWindow::onGameNew()
|
|||
return;
|
||||
}
|
||||
|
||||
NewGame *newGameDialog = new NewGame(this);
|
||||
|
||||
int res = newGameDialog->exec();
|
||||
if (res == QDialog::Rejected)
|
||||
return;
|
||||
|
||||
if (m_game)
|
||||
{
|
||||
QString msg = _q("Starting a new game will stop the current one.");
|
||||
|
@ -743,16 +737,19 @@ void MainWindow::onGameNew()
|
|||
}
|
||||
}
|
||||
|
||||
NewGame newGameDialog;
|
||||
int res = newGameDialog.exec();
|
||||
if (res == QDialog::Rejected)
|
||||
return;
|
||||
|
||||
// Destroy the game and the associated controls
|
||||
destroyCurrentGame();
|
||||
|
||||
// Create a new game
|
||||
m_game = newGameDialog->createGame(*m_dic);
|
||||
m_game = newGameDialog.createGame(*m_dic);
|
||||
if (m_game == NULL)
|
||||
return;
|
||||
|
||||
delete newGameDialog;
|
||||
|
||||
m_ui.groupBoxPlayers->show();
|
||||
|
||||
displayInfoMsg(_q("Game started"));
|
||||
|
|
Loading…
Reference in a new issue