Pool Video Switch v2
Software video switch for distributed remote display in a lecture environment
Public Types | Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ConnectWindow Class Reference

Class for handling the client connection. More...

#include "connectwindow.h"

+ Inheritance diagram for ConnectWindow:
+ Collaboration diagram for ConnectWindow:

Public Types

enum  ConnectionState {
  Idle, Scanning, Connecting, AwaitingChallenge,
  AwaitingChallengeResponse, LoggingIn, InvalidSslHash, InvalidCert,
  Connected
}
 

Public Slots

void DoConnect ()
 actually connects the connection More...
 
void DoDisconnect ()
 actually disconnects the connection More...
 
void doShow ()
 

Signals

void disconnect ()
 
void connected (ServerConnection *connection)
 

Public Member Functions

 ConnectWindow (QWidget *parent=nullptr)
 Initialize Connection Window. More...
 
 ~ConnectWindow () override
 ConnectWindow::~ConnectWindow. More...
 
void connectToSession (const QByteArray &sessionName, const QString &mgrIP)
 Public function connect to session. More...
 
void setAvailableRooms (const QList< Room > &m)
 set the available rooms. More...
 

Protected Slots

void onBtnConnection ()
 Handle click on Connect/Disconnect button. More...
 
void onBtnHide ()
 Handle click on Cancel/Hide Button. More...
 
void onRoomSelection (int index)
 check if "manual_connection" is selected, then switch to manual connection page More...
 
void onConnectionStateChange (ConnectWindow::ConnectionState state)
 Handle connection state changes and update member variables describing state. More...
 
void onConnectionClosed (QObject *connection)
 If connection is closed set _pendingConnection = nullptr. More...
 
void onConnectionDisconnected (ServerConnection *connection)
 ConnectWindow::onConnectionDisconnected. More...
 
void onServerDetected (const QString &host, quint16 port, const QByteArray &sessionName, const QByteArray &certHash, bool autoConnect)
 ConnectWindow::onServerDetected. More...
 

Protected Member Functions

void timerEvent (QTimerEvent *event) override
 Called when a Qt timer fires; used for server discovery and auto-hiding the connect dialog. More...
 
void closeEvent (QCloseEvent *e) override
 Handle incoming closeEvent and hide window. More...
 
void showEvent (QShowEvent *event) override
 Gives the keyboard input focus to the input line. More...
 

Private Member Functions

void updateUserInterface ()
 Handle changes in state and update window. More...
 

Private Attributes

Ui::ConnectWindow * _ui
 
int _hashSslErrorCount
 
ServerDiscovery _serverDiscovery
 
ServerConnection_pendingConnection
 
ConnectionState _state
 
QByteArray _currentSession
 
QString _currentIp
 
QString _defaultSessionName
 
NetworkMessage _packet
 
bool _tryReconnect {}
 
int _timerHide
 

Detailed Description

Class for handling the client connection.

Display toolbar with menu bar for connect or disconnect to pvs manager and show current connection status. For connecting with manager, user is able to set sessionName. If connection works correctly flashy green checkmark is shown.

Definition at line 41 of file connectwindow.h.

Member Enumeration Documentation

Enumerator
Idle 
Scanning 
Connecting 
AwaitingChallenge 
AwaitingChallengeResponse 
LoggingIn 
InvalidSslHash 
InvalidCert 
Connected 

Definition at line 46 of file connectwindow.h.

Constructor & Destructor Documentation

ConnectWindow::ConnectWindow ( QWidget parent = nullptr)
explicit

Initialize Connection Window.

Parameters
parent

Definition at line 29 of file connectwindow.cpp.

+ Here is the call graph for this function:

ConnectWindow::~ConnectWindow ( )
overridedefault

Member Function Documentation

void ConnectWindow::closeEvent ( QCloseEvent *  e)
overrideprotected

Handle incoming closeEvent and hide window.

Parameters
e

Definition at line 150 of file connectwindow.cpp.

void ConnectWindow::connected ( ServerConnection connection)
signal

+ Here is the caller graph for this function:

void ConnectWindow::connectToSession ( const QByteArray &  sessionName,
const QString &  mgrIP 
)

Public function connect to session.

Check if currently connected to server, if not –> connect to given sessionName.

Parameters
sessionName

Definition at line 184 of file connectwindow.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ConnectWindow::disconnect ( )
signal

+ Here is the caller graph for this function:

void ConnectWindow::DoConnect ( )
slot

actually connects the connection

Definition at line 202 of file connectwindow.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ConnectWindow::DoDisconnect ( )
slot

actually disconnects the connection

Definition at line 220 of file connectwindow.cpp.

+ Here is the caller graph for this function:

void ConnectWindow::doShow ( )
slot

Definition at line 156 of file connectwindow.cpp.

+ Here is the caller graph for this function:

void ConnectWindow::onBtnConnection ( )
protectedslot

Handle click on Connect/Disconnect button.

If already connected –> Stop/disconnect. Else scanning for given sessionId.

Definition at line 235 of file connectwindow.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ConnectWindow::onBtnHide ( )
protectedslot

Handle click on Cancel/Hide Button.

Just hide the window.

Definition at line 270 of file connectwindow.cpp.

+ Here is the caller graph for this function:

void ConnectWindow::onConnectionClosed ( QObject connection)
protectedslot

If connection is closed set _pendingConnection = nullptr.

Parameters
connection

Definition at line 337 of file connectwindow.cpp.

+ Here is the caller graph for this function:

void ConnectWindow::onConnectionDisconnected ( ServerConnection connection)
protectedslot

ConnectWindow::onConnectionDisconnected.

Definition at line 345 of file connectwindow.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ConnectWindow::onConnectionStateChange ( ConnectWindow::ConnectionState  state)
protectedslot

Handle connection state changes and update member variables describing state.

Parameters
state

Definition at line 311 of file connectwindow.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ConnectWindow::onRoomSelection ( int  index)
protectedslot

check if "manual_connection" is selected, then switch to manual connection page

Definition at line 277 of file connectwindow.cpp.

+ Here is the caller graph for this function:

void ConnectWindow::onServerDetected ( const QString &  host,
quint16  port,
const QByteArray &  sessionName,
const QByteArray &  certHash,
bool  autoConnect 
)
protectedslot

ConnectWindow::onServerDetected.

Parameters
host
port
sessionName
certHash

Definition at line 298 of file connectwindow.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ConnectWindow::setAvailableRooms ( const QList< Room > &  m)

set the available rooms.

If the list of rooms is empty, switches automatically to the "manual connection" page

Definition at line 257 of file connectwindow.cpp.

void ConnectWindow::showEvent ( QShowEvent *  event)
overrideprotected

Gives the keyboard input focus to the input line.

Parameters
event

Definition at line 171 of file connectwindow.cpp.

void ConnectWindow::timerEvent ( QTimerEvent *  event)
overrideprotected

Called when a Qt timer fires; used for server discovery and auto-hiding the connect dialog.

Definition at line 134 of file connectwindow.cpp.

void ConnectWindow::updateUserInterface ( )
private

Handle changes in state and update window.

Also changing TextLabel which shows the user what the program is doing.

Definition at line 75 of file connectwindow.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

QString ConnectWindow::_currentIp
private

Definition at line 71 of file connectwindow.h.

QByteArray ConnectWindow::_currentSession
private

Definition at line 70 of file connectwindow.h.

QString ConnectWindow::_defaultSessionName
private

Definition at line 72 of file connectwindow.h.

int ConnectWindow::_hashSslErrorCount
private

Definition at line 66 of file connectwindow.h.

NetworkMessage ConnectWindow::_packet
private

Definition at line 73 of file connectwindow.h.

ServerConnection* ConnectWindow::_pendingConnection
private

Definition at line 68 of file connectwindow.h.

ServerDiscovery ConnectWindow::_serverDiscovery
private

Definition at line 67 of file connectwindow.h.

ConnectionState ConnectWindow::_state
private

Definition at line 69 of file connectwindow.h.

int ConnectWindow::_timerHide
private

Definition at line 75 of file connectwindow.h.

bool ConnectWindow::_tryReconnect {}
private

Definition at line 74 of file connectwindow.h.

Ui::ConnectWindow* ConnectWindow::_ui
private

Definition at line 65 of file connectwindow.h.


The documentation for this class was generated from the following files: