QTfrontend/hwform.cpp
changeset 1531 f404233b6d9b
parent 1530 3b8d723661b2
child 1566 6b63c75fdc68
--- a/QTfrontend/hwform.cpp	Fri Dec 05 16:49:04 2008 +0000
+++ b/QTfrontend/hwform.cpp	Fri Dec 05 16:55:20 2008 +0000
@@ -95,7 +95,6 @@
 	connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon()));
 	connect(ui.pageOptions->WeaponsButt, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon()));
 	connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsChanged()), this, SLOT(UpdateWeapons()));
-	connect(ui.pageNetGame->pGameCFG, SIGNAL(newWeaponsName(const QString&)), this, SLOT(NetWeaponNameChanged(const QString&)));
 
 	connect(ui.pageNet->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack()));
 	connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect()));
@@ -185,14 +184,6 @@
 	}
 }
 
-void HWForm::NetWeaponNameChanged(const QString& name)
-{
-	QString ammo = ui.pageSelectWeapon->pWeapons->getWeaponsString(name);
-
-	if (hwnet)
-		hwnet->onWeaponsNameChanged(name, ammo);
-}
-
 void HWForm::UpdateTeamsLists(const QStringList* editable_teams)
 {
 	QStringList teamslist;
@@ -502,6 +493,8 @@
 	connect(ui.pageNetGame->pGameCFG, SIGNAL(fortsModeChanged(bool)), hwnet, SLOT(onFortsModeChanged(bool)));
 	connect(ui.pageNetGame->pGameCFG, SIGNAL(teamsDivideChanged(bool)), hwnet, SLOT(onTeamsDivideChanged(bool)));
 	connect(ui.pageNetGame->pGameCFG, SIGNAL(solidChanged(bool)), hwnet, SLOT(onSolidChanged(bool)));
+	connect(ui.pageNetGame->pGameCFG, SIGNAL(newWeaponScheme(const QString &, const QString &)),
+			hwnet, SLOT(onWeaponsNameChanged(const QString &, const QString &)));
 
 	connect(hwnet, SIGNAL(Disconnected()), this, SLOT(ForcedDisconnect()));
 	connect(hwnet, SIGNAL(seedChanged(const QString &)), ui.pageNetGame->pGameCFG, SLOT(setSeed(const QString &)));
@@ -612,7 +605,10 @@
 
 void HWForm::StartMPGame()
 {
-	QString ammo = ui.pageSelectWeapon->pWeapons->getWeaponsString(ui.pageMultiplayer->gameCFG->WeaponsName->currentText());
+	QString ammo;
+	ammo = ui.pageMultiplayer->gameCFG->WeaponsName->itemData(
+		ui.pageMultiplayer->gameCFG->WeaponsName->currentIndex()
+		).toString();
 
 	CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect, ammo);