// // Created by koncord on 07.01.17. // #ifndef NEWLAUNCHER_SERVERINFODIALOG_HPP #define NEWLAUNCHER_SERVERINFODIALOG_HPP #include "ui_ServerInfo.h" #include #include #include 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 &newSD); public slots: void refresh(); int exec() Q_DECL_OVERRIDE; private: QThread *refreshThread; ThrWorker* worker; std::pair 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