summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-04-22 16:56:37 +0200
committerBjörn Hagemeister2014-04-22 16:56:37 +0200
commitb8c0ce1032adface7eb20b4ecc8c1000eaaa9e65 (patch)
tree1014a33f430f7a80c7dffe2540696a454e393412 /src/server/mainwindow/mainwindow.cpp
parentMerge branch 'master' of dnbd3:pvs2 (diff)
downloadpvs2-b8c0ce1032adface7eb20b4ecc8c1000eaaa9e65.tar.gz
pvs2-b8c0ce1032adface7eb20b4ecc8c1000eaaa9e65.tar.xz
pvs2-b8c0ce1032adface7eb20b4ecc8c1000eaaa9e65.zip
New feature: Change or set tutor manually during session + URL of IP - List
of possible tutors, can be set in command line by starting server.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index b02cef8..cf2fe85 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -35,7 +35,7 @@
// Auto-generated ui class
#include "ui_mainwindow.h"
-MainWindow::MainWindow(QWidget* parent) :
+MainWindow::MainWindow(QString ipListUrl, QWidget* parent) :
QMainWindow(parent), ui(new Ui::MainWindow), _tbIconSize(24), _tbArea(Qt::LeftToolBarArea),
_buttonBlockTime(0)
@@ -61,8 +61,11 @@ MainWindow::MainWindow(QWidget* parent) :
ui->action_Lock->setStatusTip(tr("Lock or Unlock all Clients"));
// Initialize FileDownloader.
- _fileDownloader.connectSlot(this, SLOT(onTutorListDownloaded(QByteArray&)));
- _fileDownloader.downloadFile(QUrl("http://132.230.8.113/openslx/ips.txt"));
+ if (!ipListUrl.isEmpty())
+ {
+ _fileDownloader.connectSlot(this, SLOT(onTutorListDownloaded(QByteArray&)));
+ _fileDownloader.downloadFile(QUrl(ipListUrl));
+ }
// Close button in tool bar
connect(ui->action_Exit, SIGNAL(triggered()), this, SLOT(onButtonExit()));
@@ -71,6 +74,7 @@ MainWindow::MainWindow(QWidget* parent) :
connect(ui->action_StudentToTutor, SIGNAL(triggered()), this, SLOT(onButtonStudentToTutor()));
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_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()));
@@ -627,6 +631,22 @@ void MainWindow::onButtonExit()
this->close();
}
+void MainWindow::onButtonSetAsTutor()
+{
+ bool selected = false;
+ for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
+ {
+ selected = (*it)->selected();
+ if ((*it)->isTutor())
+ (*it)->setTutor(false);
+ if (selected)
+ {
+ // This frame is marked to be Tutor.
+ (*it)->setTutor(true);
+ }
+ }
+}
+
void MainWindow::onClientConnected(Client* client)
{
qDebug("ListenServer told MainWindow about new connection");