From 7913223f2c35bf69af68d28d2f11dde158c94e73 Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Thu, 19 May 2016 18:17:52 +0200 Subject: added --manager-only (and removed the ipList-feature) --- src/server/mainwindow/mainwindow.cpp | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 6d8d02f..c7d8a9e 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -38,6 +38,7 @@ #include "ui_mainwindow.h" #include "ui_reloadroom.h" +#include #include #define sStrTutorNdef MainWindow::tr("No tutor defined.") @@ -51,15 +52,18 @@ #define sStrNoDestAv MainWindow::tr("No projection destination available.") using std::vector; +using std::cout; +using std::endl; /***************************************************************************//** * Initialize MainWindow and ListenServer. * @param ipListUrl * @param parent */ -MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : +MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWindow), _tbIconSize(24), _tbArea(Qt::LeftToolBarArea) { + qDebug() << "MainWindow(parent)"; _mode = Mode::Multicast; _streamingSource = 0; @@ -95,12 +99,6 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) : ui->action_Exit->setStatusTip(tr("Exit")); ui->action_Lock->setStatusTip(tr("Lock or Unlock all Clients")); - // Initialize FileDownloader. - 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())); @@ -371,6 +369,7 @@ QSize minimalGridSize(const QMap& clientPositions, QSize& clien */ void MainWindow::tryToUseRoomTemplate() { + qDebug() << "tryToUseRoomTemplate()"; QMap roomsList; SYSTEM_SETTINGS(conf); @@ -433,9 +432,16 @@ void MainWindow::tryToUseRoomTemplate() roomsList.insert(roomName, r); } Global::setRooms(roomsList); - if (myRoom != "") { + if (myRoom == "") { + /* so apparently this is not a manager of a room */ + if (Global::manager_only) { + cout << "exiting because of the argument --manager-only was set and this computer is not a manager" << endl; + exit(0); + } + } else { switchRoomTo(myRoom); } + } /***************************************************************************//** @@ -650,18 +656,6 @@ void MainWindow::reset() * Slots */ -/***************************************************************************//** - * Extract information from downloaded tutorList. - * Split downloaded file by new line and store IPs in _tutorList. - * @param tutorList - */ -void MainWindow::onTutorListDownloaded(QByteArray& tutorList) -{ - QString data = QString::fromUtf8(tutorList.constData(), tutorList.size()); - _tutorList = data.split(QRegExp("[\r\n]"),QString::SkipEmptyParts); - qDebug() << _tutorList; -} - /***************************************************************************//** * Place Frame to from user specified position. -- cgit v1.2.3-55-g7522