X-Git-Url: http://git.maemo.org/git/?p=colorflood;a=blobdiff_plain;f=colorflood%2Fsrc%2Fwindow.cpp;h=2825369ea21cb358e89b6c031ab7e5afee7e57da;hp=49084406b62609891af814888a53eef7a950443e;hb=2d27bd2bcce5e9fa03349f7096d3aa4055628f9a;hpb=c67d5554ce76c3337e7b1b6d55297b0109abd0c7 diff --git a/colorflood/src/window.cpp b/colorflood/src/window.cpp index 4908440..2825369 100644 --- a/colorflood/src/window.cpp +++ b/colorflood/src/window.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "window.hpp" #include "colorbuttons.hpp" #include "field.hpp" @@ -51,13 +52,20 @@ Window::Window () QPushButton *newGame = new QPushButton(tr("New game"), this); QObject::connect(newGame, SIGNAL(pressed()), field, SLOT(randomize())); + QPushButton *help = new QPushButton(tr("Help"), this); + QObject::connect(help, SIGNAL(pressed()), this, SLOT(help())); + + QHBoxLayout *lowerLayout = new QHBoxLayout; + lowerLayout->addWidget(help); + lowerLayout->addWidget(newGame); + QVBoxLayout *vl = new QVBoxLayout; vl->addWidget(colorButtons); vl->setAlignment(colorButtons, Qt::AlignRight | Qt::AlignTop); vl->addWidget(turnsLabel); vl->setAlignment(turnsLabel, Qt::AlignRight | Qt::AlignBottom); - vl->addWidget(newGame); - vl->setAlignment(newGame, Qt::AlignRight | Qt::AlignTop); + vl->addLayout(lowerLayout); + vl->setAlignment(lowerLayout, Qt::AlignRight | Qt::AlignTop); QHBoxLayout *hl = new QHBoxLayout; hl->addWidget(field); @@ -151,3 +159,11 @@ void Window::colorScheme () action->setText(ColorScheme::getSchemeName( ColorScheme::getNextColorScheme())); } + +void Window::help () +{ + QMessageBox box; + box.setWindowTitle("Color Flood"); + box.setText(tr("The object of the game is to turn a board into one single color. Number of moves is limited. You start from top-left corner with one cell already flooded.\nGood luck!")); + box.exec(); +}