diff options
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 26 |
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"); |