QTfrontend/hwform.cpp
changeset 694 436045756181
parent 687 8e2dedaa01b4
child 695 34a93d123712
--- a/QTfrontend/hwform.cpp	Mon Jan 07 15:44:13 2008 +0000
+++ b/QTfrontend/hwform.cpp	Tue Jan 08 20:32:17 2008 +0000
@@ -84,7 +84,8 @@
 	connect(ui.pageOptions->BtnEditTeam,	SIGNAL(clicked()),	this, SLOT(EditTeam()));
 	connect(ui.pageOptions->BtnSaveOptions,	SIGNAL(clicked()),	config, SLOT(SaveOptions()));
 	connect(ui.pageOptions->BtnSaveOptions,	SIGNAL(clicked()),	this, SLOT(GoBack()));
-	connect(ui.pageOptions->WeaponsButt,	SIGNAL(clicked()),	this, SLOT(GoToSelectWeapon()));
+	connect(ui.pageOptions->WeaponEdit,	SIGNAL(clicked()),	this, SLOT(GoToSelectWeapon()));
+	connect(ui.pageOptions->WeaponsButt,	SIGNAL(clicked()),	this, SLOT(GoToSelectNewWeapon()));
 
 	connect(ui.pageNet->BtnBack,	SIGNAL(clicked()),	this, SLOT(GoBack()));
 	connect(ui.pageNet->BtnSpecifyServer,	SIGNAL(clicked()),	this, SLOT(NetConnect()));
@@ -135,6 +136,10 @@
 
 	ui.pageOptions->CBTeamName->clear();
 	ui.pageOptions->CBTeamName->addItems(teamslist);
+
+	// now updates weapons also
+	ui.pageOptions->WeaponsName->clear();
+	ui.pageOptions->WeaponsName->addItems(ui.pageSelectWeapon->pWeapons->getWeaponNames());
 }
 
 void HWForm::GoToMain()
@@ -162,8 +167,15 @@
 	GoToPage(ID_PAGE_SETUP);
 }
 
+void HWForm::GoToSelectNewWeapon()
+{
+	ui.pageSelectWeapon->pWeapons->setWeaponsName("");
+	GoToPage(ID_PAGE_SELECTWEAPON);
+}
+
 void HWForm::GoToSelectWeapon()
 {
+	ui.pageSelectWeapon->pWeapons->setWeaponsName(ui.pageOptions->WeaponsName->currentText());
 	GoToPage(ID_PAGE_SELECTWEAPON);
 }