25 |
25 |
26 #include "pagenet.h" |
26 #include "pagenet.h" |
27 #include "hwconsts.h" |
27 #include "hwconsts.h" |
28 #include "netudpwidget.h" |
28 #include "netudpwidget.h" |
29 |
29 |
30 PageNet::PageNet(QWidget* parent) : AbstractPage(parent) |
30 QLayout * PageNet::bodyLayoutDefinition() |
31 { |
31 { |
32 QFont * font14 = new QFont("MS Shell Dlg", 14); |
32 QGridLayout * pageLayout = new QGridLayout(); |
33 QGridLayout * pageLayout = new QGridLayout(this); |
33 |
34 pageLayout->setColumnStretch(0, 1); |
34 pageLayout->setColumnStretch(0, 1); |
35 pageLayout->setColumnStretch(1, 1); |
35 pageLayout->setColumnStretch(1, 1); |
36 pageLayout->setColumnStretch(2, 1); |
36 pageLayout->setColumnStretch(2, 1); |
37 |
37 |
38 BtnNetSvrStart = new QPushButton(this); |
38 BtnNetSvrStart = new QPushButton(this); |
39 BtnNetSvrStart->setFont(*font14); |
39 BtnNetSvrStart->setFont(*font14); |
40 BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
40 BtnNetSvrStart->setText(QPushButton::tr("Start server")); |
41 BtnNetSvrStart->setVisible(haveServer); |
41 BtnNetSvrStart->setVisible(haveServer); |
42 pageLayout->addWidget(BtnNetSvrStart, 4, 2); |
42 pageLayout->addWidget(BtnNetSvrStart, 4, 2); |
43 |
|
44 |
|
45 BtnBack = addButton(":/res/Exit.png", pageLayout, 4, 0, true); |
|
46 connect(BtnBack, SIGNAL(clicked()), this, SIGNAL(goBack())); |
|
47 |
|
48 |
43 |
49 ConnGroupBox = new QGroupBox(this); |
44 ConnGroupBox = new QGroupBox(this); |
50 ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
45 ConnGroupBox->setTitle(QGroupBox::tr("Net game")); |
51 pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
46 pageLayout->addWidget(ConnGroupBox, 2, 0, 1, 3); |
52 GBClayout = new QGridLayout(ConnGroupBox); |
47 GBClayout = new QGridLayout(ConnGroupBox); |
71 BtnSpecifyServer = new QPushButton(ConnGroupBox); |
66 BtnSpecifyServer = new QPushButton(ConnGroupBox); |
72 BtnSpecifyServer->setFont(*font14); |
67 BtnSpecifyServer->setFont(*font14); |
73 BtnSpecifyServer->setText(QPushButton::tr("Specify")); |
68 BtnSpecifyServer->setText(QPushButton::tr("Specify")); |
74 GBClayout->addWidget(BtnSpecifyServer, 2, 1); |
69 GBClayout->addWidget(BtnSpecifyServer, 2, 1); |
75 |
70 |
|
71 return pageLayout; |
|
72 } |
|
73 |
|
74 void PageNet::connectSignals() |
|
75 { |
76 connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect())); |
76 connect(BtnNetConnect, SIGNAL(clicked()), this, SLOT(slotConnect())); |
|
77 } |
|
78 |
|
79 PageNet::PageNet(QWidget* parent) : AbstractPage(parent) |
|
80 { |
|
81 initPage(); |
77 } |
82 } |
78 |
83 |
79 void PageNet::updateServersList() |
84 void PageNet::updateServersList() |
80 { |
85 { |
81 tvServersList->setModel(new HWNetUdpModel(tvServersList)); |
86 tvServersList->setModel(new HWNetUdpModel(tvServersList)); |