You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
874 B
C++
37 lines
874 B
C++
8 years ago
|
//
|
||
|
// Created by koncord on 07.01.17.
|
||
|
//
|
||
|
|
||
|
#include "qdebug.h"
|
||
|
#include "NetController.hpp"
|
||
|
|
||
|
#include "ServerInfoDialog.hpp"
|
||
|
|
||
|
ServerInfoDialog::ServerInfoDialog(QWidget *parent): QDialog(parent)
|
||
|
{
|
||
|
setupUi(this);
|
||
|
connect(btnRefresh, SIGNAL(clicked()), this, SLOT(refresh()));
|
||
|
}
|
||
|
|
||
|
ServerInfoDialog::~ServerInfoDialog()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
void ServerInfoDialog::refresh()
|
||
|
{
|
||
|
NetController::get()->updateInfo();
|
||
|
ServerData *sd = NetController::get()->selectedServer();
|
||
|
leAddr->setText(sd->addr);
|
||
|
lblName->setText(sd->hostName);
|
||
|
lblPing->setNum(sd->ping);
|
||
|
|
||
|
listPlayers->clear();
|
||
|
QStringList players = NetController::get()->players();
|
||
|
listPlayers->addItems(players);
|
||
|
listPlugins->clear();
|
||
|
listPlugins->addItems(NetController::get()->plugins());
|
||
|
|
||
|
lblPlayers->setText(QString::number(players.size()) + " / " + QString::number(sd->maxPlayers));
|
||
|
}
|