QTfrontend/hwform.cpp
changeset 2345 daf1785f2337
parent 2261 57e99c908e7c
child 2368 e0750b23c9e6
--- a/QTfrontend/hwform.cpp	Wed Sep 02 08:53:46 2009 +0000
+++ b/QTfrontend/hwform.cpp	Wed Sep 02 09:04:06 2009 +0000
@@ -577,13 +577,17 @@
 		hwnet, SLOT(CreateRoom(const QString&)));
 	connect(ui.pageRoomsList, SIGNAL(askForJoinRoom(const QString &)),
 		hwnet, SLOT(JoinRoom(const QString&)));
-	connect(ui.pageRoomsList, SIGNAL(askForCreateRoom(const QString &)),
-		this, SLOT(NetGameMaster()));
-	connect(ui.pageRoomsList, SIGNAL(askForJoinRoom(const QString &)),
-		this, SLOT(NetGameSlave()));
+//	connect(ui.pageRoomsList, SIGNAL(askForCreateRoom(const QString &)),
+//		this, SLOT(NetGameMaster()));
+//	connect(ui.pageRoomsList, SIGNAL(askForJoinRoom(const QString &)),
+//		this, SLOT(NetGameSlave()));
 	connect(ui.pageRoomsList, SIGNAL(askForRoomList()),
 		hwnet, SLOT(askRoomsList()));
 
+// room status stuff
+	connect(hwnet, SIGNAL(roomMaster(bool)),
+		this, SLOT(NetGameChangeStatus(bool)));
+
 // net page stuff
 	connect(hwnet, SIGNAL(chatStringFromNet(const QString&)),
 		ui.pageNetGame->pChatWidget, SLOT(onChatString(const QString&)));
@@ -881,12 +885,22 @@
 		sdli.StopMusic();
 }
 
+void HWForm::NetGameChangeStatus(bool isMaster)
+{
+	if (isMaster)
+		NetGameMaster();
+	else
+		NetGameSlave();
+}
+
 void HWForm::NetGameMaster()
 {
 	ui.pageNetGame->setMasterMode(true);
 	ui.pageNetGame->restrictJoins->setChecked(false);
 	ui.pageNetGame->restrictTeamAdds->setChecked(false);
 	ui.pageNetGame->pGameCFG->GameSchemes->setModel(ammoSchemeModel);
+	ui.pageNetGame->pGameCFG->setEnabled(true);
+	ui.pageNetGame->pNetTeamsWidget->setInteractivity(true);
 	
 	if (hwnet)
 	{
@@ -907,6 +921,9 @@
 
 void HWForm::NetGameSlave()
 {
+	ui.pageNetGame->pGameCFG->setEnabled(false);
+	ui.pageNetGame->pNetTeamsWidget->setInteractivity(false);
+	
 	if (hwnet)
 	{
 		NetAmmoSchemeModel * netAmmo = new NetAmmoSchemeModel(hwnet);