1 #include "settingsdialog.h"
5 #include <QRadioButton>
11 SettingsDialog::SettingsDialog(QWidget *parent) :
16 easyButton_ = new QRadioButton(tr("Easy"));
17 easyButton_->setChecked(true);
18 hardButton_ = new QRadioButton(tr("Hard"));
20 buttonLayout_ = new QHBoxLayout;
21 buttonLayout_->addWidget(easyButton_);
22 buttonLayout_->addWidget(hardButton_);
24 buttonGroup_ = new QGroupBox(tr("Difficulty"));
25 buttonGroup_->setLayout(buttonLayout_);
27 mainLayout_ = new QVBoxLayout;
28 mainLayout_->addWidget(buttonGroup_);
30 setLayout(mainLayout_);
32 connect(easyButton_, SIGNAL(toggled(bool)), this, SLOT(difficultySelectionChanged(bool)));
35 void SettingsDialog::difficultySelectionChanged(bool value)
38 Settings::instance()->setPieceCount(EASY_PIECE_COUNT);
41 Settings::instance()->setPieceCount(HARD_PIECE_COUNT);