summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp19
1 files changed, 10 insertions, 9 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);
}