From b8c0ce1032adface7eb20b4ecc8c1000eaaa9e65 Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Tue, 22 Apr 2014 16:56:37 +0200 Subject: 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. --- src/server/mainwindow/mainwindow.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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::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"); -- cgit v1.2.3-55-g7522