disable widgets if we are slave network client
authordisplacer
Thu, 18 Jan 2007 19:59:04 +0000
changeset 349 5b37d6a39829
parent 348 c91b983de18f
child 350 c3ccec3834e8
disable widgets if we are slave network client
QTfrontend/gamecfgwidget.cpp
QTfrontend/gamecfgwidget.h
QTfrontend/netserver.cpp
QTfrontend/newnetclient.cpp
--- a/QTfrontend/gamecfgwidget.cpp	Wed Jan 17 21:32:52 2007 +0000
+++ b/QTfrontend/gamecfgwidget.cpp	Thu Jan 18 19:59:04 2007 +0000
@@ -24,7 +24,7 @@
 #include <QLabel>
 #include "gamecfgwidget.h"
 
-GameCFGWidget::GameCFGWidget(QWidget* parent) :
+GameCFGWidget::GameCFGWidget(QWidget* parent, bool externalControl) :
   QWidget(parent), mainLayout(this)
 {
 	mainLayout.setMargin(0);
@@ -71,7 +71,7 @@
 	connect(SB_InitHealth, SIGNAL(valueChanged(int)), this, SLOT(onInitHealthChanged(int)));
 	connect(SB_TurnTime, SIGNAL(valueChanged(int)), this, SLOT(onTurnTimeChanged(int)));
 	connect(CB_mode_Forts, SIGNAL(toggled(bool)), this, SLOT(onFortsModeChanged(bool)));
-
+	  
 	connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(onSeedChanged(const QString &)));
 	connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(onThemeChanged(const QString &)));
 	connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(onMapChanged(const QString &)));
--- a/QTfrontend/gamecfgwidget.h	Wed Jan 17 21:32:52 2007 +0000
+++ b/QTfrontend/gamecfgwidget.h	Thu Jan 18 19:59:04 2007 +0000
@@ -34,7 +34,7 @@
 	Q_OBJECT
 
 public:
-	GameCFGWidget(QWidget* parent);
+	GameCFGWidget(QWidget* parent, bool externalControl=false);
 	quint32 getGameFlags() const;
 	QString getCurrentSeed() const;
 	QString getCurrentMap() const;
--- a/QTfrontend/netserver.cpp	Wed Jan 17 21:32:52 2007 +0000
+++ b/QTfrontend/netserver.cpp	Thu Jan 18 19:59:04 2007 +0000
@@ -205,6 +205,7 @@
     RawSendNet(QString("CONNECTED"));
     if(m_hwserver->isChiefClient(this)) RawSendNet(QString("CONFIGASKED"));
     else {
+      RawSendNet(QString("SLAVE"));
       // send config
       QMap<QString, QString> conf=m_hwserver->getGameCfg();
       for(QMap<QString, QString>::iterator it=conf.begin(); it!=conf.end(); ++it) {
--- a/QTfrontend/newnetclient.cpp	Wed Jan 17 21:32:52 2007 +0000
+++ b/QTfrontend/newnetclient.cpp	Thu Jan 18 19:59:04 2007 +0000
@@ -173,6 +173,10 @@
     return;
   }
 
+  if(lst[0]=="SLAVE") {
+    m_pGameCFGWidget->setEnabled(false);
+  }
+
   if (lst[0] == "CONFIGASKED") {
     isChief=true;
     ConfigAsked();