summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/mainwindow/mainwindow.cpp19
-rw-r--r--src/server/mainwindow/mainwindow.h2
2 files changed, 11 insertions, 10 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 489800f..28177d6 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()));
@@ -474,6 +468,8 @@ void MainWindow::onSessionNameUpdate()
*/
void MainWindow::changeProjection(Client *from, Mode mode, Client *to)
{
+ DisableButtons();
+
if (mode == Mode::Broadcast)
{
// Set all clients as watchers
@@ -853,6 +849,9 @@ void MainWindow::onClientAuthenticated(Client* client)
*/
void MainWindow::onVncServerStateChange(Client* client)
{
+ if (client == _streamingSource)
+ EnableButtons();
+
if (client->isActiveVncServer())
{
if (_mode == Mode::Broadcast)
@@ -931,6 +930,7 @@ void MainWindow::onVncClientStateChange(Client* client)
*/
void MainWindow::DisableButtons()
{
+ _buttonLockTimer->start();
foreach (QAction* a, _lockingButtons)
a->setDisabled(true);
}
@@ -940,6 +940,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 7297f6d..ad8c43f 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 {