summaryrefslogtreecommitdiffstats
path: root/atlantik/client/selectconfiguration_widget.h
blob: a0cfcd240397bc92dcf5e30924a6bc3623c06eb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright (c) 2002-2004 Rob Kaper <[email protected]>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 2 as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; see the file COPYING.  If not, write to
// the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301, USA.

#ifndef ATLANTIK_SELECTCONFIGURATION_WIDGET_H
#define ATLANTIK_SELECTCONFIGURATION_WIDGET_H

#include <tqwidget.h>
#include <tqlayout.h>
#include <tqvgroupbox.h>

#include <klistview.h>
#include <kpushbutton.h>

class TQCheckBox;
class TQListViewItem;

class AtlanticCore;
class ConfigOption;
class Game;
class Player;

class SelectConfiguration : public QWidget
{
Q_OBJECT

public:
	SelectConfiguration(AtlanticCore *atlanticCore, TQWidget *parent, const char *name=0);

	void setCanStart(const bool &canStart);
	TQString hostToConnect() const;
	int portToConnect();

private slots:
	void addConfigOption(ConfigOption *configOption);
	void changeOption();
	void gameOption(TQString title, TQString type, TQString value, TQString edit, TQString command);
	void optionChanged(ConfigOption *configOption);
	void optionChanged();
	void slotEndUpdate();
	void initGame();
	void playerChanged(Player *player);
	void gameChanged(Game *game);

signals:
	void startGame();
	void leaveGame();
	void joinConfiguration(int configurationId);
	void newConfiguration();
	void changeOption(int configId, const TQString &value);
	void buttonCommand(TQString);
	void iconSelected(const TQString &);
	void statusMessage(const TQString &message);

private:
	TQVBoxLayout *m_mainLayout;
	TQVGroupBox *m_configBox, *m_messageBox;
	KPushButton *m_backButton, *m_startButton;
	TQMap <TQObject *, TQString> m_optionCommandMap;
	TQMap <TQObject *, ConfigOption *> m_configMap;
	TQMap <ConfigOption *, TQCheckBox *> m_configBoxMap;
	TQMap <TQString, TQCheckBox *> m_checkBoxMap;
	TQMap <Player *, TQListViewItem *> m_items;
	Game *m_game;
	AtlanticCore *m_atlanticCore;
};

#endif