Fix some bugs
authorunc0rr
Sun, 09 Dec 2007 11:43:56 +0000
changeset 634 b9db5ff5cfdb
parent 633 9050a949db21
child 635 0fb6d55ecd66
Fix some bugs
QTfrontend/hwform.cpp
QTfrontend/hwform.h
QTfrontend/netudpwidget.cpp
QTfrontend/netudpwidget.h
QTfrontend/netwwwwidget.cpp
QTfrontend/netwwwwidget.h
--- a/QTfrontend/hwform.cpp	Sun Dec 09 11:25:59 2007 +0000
+++ b/QTfrontend/hwform.cpp	Sun Dec 09 11:43:56 2007 +0000
@@ -42,12 +42,14 @@
 #include "gamecfgwidget.h"
 #include "netserverslist.h"
 #include "netudpwidget.h"
+#include "netudpserver.h"
 #include "netwwwwidget.h"
+#include "netwwwserver.h"
 #include "chatwidget.h"
 #include "playrecordpage.h"
 
 HWForm::HWForm(QWidget *parent)
-  : QMainWindow(parent), pnetserver(0), pUdpServer(0), editedTeam(0)
+  : QMainWindow(parent), pnetserver(0), pRegisterServer(0), editedTeam(0)
 {
 	ui.setupUi(this);
 	config = new GameUIConfig(this, cfgdir->absolutePath() + "/hedgewars.ini");
@@ -400,7 +402,7 @@
   pnetserver = new HWNetServer;
   pnetserver->StartServer();
   _NetConnect("localhost", pnetserver->getRunningPort(), ui.pageNet->editNetNick->text());
-//  pUdpServer = new HWNetUdpServer();
+  pRegisterServer = new HWNetWwwServer(0, "hedgewars server", 46631);
 }
 
 void HWForm::NetDisconnect()
@@ -411,7 +413,7 @@
     hwnet=0;
   }
   if(pnetserver) {
-//    pUdpServer->deleteLater();
+    pRegisterServer->deleteLater();
     pnetserver->StopServer();
     delete pnetserver;
     pnetserver=0;
--- a/QTfrontend/hwform.h	Sun Dec 09 11:25:59 2007 +0000
+++ b/QTfrontend/hwform.h	Sun Dec 09 11:43:56 2007 +0000
@@ -31,7 +31,7 @@
 class HWTeam;
 class HWNewNet;
 class GameUIConfig;
-class HWNetUdpServer;
+class HWNetRegisterServer;
 
 class HWForm : public QMainWindow
 {
@@ -105,7 +105,7 @@
 	GameUIConfig * config;
 	QStack<quint8> PagesStack;
 	HWNetServer* pnetserver;
-	HWNetUdpServer* pUdpServer;
+	HWNetRegisterServer* pRegisterServer;
 	QTime eggTimer;
 	void AddStatText(const QString & msg);
 	void OnPageShown(quint8 id, quint8 lastid=0);
--- a/QTfrontend/netudpwidget.cpp	Sun Dec 09 11:25:59 2007 +0000
+++ b/QTfrontend/netudpwidget.cpp	Sun Dec 09 11:43:56 2007 +0000
@@ -22,11 +22,8 @@
 #include "netudpwidget.h"
 
 HWNetUdpWidget::HWNetUdpWidget(QWidget* parent) :
-  QWidget(parent), mainLayout(this)
+  HWNetServersWidget(parent)
 {
-  serversList = new QListWidget(this);
-  mainLayout.setMargin(0);
-  mainLayout.addWidget(serversList);
   pUdpSocket = new QUdpSocket(this);
 
   pUdpSocket->bind();
--- a/QTfrontend/netudpwidget.h	Sun Dec 09 11:25:59 2007 +0000
+++ b/QTfrontend/netudpwidget.h	Sun Dec 09 11:43:56 2007 +0000
@@ -22,18 +22,18 @@
 #include <QWidget>
 #include <QVBoxLayout>
 
+#include "netserverslist.h"
+
 class QUdpSocket;
 class QListWidget;
 
-class HWNetUdpWidget : public QWidget
+class HWNetUdpWidget : public HWNetServersWidget
 {
   Q_OBJECT
 
  public:
   HWNetUdpWidget(QWidget *parent = 0);
 
-  QListWidget* serversList;
-
  public slots:
   void updateList();
 
@@ -41,7 +41,6 @@
   void onClientRead();
 
  private:
-  QVBoxLayout mainLayout;
   QUdpSocket* pUdpSocket;
 };
 
--- a/QTfrontend/netwwwwidget.cpp	Sun Dec 09 11:25:59 2007 +0000
+++ b/QTfrontend/netwwwwidget.cpp	Sun Dec 09 11:43:56 2007 +0000
@@ -24,7 +24,7 @@
 #include "hwconsts.h"
 
 HWNetWwwWidget::HWNetWwwWidget(QWidget* parent) :
-  HWNetServersWidget(parent), mainLayout(this)
+  HWNetServersWidget(parent)
 {
 	http = new QHttp(this);
 	http->setHost("www.hedgewars.org", 80);
--- a/QTfrontend/netwwwwidget.h	Sun Dec 09 11:25:59 2007 +0000
+++ b/QTfrontend/netwwwwidget.h	Sun Dec 09 11:43:56 2007 +0000
@@ -38,7 +38,6 @@
 	void onClientRead(int id, bool error);
 
 private:
-	QVBoxLayout mainLayout;
 	QHttp * http;
 	
 };