summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-05-27 15:45:13 +0200
committerBjörn Hagemeister2014-05-27 15:45:13 +0200
commit589eacb3f97f30e1929813a1f6e7a328141d4f18 (patch)
tree6b182c26dad101fe1f39f105304075f353178d35 /src/server/mainwindow/mainwindow.cpp
parentPut the clients adaption to current class room situation into method. (diff)
downloadpvs2-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/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp18
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)