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.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)