proper window title on message boxes
[colorflood] / colorflood / src / field.cpp
index c2c556c..7304540 100644 (file)
@@ -114,6 +114,17 @@ Field::FieldSize Field::getSize () const
     return size;
 }
 
+void Field::setSize (int size)
+{
+    Q_ASSERT(size >= 0 && size < NUM_SIZES);
+
+    if (this->size == size)
+        return;
+
+    this->size = (FieldSize)size;
+    randomize();
+}
+
 void Field::randomize ()
 {
     FieldRect rect;
@@ -189,12 +200,6 @@ void Field::floodNeighbours (quint8 brush, int x, int y)
         tryFloodRecurse(brush, x, y + 1);
 }
 
-void Field::mousePressEvent (QMouseEvent *event)
-{
-    if (event->button() == Qt::LeftButton)
-        randomize();
-}
-
 void Field::paintEvent (QPaintEvent *event)
 {
     QPainter painter;
@@ -277,6 +282,7 @@ void Field::flood (int colorIndex)
     if (finished)
     {
         QMessageBox box;
+        box.setWindowTitle("Color Flood");
         box.setText(msg);
         box.exec();
         randomize();