[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.106,1.107 main.h,1.19,1.20 selectconfigu
From: kde () office ! kde ! org
Date: 2002-07-21 20:10:17
[Download RAW message or body]
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv25279/client
Modified Files:
atlantik.cpp main.h selectconfiguration_widget.cpp
selectconfiguration_widget.h
Log Message:
auctions can be disabled
Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- atlantik.cpp 2002/07/17 22:39:21 1.106
+++ atlantik.cpp 2002/07/21 20:10:14 1.107
@@ -277,9 +277,10 @@
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_atlantikNetwork, SIGNAL(gameOption(QString, QString, QString, QString, \
QString)), m_selectConfiguration, SLOT(gameOption(QString, QString, QString, QString, \
QString))); connect(m_selectConfiguration, SIGNAL(startGame()), m_atlantikNetwork, \
SLOT(startGame())); connect(m_selectConfiguration, SIGNAL(leaveGame()), \
m_atlantikNetwork, SLOT(leaveGame())); + connect(m_selectConfiguration, \
SIGNAL(buttonCommand(QString)), m_atlantikNetwork, SLOT(writeData(QString))); }
void Atlantik::slotNetworkConnected()
Index: main.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/main.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- main.h 2002/07/16 00:36:00 1.19
+++ main.h 2002/07/21 20:10:14 1.20
@@ -18,7 +18,7 @@
#define ATLANTIK_MAIN_H
#define ATLANTIK_VERSION 040
-#define ATLANTIK_VERSION_STRING "0.4.0 (CVS >= 20020716)"
+#define ATLANTIK_VERSION_STRING "0.4.0 (CVS >= 20020720)"
#define ATLANTIK_VERSION_MAJOR 0
#define ATLANTIK_VERSION_MINOR 4
#define ATLANTIK_VERSION_RELEASE 0
Index: selectconfiguration_widget.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- selectconfiguration_widget.cpp 2002/07/17 07:42:22 1.20
+++ selectconfiguration_widget.cpp 2002/07/21 20:10:14 1.21
@@ -161,18 +161,27 @@
status_label->setEnabled(true);
}
-void SelectConfiguration::gameOption(QString title, QString type, QString value)
+void SelectConfiguration::gameOption(QString title, QString type, QString value, \
QString edit, QString command) {
// Find if option exists in GUI yet
- // Update
+ if (QCheckBox *checkBox = dynamic_cast<QCheckBox *>(m_checkBoxMap[command]))
+ {
+ checkBox->setChecked(value.toInt());
+ checkBox->setEnabled(edit.toInt());
+ return;
+ }
// Create option
if (type == "bool")
{
QCheckBox *checkBox = new QCheckBox(title, m_configBox, "checkbox");
+ m_optionCommandMap[(QObject *)checkBox] = command;
+ m_checkBoxMap[command] = checkBox;
checkBox->setChecked(value.toInt());
- checkBox->setEnabled(false); // monopd doesn'tsupport editing yet
+ checkBox->setEnabled(edit.toInt());
checkBox->show();
+
+ connect(checkBox, SIGNAL(clicked()), this, SLOT(optionChanged()));
}
else
kdDebug() << "TODO: game options other than type=bool" << endl;
@@ -199,3 +208,14 @@
return false;
}
*/
+
+void SelectConfiguration::optionChanged()
+{
+ QString command = m_optionCommandMap[(QObject *)QObject::sender()];
+
+ if (QCheckBox *checkBox = m_checkBoxMap[command])
+ {
+ command.append(QString::number(checkBox->isChecked()));
+ emit buttonCommand(command);
+ }
+}
Index: selectconfiguration_widget.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/selectconfiguration_widget.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- selectconfiguration_widget.h 2002/07/16 01:47:36 1.10
+++ selectconfiguration_widget.h 2002/07/21 20:10:15 1.11
@@ -25,6 +25,8 @@
#include <klistview.h>
#include <kpushbutton.h>
+class QCheckBox;
+
class SelectConfiguration : public QWidget
{
Q_OBJECT
@@ -46,21 +48,24 @@
private slots:
void connectPressed();
void slotClicked();
- void gameOption(QString title, QString type, QString value);
-
+ void gameOption(QString title, QString type, QString value, QString edit, QString \
command); + void optionChanged();
signals:
void startGame();
void leaveGame();
void joinConfiguration(int configurationId);
void newConfiguration();
+ void buttonCommand(QString);
// void statusChanged();
- private:
- QVBoxLayout *m_mainLayout;
- QLabel *status_label;
- QVGroupBox *m_playerBox, *m_configBox, *m_messageBox;
- KListView *m_playerList;
- KPushButton *m_backButton, *m_connectButton;
+private:
+ QVBoxLayout *m_mainLayout;
+ QLabel *status_label;
+ QVGroupBox *m_playerBox, *m_configBox, *m_messageBox;
+ KListView *m_playerList;
+ KPushButton *m_backButton, *m_connectButton;
+ QMap <QObject *, QString> m_optionCommandMap;
+ QMap <QString, QCheckBox *> m_checkBoxMap;
};
#endif
_______________________________________________
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