From 589eacb3f97f30e1929813a1f6e7a328141d4f18 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 27 May 2014 15:45:13 +0200 Subject: Enable, to set locked client to tutor and unlock selected one afterwards. --- src/server/mainwindow/mainwindow.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 99339ba..35dbf0b 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -688,15 +688,25 @@ void MainWindow::onButtonExit() */ void MainWindow::onButtonSetAsTutor() { - // If same frame is already tutor, do nothing - if (_selectedFrame == _tutorFrame) + // If no frame is selected, warning. + if (_selectedFrame == NULL) + { + QMessageBox::critical(this, tr("Selection"), tr("No client is selected.")); return; + } - // If a frame has been selected unselect it - if (_selectedFrame->client() == NULL){ + // If frame of inactive client has been selected unselect it + if (_selectedFrame->client() == NULL) + { QMessageBox::critical(this, tr("Selection"), tr("The selected client is not connected.")); return; } + else // If selected client is locked, first unlock + _selectedFrame->client()->lockScreen(false); + + // If same frame is already tutor, do nothing + if (_selectedFrame == _tutorFrame) + return; // Else unset the old and set the new tutor if (_tutorFrame != NULL) -- cgit v1.2.3-55-g7522