diff options
author | Manuel Schneider | 2014-04-24 16:33:26 +0200 |
---|---|---|
committer | Manuel Schneider | 2014-04-24 16:33:26 +0200 |
commit | f6b3c21e5a3ea0307a87a9d7a471ae834145151a (patch) | |
tree | af2c6ece72e68ecdd6bce5bd8bcd66ba1d06c119 /src/server/mainwindow/mainwindow.h | |
parent | Doxygen comments, removed incomplete unused event handling for VNC RW access,... (diff) | |
download | pvs2-f6b3c21e5a3ea0307a87a9d7a471ae834145151a.tar.gz pvs2-f6b3c21e5a3ea0307a87a9d7a471ae834145151a.tar.xz pvs2-f6b3c21e5a3ea0307a87a9d7a471ae834145151a.zip |
Reduced button block code. Moved some magic number to header.
Diffstat (limited to 'src/server/mainwindow/mainwindow.h')
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index 2bba8c3..4b23ae7 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -18,46 +18,49 @@ namespace Ui class MainWindow : public QMainWindow { - Q_OBJECT + Q_OBJECT private: - Ui::MainWindow *ui; - SessionNameWindow *_sessionNameWindow; - QLabel *_sessionNameLabel; - QList<ConnectionFrame*> _clientFrames; - int _tileWidth, _tileHeight; - int _tilesX, _tilesY; - int _tbIconSize; - Qt::ToolBarArea _tbArea; - int _timerId, _timerTimeout; - ListenServer *_listenServer; - DiscoveryListener *_discoveryListener; - qint64 _buttonBlockTime; - FileDownloader _fileDownloader; - QStringList _tutorList; + Ui::MainWindow *ui; + SessionNameWindow *_sessionNameWindow; + QLabel *_sessionNameLabel; + QList<ConnectionFrame*> _clientFrames; + int _tbIconSize; + Qt::ToolBarArea _tbArea; + int _tileWidth, _tileHeight; + int _timerId, _timerTimeout; + ListenServer *_listenServer; + DiscoveryListener *_discoveryListener; + FileDownloader _fileDownloader; + QStringList _tutorList; - void placeFrameInFreeSlot(ConnectionFrame* frame); - ConnectionFrame* createFrame(); - bool loadPosition(QSettings& settings, const QString& id, int& x, int& y); - void savePosition(ConnectionFrame *cf); - void prepareForProjection(Client * const from, Client * const to); - bool isValidClient(Client* client); + // Magic numbers + static const qint64 _buttonBlockTime = 1000; + static const int _tilesX = 9; + static const int _tilesY = 7; + + void placeFrameInFreeSlot(ConnectionFrame* frame); + ConnectionFrame* createFrame(); + bool loadPosition(QSettings& settings, const QString& id, int& x, int& y); + void savePosition(ConnectionFrame *cf); + void prepareForProjection(Client * const from, Client * const to); + bool isValidClient(Client* client); + bool areButtonsBlocked(); public: - MainWindow(QString ipListUrl, QWidget *parent = 0); - ~MainWindow(); + 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); - + 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 onTutorListDownloaded(QByteArray& tutorList); void onSessionNameClick(); void onSessionNameUpdate(); void onButtonSettings(); @@ -79,8 +82,5 @@ protected slots: void onClientAuthenticated(Client* client); void onVncServerStateChange(Client* client); void onVncClientStateChange(Client* client, int lastProjectionSource); - }; - - #endif |