QTfrontend/pages.cpp
changeset 673 bd82104a28af
parent 672 08ed55ea1e2a
child 675 28e294a496cb
equal deleted inserted replaced
672:08ed55ea1e2a 673:bd82104a28af
    29 #include <QSpinBox>
    29 #include <QSpinBox>
    30 #include <QTextEdit>
    30 #include <QTextEdit>
    31 #include <QRadioButton>
    31 #include <QRadioButton>
    32 #include <QTableView>
    32 #include <QTableView>
    33 #include <QMessageBox>
    33 #include <QMessageBox>
       
    34 #include <QHeaderView>
    34 
    35 
    35 #include "pages.h"
    36 #include "pages.h"
    36 #include "sdlkeys.h"
    37 #include "sdlkeys.h"
    37 #include "hwconsts.h"
    38 #include "hwconsts.h"
    38 #include "gamecfgwidget.h"
    39 #include "gamecfgwidget.h"
    78 	pageLayout->addWidget(BtnNet, 2, 1);
    79 	pageLayout->addWidget(BtnNet, 2, 1);
    79 
    80 
    80 	BtnLoad = new QPushButton(this);
    81 	BtnLoad = new QPushButton(this);
    81 	BtnLoad->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    82 	BtnLoad->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    82 	BtnLoad->setFont(*font14);
    83 	BtnLoad->setFont(*font14);
    83 	BtnLoad->setText(QPushButton::tr("Load"));
    84 	BtnLoad->setText(QPushButton::tr("Saved games"));
    84 	pageLayout->addWidget(BtnLoad, 3, 1);
    85 	pageLayout->addWidget(BtnLoad, 3, 1);
    85 
    86 
    86 	BtnDemos = new QPushButton(this);
    87 	BtnDemos = new QPushButton(this);
    87 	BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    88 	BtnDemos->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    88 	BtnDemos->setFont(*font14);
    89 	BtnDemos->setFont(*font14);
   491 	if (rbLocalGame->isChecked())
   492 	if (rbLocalGame->isChecked())
   492 		tvServersList->setModel(new HWNetUdpModel(tvServersList));
   493 		tvServersList->setModel(new HWNetUdpModel(tvServersList));
   493 	else
   494 	else
   494 		tvServersList->setModel(new HWNetWwwModel(tvServersList));
   495 		tvServersList->setModel(new HWNetWwwModel(tvServersList));
   495 
   496 
       
   497 	tvServersList->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
       
   498 
   496 	static_cast<HWNetServersModel *>(tvServersList->model())->updateList();
   499 	static_cast<HWNetServersModel *>(tvServersList->model())->updateList();
   497 
   500 
   498 	connect(BtnUpdateSList, SIGNAL(clicked()), static_cast<HWNetServersModel *>(tvServersList->model()), SLOT(updateList()));
   501 	connect(BtnUpdateSList, SIGNAL(clicked()), static_cast<HWNetServersModel *>(tvServersList->model()), SLOT(updateList()));
   499 	connect(tvServersList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotConnect()));
   502 	connect(tvServersList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(slotConnect()));
   500 }
   503 }