[prev in list] [next in list] [prev in thread] [next in thread]
List: atlantik-devel
Subject: [atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp,1.104,1.105 selectconfiguration_widget.cpp
From: kde () office ! kde ! org
Date: 2002-07-16 1:47:39
[Download RAW message or body]
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv14575/client
Modified Files:
atlantik.cpp selectconfiguration_widget.cpp
selectconfiguration_widget.h
Log Message:
starting to support pre-game configs
Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- atlantik.cpp 2002/07/16 00:35:16 1.104
+++ atlantik.cpp 2002/07/16 01:47:36 1.105
@@ -290,7 +290,7 @@
connect(m_atlantikNetwork, SIGNAL(playerListEdit(QString, QString, QString)), \
m_selectConfiguration, SLOT(slotPlayerListEdit(QString, QString, QString))); \
connect(m_atlantikNetwork, SIGNAL(playerListDel(QString)), m_selectConfiguration, \
SLOT(slotPlayerListDel(QString))); connect(m_atlantikNetwork, \
SIGNAL(gameListClear()), this, SLOT(showSelectGame()));
-
+ connect(m_atlantikNetwork, SIGNAL(gameOption(QString, QString, QString)), \
m_selectConfiguration, SLOT(gameOption(QString, QString, QString))); \
connect(m_selectConfiguration, SIGNAL(startGame()), m_atlantikNetwork, \
SLOT(startGame())); connect(m_selectConfiguration, SIGNAL(leaveGame()), \
m_atlantikNetwork, SLOT(leaveGame())); }
Index: selectconfiguration_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- selectconfiguration_widget.cpp 2002/07/16 00:35:16 1.17
+++ selectconfiguration_widget.cpp 2002/07/16 01:47:36 1.18
@@ -16,6 +16,7 @@
#include <iostream>
+#include <qcheckbox.h>
#include <qradiobutton.h>
#include <kdebug.h>
@@ -33,11 +34,11 @@
Q_CHECK_PTR(m_mainLayout);
// Player list.
- m_playerGroupBox = new QVGroupBox(i18n("Player List"), this, "groupBox");
- m_mainLayout->addWidget(m_playerGroupBox);
+ m_playerBox = new QVGroupBox(i18n("Player List"), this, "playerBox");
+ m_mainLayout->addWidget(m_playerBox);
// List of players
- m_playerList = new KListView(m_playerGroupBox, "m_playerList");
+ m_playerList = new KListView(m_playerBox, "m_playerList");
m_playerList->addColumn(QString(i18n("Id")));
m_playerList->addColumn(QString(i18n("Name")));
m_playerList->addColumn(QString(i18n("Host")));
@@ -45,11 +46,9 @@
connect(m_playerList, SIGNAL(doubleClicked(QListViewItem *)), this, \
SLOT(connectPressed()));
-#if 0
// Game configuration.
- m_groupBox = new QVGroupBox(i18n("Game Configuration"), this, "groupBox");
- m_mainLayout->addWidget(m_groupBox);
-#endif
+ m_configBox = new QVGroupBox(i18n("Game Configuration"), this, "configBox");
+ m_mainLayout->addWidget(m_configBox);
QHBoxLayout *buttonBox = new QHBoxLayout(this, 0, KDialog::spacingHint());
m_mainLayout->addItem(buttonBox);
@@ -143,8 +142,8 @@
KPushButton *button = new KPushButton(i18n("Ok"), m_messageBox, "button");
- m_playerGroupBox->setEnabled(false);
- m_groupBox->setEnabled(false);
+ m_playerBox->setEnabled(false);
+ m_configBox->setEnabled(false);
m_connectButton->setEnabled(false);
status_label->setEnabled(false);
@@ -156,17 +155,32 @@
void SelectConfiguration::slotClicked()
{
delete m_messageBox;
- m_playerGroupBox->setEnabled(true);
- m_groupBox->setEnabled(true);
+ m_playerBox->setEnabled(true);
+ m_configBox->setEnabled(true);
m_connectButton->setEnabled(true);
status_label->setEnabled(true);
}
+void SelectConfiguration::gameOption(QString title, QString type, QString value)
+{
+ // Find if option exists in GUI yet
+ // Update
+
+ // Create option
+ if (type == "bool")
+ {
+ QCheckBox *checkBox = new QCheckBox(title, m_configBox, "checkbox");
+ checkBox->setChecked(value.toInt());
+ checkBox->show();
+ }
+ else
+ kdDebug() << "TODO: game options other than type=bool" << std::endl;
+
+ // TODO: Enable edit for master only
+}
+
/*
// some old code i might want to reuse
-
- // No i18n, this is not a permanent label anyway.
- status_label->setText("Configuration of the game is not yet supported by the monopd \
server.\nGames will be played using the standard rules.");
void ConfigureGame::slotPlayerlistEndUpdate(QString type)
{
Index: selectconfiguration_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- selectconfiguration_widget.h 2002/07/16 00:35:16 1.9
+++ selectconfiguration_widget.h 2002/07/16 01:47:36 1.10
@@ -43,9 +43,10 @@
void slotPlayerListEdit(QString playerId, QString name, QString host);
void slotPlayerListDel(QString playerId);
- private slots:
- void connectPressed();
- void slotClicked();
+private slots:
+ void connectPressed();
+ void slotClicked();
+ void gameOption(QString title, QString type, QString value);
signals:
void startGame();
@@ -57,7 +58,7 @@
private:
QVBoxLayout *m_mainLayout;
QLabel *status_label;
- QVGroupBox *m_playerGroupBox, *m_groupBox, *m_messageBox;
+ QVGroupBox *m_playerBox, *m_configBox, *m_messageBox;
KListView *m_playerList;
KPushButton *m_backButton, *m_connectButton;
};
_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@mail.kde.org
http://mail.kde.org/mailman/listinfo/atlantik-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic