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.
openmw-tes3coop/apps/browser/ServerInfoDialog.hpp

52 lines
1.1 KiB
C++

//
// Created by koncord on 07.01.17.
//
#ifndef NEWLAUNCHER_SERVERINFODIALOG_HPP
#define NEWLAUNCHER_SERVERINFODIALOG_HPP
#include "ui_ServerInfo.h"
#include <apps/browser/netutils/Utils.hpp>
#include <RakNetTypes.h>
#include <components/openmw-mp/Master/MasterData.hpp>
class ThrWorker;
class ServerInfoDialog : public QDialog, public Ui::Dialog
{
Q_OBJECT
public:
explicit ServerInfoDialog(const QString &addr, QWidget *parent = nullptr);
~ServerInfoDialog() override;
bool isUpdated();
void setData(std::pair<RakNet::SystemAddress, QueryData> &newSD);
public slots:
void refresh();
int exec() Q_DECL_OVERRIDE;
private:
QThread *refreshThread;
ThrWorker* worker;
std::pair<RakNet::SystemAddress, QueryData> sd;
};
class ThrWorker: public QObject
{
friend class ServerInfoDialog;
Q_OBJECT
public:
ThrWorker(ServerInfoDialog *dialog, QString addr, unsigned short port);
public slots:
void process();
signals:
void finished();
private:
QString addr;
unsigned short port;
bool stopped;
ServerInfoDialog *dialog;
};
#endif //NEWLAUNCHER_SERVERINFODIALOG_HPP