1 /***************************************************************************
3 Copyright 2010 Reto Zingg <g.d0b3rm4n@gmail.com>
5 ***************************************************************************/
7 /***************************************************************************
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
14 ***************************************************************************/
17 #include "settingswidget.h"
19 #include <QVBoxLayout>
20 #include <QHBoxLayout>
23 #include <QPushButton>
26 SettingsWidget::SettingsWidget(QWidget *parent) :
30 QVBoxLayout *vbox = new QVBoxLayout();
32 QHBoxLayout *hbox_level = new QHBoxLayout();
33 QHBoxLayout *hbox_game = new QHBoxLayout();
34 QHBoxLayout *hbox_bottom = new QHBoxLayout();
36 m_ComboLevel = new QComboBox();
37 m_ComboLevel->addItem("Easy");
38 m_ComboLevel->addItem("Medium");
39 m_ComboLevel->addItem("Hard");
42 SIGNAL(currentIndexChanged(int)),
44 SIGNAL(levelChanged(int)));
46 m_ComboGame = new QComboBox();
49 SIGNAL(currentIndexChanged(int)),
51 SIGNAL(gameChanged(int)));
53 QLabel *label_level = new QLabel(tr("Level:"));
54 hbox_level->addWidget(label_level);
55 hbox_level->addWidget(m_ComboLevel);
57 QLabel *label_game = new QLabel(tr("Game:"));
58 hbox_game->addWidget(label_game);
59 hbox_game->addWidget(m_ComboGame);
61 QPushButton *m_button = new QPushButton();
62 m_button->setText(tr("Start"));
63 hbox_bottom->addWidget(m_button);
70 vbox->addLayout(hbox_level);
71 vbox->addLayout(hbox_game);
72 vbox->addLayout(hbox_bottom);
78 void SettingsWidget::setGameNames(QStringList gameNames){
79 m_ComboGame->addItems(gameNames);