--- a/QTfrontend/CMakeLists.txt Wed Feb 07 22:35:41 2007 +0000
+++ b/QTfrontend/CMakeLists.txt Wed Feb 07 22:54:24 2007 +0000
@@ -44,7 +44,9 @@
proto.cpp
fpsedit.cpp
netserver.cpp
- newnetclient.cpp)
+ newnetclient.cpp
+ netudpserver.cpp
+ netudpwidget.cpp)
if (WIN32)
set(hwfr_src ${hwfr_src} res/hedgewars.rc)
@@ -74,7 +76,9 @@
proto.h
fpsedit.h
netserver.h
- newnetclient.h)
+ newnetclient.h
+ netudpserver.h
+ netudpwidget.h)
set(hwfr_rez
--- a/QTfrontend/hedgewars.pro Wed Feb 07 22:35:41 2007 +0000
+++ b/QTfrontend/hedgewars.pro Wed Feb 07 22:54:24 2007 +0000
@@ -35,7 +35,9 @@
proto.h \
fpsedit.h \
netserver.h \
- newnetclient.h
+ newnetclient.h \
+ netudpserver.h \
+ netudpwidget.h
SOURCES += game.cpp \
@@ -60,7 +62,9 @@
proto.cpp \
fpsedit.cpp \
netserver.cpp \
- newnetclient.cpp
+ newnetclient.cpp \
+ netudpserver.cpp \
+ netudpwidget.cpp
TRANSLATIONS += translations/hedgewars_ru.ts
--- a/QTfrontend/hwform.cpp Wed Feb 07 22:35:41 2007 +0000
+++ b/QTfrontend/hwform.cpp Wed Feb 07 22:54:24 2007 +0000
@@ -37,9 +37,10 @@
#include "hwconsts.h"
#include "newnetclient.h"
#include "gamecfgwidget.h"
+#include "netudpserver.h"
HWForm::HWForm(QWidget *parent)
- : QMainWindow(parent), pnetserver(0)
+ : QMainWindow(parent), pnetserver(0), pUdpServer(0)
{
ui.setupUi(this);
@@ -288,6 +289,7 @@
pnetserver = new HWNetServer;
pnetserver->StartServer();
_NetConnect(pnetserver->getRunningHostName(), pnetserver->getRunningPort(), ui.pageNet->editNetNick->text());
+ pUdpServer = new HWNetUdpServer();
}
void HWForm::NetDisconnect()
@@ -298,6 +300,7 @@
hwnet=0;
}
if(pnetserver) {
+ pUdpServer->deleteLater();
pnetserver->StopServer();
delete pnetserver;
pnetserver=0;
--- a/QTfrontend/hwform.h Wed Feb 07 22:35:41 2007 +0000
+++ b/QTfrontend/hwform.h Wed Feb 07 22:54:24 2007 +0000
@@ -32,6 +32,7 @@
class HWTeam;
class HWNewNet;
class GameUIConfig;
+class HWNetUdpServer;
class HWForm : public QMainWindow
{
@@ -95,6 +96,7 @@
GameUIConfig * config;
QStack<quint8> PagesStack;
HWNetServer* pnetserver;
+ HWNetUdpServer* pUdpServer;
void AddStatText(const QString & msg);
void OnPageShown(quint8 id);
};
--- a/QTfrontend/pages.cpp Wed Feb 07 22:35:41 2007 +0000
+++ b/QTfrontend/pages.cpp Wed Feb 07 22:54:24 2007 +0000
@@ -39,6 +39,7 @@
#include "mapContainer.h"
#include "about.h"
#include "fpsedit.h"
+#include "netudpwidget.h"
PageMain::PageMain(QWidget* parent) : QWidget(parent)
{
@@ -418,20 +419,23 @@
editIP->setMaxLength(50);
GBNlayout->addWidget(editIP, 1, 1);
+ HWNetUdpWidget* pUdpClient=new HWNetUdpWidget(this);
+ pageLayout->addWidget(pUdpClient, 2, 1);
+
BtnNetConnect = new QPushButton(this);
BtnNetConnect->setFont(*font14);
BtnNetConnect->setText(QPushButton::tr("Connect"));
- pageLayout->addWidget(BtnNetConnect, 2, 2);
+ pageLayout->addWidget(BtnNetConnect, 3, 2);
BtnNetSvrStart = new QPushButton(this);
BtnNetSvrStart->setFont(*font14);
BtnNetSvrStart->setText(QPushButton::tr("Start server"));
- pageLayout->addWidget(BtnNetSvrStart, 2, 1);
+ pageLayout->addWidget(BtnNetSvrStart, 3, 1);
BtnBack = new QPushButton(this);
BtnBack->setFont(*font14);
BtnBack->setText(QPushButton::tr("Back"));
- pageLayout->addWidget(BtnBack, 2, 0);
+ pageLayout->addWidget(BtnBack, 3, 0);
}
PageNetChat::PageNetChat(QWidget* parent) : QWidget(parent)