2 Copyright (C) 2002-2005, Jason Katz-Brown <jasonkb@mit.edu>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #include <kpagedialog.h>
23 #include <klineedit.h>
24 #include <kcolorbutton.h>
25 #include <kpushbutton.h>
39 class PlayerEditor
: public QWidget
44 explicit PlayerEditor(QString name
= QString(), QColor
= Qt::red
, QWidget
*parent
= 0);
45 QColor
color() { return colorButton
->color(); }
46 QString
name() { return editor
->text(); }
47 void setColor(QColor col
) { colorButton
->setColor(col
); }
48 void setName(const QString
&newname
) { editor
->setText(newname
); }
51 void deleteEditor(PlayerEditor
*editor
);
58 KColorButton
*colorButton
;
62 class NewGameDialog
: public KPageDialog
67 NewGameDialog(bool enableCourses
);
69 QList
<PlayerEditor
*> *players() { return &editors
; }
70 bool competition() { return mode
->isChecked(); }
71 QString
course() { return currentCourse
; }
74 void deleteEditor(PlayerEditor
*);
80 void courseSelected(int);
83 void selectionChanged();
84 void showHighscores();
87 QWidget
*playersWidget
;
88 KPushButton
*addButton
;
90 QScrollArea
*scroller
;
93 QList
<QColor
> startColors
;
94 QList
<PlayerEditor
*> editors
;
101 QStringList externCourses
;
102 QMap
<QString
, CourseInfo
> info
;
104 QStringList extraCourses
;
106 K3ListBox
*courseList
;
112 QString currentCourse
;
114 void enableButtons();