summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-04-22 18:10:02 +0200
committerBjörn Hagemeister2014-04-22 18:10:02 +0200
commitee41007d0f1ada7019d830960eea7d79df35fa0a (patch)
treed7b6c7b5d772e04272cf7c86fb2f3da9a5a38052 /src/server/mainwindow/mainwindow.cpp
parentMerge branch 'master' of git.openslx.org:pvs2 (diff)
downloadpvs2-ee41007d0f1ada7019d830960eea7d79df35fa0a.tar.gz
pvs2-ee41007d0f1ada7019d830960eea7d79df35fa0a.tar.xz
pvs2-ee41007d0f1ada7019d830960eea7d79df35fa0a.zip
Fixed, that inactive Client can be manually choosen as Tutor.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index cf2fe85..e3b7952 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -75,6 +75,7 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) :
connect(ui->action_TutorToStudent, SIGNAL(triggered()), this, SLOT(onButtonTutorToStudent()));
connect(ui->action_StopProjection, SIGNAL(triggered()), this, SLOT(onButtonStopProjection()));
connect(ui->action_SetAsTutor, SIGNAL(triggered()), this, SLOT(onButtonSetAsTutor()));
+ connect(ui->action_SetAsTutor, SIGNAL(triggered()), this, SLOT(onButtonStopProjection()));
connect(ui->action_Lock, SIGNAL(toggled(bool)), this, SLOT(onButtonLock(bool)));
// Clicking the session name label shows the edit field for it
connect(_sessionNameLabel, SIGNAL(clicked()), this, SLOT(onSessionNameClick()));
@@ -634,17 +635,26 @@ void MainWindow::onButtonExit()
void MainWindow::onButtonSetAsTutor()
{
bool selected = false;
+ ConnectionFrame *oldTutor = NULL;
+ bool changedTutor = false;
for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
{
selected = (*it)->selected();
- if ((*it)->isTutor())
+ if (!selected && (*it)->isTutor())
+ {
+ oldTutor = (*it);
(*it)->setTutor(false);
- if (selected)
+ }
+ if (selected && ((*it)->client() != NULL))
{
// This frame is marked to be Tutor.
(*it)->setTutor(true);
+ changedTutor = true;
}
}
+ if (!changedTutor && oldTutor != NULL) {
+ oldTutor->setTutor(true);
+ }
}
void MainWindow::onClientConnected(Client* client)
@@ -715,7 +725,7 @@ void MainWindow::onClientAuthenticated(Client* client)
for (int i = 0; i < _tutorList.size(); i++)
{
// Check if client is possible tutor
- if (client->computerId()== _tutorList[i])
+ if (client->computerId() == _tutorList[i])
{
isTutor = true;
break;