QTfrontend/pages.cpp
changeset 632 5e09ae25729f
parent 617 127510b442ca
child 636 dc93ac775bb9
equal deleted inserted replaced
631:f7df3889f2ff 632:5e09ae25729f
    37 #include "gamecfgwidget.h"
    37 #include "gamecfgwidget.h"
    38 #include "SquareLabel.h"
    38 #include "SquareLabel.h"
    39 #include "mapContainer.h"
    39 #include "mapContainer.h"
    40 #include "about.h"
    40 #include "about.h"
    41 #include "fpsedit.h"
    41 #include "fpsedit.h"
       
    42 #include "netserverslist.h"
    42 #include "netudpwidget.h"
    43 #include "netudpwidget.h"
       
    44 #include "netwwwwidget.h"
    43 #include "chatwidget.h"
    45 #include "chatwidget.h"
    44 #include "SDLs.h"
    46 #include "SDLs.h"
    45 #include "playrecordpage.h"
    47 #include "playrecordpage.h"
    46 #include "selectWeapon.h"
    48 #include "selectWeapon.h"
    47 
    49 
   430 	editNetNick	= new QLineEdit(NNGroupBox);
   432 	editNetNick	= new QLineEdit(NNGroupBox);
   431 	editNetNick->setMaxLength(20);
   433 	editNetNick->setMaxLength(20);
   432 	editNetNick->setText(QLineEdit::tr("unnamed"));
   434 	editNetNick->setText(QLineEdit::tr("unnamed"));
   433 	GBNlayout->addWidget(editNetNick, 0, 1);
   435 	GBNlayout->addWidget(editNetNick, 0, 1);
   434 
   436 
   435 	QGroupBox * ConnGroupBox = new QGroupBox(this);
   437 	ConnGroupBox = new QGroupBox(this);
   436 	ConnGroupBox->setTitle(QGroupBox::tr("Net game"));
   438 	ConnGroupBox->setTitle(QGroupBox::tr("Net game"));
   437 	pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3);
   439 	pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3);
   438 	QGridLayout * GBClayout = new QGridLayout(ConnGroupBox);
   440 	GBClayout = new QGridLayout(ConnGroupBox);
   439 	GBClayout->setColumnStretch(0, 0);
   441 	GBClayout->setColumnStretch(0, 0);
   440 	GBClayout->setColumnStretch(1, 1);
   442 	GBClayout->setColumnStretch(1, 1);
   441 	GBClayout->setColumnStretch(2, 1);
   443 	GBClayout->setColumnStretch(2, 1);
   442 	GBClayout->setRowStretch(0, 0);
   444 	GBClayout->setRowStretch(0, 0);
   443 	GBClayout->setRowStretch(1, 0);
   445 	GBClayout->setRowStretch(1, 0);
   449 
   451 
   450 	editIP = new QLineEdit(ConnGroupBox);
   452 	editIP = new QLineEdit(ConnGroupBox);
   451 	editIP->setMaxLength(50);
   453 	editIP->setMaxLength(50);
   452 	GBClayout->addWidget(editIP, 0, 1);
   454 	GBClayout->addWidget(editIP, 0, 1);
   453 
   455 
   454 	BtnNetConnect = new	QPushButton(ConnGroupBox);
   456 	BtnNetConnect = new QPushButton(ConnGroupBox);
   455 	BtnNetConnect->setFont(*font14);
   457 	BtnNetConnect->setFont(*font14);
   456 	BtnNetConnect->setText(QPushButton::tr("Connect"));
   458 	BtnNetConnect->setText(QPushButton::tr("Connect"));
   457 	GBClayout->addWidget(BtnNetConnect, 0, 2);
   459 	GBClayout->addWidget(BtnNetConnect, 0, 2);
   458 
   460 
   459 	pUdpClient=new HWNetUdpWidget(ConnGroupBox);
   461 	netServersWidget = 0;
   460 	GBClayout->addWidget(pUdpClient, 1, 0, 2, 2);
   462 
   461 
   463 	BtnUpdateSList = new QPushButton(ConnGroupBox);
   462 	pUpdateUdpButt = new QPushButton(ConnGroupBox);
   464 	BtnUpdateSList->setFont(*font14);
   463 	pUpdateUdpButt->setFont(*font14);
   465 	BtnUpdateSList->setText(QPushButton::tr("Update"));
   464 	pUpdateUdpButt->setText(QPushButton::tr("Update"));
   466 	GBClayout->addWidget(BtnUpdateSList, 1, 2);
   465 	GBClayout->addWidget(pUpdateUdpButt, 1, 2);
       
   466 
   467 
   467 	BtnBack = new QPushButton(this);
   468 	BtnBack = new QPushButton(this);
   468 	BtnBack->setFont(*font14);
   469 	BtnBack->setFont(*font14);
   469 	BtnBack->setText(QPushButton::tr("Back"));
   470 	BtnBack->setText(QPushButton::tr("Back"));
   470 	pageLayout->addWidget(BtnBack, 3, 0);
   471 	pageLayout->addWidget(BtnBack, 3, 0);
       
   472 }
       
   473 
       
   474 void PageNet::changeServersList()
       
   475 {
       
   476 	if (netServersWidget) delete netServersWidget;
       
   477 
       
   478 	netServersWidget = new HWNetWwwWidget(ConnGroupBox);
       
   479 	GBClayout->addWidget(netServersWidget, 1, 0, 2, 2);
       
   480 
       
   481 	connect(BtnUpdateSList, SIGNAL(clicked()), netServersWidget, SLOT(updateList()));
       
   482 	netServersWidget->updateList();
   471 }
   483 }
   472 
   484 
   473 PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent)
   485 PageNetGame::PageNetGame(QWidget* parent) : QWidget(parent)
   474 {
   486 {
   475 	QFont * font14 = new QFont("MS Shell Dlg", 14);
   487 	QFont * font14 = new QFont("MS Shell Dlg", 14);