diff options
author | Manuel Schneider | 2014-05-16 00:44:00 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-05-16 00:44:00 +0200 |
commit | 20a40ae90f6c0e4cac0345c57ac54f1bd671f633 (patch) | |
tree | f309be1cfe221d7e9fd8ecf2f5a7afaaad348576 /src/server/mainwindow/mainwindow.h | |
parent | Fix segmentation fault after looking all screens and there is one client disc... (diff) | |
download | pvs2-20a40ae90f6c0e4cac0345c57ac54f1bd671f633.tar.gz pvs2-20a40ae90f6c0e4cac0345c57ac54f1bd671f633.tar.xz pvs2-20a40ae90f6c0e4cac0345c57ac54f1bd671f633.zip |
Several changes:
* Change the messagebox text
* Add button stub for exclusiveStudentToTutor
* Split prepareProjection in broacast, unicast and exclusiveunicast (stub)
* Make multiple used, hardcoded strings static const member of mainwindow
* Replace multiple loops asking for selection and tutor by membervariable
* references to the connectionframe of the latter
* Complete missing error messages
Diffstat (limited to 'src/server/mainwindow/mainwindow.h')
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 4b9bf68..5dd177d 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -23,40 +23,43 @@ class MainWindow : public QMainWindow { Q_OBJECT +public: + + MainWindow(QString ipListUrl, QWidget *parent = 0); + ~MainWindow(); + private: - Ui::MainWindow *ui; + // Ui stuff + Ui::MainWindow *ui; SessionNameWindow *_sessionNameWindow; - QLabel *_sessionNameLabel; - - /** - * List of current clients in session. - */ - QList<ConnectionFrame*> _clientFrames; - int _tbIconSize; - Qt::ToolBarArea _tbArea; - int _tileWidth, _tileHeight; - int _timerId, _timerTimeout; - ListenServer *_listenServer; - DiscoveryListener *_discoveryListener; + QLabel *_sessionNameLabel; + int _tbIconSize; + Qt::ToolBarArea _tbArea; + int _tileWidth, _tileHeight; + ConnectionFrame *_tutorFrame, *_selectedFrame; + static const int _tilesX = 9; + static const int _tilesY = 7; // Button block stuff - QTimer * _buttonLockTimer; - QList<QAction*> _lockingButtons; + QTimer *_buttonLockTimer; + QList<QAction*> _lockingButtons; static const qint64 _buttonBlockTime = 600; - /** - * Downloader for IP - List of possible tutors. - */ - FileDownloader _fileDownloader; - - /** - * Stored List of possible tutor IPs. - */ - QStringList _tutorList; + // Internal stuff + QList<ConnectionFrame*> _clientFrames; + int _timerId, _timerTimeout; + ListenServer *_listenServer; + DiscoveryListener *_discoveryListener; + FileDownloader _fileDownloader; + QStringList _tutorList; - // Magic numbers - static const int _tilesX = 9; - static const int _tilesY = 7; + static const QString sStrTutorNdef; + static const QString sStrTutorOffline; + static const QString sStrSourceNdef; + static const QString sStrSourceOffline; + static const QString sStrDestNdef; + static const QString sStrDestOffline; + static const QString sStrSourceDestSame; void placeFrameInFreeSlot(ConnectionFrame* frame); ConnectionFrame* createFrame(); @@ -64,31 +67,32 @@ private: void savePosition(ConnectionFrame *cf); void prepareForProjection(Client * const from, Client * const to); bool isValidClient(Client* client); + void broadcast(Client *from); + void unicast(Client *from, Client *to); + void unicastExlusive(Client *from, Client *to); -public: - MainWindow(QString ipListUrl, QWidget *parent = 0); - ~MainWindow(); - -protected: void closeEvent(QCloseEvent *e); void changeEvent(QEvent *e); void resizeEvent(QResizeEvent *e); void mouseReleaseEvent(QMouseEvent* e); void timerEvent(QTimerEvent* event); + protected slots: - // This void onTutorListDownloaded(QByteArray& tutorList); void onSessionNameClick(); void onSessionNameUpdate(); void onButtonStudentToAll(); void onButtonStudentToTutor(); + void onButtonStudentToTutorExclusive(); void onButtonTutorToAll(); void onButtonTutorToStudent(); void onButtonStopProjection(); void onButtonLock(bool checked); void onButtonExit(); void onButtonSetAsTutor(); + void DisableButtons(); + void EnableButtons(); // connection frame void onPlaceFrame(ConnectionFrame* frame); void onFrameClicked(ConnectionFrame* frame); @@ -98,8 +102,5 @@ protected slots: void onClientAuthenticated(Client* client); void onVncServerStateChange(Client* client); void onVncClientStateChange(Client* client, int lastProjectionSource); - //Buttons - void DisableButtons(); - void EnableButtons(); }; #endif |