diff options
author | Björn Hagemeister | 2014-06-03 16:31:14 +0200 |
---|---|---|
committer | Björn Hagemeister | 2014-06-03 16:31:14 +0200 |
commit | f5d4f89041bc33501cdb0fe5c727bcff8e3503a2 (patch) | |
tree | dfc4c0eb34c9737e5b47c482c5c2be869c1a04ef | |
parent | Removed _watchers List. (diff) | |
parent | Merge branch 'master' of git.openslx.org:pvs2 (diff) | |
download | pvs2-f5d4f89041bc33501cdb0fe5c727bcff8e3503a2.tar.gz pvs2-f5d4f89041bc33501cdb0fe5c727bcff8e3503a2.tar.xz pvs2-f5d4f89041bc33501cdb0fe5c727bcff8e3503a2.zip |
Merge branch 'master' of git.openslx.org:pvs2
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 19 | ||||
-rw-r--r-- | src/server/mainwindow/mainwindow.h | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 58da462..a6c90c0 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -103,9 +103,12 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : /* Stuff for the button lock */ + //Setup a timeout _buttonLockTimer = new QTimer(this); _buttonLockTimer->setSingleShot(true); _buttonLockTimer->setInterval(_buttonBlockTime); + connect(_buttonLockTimer, SIGNAL(timeout()), this, SLOT(EnableButtons())); + // Define the locking buttons _lockingButtons << ui->action_Lock << ui->action_BroadcastScreen @@ -114,15 +117,6 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : << ui->action_TutorToStudent << ui->action_StopProjection << ui->action_SetAsTutor; - // Disable the buttons if a button is clicked - foreach (QAction* a, _lockingButtons) - connect(a, SIGNAL(triggered()), this, SLOT(DisableButtons())); - // Start the timer a button is clicked - foreach (QAction* a, _lockingButtons) - connect(a, SIGNAL(triggered()), _buttonLockTimer, SLOT(start())); - // Enable the buttons if the timer fires - connect(_buttonLockTimer, SIGNAL(timeout()), this, SLOT(EnableButtons())); - // Clicking the session name label shows the edit field for it connect(_sessionNameLabel, SIGNAL(clicked()), this, SLOT(onSessionNameClick())); @@ -488,6 +482,8 @@ void MainWindow::onSessionNameUpdate() */ void MainWindow::changeProjection(Client *from, Mode mode, Client *to) { + DisableButtons(); + if (mode == Mode::Broadcast) { // Set all clients as watchers @@ -886,6 +882,9 @@ void MainWindow::onClientAuthenticated(Client* client) */ void MainWindow::onVncServerStateChange(Client* client) { + if (client == _streamingSource) + EnableButtons(); + if (client->isActiveVncServer()) { if (_mode == Mode::Broadcast) @@ -985,6 +984,7 @@ void MainWindow::onVncClientStateChange(Client* client) */ void MainWindow::DisableButtons() { + _buttonLockTimer->start(); foreach (QAction* a, _lockingButtons) a->setDisabled(true); } @@ -994,6 +994,7 @@ void MainWindow::DisableButtons() */ void MainWindow::EnableButtons() { + _buttonLockTimer->stop(); foreach (QAction* a, _lockingButtons) a->setEnabled(true); } diff --git a/src/server/mainwindow/mainwindow.h b/src/server/mainwindow/mainwindow.h index b75d082..fffa49a 100644 --- a/src/server/mainwindow/mainwindow.h +++ b/src/server/mainwindow/mainwindow.h @@ -46,7 +46,7 @@ private: // Button block stuff QTimer *_buttonLockTimer; QList<QAction*> _lockingButtons; - static const qint64 _buttonBlockTime = 600; + static const qint64 _buttonBlockTime = 2000; // Management stuff enum class Mode { |