From 4b243af3de3ff2534a0d87225f52074490bdf8fd Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Sat, 4 Jun 2011 12:36:31 +0200 Subject: Enhancement #831 --- src/gui/connectionFrame.cpp | 5 +++++ src/gui/connectionFrame.h | 1 + src/gui/connectionList.cpp | 14 ++++++-------- src/gui/projectionDialog.cpp | 8 ++++++++ 4 files changed, 20 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gui/connectionFrame.cpp b/src/gui/connectionFrame.cpp index 32e20f7..f927706 100644 --- a/src/gui/connectionFrame.cpp +++ b/src/gui/connectionFrame.cpp @@ -490,6 +490,11 @@ void ConnectionFrame::setDozent(bool isDozent) _dozentContaimner->setDisabled(true); } +bool ConnectionFrame::isDozent() +{ + return _dozentContaimner->isEnabled(); +} + void ConnectionFrame::on_click() { //std::cout << "HALLO! WAS?" << std::endl; diff --git a/src/gui/connectionFrame.h b/src/gui/connectionFrame.h index fe6dc95..3b6d49a 100644 --- a/src/gui/connectionFrame.h +++ b/src/gui/connectionFrame.h @@ -49,6 +49,7 @@ public: void setInitSize(int w, int h); void Resize(int w, int h); void initFrame(); + bool isDozent(); int getPrevWidth(){return prev_width;}; void setPrevWidth(int w){prev_width = w;} diff --git a/src/gui/connectionList.cpp b/src/gui/connectionList.cpp index f0fb7d6..991ad26 100644 --- a/src/gui/connectionList.cpp +++ b/src/gui/connectionList.cpp @@ -571,16 +571,14 @@ QList ConnectionList::getTargetToDisplay(QString source) projectList.clear(); for (int i=0; irowCount(QModelIndex()); i++) - { - QString item = model->index(i, 1, QModelIndex()).data(Qt::DisplayRole).toString(); - if (item.compare(source) != 0 && !targetList.contains(item) && !sourceList.contains(item)) - { + { + QString item = model->index(i, 1, QModelIndex()).data(Qt::DisplayRole).toString(); + if (item.compare(source) != 0 && !targetList.contains(item) && !sourceList.contains(item)) + { displayList.append(item); - } - } - + } + } return displayList; - } void ConnectionList::addTargetToProjectList(QString name) diff --git a/src/gui/projectionDialog.cpp b/src/gui/projectionDialog.cpp index c091f54..5339df0 100644 --- a/src/gui/projectionDialog.cpp +++ b/src/gui/projectionDialog.cpp @@ -51,9 +51,17 @@ void ProjectionDialog::setupContent(QList content) { if (!content.isEmpty()) { + // get a list of all dozent machines + QStringList dozentList; + QList clients = MainWindow::getConnectionWindow()->getAllFrameOnWindow(); + foreach (ConnectionFrame *client, clients) + if (client->isDozent()) + dozentList.append(client->getTaskbarTitle()); + QString item; foreach(item, content) { + if (dozentList.contains(item)) item.append(" (Tutor PC)"); QCheckBox *checkbox = new QCheckBox(item,this); pui->verticalLayout_2->addWidget(checkbox); checkList.push_back(checkbox); -- cgit v1.2.3-55-g7522