QTfrontend/hwform.cpp
changeset 654 1019b8fa8638
parent 653 4f44fc06ca45
child 657 b34fc518a48a
--- a/QTfrontend/hwform.cpp	Thu Dec 13 21:31:47 2007 +0000
+++ b/QTfrontend/hwform.cpp	Thu Dec 13 21:49:52 2007 +0000
@@ -31,6 +31,7 @@
 #include <QLineEdit>
 #include <QLabel>
 #include <QRadioButton>
+#include <QSpinBox>
 
 #include "hwform.h"
 #include "game.h"
@@ -405,15 +406,22 @@
 		ui.pageNetGame->pNetTeamsWidget, SLOT(changeTeamColor(const HWTeam&)));
 
 	hwnet->Connect(hostName, port, nick);
-	config->SaveOptions();
 }
 
 void HWForm::NetConnect()
 {
 	HWHostPortDialog * hpd = new HWHostPortDialog(this);
+	hpd->leHost->setText(*netHost);
+	hpd->sbPort->setValue(netPort);
 
-	hpd->exec();
-// FIXME:  _NetConnect(ui.pageNet->editIP->text(), 46631, ui.pageNet->editNetNick->text());
+	if (hpd->exec() == QDialog::Accepted)
+	{
+		config->SaveOptions();
+		delete netHost;
+		netHost = new QString(hpd->leHost->text());
+		netPort = hpd->sbPort->value();
+		_NetConnect(*netHost, netPort, ui.pageOptions->editNetNick->text());
+	}
 }
 
 void HWForm::NetStartServer()