summaryrefslogtreecommitdiffstats
path: root/src/client/connectwindow/connectwindow.h
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-06-02 15:27:23 +0200
committerBjörn Hagemeister2014-06-02 15:27:23 +0200
commit4778d18cc1287e9a3fd2c3a7eec5f90e685c3f62 (patch)
treec798ea39460f49f6f6e34f7f909470923bf68e5f /src/client/connectwindow/connectwindow.h
parentPut Check if manager is running on machine into method. (diff)
parentUncheck lock if any action is performed. (diff)
downloadpvs2-4778d18cc1287e9a3fd2c3a7eec5f90e685c3f62.tar.gz
pvs2-4778d18cc1287e9a3fd2c3a7eec5f90e685c3f62.tar.xz
pvs2-4778d18cc1287e9a3fd2c3a7eec5f90e685c3f62.zip
Merge branch 'master' of git.openslx.org:pvs2
Conflicts: src/server/mainwindow/mainwindow.h
Diffstat (limited to 'src/client/connectwindow/connectwindow.h')
-rw-r--r--src/client/connectwindow/connectwindow.h53
1 files changed, 19 insertions, 34 deletions
diff --git a/src/client/connectwindow/connectwindow.h b/src/client/connectwindow/connectwindow.h
index 9319e45..df112fe 100644
--- a/src/client/connectwindow/connectwindow.h
+++ b/src/client/connectwindow/connectwindow.h
@@ -20,6 +20,7 @@
#include <QUdpSocket>
#include <QSslSocket>
#include "../../shared/networkmessage.h"
+#include "../net/serverdiscovery.h"
namespace Ui{
class ConnectWindow;
@@ -38,54 +39,37 @@ class ConnectWindow : public QWidget
Q_OBJECT
public:
- enum ConnectionState
- {
+ enum ConnectionState {
Idle,
Scanning,
Connecting,
AwaitingChallenge,
AwaitingChallengeResponse,
LoggingIn,
- InvalidIpList,
- InvalidHash, // Hash of UDP reply invalid
InvalidSslHash, // Hash of challenge inside SSL connection invalid
InvalidCert,
Connected
};
-private:
- Ui::ConnectWindow *_ui;
-
- bool _connected;
- int _timerDiscover, _timerHide;
- ServerConnection *_connection;
- ConnectionState _state;
- int _hashErrorCount, _hashSslErrorCount, _certErrorCount, _ipErrorCount;
- int _discoveryInterval;
-
- QByteArray _sessionNameBytes;
- QByteArray _salt2;
- QUdpSocket _discoverySocket;
- NetworkMessage _packet;
-
- void setState(const ConnectionState state);
- void updateState();
-
-public:
explicit ConnectWindow(QWidget *parent = NULL);
virtual ~ConnectWindow();
- void setConnected(const bool connected);
void connectToSession(const QByteArray sessionName);
+private:
+ Ui::ConnectWindow *_ui;
+ ServerConnection *_connection;
+ int _hashSslErrorCount;
+ ServerDiscovery _serverDiscovery;
+ ConnectionState _state;
+ QByteArray _sessionNameBytes;
+ NetworkMessage _packet;
+ bool _connected, _tryReconnect;
+ int _timerHide;
+
+ void updateState();
+
protected:
- /*
- void enterEvent(QEvent *e);
- void leaveEvent(QEvent *e);
- void mousePressEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- */
void timerEvent(QTimerEvent* event);
void closeEvent(QCloseEvent *e);
void showEvent(QShowEvent* event);
@@ -93,15 +77,16 @@ protected:
protected slots:
void onBtnConnection();
void onBtnHide();
- void onUdpReadyRead();
+
void onConnectionStateChange(ConnectWindow::ConnectionState state);
void onConnectionClosed(QObject* connection);
- //void onSsl
+ void onConnectionDisconnected();
+ // void onUdpReadyRead();
+ void onServerDetected(const QString& host, const quint16 port, const QByteArray& sessionName, const QByteArray& certHash);
signals:
void disconnect();
void connected(ServerConnection* connection);
-
};
#endif