From: Serge Ziryukin Date: Tue, 13 Apr 2010 12:53:54 +0000 (+0300) Subject: repaint after flooding and randomize after game end X-Git-Url: http://git.maemo.org/git/?p=colorflood;a=commitdiff_plain;h=f8a96a90b395f18964f45226179c3af4b473ac9a repaint after flooding and randomize after game end --- diff --git a/colorflood/src/field.cpp b/colorflood/src/field.cpp index b6a9db4..c2c556c 100644 --- a/colorflood/src/field.cpp +++ b/colorflood/src/field.cpp @@ -243,7 +243,7 @@ void Field::flood (int colorIndex) } } - update(); + repaint(); bool allFlooded = true; @@ -259,22 +259,26 @@ void Field::flood (int colorIndex) } } + QString msg; + if (allFlooded) { finished = true; - - QMessageBox box; /*: win message */ - box.setText(tr("You won!")); - box.exec(); + msg = tr("You won!"); } else if (getNumTurnsOfSize(size) == turns) { finished = true; + /*: fail message */ + msg = tr("You lost!"); + } + if (finished) + { QMessageBox box; - /*: fail message */ - box.setText(tr("You lost!")); + box.setText(msg); box.exec(); + randomize(); } }