diff options
author | Björn Hagemeister | 2014-05-27 15:45:13 +0200 |
---|---|---|
committer | Björn Hagemeister | 2014-05-27 15:45:13 +0200 |
commit | 589eacb3f97f30e1929813a1f6e7a328141d4f18 (patch) | |
tree | 6b182c26dad101fe1f39f105304075f353178d35 /src/server/mainwindow | |
parent | Put the clients adaption to current class room situation into method. (diff) | |
download | pvs2-589eacb3f97f30e1929813a1f6e7a328141d4f18.tar.gz pvs2-589eacb3f97f30e1929813a1f6e7a328141d4f18.tar.xz pvs2-589eacb3f97f30e1929813a1f6e7a328141d4f18.zip |
Enable, to set locked client to tutor and unlock selected one afterwards.
Diffstat (limited to 'src/server/mainwindow')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
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) |