diff options
| author | Sebastien Braun | 2010-11-10 01:47:26 +0100 |
|---|---|---|
| committer | Sebastien Braun | 2010-11-10 01:47:26 +0100 |
| commit | b2c87269579df6cdd10e4419e0817d6d829a302e (patch) | |
| tree | 70d93ceb460dc34b851fe928eedd71a8fffe1f6a /src/gui/processesDialog.cpp | |
| parent | Add Makefile to generate PDF from DIA figures and call pdflatex and (diff) | |
| parent | Merge branch 'master' of openslx.org:pvs (diff) | |
| download | pvs-b2c87269579df6cdd10e4419e0817d6d829a302e.tar.gz pvs-b2c87269579df6cdd10e4419e0817d6d829a302e.tar.xz pvs-b2c87269579df6cdd10e4419e0817d6d829a302e.zip | |
Merge branch 'master' of ssh://git.openslx.org/pvs
Diffstat (limited to 'src/gui/processesDialog.cpp')
| -rw-r--r-- | src/gui/processesDialog.cpp | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/src/gui/processesDialog.cpp b/src/gui/processesDialog.cpp index cda76ea..7c0405c 100644 --- a/src/gui/processesDialog.cpp +++ b/src/gui/processesDialog.cpp @@ -1,5 +1,5 @@ /* -# Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg +# Copyright (c) 2010 - OpenSLX Project, Computer Center University of Freiburg # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING @@ -17,9 +17,8 @@ #include "processesDialog.h" #include "ui_processesDialog.h" #include <src/gui/processWidget.h> -//#include <src/gui/mainWindow.h> -ProcessDialog::ProcessDialog(QDialog *parent) : +ProcessDialog::ProcessDialog(QDialog *parent, int displayedClientNameEnum) : QDialog(parent), procui(new Ui::ProcessesDialog) { @@ -28,6 +27,7 @@ ProcessDialog::ProcessDialog(QDialog *parent) : tWidget = new QTabWidget; procui->grLayout->addWidget(tWidget); + //if we click on another tab we refresh the list of this client connect( tWidget, SIGNAL( currentChanged(int)), this, SLOT( currChanged())); std::list<PVSClient*> listAll = @@ -35,23 +35,38 @@ ProcessDialog::ProcessDialog(QDialog *parent) : for (std::list<PVSClient*>::iterator it = listAll.begin(); it != listAll.end(); it++) { - if (*it == NULL || (*it)->getConnectionFrame() == NULL) continue; - if ((*it)->getConnectionFrame()->getFrame() && - /*!(*it)->getConnectionFrame()->getFrame()->isDozent() &&*/ - (*it)->getVNCConnection()) + //display ip/login name/user name the same way we do in our clientlist + switch (displayedClientNameEnum) + { + case 1: + tWidget->addTab(new ProcessWidget(0, *it), (*it)->getIp()); + break; + case 2: + tWidget->addTab(new ProcessWidget(0, *it), (*it)->getLoginName()); + break; + default: tWidget->addTab(new ProcessWidget(0, *it), (*it)->getUserName()); - else if (!(*it)->getConnectionFrame()->getFrame()) - ConsoleLog writeError(QString("The Frame connection from client: "). - append((*it)->getConnectionFrame()->getTaskbarTitle()). - append(QString(" is corrupted. Reconnect the client it again."))); + break; + } } + + QTimer *refreshTimer = new QTimer(this); + connect(refreshTimer, SIGNAL(timeout()), this, SLOT(currRefr())); + refreshTimer->start(5000); + } // if other Tab is activated we say our tab to refresh the processList void ProcessDialog::currChanged() { ProcessWidget *temp = static_cast<ProcessWidget*>(tWidget->currentWidget()); - temp->refrProcessList(); + temp->refrProcessList(false); +} + +void ProcessDialog::currRefr() +{ + ProcessWidget *temp = static_cast<ProcessWidget*>(tWidget->currentWidget()); + temp->refrProcessList(true); } ProcessDialog::~ProcessDialog() |
