summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/mainwindow/mainwindow.h')
-rw-r--r--src/server/mainwindow/mainwindow.h53
1 files changed, 23 insertions, 30 deletions
diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h
index 86499af..d4967f8 100644
--- a/src/server/mainwindow/mainwindow.h
+++ b/src/server/mainwindow/mainwindow.h
@@ -1,9 +1,7 @@
-#ifndef _MAINWINDOW_H_
-#define _MAINWINDOW_H_
+#ifndef PVS_MAINWINDOW_H_
+#define PVS_MAINWINDOW_H_
-#include <QtWidgets>
#include <QMainWindow>
-#include "../net/client.h"
class SessionNameWindow;
class ConnectionFrame;
@@ -11,6 +9,11 @@ class ListenServer;
class DiscoveryListener;
class HelpWindow;
class ReloadRoomWindow;
+class ClientLogin;
+class Client;
+class ClickLabel;
+
+class QLabel;
namespace Ui
{
@@ -27,8 +30,8 @@ class MainWindow : public QMainWindow
public:
- MainWindow(QWidget *parent = 0);
- ~MainWindow();
+ explicit MainWindow(QWidget *parent = nullptr);
+ ~MainWindow() override;
QRect calcFrameGeometry(ConnectionFrame* frame) const;
@@ -38,24 +41,17 @@ private:
Ui::MainWindow *ui;
SessionNameWindow *_sessionNameWindow;
HelpWindow *_helpWindow;
- ReloadRoomWindow *_reloadWindow;
- QLabel *_sessionNameLabel;
- int _tbIconSize;
- Qt::ToolBarArea _tbArea;
+ ReloadRoomWindow *_reloadWindow;
+ ClickLabel *_sessionNameLabel;
int _tilesX;
int _tilesY;
QImage* _backgroundImage = nullptr;
QLabel* _examModeLabel = nullptr;
-
- /* virtual columns to preserve the aspect ratio of the loaded room */
- int _virtCols;
- int _virtRows;
-
// Button block stuff
QTimer *_buttonLockTimer;
QList<QAction*> _lockingButtons;
- static const qint64 BUTTON_BLOCK_TIME = 2000;
+ static const qint64 BUTTON_BLOCK_TIME = 2000;
// Management stuff
enum class Mode
@@ -66,19 +62,16 @@ private:
LockedUnicast,
None
} _mode;
- int _streamingSource;
+ int _streamingSource{};
QList<ConnectionFrame*> _clientFrames;
QWidget *_dropMarker;
- ListenServer *_listenServer;
- DiscoveryListener *_discoveryListener;
- int _lastClientCount;
+ int _lastClientCount{};
- QPoint closestFreeSlot(const QPoint preferredPixels, const ConnectionFrame* toIgnore);
+ QPoint closestFreeSlot(const QPoint &preferredPixels, const ConnectionFrame* toIgnore);
void placeFrameInFreeSlot(ConnectionFrame* frame, QPoint preferred = QPoint(-1, -1));
ConnectionFrame* createFrame(const QString &computerId = QString(), const QPoint *gridPosition = nullptr, bool fromRoomplan = false);
- void savePosition(ConnectionFrame *cf);
void startVncServerIfNecessary(int from);
void tellClientCurrentSituation(Client* client);
void reset(bool lock = false);
@@ -86,19 +79,19 @@ private:
ConnectionFrame* getTutorFrame();
ConnectionFrame* getSelectedFrame();
- void closeEvent(QCloseEvent *e);
- void changeEvent(QEvent *e);
- void resizeEvent(QResizeEvent *e);
- void mouseReleaseEvent(QMouseEvent* e);
+ void closeEvent(QCloseEvent *e) override;
+ void changeEvent(QEvent *e) override;
+ void resizeEvent(QResizeEvent *e) override;
+ void mouseReleaseEvent(QMouseEvent* e) override;
int getTileWidthPx() const;
int getTileHeightPx() const;
- void updateContextButtonStates();
+ void updateContextButtonStates();
void reloadCurrentRoom();
- void vncOneOnOne(bool exclusive);
+ void vncOneOnOne(bool exclusive);
protected slots:
void disableButtons();
@@ -126,8 +119,8 @@ protected slots:
void onButtonExit();
void onButtonHelp();
// connection frame
- void onFrameMoving(ConnectionFrame* frame);
- void onFrameDropped(ConnectionFrame* frame);
+ void onFrameMoving(ConnectionFrame* frame);
+ void onFrameDropped(ConnectionFrame* frame);
void onFrameClicked(ConnectionFrame* frame);
// Net
void onClientConnected(Client* client);