Initializing MainWindow.
More...
#include "mainwindow.h"
Initializing MainWindow.
Handle ButtonEvents and initialize ListenServer.
Definition at line 27 of file mainwindow.h.
Enumerator |
---|
Broadcast |
|
Multicast |
|
Unicast |
|
LockedUnicast |
|
None |
|
Definition at line 57 of file mainwindow.h.
MainWindow::MainWindow |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
MainWindow::~MainWindow |
( |
| ) |
|
|
override |
void MainWindow::changeEvent |
( |
QEvent * |
e | ) |
|
|
overrideprivate |
void MainWindow::clientCountChanged |
( |
| ) |
|
|
protectedslot |
this function determines if the number of clients in exam mode comprise more than 50%.
In that case the whole manager switches to exam mode, disabling many features in the toolbar
Definition at line 160 of file mainwindow.cpp.
void MainWindow::closeEvent |
( |
QCloseEvent * |
e | ) |
|
|
overrideprivate |
QPoint MainWindow::closestFreeSlot |
( |
const QPoint & |
preferredPixels, |
|
|
const ConnectionFrame * |
toIgnore |
|
) |
| |
|
private |
: find the closest available frame.
Closest: smallest Euclidean distance from center to center
'Algorithm': ideally, go in circles around the preferred point until you find a free spot. Lazy way: store all free positions in an array and find later there the closest (<- that's what I do)
- Parameters
-
preferred | in Pixels! |
toIgnore,ignore | this connectionframe when considering free slots |
- Returns
- the free slot
Definition at line 232 of file mainwindow.cpp.
ConnectionFrame * MainWindow::createFrame |
( |
const QString & |
computerId = QString() , |
|
|
const QPoint * |
gridPosition = nullptr , |
|
|
bool |
fromRoomplan = false |
|
) |
| |
|
private |
Create new Frame.
Create new frame and add to current available frame list. Also connect signals frameMoved() and clicked() with slots.
- Returns
- ConnectionFrame*
Definition at line 312 of file mainwindow.cpp.
void MainWindow::disableButtons |
( |
| ) |
|
|
protectedslot |
void MainWindow::enableButtons |
( |
| ) |
|
|
protectedslot |
Client * MainWindow::getClientFromId |
( |
int |
id | ) |
|
|
private |
Returns connected client which belongs to given id.
Iterating over ConnectionFrames and comparing id to given id.
- Parameters
-
- Returns
- Client with given id, if not nullptr.
Definition at line 354 of file mainwindow.cpp.
Return the Frame, which is currently selected by user.
Iterating over all ConnectionFrame and looking for flag _isSelected.
- Returns
- Frame with flag _isSelected = true, else nullptr if no frame is selected.
Definition at line 386 of file mainwindow.cpp.
int MainWindow::getTileHeightPx |
( |
| ) |
const |
|
private |
int MainWindow::getTileWidthPx |
( |
| ) |
const |
|
private |
Return the Frame, which is currently beeing Tutor.
Iterating over all ConnectionFrames, and looking for flag _isTutor.
- Returns
- Frame with flag _isTutor = true, else nullptr if no Tutor is available.
Definition at line 371 of file mainwindow.cpp.
void MainWindow::mouseReleaseEvent |
( |
QMouseEvent * |
e | ) |
|
|
overrideprivate |
Handle Mouse Release Event.
Check if click was inside the frame and if that is the case, set the selection of each connected client to false.
- Parameters
-
Definition at line 542 of file mainwindow.cpp.
void MainWindow::onButtonExit |
( |
| ) |
|
|
protectedslot |
void MainWindow::onButtonHelp |
( |
| ) |
|
|
protectedslot |
Display popup which explains possible actions about the buttons.
Definition at line 826 of file mainwindow.cpp.
void MainWindow::onButtonLock |
( |
bool |
checked | ) |
|
|
protectedslot |
Handle button to lock or unlock screens of client(s).
If already locked, do nothing, else lock or unlock the clients, except the tutor and the manager running machine.
- Parameters
-
Definition at line 1001 of file mainwindow.cpp.
void MainWindow::onButtonLockSingle |
( |
| ) |
|
|
protectedslot |
void MainWindow::onButtonReloadRoomConfig |
( |
| ) |
|
|
protectedslot |
void MainWindow::onButtonSetAsTutor |
( |
| ) |
|
|
protectedslot |
Handle button to set specific client as tutor.
Unset active tutor and set selected client, if not inactive, as new tutor.
Definition at line 1048 of file mainwindow.cpp.
void MainWindow::onButtonStopProjection |
( |
| ) |
|
|
protectedslot |
Handle Button StopProjection.
Set ProjectionSource of each client to false, stop the active VNC Server and the active VNC Client(s) and unlock all screens.
Definition at line 989 of file mainwindow.cpp.
void MainWindow::onButtonStudentToTutor |
( |
| ) |
|
|
protectedslot |
Handle projection from one student to tutor.
Definition at line 921 of file mainwindow.cpp.
void MainWindow::onButtonStudentToTutorExclusive |
( |
| ) |
|
|
protectedslot |
Handle projection from one student to tutor, lock everyone else.
Definition at line 930 of file mainwindow.cpp.
void MainWindow::onButtonTutorToAll |
( |
| ) |
|
|
protectedslot |
Handle projection from tutor to all.
Get the client who is tutor and set the projectionSource of all clients, except the tutor ones, to false.
Definition at line 836 of file mainwindow.cpp.
void MainWindow::onButtonTutorToStudent |
( |
| ) |
|
|
protectedslot |
Handle the projection from Tutor to specific student.
Set the client who is tutor as from and the selected client as to.
Definition at line 868 of file mainwindow.cpp.
void MainWindow::onClientAuthenticated |
( |
Client * |
client | ) |
|
|
protectedslot |
New client was authenticated, make several checks.
Check if new clients ip already exists, if yes –> not necessary to create new clientFrame. if not –> create a new one and adapt this one to current situation in class room(projection / lock screen). Check if avctiv tutor is available, if not –> check if new client is possible tutor.
- Parameters
-
Definition at line 1140 of file mainwindow.cpp.
Authenticate new Client client.
Check if incoming client ip already exists, if yes –> return. Check if same name of client already exist, if yes –> name new client as name(x). x = number of clients with the same name.
- Parameters
-
Definition at line 1093 of file mainwindow.cpp.
void MainWindow::onClientConnected |
( |
Client * |
client | ) |
|
|
protectedslot |
void MainWindow::onDeleteClient |
( |
| ) |
|
|
protectedslot |
Mark given frame after it was clicked on.
- Parameters
-
Definition at line 612 of file mainwindow.cpp.
Place frame to from user specified position.
Should be called when a connectionFrame is dropped during the "drag-n-drop".
Definition at line 601 of file mainwindow.cpp.
void MainWindow::onReloadRoomCancel |
( |
| ) |
|
|
protectedslot |
void MainWindow::onReloadRoomOk |
( |
| ) |
|
|
protectedslot |
void MainWindow::onSessionNameClick |
( |
| ) |
|
|
protectedslot |
Show session name, after it was clicked on.
Definition at line 632 of file mainwindow.cpp.
void MainWindow::onSessionNameUpdate |
( |
| ) |
|
|
protectedslot |
void MainWindow::onVncClientStateChange |
( |
Client * |
client | ) |
|
|
protectedslot |
Handle VNC client state change.
Check if any vnc client is in use, and if that is not the case, stop VNC Server.
- Parameters
-
client | |
lastProjectionSource | |
Definition at line 1222 of file mainwindow.cpp.
void MainWindow::onVncServerStateChange |
( |
Client * |
client | ) |
|
|
protectedslot |
Handle if VNC Server State has changed.
Check if VNC server has been started/stopped on some client and start VNC server/reset pending VNC projection information.
- Parameters
-
Definition at line 1172 of file mainwindow.cpp.
void MainWindow::placeFrameInFreeSlot |
( |
ConnectionFrame * |
frame, |
|
|
QPoint |
preferred = QPoint(-1, -1) |
|
) |
| |
|
private |
void MainWindow::reloadCurrentRoom |
( |
| ) |
|
|
private |
void MainWindow::reset |
( |
bool |
lock = false | ) |
|
|
private |
void MainWindow::resizeEvent |
( |
QResizeEvent * |
e | ) |
|
|
overrideprivate |
void MainWindow::startVncServerIfNecessary |
( |
int |
from | ) |
|
|
private |
void MainWindow::tellClientCurrentSituation |
( |
Client * |
client | ) |
|
|
private |
Tells the new client the current situation in class room.
Set the specific parameters like projection source or lock screen.
- Parameters
-
Definition at line 334 of file mainwindow.cpp.
void MainWindow::updateContextButtonStates |
( |
| ) |
|
|
private |
void MainWindow::vncOneOnOne |
( |
bool |
exclusive | ) |
|
|
private |
QImage* MainWindow::_backgroundImage = nullptr |
|
private |
QTimer* MainWindow::_buttonLockTimer |
|
private |
QLabel* MainWindow::_examModeLabel = nullptr |
|
private |
int MainWindow::_lastClientCount {} |
|
private |
QList<QAction*> MainWindow::_lockingButtons |
|
private |
int MainWindow::_streamingSource {} |
|
private |
const qint64 MainWindow::BUTTON_BLOCK_TIME = 2000 |
|
staticprivate |
Ui::MainWindow* MainWindow::ui |
|
private |
The documentation for this class was generated from the following files: